@makeswift/runtime 0.4.0 → 0.4.2

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.es.js CHANGED
@@ -36,7 +36,7 @@ var __publicField = (obj, key, value) => {
36
36
  };
37
37
  var _c;
38
38
  import * as React from "react";
39
- import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useLayoutEffect, useCallback, Component, useImperativeHandle } from "react";
39
+ import { useEffect, createContext, useContext, useState, useMemo, useRef, Children, createElement, forwardRef, memo, useLayoutEffect, useCallback, Component, useImperativeHandle, Suspense } from "react";
40
40
  import { useSyncExternalStoreWithSelector } from "use-sync-external-store/shim/with-selector";
41
41
  import { g as getPropControllerDescriptors, i as isElementReference, a as getElementSwatchIds, b as getFileIds, d as getTypographyIds, e as getTableIds, f as getPageIds, h as getElementChildren, j as createDocumentReference, k as getBorderSwatchIds, l as isNonNullable, m as getBoxShadowsSwatchIds, n as getResponsiveColorSwatchIds, o as getComponentPropControllerDescriptors, p as getPropControllers, q as configureStore$1, r as getDocument, s as getElementId, t as getIsInBuilder, u as copyElementTree, c as createDocument, v as getReactComponent } from "./react-page.es.js";
42
42
  import { A as ActionTypes, f as introspectedResourcesFulfilled, g as apiResourceFulfilled, t as typographiesFulfilled, h as restoreAPIResourcesCache, j as registerDocumentEffect, k as registerComponentHandleEffect, l as mountComponentEffect, n as registerComponentEffect, o as registerReactComponentEffect } from "./actions.es.js";
@@ -1050,7 +1050,7 @@ class Document$1 extends NextDocument {
1050
1050
  });
1051
1051
  }
1052
1052
  }
1053
- const version = "0.4.0";
1053
+ const version = "0.4.2";
1054
1054
  function isErrorWithMessage(error) {
1055
1055
  return typeof error === "object" && error !== null && "message" in error && typeof error.message === "string";
1056
1056
  }
@@ -2847,13 +2847,13 @@ function paddingPropertyDataToStyle(data, defaultValue = {}) {
2847
2847
  const paddingBottom = (_c2 = data.paddingBottom) != null ? _c2 : defaultValue.paddingBottom;
2848
2848
  const paddingLeft = (_d = data.paddingLeft) != null ? _d : defaultValue.paddingLeft;
2849
2849
  const style = {};
2850
- if (paddingTop)
2850
+ if (paddingTop != null)
2851
2851
  style.paddingTop = lengthDataToString(paddingTop);
2852
- if (paddingRight)
2852
+ if (paddingRight != null)
2853
2853
  style.paddingRight = lengthDataToString(paddingRight);
2854
- if (paddingBottom)
2854
+ if (paddingBottom != null)
2855
2855
  style.paddingBottom = lengthDataToString(paddingBottom);
2856
- if (paddingLeft)
2856
+ if (paddingLeft != null)
2857
2857
  style.paddingLeft = lengthDataToString(paddingLeft);
2858
2858
  return style;
2859
2859
  }
@@ -2864,13 +2864,13 @@ function marginPropertyDataToStyle(data, defaultValue = {}) {
2864
2864
  const marginBottom = (_c2 = data.marginBottom) != null ? _c2 : defaultValue.marginBottom;
2865
2865
  const marginLeft = (_d = data.marginLeft) != null ? _d : defaultValue.marginLeft;
2866
2866
  const style = {};
2867
- if (marginTop)
2867
+ if (marginTop != null)
2868
2868
  style.marginTop = lengthDataToString(marginTop);
2869
- if (marginRight)
2869
+ if (marginRight != null)
2870
2870
  style.marginRight = lengthDataToString(marginRight);
2871
- if (marginBottom)
2871
+ if (marginBottom != null)
2872
2872
  style.marginBottom = lengthDataToString(marginBottom);
2873
- if (marginLeft)
2873
+ if (marginLeft != null)
2874
2874
  style.marginLeft = lengthDataToString(marginLeft);
2875
2875
  return style;
2876
2876
  }
@@ -2888,16 +2888,16 @@ function borderRadiusPropertyDataToStyle(data, defaultValue = {}) {
2888
2888
  const borderBottomRightRadius = (_c2 = data.borderBottomRightRadius) != null ? _c2 : defaultValue.borderBottomRightRadius;
2889
2889
  const borderBottomLeftRadius = (_d = data.borderBottomLeftRadius) != null ? _d : defaultValue.borderBottomLeftRadius;
2890
2890
  const style = {};
2891
- if (borderTopLeftRadius) {
2891
+ if (borderTopLeftRadius != null) {
2892
2892
  style.borderTopLeftRadius = lengthPercentageDataToString(borderTopLeftRadius);
2893
2893
  }
2894
- if (borderTopRightRadius) {
2894
+ if (borderTopRightRadius != null) {
2895
2895
  style.borderTopRightRadius = lengthPercentageDataToString(borderTopRightRadius);
2896
2896
  }
2897
- if (borderBottomRightRadius) {
2897
+ if (borderBottomRightRadius != null) {
2898
2898
  style.borderBottomRightRadius = lengthPercentageDataToString(borderBottomRightRadius);
2899
2899
  }
2900
- if (borderBottomLeftRadius) {
2900
+ if (borderBottomLeftRadius != null) {
2901
2901
  style.borderBottomLeftRadius = lengthPercentageDataToString(borderBottomLeftRadius);
2902
2902
  }
2903
2903
  return style;
@@ -2912,13 +2912,13 @@ function borderPropertyDataToStyle(data, defaultValue = {}) {
2912
2912
  const borderBottom = (_c2 = data.borderBottom) != null ? _c2 : defaultValue.borderBottom;
2913
2913
  const borderLeft = (_d = data.borderLeft) != null ? _d : defaultValue.borderLeft;
2914
2914
  const style = {};
2915
- if (borderTop)
2915
+ if (borderTop != null)
2916
2916
  style.borderTop = borderSideToString(borderTop);
2917
- if (borderRight)
2917
+ if (borderRight != null)
2918
2918
  style.borderRight = borderSideToString(borderRight);
2919
- if (borderBottom)
2919
+ if (borderBottom != null)
2920
2920
  style.borderBottom = borderSideToString(borderBottom);
2921
- if (borderLeft)
2921
+ if (borderLeft != null)
2922
2922
  style.borderLeft = borderSideToString(borderLeft);
2923
2923
  return style;
2924
2924
  }
@@ -3842,14 +3842,16 @@ const ElementData = memo(forwardRef(function ElementData2({
3842
3842
  text: "Component not found"
3843
3843
  });
3844
3844
  }
3845
- return /* @__PURE__ */ jsx(FindDomNode, {
3846
- ref: setFoundDomNode,
3847
- children: /* @__PURE__ */ jsx(PropsValue, {
3848
- element: elementData,
3849
- children: (props) => /* @__PURE__ */ createElement(Component2, __spreadProps(__spreadValues({}, props), {
3850
- key: elementData.key,
3851
- ref: setHandle
3852
- }))
3845
+ return /* @__PURE__ */ jsx(Suspense, {
3846
+ children: /* @__PURE__ */ jsx(FindDomNode, {
3847
+ ref: setFoundDomNode,
3848
+ children: /* @__PURE__ */ jsx(PropsValue, {
3849
+ element: elementData,
3850
+ children: (props) => /* @__PURE__ */ createElement(Component2, __spreadProps(__spreadValues({}, props), {
3851
+ key: elementData.key,
3852
+ ref: setHandle
3853
+ }))
3854
+ })
3853
3855
  })
3854
3856
  });
3855
3857
  }));