@makeswift/runtime 0.0.20 → 0.0.21

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 (59) hide show
  1. package/dist/builder.cjs.js +1 -0
  2. package/dist/builder.cjs.js.map +1 -1
  3. package/dist/builder.es.js +1 -0
  4. package/dist/builder.es.js.map +1 -1
  5. package/dist/color.cjs.js +8 -0
  6. package/dist/color.cjs.js.map +1 -0
  7. package/dist/color.es.js +6 -0
  8. package/dist/color.es.js.map +1 -0
  9. package/dist/components.cjs.js +1 -0
  10. package/dist/components.cjs.js.map +1 -1
  11. package/dist/components.es.js +1 -0
  12. package/dist/components.es.js.map +1 -1
  13. package/dist/control-serialization.cjs.js +1 -0
  14. package/dist/control-serialization.cjs.js.map +1 -1
  15. package/dist/control-serialization.es.js +1 -0
  16. package/dist/control-serialization.es.js.map +1 -1
  17. package/dist/controls.cjs.js +7 -5
  18. package/dist/controls.cjs.js.map +1 -1
  19. package/dist/controls.es.js +2 -1
  20. package/dist/controls.es.js.map +1 -1
  21. package/dist/descriptors.cjs.js.map +1 -1
  22. package/dist/descriptors.es.js.map +1 -1
  23. package/dist/image.cjs.js +6 -6
  24. package/dist/image.cjs.js.map +1 -1
  25. package/dist/image.es.js +6 -5
  26. package/dist/image.es.js.map +1 -1
  27. package/dist/index.cjs.js +108 -97
  28. package/dist/index.cjs.js.map +1 -1
  29. package/dist/index.es.js +15 -4
  30. package/dist/index.es.js.map +1 -1
  31. package/dist/main.cjs.js +1 -0
  32. package/dist/main.cjs.js.map +1 -1
  33. package/dist/main.es.js +1 -0
  34. package/dist/main.es.js.map +1 -1
  35. package/dist/next.cjs.js +1 -0
  36. package/dist/next.cjs.js.map +1 -1
  37. package/dist/next.es.js +1 -0
  38. package/dist/next.es.js.map +1 -1
  39. package/dist/react-builder-preview.cjs.js +2 -1
  40. package/dist/react-builder-preview.cjs.js.map +1 -1
  41. package/dist/react-builder-preview.es.js +2 -1
  42. package/dist/react-builder-preview.es.js.map +1 -1
  43. package/dist/react-page.cjs.js +5 -4
  44. package/dist/react-page.cjs.js.map +1 -1
  45. package/dist/react-page.es.js +2 -1
  46. package/dist/react-page.es.js.map +1 -1
  47. package/dist/react.cjs.js +1 -0
  48. package/dist/react.cjs.js.map +1 -1
  49. package/dist/react.es.js +1 -0
  50. package/dist/react.es.js.map +1 -1
  51. package/dist/types/controls/image.d.ts +15 -3
  52. package/dist/types/controls/image.d.ts.map +1 -1
  53. package/dist/types/prop-controllers/descriptors.d.ts +2 -2
  54. package/dist/types/prop-controllers/descriptors.d.ts.map +1 -1
  55. package/dist/types/runtimes/react/controls/control.d.ts +2 -2
  56. package/dist/types/runtimes/react/controls/control.d.ts.map +1 -1
  57. package/dist/types/runtimes/react/controls/image.d.ts +12 -3
  58. package/dist/types/runtimes/react/controls/image.d.ts.map +1 -1
  59. package/package.json +1 -1
package/dist/index.cjs.js CHANGED
@@ -46,6 +46,7 @@ var client = require("@apollo/client");
46
46
  var batchHttp = require("@apollo/client/link/batch-http");
47
47
  var slate = require("slate");
48
48
  var graphql = require("./graphql.cjs.js");
49
+ var image = require("./image.cjs.js");
49
50
  var shape = require("./shape.cjs.js");
50
51
  var style = require("./style.cjs.js");
51
52
  var descriptors = require("./descriptors.cjs.js");
@@ -69,7 +70,7 @@ var isHotkey = require("is-hotkey");
69
70
  var slateReact = require("slate-react");
70
71
  var Lists = require("@convertkit/slate-lists");
71
72
  var textInput = require("./text-input.cjs.js");
72
- var image = require("./image.cjs.js");
73
+ var color = require("./color.cjs.js");
73
74
  var reactDom = require("react-dom");
74
75
  function _interopDefaultLegacy(e) {
75
76
  return e && typeof e === "object" && "default" in e ? e : { "default": e };
@@ -632,11 +633,11 @@ function useBackgrounds(value) {
632
633
  angle: bg.payload.angle,
633
634
  isRadial: bg.payload.isRadial,
634
635
  stops: bg.payload.stops.map((_b2) => {
635
- var _c = _b2, { color } = _c, restOfStop = __objRest(_c, ["color"]);
636
+ var _c = _b2, { color: color2 } = _c, restOfStop = __objRest(_c, ["color"]);
636
637
  return __spreadProps(__spreadValues({}, restOfStop), {
637
- color: color && {
638
- swatch: swatches.find((s) => s && s.id === color.swatchId),
639
- alpha: color.alpha
638
+ color: color2 && {
639
+ swatch: swatches.find((s) => s && s.id === color2.swatchId),
640
+ alpha: color2.alpha
640
641
  }
641
642
  });
642
643
  })
@@ -661,11 +662,11 @@ function useBackgrounds(value) {
661
662
  }, [filesResult, swatchesResult, value]);
662
663
  }
663
664
  function mapSideColor(swatches, _c) {
664
- var _d = _c, { color } = _d, restOfSide = __objRest(_d, ["color"]);
665
+ var _d = _c, { color: color2 } = _d, restOfSide = __objRest(_d, ["color"]);
665
666
  return __spreadProps(__spreadValues({}, restOfSide), {
666
- color: color && {
667
- alpha: color.alpha,
668
- swatch: swatches.find((s) => s && s.id === color.swatchId)
667
+ color: color2 && {
668
+ alpha: color2.alpha,
669
+ swatch: swatches.find((s) => s && s.id === color2.swatchId)
669
670
  }
670
671
  });
671
672
  }
@@ -705,7 +706,7 @@ const ShadowDefaultValue = {
705
706
  };
706
707
  function useBoxShadow(value) {
707
708
  const swatchIds = value == null ? [] : [
708
- ...Array.from(new Set(value.map(({ value: shadows }) => shadows.map(({ payload: { color } }) => color && color.swatchId)).reduce((a, b) => a.concat(b), []).filter(isNonNullable)))
709
+ ...Array.from(new Set(value.map(({ value: shadows }) => shadows.map(({ payload: { color: color2 } }) => color2 && color2.swatchId)).reduce((a, b) => a.concat(b), []).filter(isNonNullable)))
709
710
  ];
710
711
  const skip = value == null || swatchIds.length === 0;
711
712
  const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
@@ -717,15 +718,15 @@ function useBoxShadow(value) {
717
718
  return __spreadProps(__spreadValues({}, restOfValue), {
718
719
  value: shadows.map((_a2) => {
719
720
  var _b2 = _a2, {
720
- payload: { color, inset, offsetX, offsetY, blurRadius, spreadRadius }
721
+ payload: { color: color2, inset, offsetX, offsetY, blurRadius, spreadRadius }
721
722
  } = _b2, restOfShadow = __objRest(_b2, [
722
723
  "payload"
723
724
  ]);
724
725
  return __spreadProps(__spreadValues({}, restOfShadow), {
725
726
  payload: {
726
- color: color != null ? {
727
- swatch: swatches.find((s) => s && s.id === color.swatchId),
728
- alpha: color.alpha
727
+ color: color2 != null ? {
728
+ swatch: swatches.find((s) => s && s.id === color2.swatchId),
729
+ alpha: color2.alpha
729
730
  } : null,
730
731
  inset: inset != null ? inset : ShadowDefaultValue.inset,
731
732
  offsetX: offsetX != null ? offsetX : ShadowDefaultValue.offsetX,
@@ -738,14 +739,14 @@ function useBoxShadow(value) {
738
739
  });
739
740
  });
740
741
  }
741
- function useResponsiveColor(color) {
742
- const swatchIds = color == null ? [] : [...Array.from(new Set(color.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
742
+ function useResponsiveColor(color2) {
743
+ const swatchIds = color2 == null ? [] : [...Array.from(new Set(color2.map(({ value: v }) => v && v.swatchId).filter(isNonNullable)))];
743
744
  const skip = swatchIds.length === 0;
744
745
  const { error, data = {} } = useQuery(SWATCHES_BY_ID, { skip, variables: { ids: swatchIds } });
745
- if (color == null || error != null)
746
+ if (color2 == null || error != null)
746
747
  return null;
747
748
  const { swatches = [] } = data;
748
- return color.map((_a) => {
749
+ return color2.map((_a) => {
749
750
  var _b = _a, { value: v } = _b, rest = __objRest(_b, ["value"]);
750
751
  const { swatchId, alpha } = v;
751
752
  const swatch = swatches.find((s) => s && s.id === swatchId);
@@ -1114,8 +1115,8 @@ const getIndexes = (spans, index) => {
1114
1115
  }
1115
1116
  return [rowIndex, remainder];
1116
1117
  };
1117
- function colorToString(color) {
1118
- return color && color.swatch ? `hsla(${color.swatch.hue},${color.swatch.saturation}%,${color.swatch.lightness}%,${color.alpha})` : "";
1118
+ function colorToString(color2) {
1119
+ return color2 && color2.swatch ? `hsla(${color2.swatch.hue},${color2.swatch.saturation}%,${color2.swatch.lightness}%,${color2.alpha})` : "";
1119
1120
  }
1120
1121
  function cssMediaRules(responsiveValues, join$1, strategy) {
1121
1122
  return (props) => join(typeof responsiveValues === "function" ? responsiveValues(props) : responsiveValues, join$1, strategy).reduce((acc, { deviceId, value }) => {
@@ -1185,7 +1186,7 @@ function cssPadding(defaultValue = {}) {
1185
1186
  `;
1186
1187
  }
1187
1188
  const defaultBorderSide = { width: 0, style: "solid", color: null };
1188
- const getBorderSide = ({ width, style: style2, color }) => `${width != null ? width : 0}px ${style2} ${color != null ? colorToString(color) : "black"}`;
1189
+ const getBorderSide = ({ width, style: style2, color: color2 }) => `${width != null ? width : 0}px ${style2} ${color2 != null ? colorToString(color2) : "black"}`;
1189
1190
  function cssBorder(defaultValue = {}) {
1190
1191
  const defaultBorderTop = defaultValue.borderTop === void 0 ? defaultBorderSide : defaultValue.borderTop;
1191
1192
  const defaultBorderRight = defaultValue.borderRight === void 0 ? defaultBorderSide : defaultValue.borderRight;
@@ -1231,7 +1232,7 @@ function cssBorderRadius(defaultValue = {}) {
1231
1232
  `)}
1232
1233
  `;
1233
1234
  }
1234
- const getBoxShadow = (shadows) => shadows.map(({ payload: { inset, offsetX, offsetY, blurRadius, spreadRadius, color } }) => `${inset ? "inset " : ""}${offsetX.toFixed(1)}px ${offsetY.toFixed(1)}px ${blurRadius}px ${spreadRadius}px ${color != null ? colorToString(color) : "rgba(0,0,0,0.2)"}`).filter(Boolean).join();
1235
+ const getBoxShadow = (shadows) => shadows.map(({ payload: { inset, offsetX, offsetY, blurRadius, spreadRadius, color: color2 } }) => `${inset ? "inset " : ""}${offsetX.toFixed(1)}px ${offsetY.toFixed(1)}px ${blurRadius}px ${spreadRadius}px ${color2 != null ? colorToString(color2) : "rgba(0,0,0,0.2)"}`).filter(Boolean).join();
1235
1236
  function cssBoxShadow(defaultValue = []) {
1236
1237
  return (props) => styled.css`
1237
1238
  ${cssMediaRules([props.boxShadow], ([boxShadow = defaultValue]) => styled.css`
@@ -1518,11 +1519,11 @@ function BackgroundVideo({
1518
1519
  })]
1519
1520
  });
1520
1521
  }
1521
- function getColor(color) {
1522
- if (color == null)
1522
+ function getColor(color2) {
1523
+ if (color2 == null)
1523
1524
  return "black";
1524
- if (color.swatch == null) {
1525
- return colorToString(__spreadProps(__spreadValues({}, color), {
1525
+ if (color2.swatch == null) {
1526
+ return colorToString(__spreadProps(__spreadValues({}, color2), {
1526
1527
  swatch: {
1527
1528
  hue: 0,
1528
1529
  saturation: 0,
@@ -1530,12 +1531,12 @@ function getColor(color) {
1530
1531
  }
1531
1532
  }));
1532
1533
  }
1533
- return colorToString(color);
1534
+ return colorToString(color2);
1534
1535
  }
1535
1536
  const getStopsStyle = (stops) => stops.map(({
1536
- color,
1537
+ color: color2,
1537
1538
  location
1538
- }) => `${getColor(color)} ${location}%`).join(",");
1539
+ }) => `${getColor(color2)} ${location}%`).join(",");
1539
1540
  const getAspectRatio = (aspectRatio) => {
1540
1541
  switch (aspectRatio) {
1541
1542
  case "wide":
@@ -2171,7 +2172,7 @@ const StyledButton$1 = styled__default["default"](Link).withConfig({
2171
2172
  lightness: 100
2172
2173
  },
2173
2174
  alpha: 1
2174
- }, color = {
2175
+ }, color2 = {
2175
2176
  swatch: {
2176
2177
  hue: 0,
2177
2178
  saturation: 0,
@@ -2202,35 +2203,35 @@ const StyledButton$1 = styled__default["default"](Link).withConfig({
2202
2203
  font-size: ${`${fontSize.value}${fontSize.unit}`};
2203
2204
  ${{
2204
2205
  flat: styled.css`
2205
- background: ${colorToString(color)};
2206
+ background: ${colorToString(color2)};
2206
2207
  border: none;
2207
2208
  transition: ${["color", "background", "border", "box-shadow"].map((property) => `${property} 0.15s ease-in-out`).join(", ")};
2208
2209
 
2209
2210
  :hover {
2210
- background: ${ColorHelper__default["default"](colorToString(color)).darken(0.1).hex()};
2211
+ background: ${ColorHelper__default["default"](colorToString(color2)).darken(0.1).hex()};
2211
2212
  }
2212
2213
 
2213
2214
  :active {
2214
- background: ${ColorHelper__default["default"](colorToString(color)).darken(0.15).hex()};
2215
+ background: ${ColorHelper__default["default"](colorToString(color2)).darken(0.15).hex()};
2215
2216
  }
2216
2217
  `,
2217
2218
  outline: styled.css`
2218
2219
  background: transparent;
2219
- box-shadow: inset 0 0 0 2px ${colorToString(color)};
2220
+ box-shadow: inset 0 0 0 2px ${colorToString(color2)};
2220
2221
  transition: ${["color", "background", "box-shadow"].map((property) => `${property} 0.15s ease-in-out`).join(", ")};
2221
2222
 
2222
2223
  :hover {
2223
- box-shadow: inset 0 0 0 2px ${ColorHelper__default["default"](colorToString(color)).darken(0.1).hex()};
2224
- color: ${ColorHelper__default["default"](colorToString(color)).darken(0.1).hex()};
2224
+ box-shadow: inset 0 0 0 2px ${ColorHelper__default["default"](colorToString(color2)).darken(0.1).hex()};
2225
+ color: ${ColorHelper__default["default"](colorToString(color2)).darken(0.1).hex()};
2225
2226
  }
2226
2227
 
2227
2228
  :active {
2228
- box-shadow: inset 0 0 0 2px ${ColorHelper__default["default"](colorToString(color)).darken(0.15).hex()};
2229
- color: ${ColorHelper__default["default"](colorToString(color)).darken(0.15).hex()};
2229
+ box-shadow: inset 0 0 0 2px ${ColorHelper__default["default"](colorToString(color2)).darken(0.15).hex()};
2230
+ color: ${ColorHelper__default["default"](colorToString(color2)).darken(0.15).hex()};
2230
2231
  }
2231
2232
  `,
2232
2233
  shadow: styled.css`
2233
- background: ${colorToString(color)};
2234
+ background: ${colorToString(color2)};
2234
2235
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.2);
2235
2236
  transition: ${["transform", "box-shadow"].map((property) => `${property} 0.18s`).join(", ")};
2236
2237
 
@@ -2257,28 +2258,28 @@ const StyledButton$1 = styled__default["default"](Link).withConfig({
2257
2258
  }
2258
2259
  `,
2259
2260
  blocky: styled.css`
2260
- background: ${colorToString(color)};
2261
+ background: ${colorToString(color2)};
2261
2262
  border-width: 1px;
2262
2263
  border-style: solid;
2263
- border-color: ${ColorHelper__default["default"](colorToString(color)).darken(0.25).hex()};
2264
- box-shadow: 0 4px ${ColorHelper__default["default"](colorToString(color)).darken(0.25).hex()};
2264
+ border-color: ${ColorHelper__default["default"](colorToString(color2)).darken(0.25).hex()};
2265
+ box-shadow: 0 4px ${ColorHelper__default["default"](colorToString(color2)).darken(0.25).hex()};
2265
2266
  transition: ${["transform", "box-shadow"].map((property) => `${property} 0.1s`).join(", ")};
2266
2267
 
2267
2268
  :hover {
2268
2269
  transform: translateY(2px);
2269
- box-shadow: 0 2px ${ColorHelper__default["default"](colorToString(color)).darken(0.25).hex()};
2270
+ box-shadow: 0 2px ${ColorHelper__default["default"](colorToString(color2)).darken(0.25).hex()};
2270
2271
  }
2271
2272
 
2272
2273
  :active {
2273
2274
  transform: translateY(4px);
2274
- box-shadow: 0 0 ${ColorHelper__default["default"](colorToString(color)).darken(0.25).hex()};
2275
+ box-shadow: 0 0 ${ColorHelper__default["default"](colorToString(color2)).darken(0.25).hex()};
2275
2276
  }
2276
2277
  `,
2277
2278
  bubbly: styled.css`
2278
2279
  background: linear-gradient(
2279
2280
  180deg,
2280
- ${ColorHelper__default["default"](colorToString(color)).lighten(0.05).hex()},
2281
- ${ColorHelper__default["default"](colorToString(color)).darken(0.3).saturate(0.05).hex()}
2281
+ ${ColorHelper__default["default"](colorToString(color2)).lighten(0.05).hex()},
2282
+ ${ColorHelper__default["default"](colorToString(color2)).darken(0.3).saturate(0.05).hex()}
2282
2283
  );
2283
2284
  position: relative;
2284
2285
  z-index: 0;
@@ -2294,8 +2295,8 @@ const StyledButton$1 = styled__default["default"](Link).withConfig({
2294
2295
  border-radius: inherit;
2295
2296
  background: linear-gradient(
2296
2297
  180deg,
2297
- ${ColorHelper__default["default"](colorToString(color)).lighten(0.2).hex()},
2298
- ${ColorHelper__default["default"](colorToString(color)).darken(0.2).saturate(0.05).hex()}
2298
+ ${ColorHelper__default["default"](colorToString(color2)).lighten(0.2).hex()},
2299
+ ${ColorHelper__default["default"](colorToString(color2)).darken(0.2).saturate(0.05).hex()}
2299
2300
  );
2300
2301
  opacity: 0;
2301
2302
  transition: opacity 0.15s;
@@ -2325,7 +2326,7 @@ const StyledButton$1 = styled__default["default"](Link).withConfig({
2325
2326
  bottom: 0;
2326
2327
  left: 0;
2327
2328
  z-index: -1;
2328
- background: ${colorToString(color)};
2329
+ background: ${colorToString(color2)};
2329
2330
  transform: skewX(-12deg);
2330
2331
  border-radius: inherit;
2331
2332
  transition: transform 0.2s cubic-bezier(0.25, 0, 0.25, 1.75);
@@ -2353,7 +2354,7 @@ const Button$1 = React.forwardRef(function Button2(_m, ref) {
2353
2354
  shape: shape2,
2354
2355
  size,
2355
2356
  textColor,
2356
- color,
2357
+ color: color2,
2357
2358
  textStyle,
2358
2359
  width,
2359
2360
  margin,
@@ -2376,7 +2377,7 @@ const Button$1 = React.forwardRef(function Button2(_m, ref) {
2376
2377
  ref,
2377
2378
  id,
2378
2379
  className: css.cx(css.css(responsiveWidth(width, "auto")), className),
2379
- color,
2380
+ color: color2,
2380
2381
  link,
2381
2382
  margin,
2382
2383
  shape: shape2,
@@ -2703,7 +2704,7 @@ const Slop = styled__default["default"].div.withConfig({
2703
2704
  align-items: center;
2704
2705
  cursor: pointer;
2705
2706
  z-index: 2;
2706
- ${(p) => cssMediaRules([p.color], ([color = {
2707
+ ${(p) => cssMediaRules([p.color], ([color2 = {
2707
2708
  swatch: {
2708
2709
  hue: 0,
2709
2710
  saturation: 0,
@@ -2711,7 +2712,7 @@ const Slop = styled__default["default"].div.withConfig({
2711
2712
  },
2712
2713
  alpha: 1
2713
2714
  }]) => styled.css`
2714
- color: ${colorToString(color)};
2715
+ color: ${colorToString(color2)};
2715
2716
  `)}
2716
2717
  `;
2717
2718
  const Slide = styled__default["default"](framerMotion.motion.div).withConfig({
@@ -2812,7 +2813,7 @@ const Dots = styled__default["default"].div.withConfig({
2812
2813
  display: ${(props) => props.hidden ? "none" : "flex"};
2813
2814
  justify-content: center;
2814
2815
  margin-top: 20px;
2815
- ${(p) => cssMediaRules([p.color], ([color = {
2816
+ ${(p) => cssMediaRules([p.color], ([color2 = {
2816
2817
  swatch: {
2817
2818
  hue: 0,
2818
2819
  saturation: 0,
@@ -2820,7 +2821,7 @@ const Dots = styled__default["default"].div.withConfig({
2820
2821
  },
2821
2822
  alpha: 1
2822
2823
  }]) => styled.css`
2823
- color: ${colorToString(color)};
2824
+ color: ${colorToString(color2)};
2824
2825
  `)}
2825
2826
  `;
2826
2827
  const Dot = styled__default["default"].div.withConfig({
@@ -3626,7 +3627,7 @@ const Line = styled__default["default"].div.withConfig({
3626
3627
  ${(p) => cssMediaRules([p.variant, p.thickness, p.color], ([variant = "solid", thickness = {
3627
3628
  value: 1,
3628
3629
  unit: "px"
3629
- }, color = {
3630
+ }, color2 = {
3630
3631
  swatch: {
3631
3632
  hue: 0,
3632
3633
  saturation: 0,
@@ -3641,17 +3642,17 @@ const Line = styled__default["default"].div.withConfig({
3641
3642
  return styled.css`
3642
3643
  border-bottom-width: ${thickness == null ? "1px" : `${thickness.value}${thickness.unit}`};
3643
3644
  border-bottom-style: ${variant};
3644
- border-bottom-color: ${colorToString(color)};
3645
+ border-bottom-color: ${colorToString(color2)};
3645
3646
  `;
3646
3647
  case "blended":
3647
3648
  return styled.css`
3648
3649
  height: ${`${thickness.value}${thickness.unit}`};
3649
3650
  background: linear-gradient(
3650
3651
  ${["90deg", colorToString({
3651
- swatch: color.swatch,
3652
+ swatch: color2.swatch,
3652
3653
  alpha: 0
3653
- }), colorToString(color), colorToString({
3654
- swatch: color.swatch,
3654
+ }), colorToString(color2), colorToString({
3655
+ swatch: color2.swatch,
3655
3656
  alpha: 0
3656
3657
  })].join(", ")}
3657
3658
  );
@@ -3665,7 +3666,7 @@ const Divider = React.forwardRef(function Divider2({
3665
3666
  id,
3666
3667
  variant,
3667
3668
  thickness,
3668
- color,
3669
+ color: color2,
3669
3670
  width,
3670
3671
  margin
3671
3672
  }, ref) {
@@ -3678,7 +3679,7 @@ const Divider = React.forwardRef(function Divider2({
3678
3679
  children: /* @__PURE__ */ jsxRuntime.jsx(Line, {
3679
3680
  variant,
3680
3681
  thickness,
3681
- color
3682
+ color: color2
3682
3683
  })
3683
3684
  })
3684
3685
  });
@@ -5884,7 +5885,7 @@ const StyledDropDownItem = styled__default["default"](Link).withConfig({
5884
5885
  background-color: transparent;
5885
5886
  transition: background-color 0.2s;
5886
5887
  ${cssTextStyle()}
5887
- ${(p) => cssMediaRules([p.color, p.textStyle], ([color, textStyle = {}]) => {
5888
+ ${(p) => cssMediaRules([p.color, p.textStyle], ([color2, textStyle = {}]) => {
5888
5889
  const fontSize = textStyle.fontSize || {
5889
5890
  value: 14,
5890
5891
  unit: "px"
@@ -5894,7 +5895,7 @@ const StyledDropDownItem = styled__default["default"](Link).withConfig({
5894
5895
  const letterSpacing = textStyle.letterSpacing == null ? null : textStyle.letterSpacing;
5895
5896
  const textTransform = textStyle.textTransform || [];
5896
5897
  return styled.css`
5897
- color: ${color == null ? "black" : colorToString(color)};
5898
+ color: ${color2 == null ? "black" : colorToString(color2)};
5898
5899
  font-size: ${`${fontSize.value}${fontSize.unit}`};
5899
5900
  font-weight: ${fontWeight};
5900
5901
  font-style: ${fontStyle.includes("italic") ? "italic" : "normal"};
@@ -5909,12 +5910,12 @@ const StyledDropDownItem = styled__default["default"](Link).withConfig({
5909
5910
  `;
5910
5911
  function DropDownItem$1(_S) {
5911
5912
  var _T = _S, {
5912
- color
5913
+ color: color2
5913
5914
  } = _T, restOfProps = __objRest(_T, [
5914
5915
  "color"
5915
5916
  ]);
5916
5917
  return /* @__PURE__ */ jsxRuntime.jsx(StyledDropDownItem, __spreadProps(__spreadValues({}, restOfProps), {
5917
- color: useResponsiveColor(color)
5918
+ color: useResponsiveColor(color2)
5918
5919
  }));
5919
5920
  }
5920
5921
  function DropDownButton(_U) {
@@ -5923,7 +5924,7 @@ function DropDownButton(_U) {
5923
5924
  caret = "caret",
5924
5925
  links: links2 = [],
5925
5926
  textColor,
5926
- color
5927
+ color: color2
5927
5928
  } = _V, restOfProps = __objRest(_V, [
5928
5929
  "label",
5929
5930
  "caret",
@@ -5944,7 +5945,7 @@ function DropDownButton(_U) {
5944
5945
  ref: container,
5945
5946
  children: [/* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
5946
5947
  textColor: useResponsiveColor(textColor),
5947
- color: useResponsiveColor(color),
5948
+ color: useResponsiveColor(color2),
5948
5949
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
5949
5950
  style: {
5950
5951
  display: "flex",
@@ -6018,18 +6019,18 @@ const StyledLink$2 = styled__default["default"](Link).withConfig({
6018
6019
  padding: 8px 16px;
6019
6020
  color: black;
6020
6021
  ${cssTextStyle()}
6021
- ${(p) => cssMediaRules([p.color], ([color]) => styled.css`
6022
- color: ${color == null ? "black" : colorToString(color)};
6022
+ ${(p) => cssMediaRules([p.color], ([color2]) => styled.css`
6023
+ color: ${color2 == null ? "black" : colorToString(color2)};
6023
6024
  `)}
6024
6025
  `;
6025
6026
  function DropDownItem(_W) {
6026
6027
  var _X = _W, {
6027
- color
6028
+ color: color2
6028
6029
  } = _X, restOfProps = __objRest(_X, [
6029
6030
  "color"
6030
6031
  ]);
6031
6032
  return /* @__PURE__ */ jsxRuntime.jsx(StyledLink$2, __spreadProps(__spreadValues({}, restOfProps), {
6032
- color: useResponsiveColor(color)
6033
+ color: useResponsiveColor(color2)
6033
6034
  }));
6034
6035
  }
6035
6036
  function MobileDropDownButton(_Y) {
@@ -6039,7 +6040,7 @@ function MobileDropDownButton(_Y) {
6039
6040
  links: links2 = [],
6040
6041
  onClose = () => {
6041
6042
  },
6042
- color,
6043
+ color: color2,
6043
6044
  textColor
6044
6045
  } = _Z, restOfProps = __objRest(_Z, [
6045
6046
  "label",
@@ -6053,7 +6054,7 @@ function MobileDropDownButton(_Y) {
6053
6054
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, {
6054
6055
  children: [/* @__PURE__ */ jsxRuntime.jsx(ButtonLink$1, __spreadProps(__spreadValues({}, restOfProps), {
6055
6056
  textColor: useResponsiveColor(textColor),
6056
- color: useResponsiveColor(color),
6057
+ color: useResponsiveColor(color2),
6057
6058
  onPointerDown: () => setIsOpen((prev) => !prev),
6058
6059
  children: /* @__PURE__ */ jsxRuntime.jsxs("div", {
6059
6060
  style: {
@@ -6090,14 +6091,14 @@ function MobileDropDownButton(_Y) {
6090
6091
  function NavigationButton$1(props) {
6091
6092
  const _a = props, {
6092
6093
  textColor,
6093
- color
6094
+ color: color2
6094
6095
  } = _a, restOfProps = __objRest(_a, [
6095
6096
  "textColor",
6096
6097
  "color"
6097
6098
  ]);
6098
6099
  return /* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
6099
6100
  textColor: useResponsiveColor(textColor),
6100
- color: useResponsiveColor(color)
6101
+ color: useResponsiveColor(color2)
6101
6102
  }));
6102
6103
  }
6103
6104
  const ButtonLink = styled__default["default"](NavigationButton$1)`
@@ -6148,8 +6149,8 @@ const CloseIconContainer = styled__default["default"].button.withConfig({
6148
6149
  outline: 0;
6149
6150
  background: none;
6150
6151
  fill: currentColor;
6151
- ${(p) => cssMediaRules([p.color], ([color]) => styled.css`
6152
- color: ${color == null ? "rgba(161, 168, 194, 0.5)" : colorToString(color)};
6152
+ ${(p) => cssMediaRules([p.color], ([color2]) => styled.css`
6153
+ color: ${color2 == null ? "rgba(161, 168, 194, 0.5)" : colorToString(color2)};
6153
6154
  `)}
6154
6155
  `;
6155
6156
  function MobileMenu({
@@ -6223,23 +6224,23 @@ const OpenIconContainer = styled__default["default"].button.withConfig({
6223
6224
  border: 0;
6224
6225
  padding: 0;
6225
6226
  fill: currentColor;
6226
- ${(p) => cssMediaRules([p.mobileMenuAnimation, p.alignment, p.color], ([mobileMenuAnimation, alignment = "flex-end", color]) => styled.css`
6227
+ ${(p) => cssMediaRules([p.mobileMenuAnimation, p.alignment, p.color], ([mobileMenuAnimation, alignment = "flex-end", color2]) => styled.css`
6227
6228
  display: ${mobileMenuAnimation == null ? "none" : "flex"};
6228
6229
  justify-content: ${alignment};
6229
- color: ${color == null ? "rgba(161, 168, 194, 0.5)" : colorToString(color)};
6230
+ color: ${color2 == null ? "rgba(161, 168, 194, 0.5)" : colorToString(color2)};
6230
6231
  `)}
6231
6232
  `;
6232
6233
  function NavigationButton(props) {
6233
6234
  const _a = props, {
6234
6235
  textColor,
6235
- color
6236
+ color: color2
6236
6237
  } = _a, restOfProps = __objRest(_a, [
6237
6238
  "textColor",
6238
6239
  "color"
6239
6240
  ]);
6240
6241
  return /* @__PURE__ */ jsxRuntime.jsx(Button$1, __spreadProps(__spreadValues({}, restOfProps), {
6241
6242
  textColor: useResponsiveColor(textColor),
6242
- color: useResponsiveColor(color)
6243
+ color: useResponsiveColor(color2)
6243
6244
  }));
6244
6245
  }
6245
6246
  const placeholder = {
@@ -7566,15 +7567,15 @@ function useTypography(typographyId) {
7566
7567
  return data == null ? void 0 : data.typographies[0];
7567
7568
  }
7568
7569
  const concat = (a, b) => a.concat(b);
7569
- const getSwatchId = ({ value: { color } }) => color && color.swatchId;
7570
+ const getSwatchId = ({ value: { color: color2 } }) => color2 && color2.swatchId;
7570
7571
  const getDeviceId = ({ deviceId }) => deviceId;
7571
7572
  const withColor = (swatches) => (_a) => {
7572
- var _b = _a, { value: _c } = _b, _d = _c, { color } = _d, restOfValue = __objRest(_d, ["color"]), rest = __objRest(_b, ["value"]);
7573
+ var _b = _a, { value: _c } = _b, _d = _c, { color: color2 } = _d, restOfValue = __objRest(_d, ["color"]), rest = __objRest(_b, ["value"]);
7573
7574
  return __spreadProps(__spreadValues({}, rest), {
7574
- value: __spreadValues(__spreadValues({}, restOfValue), color ? {
7575
+ value: __spreadValues(__spreadValues({}, restOfValue), color2 ? {
7575
7576
  color: {
7576
- swatch: swatches.find((s) => s && s.id === color.swatchId),
7577
- alpha: color.alpha
7577
+ swatch: swatches.find((s) => s && s.id === color2.swatchId),
7578
+ alpha: color2.alpha
7578
7579
  }
7579
7580
  } : {})
7580
7581
  });
@@ -7603,7 +7604,7 @@ function useTypographyMark(value) {
7603
7604
  }
7604
7605
  const Span = styled__default["default"].span`
7605
7606
  ${(p) => cssMediaRules([p.typographyStyle], ([{
7606
- color,
7607
+ color: color2,
7607
7608
  fontFamily,
7608
7609
  fontSize,
7609
7610
  fontWeight,
@@ -7614,8 +7615,8 @@ const Span = styled__default["default"].span`
7614
7615
  strikethrough,
7615
7616
  italic
7616
7617
  } = {}]) => styled.css`
7617
- ${color == null ? "" : styled.css`
7618
- color: ${colorToString(color)};
7618
+ ${color2 == null ? "" : styled.css`
7619
+ color: ${colorToString(color2)};
7619
7620
  `}
7620
7621
 
7621
7622
  ${fontFamily == null ? "" : styled.css`
@@ -8825,8 +8826,8 @@ function useStyleControlCssObject(style$1, controlDefinition) {
8825
8826
  function borderSideToString(borderSide) {
8826
8827
  if (borderSide == null)
8827
8828
  return null;
8828
- const { width, color, style: style2 } = borderSide;
8829
- return `${width != null ? width : 0}px ${style2} ${color != null ? colorToString(color) : "black"}`;
8829
+ const { width, color: color2, style: style2 } = borderSide;
8830
+ return `${width != null ? width : 0}px ${style2} ${color2 != null ? colorToString(color2) : "black"}`;
8830
8831
  }
8831
8832
  function borderRadiusToString(borderRadius) {
8832
8833
  if (borderRadius == null)
@@ -8881,9 +8882,19 @@ function useColorValue(data, definition) {
8881
8882
  function useComboboxControlValue(data) {
8882
8883
  return data == null ? void 0 : data.value;
8883
8884
  }
8884
- function useImageControlValue(data) {
8885
+ function useImageControlValue(data, definition) {
8885
8886
  var _a;
8886
- return (_a = useFile(data)) == null ? void 0 : _a.publicUrl;
8887
+ const format = (_a = definition.config.format) != null ? _a : image.ImageControlValueFormat.URL;
8888
+ const file = useFile(data);
8889
+ if (format === image.ImageControlValueFormat.URL) {
8890
+ return file == null ? void 0 : file.publicUrl;
8891
+ }
8892
+ if (file == null || file.dimensions == null)
8893
+ return void 0;
8894
+ return {
8895
+ url: file.publicUrl,
8896
+ dimensions: { width: file.dimensions.width, height: file.dimensions.height }
8897
+ };
8887
8898
  }
8888
8899
  function ListControlValue({
8889
8900
  definition,
@@ -8957,7 +8968,7 @@ function ControlValue({
8957
8968
  parameters: [data, definition],
8958
8969
  children: (value) => children(value)
8959
8970
  }, definition.type);
8960
- case image.ColorControlType:
8971
+ case color.ColorControlType:
8961
8972
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
8962
8973
  hook: useColorValue,
8963
8974
  parameters: [data, definition],
@@ -8966,7 +8977,7 @@ function ControlValue({
8966
8977
  case image.ImageControlType:
8967
8978
  return /* @__PURE__ */ jsxRuntime.jsx(RenderHook, {
8968
8979
  hook: useImageControlValue,
8969
- parameters: [data],
8980
+ parameters: [data, definition],
8970
8981
  children: (value) => children(value)
8971
8982
  }, definition.type);
8972
8983
  case shape.ComboboxControlType:
@@ -9014,7 +9025,7 @@ function PropsValue({
9014
9025
  case textInput.TextInputControlType:
9015
9026
  case textInput.TextAreaControlType:
9016
9027
  case textInput.SelectControlType:
9017
- case image.ColorControlType:
9028
+ case color.ColorControlType:
9018
9029
  case image.ImageControlType:
9019
9030
  case shape.ComboboxControlType:
9020
9031
  case shape.ShapeControlType: