saltfish 0.3.73 → 0.3.75

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.
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Color utility functions for parsing and converting colors.
3
+ * Shared across managers to reduce bundle size.
4
+ */
5
+ /**
6
+ * Parses a color string to RGB values using browser's computed style
7
+ */
8
+ export declare function parseColorToRgb(color: string): {
9
+ r: number;
10
+ g: number;
11
+ b: number;
12
+ } | null;
13
+ /**
14
+ * Converts a color to rgba format with specified opacity
15
+ */
16
+ export declare function colorToRgba(color: string, opacity: number): string;
17
+ /**
18
+ * Calculates a contrasting text color (white or dark) for a background
19
+ * Uses relative luminance formula
20
+ */
21
+ export declare function getContrastingTextColor(bgColor: string): string;
22
+ //# sourceMappingURL=colorUtils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colorUtils.d.ts","sourceRoot":"","sources":["../../src/utils/colorUtils.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;GAEG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG;IAAE,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAC;IAAC,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CASzF;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAO/D"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * DOM Snapshot Capture
3
+ *
4
+ * Captures DOM snapshots using rrweb-snapshot for debugging element finding failures.
5
+ * Loads rrweb-snapshot from Saltfish CDN to avoid adding to bundle size - only loaded when needed.
6
+ * Hosted on Saltfish domain to work with customer CSP rules that whitelist *.saltfish.ai
7
+ */
8
+ export type DOMSnapshot = Record<string, unknown>;
9
+ /**
10
+ * Captures a snapshot of the current DOM state.
11
+ * Loads rrweb-snapshot from Saltfish CDN to keep bundle size zero.
12
+ *
13
+ * @returns Serialized DOM snapshot or null if capture fails
14
+ */
15
+ export declare function captureDOMSnapshot(): Promise<DOMSnapshot | null>;
16
+ /**
17
+ * Captures a snapshot and serializes it to a JSON string.
18
+ * Useful for sending to API endpoints.
19
+ *
20
+ * @returns JSON string of DOM snapshot or null if capture fails
21
+ */
22
+ export declare function captureDOMSnapshotAsString(): Promise<string | null>;
23
+ //# sourceMappingURL=domSnapshotCapture.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"domSnapshotCapture.d.ts","sourceRoot":"","sources":["../../src/utils/domSnapshotCapture.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,MAAM,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAIlD;;;;;GAKG;AACH,wBAAsB,kBAAkB,IAAI,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAUtE;AAED;;;;;GAKG;AACH,wBAAsB,0BAA0B,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAYzE"}
@@ -3,6 +3,9 @@
3
3
  *
4
4
  * Reports element finding failures to the backend API for tracking.
5
5
  * Used when cursor/transition element finding fails after all retries.
6
+ *
7
+ * Captures a DOM snapshot using rrweb-snapshot for all failures,
8
+ * allowing reconstruction of the page state for debugging.
6
9
  */
7
10
  import type { ExpectedElement, ExpectedSize } from './elementSizeValidator';
8
11
  export type ElementErrorReason = 'no_elements' | 'tag_mismatch' | 'text_mismatch' | 'size_mismatch';
@@ -11,10 +14,14 @@ export interface ElementErrorPayload {
11
14
  stepId: string;
12
15
  failureReason: ElementErrorReason;
13
16
  selector: string;
17
+ domSnapshot?: string;
14
18
  }
15
19
  /**
16
20
  * Reports an element finding error to the backend.
17
21
  * Fire-and-forget - does not block or throw.
22
+ *
23
+ * Always captures a DOM snapshot to allow reconstruction of the page state
24
+ * for debugging, regardless of failure type.
18
25
  */
19
26
  export declare function reportElementError(playlistId: string, stepId: string, selector: string, expectedElement?: ExpectedElement, expectedSize?: ExpectedSize): void;
20
27
  //# sourceMappingURL=elementErrorReporter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"elementErrorReporter.d.ts","sourceRoot":"","sources":["../../src/utils/elementErrorReporter.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAI5E,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;AAEpG,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;CAClB;AAyCD;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,eAAe,EACjC,YAAY,CAAC,EAAE,YAAY,GAC1B,IAAI,CAqBN"}
1
+ {"version":3,"file":"elementErrorReporter.d.ts","sourceRoot":"","sources":["../../src/utils/elementErrorReporter.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAK5E,MAAM,MAAM,kBAAkB,GAAG,aAAa,GAAG,cAAc,GAAG,eAAe,GAAG,eAAe,CAAC;AAEpG,MAAM,WAAW,mBAAmB;IAClC,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,kBAAkB,CAAC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAyCD;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,EAChB,eAAe,CAAC,EAAE,eAAe,EACjC,YAAY,CAAC,EAAE,YAAY,GAC1B,IAAI,CA+BN"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Centralized SVG icon definitions to reduce bundle size by eliminating duplication.
3
+ * All icons use viewBox-based sizing for flexibility.
4
+ */
5
+ export declare const ICON_CLOSE = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z\"/></svg>";
6
+ export declare const ICON_PLUS = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M12 5v14M5 12h14\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/></svg>";
7
+ export declare const ICON_PLAY = "<svg width=\"24\" height=\"24\" viewBox=\"0 0 24 24\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M8 5v14l11-7z\" fill=\"currentColor\"/></svg>";
8
+ export declare const ICON_SPEAKER = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M155.51,24.81a8,8,0,0,0-8.42.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V32A8,8,0,0,0,155.51,24.81ZM32,96H72v64H32ZM144,207.64,88,164.09V91.91l56-43.55Zm54-106.08a40,40,0,0,1,0,52.88,8,8,0,0,1-12-10.58,24,24,0,0,0,0-31.72,8,8,0,0,1,12-10.58ZM248,128a79.9,79.9,0,0,1-20.37,53.34,8,8,0,0,1-11.92-10.67,64,64,0,0,0,0-85.33,8,8,0,1,1,11.92-10.67A79.83,79.83,0,0,1,248,128Z\"/></svg>";
9
+ export declare const ICON_SPEAKER_MUTED = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M155.51,24.81a8,8,0,0,0-8.42.88L77.25,80H32A16,16,0,0,0,16,96v64a16,16,0,0,0,16,16H77.25l69.84,54.31A8,8,0,0,0,160,224V32A8,8,0,0,0,155.51,24.81ZM32,96H72v64H32ZM144,207.64,88,164.09V91.91l56-43.55Zm101.66-61.3a8,8,0,0,1-11.32,11.32L216,139.31l-18.34,18.35a8,8,0,0,1-11.32-11.32L204.69,128l-18.35-18.34a8,8,0,0,1,11.32-11.32L216,116.69l18.34-18.35a8,8,0,0,1,11.32,11.32L227.31,128Z\"/></svg>";
10
+ export declare const ICON_CC = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192ZM118.92,151.71A8,8,0,0,1,116,162.64a40,40,0,1,1,0-69.28,8,8,0,1,1-8,13.85,24,24,0,1,0,0,41.58A8,8,0,0,1,118.92,151.71Zm80,0A8,8,0,0,1,196,162.64a40,40,0,1,1,0-69.28,8,8,0,1,1-8,13.85,24,24,0,1,0,0,41.58A8,8,0,0,1,198.92,151.71Z\"/></svg>";
11
+ export declare const ICON_CC_DISABLED = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 256 256\" fill=\"currentColor\" xmlns=\"http://www.w3.org/2000/svg\"><path d=\"M224,48H32A16,16,0,0,0,16,64V192a16,16,0,0,0,16,16H224a16,16,0,0,0,16-16V64A16,16,0,0,0,224,48Zm0,144H32V64H224V192ZM118.92,151.71A8,8,0,0,1,116,162.64a40,40,0,1,1,0-69.28,8,8,0,1,1-8,13.85,24,24,0,1,0,0,41.58A8,8,0,0,1,118.92,151.71Zm80,0A8,8,0,0,1,196,162.64a40,40,0,1,1,0-69.28,8,8,0,1,1-8,13.85,24,24,0,1,0,0,41.58A8,8,0,0,1,198.92,151.71Z\"/><line x1=\"48\" y1=\"48\" x2=\"208\" y2=\"208\" stroke=\"currentColor\" stroke-width=\"16\" stroke-linecap=\"round\"/></svg>";
12
+ export declare const ICON_CURSOR = "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 24 24\" fill=\"none\"><defs><filter id=\"cursor-shadow\" x=\"-50%\" y=\"-50%\" width=\"200%\" height=\"200%\"><feDropShadow dx=\"0\" dy=\"1\" stdDeviation=\"1.2\" flood-color=\"rgba(0, 0, 0, 0.22)\"/></filter></defs><path d=\"M3.5 3.5L10.5 20.5L13.3 13.3L20.5 10.5L3.5 3.5Z\" fill=\"#ff7614\" stroke=\"white\" stroke-width=\"0.7\" stroke-linejoin=\"round\" stroke-linecap=\"round\" filter=\"url(#cursor-shadow)\"/></svg>";
13
+ export declare const ICON_LOADING_SPINNER = "<svg width=\"60\" height=\"60\" viewBox=\"0 0 60 60\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\"><g transform=\"translate(10, 10) scale(0.656)\"><g clip-path=\"url(#saltfish-clip)\"><path d=\"M61.0002 30.1906C61.0002 46.8644 47.4834 60.3812 30.8097 60.3812C14.136 60.3812 27.1659 46.8644 27.1659 30.1906C27.1659 13.5168 14.136 0 30.8097 0C47.4834 0 61.0002 13.5168 61.0002 30.1906Z\" fill=\"black\" fill-opacity=\"0.9\"/><path d=\"M24.13 29.8618C24.13 40.3565 15.6978 48.8642 5.29602 48.8642C-5.10576 48.8642 3.02294 40.3565 3.02294 29.8618C3.02294 19.3671 -5.10576 10.8594 5.29602 10.8594C15.6978 10.8594 24.13 19.3671 24.13 29.8618Z\" fill=\"black\" fill-opacity=\"0.9\"/></g><defs><clipPath id=\"saltfish-clip\"><rect width=\"61\" height=\"61\" fill=\"white\"/></clipPath></defs></g><circle cx=\"30\" cy=\"30\" r=\"28\" stroke=\"black\" stroke-width=\"2\" fill=\"none\" stroke-linecap=\"round\" stroke-dasharray=\"8 6\" stroke-opacity=\"0.3\"><animateTransform attributeName=\"transform\" type=\"rotate\" values=\"0 30 30;360 30 30\" dur=\"2s\" repeatCount=\"indefinite\"/></circle></svg>";
14
+ export declare const ICON_SPEAKER_OUTLINE = "<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polygon points=\"11 5 6 9 2 9 2 15 6 15 11 19 11 5\" fill=\"none\"/><path d=\"M15 9c0.8 0.8 1.5 1.9 1.5 3s-0.7 2.2-1.5 3\" stroke=\"currentColor\"/><path d=\"M19 7c1.6 1.6 2.5 3.8 2.5 6s-0.9 4.4-2.5 6\" stroke=\"currentColor\"/></svg>";
15
+ /**
16
+ * Creates a close icon with custom size
17
+ */
18
+ export declare function createCloseIcon(size?: number): string;
19
+ //# sourceMappingURL=icons.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.d.ts","sourceRoot":"","sources":["../../src/utils/icons.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,eAAO,MAAM,UAAU,oUAAwT,CAAC;AAGhV,eAAO,MAAM,SAAS,gPAA4N,CAAC;AAGnP,eAAO,MAAM,SAAS,qKAAuJ,CAAC;AAG9K,eAAO,MAAM,YAAY,0iBAA8hB,CAAC;AAGxjB,eAAO,MAAM,kBAAkB,ygBAA6f,CAAC;AAG7hB,eAAO,MAAM,OAAO,meAAud,CAAC;AAG5e,eAAO,MAAM,gBAAgB,ylBAA+jB,CAAC;AAG7lB,eAAO,MAAM,WAAW,4fAAkd,CAAC;AAG3e,eAAO,MAAM,oBAAoB,glCAAkhC,CAAC;AAGpjC,eAAO,MAAM,oBAAoB,kZAAsX,CAAC;AAExZ;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,GAAE,MAAW,GAAG,MAAM,CAEzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "saltfish",
3
- "version": "0.3.73",
3
+ "version": "0.3.75",
4
4
  "description": "An interactive video-guided tour system for web applications",
5
5
  "main": "dist/saltfish-playlist-player.umd.js",
6
6
  "types": "dist/index.d.ts",