Merge branch 'main' of https://git.thomasfamily.duckdns.org/cognito-forms/cognitoforms-wordpress
This commit is contained in:
commit
1f21469bce
|
@ -1,16 +1,16 @@
|
||||||
trigger:
|
trigger:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: 'ubuntu-latest'
|
vmImage: 'ubuntu-latest'
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- script: yarn install
|
- script: yarn install
|
||||||
displayName: 🛠️ Install Dependencies
|
displayName: 🛠️ Install Dependencies
|
||||||
- script: yarn build
|
- script: yarn build
|
||||||
displayName: 🚀 Build Plugin
|
displayName: 🚀 Build Plugin
|
||||||
- task: PublishPipelineArtifact@1
|
- task: PublishPipelineArtifact@1
|
||||||
displayName: 📦 Create Artifact
|
displayName: 📦 Create Artifact
|
||||||
inputs:
|
inputs:
|
||||||
targetPath: $(System.DefaultWorkingDirectory)
|
targetPath: $(System.DefaultWorkingDirectory)
|
||||||
artifactName: CognitoFormsPlugin
|
artifactName: CognitoFormsPlugin
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
{
|
||||||
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
||||||
|
"apiVersion": 2,
|
||||||
|
"name": "cognito-forms/cognito-embed",
|
||||||
|
"title": "Cognito Forms",
|
||||||
|
"description": "Easily build powerful forms.",
|
||||||
|
"category": "embed",
|
||||||
|
"supports": {
|
||||||
|
"html": false
|
||||||
|
},
|
||||||
|
"attributes": {
|
||||||
|
"formId": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"seamlessEmbedCode": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"iframeEmbedCode": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"ampEmbedCode": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"embedMode": {
|
||||||
|
"type": "number"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -6,12 +6,15 @@ import { Modal, FocusableIframe } from '@wordpress/components';
|
||||||
|
|
||||||
import { baseUrl } from '@/globals';
|
import { baseUrl } from '@/globals';
|
||||||
|
|
||||||
type DialogProps = {
|
interface IDialogProps {
|
||||||
setOpen: Function;
|
setOpen: Function;
|
||||||
onSelectForm: Function;
|
onSelectForm: Function;
|
||||||
};
|
}
|
||||||
|
|
||||||
class SelectDialog extends React.Component<DialogProps> {
|
interface IDialogState {
|
||||||
|
}
|
||||||
|
|
||||||
|
class SelectDialog extends React.Component<IDialogProps, IDialogState> {
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
window.addEventListener( 'message', this.handlePostMessage, false );
|
window.addEventListener( 'message', this.handlePostMessage, false );
|
||||||
}
|
}
|
||||||
|
@ -25,7 +28,7 @@ class SelectDialog extends React.Component<DialogProps> {
|
||||||
this.props.onSelectForm( event.data );
|
this.props.onSelectForm( event.data );
|
||||||
this.props.setOpen( false );
|
this.props.setOpen( false );
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
export const baseUrl: string = 'https://forms.cognito.test';
|
export const baseUrl = 'https://forms.cognito.test';
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
export enum EmbedMode {
|
export enum EmbedMode {
|
||||||
Seamless,
|
Seamless,
|
||||||
IFrame
|
IFrame,
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface BlockAttributes {
|
export interface BlockAttributes {
|
||||||
formId: string,
|
formId: string;
|
||||||
iframeEmbedCode: string;
|
iframeEmbedCode: string;
|
||||||
seamlessEmbedCode: string;
|
seamlessEmbedCode: string;
|
||||||
ampEmbedCode: string;
|
ampEmbedCode: string;
|
||||||
|
|
Loading…
Reference in New Issue