@swiftwc/ui 0.0.0-dev.105 → 0.0.0-dev.106

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 (66) hide show
  1. package/generated/client/index.js +6 -7
  2. package/generated/components/alert-dialog.js +9 -10
  3. package/generated/components/body-view.js +3 -3
  4. package/generated/components/bordered-button.js +4 -5
  5. package/generated/components/bordered-prominent-button.js +4 -5
  6. package/generated/components/borderless-button.js +4 -5
  7. package/generated/components/color-scheme.js +4 -4
  8. package/generated/components/confirmation-dialog.js +9 -10
  9. package/generated/components/content-unavailable.js +4 -5
  10. package/generated/components/date-picker.js +13 -14
  11. package/generated/components/detail-placeholder.js +4 -4
  12. package/generated/components/disclosure-group.js +5 -6
  13. package/generated/components/fine-tooltip.js +4 -5
  14. package/generated/components/form-view.js +3 -4
  15. package/generated/components/glass-button.js +4 -5
  16. package/generated/components/glass-prominent-button.js +4 -5
  17. package/generated/components/h-divider.js +4 -4
  18. package/generated/components/h-stack.js +3 -3
  19. package/generated/components/image-view.js +4 -5
  20. package/generated/components/label-view.js +4 -5
  21. package/generated/components/labeled-content.js +4 -5
  22. package/generated/components/list-view.js +3 -4
  23. package/generated/components/menu-view.js +10 -11
  24. package/generated/components/navigation-large-title.js +5 -6
  25. package/generated/components/navigation-split-view.js +4 -4
  26. package/generated/components/navigation-stack.js +4 -4
  27. package/generated/components/navigation-title.js +4 -4
  28. package/generated/components/picker-view.js +31 -32
  29. package/generated/components/plain-button.js +3 -4
  30. package/generated/components/progress-view.js +6 -7
  31. package/generated/components/screen-view.js +2 -2
  32. package/generated/components/scroll-view-proxy.js +3 -3
  33. package/generated/components/scroll-view.js +9 -10
  34. package/generated/components/search-view.js +4 -5
  35. package/generated/components/section-view.js +4 -5
  36. package/generated/components/sheet-view.js +6 -7
  37. package/generated/components/sidebar-toggle.js +5 -6
  38. package/generated/components/sidebar-view.js +2 -3
  39. package/generated/components/sticky-container.js +3 -4
  40. package/generated/components/tab-bar.js +4 -5
  41. package/generated/components/tab-item.js +8 -9
  42. package/generated/components/tab-view.js +7 -8
  43. package/generated/components/table-view.js +6 -7
  44. package/generated/components/text-field.js +10 -11
  45. package/generated/components/text-view.js +4 -4
  46. package/generated/components/toggle-view.js +13 -14
  47. package/generated/components/tool-bar-item-group.js +3 -3
  48. package/generated/components/tool-bar-item.js +4 -5
  49. package/generated/components/tool-bar.js +4 -5
  50. package/generated/components/v-divider.js +4 -4
  51. package/generated/components/v-keyboard.js +5 -6
  52. package/generated/components/v-stack.js +3 -3
  53. package/generated/internal/class/css-style-observer.js +2 -3
  54. package/generated/internal/class/form-associated-base.js +5 -5
  55. package/generated/internal/class/navigation-view.js +3 -4
  56. package/generated/internal/decorators/adaptive-slot.js +4 -5
  57. package/generated/internal/privateNamespace.js +12 -12
  58. package/generated/internal/utils/debug.d.ts +1 -0
  59. package/generated/internal/utils/debug.js +4 -0
  60. package/generated/internal/utils/index.d.ts +2 -2
  61. package/generated/internal/utils/index.js +2 -2
  62. package/generated/internal/utils/is-inside.js +1 -1
  63. package/generated/snapshot/index.js +3 -4
  64. package/package.json +2 -1
  65. package/generated/internal/utils/dev-flags.d.ts +0 -3
  66. package/generated/internal/utils/dev-flags.js +0 -5
@@ -1,10 +1,9 @@
1
1
  var _a;
2
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
3
2
  import { I18n } from '../i18n';
4
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
5
4
  import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
6
5
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
7
- import { $, compareBigDecimals, kebabCase, onoff, set } from '../internal/utils';
6
+ import { $, compareBigDecimals, debug, kebabCase, onoff, set } from '../internal/utils';
8
7
  import { queryMorph } from '../morphdom';
9
8
  import { html } from '../tpl';
10
9
  const keyboardTypes = ['decimal-pad', 'number-pad', 'default'];
@@ -59,7 +58,7 @@ export class TextField extends FormAssociatedBase {
59
58
  </label>`));
60
59
  }
61
60
  #renderValidityMsgs = (entries) => {
62
- DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
61
+ debug(`${_a.name} ⚡️ mutation`);
63
62
  this.setValidity(this.validity, this.validationMessage);
64
63
  };
65
64
  #shadowRoot;
@@ -96,7 +95,7 @@ export class TextField extends FormAssociatedBase {
96
95
  }, I18n.on).on());
97
96
  }
98
97
  attributeChangedCallback(name, oldValue, newValue) {
99
- DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
98
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
100
99
  switch (name) {
101
100
  case 'keyboard-type':
102
101
  switch (newValue) {
@@ -223,7 +222,7 @@ export class TextField extends FormAssociatedBase {
223
222
  }
224
223
  }
225
224
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
226
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
225
+ debug(`${_a.name} ⚡️ ${type}`);
227
226
  if (!(slot instanceof HTMLSlotElement))
228
227
  return;
229
228
  const assigned = slot.assignedElements();
@@ -232,7 +231,7 @@ export class TextField extends FormAssociatedBase {
232
231
  this.#renderValidityMsgs([]);
233
232
  };
234
233
  #handleFocusin = (evt) => {
235
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
234
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
236
235
  if (evt.target === this)
237
236
  this.#input?.focus();
238
237
  };
@@ -263,7 +262,7 @@ export class TextField extends FormAssociatedBase {
263
262
  this.dispatchEvent(new CustomEvent('commit', { detail: { text: this.text }, bubbles: true, composed: true }));
264
263
  };
265
264
  #handleInputPaste = (evt) => {
266
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
265
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
267
266
  const { target: input } = evt;
268
267
  if (!(input instanceof HTMLInputElement))
269
268
  return;
@@ -366,7 +365,7 @@ export class TextField extends FormAssociatedBase {
366
365
  }
367
366
  };
368
367
  #handleInputBeforeinput = (evt) => {
369
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
368
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
370
369
  const { target: input } = evt;
371
370
  if (!(input instanceof HTMLInputElement))
372
371
  return;
@@ -401,7 +400,7 @@ export class TextField extends FormAssociatedBase {
401
400
  }
402
401
  };
403
402
  #handleInputBlur = ({ type, target: input }) => {
404
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
403
+ debug(`${_a.name} ⚡️ ${type}`);
405
404
  if (!(input instanceof HTMLInputElement))
406
405
  return;
407
406
  if (0 === input.value.length)
@@ -412,7 +411,7 @@ export class TextField extends FormAssociatedBase {
412
411
  this.#sendValueToForm();
413
412
  };
414
413
  #handleInputInput = (evt) => {
415
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
414
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
416
415
  this.#sendValueToForm();
417
416
  };
418
417
  /**
@@ -490,7 +489,7 @@ export class TextField extends FormAssociatedBase {
490
489
  message = kebabCase(key);
491
490
  break;
492
491
  }
493
- DEBUG && console.debug(`${_a.name} ⚡️ validity-change`);
492
+ debug(`${_a.name} ⚡️ validity-change`);
494
493
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#input);
495
494
  };
496
495
  setCustomValidity = (message) => {
@@ -1,16 +1,16 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
+ import { debug } from '../internal/utils';
2
2
  export class TextView extends HTMLElement {
3
3
  constructor() {
4
4
  super();
5
5
  }
6
6
  connectedCallback() {
7
- DEBUG && console.debug(`${TextView.name} ⚡️ connect`);
7
+ debug(`${TextView.name} ⚡️ connect`);
8
8
  }
9
9
  disconnectedCallback() {
10
- DEBUG && console.debug(`${TextView.name} ⚡️ disconnect`);
10
+ debug(`${TextView.name} ⚡️ disconnect`);
11
11
  }
12
12
  attributeChangedCallback(name, oldValue, newValue) {
13
- DEBUG && console.debug(`${TextView.name} ⚡️ attr-change [${name}]`);
13
+ debug(`${TextView.name} ⚡️ attr-change [${name}]`);
14
14
  //
15
15
  }
16
16
  }
@@ -1,9 +1,8 @@
1
1
  var _a;
2
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
3
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
3
  import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
5
4
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
6
- import { $, kebabCase, onoff, touchGlass } from '../internal/utils';
5
+ import { $, debug, kebabCase, onoff, touchGlass } from '../internal/utils';
7
6
  import { queryMorph } from '../morphdom';
8
7
  import { html } from '../tpl';
9
8
  const toggleStyles = ['switch', 'button'];
@@ -50,7 +49,7 @@ export class ToggleView extends FormAssociatedBase {
50
49
  </label>`));
51
50
  }
52
51
  #renderValidityMsgs = (entries) => {
53
- DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
52
+ debug(`${_a.name} ⚡️ mutation`);
54
53
  this.setValidity(this.validity, this.validationMessage);
55
54
  };
56
55
  #shadowRoot;
@@ -70,7 +69,7 @@ export class ToggleView extends FormAssociatedBase {
70
69
  return this.#trackWidth - this.#dotSize;
71
70
  }
72
71
  #handleMeasure = ([{ target, borderBoxSize }]) => {
73
- DEBUG && console.debug(`${_a.name} ⚡️ measure`);
72
+ debug(`${_a.name} ⚡️ measure`);
74
73
  if (!(target instanceof HTMLElement))
75
74
  return;
76
75
  this.#trackWidth = borderBoxSize.at(0)?.inlineSize ?? 0;
@@ -109,7 +108,7 @@ export class ToggleView extends FormAssociatedBase {
109
108
  CleanupRegistry.register(this, onoff([{ types: 'blur', listener: this.#handleWindowBlur }], self).on());
110
109
  }
111
110
  attributeChangedCallback(name, oldValue, newValue) {
112
- DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
111
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
113
112
  switch (name) {
114
113
  case 'value':
115
114
  this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
@@ -162,7 +161,7 @@ export class ToggleView extends FormAssociatedBase {
162
161
  this.ariaChecked = `${this.#isOn}`;
163
162
  }
164
163
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
165
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
164
+ debug(`${_a.name} ⚡️ ${type}`);
166
165
  if (!(slot instanceof HTMLSlotElement))
167
166
  return;
168
167
  const assigned = slot.assignedElements();
@@ -170,12 +169,12 @@ export class ToggleView extends FormAssociatedBase {
170
169
  this.#renderValidityMsgs([]);
171
170
  };
172
171
  #handleFocusin = ({ type, target }) => {
173
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
172
+ debug(`${_a.name} ⚡️ ${type}`);
174
173
  if (target === this)
175
174
  this.#track?.focus();
176
175
  };
177
176
  #handleTrackClick = ({ type }) => {
178
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
177
+ debug(`${_a.name} ⚡️ ${type}`);
179
178
  if (this.#didDrag)
180
179
  return (this.#didDrag = false);
181
180
  this.#applyIsOnWithFlip(!this.isOn);
@@ -194,7 +193,7 @@ export class ToggleView extends FormAssociatedBase {
194
193
  return this.isOn ? this.#trackMaxX : this.#trackMinX;
195
194
  }
196
195
  #handleTrackPointerdown = ({ type, pointerId, clientX, clientY }) => {
197
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
196
+ debug(`${_a.name} ⚡️ ${type}`);
198
197
  if (!this.#track)
199
198
  return;
200
199
  if (!this.#measurePointerIsOverDot(clientX, clientY))
@@ -206,13 +205,13 @@ export class ToggleView extends FormAssociatedBase {
206
205
  this.#track.setPointerCapture(pointerId);
207
206
  };
208
207
  #handleTrackPointermove = ({ type, clientX }) => {
209
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
208
+ debug(`${_a.name} ⚡️ ${type}`);
210
209
  if (!this.#isDragging)
211
210
  return;
212
211
  this.#updateFromEvent(clientX);
213
212
  };
214
213
  #handleTrackPointerup = ({ type, pointerId }) => {
215
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
214
+ debug(`${_a.name} ⚡️ ${type}`);
216
215
  if (!this.#isDragging)
217
216
  return; // pointerdown never engaged (missed the dot) — plain click, nothing to settle
218
217
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
@@ -220,7 +219,7 @@ export class ToggleView extends FormAssociatedBase {
220
219
  this.#settle();
221
220
  };
222
221
  #handleTrackPointercancel = ({ type }) => {
223
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
222
+ debug(`${_a.name} ⚡️ ${type}`);
224
223
  if (!this.#isDragging)
225
224
  return; // already settled via pointerup, or nothing to settle
226
225
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
@@ -252,7 +251,7 @@ export class ToggleView extends FormAssociatedBase {
252
251
  this.#sendValueToForm(true);
253
252
  };
254
253
  #handleTrackKeydown = (evt) => {
255
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
254
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
256
255
  if (' ' !== evt.key)
257
256
  return;
258
257
  evt.preventDefault();
@@ -332,7 +331,7 @@ export class ToggleView extends FormAssociatedBase {
332
331
  message = kebabCase(key);
333
332
  break;
334
333
  }
335
- DEBUG && console.debug(`${_a.name} ⚡️ validity-change`);
334
+ debug(`${_a.name} ⚡️ validity-change`);
336
335
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#track);
337
336
  };
338
337
  setCustomValidity = (message) => {
@@ -5,9 +5,9 @@ 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
  var ToolBarItemGroup_1;
8
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
9
8
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
10
9
  import { adaptiveSlot } from '../internal/decorators';
10
+ import { debug } from '../internal/utils';
11
11
  /**
12
12
  * @summary A container view that groups items together in the toolbar or navigation bar.
13
13
  */
@@ -16,10 +16,10 @@ let ToolBarItemGroup = ToolBarItemGroup_1 = class ToolBarItemGroup extends HTMLE
16
16
  super();
17
17
  }
18
18
  connectedCallback() {
19
- DEBUG && console.debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
19
+ debug(`${ToolBarItemGroup_1.name} ⚡️ connect`);
20
20
  }
21
21
  disconnectedCallback() {
22
- DEBUG && console.debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
22
+ debug(`${ToolBarItemGroup_1.name} ⚡️ disconnect`);
23
23
  CleanupRegistry.unregister(this);
24
24
  }
25
25
  };
@@ -5,10 +5,9 @@ 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
  var ToolBarItem_1;
8
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
9
8
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
10
9
  import { adaptiveSlot } from '../internal/decorators';
11
- import { ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
10
+ import { debug, ensurePlaceholder, onoff, touchGlass } from '../internal/utils';
12
11
  import { Snapshot } from '../snapshot';
13
12
  /**
14
13
  * @summary A view placed in the toolbar or navigation bar.
@@ -22,7 +21,7 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
22
21
  super();
23
22
  }
24
23
  attributeChangedCallback(name, oldValue, newValue) {
25
- DEBUG && console.debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
24
+ debug(`${ToolBarItem_1.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
26
25
  switch (name) {
27
26
  case 'slot':
28
27
  case 'data-previous-slot':
@@ -46,12 +45,12 @@ let ToolBarItem = ToolBarItem_1 = class ToolBarItem extends HTMLElement {
46
45
  }
47
46
  }
48
47
  disconnectedCallback() {
49
- DEBUG && console.debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
48
+ debug(`${ToolBarItem_1.name} ⚡️ disconnect`);
50
49
  this.#mutationObserver?.disconnect();
51
50
  CleanupRegistry.unregister(this);
52
51
  }
53
52
  connectedCallback() {
54
- DEBUG && console.debug(`${ToolBarItem_1.name} ⚡️ connect`);
53
+ debug(`${ToolBarItem_1.name} ⚡️ connect`);
55
54
  CleanupRegistry.register(this, onoff(touchGlass(this, (t) => t.closest('tool-bar-item-group') ?? t, ({ target }) => {
56
55
  if (!(target instanceof HTMLElement))
57
56
  return true;
@@ -1,7 +1,6 @@
1
1
  var _a;
2
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
3
2
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
4
- import { $ } from '../internal/utils';
3
+ import { $, debug } from '../internal/utils';
5
4
  import { html } from '../tpl';
6
5
  const observers = new ResizeObserverSingleton();
7
6
  /**
@@ -59,7 +58,7 @@ export class ToolBar extends HTMLElement {
59
58
  this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
60
59
  }
61
60
  connectedCallback() {
62
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
61
+ debug(`${_a.name} ⚡️ connect`);
63
62
  // NOTE: wait for config
64
63
  // Snapshot.waitReady.then(() => {
65
64
  for (const el of this.#shadowRoot.querySelectorAll(`[part*="toolbar-leading-stack"],[part*="toolbar-trailing-stack"]`))
@@ -67,11 +66,11 @@ export class ToolBar extends HTMLElement {
67
66
  // })
68
67
  }
69
68
  disconnectedCallback() {
70
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
69
+ debug(`${_a.name} ⚡️ disconnect`);
71
70
  observers.unobserve(this);
72
71
  }
73
72
  #measureStacks(entry) {
74
- DEBUG && console.debug(`${_a.name} ⚡️ measure`);
73
+ debug(`${_a.name} ⚡️ measure`);
75
74
  if (this.closest('[hidden]'))
76
75
  return;
77
76
  const leading = 'toolbar-leading-stack', trailing = 'toolbar-trailing-stack';
@@ -1,15 +1,15 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
+ import { debug } from '../internal/utils';
2
2
  export class VDivider extends HTMLElement {
3
3
  constructor() {
4
4
  super();
5
5
  }
6
6
  connectedCallback() {
7
- DEBUG && console.debug(`${VDivider.name} ⚡️ connect`);
7
+ debug(`${VDivider.name} ⚡️ connect`);
8
8
  }
9
9
  disconnectedCallback() {
10
- DEBUG && console.debug(`${VDivider.name} ⚡️ disconnect`);
10
+ debug(`${VDivider.name} ⚡️ disconnect`);
11
11
  }
12
12
  attributeChangedCallback(name, oldValue, newValue) {
13
- DEBUG && console.debug(`${VDivider.name} ⚡️ attr-change [${name}]`);
13
+ debug(`${VDivider.name} ⚡️ attr-change [${name}]`);
14
14
  }
15
15
  }
@@ -1,7 +1,6 @@
1
1
  var _a;
2
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
3
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
- import { frame, onoff, prop, sleep } from '../internal/utils';
3
+ import { debug, frame, onoff, prop, sleep } from '../internal/utils';
5
4
  import { Snapshot } from '../snapshot';
6
5
  /**
7
6
  * BUG: Safari on IOS reports inaccurate innerHeight (which is what we really want) on orientationchange.
@@ -23,11 +22,11 @@ export class VKeyboard extends HTMLElement {
23
22
  super();
24
23
  }
25
24
  disconnectedCallback() {
26
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
25
+ debug(`${_a.name} ⚡️ disconnect`);
27
26
  CleanupRegistry.unregister(this);
28
27
  }
29
28
  connectedCallback() {
30
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
29
+ debug(`${_a.name} ⚡️ connect`);
31
30
  this.inert = true;
32
31
  CleanupRegistry.register(this, onoff([
33
32
  { types: 'scroll', listener: this.#handleWindowScroll },
@@ -59,13 +58,13 @@ export class VKeyboard extends HTMLElement {
59
58
  self.scrollTo(0, 0);
60
59
  };
61
60
  #handleWindowOrientationchange = async () => {
62
- DEBUG && console.debug(`${_a.name} ⚡️ orientationchange`);
61
+ debug(`${_a.name} ⚡️ orientationchange`);
63
62
  if (!(await frame(this)))
64
63
  return; //self.requestAnimationFrame(this.#ifKeyboardScrollIntoActiveElement)
65
64
  this.#ifKeyboardScrollIntoActiveElement();
66
65
  };
67
66
  #handleBodyFocusin = async () => {
68
- DEBUG && console.debug(`${_a.name} ⚡️ focusin`);
67
+ debug(`${_a.name} ⚡️ focusin`);
69
68
  await sleep(100); // self.setTimeout(this.#ifKeyboardScrollIntoActiveElement, 100)
70
69
  if (!this.isConnected)
71
70
  return;
@@ -1,4 +1,4 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
+ import { debug } from '../internal/utils';
2
2
  /**
3
3
  * @summary A view that arranges its children one on top of the other.
4
4
  *
@@ -19,9 +19,9 @@ export class VStack extends HTMLElement {
19
19
  super();
20
20
  }
21
21
  connectedCallback() {
22
- DEBUG && console.debug(`${VStack.name} ⚡️ connect`);
22
+ debug(`${VStack.name} ⚡️ connect`);
23
23
  }
24
24
  disconnectedCallback() {
25
- DEBUG && console.debug(`${VStack.name} ⚡️ disconnect`);
25
+ debug(`${VStack.name} ⚡️ disconnect`);
26
26
  }
27
27
  }
@@ -1,6 +1,5 @@
1
1
  var _a;
2
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
3
- import { onoff } from '../../internal/utils';
2
+ import { debug, onoff } from '../../internal/utils';
4
3
  export class CSSStyleObserver {
5
4
  #cleanups;
6
5
  #options;
@@ -17,7 +16,7 @@ export class CSSStyleObserver {
17
16
  this.#cleanups?.();
18
17
  }
19
18
  #handleTransitionrun = (callback, evt) => {
20
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type} (${evt.propertyName})`);
19
+ debug(`${_a.name} ⚡️ ${evt?.type} (${evt.propertyName})`);
21
20
  if (!this.#options?.properties.some((prop) => evt.propertyName.startsWith(prop)))
22
21
  return;
23
22
  callback?.(evt);
@@ -1,4 +1,4 @@
1
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
1
+ import { debug } from '../../internal/utils';
2
2
  import { CleanupRegistry } from './cleanup-registry';
3
3
  const internals = new WeakMap();
4
4
  // const trackedElements = new WeakMap<FormAssociatedBase, Set<Element>>()
@@ -11,14 +11,14 @@ export function getInternals(instance) {
11
11
  }
12
12
  // export function makeSlotchangeHandler(t: FormAssociatedBase) {
13
13
  // const handleSlotchange = ({ type, target: slot }: Event) => {
14
- // DEBUG && console.debug(`${makeSlotchangeHandler.name} ⚡️ ${type}`)
14
+ // debug(`${makeSlotchangeHandler.name} ⚡️ ${type}`)
15
15
  // if (!(slot instanceof HTMLSlotElement && slot)) return
16
16
  // const assigned = slot.assignedElements({ flatten: true })
17
17
  // observers.syncObservations(trackedElements.get(t) ?? new Set(), assigned, handleTagMutation, ['value', 'label'])
18
18
  // if (0 < assigned.length) handleTagMutation()
19
19
  // },
20
20
  // handleTagMutation = (entry?: MutationRecord) => {
21
- // DEBUG && console.debug(`${handleTagMutation.name} ⚡️ mutation`)
21
+ // debug(`${handleTagMutation.name} ⚡️ mutation`)
22
22
  // t.setValidity(t.validity, t.validationMessage)
23
23
  // }
24
24
  // return [{ types: 'slotchange', listener: handleSlotchange }]
@@ -33,12 +33,12 @@ export class FormAssociatedBase extends HTMLElement {
33
33
  // trackedElements.set(this, new Set<Element>())
34
34
  }
35
35
  disconnectedCallback() {
36
- DEBUG && console.debug(`${FormAssociatedBase.name} ⚡️ disconnect`);
36
+ debug(`${FormAssociatedBase.name} ⚡️ disconnect`);
37
37
  CleanupRegistry.unregister(this);
38
38
  // observers.clearObservationsSet(trackedElements.get(this) ?? new Set())
39
39
  }
40
40
  connectedCallback() {
41
- DEBUG && console.debug(`${FormAssociatedBase.name} ⚡️ connect`);
41
+ debug(`${FormAssociatedBase.name} ⚡️ connect`);
42
42
  }
43
43
  get type() {
44
44
  return this.localName;
@@ -1,8 +1,7 @@
1
1
  var _a;
2
2
  import { lifecycleObserver } from '../../buses';
3
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
4
3
  import { CleanupRegistry } from '../../internal/class/cleanup-registry';
5
- import { frame, onoff } from '../utils';
4
+ import { debug, frame, onoff } from '../utils';
6
5
  export class NavigationView extends HTMLElement {
7
6
  static get observedAttributes() {
8
7
  return ['hidden'];
@@ -32,7 +31,7 @@ export class NavigationView extends HTMLElement {
32
31
  // consume it (important so it doesn’t leak to next change)
33
32
  this.#recentBefore = undefined;
34
33
  }
35
- DEBUG && console.debug(`${_a.name} 💡 ${eventType}`);
34
+ debug(`${_a.name} 💡 ${eventType}`);
36
35
  frame(this).then(() => target.dispatchEvent(new CustomEvent(eventType, { detail: { tag: this.id }, bubbles: true, composed: true })));
37
36
  break;
38
37
  }
@@ -56,7 +55,7 @@ export class NavigationView extends HTMLElement {
56
55
  frame(this).then(() => lifecycleObserver.dispatchEvent(new CustomEvent('tabshow', { detail: { tag: this.id }, bubbles: true, composed: true })));
57
56
  }
58
57
  #handleBeforeTabRevealOrSwap = ({ type, detail }) => {
59
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
58
+ debug(`${_a.name} ⚡️ ${type}`);
60
59
  if (this.id !== detail?.tag)
61
60
  return;
62
61
  this.#recentBefore = {
@@ -1,10 +1,9 @@
1
- import { DEBUG } from '../../internal/flags.json' with { type: 'json' };
2
1
  import { Snapshot } from '../../snapshot';
3
2
  import { CleanupRegistry } from '../class/cleanup-registry';
4
- import { onoff } from '../utils';
3
+ import { debug, onoff } from '../utils';
5
4
  export default function (filter) {
6
5
  const handleMediaChange = (el, { type, matches }) => {
7
- DEBUG && console.debug(`${el.localName} ⚡️ ${type}`);
6
+ debug(`${el.localName} ⚡️ ${type}`);
8
7
  if (matches) {
9
8
  if (!el.matches(`[slot="cancellation-action"],[slot="primary-action"],[slot="confirmation-action"],[slot="destructive-action"]`))
10
9
  return;
@@ -23,7 +22,7 @@ export default function (filter) {
23
22
  return function (Base, _context) {
24
23
  const originalConnected = Base.prototype.connectedCallback, originalDisconnected = Base.prototype.disconnectedCallback;
25
24
  Base.prototype.connectedCallback = function () {
26
- DEBUG && console.debug(`decorator:[${this.localName}] ⚡️ connect`);
25
+ debug(`decorator:[${this.localName}] ⚡️ connect`);
27
26
  originalConnected?.call(this);
28
27
  if (filter && !filter(this))
29
28
  return;
@@ -40,7 +39,7 @@ export default function (filter) {
40
39
  });
41
40
  };
42
41
  Base.prototype.disconnectedCallback = function () {
43
- DEBUG && console.debug(`decorator:[${this.localName}] ⚡️ disconnect`);
42
+ debug(`decorator:[${this.localName}] ⚡️ disconnect`);
44
43
  originalDisconnected?.call(this);
45
44
  CleanupRegistry.unregister(this, 'adaptive-slot');
46
45
  };
@@ -1,5 +1,5 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
1
  import { NavigationPath } from '../internal/class/navigation-path';
2
+ import { debug } from '../internal/utils';
3
3
  import { Snapshot } from '../snapshot';
4
4
  export function queryInsertPosition(frame) {
5
5
  if ('NAVIGATION-SPLIT-VIEW' === frame?.tagName)
@@ -18,7 +18,7 @@ const cleanup = (lm, type) => {
18
18
  el.classList.remove(...arr);
19
19
  };
20
20
  export const startViewTransition = async (target, type = 'forwards', updateCallbackOrOptions = async () => { }) => {
21
- DEBUG && console.debug(`startViewTransition (${type})`, target);
21
+ debug(`startViewTransition (${type})`, target);
22
22
  if (!(target instanceof HTMLElement))
23
23
  throw new TypeError("Argument 1 ('target') to client.startViewTransition must be an instance of HTMLElement");
24
24
  if (!['forwards', 'backwards', 'reload'].includes(type))
@@ -57,9 +57,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
57
57
  // dialogFrames = [toFrame, ...(Snapshot.leaveFrames ?? [])].filter((item): item is HTMLDialogElement => item instanceof HTMLDialogElement) //[toFrame, ...(Snapshot.leaveFrames ?? [])].filter((item) => item?.matches('dialog'))
58
58
  // if ('DIALOG' === newHost?.tagName) {
59
59
  // ;(newHost as HTMLDialogElement).showModal()
60
- // DEBUG && console.debug(`⚡️ view-transition-start (${type})`)
60
+ // debug(`⚡️ view-transition-start (${type})`)
61
61
  // await Promise.allSettled(newHost.getAnimations().map(({ finished }) => finished))
62
- // DEBUG && console.debug(`⚡️ view-transition-end (${type})`)
62
+ // debug(`⚡️ view-transition-end (${type})`)
63
63
  // return
64
64
  // }
65
65
  // purge
@@ -82,14 +82,14 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
82
82
  if (0 < modalViews.length) {
83
83
  for await (const el of modalViews)
84
84
  el.showModal();
85
- DEBUG && console.debug(`⚡️ view-dialog-transition-start (${type})`);
85
+ debug(`⚡️ view-dialog-transition-start (${type})`);
86
86
  await Promise.allSettled(modalViews?.[0].getAnimations().map(({ finished }) => finished));
87
- DEBUG && console.debug(`⚡️ view-dialog-transition-end (${type})`);
87
+ debug(`⚡️ view-dialog-transition-end (${type})`);
88
88
  }
89
89
  else {
90
- DEBUG && console.debug(`⚡️ view-transition-start (${type})`);
90
+ debug(`⚡️ view-transition-start (${type})`);
91
91
  await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to?.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
92
- DEBUG && console.debug(`⚡️ view-transition-end (${type})`);
92
+ debug(`⚡️ view-transition-end (${type})`);
93
93
  }
94
94
  if (0 < (to?.component?.querySelectorAll(`.${Snapshot.config?.['vt-fwd-class-name']},.bwd`) ?? []).length)
95
95
  return;
@@ -110,9 +110,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
110
110
  if ('DIALOG' === from.component?.tagName) {
111
111
  from.body?.dispatchEvent(new CustomEvent('pageswap', { detail: { page: from.body }, bubbles: true, composed: true }));
112
112
  from.component.close();
113
- DEBUG && console.debug(`⚡️ view-dialog-transition-start (${type})`);
113
+ debug(`⚡️ view-dialog-transition-start (${type})`);
114
114
  await Promise.allSettled(from.component.getAnimations().map(({ finished }) => finished));
115
- DEBUG && console.debug(`⚡️ view-dialog-transition-end (${type})`);
115
+ debug(`⚡️ view-dialog-transition-end (${type})`);
116
116
  if (from.component.matches('[open]'))
117
117
  return;
118
118
  await updateCallback();
@@ -147,9 +147,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
147
147
  for (const el of inbetweenModals)
148
148
  el.close(); // close old inbetween modals
149
149
  // capture trans
150
- DEBUG && console.debug(`⚡️ view-transition-start (${type})`);
150
+ debug(`⚡️ view-transition-start (${type})`);
151
151
  await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
152
- DEBUG && console.debug(`⚡️ view-transition-end (${type})`);
152
+ debug(`⚡️ view-transition-end (${type})`);
153
153
  if (to.body?.closest(`.bwd,.${Snapshot.config?.['vt-fwd-class-name']}`))
154
154
  return;
155
155
  cleanup(root);
@@ -0,0 +1 @@
1
+ export default function (...args: Parameters<typeof self.console.debug>): void;
@@ -0,0 +1,4 @@
1
+ import flags from '../flags.json' with { type: 'json' };
2
+ export default function (...args) {
3
+ flags.DEBUG && self.console.debug(...args);
4
+ }
@@ -12,10 +12,10 @@ export { default as cssTime } from './css-time';
12
12
  export * from './css-time';
13
13
  export { default as debounce } from './debounce';
14
14
  export * from './debounce';
15
+ export { default as debug } from './debug';
16
+ export * from './debug';
15
17
  export { default as defineTranslations } from './define-translations';
16
18
  export * from './define-translations';
17
- export { default as devFlags } from './dev-flags';
18
- export * from './dev-flags';
19
19
  export { default as ensurePlaceholder } from './ensure-placeholder';
20
20
  export * from './ensure-placeholder';
21
21
  export { default as frame } from './frame';
@@ -12,10 +12,10 @@ export { default as cssTime } from './css-time';
12
12
  export * from './css-time';
13
13
  export { default as debounce } from './debounce';
14
14
  export * from './debounce';
15
+ export { default as debug } from './debug';
16
+ export * from './debug';
15
17
  export { default as defineTranslations } from './define-translations';
16
18
  export * from './define-translations';
17
- export { default as devFlags } from './dev-flags';
18
- export * from './dev-flags';
19
19
  export { default as ensurePlaceholder } from './ensure-placeholder';
20
20
  export * from './ensure-placeholder';
21
21
  export { default as frame } from './frame';
@@ -1,4 +1,4 @@
1
1
  export default function (x, y, rect) {
2
2
  const { left, right, top, bottom } = rect;
3
- return x >= left && x <= right && y >= top && y <= bottom;
3
+ return left <= x && x <= right && top <= y && y <= bottom;
4
4
  }
@@ -1,5 +1,4 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
- import { onoff } from '../internal/utils';
1
+ import { debug, onoff } from '../internal/utils';
3
2
  export class Snapshot {
4
3
  static #readyCalled = false;
5
4
  static #config;
@@ -46,10 +45,10 @@ export class Snapshot {
46
45
  const mediaQueryList = self.matchMedia(`(pointer: fine) and (min-width: ${this.#config['ipad-sheet-view-inline-size']}) and (min-height: ${this.#config['ipad-sheet-view-height']})`);
47
46
  this.#breakpoints = new Map([['fine_dialog_sheet', mediaQueryList.matches]]);
48
47
  this.#listeners.add(onoff('change', (evt) => this.#handleMediaChange(evt, 'fine_dialog_sheet:change'), mediaQueryList).on());
49
- DEBUG && console.debug(this.#config);
48
+ debug(this.#config);
50
49
  }
51
50
  static #handleMediaChange = ({ type, matches, media }, kind) => {
52
- DEBUG && console.debug(`${Snapshot.name} ⚡️ ${type}`);
51
+ debug(`${Snapshot.name} ⚡️ ${type}`);
53
52
  this.#breakpoints?.set('fine_dialog_sheet', matches);
54
53
  this.on.dispatchEvent(new MediaQueryListEvent(kind, {
55
54
  matches,