@uniformdev/context 20.37.1-alpha.1 → 20.37.1-alpha.15

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.
@@ -1,4 +1,4 @@
1
- import { aI as paths$7, $ as ManifestV2 } from '../types-CzIkFCDD.mjs';
1
+ import { aJ as paths$7, $ as ManifestV2 } from '../types-CKTfVAJs.mjs';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/api/api.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { aI as paths$7, $ as ManifestV2 } from '../types-CzIkFCDD.js';
1
+ import { aJ as paths$7, $ as ManifestV2 } from '../types-CKTfVAJs.js';
2
2
  import 'mitt';
3
3
 
4
4
  type LimitPolicy = <ReturnValue>(func: () => Promise<ReturnValue>) => Promise<ReturnValue>;
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-CzIkFCDD.mjs';
2
- export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, u as ContextEvents, v as ContextInstance, q as ContextOptions, aF as ContextState, aG as ContextStateUpdate, Z as CriteriaEvaluatorParameters, Y as CriteriaEvaluatorResult, au as DecayOptions, y as DevToolsActions, E as DevToolsDataEvent, z as DevToolsEvent, I as DevToolsForgetEvent, F as DevToolsHelloEvent, B as DevToolsLogEvent, H as DevToolsRawCommandsEvent, x as DevToolsState, w as DevToolsUiVersion, G as DevToolsUpdateEvent, ab as DimensionMatch, a4 as EnrichmentCategory, aA as EnrichmentData, aD as EventData, aH as GoalStateUpdate, az as Goals, X as GroupCriteriaEvaluator, an as IdentifyCommand, U as LogMessageGroup, R as LogMessageSingle, J as LogMessages, W as ManifestInstance, $ as ManifestV2, M as MessageCategory, N as MessageFunc, ai as ModifyScoreCommand, aj as ModifySessionScoreCommand, a5 as NumberMatch, s as PersonalizationEvent, r as PersonalizationEventVariantId, a0 as PersonalizationManifest, o as PersonalizationSelectionAlgorithm, p as PersonalizationSelectionAlgorithms, aB as PersonalizeControlVariant, aC as PersonalizeVariants, ac as QuirkMatch, as as SERVER_STATE_ID, ar as ServerToClientTransitionState, ak as SetConsentCommand, ao as SetControlGroupCommand, ah as SetGoalCommand, ap as SetPersonalizeVariantControlCommand, al as SetQuirkCommand, am as SetTestCommand, K as Severity, a1 as Signal, a3 as SignalCriteria, a2 as SignalCriteriaGroup, _ as SignalData, ag as StorageCommand, a6 as TestDefinition, t as TestEvent, a8 as TestOptions, af as TestResult, ae as TestVariant, ay as Tests, at as TransitionDataStoreEvents, aa as VariationMatchMetadata, ax as VisitorDataStore, aw as VisitorDataStoreEvents, av as VisitorDataStoreOptions, aq as areCommandsEqual, aE as emptyVisitorData, a9 as testVariations } from './types-CzIkFCDD.mjs';
1
+ import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-CKTfVAJs.mjs';
2
+ export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, aF as CompositionMetadata, u as ContextEvents, v as ContextInstance, q as ContextOptions, aG as ContextState, aH as ContextStateUpdate, Z as CriteriaEvaluatorParameters, Y as CriteriaEvaluatorResult, au as DecayOptions, y as DevToolsActions, E as DevToolsDataEvent, z as DevToolsEvent, I as DevToolsForgetEvent, F as DevToolsHelloEvent, B as DevToolsLogEvent, H as DevToolsRawCommandsEvent, x as DevToolsState, w as DevToolsUiVersion, G as DevToolsUpdateEvent, ab as DimensionMatch, a4 as EnrichmentCategory, aA as EnrichmentData, aD as EventData, aI as GoalStateUpdate, az as Goals, X as GroupCriteriaEvaluator, an as IdentifyCommand, U as LogMessageGroup, R as LogMessageSingle, J as LogMessages, W as ManifestInstance, $ as ManifestV2, M as MessageCategory, N as MessageFunc, ai as ModifyScoreCommand, aj as ModifySessionScoreCommand, a5 as NumberMatch, s as PersonalizationEvent, r as PersonalizationEventVariantId, a0 as PersonalizationManifest, o as PersonalizationSelectionAlgorithm, p as PersonalizationSelectionAlgorithms, aB as PersonalizeControlVariant, aC as PersonalizeVariants, ac as QuirkMatch, as as SERVER_STATE_ID, ar as ServerToClientTransitionState, ak as SetConsentCommand, ao as SetControlGroupCommand, ah as SetGoalCommand, ap as SetPersonalizeVariantControlCommand, al as SetQuirkCommand, am as SetTestCommand, K as Severity, a1 as Signal, a3 as SignalCriteria, a2 as SignalCriteriaGroup, _ as SignalData, ag as StorageCommand, a6 as TestDefinition, t as TestEvent, a8 as TestOptions, af as TestResult, ae as TestVariant, ay as Tests, at as TransitionDataStoreEvents, aa as VariationMatchMetadata, ax as VisitorDataStore, aw as VisitorDataStoreEvents, av as VisitorDataStoreOptions, aq as areCommandsEqual, aE as emptyVisitorData, a9 as testVariations } from './types-CKTfVAJs.mjs';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
@@ -229,9 +229,13 @@ type InsightsEndpoint = {
229
229
  apiKey?: string;
230
230
  projectId?: string;
231
231
  };
232
+
232
233
  type EnableUniformInsightsOptions = {
233
234
  endpoint: InsightsEndpoint;
234
235
  };
236
+ /**
237
+ * @deprecated Use `import { enableUniformInsights } from '@uniformdev/insights'` instead
238
+ */
235
239
  declare const enableUniformInsights: (options: EnableUniformInsightsOptions) => ContextPlugin;
236
240
 
237
241
  type QuickConnectConfig = {
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-CzIkFCDD.js';
2
- export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, u as ContextEvents, v as ContextInstance, q as ContextOptions, aF as ContextState, aG as ContextStateUpdate, Z as CriteriaEvaluatorParameters, Y as CriteriaEvaluatorResult, au as DecayOptions, y as DevToolsActions, E as DevToolsDataEvent, z as DevToolsEvent, I as DevToolsForgetEvent, F as DevToolsHelloEvent, B as DevToolsLogEvent, H as DevToolsRawCommandsEvent, x as DevToolsState, w as DevToolsUiVersion, G as DevToolsUpdateEvent, ab as DimensionMatch, a4 as EnrichmentCategory, aA as EnrichmentData, aD as EventData, aH as GoalStateUpdate, az as Goals, X as GroupCriteriaEvaluator, an as IdentifyCommand, U as LogMessageGroup, R as LogMessageSingle, J as LogMessages, W as ManifestInstance, $ as ManifestV2, M as MessageCategory, N as MessageFunc, ai as ModifyScoreCommand, aj as ModifySessionScoreCommand, a5 as NumberMatch, s as PersonalizationEvent, r as PersonalizationEventVariantId, a0 as PersonalizationManifest, o as PersonalizationSelectionAlgorithm, p as PersonalizationSelectionAlgorithms, aB as PersonalizeControlVariant, aC as PersonalizeVariants, ac as QuirkMatch, as as SERVER_STATE_ID, ar as ServerToClientTransitionState, ak as SetConsentCommand, ao as SetControlGroupCommand, ah as SetGoalCommand, ap as SetPersonalizeVariantControlCommand, al as SetQuirkCommand, am as SetTestCommand, K as Severity, a1 as Signal, a3 as SignalCriteria, a2 as SignalCriteriaGroup, _ as SignalData, ag as StorageCommand, a6 as TestDefinition, t as TestEvent, a8 as TestOptions, af as TestResult, ae as TestVariant, ay as Tests, at as TransitionDataStoreEvents, aa as VariationMatchMetadata, ax as VisitorDataStore, aw as VisitorDataStoreEvents, av as VisitorDataStoreOptions, aq as areCommandsEqual, aE as emptyVisitorData, a9 as testVariations } from './types-CzIkFCDD.js';
1
+ import { O as OutputSeverity, L as LogDrain, C as ContextPlugin, S as ScoreVector, A as AggregateDimension, T as TransitionDataStore, a as StorageCommands, V as VisitorData, Q as Quirks, b as TransitionDataStoreOptions, D as DecayFunction, c as CriteriaEvaluator, d as StringMatch, e as VariantMatchCriteria, f as LogMessage, P as PersonalizedVariant, g as PersonalizeOptions, h as Context, i as PersonalizedResult, j as VariationMatchDimensionCriteria, k as PersonalizationSelectionAlgorithmOptions, l as DevToolsEvents } from './types-CKTfVAJs.js';
2
+ export { a7 as AggregateDimensionInput, ad as BehaviorTag, m as CONTEXTUAL_EDITING_TEST_NAME, n as CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID, aF as CompositionMetadata, u as ContextEvents, v as ContextInstance, q as ContextOptions, aG as ContextState, aH as ContextStateUpdate, Z as CriteriaEvaluatorParameters, Y as CriteriaEvaluatorResult, au as DecayOptions, y as DevToolsActions, E as DevToolsDataEvent, z as DevToolsEvent, I as DevToolsForgetEvent, F as DevToolsHelloEvent, B as DevToolsLogEvent, H as DevToolsRawCommandsEvent, x as DevToolsState, w as DevToolsUiVersion, G as DevToolsUpdateEvent, ab as DimensionMatch, a4 as EnrichmentCategory, aA as EnrichmentData, aD as EventData, aI as GoalStateUpdate, az as Goals, X as GroupCriteriaEvaluator, an as IdentifyCommand, U as LogMessageGroup, R as LogMessageSingle, J as LogMessages, W as ManifestInstance, $ as ManifestV2, M as MessageCategory, N as MessageFunc, ai as ModifyScoreCommand, aj as ModifySessionScoreCommand, a5 as NumberMatch, s as PersonalizationEvent, r as PersonalizationEventVariantId, a0 as PersonalizationManifest, o as PersonalizationSelectionAlgorithm, p as PersonalizationSelectionAlgorithms, aB as PersonalizeControlVariant, aC as PersonalizeVariants, ac as QuirkMatch, as as SERVER_STATE_ID, ar as ServerToClientTransitionState, ak as SetConsentCommand, ao as SetControlGroupCommand, ah as SetGoalCommand, ap as SetPersonalizeVariantControlCommand, al as SetQuirkCommand, am as SetTestCommand, K as Severity, a1 as Signal, a3 as SignalCriteria, a2 as SignalCriteriaGroup, _ as SignalData, ag as StorageCommand, a6 as TestDefinition, t as TestEvent, a8 as TestOptions, af as TestResult, ae as TestVariant, ay as Tests, at as TransitionDataStoreEvents, aa as VariationMatchMetadata, ax as VisitorDataStore, aw as VisitorDataStoreEvents, av as VisitorDataStoreOptions, aq as areCommandsEqual, aE as emptyVisitorData, a9 as testVariations } from './types-CKTfVAJs.js';
3
3
  import Cookies from 'js-cookie';
4
4
  import 'mitt';
5
5
 
@@ -229,9 +229,13 @@ type InsightsEndpoint = {
229
229
  apiKey?: string;
230
230
  projectId?: string;
231
231
  };
232
+
232
233
  type EnableUniformInsightsOptions = {
233
234
  endpoint: InsightsEndpoint;
234
235
  };
236
+ /**
237
+ * @deprecated Use `import { enableUniformInsights } from '@uniformdev/insights'` instead
238
+ */
235
239
  declare const enableUniformInsights: (options: EnableUniformInsightsOptions) => ContextPlugin;
236
240
 
237
241
  type QuickConnectConfig = {
package/dist/index.esm.js CHANGED
@@ -227,6 +227,10 @@ var ManifestInstance = class {
227
227
  }
228
228
  return (_d = (_c = __privateGet(this, _mf).pz) == null ? void 0 : _c.enr) == null ? void 0 : _d[scoreKey.substring(0, enrichmentIndex)];
229
229
  }
230
+ getAggregateDimensionByKey(scoreKey) {
231
+ var _a, _b;
232
+ return (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.agg) == null ? void 0 : _b[scoreKey];
233
+ }
230
234
  };
231
235
  _mf = new WeakMap();
232
236
  _signalInstances = new WeakMap();
@@ -941,6 +945,9 @@ var testVariations = ({
941
945
  }
942
946
  if (selectedVariant) {
943
947
  onLogMessage == null ? void 0 : onLogMessage(["info", 404, selectedVariant.id]);
948
+ if (selectedVariant.control === void 0) {
949
+ selectedVariant.control = variations.findIndex((variation) => variation.id === selectedVariantId) === 0;
950
+ }
944
951
  }
945
952
  return {
946
953
  result: selectedVariant,
@@ -1904,7 +1911,9 @@ var Context = class {
1904
1911
  __privateMethod(this, _Context_instances, emitTest_fn).call(this, {
1905
1912
  name: testName,
1906
1913
  variantId: testVariantId,
1907
- variantAssigned: true
1914
+ variantAssigned: true,
1915
+ control: false,
1916
+ compositionMetadata: void 0
1908
1917
  });
1909
1918
  });
1910
1919
  const haveQuirksChanged = __privateGet(this, _serverTransitionState) && !dequal5(__privateGet(this, _serverTransitionState).quirks, this.storage.data.quirks);
@@ -1920,7 +1929,7 @@ var Context = class {
1920
1929
  if (!plugin.update) {
1921
1930
  continue;
1922
1931
  }
1923
- await plugin.update(newData);
1932
+ await plugin.update(newData, __privateGet(this, _scores));
1924
1933
  }
1925
1934
  }
1926
1935
  (_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
@@ -1986,7 +1995,7 @@ var Context = class {
1986
1995
  }
1987
1996
  /** Executes an A/B test with a given set of variants, showing the visitor's assigned variant (or selecting one to assign, if none is set yet) */
1988
1997
  test(options) {
1989
- var _a, _b, _c;
1998
+ var _a, _b, _c, _d, _e;
1990
1999
  if (options.name === CONTEXTUAL_EDITING_TEST_NAME) {
1991
2000
  const selectedVariant = (_a = options.variations.find((variant) => variant.id === CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID)) != null ? _a : options.variations.at(-1);
1992
2001
  const value2 = {
@@ -2003,7 +2012,9 @@ var Context = class {
2003
2012
  __privateMethod(this, _Context_instances, emitTest_fn).call(this, {
2004
2013
  name: options.name,
2005
2014
  variantId: (_c = (_b = value.result) == null ? void 0 : _b.id) != null ? _c : void 0,
2006
- variantAssigned: value.variantAssigned
2015
+ variantAssigned: value.variantAssigned,
2016
+ control: (_e = (_d = value.result) == null ? void 0 : _d.control) != null ? _e : false,
2017
+ compositionMetadata: options.compositionMetadata
2007
2018
  });
2008
2019
  return value;
2009
2020
  }
@@ -2032,7 +2043,8 @@ var Context = class {
2032
2043
  control: variation.control
2033
2044
  })),
2034
2045
  control: this.storage.data.controlGroup,
2035
- changed: true
2046
+ changed: true,
2047
+ compositionMetadata: options.compositionMetadata
2036
2048
  };
2037
2049
  if (previousPlacement && dequal5(eventData.variantIds, previousPlacement)) {
2038
2050
  eventData.changed = false;
@@ -2092,6 +2104,27 @@ var Context = class {
2092
2104
  __privateGet(this, _pzCache)[event.name] = event.variantIds;
2093
2105
  __privateGet(this, _mitt3).emit("personalizationResult", event);
2094
2106
  }
2107
+ /**
2108
+ * Gets the current canvas data
2109
+ */
2110
+ getCompositionMetadata() {
2111
+ return __privateGet(this, _state).compositionMetadata;
2112
+ }
2113
+ /**
2114
+ * Updates the canvas data and emits a canvasDataUpdated event
2115
+ */
2116
+ async updateCompositionMetadata(newData) {
2117
+ const currentCanvas = __privateGet(this, _state).compositionMetadata || {};
2118
+ const updatedCanvas = { ...currentCanvas, ...newData };
2119
+ if (!dequal5(currentCanvas, updatedCanvas)) {
2120
+ __privateSet(this, _state, {
2121
+ ...__privateGet(this, _state),
2122
+ compositionMetadata: updatedCanvas
2123
+ });
2124
+ __privateGet(this, _mitt3).emit("canvasDataUpdated", updatedCanvas);
2125
+ __privateGet(this, _mitt3).emit("log", ["info", 4, "Canvas data updated"]);
2126
+ }
2127
+ }
2095
2128
  };
2096
2129
  _personalizationSelectionAlgorithms = new WeakMap();
2097
2130
  _serverTransitionState = new WeakMap();
@@ -2256,7 +2289,31 @@ var ScriptType = /* @__PURE__ */ ((ScriptType2) => {
2256
2289
  })(ScriptType || {});
2257
2290
  var EdgeNodeTagName = "nesitag";
2258
2291
 
2259
- // src/insights/index.ts
2292
+ // src/insights/storage.ts
2293
+ var createInsightsStorage = () => {
2294
+ const STORAGE_KEY2 = "ufin";
2295
+ return {
2296
+ get: () => {
2297
+ const data = localStorage.getItem(STORAGE_KEY2);
2298
+ if (!data) {
2299
+ return;
2300
+ }
2301
+ return JSON.parse(data);
2302
+ },
2303
+ set: (data) => {
2304
+ const toSet = {
2305
+ ...data,
2306
+ updated: Date.now()
2307
+ };
2308
+ localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
2309
+ },
2310
+ clear: () => {
2311
+ localStorage.removeItem(STORAGE_KEY2);
2312
+ }
2313
+ };
2314
+ };
2315
+
2316
+ // src/insights/types.ts
2260
2317
  var getBasePayload = () => {
2261
2318
  const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
2262
2319
  const locale = navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.userLanguage || navigator.language || navigator.browserLanguage || "en";
@@ -2269,13 +2326,34 @@ var getBasePayload = () => {
2269
2326
  href: window.location.href
2270
2327
  };
2271
2328
  };
2329
+ var generateVisitorId = () => {
2330
+ return `visitor_${generalRandomId()}`;
2331
+ };
2332
+ var generateSessionId = () => {
2333
+ return `session_${generalRandomId()}`;
2334
+ };
2335
+ var generatePageId = () => {
2336
+ return `page_${generalRandomId()}`;
2337
+ };
2338
+ var generalRandomId = () => {
2339
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2340
+ const id = crypto.randomUUID();
2341
+ return id.replaceAll("-", "").toLowerCase();
2342
+ }
2343
+ return Math.random().toString(32).substring(2);
2344
+ };
2345
+
2346
+ // src/insights/v1.ts
2272
2347
  var createInsightsClient = ({ endpoint }) => {
2273
2348
  let endpointUrl;
2274
2349
  const apiKey = endpoint.apiKey;
2275
2350
  const projectId = endpoint.projectId;
2276
2351
  if (endpoint.type === "api") {
2277
2352
  const url = new URL(endpoint.host);
2278
- url.pathname = "/v0/events";
2353
+ url.pathname = `/v0/events`;
2354
+ if (endpoint.host.includes("tinybird.co")) {
2355
+ url.pathname = "/v0/events";
2356
+ }
2279
2357
  url.searchParams.set("name", "analytics_events");
2280
2358
  endpointUrl = url.toString();
2281
2359
  } else {
@@ -2405,38 +2483,7 @@ var createInsightsClient = ({ endpoint }) => {
2405
2483
  }
2406
2484
  };
2407
2485
  };
2408
- var createInsightsStorage = () => {
2409
- const STORAGE_KEY2 = "ufin";
2410
- return {
2411
- get: () => {
2412
- const data = localStorage.getItem(STORAGE_KEY2);
2413
- if (!data) {
2414
- return;
2415
- }
2416
- return JSON.parse(data);
2417
- },
2418
- set: (data) => {
2419
- const toSet = {
2420
- ...data,
2421
- updated: Date.now()
2422
- };
2423
- localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
2424
- },
2425
- clear: () => {
2426
- localStorage.removeItem(STORAGE_KEY2);
2427
- }
2428
- };
2429
- };
2430
- var generateVisitorId = () => {
2431
- return `visitor_${generalRandomId()}`;
2432
- };
2433
- var generateSessionId = () => {
2434
- return `session_${generalRandomId()}`;
2435
- };
2436
- var generatePageId = () => {
2437
- return `page_${generalRandomId()}`;
2438
- };
2439
- var createInsights = ({
2486
+ var createInsightsV1 = ({
2440
2487
  endpoint,
2441
2488
  sessionDurationSeconds = 30 * 60
2442
2489
  }) => {
@@ -2537,8 +2584,10 @@ var createInsights = ({
2537
2584
  }
2538
2585
  };
2539
2586
  };
2587
+
2588
+ // src/insights/index.ts
2540
2589
  var enableUniformInsights = (options) => {
2541
- const insights = createInsights({
2590
+ const insights = createInsightsV1({
2542
2591
  endpoint: options.endpoint
2543
2592
  });
2544
2593
  let previousUrl = void 0;
@@ -2584,8 +2633,8 @@ var enableUniformInsights = (options) => {
2584
2633
  };
2585
2634
  },
2586
2635
  update: (context) => {
2587
- if (context.url && context.url !== previousUrl) {
2588
- previousUrl = context.url;
2636
+ if (context.url && context.url.toString() !== previousUrl) {
2637
+ previousUrl = context.url.toString();
2589
2638
  insights.pageHit();
2590
2639
  }
2591
2640
  },
@@ -2594,13 +2643,6 @@ var enableUniformInsights = (options) => {
2594
2643
  }
2595
2644
  };
2596
2645
  };
2597
- var generalRandomId = () => {
2598
- if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2599
- const id = crypto.randomUUID();
2600
- return id.replaceAll("-", "").toLowerCase();
2601
- }
2602
- return Math.random().toString(32).substring(2);
2603
- };
2604
2646
 
2605
2647
  // src/logging/enableConsoleLogDrain.ts
2606
2648
  import rfdc2 from "rfdc";
package/dist/index.js CHANGED
@@ -320,6 +320,10 @@ var ManifestInstance = class {
320
320
  }
321
321
  return (_d = (_c = __privateGet(this, _mf).pz) == null ? void 0 : _c.enr) == null ? void 0 : _d[scoreKey.substring(0, enrichmentIndex)];
322
322
  }
323
+ getAggregateDimensionByKey(scoreKey) {
324
+ var _a, _b;
325
+ return (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.agg) == null ? void 0 : _b[scoreKey];
326
+ }
323
327
  };
324
328
  _mf = new WeakMap();
325
329
  _signalInstances = new WeakMap();
@@ -1034,6 +1038,9 @@ var testVariations = ({
1034
1038
  }
1035
1039
  if (selectedVariant) {
1036
1040
  onLogMessage == null ? void 0 : onLogMessage(["info", 404, selectedVariant.id]);
1041
+ if (selectedVariant.control === void 0) {
1042
+ selectedVariant.control = variations.findIndex((variation) => variation.id === selectedVariantId) === 0;
1043
+ }
1037
1044
  }
1038
1045
  return {
1039
1046
  result: selectedVariant,
@@ -1997,7 +2004,9 @@ var Context = class {
1997
2004
  __privateMethod(this, _Context_instances, emitTest_fn).call(this, {
1998
2005
  name: testName,
1999
2006
  variantId: testVariantId,
2000
- variantAssigned: true
2007
+ variantAssigned: true,
2008
+ control: false,
2009
+ compositionMetadata: void 0
2001
2010
  });
2002
2011
  });
2003
2012
  const haveQuirksChanged = __privateGet(this, _serverTransitionState) && !(0, import_lite5.dequal)(__privateGet(this, _serverTransitionState).quirks, this.storage.data.quirks);
@@ -2013,7 +2022,7 @@ var Context = class {
2013
2022
  if (!plugin.update) {
2014
2023
  continue;
2015
2024
  }
2016
- await plugin.update(newData);
2025
+ await plugin.update(newData, __privateGet(this, _scores));
2017
2026
  }
2018
2027
  }
2019
2028
  (_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
@@ -2079,7 +2088,7 @@ var Context = class {
2079
2088
  }
2080
2089
  /** Executes an A/B test with a given set of variants, showing the visitor's assigned variant (or selecting one to assign, if none is set yet) */
2081
2090
  test(options) {
2082
- var _a, _b, _c;
2091
+ var _a, _b, _c, _d, _e;
2083
2092
  if (options.name === CONTEXTUAL_EDITING_TEST_NAME) {
2084
2093
  const selectedVariant = (_a = options.variations.find((variant) => variant.id === CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID)) != null ? _a : options.variations.at(-1);
2085
2094
  const value2 = {
@@ -2096,7 +2105,9 @@ var Context = class {
2096
2105
  __privateMethod(this, _Context_instances, emitTest_fn).call(this, {
2097
2106
  name: options.name,
2098
2107
  variantId: (_c = (_b = value.result) == null ? void 0 : _b.id) != null ? _c : void 0,
2099
- variantAssigned: value.variantAssigned
2108
+ variantAssigned: value.variantAssigned,
2109
+ control: (_e = (_d = value.result) == null ? void 0 : _d.control) != null ? _e : false,
2110
+ compositionMetadata: options.compositionMetadata
2100
2111
  });
2101
2112
  return value;
2102
2113
  }
@@ -2125,7 +2136,8 @@ var Context = class {
2125
2136
  control: variation.control
2126
2137
  })),
2127
2138
  control: this.storage.data.controlGroup,
2128
- changed: true
2139
+ changed: true,
2140
+ compositionMetadata: options.compositionMetadata
2129
2141
  };
2130
2142
  if (previousPlacement && (0, import_lite5.dequal)(eventData.variantIds, previousPlacement)) {
2131
2143
  eventData.changed = false;
@@ -2185,6 +2197,27 @@ var Context = class {
2185
2197
  __privateGet(this, _pzCache)[event.name] = event.variantIds;
2186
2198
  __privateGet(this, _mitt3).emit("personalizationResult", event);
2187
2199
  }
2200
+ /**
2201
+ * Gets the current canvas data
2202
+ */
2203
+ getCompositionMetadata() {
2204
+ return __privateGet(this, _state).compositionMetadata;
2205
+ }
2206
+ /**
2207
+ * Updates the canvas data and emits a canvasDataUpdated event
2208
+ */
2209
+ async updateCompositionMetadata(newData) {
2210
+ const currentCanvas = __privateGet(this, _state).compositionMetadata || {};
2211
+ const updatedCanvas = { ...currentCanvas, ...newData };
2212
+ if (!(0, import_lite5.dequal)(currentCanvas, updatedCanvas)) {
2213
+ __privateSet(this, _state, {
2214
+ ...__privateGet(this, _state),
2215
+ compositionMetadata: updatedCanvas
2216
+ });
2217
+ __privateGet(this, _mitt3).emit("canvasDataUpdated", updatedCanvas);
2218
+ __privateGet(this, _mitt3).emit("log", ["info", 4, "Canvas data updated"]);
2219
+ }
2220
+ }
2188
2221
  };
2189
2222
  _personalizationSelectionAlgorithms = new WeakMap();
2190
2223
  _serverTransitionState = new WeakMap();
@@ -2349,7 +2382,31 @@ var ScriptType = /* @__PURE__ */ ((ScriptType2) => {
2349
2382
  })(ScriptType || {});
2350
2383
  var EdgeNodeTagName = "nesitag";
2351
2384
 
2352
- // src/insights/index.ts
2385
+ // src/insights/storage.ts
2386
+ var createInsightsStorage = () => {
2387
+ const STORAGE_KEY2 = "ufin";
2388
+ return {
2389
+ get: () => {
2390
+ const data = localStorage.getItem(STORAGE_KEY2);
2391
+ if (!data) {
2392
+ return;
2393
+ }
2394
+ return JSON.parse(data);
2395
+ },
2396
+ set: (data) => {
2397
+ const toSet = {
2398
+ ...data,
2399
+ updated: Date.now()
2400
+ };
2401
+ localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
2402
+ },
2403
+ clear: () => {
2404
+ localStorage.removeItem(STORAGE_KEY2);
2405
+ }
2406
+ };
2407
+ };
2408
+
2409
+ // src/insights/types.ts
2353
2410
  var getBasePayload = () => {
2354
2411
  const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
2355
2412
  const locale = navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.userLanguage || navigator.language || navigator.browserLanguage || "en";
@@ -2362,13 +2419,34 @@ var getBasePayload = () => {
2362
2419
  href: window.location.href
2363
2420
  };
2364
2421
  };
2422
+ var generateVisitorId = () => {
2423
+ return `visitor_${generalRandomId()}`;
2424
+ };
2425
+ var generateSessionId = () => {
2426
+ return `session_${generalRandomId()}`;
2427
+ };
2428
+ var generatePageId = () => {
2429
+ return `page_${generalRandomId()}`;
2430
+ };
2431
+ var generalRandomId = () => {
2432
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2433
+ const id = crypto.randomUUID();
2434
+ return id.replaceAll("-", "").toLowerCase();
2435
+ }
2436
+ return Math.random().toString(32).substring(2);
2437
+ };
2438
+
2439
+ // src/insights/v1.ts
2365
2440
  var createInsightsClient = ({ endpoint }) => {
2366
2441
  let endpointUrl;
2367
2442
  const apiKey = endpoint.apiKey;
2368
2443
  const projectId = endpoint.projectId;
2369
2444
  if (endpoint.type === "api") {
2370
2445
  const url = new URL(endpoint.host);
2371
- url.pathname = "/v0/events";
2446
+ url.pathname = `/v0/events`;
2447
+ if (endpoint.host.includes("tinybird.co")) {
2448
+ url.pathname = "/v0/events";
2449
+ }
2372
2450
  url.searchParams.set("name", "analytics_events");
2373
2451
  endpointUrl = url.toString();
2374
2452
  } else {
@@ -2498,38 +2576,7 @@ var createInsightsClient = ({ endpoint }) => {
2498
2576
  }
2499
2577
  };
2500
2578
  };
2501
- var createInsightsStorage = () => {
2502
- const STORAGE_KEY2 = "ufin";
2503
- return {
2504
- get: () => {
2505
- const data = localStorage.getItem(STORAGE_KEY2);
2506
- if (!data) {
2507
- return;
2508
- }
2509
- return JSON.parse(data);
2510
- },
2511
- set: (data) => {
2512
- const toSet = {
2513
- ...data,
2514
- updated: Date.now()
2515
- };
2516
- localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
2517
- },
2518
- clear: () => {
2519
- localStorage.removeItem(STORAGE_KEY2);
2520
- }
2521
- };
2522
- };
2523
- var generateVisitorId = () => {
2524
- return `visitor_${generalRandomId()}`;
2525
- };
2526
- var generateSessionId = () => {
2527
- return `session_${generalRandomId()}`;
2528
- };
2529
- var generatePageId = () => {
2530
- return `page_${generalRandomId()}`;
2531
- };
2532
- var createInsights = ({
2579
+ var createInsightsV1 = ({
2533
2580
  endpoint,
2534
2581
  sessionDurationSeconds = 30 * 60
2535
2582
  }) => {
@@ -2630,8 +2677,10 @@ var createInsights = ({
2630
2677
  }
2631
2678
  };
2632
2679
  };
2680
+
2681
+ // src/insights/index.ts
2633
2682
  var enableUniformInsights = (options) => {
2634
- const insights = createInsights({
2683
+ const insights = createInsightsV1({
2635
2684
  endpoint: options.endpoint
2636
2685
  });
2637
2686
  let previousUrl = void 0;
@@ -2677,8 +2726,8 @@ var enableUniformInsights = (options) => {
2677
2726
  };
2678
2727
  },
2679
2728
  update: (context) => {
2680
- if (context.url && context.url !== previousUrl) {
2681
- previousUrl = context.url;
2729
+ if (context.url && context.url.toString() !== previousUrl) {
2730
+ previousUrl = context.url.toString();
2682
2731
  insights.pageHit();
2683
2732
  }
2684
2733
  },
@@ -2687,13 +2736,6 @@ var enableUniformInsights = (options) => {
2687
2736
  }
2688
2737
  };
2689
2738
  };
2690
- var generalRandomId = () => {
2691
- if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2692
- const id = crypto.randomUUID();
2693
- return id.replaceAll("-", "").toLowerCase();
2694
- }
2695
- return Math.random().toString(32).substring(2);
2696
- };
2697
2739
 
2698
2740
  // src/logging/enableConsoleLogDrain.ts
2699
2741
  var import_rfdc2 = __toESM(require("rfdc"));
package/dist/index.mjs CHANGED
@@ -227,6 +227,10 @@ var ManifestInstance = class {
227
227
  }
228
228
  return (_d = (_c = __privateGet(this, _mf).pz) == null ? void 0 : _c.enr) == null ? void 0 : _d[scoreKey.substring(0, enrichmentIndex)];
229
229
  }
230
+ getAggregateDimensionByKey(scoreKey) {
231
+ var _a, _b;
232
+ return (_b = (_a = __privateGet(this, _mf).pz) == null ? void 0 : _a.agg) == null ? void 0 : _b[scoreKey];
233
+ }
230
234
  };
231
235
  _mf = new WeakMap();
232
236
  _signalInstances = new WeakMap();
@@ -941,6 +945,9 @@ var testVariations = ({
941
945
  }
942
946
  if (selectedVariant) {
943
947
  onLogMessage == null ? void 0 : onLogMessage(["info", 404, selectedVariant.id]);
948
+ if (selectedVariant.control === void 0) {
949
+ selectedVariant.control = variations.findIndex((variation) => variation.id === selectedVariantId) === 0;
950
+ }
944
951
  }
945
952
  return {
946
953
  result: selectedVariant,
@@ -1904,7 +1911,9 @@ var Context = class {
1904
1911
  __privateMethod(this, _Context_instances, emitTest_fn).call(this, {
1905
1912
  name: testName,
1906
1913
  variantId: testVariantId,
1907
- variantAssigned: true
1914
+ variantAssigned: true,
1915
+ control: false,
1916
+ compositionMetadata: void 0
1908
1917
  });
1909
1918
  });
1910
1919
  const haveQuirksChanged = __privateGet(this, _serverTransitionState) && !dequal5(__privateGet(this, _serverTransitionState).quirks, this.storage.data.quirks);
@@ -1920,7 +1929,7 @@ var Context = class {
1920
1929
  if (!plugin.update) {
1921
1930
  continue;
1922
1931
  }
1923
- await plugin.update(newData);
1932
+ await plugin.update(newData, __privateGet(this, _scores));
1924
1933
  }
1925
1934
  }
1926
1935
  (_e = __privateGet(this, _commands)) == null ? void 0 : _e.push(...commands);
@@ -1986,7 +1995,7 @@ var Context = class {
1986
1995
  }
1987
1996
  /** Executes an A/B test with a given set of variants, showing the visitor's assigned variant (or selecting one to assign, if none is set yet) */
1988
1997
  test(options) {
1989
- var _a, _b, _c;
1998
+ var _a, _b, _c, _d, _e;
1990
1999
  if (options.name === CONTEXTUAL_EDITING_TEST_NAME) {
1991
2000
  const selectedVariant = (_a = options.variations.find((variant) => variant.id === CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID)) != null ? _a : options.variations.at(-1);
1992
2001
  const value2 = {
@@ -2003,7 +2012,9 @@ var Context = class {
2003
2012
  __privateMethod(this, _Context_instances, emitTest_fn).call(this, {
2004
2013
  name: options.name,
2005
2014
  variantId: (_c = (_b = value.result) == null ? void 0 : _b.id) != null ? _c : void 0,
2006
- variantAssigned: value.variantAssigned
2015
+ variantAssigned: value.variantAssigned,
2016
+ control: (_e = (_d = value.result) == null ? void 0 : _d.control) != null ? _e : false,
2017
+ compositionMetadata: options.compositionMetadata
2007
2018
  });
2008
2019
  return value;
2009
2020
  }
@@ -2032,7 +2043,8 @@ var Context = class {
2032
2043
  control: variation.control
2033
2044
  })),
2034
2045
  control: this.storage.data.controlGroup,
2035
- changed: true
2046
+ changed: true,
2047
+ compositionMetadata: options.compositionMetadata
2036
2048
  };
2037
2049
  if (previousPlacement && dequal5(eventData.variantIds, previousPlacement)) {
2038
2050
  eventData.changed = false;
@@ -2092,6 +2104,27 @@ var Context = class {
2092
2104
  __privateGet(this, _pzCache)[event.name] = event.variantIds;
2093
2105
  __privateGet(this, _mitt3).emit("personalizationResult", event);
2094
2106
  }
2107
+ /**
2108
+ * Gets the current canvas data
2109
+ */
2110
+ getCompositionMetadata() {
2111
+ return __privateGet(this, _state).compositionMetadata;
2112
+ }
2113
+ /**
2114
+ * Updates the canvas data and emits a canvasDataUpdated event
2115
+ */
2116
+ async updateCompositionMetadata(newData) {
2117
+ const currentCanvas = __privateGet(this, _state).compositionMetadata || {};
2118
+ const updatedCanvas = { ...currentCanvas, ...newData };
2119
+ if (!dequal5(currentCanvas, updatedCanvas)) {
2120
+ __privateSet(this, _state, {
2121
+ ...__privateGet(this, _state),
2122
+ compositionMetadata: updatedCanvas
2123
+ });
2124
+ __privateGet(this, _mitt3).emit("canvasDataUpdated", updatedCanvas);
2125
+ __privateGet(this, _mitt3).emit("log", ["info", 4, "Canvas data updated"]);
2126
+ }
2127
+ }
2095
2128
  };
2096
2129
  _personalizationSelectionAlgorithms = new WeakMap();
2097
2130
  _serverTransitionState = new WeakMap();
@@ -2256,7 +2289,31 @@ var ScriptType = /* @__PURE__ */ ((ScriptType2) => {
2256
2289
  })(ScriptType || {});
2257
2290
  var EdgeNodeTagName = "nesitag";
2258
2291
 
2259
- // src/insights/index.ts
2292
+ // src/insights/storage.ts
2293
+ var createInsightsStorage = () => {
2294
+ const STORAGE_KEY2 = "ufin";
2295
+ return {
2296
+ get: () => {
2297
+ const data = localStorage.getItem(STORAGE_KEY2);
2298
+ if (!data) {
2299
+ return;
2300
+ }
2301
+ return JSON.parse(data);
2302
+ },
2303
+ set: (data) => {
2304
+ const toSet = {
2305
+ ...data,
2306
+ updated: Date.now()
2307
+ };
2308
+ localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
2309
+ },
2310
+ clear: () => {
2311
+ localStorage.removeItem(STORAGE_KEY2);
2312
+ }
2313
+ };
2314
+ };
2315
+
2316
+ // src/insights/types.ts
2260
2317
  var getBasePayload = () => {
2261
2318
  const timeZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
2262
2319
  const locale = navigator.languages && navigator.languages.length ? navigator.languages[0] : navigator.userLanguage || navigator.language || navigator.browserLanguage || "en";
@@ -2269,13 +2326,34 @@ var getBasePayload = () => {
2269
2326
  href: window.location.href
2270
2327
  };
2271
2328
  };
2329
+ var generateVisitorId = () => {
2330
+ return `visitor_${generalRandomId()}`;
2331
+ };
2332
+ var generateSessionId = () => {
2333
+ return `session_${generalRandomId()}`;
2334
+ };
2335
+ var generatePageId = () => {
2336
+ return `page_${generalRandomId()}`;
2337
+ };
2338
+ var generalRandomId = () => {
2339
+ if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2340
+ const id = crypto.randomUUID();
2341
+ return id.replaceAll("-", "").toLowerCase();
2342
+ }
2343
+ return Math.random().toString(32).substring(2);
2344
+ };
2345
+
2346
+ // src/insights/v1.ts
2272
2347
  var createInsightsClient = ({ endpoint }) => {
2273
2348
  let endpointUrl;
2274
2349
  const apiKey = endpoint.apiKey;
2275
2350
  const projectId = endpoint.projectId;
2276
2351
  if (endpoint.type === "api") {
2277
2352
  const url = new URL(endpoint.host);
2278
- url.pathname = "/v0/events";
2353
+ url.pathname = `/v0/events`;
2354
+ if (endpoint.host.includes("tinybird.co")) {
2355
+ url.pathname = "/v0/events";
2356
+ }
2279
2357
  url.searchParams.set("name", "analytics_events");
2280
2358
  endpointUrl = url.toString();
2281
2359
  } else {
@@ -2405,38 +2483,7 @@ var createInsightsClient = ({ endpoint }) => {
2405
2483
  }
2406
2484
  };
2407
2485
  };
2408
- var createInsightsStorage = () => {
2409
- const STORAGE_KEY2 = "ufin";
2410
- return {
2411
- get: () => {
2412
- const data = localStorage.getItem(STORAGE_KEY2);
2413
- if (!data) {
2414
- return;
2415
- }
2416
- return JSON.parse(data);
2417
- },
2418
- set: (data) => {
2419
- const toSet = {
2420
- ...data,
2421
- updated: Date.now()
2422
- };
2423
- localStorage.setItem(STORAGE_KEY2, JSON.stringify(toSet));
2424
- },
2425
- clear: () => {
2426
- localStorage.removeItem(STORAGE_KEY2);
2427
- }
2428
- };
2429
- };
2430
- var generateVisitorId = () => {
2431
- return `visitor_${generalRandomId()}`;
2432
- };
2433
- var generateSessionId = () => {
2434
- return `session_${generalRandomId()}`;
2435
- };
2436
- var generatePageId = () => {
2437
- return `page_${generalRandomId()}`;
2438
- };
2439
- var createInsights = ({
2486
+ var createInsightsV1 = ({
2440
2487
  endpoint,
2441
2488
  sessionDurationSeconds = 30 * 60
2442
2489
  }) => {
@@ -2537,8 +2584,10 @@ var createInsights = ({
2537
2584
  }
2538
2585
  };
2539
2586
  };
2587
+
2588
+ // src/insights/index.ts
2540
2589
  var enableUniformInsights = (options) => {
2541
- const insights = createInsights({
2590
+ const insights = createInsightsV1({
2542
2591
  endpoint: options.endpoint
2543
2592
  });
2544
2593
  let previousUrl = void 0;
@@ -2584,8 +2633,8 @@ var enableUniformInsights = (options) => {
2584
2633
  };
2585
2634
  },
2586
2635
  update: (context) => {
2587
- if (context.url && context.url !== previousUrl) {
2588
- previousUrl = context.url;
2636
+ if (context.url && context.url.toString() !== previousUrl) {
2637
+ previousUrl = context.url.toString();
2589
2638
  insights.pageHit();
2590
2639
  }
2591
2640
  },
@@ -2594,13 +2643,6 @@ var enableUniformInsights = (options) => {
2594
2643
  }
2595
2644
  };
2596
2645
  };
2597
- var generalRandomId = () => {
2598
- if (typeof crypto !== "undefined" && typeof crypto.randomUUID === "function") {
2599
- const id = crypto.randomUUID();
2600
- return id.replaceAll("-", "").toLowerCase();
2601
- }
2602
- return Math.random().toString(32).substring(2);
2603
- };
2604
2646
 
2605
2647
  // src/logging/enableConsoleLogDrain.ts
2606
2648
  import rfdc2 from "rfdc";
@@ -76,6 +76,17 @@ type VisitorData = {
76
76
  personalizeVariants?: PersonalizeVariants;
77
77
  };
78
78
  declare const emptyVisitorData: () => VisitorData;
79
+ /**
80
+ * Canvas-specific data that should be managed separately from regular context updates
81
+ */
82
+ type CompositionMetadata = {
83
+ /** The composition ID always required, otherwise whole metadata should not be set */
84
+ compositionId: string;
85
+ /** The matched route from router endpoint. Same as matched project map node pathname */
86
+ matchedRoute?: string;
87
+ /** Dynamic inputs for the route */
88
+ dynamicInputs?: Record<string, string>;
89
+ };
79
90
  /**
80
91
  * Expresses a 'patch' to the Uniform Context state
81
92
  */
@@ -85,6 +96,11 @@ type ContextState = {
85
96
  quirks: Quirks;
86
97
  enrichments: EnrichmentData[];
87
98
  events: EventData[];
99
+ /**
100
+ * Metadata about the composition that is being rendered right now.
101
+ * if you have multiple compositions on the page, please set this one manually.
102
+ */
103
+ compositionMetadata?: CompositionMetadata;
88
104
  };
89
105
  type ContextStateUpdate = {
90
106
  /** The new effective state of the visitor after this state update is applied */
@@ -374,6 +390,7 @@ declare class ManifestInstance {
374
390
  */
375
391
  computeAggregateDimensions(primitiveScores: ScoreVector): ScoreVector;
376
392
  getDimensionByKey(scoreKey: string): EnrichmentCategory | Signal | undefined;
393
+ getAggregateDimensionByKey(scoreKey: string): AggregateDimension | undefined;
377
394
  }
378
395
 
379
396
  interface paths {
@@ -1030,6 +1047,10 @@ type TestVariant = {
1030
1047
  * If not provided, this variant will be selected in equal proportion to other variants without an explicit distribution.
1031
1048
  */
1032
1049
  testDistribution?: number;
1050
+ /** Whether this variant is a control variant.
1051
+ * Can be undefined for backward compatibility with older versions of the SDK which were not explicitly setting the control flag.
1052
+ */
1053
+ control?: boolean;
1033
1054
  };
1034
1055
  /** The result of computing an A/B test result */
1035
1056
  type TestResult<TVariant> = {
@@ -1051,6 +1072,8 @@ interface PersonalizeOptions<TVariant> {
1051
1072
  take?: number;
1052
1073
  /** Name of the personalization selection algorithm to use. Defaults to top-down criteria when not specified. */
1053
1074
  algorithm?: string;
1075
+ /** Composition metadata where the personalization is being rendered for analytics tracking */
1076
+ compositionMetadata?: CompositionMetadata;
1054
1077
  }
1055
1078
  interface PersonalizationSelectionAlgorithmOptions<TCriteria, TVariant extends PersonalizedVariant<TCriteria> = PersonalizedVariant<TCriteria>> {
1056
1079
  /** Name of placement (sent to analytics) */
@@ -1070,6 +1093,8 @@ type TestOptions<TVariant extends TestVariant> = {
1070
1093
  name: string;
1071
1094
  /** Variations that are being tested. */
1072
1095
  variations: TVariant[];
1096
+ /** Composition metadata where the personalization is being rendered for analytics tracking */
1097
+ compositionMetadata?: CompositionMetadata;
1073
1098
  };
1074
1099
  declare const testVariations: <TVariant extends TestVariant>({ name, context, variations, onLogMessage, }: TestOptions<TVariant> & {
1075
1100
  context: Context;
@@ -1092,8 +1117,8 @@ type ContextPlugin = {
1092
1117
  init?: (context: Context) => () => void;
1093
1118
  /** Plugin-specific actions to perform when a user is forgotten */
1094
1119
  forget?: () => Promise<void> | void;
1095
- /** Plugin-specific actions to perform when the visitor context is updated */
1096
- update?: (newData: Partial<ContextState>) => Promise<void> | void;
1120
+ /** Plugin-specific actions to perform when the visitor context is updated, second parameter is the recalculated scores after the update */
1121
+ update?: (newData: Partial<ContextState>, recalculatedScores: ScoreVector) => Promise<void> | void;
1097
1122
  /**
1098
1123
  * Allows the plugin to register named personalization selection algorithms
1099
1124
  *
@@ -1140,6 +1165,12 @@ type PersonalizationEvent = {
1140
1165
  * False: the variant(s) selected were the same as a previous evaluation of this placement.
1141
1166
  */
1142
1167
  changed: boolean;
1168
+ /**
1169
+ * Contains information about the composition that contains personalization wrapper component,
1170
+ * which triggered the personalization event.
1171
+ * Only references top level root composition after pattern resolutions.
1172
+ */
1173
+ compositionMetadata?: CompositionMetadata;
1143
1174
  };
1144
1175
  /** Emitted event when an A/B test runs */
1145
1176
  type TestEvent = {
@@ -1147,12 +1178,22 @@ type TestEvent = {
1147
1178
  name: string;
1148
1179
  /** ID of the variant that was selected */
1149
1180
  variantId: string | undefined;
1181
+ /**
1182
+ * Whether the variant is part of the control group.
1183
+ */
1184
+ control: boolean;
1150
1185
  /**
1151
1186
  * Whether the test variant was newly assigned to the visitor.
1152
1187
  * True: variant was assigned to the visitor for the first time.
1153
1188
  * False: variant was already assigned to the visitor and is being reused.
1154
1189
  */
1155
1190
  variantAssigned: boolean;
1191
+ /**
1192
+ * Contains information about the composition that contains A/B test wrapper component,
1193
+ * which triggered the A/B test event.
1194
+ * Only references top level root composition after pattern resolutions.
1195
+ */
1196
+ compositionMetadata?: CompositionMetadata;
1156
1197
  };
1157
1198
  type ContextEvents = {
1158
1199
  /**
@@ -1176,6 +1217,8 @@ type ContextEvents = {
1176
1217
  testResult: TestEvent;
1177
1218
  /** Personalization variants have been selected */
1178
1219
  personalizationResult: PersonalizationEvent;
1220
+ /** Composition metadata has been set/updated, usually happens when new composition is being rendered during client-side navigation for example */
1221
+ canvasDataUpdated: CompositionMetadata;
1179
1222
  };
1180
1223
  interface ContextInstance {
1181
1224
  get scores(): Readonly<ScoreVector>;
@@ -1197,6 +1240,14 @@ interface ContextInstance {
1197
1240
  internal_processTestEvent(event: TestEvent): void;
1198
1241
  /** @deprecated */
1199
1242
  internal_processPersonalizationEvent(event: PersonalizationEvent): void;
1243
+ /**
1244
+ * Gets the current canvas data
1245
+ */
1246
+ getCompositionMetadata(): Readonly<CompositionMetadata | undefined>;
1247
+ /**
1248
+ * Updates the canvas data and emits a canvasDataUpdated event
1249
+ */
1250
+ updateCompositionMetadata(newData: CompositionMetadata): Promise<void>;
1200
1251
  }
1201
1252
  declare class Context implements ContextInstance {
1202
1253
  #private;
@@ -1266,6 +1317,14 @@ declare class Context implements ContextInstance {
1266
1317
  internal_processTestEvent(event: TestEvent): void;
1267
1318
  /** @deprecated */
1268
1319
  internal_processPersonalizationEvent(event: PersonalizationEvent): void;
1320
+ /**
1321
+ * Gets the current canvas data
1322
+ */
1323
+ getCompositionMetadata(): Readonly<CompositionMetadata | undefined>;
1324
+ /**
1325
+ * Updates the canvas data and emits a canvasDataUpdated event
1326
+ */
1327
+ updateCompositionMetadata(newData: CompositionMetadata): Promise<void>;
1269
1328
  }
1270
1329
 
1271
1330
  /**
@@ -1337,4 +1396,4 @@ declare global {
1337
1396
  }
1338
1397
  }
1339
1398
 
1340
- export { type ManifestV2 as $, type AggregateDimension as A, type DevToolsLogEvent as B, type ContextPlugin as C, type DecayFunction as D, type DevToolsDataEvent as E, type DevToolsHelloEvent as F, type DevToolsUpdateEvent as G, type DevToolsRawCommandsEvent as H, type DevToolsForgetEvent as I, type LogMessages as J, type Severity as K, type LogDrain as L, type MessageCategory as M, type MessageFunc as N, type OutputSeverity as O, type PersonalizedVariant as P, type Quirks as Q, type LogMessageSingle as R, type ScoreVector as S, TransitionDataStore as T, type LogMessageGroup as U, type VisitorData as V, ManifestInstance as W, GroupCriteriaEvaluator as X, type CriteriaEvaluatorResult as Y, type CriteriaEvaluatorParameters as Z, type SignalData as _, type StorageCommands as a, type PersonalizationManifest as a0, type Signal as a1, type SignalCriteriaGroup as a2, type SignalCriteria as a3, type EnrichmentCategory as a4, type NumberMatch as a5, type TestDefinition as a6, type AggregateDimensionInput as a7, type TestOptions as a8, testVariations as a9, type EnrichmentData as aA, type PersonalizeControlVariant as aB, type PersonalizeVariants as aC, type EventData as aD, emptyVisitorData as aE, type ContextState as aF, type ContextStateUpdate as aG, type GoalStateUpdate as aH, type paths as aI, type VariationMatchMetadata as aa, type DimensionMatch as ab, type QuirkMatch as ac, type BehaviorTag as ad, type TestVariant as ae, type TestResult as af, type StorageCommand as ag, type SetGoalCommand as ah, type ModifyScoreCommand as ai, type ModifySessionScoreCommand as aj, type SetConsentCommand as ak, type SetQuirkCommand as al, type SetTestCommand as am, type IdentifyCommand as an, type SetControlGroupCommand as ao, type SetPersonalizeVariantControlCommand as ap, areCommandsEqual as aq, type ServerToClientTransitionState as ar, SERVER_STATE_ID as as, type TransitionDataStoreEvents as at, type DecayOptions as au, type VisitorDataStoreOptions as av, type VisitorDataStoreEvents as aw, VisitorDataStore as ax, type Tests as ay, type Goals as az, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type PersonalizeOptions as g, Context as h, type PersonalizedResult as i, type VariationMatchDimensionCriteria as j, type PersonalizationSelectionAlgorithmOptions as k, type DevToolsEvents as l, CONTEXTUAL_EDITING_TEST_NAME as m, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as n, type PersonalizationSelectionAlgorithm as o, type PersonalizationSelectionAlgorithms as p, type ContextOptions as q, type PersonalizationEventVariantId as r, type PersonalizationEvent as s, type TestEvent as t, type ContextEvents as u, type ContextInstance as v, type DevToolsUiVersion as w, type DevToolsState as x, type DevToolsActions as y, type DevToolsEvent as z };
1399
+ export { type ManifestV2 as $, type AggregateDimension as A, type DevToolsLogEvent as B, type ContextPlugin as C, type DecayFunction as D, type DevToolsDataEvent as E, type DevToolsHelloEvent as F, type DevToolsUpdateEvent as G, type DevToolsRawCommandsEvent as H, type DevToolsForgetEvent as I, type LogMessages as J, type Severity as K, type LogDrain as L, type MessageCategory as M, type MessageFunc as N, type OutputSeverity as O, type PersonalizedVariant as P, type Quirks as Q, type LogMessageSingle as R, type ScoreVector as S, TransitionDataStore as T, type LogMessageGroup as U, type VisitorData as V, ManifestInstance as W, GroupCriteriaEvaluator as X, type CriteriaEvaluatorResult as Y, type CriteriaEvaluatorParameters as Z, type SignalData as _, type StorageCommands as a, type PersonalizationManifest as a0, type Signal as a1, type SignalCriteriaGroup as a2, type SignalCriteria as a3, type EnrichmentCategory as a4, type NumberMatch as a5, type TestDefinition as a6, type AggregateDimensionInput as a7, type TestOptions as a8, testVariations as a9, type EnrichmentData as aA, type PersonalizeControlVariant as aB, type PersonalizeVariants as aC, type EventData as aD, emptyVisitorData as aE, type CompositionMetadata as aF, type ContextState as aG, type ContextStateUpdate as aH, type GoalStateUpdate as aI, type paths as aJ, type VariationMatchMetadata as aa, type DimensionMatch as ab, type QuirkMatch as ac, type BehaviorTag as ad, type TestVariant as ae, type TestResult as af, type StorageCommand as ag, type SetGoalCommand as ah, type ModifyScoreCommand as ai, type ModifySessionScoreCommand as aj, type SetConsentCommand as ak, type SetQuirkCommand as al, type SetTestCommand as am, type IdentifyCommand as an, type SetControlGroupCommand as ao, type SetPersonalizeVariantControlCommand as ap, areCommandsEqual as aq, type ServerToClientTransitionState as ar, SERVER_STATE_ID as as, type TransitionDataStoreEvents as at, type DecayOptions as au, type VisitorDataStoreOptions as av, type VisitorDataStoreEvents as aw, VisitorDataStore as ax, type Tests as ay, type Goals as az, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type PersonalizeOptions as g, Context as h, type PersonalizedResult as i, type VariationMatchDimensionCriteria as j, type PersonalizationSelectionAlgorithmOptions as k, type DevToolsEvents as l, CONTEXTUAL_EDITING_TEST_NAME as m, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as n, type PersonalizationSelectionAlgorithm as o, type PersonalizationSelectionAlgorithms as p, type ContextOptions as q, type PersonalizationEventVariantId as r, type PersonalizationEvent as s, type TestEvent as t, type ContextEvents as u, type ContextInstance as v, type DevToolsUiVersion as w, type DevToolsState as x, type DevToolsActions as y, type DevToolsEvent as z };
@@ -76,6 +76,17 @@ type VisitorData = {
76
76
  personalizeVariants?: PersonalizeVariants;
77
77
  };
78
78
  declare const emptyVisitorData: () => VisitorData;
79
+ /**
80
+ * Canvas-specific data that should be managed separately from regular context updates
81
+ */
82
+ type CompositionMetadata = {
83
+ /** The composition ID always required, otherwise whole metadata should not be set */
84
+ compositionId: string;
85
+ /** The matched route from router endpoint. Same as matched project map node pathname */
86
+ matchedRoute?: string;
87
+ /** Dynamic inputs for the route */
88
+ dynamicInputs?: Record<string, string>;
89
+ };
79
90
  /**
80
91
  * Expresses a 'patch' to the Uniform Context state
81
92
  */
@@ -85,6 +96,11 @@ type ContextState = {
85
96
  quirks: Quirks;
86
97
  enrichments: EnrichmentData[];
87
98
  events: EventData[];
99
+ /**
100
+ * Metadata about the composition that is being rendered right now.
101
+ * if you have multiple compositions on the page, please set this one manually.
102
+ */
103
+ compositionMetadata?: CompositionMetadata;
88
104
  };
89
105
  type ContextStateUpdate = {
90
106
  /** The new effective state of the visitor after this state update is applied */
@@ -374,6 +390,7 @@ declare class ManifestInstance {
374
390
  */
375
391
  computeAggregateDimensions(primitiveScores: ScoreVector): ScoreVector;
376
392
  getDimensionByKey(scoreKey: string): EnrichmentCategory | Signal | undefined;
393
+ getAggregateDimensionByKey(scoreKey: string): AggregateDimension | undefined;
377
394
  }
378
395
 
379
396
  interface paths {
@@ -1030,6 +1047,10 @@ type TestVariant = {
1030
1047
  * If not provided, this variant will be selected in equal proportion to other variants without an explicit distribution.
1031
1048
  */
1032
1049
  testDistribution?: number;
1050
+ /** Whether this variant is a control variant.
1051
+ * Can be undefined for backward compatibility with older versions of the SDK which were not explicitly setting the control flag.
1052
+ */
1053
+ control?: boolean;
1033
1054
  };
1034
1055
  /** The result of computing an A/B test result */
1035
1056
  type TestResult<TVariant> = {
@@ -1051,6 +1072,8 @@ interface PersonalizeOptions<TVariant> {
1051
1072
  take?: number;
1052
1073
  /** Name of the personalization selection algorithm to use. Defaults to top-down criteria when not specified. */
1053
1074
  algorithm?: string;
1075
+ /** Composition metadata where the personalization is being rendered for analytics tracking */
1076
+ compositionMetadata?: CompositionMetadata;
1054
1077
  }
1055
1078
  interface PersonalizationSelectionAlgorithmOptions<TCriteria, TVariant extends PersonalizedVariant<TCriteria> = PersonalizedVariant<TCriteria>> {
1056
1079
  /** Name of placement (sent to analytics) */
@@ -1070,6 +1093,8 @@ type TestOptions<TVariant extends TestVariant> = {
1070
1093
  name: string;
1071
1094
  /** Variations that are being tested. */
1072
1095
  variations: TVariant[];
1096
+ /** Composition metadata where the personalization is being rendered for analytics tracking */
1097
+ compositionMetadata?: CompositionMetadata;
1073
1098
  };
1074
1099
  declare const testVariations: <TVariant extends TestVariant>({ name, context, variations, onLogMessage, }: TestOptions<TVariant> & {
1075
1100
  context: Context;
@@ -1092,8 +1117,8 @@ type ContextPlugin = {
1092
1117
  init?: (context: Context) => () => void;
1093
1118
  /** Plugin-specific actions to perform when a user is forgotten */
1094
1119
  forget?: () => Promise<void> | void;
1095
- /** Plugin-specific actions to perform when the visitor context is updated */
1096
- update?: (newData: Partial<ContextState>) => Promise<void> | void;
1120
+ /** Plugin-specific actions to perform when the visitor context is updated, second parameter is the recalculated scores after the update */
1121
+ update?: (newData: Partial<ContextState>, recalculatedScores: ScoreVector) => Promise<void> | void;
1097
1122
  /**
1098
1123
  * Allows the plugin to register named personalization selection algorithms
1099
1124
  *
@@ -1140,6 +1165,12 @@ type PersonalizationEvent = {
1140
1165
  * False: the variant(s) selected were the same as a previous evaluation of this placement.
1141
1166
  */
1142
1167
  changed: boolean;
1168
+ /**
1169
+ * Contains information about the composition that contains personalization wrapper component,
1170
+ * which triggered the personalization event.
1171
+ * Only references top level root composition after pattern resolutions.
1172
+ */
1173
+ compositionMetadata?: CompositionMetadata;
1143
1174
  };
1144
1175
  /** Emitted event when an A/B test runs */
1145
1176
  type TestEvent = {
@@ -1147,12 +1178,22 @@ type TestEvent = {
1147
1178
  name: string;
1148
1179
  /** ID of the variant that was selected */
1149
1180
  variantId: string | undefined;
1181
+ /**
1182
+ * Whether the variant is part of the control group.
1183
+ */
1184
+ control: boolean;
1150
1185
  /**
1151
1186
  * Whether the test variant was newly assigned to the visitor.
1152
1187
  * True: variant was assigned to the visitor for the first time.
1153
1188
  * False: variant was already assigned to the visitor and is being reused.
1154
1189
  */
1155
1190
  variantAssigned: boolean;
1191
+ /**
1192
+ * Contains information about the composition that contains A/B test wrapper component,
1193
+ * which triggered the A/B test event.
1194
+ * Only references top level root composition after pattern resolutions.
1195
+ */
1196
+ compositionMetadata?: CompositionMetadata;
1156
1197
  };
1157
1198
  type ContextEvents = {
1158
1199
  /**
@@ -1176,6 +1217,8 @@ type ContextEvents = {
1176
1217
  testResult: TestEvent;
1177
1218
  /** Personalization variants have been selected */
1178
1219
  personalizationResult: PersonalizationEvent;
1220
+ /** Composition metadata has been set/updated, usually happens when new composition is being rendered during client-side navigation for example */
1221
+ canvasDataUpdated: CompositionMetadata;
1179
1222
  };
1180
1223
  interface ContextInstance {
1181
1224
  get scores(): Readonly<ScoreVector>;
@@ -1197,6 +1240,14 @@ interface ContextInstance {
1197
1240
  internal_processTestEvent(event: TestEvent): void;
1198
1241
  /** @deprecated */
1199
1242
  internal_processPersonalizationEvent(event: PersonalizationEvent): void;
1243
+ /**
1244
+ * Gets the current canvas data
1245
+ */
1246
+ getCompositionMetadata(): Readonly<CompositionMetadata | undefined>;
1247
+ /**
1248
+ * Updates the canvas data and emits a canvasDataUpdated event
1249
+ */
1250
+ updateCompositionMetadata(newData: CompositionMetadata): Promise<void>;
1200
1251
  }
1201
1252
  declare class Context implements ContextInstance {
1202
1253
  #private;
@@ -1266,6 +1317,14 @@ declare class Context implements ContextInstance {
1266
1317
  internal_processTestEvent(event: TestEvent): void;
1267
1318
  /** @deprecated */
1268
1319
  internal_processPersonalizationEvent(event: PersonalizationEvent): void;
1320
+ /**
1321
+ * Gets the current canvas data
1322
+ */
1323
+ getCompositionMetadata(): Readonly<CompositionMetadata | undefined>;
1324
+ /**
1325
+ * Updates the canvas data and emits a canvasDataUpdated event
1326
+ */
1327
+ updateCompositionMetadata(newData: CompositionMetadata): Promise<void>;
1269
1328
  }
1270
1329
 
1271
1330
  /**
@@ -1337,4 +1396,4 @@ declare global {
1337
1396
  }
1338
1397
  }
1339
1398
 
1340
- export { type ManifestV2 as $, type AggregateDimension as A, type DevToolsLogEvent as B, type ContextPlugin as C, type DecayFunction as D, type DevToolsDataEvent as E, type DevToolsHelloEvent as F, type DevToolsUpdateEvent as G, type DevToolsRawCommandsEvent as H, type DevToolsForgetEvent as I, type LogMessages as J, type Severity as K, type LogDrain as L, type MessageCategory as M, type MessageFunc as N, type OutputSeverity as O, type PersonalizedVariant as P, type Quirks as Q, type LogMessageSingle as R, type ScoreVector as S, TransitionDataStore as T, type LogMessageGroup as U, type VisitorData as V, ManifestInstance as W, GroupCriteriaEvaluator as X, type CriteriaEvaluatorResult as Y, type CriteriaEvaluatorParameters as Z, type SignalData as _, type StorageCommands as a, type PersonalizationManifest as a0, type Signal as a1, type SignalCriteriaGroup as a2, type SignalCriteria as a3, type EnrichmentCategory as a4, type NumberMatch as a5, type TestDefinition as a6, type AggregateDimensionInput as a7, type TestOptions as a8, testVariations as a9, type EnrichmentData as aA, type PersonalizeControlVariant as aB, type PersonalizeVariants as aC, type EventData as aD, emptyVisitorData as aE, type ContextState as aF, type ContextStateUpdate as aG, type GoalStateUpdate as aH, type paths as aI, type VariationMatchMetadata as aa, type DimensionMatch as ab, type QuirkMatch as ac, type BehaviorTag as ad, type TestVariant as ae, type TestResult as af, type StorageCommand as ag, type SetGoalCommand as ah, type ModifyScoreCommand as ai, type ModifySessionScoreCommand as aj, type SetConsentCommand as ak, type SetQuirkCommand as al, type SetTestCommand as am, type IdentifyCommand as an, type SetControlGroupCommand as ao, type SetPersonalizeVariantControlCommand as ap, areCommandsEqual as aq, type ServerToClientTransitionState as ar, SERVER_STATE_ID as as, type TransitionDataStoreEvents as at, type DecayOptions as au, type VisitorDataStoreOptions as av, type VisitorDataStoreEvents as aw, VisitorDataStore as ax, type Tests as ay, type Goals as az, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type PersonalizeOptions as g, Context as h, type PersonalizedResult as i, type VariationMatchDimensionCriteria as j, type PersonalizationSelectionAlgorithmOptions as k, type DevToolsEvents as l, CONTEXTUAL_EDITING_TEST_NAME as m, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as n, type PersonalizationSelectionAlgorithm as o, type PersonalizationSelectionAlgorithms as p, type ContextOptions as q, type PersonalizationEventVariantId as r, type PersonalizationEvent as s, type TestEvent as t, type ContextEvents as u, type ContextInstance as v, type DevToolsUiVersion as w, type DevToolsState as x, type DevToolsActions as y, type DevToolsEvent as z };
1399
+ export { type ManifestV2 as $, type AggregateDimension as A, type DevToolsLogEvent as B, type ContextPlugin as C, type DecayFunction as D, type DevToolsDataEvent as E, type DevToolsHelloEvent as F, type DevToolsUpdateEvent as G, type DevToolsRawCommandsEvent as H, type DevToolsForgetEvent as I, type LogMessages as J, type Severity as K, type LogDrain as L, type MessageCategory as M, type MessageFunc as N, type OutputSeverity as O, type PersonalizedVariant as P, type Quirks as Q, type LogMessageSingle as R, type ScoreVector as S, TransitionDataStore as T, type LogMessageGroup as U, type VisitorData as V, ManifestInstance as W, GroupCriteriaEvaluator as X, type CriteriaEvaluatorResult as Y, type CriteriaEvaluatorParameters as Z, type SignalData as _, type StorageCommands as a, type PersonalizationManifest as a0, type Signal as a1, type SignalCriteriaGroup as a2, type SignalCriteria as a3, type EnrichmentCategory as a4, type NumberMatch as a5, type TestDefinition as a6, type AggregateDimensionInput as a7, type TestOptions as a8, testVariations as a9, type EnrichmentData as aA, type PersonalizeControlVariant as aB, type PersonalizeVariants as aC, type EventData as aD, emptyVisitorData as aE, type CompositionMetadata as aF, type ContextState as aG, type ContextStateUpdate as aH, type GoalStateUpdate as aI, type paths as aJ, type VariationMatchMetadata as aa, type DimensionMatch as ab, type QuirkMatch as ac, type BehaviorTag as ad, type TestVariant as ae, type TestResult as af, type StorageCommand as ag, type SetGoalCommand as ah, type ModifyScoreCommand as ai, type ModifySessionScoreCommand as aj, type SetConsentCommand as ak, type SetQuirkCommand as al, type SetTestCommand as am, type IdentifyCommand as an, type SetControlGroupCommand as ao, type SetPersonalizeVariantControlCommand as ap, areCommandsEqual as aq, type ServerToClientTransitionState as ar, SERVER_STATE_ID as as, type TransitionDataStoreEvents as at, type DecayOptions as au, type VisitorDataStoreOptions as av, type VisitorDataStoreEvents as aw, VisitorDataStore as ax, type Tests as ay, type Goals as az, type TransitionDataStoreOptions as b, type CriteriaEvaluator as c, type StringMatch as d, type VariantMatchCriteria as e, type LogMessage as f, type PersonalizeOptions as g, Context as h, type PersonalizedResult as i, type VariationMatchDimensionCriteria as j, type PersonalizationSelectionAlgorithmOptions as k, type DevToolsEvents as l, CONTEXTUAL_EDITING_TEST_NAME as m, CONTEXTUAL_EDITING_TEST_SELECTED_VARIANT_ID as n, type PersonalizationSelectionAlgorithm as o, type PersonalizationSelectionAlgorithms as p, type ContextOptions as q, type PersonalizationEventVariantId as r, type PersonalizationEvent as s, type TestEvent as t, type ContextEvents as u, type ContextInstance as v, type DevToolsUiVersion as w, type DevToolsState as x, type DevToolsActions as y, type DevToolsEvent as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/context",
3
- "version": "20.37.1-alpha.1+5ac67f77a7",
3
+ "version": "20.37.1-alpha.15+2338ab9fcc",
4
4
  "description": "Uniform Context core package",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "5ac67f77a77da73d93c76b9ec23d86acbd0a2123"
75
+ "gitHead": "2338ab9fcc327bb23c4addbfedcd84dfb2ec257c"
76
76
  }