@orangelogic/design-system 2.95.0 → 2.97.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/asset.B3vySOI-.js +431 -0
- package/library/chunks/{asset.types.6DCzTOQm.js → asset.types.KXRZEtBr.js} +127 -126
- package/library/chunks/{button.BZjbVq8t.js → button.CAa1kvwe.js} +2 -2
- package/library/chunks/{color-swatch-group.Q8ybVS0A.js → color-swatch-group.ChcPlkPU.js} +5 -5
- package/library/chunks/{color-swatch.CbL_TpRZ.js → color-swatch.DJ1kUnBQ.js} +1 -1
- package/library/chunks/{confirm-popover.bBo9aPlX.js → confirm-popover.D4x0nO5g.js} +3 -3
- package/library/chunks/content-builder.CcgZciZN.js +58 -0
- package/library/chunks/{cropper.uKGcvnPk.js → cropper.Bib8Abm3.js} +4937 -4932
- package/library/chunks/{dialog.DRW8iwh-.js → dialog.BLaxLMSc.js} +2 -2
- package/library/chunks/{dom.DURaLV1d.js → dom.0RpWet6y.js} +1 -1
- package/library/chunks/{dot-pagination.CvUr6R4S.js → dot-pagination.-nDdQxJN.js} +1 -1
- package/library/chunks/{file-on-demand.KQlA1JFF.js → file-on-demand.AzwoUvwB.js} +10 -10
- package/library/chunks/{folder-select.DxBOSyvo.js → folder-select.XpkOFzAW.js} +5 -5
- package/library/chunks/{form.nRqYei4e.js → form.Ch1cwYzO.js} +1 -1
- package/library/chunks/{header.ClxEkQPZ.js → header.BZxyeLPK.js} +1 -1
- package/library/chunks/{i18n.W6czbRms.js → i18n.BABe9hN4.js} +6 -0
- package/library/chunks/{icon-button.MqA-pNw8.js → icon-button.C2s3pHG4.js} +1 -1
- package/library/chunks/{iframe.PcSPtm_O.js → iframe.DPccxsnE.js} +1 -1
- package/library/chunks/{image.Dtdklw5q.js → image.9qwbjGNb.js} +1 -1
- package/library/chunks/{image.C-Covc0H.js → image.Cc4V85ID.js} +354 -311
- package/library/chunks/{list-editor.BnHKqD0O.js → list-editor.pVYc_70c.js} +183 -153
- package/library/chunks/{number.CCF6IxpN.js → number.B4PQLJIg.js} +32 -32
- package/library/chunks/{option.Cx54zrJq.js → option.DGXQzdtb.js} +1 -1
- package/library/chunks/{pagination.CG5odPWi.js → pagination.DZqKSA86.js} +4 -4
- package/library/chunks/{responsive.D9TUCX5p.js → responsive.Oz9HWjyQ.js} +1 -1
- package/library/chunks/{string.DfV21HEI.js → string.DUgD4c9f.js} +41 -34
- package/library/chunks/{tab-group.BLZ-qEpp.js → tab-group.BhCf9Smq.js} +4 -4
- package/library/chunks/{table.CYxWpvAC.js → table.V5PGGTfO.js} +13 -11
- package/library/chunks/{time.BNrE47-8.js → time.BiQnh9wt.js} +1 -1
- package/library/chunks/toast.D3AW3RWv.js +94 -0
- package/library/chunks/transformation.Cqz3hPaQ.js +144 -0
- package/library/chunks/{tree.CKi63r95.js → tree.DZa7k-4E.js} +1 -1
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +767 -862
- package/library/components/atoms.js +12 -12
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +3 -3
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +3 -3
- package/library/components/color-swatch-group.js +6 -6
- package/library/components/color-swatch.js +2 -2
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/cropper.js +1 -1
- package/library/components/details.js +4 -4
- package/library/components/dialog.js +3 -3
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +4 -4
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +11 -11
- package/library/components/folder-select.js +4 -4
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +1 -1
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +2 -2
- package/library/components/header.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/iframe.js +2 -2
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +2 -2
- package/library/components/input.js +4 -7
- package/library/components/line-clamp.js +1 -1
- package/library/components/list-editor.js +6 -6
- package/library/components/masonry.js +2 -2
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +5 -5
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/pagination.js +5 -5
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/range.js +2 -2
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +3 -3
- package/library/components/share-option-list.js +2 -2
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +2 -2
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab.js +2 -2
- package/library/components/table.js +5 -5
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +2 -2
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +2 -2
- package/library/components/tree.js +2 -2
- package/library/components/typeface.js +2 -2
- package/library/components/types.js +31066 -29848
- package/library/components/video.js +554 -545
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/image/image.d.ts +15 -1
- package/library/packages/atoms/src/components/input/input.d.ts +1 -2
- package/library/packages/atoms/src/components/video/video.d.ts +3 -1
- package/library/packages/events/src/cx-asset-format-picker-delete.d.ts +6 -0
- package/library/packages/events/src/cx-asset-format-picker-select.d.ts +8 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
- package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
- package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
- package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
- package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
- package/library/packages/events/src/cx-timeline-data-resolved.d.ts +10 -0
- package/library/packages/events/src/cx-video-thumbnail-resolved.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +12 -1
- package/library/packages/molecules/src/asset-data-display/asset-data-display.d.ts +1 -0
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.d.ts +56 -0
- package/library/packages/molecules/src/asset-format-picker/asset-format-picker.styles.d.ts +2 -0
- package/library/packages/molecules/src/asset-picker/asset-picker.d.ts +7 -0
- package/library/packages/molecules/src/cropper/cropper.d.ts +1 -0
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +1 -0
- package/library/packages/molecules/src/download-format-picker/download-format-picker.d.ts +5 -1
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/molecules/src/timeline/timeline.d.ts +18 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +12 -0
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +102 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
- package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
- package/library/packages/organisms/src/carousel/carousel.d.ts +3 -1
- package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
- package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +2 -2
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
- package/library/packages/organisms/src/content-builder/styleController.d.ts +26 -1
- package/library/packages/organisms/src/index.d.ts +2 -0
- package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
- package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
- package/library/packages/services/src/api/asset/asset.d.ts +2 -2
- package/library/packages/services/src/api/asset/asset.types.d.ts +4 -0
- package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +19 -5
- package/library/packages/types/src/asset-click-action.d.ts +3 -1
- package/library/packages/types/src/asset-format-picker.d.ts +11 -0
- package/library/packages/types/src/bento-grid.d.ts +37 -0
- package/library/packages/types/src/content-builder.d.ts +37 -1
- package/library/packages/types/src/gallery.d.ts +0 -6
- package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
- package/library/packages/utils/src/custom-element/i18n.d.ts +6 -0
- package/library/packages/utils/src/index.d.ts +1 -0
- package/library/packages/utils/src/string/string.d.ts +1 -0
- package/library/packages/utils/src/transformation/index.d.ts +1 -0
- package/library/react-web-component.d.ts +236 -8
- package/library/utils.js +517 -192
- package/package.json +1 -1
- package/library/chunks/asset.Duzr3O3z.js +0 -370
- package/library/chunks/index.BgXEXk4m.js +0 -398
- package/library/chunks/toast.Bc4wpYJ1.js +0 -150
- /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import { x as
|
|
1
|
+
import { x as A, i as he, E as ue } from "./lit-element.jLBm65_O.js";
|
|
2
2
|
import { C as He, n as d } from "./lib-cortex-element.CVMmyPMC.js";
|
|
3
|
-
import { r as
|
|
3
|
+
import { r as L } from "./state.CSDxrqLd.js";
|
|
4
4
|
import { e as K } from "./query.BBf1UFkC.js";
|
|
5
5
|
import { E as De, b as ce, a as $e } from "./index.Cpamj0jB.js";
|
|
6
|
-
import { c as
|
|
7
|
-
import { c as
|
|
6
|
+
import { c as Te } from "./component.styles.CRO4Odto.js";
|
|
7
|
+
import { c as We } from "./custom-element.L4WJXn1j.js";
|
|
8
8
|
import { d as Oe } from "./debounce.DaHuiSGU.js";
|
|
9
|
-
import { L as
|
|
9
|
+
import { L as Ae } from "./i18n.BABe9hN4.js";
|
|
10
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 {
|
|
14
|
-
import {
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
18
|
-
import
|
|
19
|
-
import Ve from "../components/
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
12
|
+
import { o as Be } from "./if-defined.BRoBj_Rp.js";
|
|
13
|
+
import { e as Me, i as je } from "./directive.oAbCiebi.js";
|
|
14
|
+
import { m as Ie } from "./directive-helpers.Dm4rc594.js";
|
|
15
|
+
import { o as _e } from "./style-map.llVFPd__.js";
|
|
16
|
+
import { n as P } from "./when.Dr1es41R.js";
|
|
17
|
+
import Ne from "../components/icon.js";
|
|
18
|
+
import Ze from "../components/popup.js";
|
|
19
|
+
import Ve from "../components/resize-observer.js";
|
|
20
|
+
import Pe from "../components/skeleton.js";
|
|
21
|
+
import Fe from "../components/space.js";
|
|
22
|
+
var Ue = /* @__PURE__ */ ((e) => (e.Bottom = "bottom", e.BottomCenter = "bottom-center", e.BottomLeft = "bottom-left", e.BottomRight = "bottom-right", e.CenterCenter = "center-center", e.CenterLeft = "center-left", e.CenterRight = "center-right", e.Left = "left", e.Right = "right", e.Top = "top", e.TopCenter = "top-center", e.TopLeft = "top-left", e.TopRight = "top-right", e))(Ue || {}), q = /* @__PURE__ */ ((e) => (e.Jump = "jump", e.None = "none", e.TextReveal = "text-reveal", e.Zoom = "zoom", e))(q || {}), pe = /* @__PURE__ */ ((e) => (e.PopOut = "pop-out", e.WithinBorders = "within-borders", e))(pe || {}), fe = /* @__PURE__ */ ((e) => (e.Fade = "fade", e.Slide = "slide", e))(fe || {}), se = /* @__PURE__ */ ((e) => (e.Auto = "auto", e.Fixed = "fixed", e))(se || {}), W = /* @__PURE__ */ ((e) => (e.Both = "both", e.Horizontal = "horizontal", e.Vertical = "vertical", e))(W || {}), Ye = Object.defineProperty, C = (e, t, r, h) => {
|
|
23
|
+
for (var o = void 0, g = e.length - 1, u; g >= 0; g--)
|
|
24
|
+
(u = e[g]) && (o = u(t, r, o) || o);
|
|
25
|
+
return o && Ye(t, r, o), o;
|
|
24
26
|
};
|
|
25
|
-
class
|
|
27
|
+
class S extends He {
|
|
26
28
|
constructor() {
|
|
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 =
|
|
29
|
+
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 = fe.Slide, this.zoomStyle = pe.WithinBorders, this.hasSlotContent = !1, this.isCustomSlot = !1, this.isHovering = !1;
|
|
28
30
|
}
|
|
29
31
|
get easeCSSVariable() {
|
|
30
32
|
return ce[this.easing] || ce.linear;
|
|
@@ -46,100 +48,100 @@ class R extends He {
|
|
|
46
48
|
*/
|
|
47
49
|
handleSlotChange() {
|
|
48
50
|
if (this.slotEl) {
|
|
49
|
-
const
|
|
50
|
-
this.hasSlotContent =
|
|
51
|
-
(
|
|
51
|
+
const t = this.slotEl.assignedElements({ flatten: !0 });
|
|
52
|
+
this.hasSlotContent = t.length > 0, this.isCustomSlot = !t.some(
|
|
53
|
+
(r) => r.hasAttribute("data-item-id")
|
|
52
54
|
);
|
|
53
55
|
} else
|
|
54
56
|
this.hasSlotContent = this.childElementCount > 0, this.isCustomSlot = !0;
|
|
55
57
|
}
|
|
56
58
|
}
|
|
57
|
-
|
|
59
|
+
C([
|
|
58
60
|
K("slot")
|
|
59
|
-
],
|
|
60
|
-
|
|
61
|
+
], S.prototype, "slotEl");
|
|
62
|
+
C([
|
|
61
63
|
d({ attribute: "has-event", reflect: !0, type: Boolean })
|
|
62
|
-
],
|
|
63
|
-
|
|
64
|
+
], S.prototype, "hasEvent");
|
|
65
|
+
C([
|
|
64
66
|
d({ reflect: !0, type: String })
|
|
65
|
-
],
|
|
66
|
-
|
|
67
|
+
], S.prototype, "easing");
|
|
68
|
+
C([
|
|
67
69
|
d({ attribute: "highlight-border", reflect: !0, type: Boolean })
|
|
68
|
-
],
|
|
69
|
-
|
|
70
|
+
], S.prototype, "highlightBorder");
|
|
71
|
+
C([
|
|
70
72
|
d({
|
|
71
73
|
attribute: "highlight-color-overlay",
|
|
72
74
|
reflect: !0,
|
|
73
75
|
type: Boolean
|
|
74
76
|
})
|
|
75
|
-
],
|
|
76
|
-
|
|
77
|
+
], S.prototype, "highlightColorOverlay");
|
|
78
|
+
C([
|
|
77
79
|
d({
|
|
78
80
|
attribute: "highlight-drop-shadow",
|
|
79
81
|
reflect: !0,
|
|
80
82
|
type: Boolean
|
|
81
83
|
})
|
|
82
|
-
],
|
|
83
|
-
|
|
84
|
+
], S.prototype, "highlightDropShadow");
|
|
85
|
+
C([
|
|
84
86
|
d({ attribute: "highlight-background", reflect: !0, type: Boolean })
|
|
85
|
-
],
|
|
86
|
-
|
|
87
|
+
], S.prototype, "highlightBackground");
|
|
88
|
+
C([
|
|
87
89
|
d({ attribute: "highlight-opacity", reflect: !0, type: Boolean })
|
|
88
|
-
],
|
|
89
|
-
|
|
90
|
+
], S.prototype, "highlightOpacity");
|
|
91
|
+
C([
|
|
90
92
|
d({ attribute: "effect", reflect: !0, type: String })
|
|
91
|
-
],
|
|
92
|
-
|
|
93
|
+
], S.prototype, "effect");
|
|
94
|
+
C([
|
|
93
95
|
d({
|
|
94
96
|
attribute: "text-reveal-style",
|
|
95
97
|
reflect: !0,
|
|
96
98
|
type: String
|
|
97
99
|
})
|
|
98
|
-
],
|
|
99
|
-
|
|
100
|
+
], S.prototype, "textRevealStyle");
|
|
101
|
+
C([
|
|
100
102
|
d({
|
|
101
103
|
attribute: "zoom-style",
|
|
102
104
|
reflect: !0,
|
|
103
105
|
type: String
|
|
104
106
|
})
|
|
105
|
-
],
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
],
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
],
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
],
|
|
115
|
-
var
|
|
116
|
-
for (var
|
|
117
|
-
(u =
|
|
118
|
-
return
|
|
107
|
+
], S.prototype, "zoomStyle");
|
|
108
|
+
C([
|
|
109
|
+
L()
|
|
110
|
+
], S.prototype, "hasSlotContent");
|
|
111
|
+
C([
|
|
112
|
+
L()
|
|
113
|
+
], S.prototype, "isCustomSlot");
|
|
114
|
+
C([
|
|
115
|
+
L()
|
|
116
|
+
], S.prototype, "isHovering");
|
|
117
|
+
var qe = Object.defineProperty, O = (e, t, r, h) => {
|
|
118
|
+
for (var o = void 0, g = e.length - 1, u; g >= 0; g--)
|
|
119
|
+
(u = e[g]) && (o = u(t, r, o) || o);
|
|
120
|
+
return o && qe(t, r, o), o;
|
|
119
121
|
};
|
|
120
|
-
class D extends
|
|
122
|
+
class D extends S {
|
|
121
123
|
constructor() {
|
|
122
|
-
super(), this.width = "", this.height = "", this.resizable = !1, this.heightMode = se.Fixed, this.resizeDirection =
|
|
124
|
+
super(), this.width = "", this.height = "", this.resizable = !1, this.heightMode = se.Fixed, this.resizeDirection = W.Both, this.noLimit = !1, this.parentContainer = null, this.isResizeActive = !1, this.isResizing = !1, this.resizeSize = {
|
|
123
125
|
height: 0,
|
|
124
126
|
width: 0
|
|
125
127
|
}, this.maxWidth = 0, this.maxHeight = 0, this.minWidth = 0, this.minHeight = 0, this.handleDocumentMouseDown = this.handleDocumentMouseDown.bind(this);
|
|
126
128
|
}
|
|
127
129
|
get ratio() {
|
|
128
|
-
const
|
|
129
|
-
return !
|
|
130
|
+
const t = this.clientWidth || 0, r = this.clientHeight || 0;
|
|
131
|
+
return !t || !r ? 1 : t / r;
|
|
130
132
|
}
|
|
131
133
|
get keepRatio() {
|
|
132
134
|
return this.heightMode === se.Auto;
|
|
133
135
|
}
|
|
134
136
|
get canResizeHorizontal() {
|
|
135
|
-
return this.resizeDirection !==
|
|
137
|
+
return this.resizeDirection !== W.Vertical;
|
|
136
138
|
}
|
|
137
139
|
get canResizeVertical() {
|
|
138
|
-
return this.resizeDirection !==
|
|
140
|
+
return this.resizeDirection !== W.Horizontal;
|
|
139
141
|
}
|
|
140
|
-
handleDocumentMouseDown(
|
|
141
|
-
const
|
|
142
|
-
this.containingElement && !
|
|
142
|
+
handleDocumentMouseDown(t) {
|
|
143
|
+
const r = t.composedPath();
|
|
144
|
+
this.containingElement && !r.includes(this.containingElement) && this.stopResizing();
|
|
143
145
|
}
|
|
144
146
|
startResizing() {
|
|
145
147
|
!this.resizable || this.isResizeActive || (this.isResizeActive = !0, this.ownerDocument.addEventListener(
|
|
@@ -153,54 +155,54 @@ class D extends R {
|
|
|
153
155
|
this.handleDocumentMouseDown
|
|
154
156
|
);
|
|
155
157
|
}
|
|
156
|
-
handleResizeDragging(
|
|
157
|
-
|
|
158
|
+
handleResizeDragging(t, r = !1, h = !1) {
|
|
159
|
+
t.preventDefault(), t.stopPropagation(), this.maxWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--max-width")) || this.parentContainer?.clientWidth || this.parentElement?.clientWidth || 1 / 0, this.maxHeight = Number.parseInt(
|
|
158
160
|
getComputedStyle(this).getPropertyValue("--max-height")
|
|
159
161
|
) || 1 / 0, this.minWidth = Number.parseInt(getComputedStyle(this).getPropertyValue("--min-width")) || 40, this.minHeight = Number.parseInt(
|
|
160
162
|
getComputedStyle(this).getPropertyValue("--min-height")
|
|
161
163
|
) || 40, this.isResizing = !0;
|
|
162
|
-
const
|
|
163
|
-
let
|
|
164
|
+
const o = { x: t.pageX, y: t.pageY };
|
|
165
|
+
let g = 0, u = 0;
|
|
164
166
|
const x = {
|
|
165
167
|
height: this.containingElement?.clientHeight || 0,
|
|
166
168
|
width: this.containingElement?.clientWidth || 0
|
|
167
169
|
};
|
|
168
170
|
if (!this.noLimit && this.parentElement) {
|
|
169
|
-
const $ = getComputedStyle(this.parentElement), p = $.getPropertyValue("padding-left").trim() || "0px", v = $.getPropertyValue("padding-right").trim() || "0px",
|
|
170
|
-
|
|
171
|
-
|
|
171
|
+
const $ = getComputedStyle(this.parentElement), p = $.getPropertyValue("padding-left").trim() || "0px", v = $.getPropertyValue("padding-right").trim() || "0px", B = Number(p.replace("px", "")), y = Number(v.replace("px", "")), H = getComputedStyle(this.parentElement).getPropertyValue("--padding").trim() || "0px", E = Number(H.replace("px", "")), ie = Math.max(
|
|
172
|
+
B + y,
|
|
173
|
+
E * 2
|
|
172
174
|
);
|
|
173
175
|
this.maxWidth = Math.max(this.maxWidth - ie, 0);
|
|
174
176
|
}
|
|
175
177
|
this.emit("cx-resize-start", {
|
|
176
178
|
detail: {
|
|
177
179
|
element: this,
|
|
178
|
-
event:
|
|
180
|
+
event: t
|
|
179
181
|
}
|
|
180
182
|
});
|
|
181
|
-
const
|
|
182
|
-
|
|
183
|
-
let p =
|
|
184
|
-
if (this.resizeDirection ===
|
|
185
|
-
const
|
|
186
|
-
let
|
|
187
|
-
|
|
183
|
+
const _ = ($) => {
|
|
184
|
+
g = Number(x.width) + (r ? o.x - $.pageX : $.pageX - o.x), u = Number(x.height) + (h ? o.y - $.pageY : $.pageY - o.y), this.canResizeHorizontal || (g = Number(x.width)), this.canResizeVertical || (u = Number(x.height)), this.resizeDirection === W.Both && this.keepRatio && (u >= g / this.ratio && (u = g / this.ratio), g >= u * this.ratio && (g = u * this.ratio));
|
|
185
|
+
let p = g, v = u;
|
|
186
|
+
if (this.resizeDirection === W.Both && this.keepRatio) {
|
|
187
|
+
const B = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
|
|
188
|
+
let H = Math.min(p, B), E = H / this.ratio;
|
|
189
|
+
E > y && (E = y, H = E * this.ratio), p = H, v = E;
|
|
188
190
|
} else
|
|
189
191
|
p = this.maxWidth ? Math.min(p, this.maxWidth) : p, v = this.maxHeight ? Math.min(v, this.maxHeight) : v;
|
|
190
192
|
this.resizeSize = {
|
|
191
193
|
height: Math.round(v),
|
|
192
194
|
width: Math.round(p)
|
|
193
|
-
}, this.resizeDirection ===
|
|
194
|
-
},
|
|
195
|
-
if (
|
|
196
|
-
let p =
|
|
197
|
-
if (this.canResizeHorizontal || (p = Number(x.width)), this.canResizeVertical || (v = Number(x.height)), this.resizeDirection ===
|
|
198
|
-
const
|
|
199
|
-
let
|
|
200
|
-
|
|
195
|
+
}, this.resizeDirection === W.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));
|
|
196
|
+
}, N = ($) => {
|
|
197
|
+
if (g > 0 && u > 0) {
|
|
198
|
+
let p = g, v = u;
|
|
199
|
+
if (this.canResizeHorizontal || (p = Number(x.width)), this.canResizeVertical || (v = Number(x.height)), this.resizeDirection === W.Both && this.keepRatio) {
|
|
200
|
+
const B = this.maxWidth ?? 1 / 0, y = this.maxHeight ?? 1 / 0;
|
|
201
|
+
let H = Math.min(p, B), E = H / this.ratio;
|
|
202
|
+
E > y && (E = y, H = E * this.ratio), p = H, v = E;
|
|
201
203
|
} else
|
|
202
204
|
p = this.maxWidth ? Math.min(p, this.maxWidth) : p, v = this.maxHeight ? Math.min(v, this.maxHeight) : v;
|
|
203
|
-
this.resizeDirection ===
|
|
205
|
+
this.resizeDirection === W.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 = {
|
|
204
206
|
height: 0,
|
|
205
207
|
width: 0
|
|
206
208
|
}, this.isResizing = !1;
|
|
@@ -212,42 +214,42 @@ class D extends R {
|
|
|
212
214
|
}
|
|
213
215
|
}), this.ownerDocument.defaultView?.removeEventListener(
|
|
214
216
|
"mousemove",
|
|
215
|
-
|
|
217
|
+
_
|
|
216
218
|
);
|
|
217
219
|
};
|
|
218
220
|
this.ownerDocument.defaultView?.addEventListener(
|
|
219
221
|
"mousemove",
|
|
220
|
-
|
|
221
|
-
), this.ownerDocument.defaultView?.addEventListener("mouseup",
|
|
222
|
+
_
|
|
223
|
+
), this.ownerDocument.defaultView?.addEventListener("mouseup", N, {
|
|
222
224
|
once: !0
|
|
223
225
|
});
|
|
224
226
|
}
|
|
225
|
-
handleResizeDraggingTopLeft(
|
|
226
|
-
this.handleResizeDragging(
|
|
227
|
+
handleResizeDraggingTopLeft(t) {
|
|
228
|
+
this.handleResizeDragging(t, !0, !0);
|
|
227
229
|
}
|
|
228
|
-
handleResizeDraggingTopRight(
|
|
229
|
-
this.handleResizeDragging(
|
|
230
|
+
handleResizeDraggingTopRight(t) {
|
|
231
|
+
this.handleResizeDragging(t, !1, !0);
|
|
230
232
|
}
|
|
231
|
-
handleResizeDraggingBottomLeft(
|
|
232
|
-
this.handleResizeDragging(
|
|
233
|
+
handleResizeDraggingBottomLeft(t) {
|
|
234
|
+
this.handleResizeDragging(t, !0, !1);
|
|
233
235
|
}
|
|
234
|
-
handleResizeDraggingBottomRight(
|
|
235
|
-
this.handleResizeDragging(
|
|
236
|
+
handleResizeDraggingBottomRight(t) {
|
|
237
|
+
this.handleResizeDragging(t, !1, !1);
|
|
236
238
|
}
|
|
237
|
-
handleResizeDraggingLeft(
|
|
238
|
-
this.handleResizeDragging(
|
|
239
|
+
handleResizeDraggingLeft(t) {
|
|
240
|
+
this.handleResizeDragging(t, !0, !1);
|
|
239
241
|
}
|
|
240
|
-
handleResizeDraggingRight(
|
|
241
|
-
this.handleResizeDragging(
|
|
242
|
+
handleResizeDraggingRight(t) {
|
|
243
|
+
this.handleResizeDragging(t, !1, !1);
|
|
242
244
|
}
|
|
243
|
-
handleResizeDraggingTop(
|
|
244
|
-
this.handleResizeDragging(
|
|
245
|
+
handleResizeDraggingTop(t) {
|
|
246
|
+
this.handleResizeDragging(t, !1, !0);
|
|
245
247
|
}
|
|
246
|
-
handleResizeDraggingBottom(
|
|
247
|
-
this.handleResizeDragging(
|
|
248
|
+
handleResizeDraggingBottom(t) {
|
|
249
|
+
this.handleResizeDragging(t, !1, !1);
|
|
248
250
|
}
|
|
249
251
|
renderResizer() {
|
|
250
|
-
return this.resizeDirection ===
|
|
252
|
+
return this.resizeDirection === W.Horizontal ? A`<div class="resizer resizer--left" @mousedown=${this.handleResizeDraggingLeft}></div><div class="resizer resizer--right" @mousedown=${this.handleResizeDraggingRight}></div>` : this.resizeDirection === W.Vertical ? A`<div class="resizer resizer--top" @mousedown=${this.handleResizeDraggingTop}></div><div class="resizer resizer--bottom" @mousedown=${this.handleResizeDraggingBottom}></div>` : A`<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>`;
|
|
251
253
|
}
|
|
252
254
|
}
|
|
253
255
|
O([
|
|
@@ -275,116 +277,132 @@ O([
|
|
|
275
277
|
d({ attribute: !1, type: Object })
|
|
276
278
|
], D.prototype, "parentContainer");
|
|
277
279
|
O([
|
|
278
|
-
|
|
280
|
+
L()
|
|
279
281
|
], D.prototype, "isResizeActive");
|
|
280
282
|
O([
|
|
281
|
-
|
|
283
|
+
L()
|
|
282
284
|
], D.prototype, "isResizing");
|
|
283
285
|
O([
|
|
284
|
-
|
|
286
|
+
L()
|
|
285
287
|
], D.prototype, "resizeSize");
|
|
286
|
-
const
|
|
287
|
-
var Y = /* @__PURE__ */ ((
|
|
288
|
+
const Xe = 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%)}`;
|
|
289
|
+
var Y = /* @__PURE__ */ ((e) => (e.Automatic = "automatic", e.Manual = "manual", e))(Y || {});
|
|
290
|
+
/**
|
|
291
|
+
* @license
|
|
292
|
+
* Copyright 2021 Google LLC
|
|
293
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
294
|
+
*/
|
|
295
|
+
const Ke = Me(class extends je {
|
|
296
|
+
constructor() {
|
|
297
|
+
super(...arguments), this.key = ue;
|
|
298
|
+
}
|
|
299
|
+
render(e, t) {
|
|
300
|
+
return this.key = e, t;
|
|
301
|
+
}
|
|
302
|
+
update(e, [t, r]) {
|
|
303
|
+
return t !== this.key && (Ie(e), this.key = t), r;
|
|
304
|
+
}
|
|
305
|
+
});
|
|
288
306
|
/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */
|
|
289
|
-
var
|
|
290
|
-
for (var
|
|
291
|
-
var
|
|
292
|
-
for (var h in
|
|
293
|
-
Object.prototype.hasOwnProperty.call(
|
|
294
|
-
}
|
|
295
|
-
return
|
|
296
|
-
}, ee = function(
|
|
297
|
-
return
|
|
298
|
-
},
|
|
299
|
-
return NodeList.prototype.isPrototypeOf(
|
|
300
|
-
}, te = function(
|
|
301
|
-
return
|
|
302
|
-
}, me = function(
|
|
303
|
-
var
|
|
304
|
-
return
|
|
305
|
-
}, ge = function(
|
|
307
|
+
var I = Object.assign || function(e) {
|
|
308
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
309
|
+
var r = arguments[t];
|
|
310
|
+
for (var h in r)
|
|
311
|
+
Object.prototype.hasOwnProperty.call(r, h) && (e[h] = r[h]);
|
|
312
|
+
}
|
|
313
|
+
return e;
|
|
314
|
+
}, ee = function(t) {
|
|
315
|
+
return t.tagName === "IMG";
|
|
316
|
+
}, Je = function(t) {
|
|
317
|
+
return NodeList.prototype.isPrototypeOf(t);
|
|
318
|
+
}, te = function(t) {
|
|
319
|
+
return t && t.nodeType === 1;
|
|
320
|
+
}, me = function(t) {
|
|
321
|
+
var r = t.currentSrc || t.src;
|
|
322
|
+
return r.substr(-4).toLowerCase() === ".svg";
|
|
323
|
+
}, ge = function(t) {
|
|
306
324
|
try {
|
|
307
|
-
return Array.isArray(
|
|
325
|
+
return Array.isArray(t) ? t.filter(ee) : Je(t) ? [].slice.call(t).filter(ee) : te(t) ? [t].filter(ee) : typeof t == "string" ? [].slice.call(document.querySelectorAll(t)).filter(ee) : [];
|
|
308
326
|
} catch {
|
|
309
327
|
throw new TypeError(`The provided selector is invalid.
|
|
310
328
|
Expects a CSS selector, a Node element, a NodeList or an array.
|
|
311
329
|
See: https://github.com/francoischalifour/medium-zoom`);
|
|
312
330
|
}
|
|
313
|
-
},
|
|
314
|
-
var
|
|
315
|
-
return
|
|
316
|
-
},
|
|
317
|
-
var
|
|
318
|
-
return x.removeAttribute("id"), x.style.position = "absolute", x.style.top = h +
|
|
319
|
-
},
|
|
320
|
-
var h =
|
|
331
|
+
}, Ge = function(t) {
|
|
332
|
+
var r = document.createElement("div");
|
|
333
|
+
return r.classList.add("medium-zoom-overlay"), r.style.background = t, r;
|
|
334
|
+
}, Qe = function(t) {
|
|
335
|
+
var r = t.getBoundingClientRect(), h = r.top, o = r.left, g = r.width, u = r.height, x = t.cloneNode(), _ = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, N = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
336
|
+
return x.removeAttribute("id"), x.style.position = "absolute", x.style.top = h + _ + "px", x.style.left = o + N + "px", x.style.width = g + "px", x.style.height = u + "px", x.style.transform = "", x;
|
|
337
|
+
}, F = function(t, r) {
|
|
338
|
+
var h = I({
|
|
321
339
|
bubbles: !1,
|
|
322
340
|
cancelable: !1,
|
|
323
341
|
detail: void 0
|
|
324
|
-
},
|
|
342
|
+
}, r);
|
|
325
343
|
if (typeof window.CustomEvent == "function")
|
|
326
|
-
return new CustomEvent(
|
|
327
|
-
var
|
|
328
|
-
return
|
|
329
|
-
},
|
|
330
|
-
var
|
|
344
|
+
return new CustomEvent(t, h);
|
|
345
|
+
var o = document.createEvent("CustomEvent");
|
|
346
|
+
return o.initCustomEvent(t, h.bubbles, h.cancelable, h.detail), o;
|
|
347
|
+
}, et = function e(t) {
|
|
348
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = window.Promise || function(a) {
|
|
331
349
|
function n() {
|
|
332
350
|
}
|
|
333
351
|
a(n, n);
|
|
334
|
-
},
|
|
352
|
+
}, o = function(a) {
|
|
335
353
|
var n = a.target;
|
|
336
354
|
if (n === G) {
|
|
337
355
|
y();
|
|
338
356
|
return;
|
|
339
357
|
}
|
|
340
|
-
k.indexOf(n) !== -1 &&
|
|
341
|
-
},
|
|
342
|
-
if (!(
|
|
358
|
+
k.indexOf(n) !== -1 && H({ target: n });
|
|
359
|
+
}, g = function() {
|
|
360
|
+
if (!(Z || !i.original)) {
|
|
343
361
|
var a = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
344
|
-
Math.abs(le - a) >
|
|
362
|
+
Math.abs(le - a) > m.scrollOffset && setTimeout(y, 150);
|
|
345
363
|
}
|
|
346
364
|
}, u = function(a) {
|
|
347
365
|
var n = a.key || a.keyCode;
|
|
348
366
|
(n === "Escape" || n === "Esc" || n === 27) && y();
|
|
349
367
|
}, x = function() {
|
|
350
368
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a;
|
|
351
|
-
if (a.background && (G.style.background = a.background), a.container && a.container instanceof Object && (n.container =
|
|
369
|
+
if (a.background && (G.style.background = a.background), a.container && a.container instanceof Object && (n.container = I({}, m.container, a.container)), a.template) {
|
|
352
370
|
var f = te(a.template) ? a.template : document.querySelector(a.template);
|
|
353
371
|
n.template = f;
|
|
354
372
|
}
|
|
355
|
-
return
|
|
356
|
-
z.dispatchEvent(
|
|
373
|
+
return m = I({}, m, n), k.forEach(function(z) {
|
|
374
|
+
z.dispatchEvent(F("medium-zoom:update", {
|
|
357
375
|
detail: { zoom: b }
|
|
358
376
|
}));
|
|
359
377
|
}), b;
|
|
360
|
-
},
|
|
378
|
+
}, _ = function() {
|
|
361
379
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
362
|
-
return
|
|
363
|
-
},
|
|
380
|
+
return e(I({}, m, a));
|
|
381
|
+
}, N = function() {
|
|
364
382
|
for (var a = arguments.length, n = Array(a), f = 0; f < a; f++)
|
|
365
383
|
n[f] = arguments[f];
|
|
366
|
-
var z = n.reduce(function(s,
|
|
367
|
-
return [].concat(s, ge(
|
|
384
|
+
var z = n.reduce(function(s, R) {
|
|
385
|
+
return [].concat(s, ge(R));
|
|
368
386
|
}, []);
|
|
369
387
|
return z.filter(function(s) {
|
|
370
388
|
return k.indexOf(s) === -1;
|
|
371
389
|
}).forEach(function(s) {
|
|
372
390
|
k.push(s), s.classList.add("medium-zoom-image");
|
|
373
391
|
}), J.forEach(function(s) {
|
|
374
|
-
var
|
|
375
|
-
z.forEach(function(
|
|
376
|
-
|
|
392
|
+
var R = s.type, T = s.listener, V = s.options;
|
|
393
|
+
z.forEach(function(M) {
|
|
394
|
+
M.addEventListener(R, T, V);
|
|
377
395
|
});
|
|
378
396
|
}), b;
|
|
379
397
|
}, $ = function() {
|
|
380
398
|
for (var a = arguments.length, n = Array(a), f = 0; f < a; f++)
|
|
381
399
|
n[f] = arguments[f];
|
|
382
400
|
i.zoomed && y();
|
|
383
|
-
var z = n.length > 0 ? n.reduce(function(s,
|
|
384
|
-
return [].concat(s, ge(
|
|
401
|
+
var z = n.length > 0 ? n.reduce(function(s, R) {
|
|
402
|
+
return [].concat(s, ge(R));
|
|
385
403
|
}, []) : k;
|
|
386
404
|
return z.forEach(function(s) {
|
|
387
|
-
s.classList.remove("medium-zoom-image"), s.dispatchEvent(
|
|
405
|
+
s.classList.remove("medium-zoom-image"), s.dispatchEvent(F("medium-zoom:detach", {
|
|
388
406
|
detail: { zoom: b }
|
|
389
407
|
}));
|
|
390
408
|
}), k = k.filter(function(s) {
|
|
@@ -402,7 +420,7 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
402
420
|
}), J = J.filter(function(z) {
|
|
403
421
|
return !(z.type === "medium-zoom:" + a && z.listener.toString() === n.toString());
|
|
404
422
|
}), b;
|
|
405
|
-
},
|
|
423
|
+
}, B = function() {
|
|
406
424
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target, f = function() {
|
|
407
425
|
var s = {
|
|
408
426
|
width: document.documentElement.clientWidth,
|
|
@@ -411,21 +429,21 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
411
429
|
top: 0,
|
|
412
430
|
right: 0,
|
|
413
431
|
bottom: 0
|
|
414
|
-
},
|
|
415
|
-
if (
|
|
416
|
-
if (
|
|
417
|
-
s =
|
|
432
|
+
}, R = void 0, T = void 0;
|
|
433
|
+
if (m.container)
|
|
434
|
+
if (m.container instanceof Object)
|
|
435
|
+
s = I({}, s, m.container), R = s.width - s.left - s.right - m.margin * 2, T = s.height - s.top - s.bottom - m.margin * 2;
|
|
418
436
|
else {
|
|
419
|
-
var
|
|
420
|
-
s =
|
|
421
|
-
width:
|
|
422
|
-
height:
|
|
423
|
-
left:
|
|
424
|
-
top:
|
|
437
|
+
var V = te(m.container) ? m.container : document.querySelector(m.container), M = V.getBoundingClientRect(), re = M.width, ze = M.height, ye = M.left, be = M.top;
|
|
438
|
+
s = I({}, s, {
|
|
439
|
+
width: re,
|
|
440
|
+
height: ze,
|
|
441
|
+
left: ye,
|
|
442
|
+
top: be
|
|
425
443
|
});
|
|
426
444
|
}
|
|
427
|
-
|
|
428
|
-
var U = i.zoomedHd || i.original,
|
|
445
|
+
R = R || s.width - m.margin * 2, T = T || s.height - m.margin * 2;
|
|
446
|
+
var U = i.zoomedHd || i.original, xe = me(U) ? R : U.naturalWidth || R, we = me(U) ? T : U.naturalHeight || T, Q = U.getBoundingClientRect(), Re = Q.top, Se = Q.left, oe = Q.width, ae = Q.height, Ce = Math.min(Math.max(oe, xe), R) / oe, Ee = Math.min(Math.max(ae, we), T) / ae, ne = Math.min(Ce, Ee), ke = (-Se + (R - oe) / 2 + m.margin + s.left) / ne, Le = (-Re + (T - ae) / 2 + m.margin + s.top) / ne, de = "scale(" + ne + ") translate3d(" + ke + "px, " + Le + "px, 0)";
|
|
429
447
|
i.zoomed.style.transform = de, i.zoomedHd && (i.zoomedHd.style.transform = de);
|
|
430
448
|
};
|
|
431
449
|
return new h(function(z) {
|
|
@@ -433,8 +451,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
433
451
|
z(b);
|
|
434
452
|
return;
|
|
435
453
|
}
|
|
436
|
-
var s = function
|
|
437
|
-
|
|
454
|
+
var s = function re() {
|
|
455
|
+
Z = !1, i.zoomed.removeEventListener("transitionend", re), i.original.dispatchEvent(F("medium-zoom:opened", {
|
|
438
456
|
detail: { zoom: b }
|
|
439
457
|
})), z(b);
|
|
440
458
|
};
|
|
@@ -445,102 +463,102 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
445
463
|
if (n)
|
|
446
464
|
i.original = n;
|
|
447
465
|
else if (k.length > 0) {
|
|
448
|
-
var
|
|
449
|
-
i.original =
|
|
466
|
+
var R = k;
|
|
467
|
+
i.original = R[0];
|
|
450
468
|
} else {
|
|
451
469
|
z(b);
|
|
452
470
|
return;
|
|
453
471
|
}
|
|
454
|
-
if (i.original.dispatchEvent(
|
|
472
|
+
if (i.original.dispatchEvent(F("medium-zoom:open", {
|
|
455
473
|
detail: { zoom: b }
|
|
456
|
-
})), le = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
|
|
457
|
-
var
|
|
458
|
-
i.template = document.createElement("div"), i.template.appendChild(
|
|
474
|
+
})), le = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, Z = !0, i.zoomed = Qe(i.original), document.body.appendChild(G), m.template) {
|
|
475
|
+
var T = te(m.template) ? m.template : document.querySelector(m.template);
|
|
476
|
+
i.template = document.createElement("div"), i.template.appendChild(T.content.cloneNode(!0)), document.body.appendChild(i.template);
|
|
459
477
|
}
|
|
460
478
|
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() {
|
|
461
479
|
document.body.classList.add("medium-zoom--opened");
|
|
462
480
|
}), 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")) {
|
|
463
481
|
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() {
|
|
464
|
-
clearInterval(
|
|
482
|
+
clearInterval(V), console.warn("Unable to reach the zoom image target " + i.zoomedHd.src), i.zoomedHd = null, f();
|
|
465
483
|
};
|
|
466
|
-
var
|
|
467
|
-
i.zoomedHd.complete && (clearInterval(
|
|
484
|
+
var V = setInterval(function() {
|
|
485
|
+
i.zoomedHd.complete && (clearInterval(V), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f());
|
|
468
486
|
}, 10);
|
|
469
487
|
} else if (i.original.hasAttribute("srcset")) {
|
|
470
488
|
i.zoomedHd = i.zoomed.cloneNode(), i.zoomedHd.removeAttribute("sizes"), i.zoomedHd.removeAttribute("loading");
|
|
471
|
-
var
|
|
472
|
-
i.zoomedHd.removeEventListener("load",
|
|
489
|
+
var M = i.zoomedHd.addEventListener("load", function() {
|
|
490
|
+
i.zoomedHd.removeEventListener("load", M), i.zoomedHd.classList.add("medium-zoom-image--opened"), i.zoomedHd.addEventListener("click", y), document.body.appendChild(i.zoomedHd), f();
|
|
473
491
|
});
|
|
474
492
|
} else
|
|
475
493
|
f();
|
|
476
494
|
});
|
|
477
495
|
}, y = function() {
|
|
478
496
|
return new h(function(a) {
|
|
479
|
-
if (
|
|
497
|
+
if (Z || !i.original) {
|
|
480
498
|
a(b);
|
|
481
499
|
return;
|
|
482
500
|
}
|
|
483
501
|
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),
|
|
502
|
+
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), Z = !1, i.zoomed.removeEventListener("transitionend", f), i.original.dispatchEvent(F("medium-zoom:closed", {
|
|
485
503
|
detail: { zoom: b }
|
|
486
504
|
})), i.original = null, i.zoomed = null, i.zoomedHd = null, i.template = null, a(b);
|
|
487
505
|
};
|
|
488
|
-
|
|
506
|
+
Z = !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(F("medium-zoom:close", {
|
|
489
507
|
detail: { zoom: b }
|
|
490
508
|
})), i.zoomed.addEventListener("transitionend", n);
|
|
491
509
|
});
|
|
492
|
-
},
|
|
510
|
+
}, H = function() {
|
|
493
511
|
var a = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = a.target;
|
|
494
|
-
return i.original ? y() :
|
|
495
|
-
},
|
|
496
|
-
return
|
|
512
|
+
return i.original ? y() : B({ target: n });
|
|
513
|
+
}, E = function() {
|
|
514
|
+
return m;
|
|
497
515
|
}, ie = function() {
|
|
498
516
|
return k;
|
|
499
|
-
},
|
|
517
|
+
}, ve = function() {
|
|
500
518
|
return i.original;
|
|
501
|
-
}, k = [], J = [],
|
|
519
|
+
}, k = [], J = [], Z = !1, le = 0, m = r, i = {
|
|
502
520
|
original: null,
|
|
503
521
|
zoomed: null,
|
|
504
522
|
zoomedHd: null,
|
|
505
523
|
template: null
|
|
506
524
|
// If the selector is omitted, it's replaced by the options
|
|
507
525
|
};
|
|
508
|
-
Object.prototype.toString.call(
|
|
526
|
+
Object.prototype.toString.call(t) === "[object Object]" ? m = t : (t || typeof t == "string") && N(t), m = I({
|
|
509
527
|
margin: 0,
|
|
510
528
|
background: "#fff",
|
|
511
529
|
scrollOffset: 40,
|
|
512
530
|
container: null,
|
|
513
531
|
template: null
|
|
514
|
-
},
|
|
515
|
-
var G =
|
|
516
|
-
document.addEventListener("click",
|
|
532
|
+
}, m);
|
|
533
|
+
var G = Ge(m.background);
|
|
534
|
+
document.addEventListener("click", o), document.addEventListener("keyup", u), document.addEventListener("scroll", g), window.addEventListener("resize", y);
|
|
517
535
|
var b = {
|
|
518
|
-
open:
|
|
536
|
+
open: B,
|
|
519
537
|
close: y,
|
|
520
|
-
toggle:
|
|
538
|
+
toggle: H,
|
|
521
539
|
update: x,
|
|
522
|
-
clone:
|
|
523
|
-
attach:
|
|
540
|
+
clone: _,
|
|
541
|
+
attach: N,
|
|
524
542
|
detach: $,
|
|
525
543
|
on: p,
|
|
526
544
|
off: v,
|
|
527
|
-
getOptions:
|
|
545
|
+
getOptions: E,
|
|
528
546
|
getImages: ie,
|
|
529
|
-
getZoomedImage:
|
|
547
|
+
getZoomedImage: ve
|
|
530
548
|
};
|
|
531
549
|
return b;
|
|
532
550
|
};
|
|
533
|
-
function
|
|
534
|
-
|
|
535
|
-
var
|
|
551
|
+
function tt(e, t) {
|
|
552
|
+
t === void 0 && (t = {});
|
|
553
|
+
var r = t.insertAt;
|
|
536
554
|
if (!(typeof document > "u")) {
|
|
537
|
-
var h = document.head || document.getElementsByTagName("head")[0],
|
|
538
|
-
|
|
555
|
+
var h = document.head || document.getElementsByTagName("head")[0], o = document.createElement("style");
|
|
556
|
+
o.type = "text/css", r === "top" && h.firstChild ? h.insertBefore(o, h.firstChild) : h.appendChild(o), o.styleSheet ? o.styleSheet.cssText = e : o.appendChild(document.createTextNode(e));
|
|
539
557
|
}
|
|
540
558
|
}
|
|
541
|
-
var
|
|
542
|
-
|
|
543
|
-
const
|
|
559
|
+
var it = ".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}";
|
|
560
|
+
tt(it);
|
|
561
|
+
const rt = 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)}`, ot = he`
|
|
544
562
|
:host {
|
|
545
563
|
--justify-content: flex-start;
|
|
546
564
|
--border-radius: 0px;
|
|
@@ -593,7 +611,7 @@ const Qe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
593
611
|
max-height: 100%;
|
|
594
612
|
}
|
|
595
613
|
|
|
596
|
-
${
|
|
614
|
+
${rt}
|
|
597
615
|
|
|
598
616
|
:host([block]) {
|
|
599
617
|
width: 100%;
|
|
@@ -786,14 +804,14 @@ const Qe = he`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
786
804
|
--font-size: var(--cx-font-size-4x-large);
|
|
787
805
|
}
|
|
788
806
|
`;
|
|
789
|
-
var
|
|
790
|
-
for (var
|
|
791
|
-
(u =
|
|
792
|
-
return h &&
|
|
807
|
+
var at = Object.defineProperty, nt = Object.getOwnPropertyDescriptor, c = (e, t, r, h) => {
|
|
808
|
+
for (var o = h > 1 ? void 0 : h ? nt(t, r) : t, g = e.length - 1, u; g >= 0; g--)
|
|
809
|
+
(u = e[g]) && (o = (h ? u(t, r, o) : u(o)) || o);
|
|
810
|
+
return h && o && at(t, r, o), o;
|
|
793
811
|
};
|
|
794
812
|
let l = class extends D {
|
|
795
813
|
constructor() {
|
|
796
|
-
super(...arguments), this.localize = new
|
|
814
|
+
super(...arguments), this.localize = new Ae(this), this._retryCount = 0, this._retryTimer = null, this.isLoaded = !1, this.isError = !1, this._retryIndex = 0, 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.retryOnError = !1, this.maxRetries = 3, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null;
|
|
797
815
|
}
|
|
798
816
|
get currentAltValue() {
|
|
799
817
|
return this.alt;
|
|
@@ -815,12 +833,12 @@ let l = class extends D {
|
|
|
815
833
|
};
|
|
816
834
|
}
|
|
817
835
|
get imageClass() {
|
|
818
|
-
let
|
|
819
|
-
const
|
|
820
|
-
return h &&
|
|
836
|
+
let e = "landscape", t = this.ratio;
|
|
837
|
+
const r = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), h = this.isResizing ? this.resizeSize.width : r, o = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
|
|
838
|
+
return h && o && (t = h / o), t > this.imageRatio && (e = "portrait"), {
|
|
821
839
|
image: !0,
|
|
822
840
|
[`image--${this.objectFit}`]: !0,
|
|
823
|
-
[`image--${
|
|
841
|
+
[`image--${e}`]: !0,
|
|
824
842
|
[`image--height-${this.heightMode}`]: !0,
|
|
825
843
|
"image--can-zoom": this.canZoom,
|
|
826
844
|
"image--has-action": this.hasZoomAction,
|
|
@@ -840,7 +858,7 @@ let l = class extends D {
|
|
|
840
858
|
this.hasUpdated && this.requestUpdate("canZoom");
|
|
841
859
|
}
|
|
842
860
|
disconnectedCallback() {
|
|
843
|
-
super.disconnectedCallback(), this.zoom && this.zoom.detach();
|
|
861
|
+
super.disconnectedCallback(), this.zoom && this.zoom.detach(), this.clearRetryTimer();
|
|
844
862
|
}
|
|
845
863
|
/**
|
|
846
864
|
* Handle mouse enter event.
|
|
@@ -860,8 +878,8 @@ let l = class extends D {
|
|
|
860
878
|
handleBlur() {
|
|
861
879
|
this.isZoomed && this.zoom?.close();
|
|
862
880
|
}
|
|
863
|
-
handleKeyDown(
|
|
864
|
-
|
|
881
|
+
handleKeyDown(e) {
|
|
882
|
+
e.target === this.highlighterElement && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.highlighterElement.click());
|
|
865
883
|
}
|
|
866
884
|
async handleCanZoomChange() {
|
|
867
885
|
await this.updateComplete, this.hasZoomAction ? this.initZoom() : (this.zoom?.detach(), this.zoom = null);
|
|
@@ -870,10 +888,19 @@ let l = class extends D {
|
|
|
870
888
|
await this.updateComplete, this.requestUpdate();
|
|
871
889
|
}
|
|
872
890
|
handleSrcChange() {
|
|
873
|
-
this.isLoaded = !1, this.isError = !1;
|
|
891
|
+
this.isLoaded = !1, this.isError = !1, this._retryCount = 0, this._retryIndex = 0, this.clearRetryTimer();
|
|
892
|
+
}
|
|
893
|
+
clearRetryTimer() {
|
|
894
|
+
this._retryTimer !== null && (clearTimeout(this._retryTimer), this._retryTimer = null);
|
|
895
|
+
}
|
|
896
|
+
scheduleRetry() {
|
|
897
|
+
const e = Math.min(1e3 * Math.pow(2, this._retryCount - 1), 1e4);
|
|
898
|
+
this._retryTimer = setTimeout(() => {
|
|
899
|
+
this._retryTimer = null, this._retryIndex += 1;
|
|
900
|
+
}, e);
|
|
874
901
|
}
|
|
875
902
|
async initZoom() {
|
|
876
|
-
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom =
|
|
903
|
+
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = et(this.zoomImageElement, {
|
|
877
904
|
background: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.8))",
|
|
878
905
|
margin: 0,
|
|
879
906
|
scrollOffset: 0
|
|
@@ -883,170 +910,186 @@ let l = class extends D {
|
|
|
883
910
|
this.emit("cx-image-zoom-close"), this.isZoomed = !1;
|
|
884
911
|
}));
|
|
885
912
|
}
|
|
886
|
-
handleLoad(
|
|
887
|
-
const
|
|
888
|
-
if (!
|
|
913
|
+
handleLoad(e) {
|
|
914
|
+
const t = e?.currentTarget ?? this.imageElement;
|
|
915
|
+
if (!t)
|
|
889
916
|
return;
|
|
890
|
-
const { naturalHeight:
|
|
891
|
-
this.imageRatio = h /
|
|
917
|
+
const { naturalHeight: r, naturalWidth: h } = t;
|
|
918
|
+
this.imageRatio = h / r, this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0, this.isError = !1);
|
|
892
919
|
}
|
|
893
920
|
handleError() {
|
|
921
|
+
if (this.retryOnError && this._retryCount < this.maxRetries) {
|
|
922
|
+
this._retryCount += 1, this.scheduleRetry();
|
|
923
|
+
return;
|
|
924
|
+
}
|
|
894
925
|
this.emit("cx-error"), this.isLoaded = !0, this.isError = !0;
|
|
895
926
|
}
|
|
896
927
|
handleSizeChange() {
|
|
897
|
-
const
|
|
898
|
-
this.width || this.isResizing ? this.style.setProperty("--width",
|
|
928
|
+
const e = this.isResizing ? `${this.resizeSize.width}px` : this.width, t = this.isResizing ? `${this.resizeSize.height}px` : this.height;
|
|
929
|
+
this.width || this.isResizing ? this.style.setProperty("--width", e) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", t) : this.style.removeProperty("--height");
|
|
899
930
|
}
|
|
900
|
-
handleResize(
|
|
901
|
-
const { entries:
|
|
902
|
-
for (const
|
|
903
|
-
|
|
931
|
+
handleResize(e) {
|
|
932
|
+
const { entries: t } = e.detail;
|
|
933
|
+
for (const r of t)
|
|
934
|
+
r.target === this.highlighterElement && this.width.endsWith("%") && !this.isResizing && Math.abs(r.contentRect.width - (this.lastPatchedWidth ?? 0)) > 1 && this.updateLastPatchedWidth(r.contentRect.width);
|
|
904
935
|
}
|
|
905
|
-
updateLastPatchedWidth(
|
|
906
|
-
this.lastPatchedWidth =
|
|
936
|
+
updateLastPatchedWidth(e) {
|
|
937
|
+
this.lastPatchedWidth = e, this.requestUpdate();
|
|
907
938
|
}
|
|
908
939
|
/**
|
|
909
940
|
* Support CMS5 click action for the image.
|
|
910
941
|
*/
|
|
911
|
-
handleClickAction(
|
|
912
|
-
!(
|
|
942
|
+
handleClickAction(e) {
|
|
943
|
+
!(e.target instanceof HTMLElement) || this.clickHandlerType === Y.Manual || this.canZoom && this.openZoom();
|
|
913
944
|
}
|
|
914
|
-
updated(
|
|
915
|
-
super.updated(
|
|
945
|
+
updated(e) {
|
|
946
|
+
super.updated(e), (e.has("width") || e.has("height") || e.has("resizeSize")) && this.handleSizeChange();
|
|
916
947
|
}
|
|
917
948
|
openZoom() {
|
|
918
949
|
this.zoom && this.zoom.open();
|
|
919
950
|
}
|
|
920
951
|
renderContent() {
|
|
921
|
-
const
|
|
922
|
-
return
|
|
952
|
+
const e = this.currentSrc, t = this.currentAltValue;
|
|
953
|
+
return A`<div part="content" slot="anchor" class=${j(this.highlighterClass)}>${Ke(
|
|
954
|
+
this._retryIndex,
|
|
955
|
+
A`<img part="image" class=${j(this.imageClass)} src=${e || this.placeholder} alt=${t} aria-label=${t} crossorigin="anonymous" @load=${this.handleLoad} @error=${this.handleError} loading=${this.htmlLoading}>`
|
|
956
|
+
)}</div>`;
|
|
923
957
|
}
|
|
924
958
|
render() {
|
|
925
|
-
const
|
|
926
|
-
return
|
|
959
|
+
const e = this.hasZoomAction, t = this.currentAltValue, r = !this.currentSrc && !this.placeholder;
|
|
960
|
+
return A`<div part="base" class=${j({
|
|
927
961
|
container: !0,
|
|
928
|
-
"container--empty":
|
|
962
|
+
"container--empty": r,
|
|
929
963
|
"container--loading": this.loading,
|
|
930
964
|
"container--resizing": this.resizable && this.isResizeActive
|
|
931
|
-
})} style=${
|
|
965
|
+
})} style=${_e({
|
|
932
966
|
"--easing": this.easeCSSVariable
|
|
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=${
|
|
934
|
-
|
|
935
|
-
() =>
|
|
936
|
-
() =>
|
|
967
|
+
})} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${Be(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${j(r ? {} : this.getHighlighterClass())} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${P(
|
|
968
|
+
r,
|
|
969
|
+
() => ue,
|
|
970
|
+
() => P(
|
|
937
971
|
this.effect === q.Jump || this.effect === q.Zoom,
|
|
938
|
-
() =>
|
|
972
|
+
() => A`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
|
|
939
973
|
() => this.renderContent()
|
|
940
974
|
)
|
|
941
|
-
)}<div class="zoom-image-container">${
|
|
942
|
-
|
|
943
|
-
() =>
|
|
975
|
+
)}<div class="zoom-image-container">${P(
|
|
976
|
+
e,
|
|
977
|
+
() => A`<img part="zoom-image" class=${j({
|
|
944
978
|
"zoom-image": !0,
|
|
945
979
|
"zoom-image--hidden": !this.isZoomed
|
|
946
980
|
})} src=${this.currentSrc || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin="anonymous">`
|
|
947
|
-
)}</div>${
|
|
981
|
+
)}</div>${P(
|
|
948
982
|
this.skeleton && !this.isLoaded && !this.isError || this.loading,
|
|
949
|
-
() =>
|
|
983
|
+
() => A`<slot name="skeleton" part="skeleton"><div class=${j({
|
|
950
984
|
skeleton: !0
|
|
951
985
|
})}><cx-skeleton effect="sheen"></cx-skeleton></div></slot>`
|
|
952
986
|
)}
|
|
953
|
-
${
|
|
987
|
+
${P(this.isError && this.fallback, () => A`<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>${P(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
|
|
954
988
|
}
|
|
955
989
|
};
|
|
956
|
-
l.styles = [
|
|
990
|
+
l.styles = [Te, Xe, ot];
|
|
957
991
|
l.dependencies = {
|
|
958
|
-
"cx-icon":
|
|
959
|
-
"cx-popup":
|
|
960
|
-
"cx-resize-observer":
|
|
961
|
-
"cx-skeleton":
|
|
962
|
-
"cx-space":
|
|
992
|
+
"cx-icon": Ne,
|
|
993
|
+
"cx-popup": Ze,
|
|
994
|
+
"cx-resize-observer": Ve,
|
|
995
|
+
"cx-skeleton": Pe,
|
|
996
|
+
"cx-space": Fe
|
|
963
997
|
};
|
|
964
|
-
|
|
998
|
+
c([
|
|
965
999
|
K(".image")
|
|
966
1000
|
], l.prototype, "imageElement", 2);
|
|
967
|
-
|
|
1001
|
+
c([
|
|
968
1002
|
K(".zoom-image")
|
|
969
1003
|
], l.prototype, "zoomImageElement", 2);
|
|
970
|
-
|
|
1004
|
+
c([
|
|
971
1005
|
K(".highlighter")
|
|
972
1006
|
], l.prototype, "highlighterElement", 2);
|
|
973
|
-
|
|
974
|
-
|
|
1007
|
+
c([
|
|
1008
|
+
L()
|
|
975
1009
|
], l.prototype, "isLoaded", 2);
|
|
976
|
-
|
|
977
|
-
|
|
1010
|
+
c([
|
|
1011
|
+
L()
|
|
978
1012
|
], l.prototype, "isError", 2);
|
|
979
|
-
|
|
1013
|
+
c([
|
|
1014
|
+
L()
|
|
1015
|
+
], l.prototype, "_retryIndex", 2);
|
|
1016
|
+
c([
|
|
980
1017
|
d({ reflect: !0, type: String })
|
|
981
1018
|
], l.prototype, "src", 2);
|
|
982
|
-
|
|
1019
|
+
c([
|
|
983
1020
|
d({ reflect: !0, type: String })
|
|
984
1021
|
], l.prototype, "placeholder", 2);
|
|
985
|
-
|
|
1022
|
+
c([
|
|
986
1023
|
d({ reflect: !0, type: String })
|
|
987
1024
|
], l.prototype, "alt", 2);
|
|
988
|
-
|
|
1025
|
+
c([
|
|
989
1026
|
d({ attribute: "object-fit", reflect: !0 })
|
|
990
1027
|
], l.prototype, "objectFit", 2);
|
|
991
|
-
|
|
1028
|
+
c([
|
|
992
1029
|
d({ reflect: !0, type: Boolean })
|
|
993
1030
|
], l.prototype, "skeleton", 2);
|
|
994
|
-
|
|
1031
|
+
c([
|
|
995
1032
|
d({ reflect: !0, type: Boolean })
|
|
996
1033
|
], l.prototype, "fallback", 2);
|
|
997
|
-
|
|
1034
|
+
c([
|
|
998
1035
|
d({ attribute: "can-zoom", reflect: !0, type: Boolean })
|
|
999
1036
|
], l.prototype, "canZoom", 2);
|
|
1000
|
-
|
|
1037
|
+
c([
|
|
1001
1038
|
d({ reflect: !0, type: Boolean })
|
|
1002
1039
|
], l.prototype, "loading", 2);
|
|
1003
|
-
|
|
1040
|
+
c([
|
|
1004
1041
|
d({ reflect: !0, type: Boolean })
|
|
1005
1042
|
], l.prototype, "block", 2);
|
|
1006
|
-
|
|
1043
|
+
c([
|
|
1007
1044
|
d({ attribute: "html-loading", reflect: !0, type: String })
|
|
1008
1045
|
], l.prototype, "htmlLoading", 2);
|
|
1009
|
-
|
|
1046
|
+
c([
|
|
1010
1047
|
d({ attribute: "click-handler-type", reflect: !0, type: String })
|
|
1011
1048
|
], l.prototype, "clickHandlerType", 2);
|
|
1012
|
-
|
|
1013
|
-
|
|
1049
|
+
c([
|
|
1050
|
+
d({ attribute: "retry-on-error", type: Boolean })
|
|
1051
|
+
], l.prototype, "retryOnError", 2);
|
|
1052
|
+
c([
|
|
1053
|
+
d({ attribute: "max-retries", type: Number })
|
|
1054
|
+
], l.prototype, "maxRetries", 2);
|
|
1055
|
+
c([
|
|
1056
|
+
L()
|
|
1014
1057
|
], l.prototype, "isZoomed", 2);
|
|
1015
|
-
|
|
1016
|
-
|
|
1058
|
+
c([
|
|
1059
|
+
L()
|
|
1017
1060
|
], l.prototype, "imageRatio", 2);
|
|
1018
|
-
|
|
1019
|
-
|
|
1061
|
+
c([
|
|
1062
|
+
L()
|
|
1020
1063
|
], l.prototype, "parsedAlt", 2);
|
|
1021
|
-
|
|
1022
|
-
|
|
1064
|
+
c([
|
|
1065
|
+
L()
|
|
1023
1066
|
], l.prototype, "parsedAltDarkMode", 2);
|
|
1024
|
-
|
|
1067
|
+
c([
|
|
1025
1068
|
X("isLoaded"),
|
|
1026
1069
|
X("canZoom", { waitUntilFirstUpdate: !0 })
|
|
1027
1070
|
], l.prototype, "handleCanZoomChange", 1);
|
|
1028
|
-
|
|
1071
|
+
c([
|
|
1029
1072
|
X("objectFit", { waitUntilFirstUpdate: !0 })
|
|
1030
1073
|
], l.prototype, "handleObjectFitChange", 1);
|
|
1031
|
-
|
|
1074
|
+
c([
|
|
1032
1075
|
X("src"),
|
|
1033
1076
|
X("srcDarkMode")
|
|
1034
1077
|
], l.prototype, "handleSrcChange", 1);
|
|
1035
|
-
|
|
1078
|
+
c([
|
|
1036
1079
|
Oe(100)
|
|
1037
1080
|
], l.prototype, "updateLastPatchedWidth", 1);
|
|
1038
|
-
l =
|
|
1039
|
-
|
|
1081
|
+
l = c([
|
|
1082
|
+
We("cx-image")
|
|
1040
1083
|
], l);
|
|
1041
1084
|
export {
|
|
1042
1085
|
l as C,
|
|
1043
|
-
|
|
1086
|
+
Ue as H,
|
|
1044
1087
|
D as R,
|
|
1045
|
-
|
|
1088
|
+
S as a,
|
|
1046
1089
|
q as b,
|
|
1047
1090
|
Y as c,
|
|
1048
|
-
|
|
1049
|
-
|
|
1091
|
+
fe as d,
|
|
1092
|
+
pe as e,
|
|
1050
1093
|
se as f,
|
|
1051
|
-
|
|
1094
|
+
Xe as r
|
|
1052
1095
|
};
|