@tachybase/plugin-block-presentation 1.3.16 → 1.3.17

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.
@@ -1,5 +1,5 @@
1
- (function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("antd"),require("react-i18next"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","@tachybase/schema","antd","react-i18next","@ant-design/icons"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r["@tachybase/plugin-block-presentation"]={},r["@tachybase/client"],r.jsxRuntime,r.react,r["@tachybase/schema"],r.antd,r["react-i18next"],r["@ant-design/icons"]))})(this,function(r,e,o,b,x,H,q,F){"use strict";var ue=Object.defineProperty,me=Object.defineProperties;var de=Object.getOwnPropertyDescriptors;var M=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var z=(r,e,o)=>e in r?ue(r,e,{enumerable:!0,configurable:!0,writable:!0,value:o}):r[e]=o,B=(r,e)=>{for(var o in e||(e={}))L.call(e,o)&&z(r,o,e[o]);if(M)for(var o of M(e))U.call(e,o)&&z(r,o,e[o]);return r},E=(r,e)=>me(r,de(e));var A=(r,e)=>{var o={};for(var b in r)L.call(r,b)&&e.indexOf(b)<0&&(o[b]=r[b]);if(r!=null&&M)for(var b of M(r))e.indexOf(b)<0&&U.call(r,b)&&(o[b]=r[b]);return o};var S=(r,e,o)=>new Promise((b,x)=>{var H=j=>{try{F(o.next(j))}catch(C){x(C)}},q=j=>{try{F(o.throw(j))}catch(C){x(C)}},F=j=>j.done?b(j.value):Promise.resolve(j.value).then(H,q);F((o=o.apply(r,e)).next())});function j(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}/*
1
+ (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("react"),require("@tachybase/schema"),require("antd"),require("react-i18next"),require("@ant-design/icons")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","react","@tachybase/schema","antd","react-i18next","@ant-design/icons"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t["@tachybase/plugin-block-presentation"]={},t["@tachybase/client"],t.jsxRuntime,t.react,t["@tachybase/schema"],t.antd,t["react-i18next"],t["@ant-design/icons"]))})(this,function(t,e,r,v,k,H,q,E){"use strict";var se=Object.defineProperty,ce=Object.defineProperties;var ue=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var L=Object.prototype.hasOwnProperty,U=Object.prototype.propertyIsEnumerable;var z=(t,e,r)=>e in t?se(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,C=(t,e)=>{for(var r in e||(e={}))L.call(e,r)&&z(t,r,e[r]);if(F)for(var r of F(e))U.call(e,r)&&z(t,r,e[r]);return t},M=(t,e)=>ce(t,ue(e));var D=(t,e)=>{var r={};for(var v in t)L.call(t,v)&&e.indexOf(v)<0&&(r[v]=t[v]);if(t!=null&&F)for(var v of F(t))e.indexOf(v)<0&&U.call(t,v)&&(r[v]=t[v]);return r};var P=(t,e,r)=>new Promise((v,k)=>{var H=S=>{try{E(r.next(S))}catch(B){k(B)}},q=S=>{try{E(r.throw(S))}catch(B){k(B)}},E=S=>S.done?v(S.value):Promise.resolve(S.value).then(H,q);E((r=r.apply(t,e)).next())});function S(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}/*
2
2
  object-assign
3
3
  (c) Sindre Sorhus
4
4
  @license MIT
5
- */var C=Object.getOwnPropertySymbols,D=Object.prototype.hasOwnProperty,G=Object.prototype.propertyIsEnumerable;function R(n){if(n==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(n)}function _(){try{if(!Object.assign)return!1;var n=new String("abc");if(n[5]="de",Object.getOwnPropertyNames(n)[0]==="5")return!1;for(var i={},t=0;t<10;t++)i["_"+String.fromCharCode(t)]=t;var u=Object.getOwnPropertyNames(i).map(function(y){return i[y]});if(u.join("")!=="0123456789")return!1;var l={};return"abcdefghijklmnopqrst".split("").forEach(function(y){l[y]=y}),Object.keys(Object.assign({},l)).join("")==="abcdefghijklmnopqrst"}catch(y){return!1}}var V=_()?Object.assign:function(n,i){for(var t,u=R(n),l,y=1;y<arguments.length;y++){t=Object(arguments[y]);for(var O in t)D.call(t,O)&&(u[O]=t[O]);if(C){l=C(t);for(var s=0;s<l.length;s++)G.call(t,l[s])&&(u[l[s]]=t[l[s]])}}return u};const J=j(V),K=({url:n,allowFullScreen:i,position:t,display:u,height:l,width:y,overflow:O,styles:s,onLoad:P,onMouseOver:w,onMouseOut:k,scrolling:p,id:m,frameBorder:c,ariaHidden:d,sandbox:f,allow:a,className:v,title:g,ariaLabel:ee,ariaLabelledby:te,name:re,target:ne,loading:oe,importance:ae,referrerpolicy:ie,allowpaymentrequest:le,src:se,key:ce})=>{const N=J({src:se||n,target:ne||null,style:{position:t||null,display:u||"initial",overflow:O||null},scrolling:p||null,allowpaymentrequest:le||null,importance:ae||null,sandbox:f&&[...f].join(" ")||null,loading:oe||null,styles:s||null,name:re||null,className:v||null,allowFullScreen:"allowFullScreen",referrerpolicy:ie||null,title:g||null,allow:a||null,id:m||null,"aria-labelledby":te||null,"aria-hidden":d||null,"aria-label":ee||null,width:y||null,height:l||null,onLoad:P||null,onMouseOver:w||null,onMouseOut:k||null,key:ce||"iframe"});let h=Object.create(null);for(let I of Object.keys(N))N[I]!=null&&(h[I]=N[I]);for(let I of Object.keys(h.style))h.style[I]==null&&delete h.style[I];if(h.styles)for(let I of Object.keys(h.styles))h.styles.hasOwnProperty(I)&&(h.style[I]=h.styles[I]),Object.keys(h.styles).pop()==I&&delete h.styles;if(i)if("allow"in h){const I=h.allow.replace("fullscreen","");h.allow=`fullscreen ${I.trim()}`.trim()}else h.allow="fullscreen";return c>=0&&(h.style.hasOwnProperty("border")||(h.style.border=c)),b.createElement("iframe",Object.assign({},h))},Q=()=>{const n=x.useField(),i=x.useFieldSchema(),{t}=q.useTranslation(),{dn:u}=e.useDesignable(),l=e.useAPIClient(),{mode:y,url:O,htmlId:s,height:P="60vh"}=i["x-component-props"]||{},w=p=>S(this,null,function*(){var c,d,f,a,v;const m={values:{html:p}};if(s){const{data:g}=yield(d=(c=l.resource("iframeHtml")).update)==null?void 0:d.call(c,E(B({},m),{filterByTk:s}));return((f=g==null?void 0:g.data)==null?void 0:f[0])||{id:s}}else{const{data:g}=yield(v=(a=l.resource("iframeHtml")).create)==null?void 0:v.call(a,m);return g==null?void 0:g.data}}),k=f=>S(this,[f],function*({mode:p,url:m,html:c,height:d}){const a=i["x-component-props"]||{};if(a.mode=p,a.height=d,a.url=m,p==="html"){const v=yield w(c);a.htmlId=v.id}i["x-component-props"]=a,n.componentProps=B({},a),n.data={v:x.uid()},u.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":a}})});return o.jsxs(e.GeneralSchemaDesigner,{children:[o.jsx(e.SchemaSettingsModalItem,{title:t("Edit iframe"),asyncGetInitialValues:()=>S(this,null,function*(){var m,c,d;const p={mode:y,url:O,height:P};if(s){const{data:f}=yield(c=(m=l.resource("iframeHtml")).get)==null?void 0:c.call(m,{filterByTk:s});p.html=((d=f==null?void 0:f.data)==null?void 0:d.html)||""}return p}),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":"Input",required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":"CodeMirror",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:k}),o.jsx(e.SchemaSettingsDivider,{}),o.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};function W(n){return typeof n!="string"?!1:!isNaN(n)&&!isNaN(parseFloat(n))}const T=x.observer(n=>{var c;const m=n,{url:i,htmlId:t,mode:u="url",height:l,html:y}=m,O=A(m,["url","htmlId","mode","height","html"]),{t:s}=q.useTranslation(),P=e.useAPIClient(),w=x.useField(),k=e.useApp(),p=b.useMemo(()=>{var d,f;if(u==="html"){const a=k.getOptions();return`${(d=a==null?void 0:a.apiClient)==null?void 0:d.baseURL}iframeHtml:getHtml/${t}?token=${P.auth.getToken()}&v=${((f=w.data)==null?void 0:f.v)||""}`}return i},[k,i,u,t,(c=w.data)==null?void 0:c.v]);return u==="url"&&!i||u==="html"&&!t?o.jsx(H.Card,{style:{marginBottom:24},children:s("Please fill in the iframe URL")}):o.jsx(K,B({url:p,width:"100%",display:"block",position:"relative",styles:{height:W(l)?`${l}px`:l,marginBottom:"24px",border:0}},O))},{displayName:"Iframe"});T.Designer=Q;const X=()=>{const{insert:n}=e.useSchemaInitializer(),i=e.useSchemaInitializerItem();return o.jsx(e.SchemaInitializerItem,E(B({},i),{icon:o.jsx(F.Html5Outlined,{}),onClick:()=>{n({type:"void","x-settings":"blockSettings:iframe","x-decorator":"BlockItem","x-decorator-props":{name:"iframe"},"x-component":"Iframe","x-component-props":{}})}}))},Y=n=>o.jsx(e.SchemaComponentOptions,{components:{Iframe:T,IframeBlockInitializer:X},children:n.children}),Z=new e.SchemaSettings({name:"blockSettings:iframe",items:[{name:"EditIframe",type:"modal",useComponentProps(){const n=x.useField(),i=x.useFieldSchema(),{t}=q.useTranslation(),{dn:u}=e.useDesignable(),l=e.useAPIClient(),{mode:y,url:O,htmlId:s,height:P="60vh"}=i["x-component-props"]||{},w=p=>S(this,null,function*(){var c,d,f,a,v;const m={values:{html:p}};if(s){const{data:g}=yield(d=(c=l.resource("iframeHtml")).update)==null?void 0:d.call(c,E(B({},m),{filterByTk:s}));return((f=g==null?void 0:g.data)==null?void 0:f[0])||{id:s}}else{const{data:g}=yield(v=(a=l.resource("iframeHtml")).create)==null?void 0:v.call(a,m);return g==null?void 0:g.data}}),k=f=>S(this,[f],function*({mode:p,url:m,html:c,height:d}){const a=i["x-component-props"]||{};if(a.mode=p,a.height=d,a.url=m,p==="html"){const v=yield w(c);a.htmlId=v.id}i["x-component-props"]=a,n.componentProps=B({},a),n.data={v:x.uid()},u.emit("patch",{schema:{"x-uid":i["x-uid"],"x-component-props":a}})});return{title:t("Edit iframe"),asyncGetInitialValues:()=>S(this,null,function*(){var m,c,d;const p={mode:y,url:O,height:P};if(s){const{data:f}=yield(c=(m=l.resource("iframeHtml")).get)==null?void 0:c.call(m,{filterByTk:s});p.html=((d=f==null?void 0:f.data)==null?void 0:d.html)||""}return p}),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":"Input",required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":"CodeMirror",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:k}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]});class $ extends e.Plugin{load(){return S(this,null,function*(){this.app.schemaSettingsManager.add(Z),this.app.use(Y);const i=this.app.schemaInitializerManager.get("page:addBlock");i==null||i.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"});const t=this.app.schemaInitializerManager.get("popup:addNew:addBlock");t==null||t.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"});const u=this.app.schemaInitializerManager.get("popup:common:addBlock");u==null||u.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"});const l=this.app.schemaInitializerManager.get("RecordFormBlockInitializers");l==null||l.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"})})}}r.IframeBlockPlugin=$,r.default=$,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
5
+ */var B,T;function G(){if(T)return B;T=1;var o=Object.getOwnPropertySymbols,s=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable;function b(I){if(I==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(I)}function d(){try{if(!Object.assign)return!1;var I=new String("abc");if(I[5]="de",Object.getOwnPropertyNames(I)[0]==="5")return!1;for(var O={},n=0;n<10;n++)O["_"+String.fromCharCode(n)]=n;var x=Object.getOwnPropertyNames(O).map(function(f){return O[f]});if(x.join("")!=="0123456789")return!1;var g={};return"abcdefghijklmnopqrst".split("").forEach(function(f){g[f]=f}),Object.keys(Object.assign({},g)).join("")==="abcdefghijklmnopqrst"}catch(f){return!1}}return B=d()?Object.assign:function(I,O){for(var n,x=b(I),g,f=1;f<arguments.length;f++){n=Object(arguments[f]);for(var c in n)s.call(n,c)&&(x[c]=n[c]);if(o){g=o(n);for(var l=0;l<g.length;l++)a.call(n,g[l])&&(x[g[l]]=n[g[l]])}}return x},B}var R=G();const _=S(R),V=({url:o,allowFullScreen:s,position:a,display:b,height:d,width:I,overflow:O,styles:n,onLoad:x,onMouseOver:g,onMouseOut:f,scrolling:c,id:l,frameBorder:u,ariaHidden:m,sandbox:p,allow:i,className:w,title:y,ariaLabel:Y,ariaLabelledby:Z,name:ee,target:te,loading:re,importance:ne,referrerpolicy:oe,allowpaymentrequest:ae,src:ie,key:le})=>{const N=_({src:ie||o,target:te||null,style:{position:a||null,display:b||"initial",overflow:O||null},scrolling:c||null,allowpaymentrequest:ae||null,importance:ne||null,sandbox:p&&[...p].join(" ")||null,loading:re||null,styles:n||null,name:ee||null,className:w||null,allowFullScreen:"allowFullScreen",referrerpolicy:oe||null,title:y||null,allow:i||null,id:l||null,"aria-labelledby":Z||null,"aria-hidden":m||null,"aria-label":Y||null,width:I||null,height:d||null,onLoad:x||null,onMouseOver:g||null,onMouseOut:f||null,key:le||"iframe"});let h=Object.create(null);for(let j of Object.keys(N))N[j]!=null&&(h[j]=N[j]);for(let j of Object.keys(h.style))h.style[j]==null&&delete h.style[j];if(h.styles)for(let j of Object.keys(h.styles))h.styles.hasOwnProperty(j)&&(h.style[j]=h.styles[j]),Object.keys(h.styles).pop()==j&&delete h.styles;if(s)if("allow"in h){const j=h.allow.replace("fullscreen","");h.allow=`fullscreen ${j.trim()}`.trim()}else h.allow="fullscreen";return u>=0&&(h.style.hasOwnProperty("border")||(h.style.border=u)),v.createElement("iframe",Object.assign({},h))},J=()=>{const o=k.useField(),s=k.useFieldSchema(),{t:a}=q.useTranslation(),{dn:b}=e.useDesignable(),d=e.useAPIClient(),{mode:I,url:O,htmlId:n,height:x="60vh"}=s["x-component-props"]||{},g=c=>P(null,null,function*(){var u,m,p,i,w;const l={values:{html:c}};if(n){const{data:y}=yield(m=(u=d.resource("iframeHtml")).update)==null?void 0:m.call(u,M(C({},l),{filterByTk:n}));return((p=y==null?void 0:y.data)==null?void 0:p[0])||{id:n}}else{const{data:y}=yield(w=(i=d.resource("iframeHtml")).create)==null?void 0:w.call(i,l);return y==null?void 0:y.data}}),f=p=>P(null,[p],function*({mode:c,url:l,html:u,height:m}){const i=s["x-component-props"]||{};if(i.mode=c,i.height=m,i.url=l,c==="html"){const w=yield g(u);i.htmlId=w.id}s["x-component-props"]=i,o.componentProps=C({},i),o.data={v:k.uid()},b.emit("patch",{schema:{"x-uid":s["x-uid"],"x-component-props":i}})});return r.jsxs(e.GeneralSchemaDesigner,{children:[r.jsx(e.SchemaSettingsModalItem,{title:a("Edit iframe"),asyncGetInitialValues:()=>P(null,null,function*(){var l,u,m;const c={mode:I,url:O,height:x};if(n){const{data:p}=yield(u=(l=d.resource("iframeHtml")).get)==null?void 0:u.call(l,{filterByTk:n});c.html=((m=p==null?void 0:p.data)==null?void 0:m.html)||""}return c}),schema:{type:"object",title:a("Edit iframe"),properties:{mode:{title:'{{t("Mode")}}',"x-component":"Radio.Group","x-decorator":"FormItem",required:!0,default:"url",enum:[{value:"url",label:a("URL")},{value:"html",label:a("html")}]},url:{title:a("URL"),type:"string","x-decorator":"FormItem","x-component":"Input",required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},html:{title:a("html"),type:"string","x-decorator":"FormItem","x-component":"CodeMirror",required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},height:{title:a("Height"),type:"string","x-decorator":"FormItem","x-component":"Input",required:!0}}},onSubmit:f}),r.jsx(e.SchemaSettingsDivider,{}),r.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};function K(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))}const $=k.observer(o=>{var u;const l=o,{url:s,htmlId:a,mode:b="url",height:d,html:I}=l,O=D(l,["url","htmlId","mode","height","html"]),{t:n}=q.useTranslation(),x=e.useAPIClient(),g=k.useField(),f=e.useApp(),c=v.useMemo(()=>{var m,p;if(b==="html"){const i=f.getOptions();return`${(m=i==null?void 0:i.apiClient)==null?void 0:m.baseURL}iframeHtml:getHtml/${a}?token=${x.auth.getToken()}&v=${((p=g.data)==null?void 0:p.v)||""}`}return s},[f,s,b,a,(u=g.data)==null?void 0:u.v]);return b==="url"&&!s||b==="html"&&!a?r.jsx(H.Card,{style:{marginBottom:24},children:n("Please fill in the iframe URL")}):r.jsx(V,C({url:c,width:"100%",display:"block",position:"relative",styles:{height:K(d)?`${d}px`:d,marginBottom:"24px",border:0}},O))},{displayName:"Iframe"});$.Designer=J;const Q=()=>{const{insert:o}=e.useSchemaInitializer(),s=e.useSchemaInitializerItem();return r.jsx(e.SchemaInitializerItem,M(C({},s),{icon:r.jsx(E.Html5Outlined,{}),onClick:()=>{o({type:"void","x-settings":"blockSettings:iframe","x-decorator":"BlockItem","x-decorator-props":{name:"iframe"},"x-component":"Iframe","x-component-props":{}})}}))},W=o=>r.jsx(e.SchemaComponentOptions,{components:{Iframe:$,IframeBlockInitializer:Q},children:o.children}),X=new e.SchemaSettings({name:"blockSettings:iframe",items:[{name:"EditIframe",type:"modal",useComponentProps(){const o=k.useField(),s=k.useFieldSchema(),{t:a}=q.useTranslation(),{dn:b}=e.useDesignable(),d=e.useAPIClient(),{mode:I,url:O,htmlId:n,height:x="60vh"}=s["x-component-props"]||{},g=c=>P(null,null,function*(){var u,m,p,i,w;const l={values:{html:c}};if(n){const{data:y}=yield(m=(u=d.resource("iframeHtml")).update)==null?void 0:m.call(u,M(C({},l),{filterByTk:n}));return((p=y==null?void 0:y.data)==null?void 0:p[0])||{id:n}}else{const{data:y}=yield(w=(i=d.resource("iframeHtml")).create)==null?void 0:w.call(i,l);return y==null?void 0:y.data}}),f=p=>P(null,[p],function*({mode:c,url:l,html:u,height:m}){const i=s["x-component-props"]||{};if(i.mode=c,i.height=m,i.url=l,c==="html"){const w=yield g(u);i.htmlId=w.id}s["x-component-props"]=i,o.componentProps=C({},i),o.data={v:k.uid()},b.emit("patch",{schema:{"x-uid":s["x-uid"],"x-component-props":i}})});return{title:a("Edit iframe"),asyncGetInitialValues:()=>P(null,null,function*(){var l,u,m;const c={mode:I,url:O,height:x};if(n){const{data:p}=yield(u=(l=d.resource("iframeHtml")).get)==null?void 0:u.call(l,{filterByTk:n});c.html=((m=p==null?void 0:p.data)==null?void 0:m.html)||""}return c}),schema:{type:"object",title:a("Edit iframe"),properties:{mode:{title:'{{t("Mode")}}',"x-component":"Radio.Group","x-decorator":"FormItem",required:!0,default:"url",enum:[{value:"url",label:a("URL")},{value:"html",label:a("html")}]},url:{title:a("URL"),type:"string","x-decorator":"FormItem","x-component":"Input",required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},html:{title:a("html"),type:"string","x-decorator":"FormItem","x-component":"CodeMirror",required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}},height:{title:a("Height"),type:"string","x-decorator":"FormItem","x-component":"Input",required:!0}}},onSubmit:f}}},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]});class A extends e.Plugin{load(){return P(this,null,function*(){this.app.schemaSettingsManager.add(X),this.app.use(W);const s=this.app.schemaInitializerManager.get("page:addBlock");s==null||s.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"});const a=this.app.schemaInitializerManager.get("popup:addNew:addBlock");a==null||a.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"});const b=this.app.schemaInitializerManager.get("popup:common:addBlock");b==null||b.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"});const d=this.app.schemaInitializerManager.get("RecordFormBlockInitializers");d==null||d.add("otherBlocks.iframe",{title:'{{t("Embedded page")}}',Component:"IframeBlockInitializer"})})}}t.IframeBlockPlugin=A,t.default=A,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,11 +1,11 @@
1
1
  module.exports = {
2
2
  "react": "18.3.1",
3
- "@tachybase/client": "1.3.16",
4
- "@tachybase/schema": "1.3.16",
3
+ "@tachybase/client": "1.3.17",
4
+ "@tachybase/schema": "1.3.17",
5
5
  "react-i18next": "15.2.0",
6
6
  "antd": "5.22.5",
7
7
  "@ant-design/icons": "5.3.7",
8
- "@tachybase/server": "1.3.16",
9
- "@tachybase/actions": "1.3.16",
10
- "@tachybase/database": "1.3.16"
8
+ "@tachybase/server": "1.3.17",
9
+ "@tachybase/actions": "1.3.17",
10
+ "@tachybase/database": "1.3.17"
11
11
  };
package/dist/index.js CHANGED
@@ -26,12 +26,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var src_exports = {};
30
- __export(src_exports, {
29
+ var index_exports = {};
30
+ __export(index_exports, {
31
31
  default: () => import_server.default
32
32
  });
33
- module.exports = __toCommonJS(src_exports);
34
- __reExport(src_exports, require("./server"), module.exports);
33
+ module.exports = __toCommonJS(index_exports);
34
+ __reExport(index_exports, require("./server"), module.exports);
35
35
  var import_server = __toESM(require("./server"));
36
36
  // Annotate the CommonJS export names for ESM import in node:
37
37
  0 && (module.exports = {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-block-presentation",
3
3
  "displayName": "Block: Presentation",
4
- "version": "1.3.16",
4
+ "version": "1.3.17",
5
5
  "description": "Create an card on the page to embed and display external web pages or content.",
6
6
  "keywords": [
7
7
  "Blocks"
@@ -15,14 +15,14 @@
15
15
  "react": "^18.3.1",
16
16
  "react-i18next": "^15.2.0",
17
17
  "react-iframe": "~1.8.5",
18
- "@tachybase/schema": "1.3.16"
18
+ "@tachybase/schema": "1.3.17"
19
19
  },
20
20
  "peerDependencies": {
21
- "@tachybase/actions": "1.3.16",
22
- "@tachybase/client": "1.3.16",
23
- "@tachybase/database": "1.3.16",
24
- "@tachybase/server": "1.3.16",
25
- "@tachybase/test": "1.3.16"
21
+ "@tachybase/actions": "1.3.17",
22
+ "@tachybase/database": "1.3.17",
23
+ "@tachybase/server": "1.3.17",
24
+ "@tachybase/test": "1.3.17",
25
+ "@tachybase/client": "1.3.17"
26
26
  },
27
27
  "description.zh-CN": "在页面上创建和管理,用于嵌入和展示外部网页或内容。",
28
28
  "displayName.zh-CN": "卡片:presentation",