@dxos/plugin-chess 0.8.4-main.422d1c7879 → 0.8.4-main.4f23b4e393

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.
Files changed (194) hide show
  1. package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs +88 -0
  2. package/dist/lib/neutral/ChessArticle-QLLKZGPH.mjs.map +7 -0
  3. package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs +19 -0
  4. package/dist/lib/neutral/ChessCard-I5RSZZIP.mjs.map +7 -0
  5. package/dist/lib/neutral/ChessPlugin.mjs +30 -0
  6. package/dist/lib/neutral/ChessPlugin.mjs.map +7 -0
  7. package/dist/lib/neutral/ChessPlugin.node.mjs +23 -0
  8. package/dist/lib/neutral/ChessPlugin.node.mjs.map +7 -0
  9. package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs +15 -0
  10. package/dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs.map +7 -0
  11. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  12. package/dist/lib/neutral/capabilities/index.mjs +13 -0
  13. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-5UOTTW6U.mjs +8 -0
  15. package/dist/lib/neutral/chunk-5UOTTW6U.mjs.map +7 -0
  16. package/dist/lib/neutral/chunk-E4LZPHAQ.mjs +148 -0
  17. package/dist/lib/neutral/chunk-E4LZPHAQ.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-FFXSIHW6.mjs +21 -0
  19. package/dist/lib/neutral/chunk-FFXSIHW6.mjs.map +7 -0
  20. package/dist/lib/{browser/chunk-MC7L6JNC.mjs → neutral/chunk-XWKNXG62.mjs} +8 -10
  21. package/dist/lib/neutral/chunk-XWKNXG62.mjs.map +7 -0
  22. package/dist/lib/{browser → neutral/components}/index.mjs +8 -158
  23. package/dist/lib/neutral/components/index.mjs.map +7 -0
  24. package/dist/lib/neutral/containers/index.mjs +11 -0
  25. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  26. package/dist/lib/neutral/game-variant-24UKIBRM.mjs +40 -0
  27. package/dist/lib/neutral/game-variant-24UKIBRM.mjs.map +7 -0
  28. package/dist/lib/neutral/index.mjs +18 -0
  29. package/dist/lib/neutral/meta.json +1 -0
  30. package/dist/lib/neutral/meta.mjs +8 -0
  31. package/dist/lib/neutral/move-RQZ7BJY3.mjs +37 -0
  32. package/dist/lib/neutral/move-RQZ7BJY3.mjs.map +7 -0
  33. package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs +13 -0
  34. package/dist/lib/neutral/operation-handler-EKZKFQUG.mjs.map +7 -0
  35. package/dist/lib/{browser/types → neutral/operations}/index.mjs +3 -3
  36. package/dist/lib/neutral/play-GDGCEPQL.mjs +46 -0
  37. package/dist/lib/neutral/play-GDGCEPQL.mjs.map +7 -0
  38. package/dist/lib/neutral/plugin.mjs +16 -0
  39. package/dist/lib/neutral/plugin.mjs.map +7 -0
  40. package/dist/lib/{browser/print-EW7LPW4D.mjs → neutral/print-ZQA74KZI.mjs} +5 -6
  41. package/dist/lib/neutral/print-ZQA74KZI.mjs.map +7 -0
  42. package/dist/lib/neutral/translations.mjs +34 -0
  43. package/dist/lib/neutral/translations.mjs.map +7 -0
  44. package/dist/lib/neutral/types/index.mjs +10 -0
  45. package/dist/types/src/ChessPlugin.d.ts +1 -0
  46. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  47. package/dist/types/src/ChessPlugin.node.d.ts +8 -0
  48. package/dist/types/src/ChessPlugin.node.d.ts.map +1 -0
  49. package/dist/types/src/blueprints/chess-blueprint.d.ts +2 -2
  50. package/dist/types/src/blueprints/chess-blueprint.d.ts.map +1 -1
  51. package/dist/types/src/blueprints/index.d.ts +0 -1
  52. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
  54. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  55. package/dist/types/src/capabilities/game-variant.d.ts +6 -0
  56. package/dist/types/src/capabilities/game-variant.d.ts.map +1 -0
  57. package/dist/types/src/capabilities/index.d.ts +3 -3
  58. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  59. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  60. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  61. package/dist/types/src/components/Chessboard/Chessboard.d.ts +6 -2
  62. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
  63. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +32 -23
  64. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/Chessboard/Info.d.ts +4 -5
  66. package/dist/types/src/components/Chessboard/Info.d.ts.map +1 -1
  67. package/dist/types/src/components/Chessboard/types.d.ts +2 -2
  68. package/dist/types/src/components/Chessboard/types.d.ts.map +1 -1
  69. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts +3 -4
  70. package/dist/types/src/containers/ChessArticle/ChessArticle.d.ts.map +1 -1
  71. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts +32 -23
  72. package/dist/types/src/containers/ChessArticle/ChessArticle.stories.d.ts.map +1 -1
  73. package/dist/types/src/containers/ChessCard/ChessCard.d.ts +3 -4
  74. package/dist/types/src/containers/ChessCard/ChessCard.d.ts.map +1 -1
  75. package/dist/types/src/containers/ChessCard/ChessCard.stories.d.ts.map +1 -1
  76. package/dist/types/src/index.d.ts +0 -2
  77. package/dist/types/src/index.d.ts.map +1 -1
  78. package/dist/types/src/operations/index.d.ts +2 -3
  79. package/dist/types/src/operations/index.d.ts.map +1 -1
  80. package/dist/types/src/operations/move.d.ts +3 -3
  81. package/dist/types/src/operations/move.d.ts.map +1 -1
  82. package/dist/types/src/operations/play.d.ts +3 -3
  83. package/dist/types/src/operations/play.d.ts.map +1 -1
  84. package/dist/types/src/operations/print.d.ts +3 -3
  85. package/dist/types/src/operations/print.d.ts.map +1 -1
  86. package/dist/types/src/{cli/plugin.d.ts → plugin.d.ts} +1 -0
  87. package/dist/types/src/plugin.d.ts.map +1 -0
  88. package/dist/types/src/translations.d.ts +32 -24
  89. package/dist/types/src/translations.d.ts.map +1 -1
  90. package/dist/types/src/types/Chess.d.ts +10 -19
  91. package/dist/types/src/types/Chess.d.ts.map +1 -1
  92. package/dist/types/src/types/ChessOperation.d.ts +24 -0
  93. package/dist/types/src/types/ChessOperation.d.ts.map +1 -0
  94. package/dist/types/src/types/index.d.ts +1 -0
  95. package/dist/types/src/types/index.d.ts.map +1 -1
  96. package/dist/types/tsconfig.tsbuildinfo +1 -1
  97. package/package.json +91 -68
  98. package/src/ChessPlugin.node.ts +23 -0
  99. package/src/ChessPlugin.test.ts +8 -10
  100. package/src/ChessPlugin.tsx +11 -34
  101. package/src/blueprints/chess-blueprint.ts +6 -9
  102. package/src/blueprints/index.ts +0 -1
  103. package/src/capabilities/blueprint-definition.ts +2 -0
  104. package/src/capabilities/game-variant.ts +42 -0
  105. package/src/capabilities/index.ts +3 -2
  106. package/src/capabilities/operation-handler.ts +3 -3
  107. package/src/components/Chessboard/Chessboard.stories.tsx +3 -3
  108. package/src/components/Chessboard/Chessboard.tsx +4 -4
  109. package/src/components/Chessboard/Info.tsx +3 -63
  110. package/src/components/Chessboard/types.ts +1 -1
  111. package/src/containers/ChessArticle/ChessArticle.stories.tsx +9 -3
  112. package/src/containers/ChessArticle/ChessArticle.tsx +45 -10
  113. package/src/containers/ChessCard/ChessCard.stories.tsx +7 -2
  114. package/src/containers/ChessCard/ChessCard.tsx +10 -5
  115. package/src/index.ts +0 -3
  116. package/src/operations/index.ts +2 -7
  117. package/src/operations/move.ts +13 -13
  118. package/src/operations/play.ts +14 -14
  119. package/src/operations/print.ts +3 -3
  120. package/src/plugin.ts +11 -0
  121. package/src/translations.ts +6 -10
  122. package/src/types/Chess.ts +19 -22
  123. package/src/{operations/definitions.ts → types/ChessOperation.ts} +10 -34
  124. package/src/types/index.ts +1 -0
  125. package/dist/lib/browser/blueprints/index.mjs +0 -14
  126. package/dist/lib/browser/chunk-2TJN26DN.mjs +0 -67
  127. package/dist/lib/browser/chunk-2TJN26DN.mjs.map +0 -7
  128. package/dist/lib/browser/chunk-JZMN24DY.mjs +0 -28
  129. package/dist/lib/browser/chunk-JZMN24DY.mjs.map +0 -7
  130. package/dist/lib/browser/chunk-MC7L6JNC.mjs.map +0 -7
  131. package/dist/lib/browser/chunk-XAJZK6Z2.mjs +0 -110
  132. package/dist/lib/browser/chunk-XAJZK6Z2.mjs.map +0 -7
  133. package/dist/lib/browser/cli/index.mjs +0 -34
  134. package/dist/lib/browser/cli/index.mjs.map +0 -7
  135. package/dist/lib/browser/create-AJHN4QT4.mjs +0 -24
  136. package/dist/lib/browser/create-AJHN4QT4.mjs.map +0 -7
  137. package/dist/lib/browser/index.mjs.map +0 -7
  138. package/dist/lib/browser/meta.json +0 -1
  139. package/dist/lib/browser/move-T2NLRBR4.mjs +0 -36
  140. package/dist/lib/browser/move-T2NLRBR4.mjs.map +0 -7
  141. package/dist/lib/browser/operations/index.mjs +0 -19
  142. package/dist/lib/browser/play-7VTMD3SJ.mjs +0 -45
  143. package/dist/lib/browser/play-7VTMD3SJ.mjs.map +0 -7
  144. package/dist/lib/browser/print-EW7LPW4D.mjs.map +0 -7
  145. package/dist/lib/node-esm/blueprints/index.mjs +0 -15
  146. package/dist/lib/node-esm/chunk-4HZWCKMR.mjs +0 -38
  147. package/dist/lib/node-esm/chunk-4HZWCKMR.mjs.map +0 -7
  148. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  149. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
  150. package/dist/lib/node-esm/chunk-LQEDIKCV.mjs +0 -29
  151. package/dist/lib/node-esm/chunk-LQEDIKCV.mjs.map +0 -7
  152. package/dist/lib/node-esm/chunk-NYU5JVXP.mjs +0 -111
  153. package/dist/lib/node-esm/chunk-NYU5JVXP.mjs.map +0 -7
  154. package/dist/lib/node-esm/chunk-OIRJVY2R.mjs +0 -68
  155. package/dist/lib/node-esm/chunk-OIRJVY2R.mjs.map +0 -7
  156. package/dist/lib/node-esm/cli/index.mjs +0 -35
  157. package/dist/lib/node-esm/cli/index.mjs.map +0 -7
  158. package/dist/lib/node-esm/create-QSETDT4N.mjs +0 -25
  159. package/dist/lib/node-esm/create-QSETDT4N.mjs.map +0 -7
  160. package/dist/lib/node-esm/index.mjs +0 -390
  161. package/dist/lib/node-esm/index.mjs.map +0 -7
  162. package/dist/lib/node-esm/meta.json +0 -1
  163. package/dist/lib/node-esm/move-5F2ANDTE.mjs +0 -37
  164. package/dist/lib/node-esm/move-5F2ANDTE.mjs.map +0 -7
  165. package/dist/lib/node-esm/operations/index.mjs +0 -20
  166. package/dist/lib/node-esm/play-W4DQCQRX.mjs +0 -46
  167. package/dist/lib/node-esm/play-W4DQCQRX.mjs.map +0 -7
  168. package/dist/lib/node-esm/print-UJHXAXMS.mjs +0 -31
  169. package/dist/lib/node-esm/print-UJHXAXMS.mjs.map +0 -7
  170. package/dist/lib/node-esm/types/index.mjs +0 -9
  171. package/dist/lib/node-esm/types/index.mjs.map +0 -7
  172. package/dist/types/src/capabilities/artifact-definition.d.ts +0 -12
  173. package/dist/types/src/capabilities/artifact-definition.d.ts.map +0 -1
  174. package/dist/types/src/capabilities/react-surface.d.ts +0 -5
  175. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  176. package/dist/types/src/cli/index.d.ts +0 -2
  177. package/dist/types/src/cli/index.d.ts.map +0 -1
  178. package/dist/types/src/cli/plugin.d.ts.map +0 -1
  179. package/dist/types/src/operations/create.d.ts +0 -5
  180. package/dist/types/src/operations/create.d.ts.map +0 -1
  181. package/dist/types/src/operations/definitions.d.ts +0 -51
  182. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  183. package/src/capabilities/artifact-definition.ts +0 -135
  184. package/src/capabilities/react-surface.tsx +0 -35
  185. package/src/cli/index.ts +0 -5
  186. package/src/cli/plugin.ts +0 -37
  187. package/src/operations/create.ts +0 -21
  188. /package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
  189. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  190. /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  191. /package/dist/lib/{browser/operations → neutral}/index.mjs.map +0 -0
  192. /package/dist/lib/{browser/types/index.mjs.map → neutral/meta.mjs.map} +0 -0
  193. /package/dist/lib/{node-esm/blueprints → neutral/operations}/index.mjs.map +0 -0
  194. /package/dist/lib/{node-esm/operations → neutral/types}/index.mjs.map +0 -0
@@ -1,14 +1,4 @@
1
- import {
2
- chess_blueprint_default
3
- } from "./chunk-MC7L6JNC.mjs";
4
- import {
5
- operations_exports
6
- } from "./chunk-JZMN24DY.mjs";
7
- import "./chunk-XAJZK6Z2.mjs";
8
- import {
9
- Chess_exports
10
- } from "./chunk-2TJN26DN.mjs";
11
- import "./chunk-J5LGTIGS.mjs";
1
+ import "../chunk-J5LGTIGS.mjs";
12
2
 
13
3
  // src/components/Chessboard/Chessboard.tsx
14
4
  import { RegistryContext } from "@effect-atom/atom-react";
@@ -21,10 +11,7 @@ import { useSoundEffect } from "@dxos/react-ui-sfx";
21
11
  // src/components/Chessboard/Info.tsx
22
12
  import { useAtomValue } from "@effect-atom/atom-react";
23
13
  import React, { useEffect, useMemo, useRef } from "react";
24
- import { generateName } from "@dxos/display-name";
25
- import { Obj } from "@dxos/echo";
26
- import { useMembers } from "@dxos/react-client/echo";
27
- import { Icon, IconButton, Select, useTranslation } from "@dxos/react-ui";
14
+ import { Icon, IconButton, useTranslation } from "@dxos/react-ui";
28
15
  import { useGameboardContext } from "@dxos/react-ui-gameboard";
29
16
  import { mx } from "@dxos/ui-theme";
30
17
  import { meta } from "#meta";
@@ -32,8 +19,6 @@ var INFO_NAME = "Chessboard.Info";
32
19
  var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, ...props }) => {
33
20
  const { t } = useTranslation(meta.id);
34
21
  const { model } = useGameboardContext(INFO_NAME);
35
- const db = Obj.getDatabase(model.object);
36
- const members = useMembers(db?.spaceId);
37
22
  return /* @__PURE__ */ React.createElement("div", {
38
23
  className: mx("grid grid-rows-[min-content_1fr_min-content] w-full min-w-[18rem] p-2 overflow-hidden bg-group-surface rounded-xs", classNames)
39
24
  }, /* @__PURE__ */ React.createElement(PlayerIndicator, {
@@ -47,15 +32,7 @@ var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, .
47
32
  size: 4,
48
33
  onClick: onClose
49
34
  })
50
- }, /* @__PURE__ */ React.createElement(PlayerSelector, {
51
- value: model.object.players?.[orientation === "white" ? "black" : "white"],
52
- onValueChange: (value) => {
53
- Obj.change(model.object, (obj) => {
54
- obj.players[orientation === "white" ? "black" : "white"] = value;
55
- });
56
- },
57
- members
58
- })), /* @__PURE__ */ React.createElement(History, {
35
+ }), /* @__PURE__ */ React.createElement(History, {
59
36
  model,
60
37
  ...props
61
38
  }), /* @__PURE__ */ React.createElement(PlayerIndicator, {
@@ -69,15 +46,7 @@ var Info = ({ classNames, orientation = "white", onOrientationChange, onClose, .
69
46
  size: 4,
70
47
  onClick: () => onOrientationChange(orientation === "white" ? "black" : "white")
71
48
  })
72
- }, /* @__PURE__ */ React.createElement(PlayerSelector, {
73
- value: model.object.players?.[orientation],
74
- onValueChange: (value) => {
75
- Obj.change(model.object, (obj) => {
76
- obj.players[orientation] = value;
77
- });
78
- },
79
- members
80
- })));
49
+ }));
81
50
  };
82
51
  Info.displayName = INFO_NAME;
83
52
  var History = ({ classNames, model, min, max, onSelect }) => {
@@ -159,22 +128,6 @@ var PlayerIndicator = ({ children, model, player, icon }) => {
159
128
  className: "truncate overflow-hidden items-center"
160
129
  }, children), icon);
161
130
  };
162
- var PlayerSelector = ({ value, onValueChange, members }) => {
163
- const { t } = useTranslation(meta.id);
164
- return /* @__PURE__ */ React.createElement(Select.Root, {
165
- value,
166
- onValueChange
167
- }, /* @__PURE__ */ React.createElement(Select.TriggerButton, {
168
- placeholder: t("select-player.button")
169
- }), /* @__PURE__ */ React.createElement(Select.Portal, null, /* @__PURE__ */ React.createElement(Select.Content, null, /* @__PURE__ */ React.createElement(Select.Viewport, null, members.map((member) => {
170
- const memberKey = member.identity.identityKey.toHex();
171
- const displayName = member.identity?.profile?.displayName || generateName(memberKey);
172
- return /* @__PURE__ */ React.createElement(Select.Option, {
173
- key: memberKey,
174
- value: memberKey
175
- }, displayName);
176
- })), /* @__PURE__ */ React.createElement(Select.Arrow, null))));
177
- };
178
131
 
179
132
  // src/components/Chessboard/types.ts
180
133
  import { ChessModel } from "@dxos/react-ui-gameboard";
@@ -186,13 +139,13 @@ var ExtendedChessModel = class extends ChessModel {
186
139
  };
187
140
 
188
141
  // src/components/Chessboard/Chessboard.tsx
189
- var Root = /* @__PURE__ */ forwardRef(({ game, children }, forwardedRef) => {
142
+ var Root = /* @__PURE__ */ forwardRef(({ state, children }, forwardedRef) => {
190
143
  const registry = useContext(RegistryContext);
191
- const model = useMemo2(() => new ExtendedChessModel(registry, game), [
144
+ const model = useMemo2(() => new ExtendedChessModel(registry, state), [
192
145
  registry
193
146
  ]);
194
147
  const click = useSoundEffect("Click");
195
- const [pgn, updatePgn] = useObject(game, "pgn");
148
+ const [pgn, updatePgn] = useObject(state, "pgn");
196
149
  useImperativeHandle(forwardedRef, () => {
197
150
  return {
198
151
  setMoveNumber: (index) => model.setMoveIndex(index)
@@ -280,110 +233,7 @@ var Chessboard = {
280
233
  Board,
281
234
  Info
282
235
  };
283
-
284
- // src/meta.ts
285
- import { trim } from "@dxos/util";
286
- var meta2 = {
287
- id: "org.dxos.plugin.chess",
288
- name: "Chess",
289
- description: trim`
290
- Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
291
- Track game history and analyze moves in real-time.
292
- `,
293
- icon: "ph--shield-chevron--regular",
294
- iconHue: "amber",
295
- source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess",
296
- screenshots: [
297
- "https://dxos.network/plugin-details-chess-dark.png"
298
- ]
299
- };
300
-
301
- // src/ChessPlugin.tsx
302
- import * as Effect from "effect/Effect";
303
- import * as Option from "effect/Option";
304
- import { Plugin } from "@dxos/app-framework";
305
- import { AppPlugin } from "@dxos/app-toolkit";
306
- import { Annotation } from "@dxos/echo";
307
- import { Operation } from "@dxos/operation";
308
- import { SpaceOperation } from "@dxos/plugin-space/operations";
309
- import { ChessBlueprint } from "#blueprints";
310
- import { BlueprintDefinition, OperationHandler, ReactSurface } from "#capabilities";
311
- import { meta as meta4 } from "#meta";
312
- import { Chess as Chess2 } from "#types";
313
-
314
- // src/translations.ts
315
- import { meta as meta3 } from "#meta";
316
- import { Chess } from "#types";
317
- var translations = [
318
- {
319
- "en-US": {
320
- [Chess.Game.typename]: {
321
- "typename.label": "Game",
322
- "typename.label_zero": "Games",
323
- "typename.label_one": "Game",
324
- "typename.label_other": "Games",
325
- "object-name.placeholder": "New game",
326
- "add-object.label": "Add game",
327
- "rename-object.label": "Rename game",
328
- "delete-object.label": "Delete game",
329
- "object-deleted.label": "Game deleted"
330
- },
331
- [meta3.id]: {
332
- "plugin.name": "Chess",
333
- "delete-game.label": "Delete",
334
- "game.checkmate.label": "Checkmate",
335
- "game.stalemate.label": "Stalemate",
336
- "game.draw.label": "Draw",
337
- "game.check.label": "Check",
338
- "select-player.button": "Select player",
339
- "toggle-info.button": "Toggle info",
340
- "close-info.button": "Close info",
341
- "flip-board.button": "Flip board"
342
- }
343
- }
344
- }
345
- ];
346
-
347
- // src/ChessPlugin.tsx
348
- var ChessPlugin = Plugin.define(meta4).pipe(AppPlugin.addBlueprintDefinitionModule({
349
- activate: BlueprintDefinition
350
- }), AppPlugin.addOperationHandlerModule({
351
- activate: OperationHandler
352
- }), AppPlugin.addMetadataModule({
353
- metadata: {
354
- id: Chess2.Game.typename,
355
- metadata: {
356
- icon: Annotation.IconAnnotation.get(Chess2.Game).pipe(Option.getOrThrow).icon,
357
- iconHue: Annotation.IconAnnotation.get(Chess2.Game).pipe(Option.getOrThrow).hue ?? "white",
358
- blueprints: [
359
- ChessBlueprint.key
360
- ],
361
- createObject: (props, options) => Effect.gen(function* () {
362
- const object = Chess2.make(props);
363
- return yield* Operation.invoke(SpaceOperation.AddObject, {
364
- object,
365
- target: options.target,
366
- hidden: true,
367
- targetNodeId: options.targetNodeId
368
- });
369
- })
370
- }
371
- }
372
- }), AppPlugin.addSchemaModule({
373
- schema: [
374
- Chess2.Game
375
- ]
376
- }), AppPlugin.addSurfaceModule({
377
- activate: ReactSurface
378
- }), AppPlugin.addTranslationsModule({
379
- translations
380
- }), Plugin.make);
381
236
  export {
382
- Chess_exports as Chess,
383
- chess_blueprint_default as ChessBlueprint,
384
- operations_exports as ChessFunctions,
385
- ChessPlugin,
386
- Chessboard,
387
- meta2 as meta
237
+ Chessboard
388
238
  };
389
239
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/components/Chessboard/Chessboard.tsx", "../../../../src/components/Chessboard/Info.tsx", "../../../../src/components/Chessboard/types.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { RegistryContext } from '@effect-atom/atom-react';\nimport React, {\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useContext,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { useObject } from '@dxos/echo-react';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n type ChessModel,\n Gameboard,\n type GameboardRootProps,\n Chessboard as NaturalChessboard,\n type ChessboardProps as NaturalChessboardProps,\n getRawPgn,\n useGameboardContext,\n} from '@dxos/react-ui-gameboard';\nimport { useSoundEffect } from '@dxos/react-ui-sfx';\n\nimport { type Chess } from '#types';\n\nimport { Info, type InfoProps } from './Info';\nimport { ExtendedChessModel } from './types';\n\nexport interface ChessboardController {\n setMoveNumber(index: number): void;\n}\n\n//\n// Root\n//\n\ntype RootProps = PropsWithChildren<{\n state: Chess.State;\n}>;\n\nconst Root = forwardRef<ChessboardController, RootProps>(({ state, children }, forwardedRef) => {\n const registry = useContext(RegistryContext);\n const model = useMemo(() => new ExtendedChessModel(registry, state), [registry]);\n const click = useSoundEffect('Click');\n const [pgn, updatePgn] = useObject(state, 'pgn');\n\n // Controller.\n useImperativeHandle(forwardedRef, () => {\n return {\n setMoveNumber: (index) => model.setMoveIndex(index),\n };\n }, [model]);\n\n // TODO(wittjosiah): Rather than useEffect to sync ECHO object to model, create an alternative model implementation.\n // This model would take the ECHO object and derive game state directly from that.\n // Mutation methods would mutate the ECHO object and other state would be derived from that.\n\n // External change.\n // NOTE: Warning if user has not interacted with the board.\n useEffect(() => {\n if (model.pgn !== getRawPgn(pgn ?? '')) {\n const silent = model.pgn === '*';\n model.update(pgn);\n if (!silent) {\n void click.play();\n }\n }\n }, [pgn]);\n\n // Move.\n const handleDrop = useCallback<NonNullable<GameboardRootProps<ChessModel>['onDrop']>>(\n (move) => {\n if (!model.makeMove(move)) {\n return false;\n }\n\n void click.play();\n updatePgn(() => model.pgn);\n return true;\n },\n [model],\n );\n\n return (\n <Gameboard.Root model={model} onDrop={handleDrop}>\n {children}\n </Gameboard.Root>\n );\n});\n\n//\n// Content\n//\n\ntype Role = 'card--content';\n\ntype ContentProps = ThemedClassName<PropsWithChildren<{ role?: Role }>>;\n\nconst Content = ({ classNames, children }: ContentProps) => {\n return (\n <Gameboard.Content grow contain classNames={classNames}>\n {children}\n </Gameboard.Content>\n );\n};\n\n//\n// Board\n//\n\nconst BOARD_NAME = 'Chessboard.Board';\n\ntype BoardProps = NaturalChessboardProps;\n\nconst Board = (props: BoardProps) => {\n const registry = useContext(RegistryContext);\n const { model } = useGameboardContext<ChessModel>(BOARD_NAME);\n\n // Keyboard navigation.\n const ref = useRef<HTMLDivElement>(null);\n useEffect(() => {\n if (!ref.current) {\n return;\n }\n\n // Participate in keyboard navigation (set tabIndex={0})\n ref.current.setAttribute('data-arrow-keys', 'all');\n\n return addEventListener(ref.current, 'keydown', (ev) => {\n const moveIndex = registry.get(model.moveIndex);\n switch (ev.key) {\n case 'ArrowUp':\n model.setMoveIndex(0);\n break;\n case 'ArrowDown':\n model.setMoveIndex(model.game.history().length);\n break;\n case 'ArrowLeft':\n if (moveIndex > 0) {\n model.setMoveIndex(moveIndex - 1);\n }\n break;\n case 'ArrowRight':\n if (moveIndex < model.game.history().length) {\n model.setMoveIndex(moveIndex + 1);\n }\n break;\n }\n });\n }, [registry, model]);\n\n return <NaturalChessboard {...props} ref={ref} />;\n};\n\nBoard.displayName = BOARD_NAME;\n\n//\n// Chessboard\n//\n\nexport const Chessboard = {\n Root: Root,\n Content: Content,\n Board: Board,\n Info: Info,\n};\n\nexport type {\n RootProps as ChessboardRootProps,\n ContentProps as ChessboardContentProps,\n BoardProps as ChessboardBoardProps,\n InfoProps as ChessboardInfoProps,\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { useAtomValue } from '@effect-atom/atom-react';\nimport React, { type JSX, type PropsWithChildren, useEffect, useMemo, useRef } from 'react';\n\nimport { Icon, IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { type Player, useGameboardContext } from '@dxos/react-ui-gameboard';\nimport { mx } from '@dxos/ui-theme';\n\nimport { meta } from '#meta';\n\nimport { type ExtendedChessModel } from './types';\n\nconst INFO_NAME = 'Chessboard.Info';\n\nexport type InfoProps = ThemedClassName<\n {\n orientation?: Player;\n onOrientationChange?: (orientation: Player) => void;\n onClose?: () => void;\n } & Pick<HistoryProps, 'min' | 'max' | 'onSelect'>\n>;\n\nexport const Info = ({ classNames, orientation = 'white', onOrientationChange, onClose, ...props }: InfoProps) => {\n const { t } = useTranslation(meta.id);\n const { model } = useGameboardContext<ExtendedChessModel>(INFO_NAME);\n\n return (\n <div\n className={mx(\n 'grid grid-rows-[min-content_1fr_min-content] w-full min-w-[18rem] p-2 overflow-hidden bg-group-surface rounded-xs',\n classNames,\n )}\n >\n <PlayerIndicator\n model={model}\n player={orientation === 'white' ? 'black' : 'white'}\n icon={\n onClose && (\n <IconButton\n variant='ghost'\n icon='ph--x--regular'\n iconOnly\n label={t('close-info.button')}\n size={4}\n onClick={onClose}\n />\n )\n }\n />\n\n <History model={model} {...props} />\n\n <PlayerIndicator\n model={model}\n player={orientation}\n icon={\n onOrientationChange && (\n <IconButton\n classNames={mx('transition duration-200 ease-linear', orientation === 'white' && 'rotate-180')}\n icon='ph--arrows-clockwise--regular'\n iconOnly\n label={t('flip-board.button')}\n size={4}\n onClick={() => onOrientationChange(orientation === 'white' ? 'black' : 'white')}\n />\n )\n }\n />\n </div>\n );\n};\n\nInfo.displayName = INFO_NAME;\n\n//\n// History\n//\n\ntype HistoryProps = ThemedClassName<{\n model: ExtendedChessModel;\n min?: number;\n max?: number;\n onSelect?: (index: number) => void;\n}>;\n\nconst History = ({ classNames, model, min, max, onSelect }: HistoryProps) => {\n const { t } = useTranslation(meta.id);\n const moveIndex = useAtomValue(model.moveIndex);\n const label = model.game.isGameOver()\n ? model.game.isCheckmate()\n ? t('game.checkmate.label')\n : model.game.isStalemate()\n ? t('game.stalemate.label')\n : t('game.draw.label')\n : model.game.isCheck()\n ? t('game.check.label')\n : undefined;\n\n const history = model.game.history();\n const moves = useMemo(\n () =>\n history.reduce(\n (acc, move, index) => {\n if (index % 2 === 0) {\n acc.push([{ index, move }]);\n } else {\n acc[acc.length - 1].push({ index, move });\n }\n return acc;\n },\n [] as { index: number; move: string }[][],\n ),\n [history.length],\n );\n\n const scrollerRef = useRef<HTMLDivElement>(null);\n useEffect(() => {\n scrollerRef.current?.scrollTo({ top: scrollerRef.current.scrollHeight });\n }, [history.length]);\n\n useEffect(() => {\n const div = scrollerRef.current?.querySelector(`[data-index=\"${moveIndex - 1}\"]`);\n scrollerRef.current?.classList.add('scrollbar-none');\n div?.scrollIntoView({ behavior: 'smooth' });\n scrollerRef.current?.classList.remove('scrollbar-none');\n }, [moveIndex]);\n\n return (\n <div\n ref={scrollerRef}\n className={mx('overflow-y-auto', classNames)}\n style={{\n minHeight: min === undefined ? 'auto' : `${min * 24}px`,\n maxHeight: max === undefined ? 'auto' : `${max * 24}px`,\n }}\n >\n {moves.map(([a, b], index) => (\n <div key={index} className='grid grid-cols-[3rem_1fr_1fr_1rem] gap-2 ps-4'>\n <div className='content-center text-xs text-subdued'>{index + 1}</div>\n {a && (\n <div\n data-index={a.index}\n className={mx('ps-2 text-sm cursor-pointer', a.index === moveIndex - 1 && 'bg-primary-500')}\n onClick={() => onSelect?.(a.index + 1)}\n >\n {a.move}\n </div>\n )}\n {b && (\n <div\n data-index={b.index}\n className={mx('ps-2 text-sm cursor-pointer', b.index === moveIndex - 1 && 'bg-primary-500')}\n onClick={() => onSelect?.(b.index + 1)}\n >\n {b.move}\n </div>\n )}\n </div>\n ))}\n {label && <div className='text-center'>{label}</div>}\n </div>\n );\n};\n\n//\n// PlayerIndicator\n//\n\ntype PlayerIndicatorProps = PropsWithChildren<{\n model: ExtendedChessModel;\n player: Player;\n icon?: JSX.Element;\n}>;\n\nconst PlayerIndicator = ({ children, model, player, icon }: PlayerIndicatorProps) => {\n const turn = player === (model.game.turn() === 'w' ? 'white' : 'black');\n return (\n <div className='grid grid-cols-[2rem_1fr_2rem] gap-2 h-(--dx-rail-size) px-1 flex items-center overflow-hidden'>\n <div className='place-items-center'>\n <Icon\n icon={turn ? 'ph--circle--fill' : 'ph--circle--thin'}\n size={6}\n classNames={mx(turn && (model.game.isCheckmate() ? 'text-error-500' : 'text-success-text'))}\n />\n </div>\n <div className='truncate overflow-hidden items-center'>{children}</div>\n {icon}\n </div>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type Registry } from '@effect-atom/atom-react';\n\nimport { ChessModel } from '@dxos/react-ui-gameboard';\n\nimport { type Chess } from '#types';\n\nexport class ExtendedChessModel extends ChessModel {\n constructor(\n registry: Registry.Registry,\n readonly object: Chess.State,\n ) {\n super(registry);\n }\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["RegistryContext", "React", "forwardRef", "useCallback", "useContext", "useEffect", "useImperativeHandle", "useMemo", "useRef", "addEventListener", "useObject", "Gameboard", "Chessboard", "NaturalChessboard", "getRawPgn", "useGameboardContext", "useSoundEffect", "useAtomValue", "React", "useEffect", "useMemo", "useRef", "Icon", "IconButton", "useTranslation", "useGameboardContext", "mx", "meta", "INFO_NAME", "Info", "classNames", "orientation", "onOrientationChange", "onClose", "props", "t", "id", "model", "div", "className", "PlayerIndicator", "player", "icon", "variant", "iconOnly", "label", "size", "onClick", "History", "displayName", "min", "max", "onSelect", "moveIndex", "game", "isGameOver", "isCheckmate", "isStalemate", "isCheck", "undefined", "history", "moves", "reduce", "acc", "move", "index", "push", "length", "scrollerRef", "current", "scrollTo", "top", "scrollHeight", "querySelector", "classList", "add", "scrollIntoView", "behavior", "remove", "ref", "style", "minHeight", "maxHeight", "map", "a", "b", "key", "data-index", "children", "turn", "ChessModel", "ExtendedChessModel", "registry", "object", "Root", "forwardRef", "state", "children", "forwardedRef", "registry", "useContext", "RegistryContext", "model", "useMemo", "ExtendedChessModel", "click", "useSoundEffect", "pgn", "updatePgn", "useObject", "useImperativeHandle", "setMoveNumber", "index", "setMoveIndex", "useEffect", "getRawPgn", "silent", "update", "play", "handleDrop", "useCallback", "move", "makeMove", "React", "Gameboard", "onDrop", "Content", "classNames", "grow", "contain", "BOARD_NAME", "Board", "props", "useGameboardContext", "ref", "useRef", "current", "setAttribute", "addEventListener", "ev", "moveIndex", "get", "key", "game", "history", "length", "NaturalChessboard", "displayName", "Chessboard", "Info"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import "../chunk-J5LGTIGS.mjs";
2
+
3
+ // src/containers/index.ts
4
+ import { lazy } from "react";
5
+ var ChessArticle = lazy(() => import("../ChessArticle-QLLKZGPH.mjs"));
6
+ var ChessCard = lazy(() => import("../ChessCard-I5RSZZIP.mjs"));
7
+ export {
8
+ ChessArticle,
9
+ ChessCard
10
+ };
11
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../src/containers/index.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const ChessArticle: ComponentType<any> = lazy(() => import('./ChessArticle'));\nexport const ChessCard: ComponentType<any> = lazy(() => import('./ChessCard'));\n"],
5
+ "mappings": ";;;AAIA,SAA6BA,YAAY;AAElC,IAAMC,eAAmCD,KAAK,MAAM,OAAO,8BAAA,CAAA;AAC3D,IAAME,YAAgCF,KAAK,MAAM,OAAO,2BAAA,CAAA;",
6
+ "names": ["lazy", "ChessArticle", "ChessCard"]
7
+ }
@@ -0,0 +1,40 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/game-variant.ts
4
+ import * as Effect from "effect/Effect";
5
+ import * as Schema from "effect/Schema";
6
+ import { Capability } from "@dxos/app-framework";
7
+ import { GameCapabilities } from "@dxos/plugin-game";
8
+ import { ChessArticle, ChessCard } from "#containers";
9
+ import { Chess } from "#types";
10
+ var CreateChessInput = Schema.Struct({
11
+ name: Schema.optional(Schema.String.annotations({
12
+ title: "Name",
13
+ description: "Optional name for the game."
14
+ })),
15
+ pgn: Schema.optional(Schema.String.annotations({
16
+ title: "PGN",
17
+ description: "Optional Portable Game Notation to start from."
18
+ }))
19
+ });
20
+ var variant = {
21
+ id: Chess.State.typename,
22
+ label: "Chess",
23
+ icon: "ph--shield-chevron--regular",
24
+ variantSchema: Chess.State,
25
+ inputSchema: CreateChessInput,
26
+ roles: [
27
+ "white",
28
+ "black"
29
+ ],
30
+ createVariant: (input) => Effect.sync(() => Chess.make({
31
+ pgn: typeof input.pgn === "string" ? input.pgn : void 0
32
+ })),
33
+ card: ChessCard,
34
+ article: ChessArticle
35
+ };
36
+ var game_variant_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(GameCapabilities.Variant, variant)));
37
+ export {
38
+ game_variant_default as default
39
+ };
40
+ //# sourceMappingURL=game-variant-24UKIBRM.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/game-variant.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2026 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Capability } from '@dxos/app-framework';\nimport { GameCapabilities, type GameVariant } from '@dxos/plugin-game';\n\nimport { ChessArticle, ChessCard } from '#containers';\nimport { Chess } from '#types';\n\nconst CreateChessInput = Schema.Struct({\n name: Schema.optional(\n Schema.String.annotations({\n title: 'Name',\n description: 'Optional name for the game.',\n }),\n ),\n pgn: Schema.optional(\n Schema.String.annotations({\n title: 'PGN',\n description: 'Optional Portable Game Notation to start from.',\n }),\n ),\n});\n\nconst variant: GameVariant = {\n id: Chess.State.typename,\n label: 'Chess',\n icon: 'ph--shield-chevron--regular',\n variantSchema: Chess.State,\n inputSchema: CreateChessInput,\n roles: ['white', 'black'] as const,\n createVariant: (input) =>\n Effect.sync(() => Chess.make({ pgn: typeof input.pgn === 'string' ? input.pgn : undefined })),\n card: ChessCard,\n article: ChessArticle,\n};\n\nexport default Capability.makeModule(() => Effect.succeed(Capability.contributes(GameCapabilities.Variant, variant)));\n"],
5
+ "mappings": ";;;AAIA,YAAYA,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,wBAA0C;AAEnD,SAASC,cAAcC,iBAAiB;AACxC,SAASC,aAAa;AAEtB,IAAMC,mBAA0BC,cAAO;EACrCC,MAAaC,gBACJC,cAAOC,YAAY;IACxBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;EAEFC,KAAYL,gBACHC,cAAOC,YAAY;IACxBC,OAAO;IACPC,aAAa;EACf,CAAA,CAAA;AAEJ,CAAA;AAEA,IAAME,UAAuB;EAC3BC,IAAIX,MAAMY,MAAMC;EAChBC,OAAO;EACPC,MAAM;EACNC,eAAehB,MAAMY;EACrBK,aAAahB;EACbiB,OAAO;IAAC;IAAS;;EACjBC,eAAe,CAACC,UACPC,YAAK,MAAMrB,MAAMsB,KAAK;IAAEb,KAAK,OAAOW,MAAMX,QAAQ,WAAWW,MAAMX,MAAMc;EAAU,CAAA,CAAA;EAC5FC,MAAMzB;EACN0B,SAAS3B;AACX;AAEA,IAAA,uBAAeF,WAAW8B,WAAW,MAAaC,eAAQ/B,WAAWgC,YAAY/B,iBAAiBgC,SAASnB,OAAAA,CAAAA,CAAAA;",
6
+ "names": ["Effect", "Schema", "Capability", "GameCapabilities", "ChessArticle", "ChessCard", "Chess", "CreateChessInput", "Struct", "name", "optional", "String", "annotations", "title", "description", "pgn", "variant", "id", "State", "typename", "label", "icon", "variantSchema", "inputSchema", "roles", "createVariant", "input", "sync", "make", "undefined", "card", "article", "makeModule", "succeed", "contributes", "Variant"]
7
+ }
@@ -0,0 +1,18 @@
1
+ import {
2
+ ChessOperation_exports,
3
+ Chess_exports
4
+ } from "./chunk-E4LZPHAQ.mjs";
5
+ import {
6
+ chess_blueprint_default
7
+ } from "./chunk-XWKNXG62.mjs";
8
+ import {
9
+ meta
10
+ } from "./chunk-FFXSIHW6.mjs";
11
+ import "./chunk-J5LGTIGS.mjs";
12
+ export {
13
+ Chess_exports as Chess,
14
+ chess_blueprint_default as ChessBlueprint,
15
+ ChessOperation_exports as ChessOperation,
16
+ meta
17
+ };
18
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"inputs":{"src/blueprints/chess-blueprint.ts":{"bytes":3171,"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/blueprints/index.ts":{"bytes":519,"imports":[{"path":"src/blueprints/chess-blueprint.ts","kind":"import-statement","original":"./chess-blueprint"}],"format":"esm"},"src/meta.ts":{"bytes":1964,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/Chess.ts":{"bytes":6313,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"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/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true}],"format":"esm"},"src/types/ChessOperation.ts":{"bytes":7964,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true},{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/types/index.ts":{"bytes":610,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"},{"path":"src/types/ChessOperation.ts","kind":"import-statement","original":"./ChessOperation"}],"format":"esm"},"src/index.ts":{"bytes":539,"imports":[{"path":"src/blueprints/index.ts","kind":"import-statement","original":"./blueprints"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/ChessPlugin.tsx":{"bytes":3390,"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}],"format":"esm"},"src/ChessPlugin.node.ts":{"bytes":2761,"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":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/blueprint-definition.ts":{"bytes":1978,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/app-toolkit","kind":"import-statement","external":true},{"path":"#blueprints","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/game-variant.ts":{"bytes":4593,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/operation-handler.ts":{"bytes":1613,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"#operations","kind":"import-statement","external":true}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1788,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/blueprint-definition.ts","kind":"dynamic-import","original":"./blueprint-definition"},{"path":"src/capabilities/game-variant.ts","kind":"dynamic-import","original":"./game-variant"},{"path":"src/capabilities/operation-handler.ts","kind":"dynamic-import","original":"./operation-handler"}],"format":"esm"},"src/components/Chessboard/Info.tsx":{"bytes":18373,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true}],"format":"esm"},"src/components/Chessboard/types.ts":{"bytes":1194,"imports":[{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"format":"esm"},"src/components/Chessboard/Chessboard.tsx":{"bytes":13889,"imports":[{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"src/components/Chessboard/Info.tsx","kind":"import-statement","original":"./Info"},{"path":"src/components/Chessboard/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/components/Chessboard/index.ts":{"bytes":382,"imports":[{"path":"src/components/Chessboard/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"src/components/index.ts":{"bytes":382,"imports":[{"path":"src/components/Chessboard/index.ts","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"src/containers/ChessArticle/ChessArticle.tsx":{"bytes":11928,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/containers/ChessArticle/index.ts":{"bytes":506,"imports":[{"path":"src/containers/ChessArticle/ChessArticle.tsx","kind":"import-statement","original":"./ChessArticle"}],"format":"esm"},"src/containers/ChessCard/ChessCard.tsx":{"bytes":2107,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"},"src/containers/ChessCard/index.ts":{"bytes":484,"imports":[{"path":"src/containers/ChessCard/ChessCard.tsx","kind":"import-statement","original":"./ChessCard"}],"format":"esm"},"src/containers/index.ts":{"bytes":952,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/containers/ChessArticle/index.ts","kind":"dynamic-import","original":"./ChessArticle"},{"path":"src/containers/ChessCard/index.ts","kind":"dynamic-import","original":"./ChessCard"}],"format":"esm"},"src/operations/move.ts":{"bytes":3638,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/operations/play.ts":{"bytes":4894,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/operations/print.ts":{"bytes":2385,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/operations/index.ts":{"bytes":1006,"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"src/operations/move.ts","kind":"dynamic-import","original":"./move"},{"path":"src/operations/play.ts","kind":"dynamic-import","original":"./play"},{"path":"src/operations/print.ts","kind":"dynamic-import","original":"./print"}],"format":"esm"},"src/plugin.ts":{"bytes":1063,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/operations/index.ts","kind":"import-statement","original":"./operations"},{"path":"#plugin","kind":"dynamic-import","external":true}],"format":"esm"},"src/translations.ts":{"bytes":3118,"imports":[{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/lib/neutral/ChessCard-I5RSZZIP.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1180},"dist/lib/neutral/ChessCard-I5RSZZIP.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/ChessCard/index.ts","inputs":{"src/containers/ChessCard/ChessCard.tsx":{"bytesInOutput":454},"src/containers/ChessCard/index.ts":{"bytesInOutput":0}},"bytes":611},"dist/lib/neutral/move-RQZ7BJY3.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2013},"dist/lib/neutral/move-RQZ7BJY3.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-E4LZPHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/move.ts","inputs":{"src/operations/move.ts":{"bytesInOutput":755}},"bytes":976},"dist/lib/neutral/play-GDGCEPQL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2686},"dist/lib/neutral/play-GDGCEPQL.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-E4LZPHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/play.ts","inputs":{"src/operations/play.ts":{"bytesInOutput":1056}},"bytes":1277},"dist/lib/neutral/print-ZQA74KZI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1306},"dist/lib/neutral/print-ZQA74KZI.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-E4LZPHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/operations/print.ts","inputs":{"src/operations/print.ts":{"bytesInOutput":461}},"bytes":668},"dist/lib/neutral/operations/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/operations/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-5UOTTW6U.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ChessOperationHandlerSet"],"entryPoint":"src/operations/index.ts","inputs":{},"bytes":174},"dist/lib/neutral/plugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":501},"dist/lib/neutral/plugin.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-5UOTTW6U.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-FFXSIHW6.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":["ChessOperationHandlerSet","ChessPlugin"],"entryPoint":"src/plugin.ts","inputs":{"src/plugin.ts":{"bytesInOutput":108}},"bytes":361},"dist/lib/neutral/chunk-5UOTTW6U.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":549},"dist/lib/neutral/chunk-5UOTTW6U.mjs":{"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"dist/lib/neutral/move-RQZ7BJY3.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/play-GDGCEPQL.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/print-ZQA74KZI.mjs","kind":"dynamic-import"}],"exports":["ChessOperationHandlerSet"],"inputs":{"src/operations/index.ts":{"bytesInOutput":222}},"bytes":333},"dist/lib/neutral/translations.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1492},"dist/lib/neutral/translations.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"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":805}},"bytes":929},"dist/lib/neutral/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/types/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-E4LZPHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Chess","ChessOperation"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":231},"dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1102},"dist/lib/neutral/blueprint-definition-PZXHAYLD.mjs":{"imports":[{"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/app-toolkit","kind":"import-statement","external":true},{"path":"#blueprints","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/blueprint-definition.ts","inputs":{"src/capabilities/blueprint-definition.ts":{"bytesInOutput":400}},"bytes":589},"dist/lib/neutral/game-variant-24UKIBRM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":2422},"dist/lib/neutral/game-variant-24UKIBRM.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true},{"path":"#containers","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/game-variant.ts","inputs":{"src/capabilities/game-variant.ts":{"bytesInOutput":1090}},"bytes":1255},"dist/lib/neutral/operation-handler-EKZKFQUG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":917},"dist/lib/neutral/operation-handler-EKZKFQUG.mjs":{"imports":[{"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":"#operations","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/operation-handler.ts","inputs":{"src/capabilities/operation-handler.ts":{"bytesInOutput":343}},"bytes":523},"dist/lib/neutral/ChessArticle-QLLKZGPH.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6425},"dist/lib/neutral/ChessArticle-QLLKZGPH.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#components","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/containers/ChessArticle/index.ts","inputs":{"src/containers/ChessArticle/ChessArticle.tsx":{"bytesInOutput":3058},"src/containers/ChessArticle/index.ts":{"bytesInOutput":0}},"bytes":3227},"dist/lib/neutral/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-E4LZPHAQ.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-XWKNXG62.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-FFXSIHW6.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["Chess","ChessBlueprint","ChessOperation","meta"],"entryPoint":"src/index.ts","inputs":{"src/index.ts":{"bytesInOutput":0}},"bytes":395},"dist/lib/neutral/chunk-E4LZPHAQ.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":6741},"dist/lib/neutral/chunk-E4LZPHAQ.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"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/internal","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/plugin-game","kind":"import-statement","external":true}],"exports":["ChessOperation_exports","Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1747},"src/types/index.ts":{"bytesInOutput":0},"src/types/ChessOperation.ts":{"bytesInOutput":2207}},"bytes":4159},"dist/lib/neutral/ChessPlugin.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1798},"dist/lib/neutral/ChessPlugin.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":["ChessPlugin","default"],"entryPoint":"src/ChessPlugin.tsx","inputs":{"src/ChessPlugin.tsx":{"bytesInOutput":784}},"bytes":940},"dist/lib/neutral/ChessPlugin.node.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1415},"dist/lib/neutral/ChessPlugin.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":"#capabilities","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["ChessPlugin","default"],"entryPoint":"src/ChessPlugin.node.ts","inputs":{"src/ChessPlugin.node.ts":{"bytesInOutput":539}},"bytes":709},"dist/lib/neutral/blueprints/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/blueprints/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-XWKNXG62.mjs","kind":"import-statement"},{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"}],"exports":["ChessBlueprint"],"entryPoint":"src/blueprints/index.ts","inputs":{},"bytes":190},"dist/lib/neutral/chunk-XWKNXG62.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1605},"dist/lib/neutral/chunk-XWKNXG62.mjs":{"imports":[{"path":"@dxos/compute","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"#types","kind":"import-statement","external":true}],"exports":["chess_blueprint_default"],"inputs":{"src/blueprints/chess-blueprint.ts":{"bytesInOutput":820},"src/blueprints/index.ts":{"bytesInOutput":0}},"bytes":940},"dist/lib/neutral/capabilities/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":995},"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/blueprint-definition-PZXHAYLD.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/game-variant-24UKIBRM.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/operation-handler-EKZKFQUG.mjs","kind":"dynamic-import"}],"exports":["BlueprintDefinition","GameVariant","OperationHandler"],"entryPoint":"src/capabilities/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":377}},"bytes":543},"dist/lib/neutral/components/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":17837},"dist/lib/neutral/components/index.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-J5LGTIGS.mjs","kind":"import-statement"},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","kind":"import-statement","external":true},{"path":"@dxos/echo-react","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-sfx","kind":"import-statement","external":true},{"path":"@effect-atom/atom-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-ui","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/ui-theme","kind":"import-statement","external":true},{"path":"#meta","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true}],"exports":["Chessboard"],"entryPoint":"src/components/index.ts","inputs":{"src/components/Chessboard/Chessboard.tsx":{"bytesInOutput":2840},"src/components/Chessboard/Info.tsx":{"bytesInOutput":4782},"src/components/Chessboard/types.ts":{"bytesInOutput":201},"src/components/Chessboard/index.ts":{"bytesInOutput":0},"src/components/index.ts":{"bytesInOutput":0}},"bytes":8083},"dist/lib/neutral/containers/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":536},"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/ChessArticle-QLLKZGPH.mjs","kind":"dynamic-import"},{"path":"dist/lib/neutral/ChessCard-I5RSZZIP.mjs","kind":"dynamic-import"}],"exports":["ChessArticle","ChessCard"],"entryPoint":"src/containers/index.ts","inputs":{"src/containers/index.ts":{"bytesInOutput":166}},"bytes":301},"dist/lib/neutral/meta.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/meta.mjs":{"imports":[{"path":"dist/lib/neutral/chunk-FFXSIHW6.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-FFXSIHW6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":967},"dist/lib/neutral/chunk-FFXSIHW6.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["meta"],"inputs":{"src/meta.ts":{"bytesInOutput":515}},"bytes":594},"dist/lib/neutral/chunk-J5LGTIGS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/neutral/chunk-J5LGTIGS.mjs":{"imports":[],"exports":["__export"],"inputs":{},"bytes":235}}}
@@ -0,0 +1,8 @@
1
+ import {
2
+ meta
3
+ } from "./chunk-FFXSIHW6.mjs";
4
+ import "./chunk-J5LGTIGS.mjs";
5
+ export {
6
+ meta
7
+ };
8
+ //# sourceMappingURL=meta.mjs.map
@@ -0,0 +1,37 @@
1
+ import {
2
+ ChessOperation_exports,
3
+ Chess_exports
4
+ } from "./chunk-E4LZPHAQ.mjs";
5
+ import "./chunk-J5LGTIGS.mjs";
6
+
7
+ // src/operations/move.ts
8
+ import { Chess as ChessJS } from "chess.js";
9
+ import * as Effect from "effect/Effect";
10
+ import { Operation } from "@dxos/compute";
11
+ import { Obj } from "@dxos/echo";
12
+ import { loadGame } from "@dxos/plugin-game";
13
+ var handler = ChessOperation_exports.Move.pipe(Operation.withHandler(Effect.fn(function* ({ game, move }) {
14
+ const { variant } = yield* loadGame(game, Chess_exports.State);
15
+ const chess = new ChessJS();
16
+ if (variant.pgn) {
17
+ chess.loadPgn(variant.pgn);
18
+ } else if (variant.fen) {
19
+ chess.load(variant.fen);
20
+ }
21
+ chess.move(move, {
22
+ strict: false
23
+ });
24
+ const pgn = chess.pgn();
25
+ Obj.update(variant, (variant2) => {
26
+ const mutable = variant2;
27
+ mutable.pgn = pgn;
28
+ });
29
+ return {
30
+ pgn
31
+ };
32
+ })));
33
+ var move_default = handler;
34
+ export {
35
+ move_default as default
36
+ };
37
+ //# sourceMappingURL=move-RQZ7BJY3.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/move.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { loadGame } from '@dxos/plugin-game';\n\nimport { Chess, ChessOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof ChessOperation.Move> = ChessOperation.Move.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ game, move }) {\n const { variant } = yield* loadGame(game, Chess.State);\n const chess = new ChessJS();\n if (variant.pgn) {\n chess.loadPgn(variant.pgn);\n } else if (variant.fen) {\n chess.load(variant.fen);\n }\n\n chess.move(move, { strict: false });\n const pgn = chess.pgn();\n Obj.update(variant, (variant) => {\n const mutable = variant as Obj.Mutable<typeof variant>;\n mutable.pgn = pgn;\n });\n return { pgn };\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,gBAAgB;AAIzB,IAAMC,UAA6DC,uBAAeC,KAAKC,KACrFC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,KAAI,GAAE;AACjC,QAAM,EAAEC,QAAO,IAAK,OAAOC,SAASH,MAAMI,cAAMC,KAAK;AACrD,QAAMC,QAAQ,IAAIC,QAAAA;AAClB,MAAIL,QAAQM,KAAK;AACfF,UAAMG,QAAQP,QAAQM,GAAG;EAC3B,WAAWN,QAAQQ,KAAK;AACtBJ,UAAMK,KAAKT,QAAQQ,GAAG;EACxB;AAEAJ,QAAML,KAAKA,MAAM;IAAEW,QAAQ;EAAM,CAAA;AACjC,QAAMJ,MAAMF,MAAME,IAAG;AACrBK,MAAIC,OAAOZ,SAAS,CAACA,aAAAA;AACnB,UAAMa,UAAUb;AAChBa,YAAQP,MAAMA;EAChB,CAAA;AACA,SAAO;IAAEA;EAAI;AACf,CAAA,CAAA,CAAA;AAIJ,IAAA,eAAef;",
6
+ "names": ["Chess", "ChessJS", "Effect", "Operation", "Obj", "loadGame", "handler", "ChessOperation", "Move", "pipe", "Operation", "withHandler", "fn", "game", "move", "variant", "loadGame", "Chess", "State", "chess", "ChessJS", "pgn", "loadPgn", "fen", "load", "strict", "Obj", "update", "mutable"]
7
+ }
@@ -0,0 +1,13 @@
1
+ import "./chunk-J5LGTIGS.mjs";
2
+
3
+ // src/capabilities/operation-handler.ts
4
+ import * as Effect from "effect/Effect";
5
+ import { Capabilities, Capability } from "@dxos/app-framework";
6
+ import { ChessOperationHandlerSet } from "#operations";
7
+ var operation_handler_default = Capability.makeModule(Effect.fnUntraced(function* () {
8
+ return Capability.contributes(Capabilities.OperationHandler, ChessOperationHandlerSet);
9
+ }));
10
+ export {
11
+ operation_handler_default as default
12
+ };
13
+ //# sourceMappingURL=operation-handler-EKZKFQUG.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/operation-handler.ts"],
4
+ "sourcesContent": ["// Copyright 2025 DXOS.org\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport type { OperationHandlerSet } from '@dxos/compute';\n\nimport { ChessOperationHandlerSet } from '#operations';\n\nexport default Capability.makeModule<OperationHandlerSet.OperationHandlerSet>(\n Effect.fnUntraced(function* () {\n return Capability.contributes(Capabilities.OperationHandler, ChessOperationHandlerSet);\n }),\n);\n"],
5
+ "mappings": ";;;AAEA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AAGzC,SAASC,gCAAgC;AAEzC,IAAA,4BAAeD,WAAWE,WACjBC,kBAAW,aAAA;AAChB,SAAOH,WAAWI,YAAYL,aAAaM,kBAAkBJ,wBAAAA;AAC/D,CAAA,CAAA;",
6
+ "names": ["Effect", "Capabilities", "Capability", "ChessOperationHandlerSet", "makeModule", "fnUntraced", "contributes", "OperationHandler"]
7
+ }
@@ -1,8 +1,8 @@
1
1
  import {
2
- Chess_exports
3
- } from "../chunk-2TJN26DN.mjs";
2
+ ChessOperationHandlerSet
3
+ } from "../chunk-5UOTTW6U.mjs";
4
4
  import "../chunk-J5LGTIGS.mjs";
5
5
  export {
6
- Chess_exports as Chess
6
+ ChessOperationHandlerSet
7
7
  };
8
8
  //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,46 @@
1
+ import {
2
+ ChessOperation_exports,
3
+ Chess_exports
4
+ } from "./chunk-E4LZPHAQ.mjs";
5
+ import "./chunk-J5LGTIGS.mjs";
6
+
7
+ // src/operations/play.ts
8
+ import { Chess as ChessJS } from "chess.js";
9
+ import * as Effect from "effect/Effect";
10
+ import { Operation } from "@dxos/compute";
11
+ import { Obj } from "@dxos/echo";
12
+ import { loadGame } from "@dxos/plugin-game";
13
+ var handler = ChessOperation_exports.Play.pipe(Operation.withHandler(Effect.fn(function* ({ game, side = "any" }) {
14
+ const { variant } = yield* loadGame(game, Chess_exports.State);
15
+ const chess = new ChessJS();
16
+ if (variant.pgn) {
17
+ chess.loadPgn(variant.pgn);
18
+ } else if (variant.fen) {
19
+ chess.load(variant.fen);
20
+ }
21
+ if (!(side === "any" || chess.turn() === "w" && side === "white" || chess.turn() === "b" && side === "black")) {
22
+ return {
23
+ move: void 0,
24
+ pgn: variant.pgn ?? ""
25
+ };
26
+ }
27
+ const moves = chess.moves();
28
+ const move = moves[Math.floor(Math.random() * moves.length)];
29
+ chess.move(move, {
30
+ strict: false
31
+ });
32
+ const pgn = chess.pgn();
33
+ Obj.update(variant, (variant2) => {
34
+ const mutable = variant2;
35
+ mutable.pgn = pgn;
36
+ });
37
+ return {
38
+ move,
39
+ pgn
40
+ };
41
+ })));
42
+ var play_default = handler;
43
+ export {
44
+ play_default as default
45
+ };
46
+ //# sourceMappingURL=play-GDGCEPQL.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/play.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Obj } from '@dxos/echo';\nimport { loadGame } from '@dxos/plugin-game';\n\nimport { Chess, ChessOperation } from '../types';\n\nconst handler: Operation.WithHandler<typeof ChessOperation.Play> = ChessOperation.Play.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ game, side = 'any' }) {\n const { variant } = yield* loadGame(game, Chess.State);\n const chess = new ChessJS();\n if (variant.pgn) {\n chess.loadPgn(variant.pgn);\n } else if (variant.fen) {\n chess.load(variant.fen);\n }\n\n if (\n !(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))\n ) {\n return { move: undefined, pgn: variant.pgn ?? '' };\n }\n\n const moves = chess.moves();\n const move = moves[Math.floor(Math.random() * moves.length)];\n\n chess.move(move, { strict: false });\n const pgn = chess.pgn();\n Obj.update(variant, (variant) => {\n const mutable = variant as Obj.Mutable<typeof variant>;\n mutable.pgn = pgn;\n });\n return { move, pgn };\n }),\n ),\n);\n\nexport default handler;\n"],
5
+ "mappings": ";;;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,WAAW;AACpB,SAASC,gBAAgB;AAIzB,IAAMC,UAA6DC,uBAAeC,KAAKC,KACrFC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAMC,OAAO,MAAK,GAAE;AACzC,QAAM,EAAEC,QAAO,IAAK,OAAOC,SAASH,MAAMI,cAAMC,KAAK;AACrD,QAAMC,QAAQ,IAAIC,QAAAA;AAClB,MAAIL,QAAQM,KAAK;AACfF,UAAMG,QAAQP,QAAQM,GAAG;EAC3B,WAAWN,QAAQQ,KAAK;AACtBJ,UAAMK,KAAKT,QAAQQ,GAAG;EACxB;AAEA,MACE,EAAET,SAAS,SAAUK,MAAMM,KAAI,MAAO,OAAOX,SAAS,WAAaK,MAAMM,KAAI,MAAO,OAAOX,SAAS,UACpG;AACA,WAAO;MAAEY,MAAMC;MAAWN,KAAKN,QAAQM,OAAO;IAAG;EACnD;AAEA,QAAMO,QAAQT,MAAMS,MAAK;AACzB,QAAMF,OAAOE,MAAMC,KAAKC,MAAMD,KAAKE,OAAM,IAAKH,MAAMI,MAAM,CAAA;AAE1Db,QAAMO,KAAKA,MAAM;IAAEO,QAAQ;EAAM,CAAA;AACjC,QAAMZ,MAAMF,MAAME,IAAG;AACrBa,MAAIC,OAAOpB,SAAS,CAACA,aAAAA;AACnB,UAAMqB,UAAUrB;AAChBqB,YAAQf,MAAMA;EAChB,CAAA;AACA,SAAO;IAAEK;IAAML;EAAI;AACrB,CAAA,CAAA,CAAA;AAIJ,IAAA,eAAef;",
6
+ "names": ["Chess", "ChessJS", "Effect", "Operation", "Obj", "loadGame", "handler", "ChessOperation", "Play", "pipe", "Operation", "withHandler", "fn", "game", "side", "variant", "loadGame", "Chess", "State", "chess", "ChessJS", "pgn", "loadPgn", "fen", "load", "turn", "move", "undefined", "moves", "Math", "floor", "random", "length", "strict", "Obj", "update", "mutable"]
7
+ }