@almadar/ui 6.53.0 → 6.54.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/Typography-CFI7JUVE.js +5 -0
- package/dist/{UISlotRenderer-JT34I3O7.js → UISlotRenderer-QUEG6WFM.js} +5 -5
- package/dist/avl/index.cjs +578 -262
- package/dist/avl/index.js +28 -19
- package/dist/{avl-3d-context-MAt_NuU9.d.ts → avl-3d-context-BpBKZIbc.d.ts} +1 -0
- package/dist/{chunk-DQTV6QVS.js → chunk-4HC5HRHB.js} +53 -2
- package/dist/{chunk-GMDMOYXD.js → chunk-4UP6BZ4R.js} +1 -1
- package/dist/{chunk-CBIJP5PL.js → chunk-FJDS4SVD.js} +3 -3
- package/dist/{chunk-4OZDHCZV.js → chunk-MCKFWPT2.js} +1 -1
- package/dist/{chunk-UGHAADU5.js → chunk-N2V4LHFQ.js} +4 -1
- package/dist/{chunk-3EF5SDIJ.js → chunk-U2FGMHQP.js} +306 -174
- package/dist/{chunk-IKULQIDX.js → chunk-U3CGKPOK.js} +252 -91
- package/dist/{chunk-7LM6I3NA.js → chunk-Z5IYJU44.js} +1 -0
- package/dist/{chunk-WPNM2KC6.js → chunk-Z7JWXIRE.js} +2 -2
- package/dist/components/index.cjs +312 -170
- package/dist/components/index.d.ts +5 -1
- package/dist/components/index.js +11 -12
- package/dist/context/index.cjs +2 -0
- package/dist/context/index.js +2 -0
- package/dist/hooks/index.cjs +9 -1
- package/dist/hooks/index.d.ts +10 -1
- package/dist/hooks/index.js +3 -4
- package/dist/lib/drawable/three/index.cjs +5 -1
- package/dist/lib/drawable/three/index.d.ts +2 -2
- package/dist/lib/drawable/three/index.js +6 -6
- package/dist/lib/index.cjs +4 -1
- package/dist/lib/index.js +2 -2
- package/dist/locales/index.cjs +12 -3
- package/dist/locales/index.js +9 -3
- package/dist/providers/index.cjs +307 -170
- package/dist/providers/index.d.ts +1 -1
- package/dist/providers/index.js +5 -5
- package/dist/runtime/index.cjs +3850 -3523
- package/dist/runtime/index.d.ts +22 -4
- package/dist/runtime/index.js +13 -10
- package/dist/ssr/index.cjs +5 -2
- package/dist/ssr/index.js +5 -2
- package/locales/ar.json +4 -1
- package/locales/en.json +4 -1
- package/locales/sl.json +4 -1
- package/package.json +7 -6
- package/scripts/audit-tailwind-safelist.ts +21 -1
- package/tailwind-preset.cjs +15 -6
- package/themes/_fonts.css +6 -4
- package/themes/_presets.css +2 -0
- package/themes/almadar-heritage.css +373 -0
- package/themes/orb.css +373 -0
- package/dist/Typography-JGSDH4JP.js +0 -5
- package/dist/chunk-GODZKHAL.js +0 -51
package/dist/avl/index.js
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import { BrowserPlayground, collectEmbeddedTraits } from '../chunk-
|
|
2
|
-
import { zoomReducer, initialZoomState, getBreadcrumbs } from '../chunk-
|
|
3
|
-
import { JsonTreeEditor } from '../chunk-
|
|
4
|
-
import { useTranslate as useTranslate$1 } from '../chunk-
|
|
5
|
-
import '../chunk-DQTV6QVS.js';
|
|
1
|
+
import { BrowserPlayground, collectEmbeddedTraits } from '../chunk-U3CGKPOK.js';
|
|
2
|
+
import { zoomReducer, initialZoomState, getBreadcrumbs } from '../chunk-Z7JWXIRE.js';
|
|
3
|
+
import { JsonTreeEditor } from '../chunk-FJDS4SVD.js';
|
|
4
|
+
import { useTranslate as useTranslate$1 } from '../chunk-4HC5HRHB.js';
|
|
6
5
|
import '../chunk-VHTJRS2N.js';
|
|
7
6
|
import { spacingTokenOf, positionOf, withPosition, snapToSpacingStep, defaultSpacingStepPx, spacingOf, withSizing, withSpacing, layoutOf, withLayout, sizingOf, DESIGN_COLOR_TOKENS, DESIGN_RADIUS_TOKENS, DESIGN_SPACING_SCALE, sizeLimitOf, withSizeLimit, isArbitraryClass, tokenOfDesignClass } from '../chunk-ERXIHZW3.js';
|
|
8
|
-
import { Popover, Button, Icon, Select, Badge, IconButton, AvlStateMachine, Input, AvlFieldType, AvlEffect, AvlState, AvlPage, AvlEntity, useContainerWidth, useAlmadarDndSensors, almadarDndCollisionDetection, TagInput, Checkbox, Switch, CodeBlock, FileTree, Card, Accordion, RangeSlider, computeTraitLayout, edgePath, FormField, Radio, useCompactLayout, ButtonGroup, roundedEdgePath } from '../chunk-
|
|
9
|
-
export { AvlEffect, AvlEntity, AvlFieldType, AvlPage, AvlState, AvlStateMachine, BehaviorView, FIELD_TYPE_SHAPES, MiniStateMachine, ModuleCard, computeTraitLayout, edgePath } from '../chunk-
|
|
10
|
-
import { avlSeries, STATE_COLORS, Box, HStack, VStack, avlTint, CONNECTION_COLORS, parseTraitLevel, OPERATOR_CATEGORY_COLORS, AVL_INK, AVL_FONT, parseApplicationLevel, parseOrbitalLevel, getStateRole, effectCategoryOf, EFFECT_CATEGORY_COLORS, pressableProps, traitTransitionRenderUi, traitEventWires, effectZoneOf, avlBlend } from '../chunk-
|
|
11
|
-
export { CONNECTION_COLORS, EFFECT_CATEGORY_COLORS, OPERATOR_CATEGORY_COLORS, STATE_COLORS, effectCategoryOf, getStateRole, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, traitLevelFromTrait } from '../chunk-
|
|
12
|
-
import { Typography, INLINE_TEXT_ATTR } from '../chunk-
|
|
7
|
+
import { Popover, Button, Icon, Select, Badge, IconButton, AvlStateMachine, Input, AvlFieldType, AvlEffect, AvlState, AvlPage, AvlEntity, useContainerWidth, useAlmadarDndSensors, almadarDndCollisionDetection, TagInput, Checkbox, Switch, CodeBlock, FileTree, Card, Accordion, RangeSlider, computeTraitLayout, edgePath, FormField, Radio, useCompactLayout, ButtonGroup, roundedEdgePath } from '../chunk-U2FGMHQP.js';
|
|
8
|
+
export { AvlEffect, AvlEntity, AvlFieldType, AvlPage, AvlState, AvlStateMachine, BehaviorView, FIELD_TYPE_SHAPES, MiniStateMachine, ModuleCard, computeTraitLayout, edgePath } from '../chunk-U2FGMHQP.js';
|
|
9
|
+
import { avlSeries, STATE_COLORS, Box, HStack, VStack, avlTint, CONNECTION_COLORS, parseTraitLevel, OPERATOR_CATEGORY_COLORS, AVL_INK, AVL_FONT, parseApplicationLevel, parseOrbitalLevel, getStateRole, effectCategoryOf, EFFECT_CATEGORY_COLORS, pressableProps, traitTransitionRenderUi, traitEventWires, effectZoneOf, avlBlend } from '../chunk-Z5IYJU44.js';
|
|
10
|
+
export { CONNECTION_COLORS, EFFECT_CATEGORY_COLORS, OPERATOR_CATEGORY_COLORS, STATE_COLORS, effectCategoryOf, getStateRole, parseApplicationLevel, parseOrbitalLevel, parseTraitLevel, parseTransitionLevel, traitLevelFromTrait } from '../chunk-Z5IYJU44.js';
|
|
11
|
+
import { Typography, INLINE_TEXT_ATTR } from '../chunk-4UP6BZ4R.js';
|
|
13
12
|
import { usePrefersReducedMotion, useMediaQuery } from '../chunk-JRW33U35.js';
|
|
14
13
|
import '../chunk-XJTHMW4G.js';
|
|
15
14
|
import { useEventBus } from '../chunk-6EV3OEBQ.js';
|
|
16
15
|
import { profilerOnRender, perfStart, perfEnd } from '../chunk-KQXXO42S.js';
|
|
17
16
|
import { isEditableTarget } from '../chunk-O7OLVVBR.js';
|
|
18
17
|
import { domPassthrough, cn } from '../chunk-64WACXM7.js';
|
|
19
|
-
import '../chunk-
|
|
20
|
-
import '../chunk-
|
|
18
|
+
import '../chunk-MCKFWPT2.js';
|
|
19
|
+
import '../chunk-N2V4LHFQ.js';
|
|
21
20
|
import '../chunk-PQKU62LK.js';
|
|
22
21
|
import '../chunk-PEST66PN.js';
|
|
23
22
|
import '../chunk-QPXIAUJD.js';
|
|
@@ -3476,13 +3475,18 @@ function stateOptionsFor(schema, orbitalName, entityName, transitions, view, moc
|
|
|
3476
3475
|
const key = `${s.entry.traitName}|${s.entry.transition.to}`;
|
|
3477
3476
|
stateUses.set(key, (stateUses.get(key) ?? 0) + 1);
|
|
3478
3477
|
}
|
|
3478
|
+
const armsSeen = /* @__PURE__ */ new Map();
|
|
3479
3479
|
return screens.map(({ entry, enteredBy }) => {
|
|
3480
3480
|
const t = entry.transition;
|
|
3481
3481
|
const from = String(t.from);
|
|
3482
3482
|
const state = view === "screens" ? (stateUses.get(`${entry.traitName}|${t.to}`) ?? 0) > 1 ? `${t.to} \xB7 ${t.event}` : t.to : `${t.event}: ${from} \u2192 ${t.to}`;
|
|
3483
|
-
const
|
|
3483
|
+
const baseId = `${entry.traitName}:${t.event}:${from}:${t.to}`;
|
|
3484
|
+
const arm = (armsSeen.get(baseId) ?? 0) + 1;
|
|
3485
|
+
armsSeen.set(baseId, arm);
|
|
3486
|
+
const named = manyTraits ? `${entry.traitName} \xB7 ${state}` : state;
|
|
3487
|
+
const label = arm > 1 ? `${named} (guard ${arm})` : named;
|
|
3484
3488
|
return {
|
|
3485
|
-
id: `${
|
|
3489
|
+
id: arm > 1 ? `${baseId}#${arm}` : baseId,
|
|
3486
3490
|
label,
|
|
3487
3491
|
hint: view === "screens" ? enteredBy.join(" \xB7 ") : entry.traitName,
|
|
3488
3492
|
data: {
|
|
@@ -4097,11 +4101,11 @@ function marqueeHits(marquee, boxes) {
|
|
|
4097
4101
|
);
|
|
4098
4102
|
}
|
|
4099
4103
|
function axisPositionFrom(axis, constraint, offset) {
|
|
4100
|
-
const start =
|
|
4101
|
-
const end =
|
|
4104
|
+
const start = axis === "x" ? offset.left : offset.top;
|
|
4105
|
+
const end = axis === "x" ? offset.right : offset.bottom;
|
|
4102
4106
|
if (constraint === "center") return { constraint, start: (start - end) / 2, end: 0 };
|
|
4103
4107
|
if (constraint !== "scale") return { constraint, start, end };
|
|
4104
|
-
const size2 =
|
|
4108
|
+
const size2 = axis === "x" ? offset.parentWidth : offset.parentHeight;
|
|
4105
4109
|
return size2 > 0 ? { constraint, start: start / size2 * 100, end: end / size2 * 100 } : { constraint, start: 0, end: 0 };
|
|
4106
4110
|
}
|
|
4107
4111
|
var edgesX = (r) => [r.left, r.left + r.width / 2, r.left + r.width];
|
|
@@ -7713,7 +7717,11 @@ function AppearanceSection({ patternConfig, themeManifest, onPropChange, onToken
|
|
|
7713
7717
|
{
|
|
7714
7718
|
checked: position.absolute,
|
|
7715
7719
|
label: t("orbInspector.absolute"),
|
|
7716
|
-
|
|
7720
|
+
disabled: !offsetInParent && !position.absolute,
|
|
7721
|
+
onChange: (on) => {
|
|
7722
|
+
if (!on) write({ ...position, absolute: false });
|
|
7723
|
+
else if (offsetInParent) write({ absolute: true, x: axisPositionFrom("x", "start", offsetInParent), y: axisPositionFrom("y", "start", offsetInParent) });
|
|
7724
|
+
}
|
|
7717
7725
|
}
|
|
7718
7726
|
),
|
|
7719
7727
|
position.absolute && ["x", "y"].map((axis) => /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", "data-testid": `inspector-constraint-${axis}`, children: [
|
|
@@ -7724,9 +7732,10 @@ function AppearanceSection({ patternConfig, themeManifest, onPropChange, onToken
|
|
|
7724
7732
|
value: position[axis].constraint,
|
|
7725
7733
|
"aria-label": t(axis === "x" ? "orbInspector.constraintHorizontal" : "orbInspector.constraintVertical"),
|
|
7726
7734
|
options: CONSTRAINTS.map((c) => ({ value: c, label: t(CONSTRAINT_LABELS[axis][c]) })),
|
|
7735
|
+
disabled: !offsetInParent,
|
|
7727
7736
|
onValueChange: (v) => {
|
|
7728
7737
|
const constraint = CONSTRAINTS.find((c) => c === v);
|
|
7729
|
-
if (constraint) write({ ...position, [axis]: axisPositionFrom(axis, constraint, offsetInParent) });
|
|
7738
|
+
if (constraint && offsetInParent) write({ ...position, [axis]: axisPositionFrom(axis, constraint, offsetInParent) });
|
|
7730
7739
|
},
|
|
7731
7740
|
className: "flex-1 text-xs h-6"
|
|
7732
7741
|
}
|
|
@@ -59,6 +59,7 @@ declare const AVL_3D_COLORS: {
|
|
|
59
59
|
readonly "op:std-json": string;
|
|
60
60
|
readonly "op:std-time": string;
|
|
61
61
|
readonly "op:std-format": string;
|
|
62
|
+
readonly "op:std-i18n": string;
|
|
62
63
|
readonly "op:std-async": string;
|
|
63
64
|
readonly "op:std-nn": string;
|
|
64
65
|
readonly "op:std-tensor": string;
|
|
@@ -1,7 +1,58 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DEFAULT_CURRENCY } from './chunk-MCKFWPT2.js';
|
|
2
|
+
import { en_default } from './chunk-N2V4LHFQ.js';
|
|
3
|
+
import React, { createContext, useEffect, useContext, useMemo, useRef, useSyncExternalStore } from 'react';
|
|
2
4
|
import { mergeEntityFrame } from '@almadar/core';
|
|
3
5
|
import { createLogger } from '@almadar/logger';
|
|
4
6
|
|
|
7
|
+
var { $meta: _meta, ...coreMessages } = en_default;
|
|
8
|
+
var coreLocale = coreMessages;
|
|
9
|
+
var I18nContext = createContext({
|
|
10
|
+
locale: "en",
|
|
11
|
+
direction: "ltr",
|
|
12
|
+
t: (key, params) => {
|
|
13
|
+
let msg = coreLocale[key] ?? key;
|
|
14
|
+
if (params) {
|
|
15
|
+
for (const [k, v] of Object.entries(params)) {
|
|
16
|
+
msg = msg.split(`{{${k}}}`).join(String(v));
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
return msg;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
I18nContext.displayName = "I18nContext";
|
|
23
|
+
function I18nProvider({ value, children, documentRoot }) {
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
if (!documentRoot) return;
|
|
26
|
+
document.documentElement.lang = value.locale;
|
|
27
|
+
document.documentElement.dir = value.direction;
|
|
28
|
+
}, [documentRoot, value.locale, value.direction]);
|
|
29
|
+
return React.createElement(I18nContext.Provider, { value }, children);
|
|
30
|
+
}
|
|
31
|
+
function useTranslate() {
|
|
32
|
+
return useContext(I18nContext);
|
|
33
|
+
}
|
|
34
|
+
function useRenderI18n() {
|
|
35
|
+
const { locale, messages } = useContext(I18nContext);
|
|
36
|
+
return useMemo(() => messages !== void 0 ? { locale, messages } : void 0, [locale, messages]);
|
|
37
|
+
}
|
|
38
|
+
function useFormatContext() {
|
|
39
|
+
const { t, locale, currency } = useContext(I18nContext);
|
|
40
|
+
return useMemo(
|
|
41
|
+
() => ({ locale, currency: currency ?? DEFAULT_CURRENCY, booleanLabels: { yes: t("common.yes"), no: t("common.no") } }),
|
|
42
|
+
[t, locale, currency]
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function createTranslate(messages) {
|
|
46
|
+
return (key, params) => {
|
|
47
|
+
let msg = messages[key] ?? coreLocale[key] ?? key;
|
|
48
|
+
if (params) {
|
|
49
|
+
for (const [k, v] of Object.entries(params)) {
|
|
50
|
+
msg = msg.split(`{{${k}}}`).join(String(v));
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return msg;
|
|
54
|
+
};
|
|
55
|
+
}
|
|
5
56
|
var log = createLogger("almadar:ui:shared-entity-store");
|
|
6
57
|
var EMPTY_ENTITY_STATE = {};
|
|
7
58
|
function createSharedEntityStore() {
|
|
@@ -79,4 +130,4 @@ function runTickFrame(entityId, orderedWriters, store) {
|
|
|
79
130
|
return scratch;
|
|
80
131
|
}
|
|
81
132
|
|
|
82
|
-
export { SharedEntityStoreContext, createSharedEntityStore, runTickFrame, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext };
|
|
133
|
+
export { I18nProvider, SharedEntityStoreContext, createSharedEntityStore, createTranslate, runTickFrame, useFormatContext, useRenderI18n, useSharedEntitySnapshot, useSharedEntityStore, useSharedEntityStoreContext, useTranslate };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Icon, Button, Switch, Input } from './chunk-
|
|
2
|
-
import { VStack, HStack } from './chunk-
|
|
3
|
-
import { Typography } from './chunk-
|
|
1
|
+
import { Icon, Button, Switch, Input } from './chunk-U2FGMHQP.js';
|
|
2
|
+
import { VStack, HStack } from './chunk-Z5IYJU44.js';
|
|
3
|
+
import { Typography } from './chunk-4UP6BZ4R.js';
|
|
4
4
|
import { cn } from './chunk-64WACXM7.js';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { useTranslate } from '@almadar/ui/hooks';
|
|
@@ -59,6 +59,7 @@ var en_default = {
|
|
|
59
59
|
"status.draft": "Draft",
|
|
60
60
|
"status.archived": "Archived",
|
|
61
61
|
"error.generic": "Something went wrong",
|
|
62
|
+
"error.traitMountFailed": "{{trait}} failed to start",
|
|
62
63
|
"error.retry": "Try again",
|
|
63
64
|
"error.notFound": "Not found",
|
|
64
65
|
"error.loadFailed": "Failed to load: {{message}}",
|
|
@@ -1227,7 +1228,9 @@ var en_default = {
|
|
|
1227
1228
|
"agentActivity.llmToolCalls": "Tool calls",
|
|
1228
1229
|
"agentActivity.showRawLlm": "Raw LLM",
|
|
1229
1230
|
"agentActivity.earlierConversations": "Earlier conversations ({{count}})",
|
|
1230
|
-
"agentActivity.earlierActivity": "Earlier activity"
|
|
1231
|
+
"agentActivity.earlierActivity": "Earlier activity",
|
|
1232
|
+
"tabs.scrollStart": "Scroll tabs back",
|
|
1233
|
+
"tabs.scrollEnd": "Scroll tabs forward"
|
|
1231
1234
|
};
|
|
1232
1235
|
|
|
1233
1236
|
export { en_default };
|