@almadar/ui 6.55.0 → 6.57.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.
Files changed (59) hide show
  1. package/dist/{ArbitraryClassCompiler-DvzdeHxc.d.ts → ArbitraryClassCompiler-tChQ3nVq.d.ts} +15 -1
  2. package/dist/{FileTree-DUi7e7Z8.d.ts → FileTree-BSfgp-HH.d.ts} +29 -2
  3. package/dist/Typography-LZTP72Y4.js +5 -0
  4. package/dist/{UISlotRenderer-QTHFT6Z4.js → UISlotRenderer-NCGDIXN4.js} +8 -8
  5. package/dist/avl/index.cjs +4832 -4212
  6. package/dist/avl/index.d.ts +74 -5
  7. package/dist/avl/index.js +68 -711
  8. package/dist/{avl-schema-parser-C0wnAp5x.d.ts → avl-schema-parser-CH1QoZw1.d.ts} +1 -1
  9. package/dist/{chunk-HCSJHRC4.js → chunk-4ZGXIW3B.js} +1 -1
  10. package/dist/{chunk-RNY5LJXJ.js → chunk-723MJUU3.js} +1 -1
  11. package/dist/{chunk-6EV3OEBQ.js → chunk-CHNC4UYE.js} +3 -2
  12. package/dist/{chunk-SGJHVPHC.js → chunk-GZGDBS4S.js} +2 -2
  13. package/dist/{chunk-Y53Q55H5.js → chunk-HA7CJWQX.js} +1123 -1121
  14. package/dist/{chunk-JRW33U35.js → chunk-I5QOYW2Z.js} +1 -1
  15. package/dist/{chunk-KQXXO42S.js → chunk-KJGVLXEN.js} +78 -1
  16. package/dist/{chunk-HRCR53OW.js → chunk-LZRW6GXG.js} +18 -3
  17. package/dist/{chunk-2LFBQ4IS.js → chunk-MZIDOJMD.js} +2 -2
  18. package/dist/{chunk-QGH4NAQO.js → chunk-N7JIG57B.js} +9 -4
  19. package/dist/{chunk-XZKGRSIO.js → chunk-PYJ2UQWM.js} +2487 -1156
  20. package/dist/{chunk-FQM37C56.js → chunk-RHP5WL55.js} +61 -55
  21. package/dist/chunk-YYYHH5BA.js +2519 -0
  22. package/dist/{cn-ClXGlIOY.d.ts → cn-DIql5232.d.ts} +152 -24
  23. package/dist/components/index.cjs +6876 -3072
  24. package/dist/components/index.d.ts +45 -94
  25. package/dist/components/index.js +14 -16
  26. package/dist/context/index.cjs +23 -0
  27. package/dist/context/index.d.ts +2 -2
  28. package/dist/context/index.js +20 -1
  29. package/dist/hooks/index.cjs +2544 -7
  30. package/dist/hooks/index.d.ts +4 -1
  31. package/dist/hooks/index.js +7 -6
  32. package/dist/lib/drawable/three/index.cjs +22 -6
  33. package/dist/lib/drawable/three/index.d.ts +1 -1
  34. package/dist/lib/drawable/three/index.js +7 -7
  35. package/dist/lib/index.cjs +18 -3
  36. package/dist/lib/index.d.ts +1 -1
  37. package/dist/lib/index.js +3 -4
  38. package/dist/locales/index.cjs +54 -9
  39. package/dist/locales/index.js +2 -2489
  40. package/dist/providers/index.cjs +4035 -2382
  41. package/dist/providers/index.d.ts +2 -2
  42. package/dist/providers/index.js +24 -13
  43. package/dist/runtime/index.cjs +4092 -2447
  44. package/dist/runtime/index.d.ts +0 -13
  45. package/dist/runtime/index.js +11 -10
  46. package/dist/ssr/index.cjs +23 -6
  47. package/dist/ssr/index.js +23 -6
  48. package/dist/{useEventBus-JUAH3EFW.js → useEventBus-SWRN475O.js} +1 -1
  49. package/locales/ar.json +18 -3
  50. package/locales/en.json +18 -3
  51. package/locales/sl.json +18 -3
  52. package/package.json +6 -6
  53. package/tailwind-preset.cjs +6 -0
  54. package/themes/_fonts.css +1 -1
  55. package/themes/_presets.css +1 -0
  56. package/themes/kflow.css +299 -0
  57. package/dist/Typography-7PDT62PG.js +0 -5
  58. package/dist/chunk-F4ZTPKZL.js +0 -284
  59. package/dist/chunk-OKWD7LPO.js +0 -80
@@ -1,11 +1,11 @@
1
- import { useTranslate, useRenderI18n, runTickFrame } from './chunk-QGH4NAQO.js';
1
+ import { useTranslate, useRenderI18n, runTickFrame } from './chunk-N7JIG57B.js';
2
2
  import { ALL_SLOTS } from './chunk-VHTJRS2N.js';
3
- import { LoadingState, ErrorState, UISlotRenderer } from './chunk-XZKGRSIO.js';
4
- import { Box } from './chunk-Y53Q55H5.js';
5
- import { Typography } from './chunk-HCSJHRC4.js';
6
- import { beginPending, endPending } from './chunk-JRW33U35.js';
7
- import { useEventBus } from './chunk-6EV3OEBQ.js';
8
- import { registerTrait, unregisterTrait, perfTimeAsync } from './chunk-KQXXO42S.js';
3
+ import { LoadingState, ErrorState, UISlotRenderer } from './chunk-PYJ2UQWM.js';
4
+ import { Box } from './chunk-HA7CJWQX.js';
5
+ import { Typography } from './chunk-4ZGXIW3B.js';
6
+ import { beginPending, endPending } from './chunk-I5QOYW2Z.js';
7
+ import { useEventBus } from './chunk-CHNC4UYE.js';
8
+ import { registerTrait, unregisterTrait, perfTimeAsync } from './chunk-KJGVLXEN.js';
9
9
  import { bindTraitStateGetter, registerTraitSnapshot, recordTransition, recordingTransport, recordServerResponse } from './chunk-Q47ZN2DW.js';
10
10
  import { isNotificationSlot } from './chunk-PEST66PN.js';
11
11
  import React, { useState, useMemo, useEffect, useRef, useCallback, useSyncExternalStore } from 'react';
@@ -518,7 +518,7 @@ function resolveLambdaBindings(body, params, item, index) {
518
518
  return body;
519
519
  }
520
520
  var LazySlotContentRenderer = React.lazy(
521
- () => import('./UISlotRenderer-QTHFT6Z4.js').then((m) => ({ default: m.SlotContentRenderer }))
521
+ () => import('./UISlotRenderer-NCGDIXN4.js').then((m) => ({ default: m.SlotContentRenderer }))
522
522
  );
523
523
  function deferLambdaEntityExprs(value) {
524
524
  if (typeof value === "string") {
@@ -953,6 +953,7 @@ function createSharedEntityWriter(binding, tick, traitStatesRef, emit, traitConf
953
953
  }
954
954
  function useClientTicks(traitBindings, store, traitIndex, options) {
955
955
  useEffect(() => {
956
+ if (options.hostRunsProgram === true) return;
956
957
  const scheduler = createTickScheduler();
957
958
  const traitStatesRef = { current: store.manager.getAllStates() };
958
959
  const refreshStates = () => {
@@ -1098,7 +1099,7 @@ function useClientTicks(traitBindings, store, traitIndex, options) {
1098
1099
  }
1099
1100
  }
1100
1101
  return () => scheduler.stopAll();
1101
- }, [traitBindings, store, traitIndex, options.eventBus, options.slotFlush, options.traitConfigsByName, options.navigate, options.navigateBack, options.user]);
1102
+ }, [traitBindings, store, traitIndex, options.eventBus, options.slotFlush, options.traitConfigsByName, options.navigate, options.navigateBack, options.user, options.hostRunsProgram]);
1102
1103
  }
1103
1104
  var EMPTY_ENTITY = {};
1104
1105
  function useEntityBindingSource(store, traitIndex) {
@@ -1195,6 +1196,7 @@ function useTraitStateMachine(traitBindings, uiSlots, options) {
1195
1196
  useClientTicks(traitBindings, store, traitIndex, {
1196
1197
  eventBus,
1197
1198
  slotFlush,
1199
+ hostRunsProgram: transport?.hostsBrowserStore === true,
1198
1200
  ...options.traitConfigsByName !== void 0 ? { traitConfigsByName: options.traitConfigsByName } : {},
1199
1201
  ...options.navigate !== void 0 ? { navigate: options.navigate } : {},
1200
1202
  ...options.navigateBack !== void 0 ? { navigateBack: options.navigateBack } : {},
@@ -1789,6 +1791,17 @@ function resolvePreviewTheme(schema, pageName) {
1789
1791
  }
1790
1792
  return schema.orbitals[0]?.theme ?? schema.theme;
1791
1793
  }
1794
+ function NavigateListener({ onNavigate }) {
1795
+ const bus = useEventBus();
1796
+ useEffect(
1797
+ () => bus.on("UI:NAVIGATE", (event) => {
1798
+ const url = event.payload?.url;
1799
+ if (typeof url === "string" && url.length > 0) onNavigate(url);
1800
+ }),
1801
+ [bus, onNavigate]
1802
+ );
1803
+ return null;
1804
+ }
1792
1805
  function OrbPreview({
1793
1806
  schema,
1794
1807
  mockData,
@@ -1814,7 +1827,6 @@ function OrbPreview({
1814
1827
  }
1815
1828
  const { t } = useTranslate$1();
1816
1829
  const [localFallback, setLocalFallback] = useState(false);
1817
- const eventBus = useEventBus();
1818
1830
  const inHostRouter = useInRouterContext();
1819
1831
  const [hostHrefBase, setHostHrefBase] = useState("/");
1820
1832
  const handleLocalFallback = useCallback(() => {
@@ -1968,15 +1980,6 @@ function OrbPreview({
1968
1980
  const handleNavigateBack = useCallback(() => {
1969
1981
  navStackRef.current?.back();
1970
1982
  }, []);
1971
- useEffect(() => {
1972
- const unsubscribe = eventBus.on("UI:NAVIGATE", (event) => {
1973
- const url = event.payload?.url;
1974
- if (typeof url === "string" && url.length > 0) {
1975
- handleNavigate(url);
1976
- }
1977
- });
1978
- return unsubscribe;
1979
- }, [eventBus, handleNavigate]);
1980
1983
  if (!parseResult.ok) {
1981
1984
  return /* @__PURE__ */ jsx(Box, { className, style: { height }, children: /* @__PURE__ */ jsxs(Typography, { as: "pre", color: "error", variant: "small", className: "font-mono whitespace-pre-wrap break-all m-0 p-4", children: [
1982
1985
  "Parse error: ",
@@ -2071,41 +2074,44 @@ function OrbPreview({
2071
2074
  storageKey: `almadar:navstack:${parseResult.schema.name ?? "preview"}`,
2072
2075
  children: [
2073
2076
  /* @__PURE__ */ jsx(NavStackRefBridge, { apiRef: navStackRef }),
2074
- /* @__PURE__ */ jsx(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, isolated, user, children: /* @__PURE__ */ jsx(UISlotProvider, { children: fit ? /* @__PURE__ */ jsx(FitToBox, { mode: fit === "content" ? "content" : "box", children: /* @__PURE__ */ jsx(
2075
- SchemaRunner,
2076
- {
2077
- schema: parseResult.schema,
2078
- serverUrl,
2079
- transport,
2080
- getAccessToken,
2081
- mockData: effectiveMockData,
2082
- pageName: currentPage,
2083
- routeParams,
2084
- onNavigate: handleNavigateEffect,
2085
- onNavigateBack: handleNavigateBack,
2086
- onLocalFallback: handleLocalFallback,
2087
- localFallbackTimeoutMs,
2088
- persistence,
2089
- themeOverride
2090
- }
2091
- ) }) : /* @__PURE__ */ jsx(
2092
- SchemaRunner,
2093
- {
2094
- schema: parseResult.schema,
2095
- serverUrl,
2096
- transport,
2097
- getAccessToken,
2098
- mockData: effectiveMockData,
2099
- pageName: currentPage,
2100
- routeParams,
2101
- onNavigate: handleNavigateEffect,
2102
- onNavigateBack: handleNavigateBack,
2103
- onLocalFallback: handleLocalFallback,
2104
- localFallbackTimeoutMs,
2105
- persistence,
2106
- themeOverride
2107
- }
2108
- ) }) })
2077
+ /* @__PURE__ */ jsxs(OrbitalProvider, { initialData: effectiveMockData, skipTheme: true, verification: true, isolated, user, children: [
2078
+ /* @__PURE__ */ jsx(NavigateListener, { onNavigate: handleNavigate }),
2079
+ /* @__PURE__ */ jsx(UISlotProvider, { children: fit ? /* @__PURE__ */ jsx(FitToBox, { mode: fit === "content" ? "content" : "box", children: /* @__PURE__ */ jsx(
2080
+ SchemaRunner,
2081
+ {
2082
+ schema: parseResult.schema,
2083
+ serverUrl,
2084
+ transport,
2085
+ getAccessToken,
2086
+ mockData: effectiveMockData,
2087
+ pageName: currentPage,
2088
+ routeParams,
2089
+ onNavigate: handleNavigateEffect,
2090
+ onNavigateBack: handleNavigateBack,
2091
+ onLocalFallback: handleLocalFallback,
2092
+ localFallbackTimeoutMs,
2093
+ persistence,
2094
+ themeOverride
2095
+ }
2096
+ ) }) : /* @__PURE__ */ jsx(
2097
+ SchemaRunner,
2098
+ {
2099
+ schema: parseResult.schema,
2100
+ serverUrl,
2101
+ transport,
2102
+ getAccessToken,
2103
+ mockData: effectiveMockData,
2104
+ pageName: currentPage,
2105
+ routeParams,
2106
+ onNavigate: handleNavigateEffect,
2107
+ onNavigateBack: handleNavigateBack,
2108
+ onLocalFallback: handleLocalFallback,
2109
+ localFallbackTimeoutMs,
2110
+ persistence,
2111
+ themeOverride
2112
+ }
2113
+ ) })
2114
+ ] })
2109
2115
  ]
2110
2116
  }
2111
2117
  ) })
@@ -2191,7 +2197,7 @@ function BrowserPlayground({
2191
2197
  const i18n = useMemo(() => {
2192
2198
  if (viewerLocale === void 0 || messages === void 0) return void 0;
2193
2199
  const catalog = messages[viewerLocale] ?? {};
2194
- return { locale: viewerLocale, direction: localeDirection(viewerLocale), t: createTranslate(catalog), messages: catalog };
2200
+ return { locale: viewerLocale, direction: localeDirection(viewerLocale), t: createTranslate(catalog, viewerLocale), messages: catalog };
2195
2201
  }, [viewerLocale, messages]);
2196
2202
  const preview = /* @__PURE__ */ jsx(
2197
2203
  OrbPreview,