@namroodinc/liquid-editorial 0.10.1 → 0.11.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 (166) hide show
  1. package/README.md +10 -0
  2. package/UPGRADING.md +113 -0
  3. package/dist/chunks/{Board-B8wK079I.js → Board-Cnyqrc-R.js} +2 -2
  4. package/dist/chunks/{Board-B8wK079I.js.map → Board-Cnyqrc-R.js.map} +1 -1
  5. package/dist/chunks/{Board-CMf5Azt0.cjs → Board-DFuJt2Oh.cjs} +2 -2
  6. package/dist/chunks/{Board-CMf5Azt0.cjs.map → Board-DFuJt2Oh.cjs.map} +1 -1
  7. package/dist/chunks/{ColourField-C1qjpIfB.cjs → ColourField--rS9KDpq.cjs} +2 -2
  8. package/dist/chunks/{ColourField-C1qjpIfB.cjs.map → ColourField--rS9KDpq.cjs.map} +1 -1
  9. package/dist/chunks/{ColourField-Ce2oaVcd.js → ColourField-DkO8tjeB.js} +2 -2
  10. package/dist/chunks/{ColourField-Ce2oaVcd.js.map → ColourField-DkO8tjeB.js.map} +1 -1
  11. package/dist/chunks/{DatePicker-CnVmsCwO.js → DatePicker-B8tllGYy.js} +2 -2
  12. package/dist/chunks/{DatePicker-CnVmsCwO.js.map → DatePicker-B8tllGYy.js.map} +1 -1
  13. package/dist/chunks/{DatePicker-BCnzFJFF.cjs → DatePicker-OiqjoO-f.cjs} +2 -2
  14. package/dist/chunks/{DatePicker-BCnzFJFF.cjs.map → DatePicker-OiqjoO-f.cjs.map} +1 -1
  15. package/dist/chunks/EntryPicker-BI_7g2Wg.cjs +2 -0
  16. package/dist/chunks/EntryPicker-BI_7g2Wg.cjs.map +1 -0
  17. package/dist/chunks/EntryPicker-KxHZzZsh.js +160 -0
  18. package/dist/chunks/EntryPicker-KxHZzZsh.js.map +1 -0
  19. package/dist/chunks/FormEditor-BJcAIVcL.cjs +2 -0
  20. package/dist/chunks/FormEditor-BJcAIVcL.cjs.map +1 -0
  21. package/dist/chunks/{FormEditor-BEOp5EW-.js → FormEditor-CdLqPaKK.js} +112 -108
  22. package/dist/chunks/FormEditor-CdLqPaKK.js.map +1 -0
  23. package/dist/chunks/Icon-CD3oeiNA.cjs +2 -0
  24. package/dist/chunks/Icon-CD3oeiNA.cjs.map +1 -0
  25. package/dist/chunks/Icon-CYXOo0Kt.js +88 -0
  26. package/dist/chunks/Icon-CYXOo0Kt.js.map +1 -0
  27. package/dist/chunks/{Message-CaX8Y1Xb.js → Message-CyLq9ef-.js} +2 -2
  28. package/dist/chunks/{Message-CaX8Y1Xb.js.map → Message-CyLq9ef-.js.map} +1 -1
  29. package/dist/chunks/{Message-DU31JAb3.cjs → Message-D3b8HDhm.cjs} +2 -2
  30. package/dist/chunks/{Message-DU31JAb3.cjs.map → Message-D3b8HDhm.cjs.map} +1 -1
  31. package/dist/chunks/{NumberField-Ccjpa_1d.cjs → NumberField-BrWFmPkW.cjs} +2 -2
  32. package/dist/chunks/{NumberField-Ccjpa_1d.cjs.map → NumberField-BrWFmPkW.cjs.map} +1 -1
  33. package/dist/chunks/{NumberField-CVsK4l9P.js → NumberField-C90eJGny.js} +13 -13
  34. package/dist/chunks/{NumberField-CVsK4l9P.js.map → NumberField-C90eJGny.js.map} +1 -1
  35. package/dist/chunks/RichTextEditor-BXyhSeJd.cjs +2 -0
  36. package/dist/chunks/RichTextEditor-BXyhSeJd.cjs.map +1 -0
  37. package/dist/chunks/RichTextEditor-DmNM63Wg.js +1123 -0
  38. package/dist/chunks/RichTextEditor-DmNM63Wg.js.map +1 -0
  39. package/dist/chunks/use-picker-session-BDEWL2jK.js +712 -0
  40. package/dist/chunks/use-picker-session-BDEWL2jK.js.map +1 -0
  41. package/dist/chunks/use-picker-session-C4FGinLN.cjs +2 -0
  42. package/dist/chunks/use-picker-session-C4FGinLN.cjs.map +1 -0
  43. package/dist/components/AssetCard/index.cjs +1 -1
  44. package/dist/components/AssetCard/index.js +1 -1
  45. package/dist/components/AssetGrid/index.cjs +1 -1
  46. package/dist/components/AssetGrid/index.js +1 -1
  47. package/dist/components/Banner/index.cjs +1 -1
  48. package/dist/components/Banner/index.js +1 -1
  49. package/dist/components/Board/index.cjs +1 -1
  50. package/dist/components/Board/index.js +1 -1
  51. package/dist/components/Button/index.cjs +1 -1
  52. package/dist/components/Button/index.js +1 -1
  53. package/dist/components/ColourField/index.cjs +1 -1
  54. package/dist/components/ColourField/index.js +1 -1
  55. package/dist/components/DatePicker/index.cjs +1 -1
  56. package/dist/components/DatePicker/index.js +1 -1
  57. package/dist/components/EditLayout/index.cjs +1 -1
  58. package/dist/components/EditLayout/index.js +1 -1
  59. package/dist/components/EntryPicker/index.cjs +1 -1
  60. package/dist/components/EntryPicker/index.d.cts.map +1 -1
  61. package/dist/components/EntryPicker/index.d.ts.map +1 -1
  62. package/dist/components/EntryPicker/index.js +1 -1
  63. package/dist/components/EntryPicker/use-picker-session.d.cts +110 -0
  64. package/dist/components/EntryPicker/use-picker-session.d.cts.map +1 -0
  65. package/dist/components/EntryPicker/use-picker-session.d.ts +110 -0
  66. package/dist/components/EntryPicker/use-picker-session.d.ts.map +1 -0
  67. package/dist/components/EntryPicker/use-selected-items.d.cts +9 -2
  68. package/dist/components/EntryPicker/use-selected-items.d.cts.map +1 -1
  69. package/dist/components/EntryPicker/use-selected-items.d.ts +9 -2
  70. package/dist/components/EntryPicker/use-selected-items.d.ts.map +1 -1
  71. package/dist/components/FormEditor/README.md +118 -0
  72. package/dist/components/FormEditor/control.d.cts +3 -1
  73. package/dist/components/FormEditor/control.d.cts.map +1 -1
  74. package/dist/components/FormEditor/control.d.ts +3 -1
  75. package/dist/components/FormEditor/control.d.ts.map +1 -1
  76. package/dist/components/FormEditor/index.cjs +1 -1
  77. package/dist/components/FormEditor/index.d.cts +3 -1
  78. package/dist/components/FormEditor/index.d.cts.map +1 -1
  79. package/dist/components/FormEditor/index.d.ts +3 -1
  80. package/dist/components/FormEditor/index.d.ts.map +1 -1
  81. package/dist/components/FormEditor/index.js +1 -1
  82. package/dist/components/FormEditor/model.d.cts.map +1 -1
  83. package/dist/components/FormEditor/model.d.ts.map +1 -1
  84. package/dist/components/Icon/icons.d.cts +3 -0
  85. package/dist/components/Icon/icons.d.cts.map +1 -1
  86. package/dist/components/Icon/icons.d.ts +3 -0
  87. package/dist/components/Icon/icons.d.ts.map +1 -1
  88. package/dist/components/Icon/index.cjs +1 -1
  89. package/dist/components/Icon/index.js +1 -1
  90. package/dist/components/NumberField/index.cjs +1 -1
  91. package/dist/components/NumberField/index.js +1 -1
  92. package/dist/components/RichTextEditor/document.d.cts +7 -1
  93. package/dist/components/RichTextEditor/document.d.cts.map +1 -1
  94. package/dist/components/RichTextEditor/document.d.ts +7 -1
  95. package/dist/components/RichTextEditor/document.d.ts.map +1 -1
  96. package/dist/components/RichTextEditor/embed-context.d.cts +36 -0
  97. package/dist/components/RichTextEditor/embed-context.d.cts.map +1 -0
  98. package/dist/components/RichTextEditor/embed-context.d.ts +36 -0
  99. package/dist/components/RichTextEditor/embed-context.d.ts.map +1 -0
  100. package/dist/components/RichTextEditor/embed-types.d.cts +27 -0
  101. package/dist/components/RichTextEditor/embed-types.d.cts.map +1 -0
  102. package/dist/components/RichTextEditor/embed-types.d.ts +27 -0
  103. package/dist/components/RichTextEditor/embed-types.d.ts.map +1 -0
  104. package/dist/components/RichTextEditor/expansion.d.cts +6 -1
  105. package/dist/components/RichTextEditor/expansion.d.cts.map +1 -1
  106. package/dist/components/RichTextEditor/expansion.d.ts +6 -1
  107. package/dist/components/RichTextEditor/expansion.d.ts.map +1 -1
  108. package/dist/components/RichTextEditor/index.cjs +1 -1
  109. package/dist/components/RichTextEditor/index.d.cts +4 -0
  110. package/dist/components/RichTextEditor/index.d.cts.map +1 -1
  111. package/dist/components/RichTextEditor/index.d.ts +4 -0
  112. package/dist/components/RichTextEditor/index.d.ts.map +1 -1
  113. package/dist/components/RichTextEditor/index.js +1 -1
  114. package/dist/components/RichTextEditor/storyblock-view.d.cts +3 -0
  115. package/dist/components/RichTextEditor/storyblock-view.d.cts.map +1 -0
  116. package/dist/components/RichTextEditor/storyblock-view.d.ts +3 -0
  117. package/dist/components/RichTextEditor/storyblock-view.d.ts.map +1 -0
  118. package/dist/components/RichTextEditor/storyblock.d.cts +19 -0
  119. package/dist/components/RichTextEditor/storyblock.d.cts.map +1 -0
  120. package/dist/components/RichTextEditor/storyblock.d.ts +19 -0
  121. package/dist/components/RichTextEditor/storyblock.d.ts.map +1 -0
  122. package/dist/components/RichTextEditor/style.css +147 -0
  123. package/dist/components/RichTextEditor/use-embeds.d.cts +31 -0
  124. package/dist/components/RichTextEditor/use-embeds.d.cts.map +1 -0
  125. package/dist/components/RichTextEditor/use-embeds.d.ts +31 -0
  126. package/dist/components/RichTextEditor/use-embeds.d.ts.map +1 -0
  127. package/dist/components/SearchField/index.cjs +1 -1
  128. package/dist/components/SearchField/index.js +1 -1
  129. package/dist/components/Select/index.cjs +1 -1
  130. package/dist/components/Select/index.js +1 -1
  131. package/dist/components/SideNav/index.cjs +1 -1
  132. package/dist/components/SideNav/index.js +1 -1
  133. package/dist/components/SortableList/index.cjs +1 -1
  134. package/dist/components/SortableList/index.js +1 -1
  135. package/dist/components/Stepper/index.cjs +1 -1
  136. package/dist/components/Stepper/index.js +1 -1
  137. package/dist/components/SubNav/index.cjs +1 -1
  138. package/dist/components/SubNav/index.js +1 -1
  139. package/dist/components/Table/index.cjs +1 -1
  140. package/dist/components/Table/index.js +1 -1
  141. package/dist/components/Toast/index.cjs +1 -1
  142. package/dist/components/Toast/index.js +1 -1
  143. package/dist/components/TopNav/index.cjs +1 -1
  144. package/dist/components/TopNav/index.js +1 -1
  145. package/dist/index.cjs +1 -1
  146. package/dist/index.d.cts +1 -1
  147. package/dist/index.d.cts.map +1 -1
  148. package/dist/index.d.ts +1 -1
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +18 -18
  151. package/package.json +1 -1
  152. package/dist/chunks/EntryPicker-BhApdZtE.cjs +0 -2
  153. package/dist/chunks/EntryPicker-BhApdZtE.cjs.map +0 -1
  154. package/dist/chunks/EntryPicker-LBj_56_e.js +0 -803
  155. package/dist/chunks/EntryPicker-LBj_56_e.js.map +0 -1
  156. package/dist/chunks/FormEditor-B5A38LZ4.cjs +0 -2
  157. package/dist/chunks/FormEditor-B5A38LZ4.cjs.map +0 -1
  158. package/dist/chunks/FormEditor-BEOp5EW-.js.map +0 -1
  159. package/dist/chunks/Icon-WOhlu6Rp.cjs +0 -2
  160. package/dist/chunks/Icon-WOhlu6Rp.cjs.map +0 -1
  161. package/dist/chunks/Icon-spaFBU4S.js +0 -85
  162. package/dist/chunks/Icon-spaFBU4S.js.map +0 -1
  163. package/dist/chunks/RichTextEditor-CuZnjiy2.js +0 -483
  164. package/dist/chunks/RichTextEditor-CuZnjiy2.js.map +0 -1
  165. package/dist/chunks/RichTextEditor-DcbLho2Q.cjs +0 -2
  166. package/dist/chunks/RichTextEditor-DcbLho2Q.cjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.cts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAkEA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgER,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"icons.d.cts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAqEA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmER,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
@@ -3,6 +3,9 @@
3
3
  * decision rather than an import someone typed at a call site.
4
4
  */
5
5
  export declare const icons: {
6
+ readonly "align-left": import("lucide-react").LucideIcon;
7
+ readonly "align-justify": import("lucide-react").LucideIcon;
8
+ readonly "align-right": import("lucide-react").LucideIcon;
6
9
  readonly "alert-triangle": import("lucide-react").LucideIcon;
7
10
  readonly archive: import("lucide-react").LucideIcon;
8
11
  readonly blocks: import("lucide-react").LucideIcon;
@@ -1 +1 @@
1
- {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAkEA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgER,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/icons.ts"],"names":[],"mappings":"AAqEA;;;GAGG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmER,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,KAAK,CAAC;AAE1C,eAAO,MAAM,SAAS,EAAyB,QAAQ,EAAE,CAAC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-WOhlu6Rp.cjs");exports.Icon=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/Icon-CD3oeiNA.cjs");exports.Icon=e.t;
@@ -1 +1 @@
1
- export { t as Icon } from "../../chunks/Icon-spaFBU4S.js";
1
+ export { t as Icon } from "../../chunks/Icon-CYXOo0Kt.js";
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/NumberField-Ccjpa_1d.cjs");exports.NumberField=e.t,exports.NumberRangeField=e.n;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../../chunks/NumberField-BrWFmPkW.cjs");exports.NumberField=e.t,exports.NumberRangeField=e.n;
@@ -1 +1 @@
1
- export { t as NumberField, n as NumberRangeField } from "../../chunks/NumberField-CVsK4l9P.js";
1
+ export { t as NumberField, n as NumberRangeField } from "../../chunks/NumberField-C90eJGny.js";
@@ -1,9 +1,15 @@
1
1
  import { type JSONContent } from "@tiptap/react";
2
+ import { Storyblock } from "./storyblock.cjs";
2
3
  export type RichTextDocument = JSONContent & {
3
4
  type: "doc";
4
5
  };
5
6
  export declare const emptyDocument: RichTextDocument;
6
- export declare function richTextExtensions(): (import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>)[];
7
+ /**
8
+ * The shared schema's extensions. The editor passes its node-view variant of
9
+ * `storyblock`; every call returns the same configured instances, so an editor
10
+ * keeps the same extension identities across renders.
11
+ */
12
+ export declare function richTextExtensions(storyblock?: typeof Storyblock): (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>)[];
7
13
  /** ProseMirror represents an empty writing surface with one empty paragraph. */
8
14
  export declare function normalizeDocument(document: RichTextDocument): RichTextDocument;
9
15
  export declare function documentError(value: unknown): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,gBAAoE,CAAC;AAEjG,wBAAgB,kBAAkB,gLAKjC;AAID,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAE9E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAsChE"}
1
+ {"version":3,"file":"document.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,gBAAoE,CAAC;AAOjG;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,OAAO,UAAuB,uNAE5E;AAID,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAE9E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA4ChE"}
@@ -1,9 +1,15 @@
1
1
  import { type JSONContent } from "@tiptap/react";
2
+ import { Storyblock } from "./storyblock.js";
2
3
  export type RichTextDocument = JSONContent & {
3
4
  type: "doc";
4
5
  };
5
6
  export declare const emptyDocument: RichTextDocument;
6
- export declare function richTextExtensions(): (import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>)[];
7
+ /**
8
+ * The shared schema's extensions. The editor passes its node-view variant of
9
+ * `storyblock`; every call returns the same configured instances, so an editor
10
+ * keeps the same extension identities across renders.
11
+ */
12
+ export declare function richTextExtensions(storyblock?: typeof Storyblock): (import("@tiptap/core").Node<any, any> | import("@tiptap/core").Extension<import("@tiptap/starter-kit").StarterKitOptions, any> | import("@tiptap/core").Mark<import("@tiptap/extension-link").LinkOptions, any>)[];
7
13
  /** ProseMirror represents an empty writing surface with one empty paragraph. */
8
14
  export declare function normalizeDocument(document: RichTextDocument): RichTextDocument;
9
15
  export declare function documentError(value: unknown): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAI5D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,gBAAoE,CAAC;AAEjG,wBAAgB,kBAAkB,gLAKjC;AAID,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAE9E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAsChE"}
1
+ {"version":3,"file":"document.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/document.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5D,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAE3D,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG;IAAE,IAAI,EAAE,KAAK,CAAA;CAAE,CAAC;AAE7D,eAAO,MAAM,aAAa,EAAE,gBAAoE,CAAC;AAOjG;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,GAAE,OAAO,UAAuB,uNAE5E;AAID,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,gBAAgB,CAE9E;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CA4ChE"}
@@ -0,0 +1,36 @@
1
+ import type { EntryItem } from "../EntryPicker/index.cjs";
2
+ import type { SeedCopy } from "../EntryPicker/use-selected-items.cjs";
3
+ import type { RichTextEmbedKind, RichTextEmbedSource } from "./embed-types.cjs";
4
+ /** Whether a source can offer something to embed: choices to list, or one to create. */
5
+ export declare function canEmbed(source: RichTextEmbedSource | undefined): boolean;
6
+ /**
7
+ * What a block's node view reads from its source. Callbacks are stable wrappers
8
+ * over the latest source and the rest are plain values, so an application that
9
+ * builds new sources on every render doesn't re-render every block.
10
+ */
11
+ export interface EmbedSourceView {
12
+ resolveItem?: (id: string) => EntryItem | null | Promise<EntryItem | null>;
13
+ refreshKey?: string | number;
14
+ items?: EntryItem[];
15
+ isDialogHidden: boolean;
16
+ /** The source can list or create a replacement. */
17
+ canEmbed: boolean;
18
+ onEditItem?: (item: EntryItem) => void;
19
+ }
20
+ export declare const EmbedContext: import("react").Context<{
21
+ views: Partial<Record<RichTextEmbedKind, EmbedSourceView>>;
22
+ disabled: boolean;
23
+ /** A picker session is suspended or creating: starting another would orphan it. */
24
+ busy: boolean;
25
+ replace: (kind: RichTextEmbedKind, position: number) => void;
26
+ /**
27
+ * Changes with each pick. Picking a block's own item again leaves an equal node
28
+ * that ProseMirror doesn't re-render, so blocks re-read `seed` when it changes.
29
+ */
30
+ pickCount: number;
31
+ /** The row a writer just picked for this item, so its new block shows it at once. */
32
+ seed: (kind: RichTextEmbedKind, id: string) => SeedCopy | undefined;
33
+ /** The block has shown `copy`; later blocks for the item describe it afresh. */
34
+ forgetSeed: (kind: RichTextEmbedKind, id: string, copy: SeedCopy) => void;
35
+ }>;
36
+ //# sourceMappingURL=embed-context.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-context.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/embed-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE5E,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,WAE/D;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC3E,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,YAAY;WAChB,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;cAChD,OAAO;IACjB,mFAAmF;UAC7E,OAAO;aACJ,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI;IAC5D;;;OAGG;eACQ,MAAM;IACjB,qFAAqF;UAC/E,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS;IACnE,gFAAgF;gBACpE,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI;EASzE,CAAC"}
@@ -0,0 +1,36 @@
1
+ import type { EntryItem } from "../EntryPicker/index.js";
2
+ import type { SeedCopy } from "../EntryPicker/use-selected-items.js";
3
+ import type { RichTextEmbedKind, RichTextEmbedSource } from "./embed-types.js";
4
+ /** Whether a source can offer something to embed: choices to list, or one to create. */
5
+ export declare function canEmbed(source: RichTextEmbedSource | undefined): boolean;
6
+ /**
7
+ * What a block's node view reads from its source. Callbacks are stable wrappers
8
+ * over the latest source and the rest are plain values, so an application that
9
+ * builds new sources on every render doesn't re-render every block.
10
+ */
11
+ export interface EmbedSourceView {
12
+ resolveItem?: (id: string) => EntryItem | null | Promise<EntryItem | null>;
13
+ refreshKey?: string | number;
14
+ items?: EntryItem[];
15
+ isDialogHidden: boolean;
16
+ /** The source can list or create a replacement. */
17
+ canEmbed: boolean;
18
+ onEditItem?: (item: EntryItem) => void;
19
+ }
20
+ export declare const EmbedContext: import("react").Context<{
21
+ views: Partial<Record<RichTextEmbedKind, EmbedSourceView>>;
22
+ disabled: boolean;
23
+ /** A picker session is suspended or creating: starting another would orphan it. */
24
+ busy: boolean;
25
+ replace: (kind: RichTextEmbedKind, position: number) => void;
26
+ /**
27
+ * Changes with each pick. Picking a block's own item again leaves an equal node
28
+ * that ProseMirror doesn't re-render, so blocks re-read `seed` when it changes.
29
+ */
30
+ pickCount: number;
31
+ /** The row a writer just picked for this item, so its new block shows it at once. */
32
+ seed: (kind: RichTextEmbedKind, id: string) => SeedCopy | undefined;
33
+ /** The block has shown `copy`; later blocks for the item describe it afresh. */
34
+ forgetSeed: (kind: RichTextEmbedKind, id: string, copy: SeedCopy) => void;
35
+ }>;
36
+ //# sourceMappingURL=embed-context.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-context.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/embed-context.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,KAAK,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE5E,wFAAwF;AACxF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,SAAS,WAE/D;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,WAAW,CAAC,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,GAAG,IAAI,GAAG,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC,CAAC;IAC3E,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,cAAc,EAAE,OAAO,CAAC;IACxB,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,SAAS,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,YAAY;WAChB,OAAO,CAAC,MAAM,CAAC,iBAAiB,EAAE,eAAe,CAAC,CAAC;cAChD,OAAO;IACjB,mFAAmF;UAC7E,OAAO;aACJ,CAAC,IAAI,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,KAAK,IAAI;IAC5D;;;OAGG;eACQ,MAAM;IACjB,qFAAqF;UAC/E,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,KAAK,QAAQ,GAAG,SAAS;IACnE,gFAAgF;gBACpE,CAAC,IAAI,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,KAAK,IAAI;EASzE,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { EntryItem, EntryPickerSource } from "../EntryPicker/index.cjs";
2
+ /** Entry rows supplied for embedding carry their model's readable API ID. */
3
+ export interface RichTextEmbedItem extends EntryItem {
4
+ modelId?: string;
5
+ }
6
+ export interface RichTextEmbedTarget {
7
+ available: () => boolean;
8
+ /** Returns false when the editor or bookmarked target is no longer available. */
9
+ commit: (item: RichTextEmbedItem) => boolean;
10
+ }
11
+ /**
12
+ * A block holds one item, so the picker always chooses one: EntryPicker's
13
+ * `mode` and `max` don't apply. Embedding is offered when the source can list
14
+ * choices (`loadPage` or `items`) or create one (`onCreate`); a source with
15
+ * only `resolveItem` displays existing blocks.
16
+ */
17
+ export interface RichTextEmbedSource extends Omit<EntryPickerSource, "onCreate" | "mode" | "max"> {
18
+ /** Static choices, searched by title and keywords, when there is no `loadPage`. */
19
+ items?: RichTextEmbedItem[];
20
+ onCreate?: (target: RichTextEmbedTarget) => void;
21
+ }
22
+ export interface RichTextEmbedSources {
23
+ entry?: RichTextEmbedSource;
24
+ asset?: RichTextEmbedSource;
25
+ }
26
+ export type RichTextEmbedKind = keyof RichTextEmbedSources;
27
+ //# sourceMappingURL=embed-types.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-types.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/embed-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,6EAA6E;AAC7E,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,iFAAiF;IACjF,MAAM,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC;CAC9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;IAC/F,mFAAmF;IACnF,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,27 @@
1
+ import type { EntryItem, EntryPickerSource } from "../EntryPicker/index.js";
2
+ /** Entry rows supplied for embedding carry their model's readable API ID. */
3
+ export interface RichTextEmbedItem extends EntryItem {
4
+ modelId?: string;
5
+ }
6
+ export interface RichTextEmbedTarget {
7
+ available: () => boolean;
8
+ /** Returns false when the editor or bookmarked target is no longer available. */
9
+ commit: (item: RichTextEmbedItem) => boolean;
10
+ }
11
+ /**
12
+ * A block holds one item, so the picker always chooses one: EntryPicker's
13
+ * `mode` and `max` don't apply. Embedding is offered when the source can list
14
+ * choices (`loadPage` or `items`) or create one (`onCreate`); a source with
15
+ * only `resolveItem` displays existing blocks.
16
+ */
17
+ export interface RichTextEmbedSource extends Omit<EntryPickerSource, "onCreate" | "mode" | "max"> {
18
+ /** Static choices, searched by title and keywords, when there is no `loadPage`. */
19
+ items?: RichTextEmbedItem[];
20
+ onCreate?: (target: RichTextEmbedTarget) => void;
21
+ }
22
+ export interface RichTextEmbedSources {
23
+ entry?: RichTextEmbedSource;
24
+ asset?: RichTextEmbedSource;
25
+ }
26
+ export type RichTextEmbedKind = keyof RichTextEmbedSources;
27
+ //# sourceMappingURL=embed-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-types.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/embed-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAEnE,6EAA6E;AAC7E,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,OAAO,CAAC;IACzB,iFAAiF;IACjF,MAAM,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC;CAC9C;AAED;;;;;GAKG;AACH,MAAM,WAAW,mBAAoB,SAAQ,IAAI,CAAC,iBAAiB,EAAE,UAAU,GAAG,MAAM,GAAG,KAAK,CAAC;IAC/F,mFAAmF;IACnF,KAAK,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,mBAAmB,KAAK,IAAI,CAAC;CAClD;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,CAAC,EAAE,mBAAmB,CAAC;IAC5B,KAAK,CAAC,EAAE,mBAAmB,CAAC;CAC7B;AAED,MAAM,MAAM,iBAAiB,GAAG,MAAM,oBAAoB,CAAC"}
@@ -5,6 +5,11 @@ export type { RichTextEditorExpandedWidth } from "./expanded-width.cjs";
5
5
  interface EditorExpansionOptions {
6
6
  editor: Editor | null;
7
7
  disabled: boolean;
8
+ /**
9
+ * Keep an expanded view open while disabled: an embed's source is completing
10
+ * a creation, and its block lands where the writer is working.
11
+ */
12
+ isHeld?: boolean;
8
13
  invalid: boolean;
9
14
  label: string;
10
15
  labelledBy?: string;
@@ -18,7 +23,7 @@ interface EditorExpansionOptions {
18
23
  * every toggle. Modal owns the scrim, frame, dialog stack, focus trap, scroll
19
24
  * lock and Escape.
20
25
  */
21
- export declare function useEditorExpansion({ editor, disabled, invalid, label, labelledBy, expandedWidth, frameRef, }: EditorExpansionOptions): {
26
+ export declare function useEditorExpansion({ editor, disabled, isHeld, invalid, label, labelledBy, expandedWidth, frameRef, }: EditorExpansionOptions): {
22
27
  expanded: boolean;
23
28
  toggle: import("react").JSX.Element;
24
29
  surfaceSlot: (surface: ReactNode) => import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"expansion.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/expansion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAEpE,YAAY,EAAE,2BAA2B,EAAE,MAAM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AAQ,EACR,MAAc,EACd,OAAO,EACP,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE,sBAAsB;;;2BA8EO,SAAS;;;EAkCxC"}
@@ -5,6 +5,11 @@ export type { RichTextEditorExpandedWidth } from "./expanded-width.js";
5
5
  interface EditorExpansionOptions {
6
6
  editor: Editor | null;
7
7
  disabled: boolean;
8
+ /**
9
+ * Keep an expanded view open while disabled: an embed's source is completing
10
+ * a creation, and its block lands where the writer is working.
11
+ */
12
+ isHeld?: boolean;
8
13
  invalid: boolean;
9
14
  label: string;
10
15
  labelledBy?: string;
@@ -18,7 +23,7 @@ interface EditorExpansionOptions {
18
23
  * every toggle. Modal owns the scrim, frame, dialog stack, focus trap, scroll
19
24
  * lock and Escape.
20
25
  */
21
- export declare function useEditorExpansion({ editor, disabled, invalid, label, labelledBy, expandedWidth, frameRef, }: EditorExpansionOptions): {
26
+ export declare function useEditorExpansion({ editor, disabled, isHeld, invalid, label, labelledBy, expandedWidth, frameRef, }: EditorExpansionOptions): {
22
27
  expanded: boolean;
23
28
  toggle: import("react").JSX.Element;
24
29
  surfaceSlot: (surface: ReactNode) => import("react").JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"expansion.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/expansion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAEpE,YAAY,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAmBpE,UAAU,sBAAsB;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,2BAA2B,CAAC;IAC3C,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,OAAO,EACP,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE,sBAAsB;;;2BA8EO,SAAS;;;EAkCxC"}
1
+ {"version":3,"file":"expansion.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/expansion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAM5C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAEpE,YAAY,EAAE,2BAA2B,EAAE,MAAM,kBAAkB,CAAC;AAmBpE,UAAU,sBAAsB;IAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,QAAQ,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,2BAA2B,CAAC;IAC3C,QAAQ,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;CAC5C;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,QAAQ,EACR,MAAc,EACd,OAAO,EACP,KAAK,EACL,UAAU,EACV,aAAa,EACb,QAAQ,GACT,EAAE,sBAAsB;;;2BA8EO,SAAS;;;EAkCxC"}
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../Field/index.cjs");const e=require("../../chunks/RichTextEditor-DcbLho2Q.cjs");exports.RichTextEditor=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require("../Field/index.cjs");const e=require("../../chunks/RichTextEditor-BXyhSeJd.cjs");exports.RichTextEditor=e.t;
@@ -2,6 +2,9 @@ import { type ReactNode } from "react";
2
2
  import { type RichTextEditorExpandedWidth } from "./expansion.cjs";
3
3
  import { type RichTextDocument } from "./document.cjs";
4
4
  import type { FieldBinding } from "../Field/index.cjs";
5
+ import type { RichTextEmbedSources } from "./embed-types.cjs";
6
+ export type { RichTextEmbedItem, RichTextEmbedSource, RichTextEmbedSources, RichTextEmbedTarget, } from "./embed-types.cjs";
7
+ export type { StoryblockAlignment, StoryblockIdentity, StoryblockAttributes } from "./storyblock.cjs";
5
8
  export type RichTextEditorSize = "sm" | "md" | "lg";
6
9
  export type { RichTextDocument } from "./document.cjs";
7
10
  export type { RichTextEditorExpandedWidth } from "./expansion.cjs";
@@ -17,6 +20,7 @@ interface RichTextEditorCommonProps extends FieldBinding {
17
20
  className?: string;
18
21
  /** Extra controls appended to the toolbar, e.g. a word count. */
19
22
  toolbarExtra?: ReactNode;
23
+ embeds?: RichTextEmbedSources;
20
24
  isRequired?: boolean;
21
25
  }
22
26
  export type RichTextEditorProps = RichTextEditorCommonProps & ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAmBf,OAAO,EAAsB,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,aAAa,CAAC;AAErB,MAAM,M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AAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC7F;IACE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACjD,CACJ,CAAC;AAgaJ,eAAO,MAAM,cAAc,gHA6N1B,CAAC"}
@@ -2,6 +2,9 @@ import { type ReactNode } from "react";
2
2
  import { type RichTextEditorExpandedWidth } from "./expansion.js";
3
3
  import { type RichTextDocument } from "./document.js";
4
4
  import type { FieldBinding } from "../Field/index.js";
5
+ import type { RichTextEmbedSources } from "./embed-types.js";
6
+ export type { RichTextEmbedItem, RichTextEmbedSource, RichTextEmbedSources, RichTextEmbedTarget, } from "./embed-types.js";
7
+ export type { StoryblockAlignment, StoryblockIdentity, StoryblockAttributes } from "./storyblock.js";
5
8
  export type RichTextEditorSize = "sm" | "md" | "lg";
6
9
  export type { RichTextDocument } from "./document.js";
7
10
  export type { RichTextEditorExpandedWidth } from "./expansion.js";
@@ -17,6 +20,7 @@ interface RichTextEditorCommonProps extends FieldBinding {
17
20
  className?: string;
18
21
  /** Extra controls appended to the toolbar, e.g. a word count. */
19
22
  toolbarExtra?: ReactNode;
23
+ embeds?: RichTextEmbedSources;
20
24
  isRequired?: boolean;
21
25
  }
22
26
  export type RichTextEditorProps = RichTextEditorCommonProps & ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAQL,KAAK,SAAS,EAEf,MAAM,OAAO,CAAC;AAmBf,OAAO,EAAsB,KAAK,2BAA2B,EAAE,MAAM,aAAa,CAAC;AACnF,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,YAAY,CAAC;AACpB,OAAO,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAAE,YAAY,EA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AC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;CAAE,GAC7F;IACE,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,gBAAgB,CAAC;IACzB,YAAY,CAAC,EAAE,gBAAgB,CAAC;IAChC,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACjD,CACJ,CAAC;AAgaJ,eAAO,MAAM,cAAc,gHA6N1B,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import "../Field/index.js";
2
- export { t as RichTextEditor } from "../../chunks/RichTextEditor-CuZnjiy2.js";
2
+ export { t as RichTextEditor } from "../../chunks/RichTextEditor-DmNM63Wg.js";
@@ -0,0 +1,3 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ export declare function StoryblockView({ node, selected, editor, getPos, updateAttributes, }: NodeViewProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=storyblock-view.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyblock-view.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock-view.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAwTpE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,EAAE,aAAa,+BAyFf"}
@@ -0,0 +1,3 @@
1
+ import { type NodeViewProps } from "@tiptap/react";
2
+ export declare function StoryblockView({ node, selected, editor, getPos, updateAttributes, }: NodeViewProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=storyblock-view.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyblock-view.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock-view.tsx"],"names":[],"mappings":"AAUA,OAAO,EAAmB,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAwTpE,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,MAAM,EACN,gBAAgB,GACjB,EAAE,aAAa,+BAyFf"}
@@ -0,0 +1,19 @@
1
+ import { Node, type JSONContent } from "@tiptap/react";
2
+ export type StoryblockAlignment = "left" | "full" | "right";
3
+ export type StoryblockIdentity = {
4
+ type: "entry";
5
+ id: string;
6
+ entryId: string;
7
+ } | {
8
+ type: "asset";
9
+ assetId: string;
10
+ };
11
+ export type StoryblockAttributes = StoryblockIdentity & {
12
+ align: StoryblockAlignment;
13
+ };
14
+ export declare function validStoryblock(attrs: Record<string, unknown>): boolean;
15
+ /** Strip schema defaults belonging to the other kind from the external document. */
16
+ export declare function storyblockDocument<T extends JSONContent>(node: T): T;
17
+ /** Schema and HTML representation contain references only, never resolved item data. */
18
+ export declare const Storyblock: Node<any, any>;
19
+ //# sourceMappingURL=storyblock.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyblock.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACtF,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IAAE,KAAK,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEvF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAQvE;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAgBpE;AAED,wFAAwF;AACxF,eAAO,MAAM,UAAU,gBAmDrB,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { Node, type JSONContent } from "@tiptap/react";
2
+ export type StoryblockAlignment = "left" | "full" | "right";
3
+ export type StoryblockIdentity = {
4
+ type: "entry";
5
+ id: string;
6
+ entryId: string;
7
+ } | {
8
+ type: "asset";
9
+ assetId: string;
10
+ };
11
+ export type StoryblockAttributes = StoryblockIdentity & {
12
+ align: StoryblockAlignment;
13
+ };
14
+ export declare function validStoryblock(attrs: Record<string, unknown>): boolean;
15
+ /** Strip schema defaults belonging to the other kind from the external document. */
16
+ export declare function storyblockDocument<T extends JSONContent>(node: T): T;
17
+ /** Schema and HTML representation contain references only, never resolved item data. */
18
+ export declare const Storyblock: Node<any, any>;
19
+ //# sourceMappingURL=storyblock.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storyblock.d.ts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/storyblock.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAmB,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAExE,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAC5D,MAAM,MAAM,kBAAkB,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AACtF,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,GAAG;IAAE,KAAK,EAAE,mBAAmB,CAAA;CAAE,CAAC;AAEvF,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAQvE;AAED,oFAAoF;AACpF,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,WAAW,EAAE,IAAI,EAAE,CAAC,GAAG,CAAC,CAgBpE;AAED,wFAAwF;AACxF,eAAO,MAAM,UAAU,gBAmDrB,CAAC"}
@@ -215,3 +215,150 @@
215
215
  overscroll-behavior: contain;
216
216
  }
217
217
  }
218
+
219
+ @layer components {
220
+ /* Contain floated blocks, only in documents that have them. */
221
+ .ds-rte__content
222
+ .tiptap:has(.ds-storyblock[data-align="left"], .ds-storyblock[data-align="right"]) {
223
+ display: flow-root;
224
+ }
225
+
226
+ .ds-rte__content .tiptap:has(.ds-storyblock) > p {
227
+ text-wrap: pretty;
228
+ }
229
+
230
+ .ds-storyblock {
231
+ --storyblock-bar-bg: var(--color-surface-subtle);
232
+ --storyblock-bar-border: var(--color-border);
233
+
234
+ display: flex;
235
+ flex-direction: column;
236
+ container: storyblock / inline-size;
237
+ overflow: hidden;
238
+ margin-block-end: var(--space-3);
239
+ border: var(--control-border-width) solid var(--color-text);
240
+ border-radius: var(--radius-md);
241
+ background: var(--color-surface);
242
+ font-size: var(--font-size-sm);
243
+ line-height: 1.3;
244
+ }
245
+
246
+ .ds-storyblock[data-align="full"] {
247
+ clear: both;
248
+ width: 100%;
249
+ }
250
+
251
+ /* Leave room for text beside the block, or use the full writing width below 32rem. */
252
+ .ds-storyblock[data-align="left"],
253
+ .ds-storyblock[data-align="right"] {
254
+ --storyblock-gutter: clamp(0px, (100% - 32rem) * 999, var(--space-4));
255
+
256
+ width: clamp(62%, (32rem - 100%) * 999, 100%);
257
+ }
258
+
259
+ .ds-storyblock[data-align="left"] {
260
+ float: left;
261
+ margin: var(--space-1) var(--storyblock-gutter) var(--space-3) 0;
262
+ }
263
+
264
+ .ds-storyblock[data-align="right"] {
265
+ float: right;
266
+ margin: var(--space-1) 0 var(--space-3) var(--storyblock-gutter);
267
+ }
268
+
269
+ .ds-storyblock[data-tone="draft"] {
270
+ --storyblock-bar-bg: var(--color-warning-soft);
271
+ --storyblock-bar-border: var(--color-warning-border);
272
+
273
+ border-color: var(--color-warning-border);
274
+ }
275
+
276
+ .ds-storyblock[data-selected] {
277
+ --storyblock-bar-bg: var(--color-primary-soft);
278
+ --storyblock-bar-border: color-mix(
279
+ in srgb,
280
+ var(--color-primary) 18%,
281
+ var(--color-primary-soft)
282
+ );
283
+
284
+ border-color: var(--color-primary);
285
+ outline: var(--control-border-width) solid var(--color-focus);
286
+ outline-offset: 2px;
287
+ }
288
+
289
+ .ds-storyblock[data-missing] {
290
+ --storyblock-bar-bg: var(--color-danger-soft);
291
+ --storyblock-bar-border: color-mix(in srgb, var(--color-danger) 18%, var(--color-danger-soft));
292
+
293
+ border-color: var(--color-danger);
294
+ border-style: dashed;
295
+ }
296
+
297
+ .ds-storyblock[data-missing] .ds-storyblock__kind-label {
298
+ --badge-ink: var(--color-danger-text);
299
+ }
300
+
301
+ .ds-storyblock__bar {
302
+ display: grid;
303
+ grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
304
+ align-items: center;
305
+ gap: var(--space-2);
306
+ min-block-size: var(--space-12);
307
+ padding: calc(var(--space-3) / 2) var(--space-2);
308
+ border-block-end: var(--rule-width) solid var(--storyblock-bar-border);
309
+ background: var(--storyblock-bar-bg);
310
+ }
311
+
312
+ .ds-storyblock__kind,
313
+ .ds-storyblock__actions {
314
+ display: flex;
315
+ align-items: center;
316
+ }
317
+
318
+ /* The drag handle fills its column and the bar's height. It holds no buttons. */
319
+ .ds-storyblock__kind {
320
+ align-self: stretch;
321
+ gap: var(--space-2);
322
+ color: var(--color-text-muted);
323
+ }
324
+
325
+ .ds-storyblock__kind[data-drag-handle] {
326
+ cursor: grab;
327
+ }
328
+
329
+ .ds-storyblock__kind-label {
330
+ width: fit-content;
331
+ }
332
+
333
+ .ds-storyblock__grip {
334
+ display: flex;
335
+ }
336
+
337
+ .ds-storyblock__actions {
338
+ justify-self: end;
339
+ gap: calc(var(--space-1) / 2);
340
+ }
341
+
342
+ .ds-storyblock__body {
343
+ padding: var(--space-3);
344
+ }
345
+
346
+ .ds-storyblock__body .ds-entry__meta code {
347
+ font-size: var(--font-size-xs);
348
+ }
349
+
350
+ .ds-storyblock__failure {
351
+ padding: 0 var(--space-3) var(--space-3);
352
+ }
353
+
354
+ /* Wrap the right-hand actions in a narrow block, without containing the editor. */
355
+ @container storyblock (width < 22.5rem) {
356
+ .ds-storyblock__bar {
357
+ grid-template-columns: 1fr auto;
358
+ }
359
+
360
+ .ds-storyblock__actions {
361
+ grid-column: 1 / -1;
362
+ }
363
+ }
364
+ }
@@ -0,0 +1,31 @@
1
+ import type { Editor } from "@tiptap/react";
2
+ import type { SeedCopy } from "../EntryPicker/use-selected-items.cjs";
3
+ import { type EmbedSourceView } from "./embed-context.cjs";
4
+ import type { RichTextEmbedKind, RichTextEmbedSources } from "./embed-types.cjs";
5
+ /**
6
+ * Marks the transaction that commits an embed: the one change a disabled
7
+ * editor reports, while the embed's source completes a creation.
8
+ */
9
+ export declare const embedCommitMeta = "ds-rte-embed-commit";
10
+ export declare function useEmbeds(editor: Editor | null, sources: RichTextEmbedSources | undefined, disabled: boolean, label: string): {
11
+ context: {
12
+ views: {
13
+ entry: EmbedSourceView | undefined;
14
+ asset: EmbedSourceView | undefined;
15
+ };
16
+ disabled: boolean;
17
+ busy: boolean;
18
+ pickCount: number;
19
+ replace: (kind: RichTextEmbedKind, position: number) => void;
20
+ seed: (kind: RichTextEmbedKind, id: string) => SeedCopy | undefined;
21
+ forgetSeed: (kind: RichTextEmbedKind, id: string, copy: SeedCopy) => void;
22
+ };
23
+ /**
24
+ * A source is completing a creation, which its app may hold the editor read
25
+ * only for, from the dialog until it clears `isCreating` after the commit.
26
+ */
27
+ isCreating: boolean;
28
+ toolbar: false | import("react").JSX.Element;
29
+ dialog: import("react").JSX.Element | null | undefined;
30
+ };
31
+ //# sourceMappingURL=use-embeds.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-embeds.d.cts","sourceRoot":"","sources":["../../../src/components/RichTextEditor/use-embeds.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAgB,MAAM,eAAe,CAAC;AAM1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAElE,OAAO,EAAY,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEjE,OAAO,KAAK,EAEV,iBAAiB,EAEjB,oBAAoB,EAErB,MAAM,eAAe,CAAC;AAMvB;;;GAGG;AACH,eAAO,MAAM,eAAe,wBAAwB,CAAC;AA4NrD,wBAAgB,SAAS,CACvB,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,OAAO,EAAE,oBAAoB,YAAY,EACzC,QAAQ,EAAE,OAAO,EACjB,KAAK,EAAE,MAAM;;;;;;;;;wBAuJK,iBAAiB,YAAY,MAAM;qBACtC,iBAAiB,MAAM,MAAM;2BAEvB,iBAAiB,MAAM,MAAM,QAAQ,QAAQ;;IAmChE;;;OAGG;;;;EAqCN"}