@tastic/hud 0.16.0 → 0.17.0
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/README.md +45 -2
- package/dist/chrome/index.d.mts +26 -1
- package/dist/chrome/index.d.ts +26 -1
- package/dist/chrome/index.js +137 -103
- package/dist/chrome/index.mjs +10 -4
- package/dist/{chunk-JXRBXQLQ.mjs → chunk-27FIA26F.mjs} +16 -8
- package/dist/{chunk-32U2OIRW.mjs → chunk-AX4GC5KU.mjs} +25 -1
- package/dist/guide/index.js +73 -57
- package/dist/guide/index.mjs +10 -6
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +250 -216
- package/dist/index.mjs +9 -3
- package/package.json +1 -1
- package/src/BaseSettingsDialog.tsx +22 -1
- package/src/ConfirmDialog.tsx +14 -12
- package/src/OverlaySurface.tsx +62 -0
- package/src/chrome/index.ts +1 -0
- package/src/guide/HowToPlayDialog.tsx +14 -8
- package/src/index.ts +1 -0
- package/src/overlayCard.ts +13 -8
|
@@ -70,8 +70,32 @@ var overlayActionStyles = StyleSheet.create({
|
|
|
70
70
|
}
|
|
71
71
|
});
|
|
72
72
|
|
|
73
|
+
// src/OverlaySurface.tsx
|
|
74
|
+
import { BlurView, useAutoPaperTheme, useBlur } from "@rific/auto-paper";
|
|
75
|
+
import { StyleSheet as StyleSheet2, View } from "react-native";
|
|
76
|
+
import { jsx } from "react/jsx-runtime";
|
|
77
|
+
function useOverlayCardColors() {
|
|
78
|
+
const { colors } = useAutoPaperTheme();
|
|
79
|
+
return { fg: colors.onSurface, fgMuted: colors.onSurfaceVariant, cardBorder: colors.outlineVariant, backdrop: colors.backdrop };
|
|
80
|
+
}
|
|
81
|
+
function OverlayBackdrop({ children, style }) {
|
|
82
|
+
const { backdrop } = useOverlayCardColors();
|
|
83
|
+
return /* @__PURE__ */ jsx(View, { style: [overlayStyles.overlay, { backgroundColor: backdrop }, style], children });
|
|
84
|
+
}
|
|
85
|
+
function OverlayCard({ children, style, ...rest }) {
|
|
86
|
+
const { cardBorder } = useOverlayCardColors();
|
|
87
|
+
const blur = useBlur();
|
|
88
|
+
return /* @__PURE__ */ jsx(BlurView, { blur, elevation: 3, style: [overlayStyles.card, styles.card, { borderColor: cardBorder }, style], ...rest, children });
|
|
89
|
+
}
|
|
90
|
+
var styles = StyleSheet2.create({
|
|
91
|
+
card: { overflow: "hidden" }
|
|
92
|
+
});
|
|
93
|
+
|
|
73
94
|
export {
|
|
74
95
|
getOverlayCardColors,
|
|
75
96
|
overlayStyles,
|
|
76
|
-
overlayActionStyles
|
|
97
|
+
overlayActionStyles,
|
|
98
|
+
useOverlayCardColors,
|
|
99
|
+
OverlayBackdrop,
|
|
100
|
+
OverlayCard
|
|
77
101
|
};
|
package/dist/guide/index.js
CHANGED
|
@@ -100,23 +100,15 @@ var styles = import_react_native.StyleSheet.create({
|
|
|
100
100
|
var import_react2 = require("react");
|
|
101
101
|
|
|
102
102
|
// src/guide/HowToPlayDialog.tsx
|
|
103
|
-
var
|
|
103
|
+
var import_auto_paper3 = require("@rific/auto-paper");
|
|
104
104
|
var import_feedback_press = require("@rific/feedback-press");
|
|
105
105
|
var import_react = require("react");
|
|
106
|
-
var
|
|
106
|
+
var import_react_native4 = require("react-native");
|
|
107
107
|
var import_react_native_paper2 = require("react-native-paper");
|
|
108
108
|
var import_react_native_reanimated = require("react-native-reanimated");
|
|
109
109
|
|
|
110
110
|
// src/overlayCard.ts
|
|
111
111
|
var import_react_native2 = require("react-native");
|
|
112
|
-
function getOverlayCardColors(dark) {
|
|
113
|
-
return {
|
|
114
|
-
fg: dark ? "#FFFFFF" : "#000000",
|
|
115
|
-
fgMuted: dark ? "rgba(255,255,255,0.4)" : "rgba(0,0,0,0.4)",
|
|
116
|
-
cardBg: dark ? "#111111" : "#F2F2F2",
|
|
117
|
-
cardBorder: dark ? "rgba(255,255,255,0.2)" : "rgba(0,0,0,0.2)"
|
|
118
|
-
};
|
|
119
|
-
}
|
|
120
112
|
var overlayStyles = import_react_native2.StyleSheet.create({
|
|
121
113
|
card: {
|
|
122
114
|
alignItems: "center",
|
|
@@ -179,8 +171,29 @@ var overlayActionStyles = import_react_native2.StyleSheet.create({
|
|
|
179
171
|
}
|
|
180
172
|
});
|
|
181
173
|
|
|
182
|
-
// src/
|
|
174
|
+
// src/OverlaySurface.tsx
|
|
175
|
+
var import_auto_paper2 = require("@rific/auto-paper");
|
|
176
|
+
var import_react_native3 = require("react-native");
|
|
183
177
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
178
|
+
function useOverlayCardColors() {
|
|
179
|
+
const { colors } = (0, import_auto_paper2.useAutoPaperTheme)();
|
|
180
|
+
return { fg: colors.onSurface, fgMuted: colors.onSurfaceVariant, cardBorder: colors.outlineVariant, backdrop: colors.backdrop };
|
|
181
|
+
}
|
|
182
|
+
function OverlayBackdrop({ children, style }) {
|
|
183
|
+
const { backdrop } = useOverlayCardColors();
|
|
184
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react_native3.View, { style: [overlayStyles.overlay, { backgroundColor: backdrop }, style], children });
|
|
185
|
+
}
|
|
186
|
+
function OverlayCard({ children, style, ...rest }) {
|
|
187
|
+
const { cardBorder } = useOverlayCardColors();
|
|
188
|
+
const blur = (0, import_auto_paper2.useBlur)();
|
|
189
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_auto_paper2.BlurView, { blur, elevation: 3, style: [overlayStyles.card, styles2.card, { borderColor: cardBorder }, style], ...rest, children });
|
|
190
|
+
}
|
|
191
|
+
var styles2 = import_react_native3.StyleSheet.create({
|
|
192
|
+
card: { overflow: "hidden" }
|
|
193
|
+
});
|
|
194
|
+
|
|
195
|
+
// src/guide/HowToPlayDialog.tsx
|
|
196
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
184
197
|
var OVERLAY_GUTTER = 24;
|
|
185
198
|
var CARD_PADDING = 24;
|
|
186
199
|
var MAX_CARD_WIDTH = 360;
|
|
@@ -201,19 +214,19 @@ function getGuideCardSize(windowWidth, windowHeight, rotation) {
|
|
|
201
214
|
};
|
|
202
215
|
}
|
|
203
216
|
function HowToPlayCard({ steps, onFinish, onSkip, rotation = 0 }) {
|
|
204
|
-
const { dark, colors } = (0,
|
|
205
|
-
const { width: windowWidth, height: windowHeight } = (0,
|
|
217
|
+
const { dark, colors } = (0, import_auto_paper3.useAutoPaperTheme)();
|
|
218
|
+
const { width: windowWidth, height: windowHeight } = (0, import_react_native4.useWindowDimensions)();
|
|
206
219
|
const reducedMotion = (0, import_react_native_reanimated.useReducedMotion)();
|
|
207
220
|
const [index, setIndex] = (0, import_react.useState)(0);
|
|
208
221
|
const scrollRef = (0, import_react.useRef)(null);
|
|
209
222
|
(0, import_react.useEffect)(() => {
|
|
210
|
-
const subscription =
|
|
223
|
+
const subscription = import_react_native4.BackHandler.addEventListener("hardwareBackPress", () => {
|
|
211
224
|
onSkip();
|
|
212
225
|
return true;
|
|
213
226
|
});
|
|
214
227
|
return () => subscription.remove();
|
|
215
228
|
}, [onSkip]);
|
|
216
|
-
const { fg,
|
|
229
|
+
const { fg, fgMuted } = useOverlayCardColors();
|
|
217
230
|
const { width: cardWidth, pageWidth, maxHeight, artHeight } = getGuideCardSize(windowWidth, windowHeight, rotation);
|
|
218
231
|
const rotationStyle = rotation === 0 ? void 0 : { transform: [{ rotate: `${rotation}deg` }] };
|
|
219
232
|
const isFirst = index === 0;
|
|
@@ -242,24 +255,24 @@ function HowToPlayCard({ steps, onFinish, onSkip, rotation = 0 }) {
|
|
|
242
255
|
targetRef.current = null;
|
|
243
256
|
syncToOffset(e.nativeEvent.contentOffset.x);
|
|
244
257
|
}
|
|
245
|
-
return /* @__PURE__ */ (0,
|
|
246
|
-
/* @__PURE__ */ (0,
|
|
247
|
-
step.art !== void 0 && /* @__PURE__ */ (0,
|
|
248
|
-
/* @__PURE__ */ (0,
|
|
249
|
-
/* @__PURE__ */ (0,
|
|
258
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_paper2.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(OverlayBackdrop, { style: styles3.overlay, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(OverlayCard, { accessibilityViewIsModal: true, style: [styles3.card, { width: cardWidth, maxHeight }, rotationStyle], children: [
|
|
259
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native4.ScrollView, { ref: scrollRef, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onScroll: handleScroll, scrollEventThrottle: 16, onMomentumScrollEnd: handleMomentumEnd, style: [styles3.pager, { width: pageWidth }], children: steps.map((step, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native4.ScrollView, { nestedScrollEnabled: true, showsVerticalScrollIndicator: false, style: { width: pageWidth }, contentContainerStyle: styles3.page, children: [
|
|
260
|
+
step.art !== void 0 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native4.View, { style: [styles3.art, { height: artHeight, backgroundColor: artBackground }], children: step.art }),
|
|
261
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_paper2.Text, { variant: "headlineSmall", style: [styles3.title, { color: fg }], children: step.title }),
|
|
262
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native_paper2.Text, { variant: "bodyMedium", style: [styles3.body, { color: fg }], children: step.body })
|
|
250
263
|
] }, i)) }),
|
|
251
|
-
steps.length > 1 && /* @__PURE__ */ (0,
|
|
252
|
-
/* @__PURE__ */ (0,
|
|
253
|
-
!isOnly && /* @__PURE__ */ (0,
|
|
254
|
-
/* @__PURE__ */ (0,
|
|
264
|
+
steps.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native4.View, { accessible: true, accessibilityLabel: `Step ${index + 1} of ${steps.length}`, style: styles3.dots, children: steps.map((_, i) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_react_native4.View, { style: i === index ? [styles3.dot, { backgroundColor: colors.primary }] : [styles3.dot, styles3.dotInactive, { backgroundColor: fgMuted }] }, i)) }),
|
|
265
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_react_native4.View, { style: overlayActionStyles.actions, children: [
|
|
266
|
+
!isOnly && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_feedback_press.Button, { mode: "outlined", onPress: isFirst ? onSkip : () => goTo(index - 1), style: overlayActionStyles.actionButton, children: isFirst ? "Skip" : "Back" }),
|
|
267
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_feedback_press.Button, { mode: "contained", onPress: isLast ? onFinish : () => goTo(index + 1), style: isOnly ? overlayActionStyles.actionButtonSingle : overlayActionStyles.actionButton, buttonColor: colors.primary, textColor: colors.onPrimary, children: isLast ? "Ready" : "Next" })
|
|
255
268
|
] })
|
|
256
269
|
] }) }) });
|
|
257
270
|
}
|
|
258
271
|
function HowToPlayDialog({ visible, steps, ...rest }) {
|
|
259
272
|
if (!visible || steps.length === 0) return null;
|
|
260
|
-
return /* @__PURE__ */ (0,
|
|
273
|
+
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(HowToPlayCard, { steps, ...rest });
|
|
261
274
|
}
|
|
262
|
-
var
|
|
275
|
+
var styles3 = import_react_native4.StyleSheet.create({
|
|
263
276
|
art: {
|
|
264
277
|
alignItems: "center",
|
|
265
278
|
borderRadius: 12,
|
|
@@ -280,6 +293,9 @@ var styles2 = import_react_native3.StyleSheet.create({
|
|
|
280
293
|
height: 8,
|
|
281
294
|
width: 8
|
|
282
295
|
},
|
|
296
|
+
dotInactive: {
|
|
297
|
+
opacity: 0.5
|
|
298
|
+
},
|
|
283
299
|
dots: {
|
|
284
300
|
flexDirection: "row",
|
|
285
301
|
gap: 8
|
|
@@ -301,7 +317,7 @@ var styles2 = import_react_native3.StyleSheet.create({
|
|
|
301
317
|
});
|
|
302
318
|
|
|
303
319
|
// src/guide/GuideProvider.tsx
|
|
304
|
-
var
|
|
320
|
+
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
305
321
|
var noop = () => {
|
|
306
322
|
};
|
|
307
323
|
var GuideContext = (0, import_react2.createContext)({ isOpen: false, open: noop, close: noop, requestAutoShow: noop });
|
|
@@ -320,9 +336,9 @@ function GuideProvider({ steps, currentVersion, seenVersion, onSeen, rotation, c
|
|
|
320
336
|
setIsOpen(true);
|
|
321
337
|
}, [unseen]);
|
|
322
338
|
const value = (0, import_react2.useMemo)(() => ({ isOpen, open, close, requestAutoShow }), [isOpen, open, close, requestAutoShow]);
|
|
323
|
-
return /* @__PURE__ */ (0,
|
|
339
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(GuideContext.Provider, { value, children: [
|
|
324
340
|
children,
|
|
325
|
-
/* @__PURE__ */ (0,
|
|
341
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)(HowToPlayDialog, { visible: isOpen, steps, onFinish: close, onSkip: close, rotation })
|
|
326
342
|
] });
|
|
327
343
|
}
|
|
328
344
|
function useGuide() {
|
|
@@ -375,27 +391,27 @@ function createReturningPlayerMigrate(storage, legacyKeys) {
|
|
|
375
391
|
}
|
|
376
392
|
|
|
377
393
|
// src/guide/SeatDevicesHint.tsx
|
|
378
|
-
var
|
|
379
|
-
var
|
|
394
|
+
var import_auto_paper4 = require("@rific/auto-paper");
|
|
395
|
+
var import_react_native5 = require("react-native");
|
|
380
396
|
var import_react_native_paper3 = require("react-native-paper");
|
|
381
|
-
var
|
|
397
|
+
var import_jsx_runtime5 = require("react/jsx-runtime");
|
|
382
398
|
var ICON = {
|
|
383
399
|
keyboard: { source: "keyboard-outline", size: 56 },
|
|
384
400
|
mouse: { source: "mouse-outline", size: 44 }
|
|
385
401
|
};
|
|
386
402
|
var ORDER = ["keyboard", "mouse"];
|
|
387
403
|
function SeatDevicesHint({ devices, seatColors }) {
|
|
388
|
-
const { colors } = (0,
|
|
404
|
+
const { colors } = (0, import_auto_paper4.useAutoPaperTheme)();
|
|
389
405
|
const tints = seatColors ?? [colors.primary, colors.secondary];
|
|
390
406
|
const accessibilityLabel = devices.map((device, i) => `Player ${i + 1} uses the ${device}`).join(", ");
|
|
391
|
-
return /* @__PURE__ */ (0,
|
|
407
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native5.View, { accessible: true, accessibilityLabel, style: styles4.row, children: ORDER.map((device) => {
|
|
392
408
|
const seats = devices.flatMap((d, i) => d === device ? [i] : []);
|
|
393
409
|
if (seats.length === 0) return null;
|
|
394
410
|
const color = seats.length === 1 ? tints[seats[0]] ?? colors.onSurface : colors.onSurface;
|
|
395
|
-
return /* @__PURE__ */ (0,
|
|
411
|
+
return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_react_native_paper3.Icon, { source: ICON[device].source, size: ICON[device].size, color }, device);
|
|
396
412
|
}) });
|
|
397
413
|
}
|
|
398
|
-
var
|
|
414
|
+
var styles4 = import_react_native5.StyleSheet.create({
|
|
399
415
|
row: {
|
|
400
416
|
alignItems: "center",
|
|
401
417
|
flexDirection: "row",
|
|
@@ -404,28 +420,28 @@ var styles3 = import_react_native4.StyleSheet.create({
|
|
|
404
420
|
});
|
|
405
421
|
|
|
406
422
|
// src/guide/SeatDiagram.tsx
|
|
407
|
-
var
|
|
408
|
-
var
|
|
423
|
+
var import_auto_paper5 = require("@rific/auto-paper");
|
|
424
|
+
var import_react_native6 = require("react-native");
|
|
409
425
|
var import_react_native_paper4 = require("react-native-paper");
|
|
410
|
-
var
|
|
426
|
+
var import_jsx_runtime6 = require("react/jsx-runtime");
|
|
411
427
|
var DEVICE_WIDTH = 88;
|
|
412
428
|
var DEVICE_HEIGHT = 120;
|
|
413
429
|
function SeatDiagram({ topColor, bottomColor, topLabel = "P2", bottomLabel = "P1" }) {
|
|
414
|
-
const { colors } = (0,
|
|
430
|
+
const { colors } = (0, import_auto_paper5.useAutoPaperTheme)();
|
|
415
431
|
const top = topColor ?? colors.secondary;
|
|
416
432
|
const bottom = bottomColor ?? colors.primary;
|
|
417
|
-
return /* @__PURE__ */ (0,
|
|
418
|
-
/* @__PURE__ */ (0,
|
|
419
|
-
/* @__PURE__ */ (0,
|
|
420
|
-
/* @__PURE__ */ (0,
|
|
433
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native6.View, { accessible: true, accessibilityLabel: `${bottomLabel} plays the bottom half, ${topLabel} plays the top half`, style: [styles5.device, { borderColor: colors.onSurface }], children: [
|
|
434
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native6.View, { style: [styles5.half, { borderColor: top }], children: [
|
|
435
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native6.View, { style: [import_react_native6.StyleSheet.absoluteFill, styles5.tint, { backgroundColor: top }] }),
|
|
436
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native_paper4.Text, { variant: "titleMedium", style: [styles5.label, styles5.flipped, { color: top }], children: topLabel })
|
|
421
437
|
] }),
|
|
422
|
-
/* @__PURE__ */ (0,
|
|
423
|
-
/* @__PURE__ */ (0,
|
|
424
|
-
/* @__PURE__ */ (0,
|
|
438
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_native6.View, { style: [styles5.half, styles5.bottomHalf, { borderColor: bottom }], children: [
|
|
439
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native6.View, { style: [import_react_native6.StyleSheet.absoluteFill, styles5.tint, { backgroundColor: bottom }] }),
|
|
440
|
+
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_native_paper4.Text, { variant: "titleMedium", style: [styles5.label, { color: bottom }], children: bottomLabel })
|
|
425
441
|
] })
|
|
426
442
|
] });
|
|
427
443
|
}
|
|
428
|
-
var
|
|
444
|
+
var styles5 = import_react_native6.StyleSheet.create({
|
|
429
445
|
bottomHalf: {
|
|
430
446
|
borderTopWidth: 0
|
|
431
447
|
},
|
|
@@ -456,12 +472,12 @@ var styles4 = import_react_native5.StyleSheet.create({
|
|
|
456
472
|
});
|
|
457
473
|
|
|
458
474
|
// src/guide/SwipeHint.tsx
|
|
459
|
-
var
|
|
475
|
+
var import_auto_paper6 = require("@rific/auto-paper");
|
|
460
476
|
var import_react3 = require("react");
|
|
461
|
-
var
|
|
477
|
+
var import_react_native7 = require("react-native");
|
|
462
478
|
var import_react_native_paper5 = require("react-native-paper");
|
|
463
479
|
var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
|
|
464
|
-
var
|
|
480
|
+
var import_jsx_runtime7 = require("react/jsx-runtime");
|
|
465
481
|
var DOT_COUNT = 7;
|
|
466
482
|
var FINGER_SIZE = 28;
|
|
467
483
|
var MOUSE_SIZE = 30;
|
|
@@ -469,7 +485,7 @@ var SWEEP_MS = 900;
|
|
|
469
485
|
var PAUSE_MS = 500;
|
|
470
486
|
var ARROW_ICON = { up: "arrow-up", down: "arrow-down", left: "arrow-left", right: "arrow-right" };
|
|
471
487
|
function SwipeHint({ direction = "right", pointer = "finger", color, length = 96 }) {
|
|
472
|
-
const { colors } = (0,
|
|
488
|
+
const { colors } = (0, import_auto_paper6.useAutoPaperTheme)();
|
|
473
489
|
const tint = color ?? colors.primary;
|
|
474
490
|
const reducedMotion = (0, import_react_native_reanimated2.useReducedMotion)();
|
|
475
491
|
const progress = (0, import_react_native_reanimated2.useSharedValue)(0.5);
|
|
@@ -491,13 +507,13 @@ function SwipeHint({ direction = "right", pointer = "finger", color, length = 96
|
|
|
491
507
|
};
|
|
492
508
|
});
|
|
493
509
|
const axis = horizontal ? sign > 0 ? "row" : "row-reverse" : sign > 0 ? "column" : "column-reverse";
|
|
494
|
-
return /* @__PURE__ */ (0,
|
|
495
|
-
/* @__PURE__ */ (0,
|
|
496
|
-
/* @__PURE__ */ (0,
|
|
497
|
-
pointer === "mouse" ? /* @__PURE__ */ (0,
|
|
510
|
+
return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(import_react_native7.View, { accessibilityLabel: `${pointer === "mouse" ? "Drag" : "Swipe"} ${direction}`, accessible: true, style: [styles6.path, { flexDirection: axis }], children: [
|
|
511
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native7.View, { style: [styles6.dots, { flexDirection: axis, [horizontal ? "width" : "height"]: length }], children: Array.from({ length: DOT_COUNT }, (_, i) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native7.View, { style: [styles6.dot, { backgroundColor: tint, opacity: 0.35 + 0.65 * i / (DOT_COUNT - 1) }] }, i)) }),
|
|
512
|
+
/* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_paper5.Icon, { source: ARROW_ICON[direction], size: 28, color: tint }),
|
|
513
|
+
pointer === "mouse" ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_reanimated2.default.View, { style: [styles6.mouse, fingerStyle], children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_paper5.Icon, { source: "mouse", size: MOUSE_SIZE, color: tint }) }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_react_native_reanimated2.default.View, { style: [styles6.finger, { borderColor: tint }, fingerStyle] })
|
|
498
514
|
] });
|
|
499
515
|
}
|
|
500
|
-
var
|
|
516
|
+
var styles6 = import_react_native7.StyleSheet.create({
|
|
501
517
|
dot: {
|
|
502
518
|
borderRadius: 3,
|
|
503
519
|
height: 6,
|
package/dist/guide/index.mjs
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
OverlayBackdrop,
|
|
3
|
+
OverlayCard,
|
|
3
4
|
overlayActionStyles,
|
|
4
|
-
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
useOverlayCardColors
|
|
6
|
+
} from "../chunk-AX4GC5KU.mjs";
|
|
6
7
|
|
|
7
8
|
// src/guide/DirectionKeysHint.tsx
|
|
8
9
|
import { useAutoPaperTheme } from "@rific/auto-paper";
|
|
@@ -99,7 +100,7 @@ function HowToPlayCard({ steps, onFinish, onSkip, rotation = 0 }) {
|
|
|
99
100
|
});
|
|
100
101
|
return () => subscription.remove();
|
|
101
102
|
}, [onSkip]);
|
|
102
|
-
const { fg,
|
|
103
|
+
const { fg, fgMuted } = useOverlayCardColors();
|
|
103
104
|
const { width: cardWidth, pageWidth, maxHeight, artHeight } = getGuideCardSize(windowWidth, windowHeight, rotation);
|
|
104
105
|
const rotationStyle = rotation === 0 ? void 0 : { transform: [{ rotate: `${rotation}deg` }] };
|
|
105
106
|
const isFirst = index === 0;
|
|
@@ -128,13 +129,13 @@ function HowToPlayCard({ steps, onFinish, onSkip, rotation = 0 }) {
|
|
|
128
129
|
targetRef.current = null;
|
|
129
130
|
syncToOffset(e.nativeEvent.contentOffset.x);
|
|
130
131
|
}
|
|
131
|
-
return /* @__PURE__ */ jsx2(Portal, { children: /* @__PURE__ */ jsx2(
|
|
132
|
+
return /* @__PURE__ */ jsx2(Portal, { children: /* @__PURE__ */ jsx2(OverlayBackdrop, { style: styles2.overlay, children: /* @__PURE__ */ jsxs2(OverlayCard, { accessibilityViewIsModal: true, style: [styles2.card, { width: cardWidth, maxHeight }, rotationStyle], children: [
|
|
132
133
|
/* @__PURE__ */ jsx2(ScrollView, { ref: scrollRef, horizontal: true, pagingEnabled: true, showsHorizontalScrollIndicator: false, onScroll: handleScroll, scrollEventThrottle: 16, onMomentumScrollEnd: handleMomentumEnd, style: [styles2.pager, { width: pageWidth }], children: steps.map((step, i) => /* @__PURE__ */ jsxs2(ScrollView, { nestedScrollEnabled: true, showsVerticalScrollIndicator: false, style: { width: pageWidth }, contentContainerStyle: styles2.page, children: [
|
|
133
134
|
step.art !== void 0 && /* @__PURE__ */ jsx2(View2, { style: [styles2.art, { height: artHeight, backgroundColor: artBackground }], children: step.art }),
|
|
134
135
|
/* @__PURE__ */ jsx2(Text2, { variant: "headlineSmall", style: [styles2.title, { color: fg }], children: step.title }),
|
|
135
136
|
/* @__PURE__ */ jsx2(Text2, { variant: "bodyMedium", style: [styles2.body, { color: fg }], children: step.body })
|
|
136
137
|
] }, i)) }),
|
|
137
|
-
steps.length > 1 && /* @__PURE__ */ jsx2(View2, { accessible: true, accessibilityLabel: `Step ${index + 1} of ${steps.length}`, style: styles2.dots, children: steps.map((_, i) => /* @__PURE__ */ jsx2(View2, { style: [styles2.dot, { backgroundColor:
|
|
138
|
+
steps.length > 1 && /* @__PURE__ */ jsx2(View2, { accessible: true, accessibilityLabel: `Step ${index + 1} of ${steps.length}`, style: styles2.dots, children: steps.map((_, i) => /* @__PURE__ */ jsx2(View2, { style: i === index ? [styles2.dot, { backgroundColor: colors.primary }] : [styles2.dot, styles2.dotInactive, { backgroundColor: fgMuted }] }, i)) }),
|
|
138
139
|
/* @__PURE__ */ jsxs2(View2, { style: overlayActionStyles.actions, children: [
|
|
139
140
|
!isOnly && /* @__PURE__ */ jsx2(Button, { mode: "outlined", onPress: isFirst ? onSkip : () => goTo(index - 1), style: overlayActionStyles.actionButton, children: isFirst ? "Skip" : "Back" }),
|
|
140
141
|
/* @__PURE__ */ jsx2(Button, { mode: "contained", onPress: isLast ? onFinish : () => goTo(index + 1), style: isOnly ? overlayActionStyles.actionButtonSingle : overlayActionStyles.actionButton, buttonColor: colors.primary, textColor: colors.onPrimary, children: isLast ? "Ready" : "Next" })
|
|
@@ -166,6 +167,9 @@ var styles2 = StyleSheet2.create({
|
|
|
166
167
|
height: 8,
|
|
167
168
|
width: 8
|
|
168
169
|
},
|
|
170
|
+
dotInactive: {
|
|
171
|
+
opacity: 0.5
|
|
172
|
+
},
|
|
169
173
|
dots: {
|
|
170
174
|
flexDirection: "row",
|
|
171
175
|
gap: 8
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, LOCKED_BADGE_COLOR, MONO_FONT, OverlayCardColors, RotatedFrame, RotatedFrameProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, getOverlayCardColors, getStaggeredWordDuration, overlayActionStyles, overlayStyles } from './chrome/index.mjs';
|
|
1
|
+
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardColors, OverlayCardProps, OverlayCardThemeColors, RotatedFrame, RotatedFrameProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, getOverlayCardColors, getStaggeredWordDuration, overlayActionStyles, overlayStyles, useOverlayCardColors } from './chrome/index.mjs';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { RefObject, ReactNode } from 'react';
|
|
4
4
|
import { AchievementTier } from '@tastic/achievements';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, LOCKED_BADGE_COLOR, MONO_FONT, OverlayCardColors, RotatedFrame, RotatedFrameProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, getOverlayCardColors, getStaggeredWordDuration, overlayActionStyles, overlayStyles } from './chrome/index.js';
|
|
1
|
+
export { AchievementCatalogSection, AchievementRow, ActivityStatSection, BaseSettingsDialog, BaseSettingsDialogProps, BaseStatsScreen, ConfirmDialog, ConfirmDialogProps, ContentGutter, CornerActionButtons, LOCKED_BADGE_COLOR, MONO_FONT, OverlayBackdrop, OverlayBackdropProps, OverlayCard, OverlayCardColors, OverlayCardProps, OverlayCardThemeColors, RotatedFrame, RotatedFrameProps, StaggeredWord, StaggeredWordProps, StatRow, StatSection, UpdateDialog, UpdateDialogProps, getOverlayCardColors, getStaggeredWordDuration, overlayActionStyles, overlayStyles, useOverlayCardColors } from './chrome/index.js';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { RefObject, ReactNode } from 'react';
|
|
4
4
|
import { AchievementTier } from '@tastic/achievements';
|