@swiftwc/ui 0.0.0-dev.103 → 0.0.0-dev.106
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/generated/client/index.js +7 -8
- package/generated/components/alert-dialog.js +9 -17
- package/generated/components/body-view.js +3 -5
- package/generated/components/bordered-button.js +4 -7
- package/generated/components/bordered-prominent-button.js +4 -7
- package/generated/components/borderless-button.js +4 -7
- package/generated/components/color-scheme.js +4 -7
- package/generated/components/confirmation-dialog.js +9 -17
- package/generated/components/content-unavailable.js +4 -7
- package/generated/components/date-picker.js +13 -25
- package/generated/components/detail-placeholder.js +4 -8
- package/generated/components/disclosure-group.js +5 -9
- package/generated/components/fine-tooltip.js +4 -7
- package/generated/components/form-view.js +3 -5
- package/generated/components/glass-button.js +4 -7
- package/generated/components/glass-prominent-button.js +4 -7
- package/generated/components/h-divider.d.ts +11 -0
- package/generated/components/h-divider.js +15 -0
- package/generated/components/h-stack.js +3 -5
- package/generated/components/image-view.js +4 -7
- package/generated/components/index.d.ts +2 -0
- package/generated/components/index.js +2 -0
- package/generated/components/label-view.js +4 -7
- package/generated/components/labeled-content.js +4 -7
- package/generated/components/list-view.js +3 -5
- package/generated/components/menu-view.js +10 -19
- package/generated/components/navigation-large-title.js +5 -9
- package/generated/components/navigation-split-view.js +4 -7
- package/generated/components/navigation-stack.js +4 -7
- package/generated/components/navigation-title.js +4 -7
- package/generated/components/picker-view.js +32 -61
- package/generated/components/plain-button.js +3 -5
- package/generated/components/progress-view.js +6 -11
- package/generated/components/screen-view.js +2 -3
- package/generated/components/scroll-view-proxy.js +3 -5
- package/generated/components/scroll-view.js +9 -16
- package/generated/components/search-view.js +4 -7
- package/generated/components/section-view.js +4 -7
- package/generated/components/sheet-view.js +6 -11
- package/generated/components/sidebar-toggle.js +5 -9
- package/generated/components/sidebar-view.js +2 -3
- package/generated/components/sticky-container.js +3 -5
- package/generated/components/tab-bar.js +4 -7
- package/generated/components/tab-item.js +8 -15
- package/generated/components/tab-view.js +8 -14
- package/generated/components/table-view.js +6 -11
- package/generated/components/text-field.js +10 -19
- package/generated/components/text-view.js +4 -7
- package/generated/components/toggle-view.js +13 -25
- package/generated/components/tool-bar-item-group.js +3 -5
- package/generated/components/tool-bar-item.js +4 -7
- package/generated/components/tool-bar.js +4 -7
- package/generated/components/v-divider.d.ts +11 -0
- package/generated/components/v-divider.js +15 -0
- package/generated/components/v-keyboard.js +8 -12
- package/generated/components/v-stack.js +3 -5
- package/generated/css/index.css +13 -5
- package/generated/internal/class/css-style-observer.js +2 -3
- package/generated/internal/class/form-associated-base.js +5 -7
- package/generated/internal/class/navigation-view.js +3 -5
- package/generated/internal/decorators/adaptive-slot.js +4 -7
- package/generated/internal/decorators/microtask-on-connected.d.ts +2 -2
- package/generated/internal/decorators/microtask-on-connected.js +2 -2
- package/generated/internal/flags.json +3 -0
- package/generated/internal/privateNamespace.js +12 -21
- package/generated/internal/utils/$.d.ts +9 -0
- package/generated/internal/utils/$.js +11 -0
- package/generated/internal/utils/debug.d.ts +1 -0
- package/generated/internal/utils/debug.js +4 -0
- package/generated/internal/utils/index.d.ts +36 -2
- package/generated/internal/utils/index.js +36 -5
- package/generated/internal/utils/is-inside.js +1 -1
- package/generated/snapshot/index.js +3 -5
- package/package.json +11 -7
- package/scss/components/_index.scss +3 -1
- package/scss/components/_picker-view.scss +1 -1
- package/web-components.html-data/en.json +8 -0
- package/generated/internal/utils/cash/index.d.ts +0 -24
- package/generated/internal/utils/cash/index.js +0 -27
- package/generated/internal/utils/dev-flags.d.ts +0 -3
- package/generated/internal/utils/dev-flags.js +0 -5
- /package/generated/internal/utils/{cash/ancestors.d.ts → ancestors.d.ts} +0 -0
- /package/generated/internal/utils/{cash/ancestors.js → ancestors.js} +0 -0
- /package/generated/internal/utils/{cash/next-all.d.ts → next-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next-all.js → next-all.js} +0 -0
- /package/generated/internal/utils/{cash/next.d.ts → next.d.ts} +0 -0
- /package/generated/internal/utils/{cash/next.js → next.js} +0 -0
- /package/generated/internal/utils/{cash/prev-all.d.ts → prev-all.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev-all.js → prev-all.js} +0 -0
- /package/generated/internal/utils/{cash/prev.d.ts → prev.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prev.js → prev.js} +0 -0
- /package/generated/internal/utils/{cash/prop.d.ts → prop.d.ts} +0 -0
- /package/generated/internal/utils/{cash/prop.js → prop.js} +0 -0
- /package/generated/internal/utils/{cash/siblings.d.ts → siblings.d.ts} +0 -0
- /package/generated/internal/utils/{cash/siblings.js → siblings.js} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { CleanupRegistry } from '../internal/class/cleanup-registry';
|
|
3
|
-
import {
|
|
3
|
+
import { debug, frame, onoff, prop, sleep } from '../internal/utils';
|
|
4
4
|
import { Snapshot } from '../snapshot';
|
|
5
5
|
/**
|
|
6
6
|
* BUG: Safari on IOS reports inaccurate innerHeight (which is what we really want) on orientationchange.
|
|
@@ -22,13 +22,11 @@ export class VKeyboard extends HTMLElement {
|
|
|
22
22
|
super();
|
|
23
23
|
}
|
|
24
24
|
disconnectedCallback() {
|
|
25
|
-
|
|
26
|
-
console.debug(`${_a.name} ⚡️ disconnect`);
|
|
25
|
+
debug(`${_a.name} ⚡️ disconnect`);
|
|
27
26
|
CleanupRegistry.unregister(this);
|
|
28
27
|
}
|
|
29
28
|
connectedCallback() {
|
|
30
|
-
|
|
31
|
-
console.debug(`${_a.name} ⚡️ connect`);
|
|
29
|
+
debug(`${_a.name} ⚡️ connect`);
|
|
32
30
|
this.inert = true;
|
|
33
31
|
CleanupRegistry.register(this, onoff([
|
|
34
32
|
{ types: 'scroll', listener: this.#handleWindowScroll },
|
|
@@ -54,21 +52,19 @@ export class VKeyboard extends HTMLElement {
|
|
|
54
52
|
#handleVisualViewportResize = () => {
|
|
55
53
|
const dvh = self.visualViewport?.height ?? 0, fullLvh = this.offsetHeight;
|
|
56
54
|
const diff = Math.abs(self.outerHeight - (this.#shouldKeyboardBeOpenCallback() ? dvh : fullLvh));
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
prop('--100lvh', 30 < diff ? `${dvh}px` : `${fullLvh}px`, document.documentElement); //document.documentElement.style.setProperty('--100lvh', 30 < diff ? `${dvh}px` : `${fullLvh}px`)
|
|
56
|
+
prop('--keyboard-inset-top', 30 < diff ? `${dvh}px` : `${fullLvh}px`, document.documentElement); //document.documentElement.style.setProperty('--keyboard-inset-top', 30 < diff ? `${dvh}px` : `${fullLvh}px`)
|
|
57
|
+
prop('--keyboard-inset-height', 30 < diff ? `${diff}px` : `0px`, document.documentElement); //document.documentElement.style.setProperty('--keyboard-inset-height', 30 < diff ? `${diff}px` : `0px`)
|
|
60
58
|
self.scrollTo(0, 0);
|
|
61
59
|
};
|
|
62
60
|
#handleWindowOrientationchange = async () => {
|
|
63
|
-
|
|
64
|
-
console.debug(`${_a.name} ⚡️ orientationchange`);
|
|
61
|
+
debug(`${_a.name} ⚡️ orientationchange`);
|
|
65
62
|
if (!(await frame(this)))
|
|
66
63
|
return; //self.requestAnimationFrame(this.#ifKeyboardScrollIntoActiveElement)
|
|
67
64
|
this.#ifKeyboardScrollIntoActiveElement();
|
|
68
65
|
};
|
|
69
66
|
#handleBodyFocusin = async () => {
|
|
70
|
-
|
|
71
|
-
console.debug(`${_a.name} ⚡️ focusin`);
|
|
67
|
+
debug(`${_a.name} ⚡️ focusin`);
|
|
72
68
|
await sleep(100); // self.setTimeout(this.#ifKeyboardScrollIntoActiveElement, 100)
|
|
73
69
|
if (!this.isConnected)
|
|
74
70
|
return;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug } from '../internal/utils';
|
|
2
2
|
/**
|
|
3
3
|
* @summary A view that arranges its children one on top of the other.
|
|
4
4
|
*
|
|
@@ -19,11 +19,9 @@ export class VStack extends HTMLElement {
|
|
|
19
19
|
super();
|
|
20
20
|
}
|
|
21
21
|
connectedCallback() {
|
|
22
|
-
|
|
23
|
-
console.debug(`${VStack.name} ⚡️ connect`);
|
|
22
|
+
debug(`${VStack.name} ⚡️ connect`);
|
|
24
23
|
}
|
|
25
24
|
disconnectedCallback() {
|
|
26
|
-
|
|
27
|
-
console.debug(`${VStack.name} ⚡️ disconnect`);
|
|
25
|
+
debug(`${VStack.name} ⚡️ disconnect`);
|
|
28
26
|
}
|
|
29
27
|
}
|
package/generated/css/index.css
CHANGED
|
@@ -1132,7 +1132,9 @@
|
|
|
1132
1132
|
text-field:not([hidden]),
|
|
1133
1133
|
detail-placeholder:not([hidden]),
|
|
1134
1134
|
sticky-container:not([hidden]),
|
|
1135
|
-
picker-view:not([hidden])
|
|
1135
|
+
picker-view:not([hidden]),
|
|
1136
|
+
h-divider:not([hidden]),
|
|
1137
|
+
v-divider:not([hidden])) {
|
|
1136
1138
|
display: grid;
|
|
1137
1139
|
}
|
|
1138
1140
|
:where(tab-view:has(navigation-stack:not(:defined),
|
|
@@ -1163,7 +1165,9 @@
|
|
|
1163
1165
|
text-field:not(:defined),
|
|
1164
1166
|
detail-placeholder:not(:defined),
|
|
1165
1167
|
sticky-container:not(:defined),
|
|
1166
|
-
picker-view:not(:defined)
|
|
1168
|
+
picker-view:not(:defined),
|
|
1169
|
+
h-divider:not(:defined),
|
|
1170
|
+
v-divider:not(:defined)), navigation-split-view:has(navigation-stack:not(:defined),
|
|
1167
1171
|
navigation-split-view:not(:defined),
|
|
1168
1172
|
navigation-large-title:not(:defined),
|
|
1169
1173
|
navigation-title:not(:defined),
|
|
@@ -1191,7 +1195,9 @@
|
|
|
1191
1195
|
text-field:not(:defined),
|
|
1192
1196
|
detail-placeholder:not(:defined),
|
|
1193
1197
|
sticky-container:not(:defined),
|
|
1194
|
-
picker-view:not(:defined)
|
|
1198
|
+
picker-view:not(:defined),
|
|
1199
|
+
h-divider:not(:defined),
|
|
1200
|
+
v-divider:not(:defined)), navigation-stack:has(navigation-stack:not(:defined),
|
|
1195
1201
|
navigation-split-view:not(:defined),
|
|
1196
1202
|
navigation-large-title:not(:defined),
|
|
1197
1203
|
navigation-title:not(:defined),
|
|
@@ -1219,7 +1225,9 @@
|
|
|
1219
1225
|
text-field:not(:defined),
|
|
1220
1226
|
detail-placeholder:not(:defined),
|
|
1221
1227
|
sticky-container:not(:defined),
|
|
1222
|
-
picker-view:not(:defined)
|
|
1228
|
+
picker-view:not(:defined),
|
|
1229
|
+
h-divider:not(:defined),
|
|
1230
|
+
v-divider:not(:defined))) {
|
|
1223
1231
|
visibility: hidden;
|
|
1224
1232
|
}
|
|
1225
1233
|
:where([is=search-view]:not([hidden]),
|
|
@@ -5303,7 +5311,7 @@
|
|
|
5303
5311
|
--picker--stack-grid-border: if(
|
|
5304
5312
|
style(--picker-style: sheet): var(--itemborder,) ; style(--picker-style: navigation-link): var(--itemborder,) ; style(--picker-style: menu): var(--itemborder,) ;
|
|
5305
5313
|
);
|
|
5306
|
-
--picker--input-stack-text-align: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu):
|
|
5314
|
+
--picker--input-stack-text-align: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu): start ;);
|
|
5307
5315
|
}
|
|
5308
5316
|
}
|
|
5309
5317
|
@supports not (x: if(else:red)) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var _a;
|
|
2
|
-
import {
|
|
2
|
+
import { debug, onoff } from '../../internal/utils';
|
|
3
3
|
export class CSSStyleObserver {
|
|
4
4
|
#cleanups;
|
|
5
5
|
#options;
|
|
@@ -16,8 +16,7 @@ export class CSSStyleObserver {
|
|
|
16
16
|
this.#cleanups?.();
|
|
17
17
|
}
|
|
18
18
|
#handleTransitionrun = (callback, evt) => {
|
|
19
|
-
|
|
20
|
-
console.debug(`${_a.name} ⚡️ ${evt?.type} (${evt.propertyName})`);
|
|
19
|
+
debug(`${_a.name} ⚡️ ${evt?.type} (${evt.propertyName})`);
|
|
21
20
|
if (!this.#options?.properties.some((prop) => evt.propertyName.startsWith(prop)))
|
|
22
21
|
return;
|
|
23
22
|
callback?.(evt);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug } from '../../internal/utils';
|
|
2
2
|
import { CleanupRegistry } from './cleanup-registry';
|
|
3
3
|
const internals = new WeakMap();
|
|
4
4
|
// const trackedElements = new WeakMap<FormAssociatedBase, Set<Element>>()
|
|
@@ -11,14 +11,14 @@ export function getInternals(instance) {
|
|
|
11
11
|
}
|
|
12
12
|
// export function makeSlotchangeHandler(t: FormAssociatedBase) {
|
|
13
13
|
// const handleSlotchange = ({ type, target: slot }: Event) => {
|
|
14
|
-
//
|
|
14
|
+
// debug(`${makeSlotchangeHandler.name} ⚡️ ${type}`)
|
|
15
15
|
// if (!(slot instanceof HTMLSlotElement && slot)) return
|
|
16
16
|
// const assigned = slot.assignedElements({ flatten: true })
|
|
17
17
|
// observers.syncObservations(trackedElements.get(t) ?? new Set(), assigned, handleTagMutation, ['value', 'label'])
|
|
18
18
|
// if (0 < assigned.length) handleTagMutation()
|
|
19
19
|
// },
|
|
20
20
|
// handleTagMutation = (entry?: MutationRecord) => {
|
|
21
|
-
//
|
|
21
|
+
// debug(`${handleTagMutation.name} ⚡️ mutation`)
|
|
22
22
|
// t.setValidity(t.validity, t.validationMessage)
|
|
23
23
|
// }
|
|
24
24
|
// return [{ types: 'slotchange', listener: handleSlotchange }]
|
|
@@ -33,14 +33,12 @@ export class FormAssociatedBase extends HTMLElement {
|
|
|
33
33
|
// trackedElements.set(this, new Set<Element>())
|
|
34
34
|
}
|
|
35
35
|
disconnectedCallback() {
|
|
36
|
-
|
|
37
|
-
console.debug(`${FormAssociatedBase.name} ⚡️ disconnect`);
|
|
36
|
+
debug(`${FormAssociatedBase.name} ⚡️ disconnect`);
|
|
38
37
|
CleanupRegistry.unregister(this);
|
|
39
38
|
// observers.clearObservationsSet(trackedElements.get(this) ?? new Set())
|
|
40
39
|
}
|
|
41
40
|
connectedCallback() {
|
|
42
|
-
|
|
43
|
-
console.debug(`${FormAssociatedBase.name} ⚡️ connect`);
|
|
41
|
+
debug(`${FormAssociatedBase.name} ⚡️ connect`);
|
|
44
42
|
}
|
|
45
43
|
get type() {
|
|
46
44
|
return this.localName;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var _a;
|
|
2
2
|
import { lifecycleObserver } from '../../buses';
|
|
3
3
|
import { CleanupRegistry } from '../../internal/class/cleanup-registry';
|
|
4
|
-
import {
|
|
4
|
+
import { debug, frame, onoff } from '../utils';
|
|
5
5
|
export class NavigationView extends HTMLElement {
|
|
6
6
|
static get observedAttributes() {
|
|
7
7
|
return ['hidden'];
|
|
@@ -31,8 +31,7 @@ export class NavigationView extends HTMLElement {
|
|
|
31
31
|
// consume it (important so it doesn’t leak to next change)
|
|
32
32
|
this.#recentBefore = undefined;
|
|
33
33
|
}
|
|
34
|
-
|
|
35
|
-
console.debug(`${_a.name} 💡 ${eventType}`);
|
|
34
|
+
debug(`${_a.name} 💡 ${eventType}`);
|
|
36
35
|
frame(this).then(() => target.dispatchEvent(new CustomEvent(eventType, { detail: { tag: this.id }, bubbles: true, composed: true })));
|
|
37
36
|
break;
|
|
38
37
|
}
|
|
@@ -56,8 +55,7 @@ export class NavigationView extends HTMLElement {
|
|
|
56
55
|
frame(this).then(() => lifecycleObserver.dispatchEvent(new CustomEvent('tabshow', { detail: { tag: this.id }, bubbles: true, composed: true })));
|
|
57
56
|
}
|
|
58
57
|
#handleBeforeTabRevealOrSwap = ({ type, detail }) => {
|
|
59
|
-
|
|
60
|
-
console.debug(`${_a.name} ⚡️ ${type}`);
|
|
58
|
+
debug(`${_a.name} ⚡️ ${type}`);
|
|
61
59
|
if (this.id !== detail?.tag)
|
|
62
60
|
return;
|
|
63
61
|
this.#recentBefore = {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { Snapshot } from '../../snapshot';
|
|
2
2
|
import { CleanupRegistry } from '../class/cleanup-registry';
|
|
3
|
-
import {
|
|
3
|
+
import { debug, onoff } from '../utils';
|
|
4
4
|
export default function (filter) {
|
|
5
5
|
const handleMediaChange = (el, { type, matches }) => {
|
|
6
|
-
|
|
7
|
-
console.debug(`${el.localName} ⚡️ ${type}`);
|
|
6
|
+
debug(`${el.localName} ⚡️ ${type}`);
|
|
8
7
|
if (matches) {
|
|
9
8
|
if (!el.matches(`[slot="cancellation-action"],[slot="primary-action"],[slot="confirmation-action"],[slot="destructive-action"]`))
|
|
10
9
|
return;
|
|
@@ -23,8 +22,7 @@ export default function (filter) {
|
|
|
23
22
|
return function (Base, _context) {
|
|
24
23
|
const originalConnected = Base.prototype.connectedCallback, originalDisconnected = Base.prototype.disconnectedCallback;
|
|
25
24
|
Base.prototype.connectedCallback = function () {
|
|
26
|
-
|
|
27
|
-
console.debug(`decorator:[${this.localName}] ⚡️ connect`);
|
|
25
|
+
debug(`decorator:[${this.localName}] ⚡️ connect`);
|
|
28
26
|
originalConnected?.call(this);
|
|
29
27
|
if (filter && !filter(this))
|
|
30
28
|
return;
|
|
@@ -41,8 +39,7 @@ export default function (filter) {
|
|
|
41
39
|
});
|
|
42
40
|
};
|
|
43
41
|
Base.prototype.disconnectedCallback = function () {
|
|
44
|
-
|
|
45
|
-
console.debug(`decorator:[${this.localName}] ⚡️ disconnect`);
|
|
42
|
+
debug(`decorator:[${this.localName}] ⚡️ disconnect`);
|
|
46
43
|
originalDisconnected?.call(this);
|
|
47
44
|
CleanupRegistry.unregister(this, 'adaptive-slot');
|
|
48
45
|
};
|
|
@@ -23,13 +23,13 @@ class() {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
connectedCallback() {
|
|
26
|
-
|
|
26
|
+
DEBUG && console.debug(`${NavigationTitle.name} ⚡️ connect`)
|
|
27
27
|
|
|
28
28
|
this.#scheduleSync()
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {
|
|
32
|
-
|
|
32
|
+
DEBUG && console.debug(`${NavigationTitle.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`)
|
|
33
33
|
|
|
34
34
|
this.#scheduleSync()
|
|
35
35
|
|
|
@@ -23,13 +23,13 @@ class() {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
connectedCallback() {
|
|
26
|
-
|
|
26
|
+
DEBUG && console.debug(`${NavigationTitle.name} ⚡️ connect`)
|
|
27
27
|
|
|
28
28
|
this.#scheduleSync()
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null) {
|
|
32
|
-
|
|
32
|
+
DEBUG && console.debug(`${NavigationTitle.name} ⚡️ attr-change [${name}] ("${oldValue}" → "${newValue}")`)
|
|
33
33
|
|
|
34
34
|
this.#scheduleSync()
|
|
35
35
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NavigationPath } from '../internal/class/navigation-path';
|
|
2
|
-
import {
|
|
2
|
+
import { debug } from '../internal/utils';
|
|
3
3
|
import { Snapshot } from '../snapshot';
|
|
4
4
|
export function queryInsertPosition(frame) {
|
|
5
5
|
if ('NAVIGATION-SPLIT-VIEW' === frame?.tagName)
|
|
@@ -18,8 +18,7 @@ const cleanup = (lm, type) => {
|
|
|
18
18
|
el.classList.remove(...arr);
|
|
19
19
|
};
|
|
20
20
|
export const startViewTransition = async (target, type = 'forwards', updateCallbackOrOptions = async () => { }) => {
|
|
21
|
-
|
|
22
|
-
console.debug(`startViewTransition (${type})`, target);
|
|
21
|
+
debug(`startViewTransition (${type})`, target);
|
|
23
22
|
if (!(target instanceof HTMLElement))
|
|
24
23
|
throw new TypeError("Argument 1 ('target') to client.startViewTransition must be an instance of HTMLElement");
|
|
25
24
|
if (!['forwards', 'backwards', 'reload'].includes(type))
|
|
@@ -58,9 +57,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
|
|
|
58
57
|
// dialogFrames = [toFrame, ...(Snapshot.leaveFrames ?? [])].filter((item): item is HTMLDialogElement => item instanceof HTMLDialogElement) //[toFrame, ...(Snapshot.leaveFrames ?? [])].filter((item) => item?.matches('dialog'))
|
|
59
58
|
// if ('DIALOG' === newHost?.tagName) {
|
|
60
59
|
// ;(newHost as HTMLDialogElement).showModal()
|
|
61
|
-
//
|
|
60
|
+
// debug(`⚡️ view-transition-start (${type})`)
|
|
62
61
|
// await Promise.allSettled(newHost.getAnimations().map(({ finished }) => finished))
|
|
63
|
-
//
|
|
62
|
+
// debug(`⚡️ view-transition-end (${type})`)
|
|
64
63
|
// return
|
|
65
64
|
// }
|
|
66
65
|
// purge
|
|
@@ -83,18 +82,14 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
|
|
|
83
82
|
if (0 < modalViews.length) {
|
|
84
83
|
for await (const el of modalViews)
|
|
85
84
|
el.showModal();
|
|
86
|
-
|
|
87
|
-
console.debug(`⚡️ view-dialog-transition-start (${type})`);
|
|
85
|
+
debug(`⚡️ view-dialog-transition-start (${type})`);
|
|
88
86
|
await Promise.allSettled(modalViews?.[0].getAnimations().map(({ finished }) => finished));
|
|
89
|
-
|
|
90
|
-
console.debug(`⚡️ view-dialog-transition-end (${type})`);
|
|
87
|
+
debug(`⚡️ view-dialog-transition-end (${type})`);
|
|
91
88
|
}
|
|
92
89
|
else {
|
|
93
|
-
|
|
94
|
-
console.debug(`⚡️ view-transition-start (${type})`);
|
|
90
|
+
debug(`⚡️ view-transition-start (${type})`);
|
|
95
91
|
await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to?.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
|
|
96
|
-
|
|
97
|
-
console.debug(`⚡️ view-transition-end (${type})`);
|
|
92
|
+
debug(`⚡️ view-transition-end (${type})`);
|
|
98
93
|
}
|
|
99
94
|
if (0 < (to?.component?.querySelectorAll(`.${Snapshot.config?.['vt-fwd-class-name']},.bwd`) ?? []).length)
|
|
100
95
|
return;
|
|
@@ -115,11 +110,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
|
|
|
115
110
|
if ('DIALOG' === from.component?.tagName) {
|
|
116
111
|
from.body?.dispatchEvent(new CustomEvent('pageswap', { detail: { page: from.body }, bubbles: true, composed: true }));
|
|
117
112
|
from.component.close();
|
|
118
|
-
|
|
119
|
-
console.debug(`⚡️ view-dialog-transition-start (${type})`);
|
|
113
|
+
debug(`⚡️ view-dialog-transition-start (${type})`);
|
|
120
114
|
await Promise.allSettled(from.component.getAnimations().map(({ finished }) => finished));
|
|
121
|
-
|
|
122
|
-
console.debug(`⚡️ view-dialog-transition-end (${type})`);
|
|
115
|
+
debug(`⚡️ view-dialog-transition-end (${type})`);
|
|
123
116
|
if (from.component.matches('[open]'))
|
|
124
117
|
return;
|
|
125
118
|
await updateCallback();
|
|
@@ -154,11 +147,9 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
|
|
|
154
147
|
for (const el of inbetweenModals)
|
|
155
148
|
el.close(); // close old inbetween modals
|
|
156
149
|
// capture trans
|
|
157
|
-
|
|
158
|
-
console.debug(`⚡️ view-transition-start (${type})`);
|
|
150
|
+
debug(`⚡️ view-transition-start (${type})`);
|
|
159
151
|
await Promise.allSettled([...(from.body?.getAnimations().map(({ finished }) => finished) ?? []), ...(to.body?.getAnimations().map(({ finished }) => finished) ?? [])]);
|
|
160
|
-
|
|
161
|
-
console.debug(`⚡️ view-transition-end (${type})`);
|
|
152
|
+
debug(`⚡️ view-transition-end (${type})`);
|
|
162
153
|
if (to.body?.closest(`.bwd,.${Snapshot.config?.['vt-fwd-class-name']}`))
|
|
163
154
|
return;
|
|
164
155
|
cleanup(root);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type TemplateResult } from '../../tpl';
|
|
2
|
+
declare const DEFAULT: ">1";
|
|
3
|
+
interface MintFn {
|
|
4
|
+
(markup: TemplateResult): DocumentFragment;
|
|
5
|
+
<T extends Element = Element>(markup: TemplateResult, selector: typeof DEFAULT): T;
|
|
6
|
+
<T extends Element = Element>(markup: TemplateResult, selector: string): T;
|
|
7
|
+
}
|
|
8
|
+
declare const mint: MintFn;
|
|
9
|
+
export default mint;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { renderToString } from '../../morphdom';
|
|
2
|
+
const DEFAULT = '>1';
|
|
3
|
+
const mint = ((markup, selector) => {
|
|
4
|
+
const template = Object.assign(document.createElement('template'), { innerHTML: renderToString(markup).toString() });
|
|
5
|
+
if (!selector)
|
|
6
|
+
return template.content;
|
|
7
|
+
if (selector === DEFAULT)
|
|
8
|
+
return template.content.firstElementChild;
|
|
9
|
+
return template.content.querySelector('>1' === selector ? ':first-child' : selector);
|
|
10
|
+
});
|
|
11
|
+
export default mint;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function (...args: Parameters<typeof self.console.debug>): void;
|
|
@@ -1,20 +1,54 @@
|
|
|
1
|
+
export { default as $ } from './$';
|
|
2
|
+
export * from './$';
|
|
1
3
|
export { default as add } from './add';
|
|
2
|
-
export
|
|
4
|
+
export * from './add';
|
|
5
|
+
export { default as ancestors } from './ancestors';
|
|
6
|
+
export * from './ancestors';
|
|
3
7
|
export { default as clamp } from './clamp';
|
|
8
|
+
export * from './clamp';
|
|
4
9
|
export { default as compareBigDecimals } from './compare-big-decimals';
|
|
10
|
+
export * from './compare-big-decimals';
|
|
5
11
|
export { default as cssTime } from './css-time';
|
|
12
|
+
export * from './css-time';
|
|
6
13
|
export { default as debounce } from './debounce';
|
|
14
|
+
export * from './debounce';
|
|
15
|
+
export { default as debug } from './debug';
|
|
16
|
+
export * from './debug';
|
|
7
17
|
export { default as defineTranslations } from './define-translations';
|
|
8
|
-
export
|
|
18
|
+
export * from './define-translations';
|
|
9
19
|
export { default as ensurePlaceholder } from './ensure-placeholder';
|
|
20
|
+
export * from './ensure-placeholder';
|
|
10
21
|
export { default as frame } from './frame';
|
|
22
|
+
export * from './frame';
|
|
11
23
|
export { default as isInside } from './is-inside';
|
|
24
|
+
export * from './is-inside';
|
|
12
25
|
export { default as kebabCase } from './kebab-case';
|
|
26
|
+
export * from './kebab-case';
|
|
13
27
|
export { default as listActive } from './list-active';
|
|
28
|
+
export * from './list-active';
|
|
14
29
|
export { default as microtask } from './microtask';
|
|
30
|
+
export * from './microtask';
|
|
31
|
+
export { default as nextAll } from './next-all';
|
|
32
|
+
export * from './next-all';
|
|
33
|
+
export { default as next } from './next';
|
|
34
|
+
export * from './next';
|
|
15
35
|
export { default as onoff } from './onoff';
|
|
36
|
+
export * from './onoff';
|
|
37
|
+
export { default as prevAll } from './prev-all';
|
|
38
|
+
export * from './prev-all';
|
|
39
|
+
export { default as prev } from './prev';
|
|
40
|
+
export * from './prev';
|
|
41
|
+
export { default as prop } from './prop';
|
|
42
|
+
export * from './prop';
|
|
16
43
|
export { default as set } from './set';
|
|
44
|
+
export * from './set';
|
|
45
|
+
export { default as siblings } from './siblings';
|
|
46
|
+
export * from './siblings';
|
|
17
47
|
export { default as sleep } from './sleep';
|
|
48
|
+
export * from './sleep';
|
|
18
49
|
export { default as slowHideShow } from './slow-hide-show';
|
|
50
|
+
export * from './slow-hide-show';
|
|
19
51
|
export { default as timeout } from './timeout';
|
|
52
|
+
export * from './timeout';
|
|
20
53
|
export { default as touchGlass } from './touch-glass';
|
|
54
|
+
export * from './touch-glass';
|
|
@@ -1,23 +1,54 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export { default as $ } from './$';
|
|
2
|
+
export * from './$';
|
|
3
3
|
export { default as add } from './add';
|
|
4
|
-
export
|
|
4
|
+
export * from './add';
|
|
5
|
+
export { default as ancestors } from './ancestors';
|
|
6
|
+
export * from './ancestors';
|
|
5
7
|
export { default as clamp } from './clamp';
|
|
8
|
+
export * from './clamp';
|
|
6
9
|
export { default as compareBigDecimals } from './compare-big-decimals';
|
|
10
|
+
export * from './compare-big-decimals';
|
|
7
11
|
export { default as cssTime } from './css-time';
|
|
12
|
+
export * from './css-time';
|
|
8
13
|
export { default as debounce } from './debounce';
|
|
14
|
+
export * from './debounce';
|
|
15
|
+
export { default as debug } from './debug';
|
|
16
|
+
export * from './debug';
|
|
9
17
|
export { default as defineTranslations } from './define-translations';
|
|
10
|
-
export
|
|
18
|
+
export * from './define-translations';
|
|
11
19
|
export { default as ensurePlaceholder } from './ensure-placeholder';
|
|
20
|
+
export * from './ensure-placeholder';
|
|
12
21
|
export { default as frame } from './frame';
|
|
22
|
+
export * from './frame';
|
|
13
23
|
export { default as isInside } from './is-inside';
|
|
24
|
+
export * from './is-inside';
|
|
14
25
|
export { default as kebabCase } from './kebab-case';
|
|
26
|
+
export * from './kebab-case';
|
|
15
27
|
export { default as listActive } from './list-active';
|
|
28
|
+
export * from './list-active';
|
|
16
29
|
export { default as microtask } from './microtask';
|
|
30
|
+
export * from './microtask';
|
|
31
|
+
export { default as nextAll } from './next-all';
|
|
32
|
+
export * from './next-all';
|
|
33
|
+
export { default as next } from './next';
|
|
34
|
+
export * from './next';
|
|
17
35
|
export { default as onoff } from './onoff';
|
|
36
|
+
export * from './onoff';
|
|
37
|
+
export { default as prevAll } from './prev-all';
|
|
38
|
+
export * from './prev-all';
|
|
39
|
+
export { default as prev } from './prev';
|
|
40
|
+
export * from './prev';
|
|
41
|
+
export { default as prop } from './prop';
|
|
42
|
+
export * from './prop';
|
|
18
43
|
export { default as set } from './set';
|
|
44
|
+
export * from './set';
|
|
45
|
+
export { default as siblings } from './siblings';
|
|
46
|
+
export * from './siblings';
|
|
19
47
|
export { default as sleep } from './sleep';
|
|
48
|
+
export * from './sleep';
|
|
20
49
|
export { default as slowHideShow } from './slow-hide-show';
|
|
50
|
+
export * from './slow-hide-show';
|
|
21
51
|
export { default as timeout } from './timeout';
|
|
52
|
+
export * from './timeout';
|
|
22
53
|
export { default as touchGlass } from './touch-glass';
|
|
23
|
-
|
|
54
|
+
export * from './touch-glass';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { debug, onoff } from '../internal/utils';
|
|
2
2
|
export class Snapshot {
|
|
3
3
|
static #readyCalled = false;
|
|
4
4
|
static #config;
|
|
@@ -45,12 +45,10 @@ export class Snapshot {
|
|
|
45
45
|
const mediaQueryList = self.matchMedia(`(pointer: fine) and (min-width: ${this.#config['ipad-sheet-view-inline-size']}) and (min-height: ${this.#config['ipad-sheet-view-height']})`);
|
|
46
46
|
this.#breakpoints = new Map([['fine_dialog_sheet', mediaQueryList.matches]]);
|
|
47
47
|
this.#listeners.add(onoff('change', (evt) => this.#handleMediaChange(evt, 'fine_dialog_sheet:change'), mediaQueryList).on());
|
|
48
|
-
|
|
49
|
-
console.debug(this.#config);
|
|
48
|
+
debug(this.#config);
|
|
50
49
|
}
|
|
51
50
|
static #handleMediaChange = ({ type, matches, media }, kind) => {
|
|
52
|
-
|
|
53
|
-
console.debug(`${Snapshot.name} ⚡️ ${type}`);
|
|
51
|
+
debug(`${Snapshot.name} ⚡️ ${type}`);
|
|
54
52
|
this.#breakpoints?.set('fine_dialog_sheet', matches);
|
|
55
53
|
this.on.dispatchEvent(new MediaQueryListEvent(kind, {
|
|
56
54
|
matches,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swiftwc/ui",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.106",
|
|
4
4
|
"description": "Elegant SwiftUI-inspired web components for standalone web apps and web extensions.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -66,20 +66,24 @@
|
|
|
66
66
|
"build:ts": "tsc",
|
|
67
67
|
"build:scss": "sass --style=expanded --no-source-map scss/index.scss generated/css/index.css",
|
|
68
68
|
"build:manifest": "tsx scripts/make-manifest.ts && prettier ./web-components.html-data/en.json && prettier ./web-components.css-data/en.json --write",
|
|
69
|
-
"build:barrels": "npm run build:barrels:components && npm run build:barrels:events && npm run build:barrels:buses && npm run build:barrels:tpl && npm run build:barrels:morphdom && npm run build:barrels:
|
|
69
|
+
"build:barrels": "npm run build:barrels:components && npm run build:barrels:events && npm run build:barrels:buses && npm run build:barrels:i18n && npm run build:barrels:tpl && npm run build:barrels:morphdom && npm run build:barrels:decorators && npm run build:barrels:utils",
|
|
70
70
|
"build:barrels:components": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/components --exclude \".\\.test\\.ts\"",
|
|
71
71
|
"build:barrels:events": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --directory ./js/events --exclude \".\\.test\\.ts\"",
|
|
72
|
-
"build:barrels:buses": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/buses",
|
|
73
|
-
"build:barrels:i18n": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --fullPathname --directory ./js/i18n/locales",
|
|
72
|
+
"build:barrels:buses": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/buses --exclude \".\\.test\\.ts\"",
|
|
73
|
+
"build:barrels:i18n": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --fullPathname --directory ./js/i18n/locales --exclude \".\\.test\\.ts\"",
|
|
74
74
|
"build:barrels:tpl": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/tpl --exclude \".\\.test\\.ts\"",
|
|
75
75
|
"build:barrels:morphdom": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/morphdom --exclude \".\\.test\\.ts\"",
|
|
76
|
-
"build:barrels:decorators": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/internal/decorators",
|
|
76
|
+
"build:barrels:decorators": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/internal/decorators --exclude \".\\.test\\.ts\"",
|
|
77
|
+
"build:barrels:utils": "barrelsby --noHeader --delete --singleQuotes --noSemicolon --exportDefault --directory ./js/internal/utils --exclude \".\\.test\\.ts\"",
|
|
77
78
|
"format:check": "prettier . --check",
|
|
78
79
|
"format:write": "prettier . --write",
|
|
79
80
|
"lint:scripts": "tsc -p tsconfig.scripts.json --noEmit",
|
|
80
81
|
"test": "vitest --dom",
|
|
81
|
-
"prepackage": "rm -rf generated",
|
|
82
|
-
"package": "npm run build:ts && npm run build:scss",
|
|
82
|
+
"prepackage": "rm -rf generated && npm run debug:off",
|
|
83
|
+
"package": "npm run build:ts && npm run build:scss ; npm run debug:reset",
|
|
84
|
+
"postpublish": "git checkout dev",
|
|
85
|
+
"debug:off": "node -e \"const fs=require('node:fs');const f='./js/internal/flags.json';const j=JSON.parse(fs.readFileSync(f));j.DEBUG=false;fs.writeFileSync(f,JSON.stringify(j,null,2)+'\\n')\"",
|
|
86
|
+
"debug:reset": "git checkout -- ./js/internal/flags.json",
|
|
83
87
|
"version:pkg": "npm version $npm_config_bump --no-git-tag-version --preid=dev"
|
|
84
88
|
},
|
|
85
89
|
"devDependencies": {
|
|
@@ -248,7 +248,7 @@ $picker-ifs: (
|
|
|
248
248
|
style(--picker-style: sheet): var(--itemborder,) ; style(--picker-style: navigation-link): var(--itemborder,) ; style(--picker-style: menu): var(--itemborder,) ;
|
|
249
249
|
);
|
|
250
250
|
// --picker--input-stack-child-place-self: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu): end ;);
|
|
251
|
-
--picker--input-stack-text-align: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu):
|
|
251
|
+
--picker--input-stack-text-align: if(style(--picker-style: sheet): end ; style(--picker-style: navigation-link): end ; style(--picker-style: menu): start ;);
|
|
252
252
|
|
|
253
253
|
// SECTION experimental only in chrome
|
|
254
254
|
// --picker--input-stack-flex-shrink: if(
|
|
@@ -305,6 +305,10 @@
|
|
|
305
305
|
],
|
|
306
306
|
"description": "A control that starts an action. Styled with a prominent glass border, adapting to the button’s surroundings.\n---\n\n```ts\ninterface GlassProminentButtonSignature {\n Attributes: {\n role?: 'destructive' | 'confirm' // A value that describes the purpose of a button\n 'title-key'?: string\n }\n\n Slots: {\n overlay: HTMLElement[]\n }\n}\n\nclass GlassProminentButton extends HTMLButtonElement<GlassProminentButtonSignature> {}\n\ndeclare global {\n interface HTMLButtonElement {\n is: 'glass-prominent-button' // <button is=\"glass-prominent-button\"></button>\n }\n}\n\n```\n\n### **Examples:**\n**Creating a prominent glass button:**\n```html\n<button is=\"glass-prominent-button\">\n <label-view system-image=\"hand-tap\" title=\"Tap Me\"></label-view>\n</button>\n\n```\n"
|
|
307
307
|
},
|
|
308
|
+
{
|
|
309
|
+
"name": "h-divider",
|
|
310
|
+
"description": "undefined\n\n```ts\ninterface HDividerSignature {}\n\nclass HDivider extends HTMLElement<HDividerSignature> {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'h-divider': HDivider // <h-divider></h-divider>\n }\n}\n\n```\n"
|
|
311
|
+
},
|
|
308
312
|
{
|
|
309
313
|
"name": "h-stack",
|
|
310
314
|
"references": [
|
|
@@ -949,6 +953,10 @@
|
|
|
949
953
|
],
|
|
950
954
|
"description": "A list of items placed into the toolbar or navigation bar around your content.\n---\n\n```ts\ninterface ToolBarSignature {\n Slots: {\n 'cancellation-action': HTMLElement[] // The item represents a cancellation action for a modal interface. Places the item in the leading edge of the top bar and on the trailing edge of the bottom bar when fine modal\n 'primary-action': HTMLElement[] // The item represents a primary action. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal\n 'confirmation-action': HTMLElement[] // The item represents a confirmation action for a modal interface. Places the item in the trailing edge of the top bar and on the trailing edge of the bottom bar when fine modal\n 'destructive-action': HTMLElement[] // The item represents a destructive action for a modal interface. Places the item in the leading edge of the top bar and on the leading edge of the bottom bar when fine modal\n 'top-bar-leading': HTMLElement[] // Places the item in the leading edge of the top bar\n 'top-bar-principal': HTMLElement[] // Places the item in the middle of the top bar\n 'top-bar-trailing': HTMLElement[] // Places the item in the trailing edge of the top bar\n 'bottom-bar-leading': HTMLElement[] // Places the item in the leading edge of the bottom bar\n 'bottom-bar-principal': HTMLElement[] // Places the item in the middle of the bottom bar\n 'bottom-bar-trailing': HTMLElement[] // Places the item in the trailing edge of the bottom bar\n }\n}\n\nclass ToolBar extends HTMLElement<ToolBarSignature> {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'tool-bar': ToolBar // <tool-bar></tool-bar>\n }\n}\n\n```\n"
|
|
951
955
|
},
|
|
956
|
+
{
|
|
957
|
+
"name": "v-divider",
|
|
958
|
+
"description": "undefined\n\n```ts\ninterface VDividerSignature {}\n\nclass VDivider extends HTMLElement<VDividerSignature> {}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'v-divider': VDivider // <v-divider></v-divider>\n }\n}\n\n```\n"
|
|
959
|
+
},
|
|
952
960
|
{
|
|
953
961
|
"name": "v-keyboard",
|
|
954
962
|
"references": [
|