@antscorp/antsomi-ui 2.0.86-text-editor-beta.5 → 2.0.86

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 (228) hide show
  1. package/es/assets/css/main.scss +2 -4
  2. package/es/components/molecules/EmojiPopover/EmojiPopover.js +1 -5
  3. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +3 -6
  4. package/es/components/molecules/VirtualizedMenu/__mocks__/index.js +982 -2594
  5. package/es/components/molecules/VirtualizedMenu/components/Item/Item.d.ts +3 -13
  6. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +25 -53
  7. package/es/components/molecules/VirtualizedMenu/components/Item/index.d.ts +1 -1
  8. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +5 -8
  9. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +46 -289
  10. package/es/components/molecules/VirtualizedMenu/components/MenuInline/index.js +0 -1
  11. package/es/components/molecules/VirtualizedMenu/styled.d.ts +1 -1
  12. package/es/components/molecules/VirtualizedMenu/styled.js +4 -23
  13. package/es/components/molecules/VirtualizedMenu/types.d.ts +9 -6
  14. package/es/components/molecules/VirtualizedMenu/utils.d.ts +5 -8
  15. package/es/components/molecules/VirtualizedMenu/utils.js +18 -13
  16. package/es/components/molecules/index.d.ts +0 -1
  17. package/es/components/molecules/index.js +0 -1
  18. package/es/components/organism/index.d.ts +0 -1
  19. package/es/components/organism/index.js +0 -1
  20. package/es/components/template/Layout/constants/permission.d.ts +1 -0
  21. package/es/components/template/Layout/constants/permission.js +1 -1
  22. package/es/hooks/index.d.ts +0 -1
  23. package/es/hooks/index.js +0 -1
  24. package/es/utils/common.d.ts +9 -6
  25. package/es/utils/common.js +23 -44
  26. package/es/utils/index.d.ts +0 -1
  27. package/es/utils/index.js +0 -1
  28. package/es/utils/web.d.ts +0 -4
  29. package/es/utils/web.js +0 -25
  30. package/package.json +3 -29
  31. package/es/components/index.scss +0 -2
  32. package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +0 -3
  33. package/es/components/molecules/FontSizeInput/FontSizeInput.js +0 -128
  34. package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +0 -8
  35. package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +0 -14
  36. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +0 -20
  37. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +0 -17
  38. package/es/components/molecules/FontSizeInput/constants.d.ts +0 -2
  39. package/es/components/molecules/FontSizeInput/constants.js +0 -5
  40. package/es/components/molecules/FontSizeInput/index.d.ts +0 -2
  41. package/es/components/molecules/FontSizeInput/index.js +0 -1
  42. package/es/components/molecules/FontSizeInput/styled.d.ts +0 -3
  43. package/es/components/molecules/FontSizeInput/styled.js +0 -22
  44. package/es/components/molecules/FontSizeInput/styles.scss +0 -15
  45. package/es/components/molecules/FontSizeInput/types.d.ts +0 -24
  46. package/es/components/molecules/FontSizeInput/types.js +0 -1
  47. package/es/components/molecules/FontSizeInput/utils.d.ts +0 -7
  48. package/es/components/molecules/FontSizeInput/utils.js +0 -9
  49. package/es/components/molecules/index.scss +0 -1
  50. package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +0 -1290
  51. package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +0 -3059
  52. package/es/components/organism/TextEditor/TextEditor.d.ts +0 -3
  53. package/es/components/organism/TextEditor/TextEditor.js +0 -251
  54. package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +0 -320
  55. package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +0 -1
  56. package/es/components/organism/TextEditor/__mocks__/text-contennt.js +0 -38
  57. package/es/components/organism/TextEditor/constants.d.ts +0 -135
  58. package/es/components/organism/TextEditor/constants.js +0 -280
  59. package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +0 -25
  60. package/es/components/organism/TextEditor/extensions/BackgroundColor.js +0 -46
  61. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +0 -130
  62. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +0 -247
  63. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +0 -15
  64. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +0 -31
  65. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +0 -2
  66. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +0 -2
  67. package/es/components/organism/TextEditor/extensions/Color.d.ts +0 -6
  68. package/es/components/organism/TextEditor/extensions/Color.js +0 -41
  69. package/es/components/organism/TextEditor/extensions/Emoji.d.ts +0 -57
  70. package/es/components/organism/TextEditor/extensions/Emoji.js +0 -184
  71. package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +0 -6
  72. package/es/components/organism/TextEditor/extensions/FontFamily.js +0 -43
  73. package/es/components/organism/TextEditor/extensions/FontSize.d.ts +0 -32
  74. package/es/components/organism/TextEditor/extensions/FontSize.js +0 -47
  75. package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +0 -23
  76. package/es/components/organism/TextEditor/extensions/FontWeight.js +0 -41
  77. package/es/components/organism/TextEditor/extensions/Highlight.d.ts +0 -1
  78. package/es/components/organism/TextEditor/extensions/Highlight.js +0 -14
  79. package/es/components/organism/TextEditor/extensions/Indent.d.ts +0 -28
  80. package/es/components/organism/TextEditor/extensions/Indent.js +0 -68
  81. package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +0 -20
  82. package/es/components/organism/TextEditor/extensions/LineHeight.js +0 -36
  83. package/es/components/organism/TextEditor/extensions/Link.d.ts +0 -15
  84. package/es/components/organism/TextEditor/extensions/Link.js +0 -50
  85. package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +0 -13
  86. package/es/components/organism/TextEditor/extensions/ListItemMarker.js +0 -174
  87. package/es/components/organism/TextEditor/extensions/Selection.d.ts +0 -6
  88. package/es/components/organism/TextEditor/extensions/Selection.js +0 -40
  89. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +0 -39
  90. package/es/components/organism/TextEditor/extensions/SmartTag.js +0 -167
  91. package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +0 -36
  92. package/es/components/organism/TextEditor/extensions/StyleMemory.js +0 -163
  93. package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +0 -31
  94. package/es/components/organism/TextEditor/extensions/TextTransform.js +0 -37
  95. package/es/components/organism/TextEditor/hooks/index.d.ts +0 -7
  96. package/es/components/organism/TextEditor/hooks/index.js +0 -7
  97. package/es/components/organism/TextEditor/hooks/useColorSet.d.ts +0 -4
  98. package/es/components/organism/TextEditor/hooks/useColorSet.js +0 -6
  99. package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +0 -18
  100. package/es/components/organism/TextEditor/hooks/useDocumentState.js +0 -42
  101. package/es/components/organism/TextEditor/hooks/useLinkHandler.d.ts +0 -10
  102. package/es/components/organism/TextEditor/hooks/useLinkHandler.js +0 -223
  103. package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +0 -26
  104. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +0 -68
  105. package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +0 -31
  106. package/es/components/organism/TextEditor/hooks/usePersistence.js +0 -169
  107. package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +0 -6
  108. package/es/components/organism/TextEditor/hooks/useStyleMemory.js +0 -42
  109. package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +0 -34
  110. package/es/components/organism/TextEditor/hooks/useStylePresets.js +0 -83
  111. package/es/components/organism/TextEditor/index.d.ts +0 -14
  112. package/es/components/organism/TextEditor/index.js +0 -6
  113. package/es/components/organism/TextEditor/index.scss +0 -61
  114. package/es/components/organism/TextEditor/provider.d.ts +0 -12
  115. package/es/components/organism/TextEditor/provider.js +0 -34
  116. package/es/components/organism/TextEditor/store.d.ts +0 -13
  117. package/es/components/organism/TextEditor/store.js +0 -20
  118. package/es/components/organism/TextEditor/styled.d.ts +0 -8
  119. package/es/components/organism/TextEditor/styled.js +0 -90
  120. package/es/components/organism/TextEditor/types.d.ts +0 -92
  121. package/es/components/organism/TextEditor/types.js +0 -1
  122. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +0 -6
  123. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +0 -78
  124. package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +0 -1
  125. package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +0 -1
  126. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +0 -43
  127. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +0 -132
  128. package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +0 -1
  129. package/es/components/organism/TextEditor/ui/ColorPicker/index.js +0 -1
  130. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +0 -11
  131. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +0 -66
  132. package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +0 -2
  133. package/es/components/organism/TextEditor/ui/Emoji/index.js +0 -2
  134. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +0 -4
  135. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +0 -71
  136. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +0 -12
  137. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +0 -69
  138. package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +0 -1
  139. package/es/components/organism/TextEditor/ui/FontPopover/styled.js +0 -20
  140. package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +0 -6
  141. package/es/components/organism/TextEditor/ui/Popover/Popover.js +0 -7
  142. package/es/components/organism/TextEditor/ui/Popover/index.d.ts +0 -1
  143. package/es/components/organism/TextEditor/ui/Popover/index.js +0 -1
  144. package/es/components/organism/TextEditor/ui/Select/Select.d.ts +0 -4
  145. package/es/components/organism/TextEditor/ui/Select/Select.js +0 -7
  146. package/es/components/organism/TextEditor/ui/Select/index.d.ts +0 -1
  147. package/es/components/organism/TextEditor/ui/Select/index.js +0 -1
  148. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +0 -30
  149. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +0 -49
  150. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +0 -1
  151. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +0 -1
  152. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.d.ts +0 -14
  153. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +0 -42
  154. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +0 -5
  155. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +0 -7
  156. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +0 -5
  157. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +0 -7
  158. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +0 -5
  159. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +0 -18
  160. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +0 -4
  161. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +0 -13
  162. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +0 -7
  163. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +0 -18
  164. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +0 -7
  165. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +0 -37
  166. package/es/components/organism/TextEditor/ui/Toolbar/actions/HighlightAction.d.ts +0 -5
  167. package/es/components/organism/TextEditor/ui/Toolbar/actions/HighlightAction.js +0 -7
  168. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +0 -5
  169. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +0 -7
  170. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +0 -5
  171. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +0 -7
  172. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +0 -6
  173. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +0 -4
  174. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +0 -5
  175. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +0 -7
  176. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +0 -5
  177. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +0 -7
  178. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +0 -7
  179. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +0 -9
  180. package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.d.ts +0 -9
  181. package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.js +0 -22
  182. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +0 -5
  183. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +0 -7
  184. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +0 -5
  185. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +0 -13
  186. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +0 -5
  187. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +0 -13
  188. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +0 -5
  189. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +0 -3
  190. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +0 -7
  191. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +0 -19
  192. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +0 -15
  193. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +0 -14
  194. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +0 -5
  195. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +0 -30
  196. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +0 -5
  197. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +0 -5
  198. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +0 -6
  199. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +0 -10
  200. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +0 -20
  201. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +0 -20
  202. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +0 -1
  203. package/es/components/organism/TextEditor/ui/Toolbar/index.js +0 -1
  204. package/es/components/organism/TextEditor/utils/documentState.d.ts +0 -57
  205. package/es/components/organism/TextEditor/utils/documentState.js +0 -100
  206. package/es/components/organism/TextEditor/utils/font.d.ts +0 -84
  207. package/es/components/organism/TextEditor/utils/font.js +0 -175
  208. package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +0 -63
  209. package/es/components/organism/TextEditor/utils/htmlProcessing.js +0 -319
  210. package/es/components/organism/TextEditor/utils/index.d.ts +0 -8
  211. package/es/components/organism/TextEditor/utils/index.js +0 -16
  212. package/es/components/organism/TextEditor/utils/link.d.ts +0 -100
  213. package/es/components/organism/TextEditor/utils/link.js +0 -149
  214. package/es/components/organism/TextEditor/utils/menu.d.ts +0 -134
  215. package/es/components/organism/TextEditor/utils/menu.js +0 -317
  216. package/es/components/organism/TextEditor/utils/selection.d.ts +0 -25
  217. package/es/components/organism/TextEditor/utils/selection.js +0 -57
  218. package/es/components/organism/TextEditor/utils/smartTag.d.ts +0 -49
  219. package/es/components/organism/TextEditor/utils/smartTag.js +0 -89
  220. package/es/components/organism/TextEditor/utils/style.d.ts +0 -78
  221. package/es/components/organism/TextEditor/utils/style.js +0 -193
  222. package/es/components/organism/index.scss +0 -1
  223. package/es/hooks/useBroadcastedLocalStorage.d.ts +0 -5
  224. package/es/hooks/useBroadcastedLocalStorage.js +0 -71
  225. package/es/hooks/useElementSize.d.ts +0 -7
  226. package/es/hooks/useElementSize.js +0 -56
  227. package/es/utils/tree.d.ts +0 -225
  228. package/es/utils/tree.js +0 -469
@@ -1,135 +0,0 @@
1
- export declare const SMART_TAG_HIGHLIGHT_BG = "rgba(0, 199, 97, 0.2)";
2
- export declare const DEFAULT_TEXT_STYLE: {
3
- fontSize: string;
4
- color: string;
5
- fontFamily: string;
6
- backgroundColor: string;
7
- lineHeight: string;
8
- fontWeight: string;
9
- };
10
- export declare const FONT_WEIGHT_LABELS: {
11
- readonly thin: "Thin";
12
- readonly extraLight: "Extra Light";
13
- readonly light: "Light";
14
- readonly normal: "Normal";
15
- readonly medium: "Medium";
16
- readonly semiBold: "Semi Bold";
17
- readonly bold: "Bold";
18
- readonly extraBold: "Extra Bold";
19
- readonly black: "Black";
20
- };
21
- export declare const FONT_WEIGHT_MAP: Record<number, string>;
22
- export declare const DEFAULT_FONT_CONFIGS: {
23
- fontFamily: {
24
- name: string;
25
- };
26
- fontWeight: number[];
27
- }[];
28
- export declare const LINK_TEXT_COLOR = "#0066CC";
29
- export declare const COMPONENT_CLS = "antsomi-text-editor";
30
- export declare const TEXT_EDITOR_CONSTANTS: {
31
- COLOR_GIRD: string[][];
32
- TEXT_ALIGN: {
33
- TITLE: string;
34
- OPTIONS: {
35
- LEFT: {
36
- LABEL: string;
37
- VALUE: string;
38
- };
39
- CENTER: {
40
- LABEL: string;
41
- VALUE: string;
42
- };
43
- RIGHT: {
44
- LABEL: string;
45
- VALUE: string;
46
- };
47
- JUSTIFY: {
48
- LABEL: string;
49
- VALUE: string;
50
- };
51
- };
52
- TOOLTIP: string;
53
- };
54
- TEXT_TRANSFORM: {
55
- PLACEHOLDER: string;
56
- OPTIONS: {
57
- UPPERCASE: {
58
- LABEL: string;
59
- VALUE: string;
60
- };
61
- LOWERCASE: {
62
- LABEL: string;
63
- VALUE: string;
64
- };
65
- CAPITALIZE: {
66
- LABEL: string;
67
- VALUE: string;
68
- };
69
- NONE: {
70
- LABEL: string;
71
- VALUE: string;
72
- };
73
- };
74
- };
75
- TOOLTIPS: {
76
- BOLD: {
77
- TITLE: string;
78
- SHORTCUT: string;
79
- };
80
- ITALIC: {
81
- TITLE: string;
82
- SHORTCUT: string;
83
- };
84
- UNDERLINE: {
85
- TITLE: string;
86
- SHORTCUT: string;
87
- };
88
- STRIKE: {
89
- TITLE: string;
90
- SHORTCUT: string;
91
- };
92
- BULLET_LIST: {
93
- TITLE: string;
94
- SHORTCUT: string;
95
- };
96
- ORDERED_LIST: {
97
- TITLE: string;
98
- SHORTCUT: string;
99
- };
100
- CLEAR_FORMATTING: {
101
- TITLE: string;
102
- };
103
- FONT_FAMILY: {
104
- PLACEHOLDER: string;
105
- };
106
- FONT_SIZE: {
107
- PLACEHOLDER: string;
108
- };
109
- HIGHLIGHT: {
110
- TITLE: string;
111
- };
112
- INDENT: {
113
- TITLE: string;
114
- };
115
- OUTDENT: {
116
- TITLE: string;
117
- };
118
- LINK: {
119
- TITLE: string;
120
- };
121
- SMART_TAG: {
122
- TITLE: string;
123
- };
124
- SUPERSCRIPT: {
125
- TITLE: string;
126
- };
127
- SUBSCRIPT: {
128
- TITLE: string;
129
- };
130
- TEXT_COLOR: {
131
- TITLE: string;
132
- };
133
- };
134
- LINK_TEXT_COLOR: string;
135
- };
@@ -1,280 +0,0 @@
1
- import { ANTSOMI_COMPONENT_PREFIX_CLS } from '@antscorp/antsomi-ui/es/constants';
2
- const COLOR_GIRD = [
3
- // Dòng đầu: màu chuẩn
4
- [
5
- '#000000',
6
- '#434343',
7
- '#666666',
8
- '#999999',
9
- '#B7B7B7',
10
- '#CCCCCC',
11
- '#D9D9D9',
12
- '#EFEFEF',
13
- '#F3F3F3',
14
- '#FFFFFF',
15
- ],
16
- // Dòng 2: màu cơ bản
17
- [
18
- '#980000',
19
- '#FF0000',
20
- '#FF9900',
21
- '#FFFF00',
22
- '#00FF00',
23
- '#00FFFF',
24
- '#4A86E8',
25
- '#0000FF',
26
- '#9900FF',
27
- '#FF00FF',
28
- ],
29
- // Dòng 3+
30
- [
31
- '#E6B8AF',
32
- '#F4CCCC',
33
- '#FCE5CD',
34
- '#FFF2CC',
35
- '#D9EAD3',
36
- '#D0E0E3',
37
- '#C9DAF8',
38
- '#CFE2F3',
39
- '#D9D2E9',
40
- '#EAD1DC',
41
- ],
42
- [
43
- '#DD7E6B',
44
- '#EA9999',
45
- '#F9CB9C',
46
- '#FFE599',
47
- '#B6D7A8',
48
- '#A2C4C9',
49
- '#A4C2F4',
50
- '#9FC5E8',
51
- '#B4A7D6',
52
- '#D5A6BD',
53
- ],
54
- [
55
- '#CC4125',
56
- '#E06666',
57
- '#F6B26B',
58
- '#FFD966',
59
- '#93C47D',
60
- '#76A5AF',
61
- '#6D9EEB',
62
- '#6FA8DC',
63
- '#8E7CC3',
64
- '#C27BA0',
65
- ],
66
- [
67
- '#A61C00',
68
- '#CC0000',
69
- '#E69138',
70
- '#F1C232',
71
- '#6AA84F',
72
- '#45818E',
73
- '#3C78D8',
74
- '#3D85C6',
75
- '#674EA7',
76
- '#A64D79',
77
- ],
78
- [
79
- '#85200C',
80
- '#990000',
81
- '#B45F06',
82
- '#BF9000',
83
- '#38761D',
84
- '#134F5C',
85
- '#1155CC',
86
- '#0B5394',
87
- '#351C75',
88
- '#741B47',
89
- ],
90
- [
91
- '#5B0F00',
92
- '#660000',
93
- '#783F04',
94
- '#7F6000',
95
- '#274E13',
96
- '#0C343D',
97
- '#1C4587',
98
- '#073763',
99
- '#20124D',
100
- '#4C1130',
101
- ],
102
- ];
103
- // TextAlignSelect component
104
- const TEXT_ALIGN = {
105
- TITLE: 'Text Align',
106
- OPTIONS: {
107
- LEFT: {
108
- LABEL: 'Left',
109
- VALUE: 'left',
110
- },
111
- CENTER: {
112
- LABEL: 'Center',
113
- VALUE: 'center',
114
- },
115
- RIGHT: {
116
- LABEL: 'Right',
117
- VALUE: 'right',
118
- },
119
- JUSTIFY: {
120
- LABEL: 'Justify',
121
- VALUE: 'justify',
122
- },
123
- },
124
- TOOLTIP: 'Align',
125
- };
126
- // TextTransformAction component
127
- const TEXT_TRANSFORM = {
128
- PLACEHOLDER: 'Text Transform',
129
- OPTIONS: {
130
- UPPERCASE: {
131
- LABEL: 'UPPERCASE',
132
- VALUE: 'uppercase',
133
- },
134
- LOWERCASE: {
135
- LABEL: 'lowercase',
136
- VALUE: 'lowercase',
137
- },
138
- CAPITALIZE: {
139
- LABEL: 'Capitalize',
140
- VALUE: 'capitalize',
141
- },
142
- NONE: {
143
- LABEL: 'none',
144
- VALUE: 'none',
145
- },
146
- },
147
- };
148
- const TOOLTIPS = {
149
- BOLD: {
150
- TITLE: 'Bold',
151
- SHORTCUT: 'B',
152
- },
153
- ITALIC: {
154
- TITLE: 'Italic',
155
- SHORTCUT: 'I',
156
- },
157
- UNDERLINE: {
158
- TITLE: 'Underline',
159
- SHORTCUT: 'U',
160
- },
161
- STRIKE: {
162
- TITLE: 'Strike',
163
- SHORTCUT: 'S',
164
- },
165
- BULLET_LIST: {
166
- TITLE: 'Bullet List',
167
- SHORTCUT: '8',
168
- },
169
- ORDERED_LIST: {
170
- TITLE: 'Ordered List',
171
- SHORTCUT: '7',
172
- },
173
- CLEAR_FORMATTING: {
174
- TITLE: 'Clear Formatting',
175
- },
176
- FONT_FAMILY: {
177
- PLACEHOLDER: 'Font Family',
178
- },
179
- FONT_SIZE: {
180
- PLACEHOLDER: 'Font Size',
181
- },
182
- HIGHLIGHT: {
183
- TITLE: 'Text Background',
184
- },
185
- INDENT: {
186
- TITLE: 'Indent',
187
- },
188
- OUTDENT: {
189
- TITLE: 'Outdent',
190
- },
191
- LINK: {
192
- TITLE: 'Link',
193
- },
194
- SMART_TAG: {
195
- TITLE: 'Smart Tag',
196
- },
197
- SUPERSCRIPT: {
198
- TITLE: 'Superscript',
199
- },
200
- SUBSCRIPT: {
201
- TITLE: 'Subscript',
202
- },
203
- TEXT_COLOR: {
204
- TITLE: 'Text Color',
205
- },
206
- };
207
- export const SMART_TAG_HIGHLIGHT_BG = 'rgba(0, 199, 97, 0.2)';
208
- export const DEFAULT_TEXT_STYLE = {
209
- fontSize: '22px',
210
- color: '#000',
211
- fontFamily: 'inherit',
212
- backgroundColor: 'inherit',
213
- lineHeight: '1.15',
214
- fontWeight: 'inherit',
215
- };
216
- export const FONT_WEIGHT_LABELS = {
217
- thin: 'Thin',
218
- extraLight: 'Extra Light',
219
- light: 'Light',
220
- normal: 'Normal',
221
- medium: 'Medium',
222
- semiBold: 'Semi Bold',
223
- bold: 'Bold',
224
- extraBold: 'Extra Bold',
225
- black: 'Black',
226
- };
227
- export const FONT_WEIGHT_MAP = {
228
- 100: FONT_WEIGHT_LABELS.thin,
229
- 200: FONT_WEIGHT_LABELS.extraLight,
230
- 300: FONT_WEIGHT_LABELS.light,
231
- 400: FONT_WEIGHT_LABELS.normal,
232
- 500: FONT_WEIGHT_LABELS.medium,
233
- 600: FONT_WEIGHT_LABELS.semiBold,
234
- 700: FONT_WEIGHT_LABELS.bold,
235
- 800: FONT_WEIGHT_LABELS.extraBold,
236
- 900: FONT_WEIGHT_LABELS.black,
237
- };
238
- export const DEFAULT_FONT_CONFIGS = [
239
- {
240
- fontFamily: { name: 'Arial' },
241
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
242
- },
243
- {
244
- fontFamily: { name: 'Roboto' }, // Google Font, not inherently system-wide
245
- fontWeight: [100, 300, 400, 500, 700, 900],
246
- },
247
- {
248
- fontFamily: { name: 'Georgia' },
249
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
250
- },
251
- {
252
- fontFamily: { name: 'Helvetica' },
253
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
254
- },
255
- {
256
- fontFamily: { name: 'Lucida Grande' },
257
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
258
- },
259
- {
260
- fontFamily: { name: 'Tahoma' },
261
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
262
- },
263
- {
264
- fontFamily: { name: 'Times New Roman' },
265
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
266
- },
267
- {
268
- fontFamily: { name: 'Verdana' },
269
- fontWeight: [100, 200, 300, 400, 500, 600, 700, 800, 900],
270
- },
271
- ];
272
- export const LINK_TEXT_COLOR = '#0066CC';
273
- export const COMPONENT_CLS = `${ANTSOMI_COMPONENT_PREFIX_CLS}-text-editor`;
274
- export const TEXT_EDITOR_CONSTANTS = {
275
- COLOR_GIRD,
276
- TEXT_ALIGN,
277
- TEXT_TRANSFORM,
278
- TOOLTIPS,
279
- LINK_TEXT_COLOR,
280
- };
@@ -1,25 +0,0 @@
1
- import { Extension } from '@tiptap/core';
2
- export type BackgroundColorOptions = {
3
- /**
4
- * The types where the color can be applied
5
- * @default ['textStyle']
6
- * @example ['heading', 'paragraph']
7
- */
8
- types: string[];
9
- defaultBackgroundColor: string;
10
- };
11
- declare module '@tiptap/core' {
12
- interface Commands<ReturnType> {
13
- backgroundColor: {
14
- /**
15
- * Set the background color
16
- */
17
- setBackgroundColor: (color: string) => ReturnType;
18
- /**
19
- * Unset the background color
20
- */
21
- unsetBackgroundColor: () => ReturnType;
22
- };
23
- }
24
- }
25
- export declare const BackgroundColor: Extension<BackgroundColorOptions, any>;
@@ -1,46 +0,0 @@
1
- import { Extension } from '@tiptap/core';
2
- import { DEFAULT_TEXT_STYLE } from '../constants';
3
- import tinycolor from 'tinycolor2';
4
- export const BackgroundColor = Extension.create({
5
- name: 'backgroundColor',
6
- addOptions() {
7
- return {
8
- types: ['textStyle'],
9
- defaultBackgroundColor: DEFAULT_TEXT_STYLE.backgroundColor,
10
- };
11
- },
12
- addGlobalAttributes() {
13
- return [
14
- {
15
- types: this.options.types,
16
- attributes: {
17
- backgroundColor: {
18
- default: this.options.defaultBackgroundColor,
19
- parseHTML: element => element.style.backgroundColor?.replace(/['"]+/g, ''),
20
- renderHTML: attributes => {
21
- if (!tinycolor(attributes.backgroundColor).isValid()) {
22
- return {};
23
- }
24
- const hexBgColor = tinycolor(attributes.backgroundColor).toString('hex');
25
- return {
26
- style: `
27
- --text-style-bg-color: ${hexBgColor};
28
- background-color: ${hexBgColor};
29
- `,
30
- };
31
- },
32
- },
33
- },
34
- },
35
- ];
36
- },
37
- addCommands() {
38
- return {
39
- setBackgroundColor: color => ({ chain }) => chain().setMark('textStyle', { backgroundColor: color }).run(),
40
- unsetBackgroundColor: () => ({ chain }) => chain()
41
- .setMark('textStyle', { backgroundColor: this.options.defaultBackgroundColor || null })
42
- .removeEmptyTextStyle()
43
- .run(),
44
- };
45
- },
46
- });
@@ -1,130 +0,0 @@
1
- import { arrow, autoPlacement, flip, hide, inline, offset, shift, size } from '@floating-ui/dom';
2
- import type { Editor } from '@tiptap/core';
3
- import type { EditorState, PluginView } from '@tiptap/pm/state';
4
- import { Plugin, PluginKey } from '@tiptap/pm/state';
5
- import type { EditorView } from '@tiptap/pm/view';
6
- export interface BubbleMenuPluginProps {
7
- /**
8
- * The plugin key.
9
- * @type {PluginKey | string}
10
- * @default 'bubbleMenu'
11
- */
12
- pluginKey: PluginKey | string;
13
- /**
14
- * The editor instance.
15
- */
16
- editor: Editor;
17
- /**
18
- * The DOM element that contains your menu.
19
- * @type {HTMLElement}
20
- * @default null
21
- */
22
- element: HTMLElement;
23
- /**
24
- * The container element where the bubble menu will be rendered.
25
- * If not provided, it will default to document.body
26
- * @type {HTMLElement | (() => HTMLElement) | null}
27
- * @default document.body
28
- */
29
- container?: HTMLElement | (() => HTMLElement) | null;
30
- /**
31
- * The delay in milliseconds before the menu should be updated.
32
- * This can be useful to prevent performance issues.
33
- * @type {number}
34
- * @default 250
35
- */
36
- updateDelay?: number;
37
- /**
38
- * The delay in milliseconds before the menu position should be updated on window resize.
39
- * This can be useful to prevent performance issues.
40
- * @type {number}
41
- * @default 60
42
- */
43
- resizeDelay?: number;
44
- /**
45
- * A function that determines whether the menu should be shown or not.
46
- * If this function returns `false`, the menu will be hidden, otherwise it will be shown.
47
- */
48
- shouldShow: ((props: {
49
- editor: Editor;
50
- element: HTMLElement;
51
- view: EditorView;
52
- state: EditorState;
53
- oldState?: EditorState;
54
- from: number;
55
- to: number;
56
- }) => boolean) | null;
57
- /**
58
- * Callback function when the bubble menu is shown.
59
- */
60
- onShow?: () => void;
61
- /**
62
- * Callback function when the bubble menu is hidden.
63
- */
64
- onHide?: () => void;
65
- /**
66
- * FloatingUI options.
67
- */
68
- options?: {
69
- strategy?: 'absolute' | 'fixed';
70
- placement?: 'top' | 'right' | 'bottom' | 'left' | 'top-start' | 'top-end' | 'right-start' | 'right-end' | 'bottom-start' | 'bottom-end' | 'left-start' | 'left-end';
71
- offset?: Parameters<typeof offset>[0] | boolean;
72
- flip?: Parameters<typeof flip>[0] | boolean;
73
- shift?: Parameters<typeof shift>[0] | boolean;
74
- arrow?: Parameters<typeof arrow>[0] | false;
75
- size?: Parameters<typeof size>[0] | boolean;
76
- autoPlacement?: Parameters<typeof autoPlacement>[0] | boolean;
77
- hide?: Parameters<typeof hide>[0] | boolean;
78
- inline?: Parameters<typeof inline>[0] | boolean;
79
- };
80
- }
81
- export type BubbleMenuViewProps = BubbleMenuPluginProps & {
82
- view: EditorView;
83
- };
84
- export declare class BubbleMenuView implements PluginView {
85
- editor: Editor;
86
- element: HTMLElement;
87
- container?: HTMLElement | (() => HTMLElement) | null;
88
- view: EditorView;
89
- preventHide: boolean;
90
- updateDelay: number;
91
- resizeDelay: number;
92
- onShow?: () => void;
93
- onHide?: () => void;
94
- private updateDebounceTimer;
95
- private resizeDebounceTimer;
96
- private floatingUIOptions;
97
- shouldShow: Exclude<BubbleMenuPluginProps['shouldShow'], null>;
98
- get middlewares(): {
99
- name: string;
100
- options?: any;
101
- fn: (state: {
102
- x: number;
103
- y: number;
104
- platform: import("@floating-ui/core").Platform;
105
- placement: import("@floating-ui/utils").Placement;
106
- initialPlacement: import("@floating-ui/utils").Placement;
107
- strategy: import("@floating-ui/utils").Strategy;
108
- middlewareData: import("@floating-ui/core").MiddlewareData;
109
- rects: import("@floating-ui/utils").ElementRects;
110
- elements: import("@floating-ui/dom").Elements;
111
- }) => import("@floating-ui/core").MiddlewareReturn | Promise<import("@floating-ui/core").MiddlewareReturn>;
112
- }[];
113
- constructor({ editor, element, view, updateDelay, resizeDelay, container, shouldShow, options, onShow, onHide, }: BubbleMenuViewProps);
114
- mousedownHandler: () => void;
115
- dragstartHandler: () => void;
116
- focusHandler: () => void;
117
- blurHandler: ({ event }: {
118
- event: FocusEvent;
119
- }) => void;
120
- updatePosition(): void;
121
- update(view: EditorView, oldState?: EditorState): void;
122
- handleDebouncedUpdate: (view: EditorView, oldState?: EditorState) => void;
123
- getShouldShow(oldState?: EditorState): boolean;
124
- updateHandler: (view: EditorView, selectionChanged: boolean, docChanged: boolean, oldState?: EditorState) => void;
125
- private getContainer;
126
- show(): void;
127
- hide(): void;
128
- destroy(): void;
129
- }
130
- export declare const BubbleMenuPlugin: (options: BubbleMenuPluginProps) => Plugin<any>;