@tastic/shell 0.8.0 → 0.8.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.js CHANGED
@@ -1257,6 +1257,7 @@ function hasRules(game) {
1257
1257
  function RulesHost({ enabled, children }) {
1258
1258
  return enabled ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Portal.Host, { children }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_jsx_runtime14.Fragment, { children });
1259
1259
  }
1260
+ var ROW_BLURB_LINES = 3;
1260
1261
  function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
1261
1262
  const well = (0, import_chrome5.useWellColors)();
1262
1263
  const GameIcon = game.icon;
@@ -1268,7 +1269,7 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
1268
1269
  game.Preview ? /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(PreviewBox, { game, width: ROW_PREVIEW_WIDTH, revealed: previewRevealed, dark, p1Color, p2Color }) : /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native8.View, { style: [styles4.rowIcon, { backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: GameIcon && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(GameIcon, { size: ROW_ICON_SIZE, p1Color, p2Color, dark }) }),
1269
1270
  /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_react_native8.View, { style: styles4.rowText, children: [
1270
1271
  /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Text, { variant: "titleLarge", style: [styles4.rowTitle, { color: well.fg }], numberOfLines: 1, children: game.title }),
1271
- /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: 2, children: game.blurb })
1272
+ /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: ROW_BLURB_LINES, children: game.blurb })
1272
1273
  ] })
1273
1274
  ] }),
1274
1275
  onRules && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_feedback_press3.Pressable, { onPress: onRules, style: styles4.rulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_react_native_paper.Icon, { source: "information-outline", size: 22, color: well.fgMuted }) })
package/dist/index.mjs CHANGED
@@ -1180,6 +1180,7 @@ function hasRules(game) {
1180
1180
  function RulesHost({ enabled, children }) {
1181
1181
  return enabled ? /* @__PURE__ */ jsx14(Portal.Host, { children }) : /* @__PURE__ */ jsx14(Fragment4, { children });
1182
1182
  }
1183
+ var ROW_BLURB_LINES = 3;
1183
1184
  function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }) {
1184
1185
  const well = useWellColors();
1185
1186
  const GameIcon = game.icon;
@@ -1191,7 +1192,7 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
1191
1192
  game.Preview ? /* @__PURE__ */ jsx14(PreviewBox, { game, width: ROW_PREVIEW_WIDTH, revealed: previewRevealed, dark, p1Color, p2Color }) : /* @__PURE__ */ jsx14(View4, { style: [styles4.rowIcon, { backgroundColor: dark ? ICON_DARK_BG : ICON_LIGHT_BG }], children: GameIcon && /* @__PURE__ */ jsx14(GameIcon, { size: ROW_ICON_SIZE, p1Color, p2Color, dark }) }),
1192
1193
  /* @__PURE__ */ jsxs5(View4, { style: styles4.rowText, children: [
1193
1194
  /* @__PURE__ */ jsx14(Text, { variant: "titleLarge", style: [styles4.rowTitle, { color: well.fg }], numberOfLines: 1, children: game.title }),
1194
- /* @__PURE__ */ jsx14(Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: 2, children: game.blurb })
1195
+ /* @__PURE__ */ jsx14(Text, { variant: "bodyMedium", style: { color: well.fgMuted }, numberOfLines: ROW_BLURB_LINES, children: game.blurb })
1195
1196
  ] })
1196
1197
  ] }),
1197
1198
  onRules && /* @__PURE__ */ jsx14(Pressable, { onPress: onRules, style: styles4.rulesButton, hitSlop: 12, accessibilityRole: "button", accessibilityLabel: `${game.title} rules`, children: /* @__PURE__ */ jsx14(Icon, { source: "information-outline", size: 22, color: well.fgMuted }) })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tastic/shell",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "The app around a pack of React Native games, two-seat or for one player: Home, the loadout, the stats screen, Profiles and Settings, the pack's Redux store and its root providers, driven by one PackDefinition",
5
5
  "keywords": [
6
6
  "react-native",
@@ -276,8 +276,11 @@ interface GameRowProps {
276
276
  }
277
277
 
278
278
  // One game on its own well: its icon at app-icon size (the art was drawn as an app icon), or its
279
- // preview where it has one, its name and one-line blurb, and a rules button at the end that shows its
279
+ // preview where it has one, its name and short blurb (up to ROW_BLURB_LINES lines), and a rules button at the end that shows its
280
280
  // How to Play cards without opening the game.
281
+ // How many lines a row's blurb may wrap to before it's cut off.
282
+ export const ROW_BLURB_LINES = 3
283
+
281
284
  function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPress, onRules }: GameRowProps) {
282
285
  const well = useWellColors()
283
286
  const GameIcon = game.icon
@@ -291,7 +294,9 @@ function GameRow({ game, hidden, dark, p1Color, p2Color, previewRevealed, onPres
291
294
  <Text variant='titleLarge' style={[styles.rowTitle, { color: well.fg }]} numberOfLines={1}>
292
295
  {game.title}
293
296
  </Text>
294
- <Text variant='bodyMedium' style={{ color: well.fgMuted }} numberOfLines={2}>
297
+ {/* Three lines, as a tile allows: a narrow phone (an iPhone SE, a 411dp Android phone) wraps a
298
+ 55-character blurb onto a third line in the monospace, and two lines cut it off with an ellipsis */}
299
+ <Text variant='bodyMedium' style={{ color: well.fgMuted }} numberOfLines={ROW_BLURB_LINES}>
295
300
  {game.blurb}
296
301
  </Text>
297
302
  </View>
package/src/types.ts CHANGED
@@ -137,7 +137,8 @@ export interface GameRulesProps {
137
137
  export interface GameDefinition {
138
138
  id: string
139
139
  title: string
140
- // One line under the tile's name on Home.
140
+ // A sentence or two under the game's name on Home: a row shows up to three lines (ROW_BLURB_LINES)
141
+ // on the narrowest phones, a tile three.
141
142
  blurb: string
142
143
  // Left out only by a game with a Preview, which Home draws in its place.
143
144
  icon?: ComponentType<GameIconProps>