@damiro/stylo 0.7.0 → 0.9.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 (146) hide show
  1. package/README.md +24 -10
  2. package/dist/{InPlaceView-CS1qy-Ba.js → InPlaceView-Bu91_3Ig.js} +1199 -855
  3. package/dist/InPlaceView-Bu91_3Ig.js.map +1 -0
  4. package/dist/Preview-AaGGwLQP.js +170 -0
  5. package/dist/Preview-AaGGwLQP.js.map +1 -0
  6. package/dist/SplitView.d.ts +4 -2
  7. package/dist/SplitView.d.ts.map +1 -1
  8. package/dist/Stylo.d.ts.map +1 -1
  9. package/dist/editor/SourceView.d.ts +4 -2
  10. package/dist/editor/SourceView.d.ts.map +1 -1
  11. package/dist/editor/extensions.d.ts +2 -2
  12. package/dist/editor/extensions.d.ts.map +1 -1
  13. package/dist/editor/useCodeMirror.d.ts +4 -2
  14. package/dist/editor/useCodeMirror.d.ts.map +1 -1
  15. package/dist/editor/wikilink-complete.d.ts +5 -3
  16. package/dist/editor/wikilink-complete.d.ts.map +1 -1
  17. package/dist/embed-B2Dfkpd_.js +124 -0
  18. package/dist/embed-B2Dfkpd_.js.map +1 -0
  19. package/dist/embed.d.ts +14 -0
  20. package/dist/embed.d.ts.map +1 -0
  21. package/dist/frontmatter-DGUkb9z-.js +39 -0
  22. package/dist/frontmatter-DGUkb9z-.js.map +1 -0
  23. package/dist/index.d.ts +1 -1
  24. package/dist/index.d.ts.map +1 -1
  25. package/dist/inplace/InPlaceView.d.ts +11 -2
  26. package/dist/inplace/InPlaceView.d.ts.map +1 -1
  27. package/dist/inplace/config.d.ts +8 -0
  28. package/dist/inplace/config.d.ts.map +1 -1
  29. package/dist/inplace/context-menu-actions.d.ts +5 -14
  30. package/dist/inplace/context-menu-actions.d.ts.map +1 -1
  31. package/dist/inplace/context-menu-helpers.d.ts +30 -0
  32. package/dist/inplace/context-menu-helpers.d.ts.map +1 -0
  33. package/dist/inplace/context-menu-shell.d.ts +23 -0
  34. package/dist/inplace/context-menu-shell.d.ts.map +1 -0
  35. package/dist/inplace/context-menu-types.d.ts +46 -0
  36. package/dist/inplace/context-menu-types.d.ts.map +1 -0
  37. package/dist/inplace/context-menu.d.ts +2 -42
  38. package/dist/inplace/context-menu.d.ts.map +1 -1
  39. package/dist/inplace/decorate.d.ts.map +1 -1
  40. package/dist/inplace/edit-boundaries.d.ts +1 -25
  41. package/dist/inplace/edit-boundaries.d.ts.map +1 -1
  42. package/dist/inplace/edit-divider.d.ts +27 -0
  43. package/dist/inplace/edit-divider.d.ts.map +1 -0
  44. package/dist/inplace/embed-registry.d.ts +39 -0
  45. package/dist/inplace/embed-registry.d.ts.map +1 -0
  46. package/dist/inplace/embed.d.ts +8 -0
  47. package/dist/inplace/embed.d.ts.map +1 -0
  48. package/dist/inplace/extension.d.ts +6 -0
  49. package/dist/inplace/extension.d.ts.map +1 -1
  50. package/dist/inplace/inline-md.d.ts +6 -1
  51. package/dist/inplace/inline-md.d.ts.map +1 -1
  52. package/dist/inplace/link-row.d.ts +21 -0
  53. package/dist/inplace/link-row.d.ts.map +1 -0
  54. package/dist/inplace/math-edit.d.ts +36 -0
  55. package/dist/inplace/math-edit.d.ts.map +1 -0
  56. package/dist/inplace/math.d.ts +12 -0
  57. package/dist/inplace/math.d.ts.map +1 -1
  58. package/dist/inplace/menu-plugin.d.ts.map +1 -1
  59. package/dist/inplace/nodes-blocks.d.ts +14 -0
  60. package/dist/inplace/nodes-blocks.d.ts.map +1 -0
  61. package/dist/inplace/nodes-inline.d.ts +16 -0
  62. package/dist/inplace/nodes-inline.d.ts.map +1 -0
  63. package/dist/inplace/nodes.d.ts +3 -2
  64. package/dist/inplace/nodes.d.ts.map +1 -1
  65. package/dist/inplace/scan.d.ts +6 -0
  66. package/dist/inplace/scan.d.ts.map +1 -1
  67. package/dist/inplace/selection-bar-position.d.ts +31 -0
  68. package/dist/inplace/selection-bar-position.d.ts.map +1 -0
  69. package/dist/inplace/selection-bar.d.ts +0 -2
  70. package/dist/inplace/selection-bar.d.ts.map +1 -1
  71. package/dist/inplace/table-widget-caret.d.ts +11 -0
  72. package/dist/inplace/table-widget-caret.d.ts.map +1 -0
  73. package/dist/inplace/table-widget-render.d.ts +18 -0
  74. package/dist/inplace/table-widget-render.d.ts.map +1 -0
  75. package/dist/inplace/table-widget.d.ts +5 -2
  76. package/dist/inplace/table-widget.d.ts.map +1 -1
  77. package/dist/inplace/tables.d.ts.map +1 -1
  78. package/dist/inplace/theme-callout.d.ts +50 -0
  79. package/dist/inplace/theme-callout.d.ts.map +1 -0
  80. package/dist/inplace/theme-canvas.d.ts +166 -0
  81. package/dist/inplace/theme-canvas.d.ts.map +1 -0
  82. package/dist/inplace/theme-fonts.d.ts +4 -0
  83. package/dist/inplace/theme-fonts.d.ts.map +1 -0
  84. package/dist/inplace/theme-menu.d.ts +87 -0
  85. package/dist/inplace/theme-menu.d.ts.map +1 -0
  86. package/dist/inplace/theme-popups.d.ts +94 -0
  87. package/dist/inplace/theme-popups.d.ts.map +1 -0
  88. package/dist/inplace/theme-table-gizmos.d.ts +57 -0
  89. package/dist/inplace/theme-table-gizmos.d.ts.map +1 -0
  90. package/dist/inplace/theme-table.d.ts +30 -0
  91. package/dist/inplace/theme-table.d.ts.map +1 -0
  92. package/dist/inplace/theme.d.ts +5 -0
  93. package/dist/inplace/theme.d.ts.map +1 -1
  94. package/dist/inplace/wikilinks.d.ts.map +1 -1
  95. package/dist/inplace/wrap-at.d.ts +32 -0
  96. package/dist/inplace/wrap-at.d.ts.map +1 -0
  97. package/dist/{markdown-N3lRmU2n.js → markdown-BYXs9Tj8.js} +2 -2
  98. package/dist/{markdown-N3lRmU2n.js.map → markdown-BYXs9Tj8.js.map} +1 -1
  99. package/dist/render/Embed.d.ts +24 -0
  100. package/dist/render/Embed.d.ts.map +1 -0
  101. package/dist/render/Preview.d.ts +6 -2
  102. package/dist/render/Preview.d.ts.map +1 -1
  103. package/dist/render/embed-cache.d.ts +10 -0
  104. package/dist/render/embed-cache.d.ts.map +1 -0
  105. package/dist/render/remark-embed.d.ts +19 -0
  106. package/dist/render/remark-embed.d.ts.map +1 -0
  107. package/dist/styles.css +1 -1
  108. package/dist/stylo.js +70 -54
  109. package/dist/stylo.js.map +1 -1
  110. package/dist/toolbar/block.d.ts +0 -26
  111. package/dist/toolbar/block.d.ts.map +1 -1
  112. package/dist/toolbar/command-helpers.d.ts +57 -0
  113. package/dist/toolbar/command-helpers.d.ts.map +1 -0
  114. package/dist/toolbar/commands.d.ts +1 -21
  115. package/dist/toolbar/commands.d.ts.map +1 -1
  116. package/dist/toolbar/frontmatter-toggle.d.ts +13 -0
  117. package/dist/toolbar/frontmatter-toggle.d.ts.map +1 -0
  118. package/dist/toolbar/heading.d.ts +10 -0
  119. package/dist/toolbar/heading.d.ts.map +1 -0
  120. package/dist/toolbar/inline-ops.d.ts +3 -53
  121. package/dist/toolbar/inline-ops.d.ts.map +1 -1
  122. package/dist/toolbar/link-ops.d.ts +22 -0
  123. package/dist/toolbar/link-ops.d.ts.map +1 -0
  124. package/dist/toolbar/rule.d.ts +11 -0
  125. package/dist/toolbar/rule.d.ts.map +1 -0
  126. package/dist/toolbar/table-position.d.ts +32 -0
  127. package/dist/toolbar/table-position.d.ts.map +1 -0
  128. package/dist/toolbar/table.d.ts +1 -16
  129. package/dist/toolbar/table.d.ts.map +1 -1
  130. package/dist/toolbar/underline-ops.d.ts +15 -0
  131. package/dist/toolbar/underline-ops.d.ts.map +1 -0
  132. package/dist/toolbar/wikilink-ops.d.ts +22 -0
  133. package/dist/toolbar/wikilink-ops.d.ts.map +1 -0
  134. package/dist/types.d.ts +48 -0
  135. package/dist/types.d.ts.map +1 -1
  136. package/dist/{useCodeMirror-GPSkaYW6.js → useCodeMirror-DtwupFgc.js} +559 -531
  137. package/dist/useCodeMirror-DtwupFgc.js.map +1 -0
  138. package/package.json +2 -1
  139. package/dist/InPlaceView-CS1qy-Ba.js.map +0 -1
  140. package/dist/Preview-Bw0k3Mev.js +0 -93
  141. package/dist/Preview-Bw0k3Mev.js.map +0 -1
  142. package/dist/callout-oLE630ZP.js +0 -37
  143. package/dist/callout-oLE630ZP.js.map +0 -1
  144. package/dist/useCodeMirror-GPSkaYW6.js.map +0 -1
  145. package/dist/wikilink-CTR8IFKc.js +0 -42
  146. package/dist/wikilink-CTR8IFKc.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import type { EditorView } from "@codemirror/view";
2
- import type { CodeLanguages, InPlaceConfig, WikiLinkSource } from "../types";
2
+ import type { CodeLanguages, EmbedSource, InPlaceConfig, ResolveErrorInfo, WikiLinkSource } from "../types";
3
3
  export interface InPlaceViewProps {
4
4
  value: string;
5
5
  onChange: (next: string) => void;
@@ -14,6 +14,10 @@ export interface InPlaceViewProps {
14
14
  codeLanguages?: CodeLanguages;
15
15
  /** `[[wikilink]]` autocomplete source. Read once. */
16
16
  wikiLinkSource?: WikiLinkSource;
17
+ /** Resolves `![[ref]]` embeds. Read once, at mount — see ADR-009. */
18
+ embedSource?: EmbedSource;
19
+ /** Notified when `embedSource` or `wikiLinkSource` rejects. */
20
+ onResolveError?: (error: unknown, info: ResolveErrorInfo) => void;
17
21
  /** Called with the doc string on `Mod-s`. */
18
22
  onSave?: (value: string) => void;
19
23
  /** Called with the `EditorView` once created, and with `null` on teardown. */
@@ -27,6 +31,11 @@ export interface InPlaceViewProps {
27
31
  * The extension array (and the `inPlace` config baked into it) is built once;
28
32
  * `onWikiLinkClick` is reached through a ref so a changed handler does not force
29
33
  * the editor to be rebuilt.
34
+ *
35
+ * `![[ref]]` embeds (ADR-009): each off-caret lone-line embed contributes an
36
+ * inert slot `<div>` via `EmbedWidget`; this component subscribes to the
37
+ * `EmbedRegistry` and portals a host `<Embed>` into every live slot, so one
38
+ * React tree — reusing `Embed` verbatim — serves the canvas and `preview` alike.
30
39
  */
31
- export declare function InPlaceView({ value, onChange, readOnly, placeholder, onWikiLinkClick, onLinkClick, inPlace, codeLanguages, wikiLinkSource, onSave, onViewChange, }: InPlaceViewProps): import("react").JSX.Element;
40
+ export declare function InPlaceView({ value, onChange, readOnly, placeholder, onWikiLinkClick, onLinkClick, inPlace, codeLanguages, wikiLinkSource, embedSource, onResolveError, onSave, onViewChange, }: InPlaceViewProps): import("react").JSX.Element;
32
41
  //# sourceMappingURL=InPlaceView.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InPlaceView.d.ts","sourceRoot":"","sources":["../../src/inplace/InPlaceView.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAGlD,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAA;AAG5E,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAA;IACb,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,qDAAqD;IACrD,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,uDAAuD;IACvD,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB,2EAA2E;IAC3E,aAAa,CAAC,EAAE,aAAa,CAAA;IAC7B,qDAAqD;IACrD,cAAc,CAAC,EAAE,cAAc,CAAA;IAC/B,6CAA6C;IAC7C,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IAChC,8EAA8E;IAC9E,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,KAAK,IAAI,CAAA;CACjD;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAK,EACL,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW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QAAQ,EACR,QAAQ,EACR,WAAW,EACX,eAAe,EACf,WAAW,EACX,OAAO,EACP,aAAa,EACb,cAAc,EACd,WAAW,EACX,cAAc,EACd,MAAM,EACN,YAAY,GACb,EAAE,gBAAgB,+BAgDlB"}
@@ -1,5 +1,6 @@
1
1
  import { Facet } from "@codemirror/state";
2
2
  import type { InPlaceConfig, InPlaceDecorationToggles, MenuGroupId, RevealMode, SelectionUI, TableEditing, ToolbarCommandId } from "../types";
3
+ import type { EmbedRegistry } from "./embed-registry";
3
4
  /** `InPlaceDecorationToggles` with every key resolved to a concrete boolean. */
4
5
  export type ResolvedToggles = Required<InPlaceDecorationToggles>;
5
6
  export declare function resolveToggles(config?: InPlaceConfig): ResolvedToggles;
@@ -9,6 +10,13 @@ export declare function resolveToggles(config?: InPlaceConfig): ResolvedToggles;
9
10
  * written, by `decorate.ts`, `math.ts`, `frontmatter.ts`, and `tables.ts`.
10
11
  */
11
12
  export declare const inPlaceConfigFacet: Facet<Required<InPlaceDecorationToggles>, Required<InPlaceDecorationToggles>>;
13
+ /**
14
+ * The per-canvas `EmbedRegistry`, or `null` when the host passed no
15
+ * `embedSource`. Seeded once by `inPlaceExtension`; read by `embed.ts` (to gate
16
+ * the pass and hand the widget its registry) and `wikilinks.ts` (to yield the
17
+ * `[[ref]]` inside a `![[ref]]` to the embed pass). See ADR-009.
18
+ */
19
+ export declare const embedRegistryFacet: Facet<EmbedRegistry | null, EmbedRegistry | null>;
12
20
  /** Table editing mode, seeded once by `inPlaceExtension`; read by `tables.ts`. */
13
21
  export declare const tableEditingFacet: Facet<TableEditing, TableEditing>;
14
22
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/inplace/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AACzC,OAAO,KAAK,EACV,aAAa,EACb,wBAAwB,EACxB,WAAW,EACX,UAAU,EACV,WAAW,EACX,YAAY,EACZ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4,11 @@
4
4
  * Paragraph / Insert submenus, then clipboard. Every command already carries
5
5
  * its own `run` / `isActive` / `disabled`, so an item that can't apply where
6
6
  * the caret sits is greyed, not hidden — the menu shape stays put.
7
+ *
8
+ * The individual field/action rows for each inline construct live beside that
9
+ * construct's own file — `linkRow` / `wikiLinkRow` in `link-row.ts`, `mathRow`
10
+ * in `math-edit.ts`, `dividerRow` in `edit-divider.ts` — this file is the
11
+ * assembly: which rows a given context offers, and in what order.
7
12
  */
8
13
  import type { EditorView } from "@codemirror/view";
9
14
  import type { MenuField, MenuRow } from "./context-menu";
@@ -14,20 +19,6 @@ import type { MenuField, MenuRow } from "./context-menu";
14
19
  * so the Format group still applies.
15
20
  */
16
21
  export declare function cellHasSelection(view: EditorView): boolean;
17
- /**
18
- * The "Add external link" row — an editable `[text](url)` URL field. Prefilled,
19
- * with Open / Remove and the label "Edit external link", when the caret sits in
20
- * an existing `[text](url)`; otherwise an empty field that wraps the selection
21
- * (or the word the menu just selected) on submit.
22
- */
23
- export declare function linkRow(view: EditorView): MenuField;
24
- /**
25
- * The "Add link" row — an editable `[[target]]` field for an internal link.
26
- * Prefilled, with Remove and the label "Edit link", when the caret sits in an
27
- * existing `[[target|label]]`; otherwise an empty field that wraps the
28
- * selection (or the word the menu just selected) on submit.
29
- */
30
- export declare function wikiLinkRow(view: EditorView): MenuField;
31
22
  /**
32
23
  * The "Language" row shown when the caret is in a fenced code block: an
33
24
  * editable info string (` ```ts `), plus **Remove code block** to unwrap it.
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu-actions.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu-actions.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAQlD,OAAO,KAAK,EAAc,SAAS,EAAE,OAAO,EAAe,MAAM,gBAAgB,CAAA;AAejF;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAK1D;AA+GD;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAgEnD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CA6DvD;AASD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAsBxD;AASD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,EAAE,CAQ7D;AAyBD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,EAAE,CA0CpD"}
1
+ {"version":3,"file":"context-menu-actions.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu-actions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAOlD,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAA;AAmBxD;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAK1D;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAsBxD;AAgBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,EAAE,CAQ7D;AAkBD;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,EAAE,CAkDpD"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * The generic building blocks `context-menu-actions.ts`'s row groups are built
3
+ * from: mapping a `ToolbarCommandId` onto a `MenuAction`, the clipboard rows,
4
+ * and the small row/group assembly helpers.
5
+ */
6
+ import type { EditorView } from "@codemirror/view";
7
+ import type { ToolbarCommandId } from "../types";
8
+ import type { MenuAction, MenuRow, MenuSubmenu } from "./context-menu";
9
+ /** Menu glyph for a command id — headings share one, the rest map by id. */
10
+ export declare const iconFor: (id: ToolbarCommandId) => string | undefined;
11
+ /** Obsidian's three grouped submenus, adapted to the commands Stylo has. */
12
+ export declare const FORMAT_MARK_IDS: ToolbarCommandId[];
13
+ export declare const FORMAT_CODE_IDS: ToolbarCommandId[];
14
+ export declare const PARA_LIST_IDS: ToolbarCommandId[];
15
+ export declare const PARA_HEADING_IDS: ToolbarCommandId[];
16
+ export declare const INSERT_INLINE_IDS: ToolbarCommandId[];
17
+ export declare const INSERT_BLOCK_IDS: ToolbarCommandId[];
18
+ /**
19
+ * `inCell`: the selection is a table cell's DOM range, not `state.selection`, so
20
+ * `cmd.disabled` / `cmd.isActive` (which read `state.selection`, collapsed here)
21
+ * would grey every item out. The inline commands route through `runInlineInCell`
22
+ * regardless, so force them live — same call the floating selection bar makes.
23
+ */
24
+ export declare const toAction: (view: EditorView, id: ToolbarCommandId, inCell?: boolean) => MenuAction | null;
25
+ export declare const actions: (view: EditorView, ids: ToolbarCommandId[], dropDisabled?: boolean, inCell?: boolean) => MenuAction[];
26
+ export declare const clipboardRows: (view: EditorView) => MenuRow[];
27
+ export declare const submenu: (label: string, icon: string | undefined, rows: MenuRow[], disabled?: boolean) => MenuSubmenu;
28
+ /** Append `add` as its own separator-delimited group. */
29
+ export declare function pushGroup(rows: MenuRow[], add: MenuRow[]): void;
30
+ //# sourceMappingURL=context-menu-helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu-helpers.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu-helpers.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAClD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAA;AAIhD,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAEtE,4EAA4E;AAC5E,eAAO,MAAM,OAAO,OAAQ,gBAAgB,KAAG,MAAM,GAAG,SACyB,CAAA;AAEjF,4EAA4E;AAC5E,eAAO,MAAM,eAAe,EAAE,gBAAgB,EAAiC,CAAA;AAC/E,eAAO,MAAM,eAAe,EAAE,gBAAgB,EAAqB,CAAA;AACnE,eAAO,MAAM,aAAa,EAAE,gBAAgB,EAA0C,CAAA;AACtF,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,EAAuB,CAAA;AACtE,eAAO,MAAM,iBAAiB,EAAE,gBAAgB,EAAoB,CAAA;AACpE,eAAO,MAAM,gBAAgB,EAAE,gBAAgB,EAA8C,CAAA;AAE7F;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,SACb,UAAU,MACZ,gBAAgB,uBAEnB,UAAU,GAAG,IAaf,CAAA;AAED,eAAO,MAAM,OAAO,SACZ,UAAU,OACX,gBAAgB,EAAE,+CAGtB,UAAU,EAOZ,CAAA;AAED,eAAO,MAAM,aAAa,SAAU,UAAU,KAAG,OAAO,EA0CvD,CAAA;AAED,eAAO,MAAM,OAAO,UACX,MAAM,QACP,MAAM,GAAG,SAAS,QAClB,OAAO,EAAE,yBAEd,WAAgD,CAAA;AAEnD,yDAAyD;AACzD,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,GAAG,IAAI,CAI/D"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * The floating-popup mechanics `context-menu.ts`'s panels share with each
3
+ * other: viewport placement, and outside-press / Escape / delayed-scroll
4
+ * dismissal. Nothing here knows about menu rows.
5
+ */
6
+ /** Place a fixed-position panel at (x, y), nudged back on-screen on overflow. */
7
+ export declare function place(panel: HTMLElement, x: number, y: number, win: Window | null | undefined): void;
8
+ /**
9
+ * A flyout sits to the right of its parent row; if it would run off-screen it
10
+ * flips to the left instead of being shoved back over the menu (which would
11
+ * leave a gap the pointer has to cross, closing it mid-approach).
12
+ */
13
+ export declare function placeFlyout(panel: HTMLElement, host: DOMRect, win: Window | null | undefined): void;
14
+ /**
15
+ * Wires outside-press / Escape / delayed-scroll dismissal for an open menu.
16
+ * Returns the unbind function. The scroll grace period skips the first
17
+ * `graceMs` after opening — a touch long-press routinely emits an incidental
18
+ * scroll (iOS's own long-press handling, a hair of finger drift, a
19
+ * focus-driven viewport shift) in the frames right after the menu appears;
20
+ * without it the menu would be gone before the finger lifts.
21
+ */
22
+ export declare function armDismiss(doc: Document, root: HTMLElement, hide: () => void, graceMs?: number): () => void;
23
+ //# sourceMappingURL=context-menu-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu-shell.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu-shell.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,iFAAiF;AACjF,wBAAgB,KAAK,CAAC,KAAK,EAAE,WAAW,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,QAQ7F;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,QAU5F;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,MAAM,IAAI,EAAE,OAAO,SAAM,cA2B3F"}
@@ -0,0 +1,46 @@
1
+ /** Row and shell shapes for the in-place canvas's right-click menu (`context-menu.ts`). */
2
+ export interface MenuAction {
3
+ label: string;
4
+ /** Stroke-path data for a leading glyph (see `toolbar/icon-paths`). */
5
+ icon?: string;
6
+ /** Rendered with emphasis when true. */
7
+ active?: boolean;
8
+ /** Shown greyed and not selectable. */
9
+ disabled?: boolean;
10
+ /** Native `title` tooltip — e.g. why a disabled row is disabled. */
11
+ title?: string;
12
+ onSelect: () => void;
13
+ }
14
+ export interface MenuSubmenu {
15
+ label: string;
16
+ icon?: string;
17
+ rows: MenuRow[];
18
+ /** Greyed, and its flyout never opens. */
19
+ disabled?: boolean;
20
+ }
21
+ /** A row whose flyout is a single text input plus optional action buttons. */
22
+ export interface MenuField {
23
+ field: true;
24
+ label: string;
25
+ icon?: string;
26
+ value: string;
27
+ placeholder?: string;
28
+ onSubmit: (value: string) => void;
29
+ actions?: MenuAction[];
30
+ }
31
+ export type MenuRow = MenuAction | MenuSubmenu | MenuField | "separator";
32
+ export interface ContextMenu {
33
+ /** Append once to a stable container (typically `document.body`). */
34
+ readonly el: HTMLElement;
35
+ readonly isOpen: boolean;
36
+ /** Render `rows` and show the menu at a viewport point, clamped on-screen. */
37
+ show: (rows: MenuRow[], x: number, y: number) => void;
38
+ /** Show a single field panel directly, with no wrapping menu row. */
39
+ showField: (field: MenuField, x: number, y: number) => void;
40
+ hide: () => void;
41
+ /** Remove the element and drop document listeners. */
42
+ destroy: () => void;
43
+ }
44
+ export declare const isSubmenu: (r: MenuRow) => r is MenuSubmenu;
45
+ export declare const isField: (r: MenuRow) => r is MenuField;
46
+ //# sourceMappingURL=context-menu-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-menu-types.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu-types.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAE3F,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uCAAuC;IACvC,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,oEAAoE;IACpE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED,8EAA8E;AAC9E,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,IAAI,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;IACjC,OAAO,CAAC,EAAE,UAAU,EAAE,CAAA;CACvB;AAED,MAAM,MAAM,OAAO,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,WAAW,CAAA;AAExE,MAAM,WAAW,WAAW;IAC1B,qEAAqE;IACrE,QAAQ,CAAC,EAAE,EAAE,WAAW,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAA;IACxB,8EAA8E;IAC9E,IAAI,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IACrD,qEAAqE;IACrE,SAAS,EAAE,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,KAAK,IAAI,CAAA;IAC3D,IAAI,EAAE,MAAM,IAAI,CAAA;IAChB,sDAAsD;IACtD,OAAO,EAAE,MAAM,IAAI,CAAA;CACpB;AAED,eAAO,MAAM,SAAS,MAAO,OAAO,KAAG,CAAC,IAAI,WAAmD,CAAA;AAC/F,eAAO,MAAM,OAAO,MAAO,OAAO,KAAG,CAAC,IAAI,SAAkD,CAAA"}
@@ -4,47 +4,7 @@
4
4
  * press, Escape, scroll). It knows nothing about editor commands; the caller
5
5
  * passes plain rows with `onSelect` callbacks.
6
6
  */
7
- export interface MenuAction {
8
- label: string;
9
- /** Stroke-path data for a leading glyph (see `toolbar/icon-paths`). */
10
- icon?: string;
11
- /** Rendered with emphasis when true. */
12
- active?: boolean;
13
- /** Shown greyed and not selectable. */
14
- disabled?: boolean;
15
- /** Native `title` tooltip — e.g. why a disabled row is disabled. */
16
- title?: string;
17
- onSelect: () => void;
18
- }
19
- export interface MenuSubmenu {
20
- label: string;
21
- icon?: string;
22
- rows: MenuRow[];
23
- /** Greyed, and its flyout never opens. */
24
- disabled?: boolean;
25
- }
26
- /** A row whose flyout is a single text input plus optional action buttons. */
27
- export interface MenuField {
28
- field: true;
29
- label: string;
30
- icon?: string;
31
- value: string;
32
- placeholder?: string;
33
- onSubmit: (value: string) => void;
34
- actions?: MenuAction[];
35
- }
36
- export type MenuRow = MenuAction | MenuSubmenu | MenuField | "separator";
37
- export interface ContextMenu {
38
- /** Append once to a stable container (typically `document.body`). */
39
- readonly el: HTMLElement;
40
- readonly isOpen: boolean;
41
- /** Render `rows` and show the menu at a viewport point, clamped on-screen. */
42
- show: (rows: MenuRow[], x: number, y: number) => void;
43
- /** Show a single field panel directly, with no wrapping menu row. */
44
- showField: (field: MenuField, x: number, y: number) => void;
45
- hide: () => void;
46
- /** Remove the element and drop document listeners. */
47
- destroy: () => void;
48
- }
7
+ import type { ContextMenu } from "./context-menu-types";
8
+ export type { MenuAction, MenuSubmenu, MenuField, MenuRow, ContextMenu } from "./context-menu-types";
49
9
  export declare function createContextMenu(doc: Document, className?: string, onOpenChange?: (open: boolean) => void): ContextMenu;
50
10
  //# sourceMappingURL=context-menu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,uEAAuE;IACvE,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,wCAAwC;IACxC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB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AAS,SAAoB,EAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GACrC,WAAW,CAgPb"}
1
+ {"version":3,"file":"context-menu.d.ts","sourceRoot":"","sources":["../../src/inplace/context-menu.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,WAAW,EAAkC,MAAM,sBAAsB,CAAA;AAEvF,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAEpG,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,QAAQ,EACb,SAAS,SAAoB,EAC7B,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,GACrC,WAAW,CAoLb"}
@@ -1 +1 @@
1
- {"version":3,"file":"decorate.d.ts","sourceRoot":"","sources":["../../src/inplace/decorate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAelF,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,aAAa,CAAA;IAC1B,qFAAqF;IACrF,MAAM,EAAE,aAAa,CAAA;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,kBAAkB,CAiErE"}
1
+ {"version":3,"file":"decorate.d.ts","sourceRoot":"","sources":["../../src/inplace/decorate.ts"],"names":[],"mappings":"AAEA,OAAO,EAAc,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAelF,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,aAAa,CAAA;IAC1B,qFAAqF;IACrF,MAAM,EAAE,aAAa,CAAA;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,kBAAkB,CAkErE"}
@@ -17,32 +17,8 @@
17
17
  * This covers both a plain caret move and `Shift`-extending a selection, which
18
18
  * the stock `select*` commands park on the near edge just the same.
19
19
  */
20
- import { type EditorState, type Extension } from "@codemirror/state";
20
+ import { type Extension } from "@codemirror/state";
21
21
  import { type Command } from "@codemirror/view";
22
- export interface Wrap {
23
- from: number;
24
- to: number;
25
- contentFrom: number;
26
- contentTo: number;
27
- /** `"mark"` — a paired inline mark (`**`, `*`, `~~`, `` ` ``); `"link"` — a
28
- * link or wikilink, whose label is not itself a Markdown context, so a
29
- * right-click formats the *whole* construct rather than the label. */
30
- kind: "mark" | "link";
31
- }
32
- /** Are inline markers on this line hidden right now? */
33
- export declare function markersHidden(state: EditorState, lineNumber: number): boolean;
34
- /**
35
- * The hidden-marker inline construct enclosing `pos`, or `null`. With
36
- * `emphasisOnly`, only the paired-mark constructs whose *both* delimiters are
37
- * hidden count (strong / emphasis / strike / inline code) — links and wikilinks
38
- * keep a directly editable label, so their edges are not boundary-escaped.
39
- *
40
- * By default the construct's markers must be hidden right now (boundary editing
41
- * only applies then); `ignoreReveal` drops that check for callers that just want
42
- * the span — the right-click menu selecting the whole phrase, which should work
43
- * whether or not the caret has revealed the line.
44
- */
45
- export declare function wrapAt(state: EditorState, pos: number, emphasisOnly?: boolean, ignoreReveal?: boolean): Wrap | null;
46
22
  /** Backspace that steps over a hidden marker rather than stranding it. */
47
23
  export declare const deleteAcrossMarkerBackward: Command;
48
24
  /** Delete — the forward mirror. */
@@ -1 +1 @@
1
- {"version":3,"file":"edit-boundaries.d.ts","sourceRoot":"","sources":["../../src/inplace/edit-boundaries.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAGH,OAAO,EAAmB,KAAK,WAAW,EAAQ,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC3F,OAAO,EAAE,KAAK,OAAO,EAA2B,MAAM,kBAAkB,CAAA;AAgBxE,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,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0C,CAAA;AAC9E,6CAA6C;AAC7C,eAAO,MAAM,sBAAsB,EAAE,OAAyC,CAAA;AAC9E,+EAA+E;AAC/E,eAAO,MAAM,sBAAsB,EAAE,OAAyC,CAAA;AAC9E,2CAA2C;AAC3C,eAAO,MAAM,uBAAuB,EAAE,OAAwC,CAAA;AAE9E,eAAO,MAAM,qBAAqB,EAAE,SASnC,CAAA"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * ADR-007 seamless exceptions — a thematic break under `reveal: "never"`.
3
+ *
4
+ * The `---` / `***` / `___` line renders as an atomic `<hr>` widget and no
5
+ * longer reveals its source on caret entry. There is nothing to *edit* in a
6
+ * rule, so the affordance it needs is removal: Backspace or Delete while the
7
+ * caret sits on the rendered rule takes the whole line out. The "Remove
8
+ * divider" row in the right-click menu is the pointer equivalent.
9
+ *
10
+ * Fires only while the rule's source is hidden, so `reveal: "caret"` with the
11
+ * caret on the line — where the `---` shows as editable text — is untouched.
12
+ */
13
+ import { type EditorState, type Extension } from "@codemirror/state";
14
+ import { type Command, type EditorView } from "@codemirror/view";
15
+ import type { MenuAction } from "./context-menu";
16
+ /** The primary caret's line is a thematic break whose source is currently hidden. */
17
+ export declare function onHiddenRule(state: EditorState): boolean;
18
+ /** Backspace / Delete on a rendered rule line — remove the rule. */
19
+ export declare const removeHiddenRule: Command;
20
+ export declare const inPlaceDividerEdit: Extension;
21
+ /**
22
+ * The single row shown when the caret is on a rendered thematic break: its
23
+ * source is hidden under `reveal: "never"` and there is nothing to edit in a
24
+ * rule, so removal is the only action.
25
+ */
26
+ export declare function dividerRow(view: EditorView): MenuAction;
27
+ //# sourceMappingURL=edit-divider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit-divider.d.ts","sourceRoot":"","sources":["../../src/inplace/edit-divider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAQ,KAAK,WAAW,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAC1E,OAAO,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAU,MAAM,kBAAkB,CAAA;AAKxE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAGhD,qFAAqF;AACrF,wBAAgB,YAAY,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAUxD;AAED,oEAAoE;AACpE,eAAO,MAAM,gBAAgB,EAAE,OAI9B,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,SAKhC,CAAA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,UAAU,GAAG,UAAU,CASvD"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * The bridge between the in-place canvas (imperative CodeMirror DOM) and host
3
+ * React. `EmbedWidget.toDOM()` builds an inert slot element and registers it
4
+ * here; `InPlaceView` subscribes through `useSyncExternalStore` and portals an
5
+ * `<Embed>` into every live slot. One registry instance per canvas, created in
6
+ * `InPlaceView` and handed to the extension — never module-global, so two
7
+ * editors on a page do not share slots. See ADR-009.
8
+ */
9
+ export interface EmbedSlot {
10
+ /** Monotonic per registry; the React portal key. */
11
+ id: number;
12
+ /** Raw `![[ref]]` reference, passed straight to `embedSource`. */
13
+ ref: string;
14
+ /** `true` for a `![[ref]]` mid-sentence — rendered as phrasing content. */
15
+ inline: boolean;
16
+ /** The slot element CodeMirror owns; the portal target. */
17
+ el: HTMLElement;
18
+ }
19
+ export declare class EmbedRegistry {
20
+ private slots;
21
+ private listeners;
22
+ private snapshot;
23
+ private nextId;
24
+ private flushQueued;
25
+ /** Allocate an id for a freshly mounted widget. */
26
+ allocate(): number;
27
+ add(slot: EmbedSlot): void;
28
+ remove(id: number): void;
29
+ /** `useSyncExternalStore` subscribe. */
30
+ subscribe: (listener: () => void) => (() => void);
31
+ /** `useSyncExternalStore` snapshot — a stable array between mutations. */
32
+ getSnapshot: () => EmbedSlot[];
33
+ /**
34
+ * Coalesce the many `add` / `remove` calls one CodeMirror update makes into a
35
+ * single React render. A detached (never-flushed) registry stays inert.
36
+ */
37
+ private schedule;
38
+ }
39
+ //# sourceMappingURL=embed-registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed-registry.d.ts","sourceRoot":"","sources":["../../src/inplace/embed-registry.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,MAAM,WAAW,SAAS;IACxB,oDAAoD;IACpD,EAAE,EAAE,MAAM,CAAA;IACV,kEAAkE;IAClE,GAAG,EAAE,MAAM,CAAA;IACX,2EAA2E;IAC3E,MAAM,EAAE,OAAO,CAAA;IACf,2DAA2D;IAC3D,EAAE,EAAE,WAAW,CAAA;CAChB;AAED,qBAAa,aAAa;IACxB,OAAO,CAAC,KAAK,CAA+B;IAC5C,OAAO,CAAC,SAAS,CAAwB;IACzC,OAAO,CAAC,QAAQ,CAAkB;IAClC,OAAO,CAAC,MAAM,CAAI;IAClB,OAAO,CAAC,WAAW,CAAQ;IAE3B,mDAAmD;IACnD,QAAQ,IAAI,MAAM,CAEjB;IAED,GAAG,CAAC,IAAI,EAAE,SAAS,GAAG,IAAI,CAGzB;IAED,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAEvB;IAED,wCAAwC;IACxC,SAAS,aAAc,MAAM,IAAI,KAAG,CAAC,MAAM,IAAI,CAAC,CAG/C;IAED,0EAA0E;IAC1E,WAAW,QAAO,SAAS,EAAE,CAAiB;IAE9C;;;OAGG;IACH,OAAO,CAAC,QAAQ;CASjB"}
@@ -0,0 +1,8 @@
1
+ import { StateField } from "@codemirror/state";
2
+ import { type DecorationSet } from "@codemirror/view";
3
+ /**
4
+ * Decorations for the in-place embed slots, plus the atomic ranges that let the
5
+ * caret step over a rendered embed instead of into it.
6
+ */
7
+ export declare const embedField: StateField<DecorationSet>;
8
+ //# sourceMappingURL=embed.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"embed.d.ts","sourceRoot":"","sources":["../../src/inplace/embed.ts"],"names":[],"mappings":"AACA,OAAO,EAAgC,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAc,KAAK,aAAa,EAA0B,MAAM,kBAAkB,CAAA;AAuGzF;;;GAGG;AACH,eAAO,MAAM,UAAU,2BAOrB,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { type Extension } from "@codemirror/state";
2
2
  import type { InPlaceConfig } from "../types";
3
+ import type { EmbedRegistry } from "./embed-registry";
3
4
  export interface InPlaceOptions {
4
5
  /** Fired when a collapsed `[[wikilink]]` is clicked in the canvas. */
5
6
  onWikiLinkClick?: (target: string) => void;
@@ -7,6 +8,11 @@ export interface InPlaceOptions {
7
8
  onLinkClick?: (href: string) => void;
8
9
  /** Which decoration types render; see ADR-005. Applied once, at construction. */
9
10
  inPlace?: InPlaceConfig;
11
+ /**
12
+ * The canvas's `EmbedRegistry`, passed only when the host set `embedSource`.
13
+ * Its presence turns the `![[ref]]` pass on; see ADR-009.
14
+ */
15
+ embedRegistry?: EmbedRegistry;
10
16
  }
11
17
  /**
12
18
  * The complete in-place canvas layer: decoration plugin, display theme, a
@@ -1 +1 @@
1
- {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/inplace/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AA8B7C,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,0EAA0E;IAC1E,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,iFAAiF;IACjF,OAAO,CAAC,EAAE,aAAa,CAAA;CACxB;AAuCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,cAAmB,GAAG,SAAS,CA+DrE"}
1
+ {"version":3,"file":"extension.d.ts","sourceRoot":"","sources":["../../src/inplace/extension.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAGxD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAwB7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAWrD,MAAM,WAAW,cAAc;IAC7B,sEAAsE;IACtE,eAAe,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,IAAI,CAAA;IAC1C,0EAA0E;IAC1E,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAA;IACpC,iFAAiF;IACjF,OAAO,CAAC,EAAE,aAAa,CAAA;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAwCD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,GAAE,cAAmB,GAAG,SAAS,CAyErE"}
@@ -8,6 +8,11 @@
8
8
  *
9
9
  * `code` and `math` win first and keep their contents literal; everything else
10
10
  * recurses so `**a `code` b**` styles the bold and the code.
11
+ *
12
+ * With `embeds` set (the host passed `embedSource`), a `![[ref]]` is shown as
13
+ * literal text — the in-place editable/rendered table cell does not transclude;
14
+ * `preview` / `split` do. The literal keeps the `[[ref]]` inside from being
15
+ * picked up as a wikilink chip.
11
16
  */
12
- export declare function renderInline(text: string): DocumentFragment;
17
+ export declare function renderInline(text: string, embeds?: boolean): DocumentFragment;
13
18
  //# sourceMappingURL=inline-md.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"inline-md.d.ts","sourceRoot":"","sources":["../../src/inplace/inline-md.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;GAUG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,gBAAgB,CAI3D"}
1
+ {"version":3,"file":"inline-md.d.ts","sourceRoot":"","sources":["../../src/inplace/inline-md.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,UAAQ,GAAG,gBAAgB,CAI3E"}
@@ -0,0 +1,21 @@
1
+ /**
2
+ * The right-click menu's link fields: `linkRow` (`[text](url)`) and
3
+ * `wikiLinkRow` (`[[target|label]]`). Split out of `context-menu-actions.ts`.
4
+ */
5
+ import type { EditorView } from "@codemirror/view";
6
+ import type { MenuField } from "./context-menu";
7
+ /**
8
+ * The "Add external link" row — an editable `[text](url)` URL field. Prefilled,
9
+ * with Open / Remove and the label "Edit external link", when the caret sits in
10
+ * an existing `[text](url)`; otherwise an empty field that wraps the selection
11
+ * (or the word the menu just selected) on submit.
12
+ */
13
+ export declare function linkRow(view: EditorView): MenuField;
14
+ /**
15
+ * The "Add link" row — an editable `[[target]]` field for an internal link.
16
+ * Prefilled, with Remove and the label "Edit link", when the caret sits in an
17
+ * existing `[[target|label]]`; otherwise an empty field that wraps the
18
+ * selection (or the word the menu just selected) on submit.
19
+ */
20
+ export declare function wikiLinkRow(view: EditorView): MenuField;
21
+ //# sourceMappingURL=link-row.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"link-row.d.ts","sourceRoot":"","sources":["../../src/inplace/link-row.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AAIlD,OAAO,KAAK,EAAc,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAgC3D;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAgEnD;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CA6DvD"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Editing a rendered `$…$` / one-line `$$…$$` math span: the right-click
3
+ * **Math** field (`mathRow`), and its click / hover counterparts on the canvas
4
+ * — clicking a widget opens the same field at the pointer, hovering shows the
5
+ * source in a read-only bubble. Under `reveal: "never"` the source is
6
+ * otherwise never on screen (the KaTeX widget replaces the whole span), so
7
+ * these are the affordance the Stage 4 link field gives links (ADR-007
8
+ * seamless exceptions, dependable-tracker item 9c).
9
+ *
10
+ * A multi-line `$$` block's widget resolves to its opening-fence line, whose
11
+ * text is just `$$` — `mathAtIn` finds nothing there, so both routes no-op and
12
+ * leave that construct's existing caret-reveal untouched.
13
+ */
14
+ import { type EditorView, type Tooltip, ViewPlugin, type PluginValue } from "@codemirror/view";
15
+ import { type MenuField } from "./context-menu";
16
+ /**
17
+ * The **Math** row: an editable LaTeX field. Prefilled, with **Remove math**,
18
+ * when the caret sits in an existing `$…$` or one-line `$$…$$` span — its
19
+ * source has no other on-screen home under `reveal: "never"`, the rendered
20
+ * KaTeX widget replaces the whole thing. Otherwise an empty field that wraps
21
+ * the selection as `$…$` on submit, the same shape as the link rows.
22
+ */
23
+ export declare function mathRow(view: EditorView): MenuField;
24
+ declare class MathClickEditor implements PluginValue {
25
+ private menu;
26
+ private contentDOM;
27
+ private onClick;
28
+ constructor(view: EditorView);
29
+ destroy(): void;
30
+ }
31
+ export declare const mathClickEditor: ViewPlugin<MathClickEditor, undefined>;
32
+ export declare const mathHoverTooltip: import("@codemirror/state").Extension & {
33
+ active: import("@codemirror/state").StateField<readonly Tooltip[]>;
34
+ };
35
+ export {};
36
+ //# sourceMappingURL=math-edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math-edit.d.ts","sourceRoot":"","sources":["../../src/inplace/math-edit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,KAAK,UAAU,EAEf,KAAK,OAAO,EACZ,UAAU,EACV,KAAK,WAAW,EACjB,MAAM,kBAAkB,CAAA;AAGzB,OAAO,EAAuC,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAGpF;;;;;;GAMG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,SAAS,CAoDnD;AAED,cAAM,eAAgB,YAAW,WAAW;IAC1C,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,UAAU,CAAa;IAC/B,OAAO,CAAC,OAAO,CAAyB;IAExC,YAAY,IAAI,EAAE,UAAU,EAsB3B;IAED,OAAO,SAGN;CACF;AAED,eAAO,MAAM,eAAe,wCAAwC,CAAA;AAEpE,eAAO,MAAM,gBAAgB;;CAkB3B,CAAA"}
@@ -1,6 +1,18 @@
1
1
  import { type Range, StateField } from "@codemirror/state";
2
2
  import { Decoration, type DecorationSet, EditorView } from "@codemirror/view";
3
3
  import { type Tree } from "./scan";
4
+ export interface MathAt {
5
+ from: number;
6
+ to: number;
7
+ src: string;
8
+ block: boolean;
9
+ }
10
+ /**
11
+ * The one-line `$$…$$` or `$…$` math span of `text` covering `head`, or `null`.
12
+ * Used by the right-click **Math** field to find what the caret is inside —
13
+ * multi-line `$$` blocks are out of scope, a menu field is one line.
14
+ */
15
+ export declare function mathAtIn(text: string, head: number): MathAt | null;
4
16
  /**
5
17
  * Viewport pass for `$…$` and single-line `$$…$$` — the CodeMirror grammar has
6
18
  * no math node. Off-caret matches become KaTeX widgets. Multi-line `$$` blocks
@@ -1 +1 @@
1
- {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/inplace/math.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,UAAU,EAAc,MAAM,kBAAkB,CAAA;AAIzF,OAAO,EAAgC,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAA;AAmChE;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,GACvB,IAAI,CAyBN;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,2BASzB,CAAA"}
1
+ {"version":3,"file":"math.d.ts","sourceRoot":"","sources":["../../src/inplace/math.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAC5E,OAAO,EAAE,UAAU,EAAE,KAAK,aAAa,EAAE,UAAU,EAAc,MAAM,kBAAkB,CAAA;AAIzF,OAAO,EAAgC,KAAK,IAAI,EAAE,MAAM,QAAQ,CAAA;AAOhE,MAAM,WAAW,MAAM;IACrB,IAAI,EAAE,MAAM,CAAA;IACZ,EAAE,EAAE,MAAM,CAAA;IACV,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,OAAO,CAAA;CACf;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAYlE;AA8BD;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,GAAG,CAAC,MAAM,CAAC,EACrB,IAAI,EAAE,IAAI,EACV,GAAG,EAAE,KAAK,CAAC,UAAU,CAAC,EAAE,GACvB,IAAI,CAyBN;AAED;;;;GAIG;AACH,eAAO,MAAM,cAAc,2BASzB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"menu-plugin.d.ts","sourceRoot":"","sources":["../../src/inplace/menu-plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAQhF,cAAM,qBAAsB,YAAW,WAAW;IAChD,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,UAAU,CAAa;IAC/B;+EAC2E;IAC3E,OAAO,CAAC,OAAO,CAAgD;IAC/D;;mEAE+D;IAC/D,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,SAAS,CAAQ;IAEzB,YAAY,IAAI,EAAE,UAAU,EAmD3B;IAED;4EACwE;IACxE,OAAO,CAAC,UAAU;IAiClB,OAAO,SAMN;CACF;AAED,eAAO,MAAM,gBAAgB,8CAA8C,CAAA"}
1
+ {"version":3,"file":"menu-plugin.d.ts","sourceRoot":"","sources":["../../src/inplace/menu-plugin.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAQhF,cAAM,qBAAsB,YAAW,WAAW;IAChD,OAAO,CAAC,IAAI,CAAY;IACxB,OAAO,CAAC,IAAI,CAAa;IACzB,OAAO,CAAC,aAAa,CAAyB;IAC9C,OAAO,CAAC,aAAa,CAAY;IACjC,OAAO,CAAC,SAAS,CAAiB;IAClC,OAAO,CAAC,UAAU,CAAa;IAC/B;+EAC2E;IAC3E,OAAO,CAAC,OAAO,CAAgD;IAC/D;;mEAE+D;IAC/D,OAAO,CAAC,WAAW,CAAI;IACvB,OAAO,CAAC,SAAS,CAAQ;IAEzB,YAAY,IAAI,EAAE,UAAU,EAmD3B;IAED;4EACwE;IACxE,OAAO,CAAC,UAAU;IA4ClB,OAAO,SAMN;CACF;AAED,eAAO,MAAM,gBAAgB,8CAA8C,CAAA"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * `decorateNode` branches for block-level constructs: thematic breaks,
3
+ * blockquotes / callouts, list markers, and fenced / indented code. Split out
4
+ * of `nodes.ts`, which keeps the dispatch and the inline constructs.
5
+ */
6
+ import type { SyntaxNodeRef } from "@lezer/common";
7
+ import type { NodeCtx } from "./nodes";
8
+ export declare function decorateRule(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
9
+ export declare function decorateBlockquote(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
10
+ export declare function decorateQuoteMark(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
11
+ export declare function decorateListMark(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
12
+ export declare function decorateTaskMarker(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
13
+ export declare function decorateCode(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
14
+ //# sourceMappingURL=nodes-blocks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes-blocks.d.ts","sourceRoot":"","sources":["../../src/inplace/nodes-blocks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAKtC,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAgBnF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAkCzF;AAED,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAiBxF;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAgBvF;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CAQzF;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CA0CnF"}
@@ -0,0 +1,16 @@
1
+ /**
2
+ * `decorateNode` branches for inline constructs: paired marks (bold / italic /
3
+ * strike / inline code) and links. Split out of `nodes.ts`, which keeps the
4
+ * dispatch and the block-level constructs.
5
+ */
6
+ import type { SyntaxNodeRef } from "@lezer/common";
7
+ import type { NodeCtx } from "./nodes";
8
+ /** Inline spans: style the text between the markers, hide the markers off-caret. */
9
+ export declare const INLINE: Record<string, {
10
+ mark: string;
11
+ className: string;
12
+ toggle: "emphasis" | "code";
13
+ }>;
14
+ export declare function decorateInlineMark(node: SyntaxNodeRef, ctx: NodeCtx, rule: (typeof INLINE)[string]): boolean | undefined;
15
+ export declare function decorateLink(node: SyntaxNodeRef, ctx: NodeCtx): boolean | undefined;
16
+ //# sourceMappingURL=nodes-inline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodes-inline.d.ts","sourceRoot":"","sources":["../../src/inplace/nodes-inline.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,oFAAoF;AACpF,eAAO,MAAM,MAAM,EAAE,MAAM,CACzB,MAAM,EACN;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAA;CAAE,CAOjE,CAAA;AAED,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,aAAa,EACnB,GAAG,EAAE,OAAO,EACZ,IAAI,EAAE,CAAC,OAAO,MAAM,CAAC,CAAC,MAAM,CAAC,GAC5B,OAAO,GAAG,SAAS,CAiBrB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,GAAG,OAAO,GAAG,SAAS,CA4BnF"}