@indietabletop/appkit 6.1.3 → 6.1.5
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/lib/client.ts +1 -7
- package/lib/store/index.tsx +2 -1
- package/lib/store/utils.ts +10 -2
- package/package.json +5 -5
package/lib/client.ts
CHANGED
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
redeemedPledge,
|
|
6
6
|
sessionInfo,
|
|
7
7
|
type FeatureUnlock,
|
|
8
|
-
type
|
|
8
|
+
type UserGameData,
|
|
9
9
|
} from "@indietabletop/types";
|
|
10
10
|
import {
|
|
11
11
|
array,
|
|
@@ -20,12 +20,6 @@ import {
|
|
|
20
20
|
import { Failure, Success } from "./async-op.ts";
|
|
21
21
|
import type { CurrentUser, FailurePayload, SessionInfo } from "./types.ts";
|
|
22
22
|
|
|
23
|
-
export type UserGameData = {
|
|
24
|
-
spacegits?: {
|
|
25
|
-
gangs?: (SpaceGits.GangData | SpaceGits.GangTombstone)[];
|
|
26
|
-
};
|
|
27
|
-
};
|
|
28
|
-
|
|
29
23
|
export type GameCode = keyof UserGameData;
|
|
30
24
|
|
|
31
25
|
export type ClientEventType = keyof ClientEventMap;
|
package/lib/store/index.tsx
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import type { UserGameData } from "@indietabletop/types";
|
|
1
2
|
import { createActorContext } from "@xstate/react";
|
|
2
3
|
import { createContext, useContext, useMemo, type ReactNode } from "react";
|
|
3
4
|
import { fromCallback, fromPromise } from "xstate";
|
|
4
5
|
import { Failure, Success } from "../async-op.ts";
|
|
5
|
-
import type { GameCode, IndieTabletopClient
|
|
6
|
+
import type { GameCode, IndieTabletopClient } from "../client.ts";
|
|
6
7
|
import type { ModernIDB } from "../ModernIDB/ModernIDB.ts";
|
|
7
8
|
import type { ModernIDBIndexes, ModernIDBSchema } from "../ModernIDB/types.ts";
|
|
8
9
|
import type { CurrentUser } from "../types.ts";
|
package/lib/store/utils.ts
CHANGED
|
@@ -1,16 +1,24 @@
|
|
|
1
|
+
import type { UserGameData } from "@indietabletop/types";
|
|
1
2
|
import { Failure } from "../async-op.js";
|
|
2
|
-
import type { UserGameData } from "../client.ts";
|
|
3
3
|
import type { FailurePayload } from "../types.ts";
|
|
4
4
|
import type { SyncedItem } from "./types.ts";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Flattens the UserGameData structure to a flat SyncedItem[].
|
|
8
8
|
*/
|
|
9
|
-
|
|
10
9
|
export function toSyncedItems(data: UserGameData) {
|
|
11
10
|
return Object.values(data).flatMap((groups) => {
|
|
12
11
|
return Object.values(groups).flatMap((items) => {
|
|
13
12
|
return items.map((item): SyncedItem => {
|
|
13
|
+
if (!("deleted" in item)) {
|
|
14
|
+
return {
|
|
15
|
+
id: item.id,
|
|
16
|
+
name: item.id,
|
|
17
|
+
deleted: false,
|
|
18
|
+
updatedTs: item.updatedTs,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
14
22
|
return {
|
|
15
23
|
id: item.id,
|
|
16
24
|
name: item.name,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indietabletop/appkit",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.5",
|
|
4
4
|
"description": "A collection of modules used in apps built by Indie Tabletop Club",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -34,19 +34,19 @@
|
|
|
34
34
|
"@storybook/addon-docs": "^10.1.11",
|
|
35
35
|
"@storybook/addon-links": "^10.1.11",
|
|
36
36
|
"@storybook/react-vite": "^10.1.11",
|
|
37
|
-
"@types/react": "^19.2.
|
|
37
|
+
"@types/react": "^19.2.8",
|
|
38
38
|
"msw": "^2.12.7",
|
|
39
39
|
"msw-storybook-addon": "^2.0.6",
|
|
40
40
|
"np": "^10.2.0",
|
|
41
41
|
"storybook": "^10.1.11",
|
|
42
42
|
"typescript": "^5.9.3",
|
|
43
43
|
"vite": "^7.3.1",
|
|
44
|
-
"vitest": "^4.0.
|
|
44
|
+
"vitest": "^4.0.17"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@ariakit/react": "^0.4.
|
|
47
|
+
"@ariakit/react": "^0.4.21",
|
|
48
48
|
"@indietabletop/tooling": "^5.2.0",
|
|
49
|
-
"@indietabletop/types": "^1.
|
|
49
|
+
"@indietabletop/types": "^1.3.1",
|
|
50
50
|
"@vanilla-extract/css": "^1.18.0",
|
|
51
51
|
"@vanilla-extract/dynamic": "^2.1.5",
|
|
52
52
|
"@vanilla-extract/recipes": "^0.5.7",
|