@orangelogic/design-system 4.2.0 → 4.3.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/{_baseXor.DixEm6JQ.js → _baseXor.BCxbgizO.js} +2 -2
- package/library/chunks/{asset-link-format.CVwjA_yf.js → asset-link-format.C5Ue4EGP.js} +37 -36
- package/library/chunks/{button.D1YIxtv-.js → button.DbAUlIXG.js} +3 -3
- package/library/chunks/button.styles.D3GdfF7I.js +5 -0
- package/library/chunks/{color-swatch-group.BPXiMxjh.js → color-swatch-group.B10yWbVM.js} +3279 -2903
- package/library/chunks/color.CIHdfM_a.js +187 -0
- package/library/chunks/{confirm-popover.CJXyEa5A.js → confirm-popover.Cd4HM5-B.js} +4 -4
- package/library/chunks/content-builder.CBBdfVOl.js +55 -0
- package/library/chunks/{dialog.BbQ4Du0M.js → dialog.CXphbq8N.js} +2 -2
- package/library/chunks/{document-viewer.DtBW-p7z.js → document-viewer.B_ESlazf.js} +10 -9
- package/library/chunks/{dom.DL-cNKsj.js → dom.D0lSUoEI.js} +1 -1
- package/library/chunks/{dot-pagination.CJRAtM51.js → dot-pagination.CzT-MZmt.js} +1 -1
- package/library/chunks/{folder-select.BAPsI-gg.js → folder-select.BWeanVkA.js} +5 -5
- package/library/chunks/form-control.styles.CHC7Q08Q.js +5 -0
- package/library/chunks/{form.DN2v7-DH.js → form.LpappO1d.js} +1 -1
- package/library/chunks/{header.BioJzPlg.js → header.Dy57RuQW.js} +132 -90
- package/library/chunks/{i18n.rtxrs1c1.js → i18n.Q5_2aVLU.js} +93 -12
- package/library/chunks/{icon-button.CbUddcgI.js → icon-button.BjAbCuH8.js} +1 -1
- package/library/chunks/{iframe.y7iCAVZP.js → iframe.CdktjPCB.js} +1 -1
- package/library/chunks/{image.A2hE1WoV.js → image.CCo__54F.js} +322 -222
- package/library/chunks/index.DiZGZkHv.js +1126 -0
- package/library/chunks/{input.D1FFprPl.js → input.ftEf4GS6.js} +3 -3
- package/library/chunks/{markdown.Dd_GFJK8.js → markdown.RljldBNb.js} +3 -3
- package/library/chunks/{menu-item.CbqZ66to.js → menu-item.BNs1Ji48.js} +1 -1
- package/library/chunks/{option.CkhHTlpl.js → option.C8IEnv5Q.js} +1 -1
- package/library/chunks/{pagination.BlQRt932.js → pagination.Bke9vgl4.js} +6 -6
- package/library/chunks/{position-picker.DjnhxIKF.js → position-picker.qkbJlboF.js} +12 -0
- package/library/chunks/responsive.BmBJSzC4.js +17 -0
- package/library/chunks/{string.Demn8Xmk.js → string.CfI2ejyR.js} +3 -3
- package/library/chunks/{tab-group.CQfcMVEw.js → tab-group.DZ32f41G.js} +312 -310
- package/library/chunks/toast.D3AW3RWv.js +94 -0
- package/library/chunks/transformation.Dm-pK2ft.js +352 -0
- package/library/chunks/{tree.B7IKBX3n.js → tree.Umn7TAkc.js} +1 -1
- package/library/chunks/{types.MwUT4xFk.js → types.BW36Gr9c.js} +77051 -54471
- package/library/chunks/typography.BLYdTF0n.js +102 -0
- package/library/components/alert.js +2 -2
- package/library/components/asset-link-format.js +6 -6
- package/library/components/atoms.js +161 -159
- package/library/components/audio.js +3 -3
- package/library/components/bicolor-picker.js +2 -2
- package/library/components/border-input-group.js +2 -2
- package/library/components/box.d.ts +3 -0
- package/library/components/box.js +22 -0
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +4 -4
- package/library/components/card.js +7 -7
- package/library/components/checkbox.js +2 -2
- package/library/components/color-picker.js +36 -32
- package/library/components/color-swatch-group.js +8 -7
- package/library/components/color-swatch.js +246 -22
- package/library/components/confirm-popover.js +5 -5
- package/library/components/copy-button.js +2 -2
- package/library/components/corner-position-input-group.js +3 -3
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +19 -19
- package/library/components/dialog.js +3 -3
- package/library/components/diff.js +1 -1
- package/library/components/document-viewer.js +4 -4
- package/library/components/dot-pagination.js +2 -2
- package/library/components/drawer.js +2 -2
- package/library/components/dropdown.js +2 -2
- package/library/components/dynamic-select.js +95 -92
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +2 -2
- package/library/components/file-on-demand.js +12 -12
- 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 +1 -1
- package/library/components/header.js +6 -3
- 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 +4 -3
- package/library/components/input-group.js +1 -1
- package/library/components/input.js +4 -4
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +4 -4
- package/library/components/masonry.js +70 -56
- package/library/components/menu-item.js +2 -2
- package/library/components/menu.js +2 -2
- package/library/components/molecules.js +4 -4
- package/library/components/mutation-observer.js +25 -23
- package/library/components/option.js +2 -2
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +7 -7
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +2 -2
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.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 +2 -2
- package/library/components/range.js +3 -3
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +5 -5
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +3 -3
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +3 -3
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/switch.js +2 -2
- package/library/components/tab-group.js +6 -6
- package/library/components/tab-panel.js +1 -1
- package/library/components/tab.js +16 -16
- package/library/components/tag.js +2 -2
- package/library/components/textarea.js +2 -2
- package/library/components/timecode.js +2 -2
- 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 +3 -3
- package/library/components/types.js +496 -487
- package/library/components/typography.js +3 -2
- package/library/components/video.js +4231 -4210
- package/library/css/ol-base.css +1 -0
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/box/box.d.ts +26 -0
- package/library/packages/atoms/src/components/box/box.styles.d.ts +7 -0
- package/library/packages/atoms/src/components/button/button.d.ts +4 -0
- package/library/packages/atoms/src/components/card/card.d.ts +1 -0
- package/library/packages/atoms/src/components/color-picker/color-picker.d.ts +11 -0
- package/library/packages/atoms/src/components/copy-button/copy-button.d.ts +1 -0
- package/library/packages/atoms/src/components/details/details.d.ts +6 -1
- package/library/packages/atoms/src/components/header/header.d.ts +38 -2
- package/library/packages/atoms/src/components/image/image.d.ts +14 -0
- package/library/packages/atoms/src/components/mutation-observer/mutation-observer.d.ts +1 -1
- package/library/packages/atoms/src/components/radio-card/radio-card.d.ts +1 -0
- package/library/packages/atoms/src/components/tab/tab.d.ts +17 -0
- package/library/packages/atoms/src/components/typography/typography.d.ts +31 -0
- package/library/packages/atoms/src/components/video/video.d.ts +18 -0
- package/library/packages/atoms/src/index.d.ts +1 -0
- package/library/packages/events/src/cx-color-swatch-picker-columns-change.d.ts +15 -0
- package/library/packages/events/src/events.d.ts +1 -0
- package/library/packages/hybrid/table-core/src/table/table.d.ts +10 -1
- package/library/packages/molecules/src/color-swatch/color-swatch.d.ts +35 -1
- package/library/packages/molecules/src/data-tab-group/data-tab-group.d.ts +30 -1
- package/library/packages/molecules/src/details-group/details-group.d.ts +105 -3
- package/library/packages/molecules/src/dynamic-select/dynamic-select.d.ts +5 -0
- package/library/packages/molecules/src/font-picker/font-picker.d.ts +3 -0
- package/library/packages/molecules/src/gallery-item/gallery-item.d.ts +10 -0
- package/library/packages/molecules/src/index.d.ts +0 -1
- package/library/packages/molecules/src/masonry/masonry.d.ts +5 -0
- package/library/packages/organisms/src/color-swatch-group/color-swatch-group.constants.d.ts +37 -45
- package/library/packages/organisms/src/color-swatch-group/color-swatch-group.d.ts +210 -10
- package/library/packages/organisms/src/content-builder/blocks/font-kit-advanced/font-kit-advanced.utils.d.ts +85 -0
- package/library/packages/organisms/src/content-builder/blocks/image/image.d.ts +22 -6
- package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +24 -8
- package/library/packages/organisms/src/content-builder/components/color-swatch-picker/color-swatch-picker.d.ts +70 -1
- package/library/packages/organisms/src/content-builder/components/config-form/config-form-controller.d.ts +1 -22
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/gallery-config/gallery-config.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/components/gallery-picker/gallery-picker.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/accordion.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/configs/audio.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/button.d.ts +2 -1
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +11 -1
- package/library/packages/organisms/src/content-builder/configs/color-swatches.d.ts +19 -1
- package/library/packages/organisms/src/content-builder/configs/column-group.d.ts +11 -2
- package/library/packages/organisms/src/content-builder/configs/column.d.ts +13 -3
- package/library/packages/organisms/src/content-builder/configs/dam-view.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/divider.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/document-viewer.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/font-kit-advanced.d.ts +19 -0
- package/library/packages/organisms/src/content-builder/configs/font-kit.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +15 -1
- package/library/packages/organisms/src/content-builder/configs/header.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/configs/index.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/search-box.d.ts +5 -1
- package/library/packages/organisms/src/content-builder/configs/tab-group.d.ts +7 -4
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +3 -0
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +155 -13
- package/library/packages/organisms/src/content-builder/content-builder-config.d.ts +60 -0
- package/library/packages/organisms/src/content-builder/content-builder-constants.d.ts +27 -0
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +122 -2
- package/library/packages/organisms/src/content-builder/content-builder.sections.utils.d.ts +78 -0
- package/library/packages/organisms/src/content-builder/content-builder.utils.d.ts +33 -2
- package/library/packages/organisms/src/content-builder/plugins/font-kit-advanced.d.ts +5 -0
- package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/plugins/header.d.ts +7 -1
- package/library/packages/organisms/src/content-builder/plugins/index.d.ts +2 -1
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/components/rte-bubble-menu/rte-bubble-menu.d.ts +21 -1
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/extensions/index.d.ts +2 -0
- package/library/packages/organisms/src/content-builder/plugins/rich-text-editor/rte-configs.d.ts +14 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/section-fragment-component.d.ts +22 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/section-host-mounting.d.ts +15 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/sections-canvas-patches.d.ts +20 -0
- package/library/packages/organisms/src/content-builder/plugins/sections/sections-plugin.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/plugins/toolbar.d.ts +10 -1
- package/library/packages/organisms/src/content-builder/plugins/utils/block-width.d.ts +20 -0
- package/library/packages/organisms/src/content-builder/styleController.d.ts +9 -5
- package/library/packages/organisms/src/content-builder-viewer/content-builder-viewer.d.ts +1 -0
- package/library/packages/organisms/src/form/control-renderer/control-renderer.d.ts +170 -0
- package/library/packages/organisms/src/form/control-renderer/control-renderer.styles.d.ts +9 -0
- package/library/packages/organisms/src/list-editor/list-editor.d.ts +181 -6
- package/library/packages/tools/src/tiptap/extensions/metafield/index.d.ts +12 -0
- package/library/packages/tools/src/tiptap/utils/md/schema.d.ts +1 -1
- package/library/packages/types/src/asset-link-format.d.ts +0 -1
- package/library/packages/types/src/button.d.ts +1 -1
- package/library/packages/types/src/color-swatch-group.d.ts +56 -0
- package/library/packages/types/src/color-swatch.d.ts +22 -0
- package/library/packages/types/src/column.d.ts +13 -0
- package/library/packages/types/src/content-builder.d.ts +69 -4
- package/library/packages/types/src/details-group.d.ts +80 -0
- package/library/packages/types/src/font-kit-advanced.d.ts +28 -0
- package/library/packages/types/src/font-kit.d.ts +19 -0
- package/library/packages/types/src/font-picker.d.ts +2 -0
- package/library/packages/types/src/gallery-item.d.ts +3 -1
- package/library/packages/types/src/gallery.d.ts +2 -1
- package/library/packages/types/src/index.d.ts +1 -0
- package/library/packages/types/src/masonry.d.ts +1 -0
- package/library/packages/types/src/position-picker.d.ts +6 -0
- package/library/packages/types/src/sb-button.d.ts +7 -0
- package/library/packages/types/src/search-box.d.ts +4 -0
- package/library/packages/utils/src/color/color.d.ts +27 -3
- package/library/packages/utils/src/custom-element/i18n.d.ts +85 -0
- package/library/packages/utils/src/font/font.d.ts +12 -0
- package/library/packages/utils/src/transformation/transformation.d.ts +11 -3
- package/library/react-web-component.d.ts +510 -156
- package/library/utils.js +415 -395
- package/package.json +1 -1
- package/library/chunks/button.styles.BWgHrfLD.js +0 -5
- package/library/chunks/color-swatch.DdsUysbF.js +0 -223
- package/library/chunks/color.LzSGBy7o.js +0 -164
- package/library/chunks/form-control.styles.CaGWmeAS.js +0 -5
- package/library/chunks/index.BO_sT6SH.js +0 -20123
- package/library/chunks/toast.BOkYwUIj.js +0 -109
- package/library/chunks/transformation.B8m0Nbao.js +0 -384
- package/library/chunks/typography.T72DuoCa.js +0 -52
- package/library/packages/molecules/src/search-box/search-box.d.ts +0 -114
- package/library/packages/organisms/src/content-builder/plugins/wrapper-container.d.ts +0 -15
- /package/library/packages/{molecules/src/search-box/search-box.styles.d.ts → organisms/src/content-builder-viewer/content-builder-viewer.styles.d.ts} +0 -0
|
@@ -1,145 +1,146 @@
|
|
|
1
|
-
import { r as
|
|
1
|
+
import { r as $e, R as Re, H as K, a as ie, b as je } from "./resizable-component.styles.CAfXABBc.js";
|
|
2
2
|
import { c as He } from "./component.styles.CAS3c9pM.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as oe } from "./index.Cpamj0jB.js";
|
|
4
|
+
import { P as Te } from "./position-picker.qkbJlboF.js";
|
|
4
5
|
import { c as Ae } from "./custom-element.L4WJXn1j.js";
|
|
5
6
|
import { d as Oe } from "./debounce.DaHuiSGU.js";
|
|
6
|
-
import { L as
|
|
7
|
+
import { L as Ze } from "./i18n.Q5_2aVLU.js";
|
|
7
8
|
import { w as M } from "./watch.DJF5K-8U.js";
|
|
8
|
-
import { a as
|
|
9
|
-
import { i as
|
|
9
|
+
import { a as Ie } from "./url.CGdWC06g.js";
|
|
10
|
+
import { i as le, E as X, x as L } from "./lit-element.jLBm65_O.js";
|
|
10
11
|
import { n as p } from "./lib-cortex-element.CVMmyPMC.js";
|
|
11
12
|
import { r as E } from "./state.CSDxrqLd.js";
|
|
12
13
|
import { e as G } from "./query.BBf1UFkC.js";
|
|
13
14
|
import { e as S } from "./class-map.BiVq-cVR.js";
|
|
14
|
-
import { o as
|
|
15
|
-
import { i as
|
|
16
|
-
import { o as
|
|
17
|
-
import { n as
|
|
18
|
-
import { C as
|
|
19
|
-
import
|
|
15
|
+
import { o as $ } from "./if-defined.BRoBj_Rp.js";
|
|
16
|
+
import { i as Me } from "./keyed.DdOUTIg-.js";
|
|
17
|
+
import { o as Pe } from "./style-map.llVFPd__.js";
|
|
18
|
+
import { n as T } from "./when.Dr1es41R.js";
|
|
19
|
+
import { C as Fe } from "./icon.BLXWp6CU.js";
|
|
20
|
+
import _e from "../components/popup.js";
|
|
20
21
|
import Ne from "../components/resize-observer.js";
|
|
21
22
|
import We from "../components/skeleton.js";
|
|
22
23
|
import Be from "../components/space.js";
|
|
23
24
|
var I = /* @__PURE__ */ ((i) => (i.Automatic = "automatic", i.Manual = "manual", i))(I || {});
|
|
24
25
|
/*! medium-zoom 1.1.0 | MIT License | https://github.com/francoischalifour/medium-zoom */
|
|
25
|
-
var
|
|
26
|
+
var R = Object.assign || function(i) {
|
|
26
27
|
for (var t = 1; t < arguments.length; t++) {
|
|
27
28
|
var o = arguments[t];
|
|
28
|
-
for (var
|
|
29
|
-
Object.prototype.hasOwnProperty.call(o,
|
|
29
|
+
for (var h in o)
|
|
30
|
+
Object.prototype.hasOwnProperty.call(o, h) && (i[h] = o[h]);
|
|
30
31
|
}
|
|
31
32
|
return i;
|
|
32
|
-
},
|
|
33
|
+
}, W = function(t) {
|
|
33
34
|
return t.tagName === "IMG";
|
|
34
|
-
},
|
|
35
|
+
}, Ue = function(t) {
|
|
35
36
|
return NodeList.prototype.isPrototypeOf(t);
|
|
36
|
-
},
|
|
37
|
+
}, B = function(t) {
|
|
37
38
|
return t && t.nodeType === 1;
|
|
38
|
-
},
|
|
39
|
+
}, re = function(t) {
|
|
39
40
|
var o = t.currentSrc || t.src;
|
|
40
41
|
return o.substr(-4).toLowerCase() === ".svg";
|
|
41
|
-
},
|
|
42
|
+
}, ne = function(t) {
|
|
42
43
|
try {
|
|
43
|
-
return Array.isArray(t) ? t.filter(
|
|
44
|
+
return Array.isArray(t) ? t.filter(W) : Ue(t) ? [].slice.call(t).filter(W) : B(t) ? [t].filter(W) : typeof t == "string" ? [].slice.call(document.querySelectorAll(t)).filter(W) : [];
|
|
44
45
|
} catch {
|
|
45
46
|
throw new TypeError(`The provided selector is invalid.
|
|
46
47
|
Expects a CSS selector, a Node element, a NodeList or an array.
|
|
47
48
|
See: https://github.com/francoischalifour/medium-zoom`);
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
+
}, De = function(t) {
|
|
50
51
|
var o = document.createElement("div");
|
|
51
52
|
return o.classList.add("medium-zoom-overlay"), o.style.background = t, o;
|
|
52
|
-
},
|
|
53
|
-
var o = t.getBoundingClientRect(),
|
|
54
|
-
return
|
|
55
|
-
},
|
|
56
|
-
var
|
|
53
|
+
}, qe = function(t) {
|
|
54
|
+
var o = t.getBoundingClientRect(), h = o.top, d = o.left, C = o.width, k = o.height, z = t.cloneNode(), U = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, P = window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft || 0;
|
|
55
|
+
return z.removeAttribute("id"), z.style.position = "absolute", z.style.top = h + U + "px", z.style.left = d + P + "px", z.style.width = C + "px", z.style.height = k + "px", z.style.transform = "", z;
|
|
56
|
+
}, A = function(t, o) {
|
|
57
|
+
var h = R({
|
|
57
58
|
bubbles: !1,
|
|
58
59
|
cancelable: !1,
|
|
59
60
|
detail: void 0
|
|
60
61
|
}, o);
|
|
61
62
|
if (typeof window.CustomEvent == "function")
|
|
62
|
-
return new CustomEvent(t,
|
|
63
|
-
var
|
|
64
|
-
return
|
|
65
|
-
},
|
|
66
|
-
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {},
|
|
67
|
-
function
|
|
63
|
+
return new CustomEvent(t, h);
|
|
64
|
+
var d = document.createEvent("CustomEvent");
|
|
65
|
+
return d.initCustomEvent(t, h.bubbles, h.cancelable, h.detail), d;
|
|
66
|
+
}, Ve = function i(t) {
|
|
67
|
+
var o = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, h = window.Promise || function(r) {
|
|
68
|
+
function n() {
|
|
68
69
|
}
|
|
69
|
-
r(
|
|
70
|
-
},
|
|
71
|
-
var
|
|
72
|
-
if (
|
|
70
|
+
r(n, n);
|
|
71
|
+
}, d = function(r) {
|
|
72
|
+
var n = r.target;
|
|
73
|
+
if (n === _) {
|
|
73
74
|
x();
|
|
74
75
|
return;
|
|
75
76
|
}
|
|
76
|
-
y.indexOf(
|
|
77
|
+
y.indexOf(n) !== -1 && Q({ target: n });
|
|
77
78
|
}, C = function() {
|
|
78
|
-
if (!(
|
|
79
|
+
if (!(j || !e.original)) {
|
|
79
80
|
var r = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
80
|
-
Math.abs(ee - r) >
|
|
81
|
+
Math.abs(ee - r) > c.scrollOffset && setTimeout(x, 150);
|
|
81
82
|
}
|
|
82
83
|
}, k = function(r) {
|
|
83
|
-
var
|
|
84
|
-
(
|
|
85
|
-
},
|
|
86
|
-
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
87
|
-
if (r.background && (
|
|
88
|
-
var m =
|
|
89
|
-
|
|
84
|
+
var n = r.key || r.keyCode;
|
|
85
|
+
(n === "Escape" || n === "Esc" || n === 27) && x();
|
|
86
|
+
}, z = function() {
|
|
87
|
+
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = r;
|
|
88
|
+
if (r.background && (_.style.background = r.background), r.container && r.container instanceof Object && (n.container = R({}, c.container, r.container)), r.template) {
|
|
89
|
+
var m = B(r.template) ? r.template : document.querySelector(r.template);
|
|
90
|
+
n.template = m;
|
|
90
91
|
}
|
|
91
|
-
return
|
|
92
|
-
g.dispatchEvent(
|
|
92
|
+
return c = R({}, c, n), y.forEach(function(g) {
|
|
93
|
+
g.dispatchEvent(A("medium-zoom:update", {
|
|
93
94
|
detail: { zoom: u }
|
|
94
95
|
}));
|
|
95
96
|
}), u;
|
|
96
97
|
}, U = function() {
|
|
97
98
|
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
98
|
-
return i(
|
|
99
|
-
},
|
|
100
|
-
for (var r = arguments.length,
|
|
101
|
-
|
|
102
|
-
var g =
|
|
103
|
-
return [].concat(s,
|
|
99
|
+
return i(R({}, c, r));
|
|
100
|
+
}, P = function() {
|
|
101
|
+
for (var r = arguments.length, n = Array(r), m = 0; m < r; m++)
|
|
102
|
+
n[m] = arguments[m];
|
|
103
|
+
var g = n.reduce(function(s, v) {
|
|
104
|
+
return [].concat(s, ne(v));
|
|
104
105
|
}, []);
|
|
105
106
|
return g.filter(function(s) {
|
|
106
107
|
return y.indexOf(s) === -1;
|
|
107
108
|
}).forEach(function(s) {
|
|
108
109
|
y.push(s), s.classList.add("medium-zoom-image");
|
|
109
|
-
}),
|
|
110
|
-
var v = s.type,
|
|
110
|
+
}), F.forEach(function(s) {
|
|
111
|
+
var v = s.type, b = s.listener, H = s.options;
|
|
111
112
|
g.forEach(function(w) {
|
|
112
|
-
w.addEventListener(v,
|
|
113
|
+
w.addEventListener(v, b, H);
|
|
113
114
|
});
|
|
114
115
|
}), u;
|
|
115
116
|
}, de = function() {
|
|
116
|
-
for (var r = arguments.length,
|
|
117
|
-
|
|
117
|
+
for (var r = arguments.length, n = Array(r), m = 0; m < r; m++)
|
|
118
|
+
n[m] = arguments[m];
|
|
118
119
|
e.zoomed && x();
|
|
119
|
-
var g =
|
|
120
|
-
return [].concat(s,
|
|
120
|
+
var g = n.length > 0 ? n.reduce(function(s, v) {
|
|
121
|
+
return [].concat(s, ne(v));
|
|
121
122
|
}, []) : y;
|
|
122
123
|
return g.forEach(function(s) {
|
|
123
|
-
s.classList.remove("medium-zoom-image"), s.dispatchEvent(
|
|
124
|
+
s.classList.remove("medium-zoom-image"), s.dispatchEvent(A("medium-zoom:detach", {
|
|
124
125
|
detail: { zoom: u }
|
|
125
126
|
}));
|
|
126
127
|
}), y = y.filter(function(s) {
|
|
127
128
|
return g.indexOf(s) === -1;
|
|
128
129
|
}), u;
|
|
129
|
-
},
|
|
130
|
+
}, me = function(r, n) {
|
|
130
131
|
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
131
132
|
return y.forEach(function(g) {
|
|
132
|
-
g.addEventListener("medium-zoom:" + r,
|
|
133
|
-
}),
|
|
134
|
-
},
|
|
133
|
+
g.addEventListener("medium-zoom:" + r, n, m);
|
|
134
|
+
}), F.push({ type: "medium-zoom:" + r, listener: n, options: m }), u;
|
|
135
|
+
}, ge = function(r, n) {
|
|
135
136
|
var m = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
136
137
|
return y.forEach(function(g) {
|
|
137
|
-
g.removeEventListener("medium-zoom:" + r,
|
|
138
|
-
}),
|
|
139
|
-
return !(g.type === "medium-zoom:" + r && g.listener.toString() ===
|
|
138
|
+
g.removeEventListener("medium-zoom:" + r, n, m);
|
|
139
|
+
}), F = F.filter(function(g) {
|
|
140
|
+
return !(g.type === "medium-zoom:" + r && g.listener.toString() === n.toString());
|
|
140
141
|
}), u;
|
|
141
142
|
}, J = function() {
|
|
142
|
-
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
143
|
+
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = r.target, m = function() {
|
|
143
144
|
var s = {
|
|
144
145
|
width: document.documentElement.clientWidth,
|
|
145
146
|
height: document.documentElement.clientHeight,
|
|
@@ -147,30 +148,30 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
147
148
|
top: 0,
|
|
148
149
|
right: 0,
|
|
149
150
|
bottom: 0
|
|
150
|
-
}, v = void 0,
|
|
151
|
-
if (
|
|
152
|
-
if (
|
|
153
|
-
s =
|
|
151
|
+
}, v = void 0, b = void 0;
|
|
152
|
+
if (c.container)
|
|
153
|
+
if (c.container instanceof Object)
|
|
154
|
+
s = R({}, s, c.container), v = s.width - s.left - s.right - c.margin * 2, b = s.height - s.top - s.bottom - c.margin * 2;
|
|
154
155
|
else {
|
|
155
|
-
var
|
|
156
|
-
s =
|
|
156
|
+
var H = B(c.container) ? c.container : document.querySelector(c.container), w = H.getBoundingClientRect(), D = w.width, ve = w.height, ye = w.left, be = w.top;
|
|
157
|
+
s = R({}, s, {
|
|
157
158
|
width: D,
|
|
158
|
-
height:
|
|
159
|
-
left:
|
|
160
|
-
top:
|
|
159
|
+
height: ve,
|
|
160
|
+
left: ye,
|
|
161
|
+
top: be
|
|
161
162
|
});
|
|
162
163
|
}
|
|
163
|
-
v = v || s.width -
|
|
164
|
-
var Z = e.zoomedHd || e.original, ze =
|
|
164
|
+
v = v || s.width - c.margin * 2, b = b || s.height - c.margin * 2;
|
|
165
|
+
var Z = e.zoomedHd || e.original, ze = re(Z) ? v : Z.naturalWidth || v, xe = re(Z) ? b : Z.naturalHeight || b, N = Z.getBoundingClientRect(), we = N.top, Ee = N.left, q = N.width, V = N.height, Ce = Math.min(Math.max(q, ze), v) / q, ke = Math.min(Math.max(V, xe), b) / V, Y = Math.min(Ce, ke), Le = (-Ee + (v - q) / 2 + c.margin + s.left) / Y, Se = (-we + (b - V) / 2 + c.margin + s.top) / Y, te = "scale(" + Y + ") translate3d(" + Le + "px, " + Se + "px, 0)";
|
|
165
166
|
e.zoomed.style.transform = te, e.zoomedHd && (e.zoomedHd.style.transform = te);
|
|
166
167
|
};
|
|
167
|
-
return new
|
|
168
|
-
if (
|
|
168
|
+
return new h(function(g) {
|
|
169
|
+
if (n && y.indexOf(n) === -1) {
|
|
169
170
|
g(u);
|
|
170
171
|
return;
|
|
171
172
|
}
|
|
172
173
|
var s = function D() {
|
|
173
|
-
|
|
174
|
+
j = !1, e.zoomed.removeEventListener("transitionend", D), e.original.dispatchEvent(A("medium-zoom:opened", {
|
|
174
175
|
detail: { zoom: u }
|
|
175
176
|
})), g(u);
|
|
176
177
|
};
|
|
@@ -178,8 +179,8 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
178
179
|
g(u);
|
|
179
180
|
return;
|
|
180
181
|
}
|
|
181
|
-
if (
|
|
182
|
-
e.original =
|
|
182
|
+
if (n)
|
|
183
|
+
e.original = n;
|
|
183
184
|
else if (y.length > 0) {
|
|
184
185
|
var v = y;
|
|
185
186
|
e.original = v[0];
|
|
@@ -187,20 +188,20 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
187
188
|
g(u);
|
|
188
189
|
return;
|
|
189
190
|
}
|
|
190
|
-
if (e.original.dispatchEvent(
|
|
191
|
+
if (e.original.dispatchEvent(A("medium-zoom:open", {
|
|
191
192
|
detail: { zoom: u }
|
|
192
|
-
})), ee = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0,
|
|
193
|
-
var
|
|
194
|
-
e.template = document.createElement("div"), e.template.appendChild(
|
|
193
|
+
})), ee = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0, j = !0, e.zoomed = qe(e.original), document.body.appendChild(_), c.template) {
|
|
194
|
+
var b = B(c.template) ? c.template : document.querySelector(c.template);
|
|
195
|
+
e.template = document.createElement("div"), e.template.appendChild(b.content.cloneNode(!0)), document.body.appendChild(e.template);
|
|
195
196
|
}
|
|
196
197
|
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() {
|
|
197
198
|
document.body.classList.add("medium-zoom--opened");
|
|
198
199
|
}), 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", s), e.original.getAttribute("data-zoom-src")) {
|
|
199
200
|
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() {
|
|
200
|
-
clearInterval(
|
|
201
|
+
clearInterval(H), console.warn("Unable to reach the zoom image target " + e.zoomedHd.src), e.zoomedHd = null, m();
|
|
201
202
|
};
|
|
202
|
-
var
|
|
203
|
-
e.zoomedHd.complete && (clearInterval(
|
|
203
|
+
var H = setInterval(function() {
|
|
204
|
+
e.zoomedHd.complete && (clearInterval(H), e.zoomedHd.classList.add("medium-zoom-image--opened"), e.zoomedHd.addEventListener("click", x), document.body.appendChild(e.zoomedHd), m());
|
|
204
205
|
}, 10);
|
|
205
206
|
} else if (e.original.hasAttribute("srcset")) {
|
|
206
207
|
e.zoomedHd = e.zoomed.cloneNode(), e.zoomedHd.removeAttribute("sizes"), e.zoomedHd.removeAttribute("loading");
|
|
@@ -211,58 +212,58 @@ See: https://github.com/francoischalifour/medium-zoom`);
|
|
|
211
212
|
m();
|
|
212
213
|
});
|
|
213
214
|
}, x = function() {
|
|
214
|
-
return new
|
|
215
|
-
if (
|
|
215
|
+
return new h(function(r) {
|
|
216
|
+
if (j || !e.original) {
|
|
216
217
|
r(u);
|
|
217
218
|
return;
|
|
218
219
|
}
|
|
219
|
-
var
|
|
220
|
-
e.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(e.zoomed), e.zoomedHd && document.body.removeChild(e.zoomedHd), document.body.removeChild(
|
|
220
|
+
var n = function m() {
|
|
221
|
+
e.original.classList.remove("medium-zoom-image--hidden"), document.body.removeChild(e.zoomed), e.zoomedHd && document.body.removeChild(e.zoomedHd), document.body.removeChild(_), e.zoomed.classList.remove("medium-zoom-image--opened"), e.template && document.body.removeChild(e.template), j = !1, e.zoomed.removeEventListener("transitionend", m), e.original.dispatchEvent(A("medium-zoom:closed", {
|
|
221
222
|
detail: { zoom: u }
|
|
222
223
|
})), e.original = null, e.zoomed = null, e.zoomedHd = null, e.template = null, r(u);
|
|
223
224
|
};
|
|
224
|
-
|
|
225
|
+
j = !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(A("medium-zoom:close", {
|
|
225
226
|
detail: { zoom: u }
|
|
226
|
-
})), e.zoomed.addEventListener("transitionend",
|
|
227
|
+
})), e.zoomed.addEventListener("transitionend", n);
|
|
227
228
|
});
|
|
228
229
|
}, Q = function() {
|
|
229
|
-
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {},
|
|
230
|
-
return e.original ? x() : J({ target:
|
|
231
|
-
}, ge = function() {
|
|
232
|
-
return d;
|
|
230
|
+
var r = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, n = r.target;
|
|
231
|
+
return e.original ? x() : J({ target: n });
|
|
233
232
|
}, ue = function() {
|
|
234
|
-
return
|
|
233
|
+
return c;
|
|
235
234
|
}, pe = function() {
|
|
235
|
+
return y;
|
|
236
|
+
}, fe = function() {
|
|
236
237
|
return e.original;
|
|
237
|
-
}, y = [],
|
|
238
|
+
}, y = [], F = [], j = !1, ee = 0, c = o, e = {
|
|
238
239
|
original: null,
|
|
239
240
|
zoomed: null,
|
|
240
241
|
zoomedHd: null,
|
|
241
242
|
template: null
|
|
242
243
|
// If the selector is omitted, it's replaced by the options
|
|
243
244
|
};
|
|
244
|
-
Object.prototype.toString.call(t) === "[object Object]" ?
|
|
245
|
+
Object.prototype.toString.call(t) === "[object Object]" ? c = t : (t || typeof t == "string") && P(t), c = R({
|
|
245
246
|
margin: 0,
|
|
246
247
|
background: "#fff",
|
|
247
248
|
scrollOffset: 40,
|
|
248
249
|
container: null,
|
|
249
250
|
template: null
|
|
250
|
-
},
|
|
251
|
-
var
|
|
252
|
-
document.addEventListener("click",
|
|
251
|
+
}, c);
|
|
252
|
+
var _ = De(c.background);
|
|
253
|
+
document.addEventListener("click", d), document.addEventListener("keyup", k), document.addEventListener("scroll", C), window.addEventListener("resize", x);
|
|
253
254
|
var u = {
|
|
254
255
|
open: J,
|
|
255
256
|
close: x,
|
|
256
257
|
toggle: Q,
|
|
257
|
-
update:
|
|
258
|
+
update: z,
|
|
258
259
|
clone: U,
|
|
259
|
-
attach:
|
|
260
|
+
attach: P,
|
|
260
261
|
detach: de,
|
|
261
|
-
on:
|
|
262
|
-
off:
|
|
263
|
-
getOptions:
|
|
264
|
-
getImages:
|
|
265
|
-
getZoomedImage:
|
|
262
|
+
on: me,
|
|
263
|
+
off: ge,
|
|
264
|
+
getOptions: ue,
|
|
265
|
+
getImages: pe,
|
|
266
|
+
getZoomedImage: fe
|
|
266
267
|
};
|
|
267
268
|
return u;
|
|
268
269
|
};
|
|
@@ -270,13 +271,13 @@ function Ye(i, t) {
|
|
|
270
271
|
t === void 0 && (t = {});
|
|
271
272
|
var o = t.insertAt;
|
|
272
273
|
if (!(typeof document > "u")) {
|
|
273
|
-
var
|
|
274
|
-
|
|
274
|
+
var h = document.head || document.getElementsByTagName("head")[0], d = document.createElement("style");
|
|
275
|
+
d.type = "text/css", o === "top" && h.firstChild ? h.insertBefore(d, h.firstChild) : h.appendChild(d), d.styleSheet ? d.styleSheet.cssText = i : d.appendChild(document.createTextNode(i));
|
|
275
276
|
}
|
|
276
277
|
}
|
|
277
|
-
var
|
|
278
|
-
Ye(
|
|
279
|
-
const
|
|
278
|
+
var Ke = ".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}";
|
|
279
|
+
Ye(Ke);
|
|
280
|
+
const Xe = le`: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))}:host([effect=zoom][zoom-style=pop-out]){overflow-clip-margin:var(--column-padding,10px);overflow:clip}.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)}`, Ge = le`
|
|
280
281
|
:host {
|
|
281
282
|
--justify-content: flex-start;
|
|
282
283
|
--border-radius: 0px;
|
|
@@ -330,7 +331,7 @@ const Ke = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
330
331
|
max-height: 100%;
|
|
331
332
|
}
|
|
332
333
|
|
|
333
|
-
${
|
|
334
|
+
${Xe}
|
|
334
335
|
|
|
335
336
|
:host([block]) {
|
|
336
337
|
width: 100%;
|
|
@@ -424,6 +425,56 @@ const Ke = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
424
425
|
cursor: pointer;
|
|
425
426
|
}
|
|
426
427
|
|
|
428
|
+
/**
|
|
429
|
+
* Only used under object-fit: contain, where the image shrinks to fit and object-position
|
|
430
|
+
* has no free space to shift content within the <img> box — so the focal point is applied
|
|
431
|
+
* by aligning the <img> itself within this flex parent instead.
|
|
432
|
+
*/
|
|
433
|
+
.highlightable-item--crop-focus-top-left {
|
|
434
|
+
align-items: flex-start;
|
|
435
|
+
justify-content: flex-start;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
.highlightable-item--crop-focus-top-center {
|
|
439
|
+
align-items: flex-start;
|
|
440
|
+
justify-content: center;
|
|
441
|
+
}
|
|
442
|
+
|
|
443
|
+
.highlightable-item--crop-focus-top-right {
|
|
444
|
+
align-items: flex-start;
|
|
445
|
+
justify-content: flex-end;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
.highlightable-item--crop-focus-center-left {
|
|
449
|
+
align-items: center;
|
|
450
|
+
justify-content: flex-start;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
.highlightable-item--crop-focus-center-center {
|
|
454
|
+
align-items: center;
|
|
455
|
+
justify-content: center;
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
.highlightable-item--crop-focus-center-right {
|
|
459
|
+
align-items: center;
|
|
460
|
+
justify-content: flex-end;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
.highlightable-item--crop-focus-bottom-left {
|
|
464
|
+
align-items: flex-end;
|
|
465
|
+
justify-content: flex-start;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.highlightable-item--crop-focus-bottom-center {
|
|
469
|
+
align-items: flex-end;
|
|
470
|
+
justify-content: center;
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
.highlightable-item--crop-focus-bottom-right {
|
|
474
|
+
align-items: flex-end;
|
|
475
|
+
justify-content: flex-end;
|
|
476
|
+
}
|
|
477
|
+
|
|
427
478
|
.image {
|
|
428
479
|
border-radius: var(--border-radius);
|
|
429
480
|
border: var(--border) solid;
|
|
@@ -455,6 +506,42 @@ const Ke = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
455
506
|
object-fit: scale-down;
|
|
456
507
|
}
|
|
457
508
|
|
|
509
|
+
.image--crop-focus-top-left {
|
|
510
|
+
object-position: left top;
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
.image--crop-focus-top-center {
|
|
514
|
+
object-position: center top;
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
.image--crop-focus-top-right {
|
|
518
|
+
object-position: right top;
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
.image--crop-focus-center-left {
|
|
522
|
+
object-position: left center;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.image--crop-focus-center-center {
|
|
526
|
+
object-position: center center;
|
|
527
|
+
}
|
|
528
|
+
|
|
529
|
+
.image--crop-focus-center-right {
|
|
530
|
+
object-position: right center;
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
.image--crop-focus-bottom-left {
|
|
534
|
+
object-position: left bottom;
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
.image--crop-focus-bottom-center {
|
|
538
|
+
object-position: center bottom;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.image--crop-focus-bottom-right {
|
|
542
|
+
object-position: right bottom;
|
|
543
|
+
}
|
|
544
|
+
|
|
458
545
|
.image--hidden {
|
|
459
546
|
display: none;
|
|
460
547
|
}
|
|
@@ -468,13 +555,13 @@ const Ke = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
468
555
|
}
|
|
469
556
|
|
|
470
557
|
.image--contain.image--landscape {
|
|
471
|
-
width: 100
|
|
558
|
+
width: var(--image-contain-fill, 100%);
|
|
472
559
|
height: auto;
|
|
473
560
|
}
|
|
474
561
|
|
|
475
562
|
.image--contain.image--portrait {
|
|
476
563
|
width: auto;
|
|
477
|
-
height: 100
|
|
564
|
+
height: var(--image-contain-fill, 100%);
|
|
478
565
|
}
|
|
479
566
|
|
|
480
567
|
.popup-container::part(popup) {
|
|
@@ -535,16 +622,16 @@ const Ke = se`:host([effect=jump]) .container,:host([effect=text-reveal]) .conta
|
|
|
535
622
|
color: var(--fallback-icon-color);
|
|
536
623
|
}
|
|
537
624
|
`;
|
|
538
|
-
var
|
|
625
|
+
var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, he = (i) => {
|
|
539
626
|
throw TypeError(i);
|
|
540
|
-
},
|
|
541
|
-
for (var
|
|
542
|
-
(k = i[C]) && (
|
|
543
|
-
return
|
|
544
|
-
},
|
|
545
|
-
let
|
|
627
|
+
}, l = (i, t, o, h) => {
|
|
628
|
+
for (var d = h > 1 ? void 0 : h ? Qe(t, o) : t, C = i.length - 1, k; C >= 0; C--)
|
|
629
|
+
(k = i[C]) && (d = (h ? k(t, o, d) : k(d)) || d);
|
|
630
|
+
return h && d && Je(t, o, d), d;
|
|
631
|
+
}, ce = (i, t, o) => t.has(i) || he("Cannot " + o), ae = (i, t, o) => (ce(i, t, "read from private field"), o ? o.call(i) : t.get(i)), et = (i, t, o) => t.has(i) ? he("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, o), se = (i, t, o, h) => (ce(i, t, "write to private field"), t.set(i, o), o), O;
|
|
632
|
+
let a = class extends Re {
|
|
546
633
|
constructor() {
|
|
547
|
-
super(...arguments), this.localize = new
|
|
634
|
+
super(...arguments), this.localize = new Ze(this), this.retryCount = 0, this.retryTimer = null, this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryIndex = 0, this.src = "", this.srcset = "", this.sizes = "", this.placeholder = "", this.alt = "", this.objectFit = oe.Fill, this.cropFocus = Te.CenterCenter, this.skeleton = !1, this.fallback = !1, this.canZoom = !1, this.loading = !1, this.block = !1, this.htmlLoading = "lazy", this.noCrossorigin = !1, this.clickHandlerType = I.Automatic, this.retryOnError = !1, this.maxRetries = 10, this.isZoomed = !1, this.imageRatio = 1, this.parsedAlt = "", this.parsedAltDarkMode = "", this.zoom = null, this.lastPatchedWidth = null, et(this, O, "");
|
|
548
635
|
}
|
|
549
636
|
get currentAltValue() {
|
|
550
637
|
return this.alt;
|
|
@@ -558,21 +645,31 @@ let n = class extends Re {
|
|
|
558
645
|
get highlighterRole() {
|
|
559
646
|
return this.hasZoomAction && this.clickHandlerType === I.Automatic ? "button" : "img";
|
|
560
647
|
}
|
|
648
|
+
/**
|
|
649
|
+
* `object-position` only shifts content already stretched to fill the `<img>` box, so
|
|
650
|
+
* under `contain` (where the image shrinks to fit and never fills that box on both axes)
|
|
651
|
+
* the focal point must instead be applied by aligning the `<img>` within this flex parent.
|
|
652
|
+
*/
|
|
653
|
+
get highlighterCropFocusClass() {
|
|
654
|
+
return this.objectFit === oe.Contain ? { [`highlightable-item--crop-focus-${this.cropFocus}`]: !0 } : {};
|
|
655
|
+
}
|
|
561
656
|
get highlighterClass() {
|
|
562
657
|
return {
|
|
563
658
|
"highlightable-item": !0,
|
|
564
659
|
"highlightable-item--effect-text-reveal": this.effect === K.TextReveal,
|
|
565
|
-
[`highlightable-item--text-reveal-style-${this.textRevealStyle}`]: !0
|
|
660
|
+
[`highlightable-item--text-reveal-style-${this.textRevealStyle}`]: !0,
|
|
661
|
+
...this.highlighterCropFocusClass
|
|
566
662
|
};
|
|
567
663
|
}
|
|
568
664
|
get imageClass() {
|
|
569
665
|
let i = "landscape", t = this.ratio;
|
|
570
|
-
const o = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width),
|
|
571
|
-
return
|
|
666
|
+
const o = this.width.endsWith("%") ? this.clientWidth : Number.parseFloat(this.width), h = this.isResizing ? this.resizeSize.width : o, d = this.isResizing ? this.resizeSize.height : Number.parseFloat(this.height);
|
|
667
|
+
return h && d && (t = h / d), t > this.imageRatio && (i = "portrait"), {
|
|
572
668
|
image: !0,
|
|
573
669
|
[`image--${this.objectFit}`]: !0,
|
|
574
670
|
[`image--${i}`]: !0,
|
|
575
671
|
[`image--height-${this.heightMode}`]: !0,
|
|
672
|
+
[`image--crop-focus-${this.cropFocus}`]: !0,
|
|
576
673
|
"image--can-zoom": this.canZoom,
|
|
577
674
|
"image--has-action": this.hasZoomAction,
|
|
578
675
|
"image--hidden": this.isEmpty || this.isError || this.isRetrying
|
|
@@ -640,7 +737,7 @@ let n = class extends Re {
|
|
|
640
737
|
await this.updateComplete, this.requestUpdate();
|
|
641
738
|
}
|
|
642
739
|
handleSrcChange() {
|
|
643
|
-
this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryCount = 0, this.retryIndex = 0,
|
|
740
|
+
this.isLoaded = !1, this.isError = !1, this.isRetrying = !1, this.retryCount = 0, this.retryIndex = 0, se(this, O, ""), this.clearRetryTimer();
|
|
644
741
|
}
|
|
645
742
|
clearRetryTimer() {
|
|
646
743
|
this.retryTimer !== null && (clearTimeout(this.retryTimer), this.retryTimer = null);
|
|
@@ -648,15 +745,15 @@ let n = class extends Re {
|
|
|
648
745
|
scheduleRetry() {
|
|
649
746
|
const i = Math.min(1e3 * Math.pow(2, this.retryCount - 1), 1e4);
|
|
650
747
|
this.retryTimer = setTimeout(() => {
|
|
651
|
-
this.retryTimer = null,
|
|
748
|
+
this.retryTimer = null, se(this, O, `${this.retryCount}-${Math.random().toString(36).slice(2)}`), this.retryIndex += 1;
|
|
652
749
|
}, i);
|
|
653
750
|
}
|
|
654
751
|
/** Appends the retry cache-bust param to `src` while a retry attempt is in flight, so a CDN edge caching a corrupted/truncated response is bypassed in favor of a fresh origin fetch. */
|
|
655
752
|
applyRetryCacheBust(i) {
|
|
656
|
-
return this.retryIndex === 0 || !ae(this,
|
|
753
|
+
return this.retryIndex === 0 || !ae(this, O) || !i ? i : Ie(i, "cachebust", ae(this, O));
|
|
657
754
|
}
|
|
658
755
|
async initZoom() {
|
|
659
|
-
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom =
|
|
756
|
+
this.zoomImageElement && !this.zoom && this.isLoaded && (this.zoom = Ve(this.zoomImageElement, {
|
|
660
757
|
background: "light-dark(rgba(255, 255, 255, 0.8), rgba(0, 0, 0, 0.8))",
|
|
661
758
|
margin: 0,
|
|
662
759
|
scrollOffset: 0
|
|
@@ -670,8 +767,8 @@ let n = class extends Re {
|
|
|
670
767
|
const t = i?.currentTarget ?? this.imageElement;
|
|
671
768
|
if (!t)
|
|
672
769
|
return;
|
|
673
|
-
const { naturalHeight: o, naturalWidth:
|
|
674
|
-
this.imageRatio =
|
|
770
|
+
const { naturalHeight: o, naturalWidth: h } = t;
|
|
771
|
+
this.imageRatio = h / o, this.clearRetryTimer(), this.retryCount = 0, this.isRetrying = !1, this.isLoaded || this.emit("cx-load"), this.isLoaded = !0, this.isError = !1;
|
|
675
772
|
}
|
|
676
773
|
handleError() {
|
|
677
774
|
if (this.retryOnError && this.retryCount < this.maxRetries) {
|
|
@@ -681,8 +778,8 @@ let n = class extends Re {
|
|
|
681
778
|
this.isRetrying = !1, this.emit("cx-error"), this.isLoaded = !0, this.isError = !0;
|
|
682
779
|
}
|
|
683
780
|
handleSizeChange() {
|
|
684
|
-
const i = this.resizeDirection !== ie.Vertical, t = this.resizeDirection !== ie.Horizontal, o = this.isResizing ? `${this.resizeSize.width}px` : this.width,
|
|
685
|
-
i && (this.width || this.isResizing ? this.style.setProperty("--width", o) : this.style.removeProperty("--width")), t && (this.heightMode !==
|
|
781
|
+
const i = this.resizeDirection !== ie.Vertical, t = this.resizeDirection !== ie.Horizontal, o = this.isResizing ? `${this.resizeSize.width}px` : this.width, h = this.isResizing ? `${this.resizeSize.height}px` : this.height;
|
|
782
|
+
i && (this.width || this.isResizing ? this.style.setProperty("--width", o) : this.style.removeProperty("--width")), t && (this.heightMode !== je.Auto && (this.height || this.isResizing) ? this.style.setProperty("--height", h) : this.style.removeProperty("--height"));
|
|
686
783
|
}
|
|
687
784
|
handleResize(i) {
|
|
688
785
|
const { entries: t } = i.detail;
|
|
@@ -711,9 +808,9 @@ let n = class extends Re {
|
|
|
711
808
|
return X;
|
|
712
809
|
} else if (this.isError)
|
|
713
810
|
return X;
|
|
714
|
-
return L`<div part="content" slot="anchor" class=${S(this.highlighterClass)}>${
|
|
811
|
+
return L`<div part="content" slot="anchor" class=${S(this.highlighterClass)}>${Me(
|
|
715
812
|
this.retryIndex,
|
|
716
|
-
L`<img part="image" class=${S(this.imageClass)} src=${i || this.placeholder} srcset=${
|
|
813
|
+
L`<img part="image" class=${S(this.imageClass)} src=${i || this.placeholder} srcset=${$(this.srcset || void 0)} sizes=${$(this.sizes || void 0)} alt=${t} aria-label=${t} crossorigin=${$(this.crossorigin)} @load=${this.handleLoad} @error=${this.handleError} loading=${this.retryIndex > 0 ? "eager" : this.htmlLoading} decoding="async" width=${$(this.width || void 0)} height=${$(this.height || void 0)}>`
|
|
717
814
|
)}</div>`;
|
|
718
815
|
}
|
|
719
816
|
render() {
|
|
@@ -723,136 +820,139 @@ let n = class extends Re {
|
|
|
723
820
|
"container--empty": this.isEmpty,
|
|
724
821
|
"container--loading": this.loading,
|
|
725
822
|
"container--resizing": this.resizable && this.isResizeActive
|
|
726
|
-
})} style=${
|
|
823
|
+
})} style=${Pe({
|
|
727
824
|
"--easing": this.easeCSSVariable
|
|
728
|
-
})} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${
|
|
825
|
+
})} data-empty-label=${this.localize.term("emptyImage")} @click=${this.startResizing} @keydown=${this.handleKeyDown}><cx-resize-observer @cx-resize=${this.handleResize}><div part="highlighter" tabindex=${$(this.highlighterTabindex)} role=${this.highlighterRole} aria-label=${t} aria-roledescription=${this.localize.term("image")} class=${S(this.isEmpty ? {} : this.getHighlighterClass(this.isError))} @click=${this.handleClickAction} @mouseenter=${this.handleMouseEnter} @mouseleave=${this.handleMouseLeave} @blur=${this.handleBlur}>${T(
|
|
729
826
|
this.isEmpty,
|
|
730
827
|
() => X,
|
|
731
|
-
() =>
|
|
828
|
+
() => T(
|
|
732
829
|
this.effect === K.Jump || this.effect === K.Zoom,
|
|
733
830
|
() => L`<cx-popup class="popup-container" strategy="absolute" active placement="center" sync="both">${this.renderContent()}</cx-popup>`,
|
|
734
831
|
() => this.renderContent()
|
|
735
832
|
)
|
|
736
|
-
)}<div class="zoom-image-container">${
|
|
833
|
+
)}<div class="zoom-image-container">${T(
|
|
737
834
|
i,
|
|
738
835
|
() => L`<img part="zoom-image" class=${S({
|
|
739
836
|
"zoom-image": !0,
|
|
740
837
|
"zoom-image--hidden": !this.isZoomed
|
|
741
|
-
})} src=${this.applyRetryCacheBust(this.currentSrc) || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin=${
|
|
742
|
-
)}</div>${
|
|
838
|
+
})} src=${this.applyRetryCacheBust(this.currentSrc) || this.placeholder} alt="" aria-hidden="true" decoding="async" draggable="false" crossorigin=${$(this.crossorigin)}>`
|
|
839
|
+
)}</div>${T(this.showPlaceholderSkeleton, () => L`<slot name="skeleton" part="skeleton"><div class=${S({
|
|
743
840
|
skeleton: !0
|
|
744
841
|
})}><cx-skeleton effect="none" role="status" aria-live="polite" aria-label=${this.localize.term("loading")}></cx-skeleton></div></slot>`)}
|
|
745
|
-
${
|
|
842
|
+
${T(this.isError, () => L`<slot name="fallback" part="fallback"><cx-space class=${S({ 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>${T(this.resizable && this.isResizeActive, () => this.renderResizer())}</div>`;
|
|
746
843
|
}
|
|
747
844
|
};
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
"cx-icon":
|
|
752
|
-
"cx-popup":
|
|
845
|
+
O = /* @__PURE__ */ new WeakMap();
|
|
846
|
+
a.styles = [He, $e, Ge];
|
|
847
|
+
a.dependencies = {
|
|
848
|
+
"cx-icon": Fe,
|
|
849
|
+
"cx-popup": _e,
|
|
753
850
|
"cx-resize-observer": Ne,
|
|
754
851
|
"cx-skeleton": We,
|
|
755
852
|
"cx-space": Be
|
|
756
853
|
};
|
|
757
|
-
|
|
854
|
+
l([
|
|
758
855
|
G(".image")
|
|
759
|
-
],
|
|
760
|
-
|
|
856
|
+
], a.prototype, "imageElement", 2);
|
|
857
|
+
l([
|
|
761
858
|
G(".zoom-image")
|
|
762
|
-
],
|
|
763
|
-
|
|
859
|
+
], a.prototype, "zoomImageElement", 2);
|
|
860
|
+
l([
|
|
764
861
|
G(".highlighter")
|
|
765
|
-
],
|
|
766
|
-
|
|
862
|
+
], a.prototype, "highlighterElement", 2);
|
|
863
|
+
l([
|
|
767
864
|
E()
|
|
768
|
-
],
|
|
769
|
-
|
|
865
|
+
], a.prototype, "isLoaded", 2);
|
|
866
|
+
l([
|
|
770
867
|
E()
|
|
771
|
-
],
|
|
772
|
-
|
|
868
|
+
], a.prototype, "isError", 2);
|
|
869
|
+
l([
|
|
773
870
|
E()
|
|
774
|
-
],
|
|
775
|
-
|
|
871
|
+
], a.prototype, "isRetrying", 2);
|
|
872
|
+
l([
|
|
776
873
|
E()
|
|
777
|
-
],
|
|
778
|
-
|
|
874
|
+
], a.prototype, "retryIndex", 2);
|
|
875
|
+
l([
|
|
779
876
|
p({ reflect: !0, type: String })
|
|
780
|
-
],
|
|
781
|
-
|
|
877
|
+
], a.prototype, "src", 2);
|
|
878
|
+
l([
|
|
782
879
|
p({ reflect: !0, type: String })
|
|
783
|
-
],
|
|
784
|
-
|
|
880
|
+
], a.prototype, "srcset", 2);
|
|
881
|
+
l([
|
|
785
882
|
p({ reflect: !0, type: String })
|
|
786
|
-
],
|
|
787
|
-
|
|
883
|
+
], a.prototype, "sizes", 2);
|
|
884
|
+
l([
|
|
788
885
|
p({ reflect: !0, type: String })
|
|
789
|
-
],
|
|
790
|
-
|
|
886
|
+
], a.prototype, "placeholder", 2);
|
|
887
|
+
l([
|
|
791
888
|
p({ reflect: !0, type: String })
|
|
792
|
-
],
|
|
793
|
-
|
|
889
|
+
], a.prototype, "alt", 2);
|
|
890
|
+
l([
|
|
794
891
|
p({ attribute: "object-fit", reflect: !0 })
|
|
795
|
-
],
|
|
796
|
-
|
|
892
|
+
], a.prototype, "objectFit", 2);
|
|
893
|
+
l([
|
|
894
|
+
p({ attribute: "crop-focus", reflect: !0 })
|
|
895
|
+
], a.prototype, "cropFocus", 2);
|
|
896
|
+
l([
|
|
797
897
|
p({ reflect: !0, type: Boolean })
|
|
798
|
-
],
|
|
799
|
-
|
|
898
|
+
], a.prototype, "skeleton", 2);
|
|
899
|
+
l([
|
|
800
900
|
p({ reflect: !0, type: Boolean })
|
|
801
|
-
],
|
|
802
|
-
|
|
901
|
+
], a.prototype, "fallback", 2);
|
|
902
|
+
l([
|
|
803
903
|
p({ attribute: "can-zoom", reflect: !0, type: Boolean })
|
|
804
|
-
],
|
|
805
|
-
|
|
904
|
+
], a.prototype, "canZoom", 2);
|
|
905
|
+
l([
|
|
806
906
|
p({ reflect: !0, type: Boolean })
|
|
807
|
-
],
|
|
808
|
-
|
|
907
|
+
], a.prototype, "loading", 2);
|
|
908
|
+
l([
|
|
809
909
|
p({ reflect: !0, type: Boolean })
|
|
810
|
-
],
|
|
811
|
-
|
|
910
|
+
], a.prototype, "block", 2);
|
|
911
|
+
l([
|
|
812
912
|
p({ attribute: "html-loading", reflect: !0, type: String })
|
|
813
|
-
],
|
|
814
|
-
|
|
913
|
+
], a.prototype, "htmlLoading", 2);
|
|
914
|
+
l([
|
|
815
915
|
p({ attribute: "no-crossorigin", reflect: !0, type: Boolean })
|
|
816
|
-
],
|
|
817
|
-
|
|
916
|
+
], a.prototype, "noCrossorigin", 2);
|
|
917
|
+
l([
|
|
818
918
|
p({ attribute: "click-handler-type", reflect: !0, type: String })
|
|
819
|
-
],
|
|
820
|
-
|
|
919
|
+
], a.prototype, "clickHandlerType", 2);
|
|
920
|
+
l([
|
|
821
921
|
p({ attribute: "retry-on-error", reflect: !0, type: Boolean })
|
|
822
|
-
],
|
|
823
|
-
|
|
922
|
+
], a.prototype, "retryOnError", 2);
|
|
923
|
+
l([
|
|
824
924
|
p({ attribute: "max-retries", type: Number })
|
|
825
|
-
],
|
|
826
|
-
|
|
925
|
+
], a.prototype, "maxRetries", 2);
|
|
926
|
+
l([
|
|
827
927
|
E()
|
|
828
|
-
],
|
|
829
|
-
|
|
928
|
+
], a.prototype, "isZoomed", 2);
|
|
929
|
+
l([
|
|
830
930
|
E()
|
|
831
|
-
],
|
|
832
|
-
|
|
931
|
+
], a.prototype, "imageRatio", 2);
|
|
932
|
+
l([
|
|
833
933
|
E()
|
|
834
|
-
],
|
|
835
|
-
|
|
934
|
+
], a.prototype, "parsedAlt", 2);
|
|
935
|
+
l([
|
|
836
936
|
E()
|
|
837
|
-
],
|
|
838
|
-
|
|
937
|
+
], a.prototype, "parsedAltDarkMode", 2);
|
|
938
|
+
l([
|
|
839
939
|
M("isLoaded"),
|
|
840
940
|
M("canZoom", { waitUntilFirstUpdate: !0 })
|
|
841
|
-
],
|
|
842
|
-
|
|
941
|
+
], a.prototype, "handleCanZoomChange", 1);
|
|
942
|
+
l([
|
|
843
943
|
M("objectFit", { waitUntilFirstUpdate: !0 })
|
|
844
|
-
],
|
|
845
|
-
|
|
944
|
+
], a.prototype, "handleObjectFitChange", 1);
|
|
945
|
+
l([
|
|
846
946
|
M("src"),
|
|
847
947
|
M("srcDarkMode")
|
|
848
|
-
],
|
|
849
|
-
|
|
948
|
+
], a.prototype, "handleSrcChange", 1);
|
|
949
|
+
l([
|
|
850
950
|
Oe(100)
|
|
851
|
-
],
|
|
852
|
-
|
|
951
|
+
], a.prototype, "updateLastPatchedWidth", 1);
|
|
952
|
+
a = l([
|
|
853
953
|
Ae("cx-image")
|
|
854
|
-
],
|
|
954
|
+
], a);
|
|
855
955
|
export {
|
|
856
|
-
|
|
956
|
+
a as C,
|
|
857
957
|
I as a
|
|
858
958
|
};
|