@buoy-gg/shared-ui 7.0.33 → 7.0.35
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 +57 -22
- package/lib/commonjs/dataViewer/CyberpunkInput.js +3 -2
- package/lib/commonjs/dataViewer/DataTreeActionBar.js +3 -2
- package/lib/commonjs/dataViewer/DataTreeActionDock.js +2 -1
- package/lib/commonjs/dataViewer/DiffSummary.js +4 -3
- package/lib/commonjs/dataViewer/LiveExplorer.js +11 -10
- package/lib/commonjs/dataViewer/SplitDiffViewer.js +10 -9
- package/lib/commonjs/dataViewer/ThemedSplitView.js +12 -11
- package/lib/commonjs/dataViewer/ValueEditModal.js +6 -5
- package/lib/commonjs/dataViewer/VirtualizedDataExplorer.js +4 -3
- package/lib/commonjs/dataViewer/tree/TreeDiffViewer.js +15 -14
- 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/icons/index.js +533 -1
- package/lib/commonjs/index.js +143 -0
- package/lib/commonjs/license/FreeAccountPrompt.js +2 -1
- package/lib/commonjs/license/LicenseEntryModal.js +2 -1
- package/lib/commonjs/storage/definePersistedSetting.js +67 -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 +111 -0
- package/lib/commonjs/ui/components/ChipStrip.js +94 -0
- package/lib/commonjs/ui/components/ClipboardHintBanner.js +2 -1
- package/lib/commonjs/ui/components/CompactRow.js +3 -2
- package/lib/commonjs/ui/components/DataInspector.js +3 -2
- package/lib/commonjs/ui/components/DetailView.js +2 -1
- package/lib/commonjs/ui/components/DetailViewToggle.js +130 -0
- package/lib/commonjs/ui/components/DevToolsCard.js +3 -1
- package/lib/commonjs/ui/components/DynamicFilterView.js +8 -7
- package/lib/commonjs/ui/components/EntityFilterView.js +355 -0
- package/lib/commonjs/ui/components/EventHistoryViewer/CompareBar.js +5 -4
- package/lib/commonjs/ui/components/EventHistoryViewer/DiffModeTabs.js +2 -1
- package/lib/commonjs/ui/components/EventHistoryViewer/EventPickerModal.js +5 -4
- package/lib/commonjs/ui/components/EventStepperFooter.js +4 -3
- package/lib/commonjs/ui/components/ExpandablePopover.js +12 -4
- package/lib/commonjs/ui/components/ExpandedInfoRow.js +3 -2
- package/lib/commonjs/ui/components/ExportPreview.js +174 -0
- package/lib/commonjs/ui/components/FilterComponents.js +2 -1
- package/lib/commonjs/ui/components/InfoRow.js +91 -0
- package/lib/commonjs/ui/components/ModalHeader.js +40 -7
- package/lib/commonjs/ui/components/Pill.js +115 -0
- package/lib/commonjs/ui/components/ToggleRow.js +116 -0
- package/lib/commonjs/ui/components/ToolFooter.js +205 -0
- package/lib/commonjs/ui/components/index.js +100 -1
- package/lib/commonjs/ui/console/CyberpunkSectionButton.js +3 -2
- package/lib/commonjs/ui/fonts.js +12 -0
- package/lib/commonjs/ui/gameUI/components/GameUICollapsibleSection.js +4 -3
- package/lib/commonjs/ui/gameUI/components/GameUICompactStats.js +12 -11
- package/lib/commonjs/ui/gameUI/components/GameUIIssuesList.js +9 -8
- package/lib/commonjs/ui/gameUI/components/GameUIStatusHeader.js +4 -3
- package/lib/commonjs/ui/index.js +32 -2
- package/lib/commonjs/ui/listPresets.js +43 -0
- package/lib/commonjs/ui/night/primitives.js +3 -1
- package/lib/commonjs/ui/toolTheme.js +4 -3
- package/lib/commonjs/utils/snapshotProviderKit.js +167 -0
- package/lib/commonjs/utils/stateTools.js +160 -0
- package/lib/module/JsModal.js +57 -22
- package/lib/module/dataViewer/CyberpunkInput.js +3 -2
- package/lib/module/dataViewer/DataTreeActionBar.js +3 -2
- package/lib/module/dataViewer/DataTreeActionDock.js +2 -1
- package/lib/module/dataViewer/DiffSummary.js +4 -3
- package/lib/module/dataViewer/LiveExplorer.js +11 -11
- package/lib/module/dataViewer/SplitDiffViewer.js +10 -9
- package/lib/module/dataViewer/ThemedSplitView.js +12 -11
- package/lib/module/dataViewer/ValueEditModal.js +6 -5
- package/lib/module/dataViewer/VirtualizedDataExplorer.js +5 -4
- package/lib/module/dataViewer/tree/TreeDiffViewer.js +15 -15
- 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/icons/index.js +27 -2
- package/lib/module/index.js +11 -1
- package/lib/module/license/FreeAccountPrompt.js +2 -2
- package/lib/module/license/LicenseEntryModal.js +3 -3
- package/lib/module/storage/definePersistedSetting.js +63 -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 +106 -0
- package/lib/module/ui/components/ChipStrip.js +91 -0
- package/lib/module/ui/components/ClipboardHintBanner.js +2 -1
- package/lib/module/ui/components/CompactRow.js +3 -2
- package/lib/module/ui/components/DataInspector.js +3 -2
- package/lib/module/ui/components/DetailView.js +2 -1
- package/lib/module/ui/components/DetailViewToggle.js +125 -0
- package/lib/module/ui/components/DevToolsCard.js +3 -1
- package/lib/module/ui/components/DynamicFilterView.js +8 -7
- package/lib/module/ui/components/EntityFilterView.js +351 -0
- package/lib/module/ui/components/EventHistoryViewer/CompareBar.js +6 -5
- package/lib/module/ui/components/EventHistoryViewer/DiffModeTabs.js +3 -2
- package/lib/module/ui/components/EventHistoryViewer/EventPickerModal.js +6 -5
- package/lib/module/ui/components/EventStepperFooter.js +4 -3
- package/lib/module/ui/components/ExpandablePopover.js +12 -4
- package/lib/module/ui/components/ExpandedInfoRow.js +3 -2
- package/lib/module/ui/components/ExportPreview.js +169 -0
- package/lib/module/ui/components/FilterComponents.js +2 -2
- package/lib/module/ui/components/InfoRow.js +87 -0
- package/lib/module/ui/components/ModalHeader.js +40 -7
- package/lib/module/ui/components/Pill.js +111 -0
- package/lib/module/ui/components/ToggleRow.js +112 -0
- package/lib/module/ui/components/ToolFooter.js +197 -0
- package/lib/module/ui/components/index.js +10 -1
- package/lib/module/ui/console/CyberpunkSectionButton.js +3 -2
- package/lib/module/ui/fonts.js +8 -0
- package/lib/module/ui/gameUI/components/GameUICollapsibleSection.js +4 -3
- package/lib/module/ui/gameUI/components/GameUICompactStats.js +12 -11
- package/lib/module/ui/gameUI/components/GameUIIssuesList.js +9 -8
- package/lib/module/ui/gameUI/components/GameUIStatusHeader.js +4 -3
- 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/toolTheme.js +4 -4
- 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/dataViewer/CyberpunkInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/DataTreeActionBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/DataTreeActionDock.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/DiffSummary.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/LiveExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/SplitDiffViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/ThemedSplitView.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/ValueEditModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/commonjs/dataViewer/tree/TreeDiffViewer.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/icons/index.d.ts +4 -1
- package/lib/typescript/commonjs/icons/index.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/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/commonjs/license/LicenseEntryModal.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/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/ClipboardHintBanner.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DataInspector.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/DetailView.d.ts.map +1 -1
- 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/DynamicFilterView.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/EventHistoryViewer/CompareBar.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventHistoryViewer/DiffModeTabs.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventHistoryViewer/EventPickerModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/EventStepperFooter.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts +5 -1
- package/lib/typescript/commonjs/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/ExpandedInfoRow.d.ts.map +1 -1
- 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/FilterComponents.d.ts.map +1 -1
- 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/ToolFooter.d.ts +69 -0
- package/lib/typescript/commonjs/ui/components/ToolFooter.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts +9 -0
- package/lib/typescript/commonjs/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/console/CyberpunkSectionButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/fonts.d.ts +7 -0
- package/lib/typescript/commonjs/ui/fonts.d.ts.map +1 -0
- package/lib/typescript/commonjs/ui/gameUI/components/GameUICollapsibleSection.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/components/GameUICompactStats.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/components/GameUIIssuesList.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/gameUI/components/GameUIStatusHeader.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/toolTheme.d.ts.map +1 -1
- 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/dataViewer/CyberpunkInput.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/DataTreeActionBar.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/DataTreeActionDock.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/DiffSummary.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/LiveExplorer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/SplitDiffViewer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/ThemedSplitView.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/ValueEditModal.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/VirtualizedDataExplorer.d.ts.map +1 -1
- package/lib/typescript/module/dataViewer/tree/TreeDiffViewer.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/icons/index.d.ts +4 -1
- package/lib/typescript/module/icons/index.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/license/FreeAccountPrompt.d.ts.map +1 -1
- package/lib/typescript/module/license/LicenseEntryModal.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/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/ClipboardHintBanner.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/CompactRow.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DataInspector.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/DetailView.d.ts.map +1 -1
- 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/DynamicFilterView.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/EventHistoryViewer/CompareBar.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventHistoryViewer/DiffModeTabs.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventHistoryViewer/EventPickerModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/EventStepperFooter.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts +5 -1
- package/lib/typescript/module/ui/components/ExpandablePopover.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/ExpandedInfoRow.d.ts.map +1 -1
- 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/FilterComponents.d.ts.map +1 -1
- 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/ToolFooter.d.ts +69 -0
- package/lib/typescript/module/ui/components/ToolFooter.d.ts.map +1 -0
- package/lib/typescript/module/ui/components/index.d.ts +9 -0
- package/lib/typescript/module/ui/components/index.d.ts.map +1 -1
- package/lib/typescript/module/ui/console/CyberpunkSectionButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/fonts.d.ts +7 -0
- package/lib/typescript/module/ui/fonts.d.ts.map +1 -0
- package/lib/typescript/module/ui/gameUI/components/GameUICollapsibleSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/components/GameUICompactStats.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/components/GameUIIssuesList.d.ts.map +1 -1
- package/lib/typescript/module/ui/gameUI/components/GameUIStatusHeader.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/toolTheme.d.ts.map +1 -1
- 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
package/lib/commonjs/index.js
CHANGED
|
@@ -52,10 +52,25 @@ var _exportNames = {
|
|
|
52
52
|
getSafeCurrentPathname: true,
|
|
53
53
|
getSafeCurrentRoute: true,
|
|
54
54
|
isExpoRouterAvailable: true,
|
|
55
|
+
PREVIEW_ITEM_RENDER_BYTE_LIMIT: true,
|
|
56
|
+
createRestoreScope: true,
|
|
57
|
+
emptyRestoreResult: true,
|
|
58
|
+
failedRestore: true,
|
|
59
|
+
skippedRestore: true,
|
|
60
|
+
classifyPreviewItem: true,
|
|
61
|
+
wontApply: true,
|
|
62
|
+
unionKeys: true,
|
|
63
|
+
entityColor: true,
|
|
64
|
+
formatValuePreview: true,
|
|
65
|
+
shallowDiffSummary: true,
|
|
55
66
|
isPlainObjectUtil: true,
|
|
56
67
|
useSafeAreaInsets: true,
|
|
57
68
|
useFilterManager: true,
|
|
58
69
|
usePersistedState: true,
|
|
70
|
+
resetPersistedStateCache: true,
|
|
71
|
+
useChangeLog: true,
|
|
72
|
+
useSubscribedValue: true,
|
|
73
|
+
useEventStoreEvents: true,
|
|
59
74
|
useDeviceInfo: true,
|
|
60
75
|
getDeviceInfo: true,
|
|
61
76
|
logDeviceInfo: true,
|
|
@@ -222,6 +237,12 @@ Object.defineProperty(exports, "NightSwitch", {
|
|
|
222
237
|
return _primitives.NightSwitch;
|
|
223
238
|
}
|
|
224
239
|
});
|
|
240
|
+
Object.defineProperty(exports, "PREVIEW_ITEM_RENDER_BYTE_LIMIT", {
|
|
241
|
+
enumerable: true,
|
|
242
|
+
get: function () {
|
|
243
|
+
return _snapshotProviderKit.PREVIEW_ITEM_RENDER_BYTE_LIMIT;
|
|
244
|
+
}
|
|
245
|
+
});
|
|
225
246
|
Object.defineProperty(exports, "ProBadge", {
|
|
226
247
|
enumerable: true,
|
|
227
248
|
get: function () {
|
|
@@ -282,6 +303,18 @@ Object.defineProperty(exports, "buoyColors", {
|
|
|
282
303
|
return _gameUIColors.buoyColors;
|
|
283
304
|
}
|
|
284
305
|
});
|
|
306
|
+
Object.defineProperty(exports, "classifyPreviewItem", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function () {
|
|
309
|
+
return _snapshotProviderKit.classifyPreviewItem;
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
Object.defineProperty(exports, "createRestoreScope", {
|
|
313
|
+
enumerable: true,
|
|
314
|
+
get: function () {
|
|
315
|
+
return _snapshotProviderKit.createRestoreScope;
|
|
316
|
+
}
|
|
317
|
+
});
|
|
285
318
|
Object.defineProperty(exports, "dialColors", {
|
|
286
319
|
enumerable: true,
|
|
287
320
|
get: function () {
|
|
@@ -294,6 +327,24 @@ Object.defineProperty(exports, "displayValue", {
|
|
|
294
327
|
return _index3.displayValue;
|
|
295
328
|
}
|
|
296
329
|
});
|
|
330
|
+
Object.defineProperty(exports, "emptyRestoreResult", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
get: function () {
|
|
333
|
+
return _snapshotProviderKit.emptyRestoreResult;
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(exports, "entityColor", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
get: function () {
|
|
339
|
+
return _stateTools.entityColor;
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, "failedRestore", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () {
|
|
345
|
+
return _snapshotProviderKit.failedRestore;
|
|
346
|
+
}
|
|
347
|
+
});
|
|
297
348
|
Object.defineProperty(exports, "flattenObject", {
|
|
298
349
|
enumerable: true,
|
|
299
350
|
get: function () {
|
|
@@ -312,6 +363,12 @@ Object.defineProperty(exports, "formatValue", {
|
|
|
312
363
|
return _index3.formatValue;
|
|
313
364
|
}
|
|
314
365
|
});
|
|
366
|
+
Object.defineProperty(exports, "formatValuePreview", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return _stateTools.formatValuePreview;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
315
372
|
Object.defineProperty(exports, "freeKeyRaises", {
|
|
316
373
|
enumerable: true,
|
|
317
374
|
get: function () {
|
|
@@ -546,6 +603,12 @@ Object.defineProperty(exports, "reloadApp", {
|
|
|
546
603
|
return _index3.reloadApp;
|
|
547
604
|
}
|
|
548
605
|
});
|
|
606
|
+
Object.defineProperty(exports, "resetPersistedStateCache", {
|
|
607
|
+
enumerable: true,
|
|
608
|
+
get: function () {
|
|
609
|
+
return _index1.resetPersistedStateCache;
|
|
610
|
+
}
|
|
611
|
+
});
|
|
549
612
|
Object.defineProperty(exports, "resolveEffectiveTier", {
|
|
550
613
|
enumerable: true,
|
|
551
614
|
get: function () {
|
|
@@ -576,6 +639,18 @@ Object.defineProperty(exports, "setRenderCaptureProvider", {
|
|
|
576
639
|
return _index3.setRenderCaptureProvider;
|
|
577
640
|
}
|
|
578
641
|
});
|
|
642
|
+
Object.defineProperty(exports, "shallowDiffSummary", {
|
|
643
|
+
enumerable: true,
|
|
644
|
+
get: function () {
|
|
645
|
+
return _stateTools.shallowDiffSummary;
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
Object.defineProperty(exports, "skippedRestore", {
|
|
649
|
+
enumerable: true,
|
|
650
|
+
get: function () {
|
|
651
|
+
return _snapshotProviderKit.skippedRestore;
|
|
652
|
+
}
|
|
653
|
+
});
|
|
579
654
|
Object.defineProperty(exports, "subscribeToStateSnapshotProviders", {
|
|
580
655
|
enumerable: true,
|
|
581
656
|
get: function () {
|
|
@@ -612,12 +687,30 @@ Object.defineProperty(exports, "truncateText", {
|
|
|
612
687
|
return _index3.truncateText;
|
|
613
688
|
}
|
|
614
689
|
});
|
|
690
|
+
Object.defineProperty(exports, "unionKeys", {
|
|
691
|
+
enumerable: true,
|
|
692
|
+
get: function () {
|
|
693
|
+
return _snapshotProviderKit.unionKeys;
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
Object.defineProperty(exports, "useChangeLog", {
|
|
697
|
+
enumerable: true,
|
|
698
|
+
get: function () {
|
|
699
|
+
return _index1.useChangeLog;
|
|
700
|
+
}
|
|
701
|
+
});
|
|
615
702
|
Object.defineProperty(exports, "useDeviceInfo", {
|
|
616
703
|
enumerable: true,
|
|
617
704
|
get: function () {
|
|
618
705
|
return _index1.useDeviceInfo;
|
|
619
706
|
}
|
|
620
707
|
});
|
|
708
|
+
Object.defineProperty(exports, "useEventStoreEvents", {
|
|
709
|
+
enumerable: true,
|
|
710
|
+
get: function () {
|
|
711
|
+
return _index1.useEventStoreEvents;
|
|
712
|
+
}
|
|
713
|
+
});
|
|
621
714
|
Object.defineProperty(exports, "useFeatureGate", {
|
|
622
715
|
enumerable: true,
|
|
623
716
|
get: function () {
|
|
@@ -684,6 +777,18 @@ Object.defineProperty(exports, "useSafeSegments", {
|
|
|
684
777
|
return _index3.useSafeSegments;
|
|
685
778
|
}
|
|
686
779
|
});
|
|
780
|
+
Object.defineProperty(exports, "useSubscribedValue", {
|
|
781
|
+
enumerable: true,
|
|
782
|
+
get: function () {
|
|
783
|
+
return _index1.useSubscribedValue;
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
Object.defineProperty(exports, "wontApply", {
|
|
787
|
+
enumerable: true,
|
|
788
|
+
get: function () {
|
|
789
|
+
return _snapshotProviderKit.wontApply;
|
|
790
|
+
}
|
|
791
|
+
});
|
|
687
792
|
var _index = require("./ui/index.js");
|
|
688
793
|
Object.keys(_index).forEach(function (key) {
|
|
689
794
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -720,6 +825,42 @@ Object.keys(_wireBudget).forEach(function (key) {
|
|
|
720
825
|
}
|
|
721
826
|
});
|
|
722
827
|
});
|
|
828
|
+
var _wireForm = require("./sync/wireForm.js");
|
|
829
|
+
Object.keys(_wireForm).forEach(function (key) {
|
|
830
|
+
if (key === "default" || key === "__esModule") return;
|
|
831
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
832
|
+
if (key in exports && exports[key] === _wireForm[key]) return;
|
|
833
|
+
Object.defineProperty(exports, key, {
|
|
834
|
+
enumerable: true,
|
|
835
|
+
get: function () {
|
|
836
|
+
return _wireForm[key];
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
});
|
|
840
|
+
var _toolSyncAdapter = require("./sync/toolSyncAdapter.js");
|
|
841
|
+
Object.keys(_toolSyncAdapter).forEach(function (key) {
|
|
842
|
+
if (key === "default" || key === "__esModule") return;
|
|
843
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
844
|
+
if (key in exports && exports[key] === _toolSyncAdapter[key]) return;
|
|
845
|
+
Object.defineProperty(exports, key, {
|
|
846
|
+
enumerable: true,
|
|
847
|
+
get: function () {
|
|
848
|
+
return _toolSyncAdapter[key];
|
|
849
|
+
}
|
|
850
|
+
});
|
|
851
|
+
});
|
|
852
|
+
var _defineTool = require("./tools/defineTool.js");
|
|
853
|
+
Object.keys(_defineTool).forEach(function (key) {
|
|
854
|
+
if (key === "default" || key === "__esModule") return;
|
|
855
|
+
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
856
|
+
if (key in exports && exports[key] === _defineTool[key]) return;
|
|
857
|
+
Object.defineProperty(exports, key, {
|
|
858
|
+
enumerable: true,
|
|
859
|
+
get: function () {
|
|
860
|
+
return _defineTool[key];
|
|
861
|
+
}
|
|
862
|
+
});
|
|
863
|
+
});
|
|
723
864
|
var _toolActionRegistry = require("./sync/toolActionRegistry.js");
|
|
724
865
|
Object.keys(_toolActionRegistry).forEach(function (key) {
|
|
725
866
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -745,6 +886,8 @@ Object.keys(_toolUiBridge).forEach(function (key) {
|
|
|
745
886
|
});
|
|
746
887
|
});
|
|
747
888
|
var _index3 = require("./utils/index.js");
|
|
889
|
+
var _snapshotProviderKit = require("./utils/snapshotProviderKit.js");
|
|
890
|
+
var _stateTools = require("./utils/stateTools.js");
|
|
748
891
|
var _index4 = require("./utils/formatting/index.js");
|
|
749
892
|
Object.keys(_index4).forEach(function (key) {
|
|
750
893
|
if (key === "default" || key === "__esModule") return;
|
|
@@ -10,6 +10,7 @@ var _gameUIColors = require("../ui/gameUI/constants/gameUIColors.js");
|
|
|
10
10
|
var _lucideIcons = require("../icons/lucide-icons.js");
|
|
11
11
|
var _index = require("../clipboard/index.js");
|
|
12
12
|
var _openPricing = require("./openPricing.js");
|
|
13
|
+
var _fonts = require("../ui/fonts.js");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
16
|
/**
|
|
@@ -160,7 +161,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
160
161
|
fontSize: 14,
|
|
161
162
|
fontWeight: "600",
|
|
162
163
|
color: _gameUIColors.buoyColors.text,
|
|
163
|
-
fontFamily:
|
|
164
|
+
fontFamily: _fonts.monoFont
|
|
164
165
|
},
|
|
165
166
|
reassure: {
|
|
166
167
|
fontSize: 12,
|
|
@@ -10,6 +10,7 @@ var _absoluteFill = require("../utils/absoluteFill.js");
|
|
|
10
10
|
var _macOSDesignSystemColors = require("../ui/gameUI/constants/macOSDesignSystemColors.js");
|
|
11
11
|
var _openPricing = require("./openPricing.js");
|
|
12
12
|
var _lucideIcons = require("../icons/lucide-icons.js");
|
|
13
|
+
var _fonts = require("../ui/fonts.js");
|
|
13
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
15
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
15
16
|
/**
|
|
@@ -344,7 +345,7 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
344
345
|
},
|
|
345
346
|
codeText: {
|
|
346
347
|
fontSize: 11,
|
|
347
|
-
fontFamily:
|
|
348
|
+
fontFamily: _fonts.monoFont,
|
|
348
349
|
lineHeight: 18,
|
|
349
350
|
color: _macOSDesignSystemColors.macOSColors.text.primary
|
|
350
351
|
},
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.definePersistedSetting = definePersistedSetting;
|
|
7
|
+
var _persistentStorage = require("../utils/persistentStorage.js");
|
|
8
|
+
/**
|
|
9
|
+
* definePersistedSetting — the `load / save / clear` triple every tool wrote
|
|
10
|
+
* for its module-level settings (copy settings, HUD prefs, JS TOP prefs, …).
|
|
11
|
+
*
|
|
12
|
+
* Contract, the same one all of them followed:
|
|
13
|
+
* - `load()` never throws and never returns a partial object: the stored
|
|
14
|
+
* value is merged OVER the defaults so fields added in a later release
|
|
15
|
+
* get their default instead of `undefined`, then `sanitize` gets the last
|
|
16
|
+
* word (drop values the UI no longer offers, coerce types).
|
|
17
|
+
* - `save()` and `clear()` are best-effort; persistence is optional.
|
|
18
|
+
* - `loadOrNull()` distinguishes "nothing saved yet" from the defaults, for
|
|
19
|
+
* callers that treat first launch differently.
|
|
20
|
+
*/
|
|
21
|
+
|
|
22
|
+
function isPlainObject(value) {
|
|
23
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24
|
+
}
|
|
25
|
+
function definePersistedSetting(key, defaults, options = {}) {
|
|
26
|
+
const storage = options.storage ?? _persistentStorage.persistentStorage;
|
|
27
|
+
const parse = options.parse ?? (raw => JSON.parse(raw));
|
|
28
|
+
const serialize = options.serialize ?? (value => JSON.stringify(value));
|
|
29
|
+
function resolve(stored) {
|
|
30
|
+
const merged = isPlainObject(defaults) && isPlainObject(stored) ? {
|
|
31
|
+
...defaults,
|
|
32
|
+
...stored
|
|
33
|
+
} : stored;
|
|
34
|
+
return options.sanitize ? options.sanitize(merged, stored) : merged;
|
|
35
|
+
}
|
|
36
|
+
async function loadOrNull() {
|
|
37
|
+
try {
|
|
38
|
+
const raw = await storage.getItem(key);
|
|
39
|
+
if (raw == null || raw === "") return null;
|
|
40
|
+
return resolve(parse(raw));
|
|
41
|
+
} catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
key,
|
|
47
|
+
defaults,
|
|
48
|
+
loadOrNull,
|
|
49
|
+
async load() {
|
|
50
|
+
return (await loadOrNull()) ?? defaults;
|
|
51
|
+
},
|
|
52
|
+
async save(value) {
|
|
53
|
+
try {
|
|
54
|
+
await storage.setItem(key, serialize(value));
|
|
55
|
+
} catch {
|
|
56
|
+
// Persistence is best-effort.
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
async clear() {
|
|
60
|
+
try {
|
|
61
|
+
await storage.removeItem(key);
|
|
62
|
+
} catch {
|
|
63
|
+
// Persistence is best-effort.
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
@@ -3,6 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
Object.defineProperty(exports, "definePersistedSetting", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _definePersistedSetting.definePersistedSetting;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
6
12
|
Object.defineProperty(exports, "devToolsStorageKeys", {
|
|
7
13
|
enumerable: true,
|
|
8
14
|
get: function () {
|
|
@@ -15,4 +21,5 @@ Object.defineProperty(exports, "isDevToolsStorageKey", {
|
|
|
15
21
|
return _devToolsStorageKeys.isDevToolsStorageKey;
|
|
16
22
|
}
|
|
17
23
|
});
|
|
18
|
-
var _devToolsStorageKeys = require("./devToolsStorageKeys.js");
|
|
24
|
+
var _devToolsStorageKeys = require("./devToolsStorageKeys.js");
|
|
25
|
+
var _definePersistedSetting = require("./definePersistedSetting.js");
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.ChangeLog = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* ChangeLog — the class-shaped event log the state tools share.
|
|
9
|
+
*
|
|
10
|
+
* redux (`ReduxActionStore`), zustand (`ZustandStateStore`), jotai
|
|
11
|
+
* (`JotaiStateStore`) and react-query (`ReactQueryEventStore`) each carried
|
|
12
|
+
* the same ~120 lines: a newest-first ring buffer, a `Set` of array listeners
|
|
13
|
+
* (`(items) => void`), a `Set` of clear listeners for the desktop's mirror
|
|
14
|
+
* mode, an `enabled` flag (the UI's pause button), a `captureSuppressed` flag
|
|
15
|
+
* (the dashboard must never record its own traffic), a monotonic id counter,
|
|
16
|
+
* `getById`, and hydrate-by-id for lazily fetched detail payloads.
|
|
17
|
+
*
|
|
18
|
+
* This is that core. Tool stores `extend` it and keep their public method
|
|
19
|
+
* names (`addStateChange`, `getActions`, `clearAtomChanges`, …) as thin
|
|
20
|
+
* wrappers, so no call site — including Buoy Desktop — has to change.
|
|
21
|
+
*
|
|
22
|
+
* Semantics preserved from the originals, deliberately:
|
|
23
|
+
* - `getAll()` returns a COPY (`[...items]`) — consumers seed React state
|
|
24
|
+
* from it and rely on a fresh identity per notification.
|
|
25
|
+
* - `clear()` always notifies, even when already empty, then fires the clear
|
|
26
|
+
* listeners (the dashboard forwards the clear to the device either way).
|
|
27
|
+
* - `replaceAll()` respects `enabled`: the pause button freezes a mirror.
|
|
28
|
+
* - `disableCapture()` is permanent for the store's lifetime.
|
|
29
|
+
*/
|
|
30
|
+
|
|
31
|
+
class ChangeLog {
|
|
32
|
+
/** Newest first. Subclasses may read; mutate only through the helpers. */
|
|
33
|
+
items = [];
|
|
34
|
+
itemListeners = new Set();
|
|
35
|
+
clearListeners = new Set();
|
|
36
|
+
idCounter = 0;
|
|
37
|
+
enabled = true;
|
|
38
|
+
captureSuppressed = false;
|
|
39
|
+
constructor(options = {}) {
|
|
40
|
+
this.max = options.max ?? 200;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
// ---- Recording ----
|
|
44
|
+
|
|
45
|
+
/** True when a new item should be recorded (not paused, not a mirror). */
|
|
46
|
+
canRecord() {
|
|
47
|
+
return this.enabled && !this.captureSuppressed;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/** `${Date.now()}-${n}` — unique per store instance, sorts by time. */
|
|
51
|
+
nextId() {
|
|
52
|
+
return `${Date.now()}-${++this.idCounter}`;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Prepend one item and trim to `max`. Does NOT notify — subclasses often
|
|
57
|
+
* touch companion state (per-entity counters, raw-state eviction) before
|
|
58
|
+
* they notify. Call `notifyListeners()` when done, or use `record()`.
|
|
59
|
+
*/
|
|
60
|
+
push(item) {
|
|
61
|
+
this.items = [item, ...this.items].slice(0, this.max);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** `push()` + notify. The common case. */
|
|
65
|
+
record(item) {
|
|
66
|
+
this.push(item);
|
|
67
|
+
this.notifyListeners();
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/** Replace the buffer wholesale (already merged/hydrated by the caller) and notify. */
|
|
71
|
+
setItems(next) {
|
|
72
|
+
this.items = next.slice(0, this.max);
|
|
73
|
+
this.notifyListeners();
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
// ---- Reading ----
|
|
77
|
+
|
|
78
|
+
/** All items, newest first. Fresh array each call. */
|
|
79
|
+
getAll() {
|
|
80
|
+
return [...this.items];
|
|
81
|
+
}
|
|
82
|
+
getById(id) {
|
|
83
|
+
return this.items.find(item => item.id === id);
|
|
84
|
+
}
|
|
85
|
+
get size() {
|
|
86
|
+
return this.items.length;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// ---- Clearing ----
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Empty the buffer, notify, then fire clear listeners. Always notifies —
|
|
93
|
+
* a clear is a user action and the list must repaint even if nothing was
|
|
94
|
+
* in it. Subclasses that keep companion counters reset them first.
|
|
95
|
+
*/
|
|
96
|
+
clear() {
|
|
97
|
+
this.items = [];
|
|
98
|
+
this.notifyListeners();
|
|
99
|
+
this.clearListeners.forEach(listener => {
|
|
100
|
+
try {
|
|
101
|
+
listener();
|
|
102
|
+
} catch {
|
|
103
|
+
// Ignore listener errors
|
|
104
|
+
}
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Listen for `clear()` calls. Used in remote mirror mode to forward a
|
|
110
|
+
* clear performed in the dashboard UI to the synced device.
|
|
111
|
+
*/
|
|
112
|
+
onClear(listener) {
|
|
113
|
+
this.clearListeners.add(listener);
|
|
114
|
+
return () => {
|
|
115
|
+
this.clearListeners.delete(listener);
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
// ---- Remote mirror mode ----
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Permanently suppress local capture. Use when this store acts as a mirror
|
|
123
|
+
* of a remote device (the desktop dashboard): data arrives via
|
|
124
|
+
* `replaceAll()` / a subclass snapshot method and local instrumentation
|
|
125
|
+
* must never record.
|
|
126
|
+
*/
|
|
127
|
+
disableCapture() {
|
|
128
|
+
this.captureSuppressed = true;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** Whether the store is in remote mirror mode (capture suppressed). */
|
|
132
|
+
isCaptureSuppressed() {
|
|
133
|
+
return this.captureSuppressed;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Replace the whole list from a remote snapshot and notify. Respects the
|
|
138
|
+
* enabled flag so the UI's pause button freezes the mirror. Returns false
|
|
139
|
+
* when skipped. Subclasses with hydration-preserving merges compute the
|
|
140
|
+
* merged list themselves and call `setItems()`.
|
|
141
|
+
*/
|
|
142
|
+
replaceAll(next) {
|
|
143
|
+
if (!this.enabled) return false;
|
|
144
|
+
this.setItems(next);
|
|
145
|
+
return true;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Patch one item in place (by id) and notify. Used to hydrate a mirrored
|
|
150
|
+
* item with detail payloads fetched on demand from the device.
|
|
151
|
+
*/
|
|
152
|
+
hydrateById(id, patch) {
|
|
153
|
+
const index = this.items.findIndex(item => item.id === id);
|
|
154
|
+
if (index === -1) return;
|
|
155
|
+
this.items = [...this.items.slice(0, index), {
|
|
156
|
+
...this.items[index],
|
|
157
|
+
...patch
|
|
158
|
+
}, ...this.items.slice(index + 1)];
|
|
159
|
+
this.notifyListeners();
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ---- Enable / disable ----
|
|
163
|
+
|
|
164
|
+
setEnabled(enabled) {
|
|
165
|
+
this.enabled = enabled;
|
|
166
|
+
}
|
|
167
|
+
getEnabled() {
|
|
168
|
+
return this.enabled;
|
|
169
|
+
}
|
|
170
|
+
setMax(max) {
|
|
171
|
+
this.max = max;
|
|
172
|
+
if (this.items.length > max) {
|
|
173
|
+
this.items = this.items.slice(0, max);
|
|
174
|
+
this.notifyListeners();
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
getMax() {
|
|
178
|
+
return this.max;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// ---- Subscriptions ----
|
|
182
|
+
|
|
183
|
+
subscribe(listener) {
|
|
184
|
+
this.itemListeners.add(listener);
|
|
185
|
+
return () => {
|
|
186
|
+
this.itemListeners.delete(listener);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
notifyListeners() {
|
|
190
|
+
const items = this.getAll();
|
|
191
|
+
this.itemListeners.forEach(listener => listener(items));
|
|
192
|
+
}
|
|
193
|
+
get listenerCount() {
|
|
194
|
+
return this.itemListeners.size;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
exports.ChangeLog = ChangeLog;
|