@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,17 +1,16 @@
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
6
  import { NavigationPath } from '../internal/class/navigation-path';
8
7
  import { queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
9
- import { $, ancestors, kebabCase, onoff } from '../internal/utils';
8
+ import { $, ancestors, debug, kebabCase, onoff } from '../internal/utils';
10
9
  import { queryMorph } from '../morphdom';
11
10
  import { html, render } from '../tpl';
12
11
  const pickerStyles = ['menu', 'inline', 'navigation-link', 'sheet', 'automatic'];
13
12
  const update = (path, node, overwrite = true) => {
14
- DEBUG && console.debug(`PickerView: update`);
13
+ debug(`PickerView: update`);
15
14
  if (!(path instanceof NavigationPath))
16
15
  throw new Error('invalid view');
17
16
  const { component, page } = path;
@@ -23,7 +22,7 @@ const update = (path, node, overwrite = true) => {
23
22
  page.insertAdjacentElement(position, node);
24
23
  };
25
24
  const reflectSpawnedPage = (current, source) => {
26
- DEBUG && console.debug(`PickerView: reflectSpawnedPage`);
25
+ debug(`PickerView: reflectSpawnedPage`);
27
26
  const { page: oldSv, toolBarConfig: oldToolbar } = new NavigationPath(current).hydrate(), { page: newSv, toolBarConfig: newToolbar } = new NavigationPath(source).hydrate();
28
27
  const oldList = oldSv?.querySelector('list-view'), newList = newSv?.querySelector('list-view'), oldBackBtn = oldToolbar?.at(0)?.querySelector('button'), newBackBtn = newToolbar?.at(0)?.querySelector('button');
29
28
  // pre replace list (always exists)
@@ -61,10 +60,10 @@ const reflectSpawnedPage = (current, source) => {
61
60
  oldSearch?.remove();
62
61
  };
63
62
  const extractTag = (node) => {
64
- DEBUG && console.debug(`PickerView: extractTag`);
63
+ debug(`PickerView: extractTag`);
65
64
  return node instanceof HTMLOptionElement ? (((node.getAttribute('value') ?? node.textContent?.trim()) || node.getAttribute('label')) ?? '') : (node.value ?? '');
66
65
  }, extractLabel = (node) => {
67
- DEBUG && console.debug(`PickerView: extractLabelFromGroup`);
66
+ debug(`PickerView: extractLabelFromGroup`);
68
67
  if (node instanceof Element)
69
68
  if (node instanceof HTMLOptionElement)
70
69
  return (node.getAttribute('label') ?? node.getAttribute('value') ?? node.textContent?.trim()) || null;
@@ -74,14 +73,14 @@ const extractTag = (node) => {
74
73
  return node.title ?? node.value ?? null;
75
74
  // return node instanceof Element ? node.getAttribute('DATALIST' === node.tagName ? 'data-label' : 'label') : (node.title ?? node.value ?? null)
76
75
  }, extractIcon = (node) => {
77
- DEBUG && console.debug(`PickerView: extractIcon`);
76
+ debug(`PickerView: extractIcon`);
78
77
  // return node instanceof Element ? node.getAttribute('data-system-image') : (node.systemImage ?? null)
79
78
  if (node instanceof Element)
80
79
  return node.getAttribute('data-system-image');
81
80
  else
82
81
  return node.systemImage ?? null;
83
82
  }, extractSubtitle = (node) => {
84
- DEBUG && console.debug(`PickerView: extractSubtitle`);
83
+ debug(`PickerView: extractSubtitle`);
85
84
  if (node instanceof Element)
86
85
  return node.getAttribute('data-subtitle');
87
86
  else
@@ -166,7 +165,7 @@ export class PickerView extends FormAssociatedBase {
166
165
  };
167
166
  }
168
167
  #spawnPage = (elements, tag, parentGroupId, searchable = false, title) => {
169
- DEBUG && console.debug(`${_a.name} #spawnPage`);
168
+ debug(`${_a.name} #spawnPage`);
170
169
  const body = tag === 'sheet-view'
171
170
  ? $(html `<dialog is="sheet-view">
172
171
  <scroll-view>
@@ -324,7 +323,7 @@ export class PickerView extends FormAssociatedBase {
324
323
  }
325
324
  };
326
325
  #renderButtons(input) {
327
- DEBUG && console.debug(`${_a.name} #renderButtons`);
326
+ debug(`${_a.name} #renderButtons`);
328
327
  switch (input.mode) {
329
328
  case 'dictionary': {
330
329
  const flattenDictionary = (tree) => {
@@ -476,15 +475,15 @@ export class PickerView extends FormAssociatedBase {
476
475
  this.#reflectSelectionOnCurrentValueLabel();
477
476
  }
478
477
  #renderDictionary = (dictionary) => {
479
- DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
478
+ debug(`${_a.name} ⚡️ mutation`);
480
479
  this.#renderButtons({ mode: 'dictionary', source: dictionary });
481
480
  };
482
481
  #renderSlotted = (entries) => {
483
- DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
482
+ debug(`${_a.name} ⚡️ mutation`);
484
483
  this.#renderButtons({ mode: 'list', source: this.#slots?.get('list')?.assignedElements({ flatten: true }) ?? [] });
485
484
  };
486
485
  #renderValidityMsgs = (entries) => {
487
- DEBUG && console.debug(`${_a.name} ⚡️ mutation`);
486
+ debug(`${_a.name} ⚡️ mutation`);
488
487
  this.setValidity(this.validity, this.validationMessage);
489
488
  };
490
489
  #lastRenderedStyle; //string | null
@@ -616,7 +615,7 @@ export class PickerView extends FormAssociatedBase {
616
615
  this.#shadowRoot = this.attachShadow({ mode: 'closed' });
617
616
  }
618
617
  attributeChangedCallback(name, oldValue, newValue) {
619
- DEBUG && console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
618
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
620
619
  switch (name) {
621
620
  case this.constructor.ATTR.PLACEHOLDER:
622
621
  case this.constructor.ATTR.PLACEHOLDER_ICON:
@@ -663,13 +662,13 @@ export class PickerView extends FormAssociatedBase {
663
662
  }
664
663
  }
665
664
  disconnectedCallback() {
666
- DEBUG && console.debug(`${_a.name} ⚡️ disconnect`);
665
+ debug(`${_a.name} ⚡️ disconnect`);
667
666
  CleanupRegistry.unregister(this);
668
667
  this.#validityObservers.unobserveAll();
669
668
  this.#observers.unobserveAll();
670
669
  }
671
670
  connectedCallback() {
672
- DEBUG && console.debug(`${_a.name} ⚡️ connect`);
671
+ debug(`${_a.name} ⚡️ connect`);
673
672
  CleanupRegistry.register(this, onoff('localechange', () => {
674
673
  this.#renderSlotted([]);
675
674
  }, I18n.on).on());
@@ -687,7 +686,7 @@ export class PickerView extends FormAssociatedBase {
687
686
  return pickerStyles.includes(this.getAttribute(attr) ?? '') ? this.getAttribute(attr) : 'automatic';
688
687
  }
689
688
  #render() {
690
- DEBUG && console.debug(`${_a.name} ⚡️ #render (${this.pickerStyle})`);
689
+ debug(`${_a.name} ⚡️ #render (${this.pickerStyle})`);
691
690
  // const style = this.getAttribute((this.constructor as typeof PickerView).ATTR.PICKER_STYLE)
692
691
  if (this.#lastRenderedStyle === this.pickerStyle)
693
692
  return; // skip if already applied
@@ -728,7 +727,7 @@ export class PickerView extends FormAssociatedBase {
728
727
  this.dispatchEvent(new CustomEvent('selection', { detail: { selection: this.#selection }, bubbles: true, composed: true }));
729
728
  };
730
729
  #handleTriggerClick = async ({ type, target }) => {
731
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
730
+ debug(`${_a.name} ⚡️ ${type}`);
732
731
  if (!(target instanceof HTMLElement))
733
732
  return;
734
733
  this.#spawn?.remove?.();
@@ -743,7 +742,7 @@ export class PickerView extends FormAssociatedBase {
743
742
  });
744
743
  };
745
744
  #handlePageBtnClick = async (evt) => {
746
- DEBUG && console.debug(`${_a.name} ⚡️ ${evt?.type}`);
745
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
747
746
  evt.stopImmediatePropagation();
748
747
  evt.preventDefault();
749
748
  const { currentTarget: btn } = evt;
@@ -766,7 +765,7 @@ export class PickerView extends FormAssociatedBase {
766
765
  });
767
766
  };
768
767
  #handleClick({ type, target }) {
769
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
768
+ debug(`${_a.name} ⚡️ ${type}`);
770
769
  if (!(target instanceof HTMLElement))
771
770
  return;
772
771
  const btn = target.closest('button');
@@ -778,7 +777,7 @@ export class PickerView extends FormAssociatedBase {
778
777
  this.#sendValueToForm();
779
778
  }
780
779
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
781
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
780
+ debug(`${_a.name} ⚡️ ${type}`);
782
781
  if (!(slot instanceof HTMLSlotElement))
783
782
  return;
784
783
  const assigned = slot.assignedElements();
@@ -787,7 +786,7 @@ export class PickerView extends FormAssociatedBase {
787
786
  this.#renderValidityMsgs([]);
788
787
  };
789
788
  #handleListSlotchange = ({ type, target: slot }) => {
790
- DEBUG && console.debug(`${_a.name} ⚡️ ${type}`);
789
+ debug(`${_a.name} ⚡️ ${type}`);
791
790
  if (!(slot instanceof HTMLSlotElement))
792
791
  return;
793
792
  const assigned = slot.assignedElements();
@@ -796,7 +795,7 @@ export class PickerView extends FormAssociatedBase {
796
795
  this.#renderSlotted([]);
797
796
  };
798
797
  static #wrapOptionSpawnTag(node) {
799
- DEBUG && console.debug(`${_a.name} #wrapOptionSpawnTag`);
798
+ debug(`${_a.name} #wrapOptionSpawnTag`);
800
799
  const title = extractLabel(node), subtitle = extractSubtitle(node), icon = extractIcon(node);
801
800
  const mount = document.createElement('div');
802
801
  render(html `<button type="button" tabindex="0" navigation-link>
@@ -834,7 +833,7 @@ export class PickerView extends FormAssociatedBase {
834
833
  return mount.firstElementChild; //btn
835
834
  }
836
835
  static #wrapOptionTag(node) {
837
- DEBUG && console.debug(`${_a.name} #wrapOptionTag`);
836
+ debug(`${_a.name} #wrapOptionTag`);
838
837
  const tag = extractTag(node), title = extractLabel(node), subtitle = extractSubtitle(node), icon = extractIcon(node);
839
838
  const mount = document.createElement('div');
840
839
  render(html `<button type="button" tabindex="0" value="${tag}">
@@ -866,7 +865,7 @@ export class PickerView extends FormAssociatedBase {
866
865
  return mount.firstElementChild; //btn
867
866
  }
868
867
  static #wrapOptgroupTag(node) {
869
- DEBUG && console.debug(`${_a.name} #wrapOptgroupTag`);
868
+ debug(`${_a.name} #wrapOptgroupTag`);
870
869
  const title = extractLabel(node), subtitle = extractSubtitle(node), icon = extractIcon(node);
871
870
  const mount = document.createElement('div');
872
871
  render(html `<details is="disclosure-group" disclosure-style="marker-trailing">
@@ -899,7 +898,7 @@ export class PickerView extends FormAssociatedBase {
899
898
  // static #reflectButtons(nodes: Element[], container: Element): void
900
899
  // static #reflectButtons(nodes: Dictionary, container: Element): void
901
900
  static #reflectButtons(nodes, container) {
902
- DEBUG && console.debug(`${_a.name} #reflectButtons`);
901
+ debug(`${_a.name} #reflectButtons`);
903
902
  for (const node of nodes)
904
903
  if (node instanceof Element)
905
904
  switch (node.tagName) {
@@ -981,7 +980,7 @@ export class PickerView extends FormAssociatedBase {
981
980
  }
982
981
  }
983
982
  // #reflectPlaceholder(value: string | null) {
984
- // DEBUG && console.debug(`#reflectPlaceholder`)
983
+ // debug(`#reflectPlaceholder`)
985
984
  // const input = this.#shadowRoot.querySelector('input')
986
985
  // if (input) {
987
986
  // if (value) input.setAttribute((this.constructor as typeof PickerView).ATTR.PLACEHOLDER, value)
@@ -989,12 +988,12 @@ export class PickerView extends FormAssociatedBase {
989
988
  // }
990
989
  // }
991
990
  #reflectLabel(value) {
992
- DEBUG && console.debug(`${_a.name} #reflectLabel`);
991
+ debug(`${_a.name} #reflectLabel`);
993
992
  queryMorph('[slot=label]', html `<label-view slot="label">${value ? html `<span>${value}</span>` : null}</label-view>`, this);
994
993
  this.#renderSlotted([]);
995
994
  }
996
995
  #reflectSelectionOnButtons() {
997
- DEBUG && console.debug(`${_a.name} #reflectSelectionOnButtons`);
996
+ debug(`${_a.name} #reflectSelectionOnButtons`);
998
997
  self.requestAnimationFrame(() => {
999
998
  this.ariaCurrent = this.#selection;
1000
999
  const groupMap = indexGroups(this.#lastIndexedRoot);
@@ -1025,7 +1024,7 @@ export class PickerView extends FormAssociatedBase {
1025
1024
  * Overwrite cvlabel with the label prop of the current(find[value === #selection]) option/dictentry
1026
1025
  */
1027
1026
  #reflectSelectionOnCurrentValueLabel() {
1028
- DEBUG && console.debug(`${_a.name} #reflectSelectionOnCurrentValueLabel`);
1027
+ debug(`${_a.name} #reflectSelectionOnCurrentValueLabel`);
1029
1028
  self.requestAnimationFrame(() => {
1030
1029
  switch (this.pickerStyle) {
1031
1030
  case 'sheet':
@@ -1068,7 +1067,7 @@ export class PickerView extends FormAssociatedBase {
1068
1067
  });
1069
1068
  }
1070
1069
  #reflectTriggerHelp() {
1071
- DEBUG && console.debug(`${_a.name} #reflectTriggerHelp`);
1070
+ debug(`${_a.name} #reflectTriggerHelp`);
1072
1071
  let trigger;
1073
1072
  switch (this.pickerStyle) {
1074
1073
  case 'sheet':
@@ -1123,7 +1122,7 @@ export class PickerView extends FormAssociatedBase {
1123
1122
  message = kebabCase(key);
1124
1123
  break;
1125
1124
  }
1126
- DEBUG && console.debug(`${_a.name} ⚡️ validity-change`);
1125
+ debug(`${_a.name} ⚡️ validity-change`);
1127
1126
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor);
1128
1127
  };
1129
1128
  setCustomValidity = (message) => {
@@ -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'))