@tmagic/editor 1.8.0-beta.12 → 1.8.0-beta.14

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 (133) hide show
  1. package/dist/es/Editor.vue_vue_type_script_setup_true_lang.js +15 -3
  2. package/dist/es/components/CodeBlockEditor.vue_vue_type_script_setup_true_lang.js +1 -1
  3. package/dist/es/components/CompareForm.vue_vue_type_script_setup_true_lang.js +13 -121
  4. package/dist/es/components/ContentMenu.vue_vue_type_script_setup_true_lang.js +11 -4
  5. package/dist/es/components/FloatingBox.vue_vue_type_script_setup_true_lang.js +7 -2
  6. package/dist/es/components/ViewForm.js +5 -0
  7. package/dist/es/components/ViewForm.vue_vue_type_script_setup_true_lang.js +58 -0
  8. package/dist/es/fields/Code.vue_vue_type_script_setup_true_lang.js +4 -1
  9. package/dist/es/fields/CodeLink.vue_vue_type_script_setup_true_lang.js +4 -1
  10. package/dist/es/fields/CodeSelect.vue_vue_type_script_setup_true_lang.js +80 -55
  11. package/dist/es/fields/CodeSelectCol.vue_vue_type_script_setup_true_lang.js +5 -1
  12. package/dist/es/fields/CondOpSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  13. package/dist/es/fields/DataSourceFieldSelect/Index.vue_vue_type_script_setup_true_lang.js +10 -7
  14. package/dist/es/fields/DataSourceFields.vue_vue_type_script_setup_true_lang.js +4 -1
  15. package/dist/es/fields/DataSourceInput.vue_vue_type_script_setup_true_lang.js +4 -1
  16. package/dist/es/fields/DataSourceMethodSelect.vue_vue_type_script_setup_true_name_true_lang.js +4 -1
  17. package/dist/es/fields/DataSourceMethods.vue_vue_type_script_setup_true_lang.js +4 -1
  18. package/dist/es/fields/DataSourceMocks.vue_vue_type_script_setup_true_lang.js +4 -1
  19. package/dist/es/fields/DataSourceSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  20. package/dist/es/fields/DisplayConds.vue_vue_type_script_setup_true_lang.js +8 -2
  21. package/dist/es/fields/EventSelect.vue_vue_type_script_setup_true_lang.js +99 -64
  22. package/dist/es/fields/KeyValue.vue_vue_type_script_setup_true_lang.js +4 -1
  23. package/dist/es/fields/PageFragmentSelect.vue_vue_type_script_setup_true_lang.js +4 -1
  24. package/dist/es/fields/StyleSetter/Index.vue_vue_type_script_setup_true_lang.js +5 -4
  25. package/dist/es/fields/StyleSetter/components/BackgroundPosition.vue_vue_type_script_setup_true_lang.js +4 -1
  26. package/dist/es/fields/StyleSetter/components/Border.vue_vue_type_script_setup_true_lang.js +1 -1
  27. package/dist/es/fields/StyleSetter/icons/align-items/Center.js +31 -0
  28. package/dist/es/fields/StyleSetter/icons/align-items/FlexEnd.js +31 -0
  29. package/dist/es/fields/StyleSetter/icons/align-items/FlexStart.js +31 -0
  30. package/dist/es/fields/StyleSetter/icons/align-items/SpaceAround.js +50 -0
  31. package/dist/es/fields/StyleSetter/icons/align-items/SpaceBetween.js +50 -0
  32. package/dist/es/fields/StyleSetter/icons/background-repeat/NoRepeat.js +6 -6
  33. package/dist/es/fields/StyleSetter/icons/background-repeat/Repeat.js +5 -2
  34. package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatX.js +28 -5
  35. package/dist/es/fields/StyleSetter/icons/background-repeat/RepeatY.js +31 -5
  36. package/dist/es/fields/StyleSetter/icons/flex-direction/Column.js +10 -2
  37. package/dist/es/fields/StyleSetter/icons/flex-direction/ColumnReverse.js +10 -2
  38. package/dist/es/fields/StyleSetter/icons/flex-direction/Row.js +10 -2
  39. package/dist/es/fields/StyleSetter/icons/flex-direction/RowReverse.js +10 -2
  40. package/dist/es/fields/StyleSetter/icons/justify-content/Center.js +16 -2
  41. package/dist/es/fields/StyleSetter/icons/justify-content/FlexEnd.js +18 -2
  42. package/dist/es/fields/StyleSetter/icons/justify-content/FlexStart.js +18 -2
  43. package/dist/es/fields/StyleSetter/icons/justify-content/SpaceAround.js +36 -2
  44. package/dist/es/fields/StyleSetter/icons/justify-content/SpaceBetween.js +32 -2
  45. package/dist/es/fields/StyleSetter/pro/Background.vue_vue_type_script_setup_true_lang.js +7 -6
  46. package/dist/es/fields/StyleSetter/pro/Font.vue_vue_type_script_setup_true_lang.js +6 -3
  47. package/dist/es/fields/StyleSetter/pro/Layout.vue_vue_type_script_setup_true_lang.js +47 -25
  48. package/dist/es/fields/UISelect.vue_vue_type_script_setup_true_lang.js +4 -1
  49. package/dist/es/hooks/use-compare-form.js +119 -0
  50. package/dist/es/icons/DatasourceIcon.js +17 -0
  51. package/dist/es/index.js +6 -4
  52. package/dist/es/layouts/Framework.vue_vue_type_script_setup_true_lang.js +14 -10
  53. package/dist/es/layouts/props-panel/PropsPanel.vue_vue_type_script_setup_true_lang.js +10 -1
  54. package/dist/es/layouts/sidebar/Sidebar.vue_vue_type_script_setup_true_lang.js +3 -3
  55. package/dist/es/plugin.js +2 -1
  56. package/dist/es/services/codeBlock.js +1 -1
  57. package/dist/es/services/editor.js +54 -13
  58. package/dist/es/services/history.js +1 -1
  59. package/dist/es/services/props.js +1 -1
  60. package/dist/es/services/storage.js +1 -1
  61. package/dist/es/services/ui.js +5 -3
  62. package/dist/es/style.css +303 -40
  63. package/dist/es/utils/config.js +4 -1
  64. package/dist/es/utils/const.js +2 -2
  65. package/dist/es/utils/props.js +69 -30
  66. package/dist/style.css +303 -40
  67. package/dist/themes/magic-admin.css +3000 -0
  68. package/dist/tmagic-editor.umd.cjs +1748 -1079
  69. package/package.json +7 -7
  70. package/src/Editor.vue +22 -1
  71. package/src/components/CompareForm.vue +15 -202
  72. package/src/components/ContentMenu.vue +10 -2
  73. package/src/components/FloatingBox.vue +8 -2
  74. package/src/components/ViewForm.vue +55 -0
  75. package/src/editorProps.ts +4 -0
  76. package/src/fields/CodeSelect.vue +54 -43
  77. package/src/fields/CodeSelectCol.vue +1 -0
  78. package/src/fields/DataSourceFieldSelect/Index.vue +14 -5
  79. package/src/fields/DisplayConds.vue +4 -1
  80. package/src/fields/EventSelect.vue +56 -32
  81. package/src/fields/StyleSetter/Index.vue +1 -4
  82. package/src/fields/StyleSetter/components/Border.vue +1 -1
  83. package/src/fields/StyleSetter/icons/align-items/Center.vue +19 -0
  84. package/src/fields/StyleSetter/icons/align-items/FlexEnd.vue +19 -0
  85. package/src/fields/StyleSetter/icons/align-items/FlexStart.vue +19 -0
  86. package/src/fields/StyleSetter/icons/align-items/SpaceAround.vue +34 -0
  87. package/src/fields/StyleSetter/icons/align-items/SpaceBetween.vue +34 -0
  88. package/src/fields/StyleSetter/icons/align-items/index.ts +5 -0
  89. package/src/fields/StyleSetter/icons/background-repeat/NoRepeat.vue +20 -4
  90. package/src/fields/StyleSetter/icons/background-repeat/Repeat.vue +10 -28
  91. package/src/fields/StyleSetter/icons/background-repeat/RepeatX.vue +4 -5
  92. package/src/fields/StyleSetter/icons/background-repeat/RepeatY.vue +4 -5
  93. package/src/fields/StyleSetter/icons/flex-direction/Column.vue +4 -3
  94. package/src/fields/StyleSetter/icons/flex-direction/ColumnReverse.vue +4 -3
  95. package/src/fields/StyleSetter/icons/flex-direction/Row.vue +4 -3
  96. package/src/fields/StyleSetter/icons/flex-direction/RowReverse.vue +4 -3
  97. package/src/fields/StyleSetter/icons/justify-content/Center.vue +5 -2
  98. package/src/fields/StyleSetter/icons/justify-content/FlexEnd.vue +15 -2
  99. package/src/fields/StyleSetter/icons/justify-content/FlexStart.vue +15 -2
  100. package/src/fields/StyleSetter/icons/justify-content/SpaceAround.vue +28 -3
  101. package/src/fields/StyleSetter/icons/justify-content/SpaceBetween.vue +28 -2
  102. package/src/fields/StyleSetter/pro/Background.vue +7 -2
  103. package/src/fields/StyleSetter/pro/Font.vue +3 -3
  104. package/src/fields/StyleSetter/pro/Layout.vue +98 -28
  105. package/src/hooks/index.ts +1 -0
  106. package/src/hooks/use-compare-form.ts +187 -0
  107. package/src/icons/DatasourceIcon.vue +7 -0
  108. package/src/index.ts +4 -0
  109. package/src/layouts/Framework.vue +7 -1
  110. package/src/layouts/props-panel/PropsPanel.vue +19 -1
  111. package/src/layouts/sidebar/Sidebar.vue +3 -3
  112. package/src/plugin.ts +3 -2
  113. package/src/services/editor.ts +54 -11
  114. package/src/services/ui.ts +20 -5
  115. package/src/theme/code-block.scss +37 -0
  116. package/src/theme/common/var.scss +1 -1
  117. package/src/theme/component-list-panel.scss +2 -2
  118. package/src/theme/data-source-field.scss +4 -0
  119. package/src/theme/display-conds.scss +11 -0
  120. package/src/theme/event.scss +58 -4
  121. package/src/theme/framework.scss +4 -1
  122. package/src/theme/history-list-panel.scss +9 -9
  123. package/src/theme/nav-menu.scss +5 -1
  124. package/src/theme/props-panel.scss +2 -1
  125. package/src/theme/style-setter/border.scss +14 -5
  126. package/src/theme/theme.scss +1 -0
  127. package/src/theme/themes/magic-admin/index.scss +214 -0
  128. package/src/theme/ui-select.scss +1 -1
  129. package/src/type.ts +79 -6
  130. package/src/utils/config.ts +9 -1
  131. package/src/utils/const.ts +3 -2
  132. package/src/utils/props.ts +51 -9
  133. package/types/index.d.ts +314 -203
@@ -1,4 +1,9 @@
1
1
  import Box_default from "../components/Box.js";
2
+ import Center_default from "../icons/align-items/Center.js";
3
+ import FlexEnd_default from "../icons/align-items/FlexEnd.js";
4
+ import FlexStart_default from "../icons/align-items/FlexStart.js";
5
+ import SpaceAround_default from "../icons/align-items/SpaceAround.js";
6
+ import SpaceBetween_default from "../icons/align-items/SpaceBetween.js";
2
7
  import Block_default from "../icons/display/Block.js";
3
8
  import Flex_default from "../icons/display/Flex.js";
4
9
  import Inline_default from "../icons/display/Inline.js";
@@ -8,12 +13,13 @@ import Column_default from "../icons/flex-direction/Column.js";
8
13
  import ColumnReverse_default from "../icons/flex-direction/ColumnReverse.js";
9
14
  import Row_default from "../icons/flex-direction/Row.js";
10
15
  import RowReverse_default from "../icons/flex-direction/RowReverse.js";
11
- import Center_default from "../icons/justify-content/Center.js";
12
- import FlexEnd_default from "../icons/justify-content/FlexEnd.js";
13
- import FlexStart_default from "../icons/justify-content/FlexStart.js";
14
- import SpaceAround_default from "../icons/justify-content/SpaceAround.js";
15
- import SpaceBetween_default from "../icons/justify-content/SpaceBetween.js";
16
+ import Center_default$1 from "../icons/justify-content/Center.js";
17
+ import FlexEnd_default$1 from "../icons/justify-content/FlexEnd.js";
18
+ import FlexStart_default$1 from "../icons/justify-content/FlexStart.js";
19
+ import SpaceAround_default$1 from "../icons/justify-content/SpaceAround.js";
20
+ import SpaceBetween_default$1 from "../icons/justify-content/SpaceBetween.js";
16
21
  import { MContainer, defineFormConfig } from "@tmagic/form";
22
+ import { useTheme } from "@tmagic/design";
17
23
  import { Fragment, createBlock, createElementBlock, createVNode, defineComponent, markRaw, openBlock, renderList, unref, vShow, withDirectives } from "vue";
18
24
  //#region packages/editor/src/fields/StyleSetter/pro/Layout.vue?vue&type=script&setup=true&lang.ts
19
25
  var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
@@ -24,18 +30,22 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
24
30
  isCompare: { type: Boolean },
25
31
  disabled: { type: Boolean },
26
32
  size: {},
33
+ theme: {},
27
34
  prop: {}
28
35
  },
29
36
  emits: ["change", "addDiffCount"],
30
37
  setup(__props, { emit: __emit }) {
38
+ const props = __props;
31
39
  const emit = __emit;
40
+ const displayTheme = useTheme(props);
32
41
  const formConfig = defineFormConfig([
33
42
  {
34
43
  name: "display",
35
44
  text: "模式",
36
45
  type: "radioGroup",
37
46
  childType: "button",
38
- labelWidth: "68px",
47
+ labelWidth: "90px",
48
+ iconSize: "24px",
39
49
  options: [
40
50
  {
41
51
  value: "inline",
@@ -69,7 +79,8 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
69
79
  text: "主轴方向",
70
80
  type: "radioGroup",
71
81
  childType: "button",
72
- labelWidth: "68px",
82
+ labelWidth: "90px",
83
+ iconSize: "24px",
73
84
  options: [
74
85
  {
75
86
  value: "row",
@@ -99,31 +110,32 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
99
110
  text: "主轴对齐",
100
111
  type: "radioGroup",
101
112
  childType: "button",
102
- labelWidth: "68px",
113
+ labelWidth: "90px",
114
+ iconSize: "24px",
103
115
  options: [
104
116
  {
105
117
  value: "flex-start",
106
- icon: markRaw(FlexStart_default),
118
+ icon: markRaw(FlexStart_default$1),
107
119
  tooltip: "左对齐 flex-start"
108
120
  },
109
121
  {
110
122
  value: "flex-end",
111
- icon: markRaw(FlexEnd_default),
123
+ icon: markRaw(FlexEnd_default$1),
112
124
  tooltip: "右对齐 flex-end"
113
125
  },
114
126
  {
115
127
  value: "center",
116
- icon: markRaw(Center_default),
128
+ icon: markRaw(Center_default$1),
117
129
  tooltip: "居中 center"
118
130
  },
119
131
  {
120
132
  value: "space-between",
121
- icon: markRaw(SpaceBetween_default),
133
+ icon: markRaw(SpaceBetween_default$1),
122
134
  tooltip: "两端对齐 space-between"
123
135
  },
124
136
  {
125
137
  value: "space-around",
126
- icon: markRaw(SpaceAround_default),
138
+ icon: markRaw(SpaceAround_default$1),
127
139
  tooltip: "横向平分 space-around"
128
140
  }
129
141
  ],
@@ -134,7 +146,8 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
134
146
  text: "辅轴对齐",
135
147
  type: "radioGroup",
136
148
  childType: "button",
137
- labelWidth: "68px",
149
+ labelWidth: "90px",
150
+ iconSize: "24px",
138
151
  options: [
139
152
  {
140
153
  value: "flex-start",
@@ -168,8 +181,9 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
168
181
  name: "flexWrap",
169
182
  text: "换行",
170
183
  type: "radioGroup",
171
- childType: "button",
172
- labelWidth: "68px",
184
+ childType: displayTheme.value !== "magic-admin" ? "button" : "default",
185
+ labelWidth: "90px",
186
+ iconSize: "24px",
173
187
  options: [
174
188
  {
175
189
  value: "nowrap",
@@ -193,14 +207,18 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
193
207
  type: "row",
194
208
  items: [{
195
209
  name: "width",
196
- text: "宽度",
197
- labelWidth: "68px",
210
+ text: "宽度(px)",
211
+ labelWidth: "90px",
198
212
  type: "data-source-field-select",
199
213
  fieldConfig: { type: "text" }
200
- }, {
214
+ }]
215
+ },
216
+ {
217
+ type: "row",
218
+ items: [{
201
219
  name: "height",
202
- text: "高度",
203
- labelWidth: "68px",
220
+ text: "高度(px)",
221
+ labelWidth: "90px",
204
222
  type: "data-source-field-select",
205
223
  fieldConfig: { type: "text" }
206
224
  }]
@@ -211,7 +229,7 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
211
229
  type: "data-source-field-select",
212
230
  text: "overflow",
213
231
  name: "overflow",
214
- labelWidth: "68px",
232
+ labelWidth: "90px",
215
233
  checkStrictly: false,
216
234
  dataSourceFieldType: ["string"],
217
235
  fieldConfig: {
@@ -249,11 +267,15 @@ var Layout_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCom
249
267
  }
250
268
  ]
251
269
  }
252
- }, {
270
+ }]
271
+ },
272
+ {
273
+ type: "row",
274
+ items: [{
253
275
  type: "data-source-field-select",
254
- text: "透明度",
276
+ text: "透明度(%)",
255
277
  name: "opacity",
256
- labelWidth: "68px",
278
+ labelWidth: "90px",
257
279
  dataSourceFieldType: ["string", "number"],
258
280
  fieldConfig: { type: "text" }
259
281
  }]
@@ -24,7 +24,10 @@ var UISelect_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineC
24
24
  disabled: { type: Boolean },
25
25
  size: {},
26
26
  lastValues: {},
27
- isCompare: { type: Boolean }
27
+ isCompare: { type: Boolean },
28
+ text: {},
29
+ labelWidth: {},
30
+ labelPosition: {}
28
31
  },
29
32
  emits: ["change"],
30
33
  setup(__props, { emit: __emit }) {
@@ -0,0 +1,119 @@
1
+ import { getCodeBlockFormConfig } from "../utils/code-block.js";
2
+ import { removeStyleDisplayConfig } from "../utils/props.js";
3
+ import { computed, inject, provide, ref, useTemplateRef, watch, watchEffect } from "vue";
4
+ //#region packages/editor/src/hooks/use-compare-form.ts
5
+ /**
6
+ * CompareForm / ViewForm 共用逻辑:
7
+ * - 按 `category`(node / data-source / code-block) 加载 FormConfig(支持自定义 `loadConfig`);
8
+ * - 代码块 `content` 归一化为字符串;
9
+ * - 外层容器固定高度 + 内部滚动的 `wrapperStyle`;
10
+ * - 将 services / stage 注入 MForm.formState,保证 filterFunction 上下文一致。
11
+ *
12
+ * 两个组件的差异仅在于是否做新旧值对比,这部分逻辑保留在各自组件中。
13
+ */
14
+ var useCompareForm = (props) => {
15
+ provide("services", props.services);
16
+ const config = ref([]);
17
+ /** vs-code 编辑器的 monaco 配置项,沿用 Editor 顶层 provide('codeOptions', ...) 的注入。 */
18
+ const codeOptions = inject("codeOptions", {});
19
+ /** 将代码块的 content 字段统一成字符串,便于在表单 / 对比中展示 */
20
+ const normalizeCodeBlockValue = (v) => {
21
+ if (!v) return {};
22
+ const next = { ...v };
23
+ if (next.content && typeof next.content !== "string") try {
24
+ next.content = next.content.toString();
25
+ } catch {
26
+ next.content = "";
27
+ }
28
+ return next;
29
+ };
30
+ const currentValues = computed(() => {
31
+ if (props.category === "code-block") return normalizeCodeBlockValue(props.value);
32
+ return props.value || {};
33
+ });
34
+ /**
35
+ * 外层包裹层的样式:当传入 `height` 时启用固定高度 + 内部滚动,
36
+ * 这样滚动条会出现在组件内部,避免父容器(如 Dialog)自身也产生滚动。
37
+ */
38
+ const wrapperStyle = computed(() => {
39
+ if (!props.height) return void 0;
40
+ return {
41
+ height: props.height,
42
+ overflow: "auto"
43
+ };
44
+ });
45
+ const mergedExtendState = (state) => {
46
+ return (props.extendState ?? ((s) => s))(props.baseFormState || state);
47
+ };
48
+ /**
49
+ * 内置的默认 FormConfig 加载逻辑:按 `category` 从对应 service / 工具取配置。
50
+ * 作为 ctx.defaultLoadConfig 透传给自定义 `loadConfig`,方便复用与二次加工。
51
+ */
52
+ const defaultLoadConfig = async () => {
53
+ if (!props.services) return [];
54
+ switch (props.category) {
55
+ case "node":
56
+ if (!props.type) return [];
57
+ return removeStyleDisplayConfig(await props.services.propsService.getPropsConfig(props.type, { node: props.value }));
58
+ case "data-source": return props.services.dataSourceService.getFormConfig(props.type || "base").map((item) => "type" in item && item.type === "tab" ? {
59
+ ...item,
60
+ active: "fields"
61
+ } : item);
62
+ case "code-block": return getCodeBlockFormConfig({
63
+ paramColConfig: props.services.codeBlockService.getParamsColConfig(),
64
+ isDataSource: () => Boolean(props.dataSourceType),
65
+ dataSourceType: () => props.dataSourceType,
66
+ codeOptions,
67
+ editable: false
68
+ });
69
+ default: return [];
70
+ }
71
+ };
72
+ const loadConfig = async () => {
73
+ if (props.loadConfig) {
74
+ config.value = await props.loadConfig({
75
+ category: props.category,
76
+ type: props.type,
77
+ dataSourceType: props.dataSourceType,
78
+ defaultLoadConfig
79
+ });
80
+ return;
81
+ }
82
+ config.value = await defaultLoadConfig();
83
+ };
84
+ watch([
85
+ () => props.category,
86
+ () => props.type,
87
+ () => props.dataSourceType,
88
+ () => props.loadConfig
89
+ ], () => {
90
+ loadConfig();
91
+ }, { immediate: true });
92
+ const formRef = useTemplateRef("form");
93
+ /**
94
+ * 把 services / stage 注入 MForm 的 formState,避免 propsService 注入的表单配置中
95
+ * 形如 `display: ({ services }) => services.uiService.get(...)` 的 filterFunction
96
+ * 在执行时拿不到 `formState.services` 而报错。
97
+ *
98
+ * 与 props-panel/FormPanel.vue 中的注入方式保持一致:
99
+ * - services:整个 useServices() 返回的服务集合;
100
+ * - stage:当前 editorService.get('stage') 的最新值。
101
+ */
102
+ watchEffect(() => {
103
+ if (formRef.value && props.services) {
104
+ formRef.value.formState.stage = props.services.editorService.get("stage");
105
+ formRef.value.formState.services = props.services;
106
+ }
107
+ });
108
+ return {
109
+ config,
110
+ currentValues,
111
+ wrapperStyle,
112
+ mergedExtendState,
113
+ loadConfig,
114
+ formRef,
115
+ normalizeCodeBlockValue
116
+ };
117
+ };
118
+ //#endregion
119
+ export { useCompareForm };
@@ -0,0 +1,17 @@
1
+ import _plugin_vue_export_helper_default from "../_virtual/_plugin-vue_export-helper.js";
2
+ import { createElementBlock, createElementVNode, openBlock } from "vue";
3
+ //#region packages/editor/src/icons/DatasourceIcon.vue
4
+ var _sfc_main = {};
5
+ var _hoisted_1 = {
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ width: "16",
8
+ height: "16",
9
+ viewBox: "0 0 16 16",
10
+ fill: "currentColor"
11
+ };
12
+ function _sfc_render(_ctx, _cache) {
13
+ return openBlock(), createElementBlock("svg", _hoisted_1, [..._cache[0] || (_cache[0] = [createElementVNode("path", { d: "M6.25 9.723C4.392 9.6095 2.804 9.137 1.875 8.4775V9.7495C1.875 10.6165 3.7665 11.3365 6.25 11.4745V12.348C4.392 12.2345 2.804 11.763 1.875 11.102V12.3745H1V4.0625C1 2.371 3.742 1 7.125 1C10.507 1 13.249 2.371 13.249 4.0625V6.8255H12.374V5.6405C11.3025 6.5295 9.352 7.1245 7.1245 7.1245C4.897 7.1245 2.947 6.5295 1.8745 5.6405V7.1245C1.8745 7.9915 3.7665 8.712 6.2495 8.85L6.25 9.723ZM7.125 14.999C3.742 14.999 1 13.8245 1 12.3745H1.875C1.875 13.3415 4.225 14.124 7.125 14.124V14.999ZM7.125 6.2495C10.024 6.2495 12.3745 5.2695 12.3745 4.0625C12.3745 2.855 10.0245 1.875 7.1245 1.875C4.225 1.875 1.8745 2.855 1.8745 4.0625C1.8745 5.2695 4.2255 6.2495 7.125 6.2495ZM14.7385 11.9895L14.1295 11.6345C14.1635 11.4485 14.1855 11.2585 14.1855 11.062C14.1843 10.8697 14.1655 10.6779 14.1295 10.489L14.7385 10.134C14.988 9.987 15.073 9.667 14.929 9.416L14.409 8.507C14.3752 8.44726 14.3299 8.39483 14.2757 8.35275C14.2215 8.31066 14.1595 8.27977 14.0933 8.26186C14.027 8.24395 13.9579 8.23938 13.8898 8.24842C13.8218 8.25745 13.7563 8.27992 13.697 8.3145L13.081 8.6735C12.7931 8.42269 12.4616 8.22694 12.103 8.096V7.6495C12.103 7.36 11.8705 7.1245 11.5825 7.1245H10.5415C10.4728 7.12476 10.4049 7.13855 10.3415 7.16507C10.2782 7.1916 10.2206 7.23034 10.1723 7.2791C10.1239 7.32785 10.0856 7.38565 10.0595 7.4492C10.0335 7.51276 10.0202 7.58082 10.0205 7.6495V8.096C9.66186 8.22694 9.33035 8.42269 9.0425 8.6735L8.4265 8.3145C8.36725 8.27999 8.30174 8.2576 8.23377 8.2486C8.1658 8.23961 8.09672 8.24419 8.03053 8.2621C7.96435 8.28001 7.90238 8.31088 7.84821 8.35292C7.79405 8.39495 7.74877 8.44733 7.715 8.507L7.195 9.417C7.12576 9.53751 7.10688 9.68047 7.14246 9.81482C7.17804 9.94917 7.2652 10.0641 7.385 10.1345L7.9945 10.489C7.9585 10.6775 7.9395 10.8695 7.9385 11.062C7.9385 11.2585 7.96 11.4485 7.9945 11.635L7.3855 11.99C7.1355 12.1365 7.0505 12.4565 7.1945 12.7075L7.715 13.6165C7.74877 13.6762 7.79405 13.7285 7.84821 13.7706C7.90238 13.8126 7.96435 13.8435 8.03053 13.8614C8.09672 13.8793 8.1658 13.8839 8.23377 13.8749C8.30174 13.8659 8.36725 13.8435 8.4265 13.809L9.0425 13.4505C9.33023 13.7015 9.66178 13.8972 10.0205 14.028V14.474C10.0205 14.764 10.2535 14.999 10.5415 14.999H11.5825C11.7211 14.9983 11.8538 14.9427 11.9514 14.8442C12.049 14.7458 12.1035 14.6126 12.103 14.474V14.028C12.4616 13.8971 12.7931 13.7013 13.081 13.4505L13.697 13.809C13.7563 13.8434 13.8218 13.8657 13.8897 13.8746C13.9577 13.8835 14.0267 13.8789 14.0929 13.861C14.159 13.8431 14.221 13.8123 14.2751 13.7703C14.3293 13.7283 14.3746 13.6761 14.4085 13.6165L14.929 12.7065C14.998 12.586 15.0168 12.4431 14.9811 12.3089C14.9454 12.1746 14.8583 12.0599 14.7385 11.9895ZM14.092 12.5065L13.852 12.915C13.8193 12.9693 13.7667 13.0086 13.7054 13.0246C13.6441 13.0406 13.579 13.0319 13.524 13.0005L12.8575 12.623C12.5109 13.0069 12.0497 13.2688 11.5425 13.37V13.889C11.5425 14.0185 11.4345 14.124 11.3015 14.124H10.822C10.7907 14.1243 10.7597 14.1184 10.7308 14.1067C10.7018 14.0949 10.6754 14.0776 10.6531 14.0557C10.6308 14.0338 10.6131 14.0077 10.6009 13.9789C10.5887 13.9502 10.5823 13.9193 10.582 13.888V13.37C10.0746 13.2689 9.61328 13.007 9.2665 12.623L8.6 13C8.54495 13.0316 8.47971 13.0403 8.4183 13.0243C8.35688 13.0083 8.30418 12.9689 8.2715 12.9145L8.0315 12.506C8.01582 12.4792 8.00564 12.4496 8.00158 12.4189C7.99752 12.3881 7.99965 12.3569 8.00785 12.327C8.01605 12.297 8.03016 12.2691 8.04933 12.2447C8.0685 12.2203 8.09236 12.2 8.1195 12.185L8.789 11.805C8.70604 11.5658 8.66313 11.3146 8.662 11.0615C8.662 10.8005 8.709 10.552 8.7895 10.3175L8.1195 9.9375C8.09247 9.92244 8.06872 9.90213 8.04964 9.87777C8.03056 9.85341 8.01654 9.82549 8.00839 9.79564C8.00024 9.76579 7.99813 9.73461 8.00218 9.70394C8.00624 9.67326 8.01637 9.64371 8.032 9.617L8.272 9.208C8.30467 9.15373 8.35729 9.1144 8.41858 9.09843C8.47988 9.08245 8.54499 9.09109 8.6 9.1225L9.2665 9.5005C9.61315 9.11663 10.0743 8.85468 10.5815 8.7535V8.235C10.5815 8.105 10.689 8 10.822 8H11.302C11.4345 8 11.542 8.105 11.542 8.236V8.754C12.0492 8.85518 12.5104 9.11713 12.857 9.501L13.524 9.123C13.579 9.09159 13.6441 9.08295 13.7054 9.09893C13.7667 9.1149 13.8193 9.15423 13.852 9.2085L14.092 9.6175C14.1077 9.64423 14.1179 9.67383 14.122 9.70455C14.1261 9.73528 14.124 9.76652 14.1159 9.79643C14.1077 9.82634 14.0937 9.85431 14.0745 9.87871C14.0554 9.90311 14.0316 9.92344 14.0045 9.9385L13.335 10.3185C13.4135 10.5525 13.462 10.801 13.462 11.062C13.462 11.3225 13.4145 11.571 13.335 11.8055L14.0045 12.1855C14.0316 12.2006 14.0554 12.2209 14.0745 12.2453C14.0937 12.2697 14.1077 12.2977 14.1159 12.3276C14.124 12.3575 14.1261 12.3887 14.122 12.4194C14.1179 12.4502 14.1077 12.4798 14.092 12.5065ZM11.062 9.7495C10.7139 9.7495 10.3801 9.88778 10.1339 10.1339C9.88778 10.3801 9.7495 10.7139 9.7495 11.062C9.7495 11.4101 9.88778 11.7439 10.1339 11.9901C10.3801 12.2362 10.7139 12.3745 11.062 12.3745C11.4101 12.3745 11.7439 12.2362 11.9901 11.9901C12.2362 11.7439 12.3745 11.4101 12.3745 11.062C12.3745 10.7139 12.2362 10.3801 11.9901 10.1339C11.7439 9.88778 11.4101 9.7495 11.062 9.7495ZM11.062 11.4995C10.946 11.4995 10.8347 11.4534 10.7526 11.3714C10.6706 11.2893 10.6245 11.178 10.6245 11.062C10.6245 10.946 10.6706 10.8347 10.7526 10.7526C10.8347 10.6706 10.946 10.6245 11.062 10.6245C11.178 10.6245 11.2893 10.6706 11.3714 10.7526C11.4534 10.8347 11.4995 10.946 11.4995 11.062C11.4995 11.178 11.4534 11.2893 11.3714 11.3714C11.2893 11.4534 11.178 11.4995 11.062 11.4995Z" }, null, -1)])]);
14
+ }
15
+ var DatasourceIcon_default = /*#__PURE__*/ _plugin_vue_export_helper_default(_sfc_main, [["render", _sfc_render]]);
16
+ //#endregion
17
+ export { DatasourceIcon_default as default };
package/dist/es/index.js CHANGED
@@ -1,8 +1,10 @@
1
1
  import { CODE_DRAFT_STORAGE_KEY, CodeDeleteErrorType, ColumnLayout, DragType, KeyBindingCommand, Keys, LayerOffset, Layout, SideItemKey, canUsePluginMethods } from "./type.js";
2
2
  import { useCodeBlockEdit } from "./hooks/use-code-block-edit.js";
3
- import { advancedTabConfig, arrayOptions, booleanOptions, displayTabConfig, eqOptions, eventTabConfig, fillConfig, getCondOpOptionsByFieldType, numberOptions, styleTabConfig, validatePropsForm } from "./utils/props.js";
3
+ import { getEditorConfig, isGlobalFlat, setEditorConfig } from "./utils/config.js";
4
+ import { getCodeBlockFormConfig } from "./utils/code-block.js";
5
+ import { advancedTabConfig, arrayOptions, booleanOptions, displayTabConfig, eqOptions, eventTabConfig, fillConfig, getCondOpOptionsByFieldType, numberOptions, removeStyleDisplayConfig, styleTabConfig, validatePropsForm } from "./utils/props.js";
6
+ import { useCompareForm } from "./hooks/use-compare-form.js";
4
7
  import props_default from "./services/props.js";
5
- import { getEditorConfig, setEditorConfig } from "./utils/config.js";
6
8
  import { UndoRedo } from "./utils/undo-redo.js";
7
9
  import { createStackStep, describeRevertStep, deserializeStacks, detectStackOpType, detectTargetId, detectTargetName, getLastPushedHistoryIds, getOrCreateStack, markStackSaved, mergeSteps, serializeStacks, undoFloor } from "./utils/history.js";
8
10
  import { idbDelete, idbGet, idbSet, isIndexedDBSupported, openIndexedDB } from "./utils/indexed-db.js";
@@ -23,7 +25,6 @@ import { useFilter } from "./hooks/use-filter.js";
23
25
  import { useGetSo } from "./hooks/use-getso.js";
24
26
  import { useNextFloatBoxPosition } from "./hooks/use-next-float-box-position.js";
25
27
  import { useNodeStatus } from "./hooks/use-node-status.js";
26
- import { getCodeBlockFormConfig } from "./utils/code-block.js";
27
28
  import { debug, error, info, log, warn } from "./utils/logger.js";
28
29
  import { getCascaderOptionsFromFields, getDisplayField, getFieldType, getFormConfig, getFormValue, resolveFieldByPath } from "./utils/data-source/index.js";
29
30
  import { IdleTask } from "./utils/dep/idle-task.js";
@@ -74,6 +75,7 @@ import Index_default from "./fields/DataSourceFieldSelect/Index.js";
74
75
  import EventSelect_default from "./fields/EventSelect.js";
75
76
  import KeyValue_default from "./fields/KeyValue.js";
76
77
  import CompareForm_default from "./components/CompareForm.js";
78
+ import ViewForm_default from "./components/ViewForm.js";
77
79
  import HistoryDiffDialog_default from "./layouts/history-list/HistoryDiffDialog.js";
78
80
  import PageFragmentSelect_default from "./fields/PageFragmentSelect.js";
79
81
  import DisplayConds_default from "./fields/DisplayConds.js";
@@ -90,4 +92,4 @@ export * from "@tmagic/table";
90
92
  export * from "@tmagic/stage";
91
93
  export * from "@tmagic/design";
92
94
  export * from "@tmagic/utils";
93
- export { ALL_COND_OPS, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CodeBlockEditor_default as CodeBlockEditor, CodeBlockList_default as CodeBlockList, CodeBlockListPanel_default as CodeBlockListPanel, CodeDeleteErrorType, CodeSelect_default as CodeSelect, CodeSelectCol_default as CodeSelectCol, ColumnLayout, CompareForm_default as CompareForm, ComponentListPanel_default as ComponentListPanel, CondOpSelect_default as CondOpSelect, ContentMenu_default as ContentMenu, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, DataSourceAddButton_default as DataSourceAddButton, DataSourceConfigPanel_default as DataSourceConfigPanel, Index_default as DataSourceFieldSelect, DataSourceFields_default as DataSourceFields, DataSourceInput_default as DataSourceInput, DataSourceMethodSelect_default as DataSourceMethodSelect, DataSourceMethods_default as DataSourceMethods, DataSourceMocks_default as DataSourceMocks, DataSourceSelect_default as DataSourceSelect, DepTargetType, DisplayConds_default as DisplayConds, DragType, EVENT_NAME_VALUE_SEPARATOR, EventSelect_default as EventSelect, Fixed2Other, FloatingBox_default as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, HistoryDiffDialog_default as HistoryDiffDialog, Bucket_default as HistoryListBucket, BucketTab_default as HistoryListBucketTab, Icon_default as Icon, IdleTask, KeyBindingCommand, KeyValue_default as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeContent_default as LayerNodeContent, LayerOffset, LayerPanel_default as LayerPanel, Layout, SplitView_default as LayoutContainer, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, PROPS_PANEL_WIDTH_STORAGE_KEY, PageFragmentSelect_default as PageFragmentSelect, FormPanel_default as PropsFormPanel, PropsPanel_default as PropsPanel, RIGHT_COLUMN_WIDTH_STORAGE_KEY, Resizer_default as Resizer, ScrollViewer, SideItemKey, SplitView_default as SplitView, StageCore, Index_default$1 as StyleSetter, CodeEditor_default as TMagicCodeEditor, Editor_default as TMagicEditor, ToolButton_default as ToolButton, Tree_default as Tree, TreeNode_default as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, advancedTabConfig, arrayOptions, beforePaste, booleanOptions, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, codeBlock_default as codeBlockService, collectEventNameOptionValues, collectRelatedNodes, componentList_default as componentListService, confirmHistoryAction, createStackStep, dataSource_default as dataSourceService, debug, plugin_default as default, defaultIsExpandable, dep_default as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, editor_default as editorService, editorTypeMatchRules, eqOptions, error, eventTabConfig, events_default as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getCompActionAllowedValues, getCompActionOptions, getCondOpOptionsByFieldType, getDefaultConfig, getDisplayField, getEditorConfig, getEventNameAllowedValues, getEventNameOptions, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getLastPushedHistoryIds, getNodeIndex, getOrCreateStack, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, history_default as historyService, idbDelete, idbGet, idbSet, info, isEventNameCheckStrictly, isIncludeDataSource, isIndexedDBSupported, keybinding_default as keybindingService, monaco_editor_default as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, normalizeCompActionValue, numberOptions, openIndexedDB, props_default as propsService, resolveFieldByPath, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, stageOverlay_default as stageOverlayService, storage_default as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, ui_default as uiService, undoFloor, updateStatus, useCodeBlockEdit, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useHistoryRevert, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, validatePropsForm, warn };
95
+ export { ALL_COND_OPS, CODE_DRAFT_STORAGE_KEY, COPY_CODE_STORAGE_KEY, COPY_DS_STORAGE_KEY, COPY_STORAGE_KEY, CodeBlockEditor_default as CodeBlockEditor, CodeBlockList_default as CodeBlockList, CodeBlockListPanel_default as CodeBlockListPanel, CodeDeleteErrorType, CodeSelect_default as CodeSelect, CodeSelectCol_default as CodeSelectCol, ColumnLayout, CompareForm_default as CompareForm, ComponentListPanel_default as ComponentListPanel, CondOpSelect_default as CondOpSelect, ContentMenu_default as ContentMenu, DEFAULT_LEFT_COLUMN_WIDTH, DEFAULT_RIGHT_COLUMN_WIDTH, DataSourceAddButton_default as DataSourceAddButton, DataSourceConfigPanel_default as DataSourceConfigPanel, Index_default as DataSourceFieldSelect, DataSourceFields_default as DataSourceFields, DataSourceInput_default as DataSourceInput, DataSourceMethodSelect_default as DataSourceMethodSelect, DataSourceMethods_default as DataSourceMethods, DataSourceMocks_default as DataSourceMocks, DataSourceSelect_default as DataSourceSelect, DepTargetType, DisplayConds_default as DisplayConds, DragType, EVENT_NAME_VALUE_SEPARATOR, EventSelect_default as EventSelect, Fixed2Other, FloatingBox_default as FloatingBox, H_GUIDE_LINE_STORAGE_KEY, HistoryDiffDialog_default as HistoryDiffDialog, Bucket_default as HistoryListBucket, BucketTab_default as HistoryListBucketTab, Icon_default as Icon, IdleTask, KeyBindingCommand, KeyValue_default as KeyValue, Keys, LEFT_COLUMN_WIDTH_STORAGE_KEY, LayerNodeContent_default as LayerNodeContent, LayerOffset, LayerPanel_default as LayerPanel, Layout, SplitView_default as LayoutContainer, MIN_CENTER_COLUMN_WIDTH, MIN_LEFT_COLUMN_WIDTH, MIN_RIGHT_COLUMN_WIDTH, PROPS_PANEL_WIDTH_STORAGE_KEY, PageFragmentSelect_default as PageFragmentSelect, FormPanel_default as PropsFormPanel, PropsPanel_default as PropsPanel, RIGHT_COLUMN_WIDTH_STORAGE_KEY, Resizer_default as Resizer, ScrollViewer, SideItemKey, SplitView_default as SplitView, StageCore, Index_default$1 as StyleSetter, CodeEditor_default as TMagicCodeEditor, Editor_default as TMagicEditor, ToolButton_default as ToolButton, Tree_default as Tree, TreeNode_default as TreeNode, UI_SELECT_MODE_EVENT_NAME, UndoRedo, V_GUIDE_LINE_STORAGE_KEY, ViewForm_default as ViewForm, advancedTabConfig, arrayOptions, beforePaste, booleanOptions, buildChangeRecords, calcAlignCenterStyle, calcLayerTargetIndex, calcMoveStyle, canUsePluginMethods, change2Fixed, classifyDragSources, codeBlock_default as codeBlockService, collectEventNameOptionValues, collectRelatedNodes, componentList_default as componentListService, confirmHistoryAction, createStackStep, dataSource_default as dataSourceService, debug, plugin_default as default, defaultIsExpandable, dep_default as depService, describeRevertStep, describeStepForRevert, deserializeStacks, designPlugin, detectStackOpType, detectTargetId, detectTargetName, displayTabConfig, editorNodeMergeCustomizer, editor_default as editorService, editorTypeMatchRules, eqOptions, error, eventTabConfig, events_default as eventsService, fillConfig, fixNodeLeft, fixNodePosition, formPlugin, generatePageName, generatePageNameByApp, getAddParent, getCascaderOptionsFromFields, getCodeBlockFormConfig, getCompActionAllowedValues, getCompActionOptions, getCondOpOptionsByFieldType, getDefaultConfig, getDisplayField, getEditorConfig, getEventNameAllowedValues, getEventNameOptions, getFieldType, getFormConfig, getFormValue, getGuideLineFromCache, getInitPositionStyle, getLastPushedHistoryIds, getNodeIndex, getOrCreateStack, getPageFragmentList, getPageList, getPageNameList, getPositionInContainer, getRelativeStyle, history_default as historyService, idbDelete, idbGet, idbSet, info, isEventNameCheckStrictly, isGlobalFlat, isIncludeDataSource, isIndexedDBSupported, keybinding_default as keybindingService, monaco_editor_default as loadMonaco, log, markStackSaved, mergeSteps, moveItemsInContainer, normalizeCompActionValue, numberOptions, openIndexedDB, props_default as propsService, removeStyleDisplayConfig, resolveFieldByPath, resolveSelectedNode, serializeConfig, serializeStacks, setChildrenLayout, setEditorConfig, setLayout, stageOverlay_default as stageOverlayService, storage_default as storageService, styleTabConfig, tablePlugin, toggleFixedPosition, ui_default as uiService, undoFloor, updateStatus, useCodeBlockEdit, useCompareForm, useEditorContentHeight, useFilter, useFloatBox, useGetSo, useHistoryRevert, useNextFloatBoxPosition, useNodeStatus, useServices, useStage, useWindowRect, validatePropsForm, warn };
@@ -6,13 +6,8 @@ import SplitView_default from "../components/SplitView.js";
6
6
  import PageBar_default from "./page-bar/PageBar.js";
7
7
  import AddPageBox_default from "./AddPageBox.js";
8
8
  import CodeEditor_default from "./CodeEditor.js";
9
- import { computed, createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, inject, onBeforeUnmount, onMounted, openBlock, renderSlot, unref, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
9
+ import { computed, createCommentVNode, createElementBlock, createSlots, createVNode, defineComponent, inject, normalizeClass, onBeforeUnmount, onMounted, openBlock, renderSlot, unref, useTemplateRef, vShow, watch, withCtx, withDirectives } from "vue";
10
10
  //#region packages/editor/src/layouts/Framework.vue?vue&type=script&setup=true&lang.ts
11
- var _hoisted_1 = {
12
- class: "m-editor",
13
- ref: "content",
14
- style: { "min-width": "900px" }
15
- };
16
11
  var Framework_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineComponent({
17
12
  name: "MEditorFramework",
18
13
  __name: "Framework",
@@ -20,7 +15,8 @@ var Framework_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
20
15
  disabledPageFragment: { type: Boolean },
21
16
  pageBarSortOptions: {},
22
17
  pageFilterFunction: { type: Function },
23
- hideSidebar: { type: Boolean }
18
+ hideSidebar: { type: Boolean },
19
+ theme: {}
24
20
  },
25
21
  setup(__props) {
26
22
  const props = __props;
@@ -42,7 +38,7 @@ var Framework_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
42
38
  watch(() => uiService.get("hideSlideBar"), (hideSlideBar) => {
43
39
  uiService.set("columnWidth", {
44
40
  ...columnWidth.value,
45
- left: hideSlideBar ? 0 : storageService.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) || 310
41
+ left: hideSlideBar ? 0 : storageService.getItem("$MagicEditorLeftColumnWidthData", { protocol: Protocol.NUMBER }) || 345
46
42
  });
47
43
  });
48
44
  const columnWidthChange = (columnW) => {
@@ -75,7 +71,15 @@ var Framework_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
75
71
  }
76
72
  };
77
73
  return (_ctx, _cache) => {
78
- return openBlock(), createElementBlock("div", _hoisted_1, [
74
+ return openBlock(), createElementBlock("div", {
75
+ ref: "content",
76
+ class: normalizeClass([
77
+ "m-editor",
78
+ __props.theme ? `m-editor--${__props.theme}` : "",
79
+ __props.theme ? `m-theme--${__props.theme}` : ""
80
+ ]),
81
+ style: { "min-width": "900px" }
82
+ }, [
79
83
  renderSlot(_ctx.$slots, "header"),
80
84
  renderSlot(_ctx.$slots, "nav"),
81
85
  renderSlot(_ctx.$slots, "content-before"),
@@ -134,7 +138,7 @@ var Framework_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ define
134
138
  ]), [[vShow, !showSrc.value]]),
135
139
  renderSlot(_ctx.$slots, "content-after"),
136
140
  renderSlot(_ctx.$slots, "footer")
137
- ], 512);
141
+ ], 2);
138
142
  };
139
143
  }
140
144
  });
@@ -42,18 +42,27 @@ var PropsPanel_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defin
42
42
  tabPosition: "right",
43
43
  items: styleTabConfig.items
44
44
  }];
45
+ let initSeq = 0;
46
+ let mounted = true;
45
47
  const init = async () => {
48
+ initSeq += 1;
49
+ const seq = initSeq;
46
50
  if (!node.value) {
51
+ if (seq !== initSeq || !mounted) return;
47
52
  curFormConfig.value = [];
48
53
  return;
49
54
  }
50
55
  const type = node.value.type || (node.value.items ? "container" : "text");
51
- curFormConfig.value = await propsService.getPropsConfig(type, { node: node.value });
56
+ const config = await propsService.getPropsConfig(type, { node: node.value });
57
+ if (seq !== initSeq || !mounted) return;
58
+ if (!node.value) return;
59
+ curFormConfig.value = config;
52
60
  values.value = node.value;
53
61
  };
54
62
  watchEffect(init);
55
63
  propsService.on("props-configs-change", init);
56
64
  onBeforeUnmount(() => {
65
+ mounted = false;
57
66
  propsService.off("props-configs-change", init);
58
67
  });
59
68
  const submit = async (v, eventData, error, source = "props") => {
@@ -9,7 +9,7 @@ import DataSourceListPanel_default from "./data-source/DataSourceListPanel.js";
9
9
  import LayerPanel_default from "./layer/LayerPanel.js";
10
10
  import ComponentListPanel_default from "./ComponentListPanel.js";
11
11
  import { Fragment, Teleport, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createVNode, defineComponent, mergeProps, nextTick, normalizeClass, normalizeStyle, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, toHandlers, unref, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
12
- import { Close, Coin, EditPen, Goods, List } from "@element-plus/icons-vue";
12
+ import { Box, Close, Coin, EditPen, Finished } from "@element-plus/icons-vue";
13
13
  //#region packages/editor/src/layouts/sidebar/Sidebar.vue?vue&type=script&setup=true&lang.ts
14
14
  var _hoisted_1 = {
15
15
  key: 0,
@@ -82,7 +82,7 @@ var Sidebar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
82
82
  [SideItemKey.COMPONENT_LIST]: {
83
83
  $key: SideItemKey.COMPONENT_LIST,
84
84
  type: "component",
85
- icon: Goods,
85
+ icon: Box,
86
86
  text: "组件",
87
87
  component: ComponentListPanel_default,
88
88
  slots: {}
@@ -90,7 +90,7 @@ var Sidebar_vue_vue_type_script_setup_true_lang_default = /*@__PURE__*/ defineCo
90
90
  layer: {
91
91
  $key: SideItemKey.LAYER,
92
92
  type: "component",
93
- icon: List,
93
+ icon: Finished,
94
94
  text: "已选组件",
95
95
  props: {
96
96
  layerContentMenu: props.layerContentMenu,
package/dist/es/plugin.js CHANGED
@@ -28,7 +28,8 @@ import designPlugin from "@tmagic/design";
28
28
  var defaultInstallOpt = {
29
29
  parseDSL: (dsl) => eval(dsl),
30
30
  customCreateMonacoEditor: (monaco, codeEditorEl, options) => monaco.editor.create(codeEditorEl, options),
31
- customCreateMonacoDiffEditor: (monaco, codeEditorEl, options) => monaco.editor.createDiffEditor(codeEditorEl, options)
31
+ customCreateMonacoDiffEditor: (monaco, codeEditorEl, options) => monaco.editor.createDiffEditor(codeEditorEl, options),
32
+ flat: false
32
33
  };
33
34
  var plugin_default = { install: (app, opt) => {
34
35
  const option = Object.assign(defaultInstallOpt, opt || {});
@@ -1,6 +1,6 @@
1
1
  import { CODE_DRAFT_STORAGE_KEY } from "../type.js";
2
- import BaseService from "./BaseService.js";
3
2
  import { getEditorConfig } from "../utils/config.js";
3
+ import BaseService from "./BaseService.js";
4
4
  import { createStackStep, describeRevertStep, getLastPushedHistoryIds } from "../utils/history.js";
5
5
  import history_default from "./history.js";
6
6
  import storage_default, { Protocol } from "./storage.js";