@almadar/shell-web 0.0.0-stage → 1.0.0
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/bundling.d.mts +18 -0
- package/bundling.mjs +28 -0
- package/dist/ArbitraryClassCompiler-CO_iASBn.d.ts +195 -0
- package/dist/AvlGlyph-EPJKFEO3.js +6 -0
- package/dist/AvlStateMachine-RKZIKNGC.js +9 -0
- package/dist/AvlTransitionDetail-63SD6GZF.js +11 -0
- package/dist/AvlTransitionExplainer-ZBTLOM3T.js +12 -0
- package/dist/BehaviorView-YS5G4GNB.js +11 -0
- package/dist/Canvas3DHost-BkZQB5l2.d.ts +552 -0
- package/dist/EventBusProvider-BFFHfN4O.d.ts +296 -0
- package/dist/FileTree-BCFnBEuQ.d.ts +254 -0
- package/dist/FlowCanvas-3JRMNJLV.css +1756 -0
- package/dist/FlowCanvas-AUMTWMNG.js +26 -0
- package/dist/GameAudioProvider-ceM_n0ey.d.ts +90 -0
- package/dist/KaTeX_AMS-Regular-CYEKBG2K.woff +0 -0
- package/dist/KaTeX_AMS-Regular-JKX5W2C4.ttf +0 -0
- package/dist/KaTeX_AMS-Regular-U6PRYMIZ.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-5QL5CMTE.woff2 +0 -0
- package/dist/KaTeX_Caligraphic-Bold-WZ3QSGD3.woff +0 -0
- package/dist/KaTeX_Caligraphic-Bold-ZTS3R3HK.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-3LKEU76G.woff +0 -0
- package/dist/KaTeX_Caligraphic-Regular-A7XRTZ5Q.ttf +0 -0
- package/dist/KaTeX_Caligraphic-Regular-KX5MEWCF.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-2QVFK6NQ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Bold-T4SWXBMT.woff +0 -0
- package/dist/KaTeX_Fraktur-Bold-WGHVTYOR.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-2PEIFJSJ.woff2 +0 -0
- package/dist/KaTeX_Fraktur-Regular-5U4OPH2X.ttf +0 -0
- package/dist/KaTeX_Fraktur-Regular-PQMHCIK6.woff +0 -0
- package/dist/KaTeX_Main-Bold-2GA4IZIN.woff +0 -0
- package/dist/KaTeX_Main-Bold-W5FBVCZM.ttf +0 -0
- package/dist/KaTeX_Main-Bold-YP5VVQRP.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-4P4C7HJH.woff +0 -0
- package/dist/KaTeX_Main-BoldItalic-N4V3DX7S.woff2 +0 -0
- package/dist/KaTeX_Main-BoldItalic-ODMLBJJQ.ttf +0 -0
- package/dist/KaTeX_Main-Italic-I43T2HSR.ttf +0 -0
- package/dist/KaTeX_Main-Italic-RELBIK7M.woff2 +0 -0
- package/dist/KaTeX_Main-Italic-SASNQFN2.woff +0 -0
- package/dist/KaTeX_Main-Regular-ARRPAO67.woff2 +0 -0
- package/dist/KaTeX_Main-Regular-P5I74A2A.woff +0 -0
- package/dist/KaTeX_Main-Regular-W74P5G27.ttf +0 -0
- package/dist/KaTeX_Math-BoldItalic-6EBV3DK5.woff +0 -0
- package/dist/KaTeX_Math-BoldItalic-K4WTGH3J.woff2 +0 -0
- package/dist/KaTeX_Math-BoldItalic-VB447A4D.ttf +0 -0
- package/dist/KaTeX_Math-Italic-6KGCHLFN.woff2 +0 -0
- package/dist/KaTeX_Math-Italic-KKK3USB2.woff +0 -0
- package/dist/KaTeX_Math-Italic-SON4MRCA.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-RRNVJFFW.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Bold-STQ6RXC7.ttf +0 -0
- package/dist/KaTeX_SansSerif-Bold-X5M5EMOD.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-HMPFTM52.woff2 +0 -0
- package/dist/KaTeX_SansSerif-Italic-PSN4QKYX.woff +0 -0
- package/dist/KaTeX_SansSerif-Italic-WTBAZBGY.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-2TL3USAE.ttf +0 -0
- package/dist/KaTeX_SansSerif-Regular-OQCII6EP.woff +0 -0
- package/dist/KaTeX_SansSerif-Regular-XIQ62X4E.woff2 +0 -0
- package/dist/KaTeX_Script-Regular-72OLXYNA.ttf +0 -0
- package/dist/KaTeX_Script-Regular-A5IFOEBS.woff +0 -0
- package/dist/KaTeX_Script-Regular-APUWIHLP.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-4HRHTS65.woff +0 -0
- package/dist/KaTeX_Size1-Regular-5LRUTBFT.woff2 +0 -0
- package/dist/KaTeX_Size1-Regular-7K6AASVL.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-222HN3GT.ttf +0 -0
- package/dist/KaTeX_Size2-Regular-K5ZHAIS6.woff +0 -0
- package/dist/KaTeX_Size2-Regular-LELKET5D.woff2 +0 -0
- package/dist/KaTeX_Size3-Regular-TLFPAHDE.woff +0 -0
- package/dist/KaTeX_Size3-Regular-UFCO6WCA.ttf +0 -0
- package/dist/KaTeX_Size3-Regular-WQRQ47UD.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-7PGNVPQK.ttf +0 -0
- package/dist/KaTeX_Size4-Regular-CDMV7U5C.woff2 +0 -0
- package/dist/KaTeX_Size4-Regular-PKMWZHNC.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-3F5K6SQ6.ttf +0 -0
- package/dist/KaTeX_Typewriter-Regular-MJMFSK64.woff +0 -0
- package/dist/KaTeX_Typewriter-Regular-VBYJ4NRC.woff2 +0 -0
- package/dist/KernelEngineContext-CcxGYtlr.d.ts +33 -0
- package/dist/LayersPanel-M2LHWUFF.js +6 -0
- package/dist/ModuleCard-QHDGK5XK.js +7 -0
- package/dist/OrbInspector-MHLJ6OEE.css +1756 -0
- package/dist/OrbInspector-QCPEPUPH.js +26 -0
- package/dist/Select-B-iDdnvE.d.ts +185 -0
- package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
- package/dist/ThemeContext-DJmO59xd.d.ts +147 -0
- package/dist/UISlotContext-Dl_ewwCI.d.ts +79 -0
- package/dist/UISlotRenderer-C7WWOK43.js +26 -0
- package/dist/UISlotRenderer-KVFO6J7R.css +1756 -0
- package/dist/auth/browser/index.d.ts +2 -0
- package/dist/auth/browser/index.js +2 -0
- package/dist/auth/react/index.d.ts +56 -0
- package/dist/auth/react/index.js +157 -0
- package/dist/avl/index.css +1756 -0
- package/dist/avl/index.d.ts +2248 -0
- package/dist/avl/index.js +2693 -0
- package/dist/avl-3d-context-BycmO6tG.d.ts +201 -0
- package/dist/avl-schema-parser-CtJxJ9KU.d.ts +132 -0
- package/dist/avl-zoom-state-CKMVuBFg.d.ts +17 -0
- package/dist/chunk-3BBUBJFF.js +339 -0
- package/dist/chunk-3S54FWRC.js +131 -0
- package/dist/chunk-3VZ36ZKO.js +775 -0
- package/dist/chunk-4T3P43NS.js +1133 -0
- package/dist/chunk-4YXBKHHM.js +11488 -0
- package/dist/chunk-57DC34LY.js +525 -0
- package/dist/chunk-5QTYQTPS.js +15 -0
- package/dist/chunk-A2LR6VQQ.js +349 -0
- package/dist/chunk-AB3X7QTE.js +505 -0
- package/dist/chunk-AE7VCQB6.js +561 -0
- package/dist/chunk-AGXD77SL.js +98 -0
- package/dist/chunk-AU7O65OX.js +66 -0
- package/dist/chunk-CPLN6NBQ.js +701 -0
- package/dist/chunk-DZBQA2OW.js +176 -0
- package/dist/chunk-E6KA4J6N.js +227 -0
- package/dist/chunk-EOWMARUB.js +16 -0
- package/dist/chunk-G7DCAZ22.js +19 -0
- package/dist/chunk-GFXCPUMX.js +1334 -0
- package/dist/chunk-HH5KSMH5.js +311 -0
- package/dist/chunk-ILQXJ2AR.js +280 -0
- package/dist/chunk-ILZ7ORX7.js +432 -0
- package/dist/chunk-K4MOPSEL.js +674 -0
- package/dist/chunk-LHP2TK7O.js +47587 -0
- package/dist/chunk-P4ZFUQFF.js +93 -0
- package/dist/chunk-PCR37T3U.js +296 -0
- package/dist/chunk-PRXQGGCO.js +580 -0
- package/dist/chunk-REXYVBUO.js +191 -0
- package/dist/chunk-ROICKAU7.js +24 -0
- package/dist/chunk-SP5CDJ6K.js +338 -0
- package/dist/chunk-TUPZWTRE.js +1051 -0
- package/dist/chunk-TXAUOLWZ.js +490 -0
- package/dist/chunk-TZZBINQY.js +82 -0
- package/dist/chunk-UTDC2NEA.js +14 -0
- package/dist/chunk-UU57VNS2.js +1053 -0
- package/dist/chunk-UXLE3IPR.js +421 -0
- package/dist/chunk-VO2TTLS5.js +94 -0
- package/dist/chunk-X3DMMX27.js +11 -0
- package/dist/chunk-YHMRX6YA.js +455 -0
- package/dist/components/index.css +1756 -0
- package/dist/components/index.d.ts +11299 -0
- package/dist/components/index.js +1110 -0
- package/dist/context/index.d.ts +8 -0
- package/dist/context/index.js +8 -0
- package/dist/core.d.ts +2599 -0
- package/dist/core.js +3 -0
- package/dist/design-classes/index.cjs +431 -0
- package/dist/design-classes/index.d.cts +165 -0
- package/dist/design-classes/index.d.ts +165 -0
- package/dist/design-classes/index.js +399 -0
- package/dist/emojiItems-QGSNAABW.js +20 -0
- package/dist/fx-CmQjnHmT.d.ts +371 -0
- package/dist/hooks/index.d.ts +971 -0
- package/dist/hooks/index.js +8 -0
- package/dist/index.d.ts +408 -0
- package/dist/index.js +178 -0
- package/dist/katexPlugin-FA7NX4PE.css +1161 -0
- package/dist/katexPlugin-NCDKOOQY.js +2 -0
- package/dist/kernel-client-TZKGHJRY.js +516 -0
- package/dist/kernel-wire-wNdAPfhJ.d.ts +88 -0
- package/dist/lib/index.d.ts +602 -0
- package/dist/lib/index.js +1289 -0
- package/dist/paintDispatch-CuJLsr9Y.d.ts +688 -0
- package/dist/parseLessonSegments-GpCeMrb2.d.ts +334 -0
- package/dist/perf-CKiBKbkw.d.ts +22 -0
- package/dist/perf-Dr28-AgT.d.ts +57 -0
- package/dist/prism-X5YWKXO5.js +136 -0
- package/dist/providers/index.css +1756 -0
- package/dist/providers/index.d.ts +355 -0
- package/dist/providers/index.js +29 -0
- package/dist/renderer/index.d.ts +465 -0
- package/dist/renderer/index.js +4 -0
- package/dist/runtime/index.css +1756 -0
- package/dist/runtime/index.d.ts +239 -0
- package/dist/runtime/index.js +28 -0
- package/dist/slot-host-CPzrxLo9.d.ts +48 -0
- package/dist/ssr/index.cjs +9739 -0
- package/dist/ssr/index.d.cts +464 -0
- package/dist/ssr/index.d.ts +464 -0
- package/dist/ssr/index.js +9703 -0
- package/dist/storage/browser/index.d.ts +1 -0
- package/dist/storage/browser/index.js +2 -0
- package/dist/test-support.d.ts +42 -0
- package/dist/test-support.js +181 -0
- package/dist/themeTokens-CRd8AEDF.d.ts +125 -0
- package/dist/three/index.css +503 -0
- package/dist/three/index.d.ts +1185 -0
- package/dist/three/index.js +3908 -0
- package/dist/useUISlots-CiobNFGb.d.ts +211 -0
- package/dist/verification-C5pTeMJv.d.ts +66 -0
- package/dist/verificationRegistry-CVrcxG1s.d.ts +122 -0
- package/dist/wrapCallbackForEvent-B9QLbhxX.d.ts +19 -0
- package/index.css +199 -0
- package/package.json +273 -3
- package/src/core/lib/band-shapes.json +7 -0
- package/src/core/locales/ar.json +1276 -0
- package/src/core/locales/en.json +1276 -0
- package/src/core/locales/index.ts +54 -0
- package/src/core/locales/sl.json +1276 -0
- package/src/core/tokens/native-tokens.json +369 -0
- package/tailwind-compile.cjs +29 -0
- package/tailwind-preset.cjs +1020 -0
- package/themes/_base.css +451 -0
- package/themes/_contract.md +307 -0
- package/themes/_fonts-kenney.css +11 -0
- package/themes/_fonts.css +12 -0
- package/themes/_foundation.css +105 -0
- package/themes/_head.css +22 -0
- package/themes/_presets.css +67 -0
- package/themes/almadar-heritage.css +455 -0
- package/themes/almadar-website.css +269 -0
- package/themes/almadar.css +269 -0
- package/themes/aqua.css +455 -0
- package/themes/arabesque.css +459 -0
- package/themes/art-deco.css +457 -0
- package/themes/art-nouveau.css +459 -0
- package/themes/atelier.css +463 -0
- package/themes/bauhaus.css +461 -0
- package/themes/bloomberg-dense.css +463 -0
- package/themes/blueprint.css +457 -0
- package/themes/clay.css +449 -0
- package/themes/comic.css +453 -0
- package/themes/constructivist.css +457 -0
- package/themes/corporate.css +449 -0
- package/themes/cyberpunk.css +453 -0
- package/themes/frutiger-aero.css +458 -0
- package/themes/game-adventure.css +201 -0
- package/themes/game-rpg.css +203 -0
- package/themes/game-sci-fi.css +201 -0
- package/themes/game-ui-pack.css +200 -0
- package/themes/gazette.css +449 -0
- package/themes/glass.css +457 -0
- package/themes/gothic.css +453 -0
- package/themes/index.css +21 -0
- package/themes/ink-wash.css +459 -0
- package/themes/kawaii.css +459 -0
- package/themes/kflow.css +310 -0
- package/themes/kiosk.css +449 -0
- package/themes/linear-clean.css +463 -0
- package/themes/luxury.css +451 -0
- package/themes/mac-classic.css +455 -0
- package/themes/material.css +463 -0
- package/themes/memphis.css +453 -0
- package/themes/mid-century.css +455 -0
- package/themes/minimalist.css +449 -0
- package/themes/mudcloth.css +459 -0
- package/themes/nata.css +310 -0
- package/themes/neon.css +453 -0
- package/themes/neumorphic.css +451 -0
- package/themes/newsprint.css +455 -0
- package/themes/notion-editorial.css +463 -0
- package/themes/orb.css +465 -0
- package/themes/pixel.css +449 -0
- package/themes/prism.css +309 -0
- package/themes/rawi.css +310 -0
- package/themes/retro.css +452 -0
- package/themes/risograph.css +463 -0
- package/themes/scandi.css +469 -0
- package/themes/sketch.css +455 -0
- package/themes/solarpunk.css +469 -0
- package/themes/steampunk.css +451 -0
- package/themes/swiss.css +455 -0
- package/themes/terminal.css +466 -0
- package/themes/trait-wars.css +487 -0
- package/themes/ukiyo-e.css +459 -0
- package/themes/vaporwave.css +455 -0
- package/themes/victorian.css +453 -0
- package/themes/wabi-sabi.css +459 -0
- package/themes/win95.css +455 -0
- package/themes/wireframe.css +439 -0
- package/themes/zine.css +455 -0
- package/README.md +0 -3
|
@@ -0,0 +1,580 @@
|
|
|
1
|
+
import { useEventBus, useTranslate } from './chunk-4YXBKHHM.js';
|
|
2
|
+
import { createContext, useMemo, useContext, useRef, useEffect, useCallback, useState } from 'react';
|
|
3
|
+
import { jsx } from 'react/jsx-runtime';
|
|
4
|
+
import { resolvePageMeta } from '@almadar/core';
|
|
5
|
+
|
|
6
|
+
function createEditorFocus() {
|
|
7
|
+
let current = null;
|
|
8
|
+
return {
|
|
9
|
+
focused: () => current,
|
|
10
|
+
focus: (editorId) => {
|
|
11
|
+
current = editorId;
|
|
12
|
+
},
|
|
13
|
+
blur: (editorId) => {
|
|
14
|
+
if (current === editorId) current = null;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
var INERT_EDITOR_FOCUS = { focused: () => null, focus: () => void 0, blur: () => void 0 };
|
|
19
|
+
var EditorFocusContext = createContext(INERT_EDITOR_FOCUS);
|
|
20
|
+
var EditorFocusProvider = ({ children }) => {
|
|
21
|
+
const focus = useMemo(createEditorFocus, []);
|
|
22
|
+
return /* @__PURE__ */ jsx(EditorFocusContext.Provider, { value: focus, children });
|
|
23
|
+
};
|
|
24
|
+
EditorFocusProvider.displayName = "EditorFocusProvider";
|
|
25
|
+
function useEditorFocus() {
|
|
26
|
+
return useContext(EditorFocusContext);
|
|
27
|
+
}
|
|
28
|
+
function mergeCaptureTables(tables) {
|
|
29
|
+
const merged = {};
|
|
30
|
+
for (const table of tables) {
|
|
31
|
+
for (const [target, entry] of Object.entries(table)) {
|
|
32
|
+
const current = merged[target];
|
|
33
|
+
if (!current) {
|
|
34
|
+
merged[target] = { mode: entry.mode, keys: new Set(entry.keys) };
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
for (const key of entry.keys) current.keys.add(key);
|
|
38
|
+
if (current.mode === "any" || entry.mode === "any") current.mode = "any";
|
|
39
|
+
else if (current.mode !== entry.mode) {
|
|
40
|
+
current.mode = Array.from(/* @__PURE__ */ new Set([...current.mode.split("|"), entry.mode])).sort().join("|");
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return merged;
|
|
45
|
+
}
|
|
46
|
+
function keyChord(event) {
|
|
47
|
+
const parts = [];
|
|
48
|
+
if (event.ctrlKey) parts.push("Control");
|
|
49
|
+
if (event.altKey) parts.push("Alt");
|
|
50
|
+
if (event.shiftKey) parts.push("Shift");
|
|
51
|
+
if (event.metaKey) parts.push("Meta");
|
|
52
|
+
parts.push(event.key);
|
|
53
|
+
return parts.join("+");
|
|
54
|
+
}
|
|
55
|
+
function useKeyboardRouter(options) {
|
|
56
|
+
const {
|
|
57
|
+
captureTable,
|
|
58
|
+
keyEvent = "KEY",
|
|
59
|
+
enabled = true
|
|
60
|
+
} = options;
|
|
61
|
+
const eventBus = useEventBus();
|
|
62
|
+
const captureTableRef = useRef(captureTable);
|
|
63
|
+
captureTableRef.current = captureTable;
|
|
64
|
+
const editorFocus = useEditorFocus();
|
|
65
|
+
useEffect(() => {
|
|
66
|
+
if (!enabled) return;
|
|
67
|
+
const handleKeyDown = (event) => {
|
|
68
|
+
if (event.isComposing) return;
|
|
69
|
+
const target = editorFocus.focused() ?? "shell";
|
|
70
|
+
const entry = captureTableRef.current[target];
|
|
71
|
+
const captured = entry !== void 0 && (entry.keys.has(event.key) || entry.keys.has(keyChord(event)));
|
|
72
|
+
if (captured) {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
}
|
|
75
|
+
eventBus.emit(`UI:${keyEvent}`, {
|
|
76
|
+
editorId: target,
|
|
77
|
+
key: event.key,
|
|
78
|
+
code: event.code,
|
|
79
|
+
ctrl: event.ctrlKey,
|
|
80
|
+
alt: event.altKey,
|
|
81
|
+
shift: event.shiftKey,
|
|
82
|
+
meta: event.metaKey,
|
|
83
|
+
repeat: event.repeat
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
window.addEventListener("keydown", handleKeyDown, { capture: true });
|
|
87
|
+
return () => {
|
|
88
|
+
window.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
89
|
+
};
|
|
90
|
+
}, [eventBus, editorFocus, enabled, keyEvent]);
|
|
91
|
+
}
|
|
92
|
+
function useSwipeGesture(callbacks, options = {}) {
|
|
93
|
+
const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
|
|
94
|
+
const startX = useRef(0);
|
|
95
|
+
const startY = useRef(0);
|
|
96
|
+
const startTime = useRef(0);
|
|
97
|
+
const currentX = useRef(0);
|
|
98
|
+
const tracking = useRef(false);
|
|
99
|
+
const offsetXRef = useRef(0);
|
|
100
|
+
const isSwipingRef = useRef(false);
|
|
101
|
+
const onPointerDown = useCallback((e) => {
|
|
102
|
+
startX.current = e.clientX;
|
|
103
|
+
startY.current = e.clientY;
|
|
104
|
+
currentX.current = e.clientX;
|
|
105
|
+
startTime.current = Date.now();
|
|
106
|
+
tracking.current = true;
|
|
107
|
+
isSwipingRef.current = false;
|
|
108
|
+
offsetXRef.current = 0;
|
|
109
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
110
|
+
}, []);
|
|
111
|
+
const onPointerMove = useCallback((e) => {
|
|
112
|
+
if (!tracking.current) return;
|
|
113
|
+
if (preventDefault) e.preventDefault();
|
|
114
|
+
currentX.current = e.clientX;
|
|
115
|
+
const dx = e.clientX - startX.current;
|
|
116
|
+
const dy = e.clientY - startY.current;
|
|
117
|
+
if (Math.abs(dx) > 10 && Math.abs(dx) > Math.abs(dy)) {
|
|
118
|
+
isSwipingRef.current = true;
|
|
119
|
+
offsetXRef.current = dx;
|
|
120
|
+
}
|
|
121
|
+
}, [preventDefault]);
|
|
122
|
+
const onPointerUp = useCallback((e) => {
|
|
123
|
+
if (!tracking.current) return;
|
|
124
|
+
tracking.current = false;
|
|
125
|
+
const dx = e.clientX - startX.current;
|
|
126
|
+
const dy = e.clientY - startY.current;
|
|
127
|
+
const elapsed = Date.now() - startTime.current;
|
|
128
|
+
const velocity = Math.abs(dx) / Math.max(elapsed, 1);
|
|
129
|
+
offsetXRef.current = 0;
|
|
130
|
+
isSwipingRef.current = false;
|
|
131
|
+
if (Math.abs(dx) < threshold && velocity < velocityThreshold) return;
|
|
132
|
+
if (Math.abs(dx) > Math.abs(dy)) {
|
|
133
|
+
if (dx < -threshold) callbacks.onSwipeLeft?.();
|
|
134
|
+
else if (dx > threshold) callbacks.onSwipeRight?.();
|
|
135
|
+
} else {
|
|
136
|
+
if (dy < -threshold) callbacks.onSwipeUp?.();
|
|
137
|
+
else if (dy > threshold) callbacks.onSwipeDown?.();
|
|
138
|
+
}
|
|
139
|
+
}, [threshold, velocityThreshold, callbacks]);
|
|
140
|
+
const onPointerCancel = useCallback(() => {
|
|
141
|
+
tracking.current = false;
|
|
142
|
+
offsetXRef.current = 0;
|
|
143
|
+
isSwipingRef.current = false;
|
|
144
|
+
}, []);
|
|
145
|
+
return {
|
|
146
|
+
onPointerDown,
|
|
147
|
+
onPointerMove,
|
|
148
|
+
onPointerUp,
|
|
149
|
+
onPointerCancel,
|
|
150
|
+
offsetX: offsetXRef.current,
|
|
151
|
+
isSwiping: isSwipingRef.current
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
function localPoint(canvas, clientX, clientY) {
|
|
155
|
+
if (!canvas) return { x: clientX, y: clientY };
|
|
156
|
+
const rect = canvas.getBoundingClientRect();
|
|
157
|
+
return { x: clientX - rect.left, y: clientY - rect.top };
|
|
158
|
+
}
|
|
159
|
+
function useCanvasGestures(options) {
|
|
160
|
+
const {
|
|
161
|
+
canvasRef,
|
|
162
|
+
enabled = true,
|
|
163
|
+
wheelStep = 1.1,
|
|
164
|
+
onPointerDown,
|
|
165
|
+
onPointerMove,
|
|
166
|
+
onPointerUp,
|
|
167
|
+
onZoom,
|
|
168
|
+
onPanDelta,
|
|
169
|
+
onMultiTouchStart
|
|
170
|
+
} = options;
|
|
171
|
+
const pointers = useRef(/* @__PURE__ */ new Map());
|
|
172
|
+
const pinch = useRef(null);
|
|
173
|
+
const computePinch = useCallback(() => {
|
|
174
|
+
const pts = [...pointers.current.values()];
|
|
175
|
+
const dx = pts[1].x - pts[0].x;
|
|
176
|
+
const dy = pts[1].y - pts[0].y;
|
|
177
|
+
return {
|
|
178
|
+
distance: Math.hypot(dx, dy) || 1,
|
|
179
|
+
centroid: { x: (pts[0].x + pts[1].x) / 2, y: (pts[0].y + pts[1].y) / 2 }
|
|
180
|
+
};
|
|
181
|
+
}, []);
|
|
182
|
+
const handlePointerDown = useCallback(
|
|
183
|
+
(e) => {
|
|
184
|
+
if (!enabled) return;
|
|
185
|
+
e.currentTarget.setPointerCapture(e.pointerId);
|
|
186
|
+
pointers.current.set(e.pointerId, localPoint(canvasRef.current, e.clientX, e.clientY));
|
|
187
|
+
if (pointers.current.size === 2) {
|
|
188
|
+
onMultiTouchStart?.();
|
|
189
|
+
pinch.current = computePinch();
|
|
190
|
+
} else if (pointers.current.size === 1) {
|
|
191
|
+
onPointerDown?.(e);
|
|
192
|
+
}
|
|
193
|
+
},
|
|
194
|
+
[enabled, canvasRef, onMultiTouchStart, computePinch, onPointerDown]
|
|
195
|
+
);
|
|
196
|
+
const handlePointerMove = useCallback(
|
|
197
|
+
(e) => {
|
|
198
|
+
if (!enabled) return;
|
|
199
|
+
if (pointers.current.has(e.pointerId)) {
|
|
200
|
+
pointers.current.set(e.pointerId, localPoint(canvasRef.current, e.clientX, e.clientY));
|
|
201
|
+
}
|
|
202
|
+
if (pointers.current.size >= 2 && pinch.current) {
|
|
203
|
+
const next = computePinch();
|
|
204
|
+
const prev = pinch.current;
|
|
205
|
+
if (next.distance !== prev.distance) {
|
|
206
|
+
onZoom?.(next.distance / prev.distance, next.centroid.x, next.centroid.y);
|
|
207
|
+
}
|
|
208
|
+
onPanDelta?.(next.centroid.x - prev.centroid.x, next.centroid.y - prev.centroid.y);
|
|
209
|
+
pinch.current = next;
|
|
210
|
+
return;
|
|
211
|
+
}
|
|
212
|
+
onPointerMove?.(e);
|
|
213
|
+
},
|
|
214
|
+
[enabled, canvasRef, computePinch, onZoom, onPanDelta, onPointerMove]
|
|
215
|
+
);
|
|
216
|
+
const endPointer = useCallback(
|
|
217
|
+
(e, fireUp) => {
|
|
218
|
+
const wasMulti = pointers.current.size >= 2;
|
|
219
|
+
pointers.current.delete(e.pointerId);
|
|
220
|
+
if (pointers.current.size < 2) pinch.current = null;
|
|
221
|
+
if (wasMulti && pointers.current.size === 1) return;
|
|
222
|
+
if (pointers.current.size === 0 && fireUp) onPointerUp?.(e);
|
|
223
|
+
},
|
|
224
|
+
[onPointerUp]
|
|
225
|
+
);
|
|
226
|
+
const handlePointerUp = useCallback(
|
|
227
|
+
(e) => {
|
|
228
|
+
if (!enabled) return;
|
|
229
|
+
endPointer(e, true);
|
|
230
|
+
},
|
|
231
|
+
[enabled, endPointer]
|
|
232
|
+
);
|
|
233
|
+
const handlePointerCancel = useCallback(
|
|
234
|
+
(e) => {
|
|
235
|
+
if (!enabled) return;
|
|
236
|
+
endPointer(e, false);
|
|
237
|
+
},
|
|
238
|
+
[enabled, endPointer]
|
|
239
|
+
);
|
|
240
|
+
const handleWheel = useCallback(
|
|
241
|
+
(e) => {
|
|
242
|
+
if (!enabled) return;
|
|
243
|
+
e.preventDefault();
|
|
244
|
+
const { x, y } = localPoint(canvasRef.current, e.clientX, e.clientY);
|
|
245
|
+
onZoom?.(e.deltaY < 0 ? wheelStep : 1 / wheelStep, x, y);
|
|
246
|
+
},
|
|
247
|
+
[enabled, canvasRef, wheelStep, onZoom]
|
|
248
|
+
);
|
|
249
|
+
return {
|
|
250
|
+
onPointerDown: handlePointerDown,
|
|
251
|
+
onPointerMove: handlePointerMove,
|
|
252
|
+
onPointerUp: handlePointerUp,
|
|
253
|
+
onPointerCancel: handlePointerCancel,
|
|
254
|
+
onWheel: handleWheel
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
function useLongPress(onLongPress, options = {}) {
|
|
258
|
+
const { duration = 500, moveThreshold = 10 } = options;
|
|
259
|
+
const timerRef = useRef(null);
|
|
260
|
+
const startPos = useRef({ x: 0, y: 0 });
|
|
261
|
+
const isPressedRef = useRef(false);
|
|
262
|
+
const firedRef = useRef(false);
|
|
263
|
+
const cancel = useCallback(() => {
|
|
264
|
+
if (timerRef.current) {
|
|
265
|
+
clearTimeout(timerRef.current);
|
|
266
|
+
timerRef.current = null;
|
|
267
|
+
}
|
|
268
|
+
isPressedRef.current = false;
|
|
269
|
+
}, []);
|
|
270
|
+
const onPointerDown = useCallback((e) => {
|
|
271
|
+
firedRef.current = false;
|
|
272
|
+
startPos.current = { x: e.clientX, y: e.clientY };
|
|
273
|
+
isPressedRef.current = true;
|
|
274
|
+
timerRef.current = setTimeout(() => {
|
|
275
|
+
firedRef.current = true;
|
|
276
|
+
isPressedRef.current = false;
|
|
277
|
+
onLongPress();
|
|
278
|
+
}, duration);
|
|
279
|
+
}, [duration, onLongPress]);
|
|
280
|
+
const onPointerMove = useCallback((e) => {
|
|
281
|
+
if (!isPressedRef.current) return;
|
|
282
|
+
const dx = e.clientX - startPos.current.x;
|
|
283
|
+
const dy = e.clientY - startPos.current.y;
|
|
284
|
+
if (Math.sqrt(dx * dx + dy * dy) > moveThreshold) {
|
|
285
|
+
cancel();
|
|
286
|
+
}
|
|
287
|
+
}, [moveThreshold, cancel]);
|
|
288
|
+
const onPointerUp = useCallback(() => {
|
|
289
|
+
cancel();
|
|
290
|
+
}, [cancel]);
|
|
291
|
+
const onPointerCancel = useCallback(() => {
|
|
292
|
+
cancel();
|
|
293
|
+
}, [cancel]);
|
|
294
|
+
return {
|
|
295
|
+
onPointerDown,
|
|
296
|
+
onPointerMove,
|
|
297
|
+
onPointerUp,
|
|
298
|
+
onPointerCancel,
|
|
299
|
+
isPressed: isPressedRef.current
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
// src/hooks/useAuthContext.ts
|
|
304
|
+
function useAuthContext() {
|
|
305
|
+
return {
|
|
306
|
+
user: null,
|
|
307
|
+
loading: false,
|
|
308
|
+
signIn: void 0,
|
|
309
|
+
signOut: void 0
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
var queryStores = /* @__PURE__ */ new Map();
|
|
313
|
+
function getOrCreateStore(query) {
|
|
314
|
+
if (!queryStores.has(query)) {
|
|
315
|
+
queryStores.set(query, {
|
|
316
|
+
search: "",
|
|
317
|
+
filters: {},
|
|
318
|
+
sortField: void 0,
|
|
319
|
+
sortDirection: void 0,
|
|
320
|
+
listeners: /* @__PURE__ */ new Set()
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
return queryStores.get(query);
|
|
324
|
+
}
|
|
325
|
+
function useQuerySingleton(query) {
|
|
326
|
+
const [, forceUpdate] = useState({});
|
|
327
|
+
if (!query) {
|
|
328
|
+
return null;
|
|
329
|
+
}
|
|
330
|
+
const store = useMemo(() => getOrCreateStore(query), [query]);
|
|
331
|
+
useMemo(() => {
|
|
332
|
+
const listener = () => forceUpdate({});
|
|
333
|
+
store.listeners.add(listener);
|
|
334
|
+
return () => {
|
|
335
|
+
store.listeners.delete(listener);
|
|
336
|
+
};
|
|
337
|
+
}, [store]);
|
|
338
|
+
const notifyListeners = useCallback(() => {
|
|
339
|
+
store.listeners.forEach((listener) => listener());
|
|
340
|
+
}, [store]);
|
|
341
|
+
const setSearch = useCallback((value) => {
|
|
342
|
+
store.search = value;
|
|
343
|
+
notifyListeners();
|
|
344
|
+
}, [store, notifyListeners]);
|
|
345
|
+
const setFilter = useCallback((key, value) => {
|
|
346
|
+
store.filters = { ...store.filters, [key]: value };
|
|
347
|
+
notifyListeners();
|
|
348
|
+
}, [store, notifyListeners]);
|
|
349
|
+
const clearFilters = useCallback(() => {
|
|
350
|
+
store.filters = {};
|
|
351
|
+
store.search = "";
|
|
352
|
+
notifyListeners();
|
|
353
|
+
}, [store, notifyListeners]);
|
|
354
|
+
const setSort = useCallback((field, direction) => {
|
|
355
|
+
store.sortField = field;
|
|
356
|
+
store.sortDirection = direction;
|
|
357
|
+
notifyListeners();
|
|
358
|
+
}, [store, notifyListeners]);
|
|
359
|
+
return {
|
|
360
|
+
search: store.search,
|
|
361
|
+
setSearch,
|
|
362
|
+
filters: store.filters,
|
|
363
|
+
setFilter,
|
|
364
|
+
clearFilters,
|
|
365
|
+
sortField: store.sortField,
|
|
366
|
+
sortDirection: store.sortDirection,
|
|
367
|
+
setSort
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
function parseQueryBinding(binding) {
|
|
371
|
+
const cleaned = binding.startsWith("@") ? binding.slice(1) : binding;
|
|
372
|
+
const parts = cleaned.split(".");
|
|
373
|
+
return {
|
|
374
|
+
query: parts[0],
|
|
375
|
+
field: parts.length > 1 ? parts.slice(1).join(".") : void 0
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
// src/lib/bus-claim.ts
|
|
380
|
+
var claims = /* @__PURE__ */ new WeakMap();
|
|
381
|
+
function claimDelivery(source, trait, event) {
|
|
382
|
+
if (source === void 0) return true;
|
|
383
|
+
const key = `${trait}\0${event}`;
|
|
384
|
+
const seen = claims.get(source);
|
|
385
|
+
if (seen === void 0) {
|
|
386
|
+
claims.set(source, /* @__PURE__ */ new Set([key]));
|
|
387
|
+
return true;
|
|
388
|
+
}
|
|
389
|
+
if (seen.has(key)) return false;
|
|
390
|
+
seen.add(key);
|
|
391
|
+
return true;
|
|
392
|
+
}
|
|
393
|
+
var DISPATCH_CLAIM = "$dispatch";
|
|
394
|
+
function claimDispatch(source, event) {
|
|
395
|
+
return claimDelivery(source, DISPATCH_CLAIM, event);
|
|
396
|
+
}
|
|
397
|
+
var OWNED = "data-orb-head";
|
|
398
|
+
var shellTitle;
|
|
399
|
+
function ownedTag(tag, attrs) {
|
|
400
|
+
const el = document.createElement(tag);
|
|
401
|
+
for (const [k, v] of Object.entries(attrs)) el.setAttribute(k, v);
|
|
402
|
+
el.setAttribute(OWNED, "");
|
|
403
|
+
return el;
|
|
404
|
+
}
|
|
405
|
+
function usePageHead(input) {
|
|
406
|
+
const { messages, locale } = useTranslate();
|
|
407
|
+
const title = input ? resolvePageMeta(input.title, (k) => messages?.[k]) : void 0;
|
|
408
|
+
const description = input ? resolvePageMeta(input.description, (k) => messages?.[k]) : void 0;
|
|
409
|
+
const isPublic = input?.access !== "authenticated" && input?.indexing !== "noindex";
|
|
410
|
+
const canonical = input?.origin !== void 0 ? `${input.origin.replace(/\/+$/, "")}${input.path}` : void 0;
|
|
411
|
+
const siteName = input?.siteName;
|
|
412
|
+
const active = input !== null;
|
|
413
|
+
const originBase = input?.origin?.replace(/\/+$/, "");
|
|
414
|
+
const hreflang = [];
|
|
415
|
+
if (originBase !== void 0) {
|
|
416
|
+
for (const alt of input?.alternates ?? []) hreflang.push([alt.locale, `${originBase}${alt.path}`]);
|
|
417
|
+
const fallback = input?.alternates?.find((alt) => alt.locale === input.defaultLocale);
|
|
418
|
+
if (fallback !== void 0) hreflang.push(["x-default", `${originBase}${fallback.path}`]);
|
|
419
|
+
}
|
|
420
|
+
const hreflangKey = hreflang.map(([lang, href]) => `${lang} ${href}`).join("\n");
|
|
421
|
+
useEffect(() => {
|
|
422
|
+
if (!active || typeof document === "undefined") return void 0;
|
|
423
|
+
shellTitle ??= document.title;
|
|
424
|
+
document.title = title ?? siteName ?? shellTitle;
|
|
425
|
+
const tags = [];
|
|
426
|
+
if (!isPublic) tags.push(ownedTag("meta", { name: "robots", content: "noindex" }));
|
|
427
|
+
if (isPublic && description !== void 0) {
|
|
428
|
+
tags.push(ownedTag("meta", { name: "description", content: description }));
|
|
429
|
+
tags.push(ownedTag("meta", { property: "og:description", content: description }));
|
|
430
|
+
}
|
|
431
|
+
if (isPublic && title !== void 0) tags.push(ownedTag("meta", { property: "og:title", content: title }));
|
|
432
|
+
if (isPublic && canonical !== void 0) {
|
|
433
|
+
tags.push(ownedTag("link", { rel: "canonical", href: canonical }));
|
|
434
|
+
tags.push(ownedTag("meta", { property: "og:url", content: canonical }));
|
|
435
|
+
}
|
|
436
|
+
if (isPublic && siteName !== void 0) tags.push(ownedTag("meta", { property: "og:site_name", content: siteName }));
|
|
437
|
+
if (isPublic) tags.push(ownedTag("meta", { property: "og:locale", content: locale }));
|
|
438
|
+
if (isPublic && hreflangKey !== "") {
|
|
439
|
+
for (const line of hreflangKey.split("\n")) {
|
|
440
|
+
const space = line.indexOf(" ");
|
|
441
|
+
tags.push(ownedTag("link", { rel: "alternate", hreflang: line.slice(0, space), href: line.slice(space + 1) }));
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
for (const stale of Array.from(document.head.querySelectorAll(`[${OWNED}]`))) stale.remove();
|
|
445
|
+
for (const tag of tags) document.head.appendChild(tag);
|
|
446
|
+
return () => {
|
|
447
|
+
for (const tag of tags) tag.remove();
|
|
448
|
+
};
|
|
449
|
+
}, [active, title, description, isPublic, canonical, siteName, locale, hreflangKey]);
|
|
450
|
+
}
|
|
451
|
+
function usePullToRefresh(onRefresh, options = {}) {
|
|
452
|
+
const { threshold = 60, maxPull = 120 } = options;
|
|
453
|
+
const [pullDistance, setPullDistance] = useState(0);
|
|
454
|
+
const [isPulling, setIsPulling] = useState(false);
|
|
455
|
+
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
456
|
+
const startY = useRef(0);
|
|
457
|
+
const scrollTopRef = useRef(0);
|
|
458
|
+
const onTouchStart = useCallback((e) => {
|
|
459
|
+
const container = e.currentTarget;
|
|
460
|
+
scrollTopRef.current = container.scrollTop;
|
|
461
|
+
if (scrollTopRef.current <= 0) {
|
|
462
|
+
startY.current = e.touches[0].clientY;
|
|
463
|
+
setIsPulling(true);
|
|
464
|
+
}
|
|
465
|
+
}, []);
|
|
466
|
+
const onTouchMove = useCallback((e) => {
|
|
467
|
+
if (!isPulling || isRefreshing) return;
|
|
468
|
+
const container = e.currentTarget;
|
|
469
|
+
if (container.scrollTop > 0) {
|
|
470
|
+
setPullDistance(0);
|
|
471
|
+
return;
|
|
472
|
+
}
|
|
473
|
+
const dy = e.touches[0].clientY - startY.current;
|
|
474
|
+
if (dy > 0) {
|
|
475
|
+
const distance = Math.min(dy * 0.5, maxPull);
|
|
476
|
+
setPullDistance(distance);
|
|
477
|
+
}
|
|
478
|
+
}, [isPulling, isRefreshing, maxPull]);
|
|
479
|
+
const onTouchEnd = useCallback(() => {
|
|
480
|
+
if (!isPulling) return;
|
|
481
|
+
setIsPulling(false);
|
|
482
|
+
if (pullDistance >= threshold && !isRefreshing) {
|
|
483
|
+
setIsRefreshing(true);
|
|
484
|
+
setPullDistance(threshold);
|
|
485
|
+
onRefresh();
|
|
486
|
+
} else {
|
|
487
|
+
setPullDistance(0);
|
|
488
|
+
}
|
|
489
|
+
}, [isPulling, pullDistance, threshold, isRefreshing, onRefresh]);
|
|
490
|
+
const endRefresh = useCallback(() => {
|
|
491
|
+
setIsRefreshing(false);
|
|
492
|
+
setPullDistance(0);
|
|
493
|
+
}, []);
|
|
494
|
+
const containerProps = {
|
|
495
|
+
onTouchStart,
|
|
496
|
+
onTouchMove,
|
|
497
|
+
onTouchEnd,
|
|
498
|
+
style: {
|
|
499
|
+
transform: pullDistance > 0 ? `translateY(${pullDistance}px)` : void 0,
|
|
500
|
+
transition: isPulling ? "none" : "transform 300ms ease-out"
|
|
501
|
+
}
|
|
502
|
+
};
|
|
503
|
+
return {
|
|
504
|
+
pullDistance,
|
|
505
|
+
isPulling,
|
|
506
|
+
isRefreshing,
|
|
507
|
+
containerProps,
|
|
508
|
+
endRefresh
|
|
509
|
+
};
|
|
510
|
+
}
|
|
511
|
+
function useDragReorder(initialItems, onReorder) {
|
|
512
|
+
const [items, setItems] = useState(initialItems);
|
|
513
|
+
const [dragIndex, setDragIndex] = useState(-1);
|
|
514
|
+
const [dragOverIndex, setDragOverIndex] = useState(-1);
|
|
515
|
+
const itemsRef = useRef(initialItems);
|
|
516
|
+
if (initialItems !== itemsRef.current) {
|
|
517
|
+
itemsRef.current = initialItems;
|
|
518
|
+
setItems(initialItems);
|
|
519
|
+
}
|
|
520
|
+
const isDragging = dragIndex >= 0;
|
|
521
|
+
const handleDragStart = useCallback((index) => (e) => {
|
|
522
|
+
e.preventDefault();
|
|
523
|
+
setDragIndex(index);
|
|
524
|
+
setDragOverIndex(index);
|
|
525
|
+
e.target.setPointerCapture?.(e.pointerId);
|
|
526
|
+
}, []);
|
|
527
|
+
const handleDragMove = useCallback((index) => (e) => {
|
|
528
|
+
if (dragIndex < 0) return;
|
|
529
|
+
const target = document.elementFromPoint(e.clientX, e.clientY);
|
|
530
|
+
if (!target) return;
|
|
531
|
+
let el = target;
|
|
532
|
+
while (el && !el.dataset.dragIndex) {
|
|
533
|
+
el = el.parentElement;
|
|
534
|
+
}
|
|
535
|
+
if (el?.dataset.dragIndex) {
|
|
536
|
+
const overIndex = parseInt(el.dataset.dragIndex, 10);
|
|
537
|
+
if (!isNaN(overIndex) && overIndex !== dragOverIndex) {
|
|
538
|
+
setDragOverIndex(overIndex);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}, [dragIndex, dragOverIndex]);
|
|
542
|
+
const handleDragEnd = useCallback(() => {
|
|
543
|
+
if (dragIndex >= 0 && dragOverIndex >= 0 && dragIndex !== dragOverIndex) {
|
|
544
|
+
const newItems = [...items];
|
|
545
|
+
const [movedItem] = newItems.splice(dragIndex, 1);
|
|
546
|
+
newItems.splice(dragOverIndex, 0, movedItem);
|
|
547
|
+
setItems(newItems);
|
|
548
|
+
onReorder(dragIndex, dragOverIndex, items[dragIndex]);
|
|
549
|
+
}
|
|
550
|
+
setDragIndex(-1);
|
|
551
|
+
setDragOverIndex(-1);
|
|
552
|
+
}, [dragIndex, dragOverIndex, items, onReorder]);
|
|
553
|
+
const getDragHandleProps = useCallback((index) => ({
|
|
554
|
+
onPointerDown: handleDragStart(index),
|
|
555
|
+
style: { cursor: "grab", touchAction: "none" },
|
|
556
|
+
"aria-grabbed": dragIndex === index,
|
|
557
|
+
role: "button"
|
|
558
|
+
}), [handleDragStart, dragIndex]);
|
|
559
|
+
const getItemProps = useCallback((index) => ({
|
|
560
|
+
onPointerMove: handleDragMove(index),
|
|
561
|
+
onPointerUp: handleDragEnd,
|
|
562
|
+
"aria-dropeffect": "move",
|
|
563
|
+
"data-drag-index": String(index),
|
|
564
|
+
style: {
|
|
565
|
+
opacity: dragIndex === index ? 0.5 : 1,
|
|
566
|
+
transition: isDragging ? "transform 150ms ease" : void 0,
|
|
567
|
+
transform: isDragging && dragOverIndex >= 0 ? index === dragIndex ? "scale(1.02)" : index > dragIndex && index <= dragOverIndex ? "translateY(-100%)" : index < dragIndex && index >= dragOverIndex ? "translateY(100%)" : void 0 : void 0
|
|
568
|
+
}
|
|
569
|
+
}), [handleDragMove, handleDragEnd, dragIndex, dragOverIndex, isDragging]);
|
|
570
|
+
return {
|
|
571
|
+
items,
|
|
572
|
+
dragIndex,
|
|
573
|
+
dragOverIndex,
|
|
574
|
+
isDragging,
|
|
575
|
+
getDragHandleProps,
|
|
576
|
+
getItemProps
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
export { EditorFocusProvider, claimDelivery, claimDispatch, keyChord, mergeCaptureTables, parseQueryBinding, useAuthContext, useCanvasGestures, useDragReorder, useEditorFocus, useKeyboardRouter, useLongPress, usePageHead, usePullToRefresh, useQuerySingleton, useSwipeGesture };
|