@orangelogic/design-system 5.0.0 → 5.2.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/{abnfDiagram-N423BO3Z.H1zwr_k6.js → abnfDiagram-N423BO3Z.DF8zrlpl.js} +3 -3
- package/library/chunks/{alert.2Esbser8.js → alert.D4RTWtiS.js} +2 -2
- package/library/chunks/{architectureDiagram-T3A2C74G.AxjW1Pvo.js → architectureDiagram-T3A2C74G.ChMyS2RN.js} +5 -5
- package/library/chunks/{array-line-clamp.C0Vo0Zzg.js → array-line-clamp.CFndztdp.js} +2 -2
- package/library/chunks/{asset-link-format.Ce_3Qz6_.js → asset-link-format.BbDrlRL5.js} +686 -606
- package/library/chunks/{asset-link-format.COPyGdND.js → asset-link-format.D6L-qc3X.js} +8 -8
- package/library/chunks/{audio.B0VfXBIx.js → audio.jEmfjIWU.js} +2 -2
- package/library/chunks/{bicolor-picker.DS9Uut25.js → bicolor-picker.DoLf8yCy.js} +1 -1
- package/library/chunks/{block-width.ClbkbtKA.js → block-width.nVsYTBw6.js} +44 -44
- package/library/chunks/{blockDiagram-VBNYF7ZC.BA5YJ5tg.js → blockDiagram-VBNYF7ZC.Dd9MRQVF.js} +6 -6
- package/library/chunks/{border-input-group.B6fqiG6F.js → border-input-group.CQ-BZvjI.js} +3 -3
- package/library/chunks/{breadcrumb.DkINVxcJ.js → breadcrumb.8_0yuiOI.js} +1 -1
- package/library/chunks/{button.DKkHqsUz.js → button.VUFrOP0u.js} +3 -3
- package/library/chunks/{c4Diagram-5PPSVZJV.B1weqOqz.js → c4Diagram-5PPSVZJV.BYo1Zq25.js} +3 -3
- package/library/chunks/{channel.Bqlqmufs.js → channel.DQU07rrH.js} +1 -1
- package/library/chunks/{checkbox.BdSpQlwf.js → checkbox.BzR50Is_.js} +2 -2
- package/library/chunks/{chunk-2GRJ4B5K.BOBf1_FX.js → chunk-2GRJ4B5K.DSIuCed9.js} +1 -1
- package/library/chunks/{chunk-4I5QYGJK.DfO_P7bO.js → chunk-4I5QYGJK.C74S0dID.js} +1 -1
- package/library/chunks/{chunk-5RXB4S5H.oisV3Q1b.js → chunk-5RXB4S5H.BSZ9vwQ_.js} +6 -6
- package/library/chunks/{chunk-6Q2QTUOP.ByglL7sM.js → chunk-6Q2QTUOP.C98k0Ypz.js} +2 -2
- package/library/chunks/{chunk-7Z6QIM7H.BXSFN_6B.js → chunk-7Z6QIM7H.CbyAI1qL.js} +6 -6
- package/library/chunks/{chunk-GF5L2VYU.BBRVN_Sz.js → chunk-GF5L2VYU.BwnEI-9p.js} +6 -6
- package/library/chunks/{chunk-I66GZJ75.lUTR0Zxp.js → chunk-I66GZJ75.hYJHAb8_.js} +1 -1
- package/library/chunks/{chunk-JQJVKLGR.dOAJ_eec.js → chunk-JQJVKLGR.Ca9c6WQC.js} +8 -8
- package/library/chunks/{chunk-KBJHAD2P.Bfz5cQAa.js → chunk-KBJHAD2P.Dpm7St5I.js} +1 -1
- package/library/chunks/{chunk-NSK5VX7P.BkWzMz1o.js → chunk-NSK5VX7P.JTL9VQLt.js} +1 -1
- package/library/chunks/{chunk-QR6OTTB3.DyBl4spZ.js → chunk-QR6OTTB3.1iZWec7S.js} +6 -6
- package/library/chunks/{chunk-UBXNYLIW.BjkOeuJd.js → chunk-UBXNYLIW.DiZRcRzh.js} +2 -2
- package/library/chunks/{chunk-W5SLKNZC.DzlXmWcA.js → chunk-W5SLKNZC.BpdNkiim.js} +1 -1
- package/library/chunks/{chunk-WRU74C26.BDl8PZFV.js → chunk-WRU74C26.BREX4nlj.js} +3 -3
- package/library/chunks/{classDiagram-JCYQIIEL.P36yteOv.js → classDiagram-JCYQIIEL.CHysnuuw.js} +12 -12
- package/library/chunks/{classDiagram-v2-OCEON4UE.C05djrx3.js → classDiagram-v2-OCEON4UE.CMVfaUrJ.js} +12 -12
- package/library/chunks/{color-picker.DZUudAAS.js → color-picker.C1CCN1nS.js} +11 -11
- package/library/chunks/{color-swatch-group.CuMJc6m8.js → color-swatch-group.BAIZMur5.js} +24 -24
- package/library/chunks/{color-swatch.DXAr2gBg.js → color-swatch.93BgkncM.js} +3 -3
- package/library/chunks/{config-manager.B6c9XW1s.js → config-manager.DijEOQly.js} +32 -32
- package/library/chunks/{configs-controller.TQDPq63n.js → configs-controller.B91MEy-4.js} +9 -9
- package/library/chunks/{confirm-popover.sZVNhFPh.js → confirm-popover.BRYw_62p.js} +4 -4
- package/library/chunks/{copy-button.CqqKJEh3.js → copy-button.BVuGJ0pX.js} +2 -2
- package/library/chunks/{corner-position-input-group.nTlFes0_.js → corner-position-input-group.zh-KziJB.js} +4 -4
- package/library/chunks/{cropper.BF32WRyP.js → cropper.D8Uu43xy.js} +1 -1
- package/library/chunks/{cynefinDiagram-MW4NZA55.CN3dX-zy.js → cynefinDiagram-MW4NZA55.CNmGi2wN.js} +3 -3
- package/library/chunks/{dagre-VZM6K2ZE.DpSsP2YW.js → dagre-VZM6K2ZE.pAZyqROg.js} +8 -8
- package/library/chunks/date-calendar.D-LYjKFX.js +188 -0
- package/library/chunks/date.kywrEgxd.js +363 -0
- package/library/chunks/{details.DSgp6VAD.js → details.BXMJk9oy.js} +1 -1
- package/library/chunks/{diagram-7IWD3JNH.C3K0gCHG.js → diagram-7IWD3JNH.BDOF6I2J.js} +4 -4
- package/library/chunks/{diagram-B4RE2ZJO.BULgC23C.js → diagram-B4RE2ZJO.DT1Xf2Kc.js} +2 -2
- package/library/chunks/{diagram-LBJQPF4R.BmYYTkym.js → diagram-LBJQPF4R.i67nojTE.js} +3 -3
- package/library/chunks/{diagram-Q27KOJAE.Bj5ayV3p.js → diagram-Q27KOJAE.C9Y5E3pX.js} +5 -5
- package/library/chunks/{diagram-UB23O5K3.Bu_lTx_A.js → diagram-UB23O5K3.Dxnn2pgu.js} +3 -3
- package/library/chunks/{dialog.D0oTJWFf.js → dialog.C21jNK4r.js} +3 -3
- package/library/chunks/{diff.Bmdpmpvo.js → diff.BLPeoeMo.js} +1 -1
- package/library/chunks/{document-viewer.L77oYyOp.js → document-viewer.CZ2Fhfs7.js} +14 -14
- package/library/chunks/{dom.BLHsooDR.js → dom.8wD7rIGz.js} +1 -1
- package/library/chunks/{dot-pagination.C1C6NG8d.js → dot-pagination.BdG_9NTv.js} +2 -2
- package/library/chunks/{drawer.BsKzYqKe.js → drawer.DM1zAUgP.js} +2 -2
- package/library/chunks/{dropdown.CKhoP9Cr.js → dropdown.DG5U64BM.js} +16 -7
- package/library/chunks/{dynamic-select.Cb3L0dIB.js → dynamic-select.hfD2F6e4.js} +5 -5
- package/library/chunks/{e-chart.DKFAToIc.js → e-chart.BtYiI1g7.js} +2 -2
- package/library/chunks/{ebnfDiagram-BXEA7PRR.Cg96HHIs.js → ebnfDiagram-BXEA7PRR.C15CrBEH.js} +3 -3
- package/library/chunks/{element-clamp.CGq-62gg.js → element-clamp.Bmn_oyV6.js} +2 -2
- package/library/chunks/{erDiagram-JOGREHBK.CrJ962th.js → erDiagram-JOGREHBK.BAFJcDwv.js} +11 -11
- package/library/chunks/{file-on-demand.BjUW2Ydt.js → file-on-demand.DoiRhsJ7.js} +17 -17
- package/library/chunks/flowDiagram-UKHOOZJN.BkgRtWrB.js +16 -0
- package/library/chunks/{folder-select.DJ5EEod3.js → folder-select.DrM6sqAw.js} +9 -9
- package/library/chunks/{form.D_eBa3AQ.js → form.ChOu6BIn.js} +1 -1
- package/library/chunks/{format-time.QkJcKYrT.js → format-time.BZ7jIbu7.js} +1 -1
- package/library/chunks/{ganttDiagram-PKOTCBZU.D216_p5R.js → ganttDiagram-PKOTCBZU.BWKE9zb3.js} +2 -2
- package/library/chunks/{gitGraphDiagram-DS77QQ5N.BGTaYiUE.js → gitGraphDiagram-DS77QQ5N.Dh9BZvJA.js} +2 -2
- package/library/chunks/{header.CowQINf-.js → header.aHKslWaJ.js} +2 -2
- package/library/chunks/{i18n.Bjg2ubA4.js → i18n.qIMzqW-F.js} +43 -1
- package/library/chunks/{icon-button.qJd_az6T.js → icon-button.DTyZ7Nwc.js} +2 -2
- package/library/chunks/{iframe.sl2wnUcC.js → iframe.DU9XEE6J.js} +1 -1
- package/library/chunks/{image-comparer.BCD6kzLm.js → image-comparer.yDCQTe-Z.js} +1 -1
- package/library/chunks/{image.-lgb634-.js → image.C6ffajdy.js} +2 -2
- package/library/chunks/{infoDiagram-6WML65LV.BHVojFJh.js → infoDiagram-6WML65LV.BlZ2eFcf.js} +2 -2
- package/library/chunks/{input.DZRed6yo.js → input.1CW0nLBL.js} +19 -6
- package/library/chunks/{ishikawaDiagram-WSZJBQD7.nZsYnPcQ.js → ishikawaDiagram-WSZJBQD7.QMHGwtgV.js} +3 -3
- package/library/chunks/{journeyDiagram-NVQOT4AX.BXUxAk98.js → journeyDiagram-NVQOT4AX.C-ovuC8R.js} +2 -2
- package/library/chunks/{kanban-definition-27J2QSJJ.Bg8-oEtc.js → kanban-definition-27J2QSJJ.CwAo6fJw.js} +8 -8
- package/library/chunks/{line-clamp.Dl3_JdHX.js → line-clamp.BDFNqZZ8.js} +47 -28
- package/library/chunks/{markdown.BzDRvv-f.js → markdown.BBOqRlzE.js} +4 -4
- package/library/chunks/{masonry.BxNeClR6.js → masonry.BrOEearB.js} +3 -3
- package/library/chunks/{menu-item.au-gTg1F.js → menu-item.B6Lww_R9.js} +3 -3
- package/library/chunks/{menu.BxBtGPsg.js → menu.DgRAUDo_.js} +2 -2
- package/library/chunks/{mermaid.core.m1JI7kDY.js → mermaid.core.CGY0RVtv.js} +49 -49
- package/library/chunks/{mindmap-definition-FAOFIHXS.DwjOzYq5.js → mindmap-definition-FAOFIHXS.CQvqcBzU.js} +10 -10
- package/library/chunks/{option.DWE0tark.js → option.DXo-QZhI.js} +1 -1
- package/library/chunks/{padding-input-group.D2Qx15Yj.js → padding-input-group.tjIBMptQ.js} +1 -1
- package/library/chunks/{pagination.ByLuPMyE.js → pagination.CVVtlgOf.js} +7 -7
- package/library/chunks/{pegDiagram-VL7TDLO6.BaVddVr3.js → pegDiagram-VL7TDLO6.CCjKBwxn.js} +3 -3
- package/library/chunks/{pieDiagram-7S7Q4E2Y.lZiCqBKs.js → pieDiagram-7S7Q4E2Y.BIlwtlJL.js} +3 -3
- package/library/chunks/{popup.w4ZU3jI-.js → popup.jQD3De0E.js} +2 -2
- package/library/chunks/{position-picker.X2hhfGx7.js → position-picker.DW9YTney.js} +3 -3
- package/library/chunks/{progress-bar.CynVLLnY.js → progress-bar.2YrCjo_K.js} +1 -1
- package/library/chunks/{progress-ring.Bfdj3-uB.js → progress-ring.D50j7Uhy.js} +1 -1
- package/library/chunks/purify.es.jxOE2kAK.js +867 -0
- package/library/chunks/{quadrantDiagram-CIZ2JOQS.DswnHa_z.js → quadrantDiagram-CIZ2JOQS.DorpRl0y.js} +1 -1
- package/library/chunks/{radio-card.VEsyM8ue.js → radio-card.C_GVggMn.js} +2 -2
- package/library/chunks/{radio-group.CHlxPcrs.js → radio-group.DfR13lVB.js} +1 -1
- package/library/chunks/{radio.DhPbmKbQ.js → radio.BmN7pFIX.js} +1 -1
- package/library/chunks/{railroadDiagram-AXF67PYL.RYtWvnP4.js → railroadDiagram-AXF67PYL.c5ghpRCW.js} +3 -3
- package/library/chunks/{range.ObEMbygm.js → range.C14Kx5Ln.js} +3 -3
- package/library/chunks/{rating.CNeNn996.js → rating.B6WhmtiT.js} +1 -1
- package/library/chunks/{relative-time.BfE3UOhF.js → relative-time.BF48GQmV.js} +1 -1
- package/library/chunks/{requirementDiagram-LRYGKXZP.BhxZAEJL.js → requirementDiagram-LRYGKXZP.MlkqKyhd.js} +10 -10
- package/library/chunks/{sankeyDiagram-W5VNT64P.Dk8npZSg.js → sankeyDiagram-W5VNT64P.Ch23b1-S.js} +1 -1
- package/library/chunks/{select.BV0Necz7.js → select.D-QQK2rH.js} +134 -123
- package/library/chunks/{sequenceDiagram-SI44F4Z6.BNjBc769.js → sequenceDiagram-SI44F4Z6.CZxsjRpC.js} +4 -4
- package/library/chunks/{shadow-input-group.Xxuzm8Qe.js → shadow-input-group.Ch6vHKZp.js} +2 -2
- package/library/chunks/{share-option-list.DOaEypfQ.js → share-option-list.DZHvOfV4.js} +3 -3
- package/library/chunks/{sidebar.CiZOJ49X.js → sidebar.BftNiyQt.js} +32 -22
- package/library/chunks/{size-input-group.wXuG0-RB.js → size-input-group.CbsKvFaO.js} +5 -5
- package/library/chunks/{spinner.Bv06U7NJ.js → spinner.CCSVc6Z6.js} +1 -1
- package/library/chunks/{split-panel.Cag0lAvv.js → split-panel.CRHvHDiv.js} +1 -1
- package/library/chunks/{src.Dia365C9.js → src.D0_s2pWf.js} +26 -26
- package/library/chunks/src.DEO8lR91.js +103 -0
- package/library/chunks/{stateDiagram-OKZ733FA.DkiIgxjd.js → stateDiagram-OKZ733FA.JCaGHMmH.js} +12 -12
- package/library/chunks/{stateDiagram-v2-UEYNNEHI.oVj_Ex1_.js → stateDiagram-v2-UEYNNEHI.CKrKpvxj.js} +12 -12
- package/library/chunks/{step.D93ReCO1.js → step.CiCIM79l.js} +3 -3
- package/library/chunks/{stepper-wizard.CPZ2mSze.js → stepper-wizard.BKSPLzfU.js} +2 -2
- package/library/chunks/{stepper.D0JB_GVh.js → stepper.r0k2sIAi.js} +1 -1
- package/library/chunks/{string.9yahdkB8.js → string.TY0RTPc8.js} +1 -1
- package/library/chunks/{swimlanes-SLNWSIFB.DKU7qXJ7.js → swimlanes-SLNWSIFB.BnCITr-P.js} +8 -8
- package/library/chunks/{swimlanesDiagram-ULZ7WXOC.DYwYMO_K.js → swimlanesDiagram-ULZ7WXOC.DMYLowNi.js} +12 -12
- package/library/chunks/{switch.BM9msK5T.js → switch.BuleQplE.js} +1 -1
- package/library/chunks/{tab-group.dnnT9Mk6.js → tab-group.B6O3pBw0.js} +8 -8
- package/library/chunks/{tab.CYYAua8Y.js → tab.DHblc3F_.js} +3 -3
- package/library/chunks/{tag.DQLauctm.js → tag.Bp7R2CeG.js} +3 -3
- package/library/chunks/{textarea.CHSZI8vt.js → textarea.BQV58bk8.js} +1 -1
- package/library/chunks/{timecode.DjI1OTXD.js → timecode.B6JsxLxl.js} +1 -1
- package/library/chunks/{timeline-definition-Z64GVDOM.agRZ87Zs.js → timeline-definition-Z64GVDOM.DpGlraiA.js} +3 -3
- package/library/chunks/{tooltip.Cc02vm6M.js → tooltip.C11omEOs.js} +17 -21
- package/library/chunks/{tree.BI7r-WnZ.js → tree.CpN2Va5s.js} +4 -4
- package/library/chunks/{typeface.DTLrIP0B.js → typeface.oJr92CGd.js} +3 -3
- package/library/chunks/{vennDiagram-T6HMQDX7.Cd9lVObe.js → vennDiagram-T6HMQDX7.DYlGT1g9.js} +3 -3
- package/library/chunks/{video.DWmHPbXO.js → video.CtWiwJj6.js} +6 -6
- package/library/chunks/{wardleyDiagram-T6FBY63Y.yCklp5Oa.js → wardleyDiagram-T6FBY63Y.DFkqP4xG.js} +3 -3
- package/library/chunks/{xychartDiagram-ELKLHX3M.CLuRN0XK.js → xychartDiagram-ELKLHX3M.CmCPBha7.js} +5 -5
- package/library/components/alert.js +1 -1
- package/library/components/array-line-clamp.js +1 -1
- package/library/components/asset-link-format.js +1 -1
- package/library/components/atoms.js +55 -55
- package/library/components/audio.js +1 -1
- package/library/components/bicolor-picker.js +1 -1
- package/library/components/border-input-group.js +1 -1
- package/library/components/breadcrumb.js +1 -1
- package/library/components/button.js +1 -1
- package/library/components/checkbox.js +1 -1
- package/library/components/color-picker.js +1 -1
- package/library/components/color-swatch-group.js +1 -1
- package/library/components/color-swatch.js +1 -1
- package/library/components/confirm-popover.js +1 -1
- package/library/components/copy-button.js +1 -1
- package/library/components/corner-position-input-group.js +1 -1
- package/library/components/cropper.js +1 -1
- package/library/components/date-calendar.js +1 -1
- package/library/components/details.js +1 -1
- package/library/components/dialog.js +1 -1
- package/library/components/diff.js +1 -1
- package/library/components/document-viewer.js +1 -1
- package/library/components/dot-pagination.js +1 -1
- package/library/components/drawer.js +1 -1
- package/library/components/dropdown.js +1 -1
- package/library/components/dynamic-select.js +1 -1
- package/library/components/e-chart.js +1 -1
- package/library/components/element-clamp.js +1 -1
- package/library/components/file-on-demand.js +1 -1
- package/library/components/folder-select.js +1 -1
- 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 +1 -1
- package/library/components/icon-button.js +1 -1
- package/library/components/iframe.js +1 -1
- package/library/components/image-comparer.js +1 -1
- package/library/components/image.js +1 -1
- package/library/components/input.js +1 -1
- package/library/components/line-clamp.js +1 -1
- package/library/components/markdown.js +1 -1
- package/library/components/masonry.js +1 -1
- package/library/components/menu-item.js +1 -1
- package/library/components/menu.js +1 -1
- package/library/components/molecules.js +17 -17
- package/library/components/option.js +1 -1
- package/library/components/organisms.js +3 -3
- package/library/components/padding-input-group.js +1 -1
- package/library/components/pagination.js +1 -1
- package/library/components/popup.js +1 -1
- package/library/components/position-picker.js +1 -1
- package/library/components/progress-bar.js +1 -1
- package/library/components/progress-ring.js +1 -1
- package/library/components/radio-card.js +1 -1
- package/library/components/radio-group.js +1 -1
- package/library/components/radio.js +1 -1
- package/library/components/range.js +1 -1
- package/library/components/rating.js +1 -1
- package/library/components/relative-time.js +1 -1
- package/library/components/select.js +1 -1
- package/library/components/shadow-input-group.js +1 -1
- package/library/components/share-option-list.js +1 -1
- package/library/components/sidebar.js +1 -1
- package/library/components/size-input-group.js +1 -1
- package/library/components/spinner.js +1 -1
- package/library/components/split-panel.js +1 -1
- package/library/components/step.js +1 -1
- package/library/components/stepper-wizard.js +1 -1
- package/library/components/stepper.js +1 -1
- package/library/components/switch.js +1 -1
- package/library/components/tab-group.js +1 -1
- package/library/components/tab.js +1 -1
- package/library/components/tag.js +1 -1
- package/library/components/textarea.js +1 -1
- package/library/components/timecode.js +1 -1
- package/library/components/tooltip.js +1 -1
- package/library/components/tree-item.js +1 -1
- package/library/components/tree.js +1 -1
- package/library/components/typeface.js +1 -1
- package/library/components/types.js +21914 -19131
- package/library/components/video.js +1 -1
- package/library/package.json +1 -1
- package/library/packages/atoms/src/components/checkbox/checkbox.d.ts +2 -2
- package/library/packages/atoms/src/components/date-calendar/date-calendar.d.ts +62 -9
- package/library/packages/atoms/src/components/dropdown/dropdown.d.ts +6 -0
- package/library/packages/atoms/src/components/input/input.d.ts +20 -1
- package/library/packages/atoms/src/components/line-clamp/line-clamp.d.ts +3 -0
- package/library/packages/atoms/src/components/radio/radio.d.ts +3 -0
- package/library/packages/atoms/src/components/select/select.d.ts +7 -9
- package/library/packages/atoms/src/components/tooltip/tooltip.d.ts +4 -1
- package/library/packages/events/src/cx-search-facet-date-change.d.ts +11 -0
- package/library/packages/events/src/cx-search-facet-focus-title.d.ts +10 -0
- package/library/packages/events/src/cx-search-facet-reset.d.ts +12 -0
- package/library/packages/events/src/cx-search-facet-select-all.d.ts +13 -0
- package/library/packages/events/src/cx-search-facet-show-more.d.ts +12 -0
- package/library/packages/events/src/cx-search-facet-toggle.d.ts +11 -0
- package/library/packages/events/src/cx-search-facets-apply.d.ts +17 -0
- package/library/packages/events/src/cx-search-facets-change-filters.d.ts +6 -0
- package/library/packages/events/src/cx-search-facets-clear-all.d.ts +10 -0
- package/library/packages/events/src/cx-search-facets-custom.d.ts +10 -0
- package/library/packages/events/src/cx-search-facets-facet-expand.d.ts +9 -0
- package/library/packages/events/src/cx-search-facets-node-expand.d.ts +11 -0
- package/library/packages/events/src/cx-search-facets-refresh.d.ts +6 -0
- package/library/packages/events/src/cx-search-facets-show-more.d.ts +8 -0
- package/library/packages/events/src/cx-search-facets-summary-expand.d.ts +9 -0
- package/library/packages/events/src/cx-search-facets-summary-remove.d.ts +12 -0
- package/library/packages/events/src/events.d.ts +16 -0
- package/library/packages/molecules/src/input-date-picker/input-date-picker.d.ts +116 -0
- package/library/packages/molecules/src/sidebar/sidebar.d.ts +1 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +43 -2
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-crop/asset-link-format-crop.d.ts +7 -2
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-dimensions/asset-link-format-dimensions.d.ts +12 -3
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-quality/asset-link-format-quality.d.ts +1 -0
- package/library/packages/organisms/src/downloader/downloader.d.ts +6 -0
- package/library/packages/organisms/src/index.d.ts +1 -0
- package/library/packages/organisms/src/search-facets/components/search-facet/search-facet.d.ts +95 -0
- package/library/packages/organisms/src/search-facets/components/search-facet/search-facet.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-advanced-date/advanced-date-reading.d.ts +90 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-advanced-date/search-facet-advanced-date.d.ts +85 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-advanced-date/search-facet-advanced-date.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-color/search-facet-color.d.ts +47 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-color/search-facet-color.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-date/date-range-validation.d.ts +67 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-date/search-facet-date.d.ts +120 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-date/search-facet-date.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-similar/search-facet-similar.d.ts +44 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-similar/search-facet-similar.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-tree/search-facet-tree.d.ts +104 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-tree/search-facet-tree.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/components/search-facet-tree/visible-nodes.d.ts +36 -0
- package/library/packages/organisms/src/search-facets/components/search-facets-summary/search-facets-summary.d.ts +67 -0
- package/library/packages/organisms/src/search-facets/components/search-facets-summary/search-facets-summary.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/search-facets.d.ts +198 -0
- package/library/packages/organisms/src/search-facets/search-facets.fixtures.d.ts +141 -0
- package/library/packages/organisms/src/search-facets/search-facets.styles.d.ts +2 -0
- package/library/packages/organisms/src/search-facets/state/date-drafts.d.ts +11 -0
- package/library/packages/organisms/src/search-facets/state/long-panel.d.ts +7 -0
- package/library/packages/organisms/src/search-facets/state/preview-summary.d.ts +17 -0
- package/library/packages/organisms/src/search-facets/state/preview-waiting-changes.d.ts +12 -0
- package/library/packages/organisms/src/search-facets/state/response-correlation.d.ts +9 -0
- package/library/packages/organisms/src/search-facets/state/waiting-changes.d.ts +179 -0
- package/library/packages/organisms/src/search-facets/types.d.ts +347 -0
- package/library/packages/types/src/asset-link-format.d.ts +6 -0
- package/library/packages/types/src/search-facets.d.ts +104 -0
- package/library/packages/utils/src/custom-element/i18n.d.ts +42 -0
- package/library/packages/utils/src/date/calendar-grid.d.ts +5 -6
- package/library/packages/utils/src/date/date.d.ts +7 -1
- package/library/react-web-component.d.ts +99 -9
- package/library/utils.js +13 -13
- package/package.json +1 -1
- package/library/chunks/date-calendar.B7e6WBzh.js +0 -78
- package/library/chunks/date.BL4L64Hx.js +0 -358
- package/library/chunks/flowDiagram-UKHOOZJN.Bj_loY7-.js +0 -16
- package/library/chunks/purify.es.Bwsrv9kG.js +0 -866
- package/library/chunks/src.-wSEUjRV.js +0 -103
|
@@ -3,49 +3,50 @@ import { a as r, i, n as a, r as o, t as s } from "./cortex-element.DTrNUtdr.js"
|
|
|
3
3
|
import { t as c } from "./query.B1yi7t71.js";
|
|
4
4
|
import { t as l } from "./component.styles.0xM1ZmBs.js";
|
|
5
5
|
import { t as u } from "./custom-element.BEMYNDK1.js";
|
|
6
|
-
import { t as d } from "./i18n.
|
|
6
|
+
import { t as d } from "./i18n.qIMzqW-F.js";
|
|
7
7
|
import { t as f } from "./watch.Ub5r8btz.js";
|
|
8
|
-
import { t as p } from "./icon-button.
|
|
8
|
+
import { t as p } from "./icon-button.DTyZ7Nwc.js";
|
|
9
9
|
import { t as m } from "./when.BUskJLtZ.js";
|
|
10
10
|
import { t as h } from "./icon.CeQpEaQz.js";
|
|
11
11
|
import { t as g } from "./style-map.DPGQIxip.js";
|
|
12
12
|
import { c as ee } from "./browser.gIznFIix.js";
|
|
13
|
-
import { t as _ } from "./button.
|
|
14
|
-
import { g as te } from "./string.
|
|
15
|
-
import { t as ne } from "./tooltip.
|
|
13
|
+
import { t as _ } from "./button.VUFrOP0u.js";
|
|
14
|
+
import { g as te } from "./string.TY0RTPc8.js";
|
|
15
|
+
import { t as ne } from "./tooltip.C11omEOs.js";
|
|
16
16
|
import { n as v } from "./position-picker.dY_vgF_H.js";
|
|
17
|
-
import { l as re, r as
|
|
18
|
-
import { t as
|
|
19
|
-
import { n as
|
|
20
|
-
import { t as
|
|
21
|
-
import { t as
|
|
22
|
-
import { t as
|
|
23
|
-
import { t as
|
|
24
|
-
import { t as
|
|
25
|
-
import { t as
|
|
26
|
-
import { t as
|
|
27
|
-
import { t as
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import { t as
|
|
31
|
-
import {
|
|
32
|
-
import { t as
|
|
33
|
-
import { t as
|
|
34
|
-
import { t as
|
|
35
|
-
import "./
|
|
36
|
-
import
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
17
|
+
import { l as re, r as ie } from "./number.CNp5LKkv.js";
|
|
18
|
+
import { t as ae } from "./image.C0s1gL4z.js";
|
|
19
|
+
import { n as y, t as b } from "./typography.B0mkhqTB.js";
|
|
20
|
+
import { t as oe } from "./button-group.CPfXrqyq.js";
|
|
21
|
+
import { t as se } from "./checkbox.BzR50Is_.js";
|
|
22
|
+
import { t as ce } from "./math.od1DVmRk.js";
|
|
23
|
+
import { t as x } from "./repeat.CKv9FPlC.js";
|
|
24
|
+
import { t as le } from "./input.1CW0nLBL.js";
|
|
25
|
+
import { t as S } from "./option.DXo-QZhI.js";
|
|
26
|
+
import { t as C } from "./space.Dd8jezXK.js";
|
|
27
|
+
import { t as w } from "./select.D-QQK2rH.js";
|
|
28
|
+
import { t as ue } from "./visually-hidden.Bv3SInZp.js";
|
|
29
|
+
import { D as de, E as fe, T as pe, b as me, f as he, g as ge, m as _e, x as ve } from "./src.D0_s2pWf.js";
|
|
30
|
+
import { t as T } from "./details.BXMJk9oy.js";
|
|
31
|
+
import { t as ye } from "./divider.CqSNZCU8.js";
|
|
32
|
+
import { a as E, c as be, l as D, n as xe, o as O, r as k, s as A, t as j, u as M } from "./asset-link-format.D6L-qc3X.js";
|
|
33
|
+
import { t as Se } from "./menu-label.B-FOyfAX.js";
|
|
34
|
+
import { t as Ce } from "./switch.BuleQplE.js";
|
|
35
|
+
import { t as we } from "./v4.JyXW8GUB.js";
|
|
36
|
+
import "./cropper.D8Uu43xy.js";
|
|
37
|
+
import { t as Te } from "./_baseUniq.h_pGICPH.js";
|
|
38
|
+
import { d as Ee, i as De, n as Oe, o as ke, p as N, r as Ae, s as je, t as Me } from "./string-array.F2GuxHp0.js";
|
|
39
|
+
import { t as Ne } from "./position-picker.DW9YTney.js";
|
|
39
40
|
//#region ../../node_modules/lodash-es/uniq.js
|
|
40
|
-
function
|
|
41
|
-
return e && e.length ?
|
|
41
|
+
function Pe(e) {
|
|
42
|
+
return e && e.length ? Te(e) : [];
|
|
42
43
|
}
|
|
43
44
|
//#endregion
|
|
44
45
|
//#region ../../packages/services/src/api/asset/asset.utils.ts
|
|
45
|
-
function
|
|
46
|
+
function Fe(e) {
|
|
46
47
|
return typeof e == "object" && !!e && "URI" in e;
|
|
47
48
|
}
|
|
48
|
-
var
|
|
49
|
+
var Ie = {
|
|
49
50
|
artist: "Artist",
|
|
50
51
|
color: "Color",
|
|
51
52
|
createDate: "CreateDate",
|
|
@@ -67,34 +68,34 @@ var Ne = {
|
|
|
67
68
|
systemIdentifier: "SystemIdentifier",
|
|
68
69
|
text: "Text",
|
|
69
70
|
title: "Title"
|
|
70
|
-
},
|
|
71
|
+
}, Le = /* @__PURE__ */ new Set([
|
|
71
72
|
"mediaDate",
|
|
72
73
|
"createDate",
|
|
73
74
|
"editDate"
|
|
74
75
|
]);
|
|
75
|
-
function
|
|
76
|
+
function Re(e) {
|
|
76
77
|
return !/[\s&+/*"\\:(),'<>~|[\]{}]/.test(e) && !/^(?:OR|AND|NOT)$/.test(e) ? e : `"${e.replace(/\\/g, "\\\\").replace(/"/g, "\\\"")}"`;
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
let n = (Array.isArray(t) ? t : [t]).map((t) => `${e}:${
|
|
79
|
+
function ze(e, t) {
|
|
80
|
+
let n = (Array.isArray(t) ? t : [t]).map((t) => `${e}:${Re(t)}`);
|
|
80
81
|
return n.length > 1 ? `(${n.join(" OR ")})` : n[0] ?? "";
|
|
81
82
|
}
|
|
82
|
-
function
|
|
83
|
+
function Be(e, t) {
|
|
83
84
|
return (Array.isArray(t) ? t : [t]).map((t) => `${e}${t.operator}${t.value}`).join(" AND ");
|
|
84
85
|
}
|
|
85
|
-
function
|
|
86
|
+
function Ve(e) {
|
|
86
87
|
let t = [];
|
|
87
88
|
for (let n of Object.keys(e)) {
|
|
88
89
|
let r = n, i = e[r];
|
|
89
90
|
if (i == null) continue;
|
|
90
91
|
if (r === "custom") {
|
|
91
|
-
for (let [e, n] of Object.entries(i)) t.push(
|
|
92
|
+
for (let [e, n] of Object.entries(i)) t.push(ze(e, n));
|
|
92
93
|
continue;
|
|
93
94
|
}
|
|
94
|
-
let a =
|
|
95
|
+
let a = Ie[r];
|
|
95
96
|
if (a) {
|
|
96
|
-
if (
|
|
97
|
-
t.push(
|
|
97
|
+
if (Le.has(r)) {
|
|
98
|
+
t.push(Be(a, i));
|
|
98
99
|
continue;
|
|
99
100
|
}
|
|
100
101
|
if (r === "color") {
|
|
@@ -104,87 +105,87 @@ function Re(e) {
|
|
|
104
105
|
if (r === "parentFolderIdentifier") {
|
|
105
106
|
let e = Array.isArray(i) ? i : [i];
|
|
106
107
|
if (e.length === 0) continue;
|
|
107
|
-
let n = [...e.map((e) => `ParentFolderIdentifier:${
|
|
108
|
+
let n = [...e.map((e) => `ParentFolderIdentifier:${Re(String(e))}`), ...e.map((e) => `ParentAlbumIdentifier:${Re(String(e))}`)];
|
|
108
109
|
t.push(`(${n.join(" OR ")})`);
|
|
109
110
|
continue;
|
|
110
111
|
}
|
|
111
|
-
t.push(
|
|
112
|
+
t.push(ze(a, i));
|
|
112
113
|
}
|
|
113
114
|
}
|
|
114
115
|
return t.join(" AND ");
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
-
if ("and" in e) return e.and.map(
|
|
117
|
+
function He(e) {
|
|
118
|
+
if ("and" in e) return e.and.map(He).filter(Boolean).join(" AND ");
|
|
118
119
|
if ("or" in e) {
|
|
119
|
-
let t = e.or.map(
|
|
120
|
+
let t = e.or.map(He).filter(Boolean);
|
|
120
121
|
return t.length > 1 ? `(${t.join(" OR ")})` : t[0] ?? "";
|
|
121
122
|
}
|
|
122
123
|
if ("not" in e) {
|
|
123
|
-
let t =
|
|
124
|
+
let t = He(e.not);
|
|
124
125
|
return t ? `NOT (${t})` : "";
|
|
125
126
|
}
|
|
126
|
-
return
|
|
127
|
+
return Ve(e);
|
|
127
128
|
}
|
|
128
129
|
//#endregion
|
|
129
130
|
//#region ../../packages/services/src/api/asset/asset.ts
|
|
130
|
-
var
|
|
131
|
+
var Ue = "CoreField.LargeSizePreview", P = "CoreField.DocType", We = "Document.Title", Ge = "Document.CaptionLong", F = "Document.FileExtension", Ke = "CoreField.FileSize", qe = "CoreField.Identifier", Je = "CoreField.MaxHeight", Ye = "CoreField.MaxWidth", I = "Document.RecordID", Xe = "CoreField.DocSubType", Ze = "CoreField.TitleWithFallback", L = "CoreField.OriginalFileName", Qe = "__width", $e = "__height", et = "CoreField.OriginalPreview", tt = "Document.DocSubType", nt = "Document.InPoint", rt = "Document.OutPoint", it = {
|
|
131
132
|
DEFAULT_VIEW_SIZE: "Document.LargeSizePreview",
|
|
132
133
|
ORIGINAL_VIEW_SIZE: "Document.OriginalPreview"
|
|
133
|
-
},
|
|
134
|
-
[
|
|
135
|
-
[
|
|
136
|
-
},
|
|
137
|
-
function
|
|
138
|
-
return
|
|
134
|
+
}, at = {
|
|
135
|
+
[Ue]: it.DEFAULT_VIEW_SIZE,
|
|
136
|
+
[et]: it.ORIGINAL_VIEW_SIZE
|
|
137
|
+
}, ot = Object.fromEntries(Object.entries(at).map(([e, t]) => [t, e]));
|
|
138
|
+
function st(e) {
|
|
139
|
+
return at[e] ?? e;
|
|
139
140
|
}
|
|
140
|
-
function
|
|
141
|
-
return e === "CoreField.TitleWithFallback" ? [
|
|
141
|
+
function ct(e) {
|
|
142
|
+
return e === "CoreField.TitleWithFallback" ? [We, L] : [st(e)];
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function lt(e) {
|
|
144
145
|
let t = {};
|
|
145
146
|
for (let [n, r] of Object.entries(e)) {
|
|
146
|
-
let e =
|
|
147
|
+
let e = ot[n] ?? n;
|
|
147
148
|
t[e] = r;
|
|
148
149
|
}
|
|
149
150
|
return t;
|
|
150
151
|
}
|
|
151
|
-
function
|
|
152
|
-
e[n] =
|
|
152
|
+
function ut(e, t, n) {
|
|
153
|
+
e[n] = R(t, n);
|
|
153
154
|
let r = t[n];
|
|
154
|
-
return r != null &&
|
|
155
|
+
return r != null && Fe(r) && (typeof r.Width == "number" && r.Width > 0 && (e[`${n}${Qe}`] = String(r.Width)), typeof r.Height == "number" && r.Height > 0 && (e[`${n}${$e}`] = String(r.Height))), e;
|
|
155
156
|
}
|
|
156
|
-
function
|
|
157
|
+
function dt(e) {
|
|
157
158
|
let t = new URLSearchParams();
|
|
158
159
|
for (let [n, r] of Object.entries(e)) r != null && (Array.isArray(r) ? r.forEach((e) => t.append(n, String(e))) : t.append(n, String(r)));
|
|
159
160
|
return t;
|
|
160
161
|
}
|
|
161
|
-
async function
|
|
162
|
-
let m = n?.flatMap(
|
|
163
|
-
let t =
|
|
164
|
-
return h && (t[
|
|
162
|
+
async function ft({ consistency: e, countPerPage: t, fields: n, getPermanentAssetsPaths: r, httpMethod: i = "GET", isSiteBuilder: a, pageNumber: o, query: s, securityByPassToken: c, siteUrl: l, sort: u, throwOnError: d, token: f, useSession: p }) {
|
|
163
|
+
let m = n?.flatMap(ct), h = n?.includes("CoreField.TitleWithFallback") ?? !1, g = (e) => {
|
|
164
|
+
let t = lt(e);
|
|
165
|
+
return h && (t[Ze] = R(t, "Document.Title") || R(t, "CoreField.OriginalFileName")), t;
|
|
165
166
|
}, ee = {
|
|
166
167
|
Consistency: e || void 0,
|
|
167
168
|
CountPerPage: t,
|
|
168
|
-
Fields:
|
|
169
|
+
Fields: Pe(m),
|
|
169
170
|
Format: "json",
|
|
170
171
|
GetPermanentAssetsPaths: r ?? void 0,
|
|
171
172
|
PageNumber: o,
|
|
172
|
-
Query:
|
|
173
|
+
Query: He(s),
|
|
173
174
|
SecurityByPassToken: c || void 0,
|
|
174
175
|
Sort: u || void 0,
|
|
175
176
|
UseSession: p || void 0
|
|
176
177
|
}, _ = i === "POST";
|
|
177
178
|
try {
|
|
178
|
-
return (await
|
|
179
|
+
return (await N.request({
|
|
179
180
|
baseURL: l,
|
|
180
181
|
headers: f ? { Authorization: `Bearer ${f}` } : void 0,
|
|
181
182
|
method: i,
|
|
182
|
-
..._ ? { data: a ? ee :
|
|
183
|
+
..._ ? { data: a ? ee : dt(ee) } : {
|
|
183
184
|
params: ee,
|
|
184
185
|
paramsSerializer: { indexes: null }
|
|
185
186
|
},
|
|
186
187
|
responseType: "json",
|
|
187
|
-
transformResponse: [...Array.isArray(
|
|
188
|
+
transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], a ? (e) => ({
|
|
188
189
|
items: (e.results?.Items ?? []).map(g),
|
|
189
190
|
sort: e.results?.GlobalInfo?.Sort ?? "",
|
|
190
191
|
totalCount: e.results?.GlobalInfo?.TotalCount ?? 0
|
|
@@ -193,7 +194,7 @@ async function lt({ consistency: e, countPerPage: t, fields: n, getPermanentAsse
|
|
|
193
194
|
sort: e.APIResponse?.GlobalInfo?.Sort ?? "",
|
|
194
195
|
totalCount: e.APIResponse?.GlobalInfo?.TotalCount ?? 0
|
|
195
196
|
})],
|
|
196
|
-
url: a ? _ ?
|
|
197
|
+
url: a ? _ ? je.SEARCH_ASSETS_POST : je.SEARCH_ASSETS : Ee["4.0"]
|
|
197
198
|
})).data;
|
|
198
199
|
} catch (e) {
|
|
199
200
|
if (d) throw e;
|
|
@@ -204,9 +205,9 @@ async function lt({ consistency: e, countPerPage: t, fields: n, getPermanentAsse
|
|
|
204
205
|
};
|
|
205
206
|
}
|
|
206
207
|
}
|
|
207
|
-
async function
|
|
208
|
+
async function pt({ assetId: e, extension: t, format: n, siteUrl: r, token: i, transformations: a, useSession: o }) {
|
|
208
209
|
try {
|
|
209
|
-
return (await
|
|
210
|
+
return (await N.request({
|
|
210
211
|
baseURL: r,
|
|
211
212
|
method: "GET",
|
|
212
213
|
params: {
|
|
@@ -218,19 +219,19 @@ async function ut({ assetId: e, extension: t, format: n, siteUrl: r, token: i, t
|
|
|
218
219
|
UseSession: o || void 0
|
|
219
220
|
},
|
|
220
221
|
timeout: 3e5,
|
|
221
|
-
url:
|
|
222
|
+
url: Ae.GET_TRANSFORM_ASSET_LINK
|
|
222
223
|
})).data;
|
|
223
224
|
} catch {
|
|
224
225
|
return null;
|
|
225
226
|
}
|
|
226
227
|
}
|
|
227
|
-
var
|
|
228
|
-
function
|
|
228
|
+
var mt = 50;
|
|
229
|
+
function ht(e, t) {
|
|
229
230
|
let n = [];
|
|
230
231
|
for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
|
|
231
232
|
return n;
|
|
232
233
|
}
|
|
233
|
-
async function
|
|
234
|
+
async function gt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n, isSiteBuilder: r, recordIds: i, securityByPassToken: a, throwOnError: o, token: s }) {
|
|
234
235
|
if (!Array.isArray(i) || i.length === 0) return {
|
|
235
236
|
facets: [],
|
|
236
237
|
items: [],
|
|
@@ -238,11 +239,11 @@ async function pt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n,
|
|
|
238
239
|
};
|
|
239
240
|
let c = t?.filter((e) => e && typeof e == "string") ?? [], l = [
|
|
240
241
|
...c,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
], u =
|
|
242
|
+
L,
|
|
243
|
+
We,
|
|
244
|
+
Ge,
|
|
245
|
+
I
|
|
246
|
+
], u = ht(i, mt), d = await Promise.all(u.map((t) => ft({
|
|
246
247
|
consistency: e,
|
|
247
248
|
countPerPage: t.length,
|
|
248
249
|
fields: l,
|
|
@@ -258,18 +259,18 @@ async function pt({ consistency: e, extraFields: t, getPermanentAssetsPaths: n,
|
|
|
258
259
|
return {
|
|
259
260
|
facets: [],
|
|
260
261
|
items: d.flatMap((e) => e.items).map((e) => ({
|
|
261
|
-
name:
|
|
262
|
-
recordId:
|
|
263
|
-
...c.reduce((t, n) =>
|
|
262
|
+
name: R(e, L),
|
|
263
|
+
recordId: R(e, I),
|
|
264
|
+
...c.reduce((t, n) => ut(t, e, n), {})
|
|
264
265
|
})).sort((e, t) => (f.get(e.recordId) ?? Infinity) - (f.get(t.recordId) ?? Infinity)),
|
|
265
266
|
totalCount: d.reduce((e, t) => e + t.totalCount, 0)
|
|
266
267
|
};
|
|
267
268
|
}
|
|
268
|
-
function
|
|
269
|
+
function R(e, t) {
|
|
269
270
|
let n = e[t];
|
|
270
|
-
return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) :
|
|
271
|
+
return n == null ? "" : typeof n == "string" ? n : typeof n == "number" || typeof n == "boolean" ? String(n) : Fe(n) ? n.URI : "";
|
|
271
272
|
}
|
|
272
|
-
async function
|
|
273
|
+
async function _t({ consistency: e, countPerPage: t, directParentFolderIdentifier: n, extraFields: r, getPermanentAssetsPaths: i, isSiteBuilder: a, limitedDocTypes: o, pageNumber: s, parentFolderIdentifier: c, searchTerm: l, securityByPassToken: u, sortOrder: d, throwOnError: f, token: p }) {
|
|
273
274
|
if (!n && !c) return {
|
|
274
275
|
facets: [],
|
|
275
276
|
items: [],
|
|
@@ -280,19 +281,19 @@ async function mt({ consistency: e, countPerPage: t, directParentFolderIdentifie
|
|
|
280
281
|
parentFolderIdentifier: c,
|
|
281
282
|
...l ? { text: l } : {},
|
|
282
283
|
...o && o.length > 0 ? { docType: o } : {}
|
|
283
|
-
}, g = await
|
|
284
|
+
}, g = await ft({
|
|
284
285
|
consistency: e,
|
|
285
286
|
countPerPage: t,
|
|
286
287
|
fields: [
|
|
287
288
|
...m,
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
289
|
+
Ze,
|
|
290
|
+
Ke,
|
|
291
|
+
P,
|
|
292
|
+
Xe,
|
|
291
293
|
qe,
|
|
292
|
-
|
|
294
|
+
F,
|
|
293
295
|
I,
|
|
294
|
-
L
|
|
295
|
-
R
|
|
296
|
+
L
|
|
296
297
|
],
|
|
297
298
|
getPermanentAssetsPaths: i,
|
|
298
299
|
httpMethod: "POST",
|
|
@@ -307,27 +308,27 @@ async function mt({ consistency: e, countPerPage: t, directParentFolderIdentifie
|
|
|
307
308
|
return {
|
|
308
309
|
facets: [],
|
|
309
310
|
items: g.items.map((e) => {
|
|
310
|
-
let t =
|
|
311
|
+
let t = R(e, F);
|
|
311
312
|
t && !t.startsWith(".") && (t = "." + t);
|
|
312
|
-
let n =
|
|
313
|
+
let n = R(e, I);
|
|
313
314
|
return {
|
|
314
|
-
docSubType:
|
|
315
|
-
docType:
|
|
315
|
+
docSubType: R(e, Xe),
|
|
316
|
+
docType: R(e, "CoreField.DocType") || "",
|
|
316
317
|
extension: t,
|
|
317
318
|
id: n,
|
|
318
|
-
identifier:
|
|
319
|
-
name:
|
|
319
|
+
identifier: R(e, qe),
|
|
320
|
+
name: R(e, L),
|
|
320
321
|
recordId: n,
|
|
321
|
-
size:
|
|
322
|
-
...m.reduce((t, n) =>
|
|
322
|
+
size: R(e, "CoreField.FileSize") || "0 MB",
|
|
323
|
+
...m.reduce((t, n) => ut(t, e, n), {})
|
|
323
324
|
};
|
|
324
325
|
}),
|
|
325
326
|
totalCount: g.totalCount
|
|
326
327
|
};
|
|
327
328
|
}
|
|
328
|
-
async function
|
|
329
|
+
async function vt({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, useSession: i }) {
|
|
329
330
|
try {
|
|
330
|
-
return (await
|
|
331
|
+
return (await N.request({
|
|
331
332
|
method: "GET",
|
|
332
333
|
params: {
|
|
333
334
|
AutoCropMode: e,
|
|
@@ -338,21 +339,21 @@ async function ht({ autoCropMode: e, cropHeight: t, cropWidth: n, imageUrl: r, u
|
|
|
338
339
|
},
|
|
339
340
|
responseType: "json",
|
|
340
341
|
timeout: 3e5,
|
|
341
|
-
transformResponse: [...Array.isArray(
|
|
342
|
+
transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], (e) => ({
|
|
342
343
|
height: e.cropHeight,
|
|
343
344
|
width: e.cropWidth,
|
|
344
345
|
x: e.cropX,
|
|
345
346
|
y: e.cropY
|
|
346
347
|
})],
|
|
347
|
-
url:
|
|
348
|
+
url: Ae.GET_CROP_ZONE_SUGGESTION
|
|
348
349
|
})).data;
|
|
349
350
|
} catch {
|
|
350
351
|
return null;
|
|
351
352
|
}
|
|
352
353
|
}
|
|
353
|
-
async function
|
|
354
|
+
async function yt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, useSession: i }) {
|
|
354
355
|
try {
|
|
355
|
-
return (await
|
|
356
|
+
return (await N.request({
|
|
356
357
|
baseURL: n,
|
|
357
358
|
method: "GET",
|
|
358
359
|
params: {
|
|
@@ -361,7 +362,7 @@ async function gt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, us
|
|
|
361
362
|
UseSession: i || void 0
|
|
362
363
|
},
|
|
363
364
|
responseType: "json",
|
|
364
|
-
transformResponse: [...Array.isArray(
|
|
365
|
+
transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], (e) => !e || typeof e != "object" ? [] : e.proxies?.map((e) => ({
|
|
365
366
|
cdnName: e.cdnName,
|
|
366
367
|
extension: e.extension,
|
|
367
368
|
formatHeight: e.formatHeight,
|
|
@@ -372,31 +373,31 @@ async function gt({ assetRecordId: e, isSiteBuilder: t, siteUrl: n, token: r, us
|
|
|
372
373
|
proxyName: e.proxyName,
|
|
373
374
|
width: e.width
|
|
374
375
|
})) ?? []],
|
|
375
|
-
url: t ?
|
|
376
|
+
url: t ? je.GET_AVAILABLE_PROXIES : ke
|
|
376
377
|
})).data;
|
|
377
378
|
} catch {
|
|
378
379
|
return [];
|
|
379
380
|
}
|
|
380
381
|
}
|
|
381
|
-
async function
|
|
382
|
+
async function bt({ siteUrl: e } = {}) {
|
|
382
383
|
try {
|
|
383
|
-
return (await
|
|
384
|
+
return (await N.request({
|
|
384
385
|
baseURL: e,
|
|
385
386
|
method: "GET",
|
|
386
387
|
responseType: "json",
|
|
387
|
-
transformResponse: [...Array.isArray(
|
|
388
|
+
transformResponse: [...Array.isArray(N.defaults.transformResponse) ? N.defaults.transformResponse : [], (e) => !e || typeof e != "object" ? { formatsByDocType: {
|
|
388
389
|
Audio: {},
|
|
389
390
|
Image: {},
|
|
390
391
|
Multimedia: {},
|
|
391
392
|
Video: {}
|
|
392
393
|
} } : { formatsByDocType: e.formatsByDocType ?? {} }],
|
|
393
|
-
url:
|
|
394
|
+
url: Oe
|
|
394
395
|
})).data;
|
|
395
396
|
} catch {
|
|
396
397
|
return { formatsByDocType: {} };
|
|
397
398
|
}
|
|
398
399
|
}
|
|
399
|
-
async function
|
|
400
|
+
async function xt({ recordIds: e, rightsToCheck: t }) {
|
|
400
401
|
let n = {
|
|
401
402
|
authorizedObjects: [],
|
|
402
403
|
forbiddenObjectsOfReadPermission: [],
|
|
@@ -404,7 +405,7 @@ async function vt({ recordIds: e, rightsToCheck: t }) {
|
|
|
404
405
|
invalidObjects: []
|
|
405
406
|
};
|
|
406
407
|
try {
|
|
407
|
-
let { data: n } = await
|
|
408
|
+
let { data: n } = await N.request({
|
|
408
409
|
method: "GET",
|
|
409
410
|
params: {
|
|
410
411
|
RecordIDs: e,
|
|
@@ -412,7 +413,7 @@ async function vt({ recordIds: e, rightsToCheck: t }) {
|
|
|
412
413
|
},
|
|
413
414
|
paramsSerializer: { indexes: null },
|
|
414
415
|
responseType: "json",
|
|
415
|
-
url:
|
|
416
|
+
url: De.GET_AUTHORIZED_OBJECTS
|
|
416
417
|
});
|
|
417
418
|
return n;
|
|
418
419
|
} catch {
|
|
@@ -421,7 +422,7 @@ async function vt({ recordIds: e, rightsToCheck: t }) {
|
|
|
421
422
|
}
|
|
422
423
|
//#endregion
|
|
423
424
|
//#region ../../packages/tools/src/fetch-image/fetch-image.ts
|
|
424
|
-
var
|
|
425
|
+
var St = 20, z = "TR1", B = "TRX", Ct = /* @__PURE__ */ new Set([".gif"]), wt = /* @__PURE__ */ new Set([
|
|
425
426
|
".avif",
|
|
426
427
|
".bmp",
|
|
427
428
|
".gif",
|
|
@@ -432,18 +433,18 @@ var yt = 20, B = "TR1", V = "TRX", bt = /* @__PURE__ */ new Set([".gif"]), xt =
|
|
|
432
433
|
".svg",
|
|
433
434
|
".webp"
|
|
434
435
|
]);
|
|
435
|
-
function
|
|
436
|
+
function Tt(e) {
|
|
436
437
|
let t = e.toLowerCase(), n = t.startsWith(".") ? t : `.${t}`;
|
|
437
|
-
return
|
|
438
|
+
return wt.has(n);
|
|
438
439
|
}
|
|
439
|
-
function
|
|
440
|
-
return e !== void 0 && e !== "" && e !==
|
|
440
|
+
function Et(e, t) {
|
|
441
|
+
return e !== void 0 && e !== "" && e !== be.Image ? !1 : !t || Tt(t);
|
|
441
442
|
}
|
|
442
|
-
function
|
|
443
|
-
let l = r?.toLowerCase() ?? "", u = l.startsWith(".") ? l : `.${l}`, d = `path_${
|
|
443
|
+
function Dt({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i, item: a, manualFormat: o, size: s, useExpiringAssetUrls: c }) {
|
|
444
|
+
let l = r?.toLowerCase() ?? "", u = l.startsWith(".") ? l : `.${l}`, d = `path_${z}`, f = (n, r) => {
|
|
444
445
|
let i = a[n];
|
|
445
446
|
if (!i) return;
|
|
446
|
-
let s = a[`${n}${
|
|
447
|
+
let s = a[`${n}${Qe}`], u = a[`${n}${$e}`], d = e && !c ? he(i, [], {
|
|
447
448
|
autoFormat: !o,
|
|
448
449
|
extension: l,
|
|
449
450
|
format: r
|
|
@@ -452,31 +453,31 @@ function wt({ autoFormat: e, buildSrcset: t, docType: n, extension: r, format: i
|
|
|
452
453
|
maxHeight: u,
|
|
453
454
|
maxWidth: s,
|
|
454
455
|
src: d,
|
|
455
|
-
srcset: t && !c ?
|
|
456
|
+
srcset: t && !c ? _e(d, {
|
|
456
457
|
extension: l,
|
|
457
458
|
format: r,
|
|
458
|
-
maxWidth:
|
|
459
|
+
maxWidth: ve(o, s)
|
|
459
460
|
}) : ""
|
|
460
461
|
};
|
|
461
462
|
};
|
|
462
463
|
if (c) {
|
|
463
|
-
let e =
|
|
464
|
+
let e = fe(a, Et(n, l), l);
|
|
464
465
|
return e ? f(e) ?? {} : {};
|
|
465
466
|
}
|
|
466
467
|
if (!o) {
|
|
467
|
-
let e =
|
|
468
|
-
return f(`path_${e}`, e) ?? f(d,
|
|
468
|
+
let e = me(l, s);
|
|
469
|
+
return f(`path_${e}`, e) ?? f(d, z) ?? {};
|
|
469
470
|
}
|
|
470
471
|
let p = i ? `path_${i}` : void 0;
|
|
471
|
-
return p && a[p] ? i !==
|
|
472
|
+
return p && a[p] ? i !== B || Et(n, l) ? f(p, i) ?? {} : f(d, z) ?? {} : l && Ct.has(u) ? f(`path_${B}`, B) ?? f(d, z) ?? {} : f(d, z) ?? {};
|
|
472
473
|
}
|
|
473
|
-
var
|
|
474
|
+
var Ot = class {
|
|
474
475
|
constructor(e, t) {
|
|
475
|
-
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = Infinity, this.pageSize =
|
|
476
|
+
this.data = [], this.folderId = "", this.fetchedPages = /* @__PURE__ */ new Set(), this.totalCount = 0, this.maxEnd = Infinity, this.pageSize = St, this.requestEpoch = 0, this.host = e, this.host.addController?.(this);
|
|
476
477
|
let n = t?.maxEnd;
|
|
477
478
|
this.maxEnd = typeof n == "number" && Number.isFinite(n) && n >= 0 ? Math.floor(n) : Infinity;
|
|
478
479
|
let r = t?.pageSize;
|
|
479
|
-
this.pageSize = typeof r == "number" && Number.isFinite(r) && r >= 1 ? Math.floor(r) :
|
|
480
|
+
this.pageSize = typeof r == "number" && Number.isFinite(r) && r >= 1 ? Math.floor(r) : St, this.authToken = t?.token, this.securityByPassToken = t?.securityByPassToken, this.isSiteBuilder = t?.isSiteBuilder ?? !1, this.autoFormat = t?.autoFormat ?? !1, this.buildSrcset = t?.buildSrcset ?? !1, this.consistency = t?.consistency;
|
|
480
481
|
}
|
|
481
482
|
get totalDataCount() {
|
|
482
483
|
return this.totalCount;
|
|
@@ -485,34 +486,34 @@ var Tt = class {
|
|
|
485
486
|
this.securityByPassToken !== e && (this.securityByPassToken = e, this.resetPageCache());
|
|
486
487
|
}
|
|
487
488
|
setPageSize(e) {
|
|
488
|
-
let t = Number.isFinite(e) && e >= 1 ? Math.floor(e) :
|
|
489
|
+
let t = Number.isFinite(e) && e >= 1 ? Math.floor(e) : St;
|
|
489
490
|
if (this.pageSize === t) return;
|
|
490
491
|
let n = this.fetchedPages.size > 0;
|
|
491
492
|
n && t < this.pageSize || (this.pageSize = t, n && (this.requestEpoch += 1, this.fetchedPages.clear()));
|
|
492
493
|
}
|
|
493
494
|
async fetchImages({ end: e, extraFields: t = [], format: n, manualFormat: r = !0, start: i, throwOnError: a = !1, transformations: o }) {
|
|
494
495
|
if (e < i || this.totalCount > 0 && e >= this.totalCount && (e = this.totalCount - 1, e < i)) return this.data;
|
|
495
|
-
let s = this.requestEpoch, c =
|
|
496
|
+
let s = this.requestEpoch, c = pe(this.host.ownerDocument.defaultView);
|
|
496
497
|
if (!this.folderId || s !== this.requestEpoch) return this.data;
|
|
497
|
-
let l = n ? `path_${n}` : void 0, u = `path_${
|
|
498
|
+
let l = n ? `path_${n}` : void 0, u = `path_${z}`, d = `path_${B}`, f = c ? [u, d] : [...new Set([
|
|
498
499
|
l,
|
|
499
500
|
u,
|
|
500
501
|
d
|
|
501
502
|
].filter((e) => !!e))], p = Math.floor(i / this.pageSize) + 1, m = Math.floor(e / this.pageSize) + 1;
|
|
502
503
|
for (let e = p; e <= m; e++) {
|
|
503
504
|
if (this.fetchedPages.has(e)) continue;
|
|
504
|
-
let i = await
|
|
505
|
+
let i = await _t({
|
|
505
506
|
consistency: this.consistency,
|
|
506
507
|
countPerPage: this.pageSize,
|
|
507
508
|
directParentFolderIdentifier: this.folderId,
|
|
508
509
|
extraFields: [...t, ...f],
|
|
509
|
-
getPermanentAssetsPaths:
|
|
510
|
+
getPermanentAssetsPaths: de(this.host.ownerDocument.defaultView),
|
|
510
511
|
isSiteBuilder: this.isSiteBuilder,
|
|
511
512
|
limitedDocTypes: [
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
513
|
+
be.Image,
|
|
514
|
+
be.Audio,
|
|
515
|
+
be.Video,
|
|
516
|
+
be.Multimedia
|
|
516
517
|
],
|
|
517
518
|
pageNumber: e,
|
|
518
519
|
searchTerm: "",
|
|
@@ -526,7 +527,7 @@ var Tt = class {
|
|
|
526
527
|
let e = Math.min(this.maxEnd, i.totalCount);
|
|
527
528
|
this.totalCount = e, this.data = Array.from({ length: e }, () => ({
|
|
528
529
|
alt: "",
|
|
529
|
-
id: `temp-${
|
|
530
|
+
id: `temp-${we()}`,
|
|
530
531
|
name: "",
|
|
531
532
|
src: ""
|
|
532
533
|
}));
|
|
@@ -535,7 +536,7 @@ var Tt = class {
|
|
|
535
536
|
for (let e = 0; e < i.items.length; e++) {
|
|
536
537
|
let a = l + e;
|
|
537
538
|
if (a < this.data.length) {
|
|
538
|
-
let s = i.items[e], { maxHeight: l, maxWidth: u, src: d, srcset: f } =
|
|
539
|
+
let s = i.items[e], { maxHeight: l, maxWidth: u, src: d, srcset: f } = Dt({
|
|
539
540
|
autoFormat: this.autoFormat,
|
|
540
541
|
buildSrcset: this.buildSrcset,
|
|
541
542
|
docType: s.docType,
|
|
@@ -546,7 +547,7 @@ var Tt = class {
|
|
|
546
547
|
size: s.size,
|
|
547
548
|
useExpiringAssetUrls: c
|
|
548
549
|
}), p = d, m = f;
|
|
549
|
-
!c && p && o && o.length > 0 && (p =
|
|
550
|
+
!c && p && o && o.length > 0 && (p = he(p, o), m = ""), this.data[a] = {
|
|
550
551
|
alt: s.name,
|
|
551
552
|
docType: s.docType,
|
|
552
553
|
extension: s.extension,
|
|
@@ -589,39 +590,39 @@ var Tt = class {
|
|
|
589
590
|
}
|
|
590
591
|
async fetchImagesByIDs({ extraFields: e = [], format: t, manualFormat: n = !0, recordIds: r, throwOnError: i = !1, transformations: a }) {
|
|
591
592
|
if (r.length === 0) return [];
|
|
592
|
-
let o =
|
|
593
|
+
let o = pe(this.host.ownerDocument.defaultView), s = t ? `path_${t}` : void 0, c = `path_${z}`, l = `path_${B}`, u = o ? [c, l] : [...new Set([
|
|
593
594
|
s,
|
|
594
595
|
c,
|
|
595
596
|
l
|
|
596
|
-
].filter((e) => !!e))], d = [
|
|
597
|
-
return (await
|
|
597
|
+
].filter((e) => !!e))], d = [F, ...o ? [] : [Ke]], f = [...e, P];
|
|
598
|
+
return (await gt({
|
|
598
599
|
consistency: this.consistency,
|
|
599
600
|
extraFields: [
|
|
600
601
|
...f,
|
|
601
602
|
...u,
|
|
602
603
|
...d
|
|
603
604
|
].filter((e) => e !== ""),
|
|
604
|
-
getPermanentAssetsPaths:
|
|
605
|
+
getPermanentAssetsPaths: de(this.host.ownerDocument.defaultView),
|
|
605
606
|
isSiteBuilder: this.isSiteBuilder,
|
|
606
607
|
recordIds: r,
|
|
607
608
|
securityByPassToken: this.securityByPassToken,
|
|
608
609
|
throwOnError: i,
|
|
609
610
|
token: this.authToken
|
|
610
611
|
})).items.map((e) => {
|
|
611
|
-
let { maxHeight: r, maxWidth: i, src: s, srcset: c } =
|
|
612
|
+
let { maxHeight: r, maxWidth: i, src: s, srcset: c } = Dt({
|
|
612
613
|
autoFormat: this.autoFormat,
|
|
613
614
|
buildSrcset: this.buildSrcset,
|
|
614
|
-
docType: e[
|
|
615
|
-
extension: e[
|
|
615
|
+
docType: e[P],
|
|
616
|
+
extension: e[F],
|
|
616
617
|
format: t,
|
|
617
618
|
item: e,
|
|
618
619
|
manualFormat: n,
|
|
619
|
-
size: e[
|
|
620
|
+
size: e[Ke],
|
|
620
621
|
useExpiringAssetUrls: o
|
|
621
622
|
}), l = s, u = c;
|
|
622
|
-
return !o && l && a && a.length > 0 && (l =
|
|
623
|
+
return !o && l && a && a.length > 0 && (l = he(l, a), u = ""), {
|
|
623
624
|
alt: e.name,
|
|
624
|
-
docType: e[
|
|
625
|
+
docType: e[P],
|
|
625
626
|
extension: e["Document.FileExtension"] || "",
|
|
626
627
|
id: e.recordId,
|
|
627
628
|
maxHeight: r,
|
|
@@ -688,46 +689,46 @@ var Tt = class {
|
|
|
688
689
|
resetFolderState() {
|
|
689
690
|
this.resetPageCache();
|
|
690
691
|
}
|
|
691
|
-
},
|
|
692
|
-
static #e =
|
|
692
|
+
}, kt = t`.asset-link-format__panel{position:relative}.asset-link-format--formats .asset-link-format__panel:not(:last-child){border-bottom:1px solid var(--cx-color-neutral-200)}.asset-link-format__panel--placeholder,.asset-link-format--formats .asset-link-format__panel--placeholder:not(:last-child){height:var(--cx-spacing-3x-small);background-color:var(--cx-color-primary);border:none;overflow:hidden}.asset-link-format__panel--placeholder>*{visibility:hidden}.asset-link-format__drag-handle{cursor:grab;touch-action:none;width:max-content;margin-inline:auto;position:absolute;inset-block-start:calc(var(--cx-spacing-small) + var(--cx-font-size-3x-large) / 2);inset-inline:0;transform:translateY(-50%)}.asset-link-format__drag-handle::part(base){cursor:grab}.asset-link-format__drag-handle:active,.asset-link-format__drag-handle:active::part(base){cursor:grabbing}.asset-link-format__drag-handle::part(icon){color:var(--cx-color-neutral-300);rotate:90deg}.asset-link-format__announcement{clip-path:inset(50%);white-space:nowrap;width:1px;height:1px;position:absolute;overflow:hidden}.asset-link-format__order-hint{padding:var(--cx-spacing-small) var(--cx-spacing-medium);border-bottom:1px solid var(--cx-color-neutral-200);color:var(--cx-input-help-text-color);font:var(--cx-font-label-x-small)}.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__formats-summary{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__formats-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__formats-summary [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__formats-crop cx-asset-link-format-crop{box-sizing:border-box;width:100%;padding:0 var(--cx-spacing-medium) 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}.asset-link-format__footer,.asset-link-format__footer>slot{display:block}`, At = t`:host([inline]){display:block}cx-details::part(base){border-bottom-width:0}.details--inline::part(base){border-width:0}.details--inline::part(header){display:none}.details--inline::part(content){padding:0}cx-space{width:100%}cx-space cx-input{flex:1}.crop__unit-select{width:120px}.crop__input-group{flex:1;display:flex}.crop__limit{color:var(--cx-input-help-text-color);margin-block-start:calc(-1 * var(--spacing-container-gap))}.crop__limit:empty{position:absolute}`, V, H = class extends s {
|
|
693
|
+
static #e = V = this;
|
|
693
694
|
constructor(...e) {
|
|
694
|
-
super(...e), this.localize = new d(this), this.open = !1, this.inline = !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 =
|
|
695
|
-
[
|
|
695
|
+
super(...e), this.localize = new d(this), this.open = !1, this.inline = !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 = M.Pixel, this.disabledApply = !1, this.noRatioModes = !1, this.showPositionPicker = !1, this.hasCropper = !1, this.dimensionsLimited = !1, this.lastAppliedSetting = {
|
|
696
|
+
[M.Pixel]: {
|
|
696
697
|
height: 0,
|
|
697
698
|
percentageHeight: 100,
|
|
698
699
|
percentageWidth: 100,
|
|
699
|
-
unit:
|
|
700
|
+
unit: M.Pixel,
|
|
700
701
|
width: 0,
|
|
701
702
|
x: 0,
|
|
702
703
|
y: 0
|
|
703
704
|
},
|
|
704
|
-
[
|
|
705
|
+
[M.AspectRatio]: {
|
|
705
706
|
height: 1,
|
|
706
707
|
percentageHeight: 100,
|
|
707
708
|
percentageWidth: 100,
|
|
708
|
-
unit:
|
|
709
|
+
unit: M.AspectRatio,
|
|
709
710
|
width: 1,
|
|
710
711
|
x: 0,
|
|
711
712
|
y: 0
|
|
712
713
|
}
|
|
713
714
|
}, this.loading = !1, this.cropModes = [], this.focusModes = [], this.focusMode = "manual", this.cropMode = "free", this.position = v.CenterCenter, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
714
715
|
}
|
|
715
|
-
static #t = this.styles = [l,
|
|
716
|
+
static #t = this.styles = [l, At];
|
|
716
717
|
static #n = this.dependencies = {
|
|
717
718
|
"cx-button": _,
|
|
718
|
-
"cx-details":
|
|
719
|
-
"cx-divider":
|
|
719
|
+
"cx-details": T,
|
|
720
|
+
"cx-divider": ye,
|
|
720
721
|
"cx-icon": h,
|
|
721
722
|
"cx-icon-button": p,
|
|
722
|
-
"cx-input":
|
|
723
|
-
"cx-option":
|
|
724
|
-
"cx-position-picker":
|
|
725
|
-
"cx-select":
|
|
726
|
-
"cx-space":
|
|
727
|
-
"cx-typography":
|
|
723
|
+
"cx-input": le,
|
|
724
|
+
"cx-option": S,
|
|
725
|
+
"cx-position-picker": Ne,
|
|
726
|
+
"cx-select": w,
|
|
727
|
+
"cx-space": C,
|
|
728
|
+
"cx-typography": b
|
|
728
729
|
};
|
|
729
730
|
static getRatioSize(e, t, n, r, i) {
|
|
730
|
-
return n ===
|
|
731
|
+
return n === M.Pixel && Number.isFinite(r) && Number.isFinite(i) ? ae(r, i, e, t) : {
|
|
731
732
|
height: t,
|
|
732
733
|
width: e
|
|
733
734
|
};
|
|
@@ -745,11 +746,11 @@ var Tt = class {
|
|
|
745
746
|
return;
|
|
746
747
|
}
|
|
747
748
|
if (this.keepAspectRatio) {
|
|
748
|
-
if (this.unit ===
|
|
749
|
+
if (this.unit === M.Pixel && this.width && this.height) {
|
|
749
750
|
this.aspectRatio = this.width / this.height;
|
|
750
751
|
return;
|
|
751
752
|
}
|
|
752
|
-
if (this.unit ===
|
|
753
|
+
if (this.unit === M.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
753
754
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
754
755
|
return;
|
|
755
756
|
}
|
|
@@ -777,9 +778,11 @@ var Tt = class {
|
|
|
777
778
|
this.invalidWidth = !0;
|
|
778
779
|
return;
|
|
779
780
|
}
|
|
780
|
-
this.invalidWidth = !1, this.unit ===
|
|
781
|
-
let n = this.unit ===
|
|
782
|
-
this.keepAspectRatio ? n = Math.max(Math.round(t / this.aspectRatio), 1) : this.unit ===
|
|
781
|
+
this.invalidWidth = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
|
|
782
|
+
let n = this.unit === M.Pixel ? this.height : this.ratioHeight, r = !1;
|
|
783
|
+
this.keepAspectRatio ? n = Math.max(Math.round(t / this.aspectRatio), 1) : this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight));
|
|
784
|
+
let i = this.getSideMax(this.maxHeight);
|
|
785
|
+
n > i && (n = i, r = this.keepAspectRatio), r ||= this.#a(t, n), e.target.value = t.toString(), this.invalidHeight = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
|
|
783
786
|
breakAspectRatio: r,
|
|
784
787
|
height: n,
|
|
785
788
|
keepAspectRatio: this.keepAspectRatio,
|
|
@@ -793,9 +796,11 @@ var Tt = class {
|
|
|
793
796
|
this.invalidHeight = !0;
|
|
794
797
|
return;
|
|
795
798
|
}
|
|
796
|
-
this.invalidHeight = !1, this.unit ===
|
|
797
|
-
let n = this.unit ===
|
|
798
|
-
this.keepAspectRatio ? n = Math.max(Math.round(t * this.aspectRatio), 1) : this.unit ===
|
|
799
|
+
this.invalidHeight = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
|
|
800
|
+
let n = this.unit === M.Pixel ? this.width : this.ratioWidth, r = !1;
|
|
801
|
+
this.keepAspectRatio ? n = Math.max(Math.round(t * this.aspectRatio), 1) : this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth));
|
|
802
|
+
let i = this.getSideMax(this.maxWidth);
|
|
803
|
+
n > i && (n = i, r = this.keepAspectRatio), r ||= this.#a(n, t), e.target.value = t.toString(), this.invalidWidth = !1, this.emit("cx-asset-link-format-crop-change", { detail: {
|
|
799
804
|
breakAspectRatio: r,
|
|
800
805
|
height: t,
|
|
801
806
|
keepAspectRatio: this.keepAspectRatio,
|
|
@@ -806,17 +811,17 @@ var Tt = class {
|
|
|
806
811
|
onCropModeChange(e) {
|
|
807
812
|
let t = e.target.value, n = this.cropModes.find((e) => e.value === t)?.auto;
|
|
808
813
|
if (t === "free") this.selectedMode?.auto && this.emit("cx-asset-link-format-crop-change", { detail: {
|
|
809
|
-
height: this.lastAppliedSetting[
|
|
814
|
+
height: this.lastAppliedSetting[M.Pixel].height,
|
|
810
815
|
keepAspectRatio: !1,
|
|
811
816
|
silent: !0,
|
|
812
|
-
unit:
|
|
813
|
-
width: this.lastAppliedSetting[
|
|
817
|
+
unit: M.Pixel,
|
|
818
|
+
width: this.lastAppliedSetting[M.Pixel].width
|
|
814
819
|
} });
|
|
815
|
-
else if (!n) {
|
|
816
|
-
let [e, n] = t.split(":").map(Number), r = this.unit ===
|
|
820
|
+
else if (!n && /^\d+:\d+$/.test(t)) {
|
|
821
|
+
let [e, n] = t.split(":").map(Number), r = this.unit === M.Pixel && this.hasMaxSize ? M.Pixel : M.AspectRatio;
|
|
817
822
|
this.emit("cx-asset-link-format-crop-change", { detail: {
|
|
818
|
-
...
|
|
819
|
-
keepAspectRatio: r ===
|
|
823
|
+
...V.getRatioSize(e, n, r, this.maxWidth, this.maxHeight),
|
|
824
|
+
keepAspectRatio: r === M.Pixel || !this.inline,
|
|
820
825
|
silent: !0,
|
|
821
826
|
unit: r
|
|
822
827
|
} });
|
|
@@ -831,7 +836,7 @@ var Tt = class {
|
|
|
831
836
|
this.emit("cx-asset-link-format-crop-position-change", { detail: { position: this.positionPicker.value } });
|
|
832
837
|
}
|
|
833
838
|
onUnitChange(e) {
|
|
834
|
-
let t = e.target.value ===
|
|
839
|
+
let t = e.target.value === M.AspectRatio ? M.AspectRatio : M.Pixel;
|
|
835
840
|
if (this.hasCropper) {
|
|
836
841
|
this.emit("cx-asset-link-format-crop-change", { detail: {
|
|
837
842
|
...this.#i(t),
|
|
@@ -859,21 +864,21 @@ var Tt = class {
|
|
|
859
864
|
if (/^\d+:\d+$/.test(this.cropMode)) {
|
|
860
865
|
let [n, r] = this.cropMode.split(":").map(Number);
|
|
861
866
|
return {
|
|
862
|
-
...
|
|
867
|
+
...V.getRatioSize(n, r, e, this.maxWidth, this.maxHeight),
|
|
863
868
|
keepAspectRatio: t
|
|
864
869
|
};
|
|
865
870
|
}
|
|
866
|
-
return e ===
|
|
871
|
+
return e === M.AspectRatio ? {
|
|
867
872
|
height: this.height,
|
|
868
873
|
keepAspectRatio: t,
|
|
869
874
|
width: this.width
|
|
870
875
|
} : {
|
|
871
|
-
...
|
|
876
|
+
...V.getRatioSize(this.ratioWidth, this.ratioHeight, e, this.maxWidth, this.maxHeight),
|
|
872
877
|
keepAspectRatio: t
|
|
873
878
|
};
|
|
874
879
|
}
|
|
875
880
|
#i(e) {
|
|
876
|
-
if (e ===
|
|
881
|
+
if (e === M.AspectRatio && /^\d+:\d+$/.test(this.cropMode)) {
|
|
877
882
|
let [e, t] = this.cropMode.split(":").map(Number);
|
|
878
883
|
return {
|
|
879
884
|
height: t,
|
|
@@ -904,18 +909,20 @@ var Tt = class {
|
|
|
904
909
|
}
|
|
905
910
|
handleAspectRatioClick() {
|
|
906
911
|
this.emit("cx-asset-link-format-crop-change", { detail: {
|
|
907
|
-
height: this.unit ===
|
|
912
|
+
height: this.unit === M.Pixel ? this.height : this.ratioHeight,
|
|
908
913
|
keepAspectRatio: !this.keepAspectRatio,
|
|
909
914
|
unit: this.unit,
|
|
910
|
-
width: this.unit ===
|
|
915
|
+
width: this.unit === M.Pixel ? this.width : this.ratioWidth
|
|
911
916
|
} });
|
|
912
917
|
}
|
|
918
|
+
getSideMax(e) {
|
|
919
|
+
return this.unit === M.Pixel && e >= 1 ? Math.min(e, A) : A;
|
|
920
|
+
}
|
|
913
921
|
getSizeMaskBlocks(e) {
|
|
914
|
-
let t = this.unit === k.Pixel && e >= 1 ? e : Infinity;
|
|
915
922
|
return { num: {
|
|
916
923
|
autofix: !0,
|
|
917
924
|
mask: Number,
|
|
918
|
-
max:
|
|
925
|
+
max: this.getSideMax(e),
|
|
919
926
|
min: 1,
|
|
920
927
|
radix: ".",
|
|
921
928
|
scale: 0
|
|
@@ -928,111 +935,111 @@ var Tt = class {
|
|
|
928
935
|
}
|
|
929
936
|
#a(e, t) {
|
|
930
937
|
let n = /^(\d+):(\d+)$/.exec(this.cropMode);
|
|
931
|
-
return this.unit ===
|
|
938
|
+
return this.unit === M.Pixel && !this.keepAspectRatio && n !== null && Number(n[1]) * t !== Number(n[2]) * e;
|
|
932
939
|
}
|
|
933
940
|
render() {
|
|
934
941
|
let t = this.cropModes.filter((e) => !e.auto), n = this.cropModes.filter((e) => e.auto);
|
|
935
|
-
return e`<cx-details class="details ${this.inline ? "details--inline" : ""}" ?open=${this.inline || this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${
|
|
942
|
+
return e`<cx-details class="details ${this.inline ? "details--inline" : ""}" ?open=${this.inline || this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><cx-space slot="summary" align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body2">${this.localize.term("crop")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small">${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-mode" value=${this.cropMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onCropModeChange} ?disabled=${this.loading}>${x(t, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}
|
|
936
943
|
${m(n.length > 0, () => e`<cx-divider></cx-divider><small>${this.localize.term("autoCropping")}</small>`)}
|
|
937
|
-
${
|
|
944
|
+
${x(n, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}</cx-select>`)}<cx-space spacing="small"><div class="crop__input-group"><cx-input data-testid="cx-asset-link-format-crop-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxWidth)} value=${this.unit === M.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-change=${this.handleInputChange} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
938
945
|
W
|
|
939
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxHeight)} value=${this.unit ===
|
|
946
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-crop-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-crop-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${this.getSizeMaskBlocks(this.maxHeight)} value=${this.unit === M.Pixel ? this.height.toString() : this.ratioHeight.toString()} ?disabled=${this.loading} @cx-change=${this.handleInputChange} @cx-input=${this.handleHeightChange} required><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
940
947
|
H
|
|
941
|
-
</cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${
|
|
948
|
+
</cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-crop-unit" value=${this.unit} hoist class="crop__unit-select" ?disabled=${this.loading} @cx-change=${this.onUnitChange}><cx-option value=${M.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${M.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`)}</cx-space><div class="crop__limit" data-testid="cx-asset-link-format-crop-dimensions-limit" role="status">${m(this.dimensionsLimited, () => e`<cx-typography variant="small">${this.localize.term("cropLimitedByDimensions", this.maxWidth, this.maxHeight)}</cx-typography>`)}</div>${m(this.focusModes.length > 0, () => e`<cx-select data-testid="cx-asset-link-format-crop-focus-mode" value=${this.focusMode} hoist style=${g({ width: "100%" })} @cx-change=${this.onFocusModeChange} ?disabled=${this.loading || this.selectedMode?.disabledSize}>${x(this.focusModes, (e) => e.value, ({ label: t, value: n }) => e`<cx-option value=${n}>${t}</cx-option>`)}</cx-select>`)}
|
|
942
949
|
${m(this.showPositionPicker && this.focusMode === "manual", () => e`<cx-position-picker data-testid="cx-asset-link-format-crop-position" value=${this.position} @cx-change=${this.onPositionChange}></cx-position-picker>`)}
|
|
943
950
|
${m(!this.inline, () => e`<cx-button data-testid="cx-asset-link-format-crop-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${g({ marginLeft: "auto" })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space></cx-details>`;
|
|
944
951
|
}
|
|
945
952
|
};
|
|
946
|
-
a([c(".details"), o("design:type",
|
|
953
|
+
a([c(".details"), o("design:type", T === void 0 ? Object : T)], H.prototype, "base", void 0), a([c("cx-position-picker"), o("design:type", Ne === void 0 ? Object : Ne)], H.prototype, "positionPicker", void 0), a([r({
|
|
947
954
|
reflect: !0,
|
|
948
955
|
type: Boolean
|
|
949
|
-
}), o("design:type", Boolean)],
|
|
956
|
+
}), o("design:type", Boolean)], H.prototype, "open", void 0), a([r({
|
|
950
957
|
reflect: !0,
|
|
951
958
|
type: Boolean
|
|
952
|
-
}), o("design:type", Boolean)],
|
|
959
|
+
}), o("design:type", Boolean)], H.prototype, "inline", void 0), a([r({
|
|
953
960
|
reflect: !0,
|
|
954
961
|
type: Number
|
|
955
|
-
}), o("design:type", Number)],
|
|
962
|
+
}), o("design:type", Number)], H.prototype, "width", void 0), a([r({
|
|
956
963
|
reflect: !0,
|
|
957
964
|
type: Number
|
|
958
|
-
}), o("design:type", Number)],
|
|
965
|
+
}), o("design:type", Number)], H.prototype, "height", void 0), a([r({
|
|
959
966
|
attribute: "max-width",
|
|
960
967
|
reflect: !0,
|
|
961
968
|
type: Number
|
|
962
|
-
}), o("design:type", Number)],
|
|
969
|
+
}), o("design:type", Number)], H.prototype, "maxWidth", void 0), a([r({
|
|
963
970
|
attribute: "max-height",
|
|
964
971
|
reflect: !0,
|
|
965
972
|
type: Number
|
|
966
|
-
}), o("design:type", Number)],
|
|
973
|
+
}), o("design:type", Number)], H.prototype, "maxHeight", void 0), a([r({
|
|
967
974
|
attribute: "ratio-width",
|
|
968
975
|
reflect: !0,
|
|
969
976
|
type: Number
|
|
970
|
-
}), o("design:type", Number)],
|
|
977
|
+
}), o("design:type", Number)], H.prototype, "ratioWidth", void 0), a([r({
|
|
971
978
|
attribute: "ratio-height",
|
|
972
979
|
reflect: !0,
|
|
973
980
|
type: Number
|
|
974
|
-
}), o("design:type", Number)],
|
|
981
|
+
}), o("design:type", Number)], H.prototype, "ratioHeight", void 0), a([r({
|
|
975
982
|
attribute: "percentage-width",
|
|
976
983
|
reflect: !0,
|
|
977
984
|
type: Number
|
|
978
|
-
}), o("design:type", Number)],
|
|
985
|
+
}), o("design:type", Number)], H.prototype, "percentageWidth", void 0), a([r({
|
|
979
986
|
attribute: "percentage-height",
|
|
980
987
|
reflect: !0,
|
|
981
988
|
type: Number
|
|
982
|
-
}), o("design:type", Number)],
|
|
989
|
+
}), o("design:type", Number)], H.prototype, "percentageHeight", void 0), a([r({
|
|
983
990
|
reflect: !0,
|
|
984
991
|
type: String
|
|
985
|
-
}), o("design:type",
|
|
992
|
+
}), o("design:type", M === void 0 ? Object : M)], H.prototype, "unit", void 0), a([r({
|
|
986
993
|
attribute: "disabled-apply",
|
|
987
994
|
reflect: !0,
|
|
988
995
|
type: Boolean
|
|
989
|
-
}), o("design:type", Boolean)],
|
|
996
|
+
}), o("design:type", Boolean)], H.prototype, "disabledApply", void 0), a([r({
|
|
990
997
|
attribute: "no-ratio-modes",
|
|
991
998
|
reflect: !0,
|
|
992
999
|
type: Boolean
|
|
993
|
-
}), o("design:type", Boolean)],
|
|
1000
|
+
}), o("design:type", Boolean)], H.prototype, "noRatioModes", void 0), a([r({
|
|
994
1001
|
attribute: "show-position-picker",
|
|
995
1002
|
reflect: !0,
|
|
996
1003
|
type: Boolean
|
|
997
|
-
}), o("design:type", Boolean)],
|
|
1004
|
+
}), o("design:type", Boolean)], H.prototype, "showPositionPicker", void 0), a([r({
|
|
998
1005
|
attribute: "has-cropper",
|
|
999
1006
|
reflect: !0,
|
|
1000
1007
|
type: Boolean
|
|
1001
|
-
}), o("design:type", Boolean)],
|
|
1008
|
+
}), o("design:type", Boolean)], H.prototype, "hasCropper", void 0), a([r({
|
|
1002
1009
|
attribute: "dimensions-limited",
|
|
1003
1010
|
reflect: !0,
|
|
1004
1011
|
type: Boolean
|
|
1005
|
-
}), o("design:type", Boolean)],
|
|
1012
|
+
}), o("design:type", Boolean)], H.prototype, "dimensionsLimited", void 0), a([r({
|
|
1006
1013
|
attribute: "last-applied-setting",
|
|
1007
1014
|
reflect: !1,
|
|
1008
1015
|
type: Object
|
|
1009
|
-
}), o("design:type", typeof Record > "u" ? Object : Record)],
|
|
1016
|
+
}), o("design:type", typeof Record > "u" ? Object : Record)], H.prototype, "lastAppliedSetting", void 0), a([r({
|
|
1010
1017
|
reflect: !0,
|
|
1011
1018
|
type: Boolean
|
|
1012
|
-
}), o("design:type", Boolean)],
|
|
1019
|
+
}), o("design:type", Boolean)], H.prototype, "loading", void 0), a([r({
|
|
1013
1020
|
attribute: "crop-modes",
|
|
1014
1021
|
reflect: !1,
|
|
1015
1022
|
type: Array
|
|
1016
|
-
}), o("design:type", Array)],
|
|
1023
|
+
}), o("design:type", Array)], H.prototype, "cropModes", void 0), a([r({
|
|
1017
1024
|
attribute: "focus-modes",
|
|
1018
1025
|
reflect: !1,
|
|
1019
1026
|
type: Object
|
|
1020
|
-
}), o("design:type", Array)],
|
|
1027
|
+
}), o("design:type", Array)], H.prototype, "focusModes", void 0), a([r({
|
|
1021
1028
|
attribute: "focus-mode",
|
|
1022
1029
|
reflect: !0,
|
|
1023
1030
|
type: String
|
|
1024
|
-
}), o("design:type", String)],
|
|
1031
|
+
}), o("design:type", String)], H.prototype, "focusMode", void 0), a([r({
|
|
1025
1032
|
attribute: "crop-mode",
|
|
1026
1033
|
reflect: !0,
|
|
1027
1034
|
type: String
|
|
1028
|
-
}), o("design:type", String)],
|
|
1035
|
+
}), o("design:type", String)], H.prototype, "cropMode", void 0), a([r({
|
|
1029
1036
|
reflect: !0,
|
|
1030
1037
|
type: String
|
|
1031
|
-
}), o("design:type", v === void 0 ? Object : v)],
|
|
1038
|
+
}), o("design:type", v === void 0 ? Object : v)], H.prototype, "position", void 0), a([r({
|
|
1032
1039
|
attribute: "keep-aspect-ratio",
|
|
1033
1040
|
reflect: !0,
|
|
1034
1041
|
type: Boolean
|
|
1035
|
-
}), o("design:type", Boolean)],
|
|
1042
|
+
}), o("design:type", Boolean)], H.prototype, "keepAspectRatio", void 0), a([i(), o("design:type", Boolean)], H.prototype, "invalidWidth", void 0), a([i(), o("design:type", Boolean)], H.prototype, "invalidHeight", void 0), a([i(), o("design:type", Number)], H.prototype, "aspectRatio", void 0), a([
|
|
1036
1043
|
f("cropMode", { waitUntilFirstUpdate: !0 }),
|
|
1037
1044
|
f("maxWidth", { waitUntilFirstUpdate: !0 }),
|
|
1038
1045
|
f("maxHeight", { waitUntilFirstUpdate: !0 }),
|
|
@@ -1040,54 +1047,65 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], U.prototype, "ba
|
|
|
1040
1047
|
o("design:type", Function),
|
|
1041
1048
|
o("design:paramtypes", []),
|
|
1042
1049
|
o("design:returntype", Promise)
|
|
1043
|
-
],
|
|
1050
|
+
], H.prototype, "handleCropModeChange", null), a([
|
|
1044
1051
|
f("open", { waitUntilFirstUpdate: !0 }),
|
|
1045
1052
|
o("design:type", Function),
|
|
1046
1053
|
o("design:paramtypes", []),
|
|
1047
1054
|
o("design:returntype", Promise)
|
|
1048
|
-
],
|
|
1049
|
-
var
|
|
1050
|
-
[
|
|
1055
|
+
], H.prototype, "handleOpenChange", null), H = V = a([u("cx-asset-link-format-crop")], H);
|
|
1056
|
+
var jt = H, Mt = t`:host{display:block}.asset-link-format__dimensions-select{width:100%}.details::part(base){border-bottom-width:0}.asset-link-format__dimensions-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__dimensions-inline .asset-link-format__dimensions-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__dimensions-custom{grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,7rem);align-items:center;display:grid}.asset-link-format__dimensions-custom cx-input,.asset-link-format__dimensions-custom cx-select{min-width:0}.asset-link-format__dimensions-apply{margin-inline-start:auto}`, U = 1, Nt = {
|
|
1057
|
+
[O.Percent]: { num: {
|
|
1058
|
+
autofix: !0,
|
|
1051
1059
|
mask: Number,
|
|
1052
|
-
|
|
1060
|
+
max: 100,
|
|
1061
|
+
min: U,
|
|
1053
1062
|
radix: ".",
|
|
1054
|
-
scale:
|
|
1063
|
+
scale: 0
|
|
1055
1064
|
} },
|
|
1056
|
-
[
|
|
1065
|
+
[O.Pixel]: { num: {
|
|
1066
|
+
autofix: !0,
|
|
1057
1067
|
mask: Number,
|
|
1058
|
-
|
|
1068
|
+
max: A,
|
|
1069
|
+
min: U,
|
|
1059
1070
|
radix: ".",
|
|
1060
1071
|
scale: 0
|
|
1061
1072
|
} }
|
|
1062
1073
|
}, W = class extends s {
|
|
1063
1074
|
constructor(...e) {
|
|
1064
|
-
super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior =
|
|
1065
|
-
[
|
|
1075
|
+
super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = j.Legacy, this.loading = !1, this.items = [], this.canCustom = !1, this.canPercent = !1, this.customDimensionsUnit = O.Pixel, this.dimensionsSelection = "", this.customDimensionsDrafts = {
|
|
1076
|
+
[O.Percent]: {
|
|
1066
1077
|
height: "100",
|
|
1067
1078
|
width: "100"
|
|
1068
1079
|
},
|
|
1069
|
-
[
|
|
1080
|
+
[O.Pixel]: {
|
|
1070
1081
|
height: "1080",
|
|
1071
1082
|
width: "1920"
|
|
1072
1083
|
}
|
|
1073
1084
|
};
|
|
1074
1085
|
}
|
|
1075
|
-
static #e = this.styles = [l,
|
|
1086
|
+
static #e = this.styles = [l, Mt];
|
|
1076
1087
|
static #t = this.dependencies = {
|
|
1077
1088
|
"cx-button": _,
|
|
1078
|
-
"cx-details":
|
|
1079
|
-
"cx-divider":
|
|
1089
|
+
"cx-details": T,
|
|
1090
|
+
"cx-divider": ye,
|
|
1080
1091
|
"cx-icon": h,
|
|
1081
|
-
"cx-input":
|
|
1082
|
-
"cx-menu-label":
|
|
1083
|
-
"cx-option":
|
|
1084
|
-
"cx-select":
|
|
1085
|
-
"cx-space":
|
|
1086
|
-
"cx-typography":
|
|
1092
|
+
"cx-input": le,
|
|
1093
|
+
"cx-menu-label": Se,
|
|
1094
|
+
"cx-option": S,
|
|
1095
|
+
"cx-select": w,
|
|
1096
|
+
"cx-space": C,
|
|
1097
|
+
"cx-typography": b
|
|
1087
1098
|
};
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1099
|
+
willUpdate(e) {
|
|
1100
|
+
super.willUpdate(e), (e.has("value") && e.get("value") !== this.value || e.has("canPercent")) && this.#n();
|
|
1101
|
+
}
|
|
1102
|
+
#n() {
|
|
1103
|
+
let e = this.value, t = e?.mode === E.Custom && e.unit === O.Percent && !this.canPercent;
|
|
1104
|
+
if (this.canPercent || (this.customDimensionsUnit = O.Pixel), t) {
|
|
1105
|
+
this.dimensionsSelection = "";
|
|
1106
|
+
return;
|
|
1107
|
+
}
|
|
1108
|
+
this.dimensionsSelection = e?.mode === E.Custom ? E.Custom : e?.mode === E.Preset ? `preset:${e.value}` : "", e?.mode === E.Custom && (this.customDimensionsUnit = e.unit, this.customDimensionsDrafts = {
|
|
1091
1109
|
...this.customDimensionsDrafts,
|
|
1092
1110
|
[e.unit]: {
|
|
1093
1111
|
height: String(e.height),
|
|
@@ -1100,26 +1118,45 @@ var Ot = U, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
|
|
|
1100
1118
|
}
|
|
1101
1119
|
getCustomDimensionsValue() {
|
|
1102
1120
|
let e = this.customDimensionsUnit, t = this.customDimensionsDrafts[e], n = Number(t.width), r = Number(t.height);
|
|
1103
|
-
if (!(!Number.
|
|
1121
|
+
if (!(!Number.isInteger(n) || !Number.isInteger(r) || n < U || r < U) && !(e === O.Percent && (n > 100 || n !== r))) return {
|
|
1104
1122
|
height: r,
|
|
1105
|
-
mode:
|
|
1123
|
+
mode: E.Custom,
|
|
1106
1124
|
unit: e,
|
|
1107
1125
|
width: n
|
|
1108
1126
|
};
|
|
1109
1127
|
}
|
|
1128
|
+
#r(e, t) {
|
|
1129
|
+
let n = this.customDimensionsUnit, r = n === O.Percent ? {
|
|
1130
|
+
height: t,
|
|
1131
|
+
width: t
|
|
1132
|
+
} : {
|
|
1133
|
+
...this.customDimensionsDrafts[n],
|
|
1134
|
+
[e]: t
|
|
1135
|
+
};
|
|
1136
|
+
this.customDimensionsDrafts = {
|
|
1137
|
+
...this.customDimensionsDrafts,
|
|
1138
|
+
[n]: r
|
|
1139
|
+
};
|
|
1140
|
+
}
|
|
1141
|
+
#i(e) {
|
|
1142
|
+
let t = this.customDimensionsUnit, n = this.customDimensionsDrafts[t][e], r = Number(n), i = this.value, a = i?.mode === E.Custom && i.unit === t && String(i[e]) === n;
|
|
1143
|
+
if (!n || a || Number.isNaN(r)) return;
|
|
1144
|
+
let o = t === O.Percent ? 100 : A, s = String(ce(r, U, o));
|
|
1145
|
+
s !== n && this.#r(e, s);
|
|
1146
|
+
}
|
|
1110
1147
|
get pendingValue() {
|
|
1111
|
-
if (this.dimensionsSelection ===
|
|
1148
|
+
if (this.dimensionsSelection === E.Custom) return this.getCustomDimensionsValue();
|
|
1112
1149
|
if (this.dimensionsSelection.startsWith("preset:")) {
|
|
1113
1150
|
let e = this.items.find((e) => `preset:${e.value}` === this.dimensionsSelection && !e.disabled);
|
|
1114
1151
|
return e ? {
|
|
1115
|
-
mode:
|
|
1152
|
+
mode: E.Preset,
|
|
1116
1153
|
value: e.value
|
|
1117
1154
|
} : void 0;
|
|
1118
1155
|
}
|
|
1119
1156
|
}
|
|
1120
1157
|
get applyDisabled() {
|
|
1121
1158
|
let e = this.pendingValue;
|
|
1122
|
-
return !e || !this.value || e.mode !== this.value.mode ? !e : e.mode ===
|
|
1159
|
+
return !e || !this.value || e.mode !== this.value.mode ? !e : e.mode === E.Preset && this.value.mode === E.Preset ? e.value === this.value.value : e.mode === E.Custom && this.value.mode === E.Custom && e.height === this.value.height && e.unit === this.value.unit && e.width === this.value.width;
|
|
1123
1160
|
}
|
|
1124
1161
|
applyPendingValue() {
|
|
1125
1162
|
let e = this.pendingValue;
|
|
@@ -1128,33 +1165,29 @@ var Ot = U, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
|
|
|
1128
1165
|
onDimensionsSelectChange(e) {
|
|
1129
1166
|
if (e.target !== e.currentTarget || this.loading) return;
|
|
1130
1167
|
let t = e.currentTarget.value;
|
|
1131
|
-
if (t ===
|
|
1168
|
+
if (t === E.Custom && this.canCustom) this.dimensionsSelection = E.Custom, this.applyBehavior !== j.Manual && this.applyPendingValue();
|
|
1132
1169
|
else if (t.startsWith("preset:")) {
|
|
1133
1170
|
let e = this.items.find((e) => `preset:${e.value}` === t && !e.disabled);
|
|
1134
|
-
e && (this.dimensionsSelection = t, this.applyBehavior !==
|
|
1135
|
-
mode:
|
|
1171
|
+
e && (this.dimensionsSelection = t, this.applyBehavior !== j.Manual && this.emitDimensionsValue({
|
|
1172
|
+
mode: E.Preset,
|
|
1136
1173
|
value: e.value
|
|
1137
1174
|
}));
|
|
1138
1175
|
}
|
|
1139
1176
|
}
|
|
1140
1177
|
onDimensionsInput(e) {
|
|
1141
1178
|
if (e.target !== e.currentTarget || this.loading || !this.canCustom) return;
|
|
1142
|
-
let t = e.currentTarget
|
|
1143
|
-
this.
|
|
1144
|
-
...this.customDimensionsDrafts,
|
|
1145
|
-
[r]: {
|
|
1146
|
-
...this.customDimensionsDrafts[r],
|
|
1147
|
-
[n]: t.value
|
|
1148
|
-
}
|
|
1149
|
-
};
|
|
1179
|
+
let t = e.currentTarget;
|
|
1180
|
+
this.#r(t.name === "height" ? "height" : "width", t.value);
|
|
1150
1181
|
}
|
|
1151
1182
|
onDimensionsCustomChange(e) {
|
|
1152
|
-
e.target
|
|
1183
|
+
if (e.target !== e.currentTarget || this.loading || !this.canCustom) return;
|
|
1184
|
+
let t = e.currentTarget;
|
|
1185
|
+
this.#i(t.name === "height" ? "height" : "width"), t.reportValidity() && this.applyBehavior !== j.Manual && this.applyPendingValue();
|
|
1153
1186
|
}
|
|
1154
1187
|
onDimensionsUnitChange(e) {
|
|
1155
1188
|
if (e.target !== e.currentTarget || this.loading || !this.canCustom) return;
|
|
1156
1189
|
let t = e.currentTarget.value;
|
|
1157
|
-
(t ===
|
|
1190
|
+
(t === O.Pixel || t === O.Percent && this.canPercent) && (this.customDimensionsUnit = t, this.applyBehavior !== j.Manual && this.applyPendingValue());
|
|
1158
1191
|
}
|
|
1159
1192
|
onApply() {
|
|
1160
1193
|
!this.loading && !this.applyDisabled && this.applyPendingValue();
|
|
@@ -1167,21 +1200,21 @@ var Ot = U, kt = t`:host{display:block}.asset-link-format__dimensions-select{wid
|
|
|
1167
1200
|
}
|
|
1168
1201
|
renderCustomDimensions() {
|
|
1169
1202
|
let t = this.customDimensionsUnit, n = this.customDimensionsDrafts[t];
|
|
1170
|
-
return e`<cx-space class="asset-link-format__dimensions-custom" spacing="small"><cx-input name="width" mask="num" .maskBlocks=${
|
|
1203
|
+
return e`<cx-space class="asset-link-format__dimensions-custom" spacing="small"><cx-input name="width" mask="num" .maskBlocks=${Nt[t]} aria-label=${this.localize.term("maxWidth")} value=${n.width} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">W</cx-typography></cx-input><cx-input name="height" mask="num" .maskBlocks=${Nt[t]} aria-label=${this.localize.term("maxHeight")} value=${n.height} ?disabled=${this.loading} @cx-input=${this.onDimensionsInput} @cx-change=${this.onDimensionsCustomChange}><cx-typography slot="prefix" variant="body3" part="input-label">H</cx-typography></cx-input><cx-select data-label=${this.localize.term("unit")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsUnitChange}><cx-option value=${O.Pixel}>${this.localize.term("pixels")}</cx-option>${m(this.canPercent, () => e`<cx-option value=${O.Percent}>${this.localize.term("dimensionsPercent")}</cx-option>`)}</cx-select></cx-space>`;
|
|
1171
1204
|
}
|
|
1172
1205
|
renderSummary() {
|
|
1173
|
-
return e`<cx-space class="asset-link-format__dimensions-summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant=${this.inline ?
|
|
1206
|
+
return e`<cx-space class="asset-link-format__dimensions-summary" align-items="center"><div part="icon"><cx-icon name="photo_size_select_large"></cx-icon></div><cx-typography variant=${this.inline ? y.Body3 : y.Body2}>${this.localize.term("dimensions")}</cx-typography></cx-space>`;
|
|
1174
1207
|
}
|
|
1175
1208
|
renderContent() {
|
|
1176
|
-
let t = this.canCustom && this.dimensionsSelection ===
|
|
1177
|
-
return e`<cx-space class="asset-link-format__dimensions-content" direction="vertical" spacing="small"><cx-select class="asset-link-format__dimensions-select" data-label=${this.localize.term("dimensions")} value=${this.dimensionsSelection ===
|
|
1209
|
+
let t = this.canCustom && this.dimensionsSelection === E.Custom;
|
|
1210
|
+
return e`<cx-space class="asset-link-format__dimensions-content" direction="vertical" spacing="small"><cx-select class="asset-link-format__dimensions-select" data-label=${this.localize.term("dimensions")} value=${this.dimensionsSelection === E.Custom && !this.canCustom ? "" : this.dimensionsSelection} ?disabled=${this.loading} hoist @cx-change=${this.onDimensionsSelectChange}>${x(this.items, (e) => e.value, (t, n) => e`
|
|
1178
1211
|
${m(t.group !== this.items[n - 1]?.group, () => e`
|
|
1179
1212
|
${m(n > 0, () => e`<cx-divider></cx-divider>`)}
|
|
1180
1213
|
${m(!!t.group, () => e`<cx-menu-label>${t.group}</cx-menu-label>`)}
|
|
1181
1214
|
`)}<cx-option value=${`preset:${t.value}`} ?disabled=${t.disabled}>${t.label}</cx-option>`)}
|
|
1182
1215
|
${m(this.canCustom, () => e`
|
|
1183
|
-
${m(this.items.length > 0, () => e`<cx-divider></cx-divider>`)}<cx-option value=${
|
|
1184
|
-
${m(this.applyBehavior ===
|
|
1216
|
+
${m(this.items.length > 0, () => e`<cx-divider></cx-divider>`)}<cx-option value=${E.Custom}><cx-icon slot="prefix" name="edit"></cx-icon>${this.localize.term("custom")}</cx-option>`)}</cx-select>${m(t, () => this.renderCustomDimensions())}
|
|
1217
|
+
${m(this.applyBehavior === j.Manual, () => e`<cx-button class="asset-link-format__dimensions-apply" data-testid="cx-asset-link-format-dimensions-apply" variant="primary" ?disabled=${this.applyDisabled} ?loading=${this.loading} @click=${this.onApply}>${this.localize.term("apply")}</cx-button>`)}</cx-space>`;
|
|
1185
1218
|
}
|
|
1186
1219
|
render() {
|
|
1187
1220
|
return this.inline ? e`<div class="asset-link-format__dimensions-inline">${this.renderSummary()}
|
|
@@ -1208,31 +1241,29 @@ a([r({
|
|
|
1208
1241
|
attribute: "can-custom",
|
|
1209
1242
|
type: Boolean
|
|
1210
1243
|
}), o("design:type", Object)], W.prototype, "canCustom", void 0), a([r({
|
|
1244
|
+
attribute: "can-percent",
|
|
1245
|
+
type: Boolean
|
|
1246
|
+
}), o("design:type", Object)], W.prototype, "canPercent", void 0), a([r({
|
|
1211
1247
|
attribute: !1,
|
|
1212
1248
|
type: Object
|
|
1213
|
-
}), o("design:type", Object)], W.prototype, "value", void 0), a([i(), o("design:type", Object)], W.prototype, "customDimensionsUnit", void 0), a([i(), o("design:type", Object)], W.prototype, "dimensionsSelection", void 0), a([i(), o("design:type", Object)], W.prototype, "customDimensionsDrafts", void 0), a([
|
|
1214
|
-
|
|
1215
|
-
o("design:type", Function),
|
|
1216
|
-
o("design:paramtypes", []),
|
|
1217
|
-
o("design:returntype", void 0)
|
|
1218
|
-
], W.prototype, "handleDimensionsValueChange", null), W = a([u("cx-asset-link-format-dimensions")], W);
|
|
1219
|
-
var jt = W, Mt = t`.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%}}`, G = class extends s {
|
|
1249
|
+
}), o("design:type", Object)], W.prototype, "value", void 0), a([i(), o("design:type", Object)], W.prototype, "customDimensionsUnit", void 0), a([i(), o("design:type", Object)], W.prototype, "dimensionsSelection", void 0), a([i(), o("design:type", Object)], W.prototype, "customDimensionsDrafts", void 0), W = a([u("cx-asset-link-format-dimensions")], W);
|
|
1250
|
+
var Pt = W, Ft = t`.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%}}`, G = class extends s {
|
|
1220
1251
|
constructor(...e) {
|
|
1221
1252
|
super(...e), this.localize = new d(this), this.value = "", this.items = [];
|
|
1222
1253
|
}
|
|
1223
|
-
static #e = this.styles = [l,
|
|
1254
|
+
static #e = this.styles = [l, Ft];
|
|
1224
1255
|
static #t = this.dependencies = {
|
|
1225
|
-
"cx-option":
|
|
1226
|
-
"cx-select":
|
|
1227
|
-
"cx-space":
|
|
1228
|
-
"cx-typography":
|
|
1256
|
+
"cx-option": S,
|
|
1257
|
+
"cx-select": w,
|
|
1258
|
+
"cx-space": C,
|
|
1259
|
+
"cx-typography": b
|
|
1229
1260
|
};
|
|
1230
1261
|
handleExtensionChange(e) {
|
|
1231
1262
|
let t = e.target.value;
|
|
1232
1263
|
this.emit("cx-asset-link-format-extension-change", { detail: t });
|
|
1233
1264
|
}
|
|
1234
1265
|
render() {
|
|
1235
|
-
return e`<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}>${
|
|
1266
|
+
return e`<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}>${x(this.items, (e) => e.value, (t) => e`<cx-option value=${t.value}>${t.displayName}</cx-option>`)}</cx-select></cx-space>`;
|
|
1236
1267
|
}
|
|
1237
1268
|
};
|
|
1238
1269
|
a([r({
|
|
@@ -1242,23 +1273,23 @@ a([r({
|
|
|
1242
1273
|
reflect: !1,
|
|
1243
1274
|
type: Array
|
|
1244
1275
|
}), o("design:type", typeof Array > "u" ? Object : Array)], G.prototype, "items", void 0), G = a([u("cx-asset-link-format-extension")], G);
|
|
1245
|
-
var
|
|
1276
|
+
var It = G, Lt = t`cx-details::part(base){border-bottom-width:0}`, Rt = "auto", K = class extends s {
|
|
1246
1277
|
constructor(...e) {
|
|
1247
1278
|
super(...e), this.localize = new d(this), this.open = !1, this.value = "", this.items = [], this.canAutoFormat = !1, this.autoFormat = !1, this.loading = !1, this.scopedValue = "";
|
|
1248
1279
|
}
|
|
1249
|
-
static #e = this.styles = [l,
|
|
1280
|
+
static #e = this.styles = [l, Lt];
|
|
1250
1281
|
static #t = this.dependencies = {
|
|
1251
1282
|
"cx-button": _,
|
|
1252
|
-
"cx-details":
|
|
1253
|
-
"cx-divider":
|
|
1283
|
+
"cx-details": T,
|
|
1284
|
+
"cx-divider": ye,
|
|
1254
1285
|
"cx-icon": h,
|
|
1255
|
-
"cx-option":
|
|
1256
|
-
"cx-select":
|
|
1257
|
-
"cx-space":
|
|
1258
|
-
"cx-typography":
|
|
1286
|
+
"cx-option": S,
|
|
1287
|
+
"cx-select": w,
|
|
1288
|
+
"cx-space": C,
|
|
1289
|
+
"cx-typography": b
|
|
1259
1290
|
};
|
|
1260
1291
|
get committedValue() {
|
|
1261
|
-
return this.autoFormat ?
|
|
1292
|
+
return this.autoFormat ? Rt : this.value;
|
|
1262
1293
|
}
|
|
1263
1294
|
handleValueChange() {
|
|
1264
1295
|
this.scopedValue = this.committedValue;
|
|
@@ -1289,11 +1320,11 @@ var Nt = G, Pt = t`cx-details::part(base){border-bottom-width:0}`, Ft = "auto",
|
|
|
1289
1320
|
e.target !== this.base && e.stopPropagation();
|
|
1290
1321
|
}
|
|
1291
1322
|
render() {
|
|
1292
|
-
return e`<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}>${
|
|
1293
|
-
${m(this.canAutoFormat, () => e`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${
|
|
1323
|
+
return e`<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}>${x(this.items, (e) => e.id, (t) => e`<cx-option value=${t.id}>${t.proxyLabel}</cx-option>`)}
|
|
1324
|
+
${m(this.canAutoFormat, () => e`<cx-divider></cx-divider><cx-option data-testid="cx-asset-link-format-proxy-auto-option" value=${Rt}>${this.localize.term("auto")}</cx-option>`, () => n)}</cx-select><cx-button data-testid="cx-asset-link-format-proxy-apply" variant="primary" style=${g({ "margin-left": "auto" })} ?disabled=${this.scopedValue === this.committedValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1294
1325
|
}
|
|
1295
1326
|
};
|
|
1296
|
-
a([c(".details"), o("design:type",
|
|
1327
|
+
a([c(".details"), o("design:type", T === void 0 ? Object : T)], K.prototype, "base", void 0), a([r({
|
|
1297
1328
|
reflect: !0,
|
|
1298
1329
|
type: Boolean
|
|
1299
1330
|
}), o("design:type", Object)], K.prototype, "open", void 0), a([r({
|
|
@@ -1325,25 +1356,32 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], K.prototype, "ba
|
|
|
1325
1356
|
o("design:paramtypes", []),
|
|
1326
1357
|
o("design:returntype", void 0)
|
|
1327
1358
|
], K.prototype, "handleOpenChange", null), K = a([u("cx-asset-link-format-proxy")], K);
|
|
1328
|
-
var
|
|
1359
|
+
var zt = K, Bt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__quality-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__quality-inline .asset-link-format__quality-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__quality-inline .asset-link-format__quality-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}.asset-link-format__quality-apply{margin-inline-start:auto}`, Vt = 1, Ht = 100, Ut = { num: {
|
|
1360
|
+
autofix: !0,
|
|
1361
|
+
mask: Number,
|
|
1362
|
+
max: Ht,
|
|
1363
|
+
min: Vt,
|
|
1364
|
+
radix: ".",
|
|
1365
|
+
scale: 0
|
|
1366
|
+
} }, q = class extends s {
|
|
1329
1367
|
constructor(...e) {
|
|
1330
|
-
super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior =
|
|
1368
|
+
super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.applyBehavior = j.Legacy, this.value = 100, this.items = [], this.customSelected = !1, this.loading = !1, this.scopedValue = 100;
|
|
1331
1369
|
}
|
|
1332
|
-
static #e = this.styles = [l,
|
|
1370
|
+
static #e = this.styles = [l, Bt];
|
|
1333
1371
|
static #t = this.dependencies = {
|
|
1334
1372
|
"cx-button": _,
|
|
1335
|
-
"cx-details":
|
|
1336
|
-
"cx-divider":
|
|
1373
|
+
"cx-details": T,
|
|
1374
|
+
"cx-divider": ye,
|
|
1337
1375
|
"cx-icon": h,
|
|
1338
|
-
"cx-input":
|
|
1339
|
-
"cx-option":
|
|
1340
|
-
"cx-select":
|
|
1341
|
-
"cx-space":
|
|
1376
|
+
"cx-input": le,
|
|
1377
|
+
"cx-option": S,
|
|
1378
|
+
"cx-select": w,
|
|
1379
|
+
"cx-space": C,
|
|
1342
1380
|
"cx-tooltip": ne,
|
|
1343
|
-
"cx-typography":
|
|
1381
|
+
"cx-typography": b
|
|
1344
1382
|
};
|
|
1345
1383
|
get invalidValue() {
|
|
1346
|
-
return isNaN(Number(this.scopedValue)) || Number(this.scopedValue) <
|
|
1384
|
+
return isNaN(Number(this.scopedValue)) || Number(this.scopedValue) < Vt || Number(this.scopedValue) > Ht || this.value === this.scopedValue;
|
|
1347
1385
|
}
|
|
1348
1386
|
handleValueChange() {
|
|
1349
1387
|
this.scopedValue = this.value, this.customSelected = !1;
|
|
@@ -1353,14 +1391,17 @@ var It = K, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
|
|
|
1353
1391
|
let t = e.currentTarget.value;
|
|
1354
1392
|
if (this.customSelected = t === "custom", this.customSelected) return;
|
|
1355
1393
|
let n = this.items.find((e) => String(e.value) === t && !e.disabled);
|
|
1356
|
-
!n || !Number.isFinite(n.value) || n.value <
|
|
1394
|
+
!n || !Number.isFinite(n.value) || n.value < Vt || n.value > Ht || (this.scopedValue = n.value, n.value !== this.value && this.applyBehavior !== j.Manual && this.handleApply());
|
|
1357
1395
|
}
|
|
1358
1396
|
handleQualityChange(e) {
|
|
1359
1397
|
let t = e.target.value;
|
|
1360
1398
|
this.customSelected = !0, this.scopedValue = Number(t);
|
|
1361
1399
|
}
|
|
1362
1400
|
handleQualityCommit(e) {
|
|
1363
|
-
e.target === e.currentTarget && this.applyBehavior ===
|
|
1401
|
+
e.target === e.currentTarget && (this.#n(e.target.value), this.applyBehavior === j.Automatic && this.handleApply());
|
|
1402
|
+
}
|
|
1403
|
+
#n(e) {
|
|
1404
|
+
e && this.scopedValue !== this.value && (this.scopedValue = ce(this.scopedValue, Vt, Ht));
|
|
1364
1405
|
}
|
|
1365
1406
|
handleApply() {
|
|
1366
1407
|
this.loading || this.invalidValue || this.emit("cx-asset-link-format-quality-change", { detail: Number(this.scopedValue) });
|
|
@@ -1373,11 +1414,11 @@ var It = K, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
|
|
|
1373
1414
|
}
|
|
1374
1415
|
renderPresets() {
|
|
1375
1416
|
let t = !this.customSelected && this.items.some((e) => e.value === this.scopedValue) ? String(this.scopedValue) : "custom";
|
|
1376
|
-
return e`<cx-select data-label=${this.localize.term("quality")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.handlePresetChange}>${
|
|
1417
|
+
return e`<cx-select data-label=${this.localize.term("quality")} value=${t} ?disabled=${this.loading} hoist @cx-change=${this.handlePresetChange}>${x(this.items, (e) => e.value, (t) => e`<cx-option value=${String(t.value)} ?disabled=${t.disabled}>${t.label}
|
|
1377
1418
|
${m(!!t.description, () => e`<span slot="help-text">${t.description}</span>`)}</cx-option>`)}<cx-divider></cx-divider><cx-option value="custom"><cx-icon slot="prefix" name="edit"></cx-icon>${this.localize.term("custom")}<span slot="help-text">${this.localize.term("qualityHelpText")}</span></cx-option></cx-select>`;
|
|
1378
1419
|
}
|
|
1379
1420
|
renderSummary() {
|
|
1380
|
-
return e`<cx-space class="asset-link-format__quality-summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant=${this.inline ?
|
|
1421
|
+
return e`<cx-space class="asset-link-format__quality-summary" align-items="center"><div class="details__summary__icon"><div part="icon"><cx-icon name="blur_on"></cx-icon></div></div><cx-typography variant=${this.inline ? y.Body3 : y.Body2}>${this.localize.term("quality")}</cx-typography></cx-space>`;
|
|
1381
1422
|
}
|
|
1382
1423
|
renderApplyButton() {
|
|
1383
1424
|
return e`<cx-button class="asset-link-format__quality-apply" data-testid="cx-asset-link-format-quality-apply" variant="primary" ?disabled=${this.invalidValue} ?loading=${this.loading} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button>`;
|
|
@@ -1385,21 +1426,15 @@ var It = K, Lt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
|
|
|
1385
1426
|
renderContent() {
|
|
1386
1427
|
let t = this.items.length === 0 || this.customSelected || !this.items.some((e) => e.value === this.scopedValue);
|
|
1387
1428
|
return e`<cx-space class="asset-link-format__quality-content" direction="vertical" spacing="small">${m(this.items.length > 0, () => this.renderPresets())}
|
|
1388
|
-
${m(t, () => e`<cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${{
|
|
1389
|
-
|
|
1390
|
-
max: 100,
|
|
1391
|
-
min: 1,
|
|
1392
|
-
radix: ".",
|
|
1393
|
-
scale: 0
|
|
1394
|
-
} }} value=${this.scopedValue.toString()} style=${g({ flex: "1" })} @cx-input=${this.handleQualityChange} @cx-change=${this.handleQualityCommit}></cx-input></cx-tooltip>${m(this.applyBehavior === N.Legacy, () => this.renderApplyButton())}</cx-space>`)}
|
|
1395
|
-
${m(this.applyBehavior === N.Manual, () => this.renderApplyButton())}</cx-space>`;
|
|
1429
|
+
${m(t, () => e`<cx-space spacing="small"><cx-tooltip data-testid="cx-asset-link-format-quality-tooltip" content=${this.localize.term("qualityHelpText")} hoist><cx-input data-testid="cx-asset-link-format-quality" class="details__checkbox" mask="num" .maskBlocks=${Ut} value=${this.scopedValue.toString()} style=${g({ flex: "1" })} @cx-input=${this.handleQualityChange} @cx-change=${this.handleQualityCommit}></cx-input></cx-tooltip>${m(this.applyBehavior === j.Legacy, () => this.renderApplyButton())}</cx-space>`)}
|
|
1430
|
+
${m(this.applyBehavior === j.Manual, () => this.renderApplyButton())}</cx-space>`;
|
|
1396
1431
|
}
|
|
1397
1432
|
render() {
|
|
1398
1433
|
return this.inline ? e`<div class="asset-link-format__quality-inline">${this.renderSummary()}
|
|
1399
1434
|
${this.renderContent()}</div>` : e`<cx-details class="details" ?open=${this.open} @cx-show=${this.onShowDetails} @cx-hide=${this.onHideDetails}><div slot="summary">${this.renderSummary()}</div>${this.renderContent()}</cx-details>`;
|
|
1400
1435
|
}
|
|
1401
1436
|
};
|
|
1402
|
-
a([c(".details"), o("design:type",
|
|
1437
|
+
a([c(".details"), o("design:type", T === void 0 ? Object : T)], q.prototype, "base", void 0), a([r({
|
|
1403
1438
|
reflect: !0,
|
|
1404
1439
|
type: Boolean
|
|
1405
1440
|
}), o("design:type", Object)], q.prototype, "open", void 0), a([r({
|
|
@@ -1424,30 +1459,37 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], q.prototype, "ba
|
|
|
1424
1459
|
o("design:paramtypes", []),
|
|
1425
1460
|
o("design:returntype", void 0)
|
|
1426
1461
|
], q.prototype, "handleValueChange", null), q = a([u("cx-asset-link-format-quality")], q);
|
|
1427
|
-
var
|
|
1462
|
+
var Wt = q, Gt = t`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}`, Kt = { num: {
|
|
1463
|
+
autofix: !0,
|
|
1464
|
+
mask: Number,
|
|
1465
|
+
max: A,
|
|
1466
|
+
min: 1,
|
|
1467
|
+
radix: ".",
|
|
1468
|
+
scale: 0
|
|
1469
|
+
} }, J = class extends s {
|
|
1428
1470
|
constructor(...e) {
|
|
1429
|
-
super(...e), this.localize = new d(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit =
|
|
1430
|
-
[
|
|
1471
|
+
super(...e), this.localize = new d(this), this.open = !1, this.width = 0, this.height = 0, this.maxWidth = 0, this.maxHeight = 0, this.ratioWidth = 1, this.ratioHeight = 1, this.unit = M.Pixel, this.lastAppliedSetting = {
|
|
1472
|
+
[M.Pixel]: {
|
|
1431
1473
|
height: 0,
|
|
1432
1474
|
width: 0
|
|
1433
1475
|
},
|
|
1434
|
-
[
|
|
1476
|
+
[M.AspectRatio]: {
|
|
1435
1477
|
height: 1,
|
|
1436
1478
|
width: 1
|
|
1437
1479
|
}
|
|
1438
1480
|
}, this.loading = !1, this.noRatioModes = !1, this.keepAspectRatio = !1, this.invalidWidth = !1, this.invalidHeight = !1, this.aspectRatio = 0;
|
|
1439
1481
|
}
|
|
1440
|
-
static #e = this.styles = [l,
|
|
1482
|
+
static #e = this.styles = [l, Gt];
|
|
1441
1483
|
static #t = this.dependencies = {
|
|
1442
1484
|
"cx-button": _,
|
|
1443
|
-
"cx-details":
|
|
1485
|
+
"cx-details": T,
|
|
1444
1486
|
"cx-icon": h,
|
|
1445
1487
|
"cx-icon-button": p,
|
|
1446
|
-
"cx-input":
|
|
1447
|
-
"cx-option":
|
|
1448
|
-
"cx-select":
|
|
1449
|
-
"cx-space":
|
|
1450
|
-
"cx-typography":
|
|
1488
|
+
"cx-input": le,
|
|
1489
|
+
"cx-option": S,
|
|
1490
|
+
"cx-select": w,
|
|
1491
|
+
"cx-space": C,
|
|
1492
|
+
"cx-typography": b
|
|
1451
1493
|
};
|
|
1452
1494
|
get disabledApply() {
|
|
1453
1495
|
return this.lastAppliedSetting[this.unit].width === this.width && this.lastAppliedSetting[this.unit].height === this.height;
|
|
@@ -1455,11 +1497,11 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
|
|
|
1455
1497
|
async handleCropModeChange() {
|
|
1456
1498
|
let e = Number.isFinite(this.maxWidth) && Number.isFinite(this.maxHeight) && this.maxWidth > 0 && this.maxHeight > 0;
|
|
1457
1499
|
if (this.keepAspectRatio) {
|
|
1458
|
-
if (this.unit ===
|
|
1500
|
+
if (this.unit === M.AspectRatio && this.ratioWidth && this.ratioHeight) {
|
|
1459
1501
|
this.aspectRatio = this.ratioWidth / this.ratioHeight;
|
|
1460
1502
|
return;
|
|
1461
1503
|
}
|
|
1462
|
-
if (this.unit ===
|
|
1504
|
+
if (this.unit === M.Pixel && !e && this.width && this.height) {
|
|
1463
1505
|
this.aspectRatio = this.width / this.height;
|
|
1464
1506
|
return;
|
|
1465
1507
|
}
|
|
@@ -1487,9 +1529,9 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
|
|
|
1487
1529
|
this.invalidWidth = !0;
|
|
1488
1530
|
return;
|
|
1489
1531
|
}
|
|
1490
|
-
this.invalidWidth = !1, this.unit ===
|
|
1491
|
-
let n = this.unit ===
|
|
1492
|
-
!this.keepAspectRatio && this.unit ===
|
|
1532
|
+
this.invalidWidth = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxWidth), 1));
|
|
1533
|
+
let n = this.unit === M.Pixel ? this.height : this.ratioHeight;
|
|
1534
|
+
!this.keepAspectRatio && this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxWidth, this.maxHeight)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t / this.aspectRatio), this.maxHeight, A), 1), this.invalidHeight = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
|
|
1493
1535
|
height: n,
|
|
1494
1536
|
keepAspectRatio: this.keepAspectRatio,
|
|
1495
1537
|
unit: this.unit,
|
|
@@ -1502,9 +1544,9 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
|
|
|
1502
1544
|
this.invalidHeight = !0;
|
|
1503
1545
|
return;
|
|
1504
1546
|
}
|
|
1505
|
-
this.invalidHeight = !1, this.unit ===
|
|
1506
|
-
let n = this.unit ===
|
|
1507
|
-
!this.keepAspectRatio && this.unit ===
|
|
1547
|
+
this.invalidHeight = !1, t = Math.min(t, A), this.unit === M.Pixel && (t = Math.max(Math.min(t, this.maxHeight), 1));
|
|
1548
|
+
let n = this.unit === M.Pixel ? this.width : this.ratioWidth;
|
|
1549
|
+
!this.keepAspectRatio && this.unit === M.AspectRatio && ([t, n] = this.fitRatioSides(t, n, this.maxHeight, this.maxWidth)), e.target.value = t.toString(), this.keepAspectRatio && (n = Math.max(Math.min(Math.round(t * this.aspectRatio), this.maxWidth, A), 1), this.invalidWidth = !1), this.emit("cx-asset-link-format-resize-change", { detail: {
|
|
1508
1550
|
height: t,
|
|
1509
1551
|
keepAspectRatio: this.keepAspectRatio,
|
|
1510
1552
|
unit: this.unit,
|
|
@@ -1512,16 +1554,16 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
|
|
|
1512
1554
|
} });
|
|
1513
1555
|
}
|
|
1514
1556
|
onUnitChange(e) {
|
|
1515
|
-
e.target.value ===
|
|
1516
|
-
height: this.lastAppliedSetting[
|
|
1557
|
+
e.target.value === M.AspectRatio ? this.emit("cx-asset-link-format-resize-change", { detail: {
|
|
1558
|
+
height: this.lastAppliedSetting[M.AspectRatio].height,
|
|
1517
1559
|
keepAspectRatio: this.keepAspectRatio,
|
|
1518
|
-
unit:
|
|
1519
|
-
width: this.lastAppliedSetting[
|
|
1560
|
+
unit: M.AspectRatio,
|
|
1561
|
+
width: this.lastAppliedSetting[M.AspectRatio].width
|
|
1520
1562
|
} }) : this.emit("cx-asset-link-format-resize-change", { detail: {
|
|
1521
|
-
height: this.lastAppliedSetting[
|
|
1563
|
+
height: this.lastAppliedSetting[M.Pixel].height,
|
|
1522
1564
|
keepAspectRatio: this.keepAspectRatio,
|
|
1523
|
-
unit:
|
|
1524
|
-
width: this.lastAppliedSetting[
|
|
1565
|
+
unit: M.Pixel,
|
|
1566
|
+
width: this.lastAppliedSetting[M.Pixel].width
|
|
1525
1567
|
} });
|
|
1526
1568
|
}
|
|
1527
1569
|
handleApply() {
|
|
@@ -1539,10 +1581,10 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
|
|
|
1539
1581
|
}
|
|
1540
1582
|
handleAspectRatioClick() {
|
|
1541
1583
|
this.emit("cx-asset-link-format-resize-change", { detail: {
|
|
1542
|
-
height: this.unit ===
|
|
1584
|
+
height: this.unit === M.Pixel ? this.height : this.ratioHeight,
|
|
1543
1585
|
keepAspectRatio: !this.keepAspectRatio,
|
|
1544
1586
|
unit: this.unit,
|
|
1545
|
-
width: this.unit ===
|
|
1587
|
+
width: this.unit === M.Pixel ? this.width : this.ratioWidth
|
|
1546
1588
|
} });
|
|
1547
1589
|
}
|
|
1548
1590
|
fitRatioSides(e, t, n, r) {
|
|
@@ -1551,24 +1593,14 @@ var Rt = q, zt = t`cx-details::part(base){border-bottom-width:0}cx-space{width:1
|
|
|
1551
1593
|
return [i, Math.min(t, r * i)];
|
|
1552
1594
|
}
|
|
1553
1595
|
render() {
|
|
1554
|
-
return e`<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="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${{
|
|
1555
|
-
mask: Number,
|
|
1556
|
-
min: 1,
|
|
1557
|
-
radix: ".",
|
|
1558
|
-
scale: 0
|
|
1559
|
-
} }} value=${this.unit === k.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1596
|
+
return e`<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="aspect_ratio"></cx-icon></div><cx-typography variant="body2">${this.localize.term("resize")}</cx-typography></cx-space><cx-space direction="vertical" spacing="small"><cx-space spacing="small"><div class="resize__input-group"><cx-input data-testid="cx-asset-link-format-resize-width" placeholder=${this.localize.term("width")} mask="num" .maskBlocks=${Kt} value=${this.unit === M.Pixel ? this.width.toString() : this.ratioWidth.toString()} @cx-input=${this.handleWidthChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1560
1597
|
W
|
|
1561
|
-
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${{
|
|
1562
|
-
mask: Number,
|
|
1563
|
-
min: 1,
|
|
1564
|
-
radix: ".",
|
|
1565
|
-
scale: 0
|
|
1566
|
-
} }} value=${this.unit === k.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1598
|
+
</cx-typography></cx-input><cx-icon-button data-testid="cx-asset-link-format-resize-aspect-ratio" name=${this.keepAspectRatio ? "insert_link" : "link_off"} label=${this.localize.term("keepAspectRatio")} .pressed=${this.keepAspectRatio} @click=${this.handleAspectRatioClick} style=${g({ color: this.keepAspectRatio ? "var(--cx-color-primary)" : void 0 })} ?disabled=${this.loading}></cx-icon-button><cx-input data-testid="cx-asset-link-format-resize-height" placeholder=${this.localize.term("height")} mask="num" .maskBlocks=${Kt} value=${this.unit === M.Pixel ? this.height.toString() : this.ratioHeight.toString()} @cx-input=${this.handleHeightChange} required ?disabled=${this.loading}><cx-typography slot="prefix" variant="body3" part="input-label">
|
|
1567
1599
|
H
|
|
1568
|
-
</cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${
|
|
1600
|
+
</cx-typography></cx-input></div>${m(!this.noRatioModes, () => e`<cx-select data-testid="cx-asset-link-format-resize-unit" value=${this.unit} hoist class="resize__unit-select" @cx-change=${this.onUnitChange}><cx-option value=${M.Pixel}>${this.localize.term("pixels")}</cx-option><cx-option value=${M.AspectRatio}>${this.localize.term("aspectRatio")}</cx-option></cx-select>`)}</cx-space><cx-button data-testid="cx-asset-link-format-resize-apply" variant="primary" ?disabled=${this.disabledApply || this.invalidHeight || this.invalidWidth} ?loading=${this.loading} style=${g({ marginLeft: "auto" })} @click=${this.handleApply}>${this.localize.term("apply")}</cx-button></cx-space></cx-details>`;
|
|
1569
1601
|
}
|
|
1570
1602
|
};
|
|
1571
|
-
a([c(".details"), o("design:type",
|
|
1603
|
+
a([c(".details"), o("design:type", T === void 0 ? Object : T)], J.prototype, "base", void 0), a([r({
|
|
1572
1604
|
reflect: !0,
|
|
1573
1605
|
type: Boolean
|
|
1574
1606
|
}), o("design:type", Boolean)], J.prototype, "open", void 0), a([r({
|
|
@@ -1596,7 +1628,7 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], J.prototype, "ba
|
|
|
1596
1628
|
}), o("design:type", Number)], J.prototype, "ratioHeight", void 0), a([r({
|
|
1597
1629
|
reflect: !0,
|
|
1598
1630
|
type: String
|
|
1599
|
-
}), o("design:type",
|
|
1631
|
+
}), o("design:type", M === void 0 ? Object : M)], J.prototype, "unit", void 0), a([r({
|
|
1600
1632
|
attribute: "last-applied-setting",
|
|
1601
1633
|
reflect: !1,
|
|
1602
1634
|
type: Object
|
|
@@ -1625,19 +1657,19 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], J.prototype, "ba
|
|
|
1625
1657
|
o("design:paramtypes", []),
|
|
1626
1658
|
o("design:returntype", Promise)
|
|
1627
1659
|
], J.prototype, "handleOpenChange", null), J = a([u("cx-asset-link-format-resize")], J);
|
|
1628
|
-
var
|
|
1660
|
+
var qt = J, Jt = t`cx-details::part(base){border-bottom-width:0}.asset-link-format__rotation-inline{padding:var(--cx-spacing-small) var(--cx-spacing-medium)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary{margin-block-end:var(--cx-spacing-small)}.asset-link-format__rotation-inline .asset-link-format__rotation-summary cx-typography{--font-weight:var(--cx-font-weight-medium)}`, Y = class extends s {
|
|
1629
1661
|
constructor(...e) {
|
|
1630
1662
|
super(...e), this.localize = new d(this), this.open = !1, this.inline = !1, this.value = 0, this.defaultValue = 0, this.loading = !1, this.lastAppliedValue = 0;
|
|
1631
1663
|
}
|
|
1632
|
-
static #e = this.styles = [l,
|
|
1664
|
+
static #e = this.styles = [l, Jt];
|
|
1633
1665
|
static #t = this.dependencies = {
|
|
1634
1666
|
"cx-button": _,
|
|
1635
|
-
"cx-button-group":
|
|
1636
|
-
"cx-details":
|
|
1667
|
+
"cx-button-group": oe,
|
|
1668
|
+
"cx-details": T,
|
|
1637
1669
|
"cx-icon": h,
|
|
1638
1670
|
"cx-icon-button": p,
|
|
1639
|
-
"cx-space":
|
|
1640
|
-
"cx-typography":
|
|
1671
|
+
"cx-space": C,
|
|
1672
|
+
"cx-typography": b
|
|
1641
1673
|
};
|
|
1642
1674
|
handleOpenChange() {
|
|
1643
1675
|
this.open || this.emit("cx-asset-link-format-rotation-change", { detail: this.lastAppliedValue });
|
|
@@ -1661,7 +1693,7 @@ var Bt = J, Vt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
|
|
|
1661
1693
|
this.value === 360 || this.value === -360 || this.loading || this.emit("cx-asset-link-format-rotation-apply", { detail: this.value });
|
|
1662
1694
|
}
|
|
1663
1695
|
renderSummary() {
|
|
1664
|
-
return e`<cx-space class="asset-link-format__rotation-summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant=${this.inline ?
|
|
1696
|
+
return e`<cx-space class="asset-link-format__rotation-summary" align-items="center"><div part="icon"><cx-icon name="rotate_90_degrees_cw"></cx-icon></div><cx-typography variant=${this.inline ? y.Body3 : y.Body2}>${this.localize.term("rotate")}</cx-typography></cx-space>`;
|
|
1665
1697
|
}
|
|
1666
1698
|
renderControls() {
|
|
1667
1699
|
return e`<cx-space class="asset-link-format__rotation-controls" spacing="small"><cx-button-group label=${this.localize.term("rotate")}><cx-icon-button data-testid="cx-asset-link-format-rotation-ccw" name="rotate_90_degrees_ccw" label=${this.localize.term("rotateCounterclockwise")} outline size="small" ?disabled=${this.loading || this.value === -360} @click=${this.handleCounterClockwiseClick}></cx-icon-button><cx-icon-button data-testid="cx-asset-link-format-rotation-cw" name="rotate_90_degrees_cw" label=${this.localize.term("rotateClockwise")} outline size="small" ?disabled=${this.loading || this.value === 360} @click=${this.handleClockwiseClick}></cx-icon-button></cx-button-group><cx-input data-testid="cx-asset-link-format-rotation" value=${(this.value + this.defaultValue).toString()} placeholder="0" mask="num" .maskBlocks=${{ num: {
|
|
@@ -1681,7 +1713,7 @@ var Bt = J, Vt = t`cx-details::part(base){border-bottom-width:0}.asset-link-form
|
|
|
1681
1713
|
${this.renderControls()}</div>` : e`<cx-details class="details" ?open=${this.open}><div slot="summary">${this.renderSummary()}</div>${this.renderControls()}</cx-details>`;
|
|
1682
1714
|
}
|
|
1683
1715
|
};
|
|
1684
|
-
a([c(".details"), o("design:type",
|
|
1716
|
+
a([c(".details"), o("design:type", T === void 0 ? Object : T)], Y.prototype, "base", void 0), a([r({
|
|
1685
1717
|
reflect: !0,
|
|
1686
1718
|
type: Boolean
|
|
1687
1719
|
}), o("design:type", Object)], Y.prototype, "open", void 0), a([r({
|
|
@@ -1707,19 +1739,19 @@ a([c(".details"), o("design:type", E === void 0 ? Object : E)], Y.prototype, "ba
|
|
|
1707
1739
|
o("design:paramtypes", []),
|
|
1708
1740
|
o("design:returntype", void 0)
|
|
1709
1741
|
], Y.prototype, "handleOpenChange", null), Y = a([u("cx-asset-link-format-rotation")], Y);
|
|
1710
|
-
var
|
|
1742
|
+
var Yt = Y, Xt = t`cx-details::part(base){border-bottom-width:0}`, X = class extends s {
|
|
1711
1743
|
constructor(...e) {
|
|
1712
1744
|
super(...e), this.localize = new d(this), this.open = !1, this.value = !1;
|
|
1713
1745
|
}
|
|
1714
|
-
static #e = this.styles = [l,
|
|
1746
|
+
static #e = this.styles = [l, Xt];
|
|
1715
1747
|
static #t = this.dependencies = {
|
|
1716
1748
|
"cx-button": _,
|
|
1717
|
-
"cx-checkbox":
|
|
1718
|
-
"cx-details":
|
|
1749
|
+
"cx-checkbox": se,
|
|
1750
|
+
"cx-details": T,
|
|
1719
1751
|
"cx-icon": h,
|
|
1720
|
-
"cx-space":
|
|
1752
|
+
"cx-space": C,
|
|
1721
1753
|
"cx-tooltip": ne,
|
|
1722
|
-
"cx-typography":
|
|
1754
|
+
"cx-typography": b
|
|
1723
1755
|
};
|
|
1724
1756
|
handleApply(e) {
|
|
1725
1757
|
this.emit("cx-asset-link-format-metadata-change", { detail: e.target.checked });
|
|
@@ -1734,61 +1766,61 @@ var Ht = Y, Ut = t`cx-details::part(base){border-bottom-width:0}`, X = class ext
|
|
|
1734
1766
|
return e`<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>`;
|
|
1735
1767
|
}
|
|
1736
1768
|
};
|
|
1737
|
-
a([c(".details"), o("design:type",
|
|
1769
|
+
a([c(".details"), o("design:type", T === void 0 ? Object : T)], X.prototype, "base", void 0), a([r({
|
|
1738
1770
|
reflect: !0,
|
|
1739
1771
|
type: Boolean
|
|
1740
1772
|
}), o("design:type", Object)], X.prototype, "open", void 0), a([r({
|
|
1741
1773
|
reflect: !0,
|
|
1742
1774
|
type: Boolean
|
|
1743
1775
|
}), o("design:type", Object)], X.prototype, "value", void 0), X = a([u("cx-asset-link-format-metadata")], X);
|
|
1744
|
-
var
|
|
1745
|
-
[
|
|
1746
|
-
[
|
|
1747
|
-
[
|
|
1748
|
-
[
|
|
1749
|
-
[
|
|
1776
|
+
var Zt = X, Z, Qt = {
|
|
1777
|
+
[k.Crop]: D.Crop,
|
|
1778
|
+
[k.Dimensions]: D.Dimensions,
|
|
1779
|
+
[k.Quality]: D.Quality,
|
|
1780
|
+
[k.Resize]: D.Resize,
|
|
1781
|
+
[k.Rotate]: D.Rotate
|
|
1750
1782
|
}, Q = [
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
],
|
|
1758
|
-
|
|
1759
|
-
|
|
1783
|
+
k.Proxy,
|
|
1784
|
+
k.Crop,
|
|
1785
|
+
k.Resize,
|
|
1786
|
+
k.Rotate,
|
|
1787
|
+
k.Quality,
|
|
1788
|
+
k.Metadata
|
|
1789
|
+
], $t = [
|
|
1790
|
+
k.Proxy,
|
|
1791
|
+
k.Dimensions,
|
|
1760
1792
|
...Q.slice(1)
|
|
1761
|
-
],
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
], $ = class extends s {
|
|
1793
|
+
], en = [
|
|
1794
|
+
k.Dimensions,
|
|
1795
|
+
k.Crop,
|
|
1796
|
+
k.Resize,
|
|
1797
|
+
k.Rotate,
|
|
1798
|
+
k.Quality
|
|
1799
|
+
], tn = "|", $ = class extends s {
|
|
1768
1800
|
static #e = Z = this;
|
|
1769
|
-
static #t = this.styles = [l,
|
|
1801
|
+
static #t = this.styles = [l, kt];
|
|
1770
1802
|
static #n = this.dependencies = {
|
|
1771
|
-
"cx-asset-link-format-crop":
|
|
1772
|
-
"cx-asset-link-format-dimensions":
|
|
1773
|
-
"cx-asset-link-format-extension":
|
|
1774
|
-
"cx-asset-link-format-metadata":
|
|
1775
|
-
"cx-asset-link-format-proxy":
|
|
1776
|
-
"cx-asset-link-format-quality":
|
|
1777
|
-
"cx-asset-link-format-resize":
|
|
1778
|
-
"cx-asset-link-format-rotation":
|
|
1803
|
+
"cx-asset-link-format-crop": jt,
|
|
1804
|
+
"cx-asset-link-format-dimensions": Pt,
|
|
1805
|
+
"cx-asset-link-format-extension": It,
|
|
1806
|
+
"cx-asset-link-format-metadata": Zt,
|
|
1807
|
+
"cx-asset-link-format-proxy": zt,
|
|
1808
|
+
"cx-asset-link-format-quality": Wt,
|
|
1809
|
+
"cx-asset-link-format-resize": qt,
|
|
1810
|
+
"cx-asset-link-format-rotation": Yt,
|
|
1779
1811
|
"cx-button": _,
|
|
1780
1812
|
"cx-icon": h,
|
|
1781
1813
|
"cx-icon-button": p,
|
|
1782
|
-
"cx-space":
|
|
1783
|
-
"cx-switch":
|
|
1784
|
-
"cx-typography":
|
|
1785
|
-
"cx-visually-hidden":
|
|
1814
|
+
"cx-space": C,
|
|
1815
|
+
"cx-switch": Ce,
|
|
1816
|
+
"cx-typography": b,
|
|
1817
|
+
"cx-visually-hidden": ue
|
|
1786
1818
|
};
|
|
1787
1819
|
static getTransformExtension(e) {
|
|
1788
|
-
return !e ||
|
|
1820
|
+
return !e || Tt(e) ? e : "jpg";
|
|
1789
1821
|
}
|
|
1790
1822
|
static fitRatioResizeSize(e, t, n, r) {
|
|
1791
|
-
let { height: i, width: a } =
|
|
1823
|
+
let { height: i, width: a } = ae(n, r, e, t);
|
|
1792
1824
|
return {
|
|
1793
1825
|
height: Math.max(i, 1),
|
|
1794
1826
|
width: Math.max(a, 1)
|
|
@@ -1798,7 +1830,7 @@ var Wt = X, Z, Gt = {
|
|
|
1798
1830
|
return [...new Map(e.map((e) => [e.key, e])).values()];
|
|
1799
1831
|
}
|
|
1800
1832
|
static orderTransformations(e, t) {
|
|
1801
|
-
let n = t.map((e) =>
|
|
1833
|
+
let n = t.map((e) => Qt[e]).filter((e) => e !== void 0), r = e.filter((e) => n.includes(e.key)).sort((e, t) => n.indexOf(e.key) - n.indexOf(t.key)), i = 0;
|
|
1802
1834
|
return e.map((e) => n.includes(e.key) ? r[i++] : e);
|
|
1803
1835
|
}
|
|
1804
1836
|
static getDimensionsPresetSize(e) {
|
|
@@ -1809,24 +1841,36 @@ var Wt = X, Z, Gt = {
|
|
|
1809
1841
|
} : void 0;
|
|
1810
1842
|
}
|
|
1811
1843
|
static getDimensionsSize(e) {
|
|
1812
|
-
if (e?.mode ===
|
|
1813
|
-
if (e?.mode ===
|
|
1844
|
+
if (e?.mode === E.Preset) return Z.getDimensionsPresetSize(e.value);
|
|
1845
|
+
if (e?.mode === E.Custom && e.unit === O.Pixel && Number.isInteger(e.width) && Number.isInteger(e.height) && e.width >= 1 && e.height >= 1) return {
|
|
1814
1846
|
height: e.height,
|
|
1815
1847
|
width: e.width
|
|
1816
1848
|
};
|
|
1817
1849
|
}
|
|
1850
|
+
static getPercentDimensions(e) {
|
|
1851
|
+
return e?.mode === E.Custom && e.unit === O.Percent ? e : void 0;
|
|
1852
|
+
}
|
|
1853
|
+
static parsePercentDimensions(e) {
|
|
1854
|
+
let t = /^\s*(\d+)\s*%\s*,\s*(\d+)\s*%\s*$/.exec(e), n = Number(t?.[1]), r = Number(t?.[2]);
|
|
1855
|
+
return n >= 1 && n <= 100 && r === n ? {
|
|
1856
|
+
height: r,
|
|
1857
|
+
mode: E.Custom,
|
|
1858
|
+
unit: O.Percent,
|
|
1859
|
+
width: n
|
|
1860
|
+
} : void 0;
|
|
1861
|
+
}
|
|
1818
1862
|
static getSizeBoundAfterStep(e, t) {
|
|
1819
1863
|
let { height: n = 0, rotation: r = 0, unit: i, width: a = 0 } = t.value, o = Math.round(a) >= 1 && Math.round(n) >= 1;
|
|
1820
1864
|
switch (t.key) {
|
|
1821
|
-
case
|
|
1865
|
+
case D.Resize: return i !== M.AspectRatio && o ? {
|
|
1822
1866
|
height: Math.round(n),
|
|
1823
1867
|
width: Math.round(a)
|
|
1824
1868
|
} : void 0;
|
|
1825
|
-
case
|
|
1869
|
+
case D.Dimensions: return o ? {
|
|
1826
1870
|
height: Math.min(e?.height ?? Infinity, Math.round(n)),
|
|
1827
1871
|
width: Math.min(e?.width ?? Infinity, Math.round(a))
|
|
1828
1872
|
} : e;
|
|
1829
|
-
case
|
|
1873
|
+
case D.Rotate: {
|
|
1830
1874
|
if (!e) return;
|
|
1831
1875
|
let t = r * Math.PI / 180, n = Math.abs(Math.cos(t)), i = Math.abs(Math.sin(t));
|
|
1832
1876
|
return {
|
|
@@ -1837,28 +1881,32 @@ var Wt = X, Z, Gt = {
|
|
|
1837
1881
|
default: return e;
|
|
1838
1882
|
}
|
|
1839
1883
|
}
|
|
1884
|
+
#r;
|
|
1885
|
+
#i;
|
|
1886
|
+
#a;
|
|
1887
|
+
#o;
|
|
1840
1888
|
get canReorder() {
|
|
1841
1889
|
return this.reorderable && !this.asset;
|
|
1842
1890
|
}
|
|
1843
1891
|
get isFormatsLayout() {
|
|
1844
|
-
return this.layout ===
|
|
1892
|
+
return this.layout === xe.Formats;
|
|
1845
1893
|
}
|
|
1846
1894
|
get hasUnfrozenTransformations() {
|
|
1847
1895
|
return !(this.transformations.length === 0 || this.frozenIndex !== void 0 && this.frozenIndex >= this.transformations.length - 1);
|
|
1848
1896
|
}
|
|
1849
1897
|
get lastAppliedCropUnit() {
|
|
1850
|
-
return this.transformations.findLast((e) => e.key ===
|
|
1898
|
+
return this.transformations.findLast((e) => e.key === D.Crop)?.value.unit ?? M.Pixel;
|
|
1851
1899
|
}
|
|
1852
1900
|
get lastAppliedCropFocusMode() {
|
|
1853
|
-
return this.transformations.findLast((e) => e.key ===
|
|
1901
|
+
return this.transformations.findLast((e) => e.key === D.Crop)?.value.focusMode ?? "manual";
|
|
1854
1902
|
}
|
|
1855
1903
|
get lastAppliedCropPosition() {
|
|
1856
|
-
return this.transformations.findLast((e) => e.key ===
|
|
1904
|
+
return this.transformations.findLast((e) => e.key === D.Crop)?.value.position ?? v.CenterCenter;
|
|
1857
1905
|
}
|
|
1858
1906
|
get disabledCropApply() {
|
|
1859
1907
|
if (!this.asset && this.cropSize.unit !== this.lastAppliedCropUnit) return !1;
|
|
1860
|
-
if (this.cropSize.unit ===
|
|
1861
|
-
let e = this.lastCropSize[
|
|
1908
|
+
if (this.cropSize.unit === M.AspectRatio && !this.asset) {
|
|
1909
|
+
let e = this.lastCropSize[M.AspectRatio];
|
|
1862
1910
|
return this.cropSize.ratioWidth === e.width && this.cropSize.ratioHeight === e.height && this.cropSize.focusMode === this.lastAppliedCropFocusMode && this.cropSize.position === this.lastAppliedCropPosition;
|
|
1863
1911
|
}
|
|
1864
1912
|
if (!this.asset && this.cropSize.focusMode !== this.lastAppliedCropFocusMode || !this.asset && this.cropSize.position !== this.lastAppliedCropPosition) return !1;
|
|
@@ -1869,14 +1917,14 @@ var Wt = X, Z, Gt = {
|
|
|
1869
1917
|
"width",
|
|
1870
1918
|
"x",
|
|
1871
1919
|
"y"
|
|
1872
|
-
]) if (this.cropSize[e] !== this.lastCropSize[
|
|
1920
|
+
]) if (this.cropSize[e] !== this.lastCropSize[M.Pixel][e]) return !1;
|
|
1873
1921
|
return !0;
|
|
1874
1922
|
}
|
|
1875
1923
|
get formats() {
|
|
1876
1924
|
return this.proxies?.filter((e) => !e.cdnName) || [];
|
|
1877
1925
|
}
|
|
1878
1926
|
get activeParts() {
|
|
1879
|
-
let e = new Set(Object.values(
|
|
1927
|
+
let e = new Set(Object.values(k)), t = /* @__PURE__ */ new Set();
|
|
1880
1928
|
for (let n of this.parts) e.has(n) && t.add(n);
|
|
1881
1929
|
return [...t];
|
|
1882
1930
|
}
|
|
@@ -1887,11 +1935,11 @@ var Wt = X, Z, Gt = {
|
|
|
1887
1935
|
};
|
|
1888
1936
|
}
|
|
1889
1937
|
get stepsBeforeCrop() {
|
|
1890
|
-
let e = this.transformations.findIndex((e) => e.key ===
|
|
1938
|
+
let e = this.transformations.findIndex((e) => e.key === D.Crop);
|
|
1891
1939
|
if (e >= 0) return this.transformations.slice(0, e);
|
|
1892
1940
|
if (!this.canReorder) return this.transformations;
|
|
1893
1941
|
let t = {
|
|
1894
|
-
key:
|
|
1942
|
+
key: D.Crop,
|
|
1895
1943
|
value: {}
|
|
1896
1944
|
}, n = Z.orderTransformations([...this.transformations, t], this.activeParts);
|
|
1897
1945
|
return n.slice(0, n.indexOf(t));
|
|
@@ -1902,55 +1950,63 @@ var Wt = X, Z, Gt = {
|
|
|
1902
1950
|
width: Infinity
|
|
1903
1951
|
};
|
|
1904
1952
|
}
|
|
1953
|
+
get #s() {
|
|
1954
|
+
if (!this.canPercentDimensions) return "";
|
|
1955
|
+
let e = Z.getPercentDimensions(this.selectedDimensions);
|
|
1956
|
+
return e ? `${tn}${e.width}%,${e.height}%` : tn;
|
|
1957
|
+
}
|
|
1958
|
+
get #c() {
|
|
1959
|
+
return this.canPercentDimensions && this.canCustomDimensions && !this.asset && this.activeParts.includes(k.Dimensions);
|
|
1960
|
+
}
|
|
1905
1961
|
get isCropAtDimensionsLimit() {
|
|
1906
1962
|
let e = this.stepsBeforeCrop;
|
|
1907
|
-
if (this.asset || this.cropSize.unit !==
|
|
1963
|
+
if (this.asset || this.cropSize.unit !== M.Pixel || !e.some((e) => e.key === D.Dimensions)) return !1;
|
|
1908
1964
|
let t = {
|
|
1909
1965
|
height: Infinity,
|
|
1910
1966
|
width: Infinity
|
|
1911
|
-
}, n = e.reduce(Z.getSizeBoundAfterStep, void 0) ?? t, r = e.filter((e) => e.key !==
|
|
1967
|
+
}, n = e.reduce(Z.getSizeBoundAfterStep, void 0) ?? t, r = e.filter((e) => e.key !== D.Dimensions).reduce(Z.getSizeBoundAfterStep, void 0) ?? t;
|
|
1912
1968
|
return n.width < r.width && this.cropSize.width >= n.width || n.height < r.height && this.cropSize.height >= n.height;
|
|
1913
1969
|
}
|
|
1914
1970
|
get lastCropSize() {
|
|
1915
1971
|
if (!this.asset) {
|
|
1916
|
-
let e = this.transformations.findLast((e) => e.key ===
|
|
1917
|
-
if (e?.value.unit ===
|
|
1918
|
-
[
|
|
1972
|
+
let e = this.transformations.findLast((e) => e.key === D.Crop);
|
|
1973
|
+
if (e?.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) return {
|
|
1974
|
+
[M.AspectRatio]: {
|
|
1919
1975
|
height: e.value.ratioHeight,
|
|
1920
1976
|
percentageHeight: 100,
|
|
1921
1977
|
percentageWidth: 100,
|
|
1922
|
-
unit:
|
|
1978
|
+
unit: M.AspectRatio,
|
|
1923
1979
|
width: e.value.ratioWidth,
|
|
1924
1980
|
x: 0,
|
|
1925
1981
|
y: 0
|
|
1926
1982
|
},
|
|
1927
|
-
[
|
|
1983
|
+
[M.Pixel]: {
|
|
1928
1984
|
height: 1,
|
|
1929
1985
|
percentageHeight: 100,
|
|
1930
1986
|
percentageWidth: 100,
|
|
1931
|
-
unit:
|
|
1987
|
+
unit: M.Pixel,
|
|
1932
1988
|
width: 1,
|
|
1933
1989
|
x: 0,
|
|
1934
1990
|
y: 0
|
|
1935
1991
|
}
|
|
1936
1992
|
};
|
|
1937
1993
|
if (e?.value.width && e?.value.height) {
|
|
1938
|
-
let { height: t, width: n, x: r = 0, y: i = 0 } = e.value, a =
|
|
1994
|
+
let { height: t, width: n, x: r = 0, y: i = 0 } = e.value, a = ie(n, t);
|
|
1939
1995
|
return {
|
|
1940
|
-
[
|
|
1996
|
+
[M.AspectRatio]: {
|
|
1941
1997
|
height: a.height,
|
|
1942
1998
|
percentageHeight: 100,
|
|
1943
1999
|
percentageWidth: 100,
|
|
1944
|
-
unit:
|
|
2000
|
+
unit: M.AspectRatio,
|
|
1945
2001
|
width: a.width,
|
|
1946
2002
|
x: 0,
|
|
1947
2003
|
y: 0
|
|
1948
2004
|
},
|
|
1949
|
-
[
|
|
2005
|
+
[M.Pixel]: {
|
|
1950
2006
|
height: t,
|
|
1951
2007
|
percentageHeight: 100,
|
|
1952
2008
|
percentageWidth: 100,
|
|
1953
|
-
unit:
|
|
2009
|
+
unit: M.Pixel,
|
|
1954
2010
|
width: n,
|
|
1955
2011
|
x: r,
|
|
1956
2012
|
y: i
|
|
@@ -1958,25 +2014,25 @@ var Wt = X, Z, Gt = {
|
|
|
1958
2014
|
};
|
|
1959
2015
|
}
|
|
1960
2016
|
}
|
|
1961
|
-
let e = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2017
|
+
let e = this.lastImageSize.width && this.lastImageSize.height ? ie(this.lastImageSize.width, this.lastImageSize.height) : {
|
|
1962
2018
|
height: 1,
|
|
1963
2019
|
width: 1
|
|
1964
2020
|
};
|
|
1965
2021
|
return {
|
|
1966
|
-
[
|
|
2022
|
+
[M.AspectRatio]: {
|
|
1967
2023
|
height: e.height,
|
|
1968
2024
|
percentageHeight: 100,
|
|
1969
2025
|
percentageWidth: 100,
|
|
1970
|
-
unit:
|
|
2026
|
+
unit: M.AspectRatio,
|
|
1971
2027
|
width: e.width,
|
|
1972
2028
|
x: 0,
|
|
1973
2029
|
y: 0
|
|
1974
2030
|
},
|
|
1975
|
-
[
|
|
2031
|
+
[M.Pixel]: {
|
|
1976
2032
|
height: this.lastImageSize.height,
|
|
1977
2033
|
percentageHeight: 100,
|
|
1978
2034
|
percentageWidth: 100,
|
|
1979
|
-
unit:
|
|
2035
|
+
unit: M.Pixel,
|
|
1980
2036
|
width: this.lastImageSize.width,
|
|
1981
2037
|
x: 0,
|
|
1982
2038
|
y: 0
|
|
@@ -1985,57 +2041,57 @@ var Wt = X, Z, Gt = {
|
|
|
1985
2041
|
}
|
|
1986
2042
|
get lastResizeSize() {
|
|
1987
2043
|
if (!this.asset) {
|
|
1988
|
-
let e = this.transformations.findLast((e) => e.key ===
|
|
1989
|
-
if (e?.value.unit ===
|
|
1990
|
-
[
|
|
2044
|
+
let e = this.transformations.findLast((e) => e.key === D.Resize);
|
|
2045
|
+
if (e?.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) return {
|
|
2046
|
+
[M.AspectRatio]: {
|
|
1991
2047
|
height: e.value.ratioHeight,
|
|
1992
|
-
unit:
|
|
2048
|
+
unit: M.AspectRatio,
|
|
1993
2049
|
width: e.value.ratioWidth
|
|
1994
2050
|
},
|
|
1995
|
-
[
|
|
2051
|
+
[M.Pixel]: {
|
|
1996
2052
|
height: 1,
|
|
1997
|
-
unit:
|
|
2053
|
+
unit: M.Pixel,
|
|
1998
2054
|
width: 1
|
|
1999
2055
|
}
|
|
2000
2056
|
};
|
|
2001
2057
|
if (e?.value.width && e?.value.height) {
|
|
2002
|
-
let { height: t, width: n } = e.value, r =
|
|
2058
|
+
let { height: t, width: n } = e.value, r = ie(n, t);
|
|
2003
2059
|
return {
|
|
2004
|
-
[
|
|
2060
|
+
[M.AspectRatio]: {
|
|
2005
2061
|
height: r.height,
|
|
2006
|
-
unit:
|
|
2062
|
+
unit: M.AspectRatio,
|
|
2007
2063
|
width: r.width
|
|
2008
2064
|
},
|
|
2009
|
-
[
|
|
2065
|
+
[M.Pixel]: {
|
|
2010
2066
|
height: t,
|
|
2011
|
-
unit:
|
|
2067
|
+
unit: M.Pixel,
|
|
2012
2068
|
width: n
|
|
2013
2069
|
}
|
|
2014
2070
|
};
|
|
2015
2071
|
}
|
|
2016
2072
|
}
|
|
2017
|
-
let e = this.lastImageSize.width && this.lastImageSize.height ?
|
|
2073
|
+
let e = this.lastImageSize.width && this.lastImageSize.height ? ie(this.lastImageSize.width, this.lastImageSize.height) : {
|
|
2018
2074
|
height: 1,
|
|
2019
2075
|
width: 1
|
|
2020
2076
|
};
|
|
2021
2077
|
return {
|
|
2022
|
-
[
|
|
2078
|
+
[M.AspectRatio]: {
|
|
2023
2079
|
height: e.height,
|
|
2024
|
-
unit:
|
|
2080
|
+
unit: M.AspectRatio,
|
|
2025
2081
|
width: e.width
|
|
2026
2082
|
},
|
|
2027
|
-
[
|
|
2083
|
+
[M.Pixel]: {
|
|
2028
2084
|
height: this.lastImageSize.height,
|
|
2029
|
-
unit:
|
|
2085
|
+
unit: M.Pixel,
|
|
2030
2086
|
width: this.lastImageSize.width
|
|
2031
2087
|
}
|
|
2032
2088
|
};
|
|
2033
2089
|
}
|
|
2034
2090
|
get lastRotation() {
|
|
2035
|
-
return this.asset ? 0 : this.transformations.findLast((e) => e.key ===
|
|
2091
|
+
return this.asset ? 0 : this.transformations.findLast((e) => e.key === D.Rotate)?.value.rotation ?? 0;
|
|
2036
2092
|
}
|
|
2037
2093
|
get transformationString() {
|
|
2038
|
-
return
|
|
2094
|
+
return ge({
|
|
2039
2095
|
asset: this.asset,
|
|
2040
2096
|
baseUrl: "",
|
|
2041
2097
|
parameters: this.parameters,
|
|
@@ -2044,7 +2100,7 @@ var Wt = X, Z, Gt = {
|
|
|
2044
2100
|
}).replace(/\/t\//g, "");
|
|
2045
2101
|
}
|
|
2046
2102
|
constructor() {
|
|
2047
|
-
super(), this.localize = new d(this), this.initialParts = [...Q], this.sortableRevision = 0, this.dragPreviousSibling = null, this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
2103
|
+
super(), this.localize = new d(this), this.initialParts = [...Q], this.sortableRevision = 0, this.dragPreviousSibling = null, this.#r = void 0, this.#i = !1, this.#a = [], this.#o = [], this.baseUrl = void 0, this.token = void 0, this.asset = void 0, this.cropModes = [
|
|
2048
2104
|
{
|
|
2049
2105
|
label: "Free",
|
|
2050
2106
|
value: "free"
|
|
@@ -2103,7 +2159,7 @@ var Wt = X, Z, Gt = {
|
|
|
2103
2159
|
label: "Smart Swatch",
|
|
2104
2160
|
value: "SmartSwatch"
|
|
2105
2161
|
}
|
|
2106
|
-
], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.parts = this.initialParts, this.layout =
|
|
2162
|
+
], this.extensions = [], this.proxies = void 0, this.forCropper = void 0, this.useSession = "", this.transformations = [], this.selectedProxy = "", this.defaultProxy = "", this.canAutoFormat = !1, this.autoFormat = !1, this.useCustomExtension = !1, this.parts = this.initialParts, this.layout = xe.Accordion, this.cropEnabled = !1, this.reorderable = !1, this.dimensionsItems = [], this.qualityItems = [], this.canCustomDimensions = !1, this.canPercentDimensions = !1, this.percentDimensions = "", this.lastImageSize = {
|
|
2107
2163
|
height: 0,
|
|
2108
2164
|
width: 0
|
|
2109
2165
|
}, this.hideHeader = !1, this.canReset = !1, this.queryElement = null, this.activeSetting = "cx-asset-link-format-proxy", this.selectedFormat = void 0, this.resizeSize = {
|
|
@@ -2111,7 +2167,7 @@ var Wt = X, Z, Gt = {
|
|
|
2111
2167
|
keepAspectRatio: !0,
|
|
2112
2168
|
ratioHeight: 1,
|
|
2113
2169
|
ratioWidth: 1,
|
|
2114
|
-
unit:
|
|
2170
|
+
unit: M.Pixel,
|
|
2115
2171
|
width: 1
|
|
2116
2172
|
}, this.cropSize = {
|
|
2117
2173
|
cropMode: "free",
|
|
@@ -2123,14 +2179,14 @@ var Wt = X, Z, Gt = {
|
|
|
2123
2179
|
position: v.CenterCenter,
|
|
2124
2180
|
ratioHeight: 1,
|
|
2125
2181
|
ratioWidth: 1,
|
|
2126
|
-
unit:
|
|
2182
|
+
unit: M.Pixel,
|
|
2127
2183
|
width: 1,
|
|
2128
2184
|
x: 0,
|
|
2129
2185
|
y: 0
|
|
2130
2186
|
}, this.rotation = 0, this.defaultSize = {
|
|
2131
2187
|
height: 0,
|
|
2132
2188
|
width: 0
|
|
2133
|
-
}, 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.reorderAnnouncement = "", this.orderUndo = [], this.apiGetTransformAssetLink =
|
|
2189
|
+
}, 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.reorderAnnouncement = "", this.orderUndo = [], this.apiGetTransformAssetLink = pt, this.apiGetCropFocusMode = vt, this.onCropComplete = this.onCropComplete.bind(this), this.onCropDragStart = this.onCropDragStart.bind(this);
|
|
2134
2190
|
}
|
|
2135
2191
|
runConnectedCallback() {
|
|
2136
2192
|
this.hasUpdated && (this.syncSortable(), this.handleCropperSelectorChange(), this.cropperElement && (this.cropperElement.addEventListener("cx-cropper-crop-complete", this.onCropComplete), this.cropperElement.addEventListener("cx-cropper-crop-drag-start", this.onCropDragStart)));
|
|
@@ -2139,7 +2195,9 @@ var Wt = X, Z, Gt = {
|
|
|
2139
2195
|
super.disconnectedCallback(), this.sortableRevision++, this.destroySortable(), this.cropperElement && (this.cropperElement.removeEventListener("cx-cropper-crop-complete", this.onCropComplete), this.cropperElement.removeEventListener("cx-cropper-crop-drag-start", this.onCropDragStart));
|
|
2140
2196
|
}
|
|
2141
2197
|
willUpdate(e) {
|
|
2142
|
-
super.willUpdate(e), e.has("dimensionsItems") && this.syncSelectedDimensions(!1);
|
|
2198
|
+
super.willUpdate(e), this.parts ??= this.initialParts, e.has("dimensionsItems") && this.syncSelectedDimensions(!1);
|
|
2199
|
+
let t = this.#c, n = t !== this.#i;
|
|
2200
|
+
this.#i = t, (e.has("percentDimensions") || n) && this.#m(), this.#p(e);
|
|
2143
2201
|
}
|
|
2144
2202
|
updated(e) {
|
|
2145
2203
|
if ((e.has("forCropper") || e.has("queryElement")) && this.handleCropperSelectorChange(), e.has("asset") && this.handleAssetChange(), e.has("proxies") && this.handleProxiesChange(), this.autoFormat && (e.has("asset") || e.has("proxies"))) {
|
|
@@ -2149,7 +2207,7 @@ var Wt = X, Z, Gt = {
|
|
|
2149
2207
|
if (e.has("activeSetting") && this.handleActiveSettingChange(), e.has("selectedFormat") && this.handleSelectedFormatChange(), e.has("resizeSize") && this.handleResizeSizeChange(), e.has("cropSize") && this.handleCropSizeChange(), e.has("rotation") && this.handleRotationChange(), e.has("cropperElement") && this.handleCropperElementChange(), e.has("selectedFormat")) {
|
|
2150
2208
|
if (!this.asset || !this.selectedFormat || this.selectedFormat.extension === e.get("selectedFormat")?.extension) return;
|
|
2151
2209
|
this.loading = !0, this.requestTransformAsset().then((e) => {
|
|
2152
|
-
this.loading = !1, e?.relativePath && this.selectedFormat && (this.lastAction ===
|
|
2210
|
+
this.loading = !1, e?.relativePath && this.selectedFormat && (this.lastAction === D.Rotate && (this.rotation = 0), this.lastAction = void 0, this.lastImageSize = {
|
|
2153
2211
|
height: e.height,
|
|
2154
2212
|
width: e.width
|
|
2155
2213
|
}, this.selectedFormat = {
|
|
@@ -2159,7 +2217,7 @@ var Wt = X, Z, Gt = {
|
|
|
2159
2217
|
width: e.width
|
|
2160
2218
|
});
|
|
2161
2219
|
});
|
|
2162
|
-
let t =
|
|
2220
|
+
let t = ge({
|
|
2163
2221
|
asset: this.asset,
|
|
2164
2222
|
baseUrl: "",
|
|
2165
2223
|
extension: this.selectedFormat.extension,
|
|
@@ -2213,7 +2271,7 @@ var Wt = X, Z, Gt = {
|
|
|
2213
2271
|
this.frozenIndex = this.transformations.length - 1;
|
|
2214
2272
|
}
|
|
2215
2273
|
upsertTransformation(e) {
|
|
2216
|
-
e.key ===
|
|
2274
|
+
e.key === D.Crop && (this.editedCrop = e), this.asset || (this.transformations = Z.uniqueTransformations(this.transformations));
|
|
2217
2275
|
let t = this.transformations.findIndex((t) => t.key === e.key);
|
|
2218
2276
|
if (t >= 0) {
|
|
2219
2277
|
let n = [...this.transformations];
|
|
@@ -2222,11 +2280,11 @@ var Wt = X, Z, Gt = {
|
|
|
2222
2280
|
this.canReorder && (this.transformations = Z.orderTransformations(this.transformations, this.activeParts));
|
|
2223
2281
|
}
|
|
2224
2282
|
isCropPanelSize(e) {
|
|
2225
|
-
let { height: t, ratioHeight: n, ratioWidth: r, unit: i =
|
|
2226
|
-
return i === this.cropSize.unit ? i ===
|
|
2283
|
+
let { height: t, ratioHeight: n, ratioWidth: r, unit: i = M.Pixel, width: a } = e.value;
|
|
2284
|
+
return i === this.cropSize.unit ? i === M.AspectRatio ? r === this.cropSize.ratioWidth && n === this.cropSize.ratioHeight : a === this.cropSize.width && t === this.cropSize.height : !1;
|
|
2227
2285
|
}
|
|
2228
|
-
#
|
|
2229
|
-
let { height: t = 0, ratioHeight: n = 0, ratioWidth: r = 0, unit: i =
|
|
2286
|
+
#l(e) {
|
|
2287
|
+
let { height: t = 0, ratioHeight: n = 0, ratioWidth: r = 0, unit: i = M.Pixel, width: a = 0 } = e.value, o = i === M.AspectRatio, s = o ? r : a, c = o ? n : t;
|
|
2230
2288
|
if (!s || !c) return;
|
|
2231
2289
|
let l = this.cropModes.filter((e) => !e.auto && /^\d+:\d+$/.test(e.value)).map(({ value: e }) => {
|
|
2232
2290
|
let [t, n] = e.split(":").map(Number);
|
|
@@ -2239,8 +2297,8 @@ var Wt = X, Z, Gt = {
|
|
|
2239
2297
|
return u || o ? u?.value : l.find(({ modeHeight: e, modeWidth: t }) => Math.abs(t * c - e * s) <= Math.max(t, e) / 2)?.value;
|
|
2240
2298
|
}
|
|
2241
2299
|
capCropToMaxSize() {
|
|
2242
|
-
let e = this.transformations.find((e) => e.key ===
|
|
2243
|
-
if (this.asset || !e || (e.value.unit ??
|
|
2300
|
+
let e = this.transformations.find((e) => e.key === D.Crop);
|
|
2301
|
+
if (this.asset || !e || (e.value.unit ?? M.Pixel) !== M.Pixel) return;
|
|
2244
2302
|
let { height: t = 0, width: n = 0 } = e.value, r = this.cropMaxSize;
|
|
2245
2303
|
if (n <= r.width && t <= r.height) return;
|
|
2246
2304
|
let i = Math.min(t, r.height), a = Math.min(n, r.width), o = this.isCropPanelSize(e) && n * i === t * a;
|
|
@@ -2265,16 +2323,16 @@ var Wt = X, Z, Gt = {
|
|
|
2265
2323
|
(t.length !== this.transformations.length || t.some((e, t) => e !== this.transformations[t])) && (this.transformations = t), n || this.capCropToMaxSize();
|
|
2266
2324
|
}
|
|
2267
2325
|
if (this.syncSelectedDimensions(), await this.updateComplete, !this.asset) {
|
|
2268
|
-
if (this.emit("cx-asset-link-format-change", { detail:
|
|
2326
|
+
if (this.emit("cx-asset-link-format-change", { detail: ge({
|
|
2269
2327
|
asset: this.asset,
|
|
2270
2328
|
baseUrl: "",
|
|
2271
2329
|
options: { omitZeroXY: !0 },
|
|
2272
2330
|
parameters: this.parameters,
|
|
2273
2331
|
transformations: this.transformations,
|
|
2274
2332
|
useSession: this.useSession
|
|
2275
|
-
}).replace(/\/t\//g, "") }), n) return;
|
|
2276
|
-
let e = this.transformations.findLast((e) => e.key ===
|
|
2277
|
-
if (e?.value.unit ===
|
|
2333
|
+
}).replace(/\/t\//g, "") + this.#s }), n) return;
|
|
2334
|
+
let e = this.transformations.findLast((e) => e.key === D.Crop && (e.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight || e.value.width && e.value.height)), t = e !== void 0 && e === this.editedCrop && this.isCropPanelSize(e), r = e && !t ? this.#l(e) : void 0, i = t ? this.cropSize.cropMode : r ?? "free";
|
|
2335
|
+
if (e?.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight) {
|
|
2278
2336
|
let { focusMode: n, position: r, ratioHeight: a, ratioWidth: o } = e.value;
|
|
2279
2337
|
this.cropSize = {
|
|
2280
2338
|
...this.cropSize,
|
|
@@ -2286,7 +2344,7 @@ var Wt = X, Z, Gt = {
|
|
|
2286
2344
|
position: r ?? v.CenterCenter,
|
|
2287
2345
|
ratioHeight: a,
|
|
2288
2346
|
ratioWidth: o,
|
|
2289
|
-
unit:
|
|
2347
|
+
unit: M.AspectRatio
|
|
2290
2348
|
};
|
|
2291
2349
|
} else if (e) {
|
|
2292
2350
|
let { focusMode: t, height: n, position: a, unit: o, width: s, x: c = 0, y: l = 0 } = e.value;
|
|
@@ -2299,7 +2357,7 @@ var Wt = X, Z, Gt = {
|
|
|
2299
2357
|
percentageHeight: 100,
|
|
2300
2358
|
percentageWidth: 100,
|
|
2301
2359
|
position: a ?? v.CenterCenter,
|
|
2302
|
-
unit: o ??
|
|
2360
|
+
unit: o ?? M.Pixel,
|
|
2303
2361
|
width: s,
|
|
2304
2362
|
x: c,
|
|
2305
2363
|
y: l
|
|
@@ -2312,37 +2370,37 @@ var Wt = X, Z, Gt = {
|
|
|
2312
2370
|
percentageHeight: 0,
|
|
2313
2371
|
percentageWidth: 0,
|
|
2314
2372
|
position: v.CenterCenter,
|
|
2315
|
-
unit:
|
|
2373
|
+
unit: M.Pixel,
|
|
2316
2374
|
width: 1,
|
|
2317
2375
|
x: 0,
|
|
2318
2376
|
y: 0
|
|
2319
2377
|
};
|
|
2320
|
-
let a = this.transformations.findLast((e) => e.key ===
|
|
2321
|
-
if (a?.value.unit ===
|
|
2378
|
+
let a = this.transformations.findLast((e) => e.key === D.Resize && (e.value.unit === M.AspectRatio && e.value.ratioWidth && e.value.ratioHeight || e.value.width || e.value.height));
|
|
2379
|
+
if (a?.value.unit === M.AspectRatio && a.value.ratioWidth && a.value.ratioHeight) {
|
|
2322
2380
|
let { ratioHeight: e, ratioWidth: t } = a.value;
|
|
2323
2381
|
this.resizeSize = {
|
|
2324
2382
|
...this.resizeSize,
|
|
2325
2383
|
ratioHeight: e,
|
|
2326
2384
|
ratioWidth: t,
|
|
2327
|
-
unit:
|
|
2385
|
+
unit: M.AspectRatio
|
|
2328
2386
|
};
|
|
2329
2387
|
} else if (a) {
|
|
2330
2388
|
let { height: e = 0, unit: t, width: n = 0 } = a.value;
|
|
2331
2389
|
this.resizeSize = {
|
|
2332
2390
|
...this.resizeSize,
|
|
2333
2391
|
height: e,
|
|
2334
|
-
unit: t ??
|
|
2392
|
+
unit: t ?? M.Pixel,
|
|
2335
2393
|
width: n
|
|
2336
2394
|
};
|
|
2337
2395
|
} else this.resizeSize = {
|
|
2338
2396
|
...this.resizeSize,
|
|
2339
2397
|
height: 1,
|
|
2340
|
-
unit:
|
|
2398
|
+
unit: M.Pixel,
|
|
2341
2399
|
width: 1
|
|
2342
2400
|
};
|
|
2343
|
-
let o = this.transformations.findLast((e) => e.key ===
|
|
2401
|
+
let o = this.transformations.findLast((e) => e.key === D.Rotate);
|
|
2344
2402
|
this.rotation = o?.value.rotation ?? 0;
|
|
2345
|
-
let s = this.transformations.findLast((e) => e.key ===
|
|
2403
|
+
let s = this.transformations.findLast((e) => e.key === D.Quality)?.value.quality ?? 100, c = this.transformations.some((e) => e.key === D.Metadata);
|
|
2346
2404
|
this.selectedFormat = this.selectedFormat ? {
|
|
2347
2405
|
...this.selectedFormat,
|
|
2348
2406
|
keepMetadata: c,
|
|
@@ -2372,7 +2430,7 @@ var Wt = X, Z, Gt = {
|
|
|
2372
2430
|
keepAspectRatio: !0,
|
|
2373
2431
|
ratioHeight: 1,
|
|
2374
2432
|
ratioWidth: 1,
|
|
2375
|
-
unit:
|
|
2433
|
+
unit: M.Pixel,
|
|
2376
2434
|
width: r.width
|
|
2377
2435
|
}, this.cropSize = {
|
|
2378
2436
|
cropMode: "free",
|
|
@@ -2384,12 +2442,12 @@ var Wt = X, Z, Gt = {
|
|
|
2384
2442
|
position: v.CenterCenter,
|
|
2385
2443
|
ratioHeight: 1,
|
|
2386
2444
|
ratioWidth: 1,
|
|
2387
|
-
unit:
|
|
2445
|
+
unit: M.Pixel,
|
|
2388
2446
|
width: r.width,
|
|
2389
2447
|
x: 0,
|
|
2390
2448
|
y: 0
|
|
2391
|
-
}, this.lastAction ===
|
|
2392
|
-
let i = this.transformations.some((e) => e.key ===
|
|
2449
|
+
}, this.lastAction === D.Rotate && (this.rotation = 0), this.lastAction = void 0;
|
|
2450
|
+
let i = this.transformations.some((e) => e.key === D.Metadata), a = this.transformations.findLast((e) => e.key === D.Quality);
|
|
2393
2451
|
this.selectedFormat = {
|
|
2394
2452
|
...this.selectedFormat,
|
|
2395
2453
|
height: r.height,
|
|
@@ -2398,7 +2456,7 @@ var Wt = X, Z, Gt = {
|
|
|
2398
2456
|
url: this.baseUrl && this.baseUrl.length > 0 ? `${this.baseUrl}/${r.relativePath}` : r.relativePath,
|
|
2399
2457
|
width: r.width
|
|
2400
2458
|
};
|
|
2401
|
-
let o =
|
|
2459
|
+
let o = ge({
|
|
2402
2460
|
asset: this.asset,
|
|
2403
2461
|
baseUrl: "",
|
|
2404
2462
|
extension: this.selectedFormat.extension,
|
|
@@ -2420,7 +2478,7 @@ var Wt = X, Z, Gt = {
|
|
|
2420
2478
|
height: Number.parseInt(this.asset.height, 10),
|
|
2421
2479
|
width: Number.parseInt(this.asset.width, 10)
|
|
2422
2480
|
});
|
|
2423
|
-
let e = this.transformations.findLast((e) => e.key ===
|
|
2481
|
+
let e = this.transformations.findLast((e) => e.key === D.Quality);
|
|
2424
2482
|
this.selectedFormat = {
|
|
2425
2483
|
extension: this.asset.extension,
|
|
2426
2484
|
height: this.defaultSize.height,
|
|
@@ -2445,7 +2503,7 @@ var Wt = X, Z, Gt = {
|
|
|
2445
2503
|
position: v.CenterCenter,
|
|
2446
2504
|
ratioHeight: 1,
|
|
2447
2505
|
ratioWidth: 1,
|
|
2448
|
-
unit:
|
|
2506
|
+
unit: M.Pixel,
|
|
2449
2507
|
width: this.defaultSize.width,
|
|
2450
2508
|
x: 0,
|
|
2451
2509
|
y: 0
|
|
@@ -2464,7 +2522,7 @@ var Wt = X, Z, Gt = {
|
|
|
2464
2522
|
t.proxyName === "TRX" && (t.formatHeight = Number(this.asset.height), t.formatWidth = Number(this.asset.width));
|
|
2465
2523
|
let n = this.proxies?.find((t) => t.id === e);
|
|
2466
2524
|
n && (this.asset && n.proxyName === "TRX" && (n.formatHeight = Number(this.asset.height), n.formatWidth = Number(this.asset.width)), this.transformations = this.transformations.map((e) => {
|
|
2467
|
-
if (e.key ===
|
|
2525
|
+
if (e.key === D.Crop) {
|
|
2468
2526
|
let r = e.value, i = r.width / n.formatWidth * t.formatWidth, a = r.height / n.formatHeight * t.formatHeight, o = r.x / n.formatWidth * t.formatWidth, s = r.y / n.formatHeight * t.formatHeight;
|
|
2469
2527
|
return {
|
|
2470
2528
|
...e,
|
|
@@ -2477,7 +2535,7 @@ var Wt = X, Z, Gt = {
|
|
|
2477
2535
|
}
|
|
2478
2536
|
};
|
|
2479
2537
|
}
|
|
2480
|
-
if (e.key ===
|
|
2538
|
+
if (e.key === D.Resize) {
|
|
2481
2539
|
let r = e.value, i = r.width / n.formatWidth * t.formatWidth, a = r.height / n.formatHeight * t.formatHeight;
|
|
2482
2540
|
return {
|
|
2483
2541
|
...e,
|
|
@@ -2498,24 +2556,24 @@ var Wt = X, Z, Gt = {
|
|
|
2498
2556
|
}, await this.updateComplete, this.cropSize = {
|
|
2499
2557
|
cropMode: "free",
|
|
2500
2558
|
focusMode: "manual",
|
|
2501
|
-
height: this.lastCropSize[
|
|
2559
|
+
height: this.lastCropSize[M.Pixel].height,
|
|
2502
2560
|
keepAspectRatio: !0,
|
|
2503
2561
|
percentageHeight: 100,
|
|
2504
2562
|
percentageWidth: 100,
|
|
2505
2563
|
position: v.CenterCenter,
|
|
2506
2564
|
ratioHeight: 1,
|
|
2507
2565
|
ratioWidth: 1,
|
|
2508
|
-
unit:
|
|
2509
|
-
width: this.lastCropSize[
|
|
2566
|
+
unit: M.Pixel,
|
|
2567
|
+
width: this.lastCropSize[M.Pixel].width,
|
|
2510
2568
|
x: 0,
|
|
2511
2569
|
y: 0
|
|
2512
2570
|
}, this.resizeSize = {
|
|
2513
|
-
height: this.lastResizeSize[
|
|
2571
|
+
height: this.lastResizeSize[M.Pixel].height,
|
|
2514
2572
|
keepAspectRatio: !0,
|
|
2515
2573
|
ratioHeight: 1,
|
|
2516
2574
|
ratioWidth: 1,
|
|
2517
|
-
unit:
|
|
2518
|
-
width: this.lastResizeSize[
|
|
2575
|
+
unit: M.Pixel,
|
|
2576
|
+
width: this.lastResizeSize[M.Pixel].width
|
|
2519
2577
|
};
|
|
2520
2578
|
}
|
|
2521
2579
|
handleLoadingChange() {
|
|
@@ -2535,7 +2593,7 @@ var Wt = X, Z, Gt = {
|
|
|
2535
2593
|
}
|
|
2536
2594
|
handlePartsChange() {
|
|
2537
2595
|
if (this.activeParts.some((e) => {
|
|
2538
|
-
let t = e ===
|
|
2596
|
+
let t = e === k.Rotate ? "rotation" : e;
|
|
2539
2597
|
return this.activeSetting === `cx-asset-link-format-${t}`;
|
|
2540
2598
|
}) || (this.activeSetting = ""), this.canReorder) {
|
|
2541
2599
|
let e = Z.orderTransformations(Z.uniqueTransformations(this.transformations), this.activeParts);
|
|
@@ -2544,8 +2602,8 @@ var Wt = X, Z, Gt = {
|
|
|
2544
2602
|
}
|
|
2545
2603
|
handleReorderableChange() {
|
|
2546
2604
|
if (this.orderUndo = [], this.canReorder && this.parts === this.initialParts && this.transformations.length > 0) {
|
|
2547
|
-
let e = Z.uniqueTransformations(this.transformations).flatMap((e) => Q.filter((t) =>
|
|
2548
|
-
this.parts = Q.map((e) =>
|
|
2605
|
+
let e = Z.uniqueTransformations(this.transformations).flatMap((e) => Q.filter((t) => Qt[t] === e.key)), t = [...e, ...Q.filter((t) => Qt[t] && !e.includes(t))], n = 0;
|
|
2606
|
+
this.parts = Q.map((e) => Qt[e] ? t[n++] : e);
|
|
2549
2607
|
}
|
|
2550
2608
|
this.handlePartsChange(), this.syncSortable();
|
|
2551
2609
|
}
|
|
@@ -2583,6 +2641,7 @@ var Wt = X, Z, Gt = {
|
|
|
2583
2641
|
this.orderUndo = [...this.orderUndo, {
|
|
2584
2642
|
autoFormat: this.autoFormat,
|
|
2585
2643
|
parts: [...this.activeParts],
|
|
2644
|
+
percentDimensions: Z.getPercentDimensions(this.selectedDimensions),
|
|
2586
2645
|
selectedProxy: this.selectedProxy,
|
|
2587
2646
|
transformations: this.transformations.map((e) => ({
|
|
2588
2647
|
...e,
|
|
@@ -2601,11 +2660,11 @@ var Wt = X, Z, Gt = {
|
|
|
2601
2660
|
}
|
|
2602
2661
|
movePart(e, t) {
|
|
2603
2662
|
if (!this.canReorder || this.loading) return;
|
|
2604
|
-
let n = this.activeParts.filter((e) =>
|
|
2663
|
+
let n = this.activeParts.filter((e) => en.includes(e)), r = n.indexOf(e);
|
|
2605
2664
|
if (r < 0 || t < 0 || t >= n.length || r === t) return;
|
|
2606
2665
|
this.rememberOrder(), n.splice(r, 1), n.splice(t, 0, e);
|
|
2607
2666
|
let i = 0;
|
|
2608
|
-
this.parts = this.activeParts.map((e) =>
|
|
2667
|
+
this.parts = this.activeParts.map((e) => en.includes(e) ? n[i++] : e);
|
|
2609
2668
|
let a = Z.orderTransformations(this.transformations, this.parts);
|
|
2610
2669
|
a.some((e, t) => e !== this.transformations[t]) && (this.transformations = a), this.capCropToMaxSize(), this.reorderAnnouncement = `${this.localize.term(e)}: ${t + 1} / ${n.length}`, this.emitReorder(), this.updateComplete.then(() => {
|
|
2611
2670
|
this.shadowRoot?.querySelector(`[data-part="${e}"] .asset-link-format__drag-handle`)?.focus();
|
|
@@ -2614,22 +2673,22 @@ var Wt = X, Z, Gt = {
|
|
|
2614
2673
|
handleReorderKeyDown(e) {
|
|
2615
2674
|
if (e.key !== "ArrowUp" && e.key !== "ArrowDown") return;
|
|
2616
2675
|
e.preventDefault(), e.stopPropagation();
|
|
2617
|
-
let t = e.currentTarget.closest("[data-part]")?.dataset.part, n = this.activeParts.filter((e) =>
|
|
2676
|
+
let t = e.currentTarget.closest("[data-part]")?.dataset.part, n = this.activeParts.filter((e) => en.includes(e));
|
|
2618
2677
|
this.movePart(t, n.indexOf(t) + (e.key === "ArrowUp" ? -1 : 1));
|
|
2619
2678
|
}
|
|
2620
2679
|
handleActiveSettingChange() {
|
|
2621
2680
|
this.cropperElement && (this.resizeSize = {
|
|
2622
|
-
height: this.lastResizeSize[
|
|
2681
|
+
height: this.lastResizeSize[M.Pixel].height,
|
|
2623
2682
|
keepAspectRatio: !0,
|
|
2624
2683
|
ratioHeight: 1,
|
|
2625
2684
|
ratioWidth: 1,
|
|
2626
|
-
unit:
|
|
2627
|
-
width: this.lastResizeSize[
|
|
2685
|
+
unit: M.Pixel,
|
|
2686
|
+
width: this.lastResizeSize[M.Pixel].width
|
|
2628
2687
|
}, this.cropperElement.disabled = this.activeSetting !== "cx-asset-link-format-crop");
|
|
2629
2688
|
}
|
|
2630
2689
|
async handleRequestAutoCropSuggestion({ cropMode: e, focusMode: t, height: n, keepAspectRatio: r, percentageHeight: i, percentageWidth: a, ratioHeight: o, ratioWidth: s, unit: c, useCropMode: l, width: u }) {
|
|
2631
2690
|
if (!this.selectedFormat?.url || t === "manual") return;
|
|
2632
|
-
this.loading = !0, this.lastAction =
|
|
2691
|
+
this.loading = !0, this.lastAction = D.Crop;
|
|
2633
2692
|
let d = await this.apiGetCropFocusMode({
|
|
2634
2693
|
autoCropMode: t,
|
|
2635
2694
|
cropHeight: n,
|
|
@@ -2667,7 +2726,7 @@ var Wt = X, Z, Gt = {
|
|
|
2667
2726
|
if (r === 0 || n === 0) return;
|
|
2668
2727
|
let o = this.cropSize.percentageWidth !== r, s = this.cropSize.percentageHeight !== n, c = this.cropSize.height, l = this.cropSize.width;
|
|
2669
2728
|
o && (l = Math.round(r * this.selectedFormat.width / 100)), s && (c = Math.round(n * this.selectedFormat.height / 100));
|
|
2670
|
-
let u = this.cropSize.focusMode, d = this.focusModes.find((e) => e.value === u)?.auto, f = l !== this.cropSize.width || c !== this.cropSize.height, p = f ? this.#
|
|
2729
|
+
let u = this.cropSize.focusMode, d = this.focusModes.find((e) => e.value === u)?.auto, f = l !== this.cropSize.width || c !== this.cropSize.height, p = f ? this.#u(l, c) : {};
|
|
2671
2730
|
d && this.selectedFormat?.url && this.cropperElement ? await this.handleRequestAutoCropSuggestion({
|
|
2672
2731
|
...p,
|
|
2673
2732
|
focusMode: u,
|
|
@@ -2684,13 +2743,13 @@ var Wt = X, Z, Gt = {
|
|
|
2684
2743
|
width: l,
|
|
2685
2744
|
x: i,
|
|
2686
2745
|
y: a
|
|
2687
|
-
}, f && this.#
|
|
2746
|
+
}, f && this.#f();
|
|
2688
2747
|
}
|
|
2689
|
-
#
|
|
2748
|
+
#u(e, t) {
|
|
2690
2749
|
let { keepAspectRatio: n, unit: r } = this.cropSize, i = {};
|
|
2691
|
-
return n ? i : (this.#
|
|
2750
|
+
return n ? i : (this.#d(e, t) && (i.cropMode = "free"), r === M.AspectRatio && (i.ratioHeight = t, i.ratioWidth = e), i);
|
|
2692
2751
|
}
|
|
2693
|
-
#
|
|
2752
|
+
#d(e, t) {
|
|
2694
2753
|
let n = /^(\d+):(\d+)$/.exec(this.cropSize.cropMode);
|
|
2695
2754
|
return n !== null && Number(n[1]) * t !== Number(n[2]) * e;
|
|
2696
2755
|
}
|
|
@@ -2710,12 +2769,12 @@ var Wt = X, Z, Gt = {
|
|
|
2710
2769
|
this.activeSetting === e.target.localName && (this.activeSetting = "");
|
|
2711
2770
|
}
|
|
2712
2771
|
get autoResolvedProxyId() {
|
|
2713
|
-
let e =
|
|
2772
|
+
let e = me(this.asset?.extension, this.asset?.size);
|
|
2714
2773
|
return this.proxies?.find((t) => t.proxyName === e)?.id ?? "";
|
|
2715
2774
|
}
|
|
2716
2775
|
onProxyChange(e) {
|
|
2717
2776
|
let t = e.detail;
|
|
2718
|
-
if (this.lastAction =
|
|
2777
|
+
if (this.lastAction = D.Proxy, t.autoFormat) {
|
|
2719
2778
|
this.autoFormat = !0;
|
|
2720
2779
|
let e = this.autoResolvedProxyId;
|
|
2721
2780
|
e && (this.selectedProxy = e);
|
|
@@ -2731,7 +2790,7 @@ var Wt = X, Z, Gt = {
|
|
|
2731
2790
|
});
|
|
2732
2791
|
else {
|
|
2733
2792
|
let e = this.focusModes.find((e) => e.value === this.cropSize.focusMode)?.auto, n = this.cropSize.keepAspectRatio, r = this.cropSize.focusMode, i = this.cropSize.x, a = this.cropSize.y;
|
|
2734
|
-
t === "free" ? (n = !1, this.cropperElement && (r = "manual")) : this.cropSize.unit ===
|
|
2793
|
+
t === "free" ? (n = !1, this.cropperElement && (r = "manual")) : this.cropSize.unit === M.Pixel && !e && (i = 0, a = 0), this.focusModes.find((e) => e.value === r)?.auto && this.selectedFormat?.url ? await this.handleRequestAutoCropSuggestion({
|
|
2735
2794
|
cropMode: t,
|
|
2736
2795
|
focusMode: r,
|
|
2737
2796
|
height: this.cropSize.height,
|
|
@@ -2767,11 +2826,11 @@ var Wt = X, Z, Gt = {
|
|
|
2767
2826
|
}
|
|
2768
2827
|
async onCropChange(e) {
|
|
2769
2828
|
let t = this.cropSize.unit;
|
|
2770
|
-
if (e.detail.unit ===
|
|
2829
|
+
if (e.detail.unit === M.AspectRatio) {
|
|
2771
2830
|
let t = e.detail.width / e.detail.height, n = this.asset ? Math.min(Math.max(Math.round(this.cropSize.height * t), 1), this.resizeSize.width) : 0, r = this.asset ? Math.min(Math.max(Math.round(n / t), 1), this.resizeSize.height) : 0, i = this.asset ? r * 100 / this.selectedFormat.height : 100, a = this.asset ? n * 100 / this.selectedFormat.width : 100, o = this.cropSize.x, s = this.cropSize.y;
|
|
2772
2831
|
o + a > 100 && (o = 100 - a), s + i > 100 && (s = 100 - i);
|
|
2773
|
-
let c = this.cropSize.cropMode, l = this.cropModes.find((e) => e.value === c)?.auto, u = !e.detail.keepAspectRatio && this.#
|
|
2774
|
-
(l || u) && (c = "free"), e.detail.silent ? (this.cropSize.height = r, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = a, this.cropSize.ratioHeight = e.detail.height, this.cropSize.ratioWidth = e.detail.width, this.cropSize.unit =
|
|
2832
|
+
let c = this.cropSize.cropMode, l = this.cropModes.find((e) => e.value === c)?.auto, u = !e.detail.keepAspectRatio && this.#d(e.detail.width, e.detail.height);
|
|
2833
|
+
(l || u) && (c = "free"), e.detail.silent ? (this.cropSize.height = r, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = i, this.cropSize.percentageWidth = a, this.cropSize.ratioHeight = e.detail.height, this.cropSize.ratioWidth = e.detail.width, this.cropSize.unit = M.AspectRatio, this.cropSize.width = n) : this.cropSize = {
|
|
2775
2834
|
...this.cropSize,
|
|
2776
2835
|
cropMode: c,
|
|
2777
2836
|
height: r,
|
|
@@ -2780,7 +2839,7 @@ var Wt = X, Z, Gt = {
|
|
|
2780
2839
|
percentageWidth: a,
|
|
2781
2840
|
ratioHeight: e.detail.height,
|
|
2782
2841
|
ratioWidth: e.detail.width,
|
|
2783
|
-
unit:
|
|
2842
|
+
unit: M.AspectRatio,
|
|
2784
2843
|
width: n,
|
|
2785
2844
|
x: o,
|
|
2786
2845
|
y: s
|
|
@@ -2789,14 +2848,14 @@ var Wt = X, Z, Gt = {
|
|
|
2789
2848
|
let t = this.asset ? e.detail.height * 100 / this.selectedFormat.height : 100, n = this.asset ? e.detail.width * 100 / this.selectedFormat.width : 100, r = this.cropSize.x, i = this.cropSize.y;
|
|
2790
2849
|
r + n > 100 && (r = 100 - n), i + t > 100 && (i = 100 - t);
|
|
2791
2850
|
let a = this.cropSize.cropMode, o = this.cropModes.find((e) => e.value === a)?.auto;
|
|
2792
|
-
(e.detail.breakAspectRatio || o) && (a = "free"), e.detail.silent ? (this.cropSize.cropMode = a, this.cropSize.height = e.detail.height, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = t, this.cropSize.percentageWidth = n, this.cropSize.unit =
|
|
2851
|
+
(e.detail.breakAspectRatio || o) && (a = "free"), e.detail.silent ? (this.cropSize.cropMode = a, this.cropSize.height = e.detail.height, this.cropSize.keepAspectRatio = e.detail.keepAspectRatio, this.cropSize.percentageHeight = t, this.cropSize.percentageWidth = n, this.cropSize.unit = M.Pixel, this.cropSize.width = e.detail.width, this.cropSize.x = r, this.cropSize.y = i) : this.cropSize = {
|
|
2793
2852
|
...this.cropSize,
|
|
2794
2853
|
cropMode: a,
|
|
2795
2854
|
height: e.detail.height,
|
|
2796
2855
|
keepAspectRatio: e.detail.keepAspectRatio,
|
|
2797
2856
|
percentageHeight: t,
|
|
2798
2857
|
percentageWidth: n,
|
|
2799
|
-
unit:
|
|
2858
|
+
unit: M.Pixel,
|
|
2800
2859
|
width: e.detail.width,
|
|
2801
2860
|
x: r,
|
|
2802
2861
|
y: i
|
|
@@ -2807,10 +2866,10 @@ var Wt = X, Z, Gt = {
|
|
|
2807
2866
|
cropMode: "free"
|
|
2808
2867
|
}), this.onCropChanged()), this.isFormatsLayout && this.cropEnabled && this.applyCropTransformation();
|
|
2809
2868
|
}
|
|
2810
|
-
#
|
|
2869
|
+
#f() {
|
|
2811
2870
|
let { ratioHeight: e, ratioWidth: t, unit: n } = this.cropSize;
|
|
2812
|
-
if (n !==
|
|
2813
|
-
let r =
|
|
2871
|
+
if (n !== M.AspectRatio) return;
|
|
2872
|
+
let r = ie(t, e);
|
|
2814
2873
|
(r.width !== t || r.height !== e) && (this.cropSize = {
|
|
2815
2874
|
...this.cropSize,
|
|
2816
2875
|
ratioHeight: r.height,
|
|
@@ -2818,7 +2877,7 @@ var Wt = X, Z, Gt = {
|
|
|
2818
2877
|
});
|
|
2819
2878
|
}
|
|
2820
2879
|
async onCropChanged() {
|
|
2821
|
-
this.#
|
|
2880
|
+
this.#f(), this.focusModes.find((e) => e.value === this.cropSize.focusMode)?.auto && await this.handleRequestAutoCropSuggestion({
|
|
2822
2881
|
focusMode: this.cropSize.focusMode,
|
|
2823
2882
|
height: this.cropSize.height,
|
|
2824
2883
|
width: this.cropSize.width
|
|
@@ -2832,11 +2891,11 @@ var Wt = X, Z, Gt = {
|
|
|
2832
2891
|
unit: this.cropSize.unit,
|
|
2833
2892
|
width: this.cropSize.width
|
|
2834
2893
|
}) {
|
|
2835
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2894
|
+
if (this.clearResetSnapshot(), this.lastAction = D.Crop, !this.asset) {
|
|
2836
2895
|
let { focusMode: e, height: t, position: n, ratioHeight: r, ratioWidth: i, unit: a, width: o, x: s, y: c } = this.cropSize, l = this.focusModes.find((t) => t.value === e)?.auto ?? !1;
|
|
2837
|
-
if (a ===
|
|
2896
|
+
if (a === M.AspectRatio) {
|
|
2838
2897
|
i && r && this.upsertTransformation({
|
|
2839
|
-
key:
|
|
2898
|
+
key: D.Crop,
|
|
2840
2899
|
value: {
|
|
2841
2900
|
focusMode: e,
|
|
2842
2901
|
isFocusModeAuto: l,
|
|
@@ -2849,7 +2908,7 @@ var Wt = X, Z, Gt = {
|
|
|
2849
2908
|
return;
|
|
2850
2909
|
}
|
|
2851
2910
|
(t || o) && Number.isFinite(t) && Number.isFinite(o) && this.upsertTransformation({
|
|
2852
|
-
key:
|
|
2911
|
+
key: D.Crop,
|
|
2853
2912
|
value: {
|
|
2854
2913
|
focusMode: e,
|
|
2855
2914
|
height: t,
|
|
@@ -2868,8 +2927,8 @@ var Wt = X, Z, Gt = {
|
|
|
2868
2927
|
let a = this.cropSize.focusMode, o = this.focusModes.find((e) => e.value === a)?.auto ?? !1;
|
|
2869
2928
|
if (t && i && r) {
|
|
2870
2929
|
let e = i, s = t;
|
|
2871
|
-
if (r ===
|
|
2872
|
-
key:
|
|
2930
|
+
if (r === M.AspectRatio && (e = this.cropSize.percentageWidth * this.selectedFormat.width / 100, s = this.cropSize.percentageHeight * this.selectedFormat.height / 100), n) this.transformations = [...this.transformations, {
|
|
2931
|
+
key: D.Crop,
|
|
2873
2932
|
value: {
|
|
2874
2933
|
focusMode: a,
|
|
2875
2934
|
height: s,
|
|
@@ -2881,7 +2940,7 @@ var Wt = X, Z, Gt = {
|
|
|
2881
2940
|
else {
|
|
2882
2941
|
let t = this.cropSize.x / 100 * this.selectedFormat.width, n = this.cropSize.y / 100 * this.selectedFormat.height;
|
|
2883
2942
|
this.transformations = [...this.transformations, {
|
|
2884
|
-
key:
|
|
2943
|
+
key: D.Crop,
|
|
2885
2944
|
value: {
|
|
2886
2945
|
focusMode: a,
|
|
2887
2946
|
height: s,
|
|
@@ -2894,7 +2953,7 @@ var Wt = X, Z, Gt = {
|
|
|
2894
2953
|
}];
|
|
2895
2954
|
}
|
|
2896
2955
|
} else n && (this.transformations = [...this.transformations, {
|
|
2897
|
-
key:
|
|
2956
|
+
key: D.Crop,
|
|
2898
2957
|
value: {
|
|
2899
2958
|
focusMode: a,
|
|
2900
2959
|
isFocusModeAuto: o,
|
|
@@ -2905,14 +2964,14 @@ var Wt = X, Z, Gt = {
|
|
|
2905
2964
|
getRatioResizePreviewSize(e, t) {
|
|
2906
2965
|
let { height: n, width: r } = this.imageSize;
|
|
2907
2966
|
if (this.asset && r && n) return Z.fitRatioResizeSize(e, t, r, n);
|
|
2908
|
-
let i = e / t, a = Math.max(Math.round(this.lastResizeSize[
|
|
2967
|
+
let i = e / t, a = Math.max(Math.round(this.lastResizeSize[M.Pixel].height * i), 0);
|
|
2909
2968
|
return {
|
|
2910
2969
|
height: Math.max(Math.round(a / i), 0),
|
|
2911
2970
|
width: a
|
|
2912
2971
|
};
|
|
2913
2972
|
}
|
|
2914
2973
|
onResizeChange(e) {
|
|
2915
|
-
if (e.detail.unit ===
|
|
2974
|
+
if (e.detail.unit === M.AspectRatio) {
|
|
2916
2975
|
let { height: t, width: n } = this.getRatioResizePreviewSize(e.detail.width, e.detail.height);
|
|
2917
2976
|
this.resizeSize = {
|
|
2918
2977
|
...this.resizeSize,
|
|
@@ -2934,11 +2993,11 @@ var Wt = X, Z, Gt = {
|
|
|
2934
2993
|
onResizeApply(e) {
|
|
2935
2994
|
let { height: t, unit: n, width: r } = e.detail;
|
|
2936
2995
|
if (!Number.isFinite(r) || !Number.isFinite(t)) return;
|
|
2937
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
2938
|
-
if (n ===
|
|
2996
|
+
if (this.clearResetSnapshot(), this.lastAction = D.Resize, !this.asset) {
|
|
2997
|
+
if (n === M.AspectRatio) {
|
|
2939
2998
|
let { ratioHeight: e, ratioWidth: t } = this.resizeSize;
|
|
2940
2999
|
t && e && this.upsertTransformation({
|
|
2941
|
-
key:
|
|
3000
|
+
key: D.Resize,
|
|
2942
3001
|
value: {
|
|
2943
3002
|
ratioHeight: e,
|
|
2944
3003
|
ratioWidth: t,
|
|
@@ -2948,7 +3007,7 @@ var Wt = X, Z, Gt = {
|
|
|
2948
3007
|
return;
|
|
2949
3008
|
}
|
|
2950
3009
|
(t || r) && (this.upsertTransformation({
|
|
2951
|
-
key:
|
|
3010
|
+
key: D.Resize,
|
|
2952
3011
|
value: {
|
|
2953
3012
|
height: t,
|
|
2954
3013
|
unit: n,
|
|
@@ -2959,8 +3018,8 @@ var Wt = X, Z, Gt = {
|
|
|
2959
3018
|
}
|
|
2960
3019
|
if (!this.selectedFormat) return;
|
|
2961
3020
|
let i = this.selectedFormat.width || this.defaultSize.width, a = this.selectedFormat.height || this.defaultSize.height, o = r, s = t;
|
|
2962
|
-
this.resizeSize.unit === n ? n ===
|
|
2963
|
-
key:
|
|
3021
|
+
this.resizeSize.unit === n ? n === M.AspectRatio && ({height: s, width: o} = Z.fitRatioResizeSize(r, t, i, a)) : (o = i, s = a), this.transformations = [...this.transformations, {
|
|
3022
|
+
key: D.Resize,
|
|
2964
3023
|
value: {
|
|
2965
3024
|
height: s,
|
|
2966
3025
|
unit: n,
|
|
@@ -2975,23 +3034,23 @@ var Wt = X, Z, Gt = {
|
|
|
2975
3034
|
this.applyRotationTransformation(e.detail);
|
|
2976
3035
|
}
|
|
2977
3036
|
applyRotationTransformation(e) {
|
|
2978
|
-
if (this.clearResetSnapshot(), this.lastAction =
|
|
3037
|
+
if (this.clearResetSnapshot(), this.lastAction = D.Rotate, !this.asset) {
|
|
2979
3038
|
e ? this.upsertTransformation({
|
|
2980
|
-
key:
|
|
3039
|
+
key: D.Rotate,
|
|
2981
3040
|
value: { rotation: e }
|
|
2982
|
-
}) : this.transformations = this.transformations.filter((e) => e.key !==
|
|
3041
|
+
}) : this.transformations = this.transformations.filter((e) => e.key !== D.Rotate);
|
|
2983
3042
|
return;
|
|
2984
3043
|
}
|
|
2985
3044
|
this.selectedFormat && (this.transformations = [...this.transformations, {
|
|
2986
|
-
key:
|
|
3045
|
+
key: D.Rotate,
|
|
2987
3046
|
value: { rotation: e }
|
|
2988
3047
|
}]);
|
|
2989
3048
|
}
|
|
2990
3049
|
onQualityChange(e) {
|
|
2991
3050
|
let t = e.detail;
|
|
2992
|
-
this.selectedFormat && (this.selectedFormat.quality = t), this.clearResetSnapshot(), this.lastAction =
|
|
3051
|
+
this.selectedFormat && (this.selectedFormat.quality = t), this.clearResetSnapshot(), this.lastAction = D.Quality;
|
|
2993
3052
|
let n = {
|
|
2994
|
-
key:
|
|
3053
|
+
key: D.Quality,
|
|
2995
3054
|
value: { quality: t }
|
|
2996
3055
|
};
|
|
2997
3056
|
this.asset ? this.transformations = [...this.transformations, n] : this.upsertTransformation(n);
|
|
@@ -3003,15 +3062,15 @@ var Wt = X, Z, Gt = {
|
|
|
3003
3062
|
keepMetadata: t
|
|
3004
3063
|
}, !this.asset) {
|
|
3005
3064
|
t ? this.upsertTransformation({
|
|
3006
|
-
key:
|
|
3065
|
+
key: D.Metadata,
|
|
3007
3066
|
value: { keepMetadata: t }
|
|
3008
|
-
}) : this.transformations = this.transformations.filter((e) => e.key !==
|
|
3067
|
+
}) : this.transformations = this.transformations.filter((e) => e.key !== D.Metadata);
|
|
3009
3068
|
return;
|
|
3010
3069
|
}
|
|
3011
3070
|
t ? this.upsertTransformation({
|
|
3012
|
-
key:
|
|
3071
|
+
key: D.Metadata,
|
|
3013
3072
|
value: { keepMetadata: t }
|
|
3014
|
-
}) : this.transformations = this.transformations.filter((e) => e.key !==
|
|
3073
|
+
}) : this.transformations = this.transformations.filter((e) => e.key !== D.Metadata);
|
|
3015
3074
|
}
|
|
3016
3075
|
onExtensionChange(e) {
|
|
3017
3076
|
let t = e.detail;
|
|
@@ -3021,14 +3080,14 @@ var Wt = X, Z, Gt = {
|
|
|
3021
3080
|
};
|
|
3022
3081
|
}
|
|
3023
3082
|
syncQuality() {
|
|
3024
|
-
let e = this.transformations.findLast((e) => e.key ===
|
|
3083
|
+
let e = this.transformations.findLast((e) => e.key === D.Quality)?.value?.quality;
|
|
3025
3084
|
this.selectedFormat &&= {
|
|
3026
3085
|
...this.selectedFormat,
|
|
3027
3086
|
quality: e ?? 100
|
|
3028
3087
|
};
|
|
3029
3088
|
}
|
|
3030
3089
|
syncSelectedDimensions(e = !0) {
|
|
3031
|
-
let t = this.transformations.findLast((e) => e.key ===
|
|
3090
|
+
let t = this.transformations.findLast((e) => e.key === D.Dimensions), n = Z.getDimensionsSize(this.selectedDimensions);
|
|
3032
3091
|
if (!t) {
|
|
3033
3092
|
n && (this.selectedDimensions = void 0);
|
|
3034
3093
|
return;
|
|
@@ -3040,51 +3099,66 @@ var Wt = X, Z, Gt = {
|
|
|
3040
3099
|
return !e.disabled && t?.width === r && t.height === i;
|
|
3041
3100
|
});
|
|
3042
3101
|
this.selectedDimensions = a ? {
|
|
3043
|
-
mode:
|
|
3102
|
+
mode: E.Preset,
|
|
3044
3103
|
value: a.value
|
|
3045
3104
|
} : {
|
|
3046
3105
|
height: i,
|
|
3047
|
-
mode:
|
|
3048
|
-
unit:
|
|
3106
|
+
mode: E.Custom,
|
|
3107
|
+
unit: O.Pixel,
|
|
3049
3108
|
width: r
|
|
3050
3109
|
};
|
|
3051
3110
|
}
|
|
3111
|
+
#p(e) {
|
|
3112
|
+
e.has("cropModes") && (this.#a = this.cropModes.some((e) => e.value === "free") ? this.cropModes : [{
|
|
3113
|
+
label: this.localize.term("cropFreeMode"),
|
|
3114
|
+
value: "free"
|
|
3115
|
+
}, ...this.cropModes]), e.has("focusModes") && (this.#o = this.focusModes.some((e) => e.value === "manual") ? this.focusModes : [{
|
|
3116
|
+
label: this.localize.term("cropManualFocus"),
|
|
3117
|
+
value: "manual"
|
|
3118
|
+
}, ...this.focusModes]);
|
|
3119
|
+
}
|
|
3120
|
+
#m() {
|
|
3121
|
+
this.transformations.some((e) => e.key === D.Dimensions) || this.#h(this.#i ? Z.parsePercentDimensions(this.percentDimensions) : void 0);
|
|
3122
|
+
}
|
|
3123
|
+
#h(e) {
|
|
3124
|
+
e ? this.selectedDimensions = e : Z.getPercentDimensions(this.selectedDimensions) && (this.selectedDimensions = void 0);
|
|
3125
|
+
}
|
|
3052
3126
|
get hasResettableState() {
|
|
3053
|
-
let e =
|
|
3054
|
-
return this.canReorder && this.activeParts.some((t, n) => t !== e[n]) || this.transformations.length > 0 ? !0 : this.canAutoFormat && !this.autoFormat;
|
|
3127
|
+
let e = $t.filter((e) => this.activeParts.includes(e));
|
|
3128
|
+
return this.canReorder && this.activeParts.some((t, n) => t !== e[n]) || this.transformations.length > 0 || Z.getPercentDimensions(this.selectedDimensions) ? !0 : this.canAutoFormat && !this.autoFormat;
|
|
3055
3129
|
}
|
|
3056
3130
|
clearResetSnapshot() {
|
|
3057
|
-
this.canReorder && this.rememberOrder(), this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0;
|
|
3131
|
+
this.canReorder && this.rememberOrder(), this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.#r = void 0;
|
|
3058
3132
|
}
|
|
3059
3133
|
handleUndo() {
|
|
3060
3134
|
if (this.canReorder && this.orderUndo.length > 0) {
|
|
3061
3135
|
let e = this.orderUndo[this.orderUndo.length - 1];
|
|
3062
|
-
this.orderUndo = this.orderUndo.slice(0, -1), this.parts = e.parts, this.autoFormat = e.autoFormat, this.selectedProxy = e.selectedProxy, this.transformations = e.transformations, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.emitReorder(), this.syncQuality();
|
|
3136
|
+
this.orderUndo = this.orderUndo.slice(0, -1), this.parts = e.parts, this.autoFormat = e.autoFormat, this.selectedProxy = e.selectedProxy, this.#h(e.percentDimensions), this.transformations = e.transformations, this.preResetTransformations = void 0, this.preResetAutoFormat = void 0, this.preResetSelectedProxy = void 0, this.#r = void 0, this.emitReorder(), this.syncQuality();
|
|
3063
3137
|
return;
|
|
3064
3138
|
}
|
|
3065
|
-
!this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0, this.preResetAutoFormat !== void 0 && (this.autoFormat = this.preResetAutoFormat, this.preResetAutoFormat = void 0), this.preResetSelectedProxy !== void 0 && (this.selectedProxy = this.preResetSelectedProxy, this.preResetSelectedProxy = void 0)) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
|
|
3139
|
+
!this.hasUnfrozenTransformations && this.preResetTransformations !== void 0 ? (this.transformations = this.preResetTransformations, this.preResetTransformations = void 0, this.preResetAutoFormat !== void 0 && (this.autoFormat = this.preResetAutoFormat, this.preResetAutoFormat = void 0), this.preResetSelectedProxy !== void 0 && (this.selectedProxy = this.preResetSelectedProxy, this.preResetSelectedProxy = void 0), this.#h(this.#r), this.#r = void 0) : this.transformations = this.transformations.slice(0, -1), this.syncQuality();
|
|
3066
3140
|
}
|
|
3067
3141
|
handleReset() {
|
|
3068
|
-
if (this.canReorder && this.rememberOrder(), this.preResetTransformations = [...this.transformations], this.preResetAutoFormat = this.autoFormat, this.preResetSelectedProxy = this.selectedProxy, this.canAutoFormat) this.autoFormat = !0, this.selectedProxy = this.autoResolvedProxyId || this.selectedProxy;
|
|
3142
|
+
if (this.canReorder && this.rememberOrder(), this.preResetTransformations = [...this.transformations], this.preResetAutoFormat = this.autoFormat, this.preResetSelectedProxy = this.selectedProxy, this.#r = Z.getPercentDimensions(this.selectedDimensions), this.#h(void 0), this.canAutoFormat) this.autoFormat = !0, this.selectedProxy = this.autoResolvedProxyId || this.selectedProxy;
|
|
3069
3143
|
else {
|
|
3070
3144
|
let e = !!this.defaultProxy && !!this.proxies?.some((e) => e.id === this.defaultProxy);
|
|
3071
3145
|
this.selectedProxy = e ? this.defaultProxy : this.selectedProxy || this.proxies?.[0]?.id || "";
|
|
3072
3146
|
}
|
|
3073
|
-
this.transformations = [], this.canReorder && (this.parts =
|
|
3147
|
+
this.transformations = [], this.canReorder && (this.parts = $t.filter((e) => this.activeParts.includes(e)), this.emitReorder()), this.frozenIndex = -1, this.syncQuality();
|
|
3074
3148
|
}
|
|
3075
3149
|
onDimensionsChange(e) {
|
|
3076
3150
|
e.stopPropagation();
|
|
3077
3151
|
let t = Z.getDimensionsSize(e.detail);
|
|
3078
|
-
this.clearResetSnapshot(), this.lastAction =
|
|
3079
|
-
key:
|
|
3152
|
+
this.clearResetSnapshot(), this.lastAction = D.Dimensions, this.selectedDimensions = { ...e.detail }, t ? this.upsertTransformation({
|
|
3153
|
+
key: D.Dimensions,
|
|
3080
3154
|
value: t
|
|
3081
|
-
}) : this.transformations = this.transformations.filter((e) => e.key !==
|
|
3155
|
+
}) : this.transformations = this.transformations.filter((e) => e.key !== D.Dimensions), this.capCropToMaxSize();
|
|
3082
3156
|
}
|
|
3083
3157
|
onCropToggle(e) {
|
|
3084
|
-
e.stopPropagation(), this.clearResetSnapshot(), this.cropEnabled = e.currentTarget.checked, this.cropEnabled || (this.transformations = this.transformations.filter((e) => e.key !==
|
|
3158
|
+
e.stopPropagation(), this.clearResetSnapshot(), this.cropEnabled = e.currentTarget.checked, this.cropEnabled || (this.transformations = this.transformations.filter((e) => e.key !== D.Crop)), this.emit("cx-asset-link-format-crop-toggle", { detail: this.cropEnabled });
|
|
3085
3159
|
}
|
|
3086
3160
|
renderDimensionsPart() {
|
|
3087
|
-
return e`<cx-asset-link-format-dimensions class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ?
|
|
3161
|
+
return e`<cx-asset-link-format-dimensions class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ? j.Automatic : j.Manual} .inline=${this.isFormatsLayout} ?open=${this.activeSetting === "cx-asset-link-format-dimensions"} ?loading=${this.loading} .items=${this.dimensionsItems} .value=${this.selectedDimensions} ?can-custom=${this.canCustomDimensions} ?can-percent=${this.#i} @cx-asset-link-format-dimensions-change=${this.onDimensionsChange}></cx-asset-link-format-dimensions>`;
|
|
3088
3162
|
}
|
|
3089
3163
|
renderHeader() {
|
|
3090
3164
|
return m(!this.hideHeader && !this.isFormatsLayout, () => e`<cx-space class="asset-link-format__section-header" direction="horizontal" spacing="small" align-items="center" justify-content="space-between"><cx-typography variant="body3">${this.localize.term("transformations")}</cx-typography><cx-space direction="horizontal" spacing="3x-small" align-items="center"><cx-button class="asset-link-format__undo" variant="custom" ?disabled=${!this.hasUnfrozenTransformations && this.preResetTransformations === void 0 && (!this.canReorder || this.orderUndo.length === 0)} @click=${this.handleUndo}>${this.localize.term("undo")}</cx-button>${m(this.canReset, () => e`<cx-button class="asset-link-format__reset" variant="custom" ?disabled=${!this.hasResettableState} @click=${this.handleReset}>${this.localize.term("reset")}</cx-button>`)}</cx-space></cx-space>`, () => n);
|
|
@@ -3093,42 +3167,42 @@ var Wt = X, Z, Gt = {
|
|
|
3093
3167
|
return m(this.canReorder, () => e`<div class="asset-link-format__order-hint" data-testid="cx-asset-link-format-order-hint">${this.localize.term("transformationOrderHint")}</div>`);
|
|
3094
3168
|
}
|
|
3095
3169
|
renderProxyPart() {
|
|
3096
|
-
return e`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction ===
|
|
3170
|
+
return e`<cx-asset-link-format-proxy class="asset-link-format__details" value=${this.selectedProxy || this.proxies?.[0]?.id || ""} ?open=${this.activeSetting === "cx-asset-link-format-proxy"} ?auto-format=${this.autoFormat} ?can-auto-format=${this.canAutoFormat} .items=${this.formats} ?loading=${this.loading && this.lastAction === D.Proxy} @cx-asset-link-format-proxy-change=${this.onProxyChange}></cx-asset-link-format-proxy>`;
|
|
3097
3171
|
}
|
|
3098
3172
|
renderCropEditor(t) {
|
|
3099
|
-
let n = this.asset ? this.lastResizeSize[
|
|
3100
|
-
return e`<cx-asset-link-format-crop class="asset-link-format__details" .inline=${t} ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction ===
|
|
3173
|
+
let n = this.asset ? this.lastResizeSize[M.Pixel] : this.cropMaxSize;
|
|
3174
|
+
return e`<cx-asset-link-format-crop class="asset-link-format__details" .inline=${t} ?open=${this.activeSetting === "cx-asset-link-format-crop"} ?disabled-apply=${this.disabledCropApply} ?loading=${this.loading && this.lastAction === D.Crop} ?show-position-picker=${!this.asset} ?has-cropper=${!!this.cropperElement} ?dimensions-limited=${this.isCropAtDimensionsLimit} ?keep-aspect-ratio=${this.cropSize.keepAspectRatio} focus-mode=${this.cropSize.focusMode} crop-mode=${this.cropSize.cropMode} width=${this.cropSize.width} height=${this.cropSize.height} max-width=${n.width} max-height=${n.height} percentage-width=${this.cropSize.percentageWidth} percentage-height=${this.cropSize.percentageHeight} position=${this.cropSize.position} ratio-width=${this.cropSize.ratioWidth} ratio-height=${this.cropSize.ratioHeight} unit=${this.cropSize.unit} .lastAppliedSetting=${this.lastCropSize} .cropModes=${this.#a} .focusModes=${this.#o} @cx-asset-link-format-crop-mode-change=${this.onCropModeChange} @cx-asset-link-format-crop-focus-mode-change=${this.onCropFocusModeChange} @cx-asset-link-format-crop-position-change=${this.onCropPositionChange} @cx-asset-link-format-crop-change=${this.onCropChange} @cx-asset-link-format-crop-changed=${this.onCropChanged} @cx-asset-link-format-crop-apply=${this.onCropApply}></cx-asset-link-format-crop>`;
|
|
3101
3175
|
}
|
|
3102
3176
|
renderCropPart() {
|
|
3103
3177
|
return this.isFormatsLayout ? e`<div class="asset-link-format__formats-crop"><cx-space class="asset-link-format__formats-summary" align-items="center" justify-content="space-between"><cx-space align-items="center"><div part="icon"><cx-icon name="crop"></cx-icon></div><cx-typography variant="body3">${this.localize.term("crop")}</cx-typography></cx-space><cx-switch data-testid="cx-asset-link-format-crop-toggle" .checked=${this.cropEnabled} ?disabled=${this.loading} @cx-change=${this.onCropToggle}><cx-visually-hidden>${this.localize.term("crop")}</cx-visually-hidden></cx-switch></cx-space>${m(this.cropEnabled, () => this.renderCropEditor(!0))}</div>` : this.renderCropEditor(!1);
|
|
3104
3178
|
}
|
|
3105
3179
|
renderResizePart() {
|
|
3106
|
-
return e`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction ===
|
|
3180
|
+
return e`<cx-asset-link-format-resize class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-resize"} ?loading=${this.loading && this.lastAction === D.Resize} ?no-ratio-modes=${!this.asset} ?keep-aspect-ratio=${this.resizeSize.keepAspectRatio} width=${this.resizeSize.width} height=${this.resizeSize.height} max-width=${this.asset ? this.imageSize.width : Infinity} max-height=${this.asset ? this.imageSize.height : Infinity} ratio-width=${this.resizeSize.ratioWidth} ratio-height=${this.resizeSize.ratioHeight} unit=${this.resizeSize.unit} .lastAppliedSetting=${this.lastResizeSize} @cx-asset-link-format-resize-change=${this.onResizeChange} @cx-asset-link-format-resize-apply=${this.onResizeApply}></cx-asset-link-format-resize>`;
|
|
3107
3181
|
}
|
|
3108
3182
|
renderRotatePart() {
|
|
3109
|
-
return e`<cx-asset-link-format-rotation class="asset-link-format__details" .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction ===
|
|
3183
|
+
return e`<cx-asset-link-format-rotation class="asset-link-format__details" .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction === D.Rotate} ?open=${this.activeSetting === "cx-asset-link-format-rotation"} default-value=${this.selectedFormat?.rotation ?? 0} last-applied-value=${this.lastRotation} value=${this.rotation} @cx-asset-link-format-rotation-change=${this.onRotationChange} @cx-asset-link-format-rotation-apply=${this.onRotationApply}></cx-asset-link-format-rotation>`;
|
|
3110
3184
|
}
|
|
3111
3185
|
renderQualityPart() {
|
|
3112
|
-
return e`<cx-asset-link-format-quality class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ?
|
|
3186
|
+
return e`<cx-asset-link-format-quality class="asset-link-format__details" .applyBehavior=${this.isFormatsLayout ? j.Automatic : j.Manual} .inline=${this.isFormatsLayout} ?loading=${this.loading && this.lastAction === D.Quality} ?open=${this.activeSetting === "cx-asset-link-format-quality"} value=${this.selectedFormat?.quality ?? 100} .items=${this.qualityItems} @cx-asset-link-format-quality-change=${this.onQualityChange}></cx-asset-link-format-quality>`;
|
|
3113
3187
|
}
|
|
3114
3188
|
renderMetadataPart() {
|
|
3115
3189
|
return e`<cx-asset-link-format-metadata class="asset-link-format__details" ?open=${this.activeSetting === "cx-asset-link-format-metadata"} .value=${this.selectedFormat?.keepMetadata ?? !1} @cx-asset-link-format-metadata-change=${this.onMetadataChange}></cx-asset-link-format-metadata>`;
|
|
3116
3190
|
}
|
|
3117
3191
|
renderPart(e) {
|
|
3118
3192
|
switch (e) {
|
|
3119
|
-
case
|
|
3120
|
-
case
|
|
3121
|
-
case
|
|
3122
|
-
case
|
|
3123
|
-
case
|
|
3124
|
-
case
|
|
3125
|
-
case
|
|
3193
|
+
case k.Dimensions: return this.renderDimensionsPart();
|
|
3194
|
+
case k.Proxy: return this.renderProxyPart();
|
|
3195
|
+
case k.Crop: return this.renderCropPart();
|
|
3196
|
+
case k.Resize: return this.renderResizePart();
|
|
3197
|
+
case k.Rotate: return this.renderRotatePart();
|
|
3198
|
+
case k.Quality: return this.renderQualityPart();
|
|
3199
|
+
case k.Metadata: return this.renderMetadataPart();
|
|
3126
3200
|
default: return n;
|
|
3127
3201
|
}
|
|
3128
3202
|
}
|
|
3129
3203
|
render() {
|
|
3130
3204
|
return e`<div class="asset-link-format ${this.isFormatsLayout ? "asset-link-format--formats" : ""}" @cx-show=${this.onDetailsShow} @cx-hide=${this.onDetailsHide}>${this.renderHeader()}
|
|
3131
|
-
${this.renderOrderHint()}<div class="asset-link-format__panels">${
|
|
3205
|
+
${this.renderOrderHint()}<div class="asset-link-format__panels">${x(this.activeParts, (e) => e, (t) => e`<div class="asset-link-format__panel" data-part=${t} ?data-reorderable=${this.canReorder && en.includes(t)}>${m(this.canReorder && en.includes(t), () => e`<cx-icon-button class="asset-link-format__drag-handle" name="drag_indicator" label=${this.localize.term("reorderTransformation", this.localize.term(t))} ?disabled=${this.loading} @keydown=${this.handleReorderKeyDown}></cx-icon-button>`)}
|
|
3132
3206
|
${this.renderPart(t)}</div>`)}</div><span class="asset-link-format__announcement" role="status" aria-live="polite">${this.reorderAnnouncement}</span>${m(this.useCustomExtension, () => e`<cx-asset-link-format-extension .items=${this.extensions} value=${this.selectedFormat?.extension ?? ""} @cx-asset-link-format-extension-change=${this.onExtensionChange}></cx-asset-link-format-extension>`)}<div class="asset-link-format__footer"><slot name="footer"></slot></div></div>`;
|
|
3133
3207
|
}
|
|
3134
3208
|
};
|
|
@@ -3188,12 +3262,12 @@ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy",
|
|
|
3188
3262
|
type: Boolean
|
|
3189
3263
|
}), o("design:type", Boolean)], $.prototype, "useCustomExtension", void 0), a([r({
|
|
3190
3264
|
attribute: "parts",
|
|
3191
|
-
converter:
|
|
3265
|
+
converter: Me,
|
|
3192
3266
|
type: Array
|
|
3193
3267
|
}), o("design:type", Array)], $.prototype, "parts", void 0), a([r({
|
|
3194
3268
|
reflect: !0,
|
|
3195
3269
|
type: String
|
|
3196
|
-
}), o("design:type",
|
|
3270
|
+
}), o("design:type", xe === void 0 ? Object : xe)], $.prototype, "layout", void 0), a([r({
|
|
3197
3271
|
attribute: "crop-enabled",
|
|
3198
3272
|
reflect: !0,
|
|
3199
3273
|
type: Boolean
|
|
@@ -3207,6 +3281,12 @@ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy",
|
|
|
3207
3281
|
attribute: "can-custom-dimensions",
|
|
3208
3282
|
type: Boolean
|
|
3209
3283
|
}), o("design:type", Object)], $.prototype, "canCustomDimensions", void 0), a([r({
|
|
3284
|
+
attribute: "can-percent-dimensions",
|
|
3285
|
+
type: Boolean
|
|
3286
|
+
}), o("design:type", Object)], $.prototype, "canPercentDimensions", void 0), a([r({
|
|
3287
|
+
attribute: "percent-dimensions",
|
|
3288
|
+
type: String
|
|
3289
|
+
}), o("design:type", Object)], $.prototype, "percentDimensions", void 0), a([r({
|
|
3210
3290
|
attribute: "last-image-size",
|
|
3211
3291
|
reflect: !1,
|
|
3212
3292
|
type: Object
|
|
@@ -3247,6 +3327,6 @@ a([c(".sortable-fallback"), o("design:type", Object)], $.prototype, "dragCopy",
|
|
|
3247
3327
|
o("design:paramtypes", []),
|
|
3248
3328
|
o("design:returntype", void 0)
|
|
3249
3329
|
], $.prototype, "handleReorderableChange", null), $ = Z = a([u("cx-asset-link-format"), o("design:paramtypes", [])], $);
|
|
3250
|
-
var
|
|
3330
|
+
var nn = $;
|
|
3251
3331
|
//#endregion
|
|
3252
|
-
export {
|
|
3332
|
+
export { ft as C, yt as S, Pe as T, Ze as _, tt as a, gt as b, F as c, nt as d, Je as f, Xe as g, I as h, Tt as i, Ke as l, rt as m, Ot as n, We as o, Ye as p, Et as r, P as s, nn as t, qe as u, Qe as v, Fe as w, xt as x, bt as y };
|