@orangelogic/design-system 2.94.0 → 2.95.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.
- package/library/chunks/{cropper.C3G5CGTF.js → cropper.uKGcvnPk.js} +2 -2
- package/library/chunks/{file-on-demand.Vj4PI0tu.js → file-on-demand.KQlA1JFF.js} +192 -189
- package/library/chunks/{image.C3LupRuN.js → image.C-Covc0H.js} +320 -299
- package/library/chunks/{image.ocYnNdYK.js → image.Dtdklw5q.js} +1 -1
- package/library/chunks/{index.B7slZiaV.js → index.BgXEXk4m.js} +3 -3
- package/library/chunks/{list-editor.CZzuw4XU.js → list-editor.BnHKqD0O.js} +1 -1
- package/library/chunks/number.CCF6IxpN.js +105 -0
- package/library/chunks/{time.wo2iH5iw.js → time.BNrE47-8.js} +1 -1
- package/library/components/asset-link-format.js +3 -3
- package/library/components/atoms.js +1 -1
- package/library/components/cropper.js +1 -1
- package/library/components/file-on-demand.js +2 -2
- package/library/components/format-time.js +1 -1
- package/library/components/image.js +1 -1
- package/library/components/list-editor.js +1 -1
- package/library/components/masonry.js +1 -1
- package/library/components/molecules.js +2 -2
- package/library/components/organisms.js +1 -1
- package/library/components/types.js +19 -15
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/base/src/resizable-element.d.ts +9 -1
- package/library/packages/molecules/src/mentions/mentions.d.ts +1 -0
- package/library/packages/organisms/src/file-on-demand/file-on-demand.constants.d.ts +1 -0
- package/library/packages/types/src/resizable-element.d.ts +5 -0
- package/library/packages/utils/src/number/number.d.ts +4 -1
- package/library/react-web-component.d.ts +8 -0
- package/library/utils.js +4 -4
- package/package.json +1 -1
- package/library/chunks/number.DE78rV_g.js +0 -104
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import { x as
|
|
2
|
-
import { C as
|
|
1
|
+
import { x as B, i as he, E as Le } from "./lit-element.jLBm65_O.js";
|
|
2
|
+
import { C as He, n as d } from "./lib-cortex-element.CVMmyPMC.js";
|
|
3
3
|
import { r as H } from "./state.CSDxrqLd.js";
|
|
4
|
-
import { e as
|
|
5
|
-
import { E as
|
|
4
|
+
import { e as K } from "./query.BBf1UFkC.js";
|
|
5
|
+
import { E as De, b as ce, a as $e } from "./index.Cpamj0jB.js";
|
|
6
6
|
import { c as We } from "./component.styles.CRO4Odto.js";
|
|
7
7
|
import { c as Ae } from "./custom-element.L4WJXn1j.js";
|
|
8
8
|
import { d as Oe } from "./debounce.DaHuiSGU.js";
|
|
9
|
-
import { L as
|
|
10
|
-
import { w as
|
|
9
|
+
import { L as Be } from "./i18n.W6czbRms.js";
|
|
10
|
+
import { w as X } from "./watch.BCJD77bD.js";
|
|
11
11
|
import { e as j } from "./class-map.BiVq-cVR.js";
|
|
12
|
-
import { o as
|
|
13
|
-
import { o as
|
|
14
|
-
import { n as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
12
|
+
import { o as Me } from "./if-defined.BRoBj_Rp.js";
|
|
13
|
+
import { o as Te } from "./style-map.llVFPd__.js";
|
|
14
|
+
import { n as F } from "./when.Dr1es41R.js";
|
|
15
|
+
import je from "../components/icon.js";
|
|
16
|
+
import Ne from "../components/popup.js";
|
|
17
17
|
import Ze from "../components/resize-observer.js";
|
|
18
18
|
import Ie from "../components/skeleton.js";
|
|
19
|
-
import
|
|
20
|
-
var Pe = /* @__PURE__ */ ((
|
|
21
|
-
for (var r = void 0,
|
|
22
|
-
(u =
|
|
23
|
-
return r &&
|
|
19
|
+
import Ve from "../components/space.js";
|
|
20
|
+
var Pe = /* @__PURE__ */ ((t) => (t.Bottom = "bottom", t.BottomCenter = "bottom-center", t.BottomLeft = "bottom-left", t.BottomRight = "bottom-right", t.CenterCenter = "center-center", t.CenterLeft = "center-left", t.CenterRight = "center-right", t.Left = "left", t.Right = "right", t.Top = "top", t.TopCenter = "top-center", t.TopLeft = "top-left", t.TopRight = "top-right", t))(Pe || {}), q = /* @__PURE__ */ ((t) => (t.Jump = "jump", t.None = "none", t.TextReveal = "text-reveal", t.Zoom = "zoom", t))(q || {}), ue = /* @__PURE__ */ ((t) => (t.PopOut = "pop-out", t.WithinBorders = "within-borders", t))(ue || {}), pe = /* @__PURE__ */ ((t) => (t.Fade = "fade", t.Slide = "slide", t))(pe || {}), se = /* @__PURE__ */ ((t) => (t.Auto = "auto", t.Fixed = "fixed", t))(se || {}), A = /* @__PURE__ */ ((t) => (t.Both = "both", t.Horizontal = "horizontal", t.Vertical = "vertical", t))(A || {}), Fe = Object.defineProperty, E = (t, e, o, h) => {
|
|
21
|
+
for (var r = void 0, m = t.length - 1, u; m >= 0; m--)
|
|
22
|
+
(u = t[m]) && (r = u(e, o, r) || r);
|
|
23
|
+
return r && Fe(e, o, r), r;
|
|
24
24
|
};
|
|
25
|
-
class
|
|
25
|
+
class R extends He {
|
|
26
26
|
constructor() {
|
|
27
|
-
super(...arguments), this.hasEvent = !1, this.easing =
|
|
27
|
+
super(...arguments), this.hasEvent = !1, this.easing = De.Linear, this.highlightBorder = !1, this.highlightColorOverlay = !1, this.highlightDropShadow = !1, this.highlightBackground = !1, this.highlightOpacity = !1, this.effect = q.None, this.textRevealStyle = pe.Slide, this.zoomStyle = ue.WithinBorders, this.hasSlotContent = !1, this.isCustomSlot = !1, this.isHovering = !1;
|
|
28
28
|
}
|
|
29
29
|
get easeCSSVariable() {
|
|
30
|
-
return
|
|
30
|
+
return ce[this.easing] || ce.linear;
|
|
31
31
|
}
|
|
32
32
|
getHighlighterClass() {
|
|
33
33
|
return {
|
|
@@ -46,8 +46,8 @@ class S extends Re {
|
|
|
46
46
|
*/
|
|
47
47
|
handleSlotChange() {
|
|
48
48
|
if (this.slotEl) {
|
|
49
|
-
const
|
|
50
|
-
this.hasSlotContent =
|
|
49
|
+
const e = this.slotEl.assignedElements({ flatten: !0 });
|
|
50
|
+
this.hasSlotContent = e.length > 0, this.isCustomSlot = !e.some(
|
|
51
51
|
(o) => o.hasAttribute("data-item-id")
|
|
52
52
|
);
|
|
53
53
|
} else
|
|
@@ -55,84 +55,90 @@ class S extends Re {
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
E([
|
|
58
|
-
|
|
59
|
-
],
|
|
58
|
+
K("slot")
|
|
59
|
+
], R.prototype, "slotEl");
|
|
60
60
|
E([
|
|
61
61
|
d({ attribute: "has-event", reflect: !0, type: Boolean })
|
|
62
|
-
],
|
|
62
|
+
], R.prototype, "hasEvent");
|
|
63
63
|
E([
|
|
64
64
|
d({ reflect: !0, type: String })
|
|
65
|
-
],
|
|
65
|
+
], R.prototype, "easing");
|
|
66
66
|
E([
|
|
67
67
|
d({ attribute: "highlight-border", reflect: !0, type: Boolean })
|
|
68
|
-
],
|
|
68
|
+
], R.prototype, "highlightBorder");
|
|
69
69
|
E([
|
|
70
70
|
d({
|
|
71
71
|
attribute: "highlight-color-overlay",
|
|
72
72
|
reflect: !0,
|
|
73
73
|
type: Boolean
|
|
74
74
|
})
|
|
75
|
-
],
|
|
75
|
+
], R.prototype, "highlightColorOverlay");
|
|
76
76
|
E([
|
|
77
77
|
d({
|
|
78
78
|
attribute: "highlight-drop-shadow",
|
|
79
79
|
reflect: !0,
|
|
80
80
|
type: Boolean
|
|
81
81
|
})
|
|
82
|
-
],
|
|
82
|
+
], R.prototype, "highlightDropShadow");
|
|
83
83
|
E([
|
|
84
84
|
d({ attribute: "highlight-background", reflect: !0, type: Boolean })
|
|
85
|
-
],
|
|
85
|
+
], R.prototype, "highlightBackground");
|
|
86
86
|
E([
|
|
87
87
|
d({ attribute: "highlight-opacity", reflect: !0, type: Boolean })
|
|
88
|
-
],
|
|
88
|
+
], R.prototype, "highlightOpacity");
|
|
89
89
|
E([
|
|
90
90
|
d({ attribute: "effect", reflect: !0, type: String })
|
|
91
|
-
],
|
|
91
|
+
], R.prototype, "effect");
|
|
92
92
|
E([
|
|
93
93
|
d({
|
|
94
94
|
attribute: "text-reveal-style",
|
|
95
95
|
reflect: !0,
|
|
96
96
|
type: String
|
|
97
97
|
})
|
|
98
|
-
],
|
|
98
|
+
], R.prototype, "textRevealStyle");
|
|
99
99
|
E([
|
|
100
100
|
d({
|
|
101
101
|
attribute: "zoom-style",
|
|
102
102
|
reflect: !0,
|
|
103
103
|
type: String
|
|
104
104
|
})
|
|
105
|
-
],
|
|
105
|
+
], R.prototype, "zoomStyle");
|
|
106
106
|
E([
|
|
107
107
|
H()
|
|
108
|
-
],
|
|
108
|
+
], R.prototype, "hasSlotContent");
|
|
109
109
|
E([
|
|
110
110
|
H()
|
|
111
|
-
],
|
|
111
|
+
], R.prototype, "isCustomSlot");
|
|
112
112
|
E([
|
|
113
113
|
H()
|
|
114
|
-
],
|
|
115
|
-
var
|
|
116
|
-
for (var r = void 0,
|
|
117
|
-
(u =
|
|
118
|
-
return r &&
|
|
114
|
+
], R.prototype, "isHovering");
|
|
115
|
+
var _e = Object.defineProperty, O = (t, e, o, h) => {
|
|
116
|
+
for (var r = void 0, m = t.length - 1, u; m >= 0; m--)
|
|
117
|
+
(u = t[m]) && (r = u(e, o, r) || r);
|
|
118
|
+
return r && _e(e, o, r), r;
|
|
119
119
|
};
|
|
120
|
-
class
|
|
120
|
+
class D extends R {
|
|
121
121
|
constructor() {
|
|
122
|
-
super(), this.width = "", this.height = "", this.resizable = !1, this.heightMode =
|
|
122
|
+
super(), this.width = "", this.height = "", this.resizable = !1, this.heightMode = se.Fixed, this.resizeDirection = A.Both, this.noLimit = !1, this.parentContainer = null, this.isResizeActive = !1, this.isResizing = !1, this.resizeSize = {
|
|
123
123
|
height: 0,
|
|
124
124
|
width: 0
|
|
125
125
|
}, this.maxWidth = 0, this.maxHeight = 0, this.minWidth = 0, this.minHeight = 0, this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
|
126
126
|
}
|
|
127
127
|
get ratio() {
|
|
128
|
-
const
|
|
129
|
-
return !
|
|
128
|
+
const e = this.clientWidth || 0, o = this.clientHeight || 0;
|
|
129
|
+
return !e || !o ? 1 : e / o;
|
|
130
130
|
}
|
|
131
131
|
get keepRatio() {
|
|
132
|
-
return this.heightMode ===
|
|
132
|
+
return this.heightMode === se.Auto;
|
|
133
133
|
}
|
|
134
|
-
|
|
135
|
-
|
|
134
|
+
get canResizeHorizontal() {
|
|
135
|
+
return this.resizeDirection !== A.Vertical;
|
|
136
|
+
}
|
|
137
|
+
get canResizeVertical() {
|
|
138
|
+
return this.resizeDirection !== A.Horizontal;
|
|
139
|
+
}
|
|
140
|
+
handleDocumentMouseDown(e) {
|
|
141
|
+
const o = e.composedPath();
|
|
136
142
|
this.containingElement && !o.includes(this.containingElement) && this.stopResizing();
|
|
137
143
|
}
|
|
138
144
|
startResizing() {
|
|
@@ -147,54 +153,54 @@ class A extends S {
|
|
|
147
153
|
this.handleDocumentMouseDown
|
|
148
154
|
);
|
|
149
155
|
}
|
|
150
|
-
handleResizeDragging(
|
|
151
|
-
|
|
156
|
+
handleResizeDragging(e, o = !1, h = !1) {
|
|
157
|
+
e.preventDefault(), e.stopPropagation(), this.maxWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--max-width")) || this.parentContainer?.clientWidth || this.parentElement?.clientWidth || 1 / 0, this.maxHeight = Number.parseInt(
|
|
152
158
|
getComputedStyle(this).getPropertyValue("--max-height")
|
|
153
159
|
) || 1 / 0, this.minWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--min-width")) || 40, this.minHeight = Number.parseInt(
|
|
154
160
|
getComputedStyle(this).getPropertyValue("--min-height")
|
|
155
161
|
) || 40, this.isResizing = !0;
|
|
156
|
-
const r = { x:
|
|
157
|
-
let
|
|
158
|
-
const
|
|
162
|
+
const r = { x: e.pageX, y: e.pageY };
|
|
163
|
+
let m = 0, u = 0;
|
|
164
|
+
const x = {
|
|
159
165
|
height: this.containingElement?.clientHeight || 0,
|
|
160
166
|
width: this.containingElement?.clientWidth || 0
|
|
161
167
|
};
|
|
162
168
|
if (!this.noLimit && this.parentElement) {
|
|
163
|
-
const $ = getComputedStyle(this.parentElement),
|
|
169
|
+
const $ = getComputedStyle(this.parentElement), p = $.getPropertyValue("padding-left").trim() || "0px", v = $.getPropertyValue("padding-right").trim() || "0px", M = Number(p.replace("px", "")), y = Number(v.replace("px", "")), L = getComputedStyle(this.parentElement).getPropertyValue("--padding").trim() || "0px", C = Number(L.replace("px", "")), ie = Math.max(
|
|
164
170
|
M + y,
|
|
165
|
-
|
|
171
|
+
C * 2
|
|
166
172
|
);
|
|
167
|
-
this.maxWidth = Math.max(this.maxWidth -
|
|
173
|
+
this.maxWidth = Math.max(this.maxWidth - ie, 0);
|
|
168
174
|
}
|
|
169
175
|
this.emit("cx-resize-start", {
|
|
170
176
|
detail: {
|
|
171
177
|
element: this,
|
|
172
|
-
event:
|
|
178
|
+
event: e
|
|
173
179
|
}
|
|
174
180
|
});
|
|
175
181
|
const Z = ($) => {
|
|
176
|
-
|
|
177
|
-
let
|
|
178
|
-
if (this.keepRatio) {
|
|
182
|
+
m = Number(x.width) + (o ? r.x - $.pageX : $.pageX - r.x), u = Number(x.height) + (h ? r.y - $.pageY : $.pageY - r.y), this.canResizeHorizontal || (m = Number(x.width)), this.canResizeVertical || (u = Number(x.height)), this.resizeDirection === A.Both && this.keepRatio && (u >= m / this.ratio && (u = m / this.ratio), m >= u * this.ratio && (m = u * this.ratio));
|
|
183
|
+
let p = m, v = u;
|
|
184
|
+
if (this.resizeDirection === A.Both && this.keepRatio) {
|
|
179
185
|
const M = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
|
|
180
|
-
let
|
|
181
|
-
|
|
186
|
+
let L = Math.min(p, M), C = L / this.ratio;
|
|
187
|
+
C > y && (C = y, L = C * this.ratio), p = L, v = C;
|
|
182
188
|
} else
|
|
183
|
-
|
|
189
|
+
p = this.maxWidth ? Math.min(p, this.maxWidth) : p, v = this.maxHeight ? Math.min(v, this.maxHeight) : v;
|
|
184
190
|
this.resizeSize = {
|
|
185
191
|
height: Math.round(v),
|
|
186
|
-
width: Math.round(
|
|
187
|
-
}, this.keepRatio ? (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight, this.resizeSize.width = Math.round(this.minHeight * this.ratio)), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth, this.resizeSize.height = Math.round(this.minWidth / this.ratio))) : (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth));
|
|
192
|
+
width: Math.round(p)
|
|
193
|
+
}, this.resizeDirection === A.Both && this.keepRatio ? (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight, this.resizeSize.width = Math.round(this.minHeight * this.ratio)), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth, this.resizeSize.height = Math.round(this.minWidth / this.ratio))) : (this.minHeight && this.resizeSize.height < this.minHeight && (this.resizeSize.height = this.minHeight), this.minWidth && this.resizeSize.width < this.minWidth && (this.resizeSize.width = this.minWidth));
|
|
188
194
|
}, I = ($) => {
|
|
189
|
-
if (
|
|
190
|
-
let
|
|
191
|
-
if (this.keepRatio) {
|
|
195
|
+
if (m > 0 && u > 0) {
|
|
196
|
+
let p = m, v = u;
|
|
197
|
+
if (this.canResizeHorizontal || (p = Number(x.width)), this.canResizeVertical || (v = Number(x.height)), this.resizeDirection === A.Both && this.keepRatio) {
|
|
192
198
|
const M = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
|
|
193
|
-
let
|
|
194
|
-
|
|
199
|
+
let L = Math.min(p, M), C = L / this.ratio;
|
|
200
|
+
C > y && (C = y, L = C * this.ratio), p = L, v = C;
|
|
195
201
|
} else
|
|
196
|
-
|
|
197
|
-
this.keepRatio ? (this.minHeight && v < this.minHeight && (v = this.minHeight,
|
|
202
|
+
p = this.maxWidth ? Math.min(p, this.maxWidth) : p, v = this.maxHeight ? Math.min(v, this.maxHeight) : v;
|
|
203
|
+
this.resizeDirection === A.Both && this.keepRatio ? (this.minHeight && v < this.minHeight && (v = this.minHeight, p = Math.round(this.minHeight * this.ratio)), this.minWidth && p < this.minWidth && (p = this.minWidth, v = Math.round(this.minWidth / this.ratio))) : (this.minHeight && v < this.minHeight && (v = this.minHeight), this.minWidth && p < this.minWidth && (p = this.minWidth)), this.width = `${Math.round(p)}px`, this.height = `${Math.round(v)}px`, this.resizeSize = {
|
|
198
204
|
height: 0,
|
|
199
205
|
width: 0
|
|
200
206
|
}, this.isResizing = !1;
|
|
@@ -216,173 +222,188 @@ class A extends S {
|
|
|
216
222
|
once: !0
|
|
217
223
|
});
|
|
218
224
|
}
|
|
219
|
-
handleResizeDraggingTopLeft(
|
|
220
|
-
this.handleResizeDragging(
|
|
225
|
+
handleResizeDraggingTopLeft(e) {
|
|
226
|
+
this.handleResizeDragging(e, !0, !0);
|
|
227
|
+
}
|
|
228
|
+
handleResizeDraggingTopRight(e) {
|
|
229
|
+
this.handleResizeDragging(e, !1, !0);
|
|
230
|
+
}
|
|
231
|
+
handleResizeDraggingBottomLeft(e) {
|
|
232
|
+
this.handleResizeDragging(e, !0, !1);
|
|
233
|
+
}
|
|
234
|
+
handleResizeDraggingBottomRight(e) {
|
|
235
|
+
this.handleResizeDragging(e, !1, !1);
|
|
221
236
|
}
|
|
222
|
-
|
|
223
|
-
this.handleResizeDragging(
|
|
237
|
+
handleResizeDraggingLeft(e) {
|
|
238
|
+
this.handleResizeDragging(e, !0, !1);
|
|
224
239
|
}
|
|
225
|
-
|
|
226
|
-
this.handleResizeDragging(
|
|
240
|
+
handleResizeDraggingRight(e) {
|
|
241
|
+
this.handleResizeDragging(e, !1, !1);
|
|
227
242
|
}
|
|
228
|
-
|
|
229
|
-
this.handleResizeDragging(
|
|
243
|
+
handleResizeDraggingTop(e) {
|
|
244
|
+
this.handleResizeDragging(e, !1, !0);
|
|
245
|
+
}
|
|
246
|
+
handleResizeDraggingBottom(e) {
|
|
247
|
+
this.handleResizeDragging(e, !1, !1);
|
|
230
248
|
}
|
|
231
249
|
renderResizer() {
|
|
232
|
-
return
|
|
250
|
+
return this.resizeDirection === A.Horizontal ? B`<div class="resizer resizer--left" @mousedown=${this.handleResizeDraggingLeft}></div><div class="resizer resizer--right" @mousedown=${this.handleResizeDraggingRight}></div>` : this.resizeDirection === A.Vertical ? B`<div class="resizer resizer--top" @mousedown=${this.handleResizeDraggingTop}></div><div class="resizer resizer--bottom" @mousedown=${this.handleResizeDraggingBottom}></div>` : B`<div class="resizer resizer--top-left" @mousedown=${this.handleResizeDraggingTopLeft}></div><div class="resizer resizer--top-right" @mousedown=${this.handleResizeDraggingTopRight}></div><div class="resizer resizer--bottom-left" @mousedown=${this.handleResizeDraggingBottomLeft}></div><div class="resizer resizer--bottom-right" @mousedown=${this.handleResizeDraggingBottomRight}></div>`;
|
|
233
251
|
}
|
|
234
252
|
}
|
|
235
253
|
O([
|
|
236
|
-
|
|
237
|
-
],
|
|
254
|
+
K('[part="base"]')
|
|
255
|
+
], D.prototype, "containingElement");
|
|
238
256
|
O([
|
|
239
257
|
d({ reflect: !0, type: String })
|
|
240
|
-
],
|
|
258
|
+
], D.prototype, "width");
|
|
241
259
|
O([
|
|
242
260
|
d({ reflect: !0, type: String })
|
|
243
|
-
],
|
|
261
|
+
], D.prototype, "height");
|
|
244
262
|
O([
|
|
245
263
|
d({ type: Boolean })
|
|
246
|
-
],
|
|
264
|
+
], D.prototype, "resizable");
|
|
247
265
|
O([
|
|
248
266
|
d({ attribute: "height-mode", reflect: !0, type: String })
|
|
249
|
-
],
|
|
267
|
+
], D.prototype, "heightMode");
|
|
268
|
+
O([
|
|
269
|
+
d({ attribute: "resize-direction", reflect: !0, type: String })
|
|
270
|
+
], D.prototype, "resizeDirection");
|
|
250
271
|
O([
|
|
251
272
|
d({ attribute: "no-limit", reflect: !0, type: Boolean })
|
|
252
|
-
],
|
|
273
|
+
], D.prototype, "noLimit");
|
|
253
274
|
O([
|
|
254
275
|
d({ attribute: !1, type: Object })
|
|
255
|
-
],
|
|
276
|
+
], D.prototype, "parentContainer");
|
|
256
277
|
O([
|
|
257
278
|
H()
|
|
258
|
-
],
|
|
279
|
+
], D.prototype, "isResizeActive");
|
|
259
280
|
O([
|
|
260
281
|
H()
|
|
261
|
-
],
|
|
282
|
+
], D.prototype, "isResizing");
|
|
262
283
|
O([
|
|
263
284
|
H()
|
|
264
|
-
],
|
|
265
|
-
const
|
|
266
|
-
var
|
|
285
|
+
], D.prototype, "resizeSize");
|
|
286
|
+
const Ue = he`.resizer{background-color:var(--cx-color-primary);z-index:100;width:8px;height:8px;position:absolute}.resizer--top-left{top:calc(-1px - var(--border-width,0px));left:calc(-1px - var(--border-width,0px));cursor:nw-resize}.resizer--top-right{top:calc(-1px - var(--border-width,0px));right:calc(-1px - var(--border-width,0px));cursor:ne-resize}.resizer--bottom-left{bottom:calc(-1px - var(--border-width,0px));left:calc(-1px - var(--border-width,0px));cursor:sw-resize}.resizer--bottom-right{bottom:calc(-1px - var(--border-width,0px));right:calc(-1px - var(--border-width,0px));cursor:se-resize}.resizer--left{cursor:ew-resize;top:50%;left:0;transform:translateY(-50%)}.resizer--right{cursor:ew-resize;top:50%;right:0;transform:translateY(-50%)}.resizer--top{cursor:ns-resize;top:0;left:50%;transform:translate(-50%)}.resizer--bottom{cursor:ns-resize;bottom:0;left:50%;transform:translate(-50%)}`;
|
|
287
|
+
var Y = /* @__PURE__ */ ((t) => (t.Automatic = "automatic", t.Manual = "manual", t))(Y || {});
|
|
267
288
|
/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */
|
|
268
|
-
var
|
|
269
|
-
for (var
|
|
270
|
-
var o = arguments[
|
|
289
|
+
var N = Object.assign || function(t) {
|
|
290
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
291
|
+
var o = arguments[e];
|
|
271
292
|
for (var h in o)
|
|
272
|
-
Object.prototype.hasOwnProperty.call(o, h) && (
|
|
273
|
-
}
|
|
274
|
-
return
|
|
275
|
-
},
|
|
276
|
-
return
|
|
277
|
-
},
|
|
278
|
-
return NodeList.prototype.isPrototypeOf(
|
|
279
|
-
},
|
|
280
|
-
return
|
|
281
|
-
},
|
|
282
|
-
var o =
|
|
293
|
+
Object.prototype.hasOwnProperty.call(o, h) && (t[h] = o[h]);
|
|
294
|
+
}
|
|
295
|
+
return t;
|
|
296
|
+
}, ee = function(e) {
|
|
297
|
+
return e.tagName === "IMG";
|
|
298
|
+
}, Ye = function(e) {
|
|
299
|
+
return NodeList.prototype.isPrototypeOf(e);
|
|
300
|
+
}, te = function(e) {
|
|
301
|
+
return e && e.nodeType === 1;
|
|
302
|
+
}, me = function(e) {
|
|
303
|
+
var o = e.currentSrc || e.src;
|
|
283
304
|
return o.substr(-4).toLowerCase() === ".svg";
|
|
284
|
-
},
|
|
305
|
+
}, ge = function(e) {
|
|
285
306
|
try {
|
|
286
|
-
return Array.isArray(
|
|
307
|
+
return Array.isArray(e) ? e.filter(ee) : Ye(e) ? [].slice.call(e).filter(ee) : te(e) ? [e].filter(ee) : typeof e == "string" ? [].slice.call(document.querySelectorAll(e)).filter(ee) : [];
|
|
287
308
|
} catch {
|
|
288
309
|
throw new TypeError(`The provided selector is invalid.
|
|
289
310
|
Expects a CSS selector, a Node element, a NodeList or an array.
|
|
290
311
|
See: https://github.com/francoischalifour/medium-zoom`);
|
|
291
312
|
}
|
|
292
|
-
},
|
|
313
|
+
}, qe = function(e) {
|
|
293
314
|
var o = document.createElement("div");
|
|
294
|
-
return o.classList.add("medium-zoom-overlay"), o.style.background =
|
|
295
|
-
},
|
|
296
|
-
var o =
|
|
297
|
-
return
|
|
298
|
-
},
|
|
299
|
-
var h =
|
|
315
|
+
return o.classList.add("medium-zoom-overlay"), o.style.background = e, o;
|
|
316
|
+
}, Xe = function(e) {
|
|
317
|
+
var o = e.getBoundingClientRect(), h = o.top, r = o.left, m = o.width, u = o.height, x = e.cloneNode(), Z = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, I = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
318
|
+
return x.removeAttribute("id"), x.style.position = "absolute", x.style.top = h + Z + "px", x.style.left = r + I + "px", x.style.width = m + "px", x.style.height = u + "px", x.style.transform = "", x;
|
|
319
|
+
}, _ = function(e, o) {
|
|
320
|
+
var h = N({
|
|
300
321
|
bubbles: !1,
|
|
301
322
|
cancelable: !1,
|
|
302
323
|
detail: void 0
|
|
303
324
|
}, o);
|
|
304
325
|
if (typeof window.CustomEvent == "function")
|
|
305
|
-
return new CustomEvent(
|
|
326
|
+
return new CustomEvent(e, h);
|
|
306
327
|
var r = document.createEvent("CustomEvent");
|
|
307
|
-
return r.initCustomEvent(
|
|
308
|
-
},
|
|
328
|
+
return r.initCustomEvent(e, h.bubbles, h.cancelable, h.detail), r;
|
|
329
|
+
}, Ke = function t(e) {
|
|
309
330
|
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = window.Promise || function(a) {
|
|
310
331
|
function n() {
|
|
311
332
|
}
|
|
312
333
|
a(n, n);
|
|
313
334
|
}, r = function(a) {
|
|
314
335
|
var n = a.target;
|
|
315
|
-
if (n ===
|
|
336
|
+
if (n === G) {
|
|
316
337
|
y();
|
|
317
338
|
return;
|
|
318
339
|
}
|
|
319
|
-
|
|
320
|
-
},
|
|
321
|
-
if (!(
|
|
340
|
+
k.indexOf(n) !== -1 && L({ target: n });
|
|
341
|
+
}, m = function() {
|
|
342
|
+
if (!(V || !i.original)) {
|
|
322
343
|
var a = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
323
|
-
Math.abs(
|
|
344
|
+
Math.abs(le - a) > c.scrollOffset && setTimeout(y, 150);
|
|
324
345
|
}
|
|
325
346
|
}, u = function(a) {
|
|
326
347
|
var n = a.key || a.keyCode;
|
|
327
348
|
(n === "Escape" || n === "Esc" || n === 27) && y();
|
|
328
|
-
},
|
|
349
|
+
}, x = function() {
|
|
329
350
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a;
|
|
330
|
-
if (a.background && (
|
|
331
|
-
var
|
|
332
|
-
n.template =
|
|
351
|
+
if (a.background && (G.style.background = a.background), a.container && a.container instanceof Object && (n.container = N({}, c.container, a.container)), a.template) {
|
|
352
|
+
var f = te(a.template) ? a.template : document.querySelector(a.template);
|
|
353
|
+
n.template = f;
|
|
333
354
|
}
|
|
334
|
-
return c =
|
|
335
|
-
z.dispatchEvent(
|
|
355
|
+
return c = N({}, c, n), k.forEach(function(z) {
|
|
356
|
+
z.dispatchEvent(_("medium-zoom:update", {
|
|
336
357
|
detail: { zoom: b }
|
|
337
358
|
}));
|
|
338
359
|
}), b;
|
|
339
360
|
}, Z = function() {
|
|
340
361
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
341
|
-
return
|
|
362
|
+
return t(N({}, c, a));
|
|
342
363
|
}, I = function() {
|
|
343
|
-
for (var a = arguments.length, n = Array(a),
|
|
344
|
-
n[
|
|
345
|
-
var z = n.reduce(function(s,
|
|
346
|
-
return [].concat(s,
|
|
364
|
+
for (var a = arguments.length, n = Array(a), f = 0; f < a; f++)
|
|
365
|
+
n[f] = arguments[f];
|
|
366
|
+
var z = n.reduce(function(s, S) {
|
|
367
|
+
return [].concat(s, ge(S));
|
|
347
368
|
}, []);
|
|
348
369
|
return z.filter(function(s) {
|
|
349
|
-
return
|
|
370
|
+
return k.indexOf(s) === -1;
|
|
350
371
|
}).forEach(function(s) {
|
|
351
|
-
|
|
352
|
-
}),
|
|
353
|
-
var
|
|
354
|
-
z.forEach(function(
|
|
355
|
-
|
|
372
|
+
k.push(s), s.classList.add("medium-zoom-image");
|
|
373
|
+
}), J.forEach(function(s) {
|
|
374
|
+
var S = s.type, W = s.listener, P = s.options;
|
|
375
|
+
z.forEach(function(T) {
|
|
376
|
+
T.addEventListener(S, W, P);
|
|
356
377
|
});
|
|
357
378
|
}), b;
|
|
358
379
|
}, $ = function() {
|
|
359
|
-
for (var a = arguments.length, n = Array(a),
|
|
360
|
-
n[
|
|
380
|
+
for (var a = arguments.length, n = Array(a), f = 0; f < a; f++)
|
|
381
|
+
n[f] = arguments[f];
|
|
361
382
|
i.zoomed && y();
|
|
362
|
-
var z = n.length > 0 ? n.reduce(function(s,
|
|
363
|
-
return [].concat(s,
|
|
364
|
-
}, []) :
|
|
383
|
+
var z = n.length > 0 ? n.reduce(function(s, S) {
|
|
384
|
+
return [].concat(s, ge(S));
|
|
385
|
+
}, []) : k;
|
|
365
386
|
return z.forEach(function(s) {
|
|
366
|
-
s.classList.remove("medium-zoom-image"), s.dispatchEvent(
|
|
387
|
+
s.classList.remove("medium-zoom-image"), s.dispatchEvent(_("medium-zoom:detach", {
|
|
367
388
|
detail: { zoom: b }
|
|
368
389
|
}));
|
|
369
|
-
}),
|
|
390
|
+
}), k = k.filter(function(s) {
|
|
370
391
|
return z.indexOf(s) === -1;
|
|
371
392
|
}), b;
|
|
372
|
-
},
|
|
373
|
-
var
|
|
374
|
-
return
|
|
375
|
-
z.addEventListener("medium-zoom:" + a, n,
|
|
376
|
-
}),
|
|
393
|
+
}, p = function(a, n) {
|
|
394
|
+
var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
395
|
+
return k.forEach(function(z) {
|
|
396
|
+
z.addEventListener("medium-zoom:" + a, n, f);
|
|
397
|
+
}), J.push({ type: "medium-zoom:" + a, listener: n, options: f }), b;
|
|
377
398
|
}, v = function(a, n) {
|
|
378
|
-
var
|
|
379
|
-
return
|
|
380
|
-
z.removeEventListener("medium-zoom:" + a, n,
|
|
381
|
-
}),
|
|
399
|
+
var f = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
400
|
+
return k.forEach(function(z) {
|
|
401
|
+
z.removeEventListener("medium-zoom:" + a, n, f);
|
|
402
|
+
}), J = J.filter(function(z) {
|
|
382
403
|
return !(z.type === "medium-zoom:" + a && z.listener.toString() === n.toString());
|
|
383
404
|
}), b;
|
|
384
405
|
}, M = function() {
|
|
385
|
-
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target,
|
|
406
|
+
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target, f = function() {
|
|
386
407
|
var s = {
|
|
387
408
|
width: document.documentElement.clientWidth,
|
|
388
409
|
height: document.documentElement.clientHeight,
|
|
@@ -390,30 +411,30 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
390
411
|
top: 0,
|
|
391
412
|
right: 0,
|
|
392
413
|
bottom: 0
|
|
393
|
-
},
|
|
414
|
+
}, S = void 0, W = void 0;
|
|
394
415
|
if (c.container)
|
|
395
416
|
if (c.container instanceof Object)
|
|
396
|
-
s =
|
|
417
|
+
s = N({}, s, c.container), S = s.width - s.left - s.right - c.margin * 2, W = s.height - s.top - s.bottom - c.margin * 2;
|
|
397
418
|
else {
|
|
398
|
-
var P =
|
|
399
|
-
s =
|
|
400
|
-
width:
|
|
401
|
-
height:
|
|
402
|
-
left:
|
|
403
|
-
top:
|
|
419
|
+
var P = te(c.container) ? c.container : document.querySelector(c.container), T = P.getBoundingClientRect(), oe = T.width, ve = T.height, ze = T.left, ye = T.top;
|
|
420
|
+
s = N({}, s, {
|
|
421
|
+
width: oe,
|
|
422
|
+
height: ve,
|
|
423
|
+
left: ze,
|
|
424
|
+
top: ye
|
|
404
425
|
});
|
|
405
426
|
}
|
|
406
|
-
|
|
407
|
-
var
|
|
408
|
-
i.zoomed.style.transform =
|
|
427
|
+
S = S || s.width - c.margin * 2, W = W || s.height - c.margin * 2;
|
|
428
|
+
var U = i.zoomedHd || i.original, be = me(U) ? S : U.naturalWidth || S, xe = me(U) ? W : U.naturalHeight || W, Q = U.getBoundingClientRect(), we = Q.top, Se = Q.left, re = Q.width, ae = Q.height, Re = Math.min(Math.max(re, be), S) / re, Ee = Math.min(Math.max(ae, xe), W) / ae, ne = Math.min(Re, Ee), Ce = (-Se + (S - re) / 2 + c.margin + s.left) / ne, ke = (-we + (W - ae) / 2 + c.margin + s.top) / ne, de = "scale(" + ne + ") translate3d(" + Ce + "px, " + ke + "px, 0)";
|
|
429
|
+
i.zoomed.style.transform = de, i.zoomedHd && (i.zoomedHd.style.transform = de);
|
|
409
430
|
};
|
|
410
431
|
return new h(function(z) {
|
|
411
|
-
if (n &&
|
|
432
|
+
if (n && k.indexOf(n) === -1) {
|
|
412
433
|
z(b);
|
|
413
434
|
return;
|
|
414
435
|
}
|
|
415
|
-
var s = function
|
|
416
|
-
|
|
436
|
+
var s = function oe() {
|
|
437
|
+
V = !1, i.zoomed.removeEventListener("transitionend", oe), i.original.dispatchEvent(_("medium-zoom:opened", {
|
|
417
438
|
detail: { zoom: b }
|
|
418
439
|
})), z(b);
|
|
419
440
|
};
|
|
@@ -423,103 +444,103 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
423
444
|
}
|
|
424
445
|
if (n)
|
|
425
446
|
i.original = n;
|
|
426
|
-
else if (
|
|
427
|
-
var
|
|
428
|
-
i.original =
|
|
447
|
+
else if (k.length > 0) {
|
|
448
|
+
var S = k;
|
|
449
|
+
i.original = S[0];
|
|
429
450
|
} else {
|
|
430
451
|
z(b);
|
|
431
452
|
return;
|
|
432
453
|
}
|
|
433
|
-
if (i.original.dispatchEvent(
|
|
454
|
+
if (i.original.dispatchEvent(_("medium-zoom:open", {
|
|
434
455
|
detail: { zoom: b }
|
|
435
|
-
})),
|
|
436
|
-
var W =
|
|
456
|
+
})), le = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, V = !0, i.zoomed = Xe(i.original), document.body.appendChild(G), c.template) {
|
|
457
|
+
var W = te(c.template) ? c.template : document.querySelector(c.template);
|
|
437
458
|
i.template = document.createElement("div"), i.template.appendChild(W.content.cloneNode(!0)), document.body.appendChild(i.template);
|
|
438
459
|
}
|
|
439
460
|
if (i.original.parentElement && i.original.parentElement.tagName === "PICTURE" && i.original.currentSrc && (i.zoomed.src = i.original.currentSrc), document.body.appendChild(i.zoomed), window.requestAnimationFrame(function() {
|
|
440
461
|
document.body.classList.add("medium-zoom--opened");
|
|
441
462
|
}), i.original.classList.add("medium-zoom-image--hidden"), i.zoomed.classList.add("medium-zoom-image--opened"), i.zoomed.addEventListener("click", y), i.zoomed.addEventListener("transitionend", s), i.original.getAttribute("data-zoom-src")) {
|
|
442
463
|
i.zoomedHd = i.zoomed.cloneNode(), i.zoomedHd.removeAttribute("srcset"), i.zoomedHd.removeAttribute("sizes"), i.zoomedHd.removeAttribute("loading"), i.zoomedHd.src = i.zoomed.getAttribute("data-zoom-src"), i.zoomedHd.onerror = function() {
|
|
443
|
-
clearInterval(P), console.warn("Unable to reach the zoom image target " + i.zoomedHd.src), i.zoomedHd = null,
|
|
464
|
+
clearInterval(P), console.warn("Unable to reach the zoom image target " + i.zoomedHd.src), i.zoomedHd = null, f();
|
|
444
465
|
};
|
|
445
466
|
var P = setInterval(function() {
|
|
446
|
-
i.zoomedHd.complete && (clearInterval(P), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd),
|
|
467
|
+
i.zoomedHd.complete && (clearInterval(P), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f());
|
|
447
468
|
}, 10);
|
|
448
469
|
} else if (i.original.hasAttribute("srcset")) {
|
|
449
470
|
i.zoomedHd = i.zoomed.cloneNode(), i.zoomedHd.removeAttribute("sizes"), i.zoomedHd.removeAttribute("loading");
|
|
450
|
-
var
|
|
451
|
-
i.zoomedHd.removeEventListener("load",
|
|
471
|
+
var T = i.zoomedHd.addEventListener("load", function() {
|
|
472
|
+
i.zoomedHd.removeEventListener("load", T), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f();
|
|
452
473
|
});
|
|
453
474
|
} else
|
|
454
|
-
|
|
475
|
+
f();
|
|
455
476
|
});
|
|
456
477
|
}, y = function() {
|
|
457
478
|
return new h(function(a) {
|
|
458
|
-
if (
|
|
479
|
+
if (V || !i.original) {
|
|
459
480
|
a(b);
|
|
460
481
|
return;
|
|
461
482
|
}
|
|
462
|
-
var n = function
|
|
463
|
-
i.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(i.zoomed), i.zoomedHd && document.body.removeChild(i.zoomedHd), document.body.removeChild(
|
|
483
|
+
var n = function f() {
|
|
484
|
+
i.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(i.zoomed), i.zoomedHd && document.body.removeChild(i.zoomedHd), document.body.removeChild(G), i.zoomed.classList.remove("medium-zoom-image--opened"), i.template && document.body.removeChild(i.template), V = !1, i.zoomed.removeEventListener("transitionend", f), i.original.dispatchEvent(_("medium-zoom:closed", {
|
|
464
485
|
detail: { zoom: b }
|
|
465
486
|
})), i.original = null, i.zoomed = null, i.zoomedHd = null, i.template = null, a(b);
|
|
466
487
|
};
|
|
467
|
-
|
|
488
|
+
V = !0, document.body.classList.remove("medium-zoom--opened"), i.zoomed.style.transform = "", i.zoomedHd && (i.zoomedHd.style.transform = ""), i.template && (i.template.style.transition = "opacity 150ms", i.template.style.opacity = 0), i.original.dispatchEvent(_("medium-zoom:close", {
|
|
468
489
|
detail: { zoom: b }
|
|
469
490
|
})), i.zoomed.addEventListener("transitionend", n);
|
|
470
491
|
});
|
|
471
|
-
},
|
|
492
|
+
}, L = function() {
|
|
472
493
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target;
|
|
473
494
|
return i.original ? y() : M({ target: n });
|
|
474
|
-
},
|
|
495
|
+
}, C = function() {
|
|
475
496
|
return c;
|
|
476
|
-
},
|
|
477
|
-
return
|
|
478
|
-
},
|
|
497
|
+
}, ie = function() {
|
|
498
|
+
return k;
|
|
499
|
+
}, fe = function() {
|
|
479
500
|
return i.original;
|
|
480
|
-
},
|
|
501
|
+
}, k = [], J = [], V = !1, le = 0, c = o, i = {
|
|
481
502
|
original: null,
|
|
482
503
|
zoomed: null,
|
|
483
504
|
zoomedHd: null,
|
|
484
505
|
template: null
|
|
485
506
|
// If the selector is omitted, it's replaced by the options
|
|
486
507
|
};
|
|
487
|
-
Object.prototype.toString.call(
|
|
508
|
+
Object.prototype.toString.call(e) === "[object Object]" ? c = e : (e || typeof e == "string") && I(e), c = N({
|
|
488
509
|
margin: 0,
|
|
489
510
|
background: "#fff",
|
|
490
511
|
scrollOffset: 40,
|
|
491
512
|
container: null,
|
|
492
513
|
template: null
|
|
493
514
|
}, c);
|
|
494
|
-
var
|
|
495
|
-
document.addEventListener("click", r), document.addEventListener("keyup", u), document.addEventListener("scroll",
|
|
515
|
+
var G = qe(c.background);
|
|
516
|
+
document.addEventListener("click", r), document.addEventListener("keyup", u), document.addEventListener("scroll", m), window.addEventListener("resize", y);
|
|
496
517
|
var b = {
|
|
497
518
|
open: M,
|
|
498
519
|
close: y,
|
|
499
|
-
toggle:
|
|
500
|
-
update:
|
|
520
|
+
toggle: L,
|
|
521
|
+
update: x,
|
|
501
522
|
clone: Z,
|
|
502
523
|
attach: I,
|
|
503
524
|
detach: $,
|
|
504
|
-
on:
|
|
525
|
+
on: p,
|
|
505
526
|
off: v,
|
|
506
|
-
getOptions:
|
|
507
|
-
getImages:
|
|
508
|
-
getZoomedImage:
|
|
527
|
+
getOptions: C,
|
|
528
|
+
getImages: ie,
|
|
529
|
+
getZoomedImage: fe
|
|
509
530
|
};
|
|
510
531
|
return b;
|
|
511
532
|
};
|
|
512
|
-
function
|
|
513
|
-
|
|
514
|
-
var o =
|
|
533
|
+
function Je(t, e) {
|
|
534
|
+
e === void 0 && (e = {});
|
|
535
|
+
var o = e.insertAt;
|
|
515
536
|
if (!(typeof document > "u")) {
|
|
516
537
|
var h = document.head || document.getElementsByTagName("head")[0], r = document.createElement("style");
|
|
517
|
-
r.type = "text/css", o === "top" && h.firstChild ? h.insertBefore(r, h.firstChild) : h.appendChild(r), r.styleSheet ? r.styleSheet.cssText =
|
|
538
|
+
r.type = "text/css", o === "top" && h.firstChild ? h.insertBefore(r, h.firstChild) : h.appendChild(r), r.styleSheet ? r.styleSheet.cssText = t : r.appendChild(document.createTextNode(t));
|
|
518
539
|
}
|
|
519
540
|
}
|
|
520
|
-
var
|
|
521
|
-
|
|
522
|
-
const
|
|
541
|
+
var Ge = ".medium-zoom-overlay{position:fixed;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .3s;will-change:opacity}.medium-zoom--opened .medium-zoom-overlay{cursor:pointer;cursor:zoom-out;opacity:1}.medium-zoom-image{cursor:pointer;cursor:zoom-in;transition:transform .3s cubic-bezier(.2,0,.2,1)!important}.medium-zoom-image--hidden{visibility:hidden}.medium-zoom-image--opened{position:relative;cursor:pointer;cursor:zoom-out;will-change:transform}";
|
|
542
|
+
Je(Ge);
|
|
543
|
+
const Qe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .container,:host([effect=zoom]) .container{overflow:initial}:host([effect=jump]) .highlighter{transition:all var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=jump]) .highlighter:hover{transform:translateY(calc(var(--highlightable-item-effect-jump-distance,0) * -1))}.highlighter--effect-text-reveal,:host([effect=zoom]) .highlighter--zoom-style-within-borders{overflow:hidden}:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{z-index:3;animation:none}:host([effect=zoom][zoom-style=pop-out]) .highlighter:not(:hover){animation:drop-z var(--transition-transform-duration) forwards}@keyframes drop-z{0%{z-index:2}99%{z-index:2}to{z-index:0}}.highlighter--can-hover:hover:after,.highlighter--selected:after,.highlighter--color-overlay:after{content:"";pointer-events:none;width:100%;height:100%;transition:all var(--transition-duration,.5s) var(--easing,linear);position:absolute;top:0;left:0}.highlighter--can-hover:hover:after,.highlighter--selected:after{outline:2px solid var(--cx-color-primary)}.highlighter--border:hover .image{border-color:var(--highlightable-item-highlight-border-color,var(--cx-color-primary))}.highlighter--color-overlay:after{border-radius:var(--border-radius,none)}.highlighter--color-overlay:hover:after{background-color:var(--highlightable-item-highlight-color-overlay-color,transparent)}.highlighter--drop-shadow:hover .image{box-shadow:var(--highlightable-item-highlight-drop-shadow,none)}.highlighter--background:hover .highlightable-item{--content-background-color:var(--highlightable-item-highlight-background,transparent);--highlightable-item-background-color:var(--highlightable-item-highlight-background,transparent)}.highlighter--opacity{opacity:var(--highlightable-item-highlight-opacity,1)}:host([effect=zoom][zoom-style=within-borders]) .highlighter .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter{transition:transform var(--transition-transform-duration,.5s) var(--easing,linear)}:host([effect=zoom][zoom-style=within-borders]) .highlighter:hover .image,:host([effect=zoom][zoom-style=pop-out]) .highlighter:hover{transform:scale(var(--highlightable-item-effect-zoom-scale,1))}.highlightable-item{transition:background-color var(--transition-duration,.5s) var(--easing,linear), border-color var(--transition-duration,.5s) var(--easing,linear), box-shadow var(--transition-duration,.5s) var(--easing,linear), opacity var(--transition-duration,.5s) var(--easing,linear), transform var(--transition-transform-duration,.5s) var(--easing,linear), visibility var(--transition-duration,.5s) var(--easing,linear)}`, et = he`
|
|
523
544
|
:host {
|
|
524
545
|
--justify-content: flex-start;
|
|
525
546
|
--border-radius: 0px;
|
|
@@ -572,7 +593,7 @@ const Ge = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
572
593
|
max-height: 100%;
|
|
573
594
|
}
|
|
574
595
|
|
|
575
|
-
${
|
|
596
|
+
${Qe}
|
|
576
597
|
|
|
577
598
|
:host([block]) {
|
|
578
599
|
width: 100%;
|
|
@@ -765,14 +786,14 @@ const Ge = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
765
786
|
--font-size: var(--cx-font-size-4x-large);
|
|
766
787
|
}
|
|
767
788
|
`;
|
|
768
|
-
var
|
|
769
|
-
for (var r = h > 1 ? void 0 : h ?
|
|
770
|
-
(u =
|
|
771
|
-
return h && r &&
|
|
789
|
+
var tt = Object.defineProperty, it = Object.getOwnPropertyDescriptor, g = (t, e, o, h) => {
|
|
790
|
+
for (var r = h > 1 ? void 0 : h ? it(e, o) : e, m = t.length - 1, u; m >= 0; m--)
|
|
791
|
+
(u = t[m]) && (r = (h ? u(e, o, r) : u(r)) || r);
|
|
792
|
+
return h && r && tt(e, o, r), r;
|
|
772
793
|
};
|
|
773
|
-
let l = class extends
|
|
794
|
+
let l = class extends D {
|
|
774
795
|
constructor() {
|
|
775
|
-
super(...arguments), this.localize = new
|
|
796
|
+
super(...arguments), this.localize = new Be(this), this.isLoaded = !1, this.isError = !1, this.src = "", this.placeholder = "", this.alt = "", this.objectFit = $e.Fill, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.clickHandlerType = Y.Automatic, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null;
|
|
776
797
|
}
|
|
777
798
|
get currentAltValue() {
|
|
778
799
|
return this.alt;
|
|
@@ -781,25 +802,25 @@ let l = class extends A {
|
|
|
781
802
|
return this.src;
|
|
782
803
|
}
|
|
783
804
|
get highlighterTabindex() {
|
|
784
|
-
return this.hasZoomAction && this.clickHandlerType ===
|
|
805
|
+
return this.hasZoomAction && this.clickHandlerType === Y.Automatic ? "0" : void 0;
|
|
785
806
|
}
|
|
786
807
|
get highlighterRole() {
|
|
787
|
-
return this.hasZoomAction && this.clickHandlerType ===
|
|
808
|
+
return this.hasZoomAction && this.clickHandlerType === Y.Automatic ? "button" : "img";
|
|
788
809
|
}
|
|
789
810
|
get highlighterClass() {
|
|
790
811
|
return {
|
|
791
812
|
"highlightable-item": !0,
|
|
792
|
-
"highlightable-item--effect-text-reveal": this.effect ===
|
|
813
|
+
"highlightable-item--effect-text-reveal": this.effect === q.TextReveal,
|
|
793
814
|
[`highlightable-item--text-reveal-style-${this.textRevealStyle}`]: !0
|
|
794
815
|
};
|
|
795
816
|
}
|
|
796
817
|
get imageClass() {
|
|
797
|
-
let
|
|
818
|
+
let t = "landscape", e = this.ratio;
|
|
798
819
|
const o = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), h = this.isResizing ? this.resizeSize.width : o, r = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
|
|
799
|
-
return h && r && (
|
|
820
|
+
return h && r && (e = h / r), e > this.imageRatio && (t = "portrait"), {
|
|
800
821
|
image: !0,
|
|
801
822
|
[`image--${this.objectFit}`]: !0,
|
|
802
|
-
[`image--${
|
|
823
|
+
[`image--${t}`]: !0,
|
|
803
824
|
[`image--height-${this.heightMode}`]: !0,
|
|
804
825
|
"image--can-zoom": this.canZoom,
|
|
805
826
|
"image--has-action": this.hasZoomAction,
|
|
@@ -839,8 +860,8 @@ let l = class extends A {
|
|
|
839
860
|
handleBlur() {
|
|
840
861
|
this.isZoomed && this.zoom?.close();
|
|
841
862
|
}
|
|
842
|
-
handleKeyDown(
|
|
843
|
-
|
|
863
|
+
handleKeyDown(t) {
|
|
864
|
+
t.target === this.highlighterElement && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.highlighterElement.click());
|
|
844
865
|
}
|
|
845
866
|
async handleCanZoomChange() {
|
|
846
867
|
await this.updateComplete, this.hasZoomAction ? this.initZoom() : (this.zoom?.detach(), this.zoom = null);
|
|
@@ -852,7 +873,7 @@ let l = class extends A {
|
|
|
852
873
|
this.isLoaded = !1, this.isError = !1;
|
|
853
874
|
}
|
|
854
875
|
async initZoom() {
|
|
855
|
-
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom =
|
|
876
|
+
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = Ke(this.zoomImageElement, {
|
|
856
877
|
background: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.8))",
|
|
857
878
|
margin: 0,
|
|
858
879
|
scrollOffset: 0
|
|
@@ -862,170 +883,170 @@ let l = class extends A {
|
|
|
862
883
|
this.emit("cx-image-zoom-close"), this.isZoomed = !1;
|
|
863
884
|
}));
|
|
864
885
|
}
|
|
865
|
-
handleLoad(
|
|
866
|
-
const
|
|
867
|
-
if (!
|
|
886
|
+
handleLoad(t) {
|
|
887
|
+
const e = t?.currentTarget ?? this.imageElement;
|
|
888
|
+
if (!e)
|
|
868
889
|
return;
|
|
869
|
-
const { naturalHeight: o, naturalWidth: h } =
|
|
890
|
+
const { naturalHeight: o, naturalWidth: h } = e;
|
|
870
891
|
this.imageRatio = h / o, this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0, this.isError = !1);
|
|
871
892
|
}
|
|
872
893
|
handleError() {
|
|
873
894
|
this.emit("cx-error"), this.isLoaded = !0, this.isError = !0;
|
|
874
895
|
}
|
|
875
896
|
handleSizeChange() {
|
|
876
|
-
const
|
|
877
|
-
this.width || this.isResizing ? this.style.setProperty("--width",
|
|
897
|
+
const t = this.isResizing ? `${this.resizeSize.width}px` : this.width, e = this.isResizing ? `${this.resizeSize.height}px` : this.height;
|
|
898
|
+
this.width || this.isResizing ? this.style.setProperty("--width", t) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", e) : this.style.removeProperty("--height");
|
|
878
899
|
}
|
|
879
|
-
handleResize(
|
|
880
|
-
const { entries:
|
|
881
|
-
for (const o of
|
|
900
|
+
handleResize(t) {
|
|
901
|
+
const { entries: e } = t.detail;
|
|
902
|
+
for (const o of e)
|
|
882
903
|
o.target === this.highlighterElement && this.width.endsWith("%") && !this.isResizing && Math.abs(o.contentRect.width - (this.lastPatchedWidth ?? 0)) > 1 && this.updateLastPatchedWidth(o.contentRect.width);
|
|
883
904
|
}
|
|
884
|
-
updateLastPatchedWidth(
|
|
885
|
-
this.lastPatchedWidth =
|
|
905
|
+
updateLastPatchedWidth(t) {
|
|
906
|
+
this.lastPatchedWidth = t, this.requestUpdate();
|
|
886
907
|
}
|
|
887
908
|
/**
|
|
888
909
|
* Support CMS5 click action for the image.
|
|
889
910
|
*/
|
|
890
|
-
handleClickAction(
|
|
891
|
-
!(
|
|
911
|
+
handleClickAction(t) {
|
|
912
|
+
!(t.target instanceof HTMLElement) || this.clickHandlerType === Y.Manual || this.canZoom && this.openZoom();
|
|
892
913
|
}
|
|
893
|
-
updated(
|
|
894
|
-
super.updated(
|
|
914
|
+
updated(t) {
|
|
915
|
+
super.updated(t), (t.has("width") || t.has("height") || t.has("resizeSize")) && this.handleSizeChange();
|
|
895
916
|
}
|
|
896
917
|
openZoom() {
|
|
897
918
|
this.zoom && this.zoom.open();
|
|
898
919
|
}
|
|
899
920
|
renderContent() {
|
|
900
|
-
const
|
|
901
|
-
return
|
|
921
|
+
const t = this.currentSrc, e = this.currentAltValue;
|
|
922
|
+
return B`<div part="content" slot="anchor" class=${j(this.highlighterClass)}><img part="image" class=${j(this.imageClass)} src=${t || this.placeholder} alt=${e} aria-label=${e} crossorigin="anonymous" @load=${this.handleLoad} @error=${this.handleError} loading=${this.htmlLoading}></div>`;
|
|
902
923
|
}
|
|
903
924
|
render() {
|
|
904
|
-
const
|
|
905
|
-
return
|
|
925
|
+
const t = this.hasZoomAction, e = this.currentAltValue, o = !this.currentSrc && !this.placeholder;
|
|
926
|
+
return B`<div part="base" class=${j({
|
|
906
927
|
container: !0,
|
|
907
928
|
"container--empty": o,
|
|
908
929
|
"container--loading": this.loading,
|
|
909
930
|
"container--resizing": this.resizable && this.isResizeActive
|
|
910
|
-
})} style=${
|
|
931
|
+
})} style=${Te({
|
|
911
932
|
"--easing": this.easeCSSVariable
|
|
912
|
-
})} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${
|
|
933
|
+
})} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${Me(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${e} aria-roledescription=${this.localize.term("image")} class=${j(o ? {} : this.getHighlighterClass())} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${F(
|
|
913
934
|
o,
|
|
914
935
|
() => Le,
|
|
915
|
-
() =>
|
|
916
|
-
this.effect ===
|
|
917
|
-
() =>
|
|
936
|
+
() => F(
|
|
937
|
+
this.effect === q.Jump || this.effect === q.Zoom,
|
|
938
|
+
() => B`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
|
|
918
939
|
() => this.renderContent()
|
|
919
940
|
)
|
|
920
|
-
)}<div class="zoom-image-container">${
|
|
921
|
-
|
|
922
|
-
() =>
|
|
941
|
+
)}<div class="zoom-image-container">${F(
|
|
942
|
+
t,
|
|
943
|
+
() => B`<img part="zoom-image" class=${j({
|
|
923
944
|
"zoom-image": !0,
|
|
924
945
|
"zoom-image--hidden": !this.isZoomed
|
|
925
946
|
})} src=${this.currentSrc || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin="anonymous">`
|
|
926
|
-
)}</div>${
|
|
947
|
+
)}</div>${F(
|
|
927
948
|
this.skeleton && !this.isLoaded && !this.isError || this.loading,
|
|
928
|
-
() =>
|
|
949
|
+
() => B`<slot name="skeleton" part="skeleton"><div class=${j({
|
|
929
950
|
skeleton: !0
|
|
930
951
|
})}><cx-skeleton effect="sheen"></cx-skeleton></div></slot>`
|
|
931
952
|
)}
|
|
932
|
-
${
|
|
953
|
+
${F(this.isError && this.fallback, () => B`<slot name="fallback" part="fallback"><cx-space class=${j({ fallback: !0 })} direction="column" align-items="center" justify-content="center"><cx-icon name="hide_image" part="fallback-icon"> </cx-icon></cx-space></slot>`)}</div></cx-resize-observer>${F(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
|
|
933
954
|
}
|
|
934
955
|
};
|
|
935
|
-
l.styles = [We,
|
|
956
|
+
l.styles = [We, Ue, et];
|
|
936
957
|
l.dependencies = {
|
|
937
|
-
"cx-icon":
|
|
938
|
-
"cx-popup":
|
|
958
|
+
"cx-icon": je,
|
|
959
|
+
"cx-popup": Ne,
|
|
939
960
|
"cx-resize-observer": Ze,
|
|
940
961
|
"cx-skeleton": Ie,
|
|
941
|
-
"cx-space":
|
|
962
|
+
"cx-space": Ve
|
|
942
963
|
};
|
|
943
|
-
|
|
944
|
-
|
|
964
|
+
g([
|
|
965
|
+
K(".image")
|
|
945
966
|
], l.prototype, "imageElement", 2);
|
|
946
|
-
|
|
947
|
-
|
|
967
|
+
g([
|
|
968
|
+
K(".zoom-image")
|
|
948
969
|
], l.prototype, "zoomImageElement", 2);
|
|
949
|
-
|
|
950
|
-
|
|
970
|
+
g([
|
|
971
|
+
K(".highlighter")
|
|
951
972
|
], l.prototype, "highlighterElement", 2);
|
|
952
|
-
|
|
973
|
+
g([
|
|
953
974
|
H()
|
|
954
975
|
], l.prototype, "isLoaded", 2);
|
|
955
|
-
|
|
976
|
+
g([
|
|
956
977
|
H()
|
|
957
978
|
], l.prototype, "isError", 2);
|
|
958
|
-
|
|
979
|
+
g([
|
|
959
980
|
d({ reflect: !0, type: String })
|
|
960
981
|
], l.prototype, "src", 2);
|
|
961
|
-
|
|
982
|
+
g([
|
|
962
983
|
d({ reflect: !0, type: String })
|
|
963
984
|
], l.prototype, "placeholder", 2);
|
|
964
|
-
|
|
985
|
+
g([
|
|
965
986
|
d({ reflect: !0, type: String })
|
|
966
987
|
], l.prototype, "alt", 2);
|
|
967
|
-
|
|
988
|
+
g([
|
|
968
989
|
d({ attribute: "object-fit", reflect: !0 })
|
|
969
990
|
], l.prototype, "objectFit", 2);
|
|
970
|
-
|
|
991
|
+
g([
|
|
971
992
|
d({ reflect: !0, type: Boolean })
|
|
972
993
|
], l.prototype, "skeleton", 2);
|
|
973
|
-
|
|
994
|
+
g([
|
|
974
995
|
d({ reflect: !0, type: Boolean })
|
|
975
996
|
], l.prototype, "fallback", 2);
|
|
976
|
-
|
|
997
|
+
g([
|
|
977
998
|
d({ attribute: "can-zoom", reflect: !0, type: Boolean })
|
|
978
999
|
], l.prototype, "canZoom", 2);
|
|
979
|
-
|
|
1000
|
+
g([
|
|
980
1001
|
d({ reflect: !0, type: Boolean })
|
|
981
1002
|
], l.prototype, "loading", 2);
|
|
982
|
-
|
|
1003
|
+
g([
|
|
983
1004
|
d({ reflect: !0, type: Boolean })
|
|
984
1005
|
], l.prototype, "block", 2);
|
|
985
|
-
|
|
1006
|
+
g([
|
|
986
1007
|
d({ attribute: "html-loading", reflect: !0, type: String })
|
|
987
1008
|
], l.prototype, "htmlLoading", 2);
|
|
988
|
-
|
|
1009
|
+
g([
|
|
989
1010
|
d({ attribute: "click-handler-type", reflect: !0, type: String })
|
|
990
1011
|
], l.prototype, "clickHandlerType", 2);
|
|
991
|
-
|
|
1012
|
+
g([
|
|
992
1013
|
H()
|
|
993
1014
|
], l.prototype, "isZoomed", 2);
|
|
994
|
-
|
|
1015
|
+
g([
|
|
995
1016
|
H()
|
|
996
1017
|
], l.prototype, "imageRatio", 2);
|
|
997
|
-
|
|
1018
|
+
g([
|
|
998
1019
|
H()
|
|
999
1020
|
], l.prototype, "parsedAlt", 2);
|
|
1000
|
-
|
|
1021
|
+
g([
|
|
1001
1022
|
H()
|
|
1002
1023
|
], l.prototype, "parsedAltDarkMode", 2);
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1024
|
+
g([
|
|
1025
|
+
X("isLoaded"),
|
|
1026
|
+
X("canZoom", { waitUntilFirstUpdate: !0 })
|
|
1006
1027
|
], l.prototype, "handleCanZoomChange", 1);
|
|
1007
|
-
|
|
1008
|
-
|
|
1028
|
+
g([
|
|
1029
|
+
X("objectFit", { waitUntilFirstUpdate: !0 })
|
|
1009
1030
|
], l.prototype, "handleObjectFitChange", 1);
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1031
|
+
g([
|
|
1032
|
+
X("src"),
|
|
1033
|
+
X("srcDarkMode")
|
|
1013
1034
|
], l.prototype, "handleSrcChange", 1);
|
|
1014
|
-
|
|
1035
|
+
g([
|
|
1015
1036
|
Oe(100)
|
|
1016
1037
|
], l.prototype, "updateLastPatchedWidth", 1);
|
|
1017
|
-
l =
|
|
1038
|
+
l = g([
|
|
1018
1039
|
Ae("cx-image")
|
|
1019
1040
|
], l);
|
|
1020
1041
|
export {
|
|
1021
1042
|
l as C,
|
|
1022
1043
|
Pe as H,
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1044
|
+
D as R,
|
|
1045
|
+
R as a,
|
|
1046
|
+
q as b,
|
|
1047
|
+
Y as c,
|
|
1027
1048
|
pe as d,
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1049
|
+
ue as e,
|
|
1050
|
+
se as f,
|
|
1051
|
+
Ue as r
|
|
1031
1052
|
};
|