@damiro/stylo 0.4.0 → 0.5.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 +79 -4
- package/dist/{InPlaceView-Ba7JCZ2Y.js → InPlaceView-B1GXXnoz.js} +327 -316
- package/dist/InPlaceView-B1GXXnoz.js.map +1 -0
- package/dist/inplace/context-menu.d.ts +1 -1
- package/dist/inplace/context-menu.d.ts.map +1 -1
- package/dist/inplace/extension.d.ts.map +1 -1
- package/dist/inplace/menu-open.d.ts +11 -0
- package/dist/inplace/menu-open.d.ts.map +1 -0
- package/dist/inplace/menu-plugin.d.ts +1 -0
- package/dist/inplace/menu-plugin.d.ts.map +1 -1
- package/dist/inplace/selection-bar.d.ts.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/stylo.js +2 -2
- package/dist/{useCodeMirror-YnIFkvKn.js → useCodeMirror-hLeJQw6e.js} +2 -2
- package/dist/{useCodeMirror-YnIFkvKn.js.map → useCodeMirror-hLeJQw6e.js.map} +1 -1
- package/package.json +1 -1
- package/dist/InPlaceView-Ba7JCZ2Y.js.map +0 -1
package/README.md
CHANGED
|
@@ -8,6 +8,8 @@ with Obsidian and any other Markdown tool. CodeMirror 6 handles editing;
|
|
|
8
8
|
`remark` / `rehype` + KaTeX handle rendering; `[[wikilinks]]` and `$…$` math are
|
|
9
9
|
built in.
|
|
10
10
|
|
|
11
|
+

|
|
12
|
+
|
|
11
13
|
> **Status:** working library, pre-1.0. The in-place canvas, `source` / `preview`
|
|
12
14
|
> / `split` modes, the formatting toolbar, `[[wikilinks]]`, and KaTeX math all
|
|
13
15
|
> ship and are covered by an integration test suite (`npm run test`). The public
|
|
@@ -15,15 +17,49 @@ built in.
|
|
|
15
17
|
|
|
16
18
|
---
|
|
17
19
|
|
|
18
|
-
##
|
|
20
|
+
## Features
|
|
21
|
+
|
|
22
|
+
- **In-place canvas** — a live Obsidian-style surface: Markdown markers stay
|
|
23
|
+
hidden until the caret reaches the line, and headings, emphasis, links, and
|
|
24
|
+
math render inline without leaving the text. Plus `source`, `preview`, and
|
|
25
|
+
`split` modes.
|
|
26
|
+
- **First-class math** — `$…$` and `$$…$$` rendered with KaTeX, live in the
|
|
27
|
+
canvas and in preview.
|
|
28
|
+
- **`[[wikilinks]]`** — recognised, styled, and clickable, with an
|
|
29
|
+
`onWikiLinkClick` callback.
|
|
30
|
+
- **Interactive tables** — edit a rendered table cell by cell in the in-place
|
|
31
|
+
canvas, with row / column controls; or keep plain source pipes.
|
|
32
|
+
- **Callouts** — `> [!note]` blockquotes render as tinted admonition blocks
|
|
33
|
+
(`note` / `tip` / `warning` / `danger` / `example`).
|
|
34
|
+
- **Declarative toolbar** — trim, reorder, or extend the command set, supply
|
|
35
|
+
your own buttons, swap the icons.
|
|
36
|
+
[Reference](./docs/wiki/reference/toolbar.md).
|
|
37
|
+
- **End-user toolbar customizer** — an optional `<StyloToolbarSettings>`
|
|
38
|
+
component: drag- and keyboard-reorderable.
|
|
39
|
+
[Reference](./docs/wiki/reference/toolbar-settings.md).
|
|
40
|
+
- **Find / replace** — `Mod-f` on every editing surface.
|
|
41
|
+
- **Frontmatter-aware** — YAML frontmatter round-trips untouched; `onFrontmatter`
|
|
42
|
+
hands you the raw block to parse.
|
|
43
|
+
- **Opt-in code highlighting** — fenced code is coloured through a
|
|
44
|
+
`--stylo-syntax-*` token palette once you pass the grammars you want.
|
|
45
|
+
[Reference](./docs/wiki/reference/code-languages.md).
|
|
46
|
+
- **Themeable** — structural CSS only; a `--stylo-*` custom-property palette with
|
|
47
|
+
a built-in dark mode.
|
|
48
|
+
- **Imperative handle** — `focus()`, `scrollToHeading()`, `insertAtCursor()`, and
|
|
49
|
+
`getView()` for the raw CodeMirror `EditorView`.
|
|
19
50
|
|
|
20
|
-
|
|
21
|
-
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Install
|
|
22
54
|
|
|
23
55
|
```bash
|
|
24
|
-
npm install
|
|
56
|
+
npm install @damiro/stylo
|
|
25
57
|
```
|
|
26
58
|
|
|
59
|
+
To track an unreleased commit, install from git instead
|
|
60
|
+
(`npm install github:studiodamiro/stylo`) — the `prepare` script builds the
|
|
61
|
+
bundle during install, so there is nothing else to wire up.
|
|
62
|
+
|
|
27
63
|
CodeMirror, Lezer, and React are **peer dependencies** — Stylo shares the host's
|
|
28
64
|
copy rather than bundling its own, so editor state, facets, and the syntax tree
|
|
29
65
|
have a single identity (see [ADR-008](docs/journal/2026-09/2026-09-04_adr-008-codemirror-peer-dependency.md)).
|
|
@@ -128,6 +164,45 @@ full grammar set is ~110 lazy chunks). See
|
|
|
128
164
|
Every colour is a `--stylo-*` custom property; override any of them on `.stylo`
|
|
129
165
|
or an ancestor. A dark palette ships built in and activates under a `.dark` or
|
|
130
166
|
`[data-theme="dark"]` ancestor — the `next-themes` / shadcn convention.
|
|
167
|
+
`--stylo-font-size` (default `0.9375rem`) sets the base editor size; everything
|
|
168
|
+
inside scales from it.
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Documentation
|
|
173
|
+
|
|
174
|
+
Full documentation lives in the [wiki](./docs/wiki/index.md).
|
|
175
|
+
|
|
176
|
+
**Architecture**
|
|
177
|
+
|
|
178
|
+
- [System overview](./docs/wiki/architecture/overview.md) — the plain-text-first
|
|
179
|
+
model, the composed stack, and the render pipeline.
|
|
180
|
+
|
|
181
|
+
**Guides**
|
|
182
|
+
|
|
183
|
+
- [Integrating Stylo](./docs/wiki/guides/integration.md) — live vs. mount-time
|
|
184
|
+
props, persistence, stylesheet and peer-dependency setup, the theming
|
|
185
|
+
contract.
|
|
186
|
+
- [Auto-save](./docs/wiki/guides/autosave.md) — why it is not a prop, and a
|
|
187
|
+
`useAutosave` hook to copy.
|
|
188
|
+
- [Layout and touch](./docs/wiki/guides/layout-and-touch.md) — the page layouts,
|
|
189
|
+
the full-height recipe that pins a toolbar for free, and touch behaviour.
|
|
190
|
+
|
|
191
|
+
**Reference**
|
|
192
|
+
|
|
193
|
+
- [`<Stylo>` props](./docs/wiki/reference/props.md) — the prop surface, styling
|
|
194
|
+
tokens, and math setup.
|
|
195
|
+
- [Formatting toolbar](./docs/wiki/reference/toolbar.md) — the `toolbar` prop,
|
|
196
|
+
command ids, keyboard shortcuts, and the `icons` override.
|
|
197
|
+
- [`<StyloToolbarSettings />`](./docs/wiki/reference/toolbar-settings.md) — the
|
|
198
|
+
opt-in end-user customizer for the formatting bar.
|
|
199
|
+
- [In-place canvas configuration](./docs/wiki/reference/in-place-config.md) — the
|
|
200
|
+
`inPlace` prop and its decoration toggles.
|
|
201
|
+
- [Fenced-code highlighting](./docs/wiki/reference/code-languages.md) — the
|
|
202
|
+
`codeLanguages` prop and how to opt into language grammars.
|
|
203
|
+
|
|
204
|
+
Engineering journal and Architectural Decision Records:
|
|
205
|
+
[`docs/PROJECT_JOURNAL.md`](./docs/PROJECT_JOURNAL.md).
|
|
131
206
|
|
|
132
207
|
## Development
|
|
133
208
|
|