@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.
- package/generated/client/index.js +8 -9
- package/generated/components/alert-dialog.js +9 -17
- 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.d.ts +1 -1
- package/generated/components/content-unavailable.js +5 -8
- package/generated/components/{body-view.d.ts → content-view.d.ts} +2 -2
- package/generated/components/content-view.js +15 -0
- package/generated/components/date-picker.js +13 -25
- package/generated/components/detail-placeholder.d.ts +11 -0
- package/generated/components/detail-placeholder.js +15 -0
- 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-flex-stack.d.ts +16 -0
- package/generated/components/h-flex-stack.js +18 -0
- package/generated/components/h-stack.js +3 -5
- package/generated/components/image-view.js +4 -7
- package/generated/components/index.d.ts +7 -1
- package/generated/components/index.js +7 -1
- package/generated/components/label-view.d.ts +2 -2
- package/generated/components/label-view.js +6 -9
- package/generated/components/labeled-content.d.ts +7 -1
- package/generated/components/labeled-content.js +32 -32
- package/generated/components/list-view.d.ts +5 -1
- package/generated/components/list-view.js +8 -6
- package/generated/components/menu-view.d.ts +1 -1
- package/generated/components/menu-view.js +11 -20
- package/generated/components/navigation-large-title.d.ts +0 -1
- package/generated/components/navigation-large-title.js +5 -10
- 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.d.ts +4 -21
- package/generated/components/picker-view.js +374 -326
- package/generated/components/plain-button.js +3 -5
- package/generated/components/progress-view.d.ts +1 -1
- package/generated/components/progress-view.js +7 -12
- package/generated/components/screen-view.js +2 -3
- package/generated/components/scroll-view-proxy.js +3 -5
- package/generated/components/scroll-view.d.ts +1 -1
- package/generated/components/scroll-view.js +10 -17
- package/generated/components/search-view.js +4 -7
- package/generated/components/section-view.d.ts +1 -1
- package/generated/components/section-view.js +5 -8
- 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 +19 -23
- package/generated/components/table-view.d.ts +1 -1
- package/generated/components/table-view.js +7 -12
- package/generated/components/text-field.js +10 -19
- package/generated/components/text-view.d.ts +11 -0
- package/generated/components/text-view.js +16 -0
- package/generated/components/toggle-view.d.ts +2 -0
- package/generated/components/toggle-view.js +33 -37
- 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-flex-stack.d.ts +16 -0
- package/generated/components/v-flex-stack.js +18 -0
- package/generated/components/v-keyboard.js +8 -12
- package/generated/components/v-stack.js +3 -5
- package/generated/css/index.css +762 -418
- package/generated/internal/class/css-style-observer.js +2 -3
- package/generated/internal/class/form-associated-base.js +6 -8
- package/generated/internal/class/navigation-path.js +2 -2
- 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/dev-flags.d.ts +4 -0
- package/generated/internal/dev-flags.js +1 -0
- package/generated/internal/privateNamespace.d.ts +2 -2
- package/generated/internal/privateNamespace.js +15 -24
- 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/{web-components.html-data → html-data}/en.json +155 -54
- package/package.json +24 -20
- package/scss/_components.scss +1 -1
- package/scss/_maps.scss +3 -1
- package/scss/_utils.scss +3 -1
- package/scss/_vars.scss +1 -0
- package/scss/base/_layout.scss +8 -8
- package/scss/base/_reboot.scss +4 -29
- package/scss/base/_root.scss +27 -12
- package/scss/colors/_index.scss +66 -1
- package/scss/components/_alert-dialog.scss +3 -3
- package/scss/components/_bordered-button.scss +2 -2
- package/scss/components/_bordered-prominent-button.scss +3 -3
- package/scss/components/_borderless-button.scss +2 -2
- package/scss/components/_confirmation-dialog.scss +1 -1
- package/scss/components/_content-unavailable.scss +1 -1
- package/scss/components/{_body-view.scss → _content-view.scss} +2 -2
- package/scss/components/_date-picker.scss +1 -1
- package/scss/components/_detail-placeholder.scss +5 -5
- package/scss/components/_disclosure-group.scss +2 -2
- package/scss/components/_fine-tooltip.scss +1 -1
- package/scss/components/_form-view.scss +3 -3
- package/scss/components/_full-screen.scss +1 -1
- package/scss/components/_glass-button.scss +2 -2
- package/scss/components/_glass-prominent-button.scss +3 -3
- package/scss/components/_group-box.scss +1 -1
- package/scss/components/_h-divider.scss +1 -1
- package/scss/components/_h-flex-stack.scss +3 -1
- package/scss/components/_h-stack.scss +1 -1
- package/scss/components/_image-view.scss +1 -1
- package/scss/components/_index.scss +34 -24
- package/scss/components/_label-view.scss +1 -1
- package/scss/components/_labeled-content.scss +1 -1
- package/scss/components/_list-view.scss +3 -3
- package/scss/components/_menu-view.scss +3 -3
- package/scss/components/_navigation-large-title.scss +15 -9
- package/scss/components/_navigation-split-view.scss +18 -18
- package/scss/components/_navigation-stack.scss +1 -1
- package/scss/components/_navigation-title.scss +1 -1
- package/scss/components/_picker-view.scss +159 -119
- package/scss/components/_plain-button.scss +2 -2
- package/scss/components/_progress-view.scss +1 -1
- package/scss/components/_scroll-view-proxy.scss +1 -1
- package/scss/components/_scroll-view-toolbars.scss +1 -1
- package/scss/components/_scroll-view.scss +2 -2
- package/scss/components/_search-view.scss +1 -1
- package/scss/components/_section-view.scss +1 -1
- package/scss/components/_sheet-view.scss +2 -2
- package/scss/components/_sidebar-toggle.scss +1 -1
- package/scss/components/_sidebar-view.scss +2 -2
- package/scss/components/_sticky-container.scss +1 -1
- package/scss/components/_tab-bar.scss +1 -1
- package/scss/components/_tab-item.scss +1 -1
- package/scss/components/_tab-view.scss +23 -15
- package/scss/components/_table-column.scss +1 -1
- package/scss/components/_table-row.scss +1 -1
- package/scss/components/_table-view.scss +1 -1
- package/scss/components/_text-field.scss +1 -1
- package/scss/components/_text-view.scss +1 -1
- package/scss/components/_toggle-view.scss +41 -21
- package/scss/components/_tool-bar-item-group.scss +1 -1
- package/scss/components/_tool-bar-item.scss +2 -2
- package/scss/components/_tool-bar.scss +2 -2
- package/scss/components/_v-divider.scss +1 -1
- package/scss/components/_v-flex-stack.scss +3 -1
- package/scss/components/_v-keyboard.scss +1 -1
- package/scss/components/_v-stack.scss +1 -1
- package/scss/final/_touch-glass.scss +2 -2
- package/scss/mixins/_index.scss +2 -2
- package/scss/placeholders/_buttons.scss +5 -5
- package/scss/placeholders/_lists.scss +3 -3
- package/scss/transitions/_alert-dialog.scss +1 -1
- package/scss/transitions/_bwd.navbar.scss +1 -1
- package/scss/transitions/_bwd.scss +3 -3
- package/scss/transitions/_confirmation-dialog.scss +1 -1
- package/scss/transitions/_disclosure-group.scss +1 -1
- package/scss/transitions/_fine-tooltip.scss +1 -1
- package/scss/transitions/_fwd.navbar.scss +1 -1
- package/scss/transitions/_fwd.scss +1 -1
- package/scss/transitions/_glass-button.scss +1 -1
- package/scss/transitions/_glass-prominent-button.scss +1 -1
- package/scss/transitions/_index.scss +1 -1
- package/scss/transitions/_menu-view.scss +1 -1
- package/scss/transitions/_navigation-split-view.scss +1 -1
- package/scss/transitions/_progress-view.scss +1 -1
- package/scss/transitions/_sheet-view.scss +1 -1
- package/scss/transitions/_sidebar-view.scss +1 -1
- package/scss/transitions/_tab-bar.scss +1 -1
- package/scss/utils/_background.scss +52 -0
- package/scss/utils/_frame.scss +2 -2
- package/scss/utils/_index.scss +33 -8
- package/scss/utils/_spacing.scss +1 -1
- package/scss/utils/_stacks.scss +5 -3
- package/generated/components/body-view.js +0 -17
- 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/{web-components.css-data → css-data}/en.json +0 -0
- /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
- /package/scss/utils/{_scroll-view.scss → _scroll-view.scss.txt} +0 -0
|
@@ -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 }]
|
|
@@ -29,18 +29,16 @@ export class FormAssociatedBase extends HTMLElement {
|
|
|
29
29
|
}
|
|
30
30
|
constructor() {
|
|
31
31
|
super();
|
|
32
|
-
internals.set(this, this.attachInternals?.())
|
|
32
|
+
internals.set(this, this.attachInternals()); //internals.set(this, this.attachInternals?.())
|
|
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;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Gets current host (closest)
|
|
3
3
|
*/
|
|
4
4
|
function closestHost(any) {
|
|
5
|
-
return any?.closest('
|
|
5
|
+
return any?.closest('content-view,[is=sheet-view],navigation-stack,navigation-split-view') ?? undefined;
|
|
6
6
|
}
|
|
7
7
|
export class NavigationPath {
|
|
8
8
|
#component;
|
|
@@ -49,7 +49,7 @@ export class NavigationPath {
|
|
|
49
49
|
}
|
|
50
50
|
#querySlot() {
|
|
51
51
|
this.#slot =
|
|
52
|
-
this.#component?.querySelector(':scope>
|
|
52
|
+
this.#component?.querySelector(':scope>content-view:not([hidden]),:scope>[is=sheet-view]:not([hidden]),:scope>navigation-stack:not([hidden]),:scope>navigation-split-view:not([hidden])') ?? null;
|
|
53
53
|
}
|
|
54
54
|
hydrate() {
|
|
55
55
|
this.#queryBody();
|
|
@@ -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
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default { DEBUG: false };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type * as Components from '../components';
|
|
2
2
|
import { NavigationPath } from '../internal/class/navigation-path';
|
|
3
3
|
type TransitionType = 'forwards' | 'backwards' | 'reload';
|
|
4
|
-
export type NavigationHost = Components.
|
|
4
|
+
export type NavigationHost = Components.ContentView | Components.SheetView | Components.NavigationStack | Components.NavigationSplitView;
|
|
5
5
|
export type NavigationToolbarConfiguration = Components.ToolBarItem | Components.ToolBarItemGroup;
|
|
6
6
|
export type NavigationPage = Components.SidebarView | Components.ScrollView;
|
|
7
|
-
export declare function queryInsertPosition(frame
|
|
7
|
+
export declare function queryInsertPosition(frame?: NavigationHost): "afterend" | "beforebegin";
|
|
8
8
|
type UpdateCallback = () => void | Promise<void>;
|
|
9
9
|
type NavigateOptions = {
|
|
10
10
|
updateCallback?: UpdateCallback;
|
|
@@ -1,10 +1,10 @@
|
|
|
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)
|
|
6
6
|
return 'beforebegin'; // lookFor = 'previousElementSibling'
|
|
7
|
-
else if ('NAVIGATION-SPLIT-VIEW' === frame?.parentElement?.tagName && frame?.parentElement.querySelector(':scope>[is=sidebar-view]') && '
|
|
7
|
+
else if ('NAVIGATION-SPLIT-VIEW' === frame?.parentElement?.tagName && frame?.parentElement.querySelector(':scope>[is=sidebar-view]') && 'CONTENT-VIEW' === frame?.tagName)
|
|
8
8
|
return 'beforebegin'; // lookFor = 'previousElementSibling'
|
|
9
9
|
return 'afterend'; // lookFor = 'nextElementSibling'
|
|
10
10
|
}
|
|
@@ -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
|
|
@@ -72,8 +71,8 @@ export const startViewTransition = async (target, type = 'forwards', updateCallb
|
|
|
72
71
|
oldToolbar.classList.add('fwn'); // prepare navbs
|
|
73
72
|
// prepare new
|
|
74
73
|
const toolbarExclusion = 0 < modalViews.length
|
|
75
|
-
? (value, index, array) => value.parentElement?.matches('tool-bar:not(dialog tool-bar,
|
|
76
|
-
: (value, index, array) => value.parentElement?.matches('tool-bar:not(
|
|
74
|
+
? (value, index, array) => value.parentElement?.matches('tool-bar:not(dialog tool-bar,content-view ~ tool-bar)')
|
|
75
|
+
: (value, index, array) => value.parentElement?.matches('tool-bar:not(content-view ~ tool-bar)'), bodyExclusion = 0 < modalViews.length ? (item) => item.body?.matches('scroll-view:not(dialog scroll-view)') : (value, index, array) => value;
|
|
77
76
|
for (const bti of newToolbars?.filter?.(toolbarExclusion) ?? [])
|
|
78
77
|
bti.classList.add('fwnn'); // for (const ti of newToolbars ?? []) ti.classList.add('fwnn') //
|
|
79
78
|
for (const bt of tos?.filter?.(bodyExclusion) ?? []) {
|
|
@@ -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,
|