@damiro/stylo 0.11.0 → 0.13.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 +16 -6
- package/dist/{InPlaceView-Dyf7I4XQ.js → InPlaceView-BGVCST5f.js} +449 -448
- package/dist/{InPlaceView-Dyf7I4XQ.js.map → InPlaceView-BGVCST5f.js.map} +1 -1
- package/dist/Preview-C5Oi_jpI.js +238 -0
- package/dist/Preview-C5Oi_jpI.js.map +1 -0
- package/dist/SplitView.d.ts +3 -2
- package/dist/SplitView.d.ts.map +1 -1
- package/dist/Stylo.d.ts.map +1 -1
- package/dist/editor/SourceView.d.ts +5 -3
- 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/highlight.d.ts +20 -0
- package/dist/editor/highlight.d.ts.map +1 -1
- package/dist/editor/tag-complete.d.ts +16 -0
- package/dist/editor/tag-complete.d.ts.map +1 -0
- package/dist/editor/useCodeMirror.d.ts +8 -3
- package/dist/editor/useCodeMirror.d.ts.map +1 -1
- package/dist/highlight-DNGJlCDY.js +133 -0
- package/dist/highlight-DNGJlCDY.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 +5 -3
- package/dist/inplace/InPlaceView.d.ts.map +1 -1
- package/dist/render/CodeBlock.d.ts +18 -0
- package/dist/render/CodeBlock.d.ts.map +1 -0
- package/dist/render/Preview.d.ts +9 -2
- package/dist/render/Preview.d.ts.map +1 -1
- package/dist/render/highlightCode.d.ts +10 -0
- package/dist/render/highlightCode.d.ts.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/stylo.js +120 -113
- package/dist/stylo.js.map +1 -1
- package/dist/types.d.ts +35 -12
- package/dist/types.d.ts.map +1 -1
- package/dist/{useCodeMirror-CjG9CwpB.js → useCodeMirror-COmcRrUo.js} +348 -387
- package/dist/useCodeMirror-COmcRrUo.js.map +1 -0
- package/package.json +1 -1
- package/dist/Preview-DIsFdBFA.js +0 -170
- package/dist/Preview-DIsFdBFA.js.map +0 -1
- package/dist/frontmatter-DTCC0gaa.js +0 -40
- package/dist/frontmatter-DTCC0gaa.js.map +0 -1
- package/dist/useCodeMirror-CjG9CwpB.js.map +0 -1
package/README.md
CHANGED
|
@@ -28,6 +28,8 @@ 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
|
+
- **`#tags`** — opt-in `#` autocomplete from an index you supply (`tagSource`),
|
|
32
|
+
mirroring `wikiLinkSource`'s trigger-while-typing UX.
|
|
31
33
|
- **`![[embed]]` transclusion** — opt-in on every rendered surface (`preview`,
|
|
32
34
|
`split`, and the in-place canvas): pass `embedSource` and Stylo hands you the
|
|
33
35
|
reference, you return the node to render in its place.
|
|
@@ -176,15 +178,22 @@ editing surface itself, below the find/replace panel and above the document
|
|
|
176
178
|
body, a seam `toolbar.render` can't reach since it wraps content before the
|
|
177
179
|
whole canvas. See [Canvas header](./docs/wiki/reference/props.md#canvas-header).
|
|
178
180
|
|
|
179
|
-
`inPlace`, `codeLanguages`, and `
|
|
180
|
-
surface mounts — give `<Stylo>` a `key` derived from the
|
|
181
|
-
change.
|
|
181
|
+
`inPlace`, `codeLanguages`, `wikiLinkSource`, and `tagSource` are read once,
|
|
182
|
+
when the editing surface mounts — give `<Stylo>` a `key` derived from the
|
|
183
|
+
config to apply a change. (`codeLanguages` is the exception in `preview`,
|
|
184
|
+
which is a pure function of its props and picks up a change immediately, no
|
|
185
|
+
`key` needed.) Every other prop is fully reactive. See
|
|
182
186
|
[props · applied at mount](./docs/wiki/reference/props.md#config-applied-at-mount).
|
|
183
187
|
|
|
184
188
|
Pass `wikiLinkSource` — `(query) => { target, label? }[]`, sync or async — to
|
|
185
189
|
turn on `[[wikilink]]` autocomplete backed by your own index. See
|
|
186
190
|
[Wikilink autocomplete](./docs/wiki/reference/props.md#wikilink-autocomplete).
|
|
187
191
|
|
|
192
|
+
Pass `tagSource` — `(query) => { tag }[]`, sync or async — to turn on `#tag`
|
|
193
|
+
autocomplete backed by your own index, the same trigger-while-typing UX as
|
|
194
|
+
`wikiLinkSource`. See
|
|
195
|
+
[Tag autocomplete](./docs/wiki/reference/props.md#tag-autocomplete).
|
|
196
|
+
|
|
188
197
|
Pass `embedSource` — `(ref) => ReactNode`, sync or async — to resolve
|
|
189
198
|
`![[embed]]` transclusion on every rendered surface, the in-place canvas
|
|
190
199
|
included. Stylo detects the `![[…]]` (when it is alone on its line) and renders
|
|
@@ -201,9 +210,10 @@ full grammar set is ~110 lazy chunks). See
|
|
|
201
210
|
Every colour is a `--stylo-*` custom property; override any of them on `.stylo`
|
|
202
211
|
or an ancestor. A dark palette ships built in and activates under a `.dark` or
|
|
203
212
|
`[data-theme="dark"]` ancestor — the `next-themes` / shadcn convention.
|
|
204
|
-
`--stylo-font-size` (default `0.9375rem`) sets the base
|
|
205
|
-
everything inside scales from it;
|
|
206
|
-
`--stylo-font-family-mono` set the prose and code
|
|
213
|
+
`--stylo-font-size` (default `0.9375rem`) sets the base size for the in-place
|
|
214
|
+
canvas, `source`, and `preview` alike — everything inside each scales from it;
|
|
215
|
+
`--stylo-font-family` and `--stylo-font-family-mono` set the prose and code
|
|
216
|
+
fonts.
|
|
207
217
|
|
|
208
218
|
---
|
|
209
219
|
|