@uniformdev/canvas-next-rsc-client 20.43.1-alpha.8 → 20.45.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 +3 -2
- package/dist/index.d.ts +3 -2
- package/dist/index.esm.js +16 -108
- package/dist/index.js +16 -108
- package/dist/index.mjs +16 -108
- package/package.json +7 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManifestV2, PersonalizationEvent, 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
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -40,8 +40,9 @@ declare const ClientContextTestTransfer: ({ event, ts }: {
|
|
|
40
40
|
|
|
41
41
|
declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react_jsx_runtime.JSX.Element;
|
|
42
42
|
|
|
43
|
-
declare const ClientContextUpdate: ({ path }: {
|
|
43
|
+
declare const ClientContextUpdate: ({ path, compositionMetadata, }: {
|
|
44
44
|
path: string;
|
|
45
|
+
compositionMetadata: CompositionMetadata;
|
|
45
46
|
}) => react_jsx_runtime.JSX.Element;
|
|
46
47
|
|
|
47
48
|
declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManifestV2, PersonalizationEvent, 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
4
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
@@ -40,8 +40,9 @@ declare const ClientContextTestTransfer: ({ event, ts }: {
|
|
|
40
40
|
|
|
41
41
|
declare const ClientContextualEditingComponentWrapper: (props: PropsWithChildren<PureContextualEditingComponentWrapperProps>) => react_jsx_runtime.JSX.Element;
|
|
42
42
|
|
|
43
|
-
declare const ClientContextUpdate: ({ path }: {
|
|
43
|
+
declare const ClientContextUpdate: ({ path, compositionMetadata, }: {
|
|
44
44
|
path: string;
|
|
45
|
+
compositionMetadata: CompositionMetadata;
|
|
45
46
|
}) => react_jsx_runtime.JSX.Element;
|
|
46
47
|
|
|
47
48
|
declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
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);
|
|
@@ -1220,8 +1133,3 @@ export {
|
|
|
1220
1133
|
useUniformContext,
|
|
1221
1134
|
useUniformContextualEditingState
|
|
1222
1135
|
};
|
|
1223
|
-
/*! Bundled license information:
|
|
1224
|
-
|
|
1225
|
-
js-cookie/dist/js.cookie.mjs:
|
|
1226
|
-
(*! js-cookie v3.0.5 | MIT *)
|
|
1227
|
-
*/
|
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);
|
|
@@ -1236,8 +1149,3 @@ var useUniformContextualEditingState = ({
|
|
|
1236
1149
|
useUniformContext,
|
|
1237
1150
|
useUniformContextualEditingState
|
|
1238
1151
|
});
|
|
1239
|
-
/*! Bundled license information:
|
|
1240
|
-
|
|
1241
|
-
js-cookie/dist/js.cookie.mjs:
|
|
1242
|
-
(*! js-cookie v3.0.5 | MIT *)
|
|
1243
|
-
*/
|
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);
|
|
@@ -1220,8 +1133,3 @@ export {
|
|
|
1220
1133
|
useUniformContext,
|
|
1221
1134
|
useUniformContextualEditingState
|
|
1222
1135
|
};
|
|
1223
|
-
/*! Bundled license information:
|
|
1224
|
-
|
|
1225
|
-
js-cookie/dist/js.cookie.mjs:
|
|
1226
|
-
(*! js-cookie v3.0.5 | MIT *)
|
|
1227
|
-
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/canvas-next-rsc-client",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.45.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"/dist"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
+
"@types/js-cookie": "3.0.6",
|
|
27
28
|
"@types/node": "24.3.1",
|
|
28
29
|
"@types/react": "18.3.24",
|
|
29
30
|
"next": "15.2.5",
|
|
@@ -32,9 +33,10 @@
|
|
|
32
33
|
"typescript": "5.9.2"
|
|
33
34
|
},
|
|
34
35
|
"dependencies": {
|
|
35
|
-
"@uniformdev/canvas": "20.
|
|
36
|
-
"@uniformdev/canvas-next-rsc-shared": "20.
|
|
37
|
-
"@uniformdev/canvas-react": "20.
|
|
36
|
+
"@uniformdev/canvas": "20.45.0",
|
|
37
|
+
"@uniformdev/canvas-next-rsc-shared": "20.45.0",
|
|
38
|
+
"@uniformdev/canvas-react": "20.45.0",
|
|
39
|
+
"js-cookie": "3.0.5"
|
|
38
40
|
},
|
|
39
41
|
"engines": {
|
|
40
42
|
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
|
|
@@ -47,5 +49,5 @@
|
|
|
47
49
|
"publishConfig": {
|
|
48
50
|
"access": "public"
|
|
49
51
|
},
|
|
50
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "a62de70dcd452b9649d45c388942016cd439eeef"
|
|
51
53
|
}
|