@uniformdev/canvas-next-rsc-shared 19.131.1-alpha.8 → 19.133.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -82,8 +82,6 @@ type UniformServerConfig = {
82
82
  };
83
83
  };
84
84
 
85
- declare const getServerConfig: () => UniformServerConfig;
86
-
87
85
  type PageParameters = {
88
86
  /**
89
87
  * The params object from Next.js router. Used to resolve a composition.
@@ -188,4 +186,4 @@ declare const resolvePath: ({ params }: Pick<PageParameters, 'params'>) => Resol
188
186
 
189
187
  declare function getBaseUrl(): string;
190
188
 
191
- export { type AppDirectoryContext, type AppDirectoryContextState, type AppDirectoryServerContext, type CacheMode, type ComponentProps, type CompositionContext, type PageParameters, type PersonalizeProps, type PersonalizeWithContextComponentProps, type PlaygroundParameters, type ResolvePathResult, type SlotDefinition, type TestProps, type UniformServerConfig, createUniformContext, getBaseUrl, getServerConfig, resolvePath, runPersonalization, runTest };
189
+ export { type AppDirectoryContext, type AppDirectoryContextState, type AppDirectoryServerContext, type CacheMode, type ComponentProps, type CompositionContext, type PageParameters, type PersonalizeProps, type PersonalizeWithContextComponentProps, type PlaygroundParameters, type ResolvePathResult, type SlotDefinition, type TestProps, type UniformServerConfig, createUniformContext, getBaseUrl, resolvePath, runPersonalization, runTest };
package/dist/index.d.ts CHANGED
@@ -82,8 +82,6 @@ type UniformServerConfig = {
82
82
  };
83
83
  };
84
84
 
85
- declare const getServerConfig: () => UniformServerConfig;
86
-
87
85
  type PageParameters = {
88
86
  /**
89
87
  * The params object from Next.js router. Used to resolve a composition.
@@ -188,4 +186,4 @@ declare const resolvePath: ({ params }: Pick<PageParameters, 'params'>) => Resol
188
186
 
189
187
  declare function getBaseUrl(): string;
190
188
 
191
- export { type AppDirectoryContext, type AppDirectoryContextState, type AppDirectoryServerContext, type CacheMode, type ComponentProps, type CompositionContext, type PageParameters, type PersonalizeProps, type PersonalizeWithContextComponentProps, type PlaygroundParameters, type ResolvePathResult, type SlotDefinition, type TestProps, type UniformServerConfig, createUniformContext, getBaseUrl, getServerConfig, resolvePath, runPersonalization, runTest };
189
+ export { type AppDirectoryContext, type AppDirectoryContextState, type AppDirectoryServerContext, type CacheMode, type ComponentProps, type CompositionContext, type PageParameters, type PersonalizeProps, type PersonalizeWithContextComponentProps, type PlaygroundParameters, type ResolvePathResult, type SlotDefinition, type TestProps, type UniformServerConfig, createUniformContext, getBaseUrl, resolvePath, runPersonalization, runTest };
package/dist/index.esm.js CHANGED
@@ -1,24 +1,3 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined")
5
- return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
-
9
- // src/config/helpers.ts
10
- var getServerConfig = () => {
11
- let serverConfig;
12
- try {
13
- serverConfig = __require("uniform.server.config.js");
14
- } catch (e) {
15
- serverConfig = {
16
- defaultConsent: false
17
- };
18
- }
19
- return serverConfig;
20
- };
21
-
22
1
  // src/context/createUniformContext.ts
23
2
  import { Context, CookieTransitionDataStore } from "@uniformdev/context";
24
3
 
@@ -78,10 +57,8 @@ var createUniformContext = ({
78
57
  serverCookieValue,
79
58
  ...rest
80
59
  }) => {
81
- var _a;
82
60
  const context = new Context({
83
61
  ...rest,
84
- defaultConsent: (_a = getServerConfig()) == null ? void 0 : _a.defaultConsent,
85
62
  transitionStore: new CookieTransitionDataStore({
86
63
  serverCookieValue
87
64
  })
@@ -171,7 +148,10 @@ var runPersonalization = ({
171
148
  if (variations) {
172
149
  for (let i = 0; i < variations.length; i++) {
173
150
  indexes.push(variations[i].index);
174
- variantIds.push(variations[i].id);
151
+ variantIds.push({
152
+ id: variations[i].id,
153
+ control: variations[i].control
154
+ });
175
155
  }
176
156
  }
177
157
  } else {
@@ -186,7 +166,12 @@ var runPersonalization = ({
186
166
  }
187
167
  }
188
168
  indexes.push(...defaults);
189
- variantIds.push(...defaults.map((i) => componentVariations[i].id));
169
+ variantIds.push(
170
+ ...defaults.map((i) => ({
171
+ id: componentVariations[i].id,
172
+ control: false
173
+ }))
174
+ );
190
175
  }
191
176
  const event = {
192
177
  name: trackingEventName,
@@ -251,7 +236,6 @@ var runTest = ({
251
236
  export {
252
237
  createUniformContext,
253
238
  getBaseUrl,
254
- getServerConfig,
255
239
  resolvePath,
256
240
  runPersonalization,
257
241
  runTest
package/dist/index.js CHANGED
@@ -22,26 +22,12 @@ var src_exports = {};
22
22
  __export(src_exports, {
23
23
  createUniformContext: () => createUniformContext,
24
24
  getBaseUrl: () => getBaseUrl,
25
- getServerConfig: () => getServerConfig,
26
25
  resolvePath: () => resolvePath,
27
26
  runPersonalization: () => runPersonalization,
28
27
  runTest: () => runTest
29
28
  });
30
29
  module.exports = __toCommonJS(src_exports);
31
30
 
32
- // src/config/helpers.ts
33
- var getServerConfig = () => {
34
- let serverConfig;
35
- try {
36
- serverConfig = require("uniform.server.config.js");
37
- } catch (e) {
38
- serverConfig = {
39
- defaultConsent: false
40
- };
41
- }
42
- return serverConfig;
43
- };
44
-
45
31
  // src/context/createUniformContext.ts
46
32
  var import_context = require("@uniformdev/context");
47
33
 
@@ -101,10 +87,8 @@ var createUniformContext = ({
101
87
  serverCookieValue,
102
88
  ...rest
103
89
  }) => {
104
- var _a;
105
90
  const context = new import_context.Context({
106
91
  ...rest,
107
- defaultConsent: (_a = getServerConfig()) == null ? void 0 : _a.defaultConsent,
108
92
  transitionStore: new import_context.CookieTransitionDataStore({
109
93
  serverCookieValue
110
94
  })
@@ -194,7 +178,10 @@ var runPersonalization = ({
194
178
  if (variations) {
195
179
  for (let i = 0; i < variations.length; i++) {
196
180
  indexes.push(variations[i].index);
197
- variantIds.push(variations[i].id);
181
+ variantIds.push({
182
+ id: variations[i].id,
183
+ control: variations[i].control
184
+ });
198
185
  }
199
186
  }
200
187
  } else {
@@ -209,7 +196,12 @@ var runPersonalization = ({
209
196
  }
210
197
  }
211
198
  indexes.push(...defaults);
212
- variantIds.push(...defaults.map((i) => componentVariations[i].id));
199
+ variantIds.push(
200
+ ...defaults.map((i) => ({
201
+ id: componentVariations[i].id,
202
+ control: false
203
+ }))
204
+ );
213
205
  }
214
206
  const event = {
215
207
  name: trackingEventName,
@@ -275,7 +267,6 @@ var runTest = ({
275
267
  0 && (module.exports = {
276
268
  createUniformContext,
277
269
  getBaseUrl,
278
- getServerConfig,
279
270
  resolvePath,
280
271
  runPersonalization,
281
272
  runTest
package/dist/index.mjs CHANGED
@@ -1,24 +1,3 @@
1
- var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
- get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
- }) : x)(function(x) {
4
- if (typeof require !== "undefined")
5
- return require.apply(this, arguments);
6
- throw Error('Dynamic require of "' + x + '" is not supported');
7
- });
8
-
9
- // src/config/helpers.ts
10
- var getServerConfig = () => {
11
- let serverConfig;
12
- try {
13
- serverConfig = __require("uniform.server.config.js");
14
- } catch (e) {
15
- serverConfig = {
16
- defaultConsent: false
17
- };
18
- }
19
- return serverConfig;
20
- };
21
-
22
1
  // src/context/createUniformContext.ts
23
2
  import { Context, CookieTransitionDataStore } from "@uniformdev/context";
24
3
 
@@ -78,10 +57,8 @@ var createUniformContext = ({
78
57
  serverCookieValue,
79
58
  ...rest
80
59
  }) => {
81
- var _a;
82
60
  const context = new Context({
83
61
  ...rest,
84
- defaultConsent: (_a = getServerConfig()) == null ? void 0 : _a.defaultConsent,
85
62
  transitionStore: new CookieTransitionDataStore({
86
63
  serverCookieValue
87
64
  })
@@ -171,7 +148,10 @@ var runPersonalization = ({
171
148
  if (variations) {
172
149
  for (let i = 0; i < variations.length; i++) {
173
150
  indexes.push(variations[i].index);
174
- variantIds.push(variations[i].id);
151
+ variantIds.push({
152
+ id: variations[i].id,
153
+ control: variations[i].control
154
+ });
175
155
  }
176
156
  }
177
157
  } else {
@@ -186,7 +166,12 @@ var runPersonalization = ({
186
166
  }
187
167
  }
188
168
  indexes.push(...defaults);
189
- variantIds.push(...defaults.map((i) => componentVariations[i].id));
169
+ variantIds.push(
170
+ ...defaults.map((i) => ({
171
+ id: componentVariations[i].id,
172
+ control: false
173
+ }))
174
+ );
190
175
  }
191
176
  const event = {
192
177
  name: trackingEventName,
@@ -251,7 +236,6 @@ var runTest = ({
251
236
  export {
252
237
  createUniformContext,
253
238
  getBaseUrl,
254
- getServerConfig,
255
239
  resolvePath,
256
240
  runPersonalization,
257
241
  runTest
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-next-rsc-shared",
3
- "version": "19.131.1-alpha.8+d326c2787d",
3
+ "version": "19.133.0",
4
4
  "license": "SEE LICENSE IN LICENSE.txt",
5
5
  "scripts": {
6
6
  "build": "tsup",
@@ -32,8 +32,8 @@
32
32
  "react-dom": "18.2.0"
33
33
  },
34
34
  "dependencies": {
35
- "@uniformdev/canvas": "19.131.1-alpha.8+d326c2787d",
36
- "@uniformdev/context": "19.131.1-alpha.8+d326c2787d"
35
+ "@uniformdev/canvas": "19.133.0",
36
+ "@uniformdev/context": "19.133.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=16.14.0"
@@ -46,5 +46,5 @@
46
46
  "publishConfig": {
47
47
  "access": "public"
48
48
  },
49
- "gitHead": "d326c2787d0b159fcd7edb45b165a8eae54862e6"
49
+ "gitHead": "405a628b0f592ca13bf65006ef5c92261468c144"
50
50
  }