@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.
- package/README.md +24 -10
- package/dist/{InPlaceView-CS1qy-Ba.js → InPlaceView-Bu91_3Ig.js} +1199 -855
- package/dist/InPlaceView-Bu91_3Ig.js.map +1 -0
- package/dist/Preview-AaGGwLQP.js +170 -0
- package/dist/Preview-AaGGwLQP.js.map +1 -0
- package/dist/SplitView.d.ts +4 -2
- package/dist/SplitView.d.ts.map +1 -1
- package/dist/Stylo.d.ts.map +1 -1
- package/dist/editor/SourceView.d.ts +4 -2
- package/dist/editor/SourceView.d.ts.map +1 -1
- package/dist/editor/extensions.d.ts +2 -2
- package/dist/editor/extensions.d.ts.map +1 -1
- package/dist/editor/useCodeMirror.d.ts +4 -2
- package/dist/editor/useCodeMirror.d.ts.map +1 -1
- package/dist/editor/wikilink-complete.d.ts +5 -3
- package/dist/editor/wikilink-complete.d.ts.map +1 -1
- package/dist/embed-B2Dfkpd_.js +124 -0
- package/dist/embed-B2Dfkpd_.js.map +1 -0
- package/dist/embed.d.ts +14 -0
- package/dist/embed.d.ts.map +1 -0
- package/dist/frontmatter-DGUkb9z-.js +39 -0
- package/dist/frontmatter-DGUkb9z-.js.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/inplace/InPlaceView.d.ts +11 -2
- package/dist/inplace/InPlaceView.d.ts.map +1 -1
- package/dist/inplace/config.d.ts +8 -0
- package/dist/inplace/config.d.ts.map +1 -1
- package/dist/inplace/context-menu-actions.d.ts +5 -14
- package/dist/inplace/context-menu-actions.d.ts.map +1 -1
- package/dist/inplace/context-menu-helpers.d.ts +30 -0
- package/dist/inplace/context-menu-helpers.d.ts.map +1 -0
- package/dist/inplace/context-menu-shell.d.ts +23 -0
- package/dist/inplace/context-menu-shell.d.ts.map +1 -0
- package/dist/inplace/context-menu-types.d.ts +46 -0
- package/dist/inplace/context-menu-types.d.ts.map +1 -0
- package/dist/inplace/context-menu.d.ts +2 -42
- package/dist/inplace/context-menu.d.ts.map +1 -1
- package/dist/inplace/decorate.d.ts.map +1 -1
- package/dist/inplace/edit-boundaries.d.ts +1 -25
- package/dist/inplace/edit-boundaries.d.ts.map +1 -1
- package/dist/inplace/edit-divider.d.ts +27 -0
- package/dist/inplace/edit-divider.d.ts.map +1 -0
- package/dist/inplace/embed-registry.d.ts +39 -0
- package/dist/inplace/embed-registry.d.ts.map +1 -0
- package/dist/inplace/embed.d.ts +8 -0
- package/dist/inplace/embed.d.ts.map +1 -0
- package/dist/inplace/extension.d.ts +6 -0
- package/dist/inplace/extension.d.ts.map +1 -1
- package/dist/inplace/inline-md.d.ts +6 -1
- package/dist/inplace/inline-md.d.ts.map +1 -1
- package/dist/inplace/link-row.d.ts +21 -0
- package/dist/inplace/link-row.d.ts.map +1 -0
- package/dist/inplace/math-edit.d.ts +36 -0
- package/dist/inplace/math-edit.d.ts.map +1 -0
- package/dist/inplace/math.d.ts +12 -0
- package/dist/inplace/math.d.ts.map +1 -1
- package/dist/inplace/menu-plugin.d.ts.map +1 -1
- package/dist/inplace/nodes-blocks.d.ts +14 -0
- package/dist/inplace/nodes-blocks.d.ts.map +1 -0
- package/dist/inplace/nodes-inline.d.ts +16 -0
- package/dist/inplace/nodes-inline.d.ts.map +1 -0
- package/dist/inplace/nodes.d.ts +3 -2
- package/dist/inplace/nodes.d.ts.map +1 -1
- package/dist/inplace/scan.d.ts +6 -0
- package/dist/inplace/scan.d.ts.map +1 -1
- package/dist/inplace/selection-bar-position.d.ts +31 -0
- package/dist/inplace/selection-bar-position.d.ts.map +1 -0
- package/dist/inplace/selection-bar.d.ts +0 -2
- package/dist/inplace/selection-bar.d.ts.map +1 -1
- package/dist/inplace/table-widget-caret.d.ts +11 -0
- package/dist/inplace/table-widget-caret.d.ts.map +1 -0
- package/dist/inplace/table-widget-render.d.ts +18 -0
- package/dist/inplace/table-widget-render.d.ts.map +1 -0
- package/dist/inplace/table-widget.d.ts +5 -2
- package/dist/inplace/table-widget.d.ts.map +1 -1
- package/dist/inplace/tables.d.ts.map +1 -1
- package/dist/inplace/theme-callout.d.ts +50 -0
- package/dist/inplace/theme-callout.d.ts.map +1 -0
- package/dist/inplace/theme-canvas.d.ts +166 -0
- package/dist/inplace/theme-canvas.d.ts.map +1 -0
- package/dist/inplace/theme-fonts.d.ts +4 -0
- package/dist/inplace/theme-fonts.d.ts.map +1 -0
- package/dist/inplace/theme-menu.d.ts +87 -0
- package/dist/inplace/theme-menu.d.ts.map +1 -0
- package/dist/inplace/theme-popups.d.ts +94 -0
- package/dist/inplace/theme-popups.d.ts.map +1 -0
- package/dist/inplace/theme-table-gizmos.d.ts +57 -0
- package/dist/inplace/theme-table-gizmos.d.ts.map +1 -0
- package/dist/inplace/theme-table.d.ts +30 -0
- package/dist/inplace/theme-table.d.ts.map +1 -0
- package/dist/inplace/theme.d.ts +5 -0
- package/dist/inplace/theme.d.ts.map +1 -1
- package/dist/inplace/wikilinks.d.ts.map +1 -1
- package/dist/inplace/wrap-at.d.ts +32 -0
- package/dist/inplace/wrap-at.d.ts.map +1 -0
- package/dist/{markdown-N3lRmU2n.js → markdown-BYXs9Tj8.js} +2 -2
- package/dist/{markdown-N3lRmU2n.js.map → markdown-BYXs9Tj8.js.map} +1 -1
- package/dist/render/Embed.d.ts +24 -0
- package/dist/render/Embed.d.ts.map +1 -0
- package/dist/render/Preview.d.ts +6 -2
- package/dist/render/Preview.d.ts.map +1 -1
- package/dist/render/embed-cache.d.ts +10 -0
- package/dist/render/embed-cache.d.ts.map +1 -0
- package/dist/render/remark-embed.d.ts +19 -0
- package/dist/render/remark-embed.d.ts.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/stylo.js +70 -54
- package/dist/stylo.js.map +1 -1
- package/dist/toolbar/block.d.ts +0 -26
- package/dist/toolbar/block.d.ts.map +1 -1
- package/dist/toolbar/command-helpers.d.ts +57 -0
- package/dist/toolbar/command-helpers.d.ts.map +1 -0
- package/dist/toolbar/commands.d.ts +1 -21
- package/dist/toolbar/commands.d.ts.map +1 -1
- package/dist/toolbar/frontmatter-toggle.d.ts +13 -0
- package/dist/toolbar/frontmatter-toggle.d.ts.map +1 -0
- package/dist/toolbar/heading.d.ts +10 -0
- package/dist/toolbar/heading.d.ts.map +1 -0
- package/dist/toolbar/inline-ops.d.ts +3 -53
- package/dist/toolbar/inline-ops.d.ts.map +1 -1
- package/dist/toolbar/link-ops.d.ts +22 -0
- package/dist/toolbar/link-ops.d.ts.map +1 -0
- package/dist/toolbar/rule.d.ts +11 -0
- package/dist/toolbar/rule.d.ts.map +1 -0
- package/dist/toolbar/table-position.d.ts +32 -0
- package/dist/toolbar/table-position.d.ts.map +1 -0
- package/dist/toolbar/table.d.ts +1 -16
- package/dist/toolbar/table.d.ts.map +1 -1
- package/dist/toolbar/underline-ops.d.ts +15 -0
- package/dist/toolbar/underline-ops.d.ts.map +1 -0
- package/dist/toolbar/wikilink-ops.d.ts +22 -0
- package/dist/toolbar/wikilink-ops.d.ts.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/{useCodeMirror-GPSkaYW6.js → useCodeMirror-DtwupFgc.js} +559 -531
- package/dist/useCodeMirror-DtwupFgc.js.map +1 -0
- package/package.json +2 -1
- package/dist/InPlaceView-CS1qy-Ba.js.map +0 -1
- package/dist/Preview-Bw0k3Mev.js +0 -93
- package/dist/Preview-Bw0k3Mev.js.map +0 -1
- package/dist/callout-oLE630ZP.js +0 -37
- package/dist/callout-oLE630ZP.js.map +0 -1
- package/dist/useCodeMirror-GPSkaYW6.js.map +0 -1
- package/dist/wikilink-CTR8IFKc.js +0 -42
- package/dist/wikilink-CTR8IFKc.js.map +0 -1
package/README.md
CHANGED
|
@@ -28,6 +28,9 @@ built in.
|
|
|
28
28
|
- **`[[wikilinks]]`** — recognised, styled, and clickable, with an
|
|
29
29
|
`onWikiLinkClick` callback and opt-in `[[` autocomplete from an index you
|
|
30
30
|
supply (`wikiLinkSource`).
|
|
31
|
+
- **`![[embed]]` transclusion** — opt-in on every rendered surface (`preview`,
|
|
32
|
+
`split`, and the in-place canvas): pass `embedSource` and Stylo hands you the
|
|
33
|
+
reference, you return the node to render in its place.
|
|
31
34
|
- **Interactive tables** — edit a rendered table cell by cell in the in-place
|
|
32
35
|
canvas, with row / column controls; or keep plain source pipes.
|
|
33
36
|
- **Callouts** — `> [!note]` blockquotes render as tinted admonition blocks
|
|
@@ -71,7 +74,11 @@ npm install @codemirror/state @codemirror/view @codemirror/commands \
|
|
|
71
74
|
@codemirror/language @codemirror/lang-markdown @lezer/common @lezer/highlight
|
|
72
75
|
```
|
|
73
76
|
|
|
74
|
-
React 18
|
|
77
|
+
React 18 or 19 is also a peer dependency (`react` + `react-dom`). Stylo ships
|
|
78
|
+
**ES modules only** — there is no CommonJS build — so it needs a bundler (Vite,
|
|
79
|
+
Next.js, …) or a native-ESM runtime. Stylesheet imports are in [Usage](#usage);
|
|
80
|
+
the full setup checklist is in the
|
|
81
|
+
[integration guide](./docs/wiki/guides/integration.md#requirements).
|
|
75
82
|
|
|
76
83
|
The optional `@damiro/stylo/toolbar-settings` component (an end-user toolbar
|
|
77
84
|
customizer) additionally needs `@dnd-kit/core @dnd-kit/sortable
|
|
@@ -103,15 +110,16 @@ truth.** The editor is a thin, composable surface over it.
|
|
|
103
110
|
|
|
104
111
|
## Stack
|
|
105
112
|
|
|
106
|
-
| Concern | Library
|
|
107
|
-
| ---------------- |
|
|
108
|
-
| Editing surface | CodeMirror 6 (`@codemirror/lang-markdown`)
|
|
109
|
-
| Find / replace | `@codemirror/search` — `Mod-f` on every editing surface
|
|
110
|
-
| Render / preview | `react-markdown` + `remark-gfm` + `remark-math` + `rehype-katex` + `katex`
|
|
111
|
-
| `[[wikilinks]]` | small custom `remark` plugin
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
|
|
|
113
|
+
| Concern | Library |
|
|
114
|
+
| ---------------- | -------------------------------------------------------------------------------------------- |
|
|
115
|
+
| Editing surface | CodeMirror 6 (`@codemirror/lang-markdown`) |
|
|
116
|
+
| Find / replace | `@codemirror/search` — `Mod-f` on every editing surface |
|
|
117
|
+
| Render / preview | `react-markdown` + `remark-gfm` + `remark-math` + `rehype-katex` + `katex` |
|
|
118
|
+
| `[[wikilinks]]` | small custom `remark` plugin |
|
|
119
|
+
| `![[embeds]]` | `remark` plugin (preview) + `EmbedWidget` portal registry (in-place), one host `embedSource` |
|
|
120
|
+
| Frontmatter | `remark-frontmatter` — fences recognised; key/value parsing deferred |
|
|
121
|
+
| Styling | CSS Modules + `--stylo-*` CSS custom properties — no Tailwind, no CSS-in-JS |
|
|
122
|
+
| Icons | inline SVG, swappable via the `icons` prop — no icon-package dependency |
|
|
115
123
|
|
|
116
124
|
Styling and icon decisions are recorded in
|
|
117
125
|
[ADR-002](./docs/journal/2026-09/2026-09-01_adr-002-editor-ux-and-customization.md);
|
|
@@ -159,6 +167,12 @@ Pass `wikiLinkSource` — `(query) => { target, label? }[]`, sync or async — t
|
|
|
159
167
|
turn on `[[wikilink]]` autocomplete backed by your own index. See
|
|
160
168
|
[Wikilink autocomplete](./docs/wiki/reference/props.md#wikilink-autocomplete).
|
|
161
169
|
|
|
170
|
+
Pass `embedSource` — `(ref) => ReactNode`, sync or async — to resolve
|
|
171
|
+
`![[embed]]` transclusion on every rendered surface, the in-place canvas
|
|
172
|
+
included. Stylo detects the `![[…]]` (when it is alone on its line) and renders
|
|
173
|
+
whatever you return; on the canvas the caret reveals the raw source. See
|
|
174
|
+
[Embeds](./docs/wiki/reference/props.md#embeds).
|
|
175
|
+
|
|
162
176
|
Fenced code blocks render in plain monospace — no token colours — until you pass
|
|
163
177
|
`codeLanguages` with the grammars you want. Stylo bundles none by design (the
|
|
164
178
|
full grammar set is ~110 lazy chunks). See
|