@noya-app/noya-multiplayer-react 0.1.24 → 0.1.26

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.
@@ -5,14 +5,14 @@
5
5
  CLI Target: esnext
6
6
  CJS Build start
7
7
  ESM Build start
8
- CJS dist/index.js 46.99 KB
9
- CJS dist/index.js.map 77.08 KB
10
- CJS ⚡️ Build success in 69ms
11
- ESM dist/index.mjs 41.72 KB
12
- ESM dist/index.mjs.map 77.28 KB
13
- ESM ⚡️ Build success in 69ms
8
+ CJS dist/index.js 50.29 KB
9
+ CJS dist/index.js.map 81.83 KB
10
+ CJS ⚡️ Build success in 45ms
11
+ ESM dist/index.mjs 44.76 KB
12
+ ESM dist/index.mjs.map 82.05 KB
13
+ ESM ⚡️ Build success in 45ms
14
14
  DTS Build start
15
15
  "ComponentPropsWithoutRef" is imported from external module "react" but never used in "src/components/UserPointersOverlay.tsx", "src/inspector/StateInspector.tsx" and "src/hooks.ts".
16
- DTS ⚡️ Build success in 2362ms
17
- DTS dist/index.d.ts 7.44 KB
18
- DTS dist/index.d.mts 7.44 KB
16
+ DTS ⚡️ Build success in 2339ms
17
+ DTS dist/index.d.ts 7.30 KB
18
+ DTS dist/index.d.mts 7.30 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # @noya-app/state-manager
2
2
 
3
+ ## 0.1.26
4
+
5
+ ### Patch Changes
6
+
7
+ - c8abfeb: Improve tree operations
8
+ - Updated dependencies [c8abfeb]
9
+ - @noya-app/state-manager@0.1.24
10
+
11
+ ## 0.1.25
12
+
13
+ ### Patch Changes
14
+
15
+ - f3e588d: Improve json editing
16
+ - b104428: Package improvements, mainly around json
17
+ - Updated dependencies [f3e588d]
18
+ - Updated dependencies [04542f5]
19
+ - Updated dependencies [b104428]
20
+ - @noya-app/state-manager@0.1.23
21
+
3
22
  ## 0.1.24
4
23
 
5
24
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -51,7 +51,7 @@ type StateInspectorOptions = {
51
51
  colorScheme?: "light" | "dark";
52
52
  anchor?: StateInspectorAnchor;
53
53
  };
54
- declare const StateInspector: React.MemoExoticComponent<(<S extends object, M, E>({ state, connectionEvents, connectedUsers, tasks, userId, unstyled, colorScheme, multiplayerStateManager, ephemeralUserData, anchor, forceInit, ...props }: {
54
+ declare const StateInspector: React.MemoExoticComponent<(<S, M, E>({ state, connectionEvents, connectedUsers, tasks, userId, unstyled, colorScheme, multiplayerStateManager, ephemeralUserData, anchor, forceInit, ...props }: {
55
55
  state: S;
56
56
  connectionEvents?: ConnectionEvent<S>[] | undefined;
57
57
  connectedUsers?: MultiplayerUser[] | undefined;
@@ -63,11 +63,11 @@ declare const StateInspector: React.MemoExoticComponent<(<S extends object, M, E
63
63
  forceInit: () => void;
64
64
  } & StateInspectorOptions & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">) => React.JSX.Element | null)>;
65
65
 
66
- declare function useSyncStateManager<S extends object, M>(stateManager: StateManager<S, M>): S;
67
- declare function useSyncStateManager<S extends object, M, P extends string>(stateManager: StateManager<S, M>, path: P): Get<S, P, unknown>;
68
- declare function useManagedState<S extends object, M = void>(createInitialState: () => S, options?: StateManagerOptions<S, M>): readonly [S, (...args: M extends {} ? [metadata: M, action: SetStateAction<S>] : [action: SetStateAction<S>]) => void, StateManager<S, M>];
69
- declare function useManagedHistory<S extends object, M = void>(stateManager: StateManager<S, M>): _noya_app_state_manager.HistorySnapshot<S, M>;
70
- declare function useSyncMultiplayerStateManager<S extends object, M = void>(multiplayerStateManager: MultiplayerStateManager<S, M>): S;
66
+ declare function useSyncStateManager<S, M>(stateManager: StateManager<S, M>): S;
67
+ declare function useSyncStateManager<S, M, P extends string>(stateManager: StateManager<S, M>, path: P): Get<S, P, unknown>;
68
+ declare function useManagedState<S, M = void>(createInitialState: () => S, options?: StateManagerOptions<S, M>): readonly [S, (...args: M extends {} ? [metadata: M, action: SetStateAction<S>] : [action: SetStateAction<S>]) => void, StateManager<S, M>];
69
+ declare function useManagedHistory<S, M = void>(stateManager: StateManager<S, M>): _noya_app_state_manager.HistorySnapshot<S, M>;
70
+ declare function useSyncMultiplayerStateManager<S, M = void>(multiplayerStateManager: MultiplayerStateManager<S, M>): S;
71
71
  declare function useEphemeralUserData<E>(ephemeralUserData: EphemeralUserData<E>, options?: {
72
72
  throttle?: number;
73
73
  }): {
@@ -75,13 +75,13 @@ declare function useEphemeralUserData<E>(ephemeralUserData: EphemeralUserData<E>
75
75
  metadata: Record<string, _noya_app_state_manager.EphemeralUserMetadata | undefined>;
76
76
  currentUserId: string | undefined;
77
77
  };
78
- type UseMultiplayerStateOptions<S extends object, M = void, E = void> = MultiplayerStateManagerOptions<S, M> & {
78
+ type UseMultiplayerStateOptions<S, M = void, E = void> = MultiplayerStateManagerOptions<S, M> & {
79
79
  sync?: (options: Pick<SyncAdapterOptions<S, M, E>, "ms" | "ephemeralUserData">) => void;
80
80
  trackConnectionEvents?: boolean;
81
81
  trackTasks?: boolean;
82
82
  inspector?: boolean | StateInspectorOptions;
83
83
  };
84
- declare function useMultiplayerState<S extends object, M = void, E = void>(initialState: S | (() => S), options?: UseMultiplayerStateOptions<S, M, E>): readonly [S, (...args: M extends {} ? [metadata: M, action: S | ((prevState: S) => S)] : [action: S | ((prevState: S) => S)]) => void, {
84
+ declare function useMultiplayerState<S, M = void, E = void>(initialState: S | (() => S), options?: UseMultiplayerStateOptions<S, M, E>): readonly [S, (...args: M extends {} ? [metadata: M, action: S | ((prevState: S) => S)] : [action: S | ((prevState: S) => S)]) => void, {
85
85
  tasks: Task[];
86
86
  userId: string | undefined;
87
87
  connectionEvents: ConnectionEvent<S>[] | undefined;
@@ -108,7 +108,7 @@ type AppDataOptions = {
108
108
  /**
109
109
  * Get data from host app. Fall back to default data.
110
110
  */
111
- declare function useAppData<S extends object>(initialState: S, { schema }?: AppDataOptions): AppData<S>;
111
+ declare function useAppData<S>(initialState: S, { schema }?: AppDataOptions): AppData<S>;
112
112
  type IframeToHostMessage = {
113
113
  type: "application.setMenuItems";
114
114
  payload: {
@@ -129,7 +129,7 @@ type HostToIframeMessage = {
129
129
  declare function useBroadcastConnectedUsers(connectedUsers: MultiplayerUser[]): void;
130
130
  declare function useBroadcastMenuItems<T>(menuItems: any[], handleSelectMenuItem: (value: T) => void): void;
131
131
  declare function isEmbeddedApp(): boolean;
132
- declare function useNoyaAppState<S extends object, M = void, E = void>(initialState: S | (() => S), options: UseMultiplayerStateOptions<S, M, E> & {
132
+ declare function useNoyaAppState<S, M = void, E = void>(initialState: S | (() => S), options: UseMultiplayerStateOptions<S, M, E> & {
133
133
  localStorageKey?: string;
134
134
  }): readonly [S, (...args: M extends {} ? [metadata: M, action: S | ((prevState: S) => S)] : [action: S | ((prevState: S) => S)]) => void, {
135
135
  readonly theme: AppTheme;
package/dist/index.d.ts CHANGED
@@ -51,7 +51,7 @@ type StateInspectorOptions = {
51
51
  colorScheme?: "light" | "dark";
52
52
  anchor?: StateInspectorAnchor;
53
53
  };
54
- declare const StateInspector: React.MemoExoticComponent<(<S extends object, M, E>({ state, connectionEvents, connectedUsers, tasks, userId, unstyled, colorScheme, multiplayerStateManager, ephemeralUserData, anchor, forceInit, ...props }: {
54
+ declare const StateInspector: React.MemoExoticComponent<(<S, M, E>({ state, connectionEvents, connectedUsers, tasks, userId, unstyled, colorScheme, multiplayerStateManager, ephemeralUserData, anchor, forceInit, ...props }: {
55
55
  state: S;
56
56
  connectionEvents?: ConnectionEvent<S>[] | undefined;
57
57
  connectedUsers?: MultiplayerUser[] | undefined;
@@ -63,11 +63,11 @@ declare const StateInspector: React.MemoExoticComponent<(<S extends object, M, E
63
63
  forceInit: () => void;
64
64
  } & StateInspectorOptions & Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref">) => React.JSX.Element | null)>;
65
65
 
66
- declare function useSyncStateManager<S extends object, M>(stateManager: StateManager<S, M>): S;
67
- declare function useSyncStateManager<S extends object, M, P extends string>(stateManager: StateManager<S, M>, path: P): Get<S, P, unknown>;
68
- declare function useManagedState<S extends object, M = void>(createInitialState: () => S, options?: StateManagerOptions<S, M>): readonly [S, (...args: M extends {} ? [metadata: M, action: SetStateAction<S>] : [action: SetStateAction<S>]) => void, StateManager<S, M>];
69
- declare function useManagedHistory<S extends object, M = void>(stateManager: StateManager<S, M>): _noya_app_state_manager.HistorySnapshot<S, M>;
70
- declare function useSyncMultiplayerStateManager<S extends object, M = void>(multiplayerStateManager: MultiplayerStateManager<S, M>): S;
66
+ declare function useSyncStateManager<S, M>(stateManager: StateManager<S, M>): S;
67
+ declare function useSyncStateManager<S, M, P extends string>(stateManager: StateManager<S, M>, path: P): Get<S, P, unknown>;
68
+ declare function useManagedState<S, M = void>(createInitialState: () => S, options?: StateManagerOptions<S, M>): readonly [S, (...args: M extends {} ? [metadata: M, action: SetStateAction<S>] : [action: SetStateAction<S>]) => void, StateManager<S, M>];
69
+ declare function useManagedHistory<S, M = void>(stateManager: StateManager<S, M>): _noya_app_state_manager.HistorySnapshot<S, M>;
70
+ declare function useSyncMultiplayerStateManager<S, M = void>(multiplayerStateManager: MultiplayerStateManager<S, M>): S;
71
71
  declare function useEphemeralUserData<E>(ephemeralUserData: EphemeralUserData<E>, options?: {
72
72
  throttle?: number;
73
73
  }): {
@@ -75,13 +75,13 @@ declare function useEphemeralUserData<E>(ephemeralUserData: EphemeralUserData<E>
75
75
  metadata: Record<string, _noya_app_state_manager.EphemeralUserMetadata | undefined>;
76
76
  currentUserId: string | undefined;
77
77
  };
78
- type UseMultiplayerStateOptions<S extends object, M = void, E = void> = MultiplayerStateManagerOptions<S, M> & {
78
+ type UseMultiplayerStateOptions<S, M = void, E = void> = MultiplayerStateManagerOptions<S, M> & {
79
79
  sync?: (options: Pick<SyncAdapterOptions<S, M, E>, "ms" | "ephemeralUserData">) => void;
80
80
  trackConnectionEvents?: boolean;
81
81
  trackTasks?: boolean;
82
82
  inspector?: boolean | StateInspectorOptions;
83
83
  };
84
- declare function useMultiplayerState<S extends object, M = void, E = void>(initialState: S | (() => S), options?: UseMultiplayerStateOptions<S, M, E>): readonly [S, (...args: M extends {} ? [metadata: M, action: S | ((prevState: S) => S)] : [action: S | ((prevState: S) => S)]) => void, {
84
+ declare function useMultiplayerState<S, M = void, E = void>(initialState: S | (() => S), options?: UseMultiplayerStateOptions<S, M, E>): readonly [S, (...args: M extends {} ? [metadata: M, action: S | ((prevState: S) => S)] : [action: S | ((prevState: S) => S)]) => void, {
85
85
  tasks: Task[];
86
86
  userId: string | undefined;
87
87
  connectionEvents: ConnectionEvent<S>[] | undefined;
@@ -108,7 +108,7 @@ type AppDataOptions = {
108
108
  /**
109
109
  * Get data from host app. Fall back to default data.
110
110
  */
111
- declare function useAppData<S extends object>(initialState: S, { schema }?: AppDataOptions): AppData<S>;
111
+ declare function useAppData<S>(initialState: S, { schema }?: AppDataOptions): AppData<S>;
112
112
  type IframeToHostMessage = {
113
113
  type: "application.setMenuItems";
114
114
  payload: {
@@ -129,7 +129,7 @@ type HostToIframeMessage = {
129
129
  declare function useBroadcastConnectedUsers(connectedUsers: MultiplayerUser[]): void;
130
130
  declare function useBroadcastMenuItems<T>(menuItems: any[], handleSelectMenuItem: (value: T) => void): void;
131
131
  declare function isEmbeddedApp(): boolean;
132
- declare function useNoyaAppState<S extends object, M = void, E = void>(initialState: S | (() => S), options: UseMultiplayerStateOptions<S, M, E> & {
132
+ declare function useNoyaAppState<S, M = void, E = void>(initialState: S | (() => S), options: UseMultiplayerStateOptions<S, M, E> & {
133
133
  localStorageKey?: string;
134
134
  }): readonly [S, (...args: M extends {} ? [metadata: M, action: S | ((prevState: S) => S)] : [action: S | ((prevState: S) => S)]) => void, {
135
135
  readonly theme: AppTheme;