@particle-academy/fancy-code 0.15.1 → 0.17.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/CHANGELOG.md +53 -1
- package/README.md +1 -1
- package/dist/index.cjs +70 -861
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -18
- package/dist/index.d.ts +50 -18
- package/dist/index.js +63 -857
- package/dist/index.js.map +1 -1
- package/docs/CodeEditor.md +16 -1
- package/docs/languages.md +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -14,6 +14,59 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
|
14
14
|
|
|
15
15
|
## [Unreleased]
|
|
16
16
|
|
|
17
|
+
## [0.17.0] - 2026-11-13
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- **Releases need a lab-run certificate.** `publish.yml` gains a read-only
|
|
22
|
+
`lab-certificate` job that every publishing job needs: a tag is published only
|
|
23
|
+
when the fancy-labs lab has certified that exact version and commit. Consumers
|
|
24
|
+
do nothing; this changes how releases are cut, not what the package does.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **The editing textarea of `CodeEditor`, `FileViewer` and `MarkdownEditor`
|
|
29
|
+
shows a focus ring.** It was `outline-none` with nothing in its place, so a
|
|
30
|
+
keyboard user could not see where focus was. It now carries the kit ring
|
|
31
|
+
(`focus-visible:ring-2 ring-inset`, `--fancy-focus` / `--fancy-focus-dark`) on
|
|
32
|
+
the textarea itself. Consumers do nothing.
|
|
33
|
+
- **`FileViewer` (and any `readOnly` editor) no longer traps keyboard focus.**
|
|
34
|
+
Its key handler called `preventDefault` on every key except copy and
|
|
35
|
+
select-all, Tab included, so focus could never leave and the caret could not
|
|
36
|
+
move. Read-only now intercepts nothing; the textarea's `readOnly` attribute
|
|
37
|
+
already refuses edits.
|
|
38
|
+
- **Editable `CodeEditor` and `MarkdownEditor` no longer trap keyboard focus
|
|
39
|
+
(WCAG 2.1.2).** Tab always inserted indentation, so tabbing in meant never
|
|
40
|
+
tabbing out. Tab / Shift+Tab now indent and dedent only once you have edited
|
|
41
|
+
in the current focus session (typed, pasted, pressed Enter); until then Tab
|
|
42
|
+
moves focus on. Escape disarms, so the next Tab leaves; blur disarms too.
|
|
43
|
+
**Behaviour change:** a Tab pressed straight after focusing the editor, with
|
|
44
|
+
no edit yet, now moves focus instead of indenting. Nothing to do unless you
|
|
45
|
+
relied on that; type first, and Tab indents as before.
|
|
46
|
+
- **`CodeEditor`, `FileViewer` and `MarkdownEditor` can be named, and are named
|
|
47
|
+
by default** (axe `label`, critical, lab run 601, K28). The `<textarea>` a
|
|
48
|
+
person types into had no accessible name and none of the three accepted one.
|
|
49
|
+
Each now takes `aria-label`, `aria-labelledby` and `aria-describedby`, and
|
|
50
|
+
puts them on that textarea, not on a wrapper. Defaults: "Code editor",
|
|
51
|
+
the `filename` (else "File contents") for `FileViewer`, and "Markdown
|
|
52
|
+
editor". A `aria-labelledby` wins and suppresses the default label. Nothing
|
|
53
|
+
to do on upgrade; pass a name that says what the field is for, where you can.
|
|
54
|
+
|
|
55
|
+
## [0.16.0] - 2026-11-02
|
|
56
|
+
|
|
57
|
+
### Added
|
|
58
|
+
|
|
59
|
+
- **Shell and dotenv highlighting.** `language="shell"` (aliases `sh`, `bash`, `zsh`) and `language="dotenv"` (alias `env`) are registered built-ins, and `FileViewer` now highlights `.sh` / `.bash` / `.zsh` files, shell rc files and `.env` / `.env.*` files, which it showed as plain text before.
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- **The tokenizers now come from `@particle-academy/fancy-file-commons`.** fancy-code's own copies of the JavaScript/TypeScript, PHP, Python, Go and Markdown grammars moved there unchanged (react-fancy's `CodeBlock` and `CodeView` now use the same ones), and fancy-code registers the shared functions. Highlighting is identical. `tokenizeMarkdown` is still exported from this package.
|
|
64
|
+
- **The `@particle-academy/fancy-file-commons` range floor rose from `>=0.2` to `>=0.4`** (still `<2.0`): 0.4 is the first release that ships these grammars. npm installs it for you. **Consumer action:** none.
|
|
65
|
+
|
|
66
|
+
### Fixed
|
|
67
|
+
|
|
68
|
+
- **PHP with an unterminated `<!--` before a `<?php` tag no longer shows text twice.** The fix is in fancy-file-commons' `highlightCode`, which now trims a token that overlaps the one before it.
|
|
69
|
+
|
|
17
70
|
## [0.15.1] - 2026-11-01
|
|
18
71
|
|
|
19
72
|
### Changed
|
|
@@ -182,7 +235,6 @@ renders exactly as before.
|
|
|
182
235
|
|
|
183
236
|
These are the kit 0.5 platform floors, applied across every package at once so a consumer never has to resolve a mix. **No API changed, nothing was removed, nothing was renamed** — only what the package requires.
|
|
184
237
|
|
|
185
|
-
|
|
186
238
|
## [0.9.1] — 2026-07-28
|
|
187
239
|
|
|
188
240
|
### Fixed
|
package/README.md
CHANGED
|
@@ -140,7 +140,7 @@ pnpm --filter @particle-academy/fancy-code clean # Remove dist/
|
|
|
140
140
|
## At a Glance
|
|
141
141
|
|
|
142
142
|
- **5 public exports** — `CodeEditor` (+ `Toolbar`, `Toolbar.Separator`, `Panel`, `StatusBar`) and the `useCodeEditor` hook
|
|
143
|
-
- **
|
|
143
|
+
- **9 built-in languages** — JavaScript, TypeScript, HTML, PHP, Python, Go, Markdown, Shell, Dotenv (grammars shared from `@particle-academy/fancy-file-commons`)
|
|
144
144
|
- **3 built-in themes** — `light`, `dark`, `auto` (follows `prefers-color-scheme`)
|
|
145
145
|
- **Zero third-party dependencies** — custom engine, no Monaco / CodeMirror / Shiki
|
|
146
146
|
- **IDE-ready** — pairs with `TreeNav` from `@particle-academy/react-fancy` for full IDE layouts; see [docs/CodeEditor.md](./docs/CodeEditor.md) for an example.
|