@fusion.dev/helix-core 0.246.0 → 0.247.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.
Files changed (35) hide show
  1. package/custom-elements.json +1 -1
  2. package/dist/controllers/chart-pointer-controller/chart-pointer-controller.d.ts +20 -0
  3. package/dist/controllers/chart-pointer-controller/chart-pointer-controller.js +23 -3
  4. package/dist/controllers/drag-dismiss-controller/drag-dismiss-controller.d.ts +170 -0
  5. package/dist/controllers/drag-dismiss-controller/drag-dismiss-controller.js +215 -0
  6. package/dist/controllers/focus-mark-controller/focus-mark-controller.d.ts +58 -0
  7. package/dist/controllers/focus-mark-controller/focus-mark-controller.js +76 -0
  8. package/dist/controllers/hover-mark-controller/hover-mark-controller.d.ts +21 -3
  9. package/dist/controllers/hover-mark-controller/hover-mark-controller.js +31 -15
  10. package/dist/controllers/indicator-controller/indicator-controller.js +1 -1
  11. package/dist/controllers/layout-motion-controller/layout-motion-controller.d.ts +6 -0
  12. package/dist/controllers/layout-motion-controller/layout-motion-controller.js +1 -1
  13. package/dist/controllers/source-controller/source-controller.d.ts +7 -0
  14. package/dist/controllers/source-controller/source-controller.js +2 -0
  15. package/dist/controllers/swipe-controller/swipe-controller.d.ts +19 -3
  16. package/dist/controllers/swipe-controller/swipe-controller.js +32 -10
  17. package/dist/helix-element/mark-rules.d.ts +14 -0
  18. package/dist/helix-element/mark-rules.js +1 -0
  19. package/dist/index.d.ts +7 -1
  20. package/dist/index.js +7 -1
  21. package/dist/utils/burst-confetti/burst-confetti.d.ts +39 -0
  22. package/dist/utils/burst-confetti/burst-confetti.js +251 -0
  23. package/dist/utils/draw-value-axis/draw-value-axis.d.ts +8 -1
  24. package/dist/utils/draw-value-axis/draw-value-axis.js +11 -5
  25. package/dist/utils/flash-change/flash-change.d.ts +55 -0
  26. package/dist/utils/flash-change/flash-change.js +85 -0
  27. package/dist/utils/resize-from/resize-from.d.ts +36 -0
  28. package/dist/utils/resize-from/resize-from.js +37 -0
  29. package/dist/utils/scale/levels.d.ts +57 -0
  30. package/dist/utils/scale/levels.js +19 -0
  31. package/dist/utils/swipe/swipe.d.ts +52 -0
  32. package/dist/utils/swipe/swipe.js +78 -0
  33. package/dist/version.d.ts +1 -1
  34. package/dist/version.js +1 -1
  35. package/package.json +4 -4
@@ -7,7 +7,7 @@ export class HoverMarkController {
7
7
  return;
8
8
  }
9
9
  const under = event.composedPath();
10
- const item = this.options.item(under);
10
+ const item = this.options.item?.(under);
11
11
  if (item === this.hovered) {
12
12
  return;
13
13
  }
@@ -18,18 +18,7 @@ export class HoverMarkController {
18
18
  }
19
19
  return;
20
20
  }
21
- const arriving = this.hovered === undefined;
22
- this.hovered = item;
23
- this.placer.place();
24
- if (!arriving) {
25
- return;
26
- }
27
- this.options.gliding(true);
28
- cancelAnimationFrame(this.frame);
29
- this.frame = requestAnimationFrame(() => {
30
- this.frame = 0;
31
- this.options.mark()?.toggleAttribute('data-gliding', this.hovered !== undefined);
32
- });
21
+ this.move(item);
33
22
  };
34
23
  this.leave = () => {
35
24
  cancelAnimationFrame(this.frame);
@@ -53,12 +42,39 @@ export class HoverMarkController {
53
42
  host.addController(this);
54
43
  }
55
44
  hostConnected() {
56
- this.host.addEventListener('pointerover', this.over);
57
- this.host.addEventListener('pointerleave', this.leave);
45
+ if (this.options.item) {
46
+ this.host.addEventListener('pointerover', this.over);
47
+ this.host.addEventListener('pointerleave', this.leave);
48
+ }
58
49
  }
59
50
  hostDisconnected() {
60
51
  this.host.removeEventListener('pointerover', this.over);
61
52
  this.host.removeEventListener('pointerleave', this.leave);
62
53
  this.leave();
63
54
  }
55
+ show(item) {
56
+ if (item) {
57
+ this.move(item);
58
+ }
59
+ else {
60
+ this.leave();
61
+ }
62
+ }
63
+ move(item) {
64
+ if (item === this.hovered) {
65
+ return;
66
+ }
67
+ const arriving = this.hovered === undefined;
68
+ this.hovered = item;
69
+ this.placer.place();
70
+ if (!arriving) {
71
+ return;
72
+ }
73
+ this.options.gliding(true);
74
+ cancelAnimationFrame(this.frame);
75
+ this.frame = requestAnimationFrame(() => {
76
+ this.frame = 0;
77
+ this.options.mark()?.toggleAttribute('data-gliding', this.hovered !== undefined);
78
+ });
79
+ }
64
80
  }
@@ -81,7 +81,7 @@ export class IndicatorController {
81
81
  ? (own.right - box.right) / sx - surface.clientLeft
82
82
  : (box.left - own.left) / sx - surface.clientLeft;
83
83
  const x = `${rtl ? -inline : inline}px`;
84
- const y = `${(box.top - own.top) / sy - surface.clientTop}px`;
84
+ const y = `${(box.top - own.top) / sy - surface.clientTop + surface.scrollTop}px`;
85
85
  const moved = this.last !== undefined && (this.last.x !== x || this.last.y !== y);
86
86
  this.last = { x, y };
87
87
  indicator.style.setProperty('--indicator-x', x);
@@ -50,6 +50,12 @@ export interface LayoutMotionOptions {
50
50
  */
51
51
  arriveIntoEmpty?: boolean;
52
52
  }
53
+ /**
54
+ * The boxes an element is drawn in: the element itself, or where it is
55
+ * `display: contents`, as a table's row is, the boxes of what it draws, through
56
+ * its shadow root and its slots. A row of cells moves as its cells.
57
+ */
58
+ export declare const boxesOf: (element: Element) => HTMLElement[];
53
59
  /**
54
60
  * Moves each item from where it was drawn to where it is drawn after a change,
55
61
  * so a row that is added, sorted, hidden or closed up slides into its place
@@ -11,7 +11,7 @@ const scaleOf = (host, box) => {
11
11
  const along = (drawn, laid) => laid > 0 && Math.abs(drawn - laid) > 1 ? drawn / laid : 1;
12
12
  return { x: along(box.width, host.offsetWidth), y: along(box.height, host.offsetHeight) };
13
13
  };
14
- const boxesOf = (element) => {
14
+ export const boxesOf = (element) => {
15
15
  if (getComputedStyle(element).display !== 'contents') {
16
16
  return element instanceof HTMLElement ? [element] : [];
17
17
  }
@@ -36,6 +36,13 @@ export interface SourceHost extends ReactiveControllerHost, HTMLElement {
36
36
  * renaming a series edits a text node in place rather than replacing a cell,
37
37
  * and nothing in a page has reason to know a chart is reading it.
38
38
  *
39
+ * **And for the attributes the readers take a reading from**, which are
40
+ * `READ_ATTRIBUTES`. A cell's `data-value` is its number wherever it is set,
41
+ * and its text is only the words a reader sees, so an edit that changes the
42
+ * number changes the attribute. Watched for text alone, every chart kept
43
+ * drawing the old number after an edit to `data-value`, and a heatmap kept the
44
+ * old tone after an edit to `data-tone`.
45
+ *
39
46
  * **The tree around it is watched as well, for the table that is not there
40
47
  * yet.** A framework page renders a chart first and its table once the data
41
48
  * loads, or re-keys the table and so replaces it under the same id. Watching
@@ -6,6 +6,7 @@ import { wordsLocale } from '../../words/words-locale.js';
6
6
  const HIDDEN = new WeakMap();
7
7
  const READERS = new WeakMap();
8
8
  const NONE = new Set();
9
+ const READ_ATTRIBUTES = ['data-tone', 'data-value', 'datetime', 'label', 'role'];
9
10
  export class SourceController {
10
11
  constructor(host) {
11
12
  this.watched = null;
@@ -158,6 +159,7 @@ export class SourceController {
158
159
  this.host.requestUpdate();
159
160
  });
160
161
  this.observer.observe(element, {
162
+ attributeFilter: READ_ATTRIBUTES,
161
163
  characterData: true,
162
164
  childList: true,
163
165
  subtree: true,
@@ -3,9 +3,23 @@ import type { SwipeAxis } from '../../utils/swipe/swipe.js';
3
3
  export interface SwipeOptions {
4
4
  /** The axis a swipe is read along, or `undefined` while swiping is off. */
5
5
  axis: () => SwipeAxis | undefined;
6
+ /**
7
+ * Called when the browser takes a swipe over for a scroll of its own. Where
8
+ * it is not given, `end` is called with nothing moved, which puts a host that
9
+ * reads distance back where it began.
10
+ */
11
+ cancel?: () => void;
12
+ /**
13
+ * Whether the surface takes the pointer once a press becomes a swipe, so
14
+ * every move and the release come to it wherever the pointer goes. The
15
+ * capture is let go at the release and on a cancel.
16
+ */
17
+ capture?: boolean;
6
18
  /**
7
19
  * Called on the release, with how far the pointer went and how fast it was
8
- * going, in pixels per millisecond, on each axis.
20
+ * going, in pixels per millisecond, on each axis, over its last 100
21
+ * milliseconds. A pointer that stood still for that long before it lifted
22
+ * was going nowhere.
9
23
  */
10
24
  end: (dx: number, dy: number, vx: number, vy: number) => void;
11
25
  /** Called as the pointer moves, with how far it has gone from the press. */
@@ -51,8 +65,10 @@ export declare class SwipeController implements ReactiveController {
51
65
  private readonly options;
52
66
  /** Where the press began, while one is down. */
53
67
  private origin;
54
- /** The last two readings, for the speed. */
68
+ /** The readings of the last `RECENT` milliseconds, for the speed. */
55
69
  private samples;
70
+ /** The surface holding the pointer, where `capture` asked it to take it. */
71
+ private captured;
56
72
  /** Whether the press has become a swipe. */
57
73
  private swiping;
58
74
  /** The pointer being followed. */
@@ -65,6 +81,6 @@ export declare class SwipeController implements ReactiveController {
65
81
  private readonly handleUp;
66
82
  /** A swipe the browser took over, for a scroll of its own, goes back to where it began. */
67
83
  private readonly handleCancel;
68
- /** Forgets the press and stops listening for it. */
84
+ /** Forgets the press, lets go of the pointer, and stops listening for it. */
69
85
  private stop;
70
86
  }
@@ -1,4 +1,5 @@
1
1
  const SLOP = 8;
2
+ const RECENT = 100;
2
3
  export class SwipeController {
3
4
  constructor(host, options) {
4
5
  this.samples = [];
@@ -42,12 +43,20 @@ export class SwipeController {
42
43
  return;
43
44
  }
44
45
  this.swiping = true;
45
- this.options.surface()?.setAttribute('data-swiping', '');
46
+ const surface = this.options.surface();
47
+ surface?.setAttribute('data-swiping', '');
48
+ if (this.options.capture && surface) {
49
+ try {
50
+ surface.setPointerCapture(event.pointerId);
51
+ this.captured = surface;
52
+ }
53
+ catch {
54
+ this.captured = undefined;
55
+ }
56
+ }
46
57
  }
47
- this.samples = [
48
- ...this.samples.slice(-1),
49
- { t: event.timeStamp, x: event.clientX, y: event.clientY },
50
- ];
58
+ const at = { t: event.timeStamp, x: event.clientX, y: event.clientY };
59
+ this.samples = [...this.samples.filter((one) => at.t - one.t <= RECENT), at];
51
60
  this.options.move(dx, dy);
52
61
  };
53
62
  this.handleUp = (event) => {
@@ -56,10 +65,11 @@ export class SwipeController {
56
65
  return;
57
66
  }
58
67
  const swiped = this.swiping;
59
- const [before, last] = [this.samples[0], this.samples[this.samples.length - 1]];
60
- const elapsed = before && last ? last.t - before.t : 0;
61
- const vx = before && last && elapsed > 0 ? (last.x - before.x) / elapsed : 0;
62
- const vy = before && last && elapsed > 0 ? (last.y - before.y) / elapsed : 0;
68
+ const at = { t: event.timeStamp, x: event.clientX, y: event.clientY };
69
+ const first = [...this.samples, at].find((one) => at.t - one.t <= RECENT);
70
+ const elapsed = first ? at.t - first.t : 0;
71
+ const vx = first && elapsed > 0 ? (at.x - first.x) / elapsed : 0;
72
+ const vy = first && elapsed > 0 ? (at.y - first.y) / elapsed : 0;
63
73
  this.stop();
64
74
  if (!swiped) {
65
75
  return;
@@ -74,7 +84,13 @@ export class SwipeController {
74
84
  }
75
85
  const swiped = this.swiping;
76
86
  this.stop();
77
- if (swiped) {
87
+ if (!swiped) {
88
+ return;
89
+ }
90
+ if (this.options.cancel) {
91
+ this.options.cancel();
92
+ }
93
+ else {
78
94
  this.options.end(0, 0, 0, 0);
79
95
  }
80
96
  };
@@ -93,6 +109,12 @@ export class SwipeController {
93
109
  window.removeEventListener('pointermove', this.handleMove);
94
110
  window.removeEventListener('pointerup', this.handleUp);
95
111
  window.removeEventListener('pointercancel', this.handleCancel);
112
+ const captured = this.captured;
113
+ const pointer = this.pointer;
114
+ this.captured = undefined;
115
+ if (captured && pointer !== undefined && captured.hasPointerCapture?.(pointer)) {
116
+ captured.releasePointerCapture(pointer);
117
+ }
96
118
  this.options.surface()?.removeAttribute('data-swiping');
97
119
  this.origin = undefined;
98
120
  this.pointer = undefined;
@@ -175,3 +175,17 @@ export declare const SHUT_RULE = "[data-shut]{rotate:-90deg}:host(:dir(rtl)) [da
175
175
  * leaves the page its scroll.
176
176
  */
177
177
  export declare const TOUCHES_RULE = "[data-touches]{touch-action:none}";
178
+ /**
179
+ * Keeps the page's pan off the axis a surface is dragged along, and leaves it
180
+ * the other one.
181
+ *
182
+ * **A drag the browser reads as a pan is the browser's**, as for
183
+ * `TOUCHES_RULE`: it scrolls and sends `pointercancel`, so a drawer or a
184
+ * message dragged toward its edge would stop under the finger. A surface
185
+ * dragged across keeps the vertical pan for the page, and one dragged up or
186
+ * down the horizontal. `DragDismissController` marks the surface
187
+ * `data-drags="x"` or `data-drags="y"` while it can be dragged, and takes the
188
+ * mark off while it cannot, such as a closed drawer or one with
189
+ * `swipe="false"`.
190
+ */
191
+ export declare const DRAGS_RULE = "[data-drags=x]{touch-action:pan-y}[data-drags=y]{touch-action:pan-x}";
@@ -11,3 +11,4 @@ export const SPOKEN_RULE = '[data-spoken]{position:absolute;inline-size:1px;bloc
11
11
  export const MIRROR_RULE = ':host(:dir(rtl)) [data-mirror]{scale:-1 1}';
12
12
  export const SHUT_RULE = '[data-shut]{rotate:-90deg}:host(:dir(rtl)) [data-shut]{rotate:90deg}';
13
13
  export const TOUCHES_RULE = '[data-touches]{touch-action:none}';
14
+ export const DRAGS_RULE = '[data-drags=x]{touch-action:pan-y}[data-drags=y]{touch-action:pan-x}';
package/dist/index.d.ts CHANGED
@@ -16,8 +16,10 @@ export { activeCue, adoptTrack, type Caption, CueController, captionsAmong, capt
16
16
  export { DelayController, type DelayOptions, } from './controllers/delay-controller/delay-controller.js';
17
17
  export { DisabledCascadeController, type DisabledCascadeOptions, } from './controllers/disabled-cascade-controller/disabled-cascade-controller.js';
18
18
  export { DismissController, type DismissOptions, } from './controllers/dismiss-controller/dismiss-controller.js';
19
+ export { type DragBounds, DragDismissController, type DragDismissOptions, type DragRelease, } from './controllers/drag-dismiss-controller/drag-dismiss-controller.js';
19
20
  export { DrilldownController, type DrilldownOptions, } from './controllers/drilldown-controller/drilldown-controller.js';
20
21
  export { FloatingController, type FloatingOptions, type Placement, type Side, } from './controllers/floating-controller/floating-controller.js';
22
+ export { FocusMarkController, type FocusMarkOptions, } from './controllers/focus-mark-controller/focus-mark-controller.js';
21
23
  export { controlsIn, FocusScopeController, type FocusScopeOptions, } from './controllers/focus-scope-controller/focus-scope-controller.js';
22
24
  export { FullscreenController } from './controllers/fullscreen-controller/fullscreen-controller.js';
23
25
  export { HostClickController } from './controllers/host-click-controller/host-click-controller.js';
@@ -51,7 +53,7 @@ export { eventsForTag, registerElementEvents } from './events/element-events.js'
51
53
  export { type ActivateDetail, type ChangeDetail, type CheckDetail, type CompleteDetail, type CopyDetail, type DismissDetail, type FilterDetail, type FoundDetail, HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeChangeEvent, HelixBeforeCheckEvent, HelixBeforeCloseEvent, HelixBeforeFilterEvent, HelixBeforeListenEvent, HelixBeforeNavigateEvent, HelixBeforeOpenEvent, HelixBeforePinEvent, HelixBeforeReorderEvent, HelixBeforeResizeEvent, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixCheckEvent, HelixClearEvent, HelixCompleteEvent, HelixCopyErrorEvent, HelixCopyEvent, HelixDismissEvent, HelixExpandEvent, HelixFilterEvent, HelixFoundEvent, HelixListenEvent, HelixLoadEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixPinEvent, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, HelixReorderEvent, HelixResizedEvent, HelixResizeEvent, HelixSelectEvent, HelixSortEvent, type ListenDetail, type NavigateDetail, type OpenDetail, type PlotChangeDetail, type PlotTurnDetail, type PressPointerType, type ReadingDetail, type ReorderDetail, type ResizeDetail, type SelectDetail, type SortDetail, type ViewportPanDetail, type ViewportZoomDetail, } from './events/events.js';
52
54
  export { helixEventNames, registerEventNames } from './events/names.js';
53
55
  export { HelixElement, internalsOf, whenHydrated } from './helix-element/helix-element.js';
54
- export { LAYERS_RULE, MIRROR_RULE, SCROLLER_RULE, SHUT_RULE, SPOKEN_RULE, TOUCHES_RULE, VIRTUAL_RULE, } from './helix-element/mark-rules.js';
56
+ export { DRAGS_RULE, LAYERS_RULE, MIRROR_RULE, SCROLLER_RULE, SHUT_RULE, SPOKEN_RULE, TOUCHES_RULE, VIRTUAL_RULE, } from './helix-element/mark-rules.js';
55
57
  export { untilReactHydrated } from './helix-element/react-bridge.js';
56
58
  export { HelixFormElement } from './helix-form-element/helix-form-element.js';
57
59
  export { HelixFormElementBase } from './helix-form-element/helix-form-element-base.js';
@@ -78,6 +80,7 @@ export { arrowReach, sideOf } from './utils/arrow/arrow.js';
78
80
  export { assignSlot, assignSlots } from './utils/assign-slots/assign-slots.js';
79
81
  export { type DrawAutofillOptions, drawAutofill, } from './utils/autofill-select/autofill-select.js';
80
82
  export { type BoxAxisText, type BoxLabel, type BoxLabelSizes, type BoxPlace, boxLabels, type SeenPlace, } from './utils/box-labels/box-labels.js';
83
+ export { type BurstConfettiOptions, burstConfetti } from './utils/burst-confetti/burst-confetti.js';
81
84
  export { addDays, addMonths, type Barring, barredBy, type CalendarParts, type CalendarView, calendarLocale, type DateCalendar, localToday, MONTH_CALENDARS, type MonthCalendar, type MonthSystem, monthOf, monthOut, monthSystem, type PeriodCell, type PeriodPage, periodCells, periodKey, periodMove, sameMonth, todayIn, weekendOf, weekStartOf, YEARS_SHOWN, yearOut, yearPageOf, } from './utils/calendar/calendar.js';
82
85
  export { capturePointer } from './utils/capture-pointer/capture-pointer.js';
83
86
  export { type AxisLengths, type Category, type PlacedLabel, placeLabels, UNMEASURED_LABELS, } from './utils/category-labels/category-labels.js';
@@ -113,6 +116,7 @@ export { exportParts } from './utils/export-parts/export-parts.js';
113
116
  export { fillTemplate, labelWith } from './utils/fill-template/fill-template.js';
114
117
  export { FILTER_MARK, filterKeeps, markMatches, rangeOf, } from './utils/filter-marks/filter-marks.js';
115
118
  export { FIND_CURRENT, FIND_MATCH, type FindDirection, type Finder, type FindQuery, type FindResult, findPattern, findRanges, findTextRanges, type TextFinderOptions, textFinder, } from './utils/find-text/find-text.js';
119
+ export { type FlashChangeOptions, flashChange } from './utils/flash-change/flash-change.js';
116
120
  export { focusTarget } from './utils/focus-target/focus-target.js';
117
121
  export { autofocusTarget, deepActiveElement, deepContains, focusAs, focusableElements, openingFocus, PRESSABLE, pressedOwnControl, refocusWithin, } from './utils/focusable-elements/focusable-elements.js';
118
122
  export { afterLinkFollowed, followLink, type LinkModifiers, type LinkTarget, } from './utils/follow-link/follow-link.js';
@@ -162,11 +166,13 @@ export { RUNTIME_LOG, RUNTIME_SLOT, type RuntimeEvent, type RuntimeKind, reportR
162
166
  export { noteVersion, reportUsage, USAGE_SLOT, VERSIONS_SLOT, } from './utils/report-usage/report-usage.js';
163
167
  export { type ReportValuesOptions, reportValues } from './utils/report-values/report-values.js';
164
168
  export { type ChangeRequestOptions, requestChange, requestValue, } from './utils/request-change/request-change.js';
169
+ export { type ResizeFromOptions, resizeFrom } from './utils/resize-from/resize-from.js';
165
170
  export { type ActivatableItem, resolveActiveItem, } from './utils/resolve-active-item/resolve-active-item.js';
166
171
  export { holdCaret, restoreValue } from './utils/restore-value/restore-value.js';
167
172
  export { type RovingOptions, rovingStop } from './utils/roving-stop/roving-stop.js';
168
173
  export { valueAt } from './utils/row-data/row-data.js';
169
174
  export { type Arranged, type Axis, arranged, cycle, type DataRow, filter, format, type Ordered, ordered, parse, type Sort, sort, window_, } from './utils/row-order/row-order.js';
175
+ export { heldInside, type Level, levelsOf, ScaleMemory, } from './utils/scale/levels.js';
170
176
  export { extent, linear, type Scale } from './utils/scale/scale.js';
171
177
  export { headroom, ticks } from './utils/scale/ticks.js';
172
178
  export { type ScrollerOptions, type ScrollItemOptions, type ScrollRoomOptions, scrollItemIntoView, scrollingAncestor, scrollRoom, scrollWithin, } from './utils/scroll-item-into-view/scroll-item-into-view.js';
package/dist/index.js CHANGED
@@ -16,8 +16,10 @@ export { activeCue, adoptTrack, CueController, captionsAmong, captionTracks, sho
16
16
  export { DelayController, } from './controllers/delay-controller/delay-controller.js';
17
17
  export { DisabledCascadeController, } from './controllers/disabled-cascade-controller/disabled-cascade-controller.js';
18
18
  export { DismissController, } from './controllers/dismiss-controller/dismiss-controller.js';
19
+ export { DragDismissController, } from './controllers/drag-dismiss-controller/drag-dismiss-controller.js';
19
20
  export { DrilldownController, } from './controllers/drilldown-controller/drilldown-controller.js';
20
21
  export { FloatingController, } from './controllers/floating-controller/floating-controller.js';
22
+ export { FocusMarkController, } from './controllers/focus-mark-controller/focus-mark-controller.js';
21
23
  export { controlsIn, FocusScopeController, } from './controllers/focus-scope-controller/focus-scope-controller.js';
22
24
  export { FullscreenController } from './controllers/fullscreen-controller/fullscreen-controller.js';
23
25
  export { HostClickController } from './controllers/host-click-controller/host-click-controller.js';
@@ -51,7 +53,7 @@ export { eventsForTag, registerElementEvents } from './events/element-events.js'
51
53
  export { HelixActivateEvent, HelixBeforeActivateEvent, HelixBeforeChangeEvent, HelixBeforeCheckEvent, HelixBeforeCloseEvent, HelixBeforeFilterEvent, HelixBeforeListenEvent, HelixBeforeNavigateEvent, HelixBeforeOpenEvent, HelixBeforePinEvent, HelixBeforeReorderEvent, HelixBeforeResizeEvent, HelixBeforeSelectEvent, HelixBeforeSortEvent, HelixCheckEvent, HelixClearEvent, HelixCompleteEvent, HelixCopyErrorEvent, HelixCopyEvent, HelixDismissEvent, HelixExpandEvent, HelixFilterEvent, HelixFoundEvent, HelixListenEvent, HelixLoadEvent, HelixLoadMoreEvent, HelixNavigateEvent, HelixPinEvent, HelixPlotChangeEvent, HelixPlotTurnEvent, HelixReadingChangeEvent, HelixReadingPressEvent, HelixReorderEvent, HelixResizedEvent, HelixResizeEvent, HelixSelectEvent, HelixSortEvent, } from './events/events.js';
52
54
  export { helixEventNames, registerEventNames } from './events/names.js';
53
55
  export { HelixElement, internalsOf, whenHydrated } from './helix-element/helix-element.js';
54
- export { LAYERS_RULE, MIRROR_RULE, SCROLLER_RULE, SHUT_RULE, SPOKEN_RULE, TOUCHES_RULE, VIRTUAL_RULE, } from './helix-element/mark-rules.js';
56
+ export { DRAGS_RULE, LAYERS_RULE, MIRROR_RULE, SCROLLER_RULE, SHUT_RULE, SPOKEN_RULE, TOUCHES_RULE, VIRTUAL_RULE, } from './helix-element/mark-rules.js';
55
57
  export { untilReactHydrated } from './helix-element/react-bridge.js';
56
58
  export { HelixFormElement } from './helix-form-element/helix-form-element.js';
57
59
  export { HelixFormElementBase } from './helix-form-element/helix-form-element-base.js';
@@ -78,6 +80,7 @@ export { arrowReach, sideOf } from './utils/arrow/arrow.js';
78
80
  export { assignSlot, assignSlots } from './utils/assign-slots/assign-slots.js';
79
81
  export { drawAutofill, } from './utils/autofill-select/autofill-select.js';
80
82
  export { boxLabels, } from './utils/box-labels/box-labels.js';
83
+ export { burstConfetti } from './utils/burst-confetti/burst-confetti.js';
81
84
  export { addDays, addMonths, barredBy, calendarLocale, localToday, MONTH_CALENDARS, monthOf, monthOut, monthSystem, periodCells, periodKey, periodMove, sameMonth, todayIn, weekendOf, weekStartOf, YEARS_SHOWN, yearOut, yearPageOf, } from './utils/calendar/calendar.js';
82
85
  export { capturePointer } from './utils/capture-pointer/capture-pointer.js';
83
86
  export { placeLabels, UNMEASURED_LABELS, } from './utils/category-labels/category-labels.js';
@@ -113,6 +116,7 @@ export { exportParts } from './utils/export-parts/export-parts.js';
113
116
  export { fillTemplate, labelWith } from './utils/fill-template/fill-template.js';
114
117
  export { FILTER_MARK, filterKeeps, markMatches, rangeOf, } from './utils/filter-marks/filter-marks.js';
115
118
  export { FIND_CURRENT, FIND_MATCH, findPattern, findRanges, findTextRanges, textFinder, } from './utils/find-text/find-text.js';
119
+ export { flashChange } from './utils/flash-change/flash-change.js';
116
120
  export { focusTarget } from './utils/focus-target/focus-target.js';
117
121
  export { autofocusTarget, deepActiveElement, deepContains, focusAs, focusableElements, openingFocus, PRESSABLE, pressedOwnControl, refocusWithin, } from './utils/focusable-elements/focusable-elements.js';
118
122
  export { afterLinkFollowed, followLink, } from './utils/follow-link/follow-link.js';
@@ -162,11 +166,13 @@ export { RUNTIME_LOG, RUNTIME_SLOT, reportRuntime, } from './utils/report-runtim
162
166
  export { noteVersion, reportUsage, USAGE_SLOT, VERSIONS_SLOT, } from './utils/report-usage/report-usage.js';
163
167
  export { reportValues } from './utils/report-values/report-values.js';
164
168
  export { requestChange, requestValue, } from './utils/request-change/request-change.js';
169
+ export { resizeFrom } from './utils/resize-from/resize-from.js';
165
170
  export { resolveActiveItem, } from './utils/resolve-active-item/resolve-active-item.js';
166
171
  export { holdCaret, restoreValue } from './utils/restore-value/restore-value.js';
167
172
  export { rovingStop } from './utils/roving-stop/roving-stop.js';
168
173
  export { valueAt } from './utils/row-data/row-data.js';
169
174
  export { arranged, cycle, filter, format, ordered, parse, sort, window_, } from './utils/row-order/row-order.js';
175
+ export { heldInside, levelsOf, ScaleMemory, } from './utils/scale/levels.js';
170
176
  export { extent, linear } from './utils/scale/scale.js';
171
177
  export { headroom, ticks } from './utils/scale/ticks.js';
172
178
  export { scrollItemIntoView, scrollingAncestor, scrollRoom, scrollWithin, } from './utils/scroll-item-into-view/scroll-item-into-view.js';
@@ -0,0 +1,39 @@
1
+ /** How `burstConfetti` bursts. */
2
+ export interface BurstConfettiOptions {
3
+ /**
4
+ * The colors of the pieces, as any CSS colors, such as `#e5677d`,
5
+ * `var(--brand)`, or `light-dark(navy, skyblue)`, each read where the origin
6
+ * is. Defaults to the theme's first six series colors,
7
+ * `--helix-color-series-1` to `--helix-color-series-6`.
8
+ */
9
+ colors?: readonly string[] | undefined;
10
+ /** How many pieces burst. Defaults to 80, and at most 400 are drawn. */
11
+ count?: number | undefined;
12
+ }
13
+ /**
14
+ * Bursts confetti up and out of an element, once, for an action that has
15
+ * finished, such as a reader completing onboarding or publishing a page.
16
+ * Resolves once the last piece is gone, about a second and a half later.
17
+ *
18
+ * ```js
19
+ * import { burstConfetti } from '@fusion.dev/helix-core'
20
+ *
21
+ * await publish()
22
+ * burstConfetti(document.querySelector('#publish'))
23
+ * ```
24
+ *
25
+ * **Call it once the action is done.** The press that starts an action can
26
+ * still fail. The pieces fly up from the element, fall, turn, and fade. A
27
+ * second burst while one runs is drawn with it.
28
+ *
29
+ * **Drawn on one canvas over the whole viewport**, which takes no pointer, is
30
+ * hidden from screen readers, and is removed when the last piece is gone. It
31
+ * sits in the top layer where the browser has one, so a burst from inside an
32
+ * open modal `Dialog` is drawn over the dialog.
33
+ *
34
+ * **A burst is decoration**, so say that the action is done in words as well.
35
+ * Nothing is drawn, and the promise resolves at once, for a reader who asked
36
+ * for less motion, while the page's motion is paused, on a server, and while
37
+ * the page is hidden. Pausing the page's motion mid-burst ends it.
38
+ */
39
+ export declare const burstConfetti: (origin: Element, options?: BurstConfettiOptions) => Promise<void>;