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,29 +1,29 @@
1
- import { Table as TableToExtend } from '@tiptap/extension-table';
2
- import { NodeType } from '../constants';
3
-
4
- export const Table = TableToExtend.extend({
5
- addAttributes() {
6
- return {
7
- ...this.parent?.(),
8
- class: {
9
- default: 'table table-vtop table-borders table-zebra w-100'
10
- },
11
- style: null
12
- };
13
- },
14
- addCommands() {
15
- return {
16
- ...this.parent?.(),
17
- toggleTableAlignment: (className, tableClassNames) => ({ commands }) => {
18
- const classNames = tableClassNames.replace(/table-v(top|bot|mid)\s?/, '');
19
- return commands.updateAttributes(NodeType.TABLE, { class: `${classNames} ${className}` });
20
- },
21
- toggleTableClass: (className, tableClassNames) => ({ commands }) => {
22
- const classNames = tableClassNames.includes(className)
23
- ? tableClassNames.split(' ').filter((name) => name !== className).join(' ')
24
- : `${tableClassNames} ${className}`;
25
- return commands.updateAttributes(NodeType.TABLE, { class: classNames });
26
- }
27
- };
28
- }
29
- });
1
+ import { Table as TableToExtend } from '@tiptap/extension-table';
2
+ import { NodeType } from '../constants';
3
+
4
+ export const Table = TableToExtend.extend({
5
+ addAttributes() {
6
+ return {
7
+ ...this.parent?.(),
8
+ class: {
9
+ default: 'table table-vtop table-borders table-zebra w-100'
10
+ },
11
+ style: null
12
+ };
13
+ },
14
+ addCommands() {
15
+ return {
16
+ ...this.parent?.(),
17
+ toggleTableAlignment: (className, tableClassNames) => ({ commands }) => {
18
+ const classNames = tableClassNames.replace(/table-v(top|bot|mid)\s?/, '');
19
+ return commands.updateAttributes(NodeType.TABLE, { class: `${classNames} ${className}` });
20
+ },
21
+ toggleTableClass: (className, tableClassNames) => ({ commands }) => {
22
+ const classNames = tableClassNames.includes(className)
23
+ ? tableClassNames.split(' ').filter((name) => name !== className).join(' ')
24
+ : `${tableClassNames} ${className}`;
25
+ return commands.updateAttributes(NodeType.TABLE, { class: classNames });
26
+ }
27
+ };
28
+ }
29
+ });
@@ -1,6 +1,6 @@
1
- import { TextAlign as TextAlignToExtend } from '@tiptap/extension-text-align';
2
- import { NodeType, MarkType } from '../constants';
3
-
4
- export const TextAlign = TextAlignToExtend.configure({
5
- types: [NodeType.HEADING, NodeType.PARAGRAPH, MarkType.LINK, NodeType.CODE_BLOCK, NodeType.BLOCKQUOTE]
6
- });
1
+ import { TextAlign as TextAlignToExtend } from '@tiptap/extension-text-align';
2
+ import { NodeType, MarkType } from '../constants';
3
+
4
+ export const TextAlign = TextAlignToExtend.configure({
5
+ types: [NodeType.HEADING, NodeType.PARAGRAPH, MarkType.LINK, NodeType.CODE_BLOCK, NodeType.BLOCKQUOTE]
6
+ });
@@ -1,15 +1,15 @@
1
- import { TextStyle as TextStyleToExtend } from '@tiptap/extension-text-style';
2
-
3
- export const TextStyle = TextStyleToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: null
9
- },
10
- style: {
11
- default: null
12
- }
13
- }
14
- }
15
- })
1
+ import { TextStyle as TextStyleToExtend } from '@tiptap/extension-text-style';
2
+
3
+ export const TextStyle = TextStyleToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ })
@@ -1,15 +1,15 @@
1
- import { Underline as UnderlineToExtend } from '@tiptap/extension-underline';
2
-
3
- export const Underline = UnderlineToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: null
9
- },
10
- style: {
11
- default: null
12
- }
13
- }
14
- }
15
- })
1
+ import { Underline as UnderlineToExtend } from '@tiptap/extension-underline';
2
+
3
+ export const Underline = UnderlineToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ })
@@ -1,4 +1,4 @@
1
- export { default as WysiwygEditor } from '../WysiwygEditor.vue';
2
- export * from './constants'
3
- export * from './utils'
4
- export * from './tools-and-commands';
1
+ export { default as WysiwygEditor } from '../WysiwygEditor.vue';
2
+ export * from './constants'
3
+ export * from './utils'
4
+ export * from './tools-and-commands';
@@ -1,4 +1,4 @@
1
- export { default as WysiwygEditor } from '../WysiwygEditor.vue';
2
- export * from './constants'
3
- export * from './utils'
4
- export * from './tools-and-commands';
1
+ export { default as WysiwygEditor } from '../WysiwygEditor.vue';
2
+ export * from './constants'
3
+ export * from './utils'
4
+ export * from './tools-and-commands';
@@ -1,28 +1,28 @@
1
- <template>
2
- <div :title="title">
3
- <button
4
- :class="{ 'btn-outline': !isActive, 'btn-primary': isActive }"
5
- :disabled="!isEnabled"
6
- class="btn btn-small btn-icon"
7
- @click.stop="onClick">
8
- <div class="icon">
9
- <i :class="icon" class="mdi"></i>
10
- </div>
11
- </button>
12
- </div>
13
-
14
- </template>
15
-
16
- <script>
17
- import { useRender } from './mixins';
18
-
19
- export default {
20
- mixins: [useRender()],
21
- methods: {
22
- onClick() {
23
- this.tool.exec();
24
- this.emitExecuted();
25
- }
26
- }
27
- };
28
- </script>
1
+ <template>
2
+ <div :title="title">
3
+ <button
4
+ :class="{ 'btn-outline': !isActive, 'btn-primary': isActive }"
5
+ :disabled="!isEnabled"
6
+ class="btn btn-small btn-icon"
7
+ @click.stop="onClick">
8
+ <div class="icon">
9
+ <i :class="icon" class="mdi"></i>
10
+ </div>
11
+ </button>
12
+ </div>
13
+
14
+ </template>
15
+
16
+ <script>
17
+ import { useRender } from './mixins';
18
+
19
+ export default {
20
+ mixins: [useRender()],
21
+ methods: {
22
+ onClick() {
23
+ this.tool.exec();
24
+ this.emitExecuted();
25
+ }
26
+ }
27
+ };
28
+ </script>
@@ -1,41 +1,41 @@
1
- <template>
2
- <div :data-popover="popoverTargetId" :title="title">
3
- <button
4
- class="btn btn-small btn-outline btn-icon"
5
- @click="togglePopover">
6
- <div class="icon">
7
- <i class="mdi" :class="icon"></i>
8
- </div>
9
- </button>
10
- <popover :show.sync="popoverShow" v-bind="popoverOptions">
11
- <color-picker class="pull-left" v-bind="{ value, showSubmit: true }" @submit="onSubmit" />
12
- </popover>
13
- </div>
14
- </template>
15
-
16
- <script>
17
- import ColorPicker from '../../ColorPicker.vue';
18
- import Popover from '../../Popover.vue';
19
- import WithPopover from '../../utils/WithPopover';
20
- import { useRender } from './mixins';
21
-
22
- export default {
23
- components: { ColorPicker, Popover },
24
- mixins: [useRender(), WithPopover],
25
- computed: {
26
- value() {
27
- return this.tool.getValue();
28
- }
29
- },
30
- methods: {
31
- onSubmit({ rgba }) {
32
- const { r: red, g: green, b: blue, a: alpha } = rgba;
33
- const color = `rgba(${red}, ${green}, ${blue}, ${alpha})`;
34
-
35
- this.tool.exec(color);
36
- this.popoverShow = false;
37
- this.emitExecuted();
38
- }
39
- }
40
- };
41
- </script>
1
+ <template>
2
+ <div :data-popover="popoverTargetId" :title="title">
3
+ <button
4
+ class="btn btn-small btn-outline btn-icon"
5
+ @click="togglePopover">
6
+ <div class="icon">
7
+ <i class="mdi" :class="icon"></i>
8
+ </div>
9
+ </button>
10
+ <popover :show.sync="popoverShow" v-bind="popoverOptions">
11
+ <color-picker class="pull-left" v-bind="{ value, showSubmit: true }" @submit="onSubmit" />
12
+ </popover>
13
+ </div>
14
+ </template>
15
+
16
+ <script>
17
+ import ColorPicker from '../../ColorPicker.vue';
18
+ import Popover from '../../Popover.vue';
19
+ import WithPopover from '../../utils/WithPopover';
20
+ import { useRender } from './mixins';
21
+
22
+ export default {
23
+ components: { ColorPicker, Popover },
24
+ mixins: [useRender(), WithPopover],
25
+ computed: {
26
+ value() {
27
+ return this.tool.getValue();
28
+ }
29
+ },
30
+ methods: {
31
+ onSubmit({ rgba }) {
32
+ const { r: red, g: green, b: blue, a: alpha } = rgba;
33
+ const color = `rgba(${red}, ${green}, ${blue}, ${alpha})`;
34
+
35
+ this.tool.exec(color);
36
+ this.popoverShow = false;
37
+ this.emitExecuted();
38
+ }
39
+ }
40
+ };
41
+ </script>
@@ -1,34 +1,34 @@
1
- <template>
2
- <div :title="title" class="autocomplete-tool">
3
- <input-autocomplete
4
- v-bind="{ value, options: tool.options, disabled: !isEnabled, size: 'small' }"
5
- @input="onInput" />
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import InputAutocomplete from '../../InputAutocomplete.vue';
11
- import { useRender } from './mixins';
12
-
13
- export default {
14
- components: { InputAutocomplete },
15
- mixins: [useRender()],
16
- computed: {
17
- value() {
18
- return this.tool.getValue() ?? '';
19
- }
20
- },
21
- methods: {
22
- onInput(value) {
23
- this.tool.exec(value);
24
- this.emitExecuted();
25
- }
26
- }
27
- };
28
- </script>
29
-
30
- <style scoped>
31
- .autocomplete-tool {
32
- width: 10rem;
33
- }
34
- </style>
1
+ <template>
2
+ <div :title="title" class="autocomplete-tool">
3
+ <input-autocomplete
4
+ v-bind="{ value, options: tool.options, disabled: !isEnabled, size: 'small' }"
5
+ @input="onInput" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import InputAutocomplete from '../../InputAutocomplete.vue';
11
+ import { useRender } from './mixins';
12
+
13
+ export default {
14
+ components: { InputAutocomplete },
15
+ mixins: [useRender()],
16
+ computed: {
17
+ value() {
18
+ return this.tool.getValue() ?? '';
19
+ }
20
+ },
21
+ methods: {
22
+ onInput(value) {
23
+ this.tool.exec(value);
24
+ this.emitExecuted();
25
+ }
26
+ }
27
+ };
28
+ </script>
29
+
30
+ <style scoped>
31
+ .autocomplete-tool {
32
+ width: 10rem;
33
+ }
34
+ </style>
@@ -1,35 +1,35 @@
1
- <template>
2
- <div :title="title" class="form-control form-control-icon-right w-12-12">
3
- <input-autocomplete
4
- v-bind="{ value, disabled: !isEnabled, size: 'small' }"
5
- @change="onChange" />
6
- <div class="icon">
7
- <i class="mdi mdi-folder cursor-pointer color-grey" @click="browse" />
8
- </div>
9
- </div>
10
- </template>
11
-
12
- <script>
13
- import InputAutocomplete from '../../InputAutocomplete.vue';
14
- import { useRender } from './mixins';
15
-
16
- export default {
17
- components: { InputAutocomplete },
18
- mixins: [useRender()],
19
- computed: {
20
- value() {
21
- return this.tool.getValue();
22
- }
23
- },
24
- methods: {
25
- onChange(value) {
26
- this.tool.exec(value);
27
- this.emitExecuted();
28
- },
29
- async browse() {
30
- await this.tool.exec();
31
- this.emitExecuted();
32
- }
33
- }
34
- };
35
- </script>
1
+ <template>
2
+ <div :title="title" class="form-control form-control-icon-right w-12-12">
3
+ <input-autocomplete
4
+ v-bind="{ value, disabled: !isEnabled, size: 'small' }"
5
+ @change="onChange" />
6
+ <div class="icon">
7
+ <i class="mdi mdi-folder cursor-pointer color-grey" @click="browse" />
8
+ </div>
9
+ </div>
10
+ </template>
11
+
12
+ <script>
13
+ import InputAutocomplete from '../../InputAutocomplete.vue';
14
+ import { useRender } from './mixins';
15
+
16
+ export default {
17
+ components: { InputAutocomplete },
18
+ mixins: [useRender()],
19
+ computed: {
20
+ value() {
21
+ return this.tool.getValue();
22
+ }
23
+ },
24
+ methods: {
25
+ onChange(value) {
26
+ this.tool.exec(value);
27
+ this.emitExecuted();
28
+ },
29
+ async browse() {
30
+ await this.tool.exec();
31
+ this.emitExecuted();
32
+ }
33
+ }
34
+ };
35
+ </script>
@@ -1,38 +1,38 @@
1
- <template>
2
- <div :title="title" class="input-units-tool">
3
- <input-units
4
- v-bind="{ value, units, size: 'small', disabled: !isEnabled }"
5
- @change="onChange" />
6
- </div>
7
- </template>
8
-
9
- <script>
10
- import InputUnits from '../../InputUnits.vue';
11
-
12
- import { useRender } from './mixins';
13
-
14
- export default {
15
- components: { InputUnits },
16
- mixins: [useRender()],
17
- computed: {
18
- value() {
19
- return this.tool.getValue();
20
- },
21
- units() {
22
- return this.tool?.units ?? [];
23
- }
24
- },
25
- methods: {
26
- onChange(value) {
27
- this.tool.exec(value);
28
- this.emitExecuted();
29
- }
30
- }
31
- };
32
- </script>
33
-
34
- <style scoped>
35
- .input-units-tool {
36
- width: 4rem;
37
- }
38
- </style>
1
+ <template>
2
+ <div :title="title" class="input-units-tool">
3
+ <input-units
4
+ v-bind="{ value, units, size: 'small', disabled: !isEnabled }"
5
+ @change="onChange" />
6
+ </div>
7
+ </template>
8
+
9
+ <script>
10
+ import InputUnits from '../../InputUnits.vue';
11
+
12
+ import { useRender } from './mixins';
13
+
14
+ export default {
15
+ components: { InputUnits },
16
+ mixins: [useRender()],
17
+ computed: {
18
+ value() {
19
+ return this.tool.getValue();
20
+ },
21
+ units() {
22
+ return this.tool?.units ?? [];
23
+ }
24
+ },
25
+ methods: {
26
+ onChange(value) {
27
+ this.tool.exec(value);
28
+ this.emitExecuted();
29
+ }
30
+ }
31
+ };
32
+ </script>
33
+
34
+ <style scoped>
35
+ .input-units-tool {
36
+ width: 4rem;
37
+ }
38
+ </style>