@preprio/toolkit 1.0.0-rc.1 → 1.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -26
- package/dist/astro/index.cjs +1 -1
- package/dist/astro/index.js +1 -1
- package/dist/{chunk-33GWVTRJ.js → chunk-DBKZWOXA.js} +1 -1
- package/dist/{chunk-DSJ22P6J.js → chunk-EWXBE3JD.js} +1 -1
- package/dist/{chunk-WBMN4L7G.js → chunk-LJA5K4KM.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/nextjs/components.cjs +1 -1
- package/dist/nextjs/components.js +2 -2
- package/dist/nextjs/index.cjs +1 -1
- package/dist/nextjs/index.js +1 -1
- package/dist/nextjs/live-action.js +2 -2
- package/dist/nuxt/index.cjs +1 -1
- package/dist/nuxt/index.js +1 -1
- package/dist/react/components.cjs +1 -1
- package/dist/react/components.js +1 -1
- package/dist/sveltekit/index.cjs +1 -1
- package/dist/sveltekit/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
[](https://www.npmjs.com/package/@preprio/toolkit)
|
|
4
4
|
[](https://www.npmjs.com/package/@preprio/toolkit)
|
|
5
|
-
[](
|
|
5
|
+
[](./LICENSE)
|
|
6
6
|
|
|
7
7
|
Preview, visual editing, live preview and personalization for [Prepr CMS](https://prepr.io), for Next.js, Nuxt, Astro, SvelteKit, React and any other stack. One framework-free core with a thin wrapper per framework.
|
|
8
8
|
|
|
@@ -40,16 +40,16 @@ npm install @preprio/toolkit
|
|
|
40
40
|
|
|
41
41
|
## Choose your entry point
|
|
42
42
|
|
|
43
|
-
| You use | Import from | Guide
|
|
44
|
-
| -------------------- | ---------------------------- |
|
|
45
|
-
| Next.js | `@preprio/toolkit/nextjs` | [Next.js](
|
|
46
|
-
| Astro | `@preprio/toolkit/astro` | [Astro](
|
|
47
|
-
| SvelteKit | `@preprio/toolkit/sveltekit` | [SvelteKit](
|
|
48
|
-
| Nuxt | `@preprio/toolkit/nuxt` | [Nuxt](
|
|
49
|
-
| React, no framework | `@preprio/toolkit/react` | [React](
|
|
50
|
-
| Express, Hono, other | `@preprio/toolkit` | [Any other framework](
|
|
43
|
+
| You use | Import from | Guide |
|
|
44
|
+
| -------------------- | ---------------------------- | ------------------------------------------------- |
|
|
45
|
+
| Next.js | `@preprio/toolkit/nextjs` | [Next.js](./docs/nextjs.md) |
|
|
46
|
+
| Astro | `@preprio/toolkit/astro` | [Astro](./docs/astro.md) |
|
|
47
|
+
| SvelteKit | `@preprio/toolkit/sveltekit` | [SvelteKit](./docs/sveltekit.md) |
|
|
48
|
+
| Nuxt | `@preprio/toolkit/nuxt` | [Nuxt](./docs/nuxt.md) |
|
|
49
|
+
| React, no framework | `@preprio/toolkit/react` | [React](./docs/react.md) |
|
|
50
|
+
| Express, Hono, other | `@preprio/toolkit` | [Any other framework](./docs/other-frameworks.md) |
|
|
51
51
|
|
|
52
|
-
Coming from `@preprio/prepr-nextjs`? See the [migration guide](
|
|
52
|
+
Coming from `@preprio/prepr-nextjs`? See the [migration guide](../../MIGRATION.md).
|
|
53
53
|
|
|
54
54
|
## How it fits together
|
|
55
55
|
|
|
@@ -67,7 +67,7 @@ Two rules hold everywhere:
|
|
|
67
67
|
|
|
68
68
|
## Quick start (Next.js)
|
|
69
69
|
|
|
70
|
-
Other frameworks follow the same steps: [Astro](
|
|
70
|
+
Other frameworks follow the same steps: [Astro](./docs/astro.md), [SvelteKit](./docs/sveltekit.md), [Nuxt](./docs/nuxt.md).
|
|
71
71
|
|
|
72
72
|
**1. Add your GraphQL URL to `.env`.** The name is yours.
|
|
73
73
|
|
|
@@ -147,7 +147,7 @@ const response = await fetch(process.env.PREPR_GRAPHQL_URL!, {
|
|
|
147
147
|
2. Pick a segment. The page updates with that segment's content.
|
|
148
148
|
3. Open a content item's preview in Prepr and click text on the page. Prepr opens the field.
|
|
149
149
|
|
|
150
|
-
Nothing showing? See [Troubleshooting](
|
|
150
|
+
Nothing showing? See [Troubleshooting](./docs/troubleshooting.md).
|
|
151
151
|
|
|
152
152
|
## Set up live preview
|
|
153
153
|
|
|
@@ -179,7 +179,7 @@ const config = {
|
|
|
179
179
|
};
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
-
No Codegen? See [the other two ways](
|
|
182
|
+
No Codegen? See [the other two ways](./docs/live-preview.md#preparing-your-queries).
|
|
183
183
|
|
|
184
184
|
**5. Run your query results through the live preview helper**, with your preview flag as `enabled`:
|
|
185
185
|
|
|
@@ -190,29 +190,29 @@ No Codegen? See [the other two ways](https://github.com/preprio/prepr-toolkit/bl
|
|
|
190
190
|
| SvelteKit | `normalizedQuery(GetPageDocument, data.result, { enabled: data.preview, onSave: invalidateAll })` from `@preprio/toolkit/sveltekit/live` |
|
|
191
191
|
| Nuxt | `useNormalizedQuery(GetPageDocument, data, { enabled: preview, onSave: refresh })` from `@preprio/toolkit/nuxt/live` |
|
|
192
192
|
|
|
193
|
-
Full snippets per framework: [Next.js](
|
|
193
|
+
Full snippets per framework: [Next.js](./docs/nextjs.md#live-preview) · [Astro](./docs/astro.md#live-preview) · [SvelteKit](./docs/sveltekit.md#live-preview) · [Nuxt](./docs/nuxt.md#live-preview).
|
|
194
194
|
|
|
195
195
|
**6. Verify it works.** Open a content item and its preview in Prepr, and type in a text field. The page shows the text before you save.
|
|
196
196
|
|
|
197
|
-
Not updating? Check, in this order: `enabled` is true, the page is served over HTTPS, the browser console shows no `Refused to frame` error, and the query selects `_id`. More in [Troubleshooting](
|
|
197
|
+
Not updating? Check, in this order: `enabled` is true, the page is served over HTTPS, the browser console shows no `Refused to frame` error, and the query selects `_id`. More in [Troubleshooting](./docs/troubleshooting.md#live-preview-does-not-update).
|
|
198
198
|
|
|
199
|
-
The [live preview guide](
|
|
199
|
+
The [live preview guide](./docs/live-preview.md) covers how it works, every option, the cookies involved and the security model.
|
|
200
200
|
|
|
201
201
|
## Documentation
|
|
202
202
|
|
|
203
|
-
| Topic
|
|
204
|
-
|
|
|
205
|
-
| Framework guides
|
|
206
|
-
| [Live preview](
|
|
207
|
-
| [Visual editing](
|
|
208
|
-
| [Configuration](
|
|
209
|
-
| [API reference](
|
|
210
|
-
| [Troubleshooting](
|
|
211
|
-
| [Examples](
|
|
203
|
+
| Topic | |
|
|
204
|
+
| -------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
205
|
+
| Framework guides | [Next.js](./docs/nextjs.md) · [Astro](./docs/astro.md) · [SvelteKit](./docs/sveltekit.md) · [Nuxt](./docs/nuxt.md) · [React](./docs/react.md) · [Other](./docs/other-frameworks.md) |
|
|
206
|
+
| [Live preview](./docs/live-preview.md) | Checklist, preparing queries, options, security, cookies |
|
|
207
|
+
| [Visual editing](./docs/visual-editing.md) | How click-to-edit picks elements, and marking content by hand |
|
|
208
|
+
| [Configuration](./docs/configuration.md) | Middleware and preview options, feature flags, headless preview, theming, languages |
|
|
209
|
+
| [API reference](./docs/api-reference.md) | Every entry point, helper and component |
|
|
210
|
+
| [Troubleshooting](./docs/troubleshooting.md) | Toolbar, click-to-edit, headers, live preview, cookies |
|
|
211
|
+
| [Examples](../../examples) | Runnable Next.js, Astro, SvelteKit, Nuxt and Express apps |
|
|
212
212
|
|
|
213
213
|
## Versioning
|
|
214
214
|
|
|
215
|
-
The package follows semver. Minor and patch releases never break the public API; a breaking change ships as a major version with a migration entry. An API on its way out is marked `@deprecated` and keeps working until the next major. See the [changelog](
|
|
215
|
+
The package follows semver. Minor and patch releases never break the public API; a breaking change ships as a major version with a migration entry. An API on its way out is marked `@deprecated` and keeps working until the next major. See the [changelog](../../CHANGELOG.md).
|
|
216
216
|
|
|
217
217
|
Cookie names, header names, `data-prepr-*` attributes and the editor's message format are part of that contract.
|
|
218
218
|
|
package/dist/astro/index.cjs
CHANGED
package/dist/astro/index.js
CHANGED
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -5,7 +5,7 @@ export { g as PreprEnvironment, h as PreprEventType, i as PreprFeatureConfig, j
|
|
|
5
5
|
* Package version; must match package.json. Lives in its own leaf module so
|
|
6
6
|
* core can import it without cycling through the barrel.
|
|
7
7
|
*/
|
|
8
|
-
declare const VERSION = "1.0.0-rc.
|
|
8
|
+
declare const VERSION = "1.0.0-rc.2";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Resolve a `PreprFeatures` bag to plain booleans, defaulting every omitted key
|
package/dist/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { g as PreprEnvironment, h as PreprEventType, i as PreprFeatureConfig, j
|
|
|
5
5
|
* Package version; must match package.json. Lives in its own leaf module so
|
|
6
6
|
* core can import it without cycling through the barrel.
|
|
7
7
|
*/
|
|
8
|
-
declare const VERSION = "1.0.0-rc.
|
|
8
|
+
declare const VERSION = "1.0.0-rc.2";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Resolve a `PreprFeatures` bag to plain booleans, defaulting every omitted key
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
setTrackingParam,
|
|
9
9
|
stegaClean,
|
|
10
10
|
trackEvent
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-LJA5K4KM.js";
|
|
12
12
|
import {
|
|
13
13
|
PreprError,
|
|
14
14
|
extractAccessToken,
|
|
@@ -19,11 +19,11 @@ import {
|
|
|
19
19
|
getPreprUUIDFromHeaders,
|
|
20
20
|
getToolbarPropsFromHeaders,
|
|
21
21
|
validatePreprToken
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-EWXBE3JD.js";
|
|
23
23
|
import {
|
|
24
24
|
VERSION,
|
|
25
25
|
resolveFeatures
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-DBKZWOXA.js";
|
|
27
27
|
import {
|
|
28
28
|
createLiveBridge,
|
|
29
29
|
createLiveStore
|
|
@@ -3707,7 +3707,7 @@ function createPreprPreview(opts = {}) {
|
|
|
3707
3707
|
var import_react = require("react");
|
|
3708
3708
|
|
|
3709
3709
|
// src/version.ts
|
|
3710
|
-
var VERSION = "1.0.0-rc.
|
|
3710
|
+
var VERSION = "1.0.0-rc.2";
|
|
3711
3711
|
|
|
3712
3712
|
// src/core/pixel.ts
|
|
3713
3713
|
var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createPreprPreview,
|
|
4
4
|
loadTrackingPixel
|
|
5
|
-
} from "../chunk-
|
|
6
|
-
import "../chunk-
|
|
5
|
+
} from "../chunk-LJA5K4KM.js";
|
|
6
|
+
import "../chunk-DBKZWOXA.js";
|
|
7
7
|
import "../chunk-Y7JWV7WV.js";
|
|
8
8
|
import "../chunk-UTKH7DOI.js";
|
|
9
9
|
import "../chunk-V7MCHPE7.js";
|
package/dist/nextjs/index.cjs
CHANGED
|
@@ -49,7 +49,7 @@ module.exports = __toCommonJS(nextjs_exports);
|
|
|
49
49
|
var import_server = require("next/server");
|
|
50
50
|
|
|
51
51
|
// src/version.ts
|
|
52
|
-
var VERSION = "1.0.0-rc.
|
|
52
|
+
var VERSION = "1.0.0-rc.2";
|
|
53
53
|
|
|
54
54
|
// src/core/constants.ts
|
|
55
55
|
var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
|
package/dist/nextjs/index.js
CHANGED
package/dist/nuxt/index.cjs
CHANGED
package/dist/nuxt/index.js
CHANGED
|
@@ -3703,7 +3703,7 @@ function createPreprPreview(opts = {}) {
|
|
|
3703
3703
|
}
|
|
3704
3704
|
|
|
3705
3705
|
// src/version.ts
|
|
3706
|
-
var VERSION = "1.0.0-rc.
|
|
3706
|
+
var VERSION = "1.0.0-rc.2";
|
|
3707
3707
|
|
|
3708
3708
|
// src/core/pixel.ts
|
|
3709
3709
|
var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
|
package/dist/react/components.js
CHANGED
|
@@ -3679,7 +3679,7 @@ function createPreprPreview(opts = {}) {
|
|
|
3679
3679
|
}
|
|
3680
3680
|
|
|
3681
3681
|
// src/version.ts
|
|
3682
|
-
var VERSION = "1.0.0-rc.
|
|
3682
|
+
var VERSION = "1.0.0-rc.2";
|
|
3683
3683
|
|
|
3684
3684
|
// src/core/pixel.ts
|
|
3685
3685
|
var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
|
package/dist/sveltekit/index.cjs
CHANGED
package/dist/sveltekit/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@preprio/toolkit",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"description": "Prepr personalization, A/B testing and preview toolkit for React, Next.js, Nuxt, Astro, SvelteKit and Express",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Prepr B.V. (https://prepr.io)",
|