@dxos/react-ui-gameboard 0.8.4-main.c85a9c8dae → 0.8.4-main.d05539e30a

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 (97) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/browser/index.mjs +12 -72
  3. package/dist/lib/browser/index.mjs.map +4 -4
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node-esm/index.mjs +12 -72
  6. package/dist/lib/node-esm/index.mjs.map +4 -4
  7. package/dist/lib/node-esm/meta.json +1 -1
  8. package/dist/types/src/components/Chessboard/Chessboard.d.ts +1 -1
  9. package/dist/types/src/components/Chessboard/Chessboard.d.ts.map +1 -1
  10. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts +1 -0
  11. package/dist/types/src/components/Chessboard/Chessboard.stories.d.ts.map +1 -1
  12. package/dist/types/src/components/Chessboard/chess.d.ts.map +1 -1
  13. package/dist/types/src/components/Gameboard/Gameboard.d.ts +5 -1
  14. package/dist/types/src/components/Gameboard/Gameboard.d.ts.map +1 -1
  15. package/dist/types/src/components/Gameboard/types.d.ts.map +1 -1
  16. package/dist/types/src/components/Gameboard/util.d.ts.map +1 -1
  17. package/dist/types/src/gen/pieces/chess/alpha/bB.d.ts +2 -2
  18. package/dist/types/src/gen/pieces/chess/alpha/bB.d.ts.map +1 -1
  19. package/dist/types/src/gen/pieces/chess/alpha/bK.d.ts +2 -2
  20. package/dist/types/src/gen/pieces/chess/alpha/bK.d.ts.map +1 -1
  21. package/dist/types/src/gen/pieces/chess/alpha/bN.d.ts +2 -2
  22. package/dist/types/src/gen/pieces/chess/alpha/bN.d.ts.map +1 -1
  23. package/dist/types/src/gen/pieces/chess/alpha/bP.d.ts +2 -2
  24. package/dist/types/src/gen/pieces/chess/alpha/bP.d.ts.map +1 -1
  25. package/dist/types/src/gen/pieces/chess/alpha/bQ.d.ts +2 -2
  26. package/dist/types/src/gen/pieces/chess/alpha/bQ.d.ts.map +1 -1
  27. package/dist/types/src/gen/pieces/chess/alpha/bR.d.ts +2 -2
  28. package/dist/types/src/gen/pieces/chess/alpha/bR.d.ts.map +1 -1
  29. package/dist/types/src/gen/pieces/chess/alpha/index.d.ts +12 -12
  30. package/dist/types/src/gen/pieces/chess/alpha/wB.d.ts +2 -2
  31. package/dist/types/src/gen/pieces/chess/alpha/wB.d.ts.map +1 -1
  32. package/dist/types/src/gen/pieces/chess/alpha/wK.d.ts +2 -2
  33. package/dist/types/src/gen/pieces/chess/alpha/wK.d.ts.map +1 -1
  34. package/dist/types/src/gen/pieces/chess/alpha/wN.d.ts +2 -2
  35. package/dist/types/src/gen/pieces/chess/alpha/wN.d.ts.map +1 -1
  36. package/dist/types/src/gen/pieces/chess/alpha/wP.d.ts +2 -2
  37. package/dist/types/src/gen/pieces/chess/alpha/wP.d.ts.map +1 -1
  38. package/dist/types/src/gen/pieces/chess/alpha/wQ.d.ts +2 -2
  39. package/dist/types/src/gen/pieces/chess/alpha/wQ.d.ts.map +1 -1
  40. package/dist/types/src/gen/pieces/chess/alpha/wR.d.ts +2 -2
  41. package/dist/types/src/gen/pieces/chess/alpha/wR.d.ts.map +1 -1
  42. package/dist/types/src/gen/pieces/chess/cburnett/bB.d.ts +2 -2
  43. package/dist/types/src/gen/pieces/chess/cburnett/bB.d.ts.map +1 -1
  44. package/dist/types/src/gen/pieces/chess/cburnett/bK.d.ts +2 -2
  45. package/dist/types/src/gen/pieces/chess/cburnett/bK.d.ts.map +1 -1
  46. package/dist/types/src/gen/pieces/chess/cburnett/bN.d.ts +2 -2
  47. package/dist/types/src/gen/pieces/chess/cburnett/bN.d.ts.map +1 -1
  48. package/dist/types/src/gen/pieces/chess/cburnett/bP.d.ts +2 -2
  49. package/dist/types/src/gen/pieces/chess/cburnett/bP.d.ts.map +1 -1
  50. package/dist/types/src/gen/pieces/chess/cburnett/bQ.d.ts +2 -2
  51. package/dist/types/src/gen/pieces/chess/cburnett/bQ.d.ts.map +1 -1
  52. package/dist/types/src/gen/pieces/chess/cburnett/bR.d.ts +2 -2
  53. package/dist/types/src/gen/pieces/chess/cburnett/bR.d.ts.map +1 -1
  54. package/dist/types/src/gen/pieces/chess/cburnett/index.d.ts +12 -12
  55. package/dist/types/src/gen/pieces/chess/cburnett/wB.d.ts +2 -2
  56. package/dist/types/src/gen/pieces/chess/cburnett/wB.d.ts.map +1 -1
  57. package/dist/types/src/gen/pieces/chess/cburnett/wK.d.ts +2 -2
  58. package/dist/types/src/gen/pieces/chess/cburnett/wK.d.ts.map +1 -1
  59. package/dist/types/src/gen/pieces/chess/cburnett/wN.d.ts +2 -2
  60. package/dist/types/src/gen/pieces/chess/cburnett/wN.d.ts.map +1 -1
  61. package/dist/types/src/gen/pieces/chess/cburnett/wP.d.ts +2 -2
  62. package/dist/types/src/gen/pieces/chess/cburnett/wP.d.ts.map +1 -1
  63. package/dist/types/src/gen/pieces/chess/cburnett/wQ.d.ts +2 -2
  64. package/dist/types/src/gen/pieces/chess/cburnett/wQ.d.ts.map +1 -1
  65. package/dist/types/src/gen/pieces/chess/cburnett/wR.d.ts +2 -2
  66. package/dist/types/src/gen/pieces/chess/cburnett/wR.d.ts.map +1 -1
  67. package/dist/types/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +13 -16
  69. package/src/components/Chessboard/Chessboard.stories.tsx +1 -1
  70. package/src/components/Chessboard/Chessboard.tsx +1 -2
  71. package/src/components/Gameboard/Gameboard.tsx +1 -2
  72. package/src/gen/pieces/chess/alpha/bB.tsx +6 -9
  73. package/src/gen/pieces/chess/alpha/bK.tsx +7 -7
  74. package/src/gen/pieces/chess/alpha/bN.tsx +7 -7
  75. package/src/gen/pieces/chess/alpha/bP.tsx +5 -5
  76. package/src/gen/pieces/chess/alpha/bQ.tsx +6 -9
  77. package/src/gen/pieces/chess/alpha/bR.tsx +6 -6
  78. package/src/gen/pieces/chess/alpha/index.ts +12 -12
  79. package/src/gen/pieces/chess/alpha/wB.tsx +7 -7
  80. package/src/gen/pieces/chess/alpha/wK.tsx +7 -7
  81. package/src/gen/pieces/chess/alpha/wN.tsx +7 -7
  82. package/src/gen/pieces/chess/alpha/wP.tsx +7 -7
  83. package/src/gen/pieces/chess/alpha/wQ.tsx +7 -7
  84. package/src/gen/pieces/chess/alpha/wR.tsx +7 -7
  85. package/src/gen/pieces/chess/cburnett/bB.tsx +9 -20
  86. package/src/gen/pieces/chess/cburnett/bK.tsx +15 -25
  87. package/src/gen/pieces/chess/cburnett/bN.tsx +13 -20
  88. package/src/gen/pieces/chess/cburnett/bP.tsx +6 -6
  89. package/src/gen/pieces/chess/cburnett/bQ.tsx +13 -19
  90. package/src/gen/pieces/chess/cburnett/bR.tsx +11 -27
  91. package/src/gen/pieces/chess/cburnett/index.ts +12 -12
  92. package/src/gen/pieces/chess/cburnett/wB.tsx +9 -19
  93. package/src/gen/pieces/chess/cburnett/wK.tsx +12 -19
  94. package/src/gen/pieces/chess/cburnett/wN.tsx +9 -16
  95. package/src/gen/pieces/chess/cburnett/wP.tsx +7 -7
  96. package/src/gen/pieces/chess/cburnett/wQ.tsx +9 -19
  97. package/src/gen/pieces/chess/cburnett/wR.tsx +9 -19
package/LICENSE CHANGED
@@ -1,8 +1,105 @@
1
- MIT License
2
- Copyright (c) 2022 DXOS
1
+ # Functional Source License, Version 1.1, ALv2 Future License
3
2
 
4
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3
+ ## Abbreviation
5
4
 
6
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
5
+ FSL-1.1-Apache-2.0
7
6
 
8
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
7
+ ## Notice
8
+
9
+ Copyright 2026 DXOS
10
+
11
+ ## Terms and Conditions
12
+
13
+ ### Licensor ("We")
14
+
15
+ The party offering the Software under these Terms and Conditions.
16
+
17
+ ### The Software
18
+
19
+ The "Software" is each version of the software that we make available under
20
+ these Terms and Conditions, as indicated by our inclusion of these Terms and
21
+ Conditions with the Software.
22
+
23
+ ### License Grant
24
+
25
+ Subject to your compliance with this License Grant and the Patents,
26
+ Redistribution and Trademark clauses below, we hereby grant you the right to
27
+ use, copy, modify, create derivative works, publicly perform, publicly display
28
+ and redistribute the Software for any Permitted Purpose identified below.
29
+
30
+ ### Permitted Purpose
31
+
32
+ A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
33
+ means making the Software available to others in a commercial product or
34
+ service that:
35
+
36
+ 1. substitutes for the Software;
37
+
38
+ 2. substitutes for any other product or service we offer using the Software
39
+ that exists as of the date we make the Software available; or
40
+
41
+ 3. offers the same or substantially similar functionality as the Software.
42
+
43
+ Permitted Purposes specifically include using the Software:
44
+
45
+ 1. for your internal use and access;
46
+
47
+ 2. for non-commercial education;
48
+
49
+ 3. for non-commercial research; and
50
+
51
+ 4. in connection with professional services that you provide to a licensee
52
+ using the Software in accordance with these Terms and Conditions.
53
+
54
+ ### Patents
55
+
56
+ To the extent your use for a Permitted Purpose would necessarily infringe our
57
+ patents, the license grant above includes a license under our patents. If you
58
+ make a claim against any party that the Software infringes or contributes to
59
+ the infringement of any patent, then your patent license to the Software ends
60
+ immediately.
61
+
62
+ ### Redistribution
63
+
64
+ The Terms and Conditions apply to all copies, modifications and derivatives of
65
+ the Software.
66
+
67
+ If you redistribute any copies, modifications or derivatives of the Software,
68
+ you must include a copy of or a link to these Terms and Conditions and not
69
+ remove any copyright notices provided in or with the Software.
70
+
71
+ ### Disclaimer
72
+
73
+ THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
74
+ IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
75
+ PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
76
+
77
+ IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
78
+ SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
79
+ EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
80
+
81
+ ### Trademarks
82
+
83
+ Except for displaying the License Details and identifying us as the origin of
84
+ the Software, you have no right under these Terms and Conditions to use our
85
+ trademarks, trade names, service marks or product names.
86
+
87
+ ## Grant of Future License
88
+
89
+ We hereby irrevocably grant you an additional license to use the Software under
90
+ the Apache License, Version 2.0 that is effective on the second anniversary of
91
+ the date we make the Software available. On or after that date, you may use the
92
+ Software under the Apache License, Version 2.0, in which case the following
93
+ will apply:
94
+
95
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
96
+ this file except in compliance with the License.
97
+
98
+ You may obtain a copy of the License at
99
+
100
+ http://www.apache.org/licenses/LICENSE-2.0
101
+
102
+ Unless required by applicable law or agreed to in writing, software distributed
103
+ under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
104
+ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
+ specific language governing permissions and limitations under the License.
@@ -54,15 +54,7 @@ var Piece = /* @__PURE__ */ memo(({ classNames, Component, piece, bounds, label,
54
54
  return;
55
55
  }
56
56
  const el = ref.current;
57
- invariant(el, void 0, {
58
- F: __dxlog_file,
59
- L: 47,
60
- S: void 0,
61
- A: [
62
- "el",
63
- ""
64
- ]
65
- });
57
+ invariant(el, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 29, S: void 0, A: ["el", ""] });
66
58
  return draggable({
67
59
  element: el,
68
60
  getInitialData: () => ({
@@ -71,12 +63,7 @@ var Piece = /* @__PURE__ */ memo(({ classNames, Component, piece, bounds, label,
71
63
  onGenerateDragPreview: ({ nativeSetDragImage, source }) => {
72
64
  log("onGenerateDragPreview", {
73
65
  source: source.data
74
- }, {
75
- F: __dxlog_file,
76
- L: 53,
77
- S: void 0,
78
- C: (f, a) => f(...a)
79
- });
66
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 36, S: void 0 });
80
67
  setCustomNativeDragPreview({
81
68
  getOffset: centerUnderPointer,
82
69
  render: ({ container }) => {
@@ -173,15 +160,7 @@ var Square = /* @__PURE__ */ memo2(({ location, bounds, label, classNames }) =>
173
160
  const { model } = useGameboardContext(SQUARE_NAME);
174
161
  useEffect2(() => {
175
162
  const el = ref.current;
176
- invariant2(el, void 0, {
177
- F: __dxlog_file2,
178
- L: 34,
179
- S: void 0,
180
- A: [
181
- "el",
182
- ""
183
- ]
184
- });
163
+ invariant2(el, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 18, S: void 0, A: ["el", ""] });
185
164
  return dropTargetForElements({
186
165
  element: el,
187
166
  getData: () => ({
@@ -190,23 +169,13 @@ var Square = /* @__PURE__ */ memo2(({ location, bounds, label, classNames }) =>
190
169
  canDrop: ({ source }) => {
191
170
  log2("canDrop", {
192
171
  source: source.data
193
- }, {
194
- F: __dxlog_file2,
195
- L: 40,
196
- S: void 0,
197
- C: (f, a) => f(...a)
198
- });
172
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 25, S: void 0 });
199
173
  return true;
200
174
  },
201
175
  onDragEnter: ({ source }) => {
202
176
  log2("onDragEnter", {
203
177
  source: source.data
204
- }, {
205
- F: __dxlog_file2,
206
- L: 44,
207
- S: void 0,
208
- C: (f, a) => f(...a)
209
- });
178
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 31, S: void 0 });
210
179
  const piece = source.data.piece;
211
180
  if (!isPiece(piece)) {
212
181
  return;
@@ -250,12 +219,7 @@ var GameboardRoot = ({ children, model, onDrop }) => {
250
219
  const handlePromotion = useCallback((move) => {
251
220
  log3("onPromotion", {
252
221
  move
253
- }, {
254
- F: __dxlog_file3,
255
- L: 47,
256
- S: void 0,
257
- C: (f, a) => f(...a)
258
- });
222
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 22, S: void 0 });
259
223
  setPromoting(void 0);
260
224
  onDrop?.(move);
261
225
  }, []);
@@ -267,24 +231,14 @@ var GameboardRoot = ({ children, model, onDrop }) => {
267
231
  onDragStart: ({ source }) => {
268
232
  log3("onDragStart", {
269
233
  source
270
- }, {
271
- F: __dxlog_file3,
272
- L: 60,
273
- S: void 0,
274
- C: (f, a) => f(...a)
275
- });
234
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 35, S: void 0 });
276
235
  setDragging(true);
277
236
  },
278
237
  onDrop: ({ source, location }) => {
279
238
  log3("onDrop", {
280
239
  source,
281
240
  location
282
- }, {
283
- F: __dxlog_file3,
284
- L: 64,
285
- S: void 0,
286
- C: (f, a) => f(...a)
287
- });
241
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 41, S: void 0 });
288
242
  const target = location.current.dropTargets[0];
289
243
  if (!target) {
290
244
  return;
@@ -325,8 +279,7 @@ var GameboardRoot = ({ children, model, onDrop }) => {
325
279
  GameboardRoot.displayName = "Gameboard.Root";
326
280
  var GameboardContent = /* @__PURE__ */ forwardRef(({ children, classNames, grow, contain }, forwardedRef) => {
327
281
  return /* @__PURE__ */ React3.createElement("div", {
328
- role: "none",
329
- className: mx3(grow && "grid w-full h-full dx-size-container place-content-center", classNames),
282
+ className: mx3(grow && "dx-size-container dx-expander grid place-content-center", classNames),
330
283
  ref: forwardedRef
331
284
  }, contain ? /* @__PURE__ */ React3.createElement("div", {
332
285
  className: "w-[min(100cqw,100cqh)] h-[min(100cqw,100cqh)]"
@@ -589,12 +542,7 @@ var createChess = (pgn) => {
589
542
  try {
590
543
  chess.loadPgn(pgn);
591
544
  } catch {
592
- log4.warn(pgn, void 0, {
593
- F: __dxlog_file4,
594
- L: 76,
595
- S: void 0,
596
- C: (f, a) => f(...a)
597
- });
545
+ log4.warn(pgn, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file4, L: 57, S: void 0 });
598
546
  }
599
547
  }
600
548
  return chess;
@@ -739,15 +687,7 @@ var createPieceMap = (chess) => {
739
687
  pieces = _diffPieces(pieces, _createPieceMap(temp));
740
688
  const test = /* @__PURE__ */ new Set();
741
689
  Object.values(pieces).forEach((piece) => {
742
- invariant3(!test.has(piece.id), "Duplicate: " + piece.id, {
743
- F: __dxlog_file4,
744
- L: 255,
745
- S: void 0,
746
- A: [
747
- "!test.has(piece.id)",
748
- "'Duplicate: ' + piece.id"
749
- ]
750
- });
690
+ invariant3(!test.has(piece.id), "Duplicate: " + piece.id, { "~LogMeta": "~LogMeta", F: __dxlog_file4, L: 213, S: void 0, A: ["!test.has(piece.id)", "'Duplicate: ' + piece.id"] });
751
691
  test.add(piece.id);
752
692
  });
753
693
  }
@@ -877,7 +817,7 @@ var ChessboardComponent = /* @__PURE__ */ forwardRef2(({ classNames, orientation
877
817
  return /* @__PURE__ */ React16.createElement("div", {
878
818
  ref: targetRef,
879
819
  tabIndex: 0,
880
- className: mx4("relative outline-hidden", classNames)
820
+ className: mx4("dx-expander relative outline-hidden", classNames)
881
821
  }, /* @__PURE__ */ React16.createElement("div", {
882
822
  ref: gridRef,
883
823
  className: "grid grid-rows-8 grid-cols-8 aspect-square select-none"