@picked/client 0.0.1-dev.1786601464574 → 0.0.1-dev.1787019239195
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/dist/{api-DS7fA9kj.cjs → api-TWnRLh3X.cjs} +1 -1
- package/dist/{api-C8B96Kwv.js → api-uttjU_Tg.js} +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/docs/_root.css +101 -0
- package/dist/docs/how-to/analytics/index.md +2 -0
- package/dist/docs/how-to/authenticate-the-cli.md +15 -13
- package/dist/docs/how-to/create-and-revoke-an-api-key.md +7 -2
- package/dist/docs/how-to/debug-with-the-chrome-extension.md +1 -1
- package/dist/docs/how-to/install-the-sdk.md +30 -12
- package/dist/docs/how-to/install-the-vite-plugin.md +22 -9
- package/dist/docs/how-to/read-a-feature-flag.md +1 -1
- package/dist/docs/how-to/register-a-component.md +2 -2
- package/dist/docs/how-to/register-an-action-handler.md +1 -1
- package/dist/docs/how-to/server-render-a-page.md +1 -1
- package/dist/docs/how-to/write-a-predicate.md +1 -1
- package/dist/docs/reference/dashboard/api-keys.mdx +5 -4
- package/dist/docs/reference/pickedql/dimensions.md +10 -0
- package/dist/docs/reference/sdk/analytics-events.md +445 -0
- package/dist/docs/reference/sdk/content.md +1 -1
- package/dist/docs/reference/sdk/features.md +1 -1
- package/dist/docs/reference/sdk/plugins/dynamic-experiences.md +1 -1
- package/dist/docs/reference/sdk/plugins/window-object.md +1 -1
- package/dist/docs/reference/sdk/ssr/serialize.md +1 -1
- package/dist/docs/reference/sdk/type-generation.md +58 -17
- package/dist/docs/reference/tools/cli.md +16 -9
- package/dist/docs/reference/tools/vite-plugin.md +32 -6
- package/dist/docs/tutorials/first-experience.mdx +4 -4
- package/dist/docs/tutorials/first-server-rendered-page.mdx +3 -3
- package/dist/esm/index.js +2 -2
- package/dist/esm/plugins/dynamic-experiences/index.js +2 -2
- package/dist/esm/server/index.js +1 -1
- package/dist/{plugin-C8hWW3ed.js → plugin-Bb2fJVFr.js} +1 -1
- package/dist/{plugin-Dtg2sOad.cjs → plugin-hFQIiHOB.cjs} +1 -1
- package/dist/{provider-BEpRDCyr.js → provider-B8vTLrFT.js} +1 -1
- package/dist/{provider-ixdOyYTA.cjs → provider-DZEDUlIk.cjs} +1 -1
- package/dist/version-CfTz7TK0.cjs +1 -0
- package/dist/{version-IAAIvoH9.js → version-DjCWhJD5.js} +1 -1
- package/package.json +2 -2
- package/dist/version-BLzNWQ-j.cjs +0 -1
|
@@ -7,8 +7,6 @@ layout: docs
|
|
|
7
7
|
|
|
8
8
|
Picked can generate TypeScript types from your workspace schema so field values, feature keys, content models, and step layouts are typed in your app.
|
|
9
9
|
|
|
10
|
-
The generated file augments the `PickedSchemaRegistry` interface of `@picked/client`. Your IDE reads the types as soon as the declaration file is part of your TypeScript project.
|
|
11
|
-
|
|
12
10
|
## Quick start
|
|
13
11
|
|
|
14
12
|
### 1. Add `picked.config.ts`
|
|
@@ -16,25 +14,49 @@ The generated file augments the `PickedSchemaRegistry` interface of `@picked/cli
|
|
|
16
14
|
Create a `picked.config.ts` in your project root:
|
|
17
15
|
|
|
18
16
|
```typescript
|
|
19
|
-
import { defineConfig } from '
|
|
17
|
+
import { defineConfig } from 'picked/config'
|
|
20
18
|
|
|
21
19
|
export default defineConfig({
|
|
22
20
|
projectId: 'your-project-id',
|
|
23
|
-
apiUrl: 'https://api.picked.app',
|
|
24
21
|
typesOutput: './src/picked-env.d.ts',
|
|
25
|
-
source: 'published',
|
|
26
22
|
})
|
|
27
23
|
```
|
|
28
24
|
|
|
29
25
|
| Option | Description |
|
|
30
26
|
| --- | --- |
|
|
31
27
|
| `projectId` | **Required.** Your Picked project id. |
|
|
32
|
-
| `apiUrl` | API origin (defaults to `https://api.picked.app`). |
|
|
33
28
|
| `typesOutput` | Path for generated types (defaults to `./src/picked-env.d.ts`). |
|
|
34
|
-
| `source` | Schema surface to type against: `'published'` (default) or `'preview'`.
|
|
29
|
+
| `source` | Schema surface to type against: `'published'` (default) or `'preview'`. |
|
|
30
|
+
| `previewToken` | Workspace preview token. Required when `source` is `'preview'`, and read only then. |
|
|
35
31
|
|
|
36
32
|
The `source` value matches the `x-picked-source` field on the [workspace schema](/reference/delivery-api/workspace-schema) document — it controls whether tooling fetches the published or preview workspace shape.
|
|
37
33
|
|
|
34
|
+
A preview token reads one workspace, and it does not expire. Leave both `source` and
|
|
35
|
+
`previewToken` out of the committed file, and pick a workspace instead:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
picked login
|
|
39
|
+
picked workspace use
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
That writes the choice, and that workspace's token, to `.picked/settings.json`, which is
|
|
43
|
+
per-developer and which Git ignores. Each developer points at their own workspace, and the
|
|
44
|
+
committed file holds no token.
|
|
45
|
+
|
|
46
|
+
You can also set the values here. Every developer then reads the same workspace:
|
|
47
|
+
|
|
48
|
+
```typescript
|
|
49
|
+
export default defineConfig({
|
|
50
|
+
projectId: 'your-project-id',
|
|
51
|
+
source: 'preview',
|
|
52
|
+
previewToken: 'the-workspace-preview-token',
|
|
53
|
+
})
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Three places can give the token. Tooling reads the first of them that has one: the
|
|
57
|
+
`PICKED_PREVIEW_TOKEN` environment variable, then the workspace that
|
|
58
|
+
[`picked workspace use`](/reference/tools/cli) chose, then this `previewToken` option.
|
|
59
|
+
|
|
38
60
|
### 2. Enable the Vite plugin (recommended)
|
|
39
61
|
|
|
40
62
|
If you use Vite, add `@picked/vite-plugin-picked`. Type generation runs automatically on `dev` and `build` when `generateTypes` is enabled (the default):
|
|
@@ -49,24 +71,43 @@ export default defineConfig({
|
|
|
49
71
|
})
|
|
50
72
|
```
|
|
51
73
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
| --- | --- | --- |
|
|
56
|
-
| `generateTypes` | `true` | Read the workspace schema and write types, in development and in a build. |
|
|
57
|
-
| `disableLauncher` | `false` | Turn off the HTML page of the dev launcher. |
|
|
58
|
-
|
|
59
|
-
Set `generateTypes: false` in a nested Vite build that must not regenerate types, such as a build for one more entry point.
|
|
74
|
+
The project id comes from `picked.config.ts`. A failure stops the
|
|
75
|
+
run. See [the plugin reference](/reference/tools/vite-plugin) for `generateTypes` and every
|
|
76
|
+
other option.
|
|
60
77
|
|
|
61
78
|
### 3. Or use the CLI
|
|
62
79
|
|
|
63
|
-
Install
|
|
80
|
+
Install [`picked`](/reference/tools/cli) and run:
|
|
64
81
|
|
|
65
82
|
```bash
|
|
66
83
|
picked generate types
|
|
67
84
|
```
|
|
68
85
|
|
|
69
|
-
|
|
86
|
+
## Keep the types current
|
|
87
|
+
|
|
88
|
+
Commit `picked-env.d.ts`. A workspace changes after you commit it, so the file goes stale,
|
|
89
|
+
and stale types describe fields your workspace no longer has.
|
|
90
|
+
|
|
91
|
+
Run this check in CI, next to your other checks:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
picked generate types --check
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
`--check` writes no file. It reads the live workspace schema and compares it with the
|
|
98
|
+
committed file. A match gives status `0`. A difference gives status `1` and names the file:
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
Types are out of date: /home/runner/work/your-app/src/picked-env.d.ts
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
To clear it, run `picked generate types` and commit the result. The check reads no cached
|
|
105
|
+
schema, so an API it cannot reach fails the check.
|
|
106
|
+
|
|
107
|
+
:::note
|
|
108
|
+
`--check` reads the workspace that the resolved configuration names. A CI run that has no
|
|
109
|
+
`.picked/settings.json` reads the workspace your committed `picked.config.ts` names.
|
|
110
|
+
:::
|
|
70
111
|
|
|
71
112
|
## Workspace selection
|
|
72
113
|
|
|
@@ -5,18 +5,24 @@ layout: docs
|
|
|
5
5
|
|
|
6
6
|
# CLI
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
`picked` is the command-line tool for local Picked development. It generates TypeScript
|
|
9
|
+
types from your workspace schema and lets you switch which project or workspace your local
|
|
10
|
+
tooling loads — without hand-editing `picked.config.ts`.
|
|
11
11
|
|
|
12
12
|
## Installation
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
`picked.config
|
|
16
|
-
[How to authenticate the CLI](/how-to/authenticate-the-cli) to install it and sign in.
|
|
14
|
+
The [`picked`](/reference/sdk) package holds this command, the client, and the
|
|
15
|
+
`picked.config` helpers:
|
|
17
16
|
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
```bash
|
|
18
|
+
npm install picked
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The command reads `picked.config.ts` from the current directory, so run it from your
|
|
22
|
+
project root. See [How to authenticate the CLI](/how-to/authenticate-the-cli) to sign in.
|
|
23
|
+
|
|
24
|
+
`@picked/cli` holds the command on its own, for a project that wants no other part of the
|
|
25
|
+
package.
|
|
20
26
|
|
|
21
27
|
## Commands
|
|
22
28
|
|
|
@@ -124,7 +130,8 @@ Tooling — `picked generate types` and the
|
|
|
124
130
|
[Vite plugin](/reference/tools/vite-plugin) — resolves the configuration in this order. Each
|
|
125
131
|
layer supersedes the layer before it:
|
|
126
132
|
|
|
127
|
-
1. **`picked.config.ts`** — the committed default
|
|
133
|
+
1. **`picked.config.ts`** — the committed default: `projectId`, `source`, and
|
|
134
|
+
`previewToken`.
|
|
128
135
|
2. **`.picked/settings.json`** — the per-developer active selection that
|
|
129
136
|
`picked workspace use` writes. It supersedes `projectId` and `source`, and Git ignores it.
|
|
130
137
|
3. **Environment variables** — `PICKED_PROJECT_ID` and `PICKED_PREVIEW_TOKEN` supersede
|
|
@@ -106,12 +106,38 @@ After the dev server starts, the launcher URL appears next to the Vite output:
|
|
|
106
106
|
|
|
107
107
|
## Options
|
|
108
108
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
|
113
|
-
|
|
|
114
|
-
| `
|
|
109
|
+
Project identity belongs in [`picked.config.ts`](/reference/sdk/type-generation). The two
|
|
110
|
+
options that carry it are deprecated, and the table marks them.
|
|
111
|
+
|
|
112
|
+
| Option | Type | Default | Description |
|
|
113
|
+
| ---------------- | --------------------- | ------------------------ | ---------------------------------------------------------- |
|
|
114
|
+
| `disableLauncher`| `boolean` | `false` | Turns the launcher page off in both dev and build output. |
|
|
115
|
+
| `generateTypes` | `boolean` | `true` | Whether the plugin writes types from the workspace schema. |
|
|
116
|
+
| `mode` | `'bundle' \| 'api'` | `'bundle'` | Whether the build carries your project data. |
|
|
117
|
+
| `projectId` | `string` | — | **Deprecated.** Use `picked.config.ts`. |
|
|
118
|
+
| `apiUrl` | `string` | — | **Deprecated.** Use `picked.config.ts`. |
|
|
119
|
+
|
|
120
|
+
### projectId and apiUrl
|
|
121
|
+
|
|
122
|
+
These two options moved to [`picked.config.ts`](/reference/sdk/type-generation), which the
|
|
123
|
+
`picked` command and type generation also read. A later release removes them.
|
|
124
|
+
|
|
125
|
+
The plugin still reads an option for a field that `picked.config.ts` leaves out, so a
|
|
126
|
+
project that has yet to move needs no change. It stops when the two values are different,
|
|
127
|
+
rather than choose one for you:
|
|
128
|
+
|
|
129
|
+
```
|
|
130
|
+
picked plugin option `projectId` is "option-proj", and picked.config says "file-proj".
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### generateTypes
|
|
134
|
+
|
|
135
|
+
The plugin reads the workspace schema and writes `picked-env.d.ts`, on `vite dev` and on
|
|
136
|
+
`vite build`. [Type generation](/reference/sdk/type-generation) describes the output and
|
|
137
|
+
the `picked.config.ts` options that control it.
|
|
138
|
+
|
|
139
|
+
A failure stops the run. Set `generateTypes: false` for a build that must not write types,
|
|
140
|
+
such as a build for one more entry point.
|
|
115
141
|
|
|
116
142
|
### mode
|
|
117
143
|
|
|
@@ -102,11 +102,11 @@ Install the client and the adapter for your framework.
|
|
|
102
102
|
:::code-group
|
|
103
103
|
|
|
104
104
|
```bash [React]
|
|
105
|
-
npm install
|
|
105
|
+
npm install picked @picked/react effector effector-react
|
|
106
106
|
```
|
|
107
107
|
|
|
108
108
|
```bash [Svelte]
|
|
109
|
-
npm install
|
|
109
|
+
npm install picked @picked/svelte effector
|
|
110
110
|
```
|
|
111
111
|
|
|
112
112
|
:::
|
|
@@ -177,7 +177,7 @@ match the component name that you entered in step 4.
|
|
|
177
177
|
:::code-group
|
|
178
178
|
|
|
179
179
|
```tsx [React]
|
|
180
|
-
import { createClient } from '
|
|
180
|
+
import { createClient } from 'picked'
|
|
181
181
|
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
182
182
|
import { adaptReactComponent } from '@picked/react'
|
|
183
183
|
import { reactFrameworkPlugin } from '@picked/react/plugins/framework'
|
|
@@ -195,7 +195,7 @@ picked.start()
|
|
|
195
195
|
```
|
|
196
196
|
|
|
197
197
|
```ts [Svelte]
|
|
198
|
-
import { createClient } from '
|
|
198
|
+
import { createClient } from 'picked'
|
|
199
199
|
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
200
200
|
import { adaptSvelteComponent } from '@picked/svelte'
|
|
201
201
|
import { svelteFrameworkPlugin } from '@picked/svelte/plugins/framework'
|
|
@@ -76,7 +76,7 @@ a snapshot as plain JSON.
|
|
|
76
76
|
Make one client for each request, in `server.ts`:
|
|
77
77
|
|
|
78
78
|
```ts
|
|
79
|
-
import { createClient } from '
|
|
79
|
+
import { createClient } from 'picked'
|
|
80
80
|
import { serialize } from '@picked/client/server'
|
|
81
81
|
|
|
82
82
|
const client = createClient(options)
|
|
@@ -107,7 +107,7 @@ Register the component under the same name that the page uses. Here it is `CMSPa
|
|
|
107
107
|
:::code-group
|
|
108
108
|
|
|
109
109
|
```tsx [React]
|
|
110
|
-
import type { CreateClientOptions } from '
|
|
110
|
+
import type { CreateClientOptions } from 'picked'
|
|
111
111
|
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
112
112
|
import { adaptReactComponent, ExperienceSlot, PickedProvider } from '@picked/react'
|
|
113
113
|
import { reactFrameworkPlugin } from '@picked/react/plugins/framework'
|
|
@@ -136,7 +136,7 @@ export function Page({ snapshot }) {
|
|
|
136
136
|
|
|
137
137
|
```svelte [Svelte]
|
|
138
138
|
<script lang="ts">
|
|
139
|
-
import type { CreateClientOptions } from '
|
|
139
|
+
import type { CreateClientOptions } from 'picked'
|
|
140
140
|
import { dynamicExperiencesPlugin } from '@picked/client/plugins/dynamic-experiences'
|
|
141
141
|
import { adaptSvelteComponent, ExperienceSlot, setPickedContext } from '@picked/svelte'
|
|
142
142
|
import { svelteFrameworkPlugin } from '@picked/svelte/plugins/framework'
|
package/dist/esm/index.js
CHANGED
|
@@ -6,7 +6,7 @@ import { a as _, i as v, r as ee, s as y, t as b } from "../dom-BqcToNL0.js";
|
|
|
6
6
|
import { l as x, n as S, r as C, u as w } from "../experience-instance-DGk11d8a.js";
|
|
7
7
|
import { i as T, n as E, r as D, t as O } from "../storage-1MW3-_As.js";
|
|
8
8
|
import { t as te } from "../id-Bo4RBeOs.js";
|
|
9
|
-
import { t as ne } from "../version-
|
|
9
|
+
import { t as ne } from "../version-DjCWhJD5.js";
|
|
10
10
|
import { n as re, r as ie, t as ae } from "../inert-script-report-B_bMPRzp.js";
|
|
11
11
|
import { attach as k, combine as A, createApi as j, createDomain as M, createEffect as N, createEvent as P, createStore as F, is as oe, sample as I } from "effector";
|
|
12
12
|
import { createFactory as L, invoke as R } from "@withease/factories";
|
|
@@ -1774,7 +1774,7 @@ var Kt = class {
|
|
|
1774
1774
|
dataProviderFor(e) {
|
|
1775
1775
|
let t = e ?? "", n = this.dataProviders.get(t);
|
|
1776
1776
|
if (n) return n;
|
|
1777
|
-
let r = import("../provider-
|
|
1777
|
+
let r = import("../provider-B8vTLrFT.js").then((t) => t.createPickedDataProvider({
|
|
1778
1778
|
apiUrl: this.apiUrl,
|
|
1779
1779
|
projectId: this.projectId,
|
|
1780
1780
|
...e !== void 0 && { previewToken: e }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "../../../plugin-
|
|
2
|
-
import { n as t, t as n } from "../../../api-
|
|
1
|
+
import { t as e } from "../../../plugin-Bb2fJVFr.js";
|
|
2
|
+
import { n as t, t as n } from "../../../api-uttjU_Tg.js";
|
|
3
3
|
import { n as r } from "../../../registry-CXZv0uLg.js";
|
|
4
4
|
import { createClientHeaders as i, fetchSchema as a } from "@picked/delivery-api-client";
|
|
5
5
|
export { i as createClientHeaders, e as dynamicExperiencesPlugin, n as fetchExperienceContent, t as fetchProject, a as fetchSchema, r as registerPickedBundle };
|
package/dist/esm/server/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as e, c as t, i as n, o as r, s as i, t as a, u as o } from "../../experience-instance-DGk11d8a.js";
|
|
2
|
-
import { n as s } from "../../plugin-
|
|
2
|
+
import { n as s } from "../../plugin-Bb2fJVFr.js";
|
|
3
3
|
import { attach as c, createEffect as l, createEvent as u, createStore as d, sample as f } from "effector";
|
|
4
4
|
//#region src/server/serialize.ts
|
|
5
5
|
var p = 1e4;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("./logger-CSTvAyyB.cjs"),require("./api-
|
|
1
|
+
require("./logger-CSTvAyyB.cjs"),require("./api-TWnRLh3X.cjs");let e=require("effector");function t(e){let t=2166136261;for(let n of e)t^=n.codePointAt(0)??0,t=Math.imul(t,16777619);return t>>>0}function n(e){let t=e;return t^=t>>>16,t=Math.imul(t,2246822507),t^=t>>>13,t=Math.imul(t,3266489909),t^=t>>>16,t>>>0}function r(e,r){return n(t(`${e}:${r}`))%100}function i(e,t){return t<=0?!1:t>=100||e<t}function a(e,t){if(Array.isArray(t.conditions))for(let n of t.conditions)e.registerCondition(n)}function o(e,t){e.registerExperience({id:t.id,key:t.key,name:t.name,targets:t.targets,nodes:t.nodes,edges:t.edges,condition:t.condition,initializeOpen:t.initializeOpen,componentName:t.componentName})}function s(e){return typeof e!=`object`||!e?!1:`id`in e&&`key`in e&&`type`in e&&`name`in e}function c(e,t){if(Array.isArray(t.fields))for(let n of t.fields)s(n)&&e.registerField(n)}function l(e,t){if(!Array.isArray(t.steps))return;let n=new Map(t.fields.map(e=>[e.id,e.key]));for(let r of t.steps){let t=[];for(let e of r.fieldIds??[]){let i=n.get(e);if(i===void 0){`${r.key}${e}`;continue}t.push(i)}let i=r.layoutContentId?e.contents.getById(r.layoutContentId):null;e.registerStep({id:r.id,key:r.key,name:r.name,fieldKeys:t,layoutName:r.layoutName,...r.layoutContentId!==void 0&&{layoutContentId:r.layoutContentId,layoutContentStore:i}})}}function u(e,t){if(Array.isArray(t.experiences))for(let n of t.experiences)o(e,n)}function d(e,t,n){m(e,t,n.isPreview,n.sessionId),a(e,t),c(e,t),l(e,t),u(e,t)}function f(e){let t=e.searchParams[`preview-token`];if(t&&t.length>0)return t[0]}function p(e){let t=new Set,n=e.searchParams.feature;if(!n)return t;for(let e of n){let n=e.indexOf(`:`);n>0&&t.add(e.substring(0,n))}return t}function m(e,t,n,r){let i=p(e);for(let a of t.features)i.has(a.id)||h(e,a,n,r)}function h(e,t,n,a){let o=r(a,t.id);e.registerFeature(t.id,{key:`v${t.version}`,name:t.name,enabled:t.enabled,weight:t.weight,storage:n?`session`:`local`,decide:()=>i(o,t.weight)})}function g(e,t){for(let n of[...t.references??[],...t.content])e.registerContent({id:n.id,contentModelKey:n.contentModelKey,data:n.data})}function _(e,t){let n=new Map;return(r,i)=>{let a=n.get(r.id);if(a)return a;let o=(async()=>{try{let n=await t(r,i);return n&&g(e,n),n}finally{n.delete(r.id)}})();return n.set(r.id,o),o}}function v(e,t){let n=new Set(t&&Array.isArray(t.experiences)?t.experiences.map(e=>e.id):[]);return(t,r)=>n.has(t.id)?e(t,r):Promise.resolve(null)}function y(){return{name:`dynamic-experiences`,setup:t=>({onStart:(0,e.attach)({source:t.session.store.map(e=>e.id),effect:async e=>{let n=f(t),r=n!==void 0,i=n===void 0?void 0:{previewToken:n},a=await t.getProjectConfig(n===void 0?void 0:{previewToken:n}).catch(e=>null);if(t.contentLoader=_(t,v(e=>t.getExperienceContent(e,i),a)),!a)return;let o=t.seededVersionId;if(o!==null&&o!==a.versionId){t.versionSkew={seeded:o,resolved:a.versionId},`${a.versionId}${o}`;return}t.previewEmbedderOrigins=a.previewEmbedderOrigins??null,d(t,a,{isPreview:r,sessionId:e})}})})}}Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return y}});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
require("./logger-CSTvAyyB.cjs");const e=require("./api-
|
|
1
|
+
require("./logger-CSTvAyyB.cjs");const e=require("./api-TWnRLh3X.cjs"),t=require("./registry-C1t8l3t9.cjs");var n=`bundle`,r=`api`;async function i(){try{let e=await import(`virtual:picked/data`);return t.r(e)?e:null}catch{return null}}function a(e){if(e===void 0||t.r(e))return e}function o(o){let{apiUrl:s,projectId:c,previewToken:l,signal:u}=o,d=!!l,f=d?r:o.mode,p=a(d?void 0:o.bundle),m=d?void 0:o.projectConfig,h=o.getContent,g={mode:f??r,manifest:null},_,v,y=new Map;function b(){if(f===r)return Promise.resolve(null);if(p)return Promise.resolve(p);let e=t.t();return e?Promise.resolve(e):(_??=i(),_)}function x(e){g.mode=e?n:r,g.manifest=e?e.manifestMetadata:null}async function S(){if(m)return x(await b()),m;let t=await b();return x(t),t?t.projectConfig:f===n?null:e.n(s,c,{...l!==void 0&&{previewToken:l},...u!==void 0&&{signal:u}})}async function C(t,r){let i=l===void 0?void 0:{previewToken:l};if(h)return h(t,i);let a=await b();if(x(a),a)try{return await a.experienceContent(t,i)}catch{return`${t.id}`,null}if(f===n)return null;let o=r??u;return e.t(s,c,t.id,{...l!==void 0&&{previewToken:l},...o!==void 0&&{signal:o}})}return{meta:g,getProjectConfig:()=>(v??=S(),v),getContent:(e,t)=>{let n=y.get(e.id);if(n)return n;let r=C(e,t?.signal).finally(()=>{y.delete(e.id)});return y.set(e.id,r),r}}}exports.createPickedDataProvider=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=()=>`0.0.1-dev.1787019239195`;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@picked/client",
|
|
3
|
-
"version": "0.0.1-dev.
|
|
3
|
+
"version": "0.0.1-dev.1787019239195",
|
|
4
4
|
"dependencies": {
|
|
5
|
-
"@picked/delivery-api-client": "0.0.1-dev.
|
|
5
|
+
"@picked/delivery-api-client": "0.0.1-dev.1787019239195",
|
|
6
6
|
"@withease/factories": "^1.0.5"
|
|
7
7
|
},
|
|
8
8
|
"devDependencies": {
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var e=()=>`0.0.1-dev.1786601464574`;Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return e}});
|