@agent-native/core 0.109.3 → 0.109.4

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 (249) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +8 -0
  3. package/corpus/core/docs/content/agent-native-toolkit.mdx +46 -13
  4. package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +79 -55
  5. package/corpus/core/docs/content/locales/ar-SA/toolkit-capability-packages.mdx +21 -0
  6. package/corpus/core/docs/content/locales/ar-SA/toolkit-context-knowledge.mdx +12 -0
  7. package/corpus/core/docs/content/locales/ar-SA/toolkit-editors-canvases.mdx +17 -0
  8. package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +82 -54
  9. package/corpus/core/docs/content/locales/de-DE/toolkit-capability-packages.mdx +21 -0
  10. package/corpus/core/docs/content/locales/de-DE/toolkit-context-knowledge.mdx +12 -0
  11. package/corpus/core/docs/content/locales/de-DE/toolkit-editors-canvases.mdx +17 -0
  12. package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +81 -52
  13. package/corpus/core/docs/content/locales/es-ES/toolkit-capability-packages.mdx +21 -0
  14. package/corpus/core/docs/content/locales/es-ES/toolkit-context-knowledge.mdx +12 -0
  15. package/corpus/core/docs/content/locales/es-ES/toolkit-editors-canvases.mdx +21 -0
  16. package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +84 -54
  17. package/corpus/core/docs/content/locales/fr-FR/toolkit-capability-packages.mdx +21 -0
  18. package/corpus/core/docs/content/locales/fr-FR/toolkit-context-knowledge.mdx +12 -0
  19. package/corpus/core/docs/content/locales/fr-FR/toolkit-editors-canvases.mdx +21 -0
  20. package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +69 -62
  21. package/corpus/core/docs/content/locales/hi-IN/toolkit-capability-packages.mdx +21 -0
  22. package/corpus/core/docs/content/locales/hi-IN/toolkit-context-knowledge.mdx +12 -0
  23. package/corpus/core/docs/content/locales/hi-IN/toolkit-editors-canvases.mdx +17 -0
  24. package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +69 -62
  25. package/corpus/core/docs/content/locales/ja-JP/toolkit-capability-packages.mdx +21 -0
  26. package/corpus/core/docs/content/locales/ja-JP/toolkit-context-knowledge.mdx +12 -0
  27. package/corpus/core/docs/content/locales/ja-JP/toolkit-editors-canvases.mdx +17 -0
  28. package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +69 -62
  29. package/corpus/core/docs/content/locales/ko-KR/toolkit-capability-packages.mdx +21 -0
  30. package/corpus/core/docs/content/locales/ko-KR/toolkit-context-knowledge.mdx +12 -0
  31. package/corpus/core/docs/content/locales/ko-KR/toolkit-editors-canvases.mdx +17 -0
  32. package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +82 -54
  33. package/corpus/core/docs/content/locales/pt-BR/toolkit-capability-packages.mdx +21 -0
  34. package/corpus/core/docs/content/locales/pt-BR/toolkit-context-knowledge.mdx +12 -0
  35. package/corpus/core/docs/content/locales/pt-BR/toolkit-editors-canvases.mdx +17 -0
  36. package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +69 -62
  37. package/corpus/core/docs/content/locales/zh-CN/toolkit-capability-packages.mdx +21 -0
  38. package/corpus/core/docs/content/locales/zh-CN/toolkit-context-knowledge.mdx +12 -0
  39. package/corpus/core/docs/content/locales/zh-CN/toolkit-editors-canvases.mdx +17 -0
  40. package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +69 -62
  41. package/corpus/core/docs/content/locales/zh-TW/toolkit-capability-packages.mdx +21 -0
  42. package/corpus/core/docs/content/locales/zh-TW/toolkit-context-knowledge.mdx +12 -0
  43. package/corpus/core/docs/content/locales/zh-TW/toolkit-editors-canvases.mdx +17 -0
  44. package/corpus/core/docs/content/toolkit-capability-packages.mdx +52 -0
  45. package/corpus/core/docs/content/toolkit-context-knowledge.mdx +46 -0
  46. package/corpus/core/docs/content/toolkit-editors-canvases.mdx +55 -0
  47. package/corpus/core/package.json +35 -34
  48. package/corpus/core/src/cli/create.ts +39 -3
  49. package/corpus/core/src/cli/package-lifecycle.ts +2 -0
  50. package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +2 -0
  51. package/corpus/core/src/client/context-xray/ContextMeter.tsx +31 -111
  52. package/corpus/core/src/client/context-xray/ContextSegmentRow.tsx +8 -111
  53. package/corpus/core/src/client/context-xray/ContextTreemap.tsx +6 -111
  54. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +31 -391
  55. package/corpus/core/src/client/context-xray/SegmentProvenancePopover.tsx +4 -52
  56. package/corpus/core/src/client/context-xray/format.ts +0 -33
  57. package/corpus/core/src/client/rich-markdown-editor/index.ts +42 -57
  58. package/corpus/core/src/client/rich-markdown-editor/uploadEditorImage.ts +2 -1
  59. package/corpus/core/src/client/visual-style-controls.tsx +1 -1088
  60. package/corpus/core/src/collab/agent-identity.ts +5 -22
  61. package/corpus/core/src/collab/client.ts +1 -53
  62. package/corpus/core/src/styles/rich-markdown-editor.css +1 -510
  63. package/corpus/core/src/testing.ts +1 -1
  64. package/corpus/core/src/vite/client.ts +3 -0
  65. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +5 -3
  66. package/corpus/templates/content/app/components/editor/extensions/DragHandle.tsx +4 -4
  67. package/corpus/templates/content/package.json +25 -25
  68. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
  69. package/corpus/templates/design/package.json +1 -1
  70. package/corpus/templates/mail/package.json +9 -9
  71. package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +2 -0
  72. package/corpus/templates/plan/app/components/editor/PlanDocumentEditor.tsx +8 -8
  73. package/corpus/templates/plan/app/components/editor/planSlashCommands.ts +6 -6
  74. package/corpus/templates/plan/app/components/plan/PlanImageNode.tsx +4 -7
  75. package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +6 -4
  76. package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +1 -1
  77. package/corpus/templates/plan/changelog/2026-07-18-visual-plans-now-open-on-wireframes-by-default-when-a-protot.md +6 -0
  78. package/corpus/templates/plan/package.json +3 -3
  79. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +2 -2
  80. package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +2 -2
  81. package/corpus/templates/slides/package.json +13 -13
  82. package/dist/catalog.json +39 -1
  83. package/dist/cli/create.d.ts.map +1 -1
  84. package/dist/cli/create.js +32 -3
  85. package/dist/cli/create.js.map +1 -1
  86. package/dist/cli/package-lifecycle.d.ts.map +1 -1
  87. package/dist/cli/package-lifecycle.js +2 -0
  88. package/dist/cli/package-lifecycle.js.map +1 -1
  89. package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
  90. package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
  91. package/dist/cli/skills-content/visual-plan-skill.js +2 -0
  92. package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
  93. package/dist/client/context-xray/ContextMeter.d.ts.map +1 -1
  94. package/dist/client/context-xray/ContextMeter.js +8 -23
  95. package/dist/client/context-xray/ContextMeter.js.map +1 -1
  96. package/dist/client/context-xray/ContextSegmentRow.d.ts.map +1 -1
  97. package/dist/client/context-xray/ContextSegmentRow.js +3 -19
  98. package/dist/client/context-xray/ContextSegmentRow.js.map +1 -1
  99. package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
  100. package/dist/client/context-xray/ContextTreemap.js +3 -54
  101. package/dist/client/context-xray/ContextTreemap.js.map +1 -1
  102. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
  103. package/dist/client/context-xray/ContextXRayPanel.js +21 -163
  104. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  105. package/dist/client/context-xray/SegmentProvenancePopover.d.ts.map +1 -1
  106. package/dist/client/context-xray/SegmentProvenancePopover.js +3 -4
  107. package/dist/client/context-xray/SegmentProvenancePopover.js.map +1 -1
  108. package/dist/client/context-xray/format.d.ts +0 -4
  109. package/dist/client/context-xray/format.d.ts.map +1 -1
  110. package/dist/client/context-xray/format.js +0 -49
  111. package/dist/client/context-xray/format.js.map +1 -1
  112. package/dist/client/rich-markdown-editor/index.d.ts +1 -12
  113. package/dist/client/rich-markdown-editor/index.d.ts.map +1 -1
  114. package/dist/client/rich-markdown-editor/index.js +1 -12
  115. package/dist/client/rich-markdown-editor/index.js.map +1 -1
  116. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts +1 -1
  117. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +1 -1
  118. package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +1 -1
  119. package/dist/client/visual-style-controls.d.ts +1 -89
  120. package/dist/client/visual-style-controls.d.ts.map +1 -1
  121. package/dist/client/visual-style-controls.js +1 -498
  122. package/dist/client/visual-style-controls.js.map +1 -1
  123. package/dist/collab/agent-identity.d.ts +1 -14
  124. package/dist/collab/agent-identity.d.ts.map +1 -1
  125. package/dist/collab/agent-identity.js +1 -13
  126. package/dist/collab/agent-identity.js.map +1 -1
  127. package/dist/collab/awareness.d.ts +2 -2
  128. package/dist/collab/awareness.d.ts.map +1 -1
  129. package/dist/collab/client.d.ts +1 -19
  130. package/dist/collab/client.d.ts.map +1 -1
  131. package/dist/collab/client.js +1 -53
  132. package/dist/collab/client.js.map +1 -1
  133. package/dist/collab/routes.d.ts +1 -1
  134. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  135. package/dist/notifications/routes.d.ts +3 -3
  136. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  137. package/dist/styles/rich-markdown-editor.css +1 -510
  138. package/dist/testing.d.ts +1 -1
  139. package/dist/testing.d.ts.map +1 -1
  140. package/dist/testing.js +1 -1
  141. package/dist/testing.js.map +1 -1
  142. package/dist/vite/client.d.ts.map +1 -1
  143. package/dist/vite/client.js +3 -0
  144. package/dist/vite/client.js.map +1 -1
  145. package/docs/content/agent-native-toolkit.mdx +46 -13
  146. package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +79 -55
  147. package/docs/content/locales/ar-SA/toolkit-capability-packages.mdx +21 -0
  148. package/docs/content/locales/ar-SA/toolkit-context-knowledge.mdx +12 -0
  149. package/docs/content/locales/ar-SA/toolkit-editors-canvases.mdx +17 -0
  150. package/docs/content/locales/de-DE/agent-native-toolkit.mdx +82 -54
  151. package/docs/content/locales/de-DE/toolkit-capability-packages.mdx +21 -0
  152. package/docs/content/locales/de-DE/toolkit-context-knowledge.mdx +12 -0
  153. package/docs/content/locales/de-DE/toolkit-editors-canvases.mdx +17 -0
  154. package/docs/content/locales/es-ES/agent-native-toolkit.mdx +81 -52
  155. package/docs/content/locales/es-ES/toolkit-capability-packages.mdx +21 -0
  156. package/docs/content/locales/es-ES/toolkit-context-knowledge.mdx +12 -0
  157. package/docs/content/locales/es-ES/toolkit-editors-canvases.mdx +21 -0
  158. package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +84 -54
  159. package/docs/content/locales/fr-FR/toolkit-capability-packages.mdx +21 -0
  160. package/docs/content/locales/fr-FR/toolkit-context-knowledge.mdx +12 -0
  161. package/docs/content/locales/fr-FR/toolkit-editors-canvases.mdx +21 -0
  162. package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +69 -62
  163. package/docs/content/locales/hi-IN/toolkit-capability-packages.mdx +21 -0
  164. package/docs/content/locales/hi-IN/toolkit-context-knowledge.mdx +12 -0
  165. package/docs/content/locales/hi-IN/toolkit-editors-canvases.mdx +17 -0
  166. package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +69 -62
  167. package/docs/content/locales/ja-JP/toolkit-capability-packages.mdx +21 -0
  168. package/docs/content/locales/ja-JP/toolkit-context-knowledge.mdx +12 -0
  169. package/docs/content/locales/ja-JP/toolkit-editors-canvases.mdx +17 -0
  170. package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +69 -62
  171. package/docs/content/locales/ko-KR/toolkit-capability-packages.mdx +21 -0
  172. package/docs/content/locales/ko-KR/toolkit-context-knowledge.mdx +12 -0
  173. package/docs/content/locales/ko-KR/toolkit-editors-canvases.mdx +17 -0
  174. package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +82 -54
  175. package/docs/content/locales/pt-BR/toolkit-capability-packages.mdx +21 -0
  176. package/docs/content/locales/pt-BR/toolkit-context-knowledge.mdx +12 -0
  177. package/docs/content/locales/pt-BR/toolkit-editors-canvases.mdx +17 -0
  178. package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +69 -62
  179. package/docs/content/locales/zh-CN/toolkit-capability-packages.mdx +21 -0
  180. package/docs/content/locales/zh-CN/toolkit-context-knowledge.mdx +12 -0
  181. package/docs/content/locales/zh-CN/toolkit-editors-canvases.mdx +17 -0
  182. package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +69 -62
  183. package/docs/content/locales/zh-TW/toolkit-capability-packages.mdx +21 -0
  184. package/docs/content/locales/zh-TW/toolkit-context-knowledge.mdx +12 -0
  185. package/docs/content/locales/zh-TW/toolkit-editors-canvases.mdx +17 -0
  186. package/docs/content/toolkit-capability-packages.mdx +52 -0
  187. package/docs/content/toolkit-context-knowledge.mdx +46 -0
  188. package/docs/content/toolkit-editors-canvases.mdx +55 -0
  189. package/package.json +27 -26
  190. package/corpus/core/src/client/rich-markdown-editor/BubbleToolbar.tsx +0 -253
  191. package/corpus/core/src/client/rich-markdown-editor/CodeBlockNode.tsx +0 -258
  192. package/corpus/core/src/client/rich-markdown-editor/DragHandle.ts +0 -1437
  193. package/corpus/core/src/client/rich-markdown-editor/ImageExtension.ts +0 -306
  194. package/corpus/core/src/client/rich-markdown-editor/RichMarkdownEditor.tsx +0 -80
  195. package/corpus/core/src/client/rich-markdown-editor/RunId.ts +0 -61
  196. package/corpus/core/src/client/rich-markdown-editor/SharedRichEditor.tsx +0 -321
  197. package/corpus/core/src/client/rich-markdown-editor/SlashCommandMenu.tsx +0 -310
  198. package/corpus/core/src/client/rich-markdown-editor/extensions.ts +0 -402
  199. package/corpus/core/src/client/rich-markdown-editor/gfmDoc.ts +0 -92
  200. package/corpus/core/src/client/rich-markdown-editor/surgical-apply.ts +0 -192
  201. package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +0 -590
  202. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts +0 -37
  203. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts.map +0 -1
  204. package/dist/client/rich-markdown-editor/BubbleToolbar.js +0 -171
  205. package/dist/client/rich-markdown-editor/BubbleToolbar.js.map +0 -1
  206. package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts +0 -49
  207. package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts.map +0 -1
  208. package/dist/client/rich-markdown-editor/CodeBlockNode.js +0 -127
  209. package/dist/client/rich-markdown-editor/CodeBlockNode.js.map +0 -1
  210. package/dist/client/rich-markdown-editor/DragHandle.d.ts +0 -97
  211. package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +0 -1
  212. package/dist/client/rich-markdown-editor/DragHandle.js +0 -1066
  213. package/dist/client/rich-markdown-editor/DragHandle.js.map +0 -1
  214. package/dist/client/rich-markdown-editor/ImageExtension.d.ts +0 -63
  215. package/dist/client/rich-markdown-editor/ImageExtension.d.ts.map +0 -1
  216. package/dist/client/rich-markdown-editor/ImageExtension.js +0 -243
  217. package/dist/client/rich-markdown-editor/ImageExtension.js.map +0 -1
  218. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +0 -51
  219. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts.map +0 -1
  220. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js +0 -37
  221. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js.map +0 -1
  222. package/dist/client/rich-markdown-editor/RunId.d.ts +0 -28
  223. package/dist/client/rich-markdown-editor/RunId.d.ts.map +0 -1
  224. package/dist/client/rich-markdown-editor/RunId.js +0 -60
  225. package/dist/client/rich-markdown-editor/RunId.js.map +0 -1
  226. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +0 -110
  227. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +0 -1
  228. package/dist/client/rich-markdown-editor/SharedRichEditor.js +0 -144
  229. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +0 -1
  230. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts +0 -41
  231. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts.map +0 -1
  232. package/dist/client/rich-markdown-editor/SlashCommandMenu.js +0 -221
  233. package/dist/client/rich-markdown-editor/SlashCommandMenu.js.map +0 -1
  234. package/dist/client/rich-markdown-editor/extensions.d.ts +0 -178
  235. package/dist/client/rich-markdown-editor/extensions.d.ts.map +0 -1
  236. package/dist/client/rich-markdown-editor/extensions.js +0 -224
  237. package/dist/client/rich-markdown-editor/extensions.js.map +0 -1
  238. package/dist/client/rich-markdown-editor/gfmDoc.d.ts +0 -24
  239. package/dist/client/rich-markdown-editor/gfmDoc.d.ts.map +0 -1
  240. package/dist/client/rich-markdown-editor/gfmDoc.js +0 -83
  241. package/dist/client/rich-markdown-editor/gfmDoc.js.map +0 -1
  242. package/dist/client/rich-markdown-editor/surgical-apply.d.ts +0 -66
  243. package/dist/client/rich-markdown-editor/surgical-apply.d.ts.map +0 -1
  244. package/dist/client/rich-markdown-editor/surgical-apply.js +0 -147
  245. package/dist/client/rich-markdown-editor/surgical-apply.js.map +0 -1
  246. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +0 -110
  247. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +0 -1
  248. package/dist/client/rich-markdown-editor/useCollabReconcile.js +0 -441
  249. package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +0 -1
@@ -1,221 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useRef, useState, } from "react";
3
- import { cn } from "../utils.js";
4
- import { pickAndInsertImage } from "./ImageExtension.js";
5
- /**
6
- * The default block commands — Plan's current set. Apps pass their own `items`
7
- * (typically `[...DEFAULT_SLASH_COMMANDS, ...extra]`) to extend it.
8
- */
9
- export const DEFAULT_SLASH_COMMANDS = [
10
- {
11
- title: "Text",
12
- description: "Plain text block",
13
- icon: "T",
14
- action: (editor) => editor.chain().focus().setParagraph().run(),
15
- },
16
- {
17
- title: "Heading 1",
18
- description: "Large heading",
19
- icon: "H1",
20
- action: (editor) => editor.chain().focus().toggleHeading({ level: 1 }).run(),
21
- },
22
- {
23
- title: "Heading 2",
24
- description: "Section heading",
25
- icon: "H2",
26
- action: (editor) => editor.chain().focus().toggleHeading({ level: 2 }).run(),
27
- },
28
- {
29
- title: "Heading 3",
30
- description: "Subheading",
31
- icon: "H3",
32
- action: (editor) => editor.chain().focus().toggleHeading({ level: 3 }).run(),
33
- },
34
- {
35
- title: "Bulleted list",
36
- description: "Unordered list",
37
- icon: "-",
38
- action: (editor) => editor.chain().focus().toggleBulletList().run(),
39
- },
40
- {
41
- title: "Numbered list",
42
- description: "Ordered list",
43
- icon: "1.",
44
- action: (editor) => editor.chain().focus().toggleOrderedList().run(),
45
- },
46
- {
47
- title: "To-do list",
48
- description: "Checklist items",
49
- icon: "[]",
50
- action: (editor) => editor.chain().focus().toggleTaskList().run(),
51
- },
52
- {
53
- title: "Quote",
54
- description: "Block quote",
55
- icon: '"',
56
- action: (editor) => editor.chain().focus().toggleBlockquote().run(),
57
- },
58
- {
59
- title: "Code block",
60
- description: "Code snippet",
61
- icon: "<>",
62
- action: (editor) => editor.chain().focus().toggleCodeBlock().run(),
63
- },
64
- {
65
- title: "Divider",
66
- description: "Horizontal rule",
67
- icon: "-",
68
- action: (editor) => editor.chain().focus().setHorizontalRule().run(),
69
- },
70
- {
71
- title: "Table",
72
- description: "Three by three table",
73
- icon: "tbl",
74
- action: (editor) => editor
75
- .chain()
76
- .focus()
77
- .insertTable({ rows: 3, cols: 3, withHeaderRow: true })
78
- .run(),
79
- },
80
- ];
81
- /**
82
- * Build the `/image` slash command for the shared image block. Requires the
83
- * editor to mount the shared image extension (`features.image`) and an
84
- * {@link ImageUploadFn}; the command opens a native file picker and uploads +
85
- * inserts the chosen image(s). Add it to the list an app passes to
86
- * {@link SlashCommandMenu} (e.g. `[...DEFAULT_SLASH_COMMANDS, createImageSlashCommand(upload)]`).
87
- */
88
- export function createImageSlashCommand(upload) {
89
- return {
90
- title: "Image",
91
- description: "Upload an image",
92
- icon: "img",
93
- action: (editor) => pickAndInsertImage(editor.view, upload),
94
- };
95
- }
96
- /**
97
- * The shared "/" block-insert menu. Detects a `/query` at the caret, filters the
98
- * provided command list, and renders a fixed-position picker with keyboard
99
- * navigation. Extracted from the inline plan menu so apps share one
100
- * implementation and only swap the command list.
101
- */
102
- export function SlashCommandMenu({ editor, items = DEFAULT_SLASH_COMMANDS, }) {
103
- const [isOpen, setIsOpen] = useState(false);
104
- const [query, setQuery] = useState("");
105
- const [selectedIndex, setSelectedIndex] = useState(0);
106
- const [position, setPosition] = useState(null);
107
- const menuRef = useRef(null);
108
- const selectedItemRef = useRef(null);
109
- const slashPosRef = useRef(null);
110
- const filteredCommands = useMemo(() => {
111
- const normalizedQuery = query.toLowerCase();
112
- return items.filter((cmd) => cmd.title.toLowerCase().includes(normalizedQuery) ||
113
- cmd.description.toLowerCase().includes(normalizedQuery) ||
114
- cmd.searchText?.toLowerCase().includes(normalizedQuery));
115
- }, [items, query]);
116
- const close = useCallback(() => {
117
- setIsOpen(false);
118
- setQuery("");
119
- slashPosRef.current = null;
120
- }, []);
121
- const executeCommand = useCallback((command) => {
122
- if (slashPosRef.current !== null) {
123
- const { from } = editor.state.selection;
124
- editor
125
- .chain()
126
- .focus()
127
- .deleteRange({ from: slashPosRef.current, to: from })
128
- .run();
129
- }
130
- command.action(editor);
131
- close();
132
- }, [close, editor]);
133
- useEffect(() => {
134
- const handleKeyDown = (event) => {
135
- if (!isOpen)
136
- return;
137
- if (event.key === "ArrowDown") {
138
- event.preventDefault();
139
- if (filteredCommands.length === 0)
140
- return;
141
- setSelectedIndex((index) => (index + 1) % filteredCommands.length);
142
- }
143
- else if (event.key === "ArrowUp") {
144
- event.preventDefault();
145
- if (filteredCommands.length === 0)
146
- return;
147
- setSelectedIndex((index) => (index - 1 + filteredCommands.length) % filteredCommands.length);
148
- }
149
- else if (event.key === "Enter") {
150
- event.preventDefault();
151
- const command = filteredCommands[selectedIndex];
152
- if (command)
153
- executeCommand(command);
154
- }
155
- else if (event.key === "Escape") {
156
- close();
157
- }
158
- };
159
- document.addEventListener("keydown", handleKeyDown, true);
160
- return () => document.removeEventListener("keydown", handleKeyDown, true);
161
- }, [close, executeCommand, filteredCommands, isOpen, selectedIndex]);
162
- useEffect(() => {
163
- if (!isOpen)
164
- return;
165
- const menu = menuRef.current;
166
- const item = selectedItemRef.current;
167
- if (!menu || !item)
168
- return;
169
- const itemTop = item.offsetTop;
170
- const itemBottom = itemTop + item.offsetHeight;
171
- const visibleTop = menu.scrollTop;
172
- const visibleBottom = visibleTop + menu.clientHeight;
173
- if (itemTop < visibleTop) {
174
- menu.scrollTop = itemTop;
175
- }
176
- else if (itemBottom > visibleBottom) {
177
- menu.scrollTop = itemBottom - menu.clientHeight;
178
- }
179
- }, [filteredCommands.length, isOpen, selectedIndex]);
180
- useEffect(() => {
181
- const handleTransaction = () => {
182
- const { state } = editor;
183
- const { from } = state.selection;
184
- const textBefore = state.doc.textBetween(Math.max(0, from - 32), from, "\n");
185
- const slashMatch = textBefore.match(/\/([a-zA-Z0-9 ]*)$/);
186
- if (!slashMatch) {
187
- if (isOpen)
188
- close();
189
- return;
190
- }
191
- const slashStart = from - slashMatch[0].length;
192
- slashPosRef.current = slashStart;
193
- setQuery(slashMatch[1]);
194
- setSelectedIndex(0);
195
- const coords = editor.view.coordsAtPos(from);
196
- const menuHeight = 320;
197
- const spaceBelow = window.innerHeight - coords.bottom;
198
- const flipUp = spaceBelow < menuHeight && coords.top > menuHeight;
199
- setPosition({
200
- top: flipUp ? coords.top : coords.bottom + 4,
201
- left: Math.min(coords.left, window.innerWidth - 250),
202
- flipUp,
203
- });
204
- setIsOpen(true);
205
- };
206
- editor.on("transaction", handleTransaction);
207
- return () => {
208
- editor.off("transaction", handleTransaction);
209
- };
210
- }, [close, editor, isOpen]);
211
- if (!isOpen || !position || filteredCommands.length === 0)
212
- return null;
213
- return (_jsxs("div", { ref: menuRef, className: "an-rich-md-slash-menu", style: {
214
- position: "fixed",
215
- ...(position.flipUp
216
- ? { bottom: window.innerHeight - position.top + 4 }
217
- : { top: position.top }),
218
- left: position.left,
219
- }, "data-plan-interactive": true, children: [_jsx("div", { className: "an-rich-md-slash-heading", children: "Blocks" }), filteredCommands.map((command, index) => (_jsxs("button", { ref: index === selectedIndex ? selectedItemRef : undefined, type: "button", className: cn("an-rich-md-slash-item", index === selectedIndex && "an-rich-md-slash-item--active"), onMouseEnter: () => setSelectedIndex(index), onMouseDown: (event) => event.preventDefault(), onClick: () => executeCommand(command), children: [_jsx("span", { className: "an-rich-md-slash-icon", children: command.icon }), _jsxs("span", { className: "an-rich-md-slash-copy", children: [_jsx("span", { className: "an-rich-md-slash-title", children: command.title }), _jsx("span", { className: "an-rich-md-slash-description", children: command.description })] })] }, command.title)))] }));
220
- }
221
- //# sourceMappingURL=SlashCommandMenu.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SlashCommandMenu.js","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/SlashCommandMenu.tsx"],"names":[],"mappings":";AACA,OAAO,EACL,WAAW,EACX,SAAS,EACT,OAAO,EACP,MAAM,EACN,QAAQ,GAET,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,EAAE,kBAAkB,EAAsB,MAAM,qBAAqB,CAAC;AAgB7E;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAuB;IACxD;QACE,KAAK,EAAE,MAAM;QACb,WAAW,EAAE,kBAAkB;QAC/B,IAAI,EAAE,GAAG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AEE,GAAG,EAAE,KAAK,KAAK,aAAa,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,EAC1D,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,EAAE,CACX,uBAAuB,EACvB,KAAK,KAAK,aAAa,IAAI,+BAA+B,CAC3D,EACD,YAAY,EAAE,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAC3C,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,cAAc,EAAE,EAC9C,OAAO,EAAE,GAAG,EAAE,CAAC,cAAc,CAAC,OAAO,CAAC,aAEtC,eAAM,SAAS,EAAC,uBAAuB,YAAE,OAAO,CAAC,IAAI,GAAQ,EAC7D,gBAAM,SAAS,EAAC,uBAAuB,aACrC,eAAM,SAAS,EAAC,wBAAwB,YAAE,OAAO,CAAC,KAAK,GAAQ,EAC/D,eAAM,SAAS,EAAC,8BAA8B,YAC3C,OAAO,CAAC,WAAW,GACf,IACF,KAjBF,OAAO,CAAC,KAAK,CAkBX,CACV,CAAC,IACE,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { Editor } from \"@tiptap/react\";\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type CSSProperties,\n} from \"react\";\n\nimport { cn } from \"../utils.js\";\nimport { pickAndInsertImage, type ImageUploadFn } from \"./ImageExtension.js\";\n\n/** A single slash-menu block command. Apps can extend the default list. */\nexport interface SlashCommandItem {\n title: string;\n description: string;\n /**\n * Optional hidden search text. Use this for raw block types and aliases that\n * should match slash queries without making the visible description verbose.\n */\n searchText?: string;\n /** Short text glyph shown in the menu (T, H1, tbl, …). */\n icon: string;\n action: (editor: Editor) => void;\n}\n\n/**\n * The default block commands — Plan's current set. Apps pass their own `items`\n * (typically `[...DEFAULT_SLASH_COMMANDS, ...extra]`) to extend it.\n */\nexport const DEFAULT_SLASH_COMMANDS: SlashCommandItem[] = [\n {\n title: \"Text\",\n description: \"Plain text block\",\n icon: \"T\",\n action: (editor) => editor.chain().focus().setParagraph().run(),\n },\n {\n title: \"Heading 1\",\n description: \"Large heading\",\n icon: \"H1\",\n action: (editor) =>\n editor.chain().focus().toggleHeading({ level: 1 }).run(),\n },\n {\n title: \"Heading 2\",\n description: \"Section heading\",\n icon: \"H2\",\n action: (editor) =>\n editor.chain().focus().toggleHeading({ level: 2 }).run(),\n },\n {\n title: \"Heading 3\",\n description: \"Subheading\",\n icon: \"H3\",\n action: (editor) =>\n editor.chain().focus().toggleHeading({ level: 3 }).run(),\n },\n {\n title: \"Bulleted list\",\n description: \"Unordered list\",\n icon: \"-\",\n action: (editor) => editor.chain().focus().toggleBulletList().run(),\n },\n {\n title: \"Numbered list\",\n description: \"Ordered list\",\n icon: \"1.\",\n action: (editor) => editor.chain().focus().toggleOrderedList().run(),\n },\n {\n title: \"To-do list\",\n description: \"Checklist items\",\n icon: \"[]\",\n action: (editor) => editor.chain().focus().toggleTaskList().run(),\n },\n {\n title: \"Quote\",\n description: \"Block quote\",\n icon: '\"',\n action: (editor) => editor.chain().focus().toggleBlockquote().run(),\n },\n {\n title: \"Code block\",\n description: \"Code snippet\",\n icon: \"<>\",\n action: (editor) => editor.chain().focus().toggleCodeBlock().run(),\n },\n {\n title: \"Divider\",\n description: \"Horizontal rule\",\n icon: \"-\",\n action: (editor) => editor.chain().focus().setHorizontalRule().run(),\n },\n {\n title: \"Table\",\n description: \"Three by three table\",\n icon: \"tbl\",\n action: (editor) =>\n editor\n .chain()\n .focus()\n .insertTable({ rows: 3, cols: 3, withHeaderRow: true })\n .run(),\n },\n];\n\n/**\n * Build the `/image` slash command for the shared image block. Requires the\n * editor to mount the shared image extension (`features.image`) and an\n * {@link ImageUploadFn}; the command opens a native file picker and uploads +\n * inserts the chosen image(s). Add it to the list an app passes to\n * {@link SlashCommandMenu} (e.g. `[...DEFAULT_SLASH_COMMANDS, createImageSlashCommand(upload)]`).\n */\nexport function createImageSlashCommand(\n upload: ImageUploadFn,\n): SlashCommandItem {\n return {\n title: \"Image\",\n description: \"Upload an image\",\n icon: \"img\",\n action: (editor) => pickAndInsertImage(editor.view, upload),\n };\n}\n\nexport interface SlashCommandMenuProps {\n editor: Editor;\n /** Block command list. Defaults to {@link DEFAULT_SLASH_COMMANDS}. */\n items?: SlashCommandItem[];\n}\n\n/**\n * The shared \"/\" block-insert menu. Detects a `/query` at the caret, filters the\n * provided command list, and renders a fixed-position picker with keyboard\n * navigation. Extracted from the inline plan menu so apps share one\n * implementation and only swap the command list.\n */\nexport function SlashCommandMenu({\n editor,\n items = DEFAULT_SLASH_COMMANDS,\n}: SlashCommandMenuProps) {\n const [isOpen, setIsOpen] = useState(false);\n const [query, setQuery] = useState(\"\");\n const [selectedIndex, setSelectedIndex] = useState(0);\n const [position, setPosition] = useState<{\n top: number;\n left: number;\n flipUp: boolean;\n } | null>(null);\n const menuRef = useRef<HTMLDivElement>(null);\n const selectedItemRef = useRef<HTMLButtonElement>(null);\n const slashPosRef = useRef<number | null>(null);\n\n const filteredCommands = useMemo(() => {\n const normalizedQuery = query.toLowerCase();\n return items.filter(\n (cmd) =>\n cmd.title.toLowerCase().includes(normalizedQuery) ||\n cmd.description.toLowerCase().includes(normalizedQuery) ||\n cmd.searchText?.toLowerCase().includes(normalizedQuery),\n );\n }, [items, query]);\n\n const close = useCallback(() => {\n setIsOpen(false);\n setQuery(\"\");\n slashPosRef.current = null;\n }, []);\n\n const executeCommand = useCallback(\n (command: SlashCommandItem) => {\n if (slashPosRef.current !== null) {\n const { from } = editor.state.selection;\n editor\n .chain()\n .focus()\n .deleteRange({ from: slashPosRef.current, to: from })\n .run();\n }\n command.action(editor);\n close();\n },\n [close, editor],\n );\n\n useEffect(() => {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (!isOpen) return;\n if (event.key === \"ArrowDown\") {\n event.preventDefault();\n if (filteredCommands.length === 0) return;\n setSelectedIndex((index) => (index + 1) % filteredCommands.length);\n } else if (event.key === \"ArrowUp\") {\n event.preventDefault();\n if (filteredCommands.length === 0) return;\n setSelectedIndex(\n (index) =>\n (index - 1 + filteredCommands.length) % filteredCommands.length,\n );\n } else if (event.key === \"Enter\") {\n event.preventDefault();\n const command = filteredCommands[selectedIndex];\n if (command) executeCommand(command);\n } else if (event.key === \"Escape\") {\n close();\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown, true);\n return () => document.removeEventListener(\"keydown\", handleKeyDown, true);\n }, [close, executeCommand, filteredCommands, isOpen, selectedIndex]);\n\n useEffect(() => {\n if (!isOpen) return;\n const menu = menuRef.current;\n const item = selectedItemRef.current;\n if (!menu || !item) return;\n\n const itemTop = item.offsetTop;\n const itemBottom = itemTop + item.offsetHeight;\n const visibleTop = menu.scrollTop;\n const visibleBottom = visibleTop + menu.clientHeight;\n\n if (itemTop < visibleTop) {\n menu.scrollTop = itemTop;\n } else if (itemBottom > visibleBottom) {\n menu.scrollTop = itemBottom - menu.clientHeight;\n }\n }, [filteredCommands.length, isOpen, selectedIndex]);\n\n useEffect(() => {\n const handleTransaction = () => {\n const { state } = editor;\n const { from } = state.selection;\n const textBefore = state.doc.textBetween(\n Math.max(0, from - 32),\n from,\n \"\\n\",\n );\n const slashMatch = textBefore.match(/\\/([a-zA-Z0-9 ]*)$/);\n if (!slashMatch) {\n if (isOpen) close();\n return;\n }\n\n const slashStart = from - slashMatch[0].length;\n slashPosRef.current = slashStart;\n setQuery(slashMatch[1]);\n setSelectedIndex(0);\n const coords = editor.view.coordsAtPos(from);\n const menuHeight = 320;\n const spaceBelow = window.innerHeight - coords.bottom;\n const flipUp = spaceBelow < menuHeight && coords.top > menuHeight;\n setPosition({\n top: flipUp ? coords.top : coords.bottom + 4,\n left: Math.min(coords.left, window.innerWidth - 250),\n flipUp,\n });\n setIsOpen(true);\n };\n\n editor.on(\"transaction\", handleTransaction);\n return () => {\n editor.off(\"transaction\", handleTransaction);\n };\n }, [close, editor, isOpen]);\n\n if (!isOpen || !position || filteredCommands.length === 0) return null;\n\n return (\n <div\n ref={menuRef}\n className=\"an-rich-md-slash-menu\"\n style={\n {\n position: \"fixed\",\n ...(position.flipUp\n ? { bottom: window.innerHeight - position.top + 4 }\n : { top: position.top }),\n left: position.left,\n } as CSSProperties\n }\n data-plan-interactive\n >\n <div className=\"an-rich-md-slash-heading\">Blocks</div>\n {filteredCommands.map((command, index) => (\n <button\n key={command.title}\n ref={index === selectedIndex ? selectedItemRef : undefined}\n type=\"button\"\n className={cn(\n \"an-rich-md-slash-item\",\n index === selectedIndex && \"an-rich-md-slash-item--active\",\n )}\n onMouseEnter={() => setSelectedIndex(index)}\n onMouseDown={(event) => event.preventDefault()}\n onClick={() => executeCommand(command)}\n >\n <span className=\"an-rich-md-slash-icon\">{command.icon}</span>\n <span className=\"an-rich-md-slash-copy\">\n <span className=\"an-rich-md-slash-title\">{command.title}</span>\n <span className=\"an-rich-md-slash-description\">\n {command.description}\n </span>\n </span>\n </button>\n ))}\n </div>\n );\n}\n"]}
@@ -1,178 +0,0 @@
1
- import type { Extension, Node, Mark } from "@tiptap/core";
2
- import type { StarterKitOptions } from "@tiptap/starter-kit";
3
- import { Markdown } from "tiptap-markdown";
4
- import type { Awareness } from "y-protocols/awareness";
5
- import type { Doc as YDoc } from "yjs";
6
- import { type ImageUploadFn } from "./ImageExtension.js";
7
- /**
8
- * Markdown dialect the editor parses/serializes.
9
- *
10
- * - `gfm` — GitHub-Flavored Markdown. No raw HTML passthrough. The byte-stable
11
- * serialization used by Plans (see RichMarkdownEditor.roundtrip.spec.ts).
12
- * - `nfm` — the Notion-Flavored Markdown superset used by the Content editor,
13
- * which opts into inline HTML so Notion-specific blocks round-trip.
14
- */
15
- export type RichMarkdownDialect = "gfm" | "nfm";
16
- /**
17
- * Editor preset. Schema-neutral today (both presets share the base schema),
18
- * but threaded through so an app can branch schema/behavior per preset without
19
- * a new factory. The collab/markdown wiring is preset-independent.
20
- */
21
- export type RichMarkdownEditorPreset = "plan" | "content";
22
- /** User info used to label this client's collaborative cursor. */
23
- export interface RichMarkdownCollabUser {
24
- name: string;
25
- color: string;
26
- email?: string;
27
- }
28
- /** Optional collaborative-editing inputs for the shared editor. */
29
- export interface SharedEditorCollab {
30
- /**
31
- * Yjs document for collaborative editing. When present the editor binds the
32
- * shared {@link Collaboration} (+ {@link CollaborationCaret} when awareness
33
- * is set) extensions and StarterKit's built-in undo/redo is disabled (Yjs
34
- * owns history). When absent the editor is a controlled `value`/`onChange`
35
- * editor.
36
- */
37
- ydoc?: YDoc | null;
38
- /** Shared awareness instance for live multi-user cursors. */
39
- awareness?: Awareness | null;
40
- /** Current user info for the collaborative cursor label. */
41
- user?: RichMarkdownCollabUser | null;
42
- }
43
- /** Toggle the optional base extensions on/off per app. All default to `true`. */
44
- export interface SharedEditorFeatures {
45
- /** GFM pipe tables (Table + TableRow + TableHeader + TableCell). */
46
- tables?: boolean;
47
- /** Task / checklist lists (TaskList + TaskItem). */
48
- tasks?: boolean;
49
- /** Inline links (the `Link` mark). When off, links fall back to plain text. */
50
- link?: boolean;
51
- /** Fenced code blocks. Disabling lets an app inject its own code-block node. */
52
- codeBlock?: boolean;
53
- /**
54
- * The built-in {@link Placeholder} extension. Default `true`. Apps that need a
55
- * bespoke placeholder resolver (per-node-type labels, ancestor-aware text)
56
- * disable this and supply their own Placeholder via `extraExtensions`.
57
- */
58
- placeholder?: boolean;
59
- /**
60
- * The built-in dialect-keyed {@link Markdown} serializer. Default `true`.
61
- * Apps with a custom serializer (e.g. Content's NFM converter, which does NOT
62
- * round-trip through tiptap-markdown's storage) disable this and own the
63
- * serialize/parse pipeline themselves. The Markdown extension is still added
64
- * so paste/clipboard transforms work — disable it only when supplying your own
65
- * Markdown configuration via the {@link CreateSharedEditorExtensionsOptions.markdown}
66
- * option instead.
67
- */
68
- markdown?: boolean;
69
- /**
70
- * The shared block-level image node (`@tiptap/extension-image`). Default
71
- * `false` so existing embedders are unchanged. When `true`, images
72
- * serialize to GFM `![alt](src)` (source-syncable) and — when an
73
- * {@link CreateSharedEditorExtensionsOptions.onImageUpload} function is
74
- * supplied — paste / drop of local image files uploads through it. Content
75
- * leaves this off and injects its own richer image node via
76
- * `extraExtensions`, so the two never collide.
77
- */
78
- image?: boolean;
79
- }
80
- export interface CreateSharedEditorExtensionsOptions {
81
- /** Markdown dialect; selects the keyed {@link Markdown} config. */
82
- dialect?: RichMarkdownDialect;
83
- /** Preset hook (schema-neutral today). */
84
- preset?: RichMarkdownEditorPreset;
85
- /** Empty-block placeholder text (headings get their own labels). */
86
- placeholder?: string;
87
- /** Toggle individual base extensions. */
88
- features?: SharedEditorFeatures;
89
- /**
90
- * Extra StarterKit options merged over the shared defaults. Lets an app turn
91
- * off StarterKit nodes it replaces (Content swaps in its own paragraph /
92
- * blockquote / code block) or pass a custom dropcursor, while still sharing
93
- * the rest of the StarterKit base + the collab undo/redo gating. The shared
94
- * defaults (`heading` levels 1-4, `link: false`, the default dropcursor, and
95
- * `undoRedo: false` in collab mode) are applied first and can be overridden
96
- * key-by-key here.
97
- */
98
- starterKit?: Partial<StarterKitOptions>;
99
- /**
100
- * Custom {@link Markdown} configuration. Replaces the dialect-keyed config from
101
- * {@link MARKDOWN_DIALECT_CONFIG} when provided. Only used when
102
- * `features.markdown !== false`; apps that own the whole markdown pipeline (no
103
- * tiptap-markdown serialization at all) should set `features.markdown: false`
104
- * and add their own configured Markdown extension via `extraExtensions`.
105
- */
106
- markdown?: Parameters<typeof Markdown.configure>[0];
107
- /**
108
- * App-specific extensions (Notion nodes, media, drag handles, comment
109
- * anchors, etc.) appended LAST so they bind over the shared base schema and
110
- * the optional Collaboration extensions still mount after them.
111
- */
112
- extraExtensions?: Array<Extension | Node | Mark>;
113
- /** Optional collaborative-editing wiring. */
114
- collab?: SharedEditorCollab | null;
115
- /**
116
- * Disable StarterKit's built-in undo/redo (prosemirror-history) for a
117
- * controlled (non-collab) editor whose host owns its own undo authority.
118
- * Default `false`. When a `collab.ydoc` is present, undo/redo is ALWAYS
119
- * disabled regardless of this flag (Yjs owns history); this flag is the
120
- * non-collab equivalent. The plan editor sets it so a single app-level undo
121
- * stack (over the authoritative `blocks[]` tree, which includes block data
122
- * the ProseMirror doc never stores) is the sole cmd+z authority — otherwise
123
- * PM history and the app stack would both fire, and PM history can't see
124
- * block-option edits at all.
125
- */
126
- disableHistory?: boolean;
127
- /**
128
- * Injectable image uploader for the shared image block. Only used when
129
- * `features.image` is on. Turns a picked / pasted / dropped image File into a
130
- * hosted `{ src, alt? }`. Plans pass `uploadEditorImage` (the framework
131
- * `upload-image` action). When omitted, the image block still renders and
132
- * round-trips `![alt](src)` markdown but cannot ingest local files.
133
- */
134
- onImageUpload?: ImageUploadFn | null;
135
- }
136
- /**
137
- * tiptap-markdown configuration, keyed by dialect. This is the single source of
138
- * truth for how each dialect parses/serializes markdown so the editor component
139
- * and the round-trip fidelity test can never drift apart.
140
- *
141
- * tiptap-markdown re-serializes the whole document on every edit, so the goal
142
- * for GFM is `serialize(parse(markdown)) === markdown` for the markdown plans
143
- * actually contain. We deliberately keep tiptap-markdown's own defaults
144
- * (`bulletListMarker: "-"`, `tightLists: true`, `linkify: false`,
145
- * `breaks: false`) because those produce the most byte-stable GFM. See
146
- * RichMarkdownEditor.roundtrip.spec.ts for the pinned corpus.
147
- *
148
- * NFM (Content) opts into inline HTML passthrough (`html: true`) so
149
- * Notion-specific blocks survive a markdown round-trip; the rest mirrors the
150
- * Content editor's existing `Markdown.configure` call.
151
- */
152
- export declare const MARKDOWN_DIALECT_CONFIG: Record<RichMarkdownDialect, Parameters<typeof Markdown.configure>[0]>;
153
- /**
154
- * The ONE editor extension factory shared by every embedder (Plans today,
155
- * Content next). It assembles the base Tiptap schema (StarterKit + Placeholder
156
- * + Link + tasks + tables + code block), the dialect-keyed {@link Markdown}
157
- * serializer, the optional Collaboration stack, and finally any app-specific
158
- * `extraExtensions`.
159
- *
160
- * Ordering matters:
161
- * 1. Base schema (StarterKit first so its nodes/marks register; `starterKit`
162
- * overrides let an app disable replaced nodes / swap the dropcursor).
163
- * 2. dialect-keyed Markdown serializer (suppressible via `features.markdown`
164
- * for apps that own the whole serialize/parse pipeline, e.g. Content's NFM).
165
- * 3. `extraExtensions` (Notion/media/etc.) — appended before Collaboration so
166
- * apps can extend the schema and Collaboration still binds over the full
167
- * schema.
168
- * 4. Collaboration (+ CollaborationCaret) LAST so they bind over everything.
169
- *
170
- * Content (the NFM editor) drives this factory with `features.placeholder` and
171
- * `features.markdown` off, `features.tasks/tables/link` off where it ships its
172
- * own, a `starterKit` override disabling paragraph/blockquote/codeBlock, and all
173
- * Notion/media/fidelity nodes + its own Markdown(NFM)/Placeholder via
174
- * `extraExtensions` — so it shares the StarterKit base + the collab wiring while
175
- * owning its byte-identical NFM serializer.
176
- */
177
- export declare function createSharedEditorExtensions({ dialect, preset: _preset, placeholder, features, starterKit, markdown, extraExtensions, collab, onImageUpload, disableHistory, }?: CreateSharedEditorExtensionsOptions): Array<Extension | Node | Mark>;
178
- //# sourceMappingURL=extensions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":["../../../src/client/rich-markdown-editor/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAY1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAY7D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAsB3C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,KAAK,EAAE,GAAG,IAAI,IAAI,EAAE,MAAM,KAAK,CAAC;AAGvC,OAAO,EAAwB,KAAK,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAAG,KAAK,GAAG,KAAK,CAAC;AAEhD;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,GAAG,MAAM,GAAG,SAAS,CAAC;AAE1D,kEAAkE;AAClE,MAAM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