@loupekit/shared 0.2.0-next.1 → 0.2.1-next.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.
Files changed (2) hide show
  1. package/README.md +51 -27
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,38 +1,62 @@
1
- # @loupekit/shared
1
+ <div align="center">
2
2
 
3
- **Canonical TypeScript types and pure helpers shared across [Loupe](https://github.com/mohamed-ashraf-elsaed/loupe)** —
4
- the SDK, backend API, dashboard, and MCP server all import from here so a comment means the
5
- same thing everywhere in the loop.
3
+ <a href="https://mohamed-ashraf-elsaed.github.io/loupe/">
4
+ <img src="https://raw.githubusercontent.com/mohamed-ashraf-elsaed/loupe/main/docs/store/promo-marquee-1400x560.jpg" alt="Loupe Pin feedback to the live UI. Hand it to Claude." width="100%" />
5
+ </a>
6
6
 
7
- This package has no runtime dependencies. It's the contract layer, not a feature.
7
+ <h1>@loupekit/shared</h1>
8
+
9
+ <p><strong>The canonical TypeScript types and pure helpers shared across Loupe.</strong><br />
10
+ The SDK, backend API, dashboard, and MCP server all import from here — so a comment means the
11
+ same thing everywhere in the loop.</p>
12
+
13
+ <p>
14
+ <a href="https://www.npmjs.com/package/@loupekit/shared"><img src="https://img.shields.io/npm/v/@loupekit/shared?color=4a55d6&label=npm" alt="npm version" /></a>
15
+ <a href="https://www.npmjs.com/package/@loupekit/shared"><img src="https://img.shields.io/npm/dm/@loupekit/shared?color=4a55d6" alt="npm downloads" /></a>
16
+ <img src="https://img.shields.io/npm/types/@loupekit/shared?color=4a55d6" alt="TypeScript types" />
17
+ <img src="https://img.shields.io/badge/dependencies-0-4a55d6" alt="Zero dependencies" />
18
+ <img src="https://img.shields.io/npm/l/@loupekit/shared?color=4a55d6" alt="MIT license" />
19
+ </p>
20
+
21
+ <p>
22
+ <a href="https://mohamed-ashraf-elsaed.github.io/loupe/"><b>Website</b></a> ·
23
+ <a href="https://github.com/mohamed-ashraf-elsaed/loupe"><b>GitHub</b></a> ·
24
+ <a href="https://www.npmjs.com/package/@loupekit/sdk"><b>SDK</b></a> ·
25
+ <a href="https://www.npmjs.com/package/@loupekit/mcp"><b>MCP server</b></a>
26
+ </p>
27
+
28
+ </div>
8
29
 
9
30
  ---
10
31
 
32
+ This is the **contract layer** of the [Loupe](https://github.com/mohamed-ashraf-elsaed/loupe)
33
+ visual-feedback platform — no runtime dependencies, not a feature. If you're building on
34
+ Loupe, install the [SDK](https://www.npmjs.com/package/@loupekit/sdk) or
35
+ [MCP server](https://www.npmjs.com/package/@loupekit/mcp) instead; this package is pulled in
36
+ for you.
37
+
11
38
  ## Install
12
39
 
13
40
  ```bash
14
41
  npm i @loupekit/shared
15
42
  ```
16
43
 
17
- > Also mirrored to **GitHub Packages** as `@mohamed-ashraf-elsaed/shared`. To install from
18
- > there, add `@mohamed-ashraf-elsaed:registry=https://npm.pkg.github.com` to your `.npmrc`.
44
+ > Also mirrored to **GitHub Packages** as `@mohamed-ashraf-elsaed/shared` add
45
+ > `@mohamed-ashraf-elsaed:registry=https://npm.pkg.github.com` to your `.npmrc` to install from there.
19
46
 
20
47
  ## Types
21
48
 
22
- - **`Comment`** a piece of visual feedback: body, author, status, the element `anchor`,
23
- the captured `context` (HTML + styles), screenshot URL, and — for free-region comments —
24
- `kind: "region"` plus a `region` rectangle.
25
- - **`Anchor`** the multi-signal element fingerprint (tag, CSS path, XPath, testid, text,
26
- attributes, nth-of-type, bounding rect, viewport) used to re-locate an element after a
27
- redeploy.
28
- - **`ElementContext`** the target's `outerHTML` and a curated slice of computed styles.
29
- - **`RegionRect`** — a free-region rectangle in document coordinates, with optional
30
- element-relative fractions (`rel`) so regions track responsive reflow.
31
- - **`LoupeUser`**, **`CommentStatus`**, **`CommentKind`** — identity and workflow enums.
49
+ | Type | Purpose |
50
+ | --- | --- |
51
+ | **`Comment`** | A piece of visual feedback: body, author, status, element `anchor`, captured `context` (HTML + styles), screenshot URL, and — for free-region comments — `kind: "region"` + a `region` rectangle. |
52
+ | **`Anchor`** | The multi-signal element fingerprint (tag, CSS path, XPath, testid, text, attributes, nth-of-type, rect, viewport) used to re-locate an element after a redeploy. |
53
+ | **`ElementContext`** | The target's `outerHTML` + a curated slice of computed styles. |
54
+ | **`RegionRect`** | A free-region rectangle in document coordinates, with optional element-relative fractions (`rel`) so regions track responsive reflow. |
55
+ | **`LoupeUser`**, **`CommentStatus`**, **`CommentKind`** | Identity and workflow enums. |
32
56
 
33
57
  ## Helper: `normalizeUrl(input)`
34
58
 
35
- Normalizes a page URL so comments don't fragment across tracking/volatile query params.
59
+ Normalizes a page URL so comments don't fragment across tracking / volatile query params.
36
60
 
37
61
  ```ts
38
62
  import { normalizeUrl } from "@loupekit/shared";
@@ -43,23 +67,23 @@ normalizeUrl("/checkout?utm_source=x&gclid=123&step=2");
43
67
 
44
68
  It:
45
69
 
46
- - strips `utm_*`, click ids (`gclid`, `fbclid`, `msclkid`, …), and Loupe's own dev params
47
- (`api`, `key`),
70
+ - strips `utm_*`, click ids (`gclid`, `fbclid`, `msclkid`, …), and Loupe's own dev params (`api`, `key`),
48
71
  - sorts the remaining params for stability,
49
72
  - drops trailing slashes.
50
73
 
51
- So a comment on `/checkout?utm_source=x` and one on `/checkout` land on the **same** page and
52
- don't split into two buckets.
74
+ So a comment on `/checkout?utm_source=x` and one on `/checkout` land on the **same** page.
53
75
 
54
- ## Usage notes
76
+ ## Notes
55
77
 
56
- - ESM-only, ships compiled JS + `.d.ts` (`main`/`types` → `dist`).
57
- - Node packages in the monorepo import the compiled JS; browser packages import the types.
78
+ - ESM-only; ships compiled JS + `.d.ts` (`main` / `types` → `dist`).
79
+ - Node packages import the compiled JS; browser packages import the types.
58
80
 
59
81
  ## Related packages
60
82
 
61
- - [`@loupekit/sdk`](https://www.npmjs.com/package/@loupekit/sdk) the embeddable widget.
62
- - [`@loupekit/mcp`](https://www.npmjs.com/package/@loupekit/mcp) the MCP server for Claude Code.
83
+ | Package | Description |
84
+ | --- | --- |
85
+ | [`@loupekit/sdk`](https://www.npmjs.com/package/@loupekit/sdk) | The embeddable visual-feedback widget. |
86
+ | [`@loupekit/mcp`](https://www.npmjs.com/package/@loupekit/mcp) | The MCP server that hands comments to Claude Code. |
63
87
 
64
88
  ## License
65
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loupekit/shared",
3
- "version": "0.2.0-next.1",
3
+ "version": "0.2.1-next.2",
4
4
  "description": "Canonical TypeScript types + helpers (normalizeUrl) shared across the Loupe visual-feedback platform.",
5
5
  "keywords": [
6
6
  "loupe",