@fragmentsx/render-react 1.1.3 → 1.1.4

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.cjs.js CHANGED
@@ -1431,7 +1431,7 @@ const TextSchema = /* @__PURE__ */ object({
1431
1431
  fallback: ""
1432
1432
  }),
1433
1433
  whiteSpace: layerField(/* @__PURE__ */ enum_(Object.keys(whiteSpace)), {
1434
- fallback: whiteSpace.pre
1434
+ fallback: whiteSpace.normal
1435
1435
  }),
1436
1436
  textAlign: layerField(/* @__PURE__ */ string(), { fallback: "left" }),
1437
1437
  parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
@@ -1553,6 +1553,7 @@ const StringVariableSchema = /* @__PURE__ */ object({
1553
1553
  required: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1554
1554
  placeholder: layerField(/* @__PURE__ */ string(), { fallback: "" }),
1555
1555
  isTextarea: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1556
+ isRich: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1556
1557
  ...GraphFieldSchema.entries
1557
1558
  });
1558
1559
  const EventVariableSchema = /* @__PURE__ */ object({
@@ -2857,7 +2858,7 @@ const useLayerSizeValue = (layerKey, sizeType) => {
2857
2858
  return "100%";
2858
2859
  }
2859
2860
  if (autoSizes.includes(valueType)) {
2860
- return layerNode._type === index.nodes.Instance ? "auto" : "min-content";
2861
+ return layerNode._type === index.nodes.Instance ? "auto" : "fit-content";
2861
2862
  }
2862
2863
  if (valueType === index.sizing.Relative) {
2863
2864
  return `${value}%`;
@@ -2935,13 +2936,14 @@ const useLayerBackground = (layerKey) => {
2935
2936
  "solidFill",
2936
2937
  fragmentManager
2937
2938
  );
2938
- const [imageFill, , { cssVariableValue: cssImageFill }] = useLayerValue(
2939
+ const [imageFill, , cssImageFillOptions] = useLayerValue(
2939
2940
  layerKey,
2940
2941
  "imageFill",
2941
2942
  fragmentManager
2942
2943
  );
2944
+ const imageSizeLayerKey = (cssImageFillOptions == null ? void 0 : cssImageFillOptions.isVariable) ? cssImageFillOptions == null ? void 0 : cssImageFillOptions.rawValue : layerKey;
2943
2945
  const [, , { cssVariableValue: cssImageSize }] = useLayerValue(
2944
- layerKey,
2946
+ imageSizeLayerKey,
2945
2947
  "imageSize",
2946
2948
  fragmentManager
2947
2949
  );
@@ -2951,7 +2953,7 @@ const useLayerBackground = (layerKey) => {
2951
2953
  background: cssSolidFill
2952
2954
  };
2953
2955
  }
2954
- if (fillType === index.paintMode.Image && cssImageFill) {
2956
+ if (fillType === index.paintMode.Image && cssImageFillOptions.cssVariableValue) {
2955
2957
  return {
2956
2958
  background: `url(${imageFill})`,
2957
2959
  backgroundSize: cssImageSize == null ? void 0 : cssImageSize.toLowerCase(),
@@ -2961,7 +2963,12 @@ const useLayerBackground = (layerKey) => {
2961
2963
  return {
2962
2964
  background: "transparent"
2963
2965
  };
2964
- }, [fillType, cssImageFill, cssSolidFill]);
2966
+ }, [
2967
+ fillType,
2968
+ cssImageFillOptions.cssVariableValue,
2969
+ cssSolidFill,
2970
+ cssImageSize
2971
+ ]);
2965
2972
  };
2966
2973
  const useLayerDisplay = (layerKey) => {
2967
2974
  const { manager } = require$$0.useContext(FragmentContext);
package/dist/index.es.js CHANGED
@@ -1429,7 +1429,7 @@ const TextSchema = /* @__PURE__ */ object({
1429
1429
  fallback: ""
1430
1430
  }),
1431
1431
  whiteSpace: layerField(/* @__PURE__ */ enum_(Object.keys(whiteSpace)), {
1432
- fallback: whiteSpace.pre
1432
+ fallback: whiteSpace.normal
1433
1433
  }),
1434
1434
  textAlign: layerField(/* @__PURE__ */ string(), { fallback: "left" }),
1435
1435
  parent: layerField(/* @__PURE__ */ nullable(/* @__PURE__ */ string()), { overridable: false }),
@@ -1551,6 +1551,7 @@ const StringVariableSchema = /* @__PURE__ */ object({
1551
1551
  required: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1552
1552
  placeholder: layerField(/* @__PURE__ */ string(), { fallback: "" }),
1553
1553
  isTextarea: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1554
+ isRich: layerField(/* @__PURE__ */ boolean(), { fallback: false }),
1554
1555
  ...GraphFieldSchema.entries
1555
1556
  });
1556
1557
  const EventVariableSchema = /* @__PURE__ */ object({
@@ -2855,7 +2856,7 @@ const useLayerSizeValue = (layerKey, sizeType) => {
2855
2856
  return "100%";
2856
2857
  }
2857
2858
  if (autoSizes.includes(valueType)) {
2858
- return layerNode._type === index.nodes.Instance ? "auto" : "min-content";
2859
+ return layerNode._type === index.nodes.Instance ? "auto" : "fit-content";
2859
2860
  }
2860
2861
  if (valueType === index.sizing.Relative) {
2861
2862
  return `${value}%`;
@@ -2933,13 +2934,14 @@ const useLayerBackground = (layerKey) => {
2933
2934
  "solidFill",
2934
2935
  fragmentManager
2935
2936
  );
2936
- const [imageFill, , { cssVariableValue: cssImageFill }] = useLayerValue(
2937
+ const [imageFill, , cssImageFillOptions] = useLayerValue(
2937
2938
  layerKey,
2938
2939
  "imageFill",
2939
2940
  fragmentManager
2940
2941
  );
2942
+ const imageSizeLayerKey = (cssImageFillOptions == null ? void 0 : cssImageFillOptions.isVariable) ? cssImageFillOptions == null ? void 0 : cssImageFillOptions.rawValue : layerKey;
2941
2943
  const [, , { cssVariableValue: cssImageSize }] = useLayerValue(
2942
- layerKey,
2944
+ imageSizeLayerKey,
2943
2945
  "imageSize",
2944
2946
  fragmentManager
2945
2947
  );
@@ -2949,7 +2951,7 @@ const useLayerBackground = (layerKey) => {
2949
2951
  background: cssSolidFill
2950
2952
  };
2951
2953
  }
2952
- if (fillType === index.paintMode.Image && cssImageFill) {
2954
+ if (fillType === index.paintMode.Image && cssImageFillOptions.cssVariableValue) {
2953
2955
  return {
2954
2956
  background: `url(${imageFill})`,
2955
2957
  backgroundSize: cssImageSize == null ? void 0 : cssImageSize.toLowerCase(),
@@ -2959,7 +2961,12 @@ const useLayerBackground = (layerKey) => {
2959
2961
  return {
2960
2962
  background: "transparent"
2961
2963
  };
2962
- }, [fillType, cssImageFill, cssSolidFill]);
2964
+ }, [
2965
+ fillType,
2966
+ cssImageFillOptions.cssVariableValue,
2967
+ cssSolidFill,
2968
+ cssImageSize
2969
+ ]);
2963
2970
  };
2964
2971
  const useLayerDisplay = (layerKey) => {
2965
2972
  const { manager } = useContext(FragmentContext);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fragmentsx/render-react",
3
3
  "private": false,
4
- "version": "1.1.3",
4
+ "version": "1.1.4",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist"