@swiftwc/ui 0.0.0-dev.99 → 1.0.0-canary.1

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 (209) hide show
  1. package/generated/client/index.js +8 -9
  2. package/generated/components/alert-dialog.js +9 -17
  3. package/generated/components/bordered-button.js +4 -7
  4. package/generated/components/bordered-prominent-button.js +4 -7
  5. package/generated/components/borderless-button.js +4 -7
  6. package/generated/components/color-scheme.js +4 -7
  7. package/generated/components/confirmation-dialog.js +9 -17
  8. package/generated/components/content-unavailable.d.ts +1 -1
  9. package/generated/components/content-unavailable.js +5 -8
  10. package/generated/components/{body-view.d.ts → content-view.d.ts} +2 -2
  11. package/generated/components/content-view.js +15 -0
  12. package/generated/components/date-picker.js +13 -25
  13. package/generated/components/detail-placeholder.d.ts +11 -0
  14. package/generated/components/detail-placeholder.js +15 -0
  15. package/generated/components/disclosure-group.js +5 -9
  16. package/generated/components/fine-tooltip.js +4 -7
  17. package/generated/components/form-view.js +3 -5
  18. package/generated/components/glass-button.js +4 -7
  19. package/generated/components/glass-prominent-button.js +4 -7
  20. package/generated/components/h-divider.d.ts +11 -0
  21. package/generated/components/h-divider.js +15 -0
  22. package/generated/components/h-flex-stack.d.ts +16 -0
  23. package/generated/components/h-flex-stack.js +18 -0
  24. package/generated/components/h-stack.js +3 -5
  25. package/generated/components/image-view.js +4 -7
  26. package/generated/components/index.d.ts +7 -1
  27. package/generated/components/index.js +7 -1
  28. package/generated/components/label-view.d.ts +2 -2
  29. package/generated/components/label-view.js +6 -9
  30. package/generated/components/labeled-content.d.ts +7 -1
  31. package/generated/components/labeled-content.js +32 -32
  32. package/generated/components/list-view.d.ts +5 -1
  33. package/generated/components/list-view.js +8 -6
  34. package/generated/components/menu-view.d.ts +1 -1
  35. package/generated/components/menu-view.js +11 -20
  36. package/generated/components/navigation-large-title.d.ts +0 -1
  37. package/generated/components/navigation-large-title.js +5 -10
  38. package/generated/components/navigation-split-view.js +4 -7
  39. package/generated/components/navigation-stack.js +4 -7
  40. package/generated/components/navigation-title.js +4 -7
  41. package/generated/components/picker-view.d.ts +4 -21
  42. package/generated/components/picker-view.js +374 -326
  43. package/generated/components/plain-button.js +3 -5
  44. package/generated/components/progress-view.d.ts +1 -1
  45. package/generated/components/progress-view.js +7 -12
  46. package/generated/components/screen-view.js +2 -3
  47. package/generated/components/scroll-view-proxy.js +3 -5
  48. package/generated/components/scroll-view.d.ts +1 -1
  49. package/generated/components/scroll-view.js +10 -17
  50. package/generated/components/search-view.js +4 -7
  51. package/generated/components/section-view.d.ts +1 -1
  52. package/generated/components/section-view.js +5 -8
  53. package/generated/components/sheet-view.js +6 -11
  54. package/generated/components/sidebar-toggle.js +5 -9
  55. package/generated/components/sidebar-view.js +2 -3
  56. package/generated/components/sticky-container.js +3 -5
  57. package/generated/components/tab-bar.js +4 -7
  58. package/generated/components/tab-item.js +8 -15
  59. package/generated/components/tab-view.js +19 -23
  60. package/generated/components/table-view.d.ts +1 -1
  61. package/generated/components/table-view.js +7 -12
  62. package/generated/components/text-field.js +10 -19
  63. package/generated/components/text-view.d.ts +11 -0
  64. package/generated/components/text-view.js +16 -0
  65. package/generated/components/toggle-view.d.ts +2 -0
  66. package/generated/components/toggle-view.js +33 -37
  67. package/generated/components/tool-bar-item-group.js +3 -5
  68. package/generated/components/tool-bar-item.js +4 -7
  69. package/generated/components/tool-bar.js +4 -7
  70. package/generated/components/v-divider.d.ts +11 -0
  71. package/generated/components/v-divider.js +15 -0
  72. package/generated/components/v-flex-stack.d.ts +16 -0
  73. package/generated/components/v-flex-stack.js +18 -0
  74. package/generated/components/v-keyboard.js +8 -12
  75. package/generated/components/v-stack.js +3 -5
  76. package/generated/css/index.css +762 -418
  77. package/generated/internal/class/css-style-observer.js +2 -3
  78. package/generated/internal/class/form-associated-base.js +6 -8
  79. package/generated/internal/class/navigation-path.js +2 -2
  80. package/generated/internal/class/navigation-view.js +3 -5
  81. package/generated/internal/decorators/adaptive-slot.js +4 -7
  82. package/generated/internal/decorators/microtask-on-connected.d.ts +2 -2
  83. package/generated/internal/decorators/microtask-on-connected.js +2 -2
  84. package/generated/internal/dev-flags.d.ts +4 -0
  85. package/generated/internal/dev-flags.js +1 -0
  86. package/generated/internal/privateNamespace.d.ts +2 -2
  87. package/generated/internal/privateNamespace.js +15 -24
  88. package/generated/internal/utils/$.d.ts +9 -0
  89. package/generated/internal/utils/$.js +11 -0
  90. package/generated/internal/utils/debug.d.ts +1 -0
  91. package/generated/internal/utils/debug.js +4 -0
  92. package/generated/internal/utils/index.d.ts +36 -2
  93. package/generated/internal/utils/index.js +36 -5
  94. package/generated/internal/utils/is-inside.js +1 -1
  95. package/generated/snapshot/index.js +3 -5
  96. package/{web-components.html-data → html-data}/en.json +155 -54
  97. package/package.json +24 -20
  98. package/scss/_components.scss +1 -1
  99. package/scss/_maps.scss +3 -1
  100. package/scss/_utils.scss +3 -1
  101. package/scss/_vars.scss +1 -0
  102. package/scss/base/_layout.scss +8 -8
  103. package/scss/base/_reboot.scss +4 -29
  104. package/scss/base/_root.scss +27 -12
  105. package/scss/colors/_index.scss +66 -1
  106. package/scss/components/_alert-dialog.scss +3 -3
  107. package/scss/components/_bordered-button.scss +2 -2
  108. package/scss/components/_bordered-prominent-button.scss +3 -3
  109. package/scss/components/_borderless-button.scss +2 -2
  110. package/scss/components/_confirmation-dialog.scss +1 -1
  111. package/scss/components/_content-unavailable.scss +1 -1
  112. package/scss/components/{_body-view.scss → _content-view.scss} +2 -2
  113. package/scss/components/_date-picker.scss +1 -1
  114. package/scss/components/_detail-placeholder.scss +5 -5
  115. package/scss/components/_disclosure-group.scss +2 -2
  116. package/scss/components/_fine-tooltip.scss +1 -1
  117. package/scss/components/_form-view.scss +3 -3
  118. package/scss/components/_full-screen.scss +1 -1
  119. package/scss/components/_glass-button.scss +2 -2
  120. package/scss/components/_glass-prominent-button.scss +3 -3
  121. package/scss/components/_group-box.scss +1 -1
  122. package/scss/components/_h-divider.scss +1 -1
  123. package/scss/components/_h-flex-stack.scss +3 -1
  124. package/scss/components/_h-stack.scss +1 -1
  125. package/scss/components/_image-view.scss +1 -1
  126. package/scss/components/_index.scss +34 -24
  127. package/scss/components/_label-view.scss +1 -1
  128. package/scss/components/_labeled-content.scss +1 -1
  129. package/scss/components/_list-view.scss +3 -3
  130. package/scss/components/_menu-view.scss +3 -3
  131. package/scss/components/_navigation-large-title.scss +15 -9
  132. package/scss/components/_navigation-split-view.scss +18 -18
  133. package/scss/components/_navigation-stack.scss +1 -1
  134. package/scss/components/_navigation-title.scss +1 -1
  135. package/scss/components/_picker-view.scss +159 -119
  136. package/scss/components/_plain-button.scss +2 -2
  137. package/scss/components/_progress-view.scss +1 -1
  138. package/scss/components/_scroll-view-proxy.scss +1 -1
  139. package/scss/components/_scroll-view-toolbars.scss +1 -1
  140. package/scss/components/_scroll-view.scss +2 -2
  141. package/scss/components/_search-view.scss +1 -1
  142. package/scss/components/_section-view.scss +1 -1
  143. package/scss/components/_sheet-view.scss +2 -2
  144. package/scss/components/_sidebar-toggle.scss +1 -1
  145. package/scss/components/_sidebar-view.scss +2 -2
  146. package/scss/components/_sticky-container.scss +1 -1
  147. package/scss/components/_tab-bar.scss +1 -1
  148. package/scss/components/_tab-item.scss +1 -1
  149. package/scss/components/_tab-view.scss +23 -15
  150. package/scss/components/_table-column.scss +1 -1
  151. package/scss/components/_table-row.scss +1 -1
  152. package/scss/components/_table-view.scss +1 -1
  153. package/scss/components/_text-field.scss +1 -1
  154. package/scss/components/_text-view.scss +1 -1
  155. package/scss/components/_toggle-view.scss +41 -21
  156. package/scss/components/_tool-bar-item-group.scss +1 -1
  157. package/scss/components/_tool-bar-item.scss +2 -2
  158. package/scss/components/_tool-bar.scss +2 -2
  159. package/scss/components/_v-divider.scss +1 -1
  160. package/scss/components/_v-flex-stack.scss +3 -1
  161. package/scss/components/_v-keyboard.scss +1 -1
  162. package/scss/components/_v-stack.scss +1 -1
  163. package/scss/final/_touch-glass.scss +2 -2
  164. package/scss/mixins/_index.scss +2 -2
  165. package/scss/placeholders/_buttons.scss +5 -5
  166. package/scss/placeholders/_lists.scss +3 -3
  167. package/scss/transitions/_alert-dialog.scss +1 -1
  168. package/scss/transitions/_bwd.navbar.scss +1 -1
  169. package/scss/transitions/_bwd.scss +3 -3
  170. package/scss/transitions/_confirmation-dialog.scss +1 -1
  171. package/scss/transitions/_disclosure-group.scss +1 -1
  172. package/scss/transitions/_fine-tooltip.scss +1 -1
  173. package/scss/transitions/_fwd.navbar.scss +1 -1
  174. package/scss/transitions/_fwd.scss +1 -1
  175. package/scss/transitions/_glass-button.scss +1 -1
  176. package/scss/transitions/_glass-prominent-button.scss +1 -1
  177. package/scss/transitions/_index.scss +1 -1
  178. package/scss/transitions/_menu-view.scss +1 -1
  179. package/scss/transitions/_navigation-split-view.scss +1 -1
  180. package/scss/transitions/_progress-view.scss +1 -1
  181. package/scss/transitions/_sheet-view.scss +1 -1
  182. package/scss/transitions/_sidebar-view.scss +1 -1
  183. package/scss/transitions/_tab-bar.scss +1 -1
  184. package/scss/utils/_background.scss +52 -0
  185. package/scss/utils/_frame.scss +2 -2
  186. package/scss/utils/_index.scss +33 -8
  187. package/scss/utils/_spacing.scss +1 -1
  188. package/scss/utils/_stacks.scss +5 -3
  189. package/generated/components/body-view.js +0 -17
  190. package/generated/internal/utils/cash/index.d.ts +0 -24
  191. package/generated/internal/utils/cash/index.js +0 -27
  192. package/generated/internal/utils/dev-flags.d.ts +0 -3
  193. package/generated/internal/utils/dev-flags.js +0 -5
  194. /package/{web-components.css-data → css-data}/en.json +0 -0
  195. /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
  196. /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
  197. /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
  198. /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
  199. /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
  200. /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
  201. /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
  202. /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
  203. /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
  204. /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
  205. /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
  206. /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
  207. /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
  208. /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
  209. /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
@@ -2,10 +2,12 @@ import { alertDialog, confirmationDialog as confirmationDialogBus, lifecycleObse
2
2
  import * as Components from '../components';
3
3
  import { I18n } from '../i18n';
4
4
  import { NavigationPath } from '../internal/class/navigation-path';
5
+ import devFlags from '../internal/dev-flags';
5
6
  import { queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
6
- import { $, devFlags, kebabCase, onoff } from '../internal/utils';
7
+ import { $, debug, kebabCase, onoff } from '../internal/utils';
7
8
  import { Snapshot } from '../snapshot';
8
9
  import { html, render } from '../tpl';
10
+ debug(devFlags);
9
11
  //#region polyfills
10
12
  export const polyfills = new Map();
11
13
  for (const [k, Ctor] of Object.entries(Components)) {
@@ -14,11 +16,10 @@ for (const [k, Ctor] of Object.entries(Components)) {
14
16
  if (customElements.get(is))
15
17
  continue;
16
18
  customElements.define(is, Ctor, { extends: Ctor.polyfillExtends });
19
+ // NOTE: Test via the imperative creation path
17
20
  if (!(document.createElement(Ctor.polyfillExtends, { is }) instanceof Ctor))
18
21
  polyfills.set(is, Ctor);
19
- // const testEl = document.createElement('template')
20
- // testEl.innerHTML = `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`
21
- // const testNode = testEl.content.firstElementChild,
22
+ // NOTE: Defensive, test again via the HTML-parsing path
22
23
  if (!($(html `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`, '>1') instanceof Ctor))
23
24
  polyfills.set(is, Ctor);
24
25
  continue;
@@ -26,8 +27,7 @@ for (const [k, Ctor] of Object.entries(Components)) {
26
27
  if (!customElements.get(is))
27
28
  customElements.define(is, Ctor);
28
29
  }
29
- if (devFlags.debug)
30
- console.debug(polyfills);
30
+ debug(polyfills);
31
31
  if (0 < polyfills.size) {
32
32
  const polyfillTagNamesCache = new Set([...polyfills.values()].map((v) => String(v.polyfillExtends ?? '').toUpperCase()).filter(Boolean)); // ['TAG-NAME1', 'TAG-NAME2', ...]
33
33
  const handlers = new WeakMap();
@@ -57,8 +57,7 @@ if (0 < polyfills.size) {
57
57
  }, unobserve = (el) => {
58
58
  handlers.delete(el);
59
59
  }, polyfillTagNamesCacheSelector = [...polyfillTagNamesCache.values()].map((v) => `${v}`.toLowerCase()).join(','), flatten = (node) => [node, ...(node.querySelectorAll?.(polyfillTagNamesCacheSelector) ?? [])];
60
- if (devFlags.debug)
61
- console.debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
60
+ debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
62
61
  for (const [is, polyfill] of polyfills)
63
62
  for (const el of document.querySelectorAll(`${polyfill.polyfillExtends}[is="${CSS.escape(is)}"]`)) {
64
63
  polyfill.polyfillConnectedCallback(el);
@@ -264,7 +263,7 @@ export const confirmationDialog = async (trigger, title, message, actions, optio
264
263
  }
265
264
  dialog.insertAdjacentElement('beforeend', btn);
266
265
  }
267
- trigger.closest('body-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
266
+ trigger.closest('content-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
268
267
  const { promise, resolve } = Promise.withResolvers(), off = onoff('confirmation:return', (evt) => {
269
268
  const { detail } = evt;
270
269
  off();
@@ -1,6 +1,6 @@
1
1
  import { alertDialog } from '../buses';
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { devFlags, onoff, touchGlass } from '../internal/utils';
3
+ import { debug, onoff, touchGlass } from '../internal/utils';
4
4
  import { DialogBase } from '../namespace-browser/base';
5
5
  /**
6
6
  * @summary A dialog that shows a message. Use it from the client module like `void alert('Save failed.')`.
@@ -10,8 +10,7 @@ export class AlertDialog extends DialogBase {
10
10
  super();
11
11
  }
12
12
  static polyfillDisconnectedCallback(el) {
13
- if (devFlags.debug)
14
- console.debug(`${AlertDialog.name} ⚡️ disconnect`);
13
+ debug(`${AlertDialog.name} ⚡️ disconnect`);
15
14
  CleanupRegistry.unregister(el);
16
15
  alertDialog.dispatchEvent(new CustomEvent('alert:return', {
17
16
  detail: { returnValue: el.returnValue },
@@ -20,8 +19,7 @@ export class AlertDialog extends DialogBase {
20
19
  }));
21
20
  }
22
21
  static polyfillConnectedCallback(el) {
23
- if (devFlags.debug)
24
- console.debug(`${AlertDialog.name} ⚡️ connect`);
22
+ debug(`${AlertDialog.name} ⚡️ connect`);
25
23
  CleanupRegistry.register(el, onoff([
26
24
  { types: 'click', listener: this.#handleDialogClick },
27
25
  { types: 'close', listener: this.#handleDialogClose },
@@ -34,8 +32,7 @@ export class AlertDialog extends DialogBase {
34
32
  return false;
35
33
  return true;
36
34
  }), el).on());
37
- if (devFlags.debug)
38
- console.debug(`${AlertDialog.name} ⚡️ will-open`);
35
+ debug(`${AlertDialog.name} ⚡️ will-open`);
39
36
  el.removeAttribute('closing');
40
37
  el.scrollTop = 0;
41
38
  el.returnValue = '';
@@ -43,8 +40,7 @@ export class AlertDialog extends DialogBase {
43
40
  el.showModal();
44
41
  }
45
42
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
46
- if (devFlags.debug)
47
- console.debug(`${AlertDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
43
+ debug(`${AlertDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
48
44
  switch (attributeName) {
49
45
  case 'label':
50
46
  //
@@ -52,8 +48,7 @@ export class AlertDialog extends DialogBase {
52
48
  }
53
49
  }
54
50
  static #handleDialogClick = (evt) => {
55
- if (devFlags.debug)
56
- console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
51
+ debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
57
52
  const { target, currentTarget: dialog } = evt;
58
53
  if (!(dialog instanceof HTMLDialogElement))
59
54
  return;
@@ -73,8 +68,7 @@ export class AlertDialog extends DialogBase {
73
68
  evt.stopImmediatePropagation();
74
69
  };
75
70
  static #handleDialogCancel = (evt) => {
76
- if (devFlags.debug)
77
- console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
71
+ debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
78
72
  if (!evt.cancelable)
79
73
  return;
80
74
  const { target } = evt;
@@ -82,8 +76,7 @@ export class AlertDialog extends DialogBase {
82
76
  return;
83
77
  evt.preventDefault();
84
78
  target.inert = true;
85
- if (devFlags.debug)
86
- console.debug(`${AlertDialog.name} ⚡️ will-close`);
79
+ debug(`${AlertDialog.name} ⚡️ will-close`);
87
80
  target.setAttribute('closing', '');
88
81
  Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
89
82
  if (!target.hasAttribute('closing'))
@@ -93,8 +86,7 @@ export class AlertDialog extends DialogBase {
93
86
  });
94
87
  };
95
88
  static #handleDialogClose = ({ type, target }) => {
96
- if (devFlags.debug)
97
- console.debug(`${AlertDialog.name} ⚡️ ${type}`);
89
+ debug(`${AlertDialog.name} ⚡️ ${type}`);
98
90
  if (!(target instanceof HTMLDialogElement))
99
91
  return;
100
92
  target.remove();
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
2
+ import { debug, ensurePlaceholder, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
4
  import { Snapshot } from '../snapshot';
5
5
  /**
@@ -25,19 +25,16 @@ export class BorderedButton extends ButtonBase {
25
25
  super();
26
26
  }
27
27
  static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderedButton.name} ⚡️ disconnect`);
28
+ debug(`${BorderedButton.name} ⚡️ disconnect`);
30
29
  CleanupRegistry.unregister(el);
31
30
  }
32
31
  static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderedButton.name} ⚡️ connect`);
32
+ debug(`${BorderedButton.name} ⚡️ connect`);
35
33
  el.tabIndex = 0;
36
34
  CleanupRegistry.register(el, onoff('click', BorderedButton.#handleClick, el).on());
37
35
  }
38
36
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
37
+ debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
38
  const node = target instanceof HTMLButtonElement;
42
39
  if (!node)
43
40
  return;
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
2
+ import { debug, ensurePlaceholder, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
4
  import { Snapshot } from '../snapshot';
5
5
  /**
@@ -25,19 +25,16 @@ export class BorderedProminentButton extends ButtonBase {
25
25
  super();
26
26
  }
27
27
  static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
28
+ debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
30
29
  CleanupRegistry.unregister(el);
31
30
  }
32
31
  static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
32
+ debug(`${BorderedProminentButton.name} ⚡️ connect`);
35
33
  el.tabIndex = 0;
36
34
  CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
37
35
  }
38
36
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
37
+ debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
38
  const node = target instanceof HTMLButtonElement;
42
39
  if (!node)
43
40
  return;
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
2
+ import { debug, ensurePlaceholder, onoff } from '../internal/utils';
3
3
  import { ButtonBase } from '../namespace-browser/base';
4
4
  import { Snapshot } from '../snapshot';
5
5
  /**
@@ -25,19 +25,16 @@ export class BorderlessButton extends ButtonBase {
25
25
  super();
26
26
  }
27
27
  static polyfillDisconnectedCallback(el) {
28
- if (devFlags.debug)
29
- console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
28
+ debug(`${BorderlessButton.name} ⚡️ disconnect`);
30
29
  CleanupRegistry.unregister(el);
31
30
  }
32
31
  static polyfillConnectedCallback(el) {
33
- if (devFlags.debug)
34
- console.debug(`${BorderlessButton.name} ⚡️ connect`);
32
+ debug(`${BorderlessButton.name} ⚡️ connect`);
35
33
  el.tabIndex = 0;
36
34
  CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
37
35
  }
38
36
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
39
- if (devFlags.debug)
40
- console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
37
+ debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
41
38
  const node = target instanceof HTMLButtonElement;
42
39
  if (!node)
43
40
  return;
@@ -1,4 +1,4 @@
1
- import { devFlags } from '../internal/utils';
1
+ import { debug } from '../internal/utils';
2
2
  export class ColorScheme extends HTMLElement {
3
3
  static get observedAttributes() {
4
4
  return ['dark'];
@@ -7,18 +7,15 @@ export class ColorScheme extends HTMLElement {
7
7
  super();
8
8
  }
9
9
  connectedCallback() {
10
- if (devFlags.debug)
11
- console.debug(`${ColorScheme.name} ⚡️ connect`);
10
+ debug(`${ColorScheme.name} ⚡️ connect`);
12
11
  this.hidden = true;
13
12
  this.inert = true;
14
13
  }
15
14
  disconnectedCallback() {
16
- if (devFlags.debug)
17
- console.debug(`${ColorScheme.name} ⚡️ disconnect`);
15
+ debug(`${ColorScheme.name} ⚡️ disconnect`);
18
16
  }
19
17
  attributeChangedCallback(name, oldValue, newValue) {
20
- if (devFlags.debug)
21
- console.debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
18
+ debug(`${ColorScheme.name} ⚡️ attr-change [${name}]`);
22
19
  // self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(100% 0 0deg)' })
23
20
  if (newValue)
24
21
  self.CSS.registerProperty({ name: '--canvas', syntax: '<color>', inherits: false, initialValue: 'oklch(0% 0 0deg)' });
@@ -1,6 +1,6 @@
1
1
  import { confirmationDialog } from '../buses';
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { devFlags, isInside, onoff, touchGlass } from '../internal/utils';
3
+ import { debug, isInside, onoff, touchGlass } from '../internal/utils';
4
4
  import { DialogBase } from '../namespace-browser/base';
5
5
  /**
6
6
  * @summary A dialog that asks the user to confirm an action. Use it from the client module like `await confirmationDialog(trigger, 'Permanently erase the items in the Trash?')`.
@@ -13,8 +13,7 @@ export class ConfirmationDialog extends DialogBase {
13
13
  super();
14
14
  }
15
15
  static polyfillDisconnectedCallback(el) {
16
- if (devFlags.debug)
17
- console.debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
16
+ debug(`${ConfirmationDialog.name} ⚡️ disconnect`);
18
17
  const positionAnchor = el.style.getPropertyValue('position-anchor');
19
18
  document.querySelector(`[style*="${positionAnchor}"]`)?.style.removeProperty('anchor-name'); //$.prop('anchor-name', null, document.querySelector<HTMLElement>(`[style*="${positionAnchor}"]`))
20
19
  el.style.removeProperty('position-anchor'); //$.prop('position-anchor', null, el)
@@ -26,8 +25,7 @@ export class ConfirmationDialog extends DialogBase {
26
25
  }));
27
26
  }
28
27
  static polyfillConnectedCallback(el) {
29
- if (devFlags.debug)
30
- console.debug(`${ConfirmationDialog.name} ⚡️ connect`);
28
+ debug(`${ConfirmationDialog.name} ⚡️ connect`);
31
29
  CleanupRegistry.register(el, onoff([
32
30
  { types: 'click', listener: this.#handleDialogClick },
33
31
  { types: 'close', listener: this.#handleDialogClose },
@@ -41,8 +39,7 @@ export class ConfirmationDialog extends DialogBase {
41
39
  // if (!(event.target as HTMLElement).closest('menu-view[open]')) return false
42
40
  return true;
43
41
  }), el).on());
44
- if (devFlags.debug)
45
- console.debug(`${ConfirmationDialog.name} ⚡️ will-open`);
42
+ debug(`${ConfirmationDialog.name} ⚡️ will-open`);
46
43
  el.removeAttribute('closing');
47
44
  el.scrollTop = 0;
48
45
  el.returnValue = '';
@@ -50,8 +47,7 @@ export class ConfirmationDialog extends DialogBase {
50
47
  el.showModal();
51
48
  }
52
49
  static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
53
- if (devFlags.debug)
54
- console.debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
50
+ debug(`${ConfirmationDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
55
51
  // const newValue = (target as HTMLElement).getAttribute(attributeName ?? '')
56
52
  switch (attributeName) {
57
53
  case 'label':
@@ -64,8 +60,7 @@ export class ConfirmationDialog extends DialogBase {
64
60
  }
65
61
  }
66
62
  static #handleDialogClick = (evt) => {
67
- if (devFlags.debug)
68
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
63
+ debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
69
64
  const { target, currentTarget: dialog } = evt;
70
65
  if (!(dialog instanceof HTMLDialogElement))
71
66
  return;
@@ -87,8 +82,7 @@ export class ConfirmationDialog extends DialogBase {
87
82
  evt.stopImmediatePropagation();
88
83
  };
89
84
  static #handleDialogCancel = (evt) => {
90
- if (devFlags.debug)
91
- console.debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
85
+ debug(`${ConfirmationDialog.name} ⚡️ ${evt?.type}`);
92
86
  if (!evt.cancelable)
93
87
  return;
94
88
  const { target } = evt;
@@ -96,8 +90,7 @@ export class ConfirmationDialog extends DialogBase {
96
90
  return;
97
91
  evt.preventDefault();
98
92
  target.inert = true;
99
- if (devFlags.debug)
100
- console.debug(`${ConfirmationDialog.name} ⚡️ will-close`);
93
+ debug(`${ConfirmationDialog.name} ⚡️ will-close`);
101
94
  target.setAttribute('closing', '');
102
95
  Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
103
96
  if (!target.hasAttribute('closing'))
@@ -107,8 +100,7 @@ export class ConfirmationDialog extends DialogBase {
107
100
  });
108
101
  };
109
102
  static #handleDialogClose = ({ type, target }) => {
110
- if (devFlags.debug)
111
- console.debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
103
+ debug(`${ConfirmationDialog.name} ⚡️ ${type}`);
112
104
  if (!(target instanceof HTMLDialogElement))
113
105
  return;
114
106
  target.remove();
@@ -9,7 +9,7 @@
9
9
  *
10
10
  * @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
11
11
  *
12
- * @slot — The default slot.
12
+ * @slot — The default slot
13
13
  * @slot description
14
14
  * @slot actions
15
15
  *
@@ -1,6 +1,6 @@
1
1
  import { I18n } from '../i18n';
2
2
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
- import { $, devFlags, onoff } from '../internal/utils';
3
+ import { $, debug, onoff } from '../internal/utils';
4
4
  import { html } from '../tpl';
5
5
  /**
6
6
  * @summary A message with a title and extra information that you show when part of your app can’t be used.
@@ -13,7 +13,7 @@ import { html } from '../tpl';
13
13
  *
14
14
  * @example <content-unavailable padding><label-view title="No Mail"><svg slot="icon" foreground="secondary" ...>...</svg></label-view><label-view title="New mails you receive will appear here." foreground="secondary" slot="description"></label-view><button is="borderless-button" type="button" tabindex="0" slot="actions"><label-view title="Switch Account"></label-view></button></content-unavailable>
15
15
  *
16
- * @slot — The default slot.
16
+ * @slot — The default slot
17
17
  * @slot description
18
18
  * @slot actions
19
19
  *
@@ -47,8 +47,7 @@ export class ContentUnavailable extends HTMLElement {
47
47
  };
48
48
  }
49
49
  attributeChangedCallback(name, oldValue, newValue) {
50
- if (devFlags.debug)
51
- console.debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
50
+ debug(`${ContentUnavailable.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
52
51
  switch (name) {
53
52
  case 'search':
54
53
  if (oldValue === newValue)
@@ -62,12 +61,10 @@ export class ContentUnavailable extends HTMLElement {
62
61
  }
63
62
  }
64
63
  disconnectedCallback() {
65
- if (devFlags.debug)
66
- console.debug(`${ContentUnavailable.name} ⚡️ disconnect`);
64
+ debug(`${ContentUnavailable.name} ⚡️ disconnect`);
67
65
  }
68
66
  connectedCallback() {
69
- if (devFlags.debug)
70
- console.debug(`${ContentUnavailable.name} ⚡️ connect`);
67
+ debug(`${ContentUnavailable.name} ⚡️ connect`);
71
68
  }
72
69
  #renderSearch = (search) => {
73
70
  const titleLabel = this.querySelector(':scope>:not([slot])') ?? this.appendChild($(html `<label-view><i class="ph ph-magnifying-glass" slot="icon" foreground="secondary"></i></label-view>`, '>1')), descText = this.querySelector(':scope>[slot=description]') ?? this.appendChild($(html `<label-view foreground="secondary" slot="description"></label-view>`, '>1'));
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
3
3
  */
4
- export declare class BodyView extends HTMLElement {
4
+ export declare class ContentView extends HTMLElement {
5
5
  constructor();
6
6
  disconnectedCallback(): void;
7
7
  connectedCallback(): void;
8
8
  }
9
9
  declare global {
10
10
  interface HTMLElementTagNameMap {
11
- 'body-view': BodyView;
11
+ 'content-view': ContentView;
12
12
  }
13
13
  }
@@ -0,0 +1,15 @@
1
+ import { debug } from '../internal/utils';
2
+ /**
3
+ * @summary A container view that wraps a scroll view, marking it as a screen your app can navigate to.
4
+ */
5
+ export class ContentView extends HTMLElement {
6
+ constructor() {
7
+ super();
8
+ }
9
+ disconnectedCallback() {
10
+ debug(`${ContentView.name} ⚡️ disconnect`);
11
+ }
12
+ connectedCallback() {
13
+ debug(`${ContentView.name} ⚡️ connect`);
14
+ }
15
+ }
@@ -3,7 +3,7 @@ import { I18n } from '../i18n';
3
3
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
4
4
  import { FormAssociatedBase, getInternals } from '../internal/class/form-associated-base';
5
5
  import { MutationObserverSet } from '../internal/class/mutation-observer-set';
6
- import { $, clamp, devFlags, kebabCase, onoff, set } from '../internal/utils';
6
+ import { $, clamp, debug, kebabCase, onoff, set } from '../internal/utils';
7
7
  import { queryMorph } from '../morphdom';
8
8
  import { html } from '../tpl';
9
9
  const datePickerStyles = ['graphical', 'field', 'automatic'];
@@ -37,8 +37,7 @@ export class DatePicker extends FormAssociatedBase {
37
37
  static #templates = new Map();
38
38
  // #lastRenderedStyle?: DatePickerStyle //string | null
39
39
  #renderValidityMsgs = (entries) => {
40
- if (devFlags.debug)
41
- console.debug(`${_a.name} ⚡️ mutation`);
40
+ debug(`${_a.name} ⚡️ mutation`);
42
41
  this.setValidity(this.validity, this.validationMessage);
43
42
  };
44
43
  #shadowRoot;
@@ -76,8 +75,7 @@ export class DatePicker extends FormAssociatedBase {
76
75
  this.#shadowRoot = this.attachShadow({ mode: 'closed' });
77
76
  }
78
77
  attributeChangedCallback(name, oldValue, newValue) {
79
- if (devFlags.debug)
80
- console.debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
78
+ debug(`${_a.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`);
81
79
  switch (name) {
82
80
  case 'selection':
83
81
  // nothing happens// const [y = '', m = '', d = ''] = (newValue ?? '').split(/\D+/)
@@ -130,8 +128,7 @@ export class DatePicker extends FormAssociatedBase {
130
128
  return datePickerStyles.includes(this.getAttribute('date-picker-style') ?? '') ? this.getAttribute('date-picker-style') : 'automatic';
131
129
  }
132
130
  #render() {
133
- if (devFlags.debug)
134
- console.debug(`${_a.name} ⚡️ #render (${this.datePickerStyle})`);
131
+ debug(`${_a.name} ⚡️ #render (${this.datePickerStyle})`);
135
132
  // if (this.#lastRenderedStyle === this.datePickerStyle) return // skip if already applied
136
133
  // this.#lastRenderedStyle = this.datePickerStyle
137
134
  // clear shadow DOM
@@ -175,8 +172,7 @@ export class DatePicker extends FormAssociatedBase {
175
172
  }
176
173
  }
177
174
  #handleValiditiesSlotchange = ({ type, target: slot }) => {
178
- if (devFlags.debug)
179
- console.debug(`${_a.name} ⚡️ ${type}`);
175
+ debug(`${_a.name} ⚡️ ${type}`);
180
176
  if (!(slot instanceof HTMLSlotElement))
181
177
  return;
182
178
  const assigned = slot.assignedElements();
@@ -204,8 +200,7 @@ export class DatePicker extends FormAssociatedBase {
204
200
  }
205
201
  }
206
202
  #handleClick = (evt) => {
207
- if (devFlags.debug)
208
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
203
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
209
204
  const { target } = evt;
210
205
  if (!(target instanceof HTMLElement))
211
206
  return;
@@ -248,8 +243,7 @@ export class DatePicker extends FormAssociatedBase {
248
243
  this.dispatchEvent(new CustomEvent('selection', { detail: { selection }, bubbles: true, composed: true }));
249
244
  };
250
245
  #handleInputPaste = (evt) => {
251
- if (devFlags.debug)
252
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
246
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
253
247
  const { target: input } = evt;
254
248
  if (!(input instanceof HTMLInputElement))
255
249
  return;
@@ -271,8 +265,7 @@ export class DatePicker extends FormAssociatedBase {
271
265
  this.#sendValueToForm();
272
266
  };
273
267
  #handleInputBeforeinput = (evt) => {
274
- if (devFlags.debug)
275
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
268
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
276
269
  const { target: input } = evt;
277
270
  if (!(input instanceof HTMLInputElement))
278
271
  return;
@@ -295,8 +288,7 @@ export class DatePicker extends FormAssociatedBase {
295
288
  }
296
289
  };
297
290
  #handleInputKeydown = ({ type, target, key }) => {
298
- if (devFlags.debug)
299
- console.debug(`${_a.name} ⚡️ ${type}`);
291
+ debug(`${_a.name} ⚡️ ${type}`);
300
292
  if (!(target instanceof HTMLInputElement))
301
293
  return;
302
294
  const input = target;
@@ -315,14 +307,12 @@ export class DatePicker extends FormAssociatedBase {
315
307
  this.#inputs[index]?.focus();
316
308
  };
317
309
  #handleInputFocus = (evt) => {
318
- if (devFlags.debug)
319
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
310
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
320
311
  for (const input of this.#inputs)
321
312
  input.classList.toggle('focus', input === evt.target);
322
313
  };
323
314
  #handleInputBlur = ({ target, type }) => {
324
- if (devFlags.debug)
325
- console.debug(`${_a.name} ⚡️ ${type}`);
315
+ debug(`${_a.name} ⚡️ ${type}`);
326
316
  if (!(target instanceof HTMLInputElement))
327
317
  return;
328
318
  const input = target;
@@ -335,8 +325,7 @@ export class DatePicker extends FormAssociatedBase {
335
325
  this.#sendValueToForm();
336
326
  };
337
327
  #handleInputInput = (evt) => {
338
- if (devFlags.debug)
339
- console.debug(`${_a.name} ⚡️ ${evt?.type}`);
328
+ debug(`${_a.name} ⚡️ ${evt?.type}`);
340
329
  this.#sendValueToForm();
341
330
  };
342
331
  /**
@@ -447,8 +436,7 @@ export class DatePicker extends FormAssociatedBase {
447
436
  message = kebabCase(key);
448
437
  break;
449
438
  }
450
- if (devFlags.debug)
451
- console.debug(`${_a.name} ⚡️ validity-change`);
439
+ debug(`${_a.name} ⚡️ validity-change`);
452
440
  return this.#internals.setValidity(flags, this.#customValidity || message, anchor ?? this.#inputs.at(0));
453
441
  };
454
442
  setCustomValidity = (message) => {
@@ -0,0 +1,11 @@
1
+ export declare class DetailPlaceholder extends HTMLElement {
2
+ constructor();
3
+ connectedCallback(): void;
4
+ disconnectedCallback(): void;
5
+ attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
6
+ }
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'detail-placeholder': DetailPlaceholder;
10
+ }
11
+ }
@@ -0,0 +1,15 @@
1
+ import { debug } from '../internal/utils';
2
+ export class DetailPlaceholder extends HTMLElement {
3
+ constructor() {
4
+ super();
5
+ }
6
+ connectedCallback() {
7
+ debug(`${DetailPlaceholder.name} ⚡️ connect`);
8
+ }
9
+ disconnectedCallback() {
10
+ debug(`${DetailPlaceholder.name} ⚡️ disconnect`);
11
+ }
12
+ attributeChangedCallback(name, oldValue, newValue) {
13
+ debug(`${DetailPlaceholder.name} ⚡️ attr-change [${name}]`);
14
+ }
15
+ }
@@ -1,5 +1,5 @@
1
1
  import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
- import { cssTime, devFlags, onoff, timeout } from '../internal/utils';
2
+ import { cssTime, debug, onoff, timeout } from '../internal/utils';
3
3
  import { DetailsBase } from '../namespace-browser/base';
4
4
  const toggleTimers = new WeakMap();
5
5
  /**
@@ -24,18 +24,15 @@ export class DisclosureGroup extends DetailsBase {
24
24
  super();
25
25
  }
26
26
  attributeChangedCallback(name, oldValue, newValue) {
27
- if (devFlags.debug)
28
- console.debug(`${DisclosureGroup.name} ⚡️ attr-change [${name}]`);
27
+ debug(`${DisclosureGroup.name} ⚡️ attr-change [${name}]`);
29
28
  // if (CSS.supports('interpolate-size', 'allow-keywords')) return
30
29
  }
31
30
  static polyfillDisconnectedCallback(el) {
32
- if (devFlags.debug)
33
- console.debug(`${DisclosureGroup.name} ⚡️ disconnect`);
31
+ debug(`${DisclosureGroup.name} ⚡️ disconnect`);
34
32
  CleanupRegistry.unregister(el);
35
33
  }
36
34
  static polyfillConnectedCallback(el) {
37
- if (devFlags.debug)
38
- console.debug(`${DisclosureGroup.name} ⚡️ connect`);
35
+ debug(`${DisclosureGroup.name} ⚡️ connect`);
39
36
  const newValue = el.open ? 'open' : 'closed';
40
37
  if (newValue !== el.dataset.state)
41
38
  el.dataset.state = newValue;
@@ -46,8 +43,7 @@ export class DisclosureGroup extends DetailsBase {
46
43
  });
47
44
  }
48
45
  static #handleToggle = async ({ type, currentTarget: details }) => {
49
- if (devFlags.debug)
50
- console.debug(`${DisclosureGroup.name} ⚡️ ${type}`);
46
+ debug(`${DisclosureGroup.name} ⚡️ ${type}`);
51
47
  if (!(details instanceof HTMLDetailsElement))
52
48
  return;
53
49
  const newValue = details.open ? 'opening' : 'closing';