@dxos/plugin-chess 0.8.4-main.a4bbb77 → 0.8.4-main.ae835ea
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{ChessboardContainer-JOCAWL5W.mjs → ChessboardContainer-SZMONNHG.mjs} +4 -5
- package/dist/lib/browser/{ChessboardContainer-JOCAWL5W.mjs.map → ChessboardContainer-SZMONNHG.mjs.map} +3 -3
- package/dist/lib/browser/blueprint-definition-FD4TL5EE.mjs +11 -0
- package/dist/lib/browser/{chunk-WSUUPPDK.mjs → chunk-DUO4WTAM.mjs} +4 -2
- package/dist/lib/browser/chunk-DUO4WTAM.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3WEALY7P.mjs → chunk-FBLAVAMY.mjs} +12 -12
- package/dist/lib/browser/chunk-FBLAVAMY.mjs.map +7 -0
- package/dist/lib/browser/{chunk-NR4YFUK7.mjs → chunk-R6KK3WAS.mjs} +5 -17
- package/dist/lib/browser/{chunk-NR4YFUK7.mjs.map → chunk-R6KK3WAS.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-4ULSTPL6.mjs → chunk-TIIGNOGK.mjs} +11 -8
- package/dist/lib/browser/chunk-TIIGNOGK.mjs.map +7 -0
- package/dist/lib/browser/{chunk-2EN3CBLB.mjs → chunk-WLXUZMHC.mjs} +2 -2
- package/dist/lib/browser/index.mjs +21 -20
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-PMP36Y5B.mjs → intent-resolver-GXZN2EBT.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-TSLFLTXN.mjs → react-surface-EVJLBV6U.mjs} +5 -5
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{ChessboardContainer-XAVVBRFW.mjs → ChessboardContainer-GAIIADOA.mjs} +4 -5
- package/dist/lib/node-esm/{ChessboardContainer-XAVVBRFW.mjs.map → ChessboardContainer-GAIIADOA.mjs.map} +3 -3
- package/dist/lib/node-esm/blueprint-definition-O7ZM3HUF.mjs +12 -0
- package/dist/lib/node-esm/{chunk-7PHZFXU5.mjs → chunk-FKRBFLJC.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-VVTQFCUK.mjs → chunk-IVEIH4ER.mjs} +5 -17
- package/dist/lib/node-esm/{chunk-VVTQFCUK.mjs.map → chunk-IVEIH4ER.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-5C2OYL2B.mjs → chunk-KNOOJFIR.mjs} +4 -2
- package/dist/lib/node-esm/chunk-KNOOJFIR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LMXETYDF.mjs → chunk-MP3A3AGA.mjs} +12 -12
- package/dist/lib/node-esm/chunk-MP3A3AGA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-AR3TI5LX.mjs → chunk-RTCAAOLF.mjs} +11 -8
- package/dist/lib/node-esm/chunk-RTCAAOLF.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +21 -20
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-5P7Y2ZKB.mjs → intent-resolver-HK5L6P6Z.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-AN4SMEDU.mjs → react-surface-4PRNWQ2V.mjs} +5 -5
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/ChessPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/artifact-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/components/Card.stories.d.ts +11 -2
- package/dist/types/src/components/Card.stories.d.ts.map +1 -1
- package/dist/types/src/components/Chessboard.stories.d.ts +8 -8
- package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -1
- package/dist/types/src/functions/create.d.ts +1 -1
- package/dist/types/src/functions/create.d.ts.map +1 -1
- package/dist/types/src/functions/move.d.ts.map +1 -1
- package/dist/types/src/functions/play.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +8 -8
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/Chess.d.ts +2 -2
- package/dist/types/src/types/Chess.d.ts.map +1 -1
- package/dist/types/src/types/ChessAction.d.ts +1 -1
- package/dist/types/src/types/ChessAction.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -30
- package/src/ChessPlugin.tsx +3 -2
- package/src/capabilities/artifact-definition.ts +3 -2
- package/src/capabilities/blueprint-definition.ts +3 -3
- package/src/components/Card.stories.tsx +2 -2
- package/src/components/ChessboardArticle.tsx +1 -1
- package/src/components/Info.tsx +4 -4
- package/src/functions/create.ts +2 -1
- package/src/functions/move.ts +2 -1
- package/src/functions/play.ts +2 -1
- package/src/meta.ts +3 -1
- package/src/translations.ts +8 -8
- package/src/types/Chess.ts +20 -26
- package/src/types/ChessAction.ts +1 -1
- package/dist/lib/browser/blueprint-definition-LC4GNYMG.mjs +0 -11
- package/dist/lib/browser/chunk-3WEALY7P.mjs.map +0 -7
- package/dist/lib/browser/chunk-4ULSTPL6.mjs.map +0 -7
- package/dist/lib/browser/chunk-WSUUPPDK.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-FBGRWYEW.mjs +0 -12
- package/dist/lib/node-esm/chunk-5C2OYL2B.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-AR3TI5LX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LMXETYDF.mjs.map +0 -7
- /package/dist/lib/browser/{blueprint-definition-LC4GNYMG.mjs.map → blueprint-definition-FD4TL5EE.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-2EN3CBLB.mjs.map → chunk-WLXUZMHC.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-PMP36Y5B.mjs.map → intent-resolver-GXZN2EBT.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-TSLFLTXN.mjs.map → react-surface-EVJLBV6U.mjs.map} +0 -0
- /package/dist/lib/node-esm/{blueprint-definition-FBGRWYEW.mjs.map → blueprint-definition-O7ZM3HUF.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-7PHZFXU5.mjs.map → chunk-FKRBFLJC.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-5P7Y2ZKB.mjs.map → intent-resolver-HK5L6P6Z.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-AN4SMEDU.mjs.map → react-surface-4PRNWQ2V.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/types/Chess.ts":{"bytes":5620,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","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":1848,"imports":[{"path":"effect","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":3177,"imports":[{"path":"effect","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":5054,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","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":6741,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","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":24809,"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":8322,"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":3391,"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":5734},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4ULSTPL6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-2EN3CBLB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3WEALY7P.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NR4YFUK7.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-LC4GNYMG.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/intent-resolver-PMP36Y5B.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-surface-TSLFLTXN.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":807}},"bytes":3461},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3WEALY7P.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-LC4GNYMG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/blueprint-definition-LC4GNYMG.mjs":{"imports":[{"path":"dist/lib/browser/chunk-4ULSTPL6.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3WEALY7P.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-4ULSTPL6.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9598},"dist/lib/browser/chunk-4ULSTPL6.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3WEALY7P.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","kind":"import-statement","external":true},{"path":"@dxos/functions","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","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","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":703},"src/functions/index.ts":{"bytesInOutput":0},"src/functions/move.ts":{"bytesInOutput":1284},"src/functions/play.ts":{"bytesInOutput":1732}},"bytes":5068},"dist/lib/browser/intent-resolver-PMP36Y5B.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1073},"dist/lib/browser/intent-resolver-PMP36Y5B.mjs":{"imports":[{"path":"dist/lib/browser/chunk-3WEALY7P.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-JOCAWL5W.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5952},"dist/lib/browser/ChessboardContainer-JOCAWL5W.mjs":{"imports":[{"path":"dist/lib/browser/chunk-NR4YFUK7.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":2158}},"bytes":3450},"dist/lib/browser/react-surface-TSLFLTXN.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1589},"dist/lib/browser/react-surface-TSLFLTXN.mjs":{"imports":[{"path":"dist/lib/browser/chunk-2EN3CBLB.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-3WEALY7P.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-NR4YFUK7.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-2EN3CBLB.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":413},"dist/lib/browser/chunk-2EN3CBLB.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/ChessboardContainer-JOCAWL5W.mjs","kind":"dynamic-import"}],"exports":["ChessboardContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":114}},"bytes":220},"dist/lib/browser/chunk-3WEALY7P.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3784},"dist/lib/browser/chunk-3WEALY7P.mjs":{"imports":[{"path":"dist/lib/browser/chunk-WSUUPPDK.mjs","kind":"import-statement"},{"path":"chess.js","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true},{"path":"@dxos/echo","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/log","kind":"import-statement","external":true},{"path":"@dxos/schema","kind":"import-statement","external":true},{"path":"effect","kind":"import-statement","external":true}],"exports":["ChessAction_exports","Chess_exports"],"inputs":{"src/types/Chess.ts":{"bytesInOutput":1484},"src/types/index.ts":{"bytesInOutput":0},"src/types/ChessAction.ts":{"bytesInOutput":387}},"bytes":2078},"dist/lib/browser/chunk-NR4YFUK7.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19947},"dist/lib/browser/chunk-NR4YFUK7.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":6785}},"bytes":10630},"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":5965,"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":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":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":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":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":7593,"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":5834},"dist/lib/browser/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TIIGNOGK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-WLXUZMHC.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-FBLAVAMY.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-R6KK3WAS.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-FD4TL5EE.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/intent-resolver-GXZN2EBT.mjs","kind":"dynamic-import"},{"path":"dist/lib/browser/react-surface-EVJLBV6U.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":["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":1598},"src/translations.ts":{"bytesInOutput":831}},"bytes":3529},"dist/lib/browser/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/types/index.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FBLAVAMY.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-FD4TL5EE.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"dist/lib/browser/blueprint-definition-FD4TL5EE.mjs":{"imports":[{"path":"dist/lib/browser/chunk-TIIGNOGK.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-FBLAVAMY.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-TIIGNOGK.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":9590},"dist/lib/browser/chunk-TIIGNOGK.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FBLAVAMY.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-GXZN2EBT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1073},"dist/lib/browser/intent-resolver-GXZN2EBT.mjs":{"imports":[{"path":"dist/lib/browser/chunk-FBLAVAMY.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-SZMONNHG.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":5887},"dist/lib/browser/ChessboardContainer-SZMONNHG.mjs":{"imports":[{"path":"dist/lib/browser/chunk-R6KK3WAS.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":2094}},"bytes":3386},"dist/lib/browser/react-surface-EVJLBV6U.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1589},"dist/lib/browser/react-surface-EVJLBV6U.mjs":{"imports":[{"path":"dist/lib/browser/chunk-WLXUZMHC.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-FBLAVAMY.mjs","kind":"import-statement"},{"path":"dist/lib/browser/chunk-R6KK3WAS.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-WLXUZMHC.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":413},"dist/lib/browser/chunk-WLXUZMHC.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"dist/lib/browser/ChessboardContainer-SZMONNHG.mjs","kind":"dynamic-import"}],"exports":["ChessboardContainer"],"inputs":{"src/components/index.ts":{"bytesInOutput":114}},"bytes":220},"dist/lib/browser/chunk-FBLAVAMY.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3813},"dist/lib/browser/chunk-FBLAVAMY.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":"@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":1601},"src/types/index.ts":{"bytesInOutput":0},"src/types/ChessAction.ts":{"bytesInOutput":385}},"bytes":2193},"dist/lib/browser/chunk-R6KK3WAS.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":19934},"dist/lib/browser/chunk-R6KK3WAS.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":6809}},"bytes":10374},"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-
|
|
3
|
+
} from "./chunk-WLXUZMHC.mjs";
|
|
4
4
|
import {
|
|
5
5
|
Chess_exports
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-FBLAVAMY.mjs";
|
|
7
|
+
import "./chunk-R6KK3WAS.mjs";
|
|
8
8
|
import {
|
|
9
9
|
meta
|
|
10
|
-
} from "./chunk-
|
|
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-
|
|
38
|
+
//# sourceMappingURL=react-surface-EVJLBV6U.mjs.map
|
package/dist/lib/node-esm/{ChessboardContainer-XAVVBRFW.mjs → ChessboardContainer-GAIIADOA.mjs}
RENAMED
|
@@ -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-
|
|
4
|
+
} from "./chunk-IVEIH4ER.mjs";
|
|
5
5
|
import {
|
|
6
6
|
meta
|
|
7
|
-
} from "./chunk-
|
|
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";
|
|
@@ -28,8 +28,7 @@ var ChessboardArticle = ({ game, role }) => {
|
|
|
28
28
|
controller.current?.setMoveNumber(index);
|
|
29
29
|
}, []);
|
|
30
30
|
return /* @__PURE__ */ React.createElement(StackItem.Content, {
|
|
31
|
-
toolbar: true
|
|
32
|
-
classNames: "@container bs-full is-full overflow-hidden"
|
|
31
|
+
toolbar: true
|
|
33
32
|
}, /* @__PURE__ */ React.createElement(Chessboard.Root, {
|
|
34
33
|
game,
|
|
35
34
|
ref: controller
|
|
@@ -95,4 +94,4 @@ export {
|
|
|
95
94
|
ChessboardContainer,
|
|
96
95
|
ChessboardContainer_default as default
|
|
97
96
|
};
|
|
98
|
-
//# sourceMappingURL=ChessboardContainer-
|
|
97
|
+
//# sourceMappingURL=ChessboardContainer-GAIIADOA.mjs.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
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 { IconButton, 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
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,OAAOA,YAAW;AAElB,SAASC,gBAAgB;;;;ACFzB,OAAOC,SAASC,aAAaC,QAAQC,gBAAgB;AAErD,SAASC,YAAYC,SAASC,sBAAsB;AAEpD,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;
|
|
6
|
-
"names": ["React", "getSpace", "React", "useCallback", "useRef", "useState", "IconButton", "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", "
|
|
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 { IconButton, 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>\n <Chessboard.Root game={game} ref={controller}>\n <Toolbar.Root>\n <IconButton\n variant='ghost'\n icon='ph--info--regular'\n iconOnly\n label={t('toggle info button')}\n size={6}\n classNames={mx('invisible', !open && '@3xl:visible')}\n onClick={() => setOpen((open) => !open)}\n />\n </Toolbar.Root>\n <div\n className={mx(\n 'grid _grid-rows-[1fr_4rem] 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,YAAYC,SAASC,sBAAsB;AAEpD,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;OACjB,sBAAA,cAACC,WAAWC,MAAI;MAACtB;MAAYuB,KAAKZ;OAChC,sBAAA,cAACa,QAAQF,MAAI,MACX,sBAAA,cAACG,YAAAA;MACCC,SAAQ;MACRC,MAAK;MACLC,UAAAA;MACAC,OAAO3B,EAAE,oBAAA;MACT4B,MAAM;MACNC,YAAYC,GAAG,aAAa,CAACvB,QAAQ,cAAA;MACrCwB,SAAS,MAAMvB,QAAQ,CAACD,UAAS,CAACA,KAAAA;SAGtC,sBAAA,cAACyB,OAAAA;MACCC,WAAWH,GACT,oDACAvB,QAAQ,8BACRR,SAAS,aAAa,iBACtBA,SAAS,aAAaQ,QAAQ,kBAAA;OAGhC,sBAAA,cAACY,WAAWF,SAAO,MACjB,sBAAA,cAACE,WAAWe,OAAK;MAACL,YAAW;MAAiCzB;SAE/DG,QACC,sBAAA,cAACyB,OAAAA;MAAIC,WAAU;OACb,sBAAA,cAACd,WAAWgB,MAAI;MACd/B;MACAgC,KAAK;MACLC,KAAK;MACLC,qBAAqBjC;MACrBkC,SAAS,MAAM/B,QAAQ,KAAA;MACvBgC,UAAU7B;;;;;AAQ1B;;;ADlDO,IAAM8B,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", "IconButton", "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", "Chessboard", "Root", "ref", "Toolbar", "IconButton", "variant", "icon", "iconOnly", "label", "size", "classNames", "mx", "onClick", "div", "className", "Board", "Info", "min", "max", "onOrientationChange", "onClose", "onSelect", "ChessboardContainer", "game", "role", "space", "getSpace", "React", "Chessboard", "Root", "Content", "Board", "ChessboardArticle"]
|
|
7
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-RTCAAOLF.mjs";
|
|
6
|
+
import "./chunk-MP3A3AGA.mjs";
|
|
7
|
+
import "./chunk-KNOOJFIR.mjs";
|
|
8
|
+
export {
|
|
9
|
+
CHESS_BLUEPRINT_KEY,
|
|
10
|
+
blueprint_definition_default as default
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=blueprint-definition-O7ZM3HUF.mjs.map
|
|
@@ -2,9 +2,9 @@ import { createRequire } from 'node:module';const require = createRequire(import
|
|
|
2
2
|
|
|
3
3
|
// src/components/index.ts
|
|
4
4
|
import { lazy } from "react";
|
|
5
|
-
var ChessboardContainer = lazy(() => import("./ChessboardContainer-
|
|
5
|
+
var ChessboardContainer = lazy(() => import("./ChessboardContainer-GAIIADOA.mjs"));
|
|
6
6
|
|
|
7
7
|
export {
|
|
8
8
|
ChessboardContainer
|
|
9
9
|
};
|
|
10
|
-
//# sourceMappingURL=chunk-
|
|
10
|
+
//# sourceMappingURL=chunk-FKRBFLJC.mjs.map
|
|
@@ -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-
|
|
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";
|
|
@@ -73,7 +73,7 @@ var History = ({ classNames, model, min, max, onSelect }) => {
|
|
|
73
73
|
var _effect = _useSignals();
|
|
74
74
|
try {
|
|
75
75
|
const { t } = useTranslation(meta.id);
|
|
76
|
-
const label = model.game.isGameOver() ? model.game.isCheckmate() ? t("game.checkmate") : model.game.isStalemate() ? t("game.stalemate") : t("game.draw") : model.game.isCheck() ? t("game.check") : void 0;
|
|
76
|
+
const label = model.game.isGameOver() ? model.game.isCheckmate() ? t("game.checkmate label") : model.game.isStalemate() ? t("game.stalemate label") : t("game.draw label") : model.game.isCheck() ? t("game.check label") : void 0;
|
|
77
77
|
const history = model.game.history();
|
|
78
78
|
const moves = useMemo(() => history.reduce((acc, move, index) => {
|
|
79
79
|
if (index % 2 === 0) {
|
|
@@ -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(),
|
|
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-
|
|
295
|
+
//# sourceMappingURL=chunk-IVEIH4ER.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')\n : model.game.isStalemate()\n ? t('game.stalemate')\n : t('game.draw')\n : model.game.isCheck()\n ? t('game.check')\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,uBAAA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M;QACNC,SAAS,MAAMzB,oBAAoBD,gBAAgB,UAAU,UAAU,OAAA;;OAK7E,sBAAA,cAAC2B,gBAAAA;MACCC,OAAOpB,MAAMM,OAAOe,UAAU7B,WAAAA;MAC9B8B,eAAe,CAACF,UAAAA;AACdpB,cAAMM,OAAOe,QAAS7B,WAAAA,IAAe4B;MACvC;MACAjB;;;;;AAKV;AAEAb,KAAKY,cAAc;AAanB,IAAMqB,UAAU,CAAC,EAAEhC,YAAYS,OAAOwB,KAAKC,KAAKC,SAAQ,MAAgB;;;AACtE,UAAM,EAAE9B,EAAC,IAAKC,eAAeC,KAAKC,EAAE;AACpC,UAAMiB,QAAQhB,MAAM2B,KAAKC,WAAU,IAC/B5B,MAAM2B,KAAKE,YAAW,IACpBjC,EAAE,
|
|
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,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;M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vDE,MAAM,CAACF,QAAQA,SAAS;MACxBG,SAAS,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
|
-
|
|
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-
|
|
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-
|
|
5
|
+
} from "./chunk-KNOOJFIR.mjs";
|
|
6
6
|
|
|
7
7
|
// src/types/Chess.ts
|
|
8
8
|
var Chess_exports = {};
|
|
@@ -11,28 +11,28 @@ __export(Chess_exports, {
|
|
|
11
11
|
makeGame: () => makeGame
|
|
12
12
|
});
|
|
13
13
|
import { Chess as ChessJS } from "chess.js";
|
|
14
|
-
import
|
|
14
|
+
import * as Schema from "effect/Schema";
|
|
15
15
|
import { Obj, Type } from "@dxos/echo";
|
|
16
|
-
import { LabelAnnotation } from "@dxos/echo
|
|
16
|
+
import { FormAnnotation, LabelAnnotation } from "@dxos/echo/internal";
|
|
17
17
|
import { log } from "@dxos/log";
|
|
18
18
|
import { ItemAnnotation } from "@dxos/schema";
|
|
19
19
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-chess/src/types/Chess.ts";
|
|
20
20
|
var Game = Schema.Struct({
|
|
21
21
|
name: Schema.optional(Schema.String),
|
|
22
|
-
players: Schema.
|
|
22
|
+
players: Schema.Struct({
|
|
23
23
|
white: Schema.optional(Schema.String.annotations({
|
|
24
24
|
description: "DID of white player"
|
|
25
25
|
})),
|
|
26
26
|
black: Schema.optional(Schema.String.annotations({
|
|
27
27
|
description: "DID of black player"
|
|
28
28
|
}))
|
|
29
|
-
}).pipe(Schema.mutable)),
|
|
30
|
-
pgn: Schema.
|
|
29
|
+
}).pipe(Schema.mutable, FormAnnotation.set(false), Schema.optional),
|
|
30
|
+
pgn: Schema.String.annotations({
|
|
31
31
|
description: "Portable Game Notation."
|
|
32
|
-
})),
|
|
33
|
-
fen: Schema.
|
|
32
|
+
}).pipe(FormAnnotation.set(false), Schema.optional),
|
|
33
|
+
fen: Schema.String.annotations({
|
|
34
34
|
description: "Forsyth-Edwards Notation."
|
|
35
|
-
}))
|
|
35
|
+
}).pipe(FormAnnotation.set(false), Schema.optional)
|
|
36
36
|
}).pipe(Type.Obj({
|
|
37
37
|
typename: "dxos.org/type/Chess",
|
|
38
38
|
version: "0.2.0"
|
|
@@ -47,7 +47,7 @@ var makeGame = ({ name, pgn, fen } = {}) => {
|
|
|
47
47
|
} catch {
|
|
48
48
|
log.warn(pgn, void 0, {
|
|
49
49
|
F: __dxlog_file,
|
|
50
|
-
L:
|
|
50
|
+
L: 50,
|
|
51
51
|
S: void 0,
|
|
52
52
|
C: (f, a) => f(...a)
|
|
53
53
|
});
|
|
@@ -66,7 +66,7 @@ var ChessAction_exports = {};
|
|
|
66
66
|
__export(ChessAction_exports, {
|
|
67
67
|
Create: () => Create
|
|
68
68
|
});
|
|
69
|
-
import
|
|
69
|
+
import * as Schema2 from "effect/Schema";
|
|
70
70
|
var Create = class extends Schema2.TaggedClass()(`${meta.id}/action/create`, {
|
|
71
71
|
input: Schema2.Struct({
|
|
72
72
|
name: Schema2.optional(Schema2.String),
|
|
@@ -82,4 +82,4 @@ export {
|
|
|
82
82
|
Chess_exports,
|
|
83
83
|
ChessAction_exports
|
|
84
84
|
};
|
|
85
|
-
//# sourceMappingURL=chunk-
|
|
85
|
+
//# sourceMappingURL=chunk-MP3A3AGA.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/Chess.ts", "../../../src/types/ChessAction.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport { Chess as ChessJS } from 'chess.js';\nimport * as Schema from 'effect/Schema';\n\nimport { Obj, Type } from '@dxos/echo';\nimport { FormAnnotation, LabelAnnotation } from '@dxos/echo/internal';\nimport { log } from '@dxos/log';\nimport { ItemAnnotation } from '@dxos/schema';\n\nexport const Game = Schema.Struct({\n name: Schema.optional(Schema.String),\n players: Schema.Struct({\n white: Schema.optional(\n Schema.String.annotations({\n description: 'DID of white player',\n }),\n ),\n black: Schema.optional(\n Schema.String.annotations({\n description: 'DID of black player',\n }),\n ),\n }).pipe(Schema.mutable, FormAnnotation.set(false), Schema.optional),\n pgn: Schema.String.annotations({\n description: 'Portable Game Notation.',\n }).pipe(FormAnnotation.set(false), Schema.optional),\n fen: Schema.String.annotations({\n description: 'Forsyth-Edwards Notation.',\n }).pipe(FormAnnotation.set(false), Schema.optional),\n}).pipe(\n Type.Obj({\n typename: 'dxos.org/type/Chess',\n version: '0.2.0',\n }),\n LabelAnnotation.set(['name']),\n ItemAnnotation.set(true),\n);\n\nexport interface Game extends Schema.Schema.Type<typeof Game> {}\n\nexport const makeGame = ({ name, pgn, fen }: { name?: string; pgn?: string; fen?: string } = {}) => {\n const chess = new ChessJS();\n if (pgn) {\n try {\n chess.loadPgn(pgn);\n } catch {\n log.warn(pgn);\n }\n }\n\n return Obj.make(Game, {\n name,\n players: {},\n pgn,\n fen,\n });\n};\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { meta } from '../meta';\n\nimport { Game } from './Chess';\n\nexport class Create extends Schema.TaggedClass<Create>()(`${meta.id}/action/create`, {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n pgn: Schema.optional(Schema.String),\n }),\n output: Schema.Struct({\n object: Game,\n }),\n}) {}\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAAA;;;;;AAIA,SAASA,SAASC,eAAe;AACjC,YAAYC,YAAY;AAExB,SAASC,KAAKC,YAAY;AAC1B,SAASC,gBAAgBC,uBAAuB;AAChD,SAASC,WAAW;AACpB,SAASC,sBAAsB;;AAExB,IAAMC,OAAcC,cAAO;EAChCC,MAAaC,gBAAgBC,aAAM;EACnCC,SAAgBJ,cAAO;IACrBK,OAAcH,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;IAEFC,OAAcN,gBACLC,cAAOG,YAAY;MACxBC,aAAa;IACf,CAAA,CAAA;EAEJ,CAAA,EAAGE,KAAYC,gBAASf,eAAegB,IAAI,KAAA,GAAeT,eAAQ;EAClEU,KAAYT,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKd,eAAegB,IAAI,KAAA,GAAeT,eAAQ;EAClDW,KAAYV,cAAOG,YAAY;IAC7BC,aAAa;EACf,CAAA,EAAGE,KAAKd,eAAegB,IAAI,KAAA,GAAeT,eAAQ;AACpD,CAAA,EAAGO,KACDf,KAAKD,IAAI;EACPqB,UAAU;EACVC,SAAS;AACX,CAAA,GACAnB,gBAAgBe,IAAI;EAAC;CAAO,GAC5Bb,eAAea,IAAI,IAAA,CAAA;AAKd,IAAMK,WAAW,CAAC,EAAEf,MAAMW,KAAKC,IAAG,IAAoD,CAAC,MAAC;AAC7F,QAAMI,QAAQ,IAAI1B,QAAAA;AAClB,MAAIqB,KAAK;AACP,QAAI;AACFK,YAAMC,QAAQN,GAAAA;IAChB,QAAQ;AACNf,UAAIsB,KAAKP,KAAAA,QAAAA;;;;;;IACX;EACF;AAEA,SAAOnB,IAAI2B,KAAKrB,MAAM;IACpBE;IACAG,SAAS,CAAC;IACVQ;IACAC;EACF,CAAA;AACF;;;AC3DA;;;;AAIA,YAAYQ,aAAY;AAMjB,IAAMC,SAAN,cAA4BC,oBAAW,EAAW,GAAGC,KAAKC,EAAE,kBAAkB;EACnFC,OAAcC,eAAO;IACnBC,MAAaC,iBAAgBC,cAAM;IACnCC,KAAYF,iBAAgBC,cAAM;EACpC,CAAA;EACAE,QAAeL,eAAO;IACpBM,QAAQC;EACV,CAAA;AACF,CAAA,EAAA;AAAI;",
|
|
6
|
+
"names": ["Chess", "ChessJS", "Schema", "Obj", "Type", "FormAnnotation", "LabelAnnotation", "log", "ItemAnnotation", "Game", "Struct", "name", "optional", "String", "players", "white", "annotations", "description", "black", "pipe", "mutable", "set", "pgn", "fen", "typename", "version", "makeGame", "chess", "loadPgn", "warn", "make", "Schema", "Create", "TaggedClass", "meta", "id", "input", "Struct", "name", "optional", "String", "pgn", "output", "object", "Game"]
|
|
7
|
+
}
|