@dxos/plugin-chess 0.8.4-main.5ad4a44 → 0.8.4-main.66e292d

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 (77) hide show
  1. package/dist/lib/browser/{ChessboardContainer-OX6TILWD.mjs → ChessboardContainer-5YXEM4VR.mjs} +10 -10
  2. package/dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs.map +7 -0
  3. package/dist/lib/browser/blueprint-definition-Y5Y4YGNL.mjs +11 -0
  4. package/dist/lib/browser/{chunk-VA5TW6SD.mjs → chunk-3LPE2B5J.mjs} +5 -5
  5. package/dist/lib/browser/chunk-3LPE2B5J.mjs.map +7 -0
  6. package/dist/lib/browser/{chunk-E5NQWXQ7.mjs → chunk-5DOZV3PW.mjs} +6 -18
  7. package/dist/lib/browser/{chunk-E5NQWXQ7.mjs.map → chunk-5DOZV3PW.mjs.map} +2 -2
  8. package/dist/lib/browser/{chunk-M63HYNXU.mjs → chunk-CCF24VRU.mjs} +11 -12
  9. package/dist/lib/browser/chunk-CCF24VRU.mjs.map +7 -0
  10. package/dist/lib/browser/{chunk-WSUUPPDK.mjs → chunk-DUO4WTAM.mjs} +4 -2
  11. package/dist/lib/browser/chunk-DUO4WTAM.mjs.map +7 -0
  12. package/dist/lib/browser/{chunk-KQOVCG7Z.mjs → chunk-Q5TZCIH7.mjs} +2 -2
  13. package/dist/lib/browser/index.mjs +22 -21
  14. package/dist/lib/browser/index.mjs.map +3 -3
  15. package/dist/lib/browser/{intent-resolver-OQPSVFOB.mjs → intent-resolver-KPGHK5JU.mjs} +3 -3
  16. package/dist/lib/browser/meta.json +1 -1
  17. package/dist/lib/browser/{react-surface-OLAZCU2E.mjs → react-surface-3YST34QI.mjs} +5 -5
  18. package/dist/lib/browser/types/index.mjs +2 -2
  19. package/dist/lib/node-esm/{ChessboardContainer-PGDHBG6F.mjs → ChessboardContainer-7OQ6TOKB.mjs} +10 -10
  20. package/dist/lib/node-esm/ChessboardContainer-7OQ6TOKB.mjs.map +7 -0
  21. package/dist/lib/node-esm/blueprint-definition-GR6OLMB6.mjs +12 -0
  22. package/dist/lib/node-esm/{chunk-SW5N5XNV.mjs → chunk-F3HFLDV5.mjs} +5 -5
  23. package/dist/lib/node-esm/chunk-F3HFLDV5.mjs.map +7 -0
  24. package/dist/lib/node-esm/{chunk-DWGG7IGH.mjs → chunk-F4C2HVZL.mjs} +6 -18
  25. package/dist/lib/node-esm/{chunk-DWGG7IGH.mjs.map → chunk-F4C2HVZL.mjs.map} +2 -2
  26. package/dist/lib/node-esm/{chunk-5C2OYL2B.mjs → chunk-KNOOJFIR.mjs} +4 -2
  27. package/dist/lib/node-esm/chunk-KNOOJFIR.mjs.map +7 -0
  28. package/dist/lib/node-esm/{chunk-7YK5RFHY.mjs → chunk-QKXLEJNZ.mjs} +11 -12
  29. package/dist/lib/node-esm/chunk-QKXLEJNZ.mjs.map +7 -0
  30. package/dist/lib/node-esm/{chunk-C55L2OCJ.mjs → chunk-VVXTAVIS.mjs} +2 -2
  31. package/dist/lib/node-esm/index.mjs +22 -21
  32. package/dist/lib/node-esm/index.mjs.map +3 -3
  33. package/dist/lib/node-esm/{intent-resolver-KVGTUDXJ.mjs → intent-resolver-ZAELGF7I.mjs} +3 -3
  34. package/dist/lib/node-esm/meta.json +1 -1
  35. package/dist/lib/node-esm/{react-surface-FIKCDZ5L.mjs → react-surface-KV2KBSIU.mjs} +5 -5
  36. package/dist/lib/node-esm/types/index.mjs +2 -2
  37. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/blueprint-definition.d.ts +2 -2
  39. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  40. package/dist/types/src/components/Chessboard.stories.d.ts +3 -1
  41. package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -1
  42. package/dist/types/src/components/ChessboardArticle.d.ts.map +1 -1
  43. package/dist/types/src/functions/create.d.ts +2 -2
  44. package/dist/types/src/functions/move.d.ts +1 -1
  45. package/dist/types/src/functions/play.d.ts +1 -1
  46. package/dist/types/src/meta.d.ts.map +1 -1
  47. package/dist/types/src/translations.d.ts +1 -0
  48. package/dist/types/src/translations.d.ts.map +1 -1
  49. package/dist/types/src/types/Chess.d.ts +2 -2
  50. package/dist/types/src/types/Chess.d.ts.map +1 -1
  51. package/dist/types/tsconfig.tsbuildinfo +1 -1
  52. package/package.json +28 -28
  53. package/src/ChessPlugin.tsx +9 -14
  54. package/src/capabilities/blueprint-definition.ts +3 -3
  55. package/src/components/ChessboardArticle.tsx +6 -7
  56. package/src/components/Info.tsx +2 -2
  57. package/src/meta.ts +3 -1
  58. package/src/translations.ts +1 -0
  59. package/src/types/Chess.ts +19 -27
  60. package/dist/lib/browser/ChessboardContainer-OX6TILWD.mjs.map +0 -7
  61. package/dist/lib/browser/blueprint-definition-UVRFUJYE.mjs +0 -11
  62. package/dist/lib/browser/chunk-M63HYNXU.mjs.map +0 -7
  63. package/dist/lib/browser/chunk-VA5TW6SD.mjs.map +0 -7
  64. package/dist/lib/browser/chunk-WSUUPPDK.mjs.map +0 -7
  65. package/dist/lib/node-esm/ChessboardContainer-PGDHBG6F.mjs.map +0 -7
  66. package/dist/lib/node-esm/blueprint-definition-Z47C4EEX.mjs +0 -12
  67. package/dist/lib/node-esm/chunk-5C2OYL2B.mjs.map +0 -7
  68. package/dist/lib/node-esm/chunk-7YK5RFHY.mjs.map +0 -7
  69. package/dist/lib/node-esm/chunk-SW5N5XNV.mjs.map +0 -7
  70. /package/dist/lib/browser/{blueprint-definition-UVRFUJYE.mjs.map → blueprint-definition-Y5Y4YGNL.mjs.map} +0 -0
  71. /package/dist/lib/browser/{chunk-KQOVCG7Z.mjs.map → chunk-Q5TZCIH7.mjs.map} +0 -0
  72. /package/dist/lib/browser/{intent-resolver-OQPSVFOB.mjs.map → intent-resolver-KPGHK5JU.mjs.map} +0 -0
  73. /package/dist/lib/browser/{react-surface-OLAZCU2E.mjs.map → react-surface-3YST34QI.mjs.map} +0 -0
  74. /package/dist/lib/node-esm/{blueprint-definition-Z47C4EEX.mjs.map → blueprint-definition-GR6OLMB6.mjs.map} +0 -0
  75. /package/dist/lib/node-esm/{chunk-C55L2OCJ.mjs.map → chunk-VVXTAVIS.mjs.map} +0 -0
  76. /package/dist/lib/node-esm/{intent-resolver-KVGTUDXJ.mjs.map → intent-resolver-ZAELGF7I.mjs.map} +0 -0
  77. /package/dist/lib/node-esm/{react-surface-FIKCDZ5L.mjs.map → react-surface-KV2KBSIU.mjs.map} +0 -0
@@ -1 +1 @@
1
- {"inputs":{"src/types/Chess.ts":{"bytes":5642,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","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":"@dxos/schema","kind":"import-statement","external":true}],"format":"esm"},"src/meta.ts":{"bytes":1691,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/ChessAction.ts":{"bytes":1860,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/types/index.ts":{"bytes":682,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"},{"path":"src/types/ChessAction.ts","kind":"import-statement","original":"./ChessAction"}],"format":"esm"},"src/functions/create.ts":{"bytes":3286,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/functions/move.ts":{"bytes":5167,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/functions/play.ts":{"bytes":6854,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/functions/index.ts":{"bytes":860,"imports":[{"path":"src/functions/create.ts","kind":"import-statement","original":"./create"},{"path":"src/functions/move.ts","kind":"import-statement","original":"./move"},{"path":"src/functions/play.ts","kind":"import-statement","original":"./play"}],"format":"esm"},"src/capabilities/blueprint-definition.ts":{"bytes":3906,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/functions/index.ts","kind":"import-statement","original":"../functions"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2113,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/Info.tsx":{"bytes":24865,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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/react-ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/Chessboard.tsx":{"bytes":14217,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","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":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/Info.tsx","kind":"import-statement","original":"./Info"}],"format":"esm"},"src/components/ChessboardArticle.tsx":{"bytes":8160,"imports":[{"path":"@preact-signals/safe-react/tracking","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-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"src/components/ChessboardContainer.tsx":{"bytes":3725,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"},{"path":"src/components/ChessboardArticle.tsx","kind":"import-statement","original":"./ChessboardArticle"}],"format":"esm"},"src/components/index.ts":{"bytes":877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"},{"path":"src/components/ChessboardContainer.tsx","kind":"dynamic-import","original":"./ChessboardContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3392,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1442,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/blueprint-definition.ts","kind":"import-statement","original":"./blueprint-definition"},{"path":"src/capabilities/blueprint-definition.ts","kind":"dynamic-import","original":"./blueprint-definition"},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":3451,"imports":[{"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":7439,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":911,"imports":[{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5763},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VA5TW6SD.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-KQOVCG7Z.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-M63HYNXU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-E5NQWXQ7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/blueprint-definition-UVRFUJYE.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/intent-resolver-OQPSVFOB.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-surface-OLAZCU2E.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/plugin-space","kind":"import-statement","external":true},{"path":"@dxos/plugin-space/types","kind":"import-statement","external":true}],"exports":["BLUEPRINT_KEY","BlueprintDefinition","Chess","ChessAction","ChessPlugin","Chessboard","ChessboardContainer","ExtendedChessModel","IntentResolver","ReactSurface","create","meta","move","play"],"entryPoint":"src/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":275},"src/index.ts":{"bytesInOutput":0},"src/ChessPlugin.tsx":{"bytesInOutput":1566},"src/translations.ts":{"bytesInOutput":831}},"bytes":3485},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-M63HYNXU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"}],"exports":["Chess","ChessAction"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":222},"dist/lib/browser/blueprint-definition-UVRFUJYE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/blueprint-definition-UVRFUJYE.mjs":{"imports":[{"path":"dist/lib/browser/chunk-VA5TW6SD.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-M63HYNXU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"}],"exports":["BLUEPRINT_KEY","default"],"entryPoint":"src/capabilities/blueprint-definition.ts","inputs":{},"bytes":280},"dist/lib/browser/chunk-VA5TW6SD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9572},"dist/lib/browser/chunk-VA5TW6SD.mjs":{"imports":[{"path":"dist/lib/browser/chunk-M63HYNXU.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true}],"exports":["BLUEPRINT_KEY","blueprint_definition_default","create_default","move_default","play_default"],"inputs":{"src/capabilities/blueprint-definition.ts":{"bytesInOutput":968},"src/functions/create.ts":{"bytesInOutput":744},"src/functions/index.ts":{"bytesInOutput":0},"src/functions/move.ts":{"bytesInOutput":1305},"src/functions/play.ts":{"bytesInOutput":1753}},"bytes":5151},"dist/lib/browser/intent-resolver-OQPSVFOB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1073},"dist/lib/browser/intent-resolver-OQPSVFOB.mjs":{"imports":[{"path":"dist/lib/browser/chunk-M63HYNXU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":380}},"bytes":633},"dist/lib/browser/ChessboardContainer-OX6TILWD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5887},"dist/lib/browser/ChessboardContainer-OX6TILWD.mjs":{"imports":[{"path":"dist/lib/browser/chunk-E5NQWXQ7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","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-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ChessboardContainer","default"],"entryPoint":"src/components/ChessboardContainer.tsx","inputs":{"src/components/ChessboardContainer.tsx":{"bytesInOutput":931},"src/components/ChessboardArticle.tsx":{"bytesInOutput":2094}},"bytes":3386},"dist/lib/browser/react-surface-OLAZCU2E.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1589},"dist/lib/browser/react-surface-OLAZCU2E.mjs":{"imports":[{"path":"dist/lib/browser/chunk-KQOVCG7Z.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-M63HYNXU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-E5NQWXQ7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":718}},"bytes":1052},"dist/lib/browser/chunk-KQOVCG7Z.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":413},"dist/lib/browser/chunk-KQOVCG7Z.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/ChessboardContainer-OX6TILWD.mjs","kind":"dynamic-import"}],"exports":["ChessboardContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":114}},"bytes":220},"dist/lib/browser/chunk-M63HYNXU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3669},"dist/lib/browser/chunk-M63HYNXU.mjs":{"imports":[{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","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":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true}],"exports":["ChessAction_exports","Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1494},"src/types/index.ts":{"bytesInOutput":0},"src/types/ChessAction.ts":{"bytesInOutput":385}},"bytes":2086},"dist/lib/browser/chunk-E5NQWXQ7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19973},"dist/lib/browser/chunk-E5NQWXQ7.mjs":{"imports":[{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","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":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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/react-ui-theme","kind":"import-statement","external":true}],"exports":["Chessboard","ExtendedChessModel"],"inputs":{"src/components/Chessboard.tsx":{"bytesInOutput":3610},"src/components/Info.tsx":{"bytesInOutput":6809}},"bytes":10654},"dist/lib/browser/chunk-WSUUPPDK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":821},"dist/lib/browser/chunk-WSUUPPDK.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["__export","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":377}},"bytes":636}}}
1
+ {"inputs":{"src/types/Chess.ts":{"bytes":5760,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","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/meta.ts":{"bytes":2047,"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"format":"esm"},"src/types/ChessAction.ts":{"bytes":1860,"imports":[{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"}],"format":"esm"},"src/types/index.ts":{"bytes":682,"imports":[{"path":"src/types/Chess.ts","kind":"import-statement","original":"./Chess"},{"path":"src/types/ChessAction.ts","kind":"import-statement","original":"./ChessAction"}],"format":"esm"},"src/functions/create.ts":{"bytes":3286,"imports":[{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/functions/move.ts":{"bytes":5167,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/functions/play.ts":{"bytes":6854,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/functions/index.ts":{"bytes":860,"imports":[{"path":"src/functions/create.ts","kind":"import-statement","original":"./create"},{"path":"src/functions/move.ts","kind":"import-statement","original":"./move"},{"path":"src/functions/play.ts","kind":"import-statement","original":"./play"}],"format":"esm"},"src/capabilities/blueprint-definition.ts":{"bytes":3942,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"src/functions/index.ts","kind":"import-statement","original":"../functions"}],"format":"esm"},"src/capabilities/intent-resolver.ts":{"bytes":2113,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/components/Info.tsx":{"bytes":24845,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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/react-ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"src/components/Chessboard.tsx":{"bytes":13872,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","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":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/components/Info.tsx","kind":"import-statement","original":"./Info"}],"format":"esm"},"src/components/ChessboardArticle.tsx":{"bytes":8061,"imports":[{"path":"@preact-signals/safe-react/tracking","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-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"src/components/ChessboardContainer.tsx":{"bytes":3725,"imports":[{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"},{"path":"src/components/ChessboardArticle.tsx","kind":"import-statement","original":"./ChessboardArticle"}],"format":"esm"},"src/components/index.ts":{"bytes":877,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"src/components/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"},{"path":"src/components/ChessboardContainer.tsx","kind":"dynamic-import","original":"./ChessboardContainer"}],"format":"esm"},"src/capabilities/react-surface.tsx":{"bytes":3392,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"src/capabilities/index.ts":{"bytes":1442,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"src/capabilities/blueprint-definition.ts","kind":"import-statement","original":"./blueprint-definition"},{"path":"src/capabilities/blueprint-definition.ts","kind":"dynamic-import","original":"./blueprint-definition"},{"path":"src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"src/translations.ts":{"bytes":3591,"imports":[{"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":7392,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"src/index.ts":{"bytes":911,"imports":[{"path":"src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"src/components/index.ts","kind":"import-statement","original":"./components"},{"path":"src/functions/index.ts","kind":"import-statement","original":"./functions"},{"path":"src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"src/types/index.ts","kind":"import-statement","original":"./types"},{"path":"src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"}],"format":"esm"}},"outputs":{"dist/lib/browser/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5789},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LPE2B5J.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-Q5TZCIH7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CCF24VRU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5DOZV3PW.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"dist/lib/browser/blueprint-definition-Y5Y4YGNL.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/intent-resolver-KPGHK5JU.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-surface-3YST34QI.mjs","kind":"dynamic-import"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true}],"exports":["BlueprintDefinition","CHESS_BLUEPRINT_KEY","Chess","ChessAction","ChessPlugin","Chessboard","ChessboardContainer","ExtendedChessModel","IntentResolver","ReactSurface","create","meta","move","play"],"entryPoint":"src/index.ts","inputs":{"src/capabilities/index.ts":{"bytesInOutput":275},"src/index.ts":{"bytesInOutput":0},"src/ChessPlugin.tsx":{"bytesInOutput":1511},"src/translations.ts":{"bytesInOutput":879}},"bytes":3490},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CCF24VRU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"}],"exports":["Chess","ChessAction"],"entryPoint":"src/types/index.ts","inputs":{},"bytes":222},"dist/lib/browser/blueprint-definition-Y5Y4YGNL.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/blueprint-definition-Y5Y4YGNL.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3LPE2B5J.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CCF24VRU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"}],"exports":["CHESS_BLUEPRINT_KEY","default"],"entryPoint":"src/capabilities/blueprint-definition.ts","inputs":{},"bytes":292},"dist/lib/browser/chunk-3LPE2B5J.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9590},"dist/lib/browser/chunk-3LPE2B5J.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CCF24VRU.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/blueprints","kind":"import-statement","external":true},{"path":"@dxos/util","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Effect","kind":"import-statement","external":true},{"path":"effect/Schema","kind":"import-statement","external":true},{"path":"@dxos/assistant","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true}],"exports":["CHESS_BLUEPRINT_KEY","blueprint_definition_default","create_default","move_default","play_default"],"inputs":{"src/capabilities/blueprint-definition.ts":{"bytesInOutput":980},"src/functions/create.ts":{"bytesInOutput":744},"src/functions/index.ts":{"bytesInOutput":0},"src/functions/move.ts":{"bytesInOutput":1305},"src/functions/play.ts":{"bytesInOutput":1753}},"bytes":5169},"dist/lib/browser/intent-resolver-KPGHK5JU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1073},"dist/lib/browser/intent-resolver-KPGHK5JU.mjs":{"imports":[{"path":"dist/lib/browser/chunk-CCF24VRU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/intent-resolver.ts","inputs":{"src/capabilities/intent-resolver.ts":{"bytesInOutput":380}},"bytes":633},"dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5812},"dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs":{"imports":[{"path":"dist/lib/browser/chunk-5DOZV3PW.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","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-stack","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true}],"exports":["ChessboardContainer","default"],"entryPoint":"src/components/ChessboardContainer.tsx","inputs":{"src/components/ChessboardContainer.tsx":{"bytesInOutput":931},"src/components/ChessboardArticle.tsx":{"bytesInOutput":2071}},"bytes":3363},"dist/lib/browser/react-surface-3YST34QI.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1589},"dist/lib/browser/react-surface-3YST34QI.mjs":{"imports":[{"path":"dist/lib/browser/chunk-Q5TZCIH7.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-CCF24VRU.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-5DOZV3PW.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"src/capabilities/react-surface.tsx","inputs":{"src/capabilities/react-surface.tsx":{"bytesInOutput":718}},"bytes":1052},"dist/lib/browser/chunk-Q5TZCIH7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":413},"dist/lib/browser/chunk-Q5TZCIH7.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/ChessboardContainer-5YXEM4VR.mjs","kind":"dynamic-import"}],"exports":["ChessboardContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":114}},"bytes":220},"dist/lib/browser/chunk-CCF24VRU.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3704},"dist/lib/browser/chunk-CCF24VRU.mjs":{"imports":[{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect/Schema","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}],"exports":["ChessAction_exports","Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1548},"src/types/index.ts":{"bytesInOutput":0},"src/types/ChessAction.ts":{"bytesInOutput":385}},"bytes":2140},"dist/lib/browser/chunk-5DOZV3PW.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19926},"dist/lib/browser/chunk-5DOZV3PW.mjs":{"imports":[{"path":"dist/lib/browser/chunk-DUO4WTAM.mjs","kind":"import-statement"},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/async","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":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"@preact-signals/safe-react/tracking","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","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/react-ui-theme","kind":"import-statement","external":true}],"exports":["Chessboard","ExtendedChessModel"],"inputs":{"src/components/Chessboard.tsx":{"bytesInOutput":3330},"src/components/Info.tsx":{"bytesInOutput":6801}},"bytes":10366},"dist/lib/browser/chunk-DUO4WTAM.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":984},"dist/lib/browser/chunk-DUO4WTAM.mjs":{"imports":[{"path":"@dxos/util","kind":"import-statement","external":true}],"exports":["__export","meta"],"inputs":{"src/meta.ts":{"bytesInOutput":515}},"bytes":774}}}
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ChessboardContainer
3
- } from "./chunk-KQOVCG7Z.mjs";
3
+ } from "./chunk-Q5TZCIH7.mjs";
4
4
  import {
5
5
  Chess_exports
6
- } from "./chunk-M63HYNXU.mjs";
7
- import "./chunk-E5NQWXQ7.mjs";
6
+ } from "./chunk-CCF24VRU.mjs";
7
+ import "./chunk-5DOZV3PW.mjs";
8
8
  import {
9
9
  meta
10
- } from "./chunk-WSUUPPDK.mjs";
10
+ } from "./chunk-DUO4WTAM.mjs";
11
11
 
12
12
  // src/capabilities/react-surface.tsx
13
13
  import React from "react";
@@ -35,4 +35,4 @@ var react_surface_default = (() => contributes(Capabilities.ReactSurface, [
35
35
  export {
36
36
  react_surface_default as default
37
37
  };
38
- //# sourceMappingURL=react-surface-OLAZCU2E.mjs.map
38
+ //# sourceMappingURL=react-surface-3YST34QI.mjs.map
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  ChessAction_exports,
3
3
  Chess_exports
4
- } from "../chunk-M63HYNXU.mjs";
5
- import "../chunk-WSUUPPDK.mjs";
4
+ } from "../chunk-CCF24VRU.mjs";
5
+ import "../chunk-DUO4WTAM.mjs";
6
6
  export {
7
7
  Chess_exports as Chess,
8
8
  ChessAction_exports as ChessAction
@@ -1,10 +1,10 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  Chessboard
4
- } from "./chunk-DWGG7IGH.mjs";
4
+ } from "./chunk-F4C2HVZL.mjs";
5
5
  import {
6
6
  meta
7
- } from "./chunk-5C2OYL2B.mjs";
7
+ } from "./chunk-KNOOJFIR.mjs";
8
8
 
9
9
  // src/components/ChessboardContainer.tsx
10
10
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
@@ -14,7 +14,7 @@ import { getSpace } from "@dxos/react-client/echo";
14
14
  // src/components/ChessboardArticle.tsx
15
15
  import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
16
16
  import React, { useCallback, useRef, useState } from "react";
17
- import { IconButton, Toolbar, useTranslation } from "@dxos/react-ui";
17
+ import { Toolbar, useTranslation } from "@dxos/react-ui";
18
18
  import { StackItem } from "@dxos/react-ui-stack";
19
19
  import { mx } from "@dxos/react-ui-theme";
20
20
  var ChessboardArticle = ({ game, role }) => {
@@ -28,20 +28,20 @@ var ChessboardArticle = ({ game, role }) => {
28
28
  controller.current?.setMoveNumber(index);
29
29
  }, []);
30
30
  return /* @__PURE__ */ React.createElement(StackItem.Content, {
31
- toolbar: true
31
+ toolbar: true,
32
+ classNames: "@container"
32
33
  }, /* @__PURE__ */ React.createElement(Chessboard.Root, {
33
34
  game,
34
35
  ref: controller
35
- }, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(IconButton, {
36
- variant: "ghost",
36
+ }, /* @__PURE__ */ React.createElement(Toolbar.Root, null, /* @__PURE__ */ React.createElement(Toolbar.IconButton, {
37
37
  icon: "ph--info--regular",
38
38
  iconOnly: true,
39
39
  label: t("toggle info button"),
40
- size: 6,
41
- classNames: mx("invisible", !open && "@3xl:visible"),
40
+ disabled: open,
41
+ classNames: mx("invisible @3xl:visible"),
42
42
  onClick: () => setOpen((open2) => !open2)
43
43
  })), /* @__PURE__ */ React.createElement("div", {
44
- className: mx("grid _grid-rows-[1fr_4rem] bs-full is-full gap-2", open && "@3xl:grid-cols-[1fr_320px]", role === "section" && "aspect-square", role === "section" && open && "@3xl:aspect-auto")
44
+ className: mx("grid bs-full is-full gap-2", open && "@3xl:grid-cols-[1fr_320px]", role === "section" && "aspect-square", role === "section" && open && "@3xl:aspect-auto")
45
45
  }, /* @__PURE__ */ React.createElement(Chessboard.Content, null, /* @__PURE__ */ React.createElement(Chessboard.Board, {
46
46
  classNames: "m-4 rounded-sm overflow-hidden",
47
47
  orientation
@@ -94,4 +94,4 @@ export {
94
94
  ChessboardContainer,
95
95
  ChessboardContainer_default as default
96
96
  };
97
- //# sourceMappingURL=ChessboardContainer-PGDHBG6F.mjs.map
97
+ //# sourceMappingURL=ChessboardContainer-7OQ6TOKB.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/ChessboardContainer.tsx", "../../../src/components/ChessboardArticle.tsx"],
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { getSpace } from '@dxos/react-client/echo';\n\nimport { type Chess } from '../types';\n\nimport { Chessboard } from './Chessboard';\nimport { ChessboardArticle } from './ChessboardArticle';\n\nexport type ChessboardContainerProps = {\n game: Chess.Game;\n role?: string;\n};\n\nexport const ChessboardContainer = ({ game, role }: ChessboardContainerProps) => {\n const space = getSpace(game);\n if (!space) {\n return null;\n }\n\n switch (role) {\n case 'card--popover':\n case 'card--intrinsic':\n case 'card--extrinsic': {\n return (\n <Chessboard.Root game={game}>\n <Chessboard.Content role={role}>\n <Chessboard.Board />\n </Chessboard.Content>\n </Chessboard.Root>\n );\n }\n\n default: {\n return <ChessboardArticle game={game} role={role} />;\n }\n }\n};\n\nexport default ChessboardContainer;\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport React, { useCallback, useRef, useState } from 'react';\n\nimport { Toolbar, useTranslation } from '@dxos/react-ui';\nimport { type Player } from '@dxos/react-ui-gameboard';\nimport { StackItem } from '@dxos/react-ui-stack';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\nimport { type Chess } from '../types';\n\nimport { Chessboard, type ChessboardController, type ChessboardInfoProps } from './Chessboard';\n\nexport const ChessboardArticle = ({ game, role }: { game: Chess.Game; role?: string }) => {\n const { t } = useTranslation(meta.id);\n const [orientation, setOrientation] = useState<Player>('white');\n const [open, setOpen] = useState(true);\n const controller = useRef<ChessboardController>(null);\n\n // TODO(burdon): Keyboard handler.\n const handleSelect = useCallback<NonNullable<ChessboardInfoProps['onSelect']>>((index) => {\n controller.current?.setMoveNumber(index);\n }, []);\n\n return (\n <StackItem.Content toolbar classNames='@container'>\n <Chessboard.Root game={game} ref={controller}>\n <Toolbar.Root>\n <Toolbar.IconButton\n icon='ph--info--regular'\n iconOnly\n label={t('toggle info button')}\n disabled={open}\n classNames={mx('invisible @3xl:visible')}\n onClick={() => setOpen((open) => !open)}\n />\n </Toolbar.Root>\n <div\n className={mx(\n 'grid bs-full is-full gap-2',\n open && '@3xl:grid-cols-[1fr_320px]',\n role === 'section' && 'aspect-square',\n role === 'section' && open && '@3xl:aspect-auto',\n )}\n >\n <Chessboard.Content>\n <Chessboard.Board classNames='m-4 rounded-sm overflow-hidden' orientation={orientation} />\n </Chessboard.Content>\n {open && (\n <div className='hidden @3xl:flex flex-col p-8 justify-center items-center overflow-hidden'>\n <Chessboard.Info\n orientation={orientation}\n min={8}\n max={8}\n onOrientationChange={setOrientation}\n onClose={() => setOpen(false)}\n onSelect={handleSelect}\n />\n </div>\n )}\n </div>\n </Chessboard.Root>\n </StackItem.Content>\n );\n};\n"],
5
+ "mappings": ";;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,gBAAgB;;;;ACFzB,OAAOC,SAASC,aAAaC,QAAQC,gBAAgB;AAErD,SAASC,SAASC,sBAAsB;AAExC,SAASC,iBAAiB;AAC1B,SAASC,UAAU;AAOZ,IAAMC,oBAAoB,CAAC,EAAEC,MAAMC,KAAI,MAAuC;;;AACnF,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAM,CAACC,aAAaC,cAAAA,IAAkBC,SAAiB,OAAA;AACvD,UAAM,CAACC,MAAMC,OAAAA,IAAWF,SAAS,IAAA;AACjC,UAAMG,aAAaC,OAA6B,IAAA;AAGhD,UAAMC,eAAeC,YAA0D,CAACC,UAAAA;AAC9EJ,iBAAWK,SAASC,cAAcF,KAAAA;IACpC,GAAG,CAAA,CAAE;AAEL,WACE,sBAAA,cAACG,UAAUC,SAAO;MAACC,SAAAA;MAAQC,YAAW;OACpC,sBAAA,cAACC,WAAWC,MAAI;MAACvB;MAAYwB,KAAKb;OAChC,sBAAA,cAACc,QAAQF,MAAI,MACX,sBAAA,cAACE,QAAQC,YAAU;MACjBC,MAAK;MACLC,UAAAA;MACAC,OAAO3B,EAAE,oBAAA;MACT4B,UAAUrB;MACVY,YAAYU,GAAG,wBAAA;MACfC,SAAS,MAAMtB,QAAQ,CAACD,UAAS,CAACA,KAAAA;SAGtC,sBAAA,cAACwB,OAAAA;MACCC,WAAWH,GACT,8BACAtB,QAAQ,8BACRR,SAAS,aAAa,iBACtBA,SAAS,aAAaQ,QAAQ,kBAAA;OAGhC,sBAAA,cAACa,WAAWH,SAAO,MACjB,sBAAA,cAACG,WAAWa,OAAK;MAACd,YAAW;MAAiCf;SAE/DG,QACC,sBAAA,cAACwB,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACZ,WAAWc,MAAI;MACd9B;MACA+B,KAAK;MACLC,KAAK;MACLC,qBAAqBhC;MACrBiC,SAAS,MAAM9B,QAAQ,KAAA;MACvB+B,UAAU5B;;;;;AAQ1B;;;ADjDO,IAAM6B,sBAAsB,CAAC,EAAEC,MAAMC,KAAI,MAA4B;;;AAC1E,UAAMC,QAAQC,SAASH,IAAAA;AACvB,QAAI,CAACE,OAAO;AACV,aAAO;IACT;AAEA,YAAQD,MAAAA;MACN,KAAK;MACL,KAAK;MACL,KAAK,mBAAmB;AACtB,eACE,gBAAAG,OAAA,cAACC,WAAWC,MAAI;UAACN;WACf,gBAAAI,OAAA,cAACC,WAAWE,SAAO;UAACN;WAClB,gBAAAG,OAAA,cAACC,WAAWG,OAAK,IAAA,CAAA,CAAA;MAIzB;MAEA,SAAS;AACP,eAAO,gBAAAJ,OAAA,cAACK,mBAAAA;UAAkBT;UAAYC;;MACxC;IACF;;;;AACF;AAEA,IAAA,8BAAeF;",
6
+ "names": ["React", "getSpace", "React", "useCallback", "useRef", "useState", "Toolbar", "useTranslation", "StackItem", "mx", "ChessboardArticle", "game", "role", "t", "useTranslation", "meta", "id", "orientation", "setOrientation", "useState", "open", "setOpen", "controller", "useRef", "handleSelect", "useCallback", "index", "current", "setMoveNumber", "StackItem", "Content", "toolbar", "classNames", "Chessboard", "Root", "ref", "Toolbar", "IconButton", "icon", "iconOnly", "label", "disabled", "mx", "onClick", "div", "className", "Board", "Info", "min", "max", "onOrientationChange", "onClose", "onSelect", "ChessboardContainer", "game", "role", "space", "getSpace", "React", "Chessboard", "Root", "Content", "Board", "ChessboardArticle"]
7
+ }
@@ -0,0 +1,12 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ CHESS_BLUEPRINT_KEY,
4
+ blueprint_definition_default
5
+ } from "./chunk-F3HFLDV5.mjs";
6
+ import "./chunk-QKXLEJNZ.mjs";
7
+ import "./chunk-KNOOJFIR.mjs";
8
+ export {
9
+ CHESS_BLUEPRINT_KEY,
10
+ blueprint_definition_default as default
11
+ };
12
+ //# sourceMappingURL=blueprint-definition-GR6OLMB6.mjs.map
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  Chess_exports
4
- } from "./chunk-7YK5RFHY.mjs";
4
+ } from "./chunk-QKXLEJNZ.mjs";
5
5
 
6
6
  // src/capabilities/blueprint-definition.ts
7
7
  import { Capabilities, contributes } from "@dxos/app-framework";
@@ -133,17 +133,17 @@ var play_default = defineFunction3({
133
133
  });
134
134
 
135
135
  // src/capabilities/blueprint-definition.ts
136
- var BLUEPRINT_KEY = "dxos.org/blueprint/chess";
137
136
  var functions = [
138
137
  create_default,
139
138
  move_default,
140
139
  play_default
141
140
  ];
141
+ var CHESS_BLUEPRINT_KEY = "dxos.org/blueprint/chess";
142
142
  var blueprint_definition_default = (() => {
143
143
  return [
144
144
  contributes(Capabilities.Functions, functions),
145
145
  contributes(Capabilities.BlueprintDefinition, Blueprint.make({
146
- key: BLUEPRINT_KEY,
146
+ key: CHESS_BLUEPRINT_KEY,
147
147
  name: "Chess",
148
148
  tools: Blueprint.toolDefinitions({
149
149
  functions
@@ -164,7 +164,7 @@ export {
164
164
  create_default,
165
165
  move_default,
166
166
  play_default,
167
- BLUEPRINT_KEY,
167
+ CHESS_BLUEPRINT_KEY,
168
168
  blueprint_definition_default
169
169
  };
170
- //# sourceMappingURL=chunk-SW5N5XNV.mjs.map
170
+ //# sourceMappingURL=chunk-F3HFLDV5.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/blueprint-definition.ts", "../../../src/functions/create.ts", "../../../src/functions/move.ts", "../../../src/functions/play.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { create, move, play } from '../functions';\n\nconst functions: FunctionDefinition[] = [create, move, play];\n\nexport const CHESS_BLUEPRINT_KEY = 'dxos.org/blueprint/chess';\n\nexport default () => {\n return [\n contributes(Capabilities.Functions, functions),\n contributes(\n Capabilities.BlueprintDefinition,\n Blueprint.make({\n key: CHESS_BLUEPRINT_KEY,\n name: 'Chess',\n tools: Blueprint.toolDefinitions({ functions }),\n instructions: Template.make({\n source: trim`\n You are an expert chess player.\n To analyze a game you can access the \"pgn\" property by loading the context object that represents the current game.\n You could suggest a good next move or offer to play a move.\n Don't actually make a move unless you are asked to.\n `,\n }),\n }),\n ),\n ];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { DatabaseService, defineFunction } from '@dxos/functions';\n\nimport { Chess } from '../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/create',\n name: 'Create Chess',\n description: 'Creates a new chess game.',\n inputSchema: Schema.Struct({\n pgn: Schema.optional(\n Schema.String.annotations({\n description: 'Portable Game Notation.',\n }),\n ),\n fen: Schema.optional(\n Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }),\n ),\n }),\n outputSchema: Chess.Game,\n handler: Effect.fn(function* ({ data: { pgn, fen } }) {\n return yield* DatabaseService.add(Chess.makeGame({ pgn, fen }));\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { ArtifactId } from '@dxos/assistant';\nimport { DatabaseService, defineFunction } from '@dxos/functions';\n\nimport { Chess } from '../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/move',\n name: 'Move',\n description: 'Makes a move in the given chess game.',\n inputSchema: Schema.Struct({\n id: ArtifactId.annotations({\n description: 'The ID of the chess object.',\n }),\n move: Schema.String.annotations({\n description: 'The move to make in the chess game.',\n examples: ['e4', 'Bf3'],\n }),\n }),\n outputSchema: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n }),\n handler: Effect.fn(function* ({ data: { id, move } }) {\n const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.Game);\n const chess = new ChessJS();\n if (object.pgn) {\n chess.loadPgn(object.pgn);\n } else if (object.fen) {\n chess.load(object.fen);\n }\n\n chess.move(move, { strict: false });\n object.pgn = chess.pgn();\n return { pgn: object.pgn };\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { ArtifactId } from '@dxos/assistant';\nimport { DatabaseService, defineFunction } from '@dxos/functions';\n\nimport { Chess } from '../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/chess/play',\n name: 'Play',\n description: 'Uses the chess engine to play the next move.',\n inputSchema: Schema.Struct({\n id: ArtifactId.annotations({\n description: 'The ID of the chess object.',\n }),\n side: Schema.optional(Schema.Literal('white', 'black', 'any')).annotations({\n description: 'The side to play.',\n defaultValue: 'any',\n }),\n }),\n outputSchema: Schema.Struct({\n pgn: Schema.String.annotations({\n description: 'The PGN of the game after the move was played.',\n }),\n move: Schema.optional(Schema.String).annotations({\n description: 'The move that was played.',\n }),\n }),\n handler: Effect.fn(function* ({ data: { id, side = 'any' } }) {\n const object = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Chess.Game);\n const chess = new ChessJS();\n if (object.pgn) {\n chess.loadPgn(object.pgn);\n } else if (object.fen) {\n chess.load(object.fen);\n }\n\n if (!(side === 'any' || (chess.turn() === 'w' && side === 'white') || (chess.turn() === 'b' && side === 'black'))) {\n return { move: undefined, pgn: object.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 object.pgn = chess.pgn();\n return { move, pgn: object.pgn };\n }),\n});\n"],
5
+ "mappings": ";;;;;;AAIA,SAASA,cAAcC,mBAAmB;AAC1C,SAASC,WAAWC,gBAAgB;AAEpC,SAASC,YAAY;;;ACHrB,YAAYC,YAAY;AACxB,YAAYC,YAAY;AAExB,SAASC,iBAAiBC,sBAAsB;AAIhD,IAAA,iBAAeC,eAAe;EAC5BC,KAAK;EACLC,MAAM;EACNC,aAAa;EACbC,aAAoBC,cAAO;IACzBC,KAAYC,gBACHC,cAAOC,YAAY;MACxBN,aAAa;IACf,CAAA,CAAA;IAEFO,KAAYH,gBACHC,cAAOC,YAAY;MACxBN,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA;EACAQ,cAAcC,cAAMC;EACpBC,SAAgBC,UAAG,WAAW,EAAEC,MAAM,EAAEV,KAAKI,IAAG,EAAE,GAAE;AAClD,WAAO,OAAOO,gBAAgBC,IAAIN,cAAMO,SAAS;MAAEb;MAAKI;IAAI,CAAA,CAAA;EAC9D,CAAA;AACF,CAAA;;;AC3BA,SAASU,SAASC,eAAe;AACjC,YAAYC,aAAY;AACxB,YAAYC,aAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,mBAAAA,kBA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;;;;;MAMV,CAAA;IACF,CAAA,CAAA;;AAGN;",
6
+ "names": ["Capabilities", "contributes", "Blueprint", "Template", "trim", "Effect", "Schema", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "pgn", "optional", "String", "annotations", "fen", "outputSchema", "Chess", "Game", "handler", "fn", "data", "DatabaseService", "add", "makeGame", "Chess", "ChessJS", "Effect", "Schema", "ArtifactId", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "move", "String", "examples", "outputSchema", "pgn", "handler", "fn", "data", "object", "DatabaseService", "resolve", "toDXN", "Chess", "Game", "chess", "ChessJS", "loadPgn", "fen", "load", "strict", "Chess", "ChessJS", "Effect", "Schema", "ArtifactId", "DatabaseService", "defineFunction", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "side", "optional", "Literal", "defaultValue", "outputSchema", "pgn", "String", "move", "handler", "fn", "data", "object", "DatabaseService", "resolve", "toDXN", "Chess", "Game", "chess", "ChessJS", "loadPgn", "fen", "load", "turn", "undefined", "moves", "Math", "floor", "random", "length", "strict", "functions", "create", "move", "play", "CHESS_BLUEPRINT_KEY", "contributes", "Capabilities", "Functions", "BlueprintDefinition", "Blueprint", "make", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
7
+ }
@@ -1,7 +1,7 @@
1
1
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
2
  import {
3
3
  meta
4
- } from "./chunk-5C2OYL2B.mjs";
4
+ } from "./chunk-KNOOJFIR.mjs";
5
5
 
6
6
  // src/components/Chessboard.tsx
7
7
  import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
@@ -113,7 +113,7 @@ var History = ({ classNames, model, min, max, onSelect }) => {
113
113
  ]);
114
114
  return /* @__PURE__ */ React.createElement("div", {
115
115
  ref: scrollerRef,
116
- className: mx("overflow-y-scroll", classNames),
116
+ className: mx("overflow-y-auto", classNames),
117
117
  style: {
118
118
  minHeight: min === void 0 ? "auto" : `${min * 24}px`,
119
119
  maxHeight: max === void 0 ? "auto" : `${max * 24}px`
@@ -143,7 +143,7 @@ var PlayerIndicator = ({ children, model, player, icon }) => {
143
143
  try {
144
144
  const turn = player === (model.game.turn() === "w" ? "white" : "black");
145
145
  return /* @__PURE__ */ React.createElement("div", {
146
- className: "grid grid-cols-[2rem_1fr_2rem] gap-2 bs-[--rail-size] pis-1 pie-1 flex items-center overflow-hidden"
146
+ className: "grid grid-cols-[2rem_1fr_2rem] gap-2 bs-[--rail-size] pli-1 flex items-center overflow-hidden"
147
147
  }, /* @__PURE__ */ React.createElement("div", {
148
148
  className: "place-items-center"
149
149
  }, /* @__PURE__ */ React.createElement(Icon, {
@@ -180,22 +180,10 @@ var PlayerSelector = ({ value, onValueChange, members }) => {
180
180
  };
181
181
 
182
182
  // src/components/Chessboard.tsx
183
- function _define_property(obj, key, value) {
184
- if (key in obj) {
185
- Object.defineProperty(obj, key, {
186
- value,
187
- enumerable: true,
188
- configurable: true,
189
- writable: true
190
- });
191
- } else {
192
- obj[key] = value;
193
- }
194
- return obj;
195
- }
196
183
  var ExtendedChessModel = class extends ChessModel {
184
+ object;
197
185
  constructor(object) {
198
- super(), _define_property(this, "object", void 0), this.object = object;
186
+ super(), this.object = object;
199
187
  }
200
188
  };
201
189
  var Root = /* @__PURE__ */ forwardRef(({ game, children }, forwardedRef) => {
@@ -304,4 +292,4 @@ export {
304
292
  ExtendedChessModel,
305
293
  Chessboard
306
294
  };
307
- //# sourceMappingURL=chunk-DWGG7IGH.mjs.map
295
+ //# sourceMappingURL=chunk-F4C2HVZL.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/Chessboard.tsx", "../../../src/components/Info.tsx"],
4
- "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, {\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n 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';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { type Chess } from '../types';\n\nimport { Info, type InfoProps } from './Info';\n\nexport interface ChessboardController {\n setMoveNumber(index: number): void;\n}\n\nexport class ExtendedChessModel extends ChessModel {\n constructor(readonly object: Chess.Game) {\n super();\n }\n}\n\n//\n// Root\n//\n\ntype RootProps = PropsWithChildren<{\n game: Chess.Game;\n}>;\n\nconst Root = forwardRef<ChessboardController, RootProps>(({ game, children }, forwardedRef) => {\n const model = useMemo(() => new ExtendedChessModel(game), []);\n const click = useSoundEffect('Click');\n\n // Controller.\n useImperativeHandle(forwardedRef, () => {\n return {\n setMoveNumber: (index) => model.setMoveIndex(index),\n };\n }, [model]);\n\n // External change.\n // NOTE: Warning if user has not interacted with the board.\n useEffect(() => {\n if (model.pgn !== getRawPgn(game.pgn ?? '')) {\n const silent = model.pgn === '*';\n model.update(game.pgn);\n if (!silent) {\n void click.play();\n }\n }\n }, [game.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 game.pgn = 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--popover' | 'card--intrinsic' | 'card--extrinsic';\n\ntype ContentProps = ThemedClassName<PropsWithChildren<{ role?: Role }>>;\n\nconst Content = ({ classNames, children, role }: ContentProps) => {\n return (\n <Gameboard.Content\n classNames={mx(classNames, role === 'card--popover' && 'size-container popover-square')}\n grow={!role || role === 'card--extrinsic'}\n contain={!role || role === 'card--extrinsic' || role === 'card--popover'}\n >\n {children}\n </Gameboard.Content>\n );\n};\n\n//\n// Board\n//\n\ntype BoardProps = NaturalChessboardProps;\n\nconst Board = (props: BoardProps) => {\n const { model } = useGameboardContext<ChessModel>(Board.displayName);\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 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 (model.moveIndex.value > 0) {\n model.setMoveIndex(model.moveIndex.value - 1);\n }\n break;\n case 'ArrowRight':\n if (model.moveIndex.value < model.game.history().length) {\n model.setMoveIndex(model.moveIndex.value + 1);\n }\n break;\n }\n });\n }, [model]);\n\n return <NaturalChessboard ref={ref} {...props} />;\n};\n\nBoard.displayName = 'Chessboard.Board';\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 React, { type JSX, type PropsWithChildren, useEffect, useMemo, useRef } from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { type SpaceMember, getSpace, useMembers } from '@dxos/react-client/echo';\nimport { Icon, IconButton, Select, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { type Player, useGameboardContext } from '@dxos/react-ui-gameboard';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\n\nimport { type ExtendedChessModel } from './Chessboard';\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.displayName);\n const members = useMembers(getSpace(model.object)?.key);\n\n return (\n <div\n className={mx(\n 'grid grid-rows-[min-content_1fr_min-content] is-full min-is-[18rem] p-2 overflow-hidden bg-groupSurface rounded-sm',\n classNames,\n )}\n >\n <PlayerIndicator\n model={model}\n player={orientation === 'white' ? 'black' : 'white'}\n icon={\n onClose && (\n <IconButton icon='ph--x--regular' iconOnly label={t('close info button')} size={4} onClick={onClose} />\n )\n }\n >\n <PlayerSelector\n value={model.object.players?.[orientation === 'white' ? 'black' : 'white']}\n onValueChange={(value) => {\n model.object.players![orientation === 'white' ? 'black' : 'white'] = value;\n }}\n members={members}\n />\n </PlayerIndicator>\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 <PlayerSelector\n value={model.object.players?.[orientation]}\n onValueChange={(value) => {\n model.object.players![orientation] = value;\n }}\n members={members}\n />\n </PlayerIndicator>\n </div>\n );\n};\n\nInfo.displayName = 'Chessboard.Info';\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 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=\"${model.moveIndex.value - 1}\"]`);\n scrollerRef.current?.classList.add('scrollbar-none');\n div?.scrollIntoView({ behavior: 'smooth' });\n scrollerRef.current?.classList.remove('scrollbar-none');\n }, [model.moveIndex.value]);\n\n return (\n <div\n ref={scrollerRef}\n className={mx('overflow-y-scroll', 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 pis-4 leading-1'>\n <div className='content-center text-xs text-subdued'>{index + 1}</div>\n {a && (\n <div\n data-index={a.index}\n className={mx('pis-2 cursor-pointer', a.index === model.moveIndex.value - 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('pis-2 cursor-pointer', b.index === model.moveIndex.value - 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 bs-[--rail-size] pis-1 pie-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-red-500' : 'text-green-500'))}\n />\n </div>\n <div className='truncate overflow-hidden items-center'>{children}</div>\n {icon}\n </div>\n );\n};\n\n//\n// PlayerSelector\n//\n\ntype PlayerSelectorProps = {\n value?: string;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n};\n\nconst PlayerSelector = ({ value, onValueChange, members }: PlayerSelectorProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={t('select player button')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n"],
5
- "mappings": ";;;;;;;AAIA,OAAOA,UAELC,YACAC,aACAC,aAAAA,YACAC,qBACAC,WAAAA,UACAC,UAAAA,eACK;AAEP,SAASC,wBAAwB;AAEjC,SACEC,YACAC,WAEAC,cAAcC,mBAEdC,WACAC,uBAAAA,4BACK;AACP,SAASC,sBAAsB;AAC/B,SAASC,MAAAA,WAAU;;;;ACtBnB,OAAOC,SAA2CC,WAAWC,SAASC,cAAc;AAEpF,SAASC,oBAAoB;AAC7B,SAA2BC,UAAUC,kBAAkB;AACvD,SAASC,MAAMC,YAAYC,QAA8BC,sBAAsB;AAC/E,SAAsBC,2BAA2B;AACjD,SAASC,U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F,KAAK;AACH,gBAAIvC,MAAMwC,UAAUC,QAAQ,GAAG;AAC7BzC,oBAAMO,aAAaP,MAAMwC,UAAUC,QAAQ,CAAA;YAC7C;AACA;UACF,KAAK;AACH,gBAAIzC,MAAMwC,UAAUC,QAAQzC,MAAMH,KAAKyC,QAAO,EAAGC,QAAQ;AACvDvC,oBAAMO,aAAaP,MAAMwC,UAAUC,QAAQ,CAAA;YAC7C;AACA;QACJ;MACF,CAAA;IACF,GAAG;MAACzC;KAAM;AAEV,WAAO,gBAAAkB,OAAA,cAACwB,mBAAAA;MAAkBX;MAAW,GAAGH;;;;;AAC1C;AAEAD,MAAMG,cAAc;AAMb,IAAMa,aAAa;EACxBhD;EACA0B;EACAM;EACAiB;AACF;",
4
+ "sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React, {\n type PropsWithChildren,\n forwardRef,\n useCallback,\n useEffect,\n useImperativeHandle,\n useMemo,\n useRef,\n} from 'react';\n\nimport { addEventListener } from '@dxos/async';\nimport { type ThemedClassName } from '@dxos/react-ui';\nimport {\n 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';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { type Chess } from '../types';\n\nimport { Info, type InfoProps } from './Info';\n\nexport interface ChessboardController {\n setMoveNumber(index: number): void;\n}\n\nexport class ExtendedChessModel extends ChessModel {\n constructor(readonly object: Chess.Game) {\n super();\n }\n}\n\n//\n// Root\n//\n\ntype RootProps = PropsWithChildren<{\n game: Chess.Game;\n}>;\n\nconst Root = forwardRef<ChessboardController, RootProps>(({ game, children }, forwardedRef) => {\n const model = useMemo(() => new ExtendedChessModel(game), []);\n const click = useSoundEffect('Click');\n\n // Controller.\n useImperativeHandle(forwardedRef, () => {\n return {\n setMoveNumber: (index) => model.setMoveIndex(index),\n };\n }, [model]);\n\n // External change.\n // NOTE: Warning if user has not interacted with the board.\n useEffect(() => {\n if (model.pgn !== getRawPgn(game.pgn ?? '')) {\n const silent = model.pgn === '*';\n model.update(game.pgn);\n if (!silent) {\n void click.play();\n }\n }\n }, [game.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 game.pgn = 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--popover' | 'card--intrinsic' | 'card--extrinsic';\n\ntype ContentProps = ThemedClassName<PropsWithChildren<{ role?: Role }>>;\n\nconst Content = ({ classNames, children, role }: ContentProps) => {\n return (\n <Gameboard.Content\n classNames={mx(classNames, role === 'card--popover' && 'size-container popover-square')}\n grow={!role || role === 'card--extrinsic'}\n contain={!role || role === 'card--extrinsic' || role === 'card--popover'}\n >\n {children}\n </Gameboard.Content>\n );\n};\n\n//\n// Board\n//\n\ntype BoardProps = NaturalChessboardProps;\n\nconst Board = (props: BoardProps) => {\n const { model } = useGameboardContext<ChessModel>(Board.displayName);\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 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 (model.moveIndex.value > 0) {\n model.setMoveIndex(model.moveIndex.value - 1);\n }\n break;\n case 'ArrowRight':\n if (model.moveIndex.value < model.game.history().length) {\n model.setMoveIndex(model.moveIndex.value + 1);\n }\n break;\n }\n });\n }, [model]);\n\n return <NaturalChessboard ref={ref} {...props} />;\n};\n\nBoard.displayName = 'Chessboard.Board';\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 React, { type JSX, type PropsWithChildren, useEffect, useMemo, useRef } from 'react';\n\nimport { generateName } from '@dxos/display-name';\nimport { type SpaceMember, getSpace, useMembers } from '@dxos/react-client/echo';\nimport { Icon, IconButton, Select, type ThemedClassName, useTranslation } from '@dxos/react-ui';\nimport { type Player, useGameboardContext } from '@dxos/react-ui-gameboard';\nimport { mx } from '@dxos/react-ui-theme';\n\nimport { meta } from '../meta';\n\nimport { type ExtendedChessModel } from './Chessboard';\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.displayName);\n const members = useMembers(getSpace(model.object)?.key);\n\n return (\n <div\n className={mx(\n 'grid grid-rows-[min-content_1fr_min-content] is-full min-is-[18rem] p-2 overflow-hidden bg-groupSurface rounded-sm',\n classNames,\n )}\n >\n <PlayerIndicator\n model={model}\n player={orientation === 'white' ? 'black' : 'white'}\n icon={\n onClose && (\n <IconButton icon='ph--x--regular' iconOnly label={t('close info button')} size={4} onClick={onClose} />\n )\n }\n >\n <PlayerSelector\n value={model.object.players?.[orientation === 'white' ? 'black' : 'white']}\n onValueChange={(value) => {\n model.object.players![orientation === 'white' ? 'black' : 'white'] = value;\n }}\n members={members}\n />\n </PlayerIndicator>\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 <PlayerSelector\n value={model.object.players?.[orientation]}\n onValueChange={(value) => {\n model.object.players![orientation] = value;\n }}\n members={members}\n />\n </PlayerIndicator>\n </div>\n );\n};\n\nInfo.displayName = 'Chessboard.Info';\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 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=\"${model.moveIndex.value - 1}\"]`);\n scrollerRef.current?.classList.add('scrollbar-none');\n div?.scrollIntoView({ behavior: 'smooth' });\n scrollerRef.current?.classList.remove('scrollbar-none');\n }, [model.moveIndex.value]);\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 pis-4 leading-1'>\n <div className='content-center text-xs text-subdued'>{index + 1}</div>\n {a && (\n <div\n data-index={a.index}\n className={mx('pis-2 cursor-pointer', a.index === model.moveIndex.value - 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('pis-2 cursor-pointer', b.index === model.moveIndex.value - 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 bs-[--rail-size] pli-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-red-500' : 'text-green-500'))}\n />\n </div>\n <div className='truncate overflow-hidden items-center'>{children}</div>\n {icon}\n </div>\n );\n};\n\n//\n// PlayerSelector\n//\n\ntype PlayerSelectorProps = {\n value?: string;\n onValueChange: (player: string) => void;\n members: SpaceMember[];\n};\n\nconst PlayerSelector = ({ value, onValueChange, members }: PlayerSelectorProps) => {\n const { t } = useTranslation(meta.id);\n return (\n <Select.Root value={value} onValueChange={onValueChange}>\n <Select.TriggerButton placeholder={t('select player button')} />\n <Select.Portal>\n <Select.Content>\n <Select.Viewport>\n {members.map((member) => {\n const memberKey = member.identity.identityKey.toHex();\n const displayName = member.identity?.profile?.displayName || generateName(memberKey);\n return (\n <Select.Option key={memberKey} value={memberKey}>\n {displayName}\n </Select.Option>\n );\n })}\n </Select.Viewport>\n <Select.Arrow />\n </Select.Content>\n </Select.Portal>\n </Select.Root>\n );\n};\n"],
5
+ "mappings": ";;;;;;;AAIA,OAAOA,UAELC,YACAC,aACAC,aAAAA,YACAC,qBACAC,WAAAA,UACAC,UAAAA,eACK;AAEP,SAASC,wBAAwB;AAEjC,SACEC,YACAC,WAEAC,cAAcC,mBAEdC,WACAC,uBAAAA,4BACK;AACP,SAASC,sBAAsB;AAC/B,SAASC,MAAAA,WAAU;;;;ACtBnB,OAAOC,SAA2CC,WAAWC,SAASC,cAAc;AAEpF,SAASC,oBAAoB;AAC7B,SAA2BC,UAAUC,kBAAkB;AACvD,SAASC,MAAMC,YAAYC,QAA8BC,sBAAsB;AAC/E,SAAsBC,2BAA2B;AACjD,SAASC,UAAU;AAcZ,IAAMC,OAAO,CAAC,EAAEC,YAAYC,cAAc,SAASC,qBAAqBC,SAAS,GAAGC,MAAAA,MAAkB;;;AAC3G,UAAM,EAAEC,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAM,EAAEC,MAAK,IAAKC,oBAAwCX,KAAKY,WAAW;AAC1E,UAAMC,UAAUC,WAAWC,SAASL,MAAMM,MAAM,GAAGC,GAAAA;AAEnD,WACE,sBAAA,cAACC,OAAAA;MACCC,WAAWC,GACT,sHACAnB,UAAAA;OAGF,sBAAA,cAACoB,iBAAAA;MACCX;MACAY,QAAQpB,gBAAgB,UAAU,UAAU;MAC5CqB,MACEnB,WACE,sBAAA,cAACoB,YAAAA;QAAWD,MAAK;QAAiBE,UAAAA;QAASC,OAAOpB,EAAE,mBAAA;QAAsBqB,MAAM;QAAGC,SAASxB;;OAIhG,sBAAA,cAACyB,gBAAAA;MACCC,OAAOpB,MAAMM,OAAOe,UAAU7B,gBAAgB,UAAU,UAAU,OAAA;MAClE8B,eAAe,CAACF,UAAAA;AACdpB,cAAMM,O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,CAACH,QAAQA,SAAS,qBAAqBA,SAAS;OAExDzB,QAAAA;;;;AAGP;AAQA,IAAM6B,QAAQ,CAACC,UAAAA;;;AACb,UAAM,EAAE5B,MAAK,IAAK6B,qBAAgCF,MAAMG,WAAW;AAGnE,UAAMC,MAAMC,QAAuB,IAAA;AACnCxB,IAAAA,WAAU,MAAA;AACR,UAAI,CAACuB,IAAIE,SAAS;AAChB;MACF;AAGAF,UAAIE,QAAQC,aAAa,mBAAmB,KAAA;AAE5C,aAAOC,iBAAiBJ,IAAIE,SAAS,WAAW,CAACG,OAAAA;AAC/C,gBAAQA,GAAGC,KAAG;UACZ,KAAK;AACHrC,kBAAMO,aAAa,CAAA;AACnB;UACF,KAAK;AACHP,kBAAMO,aAAaP,MAAMH,KAAKyC,QAAO,EAAGC,MAAM;AAC9C;UACF,KAAK;AACH,gBAAIvC,MAAMwC,UAAUC,QAAQ,GAAG;AAC7BzC,oBAAMO,aAAaP,MAAMwC,UAAUC,QAAQ,CAAA;YAC7C;AACA;UACF,KAAK;AACH,gBAAIzC,MAAMwC,UAAUC,QAAQzC,MAAMH,KAAKyC,QAAO,EAAGC,QAAQ;AACvDvC,oBAAMO,aAAaP,MAAMwC,UAAUC,QAAQ,CAAA;YAC7C;AACA;QACJ;MACF,CAAA;IACF,GAAG;MAACzC;KAAM;AAEV,WAAO,gBAAAkB,OAAA,cAACwB,mBAAAA;MAAkBX;MAAW,GAAGH;;;;;AAC1C;AAEAD,MAAMG,cAAc;AAMb,IAAMa,aAAa;EACxBhD;EACA0B;EACAM;EACAiB;AACF;",
6
6
  "names": ["React", "forwardRef", "useCallback", "useEffect", "useImperativeHandle", "useMemo", "useRef", "addEventListener", "ChessModel", "Gameboard", "Chessboard", "NaturalChessboard", "getRawPgn", "useGameboardContext", "useSoundEffect", "mx", "React", "useEffect", "useMemo", "useRef", "generateName", "getSpace", "useMembers", "Icon", "IconButton", "Select", "useTranslation", "useGameboardContext", "mx", "Info", "classNames", "orientation", "onOrientationChange", "onClose", "props", "t", "useTranslation", "meta", "id", "model", "useGameboardContext", "displayName", "members", "useMembers", "getSpace", "object", "key", "div", "className", "mx", "PlayerIndicator", "player", "icon", "IconButton", "iconOnly", "label", "size", "onClick", "PlayerSelector", "value", "players", "onValueChange", "History", "min", "max", "onSelect", "game", "isGameOver", "isCheckmate", "isStalemate", "isCheck", "undefined", "history", "moves", "useMemo", "reduce", "acc", "move", "index", "push", "length", "scrollerRef", "useRef", "useEffect", "current", "scrollTo", "top", "scrollHeight", "querySelector", "moveIndex", "classList", "add", "scrollIntoView", "behavior", "remove", "ref", "style", "minHeight", "maxHeight", "map", "a", "b", "data-index", "children", "turn", "Icon", "Select", "Root", "TriggerButton", "placeholder", "Portal", "Content", "Viewport", "member", "memberKey", "identity", "identityKey", "toHex", "profile", "generateName", "Option", "Arrow", "ExtendedChessModel", "ChessModel", "object", "Root", "forwardRef", "game", "children", "forwardedRef", "model", "useMemo", "click", "useSoundEffect", "useImperativeHandle", "setMoveNumber", "index", "setMoveIndex", "useEffect", "pgn", "getRawPgn", "silent", "update", "play", "handleDrop", "useCallback", "move", "makeMove", "React", "Gameboard", "onDrop", "Content", "classNames", "role", "mx", "grow", "contain", "Board", "props", "useGameboardContext", "displayName", "ref", "useRef", "current", "setAttribute", "addEventListener", "ev", "key", "history", "length", "moveIndex", "value", "NaturalChessboard", "Chessboard", "Info"]
7
7
  }
@@ -11,9 +11,11 @@ var meta = {
11
11
  id: "dxos.org/plugin/chess",
12
12
  name: "Chess",
13
13
  description: trim`
14
- Play chess with friends or practice with the AI.
14
+ Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.
15
+ Track game history and analyze moves in real-time.
15
16
  `,
16
17
  icon: "ph--shield-chevron--regular",
18
+ iconHue: "amber",
17
19
  source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess",
18
20
  screenshots: [
19
21
  "https://dxos.network/plugin-details-chess-dark.png"
@@ -24,4 +26,4 @@ export {
24
26
  __export,
25
27
  meta
26
28
  };
27
- //# sourceMappingURL=chunk-5C2OYL2B.mjs.map
29
+ //# sourceMappingURL=chunk-KNOOJFIR.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/meta.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type PluginMeta } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: PluginMeta = {\n id: 'dxos.org/plugin/chess',\n name: 'Chess',\n description: trim`\n Full-featured chess game supporting multiplayer matches with friends or practice sessions against AI opponents.\n Track game history and analyze moves in real-time.\n `,\n icon: 'ph--shield-chevron--regular',\n iconHue: 'amber',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-chess',\n screenshots: ['https://dxos.network/plugin-details-chess-dark.png'],\n};\n"],
5
+ "mappings": ";;;;;;;;AAKA,SAASA,YAAY;AAEd,IAAMC,OAAmB;EAC9BC,IAAI;EACJC,MAAM;EACNC,aAAaC;;;;EAIbC,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,aAAa;IAAC;;AAChB;",
6
+ "names": ["trim", "meta", "id", "name", "description", "trim", "icon", "iconHue", "source", "screenshots"]
7
+ }
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  __export,
4
4
  meta
5
- } from "./chunk-5C2OYL2B.mjs";
5
+ } from "./chunk-KNOOJFIR.mjs";
6
6
 
7
7
  // src/types/Chess.ts
8
8
  var Chess_exports = {};
@@ -13,32 +13,31 @@ __export(Chess_exports, {
13
13
  import { Chess as ChessJS } from "chess.js";
14
14
  import * as Schema from "effect/Schema";
15
15
  import { Obj, Type } from "@dxos/echo";
16
- import { LabelAnnotation } from "@dxos/echo/internal";
16
+ import { FormInputAnnotation, LabelAnnotation } from "@dxos/echo/internal";
17
17
  import { log } from "@dxos/log";
18
- import { ItemAnnotation } from "@dxos/schema";
19
18
  var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
20
19
  var Game = Schema.Struct({
21
20
  name: Schema.optional(Schema.String),
22
- players: Schema.optional(Schema.Struct({
21
+ players: Schema.Struct({
23
22
  white: Schema.optional(Schema.String.annotations({
24
23
  description: "DID of white player"
25
24
  })),
26
25
  black: Schema.optional(Schema.String.annotations({
27
26
  description: "DID of black player"
28
27
  }))
29
- }).pipe(Schema.mutable)),
30
- pgn: Schema.optional(Schema.String.annotations({
28
+ }).pipe(Schema.mutable, FormInputAnnotation.set(false), Schema.optional),
29
+ pgn: Schema.String.annotations({
31
30
  description: "Portable Game Notation."
32
- })),
33
- fen: Schema.optional(Schema.String.annotations({
31
+ }).pipe(FormInputAnnotation.set(false), Schema.optional),
32
+ fen: Schema.String.annotations({
34
33
  description: "Forsyth-Edwards Notation."
35
- }))
34
+ }).pipe(FormInputAnnotation.set(false), Schema.optional)
36
35
  }).pipe(Type.Obj({
37
36
  typename: "dxos.org/type/Chess",
38
37
  version: "0.2.0"
39
38
  }), LabelAnnotation.set([
40
39
  "name"
41
- ]), ItemAnnotation.set(true));
40
+ ]));
42
41
  var makeGame = ({ name, pgn, fen } = {}) => {
43
42
  const chess = new ChessJS();
44
43
  if (pgn) {
@@ -47,7 +46,7 @@ var makeGame = ({ name, pgn, fen } = {}) => {
47
46
  } catch {
48
47
  log.warn(pgn, void 0, {
49
48
  F: __dxlog_file,
50
- L: 56,
49
+ L: 48,
51
50
  S: void 0,
52
51
  C: (f, a) => f(...a)
53
52
  });
@@ -82,4 +81,4 @@ export {
82
81
  Chess_exports,
83
82
  ChessAction_exports
84
83
  };
85
- //# sourceMappingURL=chunk-7YK5RFHY.mjs.map
84
+ //# sourceMappingURL=chunk-QKXLEJNZ.mjs.map