@makeswift/runtime 0.1.1 → 0.1.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.cjs.js CHANGED
@@ -2444,10 +2444,11 @@ function useStyleControlCssObject(style$1, controlDefinition) {
2444
2444
  style$1 == null ? void 0 : style$1.margin,
2445
2445
  style$1 == null ? void 0 : style$1.padding,
2446
2446
  useBorder(style$1 == null ? void 0 : style$1.border),
2447
- style$1 == null ? void 0 : style$1.borderRadius
2448
- ], ([width, margin, padding, border, borderRadius]) => {
2449
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
2450
- return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(style.StyleControlProperty.Width) && {
2447
+ style$1 == null ? void 0 : style$1.borderRadius,
2448
+ style$1 == null ? void 0 : style$1.textStyle
2449
+ ], ([width, margin, padding, border, borderRadius, textStyle]) => {
2450
+ var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s;
2451
+ return __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, properties.includes(style.StyleControlProperty.Width) && {
2451
2452
  width: (_a = widthToString(width)) != null ? _a : "100%"
2452
2453
  }), properties.includes(style.StyleControlProperty.Margin) && {
2453
2454
  marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
@@ -2469,7 +2470,10 @@ function useStyleControlCssObject(style$1, controlDefinition) {
2469
2470
  borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
2470
2471
  borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
2471
2472
  borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
2472
- });
2473
+ }), properties.includes(style.StyleControlProperty.TextStyle) && __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, (textStyle == null ? void 0 : textStyle.fontFamily) && { fontFamily: textStyle.fontFamily }), (textStyle == null ? void 0 : textStyle.letterSpacing) && { letterSpacing: textStyle.letterSpacing }), (textStyle == null ? void 0 : textStyle.fontSize) && { fontSize: fontSizeToString(textStyle.fontSize) }), (textStyle == null ? void 0 : textStyle.fontWeight) && { fontWeight: textStyle.fontWeight }), {
2474
+ textTransform: (_r = textStyle == null ? void 0 : textStyle.textTransform) != null ? _r : [],
2475
+ fontStyle: (_s = textStyle == null ? void 0 : textStyle.fontStyle) != null ? _s : []
2476
+ }));
2473
2477
  }));
2474
2478
  function widthToString(widthProperty) {
2475
2479
  if (widthProperty == null)
@@ -2499,6 +2503,9 @@ function useStyleControlCssObject(style$1, controlDefinition) {
2499
2503
  return null;
2500
2504
  return `${borderRadius.value}${borderRadius.unit}`;
2501
2505
  }
2506
+ function fontSizeToString(fontSize) {
2507
+ return `${fontSize.value}${fontSize.unit}`;
2508
+ }
2502
2509
  }
2503
2510
  const useInsertionEffectSpecifier = "useInsertionEffect";
2504
2511
  const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
@@ -2889,17 +2896,17 @@ function useDispatch() {
2889
2896
  const store = React.useContext(Context);
2890
2897
  return store.dispatch;
2891
2898
  }
2892
- function useSuppressRefWarning(ownerName) {
2893
- const originalErrorRef = React.useRef(console.error);
2894
- const patchedRef = React.useRef(false);
2895
- if (patchedRef.current === false) {
2899
+ const originalError = console.error;
2900
+ let patched = false;
2901
+ function suppressRefWarning(ownerName) {
2902
+ if (patched === false) {
2896
2903
  console.error = (...args) => {
2897
2904
  if (typeof args[0] === "string" && args[0].includes("Function components cannot be given refs.") && args[0].includes(`Check the render method of \`${ownerName}\`.`)) {
2898
2905
  return;
2899
2906
  }
2900
- return originalErrorRef.current(...args);
2907
+ return originalError(...args);
2901
2908
  };
2902
- patchedRef.current = true;
2909
+ patched = true;
2903
2910
  }
2904
2911
  }
2905
2912
  const ElementData = React.memo(React.forwardRef(function ElementData2({
@@ -2909,7 +2916,7 @@ const ElementData = React.memo(React.forwardRef(function ElementData2({
2909
2916
  const [handle, setHandle] = React.useState(null);
2910
2917
  const [foundDomNode, setFoundDomNode] = React.useState(null);
2911
2918
  React.useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
2912
- useSuppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
2919
+ suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
2913
2920
  if (Component == null) {
2914
2921
  return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
2915
2922
  ref,