@picked/client 0.0.1-dev.1789541668638 → 0.0.1-next.1
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 +732 -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,490 +1,398 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
edges: [],
|
|
400
|
-
fields: [],
|
|
401
|
-
conditions: [],
|
|
402
|
-
addStep(e, t) {
|
|
403
|
-
let n = t?.node;
|
|
404
|
-
this.nodes.length === 0 && (n = o({ type: "origin" }, this), this.nodes.push(n));
|
|
405
|
-
let r = "serialize" in e ? e : a(e, this);
|
|
406
|
-
if (n) {
|
|
407
|
-
if (!r.node) throw Error("todo no node");
|
|
408
|
-
let e = s({
|
|
409
|
-
sourceNode: n,
|
|
410
|
-
destinationNode: r.node,
|
|
411
|
-
sourceHandle: null
|
|
412
|
-
}, this);
|
|
413
|
-
this.edges.push(e);
|
|
414
|
-
}
|
|
415
|
-
return r.fields.length > 0 && r.fields.forEach((e) => {
|
|
416
|
-
this.fields.includes(e) || this.fields.push(e);
|
|
417
|
-
}), this.steps.includes(r) || (this.steps.push(r), r.node && this.nodes.push(r.node)), r;
|
|
418
|
-
},
|
|
419
|
-
addAction(e, t) {
|
|
420
|
-
let n = t?.node;
|
|
421
|
-
this.nodes.length === 0 && (n = o({ type: "origin" }, this), this.nodes.push(n));
|
|
422
|
-
let i = "serialize" in e ? e : r(e, this);
|
|
423
|
-
if (n) {
|
|
424
|
-
let e = s({
|
|
425
|
-
sourceNode: n,
|
|
426
|
-
destinationNode: i,
|
|
427
|
-
sourceHandle: null
|
|
428
|
-
}, this);
|
|
429
|
-
this.edges.push(e);
|
|
430
|
-
}
|
|
431
|
-
return this.nodes.push(i), i;
|
|
432
|
-
},
|
|
433
|
-
addCondition(e, t) {
|
|
434
|
-
let n = t?.node;
|
|
435
|
-
this.nodes.length === 0 && (n = o({ type: "origin" }, this), this.nodes.push(n));
|
|
436
|
-
let r = "serialize" in e ? e : c(e, this);
|
|
437
|
-
if (n) {
|
|
438
|
-
if (!r.node) throw Error("todo no node");
|
|
439
|
-
let e = s({
|
|
440
|
-
sourceNode: n,
|
|
441
|
-
destinationNode: r.node,
|
|
442
|
-
sourceHandle: null
|
|
443
|
-
}, this);
|
|
444
|
-
this.edges.push(e);
|
|
445
|
-
}
|
|
446
|
-
return this.conditions.includes(r) || (this.conditions.push(r), r.node && this.nodes.push(r.node)), r;
|
|
447
|
-
},
|
|
448
|
-
addConditional(e, t) {
|
|
449
|
-
return this.addCondition(e, t);
|
|
450
|
-
},
|
|
451
|
-
addExperience(e, t) {
|
|
452
|
-
let n = t?.node;
|
|
453
|
-
this.nodes.length === 0 && (n = o({ type: "origin" }, this), this.nodes.push(n));
|
|
454
|
-
let r = o({
|
|
455
|
-
type: "experience",
|
|
456
|
-
experience: e
|
|
457
|
-
}, this);
|
|
458
|
-
if (this.nodes.push(r), n) {
|
|
459
|
-
let e = s({
|
|
460
|
-
sourceNode: n,
|
|
461
|
-
destinationNode: r,
|
|
462
|
-
sourceHandle: null
|
|
463
|
-
}, this);
|
|
464
|
-
this.edges.push(e);
|
|
465
|
-
}
|
|
466
|
-
return e;
|
|
467
|
-
},
|
|
468
|
-
addField(e, t) {
|
|
469
|
-
let n = "serialize" in e ? e : l(e);
|
|
470
|
-
return t && t.fields.push(n), this.fields.includes(n) || this.fields.push(n), n;
|
|
471
|
-
},
|
|
472
|
-
serialize() {
|
|
473
|
-
return t.serialize({
|
|
474
|
-
id: this.id,
|
|
475
|
-
key: this.key,
|
|
476
|
-
component: this.component,
|
|
477
|
-
name: this.name,
|
|
478
|
-
initializeOpen: this.initializeOpen,
|
|
479
|
-
condition: this.condition,
|
|
480
|
-
targets: this.targets,
|
|
481
|
-
steps: this.steps.map((e) => t.deserialize(e.serialize())),
|
|
482
|
-
nodes: this.nodes.map((e) => t.deserialize(e.serialize())),
|
|
483
|
-
edges: this.edges.map((e) => t.deserialize(e.serialize())),
|
|
484
|
-
conditions: this.conditions.map((e) => t.deserialize(e.serialize())),
|
|
485
|
-
fields: this.fields.map((e) => t.deserialize(e.serialize()))
|
|
486
|
-
});
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
//#endregion
|
|
490
|
-
export { c as createCondition, s as createEdge, u as createExperience, n as createExperiencePlugin, l as createField, o as createNode, i as createStep };
|
|
1
|
+
import { g as h } from "../../../id-BW-g3y32.js";
|
|
2
|
+
const l = {
|
|
3
|
+
serialize(i) {
|
|
4
|
+
return JSON.stringify(i);
|
|
5
|
+
},
|
|
6
|
+
deserialize(i) {
|
|
7
|
+
return JSON.parse(i);
|
|
8
|
+
}
|
|
9
|
+
}, b = (i) => ({
|
|
10
|
+
name: "create-experience",
|
|
11
|
+
setup: (a) => {
|
|
12
|
+
i.experiences.forEach((d) => {
|
|
13
|
+
const s = d.serialize(), o = l.deserialize(s);
|
|
14
|
+
o.component = d.component, a.registerExperience(o), o.fields.forEach((c) => {
|
|
15
|
+
a.registerField(c);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}), m = (i, a) => {
|
|
20
|
+
const d = {
|
|
21
|
+
id: h("step"),
|
|
22
|
+
label: i.label,
|
|
23
|
+
experience: a,
|
|
24
|
+
fields: [],
|
|
25
|
+
node: null,
|
|
26
|
+
nextStep(s) {
|
|
27
|
+
return this.experience.addStep(s, this);
|
|
28
|
+
},
|
|
29
|
+
nextConditional(s) {
|
|
30
|
+
return this.experience.addConditional(s, this);
|
|
31
|
+
},
|
|
32
|
+
addNextExperience(s) {
|
|
33
|
+
return this.experience.addExperience(s, this);
|
|
34
|
+
},
|
|
35
|
+
addField(s) {
|
|
36
|
+
return this.experience.addField(s, this);
|
|
37
|
+
},
|
|
38
|
+
serialize() {
|
|
39
|
+
return l.serialize({
|
|
40
|
+
id: this.id,
|
|
41
|
+
label: this.label,
|
|
42
|
+
fieldIds: this.fields.map((s) => s.id)
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
return u({ step: d, type: "step" }, a), d;
|
|
47
|
+
}, y = () => [0, 0], u = (i, a) => {
|
|
48
|
+
const d = {
|
|
49
|
+
id: h("node"),
|
|
50
|
+
position: y(),
|
|
51
|
+
experience: a
|
|
52
|
+
};
|
|
53
|
+
if (i.type === "step") {
|
|
54
|
+
const o = {
|
|
55
|
+
...d,
|
|
56
|
+
type: "step",
|
|
57
|
+
connectedStep: i.step,
|
|
58
|
+
serialize() {
|
|
59
|
+
return l.serialize({
|
|
60
|
+
id: this.id,
|
|
61
|
+
type: this.type,
|
|
62
|
+
stepId: this.connectedStep.id,
|
|
63
|
+
position: this.position,
|
|
64
|
+
label: this.connectedStep.label
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
return o.connectedStep.node = o, o;
|
|
69
|
+
}
|
|
70
|
+
if (i.type === "conditional") {
|
|
71
|
+
const o = {
|
|
72
|
+
...d,
|
|
73
|
+
type: "conditional",
|
|
74
|
+
connectedConditional: i.conditional,
|
|
75
|
+
serialize() {
|
|
76
|
+
return l.serialize({
|
|
77
|
+
id: this.id,
|
|
78
|
+
type: this.type,
|
|
79
|
+
conditionalId: this.connectedConditional.id,
|
|
80
|
+
position: this.position
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return o.connectedConditional.node = o, o;
|
|
85
|
+
}
|
|
86
|
+
return i.type === "experience" ? {
|
|
87
|
+
...d,
|
|
88
|
+
type: "experience",
|
|
89
|
+
connectedExperience: i.experience,
|
|
90
|
+
serialize() {
|
|
91
|
+
return l.serialize({
|
|
92
|
+
id: this.id,
|
|
93
|
+
type: this.type,
|
|
94
|
+
experienceId: this.connectedExperience.id,
|
|
95
|
+
position: this.position
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
} : {
|
|
99
|
+
...d,
|
|
100
|
+
type: "origin",
|
|
101
|
+
serialize() {
|
|
102
|
+
return l.serialize({
|
|
103
|
+
id: this.id,
|
|
104
|
+
type: this.type,
|
|
105
|
+
position: this.position
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
}, f = (i, a) => ({
|
|
110
|
+
id: h("edge"),
|
|
111
|
+
sourceNode: i.sourceNode,
|
|
112
|
+
sourceNodeHandle: i.sourceNodeHandle,
|
|
113
|
+
destinationNode: i.destinationNode,
|
|
114
|
+
experience: a,
|
|
115
|
+
serialize() {
|
|
116
|
+
return l.serialize({
|
|
117
|
+
id: this.id,
|
|
118
|
+
sourceNodeHandle: this.sourceNodeHandle ?? void 0,
|
|
119
|
+
sourceNodeId: this.sourceNode.id,
|
|
120
|
+
destinationNodeId: this.destinationNode.id
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
}), N = (i, a) => {
|
|
124
|
+
const d = {
|
|
125
|
+
id: h("conditional"),
|
|
126
|
+
condition: i.condition,
|
|
127
|
+
node: null,
|
|
128
|
+
experience: a,
|
|
129
|
+
addTrue(s) {
|
|
130
|
+
if (!this.node || !s.node)
|
|
131
|
+
throw new Error("todo no node");
|
|
132
|
+
const o = f(
|
|
133
|
+
{ sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "true" },
|
|
134
|
+
this.experience
|
|
135
|
+
);
|
|
136
|
+
this.experience.edges.push(o);
|
|
137
|
+
},
|
|
138
|
+
addFalse(s) {
|
|
139
|
+
if (!this.node || !s.node)
|
|
140
|
+
throw new Error("todo no node");
|
|
141
|
+
const o = f(
|
|
142
|
+
{ sourceNode: this.node, destinationNode: s.node, sourceNodeHandle: "false" },
|
|
143
|
+
this.experience
|
|
144
|
+
);
|
|
145
|
+
this.experience.edges.push(o);
|
|
146
|
+
},
|
|
147
|
+
serialize() {
|
|
148
|
+
return l.serialize({
|
|
149
|
+
id: this.id,
|
|
150
|
+
condition: this.condition
|
|
151
|
+
});
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
return u({ conditional: d, type: "conditional" }, a), d;
|
|
155
|
+
}, z = (i) => {
|
|
156
|
+
var d;
|
|
157
|
+
return {
|
|
158
|
+
id: h("field"),
|
|
159
|
+
name: i.name,
|
|
160
|
+
type: i.type,
|
|
161
|
+
label: i.label,
|
|
162
|
+
placeholder: i.placeholder,
|
|
163
|
+
description: i.description,
|
|
164
|
+
helpText: i.helpText,
|
|
165
|
+
defaultValue: i.defaultValue,
|
|
166
|
+
multiple: i.multiple,
|
|
167
|
+
validation: i.validation,
|
|
168
|
+
required: i.required,
|
|
169
|
+
options: ((d = i.options) == null ? void 0 : d.map((s) => ({
|
|
170
|
+
...s,
|
|
171
|
+
id: h("option")
|
|
172
|
+
}))) || null,
|
|
173
|
+
policies: i.policies,
|
|
174
|
+
serialize() {
|
|
175
|
+
const s = {
|
|
176
|
+
id: this.id,
|
|
177
|
+
name: this.name,
|
|
178
|
+
label: this.label,
|
|
179
|
+
placeholder: this.placeholder,
|
|
180
|
+
required: this.required,
|
|
181
|
+
description: this.description,
|
|
182
|
+
helpText: this.helpText,
|
|
183
|
+
validation: this.validation,
|
|
184
|
+
policies: this.policies
|
|
185
|
+
}, o = typeof this.defaultValue == "string" ? this.defaultValue : null, c = typeof this.defaultValue == "number" ? this.defaultValue : null, n = typeof this.defaultValue == "boolean" ? this.defaultValue : null;
|
|
186
|
+
switch (this.type) {
|
|
187
|
+
case "text":
|
|
188
|
+
if (this.multiple) {
|
|
189
|
+
let e = null;
|
|
190
|
+
if (Array.isArray(this.defaultValue)) {
|
|
191
|
+
e = [];
|
|
192
|
+
for (const t of this.defaultValue)
|
|
193
|
+
typeof t == "string" && e.push(t);
|
|
194
|
+
e.length === 0 && (e = null);
|
|
195
|
+
}
|
|
196
|
+
return l.serialize({
|
|
197
|
+
...s,
|
|
198
|
+
type: "text",
|
|
199
|
+
multiple: !0,
|
|
200
|
+
defaultValue: e,
|
|
201
|
+
options: this.options ? this.options.map((t) => ({
|
|
202
|
+
id: t.id,
|
|
203
|
+
label: t.label,
|
|
204
|
+
value: `${t.value}`
|
|
205
|
+
})) : null
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
return l.serialize({
|
|
209
|
+
...s,
|
|
210
|
+
type: "text",
|
|
211
|
+
multiple: !1,
|
|
212
|
+
defaultValue: o,
|
|
213
|
+
options: this.options ? this.options.map((e) => ({
|
|
214
|
+
id: e.id,
|
|
215
|
+
label: e.label,
|
|
216
|
+
value: `${e.value}`
|
|
217
|
+
})) : null
|
|
218
|
+
});
|
|
219
|
+
case "number":
|
|
220
|
+
if (this.multiple) {
|
|
221
|
+
let e = null;
|
|
222
|
+
if (Array.isArray(this.defaultValue)) {
|
|
223
|
+
e = [];
|
|
224
|
+
for (const t of this.defaultValue)
|
|
225
|
+
typeof t == "number" && e.push(t);
|
|
226
|
+
e.length === 0 && (e = null);
|
|
227
|
+
}
|
|
228
|
+
return l.serialize({
|
|
229
|
+
...s,
|
|
230
|
+
type: "number",
|
|
231
|
+
multiple: !0,
|
|
232
|
+
defaultValue: e,
|
|
233
|
+
options: this.options ? this.options.map((t) => ({
|
|
234
|
+
id: t.id,
|
|
235
|
+
label: t.label,
|
|
236
|
+
value: Number(t.value)
|
|
237
|
+
})) : null
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
return l.serialize({
|
|
241
|
+
...s,
|
|
242
|
+
type: "number",
|
|
243
|
+
multiple: !1,
|
|
244
|
+
defaultValue: c,
|
|
245
|
+
options: this.options ? this.options.map((e) => ({
|
|
246
|
+
id: e.id,
|
|
247
|
+
label: e.label,
|
|
248
|
+
value: Number(e.value)
|
|
249
|
+
})) : null
|
|
250
|
+
});
|
|
251
|
+
case "boolean":
|
|
252
|
+
if (this.multiple) {
|
|
253
|
+
let e = null;
|
|
254
|
+
if (Array.isArray(this.defaultValue)) {
|
|
255
|
+
e = [];
|
|
256
|
+
for (const t of this.defaultValue)
|
|
257
|
+
typeof t == "boolean" && e.push(t);
|
|
258
|
+
e.length === 0 && (e = null);
|
|
259
|
+
}
|
|
260
|
+
return l.serialize({
|
|
261
|
+
...s,
|
|
262
|
+
type: "boolean",
|
|
263
|
+
multiple: !0,
|
|
264
|
+
defaultValue: e,
|
|
265
|
+
options: this.options ? this.options.map((t) => ({
|
|
266
|
+
id: t.id,
|
|
267
|
+
label: t.label,
|
|
268
|
+
value: !!t.value
|
|
269
|
+
})) : null
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
return l.serialize({
|
|
273
|
+
...s,
|
|
274
|
+
type: "boolean",
|
|
275
|
+
multiple: !1,
|
|
276
|
+
defaultValue: n,
|
|
277
|
+
options: this.options ? this.options.map((e) => ({
|
|
278
|
+
id: e.id,
|
|
279
|
+
label: e.label,
|
|
280
|
+
value: !!e.value
|
|
281
|
+
})) : null
|
|
282
|
+
});
|
|
283
|
+
// todo: support for object type fields
|
|
284
|
+
// case 'object':
|
|
285
|
+
// if (this.multiple) {
|
|
286
|
+
// return serialization.serialize({
|
|
287
|
+
// ...baseField,
|
|
288
|
+
// type: 'object',
|
|
289
|
+
// multiple: true,
|
|
290
|
+
// defaultValue: this.defaultValue,
|
|
291
|
+
// options: this.options,
|
|
292
|
+
// })
|
|
293
|
+
// }
|
|
294
|
+
// return serialization.serialize({
|
|
295
|
+
// ...baseField,
|
|
296
|
+
// type: 'object',
|
|
297
|
+
// multiple: false,
|
|
298
|
+
// defaultValue: this.defaultValue,
|
|
299
|
+
// options: this.options,
|
|
300
|
+
// })
|
|
301
|
+
default:
|
|
302
|
+
throw new Error("Unsupported field type");
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
}, x = (i) => {
|
|
307
|
+
const a = [], d = [], s = [], o = [], c = [];
|
|
308
|
+
return {
|
|
309
|
+
id: i.id,
|
|
310
|
+
component: i.component,
|
|
311
|
+
type: i.type,
|
|
312
|
+
name: i.name,
|
|
313
|
+
decide: i.decide,
|
|
314
|
+
targets: i.targets,
|
|
315
|
+
steps: a,
|
|
316
|
+
nodes: d,
|
|
317
|
+
edges: s,
|
|
318
|
+
fields: c,
|
|
319
|
+
conditionals: o,
|
|
320
|
+
addStep(n, e) {
|
|
321
|
+
let t = e == null ? void 0 : e.node;
|
|
322
|
+
this.nodes.length === 0 && (t = u({ type: "origin" }, this), this.nodes.push(t));
|
|
323
|
+
const r = "serialize" in n ? n : m(n, this);
|
|
324
|
+
if (t) {
|
|
325
|
+
if (!r.node)
|
|
326
|
+
throw new Error("todo no node");
|
|
327
|
+
const p = f(
|
|
328
|
+
{ sourceNode: t, destinationNode: r.node, sourceNodeHandle: null },
|
|
329
|
+
this
|
|
330
|
+
);
|
|
331
|
+
this.edges.push(p);
|
|
332
|
+
}
|
|
333
|
+
return this.steps.includes(r) || (this.steps.push(r), r.node && this.nodes.push(r.node)), r;
|
|
334
|
+
},
|
|
335
|
+
addConditional(n, e) {
|
|
336
|
+
let t = e == null ? void 0 : e.node;
|
|
337
|
+
this.nodes.length === 0 && (t = u({ type: "origin" }, this), this.nodes.push(t));
|
|
338
|
+
const r = "serialize" in n ? n : N(n, this);
|
|
339
|
+
if (t) {
|
|
340
|
+
if (!r.node)
|
|
341
|
+
throw new Error("todo no node");
|
|
342
|
+
const p = f(
|
|
343
|
+
{ sourceNode: t, destinationNode: r.node, sourceNodeHandle: null },
|
|
344
|
+
this
|
|
345
|
+
);
|
|
346
|
+
this.edges.push(p);
|
|
347
|
+
}
|
|
348
|
+
return this.conditionals.includes(r) || (this.conditionals.push(r), r.node && this.nodes.push(r.node)), r;
|
|
349
|
+
},
|
|
350
|
+
addExperience(n, e) {
|
|
351
|
+
let t = e == null ? void 0 : e.node;
|
|
352
|
+
this.nodes.length === 0 && (t = u({ type: "origin" }, this), this.nodes.push(t));
|
|
353
|
+
const r = u(
|
|
354
|
+
{ type: "experience", experience: n },
|
|
355
|
+
this
|
|
356
|
+
);
|
|
357
|
+
if (this.nodes.push(r), t) {
|
|
358
|
+
const p = f(
|
|
359
|
+
{ sourceNode: t, destinationNode: r, sourceNodeHandle: null },
|
|
360
|
+
this
|
|
361
|
+
);
|
|
362
|
+
this.edges.push(p);
|
|
363
|
+
}
|
|
364
|
+
return n;
|
|
365
|
+
},
|
|
366
|
+
addField(n, e) {
|
|
367
|
+
const t = "serialize" in n ? n : z(n);
|
|
368
|
+
return e && e.fields.push(t), this.fields.includes(t) || this.fields.push(t), t;
|
|
369
|
+
},
|
|
370
|
+
serialize() {
|
|
371
|
+
return l.serialize({
|
|
372
|
+
id: this.id,
|
|
373
|
+
type: this.type,
|
|
374
|
+
component: this.component,
|
|
375
|
+
name: this.name,
|
|
376
|
+
decide: this.decide,
|
|
377
|
+
targets: this.targets,
|
|
378
|
+
steps: this.steps.map((n) => l.deserialize(n.serialize())),
|
|
379
|
+
nodes: this.nodes.map((n) => l.deserialize(n.serialize())),
|
|
380
|
+
edges: this.edges.map((n) => l.deserialize(n.serialize())),
|
|
381
|
+
conditionals: this.conditionals.map(
|
|
382
|
+
(n) => l.deserialize(n.serialize())
|
|
383
|
+
),
|
|
384
|
+
fields: this.fields.map((n) => l.deserialize(n.serialize()))
|
|
385
|
+
});
|
|
386
|
+
}
|
|
387
|
+
};
|
|
388
|
+
};
|
|
389
|
+
export {
|
|
390
|
+
N as createConditional,
|
|
391
|
+
f as createEdge,
|
|
392
|
+
x as createExperience,
|
|
393
|
+
b as createExperiencePlugin,
|
|
394
|
+
z as createField,
|
|
395
|
+
u as createNode,
|
|
396
|
+
m as createStep,
|
|
397
|
+
l as serialization
|
|
398
|
+
};
|