vue-editify 0.2.17 → 0.2.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. package/examples/App.vue +4 -12
  2. package/lib/components/colors/colors.vue.d.ts +9 -0
  3. package/lib/components/colors/props.d.ts +4 -0
  4. package/lib/components/tooltip/tooltip.vue.d.ts +1 -1
  5. package/lib/core/function.d.ts +112 -64
  6. package/lib/core/rule.d.ts +23 -17
  7. package/lib/core/shortcut.d.ts +36 -0
  8. package/lib/core/tool.d.ts +12 -16
  9. package/lib/editify/editify.vue.d.ts +162 -15
  10. package/lib/editify/props.d.ts +1 -5
  11. package/lib/editify/toolbar/props.d.ts +1 -1
  12. package/lib/editify/toolbar/toolbar.vue.d.ts +3 -3
  13. package/lib/editify.es.js +13660 -12954
  14. package/lib/editify.umd.js +2 -2
  15. package/lib/feature/align.d.ts +0 -14
  16. package/lib/feature/heading.d.ts +0 -14
  17. package/lib/feature/lineHeight.d.ts +0 -14
  18. package/lib/feature/orderList.d.ts +1 -3
  19. package/lib/feature/task.d.ts +0 -14
  20. package/lib/feature/unorderList.d.ts +1 -3
  21. package/lib/index.d.ts +164 -17
  22. package/package.json +2 -2
  23. package/src/components/button/button.vue +3 -3
  24. package/src/components/checkbox/checkbox.vue +1 -1
  25. package/src/components/colors/colors.vue +4 -4
  26. package/src/components/colors/props.ts +6 -1
  27. package/src/components/insertAttachment/insertAttachment.vue +1 -1
  28. package/src/components/insertImage/insertImage.vue +1 -1
  29. package/src/components/insertLink/insertLink.vue +1 -1
  30. package/src/components/insertVideo/insertVideo.vue +1 -1
  31. package/src/components/layer/layer.vue +9 -3
  32. package/src/components/tooltip/tooltip.vue +1 -1
  33. package/src/components/updateLink/updateLink.vue +1 -1
  34. package/src/core/function.ts +873 -491
  35. package/src/core/rule.ts +86 -368
  36. package/src/core/shortcut.ts +386 -0
  37. package/src/core/tool.ts +111 -159
  38. package/src/css/var.less +0 -10
  39. package/src/editify/editify.less +85 -39
  40. package/src/editify/editify.vue +204 -88
  41. package/src/editify/menu/menu.vue +2 -3
  42. package/src/editify/props.ts +1 -6
  43. package/src/editify/toolbar/props.ts +2 -2
  44. package/src/editify/toolbar/toolbar.vue +12 -12
  45. package/src/feature/align.ts +2 -62
  46. package/src/feature/attachment.ts +14 -27
  47. package/src/feature/backColor.ts +2 -1
  48. package/src/feature/bold.ts +1 -1
  49. package/src/feature/code.ts +1 -1
  50. package/src/feature/codeBlock.ts +3 -3
  51. package/src/feature/fontFamily.ts +1 -1
  52. package/src/feature/fontSize.ts +1 -1
  53. package/src/feature/foreColor.ts +2 -1
  54. package/src/feature/formatClear.ts +1 -1
  55. package/src/feature/fullScreen.ts +1 -1
  56. package/src/feature/heading.ts +5 -76
  57. package/src/feature/image.ts +1 -1
  58. package/src/feature/indent.ts +1 -1
  59. package/src/feature/infoBlock.ts +6 -37
  60. package/src/feature/italic.ts +1 -1
  61. package/src/feature/lineHeight.ts +2 -78
  62. package/src/feature/link.ts +1 -1
  63. package/src/feature/mathformula.ts +4 -51
  64. package/src/feature/orderList.ts +168 -37
  65. package/src/feature/quote.ts +3 -3
  66. package/src/feature/redo.ts +1 -1
  67. package/src/feature/separator.ts +1 -1
  68. package/src/feature/sourceView.ts +1 -1
  69. package/src/feature/strikethrough.ts +1 -1
  70. package/src/feature/sub.ts +1 -1
  71. package/src/feature/super.ts +1 -1
  72. package/src/feature/table.ts +3 -3
  73. package/src/feature/task.ts +4 -58
  74. package/src/feature/underline.ts +1 -1
  75. package/src/feature/undo.ts +1 -1
  76. package/src/feature/unorderList.ts +108 -37
  77. package/src/feature/video.ts +1 -1
  78. package/src/icon/iconfont.css +39 -3
  79. package/src/icon/iconfont.ttf +0 -0
  80. package/src/icon/iconfont.woff +0 -0
  81. package/src/index.ts +13 -11
  82. package/src/locale/en_US.ts +109 -110
  83. package/src/locale/zh_CN.ts +11 -12
  84. package/lib/feature/panel.d.ts +0 -18
  85. package/src/feature/panel.ts +0 -107
@@ -1,19 +1,5 @@
1
1
  import { MenuSelectButtonType } from '../core/tool';
2
2
 
3
- /**
4
- * 工具栏 - 对齐方式
5
- */
6
- export declare const AlignToolbarButton: import('vue').DefineSetupFnComponent<{
7
- color: string;
8
- zIndex: number;
9
- config: MenuSelectButtonType;
10
- tooltip: boolean;
11
- }, {}, {}, {
12
- color: string;
13
- zIndex: number;
14
- config: MenuSelectButtonType;
15
- tooltip: boolean;
16
- } & {}, import('vue').PublicProps>;
17
3
  /**
18
4
  * 菜单栏 - 对齐方式
19
5
  */
@@ -1,19 +1,5 @@
1
1
  import { MenuDisplayButtonType } from '../core/tool';
2
2
 
3
- /**
4
- * 工具栏 - 标题
5
- */
6
- export declare const HeadingToolbarButton: import('vue').DefineSetupFnComponent<{
7
- color: string;
8
- zIndex: number;
9
- config: MenuDisplayButtonType;
10
- tooltip: boolean;
11
- }, {}, {}, {
12
- color: string;
13
- zIndex: number;
14
- config: MenuDisplayButtonType;
15
- tooltip: boolean;
16
- } & {}, import('vue').PublicProps>;
17
3
  /**
18
4
  * 菜单栏 - 标题
19
5
  */
@@ -1,19 +1,5 @@
1
1
  import { MenuDisplayButtonType } from '../core/tool';
2
2
 
3
- /**
4
- * 工具栏 - 行高
5
- */
6
- export declare const LineHeightToolbarButton: import('vue').DefineSetupFnComponent<{
7
- color: string;
8
- zIndex: number;
9
- config: MenuDisplayButtonType;
10
- tooltip: boolean;
11
- }, {}, {}, {
12
- color: string;
13
- zIndex: number;
14
- config: MenuDisplayButtonType;
15
- tooltip: boolean;
16
- } & {}, import('vue').PublicProps>;
17
3
  /**
18
4
  * 菜单栏 - 行高
19
5
  */
@@ -3,15 +3,13 @@ import { MenuButtonType } from '../core/tool';
3
3
  /**
4
4
  * 工具栏 - 有序列表
5
5
  */
6
- export declare const OrderListToolbarButton: import('vue').DefineSetupFnComponent<{
6
+ export declare const OrderListToolbar: import('vue').DefineSetupFnComponent<{
7
7
  color: string;
8
8
  zIndex: number;
9
- config: MenuButtonType;
10
9
  tooltip: boolean;
11
10
  }, {}, {}, {
12
11
  color: string;
13
12
  zIndex: number;
14
- config: MenuButtonType;
15
13
  tooltip: boolean;
16
14
  } & {}, import('vue').PublicProps>;
17
15
  /**
@@ -1,19 +1,5 @@
1
1
  import { MenuButtonType } from '../core/tool';
2
2
 
3
- /**
4
- * 工具栏 - 任务列表
5
- */
6
- export declare const TaskToolbarButton: import('vue').DefineSetupFnComponent<{
7
- color: string;
8
- zIndex: number;
9
- config: MenuButtonType;
10
- tooltip: boolean;
11
- }, {}, {}, {
12
- color: string;
13
- zIndex: number;
14
- config: MenuButtonType;
15
- tooltip: boolean;
16
- } & {}, import('vue').PublicProps>;
17
3
  /**
18
4
  * 菜单栏 - 任务列表
19
5
  */
@@ -3,15 +3,13 @@ import { MenuButtonType } from '../core/tool';
3
3
  /**
4
4
  * 工具栏 - 无序列表
5
5
  */
6
- export declare const UnorderListToolbarButton: import('vue').DefineSetupFnComponent<{
6
+ export declare const UnorderListToolbar: import('vue').DefineSetupFnComponent<{
7
7
  color: string;
8
8
  zIndex: number;
9
- config: MenuButtonType;
10
9
  tooltip: boolean;
11
10
  }, {}, {}, {
12
11
  color: string;
13
12
  zIndex: number;
14
- config: MenuButtonType;
15
13
  tooltip: boolean;
16
14
  } & {}, import('vue').PublicProps>;
17
15
  /**
package/lib/index.d.ts CHANGED
@@ -107,10 +107,6 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
107
107
  type: BooleanConstructor;
108
108
  default: boolean;
109
109
  };
110
- tab: {
111
- type: BooleanConstructor;
112
- default: boolean;
113
- };
114
110
  dark: {
115
111
  type: BooleanConstructor;
116
112
  default: boolean;
@@ -287,11 +283,156 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
287
283
  };
288
284
  } | null;
289
285
  }[];
290
- current: number;
291
- push: (stack: AlexElement[], range?: import('alex-editor').AlexRange | null) => void;
292
- get: (type: -1 | 1) => import('alex-editor').AlexHistoryResultType | null;
293
- updateCurrentRange: (range: import('alex-editor').AlexRange) => void;
294
- __cloneRange: (newStack: AlexElement[], range?: import('alex-editor').AlexRange | null) => import('alex-editor').AlexRange | null;
286
+ redoRecords: {
287
+ stack: {
288
+ key: number;
289
+ type: import('alex-editor').AlexElementType;
290
+ parsedom: string | null;
291
+ marks: import('alex-editor').ObjectType | null;
292
+ styles: import('alex-editor').ObjectType | null;
293
+ textContent: string | null;
294
+ children: any[] | null;
295
+ parent: any | null;
296
+ behavior: "default" | "block";
297
+ namespace: string | null;
298
+ locked: boolean;
299
+ elm: HTMLElement | null;
300
+ isBlock: () => boolean;
301
+ isInblock: () => boolean;
302
+ isInline: () => boolean;
303
+ isClosed: () => boolean;
304
+ isText: () => boolean;
305
+ isBreak: () => boolean;
306
+ isEmpty: () => boolean;
307
+ isSpaceText: () => boolean;
308
+ getUneditableElement: () => AlexElement | null;
309
+ isEqual: (element: AlexElement) => boolean;
310
+ isContains: (element: AlexElement) => boolean;
311
+ isOnlyHasBreak: () => boolean | 0;
312
+ isPreStyle: () => boolean;
313
+ hasMarks: () => boolean;
314
+ hasStyles: () => boolean;
315
+ hasChildren: () => boolean;
316
+ hasContains: (element: AlexElement) => boolean;
317
+ clone: (deep?: boolean | undefined) => AlexElement;
318
+ convertToBlock: () => void;
319
+ toEmpty: () => void;
320
+ getBlock: () => AlexElement;
321
+ getInblock: () => AlexElement | null;
322
+ getInline: () => AlexElement | null;
323
+ isEqualStyles: (element: AlexElement) => boolean;
324
+ isEqualMarks: (element: AlexElement) => boolean;
325
+ isFirst: (element: AlexElement) => boolean;
326
+ isLast: (element: AlexElement) => boolean;
327
+ __render: () => void;
328
+ __fullClone: () => AlexElement;
329
+ }[];
330
+ range: {
331
+ anchor: {
332
+ element: {
333
+ key: number;
334
+ type: import('alex-editor').AlexElementType;
335
+ parsedom: string | null;
336
+ marks: import('alex-editor').ObjectType | null;
337
+ styles: import('alex-editor').ObjectType | null;
338
+ textContent: string | null;
339
+ children: any[] | null;
340
+ parent: any | null;
341
+ behavior: "default" | "block";
342
+ namespace: string | null;
343
+ locked: boolean;
344
+ elm: HTMLElement | null;
345
+ isBlock: () => boolean;
346
+ isInblock: () => boolean;
347
+ isInline: () => boolean;
348
+ isClosed: () => boolean;
349
+ isText: () => boolean;
350
+ isBreak: () => boolean;
351
+ isEmpty: () => boolean;
352
+ isSpaceText: () => boolean;
353
+ getUneditableElement: () => AlexElement | null;
354
+ isEqual: (element: AlexElement) => boolean;
355
+ isContains: (element: AlexElement) => boolean;
356
+ isOnlyHasBreak: () => boolean | 0;
357
+ isPreStyle: () => boolean;
358
+ hasMarks: () => boolean;
359
+ hasStyles: () => boolean;
360
+ hasChildren: () => boolean;
361
+ hasContains: (element: AlexElement) => boolean;
362
+ clone: (deep?: boolean | undefined) => AlexElement;
363
+ convertToBlock: () => void;
364
+ toEmpty: () => void;
365
+ getBlock: () => AlexElement;
366
+ getInblock: () => AlexElement | null;
367
+ getInline: () => AlexElement | null;
368
+ isEqualStyles: (element: AlexElement) => boolean;
369
+ isEqualMarks: (element: AlexElement) => boolean;
370
+ isFirst: (element: AlexElement) => boolean;
371
+ isLast: (element: AlexElement) => boolean;
372
+ __render: () => void;
373
+ __fullClone: () => AlexElement;
374
+ };
375
+ offset: number;
376
+ isEqual: (point: import('alex-editor').AlexPoint) => boolean;
377
+ moveToEnd: (element: AlexElement) => void;
378
+ moveToStart: (element: AlexElement) => void;
379
+ };
380
+ focus: {
381
+ element: {
382
+ key: number;
383
+ type: import('alex-editor').AlexElementType;
384
+ parsedom: string | null;
385
+ marks: import('alex-editor').ObjectType | null;
386
+ styles: import('alex-editor').ObjectType | null;
387
+ textContent: string | null;
388
+ children: any[] | null;
389
+ parent: any | null;
390
+ behavior: "default" | "block";
391
+ namespace: string | null;
392
+ locked: boolean;
393
+ elm: HTMLElement | null;
394
+ isBlock: () => boolean;
395
+ isInblock: () => boolean;
396
+ isInline: () => boolean;
397
+ isClosed: () => boolean;
398
+ isText: () => boolean;
399
+ isBreak: () => boolean;
400
+ isEmpty: () => boolean;
401
+ isSpaceText: () => boolean;
402
+ getUneditableElement: () => AlexElement | null;
403
+ isEqual: (element: AlexElement) => boolean;
404
+ isContains: (element: AlexElement) => boolean;
405
+ isOnlyHasBreak: () => boolean | 0;
406
+ isPreStyle: () => boolean;
407
+ hasMarks: () => boolean;
408
+ hasStyles: () => boolean;
409
+ hasChildren: () => boolean;
410
+ hasContains: (element: AlexElement) => boolean;
411
+ clone: (deep?: boolean | undefined) => AlexElement;
412
+ convertToBlock: () => void;
413
+ toEmpty: () => void;
414
+ getBlock: () => AlexElement;
415
+ getInblock: () => AlexElement | null;
416
+ getInline: () => AlexElement | null;
417
+ isEqualStyles: (element: AlexElement) => boolean;
418
+ isEqualMarks: (element: AlexElement) => boolean;
419
+ isFirst: (element: AlexElement) => boolean;
420
+ isLast: (element: AlexElement) => boolean;
421
+ __render: () => void;
422
+ __fullClone: () => AlexElement;
423
+ };
424
+ offset: number;
425
+ isEqual: (point: import('alex-editor').AlexPoint) => boolean;
426
+ moveToEnd: (element: AlexElement) => void;
427
+ moveToStart: (element: AlexElement) => void;
428
+ };
429
+ } | null;
430
+ }[];
431
+ cloneRange: (newStack: AlexElement[], range: import('alex-editor').AlexRange | null) => import('alex-editor').AlexRange | null;
432
+ setState: (stack: AlexElement[], range: import('alex-editor').AlexRange | null) => void;
433
+ undo: () => import('alex-editor').AlexHistoryRecordType | null;
434
+ redo: () => import('alex-editor').AlexHistoryRecordType | null;
435
+ updateRange: (range: import('alex-editor').AlexRange) => void;
295
436
  };
296
437
  stack: {
297
438
  key: number;
@@ -437,7 +578,9 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
437
578
  };
438
579
  } | null;
439
580
  __guid: number;
440
- __events: import('alex-editor').ObjectType;
581
+ __events: {
582
+ [key: string]: ((...args: any) => void)[];
583
+ };
441
584
  __oldStack: {
442
585
  key: number;
443
586
  type: import('alex-editor').AlexElementType;
@@ -484,6 +627,12 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
484
627
  __isInputChinese: boolean;
485
628
  __innerSelectionChange: boolean;
486
629
  __chineseInputTimer: any;
630
+ __domObserver: {
631
+ disconnect: () => void;
632
+ observe: (target: Node, options?: MutationObserverInit) => void;
633
+ takeRecords: () => MutationRecord[];
634
+ } | null;
635
+ __illegalDoms: Node[];
487
636
  initRange: () => void;
488
637
  delete: () => void;
489
638
  insertText: (data: string) => void;
@@ -507,8 +656,11 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
507
656
  collapseToEnd: (element?: AlexElement) => void;
508
657
  setDisabled: () => void;
509
658
  setEnabled: () => void;
659
+ undo: () => void;
660
+ redo: () => void;
510
661
  emit: (eventName: string, ...value: any) => boolean;
511
662
  on: (eventName: string, eventHandle: (...args: any) => void) => void;
663
+ off: (eventName: string, eventHandle?: (...args: any) => void) => void;
512
664
  destroy: () => void;
513
665
  } | null>;
514
666
  isSourceView: import('vue').Ref<boolean>;
@@ -730,10 +882,6 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
730
882
  type: BooleanConstructor;
731
883
  default: boolean;
732
884
  };
733
- tab: {
734
- type: BooleanConstructor;
735
- default: boolean;
736
- };
737
885
  dark: {
738
886
  type: BooleanConstructor;
739
887
  default: boolean;
@@ -784,7 +932,6 @@ declare const Editify: import('./core/tool').SFCWithInstall<import('vue').Define
784
932
  extraKeepTags: string[];
785
933
  renderRules: ((el: AlexElement) => void)[];
786
934
  autoheight: boolean;
787
- tab: boolean;
788
935
  dark: boolean;
789
936
  offset: number;
790
937
  }, {}>>;
@@ -804,7 +951,7 @@ export type * from './core/tool';
804
951
  export type * from './core/function';
805
952
  export type * from './editify/menu';
806
953
  export type * from './editify/toolbar';
807
- export { elementIsMatch, getMatchElementByElement, getMatchElementByRange, elementIsList, getListByElement, hasListInRange, rangeIsInList, elementIsTask, getTaskByElement, hasTaskInRange, rangeIsInTask, elementIsAttachment, hasAttachmentInRange, elementIsMathformula, getMathformulaByElement, hasMathformulaInRange, elementIsPanel, getPanelByElement, hasPanelInRange, elementIsInfoBlock, getInfoBlockByElement, hasInfoBlockInRange, rangeIsInInfoBlock, hasPreInRange, hasQuoteInRange, hasLinkInRange, hasTableInRange, hasImageInRange, hasVideoInRange, rangeIsInQuote, queryTextStyle, queryTextMark, getRangeText, setIndentIncrease, setIndentDecrease, setQuote, setAlign, setList, setTask, setTextStyle, setTextMark, removeTextStyle, removeTextMark, setLineHeight, insertLink, insertImage, insertVideo, insertTable, insertCodeBlock, insertSeparator } from './core/function';
954
+ export { elementIsMatch, getMatchElementByElement, getMatchElementByRange, elementIsList, getListByElement, hasListInRange, rangeIsInList, elementIsTask, getTaskByElement, hasTaskInRange, rangeIsInTask, elementIsAttachment, hasAttachmentInRange, elementIsMathformula, getMathformulaByElement, hasMathformulaInRange, elementIsInfoBlock, getInfoBlockByElement, hasInfoBlockInRange, rangeIsInInfoBlock, hasPreInRange, hasTableInRange, hasQuoteInRange, rangeIsInQuote, hasLinkInRange, hasImageInRange, hasVideoInRange, queryTextStyle, setTextStyle, removeTextStyle, queryTextMark, setTextMark, removeTextMark, getRangeText, addSpaceTextToBothSides, setHeading, setIndentIncrease, setIndentDecrease, setQuote, setAlign, setList, setTask, setLineHeight, insertLink, insertImage, insertVideo, insertTable, insertCodeBlock, insertSeparator, insertAttachment, insertMathformula, insertInfoBlock } from './core/function';
808
955
  declare const install: (app: App) => void;
809
- declare const version = "0.2.17";
956
+ declare const version = "0.2.19";
810
957
  export { Editify as default, Editify, install, AlexElement, version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-editify",
3
- "version": "0.2.17",
3
+ "version": "0.2.19",
4
4
  "private": false,
5
5
  "sideEffects": [
6
6
  "*.css"
@@ -17,7 +17,7 @@
17
17
  "lib": "vue-tsc && vite build"
18
18
  },
19
19
  "dependencies": {
20
- "alex-editor": "^1.4.25",
20
+ "alex-editor": "^1.4.33",
21
21
  "dap-util": "^1.5.8",
22
22
  "highlight.js": "^11.8.0",
23
23
  "katex": "^0.16.10",
@@ -31,9 +31,9 @@
31
31
  import { computed, ref } from 'vue'
32
32
  import { common as DapCommon, color as DapColor } from 'dap-util'
33
33
  import { ObjectType } from '@/core/tool'
34
- import { Tooltip } from '@/components/tooltip'
35
- import { Layer } from '@/components/layer'
36
- import { Icon } from '@/components/icon'
34
+ import { Tooltip } from '../tooltip'
35
+ import { Layer } from '../layer'
36
+ import { Icon } from '../icon'
37
37
  import { ButtonOptionsItemType, ButtonParseDisplayConfigType, ButtonParseSelectConfigType, ButtonProps } from './props'
38
38
 
39
39
  defineOptions({
@@ -12,8 +12,8 @@
12
12
  <script setup lang="ts">
13
13
  import { computed } from 'vue'
14
14
  import { common as DapCommon } from 'dap-util'
15
- import { Icon } from '@/components/icon'
16
15
  import { ObjectType } from '@/core/tool'
16
+ import { Icon } from '../icon'
17
17
  import { CheckboxProps } from './props'
18
18
 
19
19
  defineOptions({
@@ -6,7 +6,7 @@
6
6
  </div>
7
7
  <div class="editify-colors-list">
8
8
  <div class="editify-color" :class="{ 'editify-active': value == item.value }" v-for="item in data" :style="{ borderColor: value == item.value ? color || '' : '' }">
9
- <Tooltip block :content="<string>item.label" :disabled="!tooltip">
9
+ <Tooltip block :content="`${item.label}`" :disabled="!tooltip" :z-index="zIndex">
10
10
  <div @click="selectColor(item)" class="editify-color-el" :style="{ background: item.value }"></div>
11
11
  </Tooltip>
12
12
  </div>
@@ -15,9 +15,9 @@
15
15
  </template>
16
16
  <script setup lang="ts">
17
17
  import { inject } from 'vue'
18
- import { Icon } from '@/components/icon'
19
- import { Tooltip } from '@/components/tooltip'
20
- import { ButtonOptionsItemType } from '@/components/button'
18
+ import { Icon } from '../icon'
19
+ import { Tooltip } from '../tooltip'
20
+ import { ButtonOptionsItemType } from '../button'
21
21
  import { ColorsProps } from './props'
22
22
 
23
23
  defineOptions({
@@ -1,5 +1,5 @@
1
1
  import { ExtractPublicPropTypes, PropType } from 'vue'
2
- import { ButtonOptionsItemType } from '@/components/button'
2
+ import { ButtonOptionsItemType } from '../button'
3
3
 
4
4
  export const ColorsProps = {
5
5
  //颜色数组
@@ -23,6 +23,11 @@ export const ColorsProps = {
23
23
  tooltip: {
24
24
  type: Boolean,
25
25
  default: false
26
+ },
27
+ //层级
28
+ zIndex: {
29
+ type: Number,
30
+ default: 1
26
31
  }
27
32
  }
28
33
 
@@ -27,7 +27,7 @@
27
27
  import { computed, inject, ref, watch } from 'vue'
28
28
  import { file as DapFile } from 'dap-util'
29
29
  import { ObjectType } from '@/core/tool'
30
- import { Icon } from '@/components/icon'
30
+ import { Icon } from '../icon'
31
31
  import { InsertAttachmentProps } from './props'
32
32
 
33
33
  defineOptions({
@@ -23,7 +23,7 @@
23
23
  import { computed, inject, ref, watch } from 'vue'
24
24
  import { file as DapFile } from 'dap-util'
25
25
  import { ObjectType } from '@/core/tool'
26
- import { Icon } from '@/components/icon'
26
+ import { Icon } from '../icon'
27
27
  import { InsertImageProps } from './props'
28
28
 
29
29
  defineOptions({
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
  <script setup lang="ts">
15
15
  import { inject, ref, watch } from 'vue'
16
- import { Checkbox } from '@/components/checkbox'
16
+ import { Checkbox } from '../checkbox'
17
17
  import { InsertLinkProps } from './props'
18
18
 
19
19
  defineOptions({
@@ -23,7 +23,7 @@
23
23
  import { computed, inject, ref, watch } from 'vue'
24
24
  import { file as DapFile } from 'dap-util'
25
25
  import { ObjectType } from '@/core/tool'
26
- import { Icon } from '@/components/icon'
26
+ import { Icon } from '../icon'
27
27
  import { InsertVideoProps } from './props'
28
28
 
29
29
  defineOptions({
@@ -14,7 +14,7 @@
14
14
  import { computed, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
15
15
  import { element as DapElement, event as DapEvent } from 'dap-util'
16
16
  import { ObjectType } from '@/core/tool'
17
- import { Triangle, TrianglePlacementType } from '@/components/triangle'
17
+ import { Triangle, TrianglePlacementType } from '../triangle'
18
18
  import { LayerPlacementType, LayerProps } from './props'
19
19
 
20
20
  defineOptions({
@@ -583,7 +583,10 @@ const handleScroll = () => {
583
583
  setScroll(el.parentNode as HTMLElement)
584
584
  }
585
585
  }
586
- setScroll(getNode()! || getScrollNode()!)
586
+ const node = getNode() || getScrollNode()
587
+ if (node) {
588
+ setScroll(node)
589
+ }
587
590
  }
588
591
  //移除上述滚动事件的监听
589
592
  const removeScrollHandle = () => {
@@ -593,7 +596,10 @@ const removeScrollHandle = () => {
593
596
  removeScroll(el.parentNode as HTMLElement)
594
597
  }
595
598
  }
596
- removeScroll(getNode()! || getScrollNode()!)
599
+ const node = getNode() || getScrollNode()
600
+ if (node) {
601
+ removeScroll(node)
602
+ }
597
603
  }
598
604
  //点击定位元素和自身以外的元素关闭浮层
599
605
  const handleClick = (e: Event) => {
@@ -8,7 +8,7 @@
8
8
  </template>
9
9
  <script setup lang="ts">
10
10
  import { ComputedRef, inject, ref } from 'vue'
11
- import { Layer } from '@/components/layer'
11
+ import { Layer } from '../layer'
12
12
  import { TooltipProps } from './props'
13
13
 
14
14
  defineOptions({
@@ -13,7 +13,7 @@
13
13
  </template>
14
14
  <script setup lang="ts">
15
15
  import { inject, onBeforeUnmount, ref, watch } from 'vue'
16
- import { Checkbox } from '@/components/checkbox'
16
+ import { Checkbox } from '../checkbox'
17
17
  import { UpdateLinkProps } from './props'
18
18
 
19
19
  defineOptions({