@preprio/toolkit 0.5.0-rc.5 → 0.5.1-dom.0
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 +218 -226
- package/dist/astro/index.cjs +1 -1
- package/dist/astro/index.js +1 -1
- package/dist/auto.cjs +4572 -0
- package/dist/auto.d.cts +42 -0
- package/dist/auto.d.ts +42 -0
- package/dist/auto.js +105 -0
- package/dist/browser/auto.js +117 -0
- package/dist/chunk-5I5TQ3NO.js +74 -0
- package/dist/chunk-AZC4BZJI.js +447 -0
- package/dist/{chunk-TG6N3C22.js → chunk-IKOOXTPM.js} +1 -1
- package/dist/{chunk-3X55JL52.js → chunk-IOSO232M.js} +4 -2
- package/dist/{chunk-SBLZANL5.js → chunk-RRM5762S.js} +2 -71
- package/dist/chunk-SZTHSJUA.js +326 -0
- package/dist/{chunk-CMUFTCG3.js → chunk-TEB7M7EM.js} +0 -4
- package/dist/chunk-UK664KSV.js +6 -0
- package/dist/{chunk-74KY5EAM.js → chunk-ZFGVP2GW.js} +28 -447
- package/dist/html-live-DzmEG9wU.d.cts +42 -0
- package/dist/html-live-DzmEG9wU.d.ts +42 -0
- package/dist/index.cjs +177 -2
- package/dist/index.d.cts +31 -28
- package/dist/index.d.ts +31 -28
- package/dist/index.js +21 -154
- package/dist/{live-preview-H4643QYF.js → live-preview-IYAS7PYV.js} +3 -2
- package/dist/nextjs/components.cjs +1 -1
- package/dist/nextjs/components.d.cts +2 -1
- package/dist/nextjs/components.d.ts +2 -1
- package/dist/nextjs/components.js +6 -3
- package/dist/nextjs/index.cjs +1 -1
- package/dist/nextjs/index.d.cts +0 -2
- package/dist/nextjs/index.d.ts +0 -2
- package/dist/nextjs/index.js +1 -1
- package/dist/nextjs/live-action.js +5 -3
- package/dist/nextjs/live.cjs +1 -4
- package/dist/nextjs/live.d.cts +1 -3
- package/dist/nextjs/live.d.ts +1 -3
- package/dist/nextjs/live.js +2 -5
- package/dist/nuxt/index.cjs +1 -1
- package/dist/nuxt/index.js +1 -1
- package/dist/pixel-DwW7cXJm.d.cts +49 -0
- package/dist/pixel-DwW7cXJm.d.ts +49 -0
- 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/dist/{pixel-CX422dCO.d.cts → types-DtMa_-f2.d.cts} +1 -49
- package/dist/{pixel-CX422dCO.d.ts → types-DtMa_-f2.d.ts} +1 -49
- package/package.json +12 -7
- package/dist/sveltekit/live-preview-O2ZTJNW4.js +0 -1520
- package/dist/sveltekit/live.cjs +0 -1731
- package/dist/sveltekit/live.d.cts +0 -59
- package/dist/sveltekit/live.d.ts +0 -59
- package/dist/sveltekit/live.js +0 -97
package/dist/nextjs/index.d.ts
CHANGED
|
@@ -311,8 +311,6 @@ interface LivePreviewConfig {
|
|
|
311
311
|
interface PreprRefreshProps {
|
|
312
312
|
/** Pass your preview flag; never `true` on a production deployment. */
|
|
313
313
|
enabled?: boolean;
|
|
314
|
-
/** Exact editor origins, replacing the `*.prepr.io` default. */
|
|
315
|
-
allowedEditorOrigins?: string[];
|
|
316
314
|
/** Your preview token uses GraphQL strict mode; see the toolbar option. */
|
|
317
315
|
strictMode?: boolean;
|
|
318
316
|
}
|
package/dist/nextjs/index.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
"use server";
|
|
2
2
|
import {
|
|
3
3
|
isPreviewFromHeaders
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-IOSO232M.js";
|
|
5
|
+
import "../chunk-UK664KSV.js";
|
|
6
|
+
import "../chunk-TEB7M7EM.js";
|
|
6
7
|
import {
|
|
7
8
|
parsePatchLog
|
|
8
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-ZFGVP2GW.js";
|
|
10
|
+
import "../chunk-AZC4BZJI.js";
|
|
9
11
|
import "../chunk-S3VT4UWM.js";
|
|
10
12
|
|
|
11
13
|
// src/nextjs/live-action.ts
|
package/dist/nextjs/live.cjs
CHANGED
|
@@ -1722,15 +1722,12 @@ function useLive(data, opts) {
|
|
|
1722
1722
|
}
|
|
1723
1723
|
function PreprRefresh({
|
|
1724
1724
|
enabled = false,
|
|
1725
|
-
allowedEditorOrigins: origins,
|
|
1726
1725
|
strictMode: strict = false
|
|
1727
1726
|
}) {
|
|
1728
1727
|
const router = (0, import_navigation.useRouter)();
|
|
1729
|
-
const originsKey = origins?.join(" ");
|
|
1730
1728
|
(0, import_react.useEffect)(() => {
|
|
1731
1729
|
if (!enabled || !isFramed()) return;
|
|
1732
1730
|
if (strict) strictMode = true;
|
|
1733
|
-
if (originsKey) allowedEditorOrigins = originsKey.split(" ");
|
|
1734
1731
|
const sync = createLogSync();
|
|
1735
1732
|
let unsubscribe = null;
|
|
1736
1733
|
let active = true;
|
|
@@ -1751,7 +1748,7 @@ function PreprRefresh({
|
|
|
1751
1748
|
unsubscribe?.();
|
|
1752
1749
|
sync.cancel();
|
|
1753
1750
|
};
|
|
1754
|
-
}, [enabled,
|
|
1751
|
+
}, [enabled, strict, router]);
|
|
1755
1752
|
return null;
|
|
1756
1753
|
}
|
|
1757
1754
|
var STEGA_CHARS = /[\u200b-\u200d\u2060-\u2064\ufeff]/;
|
package/dist/nextjs/live.d.cts
CHANGED
|
@@ -19,8 +19,6 @@ interface LivePreviewConfig {
|
|
|
19
19
|
interface PreprRefreshProps {
|
|
20
20
|
/** Pass your preview flag; never `true` on a production deployment. */
|
|
21
21
|
enabled?: boolean;
|
|
22
|
-
/** Exact editor origins, replacing the `*.prepr.io` default. */
|
|
23
|
-
allowedEditorOrigins?: string[];
|
|
24
22
|
/** Your preview token uses GraphQL strict mode; see the toolbar option. */
|
|
25
23
|
strictMode?: boolean;
|
|
26
24
|
}
|
|
@@ -49,6 +47,6 @@ declare function useLive<T>(data: T, opts?: UseLiveOptions): T;
|
|
|
49
47
|
* Use this or `useLive` with a `query`, not both: a save would refetch and
|
|
50
48
|
* refresh.
|
|
51
49
|
*/
|
|
52
|
-
declare function PreprRefresh({ enabled,
|
|
50
|
+
declare function PreprRefresh({ enabled, strictMode: strict, }: PreprRefreshProps): null;
|
|
53
51
|
|
|
54
52
|
export { type LivePreviewConfig, PreprRefresh, type PreprRefreshProps, type UseLiveOptions, initLivePreview, useLive };
|
package/dist/nextjs/live.d.ts
CHANGED
|
@@ -19,8 +19,6 @@ interface LivePreviewConfig {
|
|
|
19
19
|
interface PreprRefreshProps {
|
|
20
20
|
/** Pass your preview flag; never `true` on a production deployment. */
|
|
21
21
|
enabled?: boolean;
|
|
22
|
-
/** Exact editor origins, replacing the `*.prepr.io` default. */
|
|
23
|
-
allowedEditorOrigins?: string[];
|
|
24
22
|
/** Your preview token uses GraphQL strict mode; see the toolbar option. */
|
|
25
23
|
strictMode?: boolean;
|
|
26
24
|
}
|
|
@@ -49,6 +47,6 @@ declare function useLive<T>(data: T, opts?: UseLiveOptions): T;
|
|
|
49
47
|
* Use this or `useLive` with a `query`, not both: a save would refetch and
|
|
50
48
|
* refresh.
|
|
51
49
|
*/
|
|
52
|
-
declare function PreprRefresh({ enabled,
|
|
50
|
+
declare function PreprRefresh({ enabled, strictMode: strict, }: PreprRefreshProps): null;
|
|
53
51
|
|
|
54
52
|
export { type LivePreviewConfig, PreprRefresh, type PreprRefreshProps, type UseLiveOptions, initLivePreview, useLive };
|
package/dist/nextjs/live.js
CHANGED
|
@@ -27,7 +27,7 @@ function isFramed() {
|
|
|
27
27
|
return typeof window !== "undefined" && window.self !== window.top;
|
|
28
28
|
}
|
|
29
29
|
function startLive() {
|
|
30
|
-
starting ?? (starting = import("../live-preview-
|
|
30
|
+
starting ?? (starting = import("../live-preview-IYAS7PYV.js").then(
|
|
31
31
|
({ createLiveBridge, createLiveStore }) => {
|
|
32
32
|
const skipped = new Set(quarantined());
|
|
33
33
|
const started = createLiveStore({
|
|
@@ -92,15 +92,12 @@ function useLive(data, opts) {
|
|
|
92
92
|
}
|
|
93
93
|
function PreprRefresh({
|
|
94
94
|
enabled = false,
|
|
95
|
-
allowedEditorOrigins: origins,
|
|
96
95
|
strictMode: strict = false
|
|
97
96
|
}) {
|
|
98
97
|
const router = useRouter();
|
|
99
|
-
const originsKey = origins?.join(" ");
|
|
100
98
|
useEffect(() => {
|
|
101
99
|
if (!enabled || !isFramed()) return;
|
|
102
100
|
if (strict) strictMode = true;
|
|
103
|
-
if (originsKey) allowedEditorOrigins = originsKey.split(" ");
|
|
104
101
|
const sync = createLogSync();
|
|
105
102
|
let unsubscribe = null;
|
|
106
103
|
let active = true;
|
|
@@ -121,7 +118,7 @@ function PreprRefresh({
|
|
|
121
118
|
unsubscribe?.();
|
|
122
119
|
sync.cancel();
|
|
123
120
|
};
|
|
124
|
-
}, [enabled,
|
|
121
|
+
}, [enabled, strict, router]);
|
|
125
122
|
return null;
|
|
126
123
|
}
|
|
127
124
|
var STEGA_CHARS = /[\u200b-\u200d\u2060-\u2064\ufeff]/;
|
package/dist/nuxt/index.cjs
CHANGED
package/dist/nuxt/index.js
CHANGED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader + typed facade for Prepr's CDN tracking pixel, so consumers don't have
|
|
3
|
+
* to paste a `<script>` tag. The pixel itself lives on the CDN; this only sets
|
|
4
|
+
* up the handoff.
|
|
5
|
+
*
|
|
6
|
+
* The CDN script expects a queue stub to already exist when it loads, so the
|
|
7
|
+
* contract must be reproduced exactly:
|
|
8
|
+
* - `window.prepr` pushes `arguments` onto `.queue` until the real script
|
|
9
|
+
* lands and replaces `.process`.
|
|
10
|
+
* - `.t` must be a `Date.now()` timestamp.
|
|
11
|
+
* - The tag is inserted async, `src` cache-busted every 24h via
|
|
12
|
+
* `Math.ceil(Date.now() / cacheTime) * cacheTime`.
|
|
13
|
+
*/
|
|
14
|
+
/** Config accepted by the CDN pixel. */
|
|
15
|
+
interface PreprPixelConfig {
|
|
16
|
+
destinations?: {
|
|
17
|
+
googleTagManager?: boolean;
|
|
18
|
+
};
|
|
19
|
+
variantImpressionThreshold?: number;
|
|
20
|
+
}
|
|
21
|
+
type PreprQueueArgs = unknown[];
|
|
22
|
+
interface PreprQueueFn {
|
|
23
|
+
(...args: PreprQueueArgs): void;
|
|
24
|
+
queue: PreprQueueArgs[];
|
|
25
|
+
t: number;
|
|
26
|
+
process?: (...args: PreprQueueArgs) => void;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface Window {
|
|
30
|
+
prepr?: PreprQueueFn;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Install the queue stub, inject the pixel script, then queue
|
|
35
|
+
* `('init', trackingId, config?)` and `('event', 'pageload')` in that order.
|
|
36
|
+
*
|
|
37
|
+
* Idempotent, and a no-op outside a browser.
|
|
38
|
+
*/
|
|
39
|
+
declare function loadTrackingPixel(trackingId: string, config?: PreprPixelConfig): void;
|
|
40
|
+
/**
|
|
41
|
+
* Send a tracking event through `window.prepr`. Only depends on `window.prepr`
|
|
42
|
+
* existing, never on how it got installed. Warns once and returns quietly when
|
|
43
|
+
* no pixel is present.
|
|
44
|
+
*/
|
|
45
|
+
declare function trackEvent(name: string, data?: string | Record<string, unknown>): void;
|
|
46
|
+
/** Loader-independent like `trackEvent`; warns once if no pixel is installed. */
|
|
47
|
+
declare function setTrackingParam(key: string, value: string): void;
|
|
48
|
+
|
|
49
|
+
export { type PreprPixelConfig as P, loadTrackingPixel as l, setTrackingParam as s, trackEvent as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Loader + typed facade for Prepr's CDN tracking pixel, so consumers don't have
|
|
3
|
+
* to paste a `<script>` tag. The pixel itself lives on the CDN; this only sets
|
|
4
|
+
* up the handoff.
|
|
5
|
+
*
|
|
6
|
+
* The CDN script expects a queue stub to already exist when it loads, so the
|
|
7
|
+
* contract must be reproduced exactly:
|
|
8
|
+
* - `window.prepr` pushes `arguments` onto `.queue` until the real script
|
|
9
|
+
* lands and replaces `.process`.
|
|
10
|
+
* - `.t` must be a `Date.now()` timestamp.
|
|
11
|
+
* - The tag is inserted async, `src` cache-busted every 24h via
|
|
12
|
+
* `Math.ceil(Date.now() / cacheTime) * cacheTime`.
|
|
13
|
+
*/
|
|
14
|
+
/** Config accepted by the CDN pixel. */
|
|
15
|
+
interface PreprPixelConfig {
|
|
16
|
+
destinations?: {
|
|
17
|
+
googleTagManager?: boolean;
|
|
18
|
+
};
|
|
19
|
+
variantImpressionThreshold?: number;
|
|
20
|
+
}
|
|
21
|
+
type PreprQueueArgs = unknown[];
|
|
22
|
+
interface PreprQueueFn {
|
|
23
|
+
(...args: PreprQueueArgs): void;
|
|
24
|
+
queue: PreprQueueArgs[];
|
|
25
|
+
t: number;
|
|
26
|
+
process?: (...args: PreprQueueArgs) => void;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface Window {
|
|
30
|
+
prepr?: PreprQueueFn;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Install the queue stub, inject the pixel script, then queue
|
|
35
|
+
* `('init', trackingId, config?)` and `('event', 'pageload')` in that order.
|
|
36
|
+
*
|
|
37
|
+
* Idempotent, and a no-op outside a browser.
|
|
38
|
+
*/
|
|
39
|
+
declare function loadTrackingPixel(trackingId: string, config?: PreprPixelConfig): void;
|
|
40
|
+
/**
|
|
41
|
+
* Send a tracking event through `window.prepr`. Only depends on `window.prepr`
|
|
42
|
+
* existing, never on how it got installed. Warns once and returns quietly when
|
|
43
|
+
* no pixel is present.
|
|
44
|
+
*/
|
|
45
|
+
declare function trackEvent(name: string, data?: string | Record<string, unknown>): void;
|
|
46
|
+
/** Loader-independent like `trackEvent`; warns once if no pixel is installed. */
|
|
47
|
+
declare function setTrackingParam(key: string, value: string): void;
|
|
48
|
+
|
|
49
|
+
export { type PreprPixelConfig as P, loadTrackingPixel as l, setTrackingParam as s, trackEvent as t };
|
|
@@ -3513,7 +3513,7 @@ function createPreprPreview(opts = {}) {
|
|
|
3513
3513
|
}
|
|
3514
3514
|
|
|
3515
3515
|
// src/version.ts
|
|
3516
|
-
var VERSION = "0.5.
|
|
3516
|
+
var VERSION = "0.5.1-dom.0";
|
|
3517
3517
|
|
|
3518
3518
|
// src/core/pixel.ts
|
|
3519
3519
|
var PIXEL_SCRIPT_URL = "https://cdn.tracking.prepr.io/js/prepr.min.js";
|
package/dist/react/components.js
CHANGED
|
@@ -3489,7 +3489,7 @@ function createPreprPreview(opts = {}) {
|
|
|
3489
3489
|
}
|
|
3490
3490
|
|
|
3491
3491
|
// src/version.ts
|
|
3492
|
-
var VERSION = "0.5.
|
|
3492
|
+
var VERSION = "0.5.1-dom.0";
|
|
3493
3493
|
|
|
3494
3494
|
// src/core/pixel.ts
|
|
3495
3495
|
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
|
@@ -149,52 +149,4 @@ interface PreprHeaders {
|
|
|
149
149
|
}
|
|
150
150
|
type PreprErrorCode = 'INVALID_TOKEN' | 'MISSING_TOKEN' | 'HTTP_ERROR' | 'FETCH_ERROR' | 'INVALID_RESPONSE' | 'CONTEXT_ERROR';
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
* Loader + typed facade for Prepr's CDN tracking pixel, so consumers don't have
|
|
154
|
-
* to paste a `<script>` tag. The pixel itself lives on the CDN; this only sets
|
|
155
|
-
* up the handoff.
|
|
156
|
-
*
|
|
157
|
-
* The CDN script expects a queue stub to already exist when it loads, so the
|
|
158
|
-
* contract must be reproduced exactly:
|
|
159
|
-
* - `window.prepr` pushes `arguments` onto `.queue` until the real script
|
|
160
|
-
* lands and replaces `.process`.
|
|
161
|
-
* - `.t` must be a `Date.now()` timestamp.
|
|
162
|
-
* - The tag is inserted async, `src` cache-busted every 24h via
|
|
163
|
-
* `Math.ceil(Date.now() / cacheTime) * cacheTime`.
|
|
164
|
-
*/
|
|
165
|
-
/** Config accepted by the CDN pixel. */
|
|
166
|
-
interface PreprPixelConfig {
|
|
167
|
-
destinations?: {
|
|
168
|
-
googleTagManager?: boolean;
|
|
169
|
-
};
|
|
170
|
-
variantImpressionThreshold?: number;
|
|
171
|
-
}
|
|
172
|
-
type PreprQueueArgs = unknown[];
|
|
173
|
-
interface PreprQueueFn {
|
|
174
|
-
(...args: PreprQueueArgs): void;
|
|
175
|
-
queue: PreprQueueArgs[];
|
|
176
|
-
t: number;
|
|
177
|
-
process?: (...args: PreprQueueArgs) => void;
|
|
178
|
-
}
|
|
179
|
-
declare global {
|
|
180
|
-
interface Window {
|
|
181
|
-
prepr?: PreprQueueFn;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Install the queue stub, inject the pixel script, then queue
|
|
186
|
-
* `('init', trackingId, config?)` and `('event', 'pageload')` in that order.
|
|
187
|
-
*
|
|
188
|
-
* Idempotent, and a no-op outside a browser.
|
|
189
|
-
*/
|
|
190
|
-
declare function loadTrackingPixel(trackingId: string, config?: PreprPixelConfig): void;
|
|
191
|
-
/**
|
|
192
|
-
* Send a tracking event through `window.prepr`. Only depends on `window.prepr`
|
|
193
|
-
* existing, never on how it got installed. Warns once and returns quietly when
|
|
194
|
-
* no pixel is present.
|
|
195
|
-
*/
|
|
196
|
-
declare function trackEvent(name: string, data?: string | Record<string, unknown>): void;
|
|
197
|
-
/** Loader-independent like `trackEvent`; warns once if no pixel is installed. */
|
|
198
|
-
declare function setTrackingParam(key: string, value: string): void;
|
|
199
|
-
|
|
200
|
-
export { type Locale as L, type PreprFeatures as P, type ResolvedPreprFeatures as R, type PreprSegment as a, type PreprVariant as b, type PreprToolbarProps as c, type PreprPreviewOptions as d, type PreprErrorCode as e, type PreprHeaders as f, type PreprEnvironment as g, type PreprEventType as h, type PreprFeatureConfig as i, type PreprHeaderName as j, type PreprPixelConfig as k, type PreprToolbarComponentProps as l, type PreprToolbarOptions as m, loadTrackingPixel as n, setTrackingParam as s, trackEvent as t };
|
|
152
|
+
export type { Locale as L, PreprToolbarProps as P, ResolvedPreprFeatures as R, PreprPreviewOptions as a, PreprFeatures as b, PreprSegment as c, PreprVariant as d, PreprErrorCode as e, PreprHeaders as f, PreprEnvironment as g, PreprEventType as h, PreprFeatureConfig as i, PreprHeaderName as j, PreprToolbarComponentProps as k, PreprToolbarOptions as l };
|
|
@@ -149,52 +149,4 @@ interface PreprHeaders {
|
|
|
149
149
|
}
|
|
150
150
|
type PreprErrorCode = 'INVALID_TOKEN' | 'MISSING_TOKEN' | 'HTTP_ERROR' | 'FETCH_ERROR' | 'INVALID_RESPONSE' | 'CONTEXT_ERROR';
|
|
151
151
|
|
|
152
|
-
|
|
153
|
-
* Loader + typed facade for Prepr's CDN tracking pixel, so consumers don't have
|
|
154
|
-
* to paste a `<script>` tag. The pixel itself lives on the CDN; this only sets
|
|
155
|
-
* up the handoff.
|
|
156
|
-
*
|
|
157
|
-
* The CDN script expects a queue stub to already exist when it loads, so the
|
|
158
|
-
* contract must be reproduced exactly:
|
|
159
|
-
* - `window.prepr` pushes `arguments` onto `.queue` until the real script
|
|
160
|
-
* lands and replaces `.process`.
|
|
161
|
-
* - `.t` must be a `Date.now()` timestamp.
|
|
162
|
-
* - The tag is inserted async, `src` cache-busted every 24h via
|
|
163
|
-
* `Math.ceil(Date.now() / cacheTime) * cacheTime`.
|
|
164
|
-
*/
|
|
165
|
-
/** Config accepted by the CDN pixel. */
|
|
166
|
-
interface PreprPixelConfig {
|
|
167
|
-
destinations?: {
|
|
168
|
-
googleTagManager?: boolean;
|
|
169
|
-
};
|
|
170
|
-
variantImpressionThreshold?: number;
|
|
171
|
-
}
|
|
172
|
-
type PreprQueueArgs = unknown[];
|
|
173
|
-
interface PreprQueueFn {
|
|
174
|
-
(...args: PreprQueueArgs): void;
|
|
175
|
-
queue: PreprQueueArgs[];
|
|
176
|
-
t: number;
|
|
177
|
-
process?: (...args: PreprQueueArgs) => void;
|
|
178
|
-
}
|
|
179
|
-
declare global {
|
|
180
|
-
interface Window {
|
|
181
|
-
prepr?: PreprQueueFn;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* Install the queue stub, inject the pixel script, then queue
|
|
186
|
-
* `('init', trackingId, config?)` and `('event', 'pageload')` in that order.
|
|
187
|
-
*
|
|
188
|
-
* Idempotent, and a no-op outside a browser.
|
|
189
|
-
*/
|
|
190
|
-
declare function loadTrackingPixel(trackingId: string, config?: PreprPixelConfig): void;
|
|
191
|
-
/**
|
|
192
|
-
* Send a tracking event through `window.prepr`. Only depends on `window.prepr`
|
|
193
|
-
* existing, never on how it got installed. Warns once and returns quietly when
|
|
194
|
-
* no pixel is present.
|
|
195
|
-
*/
|
|
196
|
-
declare function trackEvent(name: string, data?: string | Record<string, unknown>): void;
|
|
197
|
-
/** Loader-independent like `trackEvent`; warns once if no pixel is installed. */
|
|
198
|
-
declare function setTrackingParam(key: string, value: string): void;
|
|
199
|
-
|
|
200
|
-
export { type Locale as L, type PreprFeatures as P, type ResolvedPreprFeatures as R, type PreprSegment as a, type PreprVariant as b, type PreprToolbarProps as c, type PreprPreviewOptions as d, type PreprErrorCode as e, type PreprHeaders as f, type PreprEnvironment as g, type PreprEventType as h, type PreprFeatureConfig as i, type PreprHeaderName as j, type PreprPixelConfig as k, type PreprToolbarComponentProps as l, type PreprToolbarOptions as m, loadTrackingPixel as n, setTrackingParam as s, trackEvent as t };
|
|
152
|
+
export type { Locale as L, PreprToolbarProps as P, ResolvedPreprFeatures as R, PreprPreviewOptions as a, PreprFeatures as b, PreprSegment as c, PreprVariant as d, PreprErrorCode as e, PreprHeaders as f, PreprEnvironment as g, PreprEventType as h, PreprFeatureConfig as i, PreprHeaderName as j, PreprToolbarComponentProps as k, PreprToolbarOptions as l };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@preprio/toolkit",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1-dom.0",
|
|
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)",
|
|
@@ -32,13 +32,23 @@
|
|
|
32
32
|
"homepage": "https://github.com/preprio/prepr-toolkit#readme",
|
|
33
33
|
"bugs": "https://github.com/preprio/prepr-toolkit/issues",
|
|
34
34
|
"type": "module",
|
|
35
|
-
"sideEffects":
|
|
35
|
+
"sideEffects": [
|
|
36
|
+
"./dist/auto.js",
|
|
37
|
+
"./dist/auto.cjs",
|
|
38
|
+
"./dist/browser/auto.js"
|
|
39
|
+
],
|
|
36
40
|
"exports": {
|
|
37
41
|
".": {
|
|
38
42
|
"types": "./dist/index.d.ts",
|
|
39
43
|
"import": "./dist/index.js",
|
|
40
44
|
"require": "./dist/index.cjs"
|
|
41
45
|
},
|
|
46
|
+
"./auto": {
|
|
47
|
+
"types": "./dist/auto.d.ts",
|
|
48
|
+
"import": "./dist/auto.js",
|
|
49
|
+
"require": "./dist/auto.cjs"
|
|
50
|
+
},
|
|
51
|
+
"./browser/auto": "./dist/browser/auto.js",
|
|
42
52
|
"./react": {
|
|
43
53
|
"types": "./dist/react/index.d.ts",
|
|
44
54
|
"import": "./dist/react/index.js",
|
|
@@ -85,11 +95,6 @@
|
|
|
85
95
|
"import": "./dist/sveltekit/index.js",
|
|
86
96
|
"require": "./dist/sveltekit/index.cjs"
|
|
87
97
|
},
|
|
88
|
-
"./sveltekit/live": {
|
|
89
|
-
"types": "./dist/sveltekit/live.d.ts",
|
|
90
|
-
"import": "./dist/sveltekit/live.js",
|
|
91
|
-
"require": "./dist/sveltekit/live.cjs"
|
|
92
|
-
},
|
|
93
98
|
"./sveltekit/components/*": "./src/sveltekit/*.svelte",
|
|
94
99
|
"./nuxt": {
|
|
95
100
|
"types": "./dist/nuxt/index.d.ts",
|