@scriptonita/chess-football-ui 0.3.0 → 0.4.1

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/index.cjs CHANGED
@@ -146,6 +146,49 @@ var Football = ({ className }) => {
146
146
  }
147
147
  );
148
148
  };
149
+ var STATIC_I18N_KEYS = [
150
+ "actionPointsAriaLabel",
151
+ "actionPointsShort",
152
+ "endTurn",
153
+ "endTurnConfirm",
154
+ "endTurnConfirmDescription",
155
+ "endTurnConfirmYes",
156
+ "endTurnKeepPlaying",
157
+ "history.empty",
158
+ "history.goal",
159
+ "history.interception",
160
+ "history.move",
161
+ "history.offside",
162
+ "history.pass",
163
+ "history.tackle",
164
+ "history.title",
165
+ "history.turn",
166
+ "history.viewAll",
167
+ "move",
168
+ "offsideWarning",
169
+ "pass",
170
+ "selectedPiece.alreadyMoved",
171
+ "selectedPiece.atSquare",
172
+ "selectedPiece.empty",
173
+ "selectedPiece.hasBall",
174
+ "teamBlack",
175
+ "teamWhite",
176
+ "waitingRival",
177
+ "yourTurn"
178
+ ];
179
+ var PIECE_I18N_KEYS = [...Object.values(chessFootballEngine.SHORT_KEY), ...Object.values(chessFootballEngine.LONG_KEY)].map(
180
+ (label) => `pieces.${label}`
181
+ );
182
+ var EVENT_TOAST_I18N_KEYS = [
183
+ "eventToast.interception",
184
+ "eventToast.offside",
185
+ "eventToast.tackle"
186
+ ];
187
+ var GAME_I18N_KEYS = [
188
+ ...STATIC_I18N_KEYS,
189
+ ...PIECE_I18N_KEYS,
190
+ ...EVENT_TOAST_I18N_KEYS
191
+ ];
149
192
  var fallback = (key) => key;
150
193
  var GameI18nContext = React.createContext(fallback);
151
194
  function GameI18nProvider({ t, children }) {
@@ -356,7 +399,14 @@ function GameBoard({ userSide, showCoordinates = false, keyboardNav = true }) {
356
399
  isDisambiguateTarget && selectedPieceId && /* @__PURE__ */ jsxRuntime.jsxs(
357
400
  "div",
358
401
  {
359
- className: "absolute z-50 bottom-full mb-1 left-1/2 -translate-x-1/2 flex gap-1 bg-bg-secondary border border-border-subtle rounded-md p-1 shadow-xl pointer-events-auto whitespace-nowrap",
402
+ className: cn(
403
+ "absolute z-50 flex gap-1 bg-bg-secondary border border-border-subtle rounded-md p-1 shadow-xl pointer-events-auto whitespace-nowrap",
404
+ // The board container is `overflow-hidden` (for its rounded
405
+ // corners), so a popover that spills past an edge gets clipped.
406
+ // Anchor it inside the board on edge columns / the top row.
407
+ y === ROWS - 1 ? "top-full mt-1" : "bottom-full mb-1",
408
+ x === 0 ? "left-0" : x === COLS - 1 ? "right-0" : "left-1/2 -translate-x-1/2"
409
+ ),
360
410
  onClick: (e) => e.stopPropagation(),
361
411
  children: [
362
412
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -1306,6 +1356,7 @@ exports.Button = Button;
1306
1356
  exports.ConfirmDialog = ConfirmDialog;
1307
1357
  exports.EventToast = EventToast;
1308
1358
  exports.Football = Football;
1359
+ exports.GAME_I18N_KEYS = GAME_I18N_KEYS;
1309
1360
  exports.GameBoard = GameBoard;
1310
1361
  exports.GameControls = GameControls;
1311
1362
  exports.GameI18nProvider = GameI18nProvider;