@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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  [![npm version](https://img.shields.io/npm/v/@preprio/toolkit.svg)](https://www.npmjs.com/package/@preprio/toolkit)
4
4
  [![npm downloads](https://img.shields.io/npm/dm/@preprio/toolkit.svg)](https://www.npmjs.com/package/@preprio/toolkit)
5
- [![license](https://img.shields.io/npm/l/@preprio/toolkit.svg)](https://github.com/preprio/prepr-toolkit/blob/main/LICENSE)
5
+ [![license](https://img.shields.io/npm/l/@preprio/toolkit.svg)](./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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nextjs.md) |
46
- | Astro | `@preprio/toolkit/astro` | [Astro](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/astro.md) |
47
- | SvelteKit | `@preprio/toolkit/sveltekit` | [SvelteKit](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/sveltekit.md) |
48
- | Nuxt | `@preprio/toolkit/nuxt` | [Nuxt](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nuxt.md) |
49
- | React, no framework | `@preprio/toolkit/react` | [React](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/react.md) |
50
- | Express, Hono, other | `@preprio/toolkit` | [Any other framework](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/other-frameworks.md) |
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](https://github.com/preprio/prepr-toolkit/blob/main/MIGRATION.md).
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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/astro.md), [SvelteKit](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/sveltekit.md), [Nuxt](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nuxt.md).
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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/troubleshooting.md).
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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/live-preview.md#preparing-your-queries).
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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nextjs.md#live-preview) · [Astro](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/astro.md#live-preview) · [SvelteKit](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/sveltekit.md#live-preview) · [Nuxt](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nuxt.md#live-preview).
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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/troubleshooting.md#live-preview-does-not-update).
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](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/live-preview.md) covers how it works, every option, the cookies involved and the security model.
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 | [Next.js](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nextjs.md) · [Astro](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/astro.md) · [SvelteKit](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/sveltekit.md) · [Nuxt](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/nuxt.md) · [React](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/react.md) · [Other](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/other-frameworks.md) |
206
- | [Live preview](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/live-preview.md) | Checklist, preparing queries, options, security, cookies |
207
- | [Visual editing](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/visual-editing.md) | How click-to-edit picks elements, and marking content by hand |
208
- | [Configuration](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/configuration.md) | Middleware and preview options, feature flags, headless preview, theming, languages |
209
- | [API reference](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/api-reference.md) | Every entry point, helper and component |
210
- | [Troubleshooting](https://github.com/preprio/prepr-toolkit/blob/main/packages/toolkit/docs/troubleshooting.md) | Toolbar, click-to-edit, headers, live preview, cookies |
211
- | [Examples](https://github.com/preprio/prepr-toolkit/tree/main/examples) | Runnable Next.js, Astro, SvelteKit, Nuxt and Express apps |
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](https://github.com/preprio/prepr-toolkit/blob/main/CHANGELOG.md).
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
 
@@ -34,7 +34,7 @@ __export(astro_exports, {
34
34
  module.exports = __toCommonJS(astro_exports);
35
35
 
36
36
  // src/version.ts
37
- var VERSION = "1.0.0-rc.1";
37
+ var VERSION = "1.0.0-rc.2";
38
38
 
39
39
  // src/core/constants.ts
40
40
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "1.0.0-rc.1";
2
+ var VERSION = "1.0.0-rc.2";
3
3
 
4
4
  // src/core/constants.ts
5
5
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -1,5 +1,5 @@
1
1
  // src/version.ts
2
- var VERSION = "1.0.0-rc.1";
2
+ var VERSION = "1.0.0-rc.2";
3
3
 
4
4
  // src/core/features.ts
5
5
  function isEnabled(config) {
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  VERSION,
3
3
  resolveFeatures
4
- } from "./chunk-33GWVTRJ.js";
4
+ } from "./chunk-DBKZWOXA.js";
5
5
 
6
6
  // src/core/server.ts
7
7
  var PreprError = class extends Error {
@@ -2,7 +2,7 @@ import {
2
2
  ALL_FEATURES_ENABLED,
3
3
  VERSION,
4
4
  resolveFeatures
5
- } from "./chunk-33GWVTRJ.js";
5
+ } from "./chunk-DBKZWOXA.js";
6
6
  import {
7
7
  createIframeBridge,
8
8
  isLocale,
package/dist/index.cjs CHANGED
@@ -51,7 +51,7 @@ __export(src_exports, {
51
51
  module.exports = __toCommonJS(src_exports);
52
52
 
53
53
  // src/version.ts
54
- var VERSION = "1.0.0-rc.1";
54
+ var VERSION = "1.0.0-rc.2";
55
55
 
56
56
  // src/core/features.ts
57
57
  function isEnabled(config) {
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.1";
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.1";
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-WBMN4L7G.js";
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-DSJ22P6J.js";
22
+ } from "./chunk-EWXBE3JD.js";
23
23
  import {
24
24
  VERSION,
25
25
  resolveFeatures
26
- } from "./chunk-33GWVTRJ.js";
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.1";
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-WBMN4L7G.js";
6
- import "../chunk-33GWVTRJ.js";
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";
@@ -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.1";
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";
@@ -2,7 +2,7 @@
2
2
  import { NextResponse } from "next/server";
3
3
 
4
4
  // src/version.ts
5
- var VERSION = "1.0.0-rc.1";
5
+ var VERSION = "1.0.0-rc.2";
6
6
 
7
7
  // src/core/constants.ts
8
8
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -1,8 +1,8 @@
1
1
  "use server";
2
2
  import {
3
3
  isPreviewFromHeaders
4
- } from "../chunk-DSJ22P6J.js";
5
- import "../chunk-33GWVTRJ.js";
4
+ } from "../chunk-EWXBE3JD.js";
5
+ import "../chunk-DBKZWOXA.js";
6
6
  import {
7
7
  parsePatchLog
8
8
  } from "../chunk-KM2GME62.js";
@@ -35,7 +35,7 @@ __export(nuxt_exports, {
35
35
  module.exports = __toCommonJS(nuxt_exports);
36
36
 
37
37
  // src/version.ts
38
- var VERSION = "1.0.0-rc.1";
38
+ var VERSION = "1.0.0-rc.2";
39
39
 
40
40
  // src/core/constants.ts
41
41
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-LUKVPOJ2.js";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = "1.0.0-rc.1";
14
+ var VERSION = "1.0.0-rc.2";
15
15
 
16
16
  // src/core/features.ts
17
17
  function isEnabled(config) {
@@ -3703,7 +3703,7 @@ function createPreprPreview(opts = {}) {
3703
3703
  }
3704
3704
 
3705
3705
  // src/version.ts
3706
- var VERSION = "1.0.0-rc.1";
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";
@@ -3679,7 +3679,7 @@ function createPreprPreview(opts = {}) {
3679
3679
  }
3680
3680
 
3681
3681
  // src/version.ts
3682
- var VERSION = "1.0.0-rc.1";
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";
@@ -35,7 +35,7 @@ __export(sveltekit_exports, {
35
35
  module.exports = __toCommonJS(sveltekit_exports);
36
36
 
37
37
  // src/version.ts
38
- var VERSION = "1.0.0-rc.1";
38
+ var VERSION = "1.0.0-rc.2";
39
39
 
40
40
  // src/core/constants.ts
41
41
  var COOKIE_PREVIEW_MODE = "Prepr-Preview-Mode";
@@ -11,7 +11,7 @@ import {
11
11
  } from "./chunk-LUKVPOJ2.js";
12
12
 
13
13
  // src/version.ts
14
- var VERSION = "1.0.0-rc.1";
14
+ var VERSION = "1.0.0-rc.2";
15
15
 
16
16
  // src/core/features.ts
17
17
  function isEnabled(config) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@preprio/toolkit",
3
- "version": "1.0.0-rc.1",
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)",