@picked/client 0.0.62-next.12 → 0.0.62-next.3

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 (55) hide show
  1. package/dist/{api-BTbEUnGh.js → api-DnsQgAfY.js} +1 -1
  2. package/dist/api-Dy5cTzV6.cjs +1 -0
  3. package/dist/cjs/index.js +2 -2
  4. package/dist/cjs/plugins/create-experience/index.js +1 -1
  5. package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
  6. package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
  7. package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
  8. package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
  9. package/dist/cjs/server/index.js +1 -1
  10. package/dist/docs/image-optimisation-service.md +6 -6
  11. package/dist/docs/sdk/content-security-policy.md +7 -8
  12. package/dist/docs/sdk/fields.md +2 -2
  13. package/dist/docs/workspaces.mdx +1 -1
  14. package/dist/esm/index.js +277 -342
  15. package/dist/esm/plugins/create-experience/index.js +1 -1
  16. package/dist/esm/plugins/dynamic-experiences/index.js +38 -109
  17. package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
  18. package/dist/esm/plugins/history-browser-storage/index.js +1 -1
  19. package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
  20. package/dist/esm/server/index.js +1 -1
  21. package/dist/experience-instance-BrLWgVAN.js +501 -0
  22. package/dist/experience-instance-Ct3ogC7n.cjs +1 -0
  23. package/dist/types/entities/experience/experience.d.ts +2 -22
  24. package/dist/types/entities/experience/experience.d.ts.map +1 -1
  25. package/dist/types/entities/step/step.d.ts +2 -17
  26. package/dist/types/entities/step/step.d.ts.map +1 -1
  27. package/dist/types/index.d.ts +0 -2
  28. package/dist/types/index.d.ts.map +1 -1
  29. package/dist/types/lifecycle/state-snapshot.d.ts.map +1 -1
  30. package/dist/types/picked.d.ts +0 -39
  31. package/dist/types/picked.d.ts.map +1 -1
  32. package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -2
  33. package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
  34. package/dist/types/plugins/dynamic-experiences/plugin.d.ts +1 -18
  35. package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
  36. package/dist/types/plugins/dynamic-experiences/types.d.ts +1 -63
  37. package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
  38. package/package.json +1 -11
  39. package/dist/api-DDd_Zf11.cjs +0 -1
  40. package/dist/cjs/plugins/dom-observer/index.js +0 -1
  41. package/dist/dom-C3C6Fmwz.cjs +0 -1
  42. package/dist/dom-DGePXPpM.js +0 -84
  43. package/dist/esm/plugins/dom-observer/index.js +0 -87
  44. package/dist/experience-instance-DImym3m_.js +0 -419
  45. package/dist/experience-instance-DygAdzbn.cjs +0 -1
  46. package/dist/types/entities/content/content.d.ts +0 -37
  47. package/dist/types/entities/content/content.d.ts.map +0 -1
  48. package/dist/types/plugins/dom-observer/index.d.ts +0 -3
  49. package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
  50. package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
  51. package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
  52. /package/dist/{id-Cg7fVl1O.cjs → id-Bv44ilEo.cjs} +0 -0
  53. /package/dist/{id-n2yrHvNo.js → id-CRqy981z.js} +0 -0
  54. /package/dist/{storage-hOHCCXvP.js → storage-6Xk0uAxB.js} +0 -0
  55. /package/dist/{storage-BXSlLTRa.cjs → storage-B6lQtc4-.cjs} +0 -0
@@ -12,42 +12,12 @@ import { Feature } from './entities/feature/feature';
12
12
  import { EventBusPayload, EventHistoryStore } from './utils/events';
13
13
  import { Field } from './entities/field/field';
14
14
  import { ExperienceStep } from './entities/step/step';
15
- import { Content } from './entities/content/content';
16
- import { ContentLoader } from './plugins/dynamic-experiences/types';
17
15
  import { Action } from './entities/action/action';
18
16
  import { Condition } from './entities/condition/condition';
19
17
  import { SessionEntity } from './entities/session/session';
20
- /**
21
- * Provenance metadata describing where the Picked client's project config and
22
- * content came from. Set by `dynamicExperiencesPlugin` when the Vite plugin's
23
- * virtual data module is available; remains `null` otherwise.
24
- */
25
- export interface PickedDataSource {
26
- /** `'build'` when build-mode prefetch JSON was used, `'dev'` when the dev-mode runtime fetch was used. */
27
- mode: 'dev' | 'build';
28
- /** ISO 8601 timestamp from the manifest. `null` in dev mode where no manifest is written. */
29
- fetchedAt: string | null;
30
- /** The `versionId` recorded by the source, when known. */
31
- projectVersionId: string | null;
32
- /** The `workspaceId` recorded by the source, when known. */
33
- workspaceId: string | null;
34
- }
35
18
  export declare class Picked {
36
19
  static readonly logger: (level: "log" | "warn" | "info" | "error", ...args: Parameters<Console["log"]>) => void;
37
20
  private readonly options;
38
- /**
39
- * Provenance metadata for the data backing this client. Populated by
40
- * `dynamicExperiencesPlugin` when the Vite plugin's virtual data module is
41
- * resolvable; remains `null` when the SDK is using the runtime API path.
42
- */
43
- dataSource: PickedDataSource | null;
44
- /**
45
- * Content fetcher selected by `dynamicExperiencesPlugin`'s resolution chain. Called
46
- * by each experience's `prepareExperienceContentFx` (fired in parallel with
47
- * `initialiseFx` by the per-experience sample graph). `undefined` when no plugin
48
- * has registered one yet.
49
- */
50
- contentLoader?: ContentLoader;
51
21
  private readonly plugins;
52
22
  readonly eventBus: EventCallable<EventBusPayload>;
53
23
  readonly events: EventHistoryStore;
@@ -198,14 +168,6 @@ export declare class Picked {
198
168
  [id: string]: ExperienceStep;
199
169
  }>;
200
170
  };
201
- readonly contents: {
202
- register: (content: Content) => void;
203
- getById: (id: Content["id"]) => Store<Content | null>;
204
- listStore: Store<Content[]>;
205
- indexStore: StoreWritable<{
206
- [id: string]: Content;
207
- }>;
208
- };
209
171
  readonly actions: {
210
172
  register: EventCallable<{
211
173
  key: string;
@@ -251,7 +213,6 @@ export declare class Picked {
251
213
  registerCondition: (condition: Condition) => void;
252
214
  registerField: (field: Field) => void;
253
215
  registerStep: (step: ExperienceStep) => void;
254
- registerContent: (content: Content) => void;
255
216
  registerAction: (key: string, action: Action) => void;
256
217
  registerExperience: (experience: Experience) => void;
257
218
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"picked.d.ts","sourceRoot":"","sources":["../../src/picked.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,OAAO,EAGL,KAAK,MAAM,EACX,KAAK,aAAa,EAClB,KAAK,KAAK,EACV,KAAK,aAAa,EACnB,MAAM,UAAU,CAAA;AACjB,OAAO,EAEL,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC7B,MAAM,kCAAkC,CAAA;AACzC,OAAO,EAAE,KAAK,MAAM,EAAE,KAAK,iBAAiB,EAAe,MAAM,0BAA0B,CAAA;AAC3F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,UAAU,CAAA;AACnD,OAAO,EACL,KAAK,gBAAgB,EAGtB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAEL,KAAK,SAAS,EAEf,MAAM,gCAAgC,CAAA;AAEvC,OAAO,EAA4B,KAAK,aAAa,EAAE,MAAM,4BAA4B,CAAA;AACzF,OAAO,EAA6B,KAAK,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AACjG,OAAO,EAAmB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAIzD,OAAO,EAAsB,KAAK,eAAe,EAAE,KAAK,iBAAiB,EAAE,MAAM,gBAAgB,CAAA;AACjG,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAA;AACxE,OAAO,KAAK,EAAE,MAAM,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AEH,oBAAoB,GAClB,cAAc,MAAM,EACpB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IACD;;;;;;;;;OASG;IAEH,qBAAqB,GACnB,eAAe,MAAM,EACrB,UAAU,uBAAuB,KAChC,OAAO,CAAC,IAAI,CAAC,CAEf;IAED;;;;;;;;OAQG;IAEH,kBAAkB,GAAU,cAAc,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAE/D;IAED;;;;;;;;OAQG;IAEH,mBAAmB,GAAU,eAAe,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC,CAEjE;IAED,OAAO,CAAC,YAAY;IAsBpB,OAAO,CAAC,aAAa;IA8CrB,OAAO,CAAC,eAAe;IAgBvB,OAAO,CAAC,YAAY;IAgBpB,OAAO,CAAC,eAAe;IAWvB,eAAe,GAAI,YAAY,MAAM,KAAG,iBAAiB,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1F;CACF"}
@@ -1,5 +1,4 @@
1
- /** @file Public exports for the dynamic-experiences plugin (project config + per-experience content resolution). */
2
- export { dynamicExperiencesPlugin, fetchExperienceContent, fetchProject } from './plugin';
1
+ export { dynamicExperiencesPlugin, fetchProject } from './plugin';
3
2
  export { createClientHeaders } from '../../utils/client-headers';
4
3
  export type * from './types';
5
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACzF,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,mBAAmB,SAAS,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,YAAY,EAAE,MAAM,UAAU,CAAA;AACjE,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAA;AAChE,mBAAmB,SAAS,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { Plugin } from '../../entities/plugin/plugin';
2
- import { DynamicExperiencesPluginOptions, ExperienceContentResponse, FetchProjectOptions, ProjectConfig } from './types';
2
+ import { DynamicExperiencesPluginOptions, FetchProjectOptions, ProjectConfig } from './types';
3
3
  /**
4
4
  * Fetches the project configuration from the Picked REST API.
5
5
  *
@@ -16,23 +16,6 @@ import { DynamicExperiencesPluginOptions, ExperienceContentResponse, FetchProjec
16
16
  * ```
17
17
  */
18
18
  export declare function fetchProject(apiUrl: string, projectId: string, options?: FetchProjectOptions): Promise<ProjectConfig | null>;
19
- /**
20
- * Fetches per-experience content from the Picked API.
21
- *
22
- * Returns `null` on network failure, non-OK responses, or invalid JSON shape — preserving
23
- * the failure-tolerant policy: experiences still render, layouts handle null defensively.
24
- *
25
- * @param {string} apiUrl - Base URL for the Picked API.
26
- * @param {string} projectId - Project ID to fetch content for.
27
- * @param {string} experienceId - Experience ID whose content to fetch.
28
- * @param {FetchProjectOptions} [options] - Optional headers and preview token.
29
- * @returns {Promise<ExperienceContentResponse | null>} Validated content response, or `null` on any failure.
30
- * @example
31
- * ```typescript
32
- * const content = await fetchExperienceContent('https://api.picked.app', 'proj_1', 'exp_1')
33
- * ```
34
- */
35
- export declare function fetchExperienceContent(apiUrl: string, projectId: string, experienceId: string, options?: FetchProjectOptions): Promise<ExperienceContentResponse | null>;
36
19
  /**
37
20
  * Plugin that fetches project configuration from the Picked REST API and registers
38
21
  * features, steps, fields, and experiences with the client.
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EAEV,+BAA+B,EAC/B,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EAId,MAAM,SAAS,CAAA;AAsThB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAoBD;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAsC3C;AAkPD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAoC1F"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,OAAO,KAAK,EACV,+BAA+B,EAC/B,mBAAmB,EACnB,aAAa,EAGd,MAAM,SAAS,CAAA;AA2VhB;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM,EACjB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAmC/B;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,CAAC,EAAE,+BAA+B,GAAG,MAAM,CAmD1F"}
@@ -9,14 +9,8 @@ import { LogicRule, LogicValue } from '../../logic-engine';
9
9
  * keys against `ProjectConfig.fields` at registration time.
10
10
  *
11
11
  * `fieldIds` is optional: layout-only steps (driven purely by `layoutName`) omit it.
12
- *
13
- * `layoutContentId` is the wire-format reference to a CMS Content record. The actual
14
- * content blob is delivered by `dynamicExperiencesPlugin`'s content resolution chain
15
- * (virtual data module, preview-token API fetch, or direct API fetch) and registered
16
- * via `client.registerContent`. Steps' derived `layoutContentStore` resolves reactively
17
- * against the registry at render time.
18
12
  */
19
- export type ApiExperienceStep = Omit<ExperienceStep, 'fieldKeys' | 'layoutContentStore'> & {
13
+ export type ApiExperienceStep = Omit<ExperienceStep, 'fieldKeys'> & {
20
14
  fieldIds?: string[];
21
15
  };
22
16
  export interface ProjectConfigFeature {
@@ -72,65 +66,9 @@ export interface ProjectConfig {
72
66
  export interface DynamicExperiencesPluginOptions {
73
67
  apiUrl?: string;
74
68
  projectConfig?: ProjectConfig;
75
- /**
76
- * Customer-supplied content fetcher. When provided, supersedes both the virtual
77
- * data module and the runtime API for per-experience content resolution.
78
- * Customers using this override are responsible for project ↔ content version
79
- * consistency. Receives the resolved experience and the current preview token
80
- * (when present) so the customer can decide preview semantics themselves.
81
- */
82
- getContent?: (experience: {
83
- id: string;
84
- key: string;
85
- }, options?: {
86
- previewToken?: string;
87
- }) => Promise<ExperienceContentResponse | null>;
88
69
  }
89
70
  export interface FetchProjectOptions {
90
71
  previewToken?: string;
91
72
  headers?: Record<string, string>;
92
73
  }
93
- /**
94
- * Wire-format content blob as returned by the Picked API content endpoint.
95
- */
96
- export interface ContentBlob {
97
- id: string;
98
- data: Record<string, unknown>;
99
- }
100
- /**
101
- * Wire-format response shape for `GET /api/v1/projects/:projectId/experiences/:experienceId/content`.
102
- * The response is agnostic of step structure — step ↔ content mapping is encoded in the
103
- * project blob via `Step.layoutContentId`.
104
- */
105
- export interface ExperienceContentResponse {
106
- experienceId: string;
107
- versionId: string;
108
- content: ContentBlob[];
109
- }
110
- /**
111
- * Function that resolves an experience's content blobs. Set on the Picked client by
112
- * `dynamicExperiencesPlugin` (selecting from virtual module, getContent override, or API)
113
- * and called by each experience's `prepareExperienceContentFx`, which is fired by the
114
- * per-experience sample graph in parallel with `initialiseFx`.
115
- */
116
- export type ContentLoader = (experience: {
117
- id: string;
118
- key: string;
119
- }, options?: {
120
- previewToken?: string;
121
- }) => Promise<ExperienceContentResponse | null>;
122
- /**
123
- * Optional-fields surface of the virtual data module exposed by `@picked/vite-plugin-picked`.
124
- * The shape is identical between dev (`vite serve`) and build (`vite build`) modes.
125
- */
126
- export interface VirtualPickedData {
127
- projectConfig: ProjectConfig;
128
- experienceContent: ContentLoader;
129
- manifestMetadata: {
130
- mode: 'dev' | 'build';
131
- fetchedAt: string | null;
132
- projectVersionId: string | null;
133
- workspaceId: string | null;
134
- };
135
- }
136
74
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAA;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAA;AACvD,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,gBAAgB,EACjB,MAAM,sCAAsC,CAAA;AAC7C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAE/D;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,cAAc,EAAE,WAAW,GAAG,oBAAoB,CAAC,GAAG;IACzF,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,MAAM,iB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nB,QAAQ,EAAE,oBAAoB,EAAE,CAAA;IAChC,yEAAyE;IACzE,WAAW,EAAE,uBAAuB,EAAE,CAAA;IACtC,yDAAyD;IACzD,KAAK,EAAE,iBAAiB,EAAE,CAAA;IAC1B,oDAAoD;IACpD,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,wEAAwE;IACxE,UAAU,EAAE,SAAS,EAAE,CAAA;IACvB,OAAO,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAC1D;AAED,MAAM,WAAW,+BAA+B;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACjC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@picked/client",
3
- "version": "0.0.62-next.12",
3
+ "version": "0.0.62-next.3",
4
4
  "dependencies": {
5
5
  "@withease/factories": "^1.0.5"
6
6
  },
@@ -89,12 +89,6 @@
89
89
  "require": "./dist/cjs/plugins/dynamic-experiences/index.js",
90
90
  "default": "./dist/esm/plugins/dynamic-experiences/index.js"
91
91
  },
92
- "./plugins/dom-observer": {
93
- "types": "./dist/types/plugins/dom-observer/index.d.ts",
94
- "import": "./dist/esm/plugins/dom-observer/index.js",
95
- "require": "./dist/cjs/plugins/dom-observer/index.js",
96
- "default": "./dist/esm/plugins/dom-observer/index.js"
97
- },
98
92
  "./form": {
99
93
  "types": "./dist/types/form/index.d.ts",
100
94
  "import": "./dist/esm/form/index.js",
@@ -204,10 +198,6 @@
204
198
  "path": "dist/esm/plugins/web-components/index.js",
205
199
  "limit": "10 kB"
206
200
  },
207
- {
208
- "path": "dist/esm/plugins/dom-observer/index.js",
209
- "limit": "5 kB"
210
- },
211
201
  {
212
202
  "path": "dist/esm/form/index.js",
213
203
  "limit": "5 kB"
@@ -1 +0,0 @@
1
- var e=`Picked-Client`,t=`Picked-Version`;function n(n,r){return{[e]:n,[t]:r}}var r=()=>`0.0.62-next.12`,i=`v1`;function a(e,t){return new URL(`/api/${i}/${t}`,e).toString()}function o(e){return{...n(`sdk`,r()),...e}}async function s(e,t,n){let r=a(e,t);return fetch(r,{headers:o(n)})}async function c(e,t,n,r){let i=a(e,t);return fetch(i,{method:`POST`,headers:{"Content-Type":`application/json`,...o(r)},body:JSON.stringify(n)})}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return s}});
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../logger-fbvQC40v.cjs`);const e=require(`../../../supports-Dsjg-82e.cjs`),t=require(`../../../dom-C3C6Fmwz.cjs`);let n=require(`effector`);var r=new WeakSet,i=()=>({name:`dom-observer`,setup:e=>{a()&&(r.has(e)||(r.add(e),o(e)))}});function a(){return!(!e.d()||!e.r()||typeof MutationObserver!=`function`||typeof requestAnimationFrame!=`function`)}function o(e){t.r().then(()=>{document.body&&s(e)})}function s(e){let t=(0,n.createEvent)(),r=(0,n.createStore)(new Map).on(t,(e,{id:t,selectors:n})=>{let r=new Map(e);return n.length>0?r.set(t,n):r.delete(t),r}),i=new Map;e.experiences.listStore.watch(e=>{for(let n of e){if(i.has(n.id))continue;let e=n.configStore.watch(e=>{t({id:n.id,selectors:c(e.targetSelectors)})});i.set(n.id,e)}});let a=(0,n.createEffect)(async e=>{await Promise.all(e.map(async e=>{await e.shouldInitialiseFx()&&await e.initialiseFx(void 0)}))});a.fail.watch(({error:e})=>{});let o=(0,n.createEvent)();(0,n.sample)({clock:o,source:{selectorsById:r,experiences:e.experiences.listStore},fn:({selectorsById:e,experiences:t},n)=>t.filter(t=>{let r=e.get(t.id);return r?r.some(e=>l(n,e)):!1}),target:a});let s=[],u,d=()=>{u=void 0;let e=s;s=[],o(e)};new MutationObserver(e=>{let t=!1;for(let n of e)if(n.type===`childList`)for(let e of n.addedNodes)e instanceof Element&&(s.push(e),t=!0);t&&(u??=requestAnimationFrame(d))}).observe(document.body,{childList:!0,subtree:!0})}function c(e){let t=[];for(let n of e){let e=n.selector.trim();e.length>0&&t.push(e)}return t}function l(e,t){for(let n of e)try{if(n.matches(t)||n.querySelector(t)!==null)return!0}catch{return!1}return!1}exports.domObserverPlugin=i;
@@ -1 +0,0 @@
1
- const e=require(`./supports-Dsjg-82e.cjs`);function t(t){return!e.d()||!e.r()?[]:Array.from(window.document.querySelectorAll(t)).filter(e=>e instanceof HTMLElement)}var n=`open`;function r(t){if(!e.l())throw Error(`Shadow DOM is not supported in this environment`);return t.attachShadow({mode:n})}function i(){return new Promise((t,n)=>{if(!e.r()){n();return}document.readyState===`loading`?document.addEventListener(`readystatechange`,()=>t(),{once:!0}):t()})}function a(e,t){let n=new MutationObserver(r=>{document.contains(e)||(n.disconnect(),t())});n.observe(document.body,{childList:!0,subtree:!0})}var o=`picked-root`,s=`picked-target`,c=`picked-root`;function l(e,n){return[...e,{selector:`${c}[experience-id="${n}"]`,placement:`replace`}].flatMap(e=>{let r=t(e.selector).filter(e=>!f(e,n)&&!p(e,n));return{...e,elements:r}})}function u(e,t,n){return e.flatMap(e=>e.elements.map(r=>h(r,e.placement,t,n)))}function d(e,t){e.classList.add(s),e.classList.add(`${s}-${t}`)}function f(e,t){return t?e.classList.contains(`${s}-${t}`):e.classList.contains(`${s}`)}function p(e,t){return t?e.classList.contains(`${o}-${t}`):e.classList.contains(o)}function m(e,t){let n=document.createElement(`div`);return n.style.display=`block`,n.classList.add(o),n.classList.add(`${o}-${e}`),n.classList.add(`${o}-${t}`),n}function h(e,t,n,r){let i,a=m(n,r);if(e instanceof Document)i=e.body.appendChild(a);else{switch(t){case`replace`:e.replaceWith(a);break;case`before`:e.before(a);break;case`after`:e.after(a);break;case`prepend`:e.prepend(a);break;case`append`:e.append(a);break}i=a}return i}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return u}});
@@ -1,84 +0,0 @@
1
- import { d as e, l as t, r as n } from "./supports-0XIfd4-R.js";
2
- //#region src/utils/dom.ts
3
- function r(t) {
4
- return !e() || !n() ? [] : Array.from(window.document.querySelectorAll(t)).filter((e) => e instanceof HTMLElement);
5
- }
6
- var i = "open";
7
- function a(e) {
8
- if (!t()) throw Error("Shadow DOM is not supported in this environment");
9
- return e.attachShadow({ mode: i });
10
- }
11
- function o() {
12
- return new Promise((e, t) => {
13
- if (!n()) {
14
- t();
15
- return;
16
- }
17
- document.readyState === "loading" ? document.addEventListener("readystatechange", () => e(), { once: !0 }) : e();
18
- });
19
- }
20
- function s(e, t) {
21
- let n = new MutationObserver((r) => {
22
- document.contains(e) || (n.disconnect(), t());
23
- });
24
- n.observe(document.body, {
25
- childList: !0,
26
- subtree: !0
27
- });
28
- }
29
- var c = "picked-root", l = "picked-target", u = "picked-root";
30
- function d(e, t) {
31
- return [...e, {
32
- selector: `${u}[experience-id="${t}"]`,
33
- placement: "replace"
34
- }].flatMap((e) => {
35
- let n = r(e.selector).filter((e) => !m(e, t) && !h(e, t));
36
- return {
37
- ...e,
38
- elements: n
39
- };
40
- });
41
- }
42
- function f(e, t, n) {
43
- return e.flatMap((e) => e.elements.map((r) => _(r, e.placement, t, n)));
44
- }
45
- function p(e, t) {
46
- e.classList.add(l), e.classList.add(`${l}-${t}`);
47
- }
48
- function m(e, t) {
49
- return t ? e.classList.contains(`${l}-${t}`) : e.classList.contains(`${l}`);
50
- }
51
- function h(e, t) {
52
- return t ? e.classList.contains(`${c}-${t}`) : e.classList.contains(c);
53
- }
54
- function g(e, t) {
55
- let n = document.createElement("div");
56
- return n.style.display = "block", n.classList.add(c), n.classList.add(`${c}-${e}`), n.classList.add(`${c}-${t}`), n;
57
- }
58
- function _(e, t, n, r) {
59
- let i, a = g(n, r);
60
- if (e instanceof Document) i = e.body.appendChild(a);
61
- else {
62
- switch (t) {
63
- case "replace":
64
- e.replaceWith(a);
65
- break;
66
- case "before":
67
- e.before(a);
68
- break;
69
- case "after":
70
- e.after(a);
71
- break;
72
- case "prepend":
73
- e.prepend(a);
74
- break;
75
- case "append":
76
- e.append(a);
77
- break;
78
- }
79
- i = a;
80
- }
81
- return i;
82
- }
83
- //#endregion
84
- export { h as a, d as i, a as n, s as o, o as r, p as s, f as t };
@@ -1,87 +0,0 @@
1
- import "../../../logger-6z_gb4rA.js";
2
- import { d as e, r as t } from "../../../supports-0XIfd4-R.js";
3
- import { r as n } from "../../../dom-DGePXPpM.js";
4
- import { createEffect as r, createEvent as i, createStore as a, sample as o } from "effector";
5
- //#region src/plugins/dom-observer/plugin.ts
6
- var s = /* @__PURE__ */ new WeakSet(), c = () => ({
7
- name: "dom-observer",
8
- setup: (e) => {
9
- l() && (s.has(e) || (s.add(e), u(e)));
10
- }
11
- });
12
- function l() {
13
- return !(!e() || !t() || typeof MutationObserver != "function" || typeof requestAnimationFrame != "function");
14
- }
15
- function u(e) {
16
- n().then(() => {
17
- document.body && d(e);
18
- });
19
- }
20
- function d(e) {
21
- let t = i(), n = a(/* @__PURE__ */ new Map()).on(t, (e, { id: t, selectors: n }) => {
22
- let r = new Map(e);
23
- return n.length > 0 ? r.set(t, n) : r.delete(t), r;
24
- }), s = /* @__PURE__ */ new Map();
25
- e.experiences.listStore.watch((e) => {
26
- for (let n of e) {
27
- if (s.has(n.id)) continue;
28
- let e = n.configStore.watch((e) => {
29
- t({
30
- id: n.id,
31
- selectors: f(e.targetSelectors)
32
- });
33
- });
34
- s.set(n.id, e);
35
- }
36
- });
37
- let c = r(async (e) => {
38
- await Promise.all(e.map(async (e) => {
39
- await e.shouldInitialiseFx() && await e.initialiseFx(void 0);
40
- }));
41
- });
42
- c.fail.watch(({ error: e }) => {});
43
- let l = i();
44
- o({
45
- clock: l,
46
- source: {
47
- selectorsById: n,
48
- experiences: e.experiences.listStore
49
- },
50
- fn: ({ selectorsById: e, experiences: t }, n) => t.filter((t) => {
51
- let r = e.get(t.id);
52
- return r ? r.some((e) => p(n, e)) : !1;
53
- }),
54
- target: c
55
- });
56
- let u = [], d, m = () => {
57
- d = void 0;
58
- let e = u;
59
- u = [], l(e);
60
- };
61
- new MutationObserver((e) => {
62
- let t = !1;
63
- for (let n of e) if (n.type === "childList") for (let e of n.addedNodes) e instanceof Element && (u.push(e), t = !0);
64
- t && (d ??= requestAnimationFrame(m));
65
- }).observe(document.body, {
66
- childList: !0,
67
- subtree: !0
68
- });
69
- }
70
- function f(e) {
71
- let t = [];
72
- for (let n of e) {
73
- let e = n.selector.trim();
74
- e.length > 0 && t.push(e);
75
- }
76
- return t;
77
- }
78
- function p(e, t) {
79
- for (let n of e) try {
80
- if (n.matches(t) || n.querySelector(t) !== null) return !0;
81
- } catch {
82
- return !1;
83
- }
84
- return !1;
85
- }
86
- //#endregion
87
- export { c as domObserverPlugin };