@preprio/toolkit 1.0.0-rc.3 → 1.0.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/dist/astro/index.cjs +1 -1
- package/dist/astro/index.js +1 -1
- package/dist/{chunk-N6CXRQQP.js → chunk-6PMBN7OR.js} +1 -1
- package/dist/{chunk-PI5HUQ6G.js → chunk-K62RW46G.js} +1 -1
- package/dist/{chunk-EJDHVIFU.js → chunk-QWTSVPEQ.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/nextjs/live.cjs +18 -5
- package/dist/nextjs/live.js +18 -5
- 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/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.4";
|
|
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.4";
|
|
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-K62RW46G.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-6PMBN7OR.js";
|
|
23
23
|
import {
|
|
24
24
|
VERSION,
|
|
25
25
|
resolveFeatures
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-QWTSVPEQ.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.4";
|
|
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-K62RW46G.js";
|
|
6
|
+
import "../chunk-QWTSVPEQ.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.4";
|
|
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/nextjs/live.cjs
CHANGED
|
@@ -1953,12 +1953,15 @@ function createLogSync() {
|
|
|
1953
1953
|
let pending = null;
|
|
1954
1954
|
let cancelled = false;
|
|
1955
1955
|
let lastGood = [];
|
|
1956
|
+
let stopSettling = null;
|
|
1956
1957
|
const send = async (incoming) => {
|
|
1957
1958
|
const skipped = new Set(quarantined());
|
|
1958
1959
|
const log = skipped.size ? incoming.filter((patch) => !skipped.has(patchKey(patch))) : incoming;
|
|
1959
1960
|
if (!log.length) return;
|
|
1960
1961
|
inFlight = true;
|
|
1961
|
-
const
|
|
1962
|
+
const watch = stopSettling !== null || showsPreprContent();
|
|
1963
|
+
stopSettling?.();
|
|
1964
|
+
const stopWatching = watch ? watchUntilSettled(() => recoverFrom(log, lastGood)) : () => {
|
|
1962
1965
|
};
|
|
1963
1966
|
let failed = false;
|
|
1964
1967
|
try {
|
|
@@ -1967,11 +1970,21 @@ function createLogSync() {
|
|
|
1967
1970
|
failed = true;
|
|
1968
1971
|
debug6.log("sending unsaved changes failed", error);
|
|
1969
1972
|
}
|
|
1970
|
-
await new Promise((resolve) => setTimeout(resolve, RENDER_SETTLE_MS));
|
|
1971
|
-
stopWatching();
|
|
1972
1973
|
inFlight = false;
|
|
1973
|
-
if (recovering)
|
|
1974
|
-
|
|
1974
|
+
if (recovering) {
|
|
1975
|
+
stopWatching();
|
|
1976
|
+
return;
|
|
1977
|
+
}
|
|
1978
|
+
const settle = setTimeout(() => {
|
|
1979
|
+
stopSettling = null;
|
|
1980
|
+
stopWatching();
|
|
1981
|
+
if (!failed && !recovering) lastGood = log;
|
|
1982
|
+
}, RENDER_SETTLE_MS);
|
|
1983
|
+
stopSettling = watch ? () => {
|
|
1984
|
+
clearTimeout(settle);
|
|
1985
|
+
stopWatching();
|
|
1986
|
+
stopSettling = null;
|
|
1987
|
+
} : null;
|
|
1975
1988
|
if (pending && !cancelled) {
|
|
1976
1989
|
const next = pending;
|
|
1977
1990
|
pending = null;
|
package/dist/nextjs/live.js
CHANGED
|
@@ -231,12 +231,15 @@ function createLogSync() {
|
|
|
231
231
|
let pending = null;
|
|
232
232
|
let cancelled = false;
|
|
233
233
|
let lastGood = [];
|
|
234
|
+
let stopSettling = null;
|
|
234
235
|
const send = async (incoming) => {
|
|
235
236
|
const skipped = new Set(quarantined());
|
|
236
237
|
const log = skipped.size ? incoming.filter((patch) => !skipped.has(patchKey(patch))) : incoming;
|
|
237
238
|
if (!log.length) return;
|
|
238
239
|
inFlight = true;
|
|
239
|
-
const
|
|
240
|
+
const watch = stopSettling !== null || showsPreprContent();
|
|
241
|
+
stopSettling?.();
|
|
242
|
+
const stopWatching = watch ? watchUntilSettled(() => recoverFrom(log, lastGood)) : () => {
|
|
240
243
|
};
|
|
241
244
|
let failed = false;
|
|
242
245
|
try {
|
|
@@ -245,11 +248,21 @@ function createLogSync() {
|
|
|
245
248
|
failed = true;
|
|
246
249
|
debug.log("sending unsaved changes failed", error);
|
|
247
250
|
}
|
|
248
|
-
await new Promise((resolve) => setTimeout(resolve, RENDER_SETTLE_MS));
|
|
249
|
-
stopWatching();
|
|
250
251
|
inFlight = false;
|
|
251
|
-
if (recovering)
|
|
252
|
-
|
|
252
|
+
if (recovering) {
|
|
253
|
+
stopWatching();
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
const settle = setTimeout(() => {
|
|
257
|
+
stopSettling = null;
|
|
258
|
+
stopWatching();
|
|
259
|
+
if (!failed && !recovering) lastGood = log;
|
|
260
|
+
}, RENDER_SETTLE_MS);
|
|
261
|
+
stopSettling = watch ? () => {
|
|
262
|
+
clearTimeout(settle);
|
|
263
|
+
stopWatching();
|
|
264
|
+
stopSettling = null;
|
|
265
|
+
} : null;
|
|
253
266
|
if (pending && !cancelled) {
|
|
254
267
|
const next = pending;
|
|
255
268
|
pending = null;
|
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.4";
|
|
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.4";
|
|
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.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)",
|