@fusion.dev/helix 0.164.0 → 0.166.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.
@@ -2,7 +2,8 @@ import { createSheet } from '@fusion.dev/helix-core';
2
2
  export const styles = createSheet(`:host {--_code-block-size: var(--code-block-font-size, var(--helix-text-sm));--_code-block-leading: var(--code-block-line-height, var(--helix-leading-normal));--_code-block-face: var(--code-block-font-family, var(--helix-font-mono));--_code-block-copy-inset: calc(var(--helix-space-sm) + (1lh - var(--helix-size-control-sm)) / 2);--_code-block-gutter: calc(var(--helix-size-control-sm) + var(--_code-block-copy-inset) * 2);display: flex;flex-direction: column;}[part="frame"] {flex: 1;}:host(:not([diff])) [part="frame"] {font-size: var(--_code-block-size);line-height: var(--_code-block-leading);}[part="header"] {align-items: center;backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-header-background-color, var(--helix-color-surface-raised));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-end-end-radius: var(--helix-radii-none);border-end-start-radius: var(--helix-radii-none);border-start-end-radius: var(--code-block-radius, var(--helix-radii-lg));border-start-start-radius: var(--code-block-radius, var(--helix-radii-lg));display: flex;gap: var(--helix-space-sm);padding-block: var(--helix-space-xs);padding-inline: var(--helix-space-md);}[part="header"]:has(> [part="copy"]) {padding-block: var(--helix-space-2xs);padding-inline-end: var(--helix-space-2xs);}[part="label"] {color: var(--code-block-label-color, var(--helix-color-foreground-muted));font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);min-inline-size: 0;overflow-wrap: anywhere;}[part="frame"] {position: relative;}[part="block"] {block-size: 100%;}[part="copy"] {--icon-button-size: var(--helix-size-control-sm);}[part="header"] > [part="copy"] {margin-inline-start: auto;}[part="actions"] {align-items: center;display: flex;gap: var(--helix-space-2xs);margin-inline-start: auto;}[part="header"]
3
3
  > :is([part="actions"], [part="wrap-toggle"])
4
4
  ~ :is([part="copy"], [part="wrap-toggle"]) {margin-inline-start: var(--helix-space-none);}[part="wrap-toggle"] {all: unset;box-sizing: border-box;border-radius: var(--helix-radii-sm);color: var(--code-block-label-color, var(--helix-color-foreground-muted));cursor: pointer;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);margin-inline-start: auto;padding-block: var(--helix-space-2xs);padding-inline: var(--helix-space-xs);}[part="wrap-toggle"]:hover,
5
- [part="wrap-toggle"][aria-pressed="true"] {color: var(--helix-color-foreground);}[part="wrap-toggle"][aria-pressed="true"] {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);}[part="wrap-toggle"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="frame"] > [part="copy"] {font-size: var(--_code-block-size);inset-block-start: var(--_code-block-copy-inset);inset-inline-end: var(--_code-block-copy-inset);line-height: var(--_code-block-leading);position: absolute;}[part="block"] {backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-background-color, var(--helix-color-background));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-radius: var(--code-block-radius, var(--helix-radii-lg));margin: var(--helix-space-none);overflow-x: auto;padding-block: var(--helix-space-sm);padding-inline: var(--helix-space-md);}:host(:not([diff], [no-copy])) [part="frame"]:not([part="header"] + *) > [part="block"] {padding-inline-end: var(--_code-block-gutter);}[part="header"] + [part="frame"] [part="block"] {border-block-start-width: var(--helix-space-none);border-start-end-radius: var(--helix-radii-none);border-start-start-radius: var(--helix-radii-none);}[part="code"] {color: var(--code-block-color, var(--helix-color-foreground));font-family: var(--_code-block-face);font-size: var(--_code-block-size);line-height: var(--_code-block-leading);}:host(:not([diff])) [part="code"] {display: block;isolation: isolate;max-block-size: var(--code-block-max-block-size, none);overflow-x: auto;position: relative;}:host(:state(expanded)) [part="code"] {max-block-size: none;}[part="expand"] {all: unset;box-sizing: border-box;border-radius: var(--helix-radii-sm);color: var(--code-block-expand-color, var(--helix-color-foreground-muted));cursor: pointer;font-size: var(--helix-text-sm);padding: var(--helix-space-xs);}[part="expand"]:hover {color: var(--helix-color-foreground);}[part="expand"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="block"]:focus-visible,
5
+ [part="wrap-toggle"][aria-pressed="true"] {color: var(--helix-color-foreground);}[part="wrap-toggle"][aria-pressed="true"] {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);}[part="wrap-toggle"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="frame"] > [part="copy"] {font-size: var(--_code-block-size);inset-block-start: var(--_code-block-copy-inset);inset-inline-end: var(--_code-block-copy-inset);line-height: var(--_code-block-leading);position: absolute;}[part="block"] {backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-background-color, var(--helix-color-background));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-radius: var(--code-block-radius, var(--helix-radii-lg));margin: var(--helix-space-none);overflow-x: auto;padding-block: var(--helix-space-sm);padding-inline: var(--helix-space-md);}:host(:not([diff], [no-copy])) [part="frame"]:not([part="header"] + *) > [part="block"] {padding-inline-end: var(--_code-block-gutter);}[part="header"] + [part="frame"] [part="block"] {border-block-start-width: var(--helix-space-none);border-start-end-radius: var(--helix-radii-none);border-start-start-radius: var(--helix-radii-none);}[part="files"] {backdrop-filter: var(--code-block-backdrop, none);background-color: var(--code-block-header-background-color, var(--helix-color-surface-raised));border: var(--helix-border-thin) solid var(--code-block-border-color, var(--helix-color-border));border-block-end-width: var(--helix-space-none);border-start-end-radius: var(--code-block-radius, var(--helix-radii-lg));border-start-start-radius: var(--code-block-radius, var(--helix-radii-lg));display: flex;overflow-x: auto;padding-inline: var(--helix-space-xs);}[part="file-tab"] {background-color: transparent;border: none;border-block-end: var(--helix-border-thick) solid transparent;color: var(--code-block-label-color, var(--helix-color-foreground-muted));cursor: pointer;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);padding-block: var(--helix-space-xs);padding-inline: var(--helix-space-sm);white-space: nowrap;}[part="file-tab"]:hover,
6
+ [part="file-tab"][aria-selected="true"] {color: var(--helix-color-foreground);}[part="file-tab"][aria-selected="true"] {border-block-end-color: var(--helix-color-accent);}[part="file-tab"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}:host(:state(tabbed)) :is([part="header"], [part="block"]) {border-start-end-radius: var(--helix-radii-none);border-start-start-radius: var(--helix-radii-none);}[part="code"] {color: var(--code-block-color, var(--helix-color-foreground));font-family: var(--_code-block-face);font-size: var(--_code-block-size);line-height: var(--_code-block-leading);}:host(:not([diff])) [part="code"] {display: block;isolation: isolate;max-block-size: var(--code-block-max-block-size, none);overflow-x: auto;position: relative;}:host(:state(expanded)) [part="code"] {max-block-size: none;}[part="expand"] {all: unset;box-sizing: border-box;border-radius: var(--helix-radii-sm);color: var(--code-block-expand-color, var(--helix-color-foreground-muted));cursor: pointer;font-size: var(--helix-text-sm);padding: var(--helix-space-xs);}[part="expand"]:hover {color: var(--helix-color-foreground);}[part="expand"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: var(--helix-size-focus-offset);}[part="block"]:focus-visible,
6
7
  [part="code"]:focus-visible,
7
8
  [part="old"]:focus-visible,
8
9
  [part="new"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}:host([wrap]:not([diff])) [part="code"] {overflow-wrap: anywhere;white-space: pre-wrap;}[part="mark"] {background-color: var(
@@ -1,7 +1,7 @@
1
1
  import { HelixHeadlessDateInput } from '@fusion.dev/helix-headless/date-input';
2
2
  import type { CSSResultGroup } from 'lit';
3
3
  import '../../date-picker/index.js';
4
- import '../../tag/index.js';
4
+ import '../../tag/root/index.js';
5
5
  /**
6
6
  * @summary A date, typed or picked from a calendar.
7
7
  *
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessDateInput } from '@fusion.dev/helix-headless/date-input';
9
9
  import '../../date-picker/index.js';
10
- import '../../tag/index.js';
10
+ import '../../tag/root/index.js';
11
11
  import { styles as fieldStyles } from '../../shared/field/field.css.js';
12
12
  import { styles as fieldFrameStyles } from '../../shared/field/field-frame.css.js';
13
13
  import { styles as fieldSegmentsStyles } from '../../shared/field/field-segments.css.js';
@@ -32,7 +32,14 @@ registerElementEvents({
32
32
  'helix-chat-message': ['helix-send'],
33
33
  'helix-checkbox': ['change', 'helix-before-toggle', 'input'],
34
34
  'helix-checkbox-group': ['change', 'helix-before-change', 'input'],
35
- 'helix-code-block': ['helix-before-toggle', 'helix-toggle'],
35
+ 'helix-code-block': [
36
+ 'change',
37
+ 'helix-before-change',
38
+ 'helix-before-toggle',
39
+ 'helix-copy',
40
+ 'helix-copy-error',
41
+ 'helix-toggle',
42
+ ],
36
43
  'helix-color-input': [
37
44
  'change',
38
45
  'helix-before-change',
@@ -182,7 +189,13 @@ registerElementEvents({
182
189
  'helix-map-route': ['helix-map-part-change'],
183
190
  'helix-map-terrain': ['helix-map-part-change'],
184
191
  'helix-megamenu': ['helix-before-close', 'helix-before-open', 'toggle'],
185
- 'helix-menu': ['helix-before-close', 'helix-before-open', 'helix-select', 'toggle'],
192
+ 'helix-menu': [
193
+ 'helix-before-close',
194
+ 'helix-before-open',
195
+ 'helix-filter',
196
+ 'helix-select',
197
+ 'toggle',
198
+ ],
186
199
  'helix-menu-item': ['helix-before-toggle', 'helix-select'],
187
200
  'helix-meter': ['helix-band'],
188
201
  'helix-notification': ['helix-dismiss', 'helix-read'],
@@ -6,6 +6,9 @@ auto
6
6
  var(--menu-item-end, 0px);min-block-size: var(--helix-size-control);padding-inline: var(--helix-space-sm);transition: background-color var(--helix-duration-fast) var(--helix-easing-standard);user-select: none;}[part="item"]:hover {background-color: var(
7
7
  --menu-item-hover-color,
8
8
  color-mix(in oklab, var(--helix-color-foreground) 8%, transparent)
9
+ );}:host(:state(highlighted)) [part="item"] {background-color: var(
10
+ --menu-item-hover-color,
11
+ color-mix(in oklab, var(--helix-color-foreground) 8%, transparent)
9
12
  );}[part="item"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="item"][aria-disabled="true"] {cursor: not-allowed;opacity: 0.5;}[part="start"] {--icon-size: var(--helix-size-icon);align-items: center;box-sizing: border-box;color: var(--helix-color-foreground-subtle);display: flex;justify-content: center;padding-inline-end: var(--helix-space-xs);min-block-size: var(--helix-size-icon);}[part="start"] {grid-column: 1;}[part="item"] > slot:not([name]) {display: block;grid-column: 2;min-inline-size: 0;}slot[name="description"] {color: var(--menu-item-description-color, var(--helix-color-foreground-subtle));display: block;font-weight: var(--helix-weight-regular);grid-column: 2;grid-row: 2;min-inline-size: 0;padding-block-end: var(--helix-space-2xs);}slot[name="description"][data-empty] {display: none;}[part="end"] {align-items: center;color: var(--menu-item-detail-color, var(--helix-color-foreground-subtle));display: flex;gap: var(--helix-space-2xs);grid-column: 3;padding-inline-start: var(--helix-space-sm);}[part="end"][data-empty] {display: none;}[part="mark"],
10
13
  slot[name="check"]::slotted(*),
11
14
  slot[name="chevron"]::slotted(*) {grid-column: 4;grid-row: 1;}[part="start"][data-empty] {display: none;}[part="mark"],
@@ -1,2 +1,2 @@
1
1
  import { createSheet } from '@fusion.dev/helix-core';
2
- export const styles = createSheet(`:host {display: contents;}[part="surface"] {--helix-size-control: var(--helix-size-control-sm);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--menu-item-start: 0px;--menu-item-end: 0px;max-block-size: var(--menu-max-block-size, var(--floating-available-block-size, none));overflow-y: auto;--_floating-background-color: var(--menu-background-color, var(--helix-color-surface-overlay));--_floating-border-color: var(--menu-border-color, var(--helix-color-border));--_floating-border-width: var(--menu-border-width, var(--helix-border-floating));--_floating-shadow: var(--menu-shadow, var(--helix-shadow-floating));min-inline-size: var(--menu-min-inline-size, 12rem);padding-block: var(--helix-space-xs);padding-inline: var(--helix-space-none);}:host(:state(start)) [part="surface"] {--menu-item-start: calc(var(--helix-size-icon) + var(--helix-space-xs));}:host(:state(mark)) [part="surface"] {--menu-item-end: calc(var(--helix-size-icon) + var(--helix-space-xs));}[part="surface"][data-placement^="left"] {transform-origin: 100% var(--floating-arrow-y, 50%);}[part="surface"][data-placement^="right"] {transform-origin: 0 var(--floating-arrow-y, 50%);}[part="header"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;gap: var(--helix-space-2xs);margin-block-end: var(--helix-space-2xs);padding: var(--helix-space-2xs) var(--helix-space-xs) var(--helix-space-xs);}[part="back"] {align-items: center;background: none;border: none;border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground-muted);cursor: pointer;display: inline-flex;justify-content: center;block-size: calc(var(--helix-size-icon) + var(--helix-space-xs));inline-size: calc(var(--helix-size-icon) + var(--helix-space-xs));padding: var(--helix-space-none);}[part="back"] svg {block-size: var(--helix-size-icon);inline-size: var(--helix-size-icon);}[part="back"]:hover {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground);}[part="back"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="title"] {color: var(--helix-color-foreground);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);}::slotted(helix-divider) {margin-block: var(--helix-space-2xs);}[part="surface"][data-drilled] slot::slotted(:not(helix-menu-item)) {display: none;}:host([loading]) [part="surface"] {opacity: 0.5;}@media print {:host {display: none;}}`);
2
+ export const styles = createSheet(`:host {display: contents;}[part="surface"] {--helix-size-control: var(--helix-size-control-sm);--helix-size-control-loose: calc(var(--helix-size-control) * 1.2);--helix-size-control-tight: calc(var(--helix-size-control) * 0.8);--helix-size-icon: var(--helix-size-icon-sm);--helix-size-icon-loose: calc(var(--helix-size-icon) * 1.2);--helix-size-icon-tight: calc(var(--helix-size-icon) * 0.8);--menu-item-start: 0px;--menu-item-end: 0px;max-block-size: var(--menu-max-block-size, var(--floating-available-block-size, none));overflow-y: auto;--_floating-background-color: var(--menu-background-color, var(--helix-color-surface-overlay));--_floating-border-color: var(--menu-border-color, var(--helix-color-border));--_floating-border-width: var(--menu-border-width, var(--helix-border-floating));--_floating-shadow: var(--menu-shadow, var(--helix-shadow-floating));min-inline-size: var(--menu-min-inline-size, 12rem);padding-block: var(--helix-space-xs);padding-inline: var(--helix-space-none);}:host(:state(start)) [part="surface"] {--menu-item-start: calc(var(--helix-size-icon) + var(--helix-space-xs));}:host(:state(mark)) [part="surface"] {--menu-item-end: calc(var(--helix-size-icon) + var(--helix-space-xs));}[part="surface"][data-placement^="left"] {transform-origin: 100% var(--floating-arrow-y, 50%);}[part="surface"][data-placement^="right"] {transform-origin: 0 var(--floating-arrow-y, 50%);}[part="header"] {align-items: center;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);display: flex;gap: var(--helix-space-2xs);margin-block-end: var(--helix-space-2xs);padding: var(--helix-space-2xs) var(--helix-space-xs) var(--helix-space-xs);}[part="back"] {align-items: center;background: none;border: none;border-radius: var(--helix-radii-sm);color: var(--helix-color-foreground-muted);cursor: pointer;display: inline-flex;justify-content: center;block-size: calc(var(--helix-size-icon) + var(--helix-space-xs));inline-size: calc(var(--helix-size-icon) + var(--helix-space-xs));padding: var(--helix-space-none);}[part="back"] svg {block-size: var(--helix-size-icon);inline-size: var(--helix-size-icon);}[part="back"]:hover {background-color: color-mix(in oklab, var(--helix-color-foreground) 8%, transparent);color: var(--helix-color-foreground);}[part="back"]:focus-visible {outline: var(--helix-size-focus-ring) solid var(--helix-color-focus-ring);outline-offset: calc(var(--helix-size-focus-offset) * -1);}[part="title"] {color: var(--helix-color-foreground);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);}::slotted(helix-divider) {margin-block: var(--helix-space-2xs);}[part="surface"][data-drilled] slot::slotted(:not(helix-menu-item)) {display: none;}[part="search-field"] {appearance: none;background-color: var(--menu-background-color, var(--helix-color-surface-overlay));border: none;border-block-end: var(--helix-border-thin) solid var(--helix-color-border);box-sizing: border-box;color: var(--helix-color-foreground);display: block;font-family: var(--helix-font-sans);font-size: var(--helix-text-xs);font-weight: var(--helix-weight-medium);inline-size: 100%;inset-block-start: calc(var(--helix-space-xs) * -1);margin-block: calc(var(--helix-space-xs) * -1) var(--helix-space-xs);min-block-size: var(--helix-size-control);padding-inline: var(--helix-space-sm);position: sticky;z-index: 1;}[part="search-field"]:focus-visible {outline: none;}[part="surface"][data-filtered] slot::slotted(helix-divider) {display: none;}:host([loading]) [part="surface"] {opacity: 0.5;}@media print {:host {display: none;}}`);
@@ -0,0 +1 @@
1
+ export * from './option-root.js';
@@ -0,0 +1 @@
1
+ export * from './option-root.js';
@@ -1,4 +1,4 @@
1
- import { HelixHeadlessOption } from '@fusion.dev/helix-headless/option';
1
+ import { HelixHeadlessOption } from '@fusion.dev/helix-headless/option/root';
2
2
  import type { CSSResultGroup } from 'lit';
3
3
  /**
4
4
  * @summary One choice in a listbox.
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
- import { HelixHeadlessOption } from '@fusion.dev/helix-headless/option';
8
+ import { HelixHeadlessOption } from '@fusion.dev/helix-headless/option/root';
9
9
  import { styles } from './option-root.css.js';
10
10
  let HelixOption = class HelixOption extends HelixHeadlessOption {
11
11
  static { this.styles = styles; }
@@ -10,6 +10,9 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
10
10
  * preview do not reference each other, so you can replace either one or use it
11
11
  * alone.
12
12
  *
13
+ * The preview runs an edit once typing has rested for `preview-delay`, 300
14
+ * milliseconds by default, so a word typed reloads it once. A pane's text when the sandbox starts reaches it at once.
15
+ *
13
16
  * The event carries the pane's `name`, so one sandbox can hold several panes.
14
17
  * `html` sets the preview's markup, `css` sets its stylesheet, and `js` sets
15
18
  * a script that runs as a module after the markup. The sandbox ignores a pane
@@ -34,6 +37,16 @@ import type { CSSResultGroup, PropertyValues, TemplateResult } from 'lit';
34
37
  * like `helix-sandbox-source`, and the sandbox reads its `value` to seed the
35
38
  * preview. Dispatch `helix-caret` from it too for the status bar's position.
36
39
  *
40
+ * Sandbox is styled only and has behavior, as `Aura` is. Its behavior is the
41
+ * hand-off from a source pane to a preview frame, which works with any pane
42
+ * that sends `helix-before-edit`, and what it draws is the layout around them:
43
+ * dividers, file tabs, and a panel. A page that wants another look slots its
44
+ * own panes and keeps the hand-off, so there is nothing for a headless version
45
+ * to hold.
46
+ *
47
+ * A development build warns about a source pane with no `label` and no `name`,
48
+ * whose file tab would have no words.
49
+ *
37
50
  * On a focused divider, the arrow keys move it, and `Home` and `End` move it
38
51
  * to its ends. `Enter` on the panes divider shuts the lead pane, and pressed
39
52
  * again it opens the pane where it was. `Enter` on the panel divider shuts the
@@ -170,6 +183,19 @@ export declare class HelixSandbox extends HelixElement {
170
183
  * Height of the panel, in pixels.
171
184
  */
172
185
  panelSize: number;
186
+ /**
187
+ * How long typing rests before the preview runs the new source, in
188
+ * milliseconds, as Sandpack's `recompileDelay` does. The preview reloads its
189
+ * frame on each run, so a word typed runs it once. `0` runs it on every
190
+ * edit.
191
+ */
192
+ previewDelay: number;
193
+ /** The edits waiting out `previewDelay`, the last text of each pane. */
194
+ private readonly edits;
195
+ /** The wait before the edits reach the previews. */
196
+ private readonly resting;
197
+ /** Hands the waiting edits to the previews. */
198
+ private readonly runEdits;
173
199
  /**
174
200
  * The name of the divider between the panes, read by screen readers.
175
201
  * `{pane}` is the lead pane, `source` or `preview`, whose share the
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, formatWords, HelixBeforePanelResizeEvent, HelixBeforeSplitEvent, HelixElement, HelixPanelResizeEvent, HelixSplitEvent, inlineStep, requestChange, requestValue, words, } from '@fusion.dev/helix-core';
7
+ import { auditName, customElement, DelayController, formatWords, HelixBeforePanelResizeEvent, HelixBeforeSplitEvent, HelixElement, HelixPanelResizeEvent, HelixSplitEvent, inlineStep, requestChange, requestValue, words, } from '@fusion.dev/helix-core';
8
8
  import '../../splitter/index.js';
9
9
  import { html, nothing } from 'lit';
10
10
  import { property, state } from 'lit/decorators.js';
@@ -33,6 +33,15 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
33
33
  this.panelCollapsedSize = 0;
34
34
  this.panelLabel = 'Resize panel';
35
35
  this.panelSize = DEFAULT_PANEL;
36
+ this.previewDelay = 300;
37
+ this.edits = new Map();
38
+ this.resting = new DelayController(this, { renders: false });
39
+ this.runEdits = () => {
40
+ for (const [name, value] of this.edits) {
41
+ this.write(name, value, false);
42
+ }
43
+ this.edits.clear();
44
+ };
36
45
  this.separatorLabel = '{pane, select, preview {Resize preview pane} other {Resize source pane}}';
37
46
  this.split = DEFAULT_SPLIT;
38
47
  this.hasPanel = false;
@@ -76,8 +85,15 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
76
85
  return;
77
86
  }
78
87
  queueMicrotask(() => {
79
- if (!event.defaultPrevented) {
80
- this.write(name, value, false);
88
+ if (event.defaultPrevented) {
89
+ return;
90
+ }
91
+ this.edits.set(name, value);
92
+ if (this.previewDelay > 0) {
93
+ this.resting.start(this.previewDelay, this.runEdits);
94
+ }
95
+ else {
96
+ this.runEdits();
81
97
  }
82
98
  });
83
99
  };
@@ -378,6 +394,12 @@ let HelixSandbox = class HelixSandbox extends HelixElement {
378
394
  if (changed.has('files') || changed.has('file')) {
379
395
  this.showFile();
380
396
  }
397
+ if (this.files.length > 0) {
398
+ auditName(this, () => {
399
+ const tabs = [...this.renderRoot.querySelectorAll('[part="file"]')];
400
+ return tabs.find((tab) => !tab.textContent?.trim()) ?? tabs[0];
401
+ }, 'Give each source pane a `label` or a `name`, which its file tab shows.');
402
+ }
381
403
  }
382
404
  renderPane(name, at) {
383
405
  const slot = html `<slot name=${name} @slotchange=${this.seed}></slot>`;
@@ -450,6 +472,9 @@ __decorate([
450
472
  __decorate([
451
473
  property({ attribute: 'panel-size', type: Number })
452
474
  ], HelixSandbox.prototype, "panelSize", void 0);
475
+ __decorate([
476
+ property({ attribute: 'preview-delay', type: Number })
477
+ ], HelixSandbox.prototype, "previewDelay", void 0);
453
478
  __decorate([
454
479
  words,
455
480
  property({ attribute: 'separator-label' })
@@ -59,6 +59,12 @@ export declare class HelixSandboxSource extends HelixElement {
59
59
  * The editable region's name, read by screen readers.
60
60
  */
61
61
  fieldLabel: string;
62
+ /**
63
+ * The editable region's name where the pane has a `label`, so each file's
64
+ * field says which file it holds. `{field}` is `field-label` and `{name}`
65
+ * the pane's `label`.
66
+ */
67
+ fieldNameLabel: string;
62
68
  /**
63
69
  * The field's description, read by screen readers while Tab indents.
64
70
  */
@@ -4,7 +4,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
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
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
- import { customElement, HelixBeforeEditEvent, HelixCaretEvent, HelixEditEvent, HelixElement, onUnlessFalse, restoreValue, words, } from '@fusion.dev/helix-core';
7
+ import { customElement, formatWords, HelixBeforeEditEvent, HelixCaretEvent, HelixEditEvent, HelixElement, onUnlessFalse, restoreValue, words, } from '@fusion.dev/helix-core';
8
8
  import { html, nothing } from 'lit';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { drawnRuns } from '../tokens.js';
@@ -14,6 +14,7 @@ let HelixSandboxSource = class HelixSandboxSource extends HelixElement {
14
14
  constructor() {
15
15
  super(...arguments);
16
16
  this.fieldLabel = 'Example source';
17
+ this.fieldNameLabel = '{field}, {name}';
17
18
  this.keysDescription = 'Tab inserts two spaces. To leave, press Escape and then Tab, or press Shift+Tab to go back.';
18
19
  this.label = '';
19
20
  this.name = 'html';
@@ -94,7 +95,9 @@ let HelixSandboxSource = class HelixSandboxSource extends HelixElement {
94
95
  renderField() {
95
96
  return html `<textarea
96
97
  part="source"
97
- aria-label=${this.fieldLabel}
98
+ aria-label=${this.label
99
+ ? formatWords(this, 'fieldNameLabel', { field: this.fieldLabel, name: this.label })
100
+ : this.fieldLabel}
98
101
  aria-describedby=${this.tabIndents ? 'keys' : nothing}
99
102
  spellcheck="false"
100
103
  .value=${this.value}
@@ -112,6 +115,10 @@ __decorate([
112
115
  words,
113
116
  property({ attribute: 'field-label' })
114
117
  ], HelixSandboxSource.prototype, "fieldLabel", void 0);
118
+ __decorate([
119
+ words,
120
+ property({ attribute: 'field-name-label' })
121
+ ], HelixSandboxSource.prototype, "fieldNameLabel", void 0);
115
122
  __decorate([
116
123
  words,
117
124
  property({ attribute: 'keys-description' })
@@ -0,0 +1 @@
1
+ export * from './tag-root.js';
@@ -0,0 +1 @@
1
+ export * from './tag-root.js';
@@ -1,4 +1,4 @@
1
- import { HelixHeadlessTag } from '@fusion.dev/helix-headless/tag';
1
+ import { HelixHeadlessTag } from '@fusion.dev/helix-headless/tag/root';
2
2
  import type { CSSResultGroup } from 'lit';
3
3
  /**
4
4
  * @summary A short label that adds metadata to content.
@@ -5,7 +5,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
- import { HelixHeadlessTag } from '@fusion.dev/helix-headless/tag';
8
+ import { HelixHeadlessTag } from '@fusion.dev/helix-headless/tag/root';
9
9
  import { property } from 'lit/decorators.js';
10
10
  import { styles } from './tag-root.css.js';
11
11
  let HelixTag = class HelixTag extends HelixHeadlessTag {
@@ -1,6 +1,6 @@
1
1
  import { HelixHeadlessTimeInput } from '@fusion.dev/helix-headless/time-input';
2
2
  import type { CSSResultGroup } from 'lit';
3
- import '../../tag/index.js';
3
+ import '../../tag/root/index.js';
4
4
  import '../../time-picker/index.js';
5
5
  /**
6
6
  * @summary A field for a time, typed or picked from a list.
@@ -6,7 +6,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessTimeInput } from '@fusion.dev/helix-headless/time-input';
9
- import '../../tag/index.js';
9
+ import '../../tag/root/index.js';
10
10
  import '../../time-picker/index.js';
11
11
  import { styles as fieldStyles } from '../../shared/field/field.css.js';
12
12
  import { styles as fieldFrameStyles } from '../../shared/field/field-frame.css.js';
@@ -1,7 +1,7 @@
1
1
  import { HelixHeadlessTimePicker } from '@fusion.dev/helix-headless/time-picker';
2
2
  import type { CSSResultGroup } from 'lit';
3
3
  import '../../listbox/index.js';
4
- import '../../option/index.js';
4
+ import '../../option/root/index.js';
5
5
  /**
6
6
  * @summary A control for choosing a time from a list or from wheels.
7
7
  *
@@ -7,7 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  import { customElement } from '@fusion.dev/helix-core';
8
8
  import { HelixHeadlessTimePicker } from '@fusion.dev/helix-headless/time-picker';
9
9
  import '../../listbox/index.js';
10
- import '../../option/index.js';
10
+ import '../../option/root/index.js';
11
11
  import { styles } from './time-picker-root.css.js';
12
12
  let HelixTimePicker = class HelixTimePicker extends HelixHeadlessTimePicker {
13
13
  static { this.tier = 'helix-'; }