@picked/client 0.0.1-dev.1789541668638 → 0.0.1-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/README.md +8 -0
- package/dist/cjs/index.js +1 -4
- package/dist/cjs/plugins/create-experience/index.js +1 -1
- package/dist/cjs/plugins/experience-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/history-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-browserstorage-plugin/index.js +1 -0
- package/dist/cjs/plugins/responses-indexeddb-plugin/index.js +1 -0
- package/dist/cjs/plugins/shopify/index.js +1 -0
- package/dist/cjs/plugins/single-page-app/index.js +1 -1
- package/dist/cjs/plugins/window-object/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +739 -1814
- package/dist/esm/plugins/create-experience/index.js +398 -490
- package/dist/esm/plugins/experience-browserstorage-plugin/index.js +38 -0
- package/dist/esm/plugins/history-browserstorage-plugin/index.js +26 -0
- package/dist/esm/plugins/responses-browserstorage-plugin/index.js +36 -0
- package/dist/esm/plugins/responses-indexeddb-plugin/index.js +101 -0
- package/dist/esm/plugins/shopify/index.js +59 -0
- package/dist/esm/plugins/single-page-app/index.js +35 -31
- package/dist/esm/plugins/window-object/index.js +9 -9
- package/dist/esm/server/index.js +89 -141
- package/dist/experience-instance-6ZKZS7dF.cjs +1 -0
- package/dist/experience-instance-BA0EXYg5.js +712 -0
- package/dist/id-BKIWbSTy.cjs +1 -0
- package/dist/id-BW-g3y32.js +6 -0
- package/dist/logger-BsmHUUw1.cjs +1 -0
- package/dist/logger-C9a75KZn.js +5 -0
- package/dist/object-BbFTsGh3.cjs +1 -0
- package/dist/object-JwZ58NOH.js +28 -0
- package/dist/storage-BPJwmlva.cjs +1 -0
- package/dist/storage-D87xFySf.js +85 -0
- package/dist/supports-BvrzQAVk.js +79 -0
- package/dist/supports-C0y3-V5V.cjs +1 -0
- package/dist/types/client.d.ts +23 -119
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/entities/component/component.d.ts +6 -45
- package/dist/types/entities/component/component.d.ts.map +1 -1
- package/dist/types/entities/experience/experience.d.ts +99 -160
- package/dist/types/entities/experience/experience.d.ts.map +1 -1
- package/dist/types/entities/experience-instance/experience-instance.d.ts +113 -83
- package/dist/types/entities/experience-instance/experience-instance.d.ts.map +1 -1
- package/dist/types/entities/feature/feature.d.ts +8 -118
- package/dist/types/entities/feature/feature.d.ts.map +1 -1
- package/dist/types/entities/field/field.d.ts +64 -96
- package/dist/types/entities/field/field.d.ts.map +1 -1
- package/dist/types/entities/framework/framework.d.ts +7 -32
- package/dist/types/entities/framework/framework.d.ts.map +1 -1
- package/dist/types/entities/history/history.d.ts +6 -6
- package/dist/types/entities/history/history.d.ts.map +1 -1
- package/dist/types/entities/plugin/plugin.d.ts +2 -41
- package/dist/types/entities/plugin/plugin.d.ts.map +1 -1
- package/dist/types/entities/predicate/predicate.d.ts +7 -30
- package/dist/types/entities/predicate/predicate.d.ts.map +1 -1
- package/dist/types/entities/project/project.d.ts +9 -0
- package/dist/types/entities/project/project.d.ts.map +1 -0
- package/dist/types/entities/response/response.d.ts +21 -57
- package/dist/types/entities/response/response.d.ts.map +1 -1
- package/dist/types/exports.d.ts +4 -22
- package/dist/types/exports.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -12
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/logic-engine.d.ts +11 -13
- package/dist/types/logic-engine.d.ts.map +1 -1
- package/dist/types/picked.d.ts +184 -381
- package/dist/types/picked.d.ts.map +1 -1
- package/dist/types/ping.d.ts +10 -0
- package/dist/types/ping.d.ts.map +1 -0
- package/dist/types/plugins/create-experience/create-experience.d.ts +44 -119
- package/dist/types/plugins/create-experience/create-experience.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/index.d.ts +2 -2
- package/dist/types/plugins/create-experience/index.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/plugin.d.ts +2 -3
- package/dist/types/plugins/create-experience/plugin.d.ts.map +1 -1
- package/dist/types/plugins/create-experience/serialization.d.ts.map +1 -1
- package/dist/types/plugins/experience-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/experience-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/history-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/plugin.d.ts +1 -2
- package/dist/types/plugins/history-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts +6 -0
- package/dist/types/plugins/responses-browserstorage-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/index.d.ts.map +1 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts +3 -0
- package/dist/types/plugins/responses-indexeddb-plugin/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/index.d.ts +2 -0
- package/dist/types/plugins/shopify/index.d.ts.map +1 -0
- package/dist/types/plugins/shopify/plugin.d.ts +3 -0
- package/dist/types/plugins/shopify/plugin.d.ts.map +1 -0
- package/dist/types/plugins/shopify/shopify.d.ts +28 -0
- package/dist/types/plugins/shopify/shopify.d.ts.map +1 -0
- package/dist/types/plugins/single-page-app/plugin.d.ts +2 -2
- package/dist/types/plugins/single-page-app/plugin.d.ts.map +1 -1
- package/dist/types/plugins/window-object/plugin.d.ts +2 -2
- package/dist/types/server/index.d.ts +3 -18
- package/dist/types/server/index.d.ts.map +1 -1
- package/dist/types/utils/dom.d.ts +6 -4
- package/dist/types/utils/dom.d.ts.map +1 -1
- package/dist/types/utils/events.d.ts +38 -83
- package/dist/types/utils/events.d.ts.map +1 -1
- package/dist/types/utils/global-obj.d.ts +2 -1
- package/dist/types/utils/global-obj.d.ts.map +1 -1
- package/dist/types/utils/id.d.ts.map +1 -1
- package/dist/types/utils/indexed-db.d.ts +1 -2
- package/dist/types/utils/indexed-db.d.ts.map +1 -1
- package/dist/types/utils/logger.d.ts +1 -2
- package/dist/types/utils/logger.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts +3 -0
- package/dist/types/utils/node-tree/get-next-node-from-conditional.d.ts.map +1 -0
- package/dist/types/utils/node-tree/get-next-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-next-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts +1 -1
- package/dist/types/utils/node-tree/get-origin-node.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts +7 -17
- package/dist/types/utils/node-tree/min-max-steps-to-leaf.d.ts.map +1 -1
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts +8 -19
- package/dist/types/utils/node-tree/min-max-steps-to-origin.d.ts.map +1 -1
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts +7 -31
- package/dist/types/utils/node-tree/next-reachable-step-nodes.d.ts.map +1 -1
- package/dist/types/utils/nodes.d.ts +2 -3
- package/dist/types/utils/nodes.d.ts.map +1 -1
- package/dist/types/utils/object.d.ts +8 -0
- package/dist/types/utils/object.d.ts.map +1 -1
- package/dist/types/utils/rules-logic.d.ts +3 -33
- package/dist/types/utils/rules-logic.d.ts.map +1 -1
- package/dist/types/utils/search-params.d.ts.map +1 -1
- package/dist/types/utils/state-snaphot.d.ts +16 -0
- package/dist/types/utils/state-snaphot.d.ts.map +1 -0
- package/dist/types/utils/storage.d.ts +11 -374
- package/dist/types/utils/storage.d.ts.map +1 -1
- package/dist/types/utils/supports.d.ts +0 -87
- package/dist/types/utils/supports.d.ts.map +1 -1
- package/package.json +49 -182
- package/dist/.tsbuildinfo +0 -1
- package/dist/api-C7q_7vxn.js +0 -22
- package/dist/api-Ctvh1qkk.cjs +0 -1
- package/dist/cjs/form/index.js +0 -1
- package/dist/cjs/plugins/dom-observer/index.js +0 -1
- package/dist/cjs/plugins/dynamic-experiences/index.js +0 -1
- package/dist/cjs/plugins/experience-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/history-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-browser-storage/index.js +0 -1
- package/dist/cjs/plugins/responses-indexeddb/index.js +0 -1
- package/dist/cjs/plugins/telemetry/index.js +0 -1
- package/dist/cjs/plugins/web-components/index.js +0 -1
- package/dist/cjs/preview/index.js +0 -1
- package/dist/docs/_root.css +0 -101
- package/dist/docs/explanation/conditions-and-the-logic-engine.md +0 -94
- package/dist/docs/explanation/content-references.md +0 -99
- package/dist/docs/explanation/feature-flag-allocation.md +0 -218
- package/dist/docs/explanation/how-picked-works.md +0 -124
- package/dist/docs/explanation/how-pickedql-works.md +0 -76
- package/dist/docs/explanation/pages-and-flows.md +0 -64
- package/dist/docs/explanation/the-content-model.md +0 -87
- package/dist/docs/explanation/the-two-apis.md +0 -68
- package/dist/docs/explanation/why-server-side-rendering.md +0 -76
- package/dist/docs/explanation/workspaces-and-versions.md +0 -71
- package/dist/docs/how-to/add-a-step-field-or-action.md +0 -43
- package/dist/docs/how-to/analytics/index.md +0 -316
- package/dist/docs/how-to/archive-or-delete-a-workspace.md +0 -46
- package/dist/docs/how-to/authenticate-the-cli.md +0 -97
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -40
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -51
- package/dist/docs/how-to/authenticate-with-an-api-key.md +0 -51
- package/dist/docs/how-to/authenticate-with-oauth.md +0 -40
- package/dist/docs/how-to/build-a-flow.md +0 -83
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -38
- package/dist/docs/how-to/create-a-content-entry.md +0 -48
- package/dist/docs/how-to/create-a-project.md +0 -29
- package/dist/docs/how-to/create-an-experience.md +0 -42
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +0 -42
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +0 -57
- package/dist/docs/how-to/define-a-page-layout.md +0 -46
- package/dist/docs/how-to/fill-and-publish-a-page.md +0 -66
- package/dist/docs/how-to/install-the-gtm-template.md +0 -84
- package/dist/docs/how-to/install-the-sdk.md +0 -93
- package/dist/docs/how-to/install-the-vite-plugin.md +0 -69
- package/dist/docs/how-to/invite-and-remove-members.md +0 -35
- package/dist/docs/how-to/point-one-entry-at-another.md +0 -61
- package/dist/docs/how-to/preview-a-workspace.md +0 -28
- package/dist/docs/how-to/publish-a-workspace.md +0 -30
- package/dist/docs/how-to/read-a-feature-flag.md +0 -113
- package/dist/docs/how-to/read-a-referenced-entry.md +0 -109
- package/dist/docs/how-to/register-a-component.md +0 -55
- package/dist/docs/how-to/register-an-action-handler.md +0 -67
- package/dist/docs/how-to/render-a-step-form.md +0 -131
- package/dist/docs/how-to/render-an-unpublished-preview.md +0 -41
- package/dist/docs/how-to/reuse-a-section.md +0 -53
- package/dist/docs/how-to/reuse-a-step-field-or-action.md +0 -28
- package/dist/docs/how-to/roll-back-a-published-version.md +0 -26
- package/dist/docs/how-to/run-an-ab-test.md +0 -49
- package/dist/docs/how-to/run-code-on-a-form-submission.md +0 -125
- package/dist/docs/how-to/server-render-a-page.md +0 -81
- package/dist/docs/how-to/set-a-content-security-policy.md +0 -32
- package/dist/docs/how-to/set-up-mfa.md +0 -69
- package/dist/docs/how-to/switch-workspaces.md +0 -122
- package/dist/docs/how-to/upload-and-use-an-asset.mdx +0 -73
- package/dist/docs/how-to/validate-a-field.md +0 -52
- package/dist/docs/how-to/write-a-condition.md +0 -45
- package/dist/docs/how-to/write-a-predicate.md +0 -60
- package/dist/docs/index.md +0 -59
- package/dist/docs/reference/dashboard/actions.mdx +0 -53
- package/dist/docs/reference/dashboard/api-keys.mdx +0 -38
- package/dist/docs/reference/dashboard/conditions.mdx +0 -42
- package/dist/docs/reference/dashboard/content/asset-library.mdx +0 -63
- package/dist/docs/reference/dashboard/content/blocks.mdx +0 -57
- package/dist/docs/reference/dashboard/content/content-entries.mdx +0 -95
- package/dist/docs/reference/dashboard/content/models.mdx +0 -108
- package/dist/docs/reference/dashboard/content/pages.mdx +0 -61
- package/dist/docs/reference/dashboard/experiences.mdx +0 -51
- package/dist/docs/reference/dashboard/features.mdx +0 -154
- package/dist/docs/reference/dashboard/fields.mdx +0 -106
- package/dist/docs/reference/dashboard/flow-builder/canvas.mdx +0 -58
- package/dist/docs/reference/dashboard/flow-builder/condition-builder.md +0 -57
- package/dist/docs/reference/dashboard/flow-builder/keyboard-shortcuts.md +0 -72
- package/dist/docs/reference/dashboard/flow-builder/nodes.md +0 -63
- package/dist/docs/reference/dashboard/projects.mdx +0 -44
- package/dist/docs/reference/dashboard/reports.mdx +0 -43
- package/dist/docs/reference/dashboard/steps.mdx +0 -37
- package/dist/docs/reference/dashboard/team-management.md +0 -29
- package/dist/docs/reference/dashboard/workspace-versioning.mdx +0 -30
- package/dist/docs/reference/dashboard/workspaces.mdx +0 -76
- package/dist/docs/reference/delivery-api/experience-content.md +0 -152
- package/dist/docs/reference/delivery-api/index.md +0 -45
- package/dist/docs/reference/delivery-api/preview-caching-crawling.md +0 -79
- package/dist/docs/reference/delivery-api/project-config.md +0 -65
- package/dist/docs/reference/delivery-api/workspace-schema.md +0 -85
- package/dist/docs/reference/glossary.md +0 -181
- package/dist/docs/reference/management-api/authentication.md +0 -74
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -285
- package/dist/docs/reference/management-api/error-handling.md +0 -233
- package/dist/docs/reference/management-api/pagination.md +0 -192
- package/dist/docs/reference/pickedql/data-sources.md +0 -174
- package/dist/docs/reference/pickedql/dimensions.md +0 -103
- package/dist/docs/reference/pickedql/filtering.md +0 -64
- package/dist/docs/reference/pickedql/index.md +0 -18
- package/dist/docs/reference/pickedql/schema.md +0 -172
- package/dist/docs/reference/pickedql/virtual-functions.md +0 -248
- package/dist/docs/reference/sdk/actions.md +0 -30
- package/dist/docs/reference/sdk/analytics-events.md +0 -445
- package/dist/docs/reference/sdk/conditions.md +0 -147
- package/dist/docs/reference/sdk/content-security-policy.md +0 -21
- package/dist/docs/reference/sdk/content.md +0 -213
- package/dist/docs/reference/sdk/experiences.md +0 -51
- package/dist/docs/reference/sdk/features.md +0 -256
- package/dist/docs/reference/sdk/fields.md +0 -255
- package/dist/docs/reference/sdk/index.md +0 -68
- package/dist/docs/reference/sdk/plugins/create-experience.md +0 -123
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +0 -74
- package/dist/docs/reference/sdk/plugins/index.md +0 -29
- package/dist/docs/reference/sdk/plugins/window-object.md +0 -25
- package/dist/docs/reference/sdk/predicates.md +0 -43
- package/dist/docs/reference/sdk/ssr/index.md +0 -33
- package/dist/docs/reference/sdk/ssr/rendering-and-hydration.md +0 -103
- package/dist/docs/reference/sdk/ssr/serialize.md +0 -80
- package/dist/docs/reference/sdk/ssr/slots-and-placements.md +0 -59
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -196
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -146
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -90
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -228
- package/dist/docs/tutorials/first-experience-in-the-dashboard.mdx +0 -143
- package/dist/docs/tutorials/first-experience.mdx +0 -254
- package/dist/docs/tutorials/first-server-rendered-page.mdx +0 -186
- package/dist/dom-BqcToNL0.js +0 -82
- package/dist/dom-DlLH3FxV.cjs +0 -1
- package/dist/emit-D-tLiWL1.cjs +0 -1
- package/dist/emit-Ds2EG7CB.js +0 -14
- package/dist/esm/form/index.js +0 -565
- package/dist/esm/plugins/dom-observer/index.js +0 -87
- package/dist/esm/plugins/dynamic-experiences/index.js +0 -5
- package/dist/esm/plugins/experience-browser-storage/index.js +0 -38
- package/dist/esm/plugins/history-browser-storage/index.js +0 -26
- package/dist/esm/plugins/responses-browser-storage/index.js +0 -71
- package/dist/esm/plugins/responses-indexeddb/index.js +0 -89
- package/dist/esm/plugins/telemetry/index.js +0 -100
- package/dist/esm/plugins/web-components/index.js +0 -19
- package/dist/esm/preview/index.js +0 -2
- package/dist/experience-instance-B9S6Yf0N.js +0 -711
- package/dist/experience-instance-D8rOg6We.cjs +0 -1
- package/dist/id-Bo4RBeOs.js +0 -4
- package/dist/id-Js-62re-.cjs +0 -1
- package/dist/inert-script-report-B_bMPRzp.js +0 -18
- package/dist/inert-script-report-ijRHPtcY.cjs +0 -1
- package/dist/logger-CSTvAyyB.cjs +0 -1
- package/dist/logger-DMN6TxJJ.js +0 -4
- package/dist/object-BUDGxEqy.js +0 -25
- package/dist/object-CIkt7Fkr.cjs +0 -1
- package/dist/plugin-ChafFq6S.js +0 -194
- package/dist/plugin-Dn25Gffy.cjs +0 -1
- package/dist/preview-channel-CSr96XAo.js +0 -98
- package/dist/preview-channel-Cx0e6fye.cjs +0 -1
- package/dist/protocol-Bb_vpLKE.cjs +0 -1
- package/dist/protocol-C5KkkiZc.js +0 -84
- package/dist/provider-B8wvmeC8.js +0 -98
- package/dist/provider-BBLlQOjV.cjs +0 -1
- package/dist/registry-C1t8l3t9.cjs +0 -1
- package/dist/registry-CXZv0uLg.js +0 -18
- package/dist/rules-logic-CGZIYgAI.cjs +0 -1
- package/dist/rules-logic-HesIUCu6.js +0 -13
- package/dist/storage-1MW3-_As.js +0 -103
- package/dist/storage-DUw9UJ2h.cjs +0 -1
- package/dist/supports-CO9bJGNl.js +0 -92
- package/dist/supports-DBzjGaWD.cjs +0 -1
- package/dist/types/data-source/api.d.ts +0 -60
- package/dist/types/data-source/api.d.ts.map +0 -1
- package/dist/types/data-source/provider.d.ts +0 -103
- package/dist/types/data-source/provider.d.ts.map +0 -1
- package/dist/types/data-source/registry.d.ts +0 -26
- package/dist/types/data-source/registry.d.ts.map +0 -1
- package/dist/types/data-source/request-observer.d.ts +0 -62
- package/dist/types/data-source/request-observer.d.ts.map +0 -1
- package/dist/types/data-source/virtual-data.d.ts +0 -19
- package/dist/types/data-source/virtual-data.d.ts.map +0 -1
- package/dist/types/entities/action/action.d.ts +0 -85
- package/dist/types/entities/action/action.d.ts.map +0 -1
- package/dist/types/entities/component/lazyComponent.d.ts +0 -11
- package/dist/types/entities/component/lazyComponent.d.ts.map +0 -1
- package/dist/types/entities/condition/condition.d.ts +0 -29
- package/dist/types/entities/condition/condition.d.ts.map +0 -1
- package/dist/types/entities/content/content.d.ts +0 -53
- package/dist/types/entities/content/content.d.ts.map +0 -1
- package/dist/types/entities/content/reference.d.ts +0 -101
- package/dist/types/entities/content/reference.d.ts.map +0 -1
- package/dist/types/entities/field/policies.d.ts +0 -35
- package/dist/types/entities/field/policies.d.ts.map +0 -1
- package/dist/types/entities/response/response-validation.d.ts +0 -75
- package/dist/types/entities/response/response-validation.d.ts.map +0 -1
- package/dist/types/entities/session/session.d.ts +0 -46
- package/dist/types/entities/session/session.d.ts.map +0 -1
- package/dist/types/entities/step/step.d.ts +0 -56
- package/dist/types/entities/step/step.d.ts.map +0 -1
- package/dist/types/form/build-responses.d.ts +0 -18
- package/dist/types/form/build-responses.d.ts.map +0 -1
- package/dist/types/form/create-field-evaluator.d.ts +0 -28
- package/dist/types/form/create-field-evaluator.d.ts.map +0 -1
- package/dist/types/form/create-field-validation.d.ts +0 -60
- package/dist/types/form/create-field-validation.d.ts.map +0 -1
- package/dist/types/form/create-form.d.ts +0 -153
- package/dist/types/form/create-form.d.ts.map +0 -1
- package/dist/types/form/create-submit-pipeline.d.ts +0 -116
- package/dist/types/form/create-submit-pipeline.d.ts.map +0 -1
- package/dist/types/form/get-step-fields.d.ts +0 -19
- package/dist/types/form/get-step-fields.d.ts.map +0 -1
- package/dist/types/form/index.d.ts +0 -11
- package/dist/types/form/index.d.ts.map +0 -1
- package/dist/types/lifecycle/condition-selection.d.ts +0 -146
- package/dist/types/lifecycle/condition-selection.d.ts.map +0 -1
- package/dist/types/lifecycle/lifecycle.d.ts +0 -48
- package/dist/types/lifecycle/lifecycle.d.ts.map +0 -1
- package/dist/types/lifecycle/rules-logic.d.ts +0 -25
- package/dist/types/lifecycle/rules-logic.d.ts.map +0 -1
- package/dist/types/lifecycle/state-snapshot.d.ts +0 -38
- 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/types/plugins/dynamic-experiences/hash.d.ts +0 -105
- package/dist/types/plugins/dynamic-experiences/hash.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/index.d.ts +0 -7
- package/dist/types/plugins/dynamic-experiences/index.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts +0 -49
- package/dist/types/plugins/dynamic-experiences/plugin.d.ts.map +0 -1
- package/dist/types/plugins/dynamic-experiences/types.d.ts +0 -45
- package/dist/types/plugins/dynamic-experiences/types.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts +0 -7
- package/dist/types/plugins/experience-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/history-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts +0 -18
- package/dist/types/plugins/responses-browser-storage/plugin.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/index.d.ts.map +0 -1
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts +0 -3
- package/dist/types/plugins/responses-indexeddb/plugin.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/emit.d.ts +0 -18
- package/dist/types/plugins/telemetry/emit.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/index.d.ts +0 -4
- package/dist/types/plugins/telemetry/index.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin-summary.d.ts +0 -10
- package/dist/types/plugins/telemetry/plugin-summary.d.ts.map +0 -1
- package/dist/types/plugins/telemetry/plugin.d.ts +0 -45
- package/dist/types/plugins/telemetry/plugin.d.ts.map +0 -1
- package/dist/types/plugins/web-components/index.d.ts +0 -2
- package/dist/types/plugins/web-components/index.d.ts.map +0 -1
- package/dist/types/plugins/web-components/plugin.d.ts +0 -4
- package/dist/types/plugins/web-components/plugin.d.ts.map +0 -1
- package/dist/types/preview/index.d.ts +0 -18
- package/dist/types/preview/index.d.ts.map +0 -1
- package/dist/types/preview-bridge/index.d.ts +0 -14
- package/dist/types/preview-bridge/index.d.ts.map +0 -1
- package/dist/types/preview-channel.d.ts +0 -16
- package/dist/types/preview-channel.d.ts.map +0 -1
- package/dist/types/preview-receiver/apply-ops.d.ts +0 -32
- package/dist/types/preview-receiver/apply-ops.d.ts.map +0 -1
- package/dist/types/preview-receiver/index.d.ts +0 -32
- package/dist/types/preview-receiver/index.d.ts.map +0 -1
- package/dist/types/preview-receiver/protocol.d.ts +0 -69
- package/dist/types/preview-receiver/protocol.d.ts.map +0 -1
- package/dist/types/schema-registry.d.ts +0 -206
- package/dist/types/schema-registry.d.ts.map +0 -1
- package/dist/types/server/serialize.d.ts +0 -87
- package/dist/types/server/serialize.d.ts.map +0 -1
- package/dist/types/typed-content.d.ts +0 -17
- package/dist/types/typed-content.d.ts.map +0 -1
- package/dist/types/utils/client-telemetry.d.ts +0 -25
- package/dist/types/utils/client-telemetry.d.ts.map +0 -1
- package/dist/types/utils/content-path.d.ts +0 -37
- package/dist/types/utils/content-path.d.ts.map +0 -1
- package/dist/types/utils/html-asset-value.d.ts +0 -20
- package/dist/types/utils/html-asset-value.d.ts.map +0 -1
- package/dist/types/utils/inert-script-report.d.ts +0 -40
- package/dist/types/utils/inert-script-report.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts +0 -25
- package/dist/types/utils/node-tree/get-next-node-from-action.d.ts.map +0 -1
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts +0 -17
- package/dist/types/utils/node-tree/get-next-node-from-condition.d.ts.map +0 -1
- package/dist/types/utils/node-tree/node-adjacency.d.ts +0 -50
- package/dist/types/utils/node-tree/node-adjacency.d.ts.map +0 -1
- package/dist/types/utils/node-tree/node-tree-index.d.ts +0 -57
- package/dist/types/utils/node-tree/node-tree-index.d.ts.map +0 -1
- package/dist/types/utils/picked-config.d.ts +0 -39
- package/dist/types/utils/picked-config.d.ts.map +0 -1
- package/dist/types/utils/preview-session.d.ts +0 -12
- package/dist/types/utils/preview-session.d.ts.map +0 -1
- package/dist/types/utils/rehydrate-scripts.d.ts +0 -50
- package/dist/types/utils/rehydrate-scripts.d.ts.map +0 -1
- package/dist/types/utils/render-string.d.ts +0 -24
- package/dist/types/utils/render-string.d.ts.map +0 -1
- package/dist/types/utils/user-timing.d.ts +0 -21
- package/dist/types/utils/user-timing.d.ts.map +0 -1
- package/dist/version-CLjPfmxk.cjs +0 -1
- package/dist/version-CPKulHMH.js +0 -256
- /package/dist/types/plugins/{experience-browser-storage → experience-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{history-browser-storage → history-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-browser-storage → responses-browserstorage-plugin}/index.d.ts +0 -0
- /package/dist/types/plugins/{responses-indexeddb → responses-indexeddb-plugin}/index.d.ts +0 -0
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { 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"}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
/** @file Deterministic, independent per-feature bucket allocation for A/B testing. */
|
|
2
|
-
/**
|
|
3
|
-
* FNV-1a 32-bit hash.
|
|
4
|
-
* Deterministic, fast, well-distributed for short strings.
|
|
5
|
-
*
|
|
6
|
-
* @param {string} input - String to hash.
|
|
7
|
-
* @returns {number} Unsigned 32-bit hash.
|
|
8
|
-
* @example
|
|
9
|
-
* ```typescript
|
|
10
|
-
* fnv1a32('sess_1:winter-sale')
|
|
11
|
-
* ```
|
|
12
|
-
*/
|
|
13
|
-
export declare function fnv1a32(input: string): number;
|
|
14
|
-
/**
|
|
15
|
-
* Deterministic dice roll for A/B testing.
|
|
16
|
-
*
|
|
17
|
-
* Returns a value 0–99 that is stable for a given session and feature. Seeding
|
|
18
|
-
* on the feature as well as the session keeps flags independent of one another:
|
|
19
|
-
* two flags at weight 50 each take half of sessions, and a quarter of sessions
|
|
20
|
-
* land in both. Independence rests on the avalanche in {@link fmix32}, not on
|
|
21
|
-
* the seed alone.
|
|
22
|
-
*
|
|
23
|
-
* The feature version keys the stored bucket rather than the roll, so
|
|
24
|
-
* publishing a new version re-runs `decide` against the current weight and an
|
|
25
|
-
* unchanged weight keeps the same audience.
|
|
26
|
-
*
|
|
27
|
-
* This is the boolean path's input. A multi-variant feature does not roll once
|
|
28
|
-
* and look the result up; {@link allocateVariant} scores each arm on its own
|
|
29
|
-
* seed. One roll per feature is still what keeps features independent of one
|
|
30
|
-
* another, per ADR-0018.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} sessionId - Current session id, stable across page loads.
|
|
33
|
-
* @param {string} featureId - Feature the roll is for.
|
|
34
|
-
* @returns {number} A value in the range 0 to 99.
|
|
35
|
-
* @example
|
|
36
|
-
* ```typescript
|
|
37
|
-
* const diceRoll = featureDiceRoll('sess_1', 'winter-sale')
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export declare function featureDiceRoll(sessionId: string, featureId: string): number;
|
|
41
|
-
/**
|
|
42
|
-
* Whether the given dice roll falls within the feature's weight.
|
|
43
|
-
*
|
|
44
|
-
* Widening a weight admits sessions the narrower weight excluded and never
|
|
45
|
-
* evicts one already inside, so a rollout can ratchet up without re-bucketing
|
|
46
|
-
* anyone. The roll is per feature, so this describes one feature's own weight
|
|
47
|
-
* changing over time; two features at the same weight overlap by chance.
|
|
48
|
-
*
|
|
49
|
-
* @param {number} diceRoll - Roll from {@link featureDiceRoll}, 0–99.
|
|
50
|
-
* @param {number} weight - Feature weight, 0–100.
|
|
51
|
-
* @returns {boolean} Whether the session is allocated to the feature.
|
|
52
|
-
* @example
|
|
53
|
-
* ```typescript
|
|
54
|
-
* isAllocated(42, 50) // true
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
export declare function isAllocated(diceRoll: number, weight: number): boolean;
|
|
58
|
-
/** The fields {@link allocateVariant} needs from an arm. */
|
|
59
|
-
export interface AllocatableVariant {
|
|
60
|
-
key: string;
|
|
61
|
-
weight: number;
|
|
62
|
-
}
|
|
63
|
-
/**
|
|
64
|
-
* Picks the arm a session lands in, scoring each arm independently.
|
|
65
|
-
*
|
|
66
|
-
* Each arm is hashed on its own key and scored against its own weight, and the
|
|
67
|
-
* highest score wins. An arm's score therefore depends on nothing but the
|
|
68
|
-
* session, the feature and that arm's own weight, which is what gives the two
|
|
69
|
-
* properties an author is entitled to assume:
|
|
70
|
-
*
|
|
71
|
-
* - Editing one arm's weight moves sessions only into or out of that arm. Two
|
|
72
|
-
* arms the author did not touch never trade sessions with each other.
|
|
73
|
-
* - Widening an arm only admits sessions and never evicts one already inside,
|
|
74
|
-
* the same ratchet {@link isAllocated} gives the boolean path. Narrowing is
|
|
75
|
-
* its mirror.
|
|
76
|
-
*
|
|
77
|
-
* Neither holds for cumulative ranges, where an arm's interval depends on every
|
|
78
|
-
* arm ordered before it, so a boundary shift upstream drags unrelated arms
|
|
79
|
-
* across it.
|
|
80
|
-
*
|
|
81
|
-
* Scores are compared, never summed, so the result is invariant under scaling
|
|
82
|
-
* every weight by the same factor: `1:1:2` and `10:10:20` allocate identically.
|
|
83
|
-
* Ties break on the key so that the arms' arrival order cannot matter — nothing
|
|
84
|
-
* in the delivery pipeline promises one.
|
|
85
|
-
*
|
|
86
|
-
* The chosen arm is returned whole rather than by key, so a caller reading its
|
|
87
|
-
* value needs no second lookup — and cannot resolve a duplicate key to a
|
|
88
|
-
* different arm than the one scored.
|
|
89
|
-
*
|
|
90
|
-
* @template T
|
|
91
|
-
* @param {string} sessionId - Current session id, stable across page loads.
|
|
92
|
-
* @param {string} featureKey - Feature being allocated.
|
|
93
|
-
* @param {readonly T[]} variants - The feature's arms, in any order.
|
|
94
|
-
* @returns {T | null} The chosen arm, or null when the set decides nobody.
|
|
95
|
-
* @example
|
|
96
|
-
* ```typescript
|
|
97
|
-
* // 'hero-b' takes three sessions in four; 'false' takes the fourth.
|
|
98
|
-
* allocateVariant('sess_1', 'hero', [
|
|
99
|
-
* { key: 'hero-b', weight: 3 },
|
|
100
|
-
* { key: 'false', weight: 1 },
|
|
101
|
-
* ])
|
|
102
|
-
* ```
|
|
103
|
-
*/
|
|
104
|
-
export declare function allocateVariant<T extends AllocatableVariant>(sessionId: string, featureKey: string, variants: readonly T[]): T | null;
|
|
105
|
-
//# sourceMappingURL=hash.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hash.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/hash.ts"],"names":[],"mappings":"AAAA,sFAAsF;AAEtF;;;;;;;;;;GAUG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAY7C;AA8BD;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,eAAe,CAAC,SAAS,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAE5E;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUrE;AAED,4DAA4D;AAC5D,MAAM,WAAW,kBAAkB;IACjC,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,MAAM,CAAA;CACf;AA4CD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,wBAAgB,eAAe,CAAC,CAAC,SAAS,kBAAkB,EAC1D,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,SAAS,CAAC,EAAE,GACrB,CAAC,GAAG,IAAI,CAmBV"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/** @file Public exports for the dynamic-experiences plugin (project config + per-experience content resolution). */
|
|
2
|
-
export { dynamicExperiencesPlugin, fetchExperienceContent, fetchProject } from './plugin';
|
|
3
|
-
export { createClientHeaders, fetchSchema } from '@picked/delivery-api-client';
|
|
4
|
-
export { registerPickedBundle } from '../../data-source/registry';
|
|
5
|
-
export type * from './types';
|
|
6
|
-
export type { ApiExperienceStep, ContentBlob, ExperienceContentResponse, FetchProjectOptions, ProjectConfig, ProjectConfigExperience, ProjectConfigFeature, ProjectConfigNode, } from '@picked/delivery-api-client';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
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;AAGzF,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAA;AAI9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,mBAAmB,SAAS,CAAA;AAI5B,YAAY,EACV,iBAAiB,EACjB,WAAW,EACX,yBAAyB,EACzB,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,6BAA6B,CAAA"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import type { ProjectConfig } from '@picked/delivery-api-client';
|
|
2
|
-
import type { Plugin } from '../../entities/plugin/plugin';
|
|
3
|
-
import type { Picked } from '../../picked';
|
|
4
|
-
export { fetchProject, fetchExperienceContent } from '../../data-source/api';
|
|
5
|
-
/**
|
|
6
|
-
* Synchronously registers a complete project config with the client: features, conditions,
|
|
7
|
-
* fields, steps, and experiences, in dependency order.
|
|
8
|
-
*
|
|
9
|
-
* Extracted from `dynamicExperiencesPlugin`'s `onStart` so the same registration runs outside
|
|
10
|
-
* the lifecycle (notably from the server `serialize` helper and the SSR provider), where the
|
|
11
|
-
* stores must be populated synchronously before selection or rendering.
|
|
12
|
-
*
|
|
13
|
-
* @param {Picked} client - Picked client instance.
|
|
14
|
-
* @param {ProjectConfig} config - Project configuration to register.
|
|
15
|
-
* @param {object} options - Registration options.
|
|
16
|
-
* @param {boolean} options.isPreview - Whether features use session storage instead of local storage.
|
|
17
|
-
* @param {string} options.sessionId - Current session id, used as the seed for stable feature allocation.
|
|
18
|
-
* @example
|
|
19
|
-
* ```typescript
|
|
20
|
-
* registerProjectConfig(client, config, { isPreview: false, sessionId: 's' })
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export declare function registerProjectConfig(client: Picked, config: ProjectConfig, options: {
|
|
24
|
-
isPreview: boolean;
|
|
25
|
-
sessionId: string;
|
|
26
|
-
}): void;
|
|
27
|
-
/**
|
|
28
|
-
* Plugin that resolves project configuration through the client and registers features,
|
|
29
|
-
* steps, fields, and experiences with it.
|
|
30
|
-
*
|
|
31
|
-
* Resolution runs during the `onStart` hook, before experience initialisation, and reads
|
|
32
|
-
* whichever source the client resolves to — the build-time bundle when one registered itself,
|
|
33
|
-
* the Picked API otherwise. Search param feature overrides take precedence over resolved
|
|
34
|
-
* values.
|
|
35
|
-
*
|
|
36
|
-
* @returns {Plugin} A configured Picked plugin.
|
|
37
|
-
* @example
|
|
38
|
-
* ```typescript
|
|
39
|
-
* import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
40
|
-
*
|
|
41
|
-
* createClient({
|
|
42
|
-
* plugins: [
|
|
43
|
-
* dynamicExperiencesPlugin()
|
|
44
|
-
* ]
|
|
45
|
-
* })
|
|
46
|
-
* ```
|
|
47
|
-
*/
|
|
48
|
-
export declare function dynamicExperiencesPlugin(): Plugin;
|
|
49
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/plugin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAEV,aAAa,EAGd,MAAM,6BAA6B,CAAA;AACpC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAG1D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAK1C,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAA;AA+J5E;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,aAAa,EACrB,OAAO,EAAE;IAAE,SAAS,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,GACjD,IAAI,CAMN;AA2QD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CA4DjD"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Plugin-specific types for the dynamic-experiences plugin.
|
|
3
|
-
*
|
|
4
|
-
* The wire-format shapes the Delivery API returns live in `@picked/delivery-api-client`,
|
|
5
|
-
* which stays runtime-agnostic. This file holds the types that only mean something inside
|
|
6
|
-
* the client: the content loader and the virtual data module
|
|
7
|
-
* `@picked/vite-plugin-picked` generates.
|
|
8
|
-
*/
|
|
9
|
-
import type { ExperienceContentResponse, ProjectConfig } from '@picked/delivery-api-client';
|
|
10
|
-
/**
|
|
11
|
-
* Function that resolves an experience's content blobs. Set on the Picked client by
|
|
12
|
-
* `dynamicExperiencesPlugin` (selecting from virtual module, getContent override, or API)
|
|
13
|
-
* and called by each experience's `prepareExperienceContentFx`, which is fired by the
|
|
14
|
-
* per-experience sample graph in parallel with `initialiseFx`.
|
|
15
|
-
*/
|
|
16
|
-
export type ContentLoader = (experience: {
|
|
17
|
-
id: string;
|
|
18
|
-
key: string;
|
|
19
|
-
}, options?: {
|
|
20
|
-
previewToken?: string;
|
|
21
|
-
}) => Promise<ExperienceContentResponse | null>;
|
|
22
|
-
/**
|
|
23
|
-
* Provenance the virtual data module records about the snapshot it carries: which build
|
|
24
|
-
* flavour produced it, when, and which workspace version it was taken from.
|
|
25
|
-
*/
|
|
26
|
-
export interface PickedManifestMetadata {
|
|
27
|
-
/** `'build'` when build-mode prefetch JSON was used, `'dev'` when the dev-mode fetch was. */
|
|
28
|
-
mode: 'dev' | 'build';
|
|
29
|
-
/** ISO 8601 timestamp from the manifest. `null` in dev mode, where no manifest is written. */
|
|
30
|
-
fetchedAt: string | null;
|
|
31
|
-
/** The `versionId` the snapshot was taken from, when known. */
|
|
32
|
-
projectVersionId: string | null;
|
|
33
|
-
/** The `workspaceId` the snapshot was taken from, when known. */
|
|
34
|
-
workspaceId: string | null;
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Optional-fields surface of the virtual data module exposed by `@picked/vite-plugin-picked`.
|
|
38
|
-
* The shape is identical between dev (`vite serve`) and build (`vite build`) modes.
|
|
39
|
-
*/
|
|
40
|
-
export interface VirtualPickedData {
|
|
41
|
-
projectConfig: ProjectConfig;
|
|
42
|
-
experienceContent: ContentLoader;
|
|
43
|
-
manifestMetadata: PickedManifestMetadata;
|
|
44
|
-
}
|
|
45
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/plugins/dynamic-experiences/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,yBAAyB,EAAE,aAAa,EAAE,MAAM,6BAA6B,CAAA;AAE3F;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,CAC1B,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,EACvC,OAAO,CAAC,EAAE;IAAE,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,KAChC,OAAO,CAAC,yBAAyB,GAAG,IAAI,CAAC,CAAA;AAE9C;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,6FAA6F;IAC7F,IAAI,EAAE,KAAK,GAAG,OAAO,CAAA;IACrB,8FAA8F;IAC9F,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,+DAA+D;IAC/D,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,iEAAiE;IACjE,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC3B;AAED;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,aAAa,EAAE,aAAa,CAAA;IAC5B,iBAAiB,EAAE,aAAa,CAAA;IAChC,gBAAgB,EAAE,sBAAsB,CAAA;CACzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,8BAA8B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
interface ExperienceBrowserStoragePlugin {
|
|
3
|
-
storage?: 'local' | 'session';
|
|
4
|
-
}
|
|
5
|
-
export declare const experienceBrowserStoragePlugin: ({ storage, }?: ExperienceBrowserStoragePlugin) => Plugin;
|
|
6
|
-
export {};
|
|
7
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/experience-browser-storage/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,8BAA8B;IACtC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,8BAA8B,kBAExC,8BAA8B,KAAQ,MAmDxC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/history-browser-storage/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-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,cAAc;AACd,MAAM,WAAW,2BAA2B;IAC1C,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAED,eAAO,MAAM,2BAA2B,kBAErC,2BAA2B,KAAQ,MA8BrC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,6BAA6B,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
interface ResponsesBrowserStoragePlugin {
|
|
3
|
-
storage?: 'local' | 'session';
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* Persists field responses to browser storage and restores them on the next page load.
|
|
7
|
-
*
|
|
8
|
-
* @param {ResponsesBrowserStoragePlugin} [options] - Plugin options.
|
|
9
|
-
* @param {'local' | 'session'} [options.storage] - Which browser store to persist to.
|
|
10
|
-
* @returns {Plugin} The plugin to pass to `createClient({ plugins })`.
|
|
11
|
-
* @example
|
|
12
|
-
* ```ts
|
|
13
|
-
* createClient({ plugins: [responsesBrowserStoragePlugin({ storage: 'local' })] })
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare const responsesBrowserStoragePlugin: ({ storage, }?: ResponsesBrowserStoragePlugin) => Plugin;
|
|
17
|
-
export {};
|
|
18
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-browser-storage/plugin.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAM1D,UAAU,6BAA6B;IACrC,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,CAAA;CAC9B;AAsED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,6BAA6B,kBAEvC,6BAA6B,KAAQ,MA4FvC,CAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/responses-indexeddb/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.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAO1D,eAAO,MAAM,wBAAwB,QAAO,MAyE3C,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file The lazily-imported half of the telemetry plugin.
|
|
3
|
-
*
|
|
4
|
-
* This module holds the only import of the OTLP emitter, so bundlers give it
|
|
5
|
-
* its own chunk and the plugin can load it after first paint.
|
|
6
|
-
*/
|
|
7
|
-
import { type SpanAttributes, type TelemetrySpan } from '@picked/telemetry';
|
|
8
|
-
/**
|
|
9
|
-
* Sends a batch of spans and resolves once the attempt has finished.
|
|
10
|
-
*
|
|
11
|
-
* @param {string} [endpoint] - OTLP HTTP trace endpoint. Defaults to Picked's collector.
|
|
12
|
-
* @param {SpanAttributes} resource - Resource attributes describing this SDK instance.
|
|
13
|
-
* @param {TelemetrySpan[]} spans - Spans to send.
|
|
14
|
-
* @returns {Promise<void>} Resolves when the batch has been attempted.
|
|
15
|
-
* @example await flushSpans(undefined, { 'service.name': 'picked-sdk' }, spans)
|
|
16
|
-
*/
|
|
17
|
-
export declare function flushSpans(endpoint: string | undefined, resource: SpanAttributes, spans: TelemetrySpan[]): Promise<void>;
|
|
18
|
-
//# sourceMappingURL=emit.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../../../src/plugins/telemetry/emit.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAA0B,KAAK,cAAc,EAAE,KAAK,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEnG;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,MAAM,GAAG,SAAS,EAC5B,QAAQ,EAAE,cAAc,EACxB,KAAK,EAAE,aAAa,EAAE,GACrB,OAAO,CAAC,IAAI,CAAC,CAYf"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/telemetry/index.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,OAAO,EAAE,eAAe,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AACjE,mBAAmB,UAAU,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** @file Summarises a client's registered plugin names for telemetry. */
|
|
2
|
-
/**
|
|
3
|
-
* Sorts and caps a client's registered plugin names for reporting.
|
|
4
|
-
*
|
|
5
|
-
* @param {string[]} registered - Every plugin name registered on the client.
|
|
6
|
-
* @returns {string[]} The names, sorted, capped at the reporting limit.
|
|
7
|
-
* @example summarisePlugins(['window', 'analytics']) // ['analytics', 'window']
|
|
8
|
-
*/
|
|
9
|
-
export declare function summarisePlugins(registered: string[]): string[];
|
|
10
|
-
//# sourceMappingURL=plugin-summary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-summary.d.ts","sourceRoot":"","sources":["../../../../src/plugins/telemetry/plugin-summary.ts"],"names":[],"mappings":"AAAA,yEAAyE;AAKzE;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAE/D"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import type { Plugin } from '../../entities/plugin/plugin';
|
|
2
|
-
/** Plugin name under which this plugin registers. */
|
|
3
|
-
export declare const TELEMETRY_PLUGIN_NAME = "telemetry";
|
|
4
|
-
/**
|
|
5
|
-
* Spans held before a flush is forced.
|
|
6
|
-
*
|
|
7
|
-
* A session buffers between flushes, so this is what bounds the buffer on a
|
|
8
|
-
* long-lived page that keeps making delivery API requests.
|
|
9
|
-
*/
|
|
10
|
-
export declare const MAX_BUFFERED_SPANS = 50;
|
|
11
|
-
/**
|
|
12
|
-
* How long the batch waits after its first span for others to join it.
|
|
13
|
-
*
|
|
14
|
-
* The ready flush goes out before a delivery API request settles, and a session
|
|
15
|
-
* makes far fewer requests than {@link MAX_BUFFERED_SPANS} — so this timer is
|
|
16
|
-
* what sends a delivery span while the session is still running, leaving the
|
|
17
|
-
* page-hidden flush as the backstop for whatever the last few seconds hold.
|
|
18
|
-
*/
|
|
19
|
-
export declare const FLUSH_DELAY_MS = 5000;
|
|
20
|
-
/** Options for {@link telemetryPlugin}. */
|
|
21
|
-
export interface TelemetryPluginOptions {
|
|
22
|
-
/**
|
|
23
|
-
* Fraction of sessions to trace, between 0 and 1.
|
|
24
|
-
*
|
|
25
|
-
* Decided once per client, before the first request, since it also decides
|
|
26
|
-
* whether `traceparent` is sent.
|
|
27
|
-
*
|
|
28
|
-
* @default 1
|
|
29
|
-
*/
|
|
30
|
-
sampleRate?: number;
|
|
31
|
-
/** OTLP HTTP trace endpoint. Defaults to Picked's collector. */
|
|
32
|
-
endpoint?: string;
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Creates the browser telemetry plugin.
|
|
36
|
-
*
|
|
37
|
-
* @param {TelemetryPluginOptions} [options] - Sampling and endpoint overrides.
|
|
38
|
-
* @returns {Plugin} A plugin to register with the Picked client.
|
|
39
|
-
* @example
|
|
40
|
-
* ```typescript
|
|
41
|
-
* const client = createClient({ plugins: [telemetryPlugin({ sampleRate: 0.05 })] })
|
|
42
|
-
* ```
|
|
43
|
-
*/
|
|
44
|
-
export declare function telemetryPlugin(options?: TelemetryPluginOptions): Plugin;
|
|
45
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/telemetry/plugin.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAK1D,qDAAqD;AACrD,eAAO,MAAM,qBAAqB,cAAc,CAAA;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,KAAK,CAAA;AAEpC;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,OAAO,CAAA;AAElC,2CAA2C;AAC3C,MAAM,WAAW,sBAAsB;IACrC;;;;;;;OAOG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,gEAAgE;IAChE,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB;AAwDD;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAmFxE"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/plugins/web-components/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAA"}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
/** @file Web Components plugin — registers a `<picked-root>` custom element that launches a Picked experience by id when connected to the DOM. */
|
|
2
|
-
import type { Plugin } from '../../entities/plugin/plugin';
|
|
3
|
-
export declare const webComponentsPlugin: () => Plugin;
|
|
4
|
-
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../../../src/plugins/web-components/plugin.ts"],"names":[],"mappings":"AAAA,kJAAkJ;AAClJ,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,8BAA8B,CAAA;AAG1D,eAAO,MAAM,mBAAmB,QAAO,MA2BtC,CAAA"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Public entry for live-preview helpers.
|
|
3
|
-
*
|
|
4
|
-
* Separate from the root entry so the path parser and the ops applier never reach the bundle every
|
|
5
|
-
* customer page loads. Imported by the Picked dashboard, and by the SDK's own preview receiver.
|
|
6
|
-
*
|
|
7
|
-
* The wire protocol is exported from here so the embedder builds against the same declaration the
|
|
8
|
-
* receiver does — see `preview-receiver/protocol` for why that stays compatible with older SDKs.
|
|
9
|
-
* The receiver's own inbound guard is not exported: the embedder sends patches rather than
|
|
10
|
-
* receiving them, and leaving it out keeps this entry inside its `size-limit` budget.
|
|
11
|
-
*/
|
|
12
|
-
export { formatContentPath, parseContentPath } from '../utils/content-path';
|
|
13
|
-
export type { ContentPathSegment } from '../utils/content-path';
|
|
14
|
-
export { applyContentOps } from '../preview-receiver/apply-ops';
|
|
15
|
-
export type { ContentPatchOp } from '../preview-receiver/apply-ops';
|
|
16
|
-
export { PREVIEW_CONTENT_PATCH_MESSAGE, PREVIEW_INERT_SCRIPTS_MESSAGE, PREVIEW_PROTOCOL_VERSION, PREVIEW_READY_MESSAGE, PREVIEW_RESYNC_MESSAGE, } from '../preview-receiver/protocol';
|
|
17
|
-
export type { PreviewInertScriptsMessage, PreviewReadyMessage, PreviewResyncMessage, } from '../preview-receiver/protocol';
|
|
18
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preview/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAC3E,YAAY,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,YAAY,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AACnE,OAAO,EACL,6BAA6B,EAC7B,6BAA6B,EAC7B,wBAAwB,EACxB,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,8BAA8B,CAAA;AACrC,YAAY,EACV,0BAA0B,EAC1B,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,8BAA8B,CAAA"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/** The `postMessage` `type` discriminator for navigation reports sent to the embedding parent frame. */
|
|
2
|
-
export declare const PREVIEW_NAVIGATION_MESSAGE = "picked-preview:navigation";
|
|
3
|
-
/**
|
|
4
|
-
* Starts reporting this frame's URL to the embedding parent frame: posts immediately, then again on
|
|
5
|
-
* every SPA navigation (`history.pushState`/`replaceState` and `popstate`). Listeners are wired at
|
|
6
|
-
* most once per frame, so multiple Picked clients on the same page do not double-report.
|
|
7
|
-
*
|
|
8
|
-
* @returns {() => void} A teardown function that detaches the `popstate` listener and re-arms the bridge.
|
|
9
|
-
* @example
|
|
10
|
-
* const stop = initPreviewBridge()
|
|
11
|
-
* // later, e.g. in a test: stop()
|
|
12
|
-
*/
|
|
13
|
-
export declare function initPreviewBridge(): () => void;
|
|
14
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preview-bridge/index.ts"],"names":[],"mappings":"AAUA,wGAAwG;AACxG,eAAO,MAAM,0BAA0B,8BAA8B,CAAA;AAmErE;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,IAAI,CAwB9C"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Single entry point for the live-preview channel, so the bridge and the receiver share one
|
|
3
|
-
* dynamic-import boundary and neither reaches production bundles.
|
|
4
|
-
*/
|
|
5
|
-
import type { Picked } from './picked';
|
|
6
|
-
/**
|
|
7
|
-
* Starts both halves of the preview channel: the outbound bridge that reports this frame's URL to
|
|
8
|
-
* the dashboard, and the inbound receiver that applies the dashboard's content patches.
|
|
9
|
-
*
|
|
10
|
-
* @param {Picked} client - The Picked client whose content index receives the patches.
|
|
11
|
-
* @returns {() => void} Teardown that stops both halves.
|
|
12
|
-
* @example
|
|
13
|
-
* const stop = initPreviewChannel(client)
|
|
14
|
-
*/
|
|
15
|
-
export declare function initPreviewChannel(client: Picked): () => void;
|
|
16
|
-
//# sourceMappingURL=preview-channel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"preview-channel.d.ts","sourceRoot":"","sources":["../../src/preview-channel.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AAItC;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAQ7D"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A single path-addressed replacement inside a content record's `data`.
|
|
3
|
-
*
|
|
4
|
-
* `path` uses the format the Picked API already emits for content-data validation errors —
|
|
5
|
-
* `$.sections[0].data.title`. See `utils/content-path`.
|
|
6
|
-
*/
|
|
7
|
-
export interface ContentPatchOp {
|
|
8
|
-
/** Path to the value being replaced, for example `$.sections[0].data.title`. */
|
|
9
|
-
path: string;
|
|
10
|
-
/** The replacement value. */
|
|
11
|
-
value: unknown;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Applies path-addressed replacements to a content `data` blob, returning a new blob that shares
|
|
15
|
-
* every untouched branch with the original.
|
|
16
|
-
*
|
|
17
|
-
* That structural sharing is the point of per-field patching: replacing the whole blob would mint a
|
|
18
|
-
* fresh object identity for every field on every keystroke, re-rendering every memoised consumer in
|
|
19
|
-
* the host app's tree. Here only the touched spine changes identity.
|
|
20
|
-
*
|
|
21
|
-
* Ops that cannot be applied — a malformed path, the root, a prototype-polluting key, an index into
|
|
22
|
-
* a non-array, an out-of-range index — are skipped. A patch arrives from another frame, so a bad op
|
|
23
|
-
* must degrade to a no-op rather than throw inside a customer's page.
|
|
24
|
-
*
|
|
25
|
-
* @param {Record<string, unknown>} data - The content `data` blob to patch.
|
|
26
|
-
* @param {readonly ContentPatchOp[]} ops - The replacements to apply, in order.
|
|
27
|
-
* @returns {Record<string, unknown>} The patched blob, or `data` unchanged when no op applied.
|
|
28
|
-
* @example
|
|
29
|
-
* applyContentOps({ headline: 'old' }, [{ path: '$.headline', value: 'new' }])
|
|
30
|
-
*/
|
|
31
|
-
export declare function applyContentOps(data: Record<string, unknown>, ops: readonly ContentPatchOp[]): Record<string, unknown>;
|
|
32
|
-
//# sourceMappingURL=apply-ops.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"apply-ops.d.ts","sourceRoot":"","sources":["../../../src/preview-receiver/apply-ops.ts"],"names":[],"mappings":"AASA;;;;;GAKG;AACH,MAAM,WAAW,cAAc;IAC7B,gFAAgF;IAChF,IAAI,EAAE,MAAM,CAAA;IACZ,6BAA6B;IAC7B,KAAK,EAAE,OAAO,CAAA;CACf;AA4DD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC7B,GAAG,EAAE,SAAS,cAAc,EAAE,GAC7B,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAUzB"}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Live-preview receiver: applies content patches pushed by the Picked dashboard.
|
|
3
|
-
*
|
|
4
|
-
* Reached only through a dynamic `import()` the client performs when a preview session is detected,
|
|
5
|
-
* so it stays out of production bundles. It touches only `client.contents`, which is
|
|
6
|
-
* framework-agnostic, so React, Svelte and script-tag installs all get live preview without any
|
|
7
|
-
* per-binding code.
|
|
8
|
-
*
|
|
9
|
-
* Trust model: the customer's page does not opt in, so the origin check is the only defence and it
|
|
10
|
-
* cannot come from the page itself. The API issues `previewEmbedderOrigins` alongside the preview
|
|
11
|
-
* project config; every inbound message is validated against that list, and the handshake is posted
|
|
12
|
-
* only to those origins. Never `document.referrer` (it becomes this frame's own origin after an
|
|
13
|
-
* in-frame navigation) and never a wildcard target.
|
|
14
|
-
*
|
|
15
|
-
* The base blob is the SDK's own preview-token fetch, so the receiver announces readiness only once
|
|
16
|
-
* content is registered and patches always land on a server-projected base.
|
|
17
|
-
*/
|
|
18
|
-
import type { Picked } from '../picked';
|
|
19
|
-
/**
|
|
20
|
-
* Starts the live-preview receiver: announces readiness to the allowlisted embedder origins once
|
|
21
|
-
* content is registered, then applies inbound content patches to the client's content index.
|
|
22
|
-
*
|
|
23
|
-
* Wired at most once per frame, so several Picked clients on one page cannot double-apply a patch.
|
|
24
|
-
*
|
|
25
|
-
* @param {Picked} client - The Picked client whose content index receives the patches.
|
|
26
|
-
* @returns {() => void} Teardown that detaches every listener and re-arms the receiver.
|
|
27
|
-
* @example
|
|
28
|
-
* const stop = initPreviewReceiver(client)
|
|
29
|
-
* // later, e.g. in a test: stop()
|
|
30
|
-
*/
|
|
31
|
-
export declare function initPreviewReceiver(client: Picked): () => void;
|
|
32
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/preview-receiver/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AA4CvC;;;;;;;;;;;GAWG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,IAAI,CAyG9D"}
|