@picked/client 0.0.1-dev.1788925875333 → 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 +733 -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 -152
- 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 +1 -1
- 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 +1 -1
- 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 +1 -1
- 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-DbMJli3H.js +0 -22
- package/dist/api-qiqq8lgz.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 -34
- 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-DGk11d8a.js +0 -563
- package/dist/experience-instance-Dej3P1sE.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-BcLaCLm1.cjs +0 -1
- package/dist/plugin-De_BJSwE.js +0 -194
- 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-C_9u0yGJ.cjs +0 -1
- package/dist/provider-ovM-CBX_.js +0 -98
- 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/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-BvLZaTMC.cjs +0 -1
- package/dist/version-VvasRUfR.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,143 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: tutorial
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Build your first experience
|
|
9
|
-
|
|
10
|
-
In this tutorial we build a survey and show it to your visitors. We do all of it in the
|
|
11
|
-
Picked dashboard.
|
|
12
|
-
|
|
13
|
-
At the end you have one experience, one step, one field, and a preview of the survey on
|
|
14
|
-
your own site.
|
|
15
|
-
|
|
16
|
-
## You will need
|
|
17
|
-
|
|
18
|
-
**A Picked account, in an organization.** An organization holds your projects and the
|
|
19
|
-
people who work on them. If you have an invitation, accept it and sign in. If nobody made
|
|
20
|
-
an organization yet, make one from the dashboard home page.
|
|
21
|
-
|
|
22
|
-
**A project.** A project is one site or one application. See
|
|
23
|
-
[How to create a project](/how-to/create-a-project). Keep the project home page open,
|
|
24
|
-
because it shows the SDK snippet that the next item needs.
|
|
25
|
-
|
|
26
|
-
**The URL of your site**, such as `https://www.example.com`. Step 5 opens it to show you
|
|
27
|
-
the survey. It can be a test site.
|
|
28
|
-
|
|
29
|
-
## What a developer must do first
|
|
30
|
-
|
|
31
|
-
The SDK must be on your site before step 1. This happens one time, and after it you need
|
|
32
|
-
no developer again. Send them these four tasks:
|
|
33
|
-
|
|
34
|
-
1. Add the SDK to the site. The snippet and the project ID are on the project home page.
|
|
35
|
-
See [How to install the SDK](/how-to/install-the-sdk).
|
|
36
|
-
2. Make a component that renders a step form.
|
|
37
|
-
3. [Register that component](/how-to/register-a-component) under the name `ColorSurvey`.
|
|
38
|
-
Step 3 enters the same name in the dashboard, and the two names must match.
|
|
39
|
-
4. Tell you which site the SDK runs on, so you can open a preview against it.
|
|
40
|
-
|
|
41
|
-
[Add Picked to your application](/tutorials/first-experience) walks a developer through
|
|
42
|
-
all of it.
|
|
43
|
-
|
|
44
|
-
## 1. Make a field
|
|
45
|
-
|
|
46
|
-
A field collects one answer from your visitor.
|
|
47
|
-
|
|
48
|
-
1. Open your project.
|
|
49
|
-
2. Click **Fields** in the sidebar.
|
|
50
|
-
3. Click **New field**.
|
|
51
|
-
4. Enter the name `Color`. The dashboard fills in the label and the key for you.
|
|
52
|
-
5. Change the label to `Which color do you like most?`. Your visitors read the label, and
|
|
53
|
-
they never see the name or the key.
|
|
54
|
-
6. Leave the key as `color`. You cannot change it later.
|
|
55
|
-
7. Choose the type **Text**.
|
|
56
|
-
8. Click **Create field**.
|
|
57
|
-
|
|
58
|
-
<Screenshot
|
|
59
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/fields/new"
|
|
60
|
-
alt="The new field form, with a name, a label, and a key entered"
|
|
61
|
-
fill={{ 'input[name="name"]': 'Color', 'input[name="label"]': 'Which color do you like most?' }}
|
|
62
|
-
/>
|
|
63
|
-
|
|
64
|
-
<Screenshot
|
|
65
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/fields"
|
|
66
|
-
alt="The fields list for a workspace on the Picked dashboard"
|
|
67
|
-
/>
|
|
68
|
-
|
|
69
|
-
Your field appears in the fields list.
|
|
70
|
-
|
|
71
|
-
## 2. Make the experience
|
|
72
|
-
|
|
73
|
-
1. Click **Flows** in the sidebar. The experiences list opens.
|
|
74
|
-
2. Click **New experience**.
|
|
75
|
-
3. Enter the name `Color survey`.
|
|
76
|
-
4. Leave **Type** on the **Flow** option. A flow is the interactive kind, and it is what
|
|
77
|
-
this tutorial builds. See [About pages and flows](/explanation/pages-and-flows) for the
|
|
78
|
-
other kind.
|
|
79
|
-
5. Open **Advanced**.
|
|
80
|
-
6. Enter the component name `ColorSurvey`. This is the name your developer registered.
|
|
81
|
-
7. Click **Create flow**.
|
|
82
|
-
|
|
83
|
-
The flow builder opens with an empty canvas. One gray circle sits on the left. That
|
|
84
|
-
circle is the origin, and every flow starts there.
|
|
85
|
-
|
|
86
|
-
## 3. Make a step
|
|
87
|
-
|
|
88
|
-
A step is one screen that your visitor sees. It holds your field. You make one from the
|
|
89
|
-
library, on the left of the flow builder.
|
|
90
|
-
|
|
91
|
-
1. Find the **Steps** section in the library.
|
|
92
|
-
2. Click the **+** next to it.
|
|
93
|
-
3. Enter the name `Question`. The key fills in as `question`.
|
|
94
|
-
4. Click **Create step**.
|
|
95
|
-
|
|
96
|
-
The flow builder opens again, and your step is in the library.
|
|
97
|
-
|
|
98
|
-
## 4. Build the flow
|
|
99
|
-
|
|
100
|
-
1. Find your `Question` step under **Steps** in the library.
|
|
101
|
-
2. Drag it onto the canvas.
|
|
102
|
-
3. Drag from the output handle of the origin to the input handle of your step. An arrow
|
|
103
|
-
joins them.
|
|
104
|
-
4. Drag your `Color` field from the library onto the step node.
|
|
105
|
-
5. Click **Save** in the toolbar.
|
|
106
|
-
|
|
107
|
-
<Screenshot
|
|
108
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/experiences/{experienceId}"
|
|
109
|
-
alt="The flow builder with the library, canvas, and inspector panels"
|
|
110
|
-
/>
|
|
111
|
-
|
|
112
|
-
The subtitle of the step node now reads one field. Your flow is one step long, and it
|
|
113
|
-
starts at the origin.
|
|
114
|
-
|
|
115
|
-
## 5. Preview it
|
|
116
|
-
|
|
117
|
-
A preview opens your own site with this workspace applied. Your visitors see no change.
|
|
118
|
-
|
|
119
|
-
1. Click **Preview** in the workspace toolbar.
|
|
120
|
-
2. Enter the URL of your site.
|
|
121
|
-
3. Click **Open preview**.
|
|
122
|
-
|
|
123
|
-
Your site opens in a new tab, and your survey is on it. Enter a color and continue.
|
|
124
|
-
|
|
125
|
-
## 6. Publish it
|
|
126
|
-
|
|
127
|
-
1. Click **Publish** in the workspace toolbar.
|
|
128
|
-
2. Read the change preview. It lists what your visitors get.
|
|
129
|
-
3. Click **Publish** to confirm.
|
|
130
|
-
|
|
131
|
-
Your survey is live.
|
|
132
|
-
|
|
133
|
-
## What you built
|
|
134
|
-
|
|
135
|
-
You have an experience that your visitors see. The dashboard holds the flow, the step, and
|
|
136
|
-
the field, so you change any of them and publish again without a deployment.
|
|
137
|
-
|
|
138
|
-
## Where to go next
|
|
139
|
-
|
|
140
|
-
- [How to build a flow](/how-to/build-a-flow) — branches, actions, and conditions.
|
|
141
|
-
- [How to run an A/B test](/how-to/run-an-ab-test) — show a change to some visitors.
|
|
142
|
-
- [About how Picked works](/explanation/how-picked-works) — what happens when you
|
|
143
|
-
publish.
|
|
@@ -1,254 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: tutorial
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Add Picked to your application
|
|
9
|
-
|
|
10
|
-
In this tutorial we make a color survey and put it on a page. We build the flow in the
|
|
11
|
-
Picked dashboard, connect the SDK to it, and see the survey in a browser.
|
|
12
|
-
|
|
13
|
-
At the end you have one experience, one step, one field, and a page that shows them.
|
|
14
|
-
|
|
15
|
-
## Before you start
|
|
16
|
-
|
|
17
|
-
- A Picked account, and an organization in it.
|
|
18
|
-
- Node 20 or later.
|
|
19
|
-
- A web application that runs React or Svelte. A new Vite application is enough.
|
|
20
|
-
|
|
21
|
-
## 1. Make a project
|
|
22
|
-
|
|
23
|
-
A project is one site or one application.
|
|
24
|
-
|
|
25
|
-
1. Sign in to the dashboard.
|
|
26
|
-
2. Open your organization.
|
|
27
|
-
3. Click **New Project**.
|
|
28
|
-
4. Enter the name `Tutorial`.
|
|
29
|
-
5. Click **Create**.
|
|
30
|
-
|
|
31
|
-
The project home page opens. It shows a project ID near the top. Copy that ID. Every step
|
|
32
|
-
after this one needs it.
|
|
33
|
-
|
|
34
|
-
## 2. Make a field
|
|
35
|
-
|
|
36
|
-
A field collects one answer from your visitor.
|
|
37
|
-
|
|
38
|
-
1. Click **Fields** in the sidebar.
|
|
39
|
-
2. Click **New field**.
|
|
40
|
-
3. Enter the name `Color`. The dashboard fills in the label and the key for you.
|
|
41
|
-
4. Change the label to `Which color do you like most?`.
|
|
42
|
-
5. Leave the key as `color`.
|
|
43
|
-
6. Choose the type **Text**.
|
|
44
|
-
7. Click **Create field**.
|
|
45
|
-
|
|
46
|
-
<Screenshot
|
|
47
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/fields"
|
|
48
|
-
alt="The fields list for a workspace on the Picked dashboard"
|
|
49
|
-
/>
|
|
50
|
-
|
|
51
|
-
The field now appears in the fields list.
|
|
52
|
-
|
|
53
|
-
## 3. Make the experience
|
|
54
|
-
|
|
55
|
-
1. Click **Flows** in the sidebar. The experiences list opens.
|
|
56
|
-
2. Click **New experience**.
|
|
57
|
-
3. Enter the name `Color survey`.
|
|
58
|
-
4. Leave **Type** on the **Flow** option.
|
|
59
|
-
5. Open **Advanced**.
|
|
60
|
-
6. Enter the component name `ColorSurvey`.
|
|
61
|
-
7. Click **Create flow**.
|
|
62
|
-
|
|
63
|
-
The flow builder opens with an empty canvas. One gray circle is on the left. That circle
|
|
64
|
-
is the origin, and every flow starts there.
|
|
65
|
-
|
|
66
|
-
## 4. Make a step
|
|
67
|
-
|
|
68
|
-
A step is one screen that your visitor sees. It holds your field. You make one from the
|
|
69
|
-
library, on the left of the flow builder.
|
|
70
|
-
|
|
71
|
-
1. Find the **Steps** section in the library.
|
|
72
|
-
2. Click the **+** next to it.
|
|
73
|
-
3. Enter the name `Question`. The key fills in as `question`.
|
|
74
|
-
4. Click **Create step**.
|
|
75
|
-
|
|
76
|
-
The flow builder opens again, and your step is in the library.
|
|
77
|
-
|
|
78
|
-
## 5. Build the flow
|
|
79
|
-
|
|
80
|
-
1. Find your `Question` step in the library on the left.
|
|
81
|
-
2. Drag it onto the canvas.
|
|
82
|
-
3. Drag from the output handle of the origin to the input handle of your step. An arrow
|
|
83
|
-
joins them.
|
|
84
|
-
4. Drag your `Color` field from the library onto the step node.
|
|
85
|
-
5. Click **Save** in the toolbar.
|
|
86
|
-
|
|
87
|
-
The subtitle of the step node now reads one field. Your flow is one step long, and it
|
|
88
|
-
starts at the origin.
|
|
89
|
-
|
|
90
|
-
## 6. Publish the workspace
|
|
91
|
-
|
|
92
|
-
Your visitors see nothing until you publish.
|
|
93
|
-
|
|
94
|
-
1. Click **Publish** in the workspace toolbar.
|
|
95
|
-
2. Read the change preview.
|
|
96
|
-
3. Click **Publish** to confirm.
|
|
97
|
-
|
|
98
|
-
## 7. Connect the SDK
|
|
99
|
-
|
|
100
|
-
Install the client and the adapter for your framework.
|
|
101
|
-
|
|
102
|
-
:::code-group
|
|
103
|
-
|
|
104
|
-
```bash [React]
|
|
105
|
-
npm install picked @picked/react
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
```bash [Svelte]
|
|
109
|
-
npm install picked @picked/svelte
|
|
110
|
-
```
|
|
111
|
-
|
|
112
|
-
:::
|
|
113
|
-
|
|
114
|
-
Now write the component that renders the step. Put it in `ColorSurvey.tsx`, or in
|
|
115
|
-
`ColorSurvey.svelte`. It reads the fields of the active step and
|
|
116
|
-
puts each one in a form.
|
|
117
|
-
|
|
118
|
-
:::code-group
|
|
119
|
-
|
|
120
|
-
```tsx [React]
|
|
121
|
-
import { useStep, useStoreGlobal } from '@picked/react/hooks'
|
|
122
|
-
|
|
123
|
-
export function ColorSurvey() {
|
|
124
|
-
const { fields, form } = useStep()
|
|
125
|
-
const currentFields = useStoreGlobal(fields)
|
|
126
|
-
|
|
127
|
-
return (
|
|
128
|
-
<form {...form.props}>
|
|
129
|
-
{currentFields.map((field) => (
|
|
130
|
-
<div key={field.id}>
|
|
131
|
-
<label htmlFor={field.id}>{field.label}</label>
|
|
132
|
-
<input
|
|
133
|
-
id={field.id}
|
|
134
|
-
name={field.id}
|
|
135
|
-
value={field.value ?? ''}
|
|
136
|
-
onChange={field.onChange}
|
|
137
|
-
onBlur={field.onBlur}
|
|
138
|
-
/>
|
|
139
|
-
</div>
|
|
140
|
-
))}
|
|
141
|
-
<button type="submit">Continue</button>
|
|
142
|
-
</form>
|
|
143
|
-
)
|
|
144
|
-
}
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
```svelte [Svelte]
|
|
148
|
-
<script lang="ts">
|
|
149
|
-
import { getStep } from '@picked/svelte/hooks'
|
|
150
|
-
|
|
151
|
-
const { fields, form } = getStep()
|
|
152
|
-
</script>
|
|
153
|
-
|
|
154
|
-
<form {...form.props}>
|
|
155
|
-
{#each $fields as field}
|
|
156
|
-
<div>
|
|
157
|
-
<label for={field.id}>{field.label}</label>
|
|
158
|
-
<input
|
|
159
|
-
id={field.id}
|
|
160
|
-
name={field.id}
|
|
161
|
-
value={field.value ?? ''}
|
|
162
|
-
onchange={field.onChange}
|
|
163
|
-
onblur={field.onBlur}
|
|
164
|
-
/>
|
|
165
|
-
</div>
|
|
166
|
-
{/each}
|
|
167
|
-
<button type="submit">Continue</button>
|
|
168
|
-
</form>
|
|
169
|
-
```
|
|
170
|
-
|
|
171
|
-
:::
|
|
172
|
-
|
|
173
|
-
Then start the client from `picked.ts`. Put your project ID in `projectId`. The key in `components` must
|
|
174
|
-
match the component name that you entered in step 4.
|
|
175
|
-
|
|
176
|
-
:::code-group
|
|
177
|
-
|
|
178
|
-
```tsx [React]
|
|
179
|
-
import { createClient } from 'picked'
|
|
180
|
-
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
181
|
-
import { adaptReactComponent } from '@picked/react'
|
|
182
|
-
import { reactFrameworkPlugin } from '@picked/react/plugins/framework'
|
|
183
|
-
import { ColorSurvey } from './ColorSurvey'
|
|
184
|
-
|
|
185
|
-
export const picked = createClient({
|
|
186
|
-
projectId: 'your-project-id',
|
|
187
|
-
components: {
|
|
188
|
-
ColorSurvey: adaptReactComponent(ColorSurvey),
|
|
189
|
-
},
|
|
190
|
-
plugins: [reactFrameworkPlugin({ components: {} }), dynamicExperiencesPlugin()],
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
picked.start()
|
|
194
|
-
```
|
|
195
|
-
|
|
196
|
-
```ts [Svelte]
|
|
197
|
-
import { createClient } from 'picked'
|
|
198
|
-
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
199
|
-
import { adaptSvelteComponent } from '@picked/svelte'
|
|
200
|
-
import { svelteFrameworkPlugin } from '@picked/svelte/plugins/framework'
|
|
201
|
-
import ColorSurvey from './ColorSurvey.svelte'
|
|
202
|
-
|
|
203
|
-
export const picked = createClient({
|
|
204
|
-
projectId: 'your-project-id',
|
|
205
|
-
components: {
|
|
206
|
-
ColorSurvey: adaptSvelteComponent(ColorSurvey),
|
|
207
|
-
},
|
|
208
|
-
plugins: [svelteFrameworkPlugin({ components: {} }), dynamicExperiencesPlugin()],
|
|
209
|
-
})
|
|
210
|
-
|
|
211
|
-
picked.start()
|
|
212
|
-
```
|
|
213
|
-
|
|
214
|
-
:::
|
|
215
|
-
|
|
216
|
-
`dynamicExperiencesPlugin` reads the published configuration of your project. It registers your
|
|
217
|
-
experience, your step, and your field. You declare none of them in code.
|
|
218
|
-
|
|
219
|
-
## 8. See it
|
|
220
|
-
|
|
221
|
-
Start your application and open it in a browser.
|
|
222
|
-
|
|
223
|
-
Your survey appears. It shows the label `Which color do you like most?` and one text
|
|
224
|
-
input. Both come from the dashboard, and neither is in your code.
|
|
225
|
-
|
|
226
|
-
## 9. Change it without a deployment
|
|
227
|
-
|
|
228
|
-
This step shows you what the dashboard controls.
|
|
229
|
-
|
|
230
|
-
1. Go back to the dashboard.
|
|
231
|
-
2. Open your `Color` field.
|
|
232
|
-
3. Change the label to `Which color do you like least?`.
|
|
233
|
-
4. Click **Save**.
|
|
234
|
-
5. Publish the workspace again.
|
|
235
|
-
6. Open the page in your browser again.
|
|
236
|
-
|
|
237
|
-
The question changes. You edited no code and you deployed nothing.
|
|
238
|
-
|
|
239
|
-
## What you built
|
|
240
|
-
|
|
241
|
-
You have an experience that you control from the dashboard and render in your own
|
|
242
|
-
application. The dashboard holds the flow, the step, and the field. Your code holds only
|
|
243
|
-
the component and the client.
|
|
244
|
-
|
|
245
|
-
To change the label, the field type, or the order of the steps, edit the workspace and
|
|
246
|
-
publish again. You deploy no code.
|
|
247
|
-
|
|
248
|
-
## Where to go next
|
|
249
|
-
|
|
250
|
-
- [Your first server-rendered page](/tutorials/first-server-rendered-page) — a page that
|
|
251
|
-
a search engine can read.
|
|
252
|
-
- [How to build a flow](/how-to/build-a-flow) — branches, actions, and conditions.
|
|
253
|
-
- [About how Picked works](/explanation/how-picked-works) — what happens between publish
|
|
254
|
-
and render.
|
|
@@ -1,186 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: tutorial
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Your first server-rendered page
|
|
9
|
-
|
|
10
|
-
In this tutorial we make a landing page in the Picked CMS and render it on your server.
|
|
11
|
-
A search engine reads the content in the first response, and the browser takes over after
|
|
12
|
-
that.
|
|
13
|
-
|
|
14
|
-
At the end you have one page layout, one content entry, and a server that returns your
|
|
15
|
-
content in its HTML.
|
|
16
|
-
|
|
17
|
-
## Before you start
|
|
18
|
-
|
|
19
|
-
- A Picked project. [Add Picked to your application](/tutorials/first-experience)
|
|
20
|
-
makes one.
|
|
21
|
-
- A server that renders React or Svelte and can add a script tag to its HTML.
|
|
22
|
-
- Node 20 or later.
|
|
23
|
-
|
|
24
|
-
## 1. Model the page layout
|
|
25
|
-
|
|
26
|
-
A page layout sets which fields your page holds.
|
|
27
|
-
|
|
28
|
-
1. Open your workspace.
|
|
29
|
-
2. Click **Pages** in the sidebar, then **Page Layouts**.
|
|
30
|
-
3. Click **New model**.
|
|
31
|
-
4. Set **Category** to **Page layout**.
|
|
32
|
-
5. Enter the name `Page hero` and the key `page-hero`. The key is stable, and your SDK
|
|
33
|
-
code and your API calls both use it.
|
|
34
|
-
6. Add a **Single-line text** field with the key `title`.
|
|
35
|
-
7. Add a **Markdown** field with the key `body`.
|
|
36
|
-
8. Click **Create model**.
|
|
37
|
-
|
|
38
|
-
<Screenshot
|
|
39
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/models"
|
|
40
|
-
alt="A page layout in the schema builder on the Picked dashboard"
|
|
41
|
-
/>
|
|
42
|
-
|
|
43
|
-
Your layout now holds two fields. It holds no content yet.
|
|
44
|
-
|
|
45
|
-
## 2. Make the page and fill it
|
|
46
|
-
|
|
47
|
-
1. Click **Pages** in the sidebar.
|
|
48
|
-
2. Click **New Experience**.
|
|
49
|
-
3. Choose the **Page** type.
|
|
50
|
-
4. Choose your `page-hero` layout.
|
|
51
|
-
5. Open the **Properties** tab.
|
|
52
|
-
6. Enter a `title` and a `body`.
|
|
53
|
-
7. Click **Save**. Picked makes a content entry and links it to the page.
|
|
54
|
-
8. Correct every field error.
|
|
55
|
-
|
|
56
|
-
## 3. Publish the workspace
|
|
57
|
-
|
|
58
|
-
1. Click **Publish** in the workspace toolbar.
|
|
59
|
-
2. Click **Publish** to confirm.
|
|
60
|
-
|
|
61
|
-
Your content is now live. Read it back with `curl`, and put your own project ID in the
|
|
62
|
-
path:
|
|
63
|
-
|
|
64
|
-
```bash
|
|
65
|
-
curl https://api.picked.app/api/v1/projects/proj_123
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
The answer holds your steps. Each one carries a `layoutContentId`, which points at the
|
|
69
|
-
content entry behind it.
|
|
70
|
-
|
|
71
|
-
## 4. Make the snapshot on your server
|
|
72
|
-
|
|
73
|
-
`serialize()` finds which experiences match the URL and reads their content. It gives you
|
|
74
|
-
a snapshot as plain JSON.
|
|
75
|
-
|
|
76
|
-
Make one client for each request, in `server.ts`:
|
|
77
|
-
|
|
78
|
-
```ts
|
|
79
|
-
import { createClient } from 'picked'
|
|
80
|
-
import { serialize } from '@picked/client/server'
|
|
81
|
-
|
|
82
|
-
const client = createClient(options)
|
|
83
|
-
|
|
84
|
-
const snapshot = await serialize(client, {
|
|
85
|
-
projectConfig,
|
|
86
|
-
attributes: { location: { pathname: url.pathname } },
|
|
87
|
-
})
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
Write the snapshot into your HTML answer:
|
|
91
|
-
|
|
92
|
-
```ts
|
|
93
|
-
const html = `
|
|
94
|
-
<div id="root">${appHtml}</div>
|
|
95
|
-
<script>window.__PICKED__ = ${JSON.stringify(snapshot)}</script>
|
|
96
|
-
`
|
|
97
|
-
```
|
|
98
|
-
|
|
99
|
-
## 5. Render the slot
|
|
100
|
-
|
|
101
|
-
`<ExperienceSlot name="page" />` renders every experience that points at that slot. Give
|
|
102
|
-
the provider your snapshot, so the first paint in the browser matches the HTML from your
|
|
103
|
-
server.
|
|
104
|
-
|
|
105
|
-
Register the component under the same name that the page uses. Here it is `CMSPage`.
|
|
106
|
-
|
|
107
|
-
:::code-group
|
|
108
|
-
|
|
109
|
-
```tsx [React]
|
|
110
|
-
import type { CreateClientOptions } from 'picked'
|
|
111
|
-
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
112
|
-
import { adaptReactComponent, ExperienceSlot, PickedProvider } from '@picked/react'
|
|
113
|
-
import { reactFrameworkPlugin } from '@picked/react/plugins/framework'
|
|
114
|
-
import { useStepContent } from '@picked/react/hooks'
|
|
115
|
-
|
|
116
|
-
function CMSPage() {
|
|
117
|
-
const content = useStepContent()
|
|
118
|
-
const title = typeof content?.title === 'string' ? content.title : ''
|
|
119
|
-
return <h1>{title}</h1>
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
const options = {
|
|
123
|
-
projectId: 'proj_123',
|
|
124
|
-
components: { CMSPage: adaptReactComponent(CMSPage) },
|
|
125
|
-
plugins: [reactFrameworkPlugin({ components: {} }), dynamicExperiencesPlugin()],
|
|
126
|
-
} satisfies CreateClientOptions
|
|
127
|
-
|
|
128
|
-
export function Page({ snapshot }) {
|
|
129
|
-
return (
|
|
130
|
-
<PickedProvider options={options} snapshot={snapshot}>
|
|
131
|
-
<ExperienceSlot name="page" />
|
|
132
|
-
</PickedProvider>
|
|
133
|
-
)
|
|
134
|
-
}
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
```svelte [Svelte]
|
|
138
|
-
<script lang="ts">
|
|
139
|
-
import type { CreateClientOptions } from 'picked'
|
|
140
|
-
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
141
|
-
import { adaptSvelteComponent, ExperienceSlot, setPickedContext } from '@picked/svelte'
|
|
142
|
-
import { svelteFrameworkPlugin } from '@picked/svelte/plugins/framework'
|
|
143
|
-
import CMSPage from './CMSPage.svelte'
|
|
144
|
-
|
|
145
|
-
const { snapshot } = $props()
|
|
146
|
-
|
|
147
|
-
const options = {
|
|
148
|
-
projectId: 'proj_123',
|
|
149
|
-
components: { CMSPage: adaptSvelteComponent(CMSPage) },
|
|
150
|
-
plugins: [svelteFrameworkPlugin({ components: {} }), dynamicExperiencesPlugin()],
|
|
151
|
-
} satisfies CreateClientOptions
|
|
152
|
-
|
|
153
|
-
setPickedContext({ options, snapshot })
|
|
154
|
-
</script>
|
|
155
|
-
|
|
156
|
-
<ExperienceSlot name="page" />
|
|
157
|
-
```
|
|
158
|
-
|
|
159
|
-
:::
|
|
160
|
-
|
|
161
|
-
Point your page experience at the slot. Set its target selector to `.picked-slot-page`,
|
|
162
|
-
and publish again.
|
|
163
|
-
|
|
164
|
-
## 6. Check that a crawler can read it
|
|
165
|
-
|
|
166
|
-
1. Read the answer from your server with `curl`, or with the view-source command of your
|
|
167
|
-
browser.
|
|
168
|
-
2. Find your `title` in the HTML.
|
|
169
|
-
|
|
170
|
-
Your title is in the first response, not in a script that the browser must run. A crawler
|
|
171
|
-
and a social preview both read it.
|
|
172
|
-
|
|
173
|
-
## What you built
|
|
174
|
-
|
|
175
|
-
You have a page whose content lives in the Picked CMS and whose HTML comes from your
|
|
176
|
-
server. An editor changes the copy in the dashboard and publishes. Your server serves the
|
|
177
|
-
new content on the next request, and you deploy nothing.
|
|
178
|
-
|
|
179
|
-
## Where to go next
|
|
180
|
-
|
|
181
|
-
- [About server-side rendering](/explanation/why-server-side-rendering) — why the
|
|
182
|
-
snapshot exists, and what it carries.
|
|
183
|
-
- [Server snapshot](/reference/sdk/ssr/serialize) — every `serialize()` parameter.
|
|
184
|
-
- [Models](/reference/dashboard/content/models) — every field type.
|
|
185
|
-
- [Preview, cache, and crawlers](/reference/delivery-api/preview-caching-crawling) — how
|
|
186
|
-
a draft stays out of the search index.
|
package/dist/dom-BqcToNL0.js
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { f as e, i as t, u as n } from "./supports-CO9bJGNl.js";
|
|
2
|
-
//#region src/utils/dom.ts
|
|
3
|
-
function r(n) {
|
|
4
|
-
return !e() || !t() ? [] : Array.from(window.document.querySelectorAll(n)).filter((e) => e instanceof HTMLElement);
|
|
5
|
-
}
|
|
6
|
-
var i = "open";
|
|
7
|
-
function a(e) {
|
|
8
|
-
if (!n()) throw Error("Shadow DOM is not supported in this environment");
|
|
9
|
-
return e.attachShadow({ mode: i });
|
|
10
|
-
}
|
|
11
|
-
function o() {
|
|
12
|
-
return new Promise((e, n) => {
|
|
13
|
-
if (!t()) {
|
|
14
|
-
n();
|
|
15
|
-
return;
|
|
16
|
-
}
|
|
17
|
-
document.readyState === "loading" ? document.addEventListener("readystatechange", () => e(), { once: !0 }) : e();
|
|
18
|
-
});
|
|
19
|
-
}
|
|
20
|
-
function s(e, t) {
|
|
21
|
-
let n = new MutationObserver((r) => {
|
|
22
|
-
document.contains(e) || (n.disconnect(), t());
|
|
23
|
-
});
|
|
24
|
-
n.observe(document.body, {
|
|
25
|
-
childList: !0,
|
|
26
|
-
subtree: !0
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
var c = "picked-root", l = "picked-target", u = "picked-root";
|
|
30
|
-
function d(e, t) {
|
|
31
|
-
return [...e, {
|
|
32
|
-
selector: `${u}[experience-id="${t}"]`,
|
|
33
|
-
placement: "replace"
|
|
34
|
-
}].flatMap((e) => {
|
|
35
|
-
let n = r(e.selector).filter((e) => !m(e, t) && !h(e, t));
|
|
36
|
-
return {
|
|
37
|
-
...e,
|
|
38
|
-
elements: n
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
function f(e, t, n) {
|
|
43
|
-
return e.flatMap((e) => e.elements.map((r) => _(r, e.placement, t, n)));
|
|
44
|
-
}
|
|
45
|
-
function p(e, t) {
|
|
46
|
-
e.classList.add(l), e.classList.add(`${l}-${t}`);
|
|
47
|
-
}
|
|
48
|
-
function m(e, t) {
|
|
49
|
-
return t ? e.classList.contains(`${l}-${t}`) : e.classList.contains(`${l}`);
|
|
50
|
-
}
|
|
51
|
-
function h(e, t) {
|
|
52
|
-
return t ? e.classList.contains(`${c}-${t}`) : e.classList.contains(c);
|
|
53
|
-
}
|
|
54
|
-
function g(e, t) {
|
|
55
|
-
let n = document.createElement("div");
|
|
56
|
-
return n.style.display = "block", n.classList.add(c), n.classList.add(`${c}-${e}`), n.classList.add(`${c}-${t}`), n;
|
|
57
|
-
}
|
|
58
|
-
function _(e, t, n, r) {
|
|
59
|
-
let i, a = g(n, r);
|
|
60
|
-
if (e instanceof Document) i = e.body.appendChild(a);
|
|
61
|
-
else {
|
|
62
|
-
switch (t) {
|
|
63
|
-
case "replace":
|
|
64
|
-
e.replaceWith(a);
|
|
65
|
-
break;
|
|
66
|
-
case "before":
|
|
67
|
-
e.before(a);
|
|
68
|
-
break;
|
|
69
|
-
case "after":
|
|
70
|
-
e.after(a);
|
|
71
|
-
break;
|
|
72
|
-
case "prepend":
|
|
73
|
-
e.prepend(a);
|
|
74
|
-
break;
|
|
75
|
-
case "append": e.append(a);
|
|
76
|
-
}
|
|
77
|
-
i = a;
|
|
78
|
-
}
|
|
79
|
-
return i;
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
export { h as a, d as i, a as n, s as o, o as r, p as s, f as t };
|
package/dist/dom-DlLH3FxV.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const e=require("./supports-DBzjGaWD.cjs");function t(t){return!e.f()||!e.i()?[]:Array.from(window.document.querySelectorAll(t)).filter(e=>e instanceof HTMLElement)}var n=`open`;function r(t){if(!e.u())throw Error(`Shadow DOM is not supported in this environment`);return t.attachShadow({mode:n})}function i(){return new Promise((t,n)=>{if(!e.i()){n();return}document.readyState===`loading`?document.addEventListener(`readystatechange`,()=>t(),{once:!0}):t()})}function a(e,t){let n=new MutationObserver(r=>{document.contains(e)||(n.disconnect(),t())});n.observe(document.body,{childList:!0,subtree:!0})}var o=`picked-root`,s=`picked-target`,c=`picked-root`;function l(e,n){return[...e,{selector:`${c}[experience-id="${n}"]`,placement:`replace`}].flatMap(e=>{let r=t(e.selector).filter(e=>!f(e,n)&&!p(e,n));return{...e,elements:r}})}function u(e,t,n){return e.flatMap(e=>e.elements.map(r=>h(r,e.placement,t,n)))}function d(e,t){e.classList.add(s),e.classList.add(`${s}-${t}`)}function f(e,t){return t?e.classList.contains(`${s}-${t}`):e.classList.contains(`${s}`)}function p(e,t){return t?e.classList.contains(`${o}-${t}`):e.classList.contains(o)}function m(e,t){let n=document.createElement(`div`);return n.style.display=`block`,n.classList.add(o),n.classList.add(`${o}-${e}`),n.classList.add(`${o}-${t}`),n}function h(e,t,n,r){let i,a=m(n,r);if(e instanceof Document)i=e.body.appendChild(a);else{switch(t){case`replace`:e.replaceWith(a);break;case`before`:e.before(a);break;case`after`:e.after(a);break;case`prepend`:e.prepend(a);break;case`append`:e.append(a)}i=a}return i}Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
|
package/dist/emit-D-tLiWL1.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
let e=require("@picked/telemetry");async function t(t,n,r){let i=(0,e.createTelemetryEmitter)({endpoint:t,resource:n,headers:{"Picked-Telemetry":`sdk`},maxBatchSize:r.length||1});for(let e of r)i.record(e);await i.flush()}exports.flushSpans=t;
|
package/dist/emit-Ds2EG7CB.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createTelemetryEmitter as e } from "@picked/telemetry";
|
|
2
|
-
//#region src/plugins/telemetry/emit.ts
|
|
3
|
-
async function t(t, n, r) {
|
|
4
|
-
let i = e({
|
|
5
|
-
endpoint: t,
|
|
6
|
-
resource: n,
|
|
7
|
-
headers: { "Picked-Telemetry": "sdk" },
|
|
8
|
-
maxBatchSize: r.length || 1
|
|
9
|
-
});
|
|
10
|
-
for (let e of r) i.record(e);
|
|
11
|
-
await i.flush();
|
|
12
|
-
}
|
|
13
|
-
//#endregion
|
|
14
|
-
export { t as flushSpans };
|