@uniformdev/canvas-react 19.54.3-alpha.3 → 19.55.1-alpha.8

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
@@ -243,8 +243,10 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
243
243
  */
244
244
  declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
245
245
 
246
- type UniformPlaygroundDecorator = (options: {
246
+ type UniformPlaygroundDecorator = (props: {
247
+ /** The rendered component instance, needs to wrapped and rendered by the decorator */
247
248
  children: React$1.ReactNode;
249
+ /** The component instance data */
248
250
  data: ComponentInstance | RootComponentInstance;
249
251
  }) => React$1.ReactElement;
250
252
  type UniformPlaygroundProps = {
package/dist/index.d.ts CHANGED
@@ -243,8 +243,10 @@ declare function useUniformCurrentComposition(): UniformCompositionContextValue;
243
243
  */
244
244
  declare function UniformComposition<TRenderProps = unknown>({ data, behaviorTracking, children, resolveRenderer, contextualEditingEnhancer, contextualEditingDefaultPlaceholder, }: UniformCompositionProps<TRenderProps>): React$1.JSX.Element;
245
245
 
246
- type UniformPlaygroundDecorator = (options: {
246
+ type UniformPlaygroundDecorator = (props: {
247
+ /** The rendered component instance, needs to wrapped and rendered by the decorator */
247
248
  children: React$1.ReactNode;
249
+ /** The component instance data */
248
250
  data: ComponentInstance | RootComponentInstance;
249
251
  }) => React$1.ReactElement;
250
252
  type UniformPlaygroundProps = {
package/dist/index.esm.js CHANGED
@@ -186,7 +186,7 @@ import {
186
186
  CANVAS_LOCALE_TAG_PARAM,
187
187
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
188
188
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
189
- PLACEHOLDER_ID
189
+ isComponentPlaceholderId
190
190
  } from "@uniformdev/canvas";
191
191
  import React4 from "react";
192
192
 
@@ -331,7 +331,7 @@ function ContextualEditingComponentWrapper({
331
331
  children
332
332
  }) {
333
333
  var _a, _b, _c, _d, _e;
334
- const isPlaceholder = (component == null ? void 0 : component._id) === PLACEHOLDER_ID;
334
+ const isPlaceholder = isComponentPlaceholderId(component == null ? void 0 : component._id);
335
335
  const { isContextualEditing } = useUniformCurrentComposition();
336
336
  const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
337
337
  return !isContextualEditing ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, children) : isPlaceholder && emptyPlaceholder === null ? null : /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
@@ -577,7 +577,7 @@ var UniformPlayground = ({
577
577
  if (!composition) {
578
578
  return null;
579
579
  }
580
- let component = /* @__PURE__ */ React7.createElement(
580
+ let component = /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ React7.createElement(
581
581
  UniformComponent,
582
582
  {
583
583
  data: composition,
@@ -586,7 +586,7 @@ var UniformPlayground = ({
586
586
  contextualEditingDefaultPlaceholder
587
587
  },
588
588
  children
589
- );
589
+ ));
590
590
  decorators.forEach((Decorator) => {
591
591
  component = /* @__PURE__ */ React7.createElement(Decorator, { data: composition }, component);
592
592
  });
@@ -604,7 +604,7 @@ var UniformPlayground = ({
604
604
  {
605
605
  value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
606
606
  },
607
- /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, renderedComponent)
607
+ renderedComponent
608
608
  );
609
609
  };
610
610
 
package/dist/index.js CHANGED
@@ -365,7 +365,7 @@ function ContextualEditingComponentWrapper({
365
365
  children
366
366
  }) {
367
367
  var _a, _b, _c, _d, _e;
368
- const isPlaceholder = (component == null ? void 0 : component._id) === import_canvas4.PLACEHOLDER_ID;
368
+ const isPlaceholder = (0, import_canvas4.isComponentPlaceholderId)(component == null ? void 0 : component._id);
369
369
  const { isContextualEditing } = useUniformCurrentComposition();
370
370
  const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
371
371
  return !isContextualEditing ? /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, children) : isPlaceholder && emptyPlaceholder === null ? null : /* @__PURE__ */ import_react4.default.createElement(import_react4.default.Fragment, null, /* @__PURE__ */ import_react4.default.createElement(
@@ -611,7 +611,7 @@ var UniformPlayground = ({
611
611
  if (!composition) {
612
612
  return null;
613
613
  }
614
- let component = /* @__PURE__ */ import_react7.default.createElement(
614
+ let component = /* @__PURE__ */ import_react7.default.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ import_react7.default.createElement(
615
615
  UniformComponent,
616
616
  {
617
617
  data: composition,
@@ -620,7 +620,7 @@ var UniformPlayground = ({
620
620
  contextualEditingDefaultPlaceholder
621
621
  },
622
622
  children
623
- );
623
+ ));
624
624
  decorators.forEach((Decorator) => {
625
625
  component = /* @__PURE__ */ import_react7.default.createElement(Decorator, { data: composition }, component);
626
626
  });
@@ -638,7 +638,7 @@ var UniformPlayground = ({
638
638
  {
639
639
  value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
640
640
  },
641
- /* @__PURE__ */ import_react7.default.createElement(ContextualEditingComponentWrapper, { component: composition }, renderedComponent)
641
+ renderedComponent
642
642
  );
643
643
  };
644
644
 
package/dist/index.mjs CHANGED
@@ -186,7 +186,7 @@ import {
186
186
  CANVAS_LOCALE_TAG_PARAM,
187
187
  IN_CONTEXT_EDITOR_COMPONENT_END_ROLE,
188
188
  IN_CONTEXT_EDITOR_COMPONENT_START_ROLE,
189
- PLACEHOLDER_ID
189
+ isComponentPlaceholderId
190
190
  } from "@uniformdev/canvas";
191
191
  import React4 from "react";
192
192
 
@@ -331,7 +331,7 @@ function ContextualEditingComponentWrapper({
331
331
  children
332
332
  }) {
333
333
  var _a, _b, _c, _d, _e;
334
- const isPlaceholder = (component == null ? void 0 : component._id) === PLACEHOLDER_ID;
334
+ const isPlaceholder = isComponentPlaceholderId(component == null ? void 0 : component._id);
335
335
  const { isContextualEditing } = useUniformCurrentComposition();
336
336
  const isReadOnly = ((_a = component == null ? void 0 : component._contextualEditing) == null ? void 0 : _a.isEditable) ? void 0 : "true";
337
337
  return !isContextualEditing ? /* @__PURE__ */ React4.createElement(React4.Fragment, null, children) : isPlaceholder && emptyPlaceholder === null ? null : /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
@@ -577,7 +577,7 @@ var UniformPlayground = ({
577
577
  if (!composition) {
578
578
  return null;
579
579
  }
580
- let component = /* @__PURE__ */ React7.createElement(
580
+ let component = /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, /* @__PURE__ */ React7.createElement(
581
581
  UniformComponent,
582
582
  {
583
583
  data: composition,
@@ -586,7 +586,7 @@ var UniformPlayground = ({
586
586
  contextualEditingDefaultPlaceholder
587
587
  },
588
588
  children
589
- );
589
+ ));
590
590
  decorators.forEach((Decorator) => {
591
591
  component = /* @__PURE__ */ React7.createElement(Decorator, { data: composition }, component);
592
592
  });
@@ -604,7 +604,7 @@ var UniformPlayground = ({
604
604
  {
605
605
  value: { data: composition, behaviorTracking, resolveRenderer, isContextualEditing }
606
606
  },
607
- /* @__PURE__ */ React7.createElement(ContextualEditingComponentWrapper, { component: composition }, renderedComponent)
607
+ renderedComponent
608
608
  );
609
609
  };
610
610
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/canvas-react",
3
- "version": "19.54.3-alpha.3+c24f64403",
3
+ "version": "19.55.1-alpha.8+02b3f0ddb",
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": "api-extractor run --local"
46
46
  },
47
47
  "dependencies": {
48
- "@uniformdev/canvas": "19.54.3-alpha.3+c24f64403",
49
- "@uniformdev/context": "19.54.3-alpha.3+c24f64403",
50
- "@uniformdev/context-react": "19.54.3-alpha.3+c24f64403",
51
- "@uniformdev/richtext": "19.54.3-alpha.3+c24f64403"
48
+ "@uniformdev/canvas": "19.55.1-alpha.8+02b3f0ddb",
49
+ "@uniformdev/context": "19.55.1-alpha.8+02b3f0ddb",
50
+ "@uniformdev/context-react": "19.55.1-alpha.8+02b3f0ddb",
51
+ "@uniformdev/richtext": "19.55.1-alpha.8+02b3f0ddb"
52
52
  },
53
53
  "peerDependencies": {
54
54
  "react": ">= 16 || 17 || 18",
@@ -65,5 +65,5 @@
65
65
  "publishConfig": {
66
66
  "access": "public"
67
67
  },
68
- "gitHead": "c24f64403ca47e28674e94da9ab1566671f398fc"
68
+ "gitHead": "02b3f0ddb80a99d95d2f69cab42013682d763ca8"
69
69
  }