@almadar/shell-web 0.1.0 → 1.1.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/dist/{ArbitraryClassCompiler-Mzabq-UB.d.ts → ArbitraryClassCompiler-CO_iASBn.d.ts} +99 -4
- package/dist/AvlGlyph-PIXU6QH5.js +5 -0
- package/dist/AvlStateMachine-CKGMECMG.js +8 -0
- package/dist/AvlTransitionDetail-QZX6G5KJ.js +10 -0
- package/dist/AvlTransitionExplainer-26WLEIC6.js +11 -0
- package/dist/BehaviorView-JLZ4PKWY.js +10 -0
- package/dist/{EventBusProvider-CVwjkV_2.d.ts → EventBusProvider-BFFHfN4O.d.ts} +12 -0
- package/dist/{FileTree-BCFnBEuQ.d.ts → FileTree-B3GDAjaQ.d.ts} +131 -4
- package/dist/FlowCanvas-RPII4V24.js +23 -0
- package/dist/{BehaviorValueFrame-SSEMEBTG.css → FlowCanvas-VWUPMBKB.css} +189 -191
- package/dist/{GameAudioProvider-Cm9BnvmP.d.ts → GameAudioProvider-D7wo5ryN.d.ts} +5 -8
- package/dist/KernelEngineContext-CPeWQMAz.d.ts +46 -0
- package/dist/LayersPanel-M2LHWUFF.js +6 -0
- package/dist/ModuleCard-NJD6JQGD.js +6 -0
- package/dist/OrbInspector-OWWKPOBF.js +23 -0
- package/dist/{TraitValueFrame-4G3KOUBR.css → OrbInspector-VMTMZHNQ.css} +189 -191
- package/dist/{Select-mDZIwNqN.d.ts → Select-C2Uq6t86.d.ts} +17 -31
- package/dist/ServerBridge-Bqsj-lOU.d.ts +124 -0
- package/dist/{FlowCanvas-3JRMNJLV.css → UISlotRenderer-BIS6KT7T.css} +189 -191
- package/dist/UISlotRenderer-PY7FIJXN.js +23 -0
- package/dist/auth/browser/index.js +1 -0
- package/dist/auth/react/index.d.ts +8 -1
- package/dist/auth/react/index.js +40 -2
- package/dist/avl/index.css +189 -191
- package/dist/avl/index.d.ts +107 -85
- package/dist/avl/index.js +170 -39
- package/dist/{chunk-P4LNHAFI.js → chunk-2WGR4TDJ.js} +465 -36
- package/dist/{chunk-GKIFONTE.js → chunk-3S54FWRC.js} +2 -2
- package/dist/{chunk-KVQS4GXU.js → chunk-4YJ53G7S.js} +18 -8
- package/dist/{chunk-MBQAMMSE.js → chunk-4YXBKHHM.js} +269 -658
- package/dist/{chunk-YDNJLLG6.js → chunk-57DC34LY.js} +19 -10
- package/dist/{chunk-FP3WIKTC.js → chunk-7N6ZPHQ5.js} +9 -1
- package/dist/{chunk-AILY3XPS.js → chunk-AE7VCQB6.js} +5 -6
- package/dist/{chunk-L677XGY3.js → chunk-AGVSO4WY.js} +4 -5
- package/dist/{chunk-FAJDTHWC.js → chunk-AGXD77SL.js} +2 -2
- package/dist/chunk-AU7O65OX.js +66 -0
- package/dist/{chunk-DFNZUYX4.js → chunk-FAKU5F62.js} +273 -29
- package/dist/{chunk-U6QRZASX.js → chunk-ILQXJ2AR.js} +1 -1
- package/dist/chunk-M74BCDBQ.js +490 -0
- package/dist/{chunk-GYTPOFVC.js → chunk-MS4K3K2R.js} +12095 -13329
- package/dist/{chunk-SGM3FASH.js → chunk-OWNG4JZI.js} +13 -12
- package/dist/{chunk-VFF5OO47.js → chunk-PCR37T3U.js} +15 -38
- package/dist/{chunk-SJGJJKBY.js → chunk-PRLHKBXG.js} +5 -3
- package/dist/{chunk-R5O5AUPI.js → chunk-PRXQGGCO.js} +93 -86
- package/dist/{chunk-42FY4RYA.js → chunk-REXYVBUO.js} +2 -2
- package/dist/{chunk-EQAMU2ZC.js → chunk-UTDC2NEA.js} +1 -1
- package/dist/{chunk-73SRAB4P.js → chunk-UU57VNS2.js} +2 -2
- package/dist/{chunk-TESBIVUA.js → chunk-VHC2M26B.js} +2 -2
- package/dist/{chunk-L2DEKY4J.js → chunk-VO2TTLS5.js} +3 -6
- package/dist/{chunk-2PY54Z44.js → chunk-VUIACGDU.js} +4 -5
- package/dist/{chunk-DLZF4PVE.js → chunk-YYIHRIDH.js} +3 -3
- package/dist/{chunk-DYEKAA4L.js → chunk-ZDRDJKYB.js} +243 -252
- package/dist/components/index.css +189 -191
- package/dist/components/index.d.ts +739 -289
- package/dist/components/index.js +25 -28
- package/dist/context/index.d.ts +2 -3
- package/dist/context/index.js +4 -3
- package/dist/core.d.ts +95 -19
- package/dist/core.js +2 -1
- package/dist/design-classes/index.cjs +3 -1
- package/dist/design-classes/index.js +3 -1
- package/dist/{fx-CmQjnHmT.d.ts → fx-Br8zjvu9.d.ts} +6 -6
- package/dist/hooks/index.d.ts +40 -5
- package/dist/hooks/index.js +5 -4
- package/dist/index.d.ts +40 -114
- package/dist/index.js +174 -34
- package/dist/kernel-client-JW6OH5FX.js +537 -0
- package/dist/kernel-wire-DGAySGhX.d.ts +95 -0
- package/dist/lib/index.d.ts +3 -4
- package/dist/lib/index.js +4 -4
- package/dist/{prism-AIWGN2X5.js → prism-X5YWKXO5.js} +5 -3
- package/dist/providers/index.css +189 -191
- package/dist/providers/index.d.ts +41 -28
- package/dist/providers/index.js +19 -24
- package/dist/renderer/index.d.ts +0 -2
- package/dist/renderer/index.js +1 -0
- package/dist/runtime/index.css +189 -191
- package/dist/runtime/index.d.ts +57 -253
- package/dist/runtime/index.js +18 -24
- package/dist/ssr/index.cjs +2643 -535
- package/dist/ssr/index.d.cts +0 -23
- package/dist/ssr/index.d.ts +0 -23
- package/dist/ssr/index.js +2639 -535
- package/dist/storage/browser/index.js +1 -0
- package/dist/test-support.d.ts +15 -8
- package/dist/test-support.js +91 -24
- package/dist/{paintDispatch-ChW5mVuK.d.ts → verificationRegistry-oopV1J1n.d.ts} +132 -30
- package/package.json +14 -38
- package/src/core/lib/band-shapes.json +7 -0
- package/src/core/locales/ar.json +18 -5
- package/src/core/locales/en.json +18 -5
- package/src/core/locales/sl.json +18 -5
- package/tailwind-preset.cjs +30 -1
- package/dist/AvlGlyph-JKJOAH23.js +0 -6
- package/dist/AvlStateMachine-PI4YGREK.js +0 -8
- package/dist/AvlTransitionDetail-ZH7V24UG.js +0 -12
- package/dist/AvlTransitionExplainer-ZSRT7L6Y.js +0 -13
- package/dist/BehaviorValueFrame-6RUJXT4A.js +0 -29
- package/dist/BehaviorView-RFEE5J6E.js +0 -10
- package/dist/Canvas3DHost-_Y-5uLM_.d.ts +0 -552
- package/dist/FlowCanvas-STDC4OWK.js +0 -27
- package/dist/KernelEngineContext-BOCQoFwk.d.ts +0 -43
- package/dist/LayersPanel-BBQ54IVG.js +0 -7
- package/dist/ModuleCard-3TT2X7IW.js +0 -7
- package/dist/OrbInspector-K6T6O7GI.js +0 -27
- package/dist/OrbInspector-MHLJ6OEE.css +0 -1756
- package/dist/ServerBridge-Cm1On51b.d.ts +0 -233
- package/dist/TraitValueFrame-2PJGLLVI.js +0 -28
- package/dist/UISlotRenderer-JKFSX24W.js +0 -27
- package/dist/UISlotRenderer-KVFO6J7R.css +0 -1756
- package/dist/UserContext-DqWeZkUZ.d.ts +0 -100
- package/dist/avl-3d-context-BIRKWpaL.d.ts +0 -204
- package/dist/avl-schema-parser-CtJxJ9KU.d.ts +0 -132
- package/dist/avl-zoom-state-CKMVuBFg.d.ts +0 -17
- package/dist/chunk-2QOH2HWM.js +0 -95
- package/dist/chunk-6P3MWXYE.js +0 -440
- package/dist/chunk-B4BU77LT.js +0 -432
- package/dist/chunk-DJ433ET5.js +0 -1327
- package/dist/chunk-DZ42OJQC.js +0 -176
- package/dist/chunk-EOWMARUB.js +0 -16
- package/dist/chunk-FIW6WN23.js +0 -508
- package/dist/chunk-GAR5TQ5B.js +0 -199
- package/dist/chunk-PC7K4SK7.js +0 -1384
- package/dist/chunk-ZO6MXAS3.js +0 -69
- package/dist/kernel-client-ZH4PSMCN.js +0 -367
- package/dist/kernel-wire-B4S8pnP3.d.ts +0 -65
- package/dist/three/index.css +0 -503
- package/dist/three/index.d.ts +0 -1185
- package/dist/three/index.js +0 -3896
- package/dist/useKeyboardRouter-Dsq553Ur.d.ts +0 -42
- package/dist/verificationRegistry-CabxhfTv.d.ts +0 -122
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { JsonTreeEditor } from './chunk-
|
|
2
|
-
import { transitionPlayback, Accordion } from './chunk-
|
|
3
|
-
import { EmptyState } from './chunk-
|
|
4
|
-
import { useContainerWidth, roundedEdgePath } from './chunk-
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import { useTranslate, useMediaQuery, Box, Typography, Card, VStack, HStack, Badge, Button } from './chunk-MBQAMMSE.js';
|
|
1
|
+
import { JsonTreeEditor } from './chunk-ILQXJ2AR.js';
|
|
2
|
+
import { transitionPlayback, Accordion } from './chunk-REXYVBUO.js';
|
|
3
|
+
import { EmptyState } from './chunk-AGXD77SL.js';
|
|
4
|
+
import { useContainerWidth, roundedEdgePath } from './chunk-M74BCDBQ.js';
|
|
5
|
+
import { parseTraitLevel } from './chunk-PCR37T3U.js';
|
|
6
|
+
import { AvlExplain, AvlEffectChip } from './chunk-PRLHKBXG.js';
|
|
7
|
+
import { AVL_INK, AVL_FONT, effectZoneOf, avlTint, AvlEffect, OPERATOR_CATEGORY_COLORS, avlBlend } from './chunk-FAKU5F62.js';
|
|
8
|
+
import { useTranslate, useMediaQuery, Box, Typography, Card, VStack, HStack, Badge, Button } from './chunk-4YXBKHHM.js';
|
|
10
9
|
import { useRef, useMemo, useState } from 'react';
|
|
11
|
-
import { formatSExpr, isBinding } from '@almadar/core';
|
|
10
|
+
import { formatSExpr, JsonValueSchema, isJsonObject, isBinding } from '@almadar/core';
|
|
12
11
|
import { operatorVisualForm, getStdOperatorMeta } from '@almadar/std/registry';
|
|
13
12
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
14
13
|
|
|
@@ -587,7 +586,6 @@ var AvlCircuit = ({ expr, trace, cursor, title, showCode = true, className }) =>
|
|
|
587
586
|
] });
|
|
588
587
|
};
|
|
589
588
|
AvlCircuit.displayName = "AvlCircuit";
|
|
590
|
-
var isConfigObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
591
589
|
var EffectHeader = ({ type, failed, failedLabel, note }) => /* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "center", children: [
|
|
592
590
|
/* @__PURE__ */ jsx(AvlEffectChip, { effectType: type, size: 18, note }),
|
|
593
591
|
/* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: type }),
|
|
@@ -640,7 +638,10 @@ var TransitionDetailBody = ({ orbital, trait, transition, annotations, playback,
|
|
|
640
638
|
stepEvent ? /* @__PURE__ */ jsxs(VStack, { gap: "xs", children: [
|
|
641
639
|
/* @__PURE__ */ jsx(Typography, { variant: "overline", color: "muted", children: t("avl.play.payload") }),
|
|
642
640
|
/* @__PURE__ */ jsxs(HStack, { gap: "sm", align: "start", children: [
|
|
643
|
-
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx(JsonTreeEditor, { value: payload, onChange: (next) =>
|
|
641
|
+
/* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: /* @__PURE__ */ jsx(JsonTreeEditor, { value: payload, onChange: (next) => {
|
|
642
|
+
const json = JsonValueSchema.safeParse(next);
|
|
643
|
+
setPayload(json.success && isJsonObject(json.data) ? json.data : {});
|
|
644
|
+
} }) }),
|
|
644
645
|
/* @__PURE__ */ jsx(Button, { variant: "primary", size: "sm", action: stepEvent, actionPayload: request, leftIcon: "skip-forward", children: t("avl.play.step") })
|
|
645
646
|
] })
|
|
646
647
|
] }) : null,
|
|
@@ -1,46 +1,11 @@
|
|
|
1
|
-
import { routing_exports } from './chunk-DYEKAA4L.js';
|
|
2
1
|
import { renderUiEntriesOf } from '@almadar/core/patterns';
|
|
3
|
-
import {
|
|
2
|
+
import { kernelEvaluator } from '@almadar/core';
|
|
4
3
|
|
|
5
|
-
function instanceOf(orbital, orbitalId, ref) {
|
|
6
|
-
const at = orbitalId === void 0 ? { orbital } : { orbital, orbitalId };
|
|
7
|
-
if (isInlineTrait(ref)) return { ...at, name: ref.name, trait: ref };
|
|
8
|
-
if (typeof ref === "object" && ref._resolved) return { ...at, name: ref.name ?? ref._resolved.name, trait: ref._resolved };
|
|
9
|
-
return null;
|
|
10
|
-
}
|
|
11
4
|
var wiresBySchema = /* @__PURE__ */ new WeakMap();
|
|
12
5
|
function traitEventWires(schema) {
|
|
13
6
|
const cached = wiresBySchema.get(schema);
|
|
14
7
|
if (cached) return cached;
|
|
15
|
-
const
|
|
16
|
-
(o) => (o.traits ?? []).map((ref) => instanceOf(o.name, o.id, ref)).filter((i) => i !== null)
|
|
17
|
-
);
|
|
18
|
-
const listensByEvent = /* @__PURE__ */ new Map();
|
|
19
|
-
for (const listener of instances) {
|
|
20
|
-
for (const listen of listener.trait.listens ?? []) {
|
|
21
|
-
const { bareEvent, matcher } = (0, routing_exports.parseListenSource)(listen, listener.orbital);
|
|
22
|
-
const bucket = listensByEvent.get(bareEvent);
|
|
23
|
-
if (bucket) bucket.push({ listener, matcher });
|
|
24
|
-
else listensByEvent.set(bareEvent, [{ listener, matcher }]);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
const wires = [];
|
|
28
|
-
for (const emitter of instances) {
|
|
29
|
-
const source = { orbital: emitter.orbital, trait: emitter.name, ...emitter.orbitalId ? { orbitalId: emitter.orbitalId } : {}, ...emitter.trait.id ? { traitId: emitter.trait.id } : {} };
|
|
30
|
-
for (const emit of emitter.trait.emits ?? []) {
|
|
31
|
-
for (const { listener, matcher } of listensByEvent.get(emit.event) ?? []) {
|
|
32
|
-
if (listener.orbital === emitter.orbital && listener.name === emitter.name) continue;
|
|
33
|
-
if (!matcher(source)) continue;
|
|
34
|
-
wires.push({
|
|
35
|
-
emitterOrbital: emitter.orbital,
|
|
36
|
-
emitterTrait: emitter.name,
|
|
37
|
-
listenerOrbital: listener.orbital,
|
|
38
|
-
listenerTrait: listener.name,
|
|
39
|
-
event: emit.event
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
8
|
+
const wires = kernelEvaluator().eventWires(schema);
|
|
44
9
|
wiresBySchema.set(schema, wires);
|
|
45
10
|
return wires;
|
|
46
11
|
}
|
|
@@ -269,6 +234,18 @@ function traitLevelFromDescription(description) {
|
|
|
269
234
|
description.events.listens
|
|
270
235
|
);
|
|
271
236
|
}
|
|
237
|
+
function traitLevelFromMounted(trait) {
|
|
238
|
+
return {
|
|
239
|
+
name: trait.trait,
|
|
240
|
+
linkedEntity: trait.linkedEntity ?? "",
|
|
241
|
+
states: trait.states.map((s) => ({ name: s.name, isInitial: s.isInitial, isTerminal: s.isTerminal })),
|
|
242
|
+
transitions: trait.transitions.flatMap(
|
|
243
|
+
(t) => t.from.map((from) => ({ from, to: t.to, event: t.event, guard: null, effects: [], index: t.index }))
|
|
244
|
+
),
|
|
245
|
+
emittedEvents: trait.emits,
|
|
246
|
+
listenedEvents: trait.listens.map((l) => l.event)
|
|
247
|
+
};
|
|
248
|
+
}
|
|
272
249
|
function traitLevelOf(name, linkedEntity, sm, emittedEvents, listenedEvents) {
|
|
273
250
|
const states = getStates(sm).map((s) => ({
|
|
274
251
|
name: s.name ?? "",
|
|
@@ -316,4 +293,4 @@ function parseTransitionLevel(schema, orbitalName, traitName, transitionIndex) {
|
|
|
316
293
|
};
|
|
317
294
|
}
|
|
318
295
|
|
|
319
|
-
export { parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, programTraits, traitEventWires, traitLevelFromDescription, traitLevelFromTrait, traitTransitionRenderUi };
|
|
296
|
+
export { parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, programTraits, traitEventWires, traitLevelFromDescription, traitLevelFromMounted, traitLevelFromTrait, traitTransitionRenderUi };
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { AvlEffect } from './chunk-
|
|
2
|
-
import {
|
|
3
|
-
import { useThemeScope, Box, useTapReveal, Typography, cn, domPassthrough, usePresence, useDialogBehavior, SurfaceBoundary, VStack, useTranslate } from './chunk-MBQAMMSE.js';
|
|
1
|
+
import { effectCategoryOf, AvlEffect } from './chunk-FAKU5F62.js';
|
|
2
|
+
import { useThemeScope, Box, useTapReveal, Typography, cn, domPassthrough, usePresence, useDialogBehavior, SurfaceBoundary, VStack, useTranslate } from './chunk-4YXBKHHM.js';
|
|
4
3
|
import { createPortal } from 'react-dom';
|
|
5
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
6
5
|
import React, { useId, useState, useRef, useLayoutEffect, useEffect } from 'react';
|
|
@@ -420,6 +419,9 @@ var Popover = ({
|
|
|
420
419
|
style: {
|
|
421
420
|
left: placement.left,
|
|
422
421
|
top: placement.top,
|
|
422
|
+
// Sized by its content, not by the room right of `left`: a placement-dependent width re-places it forever.
|
|
423
|
+
width: "max-content",
|
|
424
|
+
maxWidth: `calc(100vw - ${2 * VIEWPORT_EDGE_PADDING}px)`,
|
|
423
425
|
...popoverWidth === 0 ? { visibility: "hidden" } : void 0
|
|
424
426
|
},
|
|
425
427
|
...domPassthrough(rest),
|
|
@@ -1,7 +1,30 @@
|
|
|
1
|
-
import { useEventBus, useTranslate } from './chunk-
|
|
2
|
-
import { useRef, useEffect, useCallback, useState
|
|
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';
|
|
3
4
|
import { resolvePageMeta } from '@almadar/core';
|
|
4
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
|
+
}
|
|
5
28
|
function mergeCaptureTables(tables) {
|
|
6
29
|
const merged = {};
|
|
7
30
|
for (const table of tables) {
|
|
@@ -32,38 +55,18 @@ function keyChord(event) {
|
|
|
32
55
|
function useKeyboardRouter(options) {
|
|
33
56
|
const {
|
|
34
57
|
captureTable,
|
|
35
|
-
editorFocusEvent = "EDITOR_FOCUS",
|
|
36
|
-
editorBlurEvent = "EDITOR_BLUR",
|
|
37
58
|
keyEvent = "KEY",
|
|
38
59
|
enabled = true
|
|
39
60
|
} = options;
|
|
40
61
|
const eventBus = useEventBus();
|
|
41
62
|
const captureTableRef = useRef(captureTable);
|
|
42
63
|
captureTableRef.current = captureTable;
|
|
43
|
-
const
|
|
44
|
-
useEffect(() => {
|
|
45
|
-
const unsubFocus = eventBus.on(`UI:${editorFocusEvent}`, (event) => {
|
|
46
|
-
const editorId = event.payload?.editorId;
|
|
47
|
-
if (typeof editorId === "string") {
|
|
48
|
-
focusedEditorIdRef.current = editorId;
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
const unsubBlur = eventBus.on(`UI:${editorBlurEvent}`, (event) => {
|
|
52
|
-
const editorId = event.payload?.editorId;
|
|
53
|
-
if (typeof editorId === "string" && focusedEditorIdRef.current === editorId) {
|
|
54
|
-
focusedEditorIdRef.current = null;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
return () => {
|
|
58
|
-
unsubFocus();
|
|
59
|
-
unsubBlur();
|
|
60
|
-
};
|
|
61
|
-
}, [eventBus, editorFocusEvent, editorBlurEvent]);
|
|
64
|
+
const editorFocus = useEditorFocus();
|
|
62
65
|
useEffect(() => {
|
|
63
66
|
if (!enabled) return;
|
|
64
67
|
const handleKeyDown = (event) => {
|
|
65
68
|
if (event.isComposing) return;
|
|
66
|
-
const target =
|
|
69
|
+
const target = editorFocus.focused() ?? "shell";
|
|
67
70
|
const entry = captureTableRef.current[target];
|
|
68
71
|
const captured = entry !== void 0 && (entry.keys.has(event.key) || entry.keys.has(keyChord(event)));
|
|
69
72
|
if (captured) {
|
|
@@ -84,7 +87,7 @@ function useKeyboardRouter(options) {
|
|
|
84
87
|
return () => {
|
|
85
88
|
window.removeEventListener("keydown", handleKeyDown, { capture: true });
|
|
86
89
|
};
|
|
87
|
-
}, [eventBus, enabled, keyEvent]);
|
|
90
|
+
}, [eventBus, editorFocus, enabled, keyEvent]);
|
|
88
91
|
}
|
|
89
92
|
function useSwipeGesture(callbacks, options = {}) {
|
|
90
93
|
const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
|
|
@@ -372,66 +375,6 @@ function parseQueryBinding(binding) {
|
|
|
372
375
|
field: parts.length > 1 ? parts.slice(1).join(".") : void 0
|
|
373
376
|
};
|
|
374
377
|
}
|
|
375
|
-
function usePullToRefresh(onRefresh, options = {}) {
|
|
376
|
-
const { threshold = 60, maxPull = 120 } = options;
|
|
377
|
-
const [pullDistance, setPullDistance] = useState(0);
|
|
378
|
-
const [isPulling, setIsPulling] = useState(false);
|
|
379
|
-
const [isRefreshing, setIsRefreshing] = useState(false);
|
|
380
|
-
const startY = useRef(0);
|
|
381
|
-
const scrollTopRef = useRef(0);
|
|
382
|
-
const onTouchStart = useCallback((e) => {
|
|
383
|
-
const container = e.currentTarget;
|
|
384
|
-
scrollTopRef.current = container.scrollTop;
|
|
385
|
-
if (scrollTopRef.current <= 0) {
|
|
386
|
-
startY.current = e.touches[0].clientY;
|
|
387
|
-
setIsPulling(true);
|
|
388
|
-
}
|
|
389
|
-
}, []);
|
|
390
|
-
const onTouchMove = useCallback((e) => {
|
|
391
|
-
if (!isPulling || isRefreshing) return;
|
|
392
|
-
const container = e.currentTarget;
|
|
393
|
-
if (container.scrollTop > 0) {
|
|
394
|
-
setPullDistance(0);
|
|
395
|
-
return;
|
|
396
|
-
}
|
|
397
|
-
const dy = e.touches[0].clientY - startY.current;
|
|
398
|
-
if (dy > 0) {
|
|
399
|
-
const distance = Math.min(dy * 0.5, maxPull);
|
|
400
|
-
setPullDistance(distance);
|
|
401
|
-
}
|
|
402
|
-
}, [isPulling, isRefreshing, maxPull]);
|
|
403
|
-
const onTouchEnd = useCallback(() => {
|
|
404
|
-
if (!isPulling) return;
|
|
405
|
-
setIsPulling(false);
|
|
406
|
-
if (pullDistance >= threshold && !isRefreshing) {
|
|
407
|
-
setIsRefreshing(true);
|
|
408
|
-
setPullDistance(threshold);
|
|
409
|
-
onRefresh();
|
|
410
|
-
} else {
|
|
411
|
-
setPullDistance(0);
|
|
412
|
-
}
|
|
413
|
-
}, [isPulling, pullDistance, threshold, isRefreshing, onRefresh]);
|
|
414
|
-
const endRefresh = useCallback(() => {
|
|
415
|
-
setIsRefreshing(false);
|
|
416
|
-
setPullDistance(0);
|
|
417
|
-
}, []);
|
|
418
|
-
const containerProps = {
|
|
419
|
-
onTouchStart,
|
|
420
|
-
onTouchMove,
|
|
421
|
-
onTouchEnd,
|
|
422
|
-
style: {
|
|
423
|
-
transform: pullDistance > 0 ? `translateY(${pullDistance}px)` : void 0,
|
|
424
|
-
transition: isPulling ? "none" : "transform 300ms ease-out"
|
|
425
|
-
}
|
|
426
|
-
};
|
|
427
|
-
return {
|
|
428
|
-
pullDistance,
|
|
429
|
-
isPulling,
|
|
430
|
-
isRefreshing,
|
|
431
|
-
containerProps,
|
|
432
|
-
endRefresh
|
|
433
|
-
};
|
|
434
|
-
}
|
|
435
378
|
|
|
436
379
|
// src/lib/bus-claim.ts
|
|
437
380
|
var claims = /* @__PURE__ */ new WeakMap();
|
|
@@ -447,6 +390,10 @@ function claimDelivery(source, trait, event) {
|
|
|
447
390
|
seen.add(key);
|
|
448
391
|
return true;
|
|
449
392
|
}
|
|
393
|
+
var DISPATCH_CLAIM = "$dispatch";
|
|
394
|
+
function claimDispatch(source, event) {
|
|
395
|
+
return claimDelivery(source, DISPATCH_CLAIM, event);
|
|
396
|
+
}
|
|
450
397
|
var OWNED = "data-orb-head";
|
|
451
398
|
var shellTitle;
|
|
452
399
|
function ownedTag(tag, attrs) {
|
|
@@ -501,6 +448,66 @@ function usePageHead(input) {
|
|
|
501
448
|
};
|
|
502
449
|
}, [active, title, description, isPublic, canonical, siteName, locale, hreflangKey]);
|
|
503
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
|
+
}
|
|
504
511
|
function useDragReorder(initialItems, onReorder) {
|
|
505
512
|
const [items, setItems] = useState(initialItems);
|
|
506
513
|
const [dragIndex, setDragIndex] = useState(-1);
|
|
@@ -570,4 +577,4 @@ function useDragReorder(initialItems, onReorder) {
|
|
|
570
577
|
};
|
|
571
578
|
}
|
|
572
579
|
|
|
573
|
-
export { claimDelivery, keyChord, mergeCaptureTables, parseQueryBinding, useAuthContext, useCanvasGestures, useDragReorder, useKeyboardRouter, useLongPress, usePageHead, usePullToRefresh, useQuerySingleton, useSwipeGesture };
|
|
580
|
+
export { EditorFocusProvider, claimDelivery, claimDispatch, keyChord, mergeCaptureTables, parseQueryBinding, useAuthContext, useCanvasGestures, useDragReorder, useEditorFocus, useKeyboardRouter, useLongPress, usePageHead, usePullToRefresh, useQuerySingleton, useSwipeGesture };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { traitLevelFromDescription } from './chunk-
|
|
2
|
-
import { useContentSurface, useEventBus, Typography, Icon, cn, domPassthrough } from './chunk-
|
|
1
|
+
import { traitLevelFromDescription } from './chunk-PCR37T3U.js';
|
|
2
|
+
import { useContentSurface, useEventBus, Typography, Icon, cn, domPassthrough } from './chunk-4YXBKHHM.js';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { claimDelivery } from './chunk-
|
|
2
|
-
import { useEventBus, getTraitPresence, beginPending, endPending } from './chunk-
|
|
1
|
+
import { claimDelivery } from './chunk-PRXQGGCO.js';
|
|
2
|
+
import { useEventBus, getTraitPresence, beginPending, endPending } from './chunk-4YXBKHHM.js';
|
|
3
3
|
import { createContext, useState, useCallback, useEffect, useMemo, useRef, useContext, useSyncExternalStore } from 'react';
|
|
4
4
|
import { createLogger } from '@almadar/logger';
|
|
5
5
|
import { mergeEntityFrame } from '@almadar/core';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AvlTransitionDetail } from './chunk-
|
|
2
|
-
import { Box, domPassthrough } from './chunk-
|
|
1
|
+
import { AvlTransitionDetail } from './chunk-OWNG4JZI.js';
|
|
2
|
+
import { Box, domPassthrough } from './chunk-4YXBKHHM.js';
|
|
3
3
|
import { jsx } from 'react/jsx-runtime';
|
|
4
4
|
|
|
5
5
|
var AvlTransitionExplainer = ({ orbitalName, traitName, transition, annotations, className, ...rest }) => {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import { useEventBus } from './chunk-
|
|
1
|
+
import { useEventBus } from './chunk-4YXBKHHM.js';
|
|
2
2
|
import { useState, useCallback, useMemo } from 'react';
|
|
3
3
|
|
|
4
4
|
var ALMADAR_DND_MIME = "application/x-almadar-dnd";
|
|
5
5
|
function useDraggable({ payload, disabled = false }) {
|
|
6
6
|
const [isDragging, setIsDragging] = useState(false);
|
|
7
|
-
const eventBus = useEventBus();
|
|
8
7
|
const handleDragStart = useCallback(
|
|
9
8
|
(e) => {
|
|
10
9
|
if (disabled) {
|
|
@@ -14,16 +13,14 @@ function useDraggable({ payload, disabled = false }) {
|
|
|
14
13
|
e.dataTransfer.setData(ALMADAR_DND_MIME, JSON.stringify(payload));
|
|
15
14
|
e.dataTransfer.effectAllowed = "copy";
|
|
16
15
|
setIsDragging(true);
|
|
17
|
-
eventBus.emit("UI:DRAG_START", { kind: payload.kind, data: payload.data });
|
|
18
16
|
},
|
|
19
|
-
[disabled, payload
|
|
17
|
+
[disabled, payload]
|
|
20
18
|
);
|
|
21
19
|
const handleDragEnd = useCallback(
|
|
22
20
|
(e) => {
|
|
23
21
|
setIsDragging(false);
|
|
24
|
-
eventBus.emit("UI:DRAG_END", { kind: payload.kind, data: payload.data });
|
|
25
22
|
},
|
|
26
|
-
[
|
|
23
|
+
[]
|
|
27
24
|
);
|
|
28
25
|
const dragProps = useMemo(
|
|
29
26
|
() => ({
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { AvlState, AvlEntity, AvlFieldType, AvlPage } from './chunk-
|
|
2
|
-
import { AvlExplain, useEffectLines } from './chunk-
|
|
3
|
-
import { AvlEffect } from './chunk-
|
|
4
|
-
import {
|
|
5
|
-
import { useTranslate, Box, cn, domPassthrough } from './chunk-MBQAMMSE.js';
|
|
1
|
+
import { AvlState, AvlEntity, AvlFieldType, AvlPage } from './chunk-7N6ZPHQ5.js';
|
|
2
|
+
import { AvlExplain, useEffectLines } from './chunk-PRLHKBXG.js';
|
|
3
|
+
import { getStateRole, AvlEffect, CONNECTION_COLORS } from './chunk-FAKU5F62.js';
|
|
4
|
+
import { useTranslate, Box, cn, domPassthrough } from './chunk-4YXBKHHM.js';
|
|
6
5
|
import { useNodeId, ReactFlowProvider, Handle, Position } from '@xyflow/react';
|
|
7
6
|
import React from 'react';
|
|
8
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { AvlStateMachine } from './chunk-
|
|
2
|
-
import { EmptyState } from './chunk-
|
|
3
|
-
import { useTranslate, Box, domPassthrough } from './chunk-
|
|
1
|
+
import { AvlStateMachine } from './chunk-4YJ53G7S.js';
|
|
2
|
+
import { EmptyState } from './chunk-AGXD77SL.js';
|
|
3
|
+
import { useTranslate, Box, domPassthrough } from './chunk-4YXBKHHM.js';
|
|
4
4
|
import { jsx } from 'react/jsx-runtime';
|
|
5
5
|
|
|
6
6
|
var BehaviorView = ({ data, ...rest }) => {
|