@orangelogic/design-system 3.20.0 → 3.22.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.BnE0FbUH.js → asset-link-format.B5E00Je6.js} +656 -629
- package/library/chunks/{button.D1YIxtv-.js → button.cbDkxJHn.js} +3 -3
- package/library/chunks/button.styles.D3GdfF7I.js +5 -0
- package/library/chunks/{color-swatch-group.GEu5gVrg.js → color-swatch-group.BxmlqPZe.js} +3354 -2925
- package/library/chunks/color.CIHdfM_a.js +187 -0
- package/library/chunks/{confirm-popover.CJXyEa5A.js → confirm-popover.Dvgoz-oA.js} +4 -4
- package/library/chunks/content-builder.CBBdfVOl.js +55 -0
- package/library/chunks/{dialog.BbQ4Du0M.js → dialog.BvSMV36r.js} +2 -2
- package/library/chunks/{document-viewer.Bkf3JbWk.js → document-viewer.Dm9pcb0o.js} +11 -10
- package/library/chunks/{dom.DL-cNKsj.js → dom.D0lSUoEI.js} +1 -1
- package/library/chunks/{dot-pagination.CJRAtM51.js → dot-pagination.CukHxNBk.js} +1 -1
- package/library/chunks/{folder-select.D8_6pC8Y.js → folder-select.BQqwlVaD.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.2RH_nPmz.js} +132 -90
- package/library/chunks/{i18n.rtxrs1c1.js → i18n.BSPmBQ73.js} +94 -12
- package/library/chunks/{icon-button.CbUddcgI.js → icon-button.DV5Fks8j.js} +1 -1
- package/library/chunks/{iframe.y7iCAVZP.js → iframe.ddX2kGu3.js} +1 -1
- package/library/chunks/{image.A2hE1WoV.js → image.BM7bPTub.js} +407 -276
- package/library/chunks/index.SMjV3S2z.js +1130 -0
- package/library/chunks/{input.D1FFprPl.js → input.7pumTpdu.js} +3 -3
- package/library/chunks/{markdown.Dd_GFJK8.js → markdown.LHSzm035.js} +3 -3
- package/library/chunks/{menu-item.0TbnDEDp.js → menu-item.DsJZ7i0J.js} +1 -1
- package/library/chunks/{option.CyorNG0S.js → option.C5f7yDqN.js} +1 -1
- package/library/chunks/{pagination.D0BeaEIi.js → pagination.CMwpX60h.js} +36 -32
- package/library/chunks/{position-picker.DjnhxIKF.js → position-picker.qkbJlboF.js} +12 -0
- package/library/chunks/{resizable-component.styles.CAfXABBc.js → resizable-component.styles.kMFDlGgv.js} +2 -2
- package/library/chunks/responsive.BmBJSzC4.js +17 -0
- package/library/chunks/{string.Demn8Xmk.js → string.CfI2ejyR.js} +3 -3
- package/library/chunks/{tab-group.C98CWzEH.js → tab-group.D_QAkP8s.js} +312 -310
- package/library/chunks/toast.D3AW3RWv.js +94 -0
- package/library/chunks/transformation.BwQ_H-4q.js +351 -0
- package/library/chunks/{tree.DB-QLic1.js → tree.BHrf5WIc.js} +1 -1
- package/library/chunks/{types.DrJgdbwu.js → types.BDM-NtAR.js} +58295 -35623
- 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 +4 -4
- 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 +5 -5
- 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 +5 -4
- 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 +26 -24
- 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 +5277 -5209
- 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 +30 -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 +24 -0
- package/library/packages/atoms/src/index.d.ts +1 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +2 -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/components/table-toolbar/table-dropdown-filter.d.ts +2 -0
- package/library/packages/hybrid/table-core/src/table/table.d.ts +45 -5
- 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/icon-picker/icon-picker.d.ts +5 -6
- 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/asset-link-format/asset-link-format.d.ts +6 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +5 -1
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +32 -11
- 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 +32 -9
- 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 +3 -1
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +4 -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 +168 -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 +11 -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 +176 -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/fetch-image/fetch-image.d.ts +12 -0
- 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 +73 -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 +88 -2
- 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 +514 -156
- package/library/utils.js +417 -397
- 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.Ct-dh3Y5.js +0 -20122
- package/library/chunks/toast.CGIDPKV8.js +0 -109
- package/library/chunks/transformation.OaRYixzE.js +0 -385
- 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 -4
- /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,49 +1,50 @@
|
|
|
1
1
|
import "../components/cropper.js";
|
|
2
|
-
import { C as
|
|
3
|
-
import
|
|
4
|
-
import { C as
|
|
5
|
-
import { n as h, C as
|
|
6
|
-
import { h as E, a as Dt, C as Nt, S as
|
|
2
|
+
import { C as Y } from "./button.cbDkxJHn.js";
|
|
3
|
+
import q from "../components/space.js";
|
|
4
|
+
import { C as U } from "./typography.BLYdTF0n.js";
|
|
5
|
+
import { n as h, C as B } from "./lib-cortex-element.CVMmyPMC.js";
|
|
6
|
+
import { h as E, a as Dt, C as Nt, S as Jt, b as te, c as ee, d as ie } from "./endpoints.mJ5S-tIs.js";
|
|
7
7
|
import "./browser.BHOCIF_A.js";
|
|
8
8
|
import { i as j, x as C, E as Ot } from "./lit-element.jLBm65_O.js";
|
|
9
|
-
import "./form.
|
|
10
|
-
import { L as V } from "./i18n.
|
|
11
|
-
import { a as
|
|
9
|
+
import "./form.LpappO1d.js";
|
|
10
|
+
import { L as V } from "./i18n.BSPmBQ73.js";
|
|
11
|
+
import { a as se } from "./string.CfI2ejyR.js";
|
|
12
12
|
import "./date-picker.BGHn6qg8.js";
|
|
13
|
-
import { a as bt, r as Lt, b as
|
|
13
|
+
import { a as bt, r as Lt, b as ae, c as oe, d as dt } from "./transformation.BwQ_H-4q.js";
|
|
14
|
+
import "./content-builder.CBBdfVOl.js";
|
|
14
15
|
import "./unsafe-html.Dff7-rCx.js";
|
|
15
|
-
import { b as
|
|
16
|
+
import { b as re } from "./_baseUniq.lwMgmtt2.js";
|
|
16
17
|
import { c as G } from "./component.styles.CAS3c9pM.js";
|
|
17
|
-
import { M as
|
|
18
|
-
import { v as
|
|
19
|
-
import { P as N } from "./position-picker.
|
|
18
|
+
import { M as rt, U as o, T as m } from "./asset-link-format.ClaYu_v8.js";
|
|
19
|
+
import { v as ne } from "./v4.CKZ6klMF.js";
|
|
20
|
+
import { P as N } from "./position-picker.qkbJlboF.js";
|
|
20
21
|
import { c as Q } from "./custom-element.L4WJXn1j.js";
|
|
21
22
|
import { w as _ } from "./watch.DJF5K-8U.js";
|
|
22
|
-
import { s as Mt, a as
|
|
23
|
+
import { s as Mt, a as ut } from "./number.Cx2ncfJJ.js";
|
|
23
24
|
import { r as $ } from "./state.CSDxrqLd.js";
|
|
24
25
|
import { n as M } from "./when.Dr1es41R.js";
|
|
25
26
|
import at from "../components/details.js";
|
|
26
|
-
import
|
|
27
|
+
import qt from "../components/divider.js";
|
|
27
28
|
import { C as ot } from "./icon.BLXWp6CU.js";
|
|
28
|
-
import { C as Ct } from "./icon-button.
|
|
29
|
-
import { C as kt } from "./input.
|
|
30
|
-
import { C as yt } from "./option.
|
|
29
|
+
import { C as Ct } from "./icon-button.DV5Fks8j.js";
|
|
30
|
+
import { C as kt } from "./input.7pumTpdu.js";
|
|
31
|
+
import { C as yt } from "./option.C5f7yDqN.js";
|
|
31
32
|
import St from "../components/select.js";
|
|
32
|
-
import
|
|
33
|
-
import { c as
|
|
34
|
-
import { e as
|
|
35
|
-
import { c as
|
|
33
|
+
import he from "../components/position-picker.js";
|
|
34
|
+
import { c as le } from "./image.Y5c_hFx8.js";
|
|
35
|
+
import { e as J } from "./query.BBf1UFkC.js";
|
|
36
|
+
import { c as nt } from "./repeat.CFjcER6_.js";
|
|
36
37
|
import { o as O } from "./style-map.llVFPd__.js";
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
function
|
|
41
|
-
return t && t.length ?
|
|
38
|
+
import Ut from "../components/tooltip.js";
|
|
39
|
+
import ce from "../components/button-group.js";
|
|
40
|
+
import pe from "../components/checkbox.js";
|
|
41
|
+
function de(t) {
|
|
42
|
+
return t && t.length ? re(t) : [];
|
|
42
43
|
}
|
|
43
|
-
function
|
|
44
|
+
function Bt(t) {
|
|
44
45
|
return typeof t == "object" && t !== null && "URI" in t;
|
|
45
46
|
}
|
|
46
|
-
const
|
|
47
|
+
const ue = {
|
|
47
48
|
artist: "Artist",
|
|
48
49
|
color: "Color",
|
|
49
50
|
createDate: "CreateDate",
|
|
@@ -65,7 +66,7 @@ const de = {
|
|
|
65
66
|
systemIdentifier: "SystemIdentifier",
|
|
66
67
|
text: "Text",
|
|
67
68
|
title: "Title"
|
|
68
|
-
},
|
|
69
|
+
}, me = /* @__PURE__ */ new Set(["mediaDate", "createDate", "editDate"]);
|
|
69
70
|
function wt(t) {
|
|
70
71
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(t) && !/^(?:OR|AND|NOT)$/.test(t) ? t : `"${t.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
|
|
71
72
|
}
|
|
@@ -73,10 +74,10 @@ function It(t, e) {
|
|
|
73
74
|
const s = (Array.isArray(e) ? e : [e]).map((a) => `${t}:${wt(a)}`);
|
|
74
75
|
return s.length > 1 ? `(${s.join(" OR ")})` : s[0] ?? "";
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
+
function fe(t, e) {
|
|
77
78
|
return (Array.isArray(e) ? e : [e]).map((s) => `${t}${s.operator}${s.value}`).join(" AND ");
|
|
78
79
|
}
|
|
79
|
-
function
|
|
80
|
+
function ge(t) {
|
|
80
81
|
const e = [];
|
|
81
82
|
for (const i of Object.keys(t)) {
|
|
82
83
|
const s = i, a = t[s];
|
|
@@ -89,11 +90,11 @@ function fe(t) {
|
|
|
89
90
|
e.push(It(n, l));
|
|
90
91
|
continue;
|
|
91
92
|
}
|
|
92
|
-
const r =
|
|
93
|
+
const r = ue[s];
|
|
93
94
|
if (r) {
|
|
94
|
-
if (
|
|
95
|
+
if (me.has(s)) {
|
|
95
96
|
e.push(
|
|
96
|
-
|
|
97
|
+
fe(r, a)
|
|
97
98
|
);
|
|
98
99
|
continue;
|
|
99
100
|
}
|
|
@@ -117,26 +118,26 @@ function fe(t) {
|
|
|
117
118
|
}
|
|
118
119
|
return e.join(" AND ");
|
|
119
120
|
}
|
|
120
|
-
function
|
|
121
|
+
function mt(t) {
|
|
121
122
|
if ("and" in t)
|
|
122
|
-
return t.and.map(
|
|
123
|
+
return t.and.map(mt).filter(Boolean).join(" AND ");
|
|
123
124
|
if ("or" in t) {
|
|
124
|
-
const e = t.or.map(
|
|
125
|
+
const e = t.or.map(mt).filter(Boolean);
|
|
125
126
|
return e.length > 1 ? `(${e.join(" OR ")})` : e[0] ?? "";
|
|
126
127
|
}
|
|
127
128
|
if ("not" in t) {
|
|
128
|
-
const e =
|
|
129
|
+
const e = mt(t.not);
|
|
129
130
|
return e ? `NOT (${e})` : "";
|
|
130
131
|
}
|
|
131
|
-
return
|
|
132
|
+
return ge(t);
|
|
132
133
|
}
|
|
133
|
-
const
|
|
134
|
+
const xe = "CoreField.LargeSizePreview", ht = "CoreField.DocType", Rt = "Document.Title", ye = "Document.CaptionLong", lt = "Document.FileExtension", ft = "CoreField.FileSize", Et = "CoreField.Identifier", Bi = "CoreField.MaxHeight", ji = "CoreField.MaxWidth", gt = "Document.RecordID", Ht = "CoreField.DocSubType", xt = "CoreField.TitleWithFallback", st = "CoreField.OriginalFileName", jt = "__width", Vt = "__height", Se = "CoreField.OriginalPreview", Vi = "Document.DocSubType", Gi = "Document.InPoint", Qi = "Document.OutPoint", Tt = {
|
|
134
135
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
135
136
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
136
137
|
}, Gt = {
|
|
137
|
-
[
|
|
138
|
-
[
|
|
139
|
-
},
|
|
138
|
+
[xe]: Tt.DEFAULT_VIEW_SIZE,
|
|
139
|
+
[Se]: Tt.ORIGINAL_VIEW_SIZE
|
|
140
|
+
}, ve = Object.fromEntries(
|
|
140
141
|
Object.entries(Gt).map(([t, e]) => [
|
|
141
142
|
e,
|
|
142
143
|
t
|
|
@@ -145,13 +146,13 @@ const ge = "CoreField.LargeSizePreview", ut = "CoreField.DocType", Rt = "Documen
|
|
|
145
146
|
function Ae(t) {
|
|
146
147
|
return Gt[t] ?? t;
|
|
147
148
|
}
|
|
148
|
-
function ve(t) {
|
|
149
|
-
return t === gt ? [Rt, st] : [Ae(t)];
|
|
150
|
-
}
|
|
151
149
|
function ze(t) {
|
|
150
|
+
return t === xt ? [Rt, st] : [Ae(t)];
|
|
151
|
+
}
|
|
152
|
+
function be(t) {
|
|
152
153
|
const e = {};
|
|
153
154
|
for (const [i, s] of Object.entries(t)) {
|
|
154
|
-
const a =
|
|
155
|
+
const a = ve[i] ?? i;
|
|
155
156
|
e[a] = s;
|
|
156
157
|
}
|
|
157
158
|
return e;
|
|
@@ -159,9 +160,9 @@ function ze(t) {
|
|
|
159
160
|
function Qt(t, e, i) {
|
|
160
161
|
t[i] = H(e, i);
|
|
161
162
|
const s = e[i];
|
|
162
|
-
return s != null &&
|
|
163
|
+
return s != null && Bt(s) && (typeof s.Width == "number" && s.Width > 0 && (t[`${i}${jt}`] = String(s.Width)), typeof s.Height == "number" && s.Height > 0 && (t[`${i}${Vt}`] = String(s.Height))), t;
|
|
163
164
|
}
|
|
164
|
-
function
|
|
165
|
+
function we(t) {
|
|
165
166
|
const e = new URLSearchParams();
|
|
166
167
|
for (const [i, s] of Object.entries(t))
|
|
167
168
|
s != null && (Array.isArray(s) ? s.forEach((a) => e.append(i, String(a))) : e.append(i, String(s)));
|
|
@@ -177,14 +178,14 @@ async function Xt({
|
|
|
177
178
|
pageNumber: n,
|
|
178
179
|
query: l,
|
|
179
180
|
securityByPassToken: p,
|
|
180
|
-
siteUrl:
|
|
181
|
-
sort:
|
|
182
|
-
token:
|
|
183
|
-
useSession:
|
|
181
|
+
siteUrl: c,
|
|
182
|
+
sort: g,
|
|
183
|
+
token: u,
|
|
184
|
+
useSession: y
|
|
184
185
|
}) {
|
|
185
|
-
const
|
|
186
|
-
const
|
|
187
|
-
return d && (
|
|
186
|
+
const S = i?.flatMap(ze), d = i?.includes(xt) ?? !1, v = (F) => {
|
|
187
|
+
const z = be(F);
|
|
188
|
+
return d && (z[xt] = H(z, Rt) || H(z, st)), z;
|
|
188
189
|
}, k = {
|
|
189
190
|
/*
|
|
190
191
|
* Opt-in only, never inferred from `isSiteBuilder`: that flag picks the endpoint, and callers set
|
|
@@ -194,43 +195,43 @@ async function Xt({
|
|
|
194
195
|
*/
|
|
195
196
|
Consistency: t || void 0,
|
|
196
197
|
CountPerPage: e,
|
|
197
|
-
Fields:
|
|
198
|
+
Fields: de(S),
|
|
198
199
|
Format: "json",
|
|
199
200
|
GetPermanentAssetsPaths: s || void 0,
|
|
200
201
|
PageNumber: n,
|
|
201
|
-
Query:
|
|
202
|
+
Query: mt(l),
|
|
202
203
|
SecurityByPassToken: p || void 0,
|
|
203
|
-
Sort:
|
|
204
|
-
UseSession:
|
|
205
|
-
},
|
|
204
|
+
Sort: g || void 0,
|
|
205
|
+
UseSession: y || void 0
|
|
206
|
+
}, b = a === "POST";
|
|
206
207
|
try {
|
|
207
208
|
return (await E.request({
|
|
208
|
-
baseURL:
|
|
209
|
-
headers:
|
|
209
|
+
baseURL: c,
|
|
210
|
+
headers: u ? { Authorization: `Bearer ${u}` } : void 0,
|
|
210
211
|
method: a,
|
|
211
212
|
// POST large RecordID queries as a urlencoded body to dodge the ~2KB URL cap;
|
|
212
213
|
// GET keeps the same fields on the query string.
|
|
213
|
-
...
|
|
214
|
+
...b ? { data: we(k) } : { params: k, paramsSerializer: { indexes: null } },
|
|
214
215
|
responseType: "json",
|
|
215
216
|
transformResponse: [
|
|
216
217
|
...Array.isArray(E.defaults.transformResponse) ? E.defaults.transformResponse : [],
|
|
217
|
-
r ? (
|
|
218
|
-
items: (
|
|
219
|
-
sort:
|
|
220
|
-
totalCount:
|
|
221
|
-
}) : (
|
|
222
|
-
items: (
|
|
223
|
-
sort:
|
|
224
|
-
totalCount:
|
|
218
|
+
r ? (z) => ({
|
|
219
|
+
items: (z.results?.Items ?? []).map(v),
|
|
220
|
+
sort: z.results?.GlobalInfo?.Sort ?? "",
|
|
221
|
+
totalCount: z.results?.GlobalInfo?.TotalCount ?? 0
|
|
222
|
+
}) : (z) => ({
|
|
223
|
+
items: (z.APIResponse?.Items ?? []).map(v),
|
|
224
|
+
sort: z.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
225
|
+
totalCount: z.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
225
226
|
})
|
|
226
227
|
],
|
|
227
|
-
url: r ? Nt.SEARCH_ASSETS :
|
|
228
|
+
url: r ? Nt.SEARCH_ASSETS : Jt["4.0"]
|
|
228
229
|
})).data;
|
|
229
230
|
} catch {
|
|
230
231
|
return { items: [], sort: "", totalCount: 0 };
|
|
231
232
|
}
|
|
232
233
|
}
|
|
233
|
-
async function
|
|
234
|
+
async function Ce({
|
|
234
235
|
assetId: t,
|
|
235
236
|
extension: e,
|
|
236
237
|
format: i,
|
|
@@ -246,7 +247,7 @@ async function we({
|
|
|
246
247
|
params: {
|
|
247
248
|
SourceAssetFormat: i,
|
|
248
249
|
SourceAssetRecordID: t,
|
|
249
|
-
TargetExtension:
|
|
250
|
+
TargetExtension: se(e),
|
|
250
251
|
Token: a || void 0,
|
|
251
252
|
Transformations: r,
|
|
252
253
|
UseSession: n || void 0
|
|
@@ -262,14 +263,14 @@ async function we({
|
|
|
262
263
|
return null;
|
|
263
264
|
}
|
|
264
265
|
}
|
|
265
|
-
const
|
|
266
|
-
function
|
|
266
|
+
const ke = 50;
|
|
267
|
+
function Re(t, e) {
|
|
267
268
|
const i = [];
|
|
268
269
|
for (let s = 0; s < t.length; s += e)
|
|
269
270
|
i.push(t.slice(s, s + e));
|
|
270
271
|
return i;
|
|
271
272
|
}
|
|
272
|
-
async function
|
|
273
|
+
async function $e({
|
|
273
274
|
consistency: t,
|
|
274
275
|
extraFields: e,
|
|
275
276
|
getPermanentAssetsPaths: i,
|
|
@@ -284,10 +285,10 @@ async function Re({
|
|
|
284
285
|
...l,
|
|
285
286
|
st,
|
|
286
287
|
Rt,
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
],
|
|
290
|
-
|
|
288
|
+
ye,
|
|
289
|
+
gt
|
|
290
|
+
], c = Re(a, ke), g = await Promise.all(
|
|
291
|
+
c.map(
|
|
291
292
|
(d) => Xt({
|
|
292
293
|
consistency: t,
|
|
293
294
|
countPerPage: d.length,
|
|
@@ -301,26 +302,26 @@ async function Re({
|
|
|
301
302
|
token: n
|
|
302
303
|
})
|
|
303
304
|
)
|
|
304
|
-
),
|
|
305
|
+
), u = new Map(a.map((d, v) => [d, v])), y = g.flatMap((d) => d.items).map((d) => ({
|
|
305
306
|
name: H(d, st),
|
|
306
|
-
recordId: H(d,
|
|
307
|
+
recordId: H(d, gt),
|
|
307
308
|
...l.reduce(
|
|
308
309
|
(v, k) => Qt(v, d, k),
|
|
309
310
|
{}
|
|
310
311
|
)
|
|
311
312
|
})).sort(
|
|
312
|
-
(d, v) => (
|
|
313
|
-
),
|
|
313
|
+
(d, v) => (u.get(d.recordId) ?? 1 / 0) - (u.get(v.recordId) ?? 1 / 0)
|
|
314
|
+
), S = g.reduce(
|
|
314
315
|
(d, v) => d + v.totalCount,
|
|
315
316
|
0
|
|
316
317
|
);
|
|
317
|
-
return { facets: [], items:
|
|
318
|
+
return { facets: [], items: y, totalCount: S };
|
|
318
319
|
}
|
|
319
320
|
function H(t, e) {
|
|
320
321
|
const i = t[e];
|
|
321
|
-
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) :
|
|
322
|
+
return i == null ? "" : typeof i == "string" ? i : typeof i == "number" || typeof i == "boolean" ? String(i) : Bt(i) ? i.URI : "";
|
|
322
323
|
}
|
|
323
|
-
async function
|
|
324
|
+
async function Pe({
|
|
324
325
|
consistency: t,
|
|
325
326
|
countPerPage: e,
|
|
326
327
|
directParentFolderIdentifier: i,
|
|
@@ -330,14 +331,14 @@ async function $e({
|
|
|
330
331
|
limitedDocTypes: n,
|
|
331
332
|
pageNumber: l,
|
|
332
333
|
parentFolderIdentifier: p,
|
|
333
|
-
searchTerm:
|
|
334
|
-
securityByPassToken:
|
|
335
|
-
sortOrder:
|
|
336
|
-
token:
|
|
334
|
+
searchTerm: c,
|
|
335
|
+
securityByPassToken: g,
|
|
336
|
+
sortOrder: u,
|
|
337
|
+
token: y
|
|
337
338
|
}) {
|
|
338
339
|
if (!i && !p)
|
|
339
340
|
return { facets: [], items: [], totalCount: 0 };
|
|
340
|
-
const
|
|
341
|
+
const S = (s?.filter((b) => b && typeof b == "string") ?? []).map((b) => b.replace("%20", " ")), d = {
|
|
341
342
|
directParentFolderIdentifier: i,
|
|
342
343
|
parentFolderIdentifier: p,
|
|
343
344
|
...n && n.length > 0 ? { docType: n } : {}
|
|
@@ -345,38 +346,38 @@ async function $e({
|
|
|
345
346
|
consistency: t,
|
|
346
347
|
countPerPage: e,
|
|
347
348
|
fields: [
|
|
348
|
-
...
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
349
|
+
...S,
|
|
350
|
+
xt,
|
|
351
|
+
ft,
|
|
352
|
+
ht,
|
|
352
353
|
Ht,
|
|
353
354
|
Et,
|
|
354
|
-
|
|
355
|
-
|
|
355
|
+
lt,
|
|
356
|
+
gt,
|
|
356
357
|
st
|
|
357
358
|
],
|
|
358
359
|
getPermanentAssetsPaths: a,
|
|
359
360
|
isSiteBuilder: r,
|
|
360
361
|
pageNumber: l,
|
|
361
362
|
query: d,
|
|
362
|
-
securityByPassToken:
|
|
363
|
+
securityByPassToken: g,
|
|
363
364
|
sort: void 0,
|
|
364
|
-
token:
|
|
365
|
-
}), k = v.items.map((
|
|
366
|
-
let
|
|
367
|
-
|
|
368
|
-
const
|
|
365
|
+
token: y
|
|
366
|
+
}), k = v.items.map((b) => {
|
|
367
|
+
let F = H(b, lt);
|
|
368
|
+
F && !F.startsWith(".") && (F = "." + F);
|
|
369
|
+
const z = H(b, gt);
|
|
369
370
|
return {
|
|
370
|
-
docSubType: H(
|
|
371
|
-
docType: H(
|
|
372
|
-
extension:
|
|
373
|
-
id:
|
|
374
|
-
identifier: H(
|
|
375
|
-
name: H(
|
|
376
|
-
recordId:
|
|
377
|
-
size: H(
|
|
378
|
-
...
|
|
379
|
-
(
|
|
371
|
+
docSubType: H(b, Ht),
|
|
372
|
+
docType: H(b, ht) || "",
|
|
373
|
+
extension: F,
|
|
374
|
+
id: z,
|
|
375
|
+
identifier: H(b, Et),
|
|
376
|
+
name: H(b, st),
|
|
377
|
+
recordId: z,
|
|
378
|
+
size: H(b, ft) || "0 MB",
|
|
379
|
+
...S.reduce(
|
|
380
|
+
(et, it) => Qt(et, b, it),
|
|
380
381
|
{}
|
|
381
382
|
)
|
|
382
383
|
};
|
|
@@ -387,7 +388,7 @@ async function $e({
|
|
|
387
388
|
totalCount: v.totalCount
|
|
388
389
|
};
|
|
389
390
|
}
|
|
390
|
-
async function
|
|
391
|
+
async function Fe({
|
|
391
392
|
autoCropMode: t,
|
|
392
393
|
cropHeight: e,
|
|
393
394
|
cropWidth: i,
|
|
@@ -422,7 +423,7 @@ async function Pe({
|
|
|
422
423
|
return null;
|
|
423
424
|
}
|
|
424
425
|
}
|
|
425
|
-
async function
|
|
426
|
+
async function Xi({
|
|
426
427
|
assetRecordId: t,
|
|
427
428
|
isSiteBuilder: e,
|
|
428
429
|
siteUrl: i,
|
|
@@ -453,13 +454,13 @@ async function Gi({
|
|
|
453
454
|
width: l.width
|
|
454
455
|
})) ?? []
|
|
455
456
|
],
|
|
456
|
-
url: e ? Nt.GET_AVAILABLE_PROXIES :
|
|
457
|
+
url: e ? Nt.GET_AVAILABLE_PROXIES : ie
|
|
457
458
|
})).data;
|
|
458
459
|
} catch {
|
|
459
460
|
return [];
|
|
460
461
|
}
|
|
461
462
|
}
|
|
462
|
-
async function
|
|
463
|
+
async function Zi({
|
|
463
464
|
siteUrl: t
|
|
464
465
|
} = {}) {
|
|
465
466
|
try {
|
|
@@ -480,13 +481,13 @@ async function Qi({
|
|
|
480
481
|
formatsByDocType: i.formatsByDocType ?? {}
|
|
481
482
|
}
|
|
482
483
|
],
|
|
483
|
-
url:
|
|
484
|
+
url: te
|
|
484
485
|
})).data;
|
|
485
486
|
} catch {
|
|
486
487
|
return { formatsByDocType: {} };
|
|
487
488
|
}
|
|
488
489
|
}
|
|
489
|
-
async function
|
|
490
|
+
async function Ki({
|
|
490
491
|
recordIds: t,
|
|
491
492
|
rightsToCheck: e
|
|
492
493
|
}) {
|
|
@@ -502,14 +503,14 @@ async function Xi({
|
|
|
502
503
|
params: { RecordIDs: t, RightsToCheck: e },
|
|
503
504
|
paramsSerializer: { indexes: null },
|
|
504
505
|
responseType: "json",
|
|
505
|
-
url:
|
|
506
|
+
url: ee.GET_AUTHORIZED_OBJECTS
|
|
506
507
|
});
|
|
507
508
|
return s;
|
|
508
509
|
} catch {
|
|
509
510
|
return i;
|
|
510
511
|
}
|
|
511
512
|
}
|
|
512
|
-
const
|
|
513
|
+
const At = 20, Z = "TR1", ct = "TRX", _e = /* @__PURE__ */ new Set([".gif"]), Me = /* @__PURE__ */ new Set([
|
|
513
514
|
".avif",
|
|
514
515
|
".bmp",
|
|
515
516
|
".gif",
|
|
@@ -520,53 +521,57 @@ const vt = 20, it = "TR1", xt = "TRX", Fe = /* @__PURE__ */ new Set([".gif"]), _
|
|
|
520
521
|
".svg",
|
|
521
522
|
".webp"
|
|
522
523
|
]);
|
|
523
|
-
function
|
|
524
|
+
function Zt(t) {
|
|
524
525
|
const e = t.toLowerCase(), i = e.startsWith(".") ? e : `.${e}`;
|
|
525
|
-
return
|
|
526
|
+
return Me.has(i);
|
|
527
|
+
}
|
|
528
|
+
function Ie(t, e) {
|
|
529
|
+
return t !== void 0 && t !== "" && t !== rt.Image ? !1 : !e || Zt(e);
|
|
526
530
|
}
|
|
527
531
|
function Wt({
|
|
528
532
|
autoFormat: t,
|
|
529
533
|
buildSrcset: e,
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
534
|
+
docType: i,
|
|
535
|
+
extension: s,
|
|
536
|
+
format: a,
|
|
537
|
+
item: r,
|
|
538
|
+
manualFormat: n,
|
|
539
|
+
size: l
|
|
535
540
|
}) {
|
|
536
|
-
const
|
|
537
|
-
const
|
|
538
|
-
if (!
|
|
541
|
+
const p = s?.toLowerCase() ?? "", c = p.startsWith(".") ? p : `.${p}`, g = `path_${Z}`, u = (d, v) => {
|
|
542
|
+
const k = r[d];
|
|
543
|
+
if (!k)
|
|
539
544
|
return;
|
|
540
|
-
const
|
|
541
|
-
autoFormat: !
|
|
542
|
-
extension:
|
|
543
|
-
format:
|
|
544
|
-
}) :
|
|
545
|
+
const b = r[`${d}${jt}`], F = r[`${d}${Vt}`], z = t ? bt(k, [], {
|
|
546
|
+
autoFormat: !n,
|
|
547
|
+
extension: p,
|
|
548
|
+
format: v
|
|
549
|
+
}) : k;
|
|
545
550
|
return {
|
|
546
|
-
maxHeight:
|
|
547
|
-
maxWidth:
|
|
548
|
-
src:
|
|
549
|
-
srcset: e ?
|
|
550
|
-
extension:
|
|
551
|
-
format:
|
|
552
|
-
maxWidth:
|
|
551
|
+
maxHeight: F,
|
|
552
|
+
maxWidth: b,
|
|
553
|
+
src: z,
|
|
554
|
+
srcset: e ? ae(z, {
|
|
555
|
+
extension: p,
|
|
556
|
+
format: v,
|
|
557
|
+
maxWidth: oe(n, b)
|
|
553
558
|
}) : ""
|
|
554
559
|
};
|
|
555
560
|
};
|
|
556
|
-
if (!
|
|
557
|
-
const
|
|
558
|
-
return
|
|
561
|
+
if (!n) {
|
|
562
|
+
const d = Lt(p, l), v = `path_${d}`;
|
|
563
|
+
return u(v, d) ?? u(g, Z) ?? {};
|
|
559
564
|
}
|
|
560
|
-
const
|
|
561
|
-
return
|
|
565
|
+
const y = a ? `path_${a}` : void 0;
|
|
566
|
+
return y && r[y] ? a !== ct || Ie(i, p) ? u(y, a) ?? {} : u(g, Z) ?? {} : !!p && _e.has(c) ? u(`path_${ct}`, ct) ?? u(g, Z) ?? {} : u(g, Z) ?? {};
|
|
562
567
|
}
|
|
563
|
-
class
|
|
568
|
+
class Yi {
|
|
564
569
|
constructor(e, i) {
|
|
565
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize =
|
|
570
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = 1 / 0, this.pageSize = At, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
566
571
|
const s = i?.maxEnd;
|
|
567
572
|
this.maxEnd = typeof s == "number" && Number.isFinite(s) && s >= 0 ? Math.floor(s) : 1 / 0;
|
|
568
573
|
const a = i?.pageSize;
|
|
569
|
-
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) :
|
|
574
|
+
this.pageSize = typeof a == "number" && Number.isFinite(a) && a >= 1 ? Math.floor(a) : At, this.authToken = i?.token, this.securityByPassToken = i?.securityByPassToken, this.isSiteBuilder = i?.isSiteBuilder ?? !1, this.autoFormat = i?.autoFormat ?? !1, this.buildSrcset = i?.buildSrcset ?? !1, this.consistency = i?.consistency;
|
|
570
575
|
}
|
|
571
576
|
get totalDataCount() {
|
|
572
577
|
return this.totalCount;
|
|
@@ -584,7 +589,7 @@ class Zi {
|
|
|
584
589
|
* Shrinking is ignored once pages are cached: collapsing already has what it needs.
|
|
585
590
|
*/
|
|
586
591
|
setPageSize(e) {
|
|
587
|
-
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
592
|
+
const i = Number.isFinite(e) && e >= 1 ? Math.floor(e) : At;
|
|
588
593
|
if (this.pageSize === i)
|
|
589
594
|
return;
|
|
590
595
|
const s = this.fetchedPages.size > 0;
|
|
@@ -605,24 +610,24 @@ class Zi {
|
|
|
605
610
|
const l = this.requestEpoch;
|
|
606
611
|
if (!this.folderId || l !== this.requestEpoch)
|
|
607
612
|
return this.data;
|
|
608
|
-
const p = s ? `path_${s}` : void 0,
|
|
613
|
+
const p = s ? `path_${s}` : void 0, c = `path_${Z}`, g = `path_${ct}`, u = [
|
|
609
614
|
...new Set(
|
|
610
|
-
[p,
|
|
615
|
+
[p, c, g].filter(
|
|
611
616
|
(d) => !!d
|
|
612
617
|
)
|
|
613
618
|
)
|
|
614
|
-
],
|
|
615
|
-
for (let d =
|
|
619
|
+
], y = Math.floor(r / this.pageSize) + 1, S = Math.floor(e / this.pageSize) + 1;
|
|
620
|
+
for (let d = y; d <= S; d++) {
|
|
616
621
|
if (this.fetchedPages.has(d))
|
|
617
622
|
continue;
|
|
618
|
-
const v = await
|
|
623
|
+
const v = await Pe({
|
|
619
624
|
consistency: this.consistency,
|
|
620
625
|
countPerPage: this.pageSize,
|
|
621
626
|
directParentFolderIdentifier: this.folderId,
|
|
622
|
-
extraFields: [...i, ...
|
|
627
|
+
extraFields: [...i, ...u],
|
|
623
628
|
getPermanentAssetsPaths: !0,
|
|
624
629
|
isSiteBuilder: this.isSiteBuilder,
|
|
625
|
-
limitedDocTypes: [
|
|
630
|
+
limitedDocTypes: [rt.Image, rt.Audio, rt.Video, rt.Multimedia],
|
|
626
631
|
pageNumber: d,
|
|
627
632
|
searchTerm: "",
|
|
628
633
|
securityByPassToken: this.securityByPassToken,
|
|
@@ -632,45 +637,46 @@ class Zi {
|
|
|
632
637
|
if (l !== this.requestEpoch)
|
|
633
638
|
return this.data;
|
|
634
639
|
if (this.fetchedPages.add(d), !this.totalCount && v.totalCount) {
|
|
635
|
-
const
|
|
636
|
-
this.totalCount =
|
|
640
|
+
const b = Math.min(this.maxEnd, v.totalCount);
|
|
641
|
+
this.totalCount = b, this.data = Array.from({ length: b }, () => ({
|
|
637
642
|
alt: "",
|
|
638
|
-
id: `temp-${
|
|
643
|
+
id: `temp-${ne()}`,
|
|
639
644
|
name: "",
|
|
640
645
|
src: ""
|
|
641
646
|
}));
|
|
642
647
|
}
|
|
643
648
|
const k = (d - 1) * this.pageSize;
|
|
644
|
-
for (let
|
|
645
|
-
const
|
|
646
|
-
if (
|
|
647
|
-
const
|
|
648
|
-
maxHeight:
|
|
649
|
-
maxWidth:
|
|
650
|
-
src:
|
|
651
|
-
srcset:
|
|
649
|
+
for (let b = 0; b < v.items.length; b++) {
|
|
650
|
+
const F = k + b;
|
|
651
|
+
if (F < this.data.length) {
|
|
652
|
+
const z = v.items[b], {
|
|
653
|
+
maxHeight: et,
|
|
654
|
+
maxWidth: it,
|
|
655
|
+
src: Kt,
|
|
656
|
+
srcset: Yt
|
|
652
657
|
} = Wt({
|
|
653
658
|
autoFormat: this.autoFormat,
|
|
654
659
|
buildSrcset: this.buildSrcset,
|
|
655
|
-
|
|
660
|
+
docType: z.docType,
|
|
661
|
+
extension: z.extension,
|
|
656
662
|
format: s,
|
|
657
|
-
item:
|
|
663
|
+
item: z,
|
|
658
664
|
manualFormat: a,
|
|
659
|
-
size:
|
|
665
|
+
size: z.size
|
|
660
666
|
});
|
|
661
|
-
let
|
|
662
|
-
|
|
663
|
-
alt:
|
|
664
|
-
docType:
|
|
665
|
-
extension:
|
|
666
|
-
id:
|
|
667
|
-
maxHeight:
|
|
668
|
-
maxWidth:
|
|
669
|
-
name:
|
|
670
|
-
src:
|
|
667
|
+
let pt = Kt, Pt = Yt;
|
|
668
|
+
pt && n && n.length > 0 && (pt = bt(pt, n), Pt = ""), this.data[F] = {
|
|
669
|
+
alt: z.name,
|
|
670
|
+
docType: z.docType,
|
|
671
|
+
extension: z.extension,
|
|
672
|
+
id: z.id,
|
|
673
|
+
maxHeight: et,
|
|
674
|
+
maxWidth: it,
|
|
675
|
+
name: z.name,
|
|
676
|
+
src: pt,
|
|
671
677
|
srcset: Pt,
|
|
672
678
|
...i.reduce(
|
|
673
|
-
(Ft, _t) => (Ft[_t] =
|
|
679
|
+
(Ft, _t) => (Ft[_t] = z[_t] ?? "", Ft),
|
|
674
680
|
{}
|
|
675
681
|
)
|
|
676
682
|
};
|
|
@@ -687,28 +693,28 @@ class Zi {
|
|
|
687
693
|
manualFormat: n = !0,
|
|
688
694
|
minLimit: l = 5,
|
|
689
695
|
noPlaceholders: p = !1,
|
|
690
|
-
transformations:
|
|
696
|
+
transformations: c
|
|
691
697
|
}) {
|
|
692
698
|
(!this.folderId || this.folderId !== s) && (this.folderId = s, this.resetFolderState()), a && this.resetPageCache();
|
|
693
|
-
const
|
|
699
|
+
const g = Math.max(5, l), u = e, y = e + g, S = [...i];
|
|
694
700
|
await this.fetchImages({
|
|
695
|
-
end:
|
|
696
|
-
extraFields:
|
|
701
|
+
end: y,
|
|
702
|
+
extraFields: S.filter((k) => k !== ""),
|
|
697
703
|
format: r,
|
|
698
704
|
manualFormat: n,
|
|
699
|
-
start:
|
|
700
|
-
transformations:
|
|
705
|
+
start: u,
|
|
706
|
+
transformations: c
|
|
701
707
|
});
|
|
702
|
-
let d = e -
|
|
708
|
+
let d = e - g;
|
|
703
709
|
d < 0 && (this.totalCount === 0 ? d = 0 : d = Math.max(0, this.totalCount + d));
|
|
704
|
-
const v = d +
|
|
710
|
+
const v = d + g;
|
|
705
711
|
return await this.fetchImages({
|
|
706
712
|
end: v,
|
|
707
|
-
extraFields:
|
|
713
|
+
extraFields: S.filter((k) => k !== ""),
|
|
708
714
|
format: r,
|
|
709
715
|
manualFormat: n,
|
|
710
716
|
start: d,
|
|
711
|
-
transformations:
|
|
717
|
+
transformations: c
|
|
712
718
|
}), p ? this.data.filter((k) => k.id && !k.id.startsWith("temp-")) : this.data;
|
|
713
719
|
}
|
|
714
720
|
async fetchImagesByIDs({
|
|
@@ -720,49 +726,50 @@ class Zi {
|
|
|
720
726
|
}) {
|
|
721
727
|
if (a.length === 0)
|
|
722
728
|
return [];
|
|
723
|
-
const n = i ? `path_${i}` : void 0, l = `path_${
|
|
729
|
+
const n = i ? `path_${i}` : void 0, l = `path_${Z}`, p = `path_${ct}`, c = [
|
|
724
730
|
...new Set(
|
|
725
731
|
[n, l, p].filter(
|
|
726
|
-
(
|
|
732
|
+
(S) => !!S
|
|
727
733
|
)
|
|
728
734
|
)
|
|
729
|
-
],
|
|
730
|
-
return (await
|
|
735
|
+
], g = [lt, ft], u = [...e, ht];
|
|
736
|
+
return (await $e({
|
|
731
737
|
consistency: this.consistency,
|
|
732
|
-
extraFields: [...
|
|
738
|
+
extraFields: [...u, ...c, ...g].filter((S) => S !== ""),
|
|
733
739
|
getPermanentAssetsPaths: !0,
|
|
734
740
|
isSiteBuilder: this.isSiteBuilder,
|
|
735
741
|
recordIds: a,
|
|
736
742
|
securityByPassToken: this.securityByPassToken,
|
|
737
743
|
token: this.authToken
|
|
738
|
-
})).items.map((
|
|
744
|
+
})).items.map((S) => {
|
|
739
745
|
const {
|
|
740
746
|
maxHeight: d,
|
|
741
747
|
maxWidth: v,
|
|
742
748
|
src: k,
|
|
743
|
-
srcset:
|
|
749
|
+
srcset: b
|
|
744
750
|
} = Wt({
|
|
745
751
|
autoFormat: this.autoFormat,
|
|
746
752
|
buildSrcset: this.buildSrcset,
|
|
747
|
-
|
|
753
|
+
docType: S[ht],
|
|
754
|
+
extension: S[lt],
|
|
748
755
|
format: i,
|
|
749
|
-
item:
|
|
756
|
+
item: S,
|
|
750
757
|
manualFormat: s,
|
|
751
|
-
size:
|
|
758
|
+
size: S[ft]
|
|
752
759
|
});
|
|
753
|
-
let
|
|
754
|
-
return
|
|
755
|
-
alt:
|
|
756
|
-
docType:
|
|
757
|
-
extension:
|
|
758
|
-
id:
|
|
760
|
+
let F = k, z = b;
|
|
761
|
+
return F && r && r.length > 0 && (F = bt(F, r), z = ""), {
|
|
762
|
+
alt: S.name,
|
|
763
|
+
docType: S[ht],
|
|
764
|
+
extension: S[lt] || "",
|
|
765
|
+
id: S.recordId,
|
|
759
766
|
maxHeight: d,
|
|
760
767
|
maxWidth: v,
|
|
761
|
-
name:
|
|
762
|
-
src:
|
|
763
|
-
srcset:
|
|
764
|
-
...
|
|
765
|
-
(
|
|
768
|
+
name: S.name,
|
|
769
|
+
src: F,
|
|
770
|
+
srcset: z,
|
|
771
|
+
...u.reduce(
|
|
772
|
+
(et, it) => (et[it] = S[it] ?? "", et),
|
|
766
773
|
{}
|
|
767
774
|
)
|
|
768
775
|
};
|
|
@@ -777,18 +784,18 @@ class Zi {
|
|
|
777
784
|
noPlaceholders: n = !1,
|
|
778
785
|
page: l,
|
|
779
786
|
pageSize: p = 10,
|
|
780
|
-
transformations:
|
|
787
|
+
transformations: c
|
|
781
788
|
}) {
|
|
782
789
|
(!this.folderId || this.folderId !== i) && (this.folderId = i, this.resetFolderState()), s && this.resetPageCache();
|
|
783
|
-
const
|
|
790
|
+
const g = l * p, u = g + p - 1;
|
|
784
791
|
return await this.fetchImages({
|
|
785
|
-
end:
|
|
792
|
+
end: u,
|
|
786
793
|
extraFields: e,
|
|
787
794
|
format: a,
|
|
788
795
|
manualFormat: r,
|
|
789
|
-
start:
|
|
790
|
-
transformations:
|
|
791
|
-
}), n ? this.data.filter((
|
|
796
|
+
start: g,
|
|
797
|
+
transformations: c
|
|
798
|
+
}), n ? this.data.filter((y) => y.id && !y.id.startsWith("temp-")) : this.data;
|
|
792
799
|
}
|
|
793
800
|
async *fetchImagesInFolderByChunk({
|
|
794
801
|
chunkSize: e = 10,
|
|
@@ -799,9 +806,9 @@ class Zi {
|
|
|
799
806
|
format: n,
|
|
800
807
|
manualFormat: l = !0,
|
|
801
808
|
start: p = 0,
|
|
802
|
-
transformations:
|
|
809
|
+
transformations: c
|
|
803
810
|
}) {
|
|
804
|
-
const
|
|
811
|
+
const g = Math.max(1, e);
|
|
805
812
|
if ((!this.folderId || this.folderId !== a) && (this.folderId = a, this.resetFolderState()), r && this.resetPageCache(), i !== -1) {
|
|
806
813
|
await this.fetchImages({
|
|
807
814
|
end: i,
|
|
@@ -809,27 +816,27 @@ class Zi {
|
|
|
809
816
|
format: n,
|
|
810
817
|
manualFormat: l,
|
|
811
818
|
start: p,
|
|
812
|
-
transformations:
|
|
819
|
+
transformations: c
|
|
813
820
|
}), yield this.data;
|
|
814
821
|
return;
|
|
815
822
|
}
|
|
816
|
-
let
|
|
823
|
+
let u = p, y = p + g;
|
|
817
824
|
if (await this.fetchImages({
|
|
818
|
-
end:
|
|
825
|
+
end: y,
|
|
819
826
|
extraFields: s,
|
|
820
827
|
format: n,
|
|
821
828
|
manualFormat: l,
|
|
822
|
-
start:
|
|
823
|
-
transformations:
|
|
824
|
-
}), yield this.data, !(!this.totalCount || this.totalCount <=
|
|
825
|
-
for (;
|
|
826
|
-
|
|
827
|
-
end:
|
|
829
|
+
start: u,
|
|
830
|
+
transformations: c
|
|
831
|
+
}), yield this.data, !(!this.totalCount || this.totalCount <= y))
|
|
832
|
+
for (; y < this.totalCount; )
|
|
833
|
+
u = y, y = Math.min(y + g, this.totalCount), await this.fetchImages({
|
|
834
|
+
end: y,
|
|
828
835
|
extraFields: s,
|
|
829
836
|
format: n,
|
|
830
837
|
manualFormat: l,
|
|
831
|
-
start:
|
|
832
|
-
transformations:
|
|
838
|
+
start: u,
|
|
839
|
+
transformations: c
|
|
833
840
|
}), yield this.data;
|
|
834
841
|
}
|
|
835
842
|
hostConnected() {
|
|
@@ -844,13 +851,13 @@ class Zi {
|
|
|
844
851
|
this.resetPageCache();
|
|
845
852
|
}
|
|
846
853
|
}
|
|
847
|
-
const
|
|
848
|
-
var
|
|
849
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
854
|
+
const Ee = j`.asset-link-format__details{--header-padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__details::part(icon){width:var(--cx-font-size-3x-large);height:var(--cx-font-size-3x-large);background-color:var(--cx-color-neutral-100);border-radius:var(--cx-border-radius-large);color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-large);justify-content:center;align-items:center;display:flex}.asset-link-format__details::part(input-label){color:var(--cx-color-neutral-400);margin-inline-start:var(--cx-spacing-small)}.asset-link-format__header{padding:var(--cx-spacing-medium)}.asset-link-format__section-header{padding:0 var(--cx-spacing-medium);border-top:var(--section-header-border-width,1px) solid var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-50)}.asset-link-format__undo,.asset-link-format__reset{--color:var(--cx-color-primary);--background-color:transparent}`, He = j`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}`;
|
|
855
|
+
var Te = Object.defineProperty, We = Object.getOwnPropertyDescriptor, w = (t, e, i, s) => {
|
|
856
|
+
for (var a = s > 1 ? void 0 : s ? We(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
850
857
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
851
|
-
return s && a &&
|
|
858
|
+
return s && a && Te(e, i, a), a;
|
|
852
859
|
};
|
|
853
|
-
let A = class extends
|
|
860
|
+
let A = class extends B {
|
|
854
861
|
constructor() {
|
|
855
862
|
super(...arguments), this.localize = new V(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.percentageWidth = 0, this.percentageHeight = 0, this.unit = o.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.lastAppliedSetting = {
|
|
856
863
|
[o.Pixel]: {
|
|
@@ -964,7 +971,7 @@ let A = class extends q {
|
|
|
964
971
|
const [s, a] = e.split(":").map(Number);
|
|
965
972
|
if (this.unit === o.Pixel) {
|
|
966
973
|
let r = s, n = a;
|
|
967
|
-
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } =
|
|
974
|
+
Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && ({ height: n, width: r } = le(
|
|
968
975
|
this.maxWidth,
|
|
969
976
|
this.maxHeight,
|
|
970
977
|
s,
|
|
@@ -1086,7 +1093,7 @@ let A = class extends q {
|
|
|
1086
1093
|
!this.noRatioModes,
|
|
1087
1094
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${O({
|
|
1088
1095
|
width: "100%"
|
|
1089
|
-
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
1096
|
+
})} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${nt(
|
|
1090
1097
|
t,
|
|
1091
1098
|
(i) => i.value,
|
|
1092
1099
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1095,7 +1102,7 @@ let A = class extends q {
|
|
|
1095
1102
|
e.length > 0,
|
|
1096
1103
|
() => C`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`
|
|
1097
1104
|
)}
|
|
1098
|
-
${
|
|
1105
|
+
${nt(
|
|
1099
1106
|
e,
|
|
1100
1107
|
(i) => i.value,
|
|
1101
1108
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1113,7 +1120,7 @@ let A = class extends q {
|
|
|
1113
1120
|
this.focusModes.length > 0,
|
|
1114
1121
|
() => C`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${O({
|
|
1115
1122
|
width: "100%"
|
|
1116
|
-
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${
|
|
1123
|
+
})} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${nt(
|
|
1117
1124
|
this.focusModes,
|
|
1118
1125
|
(i) => i.value,
|
|
1119
1126
|
({ label: i, value: s }) => C`<cx-option value=${s}>${i}</cx-option>`
|
|
@@ -1127,117 +1134,117 @@ let A = class extends q {
|
|
|
1127
1134
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1128
1135
|
}
|
|
1129
1136
|
};
|
|
1130
|
-
A.styles = [G,
|
|
1137
|
+
A.styles = [G, He];
|
|
1131
1138
|
A.dependencies = {
|
|
1132
|
-
"cx-button":
|
|
1139
|
+
"cx-button": Y,
|
|
1133
1140
|
"cx-details": at,
|
|
1134
|
-
"cx-divider":
|
|
1141
|
+
"cx-divider": qt,
|
|
1135
1142
|
"cx-icon": ot,
|
|
1136
1143
|
"cx-icon-button": Ct,
|
|
1137
1144
|
"cx-input": kt,
|
|
1138
1145
|
"cx-option": yt,
|
|
1139
|
-
"cx-position-picker":
|
|
1146
|
+
"cx-position-picker": he,
|
|
1140
1147
|
"cx-select": St,
|
|
1141
|
-
"cx-space":
|
|
1142
|
-
"cx-typography":
|
|
1148
|
+
"cx-space": q,
|
|
1149
|
+
"cx-typography": U
|
|
1143
1150
|
};
|
|
1144
|
-
|
|
1145
|
-
|
|
1151
|
+
w([
|
|
1152
|
+
J(".details")
|
|
1146
1153
|
], A.prototype, "base", 2);
|
|
1147
|
-
|
|
1148
|
-
|
|
1154
|
+
w([
|
|
1155
|
+
J("cx-position-picker")
|
|
1149
1156
|
], A.prototype, "positionPicker", 2);
|
|
1150
|
-
|
|
1157
|
+
w([
|
|
1151
1158
|
h({ reflect: !0, type: Boolean })
|
|
1152
1159
|
], A.prototype, "open", 2);
|
|
1153
|
-
|
|
1160
|
+
w([
|
|
1154
1161
|
h({ reflect: !0, type: Number })
|
|
1155
1162
|
], A.prototype, "width", 2);
|
|
1156
|
-
|
|
1163
|
+
w([
|
|
1157
1164
|
h({ reflect: !0, type: Number })
|
|
1158
1165
|
], A.prototype, "height", 2);
|
|
1159
|
-
|
|
1166
|
+
w([
|
|
1160
1167
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1161
1168
|
], A.prototype, "maxWidth", 2);
|
|
1162
|
-
|
|
1169
|
+
w([
|
|
1163
1170
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1164
1171
|
], A.prototype, "maxHeight", 2);
|
|
1165
|
-
|
|
1172
|
+
w([
|
|
1166
1173
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1167
1174
|
], A.prototype, "ratioWidth", 2);
|
|
1168
|
-
|
|
1175
|
+
w([
|
|
1169
1176
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1170
1177
|
], A.prototype, "ratioHeight", 2);
|
|
1171
|
-
|
|
1178
|
+
w([
|
|
1172
1179
|
h({ attribute: "percentage-width", reflect: !0, type: Number })
|
|
1173
1180
|
], A.prototype, "percentageWidth", 2);
|
|
1174
|
-
|
|
1181
|
+
w([
|
|
1175
1182
|
h({ attribute: "percentage-height", reflect: !0, type: Number })
|
|
1176
1183
|
], A.prototype, "percentageHeight", 2);
|
|
1177
|
-
|
|
1184
|
+
w([
|
|
1178
1185
|
h({ reflect: !0, type: String })
|
|
1179
1186
|
], A.prototype, "unit", 2);
|
|
1180
|
-
|
|
1187
|
+
w([
|
|
1181
1188
|
h({ attribute: "disabled-apply", reflect: !0, type: Boolean })
|
|
1182
1189
|
], A.prototype, "disabledApply", 2);
|
|
1183
|
-
|
|
1190
|
+
w([
|
|
1184
1191
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1185
1192
|
], A.prototype, "noRatioModes", 2);
|
|
1186
|
-
|
|
1193
|
+
w([
|
|
1187
1194
|
h({ attribute: "show-position-picker", reflect: !0, type: Boolean })
|
|
1188
1195
|
], A.prototype, "showPositionPicker", 2);
|
|
1189
|
-
|
|
1196
|
+
w([
|
|
1190
1197
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1191
1198
|
], A.prototype, "lastAppliedSetting", 2);
|
|
1192
|
-
|
|
1199
|
+
w([
|
|
1193
1200
|
h({ reflect: !0, type: Boolean })
|
|
1194
1201
|
], A.prototype, "loading", 2);
|
|
1195
|
-
|
|
1202
|
+
w([
|
|
1196
1203
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
1197
1204
|
], A.prototype, "cropModes", 2);
|
|
1198
|
-
|
|
1205
|
+
w([
|
|
1199
1206
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
1200
1207
|
], A.prototype, "focusModes", 2);
|
|
1201
|
-
|
|
1208
|
+
w([
|
|
1202
1209
|
h({ attribute: "focus-mode", reflect: !0, type: String })
|
|
1203
1210
|
], A.prototype, "focusMode", 2);
|
|
1204
|
-
|
|
1211
|
+
w([
|
|
1205
1212
|
h({ attribute: "crop-mode", reflect: !0, type: String })
|
|
1206
1213
|
], A.prototype, "cropMode", 2);
|
|
1207
|
-
|
|
1214
|
+
w([
|
|
1208
1215
|
h({ reflect: !0, type: String })
|
|
1209
1216
|
], A.prototype, "position", 2);
|
|
1210
|
-
|
|
1217
|
+
w([
|
|
1211
1218
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1212
1219
|
], A.prototype, "keepAspectRatio", 2);
|
|
1213
|
-
|
|
1220
|
+
w([
|
|
1214
1221
|
$()
|
|
1215
1222
|
], A.prototype, "invalidWidth", 2);
|
|
1216
|
-
|
|
1223
|
+
w([
|
|
1217
1224
|
$()
|
|
1218
1225
|
], A.prototype, "invalidHeight", 2);
|
|
1219
|
-
|
|
1226
|
+
w([
|
|
1220
1227
|
$()
|
|
1221
1228
|
], A.prototype, "aspectRatio", 2);
|
|
1222
|
-
|
|
1229
|
+
w([
|
|
1223
1230
|
_("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1224
1231
|
_("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1225
1232
|
_("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1226
1233
|
_("keepAspectRatio")
|
|
1227
1234
|
], A.prototype, "handleCropModeChange", 1);
|
|
1228
|
-
|
|
1235
|
+
w([
|
|
1229
1236
|
_("open", { waitUntilFirstUpdate: !0 })
|
|
1230
1237
|
], A.prototype, "handleOpenChange", 1);
|
|
1231
|
-
A =
|
|
1238
|
+
A = w([
|
|
1232
1239
|
Q("cx-asset-link-format-crop")
|
|
1233
1240
|
], A);
|
|
1234
|
-
const
|
|
1235
|
-
var
|
|
1236
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1241
|
+
const De = j`.extension{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border:solid 1px var(--cx-color-neutral-200);background-color:var(--cx-color-neutral-0);& cx-select{flex:1;width:100%}}`;
|
|
1242
|
+
var Ne = Object.defineProperty, Oe = Object.getOwnPropertyDescriptor, $t = (t, e, i, s) => {
|
|
1243
|
+
for (var a = s > 1 ? void 0 : s ? Oe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1237
1244
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1238
|
-
return s && a &&
|
|
1245
|
+
return s && a && Ne(e, i, a), a;
|
|
1239
1246
|
};
|
|
1240
|
-
let
|
|
1247
|
+
let K = class extends B {
|
|
1241
1248
|
constructor() {
|
|
1242
1249
|
super(...arguments), this.localize = new V(this), this.value = "", this.items = [];
|
|
1243
1250
|
}
|
|
@@ -1248,37 +1255,37 @@ let Z = class extends q {
|
|
|
1248
1255
|
});
|
|
1249
1256
|
}
|
|
1250
1257
|
render() {
|
|
1251
|
-
return C`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${
|
|
1258
|
+
return C`<cx-space direction="vertical" spacing="small" class="extension"><cx-typography variant="body2">${this.localize.term("extension")}</cx-typography><cx-select data-label=${this.localize.term("extension")} data-testid="cx-asset-link-format-extension-select" value=${this.value} hoist @cx-change=${this.handleExtensionChange}>${nt(
|
|
1252
1259
|
this.items,
|
|
1253
1260
|
(t) => t.value,
|
|
1254
1261
|
(t) => C`<cx-option value=${t.value}>${t.displayName}</cx-option>`
|
|
1255
1262
|
)}</cx-select></cx-space>`;
|
|
1256
1263
|
}
|
|
1257
1264
|
};
|
|
1258
|
-
|
|
1259
|
-
|
|
1265
|
+
K.styles = [G, De];
|
|
1266
|
+
K.dependencies = {
|
|
1260
1267
|
"cx-option": yt,
|
|
1261
1268
|
"cx-select": St,
|
|
1262
|
-
"cx-space":
|
|
1263
|
-
"cx-typography":
|
|
1269
|
+
"cx-space": q,
|
|
1270
|
+
"cx-typography": U
|
|
1264
1271
|
};
|
|
1265
1272
|
$t([
|
|
1266
1273
|
h({ reflect: !0, type: String })
|
|
1267
|
-
],
|
|
1274
|
+
], K.prototype, "value", 2);
|
|
1268
1275
|
$t([
|
|
1269
1276
|
h({ reflect: !1, type: Array })
|
|
1270
|
-
],
|
|
1271
|
-
|
|
1277
|
+
], K.prototype, "items", 2);
|
|
1278
|
+
K = $t([
|
|
1272
1279
|
Q("cx-asset-link-format-extension")
|
|
1273
|
-
],
|
|
1274
|
-
const
|
|
1275
|
-
var
|
|
1280
|
+
], K);
|
|
1281
|
+
const Le = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1282
|
+
var qe = Object.defineProperty, Ue = Object.getOwnPropertyDescriptor, D = (t, e, i, s) => {
|
|
1276
1283
|
for (var a = s > 1 ? void 0 : s ? Ue(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1277
1284
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1278
|
-
return s && a &&
|
|
1285
|
+
return s && a && qe(e, i, a), a;
|
|
1279
1286
|
};
|
|
1280
1287
|
const zt = "auto";
|
|
1281
|
-
let I = class extends
|
|
1288
|
+
let I = class extends B {
|
|
1282
1289
|
constructor() {
|
|
1283
1290
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1284
1291
|
}
|
|
@@ -1337,7 +1344,7 @@ let I = class extends q {
|
|
|
1337
1344
|
t.target !== this.base && t.stopPropagation();
|
|
1338
1345
|
}
|
|
1339
1346
|
render() {
|
|
1340
|
-
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${
|
|
1347
|
+
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant="body2">${this.localize.term("format")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small" class="format"><cx-select data-label=${this.localize.term("imageFormat")} data-testid="cx-asset-link-format-proxy-select" value=${this.scopedValue} hoist @cx-change=${this.handleProxyChange} ?disabled=${this.loading}>${nt(
|
|
1341
1348
|
this.items,
|
|
1342
1349
|
(t) => t.id,
|
|
1343
1350
|
(t) => C`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`
|
|
@@ -1351,19 +1358,19 @@ let I = class extends q {
|
|
|
1351
1358
|
})} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1352
1359
|
}
|
|
1353
1360
|
};
|
|
1354
|
-
I.styles = [G,
|
|
1361
|
+
I.styles = [G, Le];
|
|
1355
1362
|
I.dependencies = {
|
|
1356
|
-
"cx-button":
|
|
1363
|
+
"cx-button": Y,
|
|
1357
1364
|
"cx-details": at,
|
|
1358
|
-
"cx-divider":
|
|
1365
|
+
"cx-divider": qt,
|
|
1359
1366
|
"cx-icon": ot,
|
|
1360
1367
|
"cx-option": yt,
|
|
1361
1368
|
"cx-select": St,
|
|
1362
|
-
"cx-space":
|
|
1363
|
-
"cx-typography":
|
|
1369
|
+
"cx-space": q,
|
|
1370
|
+
"cx-typography": U
|
|
1364
1371
|
};
|
|
1365
1372
|
D([
|
|
1366
|
-
|
|
1373
|
+
J(".details")
|
|
1367
1374
|
], I.prototype, "base", 2);
|
|
1368
1375
|
D([
|
|
1369
1376
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1397,12 +1404,12 @@ I = D([
|
|
|
1397
1404
|
Q("cx-asset-link-format-proxy")
|
|
1398
1405
|
], I);
|
|
1399
1406
|
const Be = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1400
|
-
var
|
|
1401
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1407
|
+
var je = Object.defineProperty, Ve = Object.getOwnPropertyDescriptor, tt = (t, e, i, s) => {
|
|
1408
|
+
for (var a = s > 1 ? void 0 : s ? Ve(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1402
1409
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1403
|
-
return s && a &&
|
|
1410
|
+
return s && a && je(e, i, a), a;
|
|
1404
1411
|
};
|
|
1405
|
-
let W = class extends
|
|
1412
|
+
let W = class extends B {
|
|
1406
1413
|
constructor() {
|
|
1407
1414
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 100, this.loading = !1, this.scopedValue = 100;
|
|
1408
1415
|
}
|
|
@@ -1455,42 +1462,42 @@ let W = class extends q {
|
|
|
1455
1462
|
};
|
|
1456
1463
|
W.styles = [G, Be];
|
|
1457
1464
|
W.dependencies = {
|
|
1458
|
-
"cx-button":
|
|
1465
|
+
"cx-button": Y,
|
|
1459
1466
|
"cx-details": at,
|
|
1460
1467
|
"cx-icon": ot,
|
|
1461
1468
|
"cx-input": kt,
|
|
1462
|
-
"cx-space":
|
|
1463
|
-
"cx-tooltip":
|
|
1464
|
-
"cx-typography":
|
|
1469
|
+
"cx-space": q,
|
|
1470
|
+
"cx-tooltip": Ut,
|
|
1471
|
+
"cx-typography": U
|
|
1465
1472
|
};
|
|
1466
|
-
|
|
1467
|
-
|
|
1473
|
+
tt([
|
|
1474
|
+
J(".details")
|
|
1468
1475
|
], W.prototype, "base", 2);
|
|
1469
|
-
|
|
1476
|
+
tt([
|
|
1470
1477
|
h({ reflect: !0, type: Boolean })
|
|
1471
1478
|
], W.prototype, "open", 2);
|
|
1472
|
-
|
|
1479
|
+
tt([
|
|
1473
1480
|
h({ reflect: !0, type: Number })
|
|
1474
1481
|
], W.prototype, "value", 2);
|
|
1475
|
-
|
|
1482
|
+
tt([
|
|
1476
1483
|
h({ reflect: !0, type: Boolean })
|
|
1477
1484
|
], W.prototype, "loading", 2);
|
|
1478
|
-
|
|
1485
|
+
tt([
|
|
1479
1486
|
$()
|
|
1480
1487
|
], W.prototype, "scopedValue", 2);
|
|
1481
|
-
|
|
1488
|
+
tt([
|
|
1482
1489
|
_("value")
|
|
1483
1490
|
], W.prototype, "handleValueChange", 1);
|
|
1484
|
-
W =
|
|
1491
|
+
W = tt([
|
|
1485
1492
|
Q("cx-asset-link-format-quality")
|
|
1486
1493
|
], W);
|
|
1487
|
-
const
|
|
1488
|
-
var
|
|
1489
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1494
|
+
const Ge = j`cx-details::part(base){border-bottom-width:0}cx-space{width:100%}cx-space cx-input{flex:1}.resize__unit-select{width:120px}.resize__input-group{flex:1;display:flex}`;
|
|
1495
|
+
var Qe = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, P = (t, e, i, s) => {
|
|
1496
|
+
for (var a = s > 1 ? void 0 : s ? Xe(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1490
1497
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1491
|
-
return s && a &&
|
|
1498
|
+
return s && a && Qe(e, i, a), a;
|
|
1492
1499
|
};
|
|
1493
|
-
let R = class extends
|
|
1500
|
+
let R = class extends B {
|
|
1494
1501
|
constructor() {
|
|
1495
1502
|
super(...arguments), this.localize = new V(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = o.Pixel, this.lastAppliedSetting = {
|
|
1496
1503
|
[o.Pixel]: { height: 0, width: 0 },
|
|
@@ -1645,85 +1652,85 @@ let R = class extends q {
|
|
|
1645
1652
|
})} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1646
1653
|
}
|
|
1647
1654
|
};
|
|
1648
|
-
R.styles = [G,
|
|
1655
|
+
R.styles = [G, Ge];
|
|
1649
1656
|
R.dependencies = {
|
|
1650
|
-
"cx-button":
|
|
1657
|
+
"cx-button": Y,
|
|
1651
1658
|
"cx-details": at,
|
|
1652
1659
|
"cx-icon": ot,
|
|
1653
1660
|
"cx-icon-button": Ct,
|
|
1654
1661
|
"cx-input": kt,
|
|
1655
1662
|
"cx-option": yt,
|
|
1656
1663
|
"cx-select": St,
|
|
1657
|
-
"cx-space":
|
|
1658
|
-
"cx-typography":
|
|
1664
|
+
"cx-space": q,
|
|
1665
|
+
"cx-typography": U
|
|
1659
1666
|
};
|
|
1660
|
-
|
|
1661
|
-
|
|
1667
|
+
P([
|
|
1668
|
+
J(".details")
|
|
1662
1669
|
], R.prototype, "base", 2);
|
|
1663
|
-
|
|
1670
|
+
P([
|
|
1664
1671
|
h({ reflect: !0, type: Boolean })
|
|
1665
1672
|
], R.prototype, "open", 2);
|
|
1666
|
-
|
|
1673
|
+
P([
|
|
1667
1674
|
h({ reflect: !0, type: Number })
|
|
1668
1675
|
], R.prototype, "width", 2);
|
|
1669
|
-
|
|
1676
|
+
P([
|
|
1670
1677
|
h({ reflect: !0, type: Number })
|
|
1671
1678
|
], R.prototype, "height", 2);
|
|
1672
|
-
|
|
1679
|
+
P([
|
|
1673
1680
|
h({ attribute: "max-width", reflect: !0, type: Number })
|
|
1674
1681
|
], R.prototype, "maxWidth", 2);
|
|
1675
|
-
|
|
1682
|
+
P([
|
|
1676
1683
|
h({ attribute: "max-height", reflect: !0, type: Number })
|
|
1677
1684
|
], R.prototype, "maxHeight", 2);
|
|
1678
|
-
|
|
1685
|
+
P([
|
|
1679
1686
|
h({ attribute: "ratio-width", reflect: !0, type: Number })
|
|
1680
1687
|
], R.prototype, "ratioWidth", 2);
|
|
1681
|
-
|
|
1688
|
+
P([
|
|
1682
1689
|
h({ attribute: "ratio-height", reflect: !0, type: Number })
|
|
1683
1690
|
], R.prototype, "ratioHeight", 2);
|
|
1684
|
-
|
|
1691
|
+
P([
|
|
1685
1692
|
h({ reflect: !0, type: String })
|
|
1686
1693
|
], R.prototype, "unit", 2);
|
|
1687
|
-
|
|
1694
|
+
P([
|
|
1688
1695
|
h({ attribute: "last-applied-setting", reflect: !1, type: Object })
|
|
1689
1696
|
], R.prototype, "lastAppliedSetting", 2);
|
|
1690
|
-
|
|
1697
|
+
P([
|
|
1691
1698
|
h({ reflect: !0, type: Boolean })
|
|
1692
1699
|
], R.prototype, "loading", 2);
|
|
1693
|
-
|
|
1700
|
+
P([
|
|
1694
1701
|
h({ attribute: "no-ratio-modes", reflect: !0, type: Boolean })
|
|
1695
1702
|
], R.prototype, "noRatioModes", 2);
|
|
1696
|
-
|
|
1703
|
+
P([
|
|
1697
1704
|
h({ attribute: "keep-aspect-ratio", reflect: !0, type: Boolean })
|
|
1698
1705
|
], R.prototype, "keepAspectRatio", 2);
|
|
1699
|
-
|
|
1706
|
+
P([
|
|
1700
1707
|
$()
|
|
1701
1708
|
], R.prototype, "invalidWidth", 2);
|
|
1702
|
-
|
|
1709
|
+
P([
|
|
1703
1710
|
$()
|
|
1704
1711
|
], R.prototype, "invalidHeight", 2);
|
|
1705
|
-
|
|
1712
|
+
P([
|
|
1706
1713
|
$()
|
|
1707
1714
|
], R.prototype, "aspectRatio", 2);
|
|
1708
|
-
|
|
1715
|
+
P([
|
|
1709
1716
|
_("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1710
1717
|
_("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1711
1718
|
_("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
1712
1719
|
_("keepAspectRatio")
|
|
1713
1720
|
], R.prototype, "handleCropModeChange", 1);
|
|
1714
|
-
|
|
1721
|
+
P([
|
|
1715
1722
|
_("open", { waitUntilFirstUpdate: !0 })
|
|
1716
1723
|
], R.prototype, "handleOpenChange", 1);
|
|
1717
|
-
R =
|
|
1724
|
+
R = P([
|
|
1718
1725
|
Q("cx-asset-link-format-resize")
|
|
1719
1726
|
], R);
|
|
1720
|
-
const
|
|
1721
|
-
var
|
|
1722
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1727
|
+
const Ze = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1728
|
+
var Ke = Object.defineProperty, Ye = Object.getOwnPropertyDescriptor, X = (t, e, i, s) => {
|
|
1729
|
+
for (var a = s > 1 ? void 0 : s ? Ye(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1723
1730
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1724
|
-
return s && a &&
|
|
1731
|
+
return s && a && Ke(e, i, a), a;
|
|
1725
1732
|
};
|
|
1726
|
-
let T = class extends
|
|
1733
|
+
let T = class extends B {
|
|
1727
1734
|
constructor() {
|
|
1728
1735
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1729
1736
|
}
|
|
@@ -1769,18 +1776,18 @@ let T = class extends q {
|
|
|
1769
1776
|
})} @cx-input=${this.handleRotationChange}></cx-input><cx-button data-testid="cx-asset-link-format-rotation-apply" variant="primary" ?disabled=${this.value === this.lastAppliedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1770
1777
|
}
|
|
1771
1778
|
};
|
|
1772
|
-
T.styles = [G,
|
|
1779
|
+
T.styles = [G, Ze];
|
|
1773
1780
|
T.dependencies = {
|
|
1774
|
-
"cx-button":
|
|
1775
|
-
"cx-button-group":
|
|
1781
|
+
"cx-button": Y,
|
|
1782
|
+
"cx-button-group": ce,
|
|
1776
1783
|
"cx-details": at,
|
|
1777
1784
|
"cx-icon": ot,
|
|
1778
1785
|
"cx-icon-button": Ct,
|
|
1779
|
-
"cx-space":
|
|
1780
|
-
"cx-typography":
|
|
1786
|
+
"cx-space": q,
|
|
1787
|
+
"cx-typography": U
|
|
1781
1788
|
};
|
|
1782
1789
|
X([
|
|
1783
|
-
|
|
1790
|
+
J(".details")
|
|
1784
1791
|
], T.prototype, "base", 2);
|
|
1785
1792
|
X([
|
|
1786
1793
|
h({ reflect: !0, type: Boolean })
|
|
@@ -1803,13 +1810,13 @@ X([
|
|
|
1803
1810
|
T = X([
|
|
1804
1811
|
Q("cx-asset-link-format-rotation")
|
|
1805
1812
|
], T);
|
|
1806
|
-
const
|
|
1807
|
-
var
|
|
1808
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1813
|
+
const Je = j`cx-details::part(base){border-bottom-width:0}`;
|
|
1814
|
+
var ti = Object.defineProperty, ei = Object.getOwnPropertyDescriptor, vt = (t, e, i, s) => {
|
|
1815
|
+
for (var a = s > 1 ? void 0 : s ? ei(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1809
1816
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1810
|
-
return s && a &&
|
|
1817
|
+
return s && a && ti(e, i, a), a;
|
|
1811
1818
|
};
|
|
1812
|
-
let L = class extends
|
|
1819
|
+
let L = class extends B {
|
|
1813
1820
|
constructor() {
|
|
1814
1821
|
super(...arguments), this.localize = new V(this), this.open = !1, this.value = !1;
|
|
1815
1822
|
}
|
|
@@ -1838,34 +1845,34 @@ let L = class extends q {
|
|
|
1838
1845
|
return C`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="short_text"></cx-icon></div></div><cx-typography variant="body2">${this.localize.term("metadata")}</cx-typography></cx-space><cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-metadata-tooltip" content=${this.localize.term("metadataHelpText")} hoist><cx-checkbox data-testid="cx-asset-link-format-metadata" class="details__checkbox" ?checked=${this.value} @cx-change=${this.handleApply}>${this.localize.term("preserveMetadata")}</cx-checkbox></cx-tooltip></cx-space></cx-details>`;
|
|
1839
1846
|
}
|
|
1840
1847
|
};
|
|
1841
|
-
L.styles = [G,
|
|
1848
|
+
L.styles = [G, Je];
|
|
1842
1849
|
L.dependencies = {
|
|
1843
|
-
"cx-button":
|
|
1844
|
-
"cx-checkbox":
|
|
1850
|
+
"cx-button": Y,
|
|
1851
|
+
"cx-checkbox": pe,
|
|
1845
1852
|
"cx-details": at,
|
|
1846
1853
|
"cx-icon": ot,
|
|
1847
|
-
"cx-space":
|
|
1848
|
-
"cx-tooltip":
|
|
1849
|
-
"cx-typography":
|
|
1854
|
+
"cx-space": q,
|
|
1855
|
+
"cx-tooltip": Ut,
|
|
1856
|
+
"cx-typography": U
|
|
1850
1857
|
};
|
|
1851
|
-
|
|
1852
|
-
|
|
1858
|
+
vt([
|
|
1859
|
+
J(".details")
|
|
1853
1860
|
], L.prototype, "base", 2);
|
|
1854
|
-
|
|
1861
|
+
vt([
|
|
1855
1862
|
h({ reflect: !0, type: Boolean })
|
|
1856
1863
|
], L.prototype, "open", 2);
|
|
1857
|
-
|
|
1864
|
+
vt([
|
|
1858
1865
|
h({ reflect: !0, type: Boolean })
|
|
1859
1866
|
], L.prototype, "value", 2);
|
|
1860
|
-
L =
|
|
1867
|
+
L = vt([
|
|
1861
1868
|
Q("cx-asset-link-format-metadata")
|
|
1862
1869
|
], L);
|
|
1863
|
-
var
|
|
1864
|
-
for (var a = s > 1 ? void 0 : s ?
|
|
1870
|
+
var ii = Object.defineProperty, si = Object.getOwnPropertyDescriptor, x = (t, e, i, s) => {
|
|
1871
|
+
for (var a = s > 1 ? void 0 : s ? si(e, i) : e, r = t.length - 1, n; r >= 0; r--)
|
|
1865
1872
|
(n = t[r]) && (a = (s ? n(e, i, a) : n(a)) || a);
|
|
1866
|
-
return s && a &&
|
|
1873
|
+
return s && a && ii(e, i, a), a;
|
|
1867
1874
|
};
|
|
1868
|
-
let
|
|
1875
|
+
let f = class extends B {
|
|
1869
1876
|
constructor() {
|
|
1870
1877
|
super(), this.localize = new V(this), this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
1871
1878
|
{
|
|
@@ -1963,7 +1970,7 @@ let u = class extends q {
|
|
|
1963
1970
|
}, this.rotation = 0, this.defaultSize = {
|
|
1964
1971
|
height: 0,
|
|
1965
1972
|
width: 0
|
|
1966
|
-
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink =
|
|
1973
|
+
}, this.cropperElement = null, this.parameters = [], this.loading = !1, this.lastAction = void 0, this.frozenIndex = void 0, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.apiGetTransformAssetLink = Ce, this.apiGetCropFocusMode = Fe, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
1967
1974
|
}
|
|
1968
1975
|
/**
|
|
1969
1976
|
* Transform requests must resolve to a web-displayable image (the browser renders the
|
|
@@ -1972,7 +1979,7 @@ let u = class extends q {
|
|
|
1972
1979
|
* extension fallback in asset-transformation-dialog.
|
|
1973
1980
|
*/
|
|
1974
1981
|
static getTransformExtension(t) {
|
|
1975
|
-
return !t ||
|
|
1982
|
+
return !t || Zt(t) ? t : "jpg";
|
|
1976
1983
|
}
|
|
1977
1984
|
/** True when there are transformations beyond the frozen index (i.e. user has added new ones). */
|
|
1978
1985
|
get hasUnfrozenTransformations() {
|
|
@@ -2087,7 +2094,7 @@ let u = class extends q {
|
|
|
2087
2094
|
}
|
|
2088
2095
|
};
|
|
2089
2096
|
if (e?.value.width && e?.value.height) {
|
|
2090
|
-
const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, n =
|
|
2097
|
+
const { height: i, width: s, x: a = 0, y: r = 0 } = e.value, n = ut(s, i);
|
|
2091
2098
|
return {
|
|
2092
2099
|
[o.AspectRatio]: {
|
|
2093
2100
|
height: n.height,
|
|
@@ -2110,7 +2117,7 @@ let u = class extends q {
|
|
|
2110
2117
|
};
|
|
2111
2118
|
}
|
|
2112
2119
|
}
|
|
2113
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2120
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? ut(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2114
2121
|
return {
|
|
2115
2122
|
[o.AspectRatio]: {
|
|
2116
2123
|
height: t.height,
|
|
@@ -2157,7 +2164,7 @@ let u = class extends q {
|
|
|
2157
2164
|
}
|
|
2158
2165
|
};
|
|
2159
2166
|
if (e?.value.width && e?.value.height) {
|
|
2160
|
-
const { height: i, width: s } = e.value, a =
|
|
2167
|
+
const { height: i, width: s } = e.value, a = ut(s, i);
|
|
2161
2168
|
return {
|
|
2162
2169
|
[o.AspectRatio]: {
|
|
2163
2170
|
height: a.height,
|
|
@@ -2172,7 +2179,7 @@ let u = class extends q {
|
|
|
2172
2179
|
};
|
|
2173
2180
|
}
|
|
2174
2181
|
}
|
|
2175
|
-
const t = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2182
|
+
const t = this.lastImageSize.width && this.lastImageSize.height ? ut(this.lastImageSize.width, this.lastImageSize.height) : { height: 1, width: 1 };
|
|
2176
2183
|
return {
|
|
2177
2184
|
[o.AspectRatio]: {
|
|
2178
2185
|
height: t.height,
|
|
@@ -2203,7 +2210,7 @@ let u = class extends q {
|
|
|
2203
2210
|
* Returns the transformation string for the asset link.
|
|
2204
2211
|
*/
|
|
2205
2212
|
get transformationString() {
|
|
2206
|
-
return
|
|
2213
|
+
return dt({
|
|
2207
2214
|
asset: this.asset,
|
|
2208
2215
|
baseUrl: "",
|
|
2209
2216
|
parameters: this.parameters,
|
|
@@ -2237,32 +2244,22 @@ let u = class extends q {
|
|
|
2237
2244
|
if (t.has("activeSetting") && this.handleActiveSettingChange(), t.has("selectedFormat") && this.handleSelectedFormatChange(), t.has("resizeSize") && this.handleResizeSizeChange(), t.has("cropSize") && this.handleCropSizeChange(), t.has("rotation") && this.handleRotationChange(), t.has("cropperElement") && this.handleCropperElementChange(), t.has("selectedFormat")) {
|
|
2238
2245
|
if (!this.asset || !this.selectedFormat || this.selectedFormat.extension === t.get("selectedFormat")?.extension)
|
|
2239
2246
|
return;
|
|
2240
|
-
|
|
2241
|
-
(
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
assetId: this.asset.id,
|
|
2245
|
-
extension: u.getTransformExtension(this.asset.extension),
|
|
2246
|
-
format: e?.proxyName ?? "",
|
|
2247
|
-
siteUrl: this.baseUrl,
|
|
2248
|
-
token: this.token,
|
|
2249
|
-
transformations: this.transformationString
|
|
2250
|
-
}).then((s) => {
|
|
2251
|
-
this.loading = !1, !(!s?.relativePath || !this.selectedFormat) && (this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2252
|
-
height: s.height,
|
|
2253
|
-
width: s.width
|
|
2247
|
+
this.loading = !0, this.requestTransformAsset().then((i) => {
|
|
2248
|
+
this.loading = !1, !(!i?.relativePath || !this.selectedFormat) && (this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2249
|
+
height: i.height,
|
|
2250
|
+
width: i.width
|
|
2254
2251
|
}, this.selectedFormat = {
|
|
2255
2252
|
...this.selectedFormat,
|
|
2256
|
-
height:
|
|
2257
|
-
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${
|
|
2258
|
-
width:
|
|
2253
|
+
height: i.height,
|
|
2254
|
+
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${i.relativePath}` : i.relativePath,
|
|
2255
|
+
width: i.width
|
|
2259
2256
|
/**
|
|
2260
2257
|
* For local development uses the base URL to construct the full URL.
|
|
2261
2258
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2262
2259
|
*/
|
|
2263
2260
|
});
|
|
2264
2261
|
});
|
|
2265
|
-
const
|
|
2262
|
+
const e = dt({
|
|
2266
2263
|
asset: this.asset,
|
|
2267
2264
|
baseUrl: "",
|
|
2268
2265
|
extension: this.selectedFormat.extension,
|
|
@@ -2271,13 +2268,52 @@ let u = class extends q {
|
|
|
2271
2268
|
useSession: this.useSession
|
|
2272
2269
|
});
|
|
2273
2270
|
this.emit("cx-asset-link-format-change", {
|
|
2274
|
-
detail:
|
|
2271
|
+
detail: e
|
|
2275
2272
|
});
|
|
2276
2273
|
}
|
|
2277
2274
|
}
|
|
2278
2275
|
getCropSize() {
|
|
2279
2276
|
return this.cropSize;
|
|
2280
2277
|
}
|
|
2278
|
+
/** Captures the current request synchronously; later edits cannot change Save's ratio. */
|
|
2279
|
+
async getAppliedAspectRatio() {
|
|
2280
|
+
if (!this.asset || !this.selectedFormat)
|
|
2281
|
+
return;
|
|
2282
|
+
const e = await this.getTransformRequest(this.transformRequestOptions).promise.catch(() => {
|
|
2283
|
+
});
|
|
2284
|
+
if (!e?.relativePath)
|
|
2285
|
+
return;
|
|
2286
|
+
const i = Number(e?.width) / Number(e?.height);
|
|
2287
|
+
return Number(e?.width) > 0 && Number(e?.height) > 0 && Number.isFinite(i) ? i : void 0;
|
|
2288
|
+
}
|
|
2289
|
+
get transformRequestOptions() {
|
|
2290
|
+
return {
|
|
2291
|
+
assetId: this.asset?.id ?? "",
|
|
2292
|
+
// The API sends this as TargetExtension, so both preview paths and Save
|
|
2293
|
+
// must use the selected output extension, not the original asset's extension.
|
|
2294
|
+
extension: f.getTransformExtension(this.selectedFormat?.extension ?? ""),
|
|
2295
|
+
format: this.proxies?.find((t) => t.id === this.selectedProxy)?.proxyName ?? "",
|
|
2296
|
+
siteUrl: this.baseUrl,
|
|
2297
|
+
token: this.token,
|
|
2298
|
+
transformations: this.transformationString
|
|
2299
|
+
};
|
|
2300
|
+
}
|
|
2301
|
+
getTransformRequest(t) {
|
|
2302
|
+
const e = JSON.stringify(t);
|
|
2303
|
+
if (this.transformRequest?.key !== e) {
|
|
2304
|
+
const i = { key: e, promise: this.apiGetTransformAssetLink(t) };
|
|
2305
|
+
i.promise = i.promise.catch(() => null).then((s) => (!s?.relativePath && this.transformRequest === i && (this.transformRequest = void 0), s)), this.transformRequest = i;
|
|
2306
|
+
}
|
|
2307
|
+
return this.transformRequest;
|
|
2308
|
+
}
|
|
2309
|
+
async requestTransformAsset() {
|
|
2310
|
+
if (!this.asset || !this.selectedFormat)
|
|
2311
|
+
return;
|
|
2312
|
+
const t = this.getTransformRequest(this.transformRequestOptions), e = await t.promise.catch(() => {
|
|
2313
|
+
});
|
|
2314
|
+
if (!(this.transformRequest !== t || JSON.stringify(this.transformRequestOptions) !== t.key))
|
|
2315
|
+
return e;
|
|
2316
|
+
}
|
|
2281
2317
|
setActiveSetting(t) {
|
|
2282
2318
|
this.activeSetting = t;
|
|
2283
2319
|
}
|
|
@@ -2295,7 +2331,7 @@ let u = class extends q {
|
|
|
2295
2331
|
async handleTransformationsChange() {
|
|
2296
2332
|
if (await this.updateComplete, !this.asset) {
|
|
2297
2333
|
this.emit("cx-asset-link-format-change", {
|
|
2298
|
-
detail:
|
|
2334
|
+
detail: dt({
|
|
2299
2335
|
asset: this.asset,
|
|
2300
2336
|
baseUrl: "",
|
|
2301
2337
|
options: {
|
|
@@ -2306,36 +2342,36 @@ let u = class extends q {
|
|
|
2306
2342
|
useSession: this.useSession
|
|
2307
2343
|
}).replace(/\/t\//g, "")
|
|
2308
2344
|
});
|
|
2309
|
-
const
|
|
2345
|
+
const a = this.transformations.findLast(
|
|
2310
2346
|
(c) => c.key === m.Crop && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width && c.value.height)
|
|
2311
2347
|
);
|
|
2312
|
-
if (
|
|
2313
|
-
const { focusMode: c, position:
|
|
2348
|
+
if (a?.value.unit === o.AspectRatio && a.value.ratioWidth && a.value.ratioHeight) {
|
|
2349
|
+
const { focusMode: c, position: g, ratioHeight: u, ratioWidth: y } = a.value;
|
|
2314
2350
|
this.cropSize = {
|
|
2315
2351
|
...this.cropSize,
|
|
2316
2352
|
cropMode: "free",
|
|
2317
2353
|
focusMode: c ?? "manual",
|
|
2318
2354
|
percentageHeight: 100,
|
|
2319
2355
|
percentageWidth: 100,
|
|
2320
|
-
position:
|
|
2321
|
-
ratioHeight:
|
|
2322
|
-
ratioWidth:
|
|
2356
|
+
position: g ?? N.CenterCenter,
|
|
2357
|
+
ratioHeight: u,
|
|
2358
|
+
ratioWidth: y,
|
|
2323
2359
|
unit: o.AspectRatio
|
|
2324
2360
|
};
|
|
2325
|
-
} else if (
|
|
2326
|
-
const { focusMode: c, height:
|
|
2361
|
+
} else if (a) {
|
|
2362
|
+
const { focusMode: c, height: g, position: u, unit: y, width: S, x: d = 0, y: v = 0 } = a.value;
|
|
2327
2363
|
this.cropSize = {
|
|
2328
2364
|
...this.cropSize,
|
|
2329
2365
|
cropMode: "free",
|
|
2330
2366
|
focusMode: c ?? "manual",
|
|
2331
|
-
height:
|
|
2367
|
+
height: g,
|
|
2332
2368
|
percentageHeight: 100,
|
|
2333
2369
|
percentageWidth: 100,
|
|
2334
|
-
position:
|
|
2335
|
-
unit:
|
|
2336
|
-
width:
|
|
2337
|
-
x:
|
|
2338
|
-
y:
|
|
2370
|
+
position: u ?? N.CenterCenter,
|
|
2371
|
+
unit: y ?? o.Pixel,
|
|
2372
|
+
width: S,
|
|
2373
|
+
x: d,
|
|
2374
|
+
y: v
|
|
2339
2375
|
};
|
|
2340
2376
|
} else
|
|
2341
2377
|
this.cropSize = {
|
|
@@ -2357,24 +2393,24 @@ let u = class extends q {
|
|
|
2357
2393
|
x: 0,
|
|
2358
2394
|
y: 0
|
|
2359
2395
|
};
|
|
2360
|
-
const
|
|
2396
|
+
const r = this.transformations.findLast(
|
|
2361
2397
|
(c) => c.key === m.Resize && (c.value.unit === o.AspectRatio && c.value.ratioWidth && c.value.ratioHeight || c.value.width || c.value.height)
|
|
2362
2398
|
);
|
|
2363
|
-
if (
|
|
2364
|
-
const { ratioHeight: c, ratioWidth:
|
|
2399
|
+
if (r?.value.unit === o.AspectRatio && r.value.ratioWidth && r.value.ratioHeight) {
|
|
2400
|
+
const { ratioHeight: c, ratioWidth: g } = r.value;
|
|
2365
2401
|
this.resizeSize = {
|
|
2366
2402
|
...this.resizeSize,
|
|
2367
2403
|
ratioHeight: c,
|
|
2368
|
-
ratioWidth:
|
|
2404
|
+
ratioWidth: g,
|
|
2369
2405
|
unit: o.AspectRatio
|
|
2370
2406
|
};
|
|
2371
|
-
} else if (
|
|
2372
|
-
const { height: c = 0, unit:
|
|
2407
|
+
} else if (r) {
|
|
2408
|
+
const { height: c = 0, unit: g, width: u = 0 } = r.value;
|
|
2373
2409
|
this.resizeSize = {
|
|
2374
2410
|
...this.resizeSize,
|
|
2375
2411
|
height: c,
|
|
2376
|
-
unit:
|
|
2377
|
-
width:
|
|
2412
|
+
unit: g ?? o.Pixel,
|
|
2413
|
+
width: u
|
|
2378
2414
|
};
|
|
2379
2415
|
} else
|
|
2380
2416
|
this.resizeSize = {
|
|
@@ -2388,18 +2424,18 @@ let u = class extends q {
|
|
|
2388
2424
|
unit: o.Pixel,
|
|
2389
2425
|
width: 1
|
|
2390
2426
|
};
|
|
2391
|
-
const
|
|
2427
|
+
const n = this.transformations.findLast(
|
|
2392
2428
|
(c) => c.key === m.Rotate
|
|
2393
2429
|
);
|
|
2394
|
-
this.rotation =
|
|
2395
|
-
const
|
|
2430
|
+
this.rotation = n?.value.rotation ?? 0;
|
|
2431
|
+
const l = this.transformations.findLast((c) => c.key === m.Quality)?.value.quality ?? 100, p = this.transformations.some(
|
|
2396
2432
|
(c) => c.key === m.Metadata
|
|
2397
2433
|
);
|
|
2398
|
-
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata:
|
|
2434
|
+
this.selectedFormat ? this.selectedFormat = { ...this.selectedFormat, keepMetadata: p, quality: l } : this.selectedFormat = {
|
|
2399
2435
|
extension: "",
|
|
2400
2436
|
height: 0,
|
|
2401
|
-
keepMetadata:
|
|
2402
|
-
quality:
|
|
2437
|
+
keepMetadata: p,
|
|
2438
|
+
quality: l,
|
|
2403
2439
|
rotation: 0,
|
|
2404
2440
|
url: "",
|
|
2405
2441
|
width: 0,
|
|
@@ -2410,34 +2446,24 @@ let u = class extends q {
|
|
|
2410
2446
|
}
|
|
2411
2447
|
if (!this.selectedFormat)
|
|
2412
2448
|
return;
|
|
2413
|
-
const t = this.proxies?.find(
|
|
2414
|
-
(r) => r.id === this.selectedProxy
|
|
2415
|
-
);
|
|
2416
2449
|
this.loading = !0;
|
|
2417
|
-
const
|
|
2418
|
-
|
|
2419
|
-
extension: u.getTransformExtension(this.selectedFormat.extension),
|
|
2420
|
-
format: t?.proxyName ?? "",
|
|
2421
|
-
siteUrl: this.baseUrl,
|
|
2422
|
-
token: this.token,
|
|
2423
|
-
transformations: this.transformationString
|
|
2424
|
-
});
|
|
2425
|
-
if (this.loading = !1, !e?.relativePath || !this.selectedFormat)
|
|
2450
|
+
const t = await this.requestTransformAsset();
|
|
2451
|
+
if (this.loading = !1, !t?.relativePath || !this.selectedFormat)
|
|
2426
2452
|
return;
|
|
2427
2453
|
this.lastImageSize = {
|
|
2428
|
-
height:
|
|
2429
|
-
width:
|
|
2454
|
+
height: t.height,
|
|
2455
|
+
width: t.width
|
|
2430
2456
|
}, this.resizeSize = {
|
|
2431
|
-
height:
|
|
2457
|
+
height: t.height,
|
|
2432
2458
|
keepAspectRatio: !0,
|
|
2433
2459
|
ratioHeight: 1,
|
|
2434
2460
|
ratioWidth: 1,
|
|
2435
2461
|
unit: o.Pixel,
|
|
2436
|
-
width:
|
|
2462
|
+
width: t.width
|
|
2437
2463
|
}, this.cropSize = {
|
|
2438
2464
|
cropMode: "free",
|
|
2439
2465
|
focusMode: "manual",
|
|
2440
|
-
height:
|
|
2466
|
+
height: t.height,
|
|
2441
2467
|
keepAspectRatio: this.cropSize.keepAspectRatio,
|
|
2442
2468
|
percentageHeight: 100,
|
|
2443
2469
|
percentageWidth: 100,
|
|
@@ -2445,28 +2471,28 @@ let u = class extends q {
|
|
|
2445
2471
|
ratioHeight: 1,
|
|
2446
2472
|
ratioWidth: 1,
|
|
2447
2473
|
unit: o.Pixel,
|
|
2448
|
-
width:
|
|
2474
|
+
width: t.width,
|
|
2449
2475
|
x: 0,
|
|
2450
2476
|
y: 0
|
|
2451
2477
|
}, this.lastAction === m.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2452
|
-
const
|
|
2453
|
-
(
|
|
2454
|
-
),
|
|
2455
|
-
(
|
|
2478
|
+
const e = this.transformations.some(
|
|
2479
|
+
(a) => a.key === m.Metadata
|
|
2480
|
+
), i = this.transformations.findLast(
|
|
2481
|
+
(a) => a.key === m.Quality
|
|
2456
2482
|
);
|
|
2457
2483
|
this.selectedFormat = {
|
|
2458
2484
|
...this.selectedFormat,
|
|
2459
|
-
height:
|
|
2460
|
-
keepMetadata:
|
|
2461
|
-
quality:
|
|
2462
|
-
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${
|
|
2463
|
-
width:
|
|
2485
|
+
height: t.height,
|
|
2486
|
+
keepMetadata: e,
|
|
2487
|
+
quality: i?.value?.quality ?? this.selectedFormat.quality,
|
|
2488
|
+
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${t.relativePath}` : t.relativePath,
|
|
2489
|
+
width: t.width
|
|
2464
2490
|
/**
|
|
2465
2491
|
* For local development uses the base URL to construct the full URL.
|
|
2466
2492
|
* url: `${this.baseUrl}/${response.relativePath}`,
|
|
2467
2493
|
*/
|
|
2468
2494
|
};
|
|
2469
|
-
const
|
|
2495
|
+
const s = dt({
|
|
2470
2496
|
asset: this.asset,
|
|
2471
2497
|
baseUrl: "",
|
|
2472
2498
|
extension: this.selectedFormat.extension,
|
|
@@ -2475,7 +2501,7 @@ let u = class extends q {
|
|
|
2475
2501
|
useSession: this.useSession
|
|
2476
2502
|
});
|
|
2477
2503
|
this.emit("cx-asset-link-format-change", {
|
|
2478
|
-
detail:
|
|
2504
|
+
detail: s
|
|
2479
2505
|
});
|
|
2480
2506
|
}
|
|
2481
2507
|
handleCropperElementChange() {
|
|
@@ -2642,29 +2668,29 @@ let u = class extends q {
|
|
|
2642
2668
|
ratioHeight: n,
|
|
2643
2669
|
ratioWidth: l,
|
|
2644
2670
|
unit: p,
|
|
2645
|
-
useCropMode:
|
|
2646
|
-
width:
|
|
2671
|
+
useCropMode: c,
|
|
2672
|
+
width: g
|
|
2647
2673
|
}) {
|
|
2648
2674
|
if (!this.selectedFormat?.url || e === "manual")
|
|
2649
2675
|
return;
|
|
2650
2676
|
this.loading = !0, this.lastAction = m.Crop;
|
|
2651
|
-
const
|
|
2677
|
+
const u = await this.apiGetCropFocusMode({
|
|
2652
2678
|
autoCropMode: e,
|
|
2653
2679
|
cropHeight: i,
|
|
2654
|
-
cropWidth:
|
|
2680
|
+
cropWidth: g,
|
|
2655
2681
|
imageUrl: this.selectedFormat.url
|
|
2656
2682
|
});
|
|
2657
|
-
if (
|
|
2658
|
-
let
|
|
2659
|
-
i || (
|
|
2683
|
+
if (u) {
|
|
2684
|
+
let y = a, S = r;
|
|
2685
|
+
i || (y = u.height * 100 / this.selectedFormat.height), g || (S = u.width * 100 / this.selectedFormat.width), this.cropSize = {
|
|
2660
2686
|
...this.cropSize,
|
|
2661
|
-
height:
|
|
2662
|
-
percentageHeight:
|
|
2663
|
-
percentageWidth:
|
|
2664
|
-
width:
|
|
2665
|
-
x:
|
|
2666
|
-
y:
|
|
2667
|
-
...
|
|
2687
|
+
height: u.height,
|
|
2688
|
+
percentageHeight: y ?? this.cropSize.percentageHeight,
|
|
2689
|
+
percentageWidth: S ?? this.cropSize.percentageWidth,
|
|
2690
|
+
width: u.width,
|
|
2691
|
+
x: u.x * 100 / this.selectedFormat.width,
|
|
2692
|
+
y: u.y * 100 / this.selectedFormat.height,
|
|
2693
|
+
...c ? {
|
|
2668
2694
|
cropMode: e,
|
|
2669
2695
|
focusMode: "manual",
|
|
2670
2696
|
keepAspectRatio: !1
|
|
@@ -2690,25 +2716,25 @@ let u = class extends q {
|
|
|
2690
2716
|
if (s === 0 || i === 0)
|
|
2691
2717
|
return;
|
|
2692
2718
|
const n = this.cropSize.percentageWidth !== s, l = this.cropSize.percentageHeight !== i;
|
|
2693
|
-
let p = this.cropSize.height,
|
|
2694
|
-
n && (
|
|
2719
|
+
let p = this.cropSize.height, c = this.cropSize.width;
|
|
2720
|
+
n && (c = Math.round(s * this.selectedFormat.width / 100)), l && (p = Math.round(
|
|
2695
2721
|
i * this.selectedFormat.height / 100
|
|
2696
2722
|
));
|
|
2697
|
-
const
|
|
2723
|
+
const g = this.cropSize.focusMode;
|
|
2698
2724
|
this.focusModes.find(
|
|
2699
|
-
(
|
|
2725
|
+
(y) => y.value === g
|
|
2700
2726
|
)?.auto && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2701
|
-
focusMode:
|
|
2727
|
+
focusMode: g,
|
|
2702
2728
|
height: p,
|
|
2703
2729
|
percentageHeight: i,
|
|
2704
2730
|
percentageWidth: s,
|
|
2705
|
-
width:
|
|
2731
|
+
width: c
|
|
2706
2732
|
}) : this.cropSize = {
|
|
2707
2733
|
...this.cropSize,
|
|
2708
2734
|
height: p,
|
|
2709
2735
|
percentageHeight: i,
|
|
2710
2736
|
percentageWidth: s,
|
|
2711
|
-
width:
|
|
2737
|
+
width: c,
|
|
2712
2738
|
x: a,
|
|
2713
2739
|
y: r
|
|
2714
2740
|
};
|
|
@@ -2809,12 +2835,12 @@ let u = class extends q {
|
|
|
2809
2835
|
) : 0, r = this.asset ? a * 100 / this.selectedFormat.height : 100, n = this.asset ? s * 100 / this.selectedFormat.width : 100;
|
|
2810
2836
|
let l = this.cropSize.x, p = this.cropSize.y;
|
|
2811
2837
|
l + n > 100 && (l = 100 - n), p + r > 100 && (p = 100 - r);
|
|
2812
|
-
let
|
|
2838
|
+
let c = this.cropSize.cropMode;
|
|
2813
2839
|
this.cropModes.find(
|
|
2814
|
-
(
|
|
2815
|
-
)?.auto && (
|
|
2840
|
+
(u) => u.value === c
|
|
2841
|
+
)?.auto && (c = "free"), t.detail.silent ? (this.cropSize.height = a, this.cropSize.keepAspectRatio = t.detail.keepAspectRatio, this.cropSize.percentageHeight = r, this.cropSize.percentageWidth = n, this.cropSize.ratioHeight = t.detail.height, this.cropSize.ratioWidth = t.detail.width, this.cropSize.unit = o.AspectRatio, this.cropSize.width = s) : this.cropSize = {
|
|
2816
2842
|
...this.cropSize,
|
|
2817
|
-
cropMode:
|
|
2843
|
+
cropMode: c,
|
|
2818
2844
|
height: a,
|
|
2819
2845
|
keepAspectRatio: t.detail.keepAspectRatio,
|
|
2820
2846
|
percentageHeight: r,
|
|
@@ -2866,39 +2892,39 @@ let u = class extends q {
|
|
|
2866
2892
|
const {
|
|
2867
2893
|
focusMode: l,
|
|
2868
2894
|
height: p,
|
|
2869
|
-
position:
|
|
2870
|
-
ratioHeight:
|
|
2871
|
-
ratioWidth:
|
|
2872
|
-
unit:
|
|
2873
|
-
width:
|
|
2895
|
+
position: c,
|
|
2896
|
+
ratioHeight: g,
|
|
2897
|
+
ratioWidth: u,
|
|
2898
|
+
unit: y,
|
|
2899
|
+
width: S,
|
|
2874
2900
|
x: d,
|
|
2875
2901
|
y: v
|
|
2876
2902
|
} = this.cropSize, k = this.focusModes.find(
|
|
2877
|
-
(
|
|
2903
|
+
(b) => b.value === l
|
|
2878
2904
|
)?.auto ?? !1;
|
|
2879
|
-
if (
|
|
2880
|
-
|
|
2905
|
+
if (y === o.AspectRatio) {
|
|
2906
|
+
u && g && this.upsertTransformation({
|
|
2881
2907
|
key: m.Crop,
|
|
2882
2908
|
value: {
|
|
2883
2909
|
focusMode: l,
|
|
2884
2910
|
isFocusModeAuto: k,
|
|
2885
|
-
position:
|
|
2886
|
-
ratioHeight:
|
|
2887
|
-
ratioWidth:
|
|
2888
|
-
unit:
|
|
2911
|
+
position: c,
|
|
2912
|
+
ratioHeight: g,
|
|
2913
|
+
ratioWidth: u,
|
|
2914
|
+
unit: y
|
|
2889
2915
|
}
|
|
2890
2916
|
});
|
|
2891
2917
|
return;
|
|
2892
2918
|
}
|
|
2893
|
-
(p ||
|
|
2919
|
+
(p || S) && this.upsertTransformation({
|
|
2894
2920
|
key: m.Crop,
|
|
2895
2921
|
value: {
|
|
2896
2922
|
focusMode: l,
|
|
2897
2923
|
height: p,
|
|
2898
2924
|
isFocusModeAuto: k,
|
|
2899
|
-
position:
|
|
2900
|
-
unit:
|
|
2901
|
-
width:
|
|
2925
|
+
position: c,
|
|
2926
|
+
unit: y,
|
|
2927
|
+
width: S,
|
|
2902
2928
|
/**
|
|
2903
2929
|
* Without an asset there is no cropper to drag, so x/y are always the 0
|
|
2904
2930
|
* placeholder from cropSize's default — never a real manual offset. Omit
|
|
@@ -2935,7 +2961,7 @@ let u = class extends q {
|
|
|
2935
2961
|
}
|
|
2936
2962
|
];
|
|
2937
2963
|
else {
|
|
2938
|
-
const
|
|
2964
|
+
const c = this.cropSize.x / 100 * this.selectedFormat.width, g = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2939
2965
|
this.transformations = [
|
|
2940
2966
|
...this.transformations,
|
|
2941
2967
|
{
|
|
@@ -2946,8 +2972,8 @@ let u = class extends q {
|
|
|
2946
2972
|
isFocusModeAuto: n,
|
|
2947
2973
|
unit: s,
|
|
2948
2974
|
width: l,
|
|
2949
|
-
x:
|
|
2950
|
-
y:
|
|
2975
|
+
x: c,
|
|
2976
|
+
y: g
|
|
2951
2977
|
}
|
|
2952
2978
|
}
|
|
2953
2979
|
];
|
|
@@ -2992,12 +3018,12 @@ let u = class extends q {
|
|
|
2992
3018
|
const { height: e, unit: i, width: s } = t.detail;
|
|
2993
3019
|
if (this.clearResetSnapshot(), this.lastAction = m.Resize, !this.asset) {
|
|
2994
3020
|
if (i === o.AspectRatio) {
|
|
2995
|
-
const { ratioHeight: p, ratioWidth:
|
|
2996
|
-
|
|
3021
|
+
const { ratioHeight: p, ratioWidth: c } = this.resizeSize;
|
|
3022
|
+
c && p && this.upsertTransformation({
|
|
2997
3023
|
key: m.Resize,
|
|
2998
3024
|
value: {
|
|
2999
3025
|
ratioHeight: p,
|
|
3000
|
-
ratioWidth:
|
|
3026
|
+
ratioWidth: c,
|
|
3001
3027
|
unit: i
|
|
3002
3028
|
}
|
|
3003
3029
|
});
|
|
@@ -3168,168 +3194,169 @@ let u = class extends q {
|
|
|
3168
3194
|
)}</div>`;
|
|
3169
3195
|
}
|
|
3170
3196
|
};
|
|
3171
|
-
|
|
3172
|
-
|
|
3197
|
+
f.styles = [G, Ee];
|
|
3198
|
+
f.dependencies = {
|
|
3173
3199
|
"cx-asset-link-format-crop": A,
|
|
3174
|
-
"cx-asset-link-format-extension":
|
|
3200
|
+
"cx-asset-link-format-extension": K,
|
|
3175
3201
|
"cx-asset-link-format-metadata": L,
|
|
3176
3202
|
"cx-asset-link-format-proxy": I,
|
|
3177
3203
|
"cx-asset-link-format-quality": W,
|
|
3178
3204
|
"cx-asset-link-format-resize": R,
|
|
3179
3205
|
"cx-asset-link-format-rotation": T,
|
|
3180
|
-
"cx-button":
|
|
3181
|
-
"cx-space":
|
|
3182
|
-
"cx-typography":
|
|
3206
|
+
"cx-button": Y,
|
|
3207
|
+
"cx-space": q,
|
|
3208
|
+
"cx-typography": U
|
|
3183
3209
|
};
|
|
3184
|
-
|
|
3210
|
+
x([
|
|
3185
3211
|
h({ attribute: "base-url", type: String })
|
|
3186
|
-
],
|
|
3187
|
-
|
|
3212
|
+
], f.prototype, "baseUrl", 2);
|
|
3213
|
+
x([
|
|
3188
3214
|
h({ attribute: "token", type: String })
|
|
3189
|
-
],
|
|
3190
|
-
|
|
3215
|
+
], f.prototype, "token", 2);
|
|
3216
|
+
x([
|
|
3191
3217
|
h({ reflect: !1, type: Object })
|
|
3192
|
-
],
|
|
3193
|
-
|
|
3218
|
+
], f.prototype, "asset", 2);
|
|
3219
|
+
x([
|
|
3194
3220
|
h({ attribute: "crop-modes", reflect: !1, type: Array })
|
|
3195
|
-
],
|
|
3196
|
-
|
|
3221
|
+
], f.prototype, "cropModes", 2);
|
|
3222
|
+
x([
|
|
3197
3223
|
h({ attribute: "focus-modes", reflect: !1, type: Object })
|
|
3198
|
-
],
|
|
3199
|
-
|
|
3224
|
+
], f.prototype, "focusModes", 2);
|
|
3225
|
+
x([
|
|
3200
3226
|
h({ reflect: !1, type: Array })
|
|
3201
|
-
],
|
|
3202
|
-
|
|
3227
|
+
], f.prototype, "extensions", 2);
|
|
3228
|
+
x([
|
|
3203
3229
|
h({ reflect: !1, type: Array })
|
|
3204
|
-
],
|
|
3205
|
-
|
|
3230
|
+
], f.prototype, "proxies", 2);
|
|
3231
|
+
x([
|
|
3206
3232
|
h({ attribute: "for-cropper", reflect: !0, type: String })
|
|
3207
|
-
],
|
|
3208
|
-
|
|
3233
|
+
], f.prototype, "forCropper", 2);
|
|
3234
|
+
x([
|
|
3209
3235
|
h({ attribute: "use-session", reflect: !0, type: String })
|
|
3210
|
-
],
|
|
3211
|
-
|
|
3236
|
+
], f.prototype, "useSession", 2);
|
|
3237
|
+
x([
|
|
3212
3238
|
h({ reflect: !1, type: Array })
|
|
3213
|
-
],
|
|
3214
|
-
|
|
3239
|
+
], f.prototype, "transformations", 2);
|
|
3240
|
+
x([
|
|
3215
3241
|
h({ attribute: "selected-proxy", reflect: !0, type: String })
|
|
3216
|
-
],
|
|
3217
|
-
|
|
3242
|
+
], f.prototype, "selectedProxy", 2);
|
|
3243
|
+
x([
|
|
3218
3244
|
h({ attribute: "default-proxy", reflect: !0, type: String })
|
|
3219
|
-
],
|
|
3220
|
-
|
|
3245
|
+
], f.prototype, "defaultProxy", 2);
|
|
3246
|
+
x([
|
|
3221
3247
|
h({ attribute: "can-auto-format", reflect: !0, type: Boolean })
|
|
3222
|
-
],
|
|
3223
|
-
|
|
3248
|
+
], f.prototype, "canAutoFormat", 2);
|
|
3249
|
+
x([
|
|
3224
3250
|
h({ attribute: "auto-format", reflect: !0, type: Boolean })
|
|
3225
|
-
],
|
|
3226
|
-
|
|
3251
|
+
], f.prototype, "autoFormat", 2);
|
|
3252
|
+
x([
|
|
3227
3253
|
h({ attribute: "use-custom-extension", reflect: !0, type: Boolean })
|
|
3228
|
-
],
|
|
3229
|
-
|
|
3254
|
+
], f.prototype, "useCustomExtension", 2);
|
|
3255
|
+
x([
|
|
3230
3256
|
h({ attribute: "no-metadata", reflect: !0, type: Boolean })
|
|
3231
|
-
],
|
|
3232
|
-
|
|
3257
|
+
], f.prototype, "noMetadata", 2);
|
|
3258
|
+
x([
|
|
3233
3259
|
h({ attribute: "no-format", reflect: !0, type: Boolean })
|
|
3234
|
-
],
|
|
3235
|
-
|
|
3260
|
+
], f.prototype, "noFormat", 2);
|
|
3261
|
+
x([
|
|
3236
3262
|
h({ attribute: "no-crop", reflect: !0, type: Boolean })
|
|
3237
|
-
],
|
|
3238
|
-
|
|
3263
|
+
], f.prototype, "noCrop", 2);
|
|
3264
|
+
x([
|
|
3239
3265
|
h({ attribute: "no-resize", reflect: !0, type: Boolean })
|
|
3240
|
-
],
|
|
3241
|
-
|
|
3266
|
+
], f.prototype, "noResize", 2);
|
|
3267
|
+
x([
|
|
3242
3268
|
h({ attribute: "no-rotate", reflect: !0, type: Boolean })
|
|
3243
|
-
],
|
|
3244
|
-
|
|
3269
|
+
], f.prototype, "noRotate", 2);
|
|
3270
|
+
x([
|
|
3245
3271
|
h({ attribute: "last-image-size", reflect: !1, type: Object })
|
|
3246
|
-
],
|
|
3247
|
-
|
|
3272
|
+
], f.prototype, "lastImageSize", 2);
|
|
3273
|
+
x([
|
|
3248
3274
|
h({ attribute: "hide-header", reflect: !1, type: Boolean })
|
|
3249
|
-
],
|
|
3250
|
-
|
|
3275
|
+
], f.prototype, "hideHeader", 2);
|
|
3276
|
+
x([
|
|
3251
3277
|
h({ attribute: "can-reset", type: Boolean })
|
|
3252
|
-
],
|
|
3253
|
-
|
|
3278
|
+
], f.prototype, "canReset", 2);
|
|
3279
|
+
x([
|
|
3254
3280
|
h({ attribute: !1, reflect: !1, type: Object })
|
|
3255
|
-
],
|
|
3256
|
-
|
|
3281
|
+
], f.prototype, "queryElement", 2);
|
|
3282
|
+
x([
|
|
3257
3283
|
$()
|
|
3258
|
-
],
|
|
3259
|
-
|
|
3284
|
+
], f.prototype, "activeSetting", 2);
|
|
3285
|
+
x([
|
|
3260
3286
|
$()
|
|
3261
|
-
],
|
|
3262
|
-
|
|
3287
|
+
], f.prototype, "selectedFormat", 2);
|
|
3288
|
+
x([
|
|
3263
3289
|
$()
|
|
3264
|
-
],
|
|
3265
|
-
|
|
3290
|
+
], f.prototype, "resizeSize", 2);
|
|
3291
|
+
x([
|
|
3266
3292
|
$()
|
|
3267
|
-
],
|
|
3268
|
-
|
|
3293
|
+
], f.prototype, "cropSize", 2);
|
|
3294
|
+
x([
|
|
3269
3295
|
$()
|
|
3270
|
-
],
|
|
3271
|
-
|
|
3296
|
+
], f.prototype, "rotation", 2);
|
|
3297
|
+
x([
|
|
3272
3298
|
$()
|
|
3273
|
-
],
|
|
3274
|
-
|
|
3299
|
+
], f.prototype, "defaultSize", 2);
|
|
3300
|
+
x([
|
|
3275
3301
|
$()
|
|
3276
|
-
],
|
|
3277
|
-
|
|
3302
|
+
], f.prototype, "cropperElement", 2);
|
|
3303
|
+
x([
|
|
3278
3304
|
$()
|
|
3279
|
-
],
|
|
3280
|
-
|
|
3305
|
+
], f.prototype, "parameters", 2);
|
|
3306
|
+
x([
|
|
3281
3307
|
$()
|
|
3282
|
-
],
|
|
3283
|
-
|
|
3308
|
+
], f.prototype, "loading", 2);
|
|
3309
|
+
x([
|
|
3284
3310
|
$()
|
|
3285
|
-
],
|
|
3286
|
-
|
|
3311
|
+
], f.prototype, "lastAction", 2);
|
|
3312
|
+
x([
|
|
3287
3313
|
$()
|
|
3288
|
-
],
|
|
3289
|
-
|
|
3314
|
+
], f.prototype, "frozenIndex", 2);
|
|
3315
|
+
x([
|
|
3290
3316
|
$()
|
|
3291
|
-
],
|
|
3292
|
-
|
|
3317
|
+
], f.prototype, "preResetTransformations", 2);
|
|
3318
|
+
x([
|
|
3293
3319
|
$()
|
|
3294
|
-
],
|
|
3295
|
-
|
|
3320
|
+
], f.prototype, "preResetAutoFormat", 2);
|
|
3321
|
+
x([
|
|
3296
3322
|
$()
|
|
3297
|
-
],
|
|
3298
|
-
|
|
3323
|
+
], f.prototype, "preResetSelectedProxy", 2);
|
|
3324
|
+
x([
|
|
3299
3325
|
_("transformations")
|
|
3300
|
-
],
|
|
3301
|
-
|
|
3326
|
+
], f.prototype, "handleTransformationsChange", 1);
|
|
3327
|
+
x([
|
|
3302
3328
|
_("selectedProxy")
|
|
3303
|
-
],
|
|
3304
|
-
|
|
3329
|
+
], f.prototype, "handleSelectedProxyChange", 1);
|
|
3330
|
+
x([
|
|
3305
3331
|
_("loading")
|
|
3306
|
-
],
|
|
3307
|
-
|
|
3332
|
+
], f.prototype, "handleLoadingChange", 1);
|
|
3333
|
+
f = x([
|
|
3308
3334
|
Q("cx-asset-link-format")
|
|
3309
|
-
],
|
|
3335
|
+
], f);
|
|
3310
3336
|
export {
|
|
3311
|
-
|
|
3312
|
-
|
|
3337
|
+
f as C,
|
|
3338
|
+
lt as F,
|
|
3313
3339
|
jt as M,
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3340
|
+
$e as a,
|
|
3341
|
+
ht as b,
|
|
3342
|
+
Ie as c,
|
|
3343
|
+
Rt as d,
|
|
3344
|
+
xt as e,
|
|
3345
|
+
Zi as f,
|
|
3346
|
+
Ki as g,
|
|
3347
|
+
Xi as h,
|
|
3348
|
+
Xt as i,
|
|
3349
|
+
gt as j,
|
|
3350
|
+
ft as k,
|
|
3351
|
+
Et as l,
|
|
3352
|
+
Bi as m,
|
|
3353
|
+
ji as n,
|
|
3354
|
+
Ht as o,
|
|
3355
|
+
Zt as p,
|
|
3356
|
+
Yi as q,
|
|
3357
|
+
Bt as r,
|
|
3358
|
+
Vi as s,
|
|
3359
|
+
Gi as t,
|
|
3360
|
+
de as u,
|
|
3361
|
+
Qi as v
|
|
3335
3362
|
};
|