@drawnagency/primitives 0.1.7 → 0.1.10

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 (173) hide show
  1. package/dist/auth/index.js +2 -2
  2. package/dist/auth/security.d.ts.map +1 -1
  3. package/dist/{chunk-T4BJ6RSB.js → chunk-32H6Q6CX.js} +1 -1
  4. package/dist/{chunk-HOJAF4VD.js → chunk-6SK5BLG3.js} +16 -9
  5. package/dist/{chunk-2VTPWODA.js → chunk-F32I6ZZV.js} +1 -1
  6. package/dist/{chunk-CS7F6IOY.js → chunk-F3Z6RISI.js} +4 -1
  7. package/dist/{chunk-UKEVUCIZ.js → chunk-XQXZHDNR.js} +4 -4
  8. package/dist/components/editor/SectionWrapper.d.ts.map +1 -1
  9. package/dist/components/primitives/EditableGrid.d.ts.map +1 -1
  10. package/dist/components/primitives/EditableList.d.ts.map +1 -1
  11. package/dist/components/primitives/EditableRichText.d.ts +2 -1
  12. package/dist/components/primitives/EditableRichText.d.ts.map +1 -1
  13. package/dist/components/primitives/ResolvedMedia.d.ts +4 -1
  14. package/dist/components/primitives/ResolvedMedia.d.ts.map +1 -1
  15. package/dist/components/primitives/useEditableRichText.d.ts +2 -1
  16. package/dist/components/primitives/useEditableRichText.d.ts.map +1 -1
  17. package/dist/components/sections/IconList/IconList.d.ts.map +1 -1
  18. package/dist/components/sections/Prose/Prose.d.ts.map +1 -1
  19. package/dist/components/sections/SplitContent/SplitContent.d.ts +4 -1
  20. package/dist/components/sections/SplitContent/SplitContent.d.ts.map +1 -1
  21. package/dist/components/sections/SplitContent/index.d.ts.map +1 -1
  22. package/dist/index.js +5 -5
  23. package/dist/lib/index.js +3 -3
  24. package/dist/lib/loader.d.ts.map +1 -1
  25. package/dist/lib/registry.d.ts.map +1 -1
  26. package/dist/schemas/index.js +2 -2
  27. package/package.json +11 -10
  28. package/src/auth/security.ts +5 -1
  29. package/src/components/brandguide/ColorSwatchSettings.d.ts +8 -0
  30. package/src/components/brandguide/ColorSwatchSettings.d.ts.map +1 -0
  31. package/src/components/brandguide/Colors.d.ts +15 -0
  32. package/src/components/brandguide/Colors.d.ts.map +1 -0
  33. package/src/components/brandguide/DoDontList.d.ts +16 -0
  34. package/src/components/brandguide/DoDontList.d.ts.map +1 -0
  35. package/src/components/brandguide/DoDontMediaGrid.d.ts +16 -0
  36. package/src/components/brandguide/DoDontMediaGrid.d.ts.map +1 -0
  37. package/src/components/editor/SectionWrapper.tsx +65 -58
  38. package/src/components/primitives/CustomParagraph.d.ts +2 -0
  39. package/src/components/primitives/CustomParagraph.d.ts.map +1 -0
  40. package/src/components/primitives/EditableGrid.d.ts +19 -0
  41. package/src/components/primitives/EditableGrid.d.ts.map +1 -0
  42. package/src/components/primitives/EditableGrid.tsx +70 -47
  43. package/src/components/primitives/EditableList.tsx +32 -21
  44. package/src/components/primitives/EditablePlainText.d.ts +12 -0
  45. package/src/components/primitives/EditablePlainText.d.ts.map +1 -0
  46. package/src/components/primitives/EditableRichText.d.ts +12 -0
  47. package/src/components/primitives/EditableRichText.d.ts.map +1 -0
  48. package/src/components/primitives/EditableRichText.tsx +19 -3
  49. package/src/components/primitives/HeadingSection.d.ts +10 -0
  50. package/src/components/primitives/HeadingSection.d.ts.map +1 -0
  51. package/src/components/primitives/IconPicker.d.ts +9 -0
  52. package/src/components/primitives/IconPicker.d.ts.map +1 -0
  53. package/src/components/primitives/LinkPopover.d.ts +8 -0
  54. package/src/components/primitives/LinkPopover.d.ts.map +1 -0
  55. package/src/components/primitives/MediaSettingsForms.d.ts +19 -0
  56. package/src/components/primitives/MediaSettingsForms.d.ts.map +1 -0
  57. package/src/components/primitives/ResolvedMedia.d.ts +8 -0
  58. package/src/components/primitives/ResolvedMedia.d.ts.map +1 -0
  59. package/src/components/primitives/ResolvedMedia.tsx +12 -1
  60. package/src/components/primitives/RichTextToolbar.d.ts +9 -0
  61. package/src/components/primitives/RichTextToolbar.d.ts.map +1 -0
  62. package/src/components/primitives/tiptap-presets.d.ts +4 -0
  63. package/src/components/primitives/tiptap-presets.d.ts.map +1 -0
  64. package/src/components/primitives/useEditableCollection.d.ts +19 -0
  65. package/src/components/primitives/useEditableCollection.d.ts.map +1 -0
  66. package/src/components/primitives/useEditablePlainText.d.ts +14 -0
  67. package/src/components/primitives/useEditablePlainText.d.ts.map +1 -0
  68. package/src/components/primitives/useEditableRichText.d.ts +17 -0
  69. package/src/components/primitives/useEditableRichText.d.ts.map +1 -0
  70. package/src/components/primitives/useEditableRichText.ts +8 -2
  71. package/src/components/sections/Button/CTAButton.d.ts +11 -0
  72. package/src/components/sections/Button/CTAButton.d.ts.map +1 -0
  73. package/src/components/sections/Button/index.d.ts +11 -0
  74. package/src/components/sections/Button/index.d.ts.map +1 -0
  75. package/src/components/sections/Colors/index.d.ts +22 -0
  76. package/src/components/sections/Colors/index.d.ts.map +1 -0
  77. package/src/components/sections/DoDontList/index.d.ts +21 -0
  78. package/src/components/sections/DoDontList/index.d.ts.map +1 -0
  79. package/src/components/sections/DoDontMediaGrid/index.d.ts +55 -0
  80. package/src/components/sections/DoDontMediaGrid/index.d.ts.map +1 -0
  81. package/src/components/sections/IconList/IconList.d.ts +20 -0
  82. package/src/components/sections/IconList/IconList.d.ts.map +1 -0
  83. package/src/components/sections/IconList/IconList.tsx +57 -36
  84. package/src/components/sections/IconList/IconListSettings.d.ts +11 -0
  85. package/src/components/sections/IconList/IconListSettings.d.ts.map +1 -0
  86. package/src/components/sections/IconList/index.d.ts +17 -0
  87. package/src/components/sections/IconList/index.d.ts.map +1 -0
  88. package/src/components/sections/LinkHeading/index.d.ts +8 -0
  89. package/src/components/sections/LinkHeading/index.d.ts.map +1 -0
  90. package/src/components/sections/MediaGrid/MediaGrid.d.ts +17 -0
  91. package/src/components/sections/MediaGrid/MediaGrid.d.ts.map +1 -0
  92. package/src/components/sections/MediaGrid/MediaGrid.tsx +4 -0
  93. package/src/components/sections/MediaGrid/index.d.ts +55 -0
  94. package/src/components/sections/MediaGrid/index.d.ts.map +1 -0
  95. package/src/components/sections/Prose/Prose.d.ts +8 -0
  96. package/src/components/sections/Prose/Prose.d.ts.map +1 -0
  97. package/src/components/sections/Prose/Prose.tsx +1 -0
  98. package/src/components/sections/Prose/index.d.ts +8 -0
  99. package/src/components/sections/Prose/index.d.ts.map +1 -0
  100. package/src/components/sections/SplitContent/SplitContent.d.ts +11 -0
  101. package/src/components/sections/SplitContent/SplitContent.d.ts.map +1 -0
  102. package/src/components/sections/SplitContent/SplitContent.tsx +7 -1
  103. package/src/components/sections/SplitContent/SplitContentSettings.d.ts +9 -0
  104. package/src/components/sections/SplitContent/SplitContentSettings.d.ts.map +1 -0
  105. package/src/components/sections/SplitContent/index.d.ts +13 -0
  106. package/src/components/sections/SplitContent/index.d.ts.map +1 -0
  107. package/src/components/sections/SplitContent/index.tsx +3 -0
  108. package/src/components/sections/SubHeading/index.d.ts +9 -0
  109. package/src/components/sections/SubHeading/index.d.ts.map +1 -0
  110. package/src/components/sections/SubSubHeading/index.d.ts +9 -0
  111. package/src/components/sections/SubSubHeading/index.d.ts.map +1 -0
  112. package/src/components/sections/register-schemas.d.ts +2 -0
  113. package/src/components/sections/register-schemas.d.ts.map +1 -0
  114. package/src/components/shared/Button.d.ts +15 -0
  115. package/src/components/shared/Button.d.ts.map +1 -0
  116. package/src/components/shared/Checkbox.d.ts +14 -0
  117. package/src/components/shared/Checkbox.d.ts.map +1 -0
  118. package/src/components/shared/FormLabel.d.ts +8 -0
  119. package/src/components/shared/FormLabel.d.ts.map +1 -0
  120. package/src/components/shared/IconButton.d.ts +12 -0
  121. package/src/components/shared/IconButton.d.ts.map +1 -0
  122. package/src/components/shared/Input.d.ts +8 -0
  123. package/src/components/shared/Input.d.ts.map +1 -0
  124. package/src/components/shared/Select.d.ts +16 -0
  125. package/src/components/shared/Select.d.ts.map +1 -0
  126. package/src/components/shared/icons.d.ts +17 -0
  127. package/src/components/shared/icons.d.ts.map +1 -0
  128. package/src/components/shell/MediaLibraryContext.d.ts +14 -0
  129. package/src/components/shell/MediaLibraryContext.d.ts.map +1 -0
  130. package/src/hooks/useResolvedMedia.d.ts +9 -0
  131. package/src/hooks/useResolvedMedia.d.ts.map +1 -0
  132. package/src/lib/cn.d.ts +3 -0
  133. package/src/lib/cn.d.ts.map +1 -0
  134. package/src/lib/grid.d.ts +2 -0
  135. package/src/lib/grid.d.ts.map +1 -0
  136. package/src/lib/icons.d.ts +9 -0
  137. package/src/lib/icons.d.ts.map +1 -0
  138. package/src/lib/loader.d.ts +28 -0
  139. package/src/lib/loader.d.ts.map +1 -0
  140. package/src/lib/loader.ts +15 -7
  141. package/src/lib/nav.d.ts +15 -0
  142. package/src/lib/nav.d.ts.map +1 -0
  143. package/src/lib/registry.d.ts +110 -0
  144. package/src/lib/registry.d.ts.map +1 -0
  145. package/src/lib/registry.ts +6 -4
  146. package/src/lib/sanitize.d.ts +2 -0
  147. package/src/lib/sanitize.d.ts.map +1 -0
  148. package/src/media/github.d.ts +3 -0
  149. package/src/media/github.d.ts.map +1 -0
  150. package/src/media/index.d.ts +8 -0
  151. package/src/media/index.d.ts.map +1 -0
  152. package/src/media/queue.d.ts +74 -0
  153. package/src/media/queue.d.ts.map +1 -0
  154. package/src/media/resolve.d.ts +14 -0
  155. package/src/media/resolve.d.ts.map +1 -0
  156. package/src/media/types.d.ts +42 -0
  157. package/src/media/types.d.ts.map +1 -0
  158. package/src/media/utils.d.ts +7 -0
  159. package/src/media/utils.d.ts.map +1 -0
  160. package/src/media/videoPoster.d.ts +6 -0
  161. package/src/media/videoPoster.d.ts.map +1 -0
  162. package/src/schemas/auth.d.ts +36 -0
  163. package/src/schemas/auth.d.ts.map +1 -0
  164. package/src/schemas/media-grid-options.d.ts +8 -0
  165. package/src/schemas/media-grid-options.d.ts.map +1 -0
  166. package/src/schemas/media.d.ts +63 -0
  167. package/src/schemas/media.d.ts.map +1 -0
  168. package/src/schemas/sections.d.ts +12 -0
  169. package/src/schemas/sections.d.ts.map +1 -0
  170. package/src/schemas/shared.d.ts +98 -0
  171. package/src/schemas/shared.d.ts.map +1 -0
  172. package/src/schemas/site-config.d.ts +48 -0
  173. package/src/schemas/site-config.d.ts.map +1 -0
@@ -0,0 +1,2 @@
1
+ export declare const CustomParagraph: import("@tiptap/core").Node<import("@tiptap/extension-paragraph").ParagraphOptions, any>;
2
+ //# sourceMappingURL=CustomParagraph.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomParagraph.d.ts","sourceRoot":"","sources":["CustomParagraph.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,eAAe,0FAoB1B,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { type ReactNode } from "react";
2
+ interface EditableGridProps<T> {
3
+ items: T[];
4
+ columns: number;
5
+ onChange: (items: T[]) => void;
6
+ createItem: () => T;
7
+ isEditMode: boolean;
8
+ renderItem: (item: T, props: {
9
+ isEditMode: boolean;
10
+ index: number;
11
+ }) => ReactNode;
12
+ onItemSettings?: (index: number) => void;
13
+ onItemImageClick?: (index: number) => void;
14
+ chromeTopClass?: string;
15
+ className?: string;
16
+ }
17
+ export declare function EditableGrid<T>({ items, columns, onChange, createItem, isEditMode, renderItem, onItemSettings, onItemImageClick, chromeTopClass, className, }: EditableGridProps<T>): import("react/jsx-runtime").JSX.Element;
18
+ export {};
19
+ //# sourceMappingURL=EditableGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableGrid.d.ts","sourceRoot":"","sources":["EditableGrid.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA+B,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAQpE,UAAU,iBAAiB,CAAC,CAAC;IAC3B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,CAAC,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE;QAAE,UAAU,EAAE,OAAO,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,KAAK,SAAS,CAAC;IAClF,cAAc,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,EAC9B,KAAK,EACL,OAAO,EACP,QAAQ,EACR,UAAU,EACV,UAAU,EACV,UAAU,EACV,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,SAAS,GACV,EAAE,iBAAiB,CAAC,CAAC,CAAC,2CAiFtB"}
@@ -1,7 +1,4 @@
1
1
  import { useRef, useEffect, useState, type ReactNode } from "react";
2
- import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
3
- import { attachClosestEdge, extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
4
- import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
5
2
  import { ImageIcon } from "lucide-react";
6
3
  import { AddIcon, DragHandle, DeleteIcon, SettingsIcon } from "../shared/icons";
7
4
  import { IconButton } from "../shared/IconButton";
@@ -48,14 +45,25 @@ export function EditableGrid<T>({
48
45
  const [isDragging, setIsDragging] = useState(false);
49
46
 
50
47
  useEffect(() => {
51
- return monitorForElements({
52
- onDragStart: ({ source }) => {
53
- if (source.data.dragType === "grid-cell") setIsDragging(true);
54
- },
55
- onDrop: ({ source }) => {
56
- if (source.data.dragType === "grid-cell") setIsDragging(false);
57
- },
48
+ let cleanup: (() => void) | undefined;
49
+ let cancelled = false;
50
+
51
+ import("@atlaskit/pragmatic-drag-and-drop/element/adapter").then(({ monitorForElements }) => {
52
+ if (cancelled) return;
53
+ cleanup = monitorForElements({
54
+ onDragStart: ({ source }) => {
55
+ if (source.data.dragType === "grid-cell") setIsDragging(true);
56
+ },
57
+ onDrop: ({ source }) => {
58
+ if (source.data.dragType === "grid-cell") setIsDragging(false);
59
+ },
60
+ });
58
61
  });
62
+
63
+ return () => {
64
+ cancelled = true;
65
+ cleanup?.();
66
+ };
59
67
  }, []);
60
68
 
61
69
  if (!isEditMode) {
@@ -142,47 +150,62 @@ function GridCell({
142
150
  const handle = handleRef.current;
143
151
  if (!cell || !handle) return;
144
152
 
145
- const cleanupDraggable = draggable({
146
- element: handle,
147
- getInitialData: () => ({ dragType: "grid-cell", id, index }),
148
- onDragStart: () => setDragState({ sourceId: id, closestEdge: null }),
149
- onDrop: () => setDragState({ sourceId: null, closestEdge: null }),
150
- });
153
+ let cleanup: (() => void) | undefined;
154
+ let cancelled = false;
155
+
156
+ Promise.all([
157
+ import("@atlaskit/pragmatic-drag-and-drop/element/adapter"),
158
+ import("@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge"),
159
+ ]).then(([{ draggable, dropTargetForElements }, { attachClosestEdge, extractClosestEdge }]) => {
160
+ if (cancelled) return;
161
+
162
+ const cleanupDraggable = draggable({
163
+ element: handle,
164
+ getInitialData: () => ({ dragType: "grid-cell", id, index }),
165
+ onDragStart: () => setDragState({ sourceId: id, closestEdge: null }),
166
+ onDrop: () => setDragState({ sourceId: null, closestEdge: null }),
167
+ });
168
+
169
+ const cleanupDropTarget = dropTargetForElements({
170
+ element: cell,
171
+ canDrop: ({ source }) => source.data.dragType === "grid-cell",
172
+ getData: ({ input, element }) =>
173
+ attachClosestEdge(
174
+ { id, index },
175
+ { input, element, allowedEdges: ["left", "right"] },
176
+ ),
177
+ onDragEnter: ({ self }) => {
178
+ const edge = extractClosestEdge(self.data);
179
+ if (edge) setDragState((prev) => ({ ...prev, closestEdge: { id, edge: edge as "left" | "right" } }));
180
+ },
181
+ onDrag: ({ self }) => {
182
+ const edge = extractClosestEdge(self.data);
183
+ if (edge) setDragState((prev) => ({ ...prev, closestEdge: { id, edge: edge as "left" | "right" } }));
184
+ },
185
+ onDragLeave: () => {
186
+ setDragState((prev) => prev.closestEdge?.id === id ? { ...prev, closestEdge: null } : prev);
187
+ },
188
+ onDrop: ({ source, self }) => {
189
+ const fromIndex = source.data.index as number;
190
+ const edge = extractClosestEdge(self.data);
191
+ let toIndex = index;
192
+ if (edge === "right") toIndex = index + 1;
193
+ if (fromIndex < toIndex) toIndex--;
194
+ if (fromIndex !== toIndex) {
195
+ onReorder(fromIndex, toIndex);
196
+ }
197
+ },
198
+ });
151
199
 
152
- const cleanupDropTarget = dropTargetForElements({
153
- element: cell,
154
- canDrop: ({ source }) => source.data.dragType === "grid-cell",
155
- getData: ({ input, element }) =>
156
- attachClosestEdge(
157
- { id, index },
158
- { input, element, allowedEdges: ["left", "right"] },
159
- ),
160
- onDragEnter: ({ self }) => {
161
- const edge = extractClosestEdge(self.data);
162
- if (edge) setDragState((prev) => ({ ...prev, closestEdge: { id, edge: edge as "left" | "right" } }));
163
- },
164
- onDrag: ({ self }) => {
165
- const edge = extractClosestEdge(self.data);
166
- if (edge) setDragState((prev) => ({ ...prev, closestEdge: { id, edge: edge as "left" | "right" } }));
167
- },
168
- onDragLeave: () => {
169
- setDragState((prev) => prev.closestEdge?.id === id ? { ...prev, closestEdge: null } : prev);
170
- },
171
- onDrop: ({ source, self }) => {
172
- const fromIndex = source.data.index as number;
173
- const edge = extractClosestEdge(self.data);
174
- let toIndex = index;
175
- if (edge === "right") toIndex = index + 1;
176
- if (fromIndex < toIndex) toIndex--;
177
- if (fromIndex !== toIndex) {
178
- onReorder(fromIndex, toIndex);
179
- }
180
- },
200
+ cleanup = () => {
201
+ cleanupDraggable();
202
+ cleanupDropTarget();
203
+ };
181
204
  });
182
205
 
183
206
  return () => {
184
- cleanupDraggable();
185
- cleanupDropTarget();
207
+ cancelled = true;
208
+ cleanup?.();
186
209
  };
187
210
  }, [id, index, onReorder, setDragState]);
188
211
 
@@ -1,5 +1,4 @@
1
1
  import { useRef, useEffect, useState, type ReactNode } from "react";
2
- import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
3
2
  import { DragHandle, DeleteIcon } from "../shared/icons";
4
3
  import { IconButton } from "../shared/IconButton";
5
4
  import { cn } from "../../lib/cn";
@@ -95,30 +94,42 @@ function ListRow({
95
94
  const handle = handleRef.current;
96
95
  if (!row || !handle) return;
97
96
 
98
- const cleanupDraggable = draggable({
99
- element: handle,
100
- getInitialData: () => ({ dragType: "list-row", id, index }),
101
- onDragStart: () => setDragState({ sourceId: id, targetId: null }),
102
- onDrop: () => setDragState({ sourceId: null, targetId: null }),
103
- });
97
+ let cleanup: (() => void) | undefined;
98
+ let cancelled = false;
99
+
100
+ import("@atlaskit/pragmatic-drag-and-drop/element/adapter").then(({ draggable, dropTargetForElements }) => {
101
+ if (cancelled) return;
102
+
103
+ const cleanupDraggable = draggable({
104
+ element: handle,
105
+ getInitialData: () => ({ dragType: "list-row", id, index }),
106
+ onDragStart: () => setDragState({ sourceId: id, targetId: null }),
107
+ onDrop: () => setDragState({ sourceId: null, targetId: null }),
108
+ });
109
+
110
+ const cleanupDropTarget = dropTargetForElements({
111
+ element: row,
112
+ canDrop: ({ source }) => source.data.dragType === "list-row",
113
+ getData: () => ({ id, index }),
114
+ onDragEnter: () => setDragState((prev) => ({ ...prev, targetId: id })),
115
+ onDragLeave: () => setDragState((prev) => prev.targetId === id ? { ...prev, targetId: null } : prev),
116
+ onDrop: ({ source }) => {
117
+ const fromIndex = source.data.index as number;
118
+ if (fromIndex !== index) {
119
+ onReorder(fromIndex, index);
120
+ }
121
+ },
122
+ });
104
123
 
105
- const cleanupDropTarget = dropTargetForElements({
106
- element: row,
107
- canDrop: ({ source }) => source.data.dragType === "list-row",
108
- getData: () => ({ id, index }),
109
- onDragEnter: () => setDragState((prev) => ({ ...prev, targetId: id })),
110
- onDragLeave: () => setDragState((prev) => prev.targetId === id ? { ...prev, targetId: null } : prev),
111
- onDrop: ({ source }) => {
112
- const fromIndex = source.data.index as number;
113
- if (fromIndex !== index) {
114
- onReorder(fromIndex, index);
115
- }
116
- },
124
+ cleanup = () => {
125
+ cleanupDraggable();
126
+ cleanupDropTarget();
127
+ };
117
128
  });
118
129
 
119
130
  return () => {
120
- cleanupDraggable();
121
- cleanupDropTarget();
131
+ cancelled = true;
132
+ cleanup?.();
122
133
  };
123
134
  }, [id, index, onReorder, setDragState]);
124
135
 
@@ -0,0 +1,12 @@
1
+ import { type ElementType, type HTMLAttributes } from "react";
2
+ interface EditablePlainTextProps extends Omit<HTMLAttributes<HTMLElement>, "onChange"> {
3
+ tag: ElementType;
4
+ value: string;
5
+ onChange: (value: string) => void;
6
+ isEditMode: boolean;
7
+ multiline?: boolean;
8
+ placeholder?: string;
9
+ }
10
+ export declare function EditablePlainText({ tag, value, onChange, isEditMode, multiline, placeholder, className, ...htmlAttrs }: EditablePlainTextProps): import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>>;
11
+ export {};
12
+ //# sourceMappingURL=EditablePlainText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditablePlainText.d.ts","sourceRoot":"","sources":["EditablePlainText.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,WAAW,EAChB,KAAK,cAAc,EACpB,MAAM,OAAO,CAAC;AAGf,UAAU,sBACR,SAAQ,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IACrD,GAAG,EAAE,WAAW,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wBAAgB,iBAAiB,CAAC,EAChC,GAAG,EACH,KAAK,EACL,QAAQ,EACR,UAAU,EACV,SAAiB,EACjB,WAAW,EACX,SAAS,EACT,GAAG,SAAS,EACb,EAAE,sBAAsB,0FAqExB"}
@@ -0,0 +1,12 @@
1
+ import type { PresetName } from "./tiptap-presets";
2
+ interface EditableRichTextProps {
3
+ value: string;
4
+ onChange: (html: string) => void;
5
+ isEditMode: boolean;
6
+ preset?: PresetName;
7
+ className?: string;
8
+ placeholder?: string;
9
+ }
10
+ export declare function EditableRichText({ value, onChange, isEditMode, preset, className, placeholder, }: EditableRichTextProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
12
+ //# sourceMappingURL=EditableRichText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditableRichText.d.ts","sourceRoot":"","sources":["EditableRichText.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,UAAU,EAAE,OAAO,CAAC;IACpB,MAAM,CAAC,EAAE,UAAU,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAMD,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,QAAQ,EACR,UAAU,EACV,MAAe,EACf,SAAS,EACT,WAAW,GACZ,EAAE,qBAAqB,2CAuHvB"}
@@ -12,6 +12,11 @@ interface EditableRichTextProps {
12
12
  isEditMode: boolean;
13
13
  preset?: PresetName;
14
14
  className?: string;
15
+ placeholder?: string;
16
+ }
17
+
18
+ function isContentEmpty(html: string): boolean {
19
+ return html.replace(/<[^>]*>/g, "").trim().length === 0;
15
20
  }
16
21
 
17
22
  export function EditableRichText({
@@ -20,9 +25,10 @@ export function EditableRichText({
20
25
  isEditMode,
21
26
  preset = "rich",
22
27
  className,
28
+ placeholder,
23
29
  }: EditableRichTextProps) {
24
30
  const { isEditorActive, editor, activate, deactivate } =
25
- useEditableRichText({ value, onChange, preset });
31
+ useEditableRichText({ value, onChange, preset, placeholder });
26
32
  const wrapperRef = useRef<HTMLDivElement>(null);
27
33
  const blurTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(null);
28
34
  const clickCoordsRef = useRef<{ left: number; top: number } | null>(null);
@@ -97,13 +103,23 @@ export function EditableRichText({
97
103
  );
98
104
  }
99
105
 
100
- // Edit mode, not yet active: static HTML with click-to-activate
106
+ // Edit mode, not yet active: static HTML with click-to-activate.
107
+ // When content is empty, show the placeholder so the area is visibly clickable.
101
108
  if (!isEditorActive || !editor) {
102
- // eslint-disable-next-line react/no-danger
109
+ const empty = placeholder && isContentEmpty(value);
110
+ if (empty) {
111
+ return (
112
+ <div className={className} onClick={handleClick}>
113
+ <p className="tiptap-placeholder">{placeholder}</p>
114
+ </div>
115
+ );
116
+ }
103
117
  return (
104
118
  <div
105
119
  className={className}
106
120
  onClick={handleClick}
121
+ // Content is sanitized via DOMPurify — safe for trusted project JSON.
122
+ // eslint-disable-next-line react/no-danger
107
123
  dangerouslySetInnerHTML={{ __html: sanitizeHtml(value) }}
108
124
  />
109
125
  );
@@ -0,0 +1,10 @@
1
+ interface Props {
2
+ heading: string;
3
+ tag: "h2" | "h3" | "h4";
4
+ placeholder: string;
5
+ className?: string;
6
+ onChange?: (heading: string) => void;
7
+ }
8
+ export declare function HeadingSection({ heading, tag, placeholder, className, onChange }: Props): import("react/jsx-runtime").JSX.Element;
9
+ export {};
10
+ //# sourceMappingURL=HeadingSection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeadingSection.d.ts","sourceRoot":"","sources":["HeadingSection.tsx"],"names":[],"mappings":"AAIA,UAAU,KAAK;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAYvF"}
@@ -0,0 +1,9 @@
1
+ interface IconPickerProps {
2
+ selected: string | null;
3
+ onSelect: (iconId: string | null) => void;
4
+ onClose: () => void;
5
+ showRemove?: boolean;
6
+ }
7
+ export declare function IconPicker({ selected, onSelect, onClose, showRemove }: IconPickerProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=IconPicker.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconPicker.d.ts","sourceRoot":"","sources":["IconPicker.tsx"],"names":[],"mappings":"AAIA,UAAU,eAAe;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAiB,EAAE,EAAE,eAAe,2CAgD7F"}
@@ -0,0 +1,8 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ interface LinkPopoverProps {
3
+ editor: Editor;
4
+ onClose: () => void;
5
+ }
6
+ export declare function LinkPopover({ editor, onClose }: LinkPopoverProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=LinkPopover.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LinkPopover.d.ts","sourceRoot":"","sources":["LinkPopover.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,UAAU,gBAAgB;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,WAAW,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,gBAAgB,2CAmGhE"}
@@ -0,0 +1,19 @@
1
+ export declare function ImageSettingsForm({ border, objectFit, onChange, }: {
2
+ border?: boolean;
3
+ objectFit?: "cover" | "contain";
4
+ onChange: (update: {
5
+ border?: boolean;
6
+ objectFit?: "cover" | "contain";
7
+ }) => void;
8
+ }): import("react/jsx-runtime").JSX.Element;
9
+ export declare function DoDontImageSettingsForm({ border, objectFit, doDont: initialDoDont, onChange, }: {
10
+ border?: boolean;
11
+ objectFit?: "cover" | "contain";
12
+ doDont: "do" | "dont";
13
+ onChange: (update: {
14
+ border?: boolean;
15
+ objectFit?: "cover" | "contain";
16
+ doDont: "do" | "dont";
17
+ }) => void;
18
+ }): import("react/jsx-runtime").JSX.Element;
19
+ //# sourceMappingURL=MediaSettingsForms.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaSettingsForms.d.ts","sourceRoot":"","sources":["MediaSettingsForms.tsx"],"names":[],"mappings":"AAMA,wBAAgB,iBAAiB,CAAC,EAChC,MAAM,EACN,SAAS,EACT,QAAQ,GACT,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;KAAE,KAAK,IAAI,CAAC;CACnF,2CA+BA;AAED,wBAAgB,uBAAuB,CAAC,EACtC,MAAM,EACN,SAAS,EACT,MAAM,EAAE,aAAa,EACrB,QAAQ,GACT,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;IAChC,MAAM,EAAE,IAAI,GAAG,MAAM,CAAC;IACtB,QAAQ,EAAE,CAAC,MAAM,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,GAAG,SAAS,CAAC;QAAC,MAAM,EAAE,IAAI,GAAG,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CAC1G,2CAmDA"}
@@ -0,0 +1,8 @@
1
+ interface ResolvedMediaProps {
2
+ imageId: string | undefined;
3
+ className?: string;
4
+ imgClassName?: string;
5
+ }
6
+ export declare function ResolvedMedia({ imageId, className, imgClassName, }: ResolvedMediaProps): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=ResolvedMedia.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResolvedMedia.d.ts","sourceRoot":"","sources":["ResolvedMedia.tsx"],"names":[],"mappings":"AAIA,UAAU,kBAAkB;IAC1B,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAS,EACT,YAAY,GACb,EAAE,kBAAkB,2CAqBpB"}
@@ -4,16 +4,27 @@ import { useResolvedMedia } from "../../hooks/useResolvedMedia";
4
4
 
5
5
  interface ResolvedMediaProps {
6
6
  imageId: string | undefined;
7
+ src?: string;
8
+ srcset?: string;
9
+ alt?: string;
7
10
  className?: string;
8
11
  imgClassName?: string;
9
12
  }
10
13
 
11
14
  export function ResolvedMedia({
12
15
  imageId,
16
+ src: propSrc,
17
+ srcset: propSrcset,
18
+ alt: propAlt,
13
19
  className,
14
20
  imgClassName,
15
21
  }: ResolvedMediaProps) {
16
- const { src, srcset, poster, alt, kind } = useResolvedMedia(imageId);
22
+ const resolved = useResolvedMedia(imageId);
23
+ const src = propSrc || resolved.src;
24
+ const srcset = propSrcset || resolved.srcset;
25
+ const poster = resolved.poster;
26
+ const alt = propAlt ?? resolved.alt;
27
+ const kind = resolved.kind;
17
28
 
18
29
  const mediaClass = cn("h-full w-full", imgClassName);
19
30
 
@@ -0,0 +1,9 @@
1
+ import type { Editor } from "@tiptap/core";
2
+ import type { PresetName } from "./tiptap-presets";
3
+ interface RichTextToolbarProps {
4
+ editor: Editor;
5
+ preset: PresetName;
6
+ }
7
+ export declare function RichTextToolbar({ editor, preset }: RichTextToolbarProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=RichTextToolbar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextToolbar.d.ts","sourceRoot":"","sources":["RichTextToolbar.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,UAAU,oBAAoB;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,UAAU,CAAC;CACpB;AAoCD,wBAAgB,eAAe,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,oBAAoB,2CAuGvE"}
@@ -0,0 +1,4 @@
1
+ import type { Extensions } from "@tiptap/core";
2
+ export type PresetName = "basic" | "rich";
3
+ export declare const presets: Record<PresetName, Extensions>;
4
+ //# sourceMappingURL=tiptap-presets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tiptap-presets.d.ts","sourceRoot":"","sources":["tiptap-presets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+C/C,MAAM,MAAM,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE1C,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,UAAU,EAAE,UAAU,CAAmB,CAAC"}
@@ -0,0 +1,19 @@
1
+ interface WrappedItem<T> {
2
+ id: string;
3
+ data: T;
4
+ }
5
+ interface UseEditableCollectionOptions<T> {
6
+ items: T[];
7
+ onChange: (items: T[]) => void;
8
+ createItem: () => T;
9
+ }
10
+ interface UseEditableCollectionReturn<T> {
11
+ wrappedItems: WrappedItem<T>[];
12
+ onReorder: (fromIndex: number, toIndex: number) => void;
13
+ onAdd: () => void;
14
+ onInsert: (index: number) => void;
15
+ onRemove: (id: string) => void;
16
+ }
17
+ export declare function useEditableCollection<T>({ items, onChange, createItem, }: UseEditableCollectionOptions<T>): UseEditableCollectionReturn<T>;
18
+ export {};
19
+ //# sourceMappingURL=useEditableCollection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditableCollection.d.ts","sourceRoot":"","sources":["useEditableCollection.ts"],"names":[],"mappings":"AAEA,UAAU,WAAW,CAAC,CAAC;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,CAAC,CAAC;CACT;AAED,UAAU,4BAA4B,CAAC,CAAC;IACtC,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,KAAK,IAAI,CAAC;IAC/B,UAAU,EAAE,MAAM,CAAC,CAAC;CACrB;AAED,UAAU,2BAA2B,CAAC,CAAC;IACrC,YAAY,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/B,SAAS,EAAE,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAC;IACxD,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAChC;AAaD,wBAAgB,qBAAqB,CAAC,CAAC,EAAE,EACvC,KAAK,EACL,QAAQ,EACR,UAAU,GACX,EAAE,4BAA4B,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,CAmElE"}
@@ -0,0 +1,14 @@
1
+ interface UseEditablePlainTextOptions {
2
+ value: string;
3
+ onChange: (value: string) => void;
4
+ multiline?: boolean;
5
+ }
6
+ interface UseEditablePlainTextReturn {
7
+ value: string;
8
+ handleInput: (text: string) => void;
9
+ handleBlur: () => void;
10
+ shouldPreventEnter: boolean;
11
+ }
12
+ export declare function useEditablePlainText({ value: propValue, onChange, multiline, }: UseEditablePlainTextOptions): UseEditablePlainTextReturn;
13
+ export {};
14
+ //# sourceMappingURL=useEditablePlainText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditablePlainText.d.ts","sourceRoot":"","sources":["useEditablePlainText.ts"],"names":[],"mappings":"AAEA,UAAU,2BAA2B;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,0BAA0B;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,kBAAkB,EAAE,OAAO,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAK,EAAE,SAAS,EAChB,QAAQ,EACR,SAAiB,GAClB,EAAE,2BAA2B,GAAG,0BAA0B,CA6B1D"}
@@ -0,0 +1,17 @@
1
+ import { Editor } from "@tiptap/core";
2
+ import { type PresetName } from "./tiptap-presets";
3
+ interface UseEditableRichTextOptions {
4
+ value: string;
5
+ onChange: (html: string) => void;
6
+ preset: PresetName;
7
+ placeholder?: string;
8
+ }
9
+ interface UseEditableRichTextReturn {
10
+ isEditorActive: boolean;
11
+ editor: Editor | null;
12
+ activate: () => void;
13
+ deactivate: () => void;
14
+ }
15
+ export declare function useEditableRichText({ value, onChange, preset, placeholder, }: UseEditableRichTextOptions): UseEditableRichTextReturn;
16
+ export {};
17
+ //# sourceMappingURL=useEditableRichText.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEditableRichText.d.ts","sourceRoot":"","sources":["useEditableRichText.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAAW,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAE5D,UAAU,0BAA0B;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACjC,MAAM,EAAE,UAAU,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,UAAU,yBAAyB;IACjC,cAAc,EAAE,OAAO,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB;AAED,wBAAgB,mBAAmB,CAAC,EAClC,KAAK,EACL,QAAQ,EACR,MAAM,EACN,WAAW,GACZ,EAAE,0BAA0B,GAAG,yBAAyB,CAuDxD"}
@@ -1,11 +1,13 @@
1
1
  import { useState, useRef, useCallback, useEffect } from "react";
2
2
  import { Editor } from "@tiptap/core";
3
+ import Placeholder from "@tiptap/extension-placeholder";
3
4
  import { presets, type PresetName } from "./tiptap-presets";
4
5
 
5
6
  interface UseEditableRichTextOptions {
6
7
  value: string;
7
8
  onChange: (html: string) => void;
8
9
  preset: PresetName;
10
+ placeholder?: string;
9
11
  }
10
12
 
11
13
  interface UseEditableRichTextReturn {
@@ -19,6 +21,7 @@ export function useEditableRichText({
19
21
  value,
20
22
  onChange,
21
23
  preset,
24
+ placeholder,
22
25
  }: UseEditableRichTextOptions): UseEditableRichTextReturn {
23
26
  // Dual ref+state: ref for stable callback access, state for re-renders
24
27
  const editorRef = useRef<Editor | null>(null);
@@ -37,13 +40,16 @@ export function useEditableRichText({
37
40
 
38
41
  const activate = useCallback(() => {
39
42
  if (editorRef.current) return;
43
+ const extensions = placeholder
44
+ ? [...presets[preset], Placeholder.configure({ placeholder })]
45
+ : presets[preset];
40
46
  const ed = new Editor({
41
- extensions: presets[preset],
47
+ extensions,
42
48
  content: valueRef.current,
43
49
  });
44
50
  editorRef.current = ed;
45
51
  setEditor(ed);
46
- }, [preset]);
52
+ }, [preset, placeholder]);
47
53
 
48
54
  const deactivate = useCallback(() => {
49
55
  const ed = editorRef.current;
@@ -0,0 +1,11 @@
1
+ import type { SectionContent } from "../../../schemas/sections";
2
+ interface Props {
3
+ text: string;
4
+ href?: string;
5
+ target?: string;
6
+ download?: boolean;
7
+ onChange?: (content: SectionContent) => void;
8
+ }
9
+ export default function Button({ text, href, target, download, onChange }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=CTAButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CTAButton.d.ts","sourceRoot":"","sources":["CTAButton.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEhE,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,CAAC;CAC9C;AAED,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAoC/E"}
@@ -0,0 +1,11 @@
1
+ declare const _default: import("../../../lib/registry").SectionDefinition<{
2
+ type: "button";
3
+ content: {
4
+ text: string;
5
+ href?: string | undefined;
6
+ target?: string | undefined;
7
+ download?: boolean | undefined;
8
+ };
9
+ }>;
10
+ export default _default;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;AAcA,wBAsBG"}
@@ -0,0 +1,22 @@
1
+ declare const _default: import("../../../lib/registry").SectionDefinition<{
2
+ type: "colors";
3
+ content: {
4
+ colors: {
5
+ spaces: {
6
+ hex?: string | undefined;
7
+ rgb?: string | undefined;
8
+ cmyk?: string | undefined;
9
+ pantone?: string | undefined;
10
+ }[];
11
+ name?: string | undefined;
12
+ }[];
13
+ };
14
+ options?: {
15
+ label?: string | undefined;
16
+ columns?: number | undefined;
17
+ collapsing?: boolean | undefined;
18
+ showLabel?: boolean | undefined;
19
+ } | undefined;
20
+ }>;
21
+ export default _default;
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAgBA,wBA4BG"}