writetrack 0.9.0 → 0.10.0

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.
Binary file
@@ -2,8 +2,8 @@ import { K as KeystrokeEvent, C as ClipboardEvent, U as UndoRedoEvent, S as Sele
2
2
  export { D as DataQualityMetrics, M as ModifierState, b as SessionMetadata } from './index-Cy91q_po.js';
3
3
  import { WriteTrackSink } from './pipes.js';
4
4
  export { DatadogClient, DatadogOptions, OTelSpan, OTelTracer, OpenTelemetryOptions, SegmentClient, SegmentOptions, WebhookOptions, datadog, opentelemetry, segment, webhook } from './pipes.js';
5
- import { S as SessionAnalysis, a as SessionReport, I as IndicatorOutput } from './analysis-types-zqWj2pHM.js';
6
- export { C as ContentOriginAnalysis, P as PhysicalPlausibilityAnalysis, R as RevisionBehaviorAnalysis, b as SessionContinuityAnalysis, c as TemporalPatternsAnalysis, T as TimingAuthenticityAnalysis } from './analysis-types-zqWj2pHM.js';
5
+ import { S as SessionAnalysis, a as SessionReport, I as IndicatorOutput } from './analysis-types-DvrvSEh0.js';
6
+ export { C as ContentOriginAnalysis, P as PhysicalPlausibilityAnalysis, R as RevisionBehaviorAnalysis, b as SessionContinuityAnalysis, c as TemporalPatternsAnalysis, T as TimingAuthenticityAnalysis } from './analysis-types-DvrvSEh0.js';
7
7
 
8
8
  interface PersistedSessionInfo {
9
9
  contentId: string;
@@ -55,6 +55,7 @@ declare class WriteTrack {
55
55
  private keystrokesSinceLastInput;
56
56
  private pendingPasteContent;
57
57
  private pendingPasteTimestamp;
58
+ private pendingPasteBeforeText;
58
59
  private hiddenTime;
59
60
  private hiddenSince;
60
61
  private tickInterval;
@@ -79,8 +80,18 @@ declare class WriteTrack {
79
80
  * @param optionsOrTarget - Either an HTMLElement (localhost evaluation) or WriteTrackOptions object
80
81
  */
81
82
  constructor(optionsOrTarget: WriteTrackOptions | HTMLElement);
83
+ /** Set initial license state — kick off async validation or mark unlicensed. */
84
+ private initLicenseState;
85
+ /** Initialize persistence manager if persist is enabled. */
86
+ private initPersistence;
82
87
  private validateLicenseAsync;
83
88
  private setupEventListeners;
89
+ private setupKeyboardListeners;
90
+ private setupMouseListeners;
91
+ private setupFocusListeners;
92
+ private setupClipboardListeners;
93
+ private setupInputListeners;
94
+ private setupSelectionListeners;
84
95
  /**
85
96
  * Technique 6: Observe target's parent for childList changes.
86
97
  * If target is removed from DOM, stop recording.
@@ -94,6 +105,25 @@ declare class WriteTrack {
94
105
  private recordWindowFocus;
95
106
  private detectKeyboardShortcuts;
96
107
  private recordClipboardEvent;
108
+ /** Extract paste text from clipboard data, with beforeinput fallback. */
109
+ private extractPasteText;
110
+ /**
111
+ * Resolve before-text for clipboard events.
112
+ * Uses pre-insertion snapshot from beforeinput if available (paste events),
113
+ * otherwise falls back to current text (copy/cut events).
114
+ */
115
+ private resolveClipboardBeforeText;
116
+ /** Infer clipboard shortcut from platform (Mac uses Cmd, others use Ctrl). */
117
+ private inferClipboardShortcut;
118
+ /**
119
+ * Merge a new clipboard event with a recent duplicate, or add it to the array.
120
+ * Returns the event object that lives in the array (for async enrichment).
121
+ */
122
+ private mergeOrAddClipboardEvent;
123
+ /** Schedule async after-state capture for paste events, then freeze. */
124
+ private scheduleAfterStateCapture;
125
+ /** Infer paste content from before/after text diff when clipboardData was unavailable. */
126
+ private inferPasteContent;
97
127
  private recordSelection;
98
128
  private static readonly INPUT_SOURCE_MAP;
99
129
  /**