@siteping/widget 0.10.7 → 0.10.8

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 (45) hide show
  1. package/dist/{chunk-7ZBKJ6NW.js → chunk-4CK3N4YE.js} +11 -11
  2. package/dist/chunk-4CK3N4YE.js.map +1 -0
  3. package/dist/{chunk-GKRKCSID.cjs → chunk-BJFC7TVL.cjs} +11 -11
  4. package/dist/chunk-BJFC7TVL.cjs.map +1 -0
  5. package/dist/{chunk-NVNA5AI2.cjs → chunk-EYISG4OI.js} +11 -11
  6. package/dist/chunk-EYISG4OI.js.map +1 -0
  7. package/dist/{chunk-FDQWFGRR.js → chunk-OK2KX3KN.cjs} +11 -11
  8. package/dist/chunk-OK2KX3KN.cjs.map +1 -0
  9. package/dist/email.d.cts +19 -0
  10. package/dist/email.d.ts +19 -0
  11. package/dist/filters.d.cts +29 -4
  12. package/dist/filters.d.ts +29 -4
  13. package/dist/index.cjs +50 -50
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.global.js +46 -46
  16. package/dist/index.global.js.map +1 -1
  17. package/dist/index.js +51 -51
  18. package/dist/index.js.map +1 -1
  19. package/dist/panel-KCYUMYAI.cjs +2 -0
  20. package/dist/{panel-M2QKMFYO.cjs.map → panel-KCYUMYAI.cjs.map} +1 -1
  21. package/dist/panel-KV2AQHC2.js +2 -0
  22. package/dist/{panel-FUPBUN6F.js.map → panel-KV2AQHC2.js.map} +1 -1
  23. package/dist/panel-LYS3425X.cjs +2 -0
  24. package/dist/{panel-XUTDVTAR.cjs.map → panel-LYS3425X.cjs.map} +1 -1
  25. package/dist/panel-W2LHYGFS.js +2 -0
  26. package/dist/{panel-7URHNKQH.js.map → panel-W2LHYGFS.js.map} +1 -1
  27. package/dist/react.cjs +42 -42
  28. package/dist/react.cjs.map +1 -1
  29. package/dist/react.js +46 -46
  30. package/dist/react.js.map +1 -1
  31. package/dist/siteping-core.d.cts +3 -2
  32. package/dist/siteping-core.d.ts +3 -2
  33. package/dist/store-helpers.d.cts +13 -4
  34. package/dist/store-helpers.d.ts +13 -4
  35. package/dist/types.d.cts +2 -2
  36. package/dist/types.d.ts +2 -2
  37. package/package.json +4 -4
  38. package/dist/chunk-7ZBKJ6NW.js.map +0 -1
  39. package/dist/chunk-FDQWFGRR.js.map +0 -1
  40. package/dist/chunk-GKRKCSID.cjs.map +0 -1
  41. package/dist/chunk-NVNA5AI2.cjs.map +0 -1
  42. package/dist/panel-7URHNKQH.js +0 -2
  43. package/dist/panel-FUPBUN6F.js +0 -2
  44. package/dist/panel-M2QKMFYO.cjs +0 -2
  45. package/dist/panel-XUTDVTAR.cjs +0 -2
@@ -1,7 +1,8 @@
1
+ export { EMAIL_PATTERN, isValidEmail } from "./email.cjs";
1
2
  export type { SitepingErrorCode } from "./errors.cjs";
2
3
  export { SitepingAuthError, SitepingError, SitepingNetworkError, SitepingValidationError } from "./errors.cjs";
3
- export type { FilterResult } from "./filters.cjs";
4
- export { applyFeedbackFilters } from "./filters.cjs";
4
+ export type { FilterResult, Pagination } from "./filters.cjs";
5
+ export { applyFeedbackFilters, clampPagination, DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT } from "./filters.cjs";
5
6
  export type { I18n, LocaleLoaders, TranslateFunction } from "./i18n.cjs";
6
7
  export { createI18n, interpolate, tWithParams } from "./i18n.cjs";
7
8
  export type { FieldDef, IndexDef, ModelDef, PrismaNativeType, PrismaScalarType, RelationDef, RelationKind, RelationOnDelete, SitepingModelFieldName, SitepingModelName, } from "./schema.cjs";
@@ -1,7 +1,8 @@
1
+ export { EMAIL_PATTERN, isValidEmail } from "./email.js";
1
2
  export type { SitepingErrorCode } from "./errors.js";
2
3
  export { SitepingAuthError, SitepingError, SitepingNetworkError, SitepingValidationError } from "./errors.js";
3
- export type { FilterResult } from "./filters.js";
4
- export { applyFeedbackFilters } from "./filters.js";
4
+ export type { FilterResult, Pagination } from "./filters.js";
5
+ export { applyFeedbackFilters, clampPagination, DEFAULT_PAGE_LIMIT, MAX_PAGE_LIMIT } from "./filters.js";
5
6
  export type { I18n, LocaleLoaders, TranslateFunction } from "./i18n.js";
6
7
  export { createI18n, interpolate, tWithParams } from "./i18n.js";
7
8
  export type { FieldDef, IndexDef, ModelDef, PrismaNativeType, PrismaScalarType, RelationDef, RelationKind, RelationOnDelete, SitepingModelFieldName, SitepingModelName, } from "./schema.js";
@@ -41,11 +41,18 @@ export declare function buildFeedbackRecord(input: FeedbackCreateInput, ctx: {
41
41
  * and async KV stores all fit the same three functions.
42
42
  */
43
43
  export interface CollectionStoreBackend {
44
- /** Return the current full snapshot of feedback records. */
44
+ /**
45
+ * Return the current full snapshot of feedback records. The engine never
46
+ * mutates this array — handing out a live cache is safe.
47
+ */
45
48
  load(): FeedbackRecord[] | Promise<FeedbackRecord[]>;
46
49
  /**
47
- * Persist the full snapshot. Throw `StorePersistenceError` when the write
48
- * is lost (quota, storage disabled, …) — never swallow the failure.
50
+ * Persist the full snapshot — always a new array, never the one `load()`
51
+ * returned. Throw `StorePersistenceError` when the write is lost (quota,
52
+ * storage disabled, …) — never swallow the failure. Because the loaded
53
+ * snapshot is left untouched, a throw here leaves a cached `load()` result
54
+ * consistent with durable storage: no phantom record, no half-applied
55
+ * update.
49
56
  */
50
57
  persist(feedbacks: FeedbackRecord[]): void | Promise<void>;
51
58
  /** Generate a unique id for a new feedback or annotation record. */
@@ -62,7 +69,9 @@ export type CollectionStore = SitepingStore & Required<Pick<SitepingStore, "veri
62
69
  * The engine implements the whole store contract: clientId dedup (idempotent
63
70
  * create), newest-first ordering, the standard filter/pagination pipeline,
64
71
  * `StoreNotFoundError` on missing update/delete, project-scoped bulk delete,
65
- * and `verifyProjectOwnership`. When `persist` fails during `createFeedback`
72
+ * and `verifyProjectOwnership`. The snapshot returned by `load` is never
73
+ * mutated: every write hands `persist` a new array, so a failed write leaves
74
+ * a cached snapshot exactly as it was. When `persist` fails during `createFeedback`
66
75
  * and the record carries an inline screenshot, the engine retries once
67
76
  * without the screenshot (by far the heaviest field) so the text feedback
68
77
  * survives a storage-quota hit; if that also fails, the error propagates —
@@ -41,11 +41,18 @@ export declare function buildFeedbackRecord(input: FeedbackCreateInput, ctx: {
41
41
  * and async KV stores all fit the same three functions.
42
42
  */
43
43
  export interface CollectionStoreBackend {
44
- /** Return the current full snapshot of feedback records. */
44
+ /**
45
+ * Return the current full snapshot of feedback records. The engine never
46
+ * mutates this array — handing out a live cache is safe.
47
+ */
45
48
  load(): FeedbackRecord[] | Promise<FeedbackRecord[]>;
46
49
  /**
47
- * Persist the full snapshot. Throw `StorePersistenceError` when the write
48
- * is lost (quota, storage disabled, …) — never swallow the failure.
50
+ * Persist the full snapshot — always a new array, never the one `load()`
51
+ * returned. Throw `StorePersistenceError` when the write is lost (quota,
52
+ * storage disabled, …) — never swallow the failure. Because the loaded
53
+ * snapshot is left untouched, a throw here leaves a cached `load()` result
54
+ * consistent with durable storage: no phantom record, no half-applied
55
+ * update.
49
56
  */
50
57
  persist(feedbacks: FeedbackRecord[]): void | Promise<void>;
51
58
  /** Generate a unique id for a new feedback or annotation record. */
@@ -62,7 +69,9 @@ export type CollectionStore = SitepingStore & Required<Pick<SitepingStore, "veri
62
69
  * The engine implements the whole store contract: clientId dedup (idempotent
63
70
  * create), newest-first ordering, the standard filter/pagination pipeline,
64
71
  * `StoreNotFoundError` on missing update/delete, project-scoped bulk delete,
65
- * and `verifyProjectOwnership`. When `persist` fails during `createFeedback`
72
+ * and `verifyProjectOwnership`. The snapshot returned by `load` is never
73
+ * mutated: every write hands `persist` a new array, so a failed write leaves
74
+ * a cached snapshot exactly as it was. When `persist` fails during `createFeedback`
66
75
  * and the record carries an inline screenshot, the engine retries once
67
76
  * without the screenshot (by far the heaviest field) so the text feedback
68
77
  * survives a storage-quota hit; if that also fails, the error propagates —
package/dist/types.d.cts CHANGED
@@ -595,7 +595,7 @@ export interface AnnotationRecord {
595
595
  */
596
596
  export declare class StoreNotFoundError extends Error {
597
597
  readonly code: "STORE_NOT_FOUND";
598
- constructor(message?: string);
598
+ constructor(message?: string, options?: ErrorOptions);
599
599
  }
600
600
  /**
601
601
  * Thrown when a unique constraint is violated (e.g. duplicate `clientId`).
@@ -604,7 +604,7 @@ export declare class StoreNotFoundError extends Error {
604
604
  */
605
605
  export declare class StoreDuplicateError extends Error {
606
606
  readonly code: "STORE_DUPLICATE";
607
- constructor(message?: string);
607
+ constructor(message?: string, options?: ErrorOptions);
608
608
  }
609
609
  /**
610
610
  * Thrown when a store accepts a mutation but cannot persist it — e.g.
package/dist/types.d.ts CHANGED
@@ -595,7 +595,7 @@ export interface AnnotationRecord {
595
595
  */
596
596
  export declare class StoreNotFoundError extends Error {
597
597
  readonly code: "STORE_NOT_FOUND";
598
- constructor(message?: string);
598
+ constructor(message?: string, options?: ErrorOptions);
599
599
  }
600
600
  /**
601
601
  * Thrown when a unique constraint is violated (e.g. duplicate `clientId`).
@@ -604,7 +604,7 @@ export declare class StoreNotFoundError extends Error {
604
604
  */
605
605
  export declare class StoreDuplicateError extends Error {
606
606
  readonly code: "STORE_DUPLICATE";
607
- constructor(message?: string);
607
+ constructor(message?: string, options?: ErrorOptions);
608
608
  }
609
609
  /**
610
610
  * Thrown when a store accepts a mutation but cannot persist it — e.g.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@siteping/widget",
3
- "version": "0.10.7",
3
+ "version": "0.10.8",
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,
@@ -79,9 +79,9 @@
79
79
  "@siteping/core": "workspace:*",
80
80
  "@size-limit/preset-small-lib": "^12.1.0",
81
81
  "@testing-library/react": "^16.3.2",
82
- "@types/react": "^19.2.17",
83
- "@types/react-dom": "^19.2.3",
84
- "esbuild": "^0.28.1",
82
+ "@types/react": "^19.2.18",
83
+ "@types/react-dom": "^19.2.5",
84
+ "esbuild": "^0.28.2",
85
85
  "react": "^19.2.7",
86
86
  "react-dom": "^19.2.7",
87
87
  "size-limit": "^12.1.0"