@uniformdev/context-vue 19.200.1-alpha.3 → 19.201.1
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/index.d.mts +36 -36
- package/dist/index.d.ts +36 -36
- package/dist/index.esm.js +14 -14
- package/dist/index.js +72 -72
- package/dist/index.mjs +14 -14
- package/package.json +15 -15
package/dist/index.d.mts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as
|
2
|
-
import {
|
1
|
+
import * as vue from 'vue';
|
2
|
+
import { Component, PropType, HTMLAttributes, App } from 'vue';
|
3
3
|
import { PersonalizedVariant, TestVariant, EnrichmentData, Context, Quirks, ScoreVector } from '@uniformdev/context';
|
4
4
|
|
5
5
|
type PersonalizedVariationComponentProps = PersonalizedVariant & {
|
@@ -8,7 +8,7 @@ type PersonalizedVariationComponentProps = PersonalizedVariant & {
|
|
8
8
|
personalizationOccurred: boolean;
|
9
9
|
};
|
10
10
|
};
|
11
|
-
type PersonalizedVariationComponent = (variation: PersonalizedVariationComponentProps) =>
|
11
|
+
type PersonalizedVariationComponent = (variation: PersonalizedVariationComponentProps) => Component<any>;
|
12
12
|
type PersonalizeComponentProps = {
|
13
13
|
/**
|
14
14
|
* Name of the personalized placement. Should be unique to this placement location and set of variants.
|
@@ -22,7 +22,7 @@ type PersonalizeComponentProps = {
|
|
22
22
|
/** The number of variations to select. Use for personalized lists where the `count` most relevant should be shown. */
|
23
23
|
count?: number;
|
24
24
|
};
|
25
|
-
declare const Personalize:
|
25
|
+
declare const Personalize: vue.DefineComponent<vue.ExtractPropTypes<{
|
26
26
|
name: {
|
27
27
|
type: PropType<PersonalizeComponentProps["name"]>;
|
28
28
|
required: true;
|
@@ -39,9 +39,9 @@ declare const Personalize: vue_demi.DefineComponent<{
|
|
39
39
|
type: PropType<PersonalizeComponentProps["count"]>;
|
40
40
|
default: number;
|
41
41
|
};
|
42
|
-
}
|
42
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
43
43
|
[key: string]: any;
|
44
|
-
}>,
|
44
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
45
45
|
name: {
|
46
46
|
type: PropType<PersonalizeComponentProps["name"]>;
|
47
47
|
required: true;
|
@@ -58,11 +58,11 @@ declare const Personalize: vue_demi.DefineComponent<{
|
|
58
58
|
type: PropType<PersonalizeComponentProps["count"]>;
|
59
59
|
default: number;
|
60
60
|
};
|
61
|
-
}
|
61
|
+
}>> & Readonly<{}>, {
|
62
62
|
count: number | undefined;
|
63
|
-
}, {}>;
|
63
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
64
64
|
|
65
|
-
declare const PersonalizeStandard:
|
65
|
+
declare const PersonalizeStandard: vue.DefineComponent<vue.ExtractPropTypes<{
|
66
66
|
name: {
|
67
67
|
type: PropType<PersonalizeComponentProps["name"]>;
|
68
68
|
required: true;
|
@@ -79,11 +79,11 @@ declare const PersonalizeStandard: vue_demi.DefineComponent<{
|
|
79
79
|
type: PropType<PersonalizeComponentProps["count"]>;
|
80
80
|
default: number;
|
81
81
|
};
|
82
|
-
}
|
82
|
+
}>, () => (vue.VNode<vue.RendererNode, vue.RendererElement, {
|
83
83
|
[key: string]: any;
|
84
|
-
}> |
|
84
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
85
85
|
[key: string]: any;
|
86
|
-
}>[][])[],
|
86
|
+
}>[][])[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
87
87
|
name: {
|
88
88
|
type: PropType<PersonalizeComponentProps["name"]>;
|
89
89
|
required: true;
|
@@ -100,9 +100,9 @@ declare const PersonalizeStandard: vue_demi.DefineComponent<{
|
|
100
100
|
type: PropType<PersonalizeComponentProps["count"]>;
|
101
101
|
default: number;
|
102
102
|
};
|
103
|
-
}
|
103
|
+
}>> & Readonly<{}>, {
|
104
104
|
count: number | undefined;
|
105
|
-
}, {}>;
|
105
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
106
106
|
|
107
107
|
interface TestComponentProps {
|
108
108
|
/** Name of the test that is running. */
|
@@ -110,9 +110,9 @@ interface TestComponentProps {
|
|
110
110
|
/** Variation list that this test will selected from. */
|
111
111
|
variations: TestVariant[];
|
112
112
|
/** A Vue component to use to render the test variant. */
|
113
|
-
component:
|
113
|
+
component: Component<TestVariant>;
|
114
114
|
}
|
115
|
-
declare const Test:
|
115
|
+
declare const Test: vue.DefineComponent<vue.ExtractPropTypes<{
|
116
116
|
name: {
|
117
117
|
type: PropType<TestComponentProps["name"]>;
|
118
118
|
required: true;
|
@@ -125,9 +125,9 @@ declare const Test: vue_demi.DefineComponent<{
|
|
125
125
|
type: PropType<TestComponentProps["component"]>;
|
126
126
|
required: true;
|
127
127
|
};
|
128
|
-
}
|
128
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
129
129
|
[key: string]: any;
|
130
|
-
}>,
|
130
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
131
131
|
name: {
|
132
132
|
type: PropType<TestComponentProps["name"]>;
|
133
133
|
required: true;
|
@@ -140,7 +140,7 @@ declare const Test: vue_demi.DefineComponent<{
|
|
140
140
|
type: PropType<TestComponentProps["component"]>;
|
141
141
|
required: true;
|
142
142
|
};
|
143
|
-
}
|
143
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
144
144
|
|
145
145
|
interface TrackProps extends HTMLAttributes {
|
146
146
|
/** Behavior that will be pushed when tracking occurs. */
|
@@ -174,7 +174,7 @@ interface TrackProps extends HTMLAttributes {
|
|
174
174
|
* in DOM changes when personalization is added. If that's undesirable use TrackSlot instead which tracks
|
175
175
|
* only on page load, but does not render a wrapping tag.
|
176
176
|
*/
|
177
|
-
declare const Track:
|
177
|
+
declare const Track: vue.DefineComponent<vue.ExtractPropTypes<{
|
178
178
|
behavior: {
|
179
179
|
type: PropType<TrackProps["behavior"]>;
|
180
180
|
};
|
@@ -190,9 +190,9 @@ declare const Track: vue_demi.DefineComponent<{
|
|
190
190
|
type: PropType<TrackProps["threshold"]>;
|
191
191
|
default: number;
|
192
192
|
};
|
193
|
-
}
|
193
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
194
194
|
[key: string]: any;
|
195
|
-
}>,
|
195
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
196
196
|
behavior: {
|
197
197
|
type: PropType<TrackProps["behavior"]>;
|
198
198
|
};
|
@@ -208,11 +208,11 @@ declare const Track: vue_demi.DefineComponent<{
|
|
208
208
|
type: PropType<TrackProps["threshold"]>;
|
209
209
|
default: number;
|
210
210
|
};
|
211
|
-
}
|
211
|
+
}>> & Readonly<{}>, {
|
212
212
|
tagName: string | undefined;
|
213
213
|
disableVisibilityTrigger: boolean | undefined;
|
214
214
|
threshold: number | number[] | undefined;
|
215
|
-
}, {}>;
|
215
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
216
216
|
|
217
217
|
type TrackFragmentProps = {
|
218
218
|
behavior: EnrichmentData | EnrichmentData[] | undefined;
|
@@ -223,17 +223,17 @@ type TrackFragmentProps = {
|
|
223
223
|
* NOTE: if you wish to track on the visitor seeing the content in the browser viewport instead,
|
224
224
|
* use Track instead of TrackFragment.
|
225
225
|
*/
|
226
|
-
declare const TrackSlot:
|
226
|
+
declare const TrackSlot: vue.DefineComponent<vue.ExtractPropTypes<{
|
227
227
|
behavior: {
|
228
228
|
type: PropType<TrackFragmentProps["behavior"]>;
|
229
229
|
};
|
230
|
-
}
|
230
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
231
231
|
[key: string]: any;
|
232
|
-
}>,
|
232
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
233
233
|
behavior: {
|
234
234
|
type: PropType<TrackFragmentProps["behavior"]>;
|
235
235
|
};
|
236
|
-
}
|
236
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
237
237
|
|
238
238
|
type VariantOutputType = 'edge' | 'standard';
|
239
239
|
type UniformContextProps = {
|
@@ -261,7 +261,7 @@ declare function onRouteChange(context: Context): void;
|
|
261
261
|
declare const useUniformContext: () => UniformContextProps;
|
262
262
|
declare function isUsingUniformContext(): boolean;
|
263
263
|
|
264
|
-
declare const UniformContextProvider:
|
264
|
+
declare const UniformContextProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
265
265
|
context: {
|
266
266
|
type: PropType<UniformContextProps["context"]>;
|
267
267
|
required: true;
|
@@ -274,11 +274,11 @@ declare const UniformContextProvider: vue_demi.DefineComponent<{
|
|
274
274
|
type: PropType<UniformContextProps["trackRouteOnRender"]>;
|
275
275
|
default: boolean;
|
276
276
|
};
|
277
|
-
}
|
277
|
+
}>, () => (vue.VNode<vue.RendererNode, vue.RendererElement, {
|
278
278
|
[key: string]: any;
|
279
|
-
}> | (() =>
|
279
|
+
}> | (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
280
280
|
[key: string]: any;
|
281
|
-
}>))[],
|
281
|
+
}>))[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
282
282
|
context: {
|
283
283
|
type: PropType<UniformContextProps["context"]>;
|
284
284
|
required: true;
|
@@ -291,10 +291,10 @@ declare const UniformContextProvider: vue_demi.DefineComponent<{
|
|
291
291
|
type: PropType<UniformContextProps["trackRouteOnRender"]>;
|
292
292
|
default: boolean;
|
293
293
|
};
|
294
|
-
}
|
294
|
+
}>> & Readonly<{}>, {
|
295
295
|
outputType: VariantOutputType | undefined;
|
296
296
|
trackRouteOnRender: boolean | undefined;
|
297
|
-
}, {}>;
|
297
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
298
298
|
|
299
299
|
declare const provideIsPersonalized: (isPersonalized?: boolean) => void;
|
300
300
|
declare const useIsPersonalized: () => boolean | undefined;
|
@@ -303,12 +303,12 @@ declare const useIsPersonalized: () => boolean | undefined;
|
|
303
303
|
* Provides reactive access to the Uniform Context's current visitor quirks values
|
304
304
|
* This can be used when you want to read current quirk values directly.
|
305
305
|
*/
|
306
|
-
declare const useQuirks: () =>
|
306
|
+
declare const useQuirks: () => vue.Ref<Quirks, Quirks>;
|
307
307
|
|
308
308
|
/**
|
309
309
|
* Provides reactive access to the Uniform Context's current visitor scores values.
|
310
310
|
* This can be used when you want to read current score values directly.
|
311
311
|
*/
|
312
|
-
declare const useScores: () =>
|
312
|
+
declare const useScores: () => vue.Ref<ScoreVector, ScoreVector>;
|
313
313
|
|
314
314
|
export { Personalize, type PersonalizeComponentProps, PersonalizeStandard as PersonalizeEdge, type PersonalizedVariationComponent, type PersonalizedVariationComponentProps, Test, type TestComponentProps, Track, TrackSlot, type UniformContextProps, UniformContextProvider, type VariantOutputType, isUsingUniformContext, onRouteChange, provideIsPersonalized, provideUniformContext, uniformContextInjectionKey, useIsPersonalized, useQuirks, useScores, useUniformContext };
|
package/dist/index.d.ts
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import * as
|
2
|
-
import {
|
1
|
+
import * as vue from 'vue';
|
2
|
+
import { Component, PropType, HTMLAttributes, App } from 'vue';
|
3
3
|
import { PersonalizedVariant, TestVariant, EnrichmentData, Context, Quirks, ScoreVector } from '@uniformdev/context';
|
4
4
|
|
5
5
|
type PersonalizedVariationComponentProps = PersonalizedVariant & {
|
@@ -8,7 +8,7 @@ type PersonalizedVariationComponentProps = PersonalizedVariant & {
|
|
8
8
|
personalizationOccurred: boolean;
|
9
9
|
};
|
10
10
|
};
|
11
|
-
type PersonalizedVariationComponent = (variation: PersonalizedVariationComponentProps) =>
|
11
|
+
type PersonalizedVariationComponent = (variation: PersonalizedVariationComponentProps) => Component<any>;
|
12
12
|
type PersonalizeComponentProps = {
|
13
13
|
/**
|
14
14
|
* Name of the personalized placement. Should be unique to this placement location and set of variants.
|
@@ -22,7 +22,7 @@ type PersonalizeComponentProps = {
|
|
22
22
|
/** The number of variations to select. Use for personalized lists where the `count` most relevant should be shown. */
|
23
23
|
count?: number;
|
24
24
|
};
|
25
|
-
declare const Personalize:
|
25
|
+
declare const Personalize: vue.DefineComponent<vue.ExtractPropTypes<{
|
26
26
|
name: {
|
27
27
|
type: PropType<PersonalizeComponentProps["name"]>;
|
28
28
|
required: true;
|
@@ -39,9 +39,9 @@ declare const Personalize: vue_demi.DefineComponent<{
|
|
39
39
|
type: PropType<PersonalizeComponentProps["count"]>;
|
40
40
|
default: number;
|
41
41
|
};
|
42
|
-
}
|
42
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
43
43
|
[key: string]: any;
|
44
|
-
}>,
|
44
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
45
45
|
name: {
|
46
46
|
type: PropType<PersonalizeComponentProps["name"]>;
|
47
47
|
required: true;
|
@@ -58,11 +58,11 @@ declare const Personalize: vue_demi.DefineComponent<{
|
|
58
58
|
type: PropType<PersonalizeComponentProps["count"]>;
|
59
59
|
default: number;
|
60
60
|
};
|
61
|
-
}
|
61
|
+
}>> & Readonly<{}>, {
|
62
62
|
count: number | undefined;
|
63
|
-
}, {}>;
|
63
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
64
64
|
|
65
|
-
declare const PersonalizeStandard:
|
65
|
+
declare const PersonalizeStandard: vue.DefineComponent<vue.ExtractPropTypes<{
|
66
66
|
name: {
|
67
67
|
type: PropType<PersonalizeComponentProps["name"]>;
|
68
68
|
required: true;
|
@@ -79,11 +79,11 @@ declare const PersonalizeStandard: vue_demi.DefineComponent<{
|
|
79
79
|
type: PropType<PersonalizeComponentProps["count"]>;
|
80
80
|
default: number;
|
81
81
|
};
|
82
|
-
}
|
82
|
+
}>, () => (vue.VNode<vue.RendererNode, vue.RendererElement, {
|
83
83
|
[key: string]: any;
|
84
|
-
}> |
|
84
|
+
}> | vue.VNode<vue.RendererNode, vue.RendererElement, {
|
85
85
|
[key: string]: any;
|
86
|
-
}>[][])[],
|
86
|
+
}>[][])[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
87
87
|
name: {
|
88
88
|
type: PropType<PersonalizeComponentProps["name"]>;
|
89
89
|
required: true;
|
@@ -100,9 +100,9 @@ declare const PersonalizeStandard: vue_demi.DefineComponent<{
|
|
100
100
|
type: PropType<PersonalizeComponentProps["count"]>;
|
101
101
|
default: number;
|
102
102
|
};
|
103
|
-
}
|
103
|
+
}>> & Readonly<{}>, {
|
104
104
|
count: number | undefined;
|
105
|
-
}, {}>;
|
105
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
106
106
|
|
107
107
|
interface TestComponentProps {
|
108
108
|
/** Name of the test that is running. */
|
@@ -110,9 +110,9 @@ interface TestComponentProps {
|
|
110
110
|
/** Variation list that this test will selected from. */
|
111
111
|
variations: TestVariant[];
|
112
112
|
/** A Vue component to use to render the test variant. */
|
113
|
-
component:
|
113
|
+
component: Component<TestVariant>;
|
114
114
|
}
|
115
|
-
declare const Test:
|
115
|
+
declare const Test: vue.DefineComponent<vue.ExtractPropTypes<{
|
116
116
|
name: {
|
117
117
|
type: PropType<TestComponentProps["name"]>;
|
118
118
|
required: true;
|
@@ -125,9 +125,9 @@ declare const Test: vue_demi.DefineComponent<{
|
|
125
125
|
type: PropType<TestComponentProps["component"]>;
|
126
126
|
required: true;
|
127
127
|
};
|
128
|
-
}
|
128
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
129
129
|
[key: string]: any;
|
130
|
-
}>,
|
130
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
131
131
|
name: {
|
132
132
|
type: PropType<TestComponentProps["name"]>;
|
133
133
|
required: true;
|
@@ -140,7 +140,7 @@ declare const Test: vue_demi.DefineComponent<{
|
|
140
140
|
type: PropType<TestComponentProps["component"]>;
|
141
141
|
required: true;
|
142
142
|
};
|
143
|
-
}
|
143
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
144
144
|
|
145
145
|
interface TrackProps extends HTMLAttributes {
|
146
146
|
/** Behavior that will be pushed when tracking occurs. */
|
@@ -174,7 +174,7 @@ interface TrackProps extends HTMLAttributes {
|
|
174
174
|
* in DOM changes when personalization is added. If that's undesirable use TrackSlot instead which tracks
|
175
175
|
* only on page load, but does not render a wrapping tag.
|
176
176
|
*/
|
177
|
-
declare const Track:
|
177
|
+
declare const Track: vue.DefineComponent<vue.ExtractPropTypes<{
|
178
178
|
behavior: {
|
179
179
|
type: PropType<TrackProps["behavior"]>;
|
180
180
|
};
|
@@ -190,9 +190,9 @@ declare const Track: vue_demi.DefineComponent<{
|
|
190
190
|
type: PropType<TrackProps["threshold"]>;
|
191
191
|
default: number;
|
192
192
|
};
|
193
|
-
}
|
193
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
194
194
|
[key: string]: any;
|
195
|
-
}>,
|
195
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
196
196
|
behavior: {
|
197
197
|
type: PropType<TrackProps["behavior"]>;
|
198
198
|
};
|
@@ -208,11 +208,11 @@ declare const Track: vue_demi.DefineComponent<{
|
|
208
208
|
type: PropType<TrackProps["threshold"]>;
|
209
209
|
default: number;
|
210
210
|
};
|
211
|
-
}
|
211
|
+
}>> & Readonly<{}>, {
|
212
212
|
tagName: string | undefined;
|
213
213
|
disableVisibilityTrigger: boolean | undefined;
|
214
214
|
threshold: number | number[] | undefined;
|
215
|
-
}, {}>;
|
215
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
216
216
|
|
217
217
|
type TrackFragmentProps = {
|
218
218
|
behavior: EnrichmentData | EnrichmentData[] | undefined;
|
@@ -223,17 +223,17 @@ type TrackFragmentProps = {
|
|
223
223
|
* NOTE: if you wish to track on the visitor seeing the content in the browser viewport instead,
|
224
224
|
* use Track instead of TrackFragment.
|
225
225
|
*/
|
226
|
-
declare const TrackSlot:
|
226
|
+
declare const TrackSlot: vue.DefineComponent<vue.ExtractPropTypes<{
|
227
227
|
behavior: {
|
228
228
|
type: PropType<TrackFragmentProps["behavior"]>;
|
229
229
|
};
|
230
|
-
}
|
230
|
+
}>, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
231
231
|
[key: string]: any;
|
232
|
-
}>,
|
232
|
+
}>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
233
233
|
behavior: {
|
234
234
|
type: PropType<TrackFragmentProps["behavior"]>;
|
235
235
|
};
|
236
|
-
}
|
236
|
+
}>> & Readonly<{}>, {}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
237
237
|
|
238
238
|
type VariantOutputType = 'edge' | 'standard';
|
239
239
|
type UniformContextProps = {
|
@@ -261,7 +261,7 @@ declare function onRouteChange(context: Context): void;
|
|
261
261
|
declare const useUniformContext: () => UniformContextProps;
|
262
262
|
declare function isUsingUniformContext(): boolean;
|
263
263
|
|
264
|
-
declare const UniformContextProvider:
|
264
|
+
declare const UniformContextProvider: vue.DefineComponent<vue.ExtractPropTypes<{
|
265
265
|
context: {
|
266
266
|
type: PropType<UniformContextProps["context"]>;
|
267
267
|
required: true;
|
@@ -274,11 +274,11 @@ declare const UniformContextProvider: vue_demi.DefineComponent<{
|
|
274
274
|
type: PropType<UniformContextProps["trackRouteOnRender"]>;
|
275
275
|
default: boolean;
|
276
276
|
};
|
277
|
-
}
|
277
|
+
}>, () => (vue.VNode<vue.RendererNode, vue.RendererElement, {
|
278
278
|
[key: string]: any;
|
279
|
-
}> | (() =>
|
279
|
+
}> | (() => vue.VNode<vue.RendererNode, vue.RendererElement, {
|
280
280
|
[key: string]: any;
|
281
|
-
}>))[],
|
281
|
+
}>))[], {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{
|
282
282
|
context: {
|
283
283
|
type: PropType<UniformContextProps["context"]>;
|
284
284
|
required: true;
|
@@ -291,10 +291,10 @@ declare const UniformContextProvider: vue_demi.DefineComponent<{
|
|
291
291
|
type: PropType<UniformContextProps["trackRouteOnRender"]>;
|
292
292
|
default: boolean;
|
293
293
|
};
|
294
|
-
}
|
294
|
+
}>> & Readonly<{}>, {
|
295
295
|
outputType: VariantOutputType | undefined;
|
296
296
|
trackRouteOnRender: boolean | undefined;
|
297
|
-
}, {}>;
|
297
|
+
}, {}, {}, {}, string, vue.ComponentProvideOptions, true, {}, any>;
|
298
298
|
|
299
299
|
declare const provideIsPersonalized: (isPersonalized?: boolean) => void;
|
300
300
|
declare const useIsPersonalized: () => boolean | undefined;
|
@@ -303,12 +303,12 @@ declare const useIsPersonalized: () => boolean | undefined;
|
|
303
303
|
* Provides reactive access to the Uniform Context's current visitor quirks values
|
304
304
|
* This can be used when you want to read current quirk values directly.
|
305
305
|
*/
|
306
|
-
declare const useQuirks: () =>
|
306
|
+
declare const useQuirks: () => vue.Ref<Quirks, Quirks>;
|
307
307
|
|
308
308
|
/**
|
309
309
|
* Provides reactive access to the Uniform Context's current visitor scores values.
|
310
310
|
* This can be used when you want to read current score values directly.
|
311
311
|
*/
|
312
|
-
declare const useScores: () =>
|
312
|
+
declare const useScores: () => vue.Ref<ScoreVector, ScoreVector>;
|
313
313
|
|
314
314
|
export { Personalize, type PersonalizeComponentProps, PersonalizeStandard as PersonalizeEdge, type PersonalizedVariationComponent, type PersonalizedVariationComponentProps, Test, type TestComponentProps, Track, TrackSlot, type UniformContextProps, UniformContextProvider, type VariantOutputType, isUsingUniformContext, onRouteChange, provideIsPersonalized, provideUniformContext, uniformContextInjectionKey, useIsPersonalized, useQuirks, useScores, useUniformContext };
|
package/dist/index.esm.js
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
// src/components/personalize/Personalize.ts
|
2
|
-
import { defineComponent as defineComponent4, h as h4 } from "vue
|
2
|
+
import { defineComponent as defineComponent4, h as h4 } from "vue";
|
3
3
|
|
4
4
|
// src/providers/useUniformContext.ts
|
5
5
|
import { parse as parseCookie } from "cookie-es";
|
6
|
-
import { getCurrentInstance, inject, provide } from "vue
|
6
|
+
import { getCurrentInstance, inject, provide } from "vue";
|
7
7
|
|
8
8
|
// src/utils/constants.ts
|
9
9
|
var isServer = typeof window === "undefined";
|
@@ -57,7 +57,7 @@ function isUsingUniformContext() {
|
|
57
57
|
|
58
58
|
// src/components/personalize/PersonalizeEdge.ts
|
59
59
|
import { EdgeNodeTagName, ScriptType } from "@uniformdev/context";
|
60
|
-
import { defineComponent, h } from "vue
|
60
|
+
import { defineComponent, h } from "vue";
|
61
61
|
var PersonalizeStandard = defineComponent({
|
62
62
|
name: "PersonalizeStandard",
|
63
63
|
inheritAttrs: false,
|
@@ -111,11 +111,11 @@ var PersonalizeStandard = defineComponent({
|
|
111
111
|
var PersonalizeEdge_default = PersonalizeStandard;
|
112
112
|
|
113
113
|
// src/components/personalize/PersonalizeStandard.ts
|
114
|
-
import { defineComponent as defineComponent3, h as h3, ref as ref2, toRaw, watch } from "vue
|
114
|
+
import { defineComponent as defineComponent3, h as h3, ref as ref2, toRaw, watch } from "vue";
|
115
115
|
|
116
116
|
// src/providers/useScores.ts
|
117
117
|
import { dequal } from "dequal/lite";
|
118
|
-
import { ref, watchEffect } from "vue
|
118
|
+
import { ref, watchEffect } from "vue";
|
119
119
|
var useScores = () => {
|
120
120
|
const { context } = useUniformContext();
|
121
121
|
const scores = ref(context.scores);
|
@@ -134,10 +134,10 @@ var useScores = () => {
|
|
134
134
|
};
|
135
135
|
|
136
136
|
// src/components/personalize/PersonalizeProvider.ts
|
137
|
-
import { defineComponent as defineComponent2, h as h2 } from "vue
|
137
|
+
import { defineComponent as defineComponent2, h as h2 } from "vue";
|
138
138
|
|
139
139
|
// src/providers/useIsPersonalized.ts
|
140
|
-
import { inject as inject2, provide as provide2 } from "vue
|
140
|
+
import { inject as inject2, provide as provide2 } from "vue";
|
141
141
|
var isPersonalizedSymbol = Symbol("uniformIsPersonalized");
|
142
142
|
var provideIsPersonalized = (isPersonalized) => {
|
143
143
|
provide2(isPersonalizedSymbol, isPersonalized);
|
@@ -251,11 +251,11 @@ var Personalize = defineComponent4({
|
|
251
251
|
var Personalize_default = Personalize;
|
252
252
|
|
253
253
|
// src/components/Test/Test.ts
|
254
|
-
import { defineComponent as defineComponent7, h as h7 } from "vue
|
254
|
+
import { defineComponent as defineComponent7, h as h7 } from "vue";
|
255
255
|
|
256
256
|
// src/components/Test/TestEdge.ts
|
257
257
|
import { EdgeNodeTagName as EdgeNodeTagName2, ScriptType as ScriptType2 } from "@uniformdev/context";
|
258
|
-
import { defineComponent as defineComponent5, h as h5 } from "vue
|
258
|
+
import { defineComponent as defineComponent5, h as h5 } from "vue";
|
259
259
|
var TestEdge = defineComponent5({
|
260
260
|
name: "TestEdge",
|
261
261
|
inheritAttrs: false,
|
@@ -300,7 +300,7 @@ var TestEdge = defineComponent5({
|
|
300
300
|
var TestEdge_default = TestEdge;
|
301
301
|
|
302
302
|
// src/components/Test/TestStandard.ts
|
303
|
-
import { defineComponent as defineComponent6, h as h6, toRaw as toRaw2 } from "vue
|
303
|
+
import { defineComponent as defineComponent6, h as h6, toRaw as toRaw2 } from "vue";
|
304
304
|
var TestStandard = defineComponent6({
|
305
305
|
name: "TestStandard",
|
306
306
|
inheritAttrs: false,
|
@@ -358,7 +358,7 @@ var Test = defineComponent7({
|
|
358
358
|
var Test_default = Test;
|
359
359
|
|
360
360
|
// src/components/track/Track.ts
|
361
|
-
import { defineComponent as defineComponent8, h as h8, ref as ref3, toRaw as toRaw3, watchEffect as watchEffect2 } from "vue
|
361
|
+
import { defineComponent as defineComponent8, h as h8, ref as ref3, toRaw as toRaw3, watchEffect as watchEffect2 } from "vue";
|
362
362
|
var Track = defineComponent8({
|
363
363
|
name: "Track",
|
364
364
|
inheritAttrs: false,
|
@@ -444,7 +444,7 @@ var Track = defineComponent8({
|
|
444
444
|
var Track_default = Track;
|
445
445
|
|
446
446
|
// src/components/track/TrackSlot.ts
|
447
|
-
import { defineComponent as defineComponent9, h as h9, ref as ref4, toRaw as toRaw4, watchEffect as watchEffect3 } from "vue
|
447
|
+
import { defineComponent as defineComponent9, h as h9, ref as ref4, toRaw as toRaw4, watchEffect as watchEffect3 } from "vue";
|
448
448
|
var TrackSlot = defineComponent9({
|
449
449
|
name: "TrackSlot",
|
450
450
|
inheritAttrs: false,
|
@@ -489,7 +489,7 @@ var TrackSlot_default = TrackSlot;
|
|
489
489
|
|
490
490
|
// src/components/UniformContextProvider.ts
|
491
491
|
import { SERVER_STATE_ID } from "@uniformdev/context";
|
492
|
-
import { defineComponent as defineComponent10, h as h10 } from "vue
|
492
|
+
import { defineComponent as defineComponent10, h as h10 } from "vue";
|
493
493
|
var UniformContextProvider = defineComponent10({
|
494
494
|
name: "UniformContextProvider",
|
495
495
|
inheritAttrs: false,
|
@@ -519,7 +519,7 @@ function TransferState(context) {
|
|
519
519
|
}
|
520
520
|
|
521
521
|
// src/providers/useQuirks.ts
|
522
|
-
import { ref as ref5, watch as watch2 } from "vue
|
522
|
+
import { ref as ref5, watch as watch2 } from "vue";
|
523
523
|
var useQuirks = () => {
|
524
524
|
const { context } = useUniformContext();
|
525
525
|
const quirks = ref5(context.quirks);
|
package/dist/index.js
CHANGED
@@ -39,11 +39,11 @@ __export(src_exports, {
|
|
39
39
|
module.exports = __toCommonJS(src_exports);
|
40
40
|
|
41
41
|
// src/components/personalize/Personalize.ts
|
42
|
-
var
|
42
|
+
var import_vue7 = require("vue");
|
43
43
|
|
44
44
|
// src/providers/useUniformContext.ts
|
45
45
|
var import_cookie_es = require("cookie-es");
|
46
|
-
var
|
46
|
+
var import_vue = require("vue");
|
47
47
|
|
48
48
|
// src/utils/constants.ts
|
49
49
|
var isServer = typeof window === "undefined";
|
@@ -63,7 +63,7 @@ var provideUniformContext = ({
|
|
63
63
|
if (vueAppInstance) {
|
64
64
|
vueAppInstance.provide(uniformContextInjectionKey, payload);
|
65
65
|
} else {
|
66
|
-
(0,
|
66
|
+
(0, import_vue.provide)(uniformContextInjectionKey, payload);
|
67
67
|
}
|
68
68
|
if (trackRouteOnRender) {
|
69
69
|
onRouteChange(context);
|
@@ -79,7 +79,7 @@ function onRouteChange(context) {
|
|
79
79
|
});
|
80
80
|
}
|
81
81
|
var useUniformContext = () => {
|
82
|
-
const contextData = (0,
|
82
|
+
const contextData = (0, import_vue.inject)(uniformContextInjectionKey);
|
83
83
|
if (!contextData) {
|
84
84
|
throw Error(
|
85
85
|
`Could not inject Uniform's Context, make sure you're using <UniformContextProvider /> or the Uniform Nuxt module with a valid manifest.`
|
@@ -90,15 +90,15 @@ var useUniformContext = () => {
|
|
90
90
|
function isUsingUniformContext() {
|
91
91
|
var _a;
|
92
92
|
const isUniformContextProvided = Boolean(
|
93
|
-
(_a = (0,
|
93
|
+
(_a = (0, import_vue.getCurrentInstance)()) == null ? void 0 : _a.appContext.provides[uniformContextInjectionKey]
|
94
94
|
);
|
95
95
|
return isUniformContextProvided;
|
96
96
|
}
|
97
97
|
|
98
98
|
// src/components/personalize/PersonalizeEdge.ts
|
99
99
|
var import_context = require("@uniformdev/context");
|
100
|
-
var
|
101
|
-
var PersonalizeStandard = (0,
|
100
|
+
var import_vue2 = require("vue");
|
101
|
+
var PersonalizeStandard = (0, import_vue2.defineComponent)({
|
102
102
|
name: "PersonalizeStandard",
|
103
103
|
inheritAttrs: false,
|
104
104
|
props: {
|
@@ -126,40 +126,40 @@ var PersonalizeStandard = (0, import_vue_demi2.defineComponent)({
|
|
126
126
|
count: (_a = props.count) != null ? _a : 1
|
127
127
|
};
|
128
128
|
return () => [
|
129
|
-
(0,
|
129
|
+
(0, import_vue2.h)(import_context.EdgeNodeTagName, { "data-type": import_context.ScriptType.ListStart, innerHTML: JSON.stringify(options) }),
|
130
130
|
props.variations.map((variant) => {
|
131
131
|
return [
|
132
|
-
(0,
|
132
|
+
(0, import_vue2.h)(import_context.EdgeNodeTagName, {
|
133
133
|
"data-type": import_context.ScriptType.ListItemSettings,
|
134
134
|
innerHTML: JSON.stringify({ id: variant.id, pz: variant.pz || null }),
|
135
135
|
key: `LIS-${variant.id}`
|
136
136
|
}),
|
137
|
-
(0,
|
137
|
+
(0, import_vue2.h)(
|
138
138
|
import_context.EdgeNodeTagName,
|
139
139
|
{ "data-type": import_context.ScriptType.ListItem, key: `LI-${variant.id}` },
|
140
|
-
(0,
|
140
|
+
(0, import_vue2.h)(props.component, {
|
141
141
|
personalizationResult: { variation: variant, personalizationOccurred: false },
|
142
142
|
...variant
|
143
143
|
})
|
144
144
|
)
|
145
145
|
];
|
146
146
|
}),
|
147
|
-
(0,
|
147
|
+
(0, import_vue2.h)(import_context.EdgeNodeTagName, { "data-type": import_context.ScriptType.ListEnd })
|
148
148
|
];
|
149
149
|
}
|
150
150
|
});
|
151
151
|
var PersonalizeEdge_default = PersonalizeStandard;
|
152
152
|
|
153
153
|
// src/components/personalize/PersonalizeStandard.ts
|
154
|
-
var
|
154
|
+
var import_vue6 = require("vue");
|
155
155
|
|
156
156
|
// src/providers/useScores.ts
|
157
157
|
var import_lite = require("dequal/lite");
|
158
|
-
var
|
158
|
+
var import_vue3 = require("vue");
|
159
159
|
var useScores = () => {
|
160
160
|
const { context } = useUniformContext();
|
161
|
-
const scores = (0,
|
162
|
-
(0,
|
161
|
+
const scores = (0, import_vue3.ref)(context.scores);
|
162
|
+
(0, import_vue3.watchEffect)(() => {
|
163
163
|
const scoringChangeListener = (updatedScores) => scores.value = updatedScores;
|
164
164
|
const currentScores = context.scores;
|
165
165
|
if (!(0, import_lite.dequal)(scores.value, currentScores)) {
|
@@ -174,20 +174,20 @@ var useScores = () => {
|
|
174
174
|
};
|
175
175
|
|
176
176
|
// src/components/personalize/PersonalizeProvider.ts
|
177
|
-
var
|
177
|
+
var import_vue5 = require("vue");
|
178
178
|
|
179
179
|
// src/providers/useIsPersonalized.ts
|
180
|
-
var
|
180
|
+
var import_vue4 = require("vue");
|
181
181
|
var isPersonalizedSymbol = Symbol("uniformIsPersonalized");
|
182
182
|
var provideIsPersonalized = (isPersonalized) => {
|
183
|
-
(0,
|
183
|
+
(0, import_vue4.provide)(isPersonalizedSymbol, isPersonalized);
|
184
184
|
};
|
185
185
|
var useIsPersonalized = () => {
|
186
|
-
return (0,
|
186
|
+
return (0, import_vue4.inject)(isPersonalizedSymbol, false);
|
187
187
|
};
|
188
188
|
|
189
189
|
// src/components/personalize/PersonalizeProvider.ts
|
190
|
-
var PersonalizeProvider = (0,
|
190
|
+
var PersonalizeProvider = (0, import_vue5.defineComponent)({
|
191
191
|
name: "PersonalizeProvider",
|
192
192
|
inheritAttrs: false,
|
193
193
|
props: {
|
@@ -195,7 +195,7 @@ var PersonalizeProvider = (0, import_vue_demi5.defineComponent)({
|
|
195
195
|
},
|
196
196
|
setup(props, context) {
|
197
197
|
provideIsPersonalized(props.personalized);
|
198
|
-
return () => (0,
|
198
|
+
return () => (0, import_vue5.h)(context.slots.default, {
|
199
199
|
...props
|
200
200
|
});
|
201
201
|
}
|
@@ -203,7 +203,7 @@ var PersonalizeProvider = (0, import_vue_demi5.defineComponent)({
|
|
203
203
|
var PersonalizeProvider_default = PersonalizeProvider;
|
204
204
|
|
205
205
|
// src/components/personalize/PersonalizeStandard.ts
|
206
|
-
var PersonalizeStandard2 = (0,
|
206
|
+
var PersonalizeStandard2 = (0, import_vue6.defineComponent)({
|
207
207
|
name: "PersonalizeStandard",
|
208
208
|
inheritAttrs: false,
|
209
209
|
props: {
|
@@ -230,23 +230,23 @@ var PersonalizeStandard2 = (0, import_vue_demi6.defineComponent)({
|
|
230
230
|
const personalize = () => {
|
231
231
|
var _a;
|
232
232
|
return uniformContext.personalize({
|
233
|
-
name: (0,
|
234
|
-
variations: (0,
|
235
|
-
take: (_a = (0,
|
233
|
+
name: (0, import_vue6.toRaw)(props.name),
|
234
|
+
variations: (0, import_vue6.toRaw)(props.variations),
|
235
|
+
take: (_a = (0, import_vue6.toRaw)(props.count)) != null ? _a : 1
|
236
236
|
});
|
237
237
|
};
|
238
|
-
const personalizedResult = (0,
|
239
|
-
(0,
|
238
|
+
const personalizedResult = (0, import_vue6.ref)(personalize());
|
239
|
+
(0, import_vue6.watch)([scores, () => props.name, () => props.variations, () => props.count], () => {
|
240
240
|
personalizedResult.value = personalize();
|
241
241
|
});
|
242
|
-
return () => (0,
|
242
|
+
return () => (0, import_vue6.h)(
|
243
243
|
PersonalizeProvider_default,
|
244
244
|
{ personalized: true },
|
245
245
|
() => {
|
246
246
|
var _a;
|
247
247
|
return (_a = personalizedResult.value) == null ? void 0 : _a.variations.map((variation) => {
|
248
248
|
var _a2;
|
249
|
-
return (0,
|
249
|
+
return (0, import_vue6.h)(props.component, {
|
250
250
|
key: variation.id,
|
251
251
|
personalizationResult: {
|
252
252
|
variation,
|
@@ -262,7 +262,7 @@ var PersonalizeStandard2 = (0, import_vue_demi6.defineComponent)({
|
|
262
262
|
var PersonalizeStandard_default = PersonalizeStandard2;
|
263
263
|
|
264
264
|
// src/components/personalize/Personalize.ts
|
265
|
-
var Personalize = (0,
|
265
|
+
var Personalize = (0, import_vue7.defineComponent)({
|
266
266
|
name: "Personalize",
|
267
267
|
inheritAttrs: false,
|
268
268
|
props: {
|
@@ -285,18 +285,18 @@ var Personalize = (0, import_vue_demi7.defineComponent)({
|
|
285
285
|
},
|
286
286
|
setup(props) {
|
287
287
|
const { outputType } = useUniformContext();
|
288
|
-
return () => (0,
|
288
|
+
return () => (0, import_vue7.h)(!isServer || outputType === "standard" ? PersonalizeStandard_default : PersonalizeEdge_default, { ...props });
|
289
289
|
}
|
290
290
|
});
|
291
291
|
var Personalize_default = Personalize;
|
292
292
|
|
293
293
|
// src/components/Test/Test.ts
|
294
|
-
var
|
294
|
+
var import_vue10 = require("vue");
|
295
295
|
|
296
296
|
// src/components/Test/TestEdge.ts
|
297
297
|
var import_context2 = require("@uniformdev/context");
|
298
|
-
var
|
299
|
-
var TestEdge = (0,
|
298
|
+
var import_vue8 = require("vue");
|
299
|
+
var TestEdge = (0, import_vue8.defineComponent)({
|
300
300
|
name: "TestEdge",
|
301
301
|
inheritAttrs: false,
|
302
302
|
props: {
|
@@ -318,30 +318,30 @@ var TestEdge = (0, import_vue_demi8.defineComponent)({
|
|
318
318
|
name: props.name
|
319
319
|
};
|
320
320
|
return () => [
|
321
|
-
(0,
|
321
|
+
(0, import_vue8.h)(import_context2.EdgeNodeTagName, { "data-type": import_context2.ScriptType.TestStart, innerHTML: JSON.stringify(options) }),
|
322
322
|
props.variations.map((variation) => {
|
323
323
|
return [
|
324
|
-
(0,
|
324
|
+
(0, import_vue8.h)(import_context2.EdgeNodeTagName, {
|
325
325
|
"data-type": import_context2.ScriptType.ListItemSettings,
|
326
326
|
key: `LIS-${variation.id}`,
|
327
327
|
innerHTML: JSON.stringify({ id: variation.id })
|
328
328
|
}),
|
329
|
-
(0,
|
329
|
+
(0, import_vue8.h)(
|
330
330
|
import_context2.EdgeNodeTagName,
|
331
331
|
{ "data-type": import_context2.ScriptType.ListItem, key: `LI-${variation.id}` },
|
332
|
-
(0,
|
332
|
+
(0, import_vue8.h)(props.component, { ...variation })
|
333
333
|
)
|
334
334
|
];
|
335
335
|
}),
|
336
|
-
(0,
|
336
|
+
(0, import_vue8.h)(import_context2.EdgeNodeTagName, { "data-type": import_context2.ScriptType.TestEnd })
|
337
337
|
];
|
338
338
|
}
|
339
339
|
});
|
340
340
|
var TestEdge_default = TestEdge;
|
341
341
|
|
342
342
|
// src/components/Test/TestStandard.ts
|
343
|
-
var
|
344
|
-
var TestStandard = (0,
|
343
|
+
var import_vue9 = require("vue");
|
344
|
+
var TestStandard = (0, import_vue9.defineComponent)({
|
345
345
|
name: "TestStandard",
|
346
346
|
inheritAttrs: false,
|
347
347
|
props: {
|
@@ -361,19 +361,19 @@ var TestStandard = (0, import_vue_demi9.defineComponent)({
|
|
361
361
|
setup(props) {
|
362
362
|
const { context: uniformContext } = useUniformContext();
|
363
363
|
const { result } = uniformContext.test({
|
364
|
-
name: (0,
|
365
|
-
variations: (0,
|
364
|
+
name: (0, import_vue9.toRaw)(props.name),
|
365
|
+
variations: (0, import_vue9.toRaw)(props.variations)
|
366
366
|
});
|
367
367
|
if (!result) {
|
368
368
|
return () => null;
|
369
369
|
}
|
370
|
-
return () => (0,
|
370
|
+
return () => (0, import_vue9.h)(props.component, { ...result });
|
371
371
|
}
|
372
372
|
});
|
373
373
|
var TestStandard_default = TestStandard;
|
374
374
|
|
375
375
|
// src/components/Test/Test.ts
|
376
|
-
var Test = (0,
|
376
|
+
var Test = (0, import_vue10.defineComponent)({
|
377
377
|
name: "Test",
|
378
378
|
inheritAttrs: false,
|
379
379
|
props: {
|
@@ -392,14 +392,14 @@ var Test = (0, import_vue_demi10.defineComponent)({
|
|
392
392
|
},
|
393
393
|
setup(props) {
|
394
394
|
const { outputType } = useUniformContext();
|
395
|
-
return () => !isServer || outputType === "standard" ? (0,
|
395
|
+
return () => !isServer || outputType === "standard" ? (0, import_vue10.h)(TestStandard_default, { ...props }) : (0, import_vue10.h)(TestEdge_default, { ...props });
|
396
396
|
}
|
397
397
|
});
|
398
398
|
var Test_default = Test;
|
399
399
|
|
400
400
|
// src/components/track/Track.ts
|
401
|
-
var
|
402
|
-
var Track = (0,
|
401
|
+
var import_vue11 = require("vue");
|
402
|
+
var Track = (0, import_vue11.defineComponent)({
|
403
403
|
name: "Track",
|
404
404
|
inheritAttrs: false,
|
405
405
|
props: {
|
@@ -423,18 +423,18 @@ var Track = (0, import_vue_demi11.defineComponent)({
|
|
423
423
|
const currentUrl = typeof document === "undefined" ? "__uniform_ssr_url" : document.location.href;
|
424
424
|
const { context: uniformContext } = useUniformContext();
|
425
425
|
const insidePersonalizeComponent = useIsPersonalized();
|
426
|
-
const lastUrl = (0,
|
427
|
-
const hasTracked = (0,
|
428
|
-
const wrapperEl = (0,
|
429
|
-
const disconnect = (0,
|
430
|
-
(0,
|
426
|
+
const lastUrl = (0, import_vue11.ref)("");
|
427
|
+
const hasTracked = (0, import_vue11.ref)(false);
|
428
|
+
const wrapperEl = (0, import_vue11.ref)();
|
429
|
+
const disconnect = (0, import_vue11.ref)();
|
430
|
+
(0, import_vue11.watchEffect)(() => {
|
431
431
|
const urlHasChanged = lastUrl.value !== currentUrl;
|
432
432
|
if (urlHasChanged) {
|
433
433
|
lastUrl.value = currentUrl;
|
434
434
|
hasTracked.value = false;
|
435
435
|
}
|
436
436
|
});
|
437
|
-
(0,
|
437
|
+
(0, import_vue11.watchEffect)(() => {
|
438
438
|
var _a;
|
439
439
|
const hasNoBehaviorValue = !props.behavior || Array.isArray(props.behavior) && !props.behavior.length;
|
440
440
|
const cannotTrack = insidePersonalizeComponent || hasNoBehaviorValue;
|
@@ -448,7 +448,7 @@ var Track = (0, import_vue_demi11.defineComponent)({
|
|
448
448
|
return;
|
449
449
|
}
|
450
450
|
uniformContext == null ? void 0 : uniformContext.update({
|
451
|
-
enrichments: (0,
|
451
|
+
enrichments: (0, import_vue11.toRaw)(enrichments)
|
452
452
|
});
|
453
453
|
hasTracked.value = false;
|
454
454
|
(_a2 = disconnect.value) == null ? void 0 : _a2.call(disconnect);
|
@@ -478,14 +478,14 @@ var Track = (0, import_vue_demi11.defineComponent)({
|
|
478
478
|
(_a2 = disconnect.value) == null ? void 0 : _a2.call(disconnect);
|
479
479
|
};
|
480
480
|
});
|
481
|
-
return () => (0,
|
481
|
+
return () => (0, import_vue11.h)(props.tagName, { ref: wrapperEl, ...context.attrs }, context.slots.default());
|
482
482
|
}
|
483
483
|
});
|
484
484
|
var Track_default = Track;
|
485
485
|
|
486
486
|
// src/components/track/TrackSlot.ts
|
487
|
-
var
|
488
|
-
var TrackSlot = (0,
|
487
|
+
var import_vue12 = require("vue");
|
488
|
+
var TrackSlot = (0, import_vue12.defineComponent)({
|
489
489
|
name: "TrackSlot",
|
490
490
|
inheritAttrs: false,
|
491
491
|
props: {
|
@@ -497,16 +497,16 @@ var TrackSlot = (0, import_vue_demi12.defineComponent)({
|
|
497
497
|
const currentUrl = typeof document === "undefined" ? "__uniform_ssr_url" : document.location.href;
|
498
498
|
const { context: uniformContext } = useUniformContext();
|
499
499
|
const insidePersonalizeComponent = useIsPersonalized();
|
500
|
-
const lastUrl = (0,
|
501
|
-
const hasTracked = (0,
|
502
|
-
(0,
|
500
|
+
const lastUrl = (0, import_vue12.ref)();
|
501
|
+
const hasTracked = (0, import_vue12.ref)(false);
|
502
|
+
(0, import_vue12.watchEffect)(() => {
|
503
503
|
const urlHasChanged = lastUrl.value !== currentUrl;
|
504
504
|
if (urlHasChanged) {
|
505
505
|
lastUrl.value = currentUrl;
|
506
506
|
hasTracked.value = false;
|
507
507
|
}
|
508
508
|
});
|
509
|
-
(0,
|
509
|
+
(0, import_vue12.watchEffect)(() => {
|
510
510
|
const hasNoBehaviorValue = !props.behavior || Array.isArray(props.behavior) && !props.behavior.length;
|
511
511
|
const cannotTrack = insidePersonalizeComponent || hasNoBehaviorValue;
|
512
512
|
if (cannotTrack) return;
|
@@ -516,21 +516,21 @@ var TrackSlot = (0, import_vue_demi12.defineComponent)({
|
|
516
516
|
}
|
517
517
|
const enrichments = Array.isArray(props.behavior) ? props.behavior : [props.behavior];
|
518
518
|
uniformContext == null ? void 0 : uniformContext.update({
|
519
|
-
enrichments: (0,
|
519
|
+
enrichments: (0, import_vue12.toRaw)(enrichments)
|
520
520
|
});
|
521
521
|
hasTracked.value = true;
|
522
522
|
};
|
523
523
|
pushBehaviorEnrichment();
|
524
524
|
});
|
525
|
-
return () => (0,
|
525
|
+
return () => (0, import_vue12.h)(context.slots.default, { ...context.attrs });
|
526
526
|
}
|
527
527
|
});
|
528
528
|
var TrackSlot_default = TrackSlot;
|
529
529
|
|
530
530
|
// src/components/UniformContextProvider.ts
|
531
531
|
var import_context3 = require("@uniformdev/context");
|
532
|
-
var
|
533
|
-
var UniformContextProvider = (0,
|
532
|
+
var import_vue13 = require("vue");
|
533
|
+
var UniformContextProvider = (0, import_vue13.defineComponent)({
|
534
534
|
name: "UniformContextProvider",
|
535
535
|
inheritAttrs: false,
|
536
536
|
props: {
|
@@ -549,24 +549,24 @@ var UniformContextProvider = (0, import_vue_demi13.defineComponent)({
|
|
549
549
|
},
|
550
550
|
setup(props, context) {
|
551
551
|
provideUniformContext(props);
|
552
|
-
return () => [(0,
|
552
|
+
return () => [(0, import_vue13.h)(context.slots.default), TransferState(props.context)];
|
553
553
|
}
|
554
554
|
});
|
555
555
|
var UniformContextProvider_default = UniformContextProvider;
|
556
556
|
function TransferState(context) {
|
557
557
|
const state = context.getServerToClientTransitionState();
|
558
|
-
return () => (0,
|
558
|
+
return () => (0, import_vue13.h)("script", { id: import_context3.SERVER_STATE_ID, type: "application/json", innerHTML: JSON.stringify(state) });
|
559
559
|
}
|
560
560
|
|
561
561
|
// src/providers/useQuirks.ts
|
562
|
-
var
|
562
|
+
var import_vue14 = require("vue");
|
563
563
|
var useQuirks = () => {
|
564
564
|
const { context } = useUniformContext();
|
565
|
-
const quirks = (0,
|
565
|
+
const quirks = (0, import_vue14.ref)(context.quirks);
|
566
566
|
const quirkChangeListener = (updateQuirks) => {
|
567
567
|
quirks.value = updateQuirks;
|
568
568
|
};
|
569
|
-
(0,
|
569
|
+
(0, import_vue14.watch)(context, () => {
|
570
570
|
context.events.on("quirksUpdated", quirkChangeListener);
|
571
571
|
return () => {
|
572
572
|
context.events.off("quirksUpdated", quirkChangeListener);
|
package/dist/index.mjs
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
// src/components/personalize/Personalize.ts
|
2
|
-
import { defineComponent as defineComponent4, h as h4 } from "vue
|
2
|
+
import { defineComponent as defineComponent4, h as h4 } from "vue";
|
3
3
|
|
4
4
|
// src/providers/useUniformContext.ts
|
5
5
|
import { parse as parseCookie } from "cookie-es";
|
6
|
-
import { getCurrentInstance, inject, provide } from "vue
|
6
|
+
import { getCurrentInstance, inject, provide } from "vue";
|
7
7
|
|
8
8
|
// src/utils/constants.ts
|
9
9
|
var isServer = typeof window === "undefined";
|
@@ -57,7 +57,7 @@ function isUsingUniformContext() {
|
|
57
57
|
|
58
58
|
// src/components/personalize/PersonalizeEdge.ts
|
59
59
|
import { EdgeNodeTagName, ScriptType } from "@uniformdev/context";
|
60
|
-
import { defineComponent, h } from "vue
|
60
|
+
import { defineComponent, h } from "vue";
|
61
61
|
var PersonalizeStandard = defineComponent({
|
62
62
|
name: "PersonalizeStandard",
|
63
63
|
inheritAttrs: false,
|
@@ -111,11 +111,11 @@ var PersonalizeStandard = defineComponent({
|
|
111
111
|
var PersonalizeEdge_default = PersonalizeStandard;
|
112
112
|
|
113
113
|
// src/components/personalize/PersonalizeStandard.ts
|
114
|
-
import { defineComponent as defineComponent3, h as h3, ref as ref2, toRaw, watch } from "vue
|
114
|
+
import { defineComponent as defineComponent3, h as h3, ref as ref2, toRaw, watch } from "vue";
|
115
115
|
|
116
116
|
// src/providers/useScores.ts
|
117
117
|
import { dequal } from "dequal/lite";
|
118
|
-
import { ref, watchEffect } from "vue
|
118
|
+
import { ref, watchEffect } from "vue";
|
119
119
|
var useScores = () => {
|
120
120
|
const { context } = useUniformContext();
|
121
121
|
const scores = ref(context.scores);
|
@@ -134,10 +134,10 @@ var useScores = () => {
|
|
134
134
|
};
|
135
135
|
|
136
136
|
// src/components/personalize/PersonalizeProvider.ts
|
137
|
-
import { defineComponent as defineComponent2, h as h2 } from "vue
|
137
|
+
import { defineComponent as defineComponent2, h as h2 } from "vue";
|
138
138
|
|
139
139
|
// src/providers/useIsPersonalized.ts
|
140
|
-
import { inject as inject2, provide as provide2 } from "vue
|
140
|
+
import { inject as inject2, provide as provide2 } from "vue";
|
141
141
|
var isPersonalizedSymbol = Symbol("uniformIsPersonalized");
|
142
142
|
var provideIsPersonalized = (isPersonalized) => {
|
143
143
|
provide2(isPersonalizedSymbol, isPersonalized);
|
@@ -251,11 +251,11 @@ var Personalize = defineComponent4({
|
|
251
251
|
var Personalize_default = Personalize;
|
252
252
|
|
253
253
|
// src/components/Test/Test.ts
|
254
|
-
import { defineComponent as defineComponent7, h as h7 } from "vue
|
254
|
+
import { defineComponent as defineComponent7, h as h7 } from "vue";
|
255
255
|
|
256
256
|
// src/components/Test/TestEdge.ts
|
257
257
|
import { EdgeNodeTagName as EdgeNodeTagName2, ScriptType as ScriptType2 } from "@uniformdev/context";
|
258
|
-
import { defineComponent as defineComponent5, h as h5 } from "vue
|
258
|
+
import { defineComponent as defineComponent5, h as h5 } from "vue";
|
259
259
|
var TestEdge = defineComponent5({
|
260
260
|
name: "TestEdge",
|
261
261
|
inheritAttrs: false,
|
@@ -300,7 +300,7 @@ var TestEdge = defineComponent5({
|
|
300
300
|
var TestEdge_default = TestEdge;
|
301
301
|
|
302
302
|
// src/components/Test/TestStandard.ts
|
303
|
-
import { defineComponent as defineComponent6, h as h6, toRaw as toRaw2 } from "vue
|
303
|
+
import { defineComponent as defineComponent6, h as h6, toRaw as toRaw2 } from "vue";
|
304
304
|
var TestStandard = defineComponent6({
|
305
305
|
name: "TestStandard",
|
306
306
|
inheritAttrs: false,
|
@@ -358,7 +358,7 @@ var Test = defineComponent7({
|
|
358
358
|
var Test_default = Test;
|
359
359
|
|
360
360
|
// src/components/track/Track.ts
|
361
|
-
import { defineComponent as defineComponent8, h as h8, ref as ref3, toRaw as toRaw3, watchEffect as watchEffect2 } from "vue
|
361
|
+
import { defineComponent as defineComponent8, h as h8, ref as ref3, toRaw as toRaw3, watchEffect as watchEffect2 } from "vue";
|
362
362
|
var Track = defineComponent8({
|
363
363
|
name: "Track",
|
364
364
|
inheritAttrs: false,
|
@@ -444,7 +444,7 @@ var Track = defineComponent8({
|
|
444
444
|
var Track_default = Track;
|
445
445
|
|
446
446
|
// src/components/track/TrackSlot.ts
|
447
|
-
import { defineComponent as defineComponent9, h as h9, ref as ref4, toRaw as toRaw4, watchEffect as watchEffect3 } from "vue
|
447
|
+
import { defineComponent as defineComponent9, h as h9, ref as ref4, toRaw as toRaw4, watchEffect as watchEffect3 } from "vue";
|
448
448
|
var TrackSlot = defineComponent9({
|
449
449
|
name: "TrackSlot",
|
450
450
|
inheritAttrs: false,
|
@@ -489,7 +489,7 @@ var TrackSlot_default = TrackSlot;
|
|
489
489
|
|
490
490
|
// src/components/UniformContextProvider.ts
|
491
491
|
import { SERVER_STATE_ID } from "@uniformdev/context";
|
492
|
-
import { defineComponent as defineComponent10, h as h10 } from "vue
|
492
|
+
import { defineComponent as defineComponent10, h as h10 } from "vue";
|
493
493
|
var UniformContextProvider = defineComponent10({
|
494
494
|
name: "UniformContextProvider",
|
495
495
|
inheritAttrs: false,
|
@@ -519,7 +519,7 @@ function TransferState(context) {
|
|
519
519
|
}
|
520
520
|
|
521
521
|
// src/providers/useQuirks.ts
|
522
|
-
import { ref as ref5, watch as watch2 } from "vue
|
522
|
+
import { ref as ref5, watch as watch2 } from "vue";
|
523
523
|
var useQuirks = () => {
|
524
524
|
const { context } = useUniformContext();
|
525
525
|
const quirks = ref5(context.quirks);
|
package/package.json
CHANGED
@@ -1,14 +1,21 @@
|
|
1
1
|
{
|
2
2
|
"name": "@uniformdev/context-vue",
|
3
|
-
"version": "19.
|
3
|
+
"version": "19.201.1",
|
4
4
|
"description": "Vue SDK for Uniform Context",
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
6
6
|
"main": "./dist/index.js",
|
7
7
|
"module": "./dist/index.esm.js",
|
8
8
|
"exports": {
|
9
9
|
".": {
|
10
|
-
"import":
|
11
|
-
|
10
|
+
"import": {
|
11
|
+
"types": "./dist/index.d.mts",
|
12
|
+
"node": "./dist/index.mjs",
|
13
|
+
"default": "./dist/index.esm.js"
|
14
|
+
},
|
15
|
+
"require": {
|
16
|
+
"types": "./dist/index.d.ts",
|
17
|
+
"default": "./dist/index.js"
|
18
|
+
}
|
12
19
|
}
|
13
20
|
},
|
14
21
|
"types": "./dist/index.d.ts",
|
@@ -23,27 +30,20 @@
|
|
23
30
|
"document": "api-extractor run --local"
|
24
31
|
},
|
25
32
|
"dependencies": {
|
26
|
-
"@uniformdev/context": "19.
|
33
|
+
"@uniformdev/context": "19.201.1",
|
27
34
|
"cookie-es": "^1.0.0",
|
28
35
|
"dequal": "^2.0.2",
|
29
|
-
"uuid": "9.0.1"
|
30
|
-
"vue-demi": "^0.14.0"
|
36
|
+
"uuid": "9.0.1"
|
31
37
|
},
|
32
38
|
"peerDependencies": {
|
33
|
-
"
|
34
|
-
"vue": "^2.0.0 || >=3.0.0"
|
35
|
-
},
|
36
|
-
"peerDependenciesMeta": {
|
37
|
-
"@vue/composition-api": {
|
38
|
-
"optional": true
|
39
|
-
}
|
39
|
+
"vue": ">=3.0.0"
|
40
40
|
},
|
41
41
|
"devDependencies": {
|
42
42
|
"@testing-library/vue": "7.0.0",
|
43
43
|
"@types/uuid": "9.0.4",
|
44
44
|
"@vue/server-test-utils": "1.3.0",
|
45
45
|
"@vue/test-utils": "2.4.6",
|
46
|
-
"vue": "3.
|
46
|
+
"vue": "3.5.12",
|
47
47
|
"vue-server-renderer": "2.7.15",
|
48
48
|
"vue-template-compiler": "2.7.15"
|
49
49
|
},
|
@@ -59,5 +59,5 @@
|
|
59
59
|
"publishConfig": {
|
60
60
|
"access": "public"
|
61
61
|
},
|
62
|
-
"gitHead": "
|
62
|
+
"gitHead": "2e20dee3fc5ce005f6d73eddf939cc89cbad83de"
|
63
63
|
}
|