@uniformdev/canvas-react 18.22.0 → 18.23.1-alpha.34

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.ts CHANGED
@@ -120,6 +120,7 @@ declare const createApiEnhancer: ({ apiUrl }: {
120
120
  [key: string]: {
121
121
  type: string;
122
122
  isPatternParameter?: boolean | undefined;
123
+ ignorePatternParameterDefault?: boolean | undefined;
123
124
  variables?: {
124
125
  [key: string]: string;
125
126
  } | undefined;
@@ -129,6 +130,7 @@ declare const createApiEnhancer: ({ apiUrl }: {
129
130
  [key: string]: {
130
131
  type: string;
131
132
  isPatternParameter?: boolean | undefined;
133
+ ignorePatternParameterDefault?: boolean | undefined;
132
134
  variables?: {
133
135
  [key: string]: string;
134
136
  } | undefined;
@@ -148,12 +150,14 @@ declare const createApiEnhancer: ({ apiUrl }: {
148
150
  } | undefined;
149
151
  };
150
152
  } | undefined;
153
+ variant?: string | undefined;
151
154
  };
152
155
  } | undefined;
153
156
  _overridability?: {
154
157
  parameters?: {
155
158
  [key: string]: "yes" | "no";
156
159
  } | undefined;
160
+ variants?: boolean | undefined;
157
161
  } | undefined;
158
162
  }[];
159
163
  } | undefined;
@@ -164,6 +168,7 @@ declare const createApiEnhancer: ({ apiUrl }: {
164
168
  [key: string]: {
165
169
  type: string;
166
170
  isPatternParameter?: boolean | undefined;
171
+ ignorePatternParameterDefault?: boolean | undefined;
167
172
  variables?: {
168
173
  [key: string]: string;
169
174
  } | undefined;
@@ -182,12 +187,14 @@ declare const createApiEnhancer: ({ apiUrl }: {
182
187
  } | undefined;
183
188
  };
184
189
  } | undefined;
190
+ variant?: string | undefined;
185
191
  };
186
192
  } | undefined;
187
193
  _overridability?: {
188
194
  parameters?: {
189
195
  [key: string]: "yes" | "no";
190
196
  } | undefined;
197
+ variants?: boolean | undefined;
191
198
  } | undefined;
192
199
  }>;
193
200
  type UseUniformContextualEditingProps = {
@@ -246,6 +253,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
246
253
  [key: string]: {
247
254
  type: string;
248
255
  isPatternParameter?: boolean | undefined;
256
+ ignorePatternParameterDefault?: boolean | undefined;
249
257
  variables?: {
250
258
  [key: string]: string;
251
259
  } | undefined;
@@ -255,6 +263,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
255
263
  [key: string]: {
256
264
  type: string;
257
265
  isPatternParameter?: boolean | undefined;
266
+ ignorePatternParameterDefault?: boolean | undefined;
258
267
  variables?: {
259
268
  [key: string]: string;
260
269
  } | undefined;
@@ -274,12 +283,14 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
274
283
  } | undefined;
275
284
  };
276
285
  } | undefined;
286
+ variant?: string | undefined;
277
287
  };
278
288
  } | undefined;
279
289
  _overridability?: {
280
290
  parameters?: {
281
291
  [key: string]: "yes" | "no";
282
292
  } | undefined;
293
+ variants?: boolean | undefined;
283
294
  } | undefined;
284
295
  }[];
285
296
  } | undefined;
@@ -290,6 +301,7 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
290
301
  [key: string]: {
291
302
  type: string;
292
303
  isPatternParameter?: boolean | undefined;
304
+ ignorePatternParameterDefault?: boolean | undefined;
293
305
  variables?: {
294
306
  [key: string]: string;
295
307
  } | undefined;
@@ -308,12 +320,14 @@ declare const useUniformContextualEditing: ({ initialCompositionValue, enhance,
308
320
  } | undefined;
309
321
  };
310
322
  } | undefined;
323
+ variant?: string | undefined;
311
324
  };
312
325
  } | undefined;
313
326
  _overridability?: {
314
327
  parameters?: {
315
328
  [key: string]: "yes" | "no";
316
329
  } | undefined;
330
+ variants?: boolean | undefined;
317
331
  } | undefined;
318
332
  } | undefined;
319
333
  };
@@ -362,6 +376,7 @@ declare const useContextualEditing: ({ initialCompositionValue, enhance, }: UseU
362
376
  [key: string]: {
363
377
  type: string;
364
378
  isPatternParameter?: boolean | undefined;
379
+ ignorePatternParameterDefault?: boolean | undefined;
365
380
  variables?: {
366
381
  [key: string]: string;
367
382
  } | undefined;
@@ -371,6 +386,7 @@ declare const useContextualEditing: ({ initialCompositionValue, enhance, }: UseU
371
386
  [key: string]: {
372
387
  type: string;
373
388
  isPatternParameter?: boolean | undefined;
389
+ ignorePatternParameterDefault?: boolean | undefined;
374
390
  variables?: {
375
391
  [key: string]: string;
376
392
  } | undefined;
@@ -390,12 +406,14 @@ declare const useContextualEditing: ({ initialCompositionValue, enhance, }: UseU
390
406
  } | undefined;
391
407
  };
392
408
  } | undefined;
409
+ variant?: string | undefined;
393
410
  };
394
411
  } | undefined;
395
412
  _overridability?: {
396
413
  parameters?: {
397
414
  [key: string]: "yes" | "no";
398
415
  } | undefined;
416
+ variants?: boolean | undefined;
399
417
  } | undefined;
400
418
  }[];
401
419
  } | undefined;
@@ -406,6 +424,7 @@ declare const useContextualEditing: ({ initialCompositionValue, enhance, }: UseU
406
424
  [key: string]: {
407
425
  type: string;
408
426
  isPatternParameter?: boolean | undefined;
427
+ ignorePatternParameterDefault?: boolean | undefined;
409
428
  variables?: {
410
429
  [key: string]: string;
411
430
  } | undefined;
@@ -424,12 +443,14 @@ declare const useContextualEditing: ({ initialCompositionValue, enhance, }: UseU
424
443
  } | undefined;
425
444
  };
426
445
  } | undefined;
446
+ variant?: string | undefined;
427
447
  };
428
448
  } | undefined;
429
449
  _overridability?: {
430
450
  parameters?: {
431
451
  [key: string]: "yes" | "no";
432
452
  } | undefined;
453
+ variants?: boolean | undefined;
433
454
  } | undefined;
434
455
  } | undefined;
435
456
  };
package/dist/index.esm.js CHANGED
@@ -28,7 +28,7 @@ function DefaultNotImplementedComponent(props) {
28
28
  "enable localization in your front-end application."
29
29
  )));
30
30
  }
31
- return /* @__PURE__ */ React.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ React.createElement("h2", null, "Component: ", /* @__PURE__ */ React.createElement("code", null, componentType)), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement("strong", null, componentType)), " ", "has no React implementation. It may need to be added to your ", /* @__PURE__ */ React.createElement("code", null, "resolveRenderer()"), " function."), /* @__PURE__ */ React.createElement("details", null, /* @__PURE__ */ React.createElement("summary", { style: { cursor: "pointer" } }, "Props"), /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(props, null, 2))));
31
+ return /* @__PURE__ */ React.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ React.createElement("h2", null, "Component: ", /* @__PURE__ */ React.createElement("code", null, componentType)), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement("strong", null, componentType)), " ", "has no React implementation. It may need to be added to your ", /* @__PURE__ */ React.createElement("code", null, "resolveRenderer()"), " function."), /* @__PURE__ */ React.createElement("details", null, /* @__PURE__ */ React.createElement("summary", { style: { cursor: "pointer" } }, "Data"), /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(props, null, 2))));
32
32
  }
33
33
 
34
34
  // src/components/UniformComponent.tsx
@@ -276,10 +276,6 @@ var UniformComponentContext = createContext({});
276
276
  function useUniformCurrentComponent() {
277
277
  return useContext(UniformComponentContext);
278
278
  }
279
- var componentStoreResolver2 = (component) => {
280
- const resolved = componentStore.get(component.type, component.variant);
281
- return resolved || null;
282
- };
283
279
  function UniformComponent({
284
280
  data,
285
281
  resolveRenderer,
@@ -297,7 +293,7 @@ function UniformComponent({
297
293
  }
298
294
  const contextValue = {
299
295
  data,
300
- resolveRenderer: resolveRenderer || (parentData == null ? void 0 : parentData.resolveRenderer) || componentStoreResolver2,
296
+ resolveRenderer: resolveRenderer || parentData.resolveRenderer || componentStoreResolver,
301
297
  behaviorTracking: (_a = behaviorTracking != null ? behaviorTracking : parentData == null ? void 0 : parentData.behaviorTracking) != null ? _a : "onView"
302
298
  };
303
299
  const enrichmentTags = (_c = (_b = data.parameters) == null ? void 0 : _b[CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _c.value;
@@ -305,7 +301,8 @@ function UniformComponent({
305
301
  const resolvedChildren = resolveChildren({
306
302
  children,
307
303
  data,
308
- hasParentLayout: Boolean(parentData.data)
304
+ hasParentLayout: Boolean(parentData.data),
305
+ resolveRenderer: contextValue.resolveRenderer
309
306
  });
310
307
  return /* @__PURE__ */ React4.createElement(UniformComponentContext.Provider, { value: contextValue }, contextContextProviderPresent ? (
311
308
  /* auto-track behavior signals when in a Canvas context */
@@ -315,13 +312,14 @@ function UniformComponent({
315
312
  function resolveChildren({
316
313
  children,
317
314
  data,
318
- hasParentLayout
315
+ hasParentLayout,
316
+ resolveRenderer
319
317
  }) {
320
318
  var _a;
321
319
  if (!children && !hasParentLayout) {
322
- const rootComponent = componentStore.get(data.type);
323
- if (rootComponent) {
324
- children = React4.createElement(rootComponent, convertComponentToProps(data));
320
+ const topLevelComponent = resolveRenderer({ type: data.type });
321
+ if (topLevelComponent) {
322
+ children = React4.createElement(topLevelComponent, convertComponentToProps(data));
325
323
  } else {
326
324
  if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
327
325
  console.warn(
package/dist/index.js CHANGED
@@ -83,7 +83,7 @@ function DefaultNotImplementedComponent(props) {
83
83
  "enable localization in your front-end application."
84
84
  )));
85
85
  }
86
- return /* @__PURE__ */ import_react.default.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ import_react.default.createElement("h2", null, "Component: ", /* @__PURE__ */ import_react.default.createElement("code", null, componentType)), /* @__PURE__ */ import_react.default.createElement("p", null, /* @__PURE__ */ import_react.default.createElement("code", null, /* @__PURE__ */ import_react.default.createElement("strong", null, componentType)), " ", "has no React implementation. It may need to be added to your ", /* @__PURE__ */ import_react.default.createElement("code", null, "resolveRenderer()"), " function."), /* @__PURE__ */ import_react.default.createElement("details", null, /* @__PURE__ */ import_react.default.createElement("summary", { style: { cursor: "pointer" } }, "Props"), /* @__PURE__ */ import_react.default.createElement("pre", null, JSON.stringify(props, null, 2))));
86
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ import_react.default.createElement("h2", null, "Component: ", /* @__PURE__ */ import_react.default.createElement("code", null, componentType)), /* @__PURE__ */ import_react.default.createElement("p", null, /* @__PURE__ */ import_react.default.createElement("code", null, /* @__PURE__ */ import_react.default.createElement("strong", null, componentType)), " ", "has no React implementation. It may need to be added to your ", /* @__PURE__ */ import_react.default.createElement("code", null, "resolveRenderer()"), " function."), /* @__PURE__ */ import_react.default.createElement("details", null, /* @__PURE__ */ import_react.default.createElement("summary", { style: { cursor: "pointer" } }, "Data"), /* @__PURE__ */ import_react.default.createElement("pre", null, JSON.stringify(props, null, 2))));
87
87
  }
88
88
 
89
89
  // src/components/UniformComponent.tsx
@@ -318,10 +318,6 @@ var UniformComponentContext = (0, import_react3.createContext)({});
318
318
  function useUniformCurrentComponent() {
319
319
  return (0, import_react3.useContext)(UniformComponentContext);
320
320
  }
321
- var componentStoreResolver2 = (component) => {
322
- const resolved = componentStore.get(component.type, component.variant);
323
- return resolved || null;
324
- };
325
321
  function UniformComponent({
326
322
  data,
327
323
  resolveRenderer,
@@ -339,7 +335,7 @@ function UniformComponent({
339
335
  }
340
336
  const contextValue = {
341
337
  data,
342
- resolveRenderer: resolveRenderer || (parentData == null ? void 0 : parentData.resolveRenderer) || componentStoreResolver2,
338
+ resolveRenderer: resolveRenderer || parentData.resolveRenderer || componentStoreResolver,
343
339
  behaviorTracking: (_a = behaviorTracking != null ? behaviorTracking : parentData == null ? void 0 : parentData.behaviorTracking) != null ? _a : "onView"
344
340
  };
345
341
  const enrichmentTags = (_c = (_b = data.parameters) == null ? void 0 : _b[import_canvas4.CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _c.value;
@@ -347,7 +343,8 @@ function UniformComponent({
347
343
  const resolvedChildren = resolveChildren({
348
344
  children,
349
345
  data,
350
- hasParentLayout: Boolean(parentData.data)
346
+ hasParentLayout: Boolean(parentData.data),
347
+ resolveRenderer: contextValue.resolveRenderer
351
348
  });
352
349
  return /* @__PURE__ */ import_react3.default.createElement(UniformComponentContext.Provider, { value: contextValue }, contextContextProviderPresent ? (
353
350
  /* auto-track behavior signals when in a Canvas context */
@@ -357,13 +354,14 @@ function UniformComponent({
357
354
  function resolveChildren({
358
355
  children,
359
356
  data,
360
- hasParentLayout
357
+ hasParentLayout,
358
+ resolveRenderer
361
359
  }) {
362
360
  var _a;
363
361
  if (!children && !hasParentLayout) {
364
- const rootComponent = componentStore.get(data.type);
365
- if (rootComponent) {
366
- children = import_react3.default.createElement(rootComponent, convertComponentToProps(data));
362
+ const topLevelComponent = resolveRenderer({ type: data.type });
363
+ if (topLevelComponent) {
364
+ children = import_react3.default.createElement(topLevelComponent, convertComponentToProps(data));
367
365
  } else {
368
366
  if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
369
367
  console.warn(
package/dist/index.mjs CHANGED
@@ -28,7 +28,7 @@ function DefaultNotImplementedComponent(props) {
28
28
  "enable localization in your front-end application."
29
29
  )));
30
30
  }
31
- return /* @__PURE__ */ React.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ React.createElement("h2", null, "Component: ", /* @__PURE__ */ React.createElement("code", null, componentType)), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement("strong", null, componentType)), " ", "has no React implementation. It may need to be added to your ", /* @__PURE__ */ React.createElement("code", null, "resolveRenderer()"), " function."), /* @__PURE__ */ React.createElement("details", null, /* @__PURE__ */ React.createElement("summary", { style: { cursor: "pointer" } }, "Props"), /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(props, null, 2))));
31
+ return /* @__PURE__ */ React.createElement("div", { style: wrapperStyles }, /* @__PURE__ */ React.createElement("h2", null, "Component: ", /* @__PURE__ */ React.createElement("code", null, componentType)), /* @__PURE__ */ React.createElement("p", null, /* @__PURE__ */ React.createElement("code", null, /* @__PURE__ */ React.createElement("strong", null, componentType)), " ", "has no React implementation. It may need to be added to your ", /* @__PURE__ */ React.createElement("code", null, "resolveRenderer()"), " function."), /* @__PURE__ */ React.createElement("details", null, /* @__PURE__ */ React.createElement("summary", { style: { cursor: "pointer" } }, "Data"), /* @__PURE__ */ React.createElement("pre", null, JSON.stringify(props, null, 2))));
32
32
  }
33
33
 
34
34
  // src/components/UniformComponent.tsx
@@ -276,10 +276,6 @@ var UniformComponentContext = createContext({});
276
276
  function useUniformCurrentComponent() {
277
277
  return useContext(UniformComponentContext);
278
278
  }
279
- var componentStoreResolver2 = (component) => {
280
- const resolved = componentStore.get(component.type, component.variant);
281
- return resolved || null;
282
- };
283
279
  function UniformComponent({
284
280
  data,
285
281
  resolveRenderer,
@@ -297,7 +293,7 @@ function UniformComponent({
297
293
  }
298
294
  const contextValue = {
299
295
  data,
300
- resolveRenderer: resolveRenderer || (parentData == null ? void 0 : parentData.resolveRenderer) || componentStoreResolver2,
296
+ resolveRenderer: resolveRenderer || parentData.resolveRenderer || componentStoreResolver,
301
297
  behaviorTracking: (_a = behaviorTracking != null ? behaviorTracking : parentData == null ? void 0 : parentData.behaviorTracking) != null ? _a : "onView"
302
298
  };
303
299
  const enrichmentTags = (_c = (_b = data.parameters) == null ? void 0 : _b[CANVAS_ENRICHMENT_TAG_PARAM]) == null ? void 0 : _c.value;
@@ -305,7 +301,8 @@ function UniformComponent({
305
301
  const resolvedChildren = resolveChildren({
306
302
  children,
307
303
  data,
308
- hasParentLayout: Boolean(parentData.data)
304
+ hasParentLayout: Boolean(parentData.data),
305
+ resolveRenderer: contextValue.resolveRenderer
309
306
  });
310
307
  return /* @__PURE__ */ React4.createElement(UniformComponentContext.Provider, { value: contextValue }, contextContextProviderPresent ? (
311
308
  /* auto-track behavior signals when in a Canvas context */
@@ -315,13 +312,14 @@ function UniformComponent({
315
312
  function resolveChildren({
316
313
  children,
317
314
  data,
318
- hasParentLayout
315
+ hasParentLayout,
316
+ resolveRenderer
319
317
  }) {
320
318
  var _a;
321
319
  if (!children && !hasParentLayout) {
322
- const rootComponent = componentStore.get(data.type);
323
- if (rootComponent) {
324
- children = React4.createElement(rootComponent, convertComponentToProps(data));
320
+ const topLevelComponent = resolveRenderer({ type: data.type });
321
+ if (topLevelComponent) {
322
+ children = React4.createElement(topLevelComponent, convertComponentToProps(data));
325
323
  } else {
326
324
  if (Object.keys((_a = data.slots) != null ? _a : {}).length > 1 && process.env.NODE_ENV === "development") {
327
325
  console.warn(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-react",
3
- "version": "18.22.0",
3
+ "version": "18.23.1-alpha.34+8eddcae60",
4
4
  "description": "React SDK for Uniform Canvas",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./dist/index.js",
@@ -24,9 +24,9 @@
24
24
  "document": "api-extractor run --local"
25
25
  },
26
26
  "dependencies": {
27
- "@uniformdev/canvas": "18.22.0",
28
- "@uniformdev/context": "18.22.0",
29
- "@uniformdev/context-react": "18.22.0"
27
+ "@uniformdev/canvas": "18.23.1-alpha.34+8eddcae60",
28
+ "@uniformdev/context": "18.23.1-alpha.34+8eddcae60",
29
+ "@uniformdev/context-react": "18.23.1-alpha.34+8eddcae60"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "react": ">= 16 || 17 || 18",
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "55125ebbd2e43c65946984dbd1cea417e089f75d"
46
+ "gitHead": "8eddcae607f5c8b7ef9f7752bc11e186eee4305b"
47
47
  }