@nivaro/react 0.2.53 → 0.2.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +99 -98
- package/dist/index.d.ts +452 -4
- package/dist/index.js +644 -618
- package/dist/layout-editor.d.ts +252 -2
- package/dist/shared/components/BackgroundRunOffer.js +117 -0
- package/dist/shared/components/BroadcastView.js +214 -213
- package/dist/shared/components/CollectionBrowserView.js +2592 -2695
- package/dist/shared/components/FormWhatsNew.js +60 -0
- package/dist/shared/components/ItemEditForm.js +3968 -3618
- package/dist/shared/components/JobsTray.js +100 -55
- package/dist/shared/components/MyWorkView.js +91 -89
- package/dist/shared/components/NotificationBell.js +80 -79
- package/dist/shared/components/ProfileView.js +568 -520
- package/dist/shared/components/RecordCompare.js +254 -0
- package/dist/shared/components/RecordReadView.js +598 -543
- package/dist/shared/components/ReportView.js +578 -543
- package/dist/shared/components/RowPresence.js +91 -0
- package/dist/shared/components/TipLayer.js +27 -27
- package/dist/shared/components/WidgetSlot.js +474 -458
- package/dist/shared/components/ai/AiAnalyticsView.js +16 -6
- package/dist/shared/components/ai/AskPanel.js +139 -119
- package/dist/shared/components/ai/FirstWeekCard.js +126 -0
- package/dist/shared/components/bulk/BulkFieldUpdate.js +289 -0
- package/dist/shared/components/bulk/bulk-field-options.js +45 -0
- package/dist/shared/components/charts/CumulativeFlowChart.js +176 -0
- package/dist/shared/components/chat/ChannelArchive.js +326 -0
- package/dist/shared/components/chat/ChannelExtras.js +141 -121
- package/dist/shared/components/chat/ChatAnalyticsView.js +112 -110
- package/dist/shared/components/chat/ChatPanel.js +1695 -1733
- package/dist/shared/components/chat/Composer.js +357 -303
- package/dist/shared/components/chat/MessageActions.js +92 -0
- package/dist/shared/components/chat/MessageFormat.js +290 -264
- package/dist/shared/components/chat/OutboxBubbles.js +146 -0
- package/dist/shared/components/chat/RequestIdCard.js +135 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +202 -0
- package/dist/shared/components/chat/RoomParts.js +213 -274
- package/dist/shared/components/chat/ScreenClip.js +184 -0
- package/dist/shared/components/chat/chat-core.js +402 -483
- package/dist/shared/components/chat/chat-drafts.js +59 -0
- package/dist/shared/components/chat/chat-emoji.js +348 -0
- package/dist/shared/components/chat/chat-local-time.js +41 -0
- package/dist/shared/components/chat/chat-outbox.js +303 -0
- package/dist/shared/components/chat/chat-window.js +163 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +164 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +342 -0
- package/dist/shared/components/chat/huddle/useHuddle.js +58 -0
- package/dist/shared/components/help-videos/api.js +80 -67
- package/dist/shared/components/help-videos/editor/DetailsTab.js +147 -130
- package/dist/shared/components/item-edit/CatalogPickerField.js +113 -112
- package/dist/shared/components/item-edit/ChangeReasonDialog.js +13 -13
- package/dist/shared/components/item-edit/FieldAffordances.js +9 -8
- package/dist/shared/components/item-edit/FieldRenderer.js +248 -245
- package/dist/shared/components/item-edit/FieldRow.js +382 -320
- package/dist/shared/components/item-edit/FormHelpVideoButton.js +59 -0
- package/dist/shared/components/item-edit/GroupSection.js +786 -639
- package/dist/shared/components/item-edit/HeaderTools.js +59 -56
- package/dist/shared/components/item-edit/InlineTableField.js +3 -1
- package/dist/shared/components/item-edit/LayoutContentBlock.js +47 -24
- package/dist/shared/components/item-edit/RelationCombobox.js +186 -176
- package/dist/shared/components/item-edit/entry/EntryStrip.js +54 -0
- package/dist/shared/components/item-edit/entry/entry-keys.js +27 -0
- package/dist/shared/components/item-edit/entry/useEntryKeyboard.js +70 -0
- package/dist/shared/components/item-edit/entry/useEntryMode.js +59 -0
- package/dist/shared/components/item-edit/form-structure-ui.js +105 -0
- package/dist/shared/components/item-edit/lazy-sections.js +36 -0
- package/dist/shared/components/item-edit/lock-why.js +94 -0
- package/dist/shared/components/item-edit/picker-miss.js +26 -0
- package/dist/shared/components/item-edit/placement-behaviour.js +196 -0
- package/dist/shared/components/item-edit/useFormUsageBeacon.js +65 -0
- package/dist/shared/components/layout-editor/AddPanel.js +226 -151
- package/dist/shared/components/layout-editor/ArrangeButton.js +34 -0
- package/dist/shared/components/layout-editor/AutoArrange.js +86 -0
- package/dist/shared/components/layout-editor/CanvasCompare.js +79 -0
- package/dist/shared/components/layout-editor/ChangeNote.js +147 -0
- package/dist/shared/components/layout-editor/CollabParts.js +175 -0
- package/dist/shared/components/layout-editor/DesignNode.js +311 -116
- package/dist/shared/components/layout-editor/EditorCanvas.js +30 -26
- package/dist/shared/components/layout-editor/EditorTopBar.js +463 -175
- package/dist/shared/components/layout-editor/FindReplace.js +188 -0
- package/dist/shared/components/layout-editor/FormMapButton.js +141 -0
- package/dist/shared/components/layout-editor/HistoryPanel.js +250 -109
- package/dist/shared/components/layout-editor/LayoutEditor.js +1196 -305
- package/dist/shared/components/layout-editor/LayoutsRail.js +94 -67
- package/dist/shared/components/layout-editor/NoteMarker.js +38 -0
- package/dist/shared/components/layout-editor/PlacementsTable.js +187 -0
- package/dist/shared/components/layout-editor/RestorePiece.js +143 -0
- package/dist/shared/components/layout-editor/ScheduleChange.js +106 -0
- package/dist/shared/components/layout-editor/SessionHistory.js +84 -0
- package/dist/shared/components/layout-editor/StagedChip.js +22 -0
- package/dist/shared/components/layout-editor/StructureMenu.js +464 -0
- package/dist/shared/components/layout-editor/UnsavedConfirm.js +103 -0
- package/dist/shared/components/layout-editor/ai/AiToolsButton.js +625 -0
- package/dist/shared/components/layout-editor/ai/ChangeCheck.js +153 -0
- package/dist/shared/components/layout-editor/ai/ai-tools-api.js +80 -0
- package/dist/shared/components/layout-editor/ai/assist-ops.js +38 -0
- package/dist/shared/components/layout-editor/ai/autofill-ops.js +73 -0
- package/dist/shared/components/layout-editor/ai/canvas-capture.js +41 -0
- package/dist/shared/components/layout-editor/ai-forms/AiComposer.js +271 -0
- package/dist/shared/components/layout-editor/ai-forms/AiFormsButton.js +182 -0
- package/dist/shared/components/layout-editor/ai-forms/MeaningSuggestions.js +109 -0
- package/dist/shared/components/layout-editor/ai-forms/SlimPanel.js +170 -0
- package/dist/shared/components/layout-editor/ai-forms/ai-forms-api.js +40 -0
- package/dist/shared/components/layout-editor/ai-forms/pending.js +25 -0
- package/dist/shared/components/layout-editor/ai-forms/plan.js +263 -0
- package/dist/shared/components/layout-editor/ai-rules/AiAskPopover.js +160 -0
- package/dist/shared/components/layout-editor/ai-rules/CascadeWriter.js +175 -0
- package/dist/shared/components/layout-editor/ai-rules/FieldRuleWriter.js +97 -0
- package/dist/shared/components/layout-editor/ai-rules/RuleWriter.js +94 -0
- package/dist/shared/components/layout-editor/ai-rules/ValidationSuggest.js +153 -0
- package/dist/shared/components/layout-editor/ai-rules/api.js +6 -0
- package/dist/shared/components/layout-editor/ai-text/AiTextTools.js +383 -0
- package/dist/shared/components/layout-editor/ai-text/text-ops.js +125 -0
- package/dist/shared/components/layout-editor/assist/AskPanel.js +278 -0
- package/dist/shared/components/layout-editor/assist/ExplainDiff.js +93 -0
- package/dist/shared/components/layout-editor/assist/ProposalsButton.js +150 -0
- package/dist/shared/components/layout-editor/assist/assist-api.js +63 -0
- package/dist/shared/components/layout-editor/assist/jump.js +142 -0
- package/dist/shared/components/layout-editor/assist/settings-index.js +118 -0
- package/dist/shared/components/layout-editor/auto-arrange.js +101 -0
- package/dist/shared/components/layout-editor/bulk/BulkChangesButton.js +221 -0
- package/dist/shared/components/layout-editor/bulk/BulkRun.js +237 -0
- package/dist/shared/components/layout-editor/bulk/MacrosPanel.js +230 -0
- package/dist/shared/components/layout-editor/bulk/bulk-api.js +65 -0
- package/dist/shared/components/layout-editor/bulk/field-labels.js +22 -0
- package/dist/shared/components/layout-editor/bulk/macro-record.js +142 -0
- package/dist/shared/components/layout-editor/bulk/useMacroRecorder.js +65 -0
- package/dist/shared/components/layout-editor/bundle-to-active.js +1 -0
- package/dist/shared/components/layout-editor/canvas-diff.js +157 -0
- package/dist/shared/components/layout-editor/collab/FormFollowShare.js +388 -0
- package/dist/shared/components/layout-editor/collab/collab-api.js +80 -0
- package/dist/shared/components/layout-editor/commands/CommandPalette.js +221 -0
- package/dist/shared/components/layout-editor/commands/intents.js +214 -0
- package/dist/shared/components/layout-editor/commands/parse.js +242 -0
- package/dist/shared/components/layout-editor/design-context.js +26 -6
- package/dist/shared/components/layout-editor/dnd/LayoutDndProvider.js +181 -164
- package/dist/shared/components/layout-editor/dnd/collision.js +25 -23
- package/dist/shared/components/layout-editor/dnd/node.js +69 -57
- package/dist/shared/components/layout-editor/dnd/rail-drop.js +56 -0
- package/dist/shared/components/layout-editor/draft-recovery.js +131 -0
- package/dist/shared/components/layout-editor/editor-notes.js +78 -0
- package/dist/shared/components/layout-editor/editors/swap-config.js +1 -0
- package/dist/shared/components/layout-editor/entry/PlacementPresets.js +149 -0
- package/dist/shared/components/layout-editor/entry/entry-editor-context.js +10 -0
- package/dist/shared/components/layout-editor/entry/presets.js +71 -0
- package/dist/shared/components/layout-editor/entry/tab-order.js +110 -0
- package/dist/shared/components/layout-editor/entry/theme-preview.js +37 -0
- package/dist/shared/components/layout-editor/explain/CanvasRules.js +142 -0
- package/dist/shared/components/layout-editor/explain/default-ghosts.js +81 -0
- package/dist/shared/components/layout-editor/explain/driver-hover.js +62 -0
- package/dist/shared/components/layout-editor/explain/field-sources.js +246 -0
- package/dist/shared/components/layout-editor/explain/rule-graph.js +215 -0
- package/dist/shared/components/layout-editor/explain/use-explain.js +132 -0
- package/dist/shared/components/layout-editor/field-zones.js +116 -0
- package/dist/shared/components/layout-editor/form-map.js +138 -0
- package/dist/shared/components/layout-editor/grid-guides.js +142 -0
- package/dist/shared/components/layout-editor/history-api.js +87 -0
- package/dist/shared/components/layout-editor/inheritance.js +55 -0
- package/dist/shared/components/layout-editor/inspect/inspect-api.js +66 -0
- package/dist/shared/components/layout-editor/inspect/picker-preview.js +48 -0
- package/dist/shared/components/layout-editor/inspect/width-fit.js +87 -0
- package/dist/shared/components/layout-editor/inspector/AiFillSetting.js +85 -0
- package/dist/shared/components/layout-editor/inspector/BehaviourSettings.js +402 -0
- package/dist/shared/components/layout-editor/inspector/Breadcrumb.js +36 -0
- package/dist/shared/components/layout-editor/inspector/BulkInspector.js +179 -0
- package/dist/shared/components/layout-editor/inspector/ColumnFit.js +112 -0
- package/dist/shared/components/layout-editor/inspector/GroupInspector.js +291 -141
- package/dist/shared/components/layout-editor/inspector/HelpTab.js +174 -0
- package/dist/shared/components/layout-editor/inspector/Inspector.js +282 -180
- package/dist/shared/components/layout-editor/inspector/LookTab.js +166 -109
- package/dist/shared/components/layout-editor/inspector/OverrideNotice.js +61 -0
- package/dist/shared/components/layout-editor/inspector/PickerMisses.js +129 -0
- package/dist/shared/components/layout-editor/inspector/PickerPreview.js +134 -0
- package/dist/shared/components/layout-editor/inspector/PickerTab.js +146 -118
- package/dist/shared/components/layout-editor/inspector/RulesTab.js +162 -111
- package/dist/shared/components/layout-editor/inspector/Translations.js +156 -0
- package/dist/shared/components/layout-editor/inspector/kit.js +71 -70
- package/dist/shared/components/layout-editor/inspector/tab-request.js +21 -0
- package/dist/shared/components/layout-editor/is-typing.js +9 -0
- package/dist/shared/components/layout-editor/keyboard-move.js +66 -0
- package/dist/shared/components/layout-editor/lint/LintPanel.js +190 -0
- package/dist/shared/components/layout-editor/lint/lint-api.js +52 -0
- package/dist/shared/components/layout-editor/load-error.js +37 -0
- package/dist/shared/components/layout-editor/matrix/FieldStateMatrix.js +305 -0
- package/dist/shared/components/layout-editor/matrix/MatrixGrid.js +181 -0
- package/dist/shared/components/layout-editor/matrix/RoleSectionMatrix.js +147 -0
- package/dist/shared/components/layout-editor/matrix/matrix-api.js +48 -0
- package/dist/shared/components/layout-editor/matrix/role-matrix.js +36 -0
- package/dist/shared/components/layout-editor/matrix/state-matrix.js +145 -0
- package/dist/shared/components/layout-editor/nav/FindPanel.js +109 -0
- package/dist/shared/components/layout-editor/nav/NavTools.js +114 -0
- package/dist/shared/components/layout-editor/nav/OutlinePanel.js +228 -0
- package/dist/shared/components/layout-editor/nav/ShortcutSheet.js +31 -0
- package/dist/shared/components/layout-editor/nav/find.js +20 -0
- package/dist/shared/components/layout-editor/nav/tree.js +142 -0
- package/dist/shared/components/layout-editor/nav/useEditorNav.js +101 -0
- package/dist/shared/components/layout-editor/nav/view-prefs.js +34 -0
- package/dist/shared/components/layout-editor/ops/ChangeRequestsPanel.js +143 -0
- package/dist/shared/components/layout-editor/ops/DependencyDiagram.js +179 -0
- package/dist/shared/components/layout-editor/ops/LayoutOpsBlocks.js +92 -0
- package/dist/shared/components/layout-editor/ops/PromotePanel.js +287 -0
- package/dist/shared/components/layout-editor/ops/ops-api.js +122 -0
- package/dist/shared/components/layout-editor/outputs/OutputsButton.js +254 -0
- package/dist/shared/components/layout-editor/outputs/help-sheet.js +154 -0
- package/dist/shared/components/layout-editor/outputs/output-api.js +61 -0
- package/dist/shared/components/layout-editor/overview/OverviewActions.js +15 -3
- package/dist/shared/components/layout-editor/overview/describe-conditions.js +24 -14
- package/dist/shared/components/layout-editor/overview/overview-api.js +105 -88
- package/dist/shared/components/layout-editor/overview/purpose.js +15 -13
- package/dist/shared/components/layout-editor/panel-style.js +8 -7
- package/dist/shared/components/layout-editor/parity-keys.json.js +4 -0
- package/dist/shared/components/layout-editor/pin.js +25 -0
- package/dist/shared/components/layout-editor/presence.js +111 -0
- package/dist/shared/components/layout-editor/preview/PreviewModes.js +224 -0
- package/dist/shared/components/layout-editor/preview/PreviewPanes.js +262 -0
- package/dist/shared/components/layout-editor/preview/preview-api.js +57 -0
- package/dist/shared/components/layout-editor/preview/preview-model.js +157 -0
- package/dist/shared/components/layout-editor/restore-piece.js +192 -0
- package/dist/shared/components/layout-editor/reuse/FieldMapStep.js +70 -0
- package/dist/shared/components/layout-editor/reuse/FormMoreMenu.js +127 -0
- package/dist/shared/components/layout-editor/reuse/LibraryRows.js +150 -0
- package/dist/shared/components/layout-editor/reuse/NewFormStart.js +20 -0
- package/dist/shared/components/layout-editor/reuse/SectionReuseActions.js +291 -0
- package/dist/shared/components/layout-editor/reuse/field-match.js +77 -0
- package/dist/shared/components/layout-editor/reuse/reuse-api.js +73 -0
- package/dist/shared/components/layout-editor/reuse/seed.js +13 -0
- package/dist/shared/components/layout-editor/reuse/useFormFromRecord.js +43 -0
- package/dist/shared/components/layout-editor/reuse/useRailCopy.js +34 -0
- package/dist/shared/components/layout-editor/section-structure.js +241 -0
- package/dist/shared/components/layout-editor/settings/EntrySection.js +296 -0
- package/dist/shared/components/layout-editor/settings/FormSettings.js +125 -103
- package/dist/shared/components/layout-editor/settings/InheritanceSection.js +1 -1
- package/dist/shared/components/layout-editor/settings/ResolveSettings.js +255 -0
- package/dist/shared/components/layout-editor/settings/ToolsSection.js +215 -105
- package/dist/shared/components/layout-editor/settings/WhoSection.js +139 -100
- package/dist/shared/components/layout-editor/settings/controls.js +8 -8
- package/dist/shared/components/layout-editor/settings/settings-registry.js +142 -21
- package/dist/shared/components/layout-editor/shortcuts.js +88 -0
- package/dist/shared/components/layout-editor/show-when.js +35 -0
- package/dist/shared/components/layout-editor/slot-names.js +4 -3
- package/dist/shared/components/layout-editor/staged-api.js +64 -0
- package/dist/shared/components/layout-editor/structure-ops.js +403 -0
- package/dist/shared/components/layout-editor/testing/CostLimitSetting.js +42 -0
- package/dist/shared/components/layout-editor/testing/TestingPanels.js +556 -0
- package/dist/shared/components/layout-editor/testing/testing-api.js +67 -0
- package/dist/shared/components/layout-editor/testing/testing-model.js +406 -0
- package/dist/shared/components/layout-editor/testing/use-record-check.js +44 -0
- package/dist/shared/components/layout-editor/toolbar-kit.js +242 -0
- package/dist/shared/components/layout-editor/unsaved-marks.js +72 -0
- package/dist/shared/components/layout-editor/usage/AbTestSection.js +355 -0
- package/dist/shared/components/layout-editor/usage/FillChip.js +27 -0
- package/dist/shared/components/layout-editor/usage/UsagePanel.js +232 -0
- package/dist/shared/components/layout-editor/usage/ab-api.js +86 -0
- package/dist/shared/components/layout-editor/usage/suggest-collapse.js +32 -0
- package/dist/shared/components/layout-editor/usage/suggest-sections.js +55 -0
- package/dist/shared/components/layout-editor/usage/usage-api.js +104 -0
- package/dist/shared/components/layout-editor/useLayoutDraft.js +573 -306
- package/dist/shared/components/notifications/NotificationAnalyticsView.js +148 -77
- package/dist/shared/components/panels/ErpFailureBanner.js +18 -17
- package/dist/shared/components/panels/ExternalRequestsChip.js +63 -62
- package/dist/shared/components/pipeline/PipelineEditorView.js +106 -104
- package/dist/shared/components/profile/AgentsPanel.js +479 -0
- package/dist/shared/components/queue/QueueWorklist.js +1026 -1040
- package/dist/shared/components/support/SuggestFormChange.js +143 -0
- package/dist/shared/components/support/SupportAnalytics.js +171 -0
- package/dist/shared/components/support/SupportView.js +75 -73
- package/dist/shared/lib/ai-fill.js +37 -0
- package/dist/shared/lib/background-runs.js +150 -0
- package/dist/shared/lib/delivery-ack.js +9 -0
- package/dist/shared/lib/entry-badge-style.js +13 -0
- package/dist/shared/lib/entry-config.js +71 -0
- package/dist/shared/lib/form-sections.js +64 -0
- package/dist/shared/lib/form-structure.js +99 -0
- package/dist/shared/lib/form-usage-beacon.js +133 -0
- package/dist/shared/lib/jobs-tray.js +25 -23
- package/dist/shared/lib/keyset-pager.js +37 -0
- package/dist/shared/lib/layout-i18n.js +66 -0
- package/dist/shared/lib/layout-lint.js +490 -0
- package/dist/shared/lib/layout-ops.js +116 -110
- package/dist/shared/lib/layout-resolve.js +113 -0
- package/dist/shared/lib/placement-behaviour.js +144 -0
- package/dist/shared/lib/prefetch.js +149 -0
- package/dist/shared/lib/presence-hooks.js +199 -0
- package/dist/shared/lib/record-outbox.js +82 -81
- package/dist/shared/lib/replay-socket.js +93 -0
- package/dist/shared/lib/request-gate.js +51 -50
- package/dist/shared/lib/room-gaps.js +96 -0
- package/dist/shared/lib/screenshot.js +54 -28
- package/dist/shared/lib/search-log.js +27 -0
- package/dist/shared/lib/socket-realtime.js +101 -80
- package/dist/shared/lib/visible-when.js +34 -0
- package/dist/shared/lib/worker-socket.js +200 -0
- package/package.json +1 -1
|
@@ -1,53 +1,54 @@
|
|
|
1
1
|
import { endSessionRecording as $, appendSessionRecordingEvents as X, sessionRecordingEnabled as ce, startSessionRecording as T } from "@nivaro/sdk";
|
|
2
2
|
import { useRef as de, useEffect as fe } from "react";
|
|
3
|
-
import { sessionStore as pe, sharedChunkStore as
|
|
4
|
-
import { useAutoRecord as
|
|
5
|
-
import { useOptionalNivaroClient as
|
|
3
|
+
import { sessionStore as pe, sharedChunkStore as me, ReplayUploader as he, clearResume as P, ORPHAN_TTL_MS as we, readResume as ge, isResumable as ve, splitBySize as Z, writeResume as ye, KEEPALIVE_CHUNK_BYTES as be, CHUNK_BYTES as Re, backoffDelay as Se } from "./replayUploadQueue.js";
|
|
4
|
+
import { useAutoRecord as ke } from "./useAutoRecord.js";
|
|
5
|
+
import { useOptionalNivaroClient as Ee } from "../shared/context.js";
|
|
6
6
|
import { normalizeReplayMasking as B, buildReplayMaskingOptions as z } from "../shared/lib/replay-masking.js";
|
|
7
7
|
import { normalizeReplaySampling as x, replaySampleDraw as Ae, currentReplayRoute as _, isReplayRouteSampled as Y, attributeChunkRoutes as ee } from "../shared/lib/replay-sampling.js";
|
|
8
8
|
import { emitReplayTap as Ce, setReplayRecorderMode as N, registerReplayCapture as Ie, clipEndOffset as _e, withClipKind as De } from "../shared/lib/replay-capture.js";
|
|
9
9
|
import { instrumentConsole as qe, instrumentRequests as Le, redactSecrets as Te } from "../shared/lib/replay-context.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import { instrumentSocket as Pe } from "../shared/lib/replay-socket.js";
|
|
11
|
+
const Ne = "nivaro-react@0.2.55", j = 1e4, Me = 150, Oe = 3e3, Ue = 600, We = (n) => `nvr_replay_resume${n ? `:${n}` : ""}`, G = () => typeof navigator > "u" || navigator.onLine !== !1;
|
|
12
|
+
function Fe(n) {
|
|
13
|
+
return typeof n.url != "string" || typeof fetch != "function" ? null : (f, a) => {
|
|
14
|
+
const l = typeof n.getToken == "function" ? n.getToken() : void 0, d = { "Content-Type": "application/json" };
|
|
15
|
+
return l && (d.Authorization = `Bearer ${l}`), fetch(`${n.url}/api/session-recordings/${f}/events`, {
|
|
15
16
|
method: "POST",
|
|
16
17
|
keepalive: !0,
|
|
17
|
-
credentials:
|
|
18
|
-
headers:
|
|
19
|
-
body:
|
|
18
|
+
credentials: l ? "omit" : "include",
|
|
19
|
+
headers: d,
|
|
20
|
+
body: a
|
|
20
21
|
});
|
|
21
22
|
};
|
|
22
23
|
}
|
|
23
|
-
async function
|
|
24
|
-
var
|
|
25
|
-
const
|
|
26
|
-
for (const [e, y] of
|
|
27
|
-
const
|
|
24
|
+
async function He(n, f, a, l, d) {
|
|
25
|
+
var u;
|
|
26
|
+
const c = Z(l), { routes: R } = ee(c, d.startRoute);
|
|
27
|
+
for (const [e, y] of c.entries()) {
|
|
28
|
+
const h = a();
|
|
28
29
|
try {
|
|
29
30
|
await n.request(
|
|
30
|
-
X(
|
|
31
|
+
X(f, h, y, {
|
|
31
32
|
route: R[e],
|
|
32
|
-
...
|
|
33
|
+
...d.build ? { build: d.build } : {}
|
|
33
34
|
})
|
|
34
35
|
);
|
|
35
|
-
} catch (
|
|
36
|
-
const b =
|
|
36
|
+
} catch (v) {
|
|
37
|
+
const b = v.status ?? ((u = v.response) == null ? void 0 : u.status);
|
|
37
38
|
if (b === 409) return "closed";
|
|
38
|
-
b === 413 && console.warn(`[session-recorder] chunk ${
|
|
39
|
+
b === 413 && console.warn(`[session-recorder] chunk ${h} too large — dropped`);
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
return "ok";
|
|
42
43
|
}
|
|
43
|
-
const
|
|
44
|
-
let J = !1,
|
|
45
|
-
async function
|
|
46
|
-
if (!
|
|
44
|
+
const Ke = 3e4, $e = 3e4;
|
|
45
|
+
let J = !1, g = null, k = null;
|
|
46
|
+
async function Be(n = "error") {
|
|
47
|
+
if (!k) return null;
|
|
47
48
|
try {
|
|
48
49
|
return await Promise.race([
|
|
49
|
-
|
|
50
|
-
new Promise((
|
|
50
|
+
k(n),
|
|
51
|
+
new Promise((f) => setTimeout(() => f(null), 4e3))
|
|
51
52
|
]);
|
|
52
53
|
} catch {
|
|
53
54
|
return null;
|
|
@@ -62,27 +63,27 @@ async function Q() {
|
|
|
62
63
|
)), null;
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
function V(n,
|
|
66
|
-
const
|
|
67
|
-
|
|
66
|
+
function V(n, f) {
|
|
67
|
+
const a = qe(n), l = Le(n), d = Pe(n), c = () => {
|
|
68
|
+
f == null || f();
|
|
68
69
|
try {
|
|
69
70
|
n("route", {
|
|
70
71
|
path: Te(window.location.pathname + window.location.search)
|
|
71
72
|
});
|
|
72
73
|
} catch {
|
|
73
74
|
}
|
|
74
|
-
},
|
|
75
|
-
return history.pushState = (...
|
|
76
|
-
|
|
77
|
-
}, history.replaceState = (...
|
|
78
|
-
|
|
79
|
-
}, window.addEventListener("popstate",
|
|
80
|
-
|
|
75
|
+
}, R = history.pushState.bind(history), u = history.replaceState.bind(history);
|
|
76
|
+
return history.pushState = (...e) => {
|
|
77
|
+
R(...e), c();
|
|
78
|
+
}, history.replaceState = (...e) => {
|
|
79
|
+
u(...e), c();
|
|
80
|
+
}, window.addEventListener("popstate", c), c(), () => {
|
|
81
|
+
a(), l(), d(), history.pushState = R, history.replaceState = u, window.removeEventListener("popstate", c);
|
|
81
82
|
};
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
const
|
|
85
|
-
|
|
84
|
+
function et(n = {}) {
|
|
85
|
+
const f = Ee(), a = n.client ?? f, l = n.app, d = n.disabled ?? !1, c = n.build ?? Ne;
|
|
86
|
+
ke({ client: a, disabled: d });
|
|
86
87
|
const R = de({
|
|
87
88
|
buffer: [],
|
|
88
89
|
stop: null,
|
|
@@ -100,22 +101,22 @@ function Xe(n = {}) {
|
|
|
100
101
|
sampled: !0
|
|
101
102
|
});
|
|
102
103
|
fe(() => {
|
|
103
|
-
if (!
|
|
104
|
-
let
|
|
104
|
+
if (!a || d || typeof window > "u") return;
|
|
105
|
+
let u = !1;
|
|
105
106
|
const e = R.current;
|
|
106
107
|
e.dead = !1;
|
|
107
|
-
const y =
|
|
108
|
-
if (!
|
|
108
|
+
const y = a, h = pe(), v = We(l), b = me(), E = Fe(y), te = async (t, r, i, m, s = {}) => {
|
|
109
|
+
if (!m || !E) {
|
|
109
110
|
await y.request(X(t, r, i, s));
|
|
110
111
|
return;
|
|
111
112
|
}
|
|
112
|
-
const
|
|
113
|
-
if (!
|
|
114
|
-
}, o = new
|
|
113
|
+
const p = await E(t, JSON.stringify({ seq: r, events: i, ...s }));
|
|
114
|
+
if (!p.ok) throw Object.assign(new Error(`HTTP ${p.status}`), { status: p.status });
|
|
115
|
+
}, o = new he({ store: b, send: te, online: G });
|
|
115
116
|
let S = null, A = 0;
|
|
116
|
-
const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >=
|
|
117
|
+
const re = () => document.readyState === "complete" && Date.now() - e.lastNavAt >= Oe;
|
|
117
118
|
function C() {
|
|
118
|
-
o.recordingId && ye(
|
|
119
|
+
o.recordingId && ye(h, v, {
|
|
119
120
|
recordingId: o.recordingId,
|
|
120
121
|
nextSeq: o.nextSeq,
|
|
121
122
|
startedAt: e.startedAt,
|
|
@@ -134,25 +135,25 @@ function Xe(n = {}) {
|
|
|
134
135
|
}
|
|
135
136
|
function M() {
|
|
136
137
|
var t;
|
|
137
|
-
e.dead = !0, (t = e.stop) == null || t.call(e), I(), o.discard(), P(
|
|
138
|
+
e.dead = !0, (t = e.stop) == null || t.call(e), I(), o.discard(), P(h, v);
|
|
138
139
|
}
|
|
139
140
|
function O(t) {
|
|
140
141
|
if (e.buffer.length === 0 || !o.recordingId) return;
|
|
141
142
|
const r = e.buffer;
|
|
142
143
|
e.buffer = [];
|
|
143
|
-
const i = Z(r, t ? be : Re), { routes:
|
|
144
|
-
for (const [s,
|
|
145
|
-
o.enqueue(
|
|
144
|
+
const i = Z(r, t ? be : Re), { routes: m } = ee(i, e.bufferRoute);
|
|
145
|
+
for (const [s, p] of i.entries())
|
|
146
|
+
o.enqueue(p, { route: m[s], ...c ? { build: c } : {} });
|
|
146
147
|
C();
|
|
147
148
|
}
|
|
148
149
|
async function oe(t) {
|
|
149
|
-
if (!
|
|
150
|
+
if (!u) {
|
|
150
151
|
if (t === "retry") ne();
|
|
151
152
|
else if (t === "closed" || t === "abandoned") M();
|
|
152
153
|
else if (t === "stale")
|
|
153
154
|
try {
|
|
154
|
-
const r = await y.request(T(
|
|
155
|
-
if (
|
|
155
|
+
const r = await y.request(T(l));
|
|
156
|
+
if (u) return;
|
|
156
157
|
o.rebase(r.data.id), e.startedAt = Date.now(), C(), e.flushAfter = !0;
|
|
157
158
|
} catch {
|
|
158
159
|
M();
|
|
@@ -160,7 +161,7 @@ function Xe(n = {}) {
|
|
|
160
161
|
}
|
|
161
162
|
}
|
|
162
163
|
function w(t = !1, r = !1) {
|
|
163
|
-
return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length <
|
|
164
|
+
return e.inFlight ? (t && (e.flushAfter = !0), e.inFlight) : e.dead || !o.recordingId || !t && !re() && e.buffer.length < Ue || (O(r), !o.hasPending() || Date.now() < A) ? Promise.resolve() : (e.inFlight = o.drain(r).then(oe).catch(() => {
|
|
164
165
|
}).finally(() => {
|
|
165
166
|
e.inFlight = null, e.flushAfter && (e.flushAfter = !1, w(!0));
|
|
166
167
|
}), e.inFlight);
|
|
@@ -171,29 +172,29 @@ function Xe(n = {}) {
|
|
|
171
172
|
}
|
|
172
173
|
async function ie() {
|
|
173
174
|
const t = await Q();
|
|
174
|
-
if (
|
|
175
|
+
if (u || !t) return;
|
|
175
176
|
b.prune(Date.now() - we);
|
|
176
|
-
const r =
|
|
177
|
-
if (r &&
|
|
177
|
+
const r = ge(h, v);
|
|
178
|
+
if (r && ve(r, Date.now())) {
|
|
178
179
|
const s = await b.list(r.recordingId);
|
|
179
|
-
if (
|
|
180
|
+
if (u) return;
|
|
180
181
|
o.begin(r.recordingId, r.nextSeq, { trusted: !1, restored: s }), e.startedAt = r.startedAt;
|
|
181
182
|
} else {
|
|
182
|
-
r && (b.clear(r.recordingId), P(
|
|
183
|
-
const s = await y.request(T(
|
|
184
|
-
if (
|
|
183
|
+
r && (b.clear(r.recordingId), P(h, v));
|
|
184
|
+
const s = await y.request(T(l));
|
|
185
|
+
if (u) return;
|
|
185
186
|
o.begin(s.data.id), e.startedAt = Date.now();
|
|
186
187
|
}
|
|
187
188
|
C(), e.lastNavAt = Date.now();
|
|
188
|
-
const i = Ae(
|
|
189
|
+
const i = Ae(h);
|
|
189
190
|
e.route = _(), e.bufferRoute = e.route, e.sampled = Y(q, e.route, i);
|
|
190
|
-
const
|
|
191
|
-
var
|
|
191
|
+
const m = () => {
|
|
192
|
+
var p;
|
|
192
193
|
e.route = _();
|
|
193
194
|
const s = e.sampled;
|
|
194
195
|
if (e.sampled = Y(q, e.route, i), e.sampled && !s)
|
|
195
196
|
try {
|
|
196
|
-
(
|
|
197
|
+
(p = t.takeFullSnapshot) == null || p.call(
|
|
197
198
|
t,
|
|
198
199
|
!0
|
|
199
200
|
);
|
|
@@ -202,24 +203,24 @@ function Xe(n = {}) {
|
|
|
202
203
|
};
|
|
203
204
|
e.stop = t({
|
|
204
205
|
emit(s) {
|
|
205
|
-
e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >=
|
|
206
|
+
e.sampled && (e.buffer.length === 0 && (e.bufferRoute = e.route), e.buffer.push(s), e.buffer.length >= Me && U());
|
|
206
207
|
},
|
|
207
208
|
...z(() => D),
|
|
208
209
|
checkoutEveryNms: 6e4
|
|
209
210
|
}) ?? null, e.uninstrument = V(
|
|
210
|
-
(s,
|
|
211
|
+
(s, p) => t.addCustomEvent(
|
|
211
212
|
s,
|
|
212
|
-
|
|
213
|
+
p
|
|
213
214
|
),
|
|
214
215
|
() => {
|
|
215
|
-
e.lastNavAt = Date.now(),
|
|
216
|
+
e.lastNavAt = Date.now(), m();
|
|
216
217
|
}
|
|
217
|
-
),
|
|
218
|
+
), k = async () => {
|
|
218
219
|
if (!o.recordingId) return null;
|
|
219
220
|
const s = Date.now() - e.startedAt;
|
|
220
221
|
return await w(!0).catch(() => {
|
|
221
222
|
}), o.recordingId ? { recording_id: o.recordingId, offset_ms: s } : null;
|
|
222
|
-
}, N("full"),
|
|
223
|
+
}, N("full"), g = () => {
|
|
223
224
|
if (!o.recordingId) return null;
|
|
224
225
|
const s = Date.now() - e.startedAt;
|
|
225
226
|
return async () => (await w(!0).catch(() => {
|
|
@@ -228,12 +229,12 @@ function Xe(n = {}) {
|
|
|
228
229
|
}
|
|
229
230
|
async function se() {
|
|
230
231
|
const t = await Q();
|
|
231
|
-
|
|
232
|
+
u || !t || (e.buffer = [], e.prevWindow = [], e.route = _(), e.bufferRoute = e.route, e.prevWindowRoute = e.route, e.stop = t({
|
|
232
233
|
emit(r, i) {
|
|
233
234
|
Ce(r), i ? (e.prevWindow = e.buffer, e.prevWindowRoute = e.bufferRoute, e.buffer = [r], e.bufferRoute = e.route) : e.buffer.push(r);
|
|
234
235
|
},
|
|
235
236
|
...z(() => D),
|
|
236
|
-
checkoutEveryNms:
|
|
237
|
+
checkoutEveryNms: Ke
|
|
237
238
|
}) ?? null, e.uninstrument = V(
|
|
238
239
|
(r, i) => t.addCustomEvent(
|
|
239
240
|
r,
|
|
@@ -242,35 +243,35 @@ function Xe(n = {}) {
|
|
|
242
243
|
() => {
|
|
243
244
|
e.route = _();
|
|
244
245
|
}
|
|
245
|
-
), N("clip"),
|
|
246
|
-
const i = [...e.prevWindow, ...e.buffer],
|
|
247
|
-
if (i.length === 0 || !
|
|
246
|
+
), N("clip"), g = (r) => {
|
|
247
|
+
const i = [...e.prevWindow, ...e.buffer], m = e.prevWindow.length > 0 ? e.prevWindowRoute : e.bufferRoute;
|
|
248
|
+
if (i.length === 0 || !a) return null;
|
|
248
249
|
const s = _e(i, r);
|
|
249
250
|
return async () => {
|
|
250
|
-
const L = (await
|
|
251
|
-
De(T(
|
|
251
|
+
const L = (await a.request(
|
|
252
|
+
De(T(l ?? "error-clip", void 0, !0), r)
|
|
252
253
|
)).data.id;
|
|
253
254
|
let le = 0;
|
|
254
|
-
return await
|
|
255
|
+
return await He(a, L, () => le++, i, { startRoute: m, build: c }), await a.request($(L)).catch(() => {
|
|
255
256
|
}), { recording_id: L, offset_ms: s };
|
|
256
257
|
};
|
|
257
|
-
},
|
|
258
|
+
}, k = async (r) => {
|
|
258
259
|
if (r === "error") {
|
|
259
|
-
if (e.lastClip && Date.now() - e.lastClip.at <
|
|
260
|
+
if (e.lastClip && Date.now() - e.lastClip.at < $e)
|
|
260
261
|
return e.lastClip.link;
|
|
261
262
|
e.lastClip = { at: Date.now(), link: null };
|
|
262
263
|
}
|
|
263
|
-
const i =
|
|
264
|
+
const i = g == null ? void 0 : g(r);
|
|
264
265
|
if (!i) return null;
|
|
265
|
-
const
|
|
266
|
-
return r === "error" && (e.lastClip = { at: Date.now(), link:
|
|
266
|
+
const m = await i();
|
|
267
|
+
return r === "error" && (e.lastClip = { at: Date.now(), link: m }), m;
|
|
267
268
|
});
|
|
268
269
|
}
|
|
269
270
|
let W = !1, D = B(null), q = x(null);
|
|
270
271
|
async function ae() {
|
|
271
272
|
try {
|
|
272
|
-
const t = await
|
|
273
|
-
if (
|
|
273
|
+
const t = await a.request(ce());
|
|
274
|
+
if (u) return;
|
|
274
275
|
D = B(t.data.masking), q = x(t.data.sampling);
|
|
275
276
|
const r = t.data.cap_reached === !0;
|
|
276
277
|
W = t.data.enabled === !0 && !r;
|
|
@@ -285,10 +286,10 @@ function Xe(n = {}) {
|
|
|
285
286
|
};
|
|
286
287
|
document.addEventListener("visibilitychange", F);
|
|
287
288
|
const H = () => {
|
|
288
|
-
if (!(e.dead || !o.recordingId) && (O(!0), C(), !(!G() || !
|
|
289
|
+
if (!(e.dead || !o.recordingId) && (O(!0), C(), !(!G() || !E)))
|
|
289
290
|
for (const { chunk: t, body: r } of o.keepaliveBatch())
|
|
290
291
|
try {
|
|
291
|
-
|
|
292
|
+
E(t.recordingId, r).catch(() => {
|
|
292
293
|
});
|
|
293
294
|
} catch {
|
|
294
295
|
}
|
|
@@ -299,19 +300,19 @@ function Xe(n = {}) {
|
|
|
299
300
|
};
|
|
300
301
|
return window.addEventListener("online", K), () => {
|
|
301
302
|
var t, r;
|
|
302
|
-
|
|
303
|
+
u = !0, k = null, g = null, N(null), document.removeEventListener("visibilitychange", F), window.removeEventListener("pagehide", H), window.removeEventListener("online", K), clearInterval(ue), I(), (t = e.uninstrument) == null || t.call(e), e.uninstrument = null, (r = e.stop) == null || r.call(e), e.stop = null, e.prevWindow = [], w(!0).then(() => {
|
|
303
304
|
const i = o.recordingId;
|
|
304
305
|
i && (e.dead || y.request($(i)).catch(() => {
|
|
305
|
-
}), o.discard(), o.recordingId = null, P(
|
|
306
|
+
}), o.discard(), o.recordingId = null, P(h, v));
|
|
306
307
|
});
|
|
307
308
|
};
|
|
308
|
-
}, [
|
|
309
|
+
}, [a, d, l, c]);
|
|
309
310
|
}
|
|
310
311
|
Ie(
|
|
311
|
-
(n) =>
|
|
312
|
-
(n) => (
|
|
312
|
+
(n) => Be(n),
|
|
313
|
+
(n) => (g == null ? void 0 : g(n)) ?? null
|
|
313
314
|
);
|
|
314
315
|
export {
|
|
315
|
-
|
|
316
|
-
|
|
316
|
+
Be as captureErrorClip,
|
|
317
|
+
et as useSessionRecorder
|
|
317
318
|
};
|