@orangelogic/design-system 2.104.0 → 2.106.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/{AxisLabelRadial.Bs1P_q_F.js → AxisLabelRadial.C4AH2ZWx.js} +1 -1
- package/library/chunks/{BaseColumnSeries.C7jwOxIJ.js → BaseColumnSeries.BV8sY1Da.js} +1 -1
- package/library/chunks/{CandlestickSeries.CkXGtRWE.js → CandlestickSeries.C8BE8OT-.js} +2 -2
- package/library/chunks/{Circle.DBa5Ok8V.js → Circle.BaJWdg6Z.js} +1 -1
- package/library/chunks/{ColumnSeries.DGazbfza.js → ColumnSeries.BGUw3nLY.js} +2 -2
- package/library/chunks/{EditableAxisLabel.wN0t_G2B.js → EditableAxisLabel.CsgqEVmA.js} +2 -2
- package/library/chunks/{EditableLabel.BWeq6fgX.js → EditableLabel.gd9mjKfA.js} +1 -1
- package/library/chunks/{Gradient.CdcsPIru.js → Gradient.Sa3COx_2.js} +1 -1
- package/library/chunks/{LinearGradient.B1z9AGUt.js → LinearGradient.BM0pPmvI.js} +2 -2
- package/library/chunks/{Picture.YSPC0l0Q.js → Picture.DVyGQOmS.js} +1 -1
- package/library/chunks/{Polygon.BwMvXN2H.js → Polygon.Du2DRvxU.js} +1 -1
- package/library/chunks/{ProgressPie.DlCwXN17.js → ProgressPie.D3FRfVo5.js} +5 -5
- package/library/chunks/{RadialLabel.DyVOf2K8.js → RadialLabel.Dgipjivh.js} +1 -1
- package/library/chunks/{Scrollbar.BdZVb_Z-.js → Scrollbar.BDbLJ_xZ.js} +1 -1
- package/library/chunks/{Slice.DiEswWa6.js → Slice.BIXpM75a.js} +1 -1
- package/library/chunks/{Slider.C20No2z5.js → Slider.BZNFS2HS.js} +1 -1
- package/library/chunks/{SpriteResizer.DFnmcy0h.js → SpriteResizer.awVrrc-n.js} +1 -1
- package/library/chunks/{Triangle.BaOef7HV.js → Triangle.DW7bUiPK.js} +1 -1
- package/library/chunks/{ZoomTools.D5JPehoL.js → ZoomTools.CSBkRpSo.js} +1 -1
- package/library/chunks/_baseIteratee.DpzDid58.js +152 -0
- package/library/chunks/_baseUniq.HFKneygy.js +53 -0
- package/library/chunks/{am-chart.H2jnOzFc.js → am-chart.sBfZlJdc.js} +252 -252
- package/library/chunks/{animation.7ifl4x2S.js → animation.8MjXJybe.js} +1 -1
- package/library/chunks/asset-link-format.B0c92pSs.js +6 -0
- package/library/chunks/{asset.DmOI7fQJ.js → asset.Tjoo0ngC.js} +63 -57
- package/library/chunks/{button.CAa1kvwe.js → button.CZ-e_TGN.js} +2 -2
- package/library/chunks/{capitalize.CNStXZBq.js → capitalize.i-sHIcnm.js} +1 -1
- package/library/chunks/{color-swatch-group.pyN7NkEj.js → color-swatch-group.BTwy546N.js} +6 -6
- package/library/chunks/{color-swatch.DfJDZHlk.js → color-swatch.DHxppzoQ.js} +2 -2
- package/library/chunks/{colorPicker.06n6P3aK.js → colorPicker.r8zsh6Oj.js} +5 -5
- package/library/chunks/{confirm-popover.DffsrEEf.js → confirm-popover.DknitT29.js} +3 -3
- package/library/chunks/{content-builder.CcgZciZN.js → content-builder.B-bd8FaV.js} +2 -2
- package/library/chunks/{cropper.Bib8Abm3.js → cropper.CMfBGsNv.js} +1 -1
- package/library/chunks/{dialog.08JIK4Kd.js → dialog.BOWFhWcd.js} +3 -3
- package/library/chunks/{dot-pagination.-nDdQxJN.js → dot-pagination.CBRkADz0.js} +2 -2
- package/library/chunks/{asset.types.KXRZEtBr.js → endpoints.DBlquU2-.js} +417 -418
- package/library/chunks/{exporting.Chnl3UWi.js → exporting.B3VErmmW.js} +2 -2
- package/library/chunks/{file-on-demand.D5xRAZKN.js → file-on-demand.BVA_s4TR.js} +40 -39
- package/library/chunks/{flow.D2CqFQa7.js → flow.gWPD-GN_.js} +5 -5
- package/library/chunks/{folder-select.D4haLI38.js → folder-select.EVuyDx55.js} +98 -98
- package/library/chunks/{gantt.DSHD2gjO.js → gantt.D_6T9w75.js} +8 -8
- package/library/chunks/{header.BZxyeLPK.js → header.inh-TC_q.js} +2 -2
- package/library/chunks/{hierarchy.DwVsMmsP.js → hierarchy.BeJLXp9N.js} +5 -5
- package/library/chunks/{hub-connection.Ot2odiCz.js → hub-connection.Dri0ZNfh.js} +1 -1
- package/library/chunks/{i18n.BABe9hN4.js → i18n.DmmFsjwP.js} +7 -1
- package/library/chunks/{icon-button.C2s3pHG4.js → icon-button.CHh2iNJJ.js} +1 -1
- package/library/chunks/{iframe.DPccxsnE.js → iframe.duVt7WWc.js} +2 -2
- package/library/chunks/image.DdtDzup6.js +821 -0
- package/library/chunks/{index.C9khsiad.js → index.CnBD7_1u.js} +17 -17
- package/library/chunks/{json.zyETMOw-.js → json.BTCD_bjV.js} +3 -3
- package/library/chunks/{list-editor.CJQ6AEs1.js → list-editor.DKEh6VBL.js} +12 -12
- package/library/chunks/{map.CqM2O6LB.js → map.HWubaOh9.js} +2 -2
- package/library/chunks/{option.DGXQzdtb.js → option.B6cSZiX6.js} +2 -2
- package/library/chunks/{pagination.DhtwOCF6.js → pagination.RXrwBaR8.js} +5 -5
- package/library/chunks/{percent.DuQwbCCg.js → percent.0CeOGNP1.js} +3 -3
- package/library/chunks/{radar.FpYl3UH5.js → radar.CDUzjkcg.js} +4 -4
- package/library/chunks/resizable-component.styles.sAhMVN1H.js +283 -0
- package/library/chunks/{responsive.Oz9HWjyQ.js → responsive.Aigicabj.js} +1 -1
- package/library/chunks/{sliceGrouper.BsE7fGMt.js → sliceGrouper.nPe6eWIh.js} +1 -1
- package/library/chunks/{stock.BR-ag4Pt.js → stock.CmWtnkxv.js} +9 -9
- package/library/chunks/{tab-group.BhCf9Smq.js → tab-group.BA4PlJhR.js} +5 -5
- package/library/chunks/{table.CRDY_C9O.js → table.Dh2C2f1c.js} +6 -6
- package/library/chunks/{timeline.DkzkmgEM.js → timeline.DDCHQ84a.js} +5 -5
- package/library/chunks/{toString.CL_lYXbK.js → toString.CAY8lys2.js} +1 -1
- package/library/chunks/{transformation.Dir8s_wm.js → transformation.BlQCWMfI.js} +1 -1
- package/library/chunks/{tree.CJculPt6.js → tree.BO4oLcdB.js} +2 -2
- package/library/chunks/{venn.D739bOV3.js → venn.BZgn9wxo.js} +1 -1
- package/library/chunks/{watch.BCJD77bD.js → watch.CThbualB.js} +8 -8
- package/library/chunks/wavesurfer.esm.Cwi1pz64.js +1276 -0
- package/library/chunks/{wc.DzW311D-.js → wc.BUEDSaz-.js} +1 -1
- package/library/chunks/{xy.DCRDfTsa.js → xy.Wbux-yPv.js} +10 -10
- package/library/components/alert.js +3 -3
- package/library/components/am-chart.js +2 -2
- package/library/components/animated-image.js +1 -1
- package/library/components/animation.js +2 -2
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +16 -11
- package/library/components/atoms.js +166 -164
- package/library/components/audio.d.ts +3 -0
- package/library/components/audio.js +237 -0
- package/library/components/avatar.js +1 -1
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb-item.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 +7 -7
- package/library/components/color-swatch.js +3 -3
- package/library/components/confirm-popover.js +4 -4
- package/library/components/copy-button.js +2 -2
- package/library/components/corner-position-input-group.js +2 -2
- package/library/components/cropper.js +2 -2
- package/library/components/details.js +2 -2
- package/library/components/dialog.js +4 -4
- package/library/components/divider.js +1 -1
- package/library/components/dot-pagination.js +3 -3
- package/library/components/drawer.js +4 -4
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +8 -7
- package/library/components/e-chart.js +2 -2
- package/library/components/element-clamp.js +3 -3
- package/library/components/file-on-demand.js +10 -10
- package/library/components/folder-select.js +5 -5
- 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/grid-item.js +1 -1
- package/library/components/header.js +3 -3
- package/library/components/hub-connection.js +2 -2
- package/library/components/icon-button.js +2 -2
- package/library/components/icon.js +1 -1
- package/library/components/iframe.js +3 -3
- package/library/components/image-comparer.js +2 -2
- package/library/components/image.js +5 -4
- package/library/components/include.js +1 -1
- package/library/components/input.js +4 -4
- package/library/components/line-clamp.js +1 -1
- package/library/components/list-editor.js +7 -7
- package/library/components/markdown.js +1 -1
- package/library/components/masonry.js +3 -3
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +5 -5
- package/library/components/mutation-observer.js +1 -1
- package/library/components/option.js +3 -3
- package/library/components/organisms.js +2 -2
- package/library/components/pagination.js +6 -6
- 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/qr-code.js +1 -1
- package/library/components/radio-button.js +1 -1
- package/library/components/radio-card.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/radio.js +1 -1
- package/library/components/range.js +2 -2
- package/library/components/rating.js +2 -2
- package/library/components/relative-time.js +1 -1
- package/library/components/resize-observer.js +1 -1
- package/library/components/select.js +3 -3
- package/library/components/share-option-list.js +2 -2
- package/library/components/sidebar.js +2 -2
- package/library/components/size-input-group.js +3 -3
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +2 -2
- package/library/components/stepper.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +5 -5
- package/library/components/tab-panel.js +1 -1
- package/library/components/tab.js +3 -3
- package/library/components/table.js +6 -6
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +2 -2
- package/library/components/tree-item.js +3 -3
- package/library/components/tree.js +3 -3
- package/library/components/typeface.js +3 -3
- package/library/components/types.js +17027 -16754
- package/library/components/video.js +9 -8
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/audio/audio.d.ts +114 -0
- package/library/packages/atoms/src/components/audio/audio.styles.d.ts +2 -0
- package/library/packages/atoms/src/index.d.ts +1 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +5 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +4 -0
- package/library/packages/organisms/src/content-builder/configs/audio.d.ts +26 -0
- package/library/packages/organisms/src/content-builder/configs/index.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +28 -0
- package/library/packages/organisms/src/content-builder/content-builder-config.d.ts +3 -0
- package/library/packages/organisms/src/content-builder/plugins/audio.d.ts +5 -0
- package/library/packages/organisms/src/content-builder/plugins/index.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +1 -1
- package/library/packages/organisms/src/file-on-demand/components/file-on-demand-asset/file-on-demand-asset.d.ts +2 -0
- package/library/packages/types/src/asset-link-format.d.ts +1 -0
- package/library/packages/types/src/content-builder.d.ts +3 -2
- package/library/packages/types/src/gallery-item.d.ts +2 -0
- package/library/packages/utils/src/custom-element/i18n.d.ts +6 -0
- package/library/react-web-component.d.ts +206 -96
- package/library/utils.js +5 -5
- package/package.json +1 -1
- package/library/chunks/_baseUniq.BUihBa8c.js +0 -202
- package/library/chunks/asset-link-format.BSRDqHg7.js +0 -6
- package/library/chunks/image.DB68R-yp.js +0 -1095
- package/library/packages/services/src/api/asset/asset.types.d.ts +0 -233
|
@@ -0,0 +1,821 @@
|
|
|
1
|
+
import { r as ze, R as xe, H as Y } from "./resizable-component.styles.sAhMVN1H.js";
|
|
2
|
+
import { c as we } from "./component.styles.CRO4Odto.js";
|
|
3
|
+
import { a as Ee } from "./index.Cpamj0jB.js";
|
|
4
|
+
import { c as ke } from "./custom-element.L4WJXn1j.js";
|
|
5
|
+
import { d as Ce } from "./debounce.CIEhztrj.js";
|
|
6
|
+
import { L as Le } from "./i18n.DmmFsjwP.js";
|
|
7
|
+
import { w as Z } from "./watch.CThbualB.js";
|
|
8
|
+
import { E as te, i as ie, x as C } from "./lit-element.jLBm65_O.js";
|
|
9
|
+
import { n as y } from "./lib-cortex-element.CVMmyPMC.js";
|
|
10
|
+
import { r as $ } from "./state.CSDxrqLd.js";
|
|
11
|
+
import { e as K } from "./query.BBf1UFkC.js";
|
|
12
|
+
import { e as L } from "./class-map.BiVq-cVR.js";
|
|
13
|
+
import { o as Se } from "./if-defined.BRoBj_Rp.js";
|
|
14
|
+
import { e as $e, i as He } from "./directive.oAbCiebi.js";
|
|
15
|
+
import { m as Te } from "./directive-helpers.Dm4rc594.js";
|
|
16
|
+
import { o as Ae } from "./style-map.llVFPd__.js";
|
|
17
|
+
import { n as A } from "./when.Dr1es41R.js";
|
|
18
|
+
import Oe from "../components/icon.js";
|
|
19
|
+
import Re from "../components/popup.js";
|
|
20
|
+
import je from "../components/resize-observer.js";
|
|
21
|
+
import Ze from "../components/skeleton.js";
|
|
22
|
+
import _e from "../components/space.js";
|
|
23
|
+
var j = /* @__PURE__ */ ((i) => (i.Automatic = "automatic", i.Manual = "manual", i))(j || {});
|
|
24
|
+
/**
|
|
25
|
+
* @license
|
|
26
|
+
* Copyright 2021 Google LLC
|
|
27
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
28
|
+
*/
|
|
29
|
+
const Ie = $e(class extends He {
|
|
30
|
+
constructor() {
|
|
31
|
+
super(...arguments), this.key = te;
|
|
32
|
+
}
|
|
33
|
+
render(i, t) {
|
|
34
|
+
return this.key = i, t;
|
|
35
|
+
}
|
|
36
|
+
update(i, [t, r]) {
|
|
37
|
+
return t !== this.key && (Te(i), this.key = t), r;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */
|
|
41
|
+
var S = Object.assign || function(i) {
|
|
42
|
+
for (var t = 1; t < arguments.length; t++) {
|
|
43
|
+
var r = arguments[t];
|
|
44
|
+
for (var l in r)
|
|
45
|
+
Object.prototype.hasOwnProperty.call(r, l) && (i[l] = r[l]);
|
|
46
|
+
}
|
|
47
|
+
return i;
|
|
48
|
+
}, N = function(t) {
|
|
49
|
+
return t.tagName === "IMG";
|
|
50
|
+
}, Me = function(t) {
|
|
51
|
+
return NodeList.prototype.isPrototypeOf(t);
|
|
52
|
+
}, F = function(t) {
|
|
53
|
+
return t && t.nodeType === 1;
|
|
54
|
+
}, Q = function(t) {
|
|
55
|
+
var r = t.currentSrc || t.src;
|
|
56
|
+
return r.substr(-4).toLowerCase() === ".svg";
|
|
57
|
+
}, ee = function(t) {
|
|
58
|
+
try {
|
|
59
|
+
return Array.isArray(t) ? t.filter(N) : Me(t) ? [].slice.call(t).filter(N) : F(t) ? [t].filter(N) : typeof t == "string" ? [].slice.call(document.querySelectorAll(t)).filter(N) : [];
|
|
60
|
+
} catch {
|
|
61
|
+
throw new TypeError(`The provided selector is invalid.
|
|
62
|
+
Expects a CSS selector, a Node element, a NodeList or an array.
|
|
63
|
+
See: https://github.com/francoischalifour/medium-zoom`);
|
|
64
|
+
}
|
|
65
|
+
}, Pe = function(t) {
|
|
66
|
+
var r = document.createElement("div");
|
|
67
|
+
return r.classList.add("medium-zoom-overlay"), r.style.background = t, r;
|
|
68
|
+
}, Ne = function(t) {
|
|
69
|
+
var r = t.getBoundingClientRect(), l = r.top, c = r.left, E = r.width, k = r.height, z = t.cloneNode(), W = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, _ = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
70
|
+
return z.removeAttribute("id"), z.style.position = "absolute", z.style.top = l + W + "px", z.style.left = c + _ + "px", z.style.width = E + "px", z.style.height = k + "px", z.style.transform = "", z;
|
|
71
|
+
}, O = function(t, r) {
|
|
72
|
+
var l = S({
|
|
73
|
+
bubbles: !1,
|
|
74
|
+
cancelable: !1,
|
|
75
|
+
detail: void 0
|
|
76
|
+
}, r);
|
|
77
|
+
if (typeof window.CustomEvent == "function")
|
|
78
|
+
return new CustomEvent(t, l);
|
|
79
|
+
var c = document.createEvent("CustomEvent");
|
|
80
|
+
return c.initCustomEvent(t, l.bubbles, l.cancelable, l.detail), c;
|
|
81
|
+
}, Fe = function i(t) {
|
|
82
|
+
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, l = window.Promise || function(o) {
|
|
83
|
+
function a() {
|
|
84
|
+
}
|
|
85
|
+
o(a, a);
|
|
86
|
+
}, c = function(o) {
|
|
87
|
+
var a = o.target;
|
|
88
|
+
if (a === M) {
|
|
89
|
+
x();
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
v.indexOf(a) !== -1 && X({ target: a });
|
|
93
|
+
}, E = function() {
|
|
94
|
+
if (!(H || !e.original)) {
|
|
95
|
+
var o = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
96
|
+
Math.abs(G - o) > d.scrollOffset && setTimeout(x, 150);
|
|
97
|
+
}
|
|
98
|
+
}, k = function(o) {
|
|
99
|
+
var a = o.key || o.keyCode;
|
|
100
|
+
(a === "Escape" || a === "Esc" || a === 27) && x();
|
|
101
|
+
}, z = function() {
|
|
102
|
+
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, a = o;
|
|
103
|
+
if (o.background && (M.style.background = o.background), o.container && o.container instanceof Object && (a.container = S({}, d.container, o.container)), o.template) {
|
|
104
|
+
var m = F(o.template) ? o.template : document.querySelector(o.template);
|
|
105
|
+
a.template = m;
|
|
106
|
+
}
|
|
107
|
+
return d = S({}, d, a), v.forEach(function(g) {
|
|
108
|
+
g.dispatchEvent(O("medium-zoom:update", {
|
|
109
|
+
detail: { zoom: u }
|
|
110
|
+
}));
|
|
111
|
+
}), u;
|
|
112
|
+
}, W = function() {
|
|
113
|
+
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
114
|
+
return i(S({}, d, o));
|
|
115
|
+
}, _ = function() {
|
|
116
|
+
for (var o = arguments.length, a = Array(o), m = 0; m < o; m++)
|
|
117
|
+
a[m] = arguments[m];
|
|
118
|
+
var g = a.reduce(function(n, f) {
|
|
119
|
+
return [].concat(n, ee(f));
|
|
120
|
+
}, []);
|
|
121
|
+
return g.filter(function(n) {
|
|
122
|
+
return v.indexOf(n) === -1;
|
|
123
|
+
}).forEach(function(n) {
|
|
124
|
+
v.push(n), n.classList.add("medium-zoom-image");
|
|
125
|
+
}), I.forEach(function(n) {
|
|
126
|
+
var f = n.type, b = n.listener, T = n.options;
|
|
127
|
+
g.forEach(function(w) {
|
|
128
|
+
w.addEventListener(f, b, T);
|
|
129
|
+
});
|
|
130
|
+
}), u;
|
|
131
|
+
}, oe = function() {
|
|
132
|
+
for (var o = arguments.length, a = Array(o), m = 0; m < o; m++)
|
|
133
|
+
a[m] = arguments[m];
|
|
134
|
+
e.zoomed && x();
|
|
135
|
+
var g = a.length > 0 ? a.reduce(function(n, f) {
|
|
136
|
+
return [].concat(n, ee(f));
|
|
137
|
+
}, []) : v;
|
|
138
|
+
return g.forEach(function(n) {
|
|
139
|
+
n.classList.remove("medium-zoom-image"), n.dispatchEvent(O("medium-zoom:detach", {
|
|
140
|
+
detail: { zoom: u }
|
|
141
|
+
}));
|
|
142
|
+
}), v = v.filter(function(n) {
|
|
143
|
+
return g.indexOf(n) === -1;
|
|
144
|
+
}), u;
|
|
145
|
+
}, re = function(o, a) {
|
|
146
|
+
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
147
|
+
return v.forEach(function(g) {
|
|
148
|
+
g.addEventListener("medium-zoom:" + o, a, m);
|
|
149
|
+
}), I.push({ type: "medium-zoom:" + o, listener: a, options: m }), u;
|
|
150
|
+
}, ae = function(o, a) {
|
|
151
|
+
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
152
|
+
return v.forEach(function(g) {
|
|
153
|
+
g.removeEventListener("medium-zoom:" + o, a, m);
|
|
154
|
+
}), I = I.filter(function(g) {
|
|
155
|
+
return !(g.type === "medium-zoom:" + o && g.listener.toString() === a.toString());
|
|
156
|
+
}), u;
|
|
157
|
+
}, V = function() {
|
|
158
|
+
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, a = o.target, m = function() {
|
|
159
|
+
var n = {
|
|
160
|
+
width: document.documentElement.clientWidth,
|
|
161
|
+
height: document.documentElement.clientHeight,
|
|
162
|
+
left: 0,
|
|
163
|
+
top: 0,
|
|
164
|
+
right: 0,
|
|
165
|
+
bottom: 0
|
|
166
|
+
}, f = void 0, b = void 0;
|
|
167
|
+
if (d.container)
|
|
168
|
+
if (d.container instanceof Object)
|
|
169
|
+
n = S({}, n, d.container), f = n.width - n.left - n.right - d.margin * 2, b = n.height - n.top - n.bottom - d.margin * 2;
|
|
170
|
+
else {
|
|
171
|
+
var T = F(d.container) ? d.container : document.querySelector(d.container), w = T.getBoundingClientRect(), U = w.width, he = w.height, de = w.left, ce = w.top;
|
|
172
|
+
n = S({}, n, {
|
|
173
|
+
width: U,
|
|
174
|
+
height: he,
|
|
175
|
+
left: de,
|
|
176
|
+
top: ce
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
f = f || n.width - d.margin * 2, b = b || n.height - d.margin * 2;
|
|
180
|
+
var R = e.zoomedHd || e.original, me = Q(R) ? f : R.naturalWidth || f, ge = Q(R) ? b : R.naturalHeight || b, P = R.getBoundingClientRect(), ue = P.top, pe = P.left, B = P.width, q = P.height, fe = Math.min(Math.max(B, me), f) / B, ve = Math.min(Math.max(q, ge), b) / q, D = Math.min(fe, ve), ye = (-pe + (f - B) / 2 + d.margin + n.left) / D, be = (-ue + (b - q) / 2 + d.margin + n.top) / D, J = "scale(" + D + ") translate3d(" + ye + "px, " + be + "px, 0)";
|
|
181
|
+
e.zoomed.style.transform = J, e.zoomedHd && (e.zoomedHd.style.transform = J);
|
|
182
|
+
};
|
|
183
|
+
return new l(function(g) {
|
|
184
|
+
if (a && v.indexOf(a) === -1) {
|
|
185
|
+
g(u);
|
|
186
|
+
return;
|
|
187
|
+
}
|
|
188
|
+
var n = function U() {
|
|
189
|
+
H = !1, e.zoomed.removeEventListener("transitionend", U), e.original.dispatchEvent(O("medium-zoom:opened", {
|
|
190
|
+
detail: { zoom: u }
|
|
191
|
+
})), g(u);
|
|
192
|
+
};
|
|
193
|
+
if (e.zoomed) {
|
|
194
|
+
g(u);
|
|
195
|
+
return;
|
|
196
|
+
}
|
|
197
|
+
if (a)
|
|
198
|
+
e.original = a;
|
|
199
|
+
else if (v.length > 0) {
|
|
200
|
+
var f = v;
|
|
201
|
+
e.original = f[0];
|
|
202
|
+
} else {
|
|
203
|
+
g(u);
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (e.original.dispatchEvent(O("medium-zoom:open", {
|
|
207
|
+
detail: { zoom: u }
|
|
208
|
+
})), G = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, H = !0, e.zoomed = Ne(e.original), document.body.appendChild(M), d.template) {
|
|
209
|
+
var b = F(d.template) ? d.template : document.querySelector(d.template);
|
|
210
|
+
e.template = document.createElement("div"), e.template.appendChild(b.content.cloneNode(!0)), document.body.appendChild(e.template);
|
|
211
|
+
}
|
|
212
|
+
if (e.original.parentElement && e.original.parentElement.tagName === "PICTURE" && e.original.currentSrc && (e.zoomed.src = e.original.currentSrc), document.body.appendChild(e.zoomed), window.requestAnimationFrame(function() {
|
|
213
|
+
document.body.classList.add("medium-zoom--opened");
|
|
214
|
+
}), e.original.classList.add("medium-zoom-image--hidden"), e.zoomed.classList.add("medium-zoom-image--opened"), e.zoomed.addEventListener("click", x), e.zoomed.addEventListener("transitionend", n), e.original.getAttribute("data-zoom-src")) {
|
|
215
|
+
e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("srcset"), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading"), e.zoomedHd.src = e.zoomed.getAttribute("data-zoom-src"), e.zoomedHd.onerror = function() {
|
|
216
|
+
clearInterval(T), console.warn("Unable to reach the zoom image target " + e.zoomedHd.src), e.zoomedHd = null, m();
|
|
217
|
+
};
|
|
218
|
+
var T = setInterval(function() {
|
|
219
|
+
e.zoomedHd.complete && (clearInterval(T), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", x), document.body.appendChild(e.zoomedHd), m());
|
|
220
|
+
}, 10);
|
|
221
|
+
} else if (e.original.hasAttribute("srcset")) {
|
|
222
|
+
e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading");
|
|
223
|
+
var w = e.zoomedHd.addEventListener("load", function() {
|
|
224
|
+
e.zoomedHd.removeEventListener("load", w), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", x), document.body.appendChild(e.zoomedHd), m();
|
|
225
|
+
});
|
|
226
|
+
} else
|
|
227
|
+
m();
|
|
228
|
+
});
|
|
229
|
+
}, x = function() {
|
|
230
|
+
return new l(function(o) {
|
|
231
|
+
if (H || !e.original) {
|
|
232
|
+
o(u);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
var a = function m() {
|
|
236
|
+
e.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(e.zoomed), e.zoomedHd && document.body.removeChild(e.zoomedHd), document.body.removeChild(M), e.zoomed.classList.remove("medium-zoom-image--opened"), e.template && document.body.removeChild(e.template), H = !1, e.zoomed.removeEventListener("transitionend", m), e.original.dispatchEvent(O("medium-zoom:closed", {
|
|
237
|
+
detail: { zoom: u }
|
|
238
|
+
})), e.original = null, e.zoomed = null, e.zoomedHd = null, e.template = null, o(u);
|
|
239
|
+
};
|
|
240
|
+
H = !0, document.body.classList.remove("medium-zoom--opened"), e.zoomed.style.transform = "", e.zoomedHd && (e.zoomedHd.style.transform = ""), e.template && (e.template.style.transition = "opacity 150ms", e.template.style.opacity = 0), e.original.dispatchEvent(O("medium-zoom:close", {
|
|
241
|
+
detail: { zoom: u }
|
|
242
|
+
})), e.zoomed.addEventListener("transitionend", a);
|
|
243
|
+
});
|
|
244
|
+
}, X = function() {
|
|
245
|
+
var o = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, a = o.target;
|
|
246
|
+
return e.original ? x() : V({ target: a });
|
|
247
|
+
}, ne = function() {
|
|
248
|
+
return d;
|
|
249
|
+
}, se = function() {
|
|
250
|
+
return v;
|
|
251
|
+
}, le = function() {
|
|
252
|
+
return e.original;
|
|
253
|
+
}, v = [], I = [], H = !1, G = 0, d = r, e = {
|
|
254
|
+
original: null,
|
|
255
|
+
zoomed: null,
|
|
256
|
+
zoomedHd: null,
|
|
257
|
+
template: null
|
|
258
|
+
// If the selector is omitted, it's replaced by the options
|
|
259
|
+
};
|
|
260
|
+
Object.prototype.toString.call(t) === "[object Object]" ? d = t : (t || typeof t == "string") && _(t), d = S({
|
|
261
|
+
margin: 0,
|
|
262
|
+
background: "#fff",
|
|
263
|
+
scrollOffset: 40,
|
|
264
|
+
container: null,
|
|
265
|
+
template: null
|
|
266
|
+
}, d);
|
|
267
|
+
var M = Pe(d.background);
|
|
268
|
+
document.addEventListener("click", c), document.addEventListener("keyup", k), document.addEventListener("scroll", E), window.addEventListener("resize", x);
|
|
269
|
+
var u = {
|
|
270
|
+
open: V,
|
|
271
|
+
close: x,
|
|
272
|
+
toggle: X,
|
|
273
|
+
update: z,
|
|
274
|
+
clone: W,
|
|
275
|
+
attach: _,
|
|
276
|
+
detach: oe,
|
|
277
|
+
on: re,
|
|
278
|
+
off: ae,
|
|
279
|
+
getOptions: ne,
|
|
280
|
+
getImages: se,
|
|
281
|
+
getZoomedImage: le
|
|
282
|
+
};
|
|
283
|
+
return u;
|
|
284
|
+
};
|
|
285
|
+
function We(i, t) {
|
|
286
|
+
t === void 0 && (t = {});
|
|
287
|
+
var r = t.insertAt;
|
|
288
|
+
if (!(typeof document > "u")) {
|
|
289
|
+
var l = document.head || document.getElementsByTagName("head")[0], c = document.createElement("style");
|
|
290
|
+
c.type = "text/css", r === "top" && l.firstChild ? l.insertBefore(c, l.firstChild) : l.appendChild(c), c.styleSheet ? c.styleSheet.cssText = i : c.appendChild(document.createTextNode(i));
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
var Ue = ".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}";
|
|
294
|
+
We(Ue);
|
|
295
|
+
const Be = ie`: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)}`, qe = ie`
|
|
296
|
+
:host {
|
|
297
|
+
--justify-content: flex-start;
|
|
298
|
+
--border-radius: 0px;
|
|
299
|
+
--border: 0px;
|
|
300
|
+
--padding: 0px;
|
|
301
|
+
--details-color: light-dark(
|
|
302
|
+
var(--cx-color-neutral-1000),
|
|
303
|
+
var(--cx-color-neutral-0)
|
|
304
|
+
);
|
|
305
|
+
--details-font-size: 16px;
|
|
306
|
+
--details-letter-spacing: 0px;
|
|
307
|
+
--details-line-height: 1.5;
|
|
308
|
+
--details-text-align: left;
|
|
309
|
+
--easing: ease-in-out;
|
|
310
|
+
--header-text-align: left;
|
|
311
|
+
--header-font-size: 24px;
|
|
312
|
+
--header-line-height: 1.5;
|
|
313
|
+
--header-letter-spacing: 0px;
|
|
314
|
+
--header-color: light-dark(
|
|
315
|
+
var(--cx-color-neutral-1000),
|
|
316
|
+
var(--cx-color-neutral-0)
|
|
317
|
+
);
|
|
318
|
+
--content-background-color: light-dark(#00000070, #00000070);
|
|
319
|
+
--content-margin: 0px;
|
|
320
|
+
--content-min-height: 50px;
|
|
321
|
+
--content-padding: 5px 10px 5px 10px;
|
|
322
|
+
--content-width: 200px;
|
|
323
|
+
--content-border: 0;
|
|
324
|
+
--content-border-radius: 0px;
|
|
325
|
+
--transition-duration: 0.5s;
|
|
326
|
+
--image-min-width: 0px;
|
|
327
|
+
--image-max-width: 1000px;
|
|
328
|
+
--image-min-height: 0px;
|
|
329
|
+
--image-max-height: 500px;
|
|
330
|
+
--highlightable-item-highlight-border-color: var(--cx-color-primary);
|
|
331
|
+
--highlightable-item-highlight-color-overlay-color: transparent;
|
|
332
|
+
--highlightable-item-highlight-drop-shadow: 0 0 0 0
|
|
333
|
+
light-dark(transparent, transparent);
|
|
334
|
+
--highlightable-item-highlight-background: transparent;
|
|
335
|
+
--highlightable-item-highlight-siblings-fade-out-opacity: 0.5;
|
|
336
|
+
--highlightable-item-effect-zoom-scale: 1.1;
|
|
337
|
+
--highlightable-item-effect-zoom-overflow: hidden;
|
|
338
|
+
--highlightable-item-effect-text-reveal-distance: 30px;
|
|
339
|
+
--highlightable-item-effect-jump-distance: 10px;
|
|
340
|
+
--transition-transform-duration: 0.5s;
|
|
341
|
+
|
|
342
|
+
display: flex;
|
|
343
|
+
width: var(--width, 100%);
|
|
344
|
+
height: var(--height, auto);
|
|
345
|
+
max-height: 100%;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
${Be}
|
|
349
|
+
|
|
350
|
+
:host([block]) {
|
|
351
|
+
width: 100%;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
:host([height-mode='auto']) {
|
|
355
|
+
height: auto;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
.container {
|
|
359
|
+
container-name: asset-container;
|
|
360
|
+
container-type: inline-size;
|
|
361
|
+
padding: var(--padding, 0px);
|
|
362
|
+
position: relative;
|
|
363
|
+
width: 100%;
|
|
364
|
+
max-height: 100%;
|
|
365
|
+
border-color: var(--border-color, transparent);
|
|
366
|
+
border-style: var(--border-style, solid);
|
|
367
|
+
border-width: var(--border-width, 0px);
|
|
368
|
+
overflow: hidden;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.container:has(.highlighter:focus-visible) {
|
|
372
|
+
outline: var(--cx-focus-ring);
|
|
373
|
+
outline-offset: var(--cx-focus-ring-offset);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
.container--empty {
|
|
377
|
+
height: var(--height, 300px);
|
|
378
|
+
min-height: var(--min-height, 100%);
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.container--empty::before {
|
|
382
|
+
align-items: center;
|
|
383
|
+
background-color: #000000;
|
|
384
|
+
color: #ffffff;
|
|
385
|
+
content: attr(data-empty-label);
|
|
386
|
+
display: flex;
|
|
387
|
+
font-family: var(--cx-font-sans);
|
|
388
|
+
font-size: clamp(
|
|
389
|
+
var(--cx-font-size-x-small),
|
|
390
|
+
4cqw,
|
|
391
|
+
var(--cx-font-size-large)
|
|
392
|
+
);
|
|
393
|
+
font-weight: var(--cx-font-weight-semibold);
|
|
394
|
+
height: 100%;
|
|
395
|
+
justify-content: center;
|
|
396
|
+
line-height: 1;
|
|
397
|
+
text-align: center;
|
|
398
|
+
text-shadow: 0.05em 0.05em 0.1em #000;
|
|
399
|
+
vertical-align: middle;
|
|
400
|
+
width: 100%;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
.container--empty.container--loading::before {
|
|
404
|
+
content: '';
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.container--resizing {
|
|
408
|
+
outline: 2px dashed var(--cx-color-primary);
|
|
409
|
+
user-select: none;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
.highlighter {
|
|
413
|
+
position: relative;
|
|
414
|
+
width: 100%;
|
|
415
|
+
height: 100%;
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
.highlighter:focus-visible {
|
|
419
|
+
outline: none;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.highlightable-item {
|
|
423
|
+
background-color: var(--highlightable-item-background-color);
|
|
424
|
+
display: flex;
|
|
425
|
+
align-items: center;
|
|
426
|
+
justify-content: var(--justify-content);
|
|
427
|
+
width: 100%;
|
|
428
|
+
height: 100%;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
.highlightable-item--has-action {
|
|
432
|
+
cursor: pointer;
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
.image {
|
|
436
|
+
border-radius: var(--border-radius);
|
|
437
|
+
border: var(--border) solid;
|
|
438
|
+
display: block;
|
|
439
|
+
transition: inherit;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.image--fill {
|
|
443
|
+
object-fit: fill;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.image--contain {
|
|
447
|
+
object-fit: contain;
|
|
448
|
+
max-width: 100%;
|
|
449
|
+
max-height: 100%;
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
.image--cover {
|
|
453
|
+
object-fit: cover;
|
|
454
|
+
width: 100%;
|
|
455
|
+
height: 100%;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.image--none {
|
|
459
|
+
object-fit: none;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
.image--scale-down {
|
|
463
|
+
object-fit: scale-down;
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
.image--hidden {
|
|
467
|
+
display: none;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
.image--can-zoom {
|
|
471
|
+
cursor: zoom-in;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
.image--has-action {
|
|
475
|
+
cursor: pointer;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
.image--contain.image--landscape {
|
|
479
|
+
width: 100%;
|
|
480
|
+
height: auto;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
.image--contain.image--portrait {
|
|
484
|
+
width: auto;
|
|
485
|
+
height: 100%;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.popup-container::part(popup) {
|
|
489
|
+
z-index: -1;
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
.zoom-image {
|
|
493
|
+
width: 100%;
|
|
494
|
+
height: auto;
|
|
495
|
+
object-fit: cover;
|
|
496
|
+
opacity: 1;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
.zoom-image-container {
|
|
500
|
+
position: absolute;
|
|
501
|
+
top: 0;
|
|
502
|
+
left: 0;
|
|
503
|
+
width: 100%;
|
|
504
|
+
height: 100%;
|
|
505
|
+
display: flex;
|
|
506
|
+
justify-content: center;
|
|
507
|
+
align-items: center;
|
|
508
|
+
z-index: -1;
|
|
509
|
+
}
|
|
510
|
+
|
|
511
|
+
.zoom-image--hidden {
|
|
512
|
+
opacity: 0;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
.medium-zoom-image--hidden {
|
|
516
|
+
opacity: 0;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.skeleton {
|
|
520
|
+
position: absolute;
|
|
521
|
+
top: 0;
|
|
522
|
+
left: 0;
|
|
523
|
+
width: 100%;
|
|
524
|
+
height: 100%;
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
.skeleton cx-skeleton {
|
|
528
|
+
width: 100%;
|
|
529
|
+
height: 100%;
|
|
530
|
+
--border-radius: 0;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.fallback {
|
|
534
|
+
position: relative;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.fallback cx-icon {
|
|
538
|
+
--font-size: var(--cx-font-size-4x-large);
|
|
539
|
+
}
|
|
540
|
+
`;
|
|
541
|
+
var De = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, h = (i, t, r, l) => {
|
|
542
|
+
for (var c = l > 1 ? void 0 : l ? Ye(t, r) : t, E = i.length - 1, k; E >= 0; E--)
|
|
543
|
+
(k = i[E]) && (c = (l ? k(t, r, c) : k(c)) || c);
|
|
544
|
+
return l && c && De(t, r, c), c;
|
|
545
|
+
};
|
|
546
|
+
let s = class extends xe {
|
|
547
|
+
constructor() {
|
|
548
|
+
super(...arguments), this.localize = new Le(this), this._retryCount = 0, this._retryTimer = null, this.isLoaded = !1, this.isError = !1, this._retryIndex = 0, this.src = "", this.placeholder = "", this.alt = "", this.objectFit = Ee.Fill, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.clickHandlerType = j.Automatic, this.retryOnError = !1, this.maxRetries = 3, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null;
|
|
549
|
+
}
|
|
550
|
+
get currentAltValue() {
|
|
551
|
+
return this.alt;
|
|
552
|
+
}
|
|
553
|
+
get currentSrc() {
|
|
554
|
+
return this.src;
|
|
555
|
+
}
|
|
556
|
+
get highlighterTabindex() {
|
|
557
|
+
return this.hasZoomAction && this.clickHandlerType === j.Automatic ? "0" : void 0;
|
|
558
|
+
}
|
|
559
|
+
get highlighterRole() {
|
|
560
|
+
return this.hasZoomAction && this.clickHandlerType === j.Automatic ? "button" : "img";
|
|
561
|
+
}
|
|
562
|
+
get highlighterClass() {
|
|
563
|
+
return {
|
|
564
|
+
"highlightable-item": !0,
|
|
565
|
+
"highlightable-item--effect-text-reveal": this.effect === Y.TextReveal,
|
|
566
|
+
[`highlightable-item--text-reveal-style-${this.textRevealStyle}`]: !0
|
|
567
|
+
};
|
|
568
|
+
}
|
|
569
|
+
get imageClass() {
|
|
570
|
+
let i = "landscape", t = this.ratio;
|
|
571
|
+
const r = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), l = this.isResizing ? this.resizeSize.width : r, c = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
|
|
572
|
+
return l && c && (t = l / c), t > this.imageRatio && (i = "portrait"), {
|
|
573
|
+
image: !0,
|
|
574
|
+
[`image--${this.objectFit}`]: !0,
|
|
575
|
+
[`image--${i}`]: !0,
|
|
576
|
+
[`image--height-${this.heightMode}`]: !0,
|
|
577
|
+
"image--can-zoom": this.canZoom,
|
|
578
|
+
"image--has-action": this.hasZoomAction,
|
|
579
|
+
"image--hidden": !this.currentSrc && !this.placeholder || this.isError && this.fallback
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Whether the image have zoom action.
|
|
584
|
+
*/
|
|
585
|
+
get hasZoomAction() {
|
|
586
|
+
return this.canZoom;
|
|
587
|
+
}
|
|
588
|
+
runFirstUpdated() {
|
|
589
|
+
this.theme = this.getTheme();
|
|
590
|
+
}
|
|
591
|
+
runConnectedCallback() {
|
|
592
|
+
this.hasUpdated && this.requestUpdate("canZoom");
|
|
593
|
+
}
|
|
594
|
+
disconnectedCallback() {
|
|
595
|
+
super.disconnectedCallback(), this.zoom && this.zoom.detach(), this.clearRetryTimer();
|
|
596
|
+
}
|
|
597
|
+
/**
|
|
598
|
+
* Handle mouse enter event.
|
|
599
|
+
*/
|
|
600
|
+
handleMouseEnter() {
|
|
601
|
+
this.isHovering = !0;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* Handle mouse leave event.
|
|
605
|
+
*/
|
|
606
|
+
handleMouseLeave() {
|
|
607
|
+
this.isHovering = !1;
|
|
608
|
+
}
|
|
609
|
+
/**
|
|
610
|
+
* If image is currently zoomed, close the zoom.
|
|
611
|
+
*/
|
|
612
|
+
handleBlur() {
|
|
613
|
+
this.isZoomed && this.zoom?.close();
|
|
614
|
+
}
|
|
615
|
+
handleKeyDown(i) {
|
|
616
|
+
i.target === this.highlighterElement && (i.key === "Enter" || i.key === " ") && (i.preventDefault(), this.highlighterElement.click());
|
|
617
|
+
}
|
|
618
|
+
async handleCanZoomChange() {
|
|
619
|
+
await this.updateComplete, this.hasZoomAction ? this.initZoom() : (this.zoom?.detach(), this.zoom = null);
|
|
620
|
+
}
|
|
621
|
+
async handleObjectFitChange() {
|
|
622
|
+
await this.updateComplete, this.requestUpdate();
|
|
623
|
+
}
|
|
624
|
+
handleSrcChange() {
|
|
625
|
+
this.isLoaded = !1, this.isError = !1, this._retryCount = 0, this._retryIndex = 0, this.clearRetryTimer();
|
|
626
|
+
}
|
|
627
|
+
clearRetryTimer() {
|
|
628
|
+
this._retryTimer !== null && (clearTimeout(this._retryTimer), this._retryTimer = null);
|
|
629
|
+
}
|
|
630
|
+
scheduleRetry() {
|
|
631
|
+
const i = Math.min(1e3 * Math.pow(2, this._retryCount - 1), 1e4);
|
|
632
|
+
this._retryTimer = setTimeout(() => {
|
|
633
|
+
this._retryTimer = null, this._retryIndex += 1;
|
|
634
|
+
}, i);
|
|
635
|
+
}
|
|
636
|
+
async initZoom() {
|
|
637
|
+
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = Fe(this.zoomImageElement, {
|
|
638
|
+
background: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.8))",
|
|
639
|
+
margin: 0,
|
|
640
|
+
scrollOffset: 0
|
|
641
|
+
}), this.zoom.on("open", () => {
|
|
642
|
+
this.emit("cx-image-zoom-open"), this.isZoomed = !0;
|
|
643
|
+
}), this.zoom.on("close", () => {
|
|
644
|
+
this.emit("cx-image-zoom-close"), this.isZoomed = !1;
|
|
645
|
+
}));
|
|
646
|
+
}
|
|
647
|
+
handleLoad(i) {
|
|
648
|
+
const t = i?.currentTarget ?? this.imageElement;
|
|
649
|
+
if (!t)
|
|
650
|
+
return;
|
|
651
|
+
const { naturalHeight: r, naturalWidth: l } = t;
|
|
652
|
+
this.imageRatio = l / r, this.isLoaded || (this.emit("cx-load"), this.isLoaded = !0, this.isError = !1);
|
|
653
|
+
}
|
|
654
|
+
handleError() {
|
|
655
|
+
if (this.retryOnError && this._retryCount < this.maxRetries) {
|
|
656
|
+
this._retryCount += 1, this.scheduleRetry();
|
|
657
|
+
return;
|
|
658
|
+
}
|
|
659
|
+
this.emit("cx-error"), this.isLoaded = !0, this.isError = !0;
|
|
660
|
+
}
|
|
661
|
+
handleSizeChange() {
|
|
662
|
+
const i = this.isResizing ? `${this.resizeSize.width}px` : this.width, t = this.isResizing ? `${this.resizeSize.height}px` : this.height;
|
|
663
|
+
this.width || this.isResizing ? this.style.setProperty("--width", i) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", t) : this.style.removeProperty("--height");
|
|
664
|
+
}
|
|
665
|
+
handleResize(i) {
|
|
666
|
+
const { entries: t } = i.detail;
|
|
667
|
+
for (const r of t)
|
|
668
|
+
r.target === this.highlighterElement && this.width.endsWith("%") && !this.isResizing && Math.abs(r.contentRect.width - (this.lastPatchedWidth ?? 0)) > 1 && this.updateLastPatchedWidth(r.contentRect.width);
|
|
669
|
+
}
|
|
670
|
+
updateLastPatchedWidth(i) {
|
|
671
|
+
this.lastPatchedWidth = i, this.requestUpdate();
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Support CMS5 click action for the image.
|
|
675
|
+
*/
|
|
676
|
+
handleClickAction(i) {
|
|
677
|
+
!(i.target instanceof HTMLElement) || this.clickHandlerType === j.Manual || this.canZoom && this.openZoom();
|
|
678
|
+
}
|
|
679
|
+
updated(i) {
|
|
680
|
+
super.updated(i), (i.has("width") || i.has("height") || i.has("resizeSize")) && this.handleSizeChange();
|
|
681
|
+
}
|
|
682
|
+
openZoom() {
|
|
683
|
+
this.zoom && this.zoom.open();
|
|
684
|
+
}
|
|
685
|
+
renderContent() {
|
|
686
|
+
const i = this.currentSrc, t = this.currentAltValue;
|
|
687
|
+
return C`<div part="content" slot="anchor" class=${L(this.highlighterClass)}>${Ie(
|
|
688
|
+
this._retryIndex,
|
|
689
|
+
C`<img part="image" class=${L(this.imageClass)} src=${i || this.placeholder} alt=${t} aria-label=${t} crossorigin="anonymous" @load=${this.handleLoad} @error=${this.handleError} loading=${this.htmlLoading}>`
|
|
690
|
+
)}</div>`;
|
|
691
|
+
}
|
|
692
|
+
render() {
|
|
693
|
+
const i = this.hasZoomAction, t = this.currentAltValue, r = !this.currentSrc && !this.placeholder;
|
|
694
|
+
return C`<div part="base" class=${L({
|
|
695
|
+
container: !0,
|
|
696
|
+
"container--empty": r,
|
|
697
|
+
"container--loading": this.loading,
|
|
698
|
+
"container--resizing": this.resizable && this.isResizeActive
|
|
699
|
+
})} style=${Ae({
|
|
700
|
+
"--easing": this.easeCSSVariable
|
|
701
|
+
})} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${Se(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${L(r ? {} : this.getHighlighterClass())} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${A(
|
|
702
|
+
r,
|
|
703
|
+
() => te,
|
|
704
|
+
() => A(
|
|
705
|
+
this.effect === Y.Jump || this.effect === Y.Zoom,
|
|
706
|
+
() => C`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
|
|
707
|
+
() => this.renderContent()
|
|
708
|
+
)
|
|
709
|
+
)}<div class="zoom-image-container">${A(
|
|
710
|
+
i,
|
|
711
|
+
() => C`<img part="zoom-image" class=${L({
|
|
712
|
+
"zoom-image": !0,
|
|
713
|
+
"zoom-image--hidden": !this.isZoomed
|
|
714
|
+
})} src=${this.currentSrc || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin="anonymous">`
|
|
715
|
+
)}</div>${A(
|
|
716
|
+
this.skeleton && !this.isLoaded && !this.isError || this.loading,
|
|
717
|
+
() => C`<slot name="skeleton" part="skeleton"><div class=${L({
|
|
718
|
+
skeleton: !0
|
|
719
|
+
})}><cx-skeleton effect="sheen"></cx-skeleton></div></slot>`
|
|
720
|
+
)}
|
|
721
|
+
${A(this.isError && this.fallback, () => C`<slot name="fallback" part="fallback"><cx-space class=${L({ 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>${A(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
|
|
722
|
+
}
|
|
723
|
+
};
|
|
724
|
+
s.styles = [we, ze, qe];
|
|
725
|
+
s.dependencies = {
|
|
726
|
+
"cx-icon": Oe,
|
|
727
|
+
"cx-popup": Re,
|
|
728
|
+
"cx-resize-observer": je,
|
|
729
|
+
"cx-skeleton": Ze,
|
|
730
|
+
"cx-space": _e
|
|
731
|
+
};
|
|
732
|
+
h([
|
|
733
|
+
K(".image")
|
|
734
|
+
], s.prototype, "imageElement", 2);
|
|
735
|
+
h([
|
|
736
|
+
K(".zoom-image")
|
|
737
|
+
], s.prototype, "zoomImageElement", 2);
|
|
738
|
+
h([
|
|
739
|
+
K(".highlighter")
|
|
740
|
+
], s.prototype, "highlighterElement", 2);
|
|
741
|
+
h([
|
|
742
|
+
$()
|
|
743
|
+
], s.prototype, "isLoaded", 2);
|
|
744
|
+
h([
|
|
745
|
+
$()
|
|
746
|
+
], s.prototype, "isError", 2);
|
|
747
|
+
h([
|
|
748
|
+
$()
|
|
749
|
+
], s.prototype, "_retryIndex", 2);
|
|
750
|
+
h([
|
|
751
|
+
y({ reflect: !0, type: String })
|
|
752
|
+
], s.prototype, "src", 2);
|
|
753
|
+
h([
|
|
754
|
+
y({ reflect: !0, type: String })
|
|
755
|
+
], s.prototype, "placeholder", 2);
|
|
756
|
+
h([
|
|
757
|
+
y({ reflect: !0, type: String })
|
|
758
|
+
], s.prototype, "alt", 2);
|
|
759
|
+
h([
|
|
760
|
+
y({ attribute: "object-fit", reflect: !0 })
|
|
761
|
+
], s.prototype, "objectFit", 2);
|
|
762
|
+
h([
|
|
763
|
+
y({ reflect: !0, type: Boolean })
|
|
764
|
+
], s.prototype, "skeleton", 2);
|
|
765
|
+
h([
|
|
766
|
+
y({ reflect: !0, type: Boolean })
|
|
767
|
+
], s.prototype, "fallback", 2);
|
|
768
|
+
h([
|
|
769
|
+
y({ attribute: "can-zoom", reflect: !0, type: Boolean })
|
|
770
|
+
], s.prototype, "canZoom", 2);
|
|
771
|
+
h([
|
|
772
|
+
y({ reflect: !0, type: Boolean })
|
|
773
|
+
], s.prototype, "loading", 2);
|
|
774
|
+
h([
|
|
775
|
+
y({ reflect: !0, type: Boolean })
|
|
776
|
+
], s.prototype, "block", 2);
|
|
777
|
+
h([
|
|
778
|
+
y({ attribute: "html-loading", reflect: !0, type: String })
|
|
779
|
+
], s.prototype, "htmlLoading", 2);
|
|
780
|
+
h([
|
|
781
|
+
y({ attribute: "click-handler-type", reflect: !0, type: String })
|
|
782
|
+
], s.prototype, "clickHandlerType", 2);
|
|
783
|
+
h([
|
|
784
|
+
y({ attribute: "retry-on-error", type: Boolean })
|
|
785
|
+
], s.prototype, "retryOnError", 2);
|
|
786
|
+
h([
|
|
787
|
+
y({ attribute: "max-retries", type: Number })
|
|
788
|
+
], s.prototype, "maxRetries", 2);
|
|
789
|
+
h([
|
|
790
|
+
$()
|
|
791
|
+
], s.prototype, "isZoomed", 2);
|
|
792
|
+
h([
|
|
793
|
+
$()
|
|
794
|
+
], s.prototype, "imageRatio", 2);
|
|
795
|
+
h([
|
|
796
|
+
$()
|
|
797
|
+
], s.prototype, "parsedAlt", 2);
|
|
798
|
+
h([
|
|
799
|
+
$()
|
|
800
|
+
], s.prototype, "parsedAltDarkMode", 2);
|
|
801
|
+
h([
|
|
802
|
+
Z("isLoaded"),
|
|
803
|
+
Z("canZoom", { waitUntilFirstUpdate: !0 })
|
|
804
|
+
], s.prototype, "handleCanZoomChange", 1);
|
|
805
|
+
h([
|
|
806
|
+
Z("objectFit", { waitUntilFirstUpdate: !0 })
|
|
807
|
+
], s.prototype, "handleObjectFitChange", 1);
|
|
808
|
+
h([
|
|
809
|
+
Z("src"),
|
|
810
|
+
Z("srcDarkMode")
|
|
811
|
+
], s.prototype, "handleSrcChange", 1);
|
|
812
|
+
h([
|
|
813
|
+
Ce(100)
|
|
814
|
+
], s.prototype, "updateLastPatchedWidth", 1);
|
|
815
|
+
s = h([
|
|
816
|
+
ke("cx-image")
|
|
817
|
+
], s);
|
|
818
|
+
export {
|
|
819
|
+
s as C,
|
|
820
|
+
j as a
|
|
821
|
+
};
|