@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,17 +1,16 @@
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
  export class PlainButton extends ButtonBase {
6
5
  constructor() {
7
6
  super();
8
7
  }
9
8
  static polyfillDisconnectedCallback(el) {
10
- DEBUG && console.debug(`${PlainButton.name} ⚡️ disconnect`);
9
+ debug(`${PlainButton.name} ⚡️ disconnect`);
11
10
  CleanupRegistry.unregister(el);
12
11
  }
13
12
  static polyfillConnectedCallback(el) {
14
- DEBUG && console.debug(`${PlainButton.name} ⚡️ connect`);
13
+ debug(`${PlainButton.name} ⚡️ connect`);
15
14
  el.tabIndex = 0;
16
15
  CleanupRegistry.register(el, onoff('click', PlainButton.#handleClick, el).on());
17
16
  }
@@ -1,8 +1,7 @@
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
- import { $ } from '../internal/utils';
4
+ import { $, debug } from '../internal/utils';
6
5
  import { queryMorph } from '../morphdom';
7
6
  import { Snapshot } from '../snapshot';
8
7
  import { html } from '../tpl';
@@ -61,7 +60,7 @@ export class ProgressView extends HTMLElement {
61
60
  this.#shadowRoot = this.attachShadow({ mode: 'closed' });
62
61
  }
63
62
  attributeChangedCallback(name, oldValue, newValue) {
64
- DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
63
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
65
64
  switch (name) {
66
65
  case 'label': {
67
66
  const label = this.querySelector(':scope>label-view:not([slot])') ?? this.appendChild($(html `<label-view foreground="secondary"></label-view>`, '>1'));
@@ -79,11 +78,11 @@ export class ProgressView extends HTMLElement {
79
78
  }
80
79
  }
81
80
  disconnectedCallback() {
82
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
81
+ debug(`${_a.name} ⚡️ disconnect`);
83
82
  CleanupRegistry.unregister(this);
84
83
  }
85
84
  connectedCallback() {
86
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
85
+ debug(`${_a.name} ⚡️ connect`);
87
86
  this.inert = true;
88
87
  this.#cssStyleObserver = new CSSStyleObserver({
89
88
  properties: ['--progress-view-style-index'],
@@ -92,7 +91,7 @@ export class ProgressView extends HTMLElement {
92
91
  Snapshot.waitReady.then(() => self.requestAnimationFrame(this.#handleStyleChange));
93
92
  }
94
93
  #handleStyleChange = () => {
95
- DEBUG && console.debug(`${_a.name} ⚡️ style`);
94
+ debug(`${_a.name} ⚡️ style`);
96
95
  const raw = self.getComputedStyle(this).getPropertyValue('--progress-view-style-index').trim();
97
96
  const newValue = progressViewStyles[Number(raw)] ?? progressViewStyles[0];
98
97
  if (newValue === this.#progressViewStyle)
@@ -101,7 +100,7 @@ export class ProgressView extends HTMLElement {
101
100
  this.#render();
102
101
  };
103
102
  #render() {
104
- DEBUG && console.debug(`${_a.name} ⚡️ #render (${this.#progressViewStyle})`);
103
+ debug(`${_a.name} ⚡️ #render (${this.#progressViewStyle})`);
105
104
  if (this.#lastRenderedStyle === this.#progressViewStyle)
106
105
  return; // skip if already applied
107
106
  this.#lastRenderedStyle = this.#progressViewStyle;
@@ -1,10 +1,10 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
1
+ import { debug } from '../internal/utils';
2
2
  import { DialogBase } from '../namespace-browser/base';
3
3
  export class ScreenView extends DialogBase {
4
4
  constructor() {
5
5
  super();
6
6
  }
7
7
  disconnectedCallback() {
8
- DEBUG && console.debug(`${ScreenView.name} ⚡️ disconnect`);
8
+ debug(`${ScreenView.name} ⚡️ disconnect`);
9
9
  }
10
10
  }
@@ -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 wrapper for {hv}-stacks
4
4
  */
@@ -7,9 +7,9 @@ export class ScrollViewProxy extends HTMLElement {
7
7
  super();
8
8
  }
9
9
  disconnectedCallback() {
10
- DEBUG && console.debug(`${ScrollViewProxy.name} ⚡️ disconnect`);
10
+ debug(`${ScrollViewProxy.name} ⚡️ disconnect`);
11
11
  }
12
12
  connectedCallback() {
13
- DEBUG && console.debug(`${ScrollViewProxy.name} ⚡️ connect`);
13
+ debug(`${ScrollViewProxy.name} ⚡️ connect`);
14
14
  }
15
15
  }
@@ -1,9 +1,8 @@
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
4
  import { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
6
- import { $, frame, onoff, slowHideShow } from '../internal/utils';
5
+ import { $, debug, frame, onoff, slowHideShow } from '../internal/utils';
7
6
  import { queryMorph } from '../morphdom';
8
7
  import { html } from '../tpl';
9
8
  const observers = new ResizeObserverSingleton();
@@ -58,7 +57,7 @@ export class ScrollView extends HTMLElement {
58
57
  });
59
58
  }
60
59
  attributeChangedCallback(name, oldValue, newValue) {
61
- DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
60
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
62
61
  switch (name) {
63
62
  case 'navigation-inline-title':
64
63
  this.#renderNavTitle(newValue, this.getAttribute('navigation-inline-subtitle'));
@@ -80,13 +79,13 @@ export class ScrollView extends HTMLElement {
80
79
  }
81
80
  }
82
81
  disconnectedCallback() {
83
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
82
+ debug(`${_a.name} ⚡️ disconnect`);
84
83
  CleanupRegistry.unregister(this);
85
84
  observers.unobserve(this);
86
85
  frame().then(() => lifecycleObserver.dispatchEvent(new CustomEvent('pagehide', { detail: { page: this }, bubbles: true, composed: true })));
87
86
  }
88
87
  connectedCallback() {
89
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
88
+ debug(`${_a.name} ⚡️ connect`);
90
89
  CleanupRegistry.register(this, onoff([
91
90
  // { types: 'tabreveal', listener: this.#handleTabReveal as EventListener },
92
91
  { types: 'beforetabswap', listener: this.#handleTabBeforeswap },
@@ -120,7 +119,7 @@ export class ScrollView extends HTMLElement {
120
119
  slowHideShow('largeinline' === `${comp}` ? 'show' : 'hide', title);
121
120
  };
122
121
  #handleScroll = ({ target, type }) => {
123
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
122
+ debug(`${_a.name} ⚡️ ${type}`);
124
123
  if (!this.#isMidScroll)
125
124
  this.#isMidScroll = true;
126
125
  // if (this.#stopRecordingScrollTop) return
@@ -129,12 +128,12 @@ export class ScrollView extends HTMLElement {
129
128
  this.#lastScrollTop = target.scrollTop;
130
129
  };
131
130
  #handleScrollend = (evt) => {
132
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
131
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
133
132
  if (this.#isMidScroll)
134
133
  this.#isMidScroll = false;
135
134
  };
136
135
  #handleMeasure = (entry) => {
137
- DEBUG && console.debug(`${_a.name} ⚡️ measure`);
136
+ debug(`${_a.name} ⚡️ measure`);
138
137
  if (0 === entry.contentRect.width + entry.contentRect.height)
139
138
  return;
140
139
  if (undefined === this.#beforeTabSwapLastScrolltop)
@@ -151,7 +150,7 @@ export class ScrollView extends HTMLElement {
151
150
  this.#beforeTabSwapLastScrolltop = undefined;
152
151
  };
153
152
  // #handleTabReveal = ({ type, target }: CustomEvent<TabDetail>) => {
154
- // DEBUG && console.debug(`${ScrollView.name} ⚡️ ${type}`)
153
+ // debug(`${ScrollView.name} ⚡️ ${type}`)
155
154
  // if (!(target instanceof HTMLElement)) return
156
155
  // if (!target.contains(this)) return
157
156
  // if (this.closest('[hidden]')) return
@@ -179,7 +178,7 @@ export class ScrollView extends HTMLElement {
179
178
  // // })
180
179
  // }
181
180
  #handleTabBeforeswap = ({ type, target }) => {
182
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
181
+ debug(`${_a.name} ⚡️ ${type}`);
183
182
  if (!(target instanceof HTMLElement))
184
183
  return;
185
184
  if (!target.contains(this))
@@ -1,22 +1,21 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { onoff, touchGlass } from '../internal/utils';
2
+ import { debug, onoff, touchGlass } from '../internal/utils';
4
3
  import { InputBase } from '../namespace-browser/base';
5
4
  export class SearchView extends InputBase {
6
5
  constructor() {
7
6
  super();
8
7
  }
9
8
  static polyfillDisconnectedCallback(el) {
10
- DEBUG && console.debug(`${SearchView.name} ⚡️ disconnect`);
9
+ debug(`${SearchView.name} ⚡️ disconnect`);
11
10
  CleanupRegistry.unregister(el);
12
11
  }
13
12
  static polyfillConnectedCallback(el) {
14
- DEBUG && console.debug(`${SearchView.name} ⚡️ connect`);
13
+ debug(`${SearchView.name} ⚡️ connect`);
15
14
  CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, () => true), el).on());
16
15
  el.type = 'search';
17
16
  }
18
17
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
19
- DEBUG && console.debug(`${SearchView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
18
+ debug(`${SearchView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
20
19
  const node = target instanceof HTMLInputElement;
21
20
  if (!node)
22
21
  return;
@@ -1,5 +1,4 @@
1
- import { DEBUG } from '../internal/flags.json' with { type: 'json' };
2
- import { $ } from '../internal/utils';
1
+ import { $, debug } from '../internal/utils';
3
2
  import { queryMorph } from '../morphdom';
4
3
  import { html } from '../tpl';
5
4
  /**
@@ -33,7 +32,7 @@ export class SectionView extends HTMLElement {
33
32
  this.#shadowRoot.appendChild(document.importNode(this.constructor.template, true));
34
33
  }
35
34
  attributeChangedCallback(name, oldValue, newValue) {
36
- DEBUG && console.debug(`${SectionView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
35
+ debug(`${SectionView.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
37
36
  switch (name) {
38
37
  case 'header':
39
38
  queryMorph('[slot=header]', html `<header slot="header">
@@ -52,11 +51,11 @@ export class SectionView extends HTMLElement {
52
51
  }
53
52
  }
54
53
  disconnectedCallback() {
55
- DEBUG && console.debug(`${SectionView.name} ⚡️ disconnect`);
54
+ debug(`${SectionView.name} ⚡️ disconnect`);
56
55
  //
57
56
  }
58
57
  connectedCallback() {
59
- DEBUG && console.debug(`${SectionView.name} ⚡️ connect`);
58
+ debug(`${SectionView.name} ⚡️ connect`);
60
59
  //
61
60
  }
62
61
  }
@@ -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 { DialogBase } from '../namespace-browser/base';
5
4
  /**
6
5
  * @summary A dialog that slides up over the current screen.
@@ -10,11 +9,11 @@ export class SheetView extends DialogBase {
10
9
  super();
11
10
  }
12
11
  static polyfillDisconnectedCallback(el) {
13
- DEBUG && console.debug(`${SheetView.name} ⚡️ disconnect`);
12
+ debug(`${SheetView.name} ⚡️ disconnect`);
14
13
  CleanupRegistry.unregister(el);
15
14
  }
16
15
  static polyfillConnectedCallback(el) {
17
- DEBUG && console.debug(`${SheetView.name} ⚡️ connect`);
16
+ debug(`${SheetView.name} ⚡️ connect`);
18
17
  CleanupRegistry.register(el, onoff([
19
18
  { types: 'cancel', listener: this.#handleCancel },
20
19
  { types: 'keydown', listener: SheetView.#handleKeydown },
@@ -22,10 +21,10 @@ export class SheetView extends DialogBase {
22
21
  el.autofocus = true;
23
22
  }
24
23
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
25
- DEBUG && console.debug(`${SheetView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
24
+ debug(`${SheetView.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
26
25
  }
27
26
  static #handleKeydown = (evt) => {
28
- DEBUG && console.debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.key})`);
27
+ debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.key})`);
29
28
  if ('Escape' !== evt.key)
30
29
  return;
31
30
  evt.preventDefault();
@@ -33,7 +32,7 @@ export class SheetView extends DialogBase {
33
32
  evt.stopPropagation();
34
33
  };
35
34
  static #handleCancel = (evt) => {
36
- DEBUG && console.debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.cancelable})`);
35
+ debug(`${SheetView.name} ⚡️ ${evt?.type} (${evt.cancelable})`);
37
36
  if (!evt.cancelable)
38
37
  return;
39
38
  evt.preventDefault();
@@ -1,8 +1,7 @@
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 { ResizeObserverSingleton } from '../internal/class/resize-observer-singleton';
5
- import { debounce, onoff } from '../internal/utils';
4
+ import { debounce, debug, onoff } from '../internal/utils';
6
5
  const observers = new ResizeObserverSingleton();
7
6
  /**
8
7
  * @summary A control that shows or hides the sidebar view.
@@ -12,12 +11,12 @@ export class SidebarToggle extends HTMLElement {
12
11
  super();
13
12
  }
14
13
  disconnectedCallback() {
15
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
14
+ debug(`${_a.name} ⚡️ disconnect`);
16
15
  observers.unobserve(this);
17
16
  CleanupRegistry.unregister(this);
18
17
  }
19
18
  connectedCallback() {
20
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
19
+ debug(`${_a.name} ⚡️ connect`);
21
20
  CleanupRegistry.register(this, onoff('click', this.#handleClick, this).on());
22
21
  const entry = {
23
22
  target: this,
@@ -32,7 +31,7 @@ export class SidebarToggle extends HTMLElement {
32
31
  }
33
32
  // This triggers on show/hide of any of sidebar-toggle elements
34
33
  static #handleMeasure(entry) {
35
- DEBUG && console.debug(`${_a.name} ⚡️ measure`);
34
+ debug(`${_a.name} ⚡️ measure`);
36
35
  const { target } = entry ?? {};
37
36
  if (!(target instanceof HTMLElement))
38
37
  return;
@@ -70,7 +69,7 @@ export class SidebarToggle extends HTMLElement {
70
69
  });
71
70
  }
72
71
  #handleClick({ target, type }) {
73
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
72
+ debug(`${_a.name} ⚡️ ${type}`);
74
73
  if (!(target instanceof HTMLElement))
75
74
  return;
76
75
  if (!target?.closest('button'))
@@ -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, touchGlass } from '../internal/utils';
2
+ import { debug, onoff, touchGlass } from '../internal/utils';
4
3
  import { DialogBase } from '../namespace-browser/base';
5
4
  /**
6
5
  * @summary A container view that arranges navigation destinations in a single column.
@@ -28,7 +27,7 @@ export class SidebarView extends DialogBase {
28
27
  }
29
28
  // Autoclose on click outside.
30
29
  static #handleClick = async ({ target, type }) => {
31
- DEBUG && console.debug(`${SidebarView.name} ⚡️ ${type}`);
30
+ debug(`${SidebarView.name} ⚡️ ${type}`);
32
31
  if (!(target instanceof HTMLElement))
33
32
  return;
34
33
  if (target instanceof HTMLDialogElement && 'sidebar-view' === target.getAttribute('is'))
@@ -1,16 +1,15 @@
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
  export class StickyContainer extends HTMLElement {
5
4
  constructor() {
6
5
  super();
7
6
  }
8
7
  disconnectedCallback() {
9
- DEBUG && console.debug(`${StickyContainer.name} ⚡️ disconnect`);
8
+ debug(`${StickyContainer.name} ⚡️ disconnect`);
10
9
  CleanupRegistry.unregister(this);
11
10
  }
12
11
  connectedCallback() {
13
- DEBUG && console.debug(`${StickyContainer.name} ⚡️ connect`);
12
+ debug(`${StickyContainer.name} ⚡️ connect`);
14
13
  // CleanupRegistry.register(this, onoff('transitionend transitionstart transitioncancel', this.#handleTransitionrun as unknown as EventListener, this).on())
15
14
  CleanupRegistry.register(this, onoff('transitionrun', this.#handleTransitionrun, this).on());
16
15
  }
@@ -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, touchGlass } from '../internal/utils';
2
+ import { debug, onoff, touchGlass } from '../internal/utils';
4
3
  import { DialogBase } from '../namespace-browser/base';
5
4
  /**
6
5
  * @summary A container view that groups tab-items together along the top or bottom of the screen.
@@ -10,12 +9,12 @@ export class TabBar extends DialogBase {
10
9
  super();
11
10
  }
12
11
  static polyfillDisconnectedCallback(el) {
13
- DEBUG && console.debug(`${TabBar.name} ⚡️ disconnect`);
12
+ debug(`${TabBar.name} ⚡️ disconnect`);
14
13
  el.removeEventListener('click', TabBar.#handleClick);
15
14
  CleanupRegistry.unregister(el);
16
15
  }
17
16
  static polyfillConnectedCallback(el) {
18
- DEBUG && console.debug(`${TabBar.name} ⚡️ connect`);
17
+ debug(`${TabBar.name} ⚡️ connect`);
19
18
  el.autofocus = true;
20
19
  CleanupRegistry.register(el, onoff('click', TabBar.#handleClick, el).on());
21
20
  CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
@@ -29,7 +28,7 @@ export class TabBar extends DialogBase {
29
28
  }), el).on());
30
29
  }
31
30
  static #handleClick = async ({ target, type }) => {
32
- DEBUG && console.debug(`${TabBar.name} ⚡️ ${type}`);
31
+ debug(`${TabBar.name} ⚡️ ${type}`);
33
32
  if (!(target instanceof HTMLElement))
34
33
  return;
35
34
  if (target instanceof HTMLDialogElement && 'tab-bar' === target.getAttribute('is'))
@@ -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;