@loupekit/shared 0.3.4-next.9 → 0.4.0-next.10

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/index.d.ts CHANGED
@@ -52,6 +52,10 @@ export interface RegionRect {
52
52
  * - "region" → a free-form rectangle the user dragged out; carries `region`.
53
53
  */
54
54
  export type CommentKind = "element" | "region";
55
+ /** Device class the feedback was captured on, derived from the viewport width. */
56
+ export type DeviceType = "mobile" | "tablet" | "desktop";
57
+ /** Classify a viewport width into a device bucket (mobile < 768 ≤ tablet < 1024 ≤ desktop). */
58
+ export declare function deviceType(width: number): DeviceType;
55
59
  export interface Comment {
56
60
  id: string;
57
61
  projectKey: string;
@@ -69,6 +73,11 @@ export interface Comment {
69
73
  };
70
74
  /** Present for region comments: the dragged rectangle in document coords. */
71
75
  region?: RegionRect;
76
+ /** The viewport the feedback was captured on — use deviceType(viewport.w) for the device class. */
77
+ viewport?: {
78
+ w: number;
79
+ h: number;
80
+ };
72
81
  /** A URL (object storage) in server mode, or an inline data URL in offline mode. */
73
82
  screenshot?: string;
74
83
  createdAt: string;
package/dist/index.js CHANGED
@@ -1,4 +1,12 @@
1
1
  // Canonical types + pure helpers shared across the SDK, server, dashboard, and MCP.
2
+ /** Classify a viewport width into a device bucket (mobile < 768 ≤ tablet < 1024 ≤ desktop). */
3
+ export function deviceType(width) {
4
+ if (width < 768)
5
+ return "mobile";
6
+ if (width < 1024)
7
+ return "tablet";
8
+ return "desktop";
9
+ }
2
10
  const DROP_EXACT = new Set([
3
11
  "api", "key", "fbclid", "gclid", "gbraid", "wbraid", "msclkid",
4
12
  "ref", "ref_src", "mc_cid", "mc_eid", "_hsenc", "_hsmi", "igshid",
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "email": "m.ashraf.saed@gmail.com",
6
6
  "url": "https://www.linkedin.com/in/mohamedashrafelsaed/"
7
7
  },
8
- "version": "0.3.4-next.9",
8
+ "version": "0.4.0-next.10",
9
9
  "description": "Canonical TypeScript types + helpers (normalizeUrl) shared across the Loupe visual-feedback platform.",
10
10
  "keywords": [
11
11
  "loupe",