@tachybase/plugin-block-presentation 1.5.1 → 1.6.1
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
CHANGED
|
@@ -1,5 +1 @@
|
|
|
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
|
-
object-assign
|
|
3
|
-
(c) Sindre Sorhus
|
|
4
|
-
@license MIT
|
|
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
|
+
(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}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"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "1.
|
|
4
|
-
"@tachybase/schema": "1.
|
|
3
|
+
"@tachybase/client": "1.6.1",
|
|
4
|
+
"@tachybase/schema": "1.6.0-alpha.9",
|
|
5
5
|
"react-i18next": "16.2.1",
|
|
6
6
|
"antd": "5.22.5",
|
|
7
|
-
"@ant-design/icons": "
|
|
8
|
-
"@tego/server": "1.
|
|
7
|
+
"@ant-design/icons": "6.1.0",
|
|
8
|
+
"@tego/server": "1.6.0-alpha.9"
|
|
9
9
|
};
|
|
File without changes
|
package/dist/server/plugin.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
var __create = Object.create;
|
|
2
1
|
var __defProp = Object.defineProperty;
|
|
3
2
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
6
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
5
|
var __export = (target, all) => {
|
|
8
6
|
for (var name in all)
|
|
@@ -16,14 +14,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
14
|
}
|
|
17
15
|
return to;
|
|
18
16
|
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
17
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
28
18
|
var plugin_exports = {};
|
|
29
19
|
__export(plugin_exports, {
|
|
@@ -31,7 +21,6 @@ __export(plugin_exports, {
|
|
|
31
21
|
default: () => plugin_default
|
|
32
22
|
});
|
|
33
23
|
module.exports = __toCommonJS(plugin_exports);
|
|
34
|
-
var import_node_path = __toESM(require("node:path"));
|
|
35
24
|
var import_server = require("@tego/server");
|
|
36
25
|
var import_actions = require("./actions");
|
|
37
26
|
class IframeBlockPlugin extends import_server.Plugin {
|
|
@@ -40,8 +29,7 @@ class IframeBlockPlugin extends import_server.Plugin {
|
|
|
40
29
|
beforeLoad() {
|
|
41
30
|
}
|
|
42
31
|
async load() {
|
|
43
|
-
|
|
44
|
-
this.app.actions({
|
|
32
|
+
this.app.resourcer.registerActions({
|
|
45
33
|
"iframeHtml:getHtml": import_actions.getHtml
|
|
46
34
|
});
|
|
47
35
|
this.app.acl.allow("iframeHtml", "getHtml", "loggedIn");
|
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.
|
|
4
|
+
"version": "1.6.1",
|
|
5
5
|
"description": "Create an card on the page to embed and display external web pages or content.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"Blocks"
|
|
@@ -10,16 +10,16 @@
|
|
|
10
10
|
"main": "./dist/server/index.js",
|
|
11
11
|
"dependencies": {},
|
|
12
12
|
"devDependencies": {
|
|
13
|
-
"@ant-design/icons": "^
|
|
14
|
-
"@tachybase/schema": "1.
|
|
15
|
-
"@tachybase/test": "1.
|
|
16
|
-
"@tego/client": "1.
|
|
17
|
-
"@tego/server": "1.
|
|
13
|
+
"@ant-design/icons": "^6.1.0",
|
|
14
|
+
"@tachybase/schema": "1.6.0-alpha.9",
|
|
15
|
+
"@tachybase/test": "1.6.0-alpha.9",
|
|
16
|
+
"@tego/client": "1.6.0-alpha.9",
|
|
17
|
+
"@tego/server": "1.6.0-alpha.9",
|
|
18
18
|
"antd": "5.22.5",
|
|
19
19
|
"react": "18.3.1",
|
|
20
20
|
"react-i18next": "16.2.1",
|
|
21
21
|
"react-iframe": "~1.8.5",
|
|
22
|
-
"@tachybase/client": "1.
|
|
22
|
+
"@tachybase/client": "1.6.1"
|
|
23
23
|
},
|
|
24
24
|
"description.zh-CN": "在页面上创建和管理,用于嵌入和展示外部网页或内容。",
|
|
25
25
|
"displayName.zh-CN": "卡片:presentation",
|