@nocobase/client 0.19.0-alpha.7 → 0.19.0-alpha.9

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
@@ -79,7 +79,7 @@ import { Outlet, UNSAFE_RouteContext, UNSAFE_LocationContext, useRoutes, HashRou
79
79
  import * as nocobaseSDK from "@nocobase/sdk";
80
80
  import { APIClient as APIClient$1, getSubAppName } from "@nocobase/sdk";
81
81
  import * as antd from "antd";
82
- import { notification, Spin, Select as Select$1, App, theme, ConfigProvider, message, Popover, Menu as Menu$1, Switch, Divider, Button, Input as Input$4, Tag, Card, Empty, Collapse, Badge, Tree as Tree$2, Space as Space$1, Radio as Radio$1, Tooltip, Modal, Alert, Dropdown, Cascader as Cascader$1, Drawer as Drawer$1, Flex, TreeSelect as TreeSelect$2, Typography, Progress, Upload as Upload$1, Table as Table$2, AutoComplete as AutoComplete$1, Checkbox as Checkbox$1, ColorPicker as ColorPicker$1, DatePicker as DatePicker$1, Slider, List as List$1, Col, InputNumber as InputNumber$1, Result as Result$1, Tabs as Tabs$1, Pagination as Pagination$1, TimePicker as TimePicker$1, Row, Layout, Popconfirm } from "antd";
82
+ import { notification, Spin, Select as Select$1, App, theme, ConfigProvider, message, Popover, Menu as Menu$1, Switch, Divider, Button, Input as Input$4, Tag, Card, Empty, Collapse, Badge, Tree as Tree$2, Space as Space$1, Radio as Radio$1, Tooltip, Modal, Alert, Dropdown, Cascader as Cascader$1, Drawer as Drawer$1, Flex, TreeSelect as TreeSelect$2, Typography, Progress, Upload as Upload$1, Table as Table$2, AutoComplete as AutoComplete$1, Checkbox as Checkbox$1, ColorPicker as ColorPicker$1, DatePicker as DatePicker$1, Slider, List as List$1, Col, InputNumber as InputNumber$1, Result as Result$1, Tabs as Tabs$1, Pagination as Pagination$1, TimePicker as TimePicker$1, Row, Popconfirm, Layout } from "antd";
83
83
  import * as formilyShared from "@formily/shared";
84
84
  import { merge, uid, isArr, toArr as toArr$3, isValid, each, clone as clone$1, isFn, applyMiddleware, isNum as isNum$1, isStr, isBool } from "@formily/shared";
85
85
  import * as ahooks from "ahooks";
@@ -100,14 +100,14 @@ import * as dndKitCore from "@dnd-kit/core";
100
100
  import { DndContext as DndContext$1, rectIntersection, DragOverlay, useDraggable, useDroppable, useDndContext, useDndMonitor, useSensor, MouseSensor, useSensors } from "@dnd-kit/core";
101
101
  import cronstrue from "cronstrue";
102
102
  import * as formilyJsonReactive from "@formily/reactive";
103
- import { untracked, define, observable, action, reaction, autorun, toJS } from "@formily/reactive";
103
+ import { raw, untracked, define, observable, action, reaction, autorun, toJS } from "@formily/reactive";
104
104
  import get from "lodash/get";
105
105
  import merge$1 from "lodash/merge";
106
106
  import set$1 from "lodash/set";
107
107
  import { createRoot as createRoot$1 } from "react-dom/client";
108
108
  import { TinyColor } from "@ctrl/tinycolor";
109
109
  import * as antIcons from "@ant-design/icons";
110
- import antIcons__default, { createFromIconfontCN, RightOutlined, CopyOutlined, HighlightOutlined, CloseCircleOutlined, MenuOutlined, PlusOutlined, DragOutlined, CloseCircleFilled, CloseOutlined, LoadingOutlined, DownloadOutlined, DeleteOutlined, EditOutlined, DownOutlined, CheckOutlined, InboxOutlined, RightSquareOutlined, SyncOutlined, ExclamationCircleFilled, ApiOutlined, SettingOutlined, ReadOutlined, ReloadOutlined, SearchOutlined, FormOutlined, TableOutlined, OrderedListOutlined, DisconnectOutlined } from "@ant-design/icons";
110
+ import antIcons__default, { createFromIconfontCN, RightOutlined, CopyOutlined, HighlightOutlined, CloseCircleOutlined, MenuOutlined, PlusOutlined, DragOutlined, CloseCircleFilled, CloseOutlined, LoadingOutlined, DownloadOutlined, DeleteOutlined, EditOutlined, DownOutlined, CheckOutlined, InboxOutlined, UserOutlined, RightSquareOutlined, SyncOutlined, ExclamationCircleFilled, ApiOutlined, SettingOutlined, ReadOutlined, ReloadOutlined, QuestionCircleOutlined, SearchOutlined, FormOutlined, TableOutlined, OrderedListOutlined, DisconnectOutlined } from "@ant-design/icons";
111
111
  import * as formilyReactiveReact from "@formily/reactive-react";
112
112
  import { observer } from "@formily/reactive-react";
113
113
  import { ErrorBoundary, useErrorBoundary } from "react-error-boundary";
@@ -312,6 +312,9 @@ const nocobaseClient = /* @__PURE__ */ _mergeNamespaces({
312
312
  get ApplicationContext() {
313
313
  return ApplicationContext;
314
314
  },
315
+ get AssignedFieldValues() {
316
+ return AssignedFieldValues;
317
+ },
315
318
  get AssociationField() {
316
319
  return AssociationField;
317
320
  },
@@ -1198,7 +1201,7 @@ const nocobaseClient = /* @__PURE__ */ _mergeNamespaces({
1198
1201
  return SettingsCenterDropdown;
1199
1202
  },
1200
1203
  get SettingsMenu() {
1201
- return SettingsMenu;
1204
+ return SettingsMenu$1;
1202
1205
  },
1203
1206
  get Sortable() {
1204
1207
  return Sortable;
@@ -2547,20 +2550,6 @@ const useAppSpin = () => {
2547
2550
  }
2548
2551
  };
2549
2552
  };
2550
- const CurrentAppInfoContext = createContext(null);
2551
- const useCurrentAppInfo = () => {
2552
- return useContext(CurrentAppInfoContext);
2553
- };
2554
- const CurrentAppInfoProvider = (props) => {
2555
- const { render: render2 } = useAppSpin();
2556
- const result = useRequest({
2557
- url: "app:getInfo"
2558
- });
2559
- if (result.loading) {
2560
- return render2();
2561
- }
2562
- return /* @__PURE__ */ jsx(CurrentAppInfoContext.Provider, { value: result.data, children: props.children });
2563
- };
2564
2553
  const useCloseAction$3 = () => {
2565
2554
  const { setVisible } = useActionContext();
2566
2555
  const form = useForm();
@@ -3482,7 +3471,9 @@ const VariablesProvider = ({ children }) => {
3482
3471
  data = yield waitForData;
3483
3472
  clearRequested(url2);
3484
3473
  }
3485
- current[key] = data.data.data;
3474
+ if (!raw(current)[key]) {
3475
+ raw(current)[key] = data.data.data;
3476
+ }
3486
3477
  current = getValuesByPath(current, key);
3487
3478
  } else {
3488
3479
  current = getValuesByPath(current, key);
@@ -8511,7 +8502,7 @@ const InternalExpiresRadio = (props) => {
8511
8502
  style: { width: "150px" },
8512
8503
  defaultValue: targetValue,
8513
8504
  onChange: (e) => {
8514
- if (e.target.value && moment(timeFormat ? date.format() : date.toLocaleString(), e.target.value).isValid()) {
8505
+ if (e.target.value) {
8515
8506
  setCustomFormatPreview(date.format(e.target.value));
8516
8507
  } else {
8517
8508
  setCustomFormatPreview(null);
@@ -8523,9 +8514,9 @@ const InternalExpiresRadio = (props) => {
8523
8514
  }
8524
8515
  ),
8525
8516
  /* @__PURE__ */ jsx(DateTimeFormatPreview, { content: customFormatPreview })
8526
- ] });
8517
+ ] }, v.value);
8527
8518
  }
8528
- return /* @__PURE__ */ jsx(Radio$1, { value: v.value, children: v.label });
8519
+ return /* @__PURE__ */ jsx(Radio$1, { value: v.value, children: v.label }, v.value);
8529
8520
  }) }) }) });
8530
8521
  };
8531
8522
  const ExpiresRadio = connect(
@@ -11908,13 +11899,13 @@ const SchemaSettingsDateFormat = function DateFormatConfig(props) {
11908
11899
  }
11909
11900
  `,
11910
11901
  defaultValue: "dddd",
11911
- formats: ["MMMMM Do YYYY", "YYYY-MM-DD", "MM/DD/YY", "YYYY/MM/DD", "DD/MM/YYYY"]
11902
+ formats: ["MMMM Do YYYY", "YYYY-MM-DD", "MM/DD/YY", "YYYY/MM/DD", "DD/MM/YYYY"]
11912
11903
  },
11913
11904
  default: dateFormatDefaultValue,
11914
11905
  enum: [
11915
11906
  {
11916
- label: DateFormatCom({ format: "MMMMM Do YYYY" }),
11917
- value: "MMMMM Do YYYY"
11907
+ label: DateFormatCom({ format: "MMMM Do YYYY" }),
11908
+ value: "MMMM Do YYYY"
11918
11909
  },
11919
11910
  {
11920
11911
  label: DateFormatCom({ format: "YYYY-MM-DD" }),
@@ -15221,7 +15212,7 @@ const createFormBlockSchema = (options) => {
15221
15212
  "x-initializer": formItemInitializers2,
15222
15213
  properties: {}
15223
15214
  },
15224
- actions: {
15215
+ [uid()]: {
15225
15216
  type: "void",
15226
15217
  "x-initializer": actionInitializers,
15227
15218
  "x-component": "ActionBar",
@@ -15287,7 +15278,7 @@ const createFilterFormBlockSchema = (options) => {
15287
15278
  "x-initializer": formItemInitializers2,
15288
15279
  properties: {}
15289
15280
  },
15290
- actions: {
15281
+ [uid()]: {
15291
15282
  type: "void",
15292
15283
  "x-initializer": actionInitializers,
15293
15284
  "x-component": "ActionBar",
@@ -15345,7 +15336,7 @@ const createReadPrettyFormBlockSchema = (options) => {
15345
15336
  useProps: "{{ useFormBlockProps }}"
15346
15337
  },
15347
15338
  properties: {
15348
- actions: {
15339
+ [uid()]: {
15349
15340
  type: "void",
15350
15341
  "x-initializer": actionInitializers,
15351
15342
  "x-component": "ActionBar",
@@ -15447,7 +15438,7 @@ const createTableBlockSchema = (options) => {
15447
15438
  "x-designer": "TableV2.ActionColumnDesigner",
15448
15439
  "x-initializer": tableActionColumnInitializers2 != null ? tableActionColumnInitializers2 : "TableActionColumnInitializers",
15449
15440
  properties: {
15450
- actions: {
15441
+ [uid()]: {
15451
15442
  type: "void",
15452
15443
  "x-decorator": "DndContext",
15453
15444
  "x-component": "Space",
@@ -15510,7 +15501,7 @@ const createTableSelectorSchema = (options) => {
15510
15501
  "x-designer": "TableSelectorDesigner",
15511
15502
  "x-component": "CardItem",
15512
15503
  properties: {
15513
- actions: {
15504
+ [uid()]: {
15514
15505
  type: "void",
15515
15506
  "x-initializer": "TableActionInitializers",
15516
15507
  "x-component": "ActionBar",
@@ -16679,7 +16670,8 @@ const ReadPretty$e = observer$1(
16679
16670
  if (isArrayField(field) && ((_a = field == null ? void 0 : field.value) == null ? void 0 : _a.length) === 0) {
16680
16671
  return /* @__PURE__ */ jsx("div", {});
16681
16672
  }
16682
- const dataSource2 = field.dataSource || props.options || [];
16673
+ const { uiSchema } = useCollectionField$1();
16674
+ const dataSource2 = field.dataSource || props.options || uiSchema.enum || [];
16683
16675
  const currentOptions = getCurrentOptions(field.value, dataSource2, fieldNames);
16684
16676
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: props.ellipsis, children: currentOptions.map((option, key) => /* @__PURE__ */ jsx(Tag, { color: option[fieldNames.color], icon: option.icon, children: option[fieldNames.label] }, key)) }) });
16685
16677
  },
@@ -19686,16 +19678,22 @@ const useAssociationNames$1 = () => {
19686
19678
  const isAssociationSubfield = s2.name.includes(".");
19687
19679
  const isAssociationField = collectionField && ["hasOne", "hasMany", "belongsTo", "belongsToMany"].includes(collectionField.type);
19688
19680
  if (s2["x-linkage-rules"]) {
19689
- const rules = s2["x-linkage-rules"];
19690
- rules.forEach(({ condition }) => {
19691
- const type2 = Object.keys(condition)[0] || "$and";
19692
- const list = condition[type2];
19681
+ const collectAppends = (obj) => {
19682
+ const type2 = Object.keys(obj)[0] || "$and";
19683
+ const list = obj[type2];
19693
19684
  list.forEach((item) => {
19685
+ if ("$and" in item || "$or" in item) {
19686
+ return collectAppends(item);
19687
+ }
19694
19688
  const fieldNames = getTargetField$1(item);
19695
19689
  if (fieldNames.length > 1) {
19696
19690
  appends.add(fieldNames.join("."));
19697
19691
  }
19698
19692
  });
19693
+ };
19694
+ const rules = s2["x-linkage-rules"];
19695
+ rules.forEach(({ condition }) => {
19696
+ collectAppends(condition);
19699
19697
  });
19700
19698
  }
19701
19699
  const isTreeCollection = isAssociationField && ((_a = getCollection(collectionField.target)) == null ? void 0 : _a.template) === "tree";
@@ -20669,7 +20667,7 @@ const openSizeWidthMap = /* @__PURE__ */ new Map([
20669
20667
  const ActionModal = observer$1(
20670
20668
  (props) => {
20671
20669
  const _a = props, { footerNodeName = "Action.Modal.Footer", width } = _a, others = __objRest(_a, ["footerNodeName", "width"]);
20672
- const { visible, setVisible, openSize = "large", modalProps } = useActionContext();
20670
+ const { visible, setVisible, openSize = "middle", modalProps } = useActionContext();
20673
20671
  const actualWidth = width != null ? width : openSizeWidthMap.get(openSize);
20674
20672
  const schema3 = useFieldSchema();
20675
20673
  const field = useField();
@@ -20705,24 +20703,14 @@ const ActionModal = observer$1(
20705
20703
  `
20706
20704
  ),
20707
20705
  footer: footerSchema ? /* @__PURE__ */ jsx(
20708
- "div",
20706
+ RecursionField,
20709
20707
  {
20710
- className: css`
20711
- display: flex;
20712
- justify-content: flex-end;
20713
- width: 100%;
20714
- `,
20715
- children: /* @__PURE__ */ jsx(
20716
- RecursionField,
20717
- {
20718
- basePath: field.address,
20719
- schema: schema3,
20720
- onlyRenderProperties: true,
20721
- filterProperties: (s2) => {
20722
- return s2["x-component"] === footerNodeName;
20723
- }
20724
- }
20725
- )
20708
+ basePath: field.address,
20709
+ schema: schema3,
20710
+ onlyRenderProperties: true,
20711
+ filterProperties: (s2) => {
20712
+ return s2["x-component"] === footerNodeName;
20713
+ }
20726
20714
  }
20727
20715
  ) : false,
20728
20716
  children: /* @__PURE__ */ jsx(
@@ -21521,13 +21509,16 @@ function getAllKeys(obj) {
21521
21509
  return keys;
21522
21510
  }
21523
21511
  const conditionAnalyses = (_0) => __async(void 0, [_0], function* ({
21524
- rules,
21512
+ ruleGroup,
21525
21513
  variables,
21526
21514
  localVariables
21527
21515
  }) {
21528
- const type2 = Object.keys(rules)[0] || "$and";
21529
- const conditions = rules[type2];
21516
+ const type2 = Object.keys(ruleGroup)[0] || "$and";
21517
+ const conditions = ruleGroup[type2];
21530
21518
  let results2 = conditions.map((condition) => __async(void 0, null, function* () {
21519
+ if ("$and" in condition || "$or" in condition) {
21520
+ return yield conditionAnalyses({ ruleGroup: condition, variables, localVariables });
21521
+ }
21531
21522
  const jsonlogic = getInnermostKeyAndValue(condition);
21532
21523
  const operator = jsonlogic == null ? void 0 : jsonlogic.key;
21533
21524
  if (!operator) {
@@ -21574,7 +21565,6 @@ const collectFieldStateOfLinkageRules = ({
21574
21565
  value,
21575
21566
  field,
21576
21567
  condition,
21577
- values,
21578
21568
  variables,
21579
21569
  localVariables
21580
21570
  }) => {
@@ -21586,13 +21576,17 @@ const collectFieldStateOfLinkageRules = ({
21586
21576
  const { evaluate } = evaluators.get("formula.js");
21587
21577
  switch (operator) {
21588
21578
  case ActionType.Required:
21589
- requiredResult.push(getTempFieldState(conditionAnalyses({ rules: condition, variables, localVariables }), true));
21579
+ requiredResult.push(
21580
+ getTempFieldState(conditionAnalyses({ ruleGroup: condition, variables, localVariables }), true)
21581
+ );
21590
21582
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
21591
21583
  required: requiredResult
21592
21584
  });
21593
21585
  break;
21594
21586
  case ActionType.InRequired:
21595
- requiredResult.push(getTempFieldState(conditionAnalyses({ rules: condition, variables, localVariables }), false));
21587
+ requiredResult.push(
21588
+ getTempFieldState(conditionAnalyses({ ruleGroup: condition, variables, localVariables }), false)
21589
+ );
21596
21590
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
21597
21591
  required: requiredResult
21598
21592
  });
@@ -21601,7 +21595,7 @@ const collectFieldStateOfLinkageRules = ({
21601
21595
  case ActionType.None:
21602
21596
  case ActionType.Hidden:
21603
21597
  displayResult.push(
21604
- getTempFieldState(conditionAnalyses({ rules: condition, variables, localVariables }), operator)
21598
+ getTempFieldState(conditionAnalyses({ ruleGroup: condition, variables, localVariables }), operator)
21605
21599
  );
21606
21600
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
21607
21601
  display: displayResult
@@ -21611,7 +21605,7 @@ const collectFieldStateOfLinkageRules = ({
21611
21605
  case ActionType.ReadOnly:
21612
21606
  case ActionType.ReadPretty:
21613
21607
  patternResult.push(
21614
- getTempFieldState(conditionAnalyses({ rules: condition, variables, localVariables }), operator)
21608
+ getTempFieldState(conditionAnalyses({ ruleGroup: condition, variables, localVariables }), operator)
21615
21609
  );
21616
21610
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
21617
21611
  pattern: patternResult
@@ -21644,7 +21638,7 @@ const collectFieldStateOfLinkageRules = ({
21644
21638
  valueResult.push(getTempFieldState(true, getValue2()));
21645
21639
  } else {
21646
21640
  valueResult.push(
21647
- getTempFieldState(conditionAnalyses({ rules: condition, variables, localVariables }), getValue2())
21641
+ getTempFieldState(conditionAnalyses({ ruleGroup: condition, variables, localVariables }), getValue2())
21648
21642
  );
21649
21643
  }
21650
21644
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
@@ -21921,7 +21915,7 @@ const linkageAction = (_0) => __async(void 0, [_0], function* ({
21921
21915
  const displayResult = ((_b = field == null ? void 0 : field.stateOfLinkageRules) == null ? void 0 : _b.display) || ["visible"];
21922
21916
  switch (operator) {
21923
21917
  case ActionType.Visible:
21924
- if (yield conditionAnalyses({ rules: condition, variables, localVariables })) {
21918
+ if (yield conditionAnalyses({ ruleGroup: condition, variables, localVariables })) {
21925
21919
  displayResult.push(operator);
21926
21920
  field.data = field.data || {};
21927
21921
  field.data.hidden = false;
@@ -21932,7 +21926,7 @@ const linkageAction = (_0) => __async(void 0, [_0], function* ({
21932
21926
  field.display = last(displayResult);
21933
21927
  break;
21934
21928
  case ActionType.Hidden:
21935
- if (yield conditionAnalyses({ rules: condition, variables, localVariables })) {
21929
+ if (yield conditionAnalyses({ ruleGroup: condition, variables, localVariables })) {
21936
21930
  field.data = field.data || {};
21937
21931
  field.data.hidden = true;
21938
21932
  } else {
@@ -21941,7 +21935,7 @@ const linkageAction = (_0) => __async(void 0, [_0], function* ({
21941
21935
  }
21942
21936
  break;
21943
21937
  case ActionType.Disabled:
21944
- if (yield conditionAnalyses({ rules: condition, variables, localVariables })) {
21938
+ if (yield conditionAnalyses({ ruleGroup: condition, variables, localVariables })) {
21945
21939
  disableResult.push(true);
21946
21940
  }
21947
21941
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
@@ -21951,7 +21945,7 @@ const linkageAction = (_0) => __async(void 0, [_0], function* ({
21951
21945
  field.componentProps["disabled"] = last(disableResult);
21952
21946
  break;
21953
21947
  case ActionType.Active:
21954
- if (yield conditionAnalyses({ rules: condition, variables, localVariables })) {
21948
+ if (yield conditionAnalyses({ ruleGroup: condition, variables, localVariables })) {
21955
21949
  disableResult.push(false);
21956
21950
  }
21957
21951
  field.stateOfLinkageRules = __spreadProps(__spreadValues({}, field.stateOfLinkageRules), {
@@ -22151,18 +22145,12 @@ function AssignedFieldValues() {
22151
22145
  const { dn } = useDesignable();
22152
22146
  const { t } = useTranslation();
22153
22147
  const fieldSchema = useFieldSchema();
22154
- const field = useField();
22155
- const [initialSchema, setInitialSchema] = useState();
22156
- useEffect(() => {
22157
- const schemaUid = uid();
22158
- const schema3 = {
22159
- type: "void",
22160
- "x-uid": schemaUid,
22161
- "x-component": "Grid",
22162
- "x-initializer": "CustomFormItemInitializers"
22163
- };
22164
- setInitialSchema(schema3);
22165
- }, [field.address]);
22148
+ const initialSchema = {
22149
+ type: "void",
22150
+ "x-uid": uid(),
22151
+ "x-component": "Grid",
22152
+ "x-initializer": "CustomFormItemInitializers"
22153
+ };
22166
22154
  const tips = {
22167
22155
  "customize:update": t(
22168
22156
  "After clicking the custom button, the following fields of the current record will be saved according to the following form."
@@ -27717,8 +27705,10 @@ const Filter = observer$1(
27717
27705
  }
27718
27706
  });
27719
27707
  useEffect(() => {
27720
- field.initialValue = fieldSchema.defaultValue;
27721
- }, []);
27708
+ if (fieldSchema.defaultValue) {
27709
+ field.initialValue = fieldSchema.defaultValue;
27710
+ }
27711
+ }, [fieldSchema.defaultValue]);
27722
27712
  return /* @__PURE__ */ jsx("div", { className, children: /* @__PURE__ */ jsx(
27723
27713
  FilterContext$2.Provider,
27724
27714
  {
@@ -29058,7 +29048,8 @@ Checkbox.Group = connect(
29058
29048
  return null;
29059
29049
  }
29060
29050
  const field = useField();
29061
- const dataSource2 = field.dataSource || [];
29051
+ const { uiSchema } = useCollectionField$1();
29052
+ const dataSource2 = field.dataSource || uiSchema.enum || [];
29062
29053
  const value = uniq$1(field.value ? field.value : []);
29063
29054
  return /* @__PURE__ */ jsx(EllipsisWithTooltip, { ellipsis: props.ellipsis, children: dataSource2.filter((option) => value.includes(option.value)).map((option, key) => /* @__PURE__ */ jsx(Tag, { color: option.color, icon: option.icon, children: option.label }, key)) });
29064
29055
  })
@@ -29842,7 +29833,7 @@ const WithForm = (props) => {
29842
29833
  const result = [fieldValuesInCondition, variableValuesInCondition, variableValuesInExpression].map((item) => JSON.stringify(item)).join(",");
29843
29834
  return result;
29844
29835
  },
29845
- getSubscriber(action2, field, rule, form2, variables, localVariables),
29836
+ getSubscriber(action2, field, rule, variables, localVariables),
29846
29837
  { fireImmediately: true }
29847
29838
  )
29848
29839
  );
@@ -29895,20 +29886,20 @@ const Form$1 = observer$1(
29895
29886
  },
29896
29887
  { displayName: "Form" }
29897
29888
  );
29898
- function getSubscriber(action2, field, rule, form, variables, localVariables) {
29889
+ function getSubscriber(action2, field, rule, variables, localVariables) {
29899
29890
  return () => {
29900
29891
  collectFieldStateOfLinkageRules({
29901
29892
  operator: action2.operator,
29902
29893
  value: action2.value,
29903
29894
  field,
29904
29895
  condition: rule.condition,
29905
- values: form.values,
29906
29896
  variables,
29907
29897
  localVariables
29908
29898
  });
29909
29899
  setTimeout(() => __async(this, null, function* () {
29900
+ var _a;
29910
29901
  const fieldName = getFieldNameByOperator(action2.operator);
29911
- if (!field.stateOfLinkageRules[fieldName]) {
29902
+ if (!((_a = field.stateOfLinkageRules) == null ? void 0 : _a[fieldName])) {
29912
29903
  return;
29913
29904
  }
29914
29905
  let stateList = field.stateOfLinkageRules[fieldName];
@@ -31816,7 +31807,7 @@ const formItemSettings = new SchemaSettings({
31816
31807
  name: "popupSize",
31817
31808
  type: "select",
31818
31809
  useComponentProps() {
31819
- var _a, _b, _c;
31810
+ var _a, _b;
31820
31811
  const { t } = useTranslation();
31821
31812
  const field = useField();
31822
31813
  const fieldSchema = useFieldSchema();
@@ -31828,7 +31819,7 @@ const formItemSettings = new SchemaSettings({
31828
31819
  { label: t("Middle"), value: "middle" },
31829
31820
  { label: t("Large"), value: "large" }
31830
31821
  ],
31831
- value: (_c = (_a = fieldSchema == null ? void 0 : fieldSchema["x-component-props"]) == null ? void 0 : _a["openSize"]) != null ? _c : ((_b = fieldSchema == null ? void 0 : fieldSchema["x-component-props"]) == null ? void 0 : _b["openMode"]) == "modal" ? "large" : "middle",
31822
+ value: (_b = (_a = fieldSchema == null ? void 0 : fieldSchema["x-component-props"]) == null ? void 0 : _a["openSize"]) != null ? _b : "middle",
31832
31823
  onChange: (value) => {
31833
31824
  field.componentProps.openSize = value;
31834
31825
  fieldSchema["x-component-props"] = field.componentProps;
@@ -33792,7 +33783,7 @@ const InternalListBlockProvider = (props) => {
33792
33783
  line-height: 34px;
33793
33784
  }
33794
33785
  .ant-formily-item-feedback-layout-loose {
33795
- margin-bottom: 0;
33786
+ margin-bottom: 12px;
33796
33787
  }
33797
33788
  `),
33798
33789
  children: props.children
@@ -33998,15 +33989,30 @@ const ListDesigner = () => {
33998
33989
  };
33999
33990
  const ListItem = (props) => {
34000
33991
  const field = useField();
34001
- return /* @__PURE__ */ jsx("div", { className: cls("itemCss", props.className), children: /* @__PURE__ */ jsx(RecordProvider, { record: field.value, children: props.children }) });
33992
+ const { designable } = useDesignable();
33993
+ return /* @__PURE__ */ jsx(
33994
+ "div",
33995
+ {
33996
+ className: cx(cls(props.className), [
33997
+ "itemCss",
33998
+ css`
33999
+ .nb-action-bar {
34000
+ gap: 20px !important;
34001
+ margin-top: ${designable ? "20px" : "0px"};
34002
+ }
34003
+ `
34004
+ ]),
34005
+ children: /* @__PURE__ */ jsx(RecordProvider, { record: field.value, children: props.children })
34006
+ }
34007
+ );
34002
34008
  };
34003
34009
  const useStyles$9 = genStyleHook("nb-list", (token) => {
34004
34010
  const { componentCls } = token;
34005
34011
  return {
34006
34012
  [componentCls]: {
34007
34013
  width: "100%",
34008
- marginBottom: token.marginLG,
34009
- ".nb-action-bar:not(:empty)": { marginTop: token.marginXS },
34014
+ marginBottom: 0,
34015
+ // '.nb-action-bar:not(:empty)': { marginTop: token.marginXS },
34010
34016
  "&:hover": { "> .general-schema-designer": { display: "block" } },
34011
34017
  "> .general-schema-designer": {
34012
34018
  position: "absolute",
@@ -35955,6 +35961,7 @@ const FixedBlockDesignerItem = () => {
35955
35961
  const { dn } = useDesignable();
35956
35962
  const { inFixedBlock } = useFixedBlock();
35957
35963
  const { isBlockInPage } = useIsBlockInPage();
35964
+ const { service } = useBlockRequestContext();
35958
35965
  if (!isBlockInPage() || !inFixedBlock) {
35959
35966
  return null;
35960
35967
  }
@@ -35964,6 +35971,7 @@ const FixedBlockDesignerItem = () => {
35964
35971
  title: t("Fix block"),
35965
35972
  checked: (_a = fieldSchema["x-decorator-props"]) == null ? void 0 : _a.fixedBlock,
35966
35973
  onChange: (fixedBlock) => __async(void 0, null, function* () {
35974
+ var _a2;
35967
35975
  const decoratorProps = __spreadProps(__spreadValues({}, fieldSchema["x-decorator-props"]), {
35968
35976
  fixedBlock
35969
35977
  });
@@ -35974,6 +35982,7 @@ const FixedBlockDesignerItem = () => {
35974
35982
  }
35975
35983
  });
35976
35984
  field.decoratorProps = fieldSchema["x-decorator-props"] = decoratorProps;
35985
+ (_a2 = service == null ? void 0 : service.refresh) == null ? void 0 : _a2.call(service);
35977
35986
  })
35978
35987
  }
35979
35988
  );
@@ -36867,7 +36876,8 @@ Radio.Group = connect(
36867
36876
  }
36868
36877
  const { value } = props;
36869
36878
  const field = useField();
36870
- const dataSource2 = field.dataSource || [];
36879
+ const { uiSchema } = useCollectionField$1();
36880
+ const dataSource2 = field.dataSource || uiSchema.enum || [];
36871
36881
  return /* @__PURE__ */ jsx("div", { children: dataSource2.filter((option) => option.value === value).map((option, key) => /* @__PURE__ */ jsx(Tag, { color: option.color, icon: option.icon, children: option.label }, key)) });
36872
36882
  })
36873
36883
  );
@@ -41038,6 +41048,7 @@ const components$3 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.define
41038
41048
  ActionContextProvider,
41039
41049
  ActionDesigner,
41040
41050
  AppendsTreeSelect,
41051
+ AssignedFieldValues,
41041
41052
  AssociationField,
41042
41053
  AssociationSelect,
41043
41054
  AutoComplete,
@@ -41310,28 +41321,20 @@ const useSwitchRole = () => {
41310
41321
  }
41311
41322
  return result;
41312
41323
  };
41313
- const useApplicationVersion = () => {
41314
- var _a;
41315
- const data = useCurrentAppInfo();
41324
+ const useNickname = () => {
41325
+ var _a, _b, _c;
41326
+ const { data } = useCurrentUserContext();
41327
+ const { token } = useToken$1();
41316
41328
  return useMemo(() => {
41317
- var _a2;
41329
+ var _a2, _b2, _c2;
41318
41330
  return {
41319
- key: "version",
41331
+ key: "nickname",
41320
41332
  disabled: true,
41321
- label: /* @__PURE__ */ jsx(
41322
- "span",
41323
- {
41324
- role: "button",
41325
- "aria-label": "app-version",
41326
- "aria-disabled": "false",
41327
- style: { cursor: "text" },
41328
- children: `Version ${(_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.version}`
41329
- }
41330
- )
41333
+ label: /* @__PURE__ */ jsx("span", { "aria-disabled": "false", style: { cursor: "text", color: token.colorTextDescription }, children: ((_a2 = data == null ? void 0 : data.data) == null ? void 0 : _a2.nickname) || ((_b2 = data == null ? void 0 : data.data) == null ? void 0 : _b2.username) || ((_c2 = data == null ? void 0 : data.data) == null ? void 0 : _c2.email) })
41331
41334
  };
41332
- }, [(_a = data == null ? void 0 : data.data) == null ? void 0 : _a.version]);
41335
+ }, [(_a = data == null ? void 0 : data.data) == null ? void 0 : _a.email, (_b = data == null ? void 0 : data.data) == null ? void 0 : _b.nickname, (_c = data == null ? void 0 : data.data) == null ? void 0 : _c.username, data == null ? void 0 : data.data.version, token.colorTextDescription]);
41333
41336
  };
41334
- const SettingsMenu = (props) => {
41337
+ const SettingsMenu$1 = (props) => {
41335
41338
  const { addMenuItem, getMenuItems: getMenuItems2 } = useCurrentUserSettingsMenu();
41336
41339
  const { redirectUrl = "" } = props;
41337
41340
  const { allowAll, snippets } = useACLRoleContext();
@@ -41355,7 +41358,7 @@ const SettingsMenu = (props) => {
41355
41358
  }, 3e3);
41356
41359
  });
41357
41360
  }), [silenceApi]);
41358
- const appVersion = useApplicationVersion();
41361
+ const nickname = useNickname();
41359
41362
  const editProfile = useEditProfile();
41360
41363
  const changePassword = useChangePassword();
41361
41364
  const switchRole = useSwitchRole();
@@ -41399,7 +41402,7 @@ const SettingsMenu = (props) => {
41399
41402
  }, [api, appAllowed, check, modal, t]);
41400
41403
  useMemo(() => {
41401
41404
  const items2 = [
41402
- appVersion,
41405
+ nickname,
41403
41406
  {
41404
41407
  key: "divider_1",
41405
41408
  type: "divider"
@@ -41436,7 +41439,6 @@ const SettingsMenu = (props) => {
41436
41439
  }, [
41437
41440
  addMenuItem,
41438
41441
  api.auth,
41439
- appVersion,
41440
41442
  changePassword,
41441
41443
  controlApp,
41442
41444
  editProfile,
@@ -41444,31 +41446,42 @@ const SettingsMenu = (props) => {
41444
41446
  navigate,
41445
41447
  redirectUrl,
41446
41448
  switchRole,
41447
- t
41449
+ t,
41450
+ nickname
41448
41451
  ]);
41449
41452
  return /* @__PURE__ */ jsx(Menu$1, { items: getMenuItems2() });
41450
41453
  };
41451
41454
  const DropdownVisibleContext = createContext(null);
41452
41455
  const CurrentUser = () => {
41453
- var _a, _b, _c;
41454
41456
  const [visible, setVisible] = useState(false);
41455
- const { data } = useCurrentUserContext();
41456
41457
  const { token } = useToken$1();
41457
- return /* @__PURE__ */ jsx("div", { style: { display: "inline-flex", verticalAlign: "top" }, children: /* @__PURE__ */ jsx(DropdownVisibleContext.Provider, { value: { visible, setVisible }, children: /* @__PURE__ */ jsx(
41458
- Dropdown,
41458
+ return /* @__PURE__ */ jsx(
41459
+ "div",
41459
41460
  {
41460
- open: visible,
41461
- onOpenChange: (visible2) => {
41462
- setVisible(visible2);
41463
- },
41464
- dropdownRender: () => {
41465
- return /* @__PURE__ */ jsx(SettingsMenu, {});
41466
- },
41467
- children: /* @__PURE__ */ jsx(
41468
- "span",
41461
+ className: css`
41462
+ display: inline-block;
41463
+ vertical-align: top;
41464
+ width: 46px;
41465
+ height: 46px;
41466
+ &:hover {
41467
+ background: rgba(255, 255, 255, 0.1) !important;
41468
+ }
41469
+ `,
41470
+ children: /* @__PURE__ */ jsx(DropdownVisibleContext.Provider, { value: { visible, setVisible }, children: /* @__PURE__ */ jsx(
41471
+ Dropdown,
41469
41472
  {
41470
- "data-testid": "user-center-button",
41471
- className: css`
41473
+ open: visible,
41474
+ onOpenChange: (visible2) => {
41475
+ setVisible(visible2);
41476
+ },
41477
+ dropdownRender: () => {
41478
+ return /* @__PURE__ */ jsx(SettingsMenu$1, {});
41479
+ },
41480
+ children: /* @__PURE__ */ jsx(
41481
+ "span",
41482
+ {
41483
+ "data-testid": "user-center-button",
41484
+ className: css`
41472
41485
  max-width: 160px;
41473
41486
  overflow: hidden;
41474
41487
  display: inline-block;
@@ -41476,12 +41489,14 @@ const CurrentUser = () => {
41476
41489
  white-space: nowrap;
41477
41490
  text-overflow: ellipsis;
41478
41491
  `,
41479
- style: { cursor: "pointer", border: 0, padding: "16px", color: token.colorTextHeaderMenu },
41480
- children: ((_a = data == null ? void 0 : data.data) == null ? void 0 : _a.nickname) || ((_b = data == null ? void 0 : data.data) == null ? void 0 : _b.username) || ((_c = data == null ? void 0 : data.data) == null ? void 0 : _c.email)
41492
+ style: { cursor: "pointer", padding: "16px", color: token.colorTextHeaderMenu },
41493
+ children: /* @__PURE__ */ jsx(UserOutlined, {})
41494
+ }
41495
+ )
41481
41496
  }
41482
- )
41497
+ ) })
41483
41498
  }
41484
- ) }) });
41499
+ );
41485
41500
  };
41486
41501
  const RecordContext = createContext({});
41487
41502
  const RecordIndexContext = createContext(null);
@@ -47667,6 +47682,20 @@ const CollectionCategroriesProvider = (props) => {
47667
47682
  }
47668
47683
  );
47669
47684
  };
47685
+ const CurrentAppInfoContext = createContext(null);
47686
+ const useCurrentAppInfo = () => {
47687
+ return useContext(CurrentAppInfoContext);
47688
+ };
47689
+ const CurrentAppInfoProvider = (props) => {
47690
+ const { render: render2 } = useAppSpin();
47691
+ const result = useRequest({
47692
+ url: "app:getInfo"
47693
+ });
47694
+ if (result.loading) {
47695
+ return render2();
47696
+ }
47697
+ return /* @__PURE__ */ jsx(CurrentAppInfoContext.Provider, { value: result.data, children: props.children });
47698
+ };
47670
47699
  const useDialect = () => {
47671
47700
  const {
47672
47701
  data: { database }
@@ -54143,147 +54172,6 @@ const useStyles$1 = createStyles(({ token }) => {
54143
54172
  }
54144
54173
  };
54145
54174
  });
54146
- const SettingsCenterContext = createContext({});
54147
- function getMenuItems(list) {
54148
- return list.map((item) => {
54149
- var _a;
54150
- return {
54151
- key: item.name,
54152
- label: item.label,
54153
- title: item.title,
54154
- icon: item.icon,
54155
- children: ((_a = item.children) == null ? void 0 : _a.length) ? getMenuItems(item.children) : void 0
54156
- };
54157
- });
54158
- }
54159
- const AdminSettingsLayout = () => {
54160
- var _a, _b, _c;
54161
- const { styles, theme: theme2 } = useStyles$1();
54162
- const app = useApp();
54163
- const navigate = useNavigate();
54164
- const location2 = useLocation();
54165
- const compile2 = useCompile();
54166
- const settings = useMemo(() => {
54167
- const list = app.pluginSettingsManager.getList();
54168
- function traverse(settings2) {
54169
- settings2.forEach((item) => {
54170
- var _a2;
54171
- item.title = compile2(item.title);
54172
- item.label = compile2(item.title);
54173
- if ((_a2 = item.children) == null ? void 0 : _a2.length) {
54174
- traverse(item.children);
54175
- }
54176
- });
54177
- }
54178
- traverse(list);
54179
- return list;
54180
- }, [app.pluginSettingsManager, compile2]);
54181
- const getFirstDeepChildPath = useCallback((settings2) => {
54182
- var _a2;
54183
- if (!settings2 || !settings2.length) {
54184
- return "/admin";
54185
- }
54186
- const first = settings2[0];
54187
- if ((_a2 = first.children) == null ? void 0 : _a2.length) {
54188
- return getFirstDeepChildPath(first.children);
54189
- }
54190
- return first.path;
54191
- }, []);
54192
- const settingsMapByPath = useMemo(() => {
54193
- const map = {};
54194
- const traverse = (settings2) => {
54195
- settings2.forEach((item) => {
54196
- var _a2;
54197
- map[item.path] = item;
54198
- if ((_a2 = item.children) == null ? void 0 : _a2.length) {
54199
- traverse(item.children);
54200
- }
54201
- });
54202
- };
54203
- traverse(settings);
54204
- return map;
54205
- }, [settings]);
54206
- const currentSetting = useMemo(() => settingsMapByPath[location2.pathname], [location2.pathname, settingsMapByPath]);
54207
- const currentTopLevelSetting = useMemo(() => {
54208
- if (!currentSetting) {
54209
- return null;
54210
- }
54211
- return settings.find((item) => item.name === currentSetting.topLevelName);
54212
- }, [currentSetting, settings]);
54213
- const sidebarMenus = useMemo(() => {
54214
- return getMenuItems(settings.map((item) => __spreadProps(__spreadValues({}, item), { children: null })));
54215
- }, [settings]);
54216
- if (!currentSetting || location2.pathname === ADMIN_SETTINGS_PATH || location2.pathname === ADMIN_SETTINGS_PATH + "/") {
54217
- return /* @__PURE__ */ jsx(Navigate, { replace: true, to: getFirstDeepChildPath(settings) });
54218
- }
54219
- if (location2.pathname === currentTopLevelSetting.path && ((_a = currentTopLevelSetting.children) == null ? void 0 : _a.length) > 0) {
54220
- return /* @__PURE__ */ jsx(Navigate, { replace: true, to: getFirstDeepChildPath(currentTopLevelSetting.children) });
54221
- }
54222
- return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Layout, { children: [
54223
- /* @__PURE__ */ jsx(
54224
- Layout.Sider,
54225
- {
54226
- className: css`
54227
- height: 100%;
54228
- left: 0;
54229
- top: 0;
54230
- background: rgba(0, 0, 0, 0);
54231
- z-index: 100;
54232
- .ant-layout-sider-children {
54233
- top: 46px;
54234
- position: fixed;
54235
- width: 200px;
54236
- height: calc(100vh - 46px);
54237
- }
54238
- `,
54239
- theme: "light",
54240
- children: /* @__PURE__ */ jsx(
54241
- Menu$1,
54242
- {
54243
- selectedKeys: [currentSetting == null ? void 0 : currentSetting.topLevelName],
54244
- style: { height: "calc(100vh - 46px)", overflowY: "auto", overflowX: "hidden" },
54245
- onClick: ({ key }) => {
54246
- var _a2;
54247
- const plugin = settings.find((item) => item.name === key);
54248
- if ((_a2 = plugin.children) == null ? void 0 : _a2.length) {
54249
- return navigate(getFirstDeepChildPath(plugin.children));
54250
- } else {
54251
- return navigate(plugin.path);
54252
- }
54253
- },
54254
- items: sidebarMenus
54255
- }
54256
- )
54257
- }
54258
- ),
54259
- /* @__PURE__ */ jsxs(Layout.Content, { children: [
54260
- currentSetting && /* @__PURE__ */ jsx(
54261
- PageHeader,
54262
- {
54263
- className: styles.pageHeader,
54264
- style: {
54265
- paddingBottom: ((_b = currentTopLevelSetting.children) == null ? void 0 : _b.length) > 0 ? 0 : theme2.paddingSM
54266
- },
54267
- ghost: false,
54268
- title: currentTopLevelSetting.title,
54269
- footer: ((_c = currentTopLevelSetting.children) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx(
54270
- Menu$1,
54271
- {
54272
- style: { marginLeft: -theme2.margin },
54273
- onClick: ({ key }) => {
54274
- navigate(app.pluginSettingsManager.getRoutePath(key));
54275
- },
54276
- selectedKeys: [currentSetting == null ? void 0 : currentSetting.name],
54277
- mode: "horizontal",
54278
- items: getMenuItems(currentTopLevelSetting.children)
54279
- }
54280
- )
54281
- }
54282
- ),
54283
- /* @__PURE__ */ jsx("div", { className: styles.pageContent, children: currentSetting ? /* @__PURE__ */ jsx(Outlet, {}) : /* @__PURE__ */ jsx(Result$1, { status: "404", title: "404", subTitle: "Sorry, the page you visited does not exist." }) })
54284
- ] })
54285
- ] }) });
54286
- };
54287
54175
  const PLUGIN_STATICS_PATH = "/static/plugins/";
54288
54176
  const PluginDocument = memo((props) => {
54289
54177
  const { isDarkTheme } = useGlobalTheme();
@@ -55098,15 +54986,17 @@ const LocalPlugins = () => {
55098
54986
  const [keyword, setKeyword] = useState(null);
55099
54987
  const debouncedSearchValue = useDebounce(searchValue, { wait: 100 });
55100
54988
  const keyWordlists = [
55101
- "Data Model",
55102
- "Fields",
54989
+ "Data model tools",
54990
+ "Data sources",
54991
+ "Collections",
54992
+ "Collection fields",
55103
54993
  "Blocks",
55104
54994
  "Actions",
55105
- "Users & permissions",
55106
54995
  "Workflow",
54996
+ "Users & permissions",
54997
+ "Authentication",
55107
54998
  "System management",
55108
- "System & security",
55109
- "Third party services",
54999
+ "Logging and monitoring",
55110
55000
  "Others"
55111
55001
  ];
55112
55002
  const keyWordsfilterList = useMemo(() => {
@@ -55202,7 +55092,7 @@ const LocalPlugins = () => {
55202
55092
  ]
55203
55093
  }
55204
55094
  ),
55205
- /* @__PURE__ */ jsxs(Row, { style: { width: "100%" }, children: [
55095
+ /* @__PURE__ */ jsxs(Row, { style: { width: "100%" }, wrap: false, children: [
55206
55096
  /* @__PURE__ */ jsx(Col, { flex: "200px", children: /* @__PURE__ */ jsx(
55207
55097
  List$1,
55208
55098
  {
@@ -55295,6 +55185,147 @@ const PluginManager = () => {
55295
55185
  ) })
55296
55186
  ] }) : /* @__PURE__ */ jsx(Result$1, { status: "404", title: "404", subTitle: "Sorry, the page you visited does not exist." });
55297
55187
  };
55188
+ const SettingsCenterContext = createContext({});
55189
+ function getMenuItems(list) {
55190
+ return list.map((item) => {
55191
+ var _a;
55192
+ return {
55193
+ key: item.name,
55194
+ label: item.label,
55195
+ title: item.title,
55196
+ icon: item.icon,
55197
+ children: ((_a = item.children) == null ? void 0 : _a.length) ? getMenuItems(item.children) : void 0
55198
+ };
55199
+ });
55200
+ }
55201
+ const AdminSettingsLayout = () => {
55202
+ var _a, _b, _c;
55203
+ const { styles, theme: theme2 } = useStyles$1();
55204
+ const app = useApp();
55205
+ const navigate = useNavigate();
55206
+ const location2 = useLocation();
55207
+ const compile2 = useCompile();
55208
+ const settings = useMemo(() => {
55209
+ const list = app.pluginSettingsManager.getList();
55210
+ function traverse(settings2) {
55211
+ settings2.forEach((item) => {
55212
+ var _a2;
55213
+ item.title = compile2(item.title);
55214
+ item.label = compile2(item.title);
55215
+ if ((_a2 = item.children) == null ? void 0 : _a2.length) {
55216
+ traverse(item.children);
55217
+ }
55218
+ });
55219
+ }
55220
+ traverse(list);
55221
+ return list;
55222
+ }, [app.pluginSettingsManager, compile2]);
55223
+ const getFirstDeepChildPath = useCallback((settings2) => {
55224
+ var _a2;
55225
+ if (!settings2 || !settings2.length) {
55226
+ return "/admin";
55227
+ }
55228
+ const first = settings2[0];
55229
+ if ((_a2 = first.children) == null ? void 0 : _a2.length) {
55230
+ return getFirstDeepChildPath(first.children);
55231
+ }
55232
+ return first.path;
55233
+ }, []);
55234
+ const settingsMapByPath = useMemo(() => {
55235
+ const map = {};
55236
+ const traverse = (settings2) => {
55237
+ settings2.forEach((item) => {
55238
+ var _a2;
55239
+ map[item.path] = item;
55240
+ if ((_a2 = item.children) == null ? void 0 : _a2.length) {
55241
+ traverse(item.children);
55242
+ }
55243
+ });
55244
+ };
55245
+ traverse(settings);
55246
+ return map;
55247
+ }, [settings]);
55248
+ const currentSetting = useMemo(() => settingsMapByPath[location2.pathname], [location2.pathname, settingsMapByPath]);
55249
+ const currentTopLevelSetting = useMemo(() => {
55250
+ if (!currentSetting) {
55251
+ return null;
55252
+ }
55253
+ return settings.find((item) => item.name === currentSetting.topLevelName);
55254
+ }, [currentSetting, settings]);
55255
+ const sidebarMenus = useMemo(() => {
55256
+ return getMenuItems(settings.map((item) => __spreadProps(__spreadValues({}, item), { children: null })));
55257
+ }, [settings]);
55258
+ if (!currentSetting || location2.pathname === ADMIN_SETTINGS_PATH || location2.pathname === ADMIN_SETTINGS_PATH + "/") {
55259
+ return /* @__PURE__ */ jsx(Navigate, { replace: true, to: getFirstDeepChildPath(settings) });
55260
+ }
55261
+ if (location2.pathname === currentTopLevelSetting.path && ((_a = currentTopLevelSetting.children) == null ? void 0 : _a.length) > 0) {
55262
+ return /* @__PURE__ */ jsx(Navigate, { replace: true, to: getFirstDeepChildPath(currentTopLevelSetting.children) });
55263
+ }
55264
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs(Layout, { children: [
55265
+ /* @__PURE__ */ jsx(
55266
+ Layout.Sider,
55267
+ {
55268
+ className: css`
55269
+ height: 100%;
55270
+ left: 0;
55271
+ top: 0;
55272
+ background: rgba(0, 0, 0, 0);
55273
+ z-index: 100;
55274
+ .ant-layout-sider-children {
55275
+ top: 46px;
55276
+ position: fixed;
55277
+ width: 200px;
55278
+ height: calc(100vh - 46px);
55279
+ }
55280
+ `,
55281
+ theme: "light",
55282
+ children: /* @__PURE__ */ jsx(
55283
+ Menu$1,
55284
+ {
55285
+ selectedKeys: [currentSetting == null ? void 0 : currentSetting.topLevelName],
55286
+ style: { height: "calc(100vh - 46px)", overflowY: "auto", overflowX: "hidden" },
55287
+ onClick: ({ key }) => {
55288
+ var _a2;
55289
+ const plugin = settings.find((item) => item.name === key);
55290
+ if ((_a2 = plugin.children) == null ? void 0 : _a2.length) {
55291
+ return navigate(getFirstDeepChildPath(plugin.children));
55292
+ } else {
55293
+ return navigate(plugin.path);
55294
+ }
55295
+ },
55296
+ items: sidebarMenus
55297
+ }
55298
+ )
55299
+ }
55300
+ ),
55301
+ /* @__PURE__ */ jsxs(Layout.Content, { children: [
55302
+ currentSetting && /* @__PURE__ */ jsx(
55303
+ PageHeader,
55304
+ {
55305
+ className: styles.pageHeader,
55306
+ style: {
55307
+ paddingBottom: ((_b = currentTopLevelSetting.children) == null ? void 0 : _b.length) > 0 ? 0 : theme2.paddingSM
55308
+ },
55309
+ ghost: false,
55310
+ title: currentTopLevelSetting.title,
55311
+ footer: ((_c = currentTopLevelSetting.children) == null ? void 0 : _c.length) > 0 && /* @__PURE__ */ jsx(
55312
+ Menu$1,
55313
+ {
55314
+ style: { marginLeft: -theme2.margin },
55315
+ onClick: ({ key }) => {
55316
+ navigate(app.pluginSettingsManager.getRoutePath(key));
55317
+ },
55318
+ selectedKeys: [currentSetting == null ? void 0 : currentSetting.name],
55319
+ mode: "horizontal",
55320
+ items: getMenuItems(currentTopLevelSetting.children)
55321
+ }
55322
+ )
55323
+ }
55324
+ ),
55325
+ /* @__PURE__ */ jsx("div", { className: styles.pageContent, children: currentSetting ? /* @__PURE__ */ jsx(Outlet, {}) : /* @__PURE__ */ jsx(Result$1, { status: "404", title: "404", subTitle: "Sorry, the page you visited does not exist." }) })
55326
+ ] })
55327
+ ] }) });
55328
+ };
55298
55329
  class PMPlugin extends Plugin {
55299
55330
  load() {
55300
55331
  return __async(this, null, function* () {
@@ -56076,6 +56107,96 @@ class PinnedListPlugin extends Plugin {
56076
56107
  });
56077
56108
  }
56078
56109
  }
56110
+ const SettingsMenu = () => {
56111
+ var _a, _b;
56112
+ const { t } = useTranslation();
56113
+ const data = useCurrentAppInfo();
56114
+ const { token } = useToken$1();
56115
+ const isSimplifiedChinese = ((_a = data == null ? void 0 : data.data) == null ? void 0 : _a.lang) === "zh-CN";
56116
+ const items2 = [
56117
+ {
56118
+ key: "nocobase",
56119
+ disabled: true,
56120
+ label: /* @__PURE__ */ jsxs("div", { style: { cursor: "text" }, children: [
56121
+ /* @__PURE__ */ jsx("div", { style: { color: token.colorText }, children: "NocoBase" }),
56122
+ /* @__PURE__ */ jsxs("div", { style: { fontSize: "0.8em", color: token.colorTextDescription }, children: [
56123
+ "v",
56124
+ (_b = data == null ? void 0 : data.data) == null ? void 0 : _b.version
56125
+ ] })
56126
+ ] })
56127
+ },
56128
+ {
56129
+ key: "divider_1",
56130
+ type: "divider"
56131
+ },
56132
+ {
56133
+ key: "homePage",
56134
+ label: /* @__PURE__ */ jsx("a", { href: isSimplifiedChinese ? "https://cn.nocobase.com/" : "https://www.nocobase.com", target: "__blank", children: t("Home page") })
56135
+ },
56136
+ {
56137
+ key: "userManual",
56138
+ label: /* @__PURE__ */ jsx(
56139
+ "a",
56140
+ {
56141
+ href: isSimplifiedChinese ? "https://docs-cn.nocobase.com/manual/quick-start/the-first-app" : "https://docs.nocobase.com/manual/quick-start/the-first-app",
56142
+ target: "__blank",
56143
+ children: t("User manual")
56144
+ }
56145
+ )
56146
+ },
56147
+ {
56148
+ key: "license",
56149
+ label: /* @__PURE__ */ jsx("a", { href: "https://github.com/nocobase/nocobase/blob/main/LICENSE-AGPL", target: "__blank", children: t("License") })
56150
+ }
56151
+ ];
56152
+ return /* @__PURE__ */ jsx(Menu$1, { items: items2 });
56153
+ };
56154
+ const Help = () => {
56155
+ const [visible, setVisible] = useState(false);
56156
+ const { token } = useToken$1();
56157
+ return /* @__PURE__ */ jsx(
56158
+ "div",
56159
+ {
56160
+ className: css`
56161
+ display: inline-block;
56162
+ vertical-align: top;
56163
+ width: 46px;
56164
+ height: 46px;
56165
+ &:hover {
56166
+ background: rgba(255, 255, 255, 0.1) !important;
56167
+ }
56168
+ `,
56169
+ children: /* @__PURE__ */ jsx(DropdownVisibleContext.Provider, { value: { visible, setVisible }, children: /* @__PURE__ */ jsx(
56170
+ Dropdown,
56171
+ {
56172
+ open: visible,
56173
+ onOpenChange: (visible2) => {
56174
+ setVisible(visible2);
56175
+ },
56176
+ dropdownRender: () => {
56177
+ return /* @__PURE__ */ jsx(SettingsMenu, {});
56178
+ },
56179
+ children: /* @__PURE__ */ jsx(
56180
+ "span",
56181
+ {
56182
+ "data-testid": "help-button",
56183
+ className: css`
56184
+ max-width: 160px;
56185
+ overflow: hidden;
56186
+ display: inline-block;
56187
+ line-height: 12px;
56188
+ white-space: nowrap;
56189
+ text-overflow: ellipsis;
56190
+ `,
56191
+ style: { cursor: "pointer", padding: "16px", color: token.colorTextHeaderMenu },
56192
+ children: /* @__PURE__ */ jsx(QuestionCircleOutlined, {})
56193
+ }
56194
+ )
56195
+ }
56196
+ ) })
56197
+ }
56198
+ );
56199
+ };
56079
56200
  const filterByACL = (schema3, options) => {
56080
56201
  const { allowAll, allowMenuItemIds = [] } = options;
56081
56202
  if (allowAll) {
@@ -56386,6 +56507,18 @@ const InternalAdminLayout = (props) => {
56386
56507
  `,
56387
56508
  children: [
56388
56509
  /* @__PURE__ */ jsx(PinnedPluginList, {}),
56510
+ /* @__PURE__ */ jsx(
56511
+ ConfigProvider,
56512
+ {
56513
+ theme: {
56514
+ token: {
56515
+ colorSplit: "rgba(255, 255, 255, 0.1)"
56516
+ }
56517
+ },
56518
+ children: /* @__PURE__ */ jsx(Divider, { type: "vertical" })
56519
+ }
56520
+ ),
56521
+ /* @__PURE__ */ jsx(Help, {}),
56389
56522
  /* @__PURE__ */ jsx(CurrentUser, {})
56390
56523
  ]
56391
56524
  }
@@ -60767,7 +60900,7 @@ const TableActionColumnInitializer = () => {
60767
60900
  "x-initializer": "TableActionColumnInitializers",
60768
60901
  "x-action-column": "actions",
60769
60902
  properties: {
60770
- actions: {
60903
+ [uid()]: {
60771
60904
  type: "void",
60772
60905
  "x-decorator": "DndContext",
60773
60906
  "x-component": "Space",
@@ -61417,6 +61550,7 @@ export {
61417
61550
  AppendsTreeSelect,
61418
61551
  Application,
61419
61552
  ApplicationContext,
61553
+ AssignedFieldValues,
61420
61554
  AssociationField,
61421
61555
  AssociationFilter,
61422
61556
  AssociationFilterDesignerDelete,
@@ -61712,7 +61846,7 @@ export {
61712
61846
  SelectWithTitle,
61713
61847
  SettingsCenterContext,
61714
61848
  SettingsCenterDropdown,
61715
- SettingsMenu,
61849
+ SettingsMenu$1 as SettingsMenu,
61716
61850
  Sortable,
61717
61851
  SortableContext,
61718
61852
  SortableItem,