@preprio/toolkit 0.5.0-rc.2 → 0.5.0-rc.4
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 +209 -10
- package/dist/astro/index.cjs +1194 -1
- package/dist/astro/index.d.cts +47 -1
- package/dist/astro/index.d.ts +47 -1
- package/dist/astro/index.js +1197 -1
- package/dist/chunk-46ISDRHT.js +26 -0
- package/dist/chunk-74KY5EAM.js +1219 -0
- package/dist/chunk-AHBN6FQP.js +184 -0
- package/dist/{chunk-FLPNN3CV.js → chunk-PDNCNTDB.js} +1370 -623
- package/dist/chunk-S3VT4UWM.js +75 -0
- package/dist/chunk-TG6N3C22.js +246 -0
- package/dist/chunk-URXSDJOU.js +356 -0
- package/dist/index.cjs +3166 -392
- package/dist/index.d.cts +238 -4
- package/dist/index.d.ts +238 -4
- package/dist/index.js +189 -149
- package/dist/live-preview-H4643QYF.js +18 -0
- package/dist/nextjs/components.cjs +1522 -359
- package/dist/nextjs/components.d.cts +1 -1
- package/dist/nextjs/components.d.ts +1 -1
- package/dist/nextjs/components.js +4 -1
- package/dist/nextjs/index.cjs +1085 -6
- package/dist/nextjs/index.d.cts +73 -1
- package/dist/nextjs/index.d.ts +73 -1
- package/dist/nextjs/index.js +1079 -7
- package/dist/nextjs/live-action.cjs +285 -0
- package/dist/nextjs/live-action.d.cts +12 -0
- package/dist/nextjs/live-action.d.ts +12 -0
- package/dist/nextjs/live-action.js +68 -0
- package/dist/nextjs/live.cjs +1896 -0
- package/dist/nextjs/live.d.cts +52 -0
- package/dist/nextjs/live.d.ts +52 -0
- package/dist/nextjs/live.js +265 -0
- package/dist/nuxt/index.cjs +1 -1
- package/dist/nuxt/index.js +1 -1
- package/dist/nuxt/live-preview-O2ZTJNW4.js +1520 -0
- package/dist/nuxt/live.cjs +1720 -0
- package/dist/nuxt/live.d.cts +43 -0
- package/dist/nuxt/live.d.ts +43 -0
- package/dist/nuxt/live.js +94 -0
- package/dist/{pixel-B3oQNbZ3.d.cts → pixel-CX422dCO.d.cts} +10 -1
- package/dist/{pixel-B3oQNbZ3.d.ts → pixel-CX422dCO.d.ts} +10 -1
- package/dist/react/components.cjs +1522 -359
- package/dist/react/components.d.cts +9 -0
- package/dist/react/components.d.ts +9 -0
- package/dist/react/components.js +1522 -359
- package/dist/sveltekit/index.cjs +1 -1
- package/dist/sveltekit/index.js +1 -1
- package/package.json +12 -1
- package/src/astro/PreprToolbar.astro +7 -1
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": "0.5.0-rc.
|
|
3
|
+
"version": "0.5.0-rc.4",
|
|
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)",
|
|
@@ -69,6 +69,11 @@
|
|
|
69
69
|
"import": "./dist/nextjs/image-loader.js",
|
|
70
70
|
"require": "./dist/nextjs/image-loader.cjs"
|
|
71
71
|
},
|
|
72
|
+
"./nextjs/live": {
|
|
73
|
+
"types": "./dist/nextjs/live.d.ts",
|
|
74
|
+
"import": "./dist/nextjs/live.js",
|
|
75
|
+
"require": "./dist/nextjs/live.cjs"
|
|
76
|
+
},
|
|
72
77
|
"./astro": {
|
|
73
78
|
"types": "./dist/astro/index.d.ts",
|
|
74
79
|
"import": "./dist/astro/index.js",
|
|
@@ -86,6 +91,11 @@
|
|
|
86
91
|
"import": "./dist/nuxt/index.js",
|
|
87
92
|
"require": "./dist/nuxt/index.cjs"
|
|
88
93
|
},
|
|
94
|
+
"./nuxt/live": {
|
|
95
|
+
"types": "./dist/nuxt/live.d.ts",
|
|
96
|
+
"import": "./dist/nuxt/live.js",
|
|
97
|
+
"require": "./dist/nuxt/live.cjs"
|
|
98
|
+
},
|
|
89
99
|
"./nuxt/components/*": "./src/nuxt/*.vue"
|
|
90
100
|
},
|
|
91
101
|
"files": [
|
|
@@ -102,6 +112,7 @@
|
|
|
102
112
|
"build": "tsup",
|
|
103
113
|
"postbuild": "node scripts/check-exports.mjs",
|
|
104
114
|
"test": "vitest run",
|
|
115
|
+
"test:e2e": "pnpm build && vitest run --config vitest.e2e.config.ts",
|
|
105
116
|
"typecheck": "tsc --noEmit"
|
|
106
117
|
},
|
|
107
118
|
"dependencies": {
|
|
@@ -50,11 +50,17 @@ const payload = {
|
|
|
50
50
|
/>
|
|
51
51
|
|
|
52
52
|
<script>
|
|
53
|
-
import { createPreprPreview } from '@preprio/toolkit';
|
|
53
|
+
import { createPreprPreview, startHtmlLivePreview } from '@preprio/toolkit';
|
|
54
54
|
|
|
55
55
|
const el = document.querySelector('script[data-prepr-toolbar-props]');
|
|
56
56
|
if (el?.textContent) {
|
|
57
57
|
const { props, options } = JSON.parse(el.textContent);
|
|
58
58
|
createPreprPreview({ props, options });
|
|
59
|
+
// Inside the Prepr editor: re-render the page with the editor's unsaved
|
|
60
|
+
// changes while they type (see `normalizeQuery`). A no-op elsewhere.
|
|
61
|
+
startHtmlLivePreview({
|
|
62
|
+
allowedEditorOrigins: options?.allowedEditorOrigins,
|
|
63
|
+
strictMode: options?.strictMode,
|
|
64
|
+
});
|
|
59
65
|
}
|
|
60
66
|
</script>
|