@aionbuilders/nabu 0.1.0-alpha.9 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/CHANGELOG.md +523 -0
  2. package/LICENSE +21 -0
  3. package/README.md +82 -144
  4. package/dist/behaviors/text/RichText.svelte +25 -2
  5. package/dist/behaviors/text/index.d.ts +2 -0
  6. package/dist/behaviors/text/index.js +2 -0
  7. package/dist/behaviors/text/markdown-shortcuts.extension.d.ts +5 -0
  8. package/dist/behaviors/text/markdown-shortcuts.extension.js +79 -0
  9. package/dist/behaviors/text/markdown-syntax.d.ts +42 -0
  10. package/dist/behaviors/text/markdown-syntax.js +81 -0
  11. package/dist/behaviors/text/rich-text.extension.d.ts +3 -0
  12. package/dist/behaviors/text/rich-text.extension.js +135 -53
  13. package/dist/behaviors/text/text.behavior.svelte.d.ts +217 -42
  14. package/dist/behaviors/text/text.behavior.svelte.js +657 -55
  15. package/dist/behaviors/text/typography.extension.d.ts +7 -0
  16. package/dist/behaviors/text/typography.extension.js +25 -0
  17. package/dist/blocks/Block.svelte +5 -2
  18. package/dist/blocks/BlockList.svelte +48 -0
  19. package/dist/blocks/BlockList.svelte.d.ts +17 -0
  20. package/dist/blocks/Nabu.svelte +180 -14
  21. package/dist/blocks/Nabu.svelte.d.ts +13 -0
  22. package/dist/blocks/block.extension.d.ts +3 -0
  23. package/dist/blocks/block.extension.js +8 -9
  24. package/dist/blocks/block.svelte.d.ts +356 -68
  25. package/dist/blocks/block.svelte.js +388 -42
  26. package/dist/blocks/blockquote/Blockquote.svelte +39 -0
  27. package/dist/blocks/blockquote/Blockquote.svelte.d.ts +11 -0
  28. package/dist/blocks/blockquote/blockquote.extension.d.ts +4 -0
  29. package/dist/blocks/blockquote/blockquote.extension.js +80 -0
  30. package/dist/blocks/blockquote/blockquote.svelte.d.ts +63 -0
  31. package/dist/blocks/blockquote/blockquote.svelte.js +136 -0
  32. package/dist/blocks/blockquote/index.d.ts +3 -0
  33. package/dist/blocks/blockquote/index.js +3 -0
  34. package/dist/blocks/callout/Callout.svelte +67 -0
  35. package/dist/blocks/callout/Callout.svelte.d.ts +11 -0
  36. package/dist/blocks/callout/callout.extension.d.ts +4 -0
  37. package/dist/blocks/callout/callout.extension.js +84 -0
  38. package/dist/blocks/callout/callout.svelte.d.ts +80 -0
  39. package/dist/blocks/callout/callout.svelte.js +189 -0
  40. package/dist/blocks/callout/index.d.ts +3 -0
  41. package/dist/blocks/callout/index.js +3 -0
  42. package/dist/blocks/chunks.d.ts +49 -0
  43. package/dist/blocks/chunks.js +90 -0
  44. package/dist/blocks/code/Code.svelte +84 -0
  45. package/dist/blocks/code/Code.svelte.d.ts +11 -0
  46. package/dist/blocks/code/code.extension.d.ts +4 -0
  47. package/dist/blocks/code/code.extension.js +88 -0
  48. package/dist/blocks/code/code.svelte.d.ts +68 -0
  49. package/dist/blocks/code/code.svelte.js +245 -0
  50. package/dist/blocks/code/index.d.ts +3 -0
  51. package/dist/blocks/code/index.js +3 -0
  52. package/dist/blocks/container.utils.d.ts +85 -13
  53. package/dist/blocks/container.utils.js +338 -178
  54. package/dist/blocks/dialogue/Dialogue.svelte +8 -2
  55. package/dist/blocks/dialogue/dialogue.svelte.d.ts +36 -23
  56. package/dist/blocks/dialogue/dialogue.svelte.js +51 -45
  57. package/dist/blocks/dialogue/hooks/onBeforeInput.hook.d.ts +2 -2
  58. package/dist/blocks/dialogue/hooks/onBeforeInput.hook.js +6 -4
  59. package/dist/blocks/dialogue/index.d.ts +12 -1
  60. package/dist/blocks/dialogue/index.js +51 -35
  61. package/dist/blocks/divider/Divider.svelte +28 -0
  62. package/dist/blocks/divider/Divider.svelte.d.ts +11 -0
  63. package/dist/blocks/divider/divider.extension.d.ts +23 -0
  64. package/dist/blocks/divider/divider.extension.js +153 -0
  65. package/dist/blocks/divider/divider.svelte.d.ts +54 -0
  66. package/dist/blocks/divider/divider.svelte.js +89 -0
  67. package/dist/blocks/divider/index.d.ts +3 -0
  68. package/dist/blocks/divider/index.js +3 -0
  69. package/dist/blocks/file/File.svelte +56 -0
  70. package/dist/blocks/file/File.svelte.d.ts +11 -0
  71. package/dist/blocks/file/file.extension.d.ts +4 -0
  72. package/dist/blocks/file/file.extension.js +27 -0
  73. package/dist/blocks/file/file.svelte.d.ts +29 -0
  74. package/dist/blocks/file/file.svelte.js +77 -0
  75. package/dist/blocks/file/index.d.ts +3 -0
  76. package/dist/blocks/file/index.js +3 -0
  77. package/dist/blocks/heading/Heading.svelte +2 -1
  78. package/dist/blocks/heading/heading.svelte.d.ts +27 -34
  79. package/dist/blocks/heading/heading.svelte.js +72 -60
  80. package/dist/blocks/heading/hooks/onBeforeInput.hook.js +7 -5
  81. package/dist/blocks/heading/index.d.ts +2 -2
  82. package/dist/blocks/heading/index.js +33 -8
  83. package/dist/blocks/image/Image.svelte +41 -0
  84. package/dist/blocks/image/Image.svelte.d.ts +11 -0
  85. package/dist/blocks/image/image.extension.d.ts +5 -0
  86. package/dist/blocks/image/image.extension.js +34 -0
  87. package/dist/blocks/image/image.svelte.d.ts +61 -0
  88. package/dist/blocks/image/image.svelte.js +114 -0
  89. package/dist/blocks/image/index.d.ts +3 -0
  90. package/dist/blocks/image/index.js +3 -0
  91. package/dist/blocks/index.d.ts +11 -1
  92. package/dist/blocks/index.js +11 -1
  93. package/dist/blocks/list/List.svelte +9 -2
  94. package/dist/blocks/list/ListItem.svelte +44 -7
  95. package/dist/blocks/list/convert.d.ts +20 -0
  96. package/dist/blocks/list/convert.js +92 -0
  97. package/dist/blocks/list/hooks/onBeforeInput.hook.js +60 -26
  98. package/dist/blocks/list/html-flat.d.ts +78 -0
  99. package/dist/blocks/list/html-flat.js +244 -0
  100. package/dist/blocks/list/indent.d.ts +86 -0
  101. package/dist/blocks/list/indent.js +205 -0
  102. package/dist/blocks/list/index.d.ts +7 -3
  103. package/dist/blocks/list/index.js +43 -31
  104. package/dist/blocks/list/list-item.svelte.d.ts +43 -17
  105. package/dist/blocks/list/list-item.svelte.js +143 -93
  106. package/dist/blocks/list/list.behavior.svelte.d.ts +7 -4
  107. package/dist/blocks/list/list.behavior.svelte.js +10 -5
  108. package/dist/blocks/list/list.svelte.d.ts +101 -23
  109. package/dist/blocks/list/list.svelte.js +136 -114
  110. package/dist/blocks/list/markdown.d.ts +149 -0
  111. package/dist/blocks/list/markdown.js +442 -0
  112. package/dist/blocks/list/normalize.d.ts +11 -0
  113. package/dist/blocks/list/normalize.js +396 -0
  114. package/dist/blocks/list/paste.d.ts +45 -0
  115. package/dist/blocks/list/paste.js +242 -0
  116. package/dist/blocks/list/step-back.d.ts +24 -0
  117. package/dist/blocks/list/step-back.js +87 -0
  118. package/dist/blocks/list/to-list.d.ts +7 -0
  119. package/dist/blocks/list/to-list.js +44 -0
  120. package/dist/blocks/list/todos-toggle.d.ts +20 -0
  121. package/dist/blocks/list/todos-toggle.js +48 -0
  122. package/dist/blocks/list/todos.svelte.d.ts +35 -0
  123. package/dist/blocks/list/todos.svelte.js +76 -0
  124. package/dist/blocks/media/index.d.ts +2 -0
  125. package/dist/blocks/media/index.js +2 -0
  126. package/dist/blocks/media/markdown.d.ts +12 -0
  127. package/dist/blocks/media/markdown.js +26 -0
  128. package/dist/blocks/media/media-block.svelte.d.ts +107 -0
  129. package/dist/blocks/media/media-block.svelte.js +181 -0
  130. package/dist/blocks/media/media.helpers.d.ts +24 -0
  131. package/dist/blocks/media/media.helpers.js +88 -0
  132. package/dist/blocks/megablock.svelte.d.ts +50 -19
  133. package/dist/blocks/megablock.svelte.js +115 -74
  134. package/dist/blocks/move.d.ts +23 -0
  135. package/dist/blocks/move.js +92 -0
  136. package/dist/blocks/nabu.svelte.d.ts +846 -75
  137. package/dist/blocks/nabu.svelte.js +1990 -182
  138. package/dist/blocks/paragraph/Paragraph.svelte +1 -0
  139. package/dist/blocks/paragraph/index.d.ts +2 -2
  140. package/dist/blocks/paragraph/index.js +35 -16
  141. package/dist/blocks/paragraph/paragraph.svelte.d.ts +49 -35
  142. package/dist/blocks/paragraph/paragraph.svelte.js +81 -69
  143. package/dist/blocks/paragraph/table.html.d.ts +9 -0
  144. package/dist/blocks/paragraph/table.html.js +111 -0
  145. package/dist/blocks/paragraph/table.markdown.d.ts +32 -0
  146. package/dist/blocks/paragraph/table.markdown.js +90 -0
  147. package/dist/blocks/region/Region.svelte +264 -0
  148. package/dist/blocks/region/Region.svelte.d.ts +11 -0
  149. package/dist/blocks/region/actions.d.ts +135 -0
  150. package/dist/blocks/region/actions.js +402 -0
  151. package/dist/blocks/region/close.d.ts +35 -0
  152. package/dist/blocks/region/close.js +130 -0
  153. package/dist/blocks/region/commands.d.ts +6 -0
  154. package/dist/blocks/region/commands.js +277 -0
  155. package/dist/blocks/region/create.d.ts +72 -0
  156. package/dist/blocks/region/create.js +208 -0
  157. package/dist/blocks/region/end-marker.d.ts +35 -0
  158. package/dist/blocks/region/end-marker.js +51 -0
  159. package/dist/blocks/region/facts.d.ts +69 -0
  160. package/dist/blocks/region/facts.js +152 -0
  161. package/dist/blocks/region/format.d.ts +91 -0
  162. package/dist/blocks/region/format.js +260 -0
  163. package/dist/blocks/region/index.d.ts +14 -0
  164. package/dist/blocks/region/index.js +14 -0
  165. package/dist/blocks/region/insert.d.ts +59 -0
  166. package/dist/blocks/region/insert.js +102 -0
  167. package/dist/blocks/region/messages.d.ts +254 -0
  168. package/dist/blocks/region/messages.js +131 -0
  169. package/dist/blocks/region/normalize.d.ts +7 -0
  170. package/dist/blocks/region/normalize.js +170 -0
  171. package/dist/blocks/region/region.extension.d.ts +58 -0
  172. package/dist/blocks/region/region.extension.js +119 -0
  173. package/dist/blocks/region/region.svelte.d.ts +221 -0
  174. package/dist/blocks/region/region.svelte.js +582 -0
  175. package/dist/blocks/region/regions.svelte.d.ts +141 -0
  176. package/dist/blocks/region/regions.svelte.js +276 -0
  177. package/dist/blocks/region/serialize.d.ts +57 -0
  178. package/dist/blocks/region/serialize.js +112 -0
  179. package/dist/blocks/region/types.d.ts +255 -0
  180. package/dist/blocks/region/types.js +204 -0
  181. package/dist/blocks/selection.svelte.d.ts +106 -8
  182. package/dist/blocks/selection.svelte.js +632 -74
  183. package/dist/blocks/subthread.d.ts +80 -0
  184. package/dist/blocks/subthread.js +167 -0
  185. package/dist/blocks/text-block.svelte.d.ts +70 -0
  186. package/dist/blocks/text-block.svelte.js +108 -0
  187. package/dist/blocks/toggle/Toggle.svelte +73 -0
  188. package/dist/blocks/toggle/Toggle.svelte.d.ts +11 -0
  189. package/dist/blocks/toggle/index.d.ts +3 -0
  190. package/dist/blocks/toggle/index.js +3 -0
  191. package/dist/blocks/toggle/markdown.d.ts +20 -0
  192. package/dist/blocks/toggle/markdown.js +112 -0
  193. package/dist/blocks/toggle/toggle.extension.d.ts +4 -0
  194. package/dist/blocks/toggle/toggle.extension.js +18 -0
  195. package/dist/blocks/toggle/toggle.svelte.d.ts +135 -0
  196. package/dist/blocks/toggle/toggle.svelte.js +352 -0
  197. package/dist/blocks/undo-selection.d.ts +175 -0
  198. package/dist/blocks/undo-selection.js +360 -0
  199. package/dist/blocks/video/Video.svelte +42 -0
  200. package/dist/blocks/video/Video.svelte.d.ts +11 -0
  201. package/dist/blocks/video/index.d.ts +3 -0
  202. package/dist/blocks/video/index.js +3 -0
  203. package/dist/blocks/video/video.extension.d.ts +4 -0
  204. package/dist/blocks/video/video.extension.js +27 -0
  205. package/dist/blocks/video/video.svelte.d.ts +29 -0
  206. package/dist/blocks/video/video.svelte.js +80 -0
  207. package/dist/extend.d.ts +55 -0
  208. package/dist/extend.js +88 -0
  209. package/dist/files/assets.clipboard.d.ts +77 -0
  210. package/dist/files/assets.clipboard.js +152 -0
  211. package/dist/files/files.svelte.d.ts +363 -0
  212. package/dist/files/files.svelte.js +897 -0
  213. package/dist/files/index.d.ts +3 -0
  214. package/dist/files/index.js +3 -0
  215. package/dist/files/outbox.d.ts +69 -0
  216. package/dist/files/outbox.js +48 -0
  217. package/dist/files/status.d.ts +65 -0
  218. package/dist/files/status.js +87 -0
  219. package/dist/files/store.d.ts +97 -0
  220. package/dist/files/store.js +65 -0
  221. package/dist/files/uploads.svelte.d.ts +174 -0
  222. package/dist/files/uploads.svelte.js +504 -0
  223. package/dist/index.d.ts +68 -6
  224. package/dist/index.js +117 -7
  225. package/dist/nabu-theme.css +112 -0
  226. package/dist/paste/html.paste.d.ts +74 -3
  227. package/dist/paste/html.paste.js +555 -83
  228. package/dist/paste/markdown-inline.d.ts +86 -0
  229. package/dist/paste/markdown-inline.js +528 -0
  230. package/dist/paste/markdown.paste.d.ts +2 -8
  231. package/dist/paste/markdown.paste.js +78 -94
  232. package/dist/paste/nabu.paste.d.ts +3 -0
  233. package/dist/paste/nabu.paste.js +29 -3
  234. package/dist/paste/plain-text.paste.d.ts +2 -2
  235. package/dist/paste/plain-text.paste.js +3 -3
  236. package/dist/persistence/asset-store.d.ts +51 -0
  237. package/dist/persistence/asset-store.js +103 -0
  238. package/dist/persistence/autosave.d.ts +53 -0
  239. package/dist/persistence/autosave.js +62 -0
  240. package/dist/persistence/compact.d.ts +162 -0
  241. package/dist/persistence/compact.js +141 -0
  242. package/dist/persistence/history.d.ts +77 -0
  243. package/dist/persistence/history.js +176 -0
  244. package/dist/persistence/indexeddb.d.ts +190 -4
  245. package/dist/persistence/indexeddb.js +333 -29
  246. package/dist/persistence/merge.d.ts +38 -0
  247. package/dist/persistence/merge.js +36 -0
  248. package/dist/persistence/outbox.d.ts +25 -0
  249. package/dist/persistence/outbox.js +40 -0
  250. package/dist/persistence/persistence.d.ts +70 -9
  251. package/dist/persistence/persistence.js +507 -35
  252. package/dist/persistence/recovery.d.ts +79 -0
  253. package/dist/persistence/recovery.js +79 -0
  254. package/dist/persistence/release.d.ts +34 -0
  255. package/dist/persistence/release.js +64 -0
  256. package/dist/persistence/state.svelte.d.ts +53 -0
  257. package/dist/persistence/state.svelte.js +48 -0
  258. package/dist/persistence/sync.d.ts +39 -0
  259. package/dist/persistence/sync.js +138 -0
  260. package/dist/persistence/tail.d.ts +42 -0
  261. package/dist/persistence/tail.js +103 -0
  262. package/dist/presets.d.ts +29 -24
  263. package/dist/presets.js +51 -14
  264. package/dist/themes/atelier.css +318 -0
  265. package/dist/ui/CommandChooser.svelte +153 -0
  266. package/dist/ui/CommandChooser.svelte.d.ts +13 -0
  267. package/dist/ui/CommandInvite.svelte +99 -0
  268. package/dist/ui/CommandInvite.svelte.d.ts +12 -0
  269. package/dist/ui/DragHandle.svelte +217 -0
  270. package/dist/ui/DragHandle.svelte.d.ts +11 -0
  271. package/dist/ui/FloatingToolbar.svelte +165 -0
  272. package/dist/ui/FloatingToolbar.svelte.d.ts +27 -0
  273. package/dist/ui/SlashMenu.svelte +215 -0
  274. package/dist/ui/SlashMenu.svelte.d.ts +33 -0
  275. package/dist/ui/anchor.d.ts +112 -0
  276. package/dist/ui/anchor.js +136 -0
  277. package/dist/ui/index.d.ts +10 -0
  278. package/dist/ui/index.js +15 -0
  279. package/dist/ui/slash-menu.svelte.d.ts +112 -0
  280. package/dist/ui/slash-menu.svelte.js +150 -0
  281. package/dist/utils/command-confirm.svelte.d.ts +349 -0
  282. package/dist/utils/command-confirm.svelte.js +673 -0
  283. package/dist/utils/commands.d.ts +328 -0
  284. package/dist/utils/commands.js +416 -0
  285. package/dist/utils/dom-scope.d.ts +14 -0
  286. package/dist/utils/dom-scope.js +20 -0
  287. package/dist/utils/drop.d.ts +160 -0
  288. package/dist/utils/drop.js +305 -0
  289. package/dist/utils/extensions.d.ts +488 -40
  290. package/dist/utils/extensions.js +300 -19
  291. package/dist/utils/html.d.ts +44 -0
  292. package/dist/utils/html.js +183 -0
  293. package/dist/utils/index.d.ts +4 -0
  294. package/dist/utils/index.js +4 -0
  295. package/dist/utils/keys.d.ts +120 -0
  296. package/dist/utils/keys.js +248 -0
  297. package/dist/utils/links.d.ts +22 -0
  298. package/dist/utils/links.js +34 -0
  299. package/dist/utils/placeholders.d.ts +88 -0
  300. package/dist/utils/placeholders.js +91 -0
  301. package/dist/utils/selection.svelte.d.ts +47 -19
  302. package/dist/utils/selection.svelte.js +60 -10
  303. package/dist/utils/spellcheck.d.ts +9 -0
  304. package/dist/utils/spellcheck.js +17 -0
  305. package/dist/utils/tab.d.ts +31 -0
  306. package/dist/utils/tab.js +117 -0
  307. package/dist/utils/words.d.ts +7 -0
  308. package/dist/utils/words.js +62 -0
  309. package/dist/vite.d.ts +22 -0
  310. package/dist/vite.js +34 -0
  311. package/package.json +61 -22
  312. package/dist/blocks/zone/Zone.svelte +0 -258
  313. package/dist/blocks/zone/Zone.svelte.d.ts +0 -11
  314. package/dist/blocks/zone/index.d.ts +0 -2
  315. package/dist/blocks/zone/index.js +0 -2
  316. package/dist/blocks/zone/zone.extension.d.ts +0 -2
  317. package/dist/blocks/zone/zone.extension.js +0 -221
  318. package/dist/blocks/zone/zone.svelte.d.ts +0 -112
  319. package/dist/blocks/zone/zone.svelte.js +0 -321
package/dist/presets.d.ts CHANGED
@@ -1,38 +1,43 @@
1
+ /**
2
+ * @typedef {Omit<import('./blocks/nabu.svelte.js').NabuInit, 'extensions'> & { preset?: Extension[], extensions?: Extension[] }} EditorOptions
3
+ * Options of the editor factories: every `NabuInit` option (`files`, `placeholders`, `snapshot`, `keymap`, `tab`, `lang`…, forwarded to
4
+ * `Nabu`) plus the `preset` the factory starts from. `extensions` are appended to the preset's.
5
+ * - `preset`: base extensions (default: `FullPreset`, or the preset of the named factory).
6
+ * - `tab`: default by preset: Minimal / Text `'focus'`, Document / Full `'stay'`, a custom preset array `'focus'`.
7
+ */
1
8
  /**
2
9
  * Create a Nabu editor instance from a preset and optional extra extensions.
3
10
  *
4
- * @param {object} [options]
5
- * @param {typeof ParagraphExtension[]} [options.preset] - Base preset (default: FullPreset)
6
- * @param {typeof ParagraphExtension[]} [options.extensions] - Extra extensions to append
11
+ * @param {EditorOptions} [options]
7
12
  * @returns {Nabu}
8
13
  *
9
14
  * @example
10
15
  * const engine = createEditor({ preset: DocumentPreset, extensions: [MyCustomExtension] });
11
16
  */
12
- export function createEditor({ preset, extensions }?: {
13
- preset?: import("./index.js").Extension[] | undefined;
14
- extensions?: import("./index.js").Extension[] | undefined;
15
- }): Nabu;
17
+ export function createEditor({ preset, extensions, ...init }?: EditorOptions): Nabu;
16
18
  /** Paragraph only. The simplest possible editor. */
17
- export const MinimalPreset: import("./index.js").Extension[];
19
+ export const MinimalPreset: Extension[];
18
20
  /** Paragraph + rich text marks (bold, italic, underline, code, strikethrough). */
19
- export const TextPreset: import("./index.js").Extension[];
21
+ export const TextPreset: Extension[];
20
22
  /** Paragraph + headings + rich text. Document-like, no lists. */
21
- export const DocumentPreset: import("./index.js").Extension[];
23
+ export const DocumentPreset: Extension[];
22
24
  /** All built-in block types + rich text. */
23
- export const FullPreset: import("./index.js").Extension[];
24
- export function createMinimalEditor(options?: {
25
- extensions?: (typeof ParagraphExtension)[];
26
- }): Nabu;
27
- export function createTextEditor(options?: {
28
- extensions?: (typeof ParagraphExtension)[];
29
- }): Nabu;
30
- export function createDocumentEditor(options?: {
31
- extensions?: (typeof ParagraphExtension)[];
32
- }): Nabu;
33
- export function createFullEditor(options?: {
34
- extensions?: (typeof ParagraphExtension)[];
35
- }): Nabu;
25
+ export const FullPreset: Extension[];
26
+ export function tabDefaultFor(preset: unknown): "focus" | "stay" | "indent";
27
+ export function createMinimalEditor(options?: EditorOptions): Nabu;
28
+ export function createTextEditor(options?: EditorOptions): Nabu;
29
+ export function createDocumentEditor(options?: EditorOptions): Nabu;
30
+ export function createFullEditor(options?: EditorOptions): Nabu;
36
31
  export { createPersistedEditor } from "./persistence/persistence.js";
32
+ /**
33
+ * Options of the editor factories: every `NabuInit` option (`files`, `placeholders`, `snapshot`, `keymap`, `tab`, `lang`…, forwarded to
34
+ * `Nabu`) plus the `preset` the factory starts from. `extensions` are appended to the preset's.
35
+ * - `preset`: base extensions (default: `FullPreset`, or the preset of the named factory).
36
+ * - `tab`: default by preset: Minimal / Text `'focus'`, Document / Full `'stay'`, a custom preset array `'focus'`.
37
+ */
38
+ export type EditorOptions = Omit<import("./blocks/nabu.svelte.js").NabuInit, "extensions"> & {
39
+ preset?: Extension[];
40
+ extensions?: Extension[];
41
+ };
37
42
  import { Nabu } from './blocks/nabu.svelte.js';
38
- import { ParagraphExtension } from './blocks/paragraph/index.js';
43
+ import type { Extension } from './utils/extensions.js';
package/dist/presets.js CHANGED
@@ -1,12 +1,24 @@
1
+ /**
2
+ * @import { Extension } from './utils/extensions.js';
3
+ */
4
+
1
5
  import { Nabu } from './blocks/nabu.svelte.js';
2
6
  import { ParagraphExtension } from './blocks/paragraph/index.js';
3
7
  import { HeadingExtension } from './blocks/heading/index.js';
4
8
  import { ListExtension, ListItemExtension } from './blocks/list/index.js';
5
9
  import { DialogueExtension } from './blocks/dialogue/index.js';
6
- import { RichTextExtension } from './behaviors/text/index.js';
10
+ import { BlockquoteExtension } from './blocks/blockquote/index.js';
11
+ import { DividerExtension } from './blocks/divider/index.js';
12
+ import { CodeExtension } from './blocks/code/index.js';
13
+ import { CalloutExtension } from './blocks/callout/index.js';
14
+ import { ToggleExtension } from './blocks/toggle/index.js';
15
+ import { RichTextExtension, TypographyExtension, MarkdownShortcutsExtension } from './behaviors/text/index.js';
7
16
  import { PlainTextPasteExtension, NabuPasteExtension, HtmlPasteExtension, MarkdownPasteExtension } from './paste/index.js';
8
17
  import { BlockExtension } from './blocks/block.extension.js';
9
- import { ZoneExtension } from './blocks/zone/zone.extension.js';
18
+ import { ImageExtension } from './blocks/image/index.js';
19
+ import { VideoExtension } from './blocks/video/index.js';
20
+ import { FileExtension } from './blocks/file/index.js';
21
+ import { RegionsExtension } from './blocks/region/index.js';
10
22
 
11
23
  // ---------------------------------------------------------------------------
12
24
  // Presets — composable extension arrays
@@ -16,31 +28,56 @@ import { ZoneExtension } from './blocks/zone/zone.extension.js';
16
28
  export const MinimalPreset = [ParagraphExtension, PlainTextPasteExtension, HtmlPasteExtension, NabuPasteExtension, BlockExtension];
17
29
 
18
30
  /** Paragraph + rich text marks (bold, italic, underline, code, strikethrough). */
19
- export const TextPreset = [ParagraphExtension, RichTextExtension, PlainTextPasteExtension, HtmlPasteExtension, NabuPasteExtension, MarkdownPasteExtension, BlockExtension];
31
+ export const TextPreset = [ParagraphExtension, RichTextExtension, TypographyExtension, MarkdownShortcutsExtension, PlainTextPasteExtension, HtmlPasteExtension, NabuPasteExtension, MarkdownPasteExtension, BlockExtension];
20
32
 
21
33
  /** Paragraph + headings + rich text. Document-like, no lists. */
22
- export const DocumentPreset = [ParagraphExtension, HeadingExtension, RichTextExtension, PlainTextPasteExtension, HtmlPasteExtension, MarkdownPasteExtension, NabuPasteExtension, BlockExtension];
34
+ export const DocumentPreset = [ParagraphExtension, HeadingExtension, BlockquoteExtension, DividerExtension, CodeExtension, CalloutExtension, ToggleExtension, ImageExtension, VideoExtension, FileExtension, RichTextExtension, TypographyExtension, MarkdownShortcutsExtension, PlainTextPasteExtension, HtmlPasteExtension, MarkdownPasteExtension, NabuPasteExtension, BlockExtension];
23
35
 
24
36
  /** All built-in block types + rich text. */
25
- export const FullPreset = [ParagraphExtension, HeadingExtension, ListExtension, ListItemExtension, DialogueExtension, ZoneExtension, RichTextExtension, PlainTextPasteExtension, HtmlPasteExtension, MarkdownPasteExtension, NabuPasteExtension, BlockExtension];
37
+ export const FullPreset = [
38
+ ParagraphExtension, HeadingExtension, BlockquoteExtension, DividerExtension, CodeExtension, CalloutExtension, ToggleExtension, ImageExtension, VideoExtension, FileExtension, ListExtension, ListItemExtension, DialogueExtension, RegionsExtension(), RichTextExtension, TypographyExtension, MarkdownShortcutsExtension, PlainTextPasteExtension, HtmlPasteExtension, MarkdownPasteExtension, NabuPasteExtension, BlockExtension,
39
+ ];
40
+
41
+ /**
42
+ * Default `tab` option of each preset (P-41): what Tab / Shift+Tab do in a plain text block. Small editors (comment box,
43
+ * description) let Tab leave like a `<textarea>`; document editors keep the caret and offer Escape then Tab to leave.
44
+ * An explicit `tab` option always wins; a preset that is not listed (custom array) gets `'focus'`.
45
+ * @type {Map<unknown, 'focus' | 'stay' | 'indent'>}
46
+ */
47
+ const TAB_DEFAULTS = new Map([[MinimalPreset, 'focus'], [TextPreset, 'focus'], [DocumentPreset, 'stay'], [FullPreset, 'stay']]);
48
+
49
+ /**
50
+ * The default `tab` mode of a preset (see `TAB_DEFAULTS`).
51
+ * @param {unknown} preset
52
+ * @returns {'focus' | 'stay' | 'indent'}
53
+ */
54
+ export const tabDefaultFor = (preset) => TAB_DEFAULTS.get(preset) ?? 'focus';
26
55
 
27
56
  // ---------------------------------------------------------------------------
28
57
  // Factory — generic createEditor
29
58
  // ---------------------------------------------------------------------------
30
59
 
60
+ /**
61
+ * @typedef {Omit<import('./blocks/nabu.svelte.js').NabuInit, 'extensions'> & { preset?: Extension[], extensions?: Extension[] }} EditorOptions
62
+ * Options of the editor factories: every `NabuInit` option (`files`, `placeholders`, `snapshot`, `keymap`, `tab`, `lang`…, forwarded to
63
+ * `Nabu`) plus the `preset` the factory starts from. `extensions` are appended to the preset's.
64
+ * - `preset`: base extensions (default: `FullPreset`, or the preset of the named factory).
65
+ * - `tab`: default by preset: Minimal / Text `'focus'`, Document / Full `'stay'`, a custom preset array `'focus'`.
66
+ */
67
+
31
68
  /**
32
69
  * Create a Nabu editor instance from a preset and optional extra extensions.
33
70
  *
34
- * @param {object} [options]
35
- * @param {typeof ParagraphExtension[]} [options.preset] - Base preset (default: FullPreset)
36
- * @param {typeof ParagraphExtension[]} [options.extensions] - Extra extensions to append
71
+ * @param {EditorOptions} [options]
37
72
  * @returns {Nabu}
38
73
  *
39
74
  * @example
40
75
  * const engine = createEditor({ preset: DocumentPreset, extensions: [MyCustomExtension] });
41
76
  */
42
- export function createEditor({ preset = FullPreset, extensions = [] } = {}) {
43
- return new Nabu({ extensions: [...preset, ...extensions] });
77
+ export function createEditor({ preset = FullPreset, extensions = [], ...init } = {}) {
78
+ // Forward any remaining Nabu init options (e.g. `files`, `snapshot`) so the
79
+ // ergonomic factories expose the full constructor surface, not just extensions.
80
+ return new Nabu({ tabDefault: tabDefaultFor(preset), ...init, extensions: [...preset, ...extensions] });
44
81
  }
45
82
 
46
83
  // ---------------------------------------------------------------------------
@@ -49,28 +86,28 @@ export function createEditor({ preset = FullPreset, extensions = [] } = {}) {
49
86
 
50
87
  /**
51
88
  * Paragraph-only editor. Ideal as a simple textarea replacement.
52
- * @param {{ extensions?: typeof ParagraphExtension[] }} [options]
89
+ * @param {EditorOptions} [options] every `NabuInit` option (`files`, `snapshot`, `keymap`…) and extra `extensions`
53
90
  */
54
91
  export const createMinimalEditor = (options = {}) =>
55
92
  createEditor({ preset: MinimalPreset, ...options });
56
93
 
57
94
  /**
58
95
  * Paragraph + rich text marks. Good for comment boxes, descriptions.
59
- * @param {{ extensions?: typeof ParagraphExtension[] }} [options]
96
+ * @param {EditorOptions} [options] every `NabuInit` option (`files`, `snapshot`, `keymap`…) and extra `extensions`
60
97
  */
61
98
  export const createTextEditor = (options = {}) =>
62
99
  createEditor({ preset: TextPreset, ...options });
63
100
 
64
101
  /**
65
102
  * Paragraph + headings + rich text. Good for articles, notes.
66
- * @param {{ extensions?: typeof ParagraphExtension[] }} [options]
103
+ * @param {EditorOptions} [options] every `NabuInit` option (`files`, `snapshot`, `keymap`…) and extra `extensions`
67
104
  */
68
105
  export const createDocumentEditor = (options = {}) =>
69
106
  createEditor({ preset: DocumentPreset, ...options });
70
107
 
71
108
  /**
72
109
  * All built-in blocks + rich text. The full Nabu experience.
73
- * @param {{ extensions?: typeof ParagraphExtension[] }} [options]
110
+ * @param {EditorOptions} [options] every `NabuInit` option (`files`, `snapshot`, `keymap`…) and extra `extensions`
74
111
  */
75
112
  export const createFullEditor = (options = {}) =>
76
113
  createEditor({ preset: FullPreset, ...options });
@@ -0,0 +1,318 @@
1
+ /*
2
+ * Nabu theme: "Atelier"
3
+ *
4
+ * A warm-coral, near-black editor surface (dark by default) with a paper-white counterpart. It is a plain stylesheet: no JavaScript,
5
+ * no build step, no font loading.
6
+ *
7
+ * USAGE
8
+ * import '@aionbuilders/nabu/themes/atelier.css';
9
+ *
10
+ * <div class="nb-theme-atelier" data-nb-scheme="dark"> <!-- any ANCESTOR of the editor AND of its floating UI -->
11
+ * <FloatingToolbar {engine} /> <SlashMenu {engine} /> <DragHandle {engine} />
12
+ * <NabuEditor {engine} />
13
+ * </div>
14
+ *
15
+ * `data-nb-scheme` (on the same element as the class):
16
+ * "dark" (or absent) dark palette
17
+ * "light" light palette
18
+ * "auto" follows `prefers-color-scheme`
19
+ * Put the scope ancestor around the floating UI too (toolbar, slash menu, drag handle, command surfaces): they are rendered where
20
+ * you mount them, and read their colours from the nearest scope.
21
+ *
22
+ * FONTS (the theme never loads a font; the HOST provides the families, the stacks below fall back to system fonts)
23
+ * --nb-font-text Inter weights 400, 500, 600
24
+ * --nb-font-heading Syne weight 700 (headings fall back to Inter, then the system font)
25
+ * --nb-font-mono JetBrains Mono weights 400, 500 (code blocks, inline code)
26
+ * Override any of them on the scope element (or an ancestor) to use other families.
27
+ *
28
+ * WHAT IT TOUCHES
29
+ * - every `--nb-*` variable the editor and its UI read (the library's own `nabu-theme.css` defaults are overridden inside the scope);
30
+ * - the editor element (`.nabu-editor`) becomes the "pane": surface, 1px border, 16px radius, 36px 40px padding, Inter 16px/1.65, coral caret
31
+ * and a focus state (the border strengthens, no outline). Set `--atelier-pane-padding` / `--atelier-pane-radius` on the scope to change the box; `--atelier-pane: transparent`
32
+ * (and no border) to blend it into your own surface;
33
+ * - typography of headings, lists, quotes, code, callouts through the blocks' public attributes and classes (`[data-block-type]`, `.nabu-*`).
34
+ * Nothing outside the scope is touched.
35
+ *
36
+ * CONTRAST (WCAG 2.x, text 4.5:1, computed from the hex values below; pane = the editor surface, float = toolbar / slash menu)
37
+ * dark light
38
+ * text-primary #EDEDED 15.7 / 14.5 #141416 18.4 / 18.4 (on pane / on float)
39
+ * text-secondary #A9A9AE 7.9 / 7.3 #55555B 7.4 / 7.4
40
+ * text-muted (labels, hints) #8A8A90 5.4 / 5.0 #6B6B72 5.3 / 5.3
41
+ * accent (links, caret, label) #FF6F61 6.7 / 6.2 #C2381F 5.4 / 5.4
42
+ * accent on code background #FF6F61 7.0 (#0F0F11) #C2381F 4.7 (#EFEFEB)
43
+ * region warning (hold hint) #F59E0B 8.6 / 7.9 #B45309 5.0 / 5.0
44
+ * error (file chip) #FF8A80 8.1 / 7.4 #B91C1C 6.5 / 6.5
45
+ * text-primary on hover/active 12.9 / 11.2 16.1 / 14.7
46
+ * text-secondary on active 5.6 5.9
47
+ * Non-text (3:1 needed): caret, focus ring of the controls, region rail and mark, drag indicator = the accent above (6.7 dark, 5.4 light
48
+ * on the pane; the region mark uses #F04E31 on light, 3.6:1). The pane's own focus state is its border (no outline): resting -> focused
49
+ * is #232327 -> #75757B (3.4:1 between the two, 4.0:1 on the pane) in dark, #E4E4DF -> #7C7C82 (3.3:1, 4.2:1 on the pane) in light. Hairlines (borders, region rule, divider) are decorative separators, deliberately
50
+ * quiet (1.3:1 to 1.5:1), as in the site design system.
51
+ * Placeholders and the region seam use text-muted (4.5:1 or more); a completed to-do is set in text-muted with a strike-through.
52
+ *
53
+ * Requires `light-dark()` and `color-scheme` (Chrome 123, Firefox 120, Safari 17.5).
54
+ */
55
+
56
+ .nb-theme-atelier {
57
+ color-scheme: dark;
58
+
59
+ /* ── Palette: light-dark(LIGHT, DARK) ─────────────────────────────────────────────── */
60
+ --atelier-pane: light-dark(#FFFFFF, #141416); /* the editor surface */
61
+ --atelier-float: light-dark(#FFFFFF, #1C1C20); /* toolbar, menus, popovers */
62
+ --atelier-sunken: light-dark(#F3F3F0, #0F0F11); /* code blocks */
63
+ --atelier-code: light-dark(#EFEFEB, #0F0F11); /* inline code */
64
+ --atelier-hover: light-dark(#F0F0EC, #26262B);
65
+ --atelier-active: light-dark(#E6E6E0, #303036);
66
+ --atelier-line: light-dark(#D4D4CE, #2A2A2E); /* borders, hairlines */
67
+ --atelier-line-soft: light-dark(#ECECE8, #1E1E21);
68
+ --atelier-line-pane: light-dark(#E4E4DF, #232327); /* the pane border */
69
+ --atelier-line-pane-focus: light-dark(#7C7C82, #75757B); /* the pane border while focused: 3.3:1 / 3.4:1 against the resting one */
70
+ --atelier-text: light-dark(#141416, #EDEDED);
71
+ --atelier-text-2: light-dark(#55555B, #A9A9AE);
72
+ --atelier-text-3: light-dark(#6B6B72, #8A8A90);
73
+ --atelier-accent: light-dark(#C2381F, #FF6F61);
74
+ --atelier-accent-fill: light-dark(#F04E31, #FF6F61);
75
+ --atelier-selection: light-dark(rgba(240, 78, 49, 0.2), rgba(255, 111, 97, 0.3));
76
+ --atelier-ring: light-dark(#C2381F, #FF6F61);
77
+ --atelier-peer: light-dark(#2F62CC, #7AA2F7);
78
+
79
+ /* ── Geometry the host may change ─────────────────────────────────────────────────── */
80
+ --atelier-pane-padding: 36px 40px;
81
+ --atelier-pane-radius: 16px;
82
+ --atelier-font-size: 16px;
83
+ --atelier-rail-offset: -28px; /* region rail, from the text's left edge: inside the pane padding, left of the drag handle */
84
+
85
+ /* ── Fonts (provided by the host, see the header) ─────────────────────────────────── */
86
+ --nb-font-text: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
87
+ --nb-font-heading: Syne, Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
88
+ --nb-font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
89
+
90
+ /* ── UI backgrounds ───────────────────────────────────────────────────────────────── */
91
+ --nb-bg-surface: var(--atelier-float);
92
+ --nb-bg-surface-sunken: var(--atelier-sunken);
93
+ --nb-bg-surface-hover: var(--atelier-hover);
94
+ --nb-bg-surface-active: var(--atelier-active);
95
+ --nb-bg-hover: var(--atelier-hover);
96
+
97
+ /* ── Borders and lines ────────────────────────────────────────────────────────────── */
98
+ --nb-border: var(--atelier-line);
99
+ --nb-border-subtle: var(--atelier-line-soft);
100
+ --nb-border-focus: var(--atelier-ring);
101
+
102
+ /* ── Text ─────────────────────────────────────────────────────────────────────────── */
103
+ --nb-text-primary: var(--atelier-text);
104
+ --nb-text-secondary: var(--atelier-text-2);
105
+ --nb-text-muted: var(--atelier-text-3);
106
+ --nb-text-placeholder: var(--atelier-text-3);
107
+ --nb-link: var(--atelier-accent);
108
+
109
+ /* ── Accent and status ────────────────────────────────────────────────────────────── */
110
+ --nb-accent: var(--atelier-accent);
111
+ --nb-success: light-dark(#15803D, #4ADE80);
112
+ --nb-success-bg: light-dark(rgba(21, 128, 61, 0.12), rgba(74, 222, 128, 0.14));
113
+ --nb-warning: light-dark(rgba(180, 83, 9, 0.35), rgba(245, 158, 11, 0.4));
114
+ --nb-danger: light-dark(rgba(185, 28, 28, 0.35), rgba(255, 138, 128, 0.4));
115
+ --nb-error: light-dark(#B91C1C, #FF8A80);
116
+
117
+ /* ── Floating UI (toolbar, slash menu, command surfaces) ──────────────────────────── */
118
+ --nb-floating-shadow: 0 10px 30px light-dark(rgba(20, 20, 22, 0.14), rgba(0, 0, 0, 0.5));
119
+ --nb-floating-radius: 10px;
120
+ --nb-command-radius: 8px;
121
+ --nb-command-shadow: var(--nb-floating-shadow);
122
+ --nb-command-accent: var(--atelier-accent);
123
+ --nb-command-fill: light-dark(rgba(194, 56, 31, 0.1), rgba(255, 111, 97, 0.14));
124
+ --nb-command-border: var(--atelier-line);
125
+ --nb-command-track: var(--atelier-line);
126
+
127
+ /* ── Shadows and glass (the library theme's, kept flat) ───────────────────────────── */
128
+ --nb-shadow-lg: var(--nb-floating-shadow);
129
+ --nb-shadow-inset: inset 0 1px 2px light-dark(rgba(20, 20, 22, 0.06), rgba(0, 0, 0, 0.35));
130
+ --nb-shadow-glow: 0 0 0 2px light-dark(rgba(194, 56, 31, 0.18), rgba(255, 111, 97, 0.22));
131
+ --nb-glass-blur: none;
132
+ --nb-glass-blur-sm: none;
133
+
134
+ /* ── Regions: the seam (mark + small caps label + hairline), the rail, the end marker ─ */
135
+ --nb-region-color: var(--atelier-text-3);
136
+ --nb-region-title-color: var(--atelier-text-3);
137
+ --nb-region-rule-color: var(--atelier-line);
138
+ --nb-region-label-size: 11px;
139
+ --nb-region-label-weight: 500;
140
+ --nb-region-gap: 10px;
141
+ --nb-region-font: var(--nb-font-text);
142
+ --nb-region-text-transform: uppercase;
143
+ --nb-region-letter-spacing: 0.06em;
144
+ --nb-region-warning: light-dark(#B45309, #F59E0B);
145
+ --nb-region-rail: var(--atelier-accent);
146
+ --nb-region-end-color: var(--atelier-text-3);
147
+ --nb-region-end-size: 11px;
148
+ --nb-region-rail-offset: var(--atelier-rail-offset);
149
+ /* The mark of the brand, 16px wide, in front of the label. Dark: #FF6F61; light: #F04E31 (the fill, 3.6:1 on white). */
150
+ --nb-region-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 13 100 74' width='16' height='12' fill='%23FF6F61'%3E%3Cpath d='M20.31 28.86L27.75 13.25L47.79 13.19L60.16 28.71L52.71 44.31L40.34 28.8ZM60.16 28.71L67.6 13.1L87.63 13.04L100 28.56L92.56 44.16L80.19 28.65ZM79.69 71.14L72.25 86.75L52.21 86.81L39.84 71.29L47.29 55.69L59.66 71.2ZM39.84 71.29L32.4 86.9L12.37 86.96L0 71.44L7.44 55.84L19.81 71.35Z'/%3E%3C/svg%3E");
151
+ }
152
+
153
+ .nb-theme-atelier[data-nb-scheme="light"] {
154
+ color-scheme: light;
155
+ --nb-region-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 13 100 74' width='16' height='12' fill='%23F04E31'%3E%3Cpath d='M20.31 28.86L27.75 13.25L47.79 13.19L60.16 28.71L52.71 44.31L40.34 28.8ZM60.16 28.71L67.6 13.1L87.63 13.04L100 28.56L92.56 44.16L80.19 28.65ZM79.69 71.14L72.25 86.75L52.21 86.81L39.84 71.29L47.29 55.69L59.66 71.2ZM39.84 71.29L32.4 86.9L12.37 86.96L0 71.44L7.44 55.84L19.81 71.35Z'/%3E%3C/svg%3E");
156
+ }
157
+
158
+ .nb-theme-atelier[data-nb-scheme="auto"] {
159
+ color-scheme: light dark;
160
+ }
161
+
162
+ @media (prefers-color-scheme: light) {
163
+ .nb-theme-atelier[data-nb-scheme="auto"] {
164
+ --nb-region-mark: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 13 100 74' width='16' height='12' fill='%23F04E31'%3E%3Cpath d='M20.31 28.86L27.75 13.25L47.79 13.19L60.16 28.71L52.71 44.31L40.34 28.8ZM60.16 28.71L67.6 13.1L87.63 13.04L100 28.56L92.56 44.16L80.19 28.65ZM79.69 71.14L72.25 86.75L52.21 86.81L39.84 71.29L47.29 55.69L59.66 71.2ZM39.84 71.29L32.4 86.9L12.37 86.96L0 71.44L7.44 55.84L19.81 71.35Z'/%3E%3C/svg%3E");
165
+ }
166
+ }
167
+
168
+ /* ══ The pane: the editor element ═══════════════════════════════════════════════════════ */
169
+
170
+ .nb-theme-atelier .nabu-editor[data-nabu-root] {
171
+ box-sizing: border-box;
172
+ padding: var(--atelier-pane-padding);
173
+ background: var(--atelier-pane);
174
+ border: 1px solid var(--atelier-line-pane);
175
+ border-radius: var(--atelier-pane-radius);
176
+ color: var(--atelier-text);
177
+ font-family: var(--nb-font-text);
178
+ font-size: var(--atelier-font-size);
179
+ line-height: 1.65;
180
+ caret-color: var(--atelier-accent);
181
+ }
182
+
183
+ /* Focus: the caret (coral) is the indicator inside the text; the pane itself only strengthens its border (WCAG 2.4.7: 3.3:1 dark /
184
+ 3.4:1 light against the resting border, 3.4+ against the pane and the page). No outline: it would read as a form field. */
185
+ .nb-theme-atelier .nabu-editor[data-nabu-root]:focus-visible {
186
+ outline: none;
187
+ border-color: var(--atelier-line-pane-focus);
188
+ }
189
+
190
+ .nb-theme-atelier .nabu-editor ::selection {
191
+ background: var(--atelier-selection);
192
+ }
193
+
194
+ @media (max-width: 759.98px) {
195
+ .nb-theme-atelier {
196
+ --atelier-pane-padding: 24px 20px;
197
+ --atelier-rail-offset: -13px; /* no room for the handle: the rail comes closer to the text */
198
+ }
199
+ }
200
+
201
+ /* ══ Blocks ═══════════════════════════════════════════════════════════════════════════ */
202
+
203
+ /* Paragraphs: ~11px between blocks (at 16px). */
204
+ .nb-theme-atelier .nabu-editor [data-block-type="paragraph"] {
205
+ margin-bottom: 0.67em;
206
+ }
207
+
208
+ /* Headings: Syne 700, tight. */
209
+ .nb-theme-atelier .nabu-editor [data-block-type="heading"] {
210
+ margin: 1.1em 0 0.4em;
211
+ font-family: var(--nb-font-heading);
212
+ font-weight: 700;
213
+ line-height: 1.15;
214
+ letter-spacing: -0.02em;
215
+ }
216
+ .nb-theme-atelier .nabu-editor > [data-block-type="heading"]:first-child,
217
+ .nb-theme-atelier .nabu-editor > .nabu-chunk:first-child > [data-block-type="heading"]:first-child,
218
+ .nb-theme-atelier .nabu-editor .nabu-region-body > [data-block-type="heading"]:first-child,
219
+ .nb-theme-atelier .nabu-editor .nabu-region-body > .nabu-chunk:first-child > [data-block-type="heading"]:first-child {
220
+ margin-top: 0;
221
+ }
222
+ .nb-theme-atelier .nabu-editor h1[data-block-type="heading"] { font-size: 2em; }
223
+ .nb-theme-atelier .nabu-editor h2[data-block-type="heading"] { font-size: 1.55em; }
224
+ .nb-theme-atelier .nabu-editor h3[data-block-type="heading"] { font-size: 1.25em; line-height: 1.2; letter-spacing: -0.01em; }
225
+ .nb-theme-atelier .nabu-editor h4[data-block-type="heading"] { font-size: 1.1em; line-height: 1.3; letter-spacing: -0.01em; }
226
+ .nb-theme-atelier .nabu-editor h5[data-block-type="heading"],
227
+ .nb-theme-atelier .nabu-editor h6[data-block-type="heading"] { font-size: 1em; line-height: 1.4; letter-spacing: 0; }
228
+
229
+ /* Quote: a coral bar, secondary text. */
230
+ .nb-theme-atelier .nabu-editor [data-block-type="blockquote"] {
231
+ border-left: 3px solid var(--atelier-accent-fill);
232
+ padding-left: 1em;
233
+ }
234
+
235
+ /* Lists: quiet markers; a completed to-do is muted and struck, not faded (opacity would drop it under 4.5:1). */
236
+ .nb-theme-atelier .nabu-editor li::marker {
237
+ color: var(--atelier-text-3);
238
+ }
239
+ .nb-theme-atelier .nabu-editor .nabu-todo-check {
240
+ color: var(--atelier-text-3);
241
+ font-family: var(--nb-font-text);
242
+ }
243
+ .nb-theme-atelier .nabu-editor .nabu-todo-check[aria-pressed="true"] {
244
+ color: var(--atelier-accent);
245
+ }
246
+ .nb-theme-atelier .nabu-editor .item-content.checked {
247
+ opacity: 1;
248
+ color: var(--atelier-text-3);
249
+ }
250
+
251
+ /* Divider: a hairline with room. */
252
+ .nb-theme-atelier .nabu-editor [data-block-type="divider"] {
253
+ margin: 1.5em 0;
254
+ }
255
+
256
+ /* Code block: mono, sunken, 10px radius. (The library's inline-code rule also reaches the <pre>: its tint is cancelled here.) */
257
+ .nb-theme-atelier .nabu-editor .nabu-code-wrapper {
258
+ border-radius: 10px;
259
+ margin: 0.75em 0;
260
+ }
261
+ .nb-theme-atelier .nabu-editor .nabu-code-wrapper pre.nabu-code {
262
+ background: none;
263
+ font-size: 13px;
264
+ line-height: 1.7;
265
+ padding: 1em 1.1em;
266
+ }
267
+ .nb-theme-atelier .nabu-editor .nabu-code-lang {
268
+ font-family: var(--nb-font-text);
269
+ font-size: 11px;
270
+ border-radius: 6px;
271
+ }
272
+
273
+ /* Inline code. */
274
+ .nb-theme-atelier .nabu-editor span.nabu-code {
275
+ font-family: var(--nb-font-mono);
276
+ font-size: 0.86em;
277
+ background: var(--atelier-code);
278
+ border-radius: 6px;
279
+ padding: 0.12em 0.4em;
280
+ }
281
+
282
+ /* Links. */
283
+ .nb-theme-atelier .nabu-editor .nabu-link {
284
+ text-decoration-thickness: 1px;
285
+ text-underline-offset: 0.18em;
286
+ }
287
+
288
+ /* Callout: five tints, text stays primary on a faint wash. */
289
+ .nb-theme-atelier .nabu-editor .nabu-callout { border-radius: 10px; }
290
+ .nb-theme-atelier .nabu-editor .nabu-callout.callout-note { --callout-accent: var(--atelier-peer); }
291
+ .nb-theme-atelier .nabu-editor .nabu-callout.callout-tip { --callout-accent: light-dark(#15803D, #3ECF8E); }
292
+ .nb-theme-atelier .nabu-editor .nabu-callout.callout-important { --callout-accent: light-dark(#6D28D9, #A78BFA); }
293
+ .nb-theme-atelier .nabu-editor .nabu-callout.callout-warning { --callout-accent: light-dark(#B45309, #F59E0B); }
294
+ .nb-theme-atelier .nabu-editor .nabu-callout.callout-caution { --callout-accent: light-dark(#B91C1C, #EF4444); }
295
+
296
+ /* ══ Floating UI ══════════════════════════════════════════════════════════════════════ */
297
+
298
+ /* Buttons do not inherit the font by default: give every floating surface the text family. */
299
+ .nb-theme-atelier :is(.nabu-toolbar, .nabu-slash, .nabu-command-chooser, .nabu-command-invite) {
300
+ font-family: var(--nb-font-text);
301
+ }
302
+ .nb-theme-atelier :is(.nabu-toolbar, .nabu-slash, .nabu-command-chooser, .nabu-command-invite) :is(button, select) {
303
+ font-family: inherit;
304
+ }
305
+
306
+ .nb-theme-atelier .nabu-toolbar-btn,
307
+ .nb-theme-atelier .nabu-slash-item {
308
+ border-radius: 7px;
309
+ }
310
+
311
+ .nb-theme-atelier :is(.nabu-toolbar-btn, .nabu-slash-item, .nabu-drag-handle, .nabu-todo-check, .nabu-callout-icon, .nabu-code-lang):focus-visible {
312
+ outline: 2px solid var(--atelier-ring);
313
+ outline-offset: 1px;
314
+ }
315
+
316
+ .nb-theme-atelier .nabu-drag-handle {
317
+ border-radius: 6px;
318
+ }