goodteditor-ui 1.0.21 → 1.0.23

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.
Files changed (114) hide show
  1. package/.eslintrc.js +7 -7
  2. package/.prettierrc +14 -14
  3. package/README.md +35 -35
  4. package/babel.config.js +5 -5
  5. package/index.js +53 -53
  6. package/jsconfig.json +13 -13
  7. package/package.json +66 -70
  8. package/src/App.vue +36 -36
  9. package/src/components/ui/Avatar.md +68 -68
  10. package/src/components/ui/Avatar.vue +180 -177
  11. package/src/components/ui/Badge.md +20 -20
  12. package/src/components/ui/Badge.vue +75 -75
  13. package/src/components/ui/Collapse.md +90 -90
  14. package/src/components/ui/Collapse.vue +86 -86
  15. package/src/components/ui/ColorPicker/Alpha.vue +114 -114
  16. package/src/components/ui/ColorPicker/Colors.vue +117 -117
  17. package/src/components/ui/ColorPicker/Hue.vue +113 -113
  18. package/src/components/ui/ColorPicker/Preview.vue +55 -55
  19. package/src/components/ui/ColorPicker/Saturation.vue +123 -123
  20. package/src/components/ui/ColorPicker/mixin.js +105 -105
  21. package/src/components/ui/ColorPicker.md +17 -17
  22. package/src/components/ui/ColorPicker.vue +314 -314
  23. package/src/components/ui/Datalist.md +41 -41
  24. package/src/components/ui/Datalist.vue +157 -157
  25. package/src/components/ui/DatePicker.md +168 -168
  26. package/src/components/ui/DatePicker.vue +527 -527
  27. package/src/components/ui/FileSelector.md +105 -105
  28. package/src/components/ui/FileSelector.vue +82 -82
  29. package/src/components/ui/Grid.md +130 -130
  30. package/src/components/ui/Grid.vue +92 -92
  31. package/src/components/ui/Image.md +59 -59
  32. package/src/components/ui/Image.vue +57 -57
  33. package/src/components/ui/InputAutocomplete.md +115 -115
  34. package/src/components/ui/InputAutocomplete.vue +341 -341
  35. package/src/components/ui/InputColorPicker.md +51 -51
  36. package/src/components/ui/InputColorPicker.vue +151 -151
  37. package/src/components/ui/InputDatePicker.md +121 -121
  38. package/src/components/ui/InputDatePicker.vue +326 -326
  39. package/src/components/ui/InputTags.md +51 -51
  40. package/src/components/ui/InputTags.vue +184 -184
  41. package/src/components/ui/InputTimePicker.md +25 -25
  42. package/src/components/ui/InputTimePicker.vue +253 -253
  43. package/src/components/ui/InputUnits.md +20 -20
  44. package/src/components/ui/InputUnits.vue +257 -257
  45. package/src/components/ui/Lazy.md +37 -37
  46. package/src/components/ui/Lazy.vue +92 -92
  47. package/src/components/ui/Pagination.md +74 -74
  48. package/src/components/ui/Pagination.vue +138 -138
  49. package/src/components/ui/Paginator.md +34 -34
  50. package/src/components/ui/Paginator.vue +83 -83
  51. package/src/components/ui/Popover.md +34 -34
  52. package/src/components/ui/Popover.vue +274 -274
  53. package/src/components/ui/Popup.md +59 -59
  54. package/src/components/ui/Popup.vue +150 -150
  55. package/src/components/ui/ResponsiveContainer.md +58 -58
  56. package/src/components/ui/ResponsiveContainer.vue +99 -99
  57. package/src/components/ui/Select.md +187 -187
  58. package/src/components/ui/Select.vue +421 -421
  59. package/src/components/ui/TimePicker.md +50 -50
  60. package/src/components/ui/TimePicker.vue +252 -252
  61. package/src/components/ui/Tooltip.md +54 -114
  62. package/src/components/ui/Tooltip.vue +113 -113
  63. package/src/components/ui/WysiwygEditor/WysiwygEditor.d.ts +119 -119
  64. package/src/components/ui/WysiwygEditor/constants.js +264 -264
  65. package/src/components/ui/WysiwygEditor/extensions/blockquote.js +15 -15
  66. package/src/components/ui/WysiwygEditor/extensions/bold.js +15 -15
  67. package/src/components/ui/WysiwygEditor/extensions/bullet-list.js +15 -15
  68. package/src/components/ui/WysiwygEditor/extensions/code-block.js +13 -13
  69. package/src/components/ui/WysiwygEditor/extensions/code.js +13 -13
  70. package/src/components/ui/WysiwygEditor/extensions/font-size.js +34 -34
  71. package/src/components/ui/WysiwygEditor/extensions/formatting.js +14 -14
  72. package/src/components/ui/WysiwygEditor/extensions/heading.js +13 -13
  73. package/src/components/ui/WysiwygEditor/extensions/horizontal-rule.js +15 -15
  74. package/src/components/ui/WysiwygEditor/extensions/image.js +19 -19
  75. package/src/components/ui/WysiwygEditor/extensions/index.d.ts +32 -32
  76. package/src/components/ui/WysiwygEditor/extensions/index.js +32 -32
  77. package/src/components/ui/WysiwygEditor/extensions/italic.js +15 -15
  78. package/src/components/ui/WysiwygEditor/extensions/link.js +16 -16
  79. package/src/components/ui/WysiwygEditor/extensions/list-item.js +15 -15
  80. package/src/components/ui/WysiwygEditor/extensions/ordered-list.js +15 -15
  81. package/src/components/ui/WysiwygEditor/extensions/paragraph.js +23 -23
  82. package/src/components/ui/WysiwygEditor/extensions/strike.js +15 -15
  83. package/src/components/ui/WysiwygEditor/extensions/table-cell.js +13 -13
  84. package/src/components/ui/WysiwygEditor/extensions/table-header.js +15 -15
  85. package/src/components/ui/WysiwygEditor/extensions/table-row.js +15 -15
  86. package/src/components/ui/WysiwygEditor/extensions/table.js +29 -29
  87. package/src/components/ui/WysiwygEditor/extensions/text-align.js +6 -6
  88. package/src/components/ui/WysiwygEditor/extensions/text-style.js +15 -15
  89. package/src/components/ui/WysiwygEditor/extensions/underline.js +15 -15
  90. package/src/components/ui/WysiwygEditor/index.d.ts +4 -4
  91. package/src/components/ui/WysiwygEditor/index.js +4 -4
  92. package/src/components/ui/WysiwygEditor/renders/Button.vue +28 -28
  93. package/src/components/ui/WysiwygEditor/renders/ColorPicker.vue +41 -41
  94. package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +34 -34
  95. package/src/components/ui/WysiwygEditor/renders/InputBrowse.vue +35 -35
  96. package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +38 -38
  97. package/src/components/ui/WysiwygEditor/renders/Link.vue +87 -87
  98. package/src/components/ui/WysiwygEditor/renders/Select.vue +47 -47
  99. package/src/components/ui/WysiwygEditor/renders/ToolbarPopover.vue +49 -49
  100. package/src/components/ui/WysiwygEditor/renders/index.d.ts +8 -8
  101. package/src/components/ui/WysiwygEditor/renders/index.js +8 -8
  102. package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +39 -39
  103. package/src/components/ui/WysiwygEditor/renders/mixins/index.js +1 -1
  104. package/src/components/ui/WysiwygEditor/tools-and-commands.js +704 -704
  105. package/src/components/ui/WysiwygEditor/utils.js +72 -72
  106. package/src/components/ui/WysiwygEditor.md +18 -18
  107. package/src/components/ui/WysiwygEditor.vue +271 -271
  108. package/src/components/ui/utils/FormComponent.js +107 -107
  109. package/src/components/ui/utils/Helpers.js +84 -84
  110. package/src/components/ui/utils/WithPopover.js +81 -99
  111. package/src/main.js +8 -8
  112. package/styleguide.config.js +37 -37
  113. package/vue.config.js +8 -8
  114. package/dist/js.png +0 -0
@@ -1,114 +1,54 @@
1
- Simple example
2
-
3
- ```vue
4
- <template>
5
- <div class="pos-rel pad-l5">
6
- <ui-select
7
- class="pos-abs pos-top-left"
8
- v-model="position"
9
- v-bind="{ options, size: 'small' }"
10
- ></ui-select>
11
- <ui-tooltip :position="position">
12
- <template #target="{ events, binds }">
13
- <div
14
- class="pad-l2 bg-green color-white radius text-center"
15
- v-on="events"
16
- v-bind="binds"
17
- >
18
- hover me
19
- </div>
20
- </template>
21
- <div>Title</div>
22
- <div>
23
- I'm on the <code>{{ position }}</code> side
24
- </div>
25
- </ui-tooltip>
26
- </div>
27
- </template>
28
- <script>
29
- import UiSelect from './Select.vue';
30
- import UiTooltip from './Tooltip.vue';
31
- export default {
32
- components: { UiSelect, UiTooltip },
33
- data() {
34
- return {
35
- position: 'top',
36
- options: [
37
- 'left',
38
- 'left-start',
39
- 'left-end',
40
- 'top',
41
- 'top-start',
42
- 'top-end',
43
- 'bottom',
44
- 'bottom-start',
45
- 'bottom-end',
46
- 'right',
47
- 'right-start',
48
- 'right-end',
49
- ],
50
- };
51
- },
52
- };
53
- </script>
54
- ```
55
-
56
- Advanced example. Using cursor tracking
57
-
58
- ```vue
59
- <template>
60
- <div class="pos-rel pad-l5">
61
- <ui-tooltip v-bind="options">
62
- <template #target="{ binds }">
63
- <div
64
- ref="target"
65
- class="pad-l2 bg-green color-white radius text-center"
66
- v-bind="binds"
67
- >
68
- hover me
69
- </div>
70
- </template>
71
- <div>
72
- I follow the cursor everywhere
73
- </div>
74
- </ui-tooltip>
75
- </div>
76
- </template>
77
- <script>
78
- import UiTooltip from './Tooltip.vue';
79
- export default {
80
- components: { UiTooltip },
81
- data() {
82
- return {
83
- options: {
84
- show: false,
85
- shouldFollowCursor: true,
86
- cursorCoordinates: [0, 0]
87
- }
88
- };
89
- },
90
- mounted() {
91
- this.$refs.target.addEventListener('mouseover', this.showTooltip);
92
- this.$refs.target.addEventListener('mousemove', this.changeTooltipCoords);
93
- this.$refs.target.addEventListener('mouseleave', this.hideTooltip);
94
- },
95
- beforeDestroy() {
96
- this.$refs.target.removeEventListener('mouseover', this.showTooltip);
97
- this.$refs.target.removeEventListener('mousemove', this.changeTooltipCoords);
98
- this.$refs.target.removeEventListener('mouseleave', this.hideTooltip);
99
-
100
- },
101
- methods: {
102
- showTooltip() {
103
- this.options.show = true;
104
- },
105
- hideTooltip() {
106
- this.options.show = false;
107
- },
108
- changeTooltipCoords({ clientX: x, clientY: y }) {
109
- this.options.cursorCoordinates = [x, y];
110
- }
111
- }
112
- };
113
- </script>
114
- ```
1
+ Simple example
2
+
3
+ ```vue
4
+ <template>
5
+ <div class="pos-rel pad-l5">
6
+ <ui-select
7
+ class="pos-abs pos-top-left"
8
+ v-model="position"
9
+ v-bind="{ options, size: 'small' }"
10
+ ></ui-select>
11
+ <ui-tooltip :position="position">
12
+ <template #target="{ events, binds }">
13
+ <div
14
+ class="pad-l2 bg-green color-white radius text-center"
15
+ v-on="events"
16
+ v-bind="binds"
17
+ >
18
+ hover me
19
+ </div>
20
+ </template>
21
+ <div>Title</div>
22
+ <div>
23
+ I'm on the <code>{{ position }}</code> side
24
+ </div>
25
+ </ui-tooltip>
26
+ </div>
27
+ </template>
28
+ <script>
29
+ import UiSelect from './Select.vue';
30
+ import UiTooltip from './Tooltip.vue';
31
+ export default {
32
+ components: { UiSelect, UiTooltip },
33
+ data() {
34
+ return {
35
+ position: 'top',
36
+ options: [
37
+ 'left',
38
+ 'left-start',
39
+ 'left-end',
40
+ 'top',
41
+ 'top-start',
42
+ 'top-end',
43
+ 'bottom',
44
+ 'bottom-start',
45
+ 'bottom-end',
46
+ 'right',
47
+ 'right-start',
48
+ 'right-end',
49
+ ],
50
+ };
51
+ },
52
+ };
53
+ </script>
54
+ ```
@@ -1,113 +1,113 @@
1
- <template>
2
- <div class="ui-tooltip">
3
- <slot name="target" v-bind="{ events: targetEvents, binds: targetBinds }"></slot>
4
- <ui-popover
5
- v-bind="popoverOptions"
6
- :show.sync="popoverShow"
7
- @mouseenter.native="onPopoverMouseEnter"
8
- @mouseleave.native="onPopoverMouseLeave"
9
- >
10
- <!--
11
- @slot Tooltip slot
12
- -->
13
- <slot name="tooltip">
14
- <div class="tooltip">
15
- <!--
16
- @slot Tooltip content slot
17
- -->
18
- <slot></slot>
19
- </div>
20
- </slot>
21
- </ui-popover>
22
- </div>
23
- </template>
24
- <style lang="less" scoped>
25
- .ui-tooltip {
26
- display: contents;
27
- }
28
- </style>
29
- <script>
30
- import UiPopover from './Popover.vue';
31
- import { Position } from './utils/Helpers';
32
- import WithPopover from './utils/WithPopover';
33
-
34
- export default {
35
- components: { UiPopover },
36
- mixins: [WithPopover],
37
- props: {
38
- /**
39
- * Whether to show the tooltip
40
- */
41
- show: {
42
- type: Boolean,
43
- default: false,
44
- },
45
- /**
46
- * Hide delay in ms
47
- */
48
- hideDelay: {
49
- type: Number,
50
- default: 150,
51
- },
52
- position: {
53
- type: String,
54
- default: Position.TOP,
55
- },
56
- positionOffset: {
57
- type: Array,
58
- default() {
59
- return [0, 5];
60
- },
61
- },
62
- },
63
- data() {
64
- return {
65
- targetEvents: {
66
- mouseenter: this.onTargetMouseEnter,
67
- mouseleave: this.onTargetMouseLeave,
68
- },
69
- timeout: null,
70
- };
71
- },
72
- computed: {
73
- targetBinds() {
74
- return {
75
- 'data-popover': this.popoverTargetId,
76
- };
77
- },
78
- },
79
- watch: {
80
- show: {
81
- handler(v) {
82
- this.setShow(v);
83
- },
84
- immediate: true,
85
- },
86
- },
87
- methods: {
88
- setShow(val) {
89
- const { timeout, hideDelay } = this;
90
- if (timeout) {
91
- clearTimeout(timeout);
92
- }
93
- if (val) {
94
- this.popoverShow = true;
95
- } else {
96
- this.timeout = setTimeout(() => (this.popoverShow = false), hideDelay);
97
- }
98
- },
99
- onTargetMouseEnter(e) {
100
- this.setShow(true);
101
- },
102
- onTargetMouseLeave(e) {
103
- this.setShow(false);
104
- },
105
- onPopoverMouseEnter(e) {
106
- this.setShow(true);
107
- },
108
- onPopoverMouseLeave(e) {
109
- this.setShow(false);
110
- },
111
- },
112
- };
113
- </script>
1
+ <template>
2
+ <div class="ui-tooltip">
3
+ <slot name="target" v-bind="{ events: targetEvents, binds: targetBinds }"></slot>
4
+ <ui-popover
5
+ v-bind="popoverOptions"
6
+ :show.sync="popoverShow"
7
+ @mouseenter.native="onPopoverMouseEnter"
8
+ @mouseleave.native="onPopoverMouseLeave"
9
+ >
10
+ <!--
11
+ @slot Tooltip slot
12
+ -->
13
+ <slot name="tooltip">
14
+ <div class="tooltip">
15
+ <!--
16
+ @slot Tooltip content slot
17
+ -->
18
+ <slot></slot>
19
+ </div>
20
+ </slot>
21
+ </ui-popover>
22
+ </div>
23
+ </template>
24
+ <style lang="less" scoped>
25
+ .ui-tooltip {
26
+ display: contents;
27
+ }
28
+ </style>
29
+ <script>
30
+ import UiPopover from './Popover.vue';
31
+ import { Position } from './utils/Helpers';
32
+ import WithPopover from './utils/WithPopover';
33
+
34
+ export default {
35
+ components: { UiPopover },
36
+ mixins: [WithPopover],
37
+ props: {
38
+ /**
39
+ * Whether to show the tooltip
40
+ */
41
+ show: {
42
+ type: Boolean,
43
+ default: false,
44
+ },
45
+ /**
46
+ * Hide delay in ms
47
+ */
48
+ hideDelay: {
49
+ type: Number,
50
+ default: 150,
51
+ },
52
+ position: {
53
+ type: String,
54
+ default: Position.TOP,
55
+ },
56
+ positionOffset: {
57
+ type: Array,
58
+ default() {
59
+ return [0, 5];
60
+ },
61
+ },
62
+ },
63
+ data() {
64
+ return {
65
+ targetEvents: {
66
+ mouseenter: this.onTargetMouseEnter,
67
+ mouseleave: this.onTargetMouseLeave,
68
+ },
69
+ timeout: null,
70
+ };
71
+ },
72
+ computed: {
73
+ targetBinds() {
74
+ return {
75
+ 'data-popover': this.popoverTargetId,
76
+ };
77
+ },
78
+ },
79
+ watch: {
80
+ show: {
81
+ handler(v) {
82
+ this.setShow(v);
83
+ },
84
+ immediate: true,
85
+ },
86
+ },
87
+ methods: {
88
+ setShow(val) {
89
+ const { timeout, hideDelay } = this;
90
+ if (timeout) {
91
+ clearTimeout(timeout);
92
+ }
93
+ if (val) {
94
+ this.popoverShow = true;
95
+ } else {
96
+ this.timeout = setTimeout(() => (this.popoverShow = false), hideDelay);
97
+ }
98
+ },
99
+ onTargetMouseEnter(e) {
100
+ this.setShow(true);
101
+ },
102
+ onTargetMouseLeave(e) {
103
+ this.setShow(false);
104
+ },
105
+ onPopoverMouseEnter(e) {
106
+ this.setShow(true);
107
+ },
108
+ onPopoverMouseLeave(e) {
109
+ this.setShow(false);
110
+ },
111
+ },
112
+ };
113
+ </script>
@@ -1,119 +1,119 @@
1
- import { Button, Select, InputUnits, ColorPicker, ToolbarPopover, InputAuto, InputBrowse, Link } from './renders';
2
-
3
- export type Render = Readonly<{
4
- BUTTON: Button;
5
- COLOR_PICKER: ColorPicker;
6
- INPUT_UNITS: InputUnits;
7
- SELECT: Select;
8
- TOOLBAR_POPOVER: ToolbarPopover;
9
- INPUT_AUTO: InputAuto;
10
- INPUT_BROWSE: InputBrowse;
11
- LINK: Link;
12
- }>;
13
-
14
- export type CommandDef = {
15
- name: String;
16
- title: String;
17
- exec: () => void;
18
- isActive: () => Boolean;
19
- isEnabled: () => Boolean;
20
- };
21
-
22
- export type ToolDef = {
23
- name: String;
24
- render: Render;
25
- title: String;
26
- icon: String;
27
- exec: (value?: String | Record<String, any>) => void;
28
- isActive: () => Boolean;
29
- isEnabled: () => Boolean;
30
- getValue?: () => String | Record<String, any>;
31
- options?: Array<String | ToolDef | CommandDef>;
32
- units?: Array<String>
33
- };
34
-
35
- export type NodeType = Readonly<{
36
- BLOCKQUOTE: 'blockquote',
37
- BULLET_LIST: 'bulletList',
38
- CODE_BLOCK: 'codeBlock',
39
- DOCUMENT: 'document',
40
- HARD_BREAK: 'hardBreak',
41
- HEADING: 'heading',
42
- HORIZONTAL_RULE: 'horizontalRule',
43
- IMAGE: 'image',
44
- LIST_ITEM: 'listItem',
45
- ORDERED_LIST: 'orderedList',
46
- PARAGRAPH: 'paragraph',
47
- TABLE: 'table',
48
- TABLE_ROW: 'tableRow',
49
- TABLE_CELL: 'tableCell',
50
- TEXT: 'text'
51
- }>;
52
-
53
- export type MarkType = Readonly<{
54
- BOLD: 'bold',
55
- CODE: 'code',
56
- ITALIC: 'italic',
57
- LINK: 'link',
58
- STRIKE: 'strike',
59
- UNDERLINE: 'underline',
60
- TEXT_STYLE: 'textStyle'
61
- }>;
62
-
63
- export type CommandType = Readonly<{
64
- PARAGRAPH: 'paragraph',
65
- HEADING_1: 'heading1',
66
- HEADING_2: 'heading2',
67
- HEADING_3: 'heading3',
68
- HEADING_4: 'heading4',
69
- TEXT_SMALL: 'textSmall',
70
- TEXT_XSMALL: 'textXsmall',
71
- CODE_BLOCK: 'codeBlock',
72
- SINK_LIST_ITEM: 'sinkListItem',
73
- LIFT_LIST_ITEM: 'liftListItem'
74
- }>;
75
-
76
- export type ToolType = Readonly<{
77
- PARAGRAPH_STYLE: 'paragraphStyle',
78
- FONT_SIZE: 'fontSize',
79
- FONT_FAMILY: 'fontFamily',
80
- TEXT_COLOR: 'textColor',
81
- BLOCKQUOTE: 'blockquote',
82
- ORDERED_LIST: 'orderedList',
83
- BULLET_LIST: 'bulletList',
84
- TEXT_ALIGN_LEFT: 'textAlignLeft',
85
- TEXT_ALIGN_RIGHT: 'textAlignRight',
86
- TEXT_ALIGN_CENTER: 'textAlignCenter',
87
- HORIZONTAL_RULE: 'horizontalRule',
88
- LINK: 'link',
89
- IMAGE: 'image',
90
- TABLE: 'table',
91
- BOLD: 'bold',
92
- CODE: 'code',
93
- ITALIC: 'italic',
94
- STRIKE: 'strike',
95
- UNDERLINE: 'underline',
96
- UNDO: 'undo',
97
- REDO: 'redo',
98
- SAVE: 'save',
99
- CLEAR_FORMATTING: 'clearFormatting',
100
- HARD_BREAK: 'hardBreak',
101
- INSERT_TABLE: 'insertTable',
102
- DELETE_TABLE: 'deleteTable',
103
- ADD_COLUMN_BEFORE: 'addColumnBefore',
104
- ADD_COLUMN_AFTER: 'addColumnAfter',
105
- DELETE_COLUMN: 'deleteColumn',
106
- ADD_ROW_BEFORE: 'addRowBefore',
107
- ADD_ROW_AFTER: 'addRowAfter',
108
- DELETE_ROW: 'deleteRow',
109
- MERGE_CELLS: 'mergeCells',
110
- SPLIT_CELL: 'splitCell',
111
- TOGGLE_HEADER_COLUMN: 'toggleHeaderColumn',
112
- TOGGLE_HEADER_ROW: 'toggleHeaderRow',
113
- ALIGN_V_TOP: 'alignVTop',
114
- ALIGN_V_MID: 'alignVMid',
115
- ALIGN_V_BOT: 'alignVBot',
116
- TOGGLE_BORDERS: 'toggleBorders',
117
- TOGGLE_ZEBRA: 'toggleZebra',
118
- INSERT_IMAGE: 'insertImage'
119
- }>;
1
+ import { Button, Select, InputUnits, ColorPicker, ToolbarPopover, InputAuto, InputBrowse, Link } from './renders';
2
+
3
+ export type Render = Readonly<{
4
+ BUTTON: Button;
5
+ COLOR_PICKER: ColorPicker;
6
+ INPUT_UNITS: InputUnits;
7
+ SELECT: Select;
8
+ TOOLBAR_POPOVER: ToolbarPopover;
9
+ INPUT_AUTO: InputAuto;
10
+ INPUT_BROWSE: InputBrowse;
11
+ LINK: Link;
12
+ }>;
13
+
14
+ export type CommandDef = {
15
+ name: String;
16
+ title: String;
17
+ exec: () => void;
18
+ isActive: () => Boolean;
19
+ isEnabled: () => Boolean;
20
+ };
21
+
22
+ export type ToolDef = {
23
+ name: String;
24
+ render: Render;
25
+ title: String;
26
+ icon: String;
27
+ exec: (value?: String | Record<String, any>) => void;
28
+ isActive: () => Boolean;
29
+ isEnabled: () => Boolean;
30
+ getValue?: () => String | Record<String, any>;
31
+ options?: Array<String | ToolDef | CommandDef>;
32
+ units?: Array<String>
33
+ };
34
+
35
+ export type NodeType = Readonly<{
36
+ BLOCKQUOTE: 'blockquote',
37
+ BULLET_LIST: 'bulletList',
38
+ CODE_BLOCK: 'codeBlock',
39
+ DOCUMENT: 'document',
40
+ HARD_BREAK: 'hardBreak',
41
+ HEADING: 'heading',
42
+ HORIZONTAL_RULE: 'horizontalRule',
43
+ IMAGE: 'image',
44
+ LIST_ITEM: 'listItem',
45
+ ORDERED_LIST: 'orderedList',
46
+ PARAGRAPH: 'paragraph',
47
+ TABLE: 'table',
48
+ TABLE_ROW: 'tableRow',
49
+ TABLE_CELL: 'tableCell',
50
+ TEXT: 'text'
51
+ }>;
52
+
53
+ export type MarkType = Readonly<{
54
+ BOLD: 'bold',
55
+ CODE: 'code',
56
+ ITALIC: 'italic',
57
+ LINK: 'link',
58
+ STRIKE: 'strike',
59
+ UNDERLINE: 'underline',
60
+ TEXT_STYLE: 'textStyle'
61
+ }>;
62
+
63
+ export type CommandType = Readonly<{
64
+ PARAGRAPH: 'paragraph',
65
+ HEADING_1: 'heading1',
66
+ HEADING_2: 'heading2',
67
+ HEADING_3: 'heading3',
68
+ HEADING_4: 'heading4',
69
+ TEXT_SMALL: 'textSmall',
70
+ TEXT_XSMALL: 'textXsmall',
71
+ CODE_BLOCK: 'codeBlock',
72
+ SINK_LIST_ITEM: 'sinkListItem',
73
+ LIFT_LIST_ITEM: 'liftListItem'
74
+ }>;
75
+
76
+ export type ToolType = Readonly<{
77
+ PARAGRAPH_STYLE: 'paragraphStyle',
78
+ FONT_SIZE: 'fontSize',
79
+ FONT_FAMILY: 'fontFamily',
80
+ TEXT_COLOR: 'textColor',
81
+ BLOCKQUOTE: 'blockquote',
82
+ ORDERED_LIST: 'orderedList',
83
+ BULLET_LIST: 'bulletList',
84
+ TEXT_ALIGN_LEFT: 'textAlignLeft',
85
+ TEXT_ALIGN_RIGHT: 'textAlignRight',
86
+ TEXT_ALIGN_CENTER: 'textAlignCenter',
87
+ HORIZONTAL_RULE: 'horizontalRule',
88
+ LINK: 'link',
89
+ IMAGE: 'image',
90
+ TABLE: 'table',
91
+ BOLD: 'bold',
92
+ CODE: 'code',
93
+ ITALIC: 'italic',
94
+ STRIKE: 'strike',
95
+ UNDERLINE: 'underline',
96
+ UNDO: 'undo',
97
+ REDO: 'redo',
98
+ SAVE: 'save',
99
+ CLEAR_FORMATTING: 'clearFormatting',
100
+ HARD_BREAK: 'hardBreak',
101
+ INSERT_TABLE: 'insertTable',
102
+ DELETE_TABLE: 'deleteTable',
103
+ ADD_COLUMN_BEFORE: 'addColumnBefore',
104
+ ADD_COLUMN_AFTER: 'addColumnAfter',
105
+ DELETE_COLUMN: 'deleteColumn',
106
+ ADD_ROW_BEFORE: 'addRowBefore',
107
+ ADD_ROW_AFTER: 'addRowAfter',
108
+ DELETE_ROW: 'deleteRow',
109
+ MERGE_CELLS: 'mergeCells',
110
+ SPLIT_CELL: 'splitCell',
111
+ TOGGLE_HEADER_COLUMN: 'toggleHeaderColumn',
112
+ TOGGLE_HEADER_ROW: 'toggleHeaderRow',
113
+ ALIGN_V_TOP: 'alignVTop',
114
+ ALIGN_V_MID: 'alignVMid',
115
+ ALIGN_V_BOT: 'alignVBot',
116
+ TOGGLE_BORDERS: 'toggleBorders',
117
+ TOGGLE_ZEBRA: 'toggleZebra',
118
+ INSERT_IMAGE: 'insertImage'
119
+ }>;