@nocobase/client 1.2.0-alpha → 1.2.2-alpha
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/es/index.mjs
CHANGED
|
@@ -61,7 +61,7 @@ import { Outlet, UNSAFE_RouteContext, UNSAFE_LocationContext, useRoutes, HashRou
|
|
|
61
61
|
import * as nocobaseSDK from "@nocobase/sdk";
|
|
62
62
|
import { APIClient as APIClient$1, getSubAppName } from "@nocobase/sdk";
|
|
63
63
|
import * as antd from "antd";
|
|
64
|
-
import { notification, Spin, message, Tag, Select as Select$1, theme, App, ConfigProvider, Popover, Menu as Menu$1, Switch, Divider, Button, Result, Tooltip, Input as Input$3, Empty, Modal, Typography, Image, Slider, Space as Space$1, Card, Collapse, Badge, Tree as Tree$2, Dropdown, Alert, Cascader as Cascader$1, Radio as Radio$1, Drawer as Drawer$1, Flex, Tabs as Tabs$1, TreeSelect as TreeSelect$2, Upload as Upload$1, Progress, Table as Table$2, Skeleton, AutoComplete as AutoComplete$1, Checkbox as Checkbox$1, ColorPicker as ColorPicker$1, DatePicker as DatePicker$1, List as List$1, Col, InputNumber as InputNumber$1, Pagination as Pagination$1, TimePicker as TimePicker$1, Row, Popconfirm, Layout } from "antd";
|
|
64
|
+
import { notification, Spin, message, Tag, Select as Select$1, theme, App, ConfigProvider, Popover, Menu as Menu$1, Switch, Divider, Button, Result, Tooltip, Input as Input$3, Empty, Modal, Typography, Image, Slider, Space as Space$1, Card, Collapse, Badge, Tree as Tree$2, Dropdown, Alert, Cascader as Cascader$1, Radio as Radio$1, Drawer as Drawer$1, Flex, Tabs as Tabs$1, TreeSelect as TreeSelect$2, Upload as Upload$1, Progress, Table as Table$2, Skeleton, AutoComplete as AutoComplete$1, Checkbox as Checkbox$1, ColorPicker as ColorPicker$1, DatePicker as DatePicker$1, List as List$1, Col, InputNumber as InputNumber$1, QRCode, Pagination as Pagination$1, TimePicker as TimePicker$1, Row, Popconfirm, Layout } from "antd";
|
|
65
65
|
import * as formilyShared from "@formily/shared";
|
|
66
66
|
import { merge, uid, isArr, isFn, applyMiddleware, isNum as isNum$1, isStr, isBool, toArr as toArr$3, isValid, each, isReactElement } from "@formily/shared";
|
|
67
67
|
import * as ahooks from "ahooks";
|
|
@@ -791,7 +791,7 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
791
791
|
return useLinkageAction;
|
|
792
792
|
},
|
|
793
793
|
get useStyles() {
|
|
794
|
-
return useStyles$
|
|
794
|
+
return useStyles$4;
|
|
795
795
|
},
|
|
796
796
|
get useTabsContext() {
|
|
797
797
|
return useTabsContext;
|
|
@@ -3397,7 +3397,7 @@ const bp = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
3397
3397
|
return useSourceIdFromRecord;
|
|
3398
3398
|
},
|
|
3399
3399
|
get useStyles() {
|
|
3400
|
-
return useStyles$
|
|
3400
|
+
return useStyles$4;
|
|
3401
3401
|
},
|
|
3402
3402
|
get useSupportedBlocks() {
|
|
3403
3403
|
return useSupportedBlocks;
|
|
@@ -3902,7 +3902,7 @@ function addAppVersion(e, t) {
|
|
|
3902
3902
|
addAppVersion((n = e.properties) == null ? void 0 : n[o], t);
|
|
3903
3903
|
}), e;
|
|
3904
3904
|
}
|
|
3905
|
-
const name = "@nocobase/client", version$1 = "1.2.
|
|
3905
|
+
const name = "@nocobase/client", version$1 = "1.2.2-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
|
|
3906
3906
|
"@ahooksjs/use-url-state": "3.5.1",
|
|
3907
3907
|
"@ant-design/cssinjs": "^1.11.1",
|
|
3908
3908
|
"@ant-design/icons": "^5.1.4",
|
|
@@ -3923,9 +3923,9 @@ const name = "@nocobase/client", version$1 = "1.2.0-alpha", license = "AGPL-3.0"
|
|
|
3923
3923
|
"@formily/reactive-react": "^2.2.27",
|
|
3924
3924
|
"@formily/shared": "^2.2.27",
|
|
3925
3925
|
"@formily/validator": "^2.2.27",
|
|
3926
|
-
"@nocobase/evaluators": "1.2.
|
|
3927
|
-
"@nocobase/sdk": "1.2.
|
|
3928
|
-
"@nocobase/utils": "1.2.
|
|
3926
|
+
"@nocobase/evaluators": "1.2.2-alpha",
|
|
3927
|
+
"@nocobase/sdk": "1.2.2-alpha",
|
|
3928
|
+
"@nocobase/utils": "1.2.2-alpha",
|
|
3929
3929
|
ahooks: "^3.7.2",
|
|
3930
3930
|
antd: "^5.12.8",
|
|
3931
3931
|
"antd-style": "3.4.5",
|
|
@@ -3945,6 +3945,7 @@ const name = "@nocobase/client", version$1 = "1.2.0-alpha", license = "AGPL-3.0"
|
|
|
3945
3945
|
"markdown-it-highlightjs": "3.3.1",
|
|
3946
3946
|
mathjs: "^10.6.0",
|
|
3947
3947
|
mermaid: "9.4.3",
|
|
3948
|
+
"mime-match": "^1.0.2",
|
|
3948
3949
|
"react-beautiful-dnd": "^13.1.0",
|
|
3949
3950
|
"react-drag-listview": "^0.1.9",
|
|
3950
3951
|
"react-error-boundary": "^4.0.10",
|
|
@@ -12502,11 +12503,29 @@ const useStyles$i = createStyles(({ css: e, token: t }) => e`
|
|
|
12502
12503
|
}
|
|
12503
12504
|
`), BlockItem = withDynamicSchemaProps(
|
|
12504
12505
|
(e) => {
|
|
12505
|
-
const { className: t, children: o } = useProps(e), { styles: n } = useStyles$i(), r = useFieldSchema(), { render: i } = useSchemaToolbarRender(r), { getAriaLabel: a } = useGetAriaLabelOfBlockItem(e.name), l = useMemo(() => a(), [a]);
|
|
12506
|
-
return /* @__PURE__ */ jsxs(
|
|
12507
|
-
|
|
12508
|
-
|
|
12509
|
-
|
|
12506
|
+
const { className: t, children: o } = useProps(e), { styles: n } = useStyles$i(), r = useFieldSchema(), { render: i } = useSchemaToolbarRender(r), { getAriaLabel: a } = useGetAriaLabelOfBlockItem(e.name), { token: l } = theme.useToken(), { designable: c } = useDesignable(), u = useMemo(() => a(), [a]);
|
|
12507
|
+
return /* @__PURE__ */ jsxs(
|
|
12508
|
+
SortableItem,
|
|
12509
|
+
{
|
|
12510
|
+
role: "button",
|
|
12511
|
+
"aria-label": u,
|
|
12512
|
+
className: cls(
|
|
12513
|
+
"nb-block-item",
|
|
12514
|
+
t,
|
|
12515
|
+
n,
|
|
12516
|
+
css`
|
|
12517
|
+
margin-bottom: ${c ? l.marginLG : 0}px !important;
|
|
12518
|
+
.ant-card {
|
|
12519
|
+
margin-bottom: ${c ? l.marginLG : 0}px !important;
|
|
12520
|
+
}
|
|
12521
|
+
`
|
|
12522
|
+
),
|
|
12523
|
+
children: [
|
|
12524
|
+
i(),
|
|
12525
|
+
/* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: ErrorFallback, onError: (d) => console.log(d), children: o })
|
|
12526
|
+
]
|
|
12527
|
+
}
|
|
12528
|
+
);
|
|
12510
12529
|
},
|
|
12511
12530
|
{ displayName: "BlockItem" }
|
|
12512
12531
|
), TestDesigner = () => {
|
|
@@ -28713,7 +28732,7 @@ const useFieldComponentOptions = () => {
|
|
|
28713
28732
|
var l;
|
|
28714
28733
|
e != null && e.title || (e.title = i((l = r == null ? void 0 : r.uiSchema) == null ? void 0 : l.title));
|
|
28715
28734
|
}, [(a = r == null ? void 0 : r.uiSchema) == null ? void 0 : a.title]);
|
|
28716
|
-
}, getPageHeaderHeight = (e, t, o, n) => e ? n.paddingContentHorizontalLG : o ? n.paddingContentHorizontalLG + 12 : t ? n.paddingSM + n.controlHeight + n.marginXS + 2 * n.controlPaddingHorizontalSM + 22 + n.paddingContentHorizontalLG : n.controlHeight + n.marginXS + (n.paddingXXS + 2) * 2 + n.paddingContentHorizontalLG, usePageFullScreenHeight = (e) => {
|
|
28735
|
+
}, getPageHeaderHeight = (e, t, o, n) => e ? n.paddingContentHorizontalLG : o ? t ? n.controlPaddingHorizontal + 3 * n.controlPaddingHorizontalSM + 22 + n.paddingContentHorizontalLG : n.paddingContentHorizontalLG + 12 : t ? n.paddingSM + n.controlHeight + n.marginXS + 2 * n.controlPaddingHorizontalSM + 22 + n.paddingContentHorizontalLG : n.controlHeight + n.marginXS + (n.paddingXXS + 2) * 2 + n.paddingContentHorizontalLG, usePageFullScreenHeight = (e) => {
|
|
28717
28736
|
const { token: t } = theme.useToken(), { designable: o } = useDesignable(), { heightProps: n } = useBlockHeightProps(), { disablePageHeader: r, enablePageTabs: i, hidePageTitle: a } = n || e || {}, l = t.sizeXXL - 2, c = o ? t.controlHeight + 2 * t.paddingContentHorizontalLG : 1 * t.paddingContentHorizontalLG, u = getPageHeaderHeight(r, i, a, t);
|
|
28718
28737
|
return l + u + c;
|
|
28719
28738
|
}, useFullScreenHeight = (e) => {
|
|
@@ -30462,7 +30481,7 @@ const FixedBlockContext = React.createContext({
|
|
|
30462
30481
|
}
|
|
30463
30482
|
},
|
|
30464
30483
|
".nb-page-wrapper": {
|
|
30465
|
-
padding: `${e.paddingPageVertical}px
|
|
30484
|
+
padding: `${e.paddingPageVertical}px`,
|
|
30466
30485
|
flex: 1
|
|
30467
30486
|
}
|
|
30468
30487
|
}
|
|
@@ -36205,29 +36224,174 @@ function convertToText(e) {
|
|
|
36205
36224
|
const n = o.innerText;
|
|
36206
36225
|
return o = null, (n == null ? void 0 : n.replace(/[\n\r]/g, "")) || "";
|
|
36207
36226
|
}
|
|
36227
|
+
const useStyles$5 = genStyleHook("nb-variable-select", (e) => {
|
|
36228
|
+
const { componentCls: t } = e;
|
|
36229
|
+
return {
|
|
36230
|
+
[t]: {
|
|
36231
|
+
position: "relative",
|
|
36232
|
+
".ant-select.ant-cascader": {
|
|
36233
|
+
position: "absolute",
|
|
36234
|
+
top: "-1px",
|
|
36235
|
+
right: "-1px",
|
|
36236
|
+
minWidth: "auto",
|
|
36237
|
+
width: "calc(100% + 2px)",
|
|
36238
|
+
height: "calc(100% + 2px)",
|
|
36239
|
+
overflow: "hidden",
|
|
36240
|
+
opacity: 0
|
|
36241
|
+
},
|
|
36242
|
+
".variable-btn": {
|
|
36243
|
+
fontStyle: "italic",
|
|
36244
|
+
fontFamily: "'New York', 'Times New Roman', Times, serif"
|
|
36245
|
+
},
|
|
36246
|
+
".Cascader-popupClassName": {
|
|
36247
|
+
".ant-cascader-menu": {
|
|
36248
|
+
marginBottom: 0
|
|
36249
|
+
}
|
|
36250
|
+
}
|
|
36251
|
+
}
|
|
36252
|
+
};
|
|
36253
|
+
}), XButton = forwardRef((e, t) => {
|
|
36254
|
+
const o = useMemo(() => ({
|
|
36255
|
+
fontStyle: "italic",
|
|
36256
|
+
fontFamily: "New York, Times New Roman, Times, serif"
|
|
36257
|
+
}), []);
|
|
36258
|
+
return /* @__PURE__ */ jsxs(Button, F(g({ "aria-label": "variable-button", ref: t, style: o }, e), { children: [
|
|
36259
|
+
"x",
|
|
36260
|
+
e.children
|
|
36261
|
+
] }));
|
|
36262
|
+
});
|
|
36263
|
+
XButton.displayName = "XButton";
|
|
36264
|
+
function VariableSelect({
|
|
36265
|
+
options: e,
|
|
36266
|
+
setOptions: t,
|
|
36267
|
+
onInsert: o,
|
|
36268
|
+
changeOnSelect: n = !1,
|
|
36269
|
+
fieldNames: r = {},
|
|
36270
|
+
className: i
|
|
36271
|
+
}) {
|
|
36272
|
+
const { t: a } = useTranslation(), [l, c] = useState([]), { wrapSSR: u, componentCls: d, hashId: p } = useStyles$5(), { token: m } = useToken();
|
|
36273
|
+
function h(x) {
|
|
36274
|
+
return V(this, null, function* () {
|
|
36275
|
+
var C;
|
|
36276
|
+
const f = x[x.length - 1];
|
|
36277
|
+
!((C = f.children) != null && C.length) && !f.isLeaf && f.loadChildren && (yield f.loadChildren(f), t((S) => [...S]));
|
|
36278
|
+
});
|
|
36279
|
+
}
|
|
36280
|
+
return u(
|
|
36281
|
+
/* @__PURE__ */ jsx(XButton, { className: cx("x-button", d, p, i), children: /* @__PURE__ */ jsx(
|
|
36282
|
+
Cascader$1,
|
|
36283
|
+
{
|
|
36284
|
+
placeholder: a("Select a variable"),
|
|
36285
|
+
value: [],
|
|
36286
|
+
options: e,
|
|
36287
|
+
fieldNames: r,
|
|
36288
|
+
loadData: h,
|
|
36289
|
+
onChange: (x = [], f = []) => {
|
|
36290
|
+
var S;
|
|
36291
|
+
if (c(x), !x.length)
|
|
36292
|
+
return;
|
|
36293
|
+
const C = f[f.length - 1];
|
|
36294
|
+
(!((S = C == null ? void 0 : C.children) != null && S.length) && !(C != null && C.loadChildren) || C != null && C.isLeaf) && o(x);
|
|
36295
|
+
},
|
|
36296
|
+
changeOnSelect: n,
|
|
36297
|
+
onClick: (x) => {
|
|
36298
|
+
var f;
|
|
36299
|
+
if (!(x.detail !== 2 || !n))
|
|
36300
|
+
for (let C = x.target; C && C !== x.currentTarget; C = C.parentNode)
|
|
36301
|
+
Array.from((f = C.classList) != null ? f : []).includes("ant-cascader-menu-item") && o(l);
|
|
36302
|
+
},
|
|
36303
|
+
popupClassName: "Cascader-popupClassName",
|
|
36304
|
+
dropdownRender: n ? (x) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36305
|
+
x,
|
|
36306
|
+
/* @__PURE__ */ jsx(
|
|
36307
|
+
"div",
|
|
36308
|
+
{
|
|
36309
|
+
style: {
|
|
36310
|
+
padding: "0.5em",
|
|
36311
|
+
borderTop: `1px solid ${m.colorBorder}`,
|
|
36312
|
+
color: m.colorTextDescription
|
|
36313
|
+
},
|
|
36314
|
+
children: a("Double click to choose entire object")
|
|
36315
|
+
}
|
|
36316
|
+
)
|
|
36317
|
+
] }) : null
|
|
36318
|
+
}
|
|
36319
|
+
) })
|
|
36320
|
+
);
|
|
36321
|
+
}
|
|
36322
|
+
class QRCodeWebComponent extends HTMLElement {
|
|
36323
|
+
constructor() {
|
|
36324
|
+
super();
|
|
36325
|
+
P(this, "root");
|
|
36326
|
+
this.attachShadow({ mode: "open" }), this.root = null;
|
|
36327
|
+
}
|
|
36328
|
+
getProps(o, n = {}) {
|
|
36329
|
+
return [...o].filter((r) => r.name !== "style").map((r) => this.convert(n, r.name, r.value)).reduce((r, i) => F(g({}, r), { [i.name]: i.value }), {});
|
|
36330
|
+
}
|
|
36331
|
+
convert(o, n, r) {
|
|
36332
|
+
const i = Object.keys(o).find((l) => l.toLowerCase() == n);
|
|
36333
|
+
let a = r;
|
|
36334
|
+
return r === "true" || r === "false" ? a = r == "true" : !isNaN(r) && r !== "" ? a = +r : /^{.*}/.exec(r) && (a = JSON.parse(r)), {
|
|
36335
|
+
name: i || n,
|
|
36336
|
+
value: a
|
|
36337
|
+
};
|
|
36338
|
+
}
|
|
36339
|
+
connectedCallback() {
|
|
36340
|
+
const o = g({}, this.getProps(this.attributes));
|
|
36341
|
+
this.root = createRoot$1(this.shadowRoot), this.root.render(/* @__PURE__ */ jsx(QRCode, g({}, o)));
|
|
36342
|
+
}
|
|
36343
|
+
disconnectedCallback() {
|
|
36344
|
+
this.root.unmount();
|
|
36345
|
+
}
|
|
36346
|
+
}
|
|
36347
|
+
function registerQrcodeWebComponent() {
|
|
36348
|
+
customElements.get("qr-code") || customElements.define("qr-code", QRCodeWebComponent);
|
|
36349
|
+
}
|
|
36208
36350
|
const MarkdownEditor = (e) => {
|
|
36209
|
-
const { t } = useTranslation(), [
|
|
36210
|
-
|
|
36351
|
+
const { scope: t } = e, { t: o } = useTranslation(), [n, r] = useState(e.defaultValue), i = useRef(null), [a, l] = useState([]), [c, u] = useState(null);
|
|
36352
|
+
useEffect(() => {
|
|
36353
|
+
l(t);
|
|
36354
|
+
}, [t]), useEffect(() => {
|
|
36355
|
+
var m, h;
|
|
36356
|
+
const p = (h = (m = i == null ? void 0 : i.current) == null ? void 0 : m.resizableTextArea) == null ? void 0 : h.textArea;
|
|
36357
|
+
c && p && p.setSelectionRange(c, c);
|
|
36358
|
+
}, [c]);
|
|
36359
|
+
const d = useCallback(
|
|
36360
|
+
function(p) {
|
|
36361
|
+
var y;
|
|
36362
|
+
const m = p.filter((v) => !!v.trim()), { current: h } = i, x = (y = h == null ? void 0 : h.resizableTextArea) == null ? void 0 : y.textArea;
|
|
36363
|
+
if (!x || !m)
|
|
36364
|
+
return;
|
|
36365
|
+
h.focus();
|
|
36366
|
+
const f = `{{${p.join(".")}}}`, C = x.selectionStart || 0, S = n.substring(0, C) + f + n.substring(C, n.length), b = C + f.length;
|
|
36367
|
+
r(S), u(b);
|
|
36368
|
+
},
|
|
36369
|
+
[n]
|
|
36370
|
+
);
|
|
36371
|
+
return /* @__PURE__ */ jsxs("div", { className: "mb-markdown", style: { position: "relative", paddingTop: "20px" }, children: [
|
|
36211
36372
|
/* @__PURE__ */ jsx(
|
|
36212
36373
|
Input$3.TextArea,
|
|
36213
36374
|
F(g({
|
|
36375
|
+
ref: i,
|
|
36214
36376
|
autoSize: { minRows: 3 }
|
|
36215
36377
|
}, e), {
|
|
36216
|
-
value:
|
|
36217
|
-
onChange: (
|
|
36218
|
-
|
|
36219
|
-
}
|
|
36378
|
+
value: n,
|
|
36379
|
+
onChange: (p) => {
|
|
36380
|
+
r(p.target.value);
|
|
36381
|
+
},
|
|
36382
|
+
style: { paddingBottom: "40px" }
|
|
36220
36383
|
})
|
|
36221
36384
|
),
|
|
36385
|
+
/* @__PURE__ */ jsx("div", { style: { position: "absolute", top: 21, right: 1 }, children: /* @__PURE__ */ jsx(VariableSelect, { options: a, setOptions: l, onInsert: d }) }),
|
|
36222
36386
|
/* @__PURE__ */ jsxs(Space$1, { style: { position: "absolute", bottom: 5, right: 5 }, children: [
|
|
36223
36387
|
/* @__PURE__ */ jsx(
|
|
36224
36388
|
Button,
|
|
36225
36389
|
{
|
|
36226
|
-
onClick: (
|
|
36227
|
-
var
|
|
36228
|
-
(
|
|
36390
|
+
onClick: (p) => {
|
|
36391
|
+
var m;
|
|
36392
|
+
(m = e.onCancel) == null || m.call(e, p);
|
|
36229
36393
|
},
|
|
36230
|
-
children:
|
|
36394
|
+
children: o("Cancel")
|
|
36231
36395
|
}
|
|
36232
36396
|
),
|
|
36233
36397
|
/* @__PURE__ */ jsx(
|
|
@@ -36235,10 +36399,10 @@ const MarkdownEditor = (e) => {
|
|
|
36235
36399
|
{
|
|
36236
36400
|
type: "primary",
|
|
36237
36401
|
onClick: () => {
|
|
36238
|
-
var
|
|
36239
|
-
(
|
|
36402
|
+
var p;
|
|
36403
|
+
(p = e.onSubmit) == null || p.call(e, n);
|
|
36240
36404
|
},
|
|
36241
|
-
children:
|
|
36405
|
+
children: o("Save")
|
|
36242
36406
|
}
|
|
36243
36407
|
)
|
|
36244
36408
|
] })
|
|
@@ -36247,24 +36411,41 @@ const MarkdownEditor = (e) => {
|
|
|
36247
36411
|
const { token: e } = theme.useToken(), t = useBlockHeight();
|
|
36248
36412
|
if (t)
|
|
36249
36413
|
return t - 2 * e.paddingLG;
|
|
36250
|
-
}, MarkdownVoid =
|
|
36251
|
-
(e) => {
|
|
36252
|
-
const { isDarkTheme: t } = useGlobalTheme(), { componentCls: o, hashId: n } = useStyles$6({ isDarkTheme: t }), { content: r, className: i } = e, a = useField(), l = useFieldSchema(), { dn: c } = useDesignable(), { onSave: u, onCancel: d } = e,
|
|
36253
|
-
|
|
36414
|
+
}, MarkdownVoid = withDynamicSchemaProps(
|
|
36415
|
+
observer$1((e) => {
|
|
36416
|
+
const { isDarkTheme: t } = useGlobalTheme(), { componentCls: o, hashId: n } = useStyles$6({ isDarkTheme: t }), { content: r, className: i } = e, a = useField(), l = useFieldSchema(), { dn: c } = useDesignable(), { onSave: u, onCancel: d, form: p } = e, m = useCollectionRecord(), [h, x] = useState(""), f = useVariables(), C = useLocalVariables(), [S, b] = useState(!1);
|
|
36417
|
+
useEffect(() => {
|
|
36418
|
+
b(!0), V(void 0, null, function* () {
|
|
36419
|
+
const A = yield replaceVariableValue(r, f, C), T = yield parseMarkdown(A);
|
|
36420
|
+
x(T), b(!1);
|
|
36421
|
+
});
|
|
36422
|
+
}, [r, f, C]);
|
|
36423
|
+
const y = useMarkdownHeight(), v = useVariableOptions({
|
|
36424
|
+
collectionField: { uiSchema: l },
|
|
36425
|
+
form: p,
|
|
36426
|
+
record: m,
|
|
36427
|
+
uiSchema: l,
|
|
36428
|
+
noDisabled: !0
|
|
36429
|
+
});
|
|
36430
|
+
return useEffect(() => {
|
|
36431
|
+
registerQrcodeWebComponent();
|
|
36432
|
+
}, []), S ? /* @__PURE__ */ jsx(Spin, {}) : a != null && a.editable ? /* @__PURE__ */ jsx(
|
|
36254
36433
|
MarkdownEditor,
|
|
36255
|
-
F(g({
|
|
36434
|
+
F(g({
|
|
36435
|
+
scope: v
|
|
36436
|
+
}, e), {
|
|
36256
36437
|
className: !0,
|
|
36257
36438
|
defaultValue: r,
|
|
36258
36439
|
onCancel: () => {
|
|
36259
36440
|
a.editable = !1, d == null || d();
|
|
36260
36441
|
},
|
|
36261
|
-
onSubmit: (
|
|
36262
|
-
var
|
|
36263
|
-
a.editable = !1, (
|
|
36442
|
+
onSubmit: (I) => V(void 0, null, function* () {
|
|
36443
|
+
var A;
|
|
36444
|
+
a.editable = !1, (A = l["x-component-props"]) != null || (l["x-component-props"] = {}), l["x-component-props"].content = I, a.componentProps.content = I, u == null || u(l), c.emit("patch", {
|
|
36264
36445
|
schema: {
|
|
36265
36446
|
"x-uid": l["x-uid"],
|
|
36266
36447
|
"x-component-props": {
|
|
36267
|
-
content:
|
|
36448
|
+
content: I
|
|
36268
36449
|
}
|
|
36269
36450
|
}
|
|
36270
36451
|
});
|
|
@@ -36274,11 +36455,11 @@ const MarkdownEditor = (e) => {
|
|
|
36274
36455
|
"div",
|
|
36275
36456
|
{
|
|
36276
36457
|
className: cls([o, n, "nb-markdown nb-markdown-default nb-markdown-table", i]),
|
|
36277
|
-
style: F(g({}, e.style), { height:
|
|
36278
|
-
dangerouslySetInnerHTML: { __html:
|
|
36458
|
+
style: F(g({}, e.style), { height: y || "100%", overflow: "auto" }),
|
|
36459
|
+
dangerouslySetInnerHTML: { __html: h }
|
|
36279
36460
|
}
|
|
36280
36461
|
);
|
|
36281
|
-
},
|
|
36462
|
+
}),
|
|
36282
36463
|
{ displayName: "MarkdownVoid" }
|
|
36283
36464
|
);
|
|
36284
36465
|
MarkdownVoid.Designer = MarkdownVoidDesigner;
|
|
@@ -37110,7 +37291,7 @@ Menu.SubMenu = observer$1(
|
|
|
37110
37291
|
{ displayName: "Menu.SubMenu" }
|
|
37111
37292
|
);
|
|
37112
37293
|
Menu.Designer = MenuDesigner;
|
|
37113
|
-
const useStyles$
|
|
37294
|
+
const useStyles$4 = createStyles(({ token: e }) => ({
|
|
37114
37295
|
menuItem: {
|
|
37115
37296
|
paddingLeft: `${e.padding}px !important`,
|
|
37116
37297
|
paddingRight: `${e.padding}px !important`
|
|
@@ -37533,7 +37714,7 @@ RecordPicker.Selector = ActionContainer;
|
|
|
37533
37714
|
* Copyright (c) 2014, Jason Chen
|
|
37534
37715
|
* Copyright (c) 2013, salesforce.com
|
|
37535
37716
|
*/
|
|
37536
|
-
const useStyles$
|
|
37717
|
+
const useStyles$3 = genStyleHook("nb-rich-text", (e) => {
|
|
37537
37718
|
const { componentCls: t } = e;
|
|
37538
37719
|
return {
|
|
37539
37720
|
[t]: {
|
|
@@ -38165,7 +38346,7 @@ const useStyles$4 = genStyleHook("nb-rich-text", (e) => {
|
|
|
38165
38346
|
};
|
|
38166
38347
|
}), RichText = connect(
|
|
38167
38348
|
(e) => {
|
|
38168
|
-
const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$
|
|
38349
|
+
const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$3(), r = {
|
|
38169
38350
|
toolbar: [["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]]
|
|
38170
38351
|
}, i = [
|
|
38171
38352
|
"header",
|
|
@@ -39486,18 +39667,7 @@ const ReadPretty = observer$1(
|
|
|
39486
39667
|
})
|
|
39487
39668
|
),
|
|
39488
39669
|
mapReadPretty(ReadPretty)
|
|
39489
|
-
),
|
|
39490
|
-
const o = useMemo(() => ({
|
|
39491
|
-
fontStyle: "italic",
|
|
39492
|
-
fontFamily: "New York, Times New Roman, Times, serif"
|
|
39493
|
-
}), []);
|
|
39494
|
-
return /* @__PURE__ */ jsxs(Button, F(g({ "aria-label": "variable-button", ref: t, style: o }, e), { children: [
|
|
39495
|
-
"x",
|
|
39496
|
-
e.children
|
|
39497
|
-
] }));
|
|
39498
|
-
});
|
|
39499
|
-
XButton.displayName = "XButton";
|
|
39500
|
-
const useStyles$3 = genStyleHook("nb-variable", (e) => {
|
|
39670
|
+
), useStyles$2 = genStyleHook("nb-variable", (e) => {
|
|
39501
39671
|
const { componentCls: t, lineWidth: o, colorFillQuaternary: n } = e, r = e.paddingSM - 1, a = 8 - o, l = e.fontSizeSM, c = `${e.lineHeightSM * l}px`, u = n;
|
|
39502
39672
|
return {
|
|
39503
39673
|
[t]: {
|
|
@@ -39689,7 +39859,7 @@ function Input(e) {
|
|
|
39689
39859
|
className: l,
|
|
39690
39860
|
changeOnSelect: c,
|
|
39691
39861
|
fieldNames: u
|
|
39692
|
-
} = e, d = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: p, hashId: m, componentCls: h, rootPrefixCls: x } = useStyles$
|
|
39862
|
+
} = e, d = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: p, hashId: m, componentCls: h, rootPrefixCls: x } = useStyles$2();
|
|
39693
39863
|
useAntdInputStyle(`${x}-input`);
|
|
39694
39864
|
const f = useCompile(), { t: C } = useTranslation(), S = useForm(), [b, y] = React.useState([]), [v, I] = React.useState([]), A = useMemo(() => parseValue(t), [t]), T = typeof A == "string", w = T ? A : "", M = T ? null : A, $ = Object.assign(
|
|
39695
39865
|
{
|
|
@@ -39810,10 +39980,10 @@ function Input(e) {
|
|
|
39810
39980
|
className: cx("ant-input", { "ant-input-disabled": j }, m),
|
|
39811
39981
|
contentEditable: !j,
|
|
39812
39982
|
suppressContentEditableWarning: !0,
|
|
39813
|
-
children: /* @__PURE__ */ jsx(Tag, { contentEditable: !1, color: "blue", children: v.map((D, N) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39983
|
+
children: /* @__PURE__ */ jsx(Tag, { contentEditable: !1, color: "blue", children: v.map((D, N) => /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
39814
39984
|
N ? " / " : "",
|
|
39815
39985
|
D
|
|
39816
|
-
] })) })
|
|
39986
|
+
] }, D)) })
|
|
39817
39987
|
}
|
|
39818
39988
|
),
|
|
39819
39989
|
j ? null : /* @__PURE__ */ jsx(
|
|
@@ -39854,91 +40024,6 @@ function Input(e) {
|
|
|
39854
40024
|
] })
|
|
39855
40025
|
);
|
|
39856
40026
|
}
|
|
39857
|
-
const useStyles$2 = genStyleHook("nb-variable-select", (e) => {
|
|
39858
|
-
const { componentCls: t } = e;
|
|
39859
|
-
return {
|
|
39860
|
-
[t]: {
|
|
39861
|
-
position: "relative",
|
|
39862
|
-
".ant-select.ant-cascader": {
|
|
39863
|
-
position: "absolute",
|
|
39864
|
-
top: "-1px",
|
|
39865
|
-
right: "-1px",
|
|
39866
|
-
minWidth: "auto",
|
|
39867
|
-
width: "calc(100% + 2px)",
|
|
39868
|
-
height: "calc(100% + 2px)",
|
|
39869
|
-
overflow: "hidden",
|
|
39870
|
-
opacity: 0
|
|
39871
|
-
},
|
|
39872
|
-
".variable-btn": {
|
|
39873
|
-
fontStyle: "italic",
|
|
39874
|
-
fontFamily: "'New York', 'Times New Roman', Times, serif"
|
|
39875
|
-
},
|
|
39876
|
-
".Cascader-popupClassName": {
|
|
39877
|
-
".ant-cascader-menu": {
|
|
39878
|
-
marginBottom: 0
|
|
39879
|
-
}
|
|
39880
|
-
}
|
|
39881
|
-
}
|
|
39882
|
-
};
|
|
39883
|
-
});
|
|
39884
|
-
function VariableSelect({
|
|
39885
|
-
options: e,
|
|
39886
|
-
setOptions: t,
|
|
39887
|
-
onInsert: o,
|
|
39888
|
-
changeOnSelect: n = !1,
|
|
39889
|
-
fieldNames: r = {},
|
|
39890
|
-
className: i
|
|
39891
|
-
}) {
|
|
39892
|
-
const { t: a } = useTranslation(), [l, c] = useState([]), { wrapSSR: u, componentCls: d, hashId: p } = useStyles$2(), { token: m } = useToken();
|
|
39893
|
-
function h(x) {
|
|
39894
|
-
return V(this, null, function* () {
|
|
39895
|
-
var C;
|
|
39896
|
-
const f = x[x.length - 1];
|
|
39897
|
-
!((C = f.children) != null && C.length) && !f.isLeaf && f.loadChildren && (yield f.loadChildren(f), t((S) => [...S]));
|
|
39898
|
-
});
|
|
39899
|
-
}
|
|
39900
|
-
return u(
|
|
39901
|
-
/* @__PURE__ */ jsx(XButton, { className: cx("x-button", d, p, i), children: /* @__PURE__ */ jsx(
|
|
39902
|
-
Cascader$1,
|
|
39903
|
-
{
|
|
39904
|
-
placeholder: a("Select a variable"),
|
|
39905
|
-
value: [],
|
|
39906
|
-
options: e,
|
|
39907
|
-
fieldNames: r,
|
|
39908
|
-
loadData: h,
|
|
39909
|
-
onChange: (x = [], f = []) => {
|
|
39910
|
-
var S;
|
|
39911
|
-
if (c(x), !x.length)
|
|
39912
|
-
return;
|
|
39913
|
-
const C = f[f.length - 1];
|
|
39914
|
-
(!((S = C == null ? void 0 : C.children) != null && S.length) && !(C != null && C.loadChildren) || C != null && C.isLeaf) && o(x);
|
|
39915
|
-
},
|
|
39916
|
-
changeOnSelect: n,
|
|
39917
|
-
onClick: (x) => {
|
|
39918
|
-
var f;
|
|
39919
|
-
if (!(x.detail !== 2 || !n))
|
|
39920
|
-
for (let C = x.target; C && C !== x.currentTarget; C = C.parentNode)
|
|
39921
|
-
Array.from((f = C.classList) != null ? f : []).includes("ant-cascader-menu-item") && o(l);
|
|
39922
|
-
},
|
|
39923
|
-
popupClassName: "Cascader-popupClassName",
|
|
39924
|
-
dropdownRender: n ? (x) => /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39925
|
-
x,
|
|
39926
|
-
/* @__PURE__ */ jsx(
|
|
39927
|
-
"div",
|
|
39928
|
-
{
|
|
39929
|
-
style: {
|
|
39930
|
-
padding: "0.5em",
|
|
39931
|
-
borderTop: `1px solid ${m.colorBorder}`,
|
|
39932
|
-
color: m.colorTextDescription
|
|
39933
|
-
},
|
|
39934
|
-
children: a("Double click to choose entire object")
|
|
39935
|
-
}
|
|
39936
|
-
)
|
|
39937
|
-
] }) : null
|
|
39938
|
-
}
|
|
39939
|
-
) })
|
|
39940
|
-
);
|
|
39941
|
-
}
|
|
39942
40027
|
function setNativeInputValue(e, t) {
|
|
39943
40028
|
var n;
|
|
39944
40029
|
const o = (n = Object.getOwnPropertyDescriptor(e.constructor.prototype, "value")) == null ? void 0 : n.set;
|
|
@@ -40096,7 +40181,7 @@ function getCurrentRange(e) {
|
|
|
40096
40181
|
];
|
|
40097
40182
|
}
|
|
40098
40183
|
function TextArea(e) {
|
|
40099
|
-
const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$
|
|
40184
|
+
const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$2(), { value: r = "", scope: i, onChange: a, multiline: l = !0, changeOnSelect: c, style: u } = e, d = useRef(null), [p, m] = useState([]), h = useForm(), x = useMemo(() => createOptionsValueLabelMap(p), [p]), [f, C] = useState(!1), [S, b] = useState(!1), [y, v] = useState(() => renderHTML(r != null ? r : "", x)), [I, A] = useState([-1, 0, -1, 0]);
|
|
40100
40185
|
useAntdInputStyle("ant-input"), useEffect(() => {
|
|
40101
40186
|
preloadOptions(i, r).then((j) => {
|
|
40102
40187
|
m(j);
|
|
@@ -55351,7 +55436,7 @@ const commonOptions$e = {
|
|
|
55351
55436
|
const e = {}, t = useSchemaInitializerItem();
|
|
55352
55437
|
return /* @__PURE__ */ jsx(InitializerWithSwitch, F(g({}, t), { schema: e, item: t, type: "x-collection-field" }));
|
|
55353
55438
|
}, LinkMenuItem = () => {
|
|
55354
|
-
const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$
|
|
55439
|
+
const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$4(), i = useCallback(() => V(void 0, null, function* () {
|
|
55355
55440
|
const a = yield FormDialog(
|
|
55356
55441
|
t("Add link"),
|
|
55357
55442
|
() => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: o.scope, components: g({}, o.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
|
|
@@ -55406,7 +55491,7 @@ const commonOptions$e = {
|
|
|
55406
55491
|
}), [e, o.components, o.scope, t, n]);
|
|
55407
55492
|
return /* @__PURE__ */ jsx(SchemaInitializerItem, { title: t("Link"), onClick: i, className: r.menuItem });
|
|
55408
55493
|
}, PageMenuItem = () => {
|
|
55409
|
-
const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$
|
|
55494
|
+
const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$4(), i = useCallback(() => V(void 0, null, function* () {
|
|
55410
55495
|
const a = yield FormDialog(
|
|
55411
55496
|
t("Add page"),
|
|
55412
55497
|
() => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: o.scope, components: g({}, o.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
|
|
@@ -55470,7 +55555,7 @@ const commonOptions$e = {
|
|
|
55470
55555
|
}), [e, o.components, o.scope, t, n]);
|
|
55471
55556
|
return /* @__PURE__ */ jsx(SchemaInitializerItem, { title: t("Page"), onClick: i, className: r.menuItem });
|
|
55472
55557
|
}, GroupItem = () => {
|
|
55473
|
-
const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$
|
|
55558
|
+
const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$4(), i = useCallback(() => V(void 0, null, function* () {
|
|
55474
55559
|
const a = yield FormDialog(
|
|
55475
55560
|
t("Add group"),
|
|
55476
55561
|
() => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: o.scope, components: g({}, o.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
|
|
@@ -57253,7 +57338,7 @@ export {
|
|
|
57253
57338
|
useSortFields,
|
|
57254
57339
|
useSourceIdFromParentRecord,
|
|
57255
57340
|
useSourceIdFromRecord,
|
|
57256
|
-
useStyles$
|
|
57341
|
+
useStyles$4 as useStyles,
|
|
57257
57342
|
useSupportedBlocks,
|
|
57258
57343
|
useSyncFromForm,
|
|
57259
57344
|
useSystemSettings,
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { TextAreaProps } from 'antd/es/input';
|
|
11
11
|
export interface MarkdownEditorProps extends Omit<TextAreaProps, 'onSubmit'> {
|
|
12
|
+
scope: any[];
|
|
12
13
|
defaultValue?: string;
|
|
13
14
|
onSubmit?: (value: string) => void;
|
|
14
15
|
onCancel?: (e: React.MouseEvent) => void;
|
|
@@ -0,0 +1,9 @@
|
|
|
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 function registerQrcodeWebComponent(): void;
|