@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.
Files changed (43) hide show
  1. package/README.md +16 -6
  2. package/dist/{InPlaceView-Dyf7I4XQ.js → InPlaceView-BGVCST5f.js} +449 -448
  3. package/dist/{InPlaceView-Dyf7I4XQ.js.map → InPlaceView-BGVCST5f.js.map} +1 -1
  4. package/dist/Preview-C5Oi_jpI.js +238 -0
  5. package/dist/Preview-C5Oi_jpI.js.map +1 -0
  6. package/dist/SplitView.d.ts +3 -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 +5 -3
  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/highlight.d.ts +20 -0
  14. package/dist/editor/highlight.d.ts.map +1 -1
  15. package/dist/editor/tag-complete.d.ts +16 -0
  16. package/dist/editor/tag-complete.d.ts.map +1 -0
  17. package/dist/editor/useCodeMirror.d.ts +8 -3
  18. package/dist/editor/useCodeMirror.d.ts.map +1 -1
  19. package/dist/highlight-DNGJlCDY.js +133 -0
  20. package/dist/highlight-DNGJlCDY.js.map +1 -0
  21. package/dist/index.d.ts +1 -1
  22. package/dist/index.d.ts.map +1 -1
  23. package/dist/inplace/InPlaceView.d.ts +5 -3
  24. package/dist/inplace/InPlaceView.d.ts.map +1 -1
  25. package/dist/render/CodeBlock.d.ts +18 -0
  26. package/dist/render/CodeBlock.d.ts.map +1 -0
  27. package/dist/render/Preview.d.ts +9 -2
  28. package/dist/render/Preview.d.ts.map +1 -1
  29. package/dist/render/highlightCode.d.ts +10 -0
  30. package/dist/render/highlightCode.d.ts.map +1 -0
  31. package/dist/styles.css +1 -1
  32. package/dist/stylo.js +120 -113
  33. package/dist/stylo.js.map +1 -1
  34. package/dist/types.d.ts +35 -12
  35. package/dist/types.d.ts.map +1 -1
  36. package/dist/{useCodeMirror-CjG9CwpB.js → useCodeMirror-COmcRrUo.js} +348 -387
  37. package/dist/useCodeMirror-COmcRrUo.js.map +1 -0
  38. package/package.json +1 -1
  39. package/dist/Preview-DIsFdBFA.js +0 -170
  40. package/dist/Preview-DIsFdBFA.js.map +0 -1
  41. package/dist/frontmatter-DTCC0gaa.js +0 -40
  42. package/dist/frontmatter-DTCC0gaa.js.map +0 -1
  43. 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 `wikiLinkSource` are read once, when the editing
180
- surface mounts — give `<Stylo>` a `key` derived from the config to apply a
181
- change. Every other prop is fully reactive. See
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 editor size and
205
- everything inside scales from it; `--stylo-font-family` and
206
- `--stylo-font-family-mono` set the prose and code fonts.
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