@tachybase/client 1.6.0 → 1.6.1

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.
Files changed (79) hide show
  1. package/es/application/PluginManager.mjs +9 -1
  2. package/es/application/WebSocketClient.d.ts +19 -0
  3. package/es/application/WebSocketClient.mjs +26 -6
  4. package/es/application/utils/remotePlugins.mjs +8 -2
  5. package/es/built-in/attachment-preview/previewers/file-sheet.mjs +1 -1
  6. package/es/built-in/pm/PluginDetail.mjs +1 -1
  7. package/es/collection-manager/Configuration/components/index.mjs +3 -3
  8. package/es/collection-manager/interfaces/components/index.mjs +2 -2
  9. package/es/collection-manager/interfaces/properties/operators.mjs +3 -3
  10. package/es/locale/index.mjs +47 -47
  11. package/es/modules/blocks/data-blocks/table/hooks/useTableBlockProps.mjs +4 -1
  12. package/es/schema-component/antd/AntdSchemaComponentProvider.mjs +3 -1
  13. package/es/schema-component/antd/__builtins__/hooks/usePrefixCls.mjs +1 -1
  14. package/es/schema-component/antd/action/Action.Area.style.mjs +1 -1
  15. package/es/schema-component/antd/action/Action.Designer.mjs +1 -1
  16. package/es/schema-component/antd/association-field/AssociationSelect.mjs +1 -1
  17. package/es/schema-component/antd/association-field/InternalDrawerSubTable.mjs +1 -1
  18. package/es/schema-component/antd/association-field/SubTabs/styles.mjs +1 -1
  19. package/es/schema-component/antd/block-item/BlockToolbar.mjs +16 -16
  20. package/es/schema-component/antd/grid-card/options.mjs +3 -3
  21. package/es/schema-component/antd/input/ReadPretty.mjs +1 -3
  22. package/es/schema-component/antd/menu/Menu.styles.mjs +1 -1
  23. package/es/schema-component/antd/menu/MenuSearchAdd.style.mjs +1 -1
  24. package/es/schema-component/antd/page/Page.mjs +3 -0
  25. package/es/schema-component/antd/page/Page.style.mjs +1 -1
  26. package/es/schema-component/antd/table/Table.Column.Designer.mjs +5 -5
  27. package/es/schema-component/antd/table/Table.Void.Designer.mjs +4 -4
  28. package/es/schema-component/antd/table-v2/EnabledToggle.d.ts +9 -0
  29. package/es/schema-component/antd/table-v2/EnabledToggle.mjs +72 -0
  30. package/es/schema-component/antd/table-v2/Table.styles.mjs +1 -1
  31. package/es/schema-component/antd/table-v2/index.d.ts +1 -0
  32. package/es/schema-component/antd/table-v2/index.mjs +1 -0
  33. package/es/schema-component/antd/variable/CodeMirror.mjs +1 -1
  34. package/es/schema-component/common/sortable-item/DragHandleMenu.style.mjs +1 -1
  35. package/es/schema-component/common/sortable-item/DragHandlePageTab.style.mjs +1 -1
  36. package/es/schema-templates/BlockTemplateDetails.mjs +1 -1
  37. package/es/user/ChangePassword.mjs +1 -1
  38. package/lib/application/PluginManager.js +9 -1
  39. package/lib/application/WebSocketClient.js +26 -6
  40. package/lib/application/utils/remotePlugins.js +8 -2
  41. package/lib/built-in/attachment-preview/previewers/file-sheet.js +1 -1
  42. package/lib/built-in/pm/PluginDetail.js +1 -1
  43. package/lib/collection-manager/Configuration/components/index.js +3 -3
  44. package/lib/collection-manager/interfaces/components/index.js +2 -2
  45. package/lib/collection-manager/interfaces/properties/operators.js +3 -3
  46. package/lib/locale/en_US.js +1 -0
  47. package/lib/locale/es_ES.js +1 -0
  48. package/lib/locale/fr_FR.js +1 -0
  49. package/lib/locale/ko_KR.js +1 -0
  50. package/lib/locale/pt_BR.js +1 -0
  51. package/lib/locale/uk_UA.js +1 -0
  52. package/lib/locale/zh-CN.js +1 -0
  53. package/lib/locale/zh-TW.js +1 -0
  54. package/lib/modules/blocks/data-blocks/table/hooks/useTableBlockProps.js +4 -1
  55. package/lib/schema-component/antd/AntdSchemaComponentProvider.js +3 -1
  56. package/lib/schema-component/antd/__builtins__/hooks/usePrefixCls.js +1 -1
  57. package/lib/schema-component/antd/action/Action.Area.style.js +1 -1
  58. package/lib/schema-component/antd/action/Action.Designer.js +1 -1
  59. package/lib/schema-component/antd/association-field/AssociationSelect.js +1 -1
  60. package/lib/schema-component/antd/association-field/InternalDrawerSubTable.js +1 -1
  61. package/lib/schema-component/antd/association-field/SubTabs/styles.js +1 -1
  62. package/lib/schema-component/antd/block-item/BlockToolbar.js +16 -16
  63. package/lib/schema-component/antd/grid-card/options.js +3 -3
  64. package/lib/schema-component/antd/input/ReadPretty.js +1 -3
  65. package/lib/schema-component/antd/menu/Menu.styles.js +1 -1
  66. package/lib/schema-component/antd/menu/MenuSearchAdd.style.js +1 -1
  67. package/lib/schema-component/antd/page/Page.js +3 -0
  68. package/lib/schema-component/antd/page/Page.style.js +1 -1
  69. package/lib/schema-component/antd/table/Table.Column.Designer.js +5 -5
  70. package/lib/schema-component/antd/table/Table.Void.Designer.js +4 -4
  71. package/lib/schema-component/antd/table-v2/EnabledToggle.js +106 -0
  72. package/lib/schema-component/antd/table-v2/Table.styles.js +1 -1
  73. package/lib/schema-component/antd/table-v2/index.js +13 -0
  74. package/lib/schema-component/antd/variable/CodeMirror.js +1 -1
  75. package/lib/schema-component/common/sortable-item/DragHandleMenu.style.js +1 -1
  76. package/lib/schema-component/common/sortable-item/DragHandlePageTab.style.js +1 -1
  77. package/lib/schema-templates/BlockTemplateDetails.js +1 -1
  78. package/lib/user/ChangePassword.js +1 -1
  79. package/package.json +4 -4
@@ -1,8 +1,8 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { useFieldSchema } from "@tachybase/schema";
4
- import { css } from "@emotion/css";
5
4
  import { usePrefixCls } from "@tego/client";
5
+ import { css } from "@emotion/css";
6
6
  import { Image, Typography } from "antd";
7
7
  import classnames from "classnames";
8
8
  import { useCompile } from "../../index.mjs";
@@ -32,8 +32,6 @@ const _Input = (props)=>{
32
32
  return /*#__PURE__*/ jsxs("div", {
33
33
  className: classnames(prefixCls, props.className),
34
34
  style: {
35
- display: 'flex',
36
- alignItems: 'center',
37
35
  overflowWrap: 'break-word',
38
36
  whiteSpace: 'normal',
39
37
  ...props.style
@@ -28,7 +28,7 @@ function _templateObject1() {
28
28
  function _templateObject2() {
29
29
  const data = _tagged_template_literal([
30
30
  "\n height: 100%;\n overflow-y: auto;\n overflow-x: hidden;\n\n .ant-menu-submenu.ant-menu-submenu-inline .ant-menu-submenu-title {\n position: relative;\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: ",
31
- ";\n\n /* \u4F7F\u7528 clip-path \u88C1\u526A\u4E3A\u68AF\u5F62 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n .ant-menu-submenu.ant-menu-submenu-inline.ant-menu-submenu-open > .ant-menu-submenu-title {\n ::before {\n background-color: ",
31
+ ";\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n .ant-menu-submenu.ant-menu-submenu-inline.ant-menu-submenu-open > .ant-menu-submenu-title {\n ::before {\n background-color: ",
32
32
  ";\n }\n }\n\n .ant-menu-item,\n .ant-menu-submenu-title {\n padding-inline-end: 10px;\n }\n\n .ant-menu-submenu-title {\n .ant-menu-title-content {\n > div {\n > .general-schema-designer {\n right: 6px !important;\n }\n > span.anticon {\n margin-right: 10px;\n }\n }\n }\n }\n "
33
33
  ]);
34
34
  _templateObject2 = function() {
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
9
9
  }
10
10
  function _templateObject() {
11
11
  const data = _tagged_template_literal([
12
- "\n /* NOTE: \u8FD9\u91CC\u7684\u6837\u5F0F\u662F\u4E3A\u4E86\u8BA9\u641C\u7D22\u6846\u7684\u6837\u5F0F, \u907F\u514D\u4E0A\u5C42 antd \u5199\u6B7B\u7684 padding-left: 24px \u7684\u5F71\u54CD */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: \u653E\u8FD9\u4E09\u4E2A\u6837\u5F0F\u662F\u4E3A\u4E86\u63D0\u5347\u9009\u62E9\u5668\u4F18\u5148\u7EA7, \u8986\u76D6\u6389 antd \u7684\u9ED8\u8BA4\u6837\u5F0F */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* \u79FB\u9664 antd \u9ED8\u8BA4\u7684\u540E\u7F6E\u641C\u7D22\u56FE\u6807 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* \u8FD9\u91CC\u662F\u4E3A\u4E86\u548C\u524D\u8FB9\u5143\u7D20\u4FDD\u6301\u5BF9\u9F50, antd \u7EC4\u4EF6\u5199\u6B7B\u4E86\u9AD8\u5EA6 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
12
+ "\n /* NOTE: 这里的样式是为了让搜索框的样式, 避免上层 antd 写死的 padding-left: 24px 的影响 */\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n display: flex;\n flex-direction: row;\n align-items: flex-start;\n\n /* NOTE: 放这三个样式是为了提升选择器优先级, 覆盖掉 antd 的默认样式 */\n .ant-input-outlined.ant-input-outlined.ant-input-outlined {\n background-color: #f9f9f9;\n border-radius: 5px;\n border: none;\n box-shadow: none;\n }\n\n /* 移除 antd 默认的后置搜索图标 */\n .ant-input-group-addon {\n display: none;\n }\n\n .menu-add-wrapper {\n .ant-dropdown-trigger {\n display: grid;\n place-items: center;\n\n width: 30px;\n /* 这里是为了和前边元素保持对齐, antd 组件写死了高度 */\n height: 28px;\n\n cursor: pointer;\n\n :hover,\n :active {\n border-radius: 5px;\n color: #ffffff;\n background-color: #f4f4f4;\n }\n }\n }\n "
13
13
  ]);
14
14
  _templateObject = function() {
15
15
  return data;
@@ -230,6 +230,9 @@ const TabItem = (props)=>{
230
230
  type: schema['x-icon']
231
231
  }),
232
232
  /*#__PURE__*/ jsx("span", {
233
+ style: {
234
+ padding: '6px 16px'
235
+ },
233
236
  children: schema.title || t('Unnamed')
234
237
  }),
235
238
  /*#__PURE__*/ jsx("div", {
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
9
9
  }
10
10
  function _templateObject() {
11
11
  const data = _tagged_template_literal([
12
- "\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab.ant-tabs-tab {\n padding: 0;\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
12
+ "\n .ant-tabs-nav-wrap.ant-tabs-nav-wrap {\n flex: none;\n }\n .ant-tabs-tab.ant-tabs-tab.ant-tabs-tab {\n border: none;\n background-color: #ffffff;\n }\n\n .ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active.ant-tabs-tab-active {\n border-radius: 8px 8px 0 0;\n box-shadow: none;\n text-shadow: none;\n background-color: var(--tb-box-bg);\n }\n .ant-tabs-extra-content {\n flex: 1;\n }\n "
13
13
  ]);
14
14
  _templateObject = function() {
15
15
  return data;
@@ -33,9 +33,9 @@ const TableColumnDesigner = (props)=>{
33
33
  return /*#__PURE__*/ jsxs(GeneralSchemaDesigner, {
34
34
  children: [
35
35
  /*#__PURE__*/ jsx(SchemaSettingsPopupItem, {
36
- title: "\u7F16\u8F91",
36
+ title: '编辑',
37
37
  schema: {
38
- title: "\u7F16\u8F91\u5B57\u6BB5",
38
+ title: '编辑字段',
39
39
  'x-component': 'Action.Modal',
40
40
  'x-component-props': {
41
41
  width: 520
@@ -49,9 +49,9 @@ const TableColumnDesigner = (props)=>{
49
49
  title: {
50
50
  'x-decorator': 'FormItem',
51
51
  'x-component': 'Input',
52
- title: "\u5B57\u6BB5\u6807\u9898",
52
+ title: '字段标题',
53
53
  'x-component-props': {},
54
- description: "\u539F\u5B57\u6BB5\u6807\u9898\uFF1A".concat(null == collectionField ? void 0 : null == (_collectionField_uiSchema = collectionField.uiSchema) ? void 0 : _collectionField_uiSchema.title)
54
+ description: "原字段标题:".concat(null == collectionField ? void 0 : null == (_collectionField_uiSchema = collectionField.uiSchema) ? void 0 : _collectionField_uiSchema.title)
55
55
  },
56
56
  footer: {
57
57
  type: 'void',
@@ -107,7 +107,7 @@ const TableColumnDesigner = (props)=>{
107
107
  }
108
108
  }),
109
109
  (null == collectionField ? void 0 : collectionField.target) && /*#__PURE__*/ jsx(SchemaSettingsSelectItem, {
110
- title: "\u6807\u9898\u5B57\u6BB5",
110
+ title: '标题字段',
111
111
  options: options,
112
112
  value: null == fieldSchema ? void 0 : null == (_fieldSchema_xcomponentprops = fieldSchema['x-component-props']) ? void 0 : null == (_fieldSchema_xcomponentprops_fieldNames = _fieldSchema_xcomponentprops['fieldNames']) ? void 0 : _fieldSchema_xcomponentprops_fieldNames['label'],
113
113
  onChange: (label)=>{
@@ -52,14 +52,14 @@ const TableVoidDesigner = ()=>{
52
52
  }
53
53
  }),
54
54
  /*#__PURE__*/ jsx(SchemaSettingsModalItem, {
55
- title: "\u8BBE\u7F6E\u6570\u636E\u8303\u56F4",
55
+ title: '设置数据范围',
56
56
  schema: {
57
57
  type: 'object',
58
- title: "\u8BBE\u7F6E\u6570\u636E\u8303\u56F4",
58
+ title: '设置数据范围',
59
59
  properties: {
60
60
  filter: {
61
61
  default: defaultFilter,
62
- title: "\u6570\u636E\u8303\u56F4",
62
+ title: '数据范围',
63
63
  enum: dataSource,
64
64
  'x-component': 'Filter',
65
65
  'x-component-props': {}
@@ -182,7 +182,7 @@ const TableVoidDesigner = ()=>{
182
182
  }
183
183
  }),
184
184
  /*#__PURE__*/ jsx(SchemaSettingsSelectItem, {
185
- title: "\u6BCF\u9875\u663E\u793A",
185
+ title: '每页显示',
186
186
  value: (null == (_field_decoratorProps_request_params = field.decoratorProps.request.params) ? void 0 : _field_decoratorProps_request_params.pageSize) || 20,
187
187
  options: [
188
188
  {
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ export interface EnabledToggleProps {
3
+ resource?: string;
4
+ checkedChildren?: string;
5
+ unCheckedChildren?: string;
6
+ fieldName?: string;
7
+ disabled?: boolean;
8
+ }
9
+ export declare const EnabledToggle: React.MemoExoticComponent<import("@tachybase/schema").ReactFC<EnabledToggleProps>>;
@@ -0,0 +1,72 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import "react";
3
+ import { observer } from "@tachybase/schema";
4
+ import { Switch, message } from "antd";
5
+ import { createStyles } from "antd-style";
6
+ import { useTranslation } from "react-i18next";
7
+ import { useAPIClient } from "../../../api-client/index.mjs";
8
+ import { useCollectionRecordData } from "../../../data-source/collection-record/CollectionRecordProvider.mjs";
9
+ import { useDataBlockRequest } from "../../../data-source/data-block/DataBlockRequestProvider.mjs";
10
+ function _tagged_template_literal(strings, raw) {
11
+ if (!raw) raw = strings.slice(0);
12
+ return Object.freeze(Object.defineProperties(strings, {
13
+ raw: {
14
+ value: Object.freeze(raw)
15
+ }
16
+ }));
17
+ }
18
+ function _templateObject() {
19
+ const data = _tagged_template_literal([
20
+ "\n &.ant-switch-checked {\n background-color: #52c41a !important;\n }\n min-height: 16px;\n height: 16px;\n line-height: 16px;\n "
21
+ ]);
22
+ _templateObject = function() {
23
+ return data;
24
+ };
25
+ return data;
26
+ }
27
+ const useStyles = createStyles((param)=>{
28
+ let { css } = param;
29
+ return {
30
+ switchClass: css(_templateObject())
31
+ };
32
+ });
33
+ const EnabledToggle = observer(function() {
34
+ let props = arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {};
35
+ const { styles } = useStyles();
36
+ const record = useCollectionRecordData();
37
+ const api = useAPIClient();
38
+ const { refresh } = useDataBlockRequest();
39
+ const { t } = useTranslation();
40
+ const fieldName = props.fieldName || 'enabled';
41
+ var _record_fieldName;
42
+ const enabled = null != (_record_fieldName = null == record ? void 0 : record[fieldName]) ? _record_fieldName : false;
43
+ const resourceName = props.resource || 'workflows';
44
+ const checkedChildren = props.checkedChildren || t('On');
45
+ const unCheckedChildren = props.unCheckedChildren || t('Off');
46
+ const handleChange = async (checked)=>{
47
+ if (props.disabled) return;
48
+ try {
49
+ await api.resource(resourceName).update({
50
+ filterByTk: record.id,
51
+ values: {
52
+ [fieldName]: checked
53
+ }
54
+ });
55
+ message.success(t('Operation succeeded'));
56
+ refresh();
57
+ } catch (error) {
58
+ message.error(t('Operation failed'));
59
+ console.error(error);
60
+ }
61
+ };
62
+ return /*#__PURE__*/ jsx(Switch, {
63
+ checked: enabled,
64
+ onChange: handleChange,
65
+ checkedChildren: checkedChildren,
66
+ unCheckedChildren: unCheckedChildren,
67
+ size: "small",
68
+ className: styles.switchClass,
69
+ disabled: props.disabled
70
+ });
71
+ });
72
+ export { EnabledToggle };
@@ -19,7 +19,7 @@ function _templateObject() {
19
19
  }
20
20
  function _templateObject1() {
21
21
  const data = _tagged_template_literal([
22
- "\n // \u6269\u5927 SchemaToolbar \u7684\u9762\u79EF\n .tb-action-link {\n margin: -",
22
+ "\n // 扩大 SchemaToolbar 的面积\n .tb-action-link {\n margin: -",
23
23
  "px -",
24
24
  "px;\n padding: ",
25
25
  "px ",
@@ -3,4 +3,5 @@ export * from './TableField';
3
3
  export * from './TableSelectorDesigner';
4
4
  export * from './Table.Column.Designer';
5
5
  export { useColumnSchema } from './Table.Column.Decorator';
6
+ export * from './EnabledToggle';
6
7
  export declare const TableV2: any;
@@ -10,6 +10,7 @@ export * from "./TableBlockDesigner.mjs";
10
10
  export * from "./TableField.mjs";
11
11
  export * from "./TableSelectorDesigner.mjs";
12
12
  export * from "./Table.Column.Designer.mjs";
13
+ export * from "./EnabledToggle.mjs";
13
14
  const TableV2 = Table;
14
15
  TableV2.Column = TableColumn;
15
16
  TableV2.Column.ActionBar = TableColumnActionBar;
@@ -74,7 +74,7 @@ const CodeMirror_CodeMirror = (props)=>{
74
74
  children: [
75
75
  /*#__PURE__*/ jsx("div", {
76
76
  className: css(_templateObject1()),
77
- children: t("Click on the right to select variables \u2192")
77
+ children: t('Click on the right to select variables →')
78
78
  }),
79
79
  disabled ? null : /*#__PURE__*/ jsx(VariableSelect, {
80
80
  className: css(_templateObject2()),
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
9
9
  }
10
10
  function _templateObject() {
11
11
  const data = _tagged_template_literal([
12
- "\n position: relative;\n width: 100%;\n height: 100%;\n\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n &.leftBorder {\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: var(--colorPrimaryText);\n\n /* \u4F7F\u7528 clip-path \u88C1\u526A\u4E3A\u68AF\u5F62 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n &.adminMenu {\n .general-schema-designer {\n display: none;\n }\n }\n\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
12
+ "\n position: relative;\n width: 100%;\n height: 100%;\n\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n &.leftBorder {\n ::before {\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n transform: translateY(-50%);\n width: 3px;\n height: 50%;\n background-color: var(--colorPrimaryText);\n\n /* 使用 clip-path 裁剪为梯形 */\n clip-path: polygon(0 0, 100% 15%, 100% 85%, 0 100%);\n }\n }\n\n &.adminMenu {\n .general-schema-designer {\n display: none;\n }\n }\n\n .wrapper {\n display: flex;\n flex-direction: row;\n justify-content: space-around;\n }\n "
13
13
  ]);
14
14
  _templateObject = function() {
15
15
  return data;
@@ -9,7 +9,7 @@ function _tagged_template_literal(strings, raw) {
9
9
  }
10
10
  function _templateObject() {
11
11
  const data = _tagged_template_literal([
12
- "\n position: relative;\n width: 100%;\n height: 100%;\n padding: 6px 16px;\n border-radius: 8px 8px 0 0;\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n "
12
+ "\n position: relative;\n width: 100%;\n height: 100%;\n border-radius: 8px 8px 0 0;\n &.draggable {\n cursor: move;\n padding: 0 10px;\n border-radius: 5px;\n background: #f0f0f0;\n }\n "
13
13
  ]);
14
14
  _templateObject = function() {
15
15
  return data;
@@ -46,7 +46,7 @@ const EditableTitle = (props)=>{
46
46
  style: {
47
47
  color: '#bbb'
48
48
  },
49
- children: "\u672A\u547D\u540D"
49
+ children: "未命名"
50
50
  })
51
51
  })
52
52
  });
@@ -115,7 +115,7 @@ const schema = {
115
115
  ],
116
116
  fulfill: {
117
117
  state: {
118
- hidden: "{{\n !$deps[1] ||\n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) // \u6709 verifyMethod \u4F46\u672A\u9009 code\n }}"
118
+ hidden: "{{\n !$deps[1] ||\n !smsVerifyEnabled ||\n ($deps[0] !== 'code' && $deps[0] !== undefined) // verifyMethod 但未选 code\n }}"
119
119
  }
120
120
  }
121
121
  }
@@ -62,9 +62,17 @@ class PluginManager {
62
62
  pluginData: pluginList,
63
63
  devDynamicImport: this.app.devDynamicImport
64
64
  });
65
- for await (const [name, pluginClass] of plugins){
65
+ for await (const [name, pluginClass] of plugins)try {
66
66
  const info = pluginList.find((item)=>item.name === name);
67
67
  await this.add(pluginClass, info);
68
+ } catch (error) {
69
+ console.error("[PluginManager.initRemotePlugins] ✗ Error adding plugin ".concat(name, ":"), {
70
+ error,
71
+ errorMessage: null == error ? void 0 : error.message,
72
+ errorStack: null == error ? void 0 : error.stack,
73
+ pluginClass
74
+ });
75
+ throw error;
68
76
  }
69
77
  }
70
78
  async add(plugin) {
@@ -45,22 +45,42 @@ class WebSocketClient {
45
45
  const options = this.app.getOptions();
46
46
  const apiBaseURL = null == options ? void 0 : null == (_options_apiClient = options.apiClient) ? void 0 : _options_apiClient['baseURL'];
47
47
  if (!apiBaseURL) return;
48
+ const locationHostname = window.__tachybase_location_hostname__;
49
+ const windowHostname = window.location.hostname;
50
+ let hostname = locationHostname || windowHostname;
51
+ const hostnameFixer = window.__tachybase_fix_websocket_hostname__;
52
+ if ('function' == typeof hostnameFixer) {
53
+ const fixedHostname = hostnameFixer(hostname);
54
+ if (fixedHostname && 'string' == typeof fixedHostname) hostname = fixedHostname;
55
+ }
48
56
  const subApp = (0, client_namespaceObject.getSubAppName)(this.app.getPublicPath());
49
- const queryString = subApp ? "?__appName=".concat(subApp) : "?__hostname=".concat(window.location.hostname);
57
+ const queryString = subApp ? "?__appName=".concat(subApp) : "?__hostname=".concat(hostname);
50
58
  const wsPath = this.options.basename || '/ws';
59
+ const hostnameWasFixed = hostname !== window.location.hostname;
51
60
  if (this.options.url) {
52
61
  const url = new URL(this.options.url);
53
- if ('localhost' === url.hostname) {
54
- const protocol = 'https:' === location.protocol ? 'wss' : 'ws';
55
- return "".concat(protocol, "://").concat(location.hostname, ":").concat(url.port).concat(wsPath).concat(queryString);
62
+ if (hostnameWasFixed) {
63
+ const protocol = 'wss:' === url.protocol ? 'wss' : 'ws';
64
+ const port = url.port || '';
65
+ const host = port ? "".concat(hostname, ":").concat(port) : hostname;
66
+ return "".concat(protocol, "://").concat(host).concat(wsPath).concat(queryString);
56
67
  }
57
68
  return "".concat(this.options.url).concat(queryString);
58
69
  }
59
70
  try {
60
71
  const url = new URL(apiBaseURL);
61
- return "".concat('https:' === url.protocol ? 'wss' : 'ws', "://").concat(url.host).concat(wsPath).concat(queryString);
72
+ const finalHostname = hostnameWasFixed ? hostname : url.hostname;
73
+ const port = url.port || '';
74
+ const host = port ? "".concat(finalHostname, ":").concat(port) : finalHostname;
75
+ return "".concat('https:' === url.protocol ? 'wss' : 'ws', "://").concat(host).concat(wsPath).concat(queryString);
62
76
  } catch (error) {
63
- return "".concat('https:' === location.protocol ? 'wss' : 'ws', "://").concat(location.host).concat(wsPath).concat(queryString);
77
+ let port = location.port;
78
+ if (!port && apiBaseURL) try {
79
+ const apiUrl = new URL(apiBaseURL);
80
+ port = apiUrl.port;
81
+ } catch (e) {}
82
+ const host = port ? "".concat(hostname, ":").concat(port) : hostname;
83
+ return "".concat('https:' === location.protocol ? 'wss' : 'ws', "://").concat(host).concat(wsPath).concat(queryString);
64
84
  }
65
85
  }
66
86
  get reconnectAttempts() {
@@ -105,12 +105,18 @@ function getRemotePlugins(requirejs) {
105
105
  definePluginClient(packageName);
106
106
  });
107
107
  return new Promise((resolve, reject)=>{
108
- requirejs.requirejs(packageNames, processRemotePlugins(pluginData, resolve), reject);
108
+ requirejs.requirejs(packageNames, processRemotePlugins(pluginData, resolve), (error)=>{
109
+ console.error('[getRemotePlugins] requirejs error:', error);
110
+ reject(error);
111
+ });
109
112
  });
110
113
  }
111
114
  async function getPlugins(options) {
112
115
  const { requirejs, pluginData, devDynamicImport } = options;
113
- if (0 === pluginData.length) return [];
116
+ if (0 === pluginData.length) {
117
+ console.warn('[getPlugins] ⚠ Early return: pluginData.length === 0');
118
+ return [];
119
+ }
114
120
  const res = [];
115
121
  const resolveDevPlugins = {};
116
122
  if (devDynamicImport) {
@@ -64,7 +64,7 @@ const ExcelView = (props)=>{
64
64
  try {
65
65
  handleShowPreviewer();
66
66
  } catch (e) {
67
- console.log("%c Line:36 \uD83E\uDD5F e", e);
67
+ console.log('%c Line:36 🥟 e', e);
68
68
  }
69
69
  }
70
70
  }, [
@@ -327,7 +327,7 @@ const PluginDetail = (param)=>{
327
327
  }),
328
328
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)(external_antd_namespaceObject.Space, {
329
329
  split: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
330
- children: "\xa0\u2022\xa0"
330
+ children: "\xa0•\xa0"
331
331
  }),
332
332
  children: [
333
333
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("span", {
@@ -57,7 +57,7 @@ const SourceForeignKey = (0, schema_namespaceObject.observer)(()=>{
57
57
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("div", {
58
58
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Select, {
59
59
  allowClear: true,
60
- placeholder: "\u7559\u7A7A\u65F6\uFF0C\u81EA\u52A8\u751F\u6210 FK \u5B57\u6BB5",
60
+ placeholder: '留空时,自动生成 FK 字段',
61
61
  disabled: field.disabled,
62
62
  value: field.value,
63
63
  options: getCollectionFields(collection.name).filter((field)=>field.type).map((field)=>{
@@ -80,7 +80,7 @@ const ThroughForeignKey = (0, schema_namespaceObject.observer)(()=>{
80
80
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Select, {
81
81
  allowClear: true,
82
82
  popupMatchSelectWidth: false,
83
- placeholder: "\u7559\u7A7A\u65F6\uFF0C\u81EA\u52A8\u751F\u6210 FK \u5B57\u6BB5",
83
+ placeholder: '留空时,自动生成 FK 字段',
84
84
  disabled: field.disabled,
85
85
  value: field.value,
86
86
  options: getCollectionFields(form.values.through).filter((field)=>field.type).map((field)=>{
@@ -103,7 +103,7 @@ const TargetForeignKey = (0, schema_namespaceObject.observer)(()=>{
103
103
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_antd_namespaceObject.Select, {
104
104
  allowClear: true,
105
105
  popupMatchSelectWidth: false,
106
- placeholder: "\u7559\u7A7A\u65F6\uFF0C\u81EA\u52A8\u751F\u6210 FK \u5B57\u6BB5",
106
+ placeholder: '留空时,自动生成 FK 字段',
107
107
  disabled: field.disabled,
108
108
  value: field.value,
109
109
  options: getCollectionFields(form.values.target).filter((field)=>field.type).map((field)=>{
@@ -67,7 +67,7 @@ const ForeignKey1 = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div
67
67
  children: [
68
68
  "Foreign key 1 ",
69
69
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
70
- children: "\u65B0\u5EFA"
70
+ children: "新建"
71
71
  })
72
72
  ]
73
73
  });
@@ -75,7 +75,7 @@ const ForeignKey2 = ()=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsxs)("div
75
75
  children: [
76
76
  "Foreign key 2 ",
77
77
  /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("a", {
78
- children: "\u65B0\u5EFA"
78
+ children: "新建"
79
79
  })
80
80
  ]
81
81
  });
@@ -181,7 +181,7 @@ const number = [
181
181
  selected: true
182
182
  },
183
183
  {
184
- label: '{{t("\u2260")}}',
184
+ label: '{{t("")}}',
185
185
  value: '$ne'
186
186
  },
187
187
  {
@@ -189,7 +189,7 @@ const number = [
189
189
  value: '$gt'
190
190
  },
191
191
  {
192
- label: '{{t("\u2265")}}',
192
+ label: '{{t("")}}',
193
193
  value: '$gte'
194
194
  },
195
195
  {
@@ -197,7 +197,7 @@ const number = [
197
197
  value: '$lt'
198
198
  },
199
199
  {
200
- label: '{{t("\u2264")}}',
200
+ label: '{{t("")}}',
201
201
  value: '$lte'
202
202
  },
203
203
  {
@@ -69,6 +69,7 @@ module.exports = {
69
69
  "All events": "All events",
70
70
  "All plugin settings": "All plugin settings",
71
71
  "All records": "All records",
72
+ "All statuses": "All",
72
73
  AllProducts: "AllProducts",
73
74
  Allow: "Allow",
74
75
  "Allow access": "Allow access",
@@ -67,6 +67,7 @@ module.exports = {
67
67
  "All events": "Todos los eventos",
68
68
  "All plugin settings": "Configuraci\xF3n de todos los plugins",
69
69
  "All records": "Todos los registros",
70
+ "All statuses": "Todos",
70
71
  Allow: "Permitir",
71
72
  "Allow access": "Permitir acceso",
72
73
  "Allow action": "Permitir acci\xF3n",
@@ -65,6 +65,7 @@ module.exports = {
65
65
  "All events": "Tous les \xE9v\xE9nements",
66
66
  "All plugin settings": "Tous les param\xE8tres de plugin",
67
67
  "All records": "Tous les enregistrements",
68
+ "All statuses": "Tous",
68
69
  Allow: "Autoriser",
69
70
  "Allow access": "Autoriser l'acc\xE8s",
70
71
  "Allow action": "Autoriser l'action",
@@ -67,6 +67,7 @@ module.exports = {
67
67
  "All events": "\uBAA8\uB4E0 \uC774\uBCA4\uD2B8",
68
68
  "All plugin settings": "\uBAA8\uB4E0 \uD50C\uB7EC\uADF8\uC778 \uC124\uC815",
69
69
  "All records": "\uBAA8\uB4E0 \uB370\uC774\uD130",
70
+ "All statuses": "\uC804\uCCB4",
70
71
  Allow: "\uD5C8\uC6A9",
71
72
  "Allow access": "\uC811\uADFC \uD5C8\uC6A9",
72
73
  "Allow action": "\uC870\uC791 \uD5C8\uC6A9",
@@ -63,6 +63,7 @@ module.exports = {
63
63
  "All events": "Todos os eventos",
64
64
  "All plugin settings": "Configura\xE7\xF5es de todos os plugins",
65
65
  "All records": "Todos os registros",
66
+ "All statuses": "Todos",
66
67
  Allow: "Permitir",
67
68
  "Allow access": "Permitir acesso",
68
69
  "Allow action": "Permitir a\xE7\xE3o",
@@ -66,6 +66,7 @@ module.exports = {
66
66
  "All events": "\u0423\u0441\u0456 \u043F\u043E\u0434\u0456\u0457",
67
67
  "All plugin settings": "\u0412\u0441\u0456 \u043D\u0430\u043B\u0430\u0448\u0442\u0443\u0432\u0430\u043D\u043D\u044F \u043F\u043B\u0430\u0433\u0456\u043D\u0456\u0432",
68
68
  "All records": "\u0412\u0441\u0456 \u0437\u0430\u043F\u0438\u0441\u0438",
69
+ "All statuses": "\u0412\u0441\u0456",
69
70
  Allow: "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438",
70
71
  "Allow access": "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0434\u043E\u0441\u0442\u0443\u043F",
71
72
  "Allow action": "\u0414\u043E\u0437\u0432\u043E\u043B\u0438\u0442\u0438 \u0434\u0456\u044E",
@@ -76,6 +76,7 @@ module.exports = {
76
76
  "All events": "\u6240\u6709\u65E5\u7A0B",
77
77
  "All plugin settings": "\u6240\u6709\u63D2\u4EF6\u914D\u7F6E",
78
78
  "All records": "\u6240\u6709\u6570\u636E",
79
+ "All statuses": "\u5168\u90E8",
79
80
  AllProducts: "\u5168\u90E8\u5546\u54C1",
80
81
  Allow: "\u5141\u8BB8",
81
82
  "Allow access": "\u5141\u8BB8\u8BBF\u95EE",
@@ -67,6 +67,7 @@ module.exports = {
67
67
  "All events": "\u6240\u6709\u4E8B\u4EF6",
68
68
  "All plugin settings": "\u6240\u6709\u63D2\u4EF6\u8A2D\u5B9A",
69
69
  "All records": "\u6240\u6709\u8CC7\u6599",
70
+ "All statuses": "\u5168\u90E8",
70
71
  Allow: "\u5141\u8A31",
71
72
  "Allow access": "\u5141\u8A31\u8A2A\u554F",
72
73
  "Allow action": "\u5141\u8A31\u52D5\u4F5C",
@@ -168,7 +168,10 @@ const useTableBlockProps = ()=>{
168
168
  prevMergedFilter = currFilter;
169
169
  dataBlocks.forEach((item)=>{
170
170
  const targetsUidList = targets.map((targetItem)=>targetItem.uid);
171
- if (targetsUidList.includes(item.uid) && !item.associatedFields.find((assItem)=>assItem.name === target.field || target.field.includes(assItem.name))) {
171
+ if (targetsUidList.includes(item.uid) && !item.associatedFields.find((assItem)=>{
172
+ var _target_field;
173
+ return assItem.name === target.field || (null == (_target_field = target.field) ? void 0 : _target_field.includes(assItem.name));
174
+ })) {
172
175
  const prevFlatItems = external_flat_default()(prevMergedFilter);
173
176
  Object.entries(prevFlatItems).forEach((param)=>{
174
177
  let [key, prevItem] = param;
@@ -26,6 +26,7 @@ __webpack_require__.r(__webpack_exports__);
26
26
  __webpack_require__.d(__webpack_exports__, {
27
27
  AntdSchemaComponentPlugin: ()=>AntdSchemaComponentPlugin
28
28
  });
29
+ const client_namespaceObject = require("@tego/client");
29
30
  const external_index_js_namespaceObject = require("./index.js");
30
31
  const Plugin_js_namespaceObject = require("../../application/Plugin.js");
31
32
  const index_js_namespaceObject = require("../common/index.js");
@@ -44,7 +45,8 @@ class AntdSchemaComponentPlugin extends Plugin_js_namespaceObject.Plugin {
44
45
  addComponents() {
45
46
  this.app.addComponents({
46
47
  ...external_index_js_namespaceObject,
47
- ...index_js_namespaceObject
48
+ ...index_js_namespaceObject,
49
+ CodeMirror: client_namespaceObject.CodeMirror
48
50
  });
49
51
  }
50
52
  addScopes() {
@@ -30,7 +30,7 @@ const external_react_namespaceObject = require("react");
30
30
  const external_antd_namespaceObject = require("antd");
31
31
  const usePrefixCls = (tag, props)=>{
32
32
  const { getPrefixCls } = (0, external_react_namespaceObject.useContext)(external_antd_namespaceObject.ConfigProvider.ConfigContext) || {};
33
- if ('ConfigContext' in external_antd_namespaceObject.ConfigProvider) return (null == getPrefixCls ? void 0 : getPrefixCls(tag, null == props ? void 0 : props.prefixCls)) || '';
33
+ if ("ConfigContext" in external_antd_namespaceObject.ConfigProvider) return (null == getPrefixCls ? void 0 : getPrefixCls(tag, null == props ? void 0 : props.prefixCls)) || '';
34
34
  {
35
35
  var _props_prefixCls;
36
36
  const prefix = null != (_props_prefixCls = null == props ? void 0 : props.prefixCls) ? _props_prefixCls : 'ant-';
@@ -61,7 +61,7 @@ function _templateObject1() {
61
61
  function _templateObject2() {
62
62
  const data = _tagged_template_literal([
63
63
  "\n position: sticky !important;\n top: 0 !important;\n z-index: 100 !important;\n background: #fff !important;\n background-color: #fff !important;\n padding: ",
64
- "px 0;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n border-bottom: 1px solid rgba(5, 5, 5, 0.06);\n margin: 0 -16px;\n padding-left: 16px;\n padding-right: 16px;\n\n /* \u786E\u4FDD\u5B8C\u5168\u906E\u6321 */\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100vw;\n right: -100vw;\n bottom: 0;\n background: #fff;\n z-index: -1;\n }\n "
64
+ "px 0;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n border-bottom: 1px solid rgba(5, 5, 5, 0.06);\n margin: 0 -16px;\n padding-left: 16px;\n padding-right: 16px;\n\n /* 确保完全遮挡 */\n &::before {\n content: '';\n position: absolute;\n top: 0;\n left: -100vw;\n right: -100vw;\n bottom: 0;\n background: #fff;\n z-index: -1;\n }\n "
65
65
  ]);
66
66
  _templateObject2 = function() {
67
67
  return data;
@@ -339,7 +339,7 @@ function WorkflowSelectComponent(param) {
339
339
  return /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_data_source_index_js_namespaceObject.DataSourceProvider, {
340
340
  dataSource: "main",
341
341
  children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_index_js_namespaceObject.RemoteSelect, {
342
- manual: true,
342
+ manual: false,
343
343
  placeholder: t('Select workflow', {
344
344
  ns: 'workflow'
345
345
  }),