@uniformdev/context-vue 19.35.2 → 19.35.3-alpha.82

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.
Files changed (2) hide show
  1. package/dist/index.d.mts +290 -0
  2. package/package.json +3 -3
@@ -0,0 +1,290 @@
1
+ import * as vue_demi from 'vue-demi';
2
+ import { ConcreteComponent, PropType, App } from 'vue-demi';
3
+ import { PersonalizedVariant, TestVariant, EnrichmentData, Context, Quirks, ScoreVector } from '@uniformdev/context';
4
+ import * as _uniformdev_context_dist_types_012db0cb from '@uniformdev/context/dist/types-012db0cb';
5
+
6
+ type PersonalizedVariationComponentProps = PersonalizedVariant & {
7
+ personalizationResult: {
8
+ variation: PersonalizedVariant;
9
+ personalizationOccurred: boolean;
10
+ };
11
+ };
12
+ type PersonalizedVariationComponent = (variation: PersonalizedVariationComponentProps) => ConcreteComponent<any>;
13
+ type PersonalizeComponentProps = {
14
+ /**
15
+ * Name of the personalized placement. Should be unique to this placement location and set of variants.
16
+ * This name is emitted to analytics after personalization executes.
17
+ */
18
+ name: string;
19
+ /** The possible variations of the content to render depending on personalization conditions */
20
+ variations: PersonalizedVariant[];
21
+ /** A Vue component to use to render a selected variant. */
22
+ component: PersonalizedVariationComponent;
23
+ /** The number of variations to select. Use for personalized lists where the `count` most relevant should be shown. */
24
+ count?: number;
25
+ };
26
+ declare const Personalize: vue_demi.DefineComponent<{
27
+ name: {
28
+ type: PropType<string>;
29
+ required: true;
30
+ };
31
+ variations: {
32
+ type: PropType<PersonalizedVariant[]>;
33
+ required: true;
34
+ };
35
+ component: {
36
+ type: PropType<PersonalizedVariationComponent>;
37
+ required: true;
38
+ };
39
+ count: {
40
+ type: PropType<number | undefined>;
41
+ default: number;
42
+ };
43
+ }, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
44
+ [key: string]: any;
45
+ }>, unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
46
+ name: {
47
+ type: PropType<string>;
48
+ required: true;
49
+ };
50
+ variations: {
51
+ type: PropType<PersonalizedVariant[]>;
52
+ required: true;
53
+ };
54
+ component: {
55
+ type: PropType<PersonalizedVariationComponent>;
56
+ required: true;
57
+ };
58
+ count: {
59
+ type: PropType<number | undefined>;
60
+ default: number;
61
+ };
62
+ }>>, {
63
+ count: number | undefined;
64
+ }>;
65
+
66
+ declare const PersonalizeStandard: vue_demi.DefineComponent<{
67
+ name: {
68
+ type: PropType<string>;
69
+ required: true;
70
+ };
71
+ variations: {
72
+ type: PropType<_uniformdev_context_dist_types_012db0cb.a4[]>;
73
+ required: true;
74
+ };
75
+ component: {
76
+ type: PropType<PersonalizedVariationComponent>;
77
+ required: true;
78
+ };
79
+ count: {
80
+ type: PropType<number | undefined>;
81
+ default: number;
82
+ };
83
+ }, () => (vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
84
+ [key: string]: any;
85
+ }> | vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
86
+ [key: string]: any;
87
+ }>[][])[], unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
88
+ name: {
89
+ type: PropType<string>;
90
+ required: true;
91
+ };
92
+ variations: {
93
+ type: PropType<_uniformdev_context_dist_types_012db0cb.a4[]>;
94
+ required: true;
95
+ };
96
+ component: {
97
+ type: PropType<PersonalizedVariationComponent>;
98
+ required: true;
99
+ };
100
+ count: {
101
+ type: PropType<number | undefined>;
102
+ default: number;
103
+ };
104
+ }>>, {
105
+ count: number | undefined;
106
+ }>;
107
+
108
+ interface TestComponentProps {
109
+ /** Name of the test that is running. */
110
+ name: string;
111
+ /** Variation list that this test will selected from. */
112
+ variations: TestVariant[];
113
+ /** A Vue component to use to render the test variant. */
114
+ component: ConcreteComponent<TestVariant>;
115
+ }
116
+ declare const Test: vue_demi.DefineComponent<{
117
+ name: {
118
+ type: PropType<string>;
119
+ required: true;
120
+ };
121
+ variations: {
122
+ type: PropType<TestVariant[]>;
123
+ required: true;
124
+ };
125
+ component: {
126
+ type: PropType<ConcreteComponent<TestVariant>>;
127
+ required: true;
128
+ };
129
+ }, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
130
+ [key: string]: any;
131
+ }>, unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
132
+ name: {
133
+ type: PropType<string>;
134
+ required: true;
135
+ };
136
+ variations: {
137
+ type: PropType<TestVariant[]>;
138
+ required: true;
139
+ };
140
+ component: {
141
+ type: PropType<ConcreteComponent<TestVariant>>;
142
+ required: true;
143
+ };
144
+ }>>, {}>;
145
+
146
+ /**
147
+ * Tracks visitor behavior by adding enrichment score when they view content wrapped in this component.
148
+ * When the Track component is sufficiently in the viewport, it will trigger the enrichment values specified
149
+ * in `behavior` to the current visitor. If the browser does not support IntersectionObserver, the behavior will
150
+ * be triggered immediately on page load instead.
151
+ *
152
+ * NOTE: this component necessarily renders a wrapping tag to attach the IntersectionObserver to; this can result
153
+ * in DOM changes when personalization is added. If that's undesirable use TrackSlot instead which tracks
154
+ * only on page load, but does not render a wrapping tag.
155
+ */
156
+ declare const Track: vue_demi.DefineComponent<{
157
+ behavior: {
158
+ type: PropType<EnrichmentData | EnrichmentData[] | undefined>;
159
+ };
160
+ tagName: {
161
+ type: PropType<string | undefined>;
162
+ default: string;
163
+ };
164
+ disableVisibilityTrigger: {
165
+ type: PropType<boolean | undefined>;
166
+ default: boolean;
167
+ };
168
+ threshold: {
169
+ type: PropType<number | number[] | undefined>;
170
+ default: number;
171
+ };
172
+ }, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
173
+ [key: string]: any;
174
+ }>, unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
175
+ behavior: {
176
+ type: PropType<EnrichmentData | EnrichmentData[] | undefined>;
177
+ };
178
+ tagName: {
179
+ type: PropType<string | undefined>;
180
+ default: string;
181
+ };
182
+ disableVisibilityTrigger: {
183
+ type: PropType<boolean | undefined>;
184
+ default: boolean;
185
+ };
186
+ threshold: {
187
+ type: PropType<number | number[] | undefined>;
188
+ default: number;
189
+ };
190
+ }>>, {
191
+ tagName: string | undefined;
192
+ disableVisibilityTrigger: boolean | undefined;
193
+ threshold: number | number[] | undefined;
194
+ }>;
195
+
196
+ /**
197
+ * Tracks visitor behavior by adding enrichment score when they are shown a route with this component on it.
198
+ *
199
+ * NOTE: if you wish to track on the visitor seeing the content in the browser viewport instead,
200
+ * use Track instead of TrackFragment.
201
+ */
202
+ declare const TrackSlot: vue_demi.DefineComponent<{
203
+ behavior: {
204
+ type: PropType<EnrichmentData | EnrichmentData[] | undefined>;
205
+ };
206
+ }, () => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
207
+ [key: string]: any;
208
+ }>, unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
209
+ behavior: {
210
+ type: PropType<EnrichmentData | EnrichmentData[] | undefined>;
211
+ };
212
+ }>>, {}>;
213
+
214
+ type VariantOutputType = 'edge' | 'standard';
215
+ type UniformContextProps = {
216
+ /** The configured Uniform Context instance to provide */
217
+ context: Context;
218
+ /** The output type to emit.
219
+ * - `standard` - Emits selected variants as HTML suitable for SSR or SSG
220
+ * - `edge` - Emits all variants suitable for Edge-side personalization selection
221
+ *
222
+ * @default standard
223
+ */
224
+ outputType?: VariantOutputType;
225
+ /**
226
+ * Whether to track a route change to the current URL when this component is rendered.
227
+ *
228
+ * @default true
229
+ */
230
+ trackRouteOnRender?: boolean;
231
+ };
232
+ declare const uniformContextInjectionKey = "uniformContextInjectionKey";
233
+ declare const provideUniformContext: ({ context, outputType, trackRouteOnRender, vueAppInstance, }: UniformContextProps & {
234
+ vueAppInstance?: App<Element> | undefined;
235
+ }) => void;
236
+ declare function onRouteChange(context: Context): void;
237
+ declare const useUniformContext: () => UniformContextProps;
238
+ declare function isUsingUniformContext(): boolean;
239
+
240
+ declare const UniformContextProvider: vue_demi.DefineComponent<{
241
+ context: {
242
+ type: PropType<Context>;
243
+ required: true;
244
+ };
245
+ outputType: {
246
+ type: PropType<VariantOutputType | undefined>;
247
+ default: string;
248
+ };
249
+ trackRouteOnRender: {
250
+ type: PropType<boolean | undefined>;
251
+ default: boolean;
252
+ };
253
+ }, () => (vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
254
+ [key: string]: any;
255
+ }> | (() => vue_demi.VNode<vue_demi.RendererNode, vue_demi.RendererElement, {
256
+ [key: string]: any;
257
+ }>))[], unknown, {}, {}, vue_demi.ComponentOptionsMixin, vue_demi.ComponentOptionsMixin, {}, string, vue_demi.VNodeProps & vue_demi.AllowedComponentProps & vue_demi.ComponentCustomProps, Readonly<vue_demi.ExtractPropTypes<{
258
+ context: {
259
+ type: PropType<Context>;
260
+ required: true;
261
+ };
262
+ outputType: {
263
+ type: PropType<VariantOutputType | undefined>;
264
+ default: string;
265
+ };
266
+ trackRouteOnRender: {
267
+ type: PropType<boolean | undefined>;
268
+ default: boolean;
269
+ };
270
+ }>>, {
271
+ outputType: VariantOutputType | undefined;
272
+ trackRouteOnRender: boolean | undefined;
273
+ }>;
274
+
275
+ declare const provideIsPersonalized: (isPersonalized?: boolean) => void;
276
+ declare const useIsPersonalized: () => boolean;
277
+
278
+ /**
279
+ * Provides reactive access to the Uniform Context's current visitor quirks values
280
+ * This can be used when you want to read current quirk values directly.
281
+ */
282
+ declare const useQuirks: () => vue_demi.Ref<Quirks>;
283
+
284
+ /**
285
+ * Provides reactive access to the Uniform Context's current visitor scores values.
286
+ * This can be used when you want to read current score values directly.
287
+ */
288
+ declare const useScores: () => vue_demi.Ref<ScoreVector>;
289
+
290
+ export { Personalize, PersonalizeComponentProps, PersonalizeStandard as PersonalizeEdge, PersonalizedVariationComponent, PersonalizedVariationComponentProps, Test, TestComponentProps, Track, TrackSlot, UniformContextProps, UniformContextProvider, VariantOutputType, isUsingUniformContext, onRouteChange, provideIsPersonalized, provideUniformContext, uniformContextInjectionKey, useIsPersonalized, useQuirks, useScores, useUniformContext };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context-vue",
3
- "version": "19.35.2",
3
+ "version": "19.35.3-alpha.82+4bc341093",
4
4
  "description": "Vue SDK for Uniform Context",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -23,7 +23,7 @@
23
23
  "document": "api-extractor run --local"
24
24
  },
25
25
  "dependencies": {
26
- "@uniformdev/context": "19.35.2",
26
+ "@uniformdev/context": "19.35.3-alpha.82+4bc341093",
27
27
  "cookie-es": "^1.0.0",
28
28
  "dequal": "^2.0.2",
29
29
  "uuid": "9.0.0",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "64d3270175087c87cfaa29a283aa4a7b0a98fd2c"
62
+ "gitHead": "4bc341093bc946900df2646fe53eca4bcddc693c"
63
63
  }