@uniformdev/canvas-next-rsc-client 20.42.2-alpha.6 → 20.43.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 +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.esm.js +108 -16
- package/dist/index.js +108 -16
- package/dist/index.mjs +108 -16
- package/package.json +5 -7
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManifestV2, PersonalizationEvent, TestEvent,
|
|
1
|
+
import { ManifestV2, PersonalizationEvent, TestEvent, 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,9 +40,8 @@ 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 }: {
|
|
44
44
|
path: string;
|
|
45
|
-
compositionMetadata: CompositionMetadata;
|
|
46
45
|
}) => react_jsx_runtime.JSX.Element;
|
|
47
46
|
|
|
48
47
|
declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ManifestV2, PersonalizationEvent, TestEvent,
|
|
1
|
+
import { ManifestV2, PersonalizationEvent, TestEvent, 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,9 +40,8 @@ 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 }: {
|
|
44
44
|
path: string;
|
|
45
|
-
compositionMetadata: CompositionMetadata;
|
|
46
45
|
}) => react_jsx_runtime.JSX.Element;
|
|
47
46
|
|
|
48
47
|
declare const ContextUpdateTransferClient: ({ update, ts, }: {
|
package/dist/index.esm.js
CHANGED
|
@@ -295,24 +295,16 @@ var ClientContextualEditingComponentWrapperInner = ({
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// src/components/ClientContextUpdate.tsx
|
|
298
|
-
import Cookies from "js-cookie";
|
|
299
298
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
300
299
|
import { Suspense as Suspense2, useEffect as useEffect4 } from "react";
|
|
301
300
|
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
302
|
-
var ClientContextUpdate = ({
|
|
303
|
-
path
|
|
304
|
-
compositionMetadata
|
|
305
|
-
}) => {
|
|
306
|
-
return /* @__PURE__ */ jsx2(Suspense2, { children: /* @__PURE__ */ jsx2(ClientContextUpdateInner, { path, compositionMetadata }) });
|
|
301
|
+
var ClientContextUpdate = ({ path }) => {
|
|
302
|
+
return /* @__PURE__ */ jsx2(Suspense2, { children: /* @__PURE__ */ jsx2(ClientContextUpdateInner, { path }) });
|
|
307
303
|
};
|
|
308
|
-
var ClientContextUpdateInner = ({
|
|
309
|
-
path,
|
|
310
|
-
compositionMetadata
|
|
311
|
-
}) => {
|
|
304
|
+
var ClientContextUpdateInner = ({ path }) => {
|
|
312
305
|
const searchParams = useSearchParams2();
|
|
313
306
|
const { context } = useUniformContext();
|
|
314
307
|
useEffect4(() => {
|
|
315
|
-
var _a;
|
|
316
308
|
if (!context || typeof window === "undefined") {
|
|
317
309
|
return;
|
|
318
310
|
}
|
|
@@ -321,11 +313,9 @@ var ClientContextUpdateInner = ({
|
|
|
321
313
|
params: {
|
|
322
314
|
path: path.split("/").filter(Boolean)
|
|
323
315
|
},
|
|
324
|
-
|
|
325
|
-
searchParams: convertedSearchParams,
|
|
326
|
-
compositionMetadata
|
|
316
|
+
searchParams: convertedSearchParams
|
|
327
317
|
});
|
|
328
|
-
}, [path, searchParams, context
|
|
318
|
+
}, [path, searchParams, context]);
|
|
329
319
|
return /* @__PURE__ */ jsx2(Fragment2, {});
|
|
330
320
|
};
|
|
331
321
|
|
|
@@ -374,8 +364,105 @@ function dequal(foo, bar) {
|
|
|
374
364
|
return foo !== foo && bar !== bar;
|
|
375
365
|
}
|
|
376
366
|
|
|
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
|
+
|
|
377
465
|
// ../context/dist/index.mjs
|
|
378
|
-
import Cookies2 from "js-cookie";
|
|
379
466
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
380
467
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
381
468
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -1133,3 +1220,8 @@ export {
|
|
|
1133
1220
|
useUniformContext,
|
|
1134
1221
|
useUniformContextualEditingState
|
|
1135
1222
|
};
|
|
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,24 +321,16 @@ var ClientContextualEditingComponentWrapperInner = ({
|
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
// src/components/ClientContextUpdate.tsx
|
|
324
|
-
var import_js_cookie = __toESM(require("js-cookie"));
|
|
325
324
|
var import_navigation2 = require("next/navigation");
|
|
326
325
|
var import_react5 = require("react");
|
|
327
326
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
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 }) });
|
|
327
|
+
var ClientContextUpdate = ({ path }) => {
|
|
328
|
+
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_react5.Suspense, { children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(ClientContextUpdateInner, { path }) });
|
|
333
329
|
};
|
|
334
|
-
var ClientContextUpdateInner = ({
|
|
335
|
-
path,
|
|
336
|
-
compositionMetadata
|
|
337
|
-
}) => {
|
|
330
|
+
var ClientContextUpdateInner = ({ path }) => {
|
|
338
331
|
const searchParams = (0, import_navigation2.useSearchParams)();
|
|
339
332
|
const { context } = useUniformContext();
|
|
340
333
|
(0, import_react5.useEffect)(() => {
|
|
341
|
-
var _a;
|
|
342
334
|
if (!context || typeof window === "undefined") {
|
|
343
335
|
return;
|
|
344
336
|
}
|
|
@@ -347,11 +339,9 @@ var ClientContextUpdateInner = ({
|
|
|
347
339
|
params: {
|
|
348
340
|
path: path.split("/").filter(Boolean)
|
|
349
341
|
},
|
|
350
|
-
|
|
351
|
-
searchParams: convertedSearchParams,
|
|
352
|
-
compositionMetadata
|
|
342
|
+
searchParams: convertedSearchParams
|
|
353
343
|
});
|
|
354
|
-
}, [path, searchParams, context
|
|
344
|
+
}, [path, searchParams, context]);
|
|
355
345
|
return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {});
|
|
356
346
|
};
|
|
357
347
|
|
|
@@ -400,8 +390,105 @@ function dequal(foo, bar) {
|
|
|
400
390
|
return foo !== foo && bar !== bar;
|
|
401
391
|
}
|
|
402
392
|
|
|
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
|
+
|
|
403
491
|
// ../context/dist/index.mjs
|
|
404
|
-
var import_js_cookie2 = __toESM(require("js-cookie"), 1);
|
|
405
492
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
406
493
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
407
494
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -1149,3 +1236,8 @@ var useUniformContextualEditingState = ({
|
|
|
1149
1236
|
useUniformContext,
|
|
1150
1237
|
useUniformContextualEditingState
|
|
1151
1238
|
});
|
|
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,24 +295,16 @@ var ClientContextualEditingComponentWrapperInner = ({
|
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// src/components/ClientContextUpdate.tsx
|
|
298
|
-
import Cookies from "js-cookie";
|
|
299
298
|
import { useSearchParams as useSearchParams2 } from "next/navigation";
|
|
300
299
|
import { Suspense as Suspense2, useEffect as useEffect4 } from "react";
|
|
301
300
|
import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
|
|
302
|
-
var ClientContextUpdate = ({
|
|
303
|
-
path
|
|
304
|
-
compositionMetadata
|
|
305
|
-
}) => {
|
|
306
|
-
return /* @__PURE__ */ jsx2(Suspense2, { children: /* @__PURE__ */ jsx2(ClientContextUpdateInner, { path, compositionMetadata }) });
|
|
301
|
+
var ClientContextUpdate = ({ path }) => {
|
|
302
|
+
return /* @__PURE__ */ jsx2(Suspense2, { children: /* @__PURE__ */ jsx2(ClientContextUpdateInner, { path }) });
|
|
307
303
|
};
|
|
308
|
-
var ClientContextUpdateInner = ({
|
|
309
|
-
path,
|
|
310
|
-
compositionMetadata
|
|
311
|
-
}) => {
|
|
304
|
+
var ClientContextUpdateInner = ({ path }) => {
|
|
312
305
|
const searchParams = useSearchParams2();
|
|
313
306
|
const { context } = useUniformContext();
|
|
314
307
|
useEffect4(() => {
|
|
315
|
-
var _a;
|
|
316
308
|
if (!context || typeof window === "undefined") {
|
|
317
309
|
return;
|
|
318
310
|
}
|
|
@@ -321,11 +313,9 @@ var ClientContextUpdateInner = ({
|
|
|
321
313
|
params: {
|
|
322
314
|
path: path.split("/").filter(Boolean)
|
|
323
315
|
},
|
|
324
|
-
|
|
325
|
-
searchParams: convertedSearchParams,
|
|
326
|
-
compositionMetadata
|
|
316
|
+
searchParams: convertedSearchParams
|
|
327
317
|
});
|
|
328
|
-
}, [path, searchParams, context
|
|
318
|
+
}, [path, searchParams, context]);
|
|
329
319
|
return /* @__PURE__ */ jsx2(Fragment2, {});
|
|
330
320
|
};
|
|
331
321
|
|
|
@@ -374,8 +364,105 @@ function dequal(foo, bar) {
|
|
|
374
364
|
return foo !== foo && bar !== bar;
|
|
375
365
|
}
|
|
376
366
|
|
|
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
|
+
|
|
377
465
|
// ../context/dist/index.mjs
|
|
378
|
-
import Cookies2 from "js-cookie";
|
|
379
466
|
var import_rfdc = __toESM(require_rfdc(), 1);
|
|
380
467
|
var import_rfdc2 = __toESM(require_rfdc(), 1);
|
|
381
468
|
var import_rfdc3 = __toESM(require_rfdc(), 1);
|
|
@@ -1133,3 +1220,8 @@ export {
|
|
|
1133
1220
|
useUniformContext,
|
|
1134
1221
|
useUniformContextualEditingState
|
|
1135
1222
|
};
|
|
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.43.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsup",
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
"/dist"
|
|
25
25
|
],
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"@types/js-cookie": "3.0.6",
|
|
28
27
|
"@types/node": "24.3.1",
|
|
29
28
|
"@types/react": "18.3.24",
|
|
30
29
|
"next": "15.2.5",
|
|
@@ -33,10 +32,9 @@
|
|
|
33
32
|
"typescript": "5.9.2"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
36
|
-
"@uniformdev/canvas": "20.
|
|
37
|
-
"@uniformdev/canvas-next-rsc-shared": "20.
|
|
38
|
-
"@uniformdev/canvas-react": "20.
|
|
39
|
-
"js-cookie": "3.0.5"
|
|
35
|
+
"@uniformdev/canvas": "20.43.0",
|
|
36
|
+
"@uniformdev/canvas-next-rsc-shared": "20.43.0",
|
|
37
|
+
"@uniformdev/canvas-react": "20.43.0"
|
|
40
38
|
},
|
|
41
39
|
"engines": {
|
|
42
40
|
"node": "^18.18.0 || ^19.8.0 || >= 20.0.0"
|
|
@@ -49,5 +47,5 @@
|
|
|
49
47
|
"publishConfig": {
|
|
50
48
|
"access": "public"
|
|
51
49
|
},
|
|
52
|
-
"gitHead": "
|
|
50
|
+
"gitHead": "9a8037f9cd28afa60861e7de0fb8f6153482194f"
|
|
53
51
|
}
|