@scalebun/web 1.0.0 → 1.2.2
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/bootstrap/SDKBootstrapper.d.ts +6 -6
- package/dist/bootstrap/SDKBootstrapper.js +8 -8
- package/dist/browser.d.ts +1 -1
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +8 -6
- package/dist/browser.js.map +1 -1
- package/dist/config/endpoints.d.ts +12 -0
- package/dist/config/endpoints.d.ts.map +1 -0
- package/dist/config/endpoints.js +12 -0
- package/dist/config/endpoints.js.map +1 -0
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +5 -3
- package/dist/config/schema.js.map +1 -1
- package/dist/core/breadcrumbs.js +1 -1
- package/dist/core/index.d.ts +13 -13
- package/dist/core/index.js +13 -13
- package/dist/core/observe.js +1 -1
- package/dist/core/pageContext.d.ts +1 -1
- package/dist/features/analytics/AnalyticsFeature.d.ts +2 -2
- package/dist/features/analytics/AnalyticsFeature.js +10 -10
- package/dist/features/analytics/autocapture.js +4 -4
- package/dist/features/analytics/sampler.js +1 -1
- package/dist/features/bugreport/BugReportFeature.d.ts +1 -1
- package/dist/features/bugreport/BugReportFeature.js +1 -1
- package/dist/features/bugreport/collect.js +1 -1
- package/dist/features/bugreport/widget.js +9 -9
- package/dist/features/coach/CoachmarkFeature.d.ts +1 -1
- package/dist/features/coach/CoachmarkFeature.js +5 -5
- package/dist/features/coach/anchor.d.ts +1 -1
- package/dist/features/coach/overlay.d.ts +1 -1
- package/dist/features/coach/overlay.js +21 -21
- package/dist/features/coach/position.d.ts +1 -1
- package/dist/features/coach/predicate.d.ts +1 -1
- package/dist/features/coach/tour.d.ts +4 -4
- package/dist/features/coach/tour.js +1 -1
- package/dist/features/coach/types.d.ts +1 -1
- package/dist/features/coach/wait.d.ts +2 -2
- package/dist/features/config/ConfigFeature.d.ts +1 -1
- package/dist/features/config/ConfigFeature.js +5 -5
- package/dist/features/config/configStore.d.ts +1 -1
- package/dist/features/config/targeting.d.ts +1 -1
- package/dist/features/console/ConsoleFeature.js +3 -3
- package/dist/features/console/normalize.js +2 -2
- package/dist/features/console/throttle.d.ts +1 -1
- package/dist/features/crash/CrashFeature.js +2 -2
- package/dist/features/engage/EngageFeature.d.ts +3 -3
- package/dist/features/engage/EngageFeature.js +5 -5
- package/dist/features/engage/attachments.d.ts +1 -1
- package/dist/features/engage/attachments.js +3 -3
- package/dist/features/engage/gameLogic.d.ts +1 -1
- package/dist/features/engage/gameResolver.d.ts +2 -2
- package/dist/features/engage/gameResolver.js +1 -1
- package/dist/features/engage/inappSlots.d.ts +1 -1
- package/dist/features/engage/inappSlots.js +1 -1
- package/dist/features/engage/normalize.d.ts +1 -1
- package/dist/features/engage/richInApp.d.ts +3 -3
- package/dist/features/engage/richInApp.js +6 -6
- package/dist/features/engage/runtime.d.ts +3 -3
- package/dist/features/engage/runtime.js +7 -7
- package/dist/features/engage/shakeDetector.js +1 -1
- package/dist/features/engage/throttle.d.ts +1 -1
- package/dist/features/engage/transport.d.ts +1 -1
- package/dist/features/engage/transport.js +1 -1
- package/dist/features/engage/triggerEngine.d.ts +1 -1
- package/dist/features/engage/widget/InAppWidget.d.ts +1 -1
- package/dist/features/engage/widget/InAppWidget.js +18 -18
- package/dist/features/engage/widget/SurveyWidget.d.ts +1 -1
- package/dist/features/engage/widget/SurveyWidget.js +66 -66
- package/dist/features/errors/ErrorsFeature.d.ts +1 -1
- package/dist/features/errors/ErrorsFeature.js +6 -6
- package/dist/features/errors/group/fingerprint.js +1 -1
- package/dist/features/errors/lazy.d.ts +3 -3
- package/dist/features/errors/lazy.js +3 -3
- package/dist/features/errors/normalize.d.ts +2 -2
- package/dist/features/errors/normalize.js +2 -2
- package/dist/features/errors/redact.js +1 -1
- package/dist/features/errors/sampling.js +1 -1
- package/dist/features/exit-intent/ExitIntentFeature.js +1 -1
- package/dist/features/exit-intent/engine.js +1 -1
- package/dist/features/forms/index.js +1 -1
- package/dist/features/inapp/InApp2Feature.js +1 -1
- package/dist/features/inapp/anchor/controller.d.ts +2 -2
- package/dist/features/inapp/anchor/controller.js +3 -3
- package/dist/features/inapp/api.d.ts +5 -5
- package/dist/features/inapp/api.js +3 -3
- package/dist/features/inapp/blocks/blocks.d.ts +1 -1
- package/dist/features/inapp/blocks/blocks.js +1 -1
- package/dist/features/inapp/blocks/feedback.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/carousel.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/chart.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/code.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/confetti.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/countdown.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/index.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/index.js +18 -18
- package/dist/features/inapp/blocks/heavy/markdown.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/productgrid.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/qr.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/scratch.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/scratch.js +1 -1
- package/dist/features/inapp/blocks/heavy/slot.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/slot.js +1 -1
- package/dist/features/inapp/blocks/heavy/spinwheel.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/spinwheel.js +1 -1
- package/dist/features/inapp/blocks/heavy/steps.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/streak.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/table.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/unavailable.d.ts +1 -1
- package/dist/features/inapp/blocks/heavy/video.d.ts +1 -1
- package/dist/features/inapp/blocks/styles.js +191 -191
- package/dist/features/inapp/center/bridge.d.ts +3 -3
- package/dist/features/inapp/center/bridge.js +1 -1
- package/dist/features/inapp/center/panel.d.ts +2 -2
- package/dist/features/inapp/center/panel.js +33 -33
- package/dist/features/inapp/center/store.d.ts +1 -1
- package/dist/features/inapp/center/sync.d.ts +1 -1
- package/dist/features/inapp/center/types.d.ts +1 -1
- package/dist/features/inapp/core/analytics.d.ts +3 -3
- package/dist/features/inapp/core/analytics.js +1 -1
- package/dist/features/inapp/core/compat.d.ts +2 -2
- package/dist/features/inapp/core/debugOverlay.d.ts +2 -2
- package/dist/features/inapp/core/debugOverlay.js +12 -12
- package/dist/features/inapp/core/engine.d.ts +3 -3
- package/dist/features/inapp/core/engine.js +10 -10
- package/dist/features/inapp/core/host.js +22 -22
- package/dist/features/inapp/core/metrics.d.ts +1 -1
- package/dist/features/inapp/core/migration.d.ts +2 -2
- package/dist/features/inapp/core/migration.js +2 -2
- package/dist/features/inapp/core/orchestrator.d.ts +1 -1
- package/dist/features/inapp/core/respect.d.ts +1 -1
- package/dist/features/inapp/core/targeting.d.ts +1 -1
- package/dist/features/inapp/core/targeting.js +1 -1
- package/dist/features/inapp/core/triggers.d.ts +1 -1
- package/dist/features/inapp/core/triggers.js +2 -2
- package/dist/features/inapp/inappContract.web.d.ts +1 -1
- package/dist/features/inapp/index.d.ts +15 -15
- package/dist/features/inapp/index.js +10 -10
- package/dist/features/inapp/registry.web.canonical.d.ts +1 -1
- package/dist/features/inapp/registry.web.catalog.d.ts +1 -1
- package/dist/features/inapp/surfaces/banner.d.ts +1 -1
- package/dist/features/inapp/surfaces/banner.js +1 -1
- package/dist/features/inapp/surfaces/checklist.d.ts +1 -1
- package/dist/features/inapp/surfaces/coachmark.d.ts +1 -1
- package/dist/features/inapp/surfaces/coachmark.js +2 -2
- package/dist/features/inapp/surfaces/hotspot.d.ts +1 -1
- package/dist/features/inapp/surfaces/hotspot.js +2 -2
- package/dist/features/inapp/surfaces/inline.d.ts +4 -4
- package/dist/features/inapp/surfaces/inline.js +11 -11
- package/dist/features/inapp/surfaces/launcher.d.ts +1 -1
- package/dist/features/inapp/surfaces/modal.d.ts +1 -1
- package/dist/features/inapp/surfaces/modal.js +2 -2
- package/dist/features/inapp/surfaces/mount.d.ts +4 -4
- package/dist/features/inapp/surfaces/mount.js +4 -4
- package/dist/features/inapp/surfaces/palette.d.ts +1 -1
- package/dist/features/inapp/surfaces/palette.js +1 -1
- package/dist/features/inapp/surfaces/panel.d.ts +1 -1
- package/dist/features/inapp/surfaces/popover.d.ts +1 -1
- package/dist/features/inapp/surfaces/popover.js +2 -2
- package/dist/features/inapp/surfaces/render.d.ts +4 -4
- package/dist/features/inapp/surfaces/render.d.ts.map +1 -1
- package/dist/features/inapp/surfaces/render.js +23 -19
- package/dist/features/inapp/surfaces/render.js.map +1 -1
- package/dist/features/inapp/surfaces/slideover.d.ts +1 -1
- package/dist/features/inapp/surfaces/slideover.js +1 -1
- package/dist/features/inapp/surfaces/styles.js +179 -179
- package/dist/features/inapp/surfaces/surface.d.ts +4 -4
- package/dist/features/inapp/surfaces/surface.js +2 -2
- package/dist/features/inapp/surfaces/takeover.d.ts +1 -1
- package/dist/features/inapp/surfaces/takeover.js +2 -2
- package/dist/features/inapp/surfaces/toast.d.ts +1 -1
- package/dist/features/inapp/surfaces/toast.js +1 -1
- package/dist/features/inapp/surfaces/toolbar.d.ts +1 -1
- package/dist/features/inapp/surfaces/toolbar.js +2 -2
- package/dist/features/inapp/surfaces/tour.d.ts +1 -1
- package/dist/features/inapp/surfaces/tour.js +5 -5
- package/dist/features/inbox/InboxFeature.d.ts +1 -1
- package/dist/features/inbox/InboxFeature.js +5 -5
- package/dist/features/inbox/runtime.d.ts +2 -2
- package/dist/features/inbox/runtime.js +3 -3
- package/dist/features/inbox/store.d.ts +1 -1
- package/dist/features/inbox/sync.d.ts +2 -2
- package/dist/features/inbox/sync.js +1 -1
- package/dist/features/inbox/widget/InboxWidget.d.ts +1 -1
- package/dist/features/inbox/widget/InboxWidget.js +85 -85
- package/dist/features/journey/InteractionTracker.js +1 -1
- package/dist/features/journey/JourneyFeature.js +3 -3
- package/dist/features/manifest.d.ts +1 -1
- package/dist/features/manifest.js +18 -18
- package/dist/features/network/NetworkFeature.d.ts +1 -1
- package/dist/features/network/NetworkFeature.js +10 -10
- package/dist/features/network/capture/body.d.ts +1 -1
- package/dist/features/network/capture/body.js +1 -1
- package/dist/features/network/classify.d.ts +1 -1
- package/dist/features/network/fetchInterceptor.d.ts +1 -1
- package/dist/features/network/fetchInterceptor.js +1 -1
- package/dist/features/network/intercept/beacon.d.ts +1 -1
- package/dist/features/network/intercept/sse.d.ts +1 -1
- package/dist/features/network/intercept/streams.d.ts +4 -4
- package/dist/features/network/intercept/streams.js +3 -3
- package/dist/features/network/intercept/websocket.d.ts +1 -1
- package/dist/features/network/lazy.d.ts +3 -3
- package/dist/features/network/lazy.js +2 -2
- package/dist/features/network/normalize.d.ts +1 -1
- package/dist/features/network/normalize.js +3 -3
- package/dist/features/network/parse/graphql.d.ts +1 -1
- package/dist/features/network/sampler.js +1 -1
- package/dist/features/network/timing.d.ts +1 -1
- package/dist/features/network/xhrInterceptor.d.ts +1 -1
- package/dist/features/network/xhrInterceptor.js +1 -1
- package/dist/features/performance/PerformanceFeature.d.ts +2 -2
- package/dist/features/performance/PerformanceFeature.js +11 -11
- package/dist/features/performance/longTasks.js +1 -1
- package/dist/features/performance/normalize.js +1 -1
- package/dist/features/performance/sampler.js +1 -1
- package/dist/features/performance/trace/index.d.ts +4 -4
- package/dist/features/performance/trace/index.js +3 -3
- package/dist/features/performance/trace/pageload.d.ts +1 -1
- package/dist/features/performance/trace/pageload.js +1 -1
- package/dist/features/performance/trace/transaction.d.ts +2 -2
- package/dist/features/performance/trace/transaction.js +2 -2
- package/dist/features/profiler/ProfilerFeature.js +1 -1
- package/dist/features/push/PushFeature.d.ts +4 -4
- package/dist/features/push/PushFeature.js +3 -3
- package/dist/features/push/softAsk.d.ts +1 -1
- package/dist/features/push/softAsk.js +26 -26
- package/dist/features/replay/ReplayFeature.d.ts +1 -1
- package/dist/features/replay/ReplayFeature.js +12 -12
- package/dist/features/replay/engine/canvas.d.ts +2 -2
- package/dist/features/replay/engine/crossOrigin.d.ts +1 -1
- package/dist/features/replay/engine/crossOrigin.js +3 -3
- package/dist/features/replay/engine/cssom.d.ts +2 -2
- package/dist/features/replay/engine/iframe.d.ts +2 -2
- package/dist/features/replay/engine/iframe.js +3 -3
- package/dist/features/replay/engine/interactions.d.ts +1 -1
- package/dist/features/replay/engine/interactions.js +1 -1
- package/dist/features/replay/engine/mutations.d.ts +3 -3
- package/dist/features/replay/engine/mutations.js +2 -2
- package/dist/features/replay/engine/player.d.ts +2 -2
- package/dist/features/replay/engine/player.js +1 -1
- package/dist/features/replay/engine/rebuild.d.ts +1 -1
- package/dist/features/replay/engine/replayWorker.js +16 -16
- package/dist/features/replay/engine/resources.d.ts +1 -1
- package/dist/features/replay/engine/resources.js +1 -1
- package/dist/features/replay/engine/snapshot.d.ts +2 -2
- package/dist/features/replay/engine/snapshot.js +1 -1
- package/dist/features/replay/engine/traverse.d.ts +1 -1
- package/dist/features/replay/lifecycle/recorder.d.ts +1 -1
- package/dist/features/replay/lifecycle/recorder.js +20 -20
- package/dist/features/replay/lifecycle/sampling.js +1 -1
- package/dist/features/replay/lifecycle/viewContext.js +1 -1
- package/dist/features/scroll/index.js +1 -1
- package/dist/features/session/sessionManager.d.ts +1 -1
- package/dist/features/session/sessionManager.js +2 -2
- package/dist/features/session/sessionStore.js +1 -1
- package/dist/features/watchdog/WatchdogFeature.d.ts +1 -1
- package/dist/features/watchdog/WatchdogFeature.js +1 -1
- package/dist/features/watchdog/collectors.d.ts +1 -1
- package/dist/features/watchdog/collectors.js +1 -1
- package/dist/features/watchdog/engine.js +8 -8
- package/dist/features/watchdog/incidents.d.ts +1 -1
- package/dist/features/watchdog/incidents.js +1 -1
- package/dist/features/watchdog/rollup.d.ts +1 -1
- package/dist/features/watchdog/rollup.js +1 -1
- package/dist/features/webVitals/WebVitalsFeature.js +4 -4
- package/dist/features/webVitals/observe.d.ts +1 -1
- package/dist/features/webVitals/observe.js +1 -1
- package/dist/features/webperf/WebPerfFeature.d.ts +1 -1
- package/dist/features/webperf/WebPerfFeature.js +3 -3
- package/dist/features/webperf/collectors.js +1 -1
- package/dist/inapp.d.ts +1 -1
- package/dist/inapp.js +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +1 -1
- package/dist/pipeline/index.d.ts +1 -1
- package/dist/pipeline/index.js +1 -1
- package/dist/pipeline/pipeline.d.ts +3 -3
- package/dist/pipeline/pipeline.js +4 -4
- package/dist/public/ScaleBunFacade.d.ts +18 -18
- package/dist/public/ScaleBunFacade.js +11 -11
- package/dist/public/index.d.ts +4 -4
- package/dist/public/index.js +2 -2
- package/dist/scalebun-push-sw.js +236 -236
- package/dist/scalebun.min.js +17 -17
- package/dist/scalebun.min.js.map +4 -4
- package/dist/storage/index.d.ts +1 -1
- package/dist/storage/index.js +1 -1
- package/dist/transport/httpClient.d.ts +1 -1
- package/dist/transport/httpClient.js +3 -3
- package/dist/transport/index.d.ts +1 -1
- package/dist/transport/index.js +1 -1
- package/package.json +7 -7
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Bodies/headers are not read in v1. Self-excludes the SDK's own traffic. `target` is injectable
|
|
4
4
|
* for testability.
|
|
5
5
|
*/
|
|
6
|
-
import { requestBodyBytes, contentLengthBytes, utf8ByteLength, perfNow } from './size';
|
|
6
|
+
import { requestBodyBytes, contentLengthBytes, utf8ByteLength, perfNow } from './size.js';
|
|
7
7
|
export function installXhr(target, onRecord, isOwnUrl, injectTrace) {
|
|
8
8
|
const XHR = target.XMLHttpRequest;
|
|
9
9
|
if (typeof XHR !== 'function')
|
|
@@ -21,8 +21,8 @@ export interface PerfStats {
|
|
|
21
21
|
/** effective transaction sample rate */
|
|
22
22
|
sampleRate: number;
|
|
23
23
|
}
|
|
24
|
-
import { type TransactionHandle } from './trace/types';
|
|
25
|
-
import type { TraceContext } from './trace';
|
|
24
|
+
import { type TransactionHandle } from './trace/types.js';
|
|
25
|
+
import type { TraceContext } from './trace/index.js';
|
|
26
26
|
export declare class PerformanceFeature implements IFeature {
|
|
27
27
|
readonly name = "performance";
|
|
28
28
|
private ctx;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { safeObserve, getReplayCoord } from '../../core';
|
|
2
|
-
import { publishJank } from './jankTap';
|
|
3
|
-
import { toPerfItem } from './normalize';
|
|
4
|
-
import { RateCap } from './throttle';
|
|
5
|
-
import { TraceRegistry } from './traces';
|
|
6
|
-
import { longTaskReading, loafReading } from './longTasks';
|
|
7
|
-
import { resourceTiming, setSelfEndpoint } from './resources';
|
|
8
|
-
import { installSpaRoutes } from './spa';
|
|
9
|
-
import { keepTransaction } from './sampler';
|
|
10
|
-
import { NOOP_TXN } from './trace/types';
|
|
1
|
+
import { safeObserve, getReplayCoord } from '../../core/index.js';
|
|
2
|
+
import { publishJank } from './jankTap.js';
|
|
3
|
+
import { toPerfItem } from './normalize.js';
|
|
4
|
+
import { RateCap } from './throttle.js';
|
|
5
|
+
import { TraceRegistry } from './traces.js';
|
|
6
|
+
import { longTaskReading, loafReading } from './longTasks.js';
|
|
7
|
+
import { resourceTiming, setSelfEndpoint } from './resources.js';
|
|
8
|
+
import { installSpaRoutes } from './spa.js';
|
|
9
|
+
import { keepTransaction } from './sampler.js';
|
|
10
|
+
import { NOOP_TXN } from './trace/types.js';
|
|
11
11
|
/** SPA route transaction settles this long after the last route change (initial render/data-load). */
|
|
12
12
|
const ROUTE_SETTLE_MS = 1000;
|
|
13
13
|
const DEFAULT_SLOW_TXN_MS = 3000;
|
|
@@ -60,7 +60,7 @@ export class PerformanceFeature {
|
|
|
60
60
|
this.slowTxnMs = opts.slowTransactionMs;
|
|
61
61
|
}
|
|
62
62
|
// Load the trace engine as a separate chunk now (at init), ready before the host opens a transaction.
|
|
63
|
-
void import('./trace')
|
|
63
|
+
void import('./trace/index.js')
|
|
64
64
|
.then((m) => {
|
|
65
65
|
this.engine = m;
|
|
66
66
|
this.tryEmitPageload(); // engine may resolve after the nav entry is grabbed
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* fields not on the base PerformanceEntry), so we take a loose shape and cast per field (as vitals.ts
|
|
5
5
|
* does). `scrubText` is applied to any URL/name strings by the caller (normalize) before emit.
|
|
6
6
|
*/
|
|
7
|
-
import { scrubText } from '../../core';
|
|
7
|
+
import { scrubText } from '../../core/index.js';
|
|
8
8
|
/** Long Task → its duration (ms) + start time. */
|
|
9
9
|
export function longTaskReading(entry) {
|
|
10
10
|
const e = entry;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Builds a contract `performance` Item from a trace / long-task / LoAF reading. Pure + shared. */
|
|
2
|
-
import { uuid, now, scrubText } from '../../core';
|
|
2
|
+
import { uuid, now, scrubText } from '../../core/index.js';
|
|
3
3
|
const currentScreen = () => {
|
|
4
4
|
try {
|
|
5
5
|
return typeof location !== 'undefined' ? location.pathname : undefined;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Net: high signal at low volume. fnv1a32 on the traceId (same hash family as flags/grouping) so the
|
|
5
5
|
* backend can re-derive the decision — no client trust.
|
|
6
6
|
*/
|
|
7
|
-
import { fnv1a32 } from '../config/bucketing';
|
|
7
|
+
import { fnv1a32 } from '../config/bucketing.js';
|
|
8
8
|
// NOTE: keeps the legacy `wzb-` prefix on purpose. This salt is a bucketing input, not
|
|
9
9
|
// branding — nobody ever sees it, and changing the string reshuffles which sessions are
|
|
10
10
|
// sampled. It was left untouched by the ScaleBun rebrand for that reason.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/** Lazy trace-engine barrel — Transaction/Span tree + W3C trace context. Loaded once at
|
|
2
2
|
* PerformanceFeature.setup so it stays out of the core bundle (mirrors the replay engine / errors). */
|
|
3
|
-
export { Transaction } from './transaction';
|
|
4
|
-
export type { TransactionData, SpanData, TransactionOptions } from './transaction';
|
|
5
|
-
export { newTraceId, newSpanId, formatTraceparent, parseTraceparent, type TraceContext } from './context';
|
|
6
|
-
export { buildPageload } from './pageload';
|
|
3
|
+
export { Transaction } from './transaction.js';
|
|
4
|
+
export type { TransactionData, SpanData, TransactionOptions } from './transaction.js';
|
|
5
|
+
export { newTraceId, newSpanId, formatTraceparent, parseTraceparent, type TraceContext } from './context.js';
|
|
6
|
+
export { buildPageload } from './pageload.js';
|
|
7
7
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/** Lazy trace-engine barrel — Transaction/Span tree + W3C trace context. Loaded once at
|
|
2
2
|
* PerformanceFeature.setup so it stays out of the core bundle (mirrors the replay engine / errors). */
|
|
3
|
-
export { Transaction } from './transaction';
|
|
4
|
-
export { newTraceId, newSpanId, formatTraceparent, parseTraceparent } from './context';
|
|
5
|
-
export { buildPageload } from './pageload';
|
|
3
|
+
export { Transaction } from './transaction.js';
|
|
4
|
+
export { newTraceId, newSpanId, formatTraceparent, parseTraceparent } from './context.js';
|
|
5
|
+
export { buildPageload } from './pageload.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* entry (the load already happened) — not live-timed — so each navigation phase becomes a child span
|
|
4
4
|
* with explicit start/end. Lazy chunk (uses trace-context id generation). Pure + testable.
|
|
5
5
|
*/
|
|
6
|
-
import { newTraceId, newSpanId } from './context';
|
|
6
|
+
import { newTraceId, newSpanId } from './context.js';
|
|
7
7
|
const r = (n) => Math.round(n);
|
|
8
8
|
export function buildPageload(nav, route) {
|
|
9
9
|
const traceId = newTraceId();
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* without a browser). Bounds cardinality: caps spans per transaction, drop-counts overflow (no silent
|
|
5
5
|
* caps), and is idempotent on finish. Lazy chunk.
|
|
6
6
|
*/
|
|
7
|
-
import { type TraceContext } from './context';
|
|
8
|
-
import { type SpanHandle, type TransactionHandle } from './types';
|
|
7
|
+
import { type TraceContext } from './context.js';
|
|
8
|
+
import { type SpanHandle, type TransactionHandle } from './types.js';
|
|
9
9
|
export interface SpanData {
|
|
10
10
|
spanId: string;
|
|
11
11
|
parentSpanId?: string;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* without a browser). Bounds cardinality: caps spans per transaction, drop-counts overflow (no silent
|
|
5
5
|
* caps), and is idempotent on finish. Lazy chunk.
|
|
6
6
|
*/
|
|
7
|
-
import { newTraceId, newSpanId } from './context';
|
|
8
|
-
import { NOOP_SPAN } from './types';
|
|
7
|
+
import { newTraceId, newSpanId } from './context.js';
|
|
8
|
+
import { NOOP_SPAN } from './types.js';
|
|
9
9
|
export class Transaction {
|
|
10
10
|
constructor(name, opts) {
|
|
11
11
|
this.name = name;
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
* only ServiceWorker / PushManager / Notification / atob — degrades to a no-op (never throws) when the
|
|
14
14
|
* browser lacks support or the user denied permission.
|
|
15
15
|
*/
|
|
16
|
-
import type { PushDiagnostics } from './diagnostics';
|
|
16
|
+
import type { PushDiagnostics } from './diagnostics.js';
|
|
17
17
|
/** SW contract version this SDK build expects. Bump in lockstep with WZB_SW_VERSION in
|
|
18
18
|
* public/scalebun-push-sw.js — push.check() compares them to catch a stale hand-copied worker. */
|
|
19
19
|
export declare const EXPECTED_SW_VERSION = 5;
|
|
20
20
|
/** Default path the host serves the worker at. Shared by enable() and check() so a diagnostic can
|
|
21
21
|
* never disagree with what was actually registered. */
|
|
22
22
|
export declare const DEFAULT_SW_URL = "/scalebun-push-sw.js";
|
|
23
|
-
export type { PushPermission, PushState } from './pushState';
|
|
24
|
-
export { PUSH_STATE_COPY, resolvePushState } from './pushState';
|
|
25
|
-
import { type PushPermission, type PushState } from './pushState';
|
|
23
|
+
export type { PushPermission, PushState } from './pushState.js';
|
|
24
|
+
export { PUSH_STATE_COPY, resolvePushState } from './pushState.js';
|
|
25
|
+
import { type PushPermission, type PushState } from './pushState.js';
|
|
26
26
|
export interface PushEnableOptions {
|
|
27
27
|
/** URL the host serves the SDK service worker at (same origin). Default `/scalebun-push-sw.js`. */
|
|
28
28
|
serviceWorkerUrl?: string;
|
|
@@ -19,8 +19,8 @@ export const EXPECTED_SW_VERSION = 5;
|
|
|
19
19
|
/** Default path the host serves the worker at. Shared by enable() and check() so a diagnostic can
|
|
20
20
|
* never disagree with what was actually registered. */
|
|
21
21
|
export const DEFAULT_SW_URL = '/scalebun-push-sw.js';
|
|
22
|
-
export { PUSH_STATE_COPY, resolvePushState } from './pushState';
|
|
23
|
-
import { resolvePushState } from './pushState';
|
|
22
|
+
export { PUSH_STATE_COPY, resolvePushState } from './pushState.js';
|
|
23
|
+
import { resolvePushState } from './pushState.js';
|
|
24
24
|
/** Feature-detect the three APIs Web Push needs. Any missing ⇒ we no-op. */
|
|
25
25
|
function isSupported() {
|
|
26
26
|
return (typeof navigator !== 'undefined' &&
|
|
@@ -184,7 +184,7 @@ export class PushFeature {
|
|
|
184
184
|
* do not download it.
|
|
185
185
|
*/
|
|
186
186
|
async check(opts = {}) {
|
|
187
|
-
const { runPushDiagnostics } = await import('./diagnostics');
|
|
187
|
+
const { runPushDiagnostics } = await import('./diagnostics.js');
|
|
188
188
|
return runPushDiagnostics({
|
|
189
189
|
apiBaseUrl: this.deps.apiBaseUrl,
|
|
190
190
|
clientKey: this.deps.clientKey,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
*
|
|
23
23
|
* ⚠️ No third-party runtime deps, per the SDK's core rule: browser APIs only.
|
|
24
24
|
*/
|
|
25
|
-
import type { PushEnableStatus } from './PushFeature';
|
|
25
|
+
import type { PushEnableStatus } from './PushFeature.js';
|
|
26
26
|
export interface SoftAskOptions {
|
|
27
27
|
/**
|
|
28
28
|
* When to show it.
|
|
@@ -39,32 +39,32 @@ function ask(o) {
|
|
|
39
39
|
// Above ordinary page chrome, below the browser's own prompt (which the OS draws anyway).
|
|
40
40
|
host.style.cssText = 'position:fixed;z-index:2147483000;inset:auto 16px 16px auto';
|
|
41
41
|
const root = host.attachShadow({ mode: 'open' });
|
|
42
|
-
root.innerHTML = `
|
|
43
|
-
<style>
|
|
44
|
-
:host{all:initial}
|
|
45
|
-
.c{width:min(340px,calc(100vw - 32px));box-sizing:border-box;padding:16px 18px;border-radius:14px;
|
|
46
|
-
background:#fff;color:#172033;box-shadow:0 18px 48px rgba(3,7,18,.28);
|
|
47
|
-
font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
|
|
48
|
-
animation:in .22s ease-out both}
|
|
49
|
-
@keyframes in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
|
|
50
|
-
.t{font-size:15px;font-weight:700;margin:0 0 4px}
|
|
51
|
-
.b{margin:0 0 14px;color:#5b6472}
|
|
52
|
-
.r{display:flex;gap:8px;justify-content:flex-end}
|
|
53
|
-
button{font:inherit;font-weight:600;border-radius:9px;padding:8px 14px;cursor:pointer;border:0}
|
|
54
|
-
.no{background:transparent;color:#5b6472}
|
|
55
|
-
.yes{background:var(--a);color:#fff}
|
|
56
|
-
@media (prefers-color-scheme:dark){
|
|
57
|
-
.c{background:#1a1e27;color:#f2f4f8}.b{color:#aab2c0}.no{color:#aab2c0}
|
|
58
|
-
}
|
|
59
|
-
@media (prefers-reduced-motion:reduce){.c{animation-duration:1ms}}
|
|
60
|
-
</style>
|
|
61
|
-
<div class="c" role="dialog" aria-modal="false" style="--a:${o.accent}">
|
|
62
|
-
<p class="t"></p>
|
|
63
|
-
<p class="b"></p>
|
|
64
|
-
<div class="r">
|
|
65
|
-
<button class="no" type="button"></button>
|
|
66
|
-
<button class="yes" type="button"></button>
|
|
67
|
-
</div>
|
|
42
|
+
root.innerHTML = `
|
|
43
|
+
<style>
|
|
44
|
+
:host{all:initial}
|
|
45
|
+
.c{width:min(340px,calc(100vw - 32px));box-sizing:border-box;padding:16px 18px;border-radius:14px;
|
|
46
|
+
background:#fff;color:#172033;box-shadow:0 18px 48px rgba(3,7,18,.28);
|
|
47
|
+
font:14px/1.45 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif;
|
|
48
|
+
animation:in .22s ease-out both}
|
|
49
|
+
@keyframes in{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}
|
|
50
|
+
.t{font-size:15px;font-weight:700;margin:0 0 4px}
|
|
51
|
+
.b{margin:0 0 14px;color:#5b6472}
|
|
52
|
+
.r{display:flex;gap:8px;justify-content:flex-end}
|
|
53
|
+
button{font:inherit;font-weight:600;border-radius:9px;padding:8px 14px;cursor:pointer;border:0}
|
|
54
|
+
.no{background:transparent;color:#5b6472}
|
|
55
|
+
.yes{background:var(--a);color:#fff}
|
|
56
|
+
@media (prefers-color-scheme:dark){
|
|
57
|
+
.c{background:#1a1e27;color:#f2f4f8}.b{color:#aab2c0}.no{color:#aab2c0}
|
|
58
|
+
}
|
|
59
|
+
@media (prefers-reduced-motion:reduce){.c{animation-duration:1ms}}
|
|
60
|
+
</style>
|
|
61
|
+
<div class="c" role="dialog" aria-modal="false" style="--a:${o.accent}">
|
|
62
|
+
<p class="t"></p>
|
|
63
|
+
<p class="b"></p>
|
|
64
|
+
<div class="r">
|
|
65
|
+
<button class="no" type="button"></button>
|
|
66
|
+
<button class="yes" type="button"></button>
|
|
67
|
+
</div>
|
|
68
68
|
</div>`;
|
|
69
69
|
// textContent, never innerHTML: these strings come from tenant config and must not be able to
|
|
70
70
|
// inject markup into a host page.
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* chunk, so it never weighs down the core bundle. A non-sampled session loads only `sampling.ts`.
|
|
7
7
|
*/
|
|
8
8
|
import type { IFeature, FeatureContext } from '@scalebun/sdk-contracts';
|
|
9
|
-
import type { ReplayStats } from './lifecycle/recorder';
|
|
9
|
+
import type { ReplayStats } from './lifecycle/recorder.js';
|
|
10
10
|
export declare class ReplayFeature implements IFeature {
|
|
11
11
|
readonly name = "replay";
|
|
12
12
|
private controller?;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* bouncing visitor is not what decides the outcome. */
|
|
3
3
|
const RECORDER_RETRY_MS = 400;
|
|
4
4
|
/** Extracted so the retry awaits the SAME specifier — two spellings would defeat the module cache. */
|
|
5
|
-
const loadRecorder = () => import('./lifecycle/recorder');
|
|
5
|
+
const loadRecorder = () => import('./lifecycle/recorder.js');
|
|
6
6
|
export class ReplayFeature {
|
|
7
7
|
constructor() {
|
|
8
8
|
this.name = 'replay';
|
|
@@ -15,7 +15,7 @@ export class ReplayFeature {
|
|
|
15
15
|
return;
|
|
16
16
|
// Deterministic sampling gate (server-reconcilable fnv1a) — decide BEFORE loading the recorder,
|
|
17
17
|
// so a non-sampled session installs nothing beyond this tiny decision.
|
|
18
|
-
const { decideSampling } = await import('./lifecycle/sampling');
|
|
18
|
+
const { decideSampling } = await import('./lifecycle/sampling.js');
|
|
19
19
|
const decision = decideSampling(ctx.replaySampling, ctx.sessionId ?? '');
|
|
20
20
|
ctx.log('[replay] sampling:', decision.reason, '(bucket', decision.bucket + ')');
|
|
21
21
|
if (!decision.record)
|
|
@@ -23,7 +23,7 @@ export class ReplayFeature {
|
|
|
23
23
|
// D3 — honor GPC / Do-Not-Track (opt-in via privacy.respectDnt). If the user signalled opt-out,
|
|
24
24
|
// don't record replay at all. Lazy-imported so it costs nothing unless the host opted in.
|
|
25
25
|
if (ctx.respectDnt) {
|
|
26
|
-
const { userOptedOutOfTracking } = await import('./lifecycle/deviceSignals');
|
|
26
|
+
const { userOptedOutOfTracking } = await import('./lifecycle/deviceSignals.js');
|
|
27
27
|
if (userOptedOutOfTracking()) {
|
|
28
28
|
ctx.log('[replay] dnt: skip');
|
|
29
29
|
return;
|
|
@@ -35,7 +35,7 @@ export class ReplayFeature {
|
|
|
35
35
|
// WebGL context) so the canvas recorder can snapshot 3D/WebGL canvases instead of capturing blank.
|
|
36
36
|
// Gated on canvas capture — we only pay the GPU cost for sampled sessions that record canvases.
|
|
37
37
|
if (ctx.replayCanvas) {
|
|
38
|
-
const { installWebGLPreserve } = await import('./engine/webglPatch');
|
|
38
|
+
const { installWebGLPreserve } = await import('./engine/webglPatch.js');
|
|
39
39
|
this.uninstallWebGL = installWebGLPreserve();
|
|
40
40
|
}
|
|
41
41
|
/**
|
|
@@ -57,14 +57,14 @@ export class ReplayFeature {
|
|
|
57
57
|
* is about to record perfectly well from a retried fetch.
|
|
58
58
|
*/
|
|
59
59
|
const warm = (p) => { void p.catch(() => { }); };
|
|
60
|
-
warm(import('../replay/engine/nodeRegistry'));
|
|
61
|
-
warm(import('../replay/engine/snapshot'));
|
|
62
|
-
warm(import('../replay/engine/mutations'));
|
|
63
|
-
warm(import('../replay/engine/interactions'));
|
|
64
|
-
warm(import('../replay/engine/cssom'));
|
|
65
|
-
warm(import('../replay/engine/iframe'));
|
|
66
|
-
warm(import('../replay/engine/replayWorker'));
|
|
67
|
-
warm(import('./lifecycle/segmentBuffer'));
|
|
60
|
+
warm(import('../replay/engine/nodeRegistry.js'));
|
|
61
|
+
warm(import('../replay/engine/snapshot.js'));
|
|
62
|
+
warm(import('../replay/engine/mutations.js'));
|
|
63
|
+
warm(import('../replay/engine/interactions.js'));
|
|
64
|
+
warm(import('../replay/engine/cssom.js'));
|
|
65
|
+
warm(import('../replay/engine/iframe.js'));
|
|
66
|
+
warm(import('../replay/engine/replayWorker.js'));
|
|
67
|
+
warm(import('./lifecycle/segmentBuffer.js'));
|
|
68
68
|
/**
|
|
69
69
|
* A3 — retry the recorder import before giving up.
|
|
70
70
|
*
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
* v1 encodes on the main thread (`toDataURL`), bounded by the fps throttle + downscale. Moving the
|
|
13
13
|
* encode into the RPL-WORKER (OffscreenCanvas.convertToBlob) is a follow-up.
|
|
14
14
|
*/
|
|
15
|
-
import type { Mutation } from './types';
|
|
16
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
15
|
+
import type { Mutation } from './types.js';
|
|
16
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
17
17
|
export interface CanvasOptions {
|
|
18
18
|
fps?: number;
|
|
19
19
|
maxDim?: number;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Mutation, SnapshotOptions } from './types';
|
|
1
|
+
import type { Mutation, SnapshotOptions } from './types.js';
|
|
2
2
|
/**
|
|
3
3
|
* Run on the cross-origin CHILD page. Waits for a parent handshake from an allowed origin, then
|
|
4
4
|
* records this document (offset registry) and relays frames back. No-op when not framed. Returns a
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
* Security: strict origin allowlists BOTH ways; the handshake carries no secrets (just a node-id base).
|
|
10
10
|
* Zero third-party deps. Mask-by-default still applies inside the child.
|
|
11
11
|
*/
|
|
12
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
13
|
-
import { serializeNode, resolveSnapshotOpts } from './snapshot';
|
|
14
|
-
import { MutationRecorder } from './mutations';
|
|
12
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
13
|
+
import { serializeNode, resolveSnapshotOpts } from './snapshot.js';
|
|
14
|
+
import { MutationRecorder } from './mutations.js';
|
|
15
15
|
const INIT = 'scalebun:frame-init'; // parent → child
|
|
16
16
|
const KEY = 'scalebun:frame-key'; // child → parent (serialized sub-document)
|
|
17
17
|
const MUT = 'scalebun:frame-mut'; // child → parent (mutation ops)
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* lost. We monkey-patch the prototype, emit compact `sheet` deltas, and restore the originals on
|
|
7
7
|
* teardown. Fail-isolated: a throwing patch never breaks the host app's CSS call.
|
|
8
8
|
*/
|
|
9
|
-
import type { Mutation } from './types';
|
|
10
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
9
|
+
import type { Mutation } from './types.js';
|
|
10
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
11
11
|
export declare function adoptedSheetId(sheet: CSSStyleSheet): number;
|
|
12
12
|
export declare class CssomRecorder {
|
|
13
13
|
private readonly reg;
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Deferred: precise nested-offset for interactions beyond depth 1 (approximated by the immediate
|
|
11
11
|
* parent's box).
|
|
12
12
|
*/
|
|
13
|
-
import type { Mutation, SnapshotOptions } from './types';
|
|
14
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
13
|
+
import type { Mutation, SnapshotOptions } from './types.js';
|
|
14
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
15
15
|
export interface IframeHooks {
|
|
16
16
|
/** Called for each accessible sub-document so interactions can be captured there (with an offset). */
|
|
17
17
|
onFrame?: (doc: Document, getOffset: () => {
|
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
* Deferred: precise nested-offset for interactions beyond depth 1 (approximated by the immediate
|
|
11
11
|
* parent's box).
|
|
12
12
|
*/
|
|
13
|
-
import { serializeNode, resolveSnapshotOpts } from './snapshot';
|
|
14
|
-
import { MutationRecorder } from './mutations';
|
|
15
|
-
import { bridgeCrossOriginFrame, nodeIdBaseFor } from './crossOrigin';
|
|
13
|
+
import { serializeNode, resolveSnapshotOpts } from './snapshot.js';
|
|
14
|
+
import { MutationRecorder } from './mutations.js';
|
|
15
|
+
import { bridgeCrossOriginFrame, nodeIdBaseFor } from './crossOrigin.js';
|
|
16
16
|
export class IframeManager {
|
|
17
17
|
constructor(reg, onMutations, opts = {}, hooks = {}) {
|
|
18
18
|
this.reg = reg;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Events are batched and flushed on an interval (and on demand via flush() for tests). Dead-click
|
|
14
14
|
* detection uses `notifyDomActivity()`, which the ReplayFeature calls on every mutation/navigation.
|
|
15
15
|
*/
|
|
16
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
16
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
17
17
|
export interface ClickTarget {
|
|
18
18
|
tag: string;
|
|
19
19
|
interactive: boolean;
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* Events are batched and flushed on an interval (and on demand via flush() for tests). Dead-click
|
|
14
14
|
* detection uses `notifyDomActivity()`, which the ReplayFeature calls on every mutation/navigation.
|
|
15
15
|
*/
|
|
16
|
-
import { maskText, maskSecret, isPasswordField } from './snapshot';
|
|
16
|
+
import { maskText, maskSecret, isPasswordField } from './snapshot.js';
|
|
17
17
|
const DEFAULTS = {
|
|
18
18
|
moveThrottleMs: 50,
|
|
19
19
|
scrollThrottleMs: 100,
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
* later. The observer callback only collects + resolves ids; heavier work (and later, the worker
|
|
7
7
|
* handoff) lives in `buildMutations`.
|
|
8
8
|
*/
|
|
9
|
-
import type { Mutation, SnapshotOptions } from './types';
|
|
10
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
11
|
-
import { type ResolvedSnapshotOpts } from './snapshot';
|
|
9
|
+
import type { Mutation, SnapshotOptions } from './types.js';
|
|
10
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
11
|
+
import { type ResolvedSnapshotOpts } from './snapshot.js';
|
|
12
12
|
export declare class MutationRecorder {
|
|
13
13
|
private readonly reg;
|
|
14
14
|
private readonly onMutations;
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
* later. The observer callback only collects + resolves ids; heavier work (and later, the worker
|
|
7
7
|
* handoff) lives in `buildMutations`.
|
|
8
8
|
*/
|
|
9
|
-
import { serializeNode, serializeShadow, maskText, maskSecret, NO_MASK_TEXT_PARENTS, SENSITIVE_ATTRS, resolveSnapshotOpts, absolutizeAttrValue, isMaskedSubtree, isPasswordField, } from './snapshot';
|
|
10
|
-
import { unregisterSubtree, markSubtree, collectShadowRoots } from './traverse';
|
|
9
|
+
import { serializeNode, serializeShadow, maskText, maskSecret, NO_MASK_TEXT_PARENTS, SENSITIVE_ATTRS, resolveSnapshotOpts, absolutizeAttrValue, isMaskedSubtree, isPasswordField, } from './snapshot.js';
|
|
10
|
+
import { unregisterSubtree, markSubtree, collectShadowRoots } from './traverse.js';
|
|
11
11
|
const shadowHandlers = new Set();
|
|
12
12
|
let origAttachShadow = null;
|
|
13
13
|
function addShadowHandler(h) {
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* and player are verified as one unit. `rebuildWithRegistry` maps each SNode id → its DOM node, so
|
|
5
5
|
* subsequent deltas resolve.
|
|
6
6
|
*/
|
|
7
|
-
import type { SNode, Mutation } from './types';
|
|
8
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
7
|
+
import type { SNode, Mutation } from './types.js';
|
|
8
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
9
9
|
export declare function rebuildWithRegistry(s: SNode, reg: NodeRegistry, doc: Document): Node | null;
|
|
10
10
|
export declare function applyMutations(muts: Mutation[], reg: NodeRegistry, doc: Document): void;
|
|
11
11
|
//# sourceMappingURL=player.d.ts.map
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* and player are verified as one unit. `rebuildWithRegistry` maps each SNode id → its DOM node, so
|
|
5
5
|
* subsequent deltas resolve.
|
|
6
6
|
*/
|
|
7
|
-
import { unregisterSubtree } from './traverse';
|
|
7
|
+
import { unregisterSubtree } from './traverse.js';
|
|
8
8
|
const SVG_NS = 'http://www.w3.org/2000/svg';
|
|
9
9
|
export function rebuildWithRegistry(s, reg, doc) {
|
|
10
10
|
switch (s.t) {
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
* serialize↔rebuild are verified as one unit. Produces real DOM from an SNode tree. (The player
|
|
4
4
|
* runs this inside a sandboxed, script-free iframe — captured markup is never executed.)
|
|
5
5
|
*/
|
|
6
|
-
import type { SNode } from './types';
|
|
6
|
+
import type { SNode } from './types.js';
|
|
7
7
|
export declare function rebuildNode(s: SNode, doc: Document): Node | null;
|
|
8
8
|
//# sourceMappingURL=rebuild.d.ts.map
|
|
@@ -10,22 +10,22 @@
|
|
|
10
10
|
* uncompressed — capture is never lost.
|
|
11
11
|
*/
|
|
12
12
|
export const GZ_PREFIX = 'gz:';
|
|
13
|
-
const WORKER_SRC = `
|
|
14
|
-
self.onmessage = async (e) => {
|
|
15
|
-
const { id, json } = e.data;
|
|
16
|
-
try {
|
|
17
|
-
const cs = new CompressionStream('gzip');
|
|
18
|
-
const w = cs.writable.getWriter();
|
|
19
|
-
w.write(new TextEncoder().encode(json)); w.close();
|
|
20
|
-
const ab = await new Response(cs.readable).arrayBuffer();
|
|
21
|
-
const bytes = new Uint8Array(ab);
|
|
22
|
-
let bin = ''; const CH = 0x8000;
|
|
23
|
-
for (let i = 0; i < bytes.length; i += CH) bin += String.fromCharCode.apply(null, bytes.subarray(i, i + CH));
|
|
24
|
-
self.postMessage({ id, out: btoa(bin) });
|
|
25
|
-
} catch (err) {
|
|
26
|
-
self.postMessage({ id, err: String(err) });
|
|
27
|
-
}
|
|
28
|
-
};
|
|
13
|
+
const WORKER_SRC = `
|
|
14
|
+
self.onmessage = async (e) => {
|
|
15
|
+
const { id, json } = e.data;
|
|
16
|
+
try {
|
|
17
|
+
const cs = new CompressionStream('gzip');
|
|
18
|
+
const w = cs.writable.getWriter();
|
|
19
|
+
w.write(new TextEncoder().encode(json)); w.close();
|
|
20
|
+
const ab = await new Response(cs.readable).arrayBuffer();
|
|
21
|
+
const bytes = new Uint8Array(ab);
|
|
22
|
+
let bin = ''; const CH = 0x8000;
|
|
23
|
+
for (let i = 0; i < bytes.length; i += CH) bin += String.fromCharCode.apply(null, bytes.subarray(i, i + CH));
|
|
24
|
+
self.postMessage({ id, out: btoa(bin) });
|
|
25
|
+
} catch (err) {
|
|
26
|
+
self.postMessage({ id, err: String(err) });
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
29
|
`;
|
|
30
30
|
export class ReplayEncoder {
|
|
31
31
|
constructor() {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Async + emitted as a `resource` delta (after the keyframe), so the keyframe stays cheap. The capture
|
|
10
10
|
* orchestrator calls `collectFontFaces(...)` with the document's CSS and emits the returned items.
|
|
11
11
|
*/
|
|
12
|
-
import type { SResource } from './types';
|
|
12
|
+
import type { SResource } from './types.js';
|
|
13
13
|
/** fnv1a-32 hex — a stable, zero-dep content hash for dedupe/reference. */
|
|
14
14
|
export declare function contentHash(s: string): string;
|
|
15
15
|
/** Pull out each `@font-face { ... }` block from a CSS string. */
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* Async + emitted as a `resource` delta (after the keyframe), so the keyframe stays cheap. The capture
|
|
10
10
|
* orchestrator calls `collectFontFaces(...)` with the document's CSS and emits the returned items.
|
|
11
11
|
*/
|
|
12
|
-
import { absUrl } from './snapshot';
|
|
12
|
+
import { absUrl } from './snapshot.js';
|
|
13
13
|
const DEFAULT_BUDGET_BYTES = 512 * 1024; // cap inlined font bytes per session
|
|
14
14
|
const SKIP_SRC = /^(?:data:|blob:)/i;
|
|
15
15
|
/** fnv1a-32 hex — a stable, zero-dep content hash for dedupe/reference. */
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* this function. CSSOM-first: <style> captures live cssRules (CSS-in-JS) and the document captures
|
|
5
5
|
* adoptedStyleSheets — the things rrweb drops from the initial snapshot.
|
|
6
6
|
*/
|
|
7
|
-
import type { SNode, SShadow, SnapshotOptions } from './types';
|
|
8
|
-
import { NodeRegistry } from './nodeRegistry';
|
|
7
|
+
import type { SNode, SShadow, SnapshotOptions } from './types.js';
|
|
8
|
+
import { NodeRegistry } from './nodeRegistry.js';
|
|
9
9
|
export declare const NO_MASK_TEXT_PARENTS: Set<string>;
|
|
10
10
|
export declare const SENSITIVE_ATTRS: Set<string>;
|
|
11
11
|
export interface ResolvedSnapshotOpts {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* this function. CSSOM-first: <style> captures live cssRules (CSS-in-JS) and the document captures
|
|
5
5
|
* adoptedStyleSheets — the things rrweb drops from the initial snapshot.
|
|
6
6
|
*/
|
|
7
|
-
import { adoptedSheetId } from './cssom';
|
|
7
|
+
import { adoptedSheetId } from './cssom.js';
|
|
8
8
|
export const NO_MASK_TEXT_PARENTS = new Set(['STYLE', 'SCRIPT']);
|
|
9
9
|
// Attributes whose values can carry PII → masked when maskAllInputs is on. `srcdoc` is inline iframe
|
|
10
10
|
// HTML (same-origin srcdoc is also captured via contentDocument, so masking it loses nothing).
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* time / visibility / URL). In 'sampled'/'always' mode it streams from the first frame instead.
|
|
10
10
|
*/
|
|
11
11
|
import type { FeatureContext } from '@scalebun/sdk-contracts';
|
|
12
|
-
import type { SampleDecision } from './sampling';
|
|
12
|
+
import type { SampleDecision } from './sampling.js';
|
|
13
13
|
/** Diagnostics surfaced via ScaleBun.replay.stats() + the Dev Panel. */
|
|
14
14
|
export interface ReplayStats {
|
|
15
15
|
recording: boolean;
|