@picked/client 0.0.62-next.12 → 0.0.62-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.
- package/dist/api-C-Q9t21v.cjs +1 -0
- package/dist/{api-BTbEUnGh.js → api-Cfb-8mqu.js} +1 -1
- package/dist/cjs/form/index.js +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +1 -1
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/web-components/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/docs/image-optimisation-service.md +6 -6
- package/dist/docs/sdk/content-security-policy.md +7 -8
- package/dist/docs/sdk/fields.md +2 -2
- package/dist/docs/workspaces.mdx +1 -1
- package/dist/esm/form/index.js +1 -1
- package/dist/esm/index.js +472 -1015
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +60 -133
- package/dist/esm/plugins/experience-browser-storage/index.js +6 -9
- package/dist/esm/plugins/history-browser-storage/index.js +1 -1
- package/dist/esm/plugins/responses-browser-storage/index.js +1 -1
- package/dist/esm/plugins/single-page-app/index.js +1 -1
- package/dist/esm/plugins/web-components/index.js +1 -1
- package/dist/esm/server/index.js +13 -23
- package/dist/experience-instance-DC2gKwA6.cjs +1 -0
- package/dist/experience-instance-DJaNc5Ob.js +486 -0
- package/dist/rules-logic-BTIxfrJJ.js +240 -0
- package/dist/rules-logic-DNLOv90w.cjs +1 -0
- package/dist/types/entities/action/action.d.ts +3 -6
- package/dist/types/entities/action/action.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +2 -39
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +113 -69
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +2 -17
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +2 -26
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +3 -24
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +1 -32
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +3 -24
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/step/step.d.ts +2 -17
- package/dist/types/entities/step/step.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -8
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +1 -1
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +186 -141
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +1 -2
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +1 -18
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +1 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +1 -63
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +1 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +1 -1
- package/dist/types/plugins/web-components/plugin.d.ts.map +1 -1
- package/dist/types/server/index.d.ts +0 -7
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +1 -1
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +9 -4
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +26 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/user-session.d.ts +12 -0
- package/dist/types/utils/user-session.d.ts.map +1 -0
- package/package.json +2 -12
- package/dist/api-DDd_Zf11.cjs +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/dom-C3C6Fmwz.cjs +0 -1
- package/dist/dom-DGePXPpM.js +0 -84
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/experience-instance-DImym3m_.js +0 -419
- package/dist/experience-instance-DygAdzbn.cjs +0 -1
- package/dist/rules-logic-D_CVBuv7.js +0 -13
- package/dist/rules-logic-H6P8xwHF.cjs +0 -1
- package/dist/types/entities/content/content.d.ts +0 -37
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -45
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -47
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -24
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -37
- package/dist/types/lifecycle/state-snapshot.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/index.d.ts +0 -3
- package/dist/types/plugins/dom-observer/index.d.ts.map +0 -1
- package/dist/types/plugins/dom-observer/plugin.d.ts +0 -50
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- /package/dist/{id-Cg7fVl1O.cjs → id-Bv44ilEo.cjs} +0 -0
- /package/dist/{id-n2yrHvNo.js → id-CRqy981z.js} +0 -0
- /package/dist/{object-DvUDOytC.js → object-C82v79xc.js} +0 -0
- /package/dist/{object-ThO1DEyl.cjs → object-CUJOjanb.cjs} +0 -0
- /package/dist/{storage-hOHCCXvP.js → storage-6Xk0uAxB.js} +0 -0
- /package/dist/{storage-BXSlLTRa.cjs → storage-B6lQtc4-.cjs} +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
/**
|
|
3
|
-
* Watches the document for `childList` mutations and reconciles experiences
|
|
4
|
-
* whose declared target selectors match newly added DOM subtrees. Each
|
|
5
|
-
* matching experience runs through its per-experience `shouldInitialiseFx`,
|
|
6
|
-
* and on `true` is handed to its `initialiseFx(undefined)`.
|
|
7
|
-
*
|
|
8
|
-
* Scope: lazy-mounted target hosts that arrive after the initial bulk init
|
|
9
|
-
* in `picked.ts`. Route-driven re-initialisation (decisionLogic depending
|
|
10
|
-
* on `location.pathname`, lifecycle event re-fires, plugin start hooks)
|
|
11
|
-
* is the responsibility of `singlePageAppPlugin`, which calls
|
|
12
|
-
* `client.start()` on history events. Pair the two plugins to cover both.
|
|
13
|
-
*
|
|
14
|
-
* Pipeline:
|
|
15
|
-
* - Each experience's `configStore.watch()` pushes its trimmed selectors
|
|
16
|
-
* into a reactive `Store<Map<id, string[]>>`. Empty / whitespace-only
|
|
17
|
-
* selectors are filtered out.
|
|
18
|
-
* - A single `MutationObserver` collects `Element` instances from
|
|
19
|
-
* `childList.addedNodes` across one animation frame, then fires a
|
|
20
|
-
* single `mutationObserved` event carrying the collected elements.
|
|
21
|
-
* - `sample` filters registered experiences to those whose selectors
|
|
22
|
-
* match at least one added element via `el.matches` or
|
|
23
|
-
* `el.querySelector`. Malformed selectors are skipped per-experience
|
|
24
|
-
* without poisoning the rest of the batch. The matched array is
|
|
25
|
-
* routed straight into `reconcileMatchedFx` via `sample.target`.
|
|
26
|
-
* - `reconcileMatchedFx` invokes each experience's
|
|
27
|
-
* `shouldInitialiseFx`, and on `true` its `initialiseFx(undefined)`.
|
|
28
|
-
* `initialiseFx` is idempotent: tagged target elements are skipped
|
|
29
|
-
* on subsequent passes.
|
|
30
|
-
*
|
|
31
|
-
* Setup is deferred until `document.body` is parsed, so SDKs loaded from
|
|
32
|
-
* `<head>` without `defer` (the standard Shopify-theme / GTM-template
|
|
33
|
-
* pattern) still install once the body becomes available.
|
|
34
|
-
*
|
|
35
|
-
* No-ops outside browser environments and on partial-DOM runtimes that
|
|
36
|
-
* lack `MutationObserver` or `requestAnimationFrame`. `MutationObserver`
|
|
37
|
-
* does not cross shadow root or iframe boundaries, so experiences whose
|
|
38
|
-
* target lives inside a shadow tree or a cross-origin frame are not
|
|
39
|
-
* reconciled by this plugin.
|
|
40
|
-
*
|
|
41
|
-
* @returns {Plugin} The plugin.
|
|
42
|
-
* @example
|
|
43
|
-
* ```typescript
|
|
44
|
-
* createClient({
|
|
45
|
-
* plugins: [domObserverPlugin()]
|
|
46
|
-
* })
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare const domObserverPlugin: () => Plugin;
|
|
50
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dom-observer/plugin.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8CG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAiBpC,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|