@almadar/ui 4.51.10 → 4.51.12

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.
@@ -59058,6 +59058,13 @@ function BrowserPlayground({
59058
59058
  const [runtime] = React93.useState(
59059
59059
  () => new OrbitalServerRuntime.OrbitalServerRuntime({ mode, debug: false })
59060
59060
  );
59061
+ const registrationReady = React93.useMemo(() => {
59062
+ const orbitalNames = schema.orbitals.map((o) => o.name);
59063
+ playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
59064
+ return runtime.register(schema).then(() => {
59065
+ playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
59066
+ });
59067
+ }, [runtime, schema]);
59061
59068
  const teardownTimerRef = React93.useRef(null);
59062
59069
  React93.useEffect(() => {
59063
59070
  if (teardownTimerRef.current !== null) {
@@ -59072,13 +59079,6 @@ function BrowserPlayground({
59072
59079
  }, 0);
59073
59080
  };
59074
59081
  }, [runtime]);
59075
- React93.useEffect(() => {
59076
- const orbitalNames = schema.orbitals.map((o) => o.name);
59077
- playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
59078
- void runtime.register(schema).then(() => {
59079
- playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
59080
- });
59081
- }, [runtime, schema]);
59082
59082
  const transport = React93.useMemo(() => ({
59083
59083
  register: async (s) => {
59084
59084
  await runtime.register(s);
@@ -59088,12 +59088,13 @@ function BrowserPlayground({
59088
59088
  runtime.unregisterAll();
59089
59089
  },
59090
59090
  sendEvent: async (orbitalName, event, payload) => {
59091
+ await registrationReady;
59091
59092
  return runtime.processOrbitalEvent(orbitalName, {
59092
59093
  event,
59093
59094
  payload
59094
59095
  });
59095
59096
  }
59096
- }), [runtime]);
59097
+ }), [runtime, registrationReady]);
59097
59098
  return /* @__PURE__ */ jsxRuntime.jsx(
59098
59099
  OrbPreview,
59099
59100
  {
@@ -60246,8 +60247,17 @@ function findPatternInTree(root, path) {
60246
60247
  for (const part of parts) {
60247
60248
  if (current === null || current === void 0 || typeof current !== "object") return null;
60248
60249
  const record = current;
60249
- if (part === "children" && Array.isArray(record.children)) {
60250
- current = record.children;
60250
+ if (part === "children") {
60251
+ if (Array.isArray(record.children)) {
60252
+ current = record.children;
60253
+ } else {
60254
+ const nestedProps = record.props;
60255
+ if (nestedProps && typeof nestedProps === "object" && !Array.isArray(nestedProps) && Array.isArray(nestedProps.children)) {
60256
+ current = nestedProps.children;
60257
+ } else {
60258
+ return null;
60259
+ }
60260
+ }
60251
60261
  } else if (Array.isArray(current)) {
60252
60262
  const idx = parseInt(part, 10);
60253
60263
  if (isNaN(idx) || idx < 0 || idx >= current.length) return null;
@@ -60291,7 +60301,13 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
60291
60301
  for (const eff of transition.effects ?? []) {
60292
60302
  if (Array.isArray(eff) && eff[0] === "render-ui" && eff[2]) {
60293
60303
  const found = findPatternInTree(eff[2], patternId);
60294
- if (found) return found;
60304
+ if (!found) continue;
60305
+ const nested = found.props;
60306
+ if (nested && typeof nested === "object" && !Array.isArray(nested)) {
60307
+ const { props: _stripped, ...rest } = found;
60308
+ return { ...nested, ...rest };
60309
+ }
60310
+ return found;
60295
60311
  }
60296
60312
  }
60297
60313
  if (selectedPattern.patternId) {
package/dist/avl/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
2
2
  import { OrbitControls as OrbitControls$1, Grid as Grid$1, Stars, Sparkles, Html, RoundedBox } from '@react-three/drei';
3
3
  import * as React93 from 'react';
4
- import React93__default, { createContext, useState, useRef, useEffect, useMemo, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
4
+ import React93__default, { createContext, useState, useMemo, useRef, useEffect, useContext, useCallback, Suspense, useLayoutEffect, Profiler, useReducer, lazy, useId, forwardRef, useImperativeHandle, Component } from 'react';
5
5
  import { createLogger, isLogLevelEnabled } from '@almadar/logger';
6
6
  import ELK from 'elkjs/lib/elk.bundled.js';
7
7
  import { MarkerType, Handle, Position, getBezierPath, EdgeLabelRenderer, BaseEdge, ReactFlowProvider, useNodesState, useEdgesState, useReactFlow, ReactFlow, Controls, Background, BackgroundVariant } from '@xyflow/react';
@@ -59012,6 +59012,13 @@ function BrowserPlayground({
59012
59012
  const [runtime] = useState(
59013
59013
  () => new OrbitalServerRuntime({ mode, debug: false })
59014
59014
  );
59015
+ const registrationReady = useMemo(() => {
59016
+ const orbitalNames = schema.orbitals.map((o) => o.name);
59017
+ playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
59018
+ return runtime.register(schema).then(() => {
59019
+ playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
59020
+ });
59021
+ }, [runtime, schema]);
59015
59022
  const teardownTimerRef = useRef(null);
59016
59023
  useEffect(() => {
59017
59024
  if (teardownTimerRef.current !== null) {
@@ -59026,13 +59033,6 @@ function BrowserPlayground({
59026
59033
  }, 0);
59027
59034
  };
59028
59035
  }, [runtime]);
59029
- useEffect(() => {
59030
- const orbitalNames = schema.orbitals.map((o) => o.name);
59031
- playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
59032
- void runtime.register(schema).then(() => {
59033
- playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
59034
- });
59035
- }, [runtime, schema]);
59036
59036
  const transport = useMemo(() => ({
59037
59037
  register: async (s) => {
59038
59038
  await runtime.register(s);
@@ -59042,12 +59042,13 @@ function BrowserPlayground({
59042
59042
  runtime.unregisterAll();
59043
59043
  },
59044
59044
  sendEvent: async (orbitalName, event, payload) => {
59045
+ await registrationReady;
59045
59046
  return runtime.processOrbitalEvent(orbitalName, {
59046
59047
  event,
59047
59048
  payload
59048
59049
  });
59049
59050
  }
59050
- }), [runtime]);
59051
+ }), [runtime, registrationReady]);
59051
59052
  return /* @__PURE__ */ jsx(
59052
59053
  OrbPreview,
59053
59054
  {
@@ -60200,8 +60201,17 @@ function findPatternInTree(root, path) {
60200
60201
  for (const part of parts) {
60201
60202
  if (current === null || current === void 0 || typeof current !== "object") return null;
60202
60203
  const record = current;
60203
- if (part === "children" && Array.isArray(record.children)) {
60204
- current = record.children;
60204
+ if (part === "children") {
60205
+ if (Array.isArray(record.children)) {
60206
+ current = record.children;
60207
+ } else {
60208
+ const nestedProps = record.props;
60209
+ if (nestedProps && typeof nestedProps === "object" && !Array.isArray(nestedProps) && Array.isArray(nestedProps.children)) {
60210
+ current = nestedProps.children;
60211
+ } else {
60212
+ return null;
60213
+ }
60214
+ }
60205
60215
  } else if (Array.isArray(current)) {
60206
60216
  const idx = parseInt(part, 10);
60207
60217
  if (isNaN(idx) || idx < 0 || idx >= current.length) return null;
@@ -60245,7 +60255,13 @@ function OrbInspector({ node, schema, editable = false, userType = "builder", th
60245
60255
  for (const eff of transition.effects ?? []) {
60246
60256
  if (Array.isArray(eff) && eff[0] === "render-ui" && eff[2]) {
60247
60257
  const found = findPatternInTree(eff[2], patternId);
60248
- if (found) return found;
60258
+ if (!found) continue;
60259
+ const nested = found.props;
60260
+ if (nested && typeof nested === "object" && !Array.isArray(nested)) {
60261
+ const { props: _stripped, ...rest } = found;
60262
+ return { ...nested, ...rest };
60263
+ }
60264
+ return found;
60249
60265
  }
60250
60266
  }
60251
60267
  if (selectedPattern.patternId) {
@@ -46949,6 +46949,13 @@ function BrowserPlayground({
46949
46949
  const [runtime] = React80.useState(
46950
46950
  () => new OrbitalServerRuntime.OrbitalServerRuntime({ mode, debug: false })
46951
46951
  );
46952
+ const registrationReady = React80.useMemo(() => {
46953
+ const orbitalNames = schema.orbitals.map((o) => o.name);
46954
+ playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
46955
+ return runtime.register(schema).then(() => {
46956
+ playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
46957
+ });
46958
+ }, [runtime, schema]);
46952
46959
  const teardownTimerRef = React80.useRef(null);
46953
46960
  React80.useEffect(() => {
46954
46961
  if (teardownTimerRef.current !== null) {
@@ -46963,13 +46970,6 @@ function BrowserPlayground({
46963
46970
  }, 0);
46964
46971
  };
46965
46972
  }, [runtime]);
46966
- React80.useEffect(() => {
46967
- const orbitalNames = schema.orbitals.map((o) => o.name);
46968
- playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
46969
- void runtime.register(schema).then(() => {
46970
- playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
46971
- });
46972
- }, [runtime, schema]);
46973
46973
  const transport = React80.useMemo(() => ({
46974
46974
  register: async (s) => {
46975
46975
  await runtime.register(s);
@@ -46979,12 +46979,13 @@ function BrowserPlayground({
46979
46979
  runtime.unregisterAll();
46980
46980
  },
46981
46981
  sendEvent: async (orbitalName, event, payload) => {
46982
+ await registrationReady;
46982
46983
  return runtime.processOrbitalEvent(orbitalName, {
46983
46984
  event,
46984
46985
  payload
46985
46986
  });
46986
46987
  }
46987
- }), [runtime]);
46988
+ }), [runtime, registrationReady]);
46988
46989
  return /* @__PURE__ */ jsxRuntime.jsx(
46989
46990
  OrbPreview,
46990
46991
  {
@@ -46903,6 +46903,13 @@ function BrowserPlayground({
46903
46903
  const [runtime] = useState(
46904
46904
  () => new OrbitalServerRuntime({ mode, debug: false })
46905
46905
  );
46906
+ const registrationReady = useMemo(() => {
46907
+ const orbitalNames = schema.orbitals.map((o) => o.name);
46908
+ playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
46909
+ return runtime.register(schema).then(() => {
46910
+ playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
46911
+ });
46912
+ }, [runtime, schema]);
46906
46913
  const teardownTimerRef = useRef(null);
46907
46914
  useEffect(() => {
46908
46915
  if (teardownTimerRef.current !== null) {
@@ -46917,13 +46924,6 @@ function BrowserPlayground({
46917
46924
  }, 0);
46918
46925
  };
46919
46926
  }, [runtime]);
46920
- useEffect(() => {
46921
- const orbitalNames = schema.orbitals.map((o) => o.name);
46922
- playgroundLog.debug("register:start", { schema: schema.name, orbitalNames });
46923
- void runtime.register(schema).then(() => {
46924
- playgroundLog.debug("register:done", { schema: schema.name, orbitalNames });
46925
- });
46926
- }, [runtime, schema]);
46927
46927
  const transport = useMemo(() => ({
46928
46928
  register: async (s) => {
46929
46929
  await runtime.register(s);
@@ -46933,12 +46933,13 @@ function BrowserPlayground({
46933
46933
  runtime.unregisterAll();
46934
46934
  },
46935
46935
  sendEvent: async (orbitalName, event, payload) => {
46936
+ await registrationReady;
46936
46937
  return runtime.processOrbitalEvent(orbitalName, {
46937
46938
  event,
46938
46939
  payload
46939
46940
  });
46940
46941
  }
46941
- }), [runtime]);
46942
+ }), [runtime, registrationReady]);
46942
46943
  return /* @__PURE__ */ jsx(
46943
46944
  OrbPreview,
46944
46945
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "4.51.10",
3
+ "version": "4.51.12",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [