@swiftwc/ui 0.0.0-dev.3 → 0.0.0-dev.5
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.d.ts +5 -1
- package/generated/client/index.js +222 -7
- package/generated/components/body-view.d.ts +5 -0
- package/generated/components/body-view.js +11 -0
- package/generated/components/borderless-button.d.ts +9 -0
- package/generated/components/borderless-button.js +25 -0
- package/generated/components/bottom-bar.d.ts +10 -0
- package/generated/components/bottom-bar.js +73 -0
- package/generated/components/disclosure-group.d.ts +12 -0
- package/generated/components/disclosure-group.js +76 -0
- package/generated/components/index.d.ts +15 -1
- package/generated/components/index.js +15 -1
- package/generated/components/navigation-bar.d.ts +10 -0
- package/generated/components/navigation-bar.js +80 -0
- package/generated/components/navigation-split-view.d.ts +5 -0
- package/generated/components/navigation-split-view.js +9 -0
- package/generated/components/navigation-stack.d.ts +6 -0
- package/generated/components/navigation-stack.js +67 -0
- package/generated/components/screen-view.d.ts +5 -0
- package/generated/components/screen-view.js +9 -0
- package/generated/components/scroll-view.d.ts +8 -0
- package/generated/components/scroll-view.js +80 -0
- package/generated/components/sheet-view.d.ts +9 -0
- package/generated/components/sheet-view.js +26 -0
- package/generated/components/sidebar-toggle.d.ts +7 -0
- package/generated/components/sidebar-toggle.js +81 -0
- package/generated/components/sidebar-view.d.ts +9 -0
- package/generated/components/sidebar-view.js +26 -0
- package/generated/components/tab-bar.d.ts +9 -0
- package/generated/components/tab-bar.js +26 -0
- package/generated/components/tab-item.d.ts +6 -0
- package/generated/components/tab-item.js +35 -0
- package/generated/components/tab-view.d.ts +7 -0
- package/generated/components/tab-view.js +29 -0
- package/generated/components/v-keyboard.d.ts +9 -0
- package/generated/components/v-keyboard.js +82 -0
- package/generated/index.js +1 -1
- package/generated/internal/class.d.ts +18 -0
- package/generated/internal/class.js +18 -0
- package/generated/internal/utils/css-time.d.ts +1 -0
- package/generated/internal/utils/css-time.js +3 -0
- package/generated/internal/utils/index.d.ts +2 -1
- package/generated/internal/utils/index.js +2 -1
- package/generated/internal/utils/kebab-case.js +3 -3
- package/generated/namespace/index.d.ts +6 -0
- package/generated/namespace/index.js +1 -0
- package/generated/snapshot/index.d.ts +16 -0
- package/generated/snapshot/index.js +150 -0
- package/generated/styles.css +1298 -1
- package/package.json +8 -4
- package/scss/_base.scss +5 -0
- package/scss/_components.scss +39 -0
- package/scss/_dev.scss +68 -0
- package/scss/_functions.scss +21 -0
- package/scss/_mixins.scss +172 -0
- package/scss/_transitions.scss +11 -0
- package/scss/_vars.scss +57 -0
- package/scss/base/_layout.scss +40 -0
- package/scss/base/_reboot.scss +55 -0
- package/scss/base/_root.scss +69 -0
- package/scss/colors/_index.scss +99 -0
- package/scss/components/_body-view.scss +8 -0
- package/scss/components/_borderless-button.scss +14 -0
- package/scss/components/_disclosure-group.scss +80 -0
- package/scss/components/_full-screen.scss +13 -0
- package/scss/components/_index.scss +24 -0
- package/scss/components/_navigation-split-view.scss +364 -0
- package/scss/components/_navigation-stack.scss +11 -0
- package/scss/components/_scroll-view.scss +86 -0
- package/scss/components/_sheet-view.scss +60 -0
- package/scss/components/_sidebar-toggle.scss +61 -0
- package/scss/components/_sidebar-view.scss +63 -0
- package/scss/components/_tab-bar-stack.scss +101 -0
- package/scss/components/_tab-bar.scss +137 -0
- package/scss/components/_tab-view.scss +168 -0
- package/scss/components/_tool-bar-item-group.scss +37 -0
- package/scss/components/_tool-bar-item.scss +87 -0
- package/scss/components/_tool-bar.scss +90 -0
- package/scss/components/_toolbars.scss +100 -0
- package/scss/components/_v-keyboard.scss +12 -0
- package/scss/components/_v-stack.scss +19 -0
- package/scss/index.scss +11 -6
- package/scss/transitions/_bwd.navbar.scss +29 -0
- package/scss/transitions/_bwd.scss +55 -0
- package/scss/transitions/_dialog.scss +32 -0
- package/scss/transitions/_fwd.navbar.scss +46 -0
- package/scss/transitions/_fwd.scss +54 -0
- package/scss/transitions/_index.scss +182 -0
- package/generated/internal/snapshot.d.ts +0 -5
- package/generated/internal/snapshot.js +0 -23
- package/scss/_reboot.scss +0 -11
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type * as Components from '../components';
|
|
2
|
+
export declare class Snapshot {
|
|
3
|
+
#private;
|
|
4
|
+
static get config(): Record<string, string> | undefined;
|
|
5
|
+
static setOwnConfig(): Promise<void>;
|
|
6
|
+
static get parent(): Components.ScrollView | undefined;
|
|
7
|
+
static get root(): HTMLElement | undefined;
|
|
8
|
+
static get leaf(): Components.ScrollView | undefined;
|
|
9
|
+
static get parentContainer(): HTMLElement | undefined;
|
|
10
|
+
static get leafContainer(): HTMLElement | undefined;
|
|
11
|
+
static get container(): HTMLElement | undefined;
|
|
12
|
+
static get toolbarItems(): NodeListOf<Element> | undefined;
|
|
13
|
+
static get parentToolbarItems(): NodeListOf<Element> | undefined;
|
|
14
|
+
static get leafToolbarItems(): NodeListOf<Element> | undefined;
|
|
15
|
+
static getSnapshot(scrollView?: Components.ScrollView): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
7
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
8
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
9
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
11
|
+
};
|
|
12
|
+
var _a, _Snapshot_config, _Snapshot_getOwnConfig, _Snapshot_parent, _Snapshot_leaf, _Snapshot_root, _Snapshot_parentContainer, _Snapshot_container, _Snapshot_leafContainer, _Snapshot_parentToolbarItems, _Snapshot_toolbarItems, _Snapshot_leafToolbarItems, _Snapshot_queryScrollViewRels;
|
|
13
|
+
export class Snapshot {
|
|
14
|
+
static get config() {
|
|
15
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_config);
|
|
16
|
+
}
|
|
17
|
+
static async setOwnConfig() {
|
|
18
|
+
if ('complete' === document.readyState)
|
|
19
|
+
return __classPrivateFieldGet(_a, _a, "m", _Snapshot_getOwnConfig).call(_a); // Page already loaded
|
|
20
|
+
await new Promise((resolve) => self.addEventListener('load', resolve)); // Wait for window load
|
|
21
|
+
return __classPrivateFieldGet(_a, _a, "m", _Snapshot_getOwnConfig).call(_a);
|
|
22
|
+
}
|
|
23
|
+
static get parent() {
|
|
24
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_parent);
|
|
25
|
+
}
|
|
26
|
+
static get root() {
|
|
27
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_root);
|
|
28
|
+
}
|
|
29
|
+
static get leaf() {
|
|
30
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_leaf);
|
|
31
|
+
}
|
|
32
|
+
static get parentContainer() {
|
|
33
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_parentContainer);
|
|
34
|
+
}
|
|
35
|
+
static get leafContainer() {
|
|
36
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_leafContainer);
|
|
37
|
+
}
|
|
38
|
+
static get container() {
|
|
39
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_container);
|
|
40
|
+
}
|
|
41
|
+
static get toolbarItems() {
|
|
42
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_toolbarItems);
|
|
43
|
+
}
|
|
44
|
+
static get parentToolbarItems() {
|
|
45
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_parentToolbarItems);
|
|
46
|
+
}
|
|
47
|
+
static get leafToolbarItems() {
|
|
48
|
+
return __classPrivateFieldGet(this, _a, "f", _Snapshot_leafToolbarItems);
|
|
49
|
+
}
|
|
50
|
+
static getSnapshot(scrollView) {
|
|
51
|
+
console.debug(`${_a.name} ⚡️ getSnapshot`);
|
|
52
|
+
// root
|
|
53
|
+
for (let e = scrollView; e; e = e.parentElement)
|
|
54
|
+
e.matches('navigation-stack,navigation-split-view') && (__classPrivateFieldSet(this, _a, e, "f", _Snapshot_root));
|
|
55
|
+
// current
|
|
56
|
+
const { frame, toolbarElements: toolbarItems } = __classPrivateFieldGet(this, _a, "f", _Snapshot_queryScrollViewRels).call(this, scrollView);
|
|
57
|
+
__classPrivateFieldSet(this, _a, frame, "f", _Snapshot_container);
|
|
58
|
+
__classPrivateFieldSet(this, _a, toolbarItems, "f", _Snapshot_toolbarItems);
|
|
59
|
+
// parent
|
|
60
|
+
const possibleParent = __classPrivateFieldGet(this, _a, "f", _Snapshot_container)?.parentElement;
|
|
61
|
+
__classPrivateFieldSet(this, _a, possibleParent?.querySelector(`:scope > scroll-view,:scope > [is=sidebar-view] > scroll-view`) ?? undefined, "f", _Snapshot_parent); //const sv2 = pr.parentElement.querySelector(`:scope > scroll-view`) //pr.previousElementSibling
|
|
62
|
+
const { frame: parentFrame, toolbarElements: parentToolbarItems } = __classPrivateFieldGet(this, _a, "f", _Snapshot_queryScrollViewRels).call(this, __classPrivateFieldGet(this, _a, "f", _Snapshot_parent));
|
|
63
|
+
__classPrivateFieldSet(this, _a, parentFrame, "f", _Snapshot_parentContainer);
|
|
64
|
+
__classPrivateFieldSet(this, _a, parentToolbarItems, "f", _Snapshot_parentToolbarItems);
|
|
65
|
+
// const possibleParent =
|
|
66
|
+
// this.#container?.parentElement?.querySelector<HTMLElement>(
|
|
67
|
+
// `:scope > scroll-view,:scope > [is=sidebar-view] > scroll-view`
|
|
68
|
+
// ) ?? undefined, //const sv2 = pr.parentElement.querySelector(`:scope > scroll-view`) //pr.previousElementSibling
|
|
69
|
+
// {
|
|
70
|
+
// landmark: parentLm,
|
|
71
|
+
// frame: parentFrame,
|
|
72
|
+
// toolbarElements: parentToolbarItems,
|
|
73
|
+
// } = this.#queryScrollViewRels(possibleParent)
|
|
74
|
+
// this.#parent = parentLm
|
|
75
|
+
// this.#parentContainer = parentFrame
|
|
76
|
+
// this.#parentToolbarItems = parentToolbarItems
|
|
77
|
+
// detect children
|
|
78
|
+
let possibleNest = scrollView?.nextElementSibling;
|
|
79
|
+
if ('NAVIGATION-SPLIT-VIEW' === __classPrivateFieldGet(this, _a, "f", _Snapshot_root)?.tagName)
|
|
80
|
+
if (scrollView?.matches(`navigation-split-view > scroll-view${null !== __classPrivateFieldGet(this, _a, "f", _Snapshot_root).querySelector(':scope > [is=sidebar-view]') ? ',navigation-split-view > [is=sidebar-view] > scroll-view,navigation-split-view > body-view > scroll-view' : ''}`))
|
|
81
|
+
possibleNest = (scrollView?.parentElement?.matches('dialog[is=sidebar-view]')
|
|
82
|
+
? scrollView?.parentElement
|
|
83
|
+
: scrollView)?.previousElementSibling; // look for prev sibling instead
|
|
84
|
+
// const possibleNest = scrollView?.nextElementSibling as HTMLElement | null
|
|
85
|
+
__classPrivateFieldSet(this, _a, [
|
|
86
|
+
...(possibleNest?.querySelectorAll('scroll-view:not(navigation-stack[hidden] scroll-view,navigation-split-view[hidden] scroll-view)') ?? []),
|
|
87
|
+
]?.pop?.(), "f", _Snapshot_leaf); //'navigation-stack:not([hidden]) scroll-view'
|
|
88
|
+
const { frame: leafFrame, toolbarElements: leafToolbarItems } = __classPrivateFieldGet(this, _a, "f", _Snapshot_queryScrollViewRels).call(this, __classPrivateFieldGet(this, _a, "f", _Snapshot_leaf));
|
|
89
|
+
__classPrivateFieldSet(this, _a, leafFrame, "f", _Snapshot_leafContainer);
|
|
90
|
+
__classPrivateFieldSet(this, _a, leafToolbarItems, "f", _Snapshot_leafToolbarItems);
|
|
91
|
+
// const {
|
|
92
|
+
// landmark: leafLm,
|
|
93
|
+
// frame: leafFrame,
|
|
94
|
+
// toolbarElements: leafToolbarItems,
|
|
95
|
+
// } = this.#queryScrollViewRels(
|
|
96
|
+
// [
|
|
97
|
+
// ...(possibleNest?.querySelectorAll<Components.ScrollView>(
|
|
98
|
+
// 'scroll-view:not(navigation-stack[hidden] scroll-view,navigation-split-view[hidden] scroll-view)'
|
|
99
|
+
// ) ?? []),
|
|
100
|
+
// ]?.pop?.()
|
|
101
|
+
// ) //'navigation-stack:not([hidden]) scroll-view'
|
|
102
|
+
// this.#leaf = leafLm
|
|
103
|
+
// this.#leafContainer = leafFrame
|
|
104
|
+
// this.#leafToolbarItems = leafToolbarItems
|
|
105
|
+
console.debug(`${__classPrivateFieldGet(this, _a, "f", _Snapshot_root)?.tagName}
|
|
106
|
+
/ \\
|
|
107
|
+
B ${__classPrivateFieldGet(this, _a, "f", _Snapshot_parentContainer)?.tagName}
|
|
108
|
+
/ \\
|
|
109
|
+
D ${__classPrivateFieldGet(this, _a, "f", _Snapshot_container)?.tagName}
|
|
110
|
+
/ \\
|
|
111
|
+
H ${__classPrivateFieldGet(this, _a, "f", _Snapshot_leafContainer)?.tagName}
|
|
112
|
+
`);
|
|
113
|
+
// this.#childFrame = ['BODY-VIEW', 'NAVIGATION-STACK'].includes(
|
|
114
|
+
// possibleNest?.tagName ?? ''
|
|
115
|
+
// )
|
|
116
|
+
// ? (possibleNest ?? undefined)
|
|
117
|
+
// : undefined
|
|
118
|
+
// this.#childToolbarItems = this.#childFrame?.querySelectorAll(
|
|
119
|
+
// `:scope > navigation-bar > tool-bar-item,:scope > bottom-bar > tool-bar-item`
|
|
120
|
+
// )
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
_a = Snapshot, _Snapshot_getOwnConfig = function _Snapshot_getOwnConfig() {
|
|
124
|
+
const style = getComputedStyle(document.documentElement, '::before'), content = style.getPropertyValue('content'), unquoted = content.replace(/^"(.*)"$/, '$1'); // Remove quotes around the content
|
|
125
|
+
try {
|
|
126
|
+
__classPrivateFieldSet(this, _a, Object.fromEntries(new URLSearchParams(unquoted).entries()), "f", _Snapshot_config); // {"none": ""}
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
console.error('could-not-parse-config');
|
|
130
|
+
}
|
|
131
|
+
console.debug(__classPrivateFieldGet(this, _a, "f", _Snapshot_config));
|
|
132
|
+
};
|
|
133
|
+
_Snapshot_config = { value: void 0 };
|
|
134
|
+
//////
|
|
135
|
+
_Snapshot_parent = { value: void 0 };
|
|
136
|
+
_Snapshot_leaf = { value: void 0 };
|
|
137
|
+
_Snapshot_root = { value: void 0 };
|
|
138
|
+
_Snapshot_parentContainer = { value: void 0 };
|
|
139
|
+
_Snapshot_container = { value: void 0 };
|
|
140
|
+
_Snapshot_leafContainer = { value: void 0 };
|
|
141
|
+
_Snapshot_parentToolbarItems = { value: void 0 };
|
|
142
|
+
_Snapshot_toolbarItems = { value: void 0 };
|
|
143
|
+
_Snapshot_leafToolbarItems = { value: void 0 };
|
|
144
|
+
_Snapshot_queryScrollViewRels = { value: (sv) => {
|
|
145
|
+
const isSidebarWrapped = sv?.parentElement?.matches('dialog[is=sidebar-view]');
|
|
146
|
+
return {
|
|
147
|
+
frame: (isSidebarWrapped ? sv?.parentElement : sv)?.parentElement ?? undefined,
|
|
148
|
+
toolbarElements: sv?.parentElement?.querySelectorAll(`:scope > navigation-bar > tool-bar-item,:scope > bottom-bar > tool-bar-item,:scope > navigation-bar > tool-bar-item-group,:scope > bottom-bar > tool-bar-item-group`),
|
|
149
|
+
};
|
|
150
|
+
} };
|