@tachybase/plugin-block-presentation 0.23.58 → 1.0.18
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 +2 -2
- package/dist/externalVersion.js +5 -5
- package/package.json +7 -7
package/dist/client/index.js
CHANGED
|
@@ -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,
|
|
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}/*
|
|
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
|
|
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"}})});
|
package/dist/externalVersion.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
module.exports = {
|
|
2
2
|
"react": "18.3.1",
|
|
3
|
-
"@tachybase/client": "0.
|
|
4
|
-
"@tachybase/schema": "0.
|
|
3
|
+
"@tachybase/client": "1.0.18",
|
|
4
|
+
"@tachybase/schema": "1.0.18",
|
|
5
5
|
"react-i18next": "15.2.0",
|
|
6
6
|
"antd": "5.22.5",
|
|
7
7
|
"@ant-design/icons": "5.3.7",
|
|
8
|
-
"@tachybase/server": "0.
|
|
9
|
-
"@tachybase/actions": "0.
|
|
10
|
-
"@tachybase/database": "0.
|
|
8
|
+
"@tachybase/server": "1.0.18",
|
|
9
|
+
"@tachybase/actions": "1.0.18",
|
|
10
|
+
"@tachybase/database": "1.0.18"
|
|
11
11
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/plugin-block-presentation",
|
|
3
3
|
"displayName": "Block: Presentation",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "1.0.18",
|
|
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": "0.
|
|
18
|
+
"@tachybase/schema": "1.0.18"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
|
-
"@tachybase/actions": "0.
|
|
22
|
-
"@tachybase/database": "0.
|
|
23
|
-
"@tachybase/
|
|
24
|
-
"@tachybase/
|
|
25
|
-
"@tachybase/test": "0.
|
|
21
|
+
"@tachybase/actions": "1.0.18",
|
|
22
|
+
"@tachybase/database": "1.0.18",
|
|
23
|
+
"@tachybase/server": "1.0.18",
|
|
24
|
+
"@tachybase/client": "1.0.18",
|
|
25
|
+
"@tachybase/test": "1.0.18"
|
|
26
26
|
},
|
|
27
27
|
"description.zh-CN": "在页面上创建和管理,用于嵌入和展示外部网页或内容。",
|
|
28
28
|
"displayName.zh-CN": "卡片:presentation",
|