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.
Files changed (116) 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 +67 -67
  8. package/src/App.vue +36 -36
  9. package/src/components/ui/Avatar.md +68 -68
  10. package/src/components/ui/Avatar.vue +180 -180
  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 +164 -164
  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 +374 -349
  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 -54
  62. package/src/components/ui/Tooltip.vue +113 -113
  63. package/src/components/ui/WysiwygEditor/WysiwygEditor.d.ts +128 -128
  64. package/src/components/ui/WysiwygEditor/constants.js +273 -273
  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 +37 -33
  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 +12 -12
  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/Image.vue +200 -162
  95. package/src/components/ui/WysiwygEditor/renders/InputAuto.vue +34 -34
  96. package/src/components/ui/WysiwygEditor/renders/InputUnits.vue +37 -37
  97. package/src/components/ui/WysiwygEditor/renders/Link.vue +82 -82
  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/components/Popover.vue +15 -0
  101. package/src/components/ui/WysiwygEditor/renders/components/WithPopover.vue +35 -35
  102. package/src/components/ui/WysiwygEditor/renders/index.d.ts +8 -8
  103. package/src/components/ui/WysiwygEditor/renders/index.js +8 -8
  104. package/src/components/ui/WysiwygEditor/renders/mixins/RenderMixin.js +39 -39
  105. package/src/components/ui/WysiwygEditor/renders/mixins/index.js +1 -1
  106. package/src/components/ui/WysiwygEditor/tools-and-commands.js +709 -702
  107. package/src/components/ui/WysiwygEditor/utils.js +72 -72
  108. package/src/components/ui/WysiwygEditor.md +18 -18
  109. package/src/components/ui/WysiwygEditor.vue +266 -266
  110. package/src/components/ui/utils/FormComponent.js +107 -107
  111. package/src/components/ui/utils/Helpers.js +84 -84
  112. package/src/components/ui/utils/WithPopover.js +81 -81
  113. package/src/main.js +8 -8
  114. package/styleguide.config.js +37 -37
  115. package/vue.config.js +8 -8
  116. package/dist/js.png +0 -0
@@ -1,13 +1,13 @@
1
- import { Code as CodeToExtend } from '@tiptap/extension-code';
2
-
3
- export const Code = CodeToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: null
9
- },
10
- style: null
11
- }
12
- }
13
- })
1
+ import { Code as CodeToExtend } from '@tiptap/extension-code';
2
+
3
+ export const Code = CodeToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: null
11
+ }
12
+ }
13
+ })
@@ -1,34 +1,34 @@
1
- import { Extension } from '@tiptap/vue-2';
2
- import { MarkType } from '../constants';
3
-
4
- export const FontSize = Extension.create({
5
- name: 'fontSize',
6
- addOptions() {
7
- return {
8
- types: [MarkType.TEXT_STYLE]
9
- };
10
- },
11
- addGlobalAttributes() {
12
- return [
13
- {
14
- types: this.options.types,
15
- attributes: {
16
- fontSize: {
17
- default: null,
18
- parseHTML: ({ style }) => style.fontSize?.replace(/['"]+/g, ''),
19
- renderHTML: ({ fontSize }) => ({ ...(fontSize && { style: `font-size: ${fontSize}` }) })
20
- }
21
- }
22
- }
23
- ];
24
- },
25
- addCommands() {
26
- return {
27
- setFontSize: fontSize => ({ commands }) => commands.setMark(MarkType.TEXT_STYLE, { fontSize }),
28
- unsetFontSize: () => ({ chain }) => chain()
29
- .setMark(MarkType.TEXT_STYLE, { fontSize: null })
30
- .removeEmptyTextStyle()
31
- .run()
32
- };
33
- }
34
- });
1
+ import { Extension } from '@tiptap/vue-2';
2
+ import { MarkType } from '../constants';
3
+
4
+ export const FontSize = Extension.create({
5
+ name: 'fontSize',
6
+ addOptions() {
7
+ return {
8
+ types: [MarkType.TEXT_STYLE]
9
+ };
10
+ },
11
+ addGlobalAttributes() {
12
+ return [
13
+ {
14
+ types: this.options.types,
15
+ attributes: {
16
+ fontSize: {
17
+ default: null,
18
+ parseHTML: ({ style }) => style.fontSize?.replace(/['"]+/g, ''),
19
+ renderHTML: ({ fontSize }) => ({ ...(fontSize && { style: `font-size: ${fontSize}` }) })
20
+ }
21
+ }
22
+ }
23
+ ];
24
+ },
25
+ addCommands() {
26
+ return {
27
+ setFontSize: fontSize => ({ commands }) => commands.setMark(MarkType.TEXT_STYLE, { fontSize }),
28
+ unsetFontSize: () => ({ chain }) => chain()
29
+ .setMark(MarkType.TEXT_STYLE, { fontSize: null })
30
+ .removeEmptyTextStyle()
31
+ .run()
32
+ };
33
+ }
34
+ });
@@ -1,14 +1,14 @@
1
- import { Extension } from '@tiptap/vue-2';
2
-
3
- export const Formatting = Extension.create({
4
- name: 'formatting',
5
- addCommands() {
6
- return {
7
- clearFormatting: () => ({ chain }) =>
8
- chain()
9
- .clearNodes()
10
- .unsetAllMarks()
11
- .run()
12
- }
13
- }
14
- })
1
+ import { Extension } from '@tiptap/vue-2';
2
+
3
+ export const Formatting = Extension.create({
4
+ name: 'formatting',
5
+ addCommands() {
6
+ return {
7
+ clearFormatting: () => ({ chain }) =>
8
+ chain()
9
+ .clearNodes()
10
+ .unsetAllMarks()
11
+ .run()
12
+ }
13
+ }
14
+ })
@@ -1,13 +1,13 @@
1
- import { Heading as HeadingToExtend } from '@tiptap/extension-heading';
2
-
3
- export const Heading = HeadingToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: null
9
- },
10
- style: null
11
- }
12
- }
13
- })
1
+ import { Heading as HeadingToExtend } from '@tiptap/extension-heading';
2
+
3
+ export const Heading = HeadingToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: null
11
+ }
12
+ }
13
+ })
@@ -1,15 +1,15 @@
1
- import { HorizontalRule as HorizontalRuleToExtend } from '@tiptap/extension-horizontal-rule';
2
-
3
- export const HorizontalRule = HorizontalRuleToExtend.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 { HorizontalRule as HorizontalRuleToExtend } from '@tiptap/extension-horizontal-rule';
2
+
3
+ export const HorizontalRule = HorizontalRuleToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ })
@@ -1,33 +1,37 @@
1
- import { Image as ImageToExtend } from '@tiptap/extension-image';
2
- import { NodeType } from '../constants';
3
-
4
- export const Image = ImageToExtend
5
- .extend({
6
- addAttributes() {
7
- return {
8
- ...this.parent?.(),
9
- class: {
10
- default: 'responsive',
11
- },
12
- style: {
13
- default: null,
14
- },
15
- };
16
- },
17
- addCommands() {
18
- return {
19
- ...this.parent?.(),
20
- toggleResponsive: (value = false) => ({ commands }) => {
21
- value === true
22
- ? commands.updateAttributes(NodeType.IMAGE, { class: 'responsive' })
23
- : commands.updateAttributes(NodeType.IMAGE, { class: null });
24
- },
25
- setStyles: (styles) => ({ commands }) => {
26
- const styleObjToString = () => Object
27
- .entries(styles)
28
- .reduce((acc, [styleName, style]) => `${acc}${styleName}:${style};`, '');
29
- commands.updateAttributes(NodeType.IMAGE, { style: styleObjToString() });
30
- }
31
- };
32
- }
33
- })
1
+ import { Image as ImageToExtend } from '@tiptap/extension-image';
2
+ import { NodeType } from '../constants';
3
+
4
+ export const Image = ImageToExtend
5
+ .extend({
6
+ addAttributes() {
7
+ return {
8
+ ...this.parent?.(),
9
+ class: {
10
+ default: 'responsive',
11
+ },
12
+ style: {
13
+ default: null,
14
+ },
15
+ };
16
+ },
17
+ addCommands() {
18
+ return {
19
+ ...this.parent?.(),
20
+ resetResponsive: (imageClasses) => ({ commands }) => {
21
+ const classes = imageClasses.replace(/responsive\s*/, '');
22
+ return commands.updateAttributes(NodeType.IMAGE, { class: classes })
23
+ },
24
+ setImageAlign: (className, imageClasses) => ({ commands }) => {
25
+ const valueToReplace = className === null ? '' : `${className} `;
26
+ const classes = imageClasses.replace(/(mar-\w+-\w+s*)|/, valueToReplace);
27
+ return commands.updateAttributes(NodeType.IMAGE, { class: classes });
28
+ },
29
+ setStyles: (styles) => ({ commands }) => {
30
+ const styleObjToString = () => Object
31
+ .entries(styles)
32
+ .reduce((acc, [styleName, style]) => `${acc}${styleName}:${style};`, '');
33
+ commands.updateAttributes(NodeType.IMAGE, { style: styleObjToString() });
34
+ }
35
+ };
36
+ }
37
+ });
@@ -1,32 +1,32 @@
1
- export { Document } from '@tiptap/extension-document';
2
- export { Text } from '@tiptap/extension-text';
3
- export { History } from '@tiptap/extension-history';
4
- export { Dropcursor } from '@tiptap/extension-dropcursor';
5
- export { Gapcursor } from '@tiptap/extension-gapcursor';
6
- export { Color } from '@tiptap/extension-color';
7
- export { FontFamily } from '@tiptap/extension-font-family';
8
- export { HardBreak } from '@tiptap/extension-hard-break';
9
-
10
- export { Table } from './table';
11
- export { TableRow } from './table-row';
12
- export { TableCell } from './table-cell';
13
- export { TableHeader } from './table-header';
14
- export { Heading } from './heading';
15
- export { Code } from './code';
16
- export { CodeBlock } from './code-block';
17
- export { Link } from './link';
18
- export { TextAlign } from './text-align';
19
- export { FontSize } from './font-size';
20
- export { Paragraph } from './paragraph';
21
- export { Formatting } from './formatting';
22
- export { TextStyle } from './text-style';
23
- export { Blockquote } from './blockquote';
24
- export { Bold } from './bold';
25
- export { Italic } from './italic';
26
- export { Underline } from './underline';
27
- export { Strike } from './strike';
28
- export { OrderedList } from './ordered-list';
29
- export { BulletList } from './bullet-list';
30
- export { ListItem } from './list-item';
31
- export { Image } from './image';
32
- export { HorizontalRule } from './horizontal-rule';
1
+ export { Document } from '@tiptap/extension-document';
2
+ export { Text } from '@tiptap/extension-text';
3
+ export { History } from '@tiptap/extension-history';
4
+ export { Dropcursor } from '@tiptap/extension-dropcursor';
5
+ export { Gapcursor } from '@tiptap/extension-gapcursor';
6
+ export { Color } from '@tiptap/extension-color';
7
+ export { FontFamily } from '@tiptap/extension-font-family';
8
+ export { HardBreak } from '@tiptap/extension-hard-break';
9
+
10
+ export { Table } from './table';
11
+ export { TableRow } from './table-row';
12
+ export { TableCell } from './table-cell';
13
+ export { TableHeader } from './table-header';
14
+ export { Heading } from './heading';
15
+ export { Code } from './code';
16
+ export { CodeBlock } from './code-block';
17
+ export { Link } from './link';
18
+ export { TextAlign } from './text-align';
19
+ export { FontSize } from './font-size';
20
+ export { Paragraph } from './paragraph';
21
+ export { Formatting } from './formatting';
22
+ export { TextStyle } from './text-style';
23
+ export { Blockquote } from './blockquote';
24
+ export { Bold } from './bold';
25
+ export { Italic } from './italic';
26
+ export { Underline } from './underline';
27
+ export { Strike } from './strike';
28
+ export { OrderedList } from './ordered-list';
29
+ export { BulletList } from './bullet-list';
30
+ export { ListItem } from './list-item';
31
+ export { Image } from './image';
32
+ export { HorizontalRule } from './horizontal-rule';
@@ -1,32 +1,32 @@
1
- export { Document } from '@tiptap/extension-document';
2
- export { Text } from '@tiptap/extension-text';
3
- export { History } from '@tiptap/extension-history';
4
- export { Dropcursor } from '@tiptap/extension-dropcursor';
5
- export { Gapcursor } from '@tiptap/extension-gapcursor';
6
- export { Color } from '@tiptap/extension-color';
7
- export { FontFamily } from '@tiptap/extension-font-family';
8
- export { HardBreak } from '@tiptap/extension-hard-break';
9
-
10
- export { Table } from './table';
11
- export { TableRow } from './table-row';
12
- export { TableCell } from './table-cell';
13
- export { TableHeader } from './table-header';
14
- export { Heading } from './heading';
15
- export { Code } from './code';
16
- export { CodeBlock } from './code-block';
17
- export { Link } from './link';
18
- export { TextAlign } from './text-align';
19
- export { FontSize } from './font-size';
20
- export { Paragraph } from './paragraph';
21
- export { Formatting } from './formatting';
22
- export { TextStyle } from './text-style';
23
- export { Blockquote } from './blockquote';
24
- export { Bold } from './bold';
25
- export { Italic } from './italic';
26
- export { Underline } from './underline';
27
- export { Strike } from './strike';
28
- export { OrderedList } from './ordered-list';
29
- export { BulletList } from './bullet-list';
30
- export { ListItem } from './list-item';
31
- export { Image } from './image';
32
- export { HorizontalRule } from './horizontal-rule';
1
+ export { Document } from '@tiptap/extension-document';
2
+ export { Text } from '@tiptap/extension-text';
3
+ export { History } from '@tiptap/extension-history';
4
+ export { Dropcursor } from '@tiptap/extension-dropcursor';
5
+ export { Gapcursor } from '@tiptap/extension-gapcursor';
6
+ export { Color } from '@tiptap/extension-color';
7
+ export { FontFamily } from '@tiptap/extension-font-family';
8
+ export { HardBreak } from '@tiptap/extension-hard-break';
9
+
10
+ export { Table } from './table';
11
+ export { TableRow } from './table-row';
12
+ export { TableCell } from './table-cell';
13
+ export { TableHeader } from './table-header';
14
+ export { Heading } from './heading';
15
+ export { Code } from './code';
16
+ export { CodeBlock } from './code-block';
17
+ export { Link } from './link';
18
+ export { TextAlign } from './text-align';
19
+ export { FontSize } from './font-size';
20
+ export { Paragraph } from './paragraph';
21
+ export { Formatting } from './formatting';
22
+ export { TextStyle } from './text-style';
23
+ export { Blockquote } from './blockquote';
24
+ export { Bold } from './bold';
25
+ export { Italic } from './italic';
26
+ export { Underline } from './underline';
27
+ export { Strike } from './strike';
28
+ export { OrderedList } from './ordered-list';
29
+ export { BulletList } from './bullet-list';
30
+ export { ListItem } from './list-item';
31
+ export { Image } from './image';
32
+ export { HorizontalRule } from './horizontal-rule';
@@ -1,15 +1,15 @@
1
- import { Italic as ItalicToExtend } from '@tiptap/extension-italic';
2
-
3
- export const Italic = ItalicToExtend.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 { Italic as ItalicToExtend } from '@tiptap/extension-italic';
2
+
3
+ export const Italic = ItalicToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ })
@@ -1,16 +1,16 @@
1
- import { Link as LinkToExtend } from '@tiptap/extension-link';
2
-
3
- export const Link = LinkToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: 'color-link cursor-pointer'
9
- },
10
- style: {
11
- default: null
12
- }
13
- };
14
- }
15
- }
16
- );
1
+ import { Link as LinkToExtend } from '@tiptap/extension-link';
2
+
3
+ export const Link = LinkToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: 'color-link cursor-pointer'
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ };
14
+ }
15
+ }
16
+ );
@@ -1,15 +1,15 @@
1
- import { ListItem as ListItemToExtend } from '@tiptap/extension-list-item';
2
-
3
- export const ListItem = ListItemToExtend.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 { ListItem as ListItemToExtend } from '@tiptap/extension-list-item';
2
+
3
+ export const ListItem = ListItemToExtend.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 { OrderedList as OrderedListToExtend } from '@tiptap/extension-ordered-list';
2
-
3
- export const OrderedList = OrderedListToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: 'list-outside'
9
- },
10
- style: {
11
- default: null
12
- }
13
- }
14
- }
15
- });
1
+ import { OrderedList as OrderedListToExtend } from '@tiptap/extension-ordered-list';
2
+
3
+ export const OrderedList = OrderedListToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: 'list-outside'
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ });
@@ -1,23 +1,23 @@
1
- import { Paragraph as ParagraphToExtend } from '@tiptap/extension-paragraph';
2
- import { NodeType } from '../constants';
3
-
4
- export const Paragraph = ParagraphToExtend.extend({
5
- addAttributes() {
6
- return {
7
- ...this.parent?.(),
8
- class: {
9
- default: 'p'
10
- },
11
- style: {
12
- default: null
13
- }
14
- };
15
- },
16
- addCommands() {
17
- return {
18
- ...this.parent?.(),
19
- setParagraphClass: (className) => ({ commands }) =>
20
- commands.updateAttributes(NodeType.PARAGRAPH, { class: className })
21
- };
22
- }
23
- });
1
+ import { Paragraph as ParagraphToExtend } from '@tiptap/extension-paragraph';
2
+ import { NodeType } from '../constants';
3
+
4
+ export const Paragraph = ParagraphToExtend.extend({
5
+ addAttributes() {
6
+ return {
7
+ ...this.parent?.(),
8
+ class: {
9
+ default: 'p'
10
+ },
11
+ style: {
12
+ default: null
13
+ }
14
+ };
15
+ },
16
+ addCommands() {
17
+ return {
18
+ ...this.parent?.(),
19
+ setParagraphClass: (className) => ({ commands }) =>
20
+ commands.updateAttributes(NodeType.PARAGRAPH, { class: className })
21
+ };
22
+ }
23
+ });
@@ -1,15 +1,15 @@
1
- import { Strike as StrikeToExtend } from '@tiptap/extension-strike';
2
-
3
- export const Strike = StrikeToExtend.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 { Strike as StrikeToExtend } from '@tiptap/extension-strike';
2
+
3
+ export const Strike = StrikeToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ })
@@ -1,13 +1,13 @@
1
- import { TableCell as TableCellToExtend } from '@tiptap/extension-table-cell';
2
-
3
- export const TableCell = TableCellToExtend.extend({
4
- addAttributes() {
5
- return {
6
- ...this.parent?.(),
7
- class: {
8
- default: null
9
- },
10
- style: null
11
- }
12
- }
13
- })
1
+ import { TableCell as TableCellToExtend } from '@tiptap/extension-table-cell';
2
+
3
+ export const TableCell = TableCellToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: null
11
+ }
12
+ }
13
+ })
@@ -1,15 +1,15 @@
1
- import { TableHeader as TableHeaderToExtend } from '@tiptap/extension-table-header';
2
-
3
- export const TableHeader = TableHeaderToExtend.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 { TableHeader as TableHeaderToExtend } from '@tiptap/extension-table-header';
2
+
3
+ export const TableHeader = TableHeaderToExtend.extend({
4
+ addAttributes() {
5
+ return {
6
+ ...this.parent?.(),
7
+ class: {
8
+ default: null
9
+ },
10
+ style: {
11
+ default: null
12
+ }
13
+ }
14
+ }
15
+ })