@dxos/plugin-game 0.9.1-staging.ee54ba693a → 0.11.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.
- package/dist/lib/GamePlugin.mjs +18 -0
- package/dist/lib/GamePlugin.mjs.map +1 -0
- package/dist/lib/GamePlugin.node.mjs +17 -0
- package/dist/lib/GamePlugin.node.mjs.map +1 -0
- package/dist/lib/GamePlugin.workerd.mjs +10 -0
- package/dist/lib/GamePlugin.workerd.mjs.map +1 -0
- package/dist/lib/capabilities.mjs +8 -0
- package/dist/lib/capabilities.mjs.map +1 -0
- package/dist/lib/chunk-GameArticle.mjs +33 -0
- package/dist/lib/chunk-GameArticle.mjs.map +1 -0
- package/dist/lib/chunk-GameCard.mjs +26 -0
- package/dist/lib/chunk-GameCard.mjs.map +1 -0
- package/dist/lib/chunk-create-object.mjs +45 -0
- package/dist/lib/chunk-create-object.mjs.map +1 -0
- package/dist/lib/chunk-load-game.mjs +38 -0
- package/dist/lib/chunk-load-game.mjs.map +1 -0
- package/dist/lib/{neutral/chunk-R4V5PVU7.mjs → chunk-meta.mjs} +20 -28
- package/dist/lib/chunk-meta.mjs.map +1 -0
- package/dist/lib/chunk-react-surface.mjs +29 -0
- package/dist/lib/chunk-react-surface.mjs.map +1 -0
- package/dist/lib/chunk-types.mjs +83 -0
- package/dist/lib/chunk-types.mjs.map +1 -0
- package/dist/lib/components.mjs +82 -0
- package/dist/lib/components.mjs.map +1 -0
- package/dist/lib/containers.mjs +8 -0
- package/dist/lib/containers.mjs.map +1 -0
- package/dist/lib/index.mjs +4 -0
- package/dist/lib/meta.mjs +2 -0
- package/dist/lib/plugin.mjs +8 -0
- package/dist/lib/plugin.mjs.map +1 -0
- package/dist/lib/translations.mjs +28 -0
- package/dist/lib/translations.mjs.map +1 -0
- package/dist/lib/types.mjs +3 -0
- package/dist/lib/util.mjs +2 -0
- package/dist/types/src/GamePlugin.workerd.d.ts.map +1 -1
- package/dist/types/src/capabilities/create-object.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/components/CreateGamePanel.stories.d.ts.map +1 -1
- package/dist/types/src/containers/GameArticle/GameArticle.d.ts +5 -2
- package/dist/types/src/containers/GameArticle/GameArticle.d.ts.map +1 -1
- package/dist/types/src/containers/GameCard/GameCard.d.ts +5 -2
- package/dist/types/src/containers/GameCard/GameCard.d.ts.map +1 -1
- package/dist/types/src/types/Game.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +1 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +9 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/load-game.d.ts +3 -3
- package/dist/types/src/util/load-game.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/dx.config.ts +1 -0
- package/package.json +34 -33
- package/src/GamePlugin.node.tsx +1 -1
- package/src/GamePlugin.tsx +1 -1
- package/src/GamePlugin.workerd.tsx +1 -1
- package/src/capabilities/create-object.ts +3 -3
- package/src/capabilities/{react-surface.tsx → react-surface.ts} +7 -8
- package/src/components/CreateGamePanel.stories.tsx +2 -1
- package/src/containers/GameArticle/GameArticle.tsx +7 -9
- package/src/containers/GameCard/GameCard.tsx +7 -7
- package/src/translations.ts +1 -1
- package/src/types/Game.ts +4 -2
- package/src/types/index.ts +1 -1
- package/src/types/types.ts +9 -5
- package/src/util/load-game.ts +3 -3
- package/dist/lib/neutral/GameArticle-AUJ4YDKW.mjs +0 -40
- package/dist/lib/neutral/GameArticle-AUJ4YDKW.mjs.map +0 -7
- package/dist/lib/neutral/GameCard-QBKHIL4Q.mjs +0 -32
- package/dist/lib/neutral/GameCard-QBKHIL4Q.mjs.map +0 -7
- package/dist/lib/neutral/GamePlugin.mjs +0 -38
- package/dist/lib/neutral/GamePlugin.mjs.map +0 -7
- package/dist/lib/neutral/GamePlugin.node.mjs +0 -21
- package/dist/lib/neutral/GamePlugin.node.mjs.map +0 -7
- package/dist/lib/neutral/GamePlugin.workerd.mjs +0 -18
- package/dist/lib/neutral/GamePlugin.workerd.mjs.map +0 -7
- package/dist/lib/neutral/capabilities/index.mjs +0 -11
- package/dist/lib/neutral/capabilities/index.mjs.map +0 -7
- package/dist/lib/neutral/chunk-DSUJWWNN.mjs +0 -98
- package/dist/lib/neutral/chunk-DSUJWWNN.mjs.map +0 -7
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +0 -10
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs.map +0 -7
- package/dist/lib/neutral/chunk-R4V5PVU7.mjs.map +0 -7
- package/dist/lib/neutral/components/index.mjs +0 -96
- package/dist/lib/neutral/components/index.mjs.map +0 -7
- package/dist/lib/neutral/containers/index.mjs +0 -11
- package/dist/lib/neutral/containers/index.mjs.map +0 -7
- package/dist/lib/neutral/create-object-NXKZWZLR.mjs +0 -51
- package/dist/lib/neutral/create-object-NXKZWZLR.mjs.map +0 -7
- package/dist/lib/neutral/index.mjs +0 -24
- package/dist/lib/neutral/index.mjs.map +0 -7
- package/dist/lib/neutral/meta.json +0 -1
- package/dist/lib/neutral/meta.mjs +0 -8
- package/dist/lib/neutral/meta.mjs.map +0 -7
- package/dist/lib/neutral/plugin.mjs +0 -12
- package/dist/lib/neutral/plugin.mjs.map +0 -7
- package/dist/lib/neutral/react-surface-GO3SKEMA.mjs +0 -35
- package/dist/lib/neutral/react-surface-GO3SKEMA.mjs.map +0 -7
- package/dist/lib/neutral/translations.mjs +0 -34
- package/dist/lib/neutral/translations.mjs.map +0 -7
- package/dist/lib/neutral/types/index.mjs +0 -20
- package/dist/lib/neutral/types/index.mjs.map +0 -7
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/GamePlugin.node.tsx
|
|
4
|
-
import { Plugin } from "@dxos/app-framework";
|
|
5
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
-
import { meta } from "#meta";
|
|
7
|
-
import { translations } from "#translations";
|
|
8
|
-
import { Game } from "#types";
|
|
9
|
-
var GamePlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
|
|
10
|
-
schema: [
|
|
11
|
-
Game
|
|
12
|
-
]
|
|
13
|
-
}), AppPlugin.addTranslationsModule({
|
|
14
|
-
translations
|
|
15
|
-
}), Plugin.make);
|
|
16
|
-
var GamePlugin_node_default = GamePlugin;
|
|
17
|
-
export {
|
|
18
|
-
GamePlugin,
|
|
19
|
-
GamePlugin_node_default as default
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=GamePlugin.node.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/GamePlugin.node.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\nimport { translations } from '#translations';\nimport { Game } from '#types';\n\n/**\n * Headless variant of GamePlugin (no React surfaces / CreateObject panel).\n * Used in node contexts (CLI, agents, tests) where rendering is unavailable —\n * the full variant lazy-loads `CreateGamePanel` from `react-ui-search` which\n * downstream bundlers don't resolve cleanly under nested pnpm symlinks.\n */\nexport const GamePlugin = Plugin.define(meta).pipe(\n AppPlugin.addSchemaModule({ schema: [Game] }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.make,\n);\n\nexport default GamePlugin;\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAC7B,SAASC,YAAY;AAQd,IAAMC,aAAaL,OAAOM,OAAOJ,IAAAA,EAAMK,KAC5CN,UAAUO,gBAAgB;EAAEC,QAAQ;IAACL;;AAAM,CAAA,GAC3CH,UAAUS,sBAAsB;EAAEP;AAAa,CAAA,GAC/CH,OAAOW,IAAI;AAGb,IAAA,0BAAeN;",
|
|
6
|
-
"names": ["Plugin", "AppPlugin", "meta", "translations", "Game", "GamePlugin", "define", "pipe", "addSchemaModule", "schema", "addTranslationsModule", "make"]
|
|
7
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/GamePlugin.workerd.tsx
|
|
4
|
-
import { Plugin } from "@dxos/app-framework";
|
|
5
|
-
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
-
import { meta } from "#meta";
|
|
7
|
-
import { Game } from "#types";
|
|
8
|
-
var GamePlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({
|
|
9
|
-
schema: [
|
|
10
|
-
Game
|
|
11
|
-
]
|
|
12
|
-
}), Plugin.make);
|
|
13
|
-
var GamePlugin_workerd_default = GamePlugin;
|
|
14
|
-
export {
|
|
15
|
-
GamePlugin,
|
|
16
|
-
GamePlugin_workerd_default as default
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=GamePlugin.workerd.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/GamePlugin.workerd.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\n\nimport { meta } from '#meta';\nimport { Game } from '#types';\n\nexport const GamePlugin = Plugin.define(meta).pipe(AppPlugin.addSchemaModule({ schema: [Game] }), Plugin.make);\n\nexport default GamePlugin;\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAE1B,SAASC,YAAY;AACrB,SAASC,YAAY;AAEd,IAAMC,aAAaJ,OAAOK,OAAOH,IAAAA,EAAMI,KAAKL,UAAUM,gBAAgB;EAAEC,QAAQ;IAACL;;AAAM,CAAA,GAAIH,OAAOS,IAAI;AAE7G,IAAA,6BAAeL;",
|
|
6
|
-
"names": ["Plugin", "AppPlugin", "meta", "Game", "GamePlugin", "define", "pipe", "addSchemaModule", "schema", "make"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/capabilities/index.ts
|
|
4
|
-
import { Capability } from "@dxos/app-framework";
|
|
5
|
-
var CreateObject = Capability.lazy("CreateObject", () => import("../create-object-NXKZWZLR.mjs"));
|
|
6
|
-
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-GO3SKEMA.mjs"));
|
|
7
|
-
export {
|
|
8
|
-
CreateObject,
|
|
9
|
-
ReactSurface
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nexport const CreateObject = Capability.lazy('CreateObject', () => import('./create-object'));\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAASA,kBAAkB;AAEpB,IAAMC,eAAeD,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMC,eAAeH,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;",
|
|
6
|
-
"names": ["Capability", "CreateObject", "lazy", "ReactSurface"]
|
|
7
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__export
|
|
3
|
-
} from "./chunk-J5LGTIGS.mjs";
|
|
4
|
-
|
|
5
|
-
// src/types/Game.ts
|
|
6
|
-
import * as Schema from "effect/Schema";
|
|
7
|
-
import { AppAnnotation } from "@dxos/app-toolkit";
|
|
8
|
-
import { Annotation, DXN, Obj, Ref, Type } from "@dxos/echo";
|
|
9
|
-
import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/Annotation";
|
|
10
|
-
var Player = Schema.Struct({
|
|
11
|
-
role: Schema.String.annotations({
|
|
12
|
-
description: 'Variant-defined player role (e.g. "white", "x").'
|
|
13
|
-
}),
|
|
14
|
-
identity: Schema.optional(Schema.String.annotations({
|
|
15
|
-
description: "DID of the player; absent for AI or empty seats."
|
|
16
|
-
})),
|
|
17
|
-
name: Schema.optional(Schema.String.annotations({
|
|
18
|
-
description: "Optional display name for the player."
|
|
19
|
-
}))
|
|
20
|
-
});
|
|
21
|
-
var Game = class extends Type.makeObject(DXN.make("org.dxos.type.game", "0.1.0"))(Schema.Struct({
|
|
22
|
-
name: Schema.optional(Schema.String),
|
|
23
|
-
players: Schema.mutable(Schema.Array(Player)).annotations({
|
|
24
|
-
description: "Players in the game."
|
|
25
|
-
}).pipe(FormInputAnnotation.set(false), Schema.optional),
|
|
26
|
-
variant: Ref.Ref(Obj.Unknown).annotations({
|
|
27
|
-
description: "Reference to variant-specific state object."
|
|
28
|
-
}).pipe(FormInputAnnotation.set(false))
|
|
29
|
-
}).pipe(
|
|
30
|
-
LabelAnnotation.set([
|
|
31
|
-
"name"
|
|
32
|
-
]),
|
|
33
|
-
Annotation.IconAnnotation.set({
|
|
34
|
-
icon: "ph--sword--regular",
|
|
35
|
-
hue: "indigo"
|
|
36
|
-
}),
|
|
37
|
-
AppAnnotation.CardAnnotation.set(true),
|
|
38
|
-
// Delegate the graph-node icon to the referenced variant state's schema. Falls back to
|
|
39
|
-
// the static `ph--sword--regular` above while the variant ref is still loading.
|
|
40
|
-
Annotation.IconFromRefAnnotation.set("variant")
|
|
41
|
-
)) {
|
|
42
|
-
};
|
|
43
|
-
var GameRef = (_variantType) => Ref.Ref(Game);
|
|
44
|
-
var make = ({ name, players, variant }) => {
|
|
45
|
-
return Obj.make(Game, {
|
|
46
|
-
name,
|
|
47
|
-
players: players ? [
|
|
48
|
-
...players
|
|
49
|
-
] : [],
|
|
50
|
-
variant: Ref.make(variant)
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
// src/util/load-game.ts
|
|
55
|
-
import * as Effect from "effect/Effect";
|
|
56
|
-
import { Database, Obj as Obj2, Type as Type2 } from "@dxos/echo";
|
|
57
|
-
var GameVariantMismatchError = class extends Error {
|
|
58
|
-
gameId;
|
|
59
|
-
expectedTypename;
|
|
60
|
-
actualTypename;
|
|
61
|
-
_tag = "GameVariantMismatchError";
|
|
62
|
-
constructor(gameId, expectedTypename, actualTypename) {
|
|
63
|
-
super(`Game ${gameId} variant typename mismatch: expected ${expectedTypename}, got ${actualTypename}.`), this.gameId = gameId, this.expectedTypename = expectedTypename, this.actualTypename = actualTypename;
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
var loadGame = (ref, variantType) => Effect.gen(function* () {
|
|
67
|
-
const game = yield* Database.load(ref);
|
|
68
|
-
const variant = yield* Database.load(game.variant);
|
|
69
|
-
if (!Obj2.instanceOf(variantType, variant)) {
|
|
70
|
-
const expected = Type2.getTypename(variantType) ?? "unknown";
|
|
71
|
-
const actual = Obj2.getTypename(variant) ?? "unknown";
|
|
72
|
-
return yield* Effect.fail(new GameVariantMismatchError(game.id, expected, actual));
|
|
73
|
-
}
|
|
74
|
-
return {
|
|
75
|
-
game,
|
|
76
|
-
variant
|
|
77
|
-
};
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
// src/types/GameCapabilities.ts
|
|
81
|
-
var GameCapabilities_exports = {};
|
|
82
|
-
__export(GameCapabilities_exports, {
|
|
83
|
-
VariantProvider: () => VariantProvider
|
|
84
|
-
});
|
|
85
|
-
import { Capability } from "@dxos/app-framework";
|
|
86
|
-
import { meta } from "#meta";
|
|
87
|
-
var VariantProvider = Capability.make(`${meta.profile.key}.capability.variant`);
|
|
88
|
-
|
|
89
|
-
export {
|
|
90
|
-
Player,
|
|
91
|
-
Game,
|
|
92
|
-
GameRef,
|
|
93
|
-
make,
|
|
94
|
-
GameVariantMismatchError,
|
|
95
|
-
loadGame,
|
|
96
|
-
GameCapabilities_exports
|
|
97
|
-
};
|
|
98
|
-
//# sourceMappingURL=chunk-DSUJWWNN.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/Game.ts", "../../../src/util/load-game.ts", "../../../src/types/GameCapabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AppAnnotation } from '@dxos/app-toolkit';\nimport { Annotation, DXN, Obj, Ref, Type } from '@dxos/echo';\nimport { FormInputAnnotation, LabelAnnotation } from '@dxos/echo/Annotation';\n\n/**\n * A player in a game.\n * `role` is variant-defined (e.g. 'white' | 'black' for chess, 'x' | 'o' for tictactoe).\n * `identity` is the optional DID of a human player; absent for AI or empty seats.\n * `name` is an optional display label (useful for AI/guest players).\n */\nexport const Player = Schema.Struct({\n role: Schema.String.annotations({\n description: 'Variant-defined player role (e.g. \"white\", \"x\").',\n }),\n identity: Schema.optional(\n Schema.String.annotations({\n description: 'DID of the player; absent for AI or empty seats.',\n }),\n ),\n name: Schema.optional(\n Schema.String.annotations({\n description: 'Optional display name for the player.',\n }),\n ),\n});\n\nexport type Player = Schema.Schema.Type<typeof Player>;\n\n/**\n * Base Game object. Variant-specific state lives in a separate referenced object.\n * Unifies all game variants (chess, tic-tac-toe, ...) under one typename so they share\n * graph node, create flow, and shared surface scaffolding.\n */\nexport class Game extends Type.makeObject<Game>(DXN.make('org.dxos.type.game', '0.1.0'))(\n Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.mutable(Schema.Array(Player))\n .annotations({ description: 'Players in the game.' })\n .pipe(FormInputAnnotation.set(false), Schema.optional),\n variant: Ref.Ref(Obj.Unknown)\n .annotations({ description: 'Reference to variant-specific state object.' })\n .pipe(FormInputAnnotation.set(false)),\n }).pipe(\n LabelAnnotation.set(['name']),\n Annotation.IconAnnotation.set({ icon: 'ph--sword--regular', hue: 'indigo' }),\n AppAnnotation.CardAnnotation.set(true),\n // Delegate the graph-node icon to the referenced variant state's schema. Falls back to\n // the static `ph--sword--regular` above while the variant ref is still loading.\n Annotation.IconFromRefAnnotation.set('variant'),\n ),\n) {}\n\n/**\n * Variant-narrowed reference to a Game.\n *\n * Encodes — at the type level — that the variant ref points to a specific state type.\n * Runtime narrowing is performed by `loadGame(ref, variantType)` which validates and\n * returns the resolved Game together with its typed variant state.\n *\n * @example\n * ```ts\n * input: Schema.Struct({\n * game: GameRef(Chess.State),\n * }),\n * // handler:\n * const { game, variant } = yield* loadGame(input.game, Chess.State);\n * // `variant` is typed as Chess.State.\n * ```\n */\nexport type GameRef<_V> = Ref.Ref<Game>;\n\nexport const GameRef = <S extends Type.AnyObj>(_variantType: S) =>\n Ref.Ref(Game) as Schema.Schema<GameRef<Type.InstanceType<S>>, any, never>;\n\n/**\n * Build a base `Game` object referencing the given variant-state ECHO object.\n *\n * The variant is stored as a `Ref` so the underlying state (e.g. `Chess.State`,\n * `TicTacToe.State`) lives as its own ECHO object alongside the Game.\n *\n * @param name Optional display name shown in the graph node and Properties form.\n * @param variant Variant-specific state object (e.g. `Chess.State`, `TicTacToe.State`).\n * @param players Optional initial players; copied into a mutable array on the Game.\n * @returns A new `Game` object with `variant` stored as a Ref.\n */\nexport const make = ({\n name,\n players,\n variant,\n}: {\n name?: string;\n players?: ReadonlyArray<Player>;\n variant: Obj.Unknown;\n}): Game => {\n return Obj.make(Game, {\n name,\n players: players ? [...players] : [],\n variant: Ref.make(variant),\n });\n};\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Database, Obj, type Ref, Type } from '@dxos/echo';\n\nimport { Game } from '../types/Game';\n\nexport class GameVariantMismatchError extends Error {\n readonly _tag = 'GameVariantMismatchError';\n constructor(\n readonly gameId: string,\n readonly expectedTypename: string,\n readonly actualTypename: string,\n ) {\n super(`Game ${gameId} variant typename mismatch: expected ${expectedTypename}, got ${actualTypename}.`);\n }\n}\n\n/**\n * Loads a Game from a Ref and resolves its variant state, asserting the variant matches\n * the expected type. Returns the typed pair.\n *\n * Use in operation handlers that declare `input.game: GameRef<MyVariantState>`.\n */\nexport const loadGame = <S extends Type.AnyObj>(\n ref: Ref.Ref<Game>,\n variantType: S,\n): Effect.Effect<{ game: Game; variant: Type.InstanceType<S> }, Error, Database.Service> =>\n Effect.gen(function* () {\n const game = yield* Database.load(ref);\n const variant = yield* Database.load(game.variant);\n if (!Obj.instanceOf(variantType, variant)) {\n const expected = Type.getTypename(variantType) ?? 'unknown';\n const actual = Obj.getTypename(variant as Obj.Any) ?? 'unknown';\n return yield* Effect.fail(new GameVariantMismatchError(game.id, expected, actual));\n }\n return { game, variant: variant as Type.InstanceType<S> };\n });\n", "//\n// Copyright 2026 DXOS.org\n//\n\n// @import-as-namespace\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport type { GameVariant } from './types';\n\n/**\n * A game variant contribution. Each variant plugin (chess, tic-tac-toe, ...)\n * contributes one of these via `Capability.contributes(GameCapabilities.VariantProvider, variant)`.\n * Consumers iterate via `Capability.getAll(GameCapabilities.VariantProvider)` (Effect) or\n * `useCapabilities(GameCapabilities.VariantProvider)` (React).\n */\nexport const VariantProvider = Capability.make<GameVariant>(`${meta.profile.key}.capability.variant`);\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,qBAAqB;AAC9B,SAASC,YAAYC,KAAKC,KAAKC,KAAKC,YAAY;AAChD,SAASC,qBAAqBC,uBAAuB;AAQ9C,IAAMC,SAAgBC,cAAO;EAClCC,MAAaC,cAAOC,YAAY;IAC9BC,aAAa;EACf,CAAA;EACAC,UAAiBC,gBACRJ,cAAOC,YAAY;IACxBC,aAAa;EACf,CAAA,CAAA;EAEFG,MAAaD,gBACJJ,cAAOC,YAAY;IACxBC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA;AASO,IAAMI,OAAN,cAAmBZ,KAAKa,WAAiBhB,IAAIiB,KAAK,sBAAsB,OAAA,CAAA,EACtEV,cAAO;EACZO,MAAaD,gBAAgBJ,aAAM;EACnCS,SAAgBC,eAAeC,aAAMd,MAAAA,CAAAA,EAClCI,YAAY;IAAEC,aAAa;EAAuB,CAAA,EAClDU,KAAKjB,oBAAoBkB,IAAI,KAAA,GAAeT,eAAQ;EACvDU,SAASrB,IAAIA,IAAID,IAAIuB,OAAO,EACzBd,YAAY;IAAEC,aAAa;EAA8C,CAAA,EACzEU,KAAKjB,oBAAoBkB,IAAI,KAAA,CAAA;AAClC,CAAA,EAAGD;EACDhB,gBAAgBiB,IAAI;IAAC;GAAO;EAC5BvB,WAAW0B,eAAeH,IAAI;IAAEI,MAAM;IAAsBC,KAAK;EAAS,CAAA;EAC1E7B,cAAc8B,eAAeN,IAAI,IAAA;;;EAGjCvB,WAAW8B,sBAAsBP,IAAI,SAAA;AAAA,CAAA,EAAA;AAEtC;AAqBI,IAAMQ,UAAU,CAAwBC,iBAC7C7B,IAAIA,IAAIa,IAAAA;AAaH,IAAME,OAAO,CAAC,EACnBH,MACAI,SACAK,QAAO,MAKR;AACC,SAAOtB,IAAIgB,KAAKF,MAAM;IACpBD;IACAI,SAASA,UAAU;SAAIA;QAAW,CAAA;IAClCK,SAASrB,IAAIe,KAAKM,OAAAA;EACpB,CAAA;AACF;;;ACrGA,YAAYS,YAAY;AAExB,SAASC,UAAUC,OAAAA,MAAeC,QAAAA,aAAY;AAIvC,IAAMC,2BAAN,cAAuCC,MAAAA;;;;EACnCC,OAAO;EAChB,YACWC,QACAC,kBACAC,gBACT;AACA,UAAM,QAAQF,MAAAA,wCAA8CC,gBAAAA,SAAyBC,cAAAA,GAAiB,GAAA,KAJ7FF,SAAAA,QAAAA,KACAC,mBAAAA,kBAAAA,KACAC,iBAAAA;EAGX;AACF;AAQO,IAAMC,WAAW,CACtBC,KACAC,gBAEOC,WAAI,aAAA;AACT,QAAMC,OAAO,OAAOb,SAASc,KAAKJ,GAAAA;AAClC,QAAMK,UAAU,OAAOf,SAASc,KAAKD,KAAKE,OAAO;AACjD,MAAI,CAACd,KAAIe,WAAWL,aAAaI,OAAAA,GAAU;AACzC,UAAME,WAAWf,MAAKgB,YAAYP,WAAAA,KAAgB;AAClD,UAAMQ,SAASlB,KAAIiB,YAAYH,OAAAA,KAAuB;AACtD,WAAO,OAAcK,YAAK,IAAIjB,yBAAyBU,KAAKQ,IAAIJ,UAAUE,MAAAA,CAAAA;EAC5E;AACA,SAAO;IAAEN;IAAME;EAAyC;AAC1D,CAAA;;;ACxCF;;;;AAMA,SAASO,kBAAkB;AAE3B,SAASC,YAAY;AAUd,IAAMC,kBAAkBF,WAAWG,KAAkB,GAAGF,KAAKG,QAAQC,GAAG,qBAAqB;",
|
|
6
|
-
"names": ["Schema", "AppAnnotation", "Annotation", "DXN", "Obj", "Ref", "Type", "FormInputAnnotation", "LabelAnnotation", "Player", "Struct", "role", "String", "annotations", "description", "identity", "optional", "name", "Game", "makeObject", "make", "players", "mutable", "Array", "pipe", "set", "variant", "Unknown", "IconAnnotation", "icon", "hue", "CardAnnotation", "IconFromRefAnnotation", "GameRef", "_variantType", "Effect", "Database", "Obj", "Type", "GameVariantMismatchError", "Error", "_tag", "gameId", "expectedTypename", "actualTypename", "loadGame", "ref", "variantType", "gen", "game", "load", "variant", "instanceOf", "expected", "getTypename", "actual", "fail", "id", "Capability", "meta", "VariantProvider", "make", "profile", "key"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/meta.ts", "../../../dx.config.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport config from '../dx.config';\n\nexport const meta = Plugin.getMetaFromConfig(config);\n", "//\n// Copyright 2026 DXOS.org\n//\n\nimport { Config2 } from '@dxos/app-framework/config';\nimport { trim } from '@dxos/util';\n\nexport default Config2.make({\n plugin: {\n key: 'org.dxos.plugin.game',\n name: 'Game',\n author: 'DXOS',\n description: trim`\n Generic game host plugin that provides shared infrastructure for local-first,\n multi-player turn-based games inside DXOS Composer. The plugin owns the base\n \\`Game\\` ECHO type — which stores players and a reference to variant-specific\n state — and drives the two-stage game-creation flow (variant picker + optional\n input form).\n\n Game variants (chess, tic-tac-toe, and others) are contributed by separate\n plugins via the \\`GameCapabilities.VariantProvider\\` capability. Each variant supplies\n its own state schema, player roles, create factory, and surface components\n (Article and Card). Plugin-game resolves the correct variant at runtime and\n delegates rendering, keeping the host layer fully decoupled from game logic.\n\n Variant state objects are stored as hidden ECHO objects alongside the top-level\n \\`Game\\`, ensuring they replicate to all peers but do not appear as independent\n items in the user's space graph. The entire creation flow is atomic: if the\n Game write fails, the variant state is rolled back automatically.\n `,\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-game',\n icon: { key: 'ph--sword--regular', hue: 'indigo' },\n spec: 'PLUGIN.mdl',\n screenshots: [\n {\n dark: 'https://customer-5rxcjpyab08avpmn.cloudflarestream.com/2797d56edc9658d018ad75fe48a47f27/iframe?poster=https%3A%2F%2Fcustomer-5rxcjpyab08avpmn.cloudflarestream.com%2F2797d56edc9658d018ad75fe48a47f27%2Fthumbnails%2Fthumbnail.jpg%3Ftime%3D%26height%3D600',\n },\n ],\n },\n});\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,cAAc;;;ACAvB,SAASC,eAAe;AACxB,SAASC,YAAY;AAErB,IAAA,oBAAeD,QAAQE,KAAK;EAC1BC,QAAQ;IACNC,KAAK;IACLC,MAAM;IACNC,QAAQ;IACRC,aAAaN;;;;;;;;;;;;;;;;;;IAkBbO,QAAQ;IACRC,MAAM;MAAEL,KAAK;MAAsBM,KAAK;IAAS;IACjDC,MAAM;IACNC,aAAa;MACX;QACEC,MAAM;MACR;;EAEJ;AACF,CAAA;;;AD/BO,IAAMC,OAAOC,OAAOC,kBAAkBC,iBAAAA;",
|
|
6
|
-
"names": ["Plugin", "Config2", "trim", "make", "plugin", "key", "name", "author", "description", "source", "icon", "hue", "spec", "screenshots", "dark", "meta", "Plugin", "getMetaFromConfig", "config"]
|
|
7
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/components/CreateGamePanel.tsx
|
|
4
|
-
import React, { useCallback, useMemo, useState } from "react";
|
|
5
|
-
import { useCapabilities } from "@dxos/app-framework/ui";
|
|
6
|
-
import { Obj } from "@dxos/echo";
|
|
7
|
-
import { Column, useTranslation } from "@dxos/react-ui";
|
|
8
|
-
import { Form, omitId } from "@dxos/react-ui-form";
|
|
9
|
-
import { SearchList, useSearchListResults } from "@dxos/react-ui-search";
|
|
10
|
-
import { meta } from "#meta";
|
|
11
|
-
import { GameCapabilities } from "#types";
|
|
12
|
-
var CreateGamePanel = ({ target, onCreateObject, variants: variantsProp }) => {
|
|
13
|
-
const capabilityVariants = useCapabilities(GameCapabilities.VariantProvider);
|
|
14
|
-
const variants = variantsProp ?? capabilityVariants;
|
|
15
|
-
const [selectedId, setSelectedId] = useState(void 0);
|
|
16
|
-
const selected = useMemo(() => variants.find((v) => v.id === selectedId), [
|
|
17
|
-
variants,
|
|
18
|
-
selectedId
|
|
19
|
-
]);
|
|
20
|
-
const handleSelect = useCallback((id) => {
|
|
21
|
-
const variant = variants.find((v) => v.id === id);
|
|
22
|
-
if (!variant) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
if (!variant.inputSchema) {
|
|
26
|
-
void onCreateObject({
|
|
27
|
-
variantId: id
|
|
28
|
-
});
|
|
29
|
-
return;
|
|
30
|
-
}
|
|
31
|
-
setSelectedId(id);
|
|
32
|
-
}, [
|
|
33
|
-
variants,
|
|
34
|
-
onCreateObject
|
|
35
|
-
]);
|
|
36
|
-
const handleSubmit = useCallback((input) => {
|
|
37
|
-
if (!selected) {
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
void onCreateObject({
|
|
41
|
-
variantId: selected.id,
|
|
42
|
-
input
|
|
43
|
-
});
|
|
44
|
-
}, [
|
|
45
|
-
selected,
|
|
46
|
-
onCreateObject
|
|
47
|
-
]);
|
|
48
|
-
if (!selected) {
|
|
49
|
-
return /* @__PURE__ */ React.createElement(VariantPicker, {
|
|
50
|
-
variants,
|
|
51
|
-
onSelect: handleSelect
|
|
52
|
-
});
|
|
53
|
-
}
|
|
54
|
-
const schema = selected.inputSchema ? omitId(selected.inputSchema) : void 0;
|
|
55
|
-
if (!schema) {
|
|
56
|
-
return null;
|
|
57
|
-
}
|
|
58
|
-
return /* @__PURE__ */ React.createElement(Form.Root, {
|
|
59
|
-
autoFocus: true,
|
|
60
|
-
schema,
|
|
61
|
-
defaultValues: {},
|
|
62
|
-
db: Obj.isObject(target) ? Obj.getDatabase(target) : target,
|
|
63
|
-
onSave: handleSubmit,
|
|
64
|
-
testId: "create-game-form"
|
|
65
|
-
}, /* @__PURE__ */ React.createElement(Column.Center, null, /* @__PURE__ */ React.createElement(Form.Content, null, /* @__PURE__ */ React.createElement(Form.FieldSet, null), /* @__PURE__ */ React.createElement(Form.Submit, null))));
|
|
66
|
-
};
|
|
67
|
-
var VariantPicker = ({ variants, onSelect }) => {
|
|
68
|
-
const { t } = useTranslation(meta.profile.key);
|
|
69
|
-
const sorted = useMemo(() => [
|
|
70
|
-
...variants
|
|
71
|
-
].sort((a, b) => a.label.localeCompare(b.label)), [
|
|
72
|
-
variants
|
|
73
|
-
]);
|
|
74
|
-
const { results, handleSearch } = useSearchListResults({
|
|
75
|
-
items: sorted,
|
|
76
|
-
extract: (variant) => variant.label
|
|
77
|
-
});
|
|
78
|
-
return /* @__PURE__ */ React.createElement(SearchList.Root, {
|
|
79
|
-
onSearch: handleSearch
|
|
80
|
-
}, /* @__PURE__ */ React.createElement(SearchList.Input, {
|
|
81
|
-
classNames: "mb-form-gap",
|
|
82
|
-
autoFocus: true,
|
|
83
|
-
"data-testid": "create-game-panel.variant-input",
|
|
84
|
-
placeholder: t("create-panel.variant.placeholder")
|
|
85
|
-
}), /* @__PURE__ */ React.createElement(SearchList.Viewport, null, results.map((variant) => /* @__PURE__ */ React.createElement(SearchList.Item, {
|
|
86
|
-
key: variant.id,
|
|
87
|
-
value: variant.id,
|
|
88
|
-
label: variant.label,
|
|
89
|
-
icon: variant.icon ?? "ph--sword--regular",
|
|
90
|
-
onSelect: () => onSelect(variant.id)
|
|
91
|
-
}))));
|
|
92
|
-
};
|
|
93
|
-
export {
|
|
94
|
-
CreateGamePanel
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/components/CreateGamePanel.tsx"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport React, { useCallback, useMemo, useState } from 'react';\n\nimport { useCapabilities } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { type SpaceCapabilities } from '@dxos/plugin-space';\nimport { Column, useTranslation } from '@dxos/react-ui';\nimport { Form, omitId } from '@dxos/react-ui-form';\nimport { SearchList, useSearchListResults } from '@dxos/react-ui-search';\n\nimport { meta } from '#meta';\nimport { GameCapabilities, type GameVariant } from '#types';\n\nexport type CreateGamePanelProps = SpaceCapabilities.CreateObjectCustomPanelProps & {\n /** Optional override (primarily for stories/tests). Defaults to GameCapabilities.VariantProvider. */\n variants?: GameVariant[];\n};\n\n/**\n * Two-stage create panel for games:\n * 1. Variant picker (SearchList over contributed `GameVariant[]`).\n * 2. Variant-specific input form (rendered from variant.inputSchema).\n *\n * On submit, calls `onCreateObject({ variantId, name, input })` where `input` is the\n * variant-specific form values. Plugin-game's CreateObjectEntry.createObject resolves\n * the variantId, builds the variant state object via variant.createVariant, then wraps\n * it in a Game.\n */\nexport const CreateGamePanel = ({ target, onCreateObject, variants: variantsProp }: CreateGamePanelProps) => {\n const capabilityVariants = useCapabilities(GameCapabilities.VariantProvider);\n const variants = variantsProp ?? capabilityVariants;\n const [selectedId, setSelectedId] = useState<string | undefined>(undefined);\n const selected = useMemo(() => variants.find((v) => v.id === selectedId), [variants, selectedId]);\n\n const handleSelect = useCallback(\n (id: string) => {\n const variant = variants.find((v) => v.id === id);\n if (!variant) {\n return;\n }\n if (!variant.inputSchema) {\n void onCreateObject({ variantId: id });\n return;\n }\n setSelectedId(id);\n },\n [variants, onCreateObject],\n );\n\n const handleSubmit = useCallback(\n (input: Record<string, any>) => {\n if (!selected) {\n return;\n }\n void onCreateObject({ variantId: selected.id, input });\n },\n [selected, onCreateObject],\n );\n\n if (!selected) {\n return <VariantPicker variants={variants} onSelect={handleSelect} />;\n }\n\n const schema = selected.inputSchema ? omitId(selected.inputSchema) : undefined;\n if (!schema) {\n return null;\n }\n\n return (\n <Form.Root\n autoFocus\n schema={schema}\n defaultValues={{}}\n db={Obj.isObject(target) ? Obj.getDatabase(target) : target}\n onSave={handleSubmit}\n testId='create-game-form'\n >\n {/* Rendered inside the create dialog's Dialog.Body (which owns the gutter Column); use\n Column.Center to align with the dialog title rather than nesting another Column.Root. */}\n <Column.Center>\n <Form.Content>\n <Form.FieldSet />\n <Form.Submit />\n </Form.Content>\n </Column.Center>\n </Form.Root>\n );\n};\n\ntype VariantPickerProps = {\n variants: GameVariant[];\n onSelect: (id: string) => void;\n};\n\nconst VariantPicker = ({ variants, onSelect }: VariantPickerProps) => {\n const { t } = useTranslation(meta.profile.key);\n const sorted = useMemo(() => [...variants].sort((a, b) => a.label.localeCompare(b.label)), [variants]);\n const { results, handleSearch } = useSearchListResults({\n items: sorted,\n extract: (variant) => variant.label,\n });\n\n return (\n <SearchList.Root onSearch={handleSearch}>\n <SearchList.Input\n classNames='mb-form-gap'\n autoFocus\n data-testid='create-game-panel.variant-input'\n placeholder={t('create-panel.variant.placeholder')}\n />\n <SearchList.Viewport>\n {results.map((variant) => (\n <SearchList.Item\n key={variant.id}\n value={variant.id}\n label={variant.label}\n icon={variant.icon ?? 'ph--sword--regular'}\n onSelect={() => onSelect(variant.id)}\n />\n ))}\n </SearchList.Viewport>\n </SearchList.Root>\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;AAIA,OAAOA,SAASC,aAAaC,SAASC,gBAAgB;AAEtD,SAASC,uBAAuB;AAChC,SAASC,WAAW;AAEpB,SAASC,QAAQC,sBAAsB;AACvC,SAASC,MAAMC,cAAc;AAC7B,SAASC,YAAYC,4BAA4B;AAEjD,SAASC,YAAY;AACrB,SAASC,wBAA0C;AAiB5C,IAAMC,kBAAkB,CAAC,EAAEC,QAAQC,gBAAgBC,UAAUC,aAAY,MAAwB;AACtG,QAAMC,qBAAqBf,gBAAgBS,iBAAiBO,eAAe;AAC3E,QAAMH,WAAWC,gBAAgBC;AACjC,QAAM,CAACE,YAAYC,aAAAA,IAAiBnB,SAA6BoB,MAAAA;AACjE,QAAMC,WAAWtB,QAAQ,MAAMe,SAASQ,KAAK,CAACC,MAAMA,EAAEC,OAAON,UAAAA,GAAa;IAACJ;IAAUI;GAAW;AAEhG,QAAMO,eAAe3B,YACnB,CAAC0B,OAAAA;AACC,UAAME,UAAUZ,SAASQ,KAAK,CAACC,MAAMA,EAAEC,OAAOA,EAAAA;AAC9C,QAAI,CAACE,SAAS;AACZ;IACF;AACA,QAAI,CAACA,QAAQC,aAAa;AACxB,WAAKd,eAAe;QAAEe,WAAWJ;MAAG,CAAA;AACpC;IACF;AACAL,kBAAcK,EAAAA;EAChB,GACA;IAACV;IAAUD;GAAe;AAG5B,QAAMgB,eAAe/B,YACnB,CAACgC,UAAAA;AACC,QAAI,CAACT,UAAU;AACb;IACF;AACA,SAAKR,eAAe;MAAEe,WAAWP,SAASG;MAAIM;IAAM,CAAA;EACtD,GACA;IAACT;IAAUR;GAAe;AAG5B,MAAI,CAACQ,UAAU;AACb,WAAO,sBAAA,cAACU,eAAAA;MAAcjB;MAAoBkB,UAAUP;;EACtD;AAEA,QAAMQ,SAASZ,SAASM,cAAcrB,OAAOe,SAASM,WAAW,IAAIP;AACrE,MAAI,CAACa,QAAQ;AACX,WAAO;EACT;AAEA,SACE,sBAAA,cAAC5B,KAAK6B,MAAI;IACRC,WAAAA;IACAF;IACAG,eAAe,CAAC;IAChBC,IAAInC,IAAIoC,SAAS1B,MAAAA,IAAUV,IAAIqC,YAAY3B,MAAAA,IAAUA;IACrD4B,QAAQX;IACRY,QAAO;KAIP,sBAAA,cAACtC,OAAOuC,QAAM,MACZ,sBAAA,cAACrC,KAAKsC,SAAO,MACX,sBAAA,cAACtC,KAAKuC,UAAQ,IAAA,GACd,sBAAA,cAACvC,KAAKwC,QAAM,IAAA,CAAA,CAAA,CAAA;AAKtB;AAOA,IAAMd,gBAAgB,CAAC,EAAEjB,UAAUkB,SAAQ,MAAsB;AAC/D,QAAM,EAAEc,EAAC,IAAK1C,eAAeK,KAAKsC,QAAQC,GAAG;AAC7C,QAAMC,SAASlD,QAAQ,MAAM;OAAIe;IAAUoC,KAAK,CAACC,GAAGC,MAAMD,EAAEE,MAAMC,cAAcF,EAAEC,KAAK,CAAA,GAAI;IAACvC;GAAS;AACrG,QAAM,EAAEyC,SAASC,aAAY,IAAKhD,qBAAqB;IACrDiD,OAAOR;IACPS,SAAS,CAAChC,YAAYA,QAAQ2B;EAChC,CAAA;AAEA,SACE,sBAAA,cAAC9C,WAAW2B,MAAI;IAACyB,UAAUH;KACzB,sBAAA,cAACjD,WAAWqD,OAAK;IACfC,YAAW;IACX1B,WAAAA;IACA2B,eAAY;IACZC,aAAajB,EAAE,kCAAA;MAEjB,sBAAA,cAACvC,WAAWyD,UAAQ,MACjBT,QAAQU,IAAI,CAACvC,YACZ,sBAAA,cAACnB,WAAW2D,MAAI;IACdlB,KAAKtB,QAAQF;IACb2C,OAAOzC,QAAQF;IACf6B,OAAO3B,QAAQ2B;IACfe,MAAM1C,QAAQ0C,QAAQ;IACtBpC,UAAU,MAAMA,SAASN,QAAQF,EAAE;;AAM/C;",
|
|
6
|
-
"names": ["React", "useCallback", "useMemo", "useState", "useCapabilities", "Obj", "Column", "useTranslation", "Form", "omitId", "SearchList", "useSearchListResults", "meta", "GameCapabilities", "CreateGamePanel", "target", "onCreateObject", "variants", "variantsProp", "capabilityVariants", "VariantProvider", "selectedId", "setSelectedId", "undefined", "selected", "find", "v", "id", "handleSelect", "variant", "inputSchema", "variantId", "handleSubmit", "input", "VariantPicker", "onSelect", "schema", "Root", "autoFocus", "defaultValues", "db", "isObject", "getDatabase", "onSave", "testId", "Center", "Content", "FieldSet", "Submit", "t", "profile", "key", "sorted", "sort", "a", "b", "label", "localeCompare", "results", "handleSearch", "items", "extract", "onSearch", "Input", "classNames", "data-testid", "placeholder", "Viewport", "map", "Item", "value", "icon"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
-
|
|
3
|
-
// src/containers/index.ts
|
|
4
|
-
import { lazy } from "react";
|
|
5
|
-
var GameArticle = lazy(() => import("../GameArticle-AUJ4YDKW.mjs"));
|
|
6
|
-
var GameCard = lazy(() => import("../GameCard-QBKHIL4Q.mjs"));
|
|
7
|
-
export {
|
|
8
|
-
GameArticle,
|
|
9
|
-
GameCard
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/containers/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const GameArticle: ComponentType<any> = lazy(() => import('./GameArticle'));\nexport const GameCard: ComponentType<any> = lazy(() => import('./GameCard'));\n"],
|
|
5
|
-
"mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,cAAkCD,KAAK,MAAM,OAAO,6BAAA,CAAA;AAC1D,IAAME,WAA+BF,KAAK,MAAM,OAAO,0BAAA,CAAA;",
|
|
6
|
-
"names": ["lazy", "GameArticle", "GameCard"]
|
|
7
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Game,
|
|
3
|
-
GameCapabilities_exports,
|
|
4
|
-
make
|
|
5
|
-
} from "./chunk-DSUJWWNN.mjs";
|
|
6
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
7
|
-
|
|
8
|
-
// src/capabilities/create-object.ts
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import { Capability } from "@dxos/app-framework";
|
|
11
|
-
import { Operation } from "@dxos/compute";
|
|
12
|
-
import { Database, Type } from "@dxos/echo";
|
|
13
|
-
import { invariant } from "@dxos/invariant";
|
|
14
|
-
import { SpaceOperation } from "@dxos/plugin-space";
|
|
15
|
-
import { SpaceCapabilities } from "@dxos/plugin-space";
|
|
16
|
-
import { CreateGamePanel } from "#components";
|
|
17
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-game/src/capabilities/create-object.ts";
|
|
18
|
-
var create_object_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
19
|
-
return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {
|
|
20
|
-
id: Type.getTypename(Game),
|
|
21
|
-
customPanel: CreateGamePanel,
|
|
22
|
-
createObject: ({ variantId, input }, options) => Effect.gen(function* () {
|
|
23
|
-
const variants = yield* Capability.getAll(GameCapabilities_exports.VariantProvider);
|
|
24
|
-
const variant = variants.find((v) => v.id === variantId);
|
|
25
|
-
invariant(variant, `Unknown game variant: ${variantId}`, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 20, S: this, A: ["variant", "`Unknown game variant: ${variantId}`"] });
|
|
26
|
-
const stateObject = yield* variant.createVariant(input ?? {}).pipe(Effect.provideService(Database.Service, Database.makeService(options.db)));
|
|
27
|
-
yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
28
|
-
object: stateObject,
|
|
29
|
-
target: options.target,
|
|
30
|
-
targetNodeId: options.targetNodeId
|
|
31
|
-
});
|
|
32
|
-
const game = make({
|
|
33
|
-
name: typeof input?.name === "string" ? input.name : void 0,
|
|
34
|
-
variant: stateObject
|
|
35
|
-
});
|
|
36
|
-
return yield* Operation.invoke(SpaceOperation.AddObject, {
|
|
37
|
-
object: game,
|
|
38
|
-
target: options.target,
|
|
39
|
-
targetNodeId: options.targetNodeId
|
|
40
|
-
}).pipe(Effect.tapError(() => Operation.invoke(SpaceOperation.RemoveObjects, {
|
|
41
|
-
objects: [
|
|
42
|
-
stateObject
|
|
43
|
-
]
|
|
44
|
-
}).pipe(Effect.ignore)));
|
|
45
|
-
})
|
|
46
|
-
});
|
|
47
|
-
}));
|
|
48
|
-
export {
|
|
49
|
-
create_object_default as default
|
|
50
|
-
};
|
|
51
|
-
//# sourceMappingURL=create-object-NXKZWZLR.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/create-object.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { Operation } from '@dxos/compute';\nimport { Database, Type } from '@dxos/echo';\nimport { invariant } from '@dxos/invariant';\nimport { SpaceOperation } from '@dxos/plugin-space';\nimport { SpaceCapabilities } from '@dxos/plugin-space';\n\nimport { CreateGamePanel } from '#components';\n\nimport { Game, GameCapabilities, make as makeGame } from '../types';\n\ntype CreateOptions = Parameters<SpaceCapabilities.CreateObjectEntry['createObject']>[1];\n\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n return Capability.contributes(SpaceCapabilities.CreateObjectEntry, {\n id: Type.getTypename(Game),\n customPanel: CreateGamePanel,\n createObject: (\n { variantId, input }: { variantId: string; input?: Record<string, any> },\n options: CreateOptions,\n ) =>\n Effect.gen(function* () {\n const variants = yield* Capability.getAll(GameCapabilities.VariantProvider);\n const variant = variants.find((v) => v.id === variantId);\n invariant(variant, `Unknown game variant: ${variantId}`);\n\n // Build variant state object via the variant's factory.\n const stateObject = yield* variant\n .createVariant(input ?? {})\n .pipe(Effect.provideService(Database.Service, Database.makeService(options.db)));\n\n // Add variant state to the database. Stays hidden — it's referenced by Game and\n // shouldn't appear as a top-level item in the user's space.\n yield* Operation.invoke(SpaceOperation.AddObject, {\n object: stateObject,\n target: options.target,\n targetNodeId: options.targetNodeId,\n });\n\n const game = makeGame({\n name: typeof input?.name === 'string' ? input.name : undefined,\n variant: stateObject,\n });\n\n // Add the user-facing Game wrapper. Not hidden — this is the object the user sees\n // and navigates to. If this second write fails, roll back the variant state so we\n // don't leak an orphaned object into the space.\n return yield* Operation.invoke(SpaceOperation.AddObject, {\n object: game,\n target: options.target,\n targetNodeId: options.targetNodeId,\n }).pipe(\n Effect.tapError(() =>\n Operation.invoke(SpaceOperation.RemoveObjects, { objects: [stateObject] }).pipe(Effect.ignore),\n ),\n );\n }),\n });\n }),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,YAAY;AAC/B,SAASC,iBAAiB;AAC1B,SAASC,sBAAsB;AAC/B,SAASC,yBAAyB;AAElC,SAASC,uBAAuB;AAMhC,IAAA,eAAeC;4BAGLC,WAAKC,WAAYC,kBAAAA,aAAAA;SACrBC,WAAaC,YAAAA,kBAAAA,mBAAAA;IACbC,IAAAA,KAAAA,YACIC,IAAAA;iBAIA;kBACMC,CAAAA,EAAAA,WAAUC,MAASC,GAAI,YAAiBH,WAAAA,aAAAA;AAC9CI,YAAAA,WAAUH,OAAU,WAAA,OAAsB,yBAAa,eAAA;AAEvD,YAAA,UAAA,SAAA,KAAA,CAAA,MAAA,EAAA,OAAA,SAAA;AACA,gBAAMI,SAAAA,yBACHC,SAAcC,IAAAA,EAAAA,YACTC,YAAOC,GAAAA,cAAeC,GAAAA,IAASC,GAAAA,MAAO,GAAED,CAAAA,WAASE,sCAAsB,EAAA,CAAA;AAG/E,YAAA,cAAA,OAAA,QAAA,cAAA,SAAA,CAAA,CAA4D,EAAA,KAAA,sBAAA,SAAA,SAAA,SAAA,YAAA,QAAA,EAAA,CAAA,CAAA;aAG1DC,UAAQC,OAAQD,eAAM,WAAA;QACtBE,QAAAA;QACF,QAAA,QAAA;QAEA,cAAaC,QAAS;;YAEpBf,OAASI,KAAAA;QACX,MAAA,OAAA,OAAA,SAAA,WAAA,MAAA,OAAA;QAEA,SAAA;MACA,CAAA;aAIEQ,OAAQC,UAAQD,OAAM,eAAA,WAAA;QACtBE,QAAAA;QACCE,QACDT,QAAOU;sBACqD,QAAA;cAACb,gBAAAA,MAAAA,UAAAA,OAAAA,eAAAA,eAAAA;iBAAY;UAASG;QAGtF;MACJ,CAAA,EAAA,KAAA,aAAA,CAAA,CAAA;IAEF,CAAA;;;",
|
|
6
|
-
"names": ["Effect", "Capability", "Operation", "Database", "Type", "invariant", "SpaceOperation", "SpaceCapabilities", "CreateGamePanel", "Capability", "Type", "getTypename", "Game", "customPanel", "CreateGamePanel", "createObject", "variantId", "variant", "variants", "find", "invariant", "stateObject", "createVariant", "input", "Effect", "provideService", "Database", "Service", "makeService", "target", "options", "targetNodeId", "makeGame", "pipe", "tapError"]
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Game,
|
|
3
|
-
GameCapabilities_exports,
|
|
4
|
-
GameRef,
|
|
5
|
-
GameVariantMismatchError,
|
|
6
|
-
Player,
|
|
7
|
-
loadGame,
|
|
8
|
-
make
|
|
9
|
-
} from "./chunk-DSUJWWNN.mjs";
|
|
10
|
-
import {
|
|
11
|
-
meta
|
|
12
|
-
} from "./chunk-R4V5PVU7.mjs";
|
|
13
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
14
|
-
export {
|
|
15
|
-
Game,
|
|
16
|
-
GameCapabilities_exports as GameCapabilities,
|
|
17
|
-
GameRef,
|
|
18
|
-
GameVariantMismatchError,
|
|
19
|
-
Player,
|
|
20
|
-
loadGame,
|
|
21
|
-
make,
|
|
22
|
-
meta
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"inputs":{"dx.config.ts":{"bytes":5243,"imports":[{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":799,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dx.config.ts","kind":"import-statement","original":"../dx.config"}],"format":"esm"},"src/types/Game.ts":{"bytes":10462,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/Annotation","kind":"import-statement","external":true}],"format":"esm"},"src/types/types.ts":{"bytes":3160,"imports":[],"format":"esm"},"src/util/load-game.ts":{"bytes":4773,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"format":"esm"},"src/types/GameCapabilities.ts":{"bytes":1968,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/types/index.ts":{"bytes":1103,"imports":[{"path":"src/types/Game.ts","kind":"import-statement","original":"./Game"},{"path":"src/types/types.ts","kind":"import-statement","original":"./types"},{"path":"src/util/load-game.ts","kind":"import-statement","original":"../util/load-game"},{"path":"src/types/GameCapabilities.ts","kind":"import-statement","original":"./GameCapabilities"}],"format":"esm"},"src/index.ts":{"bytes":449,"imports":[{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-game/PLUGIN.mdl":{"bytes":10857,"imports":[]},"src/GamePlugin.tsx":{"bytes":3560,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true},{"path":"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-game/PLUGIN.mdl","kind":"import-statement","original":"../PLUGIN.mdl?raw"}],"format":"esm"},"src/GamePlugin.node.tsx":{"bytes":2636,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/GamePlugin.workerd.tsx":{"bytes":1487,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/create-object.ts":{"bytes":9209,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":4251,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1130,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/create-object.ts","kind":"dynamic-import","original":"./create-object"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/components/CreateGamePanel.tsx":{"bytes":13579,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-search","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/components/index.ts":{"bytes":395,"imports":[{"path":"src/components/CreateGamePanel.tsx","kind":"import-statement","original":"./CreateGamePanel"}],"format":"esm"},"src/containers/GameArticle/GameArticle.tsx":{"bytes":5293,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/containers/GameArticle/index.ts":{"bytes":496,"imports":[{"path":"src/containers/GameArticle/GameArticle.tsx","kind":"import-statement","original":"./GameArticle"}],"format":"esm"},"src/containers/GameCard/GameCard.tsx":{"bytes":3650,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/containers/GameCard/index.ts":{"bytes":478,"imports":[{"path":"src/containers/GameCard/GameCard.tsx","kind":"import-statement","original":"./GameCard"}],"format":"esm"},"src/containers/index.ts":{"bytes":936,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/GameArticle/index.ts","kind":"dynamic-import","original":"./GameArticle"},{"path":"src/containers/GameCard/index.ts","kind":"dynamic-import","original":"./GameCard"}],"format":"esm"},"src/plugin.ts":{"bytes":849,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3308,"imports":[{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":436},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-R4V5PVU7.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#plugin","kind":"dynamic-import","external":true}],"exports":["GamePlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":107}},"bytes":264},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1589},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["translations"],"entryPoint":"src/translations.ts","inputs":{"src/translations.ts":{"bytesInOutput":871}},"bytes":995},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DSUJWWNN.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Game","GameCapabilities","GameRef","GameVariantMismatchError","Player","loadGame","make"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":348},"dist/lib/neutral/create-object-NXKZWZLR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4264},"dist/lib/neutral/create-object-NXKZWZLR.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DSUJWWNN.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/invariant","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/create-object.ts","inputs":{"src/capabilities/create-object.ts":{"bytesInOutput":1918}},"bytes":2169},"dist/lib/neutral/react-surface-GO3SKEMA.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2220},"dist/lib/neutral/react-surface-GO3SKEMA.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DSUJWWNN.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit/ui","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":983}},"bytes":1199},"dist/lib/neutral/GameArticle-AUJ4YDKW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2753},"dist/lib/neutral/GameArticle-AUJ4YDKW.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/GameArticle/index.ts","inputs":{"src/containers/GameArticle/GameArticle.tsx":{"bytesInOutput":1066},"src/containers/GameArticle/index.ts":{"bytesInOutput":0}},"bytes":1231},"dist/lib/neutral/GameCard-QBKHIL4Q.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1969},"dist/lib/neutral/GameCard-QBKHIL4Q.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/GameCard/index.ts","inputs":{"src/containers/GameCard/GameCard.tsx":{"bytesInOutput":730},"src/containers/GameCard/index.ts":{"bytesInOutput":0}},"bytes":883},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-DSUJWWNN.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-R4V5PVU7.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Game","GameCapabilities","GameRef","GameVariantMismatchError","Player","loadGame","make","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":401},"dist/lib/neutral/chunk-DSUJWWNN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":8648},"dist/lib/neutral/chunk-DSUJWWNN.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo/Annotation","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"exports":["Game","GameCapabilities_exports","GameRef","GameVariantMismatchError","Player","loadGame","make"],"inputs":{"src/types/Game.ts":{"bytesInOutput":1707},"src/types/index.ts":{"bytesInOutput":0},"src/util/load-game.ts":{"bytesInOutput":988},"src/types/GameCapabilities.ts":{"bytesInOutput":278}},"bytes":3267},"dist/lib/neutral/GamePlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":13908},"dist/lib/neutral/GamePlugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["GamePlugin","default"],"entryPoint":"src/GamePlugin.tsx","inputs":{"src/GamePlugin.tsx":{"bytesInOutput":755},"raw-loader:/__w/dxos/dxos/packages/plugins/plugin-game/PLUGIN.mdl":{"bytesInOutput":11914}},"bytes":12914},"dist/lib/neutral/GamePlugin.node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1303},"dist/lib/neutral/GamePlugin.node.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#translations","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["GamePlugin","default"],"entryPoint":"src/GamePlugin.node.tsx","inputs":{"src/GamePlugin.node.tsx":{"bytesInOutput":408}},"bytes":575},"dist/lib/neutral/GamePlugin.workerd.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":776},"dist/lib/neutral/GamePlugin.workerd.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["GamePlugin","default"],"entryPoint":"src/GamePlugin.workerd.tsx","inputs":{"src/GamePlugin.workerd.tsx":{"bytesInOutput":312}},"bytes":488},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":602},"dist/lib/neutral/capabilities/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/neutral/create-object-NXKZWZLR.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/react-surface-GO3SKEMA.mjs","kind":"dynamic-import"}],"exports":["CreateObject","ReactSurface"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":248}},"bytes":388},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7231},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework/ui","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-form","kind":"import-statement","external":true},{"path":"@dxos/react-ui-search","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["CreateGamePanel"],"entryPoint":"src/components/index.ts","inputs":{"src/components/CreateGamePanel.tsx":{"bytesInOutput":3037},"src/components/index.ts":{"bytesInOutput":0}},"bytes":3173},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":530},"dist/lib/neutral/containers/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/neutral/GameArticle-AUJ4YDKW.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/GameCard-QBKHIL4Q.mjs","kind":"dynamic-import"}],"exports":["GameArticle","GameCard"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":162}},"bytes":295},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-R4V5PVU7.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["meta"],"entryPoint":"src/meta.ts","inputs":{},"bytes":131},"dist/lib/neutral/chunk-R4V5PVU7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2728},"dist/lib/neutral/chunk-R4V5PVU7.mjs":{"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-framework/config","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":102},"dx.config.ts":{"bytesInOutput":1844}},"bytes":2058},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-R4V5PVU7.mjs";
|
|
4
|
-
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
-
|
|
6
|
-
// src/plugin.ts
|
|
7
|
-
import { Plugin } from "@dxos/app-framework";
|
|
8
|
-
var GamePlugin = Plugin.lazy(meta, () => import("#plugin"));
|
|
9
|
-
export {
|
|
10
|
-
GamePlugin
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=plugin.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/plugin.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\n\nimport { meta } from './meta';\n\nexport const GamePlugin = Plugin.lazy(meta, () => import('#plugin'));\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,SAASA,cAAc;AAIhB,IAAMC,aAAaC,OAAOC,KAAKC,MAAM,MAAM,OAAO,SAAA,CAAA;",
|
|
6
|
-
"names": ["Plugin", "GamePlugin", "Plugin", "lazy", "meta"]
|
|
7
|
-
}
|