goodteditor-ui 1.0.26 → 1.0.28
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/.eslintrc.js +7 -7
- package/.prettierrc +14 -14
- package/README.md +35 -35
- package/babel.config.js +5 -5
- package/index.js +53 -53
- package/jsconfig.json +13 -13
- package/package.json +67 -67
- package/src/App.vue +36 -36
- package/src/components/ui/Avatar.md +68 -68
- package/src/components/ui/Avatar.vue +180 -180
- package/src/components/ui/Badge.md +20 -20
- package/src/components/ui/Badge.vue +75 -75
- package/src/components/ui/Collapse.md +90 -90
- package/src/components/ui/Collapse.vue +86 -86
- package/src/components/ui/ColorPicker/Alpha.vue +114 -114
- package/src/components/ui/ColorPicker/Colors.vue +117 -117
- package/src/components/ui/ColorPicker/Hue.vue +113 -113
- package/src/components/ui/ColorPicker/Preview.vue +55 -55
- package/src/components/ui/ColorPicker/Saturation.vue +123 -123
- package/src/components/ui/ColorPicker/mixin.js +105 -105
- package/src/components/ui/ColorPicker.md +17 -17
- package/src/components/ui/ColorPicker.vue +314 -314
- package/src/components/ui/Datalist.md +41 -41
- package/src/components/ui/Datalist.vue +164 -164
- package/src/components/ui/DatePicker.md +168 -168
- package/src/components/ui/DatePicker.vue +527 -527
- package/src/components/ui/FileSelector.md +105 -105
- package/src/components/ui/FileSelector.vue +82 -82
- package/src/components/ui/Grid.md +130 -130
- package/src/components/ui/Grid.vue +92 -92
- package/src/components/ui/Image.md +59 -59
- package/src/components/ui/Image.vue +57 -57
- package/src/components/ui/InputAutocomplete.md +115 -115
- package/src/components/ui/InputAutocomplete.vue +374 -349
- package/src/components/ui/InputColorPicker.md +51 -51
- package/src/components/ui/InputColorPicker.vue +151 -151
- package/src/components/ui/InputDatePicker.md +121 -121
- package/src/components/ui/InputDatePicker.vue +326 -326
- package/src/components/ui/InputTags.md +51 -51
- package/src/components/ui/InputTags.vue +184 -184
- package/src/components/ui/InputTimePicker.md +25 -25
- package/src/components/ui/InputTimePicker.vue +253 -253
- package/src/components/ui/InputUnits.md +20 -20
- package/src/components/ui/InputUnits.vue +257 -257
- package/src/components/ui/Lazy.md +37 -37
- package/src/components/ui/Lazy.vue +92 -92
- package/src/components/ui/Pagination.md +74 -74
- package/src/components/ui/Pagination.vue +138 -138
- package/src/components/ui/Paginator.md +34 -34
- package/src/components/ui/Paginator.vue +83 -83
- package/src/components/ui/Popover.md +34 -34
- package/src/components/ui/Popover.vue +274 -274
- package/src/components/ui/Popup.md +59 -59
- package/src/components/ui/Popup.vue +150 -150
- package/src/components/ui/ResponsiveContainer.md +58 -58
- package/src/components/ui/ResponsiveContainer.vue +99 -99
- package/src/components/ui/Select.md +187 -187
- package/src/components/ui/Select.vue +421 -421
- package/src/components/ui/TimePicker.md +50 -50
- package/src/components/ui/TimePicker.vue +252 -252
- package/src/components/ui/Tooltip.md +54 -54
- package/src/components/ui/Tooltip.vue +113 -113
- package/src/components/ui/WysiwygEditor/WysiwygEditor.d.ts +128 -128
- package/src/components/ui/WysiwygEditor/constants.js +273 -273
- package/src/components/ui/WysiwygEditor/extensions/blockquote.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/bold.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/bullet-list.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/code-block.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/code.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/font-size.js +34 -34
- package/src/components/ui/WysiwygEditor/extensions/formatting.js +14 -14
- package/src/components/ui/WysiwygEditor/extensions/heading.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/horizontal-rule.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/image.js +37 -33
- package/src/components/ui/WysiwygEditor/extensions/index.d.ts +32 -32
- package/src/components/ui/WysiwygEditor/extensions/index.js +32 -32
- package/src/components/ui/WysiwygEditor/extensions/italic.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/link.js +16 -16
- package/src/components/ui/WysiwygEditor/extensions/list-item.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/ordered-list.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/paragraph.js +23 -23
- package/src/components/ui/WysiwygEditor/extensions/strike.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/table-cell.js +13 -13
- package/src/components/ui/WysiwygEditor/extensions/table-header.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/table-row.js +15 -15
- package/src/components/ui/WysiwygEditor/extensions/table.js +29 -29
- package/src/components/ui/WysiwygEditor/extensions/text-align.js +6 -6
- package/src/components/ui/WysiwygEditor/extensions/text-style.js +12 -12
- package/src/components/ui/WysiwygEditor/extensions/underline.js +15 -15
- package/src/components/ui/WysiwygEditor/index.d.ts +4 -4
- package/src/components/ui/WysiwygEditor/index.js +4 -4
- package/src/components/ui/WysiwygEditor/renders/Button.vue +28 -28
- package/src/components/ui/WysiwygEditor/renders/ColorPicker.vue +41 -41
- package/src/components/ui/WysiwygEditor/renders/Image.vue +200 -162
- package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +34 -34
- package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +37 -37
- package/src/components/ui/WysiwygEditor/renders/Link.vue +82 -82
- package/src/components/ui/WysiwygEditor/renders/Select.vue +47 -47
- package/src/components/ui/WysiwygEditor/renders/ToolbarPopover.vue +49 -49
- package/src/components/ui/WysiwygEditor/renders/components/Popover.vue +15 -0
- package/src/components/ui/WysiwygEditor/renders/components/WithPopover.vue +35 -35
- package/src/components/ui/WysiwygEditor/renders/index.d.ts +8 -8
- package/src/components/ui/WysiwygEditor/renders/index.js +8 -8
- package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +39 -39
- package/src/components/ui/WysiwygEditor/renders/mixins/index.js +1 -1
- package/src/components/ui/WysiwygEditor/tools-and-commands.js +709 -702
- package/src/components/ui/WysiwygEditor/utils.js +72 -72
- package/src/components/ui/WysiwygEditor.md +18 -18
- package/src/components/ui/WysiwygEditor.vue +266 -266
- package/src/components/ui/utils/FormComponent.js +107 -107
- package/src/components/ui/utils/Helpers.js +84 -84
- package/src/components/ui/utils/WithPopover.js +81 -81
- package/src/main.js +8 -8
- package/styleguide.config.js +37 -37
- package/vue.config.js +8 -8
- package/dist/js.png +0 -0
|
@@ -1,54 +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
|
-
```
|
|
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,128 +1,128 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Button,
|
|
3
|
-
Select,
|
|
4
|
-
InputUnits,
|
|
5
|
-
ColorPicker,
|
|
6
|
-
ToolbarPopover,
|
|
7
|
-
InputAuto,
|
|
8
|
-
Link,
|
|
9
|
-
Image
|
|
10
|
-
} from './renders';
|
|
11
|
-
|
|
12
|
-
export type Render = Readonly<{
|
|
13
|
-
BUTTON: Button;
|
|
14
|
-
COLOR_PICKER: ColorPicker;
|
|
15
|
-
INPUT_UNITS: InputUnits;
|
|
16
|
-
SELECT: Select;
|
|
17
|
-
TOOLBAR_POPOVER: ToolbarPopover;
|
|
18
|
-
INPUT_AUTO: InputAuto;
|
|
19
|
-
LINK: Link;
|
|
20
|
-
IMAGE: Image;
|
|
21
|
-
}>;
|
|
22
|
-
|
|
23
|
-
export type CommandDef = {
|
|
24
|
-
name: String;
|
|
25
|
-
title: String;
|
|
26
|
-
exec: () => void;
|
|
27
|
-
isActive: () => Boolean;
|
|
28
|
-
isEnabled: () => Boolean;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
export type ToolDef = {
|
|
32
|
-
name: String;
|
|
33
|
-
render: Render;
|
|
34
|
-
title: String;
|
|
35
|
-
icon: String;
|
|
36
|
-
exec: (value?: String | Record<String, any>) => void;
|
|
37
|
-
isActive: () => Boolean;
|
|
38
|
-
isEnabled: () => Boolean;
|
|
39
|
-
getValue?: () => String | Record<String, any>;
|
|
40
|
-
options?: Array<String | ToolDef | CommandDef>;
|
|
41
|
-
units?: Array<String>
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export type NodeType = Readonly<{
|
|
45
|
-
BLOCKQUOTE: 'blockquote',
|
|
46
|
-
BULLET_LIST: 'bulletList',
|
|
47
|
-
CODE_BLOCK: 'codeBlock',
|
|
48
|
-
DOCUMENT: 'document',
|
|
49
|
-
HARD_BREAK: 'hardBreak',
|
|
50
|
-
HEADING: 'heading',
|
|
51
|
-
HORIZONTAL_RULE: 'horizontalRule',
|
|
52
|
-
IMAGE: 'image',
|
|
53
|
-
LIST_ITEM: 'listItem',
|
|
54
|
-
ORDERED_LIST: 'orderedList',
|
|
55
|
-
PARAGRAPH: 'paragraph',
|
|
56
|
-
TABLE: 'table',
|
|
57
|
-
TABLE_ROW: 'tableRow',
|
|
58
|
-
TABLE_CELL: 'tableCell',
|
|
59
|
-
TEXT: 'text'
|
|
60
|
-
}>;
|
|
61
|
-
|
|
62
|
-
export type MarkType = Readonly<{
|
|
63
|
-
BOLD: 'bold',
|
|
64
|
-
CODE: 'code',
|
|
65
|
-
ITALIC: 'italic',
|
|
66
|
-
LINK: 'link',
|
|
67
|
-
STRIKE: 'strike',
|
|
68
|
-
UNDERLINE: 'underline',
|
|
69
|
-
TEXT_STYLE: 'textStyle'
|
|
70
|
-
}>;
|
|
71
|
-
|
|
72
|
-
export type CommandType = Readonly<{
|
|
73
|
-
PARAGRAPH: 'paragraph',
|
|
74
|
-
HEADING_1: 'heading1',
|
|
75
|
-
HEADING_2: 'heading2',
|
|
76
|
-
HEADING_3: 'heading3',
|
|
77
|
-
HEADING_4: 'heading4',
|
|
78
|
-
TEXT_SMALL: 'textSmall',
|
|
79
|
-
TEXT_XSMALL: 'textXsmall',
|
|
80
|
-
CODE_BLOCK: 'codeBlock',
|
|
81
|
-
SINK_LIST_ITEM: 'sinkListItem',
|
|
82
|
-
LIFT_LIST_ITEM: 'liftListItem'
|
|
83
|
-
}>;
|
|
84
|
-
|
|
85
|
-
export type ToolType = Readonly<{
|
|
86
|
-
PARAGRAPH_STYLE: 'paragraphStyle',
|
|
87
|
-
FONT_SIZE: 'fontSize',
|
|
88
|
-
FONT_FAMILY: 'fontFamily',
|
|
89
|
-
TEXT_COLOR: 'textColor',
|
|
90
|
-
BLOCKQUOTE: 'blockquote',
|
|
91
|
-
ORDERED_LIST: 'orderedList',
|
|
92
|
-
BULLET_LIST: 'bulletList',
|
|
93
|
-
TEXT_ALIGN_LEFT: 'textAlignLeft',
|
|
94
|
-
TEXT_ALIGN_RIGHT: 'textAlignRight',
|
|
95
|
-
TEXT_ALIGN_CENTER: 'textAlignCenter',
|
|
96
|
-
HORIZONTAL_RULE: 'horizontalRule',
|
|
97
|
-
LINK: 'link',
|
|
98
|
-
IMAGE: 'image',
|
|
99
|
-
TABLE: 'table',
|
|
100
|
-
BOLD: 'bold',
|
|
101
|
-
CODE: 'code',
|
|
102
|
-
ITALIC: 'italic',
|
|
103
|
-
STRIKE: 'strike',
|
|
104
|
-
UNDERLINE: 'underline',
|
|
105
|
-
UNDO: 'undo',
|
|
106
|
-
REDO: 'redo',
|
|
107
|
-
SAVE: 'save',
|
|
108
|
-
CLEAR_FORMATTING: 'clearFormatting',
|
|
109
|
-
HARD_BREAK: 'hardBreak',
|
|
110
|
-
INSERT_TABLE: 'insertTable',
|
|
111
|
-
DELETE_TABLE: 'deleteTable',
|
|
112
|
-
ADD_COLUMN_BEFORE: 'addColumnBefore',
|
|
113
|
-
ADD_COLUMN_AFTER: 'addColumnAfter',
|
|
114
|
-
DELETE_COLUMN: 'deleteColumn',
|
|
115
|
-
ADD_ROW_BEFORE: 'addRowBefore',
|
|
116
|
-
ADD_ROW_AFTER: 'addRowAfter',
|
|
117
|
-
DELETE_ROW: 'deleteRow',
|
|
118
|
-
MERGE_CELLS: 'mergeCells',
|
|
119
|
-
SPLIT_CELL: 'splitCell',
|
|
120
|
-
TOGGLE_HEADER_COLUMN: 'toggleHeaderColumn',
|
|
121
|
-
TOGGLE_HEADER_ROW: 'toggleHeaderRow',
|
|
122
|
-
ALIGN_V_TOP: 'alignVTop',
|
|
123
|
-
ALIGN_V_MID: 'alignVMid',
|
|
124
|
-
ALIGN_V_BOT: 'alignVBot',
|
|
125
|
-
TOGGLE_BORDERS: 'toggleBorders',
|
|
126
|
-
TOGGLE_ZEBRA: 'toggleZebra',
|
|
127
|
-
INSERT_IMAGE: 'insertImage'
|
|
128
|
-
}>;
|
|
1
|
+
import {
|
|
2
|
+
Button,
|
|
3
|
+
Select,
|
|
4
|
+
InputUnits,
|
|
5
|
+
ColorPicker,
|
|
6
|
+
ToolbarPopover,
|
|
7
|
+
InputAuto,
|
|
8
|
+
Link,
|
|
9
|
+
Image
|
|
10
|
+
} from './renders';
|
|
11
|
+
|
|
12
|
+
export type Render = Readonly<{
|
|
13
|
+
BUTTON: Button;
|
|
14
|
+
COLOR_PICKER: ColorPicker;
|
|
15
|
+
INPUT_UNITS: InputUnits;
|
|
16
|
+
SELECT: Select;
|
|
17
|
+
TOOLBAR_POPOVER: ToolbarPopover;
|
|
18
|
+
INPUT_AUTO: InputAuto;
|
|
19
|
+
LINK: Link;
|
|
20
|
+
IMAGE: Image;
|
|
21
|
+
}>;
|
|
22
|
+
|
|
23
|
+
export type CommandDef = {
|
|
24
|
+
name: String;
|
|
25
|
+
title: String;
|
|
26
|
+
exec: () => void;
|
|
27
|
+
isActive: () => Boolean;
|
|
28
|
+
isEnabled: () => Boolean;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export type ToolDef = {
|
|
32
|
+
name: String;
|
|
33
|
+
render: Render;
|
|
34
|
+
title: String;
|
|
35
|
+
icon: String;
|
|
36
|
+
exec: (value?: String | Record<String, any>) => void;
|
|
37
|
+
isActive: () => Boolean;
|
|
38
|
+
isEnabled: () => Boolean;
|
|
39
|
+
getValue?: () => String | Record<String, any>;
|
|
40
|
+
options?: Array<String | ToolDef | CommandDef>;
|
|
41
|
+
units?: Array<String>
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export type NodeType = Readonly<{
|
|
45
|
+
BLOCKQUOTE: 'blockquote',
|
|
46
|
+
BULLET_LIST: 'bulletList',
|
|
47
|
+
CODE_BLOCK: 'codeBlock',
|
|
48
|
+
DOCUMENT: 'document',
|
|
49
|
+
HARD_BREAK: 'hardBreak',
|
|
50
|
+
HEADING: 'heading',
|
|
51
|
+
HORIZONTAL_RULE: 'horizontalRule',
|
|
52
|
+
IMAGE: 'image',
|
|
53
|
+
LIST_ITEM: 'listItem',
|
|
54
|
+
ORDERED_LIST: 'orderedList',
|
|
55
|
+
PARAGRAPH: 'paragraph',
|
|
56
|
+
TABLE: 'table',
|
|
57
|
+
TABLE_ROW: 'tableRow',
|
|
58
|
+
TABLE_CELL: 'tableCell',
|
|
59
|
+
TEXT: 'text'
|
|
60
|
+
}>;
|
|
61
|
+
|
|
62
|
+
export type MarkType = Readonly<{
|
|
63
|
+
BOLD: 'bold',
|
|
64
|
+
CODE: 'code',
|
|
65
|
+
ITALIC: 'italic',
|
|
66
|
+
LINK: 'link',
|
|
67
|
+
STRIKE: 'strike',
|
|
68
|
+
UNDERLINE: 'underline',
|
|
69
|
+
TEXT_STYLE: 'textStyle'
|
|
70
|
+
}>;
|
|
71
|
+
|
|
72
|
+
export type CommandType = Readonly<{
|
|
73
|
+
PARAGRAPH: 'paragraph',
|
|
74
|
+
HEADING_1: 'heading1',
|
|
75
|
+
HEADING_2: 'heading2',
|
|
76
|
+
HEADING_3: 'heading3',
|
|
77
|
+
HEADING_4: 'heading4',
|
|
78
|
+
TEXT_SMALL: 'textSmall',
|
|
79
|
+
TEXT_XSMALL: 'textXsmall',
|
|
80
|
+
CODE_BLOCK: 'codeBlock',
|
|
81
|
+
SINK_LIST_ITEM: 'sinkListItem',
|
|
82
|
+
LIFT_LIST_ITEM: 'liftListItem'
|
|
83
|
+
}>;
|
|
84
|
+
|
|
85
|
+
export type ToolType = Readonly<{
|
|
86
|
+
PARAGRAPH_STYLE: 'paragraphStyle',
|
|
87
|
+
FONT_SIZE: 'fontSize',
|
|
88
|
+
FONT_FAMILY: 'fontFamily',
|
|
89
|
+
TEXT_COLOR: 'textColor',
|
|
90
|
+
BLOCKQUOTE: 'blockquote',
|
|
91
|
+
ORDERED_LIST: 'orderedList',
|
|
92
|
+
BULLET_LIST: 'bulletList',
|
|
93
|
+
TEXT_ALIGN_LEFT: 'textAlignLeft',
|
|
94
|
+
TEXT_ALIGN_RIGHT: 'textAlignRight',
|
|
95
|
+
TEXT_ALIGN_CENTER: 'textAlignCenter',
|
|
96
|
+
HORIZONTAL_RULE: 'horizontalRule',
|
|
97
|
+
LINK: 'link',
|
|
98
|
+
IMAGE: 'image',
|
|
99
|
+
TABLE: 'table',
|
|
100
|
+
BOLD: 'bold',
|
|
101
|
+
CODE: 'code',
|
|
102
|
+
ITALIC: 'italic',
|
|
103
|
+
STRIKE: 'strike',
|
|
104
|
+
UNDERLINE: 'underline',
|
|
105
|
+
UNDO: 'undo',
|
|
106
|
+
REDO: 'redo',
|
|
107
|
+
SAVE: 'save',
|
|
108
|
+
CLEAR_FORMATTING: 'clearFormatting',
|
|
109
|
+
HARD_BREAK: 'hardBreak',
|
|
110
|
+
INSERT_TABLE: 'insertTable',
|
|
111
|
+
DELETE_TABLE: 'deleteTable',
|
|
112
|
+
ADD_COLUMN_BEFORE: 'addColumnBefore',
|
|
113
|
+
ADD_COLUMN_AFTER: 'addColumnAfter',
|
|
114
|
+
DELETE_COLUMN: 'deleteColumn',
|
|
115
|
+
ADD_ROW_BEFORE: 'addRowBefore',
|
|
116
|
+
ADD_ROW_AFTER: 'addRowAfter',
|
|
117
|
+
DELETE_ROW: 'deleteRow',
|
|
118
|
+
MERGE_CELLS: 'mergeCells',
|
|
119
|
+
SPLIT_CELL: 'splitCell',
|
|
120
|
+
TOGGLE_HEADER_COLUMN: 'toggleHeaderColumn',
|
|
121
|
+
TOGGLE_HEADER_ROW: 'toggleHeaderRow',
|
|
122
|
+
ALIGN_V_TOP: 'alignVTop',
|
|
123
|
+
ALIGN_V_MID: 'alignVMid',
|
|
124
|
+
ALIGN_V_BOT: 'alignVBot',
|
|
125
|
+
TOGGLE_BORDERS: 'toggleBorders',
|
|
126
|
+
TOGGLE_ZEBRA: 'toggleZebra',
|
|
127
|
+
INSERT_IMAGE: 'insertImage'
|
|
128
|
+
}>;
|