@tmagic/editor 1.5.18-beta.1 → 1.5.18
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/dist/tmagic-editor.js +35 -16
- package/dist/tmagic-editor.umd.cjs +35 -16
- package/package.json +7 -7
- package/src/services/events.ts +19 -1
- package/src/utils/props.ts +9 -0
- package/types/index.d.ts +16 -9
package/dist/tmagic-editor.js
CHANGED
|
@@ -646,12 +646,21 @@ const advancedTabConfig = {
|
|
|
646
646
|
name: "created",
|
|
647
647
|
text: "created",
|
|
648
648
|
labelPosition: "top",
|
|
649
|
-
type: "code-select"
|
|
649
|
+
type: "code-select",
|
|
650
|
+
extra: "组件初始化时执行"
|
|
650
651
|
},
|
|
651
652
|
{
|
|
652
653
|
name: "mounted",
|
|
653
654
|
text: "mounted",
|
|
654
655
|
labelPosition: "top",
|
|
656
|
+
type: "code-select",
|
|
657
|
+
extra: "组件挂载到dom时执行"
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
name: "display",
|
|
661
|
+
text: "display",
|
|
662
|
+
extra: "控制组件是否渲染,关系的代码块返回值为false时不渲染",
|
|
663
|
+
labelPosition: "top",
|
|
655
664
|
type: "code-select"
|
|
656
665
|
}
|
|
657
666
|
]
|
|
@@ -1200,7 +1209,7 @@ class BaseService extends EventEmitter {
|
|
|
1200
1209
|
}
|
|
1201
1210
|
}
|
|
1202
1211
|
|
|
1203
|
-
const canUsePluginMethods$
|
|
1212
|
+
const canUsePluginMethods$7 = {
|
|
1204
1213
|
async: [
|
|
1205
1214
|
"setPropsConfig",
|
|
1206
1215
|
"getPropsConfig",
|
|
@@ -1219,8 +1228,8 @@ class Props extends BaseService {
|
|
|
1219
1228
|
});
|
|
1220
1229
|
constructor() {
|
|
1221
1230
|
super([
|
|
1222
|
-
...canUsePluginMethods$
|
|
1223
|
-
...canUsePluginMethods$
|
|
1231
|
+
...canUsePluginMethods$7.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
1232
|
+
...canUsePluginMethods$7.sync.map((methodName) => ({ name: methodName, isAsync: false }))
|
|
1224
1233
|
]);
|
|
1225
1234
|
}
|
|
1226
1235
|
setPropsConfigs(configs) {
|
|
@@ -1540,14 +1549,14 @@ var Protocol = /* @__PURE__ */ ((Protocol2) => {
|
|
|
1540
1549
|
Protocol2["BOOLEAN"] = "boolean";
|
|
1541
1550
|
return Protocol2;
|
|
1542
1551
|
})(Protocol || {});
|
|
1543
|
-
const canUsePluginMethods$
|
|
1552
|
+
const canUsePluginMethods$6 = {
|
|
1544
1553
|
sync: ["getStorage", "getNamespace", "clear", "getItem", "removeItem", "setItem"]
|
|
1545
1554
|
};
|
|
1546
1555
|
class WebStorage extends BaseService {
|
|
1547
1556
|
storage = globalThis.localStorage;
|
|
1548
1557
|
namespace = "tmagic";
|
|
1549
1558
|
constructor() {
|
|
1550
|
-
super(canUsePluginMethods$
|
|
1559
|
+
super(canUsePluginMethods$6.sync.map((methodName) => ({ name: methodName, isAsync: false })));
|
|
1551
1560
|
}
|
|
1552
1561
|
/**
|
|
1553
1562
|
* 获取数据存储对象,可以通过
|
|
@@ -1653,7 +1662,7 @@ class WebStorage extends BaseService {
|
|
|
1653
1662
|
}
|
|
1654
1663
|
const storageService = new WebStorage();
|
|
1655
1664
|
|
|
1656
|
-
const canUsePluginMethods$
|
|
1665
|
+
const canUsePluginMethods$5 = {
|
|
1657
1666
|
async: [
|
|
1658
1667
|
"getLayout",
|
|
1659
1668
|
"highlight",
|
|
@@ -1696,7 +1705,7 @@ class Editor extends BaseService {
|
|
|
1696
1705
|
isHistoryStateChange = false;
|
|
1697
1706
|
constructor() {
|
|
1698
1707
|
super(
|
|
1699
|
-
canUsePluginMethods$
|
|
1708
|
+
canUsePluginMethods$5.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
1700
1709
|
// 需要注意循环依赖问题,如果函数间有相互调用的话,不能设置为串行调用
|
|
1701
1710
|
["select", "update", "moveLayer"]
|
|
1702
1711
|
);
|
|
@@ -3676,11 +3685,11 @@ const state = shallowReactive({
|
|
|
3676
3685
|
top: 0
|
|
3677
3686
|
}
|
|
3678
3687
|
});
|
|
3679
|
-
const canUsePluginMethods$
|
|
3688
|
+
const canUsePluginMethods$4 = {
|
|
3680
3689
|
async: ["zoom", "calcZoom"]};
|
|
3681
3690
|
class Ui extends BaseService {
|
|
3682
3691
|
constructor() {
|
|
3683
|
-
super(canUsePluginMethods$
|
|
3692
|
+
super(canUsePluginMethods$4.async.map((methodName) => ({ name: methodName, isAsync: true })));
|
|
3684
3693
|
}
|
|
3685
3694
|
set(name, value) {
|
|
3686
3695
|
const mask = editorService.get("stage")?.mask;
|
|
@@ -13520,7 +13529,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
13520
13529
|
}
|
|
13521
13530
|
});
|
|
13522
13531
|
|
|
13523
|
-
const canUsePluginMethods$
|
|
13532
|
+
const canUsePluginMethods$3 = {
|
|
13524
13533
|
async: ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"],
|
|
13525
13534
|
sync: ["setCodeDslByIdSync"]
|
|
13526
13535
|
};
|
|
@@ -13534,8 +13543,8 @@ class CodeBlock extends BaseService {
|
|
|
13534
13543
|
});
|
|
13535
13544
|
constructor() {
|
|
13536
13545
|
super([
|
|
13537
|
-
...canUsePluginMethods$
|
|
13538
|
-
...canUsePluginMethods$
|
|
13546
|
+
...canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
13547
|
+
...canUsePluginMethods$3.sync.map((methodName) => ({ name: methodName, isAsync: false }))
|
|
13539
13548
|
]);
|
|
13540
13549
|
}
|
|
13541
13550
|
/**
|
|
@@ -13793,7 +13802,7 @@ class ComponentList extends BaseService {
|
|
|
13793
13802
|
}
|
|
13794
13803
|
const componentListService = new ComponentList();
|
|
13795
13804
|
|
|
13796
|
-
const canUsePluginMethods$
|
|
13805
|
+
const canUsePluginMethods$2 = {
|
|
13797
13806
|
sync: [
|
|
13798
13807
|
"getFormConfig",
|
|
13799
13808
|
"setFormConfig",
|
|
@@ -13820,7 +13829,7 @@ class DataSource extends BaseService {
|
|
|
13820
13829
|
methods: {}
|
|
13821
13830
|
});
|
|
13822
13831
|
constructor() {
|
|
13823
|
-
super(canUsePluginMethods$
|
|
13832
|
+
super(canUsePluginMethods$2.sync.map((methodName) => ({ name: methodName, isAsync: false })));
|
|
13824
13833
|
}
|
|
13825
13834
|
set(name, value) {
|
|
13826
13835
|
this.state[name] = value;
|
|
@@ -14163,11 +14172,18 @@ class Dep extends BaseService {
|
|
|
14163
14172
|
}
|
|
14164
14173
|
const depService = new Dep();
|
|
14165
14174
|
|
|
14175
|
+
const canUsePluginMethods$1 = {
|
|
14176
|
+
async: [],
|
|
14177
|
+
sync: ["setEvent", "getEvent", "setMethod", "getMethod"]
|
|
14178
|
+
};
|
|
14166
14179
|
let eventMap = reactive({});
|
|
14167
14180
|
let methodMap = reactive({});
|
|
14168
14181
|
class Events extends BaseService {
|
|
14169
14182
|
constructor() {
|
|
14170
|
-
super([
|
|
14183
|
+
super([
|
|
14184
|
+
...canUsePluginMethods$1.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
14185
|
+
...canUsePluginMethods$1.sync.map((methodName) => ({ name: methodName, isAsync: false }))
|
|
14186
|
+
]);
|
|
14171
14187
|
}
|
|
14172
14188
|
setEvents(events) {
|
|
14173
14189
|
Object.keys(events).forEach((type) => {
|
|
@@ -14200,6 +14216,9 @@ class Events extends BaseService {
|
|
|
14200
14216
|
this.removeAllListeners();
|
|
14201
14217
|
this.removeAllPlugins();
|
|
14202
14218
|
}
|
|
14219
|
+
usePlugin(options) {
|
|
14220
|
+
super.usePlugin(options);
|
|
14221
|
+
}
|
|
14203
14222
|
}
|
|
14204
14223
|
const eventsService = new Events();
|
|
14205
14224
|
|
|
@@ -5439,12 +5439,21 @@
|
|
|
5439
5439
|
name: "created",
|
|
5440
5440
|
text: "created",
|
|
5441
5441
|
labelPosition: "top",
|
|
5442
|
-
type: "code-select"
|
|
5442
|
+
type: "code-select",
|
|
5443
|
+
extra: "组件初始化时执行"
|
|
5443
5444
|
},
|
|
5444
5445
|
{
|
|
5445
5446
|
name: "mounted",
|
|
5446
5447
|
text: "mounted",
|
|
5447
5448
|
labelPosition: "top",
|
|
5449
|
+
type: "code-select",
|
|
5450
|
+
extra: "组件挂载到dom时执行"
|
|
5451
|
+
},
|
|
5452
|
+
{
|
|
5453
|
+
name: "display",
|
|
5454
|
+
text: "display",
|
|
5455
|
+
extra: "控制组件是否渲染,关系的代码块返回值为false时不渲染",
|
|
5456
|
+
labelPosition: "top",
|
|
5448
5457
|
type: "code-select"
|
|
5449
5458
|
}
|
|
5450
5459
|
]
|
|
@@ -5993,7 +6002,7 @@
|
|
|
5993
6002
|
}
|
|
5994
6003
|
}
|
|
5995
6004
|
|
|
5996
|
-
const canUsePluginMethods$
|
|
6005
|
+
const canUsePluginMethods$7 = {
|
|
5997
6006
|
async: [
|
|
5998
6007
|
"setPropsConfig",
|
|
5999
6008
|
"getPropsConfig",
|
|
@@ -6012,8 +6021,8 @@
|
|
|
6012
6021
|
});
|
|
6013
6022
|
constructor() {
|
|
6014
6023
|
super([
|
|
6015
|
-
...canUsePluginMethods$
|
|
6016
|
-
...canUsePluginMethods$
|
|
6024
|
+
...canUsePluginMethods$7.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
6025
|
+
...canUsePluginMethods$7.sync.map((methodName) => ({ name: methodName, isAsync: false }))
|
|
6017
6026
|
]);
|
|
6018
6027
|
}
|
|
6019
6028
|
setPropsConfigs(configs) {
|
|
@@ -6333,14 +6342,14 @@
|
|
|
6333
6342
|
Protocol2["BOOLEAN"] = "boolean";
|
|
6334
6343
|
return Protocol2;
|
|
6335
6344
|
})(Protocol || {});
|
|
6336
|
-
const canUsePluginMethods$
|
|
6345
|
+
const canUsePluginMethods$6 = {
|
|
6337
6346
|
sync: ["getStorage", "getNamespace", "clear", "getItem", "removeItem", "setItem"]
|
|
6338
6347
|
};
|
|
6339
6348
|
class WebStorage extends BaseService {
|
|
6340
6349
|
storage = globalThis.localStorage;
|
|
6341
6350
|
namespace = "tmagic";
|
|
6342
6351
|
constructor() {
|
|
6343
|
-
super(canUsePluginMethods$
|
|
6352
|
+
super(canUsePluginMethods$6.sync.map((methodName) => ({ name: methodName, isAsync: false })));
|
|
6344
6353
|
}
|
|
6345
6354
|
/**
|
|
6346
6355
|
* 获取数据存储对象,可以通过
|
|
@@ -6446,7 +6455,7 @@
|
|
|
6446
6455
|
}
|
|
6447
6456
|
const storageService = new WebStorage();
|
|
6448
6457
|
|
|
6449
|
-
const canUsePluginMethods$
|
|
6458
|
+
const canUsePluginMethods$5 = {
|
|
6450
6459
|
async: [
|
|
6451
6460
|
"getLayout",
|
|
6452
6461
|
"highlight",
|
|
@@ -6489,7 +6498,7 @@
|
|
|
6489
6498
|
isHistoryStateChange = false;
|
|
6490
6499
|
constructor() {
|
|
6491
6500
|
super(
|
|
6492
|
-
canUsePluginMethods$
|
|
6501
|
+
canUsePluginMethods$5.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
6493
6502
|
// 需要注意循环依赖问题,如果函数间有相互调用的话,不能设置为串行调用
|
|
6494
6503
|
["select", "update", "moveLayer"]
|
|
6495
6504
|
);
|
|
@@ -8469,11 +8478,11 @@
|
|
|
8469
8478
|
top: 0
|
|
8470
8479
|
}
|
|
8471
8480
|
});
|
|
8472
|
-
const canUsePluginMethods$
|
|
8481
|
+
const canUsePluginMethods$4 = {
|
|
8473
8482
|
async: ["zoom", "calcZoom"]};
|
|
8474
8483
|
class Ui extends BaseService {
|
|
8475
8484
|
constructor() {
|
|
8476
|
-
super(canUsePluginMethods$
|
|
8485
|
+
super(canUsePluginMethods$4.async.map((methodName) => ({ name: methodName, isAsync: true })));
|
|
8477
8486
|
}
|
|
8478
8487
|
set(name, value) {
|
|
8479
8488
|
const mask = editorService.get("stage")?.mask;
|
|
@@ -18313,7 +18322,7 @@
|
|
|
18313
18322
|
}
|
|
18314
18323
|
});
|
|
18315
18324
|
|
|
18316
|
-
const canUsePluginMethods$
|
|
18325
|
+
const canUsePluginMethods$3 = {
|
|
18317
18326
|
async: ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"],
|
|
18318
18327
|
sync: ["setCodeDslByIdSync"]
|
|
18319
18328
|
};
|
|
@@ -18327,8 +18336,8 @@
|
|
|
18327
18336
|
});
|
|
18328
18337
|
constructor() {
|
|
18329
18338
|
super([
|
|
18330
|
-
...canUsePluginMethods$
|
|
18331
|
-
...canUsePluginMethods$
|
|
18339
|
+
...canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
18340
|
+
...canUsePluginMethods$3.sync.map((methodName) => ({ name: methodName, isAsync: false }))
|
|
18332
18341
|
]);
|
|
18333
18342
|
}
|
|
18334
18343
|
/**
|
|
@@ -18586,7 +18595,7 @@
|
|
|
18586
18595
|
}
|
|
18587
18596
|
const componentListService = new ComponentList();
|
|
18588
18597
|
|
|
18589
|
-
const canUsePluginMethods$
|
|
18598
|
+
const canUsePluginMethods$2 = {
|
|
18590
18599
|
sync: [
|
|
18591
18600
|
"getFormConfig",
|
|
18592
18601
|
"setFormConfig",
|
|
@@ -18613,7 +18622,7 @@
|
|
|
18613
18622
|
methods: {}
|
|
18614
18623
|
});
|
|
18615
18624
|
constructor() {
|
|
18616
|
-
super(canUsePluginMethods$
|
|
18625
|
+
super(canUsePluginMethods$2.sync.map((methodName) => ({ name: methodName, isAsync: false })));
|
|
18617
18626
|
}
|
|
18618
18627
|
set(name, value) {
|
|
18619
18628
|
this.state[name] = value;
|
|
@@ -18956,11 +18965,18 @@
|
|
|
18956
18965
|
}
|
|
18957
18966
|
const depService = new Dep();
|
|
18958
18967
|
|
|
18968
|
+
const canUsePluginMethods$1 = {
|
|
18969
|
+
async: [],
|
|
18970
|
+
sync: ["setEvent", "getEvent", "setMethod", "getMethod"]
|
|
18971
|
+
};
|
|
18959
18972
|
let eventMap = vue.reactive({});
|
|
18960
18973
|
let methodMap = vue.reactive({});
|
|
18961
18974
|
class Events extends BaseService {
|
|
18962
18975
|
constructor() {
|
|
18963
|
-
super([
|
|
18976
|
+
super([
|
|
18977
|
+
...canUsePluginMethods$1.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
18978
|
+
...canUsePluginMethods$1.sync.map((methodName) => ({ name: methodName, isAsync: false }))
|
|
18979
|
+
]);
|
|
18964
18980
|
}
|
|
18965
18981
|
setEvents(events) {
|
|
18966
18982
|
Object.keys(events).forEach((type) => {
|
|
@@ -18993,6 +19009,9 @@
|
|
|
18993
19009
|
this.removeAllListeners();
|
|
18994
19010
|
this.removeAllPlugins();
|
|
18995
19011
|
}
|
|
19012
|
+
usePlugin(options) {
|
|
19013
|
+
super.usePlugin(options);
|
|
19014
|
+
}
|
|
18996
19015
|
}
|
|
18997
19016
|
const eventsService = new Events();
|
|
18998
19017
|
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.5.18
|
|
2
|
+
"version": "1.5.18",
|
|
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.0",
|
|
60
60
|
"sortablejs": "^1.15.2",
|
|
61
|
-
"@tmagic/design": "1.5.
|
|
62
|
-
"@tmagic/
|
|
63
|
-
"@tmagic/
|
|
64
|
-
"@tmagic/
|
|
65
|
-
"@tmagic/
|
|
61
|
+
"@tmagic/design": "1.5.18",
|
|
62
|
+
"@tmagic/stage": "1.5.18",
|
|
63
|
+
"@tmagic/table": "1.5.18",
|
|
64
|
+
"@tmagic/utils": "1.5.18",
|
|
65
|
+
"@tmagic/form": "1.5.18"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
68
|
"@types/events": "^3.0.0",
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
"monaco-editor": "^0.48.0",
|
|
77
77
|
"typescript": "*",
|
|
78
78
|
"vue": ">=3.5.0",
|
|
79
|
-
"@tmagic/core": "1.5.
|
|
79
|
+
"@tmagic/core": "1.5.18"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
82
82
|
"typescript": {
|
package/src/services/events.ts
CHANGED
|
@@ -18,18 +18,32 @@
|
|
|
18
18
|
|
|
19
19
|
import { reactive } from 'vue';
|
|
20
20
|
import { cloneDeep } from 'lodash-es';
|
|
21
|
+
import type { Writable } from 'type-fest';
|
|
21
22
|
|
|
22
23
|
import { type EventOption } from '@tmagic/core';
|
|
23
24
|
import { toLine } from '@tmagic/utils';
|
|
24
25
|
|
|
26
|
+
import type { AsyncHookPlugin, SyncHookPlugin } from '@editor/type';
|
|
27
|
+
|
|
25
28
|
import BaseService from './BaseService';
|
|
26
29
|
|
|
30
|
+
const canUsePluginMethods = {
|
|
31
|
+
async: [] as const,
|
|
32
|
+
sync: ['setEvent', 'getEvent', 'setMethod', 'getMethod'] as const,
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
type AsyncMethodName = Writable<(typeof canUsePluginMethods)['async']>;
|
|
36
|
+
type SyncMethodName = Writable<(typeof canUsePluginMethods)['sync']>;
|
|
37
|
+
|
|
27
38
|
let eventMap: Record<string, EventOption[]> = reactive({});
|
|
28
39
|
let methodMap: Record<string, EventOption[]> = reactive({});
|
|
29
40
|
|
|
30
41
|
class Events extends BaseService {
|
|
31
42
|
constructor() {
|
|
32
|
-
super([
|
|
43
|
+
super([
|
|
44
|
+
...canUsePluginMethods.async.map((methodName) => ({ name: methodName, isAsync: true })),
|
|
45
|
+
...canUsePluginMethods.sync.map((methodName) => ({ name: methodName, isAsync: false })),
|
|
46
|
+
]);
|
|
33
47
|
}
|
|
34
48
|
|
|
35
49
|
public setEvents(events: Record<string, EventOption[]>) {
|
|
@@ -70,6 +84,10 @@ class Events extends BaseService {
|
|
|
70
84
|
this.removeAllListeners();
|
|
71
85
|
this.removeAllPlugins();
|
|
72
86
|
}
|
|
87
|
+
|
|
88
|
+
public usePlugin(options: AsyncHookPlugin<AsyncMethodName, Events> & SyncHookPlugin<SyncMethodName, Events>): void {
|
|
89
|
+
super.usePlugin(options);
|
|
90
|
+
}
|
|
73
91
|
}
|
|
74
92
|
|
|
75
93
|
export type EventsService = Events;
|
package/src/utils/props.ts
CHANGED
|
@@ -128,12 +128,21 @@ export const advancedTabConfig: TabPaneConfig = {
|
|
|
128
128
|
text: 'created',
|
|
129
129
|
labelPosition: 'top',
|
|
130
130
|
type: 'code-select',
|
|
131
|
+
extra: '组件初始化时执行',
|
|
131
132
|
},
|
|
132
133
|
{
|
|
133
134
|
name: 'mounted',
|
|
134
135
|
text: 'mounted',
|
|
135
136
|
labelPosition: 'top',
|
|
136
137
|
type: 'code-select',
|
|
138
|
+
extra: '组件挂载到dom时执行',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: 'display',
|
|
142
|
+
text: 'display',
|
|
143
|
+
extra: '控制组件是否渲染,关系的代码块返回值为false时不渲染',
|
|
144
|
+
labelPosition: 'top',
|
|
145
|
+
type: 'code-select',
|
|
137
146
|
},
|
|
138
147
|
],
|
|
139
148
|
};
|
package/types/index.d.ts
CHANGED
|
@@ -94,11 +94,11 @@ declare class export_default extends EventEmitter {
|
|
|
94
94
|
private doTask;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
declare const canUsePluginMethods$
|
|
97
|
+
declare const canUsePluginMethods$7: {
|
|
98
98
|
async: readonly ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"];
|
|
99
99
|
sync: string[];
|
|
100
100
|
};
|
|
101
|
-
type AsyncMethodName$
|
|
101
|
+
type AsyncMethodName$4 = Writable<(typeof canUsePluginMethods$7)['async']>;
|
|
102
102
|
declare class CodeBlock extends export_default {
|
|
103
103
|
private state;
|
|
104
104
|
constructor();
|
|
@@ -213,7 +213,7 @@ declare class CodeBlock extends export_default {
|
|
|
213
213
|
paste(): void;
|
|
214
214
|
resetState(): void;
|
|
215
215
|
destroy(): void;
|
|
216
|
-
usePlugin(options: AsyncHookPlugin<AsyncMethodName$
|
|
216
|
+
usePlugin(options: AsyncHookPlugin<AsyncMethodName$4, CodeBlock>): void;
|
|
217
217
|
}
|
|
218
218
|
type CodeBlockService = CodeBlock;
|
|
219
219
|
declare const _default$H: CodeBlock;
|
|
@@ -241,11 +241,11 @@ interface State$2 {
|
|
|
241
241
|
methods: Record<string, EventOption[]>;
|
|
242
242
|
}
|
|
243
243
|
type StateKey$1 = keyof State$2;
|
|
244
|
-
declare const canUsePluginMethods$
|
|
244
|
+
declare const canUsePluginMethods$6: {
|
|
245
245
|
async: never[];
|
|
246
246
|
sync: readonly ["getFormConfig", "setFormConfig", "getFormValue", "setFormValue", "getFormEvent", "setFormEvent", "getFormMethod", "setFormMethod", "add", "update", "remove", "createId"];
|
|
247
247
|
};
|
|
248
|
-
type SyncMethodName$
|
|
248
|
+
type SyncMethodName$4 = Writable<(typeof canUsePluginMethods$6)['sync']>;
|
|
249
249
|
declare class DataSource extends export_default {
|
|
250
250
|
private state;
|
|
251
251
|
constructor();
|
|
@@ -278,7 +278,7 @@ declare class DataSource extends export_default {
|
|
|
278
278
|
getDataSourceById(id: string): DataSourceSchema | undefined;
|
|
279
279
|
resetState(): void;
|
|
280
280
|
destroy(): void;
|
|
281
|
-
usePlugin(options: SyncHookPlugin<SyncMethodName$
|
|
281
|
+
usePlugin(options: SyncHookPlugin<SyncMethodName$4, DataSource>): void;
|
|
282
282
|
/**
|
|
283
283
|
* 复制时会带上组件关联的数据源
|
|
284
284
|
* @param config 组件节点配置
|
|
@@ -359,11 +359,11 @@ interface EditorEvents {
|
|
|
359
359
|
}];
|
|
360
360
|
'history-change': [data: MPage | MPageFragment];
|
|
361
361
|
}
|
|
362
|
-
declare const canUsePluginMethods$
|
|
362
|
+
declare const canUsePluginMethods$5: {
|
|
363
363
|
async: readonly ["getLayout", "highlight", "select", "multiSelect", "doAdd", "add", "doRemove", "remove", "doUpdate", "update", "sort", "copy", "paste", "doPaste", "doAlignCenter", "alignCenter", "moveLayer", "moveToContainer", "dragTo", "undo", "redo", "move"];
|
|
364
364
|
sync: never[];
|
|
365
365
|
};
|
|
366
|
-
type AsyncMethodName$
|
|
366
|
+
type AsyncMethodName$3 = Writable<(typeof canUsePluginMethods$5)['async']>;
|
|
367
367
|
declare class Editor extends export_default {
|
|
368
368
|
state: StoreState;
|
|
369
369
|
private isHistoryStateChange;
|
|
@@ -514,7 +514,7 @@ declare class Editor extends export_default {
|
|
|
514
514
|
resetState(): void;
|
|
515
515
|
destroy(): void;
|
|
516
516
|
resetModifiedNodeId(): void;
|
|
517
|
-
usePlugin(options: AsyncHookPlugin<AsyncMethodName$
|
|
517
|
+
usePlugin(options: AsyncHookPlugin<AsyncMethodName$3, Editor>): void;
|
|
518
518
|
on<Name extends keyof EditorEvents, Param extends EditorEvents[Name]>(eventName: Name, listener: (...args: Param) => void | Promise<void>): this;
|
|
519
519
|
once<Name extends keyof EditorEvents, Param extends EditorEvents[Name]>(eventName: Name, listener: (...args: Param) => void | Promise<void>): this;
|
|
520
520
|
emit<Name extends keyof EditorEvents, Param extends EditorEvents[Name]>(eventName: Name, ...args: Param): boolean;
|
|
@@ -527,6 +527,12 @@ declare class Editor extends export_default {
|
|
|
527
527
|
type EditorService = Editor;
|
|
528
528
|
declare const _default$E: Editor;
|
|
529
529
|
|
|
530
|
+
declare const canUsePluginMethods$4: {
|
|
531
|
+
async: readonly [];
|
|
532
|
+
sync: readonly ["setEvent", "getEvent", "setMethod", "getMethod"];
|
|
533
|
+
};
|
|
534
|
+
type AsyncMethodName$2 = Writable<(typeof canUsePluginMethods$4)['async']>;
|
|
535
|
+
type SyncMethodName$3 = Writable<(typeof canUsePluginMethods$4)['sync']>;
|
|
530
536
|
declare class Events extends export_default {
|
|
531
537
|
constructor();
|
|
532
538
|
setEvents(events: Record<string, EventOption[]>): void;
|
|
@@ -537,6 +543,7 @@ declare class Events extends export_default {
|
|
|
537
543
|
getMethod(type: string): EventOption[];
|
|
538
544
|
resetState(): void;
|
|
539
545
|
destroy(): void;
|
|
546
|
+
usePlugin(options: AsyncHookPlugin<AsyncMethodName$2, Events> & SyncHookPlugin<SyncMethodName$3, Events>): void;
|
|
540
547
|
}
|
|
541
548
|
type EventsService = Events;
|
|
542
549
|
declare const _default$D: Events;
|