@drfed/web 0.1.0-dev.565 → 0.2.0-dev.567
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/.output/nitro.json +1 -1
- package/.output/public/.vite/manifest.json +181 -181
- package/.output/public/_build/assets/{ActorDetailQuery.graphql-D96mwq1k.js → ActorDetailQuery.graphql-BifVLgri.js} +1 -1
- package/.output/public/_build/assets/{ActorDetailQuery.graphql-DrxSNh1X.js → ActorDetailQuery.graphql-CCzXciWe.js} +1 -1
- package/.output/public/_build/assets/{CompleteLoginChallenge.graphql-C5Zq3wNh.js → CompleteLoginChallenge.graphql-BuIODTQe.js} +1 -1
- package/.output/public/_build/assets/{CopyButton-B2l484wE.js → CopyButton-BPA_AsfQ.js} +1 -1
- package/.output/public/_build/assets/{CreateInstanceMutation.graphql-B4CRy6cl.js → CreateInstanceMutation.graphql-BeuI_m9K.js} +1 -1
- package/.output/public/_build/assets/{CreateObjectMutation.graphql-B4A01dgV.js → CreateObjectMutation.graphql-slDMnVjt.js} +1 -1
- package/.output/public/_build/assets/{GenerateActorsMutation.graphql-mlHJNIbe.js → GenerateActorsMutation.graphql-vkoqVyL8.js} +1 -1
- package/.output/public/_build/assets/{GetHostQuery.graphql-CuzDdOdW.js → GetHostQuery.graphql-BzusRJ7N.js} +1 -1
- package/.output/public/_build/assets/{GetHostQuery.graphql-o9K0Qkg0.js → GetHostQuery.graphql-CKu9xX8-.js} +1 -1
- package/.output/public/_build/assets/{HomeViewerQuery.graphql-B903WWKs.js → HomeViewerQuery.graphql-BEP_urQ1.js} +1 -1
- package/.output/public/_build/assets/HttpStatusCode-FQmr-LGM.js +1 -0
- package/.output/public/_build/assets/{InstanceActorListQuery.graphql-paa7teUO.js → InstanceActorListQuery.graphql-ADOUh67G.js} +1 -1
- package/.output/public/_build/assets/{InstanceActorListQuery.graphql-DmNwiEhM.js → InstanceActorListQuery.graphql-Dmh71GI5.js} +1 -1
- package/.output/public/_build/assets/{InstanceDetailQuery.graphql-B52nR132.js → InstanceDetailQuery.graphql-BVIsRDhB.js} +1 -1
- package/.output/public/_build/assets/{InstanceDetailQuery.graphql-DSA2BcAV.js → InstanceDetailQuery.graphql-YvCDX6Vx.js} +1 -1
- package/.output/public/_build/assets/JNCCF6MP-C_2GhSaE.js +1 -0
- package/.output/public/_build/assets/{LP6E37CW-Cwv6G3n1.js → LP6E37CW-BBu2j5XX.js} +1 -1
- package/.output/public/_build/assets/{SignInMutation.graphql-BalZYNFu.js → SignInMutation.graphql-D-K99qj-.js} +1 -1
- package/.output/public/_build/assets/TSB6MOZK-D4_kp7T4.js +1 -0
- package/.output/public/_build/assets/Toast-tZxI6Kk3.js +1 -0
- package/.output/public/_build/assets/{WorkspaceQuery.graphql-UoI7QDs4.js → WorkspaceQuery.graphql-9H5uLyBt.js} +1 -1
- package/.output/public/_build/assets/_...404_-DMz-AmEz.js +1 -0
- package/.output/public/_build/assets/{_challengeId_-Dk-0l7zl.js → _challengeId_-BK-xeuYX.js} +1 -1
- package/.output/public/_build/assets/{_id_-bpxdclBj.js → _id_-Q9HBJzaf.js} +1 -1
- package/.output/public/_build/assets/_slug_-DrTnyM7j.js +200 -0
- package/.output/public/_build/assets/{about-DIrbzRsi.js → about-DtTGI6TG.js} +1 -1
- package/.output/public/_build/assets/actors-LmFNJfl8.js +24 -0
- package/.output/public/_build/assets/{client-CGFoRcqH.js → client-BVl87rV7.js} +2 -2
- package/.output/public/_build/assets/{components-5MVu7IcD.js → components-D1sEsgws.js} +1 -1
- package/.output/public/_build/assets/dist-CMub1v5w.js +1 -0
- package/.output/public/_build/assets/{dist-BrJ_B8nU.js → dist-DUCXQy4t.js} +1 -1
- package/.output/public/_build/assets/{dist-WrlGlK67.js → dist-IMcx10bF.js} +1 -1
- package/.output/public/_build/assets/{entry-client-Do7ocrsL.js → entry-client-DyU5h6Kf.js} +3 -3
- package/.output/public/_build/assets/form.module-DZJVksrR.js +1 -0
- package/.output/public/_build/assets/{index-BHn6sAgH.js → index-CsGHD4_w.js} +1 -1
- package/.output/public/_build/assets/{index-BSLqnqN7.js → index-xrNvEFEe.js} +1 -1
- package/.output/public/_build/assets/instance-CD2GuEFF.js +35 -0
- package/.output/public/_build/assets/objects-CSDLRgba.js +25 -0
- package/.output/public/_build/assets/relay-runtime-CW2Fi-vu.js +7 -0
- package/.output/public/_build/assets/routing-BOJUm5FP.js +1 -0
- package/.output/public/_build/assets/sign-in-6aWEq4t1.js +10 -0
- package/.output/public/_build/assets/web-BjwKY0xb.js +1 -0
- package/.output/server/{_...404_-DDEH5apf.mjs → _...404_-DM28Kka3.mjs} +2 -3
- package/.output/server/{_challengeId_-C_n_Bww9.mjs → _challengeId_-CHkjsE_y.mjs} +5 -5
- package/.output/server/_chunks/ssr-renderer.mjs +3 -3
- package/.output/server/{_id_-DqytvZEf.mjs → _id_-BjLFsMir.mjs} +3 -4
- package/.output/server/_libs/@shikijs/core+[...].mjs +24 -22
- package/.output/server/_libs/@shikijs/engine-javascript+[...].mjs +45 -40
- package/.output/server/_libs/faker-js__faker.mjs +6 -12
- package/.output/server/_libs/relay-runtime.mjs +189 -177
- package/.output/server/_libs/seroval-plugins.mjs +45 -43
- package/.output/server/_libs/seroval.mjs +16 -11
- package/.output/server/_libs/solid-js.mjs +28 -19
- package/.output/server/_libs/solid-relay+tiny-invariant.mjs +1 -3
- package/.output/server/_libs/valibot.mjs +5 -44
- package/.output/server/_runtime.mjs +1 -1
- package/.output/server/{_slug_-CBOaSqoF.mjs → _slug_-CamNffYc.mjs} +3 -4
- package/.output/server/_ssr/{LP6E37CW-D2Ih_b_K.mjs → LP6E37CW-Bs07BPsK.mjs} +2 -2
- package/.output/server/_ssr/{TSB6MOZK-D06WZb6o.mjs → TSB6MOZK-Dz16RpiS.mjs} +10 -6
- package/.output/server/_ssr/{about-CD3QIgf_.mjs → about-K4E3_OxN.mjs} +2 -2
- package/.output/server/_ssr/{actors-CMWf-xQU.mjs → actors-DQIzbpiq.mjs} +21 -21
- package/.output/server/_ssr/{form.module-CTvIl1lm.mjs → form.module-B3iJri2-.mjs} +8 -5
- package/.output/server/_ssr/{index-yuhuc6-X.mjs → index-DQYLULEn.mjs} +2 -2
- package/.output/server/_ssr/{index-C4crD6q-.mjs → index-DU0kuIH3.mjs} +2 -3
- package/.output/server/_ssr/{instance-ZYWGeWd3.mjs → instance-BXwV77PI.mjs} +5 -7
- package/.output/server/_ssr/{objects-D5MVukzB.mjs → objects-DNPuxUtN.mjs} +55 -38
- package/.output/server/_ssr/{sign-in-CNHZb_zL.mjs → sign-in-KJ_TNq1o.mjs} +5 -6
- package/.output/server/_ssr/ssr.mjs +2303 -224
- package/.output/server/index.mjs +246 -246
- package/package.json +9 -9
- package/.output/public/_build/assets/HttpStatusCode-bgaVzuLy.js +0 -1
- package/.output/public/_build/assets/JNCCF6MP-CNMywyiC.js +0 -1
- package/.output/public/_build/assets/TSB6MOZK-CpiH97G1.js +0 -1
- package/.output/public/_build/assets/Toast-C1zr9crB.js +0 -1
- package/.output/public/_build/assets/_...404_-WZ8kAljY.js +0 -1
- package/.output/public/_build/assets/_slug_-DXfRknzJ.js +0 -200
- package/.output/public/_build/assets/actors-HfZh_afh.js +0 -24
- package/.output/public/_build/assets/dist-DVo0HS5G.js +0 -1
- package/.output/public/_build/assets/form.module-BecmEfV_.js +0 -1
- package/.output/public/_build/assets/instance-tpMrvJNZ.js +0 -35
- package/.output/public/_build/assets/objects-DR9TfL-V.js +0 -25
- package/.output/public/_build/assets/relay-runtime-BX3uubtA.js +0 -7
- package/.output/public/_build/assets/routing-DMN2NHu6.js +0 -1
- package/.output/public/_build/assets/sign-in-B67sv7z8.js +0 -10
- package/.output/public/_build/assets/web-DB_Nkq2D.js +0 -1
- package/.output/server/_ssr/JNCCF6MP-BAZlBnvx.mjs +0 -419
- package/.output/server/_ssr/Toast-Bb1gcxED.mjs +0 -947
- package/.output/server/_ssr/dist-D6rgyh-L.mjs +0 -81
- package/.output/server/_ssr/routing-DKTLkkbY.mjs +0 -620
|
@@ -1,419 +0,0 @@
|
|
|
1
|
-
import { $ as splitProps, I as createEffect, K as mergeProps, L as createMemo, N as createComponent, V as createSignal, a as Dynamic } from "../_libs/solid-js.mjs";
|
|
2
|
-
//#region node_modules/.nitro/vite/services/ssr/_build/assets/JNCCF6MP-BAZlBnvx.js
|
|
3
|
-
function removeItemFromArray(array, item) {
|
|
4
|
-
const updatedArray = [...array];
|
|
5
|
-
const index = updatedArray.indexOf(item);
|
|
6
|
-
if (index !== -1) updatedArray.splice(index, 1);
|
|
7
|
-
return updatedArray;
|
|
8
|
-
}
|
|
9
|
-
function isNumber(value) {
|
|
10
|
-
return typeof value === "number";
|
|
11
|
-
}
|
|
12
|
-
function isString(value) {
|
|
13
|
-
return Object.prototype.toString.call(value) === "[object String]";
|
|
14
|
-
}
|
|
15
|
-
function isFunction(value) {
|
|
16
|
-
return typeof value === "function";
|
|
17
|
-
}
|
|
18
|
-
function createGenerateId(baseId) {
|
|
19
|
-
return (suffix) => `${baseId()}-${suffix}`;
|
|
20
|
-
}
|
|
21
|
-
function contains(parent, child) {
|
|
22
|
-
if (!parent) return false;
|
|
23
|
-
return parent === child || parent.contains(child);
|
|
24
|
-
}
|
|
25
|
-
function getActiveElement(node, activeDescendant = false) {
|
|
26
|
-
const { activeElement } = getDocument(node);
|
|
27
|
-
if (!activeElement?.nodeName) return null;
|
|
28
|
-
if (isFrame(activeElement) && activeElement.contentDocument) return getActiveElement(activeElement.contentDocument.body, activeDescendant);
|
|
29
|
-
if (activeDescendant) {
|
|
30
|
-
const id = activeElement.getAttribute("aria-activedescendant");
|
|
31
|
-
if (id) {
|
|
32
|
-
const element = getDocument(activeElement).getElementById(id);
|
|
33
|
-
if (element) return element;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return activeElement;
|
|
37
|
-
}
|
|
38
|
-
function getWindow(node) {
|
|
39
|
-
return getDocument(node).defaultView || window;
|
|
40
|
-
}
|
|
41
|
-
function getDocument(node) {
|
|
42
|
-
return node ? node.ownerDocument || node : document;
|
|
43
|
-
}
|
|
44
|
-
function isFrame(element) {
|
|
45
|
-
return element.tagName === "IFRAME";
|
|
46
|
-
}
|
|
47
|
-
var EventKey = /* @__PURE__ */ ((EventKey2) => {
|
|
48
|
-
EventKey2["Escape"] = "Escape";
|
|
49
|
-
EventKey2["Enter"] = "Enter";
|
|
50
|
-
EventKey2["Tab"] = "Tab";
|
|
51
|
-
EventKey2["Space"] = " ";
|
|
52
|
-
EventKey2["ArrowDown"] = "ArrowDown";
|
|
53
|
-
EventKey2["ArrowLeft"] = "ArrowLeft";
|
|
54
|
-
EventKey2["ArrowRight"] = "ArrowRight";
|
|
55
|
-
EventKey2["ArrowUp"] = "ArrowUp";
|
|
56
|
-
EventKey2["End"] = "End";
|
|
57
|
-
EventKey2["Home"] = "Home";
|
|
58
|
-
EventKey2["PageDown"] = "PageDown";
|
|
59
|
-
EventKey2["PageUp"] = "PageUp";
|
|
60
|
-
return EventKey2;
|
|
61
|
-
})(EventKey || {});
|
|
62
|
-
function testUserAgent(re) {
|
|
63
|
-
if (typeof window === "undefined" || window.navigator == null) return false;
|
|
64
|
-
return window.navigator.userAgentData?.brands.some((brand) => re.test(brand.brand)) || re.test(window.navigator.userAgent);
|
|
65
|
-
}
|
|
66
|
-
function testPlatform(re) {
|
|
67
|
-
return typeof window !== "undefined" && window.navigator != null ? re.test(window.navigator.userAgentData?.platform || window.navigator.platform) : false;
|
|
68
|
-
}
|
|
69
|
-
function isMac() {
|
|
70
|
-
return testPlatform(/^Mac/i);
|
|
71
|
-
}
|
|
72
|
-
function isIPhone() {
|
|
73
|
-
return testPlatform(/^iPhone/i);
|
|
74
|
-
}
|
|
75
|
-
function isIPad() {
|
|
76
|
-
return testPlatform(/^iPad/i) || isMac() && navigator.maxTouchPoints > 1;
|
|
77
|
-
}
|
|
78
|
-
function isIOS() {
|
|
79
|
-
return isIPhone() || isIPad();
|
|
80
|
-
}
|
|
81
|
-
function isAppleDevice() {
|
|
82
|
-
return isMac() || isIOS();
|
|
83
|
-
}
|
|
84
|
-
function isWebKit() {
|
|
85
|
-
return testUserAgent(/AppleWebKit/i) && !isChrome();
|
|
86
|
-
}
|
|
87
|
-
function isChrome() {
|
|
88
|
-
return testUserAgent(/Chrome/i);
|
|
89
|
-
}
|
|
90
|
-
function callHandler(event, handler) {
|
|
91
|
-
if (handler) if (isFunction(handler)) handler(event);
|
|
92
|
-
else handler[0](handler[1], event);
|
|
93
|
-
return event?.defaultPrevented;
|
|
94
|
-
}
|
|
95
|
-
function composeEventHandlers(handlers) {
|
|
96
|
-
return (event) => {
|
|
97
|
-
for (const handler of handlers) callHandler(event, handler);
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
function isCtrlKey(e) {
|
|
101
|
-
if (isMac()) return e.metaKey && !e.ctrlKey;
|
|
102
|
-
return e.ctrlKey && !e.metaKey;
|
|
103
|
-
}
|
|
104
|
-
function focusWithoutScrolling(element) {
|
|
105
|
-
if (!element) return;
|
|
106
|
-
if (supportsPreventScroll()) element.focus({ preventScroll: true });
|
|
107
|
-
else {
|
|
108
|
-
const scrollableElements = getScrollableElements(element);
|
|
109
|
-
element.focus();
|
|
110
|
-
restoreScrollPosition(scrollableElements);
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
var supportsPreventScrollCached = null;
|
|
114
|
-
function supportsPreventScroll() {
|
|
115
|
-
if (supportsPreventScrollCached == null) {
|
|
116
|
-
supportsPreventScrollCached = false;
|
|
117
|
-
try {
|
|
118
|
-
document.createElement("div").focus({ get preventScroll() {
|
|
119
|
-
supportsPreventScrollCached = true;
|
|
120
|
-
return true;
|
|
121
|
-
} });
|
|
122
|
-
} catch (e) {}
|
|
123
|
-
}
|
|
124
|
-
return supportsPreventScrollCached;
|
|
125
|
-
}
|
|
126
|
-
function getScrollableElements(element) {
|
|
127
|
-
let parent = element.parentNode;
|
|
128
|
-
const scrollableElements = [];
|
|
129
|
-
const rootScrollingElement = document.scrollingElement || document.documentElement;
|
|
130
|
-
while (parent instanceof HTMLElement && parent !== rootScrollingElement) {
|
|
131
|
-
if (parent.offsetHeight < parent.scrollHeight || parent.offsetWidth < parent.scrollWidth) scrollableElements.push({
|
|
132
|
-
element: parent,
|
|
133
|
-
scrollTop: parent.scrollTop,
|
|
134
|
-
scrollLeft: parent.scrollLeft
|
|
135
|
-
});
|
|
136
|
-
parent = parent.parentNode;
|
|
137
|
-
}
|
|
138
|
-
if (rootScrollingElement instanceof HTMLElement) scrollableElements.push({
|
|
139
|
-
element: rootScrollingElement,
|
|
140
|
-
scrollTop: rootScrollingElement.scrollTop,
|
|
141
|
-
scrollLeft: rootScrollingElement.scrollLeft
|
|
142
|
-
});
|
|
143
|
-
return scrollableElements;
|
|
144
|
-
}
|
|
145
|
-
function restoreScrollPosition(scrollableElements) {
|
|
146
|
-
for (const { element, scrollTop, scrollLeft } of scrollableElements) {
|
|
147
|
-
element.scrollTop = scrollTop;
|
|
148
|
-
element.scrollLeft = scrollLeft;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
var focusableElements = [
|
|
152
|
-
"input:not([type='hidden']):not([disabled])",
|
|
153
|
-
"select:not([disabled])",
|
|
154
|
-
"textarea:not([disabled])",
|
|
155
|
-
"button:not([disabled])",
|
|
156
|
-
"a[href]",
|
|
157
|
-
"area[href]",
|
|
158
|
-
"[tabindex]",
|
|
159
|
-
"iframe",
|
|
160
|
-
"object",
|
|
161
|
-
"embed",
|
|
162
|
-
"audio[controls]",
|
|
163
|
-
"video[controls]",
|
|
164
|
-
"[contenteditable]:not([contenteditable='false'])"
|
|
165
|
-
];
|
|
166
|
-
var tabbableElements = [...focusableElements, "[tabindex]:not([tabindex=\"-1\"]):not([disabled])"];
|
|
167
|
-
var FOCUSABLE_ELEMENT_SELECTOR = `${focusableElements.join(":not([hidden]),")},[tabindex]:not([disabled]):not([hidden])`;
|
|
168
|
-
var TABBABLE_ELEMENT_SELECTOR = tabbableElements.join(":not([hidden]):not([tabindex=\"-1\"]),");
|
|
169
|
-
function getAllTabbableIn(container, includeContainer) {
|
|
170
|
-
const tabbableElements2 = Array.from(container.querySelectorAll(FOCUSABLE_ELEMENT_SELECTOR)).filter(isTabbable);
|
|
171
|
-
if (includeContainer && isTabbable(container)) tabbableElements2.unshift(container);
|
|
172
|
-
tabbableElements2.forEach((element, i) => {
|
|
173
|
-
if (isFrame(element) && element.contentDocument) {
|
|
174
|
-
const frameBody = element.contentDocument.body;
|
|
175
|
-
const allFrameTabbable = getAllTabbableIn(frameBody, false);
|
|
176
|
-
tabbableElements2.splice(i, 1, ...allFrameTabbable);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
return tabbableElements2;
|
|
180
|
-
}
|
|
181
|
-
function isTabbable(element) {
|
|
182
|
-
return isFocusable(element) && !hasNegativeTabIndex(element);
|
|
183
|
-
}
|
|
184
|
-
function isFocusable(element) {
|
|
185
|
-
return element.matches(FOCUSABLE_ELEMENT_SELECTOR) && isElementVisible(element);
|
|
186
|
-
}
|
|
187
|
-
function hasNegativeTabIndex(element) {
|
|
188
|
-
return Number.parseInt(element.getAttribute("tabindex") || "0", 10) < 0;
|
|
189
|
-
}
|
|
190
|
-
function isElementVisible(element, childElement) {
|
|
191
|
-
return element.nodeName !== "#comment" && isStyleVisible(element) && isAttributeVisible(element, childElement) && (!element.parentElement || isElementVisible(element.parentElement, element));
|
|
192
|
-
}
|
|
193
|
-
function isStyleVisible(element) {
|
|
194
|
-
if (!(element instanceof HTMLElement) && !(element instanceof SVGElement)) return false;
|
|
195
|
-
const { display, visibility } = element.style;
|
|
196
|
-
let isVisible = display !== "none" && visibility !== "hidden" && visibility !== "collapse";
|
|
197
|
-
if (isVisible) {
|
|
198
|
-
if (!element.ownerDocument.defaultView) return isVisible;
|
|
199
|
-
const { getComputedStyle } = element.ownerDocument.defaultView;
|
|
200
|
-
const { display: computedDisplay, visibility: computedVisibility } = getComputedStyle(element);
|
|
201
|
-
isVisible = computedDisplay !== "none" && computedVisibility !== "hidden" && computedVisibility !== "collapse";
|
|
202
|
-
}
|
|
203
|
-
return isVisible;
|
|
204
|
-
}
|
|
205
|
-
function isAttributeVisible(element, childElement) {
|
|
206
|
-
return !element.hasAttribute("hidden") && (element.nodeName === "DETAILS" && childElement && childElement.nodeName !== "SUMMARY" ? element.hasAttribute("open") : true);
|
|
207
|
-
}
|
|
208
|
-
function isElementInScope(element, scope) {
|
|
209
|
-
return scope.some((node) => node.contains(element));
|
|
210
|
-
}
|
|
211
|
-
function getFocusableTreeWalker(root, opts, scope) {
|
|
212
|
-
const selector = opts?.tabbable ? TABBABLE_ELEMENT_SELECTOR : FOCUSABLE_ELEMENT_SELECTOR;
|
|
213
|
-
const walker = document.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, { acceptNode(node) {
|
|
214
|
-
if (opts?.from?.contains(node)) return NodeFilter.FILTER_REJECT;
|
|
215
|
-
if (node.matches(selector) && isElementVisible(node) && (!scope || isElementInScope(node, scope)) && (!opts?.accept || opts.accept(node))) return NodeFilter.FILTER_ACCEPT;
|
|
216
|
-
return NodeFilter.FILTER_SKIP;
|
|
217
|
-
} });
|
|
218
|
-
if (opts?.from) walker.currentNode = opts.from;
|
|
219
|
-
return walker;
|
|
220
|
-
}
|
|
221
|
-
function noop() {}
|
|
222
|
-
function snapValueToStep(value, min, max, step) {
|
|
223
|
-
const remainder = (value - (Number.isNaN(min) ? 0 : min)) % step;
|
|
224
|
-
let snappedValue = Math.abs(remainder) * 2 >= step ? value + Math.sign(remainder) * (step - Math.abs(remainder)) : value - remainder;
|
|
225
|
-
if (!Number.isNaN(min)) {
|
|
226
|
-
if (snappedValue < min) snappedValue = min;
|
|
227
|
-
else if (!Number.isNaN(max) && snappedValue > max) snappedValue = min + Math.floor((max - min) / step) * step;
|
|
228
|
-
} else if (!Number.isNaN(max) && snappedValue > max) snappedValue = Math.floor(max / step) * step;
|
|
229
|
-
const string = step.toString();
|
|
230
|
-
const index = string.indexOf(".");
|
|
231
|
-
const precision = index >= 0 ? string.length - index : 0;
|
|
232
|
-
if (precision > 0) {
|
|
233
|
-
const pow = 10 ** precision;
|
|
234
|
-
snappedValue = Math.round(snappedValue * pow) / pow;
|
|
235
|
-
}
|
|
236
|
-
return snappedValue;
|
|
237
|
-
}
|
|
238
|
-
var getPrecision = (n) => {
|
|
239
|
-
let e = 1;
|
|
240
|
-
let precision = 0;
|
|
241
|
-
while (Math.round(n * e) / e !== n) {
|
|
242
|
-
e *= 10;
|
|
243
|
-
precision++;
|
|
244
|
-
}
|
|
245
|
-
return precision;
|
|
246
|
-
};
|
|
247
|
-
function mergeDefaultProps(defaultProps, props) {
|
|
248
|
-
return mergeProps(defaultProps, props);
|
|
249
|
-
}
|
|
250
|
-
var transitionsByElement = /* @__PURE__ */ new Map();
|
|
251
|
-
var transitionCallbacks = /* @__PURE__ */ new Set();
|
|
252
|
-
function setupGlobalEvents() {
|
|
253
|
-
if (typeof window === "undefined" || document.body === null) return;
|
|
254
|
-
const onTransitionStart = (e) => {
|
|
255
|
-
if (!e.target) return;
|
|
256
|
-
let transitions = transitionsByElement.get(e.target);
|
|
257
|
-
if (!transitions) {
|
|
258
|
-
transitions = /* @__PURE__ */ new Set();
|
|
259
|
-
transitionsByElement.set(e.target, transitions);
|
|
260
|
-
e.target.addEventListener("transitioncancel", onTransitionEnd);
|
|
261
|
-
}
|
|
262
|
-
transitions.add(e.propertyName);
|
|
263
|
-
};
|
|
264
|
-
const onTransitionEnd = (e) => {
|
|
265
|
-
if (!e.target) return;
|
|
266
|
-
const properties = transitionsByElement.get(e.target);
|
|
267
|
-
if (!properties) return;
|
|
268
|
-
properties.delete(e.propertyName);
|
|
269
|
-
if (properties.size === 0) {
|
|
270
|
-
e.target.removeEventListener("transitioncancel", onTransitionEnd);
|
|
271
|
-
transitionsByElement.delete(e.target);
|
|
272
|
-
}
|
|
273
|
-
if (transitionsByElement.size === 0) {
|
|
274
|
-
for (const cb of transitionCallbacks) cb();
|
|
275
|
-
transitionCallbacks.clear();
|
|
276
|
-
}
|
|
277
|
-
};
|
|
278
|
-
document.body.addEventListener("transitionrun", onTransitionStart);
|
|
279
|
-
document.body.addEventListener("transitionend", onTransitionEnd);
|
|
280
|
-
}
|
|
281
|
-
if (typeof document !== "undefined") if (document.readyState !== "loading") setupGlobalEvents();
|
|
282
|
-
else document.addEventListener("DOMContentLoaded", setupGlobalEvents);
|
|
283
|
-
function scrollIntoView(scrollView, element) {
|
|
284
|
-
const offsetX = relativeOffset(scrollView, element, "left");
|
|
285
|
-
const offsetY = relativeOffset(scrollView, element, "top");
|
|
286
|
-
const width = element.offsetWidth;
|
|
287
|
-
const height = element.offsetHeight;
|
|
288
|
-
let x = scrollView.scrollLeft;
|
|
289
|
-
let y = scrollView.scrollTop;
|
|
290
|
-
const maxX = x + scrollView.offsetWidth;
|
|
291
|
-
const maxY = y + scrollView.offsetHeight;
|
|
292
|
-
if (offsetX <= x) x = offsetX;
|
|
293
|
-
else if (offsetX + width > maxX) x += offsetX + width - maxX;
|
|
294
|
-
if (offsetY <= y) y = offsetY;
|
|
295
|
-
else if (offsetY + height > maxY) y += offsetY + height - maxY;
|
|
296
|
-
scrollView.scrollLeft = x;
|
|
297
|
-
scrollView.scrollTop = y;
|
|
298
|
-
}
|
|
299
|
-
function relativeOffset(ancestor, child, axis) {
|
|
300
|
-
const prop = axis === "left" ? "offsetLeft" : "offsetTop";
|
|
301
|
-
let sum = 0;
|
|
302
|
-
while (child.offsetParent) {
|
|
303
|
-
sum += child[prop];
|
|
304
|
-
if (child.offsetParent === ancestor) break;
|
|
305
|
-
if (child.offsetParent.contains(ancestor)) {
|
|
306
|
-
sum -= ancestor[prop];
|
|
307
|
-
break;
|
|
308
|
-
}
|
|
309
|
-
child = child.offsetParent;
|
|
310
|
-
}
|
|
311
|
-
return sum;
|
|
312
|
-
}
|
|
313
|
-
var visuallyHiddenStyles = {
|
|
314
|
-
border: "0",
|
|
315
|
-
clip: "rect(0 0 0 0)",
|
|
316
|
-
"clip-path": "inset(50%)",
|
|
317
|
-
height: "1px",
|
|
318
|
-
margin: "0 -1px -1px 0",
|
|
319
|
-
overflow: "hidden",
|
|
320
|
-
padding: "0",
|
|
321
|
-
position: "absolute",
|
|
322
|
-
width: "1px",
|
|
323
|
-
"white-space": "nowrap"
|
|
324
|
-
};
|
|
325
|
-
function createTagName(ref, fallback) {
|
|
326
|
-
const [tagName, setTagName] = createSignal(stringOrUndefined(fallback?.()));
|
|
327
|
-
createEffect(() => {
|
|
328
|
-
setTagName(ref()?.tagName.toLowerCase() || stringOrUndefined(fallback?.()));
|
|
329
|
-
});
|
|
330
|
-
return tagName;
|
|
331
|
-
}
|
|
332
|
-
function stringOrUndefined(value) {
|
|
333
|
-
return isString(value) ? value : void 0;
|
|
334
|
-
}
|
|
335
|
-
function Polymorphic(props) {
|
|
336
|
-
const [local, others] = splitProps(props, ["as"]);
|
|
337
|
-
if (!local.as) throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");
|
|
338
|
-
return createComponent(Dynamic, mergeProps(others, { get component() {
|
|
339
|
-
return local.as;
|
|
340
|
-
} }));
|
|
341
|
-
}
|
|
342
|
-
var __defProp = Object.defineProperty;
|
|
343
|
-
var __export = (target, all) => {
|
|
344
|
-
for (var name in all) __defProp(target, name, {
|
|
345
|
-
get: all[name],
|
|
346
|
-
enumerable: true
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
|
-
__export({}, {
|
|
350
|
-
Button: () => Button,
|
|
351
|
-
Root: () => ButtonRoot
|
|
352
|
-
});
|
|
353
|
-
var BUTTON_INPUT_TYPES = [
|
|
354
|
-
"button",
|
|
355
|
-
"color",
|
|
356
|
-
"file",
|
|
357
|
-
"image",
|
|
358
|
-
"reset",
|
|
359
|
-
"submit"
|
|
360
|
-
];
|
|
361
|
-
function isButton(element) {
|
|
362
|
-
const tagName = element.tagName.toLowerCase();
|
|
363
|
-
if (tagName === "button") return true;
|
|
364
|
-
if (tagName === "input" && element.type) return BUTTON_INPUT_TYPES.indexOf(element.type) !== -1;
|
|
365
|
-
return false;
|
|
366
|
-
}
|
|
367
|
-
function ButtonRoot(props) {
|
|
368
|
-
let ref;
|
|
369
|
-
const [local, others] = splitProps(mergeDefaultProps({ type: "button" }, props), [
|
|
370
|
-
"ref",
|
|
371
|
-
"type",
|
|
372
|
-
"disabled"
|
|
373
|
-
]);
|
|
374
|
-
const tagName = createTagName(() => ref, () => "button");
|
|
375
|
-
const isNativeButton = createMemo(() => {
|
|
376
|
-
const elementTagName = tagName();
|
|
377
|
-
if (elementTagName == null) return false;
|
|
378
|
-
return isButton({
|
|
379
|
-
tagName: elementTagName,
|
|
380
|
-
type: local.type
|
|
381
|
-
});
|
|
382
|
-
});
|
|
383
|
-
const isNativeInput = createMemo(() => {
|
|
384
|
-
return tagName() === "input";
|
|
385
|
-
});
|
|
386
|
-
const isNativeLink = createMemo(() => {
|
|
387
|
-
return tagName() === "a" && false;
|
|
388
|
-
});
|
|
389
|
-
return createComponent(Polymorphic, mergeProps({
|
|
390
|
-
as: "button",
|
|
391
|
-
get type() {
|
|
392
|
-
return isNativeButton() || isNativeInput() ? local.type : void 0;
|
|
393
|
-
},
|
|
394
|
-
get role() {
|
|
395
|
-
return !isNativeButton() && !isNativeLink() ? "button" : void 0;
|
|
396
|
-
},
|
|
397
|
-
get tabIndex() {
|
|
398
|
-
return !isNativeButton() && !isNativeLink() && !local.disabled ? 0 : void 0;
|
|
399
|
-
},
|
|
400
|
-
get disabled() {
|
|
401
|
-
return isNativeButton() || isNativeInput() ? local.disabled : void 0;
|
|
402
|
-
},
|
|
403
|
-
get ["aria-disabled"]() {
|
|
404
|
-
return !isNativeButton() && !isNativeInput() && local.disabled ? true : void 0;
|
|
405
|
-
},
|
|
406
|
-
get ["data-disabled"]() {
|
|
407
|
-
return local.disabled ? "" : void 0;
|
|
408
|
-
}
|
|
409
|
-
}, others));
|
|
410
|
-
}
|
|
411
|
-
var Button = ButtonRoot;
|
|
412
|
-
function createRegisterId(setter) {
|
|
413
|
-
return (id) => {
|
|
414
|
-
setter(id);
|
|
415
|
-
return () => setter(void 0);
|
|
416
|
-
};
|
|
417
|
-
}
|
|
418
|
-
//#endregion
|
|
419
|
-
export { scrollIntoView as A, isMac as C, mergeDefaultProps as D, isWebKit as E, visuallyHiddenStyles as M, noop as O, isFunction as S, isString as T, getPrecision as _, __export as a, isCtrlKey as b, contains as c, createTagName as d, focusWithoutScrolling as f, getFocusableTreeWalker as g, getDocument as h, Polymorphic as i, snapValueToStep as j, removeItemFromArray as k, createGenerateId as l, getAllTabbableIn as m, ButtonRoot as n, callHandler as o, getActiveElement as p, EventKey as r, composeEventHandlers as s, Button as t, createRegisterId as u, getWindow as v, isNumber as w, isFocusable as x, isAppleDevice as y };
|