@picked/client 0.0.1-dev.1777611471601 → 0.0.1-dev.1777612433193
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-UYfzBUGT.js → api-BITDxiKp.js} +1 -1
- package/dist/{api-CP_eIRW2.cjs → api-DzvLjSVi.cjs} +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/server/index.js +1 -1
- package/dist/esm/form/index.js +38 -32
- package/dist/esm/index.js +294 -169
- package/dist/esm/plugins/create-experience/index.js +1 -1
- package/dist/esm/plugins/dynamic-experiences/index.js +1 -1
- package/dist/esm/plugins/experience-browser-storage/index.js +1 -1
- 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/server/index.js +1 -1
- package/dist/experience-instance-DC2gKwA6.cjs +1 -0
- package/dist/experience-instance-DJaNc5Ob.js +486 -0
- package/dist/types/form/create-form.d.ts +55 -0
- package/dist/types/form/create-form.d.ts.map +1 -1
- package/package.json +1 -11
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/esm/plugins/dom-observer/index.js +0 -58
- package/dist/experience-BhteyYBl.cjs +0 -1
- package/dist/experience-CoMdlvyn.js +0 -136
- package/dist/experience-instance-CZDcicPj.cjs +0 -1
- package/dist/experience-instance-IkIw31Cg.js +0 -387
- package/dist/nodes-ChVU1VZO.js +0 -101
- package/dist/nodes-DDDs-rC2.cjs +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 -37
- package/dist/types/plugins/dom-observer/plugin.d.ts.map +0 -1
- /package/dist/{id-Bbodazn8.cjs → id-Bv44ilEo.cjs} +0 -0
- /package/dist/{id-B-N2zNbS.js → id-CRqy981z.js} +0 -0
- /package/dist/{storage-hOHCCXvP.js → storage-6Xk0uAxB.js} +0 -0
- /package/dist/{storage-BXSlLTRa.cjs → storage-B6lQtc4-.cjs} +0 -0
package/dist/nodes-DDDs-rC2.cjs
DELETED
|
@@ -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}function g(e){return e.type===`condition`}function _(e){return e.type===`step`}function v(e){return e.type===`experience`}function y(e){return e.type===`origin`}function b(e){return e.type===`action`}Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return p}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dom-observer/index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAC3D,OAAO,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
/**
|
|
3
|
-
* Watches the document for added nodes that match an experience target
|
|
4
|
-
* selector, and re-runs `initialiseExperiences` when one appears. Decouples
|
|
5
|
-
* DOM-driven reconciliation from route detection: any DOM addition that
|
|
6
|
-
* brings a target into existence — SPA navigations, lazy mounts, framework
|
|
7
|
-
* hydration, modal opens, infinite scroll — will spawn the experience
|
|
8
|
-
* without the consumer wiring a router-specific hook.
|
|
9
|
-
*
|
|
10
|
-
* Behaviour:
|
|
11
|
-
* - Installs a single `MutationObserver` on `document.body` with
|
|
12
|
-
* `{ childList: true, subtree: true }`.
|
|
13
|
-
* - On each batch, walks added nodes and short-circuits on the first one
|
|
14
|
-
* that matches (or contains a descendant matching) any registered
|
|
15
|
-
* experience's target selector.
|
|
16
|
-
* - When a match is found, schedules a single coalesced
|
|
17
|
-
* `initialiseExperiences` call on the next animation frame; further
|
|
18
|
-
* mutations during that frame collapse into the same call.
|
|
19
|
-
* - Single-flight: a trailing call is scheduled if mutations arrive while
|
|
20
|
-
* reconciliation is in flight.
|
|
21
|
-
* - Selector set is rebuilt whenever `client.experiences.listStore`
|
|
22
|
-
* changes, so newly registered experiences extend the watch list
|
|
23
|
-
* without restarting the observer.
|
|
24
|
-
*
|
|
25
|
-
* No-ops outside browser environments and on partial-DOM runtimes that
|
|
26
|
-
* lack `MutationObserver`, `requestAnimationFrame`, or `document.body`.
|
|
27
|
-
*
|
|
28
|
-
* @returns {Plugin} The plugin.
|
|
29
|
-
* @example
|
|
30
|
-
* ```typescript
|
|
31
|
-
* createClient({
|
|
32
|
-
* plugins: [domObserverPlugin()]
|
|
33
|
-
* })
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
export declare const domObserverPlugin: () => Plugin;
|
|
37
|
-
//# 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":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,eAAO,MAAM,iBAAiB,QAAO,MAiBpC,CAAA"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|