@picked/client 0.0.1-dev.1756875690387 → 0.0.1-dev.1762908210565
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/cjs/index.js +1 -1
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -0
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -0
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -0
- package/dist/cjs/plugins/{responses-indexeddb-plugin → responses-indexeddb}/index.js +1 -1
- package/dist/cjs/plugins/shopify/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -0
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +555 -443
- package/dist/esm/plugins/create-experience/index.js +172 -103
- package/dist/esm/plugins/experience-browser-storage/index.js +39 -0
- package/dist/esm/plugins/{history-browserstorage-plugin → history-browser-storage}/index.js +2 -2
- package/dist/esm/plugins/responses-browser-storage/index.js +41 -0
- package/dist/esm/plugins/{responses-indexeddb-plugin → responses-indexeddb}/index.js +24 -21
- package/dist/esm/plugins/shopify/index.js +38 -28
- package/dist/esm/plugins/single-page-app/index.js +3 -3
- package/dist/esm/plugins/web-components/index.js +21 -0
- package/dist/esm/plugins/window-object/index.js +1 -1
- package/dist/esm/server/index.js +1 -1
- package/dist/experience-instance-CF6m7G83.cjs +1 -0
- package/dist/experience-instance-CKru5var.js +781 -0
- package/dist/storage-Cb_71y48.js +94 -0
- package/dist/storage-DuRlyFaY.cjs +1 -0
- package/dist/{supports-BvrzQAVk.js → supports-BjhuLJ8z.js} +27 -11
- package/dist/supports-YvpQZxbh.cjs +1 -0
- package/dist/types/client.d.ts +26 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/action/action.d.ts +15 -0
- package/dist/types/entities/action/action.d.ts.map +1 -0
- package/dist/types/entities/experience/experience.d.ts +19 -6
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +13 -10
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +5 -2
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +27 -19
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +1 -1
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/response/response.d.ts +8 -0
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +2 -0
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/picked.d.ts +28 -10
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/create-experience.d.ts +48 -13
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +1 -0
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -1
- package/dist/types/plugins/shopify/utils.d.ts +21 -0
- package/dist/types/plugins/shopify/utils.d.ts.map +1 -0
- package/dist/types/plugins/web-components/index.d.ts +2 -0
- package/dist/types/plugins/web-components/index.d.ts.map +1 -0
- package/dist/types/plugins/web-components/plugin.d.ts +3 -0
- package/dist/types/plugins/web-components/plugin.d.ts.map +1 -0
- package/dist/types/utils/dom.d.ts +5 -5
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +29 -24
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/get-step-fields.d.ts +4 -0
- package/dist/types/utils/get-step-fields.d.ts.map +1 -0
- package/dist/types/utils/nodes.d.ts +2 -1
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/storage.d.ts +3 -0
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +2 -0
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/dist/types/utils/user-session.d.ts +5 -0
- package/dist/types/utils/user-session.d.ts.map +1 -0
- package/package.json +32 -26
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +0 -1
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +0 -1
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +0 -1
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +0 -38
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +0 -36
- package/dist/experience-instance-6ZKZS7dF.cjs +0 -1
- package/dist/experience-instance-BA0EXYg5.js +0 -712
- package/dist/storage-BPJwmlva.cjs +0 -1
- package/dist/storage-D87xFySf.js +0 -85
- package/dist/supports-C0y3-V5V.cjs +0 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +0 -1
- /package/dist/types/plugins/{experience-browserstorage-plugin → experience-browser-storage}/index.d.ts +0 -0
- /package/dist/types/plugins/{experience-browserstorage-plugin → experience-browser-storage}/plugin.d.ts +0 -0
- /package/dist/types/plugins/{history-browserstorage-plugin → history-browser-storage}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browserstorage-plugin → history-browser-storage}/plugin.d.ts +0 -0
- /package/dist/types/plugins/{responses-browserstorage-plugin → responses-browser-storage}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browserstorage-plugin → responses-browser-storage}/plugin.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb-plugin → responses-indexeddb}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb-plugin → responses-indexeddb}/plugin.d.ts +0 -0
package/dist/storage-D87xFySf.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
function f(e, t = "global", o) {
|
|
2
|
-
let s = "picked";
|
|
3
|
-
if (t === "experience") {
|
|
4
|
-
if (!o)
|
|
5
|
-
throw new Error("Experience instance is required to scope storage to an experience");
|
|
6
|
-
s = `${s}:${o.experienceId}`;
|
|
7
|
-
}
|
|
8
|
-
return `${s}:${e}`;
|
|
9
|
-
}
|
|
10
|
-
function c(e, t) {
|
|
11
|
-
const o = t === "local" ? localStorage : sessionStorage, s = o.getItem(e), n = o.getItem(`${e}:expires-at`);
|
|
12
|
-
if (n) {
|
|
13
|
-
const r = /* @__PURE__ */ new Date(), i = new Date(n);
|
|
14
|
-
if (r > i)
|
|
15
|
-
return a(e, t), {
|
|
16
|
-
text: () => null,
|
|
17
|
-
json: () => null,
|
|
18
|
-
boolean: () => null
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
return {
|
|
22
|
-
text() {
|
|
23
|
-
return s;
|
|
24
|
-
},
|
|
25
|
-
json() {
|
|
26
|
-
return s ? JSON.parse(s) : null;
|
|
27
|
-
},
|
|
28
|
-
boolean() {
|
|
29
|
-
return s ? s === "true" : null;
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
function l(e, t, o, s) {
|
|
34
|
-
const n = o === "local" ? localStorage : sessionStorage, r = typeof t != "string" ? JSON.stringify(t) : t;
|
|
35
|
-
if (n.setItem(e, r), typeof s == "number") {
|
|
36
|
-
const g = new Date(Date.now() + s).toISOString();
|
|
37
|
-
n.setItem(`${e}:expires-at`, g);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
function a(e, t) {
|
|
41
|
-
const o = t === "local" ? localStorage : sessionStorage;
|
|
42
|
-
o.removeItem(e), o.removeItem(`${e}:expires-at`);
|
|
43
|
-
}
|
|
44
|
-
function u(e, t, o, s) {
|
|
45
|
-
const n = t === "local" ? localStorage : sessionStorage;
|
|
46
|
-
function r(i) {
|
|
47
|
-
i.storageArea === n && i.key === e && s(o(e));
|
|
48
|
-
}
|
|
49
|
-
return window.addEventListener("storage", r), function() {
|
|
50
|
-
window.removeEventListener("storage", r);
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
const p = {
|
|
54
|
-
get(e) {
|
|
55
|
-
return c(e, "session");
|
|
56
|
-
},
|
|
57
|
-
set(e, t, o) {
|
|
58
|
-
l(e, t, "session", o);
|
|
59
|
-
},
|
|
60
|
-
remove(e) {
|
|
61
|
-
a(e, "session");
|
|
62
|
-
},
|
|
63
|
-
subscribe(e, t) {
|
|
64
|
-
return u(e, "session", this.get, t);
|
|
65
|
-
}
|
|
66
|
-
}, m = {
|
|
67
|
-
get(e) {
|
|
68
|
-
return c(e, "local");
|
|
69
|
-
},
|
|
70
|
-
set(e, t, o) {
|
|
71
|
-
l(e, t, "local", o);
|
|
72
|
-
},
|
|
73
|
-
remove(e) {
|
|
74
|
-
a(e, "local");
|
|
75
|
-
},
|
|
76
|
-
subscribe(e, t) {
|
|
77
|
-
return u(e, "local", this.get, t);
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
export {
|
|
81
|
-
u as a,
|
|
82
|
-
f as c,
|
|
83
|
-
m as l,
|
|
84
|
-
p as s
|
|
85
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=Symbol("Picked"),t=globalThis,n=o=>{t[r]=o};function e(){try{return"location"in t&&!!t.location}catch{return!1}}function s(){try{return"history"in t&&!!t.history}catch{return!1}}function c(){try{return"localStorage"in t&&!!t.localStorage}catch{return!1}}function u(){try{return"sessionStorage"in t&&!!t.sessionStorage}catch{return!1}}function i(){try{return"document"in t&&"cookie"in t.document}catch{return!1}}function a(){try{return"document"in t&&"createElement"in t.document&&"attachShadow"in t.document.createElement("div")}catch{return!1}}function p(){try{return"window"in t}catch{return!1}}function l(){try{return"document"in t}catch{return!1}}function f(){try{return"IntersectionObserver"in t}catch{return!1}}exports.GLOBAL_OBJ=t;exports.bindClient=n;exports.supportsCookies=i;exports.supportsDocument=l;exports.supportsHistory=s;exports.supportsIntersectionObserver=f;exports.supportsLocalStorage=c;exports.supportsLocation=e;exports.supportsSessionStorage=u;exports.supportsShadowRoot=a;exports.supportsWindow=p;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browserstorage-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browserstorage-plugin/plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,MAAM,WAAW,8BAA8B;IAC7C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,GAAI,eAE5C,8BAAmC,KAAG,MAyCxC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browserstorage-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browserstorage-plugin/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,GAAI,eAEzC,2BAAgC,KAAG,MA4BrC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browserstorage-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browserstorage-plugin/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,MAAM,WAAW,6BAA6B;IAC5C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,6BAA6B,GAAI,eAE3C,6BAAkC,KAAG,MA+CvC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb-plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb-plugin/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,eAAO,MAAM,wBAAwB,QAAO,MA2E3C,CAAA"}
|
|
File without changes
|
|
File without changes
|
/package/dist/types/plugins/{history-browserstorage-plugin → history-browser-storage}/index.d.ts
RENAMED
|
File without changes
|
/package/dist/types/plugins/{history-browserstorage-plugin → history-browser-storage}/plugin.d.ts
RENAMED
|
File without changes
|
/package/dist/types/plugins/{responses-browserstorage-plugin → responses-browser-storage}/index.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|