@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function c(t,e,n){if(!(e in t))return;const o=t[e];if(typeof o!="function")throw new Error(`Expected '${String(e)}' to be a function`);const r=n(o);p(r,o),t[e]=r}function i(t,e,n){Object.defineProperty(t,e,{enumerable:!1,value:n,writable:!0,configurable:!0})}function p(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,i(t,"__picked_original",e)}function u(t){return t===void 0||typeof t=="object"&&t!==null&&t.constructor===Object&&Object.keys(t).length===0}exports.isEmpty=u;exports.patchMethod=c;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
function p(t, e, n) {
|
|
2
|
+
if (!(e in t))
|
|
3
|
+
return;
|
|
4
|
+
const o = t[e];
|
|
5
|
+
if (typeof o != "function")
|
|
6
|
+
throw new Error(`Expected '${String(e)}' to be a function`);
|
|
7
|
+
const r = n(o);
|
|
8
|
+
i(r, o), t[e] = r;
|
|
9
|
+
}
|
|
10
|
+
function c(t, e, n) {
|
|
11
|
+
Object.defineProperty(t, e, {
|
|
12
|
+
enumerable: !1,
|
|
13
|
+
value: n,
|
|
14
|
+
writable: !0,
|
|
15
|
+
configurable: !0
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
function i(t, e) {
|
|
19
|
+
const n = e.prototype || {};
|
|
20
|
+
t.prototype = e.prototype = n, c(t, "__picked_original", e);
|
|
21
|
+
}
|
|
22
|
+
function u(t) {
|
|
23
|
+
return t === void 0 || typeof t == "object" && t !== null && t.constructor === Object && Object.keys(t).length === 0;
|
|
24
|
+
}
|
|
25
|
+
export {
|
|
26
|
+
u as i,
|
|
27
|
+
p
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function f(e,t="global",o){let s="picked";if(t==="experience"){if(!o)throw new Error("Experience instance is required to scope storage to an experience");s=`${s}:${o.experienceId}`}return`${s}:${e}`}function l(e,t){const o=t==="local"?localStorage:sessionStorage,s=o.getItem(e),r=o.getItem(`${e}:expires-at`);if(r){const n=new Date,i=new Date(r);if(n>i)return c(e,t),{text:()=>null,json:()=>null,boolean:()=>null}}return{text(){return s},json(){return s?JSON.parse(s):null},boolean(){return s?s==="true":null}}}function u(e,t,o,s){const r=o==="local"?localStorage:sessionStorage,n=typeof t!="string"?JSON.stringify(t):t;if(r.setItem(e,n),typeof s=="number"){const g=new Date(Date.now()+s).toISOString();r.setItem(`${e}:expires-at`,g)}}function c(e,t){const o=t==="local"?localStorage:sessionStorage;o.removeItem(e),o.removeItem(`${e}:expires-at`)}function a(e,t,o,s){const r=t==="local"?localStorage:sessionStorage;function n(i){i.storageArea===r&&i.key===e&&s(o(e))}return window.addEventListener("storage",n),function(){window.removeEventListener("storage",n)}}const S={get(e){return l(e,"session")},set(e,t,o){u(e,t,"session",o)},remove(e){c(e,"session")},subscribe(e,t){return a(e,"session",this.get,t)}},m={get(e){return l(e,"local")},set(e,t,o){u(e,t,"local",o)},remove(e){c(e,"local")},subscribe(e,t){return a(e,"local",this.get,t)}};exports.createStorageKey=f;exports.localStore=m;exports.sessionStore=S;exports.subscribe=a;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
function f(e, t = "global", o) {
|
|
2
|
+
let s = "picked";
|
|
3
|
+
if (t === "experience") {
|
|
4
|
+
if (!o)
|
|
5
|
+
throw new Error("Experience instance is required to scope storage to an experience");
|
|
6
|
+
s = `${s}:${o.experienceId}`;
|
|
7
|
+
}
|
|
8
|
+
return `${s}:${e}`;
|
|
9
|
+
}
|
|
10
|
+
function c(e, t) {
|
|
11
|
+
const o = t === "local" ? localStorage : sessionStorage, s = o.getItem(e), n = o.getItem(`${e}:expires-at`);
|
|
12
|
+
if (n) {
|
|
13
|
+
const r = /* @__PURE__ */ new Date(), i = new Date(n);
|
|
14
|
+
if (r > i)
|
|
15
|
+
return a(e, t), {
|
|
16
|
+
text: () => null,
|
|
17
|
+
json: () => null,
|
|
18
|
+
boolean: () => null
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
text() {
|
|
23
|
+
return s;
|
|
24
|
+
},
|
|
25
|
+
json() {
|
|
26
|
+
return s ? JSON.parse(s) : null;
|
|
27
|
+
},
|
|
28
|
+
boolean() {
|
|
29
|
+
return s ? s === "true" : null;
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function l(e, t, o, s) {
|
|
34
|
+
const n = o === "local" ? localStorage : sessionStorage, r = typeof t != "string" ? JSON.stringify(t) : t;
|
|
35
|
+
if (n.setItem(e, r), typeof s == "number") {
|
|
36
|
+
const g = new Date(Date.now() + s).toISOString();
|
|
37
|
+
n.setItem(`${e}:expires-at`, g);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
function a(e, t) {
|
|
41
|
+
const o = t === "local" ? localStorage : sessionStorage;
|
|
42
|
+
o.removeItem(e), o.removeItem(`${e}:expires-at`);
|
|
43
|
+
}
|
|
44
|
+
function u(e, t, o, s) {
|
|
45
|
+
const n = t === "local" ? localStorage : sessionStorage;
|
|
46
|
+
function r(i) {
|
|
47
|
+
i.storageArea === n && i.key === e && s(o(e));
|
|
48
|
+
}
|
|
49
|
+
return window.addEventListener("storage", r), function() {
|
|
50
|
+
window.removeEventListener("storage", r);
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const p = {
|
|
54
|
+
get(e) {
|
|
55
|
+
return c(e, "session");
|
|
56
|
+
},
|
|
57
|
+
set(e, t, o) {
|
|
58
|
+
l(e, t, "session", o);
|
|
59
|
+
},
|
|
60
|
+
remove(e) {
|
|
61
|
+
a(e, "session");
|
|
62
|
+
},
|
|
63
|
+
subscribe(e, t) {
|
|
64
|
+
return u(e, "session", this.get, t);
|
|
65
|
+
}
|
|
66
|
+
}, m = {
|
|
67
|
+
get(e) {
|
|
68
|
+
return c(e, "local");
|
|
69
|
+
},
|
|
70
|
+
set(e, t, o) {
|
|
71
|
+
l(e, t, "local", o);
|
|
72
|
+
},
|
|
73
|
+
remove(e) {
|
|
74
|
+
a(e, "local");
|
|
75
|
+
},
|
|
76
|
+
subscribe(e, t) {
|
|
77
|
+
return u(e, "local", this.get, t);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
export {
|
|
81
|
+
u as a,
|
|
82
|
+
f as c,
|
|
83
|
+
m as l,
|
|
84
|
+
p as s
|
|
85
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
const o = Symbol("Picked"), t = globalThis, r = (n) => {
|
|
2
|
+
t[o] = n;
|
|
3
|
+
};
|
|
4
|
+
function e() {
|
|
5
|
+
try {
|
|
6
|
+
return "location" in t && !!t.location;
|
|
7
|
+
} catch {
|
|
8
|
+
return !1;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
function s() {
|
|
12
|
+
try {
|
|
13
|
+
return "history" in t && !!t.history;
|
|
14
|
+
} catch {
|
|
15
|
+
return !1;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function a() {
|
|
19
|
+
try {
|
|
20
|
+
return "localStorage" in t && !!t.localStorage;
|
|
21
|
+
} catch {
|
|
22
|
+
return !1;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
function c() {
|
|
26
|
+
try {
|
|
27
|
+
return "sessionStorage" in t && !!t.sessionStorage;
|
|
28
|
+
} catch {
|
|
29
|
+
return !1;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function u() {
|
|
33
|
+
try {
|
|
34
|
+
return "document" in t && "cookie" in t.document;
|
|
35
|
+
} catch {
|
|
36
|
+
return !1;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function i() {
|
|
40
|
+
try {
|
|
41
|
+
return "document" in t && "createElement" in t.document && "attachShadow" in t.document.createElement("div");
|
|
42
|
+
} catch {
|
|
43
|
+
return !1;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
function l() {
|
|
47
|
+
try {
|
|
48
|
+
return "window" in t;
|
|
49
|
+
} catch {
|
|
50
|
+
return !1;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function f() {
|
|
54
|
+
try {
|
|
55
|
+
return "document" in t;
|
|
56
|
+
} catch {
|
|
57
|
+
return !1;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function p() {
|
|
61
|
+
try {
|
|
62
|
+
return "IntersectionObserver" in t;
|
|
63
|
+
} catch {
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export {
|
|
68
|
+
t as G,
|
|
69
|
+
l as a,
|
|
70
|
+
r as b,
|
|
71
|
+
e as c,
|
|
72
|
+
s as d,
|
|
73
|
+
a as e,
|
|
74
|
+
c as f,
|
|
75
|
+
u as g,
|
|
76
|
+
i as h,
|
|
77
|
+
p as i,
|
|
78
|
+
f as s
|
|
79
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=Symbol("Picked"),t=globalThis,n=o=>{t[r]=o};function e(){try{return"location"in t&&!!t.location}catch{return!1}}function s(){try{return"history"in t&&!!t.history}catch{return!1}}function c(){try{return"localStorage"in t&&!!t.localStorage}catch{return!1}}function u(){try{return"sessionStorage"in t&&!!t.sessionStorage}catch{return!1}}function i(){try{return"document"in t&&"cookie"in t.document}catch{return!1}}function a(){try{return"document"in t&&"createElement"in t.document&&"attachShadow"in t.document.createElement("div")}catch{return!1}}function p(){try{return"window"in t}catch{return!1}}function l(){try{return"document"in t}catch{return!1}}function f(){try{return"IntersectionObserver"in t}catch{return!1}}exports.GLOBAL_OBJ=t;exports.bindClient=n;exports.supportsCookies=i;exports.supportsDocument=l;exports.supportsHistory=s;exports.supportsIntersectionObserver=f;exports.supportsLocalStorage=c;exports.supportsLocation=e;exports.supportsSessionStorage=u;exports.supportsShadowRoot=a;exports.supportsWindow=p;
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1,44 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import type { Plugin } from './entities/plugin/plugin';
|
|
5
|
-
import type { Feature } from './entities/feature/feature';
|
|
6
|
-
import type { FieldDefinition } from './entities/field/field';
|
|
7
|
-
import type { AdaptedComponent } from './entities/component/component';
|
|
8
|
-
import type { LogicRule } from './logic-engine';
|
|
1
|
+
import { Predicate } from './entities/predicate/predicate';
|
|
2
|
+
import { Plugin } from './entities/plugin/plugin';
|
|
3
|
+
import { Feature } from './entities/feature/feature';
|
|
9
4
|
export interface CreateClientOptions {
|
|
10
5
|
/**
|
|
11
|
-
*
|
|
12
|
-
* field is accepted for backwards compatibility but the value is ignored.
|
|
6
|
+
* Your organizations unique identifier
|
|
13
7
|
*/
|
|
14
|
-
organizationId
|
|
8
|
+
organizationId: string;
|
|
15
9
|
/**
|
|
16
|
-
* Your projects unique identifier
|
|
17
|
-
* If not provided the projectId will be read from window.pickedConfig.projectId or data-projectid on the script tag.
|
|
10
|
+
* Your projects unique identifier
|
|
18
11
|
*/
|
|
19
|
-
projectId
|
|
12
|
+
projectId: string;
|
|
20
13
|
/**
|
|
21
|
-
* Authentication token for previewing unpublished experiences
|
|
14
|
+
* Authentication token for previewing unpublished experiences
|
|
22
15
|
*/
|
|
23
16
|
previewToken?: string;
|
|
24
17
|
/**
|
|
25
|
-
* Base URL for the Picked API service
|
|
18
|
+
* Base URL for the Picked API service
|
|
26
19
|
*/
|
|
27
20
|
apiUrl?: string;
|
|
28
21
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @default 'https://dashboard.picked.app'
|
|
32
|
-
*/
|
|
33
|
-
dashboardUrl?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Base URL for the documentation site shown in devtools.
|
|
36
|
-
*
|
|
37
|
-
* @default 'https://docs.picked.app'
|
|
38
|
-
*/
|
|
39
|
-
documentationSiteUrl?: string;
|
|
40
|
-
/**
|
|
41
|
-
* Register predicates to determine when experiences should be rendered.
|
|
22
|
+
* Register predicates to determine when experiences should be rendered
|
|
42
23
|
*
|
|
43
24
|
* @example
|
|
44
25
|
* ```typescript
|
|
@@ -51,24 +32,7 @@ export interface CreateClientOptions {
|
|
|
51
32
|
*/
|
|
52
33
|
predicates?: Record<string, Predicate>;
|
|
53
34
|
/**
|
|
54
|
-
*
|
|
55
|
-
* Actions receive a state snapshot with full client context.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* ```typescript
|
|
59
|
-
* actions: {
|
|
60
|
-
* logEvent({ client, responses, location, args }) {
|
|
61
|
-
* // custom logic with access to full state
|
|
62
|
-
* },
|
|
63
|
-
* isLoggedIn({ responses }) {
|
|
64
|
-
* return responses.some(r => r.fieldKey === 'userId' && r.value)
|
|
65
|
-
* }
|
|
66
|
-
* }
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
actions?: Record<string, Action>;
|
|
70
|
-
/**
|
|
71
|
-
* Plugins to extend client functionality.
|
|
35
|
+
* Plugins to extend client functionality
|
|
72
36
|
*
|
|
73
37
|
* @example
|
|
74
38
|
* ```typescript
|
|
@@ -81,81 +45,21 @@ export interface CreateClientOptions {
|
|
|
81
45
|
*/
|
|
82
46
|
plugins?: (Plugin | (() => Plugin) | Plugin[] | (() => Plugin[]))[];
|
|
83
47
|
/**
|
|
84
|
-
*
|
|
48
|
+
* Calulate AB test results to decide which experience to show
|
|
85
49
|
*
|
|
86
50
|
* @example
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
* }
|
|
99
|
-
* ```
|
|
51
|
+
```typescript
|
|
52
|
+
'summer-sales-experiment': {
|
|
53
|
+
key: 'summer-sales-experiment-1',
|
|
54
|
+
name: 'Summer Sales Experiment',
|
|
55
|
+
decide: async () => {
|
|
56
|
+
await new Promise((resolve) => setTimeout(resolve, 800))
|
|
57
|
+
return false
|
|
58
|
+
},
|
|
59
|
+
weight: 0.2,
|
|
60
|
+
}
|
|
61
|
+
````
|
|
100
62
|
*/
|
|
101
63
|
features?: Record<string, Feature | (() => Feature)>;
|
|
102
|
-
/**
|
|
103
|
-
* Register fields that capture responses in experiences. The record key supplies the
|
|
104
|
-
* field `key` when the definition omits one; an explicit `key` on the definition wins.
|
|
105
|
-
* A function value is resolved once during client setup.
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* ```typescript
|
|
109
|
-
* fields: {
|
|
110
|
-
* email: {
|
|
111
|
-
* id: 'email',
|
|
112
|
-
* name: 'email',
|
|
113
|
-
* label: 'Email',
|
|
114
|
-
* type: 'text',
|
|
115
|
-
* multiple: false,
|
|
116
|
-
* required: true,
|
|
117
|
-
* }
|
|
118
|
-
* }
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
fields?: Record<string, FieldDefinition | (() => FieldDefinition)>;
|
|
122
|
-
/**
|
|
123
|
-
* Register components for use in dynamic experiences.
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* ```typescript
|
|
127
|
-
* components: {
|
|
128
|
-
* HeroBanner: adaptedHeroBannerComponent,
|
|
129
|
-
* ProductCard: adaptedProductCardComponent,
|
|
130
|
-
* }
|
|
131
|
-
* ```
|
|
132
|
-
*/
|
|
133
|
-
components?: Record<string, AdaptedComponent>;
|
|
134
|
-
/**
|
|
135
|
-
* Evaluate a condition or boolean expression before initializing the client.
|
|
136
|
-
*
|
|
137
|
-
* @example
|
|
138
|
-
* ```typescript
|
|
139
|
-
* precondition: {
|
|
140
|
-
* invoke: {
|
|
141
|
-
* var: 'predicates.shopify-is-product-page',
|
|
142
|
-
* },
|
|
143
|
-
* }
|
|
144
|
-
* ```
|
|
145
|
-
*/
|
|
146
|
-
precondition?: LogicRule;
|
|
147
|
-
/**
|
|
148
|
-
* Evaluate a condition or boolean expression to determine the user state at initialization.
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```typescript
|
|
152
|
-
* condition: {
|
|
153
|
-
* invoke: {
|
|
154
|
-
* var: 'features.convincely-enabled',
|
|
155
|
-
* },
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
condition?: LogicRule;
|
|
160
64
|
}
|
|
161
65
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAEzD,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,cAAc,EAAE,MAAM,CAAA;IAEtB;;OAEG;IACH,SAAS,EAAE,MAAM,CAAA;IAEjB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAA;IAErB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAA;IAEf;;;;;;;;;;;OAWG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;IAEtC;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,MAAM,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,MAAM,MAAM,EAAE,CAAC,CAAC,EAAE,CAAA;IAEnE;;;;;;;;;;;;;;;OAeG;IAEH,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,CAAA;CACrD"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import type { Picked } from '../../picked';
|
|
4
|
-
import type { LazyComponentLoader } from './lazyComponent';
|
|
1
|
+
import { Store } from 'effector';
|
|
2
|
+
import { Picked } from '../../picked';
|
|
5
3
|
export interface AdaptedComponentStyle {
|
|
6
4
|
sheets?: string[];
|
|
7
5
|
css?: string[];
|
|
@@ -10,7 +8,7 @@ export interface LazyAdaptedComponent<F extends string = string, C = unknown> {
|
|
|
10
8
|
frameworkName: F;
|
|
11
9
|
component: Promise<{
|
|
12
10
|
default: C;
|
|
13
|
-
}
|
|
11
|
+
}>;
|
|
14
12
|
style?: AdaptedComponentStyle;
|
|
15
13
|
}
|
|
16
14
|
export interface EagerAdaptedComponent<F extends string = string, C = unknown> {
|
|
@@ -31,27 +29,13 @@ declare const createComponentFactory: ({ client, component, name }: {
|
|
|
31
29
|
}) => {
|
|
32
30
|
name: string;
|
|
33
31
|
component: AdaptedComponent<string, unknown>;
|
|
34
|
-
frameworkStore: Store<import(
|
|
32
|
+
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
35
33
|
};
|
|
36
|
-
/**
|
|
37
|
-
* Creates a component with framework-specific metadata and loader.
|
|
38
|
-
*
|
|
39
|
-
* @template T - Factory parameter type.
|
|
40
|
-
* @param params - The client, component name, and adapted component.
|
|
41
|
-
* @returns A component with name, component, and frameworkStore.
|
|
42
|
-
* @example
|
|
43
|
-
* ```ts
|
|
44
|
-
* const component = createComponent({ client, name: 'experience', component: adaptedComp })
|
|
45
|
-
* ```
|
|
46
|
-
*/
|
|
47
34
|
export declare function createComponent<T extends Parameters<typeof createComponentFactory>[0]>(params: T): ReturnType<typeof createComponentFactory>;
|
|
48
35
|
declare const createComponentIndexFactory: ({ client }: {
|
|
49
36
|
client: Picked;
|
|
50
37
|
}) => {
|
|
51
|
-
register:
|
|
52
|
-
name: string;
|
|
53
|
-
component: AdaptedComponent;
|
|
54
|
-
}>;
|
|
38
|
+
register: (name: string, component: AdaptedComponent) => void;
|
|
55
39
|
getByName: (name: string) => Store<{
|
|
56
40
|
name: string;
|
|
57
41
|
component: AdaptedComponent;
|
|
@@ -59,33 +43,10 @@ declare const createComponentIndexFactory: ({ client }: {
|
|
|
59
43
|
listStore: Store<{
|
|
60
44
|
name: string;
|
|
61
45
|
component: AdaptedComponent<string, unknown>;
|
|
62
|
-
frameworkStore: Store<import(
|
|
46
|
+
frameworkStore: Store<import('../..').Framework | undefined>;
|
|
63
47
|
}[]>;
|
|
64
48
|
};
|
|
65
|
-
/**
|
|
66
|
-
* Creates a component index with lifecycle stores and registration logic.
|
|
67
|
-
*
|
|
68
|
-
* @template T - Factory parameter type.
|
|
69
|
-
* @param {T} params - Factory parameters including the client.
|
|
70
|
-
* @returns {ReturnType<typeof createComponentIndexFactory>} The component index with register, getByName, and listStore methods.
|
|
71
|
-
* @example
|
|
72
|
-
* ```ts
|
|
73
|
-
* const components = createComponentIndex({ client })
|
|
74
|
-
* components.register('experience', adaptedComponent)
|
|
75
|
-
* ```
|
|
76
|
-
*/
|
|
77
49
|
export declare function createComponentIndex<T extends Parameters<typeof createComponentIndexFactory>[0]>(params: T): ReturnType<typeof createComponentIndexFactory>;
|
|
78
|
-
/**
|
|
79
|
-
* Convenience helper that registers a single component on the given index.
|
|
80
|
-
*
|
|
81
|
-
* @param {string} name - Unique name for the component.
|
|
82
|
-
* @param {AdaptedComponent} component - The adapted component to register.
|
|
83
|
-
* @param {ComponentIndex} components - The component index to register into.
|
|
84
|
-
* @example
|
|
85
|
-
* ```ts
|
|
86
|
-
* setupComponent('experience', adaptedComponent, componentsIndex)
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
50
|
export declare const setupComponent: (name: string, component: AdaptedComponent, components: ComponentIndex) => void;
|
|
90
51
|
export {};
|
|
91
52
|
//# sourceMappingURL=component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/entities/component/component.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../../src/entities/component/component.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AAIrC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAA;AAE1C,MAAM,WAAW,qBAAqB;IACpC,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,EAAE,CAAA;CACf;AAED,MAAM,WAAW,oBAAoB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IAC1E,aAAa,EAAE,CAAC,CAAA;IAChB,SAAS,EAAE,OAAO,CAAC;QAAE,OAAO,EAAE,CAAC,CAAA;KAAE,CAAC,CAAA;IAClC,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAC9B;AAED,MAAM,WAAW,qBAAqB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO;IAC3E,aAAa,EAAE,CAAC,CAAA;IAChB,SAAS,EAAE,CAAC,CAAA;IACZ,KAAK,CAAC,EAAE,qBAAqB,CAAA;CAC9B;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,MAAM,GAAG,MAAM,EAAE,CAAC,GAAG,OAAO,IAC/D,oBAAoB,CAAC,CAAC,EAAE,CAAC,CAAC,GAC1B,qBAAqB,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;AAE/B,MAAM,WAAW,mBAAmB,CAAC,CAAC,GAAG,gBAAgB,CAAC,MAAM,CAAC;IAC/D,UAAU,EAAE,CAAC,CAAA;CACd;AAED,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAA;AACpE,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAI1D,QAAA,MAAM,sBAAsB,gCACI;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,gBAAgB,CAAA;CAAE;;;;CAS5F,CAAA;AAED,wBAAgB,eAAe,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC,CAAC,CAAC,EACpF,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAE3C;AAED,QAAA,MAAM,2BAA2B,eAA8B;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE;qBAcvD,MAAM,aAAa,gBAAgB,KAAG,IAAI;sBAkBzC,MAAM,KAAG,KAAK,CACnC;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,SAAS,EAAE,gBAAgB,CAAA;KAC5B,GACD,SAAS,CACZ;;;;;;CASD,CAAA;AAEF,wBAAgB,oBAAoB,CAAC,CAAC,SAAS,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAAC,CAAC,CAAC,EAC9F,MAAM,EAAE,CAAC,GACR,UAAU,CAAC,OAAO,2BAA2B,CAAC,CAEhD;AAED,eAAO,MAAM,cAAc,GACzB,MAAM,MAAM,EACZ,WAAW,gBAAgB,EAC3B,YAAY,cAAc,KACzB,IAEF,CAAA"}
|