@orangelogic/design-system 4.57.0 → 4.58.0

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.
@@ -32,7 +32,7 @@ import { a as D, c as O, l as k, n as ve, o as A, r as j, s as M, t as N } from
32
32
  import { t as ye } from "./menu-label.B-FOyfAX.js";
33
33
  import { t as be } from "./switch.BM9msK5T.js";
34
34
  import { t as xe } from "./v4.JyXW8GUB.js";
35
- import "./cropper.BRsN8h2t.js";
35
+ import "./cropper.CNmQt-sa.js";
36
36
  import { t as Se } from "./_baseUniq.h_pGICPH.js";
37
37
  import { d as Ce, i as we, n as Te, o as Ee, p as P, r as De, s as Oe, t as ke } from "./string-array.Dstcqyjm.js";
38
38
  import { t as Ae } from "./position-picker.X2hhfGx7.js";
@@ -778,7 +778,7 @@ var Tt = class {
778
778
  }
779
779
  this.invalidWidth = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
780
780
  let n = this.unit === k.Pixel ? this.height : this.ratioHeight, r = !1;
781
- this.keepAspectRatio && (n = Math.max(Math.round(t / this.aspectRatio), 1)), this.unit === k.Pixel && this.maxHeight >= 1 && n > this.maxHeight && (n = this.maxHeight, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
781
+ this.keepAspectRatio ? n = Math.max(Math.round(t / this.aspectRatio), 1) : this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), this.unit === k.Pixel && this.maxHeight >= 1 && n > this.maxHeight && (n = this.maxHeight, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
782
782
  breakAspectRatio: r,
783
783
  height: n,
784
784
  keepAspectRatio: this.keepAspectRatio,
@@ -794,7 +794,7 @@ var Tt = class {
794
794
  }
795
795
  this.invalidHeight = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
796
796
  let n = this.unit === k.Pixel ? this.width : this.ratioWidth, r = !1;
797
- this.keepAspectRatio && (n = Math.max(Math.round(t * this.aspectRatio), 1)), this.unit === k.Pixel && this.maxWidth >= 1 && n > this.maxWidth && (n = this.maxWidth, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
797
+ this.keepAspectRatio ? n = Math.max(Math.round(t * this.aspectRatio), 1) : this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), this.unit === k.Pixel && this.maxWidth >= 1 && n > this.maxWidth && (n = this.maxWidth, r = this.keepAspectRatio), e.target.value = t.toString(), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
798
798
  breakAspectRatio: r,
799
799
  height: t,
800
800
  keepAspectRatio: this.keepAspectRatio,
@@ -920,6 +920,11 @@ var Tt = class {
920
920
  scale: 0
921
921
  } };
922
922
  }
923
+ fitRatioSides(e, t, n, r) {
924
+ if (!this.hasMaxSize || n < 1 || r < 1) return [e, t];
925
+ let i = Math.min(e, n * t);
926
+ return [i, Math.min(t, r * i)];
927
+ }
923
928
  render() {
924
929
  let t = this.cropModes.filter((e) => !e.auto), n = this.cropModes.filter((e) => e.auto);
925
930
  return e`<cx-details class="details ${this.inline ? "details--inline" : ""}" ?open=${this.inline || this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${S(t, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}
@@ -1477,9 +1482,9 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1477
1482
  this.invalidWidth = !0;
1478
1483
  return;
1479
1484
  }
1480
- this.invalidWidth = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1)), e.target.value = t.toString();
1485
+ this.invalidWidth = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
1481
1486
  let n = this.unit === k.Pixel ? this.height : this.ratioHeight;
1482
- this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1487
+ !this.keepAspectRatio && this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1483
1488
  height: n,
1484
1489
  keepAspectRatio: this.keepAspectRatio,
1485
1490
  unit: this.unit,
@@ -1492,9 +1497,9 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1492
1497
  this.invalidHeight = !0;
1493
1498
  return;
1494
1499
  }
1495
- this.invalidHeight = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1)), e.target.value = t.toString();
1500
+ this.invalidHeight = !1, this.unit === k.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
1496
1501
  let n = this.unit === k.Pixel ? this.width : this.ratioWidth;
1497
- this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1502
+ !this.keepAspectRatio && this.unit === k.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
1498
1503
  height: t,
1499
1504
  keepAspectRatio: this.keepAspectRatio,
1500
1505
  unit: this.unit,
@@ -1535,6 +1540,11 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
1535
1540
  width: this.unit === k.Pixel ? this.width : this.ratioWidth
1536
1541
  } });
1537
1542
  }
1543
+ fitRatioSides(e, t, n, r) {
1544
+ if (!Number.isFinite(n) || !Number.isFinite(r) || n < 1 || r < 1) return [e, t];
1545
+ let i = Math.min(e, n * t);
1546
+ return [i, Math.min(t, r * i)];
1547
+ }
1538
1548
  render() {
1539
1549
  return e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{ num: {
1540
1550
  mask: Number,
@@ -1772,6 +1782,13 @@ var Wt = X, Z, Gt = {
1772
1782
  static getTransformExtension(e) {
1773
1783
  return !e || St(e) ? e : "jpg";
1774
1784
  }
1785
+ static fitRatioResizeSize(e, t, n, r) {
1786
+ let { height: i, width: a } = ie(n, r, e, t);
1787
+ return {
1788
+ height: Math.max(i, 1),
1789
+ width: Math.max(a, 1)
1790
+ };
1791
+ }
1775
1792
  static uniqueTransformations(e) {
1776
1793
  return [...new Map(e.map((e) => [e.key, e])).values()];
1777
1794
  }
@@ -2736,7 +2753,7 @@ var Wt = X, Z, Gt = {
2736
2753
  async onCropChange(e) {
2737
2754
  let t = this.cropSize.unit;
2738
2755
  if (e.detail.unit === k.AspectRatio) {
2739
- let t = e.detail.width / e.detail.height, n = this.asset ? Math.min(Math.max(Math.round(this.cropSize.height * t), 0), this.resizeSize.width) : 0, r = this.asset ? Math.min(Math.max(Math.round(n / t), 0), this.resizeSize.height) : 0, i = this.asset ? r * 100 / this.selectedFormat.height : 100, a = this.asset ? n * 100 / this.selectedFormat.width : 100, o = this.cropSize.x, s = this.cropSize.y;
2756
+ let t = e.detail.width / e.detail.height, n = this.asset ? Math.min(Math.max(Math.round(this.cropSize.height * t), 1), this.resizeSize.width) : 0, r = this.asset ? Math.min(Math.max(Math.round(n / t), 1), this.resizeSize.height) : 0, i = this.asset ? r * 100 / this.selectedFormat.height : 100, a = this.asset ? n * 100 / this.selectedFormat.width : 100, o = this.cropSize.x, s = this.cropSize.y;
2740
2757
  o + a > 100 && (o = 100 - a), s + i > 100 && (s = 100 - i);
2741
2758
  let c = this.cropSize.cropMode, l = this.cropModes.find((e) => e.value === c)?.auto, u = /^(\d+):(\d+)$/.exec(c), d = u !== null && !e.detail.keepAspectRatio && Number(u[1]) * e.detail.height !== Number(u[2]) * e.detail.width;
2742
2759
  (l || d) && (c = "free"), e.detail.silent ? (this.cropSize.height = r, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = a, this.cropSize.ratioHeight = e.detail.height, this.cropSize.ratioWidth = e.detail.width, this.cropSize.unit = k.AspectRatio, this.cropSize.width = n) : this.cropSize = {
@@ -2860,12 +2877,21 @@ var Wt = X, Z, Gt = {
2860
2877
  }
2861
2878
  }]);
2862
2879
  }
2880
+ getRatioResizePreviewSize(e, t) {
2881
+ let { height: n, width: r } = this.imageSize;
2882
+ if (this.asset && r && n) return Z.fitRatioResizeSize(e, t, r, n);
2883
+ let i = e / t, a = Math.max(Math.round(this.lastResizeSize[k.Pixel].height * i), 0);
2884
+ return {
2885
+ height: Math.max(Math.round(a / i), 0),
2886
+ width: a
2887
+ };
2888
+ }
2863
2889
  onResizeChange(e) {
2864
2890
  if (e.detail.unit === k.AspectRatio) {
2865
- let t = e.detail.width / e.detail.height, n = Math.max(Math.round(this.lastResizeSize[k.Pixel].height * t), 0), r = Math.max(Math.round(n / t), 0);
2891
+ let { height: t, width: n } = this.getRatioResizePreviewSize(e.detail.width, e.detail.height);
2866
2892
  this.resizeSize = {
2867
2893
  ...this.resizeSize,
2868
- height: r,
2894
+ height: t,
2869
2895
  keepAspectRatio: e.detail.keepAspectRatio,
2870
2896
  ratioHeight: e.detail.height,
2871
2897
  ratioWidth: e.detail.width,
@@ -2908,7 +2934,7 @@ var Wt = X, Z, Gt = {
2908
2934
  }
2909
2935
  if (!this.selectedFormat) return;
2910
2936
  let i = this.selectedFormat.width || this.defaultSize.width, a = this.selectedFormat.height || this.defaultSize.height, o = r, s = t;
2911
- this.resizeSize.unit === n ? n === k.AspectRatio && (o = Math.round(r / t * a), s = a) : (o = i, s = a), this.transformations = [...this.transformations, {
2937
+ this.resizeSize.unit === n ? n === k.AspectRatio && ({height: s, width: o} = Z.fitRatioResizeSize(r, t, i, a)) : (o = i, s = a), this.transformations = [...this.transformations, {
2912
2938
  key: O.Resize,
2913
2939
  value: {
2914
2940
  height: s,
@@ -69,7 +69,7 @@ import { t as bt } from "./bicolor-picker.DZY5PP24.js";
69
69
  import { t as xt } from "./border-input-group.BymzNWba.js";
70
70
  import { n as St, t as Ct } from "./confirm-popover.DUrgLQjC.js";
71
71
  import { t as wt } from "./corner-position-input-group.mrOiz-0k.js";
72
- import { t as Tt } from "./cropper.BRsN8h2t.js";
72
+ import { t as Tt } from "./cropper.CNmQt-sa.js";
73
73
  import { t as Et } from "./dynamic-select.Dwcz7UjN.js";
74
74
  import { t as Dt } from "./string-array.Dstcqyjm.js";
75
75
  import { n as M, r as Ot, t as N } from "./folder-select.Buoz3ioX.js";
@@ -79,7 +79,7 @@ import { t as jt } from "./padding-input-group.B-hbA7P2.js";
79
79
  import { t as Mt } from "./position-picker.X2hhfGx7.js";
80
80
  import { t as Nt } from "./shadow-input-group.B_W5gJ4u.js";
81
81
  import { t as Pt } from "./size-input-group.DUyTc5na.js";
82
- import { C as Ft, S as It, T as Lt, _ as Rt, b as zt, c as Bt, f as Vt, g as Ht, h as Ut, i as Wt, l as Gt, n as Kt, o as qt, p as Jt, r as Yt, s as P, t as Xt, u as Zt, v as Qt, w as $t, x as en, y as tn } from "./asset-link-format.DFFHzlDh.js";
82
+ import { C as Ft, S as It, T as Lt, _ as Rt, b as zt, c as Bt, f as Vt, g as Ht, h as Ut, i as Wt, l as Gt, n as Kt, o as qt, p as Jt, r as Yt, s as P, t as Xt, u as Zt, v as Qt, w as $t, x as en, y as tn } from "./asset-link-format.zO0t0oA3.js";
83
83
  import { c as nn, d as rn, f as an, n as on, u as sn } from "./color-swatch-group.Bcw5aIqG.js";
84
84
  import { $ as cn, B as F, G as ln, O as un, P as dn, Q as fn, T as pn, X as mn, Y as hn, Z as gn, _ as _n, at as vn, ct as I, et as yn, lt as bn, ot as L, st as xn, v as Sn, w as Cn, x as wn } from "./configs-controller.uTcM4iX4.js";
85
85
  import { a as Tn } from "./cloneDeep.C6x5LNv3.js";
@@ -14,7 +14,7 @@ import { t as b } from "./style-map.DPGQIxip.js";
14
14
  import { t as x } from "./button.BjijpxeK.js";
15
15
  import { t as ee } from "./tooltip.Cc02vm6M.js";
16
16
  import { t as te } from "./line-clamp.SD3U021K.js";
17
- import { S as ne, _ as re, a as ie, b as ae, c as oe, d as se, f as ce, g as le, h as ue, i as de, l as fe, m as pe, n as me, o as he, p as ge, s as S, t as C, u as w, v as T, x as E, y as D } from "./block-width.BPsewZ8l.js";
17
+ import { S as ne, _ as re, a as ie, b as ae, c as oe, d as se, f as ce, g as le, h as ue, i as de, l as fe, m as pe, n as me, o as he, p as ge, s as S, t as C, u as w, v as T, x as E, y as D } from "./block-width.Dbc3rT3Y.js";
18
18
  import { t as O } from "./typography.B0mkhqTB.js";
19
19
  import { t as k } from "./button-group.CPfXrqyq.js";
20
20
  import { t as A } from "./card.3c-X4hqR.js";
@@ -59,7 +59,7 @@ import { t as Je } from "./padding-input-group.B-hbA7P2.js";
59
59
  import { t as Ye } from "./position-picker.X2hhfGx7.js";
60
60
  import { t as Xe } from "./shadow-input-group.B_W5gJ4u.js";
61
61
  import { t as Ze } from "./size-input-group.DUyTc5na.js";
62
- import { T as K } from "./asset-link-format.DFFHzlDh.js";
62
+ import { T as K } from "./asset-link-format.zO0t0oA3.js";
63
63
  import { n as Qe } from "./_baseXor.Ca5K0ORC.js";
64
64
  import { n as $e, s as et, t as q } from "./isArrayLikeObject.Da3IzQeH.js";
65
65
  import { i as tt } from "./_baseClone.CnI5Vpqn.js";
@@ -166,10 +166,10 @@ var F = b(), I = {
166
166
  if (a || o || !i) return;
167
167
  if (t.key === "ArrowUp" || t.key === "ArrowDown" || t.key === "ArrowLeft" || t.key === "ArrowRight") t.stopPropagation(), t.preventDefault();
168
168
  else return;
169
- let m = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? e.nudgeStepLarge : t.shiftKey ? e.nudgeStepMedium : e.nudgeStep, h = N(P(M(i, p.width, p.height), t.key, m, n), r, n, p.width, p.height, u, l, c, s);
170
- if (!O(i, h)) {
171
- let e = j(h, p.width, p.height);
172
- d(h, e), f && f(h, e);
169
+ let m = (navigator.platform.match("Mac") ? t.metaKey : t.ctrlKey) ? e.nudgeStepLarge : t.shiftKey ? e.nudgeStepMedium : e.nudgeStep, h = P(M(i, p.width, p.height), t.key, m, n), [g, _] = this.resolveMinDimensions(p, r, u, l), v = N(h, r, n, p.width, p.height, g, _, c, s);
170
+ if (!O(i, v)) {
171
+ let e = j(v, p.width, p.height);
172
+ d(v, e), f && f(v, e);
173
173
  }
174
174
  }, this.onDocPointerDone = (e) => {
175
175
  let { crop: t, disabled: n, loading: r, onComplete: i, onDragEnd: a } = this.props, o = this.getBox();
@@ -251,20 +251,16 @@ var F = b(), I = {
251
251
  let { evData: e } = this, t = this.getBox(), n = this.makePixelCrop(t), r = e.clientX - e.startClientX, i = e.clientY - e.startClientY;
252
252
  return n.x = E(e.startCropX + r, 0, t.width - n.width), n.y = E(e.startCropY + i, 0, t.height - n.height), n;
253
253
  }
254
- getPointRegion(e, t, n, r) {
255
- let { evData: i } = this, a = i.clientX - e.x, o = i.clientY - e.y, s;
256
- s = r && t ? t === "nw" || t === "n" || t === "ne" : o < i.startCropY;
257
- let c;
258
- return c = n && t ? t === "nw" || t === "w" || t === "sw" : a < i.startCropX, c ? s ? "nw" : "sw" : s ? "ne" : "se";
254
+ getPointRegion(e) {
255
+ let { evData: t } = this, n = t.clientX - e.x, r = t.clientY - e.y < t.startCropY;
256
+ return n < t.startCropX ? r ? "nw" : "sw" : r ? "ne" : "se";
259
257
  }
260
258
  resolveMinDimensions(e, t, n = 0, r = 0) {
261
259
  let i = Math.min(n, e.width), a = Math.min(r, e.height);
262
260
  return !t || !i && !a ? [i, a] : t > 1 ? i ? [i, i / t] : [a * t, a] : a ? [a * t, a] : [i, i / t];
263
261
  }
264
262
  resizeCrop() {
265
- let { evData: t } = this, { aspect: n = 0, centerCrop: r, maxHeight: i, maxWidth: a } = this.props, o = this.getBox(), [s, c] = this.resolveMinDimensions(o, n, this.props.minWidth, this.props.minHeight), l = this.makePixelCrop(o), u = this.getPointRegion(o, t.ord, s, c), d = t.ord || u, f = t.clientX - t.startClientX, p = t.clientY - t.startClientY;
266
- (s && d === "nw" || d === "w" || d === "sw") && (f = Math.min(f, -s)), (c && d === "nw" || d === "n" || d === "ne") && (p = Math.min(p, -c));
267
- let m = {
263
+ let { evData: t } = this, { aspect: n = 0, centerCrop: r, maxHeight: i, maxWidth: a } = this.props, o = this.getBox(), [s, c] = this.resolveMinDimensions(o, n, this.props.minWidth, this.props.minHeight), l = this.makePixelCrop(o), u = this.getPointRegion(o), d = t.ord || u, f = t.clientX - t.startClientX, p = t.clientY - t.startClientY, m = {
268
264
  height: 0,
269
265
  unit: "px",
270
266
  width: 0,
@@ -673,6 +669,8 @@ var B = (0, S.forwardRef)(({ cropper: e, disabled: t, fillImage: n, image: r, lo
673
669
  disabled: v,
674
670
  loading: a || l && d,
675
671
  keepSelection: !0,
672
+ minHeight: 1,
673
+ minWidth: 1,
676
674
  ruleOfThirds: !0,
677
675
  onChange: K,
678
676
  onComplete: Y,
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/asset-link-format.DFFHzlDh.js";
1
+ import { t as e } from "../chunks/asset-link-format.zO0t0oA3.js";
2
2
  export { e as default };
@@ -1,2 +1,2 @@
1
- import { t as e } from "../chunks/cropper.BRsN8h2t.js";
1
+ import { t as e } from "../chunks/cropper.CNmQt-sa.js";
2
2
  export { e as default };
@@ -3,7 +3,7 @@ import { t } from "../chunks/border-input-group.BymzNWba.js";
3
3
  import { t as n } from "../chunks/color-swatch.DZG975M_.js";
4
4
  import { t as r } from "../chunks/confirm-popover.DUrgLQjC.js";
5
5
  import { t as i } from "../chunks/corner-position-input-group.mrOiz-0k.js";
6
- import { t as a } from "../chunks/cropper.BRsN8h2t.js";
6
+ import { t as a } from "../chunks/cropper.CNmQt-sa.js";
7
7
  import { t as o } from "../chunks/dynamic-select.Dwcz7UjN.js";
8
8
  import { t as s } from "../chunks/folder-select.Buoz3ioX.js";
9
9
  import { t as c } from "../chunks/masonry.BxNeClR6.js";
@@ -1,4 +1,4 @@
1
- import { t as e } from "../chunks/asset-link-format.DFFHzlDh.js";
1
+ import { t as e } from "../chunks/asset-link-format.zO0t0oA3.js";
2
2
  import { t } from "../chunks/color-swatch-group.Bcw5aIqG.js";
3
3
  import { t as n } from "../chunks/file-on-demand.BmRBmyyq.js";
4
4
  export { e as CxAssetLinkFormat, t as CxColorSwatchGroup, n as CxFileOnDemand };
@@ -38,7 +38,7 @@ import { t as Mt } from "../chunks/tooltip.Cc02vm6M.js";
38
38
  import { t as Nt } from "../chunks/line-clamp.SD3U021K.js";
39
39
  import { t as Pt } from "../chunks/tag.Cq8m5pRP.js";
40
40
  import { t as Ft } from "../chunks/array-line-clamp.9myPWg1y.js";
41
- import { C as It, S as Lt, _ as Rt, b as zt, g as Bt, h as Vt, o as Ht, r as Ut, s as Wt, t as Gt, v as Kt, w as qt, x as Jt, y as Yt } from "../chunks/block-width.BPsewZ8l.js";
41
+ import { C as It, S as Lt, _ as Rt, b as zt, g as Bt, h as Vt, o as Ht, r as Ut, s as Wt, t as Gt, v as Kt, w as qt, x as Jt, y as Yt } from "../chunks/block-width.Dbc3rT3Y.js";
42
42
  import { n as Xt, t as Zt } from "../chunks/position-picker.dY_vgF_H.js";
43
43
  import { a as Qt, i as $t, n as en, o as tn, r as nn, s as rn, t as an } from "../chunks/src.BJhIYoMP.js";
44
44
  import { a as on, c as sn, i as cn, n as ln, o as un, r as dn, t as fn, u as pn } from "../chunks/time.p1t0NCwj.js";
@@ -149,7 +149,7 @@ import { t as Is } from "../chunks/border-input-group.BymzNWba.js";
149
149
  import { t as Ls } from "../chunks/color-swatch.DZG975M_.js";
150
150
  import { t as Rs } from "../chunks/confirm-popover.DUrgLQjC.js";
151
151
  import { t as zs } from "../chunks/corner-position-input-group.mrOiz-0k.js";
152
- import { t as Bs } from "../chunks/cropper.BRsN8h2t.js";
152
+ import { t as Bs } from "../chunks/cropper.CNmQt-sa.js";
153
153
  import { t as Vs } from "../chunks/toNumber.BBjIwSoo.js";
154
154
  import { t as Hs } from "../chunks/debounce.DrhImrNP.js";
155
155
  import { t as Us } from "../chunks/dynamic-select.Dwcz7UjN.js";
@@ -165,7 +165,7 @@ import { t as ec } from "../chunks/sidebar.CiZOJ49X.js";
165
165
  import { t as tc } from "../chunks/size-input-group.DUyTc5na.js";
166
166
  import { t as nc } from "../chunks/stepper-wizard.DgrCTDtq.js";
167
167
  import { t as rc } from "../chunks/typeface.eo-n8r2R.js";
168
- import { T as ic, _ as ac, a as oc, b as sc, c as cc, d as lc, l as uc, m as dc, n as fc, o as pc, r as mc, s as hc, t as gc, v as _c } from "../chunks/asset-link-format.DFFHzlDh.js";
168
+ import { T as ic, _ as ac, a as oc, b as sc, c as cc, d as lc, l as uc, m as dc, n as fc, o as pc, r as mc, s as hc, t as gc, v as _c } from "../chunks/asset-link-format.zO0t0oA3.js";
169
169
  import { c as vc, h as yc, l as bc, m as xc, p as Sc, t as Cc, u as wc } from "../chunks/color-swatch-group.Bcw5aIqG.js";
170
170
  import { n as eee } from "../chunks/isArrayLikeObject.Da3IzQeH.js";
171
171
  import { t as tee } from "../chunks/file-on-demand.BmRBmyyq.js";
@@ -95207,7 +95207,7 @@ var A5 = class extends d {
95207
95207
  return this.mappedSupportedLanguages.length > 1;
95208
95208
  }
95209
95209
  ensureConfigUi() {
95210
- return this.configUiPromise ??= Promise.all([import("../chunks/config-manager.IMu4B2T8.js"), import("../chunks/configs-controller.uTcM4iX4.js").then((e) => e.n)]).then(async ([, e]) => {
95210
+ return this.configUiPromise ??= Promise.all([import("../chunks/config-manager.BfkCA0F3.js"), import("../chunks/configs-controller.uTcM4iX4.js").then((e) => e.n)]).then(async ([, e]) => {
95211
95211
  this.configsController ??= new e.default(this.localize), await customElements.whenDefined("cx-config-manager"), await this.configManager?.updateComplete;
95212
95212
  });
95213
95213
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "4.57.0",
4
+ "version": "4.58.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {
@@ -129,7 +129,7 @@ export declare class ReactCrop extends PureComponent<ReactCropProps, ReactCropSt
129
129
  width: string;
130
130
  } | undefined;
131
131
  dragCrop(): PixelCrop;
132
- getPointRegion(box: Rectangle, origOrd: Ords | undefined, minWidth: number, minHeight: number): XYOrds;
132
+ getPointRegion(box: Rectangle): XYOrds;
133
133
  resolveMinDimensions(box: Rectangle, aspect: number, minWidth?: number, minHeight?: number): number[];
134
134
  resizeCrop(): PixelCrop;
135
135
  renderCropSelection(): import('react/jsx-runtime').JSX.Element | undefined;
@@ -69,6 +69,11 @@ export default class CxAssetLinkFormat extends CortexElement {
69
69
  * extension fallback in asset-transformation-dialog.
70
70
  */
71
71
  private static getTransformExtension;
72
+ /**
73
+ * The pixel size of a `ratioWidth`:`ratioHeight` resize of a `maxWidth` x `maxHeight` image: the largest
74
+ * box of the ratio inside it, as a pixel resize stops at the image size, and at least 1px a side.
75
+ */
76
+ private static fitRatioResizeSize;
72
77
  /**
73
78
  * Keep the last value for each type, at that type's first position.
74
79
  */
@@ -532,6 +537,11 @@ export default class CxAssetLinkFormat extends CortexElement {
532
537
  private onCropChanged;
533
538
  private onCropApply;
534
539
  private applyCropTransformation;
540
+ /**
541
+ * The pixel size a typed resize ratio previews. With an image, the largest box of the ratio inside it, as
542
+ * Apply resizes to. Without one only the ratio is saved, so it is sized over the last pixel height.
543
+ */
544
+ private getRatioResizePreviewSize;
535
545
  private onResizeChange;
536
546
  private onResizeApply;
537
547
  private onRotationChange;
@@ -257,6 +257,14 @@ export default class CxAssetLinkFormatCrop extends CortexElement {
257
257
  * turns a larger number into `max` as it is typed. Ratio values and an unknown (0) max have no cap.
258
258
  */
259
259
  private getSizeMaskBlocks;
260
+ /**
261
+ * An unlinked ratio, kept between 1:`maxHeight` and `maxWidth`:1 so the largest box of it inside the max
262
+ * size has at least 1px a side; past that, the box rounds to 0px on a side and the cropper has no frame to
263
+ * draw. As with a pixel size, the typed side stops at its max (`sideMax` times the other side: 29999922:1
264
+ * in 1000x800 gives 1000:1), and the other side then stops at `otherSideMax` times the typed one (lowering
265
+ * one side of 800000:800000 to 1 gives 1:800). An unknown max leaves both sides as they are.
266
+ */
267
+ private fitRatioSides;
260
268
  render(): TemplateResult;
261
269
  }
262
270
  declare global {
@@ -158,6 +158,13 @@ export default class CxAssetLinkFormatResize extends CortexElement {
158
158
  */
159
159
  private onHideDetails;
160
160
  private handleAspectRatioClick;
161
+ /**
162
+ * An unlinked ratio, kept between 1:`maxHeight` and `maxWidth`:1 so the image resized to it keeps at least
163
+ * 1px a side. As with a pixel size, the typed side stops at its max (`sideMax` times the other side:
164
+ * 29999922:1 in 1000x800 gives 1000:1), and the other side then stops at `otherSideMax` times the typed one
165
+ * (lowering one side of 800000:800000 to 1 gives 1:800). An unknown max (0 or Infinity) leaves both as they are.
166
+ */
167
+ private fitRatioSides;
161
168
  render(): TemplateResult;
162
169
  }
163
170
  declare global {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@orangelogic/design-system",
3
3
  "type": "module",
4
- "version": "4.57.0",
4
+ "version": "4.58.0",
5
5
  "license": "UNLICENSED",
6
6
  "types": "library/types.d.ts",
7
7
  "scripts": {