@nocobase/plugin-block-iframe 1.3.53 → 1.3.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/index.js +1 -1
- package/dist/externalVersion.js +5 -5
- package/package.json +2 -2
package/dist/client/index.js
CHANGED
|
@@ -11,4 +11,4 @@
|
|
|
11
11
|
object-assign
|
|
12
12
|
(c) Sindre Sorhus
|
|
13
13
|
@license MIT
|
|
14
|
-
*/var G=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;function te(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function re(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},t=0;t<10;t++)a["_"+String.fromCharCode(t)]=t;var l=Object.getOwnPropertyNames(a).map(function(h){return a[h]});if(l.join("")!=="0123456789")return!1;var s={};return"abcdefghijklmnopqrst".split("").forEach(function(h){s[h]=h}),Object.keys(Object.assign({},s)).join("")==="abcdefghijklmnopqrst"}catch(h){return!1}}var ne=re()?Object.assign:function(o,a){for(var t,l=te(o),s,h=1;h<arguments.length;h++){t=Object(arguments[h]);for(var k in t)Z.call(t,k)&&(l[k]=t[k]);if(G){s=G(t);for(var y=0;y<s.length;y++)ee.call(t,s[y])&&(l[s[y]]=t[s[y]])}}return l};const oe=Y(ne),ae=({url:o,allowFullScreen:a,position:t,display:l,height:s,width:h,overflow:k,styles:y,onLoad:w,onMouseOver:M,onMouseOut:T,scrolling:I,id:F,frameBorder:C,ariaHidden:P,sandbox:x,allow:i,className:m,title:u,ariaLabel:c,ariaLabelledby:b,name:f,target:d,loading:p,importance:A,referrerpolicy:V,allowpaymentrequest:ue,src:pe,key:fe})=>{const D=oe({src:pe||o,target:d||null,style:{position:t||null,display:l||"initial",overflow:k||null},scrolling:I||null,allowpaymentrequest:ue||null,importance:A||null,sandbox:x&&[...x].join(" ")||null,loading:p||null,styles:y||null,name:f||null,className:m||null,allowFullScreen:"allowFullScreen",referrerpolicy:V||null,title:u||null,allow:i||null,id:F||null,"aria-labelledby":b||null,"aria-hidden":P||null,"aria-label":c||null,width:h||null,height:s||null,onLoad:w||null,onMouseOver:M||null,onMouseOut:T||null,key:fe||"iframe"});let g=Object.create(null);for(let v of Object.keys(D))D[v]!=null&&(g[v]=D[v]);for(let v of Object.keys(g.style))g.style[v]==null&&delete g.style[v];if(g.styles)for(let v of Object.keys(g.styles))g.styles.hasOwnProperty(v)&&(g.style[v]=g.styles[v]),Object.keys(g.styles).pop()==v&&delete g.styles;if(a)if("allow"in g){const v=g.allow.replace("fullscreen","");g.allow=`fullscreen ${v.trim()}`.trim()}else g.allow="fullscreen";return C>=0&&(g.style.hasOwnProperty("border")||(g.style.border=C)),N.createElement("iframe",Object.assign({},g))},se=()=>{const o=j.useField(),a=j.useFieldSchema(),{t}=q.useTranslation(),{dn:l}=e.useDesignable(),s=e.useAPIClient(),{mode:h,url:k,htmlId:y,height:w="60vh",engine:M}=a["x-component-props"]||{},T=x=>H(this,null,function*(){var m,u,c,b,f;const i={values:{html:x}};if(y){const{data:d}=yield(u=(m=s.resource("iframeHtml")).update)==null?void 0:u.call(m,L(O({},i),{filterByTk:y}));return((c=d==null?void 0:d.data)==null?void 0:c[0])||{id:y}}else{const{data:d}=yield(f=(b=s.resource("iframeHtml")).create)==null?void 0:f.call(b,i);return d==null?void 0:d.data}}),I=b=>H(this,[b],function*({mode:x,url:i,html:m,height:u,engine:c}){const f=a["x-component-props"]||{};if(f.mode=x,f.height=u,f.url=i,f.engine=c||"string",x==="html"){const d=yield T(m);f.htmlId=d.id}a["x-component-props"]=f,o.componentProps=O({},f),o.data={v:B.uid()},l.emit("patch",{schema:{"x-uid":a["x-uid"],"x-component-props":f}})}),{form:F}=e.useFormBlockContext(),C=e.useRecord(),P=e.useVariableOptions({collectionField:{uiSchema:a},form:F,record:C,uiSchema:a,noDisabled:!0});return n.jsxs(e.GeneralSchemaDesigner,{children:[n.jsx(e.SchemaSettingsModalItem,{title:t("Edit iframe"),asyncGetInitialValues:()=>H(this,null,function*(){var i,m,u;const x={mode:h,url:k,height:w};if(y){const{data:c}=yield(m=(i=s.resource("iframeHtml")).get)==null?void 0:m.call(i,{filterByTk:y});x.html=((u=c==null?void 0:c.data)==null?void 0:u.html)||""}return x}),schema:{type:"object",title:t("Edit iframe"),properties:{mode:{title:'{{t("Mode")}}',"x-component":"Radio.Group","x-decorator":"FormItem",required:!0,default:"url",enum:[{value:"url",label:t("URL")},{value:"html",label:t("HTML")}]},url:{title:t("URL"),type:"string","x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:P},required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},engine:{title:'{{t("Template engine")}}',"x-component":"Radio.Group","x-decorator":"FormItem",enum:[{value:"string",label:t("String template")},{value:"handlebars",label:t("Handlebars")}],"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:P,style:{minHeight:"200px"}},required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},height:{title:t("Height"),type:"string","x-decorator":"FormItem","x-component":"Input",required:!0}}},onSubmit:I}),n.jsx(e.SchemaSettingsDivider,{}),n.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};function $(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))}const R=j.observer(o=>{const b=o,{url:a,htmlId:t,mode:l="url",height:s,html:h,params:k,engine:y}=b,w=X(b,["url","htmlId","mode","height","html","params","engine"]),M=j.useField(),{t:T}=q.useTranslation(),I=e.useBlockHeight()||s,F=e.useVariables(),C=e.useLocalVariables(),P=e.useCompile(),{loading:x,data:i}=e.useRequest({url:`iframeHtml:getHtml/${t}`},{refreshDeps:[t,M.data],ready:l==="html"&&!!t}),{parseURLAndParams:m}=e.useParseURLAndParams(),[u,c]=N.useState(null);return N.useEffect(()=>{H(this,null,function*(){if(l==="html"){const d=yield e.getRenderContent(y,i,P(F),P(C),V=>V);if(d===void 0)return;const A="data:text/html;charset=utf-8,"+encodeURIComponent(d);c(A)}else try{const d=yield m(a,k||[]);c(d)}catch(d){console.error("Error fetching target URL:",d),c("fallback-url")}})},[i,l,a,F,C,k]),l==="url"&&!a||l==="html"&&!t?n.jsx(E.Card,{style:{marginBottom:24,height:$(I)?`${I}px`:I},children:T("Please fill in the iframe URL")}):x&&!u?n.jsx("div",{style:{height:$(I)?`${I}px`:I||"60vh",marginBottom:"24px",border:0},children:n.jsx(E.Spin,{})}):n.jsx(ae,O({url:u,width:"100%",display:"block",position:"relative",styles:{height:$(I)?`${I}px`:I||"60vh",marginBottom:"24px",border:0}},w))},{displayName:"Iframe"});R.Designer=se;const ie=()=>{const{insert:o}=e.useSchemaInitializer(),a=e.useSchemaInitializerItem();return n.jsx(e.SchemaInitializerItem,L(O({},a),{icon:n.jsx(z.FormOutlined,{}),onClick:()=>{o({type:"void","x-settings":"blockSettings:iframe","x-decorator":"BlockItem","x-decorator-props":{name:"iframe"},"x-component":"Iframe","x-component-props":{}})}}))},le=o=>n.jsx(e.SchemaComponentOptions,{components:{Iframe:R,IframeBlockInitializer:ie,ArrayItems:S.ArrayItems},children:o.children}),ce=o=>a=>{const t=j.useFieldSchema(),{form:l}=e.useFormBlockContext(),s=e.useRecord(),h=e.useVariableOptions({collectionField:{uiSchema:t},form:l,record:s,uiSchema:t,noDisabled:!0});return n.jsx(o,L(O({},a),{scope:h}))},_={items:[{name:"EditIframe",type:"modal",useComponentProps(){const o=j.useField(),a=j.useFieldSchema(),{t}=q.useTranslation(),{dn:l}=e.useDesignable(),s=e.useAPIClient(),{mode:h,url:k,params:y,htmlId:w,height:M="60vh",engine:T}=a["x-component-props"]||{},I=i=>H(this,null,function*(){var u,c,b,f,d;const m={values:{html:i}};if(w){const{data:p}=yield(c=(u=s.resource("iframeHtml")).update)==null?void 0:c.call(u,L(O({},m),{filterByTk:w}));return((b=p==null?void 0:p.data)==null?void 0:b[0])||{id:w}}else{const{data:p}=yield(d=(f=s.resource("iframeHtml")).create)==null?void 0:d.call(f,m);return p==null?void 0:p.data}}),{urlSchema:F,paramsSchema:C}=e.useURLAndHTMLSchema(),P=d=>H(this,[d],function*({mode:i,url:m,html:u,height:c,params:b,engine:f}){const p=a["x-component-props"]||{};if(p.mode=i,p.height=c,p.engine=f||"string",p.params=b,p.url=m,i==="html"){const A=yield I(u);p.htmlId=A.id}a["x-component-props"]=p,o.componentProps=O({},p),o.data={v:B.uid()},l.emit("patch",{schema:{"x-uid":a["x-uid"],"x-component-props":p}})}),x=n.jsxs(n.Fragment,{children:[n.jsxs("span",{style:{marginLeft:".25em"},className:"ant-formily-item-extra",children:[t("Syntax references"),":"]}),n.jsx("a",{href:"https://handlebarsjs.com/guide/",target:"_blank",rel:"noreferrer",children:"Handlebars.js"})]});return{title:t("Edit iframe"),asyncGetInitialValues:()=>H(this,null,function*(){var m,u,c;const i={mode:h,url:k,height:M,engine:T,params:y};if(w){const{data:b}=yield(u=(m=s.resource("iframeHtml")).get)==null?void 0:u.call(m,{filterByTk:w});i.html=((c=b==null?void 0:b.data)==null?void 0:c.html)||""}return i}),schema:{type:"object",title:t("Edit iframe"),properties:{mode:{title:'{{t("Mode")}}',"x-component":"Radio.Group","x-decorator":"FormItem",required:!0,default:"url",enum:[{value:"url",label:t("URL")},{value:"html",label:t("HTML")}]},url:L(O({},F),{required:!0}),params:C,engine:{title:'{{t("Template engine")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"string",enum:[{value:"string",label:t("String template")},{value:"handlebars",label:t("Handlebars")}],"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":ce(e.Variable.RawTextArea),"x-component-props":{rows:10},required:!0,description:x,"x-reactions":[{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}},i=>{const{engine:m}=i.form.values;m==="handlebars"?i.description=x:i.description=null}]}}},onSubmit:P,noRecord:!0}}},{name:"setTheBlockHeight",Component:e.SchemaSettingsBlockHeightItem},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]},me=new e.SchemaSettings(O({name:"iframeBlockSchemaSettings"},_)),de=new e.SchemaSettings(O({name:"blockSettings:iframe"},_));class W extends e.Plugin{load(){return H(this,null,function*(){this.app.schemaSettingsManager.add(me),this.app.schemaSettingsManager.add(de),this.app.use(le);const a=this.app.schemaInitializerManager.get("page:addBlock");a==null||a.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"});const t=this.app.schemaInitializerManager.get("popup:addNew:addBlock");t==null||t.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"});const l=this.app.schemaInitializerManager.get("popup:common:addBlock");l==null||l.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"});const s=this.app.schemaInitializerManager.get("RecordFormBlockInitializers");s==null||s.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"}),this.app.schemaInitializerManager.addItem("mobilePage:addBlock","otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"}),this.app.schemaInitializerManager.addItem("mobile:addBlock","otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"})})}}r.PluginBlockIframeClient=W,r.default=W,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
14
|
+
*/var G=Object.getOwnPropertySymbols,Z=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;function te(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function re(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var a={},t=0;t<10;t++)a["_"+String.fromCharCode(t)]=t;var l=Object.getOwnPropertyNames(a).map(function(h){return a[h]});if(l.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(h){i[h]=h}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(h){return!1}}var ne=re()?Object.assign:function(o,a){for(var t,l=te(o),i,h=1;h<arguments.length;h++){t=Object(arguments[h]);for(var k in t)Z.call(t,k)&&(l[k]=t[k]);if(G){i=G(t);for(var y=0;y<i.length;y++)ee.call(t,i[y])&&(l[i[y]]=t[i[y]])}}return l};const oe=Y(ne),ae=({url:o,allowFullScreen:a,position:t,display:l,height:i,width:h,overflow:k,styles:y,onLoad:w,onMouseOver:M,onMouseOut:T,scrolling:I,id:F,frameBorder:C,ariaHidden:P,sandbox:x,allow:s,className:m,title:u,ariaLabel:c,ariaLabelledby:b,name:f,target:d,loading:p,importance:A,referrerpolicy:V,allowpaymentrequest:ue,src:pe,key:fe})=>{const D=oe({src:pe||o,target:d||null,style:{position:t||null,display:l||"initial",overflow:k||null},scrolling:I||null,allowpaymentrequest:ue||null,importance:A||null,sandbox:x&&[...x].join(" ")||null,loading:p||null,styles:y||null,name:f||null,className:m||null,allowFullScreen:"allowFullScreen",referrerpolicy:V||null,title:u||null,allow:s||null,id:F||null,"aria-labelledby":b||null,"aria-hidden":P||null,"aria-label":c||null,width:h||null,height:i||null,onLoad:w||null,onMouseOver:M||null,onMouseOut:T||null,key:fe||"iframe"});let g=Object.create(null);for(let v of Object.keys(D))D[v]!=null&&(g[v]=D[v]);for(let v of Object.keys(g.style))g.style[v]==null&&delete g.style[v];if(g.styles)for(let v of Object.keys(g.styles))g.styles.hasOwnProperty(v)&&(g.style[v]=g.styles[v]),Object.keys(g.styles).pop()==v&&delete g.styles;if(a)if("allow"in g){const v=g.allow.replace("fullscreen","");g.allow=`fullscreen ${v.trim()}`.trim()}else g.allow="fullscreen";return C>=0&&(g.style.hasOwnProperty("border")||(g.style.border=C)),N.createElement("iframe",Object.assign({},g))},ie=()=>{const o=j.useField(),a=j.useFieldSchema(),{t}=q.useTranslation(),{dn:l}=e.useDesignable(),i=e.useAPIClient(),{mode:h,url:k,htmlId:y,height:w="60vh",engine:M}=a["x-component-props"]||{},T=x=>H(this,null,function*(){var m,u,c,b,f;const s={values:{html:x}};if(y){const{data:d}=yield(u=(m=i.resource("iframeHtml")).update)==null?void 0:u.call(m,L(O({},s),{filterByTk:y}));return((c=d==null?void 0:d.data)==null?void 0:c[0])||{id:y}}else{const{data:d}=yield(f=(b=i.resource("iframeHtml")).create)==null?void 0:f.call(b,s);return d==null?void 0:d.data}}),I=b=>H(this,[b],function*({mode:x,url:s,html:m,height:u,engine:c}){const f=a["x-component-props"]||{};if(f.mode=x,f.height=u,f.url=s,f.engine=c||"string",x==="html"){const d=yield T(m);f.htmlId=d.id}a["x-component-props"]=f,o.componentProps=O({},f),o.data={v:B.uid()},l.emit("patch",{schema:{"x-uid":a["x-uid"],"x-component-props":f}})}),{form:F}=e.useFormBlockContext(),C=e.useRecord(),P=e.useVariableOptions({collectionField:{uiSchema:a},form:F,record:C,uiSchema:a,noDisabled:!0});return n.jsxs(e.GeneralSchemaDesigner,{children:[n.jsx(e.SchemaSettingsModalItem,{title:t("Edit iframe"),asyncGetInitialValues:()=>H(this,null,function*(){var s,m,u;const x={mode:h,url:k,height:w};if(y){const{data:c}=yield(m=(s=i.resource("iframeHtml")).get)==null?void 0:m.call(s,{filterByTk:y});x.html=((u=c==null?void 0:c.data)==null?void 0:u.html)||""}return x}),schema:{type:"object",title:t("Edit iframe"),properties:{mode:{title:'{{t("Mode")}}',"x-component":"Radio.Group","x-decorator":"FormItem",required:!0,default:"url",enum:[{value:"url",label:t("URL")},{value:"html",label:t("HTML")}]},url:{title:t("URL"),type:"string","x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:P},required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},engine:{title:'{{t("Template engine")}}',"x-component":"Radio.Group","x-decorator":"FormItem",enum:[{value:"string",label:t("String template")},{value:"handlebars",label:t("Handlebars")}],"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:P,style:{minHeight:"200px"}},required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},height:{title:t("Height"),type:"string","x-decorator":"FormItem","x-component":"Input",required:!0}}},onSubmit:I}),n.jsx(e.SchemaSettingsDivider,{}),n.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};function $(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))}const R=j.observer(o=>{const b=o,{url:a,htmlId:t,mode:l="url",height:i,html:h,params:k,engine:y}=b,w=X(b,["url","htmlId","mode","height","html","params","engine"]),M=j.useField(),{t:T}=q.useTranslation(),I=e.useBlockHeight()||i,F=e.useVariables(),C=e.useLocalVariables(),P=e.useCompile(),{loading:x,data:s}=e.useRequest({url:`iframeHtml:getHtml/${t}`},{refreshDeps:[t,M.data],ready:l==="html"&&!!t}),{parseURLAndParams:m}=e.useParseURLAndParams(),[u,c]=N.useState(null);return N.useEffect(()=>{H(this,null,function*(){if(l==="html"){const d=yield e.getRenderContent(y,s,P(F),P(C),V=>V);if(d===void 0)return;const A="data:text/html;charset=utf-8,"+encodeURIComponent(d);c(A)}else try{const d=yield m(a,k||[]);c(d)}catch(d){console.error("Error fetching target URL:",d),c("fallback-url")}})},[s,l,a,F,C,k]),l==="url"&&!a||l==="html"&&!t?n.jsx(E.Card,{style:{marginBottom:24,height:$(I)?`${I}px`:I},children:T("Please fill in the iframe URL")}):x&&!u?n.jsx("div",{style:{height:$(I)?`${I}px`:I||"60vh",marginBottom:"24px",border:0},children:n.jsx(E.Spin,{})}):n.jsx(ae,O({url:u,width:"100%",display:"block",position:"relative",styles:{height:$(I)?`${I}px`:I||"60vh",marginBottom:"24px",border:0}},w))},{displayName:"Iframe"});R.Designer=ie;const se=()=>{const{insert:o}=e.useSchemaInitializer(),a=e.useSchemaInitializerItem();return n.jsx(e.SchemaInitializerItem,L(O({},a),{icon:n.jsx(z.PicRightOutlined,{}),onClick:()=>{o({type:"void","x-settings":"blockSettings:iframe","x-decorator":"BlockItem","x-decorator-props":{name:"iframe"},"x-component":"Iframe","x-component-props":{}})}}))},le=o=>n.jsx(e.SchemaComponentOptions,{components:{Iframe:R,IframeBlockInitializer:se,ArrayItems:S.ArrayItems},children:o.children}),ce=o=>a=>{const t=j.useFieldSchema(),{form:l}=e.useFormBlockContext(),i=e.useRecord(),h=e.useVariableOptions({collectionField:{uiSchema:t},form:l,record:i,uiSchema:t,noDisabled:!0});return n.jsx(o,L(O({},a),{scope:h}))},_={items:[{name:"EditIframe",type:"modal",useComponentProps(){const o=j.useField(),a=j.useFieldSchema(),{t}=q.useTranslation(),{dn:l}=e.useDesignable(),i=e.useAPIClient(),{mode:h,url:k,params:y,htmlId:w,height:M="60vh",engine:T}=a["x-component-props"]||{},I=s=>H(this,null,function*(){var u,c,b,f,d;const m={values:{html:s}};if(w){const{data:p}=yield(c=(u=i.resource("iframeHtml")).update)==null?void 0:c.call(u,L(O({},m),{filterByTk:w}));return((b=p==null?void 0:p.data)==null?void 0:b[0])||{id:w}}else{const{data:p}=yield(d=(f=i.resource("iframeHtml")).create)==null?void 0:d.call(f,m);return p==null?void 0:p.data}}),{urlSchema:F,paramsSchema:C}=e.useURLAndHTMLSchema(),P=d=>H(this,[d],function*({mode:s,url:m,html:u,height:c,params:b,engine:f}){const p=a["x-component-props"]||{};if(p.mode=s,p.height=c,p.engine=f||"string",p.params=b,p.url=m,s==="html"){const A=yield I(u);p.htmlId=A.id}a["x-component-props"]=p,o.componentProps=O({},p),o.data={v:B.uid()},l.emit("patch",{schema:{"x-uid":a["x-uid"],"x-component-props":p}})}),x=n.jsxs(n.Fragment,{children:[n.jsxs("span",{style:{marginLeft:".25em"},className:"ant-formily-item-extra",children:[t("Syntax references"),":"]}),n.jsx("a",{href:"https://handlebarsjs.com/guide/",target:"_blank",rel:"noreferrer",children:"Handlebars.js"})]});return{title:t("Edit iframe"),asyncGetInitialValues:()=>H(this,null,function*(){var m,u,c;const s={mode:h,url:k,height:M,engine:T,params:y};if(w){const{data:b}=yield(u=(m=i.resource("iframeHtml")).get)==null?void 0:u.call(m,{filterByTk:w});s.html=((c=b==null?void 0:b.data)==null?void 0:c.html)||""}return s}),schema:{type:"object",title:t("Edit iframe"),properties:{mode:{title:'{{t("Mode")}}',"x-component":"Radio.Group","x-decorator":"FormItem",required:!0,default:"url",enum:[{value:"url",label:t("URL")},{value:"html",label:t("HTML")}]},url:L(O({},F),{required:!0}),params:C,engine:{title:'{{t("Template engine")}}',"x-component":"Radio.Group","x-decorator":"FormItem",default:"string",enum:[{value:"string",label:t("String template")},{value:"handlebars",label:t("Handlebars")}],"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":ce(e.Variable.RawTextArea),"x-component-props":{rows:10},required:!0,description:x,"x-reactions":[{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}},s=>{const{engine:m}=s.form.values;m==="handlebars"?s.description=x:s.description=null}]}}},onSubmit:P,noRecord:!0}}},{name:"setTheBlockHeight",Component:e.SchemaSettingsBlockHeightItem},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]},me=new e.SchemaSettings(O({name:"iframeBlockSchemaSettings"},_)),de=new e.SchemaSettings(O({name:"blockSettings:iframe"},_));class W extends e.Plugin{load(){return H(this,null,function*(){this.app.schemaSettingsManager.add(me),this.app.schemaSettingsManager.add(de),this.app.use(le);const a=this.app.schemaInitializerManager.get("page:addBlock");a==null||a.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"});const t=this.app.schemaInitializerManager.get("popup:addNew:addBlock");t==null||t.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"});const l=this.app.schemaInitializerManager.get("popup:common:addBlock");l==null||l.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"});const i=this.app.schemaInitializerManager.get("RecordFormBlockInitializers");i==null||i.add("otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"}),this.app.schemaInitializerManager.addItem("mobilePage:addBlock","otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"}),this.app.schemaInitializerManager.addItem("mobile:addBlock","otherBlocks.iframe",{title:'{{t("Iframe")}}',Component:"IframeBlockInitializer"})})}}r.PluginBlockIframeClient=W,r.default=W,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
module.exports = {
|
|
11
11
|
"@formily/react": "2.3.0",
|
|
12
12
|
"@formily/shared": "2.3.2",
|
|
13
|
-
"@nocobase/client": "1.3.
|
|
13
|
+
"@nocobase/client": "1.3.55",
|
|
14
14
|
"react": "18.2.0",
|
|
15
15
|
"react-i18next": "11.18.6",
|
|
16
16
|
"antd": "5.12.8",
|
|
17
17
|
"@ant-design/icons": "5.2.6",
|
|
18
18
|
"@formily/antd-v5": "1.1.9",
|
|
19
|
-
"@nocobase/server": "1.3.
|
|
20
|
-
"@nocobase/test": "1.3.
|
|
21
|
-
"@nocobase/actions": "1.3.
|
|
22
|
-
"@nocobase/database": "1.3.
|
|
19
|
+
"@nocobase/server": "1.3.55",
|
|
20
|
+
"@nocobase/test": "1.3.55",
|
|
21
|
+
"@nocobase/actions": "1.3.55",
|
|
22
|
+
"@nocobase/database": "1.3.55"
|
|
23
23
|
};
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"displayName.zh-CN": "区块:iframe",
|
|
5
5
|
"description": "Create an iframe block on the page to embed and display external web pages or content.",
|
|
6
6
|
"description.zh-CN": "在页面上创建和管理iframe,用于嵌入和展示外部网页或内容。",
|
|
7
|
-
"version": "1.3.
|
|
7
|
+
"version": "1.3.55",
|
|
8
8
|
"license": "AGPL-3.0",
|
|
9
9
|
"main": "./dist/server/index.js",
|
|
10
10
|
"homepage": "https://docs.nocobase.com/handbook/block-iframe",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@nocobase/server": "1.x",
|
|
26
26
|
"@nocobase/test": "1.x"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "29126bb873bd07a9f40a7f2fee5ca1c396f09794",
|
|
29
29
|
"keywords": [
|
|
30
30
|
"Blocks"
|
|
31
31
|
]
|