@makeswift/runtime 0.1.0-next.0 → 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.
Files changed (57) hide show
  1. package/dist/Form.cjs.js +33 -14
  2. package/dist/Form.cjs.js.map +1 -1
  3. package/dist/Form.es.js +33 -13
  4. package/dist/Form.es.js.map +1 -1
  5. package/dist/Text.es.js +1 -1
  6. package/dist/components.cjs.js +1 -2
  7. package/dist/components.cjs.js.map +1 -1
  8. package/dist/components.es.js +1 -1
  9. package/dist/index.cjs.js +19 -14
  10. package/dist/index.cjs.js.map +1 -1
  11. package/dist/index.cjs3.js +1 -1
  12. package/dist/index.cjs3.js.map +1 -1
  13. package/dist/index.es.js +21 -16
  14. package/dist/index.es.js.map +1 -1
  15. package/dist/index.es2.js +1 -1
  16. package/dist/index.es3.js +2 -2
  17. package/dist/index.es3.js.map +1 -1
  18. package/dist/style.cjs.js +5 -2
  19. package/dist/style.cjs.js.map +1 -1
  20. package/dist/style.es.js +5 -2
  21. package/dist/style.es.js.map +1 -1
  22. package/dist/types/components/builtin/Form/Form.d.ts.map +1 -1
  23. package/dist/types/components/builtin/Form/components/Field/index.d.ts +1 -1
  24. package/dist/types/components/builtin/Form/components/Field/index.d.ts.map +1 -1
  25. package/dist/types/components/{hooks/useTable.d.ts → builtin/Form/types.d.ts} +2 -6
  26. package/dist/types/components/builtin/Form/types.d.ts.map +1 -0
  27. package/dist/types/components/hooks/index.d.ts +0 -1
  28. package/dist/types/components/hooks/index.d.ts.map +1 -1
  29. package/dist/types/controls/style.d.ts +65 -0
  30. package/dist/types/controls/style.d.ts.map +1 -1
  31. package/dist/types/runtimes/react/controls/style.d.ts.map +1 -1
  32. package/dist/types/runtimes/react/index.d.ts.map +1 -1
  33. package/dist/useBoxShadow.es.js +1 -1
  34. package/package.json +2 -2
  35. package/dist/types/components/builtin/Box/contants.d.ts +0 -9
  36. package/dist/types/components/builtin/Box/contants.d.ts.map +0 -1
  37. package/dist/types/components/builtin/Button/constants.d.ts +0 -2
  38. package/dist/types/components/builtin/Button/constants.d.ts.map +0 -1
  39. package/dist/types/components/builtin/Form/constants.d.ts +0 -1
  40. package/dist/types/components/builtin/Form/constants.d.ts.map +0 -1
  41. package/dist/types/components/hooks/useTable.d.ts.map +0 -1
  42. package/dist/types/dynamic.d.ts +0 -2
  43. package/dist/types/dynamic.d.ts.map +0 -1
  44. package/dist/types/next/plugin.d.ts +0 -3
  45. package/dist/types/next/plugin.d.ts.map +0 -1
  46. package/dist/useBackgrounds.cjs.js +0 -124
  47. package/dist/useBackgrounds.cjs.js.map +0 -1
  48. package/dist/useBackgrounds.es.js +0 -123
  49. package/dist/useBackgrounds.es.js.map +0 -1
  50. package/dist/usePage.cjs.js +0 -14
  51. package/dist/usePage.cjs.js.map +0 -1
  52. package/dist/usePage.es.js +0 -13
  53. package/dist/usePage.es.js.map +0 -1
  54. package/dist/useTable.cjs.js +0 -10
  55. package/dist/useTable.cjs.js.map +0 -1
  56. package/dist/useTable.es.js +0 -9
  57. package/dist/useTable.es.js.map +0 -1
package/dist/index.cjs.js CHANGED
@@ -1550,8 +1550,6 @@ const { Provider } = Context$1;
1550
1550
  function registerComponent$6(runtime) {
1551
1551
  return runtime.registerComponent(forwardNextDynamicRef((patch) => dynamic__default["default"](() => patch(Promise.resolve().then(function() {
1552
1552
  return require("./Form.cjs.js");
1553
- }).then(function(n) {
1554
- return n.Form$1;
1555
1553
  })))), {
1556
1554
  type: "./components/Form/index.js",
1557
1555
  label: "Form",
@@ -2446,10 +2444,11 @@ function useStyleControlCssObject(style$1, controlDefinition) {
2446
2444
  style$1 == null ? void 0 : style$1.margin,
2447
2445
  style$1 == null ? void 0 : style$1.padding,
2448
2446
  useBorder(style$1 == null ? void 0 : style$1.border),
2449
- style$1 == null ? void 0 : style$1.borderRadius
2450
- ], ([width, margin, padding, border, borderRadius]) => {
2451
- var _a, _b, _c, _d, _e2, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q;
2452
- 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) && {
2453
2452
  width: (_a = widthToString(width)) != null ? _a : "100%"
2454
2453
  }), properties.includes(style.StyleControlProperty.Margin) && {
2455
2454
  marginTop: (_b = marginToString(margin == null ? void 0 : margin.marginTop)) != null ? _b : 0,
@@ -2471,7 +2470,10 @@ function useStyleControlCssObject(style$1, controlDefinition) {
2471
2470
  borderTopRightRadius: (_o = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderTopRightRadius)) != null ? _o : 0,
2472
2471
  borderBottomRightRadius: (_p = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomRightRadius)) != null ? _p : 0,
2473
2472
  borderBottomLeftRadius: (_q = borderRadiusToString(borderRadius == null ? void 0 : borderRadius.borderBottomLeftRadius)) != null ? _q : 0
2474
- });
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
+ }));
2475
2477
  }));
2476
2478
  function widthToString(widthProperty) {
2477
2479
  if (widthProperty == null)
@@ -2501,6 +2503,9 @@ function useStyleControlCssObject(style$1, controlDefinition) {
2501
2503
  return null;
2502
2504
  return `${borderRadius.value}${borderRadius.unit}`;
2503
2505
  }
2506
+ function fontSizeToString(fontSize) {
2507
+ return `${fontSize.value}${fontSize.unit}`;
2508
+ }
2504
2509
  }
2505
2510
  const useInsertionEffectSpecifier = "useInsertionEffect";
2506
2511
  const useInsertionEffect = (_e = React__namespace[useInsertionEffectSpecifier]) != null ? _e : React__namespace.useLayoutEffect;
@@ -2891,17 +2896,17 @@ function useDispatch() {
2891
2896
  const store = React.useContext(Context);
2892
2897
  return store.dispatch;
2893
2898
  }
2894
- function useSuppressRefWarning(ownerName) {
2895
- const originalErrorRef = React.useRef(console.error);
2896
- const patchedRef = React.useRef(false);
2897
- if (patchedRef.current === false) {
2899
+ const originalError = console.error;
2900
+ let patched = false;
2901
+ function suppressRefWarning(ownerName) {
2902
+ if (patched === false) {
2898
2903
  console.error = (...args) => {
2899
2904
  if (typeof args[0] === "string" && args[0].includes("Function components cannot be given refs.") && args[0].includes(`Check the render method of \`${ownerName}\`.`)) {
2900
2905
  return;
2901
2906
  }
2902
- return originalErrorRef.current(...args);
2907
+ return originalError(...args);
2903
2908
  };
2904
- patchedRef.current = true;
2909
+ patched = true;
2905
2910
  }
2906
2911
  }
2907
2912
  const ElementData = React.memo(React.forwardRef(function ElementData2({
@@ -2911,7 +2916,7 @@ const ElementData = React.memo(React.forwardRef(function ElementData2({
2911
2916
  const [handle, setHandle] = React.useState(null);
2912
2917
  const [foundDomNode, setFoundDomNode] = React.useState(null);
2913
2918
  React.useImperativeHandle(ref, () => handle != null ? handle : foundDomNode, [handle, foundDomNode]);
2914
- useSuppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
2919
+ suppressRefWarning(`\`ForwardRef(${ElementData2.name})\``);
2915
2920
  if (Component == null) {
2916
2921
  return /* @__PURE__ */ jsxRuntime.jsx(FallbackComponent, {
2917
2922
  ref,