@fusion.dev/helix-sandbox 0.0.0-dev → 0.207.1

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 (61) hide show
  1. package/api.json +1 -1
  2. package/custom-elements.json +1 -1182
  3. package/dist/code-block/code-block-highlight.d.ts +0 -1
  4. package/dist/code-block/code-block-highlight.js +0 -1
  5. package/dist/code-block/index.d.ts +0 -1
  6. package/dist/code-block/index.js +0 -1
  7. package/dist/editor/index.d.ts +0 -1
  8. package/dist/editor/index.js +0 -1
  9. package/dist/highlight/highlight.d.ts +0 -1
  10. package/dist/highlight/highlight.js +0 -1
  11. package/dist/highlight/index.d.ts +0 -1
  12. package/dist/highlight/index.js +0 -1
  13. package/dist/highlight/language.d.ts +0 -1
  14. package/dist/highlight/language.js +0 -1
  15. package/dist/highlight/shell.d.ts +0 -1
  16. package/dist/highlight/shell.js +0 -1
  17. package/dist/highlight/stream.d.ts +0 -1
  18. package/dist/highlight/stream.js +0 -1
  19. package/dist/highlight/syntax.d.ts +0 -1
  20. package/dist/highlight/syntax.js +0 -1
  21. package/dist/index.d.ts +0 -1
  22. package/dist/index.js +0 -1
  23. package/dist/sandbox/editor/sandbox-editor.css.d.ts +0 -1
  24. package/dist/sandbox/editor/sandbox-editor.css.js +0 -1
  25. package/dist/sandbox/editor/sandbox-editor.d.ts +0 -1
  26. package/dist/sandbox/editor/sandbox-editor.js +0 -1
  27. package/examples.json +1 -1
  28. package/lint.json +1 -1
  29. package/package.json +8 -8
  30. package/dist/code-block/code-block-highlight.d.ts.map +0 -1
  31. package/dist/code-block/code-block-highlight.js.map +0 -1
  32. package/dist/code-block/index.d.ts.map +0 -1
  33. package/dist/code-block/index.js.map +0 -1
  34. package/dist/editor/index.d.ts.map +0 -1
  35. package/dist/editor/index.js.map +0 -1
  36. package/dist/editor/root/editor-root.css.d.ts +0 -2
  37. package/dist/editor/root/editor-root.css.d.ts.map +0 -1
  38. package/dist/editor/root/editor-root.css.js +0 -3
  39. package/dist/editor/root/editor-root.css.js.map +0 -1
  40. package/dist/editor/root/editor-root.d.ts +0 -146
  41. package/dist/editor/root/editor-root.d.ts.map +0 -1
  42. package/dist/editor/root/editor-root.js +0 -199
  43. package/dist/editor/root/editor-root.js.map +0 -1
  44. package/dist/highlight/highlight.d.ts.map +0 -1
  45. package/dist/highlight/highlight.js.map +0 -1
  46. package/dist/highlight/index.d.ts.map +0 -1
  47. package/dist/highlight/index.js.map +0 -1
  48. package/dist/highlight/language.d.ts.map +0 -1
  49. package/dist/highlight/language.js.map +0 -1
  50. package/dist/highlight/shell.d.ts.map +0 -1
  51. package/dist/highlight/shell.js.map +0 -1
  52. package/dist/highlight/stream.d.ts.map +0 -1
  53. package/dist/highlight/stream.js.map +0 -1
  54. package/dist/highlight/syntax.d.ts.map +0 -1
  55. package/dist/highlight/syntax.js.map +0 -1
  56. package/dist/index.d.ts.map +0 -1
  57. package/dist/index.js.map +0 -1
  58. package/dist/sandbox/editor/sandbox-editor.css.d.ts.map +0 -1
  59. package/dist/sandbox/editor/sandbox-editor.css.js.map +0 -1
  60. package/dist/sandbox/editor/sandbox-editor.d.ts.map +0 -1
  61. package/dist/sandbox/editor/sandbox-editor.js.map +0 -1
@@ -13,4 +13,3 @@ import { type CSSResult } from 'lit';
13
13
  export declare const codeBlockHighlighter: (code: string, language: string) => string | undefined;
14
14
  /** The rules that color `codeBlockHighlighter`'s classes, for a block to adopt. */
15
15
  export declare const codeBlockSheet: CSSResult;
16
- //# sourceMappingURL=code-block-highlight.d.ts.map
@@ -7,4 +7,3 @@ export const codeBlockHighlighter = (code, language) => {
7
7
  return grammar ? highlight(code, grammar, syntaxHighlighter) : undefined;
8
8
  };
9
9
  export const codeBlockSheet = unsafeCSS(syntaxRules);
10
- //# sourceMappingURL=code-block-highlight.js.map
@@ -1,2 +1 @@
1
1
  export { codeBlockHighlighter, codeBlockSheet } from './code-block-highlight.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@ import { registerHighlighter } from '@fusion.dev/helix-headless/code-block';
2
2
  import { codeBlockHighlighter, codeBlockSheet } from './code-block-highlight.js';
3
3
  registerHighlighter(codeBlockHighlighter, codeBlockSheet);
4
4
  export { codeBlockHighlighter, codeBlockSheet } from './code-block-highlight.js';
5
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export * from '../sandbox/editor/sandbox-editor.js';
2
- //# sourceMappingURL=index.d.ts.map
@@ -1,2 +1 @@
1
1
  export * from '../sandbox/editor/sandbox-editor.js';
2
- //# sourceMappingURL=index.js.map
@@ -22,4 +22,3 @@ import type { HighlightLanguage } from './language.js';
22
22
  * own, whose rules are `syntaxRules`.
23
23
  */
24
24
  export declare const highlight: (code: string, language: HighlightLanguage, highlighter?: Highlighter) => string;
25
- //# sourceMappingURL=highlight.d.ts.map
@@ -94,4 +94,3 @@ export const highlight = (code, language, highlighter = classHighlighter) => {
94
94
  }
95
95
  return out;
96
96
  };
97
- //# sourceMappingURL=highlight.js.map
@@ -1,4 +1,3 @@
1
1
  export { highlight } from './highlight.js';
2
2
  export { type HighlightLanguage, languageOf } from './language.js';
3
3
  export { syntaxHighlighter, syntaxRules } from './syntax.js';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,3 @@
1
1
  export { highlight } from './highlight.js';
2
2
  export { languageOf } from './language.js';
3
3
  export { syntaxHighlighter, syntaxRules } from './syntax.js';
4
- //# sourceMappingURL=index.js.map
@@ -23,4 +23,3 @@ export type HighlightLanguage = 'css' | 'html' | 'js' | 'sh' | 'ts' | 'tsx';
23
23
  * `undefined` for a name no grammar here reads.
24
24
  */
25
25
  export declare const languageOf: (name: string) => HighlightLanguage | undefined;
26
- //# sourceMappingURL=language.d.ts.map
@@ -18,4 +18,3 @@ const NAMES = {
18
18
  zsh: 'sh',
19
19
  };
20
20
  export const languageOf = (name) => NAMES[name.trim().toLowerCase()];
21
- //# sourceMappingURL=language.js.map
@@ -7,4 +7,3 @@ export interface ShellState {
7
7
  export declare const shellMode: StreamParser<ShellState>;
8
8
  /** What `shellMode`'s own token name is drawn as, for its `tokenTable`. */
9
9
  export declare const shellTokens: Record<string, Tag>;
10
- //# sourceMappingURL=shell.d.ts.map
@@ -28,4 +28,3 @@ export const shellMode = {
28
28
  },
29
29
  };
30
30
  export const shellTokens = { command: tags.keyword };
31
- //# sourceMappingURL=shell.js.map
@@ -7,4 +7,3 @@ import { type Highlighter, type Tag } from '@lezer/highlight';
7
7
  * run, as they are there.
8
8
  */
9
9
  export declare const highlightStream: <State>(code: string, mode: StreamParser<State>, table: Record<string, Tag | readonly Tag[]>, highlighter: Highlighter, put: (text: string, classes: string) => void, putBreak: () => void) => void;
10
- //# sourceMappingURL=stream.d.ts.map
@@ -175,4 +175,3 @@ export const highlightStream = (code, mode, table, highlighter, put, putBreak) =
175
175
  put(line.slice(from), run);
176
176
  });
177
177
  };
178
- //# sourceMappingURL=stream.js.map
@@ -7,4 +7,3 @@ import { type Highlighter } from '@lezer/highlight';
7
7
  export declare const syntaxHighlighter: Highlighter;
8
8
  /** The CSS for `syntaxHighlighter`'s classes, which colors them from the `--helix-color-syntax-*` tokens. */
9
9
  export declare const syntaxRules: string;
10
- //# sourceMappingURL=syntax.d.ts.map
@@ -97,4 +97,3 @@ export const syntaxHighlighter = tagHighlighter(RULES.map((rule) => ({ class: ru
97
97
  export const syntaxRules = RULES.map((rule) => `.${rule.class} { ${Object.entries(rule.style)
98
98
  .map(([name, value]) => `${name.replace(/[A-Z]/g, (up) => `-${up.toLowerCase()}`)}: ${value};`)
99
99
  .join(' ')} }`).join('\n');
100
- //# sourceMappingURL=syntax.js.map
package/dist/index.d.ts CHANGED
@@ -17,4 +17,3 @@
17
17
  export type { CaretDetail, HelixBeforeEditEvent, HelixCaretEvent, HelixEditEvent, } from '@fusion.dev/helix-core';
18
18
  export * from './highlight/index.js';
19
19
  export type { EditorLanguage, HelixSandboxEditor } from './sandbox/editor/sandbox-editor.js';
20
- //# sourceMappingURL=index.d.ts.map
package/dist/index.js CHANGED
@@ -1,2 +1 @@
1
1
  export * from './highlight/index.js';
2
- //# sourceMappingURL=index.js.map
@@ -1,2 +1 @@
1
1
  export declare const styles: import("lit").CSSResult;
2
- //# sourceMappingURL=sandbox-editor.css.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`:host {display: block;min-block-size: 0;overflow: hidden}[part="editor"] {block-size: 100%;font-family: var(--helix-font-mono);font-size: var(--helix-text-sm)}[part="editor"] .cm-editor {block-size: 100%}[part="editor"] .cm-scroller {font-family: inherit;line-height: var(--helix-leading-normal)}[part="editor"] .cm-gutters {background-color: transparent;border: none;color: var(--helix-color-foreground-muted)}[part="editor"] .cm-activeLineGutter, [part="editor"] .cm-activeLine {background-color: var(--helix-color-surface-sunken)}[part="editor"] .cm-content {caret-color: var(--helix-color-primary)}[part="editor"] .cm-cursor {border-left-color: var(--helix-color-primary)}[part="editor"] .cm-selectionBackground, [part="editor"] .cm-editor.cm-focused .cm-selectionBackground {background-color: var(--helix-color-primary-subtle)}[part="editor"] .cm-editor.cm-focused {outline: none}:host([readonly]) [part="editor"] .cm-cursor {border-left-color: var(--helix-color-foreground-subtle)}@media print {:host {display: none}}`);
3
- //# sourceMappingURL=sandbox-editor.css.js.map
@@ -144,4 +144,3 @@ declare global {
144
144
  'helix-sandbox-editor': HelixSandboxEditor;
145
145
  }
146
146
  }
147
- //# sourceMappingURL=sandbox-editor.d.ts.map
@@ -196,4 +196,3 @@ HelixSandboxEditor = __decorate([
196
196
  customElement('helix-sandbox-editor')
197
197
  ], HelixSandboxEditor);
198
198
  export { HelixSandboxEditor };
199
- //# sourceMappingURL=sandbox-editor.js.map
package/examples.json CHANGED
@@ -1 +1 @@
1
- {"environment":{"browser":"chromium 153.0.8010.12","fonts":"90 fonts, d93ed8347ae01f6c","os":"ubuntu 24.04","platform":"linux"},"examples":{"sandbox":[]},"package":"@fusion.dev/helix-sandbox"}
1
+ {"environment":{"browser":"chromium 153.0.8010.12","fonts":"90 fonts, d93ed8347ae01f6c","os":"ubuntu 24.04","platform":"linux"},"examples":{"sandbox":[]},"package":"@fusion.dev/helix-sandbox"}
package/lint.json CHANGED
@@ -1 +1 @@
1
- {"package":"@fusion.dev/helix-sandbox","tags":{"helix-sandbox-editor":{"attributes":{"field-label":null,"language":["css","html","javascript","js","jsx","mjs","sh","ts","tsx"],"name":null,"readonly":null,"value":null},"booleans":["readonly"],"family":"sandbox","hooks":[],"parts":["editor"],"reflected":["readonly"],"slots":[],"written":["readOnly$","read-only$","language$","name$","modified","caret","mount","internals","whenSettled","when-settled","hydrating","serverRendered","server-rendered","childrenKnown","children-known","knownChildren","known-children","assignsByName","assigns-by-name","stopInner","stop-inner"]}},"version":"0.206.0"}
1
+ {"package":"@fusion.dev/helix-sandbox","tags":{"helix-sandbox-editor":{"attributes":{"field-label":null,"language":["css","html","javascript","js","jsx","mjs","sh","ts","tsx"],"name":null,"readonly":null,"value":null},"booleans":["readonly"],"family":"sandbox","hooks":[],"parts":["editor"],"reflected":["readonly"],"slots":[],"written":["readOnly$","read-only$","language$","name$","modified","caret","mount","internals","whenSettled","when-settled","hydrating","serverRendered","server-rendered","childrenKnown","children-known","knownChildren","known-children","assignsByName","assigns-by-name","stopInner","stop-inner"]}},"version":"0.207.1"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-sandbox",
3
3
  "description": "A CodeMirror source pane for the Helix sandbox, and a code highlighter for Code Block.",
4
- "version": "0.0.0-dev",
4
+ "version": "0.207.1",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -72,18 +72,18 @@
72
72
  "@codemirror/legacy-modes": "^6.5.4",
73
73
  "@codemirror/state": "^6.7.1",
74
74
  "@codemirror/view": "^6.43.8",
75
- "@fusion.dev/helix-core": "0.206.0",
76
- "@fusion.dev/helix-headless": "0.206.0",
77
- "@fusion.dev/helix-styles": "0.206.0",
75
+ "@fusion.dev/helix-core": "0.207.1",
76
+ "@fusion.dev/helix-headless": "0.207.1",
77
+ "@fusion.dev/helix-styles": "0.207.1",
78
78
  "@lezer/css": "^1.3.6",
79
79
  "@lezer/highlight": "^1.2.5",
80
80
  "@lezer/html": "^1.3.13",
81
81
  "@lezer/javascript": "^1.5.4"
82
82
  },
83
83
  "devDependencies": {
84
- "@fusion.dev/helix": "0.206.0",
85
- "@fusion.dev/helix-cem": "0.206.0",
86
- "@fusion.dev/helix-testing": "0.206.0",
84
+ "@fusion.dev/helix": "0.207.1",
85
+ "@fusion.dev/helix-cem": "0.207.1",
86
+ "@fusion.dev/helix-testing": "0.207.1",
87
87
  "@fusion.dev/scripts": "0.0.0-dev",
88
88
  "@happy-dom/global-registrator": "^20.14.5",
89
89
  "@lit-labs/ssr": "^4.1.0",
@@ -102,7 +102,7 @@
102
102
  "web-components"
103
103
  ],
104
104
  "peerDependencies": {
105
- "@fusion.dev/helix": "0.206.0",
105
+ "@fusion.dev/helix": "0.207.1",
106
106
  "lit": "^3.2.1"
107
107
  },
108
108
  "peerDependenciesMeta": {
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-block-highlight.d.ts","sourceRoot":"","sources":["../../src/code-block/code-block-highlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAa,MAAM,KAAK,CAAA;AAK/C;;;;;;;;;;GAUG;AACH,eAAO,MAAM,oBAAoB,SAAU,MAAM,YAAY,MAAM,KAAG,MAAM,GAAG,SAG9E,CAAA;AAED,mFAAmF;AACnF,eAAO,MAAM,cAAc,EAAE,SAAkC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"code-block-highlight.js","sourceRoot":"","sources":["../../src/code-block/code-block-highlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,SAAS,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAA;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAavE,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAY,EAAE,QAAgB,EAAsB,EAAE;IACzF,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,CAAC,CAAA;IACpC,OAAO,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC1E,CAAC,CAAA;AAGD,MAAM,CAAC,MAAM,cAAc,GAAc,SAAS,CAAC,WAAW,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/code-block/index.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/code-block/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAA;AAC3E,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA;AAEhF,mBAAmB,CAAC,oBAAoB,EAAE,cAAc,CAAC,CAAA;AAEzD,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AASA,cAAc,qCAAqC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AASA,cAAc,qCAAqC,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare const styles: import("lit").CSSResult;
2
- //# sourceMappingURL=editor-root.css.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-root.css.d.ts","sourceRoot":"","sources":["../../../src/editor/root/editor-root.css.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,yBAAihC,CAAA"}
@@ -1,3 +0,0 @@
1
- import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {display: block;min-block-size: 0;overflow: hidden}[part="editor"] {block-size: 100%;font-family: var(--helix-font-mono);font-size: var(--helix-text-sm)}[part="editor"] .cm-editor {block-size: 100%}[part="editor"] .cm-scroller {font-family: inherit;line-height: var(--helix-leading-normal)}[part="editor"] .cm-gutters {background-color: transparent;border: none;color: var(--helix-color-foreground-muted)}[part="editor"] .cm-activeLineGutter, [part="editor"] .cm-activeLine {background-color: var(--helix-color-surface-sunken)}[part="editor"] .cm-content {caret-color: var(--helix-color-primary)}[part="editor"] .cm-cursor {border-left-color: var(--helix-color-primary)}[part="editor"] .cm-selectionBackground, [part="editor"] .cm-editor.cm-focused .cm-selectionBackground {background-color: var(--helix-color-primary-subtle)}[part="editor"] .cm-editor.cm-focused {outline: none}:host([readonly]) [part="editor"] .cm-cursor {border-left-color: var(--helix-color-foreground-subtle)}@media print {:host {display: none}}`);
3
- //# sourceMappingURL=editor-root.css.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-root.css.js","sourceRoot":"","sources":["../../../src/editor/root/editor-root.css.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEpD,MAAM,CAAC,MAAM,MAAM,GAAG,WAAW,CAAC,igCAAigC,CAAC,CAAA"}
@@ -1,146 +0,0 @@
1
- import { type CaretDetail, HelixElement } from '@fusion.dev/helix-core';
2
- import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
3
- /**
4
- * A language the editor knows, by the name a file or a sandbox pane carries.
5
- *
6
- * **Written out, where `keyof typeof` would hide the values.** The manifest
7
- * records a property's type as the text somebody wrote, so a type derived from
8
- * a record's keys reached it as a name with nothing in it and the reference
9
- * page listed no values. A union on one line resolves for every reader of these
10
- * sources without a type system, the `axes` rule included.
11
- *
12
- * The names are the panes': `js`, `jsx`, `mjs`, `ts` and `tsx` beside `css`,
13
- * `html` and `sh`, and `javascript`. The editor reads every name `languageOf`
14
- * from `@fusion.dev/helix-sandbox/highlight` reads, such as `TypeScript` or
15
- * `bash`, and `jsx` as `tsx`.
16
- */
17
- export type EditorLanguage = 'css' | 'html' | 'javascript' | 'js' | 'jsx' | 'mjs' | 'sh' | 'ts' | 'tsx';
18
- /**
19
- * @summary An editable pane of source, with highlighting and line numbers.
20
- *
21
- * @description
22
- * CodeMirror, not a `<textarea>`. A textarea cannot highlight what it holds,
23
- * number its lines, or say where the cursor is, and a status bar reading line
24
- * and column has to ask something.
25
- *
26
- * **On its own path.** This is `@fusion.dev/helix-sandbox/editor`, and the
27
- * package's root exports its class as a type only, because CodeMirror is most
28
- * of what the package weighs over the wire. A sandbox with no editable pane
29
- * pays for none, and neither does a site that registers its elements once.
30
- *
31
- * `language` names the grammar by the name a file or a sandbox pane carries:
32
- * `css`, `html`, `js`, `jsx`, `mjs`, `sh`, `ts` or `tsx`. A name the editor
33
- * does not read draws the source plain, and the console says so once.
34
- *
35
- * Each edit a reader makes is `helix-before-edit` first, which you can cancel
36
- * to refuse the edit, and `helix-edit` once the source holds it, as
37
- * `helix-sandbox-source` sends them. A `value` set from outside is the source the editor is given, and
38
- * sends neither. **The editor is `:state(modified)` while its source differs
39
- * from the source it was given**, the first `value` or the last one set from
40
- * outside, and `reset()` puts that source back as an edit.
41
- *
42
- * The view is built once and reconfigured, not rebuilt. Replacing it on every
43
- * change would throw away the undo history, the scroll position, and the
44
- * selection, which is most of what an editor is.
45
- *
46
- * @since 0.1.0
47
- * @status experimental
48
- * @category tooling
49
- * @aliases Code editor, Source pane
50
- * @documentation https://fusion.dev/helix/docs/sandbox
51
- *
52
- * @event {HelixBeforeEditEvent} helix-before-edit - Fired before the source is edited. Cancelable: refusing it takes the decision and nothing moves.
53
- * @event {HelixCaretEvent} helix-caret - Fired when the cursor moves, with its line and column.
54
- * @event {HelixEditEvent} helix-edit - Fired after the source was edited, with the new source.
55
- *
56
- * @csspart editor - The element CodeMirror is mounted into.
57
- *
58
- * @cssstate modified - While the source differs from the source the editor was given, until `reset()` or a new `value`.
59
- */
60
- export declare class HelixSandboxEditor extends HelixElement {
61
- /**
62
- * The key the editor's words are registered under, its tag:
63
- * `registerWords('de', { 'helix-sandbox-editor': { fieldLabel: 'Quelltext' } })`.
64
- */
65
- static words: string;
66
- /**
67
- * Accessible name for the editable region.
68
- */
69
- fieldLabel: string;
70
- /**
71
- * The language of the source, which decides how it is highlighted. A name
72
- * the editor does not read draws the source plain.
73
- */
74
- language: EditorLanguage;
75
- /**
76
- * Which source this pane holds, echoed in every change.
77
- */
78
- name: string;
79
- /**
80
- * Whether the text can be changed.
81
- *
82
- * `EditorState.readOnly` rather than removing the editor's focus or its
83
- * keymap: a reader still needs to select the text, scroll it, and put a
84
- * cursor in it to read a long line. What it stops is the typing.
85
- */
86
- readOnly: boolean;
87
- /**
88
- * The source being edited.
89
- */
90
- value: string;
91
- private readonly readOnly$;
92
- private view;
93
- private readonly language$;
94
- /** The editable region's name, which follows `field-label` and the words registered for it. */
95
- private readonly name$;
96
- /** The source the editor was given: its first `value`, or the last one set from outside. */
97
- private baseline;
98
- /** The source the last edit left, while `value` still holds it. */
99
- private edited;
100
- /** The `language` last reported as one the editor does not read. */
101
- private unread;
102
- /**
103
- * Whether the source differs from the source the editor was given: its
104
- * first `value`, or the last one set from outside.
105
- */
106
- get modified(): boolean;
107
- /**
108
- * Puts back the source the editor was given, as an edit: `helix-before-edit`
109
- * is sent first and can refuse it, and a sandbox passes it to its preview.
110
- */
111
- reset(): void;
112
- /**
113
- * What `language` turns on: its grammar, or nothing for a name the editor
114
- * does not read, which it reports once for each name.
115
- */
116
- private grammar;
117
- /** Where the cursor is, counted from one, as an editor reports it. */
118
- get caret(): CaretDetail;
119
- private get mount();
120
- /**
121
- * Builds the view once the mount exists.
122
- *
123
- * `root` is the shadow root rather than the document, or CodeMirror puts its
124
- * stylesheet where this element cannot see it and the editor renders unstyled.
125
- */
126
- private create;
127
- /**
128
- * Moves focus into the text, not onto the host.
129
- *
130
- * The host is not focusable: what a reader types into is CodeMirror's
131
- * contenteditable, several nodes down inside this shadow root. Without this,
132
- * `editor.focus()` from outside silently does nothing.
133
- */
134
- focus(): void;
135
- disconnectedCallback(): void;
136
- protected willUpdate(changed: PropertyValues): void;
137
- protected updated(changed: PropertyValues): void;
138
- protected render(): TemplateResult;
139
- static styles: CSSResultGroup;
140
- }
141
- declare global {
142
- interface HTMLElementTagNameMap {
143
- 'helix-sandbox-editor': HelixSandboxEditor;
144
- }
145
- }
146
- //# sourceMappingURL=editor-root.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-root.d.ts","sourceRoot":"","sources":["../../../src/editor/root/editor-root.ts"],"names":[],"mappings":"AAOA,OAAO,EACL,KAAK,WAAW,EAKhB,YAAY,EAGb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,KAAK,CAAA;AAQzE;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,cAAc,GACtB,KAAK,GACL,MAAM,GACN,YAAY,GACZ,IAAI,GACJ,KAAK,GACL,KAAK,GACL,IAAI,GACJ,IAAI,GACJ,KAAK,CAAA;AA0BT;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,qBACa,kBAAmB,SAAQ,YAAY;IAClD;;;OAGG;IACH,MAAM,CAAC,KAAK,SAAyB;IAErC;;OAEG;IAGH,UAAU,SAAmB;IAE7B;;;OAGG;IAEH,QAAQ,EAAE,cAAc,CAAS;IAEjC;;OAEG;IAEH,IAAI,SAAS;IAEb;;;;;;OAMG;IAEH,QAAQ,UAAQ;IAEhB;;OAEG;IAEH,KAAK,SAAK;IAEV,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C,OAAO,CAAC,IAAI,CAAwB;IACpC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C,+FAA+F;IAC/F,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAoB;IAE1C,4FAA4F;IAC5F,OAAO,CAAC,QAAQ,CAAK;IAErB,mEAAmE;IACnE,OAAO,CAAC,MAAM,CAAoB;IAElC,oEAAoE;IACpE,OAAO,CAAC,MAAM,CAAoB;IAElC;;;OAGG;IACH,IAAI,QAAQ,IAAI,OAAO,CAEtB;IAED;;;OAGG;IACH,KAAK,IAAI,IAAI,CAKZ;IAED;;;OAGG;IACH,OAAO,CAAC,OAAO;IAkBf,sEAAsE;IACtE,IAAI,KAAK,IAAI,WAAW,CAQvB;IAED,OAAO,KAAK,KAAK,GAEhB;IAED;;;;;OAKG;IACH,OAAO,CAAC,MAAM;IAiFd;;;;;;OAMG;IACM,KAAK,IAAI,IAAI,CAErB;IAEQ,oBAAoB,IAAI,IAAI,CAIpC;IAED,UAAmB,UAAU,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAQ3D;IAED,UAAmB,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,IAAI,CAwCxD;IAED,UAAmB,MAAM,IAAI,cAAc,CAE1C;IAED,OAAgB,MAAM,EAAE,cAAc,CAAmC;CAC1E;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,sBAAsB,EAAE,kBAAkB,CAAA;KAC3C;CACF"}
@@ -1,199 +0,0 @@
1
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
2
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
3
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
4
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
- return c > 3 && r && Object.defineProperty(target, key, r), r;
6
- };
7
- import { defaultKeymap, history, historyKeymap, indentWithTab } from '@codemirror/commands';
8
- import { css } from '@codemirror/lang-css';
9
- import { html as htmlLanguage } from '@codemirror/lang-html';
10
- import { javascript } from '@codemirror/lang-javascript';
11
- import { indentUnit, StreamLanguage, syntaxHighlighting } from '@codemirror/language';
12
- import { Annotation, Compartment, EditorState } from '@codemirror/state';
13
- import { EditorView, keymap, lineNumbers } from '@codemirror/view';
14
- import { customElement, HelixBeforeEditEvent, HelixCaretEvent, HelixEditEvent, HelixElement, reportRuntime, words, } from '@fusion.dev/helix-core';
15
- import { html, unsafeCSS } from 'lit';
16
- import { property } from 'lit/decorators.js';
17
- import { languageOf } from '../../highlight/language.js';
18
- import { shellMode, shellTokens } from '../../highlight/shell.js';
19
- import { syntaxHighlighter, syntaxRules } from '../../highlight/syntax.js';
20
- import { styles } from './editor-root.css.js';
21
- const shellLanguage = StreamLanguage.define({ ...shellMode, tokenTable: shellTokens });
22
- const LANGUAGES = {
23
- css: () => css(),
24
- html: () => htmlLanguage(),
25
- js: () => javascript(),
26
- sh: () => shellLanguage,
27
- ts: () => javascript({ typescript: true }),
28
- tsx: () => javascript({ jsx: true, typescript: true }),
29
- };
30
- const given = Annotation.define();
31
- let HelixSandboxEditor = class HelixSandboxEditor extends HelixElement {
32
- constructor() {
33
- super(...arguments);
34
- this.fieldLabel = 'Example source';
35
- this.language = 'html';
36
- this.name = 'html';
37
- this.readOnly = false;
38
- this.value = '';
39
- this.readOnly$ = new Compartment();
40
- this.language$ = new Compartment();
41
- this.name$ = new Compartment();
42
- this.baseline = '';
43
- }
44
- static { this.words = 'helix-sandbox-editor'; }
45
- get modified() {
46
- return this.value === this.edited && this.value !== this.baseline;
47
- }
48
- reset() {
49
- const view = this.view;
50
- if (view && this.modified) {
51
- view.dispatch({ changes: { from: 0, insert: this.baseline, to: view.state.doc.length } });
52
- }
53
- }
54
- grammar() {
55
- const read = languageOf(typeof this.language === 'string' ? this.language : '');
56
- if (read !== undefined) {
57
- return LANGUAGES[read]();
58
- }
59
- if (this.unread !== this.language) {
60
- this.unread = this.language;
61
- reportRuntime({
62
- kind: 'unknown-language',
63
- message: `<${this.localName} language="${this.language}"> names no language the editor reads, ` +
64
- 'so its source is drawn plain. Use css, html, js, jsx, mjs, sh, ts or tsx.',
65
- tag: this.localName,
66
- });
67
- }
68
- return [];
69
- }
70
- get caret() {
71
- const state = this.view?.state;
72
- if (!state) {
73
- return { column: 1, line: 1 };
74
- }
75
- const head = state.selection.main.head;
76
- const line = state.doc.lineAt(head);
77
- return { column: head - line.from + 1, line: line.number };
78
- }
79
- get mount() {
80
- return this.renderRoot.querySelector('[part="editor"]');
81
- }
82
- create() {
83
- const parent = this.mount;
84
- if (!parent || this.view) {
85
- return;
86
- }
87
- this.view = new EditorView({
88
- parent,
89
- root: this.shadowRoot ?? document,
90
- state: EditorState.create({
91
- doc: this.value,
92
- extensions: [
93
- lineNumbers(),
94
- history(),
95
- indentUnit.of(' '),
96
- EditorState.tabSize.of(2),
97
- keymap.of([...defaultKeymap, ...historyKeymap, indentWithTab]),
98
- syntaxHighlighting(syntaxHighlighter, { fallback: true }),
99
- this.language$.of(this.grammar()),
100
- this.readOnly$.of(EditorState.readOnly.of(this.readOnly)),
101
- EditorView.lineWrapping,
102
- EditorState.transactionFilter.of((transaction) => {
103
- if (!transaction.docChanged || transaction.annotation(given)) {
104
- return transaction;
105
- }
106
- const next = transaction.newDoc.toString();
107
- const request = new HelixBeforeEditEvent({ value: next });
108
- return this.dispatchEvent(request) ? transaction : [];
109
- }),
110
- EditorView.updateListener.of((update) => {
111
- const edit = update.docChanged &&
112
- !update.transactions.some((transaction) => transaction.annotation(given));
113
- if (edit) {
114
- const next = update.state.doc.toString();
115
- this.edited = next;
116
- this.value = next;
117
- this.dispatchEvent(new HelixEditEvent({ value: next }));
118
- }
119
- if (update.selectionSet || update.docChanged || update.focusChanged) {
120
- this.dispatchEvent(new HelixCaretEvent(this.caret));
121
- }
122
- }),
123
- this.name$.of(EditorView.contentAttributes.of({ 'aria-label': this.fieldLabel })),
124
- ],
125
- }),
126
- });
127
- this.dispatchEvent(new HelixCaretEvent(this.caret));
128
- }
129
- focus() {
130
- this.view?.focus();
131
- }
132
- disconnectedCallback() {
133
- super.disconnectedCallback();
134
- this.view?.destroy();
135
- this.view = undefined;
136
- }
137
- willUpdate(changed) {
138
- super.willUpdate(changed);
139
- if (this.value !== this.edited) {
140
- this.baseline = this.value;
141
- this.edited = undefined;
142
- }
143
- this.toggleState('modified', this.modified);
144
- }
145
- updated(changed) {
146
- super.updated(changed);
147
- this.create();
148
- const view = this.view;
149
- if (!view) {
150
- return;
151
- }
152
- if (changed.has('language')) {
153
- view.dispatch({ effects: this.language$.reconfigure(this.grammar()) });
154
- }
155
- if (changed.has('fieldLabel')) {
156
- view.dispatch({
157
- effects: this.name$.reconfigure(EditorView.contentAttributes.of({ 'aria-label': this.fieldLabel })),
158
- });
159
- }
160
- if (changed.has('readOnly')) {
161
- view.dispatch({
162
- effects: this.readOnly$.reconfigure(EditorState.readOnly.of(this.readOnly)),
163
- });
164
- }
165
- if (changed.has('value') && this.value !== view.state.doc.toString()) {
166
- const head = view.state.selection.main.head;
167
- view.dispatch({
168
- annotations: given.of(true),
169
- changes: { from: 0, insert: this.value, to: view.state.doc.length },
170
- selection: { anchor: Math.min(head, this.value.length) },
171
- });
172
- }
173
- }
174
- render() {
175
- return html `<div part="editor"></div>`;
176
- }
177
- static { this.styles = [styles, unsafeCSS(syntaxRules)]; }
178
- };
179
- __decorate([
180
- words,
181
- property({ attribute: 'field-label' })
182
- ], HelixSandboxEditor.prototype, "fieldLabel", void 0);
183
- __decorate([
184
- property()
185
- ], HelixSandboxEditor.prototype, "language", void 0);
186
- __decorate([
187
- property()
188
- ], HelixSandboxEditor.prototype, "name", void 0);
189
- __decorate([
190
- property({ attribute: 'readonly', reflect: true, type: Boolean })
191
- ], HelixSandboxEditor.prototype, "readOnly", void 0);
192
- __decorate([
193
- property()
194
- ], HelixSandboxEditor.prototype, "value", void 0);
195
- HelixSandboxEditor = __decorate([
196
- customElement('helix-sandbox-editor')
197
- ], HelixSandboxEditor);
198
- export { HelixSandboxEditor };
199
- //# sourceMappingURL=editor-root.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"editor-root.js","sourceRoot":"","sources":["../../../src/editor/root/editor-root.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC3F,OAAO,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC1C,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AACrF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,WAAW,EAAkB,MAAM,mBAAmB,CAAA;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAClE,OAAO,EAEL,aAAa,EACb,oBAAoB,EACpB,eAAe,EACf,cAAc,EACd,YAAY,EACZ,aAAa,EACb,KAAK,GACN,MAAM,wBAAwB,CAAA;AAE/B,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,KAAK,CAAA;AACrC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAC5C,OAAO,EAA0B,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAChF,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAA;AAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,sB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,CAAC,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;sDACV;AAO7B;IADC,QAAQ,EAAE;oDACsB;AAMjC;IADC,QAAQ,EAAE;gDACE;AAUb;IADC,QAAQ,CAAC,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;oDAClD;AAMhB;IADC,QAAQ,EAAE;iDACD;AAzCC,kBAAkB;IAD9B,aAAa,CAAC,sBAAsB,CAAC;GACzB,kBAAkB,CAqR9B"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"highlight.d.ts","sourceRoot":"","sources":["../../src/highlight/highlight.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,KAAK,WAAW,EAAiB,MAAM,kBAAkB,CAAA;AAGpF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAA;AA2GtD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,SAAS,SACd,MAAM,YACF,iBAAiB,gBACd,WAAW,KACvB,MAcF,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"highlight.js","sourceRoot":"","sources":["../../src/highlight/highlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,YAAY,CAAA;AAChD,OAAO,EAAE,gBAAgB,EAAoB,aAAa,EAAE,MAAM,kBAAkB,CAAA;AACpF,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,aAAa,CAAA;AACpE,OAAO,EAAE,MAAM,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEtD,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAG7C,MAAM,gBAAgB,GAAG;IACvB,cAAc;IACd,MAAM;IACN,QAAQ;IACR,OAAO;IACP,MAAM;IACN,KAAK;IACL,MAAM;IACN,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CAAA;AAuBH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,IAAY,EACZ,QAA2B,EAC3B,WAAW,GAAgB,gBAAgB,EACnC,EAAE;IACV,IAAI,GAAG,GAAG,EAAE,CAAA;IACZ,MAAM,GAAG,GAAG,CAAC,IAAY,EAAE,OAAe,EAAQ,EAAE;QAClD,GAAG,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,OAAO,KAAK,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;IAC3F,CAAC,CAAA;IACD,MAAM,QAAQ,GAAG,GAAS,EAAE;QAC1B,GAAG,IAAI,IAAI,CAAA;IACb,CAAC,CAAA;IACD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAC3E,CAAC;SAAM,CAAC;QACN,aAAa,CAAC,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,GAAG,EAAE,QAAQ,CAAC,CAAA;IAChF,CAAC;IACD,OAAO,GAAG,CAAA;AACZ,CAAC,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/highlight/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAAE,KAAK,iBAAiB,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/highlight/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,EAA0B,UAAU,EAAE,MAAM,eAAe,CAAA;AAClE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA"}