@nocobase/app 2.0.0-alpha.40 → 2.0.0-alpha.42
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/{1595.6a6087c3.async.js → 1595.9f992743.async.js} +1 -1
- package/dist/client/{2097.bb2e7097.async.js → 2097.919e4d8a.async.js} +2 -2
- package/dist/client/{4356.feef0eca.async.js → 4356.d61392c6.async.js} +1 -1
- package/dist/client/{4750.b552d2df.async.js → 4750.ce3051f3.async.js} +1 -1
- package/dist/client/{645.c19a1f59.async.js → 645.ab5af584.async.js} +1 -1
- package/dist/client/{703.f2104ec4.async.js → 703.7ad807b0.async.js} +1 -1
- package/dist/client/7764.a3ae7727.async.js +25 -0
- package/dist/client/index.html +1 -1
- package/dist/client/index.html.tpl +1 -1
- package/dist/client/p__index.82f5cfdd.async.js +2411 -0
- package/dist/client/{umi.29f402d6.js → umi.ce64a339.js} +1 -1
- package/package.json +6 -6
- package/dist/client/p__index.88104805.async.js +0 -2411
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
5
|
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
6
|
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),_.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},41595:function(a,n,e){e.r(n);var t=e(10095),r={contexts:[t.JSBlockRunJSContext],prefix:"sn-jsb-timeline",label:"Render timeline from records",description:"Display records as a timeline using Ant Design Timeline",locales:{"zh-CN":{label:"\u6E32\u67D3\u65F6\u95F4\u8F74",description:"\u4F7F\u7528 Ant Design \u65F6\u95F4\u8F74\u7EC4\u4EF6\u663E\u793A\u8BB0\u5F55\u5386\u53F2"}},content:`
|
|
7
|
-
const { Timeline, Card } = ctx.antd;
|
|
7
|
+
const { Timeline, Card } = ctx.libs.antd;
|
|
8
8
|
|
|
9
9
|
const res = await ctx.api.request({
|
|
10
10
|
url: 'users:list',
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[2097,95],{10095:function(a,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return r}});var t=e(72004),_=e.n(t),s=e(12444),l=e.n(s),
|
|
1
|
+
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[2097,95],{10095:function(a,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return r}});var t=e(72004),_=e.n(t),s=e(12444),l=e.n(s),i=e(31996),c=e.n(i),u=e(26037),d=e.n(u),m=e(1772),r=function(b){c()(o,b);var h=d()(o);function o(){return l()(this,o),h.apply(this,arguments)}return _()(o)}(m.Uo);r.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
|
|
2
2
|
Supports innerHTML, append, and other DOM manipulation methods.
|
|
3
3
|
Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
|
|
4
4
|
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
5
|
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
6
|
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),r.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},82097:function(a,n,e){e.r(n);var t=e(10095),_={contexts:[t.JSBlockRunJSContext],prefix:"sn-jsb-button",label:"Render button handler",description:"Render a button and handle click events inside the block",locales:{"zh-CN":{label:"\u6309\u94AE\u4E8B\u4EF6\u5904\u7406",description:"\u5728\u533A\u5757\u4E2D\u6E32\u67D3\u6309\u94AE\u5E76\u7ED1\u5B9A\u70B9\u51FB\u5904\u7406\u903B\u8F91"}},content:`
|
|
7
|
-
const { Button } = ctx.antd;
|
|
7
|
+
const { Button } = ctx.libs.antd;
|
|
8
8
|
|
|
9
9
|
ctx.render(
|
|
10
10
|
<Button type="primary" onClick={() => ctx.message.success(ctx.t('Clicked!'))}>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
6
|
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),r.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},24356:function(a,n,e){e.r(n);var t=e(10095),_={contexts:[t.JSBlockRunJSContext],prefix:"sn-react-jsx",label:"Render React (JSX)",description:"Render a simple React component using JSX syntax",locales:{"zh-CN":{label:"\u6E32\u67D3 React\uFF08JSX\uFF09",description:"\u4F7F\u7528 JSX \u8BED\u6CD5\u6E32\u67D3\u4E00\u4E2A\u7B80\u5355\u7684 React \u7EC4\u4EF6"}},content:`
|
|
7
7
|
// Render a React component with JSX
|
|
8
|
-
const { React } = ctx;
|
|
8
|
+
const { React } = ctx.libs;
|
|
9
9
|
|
|
10
10
|
const App = () => (
|
|
11
11
|
<div style={{ padding: 12 }}>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
5
|
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
6
|
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),_.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},24750:function(s,n,e){e.r(n);var o=e(10095),r={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-info-card",label:"Render record info card",description:"Display current record information in an Ant Design card",locales:{"zh-CN":{label:"\u6E32\u67D3\u8BB0\u5F55\u4FE1\u606F\u5361\u7247",description:"\u4F7F\u7528 Ant Design \u5361\u7247\u663E\u793A\u5F53\u524D\u8BB0\u5F55\u7684\u5173\u952E\u4FE1\u606F"}},content:`
|
|
7
|
-
const { Card, Descriptions, Tag } = ctx.antd;
|
|
7
|
+
const { Card, Descriptions, Tag } = ctx.libs.antd;
|
|
8
8
|
|
|
9
9
|
if (!ctx.record) {
|
|
10
10
|
ctx.render('<div style="padding:16px;color:#999;">' + ctx.t('No record data') + '</div>');
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
5
|
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
6
|
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),s.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},10645:function(a,n,e){e.r(n);var o=e(10095),r={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-stats",label:"Render statistics cards",description:"Display multiple statistic cards with numbers from API",locales:{"zh-CN":{label:"\u6E32\u67D3\u7EDF\u8BA1\u5361\u7247",description:"\u663E\u793A\u591A\u4E2A\u7EDF\u8BA1\u6570\u5B57\u5361\u7247\uFF08\u4ECE API \u83B7\u53D6\u6570\u636E\uFF09"}},content:`
|
|
7
|
-
const { Card, Statistic, Row, Col } = ctx.antd;
|
|
7
|
+
const { Card, Statistic, Row, Col } = ctx.libs.antd;
|
|
8
8
|
|
|
9
9
|
const res = await ctx.api.request({
|
|
10
10
|
url: 'users:list',
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
6
|
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),r.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},70703:function(a,n,e){e.r(n);var o=e(10095),_={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-react",label:"Render React",description:"Render a React element inside the block container",locales:{"zh-CN":{label:"\u6E32\u67D3 React",description:"\u5728\u533A\u5757\u5BB9\u5668\u4E2D\u6E32\u67D3 React \u7EC4\u4EF6"}},content:`
|
|
7
7
|
// Render a React element into ctx.element via ReactDOM
|
|
8
|
-
const { Button } = ctx.antd;
|
|
8
|
+
const { Button } = ctx.libs.antd;
|
|
9
9
|
|
|
10
10
|
ctx.render(
|
|
11
11
|
<div style={{ padding: 12 }}>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";(self.webpackChunknocobase=self.webpackChunknocobase||[]).push([[7764,95],{10095:function(r,n,e){e.r(n),e.d(n,{JSBlockRunJSContext:function(){return s}});var o=e(72004),_=e.n(o),a=e(12444),l=e.n(a),i=e(31996),c=e.n(i),u=e(26037),d=e.n(u),m=e(1772),s=function(b){c()(t,b);var p=d()(t);function t(){return l()(this,t),p.apply(this,arguments)}return _()(t)}(m.Uo);s.define({label:"RunJS context",properties:{element:{description:`ElementProxy instance providing a safe DOM container.
|
|
2
|
+
Supports innerHTML, append, and other DOM manipulation methods.
|
|
3
|
+
Use this to render content in the JS block.`,detail:"ElementProxy",properties:{innerHTML:"Set or read the HTML content of the container element."}},record:`Current record data object (read-only).
|
|
4
|
+
Available when the JS block is within a data block or detail view context.`,value:"Current value of the field or component, if available in the current context.",React:"React library",antd:"Ant Design library"},methods:{onRefReady:`Wait for container DOM element to be ready before executing callback.
|
|
5
|
+
Parameters: (ref: React.RefObject, callback: (element: HTMLElement) => void, timeout?: number) => void
|
|
6
|
+
Example: ctx.onRefReady(ctx.ref, (el) => { el.innerHTML = "Ready!" })`,requireAsync:"Load external library: `const lib = await ctx.requireAsync(url)`",importAsync:"Dynamically import ESM module: `const mod = await ctx.importAsync(url)`"}}),s.define({label:"RunJS \u4E0A\u4E0B\u6587",properties:{element:{description:"ElementProxy\uFF0C\u5B89\u5168\u7684 DOM \u5BB9\u5668\uFF0C\u652F\u6301 innerHTML/append \u7B49",detail:"ElementProxy",properties:{innerHTML:"\u8BFB\u53D6\u6216\u8BBE\u7F6E\u5BB9\u5668\u7684 HTML \u5185\u5BB9"}},record:"\u5F53\u524D\u8BB0\u5F55\uFF08\u53EA\u8BFB\uFF0C\u7528\u4E8E\u6570\u636E\u533A\u5757/\u8BE6\u60C5\u7B49\u573A\u666F\uFF09",value:"\u5F53\u524D\u503C\uFF08\u82E5\u5B58\u5728\uFF09",React:"React \u5E93",antd:"Ant Design \u5E93"},methods:{onRefReady:"\u5BB9\u5668 ref \u5C31\u7EEA\u56DE\u8C03\uFF1A\n```js\nctx.onRefReady(ctx.ref, el => { /* ... */ })\n```",requireAsync:"\u52A0\u8F7D\u5916\u90E8\u5E93\uFF1A`const lib = await ctx.requireAsync(url)`",importAsync:"\u6309 URL \u52A8\u6001\u5BFC\u5165 ESM \u6A21\u5757\uFF1A`const mod = await ctx.importAsync(url)`"}},{locale:"zh-CN"})},17764:function(r,n,e){e.r(n);var o=e(10095),_={contexts:[o.JSBlockRunJSContext],prefix:"sn-jsb-antd-icons",label:"Render Ant Design icons",description:"Render Ant Design icons with buttons inside the block container",locales:{"zh-CN":{label:"\u6E32\u67D3 Ant Design \u56FE\u6807",description:"\u5728\u533A\u5757\u5BB9\u5668\u4E2D\u4F7F\u7528 Ant Design \u56FE\u6807\u4E0E\u6309\u94AE\u8FDB\u884C\u6E32\u67D3"}},content:`
|
|
7
|
+
// Render Ant Design icons with buttons via ctx.libs
|
|
8
|
+
const { React, antd, antdIcons } = ctx.libs;
|
|
9
|
+
const { Button, Space } = antd;
|
|
10
|
+
const { PlusOutlined, EditOutlined, DeleteOutlined } = antdIcons;
|
|
11
|
+
|
|
12
|
+
const IconButtons = () => (
|
|
13
|
+
<Space style={{ padding: 12 }}>
|
|
14
|
+
<Button type="primary" icon={<PlusOutlined />}>
|
|
15
|
+
{ctx.t('Add')}
|
|
16
|
+
</Button>
|
|
17
|
+
<Button icon={<EditOutlined />}>{ctx.t('Edit')}</Button>
|
|
18
|
+
<Button danger icon={<DeleteOutlined />}>
|
|
19
|
+
{ctx.t('Delete')}
|
|
20
|
+
</Button>
|
|
21
|
+
</Space>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
ctx.render(<IconButtons />);
|
|
25
|
+
`};n.default=_}}]);
|
package/dist/client/index.html
CHANGED