@buoy-gg/shared-ui 7.0.25 → 7.0.27
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/lib/commonjs/JsModal.js +156 -20
- package/lib/commonjs/JsModal.web.js +85 -39
- package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +14 -4
- package/lib/commonjs/dataViewer/diffThemes.js +20 -18
- package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +8 -8
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/icons/lucide-icons.js +74 -15
- package/lib/commonjs/index.js +86 -0
- package/lib/commonjs/ui/backgrounds/BackgroundSwitcher.js +248 -74
- package/lib/commonjs/ui/backgrounds/README.md +102 -20
- package/lib/commonjs/ui/backgrounds/backgroundStore.js +20 -6
- package/lib/commonjs/ui/backgrounds/index.js +91 -1
- package/lib/commonjs/ui/backgrounds/primitives.js +50 -14
- package/lib/commonjs/ui/backgrounds/registry.js +41 -64
- package/lib/commonjs/ui/backgrounds/rng.js +21 -0
- package/lib/commonjs/ui/backgrounds/skyClock.js +45 -0
- package/lib/commonjs/ui/backgrounds/variants/daylight.js +453 -0
- package/lib/commonjs/ui/backgrounds/variants/deepField.js +60 -30
- package/lib/commonjs/ui/backgrounds/variants/hyperspace.js +218 -0
- package/lib/commonjs/ui/backgrounds/variants/liveSky.js +898 -0
- package/lib/commonjs/ui/backgrounds/variants/meteors.js +257 -0
- package/lib/commonjs/ui/backgrounds/variants/moonlight.js +472 -0
- package/lib/commonjs/ui/backgrounds/variants/underwater.js +757 -0
- package/lib/commonjs/ui/components/Badge.js +11 -10
- package/lib/commonjs/ui/components/CompactRow.js +30 -17
- package/lib/commonjs/ui/components/DevToolsCard.js +12 -8
- package/lib/commonjs/ui/components/DynamicFilterView.js +43 -41
- package/lib/commonjs/ui/components/EventStepperFooter.js +38 -10
- package/lib/commonjs/ui/components/FilterComponents.js +11 -11
- package/lib/commonjs/ui/components/ModalHeader.js +13 -13
- package/lib/commonjs/ui/components/SectionHeader.js +3 -1
- package/lib/commonjs/ui/components/StorageTypeBadge.js +3 -2
- package/lib/commonjs/ui/components/TabSelector.js +56 -38
- package/lib/commonjs/ui/components/ValueTypeBadge.js +7 -6
- package/lib/commonjs/ui/components/WindowControls.js +37 -10
- package/lib/commonjs/ui/gameUI/constants/gameUIColors.js +8 -0
- package/lib/commonjs/ui/night/nightTheme.js +120 -0
- package/lib/commonjs/ui/night/primitives.js +498 -0
- package/lib/module/JsModal.js +156 -20
- package/lib/module/JsModal.web.js +83 -39
- package/lib/module/dataViewer/VirtualizedDataExplorer.js +14 -4
- package/lib/module/dataViewer/diffThemes.js +20 -18
- package/lib/module/dataViewer/tree/TreeDiffViewer.js +9 -9
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/icons/lucide-icons.js +74 -15
- package/lib/module/index.js +4 -0
- package/lib/module/ui/backgrounds/BackgroundSwitcher.js +250 -76
- package/lib/module/ui/backgrounds/README.md +102 -20
- package/lib/module/ui/backgrounds/backgroundStore.js +19 -5
- package/lib/module/ui/backgrounds/index.js +11 -2
- package/lib/module/ui/backgrounds/primitives.js +53 -16
- package/lib/module/ui/backgrounds/registry.js +41 -64
- package/lib/module/ui/backgrounds/rng.js +20 -0
- package/lib/module/ui/backgrounds/skyClock.js +39 -0
- package/lib/module/ui/backgrounds/variants/daylight.js +449 -0
- package/lib/module/ui/backgrounds/variants/deepField.js +62 -31
- package/lib/module/ui/backgrounds/variants/hyperspace.js +214 -0
- package/lib/module/ui/backgrounds/variants/liveSky.js +893 -0
- package/lib/module/ui/backgrounds/variants/meteors.js +253 -0
- package/lib/module/ui/backgrounds/variants/moonlight.js +468 -0
- package/lib/module/ui/backgrounds/variants/underwater.js +753 -0
- package/lib/module/ui/components/Badge.js +11 -10
- package/lib/module/ui/components/CompactRow.js +30 -17
- package/lib/module/ui/components/DevToolsCard.js +12 -8
- package/lib/module/ui/components/DynamicFilterView.js +43 -41
- package/lib/module/ui/components/EventStepperFooter.js +38 -10
- package/lib/module/ui/components/FilterComponents.js +11 -11
- package/lib/module/ui/components/ModalHeader.js +13 -13
- package/lib/module/ui/components/SectionHeader.js +3 -1
- package/lib/module/ui/components/StorageTypeBadge.js +3 -2
- package/lib/module/ui/components/TabSelector.js +57 -39
- package/lib/module/ui/components/ValueTypeBadge.js +7 -6
- package/lib/module/ui/components/WindowControls.js +37 -10
- package/lib/module/ui/gameUI/constants/gameUIColors.js +8 -0
- package/lib/module/ui/night/nightTheme.js +116 -0
- package/lib/module/ui/night/primitives.js +485 -0
- package/lib/typescript/commonjs/JsModal.d.ts +18 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/JsModal.web.d.ts +13 -0
- package/lib/typescript/commonjs/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/diffThemes.d.ts +3 -1
- package/lib/typescript/commonjs/dataViewer/diffThemes.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/icons/lucide-icons.d.ts +12 -1
- package/lib/typescript/commonjs/icons/lucide-icons.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +3 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts +26 -6
- package/lib/typescript/commonjs/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts +3 -0
- package/lib/typescript/commonjs/ui/backgrounds/backgroundStore.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts +7 -1
- package/lib/typescript/commonjs/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts +18 -3
- package/lib/typescript/commonjs/ui/backgrounds/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts +8 -0
- package/lib/typescript/commonjs/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts +6 -0
- package/lib/typescript/commonjs/ui/backgrounds/rng.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/skyClock.d.ts +17 -0
- package/lib/typescript/commonjs/ui/backgrounds/skyClock.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/daylight.d.ts +30 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/daylight.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts +19 -4
- package/lib/typescript/commonjs/ui/backgrounds/variants/deepField.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/hyperspace.d.ts +39 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/hyperspace.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/liveSky.d.ts +41 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/liveSky.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/meteors.d.ts +26 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/meteors.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/moonlight.d.ts +35 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/moonlight.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/underwater.d.ts +51 -0
- package/lib/typescript/commonjs/ui/backgrounds/variants/underwater.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/Badge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DynamicFilterView.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts +2 -0
- package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/StorageTypeBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/TabSelector.d.ts +9 -0
- package/lib/typescript/commonjs/ui/components/TabSelector.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ValueTypeBadge.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts +4 -2
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts +8 -0
- package/lib/typescript/commonjs/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts +113 -0
- package/lib/typescript/commonjs/ui/night/nightTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/night/primitives.d.ts +111 -0
- package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -0
- package/lib/typescript/module/JsModal.d.ts +18 -0
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/JsModal.web.d.ts +13 -0
- package/lib/typescript/module/JsModal.web.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/diffThemes.d.ts +3 -1
- package/lib/typescript/module/dataViewer/diffThemes.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/icons/lucide-icons.d.ts +12 -1
- package/lib/typescript/module/icons/lucide-icons.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +3 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts +26 -6
- package/lib/typescript/module/ui/backgrounds/BackgroundSwitcher.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts +3 -0
- package/lib/typescript/module/ui/backgrounds/backgroundStore.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts +7 -1
- package/lib/typescript/module/ui/backgrounds/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts +18 -3
- package/lib/typescript/module/ui/backgrounds/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/registry.d.ts +8 -0
- package/lib/typescript/module/ui/backgrounds/registry.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/rng.d.ts +6 -0
- package/lib/typescript/module/ui/backgrounds/rng.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/skyClock.d.ts +17 -0
- package/lib/typescript/module/ui/backgrounds/skyClock.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/types.d.ts +1 -1
- package/lib/typescript/module/ui/backgrounds/types.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/variants/daylight.d.ts +30 -0
- package/lib/typescript/module/ui/backgrounds/variants/daylight.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts +19 -4
- package/lib/typescript/module/ui/backgrounds/variants/deepField.d.ts.map +1 -1
- package/lib/typescript/module/ui/backgrounds/variants/hyperspace.d.ts +39 -0
- package/lib/typescript/module/ui/backgrounds/variants/hyperspace.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/liveSky.d.ts +41 -0
- package/lib/typescript/module/ui/backgrounds/variants/liveSky.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/meteors.d.ts +26 -0
- package/lib/typescript/module/ui/backgrounds/variants/meteors.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/moonlight.d.ts +35 -0
- package/lib/typescript/module/ui/backgrounds/variants/moonlight.d.ts.map +1 -0
- package/lib/typescript/module/ui/backgrounds/variants/underwater.d.ts +51 -0
- package/lib/typescript/module/ui/backgrounds/variants/underwater.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/Badge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DynamicFilterView.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventStepperFooter.d.ts +2 -0
- package/lib/typescript/module/ui/components/EventStepperFooter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/StorageTypeBadge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/TabSelector.d.ts +9 -0
- package/lib/typescript/module/ui/components/TabSelector.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ValueTypeBadge.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/WindowControls.d.ts +4 -2
- package/lib/typescript/module/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts +8 -0
- package/lib/typescript/module/ui/gameUI/constants/gameUIColors.d.ts.map +1 -1
- package/lib/typescript/module/ui/night/nightTheme.d.ts +113 -0
- package/lib/typescript/module/ui/night/nightTheme.d.ts.map +1 -0
- package/lib/typescript/module/ui/night/primitives.d.ts +111 -0
- package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -0
- package/package.json +4 -4
- package/lib/commonjs/ui/backgrounds/variants/lattice.js +0 -579
- package/lib/commonjs/ui/backgrounds/variants/starfield.js +0 -210
- package/lib/module/ui/backgrounds/variants/lattice.js +0 -575
- package/lib/module/ui/backgrounds/variants/starfield.js +0 -206
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts +0 -33
- package/lib/typescript/commonjs/ui/backgrounds/variants/lattice.d.ts.map +0 -1
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts +0 -12
- package/lib/typescript/commonjs/ui/backgrounds/variants/starfield.d.ts.map +0 -1
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts +0 -33
- package/lib/typescript/module/ui/backgrounds/variants/lattice.d.ts.map +0 -1
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts +0 -12
- package/lib/typescript/module/ui/backgrounds/variants/starfield.d.ts.map +0 -1
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
|
|
18
18
|
import React, { useMemo, useState, useEffect, useRef } from "react";
|
|
19
19
|
import { View, Text, ScrollView, StyleSheet, TouchableOpacity } from "react-native";
|
|
20
|
-
import { gameUIColors } from "@buoy-gg/shared-ui";
|
|
20
|
+
import { gameUIColors, night } from "@buoy-gg/shared-ui";
|
|
21
21
|
import { isAbsent } from "../lineDiff.js";
|
|
22
22
|
|
|
23
23
|
// ============================================
|
|
@@ -29,10 +29,10 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
|
|
|
29
29
|
// ============================================
|
|
30
30
|
|
|
31
31
|
const darkTheme = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
text:
|
|
35
|
-
//
|
|
32
|
+
// Night chrome; the diff DATA colors below stay on the shared diff palette.
|
|
33
|
+
background: night.color.bg,
|
|
34
|
+
text: night.color.textSecondary,
|
|
35
|
+
// "unchanged" stays dimmed vs the diff tints
|
|
36
36
|
// Line backgrounds - exact from gameUIColors
|
|
37
37
|
addedBg: gameUIColors.diff.addedBackground,
|
|
38
38
|
removedBg: gameUIColors.diff.removedBackground,
|
|
@@ -47,12 +47,12 @@ const darkTheme = {
|
|
|
47
47
|
// UI elements
|
|
48
48
|
arrowText: gameUIColors.diff.modifiedText,
|
|
49
49
|
keyText: gameUIColors.diff.modifiedText,
|
|
50
|
-
expandIcon:
|
|
51
|
-
bracketText:
|
|
50
|
+
expandIcon: night.color.textTertiary,
|
|
51
|
+
bracketText: night.color.textSecondary,
|
|
52
52
|
nullText: gameUIColors.diff.modifiedText,
|
|
53
53
|
undefinedText: gameUIColors.diff.modifiedText,
|
|
54
|
-
stringText:
|
|
55
|
-
numberText:
|
|
54
|
+
stringText: night.color.textSecondary,
|
|
55
|
+
numberText: night.color.textSecondary,
|
|
56
56
|
booleanText: gameUIColors.diff.modifiedText
|
|
57
57
|
};
|
|
58
58
|
const lightTheme = {
|
|
@@ -505,30 +505,89 @@ export const Eye = ({
|
|
|
505
505
|
strokeWidth: strokeWidth
|
|
506
506
|
})]
|
|
507
507
|
});
|
|
508
|
+
|
|
509
|
+
/**
|
|
510
|
+
* Pushpin at 45°: needle → flange bar → flare → one long rounded handle.
|
|
511
|
+
* The handle is a border-only View rotated about its center; everything else
|
|
512
|
+
* is straight Line segments, so no curve stamping on native.
|
|
513
|
+
*
|
|
514
|
+
* `active` stands the pin upright (needle down — "stuck in"); default is the
|
|
515
|
+
* tilted resting pose. The upright pose scales 0.92 so the needle tip and
|
|
516
|
+
* head corners stay inside the 24-box.
|
|
517
|
+
*/
|
|
508
518
|
export const Pin = ({
|
|
509
519
|
size = 24,
|
|
510
520
|
color = "currentColor",
|
|
511
521
|
strokeWidth = 2,
|
|
522
|
+
active = false,
|
|
512
523
|
...props
|
|
513
|
-
}) => /*#__PURE__*/
|
|
524
|
+
}) => /*#__PURE__*/_jsx(Svg, {
|
|
514
525
|
width: size,
|
|
515
526
|
height: size,
|
|
516
527
|
viewBox: "0 0 24 24",
|
|
517
528
|
...props,
|
|
518
|
-
children:
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
529
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
530
|
+
style: {
|
|
531
|
+
position: "absolute",
|
|
532
|
+
width: 24,
|
|
533
|
+
height: 24,
|
|
534
|
+
// Keep the array shape stable across toggles: RN's style differ turns
|
|
535
|
+
// an explicit `transform: undefined` into null and processTransform
|
|
536
|
+
// crashes on it (`null.forEach`) when unpinning.
|
|
537
|
+
transform: active ? [{
|
|
538
|
+
rotate: "-45deg"
|
|
539
|
+
}, {
|
|
540
|
+
scale: 0.92
|
|
541
|
+
}] : [{
|
|
542
|
+
rotate: "0deg"
|
|
543
|
+
}, {
|
|
544
|
+
scale: 1
|
|
545
|
+
}]
|
|
546
|
+
},
|
|
547
|
+
children: [/*#__PURE__*/_jsx(Line, {
|
|
548
|
+
x1: 2.97,
|
|
549
|
+
y1: 21.03,
|
|
550
|
+
x2: 8.18,
|
|
551
|
+
y2: 15.82,
|
|
552
|
+
stroke: color,
|
|
553
|
+
strokeWidth: strokeWidth
|
|
554
|
+
}), /*#__PURE__*/_jsx(Line, {
|
|
555
|
+
x1: 4.4,
|
|
556
|
+
y1: 10.81,
|
|
557
|
+
x2: 13.19,
|
|
558
|
+
y2: 19.6,
|
|
559
|
+
stroke: color,
|
|
560
|
+
strokeWidth: strokeWidth
|
|
561
|
+
}), /*#__PURE__*/_jsx(Line, {
|
|
562
|
+
x1: 5.17,
|
|
563
|
+
y1: 10.54,
|
|
564
|
+
x2: 11.43,
|
|
565
|
+
y2: 8.83,
|
|
566
|
+
stroke: color,
|
|
567
|
+
strokeWidth: strokeWidth
|
|
568
|
+
}), /*#__PURE__*/_jsx(Line, {
|
|
569
|
+
x1: 13.46,
|
|
570
|
+
y1: 18.83,
|
|
571
|
+
x2: 15.17,
|
|
572
|
+
y2: 12.57,
|
|
573
|
+
stroke: color,
|
|
574
|
+
strokeWidth: strokeWidth
|
|
575
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
576
|
+
style: {
|
|
577
|
+
position: "absolute",
|
|
578
|
+
left: 11.15,
|
|
579
|
+
top: 4.4,
|
|
580
|
+
width: 11.38,
|
|
581
|
+
height: 5.52,
|
|
582
|
+
borderWidth: strokeWidth,
|
|
583
|
+
borderColor: color,
|
|
584
|
+
borderRadius: 2.07,
|
|
585
|
+
transform: [{
|
|
586
|
+
rotate: "-45deg"
|
|
587
|
+
}]
|
|
588
|
+
}
|
|
589
|
+
})]
|
|
590
|
+
})
|
|
532
591
|
});
|
|
533
592
|
|
|
534
593
|
/**
|
package/lib/module/index.js
CHANGED
|
@@ -61,6 +61,10 @@ export { useSafeAreaInsets, useFilterManager, usePersistedState, useDeviceInfo,
|
|
|
61
61
|
|
|
62
62
|
// JsModal
|
|
63
63
|
export { JsModal } from "./JsModal";
|
|
64
|
+
// Night theme — the Everlights-style surface language (piloted on the dial
|
|
65
|
+
// menu's settings modal; see ui/night/nightTheme.ts).
|
|
66
|
+
export { night, NIGHT_LABEL_TRACKING } from "./ui/night/nightTheme.js";
|
|
67
|
+
export { NightSectionLabel, NightFootnote, NightCard, NightSeparator, NightRows, NightSwitch, NightChip, NightButton, NightSegmented, NightBadge } from "./ui/night/primitives.js";
|
|
64
68
|
// game ui colors
|
|
65
69
|
export { gameUIColors, buoyColors } from "./ui/gameUI/constants/gameUIColors.js";
|
|
66
70
|
// Runtime re-tint hook — only the desktop dashboard's theme switcher uses it.
|
|
@@ -1,92 +1,210 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The ‹ prev / next › strip for
|
|
4
|
+
* The ‹ prev / next › strip for choosing a background.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
6
|
+
* Shipping mount: the dial menu's settings modal (pass `embedded` there so the
|
|
7
|
+
* host card supplies the chrome). It can also be dropped at the top of a
|
|
8
|
+
* tool's body while auditioning new presets — the cost of each preset shows
|
|
9
|
+
* next to its name, so it doubles as the review tool it started as.
|
|
10
10
|
*
|
|
11
11
|
* It writes to the shared `backgroundStore`, so stepping here changes the
|
|
12
12
|
* background in every tool at once.
|
|
13
|
+
*
|
|
14
|
+
* While Live Sky is showing, a second row appears: a WALL-clock slider that
|
|
15
|
+
* scrubs the scene through the whole cycle (Live Sky applies its workday
|
|
16
|
+
* remap to whatever wall time the scrub holds, same as it does to the live
|
|
17
|
+
* clock). LIVE snaps back to the real clock. The scrub is quantized to
|
|
18
|
+
* 5-minute steps so a drag re-renders the scene at most once per step, and it
|
|
19
|
+
* is not persisted — it's a preview gesture.
|
|
20
|
+
*
|
|
21
|
+
* ▶ runs the cycle like a movie: one full 24h lap in 15s, starting from the
|
|
22
|
+
* displayed time and finishing exactly where it began (back on LIVE if that's
|
|
23
|
+
* where it was). It drives the SAME scrub value on a JS interval — ~19 5-min
|
|
24
|
+
* steps a second, each one small re-render of the scene — which is fine for a
|
|
25
|
+
* 15s preview gesture and is exactly what a fast drag already does.
|
|
13
26
|
*/
|
|
14
27
|
|
|
15
|
-
import { memo } from "react";
|
|
16
|
-
import { StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
28
|
+
import { memo, useEffect, useRef, useState } from "react";
|
|
29
|
+
import { PanResponder, StyleSheet, Text, TouchableOpacity, View } from "react-native";
|
|
17
30
|
import { ChevronLeft, ChevronRight, Palette } from "../../icons/lucide-icons.js";
|
|
18
31
|
import { macOSColors } from "../gameUI/constants/macOSDesignSystemColors.js";
|
|
19
32
|
import { useToolBackground } from "./backgroundStore.js";
|
|
20
33
|
import { getPreset } from "./registry.js";
|
|
34
|
+
import { getSkyScrub, setSkyScrub, useSkyScrub } from "./skyClock.js";
|
|
21
35
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
-
|
|
36
|
+
const THUMB = 14;
|
|
37
|
+
function formatMinutes(m) {
|
|
38
|
+
const h = Math.floor(m / 60) % 24;
|
|
39
|
+
const min = m % 60;
|
|
40
|
+
return `${String(h).padStart(2, "0")}:${String(min).padStart(2, "0")}`;
|
|
41
|
+
}
|
|
42
|
+
const PLAY_DURATION_MS = 15000;
|
|
43
|
+
const PLAY_FRAME_MS = 50;
|
|
44
|
+
const TimeSlider = /*#__PURE__*/memo(function TimeSlider() {
|
|
45
|
+
const scrub = useSkyScrub();
|
|
46
|
+
const [trackW, setTrackW] = useState(0);
|
|
47
|
+
const widthRef = useRef(0);
|
|
48
|
+
const [playing, setPlaying] = useState(false);
|
|
49
|
+
const playTimer = useRef(null);
|
|
50
|
+
const stopPlay = () => {
|
|
51
|
+
if (playTimer.current) clearInterval(playTimer.current);
|
|
52
|
+
playTimer.current = null;
|
|
53
|
+
setPlaying(false);
|
|
54
|
+
};
|
|
55
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
56
|
+
useEffect(() => stopPlay, []);
|
|
57
|
+
const startPlay = () => {
|
|
58
|
+
stopPlay();
|
|
59
|
+
const now = new Date();
|
|
60
|
+
const startMinutes = getSkyScrub() ?? now.getHours() * 60 + now.getMinutes();
|
|
61
|
+
const wasLive = getSkyScrub() === null;
|
|
62
|
+
const begin = Date.now();
|
|
63
|
+
setPlaying(true);
|
|
64
|
+
playTimer.current = setInterval(() => {
|
|
65
|
+
const t = (Date.now() - begin) / PLAY_DURATION_MS;
|
|
66
|
+
if (t >= 1) {
|
|
67
|
+
stopPlay();
|
|
68
|
+
// Finish exactly where the day began.
|
|
69
|
+
setSkyScrub(wasLive ? null : startMinutes);
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
setSkyScrub(Math.floor((startMinutes + t * 1440) % 1440 / 5) * 5);
|
|
73
|
+
}, PLAY_FRAME_MS);
|
|
74
|
+
};
|
|
75
|
+
const applyX = x => {
|
|
76
|
+
stopPlay();
|
|
77
|
+
const w = widthRef.current;
|
|
78
|
+
if (w <= 0) return;
|
|
79
|
+
const frac = Math.min(1, Math.max(0, x / w));
|
|
80
|
+
setSkyScrub(Math.round(frac * 1439 / 5) * 5);
|
|
81
|
+
};
|
|
82
|
+
const responder = useRef(PanResponder.create({
|
|
83
|
+
onStartShouldSetPanResponder: () => true,
|
|
84
|
+
onMoveShouldSetPanResponder: () => true,
|
|
85
|
+
onPanResponderGrant: e => applyX(e.nativeEvent.locationX),
|
|
86
|
+
onPanResponderMove: e => applyX(e.nativeEvent.locationX)
|
|
87
|
+
})).current;
|
|
88
|
+
const now = new Date();
|
|
89
|
+
// Wall time throughout — the scene applies its own remap to this.
|
|
90
|
+
const minutes = scrub ?? now.getHours() * 60 + now.getMinutes();
|
|
91
|
+
const frac = minutes / 1440;
|
|
92
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
93
|
+
style: styles.sliderRow,
|
|
94
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
95
|
+
onPress: () => {
|
|
96
|
+
stopPlay();
|
|
97
|
+
setSkyScrub(null);
|
|
98
|
+
},
|
|
99
|
+
style: [styles.live, scrub === null ? styles.liveOn : null],
|
|
100
|
+
hitSlop: HIT_SLOP,
|
|
101
|
+
accessibilityLabel: "Follow the real clock",
|
|
102
|
+
"sentry-label": "ignore background sky live",
|
|
103
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
104
|
+
style: [styles.liveText, scrub === null ? styles.liveTextOn : null],
|
|
105
|
+
children: "LIVE"
|
|
106
|
+
})
|
|
107
|
+
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
108
|
+
onPress: playing ? stopPlay : startPlay,
|
|
109
|
+
style: [styles.live, playing ? styles.playOn : null],
|
|
110
|
+
hitSlop: HIT_SLOP,
|
|
111
|
+
accessibilityLabel: playing ? "Stop the day cycle" : "Play the full day in 15 seconds",
|
|
112
|
+
"sentry-label": "ignore background sky play",
|
|
113
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
114
|
+
style: [styles.liveText, playing ? styles.playTextOn : null],
|
|
115
|
+
children: playing ? "■" : "▶"
|
|
116
|
+
})
|
|
117
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
118
|
+
style: styles.track,
|
|
119
|
+
onLayout: e => {
|
|
120
|
+
widthRef.current = e.nativeEvent.layout.width;
|
|
121
|
+
setTrackW(e.nativeEvent.layout.width);
|
|
122
|
+
},
|
|
123
|
+
...responder.panHandlers,
|
|
124
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
125
|
+
style: styles.trackBar,
|
|
126
|
+
pointerEvents: "none"
|
|
127
|
+
}), trackW > 0 ? /*#__PURE__*/_jsx(View, {
|
|
128
|
+
pointerEvents: "none",
|
|
129
|
+
style: [styles.thumb, scrub === null ? null : styles.thumbScrub, {
|
|
130
|
+
left: frac * trackW - THUMB / 2
|
|
131
|
+
}]
|
|
132
|
+
}) : null]
|
|
133
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
134
|
+
style: styles.time,
|
|
135
|
+
children: formatMinutes(minutes)
|
|
136
|
+
})]
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
export const BackgroundSwitcher = /*#__PURE__*/memo(function BackgroundSwitcher({
|
|
140
|
+
embedded = false
|
|
141
|
+
}) {
|
|
23
142
|
const {
|
|
24
143
|
id,
|
|
25
144
|
index,
|
|
26
145
|
count,
|
|
27
|
-
motion,
|
|
28
146
|
next,
|
|
29
147
|
previous,
|
|
30
|
-
|
|
148
|
+
setId
|
|
31
149
|
} = useToolBackground();
|
|
32
150
|
const preset = getPreset(id);
|
|
151
|
+
const counterpart = preset.counterpart;
|
|
33
152
|
return /*#__PURE__*/_jsxs(View, {
|
|
34
|
-
style: styles.root,
|
|
35
|
-
children: [/*#__PURE__*/
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
style: styles.
|
|
49
|
-
children: [/*#__PURE__*/
|
|
50
|
-
|
|
51
|
-
|
|
153
|
+
style: embedded ? styles.rootEmbedded : styles.root,
|
|
154
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
155
|
+
style: styles.row,
|
|
156
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
157
|
+
onPress: previous,
|
|
158
|
+
style: styles.step,
|
|
159
|
+
hitSlop: HIT_SLOP,
|
|
160
|
+
accessibilityLabel: "Previous background",
|
|
161
|
+
"sentry-label": "ignore background previous",
|
|
162
|
+
children: /*#__PURE__*/_jsx(ChevronLeft, {
|
|
163
|
+
size: 16,
|
|
164
|
+
color: macOSColors.text.secondary
|
|
165
|
+
})
|
|
166
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
167
|
+
style: styles.center,
|
|
168
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
169
|
+
style: styles.titleRow,
|
|
170
|
+
children: [/*#__PURE__*/_jsx(Palette, {
|
|
171
|
+
size: 11,
|
|
172
|
+
color: macOSColors.semantic.info
|
|
173
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
174
|
+
style: styles.title,
|
|
175
|
+
numberOfLines: 1,
|
|
176
|
+
children: preset.label
|
|
177
|
+
}), /*#__PURE__*/_jsxs(Text, {
|
|
178
|
+
style: styles.counter,
|
|
179
|
+
children: [index + 1, "/", count]
|
|
180
|
+
})]
|
|
52
181
|
}), /*#__PURE__*/_jsx(Text, {
|
|
53
|
-
style: styles.
|
|
182
|
+
style: styles.blurb,
|
|
54
183
|
numberOfLines: 1,
|
|
55
|
-
children: preset.
|
|
56
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
57
|
-
style: styles.counter,
|
|
58
|
-
children: [index + 1, "/", count]
|
|
184
|
+
children: preset.blurb
|
|
59
185
|
})]
|
|
60
|
-
}), /*#__PURE__*/_jsx(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
186
|
+
}), counterpart ? /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
187
|
+
onPress: () => setId(counterpart.id),
|
|
188
|
+
style: styles.motion,
|
|
189
|
+
hitSlop: HIT_SLOP,
|
|
190
|
+
accessibilityLabel: `Switch to ${counterpart.id} background`,
|
|
191
|
+
"sentry-label": "ignore background counterpart",
|
|
192
|
+
children: /*#__PURE__*/_jsx(Text, {
|
|
193
|
+
style: styles.motionText,
|
|
194
|
+
children: counterpart.label
|
|
195
|
+
})
|
|
196
|
+
}) : null, /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
197
|
+
onPress: next,
|
|
198
|
+
style: styles.step,
|
|
199
|
+
hitSlop: HIT_SLOP,
|
|
200
|
+
accessibilityLabel: "Next background",
|
|
201
|
+
"sentry-label": "ignore background next",
|
|
202
|
+
children: /*#__PURE__*/_jsx(ChevronRight, {
|
|
203
|
+
size: 16,
|
|
204
|
+
color: macOSColors.text.secondary
|
|
205
|
+
})
|
|
68
206
|
})]
|
|
69
|
-
}), /*#__PURE__*/_jsx(
|
|
70
|
-
onPress: () => setMotion(!motion),
|
|
71
|
-
style: [styles.motion, motion ? styles.motionOn : null],
|
|
72
|
-
hitSlop: HIT_SLOP,
|
|
73
|
-
accessibilityLabel: motion ? "Turn motion off" : "Turn motion on",
|
|
74
|
-
"sentry-label": "ignore background motion",
|
|
75
|
-
children: /*#__PURE__*/_jsx(Text, {
|
|
76
|
-
style: [styles.motionText, motion ? styles.motionTextOn : null],
|
|
77
|
-
children: motion ? "MOTION" : "STATIC"
|
|
78
|
-
})
|
|
79
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
80
|
-
onPress: next,
|
|
81
|
-
style: styles.step,
|
|
82
|
-
hitSlop: HIT_SLOP,
|
|
83
|
-
accessibilityLabel: "Next background",
|
|
84
|
-
"sentry-label": "ignore background next",
|
|
85
|
-
children: /*#__PURE__*/_jsx(ChevronRight, {
|
|
86
|
-
size: 16,
|
|
87
|
-
color: macOSColors.text.secondary
|
|
88
|
-
})
|
|
89
|
-
})]
|
|
207
|
+
}), id === "livesky" ? /*#__PURE__*/_jsx(TimeSlider, {}) : null]
|
|
90
208
|
});
|
|
91
209
|
});
|
|
92
210
|
const HIT_SLOP = {
|
|
@@ -97,9 +215,6 @@ const HIT_SLOP = {
|
|
|
97
215
|
};
|
|
98
216
|
const styles = StyleSheet.create({
|
|
99
217
|
root: {
|
|
100
|
-
flexDirection: "row",
|
|
101
|
-
alignItems: "center",
|
|
102
|
-
gap: 8,
|
|
103
218
|
paddingHorizontal: 8,
|
|
104
219
|
paddingVertical: 6,
|
|
105
220
|
marginHorizontal: 8,
|
|
@@ -112,6 +227,14 @@ const styles = StyleSheet.create({
|
|
|
112
227
|
// previewing, so you can see the field through it.
|
|
113
228
|
backgroundColor: "rgba(26,26,28,0.72)"
|
|
114
229
|
},
|
|
230
|
+
rootEmbedded: {
|
|
231
|
+
// The host card supplies border/fill/margins.
|
|
232
|
+
},
|
|
233
|
+
row: {
|
|
234
|
+
flexDirection: "row",
|
|
235
|
+
alignItems: "center",
|
|
236
|
+
gap: 8
|
|
237
|
+
},
|
|
115
238
|
step: {
|
|
116
239
|
width: 28,
|
|
117
240
|
height: 28,
|
|
@@ -146,12 +269,6 @@ const styles = StyleSheet.create({
|
|
|
146
269
|
fontSize: 10,
|
|
147
270
|
marginTop: 1
|
|
148
271
|
},
|
|
149
|
-
cost: {
|
|
150
|
-
color: macOSColors.text.icon,
|
|
151
|
-
fontSize: 9,
|
|
152
|
-
marginTop: 1,
|
|
153
|
-
fontVariant: ["tabular-nums"]
|
|
154
|
-
},
|
|
155
272
|
motion: {
|
|
156
273
|
paddingHorizontal: 7,
|
|
157
274
|
paddingVertical: 4,
|
|
@@ -160,17 +277,74 @@ const styles = StyleSheet.create({
|
|
|
160
277
|
borderColor: macOSColors.border.default,
|
|
161
278
|
backgroundColor: "rgba(38,38,42,0.8)"
|
|
162
279
|
},
|
|
163
|
-
motionOn: {
|
|
164
|
-
borderColor: macOSColors.semantic.info + "55",
|
|
165
|
-
backgroundColor: macOSColors.semantic.infoBackground
|
|
166
|
-
},
|
|
167
280
|
motionText: {
|
|
168
281
|
fontSize: 9,
|
|
169
282
|
fontWeight: "700",
|
|
170
283
|
letterSpacing: 0.6,
|
|
171
284
|
color: macOSColors.text.muted
|
|
172
285
|
},
|
|
173
|
-
|
|
286
|
+
sliderRow: {
|
|
287
|
+
flexDirection: "row",
|
|
288
|
+
alignItems: "center",
|
|
289
|
+
gap: 8,
|
|
290
|
+
marginTop: 7
|
|
291
|
+
},
|
|
292
|
+
live: {
|
|
293
|
+
paddingHorizontal: 7,
|
|
294
|
+
paddingVertical: 3,
|
|
295
|
+
borderRadius: 6,
|
|
296
|
+
borderWidth: 1,
|
|
297
|
+
borderColor: macOSColors.border.default,
|
|
298
|
+
backgroundColor: "rgba(38,38,42,0.8)"
|
|
299
|
+
},
|
|
300
|
+
liveOn: {
|
|
301
|
+
borderColor: macOSColors.semantic.success + "55",
|
|
302
|
+
backgroundColor: macOSColors.semantic.successBackground
|
|
303
|
+
},
|
|
304
|
+
liveText: {
|
|
305
|
+
fontSize: 9,
|
|
306
|
+
fontWeight: "700",
|
|
307
|
+
letterSpacing: 0.6,
|
|
308
|
+
color: macOSColors.text.muted
|
|
309
|
+
},
|
|
310
|
+
liveTextOn: {
|
|
311
|
+
color: macOSColors.semantic.success
|
|
312
|
+
},
|
|
313
|
+
playOn: {
|
|
314
|
+
borderColor: macOSColors.semantic.info + "55",
|
|
315
|
+
backgroundColor: macOSColors.semantic.infoBackground
|
|
316
|
+
},
|
|
317
|
+
playTextOn: {
|
|
174
318
|
color: macOSColors.semantic.info
|
|
319
|
+
},
|
|
320
|
+
track: {
|
|
321
|
+
flex: 1,
|
|
322
|
+
height: 24,
|
|
323
|
+
justifyContent: "center"
|
|
324
|
+
},
|
|
325
|
+
trackBar: {
|
|
326
|
+
height: 3,
|
|
327
|
+
borderRadius: 1.5,
|
|
328
|
+
backgroundColor: "rgba(120,130,150,0.35)"
|
|
329
|
+
},
|
|
330
|
+
thumb: {
|
|
331
|
+
position: "absolute",
|
|
332
|
+
top: (24 - THUMB) / 2,
|
|
333
|
+
width: THUMB,
|
|
334
|
+
height: THUMB,
|
|
335
|
+
borderRadius: THUMB / 2,
|
|
336
|
+
backgroundColor: macOSColors.text.secondary,
|
|
337
|
+
borderWidth: 1,
|
|
338
|
+
borderColor: "rgba(255,255,255,0.5)"
|
|
339
|
+
},
|
|
340
|
+
thumbScrub: {
|
|
341
|
+
backgroundColor: macOSColors.semantic.info
|
|
342
|
+
},
|
|
343
|
+
time: {
|
|
344
|
+
color: macOSColors.text.secondary,
|
|
345
|
+
fontSize: 10,
|
|
346
|
+
fontVariant: ["tabular-nums"],
|
|
347
|
+
width: 32,
|
|
348
|
+
textAlign: "right"
|
|
175
349
|
}
|
|
176
350
|
});
|