@dxos/plugin-chess 0.7.5-main.9d2a38b → 0.7.5-main.e9bb01b

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 (89) hide show
  1. package/dist/lib/browser/ChessContainer-LPMACR6Y.mjs +106 -0
  2. package/dist/lib/browser/ChessContainer-LPMACR6Y.mjs.map +7 -0
  3. package/dist/lib/browser/{chunk-VHSLLEH3.mjs → chunk-SINRYD72.mjs} +6 -3
  4. package/dist/lib/browser/{chunk-VHSLLEH3.mjs.map → chunk-SINRYD72.mjs.map} +3 -3
  5. package/dist/lib/browser/index.mjs +8 -8
  6. package/dist/lib/browser/index.mjs.map +3 -3
  7. package/dist/lib/browser/{intent-resolver-FUAOSHHX.mjs → intent-resolver-F36MGVEQ.mjs} +12 -9
  8. package/dist/lib/browser/{intent-resolver-FUAOSHHX.mjs.map → intent-resolver-F36MGVEQ.mjs.map} +3 -3
  9. package/dist/lib/browser/meta.json +1 -1
  10. package/dist/lib/browser/{react-surface-63EO2PZO.mjs → react-surface-ADVIWGEE.mjs} +3 -3
  11. package/dist/lib/browser/types/index.mjs +1 -1
  12. package/dist/lib/node/ChessContainer-ZFOCAXZL.cjs +131 -0
  13. package/dist/lib/node/ChessContainer-ZFOCAXZL.cjs.map +7 -0
  14. package/dist/lib/node/{chunk-3BLH7NRV.cjs → chunk-NALFH4J4.cjs} +9 -6
  15. package/dist/lib/node/{chunk-3BLH7NRV.cjs.map → chunk-NALFH4J4.cjs.map} +3 -3
  16. package/dist/lib/node/index.cjs +21 -21
  17. package/dist/lib/node/index.cjs.map +3 -3
  18. package/dist/lib/node/{intent-resolver-VTB6P3IL.cjs → intent-resolver-QLRGQQ2C.cjs} +15 -12
  19. package/dist/lib/node/{intent-resolver-VTB6P3IL.cjs.map → intent-resolver-QLRGQQ2C.cjs.map} +3 -3
  20. package/dist/lib/node/meta.json +1 -1
  21. package/dist/lib/node/{react-surface-PO42G64E.cjs → react-surface-FRGCWHDU.cjs} +8 -8
  22. package/dist/lib/node/types/index.cjs +5 -5
  23. package/dist/lib/node/types/index.cjs.map +1 -1
  24. package/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs +108 -0
  25. package/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs.map +7 -0
  26. package/dist/lib/node-esm/{chunk-M2CRYWX5.mjs → chunk-R2ZZTB5A.mjs} +6 -3
  27. package/dist/lib/node-esm/{chunk-M2CRYWX5.mjs.map → chunk-R2ZZTB5A.mjs.map} +3 -3
  28. package/dist/lib/node-esm/index.mjs +8 -8
  29. package/dist/lib/node-esm/index.mjs.map +3 -3
  30. package/dist/lib/node-esm/{intent-resolver-MKEQFVZO.mjs → intent-resolver-OGWCQJZ2.mjs} +12 -9
  31. package/dist/lib/node-esm/{intent-resolver-MKEQFVZO.mjs.map → intent-resolver-OGWCQJZ2.mjs.map} +3 -3
  32. package/dist/lib/node-esm/meta.json +1 -1
  33. package/dist/lib/node-esm/{react-surface-CXEBEDLT.mjs → react-surface-SFBGDWJD.mjs} +3 -3
  34. package/dist/lib/node-esm/types/index.mjs +1 -1
  35. package/dist/types/src/ChessPlugin.d.ts.map +1 -1
  36. package/dist/types/src/capabilities/index.d.ts +2 -2
  37. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  38. package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
  39. package/dist/types/src/components/ChessContainer.d.ts +4 -3
  40. package/dist/types/src/components/ChessContainer.d.ts.map +1 -1
  41. package/dist/types/src/components/ChessPanel.d.ts +11 -0
  42. package/dist/types/src/components/ChessPanel.d.ts.map +1 -0
  43. package/dist/types/src/components/Chessboard.stories.d.ts +8 -0
  44. package/dist/types/src/components/Chessboard.stories.d.ts.map +1 -0
  45. package/dist/types/src/components/{Chess.d.ts → PlayerSelector.d.ts} +4 -5
  46. package/dist/types/src/components/PlayerSelector.d.ts.map +1 -0
  47. package/dist/types/src/components/index.d.ts +2 -1
  48. package/dist/types/src/components/index.d.ts.map +1 -1
  49. package/dist/types/src/meta.d.ts +1 -0
  50. package/dist/types/src/meta.d.ts.map +1 -1
  51. package/package.json +19 -20
  52. package/src/ChessPlugin.tsx +5 -13
  53. package/src/capabilities/intent-resolver.ts +8 -5
  54. package/src/components/ChessContainer.tsx +41 -4
  55. package/src/components/ChessPanel.tsx +67 -0
  56. package/src/components/Chessboard.stories.tsx +39 -0
  57. package/src/components/{Chess.tsx → PlayerSelector.tsx} +2 -49
  58. package/src/meta.ts +2 -1
  59. package/dist/lib/browser/ChessContainer-JYXOZIDK.mjs +0 -505
  60. package/dist/lib/browser/ChessContainer-JYXOZIDK.mjs.map +0 -7
  61. package/dist/lib/node/ChessContainer-XRP7D63X.cjs +0 -518
  62. package/dist/lib/node/ChessContainer-XRP7D63X.cjs.map +0 -7
  63. package/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs +0 -507
  64. package/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs.map +0 -7
  65. package/dist/types/src/components/Chess.d.ts.map +0 -1
  66. package/dist/types/src/components/Chessboard/Chessboard.d.ts +0 -37
  67. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +0 -1
  68. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +0 -13
  69. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +0 -1
  70. package/dist/types/src/components/Chessboard/index.d.ts +0 -2
  71. package/dist/types/src/components/Chessboard/index.d.ts.map +0 -1
  72. package/dist/types/src/components/Chessboard/pieces/custom.d.ts +0 -3
  73. package/dist/types/src/components/Chessboard/pieces/custom.d.ts.map +0 -1
  74. package/dist/types/src/components/Chessboard/pieces/index.d.ts +0 -4
  75. package/dist/types/src/components/Chessboard/pieces/index.d.ts.map +0 -1
  76. package/dist/types/src/components/Chessboard/pieces/phosphor.d.ts +0 -3
  77. package/dist/types/src/components/Chessboard/pieces/phosphor.d.ts.map +0 -1
  78. package/dist/types/src/components/Chessboard/pieces/riohacha.d.ts +0 -3
  79. package/dist/types/src/components/Chessboard/pieces/riohacha.d.ts.map +0 -1
  80. package/src/components/Chessboard/Chessboard.stories.tsx +0 -43
  81. package/src/components/Chessboard/Chessboard.tsx +0 -170
  82. package/src/components/Chessboard/index.ts +0 -5
  83. package/src/components/Chessboard/pieces/custom.tsx +0 -82
  84. package/src/components/Chessboard/pieces/index.ts +0 -7
  85. package/src/components/Chessboard/pieces/phosphor.tsx +0 -71
  86. package/src/components/Chessboard/pieces/riohacha.tsx +0 -166
  87. /package/dist/lib/browser/{react-surface-63EO2PZO.mjs.map → react-surface-ADVIWGEE.mjs.map} +0 -0
  88. /package/dist/lib/node/{react-surface-PO42G64E.cjs.map → react-surface-FRGCWHDU.cjs.map} +0 -0
  89. /package/dist/lib/node-esm/{react-surface-CXEBEDLT.mjs.map → react-surface-SFBGDWJD.mjs.map} +0 -0
@@ -4,16 +4,16 @@ import {
4
4
  ChessAction,
5
5
  GameType,
6
6
  meta
7
- } from "./chunk-M2CRYWX5.mjs";
7
+ } from "./chunk-R2ZZTB5A.mjs";
8
8
 
9
9
  // packages/plugins/plugin-chess/src/ChessPlugin.tsx
10
- import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events, oneOf } from "@dxos/app-framework";
10
+ import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from "@dxos/app-framework";
11
11
  import { ClientCapabilities, ClientEvents } from "@dxos/plugin-client";
12
12
 
13
13
  // packages/plugins/plugin-chess/src/capabilities/index.ts
14
14
  import { lazy } from "@dxos/app-framework";
15
- var IntentResolver = lazy(() => import("./intent-resolver-MKEQFVZO.mjs"));
16
- var ReactSurface = lazy(() => import("./react-surface-CXEBEDLT.mjs"));
15
+ var IntentResolver = lazy(() => import("./intent-resolver-OGWCQJZ2.mjs"));
16
+ var ReactSurface = lazy(() => import("./react-surface-SFBGDWJD.mjs"));
17
17
 
18
18
  // packages/plugins/plugin-chess/src/translations.ts
19
19
  var translations_default = [
@@ -41,7 +41,7 @@ var ChessPlugin = () => definePlugin(meta, [
41
41
  }),
42
42
  defineModule({
43
43
  id: `${meta.id}/module/metadata`,
44
- activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
44
+ activatesOn: Events.SetupMetadata,
45
45
  activate: () => contributes(Capabilities.Metadata, {
46
46
  id: GameType.typename,
47
47
  metadata: {
@@ -58,19 +58,19 @@ var ChessPlugin = () => definePlugin(meta, [
58
58
  }),
59
59
  defineModule({
60
60
  id: `${meta.id}/module/schema`,
61
- activatesOn: ClientEvents.SetupClient,
61
+ activatesOn: ClientEvents.SetupSchema,
62
62
  activate: () => contributes(ClientCapabilities.Schema, [
63
63
  GameType
64
64
  ])
65
65
  }),
66
66
  defineModule({
67
67
  id: `${meta.id}/module/react-surface`,
68
- activatesOn: Events.Startup,
68
+ activatesOn: Events.SetupSurfaces,
69
69
  activate: ReactSurface
70
70
  }),
71
71
  defineModule({
72
72
  id: `${meta.id}/module/intent-resolver`,
73
- activatesOn: Events.Startup,
73
+ activatesOn: Events.SetupIntents,
74
74
  activate: IntentResolver
75
75
  })
76
76
  ]);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/ChessPlugin.tsx", "../../../src/capabilities/index.ts", "../../../src/translations.ts"],
4
- "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport {\n Capabilities,\n contributes,\n createIntent,\n defineModule,\n definePlugin,\n Events,\n oneOf,\n} from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { IntentResolver, ReactSurface } from './capabilities';\nimport { CHESS_PLUGIN, meta } from './meta';\nimport translations from './translations';\nimport { ChessAction, GameType } from './types';\n\nexport const ChessPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: GameType.typename,\n metadata: {\n createObject: (props: { name?: string }) => createIntent(ChessAction.Create, props),\n placeholder: ['game title placeholder', { ns: CHESS_PLUGIN }],\n icon: 'ph--shield-chevron--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupClient,\n activate: () => contributes(ClientCapabilities.Schema, [GameType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.Startup,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.Startup,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CHESS_PLUGIN } from './meta';\nimport { GameType } from './types';\n\nexport default [\n {\n 'en-US': {\n [GameType.typename]: {\n 'typename label': 'Game',\n },\n [CHESS_PLUGIN]: {\n 'plugin name': 'Chess',\n 'game title placeholder': 'New game',\n 'create game label': 'Create game',\n 'delete game label': 'Delete',\n },\n },\n },\n];\n"],
5
- "mappings": ";;;;;;;;;AAIA,SACEA,cACAC,aACAC,cACAC,cACAC,cACAC,QACAC,aACK;AACP,SAASC,oBAAoBC,oBAAoB;;;ACTjD,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACA9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,SAASC,QAAQ,GAAG;QACnB,kBAAkB;MACpB;MACA,CAACC,YAAAA,GAAe;QACd,eAAe;QACf,0BAA0B;QAC1B,qBAAqB;QACrB,qBAAqB;MACvB;IACF;EACF;;;;AFAK,IAAMC,cAAc,MACzBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaQ,MAAMP,OAAOQ,SAASR,OAAOS,aAAa;IACvDP,UAAU,MACRC,YAAYC,aAAaM,UAAU;MACjCZ,IAAIa,SAASC;MACbC,UAAU;QACRC,cAAc,CAACC,UAA6BC,aAAaC,YAAYC,QAAQH,KAAAA;QAC7EI,aAAa;UAAC;UAA0B;YAAEC,IAAIC;UAAa;;QAC3DC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAzB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAawB,aAAaC;IAC1BtB,UAAU,MAAMC,YAAYsB,mBAAmBC,QAAQ;MAACf;KAAS;EACnE,CAAA;EACAd,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOQ;IACpBN,UAAUyB;EACZ,CAAA;EACA9B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOQ;IACpBN,UAAU0B;EACZ,CAAA;CACD;",
6
- "names": ["Capabilities", "contributes", "createIntent", "defineModule", "definePlugin", "Events", "oneOf", "ClientCapabilities", "ClientEvents", "lazy", "IntentResolver", "lazy", "ReactSurface", "GameType", "typename", "CHESS_PLUGIN", "ChessPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "oneOf", "Startup", "SetupAppGraph", "Metadata", "GameType", "typename", "metadata", "createObject", "props", "createIntent", "ChessAction", "Create", "placeholder", "ns", "CHESS_PLUGIN", "icon", "ClientEvents", "SetupClient", "ClientCapabilities", "Schema", "ReactSurface", "IntentResolver"]
4
+ "sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';\nimport { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';\n\nimport { IntentResolver, ReactSurface } from './capabilities';\nimport { CHESS_PLUGIN, meta } from './meta';\nimport translations from './translations';\nimport { ChessAction, GameType } from './types';\n\nexport const ChessPlugin = () =>\n definePlugin(meta, [\n defineModule({\n id: `${meta.id}/module/translations`,\n activatesOn: Events.SetupTranslations,\n activate: () => contributes(Capabilities.Translations, translations),\n }),\n defineModule({\n id: `${meta.id}/module/metadata`,\n activatesOn: Events.SetupMetadata,\n activate: () =>\n contributes(Capabilities.Metadata, {\n id: GameType.typename,\n metadata: {\n createObject: (props: { name?: string }) => createIntent(ChessAction.Create, props),\n placeholder: ['game title placeholder', { ns: CHESS_PLUGIN }],\n icon: 'ph--shield-chevron--regular',\n },\n }),\n }),\n defineModule({\n id: `${meta.id}/module/schema`,\n activatesOn: ClientEvents.SetupSchema,\n activate: () => contributes(ClientCapabilities.Schema, [GameType]),\n }),\n defineModule({\n id: `${meta.id}/module/react-surface`,\n activatesOn: Events.SetupSurfaces,\n activate: ReactSurface,\n }),\n defineModule({\n id: `${meta.id}/module/intent-resolver`,\n activatesOn: Events.SetupIntents,\n activate: IntentResolver,\n }),\n ]);\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { lazy } from '@dxos/app-framework';\n\nexport const IntentResolver = lazy(() => import('./intent-resolver'));\nexport const ReactSurface = lazy(() => import('./react-surface'));\n", "//\n// Copyright 2023 DXOS.org\n//\n\nimport { CHESS_PLUGIN } from './meta';\nimport { GameType } from './types';\n\nexport default [\n {\n 'en-US': {\n [GameType.typename]: {\n 'typename label': 'Game',\n },\n [CHESS_PLUGIN]: {\n 'plugin name': 'Chess',\n 'game title placeholder': 'New game',\n 'create game label': 'Create game',\n 'delete game label': 'Delete',\n },\n },\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;AAIA,SAASA,cAAcC,aAAaC,cAAcC,cAAcC,cAAcC,cAAc;AAC5F,SAASC,oBAAoBC,oBAAoB;;;ACDjD,SAASC,YAAY;AAEd,IAAMC,iBAAiBC,KAAK,MAAM,OAAO,gCAAA,CAAA;AACzC,IAAMC,eAAeD,KAAK,MAAM,OAAO,8BAAA,CAAA;;;ACA9C,IAAA,uBAAe;EACb;IACE,SAAS;MACP,CAACE,SAASC,QAAQ,GAAG;QACnB,kBAAkB;MACpB;MACA,CAACC,YAAAA,GAAe;QACd,eAAe;QACf,0BAA0B;QAC1B,qBAAqB;QACrB,qBAAqB;MACvB;IACF;EACF;;;;AFRK,IAAMC,cAAc,MACzBC,aAAaC,MAAM;EACjBC,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOC;IACpBC,UAAU,MAAMC,YAAYC,aAAaC,cAAcC,oBAAAA;EACzD,CAAA;EACAT,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOO;IACpBL,UAAU,MACRC,YAAYC,aAAaI,UAAU;MACjCV,IAAIW,SAASC;MACbC,UAAU;QACRC,cAAc,CAACC,UAA6BC,aAAaC,YAAYC,QAAQH,KAAAA;QAC7EI,aAAa;UAAC;UAA0B;YAAEC,IAAIC;UAAa;;QAC3DC,MAAM;MACR;IACF,CAAA;EACJ,CAAA;EACAvB,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAasB,aAAaC;IAC1BpB,UAAU,MAAMC,YAAYoB,mBAAmBC,QAAQ;MAACf;KAAS;EACnE,CAAA;EACAZ,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAOyB;IACpBvB,UAAUwB;EACZ,CAAA;EACA7B,aAAa;IACXC,IAAI,GAAGF,KAAKE,EAAE;IACdC,aAAaC,OAAO2B;IACpBzB,UAAU0B;EACZ,CAAA;CACD;",
6
+ "names": ["Capabilities", "contributes", "createIntent", "defineModule", "definePlugin", "Events", "ClientCapabilities", "ClientEvents", "lazy", "IntentResolver", "lazy", "ReactSurface", "GameType", "typename", "CHESS_PLUGIN", "ChessPlugin", "definePlugin", "meta", "defineModule", "id", "activatesOn", "Events", "SetupTranslations", "activate", "contributes", "Capabilities", "Translations", "translations", "SetupMetadata", "Metadata", "GameType", "typename", "metadata", "createObject", "props", "createIntent", "ChessAction", "Create", "placeholder", "ns", "CHESS_PLUGIN", "icon", "ClientEvents", "SetupSchema", "ClientCapabilities", "Schema", "SetupSurfaces", "ReactSurface", "SetupIntents", "IntentResolver"]
7
7
  }
@@ -2,19 +2,22 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  ChessAction,
4
4
  GameType
5
- } from "./chunk-M2CRYWX5.mjs";
5
+ } from "./chunk-R2ZZTB5A.mjs";
6
6
 
7
7
  // packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts
8
8
  import { Capabilities, contributes, createResolver } from "@dxos/app-framework";
9
9
  import { create } from "@dxos/live-object";
10
- var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver(ChessAction.Create, ({ name }) => ({
11
- data: {
12
- object: create(GameType, {
13
- name
14
- })
15
- }
16
- })));
10
+ var intent_resolver_default = () => contributes(Capabilities.IntentResolver, createResolver({
11
+ intent: ChessAction.Create,
12
+ resolve: ({ name }) => ({
13
+ data: {
14
+ object: create(GameType, {
15
+ name
16
+ })
17
+ }
18
+ })
19
+ }));
17
20
  export {
18
21
  intent_resolver_default as default
19
22
  };
20
- //# sourceMappingURL=intent-resolver-MKEQFVZO.mjs.map
23
+ //# sourceMappingURL=intent-resolver-OGWCQJZ2.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/capabilities/intent-resolver.ts"],
4
- "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ChessAction, GameType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver(ChessAction.Create, ({ name }) => ({\n data: {\n object: create(GameType, { name }),\n },\n })),\n );\n"],
5
- "mappings": ";;;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAeC,YAAYC,QAAQ,CAAC,EAAEC,KAAI,OAAQ;EAChDC,MAAM;IACJC,QAAQC,OAAOC,UAAU;MAAEJ;IAAK,CAAA;EAClC;AACF,EAAA,CAAA;",
6
- "names": ["Capabilities", "contributes", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "ChessAction", "Create", "name", "data", "object", "create", "GameType"]
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes, createResolver } from '@dxos/app-framework';\nimport { create } from '@dxos/live-object';\n\nimport { ChessAction, GameType } from '../types';\n\nexport default () =>\n contributes(\n Capabilities.IntentResolver,\n createResolver({\n intent: ChessAction.Create,\n resolve: ({ name }) => ({\n data: {\n object: create(GameType, { name }),\n },\n }),\n }),\n );\n"],
5
+ "mappings": ";;;;;;;AAIA,SAASA,cAAcC,aAAaC,sBAAsB;AAC1D,SAASC,cAAc;AAIvB,IAAA,0BAAe,MACbC,YACEC,aAAaC,gBACbC,eAAe;EACbC,QAAQC,YAAYC;EACpBC,SAAS,CAAC,EAAEC,KAAI,OAAQ;IACtBC,MAAM;MACJC,QAAQC,OAAOC,UAAU;QAAEJ;MAAK,CAAA;IAClC;EACF;AACF,CAAA,CAAA;",
6
+ "names": ["Capabilities", "contributes", "createResolver", "create", "contributes", "Capabilities", "IntentResolver", "createResolver", "intent", "ChessAction", "Create", "resolve", "name", "data", "object", "create", "GameType"]
7
7
  }
@@ -1 +1 @@
1
- {"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2461,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":1411,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":2799,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":1974,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/custom.tsx":{"bytes":32344,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/phosphor.tsx":{"bytes":6674,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/riohacha.tsx":{"bytes":30948,"imports":[{"path":"react","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/index.ts":{"bytes":704,"imports":[{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/custom.tsx","kind":"import-statement","original":"./custom"},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/phosphor.tsx","kind":"import-statement","original":"./phosphor"},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/riohacha.tsx","kind":"import-statement","original":"./riohacha"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/Chessboard.tsx":{"bytes":15769,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-chessboard","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/pieces/index.ts","kind":"import-statement","original":"./pieces"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chessboard/index.ts":{"bytes":529,"imports":[{"path":"packages/plugins/plugin-chess/src/components/Chessboard/Chessboard.tsx","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/Chess.tsx":{"bytes":14027,"imports":[{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/invariant","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-theme","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/Chessboard/index.ts","kind":"import-statement","original":"./Chessboard"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":2405,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/Chess.tsx","kind":"import-statement","original":"./Chess"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":798,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":2649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1080,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1819,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":6788,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":592,"imports":[{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4361},"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-M2CRYWX5.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-MKEQFVZO.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-CXEBEDLT.mjs","kind":"dynamic-import"}],"exports":["CHESS_PLUGIN","ChessPlugin","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1355},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":190},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":324},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0}},"bytes":2358},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-M2CRYWX5.mjs","kind":"import-statement"}],"exports":["ChessAction","GameType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":284},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-MKEQFVZO.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":979},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-MKEQFVZO.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-M2CRYWX5.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":323}},"bytes":654},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":47070},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs":{"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/display-name","kind":"import-statement","external":true},{"path":"@dxos/invariant","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-theme","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react-chessboard","kind":"import-statement","external":true},{"path":"react-resize-detector","kind":"import-statement","external":true},{"path":"@dxos/react-ui-theme","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":495},"packages/plugins/plugin-chess/src/components/Chess.tsx":{"bytesInOutput":3989},"packages/plugins/plugin-chess/src/components/Chessboard/Chessboard.tsx":{"bytesInOutput":2364},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/custom.tsx":{"bytesInOutput":12536},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/phosphor.tsx":{"bytesInOutput":1678},"packages/plugins/plugin-chess/src/components/Chessboard/pieces/riohacha.tsx":{"bytesInOutput":11516},"packages/plugins/plugin-chess/src/components/Chessboard/index.ts":{"bytesInOutput":0}},"bytes":33413},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-CXEBEDLT.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1560},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-CXEBEDLT.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-M2CRYWX5.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-37QUCUTD.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":434},"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":992},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-M2CRYWX5.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3212},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-M2CRYWX5.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","GameType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":430},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":558},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":247}},"bytes":1666}}}
1
+ {"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytes":2461,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/meta.ts":{"bytes":2109,"imports":[],"format":"esm"},"packages/plugins/plugin-chess/src/types/types.ts":{"bytes":2799,"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"}],"format":"esm"},"packages/plugins/plugin-chess/src/types/index.ts":{"bytes":586,"imports":[{"path":"packages/plugins/plugin-chess/src/types/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/plugins/plugin-chess/src/types/types.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytes":2167,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytes":8757,"imports":[{"path":"@phosphor-icons/react","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-theme","kind":"import-statement","external":true}],"format":"esm"},"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytes":6004,"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx","kind":"import-statement","original":"./PlayerSelector"}],"format":"esm"},"packages/plugins/plugin-chess/src/components/index.ts":{"bytes":798,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","kind":"dynamic-import","original":"./ChessContainer"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytes":2649,"imports":[{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/components/index.ts","kind":"import-statement","original":"../components"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"../meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytes":1080,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","kind":"dynamic-import","original":"./intent-resolver"},{"path":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","kind":"dynamic-import","original":"./react-surface"}],"format":"esm"},"packages/plugins/plugin-chess/src/translations.ts":{"bytes":1819,"imports":[{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytes":6685,"imports":[{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/src/capabilities/index.ts","kind":"import-statement","original":"./capabilities"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"},{"path":"packages/plugins/plugin-chess/src/translations.ts","kind":"import-statement","original":"./translations"},{"path":"packages/plugins/plugin-chess/src/types/index.ts","kind":"import-statement","original":"./types"}],"format":"esm"},"packages/plugins/plugin-chess/src/index.ts":{"bytes":592,"imports":[{"path":"packages/plugins/plugin-chess/src/ChessPlugin.tsx","kind":"import-statement","original":"./ChessPlugin"},{"path":"packages/plugins/plugin-chess/src/meta.ts","kind":"import-statement","original":"./meta"}],"format":"esm"}},"outputs":{"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":4299},"packages/plugins/plugin-chess/dist/lib/node-esm/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-R2ZZTB5A.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/plugin-client","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-OGWCQJZ2.mjs","kind":"dynamic-import"},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-SFBGDWJD.mjs","kind":"dynamic-import"}],"exports":["CHESS_PLUGIN","ChessPlugin","meta"],"entryPoint":"packages/plugins/plugin-chess/src/index.ts","inputs":{"packages/plugins/plugin-chess/src/ChessPlugin.tsx":{"bytesInOutput":1336},"packages/plugins/plugin-chess/src/capabilities/index.ts":{"bytesInOutput":190},"packages/plugins/plugin-chess/src/translations.ts":{"bytesInOutput":324},"packages/plugins/plugin-chess/src/index.ts":{"bytesInOutput":0}},"bytes":2339},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":93},"packages/plugins/plugin-chess/dist/lib/node-esm/types/index.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-R2ZZTB5A.mjs","kind":"import-statement"}],"exports":["ChessAction","GameType","MoveSchema","isObject"],"entryPoint":"packages/plugins/plugin-chess/src/types/index.ts","inputs":{},"bytes":284},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-OGWCQJZ2.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1072},"packages/plugins/plugin-chess/dist/lib/node-esm/intent-resolver-OGWCQJZ2.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-R2ZZTB5A.mjs","kind":"import-statement"},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts","inputs":{"packages/plugins/plugin-chess/src/capabilities/intent-resolver.ts":{"bytesInOutput":360}},"bytes":691},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":7739},"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs":{"imports":[{"path":"chess.js","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/react-client/echo","kind":"import-statement","external":true},{"path":"@dxos/react-ui-gameboard","kind":"import-statement","external":true},{"path":"@dxos/react-ui-stack","kind":"import-statement","external":true},{"path":"@phosphor-icons/react","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-theme","kind":"import-statement","external":true}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/components/ChessContainer.tsx","inputs":{"packages/plugins/plugin-chess/src/components/ChessContainer.tsx":{"bytesInOutput":1501},"packages/plugins/plugin-chess/src/components/PlayerSelector.tsx":{"bytesInOutput":2299}},"bytes":4197},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-SFBGDWJD.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":1560},"packages/plugins/plugin-chess/dist/lib/node-esm/react-surface-SFBGDWJD.mjs":{"imports":[{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-R2ZZTB5A.mjs","kind":"import-statement"},{"path":"react","kind":"import-statement","external":true},{"path":"@dxos/app-framework","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"packages/plugins/plugin-chess/dist/lib/node-esm/ChessContainer-DF6IFM2R.mjs","kind":"dynamic-import"}],"exports":["default"],"entryPoint":"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx","inputs":{"packages/plugins/plugin-chess/src/capabilities/react-surface.tsx":{"bytesInOutput":434},"packages/plugins/plugin-chess/src/components/index.ts":{"bytesInOutput":104}},"bytes":992},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-R2ZZTB5A.mjs.map":{"imports":[],"exports":[],"inputs":{},"bytes":3504},"packages/plugins/plugin-chess/dist/lib/node-esm/chunk-R2ZZTB5A.mjs":{"imports":[{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/echo-schema","kind":"import-statement","external":true},{"path":"@dxos/live-object","kind":"import-statement","external":true}],"exports":["CHESS_PLUGIN","ChessAction","GameType","MoveSchema","isObject","meta"],"inputs":{"packages/plugins/plugin-chess/src/types/schema.ts":{"bytesInOutput":430},"packages/plugins/plugin-chess/src/types/index.ts":{"bytesInOutput":0},"packages/plugins/plugin-chess/src/types/types.ts":{"bytesInOutput":558},"packages/plugins/plugin-chess/src/meta.ts":{"bytesInOutput":513}},"bytes":1932}}}
@@ -2,7 +2,7 @@ import { createRequire } from 'node:module';const require = createRequire(import
2
2
  import {
3
3
  CHESS_PLUGIN,
4
4
  isObject
5
- } from "./chunk-M2CRYWX5.mjs";
5
+ } from "./chunk-R2ZZTB5A.mjs";
6
6
 
7
7
  // packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
8
8
  import React from "react";
@@ -10,7 +10,7 @@ import { Capabilities, contributes, createSurface } from "@dxos/app-framework";
10
10
 
11
11
  // packages/plugins/plugin-chess/src/components/index.ts
12
12
  import { lazy } from "react";
13
- var ChessContainer = lazy(() => import("./ChessContainer-37QUCUTD.mjs"));
13
+ var ChessContainer = lazy(() => import("./ChessContainer-DF6IFM2R.mjs"));
14
14
 
15
15
  // packages/plugins/plugin-chess/src/capabilities/react-surface.tsx
16
16
  var react_surface_default = () => contributes(Capabilities.ReactSurface, createSurface({
@@ -28,4 +28,4 @@ var react_surface_default = () => contributes(Capabilities.ReactSurface, createS
28
28
  export {
29
29
  react_surface_default as default
30
30
  };
31
- //# sourceMappingURL=react-surface-CXEBEDLT.mjs.map
31
+ //# sourceMappingURL=react-surface-SFBGDWJD.mjs.map
@@ -4,7 +4,7 @@ import {
4
4
  GameType,
5
5
  MoveSchema,
6
6
  isObject
7
- } from "../chunk-M2CRYWX5.mjs";
7
+ } from "../chunk-R2ZZTB5A.mjs";
8
8
  export {
9
9
  ChessAction,
10
10
  GameType,
@@ -1 +1 @@
1
- {"version":3,"file":"ChessPlugin.d.ts","sourceRoot":"","sources":["../../../src/ChessPlugin.tsx"],"names":[],"mappings":"AAoBA,eAAO,MAAM,WAAW,4CAmCpB,CAAC"}
1
+ {"version":3,"file":"ChessPlugin.d.ts","sourceRoot":"","sources":["../../../src/ChessPlugin.tsx"],"names":[],"mappings":"AAYA,eAAO,MAAM,WAAW,4CAmCpB,CAAC"}
@@ -1,3 +1,3 @@
1
- export declare const IntentResolver: (props?: unknown) => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.IntentResolver>>;
2
- export declare const ReactSurface: (props?: unknown) => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface>>;
1
+ export declare const IntentResolver: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.IntentResolver> | import("@dxos/app-framework").AnyCapability[]>>;
2
+ export declare const ReactSurface: (props?: unknown) => Promise<() => Promise<import("@dxos/app-framework").Capability<import("@dxos/app-framework").Capabilities.ReactSurface> | import("@dxos/app-framework").AnyCapability[]>>;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,mIAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,iIAAwC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc,kMAA0C,CAAC;AACtE,eAAO,MAAM,YAAY,gMAAwC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;;AAKhF,wBAQI"}
1
+ {"version":3,"file":"intent-resolver.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/intent-resolver.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAA+B,MAAM,qBAAqB,CAAC;;AAKhF,wBAWI"}
@@ -1,6 +1,7 @@
1
- import React, { type ComponentProps } from 'react';
2
- import { Chess } from './Chess';
3
- declare const ChessContainer: ({ game, role }: Pick<ComponentProps<typeof Chess>, "game"> & {
1
+ import React from 'react';
2
+ import { type GameType } from '../types';
3
+ declare const ChessContainer: ({ game }: {
4
+ game: GameType;
4
5
  role?: string;
5
6
  }) => React.JSX.Element | null;
6
7
  export default ChessContainer;
@@ -1 +1 @@
1
- {"version":3,"file":"ChessContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAEhC,QAAA,MAAM,cAAc,mBAAoB,IAAI,CAAC,cAAc,CAAC,OAAO,KAAK,CAAC,EAAE,MAAM,CAAC,GAAG;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,6BAWrG,CAAC;AAEF,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ChessContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessContainer.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA0C,MAAM,OAAO,CAAC;AAO/D,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,QAAA,MAAM,cAAc,aAAc;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,6BA6ClE,CAAC;AAEF,eAAe,cAAc,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { type Color } from 'chess.js';
2
+ import { type FC } from 'react';
3
+ import { type ThemedClassName } from '@dxos/react-ui';
4
+ import { type ChessModel } from '@dxos/react-ui-gameboard';
5
+ export type ChessPanelProps = ThemedClassName<{
6
+ model: ChessModel;
7
+ orientation?: Color;
8
+ onFlip?: () => void;
9
+ }>;
10
+ export declare const ChessPanel: FC<ChessPanelProps>;
11
+ //# sourceMappingURL=ChessPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChessPanel.d.ts","sourceRoot":"","sources":["../../../../src/components/ChessPanel.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAc,EAAE,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,0BAA0B,CAAC;AAG3D,MAAM,MAAM,eAAe,GAAG,eAAe,CAAC;IAC5C,KAAK,EAAE,UAAU,CAAC;IAClB,WAAW,CAAC,EAAE,KAAK,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,EAAE,CAAC,eAAe,CAgD1C,CAAC"}
@@ -0,0 +1,8 @@
1
+ import '@dxos-theme';
2
+ import { type Meta, type StoryObj } from '@storybook/react';
3
+ import { Chessboard } from '@dxos/react-ui-gameboard';
4
+ declare const meta: Meta<typeof Chessboard>;
5
+ type Story = StoryObj<typeof Chessboard>;
6
+ export default meta;
7
+ export declare const Default: Story;
8
+ //# sourceMappingURL=Chessboard.stories.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Chessboard.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/Chessboard.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAG5D,OAAO,EAAS,UAAU,EAAc,MAAM,0BAA0B,CAAC;AAkBzE,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,UAAU,CAKjC,CAAC;AAEF,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,UAAU,CAAC,CAAC;AAEzC,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import React from 'react';
2
2
  import { type Space } from '@dxos/react-client/echo';
3
3
  import { type GameType } from '../types';
4
- export declare const Chess: ({ space, game, playerSelector }: {
5
- space: Space;
4
+ export declare const PlayerSelector: ({ game, space }: {
6
5
  game: GameType;
7
- playerSelector?: boolean;
8
- }) => React.JSX.Element | null;
9
- //# sourceMappingURL=Chess.d.ts.map
6
+ space: Space;
7
+ }) => React.JSX.Element;
8
+ //# sourceMappingURL=PlayerSelector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PlayerSelector.d.ts","sourceRoot":"","sources":["../../../../src/components/PlayerSelector.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,OAAO,EAAc,KAAK,KAAK,EAAoB,MAAM,yBAAyB,CAAC;AAInF,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,cAAc,oBAAqB;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,KAAK,CAAA;CAAE,sBAuB/E,CAAC"}
@@ -1,4 +1,5 @@
1
- export declare const ChessContainer: import("react").LazyExoticComponent<({ game, role }: Pick<import("react").ComponentProps<typeof import("./Chess").Chess>, "game"> & {
1
+ export declare const ChessContainer: import("react").LazyExoticComponent<({ game }: {
2
+ game: import("../types").GameType;
2
3
  role?: string;
3
4
  }) => import("react").JSX.Element | null>;
4
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;QACyJ,CAAC;yCADjH,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/index.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,cAAc;;QAC+T,CAAC;yCADvR,CAAC"}
@@ -5,5 +5,6 @@ export declare const meta: {
5
5
  description: string;
6
6
  icon: string;
7
7
  source: string;
8
+ screenshots: string[];
8
9
  };
9
10
  //# sourceMappingURL=meta.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,0BAA0B,CAAC;AAEpD,eAAO,MAAM,IAAI;;;;;;CAMK,CAAC"}
1
+ {"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/meta.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,0BAA0B,CAAC;AAEpD,eAAO,MAAM,IAAI;;;;;;;CAOK,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dxos/plugin-chess",
3
- "version": "0.7.5-main.9d2a38b",
3
+ "version": "0.7.5-main.e9bb01b",
4
4
  "description": "Chess for new plugin",
5
5
  "homepage": "https://dxos.org",
6
6
  "bugs": "https://github.com/dxos/dxos/issues",
@@ -34,20 +34,19 @@
34
34
  "dependencies": {
35
35
  "@effect/schema": "^0.75.5",
36
36
  "@preact/signals-core": "^1.6.0",
37
- "chess.js": "^1.0.0-beta.8",
38
- "react-chessboard": "^4.7.1",
39
- "react-resize-detector": "^11.0.1",
40
- "@dxos/app-framework": "0.7.5-main.9d2a38b",
41
- "@dxos/display-name": "0.7.5-main.9d2a38b",
42
- "@dxos/echo-schema": "0.7.5-main.9d2a38b",
43
- "@dxos/async": "0.7.5-main.9d2a38b",
44
- "@dxos/invariant": "0.7.5-main.9d2a38b",
45
- "@dxos/live-object": "0.7.5-main.9d2a38b",
46
- "@dxos/plugin-graph": "0.7.5-main.9d2a38b",
47
- "@dxos/plugin-space": "0.7.5-main.9d2a38b",
48
- "@dxos/react-client": "0.7.5-main.9d2a38b",
49
- "@dxos/react-ui-stack": "0.7.5-main.9d2a38b",
50
- "@dxos/plugin-client": "0.7.5-main.9d2a38b"
37
+ "chess.js": "^1.0.0",
38
+ "@dxos/app-framework": "0.7.5-main.e9bb01b",
39
+ "@dxos/async": "0.7.5-main.e9bb01b",
40
+ "@dxos/echo-schema": "0.7.5-main.e9bb01b",
41
+ "@dxos/invariant": "0.7.5-main.e9bb01b",
42
+ "@dxos/display-name": "0.7.5-main.e9bb01b",
43
+ "@dxos/live-object": "0.7.5-main.e9bb01b",
44
+ "@dxos/plugin-client": "0.7.5-main.e9bb01b",
45
+ "@dxos/plugin-graph": "0.7.5-main.e9bb01b",
46
+ "@dxos/plugin-space": "0.7.5-main.e9bb01b",
47
+ "@dxos/react-client": "0.7.5-main.e9bb01b",
48
+ "@dxos/react-ui-gameboard": "0.7.5-main.e9bb01b",
49
+ "@dxos/react-ui-stack": "0.7.5-main.e9bb01b"
51
50
  },
52
51
  "devDependencies": {
53
52
  "@phosphor-icons/react": "^2.1.5",
@@ -56,16 +55,16 @@
56
55
  "react": "~18.2.0",
57
56
  "react-dom": "~18.2.0",
58
57
  "vite": "5.4.7",
59
- "@dxos/react-ui": "0.7.5-main.9d2a38b",
60
- "@dxos/react-ui-theme": "0.7.5-main.9d2a38b",
61
- "@dxos/storybook-utils": "0.7.5-main.9d2a38b"
58
+ "@dxos/react-ui-theme": "0.7.5-main.e9bb01b",
59
+ "@dxos/react-ui": "0.7.5-main.e9bb01b",
60
+ "@dxos/storybook-utils": "0.7.5-main.e9bb01b"
62
61
  },
63
62
  "peerDependencies": {
64
63
  "@phosphor-icons/react": "^2.1.5",
65
64
  "react": "~18.2.0",
66
65
  "react-dom": "~18.2.0",
67
- "@dxos/react-ui": "0.7.5-main.9d2a38b",
68
- "@dxos/react-ui-theme": "0.7.5-main.9d2a38b"
66
+ "@dxos/react-ui": "0.7.5-main.e9bb01b",
67
+ "@dxos/react-ui-theme": "0.7.5-main.e9bb01b"
69
68
  },
70
69
  "publishConfig": {
71
70
  "access": "public"
@@ -2,15 +2,7 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import {
6
- Capabilities,
7
- contributes,
8
- createIntent,
9
- defineModule,
10
- definePlugin,
11
- Events,
12
- oneOf,
13
- } from '@dxos/app-framework';
5
+ import { Capabilities, contributes, createIntent, defineModule, definePlugin, Events } from '@dxos/app-framework';
14
6
  import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
15
7
 
16
8
  import { IntentResolver, ReactSurface } from './capabilities';
@@ -27,7 +19,7 @@ export const ChessPlugin = () =>
27
19
  }),
28
20
  defineModule({
29
21
  id: `${meta.id}/module/metadata`,
30
- activatesOn: oneOf(Events.Startup, Events.SetupAppGraph),
22
+ activatesOn: Events.SetupMetadata,
31
23
  activate: () =>
32
24
  contributes(Capabilities.Metadata, {
33
25
  id: GameType.typename,
@@ -40,17 +32,17 @@ export const ChessPlugin = () =>
40
32
  }),
41
33
  defineModule({
42
34
  id: `${meta.id}/module/schema`,
43
- activatesOn: ClientEvents.SetupClient,
35
+ activatesOn: ClientEvents.SetupSchema,
44
36
  activate: () => contributes(ClientCapabilities.Schema, [GameType]),
45
37
  }),
46
38
  defineModule({
47
39
  id: `${meta.id}/module/react-surface`,
48
- activatesOn: Events.Startup,
40
+ activatesOn: Events.SetupSurfaces,
49
41
  activate: ReactSurface,
50
42
  }),
51
43
  defineModule({
52
44
  id: `${meta.id}/module/intent-resolver`,
53
- activatesOn: Events.Startup,
45
+ activatesOn: Events.SetupIntents,
54
46
  activate: IntentResolver,
55
47
  }),
56
48
  ]);
@@ -10,9 +10,12 @@ import { ChessAction, GameType } from '../types';
10
10
  export default () =>
11
11
  contributes(
12
12
  Capabilities.IntentResolver,
13
- createResolver(ChessAction.Create, ({ name }) => ({
14
- data: {
15
- object: create(GameType, { name }),
16
- },
17
- })),
13
+ createResolver({
14
+ intent: ChessAction.Create,
15
+ resolve: ({ name }) => ({
16
+ data: {
17
+ object: create(GameType, { name }),
18
+ },
19
+ }),
20
+ }),
18
21
  );
@@ -2,22 +2,59 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import React, { type ComponentProps } from 'react';
5
+ import { Chess } from 'chess.js';
6
+ import React, { useCallback, useEffect, useMemo } from 'react';
6
7
 
7
8
  import { getSpace } from '@dxos/react-client/echo';
9
+ import { ChessModel, Board, Chessboard, type BoardRootProps } from '@dxos/react-ui-gameboard';
8
10
  import { StackItem } from '@dxos/react-ui-stack';
9
11
 
10
- import { Chess } from './Chess';
12
+ import { PlayerSelector } from './PlayerSelector';
13
+ import { type GameType } from '../types';
14
+
15
+ const ChessContainer = ({ game }: { game: GameType; role?: string }) => {
16
+ const model = useMemo(() => new ChessModel(), []);
17
+ useEffect(() => {
18
+ if (!model || game.pgn !== model?.game.pgn()) {
19
+ const chess = new Chess();
20
+ if (game.pgn) {
21
+ chess.loadPgn(game.pgn);
22
+ }
23
+
24
+ model.initialize(chess.fen());
25
+ }
26
+ }, [game.pgn]);
11
27
 
12
- const ChessContainer = ({ game, role }: Pick<ComponentProps<typeof Chess>, 'game'> & { role?: string }) => {
13
28
  const space = getSpace(game);
14
29
  if (!space) {
15
30
  return null;
16
31
  }
17
32
 
33
+ const handleDrop = useCallback<NonNullable<BoardRootProps['onDrop']>>(
34
+ (move) => {
35
+ if (model.makeMove(move)) {
36
+ game.pgn = model.game.pgn();
37
+ return true;
38
+ }
39
+
40
+ return false;
41
+ },
42
+ [model],
43
+ );
44
+
18
45
  return (
19
46
  <StackItem.Content toolbar={false}>
20
- <Chess game={game} space={space} playerSelector={role === 'article'} />
47
+ <div role='none' className='grid grid-rows-[60px_1fr_60px] grow overflow-hidden'>
48
+ <div />
49
+
50
+ <div className='flex m-4 overflow-hidden'>
51
+ <Board.Root model={model} onDrop={handleDrop}>
52
+ <Chessboard />
53
+ </Board.Root>
54
+ </div>
55
+
56
+ <PlayerSelector space={space} game={game} />
57
+ </div>
21
58
  </StackItem.Content>
22
59
  );
23
60
  };