@uniformdev/next-app-router-client 20.7.1-alpha.123 → 20.7.1-alpha.136

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 CHANGED
@@ -1,2 +1,2 @@
1
- © 2024 Uniform Systems, Inc. All Rights Reserved.
1
+ © 2026 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,7 +1,6 @@
1
1
  import { ManifestV2, CompositionMetadata, TestEvent, ContextState, ContextOptions, CookieTransitionDataStoreOptions, Context, Quirks, ScoreVector } from '@uniformdev/context';
2
2
  import * as React from 'react';
3
3
  import React__default, { JSX, PropsWithChildren } from 'react';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
  import { ComponentContext, ComponentParameter, PersonalizeProps } from '@uniformdev/next-app-router-shared';
6
5
  import { VisibilityParameterValue } from '@uniformdev/canvas';
7
6
  import * as _uniformdev_context__ from '@uniformdev/context/*';
@@ -69,7 +68,7 @@ type ClientUniformTextProps = {
69
68
  /**
70
69
  * Renders text parameters. Offers inline editing capability out of the box.
71
70
  */
72
- declare const ClientUniformText: ({ as, component, parameter: providedParameter, isMultiline, placeholder, render, ...props }: ClientUniformTextProps) => react_jsx_runtime.JSX.Element | null;
71
+ declare const ClientUniformText: ({ as, component, parameter: providedParameter, isMultiline, placeholder, render, ...props }: ClientUniformTextProps) => React__default.JSX.Element | null;
73
72
 
74
73
  /**
75
74
  * Transfers context state updates from RSC to the client-side context.
@@ -86,12 +85,12 @@ declare const Personalize: ({ parameters, indexes, slots, context: compositionCo
86
85
  children?: React.ReactNode | undefined;
87
86
  }>;
88
87
 
89
- declare const UniformScript: () => react_jsx_runtime.JSX.Element;
88
+ declare const UniformScript: () => null;
90
89
 
91
90
  declare const VisibilityRulesWrapperClient: ({ parameter, initialIsVisible, children, }: PropsWithChildren<{
92
91
  parameter: VisibilityParameterValue;
93
92
  initialIsVisible: boolean | null;
94
- }>) => react_jsx_runtime.JSX.Element | null;
93
+ }>) => React__default.JSX.Element | null;
95
94
 
96
95
  type CreateUniformContextOptions = Omit<ContextOptions, 'transitionStore'> & {
97
96
  serverCookieValue: string | undefined;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import { ManifestV2, CompositionMetadata, TestEvent, ContextState, ContextOptions, CookieTransitionDataStoreOptions, Context, Quirks, ScoreVector } from '@uniformdev/context';
2
2
  import * as React from 'react';
3
3
  import React__default, { JSX, PropsWithChildren } from 'react';
4
- import * as react_jsx_runtime from 'react/jsx-runtime';
5
4
  import { ComponentContext, ComponentParameter, PersonalizeProps } from '@uniformdev/next-app-router-shared';
6
5
  import { VisibilityParameterValue } from '@uniformdev/canvas';
7
6
  import * as _uniformdev_context__ from '@uniformdev/context/*';
@@ -69,7 +68,7 @@ type ClientUniformTextProps = {
69
68
  /**
70
69
  * Renders text parameters. Offers inline editing capability out of the box.
71
70
  */
72
- declare const ClientUniformText: ({ as, component, parameter: providedParameter, isMultiline, placeholder, render, ...props }: ClientUniformTextProps) => react_jsx_runtime.JSX.Element | null;
71
+ declare const ClientUniformText: ({ as, component, parameter: providedParameter, isMultiline, placeholder, render, ...props }: ClientUniformTextProps) => React__default.JSX.Element | null;
73
72
 
74
73
  /**
75
74
  * Transfers context state updates from RSC to the client-side context.
@@ -86,12 +85,12 @@ declare const Personalize: ({ parameters, indexes, slots, context: compositionCo
86
85
  children?: React.ReactNode | undefined;
87
86
  }>;
88
87
 
89
- declare const UniformScript: () => react_jsx_runtime.JSX.Element;
88
+ declare const UniformScript: () => null;
90
89
 
91
90
  declare const VisibilityRulesWrapperClient: ({ parameter, initialIsVisible, children, }: PropsWithChildren<{
92
91
  parameter: VisibilityParameterValue;
93
92
  initialIsVisible: boolean | null;
94
- }>) => react_jsx_runtime.JSX.Element | null;
93
+ }>) => React__default.JSX.Element | null;
95
94
 
96
95
  type CreateUniformContextOptions = Omit<ContextOptions, 'transitionStore'> & {
97
96
  serverCookieValue: string | undefined;
package/dist/index.esm.js CHANGED
@@ -7,10 +7,12 @@ import { useEffect as useEffect3 } from "react";
7
7
  import { useEffect, useRef, useState } from "react";
8
8
  var useStableValue = (value, isValid) => {
9
9
  const previousRef = useRef(null);
10
+ const isValidRef = useRef(isValid);
10
11
  const [stableValue, setStableValue] = useState(void 0);
12
+ isValidRef.current = isValid;
11
13
  useEffect(() => {
12
14
  const serialized = JSON.stringify(value);
13
- const valid = isValid ? isValid(value) : true;
15
+ const valid = isValidRef.current ? isValidRef.current(value) : true;
14
16
  if (serialized !== previousRef.current && valid) {
15
17
  previousRef.current = serialized;
16
18
  setStableValue(value);
@@ -79,7 +81,7 @@ import {
79
81
  createQuirksVisibilityRule,
80
82
  evaluatePropertyCriteria
81
83
  } from "@uniformdev/canvas";
82
- import { useMemo } from "react";
84
+ import React, { useMemo } from "react";
83
85
 
84
86
  // src/hooks/useQuirks.ts
85
87
  import { useEffect as useEffect4, useState as useState3 } from "react";
@@ -104,7 +106,6 @@ function useQuirks() {
104
106
  }
105
107
 
106
108
  // src/components/ClientUniformText.tsx
107
- import { jsx } from "react/jsx-runtime";
108
109
  var ClientUniformText = ({
109
110
  as,
110
111
  component,
@@ -146,10 +147,10 @@ var ClientUniformText = ({
146
147
  const parameterId = parameter.parameterId;
147
148
  const isContextualEditing = Boolean(parameter._contextualEditing);
148
149
  if (!isContextualEditing) {
149
- return /* @__PURE__ */ jsx(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props, children: render(currentValue) });
150
+ return /* @__PURE__ */ React.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(currentValue));
150
151
  }
151
152
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
152
- return /* @__PURE__ */ jsx(
153
+ return /* @__PURE__ */ React.createElement(
153
154
  Tag,
154
155
  {
155
156
  ...props,
@@ -161,9 +162,9 @@ var ClientUniformText = ({
161
162
  }),
162
163
  "data-uniform-parameter-type": "text",
163
164
  "data-uniform-placeholder": computedPlaceholder,
164
- style: isMultiline ? { whiteSpace: "pre-wrap" } : {},
165
- children: isContextualEditing ? currentValue : render(currentValue)
166
- }
165
+ style: isMultiline ? { whiteSpace: "pre-wrap" } : {}
166
+ },
167
+ isContextualEditing ? currentValue : render(currentValue)
167
168
  );
168
169
  };
169
170
  var getParameterAttributes = ({
@@ -402,7 +403,6 @@ var Personalize = ({
402
403
  import { createCanvasChannel, isAllowedReferrer } from "@uniformdev/canvas";
403
404
  import { useRouter as useRouter2 } from "next/navigation";
404
405
  import { useEffect as useEffect9, useMemo as useMemo3, useRef as useRef4 } from "react";
405
- import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
406
406
  var UniformScript = () => {
407
407
  const router = useRouter2();
408
408
  const needsToRefreshRef = useRef4(false);
@@ -467,7 +467,7 @@ var UniformScript = () => {
467
467
  document.removeEventListener("focus", handleBlurChange, true);
468
468
  };
469
469
  }, [router]);
470
- return /* @__PURE__ */ jsx2(Fragment2, {});
470
+ return null;
471
471
  };
472
472
 
473
473
  // src/components/VisibilityRulesWrapperClient.tsx
@@ -475,8 +475,7 @@ import {
475
475
  createQuirksVisibilityRule as createQuirksVisibilityRule2,
476
476
  evaluateNodeVisibilityParameter
477
477
  } from "@uniformdev/canvas";
478
- import { useEffect as useEffect10, useMemo as useMemo4, useState as useState6 } from "react";
479
- import { Fragment as Fragment3, jsx as jsx3 } from "react/jsx-runtime";
478
+ import React2, { useEffect as useEffect10, useMemo as useMemo4, useState as useState6 } from "react";
480
479
  var VisibilityRulesWrapperClient = ({
481
480
  parameter,
482
481
  initialIsVisible,
@@ -503,7 +502,7 @@ var VisibilityRulesWrapperClient = ({
503
502
  setIsVisible(result);
504
503
  setVisibleSource("client");
505
504
  }, [initialIsVisible, visibleSource, parameter, rules]);
506
- return isVisible ? /* @__PURE__ */ jsx3(Fragment3, { children }) : null;
505
+ return isVisible ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, children) : null;
507
506
  };
508
507
  export {
509
508
  ClientContextTestTransfer,
package/dist/index.js CHANGED
@@ -53,10 +53,12 @@ var import_react3 = require("react");
53
53
  var import_react = require("react");
54
54
  var useStableValue = (value, isValid) => {
55
55
  const previousRef = (0, import_react.useRef)(null);
56
+ const isValidRef = (0, import_react.useRef)(isValid);
56
57
  const [stableValue, setStableValue] = (0, import_react.useState)(void 0);
58
+ isValidRef.current = isValid;
57
59
  (0, import_react.useEffect)(() => {
58
60
  const serialized = JSON.stringify(value);
59
- const valid = isValid ? isValid(value) : true;
61
+ const valid = isValidRef.current ? isValidRef.current(value) : true;
60
62
  if (serialized !== previousRef.current && valid) {
61
63
  previousRef.current = serialized;
62
64
  setStableValue(value);
@@ -116,7 +118,7 @@ var ClientContextTestTransfer = ({ event }) => {
116
118
 
117
119
  // src/components/ClientUniformText.tsx
118
120
  var import_canvas = require("@uniformdev/canvas");
119
- var import_react5 = require("react");
121
+ var import_react5 = __toESM(require("react"));
120
122
 
121
123
  // src/hooks/useQuirks.ts
122
124
  var import_react4 = require("react");
@@ -141,7 +143,6 @@ function useQuirks() {
141
143
  }
142
144
 
143
145
  // src/components/ClientUniformText.tsx
144
- var import_jsx_runtime = require("react/jsx-runtime");
145
146
  var ClientUniformText = ({
146
147
  as,
147
148
  component,
@@ -183,10 +184,10 @@ var ClientUniformText = ({
183
184
  const parameterId = parameter.parameterId;
184
185
  const isContextualEditing = Boolean(parameter._contextualEditing);
185
186
  if (!isContextualEditing) {
186
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props, children: render(currentValue) });
187
+ return /* @__PURE__ */ import_react5.default.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(currentValue));
187
188
  }
188
189
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
189
- return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
190
+ return /* @__PURE__ */ import_react5.default.createElement(
190
191
  Tag,
191
192
  {
192
193
  ...props,
@@ -198,9 +199,9 @@ var ClientUniformText = ({
198
199
  }),
199
200
  "data-uniform-parameter-type": "text",
200
201
  "data-uniform-placeholder": computedPlaceholder,
201
- style: isMultiline ? { whiteSpace: "pre-wrap" } : {},
202
- children: isContextualEditing ? currentValue : render(currentValue)
203
- }
202
+ style: isMultiline ? { whiteSpace: "pre-wrap" } : {}
203
+ },
204
+ isContextualEditing ? currentValue : render(currentValue)
204
205
  );
205
206
  };
206
207
  var getParameterAttributes = ({
@@ -436,7 +437,6 @@ var Personalize = ({
436
437
  var import_canvas3 = require("@uniformdev/canvas");
437
438
  var import_navigation3 = require("next/navigation");
438
439
  var import_react10 = require("react");
439
- var import_jsx_runtime2 = require("react/jsx-runtime");
440
440
  var UniformScript = () => {
441
441
  const router = (0, import_navigation3.useRouter)();
442
442
  const needsToRefreshRef = (0, import_react10.useRef)(false);
@@ -501,13 +501,12 @@ var UniformScript = () => {
501
501
  document.removeEventListener("focus", handleBlurChange, true);
502
502
  };
503
503
  }, [router]);
504
- return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_jsx_runtime2.Fragment, {});
504
+ return null;
505
505
  };
506
506
 
507
507
  // src/components/VisibilityRulesWrapperClient.tsx
508
508
  var import_canvas4 = require("@uniformdev/canvas");
509
- var import_react11 = require("react");
510
- var import_jsx_runtime3 = require("react/jsx-runtime");
509
+ var import_react11 = __toESM(require("react"));
511
510
  var VisibilityRulesWrapperClient = ({
512
511
  parameter,
513
512
  initialIsVisible,
@@ -534,7 +533,7 @@ var VisibilityRulesWrapperClient = ({
534
533
  setIsVisible(result);
535
534
  setVisibleSource("client");
536
535
  }, [initialIsVisible, visibleSource, parameter, rules]);
537
- return isVisible ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_jsx_runtime3.Fragment, { children }) : null;
536
+ return isVisible ? /* @__PURE__ */ import_react11.default.createElement(import_react11.default.Fragment, null, children) : null;
538
537
  };
539
538
  // Annotate the CommonJS export names for ESM import in node:
540
539
  0 && (module.exports = {
package/dist/index.mjs CHANGED
@@ -7,10 +7,12 @@ import { useEffect as useEffect3 } from "react";
7
7
  import { useEffect, useRef, useState } from "react";
8
8
  var useStableValue = (value, isValid) => {
9
9
  const previousRef = useRef(null);
10
+ const isValidRef = useRef(isValid);
10
11
  const [stableValue, setStableValue] = useState(void 0);
12
+ isValidRef.current = isValid;
11
13
  useEffect(() => {
12
14
  const serialized = JSON.stringify(value);
13
- const valid = isValid ? isValid(value) : true;
15
+ const valid = isValidRef.current ? isValidRef.current(value) : true;
14
16
  if (serialized !== previousRef.current && valid) {
15
17
  previousRef.current = serialized;
16
18
  setStableValue(value);
@@ -79,7 +81,7 @@ import {
79
81
  createQuirksVisibilityRule,
80
82
  evaluatePropertyCriteria
81
83
  } from "@uniformdev/canvas";
82
- import { useMemo } from "react";
84
+ import React, { useMemo } from "react";
83
85
 
84
86
  // src/hooks/useQuirks.ts
85
87
  import { useEffect as useEffect4, useState as useState3 } from "react";
@@ -104,7 +106,6 @@ function useQuirks() {
104
106
  }
105
107
 
106
108
  // src/components/ClientUniformText.tsx
107
- import { jsx } from "react/jsx-runtime";
108
109
  var ClientUniformText = ({
109
110
  as,
110
111
  component,
@@ -146,10 +147,10 @@ var ClientUniformText = ({
146
147
  const parameterId = parameter.parameterId;
147
148
  const isContextualEditing = Boolean(parameter._contextualEditing);
148
149
  if (!isContextualEditing) {
149
- return /* @__PURE__ */ jsx(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props, children: render(currentValue) });
150
+ return /* @__PURE__ */ React.createElement(Tag, { style: isMultiline ? { whiteSpace: "pre-wrap" } : {}, ...props }, render(currentValue));
150
151
  }
151
152
  const computedPlaceholder = typeof placeholder === "function" ? placeholder({ id: parameterId }) : placeholder;
152
- return /* @__PURE__ */ jsx(
153
+ return /* @__PURE__ */ React.createElement(
153
154
  Tag,
154
155
  {
155
156
  ...props,
@@ -161,9 +162,9 @@ var ClientUniformText = ({
161
162
  }),
162
163
  "data-uniform-parameter-type": "text",
163
164
  "data-uniform-placeholder": computedPlaceholder,
164
- style: isMultiline ? { whiteSpace: "pre-wrap" } : {},
165
- children: isContextualEditing ? currentValue : render(currentValue)
166
- }
165
+ style: isMultiline ? { whiteSpace: "pre-wrap" } : {}
166
+ },
167
+ isContextualEditing ? currentValue : render(currentValue)
167
168
  );
168
169
  };
169
170
  var getParameterAttributes = ({
@@ -402,7 +403,6 @@ var Personalize = ({
402
403
  import { createCanvasChannel, isAllowedReferrer } from "@uniformdev/canvas";
403
404
  import { useRouter as useRouter2 } from "next/navigation";
404
405
  import { useEffect as useEffect9, useMemo as useMemo3, useRef as useRef4 } from "react";
405
- import { Fragment as Fragment2, jsx as jsx2 } from "react/jsx-runtime";
406
406
  var UniformScript = () => {
407
407
  const router = useRouter2();
408
408
  const needsToRefreshRef = useRef4(false);
@@ -467,7 +467,7 @@ var UniformScript = () => {
467
467
  document.removeEventListener("focus", handleBlurChange, true);
468
468
  };
469
469
  }, [router]);
470
- return /* @__PURE__ */ jsx2(Fragment2, {});
470
+ return null;
471
471
  };
472
472
 
473
473
  // src/components/VisibilityRulesWrapperClient.tsx
@@ -475,8 +475,7 @@ import {
475
475
  createQuirksVisibilityRule as createQuirksVisibilityRule2,
476
476
  evaluateNodeVisibilityParameter
477
477
  } from "@uniformdev/canvas";
478
- import { useEffect as useEffect10, useMemo as useMemo4, useState as useState6 } from "react";
479
- import { Fragment as Fragment3, jsx as jsx3 } from "react/jsx-runtime";
478
+ import React2, { useEffect as useEffect10, useMemo as useMemo4, useState as useState6 } from "react";
480
479
  var VisibilityRulesWrapperClient = ({
481
480
  parameter,
482
481
  initialIsVisible,
@@ -503,7 +502,7 @@ var VisibilityRulesWrapperClient = ({
503
502
  setIsVisible(result);
504
503
  setVisibleSource("client");
505
504
  }, [initialIsVisible, visibleSource, parameter, rules]);
506
- return isVisible ? /* @__PURE__ */ jsx3(Fragment3, { children }) : null;
505
+ return isVisible ? /* @__PURE__ */ React2.createElement(React2.Fragment, null, children) : null;
507
506
  };
508
507
  export {
509
508
  ClientContextTestTransfer,
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@uniformdev/next-app-router-client",
3
- "version": "20.7.1-alpha.123+2f94c7c7d8",
3
+ "version": "20.7.1-alpha.136+b24fc21071",
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
- "test": "jest --maxWorkers=1 --passWithNoTests"
9
+ "test": "vitest --passWithNoTests"
10
10
  },
11
11
  "sideEffects": false,
12
12
  "main": "./dist/index.js",
@@ -31,13 +31,15 @@
31
31
  "next": "16.0.7",
32
32
  "react": "19.2.0",
33
33
  "react-dom": "19.2.0",
34
- "typescript": "5.9.2"
34
+ "typescript": "5.9.2",
35
+ "vite-tsconfig-paths": "^5.1.4",
36
+ "vitest": "3.2.4"
35
37
  },
36
38
  "dependencies": {
37
- "@uniformdev/canvas": "20.7.1-alpha.123+2f94c7c7d8",
38
- "@uniformdev/canvas-react": "20.7.1-alpha.123+2f94c7c7d8",
39
- "@uniformdev/context": "20.7.1-alpha.123+2f94c7c7d8",
40
- "@uniformdev/next-app-router-shared": "20.7.1-alpha.123+2f94c7c7d8",
39
+ "@uniformdev/canvas": "20.7.1-alpha.136+b24fc21071",
40
+ "@uniformdev/canvas-react": "20.7.1-alpha.136+b24fc21071",
41
+ "@uniformdev/context": "20.7.1-alpha.136+b24fc21071",
42
+ "@uniformdev/next-app-router-shared": "20.7.1-alpha.136+b24fc21071",
41
43
  "js-cookie": "3.0.5"
42
44
  },
43
45
  "engines": {
@@ -51,5 +53,5 @@
51
53
  "publishConfig": {
52
54
  "access": "public"
53
55
  },
54
- "gitHead": "2f94c7c7d825e4d5fb92122c706fb4efa4922993"
56
+ "gitHead": "b24fc21071984f3e41cf7d2e46345c122182a185"
55
57
  }