@buoy-gg/shared-ui 7.0.32 → 7.0.34
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 +70 -28
- package/lib/commonjs/hooks/index.js +26 -0
- package/lib/commonjs/hooks/safe-area-impl.js +1 -1
- package/lib/commonjs/hooks/useChangeLog.js +55 -0
- package/lib/commonjs/hooks/useEventStoreEvents.js +65 -0
- package/lib/commonjs/hooks/usePersistedState.js +45 -10
- package/lib/commonjs/index.js +143 -0
- package/lib/commonjs/storage/definePersistedSetting.js +67 -0
- package/lib/commonjs/storage/devToolsStorageKeys.js +12 -0
- package/lib/commonjs/storage/index.js +8 -1
- package/lib/commonjs/stores/ChangeLog.js +197 -0
- package/lib/commonjs/stores/createToolStore.js +175 -0
- package/lib/commonjs/stores/index.js +15 -1
- package/lib/commonjs/sync/toolSyncAdapter.js +63 -0
- package/lib/commonjs/sync/wireForm.js +172 -0
- package/lib/commonjs/tools/defineTool.js +79 -0
- package/lib/commonjs/ui/components/ChangeRow.js +110 -0
- package/lib/commonjs/ui/components/ChipStrip.js +94 -0
- package/lib/commonjs/ui/components/DetailViewToggle.js +130 -0
- package/lib/commonjs/ui/components/DevToolsCard.js +3 -1
- package/lib/commonjs/ui/components/EmptyState.js +10 -2
- package/lib/commonjs/ui/components/EntityFilterView.js +354 -0
- package/lib/commonjs/ui/components/ExportPreview.js +174 -0
- package/lib/commonjs/ui/components/InfoRow.js +90 -0
- package/lib/commonjs/ui/components/ModalHeader.js +40 -7
- package/lib/commonjs/ui/components/Pill.js +114 -0
- package/lib/commonjs/ui/components/ToggleRow.js +116 -0
- package/lib/commonjs/ui/components/ToolEmptyState.js +154 -0
- package/lib/commonjs/ui/components/ToolFooter.js +204 -0
- package/lib/commonjs/ui/components/WindowControls.js +8 -5
- package/lib/commonjs/ui/components/index.js +113 -1
- package/lib/commonjs/ui/index.js +36 -2
- package/lib/commonjs/ui/listPresets.js +43 -0
- package/lib/commonjs/ui/night/primitives.js +3 -1
- package/lib/commonjs/ui/otto/OttoSprite.js +510 -0
- package/lib/commonjs/ui/otto/index.js +38 -0
- package/lib/commonjs/ui/otto/ottoEngine.js +2734 -0
- package/lib/commonjs/ui/otto/ottoSheet.js +191 -0
- package/lib/commonjs/utils/snapshotProviderKit.js +167 -0
- package/lib/commonjs/utils/stateTools.js +160 -0
- package/lib/module/JsModal.js +70 -28
- package/lib/module/hooks/index.js +3 -1
- package/lib/module/hooks/safe-area-impl.js +1 -1
- package/lib/module/hooks/useChangeLog.js +50 -0
- package/lib/module/hooks/useEventStoreEvents.js +61 -0
- package/lib/module/hooks/usePersistedState.js +44 -10
- package/lib/module/index.js +11 -1
- package/lib/module/storage/definePersistedSetting.js +63 -0
- package/lib/module/storage/devToolsStorageKeys.js +12 -0
- package/lib/module/storage/index.js +2 -1
- package/lib/module/stores/ChangeLog.js +192 -0
- package/lib/module/stores/createToolStore.js +171 -0
- package/lib/module/stores/index.js +3 -1
- package/lib/module/sync/toolSyncAdapter.js +58 -0
- package/lib/module/sync/wireForm.js +159 -0
- package/lib/module/tools/defineTool.js +74 -0
- package/lib/module/ui/components/ChangeRow.js +105 -0
- package/lib/module/ui/components/ChipStrip.js +91 -0
- package/lib/module/ui/components/DetailViewToggle.js +125 -0
- package/lib/module/ui/components/DevToolsCard.js +3 -1
- package/lib/module/ui/components/EmptyState.js +10 -2
- package/lib/module/ui/components/EntityFilterView.js +350 -0
- package/lib/module/ui/components/ExportPreview.js +169 -0
- package/lib/module/ui/components/InfoRow.js +86 -0
- package/lib/module/ui/components/ModalHeader.js +40 -7
- package/lib/module/ui/components/Pill.js +110 -0
- package/lib/module/ui/components/ToggleRow.js +112 -0
- package/lib/module/ui/components/ToolEmptyState.js +149 -0
- package/lib/module/ui/components/ToolFooter.js +196 -0
- package/lib/module/ui/components/WindowControls.js +8 -5
- package/lib/module/ui/components/index.js +13 -1
- package/lib/module/ui/index.js +7 -1
- package/lib/module/ui/listPresets.js +39 -0
- package/lib/module/ui/night/primitives.js +3 -1
- package/lib/module/ui/otto/OttoSprite.js +496 -0
- package/lib/module/ui/otto/index.js +20 -0
- package/lib/module/ui/otto/ottoEngine.js +2726 -0
- package/lib/module/ui/otto/ottoSheet.js +180 -0
- package/lib/module/utils/snapshotProviderKit.js +156 -0
- package/lib/module/utils/stateTools.js +154 -0
- package/lib/typescript/commonjs/JsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/index.d.ts +3 -1
- package/lib/typescript/commonjs/hooks/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/commonjs/hooks/useChangeLog.d.ts +38 -0
- package/lib/typescript/commonjs/hooks/useChangeLog.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/useEventStoreEvents.d.ts +25 -0
- package/lib/typescript/commonjs/hooks/useEventStoreEvents.d.ts.map +1 -0
- package/lib/typescript/commonjs/hooks/usePersistedState.d.ts +34 -5
- package/lib/typescript/commonjs/hooks/usePersistedState.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +6 -1
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/definePersistedSetting.d.ts +39 -0
- package/lib/typescript/commonjs/storage/definePersistedSetting.d.ts.map +1 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts +12 -0
- package/lib/typescript/commonjs/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/commonjs/storage/index.d.ts +1 -0
- package/lib/typescript/commonjs/storage/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/stores/ChangeLog.d.ts +100 -0
- package/lib/typescript/commonjs/stores/ChangeLog.d.ts.map +1 -0
- package/lib/typescript/commonjs/stores/createToolStore.d.ts +92 -0
- package/lib/typescript/commonjs/stores/createToolStore.d.ts.map +1 -0
- package/lib/typescript/commonjs/stores/index.d.ts +2 -0
- package/lib/typescript/commonjs/stores/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/sync/toolSyncAdapter.d.ts +66 -0
- package/lib/typescript/commonjs/sync/toolSyncAdapter.d.ts.map +1 -0
- package/lib/typescript/commonjs/sync/wireForm.d.ts +100 -0
- package/lib/typescript/commonjs/sync/wireForm.d.ts.map +1 -0
- package/lib/typescript/commonjs/tools/defineTool.d.ts +100 -0
- package/lib/typescript/commonjs/tools/defineTool.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ChangeRow.d.ts +52 -0
- package/lib/typescript/commonjs/ui/components/ChangeRow.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ChipStrip.d.ts +41 -0
- package/lib/typescript/commonjs/ui/components/ChipStrip.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/DetailViewToggle.d.ts +36 -0
- package/lib/typescript/commonjs/ui/components/DetailViewToggle.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/DevToolsCard.d.ts +8 -1
- package/lib/typescript/commonjs/ui/components/DevToolsCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EmptyState.d.ts +14 -1
- package/lib/typescript/commonjs/ui/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EntityFilterView.d.ts +51 -0
- package/lib/typescript/commonjs/ui/components/EntityFilterView.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ExportPreview.d.ts +48 -0
- package/lib/typescript/commonjs/ui/components/ExportPreview.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/InfoRow.d.ts +33 -0
- package/lib/typescript/commonjs/ui/components/InfoRow.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ModalHeader.d.ts +31 -1
- package/lib/typescript/commonjs/ui/components/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/Pill.d.ts +38 -0
- package/lib/typescript/commonjs/ui/components/Pill.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ToggleRow.d.ts +33 -0
- package/lib/typescript/commonjs/ui/components/ToggleRow.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ToolEmptyState.d.ts +113 -0
- package/lib/typescript/commonjs/ui/components/ToolEmptyState.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/ToolFooter.d.ts +69 -0
- package/lib/typescript/commonjs/ui/components/ToolFooter.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts +7 -1
- package/lib/typescript/commonjs/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/index.d.ts +11 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/index.d.ts +2 -0
- package/lib/typescript/commonjs/ui/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/listPresets.d.ts +28 -0
- package/lib/typescript/commonjs/ui/listPresets.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/night/primitives.d.ts +3 -1
- package/lib/typescript/commonjs/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/otto/OttoSprite.d.ts +103 -0
- package/lib/typescript/commonjs/ui/otto/OttoSprite.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts +19 -0
- package/lib/typescript/commonjs/ui/otto/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts +2205 -0
- package/lib/typescript/commonjs/ui/otto/ottoEngine.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/otto/ottoSheet.d.ts +73 -0
- package/lib/typescript/commonjs/ui/otto/ottoSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/snapshotProviderKit.d.ts +81 -0
- package/lib/typescript/commonjs/utils/snapshotProviderKit.d.ts.map +1 -0
- package/lib/typescript/commonjs/utils/stateTools.d.ts +44 -0
- package/lib/typescript/commonjs/utils/stateTools.d.ts.map +1 -0
- package/lib/typescript/module/JsModal.d.ts.map +1 -1
- package/lib/typescript/module/hooks/index.d.ts +3 -1
- package/lib/typescript/module/hooks/index.d.ts.map +1 -1
- package/lib/typescript/module/hooks/safe-area-impl.d.ts +1 -1
- package/lib/typescript/module/hooks/useChangeLog.d.ts +38 -0
- package/lib/typescript/module/hooks/useChangeLog.d.ts.map +1 -0
- package/lib/typescript/module/hooks/useEventStoreEvents.d.ts +25 -0
- package/lib/typescript/module/hooks/useEventStoreEvents.d.ts.map +1 -0
- package/lib/typescript/module/hooks/usePersistedState.d.ts +34 -5
- package/lib/typescript/module/hooks/usePersistedState.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +6 -1
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/storage/definePersistedSetting.d.ts +39 -0
- package/lib/typescript/module/storage/definePersistedSetting.d.ts.map +1 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts +12 -0
- package/lib/typescript/module/storage/devToolsStorageKeys.d.ts.map +1 -1
- package/lib/typescript/module/storage/index.d.ts +1 -0
- package/lib/typescript/module/storage/index.d.ts.map +1 -1
- package/lib/typescript/module/stores/ChangeLog.d.ts +100 -0
- package/lib/typescript/module/stores/ChangeLog.d.ts.map +1 -0
- package/lib/typescript/module/stores/createToolStore.d.ts +92 -0
- package/lib/typescript/module/stores/createToolStore.d.ts.map +1 -0
- package/lib/typescript/module/stores/index.d.ts +2 -0
- package/lib/typescript/module/stores/index.d.ts.map +1 -1
- package/lib/typescript/module/sync/toolSyncAdapter.d.ts +66 -0
- package/lib/typescript/module/sync/toolSyncAdapter.d.ts.map +1 -0
- package/lib/typescript/module/sync/wireForm.d.ts +100 -0
- package/lib/typescript/module/sync/wireForm.d.ts.map +1 -0
- package/lib/typescript/module/tools/defineTool.d.ts +100 -0
- package/lib/typescript/module/tools/defineTool.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ChangeRow.d.ts +52 -0
- package/lib/typescript/module/ui/components/ChangeRow.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ChipStrip.d.ts +41 -0
- package/lib/typescript/module/ui/components/ChipStrip.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/DetailViewToggle.d.ts +36 -0
- package/lib/typescript/module/ui/components/DetailViewToggle.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/DevToolsCard.d.ts +8 -1
- package/lib/typescript/module/ui/components/DevToolsCard.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EmptyState.d.ts +14 -1
- package/lib/typescript/module/ui/components/EmptyState.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EntityFilterView.d.ts +51 -0
- package/lib/typescript/module/ui/components/EntityFilterView.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ExportPreview.d.ts +48 -0
- package/lib/typescript/module/ui/components/ExportPreview.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/InfoRow.d.ts +33 -0
- package/lib/typescript/module/ui/components/InfoRow.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ModalHeader.d.ts +31 -1
- package/lib/typescript/module/ui/components/ModalHeader.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/Pill.d.ts +38 -0
- package/lib/typescript/module/ui/components/Pill.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ToggleRow.d.ts +33 -0
- package/lib/typescript/module/ui/components/ToggleRow.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ToolEmptyState.d.ts +113 -0
- package/lib/typescript/module/ui/components/ToolEmptyState.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/ToolFooter.d.ts +69 -0
- package/lib/typescript/module/ui/components/ToolFooter.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/WindowControls.d.ts +7 -1
- package/lib/typescript/module/ui/components/WindowControls.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/index.d.ts +11 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/index.d.ts +2 -0
- package/lib/typescript/module/ui/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/listPresets.d.ts +28 -0
- package/lib/typescript/module/ui/listPresets.d.ts.map +1 -0
- package/lib/typescript/module/ui/night/primitives.d.ts +3 -1
- package/lib/typescript/module/ui/night/primitives.d.ts.map +1 -1
- package/lib/typescript/module/ui/otto/OttoSprite.d.ts +103 -0
- package/lib/typescript/module/ui/otto/OttoSprite.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/index.d.ts +19 -0
- package/lib/typescript/module/ui/otto/index.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts +2205 -0
- package/lib/typescript/module/ui/otto/ottoEngine.d.ts.map +1 -0
- package/lib/typescript/module/ui/otto/ottoSheet.d.ts +73 -0
- package/lib/typescript/module/ui/otto/ottoSheet.d.ts.map +1 -0
- package/lib/typescript/module/utils/snapshotProviderKit.d.ts +81 -0
- package/lib/typescript/module/utils/snapshotProviderKit.d.ts.map +1 -0
- package/lib/typescript/module/utils/stateTools.d.ts +44 -0
- package/lib/typescript/module/utils/stateTools.d.ts.map +1 -0
- package/package.json +4 -4
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.Pill = Pill;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _nightTheme = require("../night/nightTheme.js");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
/**
|
|
11
|
+
* Pill — the small caption chip every tool draws next to a row: a verdict
|
|
12
|
+
* ("UNUSED", "OVERSIZE"), a kind ("event", "transaction"), a link ("↔ 2"),
|
|
13
|
+
* a source ("MMKV"). Sixteen packages defined 150+ local pill styles that
|
|
14
|
+
* fall into five looks; those are the `variant`s here. Text is always in
|
|
15
|
+
* the pill's color (or the muted ink for `quiet`), never the series color
|
|
16
|
+
* of anything else.
|
|
17
|
+
*
|
|
18
|
+
* - `tinted` — color fill at 15% + border at 40% (scenarios, react-query chips)
|
|
19
|
+
* - `soft` — color fill at 20%, rounded, no border (events correlation badge)
|
|
20
|
+
* - `outline` — color border only (sentry envelope types)
|
|
21
|
+
* - `quiet` — neutral 6% white fill, muted text, optional color dot (assets)
|
|
22
|
+
* - `text` — bare colored caption, no chrome (images row badges)
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
function Pill({
|
|
26
|
+
label,
|
|
27
|
+
color = _nightTheme.night.color.textSecondary,
|
|
28
|
+
variant = "tinted",
|
|
29
|
+
size = "xs",
|
|
30
|
+
mono = false,
|
|
31
|
+
uppercase,
|
|
32
|
+
dot = false,
|
|
33
|
+
icon,
|
|
34
|
+
testID,
|
|
35
|
+
style
|
|
36
|
+
}) {
|
|
37
|
+
const upper = uppercase ?? (variant === "tinted" || variant === "quiet" || variant === "text");
|
|
38
|
+
const textColor = variant === "quiet" ? _nightTheme.night.color.textSecondary : color;
|
|
39
|
+
const chrome = variant === "tinted" ? {
|
|
40
|
+
backgroundColor: `${color}15`,
|
|
41
|
+
borderColor: `${color}40`,
|
|
42
|
+
borderWidth: 1
|
|
43
|
+
} : variant === "soft" ? {
|
|
44
|
+
backgroundColor: `${color}20`
|
|
45
|
+
} : variant === "outline" ? {
|
|
46
|
+
borderColor: color,
|
|
47
|
+
borderWidth: 1
|
|
48
|
+
} : variant === "quiet" ? {
|
|
49
|
+
backgroundColor: "rgba(255,255,255,0.06)"
|
|
50
|
+
} : {};
|
|
51
|
+
if (variant === "text") {
|
|
52
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
53
|
+
style: [styles.text, size === "sm" && styles.textSm, mono && styles.mono, upper && styles.upper, {
|
|
54
|
+
color: textColor
|
|
55
|
+
}],
|
|
56
|
+
testID: testID,
|
|
57
|
+
children: label
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
61
|
+
style: [styles.pill, variant === "soft" && styles.pillSoft, size === "sm" && styles.pillSm, chrome, style],
|
|
62
|
+
children: [icon, dot && variant === "quiet" ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
63
|
+
style: [styles.dot, {
|
|
64
|
+
backgroundColor: color
|
|
65
|
+
}]
|
|
66
|
+
}) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
67
|
+
style: [styles.text, size === "sm" && styles.textSm, mono && styles.mono, upper && styles.upper, {
|
|
68
|
+
color: textColor
|
|
69
|
+
}],
|
|
70
|
+
testID: testID,
|
|
71
|
+
children: label
|
|
72
|
+
})]
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
const styles = _reactNative.StyleSheet.create({
|
|
76
|
+
pill: {
|
|
77
|
+
flexDirection: "row",
|
|
78
|
+
alignItems: "center",
|
|
79
|
+
alignSelf: "flex-start",
|
|
80
|
+
gap: 4,
|
|
81
|
+
paddingHorizontal: 6,
|
|
82
|
+
paddingVertical: 2,
|
|
83
|
+
borderRadius: 4
|
|
84
|
+
},
|
|
85
|
+
pillSoft: {
|
|
86
|
+
paddingHorizontal: 8,
|
|
87
|
+
borderRadius: 10
|
|
88
|
+
},
|
|
89
|
+
pillSm: {
|
|
90
|
+
paddingHorizontal: 8,
|
|
91
|
+
paddingVertical: 3
|
|
92
|
+
},
|
|
93
|
+
dot: {
|
|
94
|
+
width: 5,
|
|
95
|
+
height: 5,
|
|
96
|
+
borderRadius: 2.5
|
|
97
|
+
},
|
|
98
|
+
text: {
|
|
99
|
+
fontSize: 10,
|
|
100
|
+
fontWeight: "600",
|
|
101
|
+
letterSpacing: 0.3
|
|
102
|
+
},
|
|
103
|
+
textSm: {
|
|
104
|
+
fontSize: 11
|
|
105
|
+
},
|
|
106
|
+
mono: {
|
|
107
|
+
fontFamily: "monospace"
|
|
108
|
+
},
|
|
109
|
+
upper: {
|
|
110
|
+
textTransform: "uppercase",
|
|
111
|
+
letterSpacing: 0.5,
|
|
112
|
+
fontWeight: "700"
|
|
113
|
+
}
|
|
114
|
+
});
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ToggleRow = ToggleRow;
|
|
7
|
+
var _reactNative = require("react-native");
|
|
8
|
+
var _nightTheme = require("../night/nightTheme.js");
|
|
9
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
10
|
+
/**
|
|
11
|
+
* ToggleRow — a labeled switch row for a tool's settings surface.
|
|
12
|
+
*
|
|
13
|
+
* Every settings screen (impersonate, image-overlay, highlight-updates,
|
|
14
|
+
* perf-monitor, scenarios, storage, ask-buoy) drew its own `toggleRow` +
|
|
15
|
+
* `<Switch>` pair with the same night track colors. The native switch stays
|
|
16
|
+
* (a custom control would be a visible design change); the row chrome,
|
|
17
|
+
* the label/description stack and the accent/warning tone are shared.
|
|
18
|
+
*
|
|
19
|
+
* - `variant="card"` — an elevated bordered pill row (image-overlay)
|
|
20
|
+
* - `variant="plain"` — a bare list row for use inside a card (impersonate)
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
function ToggleRow({
|
|
24
|
+
label,
|
|
25
|
+
description,
|
|
26
|
+
value,
|
|
27
|
+
onValueChange,
|
|
28
|
+
disabled = false,
|
|
29
|
+
tone = "accent",
|
|
30
|
+
accessory,
|
|
31
|
+
variant = "card",
|
|
32
|
+
emphasizeLabel = false,
|
|
33
|
+
testID,
|
|
34
|
+
style
|
|
35
|
+
}) {
|
|
36
|
+
const onColor = tone === "warning" ? _nightTheme.night.color.warning : _nightTheme.night.color.accent;
|
|
37
|
+
const isCard = variant === "card";
|
|
38
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
39
|
+
style: [styles.row, isCard ? styles.rowCard : styles.rowPlain, style],
|
|
40
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
41
|
+
style: styles.info,
|
|
42
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
43
|
+
style: styles.header,
|
|
44
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
45
|
+
style: [isCard ? styles.labelCard : styles.labelPlain, emphasizeLabel && {
|
|
46
|
+
color: onColor
|
|
47
|
+
}],
|
|
48
|
+
numberOfLines: 2,
|
|
49
|
+
children: label
|
|
50
|
+
}), accessory]
|
|
51
|
+
}), description ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
52
|
+
style: styles.description,
|
|
53
|
+
children: description
|
|
54
|
+
}) : null]
|
|
55
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Switch, {
|
|
56
|
+
value: value,
|
|
57
|
+
onValueChange: onValueChange,
|
|
58
|
+
disabled: disabled,
|
|
59
|
+
testID: testID,
|
|
60
|
+
accessibilityLabel: label,
|
|
61
|
+
trackColor: isCard ? {
|
|
62
|
+
false: _nightTheme.night.color.surfaceElevated,
|
|
63
|
+
true: onColor
|
|
64
|
+
} : {
|
|
65
|
+
false: _nightTheme.night.color.border,
|
|
66
|
+
true: `${onColor}50`
|
|
67
|
+
},
|
|
68
|
+
thumbColor: isCard ? undefined : value ? onColor : _nightTheme.night.color.knob
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
const styles = _reactNative.StyleSheet.create({
|
|
73
|
+
row: {
|
|
74
|
+
flexDirection: "row",
|
|
75
|
+
alignItems: "center",
|
|
76
|
+
justifyContent: "space-between"
|
|
77
|
+
},
|
|
78
|
+
rowCard: {
|
|
79
|
+
backgroundColor: _nightTheme.night.color.surfaceElevated,
|
|
80
|
+
borderRadius: 8,
|
|
81
|
+
borderWidth: 1,
|
|
82
|
+
borderColor: _nightTheme.night.color.border,
|
|
83
|
+
paddingHorizontal: 12,
|
|
84
|
+
paddingVertical: 8
|
|
85
|
+
},
|
|
86
|
+
rowPlain: {
|
|
87
|
+
paddingVertical: 12,
|
|
88
|
+
paddingHorizontal: 12
|
|
89
|
+
},
|
|
90
|
+
info: {
|
|
91
|
+
flex: 1,
|
|
92
|
+
marginRight: 12
|
|
93
|
+
},
|
|
94
|
+
header: {
|
|
95
|
+
flexDirection: "row",
|
|
96
|
+
alignItems: "center",
|
|
97
|
+
gap: 8,
|
|
98
|
+
flexWrap: "wrap"
|
|
99
|
+
},
|
|
100
|
+
labelCard: {
|
|
101
|
+
fontSize: 13,
|
|
102
|
+
fontWeight: "500",
|
|
103
|
+
color: _nightTheme.night.color.textSecondary
|
|
104
|
+
},
|
|
105
|
+
labelPlain: {
|
|
106
|
+
fontSize: 14,
|
|
107
|
+
fontWeight: "500",
|
|
108
|
+
color: _nightTheme.night.color.text
|
|
109
|
+
},
|
|
110
|
+
description: {
|
|
111
|
+
fontSize: 12,
|
|
112
|
+
color: _nightTheme.night.color.textTertiary,
|
|
113
|
+
lineHeight: 16,
|
|
114
|
+
marginTop: 3
|
|
115
|
+
}
|
|
116
|
+
});
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ToolEmptyState = ToolEmptyState;
|
|
7
|
+
exports.resolveListEmptyState = resolveListEmptyState;
|
|
8
|
+
var _reactNative = require("react-native");
|
|
9
|
+
var _index = require("../otto/index.js");
|
|
10
|
+
var _nightTheme = require("../night/nightTheme.js");
|
|
11
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
12
|
+
/**
|
|
13
|
+
* The one "nothing here" panel, for every tool that shows a list.
|
|
14
|
+
*
|
|
15
|
+
* WHY THIS EXISTS
|
|
16
|
+
*
|
|
17
|
+
* Every capture tool — network, events, highlight-updates, storage, zustand,
|
|
18
|
+
* redux, jotai, console — renders the same panel with the same four causes and
|
|
19
|
+
* different nouns. Written out per tool, that produced four copies of the same
|
|
20
|
+
* layout (each of which had to be re-inset by hand the first time a sentence
|
|
21
|
+
* was longer than "No events yet"), and four independent guesses at the
|
|
22
|
+
* PRECEDENCE between those causes. The guesses disagreed, and the disagreements
|
|
23
|
+
* were bugs:
|
|
24
|
+
*
|
|
25
|
+
* - A search that matched nothing showed "Enable tracking to start
|
|
26
|
+
* capturing" — pointing at a toggle that was already on.
|
|
27
|
+
* - Turning every source chip off showed "Events will appear here as they
|
|
28
|
+
* occur" — inviting you to go generate events that were already in the
|
|
29
|
+
* store, behind your own filter.
|
|
30
|
+
* - Typing into a search box while the store was empty produced no
|
|
31
|
+
* acknowledgement of the query at all, which reads as a dead search box.
|
|
32
|
+
*
|
|
33
|
+
* So the precedence lives here, once, and each tool supplies only what is
|
|
34
|
+
* genuinely its own: the noun, and what "switched on but waiting" looks like
|
|
35
|
+
* for it (network fishes, events listens, the highlighter stares).
|
|
36
|
+
*
|
|
37
|
+
* SPLIT IN TWO ON PURPOSE
|
|
38
|
+
*
|
|
39
|
+
* `resolveListEmptyState` is a pure function returning `{ otto, title,
|
|
40
|
+
* message }`, and `ToolEmptyState` renders that object. Tools with a cause
|
|
41
|
+
* nobody else has — storage's "no issues found" (which is a PASS, not a
|
|
42
|
+
* failure), zustand's unregistered store — resolve the common cases and
|
|
43
|
+
* substitute their own, or skip the resolver and hand the shell a literal.
|
|
44
|
+
* Adding a mascot to every tool at once is then one edit in this file, which is
|
|
45
|
+
* also what makes the Flutter and Swift ports one component to mirror instead
|
|
46
|
+
* of eight.
|
|
47
|
+
*/
|
|
48
|
+
|
|
49
|
+
/** What a "nothing here" panel says. */
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* The panel itself: Otto, a heading, a sentence. Nothing else — this only ever
|
|
53
|
+
* renders where the alternative is a blank body, so it has no actions and no
|
|
54
|
+
* decoration to compete with the list it stands in for.
|
|
55
|
+
*/
|
|
56
|
+
function ToolEmptyState({
|
|
57
|
+
otto,
|
|
58
|
+
title,
|
|
59
|
+
message,
|
|
60
|
+
testID,
|
|
61
|
+
style
|
|
62
|
+
}) {
|
|
63
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
|
|
64
|
+
style: [styles.container, style],
|
|
65
|
+
testID: testID,
|
|
66
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_index.Otto, {
|
|
67
|
+
state: otto,
|
|
68
|
+
pixelSize: 2
|
|
69
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
70
|
+
style: styles.title,
|
|
71
|
+
testID: testID ? `${testID}-title` : undefined,
|
|
72
|
+
numberOfLines: 2,
|
|
73
|
+
children: title
|
|
74
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
75
|
+
style: styles.message,
|
|
76
|
+
testID: testID ? `${testID}-text` : undefined,
|
|
77
|
+
children: message
|
|
78
|
+
})]
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Which "nothing here" this is, in the order the facts answer the question.
|
|
83
|
+
*
|
|
84
|
+
* A typed query first (see `search`), then the user's filters, then the
|
|
85
|
+
* capture switch, then the honest "nothing yet".
|
|
86
|
+
*/
|
|
87
|
+
function resolveListEmptyState(facts) {
|
|
88
|
+
const {
|
|
89
|
+
subject,
|
|
90
|
+
verb = "captured",
|
|
91
|
+
search,
|
|
92
|
+
total = 0,
|
|
93
|
+
capturing,
|
|
94
|
+
waiting,
|
|
95
|
+
paused,
|
|
96
|
+
blocked
|
|
97
|
+
} = facts;
|
|
98
|
+
const term = (search ?? "").trim();
|
|
99
|
+
if (term) {
|
|
100
|
+
return {
|
|
101
|
+
otto: "sad",
|
|
102
|
+
// The query goes in the HEADING because checking what you typed is the
|
|
103
|
+
// first thing you do; the body names whichever blocker is in the way.
|
|
104
|
+
title: `No results for “${term}”`,
|
|
105
|
+
message: blocked ?? (total > 0 ? `None of the ${total} ${verb} ${subject} match. Clear the search to see them.` : capturing === false ? `Nothing is ${verb} to search — capture is off. Turn it on to start.` : `Nothing has been ${verb} yet, so there is nothing to match.`)
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
if (blocked) {
|
|
109
|
+
return {
|
|
110
|
+
otto: "filtering",
|
|
111
|
+
title: "Filtered Out",
|
|
112
|
+
message: blocked
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
if (total > 0) {
|
|
116
|
+
return {
|
|
117
|
+
otto: "filtering",
|
|
118
|
+
title: "Filtered Out",
|
|
119
|
+
message: `${total} ${verb} ${subject} ${total === 1 ? "is" : "are"} hidden by the active filters.`
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
if (capturing === false) {
|
|
123
|
+
return {
|
|
124
|
+
otto: paused?.otto ?? "paused",
|
|
125
|
+
title: paused?.title ?? "Not capturing",
|
|
126
|
+
message: paused?.message ?? "Capture is off. Turn it on to start."
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
return waiting;
|
|
130
|
+
}
|
|
131
|
+
const styles = _reactNative.StyleSheet.create({
|
|
132
|
+
container: {
|
|
133
|
+
alignItems: "center",
|
|
134
|
+
paddingVertical: 40,
|
|
135
|
+
// The generated sentences are full sentences. Every tool that hand-rolled
|
|
136
|
+
// this panel shipped without an inset and had it run to both edges of the
|
|
137
|
+
// sheet the first time the copy grew past a few words.
|
|
138
|
+
paddingHorizontal: 24
|
|
139
|
+
},
|
|
140
|
+
title: {
|
|
141
|
+
color: _nightTheme.night.color.text,
|
|
142
|
+
fontSize: 14,
|
|
143
|
+
fontWeight: "600",
|
|
144
|
+
marginTop: 12,
|
|
145
|
+
marginBottom: 6,
|
|
146
|
+
textAlign: "center"
|
|
147
|
+
},
|
|
148
|
+
message: {
|
|
149
|
+
color: _nightTheme.night.color.textTertiary,
|
|
150
|
+
fontSize: 12,
|
|
151
|
+
textAlign: "center",
|
|
152
|
+
lineHeight: 17
|
|
153
|
+
}
|
|
154
|
+
});
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.FooterButton = FooterButton;
|
|
7
|
+
exports.FooterCaption = FooterCaption;
|
|
8
|
+
exports.FooterMessage = FooterMessage;
|
|
9
|
+
exports.FooterRow = FooterRow;
|
|
10
|
+
exports.ToolFooter = ToolFooter;
|
|
11
|
+
var _reactNative = require("react-native");
|
|
12
|
+
var _nightTheme = require("../night/nightTheme.js");
|
|
13
|
+
var _useSafeAreaInsets = require("../../hooks/useSafeAreaInsets.js");
|
|
14
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
+
/**
|
|
16
|
+
* ToolFooter — the night glass bar pinned to the bottom of a tool: dark
|
|
17
|
+
* backing over the star field, a hairline on top, safe-area padding when
|
|
18
|
+
* docked as a sheet, rounded corners when floating.
|
|
19
|
+
*
|
|
20
|
+
* `EventStepperFooter` draws this bar for the Previous/Next case; the
|
|
21
|
+
* images and react-query tools each re-drew it for their action bars with
|
|
22
|
+
* a comment saying "matches EventStepperFooter". This is that bar as a
|
|
23
|
+
* container, plus `FooterButton` — the mono uppercase plate button those
|
|
24
|
+
* action bars are made of — and the caption/message lines above the row.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
function ToolFooter({
|
|
28
|
+
children,
|
|
29
|
+
safeArea = true,
|
|
30
|
+
paddingBottom = 12,
|
|
31
|
+
floating = false,
|
|
32
|
+
absolute = false,
|
|
33
|
+
gap = 8,
|
|
34
|
+
style,
|
|
35
|
+
testID
|
|
36
|
+
}) {
|
|
37
|
+
const insets = (0, _useSafeAreaInsets.useSafeAreaInsets)();
|
|
38
|
+
const bottom = typeof safeArea === "number" ? safeArea + insets.bottom : safeArea ? paddingBottom + insets.bottom : paddingBottom;
|
|
39
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
40
|
+
style: [styles.footer, floating && styles.footerFloating, absolute && styles.footerAbsolute, {
|
|
41
|
+
paddingBottom: bottom,
|
|
42
|
+
gap
|
|
43
|
+
}, style],
|
|
44
|
+
testID: testID,
|
|
45
|
+
children: children
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** A row of footer buttons. */
|
|
50
|
+
function FooterRow({
|
|
51
|
+
children,
|
|
52
|
+
style
|
|
53
|
+
}) {
|
|
54
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
|
|
55
|
+
style: [styles.row, style],
|
|
56
|
+
children: children
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/** Tracking caption above a row ("MASS ACTIONS — every image on screen"). */
|
|
61
|
+
function FooterCaption({
|
|
62
|
+
children,
|
|
63
|
+
style
|
|
64
|
+
}) {
|
|
65
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
66
|
+
style: [styles.caption, style],
|
|
67
|
+
numberOfLines: 1,
|
|
68
|
+
children: children
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/** Mono feedback line ("Restored 3 images"). */
|
|
73
|
+
function FooterMessage({
|
|
74
|
+
children,
|
|
75
|
+
tone = "info",
|
|
76
|
+
style
|
|
77
|
+
}) {
|
|
78
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
79
|
+
style: [styles.message, tone === "muted" && styles.messageMuted, style],
|
|
80
|
+
numberOfLines: 1,
|
|
81
|
+
children: children
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function FooterButton({
|
|
85
|
+
label,
|
|
86
|
+
onPress,
|
|
87
|
+
accent = false,
|
|
88
|
+
active = false,
|
|
89
|
+
disabled = false,
|
|
90
|
+
icon,
|
|
91
|
+
flex = true,
|
|
92
|
+
size = "sm",
|
|
93
|
+
testID,
|
|
94
|
+
accessibilityLabel,
|
|
95
|
+
style
|
|
96
|
+
}) {
|
|
97
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.TouchableOpacity, {
|
|
98
|
+
onPress: onPress,
|
|
99
|
+
disabled: disabled,
|
|
100
|
+
activeOpacity: 0.7,
|
|
101
|
+
accessibilityRole: "button",
|
|
102
|
+
accessibilityLabel: accessibilityLabel ?? label,
|
|
103
|
+
accessibilityState: {
|
|
104
|
+
disabled,
|
|
105
|
+
selected: active
|
|
106
|
+
},
|
|
107
|
+
testID: testID,
|
|
108
|
+
style: [styles.button, flex ? styles.buttonFlex : styles.buttonFixed, size === "md" && styles.buttonMd, active && styles.buttonActive, disabled && styles.disabled, style],
|
|
109
|
+
children: [icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
|
|
110
|
+
style: [styles.buttonText, size === "md" && styles.buttonTextMd, accent && !disabled && styles.buttonTextAccent, active && styles.buttonTextActive, disabled && styles.buttonTextDisabled],
|
|
111
|
+
children: label
|
|
112
|
+
})]
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
const styles = _reactNative.StyleSheet.create({
|
|
116
|
+
footer: {
|
|
117
|
+
paddingHorizontal: 12,
|
|
118
|
+
paddingTop: 10,
|
|
119
|
+
// Dark glass over the star field — the same bar EventStepperFooter draws.
|
|
120
|
+
backgroundColor: "rgba(5, 5, 5, 0.92)",
|
|
121
|
+
borderTopWidth: 1,
|
|
122
|
+
borderTopColor: _nightTheme.night.color.border
|
|
123
|
+
},
|
|
124
|
+
footerFloating: {
|
|
125
|
+
borderBottomLeftRadius: 14,
|
|
126
|
+
borderBottomRightRadius: 14
|
|
127
|
+
},
|
|
128
|
+
footerAbsolute: {
|
|
129
|
+
position: "absolute",
|
|
130
|
+
left: 0,
|
|
131
|
+
right: 0,
|
|
132
|
+
bottom: 0
|
|
133
|
+
},
|
|
134
|
+
row: {
|
|
135
|
+
flexDirection: "row",
|
|
136
|
+
alignItems: "center",
|
|
137
|
+
gap: 6
|
|
138
|
+
},
|
|
139
|
+
caption: {
|
|
140
|
+
color: _nightTheme.night.color.textTertiary,
|
|
141
|
+
fontSize: 9,
|
|
142
|
+
fontWeight: "700",
|
|
143
|
+
letterSpacing: 0.8
|
|
144
|
+
},
|
|
145
|
+
message: {
|
|
146
|
+
color: _nightTheme.night.color.info,
|
|
147
|
+
fontSize: 10,
|
|
148
|
+
fontFamily: "monospace"
|
|
149
|
+
},
|
|
150
|
+
messageMuted: {
|
|
151
|
+
color: _nightTheme.night.color.textTertiary,
|
|
152
|
+
fontFamily: undefined
|
|
153
|
+
},
|
|
154
|
+
button: {
|
|
155
|
+
flexDirection: "row",
|
|
156
|
+
alignItems: "center",
|
|
157
|
+
justifyContent: "center",
|
|
158
|
+
gap: 6,
|
|
159
|
+
paddingVertical: 8,
|
|
160
|
+
// No horizontal padding: six of these share one row on a phone, and the
|
|
161
|
+
// mono uppercase label needs every point it can get before it wraps.
|
|
162
|
+
paddingHorizontal: 0,
|
|
163
|
+
borderRadius: 6,
|
|
164
|
+
backgroundColor: _nightTheme.night.color.button,
|
|
165
|
+
borderWidth: _reactNative.StyleSheet.hairlineWidth,
|
|
166
|
+
borderColor: _nightTheme.night.color.border
|
|
167
|
+
},
|
|
168
|
+
buttonFlex: {
|
|
169
|
+
flex: 1
|
|
170
|
+
},
|
|
171
|
+
buttonFixed: {
|
|
172
|
+
paddingHorizontal: 10
|
|
173
|
+
},
|
|
174
|
+
buttonMd: {
|
|
175
|
+
paddingVertical: 8
|
|
176
|
+
},
|
|
177
|
+
buttonActive: {
|
|
178
|
+
backgroundColor: _nightTheme.night.color.accentSoft,
|
|
179
|
+
borderColor: _nightTheme.night.color.accentBorderStrong
|
|
180
|
+
},
|
|
181
|
+
buttonText: {
|
|
182
|
+
fontSize: 10,
|
|
183
|
+
fontWeight: "600",
|
|
184
|
+
color: _nightTheme.night.color.textSecondary,
|
|
185
|
+
fontFamily: "monospace",
|
|
186
|
+
textTransform: "uppercase"
|
|
187
|
+
},
|
|
188
|
+
buttonTextMd: {
|
|
189
|
+
fontSize: 11,
|
|
190
|
+
color: _nightTheme.night.color.text
|
|
191
|
+
},
|
|
192
|
+
buttonTextAccent: {
|
|
193
|
+
color: _nightTheme.night.color.warning
|
|
194
|
+
},
|
|
195
|
+
buttonTextActive: {
|
|
196
|
+
color: _nightTheme.night.color.accent
|
|
197
|
+
},
|
|
198
|
+
buttonTextDisabled: {
|
|
199
|
+
color: _nightTheme.night.color.textTertiary
|
|
200
|
+
},
|
|
201
|
+
disabled: {
|
|
202
|
+
opacity: 0.4
|
|
203
|
+
}
|
|
204
|
+
});
|
|
@@ -74,7 +74,8 @@ function WindowControls({
|
|
|
74
74
|
onMinimize,
|
|
75
75
|
onToggleMode,
|
|
76
76
|
mode,
|
|
77
|
-
variant = "night"
|
|
77
|
+
variant = "night",
|
|
78
|
+
defaultExpanded
|
|
78
79
|
}) {
|
|
79
80
|
// Show action-based icon: what will happen when clicked
|
|
80
81
|
const ToggleModeIcon = mode === "floating" ? _index.DockBottom : _index.FloatWindow;
|
|
@@ -129,7 +130,8 @@ function WindowControls({
|
|
|
129
130
|
onMinimize: onMinimize,
|
|
130
131
|
onToggleMode: onToggleMode,
|
|
131
132
|
mode: mode,
|
|
132
|
-
variant: variant
|
|
133
|
+
variant: variant,
|
|
134
|
+
defaultExpanded: defaultExpanded
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
137
|
function ExpandableWindowControls({
|
|
@@ -137,11 +139,12 @@ function ExpandableWindowControls({
|
|
|
137
139
|
onMinimize,
|
|
138
140
|
onToggleMode,
|
|
139
141
|
mode,
|
|
140
|
-
variant = "night"
|
|
142
|
+
variant = "night",
|
|
143
|
+
defaultExpanded = false
|
|
141
144
|
}) {
|
|
142
145
|
const isNight = variant === "night";
|
|
143
|
-
const [expanded, setExpanded] = (0, _react.useState)(
|
|
144
|
-
const expandAnim = (0, _react.useRef)(new _reactNative.Animated.Value(0)).current;
|
|
146
|
+
const [expanded, setExpanded] = (0, _react.useState)(defaultExpanded);
|
|
147
|
+
const expandAnim = (0, _react.useRef)(new _reactNative.Animated.Value(defaultExpanded ? 1 : 0)).current;
|
|
145
148
|
const dismissTimeout = (0, _react.useRef)(null);
|
|
146
149
|
const ToggleModeIcon = mode === "floating" ? _index.DockBottom : _index.FloatWindow;
|
|
147
150
|
const toggleModeLabel = mode === "floating" ? "Dock to bottom sheet" : "Make floating window";
|