@nocobase/plugin-block-iframe 1.2.12-alpha → 1.3.0-alpha.20240710084543

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/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.2.12-alpha",
7
+ "version": "1.3.0-alpha.20240710084543",
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": "553231d4882496cb7f1f17fa7541899ce82a27ab",
28
+ "gitHead": "07a8b596fc64a9779a194cb9b0dc2ca7570ed9d4",
29
29
  "keywords": [
30
30
  "Blocks"
31
31
  ]
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const IframeDesigner: () => React.JSX.Element;
@@ -1,9 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export declare const Iframe: any;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const IframeBlockInitializer: () => React.JSX.Element;
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import React from 'react';
10
- export declare const IframeBlockProvider: (props: any) => React.JSX.Element;
@@ -1,13 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { Plugin } from '@nocobase/client';
10
- export declare class PluginBlockIframeClient extends Plugin {
11
- load(): Promise<void>;
12
- }
13
- export default PluginBlockIframeClient;
@@ -1,19 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- (function(r,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@nocobase/client"),require("react/jsx-runtime"),require("@formily/antd-v5"),require("@formily/react"),require("antd"),require("react"),require("react-i18next"),require("@formily/shared"),require("@ant-design/icons"),require("@emotion/css")):typeof define=="function"&&define.amd?define(["exports","@nocobase/client","react/jsx-runtime","@formily/antd-v5","@formily/react","antd","react","react-i18next","@formily/shared","@ant-design/icons","@emotion/css"],e):(r=typeof globalThis!="undefined"?globalThis:r||self,e(r["@nocobase/plugin-block-iframe"]={},r["@nocobase/client"],r.jsxRuntime,r["@formily/antd-v5"],r["@formily/react"],r.antd,r.react,r["react-i18next"],r["@formily/shared"],r["@ant-design/icons"],r["@emotion/css"]))})(this,function(r,e,a,I,O,M,q,F,j,T,J){"use strict";var ye=Object.defineProperty,ge=Object.defineProperties;var xe=Object.getOwnPropertyDescriptors;var N=Object.getOwnPropertySymbols;var _=Object.prototype.hasOwnProperty,W=Object.prototype.propertyIsEnumerable;var G=(r,e,a)=>e in r?ye(r,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[e]=a,B=(r,e)=>{for(var a in e||(e={}))_.call(e,a)&&G(r,a,e[a]);if(N)for(var a of N(e))W.call(e,a)&&G(r,a,e[a]);return r},A=(r,e)=>ge(r,xe(e));var Q=(r,e)=>{var a={};for(var I in r)_.call(r,I)&&e.indexOf(I)<0&&(a[I]=r[I]);if(r!=null&&N)for(var I of N(r))e.indexOf(I)<0&&W.call(r,I)&&(a[I]=r[I]);return a};var P=(r,e,a)=>new Promise((I,O)=>{var M=j=>{try{F(a.next(j))}catch(T){O(T)}},q=j=>{try{F(a.throw(j))}catch(T){O(T)}},F=j=>j.done?I(j.value):Promise.resolve(j.value).then(M,q);F((a=a.apply(r,e)).next())});function K(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}/*
11
- object-assign
12
- (c) Sindre Sorhus
13
- @license MIT
14
- */var z=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,Y=Object.prototype.propertyIsEnumerable;function Z(o){if(o==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(o)}function ee(){try{if(!Object.assign)return!1;var o=new String("abc");if(o[5]="de",Object.getOwnPropertyNames(o)[0]==="5")return!1;for(var n={},t=0;t<10;t++)n["_"+String.fromCharCode(t)]=t;var l=Object.getOwnPropertyNames(n).map(function(f){return n[f]});if(l.join("")!=="0123456789")return!1;var i={};return"abcdefghijklmnopqrst".split("").forEach(function(f){i[f]=f}),Object.keys(Object.assign({},i)).join("")==="abcdefghijklmnopqrst"}catch(f){return!1}}var te=ee()?Object.assign:function(o,n){for(var t,l=Z(o),i,f=1;f<arguments.length;f++){t=Object(arguments[f]);for(var k in t)X.call(t,k)&&(l[k]=t[k]);if(z){i=z(t);for(var m=0;m<i.length;m++)Y.call(t,i[m])&&(l[i[m]]=t[i[m]])}}return l};const re=K(te),oe=({url:o,allowFullScreen:n,position:t,display:l,height:i,width:f,overflow:k,styles:m,onLoad:H,onMouseOver:V,onMouseOut:g,scrolling:w,id:y,frameBorder:x,ariaHidden:u,sandbox:p,allow:c,className:b,title:d,ariaLabel:s,ariaLabelledby:C,name:v,target:ce,loading:me,importance:pe,referrerpolicy:de,allowpaymentrequest:ue,src:fe,key:he})=>{const $=re({src:fe||o,target:ce||null,style:{position:t||null,display:l||"initial",overflow:k||null},scrolling:w||null,allowpaymentrequest:ue||null,importance:pe||null,sandbox:p&&[...p].join(" ")||null,loading:me||null,styles:m||null,name:v||null,className:b||null,allowFullScreen:"allowFullScreen",referrerpolicy:de||null,title:d||null,allow:c||null,id:y||null,"aria-labelledby":C||null,"aria-hidden":u||null,"aria-label":s||null,width:f||null,height:i||null,onLoad:H||null,onMouseOver:V||null,onMouseOut:g||null,key:he||"iframe"});let h=Object.create(null);for(let S of Object.keys($))$[S]!=null&&(h[S]=$[S]);for(let S of Object.keys(h.style))h.style[S]==null&&delete h.style[S];if(h.styles)for(let S of Object.keys(h.styles))h.styles.hasOwnProperty(S)&&(h.style[S]=h.styles[S]),Object.keys(h.styles).pop()==S&&delete h.styles;if(n)if("allow"in h){const S=h.allow.replace("fullscreen","");h.allow=`fullscreen ${S.trim()}`.trim()}else h.allow="fullscreen";return x>=0&&(h.style.hasOwnProperty("border")||(h.style.border=x)),q.createElement("iframe",Object.assign({},h))},ne=()=>{const o=O.useField(),n=O.useFieldSchema(),{t}=F.useTranslation(),{dn:l}=e.useDesignable(),i=e.useAPIClient(),{mode:f,url:k,htmlId:m,height:H="60vh"}=n["x-component-props"]||{},V=u=>P(this,null,function*(){var c,b,d,s,C;const p={values:{html:u}};if(m){const{data:v}=yield(b=(c=i.resource("iframeHtml")).update)==null?void 0:b.call(c,A(B({},p),{filterByTk:m}));return((d=v==null?void 0:v.data)==null?void 0:d[0])||{id:m}}else{const{data:v}=yield(C=(s=i.resource("iframeHtml")).create)==null?void 0:C.call(s,p);return v==null?void 0:v.data}}),g=d=>P(this,[d],function*({mode:u,url:p,html:c,height:b}){const s=n["x-component-props"]||{};if(s.mode=u,s.height=b,s.url=p,u==="html"){const C=yield V(c);s.htmlId=C.id}n["x-component-props"]=s,o.componentProps=B({},s),o.data={v:j.uid()},l.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":s}})}),{form:w}=e.useFormBlockContext(),y=e.useRecord(),x=e.useVariableOptions({collectionField:{uiSchema:n},form:w,record:y,uiSchema:n,noDisabled:!0});return a.jsxs(e.GeneralSchemaDesigner,{children:[a.jsx(e.SchemaSettingsModalItem,{title:t("Edit iframe"),asyncGetInitialValues:()=>P(this,null,function*(){var p,c,b;const u={mode:f,url:k,height:H};if(m){const{data:d}=yield(c=(p=i.resource("iframeHtml")).get)==null?void 0:c.call(p,{filterByTk:m});u.html=((b=d==null?void 0:d.data)==null?void 0:b.html)||""}return u}),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:x},required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:x,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:g}),a.jsx(e.SchemaSettingsDivider,{}),a.jsx(e.SchemaSettingsRemove,{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}})]})};function E(o){return typeof o!="string"?!1:!isNaN(o)&&!isNaN(parseFloat(o))}const D=O.observer(o=>{const b=o,{url:n,htmlId:t,mode:l="url",height:i,html:f,params:k}=b,m=Q(b,["url","htmlId","mode","height","html","params"]),H=O.useField(),{t:V}=F.useTranslation(),g=e.useBlockHeight()||i,w=e.useVariables(),y=e.useLocalVariables(),{loading:x,data:u}=e.useRequest({url:`iframeHtml:getHtml/${t}`},{refreshDeps:[t,H.data],ready:l==="html"&&!!t}),[p,c]=q.useState(null);return q.useEffect(()=>{P(this,null,function*(){if(l==="html"){const s=yield e.replaceVariableValue(u,w,y),v="data:text/html;charset=utf-8,"+encodeURIComponent(s);c(v)}else try{const s=yield e.replaceVariableValue(n,w,y),C=yield e.parseVariablesAndChangeParamsToQueryString({searchParams:k||[],variables:w,localVariables:y,replaceVariableValue:e.replaceVariableValue}),v=e.appendQueryStringToUrl(s,C);c(v)}catch(s){console.error("Error fetching target URL:",s),c("fallback-url")}})},[u,l,n,w,y,k]),l==="url"&&!n||l==="html"&&!t?a.jsx(M.Card,{style:{marginBottom:24,height:E(g)?`${g}px`:g},children:V("Please fill in the iframe URL")}):x&&!p?a.jsx("div",{style:{height:E(g)?`${g}px`:g||"60vh",marginBottom:"24px",border:0},children:a.jsx(M.Spin,{})}):a.jsx(oe,B({url:p,width:"100%",display:"block",position:"relative",styles:{height:E(g)?`${g}px`:g||"60vh",marginBottom:"24px",border:0}},m))},{displayName:"Iframe"});D.Designer=ne;const ae=()=>{const{insert:o}=e.useSchemaInitializer(),n=e.useSchemaInitializerItem();return a.jsx(e.SchemaInitializerItem,A(B({},n),{icon:a.jsx(T.FormOutlined,{}),onClick:()=>{o({type:"void","x-settings":"blockSettings:iframe","x-decorator":"BlockItem","x-decorator-props":{name:"iframe"},"x-component":"Iframe","x-component-props":{}})}}))},se=o=>a.jsx(e.SchemaComponentOptions,{components:{Iframe:D,IframeBlockInitializer:ae,ArrayItems:I.ArrayItems},children:o.children}),U=o=>n=>{const t=O.useFieldSchema(),{form:l}=e.useFormBlockContext(),i=e.useRecord(),f=e.useVariableOptions({collectionField:{uiSchema:t},form:l,record:i,uiSchema:t,noDisabled:!0});return a.jsx(o,A(B({},n),{scope:f}))},L={items:[{name:"EditIframe",type:"modal",useComponentProps(){var w;const o=O.useField(),n=O.useFieldSchema(),{t}=F.useTranslation(),{dn:l}=e.useDesignable(),i=e.useAPIClient(),{mode:f,url:k,htmlId:m,height:H="60vh"}=n["x-component-props"]||{},V=y=>P(this,null,function*(){var u,p,c,b,d;const x={values:{html:y}};if(m){const{data:s}=yield(p=(u=i.resource("iframeHtml")).update)==null?void 0:p.call(u,A(B({},x),{filterByTk:m}));return((c=s==null?void 0:s.data)==null?void 0:c[0])||{id:m}}else{const{data:s}=yield(d=(b=i.resource("iframeHtml")).create)==null?void 0:d.call(b,x);return s==null?void 0:s.data}}),g=b=>P(this,[b],function*({mode:y,url:x,html:u,height:p,params:c}){const d=n["x-component-props"]||{};if(d.mode=y,d.height=p,d.params=c,d.url=x,y==="html"){const s=yield V(u);d.htmlId=s.id}n["x-component-props"]=d,o.componentProps=B({},d),o.data={v:j.uid()},l.emit("patch",{schema:{"x-uid":n["x-uid"],"x-component-props":d}})});return{title:t("Edit iframe"),asyncGetInitialValues:()=>P(this,null,function*(){var x,u,p;const y={mode:f,url:k,height:H};if(m){const{data:c}=yield(u=(x=i.resource("iframeHtml")).get)==null?void 0:u.call(x,{filterByTk:m});y.html=((p=c==null?void 0:c.data)==null?void 0:p.html)||""}return y}),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":U(e.Variable.TextArea),description:t("Do not concatenate search params in the URL"),required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}}},params:{type:"array","x-component":"ArrayItems","x-decorator":"FormItem",title:'{{t("Search parameters")}}',default:((w=n==null?void 0:n["x-component-props"])==null?void 0:w.params)||[{}],items:{type:"object",properties:{space:{type:"void","x-component":"Space","x-component-props":{style:{flexWrap:"nowrap",maxWidth:"100%"},className:J.css`
15
- & > .ant-space-item:first-child,
16
- & > .ant-space-item:last-child {
17
- flex-shrink: 0;
18
- }
19
- `},properties:{name:{type:"string","x-decorator":"FormItem","x-component":"Input","x-component-props":{placeholder:'{{t("Name")}}'}},value:{type:"string","x-decorator":"FormItem","x-component":U(e.Variable.TextArea),"x-component-props":{placeholder:'{{t("Value")}}',useTypedConstant:!0,changeOnSelect:!0}},remove:{type:"void","x-decorator":"FormItem","x-component":"ArrayItems.Remove"}}}}},"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "html"}}'}}},properties:{add:{type:"void",title:'{{t("Add parameter")}}',"x-component":"ArrayItems.Addition"}}},html:{title:t("html"),type:"string","x-decorator":"FormItem","x-component":U(e.Variable.RawTextArea),"x-component-props":{rows:10},required:!0,"x-reactions":{dependencies:["mode"],fulfill:{state:{hidden:'{{$deps[0] === "url"}}'}}}}}},onSubmit:g,noRecord:!0}}},{name:"setTheBlockHeight",Component:e.SchemaSettingsBlockHeightItem},{name:"divider",type:"divider"},{name:"delete",type:"remove",useComponentProps(){return{removeParentsIfNoChildren:!0,breakRemoveOn:{"x-component":"Grid"}}}}]},ie=new e.SchemaSettings(B({name:"iframeBlockSchemaSettings"},L)),le=new e.SchemaSettings(B({name:"blockSettings:iframe"},L));class R extends e.Plugin{load(){return P(this,null,function*(){this.app.schemaSettingsManager.add(ie),this.app.schemaSettingsManager.add(le),this.app.use(se);const n=this.app.schemaInitializerManager.get("page:addBlock");n==null||n.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"})})}}r.PluginBlockIframeClient=R,r.default=R,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,14 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { SchemaSettings } from '@nocobase/client';
10
- /**
11
- * @deprecated
12
- */
13
- export declare const iframeBlockSchemaSettings_deprecated: SchemaSettings<{}>;
14
- export declare const iframeBlockSchemaSettings: SchemaSettings<{}>;
@@ -1,23 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- module.exports = {
11
- "@formily/react": "2.3.0",
12
- "@formily/shared": "2.3.0",
13
- "@nocobase/client": "1.2.12-alpha",
14
- "react": "18.2.0",
15
- "react-i18next": "11.18.6",
16
- "antd": "5.12.8",
17
- "@ant-design/icons": "5.2.6",
18
- "@formily/antd-v5": "1.1.9",
19
- "@emotion/css": "11.11.2",
20
- "@nocobase/server": "1.2.12-alpha",
21
- "@nocobase/actions": "1.2.12-alpha",
22
- "@nocobase/database": "1.2.12-alpha"
23
- };
package/dist/index.d.ts DELETED
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export * from './server';
10
- export { default } from './server';
package/dist/index.js DELETED
@@ -1,48 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
29
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
30
- // If the importer is in node compatibility mode or this is not an ESM
31
- // file that has been converted to a CommonJS file using a Babel-
32
- // compatible transform (i.e. "__esModule" has not been set), then set
33
- // "default" to the CommonJS "module.exports" for node compatibility.
34
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
35
- mod
36
- ));
37
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
38
- var src_exports = {};
39
- __export(src_exports, {
40
- default: () => import_server.default
41
- });
42
- module.exports = __toCommonJS(src_exports);
43
- __reExport(src_exports, require("./server"), module.exports);
44
- var import_server = __toESM(require("./server"));
45
- // Annotate the CommonJS export names for ESM import in node:
46
- 0 && (module.exports = {
47
- ...require("./server")
48
- });
@@ -1,10 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { Context, Next } from '@nocobase/actions';
10
- export declare function getHtml(ctx: Context, next: Next): Promise<void>;
@@ -1,47 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var actions_exports = {};
28
- __export(actions_exports, {
29
- getHtml: () => getHtml
30
- });
31
- module.exports = __toCommonJS(actions_exports);
32
- async function getHtml(ctx, next) {
33
- const { filterByTk } = ctx.action.params;
34
- const { resourceName } = ctx.action;
35
- const repository = ctx.db.getRepository(resourceName);
36
- const model = await repository.findById(filterByTk);
37
- ctx.body = model.get("html");
38
- ctx.withoutDataWrapping = true;
39
- ctx.set({
40
- "Content-Type": "text/html; charset=UTF-8"
41
- });
42
- await next();
43
- }
44
- // Annotate the CommonJS export names for ESM import in node:
45
- 0 && (module.exports = {
46
- getHtml
47
- });
@@ -1,11 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { CollectionOptions } from '@nocobase/database';
10
- declare const _default: CollectionOptions;
11
- export default _default;
@@ -1,50 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var iframe_html_exports = {};
28
- __export(iframe_html_exports, {
29
- default: () => iframe_html_default
30
- });
31
- module.exports = __toCommonJS(iframe_html_exports);
32
- var iframe_html_default = {
33
- namespace: "iframe-block.iframe-html-storage",
34
- dumpRules: "required",
35
- name: "iframeHtml",
36
- createdBy: true,
37
- updatedBy: true,
38
- shared: true,
39
- fields: [
40
- {
41
- type: "uid",
42
- name: "id",
43
- primaryKey: true
44
- },
45
- {
46
- type: "text",
47
- name: "html"
48
- }
49
- ]
50
- };
@@ -1,9 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- export { default } from './plugin';
@@ -1,42 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var server_exports = {};
38
- __export(server_exports, {
39
- default: () => import_plugin.default
40
- });
41
- module.exports = __toCommonJS(server_exports);
42
- var import_plugin = __toESM(require("./plugin"));
@@ -1,19 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- import { InstallOptions, Plugin } from '@nocobase/server';
10
- export declare class PluginBlockIframeServer extends Plugin {
11
- afterAdd(): void;
12
- beforeLoad(): void;
13
- load(): Promise<void>;
14
- install(options?: InstallOptions): Promise<void>;
15
- afterEnable(): Promise<void>;
16
- afterDisable(): Promise<void>;
17
- remove(): Promise<void>;
18
- }
19
- export default PluginBlockIframeServer;
@@ -1,75 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __create = Object.create;
11
- var __defProp = Object.defineProperty;
12
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
13
- var __getOwnPropNames = Object.getOwnPropertyNames;
14
- var __getProtoOf = Object.getPrototypeOf;
15
- var __hasOwnProp = Object.prototype.hasOwnProperty;
16
- var __export = (target, all) => {
17
- for (var name in all)
18
- __defProp(target, name, { get: all[name], enumerable: true });
19
- };
20
- var __copyProps = (to, from, except, desc) => {
21
- if (from && typeof from === "object" || typeof from === "function") {
22
- for (let key of __getOwnPropNames(from))
23
- if (!__hasOwnProp.call(to, key) && key !== except)
24
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
25
- }
26
- return to;
27
- };
28
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
29
- // If the importer is in node compatibility mode or this is not an ESM
30
- // file that has been converted to a CommonJS file using a Babel-
31
- // compatible transform (i.e. "__esModule" has not been set), then set
32
- // "default" to the CommonJS "module.exports" for node compatibility.
33
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
34
- mod
35
- ));
36
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
37
- var plugin_exports = {};
38
- __export(plugin_exports, {
39
- PluginBlockIframeServer: () => PluginBlockIframeServer,
40
- default: () => plugin_default
41
- });
42
- module.exports = __toCommonJS(plugin_exports);
43
- var import_server = require("@nocobase/server");
44
- var import_path = __toESM(require("path"));
45
- var import_actions = require("./actions");
46
- class PluginBlockIframeServer extends import_server.Plugin {
47
- afterAdd() {
48
- }
49
- beforeLoad() {
50
- }
51
- async load() {
52
- await this.importCollections(import_path.default.resolve(__dirname, "collections"));
53
- this.app.actions({
54
- "iframeHtml:getHtml": import_actions.getHtml
55
- });
56
- this.app.acl.allow("iframeHtml", "getHtml", "loggedIn");
57
- this.app.acl.registerSnippet({
58
- name: "ui.iframeHtml",
59
- actions: ["iframeHtml:*"]
60
- });
61
- }
62
- async install(options) {
63
- }
64
- async afterEnable() {
65
- }
66
- async afterDisable() {
67
- }
68
- async remove() {
69
- }
70
- }
71
- var plugin_default = PluginBlockIframeServer;
72
- // Annotate the CommonJS export names for ESM import in node:
73
- 0 && (module.exports = {
74
- PluginBlockIframeServer
75
- });
@@ -1,16 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
- declare const _default: {
10
- info: {
11
- title: string;
12
- };
13
- tags: any[];
14
- paths: {};
15
- };
16
- export default _default;
@@ -1,38 +0,0 @@
1
- /**
2
- * This file is part of the NocoBase (R) project.
3
- * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
- * Authors: NocoBase Team.
5
- *
6
- * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
- * For more information, please refer to: https://www.nocobase.com/agreement.
8
- */
9
-
10
- var __defProp = Object.defineProperty;
11
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
12
- var __getOwnPropNames = Object.getOwnPropertyNames;
13
- var __hasOwnProp = Object.prototype.hasOwnProperty;
14
- var __export = (target, all) => {
15
- for (var name in all)
16
- __defProp(target, name, { get: all[name], enumerable: true });
17
- };
18
- var __copyProps = (to, from, except, desc) => {
19
- if (from && typeof from === "object" || typeof from === "function") {
20
- for (let key of __getOwnPropNames(from))
21
- if (!__hasOwnProp.call(to, key) && key !== except)
22
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
23
- }
24
- return to;
25
- };
26
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
27
- var swagger_exports = {};
28
- __export(swagger_exports, {
29
- default: () => swagger_default
30
- });
31
- module.exports = __toCommonJS(swagger_exports);
32
- var swagger_default = {
33
- info: {
34
- title: "NocoBase API - Iframe block plugin"
35
- },
36
- tags: [],
37
- paths: {}
38
- };