@almadar/ui 4.51.10 → 4.51.11

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
  {
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
  {
@@ -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.11",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [