planet-editor 0.1.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 (147) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +129 -0
  3. package/THIRD-PARTY-LICENSES.md +76 -0
  4. package/dist/lib/components/planet-extension/node-background-extension.d.ts +23 -0
  5. package/dist/lib/components/planet-extension/search-extension.d.ts +39 -0
  6. package/dist/lib/components/planet-icons/align-center-icon.d.ts +3 -0
  7. package/dist/lib/components/planet-icons/align-justify-icon.d.ts +3 -0
  8. package/dist/lib/components/planet-icons/align-left-icon.d.ts +3 -0
  9. package/dist/lib/components/planet-icons/align-right-icon.d.ts +3 -0
  10. package/dist/lib/components/planet-icons/arrow-left-icon.d.ts +3 -0
  11. package/dist/lib/components/planet-icons/ban-icon.d.ts +3 -0
  12. package/dist/lib/components/planet-icons/blockquote-icon.d.ts +3 -0
  13. package/dist/lib/components/planet-icons/bold-icon.d.ts +3 -0
  14. package/dist/lib/components/planet-icons/check-icon.d.ts +3 -0
  15. package/dist/lib/components/planet-icons/chevron-down-icon.d.ts +3 -0
  16. package/dist/lib/components/planet-icons/close-icon.d.ts +3 -0
  17. package/dist/lib/components/planet-icons/code-block-icon.d.ts +3 -0
  18. package/dist/lib/components/planet-icons/code2-icon.d.ts +3 -0
  19. package/dist/lib/components/planet-icons/corner-down-left-icon.d.ts +3 -0
  20. package/dist/lib/components/planet-icons/external-link-icon.d.ts +3 -0
  21. package/dist/lib/components/planet-icons/heading-five-icon.d.ts +3 -0
  22. package/dist/lib/components/planet-icons/heading-four-icon.d.ts +3 -0
  23. package/dist/lib/components/planet-icons/heading-icon.d.ts +3 -0
  24. package/dist/lib/components/planet-icons/heading-one-icon.d.ts +3 -0
  25. package/dist/lib/components/planet-icons/heading-six-icon.d.ts +3 -0
  26. package/dist/lib/components/planet-icons/heading-three-icon.d.ts +3 -0
  27. package/dist/lib/components/planet-icons/heading-two-icon.d.ts +3 -0
  28. package/dist/lib/components/planet-icons/highlighter-icon.d.ts +3 -0
  29. package/dist/lib/components/planet-icons/image-plus-icon.d.ts +3 -0
  30. package/dist/lib/components/planet-icons/italic-icon.d.ts +3 -0
  31. package/dist/lib/components/planet-icons/line-numbers-icon.d.ts +3 -0
  32. package/dist/lib/components/planet-icons/link-icon.d.ts +3 -0
  33. package/dist/lib/components/planet-icons/list-icon.d.ts +3 -0
  34. package/dist/lib/components/planet-icons/list-ordered-icon.d.ts +3 -0
  35. package/dist/lib/components/planet-icons/list-todo-icon.d.ts +3 -0
  36. package/dist/lib/components/planet-icons/moon-star-icon.d.ts +3 -0
  37. package/dist/lib/components/planet-icons/redo2-icon.d.ts +3 -0
  38. package/dist/lib/components/planet-icons/search-icon.d.ts +3 -0
  39. package/dist/lib/components/planet-icons/strike-icon.d.ts +3 -0
  40. package/dist/lib/components/planet-icons/subscript-icon.d.ts +3 -0
  41. package/dist/lib/components/planet-icons/sun-icon.d.ts +3 -0
  42. package/dist/lib/components/planet-icons/superscript-icon.d.ts +3 -0
  43. package/dist/lib/components/planet-icons/table-icon.d.ts +3 -0
  44. package/dist/lib/components/planet-icons/trash-icon.d.ts +3 -0
  45. package/dist/lib/components/planet-icons/underline-icon.d.ts +3 -0
  46. package/dist/lib/components/planet-icons/undo2-icon.d.ts +3 -0
  47. package/dist/lib/components/planet-node/horizontal-rule-node/horizontal-rule-node-extension.d.ts +2 -0
  48. package/dist/lib/components/planet-node/image-node/resizable-image-extension.d.ts +10 -0
  49. package/dist/lib/components/planet-node/image-node/resizable-image-node-view.d.ts +7 -0
  50. package/dist/lib/components/planet-node/image-upload-node/image-upload-node-extension.d.ts +58 -0
  51. package/dist/lib/components/planet-node/image-upload-node/image-upload-node.d.ts +68 -0
  52. package/dist/lib/components/planet-node/image-upload-node/index.d.ts +1 -0
  53. package/dist/lib/components/planet-templates/simple/data/content.json.d.ts +479 -0
  54. package/dist/lib/components/planet-templates/simple/simple-editor.d.ts +31 -0
  55. package/dist/lib/components/planet-templates/simple/theme-toggle.d.ts +1 -0
  56. package/dist/lib/components/planet-ui/blockquote-button/blockquote-button.d.ts +22 -0
  57. package/dist/lib/components/planet-ui/blockquote-button/index.d.ts +2 -0
  58. package/dist/lib/components/planet-ui/blockquote-button/use-blockquote.d.ts +80 -0
  59. package/dist/lib/components/planet-ui/code-block-button/code-block-button.d.ts +22 -0
  60. package/dist/lib/components/planet-ui/code-block-button/index.d.ts +2 -0
  61. package/dist/lib/components/planet-ui/code-block-button/use-code-block.d.ts +87 -0
  62. package/dist/lib/components/planet-ui/color-highlight-button/color-highlight-button.d.ts +45 -0
  63. package/dist/lib/components/planet-ui/color-highlight-button/index.d.ts +2 -0
  64. package/dist/lib/components/planet-ui/color-highlight-button/use-color-highlight.d.ts +93 -0
  65. package/dist/lib/components/planet-ui/color-highlight-popover/color-highlight-popover.d.ts +35 -0
  66. package/dist/lib/components/planet-ui/color-highlight-popover/index.d.ts +1 -0
  67. package/dist/lib/components/planet-ui/font-size-dropdown-menu/font-size-dropdown-menu.d.ts +10 -0
  68. package/dist/lib/components/planet-ui/font-size-dropdown-menu/index.d.ts +1 -0
  69. package/dist/lib/components/planet-ui/heading-button/heading-button.d.ts +23 -0
  70. package/dist/lib/components/planet-ui/heading-button/index.d.ts +2 -0
  71. package/dist/lib/components/planet-ui/heading-button/use-heading.d.ts +108 -0
  72. package/dist/lib/components/planet-ui/heading-dropdown-menu/heading-dropdown-menu.d.ts +19 -0
  73. package/dist/lib/components/planet-ui/heading-dropdown-menu/index.d.ts +2 -0
  74. package/dist/lib/components/planet-ui/heading-dropdown-menu/use-heading-dropdown-menu.d.ts +73 -0
  75. package/dist/lib/components/planet-ui/image-upload-button/image-upload-button.d.ts +29 -0
  76. package/dist/lib/components/planet-ui/image-upload-button/index.d.ts +2 -0
  77. package/dist/lib/components/planet-ui/image-upload-button/use-image-upload.d.ts +84 -0
  78. package/dist/lib/components/planet-ui/link-popover/index.d.ts +2 -0
  79. package/dist/lib/components/planet-ui/link-popover/link-popover.d.ts +57 -0
  80. package/dist/lib/components/planet-ui/link-popover/use-link-popover.d.ts +117 -0
  81. package/dist/lib/components/planet-ui/list-button/index.d.ts +2 -0
  82. package/dist/lib/components/planet-ui/list-button/list-button.d.ts +23 -0
  83. package/dist/lib/components/planet-ui/list-button/use-list.d.ts +97 -0
  84. package/dist/lib/components/planet-ui/list-dropdown-menu/index.d.ts +1 -0
  85. package/dist/lib/components/planet-ui/list-dropdown-menu/list-dropdown-menu.d.ts +28 -0
  86. package/dist/lib/components/planet-ui/list-dropdown-menu/use-list-dropdown-menu.d.ts +90 -0
  87. package/dist/lib/components/planet-ui/mark-button/index.d.ts +2 -0
  88. package/dist/lib/components/planet-ui/mark-button/mark-button.d.ts +23 -0
  89. package/dist/lib/components/planet-ui/mark-button/use-mark.d.ts +104 -0
  90. package/dist/lib/components/planet-ui/search-bar/index.d.ts +1 -0
  91. package/dist/lib/components/planet-ui/search-bar/search-bar.d.ts +11 -0
  92. package/dist/lib/components/planet-ui/table-dropdown-menu/index.d.ts +1 -0
  93. package/dist/lib/components/planet-ui/table-dropdown-menu/table-dropdown-menu.d.ts +11 -0
  94. package/dist/lib/components/planet-ui/text-align-button/index.d.ts +2 -0
  95. package/dist/lib/components/planet-ui/text-align-button/text-align-button.d.ts +30 -0
  96. package/dist/lib/components/planet-ui/text-align-button/use-text-align.d.ts +101 -0
  97. package/dist/lib/components/planet-ui/undo-redo-button/index.d.ts +2 -0
  98. package/dist/lib/components/planet-ui/undo-redo-button/undo-redo-button.d.ts +23 -0
  99. package/dist/lib/components/planet-ui/undo-redo-button/use-undo-redo.d.ts +90 -0
  100. package/dist/lib/components/planet-ui-primitive/badge/badge.d.ts +8 -0
  101. package/dist/lib/components/planet-ui-primitive/badge/index.d.ts +1 -0
  102. package/dist/lib/components/planet-ui-primitive/button/button.d.ts +14 -0
  103. package/dist/lib/components/planet-ui-primitive/button/index.d.ts +1 -0
  104. package/dist/lib/components/planet-ui-primitive/button-group/button-group.d.ts +10 -0
  105. package/dist/lib/components/planet-ui-primitive/button-group/index.d.ts +1 -0
  106. package/dist/lib/components/planet-ui-primitive/card/card.d.ts +9 -0
  107. package/dist/lib/components/planet-ui-primitive/card/index.d.ts +1 -0
  108. package/dist/lib/components/planet-ui-primitive/dropdown-menu/dropdown-menu.d.ts +28 -0
  109. package/dist/lib/components/planet-ui-primitive/dropdown-menu/index.d.ts +1 -0
  110. package/dist/lib/components/planet-ui-primitive/input/index.d.ts +1 -0
  111. package/dist/lib/components/planet-ui-primitive/input/input.d.ts +2 -0
  112. package/dist/lib/components/planet-ui-primitive/popover/index.d.ts +1 -0
  113. package/dist/lib/components/planet-ui-primitive/popover/popover.d.ts +5 -0
  114. package/dist/lib/components/planet-ui-primitive/separator/index.d.ts +1 -0
  115. package/dist/lib/components/planet-ui-primitive/separator/separator.d.ts +5 -0
  116. package/dist/lib/components/planet-ui-primitive/spacer/index.d.ts +1 -0
  117. package/dist/lib/components/planet-ui-primitive/spacer/spacer.d.ts +5 -0
  118. package/dist/lib/components/planet-ui-primitive/toolbar/index.d.ts +1 -0
  119. package/dist/lib/components/planet-ui-primitive/toolbar/toolbar.d.ts +8 -0
  120. package/dist/lib/components/planet-ui-primitive/tooltip/index.d.ts +1 -0
  121. package/dist/lib/components/planet-ui-primitive/tooltip/tooltip.d.ts +28 -0
  122. package/dist/lib/favicon.svg +1 -0
  123. package/dist/lib/hooks/use-composed-ref.d.ts +3 -0
  124. package/dist/lib/hooks/use-cursor-visibility.d.ts +20 -0
  125. package/dist/lib/hooks/use-element-rect.d.ts +35 -0
  126. package/dist/lib/hooks/use-is-breakpoint.d.ts +9 -0
  127. package/dist/lib/hooks/use-line-numbers.d.ts +15 -0
  128. package/dist/lib/hooks/use-menu-navigation.d.ts +52 -0
  129. package/dist/lib/hooks/use-planet-editor.d.ts +6 -0
  130. package/dist/lib/hooks/use-scrolling.d.ts +8 -0
  131. package/dist/lib/hooks/use-throttled-callback.d.ts +18 -0
  132. package/dist/lib/hooks/use-unmount.d.ts +7 -0
  133. package/dist/lib/hooks/use-window-size.d.ts +35 -0
  134. package/dist/lib/icons.svg +24 -0
  135. package/dist/lib/images/planet-ui-placeholder-image.svg +10 -0
  136. package/dist/lib/index.js +5102 -0
  137. package/dist/lib/lib/index.d.ts +2 -0
  138. package/dist/lib/lib/planet-utils.d.ts +173 -0
  139. package/dist/lib/lib/upload.d.ts +10 -0
  140. package/dist/lib/styles.css +2 -0
  141. package/dist/web-component/favicon.svg +1 -0
  142. package/dist/web-component/icons.svg +24 -0
  143. package/dist/web-component/images/planet-ui-placeholder-image.svg +10 -0
  144. package/dist/web-component/planet-editor.css +2 -0
  145. package/dist/web-component/planet-editor.html +224 -0
  146. package/dist/web-component/planet-editor.js +203 -0
  147. package/package.json +101 -0
@@ -0,0 +1,68 @@
1
+ import { NodeViewProps } from '../../../planet-core/react';
2
+ export interface FileItem {
3
+ /**
4
+ * Unique identifier for the file item
5
+ */
6
+ id: string;
7
+ /**
8
+ * The actual File object being uploaded
9
+ */
10
+ file: File;
11
+ /**
12
+ * Current upload progress as a percentage (0-100)
13
+ */
14
+ progress: number;
15
+ /**
16
+ * Current status of the file upload process
17
+ * @default "uploading"
18
+ */
19
+ status: "uploading" | "success" | "error";
20
+ /**
21
+ * URL to the uploaded file, available after successful upload
22
+ * @optional
23
+ */
24
+ url?: string;
25
+ /**
26
+ * Controller that can be used to abort the upload process
27
+ * @optional
28
+ */
29
+ abortController?: AbortController;
30
+ }
31
+ export interface UploadOptions {
32
+ /**
33
+ * Maximum allowed file size in bytes
34
+ */
35
+ maxSize: number;
36
+ /**
37
+ * Maximum number of files that can be uploaded
38
+ */
39
+ limit: number;
40
+ /**
41
+ * String specifying acceptable file types (MIME types or extensions)
42
+ * @example ".jpg,.png,image/jpeg" or "image/*"
43
+ */
44
+ accept: string;
45
+ /**
46
+ * Function that handles the actual file upload process
47
+ * @param {File} file - The file to be uploaded
48
+ * @param {Function} onProgress - Callback function to report upload progress
49
+ * @param {AbortSignal} signal - Signal that can be used to abort the upload
50
+ * @returns {Promise<string>} Promise resolving to the URL of the uploaded file
51
+ */
52
+ upload: (file: File, onProgress: (event: {
53
+ progress: number;
54
+ }) => void, signal: AbortSignal) => Promise<string>;
55
+ /**
56
+ * Callback triggered when a file is uploaded successfully
57
+ * @param {string} url - URL of the successfully uploaded file
58
+ * @optional
59
+ */
60
+ onSuccess?: (url: string) => void;
61
+ /**
62
+ * Callback triggered when an error occurs during upload
63
+ * @param {Error} error - The error that occurred
64
+ * @optional
65
+ */
66
+ onError?: (error: Error) => void;
67
+ }
68
+ export declare const ImageUploadNode: React.FC<NodeViewProps>;
@@ -0,0 +1 @@
1
+ export * from './image-upload-node-extension';
@@ -0,0 +1,479 @@
1
+ declare const _default: {
2
+ "type": "doc",
3
+ "content": [
4
+ {
5
+ "type": "heading",
6
+ "attrs": {
7
+ "textAlign": null,
8
+ "level": 1
9
+ },
10
+ "content": [
11
+ {
12
+ "type": "text",
13
+ "text": "Getting started"
14
+ }
15
+ ]
16
+ },
17
+ {
18
+ "type": "paragraph",
19
+ "attrs": {
20
+ "textAlign": null
21
+ },
22
+ "content": [
23
+ {
24
+ "type": "text",
25
+ "text": "Welcome to the "
26
+ },
27
+ {
28
+ "type": "text",
29
+ "marks": [
30
+ {
31
+ "type": "italic"
32
+ },
33
+ {
34
+ "type": "highlight",
35
+ "attrs": {
36
+ "color": "var(--tt-color-highlight-yellow)"
37
+ }
38
+ }
39
+ ],
40
+ "text": "Simple Editor"
41
+ },
42
+ {
43
+ "type": "text",
44
+ "text": " template! This template integrates "
45
+ },
46
+ {
47
+ "type": "text",
48
+ "marks": [
49
+ {
50
+ "type": "bold"
51
+ }
52
+ ],
53
+ "text": "open source"
54
+ },
55
+ {
56
+ "type": "text",
57
+ "text": " UI components and Planet extensions licensed under "
58
+ },
59
+ {
60
+ "type": "text",
61
+ "marks": [
62
+ {
63
+ "type": "bold"
64
+ }
65
+ ],
66
+ "text": "MIT"
67
+ },
68
+ {
69
+ "type": "text",
70
+ "text": "."
71
+ }
72
+ ]
73
+ },
74
+ {
75
+ "type": "paragraph",
76
+ "attrs": {
77
+ "textAlign": null
78
+ },
79
+ "content": [
80
+ {
81
+ "type": "text",
82
+ "text": "Integrate it by following the "
83
+ },
84
+ {
85
+ "type": "text",
86
+ "marks": [
87
+ {
88
+ "type": "link",
89
+ "attrs": {
90
+ "href": "https://planet.dev/docs/ui-components/templates/simple-editor",
91
+ "target": "_blank",
92
+ "rel": "noopener noreferrer nofollow",
93
+ "class": null
94
+ }
95
+ }
96
+ ],
97
+ "text": "Planet UI Components docs"
98
+ },
99
+ {
100
+ "type": "text",
101
+ "text": " or using our CLI tool."
102
+ }
103
+ ]
104
+ },
105
+ {
106
+ "type": "codeBlock",
107
+ "attrs": {
108
+ "language": null
109
+ },
110
+ "content": [
111
+ {
112
+ "type": "text",
113
+ "text": "npm install planet-editor"
114
+ }
115
+ ]
116
+ },
117
+ {
118
+ "type": "heading",
119
+ "attrs": {
120
+ "textAlign": null,
121
+ "level": 2
122
+ },
123
+ "content": [
124
+ {
125
+ "type": "text",
126
+ "text": "Features"
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "type": "blockquote",
132
+ "content": [
133
+ {
134
+ "type": "paragraph",
135
+ "attrs": {
136
+ "textAlign": null
137
+ },
138
+ "content": [
139
+ {
140
+ "type": "text",
141
+ "marks": [
142
+ {
143
+ "type": "italic"
144
+ }
145
+ ],
146
+ "text": "A fully responsive rich text editor with built-in support for common formatting and layout tools. Type markdown "
147
+ },
148
+ {
149
+ "type": "text",
150
+ "marks": [
151
+ {
152
+ "type": "code"
153
+ }
154
+ ],
155
+ "text": "**"
156
+ },
157
+ {
158
+ "type": "text",
159
+ "marks": [
160
+ {
161
+ "type": "italic"
162
+ }
163
+ ],
164
+ "text": " or use keyboard shortcuts "
165
+ },
166
+ {
167
+ "type": "text",
168
+ "marks": [
169
+ {
170
+ "type": "code"
171
+ }
172
+ ],
173
+ "text": "⌘+B"
174
+ },
175
+ {
176
+ "type": "text",
177
+ "text": " for "
178
+ },
179
+ {
180
+ "type": "text",
181
+ "marks": [
182
+ {
183
+ "type": "strike"
184
+ }
185
+ ],
186
+ "text": "most"
187
+ },
188
+ {
189
+ "type": "text",
190
+ "text": " all common markdown marks. 🪄"
191
+ }
192
+ ]
193
+ }
194
+ ]
195
+ },
196
+ {
197
+ "type": "paragraph",
198
+ "attrs": {
199
+ "textAlign": "left"
200
+ },
201
+ "content": [
202
+ {
203
+ "type": "text",
204
+ "text": "Add images, customize alignment, and apply "
205
+ },
206
+ {
207
+ "type": "text",
208
+ "marks": [
209
+ {
210
+ "type": "highlight",
211
+ "attrs": {
212
+ "color": "var(--tt-color-highlight-blue)"
213
+ }
214
+ }
215
+ ],
216
+ "text": "advanced formatting"
217
+ },
218
+ {
219
+ "type": "text",
220
+ "text": " to make your writing more engaging and professional."
221
+ }
222
+ ]
223
+ },
224
+ {
225
+ "type": "image",
226
+ "attrs": {
227
+ "src": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSI5MDAiIGhlaWdodD0iNDIwIiB2aWV3Qm94PSIwIDAgOTAwIDQyMCIgcm9sZT0iaW1nIiBhcmlhLWxhYmVsPSJQbGFjZWhvbGRlciBpbWFnZSI+CiAgPHJlY3Qgd2lkdGg9IjkwMCIgaGVpZ2h0PSI0MjAiIGZpbGw9IiNmNGY0ZjUiLz4KICA8cmVjdCB4PSIwLjUiIHk9IjAuNSIgd2lkdGg9Ijg5OSIgaGVpZ2h0PSI0MTkiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2U0ZTRlNyIvPgogIDxnIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2M0YzRjYyIgc3Ryb2tlLXdpZHRoPSI0Ij4KICAgIDxyZWN0IHg9IjMzMCIgeT0iMTUwIiB3aWR0aD0iMjQwIiBoZWlnaHQ9IjE1MCIgcng9IjgiLz4KICAgIDxjaXJjbGUgY3g9IjM5MiIgY3k9IjIwMCIgcj0iMjAiLz4KICAgIDxwYXRoIGQ9Ik0zMzggMjkybDcwLTY0IDUwIDQ0IDYwLTU0IDc2IDc0Ii8+CiAgPC9nPgogIDx0ZXh0IHg9IjQ1MCIgeT0iMzQ2IiBmb250LWZhbWlseT0iSW50ZXIsIHN5c3RlbS11aSwgc2Fucy1zZXJpZiIgZm9udC1zaXplPSIyMiIgZmlsbD0iI2ExYTFhYSIgdGV4dC1hbmNob3I9Im1pZGRsZSI+UGxhY2Vob2xkZXIgaW1hZ2U8L3RleHQ+Cjwvc3ZnPgo=",
228
+ "alt": "placeholder-image",
229
+ "title": "placeholder-image"
230
+ }
231
+ },
232
+ {
233
+ "type": "bulletList",
234
+ "content": [
235
+ {
236
+ "type": "listItem",
237
+ "content": [
238
+ {
239
+ "type": "paragraph",
240
+ "attrs": {
241
+ "textAlign": "left"
242
+ },
243
+ "content": [
244
+ {
245
+ "type": "text",
246
+ "marks": [
247
+ {
248
+ "type": "bold"
249
+ }
250
+ ],
251
+ "text": "Superscript"
252
+ },
253
+ {
254
+ "type": "text",
255
+ "text": " (x"
256
+ },
257
+ {
258
+ "type": "text",
259
+ "marks": [
260
+ {
261
+ "type": "superscript"
262
+ }
263
+ ],
264
+ "text": "2"
265
+ },
266
+ {
267
+ "type": "text",
268
+ "text": ") and "
269
+ },
270
+ {
271
+ "type": "text",
272
+ "marks": [
273
+ {
274
+ "type": "bold"
275
+ }
276
+ ],
277
+ "text": "Subscript"
278
+ },
279
+ {
280
+ "type": "text",
281
+ "text": " (H"
282
+ },
283
+ {
284
+ "type": "text",
285
+ "marks": [
286
+ {
287
+ "type": "subscript"
288
+ }
289
+ ],
290
+ "text": "2"
291
+ },
292
+ {
293
+ "type": "text",
294
+ "text": "O) for precision."
295
+ }
296
+ ]
297
+ }
298
+ ]
299
+ },
300
+ {
301
+ "type": "listItem",
302
+ "content": [
303
+ {
304
+ "type": "paragraph",
305
+ "attrs": {
306
+ "textAlign": "left"
307
+ },
308
+ "content": [
309
+ {
310
+ "type": "text",
311
+ "marks": [
312
+ {
313
+ "type": "bold"
314
+ }
315
+ ],
316
+ "text": "Typographic conversion"
317
+ },
318
+ {
319
+ "type": "text",
320
+ "text": ": automatically convert to "
321
+ },
322
+ {
323
+ "type": "text",
324
+ "marks": [
325
+ {
326
+ "type": "code"
327
+ }
328
+ ],
329
+ "text": "->"
330
+ },
331
+ {
332
+ "type": "text",
333
+ "text": " an arrow "
334
+ },
335
+ {
336
+ "type": "text",
337
+ "marks": [
338
+ {
339
+ "type": "bold"
340
+ }
341
+ ],
342
+ "text": "→"
343
+ },
344
+ {
345
+ "type": "text",
346
+ "text": "."
347
+ }
348
+ ]
349
+ }
350
+ ]
351
+ }
352
+ ]
353
+ },
354
+ {
355
+ "type": "paragraph",
356
+ "attrs": {
357
+ "textAlign": "left"
358
+ },
359
+ "content": [
360
+ {
361
+ "type": "text",
362
+ "marks": [
363
+ {
364
+ "type": "italic"
365
+ }
366
+ ],
367
+ "text": "→ "
368
+ },
369
+ {
370
+ "type": "text",
371
+ "marks": [
372
+ {
373
+ "type": "link",
374
+ "attrs": {
375
+ "href": "https://planet.dev/docs/ui-components/templates/simple-editor#features",
376
+ "target": "_blank",
377
+ "rel": "noopener noreferrer nofollow",
378
+ "class": null
379
+ }
380
+ }
381
+ ],
382
+ "text": "Learn more"
383
+ }
384
+ ]
385
+ },
386
+ {
387
+ "type": "horizontalRule"
388
+ },
389
+ {
390
+ "type": "heading",
391
+ "attrs": {
392
+ "textAlign": "left",
393
+ "level": 2
394
+ },
395
+ "content": [
396
+ {
397
+ "type": "text",
398
+ "text": "Make it your own"
399
+ }
400
+ ]
401
+ },
402
+ {
403
+ "type": "paragraph",
404
+ "attrs": {
405
+ "textAlign": "left"
406
+ },
407
+ "content": [
408
+ {
409
+ "type": "text",
410
+ "text": "Switch between light and dark modes, and tailor the editor's appearance with customizable CSS to match your style."
411
+ }
412
+ ]
413
+ },
414
+ {
415
+ "type": "taskList",
416
+ "content": [
417
+ {
418
+ "type": "taskItem",
419
+ "attrs": {
420
+ "checked": true
421
+ },
422
+ "content": [
423
+ {
424
+ "type": "paragraph",
425
+ "attrs": {
426
+ "textAlign": "left"
427
+ },
428
+ "content": [
429
+ {
430
+ "type": "text",
431
+ "text": "Test template"
432
+ }
433
+ ]
434
+ }
435
+ ]
436
+ },
437
+ {
438
+ "type": "taskItem",
439
+ "attrs": {
440
+ "checked": false
441
+ },
442
+ "content": [
443
+ {
444
+ "type": "paragraph",
445
+ "attrs": {
446
+ "textAlign": "left"
447
+ },
448
+ "content": [
449
+ {
450
+ "type": "text",
451
+ "marks": [
452
+ {
453
+ "type": "link",
454
+ "attrs": {
455
+ "href": "https://planet.dev/docs/ui-components/templates/simple-editor",
456
+ "target": "_blank",
457
+ "rel": "noopener noreferrer nofollow",
458
+ "class": null
459
+ }
460
+ }
461
+ ],
462
+ "text": "Integrate the free template"
463
+ }
464
+ ]
465
+ }
466
+ ]
467
+ }
468
+ ]
469
+ },
470
+ {
471
+ "type": "paragraph",
472
+ "attrs": {
473
+ "textAlign": "left"
474
+ }
475
+ }
476
+ ]
477
+ };
478
+
479
+ export default _default;
@@ -0,0 +1,31 @@
1
+ export interface SimpleEditorProps {
2
+ /** Initial content as HTML string or Planet JSON. Defaults to demo content. */
3
+ content?: string | Record<string, unknown>;
4
+ /** Whether the editor is editable. @default true */
5
+ editable?: boolean;
6
+ /** Called on every change with both HTML and JSON representations. */
7
+ onChange?: (value: {
8
+ html: string;
9
+ json: Record<string, unknown>;
10
+ }) => void;
11
+ /**
12
+ * Image upload handler. Receives the picked File and resolves to a URL/src.
13
+ * Defaults to an offline base64 (data URL) handler. Pass your own to upload
14
+ * to a backend when online.
15
+ */
16
+ uploadImage?: (file: File, onProgress?: (event: {
17
+ progress: number;
18
+ }) => void, abortSignal?: AbortSignal) => Promise<string>;
19
+ /**
20
+ * Show a line-number gutter down the left of the document, numbering each
21
+ * top-level block. Off by default. @default false
22
+ */
23
+ lineNumbers?: boolean;
24
+ }
25
+ /**
26
+ * Public editor component. SSR-safe: on the server (and the first client render
27
+ * during hydration) it emits a stable empty wrapper, then mounts the real
28
+ * editor on the client. This keeps every Planet hook off the server, so it
29
+ * works in Next.js App Router without prerender/hydration errors.
30
+ */
31
+ export declare function SimpleEditor(props?: SimpleEditorProps): import("react").JSX.Element;
@@ -0,0 +1 @@
1
+ export declare function ThemeToggle(): import("react").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { UseBlockquoteConfig } from '.';
2
+ import { ButtonProps } from '../../planet-ui-primitive/button';
3
+ export interface BlockquoteButtonProps extends Omit<ButtonProps, "type">, UseBlockquoteConfig {
4
+ /**
5
+ * Optional text to display alongside the icon.
6
+ */
7
+ text?: string;
8
+ /**
9
+ * Optional show shortcut keys in the button.
10
+ * @default false
11
+ */
12
+ showShortcut?: boolean;
13
+ }
14
+ export declare function BlockquoteShortcutBadge({ shortcutKeys, }: {
15
+ shortcutKeys?: string;
16
+ }): import("react").JSX.Element;
17
+ /**
18
+ * Button component for toggling blockquote in a Planet editor.
19
+ *
20
+ * For custom button implementations, use the `useBlockquote` hook instead.
21
+ */
22
+ export declare const BlockquoteButton: import('react').ForwardRefExoticComponent<BlockquoteButtonProps & import('react').RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,2 @@
1
+ export * from './blockquote-button';
2
+ export * from './use-blockquote';
@@ -0,0 +1,80 @@
1
+ import { Editor } from '../../../planet-core/react';
2
+ export declare const BLOCKQUOTE_SHORTCUT_KEY = "mod+shift+b";
3
+ /**
4
+ * Configuration for the blockquote functionality
5
+ */
6
+ export interface UseBlockquoteConfig {
7
+ /**
8
+ * The Planet editor instance.
9
+ */
10
+ editor?: Editor | null;
11
+ /**
12
+ * Whether the button should hide when blockquote is not available.
13
+ * @default false
14
+ */
15
+ hideWhenUnavailable?: boolean;
16
+ /**
17
+ * Callback function called after a successful toggle.
18
+ */
19
+ onToggled?: () => void;
20
+ }
21
+ /**
22
+ * Checks if blockquote can be toggled in the current editor state
23
+ */
24
+ export declare function canToggleBlockquote(editor: Editor | null, turnInto?: boolean): boolean;
25
+ /**
26
+ * Toggles blockquote formatting for a specific node or the current selection
27
+ */
28
+ export declare function toggleBlockquote(editor: Editor | null): boolean;
29
+ /**
30
+ * Determines if the blockquote button should be shown
31
+ */
32
+ export declare function shouldShowButton(props: {
33
+ editor: Editor | null;
34
+ hideWhenUnavailable: boolean;
35
+ }): boolean;
36
+ /**
37
+ * Custom hook that provides blockquote functionality for Planet editor
38
+ *
39
+ * @example
40
+ * ```tsx
41
+ * // Simple usage - no params needed
42
+ * function MySimpleBlockquoteButton() {
43
+ * const { isVisible, handleToggle, isActive } = useBlockquote()
44
+ *
45
+ * if (!isVisible) return null
46
+ *
47
+ * return <button onClick={handleToggle}>Blockquote</button>
48
+ * }
49
+ *
50
+ * // Advanced usage with configuration
51
+ * function MyAdvancedBlockquoteButton() {
52
+ * const { isVisible, handleToggle, label, isActive } = useBlockquote({
53
+ * editor: myEditor,
54
+ * hideWhenUnavailable: true,
55
+ * onToggled: () => console.log('Blockquote toggled!')
56
+ * })
57
+ *
58
+ * if (!isVisible) return null
59
+ *
60
+ * return (
61
+ * <MyButton
62
+ * onClick={handleToggle}
63
+ * aria-label={label}
64
+ * aria-pressed={isActive}
65
+ * >
66
+ * Toggle Blockquote
67
+ * </MyButton>
68
+ * )
69
+ * }
70
+ * ```
71
+ */
72
+ export declare function useBlockquote(config?: UseBlockquoteConfig): {
73
+ isVisible: boolean;
74
+ isActive: boolean;
75
+ handleToggle: () => boolean;
76
+ canToggle: boolean;
77
+ label: string;
78
+ shortcutKeys: string;
79
+ Icon: import('react').MemoExoticComponent<({ className, ...props }: Omit<import('react').SVGProps<SVGSVGElement>, "ref">) => import("react").JSX.Element>;
80
+ };