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

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 (231) hide show
  1. package/es/assets/css/main.scss +4 -2
  2. package/es/components/index.scss +2 -0
  3. package/es/components/molecules/EmojiPopover/EmojiPopover.js +5 -1
  4. package/es/components/molecules/FontSizeInput/FontSizeInput.d.ts +3 -0
  5. package/es/components/molecules/FontSizeInput/FontSizeInput.js +128 -0
  6. package/es/components/molecules/FontSizeInput/components/FontSizeControl.d.ts +8 -0
  7. package/es/components/molecules/FontSizeInput/components/FontSizeControl.js +14 -0
  8. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.d.ts +20 -0
  9. package/es/components/molecules/FontSizeInput/components/FontSizeDropdown.js +17 -0
  10. package/es/components/molecules/FontSizeInput/constants.d.ts +2 -0
  11. package/es/components/molecules/FontSizeInput/constants.js +5 -0
  12. package/es/components/molecules/FontSizeInput/index.d.ts +2 -0
  13. package/es/components/molecules/FontSizeInput/index.js +1 -0
  14. package/es/components/molecules/FontSizeInput/styled.d.ts +3 -0
  15. package/es/components/molecules/FontSizeInput/styled.js +22 -0
  16. package/es/components/molecules/FontSizeInput/styles.scss +15 -0
  17. package/es/components/molecules/FontSizeInput/types.d.ts +24 -0
  18. package/es/components/molecules/FontSizeInput/types.js +1 -0
  19. package/es/components/molecules/FontSizeInput/utils.d.ts +7 -0
  20. package/es/components/molecules/FontSizeInput/utils.js +9 -0
  21. package/es/components/molecules/TagifyInput/TagifyInput.js +20 -14
  22. package/es/components/molecules/TagifyInput/utils.d.ts +10 -1
  23. package/es/components/molecules/TagifyInput/utils.js +64 -6
  24. package/es/components/molecules/VirtualizedMenu/VirtualizedMenu.d.ts +6 -3
  25. package/es/components/molecules/VirtualizedMenu/__mocks__/index.js +2550 -938
  26. package/es/components/molecules/VirtualizedMenu/components/Item/Item.d.ts +13 -3
  27. package/es/components/molecules/VirtualizedMenu/components/Item/Item.js +53 -25
  28. package/es/components/molecules/VirtualizedMenu/components/Item/index.d.ts +1 -1
  29. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.d.ts +8 -5
  30. package/es/components/molecules/VirtualizedMenu/components/MenuInline/MenuInline.js +289 -46
  31. package/es/components/molecules/VirtualizedMenu/components/MenuInline/index.js +1 -0
  32. package/es/components/molecules/VirtualizedMenu/styled.d.ts +1 -1
  33. package/es/components/molecules/VirtualizedMenu/styled.js +23 -4
  34. package/es/components/molecules/VirtualizedMenu/types.d.ts +6 -9
  35. package/es/components/molecules/VirtualizedMenu/utils.d.ts +8 -5
  36. package/es/components/molecules/VirtualizedMenu/utils.js +13 -18
  37. package/es/components/molecules/index.d.ts +1 -0
  38. package/es/components/molecules/index.js +1 -0
  39. package/es/components/molecules/index.scss +1 -0
  40. package/es/components/organism/ActivityTimeline/__mocks__/event_tracking.json +1290 -0
  41. package/es/components/organism/ActivityTimeline/__mocks__/timeline.json +3059 -0
  42. package/es/components/organism/TextEditor/TextEditor.d.ts +3 -0
  43. package/es/components/organism/TextEditor/TextEditor.js +251 -0
  44. package/es/components/organism/TextEditor/__mocks__/text-block.settings.json +320 -0
  45. package/es/components/organism/TextEditor/__mocks__/text-contennt.d.ts +1 -0
  46. package/es/components/organism/TextEditor/__mocks__/text-contennt.js +38 -0
  47. package/es/components/organism/TextEditor/constants.d.ts +135 -0
  48. package/es/components/organism/TextEditor/constants.js +280 -0
  49. package/es/components/organism/TextEditor/extensions/BackgroundColor.d.ts +25 -0
  50. package/es/components/organism/TextEditor/extensions/BackgroundColor.js +46 -0
  51. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.d.ts +130 -0
  52. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu-plugin.js +247 -0
  53. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.d.ts +15 -0
  54. package/es/components/organism/TextEditor/extensions/BubbleMenu/bubble-menu.js +31 -0
  55. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.d.ts +2 -0
  56. package/es/components/organism/TextEditor/extensions/BubbleMenu/index.js +2 -0
  57. package/es/components/organism/TextEditor/extensions/Color.d.ts +6 -0
  58. package/es/components/organism/TextEditor/extensions/Color.js +41 -0
  59. package/es/components/organism/TextEditor/extensions/Emoji.d.ts +57 -0
  60. package/es/components/organism/TextEditor/extensions/Emoji.js +184 -0
  61. package/es/components/organism/TextEditor/extensions/FontFamily.d.ts +6 -0
  62. package/es/components/organism/TextEditor/extensions/FontFamily.js +43 -0
  63. package/es/components/organism/TextEditor/extensions/FontSize.d.ts +32 -0
  64. package/es/components/organism/TextEditor/extensions/FontSize.js +47 -0
  65. package/es/components/organism/TextEditor/extensions/FontWeight.d.ts +23 -0
  66. package/es/components/organism/TextEditor/extensions/FontWeight.js +41 -0
  67. package/es/components/organism/TextEditor/extensions/Highlight.d.ts +1 -0
  68. package/es/components/organism/TextEditor/extensions/Highlight.js +14 -0
  69. package/es/components/organism/TextEditor/extensions/Indent.d.ts +28 -0
  70. package/es/components/organism/TextEditor/extensions/Indent.js +68 -0
  71. package/es/components/organism/TextEditor/extensions/LineHeight.d.ts +20 -0
  72. package/es/components/organism/TextEditor/extensions/LineHeight.js +36 -0
  73. package/es/components/organism/TextEditor/extensions/Link.d.ts +15 -0
  74. package/es/components/organism/TextEditor/extensions/Link.js +50 -0
  75. package/es/components/organism/TextEditor/extensions/ListItemMarker.d.ts +13 -0
  76. package/es/components/organism/TextEditor/extensions/ListItemMarker.js +174 -0
  77. package/es/components/organism/TextEditor/extensions/Selection.d.ts +6 -0
  78. package/es/components/organism/TextEditor/extensions/Selection.js +40 -0
  79. package/es/components/organism/TextEditor/extensions/SmartTag.d.ts +39 -0
  80. package/es/components/organism/TextEditor/extensions/SmartTag.js +167 -0
  81. package/es/components/organism/TextEditor/extensions/StyleMemory.d.ts +36 -0
  82. package/es/components/organism/TextEditor/extensions/StyleMemory.js +163 -0
  83. package/es/components/organism/TextEditor/extensions/TextTransform.d.ts +31 -0
  84. package/es/components/organism/TextEditor/extensions/TextTransform.js +37 -0
  85. package/es/components/organism/TextEditor/hooks/index.d.ts +6 -0
  86. package/es/components/organism/TextEditor/hooks/index.js +6 -0
  87. package/es/components/organism/TextEditor/hooks/useDocumentState.d.ts +18 -0
  88. package/es/components/organism/TextEditor/hooks/useDocumentState.js +42 -0
  89. package/es/components/organism/TextEditor/hooks/useLinkHandler.d.ts +10 -0
  90. package/es/components/organism/TextEditor/hooks/useLinkHandler.js +223 -0
  91. package/es/components/organism/TextEditor/hooks/useMarkTracking.d.ts +26 -0
  92. package/es/components/organism/TextEditor/hooks/useMarkTracking.js +68 -0
  93. package/es/components/organism/TextEditor/hooks/usePersistence.d.ts +31 -0
  94. package/es/components/organism/TextEditor/hooks/usePersistence.js +169 -0
  95. package/es/components/organism/TextEditor/hooks/useStyleMemory.d.ts +6 -0
  96. package/es/components/organism/TextEditor/hooks/useStyleMemory.js +42 -0
  97. package/es/components/organism/TextEditor/hooks/useStylePresets.d.ts +34 -0
  98. package/es/components/organism/TextEditor/hooks/useStylePresets.js +83 -0
  99. package/es/components/organism/TextEditor/index.d.ts +14 -0
  100. package/es/components/organism/TextEditor/index.js +6 -0
  101. package/es/components/organism/TextEditor/index.scss +61 -0
  102. package/es/components/organism/TextEditor/provider.d.ts +10 -0
  103. package/es/components/organism/TextEditor/provider.js +20 -0
  104. package/es/components/organism/TextEditor/store.d.ts +11 -0
  105. package/es/components/organism/TextEditor/store.js +12 -0
  106. package/es/components/organism/TextEditor/styled.d.ts +8 -0
  107. package/es/components/organism/TextEditor/styled.js +90 -0
  108. package/es/components/organism/TextEditor/types.d.ts +92 -0
  109. package/es/components/organism/TextEditor/types.js +1 -0
  110. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.d.ts +6 -0
  111. package/es/components/organism/TextEditor/ui/BubbleMenu/BubbleMenu.js +78 -0
  112. package/es/components/organism/TextEditor/ui/BubbleMenu/index.d.ts +1 -0
  113. package/es/components/organism/TextEditor/ui/BubbleMenu/index.js +1 -0
  114. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.d.ts +43 -0
  115. package/es/components/organism/TextEditor/ui/ColorPicker/ColorPicker.js +120 -0
  116. package/es/components/organism/TextEditor/ui/ColorPicker/index.d.ts +1 -0
  117. package/es/components/organism/TextEditor/ui/ColorPicker/index.js +1 -0
  118. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.d.ts +11 -0
  119. package/es/components/organism/TextEditor/ui/Emoji/EmojiList.js +66 -0
  120. package/es/components/organism/TextEditor/ui/Emoji/index.d.ts +2 -0
  121. package/es/components/organism/TextEditor/ui/Emoji/index.js +2 -0
  122. package/es/components/organism/TextEditor/ui/Emoji/suggestion.d.ts +4 -0
  123. package/es/components/organism/TextEditor/ui/Emoji/suggestion.js +71 -0
  124. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.d.ts +12 -0
  125. package/es/components/organism/TextEditor/ui/FontPopover/FontPopover.js +69 -0
  126. package/es/components/organism/TextEditor/ui/FontPopover/styled.d.ts +1 -0
  127. package/es/components/organism/TextEditor/ui/FontPopover/styled.js +20 -0
  128. package/es/components/organism/TextEditor/ui/Popover/Popover.d.ts +6 -0
  129. package/es/components/organism/TextEditor/ui/Popover/Popover.js +7 -0
  130. package/es/components/organism/TextEditor/ui/Popover/index.d.ts +1 -0
  131. package/es/components/organism/TextEditor/ui/Popover/index.js +1 -0
  132. package/es/components/organism/TextEditor/ui/Select/Select.d.ts +4 -0
  133. package/es/components/organism/TextEditor/ui/Select/Select.js +7 -0
  134. package/es/components/organism/TextEditor/ui/Select/index.d.ts +1 -0
  135. package/es/components/organism/TextEditor/ui/Select/index.js +1 -0
  136. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.d.ts +30 -0
  137. package/es/components/organism/TextEditor/ui/TextAlignSelect/TextAlignSelect.js +49 -0
  138. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.d.ts +1 -0
  139. package/es/components/organism/TextEditor/ui/TextAlignSelect/index.js +1 -0
  140. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.d.ts +14 -0
  141. package/es/components/organism/TextEditor/ui/Toolbar/Toolbar.js +42 -0
  142. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.d.ts +5 -0
  143. package/es/components/organism/TextEditor/ui/Toolbar/actions/BoldAction.js +7 -0
  144. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.d.ts +5 -0
  145. package/es/components/organism/TextEditor/ui/Toolbar/actions/BulletListAction.js +7 -0
  146. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.d.ts +5 -0
  147. package/es/components/organism/TextEditor/ui/Toolbar/actions/ClearFormattingAction.js +18 -0
  148. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.d.ts +4 -0
  149. package/es/components/organism/TextEditor/ui/Toolbar/actions/EmojiAction.js +13 -0
  150. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.d.ts +7 -0
  151. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontFamilyAction.js +18 -0
  152. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.d.ts +7 -0
  153. package/es/components/organism/TextEditor/ui/Toolbar/actions/FontSizeAction.js +37 -0
  154. package/es/components/organism/TextEditor/ui/Toolbar/actions/HighlightAction.d.ts +5 -0
  155. package/es/components/organism/TextEditor/ui/Toolbar/actions/HighlightAction.js +7 -0
  156. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.d.ts +5 -0
  157. package/es/components/organism/TextEditor/ui/Toolbar/actions/IndentAction.js +7 -0
  158. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.d.ts +5 -0
  159. package/es/components/organism/TextEditor/ui/Toolbar/actions/ItalicAction.js +7 -0
  160. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.d.ts +6 -0
  161. package/es/components/organism/TextEditor/ui/Toolbar/actions/LinkAction.js +4 -0
  162. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.d.ts +5 -0
  163. package/es/components/organism/TextEditor/ui/Toolbar/actions/OrderedListAction.js +7 -0
  164. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.d.ts +5 -0
  165. package/es/components/organism/TextEditor/ui/Toolbar/actions/OutdentAction.js +7 -0
  166. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.d.ts +7 -0
  167. package/es/components/organism/TextEditor/ui/Toolbar/actions/SmartTagAction.js +9 -0
  168. package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.d.ts +9 -0
  169. package/es/components/organism/TextEditor/ui/Toolbar/actions/SpacingAction.js +22 -0
  170. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.d.ts +5 -0
  171. package/es/components/organism/TextEditor/ui/Toolbar/actions/StrikeAction.js +7 -0
  172. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.d.ts +5 -0
  173. package/es/components/organism/TextEditor/ui/Toolbar/actions/SubscriptAction.js +13 -0
  174. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.d.ts +5 -0
  175. package/es/components/organism/TextEditor/ui/Toolbar/actions/SuperscriptAction.js +13 -0
  176. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.d.ts +5 -0
  177. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextAlignAction.js +3 -0
  178. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.d.ts +7 -0
  179. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextBackgroundColorAction.js +19 -0
  180. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.d.ts +15 -0
  181. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextColorAction.js +14 -0
  182. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.d.ts +5 -0
  183. package/es/components/organism/TextEditor/ui/Toolbar/actions/TextTransformAction.js +30 -0
  184. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.d.ts +5 -0
  185. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnderlineAction.js +5 -0
  186. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.d.ts +6 -0
  187. package/es/components/organism/TextEditor/ui/Toolbar/actions/UnsetLink.js +10 -0
  188. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.d.ts +20 -0
  189. package/es/components/organism/TextEditor/ui/Toolbar/actions/index.js +20 -0
  190. package/es/components/organism/TextEditor/ui/Toolbar/index.d.ts +1 -0
  191. package/es/components/organism/TextEditor/ui/Toolbar/index.js +1 -0
  192. package/es/components/organism/TextEditor/utils/documentState.d.ts +57 -0
  193. package/es/components/organism/TextEditor/utils/documentState.js +100 -0
  194. package/es/components/organism/TextEditor/utils/font.d.ts +84 -0
  195. package/es/components/organism/TextEditor/utils/font.js +175 -0
  196. package/es/components/organism/TextEditor/utils/htmlProcessing.d.ts +63 -0
  197. package/es/components/organism/TextEditor/utils/htmlProcessing.js +321 -0
  198. package/es/components/organism/TextEditor/utils/index.d.ts +8 -0
  199. package/es/components/organism/TextEditor/utils/index.js +16 -0
  200. package/es/components/organism/TextEditor/utils/link.d.ts +100 -0
  201. package/es/components/organism/TextEditor/utils/link.js +149 -0
  202. package/es/components/organism/TextEditor/utils/menu.d.ts +134 -0
  203. package/es/components/organism/TextEditor/utils/menu.js +317 -0
  204. package/es/components/organism/TextEditor/utils/selection.d.ts +25 -0
  205. package/es/components/organism/TextEditor/utils/selection.js +57 -0
  206. package/es/components/organism/TextEditor/utils/smartTag.d.ts +49 -0
  207. package/es/components/organism/TextEditor/utils/smartTag.js +89 -0
  208. package/es/components/organism/TextEditor/utils/style.d.ts +78 -0
  209. package/es/components/organism/TextEditor/utils/style.js +193 -0
  210. package/es/components/organism/index.d.ts +1 -0
  211. package/es/components/organism/index.js +1 -0
  212. package/es/components/organism/index.scss +1 -0
  213. package/es/config/index.d.ts +1 -0
  214. package/es/config/index.js +1 -0
  215. package/es/constants/api.d.ts +10 -0
  216. package/es/constants/api.js +10 -0
  217. package/es/hooks/index.d.ts +1 -0
  218. package/es/hooks/index.js +1 -0
  219. package/es/hooks/useBroadcastedLocalStorage.d.ts +5 -0
  220. package/es/hooks/useBroadcastedLocalStorage.js +71 -0
  221. package/es/hooks/useElementSize.d.ts +7 -0
  222. package/es/hooks/useElementSize.js +56 -0
  223. package/es/utils/common.d.ts +6 -9
  224. package/es/utils/common.js +44 -23
  225. package/es/utils/index.d.ts +1 -0
  226. package/es/utils/index.js +1 -0
  227. package/es/utils/tree.d.ts +225 -0
  228. package/es/utils/tree.js +469 -0
  229. package/es/utils/web.d.ts +4 -0
  230. package/es/utils/web.js +25 -0
  231. package/package.json +29 -3
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ import { TextEditorRef, TextEditorProps } from './types';
3
+ export declare const TextEditor: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<TextEditorProps & import("react").RefAttributes<TextEditorRef>>>;
@@ -0,0 +1,251 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef, memo, useCallback, useEffect, useImperativeHandle, useRef } from 'react';
3
+ import { useEditor } from '@tiptap/react';
4
+ import StarterKit from '@tiptap/starter-kit';
5
+ import TextStyleExt from '@tiptap/extension-text-style';
6
+ import Underline from '@tiptap/extension-underline';
7
+ import Superscript from '@tiptap/extension-superscript';
8
+ import SubScript from '@tiptap/extension-subscript';
9
+ import TextAlign from '@tiptap/extension-text-align';
10
+ import { FontSize } from './extensions/FontSize';
11
+ import Strike from '@tiptap/extension-strike';
12
+ import { TextTransform } from './extensions/TextTransform';
13
+ import { FontFamily } from './extensions/FontFamily';
14
+ import { SelectionDecoration } from './extensions/Selection';
15
+ import { SmartTag } from './extensions/SmartTag';
16
+ import { Indent } from './extensions/Indent';
17
+ import { LineHeight } from './extensions/LineHeight';
18
+ import { Link as LinkExtension } from './extensions/Link';
19
+ import { Toolbar } from './ui/Toolbar/Toolbar';
20
+ import { defaultShouldShowBubbleMenu, handleLinkAction, handleSmartTagAction, isShowLinkMenu, safeParseHTMLContent, } from './utils';
21
+ import { useLinkHandler } from './hooks/useLinkHandler';
22
+ import { useDebouncedCallback } from 'use-debounce';
23
+ import { StyledBubbleMenu, StyledEditorContent } from './styled';
24
+ import { BackgroundColor } from './extensions/BackgroundColor';
25
+ import { isBoolean } from 'lodash';
26
+ import { DEFAULT_TEXT_STYLE } from './constants';
27
+ import { Color } from './extensions/Color';
28
+ import { FontWeight } from './extensions/FontWeight';
29
+ import { useTextEditorStore } from './provider';
30
+ import { useDeepCompareMemo } from '@antscorp/antsomi-ui/es/hooks';
31
+ import { Emoji } from './extensions/Emoji';
32
+ import { emojiSuggestion } from './ui/Emoji';
33
+ import clsx from 'clsx';
34
+ import { ANTSOMI_COMPONENT_PREFIX_CLS } from '@antscorp/antsomi-ui/es/constants';
35
+ import produce from 'immer';
36
+ export const TextEditor = memo(forwardRef((props, ref) => {
37
+ const { id, className, config, editable = true, initialContent, dataAttributes, defaultTextStyle: defaultTextStyleProp, linkHandler: outerLinkHandler, smartTagHandler: outerSmartTagHandler, bubbleMenuProps, style, onUpdate, onFocus, onCreate, } = props;
38
+ const isShowBubbleMenu = useTextEditorStore(state => state.isShowBubbleMenu);
39
+ const setBubbleMenuContainer = useTextEditorStore(state => state.setBubbleMenuContainer);
40
+ const defaultTextStyle = useDeepCompareMemo(() => ({
41
+ ...DEFAULT_TEXT_STYLE,
42
+ ...defaultTextStyleProp,
43
+ }), [defaultTextStyleProp]);
44
+ const handleOnUpdateDebounce = useDebouncedCallback((editor) => {
45
+ const html = editor.getHTML();
46
+ const text = editor.getText();
47
+ const json = editor.getJSON();
48
+ onUpdate?.({ html, text, json });
49
+ }, 400);
50
+ const contentRef = useRef(null);
51
+ const editor = useEditor({
52
+ extensions: [
53
+ StarterKit.configure({
54
+ bulletList: {
55
+ HTMLAttributes: {
56
+ style: 'padding-left:1em;margin:0.5em 0;list-style-type:disc;',
57
+ },
58
+ },
59
+ orderedList: {
60
+ HTMLAttributes: {
61
+ style: 'padding-left:1em;margin:0.5em 0;list-style-type:decimal;',
62
+ },
63
+ },
64
+ listItem: {
65
+ HTMLAttributes: {
66
+ style: 'line-height:normal;',
67
+ },
68
+ },
69
+ }),
70
+ // Text Style Extensions
71
+ FontWeight.configure({
72
+ defaultWeight: defaultTextStyle.fontWeight,
73
+ }),
74
+ LineHeight.configure({
75
+ defaultHeight: defaultTextStyle.lineHeight,
76
+ }),
77
+ FontFamily.configure({
78
+ defaultFontFamily: defaultTextStyle.fontFamily,
79
+ }),
80
+ FontSize.configure({
81
+ defaultFontSize: defaultTextStyle.fontSize,
82
+ }),
83
+ Color.configure({
84
+ defaultColor: defaultTextStyle.color,
85
+ }),
86
+ BackgroundColor.configure({
87
+ defaultBackgroundColor: defaultTextStyle.backgroundColor,
88
+ }),
89
+ TextStyleExt.configure({
90
+ mergeNestedSpanStyles: true,
91
+ }),
92
+ TextTransform,
93
+ Underline,
94
+ Superscript,
95
+ SubScript,
96
+ Strike,
97
+ SelectionDecoration,
98
+ SmartTag.configure({
99
+ highlight: config?.SmartTag?.highlight,
100
+ }),
101
+ TextAlign.configure({
102
+ types: ['heading', 'paragraph'],
103
+ }),
104
+ LinkExtension.configure({
105
+ openOnClick: false,
106
+ HTMLAttributes: {
107
+ class: 'link',
108
+ style: 'text-decoration:inherit;color:inherit;',
109
+ rel: undefined,
110
+ },
111
+ }),
112
+ Indent,
113
+ // ListItemMarker,
114
+ Emoji.configure({
115
+ suggestion: emojiSuggestion({
116
+ container: bubbleMenuProps?.container,
117
+ }),
118
+ }),
119
+ ],
120
+ content: safeParseHTMLContent(initialContent || ''),
121
+ onCreate: ({ editor }) => {
122
+ const html = editor.getHTML();
123
+ const text = editor.getText();
124
+ const json = editor.getJSON();
125
+ onCreate?.({ html, text, json });
126
+ },
127
+ onUpdate: ({ editor }) => {
128
+ handleOnUpdateDebounce(editor);
129
+ },
130
+ onFocus: ({ event }) => {
131
+ onFocus?.(event);
132
+ },
133
+ editorProps: {
134
+ attributes: { spellcheck: 'false' },
135
+ handleKeyDown(view, event) {
136
+ if (event.ctrlKey && event.key === 'k') {
137
+ // Add this line to prevent browser's default behavior.
138
+ event.preventDefault();
139
+ handleLinkAction(view, outerLinkHandler);
140
+ }
141
+ },
142
+ },
143
+ });
144
+ const { setLink, deleteLink, updateLinkAttrsGlobally } = useLinkHandler({
145
+ editor,
146
+ });
147
+ // useStyleMemory(editor);
148
+ useEffect(() => {
149
+ if (editable === undefined) {
150
+ editor?.setEditable(true);
151
+ }
152
+ else if (isBoolean(editable)) {
153
+ editor?.setEditable(editable);
154
+ }
155
+ }, [editor, editable]);
156
+ useEffect(() => {
157
+ if (editor && config?.SmartTag?.highlight !== undefined) {
158
+ editor.chain().updateSmartTagHighlight(config.SmartTag.highlight).run();
159
+ }
160
+ }, [editor, config?.SmartTag?.highlight]);
161
+ useEffect(() => {
162
+ if (!isBoolean(config?.Link?.highlightDynamic)) {
163
+ return;
164
+ }
165
+ updateLinkAttrsGlobally(attrs => produce(attrs, draft => {
166
+ if (!attrs.dynamic)
167
+ return;
168
+ const updatedClass = new Set(String(attrs.class).split(' '));
169
+ if (config?.Link?.highlightDynamic) {
170
+ updatedClass.add('highlight');
171
+ }
172
+ else {
173
+ updatedClass.delete('highlight');
174
+ }
175
+ draft.class = [...updatedClass].join(' ');
176
+ }));
177
+ }, [config?.Link?.highlightDynamic, updateLinkAttrsGlobally]);
178
+ const handleSetSmartTag = useCallback(({ id, content }) => {
179
+ editor?.chain().focus().setSmartTag({ id, content }).run();
180
+ }, [editor]);
181
+ const handleDeleteSmartTag = useCallback(id => {
182
+ editor
183
+ ?.chain()
184
+ .deleteSmartTagGlobally(attrs => attrs.id === id)
185
+ .run();
186
+ }, [editor]);
187
+ const handleUpdateSmartTagAttrs = useCallback((id, updatedAttrs) => editor
188
+ ?.chain()
189
+ .updateSmartTagAttrsGlobally(attrs => {
190
+ if (attrs.id === id)
191
+ return updatedAttrs;
192
+ })
193
+ .run(), [editor]);
194
+ const handleUpdateLinkAttrs = useCallback((id, updatedAttrs) => updateLinkAttrsGlobally((attrs) => {
195
+ if (attrs.id === id)
196
+ return updatedAttrs;
197
+ }), [updateLinkAttrsGlobally]);
198
+ const shouldShowBubbleMenu = useCallback((params) => {
199
+ const { state, view, element } = params;
200
+ if (isShowLinkMenu(state)) {
201
+ return true;
202
+ }
203
+ return defaultShouldShowBubbleMenu({
204
+ state,
205
+ view,
206
+ element,
207
+ editor: params.editor,
208
+ });
209
+ }, []);
210
+ const handleBlur = useCallback((perserveSelection) => {
211
+ if (perserveSelection) {
212
+ editor?.chain().blur().run();
213
+ }
214
+ else {
215
+ editor?.chain().blur().setTextSelection({ from: 0, to: 0 }).run();
216
+ }
217
+ }, [editor]);
218
+ const handleBubbleMenuRef = useCallback((htmlElement) => {
219
+ setBubbleMenuContainer(htmlElement);
220
+ }, [setBubbleMenuContainer]);
221
+ useImperativeHandle(ref, () => ({
222
+ setLink,
223
+ deleteLink,
224
+ updateLinkAttrs: handleUpdateLinkAttrs,
225
+ setSmartTag: handleSetSmartTag,
226
+ deleteSmartTag: handleDeleteSmartTag,
227
+ updateSmartTagAttrs: handleUpdateSmartTagAttrs,
228
+ blur: handleBlur,
229
+ style: contentRef.current?.style,
230
+ editor,
231
+ }));
232
+ if (!editor) {
233
+ return null;
234
+ }
235
+ return (_jsxs(_Fragment, { children: [_jsx(StyledEditorContent, { className: clsx(`${ANTSOMI_COMPONENT_PREFIX_CLS}-text-editor`, className), "$textStyle": defaultTextStyle, style: {
236
+ // Inline styles apply to inner html elements (support email client)
237
+ lineHeight: defaultTextStyle.lineHeight,
238
+ fontFamily: defaultTextStyle.fontFamily,
239
+ fontSize: defaultTextStyle.fontSize,
240
+ color: defaultTextStyle.color,
241
+ ...style,
242
+ }, id: id, ref: contentRef, editor: editor, ...dataAttributes }), _jsx(StyledBubbleMenu, { ref: handleBubbleMenuRef, editor: editor, shouldShow: shouldShowBubbleMenu, ...bubbleMenuProps, children: isShowBubbleMenu && (_jsx(Toolbar, { config: config, editor: editor, linkHanlder: {
243
+ onUpsert: () => {
244
+ handleLinkAction(editor.view, outerLinkHandler);
245
+ },
246
+ }, smartTagHandler: {
247
+ onUpsert: (event) => {
248
+ handleSmartTagAction(event, editor.view, outerSmartTagHandler);
249
+ },
250
+ } })) })] }));
251
+ }));
@@ -0,0 +1,320 @@
1
+ {
2
+ "id": "7ctw1n8f4i31mb8yuoec",
3
+ "type": "text",
4
+ "settings": {
5
+ "link": {
6
+ "data": {
7
+ "2o83ijfx": {
8
+ "text": "Dynamic Link 2\n\n",
9
+ "type": "content-source::csgjqgun::1",
10
+ "index": 1,
11
+ "title": "Same link 1",
12
+ "linkType": "dynamic",
13
+ "attribute": {
14
+ "key": "page_url",
15
+ "label": "Page url",
16
+ "value": "page_url",
17
+ "disabled": false
18
+ },
19
+ "openNewTab": true
20
+ },
21
+ "63g9c32g": {
22
+ "text": "Dynamic Link\n\n",
23
+ "type": "content-source::csgjqgun::1",
24
+ "index": 1,
25
+ "title": "Product Page Dynamic Link",
26
+ "linkType": "dynamic",
27
+ "attribute": {
28
+ "key": "page_url",
29
+ "label": "Page url",
30
+ "value": "page_url",
31
+ "disabled": false
32
+ },
33
+ "openNewTab": true
34
+ },
35
+ "jkeswcp5": {
36
+ "url": "https://ant.design/components/modal",
37
+ "text": "Offer",
38
+ "title": "Test",
39
+ "linkType": "static",
40
+ "openNewTab": false
41
+ },
42
+ "v9sifsn8": {
43
+ "url": "https://claude.ai/new",
44
+ "text": "Bo",
45
+ "title": "Link 1",
46
+ "linkType": "static",
47
+ "openNewTab": true
48
+ }
49
+ },
50
+ "selectedId": ""
51
+ },
52
+ "name": "Text",
53
+ "type": "text",
54
+ "editor": "TextElementEditor",
55
+ "styles": {
56
+ "color": "#000000",
57
+ "fontSize": "16px",
58
+ "fontStyle": "normal",
59
+ "textAlign": "left",
60
+ "fontFamily": "Montserrat",
61
+ "fontWeight": 400,
62
+ "lineHeight": "1",
63
+ "letterSpacing": "0",
64
+ "textTransform": "none",
65
+ "textDecoration": "none"
66
+ },
67
+ "altText": "",
68
+ "dynamic": {
69
+ "data": {
70
+ "awh4d18k": {
71
+ "type": "event-attribute",
72
+ "event": "896830:779154",
73
+ "source": [556430427],
74
+ "attribute": {
75
+ "type": 1,
76
+ "label": "Last modified on",
77
+ "value": "ad_zone.utime",
78
+ "status": 1,
79
+ "children": [],
80
+ "dataType": "datetime",
81
+ "itemTypeId": -1013,
82
+ "itemTypeName": "ad_zone",
83
+ "propertyName": "utime",
84
+ "eventPropertySyntax": "dims.ad_zone_id",
85
+ "datetimeFormatSettings": {
86
+ "type": "datetime",
87
+ "language": "en",
88
+ "hasDateFormat": true,
89
+ "hasTimeFormat": true,
90
+ "dateParseFormat": "MM/DD/YYYY",
91
+ "dateParseOption": "medium",
92
+ "timeParseFormat": "12hour",
93
+ "timeParseOption": "medium",
94
+ "dateFormatString": "MMM DD, YYYY h:mm:ss A"
95
+ }
96
+ },
97
+ "mappingKey": "7ctw1n8f4i31mb8yuoec-awh4d18k",
98
+ "mappingFields": "event.ad_zone.utime"
99
+ },
100
+ "bcz6fw4b": {
101
+ "type": "content-source::csgjqgun::1",
102
+ "index": 1,
103
+ "attribute": {
104
+ "key": "price",
105
+ "label": "Price",
106
+ "value": "price",
107
+ "status": "1",
108
+ "dataType": "number",
109
+ "disabled": false,
110
+ "itemTypeName": "product",
111
+ "numberFormatSettings": {
112
+ "type": "number",
113
+ "decimal": ".",
114
+ "grouping": ",",
115
+ "isCompact": false,
116
+ "prefixType": "code",
117
+ "currencyCode": "USD",
118
+ "decimalPlaces": 2
119
+ }
120
+ },
121
+ "mappingKey": "7ctw1n8f4i31mb8yuoec-bcz6fw4b",
122
+ "mappingFields": "groups.csgjqgun[1].price"
123
+ }
124
+ },
125
+ "highlight": true,
126
+ "selectedId": ""
127
+ },
128
+ "rawHTML": "<div class=\"fr-element fr-view\" dir=\"auto\" contenteditable=\"true\" aria-disabled=\"false\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"false\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\" style=\"font-family: Montserrat;\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><div class=\"fr-element fr-view\" contenteditable=\"true\" dir=\"auto\" spellcheck=\"true\"><p style=\"font-size: 16px;\"><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><span data-dynamic=\"true\" data-dynamic-id=\"bcz6fw4b\" style=\"direction: unset; unicode-bidi: bidi-override; text-align: right; background-color: rgba(0, 199, 97, 0.2);\">******</span> </span></p><p style=\"font-size: 16px;\"><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\">Special </span><span style=\"font-family: Georgia; font-size: 22px; letter-spacing: 0px;\"><a data-link-id=\"v9sifsn8\" href=\"https://claude.ai/new\" target=\"_blank\" title=\"Link 1\"><span style=\"font-weight: 200;\">Bo</span></a><span style=\"font-weight: 200;\">nus</span></span><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"> <a data-link-id=\"jkeswcp5\" href=\"https://ant.design/components/modal\" style=\"color: inherit;\" target=\"_self\" title=\"Test\"><span style=\"color: rgb(147, 101, 184);\">Off</span>er</a> H<span style=\"background-color: rgb(87, 184, 194);\">as Been </span><span data-dynamic=\"true\" data-dynamic-id=\"awh4d18k\" style=\"direction: unset; unicode-bidi: bidi-override; text-align: right; background-color: rgb(87, 184, 194); color: rgb(226, 80, 65);\"><strong><em>Last modified on</em></strong></span></span></p><p style=\"font-size: 16px;\"><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><span style=\"background-color: rgb(87, 184, 194);\">c</span>ó <strong><em>chuyện</em></strong> gì <strong><u>hô</u></strong></span><strong>m <span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\">nay không?&nbsp;</span></strong></p><p style=\"font-size: 16px;\"></p><p><a data-dynamic=\"true\" data-link-id=\"63g9c32g\" href=\"https://sandbox-magento.antsomi.com/argus-all-weather-tank.html\" style=\"background-color: rgba(0, 199, 97, 0.2);\" target=\"_blank\" title=\"Product Page Dynamic Link\"><span style=\"font-size: 22px;\"><strong>Dynamic Link\n\n</strong></span></a></p><p style=\"font-size: 16px;\"><strong></strong></p><p style=\"font-size: 16px;\"><strong></strong><a data-link-id=\"2o83ijfx\" data-dynamic=\"true\" title=\"Same link 1\" target=\"_blank\" href=\"https://sandbox-magento.antsomi.com/montana-wind-jacket.html\" style=\"background-color: rgba(0, 199, 97, 0.2);\"><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\">Dynamic Link 2\n\n</span></strong></a></p><p style=\"font-size: 16px;\"><strong></strong></p><p style=\"font-size: 16px;\"><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\">Danh sách</span></strong></p><ul style=\"font-size: 16px;\"><li style=\"line-height: 2.3;\"><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\">Giá trị 1</span></strong></li><li style=\"line-height: 2.3;\"><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><strong>Giá <span style=\"color: rgb(137, 18, 221);\">t<em>r</em>ị</span> 2</strong></span></strong></li><li style=\"line-height: 2.3;\"><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\">Giá trị 3</span></strong></li></ul><p style=\"font-size: 16px;\"><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><em>Number list</em></span></strong></p><ol style=\"font-size: 16px;\"><li><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><em>Item 1</em></span></strong></li><li><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><em>Item 2</em></span></strong></li><li><strong><span style=\"font-family: Montserrat; font-size: 22px; letter-spacing: 0px;\"><em>Item 3</em></span></strong></li></ol></div></div></div></div></div></div></div></div></div></div></div>",
129
+ "component": "TextElement",
130
+ "linkStyles": {
131
+ "color": "#1e5494",
132
+ "textDecoration": "underline"
133
+ },
134
+ "blockStyles": {
135
+ "top": "0px",
136
+ "left": "0px",
137
+ "right": "0px",
138
+ "width": "auto",
139
+ "bottom": "0px",
140
+ "height": "auto",
141
+ "zIndex": 0,
142
+ "maxWidth": "100%",
143
+ "position": "relative",
144
+ "boxShadow": "none",
145
+ "marginTop": "0px",
146
+ "background": "transparent",
147
+ "marginLeft": "0px",
148
+ "paddingTop": "0px",
149
+ "borderColor": "#000000",
150
+ "borderStyle": "none",
151
+ "marginRight": "0px",
152
+ "paddingLeft": "0px",
153
+ "marginBottom": "0px",
154
+ "paddingRight": "0px",
155
+ "paddingBottom": "0px",
156
+ "borderTopWidth": "0px",
157
+ "borderLeftWidth": "0px",
158
+ "borderRightWidth": "0px",
159
+ "borderBottomWidth": "0px",
160
+ "borderTopLeftRadius": "0px",
161
+ "borderTopRightRadius": "0px",
162
+ "borderBottomLeftRadius": "0px",
163
+ "borderBottomRightRadius": "0px"
164
+ },
165
+ "breakpoints": {
166
+ "sm": {
167
+ "blockStyles": {},
168
+ "blockHoverStyles": {},
169
+ "blockStylesSettings": {},
170
+ "blockHoverStylesSettings": {}
171
+ }
172
+ },
173
+ "textStyling": {
174
+ "isEllipsisText": true,
175
+ "selectLineDisplay": ""
176
+ },
177
+ "blockHoverStyles": {
178
+ "top": "0px",
179
+ "left": "0px",
180
+ "right": "0px",
181
+ "width": "auto",
182
+ "bottom": "0px",
183
+ "height": "auto",
184
+ "zIndex": 0,
185
+ "maxWidth": "100%",
186
+ "position": "relative",
187
+ "boxShadow": "none",
188
+ "marginTop": "0px",
189
+ "background": "transparent",
190
+ "marginLeft": "0px",
191
+ "paddingTop": "0px",
192
+ "borderColor": "#000000",
193
+ "borderStyle": "none",
194
+ "marginRight": "0px",
195
+ "paddingLeft": "0px",
196
+ "marginBottom": "0px",
197
+ "paddingRight": "0px",
198
+ "paddingBottom": "0px",
199
+ "borderTopWidth": "0px",
200
+ "borderLeftWidth": "0px",
201
+ "borderRightWidth": "0px",
202
+ "borderBottomWidth": "0px",
203
+ "borderTopLeftRadius": "0px",
204
+ "borderTopRightRadius": "0px",
205
+ "borderBottomLeftRadius": "0px",
206
+ "borderBottomRightRadius": "0px"
207
+ },
208
+ "blockStylesSettings": {
209
+ "hidden": false,
210
+ "customId": "",
211
+ "gradients": [
212
+ {
213
+ "gradientColor": "#ffffff",
214
+ "gradientColorLocation": 0
215
+ },
216
+ {
217
+ "gradientColor": "#000000",
218
+ "gradientColorLocation": 50
219
+ }
220
+ ],
221
+ "customClass": "",
222
+ "linearAngle": 45,
223
+ "gradientType": "linear-gradient",
224
+ "heightSuffix": "auto",
225
+ "marginSuffix": "px",
226
+ "boxShadowBlur": "0px",
227
+ "paddingSuffix": "px",
228
+ "backgroundSize": "cover",
229
+ "boxShadowColor": "#ffffff",
230
+ "boxShadowInset": false,
231
+ "boxShadowStyle": "none",
232
+ "radialPosition": "center center",
233
+ "backgroundColor": "transparent",
234
+ "boxShadowSpread": "0px",
235
+ "backgroundRepeat": "no-repeat",
236
+ "displayCondition": {
237
+ "pool": null,
238
+ "type": "visitor-attribute",
239
+ "value": "2025-04-22 23:59:59",
240
+ "operator": "after_date",
241
+ "attribute": {
242
+ "key": "date_created",
243
+ "label": "Created date",
244
+ "value": "date_created",
245
+ "status": 1,
246
+ "dataType": "datetime",
247
+ "disabled": false,
248
+ "displayFormat": {
249
+ "type": "DATE_AND_TIME",
250
+ "config": {}
251
+ }
252
+ },
253
+ "condition": "show_when",
254
+ "time_unit": "",
255
+ "value_type": "normal",
256
+ "event_metadata": {}
257
+ },
258
+ "borderRadiusStyle": "none",
259
+ "boxShadowVertical": "0px",
260
+ "linkedMarginInput": true,
261
+ "backgroundPosition": "left top",
262
+ "borderRadiusSuffix": "px",
263
+ "linkedPaddingInput": false,
264
+ "boxShadowHorizontal": "0px",
265
+ "backgroundColorStyle": "color",
266
+ "linkedBorderWidthInput": true,
267
+ "linkedBorderRadiusInput": true
268
+ },
269
+ "defaultDynamicIndex": 1,
270
+ "blockHoverStylesSettings": {
271
+ "hidden": false,
272
+ "customId": "",
273
+ "editHover": false,
274
+ "gradients": [
275
+ {
276
+ "gradientColor": "#ffffff",
277
+ "gradientColorLocation": 0
278
+ },
279
+ {
280
+ "gradientColor": "#000000",
281
+ "gradientColorLocation": 50
282
+ }
283
+ ],
284
+ "customClass": "",
285
+ "linearAngle": 45,
286
+ "gradientType": "linear-gradient",
287
+ "heightSuffix": "auto",
288
+ "marginSuffix": "px",
289
+ "boxShadowBlur": "0px",
290
+ "paddingSuffix": "px",
291
+ "backgroundSize": "cover",
292
+ "boxShadowColor": "#ffffff",
293
+ "boxShadowInset": false,
294
+ "boxShadowStyle": "none",
295
+ "radialPosition": "center center",
296
+ "backgroundColor": "transparent",
297
+ "boxShadowSpread": "0px",
298
+ "backgroundRepeat": "no-repeat",
299
+ "displayCondition": {
300
+ "type": "",
301
+ "index": 1,
302
+ "value": "",
303
+ "operator": "",
304
+ "attribute": {},
305
+ "condition": ""
306
+ },
307
+ "borderRadiusStyle": "none",
308
+ "boxShadowVertical": "0px",
309
+ "linkedMarginInput": true,
310
+ "backgroundPosition": "left top",
311
+ "borderRadiusSuffix": "px",
312
+ "linkedPaddingInput": false,
313
+ "boxShadowHorizontal": "0px",
314
+ "backgroundColorStyle": "color",
315
+ "linkedBorderWidthInput": true,
316
+ "linkedBorderRadiusInput": true
317
+ }
318
+ },
319
+ "createdAt": "18/04/2025 - 11:03:44"
320
+ }
@@ -0,0 +1 @@
1
+ export declare const HTML_DOM: string;
@@ -0,0 +1,38 @@
1
+ import SETTINGS from './text-block.settings.json';
2
+ const CONTENT_WITH_INHERITED_STYLES = `
3
+ <div class="fr-box" role="application">
4
+ <div class="fr-wrapper" dir="auto">
5
+ <div class="fr-element fr-view" dir="auto" contenteditable="true" aria-disabled="false" spellcheck="true">
6
+ <p style="text-align: center;">
7
+ <span style="font-family: Montserrat; font-size: 22px; letter-spacing: 0px; color: rgb(0, 0, 0);">
8
+ <span id="isPasted" style="font-weight: 800; font-size: 34px; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; text-align: center; text-transform: none; color: rgb(77, 96, 116);">Receive&nbsp;</span>
9
+ <span style="font-weight: 400; font-size: 34px; line-height: inherit; font-family: Montserrat; color: rgb(0, 0, 0); letter-spacing: normal; text-align: center; text-transform: none;">
10
+ <span style="font-weight: 800; font-size: inherit; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; color: rgb(255, 79, 66);"><u>10% Off</u></span>
11
+ </span>
12
+ <span style="font-weight: 800; font-size: 34px; line-height: inherit; font-family: Montserrat; letter-spacing: 0px; text-align: center; text-transform: none; color: rgb(77, 96, 116);">&nbsp;Your First Order!</span>
13
+ </span>
14
+ </p>
15
+ </div>
16
+ <span class="fr-placeholder" style="font-size: 12px; line-height: 12px; margin-top: 0px; padding-top: 0px; padding-left: 0px; margin-left: 0px; padding-right: 0px; margin-right: 0px; text-align: left;">Enter your text here</span>
17
+ </div>
18
+ </div>
19
+ `;
20
+ export const HTML_DOM = `<!doctype html>
21
+ <html lang="en">
22
+ <head>
23
+ <meta charset="UTF-8" />
24
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
25
+ <title>Raw HTML</title>
26
+ </head>
27
+ <body>
28
+ <p style="line-height: 1.4; text-align: center;">
29
+ <span style="font-family: Poppins; font-weight: 500;">Enter your email address below for a chance to spin the wheel and save big on your next purchase. <span class="fr-emoticon fr-deletable">😁</span></span>
30
+ <span style="font-family: Montserrat; font-size: 22px; letter-spacing: 0px; color: rgb(0, 0, 0);"></span>
31
+ </p>
32
+
33
+ ${CONTENT_WITH_INHERITED_STYLES}
34
+
35
+ ${SETTINGS.settings.rawHTML}
36
+ </body>
37
+ </html>
38
+ `;