@damiro/stylo 0.5.0 → 0.7.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 +18 -9
- package/dist/{InPlaceView-B1GXXnoz.js → InPlaceView-CS1qy-Ba.js} +116 -115
- package/dist/{InPlaceView-B1GXXnoz.js.map → InPlaceView-CS1qy-Ba.js.map} +1 -1
- package/dist/{Preview-Dxb9zPVv.js → Preview-Bw0k3Mev.js} +2 -2
- package/dist/{Preview-Dxb9zPVv.js.map → Preview-Bw0k3Mev.js.map} +1 -1
- 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 +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/theme.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 +15 -0
- package/dist/editor/wikilink-complete.d.ts.map +1 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/inplace/InPlaceView.d.ts +4 -2
- package/dist/inplace/InPlaceView.d.ts.map +1 -1
- package/dist/inplace/theme.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/stylo.js +58 -53
- package/dist/stylo.js.map +1 -1
- package/dist/types.d.ts +25 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/{useCodeMirror-hLeJQw6e.js → useCodeMirror-GPSkaYW6.js} +203 -167
- package/dist/useCodeMirror-GPSkaYW6.js.map +1 -0
- package/dist/wikilink-CTR8IFKc.js +42 -0
- package/dist/wikilink-CTR8IFKc.js.map +1 -0
- package/package.json +4 -1
- package/dist/useCodeMirror-hLeJQw6e.js.map +0 -1
- package/dist/wikilink-BFpTehto.js +0 -42
- package/dist/wikilink-BFpTehto.js.map +0 -1
package/README.md
CHANGED
|
@@ -26,7 +26,8 @@ built in.
|
|
|
26
26
|
- **First-class math** — `$…$` and `$$…$$` rendered with KaTeX, live in the
|
|
27
27
|
canvas and in preview.
|
|
28
28
|
- **`[[wikilinks]]`** — recognised, styled, and clickable, with an
|
|
29
|
-
`onWikiLinkClick` callback
|
|
29
|
+
`onWikiLinkClick` callback and opt-in `[[` autocomplete from an index you
|
|
30
|
+
supply (`wikiLinkSource`).
|
|
30
31
|
- **Interactive tables** — edit a rendered table cell by cell in the in-place
|
|
31
32
|
canvas, with row / column controls; or keep plain source pipes.
|
|
32
33
|
- **Callouts** — `> [!note]` blockquotes render as tinted admonition blocks
|
|
@@ -149,11 +150,15 @@ function Editor() {
|
|
|
149
150
|
your own `ToolbarCustomItem` buttons, and a `render` slot to wrap it. See the
|
|
150
151
|
[toolbar reference](./docs/wiki/reference/toolbar.md).
|
|
151
152
|
|
|
152
|
-
`inPlace` and `
|
|
153
|
-
give `<Stylo>` a `key` derived from the config to apply a
|
|
154
|
-
prop is fully reactive. See
|
|
153
|
+
`inPlace`, `codeLanguages`, and `wikiLinkSource` are read once, when the editing
|
|
154
|
+
surface mounts — give `<Stylo>` a `key` derived from the config to apply a
|
|
155
|
+
change. Every other prop is fully reactive. See
|
|
155
156
|
[props · applied at mount](./docs/wiki/reference/props.md#config-applied-at-mount).
|
|
156
157
|
|
|
158
|
+
Pass `wikiLinkSource` — `(query) => { target, label? }[]`, sync or async — to
|
|
159
|
+
turn on `[[wikilink]]` autocomplete backed by your own index. See
|
|
160
|
+
[Wikilink autocomplete](./docs/wiki/reference/props.md#wikilink-autocomplete).
|
|
161
|
+
|
|
157
162
|
Fenced code blocks render in plain monospace — no token colours — until you pass
|
|
158
163
|
`codeLanguages` with the grammars you want. Stylo bundles none by design (the
|
|
159
164
|
full grammar set is ~110 lazy chunks). See
|
|
@@ -164,8 +169,9 @@ full grammar set is ~110 lazy chunks). See
|
|
|
164
169
|
Every colour is a `--stylo-*` custom property; override any of them on `.stylo`
|
|
165
170
|
or an ancestor. A dark palette ships built in and activates under a `.dark` or
|
|
166
171
|
`[data-theme="dark"]` ancestor — the `next-themes` / shadcn convention.
|
|
167
|
-
`--stylo-font-size` (default `0.9375rem`) sets the base editor size
|
|
168
|
-
inside scales from it
|
|
172
|
+
`--stylo-font-size` (default `0.9375rem`) sets the base editor size and
|
|
173
|
+
everything inside scales from it; `--stylo-font-family` and
|
|
174
|
+
`--stylo-font-family-mono` set the prose and code fonts.
|
|
169
175
|
|
|
170
176
|
---
|
|
171
177
|
|
|
@@ -208,12 +214,15 @@ Engineering journal and Architectural Decision Records:
|
|
|
208
214
|
|
|
209
215
|
```bash
|
|
210
216
|
npm install
|
|
211
|
-
npm run dev
|
|
217
|
+
npm run dev # playground
|
|
212
218
|
npm run typecheck
|
|
213
|
-
npm run test
|
|
214
|
-
npm run
|
|
219
|
+
npm run test # unit suite (Vitest + jsdom)
|
|
220
|
+
npm run test:browser # in-place canvas in real Chromium (Playwright)
|
|
221
|
+
npm run build # library bundle
|
|
215
222
|
```
|
|
216
223
|
|
|
224
|
+
`npm run test:browser` needs the browser once: `npx playwright install chromium`.
|
|
225
|
+
|
|
217
226
|
## License
|
|
218
227
|
|
|
219
228
|
MIT © damiro
|