@procore/text-editor 0.0.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 (161) hide show
  1. package/.jest/ckeditorMock.js +67 -0
  2. package/.jest/esToolkitMock.js +23 -0
  3. package/.jest/setupTests.js +33 -0
  4. package/.jest/styleMock.js +1 -0
  5. package/.jest/svgTransform.js +10 -0
  6. package/.jest/translationFileMock.js +4 -0
  7. package/.jest/translationMock.js +12 -0
  8. package/LICENSE +84 -0
  9. package/README.md +107 -0
  10. package/codemod/__fixtures__/hammer.config.mjs +15 -0
  11. package/codemod/__fixtures__/jest.config.js +6 -0
  12. package/codemod/__fixtures__/procore.config.js +12 -0
  13. package/codemod/__fixtures__/src/components/ComplexEditor.tsx +21 -0
  14. package/codemod/__fixtures__/src/components/FormWithRichText.tsx +10 -0
  15. package/codemod/__fixtures__/src/components/MultilineFormRichText.tsx +14 -0
  16. package/codemod/__fixtures__/src/components/NoTextEditor.tsx +11 -0
  17. package/codemod/__fixtures__/src/components/ReadOnlyRichText.tsx +10 -0
  18. package/codemod/__fixtures__/src/components/SimpleEditor.tsx +11 -0
  19. package/codemod/__fixtures__/src/components/TypeImportEditor.tsx +17 -0
  20. package/codemod/text-editor-migrate.js +509 -0
  21. package/codemod/text-editor-migrate.test.js +225 -0
  22. package/dist/TextEditor/EditorError.js +9 -0
  23. package/dist/TextEditor/EditorError.js.map +1 -0
  24. package/dist/TextEditor/StickyToolbar/index.js +2 -0
  25. package/dist/TextEditor/StickyToolbar/index.js.map +1 -0
  26. package/dist/TextEditor/StickyToolbar/useStickyToolbar.js +59 -0
  27. package/dist/TextEditor/StickyToolbar/useStickyToolbar.js.map +1 -0
  28. package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js +2 -0
  29. package/dist/TextEditor/StickyToolbar/useStickyToolbar.types.js.map +1 -0
  30. package/dist/TextEditor/TextEditor.js +226 -0
  31. package/dist/TextEditor/TextEditor.js.map +1 -0
  32. package/dist/TextEditor/TextEditor.styles.js +26 -0
  33. package/dist/TextEditor/TextEditor.styles.js.map +1 -0
  34. package/dist/TextEditor/TextEditor.types.js +2 -0
  35. package/dist/TextEditor/TextEditor.types.js.map +1 -0
  36. package/dist/TextEditor/TextEditorProvider.js +17 -0
  37. package/dist/TextEditor/TextEditorProvider.js.map +1 -0
  38. package/dist/TextEditor/TextEditorProvider.types.js +2 -0
  39. package/dist/TextEditor/TextEditorProvider.types.js.map +1 -0
  40. package/dist/TextEditor/index.js +4 -0
  41. package/dist/TextEditor/index.js.map +1 -0
  42. package/dist/TextEditor/license_key.js +3 -0
  43. package/dist/TextEditor/license_key.js.map +1 -0
  44. package/dist/TextEditor/plugins/CutPlugin/CutCommand.js +99 -0
  45. package/dist/TextEditor/plugins/CutPlugin/CutCommand.js.map +1 -0
  46. package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js +56 -0
  47. package/dist/TextEditor/plugins/CutPlugin/CutPlugin.js.map +1 -0
  48. package/dist/TextEditor/plugins/CutPlugin/index.js +2 -0
  49. package/dist/TextEditor/plugins/CutPlugin/index.js.map +1 -0
  50. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js +40 -0
  51. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.js.map +1 -0
  52. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js +2 -0
  53. package/dist/TextEditor/plugins/IndentPaddingToMarginPlugin/index.js.map +1 -0
  54. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js +86 -0
  55. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.js.map +1 -0
  56. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js +56 -0
  57. package/dist/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.js.map +1 -0
  58. package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js +2 -0
  59. package/dist/TextEditor/plugins/PasteAsTextPlugin/index.js.map +1 -0
  60. package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js +149 -0
  61. package/dist/TextEditor/plugins/PastePlugin/PasteCommand.js.map +1 -0
  62. package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js +56 -0
  63. package/dist/TextEditor/plugins/PastePlugin/PastePlugin.js.map +1 -0
  64. package/dist/TextEditor/plugins/PastePlugin/index.js +2 -0
  65. package/dist/TextEditor/plugins/PastePlugin/index.js.map +1 -0
  66. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js +87 -0
  67. package/dist/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.js.map +1 -0
  68. package/dist/TextEditor/plugins/TabSpacesPlugin/index.js +2 -0
  69. package/dist/TextEditor/plugins/TabSpacesPlugin/index.js.map +1 -0
  70. package/dist/TextEditor/textEditorTheming/icons.js +24 -0
  71. package/dist/TextEditor/textEditorTheming/icons.js.map +1 -0
  72. package/dist/TextEditor/textEditorTheming/index.js +2 -0
  73. package/dist/TextEditor/textEditorTheming/index.js.map +1 -0
  74. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js +10 -0
  75. package/dist/TextEditor/textEditorTheming/textEditorTheming.styles.js.map +1 -0
  76. package/dist/TextEditor/useCKEditorCss.js +36 -0
  77. package/dist/TextEditor/useCKEditorCss.js.map +1 -0
  78. package/dist/TextEditor/useTabAsNavigation.js +29 -0
  79. package/dist/TextEditor/useTabAsNavigation.js.map +1 -0
  80. package/dist/TextEditor/utils/config.js +179 -0
  81. package/dist/TextEditor/utils/config.js.map +1 -0
  82. package/dist/TextEditor/utils/index.js +3 -0
  83. package/dist/TextEditor/utils/index.js.map +1 -0
  84. package/dist/TextEditor/utils/locale.js +102 -0
  85. package/dist/TextEditor/utils/locale.js.map +1 -0
  86. package/dist/TextEditor/utils/plugins.js +184 -0
  87. package/dist/TextEditor/utils/plugins.js.map +1 -0
  88. package/dist/TextEditorOutput/TextEditorOutput.js +29 -0
  89. package/dist/TextEditorOutput/TextEditorOutput.js.map +1 -0
  90. package/dist/TextEditorOutput/TextEditorOutput.styles.js +6 -0
  91. package/dist/TextEditorOutput/TextEditorOutput.styles.js.map +1 -0
  92. package/dist/TextEditorOutput/TextEditorOutput.types.js +2 -0
  93. package/dist/TextEditorOutput/TextEditorOutput.types.js.map +1 -0
  94. package/dist/TextEditorOutput/TextEditorOutput.utils.js +59 -0
  95. package/dist/TextEditorOutput/TextEditorOutput.utils.js.map +1 -0
  96. package/dist/TextEditorOutput/index.js +2 -0
  97. package/dist/TextEditorOutput/index.js.map +1 -0
  98. package/dist/_storyHelpers/constants.js +48 -0
  99. package/dist/_storyHelpers/constants.js.map +1 -0
  100. package/dist/_typedoc/TextEditor/TextEditor.types.json +227 -0
  101. package/dist/_typedoc/TextEditor/TextEditorProvider.types.json +28 -0
  102. package/dist/_typedoc/TextEditorOutput/TextEditorOutput.types.json +38 -0
  103. package/dist/_typedoc/deprecations.json +1 -0
  104. package/dist/_utils/propsTypedoc.js +4 -0
  105. package/dist/_utils/propsTypedoc.js.map +1 -0
  106. package/dist/codemod/__fixtures__/src/components/ComplexEditor.d.ts +2 -0
  107. package/dist/codemod/__fixtures__/src/components/FormWithRichText.d.ts +2 -0
  108. package/dist/codemod/__fixtures__/src/components/MultilineFormRichText.d.ts +2 -0
  109. package/dist/codemod/__fixtures__/src/components/NoTextEditor.d.ts +2 -0
  110. package/dist/codemod/__fixtures__/src/components/ReadOnlyRichText.d.ts +2 -0
  111. package/dist/codemod/__fixtures__/src/components/SimpleEditor.d.ts +2 -0
  112. package/dist/codemod/__fixtures__/src/components/TypeImportEditor.d.ts +2 -0
  113. package/dist/index.js +3 -0
  114. package/dist/index.js.map +1 -0
  115. package/dist/src/TextEditor/EditorError.d.ts +2 -0
  116. package/dist/src/TextEditor/StickyToolbar/index.d.ts +2 -0
  117. package/dist/src/TextEditor/StickyToolbar/useStickyToolbar.d.ts +2 -0
  118. package/dist/src/TextEditor/StickyToolbar/useStickyToolbar.types.d.ts +8 -0
  119. package/dist/src/TextEditor/TextEditor.d.ts +44 -0
  120. package/dist/src/TextEditor/TextEditor.styles.d.ts +7 -0
  121. package/dist/src/TextEditor/TextEditor.types.d.ts +155 -0
  122. package/dist/src/TextEditor/TextEditorProvider.d.ts +4 -0
  123. package/dist/src/TextEditor/TextEditorProvider.types.d.ts +14 -0
  124. package/dist/src/TextEditor/index.d.ts +4 -0
  125. package/dist/src/TextEditor/license_key.d.ts +2 -0
  126. package/dist/src/TextEditor/plugins/CutPlugin/CutCommand.d.ts +5 -0
  127. package/dist/src/TextEditor/plugins/CutPlugin/CutPlugin.d.ts +5 -0
  128. package/dist/src/TextEditor/plugins/CutPlugin/index.d.ts +1 -0
  129. package/dist/src/TextEditor/plugins/IndentPaddingToMarginPlugin/IndentPaddingToMarginPlugin.d.ts +5 -0
  130. package/dist/src/TextEditor/plugins/IndentPaddingToMarginPlugin/index.d.ts +1 -0
  131. package/dist/src/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextCommand.d.ts +5 -0
  132. package/dist/src/TextEditor/plugins/PasteAsTextPlugin/PasteAsTextPlugin.d.ts +5 -0
  133. package/dist/src/TextEditor/plugins/PasteAsTextPlugin/index.d.ts +1 -0
  134. package/dist/src/TextEditor/plugins/PastePlugin/PasteCommand.d.ts +5 -0
  135. package/dist/src/TextEditor/plugins/PastePlugin/PastePlugin.d.ts +5 -0
  136. package/dist/src/TextEditor/plugins/PastePlugin/index.d.ts +1 -0
  137. package/dist/src/TextEditor/plugins/TabSpacesPlugin/TabSpacesPlugin.d.ts +6 -0
  138. package/dist/src/TextEditor/plugins/TabSpacesPlugin/index.d.ts +1 -0
  139. package/dist/src/TextEditor/textEditorTheming/icons.d.ts +23 -0
  140. package/dist/src/TextEditor/textEditorTheming/index.d.ts +1 -0
  141. package/dist/src/TextEditor/textEditorTheming/textEditorTheming.styles.d.ts +2 -0
  142. package/dist/src/TextEditor/useCKEditorCss.d.ts +3 -0
  143. package/dist/src/TextEditor/useTabAsNavigation.d.ts +11 -0
  144. package/dist/src/TextEditor/utils/config.d.ts +3 -0
  145. package/dist/src/TextEditor/utils/index.d.ts +2 -0
  146. package/dist/src/TextEditor/utils/locale.d.ts +3 -0
  147. package/dist/src/TextEditor/utils/plugins.d.ts +7 -0
  148. package/dist/src/TextEditorOutput/TextEditorOutput.d.ts +8 -0
  149. package/dist/src/TextEditorOutput/TextEditorOutput.styles.d.ts +2 -0
  150. package/dist/src/TextEditorOutput/TextEditorOutput.types.d.ts +21 -0
  151. package/dist/src/TextEditorOutput/TextEditorOutput.utils.d.ts +2 -0
  152. package/dist/src/TextEditorOutput/index.d.ts +2 -0
  153. package/dist/src/_storyHelpers/constants.d.ts +14 -0
  154. package/dist/src/_utils/propsTypedoc.d.ts +3 -0
  155. package/dist/src/index.d.ts +2 -0
  156. package/dist/src/stories/util.d.ts +21 -0
  157. package/dist/stories/util.js +86 -0
  158. package/dist/stories/util.js.map +1 -0
  159. package/jestConfig.d.ts +1 -0
  160. package/jestConfig.js +66 -0
  161. package/package.json +146 -0
@@ -0,0 +1,227 @@
1
+ {
2
+ "TextEditorProps": {
3
+ "name": "TextEditorProps",
4
+ "properties": [
5
+ {
6
+ "name": "disabled",
7
+ "required": false,
8
+ "type": "<span class=\"tsd-signature-type\">boolean</span>",
9
+ "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
10
+ "description": "Indicates if the editor is disabled",
11
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Indicates if the editor is disabled</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
12
+ "sourceFile": "TextEditor/TextEditor.types.ts",
13
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L34"
14
+ },
15
+ {
16
+ "name": "error",
17
+ "required": false,
18
+ "type": "<span class=\"tsd-signature-type\">boolean</span>",
19
+ "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
20
+ "description": "Indicates if the editor is in an error state",
21
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Indicates if the editor is in an error state</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
22
+ "sourceFile": "TextEditor/TextEditor.types.ts",
23
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L41"
24
+ },
25
+ {
26
+ "name": "id",
27
+ "required": false,
28
+ "type": "<span class=\"tsd-signature-type\">string</span>",
29
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
30
+ "description": "Unique identifier for the editor",
31
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Unique identifier for the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
32
+ "sourceFile": "TextEditor/TextEditor.types.ts",
33
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L10"
34
+ },
35
+ {
36
+ "name": "init",
37
+ "required": false,
38
+ "type": "<span class=\"tsd-signature-type\">any</span>",
39
+ "typeDetail": "<span class=\"tsd-signature-type\">any</span>",
40
+ "description": "Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**",
41
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Config for when the editor is initialized. <strong>Changes after the editor has initialized are ignored.</strong></p>\n</div><dl class=\"tsd-comment-tags\"><dt>link</dt><dd><p><a href=\"https://www.tiny.cloud/docs/integrations/react/#init\">TinyMCE React Init</a></p>\n</dd><dt>unsupported</dt><dd><p>Use at your own risk. DST makes no guarantees about this API,\nand is subject to removal at any point without warning or deprecation.</p>\n</dd><dt>deprecated</dt><dd><p><code>init</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
42
+ "deprecated": "`init` has been deprecated and will be removed in a future version. TinyMCE support has been removed.",
43
+ "sourceFile": "TextEditor/TextEditor.types.ts",
44
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L153"
45
+ },
46
+ {
47
+ "name": "initialValue",
48
+ "required": false,
49
+ "type": "<span class=\"tsd-signature-type\">string</span>",
50
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
51
+ "description": "Initial value of the editor",
52
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Initial value of the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>initialValue</code> has been deprecated and will be removed in a future version.\nPlease use the <code>value</code> prop instead</p>\n</dd><dt>deprecatedsince</dt><dd><p>10.20.0</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
53
+ "deprecated": "`initialValue` has been deprecated and will be removed in a future version.\nPlease use the `value` prop instead",
54
+ "deprecatedSince": "10.20.0",
55
+ "sourceFile": "TextEditor/TextEditor.types.ts",
56
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L20"
57
+ },
58
+ {
59
+ "name": "locale",
60
+ "required": false,
61
+ "type": "<span class=\"tsd-signature-type\">Locale</span>",
62
+ "typeDetail": "<span class=\"tsd-signature-type\">Locale</span>",
63
+ "description": "Locale which will be used for localization. Can be passed directly or\nset by wrapping components in I18n provider.",
64
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Locale which will be used for localization. Can be passed directly or\nset by wrapping components in I18n provider.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
65
+ "sourceFile": "TextEditor/TextEditor.types.ts",
66
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L48"
67
+ },
68
+ {
69
+ "name": "plugins",
70
+ "required": false,
71
+ "type": "<span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">[]</span>",
72
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">[]</span>",
73
+ "description": "Array of plugin names to add to the editor in addition to the defaults.\nThis provides backward compatibility with the deprecated TinyMCE version of the editor.\nSupports plugin names like 'link', 'image', 'table', etc.",
74
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Array of plugin names to add to the editor in addition to the defaults.\nThis provides backward compatibility with the deprecated TinyMCE version of the editor.\nSupports plugin names like &#39;link&#39;, &#39;image&#39;, &#39;table&#39;, etc.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.26.0</p>\n</dd></dl></div>",
75
+ "sourceFile": "TextEditor/TextEditor.types.ts",
76
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L57"
77
+ },
78
+ {
79
+ "name": "tinyMCE",
80
+ "required": false,
81
+ "type": "<span class=\"tsd-signature-type\">boolean</span>",
82
+ "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
83
+ "description": "If you experience problems with the new editor implementation, you can use this to **temporarily** switch back to legacy version while you report the issue.",
84
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>If you experience problems with the new editor implementation, you can use this to <strong>temporarily</strong> switch back to legacy version while you report the issue.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p>This property will be removed in a future version. TinyMCE support has been removed.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
85
+ "deprecated": "This property will be removed in a future version. TinyMCE support has been removed.",
86
+ "sourceFile": "TextEditor/TextEditor.types.ts",
87
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L142"
88
+ },
89
+ {
90
+ "name": "value",
91
+ "required": false,
92
+ "type": "<span class=\"tsd-signature-type\">string</span>",
93
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
94
+ "description": "The current value of the editor",
95
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>The current value of the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
96
+ "sourceFile": "TextEditor/TextEditor.types.ts",
97
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L27"
98
+ },
99
+ {
100
+ "name": "config",
101
+ "required": false,
102
+ "type": "Function",
103
+ "typeDetail": "config<span class=\"tsd-signature-symbol\">(</span>defaultConfig<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">EditorConfig</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">EditorConfig</span>",
104
+ "description": "Configuration function for customizing the editor",
105
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Configuration function for customizing the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.26.0</p>\n</dd></dl></div>",
106
+ "sourceFile": "TextEditor/TextEditor.types.ts",
107
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L66"
108
+ },
109
+ {
110
+ "name": "onAfterDestroy",
111
+ "required": false,
112
+ "type": "Function",
113
+ "typeDetail": "on<wbr/>After<wbr/>Destroy<span class=\"tsd-signature-symbol\">(</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
114
+ "description": "Callback fired after the editor instance is destroyed",
115
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired after the editor instance is destroyed</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
116
+ "sourceFile": "TextEditor/TextEditor.types.ts",
117
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L116"
118
+ },
119
+ {
120
+ "name": "onBlur",
121
+ "required": false,
122
+ "type": "Function",
123
+ "typeDetail": "on<wbr/>Blur<span class=\"tsd-signature-symbol\">(</span>event<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">EventInfo</span><span class=\"tsd-signature-symbol\">&lt;</span><span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">, </span><span class=\"tsd-signature-type\">unknown</span><span class=\"tsd-signature-symbol\">&gt;</span>, editor<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">ClassicEditor</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
124
+ "description": "Callback fired when the editor loses focus",
125
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor loses focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
126
+ "sourceFile": "TextEditor/TextEditor.types.ts",
127
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L89"
128
+ },
129
+ {
130
+ "name": "onChange",
131
+ "required": false,
132
+ "type": "Function",
133
+ "typeDetail": "on<wbr/>Change<span class=\"tsd-signature-symbol\">(</span>value<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">string</span>, isDirty<span class=\"tsd-signature-symbol\">?: </span><span class=\"tsd-signature-type\">boolean</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
134
+ "description": "Callback fired when the editor content changes",
135
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor content changes</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
136
+ "sourceFile": "TextEditor/TextEditor.types.ts",
137
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L75"
138
+ },
139
+ {
140
+ "name": "onDirty",
141
+ "required": false,
142
+ "type": "Function",
143
+ "typeDetail": "on<wbr/>Dirty<span class=\"tsd-signature-symbol\">(</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
144
+ "description": "Callback fired when the editor becomes dirty (content differs from initial value)",
145
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor becomes dirty (content differs from initial value)</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.26.0</p>\n</dd></dl></div>",
146
+ "sourceFile": "TextEditor/TextEditor.types.ts",
147
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L123"
148
+ },
149
+ {
150
+ "name": "onEditorChange",
151
+ "required": false,
152
+ "type": "Function",
153
+ "typeDetail": "on<wbr/>Editor<wbr/>Change<span class=\"tsd-signature-symbol\">(</span>value<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
154
+ "description": "Callback fired when the editor content changes",
155
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor content changes</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>onEditorChange</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use <code>onChange</code> instead.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
156
+ "sourceFile": "TextEditor/TextEditor.types.ts",
157
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L161"
158
+ },
159
+ {
160
+ "name": "onError",
161
+ "required": false,
162
+ "type": "Function",
163
+ "typeDetail": "on<wbr/>Error<span class=\"tsd-signature-symbol\">(</span>error<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">Error</span>, details<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-symbol\">{ </span>phase<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">&quot;initialization&quot;</span><span class=\"tsd-signature-symbol\"> | </span><span class=\"tsd-signature-type\">&quot;runtime&quot;</span><span class=\"tsd-signature-symbol\">; </span>willEditorRestart<span class=\"tsd-signature-symbol\">?: </span><span class=\"tsd-signature-type\">boolean</span><span class=\"tsd-signature-symbol\"> }</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
164
+ "description": "Callback fired when an error occurs in the editor",
165
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when an error occurs in the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
166
+ "sourceFile": "TextEditor/TextEditor.types.ts",
167
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L96"
168
+ },
169
+ {
170
+ "name": "onFocus",
171
+ "required": false,
172
+ "type": "Function",
173
+ "typeDetail": "on<wbr/>Focus<span class=\"tsd-signature-symbol\">(</span>event<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">EventInfo</span><span class=\"tsd-signature-symbol\">&lt;</span><span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">, </span><span class=\"tsd-signature-type\">unknown</span><span class=\"tsd-signature-symbol\">&gt;</span>, editor<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">ClassicEditor</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
174
+ "description": "Callback fired when the editor gains focus",
175
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor gains focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
176
+ "sourceFile": "TextEditor/TextEditor.types.ts",
177
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L82"
178
+ },
179
+ {
180
+ "name": "onFocusIn",
181
+ "required": false,
182
+ "type": "Function",
183
+ "typeDetail": "on<wbr/>Focus<wbr/>In<span class=\"tsd-signature-symbol\">(</span><span class=\"tsd-signature-symbol\">...</span>args<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">any</span><span class=\"tsd-signature-symbol\">[]</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
184
+ "description": "Callback fired when the editor gains focus",
185
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor gains focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>onFocusIn</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use <code>onFocus</code> instead.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
186
+ "sourceFile": "TextEditor/TextEditor.types.ts",
187
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L169"
188
+ },
189
+ {
190
+ "name": "onFocusOut",
191
+ "required": false,
192
+ "type": "Function",
193
+ "typeDetail": "on<wbr/>Focus<wbr/>Out<span class=\"tsd-signature-symbol\">(</span><span class=\"tsd-signature-symbol\">...</span>args<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">any</span><span class=\"tsd-signature-symbol\">[]</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
194
+ "description": "Callback fired when the editor loses focus",
195
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor loses focus</p>\n</div><dl class=\"tsd-comment-tags\"><dt>deprecated</dt><dd><p><code>onFocusOut</code> has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use <code>onBlur</code> instead.</p>\n</dd><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
196
+ "sourceFile": "TextEditor/TextEditor.types.ts",
197
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L177"
198
+ },
199
+ {
200
+ "name": "onInit",
201
+ "required": false,
202
+ "type": "Function",
203
+ "typeDetail": "on<wbr/>Init<span class=\"tsd-signature-symbol\">(</span>editor<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">ClassicEditor</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
204
+ "description": "Callback fired when the editor is ready",
205
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when the editor is ready</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.19.0</p>\n</dd></dl></div>",
206
+ "sourceFile": "TextEditor/TextEditor.types.ts",
207
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L109"
208
+ },
209
+ {
210
+ "name": "onKeyDown",
211
+ "required": false,
212
+ "type": "Function",
213
+ "typeDetail": "on<wbr/>Key<wbr/>Down<span class=\"tsd-signature-symbol\">(</span>event<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">KeyboardEvent</span>, editor<span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">ClassicEditor</span><span class=\"tsd-signature-symbol\">)</span><span class=\"tsd-signature-symbol\">: </span><span class=\"tsd-signature-type\">void</span>",
214
+ "description": "Callback fired when a key is pressed in the editor",
215
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Callback fired when a key is pressed in the editor</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>12.29.0</p>\n</dd></dl></div>",
216
+ "sourceFile": "TextEditor/TextEditor.types.ts",
217
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditor.types.ts#L132"
218
+ }
219
+ ],
220
+ "description": ""
221
+ },
222
+ "KeyDownListener": {
223
+ "name": "KeyDownListener",
224
+ "properties": [],
225
+ "description": ""
226
+ }
227
+ }
@@ -0,0 +1,28 @@
1
+ {
2
+ "TextEditorProviderProps": {
3
+ "name": "TextEditorProviderProps",
4
+ "properties": [
5
+ {
6
+ "name": "children",
7
+ "required": true,
8
+ "type": "<span class=\"tsd-signature-type\">ReactNode</span>",
9
+ "typeDetail": "<span class=\"tsd-signature-type\">ReactNode</span>",
10
+ "description": "",
11
+ "descriptionHtml": "",
12
+ "sourceFile": "TextEditor/TextEditorProvider.types.ts",
13
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L9"
14
+ },
15
+ {
16
+ "name": "features",
17
+ "required": false,
18
+ "type": "<span class=\"tsd-signature-type\">TextEditorFeatureToggle</span>",
19
+ "typeDetail": "<span class=\"tsd-signature-type\">TextEditorFeatureToggle</span>",
20
+ "description": "- `stickyToolbar` - Have the editor toolbar stick to the top when content is longer than the page length.\n- `tabAsNavigation` - Have `Tab` key exit the editor. Support `Alt`/`Opt` + `Tab` as triple space indent.",
21
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<ul>\n<li><code>stickyToolbar</code> - Have the editor toolbar stick to the top when content is longer than the page length.</li>\n<li><code>tabAsNavigation</code> - Have <code>Tab</code> key exit the editor. Support <code>Alt</code>/<code>Opt</code> + <code>Tab</code> as triple space indent.</li>\n</ul>\n</div></div>",
22
+ "sourceFile": "TextEditor/TextEditorProvider.types.ts",
23
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L14"
24
+ }
25
+ ],
26
+ "description": ""
27
+ }
28
+ }
@@ -0,0 +1,38 @@
1
+ {
2
+ "TextEditorOutputProps": {
3
+ "name": "TextEditorOutputProps",
4
+ "properties": [
5
+ {
6
+ "name": "className",
7
+ "required": false,
8
+ "type": "<span class=\"tsd-signature-type\">string</span>",
9
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
10
+ "description": "Additional classNames",
11
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional classNames</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.24.0</p>\n</dd></dl></div>",
12
+ "sourceFile": "TextEditorOutput/TextEditorOutput.types.ts",
13
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L14"
14
+ },
15
+ {
16
+ "name": "style",
17
+ "required": false,
18
+ "type": "<span class=\"tsd-signature-type\">CSSProperties</span>",
19
+ "typeDetail": "<span class=\"tsd-signature-type\">CSSProperties</span>",
20
+ "description": "Additional CSS styles",
21
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Additional CSS styles</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.24.0</p>\n</dd></dl></div>",
22
+ "sourceFile": "TextEditorOutput/TextEditorOutput.types.ts",
23
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L21"
24
+ },
25
+ {
26
+ "name": "value",
27
+ "required": false,
28
+ "type": "<span class=\"tsd-signature-type\">string</span>",
29
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
30
+ "description": "Formatted text from `TextEditor`",
31
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Formatted text from <code>TextEditor</code></p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>10.24.0</p>\n</dd></dl></div>",
32
+ "sourceFile": "TextEditorOutput/TextEditorOutput.types.ts",
33
+ "sourceUrl": "https://github.com/procore/core/blob/d7acf0a/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L7"
34
+ }
35
+ ],
36
+ "description": ""
37
+ }
38
+ }
@@ -0,0 +1 @@
1
+ [{"interface":"TextEditorProps","property":"init","deprecatedSince":"","message":"`init` has been deprecated and will be removed in a future version. TinyMCE support has been removed.","deprecationKind":"prop"},{"interface":"TextEditorProps","property":"initialValue","deprecatedSince":"10.20.0","message":"`initialValue` has been deprecated and will be removed in a future version.\nPlease use the `value` prop instead","deprecationKind":"prop"},{"interface":"TextEditorProps","property":"tinyMCE","deprecatedSince":"","message":"This property will be removed in a future version. TinyMCE support has been removed.","deprecationKind":"prop"}]
@@ -0,0 +1,4 @@
1
+ export * from '../TextEditor/TextEditor.types';
2
+ export * from '../TextEditor/TextEditorProvider.types';
3
+ export * from '../TextEditorOutput/TextEditorOutput.types';
4
+ //# sourceMappingURL=propsTypedoc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propsTypedoc.js","names":[],"sources":["../../src/_utils/propsTypedoc.ts"],"sourcesContent":["export * from '../TextEditor/TextEditor.types'\nexport * from '../TextEditor/TextEditorProvider.types'\nexport * from '../TextEditorOutput/TextEditorOutput.types'\n"],"mappings":"AAAA,cAAc,gCAAgC;AAC9C,cAAc,wCAAwC;AACtD,cAAc,4CAA4C"}
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ComplexEditor: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const FormWithRichText: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const MultilineFormRichText: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const NoTextEditor: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const ReadOnlyRichText: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const SimpleEditor: () => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare const TypeImportEditor: React.FC;
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export * from './TextEditor';
2
+ export * from './TextEditorOutput';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './TextEditor'\nexport * from './TextEditorOutput'\n"],"mappings":"AAAA,cAAc,cAAc;AAC5B,cAAc,oBAAoB"}
@@ -0,0 +1,2 @@
1
+ import React, { type PropsWithChildren } from 'react';
2
+ export declare const EditorError: ({ children }: PropsWithChildren<{}>) => React.JSX.Element;
@@ -0,0 +1,2 @@
1
+ export { useStickyToolbar } from './useStickyToolbar';
2
+ export type { UseStickyToolbarProps } from './useStickyToolbar.types';
@@ -0,0 +1,2 @@
1
+ import type { UseStickyToolbarProps } from './useStickyToolbar.types';
2
+ export declare function useStickyToolbar({ enabled, editor, editorRef, cssLoading, }: UseStickyToolbarProps): void;
@@ -0,0 +1,8 @@
1
+ import type { ClassicEditor } from 'ckeditor5';
2
+ import type { RefObject } from 'react';
3
+ export interface UseStickyToolbarProps {
4
+ enabled: boolean;
5
+ editorRef: RefObject<HTMLDivElement>;
6
+ editor?: ClassicEditor | null;
7
+ cssLoading?: boolean;
8
+ }
@@ -0,0 +1,44 @@
1
+ import React from 'react';
2
+ import type { TextEditorProps } from './TextEditor.types';
3
+ /**
4
+ * To ensure your Jest tests work with the CKEditor implementation, wrap your Jest configuration with `textEditorJestConfig`:
5
+ *
6
+ * @example
7
+ *
8
+ * // Using Jest config file
9
+ *
10
+ * const { textEditorJestConfig } = require('@procore/text-editor/jestConfig')
11
+ *
12
+ * module.exports = textEditorJestConfig({
13
+ * // Your existing Jest config
14
+ * })
15
+ *
16
+ * @example
17
+ *
18
+ * // Using Hammer
19
+ *
20
+ * import { textEditorJestConfig } from '@procore/text-editor/jestConfig'
21
+ *
22
+ * export default {
23
+ * testJest: (defaultConfig) =>
24
+ * textEditorJestConfig({
25
+ * ...defaultConfig,
26
+ * // Your existing Jest config
27
+ * }),
28
+ * }
29
+ *
30
+ * @example
31
+ *
32
+ * // Using Core Scripts
33
+ *
34
+ * const { textEditorJestConfig } = require('@procore/text-editor/jestConfig')
35
+ *
36
+ * module.exports = () => ({
37
+ * jestOverride: (defaultConfig) =>
38
+ * textEditorJestConfig({
39
+ * ...defaultConfig,
40
+ * // Your existing Jest config
41
+ * }),
42
+ * })
43
+ */
44
+ export declare function TextEditor({ disabled, error, value, initialValue, onChange, onInit, onBlur, onKeyDown, config: externalConfig, plugins: stringPlugins, locale: propLocale, onDirty, tinyMCE: _tinyMCE, init: _init, onEditorChange: _onEditorChange, onFocusOut: _onFocusOut, ...restProps }: TextEditorProps): React.JSX.Element | null;
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const GlobalEditorStyles: import("react").NamedExoticComponent<import("styled-components").ExecutionProps & {
3
+ zIndex: number;
4
+ }>;
5
+ export declare const StyledTextEditor: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components/dist/types").Substitute<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {
6
+ error?: boolean | undefined;
7
+ }>> & string;
@@ -0,0 +1,155 @@
1
+ import type { Locale } from '@procore/core-react';
2
+ import type { ClassicEditor, EditorConfig, EventInfo } from 'ckeditor5';
3
+ export interface TextEditorProps {
4
+ /**
5
+ * Unique identifier for the editor
6
+ *
7
+ * @since 10.19.0
8
+ */
9
+ id?: string;
10
+ /**
11
+ * Initial value of the editor
12
+ *
13
+ * @deprecated `initialValue` has been deprecated and will be removed in a future version.
14
+ * Please use the `value` prop instead
15
+ * @deprecatedSince 10.20.0
16
+ * @since 10.19.0
17
+ */
18
+ initialValue?: string;
19
+ /**
20
+ * The current value of the editor
21
+ *
22
+ * @since 10.19.0
23
+ */
24
+ value?: string;
25
+ /**
26
+ * Indicates if the editor is disabled
27
+ *
28
+ * @since 10.19.0
29
+ */
30
+ disabled?: boolean;
31
+ /**
32
+ * Indicates if the editor is in an error state
33
+ *
34
+ * @since 10.19.0
35
+ */
36
+ error?: boolean;
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
41
+ */
42
+ locale?: Locale;
43
+ /**
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.
47
+ *
48
+ * @since 12.26.0
49
+ */
50
+ plugins?: string[];
51
+ /**
52
+ * Configuration function for customizing the editor
53
+ *
54
+ * @param defaultConfig - The default CKEditor configuration
55
+ * @returns Customized configuration object
56
+ * @since 12.26.0
57
+ */
58
+ config?: (defaultConfig: EditorConfig) => EditorConfig;
59
+ /**
60
+ * Callback fired when the editor content changes
61
+ *
62
+ * @param value - The current content of the editor
63
+ * @param isDirty - Whether the content differs from the initial value
64
+ * @since 10.19.0
65
+ */
66
+ onChange?: (value: string, isDirty?: boolean) => void;
67
+ /**
68
+ * Callback fired when the editor gains focus
69
+ *
70
+ * @since 10.19.0
71
+ */
72
+ onFocus?: (event: EventInfo, editor: ClassicEditor) => void;
73
+ /**
74
+ * Callback fired when the editor loses focus
75
+ *
76
+ * @since 10.19.0
77
+ */
78
+ onBlur?: (event: EventInfo, editor: ClassicEditor) => void;
79
+ /**
80
+ * Callback fired when an error occurs in the editor
81
+ *
82
+ * @since 10.19.0
83
+ */
84
+ onError?: (error: Error, details: {
85
+ phase: 'initialization' | 'runtime';
86
+ willEditorRestart?: boolean;
87
+ }) => void;
88
+ /**
89
+ * Callback fired when the editor is ready
90
+ *
91
+ * @since 10.19.0
92
+ */
93
+ onInit?: (editor: ClassicEditor) => void;
94
+ /**
95
+ * Callback fired after the editor instance is destroyed
96
+ *
97
+ * @since 10.19.0
98
+ */
99
+ onAfterDestroy?: () => void;
100
+ /**
101
+ * Callback fired when the editor becomes dirty (content differs from initial value)
102
+ *
103
+ * @since 12.26.0
104
+ */
105
+ onDirty?: () => void;
106
+ /**
107
+ * Callback fired when a key is pressed in the editor
108
+ *
109
+ * @param event - The keyboard event
110
+ * @param editor - The CKEditor instance
111
+ * @since 12.29.0
112
+ */
113
+ onKeyDown?: (event: KeyboardEvent, editor: ClassicEditor) => void;
114
+ /**
115
+ * If you experience problems with the new editor implementation, you can use this to **temporarily** switch back to legacy version while you report the issue.
116
+ *
117
+ * @deprecated This property will be removed in a future version. TinyMCE support has been removed.
118
+ * @since 10.19.0
119
+ */
120
+ tinyMCE?: boolean;
121
+ /**
122
+ * Config for when the editor is initialized. **Changes after the editor has initialized are ignored.**
123
+ *
124
+ * @link [TinyMCE React Init](https://www.tiny.cloud/docs/integrations/react/#init)
125
+ * @unsupported Use at your own risk. DST makes no guarantees about this API,
126
+ * and is subject to removal at any point without warning or deprecation.
127
+ * @deprecated `init` has been deprecated and will be removed in a future version. TinyMCE support has been removed.
128
+ * @since 10.19.0
129
+ */
130
+ init?: any;
131
+ /**
132
+ * Callback fired when the editor content changes
133
+ *
134
+ * @deprecated `onEditorChange` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onChange` instead.
135
+ * @since 10.19.0
136
+ */
137
+ onEditorChange?: (value: string) => void;
138
+ /**
139
+ * Callback fired when the editor gains focus
140
+ *
141
+ * @deprecated `onFocusIn` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onFocus` instead.
142
+ * @since 10.19.0
143
+ */
144
+ onFocusIn?: (...args: any[]) => void;
145
+ /**
146
+ * Callback fired when the editor loses focus
147
+ *
148
+ * @deprecated `onFocusOut` has been deprecated and will be removed in a future version. TinyMCE support has been removed. Use `onBlur` instead.
149
+ * @since 10.19.0
150
+ */
151
+ onFocusOut?: (...args: any[]) => void;
152
+ }
153
+ export declare type KeyDownListener = (event: EventInfo, data: {
154
+ domEvent: Event;
155
+ }) => void;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import type { TextEditorProviderProps } from './TextEditorProvider.types';
3
+ export declare const TextEditorContext: React.Context<Omit<TextEditorProviderProps, "children">>;
4
+ export declare function TextEditorProvider({ children, features, }: TextEditorProviderProps): React.JSX.Element;
@@ -0,0 +1,14 @@
1
+ import type React from 'react';
2
+ declare type TextEditorFeatureToggle = {
3
+ stickyToolbar?: boolean;
4
+ tabAsNavigation?: boolean;
5
+ };
6
+ export interface TextEditorProviderProps {
7
+ children: React.ReactNode;
8
+ /**
9
+ * - `stickyToolbar` - Have the editor toolbar stick to the top when content is longer than the page length.
10
+ * - `tabAsNavigation` - Have `Tab` key exit the editor. Support `Alt`/`Opt` + `Tab` as triple space indent.
11
+ */
12
+ features?: TextEditorFeatureToggle;
13
+ }
14
+ export {};