@uniformdev/canvas-next-rsc-client 20.6.2-alpha.11 → 20.7.1-alpha.102
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/LICENSE.txt +1 -1
- package/dist/index.d.mts +5 -7
- package/dist/index.d.ts +5 -7
- package/dist/index.esm.js +23 -110
- package/dist/index.js +21 -109
- package/dist/index.mjs +23 -110
- package/package.json +13 -12
package/LICENSE.txt
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
©
|
|
1
|
+
© 2025 Uniform Systems, Inc. All Rights Reserved.
|
|
2
2
|
See details of Uniform Systems, Inc. Master Subscription Agreement here: https://uniform.dev/eula
|
package/dist/index.d.mts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ManifestV2, TestEvent, Quirks, ScoreVector } from '@uniformdev/context';
|
|
1
|
+
import { ManifestV2, PersonalizationEvent, TestEvent, CompositionMetadata, Quirks, ScoreVector } from '@uniformdev/context';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, PropsWithChildren } from 'react';
|
|
4
|
-
import { PersonalizationEvent } from '@uniformdev/context/*';
|
|
5
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
5
|
import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core';
|
|
7
6
|
import * as _uniformdev_canvas_next_rsc_shared from '@uniformdev/canvas-next-rsc-shared';
|
|
8
|
-
import { AppDirectoryContextState,
|
|
7
|
+
import { AppDirectoryContextState, ComponentProps, PersonalizeProps, TestProps, CreateUniformContextOptions, AppDirectoryContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
9
8
|
import { VisibilityParameterValue, ComponentInstance, UpdateContextualEditingStateInternalMessage } from '@uniformdev/canvas';
|
|
10
9
|
|
|
11
10
|
type ClientContextComponentProps = {
|
|
@@ -41,8 +40,9 @@ declare const ClientContextTestTransfer: ({ event, ts }: {
|
|
|
41
40
|
|
|
42
41
|
declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react_jsx_runtime.JSX.Element;
|
|
43
42
|
|
|
44
|
-
declare const ClientContextUpdate: ({ path }: {
|
|
43
|
+
declare const ClientContextUpdate: ({ path, compositionMetadata, }: {
|
|
45
44
|
path: string;
|
|
45
|
+
compositionMetadata: CompositionMetadata;
|
|
46
46
|
}) => react_jsx_runtime.JSX.Element;
|
|
47
47
|
|
|
48
48
|
declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
|
@@ -52,10 +52,8 @@ declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
|
|
52
52
|
|
|
53
53
|
declare const DefaultUniformClientContext: ClientContextComponent;
|
|
54
54
|
|
|
55
|
-
interface PersonalizeClientProps extends PersonalizeProps {
|
|
55
|
+
interface PersonalizeClientProps extends ComponentProps<PersonalizeProps> {
|
|
56
56
|
indexes: number[];
|
|
57
|
-
slots: ComponentProps['slots'];
|
|
58
|
-
component: ComponentProps['component'];
|
|
59
57
|
}
|
|
60
58
|
declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement<{
|
|
61
59
|
children?: react.ReactNode | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { ManifestV2, TestEvent, Quirks, ScoreVector } from '@uniformdev/context';
|
|
1
|
+
import { ManifestV2, PersonalizationEvent, TestEvent, CompositionMetadata, Quirks, ScoreVector } from '@uniformdev/context';
|
|
2
2
|
import * as react from 'react';
|
|
3
3
|
import { ReactNode, PropsWithChildren } from 'react';
|
|
4
|
-
import { PersonalizationEvent } from '@uniformdev/context/*';
|
|
5
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
5
|
import { PureContextualEditingComponentWrapperProps } from '@uniformdev/canvas-react/core';
|
|
7
6
|
import * as _uniformdev_canvas_next_rsc_shared from '@uniformdev/canvas-next-rsc-shared';
|
|
8
|
-
import { AppDirectoryContextState,
|
|
7
|
+
import { AppDirectoryContextState, ComponentProps, PersonalizeProps, TestProps, CreateUniformContextOptions, AppDirectoryContext } from '@uniformdev/canvas-next-rsc-shared';
|
|
9
8
|
import { VisibilityParameterValue, ComponentInstance, UpdateContextualEditingStateInternalMessage } from '@uniformdev/canvas';
|
|
10
9
|
|
|
11
10
|
type ClientContextComponentProps = {
|
|
@@ -41,8 +40,9 @@ declare const ClientContextTestTransfer: ({ event, ts }: {
|
|
|
41
40
|
|
|
42
41
|
declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react_jsx_runtime.JSX.Element;
|
|
43
42
|
|
|
44
|
-
declare const ClientContextUpdate: ({ path }: {
|
|
43
|
+
declare const ClientContextUpdate: ({ path, compositionMetadata, }: {
|
|
45
44
|
path: string;
|
|
45
|
+
compositionMetadata: CompositionMetadata;
|
|
46
46
|
}) => react_jsx_runtime.JSX.Element;
|
|
47
47
|
|
|
48
48
|
declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
|
@@ -52,10 +52,8 @@ declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
|
|
52
52
|
|
|
53
53
|
declare const DefaultUniformClientContext: ClientContextComponent;
|
|
54
54
|
|
|
55
|
-
interface PersonalizeClientProps extends PersonalizeProps {
|
|
55
|
+
interface PersonalizeClientProps extends ComponentProps<PersonalizeProps> {
|
|
56
56
|
indexes: number[];
|
|
57
|
-
slots: ComponentProps['slots'];
|
|
58
|
-
component: ComponentProps['component'];
|
|
59
57
|
}
|
|
60
58
|
declare const PersonalizeClient: (props: PersonalizeClientProps) => react.FunctionComponentElement<{
|
|
61
59
|
children?: react.ReactNode | undefined;
|
package/dist/index.esm.js
CHANGED
|
@@ -295,16 +295,24 @@ var ClientContextualEditingComponentWrapperInner = ({
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// src/components/ClientContextUpdate.tsx
|
|
298
|
+
import Cookies from "js-cookie";
|
|
298
299
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
299
300
|
import { Suspense as Suspense2, useEffect as useEffect4 } from "react";
|
|
300
301
|
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
301
|
-
var ClientContextUpdate = ({
|
|
302
|
-
|
|
302
|
+
var ClientContextUpdate = ({
|
|
303
|
+
path,
|
|
304
|
+
compositionMetadata
|
|
305
|
+
}) => {
|
|
306
|
+
return /* @__PURE__ */ jsx2(Suspense2, { children: /* @__PURE__ */ jsx2(ClientContextUpdateInner, { path, compositionMetadata }) });
|
|
303
307
|
};
|
|
304
|
-
var ClientContextUpdateInner = ({
|
|
308
|
+
var ClientContextUpdateInner = ({
|
|
309
|
+
path,
|
|
310
|
+
compositionMetadata
|
|
311
|
+
}) => {
|
|
305
312
|
const searchParams = useSearchParams2();
|
|
306
313
|
const { context } = useUniformContext();
|
|
307
314
|
useEffect4(() => {
|
|
315
|
+
var _a;
|
|
308
316
|
if (!context || typeof window === "undefined") {
|
|
309
317
|
return;
|
|
310
318
|
}
|
|
@@ -313,9 +321,11 @@ var ClientContextUpdateInner = ({ path }) => {
|
|
|
313
321
|
params: {
|
|
314
322
|
path: path.split("/").filter(Boolean)
|
|
315
323
|
},
|
|
316
|
-
|
|
324
|
+
cookies: (_a = Cookies.get()) != null ? _a : {},
|
|
325
|
+
searchParams: convertedSearchParams,
|
|
326
|
+
compositionMetadata
|
|
317
327
|
});
|
|
318
|
-
}, [path, searchParams, context]);
|
|
328
|
+
}, [path, searchParams, context, compositionMetadata]);
|
|
319
329
|
return /* @__PURE__ */ jsx2(Fragment2, {});
|
|
320
330
|
};
|
|
321
331
|
|
|
@@ -364,105 +374,8 @@ function dequal(foo, bar) {
|
|
|
364
374
|
return foo !== foo && bar !== bar;
|
|
365
375
|
}
|
|
366
376
|
|
|
367
|
-
// ../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
|
|
368
|
-
function assign(target) {
|
|
369
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
370
|
-
var source = arguments[i];
|
|
371
|
-
for (var key in source) {
|
|
372
|
-
target[key] = source[key];
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return target;
|
|
376
|
-
}
|
|
377
|
-
var defaultConverter = {
|
|
378
|
-
read: function(value) {
|
|
379
|
-
if (value[0] === '"') {
|
|
380
|
-
value = value.slice(1, -1);
|
|
381
|
-
}
|
|
382
|
-
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
383
|
-
},
|
|
384
|
-
write: function(value) {
|
|
385
|
-
return encodeURIComponent(value).replace(
|
|
386
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
387
|
-
decodeURIComponent
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
function init(converter, defaultAttributes) {
|
|
392
|
-
function set(name, value, attributes) {
|
|
393
|
-
if (typeof document === "undefined") {
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
attributes = assign({}, defaultAttributes, attributes);
|
|
397
|
-
if (typeof attributes.expires === "number") {
|
|
398
|
-
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
399
|
-
}
|
|
400
|
-
if (attributes.expires) {
|
|
401
|
-
attributes.expires = attributes.expires.toUTCString();
|
|
402
|
-
}
|
|
403
|
-
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
404
|
-
var stringifiedAttributes = "";
|
|
405
|
-
for (var attributeName in attributes) {
|
|
406
|
-
if (!attributes[attributeName]) {
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
stringifiedAttributes += "; " + attributeName;
|
|
410
|
-
if (attributes[attributeName] === true) {
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
414
|
-
}
|
|
415
|
-
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
|
416
|
-
}
|
|
417
|
-
function get(name) {
|
|
418
|
-
if (typeof document === "undefined" || arguments.length && !name) {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
422
|
-
var jar = {};
|
|
423
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
424
|
-
var parts = cookies[i].split("=");
|
|
425
|
-
var value = parts.slice(1).join("=");
|
|
426
|
-
try {
|
|
427
|
-
var found = decodeURIComponent(parts[0]);
|
|
428
|
-
jar[found] = converter.read(value, found);
|
|
429
|
-
if (name === found) {
|
|
430
|
-
break;
|
|
431
|
-
}
|
|
432
|
-
} catch (e) {
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
return name ? jar[name] : jar;
|
|
436
|
-
}
|
|
437
|
-
return Object.create(
|
|
438
|
-
{
|
|
439
|
-
set,
|
|
440
|
-
get,
|
|
441
|
-
remove: function(name, attributes) {
|
|
442
|
-
set(
|
|
443
|
-
name,
|
|
444
|
-
"",
|
|
445
|
-
assign({}, attributes, {
|
|
446
|
-
expires: -1
|
|
447
|
-
})
|
|
448
|
-
);
|
|
449
|
-
},
|
|
450
|
-
withAttributes: function(attributes) {
|
|
451
|
-
return init(this.converter, assign({}, this.attributes, attributes));
|
|
452
|
-
},
|
|
453
|
-
withConverter: function(converter2) {
|
|
454
|
-
return init(assign({}, this.converter, converter2), this.attributes);
|
|
455
|
-
}
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
attributes: { value: Object.freeze(defaultAttributes) },
|
|
459
|
-
converter: { value: Object.freeze(converter) }
|
|
460
|
-
}
|
|
461
|
-
);
|
|
462
|
-
}
|
|
463
|
-
var api = init(defaultConverter, { path: "/" });
|
|
464
|
-
|
|
465
377
|
// ../context/dist/index.mjs
|
|
378
|
+
import Cookies2 from "js-cookie";
|
|
466
379
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
467
380
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
468
381
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -998,7 +911,8 @@ var TestClient = (props) => {
|
|
|
998
911
|
import {
|
|
999
912
|
createCanvasChannel,
|
|
1000
913
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM as IN_CONTEXT_EDITOR_QUERY_STRING_PARAM2,
|
|
1001
|
-
isAllowedReferrer
|
|
914
|
+
isAllowedReferrer,
|
|
915
|
+
version
|
|
1002
916
|
} from "@uniformdev/canvas";
|
|
1003
917
|
import { useRouter as useRouter2, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
1004
918
|
import { useEffect as useEffect8, useMemo as useMemo2, useRef } from "react";
|
|
@@ -1032,6 +946,9 @@ var UniformScript = () => {
|
|
|
1032
946
|
needsToRefreshRef.current = true;
|
|
1033
947
|
}
|
|
1034
948
|
});
|
|
949
|
+
channel.ready({
|
|
950
|
+
rsc: true
|
|
951
|
+
});
|
|
1035
952
|
return () => {
|
|
1036
953
|
unsubscribeFromEditorUpdates();
|
|
1037
954
|
};
|
|
@@ -1046,7 +963,8 @@ var UniformScript = () => {
|
|
|
1046
963
|
const textHost = isAllowedReferrer(window.document.referrer) ? window.document.referrer : "https://uniform.app/";
|
|
1047
964
|
window.__UNIFORM_CONTEXTUAL_EDITING__ = {
|
|
1048
965
|
framework: "React",
|
|
1049
|
-
version: 2
|
|
966
|
+
version: 2,
|
|
967
|
+
canvasPackageVersion: version
|
|
1050
968
|
};
|
|
1051
969
|
const bundleHost = new URL(textHost);
|
|
1052
970
|
bundleHost.pathname = "/files/canvas-in-context-embed/index.js";
|
|
@@ -1215,8 +1133,3 @@ export {
|
|
|
1215
1133
|
useUniformContext,
|
|
1216
1134
|
useUniformContextualEditingState
|
|
1217
1135
|
};
|
|
1218
|
-
/*! Bundled license information:
|
|
1219
|
-
|
|
1220
|
-
js-cookie/dist/js.cookie.mjs:
|
|
1221
|
-
(*! js-cookie v3.0.5 | MIT *)
|
|
1222
|
-
*/
|
package/dist/index.js
CHANGED
|
@@ -321,16 +321,24 @@ var ClientContextualEditingComponentWrapperInner = ({
|
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
// src/components/ClientContextUpdate.tsx
|
|
324
|
+
var import_js_cookie = __toESM(require("js-cookie"));
|
|
324
325
|
var import_navigation2 = require("next/navigation");
|
|
325
326
|
var import_react5 = require("react");
|
|
326
327
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
327
|
-
var ClientContextUpdate = ({
|
|
328
|
-
|
|
328
|
+
var ClientContextUpdate = ({
|
|
329
|
+
path,
|
|
330
|
+
compositionMetadata
|
|
331
|
+
}) => {
|
|
332
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react5.Suspense, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ClientContextUpdateInner, { path, compositionMetadata }) });
|
|
329
333
|
};
|
|
330
|
-
var ClientContextUpdateInner = ({
|
|
334
|
+
var ClientContextUpdateInner = ({
|
|
335
|
+
path,
|
|
336
|
+
compositionMetadata
|
|
337
|
+
}) => {
|
|
331
338
|
const searchParams = (0, import_navigation2.useSearchParams)();
|
|
332
339
|
const { context } = useUniformContext();
|
|
333
340
|
(0, import_react5.useEffect)(() => {
|
|
341
|
+
var _a;
|
|
334
342
|
if (!context || typeof window === "undefined") {
|
|
335
343
|
return;
|
|
336
344
|
}
|
|
@@ -339,9 +347,11 @@ var ClientContextUpdateInner = ({ path }) => {
|
|
|
339
347
|
params: {
|
|
340
348
|
path: path.split("/").filter(Boolean)
|
|
341
349
|
},
|
|
342
|
-
|
|
350
|
+
cookies: (_a = import_js_cookie.default.get()) != null ? _a : {},
|
|
351
|
+
searchParams: convertedSearchParams,
|
|
352
|
+
compositionMetadata
|
|
343
353
|
});
|
|
344
|
-
}, [path, searchParams, context]);
|
|
354
|
+
}, [path, searchParams, context, compositionMetadata]);
|
|
345
355
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {});
|
|
346
356
|
};
|
|
347
357
|
|
|
@@ -390,105 +400,8 @@ function dequal(foo, bar) {
|
|
|
390
400
|
return foo !== foo && bar !== bar;
|
|
391
401
|
}
|
|
392
402
|
|
|
393
|
-
// ../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
|
|
394
|
-
function assign(target) {
|
|
395
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
396
|
-
var source = arguments[i];
|
|
397
|
-
for (var key in source) {
|
|
398
|
-
target[key] = source[key];
|
|
399
|
-
}
|
|
400
|
-
}
|
|
401
|
-
return target;
|
|
402
|
-
}
|
|
403
|
-
var defaultConverter = {
|
|
404
|
-
read: function(value) {
|
|
405
|
-
if (value[0] === '"') {
|
|
406
|
-
value = value.slice(1, -1);
|
|
407
|
-
}
|
|
408
|
-
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
409
|
-
},
|
|
410
|
-
write: function(value) {
|
|
411
|
-
return encodeURIComponent(value).replace(
|
|
412
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
413
|
-
decodeURIComponent
|
|
414
|
-
);
|
|
415
|
-
}
|
|
416
|
-
};
|
|
417
|
-
function init(converter, defaultAttributes) {
|
|
418
|
-
function set(name, value, attributes) {
|
|
419
|
-
if (typeof document === "undefined") {
|
|
420
|
-
return;
|
|
421
|
-
}
|
|
422
|
-
attributes = assign({}, defaultAttributes, attributes);
|
|
423
|
-
if (typeof attributes.expires === "number") {
|
|
424
|
-
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
425
|
-
}
|
|
426
|
-
if (attributes.expires) {
|
|
427
|
-
attributes.expires = attributes.expires.toUTCString();
|
|
428
|
-
}
|
|
429
|
-
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
430
|
-
var stringifiedAttributes = "";
|
|
431
|
-
for (var attributeName in attributes) {
|
|
432
|
-
if (!attributes[attributeName]) {
|
|
433
|
-
continue;
|
|
434
|
-
}
|
|
435
|
-
stringifiedAttributes += "; " + attributeName;
|
|
436
|
-
if (attributes[attributeName] === true) {
|
|
437
|
-
continue;
|
|
438
|
-
}
|
|
439
|
-
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
440
|
-
}
|
|
441
|
-
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
|
442
|
-
}
|
|
443
|
-
function get(name) {
|
|
444
|
-
if (typeof document === "undefined" || arguments.length && !name) {
|
|
445
|
-
return;
|
|
446
|
-
}
|
|
447
|
-
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
448
|
-
var jar = {};
|
|
449
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
450
|
-
var parts = cookies[i].split("=");
|
|
451
|
-
var value = parts.slice(1).join("=");
|
|
452
|
-
try {
|
|
453
|
-
var found = decodeURIComponent(parts[0]);
|
|
454
|
-
jar[found] = converter.read(value, found);
|
|
455
|
-
if (name === found) {
|
|
456
|
-
break;
|
|
457
|
-
}
|
|
458
|
-
} catch (e) {
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
return name ? jar[name] : jar;
|
|
462
|
-
}
|
|
463
|
-
return Object.create(
|
|
464
|
-
{
|
|
465
|
-
set,
|
|
466
|
-
get,
|
|
467
|
-
remove: function(name, attributes) {
|
|
468
|
-
set(
|
|
469
|
-
name,
|
|
470
|
-
"",
|
|
471
|
-
assign({}, attributes, {
|
|
472
|
-
expires: -1
|
|
473
|
-
})
|
|
474
|
-
);
|
|
475
|
-
},
|
|
476
|
-
withAttributes: function(attributes) {
|
|
477
|
-
return init(this.converter, assign({}, this.attributes, attributes));
|
|
478
|
-
},
|
|
479
|
-
withConverter: function(converter2) {
|
|
480
|
-
return init(assign({}, this.converter, converter2), this.attributes);
|
|
481
|
-
}
|
|
482
|
-
},
|
|
483
|
-
{
|
|
484
|
-
attributes: { value: Object.freeze(defaultAttributes) },
|
|
485
|
-
converter: { value: Object.freeze(converter) }
|
|
486
|
-
}
|
|
487
|
-
);
|
|
488
|
-
}
|
|
489
|
-
var api = init(defaultConverter, { path: "/" });
|
|
490
|
-
|
|
491
403
|
// ../context/dist/index.mjs
|
|
404
|
+
var import_js_cookie2 = __toESM(require("js-cookie"), 1);
|
|
492
405
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
493
406
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
494
407
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -1054,6 +967,9 @@ var UniformScript = () => {
|
|
|
1054
967
|
needsToRefreshRef.current = true;
|
|
1055
968
|
}
|
|
1056
969
|
});
|
|
970
|
+
channel.ready({
|
|
971
|
+
rsc: true
|
|
972
|
+
});
|
|
1057
973
|
return () => {
|
|
1058
974
|
unsubscribeFromEditorUpdates();
|
|
1059
975
|
};
|
|
@@ -1068,7 +984,8 @@ var UniformScript = () => {
|
|
|
1068
984
|
const textHost = (0, import_canvas4.isAllowedReferrer)(window.document.referrer) ? window.document.referrer : "https://uniform.app/";
|
|
1069
985
|
window.__UNIFORM_CONTEXTUAL_EDITING__ = {
|
|
1070
986
|
framework: "React",
|
|
1071
|
-
version: 2
|
|
987
|
+
version: 2,
|
|
988
|
+
canvasPackageVersion: import_canvas4.version
|
|
1072
989
|
};
|
|
1073
990
|
const bundleHost = new URL(textHost);
|
|
1074
991
|
bundleHost.pathname = "/files/canvas-in-context-embed/index.js";
|
|
@@ -1232,8 +1149,3 @@ var useUniformContextualEditingState = ({
|
|
|
1232
1149
|
useUniformContext,
|
|
1233
1150
|
useUniformContextualEditingState
|
|
1234
1151
|
});
|
|
1235
|
-
/*! Bundled license information:
|
|
1236
|
-
|
|
1237
|
-
js-cookie/dist/js.cookie.mjs:
|
|
1238
|
-
(*! js-cookie v3.0.5 | MIT *)
|
|
1239
|
-
*/
|
package/dist/index.mjs
CHANGED
|
@@ -295,16 +295,24 @@ var ClientContextualEditingComponentWrapperInner = ({
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// src/components/ClientContextUpdate.tsx
|
|
298
|
+
import Cookies from "js-cookie";
|
|
298
299
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
299
300
|
import { Suspense as Suspense2, useEffect as useEffect4 } from "react";
|
|
300
301
|
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
301
|
-
var ClientContextUpdate = ({
|
|
302
|
-
|
|
302
|
+
var ClientContextUpdate = ({
|
|
303
|
+
path,
|
|
304
|
+
compositionMetadata
|
|
305
|
+
}) => {
|
|
306
|
+
return /* @__PURE__ */ jsx2(Suspense2, { children: /* @__PURE__ */ jsx2(ClientContextUpdateInner, { path, compositionMetadata }) });
|
|
303
307
|
};
|
|
304
|
-
var ClientContextUpdateInner = ({
|
|
308
|
+
var ClientContextUpdateInner = ({
|
|
309
|
+
path,
|
|
310
|
+
compositionMetadata
|
|
311
|
+
}) => {
|
|
305
312
|
const searchParams = useSearchParams2();
|
|
306
313
|
const { context } = useUniformContext();
|
|
307
314
|
useEffect4(() => {
|
|
315
|
+
var _a;
|
|
308
316
|
if (!context || typeof window === "undefined") {
|
|
309
317
|
return;
|
|
310
318
|
}
|
|
@@ -313,9 +321,11 @@ var ClientContextUpdateInner = ({ path }) => {
|
|
|
313
321
|
params: {
|
|
314
322
|
path: path.split("/").filter(Boolean)
|
|
315
323
|
},
|
|
316
|
-
|
|
324
|
+
cookies: (_a = Cookies.get()) != null ? _a : {},
|
|
325
|
+
searchParams: convertedSearchParams,
|
|
326
|
+
compositionMetadata
|
|
317
327
|
});
|
|
318
|
-
}, [path, searchParams, context]);
|
|
328
|
+
}, [path, searchParams, context, compositionMetadata]);
|
|
319
329
|
return /* @__PURE__ */ jsx2(Fragment2, {});
|
|
320
330
|
};
|
|
321
331
|
|
|
@@ -364,105 +374,8 @@ function dequal(foo, bar) {
|
|
|
364
374
|
return foo !== foo && bar !== bar;
|
|
365
375
|
}
|
|
366
376
|
|
|
367
|
-
// ../../node_modules/.pnpm/js-cookie@3.0.5/node_modules/js-cookie/dist/js.cookie.mjs
|
|
368
|
-
function assign(target) {
|
|
369
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
370
|
-
var source = arguments[i];
|
|
371
|
-
for (var key in source) {
|
|
372
|
-
target[key] = source[key];
|
|
373
|
-
}
|
|
374
|
-
}
|
|
375
|
-
return target;
|
|
376
|
-
}
|
|
377
|
-
var defaultConverter = {
|
|
378
|
-
read: function(value) {
|
|
379
|
-
if (value[0] === '"') {
|
|
380
|
-
value = value.slice(1, -1);
|
|
381
|
-
}
|
|
382
|
-
return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
|
|
383
|
-
},
|
|
384
|
-
write: function(value) {
|
|
385
|
-
return encodeURIComponent(value).replace(
|
|
386
|
-
/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
|
|
387
|
-
decodeURIComponent
|
|
388
|
-
);
|
|
389
|
-
}
|
|
390
|
-
};
|
|
391
|
-
function init(converter, defaultAttributes) {
|
|
392
|
-
function set(name, value, attributes) {
|
|
393
|
-
if (typeof document === "undefined") {
|
|
394
|
-
return;
|
|
395
|
-
}
|
|
396
|
-
attributes = assign({}, defaultAttributes, attributes);
|
|
397
|
-
if (typeof attributes.expires === "number") {
|
|
398
|
-
attributes.expires = new Date(Date.now() + attributes.expires * 864e5);
|
|
399
|
-
}
|
|
400
|
-
if (attributes.expires) {
|
|
401
|
-
attributes.expires = attributes.expires.toUTCString();
|
|
402
|
-
}
|
|
403
|
-
name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
|
|
404
|
-
var stringifiedAttributes = "";
|
|
405
|
-
for (var attributeName in attributes) {
|
|
406
|
-
if (!attributes[attributeName]) {
|
|
407
|
-
continue;
|
|
408
|
-
}
|
|
409
|
-
stringifiedAttributes += "; " + attributeName;
|
|
410
|
-
if (attributes[attributeName] === true) {
|
|
411
|
-
continue;
|
|
412
|
-
}
|
|
413
|
-
stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
|
|
414
|
-
}
|
|
415
|
-
return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes;
|
|
416
|
-
}
|
|
417
|
-
function get(name) {
|
|
418
|
-
if (typeof document === "undefined" || arguments.length && !name) {
|
|
419
|
-
return;
|
|
420
|
-
}
|
|
421
|
-
var cookies = document.cookie ? document.cookie.split("; ") : [];
|
|
422
|
-
var jar = {};
|
|
423
|
-
for (var i = 0; i < cookies.length; i++) {
|
|
424
|
-
var parts = cookies[i].split("=");
|
|
425
|
-
var value = parts.slice(1).join("=");
|
|
426
|
-
try {
|
|
427
|
-
var found = decodeURIComponent(parts[0]);
|
|
428
|
-
jar[found] = converter.read(value, found);
|
|
429
|
-
if (name === found) {
|
|
430
|
-
break;
|
|
431
|
-
}
|
|
432
|
-
} catch (e) {
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
return name ? jar[name] : jar;
|
|
436
|
-
}
|
|
437
|
-
return Object.create(
|
|
438
|
-
{
|
|
439
|
-
set,
|
|
440
|
-
get,
|
|
441
|
-
remove: function(name, attributes) {
|
|
442
|
-
set(
|
|
443
|
-
name,
|
|
444
|
-
"",
|
|
445
|
-
assign({}, attributes, {
|
|
446
|
-
expires: -1
|
|
447
|
-
})
|
|
448
|
-
);
|
|
449
|
-
},
|
|
450
|
-
withAttributes: function(attributes) {
|
|
451
|
-
return init(this.converter, assign({}, this.attributes, attributes));
|
|
452
|
-
},
|
|
453
|
-
withConverter: function(converter2) {
|
|
454
|
-
return init(assign({}, this.converter, converter2), this.attributes);
|
|
455
|
-
}
|
|
456
|
-
},
|
|
457
|
-
{
|
|
458
|
-
attributes: { value: Object.freeze(defaultAttributes) },
|
|
459
|
-
converter: { value: Object.freeze(converter) }
|
|
460
|
-
}
|
|
461
|
-
);
|
|
462
|
-
}
|
|
463
|
-
var api = init(defaultConverter, { path: "/" });
|
|
464
|
-
|
|
465
377
|
// ../context/dist/index.mjs
|
|
378
|
+
import Cookies2 from "js-cookie";
|
|
466
379
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
467
380
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
468
381
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -998,7 +911,8 @@ var TestClient = (props) => {
|
|
|
998
911
|
import {
|
|
999
912
|
createCanvasChannel,
|
|
1000
913
|
IN_CONTEXT_EDITOR_QUERY_STRING_PARAM as IN_CONTEXT_EDITOR_QUERY_STRING_PARAM2,
|
|
1001
|
-
isAllowedReferrer
|
|
914
|
+
isAllowedReferrer,
|
|
915
|
+
version
|
|
1002
916
|
} from "@uniformdev/canvas";
|
|
1003
917
|
import { useRouter as useRouter2, useSearchParams as useSearchParams3 } from "next/navigation";
|
|
1004
918
|
import { useEffect as useEffect8, useMemo as useMemo2, useRef } from "react";
|
|
@@ -1032,6 +946,9 @@ var UniformScript = () => {
|
|
|
1032
946
|
needsToRefreshRef.current = true;
|
|
1033
947
|
}
|
|
1034
948
|
});
|
|
949
|
+
channel.ready({
|
|
950
|
+
rsc: true
|
|
951
|
+
});
|
|
1035
952
|
return () => {
|
|
1036
953
|
unsubscribeFromEditorUpdates();
|
|
1037
954
|
};
|
|
@@ -1046,7 +963,8 @@ var UniformScript = () => {
|
|
|
1046
963
|
const textHost = isAllowedReferrer(window.document.referrer) ? window.document.referrer : "https://uniform.app/";
|
|
1047
964
|
window.__UNIFORM_CONTEXTUAL_EDITING__ = {
|
|
1048
965
|
framework: "React",
|
|
1049
|
-
version: 2
|
|
966
|
+
version: 2,
|
|
967
|
+
canvasPackageVersion: version
|
|
1050
968
|
};
|
|
1051
969
|
const bundleHost = new URL(textHost);
|
|
1052
970
|
bundleHost.pathname = "/files/canvas-in-context-embed/index.js";
|
|
@@ -1215,8 +1133,3 @@ export {
|
|
|
1215
1133
|
useUniformContext,
|
|
1216
1134
|
useUniformContextualEditingState
|
|
1217
1135
|
};
|
|
1218
|
-
/*! Bundled license information:
|
|
1219
|
-
|
|
1220
|
-
js-cookie/dist/js.cookie.mjs:
|
|
1221
|
-
(*! js-cookie v3.0.5 | MIT *)
|
|
1222
|
-
*/
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc-client",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.7.1-alpha.102+d621aa22b2",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
7
7
|
"dev": "tsup --watch",
|
|
8
8
|
"lint": "eslint \"src/**/*.{ts,tsx}\" --fix",
|
|
9
|
-
"
|
|
9
|
+
"document": "api-extractor run --local"
|
|
10
10
|
},
|
|
11
11
|
"sideEffects": false,
|
|
12
12
|
"main": "./dist/index.js",
|
|
@@ -24,29 +24,30 @@
|
|
|
24
24
|
"/dist"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/
|
|
28
|
-
"@types/
|
|
29
|
-
"
|
|
30
|
-
"next": "15.
|
|
27
|
+
"@types/js-cookie": "3.0.6",
|
|
28
|
+
"@types/node": "24.3.1",
|
|
29
|
+
"@types/react": "18.3.24",
|
|
30
|
+
"next": "15.2.5",
|
|
31
31
|
"react": "18.3.1",
|
|
32
32
|
"react-dom": "18.3.1",
|
|
33
|
-
"typescript": "5.
|
|
33
|
+
"typescript": "5.9.2"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@uniformdev/canvas": "20.
|
|
37
|
-
"@uniformdev/canvas-next-rsc-shared": "
|
|
38
|
-
"@uniformdev/canvas-react": "
|
|
36
|
+
"@uniformdev/canvas": "20.7.1-alpha.102+d621aa22b2",
|
|
37
|
+
"@uniformdev/canvas-next-rsc-shared": "20.7.1-alpha.102+d621aa22b2",
|
|
38
|
+
"@uniformdev/canvas-react": "20.7.1-alpha.102+d621aa22b2",
|
|
39
|
+
"js-cookie": "3.0.5"
|
|
39
40
|
},
|
|
40
41
|
"engines": {
|
|
41
42
|
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
|
|
42
43
|
},
|
|
43
44
|
"peerDependencies": {
|
|
44
|
-
"next": ">=15.
|
|
45
|
+
"next": ">=15.2.3",
|
|
45
46
|
"react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0",
|
|
46
47
|
"react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0"
|
|
47
48
|
},
|
|
48
49
|
"publishConfig": {
|
|
49
50
|
"access": "public"
|
|
50
51
|
},
|
|
51
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "d621aa22b220347565e307b064fb1eda8963abbe"
|
|
52
53
|
}
|