@nocobase/client 1.2.1-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$5;
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$5;
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.1-alpha", license = "AGPL-3.0", main = "lib/index.js", module = "es/index.mjs", types = "es/index.d.ts", dependencies = {
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.1-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.1-alpha",
3927
- "@nocobase/sdk": "1.2.1-alpha",
3928
- "@nocobase/utils": "1.2.1-alpha",
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",
@@ -12503,11 +12503,29 @@ const useStyles$i = createStyles(({ css: e, token: t }) => e`
12503
12503
  }
12504
12504
  `), BlockItem = withDynamicSchemaProps(
12505
12505
  (e) => {
12506
- 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]);
12507
- return /* @__PURE__ */ jsxs(SortableItem, { role: "button", "aria-label": l, className: cls("nb-block-item", t, n), children: [
12508
- i(),
12509
- /* @__PURE__ */ jsx(ErrorBoundary, { FallbackComponent: ErrorFallback, onError: (c) => console.log(c), children: o })
12510
- ] });
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
+ );
12511
12529
  },
12512
12530
  { displayName: "BlockItem" }
12513
12531
  ), TestDesigner = () => {
@@ -28714,7 +28732,7 @@ const useFieldComponentOptions = () => {
28714
28732
  var l;
28715
28733
  e != null && e.title || (e.title = i((l = r == null ? void 0 : r.uiSchema) == null ? void 0 : l.title));
28716
28734
  }, [(a = r == null ? void 0 : r.uiSchema) == null ? void 0 : a.title]);
28717
- }, 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) => {
28718
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);
28719
28737
  return l + u + c;
28720
28738
  }, useFullScreenHeight = (e) => {
@@ -30463,7 +30481,7 @@ const FixedBlockContext = React.createContext({
30463
30481
  }
30464
30482
  },
30465
30483
  ".nb-page-wrapper": {
30466
- padding: `${e.paddingPageVertical}px ${e.paddingPageHorizontal}px 0px ${e.paddingPageHorizontal}px`,
30484
+ padding: `${e.paddingPageVertical}px`,
30467
30485
  flex: 1
30468
30486
  }
30469
30487
  }
@@ -36206,29 +36224,174 @@ function convertToText(e) {
36206
36224
  const n = o.innerText;
36207
36225
  return o = null, (n == null ? void 0 : n.replace(/[\n\r]/g, "")) || "";
36208
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
+ }
36209
36350
  const MarkdownEditor = (e) => {
36210
- const { t } = useTranslation(), [o, n] = useState(e.defaultValue);
36211
- return /* @__PURE__ */ jsxs("div", { className: "mb-markdown", style: { position: "relative" }, children: [
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: [
36212
36372
  /* @__PURE__ */ jsx(
36213
36373
  Input$3.TextArea,
36214
36374
  F(g({
36375
+ ref: i,
36215
36376
  autoSize: { minRows: 3 }
36216
36377
  }, e), {
36217
- value: o,
36218
- onChange: (r) => {
36219
- n(r.target.value);
36220
- }
36378
+ value: n,
36379
+ onChange: (p) => {
36380
+ r(p.target.value);
36381
+ },
36382
+ style: { paddingBottom: "40px" }
36221
36383
  })
36222
36384
  ),
36385
+ /* @__PURE__ */ jsx("div", { style: { position: "absolute", top: 21, right: 1 }, children: /* @__PURE__ */ jsx(VariableSelect, { options: a, setOptions: l, onInsert: d }) }),
36223
36386
  /* @__PURE__ */ jsxs(Space$1, { style: { position: "absolute", bottom: 5, right: 5 }, children: [
36224
36387
  /* @__PURE__ */ jsx(
36225
36388
  Button,
36226
36389
  {
36227
- onClick: (r) => {
36228
- var i;
36229
- (i = e.onCancel) == null || i.call(e, r);
36390
+ onClick: (p) => {
36391
+ var m;
36392
+ (m = e.onCancel) == null || m.call(e, p);
36230
36393
  },
36231
- children: t("Cancel")
36394
+ children: o("Cancel")
36232
36395
  }
36233
36396
  ),
36234
36397
  /* @__PURE__ */ jsx(
@@ -36236,10 +36399,10 @@ const MarkdownEditor = (e) => {
36236
36399
  {
36237
36400
  type: "primary",
36238
36401
  onClick: () => {
36239
- var r;
36240
- (r = e.onSubmit) == null || r.call(e, o);
36402
+ var p;
36403
+ (p = e.onSubmit) == null || p.call(e, n);
36241
36404
  },
36242
- children: t("Save")
36405
+ children: o("Save")
36243
36406
  }
36244
36407
  )
36245
36408
  ] })
@@ -36248,24 +36411,41 @@ const MarkdownEditor = (e) => {
36248
36411
  const { token: e } = theme.useToken(), t = useBlockHeight();
36249
36412
  if (t)
36250
36413
  return t - 2 * e.paddingLG;
36251
- }, MarkdownVoid = observer$1(
36252
- (e) => {
36253
- 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, { html: p, loading: m } = useParseMarkdown(r), h = useMarkdownHeight();
36254
- return m ? /* @__PURE__ */ jsx(Spin, {}) : a != null && a.editable ? /* @__PURE__ */ jsx(
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(
36255
36433
  MarkdownEditor,
36256
- F(g({}, e), {
36434
+ F(g({
36435
+ scope: v
36436
+ }, e), {
36257
36437
  className: !0,
36258
36438
  defaultValue: r,
36259
36439
  onCancel: () => {
36260
36440
  a.editable = !1, d == null || d();
36261
36441
  },
36262
- onSubmit: (x) => V(void 0, null, function* () {
36263
- var f;
36264
- a.editable = !1, (f = l["x-component-props"]) != null || (l["x-component-props"] = {}), l["x-component-props"].content = x, a.componentProps.content = x, u == null || u(l), c.emit("patch", {
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", {
36265
36445
  schema: {
36266
36446
  "x-uid": l["x-uid"],
36267
36447
  "x-component-props": {
36268
- content: x
36448
+ content: I
36269
36449
  }
36270
36450
  }
36271
36451
  });
@@ -36275,11 +36455,11 @@ const MarkdownEditor = (e) => {
36275
36455
  "div",
36276
36456
  {
36277
36457
  className: cls([o, n, "nb-markdown nb-markdown-default nb-markdown-table", i]),
36278
- style: F(g({}, e.style), { height: h || "100%", overflow: "auto" }),
36279
- dangerouslySetInnerHTML: { __html: p }
36458
+ style: F(g({}, e.style), { height: y || "100%", overflow: "auto" }),
36459
+ dangerouslySetInnerHTML: { __html: h }
36280
36460
  }
36281
36461
  );
36282
- },
36462
+ }),
36283
36463
  { displayName: "MarkdownVoid" }
36284
36464
  );
36285
36465
  MarkdownVoid.Designer = MarkdownVoidDesigner;
@@ -37111,7 +37291,7 @@ Menu.SubMenu = observer$1(
37111
37291
  { displayName: "Menu.SubMenu" }
37112
37292
  );
37113
37293
  Menu.Designer = MenuDesigner;
37114
- const useStyles$5 = createStyles(({ token: e }) => ({
37294
+ const useStyles$4 = createStyles(({ token: e }) => ({
37115
37295
  menuItem: {
37116
37296
  paddingLeft: `${e.padding}px !important`,
37117
37297
  paddingRight: `${e.padding}px !important`
@@ -37534,7 +37714,7 @@ RecordPicker.Selector = ActionContainer;
37534
37714
  * Copyright (c) 2014, Jason Chen
37535
37715
  * Copyright (c) 2013, salesforce.com
37536
37716
  */
37537
- const useStyles$4 = genStyleHook("nb-rich-text", (e) => {
37717
+ const useStyles$3 = genStyleHook("nb-rich-text", (e) => {
37538
37718
  const { componentCls: t } = e;
37539
37719
  return {
37540
37720
  [t]: {
@@ -38166,7 +38346,7 @@ const useStyles$4 = genStyleHook("nb-rich-text", (e) => {
38166
38346
  };
38167
38347
  }), RichText = connect(
38168
38348
  (e) => {
38169
- const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$4(), r = {
38349
+ const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$3(), r = {
38170
38350
  toolbar: [["bold", "italic", "underline", "link"], [{ list: "ordered" }, { list: "bullet" }], ["clean"]]
38171
38351
  }, i = [
38172
38352
  "header",
@@ -39487,18 +39667,7 @@ const ReadPretty = observer$1(
39487
39667
  })
39488
39668
  ),
39489
39669
  mapReadPretty(ReadPretty)
39490
- ), XButton = forwardRef((e, t) => {
39491
- const o = useMemo(() => ({
39492
- fontStyle: "italic",
39493
- fontFamily: "New York, Times New Roman, Times, serif"
39494
- }), []);
39495
- return /* @__PURE__ */ jsxs(Button, F(g({ "aria-label": "variable-button", ref: t, style: o }, e), { children: [
39496
- "x",
39497
- e.children
39498
- ] }));
39499
- });
39500
- XButton.displayName = "XButton";
39501
- const useStyles$3 = genStyleHook("nb-variable", (e) => {
39670
+ ), useStyles$2 = genStyleHook("nb-variable", (e) => {
39502
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;
39503
39672
  return {
39504
39673
  [t]: {
@@ -39690,7 +39859,7 @@ function Input(e) {
39690
39859
  className: l,
39691
39860
  changeOnSelect: c,
39692
39861
  fieldNames: u
39693
- } = e, d = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: p, hashId: m, componentCls: h, rootPrefixCls: x } = useStyles$3();
39862
+ } = e, d = typeof e.scope == "function" ? e.scope() : e.scope, { wrapSSR: p, hashId: m, componentCls: h, rootPrefixCls: x } = useStyles$2();
39694
39863
  useAntdInputStyle(`${x}-input`);
39695
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(
39696
39865
  {
@@ -39811,10 +39980,10 @@ function Input(e) {
39811
39980
  className: cx("ant-input", { "ant-input-disabled": j }, m),
39812
39981
  contentEditable: !j,
39813
39982
  suppressContentEditableWarning: !0,
39814
- 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: [
39815
39984
  N ? " / " : "",
39816
39985
  D
39817
- ] })) })
39986
+ ] }, D)) })
39818
39987
  }
39819
39988
  ),
39820
39989
  j ? null : /* @__PURE__ */ jsx(
@@ -39855,91 +40024,6 @@ function Input(e) {
39855
40024
  ] })
39856
40025
  );
39857
40026
  }
39858
- const useStyles$2 = genStyleHook("nb-variable-select", (e) => {
39859
- const { componentCls: t } = e;
39860
- return {
39861
- [t]: {
39862
- position: "relative",
39863
- ".ant-select.ant-cascader": {
39864
- position: "absolute",
39865
- top: "-1px",
39866
- right: "-1px",
39867
- minWidth: "auto",
39868
- width: "calc(100% + 2px)",
39869
- height: "calc(100% + 2px)",
39870
- overflow: "hidden",
39871
- opacity: 0
39872
- },
39873
- ".variable-btn": {
39874
- fontStyle: "italic",
39875
- fontFamily: "'New York', 'Times New Roman', Times, serif"
39876
- },
39877
- ".Cascader-popupClassName": {
39878
- ".ant-cascader-menu": {
39879
- marginBottom: 0
39880
- }
39881
- }
39882
- }
39883
- };
39884
- });
39885
- function VariableSelect({
39886
- options: e,
39887
- setOptions: t,
39888
- onInsert: o,
39889
- changeOnSelect: n = !1,
39890
- fieldNames: r = {},
39891
- className: i
39892
- }) {
39893
- const { t: a } = useTranslation(), [l, c] = useState([]), { wrapSSR: u, componentCls: d, hashId: p } = useStyles$2(), { token: m } = useToken();
39894
- function h(x) {
39895
- return V(this, null, function* () {
39896
- var C;
39897
- const f = x[x.length - 1];
39898
- !((C = f.children) != null && C.length) && !f.isLeaf && f.loadChildren && (yield f.loadChildren(f), t((S) => [...S]));
39899
- });
39900
- }
39901
- return u(
39902
- /* @__PURE__ */ jsx(XButton, { className: cx("x-button", d, p, i), children: /* @__PURE__ */ jsx(
39903
- Cascader$1,
39904
- {
39905
- placeholder: a("Select a variable"),
39906
- value: [],
39907
- options: e,
39908
- fieldNames: r,
39909
- loadData: h,
39910
- onChange: (x = [], f = []) => {
39911
- var S;
39912
- if (c(x), !x.length)
39913
- return;
39914
- const C = f[f.length - 1];
39915
- (!((S = C == null ? void 0 : C.children) != null && S.length) && !(C != null && C.loadChildren) || C != null && C.isLeaf) && o(x);
39916
- },
39917
- changeOnSelect: n,
39918
- onClick: (x) => {
39919
- var f;
39920
- if (!(x.detail !== 2 || !n))
39921
- for (let C = x.target; C && C !== x.currentTarget; C = C.parentNode)
39922
- Array.from((f = C.classList) != null ? f : []).includes("ant-cascader-menu-item") && o(l);
39923
- },
39924
- popupClassName: "Cascader-popupClassName",
39925
- dropdownRender: n ? (x) => /* @__PURE__ */ jsxs(Fragment, { children: [
39926
- x,
39927
- /* @__PURE__ */ jsx(
39928
- "div",
39929
- {
39930
- style: {
39931
- padding: "0.5em",
39932
- borderTop: `1px solid ${m.colorBorder}`,
39933
- color: m.colorTextDescription
39934
- },
39935
- children: a("Double click to choose entire object")
39936
- }
39937
- )
39938
- ] }) : null
39939
- }
39940
- ) })
39941
- );
39942
- }
39943
40027
  function setNativeInputValue(e, t) {
39944
40028
  var n;
39945
40029
  const o = (n = Object.getOwnPropertyDescriptor(e.constructor.prototype, "value")) == null ? void 0 : n.set;
@@ -40097,7 +40181,7 @@ function getCurrentRange(e) {
40097
40181
  ];
40098
40182
  }
40099
40183
  function TextArea(e) {
40100
- const { wrapSSR: t, hashId: o, componentCls: n } = useStyles$3(), { 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]);
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]);
40101
40185
  useAntdInputStyle("ant-input"), useEffect(() => {
40102
40186
  preloadOptions(i, r).then((j) => {
40103
40187
  m(j);
@@ -55352,7 +55436,7 @@ const commonOptions$e = {
55352
55436
  const e = {}, t = useSchemaInitializerItem();
55353
55437
  return /* @__PURE__ */ jsx(InitializerWithSwitch, F(g({}, t), { schema: e, item: t, type: "x-collection-field" }));
55354
55438
  }, LinkMenuItem = () => {
55355
- const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$5(), i = useCallback(() => V(void 0, null, function* () {
55439
+ const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$4(), i = useCallback(() => V(void 0, null, function* () {
55356
55440
  const a = yield FormDialog(
55357
55441
  t("Add link"),
55358
55442
  () => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: o.scope, components: g({}, o.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
@@ -55407,7 +55491,7 @@ const commonOptions$e = {
55407
55491
  }), [e, o.components, o.scope, t, n]);
55408
55492
  return /* @__PURE__ */ jsx(SchemaInitializerItem, { title: t("Link"), onClick: i, className: r.menuItem });
55409
55493
  }, PageMenuItem = () => {
55410
- const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$5(), i = useCallback(() => V(void 0, null, function* () {
55494
+ const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$4(), i = useCallback(() => V(void 0, null, function* () {
55411
55495
  const a = yield FormDialog(
55412
55496
  t("Add page"),
55413
55497
  () => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: o.scope, components: g({}, o.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
@@ -55471,7 +55555,7 @@ const commonOptions$e = {
55471
55555
  }), [e, o.components, o.scope, t, n]);
55472
55556
  return /* @__PURE__ */ jsx(SchemaInitializerItem, { title: t("Page"), onClick: i, className: r.menuItem });
55473
55557
  }, GroupItem = () => {
55474
- const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$5(), i = useCallback(() => V(void 0, null, function* () {
55558
+ const { insert: e } = useSchemaInitializer(), { t } = useTranslation(), o = useContext(SchemaOptionsContext), { theme: n } = useGlobalTheme(), { styles: r } = useStyles$4(), i = useCallback(() => V(void 0, null, function* () {
55475
55559
  const a = yield FormDialog(
55476
55560
  t("Add group"),
55477
55561
  () => /* @__PURE__ */ jsx(SchemaComponentOptions, { scope: o.scope, components: g({}, o.components), children: /* @__PURE__ */ jsx(FormLayout, { layout: "vertical", children: /* @__PURE__ */ jsx(
@@ -57254,7 +57338,7 @@ export {
57254
57338
  useSortFields,
57255
57339
  useSourceIdFromParentRecord,
57256
57340
  useSourceIdFromRecord,
57257
- useStyles$5 as useStyles,
57341
+ useStyles$4 as useStyles,
57258
57342
  useSupportedBlocks,
57259
57343
  useSyncFromForm,
57260
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;