writetrack 0.11.0 → 0.12.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.
- package/README.md +100 -30
- package/dist/browser/index.js +1 -1
- package/dist/browser/viz.js +12 -12
- package/dist/browser/writetrack.wasm +0 -0
- package/dist/ckeditor/index.d.ts +2 -20
- package/dist/esm/index.d.ts +69 -4
- package/dist/esm/index.js +1 -1
- package/dist/esm/testing.d.ts +1 -1
- package/dist/esm/testing.js +1 -1
- package/dist/esm/verify.d.ts +1 -1
- package/dist/esm/viz.d.ts +38 -12
- package/dist/esm/viz.js +12 -12
- package/dist/esm/writetrack.wasm +0 -0
- package/dist/index.cjs +1 -1
- package/dist/lexical/index.d.ts +2 -20
- package/dist/lexical/index.js +1 -1
- package/dist/prosemirror/index.d.ts +2 -20
- package/dist/prosemirror/index.js +1 -1
- package/dist/quill/index.d.ts +2 -20
- package/dist/quill/index.js +1 -1
- package/dist/react/index.d.ts +2 -19
- package/dist/react/index.js +1 -1
- package/dist/slate/index.d.ts +2 -20
- package/dist/tiptap/index.d.ts +11 -21
- package/dist/viz.cjs +12 -12
- package/dist/vue/index.d.ts +2 -19
- package/dist/vue/index.js +1 -1
- package/dist/writetrack.wasm +0 -0
- package/package.json +2 -2
package/dist/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { K as KeystrokeEvent, C as ClipboardEvent, U as UndoRedoEvent, S as SelectionEvent, P as ProgrammaticInsertionEvent, a as CompositionEvent, I as InputSource, W as WriteTrackDataSchema } from './index-Cy91q_po.js';
|
|
2
2
|
export { D as DataQualityMetrics, M as ModifierState, b as SessionMetadata } from './index-Cy91q_po.js';
|
|
3
3
|
import { W as WriteTrackSink } from './types-B8bNI9P5.js';
|
|
4
|
-
import { S as SessionAnalysis, a as SessionReport, I as IndicatorOutput } from './analysis-types-
|
|
5
|
-
export { C as ContentOriginAnalysis, e as PhaseTransition, P as PhysicalPlausibilityAnalysis, R as RevisionBehaviorAnalysis, b as SessionContinuityAnalysis, c as TemporalPatternsAnalysis, T as TimingAuthenticityAnalysis, f as WindowFeatures, W as WritingProcessAnalysis, d as WritingProcessSegment } from './analysis-types-
|
|
4
|
+
import { S as SessionAnalysis, a as SessionReport, I as IndicatorOutput } from './analysis-types-CRB59-1F.js';
|
|
5
|
+
export { A as ActiveTimeResult, g as ActiveTimeWindow, C as ContentOriginAnalysis, e as PhaseTransition, P as PhysicalPlausibilityAnalysis, R as RevisionBehaviorAnalysis, b as SessionContinuityAnalysis, c as TemporalPatternsAnalysis, T as TimingAuthenticityAnalysis, f as WindowFeatures, W as WritingProcessAnalysis, d as WritingProcessSegment } from './analysis-types-CRB59-1F.js';
|
|
6
6
|
export { DatadogClient, DatadogOptions, OTelSpan, OTelTracer, OpenTelemetryOptions, SegmentClient, SegmentOptions, WebhookOptions, datadog, opentelemetry, segment, webhook } from './pipes.js';
|
|
7
7
|
|
|
8
8
|
interface PersistedSessionInfo {
|
|
@@ -282,7 +282,7 @@ declare class WriteTrack {
|
|
|
282
282
|
|
|
283
283
|
/** Extract session duration in milliseconds. */
|
|
284
284
|
declare function getSessionDurationMs(analysis: SessionAnalysis): number;
|
|
285
|
-
/** Compute characters-per-minute and words-per-minute from keydown count and
|
|
285
|
+
/** Compute characters-per-minute and words-per-minute from keydown count and active duration. */
|
|
286
286
|
declare function getTypingSpeed(analysis: SessionAnalysis): {
|
|
287
287
|
cpm: number;
|
|
288
288
|
wpm: number;
|
|
@@ -348,4 +348,69 @@ declare function createSessionReport(rawData: unknown, options?: AnalyzeEventsOp
|
|
|
348
348
|
*/
|
|
349
349
|
declare function getHighResolutionTime(): number;
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
/**
|
|
352
|
+
* Data passed to the `onTick` callback in all editor bindings.
|
|
353
|
+
* The core `tick` event emits `{ activeTime, totalTime }` — bindings
|
|
354
|
+
* wrap it to include the `tracker` instance for convenience.
|
|
355
|
+
*/
|
|
356
|
+
interface OnTickData {
|
|
357
|
+
activeTime: number;
|
|
358
|
+
totalTime: number;
|
|
359
|
+
tracker: WriteTrack;
|
|
360
|
+
}
|
|
361
|
+
/**
|
|
362
|
+
* Common options shared by all editor binding option interfaces.
|
|
363
|
+
* Each binding extends this with any binding-specific options.
|
|
364
|
+
*/
|
|
365
|
+
interface BaseBindingOptions {
|
|
366
|
+
/** WriteTrack license key */
|
|
367
|
+
license?: string;
|
|
368
|
+
/** User identifier included in metadata */
|
|
369
|
+
userId?: string;
|
|
370
|
+
/** Content identifier included in metadata */
|
|
371
|
+
contentId?: string;
|
|
372
|
+
/** Additional metadata */
|
|
373
|
+
metadata?: Record<string, unknown>;
|
|
374
|
+
/** Auto-start tracking when the editor is ready (default: true) */
|
|
375
|
+
autoStart?: boolean;
|
|
376
|
+
/** URL to the WASM binary for analysis. If omitted, uses default loader path. */
|
|
377
|
+
wasmUrl?: string;
|
|
378
|
+
/** Enable IndexedDB session persistence and auto-resume. Requires contentId. */
|
|
379
|
+
persist?: boolean;
|
|
380
|
+
/** Callback invoked on each tick with activeTime, totalTime, and the tracker instance. */
|
|
381
|
+
onTick?: (data: OnTickData) => void;
|
|
382
|
+
/** Callback invoked when the tracker is created and ready (persistence loaded if applicable). */
|
|
383
|
+
onReady?: (tracker: WriteTrack) => void;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface ControllerState {
|
|
387
|
+
tracker: WriteTrack | null;
|
|
388
|
+
isReady: boolean;
|
|
389
|
+
isTracking: boolean;
|
|
390
|
+
analysis: SessionAnalysis | null;
|
|
391
|
+
error: Error | null;
|
|
392
|
+
}
|
|
393
|
+
interface ControllerOptions {
|
|
394
|
+
writeTrackOptions: Omit<WriteTrackOptions, 'target'>;
|
|
395
|
+
target: HTMLElement;
|
|
396
|
+
autoStart?: boolean;
|
|
397
|
+
analysis?: boolean;
|
|
398
|
+
onTick?: (data: OnTickData) => void;
|
|
399
|
+
onReady?: (tracker: WriteTrack) => void;
|
|
400
|
+
onStateChange: (state: ControllerState) => void;
|
|
401
|
+
}
|
|
402
|
+
declare class WriteTrackController {
|
|
403
|
+
private _state;
|
|
404
|
+
private _opts;
|
|
405
|
+
private _unsubs;
|
|
406
|
+
constructor(opts: ControllerOptions);
|
|
407
|
+
private _init;
|
|
408
|
+
private _notify;
|
|
409
|
+
getState(): ControllerState;
|
|
410
|
+
start(): void;
|
|
411
|
+
stop(): void;
|
|
412
|
+
destroy(): Promise<void>;
|
|
413
|
+
reset(target: HTMLElement, writeTrackOptions?: Omit<WriteTrackOptions, 'target'>): Promise<void>;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
export { type AnalyzeEventsOptions, type BaseBindingOptions, ClipboardEvent, CompositionEvent, type ControllerOptions, type ControllerState, IndicatorOutput, InputSource, KeystrokeEvent, type OnTickData, type PersistedSessionInfo, ProgrammaticInsertionEvent, SelectionEvent, SessionAnalysis, SessionReport, UndoRedoEvent, WriteTrack, WriteTrackController, WriteTrackDataSchema, type WriteTrackOptions, WriteTrackSink, analyzeEvents, createSessionReport, WriteTrack as default, formatIndicator, getContentOriginBreakdown, getHighResolutionTime, getSessionDurationMs, getTypingSpeed };
|