@tmagic/editor 1.5.24 → 1.6.0-beta.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.
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  Tencent is pleased to support the open source community by making TMagicEditor available.
2
2
 
3
- Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
3
+ Copyright (C) 2025 Tencent. All rights reserved.
4
4
 
5
5
  TMagicEditor is licensed under the Apache License Version 2.0 except for the third-party components listed below.
6
6
 
@@ -15766,7 +15766,7 @@ const defaultEditorProps = {
15766
15766
  eventMethodList: () => ({}),
15767
15767
  datasourceValues: () => ({}),
15768
15768
  datasourceConfigs: () => ({}),
15769
- canSelect: (el) => Boolean(getIdFromEl()(el)),
15769
+ canSelect: (el) => Boolean(getIdFromEl()(el) && !el.dataset.tmagicPageFragmentContainerId),
15770
15770
  isContainer: (el) => el.classList.contains("magic-ui-container"),
15771
15771
  codeOptions: () => ({}),
15772
15772
  customContentMenu: (menus) => menus
@@ -16062,8 +16062,8 @@ const initServiceEvents = (props, emit, { editorService, codeBlockService, dataS
16062
16062
  });
16063
16063
  if (value) {
16064
16064
  depService.clearIdleTasks();
16065
+ await (typeof Worker === "undefined" ? collectIdle(value.items, true) : depService.collectByWorker(value));
16065
16066
  const dsl = cloneDeep(toRaw(value));
16066
- await (typeof Worker === "undefined" ? collectIdle(dsl.items, true) : depService.collectByWorker(dsl));
16067
16067
  if (dsl.dataSources && dsl.dataSourceDeps && app?.dataSourceManager) {
16068
16068
  for (const node2 of getNodes(getDepNodeIds(dsl.dataSourceDeps), dsl.items)) {
16069
16069
  updateNode(app.dataSourceManager.compiledNode(node2), dsl);
@@ -16371,7 +16371,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
16371
16371
  datasourceValues: {},
16372
16372
  datasourceConfigs: {},
16373
16373
  datasourceEventMethodList: {},
16374
- moveableOptions: { type: [Object, Function] },
16374
+ moveableOptions: { type: [Function, Object] },
16375
16375
  defaultSelected: {},
16376
16376
  containerHighlightClassName: {},
16377
16377
  containerHighlightDuration: {},
@@ -20559,7 +20559,7 @@
20559
20559
  eventMethodList: () => ({}),
20560
20560
  datasourceValues: () => ({}),
20561
20561
  datasourceConfigs: () => ({}),
20562
- canSelect: (el) => Boolean(utils.getIdFromEl()(el)),
20562
+ canSelect: (el) => Boolean(utils.getIdFromEl()(el) && !el.dataset.tmagicPageFragmentContainerId),
20563
20563
  isContainer: (el) => el.classList.contains("magic-ui-container"),
20564
20564
  codeOptions: () => ({}),
20565
20565
  customContentMenu: (menus) => menus
@@ -20855,8 +20855,8 @@
20855
20855
  });
20856
20856
  if (value) {
20857
20857
  depService.clearIdleTasks();
20858
+ await (typeof Worker === "undefined" ? collectIdle(value.items, true) : depService.collectByWorker(value));
20858
20859
  const dsl = cloneDeep(vue.toRaw(value));
20859
- await (typeof Worker === "undefined" ? collectIdle(dsl.items, true) : depService.collectByWorker(dsl));
20860
20860
  if (dsl.dataSources && dsl.dataSourceDeps && app?.dataSourceManager) {
20861
20861
  for (const node2 of utils.getNodes(utils.getDepNodeIds(dsl.dataSourceDeps), dsl.items)) {
20862
20862
  core.updateNode(app.dataSourceManager.compiledNode(node2), dsl);
@@ -21164,7 +21164,7 @@
21164
21164
  datasourceValues: {},
21165
21165
  datasourceConfigs: {},
21166
21166
  datasourceEventMethodList: {},
21167
- moveableOptions: { type: [Object, Function] },
21167
+ moveableOptions: { type: [Function, Object] },
21168
21168
  defaultSelected: {},
21169
21169
  containerHighlightClassName: {},
21170
21170
  containerHighlightDuration: {},
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.24",
2
+ "version": "1.6.0-beta.1",
3
3
  "name": "@tmagic/editor",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -58,11 +58,11 @@
58
58
  "moveable": "^0.53.0",
59
59
  "serialize-javascript": "^6.0.2",
60
60
  "sortablejs": "^1.15.6",
61
- "@tmagic/form": "1.5.24",
62
- "@tmagic/stage": "1.5.24",
63
- "@tmagic/utils": "1.5.24",
64
- "@tmagic/design": "1.5.24",
65
- "@tmagic/table": "1.5.24"
61
+ "@tmagic/design": "1.6.0-beta.1",
62
+ "@tmagic/form": "1.6.0-beta.1",
63
+ "@tmagic/table": "1.6.0-beta.1",
64
+ "@tmagic/utils": "1.6.0-beta.1",
65
+ "@tmagic/stage": "1.6.0-beta.1"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/events": "^3.0.3",
@@ -76,7 +76,7 @@
76
76
  "monaco-editor": "^0.48.0",
77
77
  "typescript": "^5.8.3",
78
78
  "vue": "^3.5.17",
79
- "@tmagic/core": "1.5.24"
79
+ "@tmagic/core": "1.6.0-beta.1"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "typescript": {
@@ -3,9 +3,8 @@ import type { FormConfig, FormState } from '@tmagic/form';
3
3
  import StageCore, {
4
4
  CONTAINER_HIGHLIGHT_CLASS_NAME,
5
5
  ContainerHighlightType,
6
- type CustomizeMoveableOptionsCallbackConfig,
6
+ type CustomizeMoveableOptions,
7
7
  type GuidesOptions,
8
- type MoveableOptions,
9
8
  RenderType,
10
9
  type UpdateDragEl,
11
10
  } from '@tmagic/stage';
@@ -56,7 +55,7 @@ export interface EditorProps {
56
55
  datasourceConfigs?: Record<string, FormConfig>;
57
56
  datasourceEventMethodList?: Record<string, { events: EventOption[]; methods: EventOption[] }>;
58
57
  /** 画布中组件选中框的移动范围 */
59
- moveableOptions?: MoveableOptions | ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions);
58
+ moveableOptions?: CustomizeMoveableOptions;
60
59
  /** 编辑器初始化时默认选中的组件ID */
61
60
  defaultSelected?: Id;
62
61
  /** 拖入画布中容器时,识别到容器后给容器根dom加上的class */
@@ -127,7 +126,7 @@ export const defaultEditorProps = {
127
126
  eventMethodList: () => ({}),
128
127
  datasourceValues: () => ({}),
129
128
  datasourceConfigs: () => ({}),
130
- canSelect: (el: HTMLElement) => Boolean(getIdFromEl()(el)),
129
+ canSelect: (el: HTMLElement) => Boolean(getIdFromEl()(el) && !el.dataset.tmagicPageFragmentContainerId),
131
130
  isContainer: (el: HTMLElement) => el.classList.contains('magic-ui-container'),
132
131
  codeOptions: () => ({}),
133
132
  customContentMenu: (menus: (MenuButton | MenuComponent)[]) => menus,
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
package/src/index.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -388,10 +388,9 @@ export const initServiceEvents = (
388
388
  if (value) {
389
389
  depService.clearIdleTasks();
390
390
 
391
- const dsl = cloneDeep(toRaw(value));
392
-
393
- await (typeof Worker === 'undefined' ? collectIdle(dsl.items, true) : depService.collectByWorker(dsl));
391
+ await (typeof Worker === 'undefined' ? collectIdle(value.items, true) : depService.collectByWorker(value));
394
392
 
393
+ const dsl = cloneDeep(toRaw(value));
395
394
  if (dsl.dataSources && dsl.dataSourceDeps && app?.dataSourceManager) {
396
395
  for (const node of getNodes(getDepNodeIds(dsl.dataSourceDeps), dsl.items)) {
397
396
  updateNode(app.dataSourceManager.compiledNode(node), dsl);
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  * Tencent is pleased to support the open source community by making TMagicEditor available.
4
4
  *
5
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
+ * Copyright (C) 2025 Tencent. All rights reserved.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
package/src/type.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -26,9 +26,8 @@ import type { FormConfig, TableColumnConfig } from '@tmagic/form';
26
26
  import type StageCore from '@tmagic/stage';
27
27
  import type {
28
28
  ContainerHighlightType,
29
- CustomizeMoveableOptionsCallbackConfig,
29
+ CustomizeMoveableOptions,
30
30
  GuidesOptions,
31
- MoveableOptions,
32
31
  RenderType,
33
32
  UpdateDragEl,
34
33
  } from '@tmagic/stage';
@@ -157,7 +156,7 @@ export interface StageOptions {
157
156
  containerHighlightType?: ContainerHighlightType;
158
157
  disabledDragStart?: boolean;
159
158
  render?: (stage: StageCore) => HTMLDivElement | void | Promise<HTMLDivElement | void>;
160
- moveableOptions?: MoveableOptions | ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions);
159
+ moveableOptions?: CustomizeMoveableOptions;
161
160
  canSelect?: (el: HTMLElement) => boolean | Promise<boolean>;
162
161
  isContainer?: (el: HTMLElement) => boolean | Promise<boolean>;
163
162
  updateDragEl?: UpdateDragEl;
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
@@ -2,7 +2,7 @@
2
2
  /*
3
3
  * Tencent is pleased to support the open source community by making TMagicEditor available.
4
4
  *
5
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
5
+ * Copyright (C) 2025 Tencent. All rights reserved.
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -1,7 +1,7 @@
1
1
  /*
2
2
  * Tencent is pleased to support the open source community by making TMagicEditor available.
3
3
  *
4
- * Copyright (C) 2023 THL A29 Limited, a Tencent company. All rights reserved.
4
+ * Copyright (C) 2025 Tencent. All rights reserved.
5
5
  *
6
6
  * Licensed under the Apache License, Version 2.0 (the "License");
7
7
  * you may not use this file except in compliance with the License.
package/types/index.d.ts CHANGED
@@ -12,7 +12,7 @@ import * as _tmagic_core from '@tmagic/core';
12
12
  import { CodeBlockDSL, Id, CodeBlockContent, MNode, TargetOptions, DataSourceSchema, EventOption, Target, DepExtendedData, DepTargetType, MApp, DepData, MContainer, MPage, MPageFragment, NodeType, DataSchema, DataSourceFieldType, DisplayCond } from '@tmagic/core';
13
13
  export { DepTargetType } from '@tmagic/core';
14
14
  import * as StageCore from '@tmagic/stage';
15
- import StageCore__default, { ContainerHighlightType, MoveableOptions, CustomizeMoveableOptionsCallbackConfig, UpdateDragEl, RenderType, GuidesOptions } from '@tmagic/stage';
15
+ import StageCore__default, { ContainerHighlightType, CustomizeMoveableOptions, UpdateDragEl, RenderType, GuidesOptions } from '@tmagic/stage';
16
16
  export * from '@tmagic/stage';
17
17
  export { default as StageCore } from '@tmagic/stage';
18
18
  import * as monaco from 'monaco-editor';
@@ -925,7 +925,7 @@ interface StageOptions {
925
925
  containerHighlightType?: ContainerHighlightType;
926
926
  disabledDragStart?: boolean;
927
927
  render?: (stage: StageCore__default) => HTMLDivElement | void | Promise<HTMLDivElement | void>;
928
- moveableOptions?: MoveableOptions | ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions);
928
+ moveableOptions?: CustomizeMoveableOptions;
929
929
  canSelect?: (el: HTMLElement) => boolean | Promise<boolean>;
930
930
  isContainer?: (el: HTMLElement) => boolean | Promise<boolean>;
931
931
  updateDragEl?: UpdateDragEl;
@@ -1751,7 +1751,7 @@ interface EditorProps {
1751
1751
  methods: EventOption[];
1752
1752
  }>;
1753
1753
  /** 画布中组件选中框的移动范围 */
1754
- moveableOptions?: MoveableOptions | ((config?: CustomizeMoveableOptionsCallbackConfig) => MoveableOptions);
1754
+ moveableOptions?: CustomizeMoveableOptions;
1755
1755
  /** 编辑器初始化时默认选中的组件ID */
1756
1756
  defaultSelected?: Id;
1757
1757
  /** 拖入画布中容器时,识别到容器后给容器根dom加上的class */