@procore/text-editor 0.0.3 → 0.2.0

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 (42) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +50 -24
  3. package/codemod/__fixtures__/src/components/MultilineFormRichText.tsx +2 -1
  4. package/codemod/text-editor-migrate.js +54 -0
  5. package/codemod/text-editor-migrate.test.js +9 -0
  6. package/dist/DebouncedTextEditor/DebouncedTextEditor.d.ts +35 -0
  7. package/dist/DebouncedTextEditor/DebouncedTextEditor.js +71 -0
  8. package/dist/DebouncedTextEditor/DebouncedTextEditor.js.map +1 -0
  9. package/dist/DebouncedTextEditor/index.d.ts +1 -0
  10. package/dist/DebouncedTextEditor/index.js +2 -0
  11. package/dist/DebouncedTextEditor/index.js.map +1 -0
  12. package/dist/TextEditor/TextEditor.d.ts +1 -1
  13. package/dist/TextEditor/TextEditor.js +90 -36
  14. package/dist/TextEditor/TextEditor.js.map +1 -1
  15. package/dist/TextEditor/TextEditor.styles.js +1 -1
  16. package/dist/TextEditor/TextEditor.types.d.ts +38 -30
  17. package/dist/TextEditor/TextEditor.types.js.map +1 -1
  18. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js +2 -1
  19. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -1
  20. package/dist/TextEditor/utils/config.js +3 -3
  21. package/dist/TextEditor/utils/config.js.map +1 -1
  22. package/dist/TextEditor/utils/index.d.ts +0 -1
  23. package/dist/TextEditor/utils/index.js +0 -1
  24. package/dist/TextEditor/utils/index.js.map +1 -1
  25. package/dist/TextEditorOutput/TextEditorOutput.styles.js +1 -1
  26. package/dist/_storyHelpers/constants.d.ts +1 -0
  27. package/dist/_storyHelpers/constants.js +2 -1
  28. package/dist/_storyHelpers/constants.js.map +1 -1
  29. package/dist/_typedoc/TextEditor/TextEditor.types.json +57 -47
  30. package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +2 -2
  31. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +3 -3
  32. package/dist/_typedoc/deprecations.json +1 -1
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +1 -0
  35. package/dist/index.js.map +1 -1
  36. package/dist/utils/debounce.d.ts +1 -0
  37. package/dist/utils/debounce.js +24 -0
  38. package/dist/utils/debounce.js.map +1 -0
  39. package/package.json +13 -12
  40. package/dist/TextEditor/utils/plugins.d.ts +0 -7
  41. package/dist/TextEditor/utils/plugins.js +0 -184
  42. package/dist/TextEditor/utils/plugins.js.map +0 -1
@@ -18,7 +18,7 @@ export var GlobalEditorStyles = /*#__PURE__*/createGlobalStyle([":root{--ck-z-de
18
18
  });
19
19
  export var StyledTextEditor = /*#__PURE__*/styled.div.withConfig({
20
20
  displayName: "StyledTextEditor",
21
- componentId: "text-editor-0_0_3__sc-iim79x-0"
21
+ componentId: "text-editor-0_2_0__sc-iim79x-0"
22
22
  })(["", ""], function (_ref6) {
23
23
  var error = _ref6.error;
24
24
  return error && "\n .ck-sticky-panel__content {\n border-top-color: ".concat(colors.red50, " !important;\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n }\n\n .ck-editor__editable {\n border-left-color: ").concat(colors.red50, " !important;\n border-right-color: ").concat(colors.red50, " !important;\n border-bottom-color: ").concat(colors.red50, " !important;\n }\n ");
@@ -1,10 +1,10 @@
1
- import type { Locale } from '@procore/core-react';
2
- import type { ClassicEditor, EditorConfig, EventInfo } from 'ckeditor5';
1
+ import type { Locale } from '@procore/globalization-toolkit';
2
+ import type { ClassicEditor, EventInfo } from 'ckeditor5';
3
3
  export interface TextEditorProps {
4
4
  /**
5
5
  * Unique identifier for the editor
6
6
  *
7
- * @since 10.19.0
7
+ * @since 0.0.1
8
8
  */
9
9
  id?: string;
10
10
  /**
@@ -12,74 +12,82 @@ export interface TextEditorProps {
12
12
  *
13
13
  * @deprecated `initialValue` has been deprecated and will be removed in a future version.
14
14
  * Please use the `value` prop instead
15
- * @deprecatedSince 10.20.0
16
- * @since 10.19.0
15
+ * @deprecatedSince 0.0.1
16
+ * @since 0.0.1
17
17
  */
18
18
  initialValue?: string;
19
19
  /**
20
20
  * The current value of the editor
21
21
  *
22
- * @since 10.19.0
22
+ * @since 0.0.1
23
23
  */
24
24
  value?: string;
25
25
  /**
26
26
  * Indicates if the editor is disabled
27
27
  *
28
- * @since 10.19.0
28
+ * @since 0.0.1
29
29
  */
30
30
  disabled?: boolean;
31
31
  /**
32
32
  * Indicates if the editor is in an error state
33
33
  *
34
- * @since 10.19.0
34
+ * @since 0.0.1
35
35
  */
36
36
  error?: boolean;
37
37
  /**
38
- * Locale which will be used for localization. Can be passed directly or
39
- * set by wrapping components in I18n provider.
40
- * @since 10.19.0
38
+ * Indicates if the editor is in readonly mode.
39
+ * When true, renders the content using TextEditorOutput instead of the editable editor.
40
+ *
41
+ * @since 0.2.0
41
42
  */
42
- locale?: Locale;
43
+ readonly?: boolean;
43
44
  /**
44
- * Array of plugin names to add to the editor in addition to the defaults.
45
- * This provides backward compatibility with the deprecated TinyMCE version of the editor.
46
- * Supports plugin names like 'link', 'image', 'table', etc.
45
+ * Accessible label for the editor's editable area. This text will be
46
+ * announced by screen readers when the user focuses the editor. It should
47
+ * match or include the visible label associated with this editor field.
48
+ * If not provided, screen readers will announce a generic "Rich Text Editor" message.
47
49
  *
48
- * @since 12.26.0
50
+ * @since 0.1.0
49
51
  */
50
- plugins?: string[];
52
+ 'aria-label'?: string;
51
53
  /**
52
- * Configuration function for customizing the editor
54
+ * Accessible description for the editor's editable area.
55
+ * This text provides additional context to screen reader users. It will be
56
+ * announced after the label when the user focuses the editor.
53
57
  *
54
- * @param defaultConfig - The default CKEditor configuration
55
- * @returns Customized configuration object
56
- * @since 12.26.0
58
+ * @since 0.1.0
57
59
  */
58
- config?: (defaultConfig: EditorConfig) => EditorConfig;
60
+ 'aria-description'?: string;
61
+ /**
62
+ * Locale which will be used for localization. Can be passed directly or
63
+ * set by wrapping components in I18n provider.
64
+ * @since 0.0.1
65
+ */
66
+ locale?: Locale;
59
67
  /**
60
68
  * Callback fired when the editor content changes
61
69
  *
62
70
  * @param value - The current content of the editor
63
71
  * @param isDirty - Whether the content differs from the initial value
64
- * @since 10.19.0
72
+ * @since 0.0.1
65
73
  */
66
74
  onChange?: (value: string, isDirty?: boolean) => void;
67
75
  /**
68
76
  * Callback fired when the editor gains focus
69
77
  *
70
- * @since 10.19.0
78
+ * @since 0.0.1
71
79
  */
72
80
  onFocus?: (event: EventInfo, editor: ClassicEditor) => void;
73
81
  /**
74
82
  * Callback fired when the editor loses focus
75
83
  *
76
- * @since 10.19.0
84
+ * @since 0.0.1
77
85
  */
78
86
  onBlur?: (event: EventInfo, editor: ClassicEditor) => void;
79
87
  /**
80
88
  * Callback fired when an error occurs in the editor
81
89
  *
82
- * @since 10.19.0
90
+ * @since 0.0.1
83
91
  */
84
92
  onError?: (error: Error, details: {
85
93
  phase: 'initialization' | 'runtime';
@@ -88,19 +96,19 @@ export interface TextEditorProps {
88
96
  /**
89
97
  * Callback fired when the editor is ready
90
98
  *
91
- * @since 10.19.0
99
+ * @since 0.0.1
92
100
  */
93
101
  onInit?: (editor: ClassicEditor) => void;
94
102
  /**
95
103
  * Callback fired after the editor instance is destroyed
96
104
  *
97
- * @since 10.19.0
105
+ * @since 0.0.1
98
106
  */
99
107
  onAfterDestroy?: () => void;
100
108
  /**
101
109
  * Callback fired when the editor becomes dirty (content differs from initial value)
102
110
  *
103
- * @since 12.26.0
111
+ * @since 0.0.1
104
112
  */
105
113
  onDirty?: () => void;
106
114
  /**
@@ -108,7 +116,7 @@ export interface TextEditorProps {
108
116
  *
109
117
  * @param event - The keyboard event
110
118
  * @param editor - The CKEditor instance
111
- * @since 12.29.0
119
+ * @since 0.0.1
112
120
  */
113
121
  onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void;
114
122
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { Locale } from '@procore/core-react'\nimport type { ClassicEditor, EditorConfig, EventInfo } from 'ckeditor5'\n\nexport interface TextEditorProps {\n /**\n * Unique identifier for the editor\n *\n * @since 10.19.0\n */\n id?: string\n\n /**\n * Initial value of the editor\n *\n * @deprecated `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n * @deprecatedSince 10.20.0\n * @since 10.19.0\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 10.19.0\n */\n value?: string\n\n /**\n * Indicates if the editor is disabled\n *\n * @since 10.19.0\n */\n disabled?: boolean\n\n /**\n * Indicates if the editor is in an error state\n *\n * @since 10.19.0\n */\n error?: boolean\n\n /**\n * Locale which will be used for localization. Can be passed directly or\n * set by wrapping components in I18n provider.\n * @since 10.19.0\n */\n locale?: Locale\n\n /**\n * Array of plugin names to add to the editor in addition to the defaults.\n * This provides backward compatibility with the deprecated TinyMCE version of the editor.\n * Supports plugin names like 'link', 'image', 'table', etc.\n *\n * @since 12.26.0\n */\n plugins?: string[]\n\n /**\n * Configuration function for customizing the editor\n *\n * @param defaultConfig - The default CKEditor configuration\n * @returns Customized configuration object\n * @since 12.26.0\n */\n config?: (defaultConfig: EditorConfig) => EditorConfig\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @param isDirty - Whether the content differs from the initial value\n * @since 10.19.0\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor gains focus\n *\n * @since 10.19.0\n */\n onFocus?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 10.19.0\n */\n onBlur?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when an error occurs in the editor\n *\n * @since 10.19.0\n */\n onError?: (\n error: Error,\n details: {\n phase: 'initialization' | 'runtime'\n willEditorRestart?: boolean\n }\n ) => void\n\n /**\n * Callback fired when the editor is ready\n *\n * @since 10.19.0\n */\n onInit?: (editor: ClassicEditor) => void\n\n /**\n * Callback fired after the editor instance is destroyed\n *\n * @since 10.19.0\n */\n onAfterDestroy?: () => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 12.26.0\n */\n onDirty?: () => void\n\n /**\n * Callback fired when a key is pressed in the editor\n *\n * @param event - The keyboard event\n * @param editor - The CKEditor instance\n * @since 12.29.0\n */\n onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void\n}\n\nexport type KeyDownListener = (\n event: EventInfo,\n data: { domEvent: Event }\n) => void\n"],"mappings":""}
1
+ {"version":3,"file":"TextEditor.types.js","names":[],"sources":["../../src/TextEditor/TextEditor.types.ts"],"sourcesContent":["import type { Locale } from '@procore/globalization-toolkit'\nimport type { ClassicEditor, EventInfo } from 'ckeditor5'\n\nexport interface TextEditorProps {\n /**\n * Unique identifier for the editor\n *\n * @since 0.0.1\n */\n id?: string\n\n /**\n * Initial value of the editor\n *\n * @deprecated `initialValue` has been deprecated and will be removed in a future version.\n * Please use the `value` prop instead\n * @deprecatedSince 0.0.1\n * @since 0.0.1\n */\n initialValue?: string\n\n /**\n * The current value of the editor\n *\n * @since 0.0.1\n */\n value?: string\n\n /**\n * Indicates if the editor is disabled\n *\n * @since 0.0.1\n */\n disabled?: boolean\n\n /**\n * Indicates if the editor is in an error state\n *\n * @since 0.0.1\n */\n error?: boolean\n\n /**\n * Indicates if the editor is in readonly mode.\n * When true, renders the content using TextEditorOutput instead of the editable editor.\n *\n * @since 0.2.0\n */\n readonly?: boolean\n\n /**\n * Accessible label for the editor's editable area. This text will be\n * announced by screen readers when the user focuses the editor. It should\n * match or include the visible label associated with this editor field.\n * If not provided, screen readers will announce a generic \"Rich Text Editor\" message.\n *\n * @since 0.1.0\n */\n 'aria-label'?: string\n\n /**\n * Accessible description for the editor's editable area.\n * This text provides additional context to screen reader users. It will be\n * announced after the label when the user focuses the editor.\n *\n * @since 0.1.0\n */\n 'aria-description'?: string\n\n /**\n * Locale which will be used for localization. Can be passed directly or\n * set by wrapping components in I18n provider.\n * @since 0.0.1\n */\n locale?: Locale\n\n /**\n * Callback fired when the editor content changes\n *\n * @param value - The current content of the editor\n * @param isDirty - Whether the content differs from the initial value\n * @since 0.0.1\n */\n onChange?: (value: string, isDirty?: boolean) => void\n\n /**\n * Callback fired when the editor gains focus\n *\n * @since 0.0.1\n */\n onFocus?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when the editor loses focus\n *\n * @since 0.0.1\n */\n onBlur?: (event: EventInfo, editor: ClassicEditor) => void\n\n /**\n * Callback fired when an error occurs in the editor\n *\n * @since 0.0.1\n */\n onError?: (\n error: Error,\n details: {\n phase: 'initialization' | 'runtime'\n willEditorRestart?: boolean\n }\n ) => void\n\n /**\n * Callback fired when the editor is ready\n *\n * @since 0.0.1\n */\n onInit?: (editor: ClassicEditor) => void\n\n /**\n * Callback fired after the editor instance is destroyed\n *\n * @since 0.0.1\n */\n onAfterDestroy?: () => void\n\n /**\n * Callback fired when the editor becomes dirty (content differs from initial value)\n *\n * @since 0.0.1\n */\n onDirty?: () => void\n\n /**\n * Callback fired when a key is pressed in the editor\n *\n * @param event - The keyboard event\n * @param editor - The CKEditor instance\n * @since 0.0.1\n */\n onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void\n}\n\nexport type KeyDownListener = (\n event: EventInfo,\n data: { domEvent: Event }\n) => void\n"],"mappings":""}
@@ -1,3 +1,4 @@
1
+ import { colors, spacing } from '@procore/core-react';
1
2
  import { createGlobalStyle } from 'styled-components';
2
3
  import { alignCenterIcon, alignLeftIcon, alignRightIcon, bgColorIcon, boldIcon, checkmarkIcon, cutIcon, fontSizeIcon, imageIcon, indentIcon, italicIcon, linkIcon, orderedListIcon, outdentIcon, pasteAsTextIcon, pasteIcon, redoIcon, strikeThroughIcon, tableIcon, textColorIcon, underlineIcon, undoIcon, unorderedListIcon } from './icons';
3
4
  var getIconUrl = function getIconUrl(icon) {
@@ -6,5 +7,5 @@ var getIconUrl = function getIconUrl(icon) {
6
7
  }
7
8
  return "data:image/svg+xml;charset=utf-8,".concat(encodeURIComponent(icon));
8
9
  };
9
- export var TextEditorTheme = /*#__PURE__*/createGlobalStyle([".ck-button:first-child .ck-icon:first-child{background-size:24px;background-repeat:no-repeat;background-position:center;}[data-cke-command=\"bold\"],[data-cke-command=\"italic\"],[data-cke-command=\"underline\"],[data-cke-command=\"strikethrough\"],[data-cke-command=\"alignment:left\"],[data-cke-command=\"alignment:center\"],[data-cke-command=\"alignment:right\"],[data-cke-command=\"bulletedList\"],[data-cke-command=\"numberedList\"],[data-cke-command=\"outdent\"],[data-cke-command=\"indent\"],[data-cke-command=\"cut\"],[data-cke-command=\"paste\"],[data-cke-command=\"pasteAsText\"],[data-cke-command=\"fontSize\"],[data-cke-command=\"fontColor\"],[data-cke-command=\"fontBackgroundColor\"],[data-cke-command=\"link\"],[data-cke-command=\"insertTable\"],[data-cke-command=\"insertImageViaUrl\"],[data-cke-command=\"undo\"],[data-cke-command=\"redo\"]{> .ck-icon:first-child > *,> .ck-button:first-child > .ck-icon:first-child > *,> .ck-splitbutton > .ck-button:first-child > .ck-icon:first-child > *{display:none;}> .ck-icon:first-child,> .ck-splitbutton > .ck-button:first-child .ck-icon:first-child,> .ck-button > .ck-icon:first-child{width:24px !important;height:24px !important;}}[data-cke-command=\"bold\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"italic\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"underline\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"strikethrough\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"alignment:left\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"alignment:center\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"alignment:right\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"bulletedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"numberedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"outdent\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"indent\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"cut\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"paste\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"pasteAsText\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"fontSize\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');background-size:19px;}[data-cke-command=\"fontColor\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"fontBackgroundColor\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"link\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"insertTable\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"insertImageViaUrl\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"undo\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"redo\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"fontSize\"] .ck-dropdown__panel{max-width:130px !important;.ck-list__item{min-width:128px !important;}.ck-list{.ck-button{padding:4px 12px !important;font-size:14px !important;line-height:24px !important;.ck-button__label{font-size:14px !important;font-weight:normal !important;font-family:inherit !important;line-height:24px !important;}&[data-cke-tooltip-text]{font-size:14px !important;.ck-button__label{font-size:14px !important;}}&.ck-on{position:relative;padding-right:32px !important;&::after{content:\"\";position:absolute;right:8px;top:50%;transform:translateY(-50%);width:24px !important;height:24px !important;background-image:url('", "');background-size:24px 24px;background-repeat:no-repeat;background-position:center;line-height:1;}}}}.ck-list-item-button__check-holder{display:none !important;}}"], getIconUrl(boldIcon), getIconUrl(italicIcon), getIconUrl(underlineIcon), getIconUrl(strikeThroughIcon), getIconUrl(alignLeftIcon), getIconUrl(alignCenterIcon), getIconUrl(alignRightIcon), getIconUrl(unorderedListIcon), getIconUrl(orderedListIcon), getIconUrl(outdentIcon), getIconUrl(indentIcon), getIconUrl(cutIcon), getIconUrl(pasteIcon), getIconUrl(pasteAsTextIcon), getIconUrl(fontSizeIcon), getIconUrl(textColorIcon), getIconUrl(bgColorIcon), getIconUrl(linkIcon), getIconUrl(tableIcon), getIconUrl(imageIcon), getIconUrl(undoIcon), getIconUrl(redoIcon), getIconUrl(checkmarkIcon));
10
+ export var TextEditorTheme = /*#__PURE__*/createGlobalStyle([".ck-button:first-child .ck-icon:first-child{background-size:24px;background-repeat:no-repeat;background-position:center;}.ck-link-form .ck-button-action{font-size:13px !important;line-height:", " !important;background:", " !important;color:", " !important;border-radius:", " !important;font-family:inherit !important;font-weight:600 !important;height:", " !important;justify-content:center !important;align-items:center !important;cursor:pointer !important;&:hover{background:", " !important;}}[data-cke-command=\"bold\"],[data-cke-command=\"italic\"],[data-cke-command=\"underline\"],[data-cke-command=\"strikethrough\"],[data-cke-command=\"alignment:left\"],[data-cke-command=\"alignment:center\"],[data-cke-command=\"alignment:right\"],[data-cke-command=\"bulletedList\"],[data-cke-command=\"numberedList\"],[data-cke-command=\"outdent\"],[data-cke-command=\"indent\"],[data-cke-command=\"cut\"],[data-cke-command=\"paste\"],[data-cke-command=\"pasteAsText\"],[data-cke-command=\"fontSize\"],[data-cke-command=\"fontColor\"],[data-cke-command=\"fontBackgroundColor\"],[data-cke-command=\"link\"],[data-cke-command=\"insertTable\"],[data-cke-command=\"insertImageViaUrl\"],[data-cke-command=\"undo\"],[data-cke-command=\"redo\"]{> .ck-icon:first-child > *,> .ck-button:first-child > .ck-icon:first-child > *,> .ck-splitbutton > .ck-button:first-child > .ck-icon:first-child > *{display:none;}> .ck-icon:first-child,> .ck-splitbutton > .ck-button:first-child .ck-icon:first-child,> .ck-button > .ck-icon:first-child{width:24px !important;height:24px !important;}}[data-cke-command=\"bold\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"italic\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"underline\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"strikethrough\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"alignment:left\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"alignment:center\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"alignment:right\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"bulletedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"numberedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"outdent\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"indent\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"cut\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"paste\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"pasteAsText\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"fontSize\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');background-size:19px;}[data-cke-command=\"fontColor\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"fontBackgroundColor\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"link\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"insertTable\"] > .ck-button > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"insertImageViaUrl\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"undo\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"redo\"] > .ck-icon:first-child{background-image:url('", "');}[data-cke-command=\"fontSize\"] .ck-dropdown__panel{max-width:130px !important;.ck-list__item{min-width:128px !important;}.ck-list{.ck-button{padding:4px 12px !important;font-size:14px !important;line-height:24px !important;.ck-button__label{font-size:14px !important;font-weight:normal !important;font-family:inherit !important;line-height:24px !important;}&[data-cke-tooltip-text]{font-size:14px !important;.ck-button__label{font-size:14px !important;}}&.ck-on{position:relative;padding-right:32px !important;&::after{content:\"\";position:absolute;right:8px;top:50%;transform:translateY(-50%);width:24px !important;height:24px !important;background-image:url('", "');background-size:24px 24px;background-repeat:no-repeat;background-position:center;line-height:1;}}}}.ck-list-item-button__check-holder{display:none !important;}}"], spacing.lg, colors.gray90, colors.gray15, spacing.xs, spacing.xl, colors.gray85, getIconUrl(boldIcon), getIconUrl(italicIcon), getIconUrl(underlineIcon), getIconUrl(strikeThroughIcon), getIconUrl(alignLeftIcon), getIconUrl(alignCenterIcon), getIconUrl(alignRightIcon), getIconUrl(unorderedListIcon), getIconUrl(orderedListIcon), getIconUrl(outdentIcon), getIconUrl(indentIcon), getIconUrl(cutIcon), getIconUrl(pasteIcon), getIconUrl(pasteAsTextIcon), getIconUrl(fontSizeIcon), getIconUrl(textColorIcon), getIconUrl(bgColorIcon), getIconUrl(linkIcon), getIconUrl(tableIcon), getIconUrl(imageIcon), getIconUrl(undoIcon), getIconUrl(redoIcon), getIconUrl(checkmarkIcon));
10
11
  //# sourceMappingURL=textEditorTheming.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"textEditorTheming.styles.js","names":["createGlobalStyle","alignCenterIcon","alignLeftIcon","alignRightIcon","bgColorIcon","boldIcon","checkmarkIcon","cutIcon","fontSizeIcon","imageIcon","indentIcon","italicIcon","linkIcon","orderedListIcon","outdentIcon","pasteAsTextIcon","pasteIcon","redoIcon","strikeThroughIcon","tableIcon","textColorIcon","underlineIcon","undoIcon","unorderedListIcon","getIconUrl","icon","startsWith","concat","encodeURIComponent","TextEditorTheme"],"sources":["../../../src/TextEditor/textEditorTheming/textEditorTheming.styles.ts"],"sourcesContent":["import { createGlobalStyle } from 'styled-components'\nimport {\n alignCenterIcon,\n alignLeftIcon,\n alignRightIcon,\n bgColorIcon,\n boldIcon,\n checkmarkIcon,\n cutIcon,\n fontSizeIcon,\n imageIcon,\n indentIcon,\n italicIcon,\n linkIcon,\n orderedListIcon,\n outdentIcon,\n pasteAsTextIcon,\n pasteIcon,\n redoIcon,\n strikeThroughIcon,\n tableIcon,\n textColorIcon,\n underlineIcon,\n undoIcon,\n unorderedListIcon,\n} from './icons'\n\nconst getIconUrl = (icon: string) => {\n if (icon.startsWith('data:')) {\n return icon\n }\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(icon)}`\n}\n\nexport const TextEditorTheme = createGlobalStyle`\n .ck-button:first-child .ck-icon:first-child {\n background-size: 24px;\n background-repeat: no-repeat;\n background-position: center;\n }\n\n [data-cke-command=\"bold\"],\n [data-cke-command=\"italic\"],\n [data-cke-command=\"underline\"],\n [data-cke-command=\"strikethrough\"],\n [data-cke-command=\"alignment:left\"],\n [data-cke-command=\"alignment:center\"],\n [data-cke-command=\"alignment:right\"],\n [data-cke-command=\"bulletedList\"],\n [data-cke-command=\"numberedList\"],\n [data-cke-command=\"outdent\"],\n [data-cke-command=\"indent\"],\n [data-cke-command=\"cut\"],\n [data-cke-command=\"paste\"],\n [data-cke-command=\"pasteAsText\"],\n [data-cke-command=\"fontSize\"],\n [data-cke-command=\"fontColor\"],\n [data-cke-command=\"fontBackgroundColor\"],\n [data-cke-command=\"link\"],\n [data-cke-command=\"insertTable\"],\n [data-cke-command=\"insertImageViaUrl\"],\n [data-cke-command=\"undo\"],\n [data-cke-command=\"redo\"] {\n > .ck-icon:first-child > *,\n > .ck-button:first-child > .ck-icon:first-child > *,\n > .ck-splitbutton > .ck-button:first-child > .ck-icon:first-child > * {\n display: none;\n }\n\n > .ck-icon:first-child,\n > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child,\n > .ck-button > .ck-icon:first-child {\n width: 24px !important;\n height: 24px !important;\n }\n }\n\n [data-cke-command=\"bold\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(boldIcon)}');\n }\n\n [data-cke-command=\"italic\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(italicIcon)}');\n }\n\n [data-cke-command=\"underline\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(underlineIcon)}');\n }\n\n [data-cke-command=\"strikethrough\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(strikeThroughIcon)}');\n }\n\n [data-cke-command=\"alignment:left\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(alignLeftIcon)}');\n }\n\n [data-cke-command=\"alignment:center\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(alignCenterIcon)}');\n }\n\n [data-cke-command=\"alignment:right\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(alignRightIcon)}');\n }\n\n [data-cke-command=\"bulletedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child {\n background-image: url('${getIconUrl(unorderedListIcon)}');\n }\n\n [data-cke-command=\"numberedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child {\n background-image: url('${getIconUrl(orderedListIcon)}');\n }\n\n [data-cke-command=\"outdent\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(outdentIcon)}');\n }\n\n [data-cke-command=\"indent\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(indentIcon)}');\n }\n\n [data-cke-command=\"cut\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(cutIcon)}');\n }\n\n [data-cke-command=\"paste\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(pasteIcon)}');\n }\n\n [data-cke-command=\"pasteAsText\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(pasteAsTextIcon)}');\n }\n\n [data-cke-command=\"fontSize\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(fontSizeIcon)}');\n background-size: 19px;\n }\n\n [data-cke-command=\"fontColor\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(textColorIcon)}');\n }\n\n [data-cke-command=\"fontBackgroundColor\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(bgColorIcon)}');\n }\n [data-cke-command=\"link\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(linkIcon)}');\n }\n\n [data-cke-command=\"insertTable\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(tableIcon)}');\n }\n\n [data-cke-command=\"insertImageViaUrl\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(imageIcon)}');\n }\n\n [data-cke-command=\"undo\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(undoIcon)}');\n }\n\n [data-cke-command=\"redo\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(redoIcon)}');\n }\n\n [data-cke-command=\"fontSize\"] .ck-dropdown__panel {\n max-width: 130px !important;\n\n .ck-list__item {\n min-width: 128px !important;\n }\n\n .ck-list {\n .ck-button {\n padding: 4px 12px !important;\n font-size: 14px !important;\n line-height: 24px !important;\n\n .ck-button__label {\n font-size: 14px !important;\n font-weight: normal !important;\n font-family: inherit !important;\n line-height: 24px !important;\n }\n\n &[data-cke-tooltip-text] {\n font-size: 14px !important;\n\n .ck-button__label {\n font-size: 14px !important;\n }\n }\n\n &.ck-on {\n position: relative;\n padding-right: 32px !important;\n\n &::after {\n content: \"\";\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n width: 24px !important;\n height: 24px !important;\n background-image: url('${getIconUrl(checkmarkIcon)}');\n background-size: 24px 24px;\n background-repeat: no-repeat;\n background-position: center;\n line-height: 1;\n }\n }\n }\n }\n\n .ck-list-item-button__check-holder {\n display: none !important;\n }\n }\n`\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,mBAAmB;AACrD,SACEC,eAAe,EACfC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,QAAQ,EACRC,aAAa,EACbC,OAAO,EACPC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,eAAe,EACfC,SAAS,EACTC,QAAQ,EACRC,iBAAiB,EACjBC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,QAAQ,EACRC,iBAAiB,QACZ,SAAS;AAEhB,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY,EAAK;EACnC,IAAIA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC,EAAE;IAC5B,OAAOD,IAAI;EACb;EACA,2CAAAE,MAAA,CAA2CC,kBAAkB,CAACH,IAAI,CAAC;AACrE,CAAC;AAED,OAAO,IAAMI,eAAe,gBAAG7B,iBAAiB,s/HA4CnBwB,UAAU,CAACnB,QAAQ,CAAC,EAIpBmB,UAAU,CAACb,UAAU,CAAC,EAItBa,UAAU,CAACH,aAAa,CAAC,EAIzBG,UAAU,CAACN,iBAAiB,CAAC,EAI7BM,UAAU,CAACtB,aAAa,CAAC,EAIzBsB,UAAU,CAACvB,eAAe,CAAC,EAI3BuB,UAAU,CAACrB,cAAc,CAAC,EAI1BqB,UAAU,CAACD,iBAAiB,CAAC,EAI7BC,UAAU,CAACX,eAAe,CAAC,EAI3BW,UAAU,CAACV,WAAW,CAAC,EAIvBU,UAAU,CAACd,UAAU,CAAC,EAItBc,UAAU,CAACjB,OAAO,CAAC,EAInBiB,UAAU,CAACR,SAAS,CAAC,EAIrBQ,UAAU,CAACT,eAAe,CAAC,EAI3BS,UAAU,CAAChB,YAAY,CAAC,EAKxBgB,UAAU,CAACJ,aAAa,CAAC,EAIzBI,UAAU,CAACpB,WAAW,CAAC,EAGvBoB,UAAU,CAACZ,QAAQ,CAAC,EAIpBY,UAAU,CAACL,SAAS,CAAC,EAIrBK,UAAU,CAACf,SAAS,CAAC,EAIrBe,UAAU,CAACF,QAAQ,CAAC,EAIpBE,UAAU,CAACP,QAAQ,CAAC,EA2CZO,UAAU,CAAClB,aAAa,CAAC,CAc7D"}
1
+ {"version":3,"file":"textEditorTheming.styles.js","names":["colors","spacing","createGlobalStyle","alignCenterIcon","alignLeftIcon","alignRightIcon","bgColorIcon","boldIcon","checkmarkIcon","cutIcon","fontSizeIcon","imageIcon","indentIcon","italicIcon","linkIcon","orderedListIcon","outdentIcon","pasteAsTextIcon","pasteIcon","redoIcon","strikeThroughIcon","tableIcon","textColorIcon","underlineIcon","undoIcon","unorderedListIcon","getIconUrl","icon","startsWith","concat","encodeURIComponent","TextEditorTheme","lg","gray90","gray15","xs","xl","gray85"],"sources":["../../../src/TextEditor/textEditorTheming/textEditorTheming.styles.ts"],"sourcesContent":["import { colors, spacing } from '@procore/core-react'\nimport { createGlobalStyle } from 'styled-components'\nimport {\n alignCenterIcon,\n alignLeftIcon,\n alignRightIcon,\n bgColorIcon,\n boldIcon,\n checkmarkIcon,\n cutIcon,\n fontSizeIcon,\n imageIcon,\n indentIcon,\n italicIcon,\n linkIcon,\n orderedListIcon,\n outdentIcon,\n pasteAsTextIcon,\n pasteIcon,\n redoIcon,\n strikeThroughIcon,\n tableIcon,\n textColorIcon,\n underlineIcon,\n undoIcon,\n unorderedListIcon,\n} from './icons'\n\nconst getIconUrl = (icon: string) => {\n if (icon.startsWith('data:')) {\n return icon\n }\n return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(icon)}`\n}\n\nexport const TextEditorTheme = createGlobalStyle`\n .ck-button:first-child .ck-icon:first-child {\n background-size: 24px;\n background-repeat: no-repeat;\n background-position: center;\n }\n\n .ck-link-form .ck-button-action {\n font-size: 13px !important;\n line-height: ${spacing.lg} !important;\n background: ${colors.gray90} !important;\n color: ${colors.gray15} !important;\n border-radius: ${spacing.xs} !important;\n font-family: inherit !important;\n font-weight: 600 !important;\n height: ${spacing.xl} !important;\n justify-content: center !important;\n align-items: center !important;\n cursor: pointer !important;\n \n &:hover {\n background: ${colors.gray85} !important;\n }\n }\n \n [data-cke-command=\"bold\"],\n [data-cke-command=\"italic\"],\n [data-cke-command=\"underline\"],\n [data-cke-command=\"strikethrough\"],\n [data-cke-command=\"alignment:left\"],\n [data-cke-command=\"alignment:center\"],\n [data-cke-command=\"alignment:right\"],\n [data-cke-command=\"bulletedList\"],\n [data-cke-command=\"numberedList\"],\n [data-cke-command=\"outdent\"],\n [data-cke-command=\"indent\"],\n [data-cke-command=\"cut\"],\n [data-cke-command=\"paste\"],\n [data-cke-command=\"pasteAsText\"],\n [data-cke-command=\"fontSize\"],\n [data-cke-command=\"fontColor\"],\n [data-cke-command=\"fontBackgroundColor\"],\n [data-cke-command=\"link\"],\n [data-cke-command=\"insertTable\"],\n [data-cke-command=\"insertImageViaUrl\"],\n [data-cke-command=\"undo\"],\n [data-cke-command=\"redo\"] {\n > .ck-icon:first-child > *,\n > .ck-button:first-child > .ck-icon:first-child > *,\n > .ck-splitbutton > .ck-button:first-child > .ck-icon:first-child > * {\n display: none;\n }\n\n > .ck-icon:first-child,\n > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child,\n > .ck-button > .ck-icon:first-child {\n width: 24px !important;\n height: 24px !important;\n }\n }\n\n [data-cke-command=\"bold\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(boldIcon)}');\n }\n\n [data-cke-command=\"italic\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(italicIcon)}');\n }\n\n [data-cke-command=\"underline\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(underlineIcon)}');\n }\n\n [data-cke-command=\"strikethrough\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(strikeThroughIcon)}');\n }\n\n [data-cke-command=\"alignment:left\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(alignLeftIcon)}');\n }\n\n [data-cke-command=\"alignment:center\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(alignCenterIcon)}');\n }\n\n [data-cke-command=\"alignment:right\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(alignRightIcon)}');\n }\n\n [data-cke-command=\"bulletedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child {\n background-image: url('${getIconUrl(unorderedListIcon)}');\n }\n\n [data-cke-command=\"numberedList\"] > .ck-splitbutton > .ck-button:first-child .ck-icon:first-child {\n background-image: url('${getIconUrl(orderedListIcon)}');\n }\n\n [data-cke-command=\"outdent\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(outdentIcon)}');\n }\n\n [data-cke-command=\"indent\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(indentIcon)}');\n }\n\n [data-cke-command=\"cut\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(cutIcon)}');\n }\n\n [data-cke-command=\"paste\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(pasteIcon)}');\n }\n\n [data-cke-command=\"pasteAsText\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(pasteAsTextIcon)}');\n }\n\n [data-cke-command=\"fontSize\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(fontSizeIcon)}');\n background-size: 19px;\n }\n\n [data-cke-command=\"fontColor\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(textColorIcon)}');\n }\n\n [data-cke-command=\"fontBackgroundColor\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(bgColorIcon)}');\n }\n [data-cke-command=\"link\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(linkIcon)}');\n }\n\n [data-cke-command=\"insertTable\"] > .ck-button > .ck-icon:first-child {\n background-image: url('${getIconUrl(tableIcon)}');\n }\n\n [data-cke-command=\"insertImageViaUrl\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(imageIcon)}');\n }\n\n [data-cke-command=\"undo\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(undoIcon)}');\n }\n\n [data-cke-command=\"redo\"] > .ck-icon:first-child {\n background-image: url('${getIconUrl(redoIcon)}');\n }\n\n [data-cke-command=\"fontSize\"] .ck-dropdown__panel {\n max-width: 130px !important;\n\n .ck-list__item {\n min-width: 128px !important;\n }\n\n .ck-list {\n .ck-button {\n padding: 4px 12px !important;\n font-size: 14px !important;\n line-height: 24px !important;\n\n .ck-button__label {\n font-size: 14px !important;\n font-weight: normal !important;\n font-family: inherit !important;\n line-height: 24px !important;\n }\n\n &[data-cke-tooltip-text] {\n font-size: 14px !important;\n\n .ck-button__label {\n font-size: 14px !important;\n }\n }\n\n &.ck-on {\n position: relative;\n padding-right: 32px !important;\n\n &::after {\n content: \"\";\n position: absolute;\n right: 8px;\n top: 50%;\n transform: translateY(-50%);\n width: 24px !important;\n height: 24px !important;\n background-image: url('${getIconUrl(checkmarkIcon)}');\n background-size: 24px 24px;\n background-repeat: no-repeat;\n background-position: center;\n line-height: 1;\n }\n }\n }\n }\n\n .ck-list-item-button__check-holder {\n display: none !important;\n }\n }\n`\n"],"mappings":"AAAA,SAASA,MAAM,EAAEC,OAAO,QAAQ,qBAAqB;AACrD,SAASC,iBAAiB,QAAQ,mBAAmB;AACrD,SACEC,eAAe,EACfC,aAAa,EACbC,cAAc,EACdC,WAAW,EACXC,QAAQ,EACRC,aAAa,EACbC,OAAO,EACPC,YAAY,EACZC,SAAS,EACTC,UAAU,EACVC,UAAU,EACVC,QAAQ,EACRC,eAAe,EACfC,WAAW,EACXC,eAAe,EACfC,SAAS,EACTC,QAAQ,EACRC,iBAAiB,EACjBC,SAAS,EACTC,aAAa,EACbC,aAAa,EACbC,QAAQ,EACRC,iBAAiB,QACZ,SAAS;AAEhB,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAIC,IAAY,EAAK;EACnC,IAAIA,IAAI,CAACC,UAAU,CAAC,OAAO,CAAC,EAAE;IAC5B,OAAOD,IAAI;EACb;EACA,2CAAAE,MAAA,CAA2CC,kBAAkB,CAACH,IAAI,CAAC;AACrE,CAAC;AAED,OAAO,IAAMI,eAAe,gBAAG7B,iBAAiB,22IAS3BD,OAAO,CAAC+B,EAAE,EACXhC,MAAM,CAACiC,MAAM,EAClBjC,MAAM,CAACkC,MAAM,EACLjC,OAAO,CAACkC,EAAE,EAGjBlC,OAAO,CAACmC,EAAE,EAMFpC,MAAM,CAACqC,MAAM,EAyCRX,UAAU,CAACnB,QAAQ,CAAC,EAIpBmB,UAAU,CAACb,UAAU,CAAC,EAItBa,UAAU,CAACH,aAAa,CAAC,EAIzBG,UAAU,CAACN,iBAAiB,CAAC,EAI7BM,UAAU,CAACtB,aAAa,CAAC,EAIzBsB,UAAU,CAACvB,eAAe,CAAC,EAI3BuB,UAAU,CAACrB,cAAc,CAAC,EAI1BqB,UAAU,CAACD,iBAAiB,CAAC,EAI7BC,UAAU,CAACX,eAAe,CAAC,EAI3BW,UAAU,CAACV,WAAW,CAAC,EAIvBU,UAAU,CAACd,UAAU,CAAC,EAItBc,UAAU,CAACjB,OAAO,CAAC,EAInBiB,UAAU,CAACR,SAAS,CAAC,EAIrBQ,UAAU,CAACT,eAAe,CAAC,EAI3BS,UAAU,CAAChB,YAAY,CAAC,EAKxBgB,UAAU,CAACJ,aAAa,CAAC,EAIzBI,UAAU,CAACpB,WAAW,CAAC,EAGvBoB,UAAU,CAACZ,QAAQ,CAAC,EAIpBY,UAAU,CAACL,SAAS,CAAC,EAIrBK,UAAU,CAACf,SAAS,CAAC,EAIrBe,UAAU,CAACF,QAAQ,CAAC,EAIpBE,UAAU,CAACP,QAAQ,CAAC,EA2CZO,UAAU,CAAClB,aAAa,CAAC,CAc7D"}
@@ -1,4 +1,4 @@
1
- import { Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Image, ImageInsert, ImageToolbar, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline } from 'ckeditor5';
1
+ import { Alignment, Autoformat, AutoLink, BlockQuote, Bold, Clipboard, CodeBlock, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Heading, HorizontalLine, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, RemoveFormat, SpecialCharacters, SpecialCharactersEssentials, Strikethrough, Subscript, Superscript, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline } from 'ckeditor5';
2
2
  import { CK_EDITOR_LICENSE_KEY } from '../license_key';
3
3
  import { CutPlugin } from '../plugins/CutPlugin';
4
4
  import { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin';
@@ -57,10 +57,10 @@ export var getDefaultConfig = function getDefaultConfig() {
57
57
  licenseKey: CK_EDITOR_LICENSE_KEY,
58
58
  language: getValidEditorLocale(locale),
59
59
  translations: [getEditorTranslation(locale)],
60
- plugins: [Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline, Image, ImageInsert, ImageToolbar, CutPlugin, PastePlugin, PasteAsTextPlugin, IndentPaddingToMarginPlugin, TabSpacesPlugin // TODO - delete
60
+ plugins: [Alignment, AutoLink, Bold, Clipboard, Essentials, FontBackgroundColor, FontColor, FontSize, GeneralHtmlSupport, Indent, IndentBlock, Italic, Link, List, ListProperties, Paragraph, Strikethrough, Table, TableCaption, TableCellProperties, TableColumnResize, TableProperties, TableToolbar, Underline, CutPlugin, PastePlugin, PasteAsTextPlugin, IndentPaddingToMarginPlugin, BlockQuote, Heading, Autoformat, SpecialCharacters, SpecialCharactersEssentials, Subscript, Superscript, HorizontalLine, RemoveFormat, CodeBlock, TabSpacesPlugin // TODO - delete
61
61
  ],
62
62
 
63
- toolbar: ['bold', 'italic', 'underline', 'strikethrough', '|', 'alignment:left', 'alignment:center', 'alignment:right', '|', 'bulletedList', 'numberedList', '|', 'outdent', 'indent', '|', 'cut', 'paste', 'pasteAsText', '|', 'fontSize', '|', 'fontColor', 'fontBackgroundColor', '|', 'undo', 'redo'],
63
+ toolbar: ['bold', 'italic', 'underline', 'strikethrough', '|', 'alignment:left', 'alignment:center', 'alignment:right', '|', 'bulletedList', 'numberedList', '|', 'outdent', 'indent', '|', 'cut', 'paste', 'pasteAsText', '|', 'fontSize', '|', 'fontColor', 'fontBackgroundColor', '|', 'insertTable', 'link', '|', 'blockquote', 'heading', '|', 'horizontalLine', 'removeFormat', 'specialCharacters', 'subscript', 'superscript', 'codeblock', '|', 'undo', 'redo'],
64
64
  fontSize: {
65
65
  options: [{
66
66
  title: '8pt',
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","names":["Alignment","AutoLink","Bold","Clipboard","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Image","ImageInsert","ImageToolbar","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","Strikethrough","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/TextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Image,\n ImageInsert,\n ImageToolbar,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n Image,\n ImageInsert,\n ImageToolbar,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n TabSpacesPlugin, // TODO - delete\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n toolbar: ['imageTextAlternative'],\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })\n }\n}\n"],"mappings":"AACA,SACEA,SAAS,EACTC,QAAQ,EACRC,IAAI,EACJC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,kBAAkB,EAClBC,KAAK,EACLC,WAAW,EACXC,YAAY,EACZC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,SAAS,EACTC,aAAa,EACbC,KAAK,EACLC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,YAAY,EACZC,SAAS,QACJ,WAAW;AAElB,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,UAAU;AAErE,IAAMC,kBAAkB,GAAG,CACzB;EAAEC,KAAK,EAAE;AAAU,CAAC,EACpB;EAAEA,KAAK,EAAE;AAAU,CAAC,EACpB;EAAEA,KAAK,EAAE;AAAU,CAAC,EACpB;EAAEA,K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;IAEvE;IACA,IAAMG,YAAY,GAAIb,MAAM,CAACc,MAAM,CAACC,GAAG,CAAC,SAAS,CAAC,IAAI,EAAe;IACrE,IAAIC,YAAY,GAAG,CAAC;IAEpBH,YAAY,CAACI,OAAO,CAAC,UAACC,QAAQ,EAAK;MACjC,IAAMb,OAAO,GAAGM,kBAAkB,CAACK,YAAY,CAAC;MAChD,IACEE,QAAQ,KAAK,GAAG,IAChBb,OAAO,IACP,CAACA,OAAO,CAACc,SAAS,CAACC,QAAQ,CAAC,uBAAuB,CAAC,EACpD;QACA;QACAf,OAAO,CAACgB,YAAY,CAAC,kBAAkB,EAAEH,QAAQ,CAAC;MACpD;MACAF,YAAY,EAAE;IAChB,CAAC,CAAC;EACJ,CAAC;;EAED;EACAf,eAAe,CAAC,CAAC;;EAEjB;EACA,IAAMC,cAAc,GAAGF,MAAM,CAACG,EAAE,CAACC,IAAI,CAACnC,OAAO,CAACoC,OAAO;EACrD,IAAIH,cAAc,EAAE;IAClB,IAAMoB,QAAQ,GAAG,IAAIC,gBAAgB,CAAC,YAAM;MAC1CtB,eAAe,CAAC,CAAC;IACnB,CAAC,CAAC;IACFqB,QAAQ,CAACE,OAAO,CAACtB,cAAc,EAAE;MAC/BuB,SAAS,EAAE,IAAI;MACfC,OAAO,EAAE;IACX,CAAC,CAAC;IACF1B,MAAM,CAAC2B,EAAE,CAAC,SAAS,EAAE,YAAM;MACzBL,QAAQ,CAACM,UAAU,CAAC,CAAC;IACvB,CAAC,CAAC;EACJ;AACF,CAAC"}
1
+ {"version":3,"file":"config.js","names":["Alignment","Autoformat","AutoLink","BlockQuote","Bold","Clipboard","CodeBlock","Essentials","FontBackgroundColor","FontColor","FontSize","GeneralHtmlSupport","Heading","HorizontalLine","Indent","IndentBlock","Italic","Link","List","ListProperties","Paragraph","RemoveFormat","SpecialCharacters","SpecialCharactersEssentials","Strikethrough","Subscript","Superscript","Table","TableCaption","TableCellProperties","TableColumnResize","TableProperties","TableToolbar","Underline","CK_EDITOR_LICENSE_KEY","CutPlugin","IndentPaddingToMarginPlugin","PasteAsTextPlugin","PastePlugin","TabSpacesPlugin","getEditorTranslation","getValidEditorLocale","TEXT_COLOR_PALETTE","color","getDefaultConfig","locale","arguments","length","undefined","licenseKey","language","translations","plugins","toolbar","fontSize","options","title","model","supportAllValues","fontColor","colors","fontBackgroundColor","indentBlock","offset","unit","htmlSupport","allow","name","styles","list","properties","useAttribute","startIndex","reversed","image","insert","integrations","table","contentToolbar","tableProperties","borderColors","backgroundColors","tableCellProperties","addButtonDataAttributes","editor","applyAttributes","toolbarElement","ui","view","element","toolbarChildren","Array","from","querySelectorAll","moreDropdownButtons","allToolbarElements","concat","toolbarItems","config","get","elementIndex","forEach","itemName","classList","contains","setAttribute","observer","MutationObserver","observe","childList","subtree","on","disconnect"],"sources":["../../../src/TextEditor/utils/config.ts"],"sourcesContent":["import type { ClassicEditor, EditorConfig } from 'ckeditor5'\nimport {\n Alignment,\n Autoformat,\n AutoLink,\n BlockQuote,\n Bold,\n Clipboard,\n CodeBlock,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Heading,\n HorizontalLine,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n RemoveFormat,\n SpecialCharacters,\n SpecialCharactersEssentials,\n Strikethrough,\n Subscript,\n Superscript,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n} from 'ckeditor5'\n\nimport { CK_EDITOR_LICENSE_KEY } from '../license_key'\nimport { CutPlugin } from '../plugins/CutPlugin'\nimport { IndentPaddingToMarginPlugin } from '../plugins/IndentPaddingToMarginPlugin'\nimport { PasteAsTextPlugin } from '../plugins/PasteAsTextPlugin'\nimport { PastePlugin } from '../plugins/PastePlugin'\nimport { TabSpacesPlugin } from '../plugins/TabSpacesPlugin'\nimport { getEditorTranslation, getValidEditorLocale } from './locale'\n\nconst TEXT_COLOR_PALETTE = [\n { color: '#BFEDD2' },\n { color: '#FBEEB8' },\n { color: '#F8CAC6' },\n { color: '#ECCAFA' },\n { color: '#C2E0F4' },\n { color: '#2DC26B' },\n { color: '#F1C40F' },\n { color: '#E03E2D' },\n { color: '#B96AD9' },\n { color: '#3598DB' },\n { color: '#169179' },\n { color: '#E67E23' },\n { color: '#BA372A' },\n { color: '#843FA1' },\n { color: '#236FA1' },\n { color: '#ECF0F1' },\n { color: '#CED4D9' },\n { color: '#95A5A6' },\n { color: '#7E8C8D' },\n { color: '#34495E' },\n { color: '#000000' },\n { color: '#FFFFFF' },\n]\n\nexport const getDefaultConfig = (locale: string = 'en'): EditorConfig => ({\n licenseKey: CK_EDITOR_LICENSE_KEY,\n language: getValidEditorLocale(locale),\n translations: [getEditorTranslation(locale)],\n plugins: [\n Alignment,\n AutoLink,\n Bold,\n Clipboard,\n Essentials,\n FontBackgroundColor,\n FontColor,\n FontSize,\n GeneralHtmlSupport,\n Indent,\n IndentBlock,\n Italic,\n Link,\n List,\n ListProperties,\n Paragraph,\n Strikethrough,\n Table,\n TableCaption,\n TableCellProperties,\n TableColumnResize,\n TableProperties,\n TableToolbar,\n Underline,\n CutPlugin,\n PastePlugin,\n PasteAsTextPlugin,\n IndentPaddingToMarginPlugin,\n BlockQuote,\n Heading,\n Autoformat,\n SpecialCharacters,\n SpecialCharactersEssentials,\n Subscript,\n Superscript,\n HorizontalLine,\n RemoveFormat,\n CodeBlock,\n TabSpacesPlugin, // TODO - delete\n ],\n toolbar: [\n 'bold',\n 'italic',\n 'underline',\n 'strikethrough',\n '|',\n 'alignment:left',\n 'alignment:center',\n 'alignment:right',\n '|',\n 'bulletedList',\n 'numberedList',\n '|',\n 'outdent',\n 'indent',\n '|',\n 'cut',\n 'paste',\n 'pasteAsText',\n '|',\n 'fontSize',\n '|',\n 'fontColor',\n 'fontBackgroundColor',\n '|',\n 'insertTable',\n 'link',\n '|',\n 'blockquote',\n 'heading',\n '|',\n 'horizontalLine',\n 'removeFormat',\n 'specialCharacters',\n 'subscript',\n 'superscript',\n 'codeblock',\n '|',\n 'undo',\n 'redo',\n ],\n fontSize: {\n options: [\n { title: '8pt', model: '8px' },\n { title: '10pt', model: '10px' },\n { title: '12pt', model: '12px' },\n { title: '14pt', model: '14px' },\n { title: '18pt', model: '18px' },\n { title: '24pt', model: '24px' },\n { title: '36pt', model: '36px' },\n ],\n supportAllValues: true,\n },\n fontColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n fontBackgroundColor: {\n colors: TEXT_COLOR_PALETTE,\n },\n indentBlock: {\n offset: 40,\n unit: 'px',\n },\n htmlSupport: {\n allow: [\n {\n name: 'p',\n styles: {\n 'margin-left': true,\n },\n },\n ],\n },\n list: {\n properties: {\n styles: {\n useAttribute: true,\n },\n startIndex: true,\n reversed: true,\n },\n },\n image: {\n insert: {\n integrations: ['insertImageViaUrl'],\n },\n toolbar: ['imageTextAlternative'],\n },\n table: {\n contentToolbar: [\n 'tableColumn',\n 'tableRow',\n 'mergeTableCells',\n 'tableProperties',\n 'tableCellProperties',\n ],\n tableProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n tableCellProperties: {\n borderColors: TEXT_COLOR_PALETTE,\n backgroundColors: TEXT_COLOR_PALETTE,\n },\n },\n})\n\n// Add stable data attributes to toolbar buttons for the styling (or testing) purposes\nexport const addButtonDataAttributes = (editor: ClassicEditor) => {\n const applyAttributes = () => {\n const toolbarElement = editor.ui.view.toolbar.element\n if (!toolbarElement) {\n return\n }\n\n // Get buttons in the main toolbar\n const toolbarChildren = Array.from(\n toolbarElement.querySelectorAll('.ck-toolbar__items > *')\n )\n\n // Get buttons hidden in \"more\" dropdown\n const moreDropdownButtons = Array.from(\n toolbarElement.querySelectorAll('.ck-dropdown__panel .ck-list .ck-button')\n )\n\n const allToolbarElements = [...toolbarChildren, ...moreDropdownButtons]\n\n // Create mapping based on toolbar configuration order\n const toolbarItems = (editor.config.get('toolbar') || []) as string[]\n let elementIndex = 0\n\n toolbarItems.forEach((itemName) => {\n const element = allToolbarElements[elementIndex]\n if (\n itemName !== '|' &&\n element &&\n !element.classList.contains('ck-toolbar__separator')\n ) {\n // Use the toolbar item name as the stable identifier\n element.setAttribute('data-cke-command', itemName)\n }\n elementIndex++\n })\n }\n\n // Apply attributes initially\n applyAttributes()\n\n // Re-apply when dropdown menus are opened (buttons get created dynamically)\n const toolbarElement = editor.ui.view.toolbar.element\n if (toolbarElement) {\n const observer = new MutationObserver(() => {\n applyAttributes()\n })\n observer.observe(toolbarElement, {\n childList: true,\n subtree: true,\n })\n editor.on('destroy', () => {\n observer.disconnect()\n })\n }\n}\n"],"mappings":"AACA,SACEA,SAAS,EACTC,UAAU,EACVC,QAAQ,EACRC,UAAU,EACVC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,UAAU,EACVC,mBAAmB,EACnBC,SAAS,EACTC,QAAQ,EACRC,kBAAkB,EAClBC,OAAO,EACPC,cAAc,EACdC,MAAM,EACNC,WAAW,EACXC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,cAAc,EACdC,SAAS,EACTC,YAAY,EACZC,iBAAiB,EACjBC,2BAA2B,EAC3BC,aAAa,EACbC,SAAS,EACTC,WAAW,EACXC,KAAK,EACLC,YAAY,EACZC,mBAAmB,EACnBC,iBAAiB,EACjBC,eAAe,EACfC,YAAY,EACZC,SAAS,QACJ,WAAW;AAElB,SAASC,qBAAqB,QAAQ,gBAAgB;AACtD,SAASC,SAAS,QAAQ,sBAAsB;AAChD,SAASC,2BAA2B,QAAQ,wCAAwC;AACpF,SAASC,iBAAiB,QAAQ,8BAA8B;AAChE,SAASC,WAAW,QAAQ,wBAAwB;AACpD,SAASC,eAAe,QAAQ,4BAA4B;AAC5D,SAASC,oBAAoB,EAAEC,oBAAoB,QAAQ,UAAU;AAErE,IAAMC,kBAAkB,GAAG,CACzB;EAAEC,KAAK,EAAE;AAAU,CAAC,EACpB;EAAEA,KAAK,EAAE;AAAU,CAAC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,CAAC"}
@@ -1,2 +1 @@
1
1
  export { addButtonDataAttributes, getDefaultConfig } from './config';
2
- export { addPluginsFromStringArray } from './plugins';
@@ -1,3 +1,2 @@
1
1
  export { addButtonDataAttributes, getDefaultConfig } from './config';
2
- export { addPluginsFromStringArray } from './plugins';
3
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["addButtonDataAttributes","getDefaultConfig","addPluginsFromStringArray"],"sources":["../../../src/TextEditor/utils/index.ts"],"sourcesContent":["export { addButtonDataAttributes, getDefaultConfig } from './config'\nexport { addPluginsFromStringArray } from './plugins'\n"],"mappings":"AAAA,SAASA,uBAAuB,EAAEC,gBAAgB,QAAQ,UAAU;AACpE,SAASC,yBAAyB,QAAQ,WAAW"}
1
+ {"version":3,"file":"index.js","names":["addButtonDataAttributes","getDefaultConfig"],"sources":["../../../src/TextEditor/utils/index.ts"],"sourcesContent":["export { addButtonDataAttributes, getDefaultConfig } from './config'\n"],"mappings":"AAAA,SAASA,uBAAuB,EAAEC,gBAAgB,QAAQ,UAAU"}
@@ -1,6 +1,6 @@
1
1
  import styled from 'styled-components';
2
2
  export var StyledEditor = /*#__PURE__*/styled.div.withConfig({
3
3
  displayName: "StyledEditor",
4
- componentId: "text-editor-0_0_3__sc-1oujb2g-0"
4
+ componentId: "text-editor-0_2_0__sc-1oujb2g-0"
5
5
  })([".ck-editor__top{height:0 !important;}.ck-content{border:none !important;padding:0 !important;p{margin:0;}table,img{margin-left:auto;margin-right:auto;}img{display:block;}table{border:1px double #b3b3b3;border-collapse:collapse;border-spacing:0;th{text-align:left;}& > thead,& > tbody{& > tr > td,& > tr > th{border:1px solid #bfbfbf;min-width:2em;padding:0.4em;}& > tr > th{background:rgba(0,0,0,0.05);font-weight:700;}}}}"]);
6
6
  //# sourceMappingURL=TextEditorOutput.styles.js.map
@@ -6,6 +6,7 @@ export declare const exampleText: {
6
6
  long_ipsum: string;
7
7
  longest_ipsum: string;
8
8
  long_ipsum_one_line: string;
9
+ formatted_content: string;
9
10
  };
10
11
  export declare function Ipsum(lengthOrOptions: number | {
11
12
  length: number;
@@ -5,7 +5,8 @@ export var exampleText = {
5
5
  short_sentence: 'Did you think you have mastery over fire? Incredible!',
6
6
  long_ipsum: "Lorem ip sum dolor sit amet, consectetur adipiscing elit,\n ed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n Scelerisque eleifend donec pretium vulputate sapien nec sagittis.\n Ultricies tristique nulla aliquet enim tortor at auctor urna nunc.\n Vitae turpis massa sed elementum tempus egestas.\n Nunc consequat interdum varius sit amet",
7
7
  longest_ipsum: "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua. Ac tortor dignissim\n convallis aenean et. Facilisis volutpat est velit egestas dui id. In\n nulla posuere sollicitudin aliquam ultrices. Lorem mollis aliquam ut\n porttitor. Convallis aenean et tortor at risus viverra adipiscing at.\n Euismod nisi porta lorem mollis aliquam ut porttitor. Hac habitasse\n platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper.\n Viverra tellus in hac habitasse platea dictumst. Scelerisque viverra lawn\n gnome in aliquam sem fringilla ut morbi tincidunt. Ullamcorper morbi tincidunt\n ornare massa eget. Gravida cum sociis natoque penatibus. Leo vel fringilla est\n ullamcorper eget nulla. Vitae proin sagittis nisl rhoncus mattis rhoncus urna.\n Mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Id aliquet\n lectus proin nibh troll condimentum id venenatis.",
8
- long_ipsum_one_line: "Lorem ip sum dolor sit amet, consectetur adipiscing elit, ed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque eleifend donec pretium vulputate sapien nec sagittis. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Vitae turpis massa sed elementum tempus egestas. Nunc consequat interdum varius sit amet"
8
+ long_ipsum_one_line: "Lorem ip sum dolor sit amet, consectetur adipiscing elit, ed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque eleifend donec pretium vulputate sapien nec sagittis. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Vitae turpis massa sed elementum tempus egestas. Nunc consequat interdum varius sit amet",
9
+ formatted_content: "\n <p><strong>Bold text</strong> and <em>italic text</em></p>\n <ul>\n <li>List item 1</li>\n <li>List item 2</li>\n </ul>\n <p style=\"text-align: center;\">Centered text</p>\n "
9
10
  };
10
11
  export function Ipsum(lengthOrOptions) {
11
12
  if (typeof lengthOrOptions === 'number') {
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","names":["exampleText","none","short_ipsum","short_sentence","long_ipsum","longest_ipsum","long_ipsum_one_line","Ipsum","lengthOrOptions","recursiveGrow","length","lettercase","trailingPeriod","longString","lastChar","includes","slice","replace","s","toUpperCase","arguments","undefined","out"],"sources":["../../src/_storyHelpers/constants.ts"],"sourcesContent":["export const exampleText = {\n default: 'Click me!',\n none: '',\n short_ipsum: 'Lorum',\n short_sentence: 'Did you think you have mastery over fire? Incredible!',\n long_ipsum: `Lorem ip sum dolor sit amet, consectetur adipiscing elit,\n ed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n Scelerisque eleifend donec pretium vulputate sapien nec sagittis.\n Ultricies tristique nulla aliquet enim tortor at auctor urna nunc.\n Vitae turpis massa sed elementum tempus egestas.\n Nunc consequat interdum varius sit amet`,\n longest_ipsum: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua. Ac tortor dignissim\n convallis aenean et. Facilisis volutpat est velit egestas dui id. In\n nulla posuere sollicitudin aliquam ultrices. Lorem mollis aliquam ut\n porttitor. Convallis aenean et tortor at risus viverra adipiscing at.\n Euismod nisi porta lorem mollis aliquam ut porttitor. Hac habitasse\n platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper.\n Viverra tellus in hac habitasse platea dictumst. Scelerisque viverra lawn\n gnome in aliquam sem fringilla ut morbi tincidunt. Ullamcorper morbi tincidunt\n ornare massa eget. Gravida cum sociis natoque penatibus. Leo vel fringilla est\n ullamcorper eget nulla. Vitae proin sagittis nisl rhoncus mattis rhoncus urna.\n Mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Id aliquet\n lectus proin nibh troll condimentum id venenatis.`,\n long_ipsum_one_line: `Lorem ip sum dolor sit amet, consectetur adipiscing elit, ed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque eleifend donec pretium vulputate sapien nec sagittis. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Vitae turpis massa sed elementum tempus egestas. Nunc consequat interdum varius sit amet`,\n}\n\nexport function Ipsum(\n lengthOrOptions:\n | number\n | {\n length: number\n lettercase?: 'sentence' | 'title'\n trailingPeriod?: boolean\n }\n) {\n if (typeof lengthOrOptions === 'number') {\n return recursiveGrow(lengthOrOptions)\n }\n const { length, lettercase, trailingPeriod } = lengthOrOptions\n let longString = recursiveGrow(length)\n const lastChar = longString[longString.length - 1]\n if (!trailingPeriod && ['.', ','].includes(lastChar)) {\n longString = longString.slice(0, -1)\n }\n if (lettercase === 'title') {\n longString = longString.replace(/\\b\\w/g, (s) => s.toUpperCase())\n }\n return longString\n}\n\n/**\n * Creates a sentence case sentence.\n * @returns string\n */\nconst recursiveGrow = (length = 1, out = exampleText.longest_ipsum): string => {\n if (!length) {\n return ''\n }\n if (out.length < length) {\n return recursiveGrow(length, out + exampleText.longest_ipsum)\n }\n if (out.length >= length) {\n return out.slice(0, length - 1) + '.'\n }\n return 'Lorem ipsum grow failed.'\n}\n"],"mappings":"AAAA,OAAO,IAAMA,WAAW,GAAG;EACzB,WAAS,WAAW;EACpBC,IAAI,EAAE,EAAE;EACRC,WAAW,EAAE,OAAO;EACpBC,cAAc,EAAE,uDAAuD;EACvEC,UAAU,sXAKgC;EAC1CC,aAAa,o+BAYuC;EACpDC,mBAAmB;AACrB,CAAC;AAED,OAAO,SAASC,KAAKA,CACnBC,eAMK,EACL;EACA,IAAI,OAAOA,eAAe,KAAK,QAAQ,EAAE;IAC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CAAC,EAAEN,MAAM,GAAG,CAAC,CAAC,GAAG,GAAG;EACvC;EACA,OAAO,0BAA0B;AACnC,CAAC"}
1
+ {"version":3,"file":"constants.js","names":["exampleText","none","short_ipsum","short_sentence","long_ipsum","longest_ipsum","long_ipsum_one_line","formatted_content","Ipsum","lengthOrOptions","recursiveGrow","length","lettercase","trailingPeriod","longString","lastChar","includes","slice","replace","s","toUpperCase","arguments","undefined","out"],"sources":["../../src/_storyHelpers/constants.ts"],"sourcesContent":["export const exampleText = {\n default: 'Click me!',\n none: '',\n short_ipsum: 'Lorum',\n short_sentence: 'Did you think you have mastery over fire? Incredible!',\n long_ipsum: `Lorem ip sum dolor sit amet, consectetur adipiscing elit,\n ed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\n Scelerisque eleifend donec pretium vulputate sapien nec sagittis.\n Ultricies tristique nulla aliquet enim tortor at auctor urna nunc.\n Vitae turpis massa sed elementum tempus egestas.\n Nunc consequat interdum varius sit amet`,\n longest_ipsum: `Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod\n tempor incididunt ut labore et dolore magna aliqua. Ac tortor dignissim\n convallis aenean et. Facilisis volutpat est velit egestas dui id. In\n nulla posuere sollicitudin aliquam ultrices. Lorem mollis aliquam ut\n porttitor. Convallis aenean et tortor at risus viverra adipiscing at.\n Euismod nisi porta lorem mollis aliquam ut porttitor. Hac habitasse\n platea dictumst vestibulum rhoncus est pellentesque elit ullamcorper.\n Viverra tellus in hac habitasse platea dictumst. Scelerisque viverra lawn\n gnome in aliquam sem fringilla ut morbi tincidunt. Ullamcorper morbi tincidunt\n ornare massa eget. Gravida cum sociis natoque penatibus. Leo vel fringilla est\n ullamcorper eget nulla. Vitae proin sagittis nisl rhoncus mattis rhoncus urna.\n Mauris commodo quis imperdiet massa tincidunt nunc pulvinar sapien et. Id aliquet\n lectus proin nibh troll condimentum id venenatis.`,\n long_ipsum_one_line: `Lorem ip sum dolor sit amet, consectetur adipiscing elit, ed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Scelerisque eleifend donec pretium vulputate sapien nec sagittis. Ultricies tristique nulla aliquet enim tortor at auctor urna nunc. Vitae turpis massa sed elementum tempus egestas. Nunc consequat interdum varius sit amet`,\n formatted_content: `\n <p><strong>Bold text</strong> and <em>italic text</em></p>\n <ul>\n <li>List item 1</li>\n <li>List item 2</li>\n </ul>\n <p style=\"text-align: center;\">Centered text</p>\n `,\n}\n\nexport function Ipsum(\n lengthOrOptions:\n | number\n | {\n length: number\n lettercase?: 'sentence' | 'title'\n trailingPeriod?: boolean\n }\n) {\n if (typeof lengthOrOptions === 'number') {\n return recursiveGrow(lengthOrOptions)\n }\n const { length, lettercase, trailingPeriod } = lengthOrOptions\n let longString = recursiveGrow(length)\n const lastChar = longString[longString.length - 1]\n if (!trailingPeriod && ['.', ','].includes(lastChar)) {\n longString = longString.slice(0, -1)\n }\n if (lettercase === 'title') {\n longString = longString.replace(/\\b\\w/g, (s) => s.toUpperCase())\n }\n return longString\n}\n\n/**\n * Creates a sentence case sentence.\n * @returns string\n */\nconst recursiveGrow = (length = 1, out = exampleText.longest_ipsum): string => {\n if (!length) {\n return ''\n }\n if (out.length < length) {\n return recursiveGrow(length, out + exampleText.longest_ipsum)\n }\n if (out.length >= length) {\n return out.slice(0, length - 1) + '.'\n }\n return 'Lorem ipsum grow failed.'\n}\n"],"mappings":"AAAA,OAAO,IAAMA,WAAW,GAAG;EACzB,WAAS,WAAW;EACpBC,IAAI,EAAE,EAAE;EACRC,WAAW,EAAE,OAAO;EACpBC,cAAc,EAAE,uDAAuD;EACvEC,UAAU,sXAKgC;EAC1CC,aAAa,o+BAYuC;EACpDC,mBAAmB,6VAA6V;EAChXC,iBAAiB;AAQnB,CAAC;AAED,OAAO,SAASC,KAAKA,CACnBC,eAMK,EACL;EACA,IAAI,OAAOA,eAAe,KAAK,QAAQ,EAAE;IACvC,OAAOC,cAAa,CAACD,eAAe,CAAC;EACvC;EACA,IAAQE,MAAM,GAAiCF,eAAe,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