@tmagic/editor 1.0.0-rc.2 → 1.0.0-rc.5
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/coverage/clover.xml +485 -448
- package/coverage/coverage-final.json +9 -9
- package/coverage/lcov-report/index.html +39 -39
- package/coverage/lcov-report/src/Editor.vue.html +14 -2
- package/coverage/lcov-report/src/components/ContentMenu.vue.html +12 -12
- package/coverage/lcov-report/src/components/Icon.vue.html +2 -2
- package/coverage/lcov-report/src/components/ScrollViewer.vue.html +1 -1
- package/coverage/lcov-report/src/components/ToolButton.vue.html +25 -25
- package/coverage/lcov-report/src/components/index.html +5 -5
- package/coverage/lcov-report/src/index.html +1 -1
- package/coverage/lcov-report/src/layouts/AddPageBox.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/Framework.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/NavMenu.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/PropsPanel.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/Resizer.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/index.html +1 -1
- package/coverage/lcov-report/src/layouts/sidebar/ComponentListPanel.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/sidebar/LayerMenu.vue.html +17 -17
- package/coverage/lcov-report/src/layouts/sidebar/LayerPanel.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/sidebar/Sidebar.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/sidebar/TabPane.vue.html +2 -2
- package/coverage/lcov-report/src/layouts/sidebar/index.html +19 -19
- package/coverage/lcov-report/src/layouts/workspace/PageBar.vue.html +1 -1
- package/coverage/lcov-report/src/layouts/workspace/Stage.vue.html +8 -2
- package/coverage/lcov-report/src/layouts/workspace/ViewerMenu.vue.html +69 -33
- package/coverage/lcov-report/src/layouts/workspace/Workspace.vue.html +85 -34
- package/coverage/lcov-report/src/layouts/workspace/index.html +28 -28
- package/coverage/lcov-report/src/services/BaseService.ts.html +2 -2
- package/coverage/lcov-report/src/services/componentList.ts.html +1 -1
- package/coverage/lcov-report/src/services/editor.ts.html +100 -10
- package/coverage/lcov-report/src/services/events.ts.html +1 -1
- package/coverage/lcov-report/src/services/history.ts.html +1 -1
- package/coverage/lcov-report/src/services/index.html +15 -15
- package/coverage/lcov-report/src/services/props.ts.html +1 -1
- package/coverage/lcov-report/src/services/ui.ts.html +1 -1
- package/coverage/lcov-report/src/type.ts.html +1 -1
- package/coverage/lcov-report/src/utils/compose.ts.html +1 -1
- package/coverage/lcov-report/src/utils/config.ts.html +1 -1
- package/coverage/lcov-report/src/utils/editor.ts.html +1 -1
- package/coverage/lcov-report/src/utils/index.html +1 -1
- package/coverage/lcov-report/src/utils/index.ts.html +1 -1
- package/coverage/lcov-report/src/utils/logger.ts.html +1 -1
- package/coverage/lcov-report/src/utils/props.ts.html +1 -1
- package/coverage/lcov-report/src/utils/scroll-viewer.ts.html +1 -1
- package/coverage/lcov-report/src/utils/undo-redo.ts.html +1 -1
- package/coverage/lcov.info +1156 -1057
- package/dist/tmagic-editor.es.js +90 -38
- package/dist/tmagic-editor.es.js.map +1 -1
- package/dist/tmagic-editor.umd.js +89 -37
- package/dist/tmagic-editor.umd.js.map +1 -1
- package/dist/types/src/Editor.vue.d.ts +5 -0
- package/dist/types/src/layouts/workspace/Workspace.vue.d.ts +5 -1
- package/dist/types/src/services/BaseService.d.ts +1 -1
- package/package.json +7 -7
- package/src/Editor.vue +4 -0
- package/src/components/ContentMenu.vue +3 -3
- package/src/layouts/sidebar/TabPane.vue +1 -1
- package/src/layouts/workspace/Stage.vue +2 -0
- package/src/layouts/workspace/ViewerMenu.vue +14 -2
- package/src/layouts/workspace/Workspace.vue +40 -23
- package/src/services/BaseService.ts +1 -1
- package/src/services/editor.ts +31 -1
- package/src/utils/editor.ts +6 -2
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">54.28% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>19/35</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">10.93% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>7/64</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">22.22% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>4/18</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">60% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>18/30</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -257,14 +257,14 @@
|
|
|
257
257
|
<span class="cline-any cline-neutral"> </span>
|
|
258
258
|
<span class="cline-any cline-neutral"> </span>
|
|
259
259
|
<span class="cline-any cline-neutral"> </span>
|
|
260
|
-
<span class="cline-any cline-
|
|
260
|
+
<span class="cline-any cline-no"> </span>
|
|
261
261
|
<span class="cline-any cline-neutral"> </span>
|
|
262
262
|
<span class="cline-any cline-neutral"> </span>
|
|
263
263
|
<span class="cline-any cline-neutral"> </span>
|
|
264
264
|
<span class="cline-any cline-neutral"> </span>
|
|
265
265
|
<span class="cline-any cline-neutral"> </span>
|
|
266
266
|
<span class="cline-any cline-neutral"> </span>
|
|
267
|
-
<span class="cline-any cline-
|
|
267
|
+
<span class="cline-any cline-no"> </span>
|
|
268
268
|
<span class="cline-any cline-neutral"> </span>
|
|
269
269
|
<span class="cline-any cline-no"> </span>
|
|
270
270
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -273,7 +273,7 @@
|
|
|
273
273
|
<span class="cline-any cline-neutral"> </span>
|
|
274
274
|
<span class="cline-any cline-neutral"> </span>
|
|
275
275
|
<span class="cline-any cline-neutral"> </span>
|
|
276
|
-
<span class="cline-any cline-
|
|
276
|
+
<span class="cline-any cline-no"> </span>
|
|
277
277
|
<span class="cline-any cline-neutral"> </span>
|
|
278
278
|
<span class="cline-any cline-no"> </span>
|
|
279
279
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -307,8 +307,8 @@ export default defineComponent({
|
|
|
307
307
|
const services = inject<Services>('services');
|
|
308
308
|
const menu = ref<InstanceType<typeof ContentMenu>>();
|
|
309
309
|
const node = computed(() => services<span class="branch-0 cbranch-no" title="branch not covered" >?.e</span>ditorService.get('node'));
|
|
310
|
-
const isRoot = computed(
|
|
311
|
-
const isPage = computed(
|
|
310
|
+
const isRoot = computed(<span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >n</span>ode.</span>value?.type === NodeType.ROOT);
|
|
311
|
+
const isPage = computed(<span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >n</span>ode.</span>value?.type === NodeType.PAGE);
|
|
312
312
|
const componentList = computed(<span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >s</span>ervices?</span>.componentListService.getList() || []);
|
|
313
313
|
|
|
314
314
|
const createMenuItems = <span class="fstat-no" title="function not covered" >(g</span>roup: ComponentGroup): MenuButton[] =>
|
|
@@ -369,14 +369,14 @@ export default defineComponent({
|
|
|
369
369
|
type: 'button',
|
|
370
370
|
text: '新增',
|
|
371
371
|
icon: markRaw(Plus),
|
|
372
|
-
display:
|
|
372
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >n</span>ode.</span>value?.items,
|
|
373
373
|
items: getSubMenuData.value,
|
|
374
374
|
},
|
|
375
375
|
{
|
|
376
376
|
type: 'button',
|
|
377
377
|
text: '复制',
|
|
378
378
|
icon: markRaw(DocumentCopy),
|
|
379
|
-
display: () =>
|
|
379
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sRoot.value,
|
|
380
380
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
381
381
|
<span class="cstat-no" title="statement not covered" > node.</span>value && services?.editorService.copy(node.value);
|
|
382
382
|
},
|
|
@@ -385,7 +385,7 @@ export default defineComponent({
|
|
|
385
385
|
type: 'button',
|
|
386
386
|
text: '删除',
|
|
387
387
|
icon: markRaw(Delete),
|
|
388
|
-
display: () =>
|
|
388
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sRoot.value && !isPage.value,
|
|
389
389
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
390
390
|
<span class="cstat-no" title="statement not covered" > node.</span>value && services?.editorService.remove(node.value);
|
|
391
391
|
},
|
|
@@ -406,7 +406,7 @@ export default defineComponent({
|
|
|
406
406
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
407
407
|
Code coverage generated by
|
|
408
408
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
409
|
-
at Tue May
|
|
409
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
410
410
|
</div>
|
|
411
411
|
<script src="../../../prettify.js"></script>
|
|
412
412
|
<script>
|
|
@@ -760,7 +760,7 @@ export default defineComponent({
|
|
|
760
760
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
761
761
|
Code coverage generated by
|
|
762
762
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
763
|
-
at Tue May
|
|
763
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
764
764
|
</div>
|
|
765
765
|
<script src="../../../prettify.js"></script>
|
|
766
766
|
<script>
|
|
@@ -211,7 +211,7 @@ export default defineComponent({
|
|
|
211
211
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
212
212
|
Code coverage generated by
|
|
213
213
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
214
|
-
at Tue May
|
|
214
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
215
215
|
</div>
|
|
216
216
|
<script src="../../../prettify.js"></script>
|
|
217
217
|
<script>
|
|
@@ -231,7 +231,7 @@ export default defineComponent({
|
|
|
231
231
|
|
|
232
232
|
props: {
|
|
233
233
|
data: {
|
|
234
|
-
type: Object as PropType<SideItem>,
|
|
234
|
+
type: [Object, String] as PropType<SideItem>,
|
|
235
235
|
},
|
|
236
236
|
},
|
|
237
237
|
|
|
@@ -274,7 +274,7 @@ export default defineComponent({
|
|
|
274
274
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
275
275
|
Code coverage generated by
|
|
276
276
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
277
|
-
at Tue May
|
|
277
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
278
278
|
</div>
|
|
279
279
|
<script src="../../../prettify.js"></script>
|
|
280
280
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">45.55% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>82/180</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">13.67% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>32/234</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">34.54% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>19/55</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">49.35% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>77/156</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -95,17 +95,17 @@
|
|
|
95
95
|
|
|
96
96
|
<tr>
|
|
97
97
|
<td class="file medium" data-value="LayerMenu.vue"><a href="LayerMenu.vue.html">LayerMenu.vue</a></td>
|
|
98
|
-
<td data-value="
|
|
99
|
-
<div class="chart"><div class="cover-fill" style="width:
|
|
98
|
+
<td data-value="54.28" class="pic medium">
|
|
99
|
+
<div class="chart"><div class="cover-fill" style="width: 54%"></div><div class="cover-empty" style="width: 46%"></div></div>
|
|
100
100
|
</td>
|
|
101
|
-
<td data-value="
|
|
102
|
-
<td data-value="35" class="abs medium">
|
|
103
|
-
<td data-value="
|
|
104
|
-
<td data-value="64" class="abs low">
|
|
105
|
-
<td data-value="
|
|
106
|
-
<td data-value="18" class="abs
|
|
107
|
-
<td data-value="
|
|
108
|
-
<td data-value="30" class="abs medium">
|
|
101
|
+
<td data-value="54.28" class="pct medium">54.28%</td>
|
|
102
|
+
<td data-value="35" class="abs medium">19/35</td>
|
|
103
|
+
<td data-value="10.93" class="pct low">10.93%</td>
|
|
104
|
+
<td data-value="64" class="abs low">7/64</td>
|
|
105
|
+
<td data-value="22.22" class="pct low">22.22%</td>
|
|
106
|
+
<td data-value="18" class="abs low">4/18</td>
|
|
107
|
+
<td data-value="60" class="pct medium">60%</td>
|
|
108
|
+
<td data-value="30" class="abs medium">18/30</td>
|
|
109
109
|
</tr>
|
|
110
110
|
|
|
111
111
|
<tr>
|
|
@@ -161,7 +161,7 @@
|
|
|
161
161
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
162
162
|
Code coverage generated by
|
|
163
163
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
164
|
-
at Tue May
|
|
164
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
165
165
|
</div>
|
|
166
166
|
<script src="../../../prettify.js"></script>
|
|
167
167
|
<script>
|
|
@@ -703,7 +703,7 @@ export default defineComponent({
|
|
|
703
703
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
704
704
|
Code coverage generated by
|
|
705
705
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
706
|
-
at Tue May
|
|
706
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
707
707
|
</div>
|
|
708
708
|
<script src="../../../prettify.js"></script>
|
|
709
709
|
<script>
|
|
@@ -288,7 +288,9 @@
|
|
|
288
288
|
<a name='L223'></a><a href='#L223'>223</a>
|
|
289
289
|
<a name='L224'></a><a href='#L224'>224</a>
|
|
290
290
|
<a name='L225'></a><a href='#L225'>225</a>
|
|
291
|
-
<a name='L226'></a><a href='#L226'>226</a
|
|
291
|
+
<a name='L226'></a><a href='#L226'>226</a>
|
|
292
|
+
<a name='L227'></a><a href='#L227'>227</a>
|
|
293
|
+
<a name='L228'></a><a href='#L228'>228</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
292
294
|
<span class="cline-any cline-neutral"> </span>
|
|
293
295
|
<span class="cline-any cline-neutral"> </span>
|
|
294
296
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -352,6 +354,7 @@
|
|
|
352
354
|
<span class="cline-any cline-neutral"> </span>
|
|
353
355
|
<span class="cline-any cline-neutral"> </span>
|
|
354
356
|
<span class="cline-any cline-neutral"> </span>
|
|
357
|
+
<span class="cline-any cline-neutral"> </span>
|
|
355
358
|
<span class="cline-any cline-no"> </span>
|
|
356
359
|
<span class="cline-any cline-neutral"> </span>
|
|
357
360
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -391,6 +394,7 @@
|
|
|
391
394
|
<span class="cline-any cline-neutral"> </span>
|
|
392
395
|
<span class="cline-any cline-neutral"> </span>
|
|
393
396
|
<span class="cline-any cline-neutral"> </span>
|
|
397
|
+
<span class="cline-any cline-neutral"> </span>
|
|
394
398
|
<span class="cline-any cline-no"> </span>
|
|
395
399
|
<span class="cline-any cline-neutral"> </span>
|
|
396
400
|
<span class="cline-any cline-no"> </span>
|
|
@@ -574,6 +578,7 @@ export default defineComponent({
|
|
|
574
578
|
},
|
|
575
579
|
|
|
576
580
|
runtimeUrl: String,
|
|
581
|
+
autoScrollIntoView: Boolean,
|
|
577
582
|
|
|
578
583
|
canSelect: {
|
|
579
584
|
type: Function as PropType<(el: HTMLElement) => boolean | Promise<boolean>>,
|
|
@@ -615,6 +620,7 @@ export default defineComponent({
|
|
|
615
620
|
render: props.render,
|
|
616
621
|
runtimeUrl: props.runtimeUrl,
|
|
617
622
|
zoom: zoom.value,
|
|
623
|
+
autoScrollIntoView: props.autoScrollIntoView,
|
|
618
624
|
canSelect: <span class="fstat-no" title="function not covered" >(e</span>l, event, stop) => {
|
|
619
625
|
const elCanSelect = <span class="cstat-no" title="statement not covered" >props.</span>canSelect(el);
|
|
620
626
|
// 在组件联动过程中不能再往下选择,返回并触发 ui-select
|
|
@@ -745,7 +751,7 @@ export default defineComponent({
|
|
|
745
751
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
746
752
|
Code coverage generated by
|
|
747
753
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
748
|
-
at Tue May
|
|
754
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
749
755
|
</div>
|
|
750
756
|
<script src="../../../prettify.js"></script>
|
|
751
757
|
<script>
|
|
@@ -23,30 +23,30 @@
|
|
|
23
23
|
<div class='clearfix'>
|
|
24
24
|
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
|
26
|
-
<span class="strong">
|
|
26
|
+
<span class="strong">41.66% </span>
|
|
27
27
|
<span class="quiet">Statements</span>
|
|
28
|
-
<span class='fraction'>
|
|
28
|
+
<span class='fraction'>25/60</span>
|
|
29
29
|
</div>
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
|
33
|
-
<span class="strong">
|
|
33
|
+
<span class="strong">8.57% </span>
|
|
34
34
|
<span class="quiet">Branches</span>
|
|
35
|
-
<span class='fraction'>
|
|
35
|
+
<span class='fraction'>12/140</span>
|
|
36
36
|
</div>
|
|
37
37
|
|
|
38
38
|
|
|
39
39
|
<div class='fl pad1y space-right2'>
|
|
40
|
-
<span class="strong">
|
|
40
|
+
<span class="strong">16% </span>
|
|
41
41
|
<span class="quiet">Functions</span>
|
|
42
|
-
<span class='fraction'>
|
|
42
|
+
<span class='fraction'>4/25</span>
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
|
47
|
-
<span class="strong">
|
|
47
|
+
<span class="strong">41.81% </span>
|
|
48
48
|
<span class="quiet">Lines</span>
|
|
49
|
-
<span class='fraction'>
|
|
49
|
+
<span class='fraction'>23/55</span>
|
|
50
50
|
</div>
|
|
51
51
|
|
|
52
52
|
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
</div>
|
|
62
62
|
</template>
|
|
63
63
|
</div>
|
|
64
|
-
<div class='status-line
|
|
64
|
+
<div class='status-line low'></div>
|
|
65
65
|
<pre><table class="coverage">
|
|
66
66
|
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
|
|
67
67
|
<a name='L2'></a><a href='#L2'>2</a>
|
|
@@ -212,7 +212,19 @@
|
|
|
212
212
|
<a name='L147'></a><a href='#L147'>147</a>
|
|
213
213
|
<a name='L148'></a><a href='#L148'>148</a>
|
|
214
214
|
<a name='L149'></a><a href='#L149'>149</a>
|
|
215
|
-
<a name='L150'></a><a href='#L150'>150</a
|
|
215
|
+
<a name='L150'></a><a href='#L150'>150</a>
|
|
216
|
+
<a name='L151'></a><a href='#L151'>151</a>
|
|
217
|
+
<a name='L152'></a><a href='#L152'>152</a>
|
|
218
|
+
<a name='L153'></a><a href='#L153'>153</a>
|
|
219
|
+
<a name='L154'></a><a href='#L154'>154</a>
|
|
220
|
+
<a name='L155'></a><a href='#L155'>155</a>
|
|
221
|
+
<a name='L156'></a><a href='#L156'>156</a>
|
|
222
|
+
<a name='L157'></a><a href='#L157'>157</a>
|
|
223
|
+
<a name='L158'></a><a href='#L158'>158</a>
|
|
224
|
+
<a name='L159'></a><a href='#L159'>159</a>
|
|
225
|
+
<a name='L160'></a><a href='#L160'>160</a>
|
|
226
|
+
<a name='L161'></a><a href='#L161'>161</a>
|
|
227
|
+
<a name='L162'></a><a href='#L162'>162</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral"> </span>
|
|
216
228
|
<span class="cline-any cline-neutral"> </span>
|
|
217
229
|
<span class="cline-any cline-neutral"> </span>
|
|
218
230
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -264,7 +276,7 @@
|
|
|
264
276
|
<span class="cline-any cline-neutral"> </span>
|
|
265
277
|
<span class="cline-any cline-neutral"> </span>
|
|
266
278
|
<span class="cline-any cline-neutral"> </span>
|
|
267
|
-
<span class="cline-any cline-
|
|
279
|
+
<span class="cline-any cline-no"> </span>
|
|
268
280
|
<span class="cline-any cline-neutral"> </span>
|
|
269
281
|
<span class="cline-any cline-no"> </span>
|
|
270
282
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -281,23 +293,35 @@
|
|
|
281
293
|
<span class="cline-any cline-neutral"> </span>
|
|
282
294
|
<span class="cline-any cline-neutral"> </span>
|
|
283
295
|
<span class="cline-any cline-neutral"> </span>
|
|
284
|
-
<span class="cline-any cline-
|
|
296
|
+
<span class="cline-any cline-no"> </span>
|
|
285
297
|
<span class="cline-any cline-neutral"> </span>
|
|
286
298
|
<span class="cline-any cline-no"> </span>
|
|
299
|
+
<span class="cline-any cline-neutral"> </span>
|
|
300
|
+
<span class="cline-any cline-no"> </span>
|
|
301
|
+
<span class="cline-any cline-no"> </span>
|
|
302
|
+
<span class="cline-any cline-no"> </span>
|
|
303
|
+
<span class="cline-any cline-no"> </span>
|
|
304
|
+
<span class="cline-any cline-neutral"> </span>
|
|
305
|
+
<span class="cline-any cline-no"> </span>
|
|
306
|
+
<span class="cline-any cline-no"> </span>
|
|
307
|
+
<span class="cline-any cline-no"> </span>
|
|
287
308
|
<span class="cline-any cline-no"> </span>
|
|
288
309
|
<span class="cline-any cline-no"> </span>
|
|
289
310
|
<span class="cline-any cline-neutral"> </span>
|
|
290
311
|
<span class="cline-any cline-neutral"> </span>
|
|
312
|
+
<span class="cline-any cline-no"> </span>
|
|
291
313
|
<span class="cline-any cline-neutral"> </span>
|
|
292
314
|
<span class="cline-any cline-neutral"> </span>
|
|
293
315
|
<span class="cline-any cline-neutral"> </span>
|
|
294
|
-
<span class="cline-any cline-yes">2x</span>
|
|
295
316
|
<span class="cline-any cline-neutral"> </span>
|
|
296
317
|
<span class="cline-any cline-neutral"> </span>
|
|
318
|
+
<span class="cline-any cline-no"> </span>
|
|
297
319
|
<span class="cline-any cline-neutral"> </span>
|
|
298
320
|
<span class="cline-any cline-neutral"> </span>
|
|
299
321
|
<span class="cline-any cline-neutral"> </span>
|
|
300
|
-
<span class="cline-any cline-
|
|
322
|
+
<span class="cline-any cline-neutral"> </span>
|
|
323
|
+
<span class="cline-any cline-neutral"> </span>
|
|
324
|
+
<span class="cline-any cline-no"> </span>
|
|
301
325
|
<span class="cline-any cline-neutral"> </span>
|
|
302
326
|
<span class="cline-any cline-no"> </span>
|
|
303
327
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -306,7 +330,7 @@
|
|
|
306
330
|
<span class="cline-any cline-neutral"> </span>
|
|
307
331
|
<span class="cline-any cline-neutral"> </span>
|
|
308
332
|
<span class="cline-any cline-neutral"> </span>
|
|
309
|
-
<span class="cline-any cline-
|
|
333
|
+
<span class="cline-any cline-no"> </span>
|
|
310
334
|
<span class="cline-any cline-neutral"> </span>
|
|
311
335
|
<span class="cline-any cline-no"> </span>
|
|
312
336
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -314,7 +338,7 @@
|
|
|
314
338
|
<span class="cline-any cline-neutral"> </span>
|
|
315
339
|
<span class="cline-any cline-neutral"> </span>
|
|
316
340
|
<span class="cline-any cline-neutral"> </span>
|
|
317
|
-
<span class="cline-any cline-
|
|
341
|
+
<span class="cline-any cline-no"> </span>
|
|
318
342
|
<span class="cline-any cline-neutral"> </span>
|
|
319
343
|
<span class="cline-any cline-no"> </span>
|
|
320
344
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -322,7 +346,7 @@
|
|
|
322
346
|
<span class="cline-any cline-neutral"> </span>
|
|
323
347
|
<span class="cline-any cline-neutral"> </span>
|
|
324
348
|
<span class="cline-any cline-neutral"> </span>
|
|
325
|
-
<span class="cline-any cline-
|
|
349
|
+
<span class="cline-any cline-no"> </span>
|
|
326
350
|
<span class="cline-any cline-neutral"> </span>
|
|
327
351
|
<span class="cline-any cline-no"> </span>
|
|
328
352
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -330,13 +354,13 @@
|
|
|
330
354
|
<span class="cline-any cline-neutral"> </span>
|
|
331
355
|
<span class="cline-any cline-neutral"> </span>
|
|
332
356
|
<span class="cline-any cline-neutral"> </span>
|
|
333
|
-
<span class="cline-any cline-
|
|
357
|
+
<span class="cline-any cline-no"> </span>
|
|
334
358
|
<span class="cline-any cline-neutral"> </span>
|
|
335
359
|
<span class="cline-any cline-neutral"> </span>
|
|
336
360
|
<span class="cline-any cline-neutral"> </span>
|
|
337
361
|
<span class="cline-any cline-neutral"> </span>
|
|
338
362
|
<span class="cline-any cline-neutral"> </span>
|
|
339
|
-
<span class="cline-any cline-
|
|
363
|
+
<span class="cline-any cline-no"> </span>
|
|
340
364
|
<span class="cline-any cline-neutral"> </span>
|
|
341
365
|
<span class="cline-any cline-no"> </span>
|
|
342
366
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -386,9 +410,9 @@ export default defineComponent({
|
|
|
386
410
|
const canPaste = ref(false);
|
|
387
411
|
const canCenter = ref(false);
|
|
388
412
|
|
|
389
|
-
const node = computed(() =>
|
|
413
|
+
const node = computed(<span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >e</span>ditorService?</span>.get('node'));
|
|
390
414
|
const parent = computed(() => editorService?.get('parent'));
|
|
391
|
-
const isPage = computed(() =>
|
|
415
|
+
const isPage = computed(<span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >n</span>ode.</span>value?.type === NodeType.PAGE);
|
|
392
416
|
|
|
393
417
|
onMounted(() => {
|
|
394
418
|
const data = globalThis.localStorage.getItem(COPY_STORAGE_KEY);
|
|
@@ -413,7 +437,7 @@ export default defineComponent({
|
|
|
413
437
|
{
|
|
414
438
|
type: 'button',
|
|
415
439
|
text: '水平居中',
|
|
416
|
-
display: () =>
|
|
440
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >c</span>anCenter.</span>value,
|
|
417
441
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
418
442
|
<span class="cstat-no" title="statement not covered" > node.</span>value && editorService?.alignCenter(node.value);
|
|
419
443
|
},
|
|
@@ -430,23 +454,35 @@ export default defineComponent({
|
|
|
430
454
|
{
|
|
431
455
|
type: 'button',
|
|
432
456
|
text: '粘贴',
|
|
433
|
-
display: () =>
|
|
457
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >c</span>anPaste.</span>value,
|
|
434
458
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
435
|
-
const
|
|
436
|
-
|
|
459
|
+
const stage = <span class="cstat-no" title="statement not covered" >editorService?</span>.get<StageCore>('stage');
|
|
460
|
+
|
|
461
|
+
const rect = <span class="cstat-no" title="statement not covered" >menu.value?.$</span>el.getBoundingClientRect();
|
|
462
|
+
const parentRect = <span class="cstat-no" title="statement not covered" >stage?.container?.g</span>etBoundingClientRect();
|
|
463
|
+
let left = <span class="cstat-no" title="statement not covered" >(r</span>ect?.left || 0) - (parentRect?.left || 0);
|
|
464
|
+
let top = <span class="cstat-no" title="statement not covered" >(r</span>ect?.top || 0) - (parentRect?.top || 0);
|
|
465
|
+
|
|
466
|
+
<span class="cstat-no" title="statement not covered" > <span class="missing-if-branch" title="if path not taken" >I</span>if (node.value?.items && stage) {</span>
|
|
467
|
+
const parentEl = <span class="cstat-no" title="statement not covered" >stage.renderer.contentWindow?.d</span>ocument.getElementById(`${node.value.id}`);
|
|
468
|
+
const parentElRect = <span class="cstat-no" title="statement not covered" >parentEl?</span>.getBoundingClientRect();
|
|
469
|
+
<span class="cstat-no" title="statement not covered" > left </span>= left - (parentElRect?.left || 0);
|
|
470
|
+
<span class="cstat-no" title="statement not covered" > top </span>= top - (parentElRect?.top || 0);
|
|
471
|
+
}
|
|
472
|
+
|
|
437
473
|
<span class="cstat-no" title="statement not covered" > editorService?</span>.paste({ left, top });
|
|
438
474
|
},
|
|
439
475
|
},
|
|
440
476
|
{
|
|
441
477
|
type: 'divider',
|
|
442
478
|
direction: 'horizontal',
|
|
443
|
-
display: () =>
|
|
479
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
444
480
|
},
|
|
445
481
|
{
|
|
446
482
|
type: 'button',
|
|
447
483
|
text: '上移一层',
|
|
448
484
|
icon: markRaw(Top),
|
|
449
|
-
display: () =>
|
|
485
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
450
486
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
451
487
|
<span class="cstat-no" title="statement not covered" > editorService?</span>.moveLayer(1);
|
|
452
488
|
},
|
|
@@ -455,7 +491,7 @@ export default defineComponent({
|
|
|
455
491
|
type: 'button',
|
|
456
492
|
text: '下移一层',
|
|
457
493
|
icon: markRaw(Bottom),
|
|
458
|
-
display: () =>
|
|
494
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
459
495
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
460
496
|
<span class="cstat-no" title="statement not covered" > editorService?</span>.moveLayer(-1);
|
|
461
497
|
},
|
|
@@ -463,7 +499,7 @@ export default defineComponent({
|
|
|
463
499
|
{
|
|
464
500
|
type: 'button',
|
|
465
501
|
text: '置顶',
|
|
466
|
-
display: () =>
|
|
502
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
467
503
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
468
504
|
<span class="cstat-no" title="statement not covered" > editorService?</span>.moveLayer(LayerOffset.TOP);
|
|
469
505
|
},
|
|
@@ -471,7 +507,7 @@ export default defineComponent({
|
|
|
471
507
|
{
|
|
472
508
|
type: 'button',
|
|
473
509
|
text: '置底',
|
|
474
|
-
display: () =>
|
|
510
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
475
511
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
476
512
|
<span class="cstat-no" title="statement not covered" > editorService?</span>.moveLayer(LayerOffset.BOTTOM);
|
|
477
513
|
},
|
|
@@ -479,13 +515,13 @@ export default defineComponent({
|
|
|
479
515
|
{
|
|
480
516
|
type: 'divider',
|
|
481
517
|
direction: 'horizontal',
|
|
482
|
-
display: () =>
|
|
518
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
483
519
|
},
|
|
484
520
|
{
|
|
485
521
|
type: 'button',
|
|
486
522
|
text: '删除',
|
|
487
523
|
icon: Delete,
|
|
488
|
-
display: () =>
|
|
524
|
+
display: <span class="fstat-no" title="function not covered" >() => <span class="cstat-no" title="statement not covered" >!</span>i</span>sPage.value,
|
|
489
525
|
handler: <span class="fstat-no" title="function not covered" >() => {</span>
|
|
490
526
|
<span class="cstat-no" title="statement not covered" > node.</span>value && editorService?.remove(node.value);
|
|
491
527
|
},
|
|
@@ -517,7 +553,7 @@ export default defineComponent({
|
|
|
517
553
|
<div class='footer quiet pad2 space-top1 center small'>
|
|
518
554
|
Code coverage generated by
|
|
519
555
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
|
520
|
-
at Tue May
|
|
556
|
+
at Tue May 31 2022 20:04:27 GMT+0800 (China Standard Time)
|
|
521
557
|
</div>
|
|
522
558
|
<script src="../../../prettify.js"></script>
|
|
523
559
|
<script>
|