@siteping/widget 0.10.10 → 0.11.1
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 +5 -4
- package/dist/chunk-26577FDQ.js +9 -0
- package/dist/chunk-26577FDQ.js.map +1 -0
- package/dist/chunk-3EHIWTJH.js +9 -0
- package/dist/chunk-3EHIWTJH.js.map +1 -0
- package/dist/chunk-6MCFOKVG.cjs +9 -0
- package/dist/chunk-6MCFOKVG.cjs.map +1 -0
- package/dist/chunk-Q34GDCKE.cjs +9 -0
- package/dist/chunk-Q34GDCKE.cjs.map +1 -0
- package/dist/concurrency.d.cts +14 -0
- package/dist/concurrency.d.ts +14 -0
- package/dist/de-73CTH2E4.cjs +2 -0
- package/dist/de-73CTH2E4.cjs.map +1 -0
- package/dist/de-GUUJUHYP.js +2 -0
- package/dist/de-GUUJUHYP.js.map +1 -0
- package/dist/deep-link.d.cts +14 -0
- package/dist/deep-link.d.ts +14 -0
- package/dist/email.d.cts +6 -3
- package/dist/email.d.ts +6 -3
- package/dist/errors.d.cts +18 -4
- package/dist/errors.d.ts +18 -4
- package/dist/{es-HEVFJPRI.js → es-3MXMSDUC.js} +2 -2
- package/dist/es-3MXMSDUC.js.map +1 -0
- package/dist/{es-5XQA3TPT.cjs → es-WJZ3XARH.cjs} +2 -2
- package/dist/es-WJZ3XARH.cjs.map +1 -0
- package/dist/filters.d.cts +31 -7
- package/dist/filters.d.ts +31 -7
- package/dist/fr-52F3ZCLQ.js +2 -0
- package/dist/fr-52F3ZCLQ.js.map +1 -0
- package/dist/fr-ZCRIJWI3.cjs +2 -0
- package/dist/fr-ZCRIJWI3.cjs.map +1 -0
- package/dist/i18n.d.cts +18 -0
- package/dist/i18n.d.ts +18 -0
- package/dist/index.cjs +3 -1588
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -1
- package/dist/index.d.ts +12 -1
- package/dist/index.global.js +4 -3389
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -1588
- package/dist/index.js.map +1 -1
- package/dist/it-MEUT3RCC.js +2 -0
- package/dist/it-MEUT3RCC.js.map +1 -0
- package/dist/it-TGUTW6MO.cjs +2 -0
- package/dist/it-TGUTW6MO.cjs.map +1 -0
- package/dist/ja-DOS7AWLW.cjs +2 -0
- package/dist/ja-DOS7AWLW.cjs.map +1 -0
- package/dist/ja-U7NRNGPQ.js +2 -0
- package/dist/ja-U7NRNGPQ.js.map +1 -0
- package/dist/ko-U2CS6XQ4.js +2 -0
- package/dist/ko-U2CS6XQ4.js.map +1 -0
- package/dist/ko-ZUL567LW.cjs +2 -0
- package/dist/ko-ZUL567LW.cjs.map +1 -0
- package/dist/panel-3BEMZFIR.cjs +2 -0
- package/dist/panel-3BEMZFIR.cjs.map +1 -0
- package/dist/panel-HPDIAYLQ.js +2 -0
- package/dist/panel-HPDIAYLQ.js.map +1 -0
- package/dist/panel-MIWFGD7X.cjs +2 -0
- package/dist/panel-MIWFGD7X.cjs.map +1 -0
- package/dist/panel-XTNU6XHV.js +2 -0
- package/dist/panel-XTNU6XHV.js.map +1 -0
- package/dist/pt-BZRBHCYN.cjs +2 -0
- package/dist/pt-BZRBHCYN.cjs.map +1 -0
- package/dist/pt-MOS5DVOG.js +2 -0
- package/dist/pt-MOS5DVOG.js.map +1 -0
- package/dist/react.cjs +3 -1588
- package/dist/react.cjs.map +1 -1
- package/dist/react.js +3 -1588
- package/dist/react.js.map +1 -1
- package/dist/ru-KDNRHHNZ.cjs +2 -0
- package/dist/ru-KDNRHHNZ.cjs.map +1 -0
- package/dist/ru-VSWB5NKK.js +2 -0
- package/dist/ru-VSWB5NKK.js.map +1 -0
- package/dist/schema.d.cts +54 -0
- package/dist/schema.d.ts +54 -0
- package/dist/screenshot-storage.d.cts +61 -19
- package/dist/screenshot-storage.d.ts +61 -19
- package/dist/siteping-core.d.cts +9 -6
- package/dist/siteping-core.d.ts +9 -6
- package/dist/store-helpers.d.cts +59 -15
- package/dist/store-helpers.d.ts +59 -15
- package/dist/type-utils.d.cts +8 -0
- package/dist/type-utils.d.ts +8 -0
- package/dist/types.d.cts +399 -33
- package/dist/types.d.ts +399 -33
- package/dist/wire.d.cts +35 -2
- package/dist/wire.d.ts +35 -2
- package/package.json +5 -3
- package/dist/chunk-AFLWWD6M.cjs +0 -1796
- package/dist/chunk-AFLWWD6M.cjs.map +0 -1
- package/dist/chunk-ATTI2TS4.js +0 -1796
- package/dist/chunk-ATTI2TS4.js.map +0 -1
- package/dist/chunk-BP5TH2CD.js +0 -1796
- package/dist/chunk-BP5TH2CD.js.map +0 -1
- package/dist/chunk-OSADAHGS.cjs +0 -1796
- package/dist/chunk-OSADAHGS.cjs.map +0 -1
- package/dist/de-AZUOIGF2.cjs +0 -2
- package/dist/de-AZUOIGF2.cjs.map +0 -1
- package/dist/de-MAGIJBFC.js +0 -2
- package/dist/de-MAGIJBFC.js.map +0 -1
- package/dist/es-5XQA3TPT.cjs.map +0 -1
- package/dist/es-HEVFJPRI.js.map +0 -1
- package/dist/fr-ERYSAH32.cjs +0 -2
- package/dist/fr-ERYSAH32.cjs.map +0 -1
- package/dist/fr-OM2PHLDH.js +0 -2
- package/dist/fr-OM2PHLDH.js.map +0 -1
- package/dist/it-NXAZR4K6.cjs +0 -2
- package/dist/it-NXAZR4K6.cjs.map +0 -1
- package/dist/it-OQVYHKKV.js +0 -2
- package/dist/it-OQVYHKKV.js.map +0 -1
- package/dist/panel-2FEECS2N.cjs +0 -2
- package/dist/panel-2FEECS2N.cjs.map +0 -1
- package/dist/panel-CSFFA5FF.cjs +0 -2
- package/dist/panel-CSFFA5FF.cjs.map +0 -1
- package/dist/panel-S2UR5BSD.js +0 -2
- package/dist/panel-S2UR5BSD.js.map +0 -1
- package/dist/panel-SGSUHR7V.js +0 -2
- package/dist/panel-SGSUHR7V.js.map +0 -1
- package/dist/pt-CODDT6VY.cjs +0 -2
- package/dist/pt-CODDT6VY.cjs.map +0 -1
- package/dist/pt-VUUNL42H.js +0 -2
- package/dist/pt-VUUNL42H.js.map +0 -1
- package/dist/ru-72WUEADV.cjs +0 -2
- package/dist/ru-72WUEADV.cjs.map +0 -1
- package/dist/ru-NDWY7Y36.js +0 -2
- package/dist/ru-NDWY7Y36.js.map +0 -1
package/dist/wire.d.cts
CHANGED
|
@@ -9,16 +9,37 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { SitepingError, SitepingNetworkError } from "./errors.cjs";
|
|
11
11
|
import type { FeedbackQuery } from "./types.cjs";
|
|
12
|
+
/**
|
|
13
|
+
* A fresh `clientId` for a write the server dedupes a resend of — a feedback,
|
|
14
|
+
* or a reply in a thread.
|
|
15
|
+
*/
|
|
16
|
+
export declare function newClientId(): string;
|
|
12
17
|
/**
|
|
13
18
|
* Encode a `FeedbackQuery` as the endpoint's expected query string.
|
|
14
19
|
* Omitted/empty filters are not serialized; `statuses` uses the CSV form
|
|
15
20
|
* the server's schema splits (`statuses=open,in_progress`).
|
|
16
21
|
*/
|
|
17
22
|
export declare function feedbackQueryToSearchParams(query: FeedbackQuery): URLSearchParams;
|
|
23
|
+
/**
|
|
24
|
+
* Merge caller-supplied `extra` headers over a client's `defaults`
|
|
25
|
+
* (`Content-Type`, `Authorization` from `apiKey`). Header names are
|
|
26
|
+
* case-insensitive, so a default spelled differently is dropped and the
|
|
27
|
+
* explicit value replaces it — a plain object merge kept both, and fetch
|
|
28
|
+
* joined them (`authorization: "Basic x"` over an apiKey went out as
|
|
29
|
+
* "Bearer k, Basic x").
|
|
30
|
+
*/
|
|
31
|
+
export declare function mergeRequestHeaders(defaults: Record<string, string>, extra: Record<string, string> | undefined): Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Append `params` to `endpoint`, which may already carry a query string
|
|
34
|
+
* (`/api/siteping?tenant=acme`) or a fragment — naive `${endpoint}?${params}`
|
|
35
|
+
* produced `?tenant=acme?projectName=…`, a 400. Plain string work, so
|
|
36
|
+
* relative endpoints stay relative and nothing depends on `location`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function withSearchParams(endpoint: string, params: URLSearchParams): string;
|
|
18
39
|
/**
|
|
19
40
|
* Map a non-OK `Response` to the appropriate typed error:
|
|
20
|
-
* - 401 / 403 → `SitepingAuthError`
|
|
21
|
-
* - other 4xx → `SitepingValidationError`
|
|
41
|
+
* - 401 / 403 → `SitepingAuthError`, with its `status`
|
|
42
|
+
* - other 4xx → `SitepingValidationError`, with its `status`
|
|
22
43
|
* - 5xx (or anything else) → generic `SitepingError` (code `"SERVER"`)
|
|
23
44
|
*
|
|
24
45
|
* The response body is consumed via `.text()` so the caller keeps the
|
|
@@ -26,6 +47,18 @@ export declare function feedbackQueryToSearchParams(query: FeedbackQuery): URLSe
|
|
|
26
47
|
* to `"Unknown error"` (kept verbatim — host apps grep for it).
|
|
27
48
|
*/
|
|
28
49
|
export declare function errorFromResponse(response: Response, label: string): Promise<SitepingError>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a failed reply met a full thread — a store's `StoreLimitError`, or
|
|
52
|
+
* a 409 (the endpoint's other 409, a clientId reused on another feedback,
|
|
53
|
+
* never comes from clients that mint one per reply). Retrying won't help.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isThreadFull(error: unknown): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether a failed reply delete found nothing to delete — a store's
|
|
58
|
+
* `StoreNotFoundError`, or a 404: it is gone already. (Unlike
|
|
59
|
+
* `isStoreNotFound`, no Prisma `P2025`: a browser source never meets one.)
|
|
60
|
+
*/
|
|
61
|
+
export declare function isCommentGone(error: unknown): boolean;
|
|
29
62
|
/**
|
|
30
63
|
* Normalise an exception thrown by `fetch` (or a timeout AbortController)
|
|
31
64
|
* into a `SitepingNetworkError`. AbortErrors count as network failures —
|
package/dist/wire.d.ts
CHANGED
|
@@ -9,16 +9,37 @@
|
|
|
9
9
|
*/
|
|
10
10
|
import { SitepingError, SitepingNetworkError } from "./errors.js";
|
|
11
11
|
import type { FeedbackQuery } from "./types.js";
|
|
12
|
+
/**
|
|
13
|
+
* A fresh `clientId` for a write the server dedupes a resend of — a feedback,
|
|
14
|
+
* or a reply in a thread.
|
|
15
|
+
*/
|
|
16
|
+
export declare function newClientId(): string;
|
|
12
17
|
/**
|
|
13
18
|
* Encode a `FeedbackQuery` as the endpoint's expected query string.
|
|
14
19
|
* Omitted/empty filters are not serialized; `statuses` uses the CSV form
|
|
15
20
|
* the server's schema splits (`statuses=open,in_progress`).
|
|
16
21
|
*/
|
|
17
22
|
export declare function feedbackQueryToSearchParams(query: FeedbackQuery): URLSearchParams;
|
|
23
|
+
/**
|
|
24
|
+
* Merge caller-supplied `extra` headers over a client's `defaults`
|
|
25
|
+
* (`Content-Type`, `Authorization` from `apiKey`). Header names are
|
|
26
|
+
* case-insensitive, so a default spelled differently is dropped and the
|
|
27
|
+
* explicit value replaces it — a plain object merge kept both, and fetch
|
|
28
|
+
* joined them (`authorization: "Basic x"` over an apiKey went out as
|
|
29
|
+
* "Bearer k, Basic x").
|
|
30
|
+
*/
|
|
31
|
+
export declare function mergeRequestHeaders(defaults: Record<string, string>, extra: Record<string, string> | undefined): Record<string, string>;
|
|
32
|
+
/**
|
|
33
|
+
* Append `params` to `endpoint`, which may already carry a query string
|
|
34
|
+
* (`/api/siteping?tenant=acme`) or a fragment — naive `${endpoint}?${params}`
|
|
35
|
+
* produced `?tenant=acme?projectName=…`, a 400. Plain string work, so
|
|
36
|
+
* relative endpoints stay relative and nothing depends on `location`.
|
|
37
|
+
*/
|
|
38
|
+
export declare function withSearchParams(endpoint: string, params: URLSearchParams): string;
|
|
18
39
|
/**
|
|
19
40
|
* Map a non-OK `Response` to the appropriate typed error:
|
|
20
|
-
* - 401 / 403 → `SitepingAuthError`
|
|
21
|
-
* - other 4xx → `SitepingValidationError`
|
|
41
|
+
* - 401 / 403 → `SitepingAuthError`, with its `status`
|
|
42
|
+
* - other 4xx → `SitepingValidationError`, with its `status`
|
|
22
43
|
* - 5xx (or anything else) → generic `SitepingError` (code `"SERVER"`)
|
|
23
44
|
*
|
|
24
45
|
* The response body is consumed via `.text()` so the caller keeps the
|
|
@@ -26,6 +47,18 @@ export declare function feedbackQueryToSearchParams(query: FeedbackQuery): URLSe
|
|
|
26
47
|
* to `"Unknown error"` (kept verbatim — host apps grep for it).
|
|
27
48
|
*/
|
|
28
49
|
export declare function errorFromResponse(response: Response, label: string): Promise<SitepingError>;
|
|
50
|
+
/**
|
|
51
|
+
* Whether a failed reply met a full thread — a store's `StoreLimitError`, or
|
|
52
|
+
* a 409 (the endpoint's other 409, a clientId reused on another feedback,
|
|
53
|
+
* never comes from clients that mint one per reply). Retrying won't help.
|
|
54
|
+
*/
|
|
55
|
+
export declare function isThreadFull(error: unknown): boolean;
|
|
56
|
+
/**
|
|
57
|
+
* Whether a failed reply delete found nothing to delete — a store's
|
|
58
|
+
* `StoreNotFoundError`, or a 404: it is gone already. (Unlike
|
|
59
|
+
* `isStoreNotFound`, no Prisma `P2025`: a browser source never meets one.)
|
|
60
|
+
*/
|
|
61
|
+
export declare function isCommentGone(error: unknown): boolean;
|
|
29
62
|
/**
|
|
30
63
|
* Normalise an exception thrown by `fetch` (or a timeout AbortController)
|
|
31
64
|
* into a `SitepingNetworkError`. AbortErrors count as network failures —
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@siteping/widget",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.1",
|
|
4
4
|
"description": "Feedback widget for client review during development — annotations, bugs, questions directly on the site",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -76,15 +76,17 @@
|
|
|
76
76
|
"html2canvas-pro": "^2.4.3"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
+
"@siteping/adapter-localstorage": "workspace:*",
|
|
80
|
+
"@siteping/adapter-memory": "workspace:*",
|
|
79
81
|
"@siteping/core": "workspace:*",
|
|
80
|
-
"@size-limit/file": "^14.
|
|
82
|
+
"@size-limit/file": "^14.2.0",
|
|
81
83
|
"@testing-library/react": "^16.3.3",
|
|
82
84
|
"@types/react": "^19.3.0",
|
|
83
85
|
"@types/react-dom": "^19.3.0",
|
|
84
86
|
"esbuild": "^0.28.2",
|
|
85
87
|
"react": "^19.3.0",
|
|
86
88
|
"react-dom": "^19.3.0",
|
|
87
|
-
"size-limit": "^14.
|
|
89
|
+
"size-limit": "^14.2.0"
|
|
88
90
|
},
|
|
89
91
|
"peerDependencies": {
|
|
90
92
|
"react": ">=18"
|