@uniformdev/canvas-next-rsc-shared 19.199.0 → 19.199.1-alpha.10
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 +9 -3
- package/dist/index.d.ts +9 -3
- package/dist/index.esm.js +11 -3
- package/dist/index.js +11 -3
- package/dist/index.mjs +11 -3
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -56,7 +56,7 @@ type UniformServerConfig = {
|
|
|
56
56
|
/**
|
|
57
57
|
* Configure where personalization components should be evaluated.
|
|
58
58
|
*/
|
|
59
|
-
personalization: 'client' | 'server';
|
|
59
|
+
personalization: 'client' | 'server' | 'hybrid';
|
|
60
60
|
/**
|
|
61
61
|
* Configure where testing components should be evaluated.
|
|
62
62
|
*/
|
|
@@ -86,6 +86,10 @@ type UniformServerConfig = {
|
|
|
86
86
|
* Enables visual editing mode.
|
|
87
87
|
*/
|
|
88
88
|
vercelVisualEditing?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* When enabled, quirks will be serialized to a cookie so they are available on the server.
|
|
91
|
+
*/
|
|
92
|
+
quirkSerialization?: boolean;
|
|
89
93
|
};
|
|
90
94
|
ppr?: {
|
|
91
95
|
/**
|
|
@@ -167,8 +171,10 @@ type AppDirectoryServerContext = Omit<AppDirectoryContext, 'update'>;
|
|
|
167
171
|
type CreateUniformContextOptions = Omit<ContextOptions, 'transitionStore'> & {
|
|
168
172
|
serverCookieValue: string | undefined;
|
|
169
173
|
cookieAttributes?: CookieTransitionDataStoreOptions['cookieAttributes'];
|
|
174
|
+
quirkCookieValue?: string;
|
|
175
|
+
experimental_quirksEnabled?: CookieTransitionDataStoreOptions['experimental_quirksEnabled'];
|
|
170
176
|
};
|
|
171
|
-
declare const createUniformContext: ({ serverCookieValue, cookieAttributes, ...rest }: CreateUniformContextOptions) => AppDirectoryContextInstance;
|
|
177
|
+
declare const createUniformContext: ({ serverCookieValue, quirkCookieValue, experimental_quirksEnabled, cookieAttributes, ...rest }: CreateUniformContextOptions) => AppDirectoryContextInstance;
|
|
172
178
|
declare class AppDirectoryContextInstance implements AppDirectoryContext {
|
|
173
179
|
#private;
|
|
174
180
|
readonly manifest: ContextInstance['manifest'];
|
|
@@ -212,7 +218,7 @@ type TestProps = {
|
|
|
212
218
|
test: string;
|
|
213
219
|
};
|
|
214
220
|
|
|
215
|
-
declare const runTest: ({ test, component, contextInstance, }: ComponentProps<TestProps> & {
|
|
221
|
+
declare const runTest: ({ test, component, contextInstance, context, }: ComponentProps<TestProps> & {
|
|
216
222
|
contextInstance: Pick<ContextInstance, "test" | "manifest"> | undefined;
|
|
217
223
|
}) => {
|
|
218
224
|
index: number | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ type UniformServerConfig = {
|
|
|
56
56
|
/**
|
|
57
57
|
* Configure where personalization components should be evaluated.
|
|
58
58
|
*/
|
|
59
|
-
personalization: 'client' | 'server';
|
|
59
|
+
personalization: 'client' | 'server' | 'hybrid';
|
|
60
60
|
/**
|
|
61
61
|
* Configure where testing components should be evaluated.
|
|
62
62
|
*/
|
|
@@ -86,6 +86,10 @@ type UniformServerConfig = {
|
|
|
86
86
|
* Enables visual editing mode.
|
|
87
87
|
*/
|
|
88
88
|
vercelVisualEditing?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* When enabled, quirks will be serialized to a cookie so they are available on the server.
|
|
91
|
+
*/
|
|
92
|
+
quirkSerialization?: boolean;
|
|
89
93
|
};
|
|
90
94
|
ppr?: {
|
|
91
95
|
/**
|
|
@@ -167,8 +171,10 @@ type AppDirectoryServerContext = Omit<AppDirectoryContext, 'update'>;
|
|
|
167
171
|
type CreateUniformContextOptions = Omit<ContextOptions, 'transitionStore'> & {
|
|
168
172
|
serverCookieValue: string | undefined;
|
|
169
173
|
cookieAttributes?: CookieTransitionDataStoreOptions['cookieAttributes'];
|
|
174
|
+
quirkCookieValue?: string;
|
|
175
|
+
experimental_quirksEnabled?: CookieTransitionDataStoreOptions['experimental_quirksEnabled'];
|
|
170
176
|
};
|
|
171
|
-
declare const createUniformContext: ({ serverCookieValue, cookieAttributes, ...rest }: CreateUniformContextOptions) => AppDirectoryContextInstance;
|
|
177
|
+
declare const createUniformContext: ({ serverCookieValue, quirkCookieValue, experimental_quirksEnabled, cookieAttributes, ...rest }: CreateUniformContextOptions) => AppDirectoryContextInstance;
|
|
172
178
|
declare class AppDirectoryContextInstance implements AppDirectoryContext {
|
|
173
179
|
#private;
|
|
174
180
|
readonly manifest: ContextInstance['manifest'];
|
|
@@ -212,7 +218,7 @@ type TestProps = {
|
|
|
212
218
|
test: string;
|
|
213
219
|
};
|
|
214
220
|
|
|
215
|
-
declare const runTest: ({ test, component, contextInstance, }: ComponentProps<TestProps> & {
|
|
221
|
+
declare const runTest: ({ test, component, contextInstance, context, }: ComponentProps<TestProps> & {
|
|
216
222
|
contextInstance: Pick<ContextInstance, "test" | "manifest"> | undefined;
|
|
217
223
|
}) => {
|
|
218
224
|
index: number | null;
|
package/dist/index.esm.js
CHANGED
|
@@ -66,6 +66,8 @@ function getBaseUrl() {
|
|
|
66
66
|
// src/context/createUniformContext.ts
|
|
67
67
|
var createUniformContext = ({
|
|
68
68
|
serverCookieValue,
|
|
69
|
+
quirkCookieValue,
|
|
70
|
+
experimental_quirksEnabled,
|
|
69
71
|
cookieAttributes,
|
|
70
72
|
...rest
|
|
71
73
|
}) => {
|
|
@@ -73,7 +75,9 @@ var createUniformContext = ({
|
|
|
73
75
|
...rest,
|
|
74
76
|
transitionStore: new CookieTransitionDataStore({
|
|
75
77
|
serverCookieValue,
|
|
76
|
-
|
|
78
|
+
quirkCookieValue,
|
|
79
|
+
cookieAttributes,
|
|
80
|
+
experimental_quirksEnabled
|
|
77
81
|
})
|
|
78
82
|
});
|
|
79
83
|
const wrapped = new AppDirectoryContextInstance(context);
|
|
@@ -244,14 +248,18 @@ var runPersonalization = ({
|
|
|
244
248
|
|
|
245
249
|
// src/runTest.ts
|
|
246
250
|
import { CANVAS_TEST_SLOT, CANVAS_TEST_VARIANT_PARAM } from "@uniformdev/canvas";
|
|
251
|
+
import { CONTEXTUAL_EDITING_TEST_NAME } from "@uniformdev/context";
|
|
247
252
|
var runTest = ({
|
|
248
253
|
test,
|
|
249
254
|
component,
|
|
250
|
-
contextInstance
|
|
255
|
+
contextInstance,
|
|
256
|
+
context
|
|
251
257
|
}) => {
|
|
252
258
|
var _a, _b;
|
|
253
259
|
const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
|
|
254
|
-
|
|
260
|
+
const isContextualTest = context.isContextualEditing && test === CONTEXTUAL_EDITING_TEST_NAME;
|
|
261
|
+
const shouldShowTest = isTestDefined || isContextualTest;
|
|
262
|
+
if (!shouldShowTest && process.env.NODE_ENV !== "production") {
|
|
255
263
|
console.warn(`Test "${test}" is not defined in Uniform manifest.`);
|
|
256
264
|
return {
|
|
257
265
|
index: null,
|
package/dist/index.js
CHANGED
|
@@ -93,6 +93,8 @@ function getBaseUrl() {
|
|
|
93
93
|
// src/context/createUniformContext.ts
|
|
94
94
|
var createUniformContext = ({
|
|
95
95
|
serverCookieValue,
|
|
96
|
+
quirkCookieValue,
|
|
97
|
+
experimental_quirksEnabled,
|
|
96
98
|
cookieAttributes,
|
|
97
99
|
...rest
|
|
98
100
|
}) => {
|
|
@@ -100,7 +102,9 @@ var createUniformContext = ({
|
|
|
100
102
|
...rest,
|
|
101
103
|
transitionStore: new import_context.CookieTransitionDataStore({
|
|
102
104
|
serverCookieValue,
|
|
103
|
-
|
|
105
|
+
quirkCookieValue,
|
|
106
|
+
cookieAttributes,
|
|
107
|
+
experimental_quirksEnabled
|
|
104
108
|
})
|
|
105
109
|
});
|
|
106
110
|
const wrapped = new AppDirectoryContextInstance(context);
|
|
@@ -271,14 +275,18 @@ var runPersonalization = ({
|
|
|
271
275
|
|
|
272
276
|
// src/runTest.ts
|
|
273
277
|
var import_canvas2 = require("@uniformdev/canvas");
|
|
278
|
+
var import_context2 = require("@uniformdev/context");
|
|
274
279
|
var runTest = ({
|
|
275
280
|
test,
|
|
276
281
|
component,
|
|
277
|
-
contextInstance
|
|
282
|
+
contextInstance,
|
|
283
|
+
context
|
|
278
284
|
}) => {
|
|
279
285
|
var _a, _b;
|
|
280
286
|
const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
|
|
281
|
-
|
|
287
|
+
const isContextualTest = context.isContextualEditing && test === import_context2.CONTEXTUAL_EDITING_TEST_NAME;
|
|
288
|
+
const shouldShowTest = isTestDefined || isContextualTest;
|
|
289
|
+
if (!shouldShowTest && process.env.NODE_ENV !== "production") {
|
|
282
290
|
console.warn(`Test "${test}" is not defined in Uniform manifest.`);
|
|
283
291
|
return {
|
|
284
292
|
index: null,
|
package/dist/index.mjs
CHANGED
|
@@ -66,6 +66,8 @@ function getBaseUrl() {
|
|
|
66
66
|
// src/context/createUniformContext.ts
|
|
67
67
|
var createUniformContext = ({
|
|
68
68
|
serverCookieValue,
|
|
69
|
+
quirkCookieValue,
|
|
70
|
+
experimental_quirksEnabled,
|
|
69
71
|
cookieAttributes,
|
|
70
72
|
...rest
|
|
71
73
|
}) => {
|
|
@@ -73,7 +75,9 @@ var createUniformContext = ({
|
|
|
73
75
|
...rest,
|
|
74
76
|
transitionStore: new CookieTransitionDataStore({
|
|
75
77
|
serverCookieValue,
|
|
76
|
-
|
|
78
|
+
quirkCookieValue,
|
|
79
|
+
cookieAttributes,
|
|
80
|
+
experimental_quirksEnabled
|
|
77
81
|
})
|
|
78
82
|
});
|
|
79
83
|
const wrapped = new AppDirectoryContextInstance(context);
|
|
@@ -244,14 +248,18 @@ var runPersonalization = ({
|
|
|
244
248
|
|
|
245
249
|
// src/runTest.ts
|
|
246
250
|
import { CANVAS_TEST_SLOT, CANVAS_TEST_VARIANT_PARAM } from "@uniformdev/canvas";
|
|
251
|
+
import { CONTEXTUAL_EDITING_TEST_NAME } from "@uniformdev/context";
|
|
247
252
|
var runTest = ({
|
|
248
253
|
test,
|
|
249
254
|
component,
|
|
250
|
-
contextInstance
|
|
255
|
+
contextInstance,
|
|
256
|
+
context
|
|
251
257
|
}) => {
|
|
252
258
|
var _a, _b;
|
|
253
259
|
const isTestDefined = Boolean((_a = contextInstance == null ? void 0 : contextInstance.manifest.data.project.test) == null ? void 0 : _a[test]);
|
|
254
|
-
|
|
260
|
+
const isContextualTest = context.isContextualEditing && test === CONTEXTUAL_EDITING_TEST_NAME;
|
|
261
|
+
const shouldShowTest = isTestDefined || isContextualTest;
|
|
262
|
+
if (!shouldShowTest && process.env.NODE_ENV !== "production") {
|
|
255
263
|
console.warn(`Test "${test}" is not defined in Uniform manifest.`);
|
|
256
264
|
return {
|
|
257
265
|
index: null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc-shared",
|
|
3
|
-
"version": "19.199.
|
|
3
|
+
"version": "19.199.1-alpha.10+7f62130189",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -24,16 +24,16 @@
|
|
|
24
24
|
"/dist"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/node": "
|
|
28
|
-
"@types/react": "18.3.
|
|
27
|
+
"@types/node": "22.7.8",
|
|
28
|
+
"@types/react": "18.3.11",
|
|
29
29
|
"eslint": "9.9.0",
|
|
30
30
|
"next": "^14.0.0",
|
|
31
31
|
"react": "18.3.1",
|
|
32
32
|
"react-dom": "18.3.1"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@uniformdev/canvas": "19.199.
|
|
36
|
-
"@uniformdev/context": "19.199.
|
|
35
|
+
"@uniformdev/canvas": "19.199.1-alpha.10+7f62130189",
|
|
36
|
+
"@uniformdev/context": "19.199.1-alpha.10+7f62130189"
|
|
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": "
|
|
49
|
+
"gitHead": "7f62130189d43f7ecaaed0a41c929e5c166860d2"
|
|
50
50
|
}
|