@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
@@ -2,15 +2,35 @@
2
2
  "TextEditorProps": {
3
3
  "name": "TextEditorProps",
4
4
  "properties": [
5
+ {
6
+ "name": "aria-description",
7
+ "required": false,
8
+ "type": "<span class=\"tsd-signature-type\">string</span>",
9
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
10
+ "description": "Accessible description for the editor's editable area.\nThis text provides additional context to screen reader users. It will be\nannounced after the label when the user focuses the editor.",
11
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Accessible description for the editor&#39;s editable area.\nThis text provides additional context to screen reader users. It will be\nannounced after the label when the user focuses the editor.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>0.1.0</p>\n</dd></dl></div>",
12
+ "sourceFile": "TextEditor/TextEditor.types.ts",
13
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L68"
14
+ },
15
+ {
16
+ "name": "aria-label",
17
+ "required": false,
18
+ "type": "<span class=\"tsd-signature-type\">string</span>",
19
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
20
+ "description": "Accessible label for the editor's editable area. This text will be\nannounced by screen readers when the user focuses the editor. It should\nmatch or include the visible label associated with this editor field.\nIf not provided, screen readers will announce a generic \"Rich Text Editor\" message.",
21
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Accessible label for the editor&#39;s editable area. This text will be\nannounced by screen readers when the user focuses the editor. It should\nmatch or include the visible label associated with this editor field.\nIf not provided, screen readers will announce a generic &quot;Rich Text Editor&quot; message.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>0.1.0</p>\n</dd></dl></div>",
22
+ "sourceFile": "TextEditor/TextEditor.types.ts",
23
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L59"
24
+ },
5
25
  {
6
26
  "name": "disabled",
7
27
  "required": false,
8
28
  "type": "<span class=\"tsd-signature-type\">boolean</span>",
9
29
  "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
10
30
  "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>",
31
+ "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>0.0.1</p>\n</dd></dl></div>",
12
32
  "sourceFile": "TextEditor/TextEditor.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L34"
33
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L34"
14
34
  },
15
35
  {
16
36
  "name": "error",
@@ -18,9 +38,9 @@
18
38
  "type": "<span class=\"tsd-signature-type\">boolean</span>",
19
39
  "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
20
40
  "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>",
41
+ "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>0.0.1</p>\n</dd></dl></div>",
22
42
  "sourceFile": "TextEditor/TextEditor.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L41"
43
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L41"
24
44
  },
25
45
  {
26
46
  "name": "id",
@@ -28,9 +48,9 @@
28
48
  "type": "<span class=\"tsd-signature-type\">string</span>",
29
49
  "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
30
50
  "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>",
51
+ "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>0.0.1</p>\n</dd></dl></div>",
32
52
  "sourceFile": "TextEditor/TextEditor.types.ts",
33
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L10"
53
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L10"
34
54
  },
35
55
  {
36
56
  "name": "initialValue",
@@ -38,31 +58,31 @@
38
58
  "type": "<span class=\"tsd-signature-type\">string</span>",
39
59
  "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
40
60
  "description": "Initial value of the editor",
41
- "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>",
61
+ "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>0.0.1</p>\n</dd><dt>since</dt><dd><p>0.0.1</p>\n</dd></dl></div>",
42
62
  "deprecated": "`initialValue` has been deprecated and will be removed in a future version.\nPlease use the `value` prop instead",
43
- "deprecatedSince": "10.20.0",
63
+ "deprecatedSince": "0.0.1",
44
64
  "sourceFile": "TextEditor/TextEditor.types.ts",
45
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L20"
65
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L20"
46
66
  },
47
67
  {
48
68
  "name": "locale",
49
69
  "required": false,
50
- "type": "<span class=\"tsd-signature-type\">Locale</span>",
51
- "typeDetail": "<span class=\"tsd-signature-type\">Locale</span>",
70
+ "type": "<span class=\"tsd-signature-type\">string</span>",
71
+ "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
52
72
  "description": "Locale which will be used for localization. Can be passed directly or\nset by wrapping components in I18n provider.",
53
- "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>",
73
+ "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>0.0.1</p>\n</dd></dl></div>",
54
74
  "sourceFile": "TextEditor/TextEditor.types.ts",
55
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L48"
75
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L75"
56
76
  },
57
77
  {
58
- "name": "plugins",
78
+ "name": "readonly",
59
79
  "required": false,
60
- "type": "<span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">[]</span>",
61
- "typeDetail": "<span class=\"tsd-signature-type\">string</span><span class=\"tsd-signature-symbol\">[]</span>",
62
- "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.",
63
- "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>",
80
+ "type": "<span class=\"tsd-signature-type\">boolean</span>",
81
+ "typeDetail": "<span class=\"tsd-signature-type\">boolean</span>",
82
+ "description": "Indicates if the editor is in readonly mode.\nWhen true, renders the content using TextEditorOutput instead of the editable editor.",
83
+ "descriptionHtml": "<div class=\"tsd-comment tsd-typography\"><div class=\"lead\">\n<p>Indicates if the editor is in readonly mode.\nWhen true, renders the content using TextEditorOutput instead of the editable editor.</p>\n</div><dl class=\"tsd-comment-tags\"><dt>since</dt><dd><p>0.2.0</p>\n</dd></dl></div>",
64
84
  "sourceFile": "TextEditor/TextEditor.types.ts",
65
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L57"
85
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L49"
66
86
  },
67
87
  {
68
88
  "name": "value",
@@ -70,19 +90,9 @@
70
90
  "type": "<span class=\"tsd-signature-type\">string</span>",
71
91
  "typeDetail": "<span class=\"tsd-signature-type\">string</span>",
72
92
  "description": "The current value of the editor",
73
- "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>",
74
- "sourceFile": "TextEditor/TextEditor.types.ts",
75
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L27"
76
- },
77
- {
78
- "name": "config",
79
- "required": false,
80
- "type": "Function",
81
- "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>",
82
- "description": "Configuration function for customizing the editor",
83
- "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>",
93
+ "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>0.0.1</p>\n</dd></dl></div>",
84
94
  "sourceFile": "TextEditor/TextEditor.types.ts",
85
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L66"
95
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L27"
86
96
  },
87
97
  {
88
98
  "name": "onAfterDestroy",
@@ -90,9 +100,9 @@
90
100
  "type": "Function",
91
101
  "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>",
92
102
  "description": "Callback fired after the editor instance is destroyed",
93
- "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>",
103
+ "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>0.0.1</p>\n</dd></dl></div>",
94
104
  "sourceFile": "TextEditor/TextEditor.types.ts",
95
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L116"
105
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L125"
96
106
  },
97
107
  {
98
108
  "name": "onBlur",
@@ -100,9 +110,9 @@
100
110
  "type": "Function",
101
111
  "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>",
102
112
  "description": "Callback fired when the editor loses focus",
103
- "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>",
113
+ "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>0.0.1</p>\n</dd></dl></div>",
104
114
  "sourceFile": "TextEditor/TextEditor.types.ts",
105
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L89"
115
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L98"
106
116
  },
107
117
  {
108
118
  "name": "onChange",
@@ -110,9 +120,9 @@
110
120
  "type": "Function",
111
121
  "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>",
112
122
  "description": "Callback fired when the editor content changes",
113
- "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>",
123
+ "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>0.0.1</p>\n</dd></dl></div>",
114
124
  "sourceFile": "TextEditor/TextEditor.types.ts",
115
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L75"
125
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L84"
116
126
  },
117
127
  {
118
128
  "name": "onDirty",
@@ -120,9 +130,9 @@
120
130
  "type": "Function",
121
131
  "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>",
122
132
  "description": "Callback fired when the editor becomes dirty (content differs from initial value)",
123
- "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>",
133
+ "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>0.0.1</p>\n</dd></dl></div>",
124
134
  "sourceFile": "TextEditor/TextEditor.types.ts",
125
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L123"
135
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L132"
126
136
  },
127
137
  {
128
138
  "name": "onError",
@@ -130,9 +140,9 @@
130
140
  "type": "Function",
131
141
  "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>",
132
142
  "description": "Callback fired when an error occurs in the editor",
133
- "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>",
143
+ "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>0.0.1</p>\n</dd></dl></div>",
134
144
  "sourceFile": "TextEditor/TextEditor.types.ts",
135
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L96"
145
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L105"
136
146
  },
137
147
  {
138
148
  "name": "onFocus",
@@ -140,9 +150,9 @@
140
150
  "type": "Function",
141
151
  "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>",
142
152
  "description": "Callback fired when the editor gains focus",
143
- "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>",
153
+ "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>0.0.1</p>\n</dd></dl></div>",
144
154
  "sourceFile": "TextEditor/TextEditor.types.ts",
145
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L82"
155
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L91"
146
156
  },
147
157
  {
148
158
  "name": "onInit",
@@ -150,9 +160,9 @@
150
160
  "type": "Function",
151
161
  "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>",
152
162
  "description": "Callback fired when the editor is ready",
153
- "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>",
163
+ "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>0.0.1</p>\n</dd></dl></div>",
154
164
  "sourceFile": "TextEditor/TextEditor.types.ts",
155
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L109"
165
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L118"
156
166
  },
157
167
  {
158
168
  "name": "onKeyDown",
@@ -160,9 +170,9 @@
160
170
  "type": "Function",
161
171
  "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>",
162
172
  "description": "Callback fired when a key is pressed in the editor",
163
- "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>",
173
+ "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>0.0.1</p>\n</dd></dl></div>",
164
174
  "sourceFile": "TextEditor/TextEditor.types.ts",
165
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditor.types.ts#L132"
175
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditor.types.ts#L141"
166
176
  }
167
177
  ],
168
178
  "description": ""
@@ -10,7 +10,7 @@
10
10
  "description": "",
11
11
  "descriptionHtml": "",
12
12
  "sourceFile": "TextEditor/TextEditorProvider.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L9"
13
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L9"
14
14
  },
15
15
  {
16
16
  "name": "features",
@@ -20,7 +20,7 @@
20
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
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
22
  "sourceFile": "TextEditor/TextEditorProvider.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L14"
23
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditor/TextEditorProvider.types.ts#L14"
24
24
  }
25
25
  ],
26
26
  "description": ""
@@ -10,7 +10,7 @@
10
10
  "description": "Additional classNames",
11
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
12
  "sourceFile": "TextEditorOutput/TextEditorOutput.types.ts",
13
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L14"
13
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L14"
14
14
  },
15
15
  {
16
16
  "name": "style",
@@ -20,7 +20,7 @@
20
20
  "description": "Additional CSS styles",
21
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
22
  "sourceFile": "TextEditorOutput/TextEditorOutput.types.ts",
23
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L21"
23
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L21"
24
24
  },
25
25
  {
26
26
  "name": "value",
@@ -30,7 +30,7 @@
30
30
  "description": "Formatted text from `TextEditor`",
31
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
32
  "sourceFile": "TextEditorOutput/TextEditorOutput.types.ts",
33
- "sourceUrl": "https://github.com/procore/core/blob/672f459/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L7"
33
+ "sourceUrl": "https://github.com/procore/core/blob/5a7d81e/packages/text-editor/src/TextEditorOutput/TextEditorOutput.types.ts#L7"
34
34
  }
35
35
  ],
36
36
  "description": ""
@@ -1 +1 @@
1
- [{"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"}]
1
+ [{"interface":"TextEditorProps","property":"initialValue","deprecatedSince":"0.0.1","message":"`initialValue` has been deprecated and will be removed in a future version.\nPlease use the `value` prop instead","deprecationKind":"prop"}]
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
+ export * from './DebouncedTextEditor';
1
2
  export * from './TextEditor';
2
3
  export * from './TextEditorOutput';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export * from './DebouncedTextEditor';
1
2
  export * from './TextEditor';
2
3
  export * from './TextEditorOutput';
3
4
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +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"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["export * from './DebouncedTextEditor'\nexport * from './TextEditor'\nexport * from './TextEditorOutput'\n"],"mappings":"AAAA,cAAc,uBAAuB;AACrC,cAAc,cAAc;AAC5B,cAAc,oBAAoB"}
@@ -0,0 +1 @@
1
+ export declare function debounce<T extends (...args: any[]) => void>(func: T, wait: number, immediate?: boolean): (this: ThisParameterType<T>, ...args: Parameters<T>) => void;
@@ -0,0 +1,24 @@
1
+ export function debounce(func, wait) {
2
+ var immediate = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
3
+ var timeout = null;
4
+ return function () {
5
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6
+ args[_key] = arguments[_key];
7
+ }
8
+ var context = this;
9
+ var callNow = immediate && timeout === null;
10
+ if (timeout !== null) {
11
+ clearTimeout(timeout);
12
+ }
13
+ timeout = setTimeout(function () {
14
+ timeout = null;
15
+ if (!immediate) {
16
+ func.apply(context, args);
17
+ }
18
+ }, wait);
19
+ if (callNow) {
20
+ func.apply(context, args);
21
+ }
22
+ };
23
+ }
24
+ //# sourceMappingURL=debounce.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debounce.js","names":["debounce","func","wait","immediate","arguments","length","undefined","timeout","_len","args","Array","_key","context","callNow","clearTimeout","setTimeout","apply"],"sources":["../../src/utils/debounce.ts"],"sourcesContent":["export function debounce<T extends (...args: any[]) => void>(\n func: T,\n wait: number,\n immediate: boolean = false\n) {\n let timeout: ReturnType<typeof setTimeout> | null = null\n\n return function (this: ThisParameterType<T>, ...args: Parameters<T>): void {\n const context = this\n\n const callNow = immediate && timeout === null\n\n if (timeout !== null) {\n clearTimeout(timeout)\n }\n\n timeout = setTimeout(() => {\n timeout = null\n if (!immediate) {\n func.apply(context, args)\n }\n }, wait)\n\n if (callNow) {\n func.apply(context, args)\n }\n }\n}\n"],"mappings":"AAAA,OAAO,SAASA,QAAQA,CACtBC,IAAO,EACPC,IAAY,EAEZ;EAAA,IADAC,SAAkB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAE1B,IAAIG,OAA6C,GAAG,IAAI;EAExD,OAAO,YAAoE;IAAA,SAAAC,IAAA,GAAAJ,SAAA,CAAAC,MAAA,EAA3BI,IAAI,OAAAC,KAAA,CAAAF,IAAA,GAAAG,IAAA,MAAAA,IAAA,GAAAH,IAAA,EAAAG,IAAA;MAAJF,IAAI,CAAAE,IAAA,IAAAP,SAAA,CAAAO,IAAA;IAAA;IAClD,IAAMC,OAAO,GAAG,IAAI;IAEpB,IAAMC,OAAO,GAAGV,SAAS,IAAII,OAAO,KAAK,IAAI;IAE7C,IAAIA,OAAO,KAAK,IAAI,EAAE;MACpBO,YAAY,CAACP,OAAO,CAAC;IACvB;IAEAA,OAAO,GAAGQ,UAAU,CAAC,YAAM;MACzBR,OAAO,GAAG,IAAI;MACd,IAAI,CAACJ,SAAS,EAAE;QACdF,IAAI,CAACe,KAAK,CAACJ,OAAO,EAAEH,IAAI,CAAC;MAC3B;IACF,CAAC,EAAEP,IAAI,CAAC;IAER,IAAIW,OAAO,EAAE;MACXZ,IAAI,CAACe,KAAK,CAACJ,OAAO,EAAEH,IAAI,CAAC;IAC3B;EACF,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@procore/text-editor",
3
- "version": "0.0.3",
3
+ "version": "0.2.0",
4
4
  "description": "Rich text editor component based on CKEditor 5",
5
5
  "author": "Procore Technologies",
6
6
  "homepage": "https://github.com/procore/core/tree/main/packages/text-editor",
@@ -12,16 +12,16 @@
12
12
  "bugs": "https://github.com/procore/core/issues",
13
13
  "license": "SEE LICENSE IN LICENSE",
14
14
  "keywords": [
15
- "javascript",
15
+ "ckeditor",
16
16
  "components",
17
- "react",
17
+ "javascript",
18
18
  "js",
19
19
  "jsx",
20
20
  "library",
21
21
  "procore",
22
- "text-editor",
22
+ "react",
23
23
  "rich-text",
24
- "ckeditor"
24
+ "text-editor"
25
25
  ],
26
26
  "publishConfig": {
27
27
  "access": "public"
@@ -30,8 +30,8 @@
30
30
  ".": "./dist/index.js",
31
31
  "./jestConfig": {
32
32
  "types": "./jestConfig.d.ts",
33
- "require": "./jestConfig.js",
34
- "import": "./jestConfig.js"
33
+ "import": "./jestConfig.js",
34
+ "require": "./jestConfig.js"
35
35
  },
36
36
  "./dist/_typedoc/*.json": "./dist/_typedoc/*.json",
37
37
  "./dist/_typedoc/**/*.json": "./dist/_typedoc/**/*.json"
@@ -55,6 +55,8 @@
55
55
  "build:esm": "BUNDLING=true babel src --out-dir dist --extensions '.ts,.tsx,.js,.snap' -s --copy-files --no-copy-ignored",
56
56
  "build:typedoc": "ts-node typedoc.ts",
57
57
  "build:types": "tsc --declaration --emitDeclarationOnly -p tsconfig.prod.json",
58
+ "chromatic": "dotenvx run -- chromatic",
59
+ "chromatic:ci": "chromatic --ci --storybook-build-dir ./storybook-static --project-token=${CHROMATIC_TEXT_EDITOR_TOKEN} --exit-once-uploaded --only-changed --skip=\"dependabot*\"",
58
60
  "clean": "rimraf dist",
59
61
  "dev": "NODE_ENV=development yarn run dev:ts",
60
62
  "dev:ts": "tsc -p tsconfig.prod.json --watch",
@@ -67,7 +69,7 @@
67
69
  "test:watch": "yarn run test --watch"
68
70
  },
69
71
  "peerDependencies": {
70
- "@procore/core-react": "^12.33.0",
72
+ "@procore/core-react": "^12.40.0",
71
73
  "@procore/globalization-toolkit": ">= 3 < 4",
72
74
  "ckeditor5": "^46.0.1",
73
75
  "react": ">=16.8.0 < 19",
@@ -77,7 +79,7 @@
77
79
  "dependencies": {
78
80
  "@ckeditor/ckeditor5-react": "^11.0.0",
79
81
  "@procore/core-i18n-js": "^10.30.0",
80
- "@procore/core-icons": "^12.11.0",
82
+ "@procore/core-icons": "^12.13.0",
81
83
  "@react-aria/focus": "3.16.2",
82
84
  "@react-aria/utils": "3.23.2",
83
85
  "sanitize-html": "^2.17.0"
@@ -91,8 +93,7 @@
91
93
  "@babel/preset-react": "7.18.6",
92
94
  "@babel/preset-typescript": "7.18.6",
93
95
  "@babel/register": "7.18.9",
94
- "@ckeditor/ckeditor5-dev-webpack-plugin": "^31.1.13",
95
- "@procore/core-react": "^12.33.0",
96
+ "@procore/core-react": "^12.40.0",
96
97
  "@procore/globalization-toolkit": "3.0.0",
97
98
  "@storybook/addon-webpack5-compiler-swc": "^4.0.2",
98
99
  "@storybook/jest": "^0.2.3",
@@ -130,7 +131,7 @@
130
131
  "react": "18.3.1",
131
132
  "react-dom": "18.3.1",
132
133
  "rimraf": "^6.0.1",
133
- "storybook": "^9.1.16",
134
+ "storybook": "^9.1.17",
134
135
  "style-loader": "^4.0.0",
135
136
  "styled-components": "6.1.18",
136
137
  "ts-jest": "^29.0.5",
@@ -1,7 +0,0 @@
1
- import type { EditorConfig, Plugin } from 'ckeditor5';
2
- /** Gets CKEditor plugin objects from TinyMCE string plugin names */
3
- export declare const getPluginsFromStringArray: (pluginNames?: string[]) => (typeof Plugin)[];
4
- /** Gets toolbar items that should be added for the given string plugin names. */
5
- export declare const getToolbarItemsFromStringArray: (pluginNames?: string[]) => string[];
6
- /** Enhances an editor config by adding plugins and toolbar items from TinyMCE string array */
7
- export declare const addPluginsFromStringArray: (config: EditorConfig, pluginNames?: string[]) => EditorConfig;