@picked/client 0.0.101-next.2 → 0.0.101
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 +34 -158
- package/dist/{api-BlRFU0Fi.js → api-BOKA2i46.js} +1 -1
- package/dist/{api-AaQeg3Ij.cjs → api-C5jUHF3A.cjs} +1 -1
- package/dist/cjs/index.js +2 -2
- package/dist/cjs/plugins/dynamic-experiences/index.js +1 -1
- package/dist/cjs/server/index.js +1 -1
- package/dist/esm/index.js +2 -2
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/server/index.js +2 -2
- package/dist/{plugin-CVD2TnRC.cjs → plugin-BcB9ah7q.cjs} +1 -1
- package/dist/{plugin-DhznDG-h.js → plugin-COWxZiTa.js} +2 -2
- package/dist/{preview-unavailable-mW4Pj3Ph.js → preview-unavailable-BJjc3UNr.js} +1 -1
- package/dist/{preview-unavailable-xWLCr93y.cjs → preview-unavailable-CV1BonKA.cjs} +1 -1
- package/dist/{provider-COb_V-yq.js → provider-CszmtTg3.js} +1 -1
- package/dist/{provider-zag5m5GH.cjs → provider-daBChM0G.cjs} +1 -1
- package/package.json +5 -5
- 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 -101
- package/dist/docs/how-to/authenticate-with-a-magic-link.md +0 -47
- package/dist/docs/how-to/authenticate-with-a-password.md +0 -59
- 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 -93
- package/dist/docs/how-to/call-an-external-api-from-a-workflow.md +0 -102
- package/dist/docs/how-to/connect-the-mcp-server.md +0 -46
- 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 -85
- package/dist/docs/how-to/register-an-api-that-uses-oauth2.md +0 -107
- 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/retry-a-failed-call-with-a-loop.md +0 -81
- 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 -113
- 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/wait-for-an-action-response.md +0 -182
- 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 -56
- 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/external-apis.md +0 -169
- 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/labels.md +0 -321
- package/dist/docs/reference/dashboard/lead-search.md +0 -224
- 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/workflow-runs.md +0 -142
- package/dist/docs/reference/dashboard/workflow-templates.md +0 -182
- package/dist/docs/reference/dashboard/workflow-test-runs.md +0 -77
- 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 -107
- package/dist/docs/reference/glossary.md +0 -201
- package/dist/docs/reference/management-api/authentication.md +0 -87
- package/dist/docs/reference/management-api/authorization-and-scopes.md +0 -291
- package/dist/docs/reference/management-api/error-handling.md +0 -232
- 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 -154
- package/dist/docs/reference/sdk/analytics-events.md +0 -453
- 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 -253
- 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 -113
- package/dist/docs/reference/sdk/steps.md +0 -86
- package/dist/docs/reference/sdk/type-generation.md +0 -265
- package/dist/docs/reference/tools/chrome-extension.md +0 -16
- package/dist/docs/reference/tools/cli.md +0 -292
- package/dist/docs/reference/tools/image-optimisation-service.md +0 -104
- package/dist/docs/reference/tools/mcp.md +0 -136
- package/dist/docs/reference/tools/vite-plugin.md +0 -163
- package/dist/docs/tutorials/first-api-call.md +0 -235
- 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
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: how-to
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# How to write a predicate
|
|
7
|
-
|
|
8
|
-
This guide shows you how to let a condition read data that only your application holds,
|
|
9
|
-
such as a cart total or an account level.
|
|
10
|
-
|
|
11
|
-
## 1. Define the predicate
|
|
12
|
-
|
|
13
|
-
Pass a `predicates` object to `createClient()`:
|
|
14
|
-
|
|
15
|
-
```ts
|
|
16
|
-
import { createClient } from 'picked'
|
|
17
|
-
|
|
18
|
-
const client = createClient({
|
|
19
|
-
projectId: 'your-project-id',
|
|
20
|
-
predicates: {
|
|
21
|
-
'is-example-page': ({ location }) => location?.pathname === '/example',
|
|
22
|
-
'get-account-tier': async () => {
|
|
23
|
-
const data = await fetch('/api/get-account-tier').then((r) => r.json())
|
|
24
|
-
return data.result
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
})
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
A predicate returns a boolean, a string, an array of strings, or `undefined`. It can also
|
|
31
|
-
return a promise that resolves to one of those.
|
|
32
|
-
|
|
33
|
-
## 2. Invoke it from a condition
|
|
34
|
-
|
|
35
|
-
```ts
|
|
36
|
-
condition: {
|
|
37
|
-
'==': [
|
|
38
|
-
{ invoke: { var: 'predicates.is-example-page' } },
|
|
39
|
-
true,
|
|
40
|
-
],
|
|
41
|
-
}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
:::tip
|
|
45
|
-
A predicate also works inside `validation` logic.
|
|
46
|
-
:::
|
|
47
|
-
|
|
48
|
-
## Keep it pure and fast
|
|
49
|
-
|
|
50
|
-
- The same snapshot must always give the same result.
|
|
51
|
-
- Check that a response or a field is there before you read its value. Return `undefined`
|
|
52
|
-
when the data is not available, and do not throw.
|
|
53
|
-
- The SDK can invoke a predicate many times, so keep the logic small.
|
|
54
|
-
- Do not change the snapshot. It is frozen, and a change to it throws in strict mode.
|
|
55
|
-
|
|
56
|
-
## Related
|
|
57
|
-
|
|
58
|
-
- [Predicates](/reference/sdk/predicates) — the state snapshot shape.
|
|
59
|
-
- [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
|
|
60
|
-
why predicates exist.
|
package/dist/docs/index.md
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: map
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Picked documentation
|
|
7
|
-
|
|
8
|
-
Picked lets you build personalized UI flows in a visual editor. The SDK then serves them
|
|
9
|
-
to the visitors on your site.
|
|
10
|
-
|
|
11
|
-
There are two paths to follow. Choose the one that matches your work.
|
|
12
|
-
|
|
13
|
-
## Work in the dashboard
|
|
14
|
-
|
|
15
|
-
Build experiences, write content, and publish.
|
|
16
|
-
|
|
17
|
-
Start with [build your first experience](/tutorials/first-experience-in-the-dashboard).
|
|
18
|
-
It takes you from an empty project to a survey on your own site, and it needs no
|
|
19
|
-
development tools.
|
|
20
|
-
|
|
21
|
-
One thing must happen first: a developer adds the Picked SDK to your site one time. After
|
|
22
|
-
that, the dashboard is all you need.
|
|
23
|
-
|
|
24
|
-
Then:
|
|
25
|
-
|
|
26
|
-
- **[Build](/how-to/create-an-experience)** — experiences, flows, conditions, and A/B
|
|
27
|
-
tests.
|
|
28
|
-
- **[Content](/how-to/define-a-page-layout)** — Models, Blocks, entries, pages, and assets.
|
|
29
|
-
- **[Publish](/how-to/publish-a-workspace)** — preview, publish, and roll back.
|
|
30
|
-
- **[Administer and measure](/how-to/invite-and-remove-members)** — members, API keys,
|
|
31
|
-
analytics, and the tools that connect Picked to Google Tag Manager and to an AI tool.
|
|
32
|
-
- **[Dashboard reference](/reference/dashboard/projects)** — every dashboard screen and
|
|
33
|
-
every option, plus the [glossary](/reference/glossary).
|
|
34
|
-
- **[How Picked works](/explanation/how-picked-works)** — what happens when you publish.
|
|
35
|
-
|
|
36
|
-
## Integrate with code
|
|
37
|
-
|
|
38
|
-
Add Picked to a site or an application. Your code then renders the experiences that the
|
|
39
|
-
dashboard describes.
|
|
40
|
-
|
|
41
|
-
Start with [add Picked to your application](/tutorials/first-experience). It goes from an
|
|
42
|
-
empty project to a survey that runs in React or in Svelte.
|
|
43
|
-
|
|
44
|
-
Read the dashboard documents above also. Everything your code renders is described
|
|
45
|
-
there, so the two paths link to each other rather than repeat.
|
|
46
|
-
|
|
47
|
-
Then:
|
|
48
|
-
|
|
49
|
-
- **[Integrate the SDK](/how-to/install-the-sdk)** — install, register a component, read
|
|
50
|
-
a feature flag.
|
|
51
|
-
- **[Build a step form](/how-to/render-a-step-form)** — render fields, act on a
|
|
52
|
-
submission, validate input.
|
|
53
|
-
- **[Server-side rendering](/how-to/server-render-a-page)** — a page that a search engine
|
|
54
|
-
can read.
|
|
55
|
-
- **[Authenticate](/how-to/authenticate-with-a-password)** — the management API.
|
|
56
|
-
- **[SDK reference](/reference/sdk)**, **[Delivery API](/reference/delivery-api)**,
|
|
57
|
-
**[PickedQL](/reference/pickedql)**.
|
|
58
|
-
- **[Why it works this way](/explanation/why-server-side-rendering)** — the design
|
|
59
|
-
behind the SDK.
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Actions
|
|
9
|
-
|
|
10
|
-
An action is a side effect that starts when the flow reaches it. Use an action to
|
|
11
|
-
track an event, to send data to an external service, or to call a webhook.
|
|
12
|
-
|
|
13
|
-
<Screenshot
|
|
14
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/actions"
|
|
15
|
-
alt="The actions list for a workspace on the Picked dashboard"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
## Set up an action
|
|
19
|
-
|
|
20
|
-
**Name**: The name that the dashboard shows. Your visitors do not see it.
|
|
21
|
-
|
|
22
|
-
**Key**: The identifier that your application uses for this action. Your visitors do
|
|
23
|
-
not see it.
|
|
24
|
-
|
|
25
|
-
## Register in your application
|
|
26
|
-
|
|
27
|
-
A published action that starts a workflow needs no code in your application. The SDK
|
|
28
|
-
sends the request to Picked, and the workflow runs there.
|
|
29
|
-
|
|
30
|
-
To run your own code, pass a handler under the action key in `createClient()`. That handler
|
|
31
|
-
replaces the workflow for this key. See
|
|
32
|
-
[How to register an action handler](/how-to/register-an-action-handler) for the code, and
|
|
33
|
-
[SDK actions](/reference/sdk/actions) for what the handler receives and returns.
|
|
34
|
-
|
|
35
|
-
## Use actions in flows
|
|
36
|
-
|
|
37
|
-
In the flow builder, drag an action from the library onto the canvas. Connect it to
|
|
38
|
-
the point in the flow where you want it to start.
|
|
39
|
-
|
|
40
|
-
An action runs when the flow reaches its node. It does not interrupt your visitor. By
|
|
41
|
-
default the flow continues to the next connected node.
|
|
42
|
-
|
|
43
|
-
An action node can carry a **success** branch and a **failure** branch. Which one the flow
|
|
44
|
-
takes depends on whether your handler throws, and a returned `false` is a success. See
|
|
45
|
-
[How an action decides which way to go](/explanation/how-picked-works#how-an-action-decides-which-way-to-go).
|
|
46
|
-
|
|
47
|
-
## Reuse actions
|
|
48
|
-
|
|
49
|
-
An action belongs to the project. Use the same action in more than one experience flow.
|
|
50
|
-
A change to the options of an action applies at every place that uses it.
|
|
51
|
-
|
|
52
|
-
## Related
|
|
53
|
-
|
|
54
|
-
- [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
|
|
55
|
-
- [How to register an action handler](/how-to/register-an-action-handler)
|
|
56
|
-
- [SDK actions](/reference/sdk/actions) — what the handler receives and returns.
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# API keys
|
|
9
|
-
|
|
10
|
-
An API key lets your code reach the Picked API. Use one where your own code calls the API,
|
|
11
|
-
such as a server-side integration. It does not sign the
|
|
12
|
-
[CLI](/reference/tools/cli) in.
|
|
13
|
-
|
|
14
|
-
<Screenshot
|
|
15
|
-
route="/{orgSlug}/api-keys"
|
|
16
|
-
alt="The API keys list for an organization on the Picked dashboard"
|
|
17
|
-
/>
|
|
18
|
-
|
|
19
|
-
## Use an API key
|
|
20
|
-
|
|
21
|
-
Put your API key in the `x-api-key` header of each request to the
|
|
22
|
-
[Picked API](/tutorials/first-api-call).
|
|
23
|
-
|
|
24
|
-
```
|
|
25
|
-
x-api-key: your-api-key
|
|
26
|
-
```
|
|
27
|
-
|
|
28
|
-
## Scopes
|
|
29
|
-
|
|
30
|
-
An API key carries scopes, and the scopes limit what the key can reach. Choose the
|
|
31
|
-
scopes that your integration needs when you create the key. A key can do only the
|
|
32
|
-
operations that its scopes permit.
|
|
33
|
-
|
|
34
|
-
## Related
|
|
35
|
-
|
|
36
|
-
- [How to create and revoke an API key](/how-to/create-and-revoke-an-api-key)
|
|
37
|
-
- [How to authenticate with an API key](/how-to/authenticate-with-an-api-key) — the API
|
|
38
|
-
side.
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Conditions
|
|
9
|
-
|
|
10
|
-
A condition evaluates a rule and splits the flow into two paths. One path is for a
|
|
11
|
-
true result, the other for a false result.
|
|
12
|
-
|
|
13
|
-
<Screenshot
|
|
14
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/conditions"
|
|
15
|
-
alt="The conditions list for a workspace on the Picked dashboard"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
## Set up a condition
|
|
19
|
-
|
|
20
|
-
**Name**: The name that the dashboard shows. Your visitors do not see it.
|
|
21
|
-
|
|
22
|
-
**Key**: The identifier for your application. You set it once and you cannot change
|
|
23
|
-
it. Your visitors do not see it.
|
|
24
|
-
|
|
25
|
-
## Branches
|
|
26
|
-
|
|
27
|
-
In the flow builder, a condition node has two output handles. The green handle, for a
|
|
28
|
-
true result, leads to the path for a match. The red handle, for a false result, leads
|
|
29
|
-
to the other path.
|
|
30
|
-
|
|
31
|
-
You can chain conditions. Connect the output of one condition to the input of another
|
|
32
|
-
to build a decision tree.
|
|
33
|
-
|
|
34
|
-
## Related
|
|
35
|
-
|
|
36
|
-
- [How to add a step, a field, an action, or a condition](/how-to/add-a-step-field-or-action)
|
|
37
|
-
|
|
38
|
-
- [About conditions and the logic engine](/explanation/conditions-and-the-logic-engine) —
|
|
39
|
-
what a rule can read.
|
|
40
|
-
- [How to write a condition](/how-to/write-a-condition)
|
|
41
|
-
- [Condition builder](/reference/dashboard/flow-builder/condition-builder) — the data
|
|
42
|
-
sources and the rule structure.
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Asset Library
|
|
9
|
-
|
|
10
|
-
The Asset Library holds the files that your content points at. These are images,
|
|
11
|
-
video, documents, and HTML.
|
|
12
|
-
|
|
13
|
-
<Screenshot
|
|
14
|
-
route="/{orgSlug}/{projectId}/assets"
|
|
15
|
-
alt="The asset library on the Picked dashboard"
|
|
16
|
-
/>
|
|
17
|
-
|
|
18
|
-
## Upload and control your assets
|
|
19
|
-
|
|
20
|
-
The Asset Library is a project-level store. Upload a file, then point at it from any
|
|
21
|
-
Content Entry in the project.
|
|
22
|
-
|
|
23
|
-
- **Size limit:** 50 MB for each file.
|
|
24
|
-
- **Allowed types:** an image in PNG, JPEG, WebP, AVIF, GIF, or SVG. A video in MP4
|
|
25
|
-
or WebM. A common document format. HTML, as `text/html`.
|
|
26
|
-
|
|
27
|
-
Picked rejects a file of another type. It also rejects a file above the size limit.
|
|
28
|
-
|
|
29
|
-
## HTML assets
|
|
30
|
-
|
|
31
|
-
Upload a `.html` file and point at it from an **HTML asset** field. Picked then scans
|
|
32
|
-
the file. The scan is advisory: it helps you, and it never stops you. It
|
|
33
|
-
reports findings about speed, about search rank, and about accessibility, so that you
|
|
34
|
-
can improve the file before you publish it:
|
|
35
|
-
|
|
36
|
-
- **File size:** a warning at 100 KB, and a stronger one at 250 KB.
|
|
37
|
-
- **Inline images:** a note when inline `base64` image data adds about 50 KB or more.
|
|
38
|
-
- **Image dimensions:** an image with no width and no height. Such an image can move
|
|
39
|
-
the content around it while the page loads.
|
|
40
|
-
- **Lazy load:** an image with no `loading="lazy"` attribute.
|
|
41
|
-
- **Link safety:** an external link with `target="_blank"` and no `rel="noopener"`.
|
|
42
|
-
- **Link search rank:** an external link with no `rel="nofollow"`.
|
|
43
|
-
- **Accessibility:** a pass by `axe-core`. It covers alt text, heading order,
|
|
44
|
-
contrast, and more.
|
|
45
|
-
|
|
46
|
-
Every finding is advisory. You can always upload the file as it is.
|
|
47
|
-
|
|
48
|
-
## How assets are served
|
|
49
|
-
|
|
50
|
-
Picked serves each asset from a sandboxed storage origin. That origin is separate
|
|
51
|
-
from the trusted origin of your application. HTML therefore comes from its own
|
|
52
|
-
origin, so a document that you upload runs in isolation and cannot reach the page
|
|
53
|
-
that holds it. A script in that document cannot read a session, a token, or the DOM
|
|
54
|
-
around it, because each of those needs same-origin access.
|
|
55
|
-
|
|
56
|
-
An [Experience Content](/reference/delivery-api/experience-content) response can hold an HTML
|
|
57
|
-
asset. The response then carries the content of that asset, and the SDK renders it
|
|
58
|
-
with no second request to storage.
|
|
59
|
-
|
|
60
|
-
## Related
|
|
61
|
-
|
|
62
|
-
- [How to upload and use an asset](/how-to/upload-and-use-an-asset)
|
|
63
|
-
- [Fields](/reference/dashboard/fields) — the field type for an HTML asset.
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Blocks
|
|
9
|
-
|
|
10
|
-
A Block is a reusable schema fragment that you embed inside a Model, so that a common structure is defined one time.
|
|
11
|
-
|
|
12
|
-
<Screenshot
|
|
13
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/blocks"
|
|
14
|
-
alt="The blocks list in the schema builder on the Picked dashboard"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
## What a Block is
|
|
18
|
-
|
|
19
|
-
A Block is a schema fragment with its own **Key**. A
|
|
20
|
-
[Model](/reference/dashboard/content/models) gives its shape to a whole Page or Step. A
|
|
21
|
-
Block is a part that you put into one or more Models. Define the shape one time, then
|
|
22
|
-
reuse it everywhere.
|
|
23
|
-
|
|
24
|
-
A Block holds no data of its own. The content that fills a Block sits inside the entry
|
|
25
|
-
of the Model that embeds it.
|
|
26
|
-
|
|
27
|
-
## Where a Block appears
|
|
28
|
-
|
|
29
|
-
**CMS** in the sidebar holds **Blocks**, and that list shows every Block in the
|
|
30
|
-
workspace. **Pages** holds **Page Sections**, which is the same list limited to the
|
|
31
|
-
Section category.
|
|
32
|
-
|
|
33
|
-
## Category
|
|
34
|
-
|
|
35
|
-
| Category | What it does |
|
|
36
|
-
| --- | --- |
|
|
37
|
-
| **Section** | Marks the Block as a page section. A **Page Sections** field accepts it. |
|
|
38
|
-
| **None (general content)** | Gives the Block no layout role. |
|
|
39
|
-
|
|
40
|
-
The category is fixed when you create the Block. You cannot change it later.
|
|
41
|
-
|
|
42
|
-
A **Content block** field holds the category of the Blocks that it accepts. Give that
|
|
43
|
-
field the **Section** category to build a page section list.
|
|
44
|
-
|
|
45
|
-
A field set to **Any category** accepts every Block in the workspace. This is the only
|
|
46
|
-
kind of field that can hold a Block with no category.
|
|
47
|
-
|
|
48
|
-
## Field types
|
|
49
|
-
|
|
50
|
-
A Block holds the same field types as a Model. See
|
|
51
|
-
[Field types](/reference/dashboard/content/models#field-types).
|
|
52
|
-
|
|
53
|
-
## Related
|
|
54
|
-
|
|
55
|
-
- [About the content model](/explanation/the-content-model) — why Blocks exist.
|
|
56
|
-
- [How to reuse a section](/how-to/reuse-a-section)
|
|
57
|
-
- [Models](/reference/dashboard/content/models)
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Content Entries
|
|
9
|
-
|
|
10
|
-
A content entry is one instance of a Model, filled with real data. A Page renders one entry, and a Flow Step can render one too.
|
|
11
|
-
|
|
12
|
-
<Screenshot
|
|
13
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/content"
|
|
14
|
-
alt="The content entries list on the Picked dashboard"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
## What a content entry is
|
|
18
|
-
|
|
19
|
-
A content entry is an instance of the schema of a
|
|
20
|
-
[Model](/reference/dashboard/content/models). The Model sets the fields, and the entry
|
|
21
|
-
holds the values. One Model backs many entries, and each entry holds its own data.
|
|
22
|
-
|
|
23
|
-
The Model of an entry is fixed when you create the entry.
|
|
24
|
-
|
|
25
|
-
## The entries list
|
|
26
|
-
|
|
27
|
-
**CMS** in the sidebar holds **Content entries**, with a count of every entry in the
|
|
28
|
-
workspace.
|
|
29
|
-
|
|
30
|
-
| Column | What it shows |
|
|
31
|
-
| --- | --- |
|
|
32
|
-
| Title | The value of the first single-line text field of the entry. It falls back to the entry id when no such field holds a value. |
|
|
33
|
-
| Model | The Model that the entry belongs to. |
|
|
34
|
-
| Entry ID | The stable id of the entry. |
|
|
35
|
-
| Last updated | When somebody last saved the entry. |
|
|
36
|
-
|
|
37
|
-
The **Model** filter narrows the list to one Model. The list has no search, because the
|
|
38
|
-
title is derived at read time and is not a column that Picked can search.
|
|
39
|
-
|
|
40
|
-
## How entries bind to pages and steps
|
|
41
|
-
|
|
42
|
-
A [Page](/reference/dashboard/content/pages) has a single Step, and that Step links to
|
|
43
|
-
its entry through the layout content link. A Flow [Step](/reference/dashboard/steps)
|
|
44
|
-
with a Step Layout binds an entry the same way. When the SDK renders the Page or the
|
|
45
|
-
Step, it resolves the linked entry and gives the data to your component.
|
|
46
|
-
|
|
47
|
-
## Edit entry data
|
|
48
|
-
|
|
49
|
-
The entry editor renders a form from the schema of the Model. There is one input for
|
|
50
|
-
each field, in the order that the schema sets. A repeatable field shows as a sortable
|
|
51
|
-
list. You can add to that list and put it into a new order. A group field holds its
|
|
52
|
-
inputs under one heading.
|
|
53
|
-
|
|
54
|
-
## Reference fields
|
|
55
|
-
|
|
56
|
-
A [Reference field](/reference/dashboard/content/models#reference-fields) holds a pointer
|
|
57
|
-
at another entry, and not a copy of it.
|
|
58
|
-
|
|
59
|
-
| Control | What it does |
|
|
60
|
-
| --- | --- |
|
|
61
|
-
| **Choose entry** | Opens the entry picker. |
|
|
62
|
-
| **Change entry** | Opens the entry picker on a field that holds a target already. |
|
|
63
|
-
| **Clear** | Removes the pointer. It does not delete the entry. |
|
|
64
|
-
|
|
65
|
-
The entry picker lists the entries that the **Target Model** of the field allows, and it
|
|
66
|
-
has a search box. **Open model** opens the Model of an entry in a new tab.
|
|
67
|
-
|
|
68
|
-
## Validation
|
|
69
|
-
|
|
70
|
-
Invalid data shows as an error on each field. The error carries a path in the JSON style,
|
|
71
|
-
and it points at the exact place in the entry, for example `sections[0].data.title`.
|
|
72
|
-
|
|
73
|
-
A reference field reports an error when its target does not exist, or when the target
|
|
74
|
-
belongs to the wrong Model. Fix every error before you publish, because Picked serves
|
|
75
|
-
valid content only.
|
|
76
|
-
|
|
77
|
-
## Delete rules
|
|
78
|
-
|
|
79
|
-
Picked does not delete an entry while something still points at it.
|
|
80
|
-
|
|
81
|
-
| Condition | Result |
|
|
82
|
-
| --- | --- |
|
|
83
|
-
| A Step uses the entry as its layout | The delete stops. |
|
|
84
|
-
| Another entry points at it through a Reference field | The delete stops. |
|
|
85
|
-
|
|
86
|
-
Clear the reference on the other entry first, then delete the target.
|
|
87
|
-
|
|
88
|
-
## Related
|
|
89
|
-
|
|
90
|
-
- [About the content model](/explanation/the-content-model) — why the schema and the data
|
|
91
|
-
are separate.
|
|
92
|
-
- [About content references](/explanation/content-references) — why a delete stops.
|
|
93
|
-
- [How to create a content entry](/how-to/create-a-content-entry)
|
|
94
|
-
- [How to point one entry at another](/how-to/point-one-entry-at-another)
|
|
95
|
-
- [Models](/reference/dashboard/content/models)
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Models
|
|
9
|
-
|
|
10
|
-
A Model is a reusable schema. It sets which fields a piece of content can hold, and it holds no data itself.
|
|
11
|
-
|
|
12
|
-
<Screenshot
|
|
13
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/models"
|
|
14
|
-
alt="The models list in the schema builder on the Picked dashboard"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
## Where a Model appears
|
|
18
|
-
|
|
19
|
-
**CMS** in the sidebar holds **Models**, and that list shows every Model in the
|
|
20
|
-
workspace. The list shows the **Key** below the name, because the key is the value that
|
|
21
|
-
a schema holds.
|
|
22
|
-
|
|
23
|
-
Two shortcuts open a filtered subset of the same list. **Flows** holds **Step Layouts**,
|
|
24
|
-
and **Pages** holds **Page Layouts**.
|
|
25
|
-
|
|
26
|
-
## Category
|
|
27
|
-
|
|
28
|
-
A category gives a Model a role. It decides where the Model appears, and what renders an
|
|
29
|
-
entry that comes from it.
|
|
30
|
-
|
|
31
|
-
| Category | It gives its shape to | What renders it |
|
|
32
|
-
| --- | --- | --- |
|
|
33
|
-
| **Page layout** | A standalone [Page](/reference/dashboard/content/pages). | The SDK renders the entry on your server. |
|
|
34
|
-
| **Step layout** | One [Step](/reference/dashboard/steps) inside a Flow. | The Step renders the entry in the browser. |
|
|
35
|
-
| **None (general content)** | Content with no layout role. | Nothing renders it directly. A [reference field](#reference-fields) reaches it. |
|
|
36
|
-
|
|
37
|
-
A Model with no category holds content that other content points at, such as a product
|
|
38
|
-
or a category. It appears under **CMS** only.
|
|
39
|
-
|
|
40
|
-
:::warning
|
|
41
|
-
The category is fixed when you create the Model. You cannot change it later.
|
|
42
|
-
:::
|
|
43
|
-
|
|
44
|
-
## Field types
|
|
45
|
-
|
|
46
|
-
A Model is built from fields. Each field has a type. The type decides the editor for the
|
|
47
|
-
field, and the shape of the value that the field holds.
|
|
48
|
-
|
|
49
|
-
| Type | Holds | Use it for |
|
|
50
|
-
| --- | --- | --- |
|
|
51
|
-
| **Single line text** | A short string. | A title, a label, or a short headline. |
|
|
52
|
-
| **Multi-line text** | A longer plain string. | A description, or a paragraph with no format marks. |
|
|
53
|
-
| **Markdown** | A Markdown string. | Body copy with format marks. |
|
|
54
|
-
| **Slug** | A URL-safe string. | A part of a path, or an identifier. |
|
|
55
|
-
| **Number** | A numeric value. | A price, a count, or a rating. |
|
|
56
|
-
| **Boolean** | A true or false value. | A toggle or a flag. |
|
|
57
|
-
| **Date** | A date value. | A publish date or a deadline. |
|
|
58
|
-
| **Color** | A color value. | A theme accent or a swatch. |
|
|
59
|
-
| **JSON** | Any JSON value. | Structured data with no editor of its own. |
|
|
60
|
-
| **Group** | An object of fields inside the Model. | A set of related fields, held together. |
|
|
61
|
-
| **Content block** | A [Block](/reference/dashboard/content/blocks) schema inside the Model. | A shared schema fragment that you reuse. |
|
|
62
|
-
| **Page Sections** | A repeatable Content block field, limited to the Section category. | The section list of a page. |
|
|
63
|
-
| **Reference** | A pointer at another [content entry](/reference/dashboard/content/content-entries). | A product that points at its category. |
|
|
64
|
-
| **Asset** | A link to an [Asset Library](/reference/dashboard/content/asset-library) item. | An image, a video, or a document. |
|
|
65
|
-
| **HTML** | A link to a `.html` file in your library. | HTML that you wrote before, held inside the content. |
|
|
66
|
-
|
|
67
|
-
## Reference fields
|
|
68
|
-
|
|
69
|
-
A **Reference** field points at another content entry. The entry that you point at keeps
|
|
70
|
-
its own data, and many fields can point at the same entry.
|
|
71
|
-
|
|
72
|
-
| Option | Values | What it does |
|
|
73
|
-
| --- | --- | --- |
|
|
74
|
-
| **Target Model** | A Model, or **Any Model** | Limits which entries an editor can choose. |
|
|
75
|
-
| **Repeatable** | On or off | On gives an ordered list of entries. Off gives one entry. |
|
|
76
|
-
|
|
77
|
-
**Target Model** holds the `key` of the Model, and not its id. A duplicate of the
|
|
78
|
-
workspace therefore keeps the constraint.
|
|
79
|
-
|
|
80
|
-
A reference stays inside one workspace. A field cannot point at an entry in another
|
|
81
|
-
workspace, and Picked reports such a target as unknown.
|
|
82
|
-
|
|
83
|
-
## Repeatable and grouped fields
|
|
84
|
-
|
|
85
|
-
You can make any field **repeatable**. It then shows as a sortable list of values, and
|
|
86
|
-
not as one value. Use it for a gallery, for a list of features, or for any collection.
|
|
87
|
-
|
|
88
|
-
A **Group** field holds a set of fields under one key, and it gives a structured object.
|
|
89
|
-
Make a group repeatable to describe a list of objects, such as a list of feature cards.
|
|
90
|
-
|
|
91
|
-
## Delete rules
|
|
92
|
-
|
|
93
|
-
Picked does not delete a Model while something still needs it.
|
|
94
|
-
|
|
95
|
-
| Condition | Result |
|
|
96
|
-
| --- | --- |
|
|
97
|
-
| Content entries still belong to the Model | The delete stops. |
|
|
98
|
-
| A Reference field still holds the Model as its **Target Model** | The delete stops. |
|
|
99
|
-
|
|
100
|
-
## Related
|
|
101
|
-
|
|
102
|
-
- [About the content model](/explanation/the-content-model) — why a schema change does not
|
|
103
|
-
migrate your data.
|
|
104
|
-
- [About content references](/explanation/content-references) — why a reference is a pointer.
|
|
105
|
-
- [How to define a page layout](/how-to/define-a-page-layout)
|
|
106
|
-
- [How to create a content entry](/how-to/create-a-content-entry)
|
|
107
|
-
- [How to point one entry at another](/how-to/point-one-entry-at-another)
|
|
108
|
-
- [Blocks](/reference/dashboard/content/blocks)
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
type: reference
|
|
3
|
-
layout: docs
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
import { Screenshot } from '../../../../../components/Screenshot'
|
|
7
|
-
|
|
8
|
-
# Pages
|
|
9
|
-
|
|
10
|
-
A Page is a standalone, server-rendered experience backed by CMS content, built for SEO-critical landing pages.
|
|
11
|
-
|
|
12
|
-
<Screenshot
|
|
13
|
-
route="/{orgSlug}/{projectId}/workspaces/{workspaceId}/experiences"
|
|
14
|
-
alt="The experiences list, where Pages and Flows are created on the Picked dashboard"
|
|
15
|
-
/>
|
|
16
|
-
|
|
17
|
-
## Edit page content
|
|
18
|
-
|
|
19
|
-
The Page editor has two tabs. The **Properties** tab holds the content of the page.
|
|
20
|
-
The **Settings** tab holds its name, its condition, and its layout. Fill in the
|
|
21
|
-
fields on the **Properties** tab. The inspector on the right edits the field that you
|
|
22
|
-
choose, and the preview panel shows the page while it fills in.
|
|
23
|
-
|
|
24
|
-
## Status
|
|
25
|
-
|
|
26
|
-
The **Settings** tab has a status control. It has two values.
|
|
27
|
-
|
|
28
|
-
| Value | Effect |
|
|
29
|
-
| --- | --- |
|
|
30
|
-
| **Active** | Picked serves the page to everyone. |
|
|
31
|
-
| **Draft** | Picked keeps the page out of the published site. |
|
|
32
|
-
|
|
33
|
-
A draft page is absent from the published payload. Picked also holds back the
|
|
34
|
-
steps, fields and actions that only that page uses, and it does not serve the
|
|
35
|
-
page content. A visitor and a search-engine crawler receive nothing.
|
|
36
|
-
|
|
37
|
-
To see a draft page, open it with a preview link. See
|
|
38
|
-
[How to see a preview of a workspace](/how-to/preview-a-workspace). One preview
|
|
39
|
-
link opens every draft page in the workspace.
|
|
40
|
-
|
|
41
|
-
Status applies to Flows and to Pages. It is not the same as the status of the
|
|
42
|
-
workspace: a draft page can be in a live workspace.
|
|
43
|
-
|
|
44
|
-
:::warning
|
|
45
|
-
Status is part of the published version. Change the value, then publish the
|
|
46
|
-
workspace to apply the change to the live site.
|
|
47
|
-
:::
|
|
48
|
-
|
|
49
|
-
## Change or remove the layout
|
|
50
|
-
|
|
51
|
-
Use the change-layout control on the **Settings** tab to move the page to another
|
|
52
|
-
[Page Layout](/reference/dashboard/content/models#category). When you unlink a layout,
|
|
53
|
-
Picked separates the content entry from the page. It deletes no entry, but the page then
|
|
54
|
-
has no content to render until you attach a layout again.
|
|
55
|
-
|
|
56
|
-
## Related
|
|
57
|
-
|
|
58
|
-
- [About pages and flows](/explanation/pages-and-flows) — when to choose a Page.
|
|
59
|
-
- [How to fill and publish a page](/how-to/fill-and-publish-a-page)
|
|
60
|
-
- [How to server-render a page](/how-to/server-render-a-page)
|
|
61
|
-
- [Models](/reference/dashboard/content/models) — the schema behind a Page.
|