@swiftwc/ui 0.0.0-dev.4 → 0.0.0-dev.41

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 (314) hide show
  1. package/README.md +15 -0
  2. package/generated/buses/alert-dialog.d.ts +2 -0
  3. package/generated/buses/alert-dialog.js +1 -0
  4. package/generated/buses/confirmation-dialog.d.ts +2 -0
  5. package/generated/buses/confirmation-dialog.js +1 -0
  6. package/generated/buses/index.d.ts +6 -0
  7. package/generated/buses/index.js +6 -0
  8. package/generated/buses/lifecycle-observer.d.ts +2 -0
  9. package/generated/buses/lifecycle-observer.js +1 -0
  10. package/generated/client/index.d.ts +24 -0
  11. package/generated/client/index.js +272 -0
  12. package/generated/components/alert-dialog.d.ts +8 -0
  13. package/generated/components/alert-dialog.js +99 -0
  14. package/generated/components/body-view.d.ts +5 -0
  15. package/generated/components/body-view.js +14 -0
  16. package/generated/components/bordered-button.d.ts +13 -0
  17. package/generated/components/bordered-button.js +45 -0
  18. package/generated/components/bordered-prominent-button.d.ts +13 -0
  19. package/generated/components/bordered-prominent-button.js +45 -0
  20. package/generated/components/borderless-button.d.ts +13 -0
  21. package/generated/components/borderless-button.js +45 -0
  22. package/generated/components/confirmation-dialog.d.ts +9 -0
  23. package/generated/components/confirmation-dialog.js +113 -0
  24. package/generated/components/content-unavailable-view.d.ts +24 -0
  25. package/generated/components/content-unavailable-view.js +81 -0
  26. package/generated/components/date-picker.d.ts +36 -0
  27. package/generated/components/date-picker.js +468 -0
  28. package/generated/components/disclosure-group.d.ts +9 -0
  29. package/generated/components/disclosure-group.js +58 -0
  30. package/generated/components/fine-tooltip.d.ts +7 -0
  31. package/generated/components/fine-tooltip.js +107 -0
  32. package/generated/components/form-view.d.ts +6 -0
  33. package/generated/components/form-view.js +60 -0
  34. package/generated/components/glass-button.d.ts +12 -0
  35. package/generated/components/glass-button.js +42 -0
  36. package/generated/components/glass-prominent-button.d.ts +12 -0
  37. package/generated/components/glass-prominent-button.js +42 -0
  38. package/generated/components/index.d.ts +42 -0
  39. package/generated/components/index.js +42 -0
  40. package/generated/components/label-view.d.ts +9 -0
  41. package/generated/components/label-view.js +59 -0
  42. package/generated/components/list-view.d.ts +5 -0
  43. package/generated/components/list-view.js +29 -0
  44. package/generated/components/menu-view.d.ts +9 -0
  45. package/generated/components/menu-view.js +145 -0
  46. package/generated/components/navigation-large-title.d.ts +6 -0
  47. package/generated/components/navigation-large-title.js +181 -0
  48. package/generated/components/navigation-split-view.d.ts +10 -0
  49. package/generated/components/navigation-split-view.js +25 -0
  50. package/generated/components/navigation-stack.d.ts +10 -0
  51. package/generated/components/navigation-stack.js +31 -0
  52. package/generated/components/navigation-title.d.ts +8 -0
  53. package/generated/components/navigation-title.js +52 -0
  54. package/generated/components/picker-view.d.ts +28 -0
  55. package/generated/components/picker-view.js +697 -0
  56. package/generated/components/plain-button.d.ts +7 -0
  57. package/generated/components/plain-button.js +22 -0
  58. package/generated/components/progress-view.d.ts +13 -0
  59. package/generated/components/progress-view.js +125 -0
  60. package/generated/components/screen-view.d.ts +5 -0
  61. package/generated/components/screen-view.js +11 -0
  62. package/generated/components/scroll-view-proxy.d.ts +8 -0
  63. package/generated/components/scroll-view-proxy.js +17 -0
  64. package/generated/components/scroll-view.d.ts +10 -0
  65. package/generated/components/scroll-view.js +202 -0
  66. package/generated/components/search-view.d.ts +8 -0
  67. package/generated/components/search-view.js +30 -0
  68. package/generated/components/section-view.d.ts +9 -0
  69. package/generated/components/section-view.js +83 -0
  70. package/generated/components/sheet-view.d.ts +8 -0
  71. package/generated/components/sheet-view.js +62 -0
  72. package/generated/components/sidebar-toggle.d.ts +7 -0
  73. package/generated/components/sidebar-toggle.js +85 -0
  74. package/generated/components/sidebar-view.d.ts +7 -0
  75. package/generated/components/sidebar-view.js +34 -0
  76. package/generated/components/sticky-container.d.ts +6 -0
  77. package/generated/components/sticky-container.js +26 -0
  78. package/generated/components/tab-bar.d.ts +10 -0
  79. package/generated/components/tab-bar.js +43 -0
  80. package/generated/components/tab-item.d.ts +7 -0
  81. package/generated/components/tab-item.js +132 -0
  82. package/generated/components/tab-view.d.ts +22 -0
  83. package/generated/components/tab-view.js +264 -0
  84. package/generated/components/table-view.d.ts +7 -0
  85. package/generated/components/table-view.js +174 -0
  86. package/generated/components/text-field.d.ts +29 -0
  87. package/generated/components/text-field.js +503 -0
  88. package/generated/components/tool-bar-item-group.d.ts +5 -0
  89. package/generated/components/tool-bar-item-group.js +28 -0
  90. package/generated/components/tool-bar-item.d.ts +8 -0
  91. package/generated/components/tool-bar-item.js +66 -0
  92. package/generated/components/tool-bar.d.ts +19 -0
  93. package/generated/components/tool-bar.js +93 -0
  94. package/generated/components/v-keyboard.d.ts +15 -0
  95. package/generated/components/v-keyboard.js +89 -0
  96. package/generated/components/v-stack.d.ts +10 -0
  97. package/generated/components/v-stack.js +19 -0
  98. package/generated/css/index.css +8089 -0
  99. package/generated/events/alert-dialog.d.ts +8 -0
  100. package/generated/events/alert-dialog.js +1 -0
  101. package/generated/events/confirmation-dialog.d.ts +9 -0
  102. package/generated/events/confirmation-dialog.js +1 -0
  103. package/generated/events/date-picker.d.ts +8 -0
  104. package/generated/events/date-picker.js +1 -0
  105. package/generated/events/index.d.ts +8 -0
  106. package/generated/events/index.js +8 -0
  107. package/generated/events/lifecycle-observer.d.ts +10 -0
  108. package/generated/events/lifecycle-observer.js +1 -0
  109. package/generated/events/picker-view.d.ts +15 -0
  110. package/generated/events/picker-view.js +1 -0
  111. package/generated/events/scroll-view.d.ts +10 -0
  112. package/generated/events/scroll-view.js +1 -0
  113. package/generated/events/tab-view.d.ts +28 -0
  114. package/generated/events/tab-view.js +1 -0
  115. package/generated/events/text-field.d.ts +8 -0
  116. package/generated/events/text-field.js +1 -0
  117. package/generated/i18n/index.d.ts +34 -0
  118. package/generated/i18n/index.js +167 -0
  119. package/generated/i18n/locales/el.d.ts +16 -0
  120. package/generated/i18n/locales/el.js +16 -0
  121. package/generated/i18n/locales/en.d.ts +16 -0
  122. package/generated/i18n/locales/en.js +16 -0
  123. package/generated/i18n/locales/index.d.ts +4 -0
  124. package/generated/i18n/locales/index.js +4 -0
  125. package/generated/index.d.ts +2 -0
  126. package/generated/index.js +3 -0
  127. package/generated/internal/class/cleanup-registry.d.ts +5 -0
  128. package/generated/internal/class/cleanup-registry.js +38 -0
  129. package/generated/internal/class/css-style-observer.d.ts +8 -0
  130. package/generated/internal/class/css-style-observer.js +26 -0
  131. package/generated/internal/class/form-associated-base.d.ts +16 -0
  132. package/generated/internal/class/form-associated-base.js +78 -0
  133. package/generated/internal/class/mutation-observer-set.d.ts +9 -0
  134. package/generated/internal/class/mutation-observer-set.js +42 -0
  135. package/generated/internal/class/mutation-observer-singleton.d.ts +10 -0
  136. package/generated/internal/class/mutation-observer-singleton.js +64 -0
  137. package/generated/internal/class/navigation-path.d.ts +15 -0
  138. package/generated/internal/class/navigation-path.js +84 -0
  139. package/generated/internal/class/navigation-view.d.ts +8 -0
  140. package/generated/internal/class/navigation-view.js +79 -0
  141. package/generated/internal/class/resize-observer-singleton.d.ts +7 -0
  142. package/generated/internal/class/resize-observer-singleton.js +22 -0
  143. package/generated/internal/decorators/adaptive-slot.d.ts +1 -0
  144. package/generated/internal/decorators/adaptive-slot.js +50 -0
  145. package/generated/internal/decorators/custom-element.d.ts +5 -0
  146. package/generated/internal/decorators/custom-element.js +5 -0
  147. package/generated/internal/decorators/index.d.ts +4 -0
  148. package/generated/internal/decorators/index.js +4 -0
  149. package/generated/internal/privateNamespace.d.ts +14 -0
  150. package/generated/internal/privateNamespace.js +168 -0
  151. package/generated/internal/utils/add.d.ts +1 -0
  152. package/generated/internal/utils/add.js +7 -0
  153. package/generated/internal/utils/cash/ancestors.d.ts +1 -0
  154. package/generated/internal/utils/cash/ancestors.js +27 -0
  155. package/generated/internal/utils/cash/index.d.ts +23 -0
  156. package/generated/internal/utils/cash/index.js +25 -0
  157. package/generated/internal/utils/cash/next-all.d.ts +1 -0
  158. package/generated/internal/utils/cash/next-all.js +10 -0
  159. package/generated/internal/utils/cash/next.d.ts +1 -0
  160. package/generated/internal/utils/cash/next.js +9 -0
  161. package/generated/internal/utils/cash/prev-all.d.ts +1 -0
  162. package/generated/internal/utils/cash/prev-all.js +10 -0
  163. package/generated/internal/utils/cash/prev.d.ts +1 -0
  164. package/generated/internal/utils/cash/prev.js +9 -0
  165. package/generated/internal/utils/cash/prop.d.ts +18 -0
  166. package/generated/internal/utils/cash/prop.js +30 -0
  167. package/generated/internal/utils/cash/siblings.d.ts +1 -0
  168. package/generated/internal/utils/cash/siblings.js +10 -0
  169. package/generated/internal/utils/clamp.d.ts +1 -0
  170. package/generated/internal/utils/clamp.js +4 -0
  171. package/generated/internal/utils/compare-big-decimals.d.ts +1 -0
  172. package/generated/internal/utils/compare-big-decimals.js +90 -0
  173. package/generated/internal/utils/css-time.d.ts +1 -0
  174. package/generated/internal/utils/css-time.js +3 -0
  175. package/generated/internal/utils/debounce.d.ts +1 -0
  176. package/generated/internal/utils/debounce.js +13 -0
  177. package/generated/internal/utils/dev-flags.d.ts +3 -0
  178. package/generated/internal/utils/dev-flags.js +5 -0
  179. package/generated/internal/utils/ensure-placeholder.d.ts +1 -0
  180. package/generated/internal/utils/ensure-placeholder.js +55 -0
  181. package/generated/internal/utils/frame.d.ts +1 -0
  182. package/generated/internal/utils/frame.js +6 -0
  183. package/generated/internal/utils/index.d.ts +19 -0
  184. package/generated/internal/utils/index.js +22 -0
  185. package/generated/internal/utils/is-inside.d.ts +1 -0
  186. package/generated/internal/utils/is-inside.js +4 -0
  187. package/generated/internal/utils/kebab-case.d.ts +1 -0
  188. package/generated/internal/utils/kebab-case.js +11 -0
  189. package/generated/internal/utils/list-active.d.ts +7 -0
  190. package/generated/internal/utils/list-active.js +83 -0
  191. package/generated/internal/utils/microtask.d.ts +1 -0
  192. package/generated/internal/utils/microtask.js +3 -0
  193. package/generated/internal/utils/onoff.d.ts +45 -0
  194. package/generated/internal/utils/onoff.js +31 -0
  195. package/generated/internal/utils/set.d.ts +1 -0
  196. package/generated/internal/utils/set.js +7 -0
  197. package/generated/internal/utils/sleep.d.ts +1 -0
  198. package/generated/internal/utils/sleep.js +3 -0
  199. package/generated/internal/utils/slow-hide-show.d.ts +1 -0
  200. package/generated/internal/utils/slow-hide-show.js +16 -0
  201. package/generated/internal/utils/timeout.d.ts +5 -0
  202. package/generated/internal/utils/timeout.js +16 -0
  203. package/generated/internal/utils/touch-glass.d.ts +7 -0
  204. package/generated/internal/utils/touch-glass.js +19 -0
  205. package/generated/namespace-browser/base.d.ts +45 -0
  206. package/generated/namespace-browser/base.js +115 -0
  207. package/generated/namespace-browser/index.d.ts +7 -0
  208. package/generated/namespace-browser/index.js +1 -0
  209. package/generated/snapshot/index.d.ts +9 -0
  210. package/generated/snapshot/index.js +60 -0
  211. package/package.json +35 -11
  212. package/scss/_components.scss +59 -14
  213. package/scss/_final.scss +1 -0
  214. package/scss/_functions.scss +10 -0
  215. package/scss/_mixins.scss +4 -169
  216. package/scss/_placeholders.scss +3 -0
  217. package/scss/_transitions.scss +22 -1
  218. package/scss/_utils.scss +9 -0
  219. package/scss/_vars.scss +142 -23
  220. package/scss/base/_layout.scss +31 -16
  221. package/scss/base/_reboot.scss +151 -15
  222. package/scss/base/_root.scss +355 -25
  223. package/scss/colors/_index.scss +672 -70
  224. package/scss/components/_alert-dialog.scss +111 -0
  225. package/scss/components/_body-view.scss +12 -3
  226. package/scss/components/_bordered-button.scss +57 -0
  227. package/scss/components/_bordered-prominent-button.scss +63 -0
  228. package/scss/components/_borderless-button.scss +36 -6
  229. package/scss/components/_confirmation-dialog.scss +84 -0
  230. package/scss/components/_content-unavailable-view.scss +45 -0
  231. package/scss/components/_date-picker.scss +30 -0
  232. package/scss/components/_detail-placeholder.scss +153 -0
  233. package/scss/components/_disclosure-group.scss +146 -51
  234. package/scss/components/_fine-tooltip.scss +82 -0
  235. package/scss/components/_form-view.scss +195 -0
  236. package/scss/components/_full-screen.scss +7 -5
  237. package/scss/components/_glass-button.scss +59 -0
  238. package/scss/components/_glass-prominent-button.scss +68 -0
  239. package/scss/components/_h-divider.scss +13 -0
  240. package/scss/components/_h-flex-stack.scss +23 -0
  241. package/scss/components/_h-stack.scss +29 -0
  242. package/scss/components/_index.scss +234 -7
  243. package/scss/components/_label-view copy.scss.txt +420 -0
  244. package/scss/components/_label-view.scss +355 -0
  245. package/scss/components/_label-view.scss.txt +536 -0
  246. package/scss/components/_labeled-content.scss +9 -0
  247. package/scss/components/_list-view.scss +229 -0
  248. package/scss/components/_menu-view.scss +211 -0
  249. package/scss/components/_navigation-large-title.scss +27 -0
  250. package/scss/components/_navigation-split-view.scss +329 -269
  251. package/scss/components/_navigation-stack.scss +6 -6
  252. package/scss/components/_navigation-title.scss +10 -0
  253. package/scss/components/_picker-view.scss +131 -0
  254. package/scss/components/_plain-button.scss +18 -0
  255. package/scss/components/_progress-view.scss +98 -0
  256. package/scss/components/_scroll-view-proxy.scss +79 -0
  257. package/scss/components/_scroll-view-toolbars.scss +126 -0
  258. package/scss/components/_scroll-view.scss +114 -66
  259. package/scss/components/_search-view.scss +18 -0
  260. package/scss/components/_section-view.scss +119 -0
  261. package/scss/components/_sheet-view.scss +78 -35
  262. package/scss/components/_sidebar-toggle.scss +87 -27
  263. package/scss/components/_sidebar-view.scss +30 -40
  264. package/scss/components/_sticky-container.scss +42 -0
  265. package/scss/components/_tab-bar.scss +207 -84
  266. package/scss/components/_tab-item.scss +25 -0
  267. package/scss/components/_tab-view.scss +270 -126
  268. package/scss/components/_table-column.scss +52 -0
  269. package/scss/components/_table-row.scss +172 -0
  270. package/scss/components/_table-view.scss +223 -0
  271. package/scss/components/_text-field.scss +37 -0
  272. package/scss/components/_tool-bar-item-group.scss +30 -19
  273. package/scss/components/_tool-bar-item.scss +81 -71
  274. package/scss/components/_tool-bar.scss +126 -63
  275. package/scss/components/_v-divider.scss +13 -0
  276. package/scss/components/_v-flex-stack.scss +29 -0
  277. package/scss/components/_v-keyboard.scss +6 -4
  278. package/scss/components/_v-stack.scss +15 -9
  279. package/scss/final/_touch-glass.scss +91 -0
  280. package/scss/index.scss +6 -2
  281. package/scss/mixins/_button.scss +44 -0
  282. package/scss/mixins/_color.scss +16 -0
  283. package/scss/mixins/_dialog.scss +89 -0
  284. package/scss/mixins/_index.scss +422 -0
  285. package/scss/placeholders/_buttons.scss +117 -0
  286. package/scss/placeholders/_lists.scss +571 -0
  287. package/scss/transitions/_alert-dialog.scss +18 -0
  288. package/scss/transitions/_bwd.navbar.scss +3 -13
  289. package/scss/transitions/_bwd.scss +4 -20
  290. package/scss/transitions/_confirmation-dialog.scss +22 -0
  291. package/scss/transitions/_disclosure-group.scss +35 -0
  292. package/scss/transitions/_fine-tooltip.scss +21 -0
  293. package/scss/transitions/_fwd.navbar.scss +4 -9
  294. package/scss/transitions/_fwd.scss +4 -34
  295. package/scss/transitions/_glass-button.scss +12 -0
  296. package/scss/transitions/_glass-prominent-button.scss +12 -0
  297. package/scss/transitions/_index.scss +35 -143
  298. package/scss/transitions/_menu-view.scss +26 -0
  299. package/scss/transitions/_navigation-split-view.scss +23 -0
  300. package/scss/transitions/_progress-view.scss +23 -0
  301. package/scss/transitions/_sheet-view.scss +30 -0
  302. package/scss/transitions/_sidebar-view.scss +36 -0
  303. package/scss/transitions/_tab-bar.scss +20 -0
  304. package/scss/utils/_frame.scss +91 -0
  305. package/scss/utils/_index.scss +91 -0
  306. package/scss/utils/_scroll-view.scss +14 -0
  307. package/scss/utils/_spacing.scss +25 -0
  308. package/scss/utils/_stacks.scss +209 -0
  309. package/web-components.html-data/en.json +500 -0
  310. package/generated/styles.css +0 -1305
  311. package/scss/_dev.scss +0 -68
  312. package/scss/components/_tab-bar-stack.scss +0 -101
  313. package/scss/components/_toolbars.scss +0 -100
  314. package/scss/transitions/_dialog.scss +0 -32
package/README.md ADDED
@@ -0,0 +1,15 @@
1
+ # @swiftwc/ui
2
+
3
+ [README](https://github.com/swiftwc/ui/blob/main/README.md)
4
+
5
+ ## Documentation
6
+
7
+ Visit [swiftwc.github.io/ui/](https://swiftwc.github.io/ui/) to view the documentation.
8
+
9
+ ## Contributing
10
+
11
+ Please read the [contributing guide](https://github.com/swiftwc/ui/blob/main/CONTRIBUTING.md).
12
+
13
+ ## License
14
+
15
+ Licensed under the [MIT license](https://github.com/swiftwc/ui/blob/main/LICENSE.md).
@@ -0,0 +1,2 @@
1
+ declare const _default: EventTarget;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default new EventTarget();
@@ -0,0 +1,2 @@
1
+ declare const _default: EventTarget;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default new EventTarget();
@@ -0,0 +1,6 @@
1
+ export { default as alertDialog } from './alert-dialog';
2
+ export * from './alert-dialog';
3
+ export { default as confirmationDialog } from './confirmation-dialog';
4
+ export * from './confirmation-dialog';
5
+ export { default as lifecycleObserver } from './lifecycle-observer';
6
+ export * from './lifecycle-observer';
@@ -0,0 +1,6 @@
1
+ export { default as alertDialog } from './alert-dialog';
2
+ export * from './alert-dialog';
3
+ export { default as confirmationDialog } from './confirmation-dialog';
4
+ export * from './confirmation-dialog';
5
+ export { default as lifecycleObserver } from './lifecycle-observer';
6
+ export * from './lifecycle-observer';
@@ -0,0 +1,2 @@
1
+ declare const _default: EventTarget;
2
+ export default _default;
@@ -0,0 +1 @@
1
+ export default new EventTarget();
@@ -0,0 +1,24 @@
1
+ import { lifecycleObserver } from '../buses';
2
+ import { I18n } from '../i18n';
3
+ import { NavigationPath } from '../internal/class/navigation-path';
4
+ import { type NavigationHost, queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
5
+ import { type WebComponentCtor } from '../namespace-browser';
6
+ import { Snapshot } from '../snapshot';
7
+ export declare const polyfills: Map<string, WebComponentCtor>;
8
+ export declare const alert: (title?: string, message?: string, actions?: {
9
+ label?: string;
10
+ image?: string;
11
+ role?: string;
12
+ }[], options?: {
13
+ titleVisibility?: boolean;
14
+ }) => Promise<void>;
15
+ export declare const confirmationDialog: (trigger: HTMLElement, title: string, message?: string, actions?: {
16
+ label?: string;
17
+ image?: string;
18
+ role?: string;
19
+ }[], options?: {
20
+ controller?: AbortController;
21
+ titleVisibility?: boolean;
22
+ }) => Promise<string>;
23
+ export { I18n, lifecycleObserver, NavigationPath, queryInsertPosition, Snapshot, startViewTransition };
24
+ export { type NavigationHost };
@@ -0,0 +1,272 @@
1
+ import { alertDialog, confirmationDialog as confirmationDialogBus, lifecycleObserver } from '../buses';
2
+ import * as Components from '../components';
3
+ import { I18n } from '../i18n';
4
+ import { NavigationPath } from '../internal/class/navigation-path';
5
+ import { queryInsertPosition, startViewTransition } from '../internal/privateNamespace';
6
+ import { $, devFlags, kebabCase, onoff } from '../internal/utils';
7
+ import { Snapshot } from '../snapshot';
8
+ //#region polyfills
9
+ export const polyfills = new Map();
10
+ for (const [k, Ctor] of Object.entries(Components)) {
11
+ const is = kebabCase(k);
12
+ if ('polyfillExtends' in Ctor && 'string' === typeof Ctor.polyfillExtends) {
13
+ if (customElements.get(is))
14
+ continue;
15
+ customElements.define(is, Ctor, { extends: Ctor.polyfillExtends });
16
+ if (!(document.createElement(Ctor.polyfillExtends, { is }) instanceof Ctor))
17
+ polyfills.set(is, Ctor);
18
+ // const testEl = document.createElement('template')
19
+ // testEl.innerHTML = `<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`
20
+ // const testNode = testEl.content.firstElementChild,
21
+ if (!($(`<${Ctor.polyfillExtends} is="${is}"></${Ctor.polyfillExtends}>`, '>1') instanceof Ctor))
22
+ polyfills.set(is, Ctor);
23
+ continue;
24
+ }
25
+ if (!customElements.get(is))
26
+ customElements.define(is, Ctor);
27
+ }
28
+ if (devFlags.debug)
29
+ console.debug(polyfills);
30
+ if (0 < polyfills.size) {
31
+ const polyfillTagNamesCache = new Set([...polyfills.values()].map((v) => String(v.polyfillExtends ?? '').toUpperCase()).filter(Boolean)); // ['TAG-NAME1', 'TAG-NAME2', ...]
32
+ const handlers = new WeakMap();
33
+ const observe = (el, polyfill) => {
34
+ if (!Array.isArray(polyfill.observedAttributes))
35
+ return;
36
+ if (0 === polyfill?.observedAttributes.length)
37
+ return;
38
+ if (!polyfill.polyfillAttributeChangedCallback)
39
+ return;
40
+ const observer = new MutationObserver(polyfill.polyfillAttributeChangedCallback);
41
+ observer.observe(el, {
42
+ attributes: true,
43
+ attributeFilter: polyfill.observedAttributes,
44
+ attributeOldValue: true,
45
+ });
46
+ handlers.set(el, observer);
47
+ for (const attributeName of polyfill.observedAttributes)
48
+ if (el.hasAttribute(attributeName)) {
49
+ const entry = {
50
+ attributeName,
51
+ oldValue: null,
52
+ target: el,
53
+ };
54
+ polyfill.polyfillAttributeChangedCallback([entry]);
55
+ }
56
+ }, unobserve = (el) => {
57
+ handlers.delete(el);
58
+ }, polyfillTagNamesCacheSelector = [...polyfillTagNamesCache.values()].map((v) => `${v}`.toLowerCase()).join(','), flatten = (node) => [node, ...(node.querySelectorAll?.(polyfillTagNamesCacheSelector) ?? [])];
59
+ if (devFlags.debug)
60
+ console.debug(polyfillTagNamesCache, polyfillTagNamesCacheSelector);
61
+ for (const [is, polyfill] of polyfills)
62
+ for (const el of document.querySelectorAll(`${polyfill.polyfillExtends}[is="${CSS.escape(is)}"]`)) {
63
+ polyfill.polyfillConnectedCallback(el);
64
+ observe(el, polyfill);
65
+ }
66
+ // observer callback
67
+ const observer = new MutationObserver((mutations) => {
68
+ for (const { addedNodes, removedNodes } of mutations) {
69
+ for (const root of addedNodes) {
70
+ if (!(root instanceof HTMLElement))
71
+ continue;
72
+ for (const node of flatten(root)) {
73
+ if (!(node instanceof HTMLElement))
74
+ continue;
75
+ if (!polyfillTagNamesCache.has(node.tagName))
76
+ continue;
77
+ const is = node?.getAttribute('is') ?? '';
78
+ if (!polyfills.has(is))
79
+ continue;
80
+ polyfills.get(is)?.polyfillConnectedCallback(node);
81
+ observe(node, polyfills.get(is));
82
+ }
83
+ }
84
+ for (const root of removedNodes) {
85
+ if (!(root instanceof HTMLElement))
86
+ continue;
87
+ for (const node of flatten(root)) {
88
+ if (!(node instanceof HTMLElement))
89
+ continue;
90
+ if (!polyfillTagNamesCache.has(node.tagName))
91
+ continue;
92
+ const is = node?.getAttribute('is') ?? '';
93
+ if (!polyfills.has(is))
94
+ continue;
95
+ polyfills.get(is)?.polyfillDisconnectedCallback(node);
96
+ unobserve(node);
97
+ }
98
+ }
99
+ }
100
+ });
101
+ observer.observe(document.body, {
102
+ childList: true,
103
+ subtree: true,
104
+ });
105
+ }
106
+ // SECTION: Safari polyfill
107
+ document.addEventListener('touchstart', () => { }, { passive: true });
108
+ //#endregion
109
+ // SECTION
110
+ const handleHelp = ({ target, relatedTarget }) => {
111
+ if (!(target instanceof HTMLElement && target))
112
+ return;
113
+ const trigger = target.closest('[help]');
114
+ if (!trigger)
115
+ return;
116
+ if (relatedTarget instanceof HTMLElement && relatedTarget && trigger.contains(relatedTarget))
117
+ return;
118
+ const newAnchorName = `--help-${self.crypto.randomUUID()}`;
119
+ const tooltip = $(`<fine-tooltip></fine-tooltip>`, '>1');
120
+ trigger.style.setProperty('anchor-name', newAnchorName);
121
+ tooltip.style.setProperty('position-anchor', newAnchorName);
122
+ document.body.appendChild(tooltip);
123
+ // setInterval(() => {
124
+ // trigger.setAttribute('help', trigger.getAttribute('help') + 'h')
125
+ // }, 2000)
126
+ // console.log(999, trigger)
127
+ }, handleDone = ({ target, relatedTarget }) => {
128
+ if (!(target instanceof HTMLElement && target))
129
+ return;
130
+ const trigger = target.closest('[help]');
131
+ if (!trigger)
132
+ return;
133
+ if (relatedTarget instanceof HTMLElement && relatedTarget && trigger.contains(relatedTarget))
134
+ return;
135
+ const anchorName = trigger.style.anchorName;
136
+ if (!anchorName.startsWith('--help-'))
137
+ return;
138
+ // for (const el of document.querySelectorAll<HTMLElement>(`[style*="--help-${CSS.escape(anchorName)}"][help]`)) el.style.removeProperty('anchor-name') //trigger.style.removeProperty('anchor-name')
139
+ // for (const el of document.querySelectorAll(`[style*="${CSS.escape(anchorName)}"]:not([help])`)) el.remove()
140
+ // return
141
+ // }
142
+ const tooltip = document.querySelector(`[style*="${CSS.escape(anchorName)}"]:not([help])`);
143
+ if (!tooltip)
144
+ return;
145
+ // for (const el of document.querySelectorAll<HTMLElement>(`[style*="--help-${CSS.escape(anchorName)}"][help]`)) el.style.removeProperty('anchor-name') //trigger.style.removeProperty('anchor-name')
146
+ // for (const el of document.querySelectorAll(`[style*="${CSS.escape(anchorName)}"]:not([help])`)) el.remove()
147
+ // return
148
+ // }
149
+ // trigger.style.removeProperty('anchor-name')
150
+ tooltip.hidePopover(); // tooltip.remove?.()
151
+ };
152
+ const mediaQueryList = self.matchMedia(`(pointer: fine)`);
153
+ mediaQueryList.addEventListener('change', ({ matches }) => {
154
+ for (const [k, v] of [
155
+ ['pointerover', handleHelp],
156
+ ['pointerout', handleDone],
157
+ ])
158
+ document.removeEventListener(k, v);
159
+ if (matches)
160
+ for (const [k, v] of [
161
+ ['pointerover', handleHelp],
162
+ ['pointerout', handleDone],
163
+ ])
164
+ document.addEventListener(k, v, { passive: true });
165
+ });
166
+ if (mediaQueryList.matches)
167
+ for (const [k, v] of [
168
+ ['pointerover', handleHelp],
169
+ ['pointerout', handleDone],
170
+ ])
171
+ document.addEventListener(k, v, { passive: true });
172
+ //#region fns
173
+ export const alert = async (title, message, actions, options) => {
174
+ await navigator.locks.request('alert:', async () => {
175
+ const dialog = $(`<dialog is="alert-dialog"></dialog>`, '>1'), vStack = dialog.querySelector(':scope>v-stack') ?? dialog.appendChild($(`<v-stack spacing="1" alignment="fill"></v-stack>`, '>1'));
176
+ if (title) {
177
+ const label = $(`<label-view font="headline"></label-view>`, '>1');
178
+ label.setAttribute('title', title);
179
+ vStack.insertAdjacentElement('beforeend', label);
180
+ }
181
+ if (message) {
182
+ const label = $(`<label-view foreground="secondary" font="callout"></label-view>`, '>1');
183
+ label.setAttribute('title', message);
184
+ vStack.insertAdjacentElement('beforeend', label);
185
+ }
186
+ for (const [index, action] of (actions ?? [
187
+ {
188
+ role: 'close',
189
+ },
190
+ ]).entries()) {
191
+ const btn = $(`<button type="button" tabindex="0" is="bordered-button"></button>`, '>1');
192
+ btn.setAttribute('value', `${index}`);
193
+ if (action?.role)
194
+ btn.setAttribute('role', action.role);
195
+ if (action.label || action.image) {
196
+ const label = $(`<label-view></label-view>`, '>1');
197
+ if (action.label)
198
+ label.setAttribute('title', action.label);
199
+ if (action.image)
200
+ label.setAttribute('system-image', action.image);
201
+ btn.appendChild(label);
202
+ }
203
+ dialog.insertAdjacentElement('beforeend', btn);
204
+ }
205
+ document.body.insertAdjacentElement('beforeend', dialog);
206
+ dialog.showModal();
207
+ const { promise, resolve } = Promise.withResolvers(), off = onoff('alert:return', (evt) => {
208
+ off();
209
+ resolve(evt.detail.returnValue);
210
+ }, alertDialog, { once: true }).on();
211
+ return promise;
212
+ });
213
+ };
214
+ export const confirmationDialog = async (trigger, title, message, actions, options) => {
215
+ const newAnchorName = `--confirmation-dialog-${self.crypto.randomUUID()}`;
216
+ const dialog = $(`<dialog is="confirmation-dialog"></dialog>`, '>1'), vStack = dialog.querySelector(':scope>v-stack') ?? dialog.appendChild($(`<v-stack spacing="1" alignment="fill"></v-stack>`, '>1'));
217
+ trigger.style.setProperty('anchor-name', newAnchorName, 'important'); //$.prop('anchor-name', newAnchorName, trigger, 'important')
218
+ dialog.style.setProperty('position-anchor', newAnchorName); //$.prop('position-anchor', newAnchorName, dialog)
219
+ if (title && false !== options?.titleVisibility) {
220
+ const label = $(`<label-view font="headline"></label-view>`, '>1');
221
+ label.setAttribute('title', title);
222
+ vStack.insertAdjacentElement('beforeend', label);
223
+ }
224
+ if (message && false !== options?.titleVisibility) {
225
+ const label = $(`<label-view foreground="secondary" font="callout"></label-view>`, '>1');
226
+ label.setAttribute('title', message);
227
+ vStack.insertAdjacentElement('beforeend', label);
228
+ }
229
+ for (const [index, action] of (actions ?? []).entries()) {
230
+ const btn = $(`<button type="button" tabindex="0" is="bordered-button"></button>`, '>1');
231
+ btn.setAttribute('value', `${index}`);
232
+ if (action?.role)
233
+ btn.setAttribute('role', action.role);
234
+ if (action.label || action.image) {
235
+ const label = $(`<label-view></label-view>`, '>1');
236
+ if (action.label)
237
+ label.setAttribute('title', action.label);
238
+ if (action.image)
239
+ label.setAttribute('system-image', action.image);
240
+ btn.appendChild(label);
241
+ }
242
+ dialog.insertAdjacentElement('beforeend', btn);
243
+ }
244
+ trigger.closest('body-view,dialog')?.insertAdjacentElement('beforeend', dialog); // dialog.showModal()
245
+ const { promise, resolve } = Promise.withResolvers(), off = onoff('confirmation:return', (evt) => {
246
+ off();
247
+ resolve(evt.detail.returnValue);
248
+ }, confirmationDialogBus, { once: true }).on();
249
+ return promise;
250
+ // return await new Promise((resolve, reject) => {
251
+ // const onClose = (evt: any) => {
252
+ // off()
253
+ // resolve(evt.detail.returnValue)
254
+ // },
255
+ // off = onoff('return', onClose, ConfirmationDialog, { once: true }).on()
256
+ // // const onAbort = () => {
257
+ // // cleanup()
258
+ // // reject(new DOMException('aborted', 'AbortError'))
259
+ // // }
260
+ // // const cleanup = () => {
261
+ // // ConfirmationDialog.removeEventListener('close', onClose)
262
+ // // // controller.signal.removeEventListener('abort', onAbort)
263
+ // // }
264
+ // // ConfirmationDialog.addEventListener('close', onClose, { once: true })
265
+ // // controller.signal.addEventListener('abort', onAbort, { once: true })
266
+ // })
267
+ };
268
+ //#endregion
269
+ void Snapshot.waitReady; // void Snapshot.setOwnConfig()
270
+ //#region exports
271
+ export { I18n, lifecycleObserver, NavigationPath, queryInsertPosition, Snapshot, startViewTransition };
272
+ //#endregion
@@ -0,0 +1,8 @@
1
+ import { DialogBase } from '../namespace-browser/base';
2
+ export declare class AlertDialog extends DialogBase {
3
+ #private;
4
+ constructor();
5
+ static polyfillDisconnectedCallback(el: AlertDialog): void;
6
+ static polyfillConnectedCallback(el: AlertDialog): void;
7
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
8
+ }
@@ -0,0 +1,99 @@
1
+ import { alertDialog } from '../buses';
2
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
3
+ import { devFlags, onoff, touchGlass } from '../internal/utils';
4
+ import { DialogBase } from '../namespace-browser/base';
5
+ export class AlertDialog extends DialogBase {
6
+ constructor() {
7
+ super();
8
+ }
9
+ static polyfillDisconnectedCallback(el) {
10
+ if (devFlags.debug)
11
+ console.debug(`${AlertDialog.name} ⚡️ disconnect`);
12
+ CleanupRegistry.unregister(el);
13
+ alertDialog.dispatchEvent(new CustomEvent('alert:return', {
14
+ detail: { returnValue: el.returnValue },
15
+ bubbles: true,
16
+ composed: true,
17
+ }));
18
+ }
19
+ static polyfillConnectedCallback(el) {
20
+ if (devFlags.debug)
21
+ console.debug(`${AlertDialog.name} ⚡️ connect`);
22
+ CleanupRegistry.register(el, onoff([
23
+ { types: 'click', listener: this.#handleDialogClick },
24
+ { types: 'close', listener: this.#handleDialogClose },
25
+ { types: 'cancel', listener: this.#handleDialogCancel },
26
+ ], el).on());
27
+ CleanupRegistry.register(el, onoff(touchGlass(el, (t) => t, ({ target }) => {
28
+ if (!(target instanceof HTMLElement && target))
29
+ return true;
30
+ if (target.matches('[is=alert-dialog]'))
31
+ return false;
32
+ return true;
33
+ }), el).on());
34
+ if (devFlags.debug)
35
+ console.debug(`${AlertDialog.name} ⚡️ will-open`);
36
+ el.removeAttribute('closing');
37
+ el.scrollTop = 0;
38
+ el.returnValue = '';
39
+ el.autofocus = true;
40
+ el.showModal();
41
+ }
42
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
43
+ if (devFlags.debug)
44
+ console.debug(`${AlertDialog.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
45
+ switch (attributeName) {
46
+ case 'label':
47
+ //
48
+ break;
49
+ }
50
+ }
51
+ static #handleDialogClick = (evt) => {
52
+ if (devFlags.debug)
53
+ console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
54
+ const { target, currentTarget: dialog } = evt;
55
+ if (!(dialog instanceof HTMLDialogElement && dialog))
56
+ return;
57
+ if (!(target instanceof HTMLElement && target))
58
+ return;
59
+ const button = target.closest('button');
60
+ if (!button)
61
+ return;
62
+ button.scrollIntoView({
63
+ behavior: self.matchMedia('(prefers-reduced-motion: no-preference)').matches ? 'smooth' : 'instant',
64
+ block: 'nearest',
65
+ inline: 'nearest',
66
+ });
67
+ dialog.returnValue = button.value;
68
+ dialog.requestClose(button.value);
69
+ evt.stopPropagation();
70
+ evt.stopImmediatePropagation();
71
+ };
72
+ static #handleDialogCancel = (evt) => {
73
+ if (devFlags.debug)
74
+ console.debug(`${AlertDialog.name} ⚡️ ${evt?.type}`);
75
+ if (!evt.cancelable)
76
+ return;
77
+ const { target } = evt;
78
+ if (!(target instanceof HTMLDialogElement && target))
79
+ return;
80
+ evt.preventDefault();
81
+ target.inert = true;
82
+ if (devFlags.debug)
83
+ console.debug(`${AlertDialog.name} ⚡️ will-close`);
84
+ target.setAttribute('closing', '');
85
+ Promise.allSettled(target.getAnimations().map(({ finished }) => finished)).then(() => {
86
+ if (!target.hasAttribute('closing'))
87
+ return;
88
+ target?.close(target?.returnValue);
89
+ target.removeAttribute('closing');
90
+ });
91
+ };
92
+ static #handleDialogClose = ({ type, target }) => {
93
+ if (devFlags.debug)
94
+ console.debug(`${AlertDialog.name} ⚡️ ${type}`);
95
+ if (!(target instanceof HTMLDialogElement && target))
96
+ return;
97
+ target.remove();
98
+ };
99
+ }
@@ -0,0 +1,5 @@
1
+ export declare class BodyView extends HTMLElement {
2
+ constructor();
3
+ disconnectedCallback(): void;
4
+ connectedCallback(): void;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { devFlags } from '../internal/utils';
2
+ export class BodyView extends HTMLElement {
3
+ constructor() {
4
+ super();
5
+ }
6
+ disconnectedCallback() {
7
+ if (devFlags.debug)
8
+ console.debug(`${BodyView.name} ⚡️ disconnect`);
9
+ }
10
+ connectedCallback() {
11
+ if (devFlags.debug)
12
+ console.debug(`${BodyView.name} ⚡️ connect`);
13
+ }
14
+ }
@@ -0,0 +1,13 @@
1
+ import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @slot overlay
4
+ *
5
+ */
6
+ export declare class BorderedButton extends ButtonBase {
7
+ #private;
8
+ static get observedAttributes(): string[];
9
+ constructor();
10
+ static polyfillDisconnectedCallback(el: BorderedButton): void;
11
+ static polyfillConnectedCallback(el: BorderedButton): void;
12
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
13
+ }
@@ -0,0 +1,45 @@
1
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @slot overlay
7
+ *
8
+ */
9
+ export class BorderedButton extends ButtonBase {
10
+ static get observedAttributes() {
11
+ return ['role', 'title-key'];
12
+ }
13
+ constructor() {
14
+ super();
15
+ }
16
+ static polyfillDisconnectedCallback(el) {
17
+ if (devFlags.debug)
18
+ console.debug(`${BorderedButton.name} ⚡️ disconnect`);
19
+ CleanupRegistry.unregister(el);
20
+ }
21
+ static polyfillConnectedCallback(el) {
22
+ if (devFlags.debug)
23
+ console.debug(`${BorderedButton.name} ⚡️ connect`);
24
+ el.tabIndex = 0;
25
+ CleanupRegistry.register(el, onoff('click', BorderedButton.#handleClick, el).on());
26
+ }
27
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderedButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
30
+ const node = target instanceof HTMLButtonElement && target;
31
+ if (!node)
32
+ return;
33
+ switch (attributeName) {
34
+ case 'title-key':
35
+ case 'role':
36
+ Snapshot.waitReady.then(() => {
37
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'));
38
+ });
39
+ break;
40
+ }
41
+ }
42
+ static #handleClick = async (evt) => {
43
+ //
44
+ };
45
+ }
@@ -0,0 +1,13 @@
1
+ import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @slot overlay
4
+ *
5
+ */
6
+ export declare class BorderedProminentButton extends ButtonBase {
7
+ #private;
8
+ static get observedAttributes(): string[];
9
+ constructor();
10
+ static polyfillDisconnectedCallback(el: BorderedProminentButton): void;
11
+ static polyfillConnectedCallback(el: BorderedProminentButton): void;
12
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
13
+ }
@@ -0,0 +1,45 @@
1
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @slot overlay
7
+ *
8
+ */
9
+ export class BorderedProminentButton extends ButtonBase {
10
+ static get observedAttributes() {
11
+ return ['role', 'title-key'];
12
+ }
13
+ constructor() {
14
+ super();
15
+ }
16
+ static polyfillDisconnectedCallback(el) {
17
+ if (devFlags.debug)
18
+ console.debug(`${BorderedProminentButton.name} ⚡️ disconnect`);
19
+ CleanupRegistry.unregister(el);
20
+ }
21
+ static polyfillConnectedCallback(el) {
22
+ if (devFlags.debug)
23
+ console.debug(`${BorderedProminentButton.name} ⚡️ connect`);
24
+ el.tabIndex = 0;
25
+ CleanupRegistry.register(el, onoff('click', BorderedProminentButton.#handleClick, el).on());
26
+ }
27
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderedProminentButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
30
+ const node = target instanceof HTMLButtonElement && target;
31
+ if (!node)
32
+ return;
33
+ switch (attributeName) {
34
+ case 'title-key':
35
+ case 'role':
36
+ Snapshot.waitReady.then(() => {
37
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'));
38
+ });
39
+ break;
40
+ }
41
+ }
42
+ static #handleClick = async (evt) => {
43
+ //
44
+ };
45
+ }
@@ -0,0 +1,13 @@
1
+ import { ButtonBase } from '../namespace-browser/base';
2
+ /**
3
+ * @slot overlay
4
+ *
5
+ */
6
+ export declare class BorderlessButton extends ButtonBase {
7
+ #private;
8
+ static get observedAttributes(): string[];
9
+ constructor();
10
+ static polyfillDisconnectedCallback(el: BorderlessButton): void;
11
+ static polyfillConnectedCallback(el: BorderlessButton): void;
12
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]: Pick<MutationRecord, 'attributeName' | 'oldValue' | 'target'>[]): void;
13
+ }
@@ -0,0 +1,45 @@
1
+ import { CleanupRegistry } from '../internal/class/cleanup-registry';
2
+ import { devFlags, ensurePlaceholder, onoff } from '../internal/utils';
3
+ import { ButtonBase } from '../namespace-browser/base';
4
+ import { Snapshot } from '../snapshot';
5
+ /**
6
+ * @slot overlay
7
+ *
8
+ */
9
+ export class BorderlessButton extends ButtonBase {
10
+ static get observedAttributes() {
11
+ return ['role', 'title-key'];
12
+ }
13
+ constructor() {
14
+ super();
15
+ }
16
+ static polyfillDisconnectedCallback(el) {
17
+ if (devFlags.debug)
18
+ console.debug(`${BorderlessButton.name} ⚡️ disconnect`);
19
+ CleanupRegistry.unregister(el);
20
+ }
21
+ static polyfillConnectedCallback(el) {
22
+ if (devFlags.debug)
23
+ console.debug(`${BorderlessButton.name} ⚡️ connect`);
24
+ el.tabIndex = 0;
25
+ CleanupRegistry.register(el, onoff('click', BorderlessButton.#handleClick, el).on());
26
+ }
27
+ static polyfillAttributeChangedCallback([{ attributeName, target, oldValue }]) {
28
+ if (devFlags.debug)
29
+ console.debug(`${BorderlessButton.name} ⚡️ attr-change [${attributeName}] ("${oldValue}" → "${target.getAttribute(attributeName ?? '')}")`);
30
+ const node = target instanceof HTMLButtonElement && target;
31
+ if (!node)
32
+ return;
33
+ switch (attributeName) {
34
+ case 'title-key':
35
+ case 'role':
36
+ Snapshot.waitReady.then(() => {
37
+ ensurePlaceholder(target, target.getAttribute('role'), target.getAttribute('title-key'));
38
+ });
39
+ break;
40
+ }
41
+ }
42
+ static #handleClick = async (evt) => {
43
+ // alert(99)
44
+ };
45
+ }