@tmagic/editor 1.5.24 → 1.6.0-beta.0
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 +1 -1
- package/dist/tmagic-editor.js +2 -2
- package/dist/tmagic-editor.umd.cjs +2 -2
- package/package.json +7 -7
- package/src/editorProps.ts +2 -3
- package/src/hooks/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/initService.ts +2 -3
- package/src/services/BaseService.ts +1 -1
- package/src/services/codeBlock.ts +1 -1
- package/src/services/componentList.ts +1 -1
- package/src/services/dep.ts +1 -1
- package/src/services/editor.ts +1 -1
- package/src/services/events.ts +1 -1
- package/src/services/history.ts +1 -1
- package/src/services/props.ts +1 -1
- package/src/services/ui.ts +1 -1
- package/src/type.ts +3 -4
- package/src/utils/config.ts +1 -1
- package/src/utils/editor.ts +1 -1
- package/src/utils/index.ts +1 -1
- package/src/utils/logger.ts +1 -1
- package/src/utils/props.ts +1 -1
- package/src/utils/undo-redo.ts +1 -1
- package/types/index.d.ts +3 -3
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)
|
|
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
|
|
package/dist/tmagic-editor.js
CHANGED
|
@@ -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: [
|
|
16374
|
+
moveableOptions: { type: [Function, Object] },
|
|
16375
16375
|
defaultSelected: {},
|
|
16376
16376
|
containerHighlightClassName: {},
|
|
16377
16377
|
containerHighlightDuration: {},
|
|
@@ -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: [
|
|
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.
|
|
2
|
+
"version": "1.6.0-beta.0",
|
|
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/
|
|
62
|
-
"@tmagic/
|
|
63
|
-
"@tmagic/
|
|
64
|
-
"@tmagic/
|
|
65
|
-
"@tmagic/
|
|
61
|
+
"@tmagic/design": "1.6.0-beta.0",
|
|
62
|
+
"@tmagic/form": "1.6.0-beta.0",
|
|
63
|
+
"@tmagic/stage": "1.6.0-beta.0",
|
|
64
|
+
"@tmagic/table": "1.6.0-beta.0",
|
|
65
|
+
"@tmagic/utils": "1.6.0-beta.0"
|
|
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.
|
|
79
|
+
"@tmagic/core": "1.6.0-beta.0"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"typescript": {
|
package/src/editorProps.ts
CHANGED
|
@@ -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
|
|
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?:
|
|
58
|
+
moveableOptions?: CustomizeMoveableOptions;
|
|
60
59
|
/** 编辑器初始化时默认选中的组件ID */
|
|
61
60
|
defaultSelected?: Id;
|
|
62
61
|
/** 拖入画布中容器时,识别到容器后给容器根dom加上的class */
|
package/src/hooks/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)
|
|
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)
|
|
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/initService.ts
CHANGED
|
@@ -388,10 +388,9 @@ export const initServiceEvents = (
|
|
|
388
388
|
if (value) {
|
|
389
389
|
depService.clearIdleTasks();
|
|
390
390
|
|
|
391
|
-
|
|
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)
|
|
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)
|
|
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)
|
|
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/services/dep.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)
|
|
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/services/editor.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)
|
|
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/services/events.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)
|
|
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/services/history.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)
|
|
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/services/props.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)
|
|
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/services/ui.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)
|
|
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)
|
|
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
|
-
|
|
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?:
|
|
159
|
+
moveableOptions?: CustomizeMoveableOptions;
|
|
161
160
|
canSelect?: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
162
161
|
isContainer?: (el: HTMLElement) => boolean | Promise<boolean>;
|
|
163
162
|
updateDragEl?: UpdateDragEl;
|
package/src/utils/config.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)
|
|
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/utils/editor.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)
|
|
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/utils/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)
|
|
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/utils/logger.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)
|
|
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/utils/props.ts
CHANGED
|
@@ -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)
|
|
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.
|
package/src/utils/undo-redo.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)
|
|
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,
|
|
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?:
|
|
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?:
|
|
1754
|
+
moveableOptions?: CustomizeMoveableOptions;
|
|
1755
1755
|
/** 编辑器初始化时默认选中的组件ID */
|
|
1756
1756
|
defaultSelected?: Id;
|
|
1757
1757
|
/** 拖入画布中容器时,识别到容器后给容器根dom加上的class */
|