@kupcad/editor 0.1.1 → 0.1.3

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 CHANGED
@@ -68,7 +68,9 @@ const again = new Editor(element, { value: source, restore: kept });
68
68
  * **The look** (`theme.js`): the `--kc-*` tokens of `@kupcad/ui` (the page's own colours where
69
69
  they are unset), and the code's colours by `--kc-code-keyword`, `-string`, `-comment`,
70
70
  `-constant`, `-function` and `-definition` (GitHub's, light or dark, where unset);
71
- `--kc-code-font` and `--kc-code-font-size`.
71
+ `--kc-code-font` and `--kc-code-font-size`. Light or dark as the page's colour scheme is: the
72
+ system's with `@kupcad/ui`'s tokens, until the page chooses one (`data-theme="light"` or
73
+ `"dark"` on its root).
72
74
 
73
75
  Tests: the highlighting, indentation and completion on the parsed text, the findings placed (the
74
76
  real core's `check`, through `@kupcad/wasm`) and their fixes made, a snapshot restored (its undo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kupcad/editor",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "KupCAD's code editor for the web: CodeMirror 6 with the language's highlighting and the core's findings marked, and a Svelte component around it.",
5
5
  "license": "AGPL-3.0-only",
6
6
  "repository": {
@@ -34,11 +34,11 @@
34
34
  "@codemirror/search": "^6.7.2",
35
35
  "@codemirror/state": "^6.7.6",
36
36
  "@codemirror/view": "^6.43.15",
37
- "@kupcad/protocol": "0.1.1",
37
+ "@kupcad/protocol": "0.1.3",
38
38
  "@lezer/highlight": "^1.2.5"
39
39
  },
40
40
  "devDependencies": {
41
- "@kupcad/wasm": "0.1.1",
41
+ "@kupcad/wasm": "0.1.3",
42
42
  "@sveltejs/vite-plugin-svelte": "^7.3.1",
43
43
  "@testing-library/svelte": "^5.4.2",
44
44
  "@types/node": "^26.6.5",
package/src/theme.js CHANGED
@@ -1,7 +1,8 @@
1
1
  // How the editor looks: by the --kc-* tokens a host sets (@kupcad/ui's tokens.css), else the
2
2
  // page's own colours (CSS system colours, light or dark as the page is); the code's colours by
3
3
  // the --kc-code-* tokens (keyword, string, comment, constant, function, definition), else
4
- // GitHub's, light or dark.
4
+ // GitHub's, light or dark. Light or dark as the page's colour scheme is, which the editor takes
5
+ // from it: tokens.css's, the system's until the page chooses one (data-theme).
5
6
 
6
7
  import { HighlightStyle } from '@codemirror/language';
7
8
  import { EditorView } from '@codemirror/view';
@@ -26,8 +27,6 @@ export const editorTheme = EditorView.theme({
26
27
  color: FG,
27
28
  backgroundColor: BG,
28
29
  fontSize: 'var(--kc-code-font-size, var(--kc-font-size, 13px))',
29
- // What light-dark() picks by, where the page says nothing of its scheme
30
- colorScheme: 'light dark',
31
30
  },
32
31
  '.cm-scroller': {
33
32
  fontFamily: 'var(--kc-code-font, ui-monospace, SFMono-Regular, Menlo, Consolas, monospace)',