@uniformdev/canvas-react 20.34.3-alpha.70 → 20.35.1-alpha.188

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 CHANGED
@@ -19,7 +19,7 @@ type ComponentProps<TProps = unknown> = TProps & {
19
19
  */
20
20
  type RenderComponentResolver = (component: ComponentInstance) => React.ComponentType<ComponentProps<any>> | null;
21
21
  /** Function that renders Canvas system internals */
22
- type SystemRenderFunction = (component: ComponentInstance, key: Key, renderChild: (component: ComponentInstance, key: Key) => JSX.Element | null) => JSX.Element | null;
22
+ type SystemRenderFunction = (component: ComponentInstance, key: Key, renderChild: (component: ComponentInstance, key: Key) => ReactNode | null) => ReactNode | null;
23
23
  /** Configures rendering of system components (tests, pz) */
24
24
  type SystemRenderConfig = {
25
25
  test: SystemRenderFunction;
@@ -55,7 +55,7 @@ type UniformComponentProps<TRenderProps = unknown> = {
55
55
  /** Resolves a React component to render a Canvas component, generally by inspecting type/variant */
56
56
  resolveRenderer?: RenderComponentResolver;
57
57
  /** Children to render. Can also be a function that takes ComponentProps as argument */
58
- children?: ReactNode | ((props: ComponentProps<TRenderProps>) => JSX.Element);
58
+ children?: ReactNode | ((props: ComponentProps<TRenderProps>) => ReactNode);
59
59
  /**
60
60
  * When to track behavior from enrichment tags on the current composition
61
61
  * onView: adds enrichment score when the visitor views the tagged component in the browser viewport.
@@ -159,6 +159,13 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
159
159
  name: string;
160
160
  value?: string;
161
161
  helpText?: string;
162
+ optionsSource?: {
163
+ source: "static";
164
+ options: {
165
+ name: string;
166
+ value: string;
167
+ }[];
168
+ };
162
169
  }[];
163
170
  previewValue?: string;
164
171
  };
@@ -842,7 +849,7 @@ type CustomSlotChildRenderFunc = (options: {
842
849
  child: ReactNode;
843
850
  component: ComponentInstance;
844
851
  key: Key;
845
- }) => JSX.Element;
852
+ }) => ReactNode;
846
853
  type UniformSlotWrapperComponentProps = {
847
854
  items: ReactNode[];
848
855
  slotName: string;
@@ -868,7 +875,7 @@ type UniformSlotProps<TSlotNames extends string> = {
868
875
  emptyPlaceholder?: React$1.ReactNode;
869
876
  };
870
877
  /** Renders a named Slot within a Composition. */
871
- declare function UniformSlot<TSlotNames extends string = string>({ name, resolveRenderer, emptyPlaceholder, wrapperComponent, }: UniformSlotProps<TSlotNames>): JSX.Element | null;
878
+ declare function UniformSlot<TSlotNames extends string = string>({ name, resolveRenderer, emptyPlaceholder, wrapperComponent, }: UniformSlotProps<TSlotNames>): ReactNode | null;
872
879
 
873
880
  /**
874
881
  * Converts a raw Canvas component instance to React component props format.
package/dist/index.d.ts CHANGED
@@ -19,7 +19,7 @@ type ComponentProps<TProps = unknown> = TProps & {
19
19
  */
20
20
  type RenderComponentResolver = (component: ComponentInstance) => React.ComponentType<ComponentProps<any>> | null;
21
21
  /** Function that renders Canvas system internals */
22
- type SystemRenderFunction = (component: ComponentInstance, key: Key, renderChild: (component: ComponentInstance, key: Key) => JSX.Element | null) => JSX.Element | null;
22
+ type SystemRenderFunction = (component: ComponentInstance, key: Key, renderChild: (component: ComponentInstance, key: Key) => ReactNode | null) => ReactNode | null;
23
23
  /** Configures rendering of system components (tests, pz) */
24
24
  type SystemRenderConfig = {
25
25
  test: SystemRenderFunction;
@@ -55,7 +55,7 @@ type UniformComponentProps<TRenderProps = unknown> = {
55
55
  /** Resolves a React component to render a Canvas component, generally by inspecting type/variant */
56
56
  resolveRenderer?: RenderComponentResolver;
57
57
  /** Children to render. Can also be a function that takes ComponentProps as argument */
58
- children?: ReactNode | ((props: ComponentProps<TRenderProps>) => JSX.Element);
58
+ children?: ReactNode | ((props: ComponentProps<TRenderProps>) => ReactNode);
59
59
  /**
60
60
  * When to track behavior from enrichment tags on the current composition
61
61
  * onView: adds enrichment score when the visitor views the tagged component in the browser viewport.
@@ -159,6 +159,13 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
159
159
  name: string;
160
160
  value?: string;
161
161
  helpText?: string;
162
+ optionsSource?: {
163
+ source: "static";
164
+ options: {
165
+ name: string;
166
+ value: string;
167
+ }[];
168
+ };
162
169
  }[];
163
170
  previewValue?: string;
164
171
  };
@@ -842,7 +849,7 @@ type CustomSlotChildRenderFunc = (options: {
842
849
  child: ReactNode;
843
850
  component: ComponentInstance;
844
851
  key: Key;
845
- }) => JSX.Element;
852
+ }) => ReactNode;
846
853
  type UniformSlotWrapperComponentProps = {
847
854
  items: ReactNode[];
848
855
  slotName: string;
@@ -868,7 +875,7 @@ type UniformSlotProps<TSlotNames extends string> = {
868
875
  emptyPlaceholder?: React$1.ReactNode;
869
876
  };
870
877
  /** Renders a named Slot within a Composition. */
871
- declare function UniformSlot<TSlotNames extends string = string>({ name, resolveRenderer, emptyPlaceholder, wrapperComponent, }: UniformSlotProps<TSlotNames>): JSX.Element | null;
878
+ declare function UniformSlot<TSlotNames extends string = string>({ name, resolveRenderer, emptyPlaceholder, wrapperComponent, }: UniformSlotProps<TSlotNames>): ReactNode | null;
872
879
 
873
880
  /**
874
881
  * Converts a raw Canvas component instance to React component props format.
package/dist/index.esm.js CHANGED
@@ -223,7 +223,7 @@ var useUniformContextualEditing = ({
223
223
  enhance = (message) => message.composition
224
224
  }) => {
225
225
  const [contextualComposition, setContextualComposition] = useState();
226
- const latestEventTimeStamp = useRef();
226
+ const latestEventTimeStamp = useRef(void 0);
227
227
  const channel = useMemo3(() => {
228
228
  var _a;
229
229
  if (!isInContextEditingMode()) {
@@ -392,8 +392,9 @@ function UniformComposition({
392
392
  resolveRenderer,
393
393
  contextualEditingEnhancer,
394
394
  contextualEditingDefaultPlaceholder,
395
- matchedRoute,
396
- dynamicInputs
395
+ // provide default non-undefined values to avoid serialization issues
396
+ matchedRoute = "",
397
+ dynamicInputs = {}
397
398
  }) {
398
399
  const maybeContext = useUniformContext({ throwOnMissingProvider: false });
399
400
  useEffect2(() => {
package/dist/index.js CHANGED
@@ -252,7 +252,7 @@ var useUniformContextualEditing = ({
252
252
  enhance = (message) => message.composition
253
253
  }) => {
254
254
  const [contextualComposition, setContextualComposition] = (0, import_react4.useState)();
255
- const latestEventTimeStamp = (0, import_react4.useRef)();
255
+ const latestEventTimeStamp = (0, import_react4.useRef)(void 0);
256
256
  const channel = (0, import_react4.useMemo)(() => {
257
257
  var _a;
258
258
  if (!isInContextEditingMode()) {
@@ -415,8 +415,9 @@ function UniformComposition({
415
415
  resolveRenderer,
416
416
  contextualEditingEnhancer,
417
417
  contextualEditingDefaultPlaceholder,
418
- matchedRoute,
419
- dynamicInputs
418
+ // provide default non-undefined values to avoid serialization issues
419
+ matchedRoute = "",
420
+ dynamicInputs = {}
420
421
  }) {
421
422
  const maybeContext = (0, import_context_react2.useUniformContext)({ throwOnMissingProvider: false });
422
423
  (0, import_react7.useEffect)(() => {
package/dist/index.mjs CHANGED
@@ -223,7 +223,7 @@ var useUniformContextualEditing = ({
223
223
  enhance = (message) => message.composition
224
224
  }) => {
225
225
  const [contextualComposition, setContextualComposition] = useState();
226
- const latestEventTimeStamp = useRef();
226
+ const latestEventTimeStamp = useRef(void 0);
227
227
  const channel = useMemo3(() => {
228
228
  var _a;
229
229
  if (!isInContextEditingMode()) {
@@ -392,8 +392,9 @@ function UniformComposition({
392
392
  resolveRenderer,
393
393
  contextualEditingEnhancer,
394
394
  contextualEditingDefaultPlaceholder,
395
- matchedRoute,
396
- dynamicInputs
395
+ // provide default non-undefined values to avoid serialization issues
396
+ matchedRoute = "",
397
+ dynamicInputs = {}
397
398
  }) {
398
399
  const maybeContext = useUniformContext({ throwOnMissingProvider: false });
399
400
  useEffect2(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-react",
3
- "version": "20.34.3-alpha.70+bc3f8ba0f4",
3
+ "version": "20.35.1-alpha.188+c2a5b9c45f",
4
4
  "description": "React SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -45,10 +45,10 @@
45
45
  "document:prebuild": "api-extractor run --local"
46
46
  },
47
47
  "dependencies": {
48
- "@uniformdev/canvas": "20.34.3-alpha.70+bc3f8ba0f4",
49
- "@uniformdev/context": "20.34.3-alpha.70+bc3f8ba0f4",
50
- "@uniformdev/context-react": "20.34.3-alpha.70+bc3f8ba0f4",
51
- "@uniformdev/richtext": "20.34.3-alpha.70+bc3f8ba0f4"
48
+ "@uniformdev/canvas": "20.35.1-alpha.188+c2a5b9c45f",
49
+ "@uniformdev/context": "20.35.1-alpha.188+c2a5b9c45f",
50
+ "@uniformdev/context-react": "20.35.1-alpha.188+c2a5b9c45f",
51
+ "@uniformdev/richtext": "20.35.1-alpha.188+c2a5b9c45f"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "immer": ">= 10",
@@ -56,10 +56,10 @@
56
56
  "react-dom": ">=16"
57
57
  },
58
58
  "devDependencies": {
59
- "@types/react": "18.3.24",
60
- "immer": "10.1.1",
61
- "react": "18.3.1",
62
- "react-dom": "18.3.1"
59
+ "@types/react": "19.2.2",
60
+ "immer": "10.1.3",
61
+ "react": "19.2.0",
62
+ "react-dom": "19.2.0"
63
63
  },
64
64
  "files": [
65
65
  "/dist"
@@ -67,5 +67,5 @@
67
67
  "publishConfig": {
68
68
  "access": "public"
69
69
  },
70
- "gitHead": "bc3f8ba0f4719673f92d9e8c48c3818dc439c364"
70
+ "gitHead": "c2a5b9c45fdbcd3199fba23e38beaf7ca0388c35"
71
71
  }