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

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 (79) 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.d.ts +1 -0
  23. package/generated/components/list-view.js +4 -4
  24. package/generated/components/menu-view.js +10 -11
  25. package/generated/components/navigation-large-title.d.ts +0 -1
  26. package/generated/components/navigation-large-title.js +5 -7
  27. package/generated/components/navigation-split-view.js +4 -4
  28. package/generated/components/navigation-stack.js +4 -4
  29. package/generated/components/navigation-title.js +4 -4
  30. package/generated/components/picker-view.js +31 -32
  31. package/generated/components/plain-button.js +3 -4
  32. package/generated/components/progress-view.js +6 -7
  33. package/generated/components/screen-view.js +2 -2
  34. package/generated/components/scroll-view-proxy.js +3 -3
  35. package/generated/components/scroll-view.js +9 -10
  36. package/generated/components/search-view.js +4 -5
  37. package/generated/components/section-view.js +4 -5
  38. package/generated/components/sheet-view.js +6 -7
  39. package/generated/components/sidebar-toggle.js +5 -6
  40. package/generated/components/sidebar-view.js +2 -3
  41. package/generated/components/sticky-container.js +3 -4
  42. package/generated/components/tab-bar.js +4 -5
  43. package/generated/components/tab-item.js +8 -9
  44. package/generated/components/tab-view.js +7 -8
  45. package/generated/components/table-view.js +6 -7
  46. package/generated/components/text-field.js +10 -11
  47. package/generated/components/text-view.js +4 -4
  48. package/generated/components/toggle-view.js +21 -15
  49. package/generated/components/tool-bar-item-group.js +3 -3
  50. package/generated/components/tool-bar-item.js +4 -5
  51. package/generated/components/tool-bar.js +4 -5
  52. package/generated/components/v-divider.js +4 -4
  53. package/generated/components/v-keyboard.js +5 -6
  54. package/generated/components/v-stack.js +3 -3
  55. package/generated/css/index.css +76 -11
  56. package/generated/internal/class/css-style-observer.js +2 -3
  57. package/generated/internal/class/form-associated-base.js +5 -5
  58. package/generated/internal/class/navigation-view.js +3 -4
  59. package/generated/internal/decorators/adaptive-slot.js +4 -5
  60. package/generated/internal/privateNamespace.d.ts +1 -1
  61. package/generated/internal/privateNamespace.js +12 -12
  62. package/generated/internal/utils/debug.d.ts +1 -0
  63. package/generated/internal/utils/debug.js +4 -0
  64. package/generated/internal/utils/index.d.ts +2 -2
  65. package/generated/internal/utils/index.js +2 -2
  66. package/generated/internal/utils/is-inside.js +1 -1
  67. package/generated/snapshot/index.js +3 -4
  68. package/package.json +2 -1
  69. package/scss/_utils.scss +2 -0
  70. package/scss/base/_root.scss +6 -3
  71. package/scss/colors/_index.scss +11 -0
  72. package/scss/components/_navigation-large-title.scss +14 -8
  73. package/scss/components/_scroll-view.scss +12 -0
  74. package/scss/components/_toggle-view.scss +10 -0
  75. package/scss/utils/_background.scss +52 -0
  76. package/scss/utils/_index.scss +20 -17
  77. package/web-components.html-data/en.json +11 -11
  78. package/generated/internal/utils/dev-flags.d.ts +0 -3
  79. package/generated/internal/utils/dev-flags.js +0 -5
@@ -1,6 +1,5 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { onoff } from '../internal/utils';
2
+ import { debug, onoff } from '../internal/utils';
4
3
  import { ButtonBase } from '../namespace-browser/base';
5
4
  import { TabView } from './tab-view';
6
5
  /**
@@ -11,11 +10,11 @@ export class TabItem extends ButtonBase {
11
10
  super();
12
11
  }
13
12
  static polyfillDisconnectedCallback(btn) {
14
- DEBUG && console.debug(`${TabItem.name} ⚡️ disconnect`);
13
+ debug(`${TabItem.name} ⚡️ disconnect`);
15
14
  CleanupRegistry.unregister(btn);
16
15
  }
17
16
  static polyfillConnectedCallback(btn) {
18
- DEBUG && console.debug(`${TabItem.name} ⚡️ connect`);
17
+ debug(`${TabItem.name} ⚡️ connect`);
19
18
  Object.assign(btn, {
20
19
  tabIndex: 0,
21
20
  ariaSelected: 'false',
@@ -35,7 +34,7 @@ export class TabItem extends ButtonBase {
35
34
  });
36
35
  }
37
36
  static #handleTabMoreStackAllowance = async (btn, evt) => {
38
- DEBUG && console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
37
+ debug(`${TabItem.name} ⚡️ ${evt?.type}`);
39
38
  const tv = btn.closest('tab-view');
40
39
  if (!tv)
41
40
  return;
@@ -44,7 +43,7 @@ export class TabItem extends ButtonBase {
44
43
  btn.hidden = 'bottom-bar' !== tv.tabBarPlacement;
45
44
  };
46
45
  static #handleTabRevealOrSwap = async (btn, evt) => {
47
- DEBUG && console.debug(`${TabItem.name} ⚡️ ${evt?.type}`);
46
+ debug(`${TabItem.name} ⚡️ ${evt?.type}`);
48
47
  const tv = btn?.closest('tab-view');
49
48
  if (!tv)
50
49
  return;
@@ -66,7 +65,7 @@ export class TabItem extends ButtonBase {
66
65
  }, 100);
67
66
  };
68
67
  static #handleClick = async ({ type, currentTarget: btn }) => {
69
- DEBUG && console.debug(`${TabItem.name} ⚡️ ${type}`);
68
+ debug(`${TabItem.name} ⚡️ ${type}`);
70
69
  if (!(btn instanceof HTMLElement))
71
70
  return;
72
71
  // const tag = btn.getAttribute('value')
@@ -112,14 +111,14 @@ export class TabItem extends ButtonBase {
112
111
  for (const tab of tabs.reverse())
113
112
  if (tv.selectedTab.includes(tab)) {
114
113
  const eventType = 'tabroot';
115
- DEBUG && console.debug(`${TabItem.name} 💡 ${eventType}`);
114
+ debug(`${TabItem.name} 💡 ${eventType}`);
116
115
  tab?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
117
116
  return; // skip rest no selection!
118
117
  }
119
118
  }
120
119
  else if ('->' === dir) {
121
120
  const eventType = 'tabroot';
122
- DEBUG && console.debug(`${TabItem.name} 💡 ${eventType}`);
121
+ debug(`${TabItem.name} 💡 ${eventType}`);
123
122
  tabs.at(0)?.dispatchEvent(new CustomEvent(eventType, { bubbles: true, composed: true }));
124
123
  }
125
124
  // SECTION: finally, submit new tabs
@@ -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 { CSSStyleObserver } from '../internal/class/css-style-observer';
5
4
  import { NavigationPath } from '../internal/class/navigation-path';
6
- import { cssTime, debounce, frame, onoff, siblings, timeout } from '../internal/utils';
5
+ import { cssTime, debounce, debug, frame, onoff, siblings, timeout } from '../internal/utils';
7
6
  import { Snapshot } from '../snapshot';
8
7
  const TAB_BAR_PLACEMENTS = ['bottom-bar', 'ornament', 'sidebar', 'top-bar'];
9
8
  /**
@@ -30,7 +29,7 @@ export class TabView extends HTMLElement {
30
29
  this.#debouncedHandler = debounce(this.#handleSelectionChange, 1);
31
30
  }
32
31
  disconnectedCallback() {
33
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
32
+ debug(`${_a.name} ⚡️ disconnect`);
34
33
  this.#afterTabRevealDelay.cancel();
35
34
  this.#cssStyleObserver?.disconnect();
36
35
  CleanupRegistry.unregister(this);
@@ -42,7 +41,7 @@ export class TabView extends HTMLElement {
42
41
  return this.querySelector(':scope>navigation-stack:has(> navigation-stack,> navigation-split-view)');
43
42
  }
44
43
  connectedCallback() {
45
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
44
+ debug(`${_a.name} ⚡️ connect`);
46
45
  this.#cssStyleObserver = new CSSStyleObserver({
47
46
  properties: ['--adaptable-tab-bar-placement-index'],
48
47
  });
@@ -78,11 +77,11 @@ export class TabView extends HTMLElement {
78
77
  this.#addAnimations(new CustomEvent('beforetabreveal', { detail: { tag: '', ms: cssTime(`${this.computedStyleMap().get(`--tabbar-after-tabreveal-duration`)}`) }, bubbles: true, composed: true }));
79
78
  };
80
79
  #handleTabViewPagereveal = (evt) => {
81
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
80
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
82
81
  void this.#syncBodyFace();
83
82
  };
84
83
  #handleStyleChange = () => {
85
- DEBUG && console.debug(`${_a.name} ⚡️ style`);
84
+ debug(`${_a.name} ⚡️ style`);
86
85
  const style = self.getComputedStyle(this);
87
86
  const placement = style.getPropertyValue('--adaptable-tab-bar-placement'), // or do it manually without any computedstyle
88
87
  newValue = TAB_BAR_PLACEMENTS.includes(placement) ? placement : 'bottom-bar';
@@ -97,7 +96,7 @@ export class TabView extends HTMLElement {
97
96
  }
98
97
  };
99
98
  #handleAdaptableTabBarPlacementChange = (evt) => {
100
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
99
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
101
100
  if ('bottom-bar' !== evt.detail.oldValue)
102
101
  return; // button triggers should happen, ONLY when going FROM bottom-bar TO anything else
103
102
  const innerSelection = this.moreTab?.querySelector(':scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])')?.id;
@@ -165,7 +164,7 @@ export class TabView extends HTMLElement {
165
164
  #triggerToggleEvent = (evt) => {
166
165
  const eventType = 'tab-view:toggle';
167
166
  void this.#syncBodyFace();
168
- DEBUG && console.debug(`${_a.name} 💡 ${eventType}`);
167
+ debug(`${_a.name} 💡 ${eventType}`);
169
168
  this.dispatchEvent(new CustomEvent(eventType, { detail: { selection: this.selectedTab }, bubbles: true, composed: true }));
170
169
  };
171
170
  #syncBodyFace = async () => {
@@ -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 { CSSStyleObserver } from '../internal/class/css-style-observer';
5
4
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
6
- import { $, listActive, onoff } from '../internal/utils';
5
+ import { $, debug, listActive, onoff } from '../internal/utils';
7
6
  import { queryMorph } from '../morphdom';
8
7
  import { Snapshot } from '../snapshot';
9
8
  import { html } from '../tpl';
@@ -69,14 +68,14 @@ export class TableView extends HTMLElement {
69
68
  this.#slots?.get('column')?.addEventListener('slotchange', this.#handleColumnSlotchange);
70
69
  }
71
70
  disconnectedCallback() {
72
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
71
+ debug(`${_a.name} ⚡️ disconnect`);
73
72
  CleanupRegistry.unregister(this);
74
73
  this.#styleObserver?.disconnect();
75
74
  this.#observers.unobserveAll();
76
75
  this.#compactToolbarItem = undefined;
77
76
  }
78
77
  connectedCallback() {
79
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
78
+ debug(`${_a.name} ⚡️ connect`);
80
79
  CleanupRegistry.register(this, onoff(listActive(this), this).on());
81
80
  this.#styleObserver = new CSSStyleObserver({
82
81
  properties: ['--adaptable-table-style-index'],
@@ -88,7 +87,7 @@ export class TableView extends HTMLElement {
88
87
  Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
89
88
  }
90
89
  #handleColumnSlotchange = ({ type, target: slot }) => {
91
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
90
+ debug(`${_a.name} ⚡️ ${type}`);
92
91
  if (!(slot instanceof HTMLSlotElement))
93
92
  return;
94
93
  const assigned = slot.assignedElements();
@@ -97,7 +96,7 @@ export class TableView extends HTMLElement {
97
96
  this.#renderColumns([]);
98
97
  };
99
98
  #renderColumns = (entries) => {
100
- DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
99
+ debug(`${_a.name} ⚡️ mutation`);
101
100
  if (!this.#compactToolbarItem) {
102
101
  this.#compactToolbarItem = $(html `<menu-view tabindex="0" slot="header-trailing"></menu-view>`, '>1');
103
102
  CleanupRegistry.unregister(this, 'compact_toolbar');
@@ -120,7 +119,7 @@ export class TableView extends HTMLElement {
120
119
  };
121
120
  #observers = new MutationObserverSet(this.#renderColumns);
122
121
  #handleStyleChange = () => {
123
- DEBUG && console.debug(`${_a.name} ⚡️ style`);
122
+ debug(`${_a.name} ⚡️ style`);
124
123
  const target = this.#shadowRoot.querySelector('[part*=table-container]') ?? undefined;
125
124
  if (!target)
126
125
  return;
@@ -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;
@@ -106,10 +105,13 @@ export class ToggleView extends FormAssociatedBase {
106
105
  { types: 'pointermove', listener: this.#handleTrackPointermove },
107
106
  { types: 'lostpointercapture', listener: this.#handleTrackPointercancel },
108
107
  ], this.#track).on());
109
- CleanupRegistry.register(this, onoff([{ types: 'blur', listener: this.#handleWindowBlur }], self).on());
108
+ CleanupRegistry.register(this, onoff([
109
+ { types: 'blur', listener: this.#handleWindowBlur },
110
+ { types: 'focus', listener: this.#handleWindowFocus },
111
+ ], self).on());
110
112
  }
111
113
  attributeChangedCallback(name, oldValue, newValue) {
112
- DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
114
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
113
115
  switch (name) {
114
116
  case 'value':
115
117
  this.value = String(newValue); // this.#input?.setAttribute('checked', newValue ?? '')
@@ -162,7 +164,7 @@ export class ToggleView extends FormAssociatedBase {
162
164
  this.ariaChecked = `${this.#isOn}`;
163
165
  }
164
166
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
165
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
167
+ debug(`${_a.name} ⚡️ ${type}`);
166
168
  if (!(slot instanceof HTMLSlotElement))
167
169
  return;
168
170
  const assigned = slot.assignedElements();
@@ -170,12 +172,12 @@ export class ToggleView extends FormAssociatedBase {
170
172
  this.#renderValidityMsgs([]);
171
173
  };
172
174
  #handleFocusin = ({ type, target }) => {
173
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
175
+ debug(`${_a.name} ⚡️ ${type}`);
174
176
  if (target === this)
175
177
  this.#track?.focus();
176
178
  };
177
179
  #handleTrackClick = ({ type }) => {
178
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
180
+ debug(`${_a.name} ⚡️ ${type}`);
179
181
  if (this.#didDrag)
180
182
  return (this.#didDrag = false);
181
183
  this.#applyIsOnWithFlip(!this.isOn);
@@ -194,7 +196,7 @@ export class ToggleView extends FormAssociatedBase {
194
196
  return this.isOn ? this.#trackMaxX : this.#trackMinX;
195
197
  }
196
198
  #handleTrackPointerdown = ({ type, pointerId, clientX, clientY }) => {
197
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
199
+ debug(`${_a.name} ⚡️ ${type}`);
198
200
  if (!this.#track)
199
201
  return;
200
202
  if (!this.#measurePointerIsOverDot(clientX, clientY))
@@ -206,13 +208,13 @@ export class ToggleView extends FormAssociatedBase {
206
208
  this.#track.setPointerCapture(pointerId);
207
209
  };
208
210
  #handleTrackPointermove = ({ type, clientX }) => {
209
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
211
+ debug(`${_a.name} ⚡️ ${type}`);
210
212
  if (!this.#isDragging)
211
213
  return;
212
214
  this.#updateFromEvent(clientX);
213
215
  };
214
216
  #handleTrackPointerup = ({ type, pointerId }) => {
215
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
217
+ debug(`${_a.name} ⚡️ ${type}`);
216
218
  if (!this.#isDragging)
217
219
  return; // pointerdown never engaged (missed the dot) — plain click, nothing to settle
218
220
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
@@ -220,18 +222,22 @@ export class ToggleView extends FormAssociatedBase {
220
222
  this.#settle();
221
223
  };
222
224
  #handleTrackPointercancel = ({ type }) => {
223
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
225
+ debug(`${_a.name} ⚡️ ${type}`);
224
226
  if (!this.#isDragging)
225
227
  return; // already settled via pointerup, or nothing to settle
226
228
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
227
229
  this.#settle();
228
230
  };
229
231
  #handleWindowBlur = () => {
232
+ this.toggleAttribute('js-window-inactive', true);
230
233
  if (!this.#isDragging)
231
234
  return;
232
235
  this.#track?.style.removeProperty('--toggle--dot-transition-duration');
233
236
  this.#settle();
234
237
  };
238
+ #handleWindowFocus = async () => {
239
+ this.toggleAttribute('js-window-inactive', false);
240
+ };
235
241
  #updateFromEvent = (clientX) => {
236
242
  if (!this.#track)
237
243
  return;
@@ -252,7 +258,7 @@ export class ToggleView extends FormAssociatedBase {
252
258
  this.#sendValueToForm(true);
253
259
  };
254
260
  #handleTrackKeydown = (evt) => {
255
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
261
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
256
262
  if (' ' !== evt.key)
257
263
  return;
258
264
  evt.preventDefault();
@@ -332,7 +338,7 @@ export class ToggleView extends FormAssociatedBase {
332
338
  message = kebabCase(key);
333
339
  break;
334
340
  }
335
- DEBUG && console.debug(`${_a.name} ⚡️ validity-change`);
341
+ debug(`${_a.name} ⚡️ validity-change`);
336
342
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#track);
337
343
  };
338
344
  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
  }