@orangelogic/design-system 2.0.0-29DUO2-beta-3 → 2.0.0-29IORR-beta-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/library/chunks/{AxisLabelRadial.CgPb7ghO.js → AxisLabelRadial.Bs1P_q_F.js} +1 -1
- package/library/chunks/{BaseColumnSeries.B6rG-Ylz.js → BaseColumnSeries.C7jwOxIJ.js} +1 -1
- package/library/chunks/{CandlestickSeries.C-YfO-57.js → CandlestickSeries.CkXGtRWE.js} +2 -2
- package/library/chunks/{Circle.DhoXSsjo.js → Circle.DBa5Ok8V.js} +1 -1
- package/library/chunks/{ColumnSeries.CZi2LBZ2.js → ColumnSeries.DGazbfza.js} +2 -2
- package/library/chunks/{EditableAxisLabel.CykTMTsG.js → EditableAxisLabel.wN0t_G2B.js} +2 -2
- package/library/chunks/{EditableLabel.BlQ7B4D0.js → EditableLabel.BWeq6fgX.js} +1 -1
- package/library/chunks/{Gradient.BQ0JzFEe.js → Gradient.CdcsPIru.js} +1 -1
- package/library/chunks/{LinearGradient.DuVS2EHe.js → LinearGradient.B1z9AGUt.js} +2 -2
- package/library/chunks/{Picture.DRO0jnR6.js → Picture.YSPC0l0Q.js} +1 -1
- package/library/chunks/{Polygon.DEO3f_qs.js → Polygon.BwMvXN2H.js} +1 -1
- package/library/chunks/{ProgressPie.Bryx2w1J.js → ProgressPie.DlCwXN17.js} +5 -5
- package/library/chunks/{RadialLabel.TyXECvYG.js → RadialLabel.DyVOf2K8.js} +1 -1
- package/library/chunks/{Scrollbar.DK48nKk4.js → Scrollbar.BdZVb_Z-.js} +1 -1
- package/library/chunks/{Slice.DbXRplXx.js → Slice.DiEswWa6.js} +1 -1
- package/library/chunks/{Slider.B27osQYu.js → Slider.C20No2z5.js} +1 -1
- package/library/chunks/{SpriteResizer.C4wFzD_x.js → SpriteResizer.DFnmcy0h.js} +1 -1
- package/library/chunks/{Triangle.BEmFiHyd.js → Triangle.BaOef7HV.js} +1 -1
- package/library/chunks/{ZoomTools.CBqjLDqb.js → ZoomTools.D5JPehoL.js} +1 -1
- package/library/chunks/{_baseUniq.Df-fLIBx.js → _baseUniq.BUihBa8c.js} +56 -53
- package/library/chunks/{am-chart.B_OdX4Q-.js → am-chart.H2jnOzFc.js} +254 -262
- package/library/chunks/{animation.DfUHRQry.js → animation.7ifl4x2S.js} +4 -8
- package/library/chunks/array.DCtvHiLS.js +81 -0
- package/library/chunks/asset.D7E0-cUV.js +460 -0
- package/library/chunks/{button.KnE3mcyM.js → button.CauAHfdl.js} +10 -45
- package/library/chunks/button.styles.CKqn956w.js +5 -0
- package/library/chunks/{capitalize.WSkCXkNE.js → capitalize.CNStXZBq.js} +1 -1
- package/library/chunks/{color-swatch-group.p3Sdqlat.js → color-swatch-group.D5BP2W3P.js} +50 -220
- package/library/chunks/{color-swatch.C0oPHfOu.js → color-swatch.2HS4bc3N.js} +20 -204
- package/library/chunks/{colorPicker.CJwbdhtn.js → colorPicker.06n6P3aK.js} +5 -5
- package/library/chunks/component.styles.CRO4Odto.js +5 -0
- package/library/chunks/confirm-popover.DmGAMS8X.js +121 -0
- package/library/chunks/{cropper.tSDgXKqJ.js → cropper.ZU2Dy-MM.js} +8182 -8540
- package/library/chunks/{dialog.DpZBbTCn.js → dialog.2UW1LNm1.js} +117 -314
- package/library/chunks/{dom.BQVKDNd8.js → dom.BslZF2Y_.js} +1 -1
- package/library/chunks/dot-pagination.DsAfSNzr.js +204 -0
- package/library/chunks/{endpoints.B7lcoc1N.js → endpoints.Fpyb8xvv.js} +214 -203
- package/library/chunks/{exporting.DCqJtW6l.js → exporting.Chnl3UWi.js} +2 -2
- package/library/chunks/file-on-demand.Dig_iVvx.js +1956 -0
- package/library/chunks/{flow.Ch1rU01m.js → flow.D2CqFQa7.js} +5 -5
- package/library/chunks/folder-select.BT1drT8C.js +775 -0
- package/library/chunks/form-control.styles.CaGWmeAS.js +5 -0
- package/library/chunks/{form.DgwYWi0O.js → form.CFc09rKh.js} +1 -1
- package/library/chunks/{gantt.rWdF_jmG.js → gantt.DSHD2gjO.js} +8 -8
- package/library/chunks/header.BePZwMCQ.js +170 -0
- package/library/chunks/{hierarchy.HoRJAu6S.js → hierarchy.DwVsMmsP.js} +5 -5
- package/library/chunks/{hub-connection.CfARlehM.js → hub-connection.Ot2odiCz.js} +1 -1
- package/library/chunks/{i18n.C0iakJkV.js → i18n.BFqTRDCA.js} +19 -12
- package/library/chunks/icon-button.rKe0N4VB.js +149 -0
- package/library/chunks/iframe.DznmlYpV.js +73 -0
- package/library/chunks/{image.C9avagDq.js → image.CEtCGsNL.js} +275 -488
- package/library/chunks/{index.D2JPKXqq.js → index.C9khsiad.js} +17 -17
- package/library/chunks/isObjectLike.z36Fu426.js +34 -0
- package/library/chunks/{isSymbol.huJ_Cvxt.js → isSymbol.L0C2ND_U.js} +1 -1
- package/library/chunks/{json.DHNMAC-m.js → json.zyETMOw-.js} +3 -3
- package/library/chunks/{list-editor.B2mFE9f7.js → list-editor.CJ96S1Np.js} +58 -372
- package/library/chunks/{map.BHmZ4Crx.js → map.CqM2O6LB.js} +2 -2
- package/library/chunks/option.COnEtd3X.js +123 -0
- package/library/chunks/{overlayscrollbars.XhGWx9Zk.js → overlayscrollbars.BMav4RQ4.js} +252 -958
- package/library/chunks/pagination.DaD9Yul6.js +334 -0
- package/library/chunks/{percent.CM9cr1H3.js → percent.DuQwbCCg.js} +3 -3
- package/library/chunks/{radar.CQUnnhGk.js → radar.FpYl3UH5.js} +4 -4
- package/library/chunks/{responsive.CrX-HUow.js → responsive.BndCeSg0.js} +1 -1
- package/library/chunks/{sliceGrouper.iv1p8MAK.js → sliceGrouper.BsE7fGMt.js} +1 -1
- package/library/chunks/{stock.CU0y6a5P.js → stock.BR-ag4Pt.js} +9 -9
- package/library/chunks/string.BigZhczf.js +185 -0
- package/library/chunks/{tab-group.05PY0smt.js → tab-group.0Po0eoxR.js} +33 -584
- package/library/chunks/{table.DNTm_GMS.js → table.WNd284in.js} +3535 -4852
- package/library/chunks/{timeline.yzdwtGKM.js → timeline.DkzkmgEM.js} +5 -5
- package/library/chunks/{toString.CRT5zqEU.js → toString.CL_lYXbK.js} +3 -3
- package/library/chunks/toast.B2cJgW5u.js +71 -0
- package/library/chunks/transformation.CzBptarI.js +140 -0
- package/library/chunks/{tree.CeMLCbs-.js → tree.QCQd_cuc.js} +32 -400
- package/library/chunks/typography.DJC_UXgs.js +52 -0
- package/library/chunks/url.Cj9cIQXJ.js +27 -0
- package/library/chunks/{venn.BOEi13la.js → venn.D739bOV3.js} +1 -1
- package/library/chunks/watch.BCJD77bD.js +547 -0
- package/library/chunks/{wc.V-lq02JF.js → wc.DzW311D-.js} +1 -1
- package/library/chunks/{xy.Df1hy9ac.js → xy.DCRDfTsa.js} +10 -10
- package/library/components/alert.js +11 -179
- package/library/components/am-chart.js +3 -3
- package/library/components/animated-image.js +13 -101
- package/library/components/animation.js +3 -3
- package/library/components/array-line-clamp.js +8 -89
- package/library/components/asset-link-format.js +718 -1380
- package/library/components/atoms.js +18 -18
- package/library/components/avatar.js +6 -95
- package/library/components/badge.js +11 -139
- package/library/components/bicolor-picker.js +4 -23
- package/library/components/border-input-group.js +5 -26
- package/library/components/breadcrumb-item.js +25 -156
- package/library/components/breadcrumb.js +4 -22
- package/library/components/button-group.js +3 -28
- package/library/components/button.js +6 -6
- package/library/components/card.js +4 -126
- package/library/components/checkbox.js +13 -254
- package/library/components/color-picker.js +57 -728
- package/library/components/color-swatch-group.js +9 -9
- package/library/components/color-swatch.js +5 -5
- package/library/components/confirm-popover.js +6 -6
- package/library/components/copy-button.js +11 -256
- package/library/components/corner-position-input-group.js +5 -58
- package/library/components/cropper.js +2 -2
- package/library/components/details.js +6 -152
- package/library/components/dialog.js +6 -6
- package/library/components/divider.js +6 -68
- package/library/components/dot-pagination.js +4 -4
- package/library/components/dot-status.js +25 -95
- package/library/components/drawer.js +11 -242
- package/library/components/dropdown.js +49 -151
- package/library/components/dynamic-select.js +10 -75
- package/library/components/e-chart.js +8 -51
- package/library/components/element-clamp.js +7 -80
- package/library/components/file-on-demand.js +13 -13
- package/library/components/folder-select.js +9 -7
- package/library/components/format-bytes.js +1 -1
- package/library/components/format-date.js +3 -7
- package/library/components/format-number.js +1 -1
- package/library/components/format-time.js +4 -14
- package/library/components/grid-item.js +5 -172
- package/library/components/grid.js +5 -41
- package/library/components/header.js +4 -4
- package/library/components/hub-connection.js +2 -2
- package/library/components/icon-button.js +14 -679
- package/library/components/icon.js +9 -2449
- package/library/components/iframe.js +4 -4
- package/library/components/image-comparer.js +9 -129
- package/library/components/image.js +4 -4
- package/library/components/include.js +3 -7
- package/library/components/input-group.js +4 -29
- package/library/components/input.js +358 -966
- package/library/components/line-clamp.js +7 -83
- package/library/components/list-editor.js +9 -9
- package/library/components/markdown.js +2 -4
- package/library/components/masonry.js +24 -223
- package/library/components/menu-item.js +155 -445
- package/library/components/menu-label.js +3 -20
- package/library/components/menu-section.js +3 -17
- package/library/components/menu.js +5 -113
- package/library/components/molecules.js +5 -5
- package/library/components/mutation-observer.js +3 -7
- package/library/components/option.js +4 -4
- package/library/components/organisms.js +2 -2
- package/library/components/padding-input-group.js +5 -16
- package/library/components/pagination.js +10 -8
- package/library/components/popup.js +385 -682
- package/library/components/position-picker.js +4 -94
- package/library/components/progress-bar.js +19 -136
- package/library/components/progress-ring.js +4 -95
- package/library/components/qr-code.js +5 -17
- package/library/components/radio-button.js +5 -25
- package/library/components/radio-card.js +8 -176
- package/library/components/radio-group.js +22 -153
- package/library/components/radio.js +14 -171
- package/library/components/range.js +123 -660
- package/library/components/rating.js +58 -238
- package/library/components/relative-time.js +3 -13
- package/library/components/resize-observer.js +4 -8
- package/library/components/select.js +305 -1012
- package/library/components/shadow-input-group.js +5 -24
- package/library/components/share-option-list.js +21 -313
- package/library/components/sidebar.js +15 -221
- package/library/components/size-input-group.js +12 -77
- package/library/components/skeleton.js +7 -80
- package/library/components/space.js +6 -143
- package/library/components/spinner.js +7 -76
- package/library/components/split-panel.js +18 -125
- package/library/components/step.js +21 -272
- package/library/components/stepper-wizard.js +9 -43
- package/library/components/stepper.js +17 -34
- package/library/components/switch.js +13 -276
- package/library/components/tab-group.js +7 -7
- package/library/components/tab-panel.js +5 -32
- package/library/components/tab.js +11 -257
- package/library/components/table.js +8 -8
- package/library/components/tag.js +15 -166
- package/library/components/textarea.js +183 -504
- package/library/components/timecode.js +6 -25
- package/library/components/tooltip.js +10 -94
- package/library/components/tree-item.js +4 -4
- package/library/components/tree.js +4 -4
- package/library/components/typeface.js +24 -123
- package/library/components/types.js +37225 -47339
- package/library/components/typography.js +2 -2
- package/library/components/video.js +3875 -6263
- package/library/components/visually-hidden.js +3 -15
- package/library/package.json +4 -1
- package/library/packages/atoms/src/components/dialog/dialog.d.ts +10 -0
- package/library/packages/atoms/src/components/icon-button/icon-button.d.ts +2 -1
- package/library/packages/atoms/src/components/image/image.d.ts +15 -1
- package/library/packages/atoms/src/components/input/auto-grow-controller.d.ts +23 -0
- package/library/packages/atoms/src/components/input/input.d.ts +10 -2
- package/library/packages/atoms/src/components/menu-item/menu-item.d.ts +4 -0
- package/library/packages/atoms/src/components/pagination/pagination.d.ts +32 -2
- package/library/packages/atoms/src/components/popup/overlay/Overlay.d.ts +10 -0
- package/library/packages/atoms/src/components/popup/popup.d.ts +1 -1
- package/library/packages/atoms/src/components/select/select.d.ts +11 -0
- package/library/packages/atoms/src/components/table/table.d.ts +49 -8
- package/library/packages/atoms/src/components/table/tabulator-tables/core/Tabulator.d.ts +1 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/core/TabulatorFull.d.ts +1 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/core/tools/DataLoader.d.ts +3 -1
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Ajax/Ajax.d.ts +1 -1
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/Edit.d.ts +1 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Edit/List.d.ts +40 -1
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Filter/Filter.d.ts +10 -3
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Filter/formatter-display-resolvers.d.ts +93 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/Group.d.ts +8 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupComponent.d.ts +3 -1
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupLoadMore.d.ts +7 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/GroupRows/GroupRows.d.ts +2 -0
- package/library/packages/atoms/src/components/table/tabulator-tables/modules/Page/Page.d.ts +2 -2
- package/library/packages/atoms/src/components/textarea/textarea.d.ts +19 -4
- package/library/packages/atoms/src/components/video/video.d.ts +3 -1
- package/library/packages/events/src/cx-asset-transformation-dialog-cancel.d.ts +6 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-confirm.d.ts +11 -0
- package/library/packages/events/src/cx-asset-transformation-dialog-delete.d.ts +6 -0
- package/library/packages/events/src/cx-bento-range-change.d.ts +9 -0
- package/library/packages/events/src/cx-content-builder-gallery-fetched.d.ts +10 -0
- package/library/packages/events/src/cx-lightbox-close.d.ts +6 -0
- package/library/packages/events/src/cx-lightbox-download.d.ts +11 -0
- package/library/packages/events/src/cx-unauthorized.d.ts +10 -0
- package/library/packages/events/src/cx-video-format-picker-delete.d.ts +6 -0
- package/library/packages/events/src/cx-video-format-picker-select.d.ts +8 -0
- package/library/packages/events/src/events.d.ts +11 -1
- package/library/packages/molecules/src/cropper/cropper.d.ts +2 -0
- package/library/packages/molecules/src/cropper/react/Cropper.d.ts +2 -0
- package/library/packages/molecules/src/estimated-reading-time/estimated-reading-time.d.ts +3 -2
- package/library/packages/molecules/src/folder-select/components/folder-select-tree/folder-select-tree.d.ts +26 -0
- package/library/packages/molecules/src/folder-select/components/folder-select-tree-item/folder-select-tree-item.d.ts +46 -0
- package/library/packages/molecules/src/folder-select/folder-select.d.ts +25 -0
- package/library/packages/molecules/src/index.d.ts +1 -0
- package/library/packages/molecules/src/storybook/storybook.d.ts +60 -23
- package/library/packages/molecules/src/timeline/timeline.d.ts +14 -0
- package/library/packages/molecules/src/video-format-picker/video-format-picker.d.ts +55 -0
- package/library/packages/molecules/src/video-format-picker/video-format-picker.styles.d.ts +2 -0
- package/library/packages/organisms/src/asset-link-format/asset-link-format.d.ts +9 -1
- package/library/packages/organisms/src/asset-link-format/components/asset-link-format-rotation/asset-link-format-rotation.d.ts +7 -7
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.d.ts +95 -0
- package/library/packages/organisms/src/asset-transformation-dialog/asset-transformation-dialog.styles.d.ts +2 -0
- package/library/packages/organisms/src/bento-grid/bento-grid.d.ts +57 -26
- package/library/packages/organisms/src/bento-grid/bento-layout.d.ts +44 -0
- package/library/packages/organisms/src/carousel/carousel.d.ts +5 -1
- package/library/packages/organisms/src/comment/comment.d.ts +1 -0
- package/library/packages/organisms/src/content-builder/components/block-picker/block-picker.d.ts +7 -0
- package/library/packages/organisms/src/content-builder/components/config-form/config-form.d.ts +11 -0
- package/library/packages/organisms/src/content-builder/components/config-manager/config-manager.d.ts +10 -0
- package/library/packages/organisms/src/content-builder/components/folder-picker/folder-picker.d.ts +6 -0
- package/library/packages/organisms/src/content-builder/configs/carousel.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/gallery.d.ts +6 -2
- package/library/packages/organisms/src/content-builder/configs/image.d.ts +7 -4
- package/library/packages/organisms/src/content-builder/configs/timeline.d.ts +5 -2
- package/library/packages/organisms/src/content-builder/configs/video.d.ts +11 -2
- package/library/packages/organisms/src/content-builder/configs-controller.d.ts +45 -4
- package/library/packages/organisms/src/content-builder/content-builder.d.ts +13 -0
- package/library/packages/organisms/src/content-builder/plugins/gallery.d.ts +45 -1
- package/library/packages/organisms/src/content-builder/styleController.d.ts +20 -2
- package/library/packages/organisms/src/index.d.ts +2 -0
- package/library/packages/organisms/src/lightbox/lightbox.d.ts +79 -0
- package/library/packages/organisms/src/lightbox/lightbox.styles.d.ts +2 -0
- package/library/packages/services/src/api/asset/asset.d.ts +3 -2
- package/library/packages/services/src/api/asset/asset.types.d.ts +84 -0
- package/library/packages/services/src/api/asset/asset.utils.d.ts +9 -0
- package/library/packages/services/src/api/endpoints.d.ts +1 -1
- package/library/packages/tools/src/fetch-asset/fetch-asset.d.ts +2 -1
- package/library/packages/tools/src/fetch-image/fetch-image.d.ts +17 -5
- package/library/packages/types/src/asset-click-action.d.ts +3 -1
- package/library/packages/types/src/bento-grid.d.ts +37 -0
- package/library/packages/types/src/content-builder.d.ts +27 -1
- package/library/packages/types/src/gallery.d.ts +0 -6
- package/library/packages/types/src/icon-button.d.ts +7 -0
- package/library/packages/types/src/menu-item.d.ts +33 -0
- package/library/packages/types/src/storybook.d.ts +19 -0
- package/library/packages/types/src/table.d.ts +37 -1
- package/library/packages/types/src/textarea.d.ts +4 -0
- package/library/packages/types/src/video-format-picker.d.ts +11 -0
- package/library/packages/utils/src/actions/asset-click.d.ts +1 -3
- package/library/packages/utils/src/custom-element/i18n.d.ts +10 -3
- package/library/packages/utils/src/index.d.ts +1 -0
- package/library/packages/utils/src/string/string.d.ts +33 -0
- package/library/packages/utils/src/transformation/index.d.ts +1 -0
- package/library/packages/utils/src/url/url.d.ts +9 -0
- package/library/react-web-component.d.ts +293 -29
- package/library/utils.js +483 -178
- package/package.json +4 -1
- package/library/chunks/_baseRest.ClTMQtN1.js +0 -67
- package/library/chunks/asset.CG_yXtWK.js +0 -288
- package/library/chunks/button.styles.Dl5IQLHU.js +0 -718
- package/library/chunks/component.styles.DMSLciL5.js +0 -71
- package/library/chunks/confirm-popover.zmOFI4e-.js +0 -288
- package/library/chunks/content-builder.D_phDrlo.js +0 -127
- package/library/chunks/dot-pagination.COBkyhoJ.js +0 -325
- package/library/chunks/file-on-demand.CbE-qsiP.js +0 -3740
- package/library/chunks/folder-select.Bl_WkhVE.js +0 -844
- package/library/chunks/form-control.styles.CUGhvlfT.js +0 -67
- package/library/chunks/header.BduX6KJP.js +0 -777
- package/library/chunks/identity.ByMq8VxU.js +0 -6
- package/library/chunks/iframe.BPKV2K7z.js +0 -160
- package/library/chunks/index.B3wJT3XS.js +0 -373
- package/library/chunks/isObjectLike.D3cpZO39.js +0 -81
- package/library/chunks/option.DnpkE8Xi.js +0 -296
- package/library/chunks/pagination.C30LoTya.js +0 -341
- package/library/chunks/string.B_rEG27K.js +0 -160
- package/library/chunks/toast.BXNbwZV8.js +0 -25
- package/library/chunks/typography.oDzoLbZS.js +0 -149
- package/library/chunks/url.LjsR2sB5.js +0 -15
- package/library/chunks/watch.q1sEjPWL.js +0 -501
- /package/library/packages/{organisms/src/asset-link-format/asset-link-format.utils.d.ts → utils/src/transformation/transformation.d.ts} +0 -0
|
@@ -0,0 +1,1956 @@
|
|
|
1
|
+
import J from "../components/icon.js";
|
|
2
|
+
import Q from "../components/line-clamp.js";
|
|
3
|
+
import { C as yt, s as bt, a as $t, b as lt } from "./tree.QCQd_cuc.js";
|
|
4
|
+
import { n as d, C as H } from "./lib-cortex-element.CVMmyPMC.js";
|
|
5
|
+
import { c as tt } from "./component.styles.CRO4Odto.js";
|
|
6
|
+
import { c as W } from "./custom-element.L4WJXn1j.js";
|
|
7
|
+
import { L as q } from "./i18n.BFqTRDCA.js";
|
|
8
|
+
import { k as zt, h as St, i as It, w as P, j as Et, l as Lt, f as Ft, g as Ut, d as Rt, m as kt, n as Ot } from "./watch.BCJD77bD.js";
|
|
9
|
+
import { p as R } from "./string.BigZhczf.js";
|
|
10
|
+
import { x as n, i as at, E as Nt } from "./lit-element.jLBm65_O.js";
|
|
11
|
+
import { r as u } from "./state.CSDxrqLd.js";
|
|
12
|
+
import { e as z } from "./query.BBf1UFkC.js";
|
|
13
|
+
import { e as C } from "./class-map.BiVq-cVR.js";
|
|
14
|
+
import { c as U } from "./repeat.DbF2p5ae.js";
|
|
15
|
+
import { n as p } from "./when.Dr1es41R.js";
|
|
16
|
+
import { a as jt, i as wt, c as Bt, b as dt } from "./_baseUniq.BUihBa8c.js";
|
|
17
|
+
import Mt from "../components/avatar.js";
|
|
18
|
+
import { C as Vt } from "./button.CauAHfdl.js";
|
|
19
|
+
import { C as Ht } from "./dialog.2UW1LNm1.js";
|
|
20
|
+
import Wt from "../components/divider.js";
|
|
21
|
+
import ot from "../components/format-bytes.js";
|
|
22
|
+
import { C as Ct } from "./icon-button.rKe0N4VB.js";
|
|
23
|
+
import qt from "../components/input.js";
|
|
24
|
+
import { C as Gt } from "./option.COnEtd3X.js";
|
|
25
|
+
import At from "../components/relative-time.js";
|
|
26
|
+
import Yt from "../components/select.js";
|
|
27
|
+
import Kt from "../components/space.js";
|
|
28
|
+
import Xt from "../components/tab.js";
|
|
29
|
+
import { C as Zt } from "./tab-group.0Po0eoxR.js";
|
|
30
|
+
import Jt from "../components/tab-panel.js";
|
|
31
|
+
import Dt from "../components/tooltip.js";
|
|
32
|
+
import { C as nt } from "./typography.DJC_UXgs.js";
|
|
33
|
+
import { C as Qt } from "./confirm-popover.DmGAMS8X.js";
|
|
34
|
+
import { d as te } from "./debounce.DaHuiSGU.js";
|
|
35
|
+
import { a as et } from "./number.CjNxU7Xs.js";
|
|
36
|
+
import { i as K, a as ht } from "./url.Cj9cIQXJ.js";
|
|
37
|
+
import { a as ee } from "./toString.CL_lYXbK.js";
|
|
38
|
+
import { S as pt, i as se } from "./isObjectLike.z36Fu426.js";
|
|
39
|
+
import ie from "../components/progress-bar.js";
|
|
40
|
+
import ae from "../components/spinner.js";
|
|
41
|
+
import { o as oe } from "./style-map.llVFPd__.js";
|
|
42
|
+
import { r as ne } from "./choose.BTbF6BAn.js";
|
|
43
|
+
function re(t, e, i, a) {
|
|
44
|
+
for (var s = -1, o = t == null ? 0 : t.length; ++s < o; ) {
|
|
45
|
+
var c = t[s];
|
|
46
|
+
e(a, c, i(c), t);
|
|
47
|
+
}
|
|
48
|
+
return a;
|
|
49
|
+
}
|
|
50
|
+
function ce(t) {
|
|
51
|
+
return function(e, i, a) {
|
|
52
|
+
for (var s = -1, o = Object(e), c = a(e), h = c.length; h--; ) {
|
|
53
|
+
var _ = c[++s];
|
|
54
|
+
if (i(o[_], _, o) === !1)
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
return e;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
var le = ce();
|
|
61
|
+
function de(t, e) {
|
|
62
|
+
return t && le(t, e, zt);
|
|
63
|
+
}
|
|
64
|
+
function he(t, e) {
|
|
65
|
+
return function(i, a) {
|
|
66
|
+
if (i == null)
|
|
67
|
+
return i;
|
|
68
|
+
if (!St(i))
|
|
69
|
+
return t(i, a);
|
|
70
|
+
for (var s = i.length, o = -1, c = Object(i); ++o < s && a(c[o], o, c) !== !1; )
|
|
71
|
+
;
|
|
72
|
+
return i;
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
var pe = he(de);
|
|
76
|
+
function ue(t, e, i, a) {
|
|
77
|
+
return pe(t, function(s, o, c) {
|
|
78
|
+
e(a, s, i(s), c);
|
|
79
|
+
}), a;
|
|
80
|
+
}
|
|
81
|
+
function ge(t, e) {
|
|
82
|
+
return function(i, a) {
|
|
83
|
+
var s = It(i) ? re : ue, o = e ? e() : {};
|
|
84
|
+
return s(i, t, jt(a), o);
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
var xe = ge(function(t, e, i) {
|
|
88
|
+
t[i ? 0 : 1].push(e);
|
|
89
|
+
}, function() {
|
|
90
|
+
return [[], []];
|
|
91
|
+
});
|
|
92
|
+
const me = {
|
|
93
|
+
error: "Upload error",
|
|
94
|
+
loaded: "Up-to-date",
|
|
95
|
+
loading: "Syncing"
|
|
96
|
+
}, x = {
|
|
97
|
+
FAVORITES: "favorites",
|
|
98
|
+
PINNED: "pinned",
|
|
99
|
+
RECENT: "recent",
|
|
100
|
+
UPLOADS: "uploads"
|
|
101
|
+
}, X = 20, _e = {
|
|
102
|
+
GET_CONTENT: "/webapi/extensibility/integrations/contentBrowserSDK/getcontent_4bw_v1"
|
|
103
|
+
}, A = {
|
|
104
|
+
ASSET_PATH: "Document.AssetPath",
|
|
105
|
+
CHILD_COUNT: "Document.ChildCount",
|
|
106
|
+
CORTEX_PATH: "Document.CortexPath",
|
|
107
|
+
DOC_TYPE: "CoreField.DocType",
|
|
108
|
+
HAS_BROWSER_CHILDREN: "Document.HasBrowserChildren",
|
|
109
|
+
PARENT_FOLDER_IDENTIFIER: "Document.ParentRecordID",
|
|
110
|
+
TITLE_WITH_FALLBACK: "CoreField.TitleWithFallback"
|
|
111
|
+
}, Z = "GB", O = 6e4, fe = ["album", "story", "project", "merchandise"], ut = (t) => {
|
|
112
|
+
const e = /* @__PURE__ */ new Date(), i = new Date(
|
|
113
|
+
e.getFullYear(),
|
|
114
|
+
e.getMonth(),
|
|
115
|
+
e.getDate()
|
|
116
|
+
).getTime(), a = new Date(
|
|
117
|
+
e.getFullYear(),
|
|
118
|
+
e.getMonth(),
|
|
119
|
+
e.getDate() + 1
|
|
120
|
+
).getTime();
|
|
121
|
+
return xe(
|
|
122
|
+
t.toSorted((s, o) => o.uploadTimestamp - s.uploadTimestamp),
|
|
123
|
+
(s) => s.uploadTimestamp >= i && s.uploadTimestamp < a
|
|
124
|
+
);
|
|
125
|
+
}, ve = ({
|
|
126
|
+
excludesRecordIDs: t,
|
|
127
|
+
searchText: e
|
|
128
|
+
}) => {
|
|
129
|
+
let i = "";
|
|
130
|
+
e?.trim() && (i = `Story_Title:${e}`);
|
|
131
|
+
let a = "";
|
|
132
|
+
t?.length && (a = t.map((o) => `RecordID:NOT ${o}`).join(" AND "));
|
|
133
|
+
let s = i ? ` AND (${[i].filter(Boolean).join(" OR ")})` : "";
|
|
134
|
+
return a && (s = `${s} AND (${a})`), `(MediaType:Story OR MediaType:Album)${s}`;
|
|
135
|
+
}, ye = 10, Tt = async ({
|
|
136
|
+
excludes: t = [],
|
|
137
|
+
folderId: e,
|
|
138
|
+
folderPath: i = [],
|
|
139
|
+
folderPathsSet: a,
|
|
140
|
+
limit: s = ye,
|
|
141
|
+
searchText: o,
|
|
142
|
+
seeThru: c,
|
|
143
|
+
siteUrl: h,
|
|
144
|
+
start: _ = 0,
|
|
145
|
+
token: m
|
|
146
|
+
}) => {
|
|
147
|
+
if (!h)
|
|
148
|
+
return { data: [], totalCount: 0 };
|
|
149
|
+
let g = h;
|
|
150
|
+
g.endsWith("/") && (g = g.slice(0, -1));
|
|
151
|
+
const $ = _e.GET_CONTENT, f = [
|
|
152
|
+
["Token", m],
|
|
153
|
+
[
|
|
154
|
+
"extraFilters",
|
|
155
|
+
ve({
|
|
156
|
+
excludesRecordIDs: t,
|
|
157
|
+
searchText: o
|
|
158
|
+
})
|
|
159
|
+
],
|
|
160
|
+
["fields", A.ASSET_PATH],
|
|
161
|
+
["fields", A.CORTEX_PATH],
|
|
162
|
+
["fields", A.DOC_TYPE],
|
|
163
|
+
["fields", A.TITLE_WITH_FALLBACK],
|
|
164
|
+
["fields", A.HAS_BROWSER_CHILDREN],
|
|
165
|
+
["fields", A.PARENT_FOLDER_IDENTIFIER],
|
|
166
|
+
["fields", A.CHILD_COUNT],
|
|
167
|
+
["objectRecordID", e],
|
|
168
|
+
["seeThru", o?.trim() || c ? "true" : "false"],
|
|
169
|
+
["limit", s.toString()],
|
|
170
|
+
["start", _.toString()]
|
|
171
|
+
], F = new URL(`${g}${$}`);
|
|
172
|
+
f.forEach(([w, E]) => {
|
|
173
|
+
F.searchParams.append(w, E);
|
|
174
|
+
});
|
|
175
|
+
const k = await fetch(F.toString(), {
|
|
176
|
+
headers: {
|
|
177
|
+
Authorization: `Bearer ${m}`
|
|
178
|
+
},
|
|
179
|
+
method: "GET"
|
|
180
|
+
});
|
|
181
|
+
if (!k.ok) {
|
|
182
|
+
const w = new Error();
|
|
183
|
+
throw w.message = "Failed to fetch", w;
|
|
184
|
+
}
|
|
185
|
+
const G = await k.json();
|
|
186
|
+
let Y = /* @__PURE__ */ new Set();
|
|
187
|
+
a && (Y = Se(a));
|
|
188
|
+
const rt = G.contentItems?.map((w) => {
|
|
189
|
+
let E = M(
|
|
190
|
+
w.fields,
|
|
191
|
+
A.TITLE_WITH_FALLBACK
|
|
192
|
+
) ?? "", B = $e(
|
|
193
|
+
(M(
|
|
194
|
+
w.fields,
|
|
195
|
+
A.ASSET_PATH
|
|
196
|
+
) ?? "").replace(/^Root\//i, "")
|
|
197
|
+
) || E;
|
|
198
|
+
if (a) {
|
|
199
|
+
if (a.has(B)) {
|
|
200
|
+
const ct = B.split("/"), Pt = ct.pop();
|
|
201
|
+
B = `${ct.join("/")}/${w.recordID}-${Pt}`, E = `${w.recordID}-${E}`;
|
|
202
|
+
}
|
|
203
|
+
o?.trim() && Y.has(E) && (E = B), a.add(B), Y.add(E);
|
|
204
|
+
}
|
|
205
|
+
return {
|
|
206
|
+
childCount: Number(
|
|
207
|
+
M(
|
|
208
|
+
w.fields,
|
|
209
|
+
A.CHILD_COUNT
|
|
210
|
+
) ?? 0
|
|
211
|
+
),
|
|
212
|
+
children: [],
|
|
213
|
+
docType: M(
|
|
214
|
+
w.fields,
|
|
215
|
+
A.DOC_TYPE
|
|
216
|
+
) ?? "",
|
|
217
|
+
fullPath: B,
|
|
218
|
+
hasChildren: M(
|
|
219
|
+
w.fields,
|
|
220
|
+
A.HAS_BROWSER_CHILDREN
|
|
221
|
+
) === "1",
|
|
222
|
+
id: w.recordID,
|
|
223
|
+
parentFolderIdentifier: M(
|
|
224
|
+
w.fields,
|
|
225
|
+
A.PARENT_FOLDER_IDENTIFIER
|
|
226
|
+
) ?? "",
|
|
227
|
+
parents: [],
|
|
228
|
+
path: [...i, E],
|
|
229
|
+
title: E
|
|
230
|
+
};
|
|
231
|
+
}) ?? [];
|
|
232
|
+
return { data: rt, totalCount: G.totalCount ?? rt.length };
|
|
233
|
+
};
|
|
234
|
+
function M(t, e) {
|
|
235
|
+
const i = e.toLowerCase(), a = Object.keys(t).find(
|
|
236
|
+
(s) => s.toLowerCase() === i
|
|
237
|
+
);
|
|
238
|
+
return a ? t[a] : void 0;
|
|
239
|
+
}
|
|
240
|
+
const it = "-", S = (t) => {
|
|
241
|
+
const e = t.split(it), i = e.pop() ?? "", a = e.join(it);
|
|
242
|
+
return { id: i, path: a };
|
|
243
|
+
}, N = ({ id: t, path: e }) => [e, t].join(it), be = (t) => {
|
|
244
|
+
const e = t.split(".");
|
|
245
|
+
return e.length > 1 ? e.pop() ?? "" : "";
|
|
246
|
+
}, gt = (t) => {
|
|
247
|
+
const e = t.match(/(?:V\.?)?(\d+(?:\.\d+)*)/);
|
|
248
|
+
return e ? e[1] : "";
|
|
249
|
+
}, xt = (t, e) => {
|
|
250
|
+
let i = e?.trim();
|
|
251
|
+
const a = e ? e.split("/").length : 0;
|
|
252
|
+
return (t ? t.length : 0) >= a && (i = t.join("/") ?? ""), i;
|
|
253
|
+
}, $e = (t) => t.split("/").map((e) => e.trim()).join("/"), Se = (t) => {
|
|
254
|
+
const e = /* @__PURE__ */ new Set();
|
|
255
|
+
for (const i of t) {
|
|
256
|
+
const a = i.split("/"), s = a[a.length - 1];
|
|
257
|
+
s && e.add(s);
|
|
258
|
+
}
|
|
259
|
+
return e;
|
|
260
|
+
}, Ie = (t, e) => {
|
|
261
|
+
const i = t.split("/"), a = e.split("/");
|
|
262
|
+
return i.slice(0, a.length + 1).join("/");
|
|
263
|
+
};
|
|
264
|
+
function mt(t) {
|
|
265
|
+
return t.toSorted((e, i) => i.uploadTimestamp - e.uploadTimestamp);
|
|
266
|
+
}
|
|
267
|
+
var we = Object.defineProperty, Ce = Object.getOwnPropertyDescriptor, D = (t, e, i, a) => {
|
|
268
|
+
for (var s = a > 1 ? void 0 : a ? Ce(e, i) : e, o = t.length - 1, c; o >= 0; o--)
|
|
269
|
+
(c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
|
|
270
|
+
return a && s && we(e, i, s), s;
|
|
271
|
+
};
|
|
272
|
+
let y = class extends H {
|
|
273
|
+
constructor() {
|
|
274
|
+
super(...arguments), this.localize = new q(this), this.role = "treeitem", this.siteUrl = "", this.token = "", this.searchText = "", this.folder = null, this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.folderPathsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.data = null, this.totalCount = 0, this.isLoading = !1, this.fetchFolders = async ({
|
|
275
|
+
folderId: t,
|
|
276
|
+
start: e = 0
|
|
277
|
+
}) => await Tt({
|
|
278
|
+
folderId: t,
|
|
279
|
+
folderPath: this.folder?.path ?? [],
|
|
280
|
+
folderPathsSet: this.folderPathsSet,
|
|
281
|
+
siteUrl: this.siteUrl,
|
|
282
|
+
start: e,
|
|
283
|
+
token: this.token
|
|
284
|
+
}), this.loadMore = async (t) => {
|
|
285
|
+
t?.stopPropagation();
|
|
286
|
+
const e = this.data?.length ?? 0;
|
|
287
|
+
if (e >= this.totalCount)
|
|
288
|
+
return;
|
|
289
|
+
this.isLoading = !0;
|
|
290
|
+
const { data: i, totalCount: a } = await this.fetchFolders({
|
|
291
|
+
folderId: this.folder?.id ?? "",
|
|
292
|
+
start: e
|
|
293
|
+
});
|
|
294
|
+
this.data = [...this.data ?? [], ...i], this.totalCount = a, this.isLoading = !1;
|
|
295
|
+
}, this.onLazyLoad = async (t) => {
|
|
296
|
+
if (t.target !== this.treeItem)
|
|
297
|
+
return;
|
|
298
|
+
const { data: e, totalCount: i } = await this.fetchFolders({
|
|
299
|
+
folderId: this.folder?.id ?? ""
|
|
300
|
+
});
|
|
301
|
+
if (this.data = e, this.totalCount = i, await this.updateComplete, !this.treeItem.selected && !this.treeItem.indeterminate) {
|
|
302
|
+
let a = !0, s = !0;
|
|
303
|
+
for (const o of this.treeItem.getChildrenItems())
|
|
304
|
+
o.selected ? (bt(o, !0, "multiple"), s = !1) : a = !1;
|
|
305
|
+
this.treeItem.indeterminate = !a && !s;
|
|
306
|
+
}
|
|
307
|
+
};
|
|
308
|
+
}
|
|
309
|
+
get selected() {
|
|
310
|
+
return this.treeItem.selected;
|
|
311
|
+
}
|
|
312
|
+
set selected(t) {
|
|
313
|
+
this.treeItem.selected = t;
|
|
314
|
+
}
|
|
315
|
+
get expanded() {
|
|
316
|
+
return this.treeItem.expanded;
|
|
317
|
+
}
|
|
318
|
+
set expanded(t) {
|
|
319
|
+
this.treeItem.expanded = t;
|
|
320
|
+
}
|
|
321
|
+
get indeterminate() {
|
|
322
|
+
return this.treeItem.indeterminate;
|
|
323
|
+
}
|
|
324
|
+
set indeterminate(t) {
|
|
325
|
+
this.treeItem.indeterminate = t;
|
|
326
|
+
}
|
|
327
|
+
// this is so that external cx-tree can query select the cx-tree-item inside
|
|
328
|
+
createRenderRoot() {
|
|
329
|
+
return this;
|
|
330
|
+
}
|
|
331
|
+
getChildrenItems() {
|
|
332
|
+
return this.treeItem.getChildrenItems();
|
|
333
|
+
}
|
|
334
|
+
async syncBoxes() {
|
|
335
|
+
if (await this.updateComplete, !this.treeItem)
|
|
336
|
+
return;
|
|
337
|
+
let t = !1;
|
|
338
|
+
const e = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set(), a = xt(this.folder?.path ?? [], this.folder?.fullPath ?? ""), s = [...this.currentRootIDsSet], o = (m, g) => {
|
|
339
|
+
m.forEach(($) => {
|
|
340
|
+
const f = S($);
|
|
341
|
+
if (!f.path.trim() || !f.id.trim())
|
|
342
|
+
return !1;
|
|
343
|
+
const F = R(f.path), k = R(a);
|
|
344
|
+
a && F.startsWith(k) && F !== k && g.add(Ie(f.path, a));
|
|
345
|
+
});
|
|
346
|
+
};
|
|
347
|
+
o(this.removedIDs, i), o(s, e);
|
|
348
|
+
let c = !!s.some((m) => {
|
|
349
|
+
const g = S(m);
|
|
350
|
+
if (!g.path.trim() || !g.id.trim())
|
|
351
|
+
return !1;
|
|
352
|
+
const $ = N({
|
|
353
|
+
id: this.folder?.id ?? "",
|
|
354
|
+
path: a
|
|
355
|
+
}), f = R(g.path), F = R(a), k = g.id === this.folder?.id, G = !this.removedIDs.includes($) && F.startsWith(f);
|
|
356
|
+
return k || G;
|
|
357
|
+
});
|
|
358
|
+
const h = this.folder?.childCount && e.size === this.folder?.childCount;
|
|
359
|
+
if (this.folder?.childCount && i.size === this.folder?.childCount) {
|
|
360
|
+
this.currentRootIDsSet.delete(
|
|
361
|
+
N({
|
|
362
|
+
id: this.folder?.id ?? "",
|
|
363
|
+
path: a
|
|
364
|
+
})
|
|
365
|
+
);
|
|
366
|
+
const m = this.parentElement?.parentElement;
|
|
367
|
+
m && m instanceof y && m.syncBoxes(), c = !1;
|
|
368
|
+
} else if (!c)
|
|
369
|
+
if (h) {
|
|
370
|
+
this.currentRootIDsSet.add(
|
|
371
|
+
N({
|
|
372
|
+
id: this.folder?.id ?? "",
|
|
373
|
+
path: a
|
|
374
|
+
})
|
|
375
|
+
);
|
|
376
|
+
const m = this.parentElement?.parentElement;
|
|
377
|
+
m && m instanceof y && m.syncBoxes(), c = !0;
|
|
378
|
+
} else e.size > 0 && (t = !0);
|
|
379
|
+
c ? (t = i.size > 0, this.treeItem.selected = !0) : (t = e.size > 0, this.treeItem.selected = !1, await this.treeItem.updateComplete), t ? (this.treeItem.selected = !1, await this.treeItem.updateComplete, this.treeItem.indeterminate = !0) : this.treeItem.indeterminate = !1;
|
|
380
|
+
}
|
|
381
|
+
render() {
|
|
382
|
+
const t = xt(this.folder?.path ?? [], this.folder?.fullPath ?? "");
|
|
383
|
+
return n`<cx-tree-item aria-label=${this.folder?.title ?? ""} class=${C({
|
|
384
|
+
"folder-tree__item": !0,
|
|
385
|
+
selectable: !0
|
|
386
|
+
})} data-id=${this.folder?.id} data-path=${t} ?lazy=${this.folder?.hasChildren && this.data === null} @cx-lazy-load=${this.onLazyLoad}><div class="folder-tree__label"><cx-icon class="folder-tree__icon" name="folder"></cx-icon><cx-line-clamp lines="1" class="folder-tree__label__value">${this.folder?.title}</cx-line-clamp></div>${U(
|
|
387
|
+
this.data ?? [],
|
|
388
|
+
(e) => e.id,
|
|
389
|
+
(e) => n`<cx-folder-item slot="children" .folder=${e} .siteUrl=${this.siteUrl} .token=${this.token} .removedIDs=${this.removedIDs} .currentRootIDsSet=${this.currentRootIDsSet} .folderPathsSet=${this.folderPathsSet}></cx-folder-item>`
|
|
390
|
+
)}
|
|
391
|
+
${p(
|
|
392
|
+
this.data && this.data.length < this.totalCount,
|
|
393
|
+
() => n`<div slot="children" class="load-more-button"><cx-button data-testid="load-more-button" variant="text" @click=${this.loadMore} ?loading=${this.isLoading}>${this.localize.term("more")}</cx-button></div>`
|
|
394
|
+
)}</cx-tree-item>`;
|
|
395
|
+
}
|
|
396
|
+
};
|
|
397
|
+
y.styles = [tt];
|
|
398
|
+
y.dependencies = {
|
|
399
|
+
"cx-icon": J,
|
|
400
|
+
"cx-line-clamp": Q,
|
|
401
|
+
"cx-tree-item": yt
|
|
402
|
+
};
|
|
403
|
+
D([
|
|
404
|
+
z("cx-tree-item")
|
|
405
|
+
], y.prototype, "treeItem", 2);
|
|
406
|
+
D([
|
|
407
|
+
d({
|
|
408
|
+
attribute: "site-url",
|
|
409
|
+
reflect: !0,
|
|
410
|
+
type: String
|
|
411
|
+
})
|
|
412
|
+
], y.prototype, "siteUrl", 2);
|
|
413
|
+
D([
|
|
414
|
+
d({ reflect: !0, type: String })
|
|
415
|
+
], y.prototype, "token", 2);
|
|
416
|
+
D([
|
|
417
|
+
d({ attribute: "search-text", reflect: !0, type: String })
|
|
418
|
+
], y.prototype, "searchText", 2);
|
|
419
|
+
D([
|
|
420
|
+
d({ type: Object })
|
|
421
|
+
], y.prototype, "folder", 2);
|
|
422
|
+
D([
|
|
423
|
+
d({
|
|
424
|
+
attribute: "current-root-ids-set",
|
|
425
|
+
type: Object
|
|
426
|
+
})
|
|
427
|
+
], y.prototype, "currentRootIDsSet", 2);
|
|
428
|
+
D([
|
|
429
|
+
d({ attribute: "folder-paths-set", type: Object })
|
|
430
|
+
], y.prototype, "folderPathsSet", 2);
|
|
431
|
+
D([
|
|
432
|
+
d({
|
|
433
|
+
attribute: "removed-ids",
|
|
434
|
+
converter: {
|
|
435
|
+
fromAttribute: (t) => t.split(" "),
|
|
436
|
+
toAttribute: (t) => t.join(" ")
|
|
437
|
+
},
|
|
438
|
+
type: String
|
|
439
|
+
})
|
|
440
|
+
], y.prototype, "removedIDs", 2);
|
|
441
|
+
D([
|
|
442
|
+
u()
|
|
443
|
+
], y.prototype, "data", 2);
|
|
444
|
+
D([
|
|
445
|
+
u()
|
|
446
|
+
], y.prototype, "totalCount", 2);
|
|
447
|
+
D([
|
|
448
|
+
u()
|
|
449
|
+
], y.prototype, "isLoading", 2);
|
|
450
|
+
D([
|
|
451
|
+
P(["currentRootIDsSet", "removedIDs"])
|
|
452
|
+
], y.prototype, "syncBoxes", 1);
|
|
453
|
+
y = D([
|
|
454
|
+
W("cx-folder-item")
|
|
455
|
+
], y);
|
|
456
|
+
const Ae = at`.folder-tree{flex:1;overflow:auto}.folder-tree:not(.selectable){max-height:200px}.folder-tree__item::part(label){width:100%;overflow:hidden}.folder-tree__icon{font-size:var(--cx-font-size-large);color:var(--cx-color-neutral-600)}.folder-tree__label{gap:var(--cx-spacing-x-small);width:100%;line-height:var(--cx-line-height-medium);display:flex;overflow:hidden}.folder-tree__label__value{--tooltip-max-width:min(80vw, 640px);flex-grow:1;flex-shrink:1;overflow:hidden}.load-more-button{margin-left:calc(1em + var(--cx-spacing-x-small) + 1rem + var(--cx-spacing-x-small) * 2)}.load-more-button cx-button{line-height:var(--cx-line-height-small)}`;
|
|
457
|
+
var De = Object.defineProperty, Te = Object.getOwnPropertyDescriptor, I = (t, e, i, a) => {
|
|
458
|
+
for (var s = a > 1 ? void 0 : a ? Te(e, i) : e, o = t.length - 1, c; o >= 0; o--)
|
|
459
|
+
(c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
|
|
460
|
+
return a && s && De(e, i, s), s;
|
|
461
|
+
};
|
|
462
|
+
let b = class extends H {
|
|
463
|
+
constructor() {
|
|
464
|
+
super(...arguments), this.localize = new q(this), this.role = "tree", this.siteUrl = "", this.bearerToken = "", this.token = "", this.searchText = "", this.folders = [], this.rootIDs = [], this.totalCount = 0, this.loadMore = () => {
|
|
465
|
+
}, this.isLoading = !1, this.folderPathsSet = /* @__PURE__ */ new Set(), this.removedIDs = [], this.currentRootIDsSet = /* @__PURE__ */ new Set(), this.renderFolder = (t) => n`<cx-folder-item .currentRootIDsSet=${this.currentRootIDsSet} .folder=${t} .folderPathsSet=${this.folderPathsSet} .removedIDs=${this.removedIDs} bearer-token=${this.bearerToken} search-text=${this.searchText} site-url=${this.siteUrl} token=${this.token}></cx-folder-item>`;
|
|
466
|
+
}
|
|
467
|
+
get currentRootIDs() {
|
|
468
|
+
return Array.from(this.currentRootIDsSet);
|
|
469
|
+
}
|
|
470
|
+
handleRootIDsChange() {
|
|
471
|
+
this.currentRootIDsSet = new Set(this.rootIDs);
|
|
472
|
+
}
|
|
473
|
+
resetTree() {
|
|
474
|
+
this.currentRootIDsSet = new Set(this.rootIDs), this.tree.querySelectorAll("cx-folder-item").forEach((t) => {
|
|
475
|
+
t.selected = this.currentRootIDsSet.has(
|
|
476
|
+
N({
|
|
477
|
+
id: t.id,
|
|
478
|
+
path: t.dataset.path ?? ""
|
|
479
|
+
})
|
|
480
|
+
), t.expanded = !1, t.indeterminate = !1;
|
|
481
|
+
});
|
|
482
|
+
}
|
|
483
|
+
async handleSelectedChange(t) {
|
|
484
|
+
const e = t.target, i = e.dataset.id ?? "", a = e.dataset.path ?? "";
|
|
485
|
+
if (await e.updateComplete, !i.trim() || !a.trim())
|
|
486
|
+
return;
|
|
487
|
+
const s = N({
|
|
488
|
+
id: i,
|
|
489
|
+
path: a
|
|
490
|
+
});
|
|
491
|
+
if (!(e.indeterminate && !e.selected)) {
|
|
492
|
+
if (e.selected) {
|
|
493
|
+
if (!this.currentRootIDsSet.has(s)) {
|
|
494
|
+
lt(e, "multiple"), this.currentRootIDsSet.add(s);
|
|
495
|
+
for (const o of e.getChildrenItems())
|
|
496
|
+
!o.id.trim() || !o.dataset.path?.trim() || this.currentRootIDsSet.add(
|
|
497
|
+
N({
|
|
498
|
+
id: o.id,
|
|
499
|
+
path: o.dataset.path ?? ""
|
|
500
|
+
})
|
|
501
|
+
);
|
|
502
|
+
}
|
|
503
|
+
this.removedIDs = this.removedIDs.filter(
|
|
504
|
+
(o) => o !== s && !S(o).path.startsWith(a + "/")
|
|
505
|
+
);
|
|
506
|
+
} else
|
|
507
|
+
this.removedIDs.push(s), this.currentRootIDsSet.has(s) && (this.currentRootIDsSet.delete(s), lt(e, "multiple"));
|
|
508
|
+
[...this.currentRootIDsSet].forEach((o) => {
|
|
509
|
+
const c = R(a), h = S(o).path, _ = R(h);
|
|
510
|
+
_.startsWith(c) && _ !== c && (e.selected || this.currentRootIDsSet.delete(o));
|
|
511
|
+
}), this.currentRootIDsSet = new Set(this.currentRootIDsSet);
|
|
512
|
+
}
|
|
513
|
+
}
|
|
514
|
+
render() {
|
|
515
|
+
return n`<div class="folder-tree selectable"><cx-tree class=${C({
|
|
516
|
+
selectable: !0
|
|
517
|
+
})} @cx-selected-change=${this.handleSelectedChange} selection="multiple" disabled-auto-expand disabled-sync-checkboxes>${U(
|
|
518
|
+
this.folders,
|
|
519
|
+
(t) => t.id,
|
|
520
|
+
(t) => this.renderFolder(t)
|
|
521
|
+
)}
|
|
522
|
+
${p(
|
|
523
|
+
this.folders && this.folders.length < this.totalCount,
|
|
524
|
+
() => n`<div class="load-more-button"><cx-button variant="text" @click=${this.loadMore} ?loading=${this.isLoading}>${this.localize.term("more")}</cx-button></div>`
|
|
525
|
+
)}</cx-tree></div>`;
|
|
526
|
+
}
|
|
527
|
+
};
|
|
528
|
+
b.styles = [tt, Ae];
|
|
529
|
+
b.dependencies = {
|
|
530
|
+
"cx-folder-item": y,
|
|
531
|
+
"cx-tree": $t
|
|
532
|
+
};
|
|
533
|
+
I([
|
|
534
|
+
z("cx-tree")
|
|
535
|
+
], b.prototype, "tree", 2);
|
|
536
|
+
I([
|
|
537
|
+
d({ attribute: "site-url", reflect: !0, type: String })
|
|
538
|
+
], b.prototype, "siteUrl", 2);
|
|
539
|
+
I([
|
|
540
|
+
d({ attribute: "bearer-token", reflect: !0, type: String })
|
|
541
|
+
], b.prototype, "bearerToken", 2);
|
|
542
|
+
I([
|
|
543
|
+
d({ attribute: "token", reflect: !0, type: String })
|
|
544
|
+
], b.prototype, "token", 2);
|
|
545
|
+
I([
|
|
546
|
+
d({ attribute: "search-text", reflect: !0, type: String })
|
|
547
|
+
], b.prototype, "searchText", 2);
|
|
548
|
+
I([
|
|
549
|
+
d({ type: Array })
|
|
550
|
+
], b.prototype, "folders", 2);
|
|
551
|
+
I([
|
|
552
|
+
d({ attribute: "root-ids", reflect: !0, type: Array })
|
|
553
|
+
], b.prototype, "rootIDs", 2);
|
|
554
|
+
I([
|
|
555
|
+
d({ attribute: "total-count", reflect: !0, type: Number })
|
|
556
|
+
], b.prototype, "totalCount", 2);
|
|
557
|
+
I([
|
|
558
|
+
d({ attribute: "load-more", type: Function })
|
|
559
|
+
], b.prototype, "loadMore", 2);
|
|
560
|
+
I([
|
|
561
|
+
d({ attribute: "is-loading", reflect: !0, type: Boolean })
|
|
562
|
+
], b.prototype, "isLoading", 2);
|
|
563
|
+
I([
|
|
564
|
+
d({ attribute: "folder-paths-set", type: Object })
|
|
565
|
+
], b.prototype, "folderPathsSet", 2);
|
|
566
|
+
I([
|
|
567
|
+
u()
|
|
568
|
+
], b.prototype, "removedIDs", 2);
|
|
569
|
+
I([
|
|
570
|
+
u()
|
|
571
|
+
], b.prototype, "currentRootIDsSet", 2);
|
|
572
|
+
I([
|
|
573
|
+
P("rootIDs")
|
|
574
|
+
], b.prototype, "handleRootIDsChange", 1);
|
|
575
|
+
b = I([
|
|
576
|
+
W("cx-folder-tree")
|
|
577
|
+
], b);
|
|
578
|
+
function Pe(t, e, i) {
|
|
579
|
+
switch (i.length) {
|
|
580
|
+
case 0:
|
|
581
|
+
return t.call(e);
|
|
582
|
+
case 1:
|
|
583
|
+
return t.call(e, i[0]);
|
|
584
|
+
case 2:
|
|
585
|
+
return t.call(e, i[0], i[1]);
|
|
586
|
+
case 3:
|
|
587
|
+
return t.call(e, i[0], i[1], i[2]);
|
|
588
|
+
}
|
|
589
|
+
return t.apply(e, i);
|
|
590
|
+
}
|
|
591
|
+
var _t = Math.max;
|
|
592
|
+
function ze(t, e, i) {
|
|
593
|
+
return e = _t(e === void 0 ? t.length - 1 : e, 0), function() {
|
|
594
|
+
for (var a = arguments, s = -1, o = _t(a.length - e, 0), c = Array(o); ++s < o; )
|
|
595
|
+
c[s] = a[e + s];
|
|
596
|
+
s = -1;
|
|
597
|
+
for (var h = Array(e + 1); ++s < e; )
|
|
598
|
+
h[s] = a[s];
|
|
599
|
+
return h[e] = i(c), Pe(t, this, h);
|
|
600
|
+
};
|
|
601
|
+
}
|
|
602
|
+
function Ee(t) {
|
|
603
|
+
return function() {
|
|
604
|
+
return t;
|
|
605
|
+
};
|
|
606
|
+
}
|
|
607
|
+
var ft = function() {
|
|
608
|
+
try {
|
|
609
|
+
var t = Et(Object, "defineProperty");
|
|
610
|
+
return t({}, "", {}), t;
|
|
611
|
+
} catch {
|
|
612
|
+
}
|
|
613
|
+
}(), Le = ft ? function(t, e) {
|
|
614
|
+
return ft(t, "toString", {
|
|
615
|
+
configurable: !0,
|
|
616
|
+
enumerable: !1,
|
|
617
|
+
value: Ee(e),
|
|
618
|
+
writable: !0
|
|
619
|
+
});
|
|
620
|
+
} : wt, Fe = 800, Ue = 16, Re = Date.now;
|
|
621
|
+
function ke(t) {
|
|
622
|
+
var e = 0, i = 0;
|
|
623
|
+
return function() {
|
|
624
|
+
var a = Re(), s = Ue - (a - i);
|
|
625
|
+
if (i = a, s > 0) {
|
|
626
|
+
if (++e >= Fe)
|
|
627
|
+
return arguments[0];
|
|
628
|
+
} else
|
|
629
|
+
e = 0;
|
|
630
|
+
return t.apply(void 0, arguments);
|
|
631
|
+
};
|
|
632
|
+
}
|
|
633
|
+
var Oe = ke(Le);
|
|
634
|
+
function Ne(t, e) {
|
|
635
|
+
return Oe(ze(t, e, wt), t + "");
|
|
636
|
+
}
|
|
637
|
+
var je = 200;
|
|
638
|
+
function Be(t, e, i, a) {
|
|
639
|
+
var s = -1, o = Bt, c = !0, h = t.length, _ = [], m = e.length;
|
|
640
|
+
if (!h)
|
|
641
|
+
return _;
|
|
642
|
+
i && (e = ee(e, Lt(i))), e.length >= je && (o = Ut, c = !1, e = new Ft(e));
|
|
643
|
+
t:
|
|
644
|
+
for (; ++s < h; ) {
|
|
645
|
+
var g = t[s], $ = i == null ? g : i(g);
|
|
646
|
+
if (g = g !== 0 ? g : 0, c && $ === $) {
|
|
647
|
+
for (var f = m; f--; )
|
|
648
|
+
if (e[f] === $)
|
|
649
|
+
continue t;
|
|
650
|
+
_.push(g);
|
|
651
|
+
} else o(e, $, a) || _.push(g);
|
|
652
|
+
}
|
|
653
|
+
return _;
|
|
654
|
+
}
|
|
655
|
+
var vt = pt ? pt.isConcatSpreadable : void 0;
|
|
656
|
+
function Me(t) {
|
|
657
|
+
return It(t) || Rt(t) || !!(vt && t && t[vt]);
|
|
658
|
+
}
|
|
659
|
+
function Ve(t, e, i, a, s) {
|
|
660
|
+
var o = -1, c = t.length;
|
|
661
|
+
for (i || (i = Me), s || (s = []); ++o < c; ) {
|
|
662
|
+
var h = t[o];
|
|
663
|
+
i(h) ? kt(s, h) : a || (s[s.length] = h);
|
|
664
|
+
}
|
|
665
|
+
return s;
|
|
666
|
+
}
|
|
667
|
+
function He(t, e, i) {
|
|
668
|
+
var a = t.length;
|
|
669
|
+
if (a < 2)
|
|
670
|
+
return a ? dt(t[0]) : [];
|
|
671
|
+
for (var s = -1, o = Array(a); ++s < a; )
|
|
672
|
+
for (var c = t[s], h = -1; ++h < a; )
|
|
673
|
+
h != s && (o[s] = Be(o[s] || c, t[h], e, i));
|
|
674
|
+
return dt(Ve(o), e, i);
|
|
675
|
+
}
|
|
676
|
+
function We(t) {
|
|
677
|
+
return se(t) && St(t);
|
|
678
|
+
}
|
|
679
|
+
var st = Ne(function(t) {
|
|
680
|
+
return He(Ot(t, We));
|
|
681
|
+
}), v = /* @__PURE__ */ ((t) => (t.Canceled = "CANCELED", t.Failed = "FAILED", t.InProgress = "INPROGRESS", t.PendingComplete = "PENDINGCOMPLETE", t.Success = "SUCCESS", t))(v || {}), qe = Object.defineProperty, Ge = Object.getOwnPropertyDescriptor, j = (t, e, i, a) => {
|
|
682
|
+
for (var s = a > 1 ? void 0 : a ? Ge(e, i) : e, o = t.length - 1, c; o >= 0; o--)
|
|
683
|
+
(c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
|
|
684
|
+
return a && s && qe(e, i, s), s;
|
|
685
|
+
};
|
|
686
|
+
let T = class extends H {
|
|
687
|
+
constructor() {
|
|
688
|
+
super(...arguments), this.localize = new q(this), this.size = 0, this.remainingSize = 0, this.childrenCount = 0, this.assetsCount = 0;
|
|
689
|
+
}
|
|
690
|
+
get cachedSize() {
|
|
691
|
+
return Math.max(0, this.size - this.remainingSize);
|
|
692
|
+
}
|
|
693
|
+
get percentage() {
|
|
694
|
+
return this.size ? Math.round(this.cachedSize / this.size * 100) : 0;
|
|
695
|
+
}
|
|
696
|
+
createRenderRoot() {
|
|
697
|
+
return this;
|
|
698
|
+
}
|
|
699
|
+
renderFolderSuccessText() {
|
|
700
|
+
return n`${this.childrenCount} ${this.localize.term("subfolders")},
|
|
701
|
+
${this.assetsCount} ${this.localize.term("assets")}`;
|
|
702
|
+
}
|
|
703
|
+
renderSuccess() {
|
|
704
|
+
return n`<div class="file-on-demand-pinned-status__success progress"><cx-icon name="file_download" variant="filled"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${p(this.isFolder, this.renderFolderSuccessText.bind(this), () => n`${this.localize.term("cached")}`)}</cx-line-clamp></cx-typography></div>`;
|
|
705
|
+
}
|
|
706
|
+
renderFailed() {
|
|
707
|
+
return n`<div class="file-on-demand-pinned-status__failed progress"><cx-icon name="file_download_off" variant="filled"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${this.localize.term("syncFailedCacheFull")}</cx-line-clamp></cx-typography></div>`;
|
|
708
|
+
}
|
|
709
|
+
renderCanceled() {
|
|
710
|
+
return n`<div class="file-on-demand-pinned-status__canceled progress"><cx-icon name="file_download_off" variant="filled"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${this.localize.term("syncCanceled")}</cx-line-clamp></cx-typography></div>`;
|
|
711
|
+
}
|
|
712
|
+
renderInProgress() {
|
|
713
|
+
return n`<div class="file-on-demand-pinned-status__in-progress progress"><cx-icon name="downloading" variant="filled"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${this.localize.term("caching")} ${this.percentage}% (<cx-format-bytes .value=${this.cachedSize}></cx-format-bytes>/
|
|
714
|
+
<cx-format-bytes .value=${this.size}></cx-format-bytes>)
|
|
715
|
+
</cx-line-clamp></cx-typography></div>`;
|
|
716
|
+
}
|
|
717
|
+
render() {
|
|
718
|
+
return n`<div class="file-on-demand-pinned-status">${ne(this.uploadStatus, [
|
|
719
|
+
[v.Success, this.renderSuccess.bind(this)],
|
|
720
|
+
[v.Failed, this.renderFailed.bind(this)],
|
|
721
|
+
[v.InProgress, this.renderInProgress.bind(this)],
|
|
722
|
+
[v.PendingComplete, this.renderInProgress.bind(this)],
|
|
723
|
+
[v.Canceled, this.renderCanceled.bind(this)]
|
|
724
|
+
])}</div>`;
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
T.styles = [tt];
|
|
728
|
+
T.dependencies = {
|
|
729
|
+
"cx-format-bytes": ot,
|
|
730
|
+
"cx-icon": J,
|
|
731
|
+
"cx-line-clamp": Q,
|
|
732
|
+
"cx-typography": nt
|
|
733
|
+
};
|
|
734
|
+
j([
|
|
735
|
+
d({
|
|
736
|
+
attribute: "upload-status",
|
|
737
|
+
type: String
|
|
738
|
+
})
|
|
739
|
+
], T.prototype, "uploadStatus", 2);
|
|
740
|
+
j([
|
|
741
|
+
d({ type: Number })
|
|
742
|
+
], T.prototype, "size", 2);
|
|
743
|
+
j([
|
|
744
|
+
d({
|
|
745
|
+
attribute: "remaining-size",
|
|
746
|
+
type: Number
|
|
747
|
+
})
|
|
748
|
+
], T.prototype, "remainingSize", 2);
|
|
749
|
+
j([
|
|
750
|
+
d({
|
|
751
|
+
attribute: "is-folder",
|
|
752
|
+
type: Boolean
|
|
753
|
+
})
|
|
754
|
+
], T.prototype, "isFolder", 2);
|
|
755
|
+
j([
|
|
756
|
+
d({
|
|
757
|
+
attribute: "children-count",
|
|
758
|
+
type: Number
|
|
759
|
+
})
|
|
760
|
+
], T.prototype, "childrenCount", 2);
|
|
761
|
+
j([
|
|
762
|
+
d({
|
|
763
|
+
attribute: "assets-count",
|
|
764
|
+
type: Number
|
|
765
|
+
})
|
|
766
|
+
], T.prototype, "assetsCount", 2);
|
|
767
|
+
T = j([
|
|
768
|
+
W("cx-file-on-demand-pinned-status")
|
|
769
|
+
], T);
|
|
770
|
+
const Ye = at`:host{padding:var(--cx-spacing-2x-small) var(--cx-spacing-small);display:block}.asset{max-height:var(--asset-height);gap:var(--cx-spacing-small);display:flex}:host(:hover){background-color:var(--cx-input-filled-background-color-hover)}.asset__description{flex-direction:column;flex:1;justify-content:center;width:0;display:flex}.asset__description__label{display:flex}.asset__description__label__text{flex-grow:1;flex-shrink:1;overflow:hidden}.asset__description__status{color:var(--cx-color-neutral-500);line-height:var(--cx-line-height-medium)}.asset__actions{justify-content:flex-end;align-items:center;min-width:64px;display:flex}.asset:hover .asset__actions{visibility:visible;opacity:1}.asset__actions{visibility:hidden;opacity:0}.asset__actions__spinner{min-height:var(--cx-input-height-medium);min-width:var(--cx-input-height-medium);justify-content:center;align-items:center;display:flex}.asset__actions__spinner::part(base){flex-grow:0}.asset__thumbnail{width:56px;height:var(--asset-height);border-radius:var(--cx-border-radius-medium);justify-content:center;align-items:center;display:flex;position:relative}.asset__thumbnail--placeholder{background-color:var(--cx-color-primary-50)}.asset__thumbnail--folder{background-color:var(--cx-color-neutral-100)}.asset__thumbnail__image{object-fit:cover;border-radius:var(--cx-border-radius-medium);flex-shrink:0;width:100%;height:100%}.asset__thumbnail__icon{--font-size:38px;color:var(--cx-color-primary-400);display:none}.asset__folder__icon{--font-size:var(--cx-font-size-x-large);color:var(--cx-color-neutral-600)}.asset__thumbnail__extension{bottom:var(--cx-spacing-3x-small);width:26px;color:var(--cx-color-primary-50);display:none;position:absolute;left:50%;transform:translate(-50%)}.asset__thumbnail__extension__line-clamp{text-align:center;width:100%}.asset__thumbnail__extension__text{text-transform:uppercase;flex-grow:1;flex-shrink:1;display:contents;overflow:hidden}.asset__thumbnail--placeholder .asset__thumbnail__image{display:none}.asset__thumbnail--placeholder .asset__thumbnail__icon,.asset__thumbnail--placeholder .asset__thumbnail__extension{display:flex}cx-progress-bar{--height:4px;--indicator-color:var(--color);--track-color:var(--cx-color-neutral-300);z-index:0}.progress{align-items:center;gap:var(--cx-spacing-2x-small);width:100%;margin-top:var(--cx-spacing-3x-small);display:flex}.syncing-progress,.completed-progress,.failed-progress,.canceled-progress{margin-top:var(--cx-spacing-2x-small)}.progress *{white-space:nowrap}.progress cx-icon{--font-size:var(--cx-font-size-medium)}.progress cx-typography::part(base){line-height:var(--cx-font-size-medium)}.uploading-progress.in-progress cx-icon{color:var(--cx-color-primary-500)}.uploading-progress.paused cx-icon{color:var(--cx-color-warning-500)}.syncing-progress cx-icon{color:var(--cx-color-warning)}.completed-progress cx-icon{color:var(--cx-color-success)}.failed-progress cx-icon,.failed-progress__text{color:var(--cx-color-danger);cursor:help}.canceled-progress cx-icon{color:var(--cx-color-neutral-600)}.file-on-demand-pinned-status__success cx-icon,.file-on-demand-pinned-status__in-progress cx-icon{color:var(--cx-color-success-500)}.file-on-demand-pinned-status__failed cx-icon{color:var(--cx-color-danger-500)}.file-on-demand-pinned-status__canceled cx-icon{color:var(--cx-color-neutral-500)}`;
|
|
771
|
+
var Ke = Object.defineProperty, Xe = Object.getOwnPropertyDescriptor, V = (t, e, i, a) => {
|
|
772
|
+
for (var s = a > 1 ? void 0 : a ? Xe(e, i) : e, o = t.length - 1, c; o >= 0; o--)
|
|
773
|
+
(c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
|
|
774
|
+
return a && s && Ke(e, i, s), s;
|
|
775
|
+
};
|
|
776
|
+
let L = class extends H {
|
|
777
|
+
constructor() {
|
|
778
|
+
super(...arguments), this.localize = new q(this), this.favoriteInProgressAssets = [], this.pinInProgressAssets = [], this.thumbnailLoadError = !1;
|
|
779
|
+
}
|
|
780
|
+
/** Failed or canceled uploads: show open-in-drive and retry. */
|
|
781
|
+
get showRetryableUploadActions() {
|
|
782
|
+
return this.listType === x.PINNED ? !1 : this.asset.uploadStatus === v.Failed || this.asset.uploadStatus === v.Canceled;
|
|
783
|
+
}
|
|
784
|
+
get showInProgressActions() {
|
|
785
|
+
return this.listType === x.PINNED ? !1 : this.asset.uploadStatus === v.InProgress;
|
|
786
|
+
}
|
|
787
|
+
get showNormalActions() {
|
|
788
|
+
return this.listType === x.PINNED ? !1 : [v.Success, v.PendingComplete].includes(
|
|
789
|
+
this.asset.uploadStatus
|
|
790
|
+
) || !this.asset.uploadStatus?.trim();
|
|
791
|
+
}
|
|
792
|
+
get showPinnedActions() {
|
|
793
|
+
return this.listType === x.PINNED;
|
|
794
|
+
}
|
|
795
|
+
get isFolder() {
|
|
796
|
+
return fe.includes((this.asset.docType ?? "").toLowerCase());
|
|
797
|
+
}
|
|
798
|
+
get thumbnailUrl() {
|
|
799
|
+
return this.asset.thumbnail?.trim() ?? "";
|
|
800
|
+
}
|
|
801
|
+
get showThumbnailPlaceholder() {
|
|
802
|
+
return !this.thumbnailUrl || this.thumbnailLoadError;
|
|
803
|
+
}
|
|
804
|
+
willUpdate(t) {
|
|
805
|
+
if (super.willUpdate(t), !t.has("asset"))
|
|
806
|
+
return;
|
|
807
|
+
(t.get("asset")?.thumbnail?.trim() ?? "") !== this.thumbnailUrl && (this.thumbnailLoadError = !1);
|
|
808
|
+
}
|
|
809
|
+
handleImgError() {
|
|
810
|
+
this.thumbnailLoadError = !0;
|
|
811
|
+
}
|
|
812
|
+
handleImgLoad() {
|
|
813
|
+
this.thumbnailLoadError = !1;
|
|
814
|
+
}
|
|
815
|
+
handleOpenDriveClick() {
|
|
816
|
+
this.openDrive(this.asset);
|
|
817
|
+
}
|
|
818
|
+
openDrive(t) {
|
|
819
|
+
this.emit("cx-open-drive", {
|
|
820
|
+
detail: {
|
|
821
|
+
asset: t
|
|
822
|
+
}
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
unmarkFavorite(t) {
|
|
826
|
+
this.emit("cx-unmark-favorite", {
|
|
827
|
+
detail: {
|
|
828
|
+
assetId: t
|
|
829
|
+
}
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
markFavorite(t) {
|
|
833
|
+
this.emit("cx-mark-favorite", {
|
|
834
|
+
detail: {
|
|
835
|
+
assetId: t
|
|
836
|
+
}
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
pinAsset(t) {
|
|
840
|
+
this.emit("cx-file-on-demand-pin", {
|
|
841
|
+
detail: {
|
|
842
|
+
assetId: t
|
|
843
|
+
}
|
|
844
|
+
});
|
|
845
|
+
}
|
|
846
|
+
unpinAsset(t) {
|
|
847
|
+
this.emit("cx-file-on-demand-unpin", {
|
|
848
|
+
detail: {
|
|
849
|
+
assetId: t
|
|
850
|
+
}
|
|
851
|
+
});
|
|
852
|
+
}
|
|
853
|
+
handlePinClick() {
|
|
854
|
+
this.asset.isPinned ? this.unpinAsset(this.asset.recordId) : this.pinAsset(this.asset.recordId);
|
|
855
|
+
}
|
|
856
|
+
handleFavoriteClick() {
|
|
857
|
+
this.asset.isInFavorite ? this.unmarkFavorite(this.asset.recordId) : this.markFavorite(this.asset.recordId);
|
|
858
|
+
}
|
|
859
|
+
retryUpload(t) {
|
|
860
|
+
this.emit("cx-retry-upload", {
|
|
861
|
+
detail: {
|
|
862
|
+
assetId: t
|
|
863
|
+
}
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
handleRetryUploadClick() {
|
|
867
|
+
this.asset.uploadId && this.retryUpload(this.asset.uploadId);
|
|
868
|
+
}
|
|
869
|
+
resumeUpload(t) {
|
|
870
|
+
this.emit("cx-resume-upload", {
|
|
871
|
+
detail: {
|
|
872
|
+
assetId: t
|
|
873
|
+
}
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
pauseUpload(t) {
|
|
877
|
+
this.emit("cx-pause-upload", {
|
|
878
|
+
detail: {
|
|
879
|
+
assetId: t
|
|
880
|
+
}
|
|
881
|
+
});
|
|
882
|
+
}
|
|
883
|
+
cancelUpload(t) {
|
|
884
|
+
this.emit("cx-cancel-upload", {
|
|
885
|
+
detail: {
|
|
886
|
+
assetId: t
|
|
887
|
+
}
|
|
888
|
+
});
|
|
889
|
+
}
|
|
890
|
+
handlePauseUploadClick() {
|
|
891
|
+
this.asset.uploadId && (this.asset.isPaused ? this.resumeUpload(this.asset.uploadId) : this.pauseUpload(this.asset.uploadId));
|
|
892
|
+
}
|
|
893
|
+
handleCancelUploadClick() {
|
|
894
|
+
this.asset.uploadId && this.cancelUpload(this.asset.uploadId);
|
|
895
|
+
}
|
|
896
|
+
renderProgress({
|
|
897
|
+
isPaused: t = !1,
|
|
898
|
+
progress: e = 0,
|
|
899
|
+
remainingTime: i,
|
|
900
|
+
size: a = 0,
|
|
901
|
+
timestamp: s = Date.now(),
|
|
902
|
+
uploadErrorMessage: o,
|
|
903
|
+
uploadStatus: c = v.InProgress
|
|
904
|
+
}) {
|
|
905
|
+
const h = a > 0 ? e * 100 / a : 0, _ = c === v.InProgress ? h : 100, m = n`<div class=${C({
|
|
906
|
+
"in-progress": c === v.InProgress,
|
|
907
|
+
paused: t,
|
|
908
|
+
progress: !0,
|
|
909
|
+
"uploading-progress": !0
|
|
910
|
+
})}>${p(t, () => n`<cx-icon name="pause" variant="filled"></cx-icon>`, () => n`<cx-icon name="arrow_upward"></cx-icon>`)}<cx-typography variant="small"><cx-line-clamp lines="1">${p(t, () => n`${this.localize.term("paused")} ‧`)}<cx-format-bytes .value=${e}></cx-format-bytes>${this.localize.term("of")}<cx-format-bytes .value=${a}></cx-format-bytes>
|
|
911
|
+
(${Math.round(h)}%)
|
|
912
|
+
${p(
|
|
913
|
+
!!i && !t,
|
|
914
|
+
() => n`‧
|
|
915
|
+
<cx-relative-time format="narrow" numeric="always" date=${new Date(Date.now() + (i ?? 0))} sync sync-interval=${O}></cx-relative-time>`
|
|
916
|
+
)}</cx-line-clamp></cx-typography></div>`, g = n`<div class="progress syncing-progress"><cx-icon name="cached"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${this.localize.term("syncing")} ‧
|
|
917
|
+
<cx-relative-time format="narrow" numeric="always" date=${new Date(s)} sync sync-interval=${O}></cx-relative-time></cx-line-clamp></cx-typography></div>`, $ = n`<div class="progress completed-progress"><cx-icon name="check"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${this.localize.term("readyToUse")} ‧
|
|
918
|
+
<cx-relative-time format="narrow" numeric="always" date=${new Date(s)} sync sync-interval=${O}></cx-relative-time></cx-line-clamp></cx-typography></div>`, f = n`<div class="progress failed-progress"><cx-typography variant="small"><cx-line-clamp lines="1"><cx-tooltip content=${o || this.localize.term("uploadFailed")}><span class="failed-progress__text">${this.localize.term("uploadFailed")} ‧
|
|
919
|
+
</span></cx-tooltip><cx-relative-time format="narrow" numeric="always" date=${new Date(s)} sync sync-interval=${O}></cx-relative-time></cx-line-clamp></cx-typography></div>`, F = n`<div class="progress canceled-progress"><cx-icon name="cancel"></cx-icon><cx-typography variant="small"><cx-line-clamp lines="1">${this.localize.term("canceled")} ‧
|
|
920
|
+
<cx-relative-time format="narrow" numeric="always" date=${new Date(s)} sync sync-interval=${O}></cx-relative-time></cx-line-clamp></cx-typography></div>`;
|
|
921
|
+
return n`
|
|
922
|
+
${p(
|
|
923
|
+
c === v.InProgress,
|
|
924
|
+
() => n`<cx-progress-bar style=${oe({
|
|
925
|
+
"--color": t ? "var(--cx-color-warning-500)" : "var(--cx-color-primary-500)"
|
|
926
|
+
})} .value=${_.toFixed(0)} class="progress-bar"></cx-progress-bar>${m}`
|
|
927
|
+
)}
|
|
928
|
+
${p(
|
|
929
|
+
c === v.PendingComplete,
|
|
930
|
+
() => g
|
|
931
|
+
)}
|
|
932
|
+
${p(c === v.Success, () => $)}
|
|
933
|
+
${p(c === v.Failed, () => f)}
|
|
934
|
+
${p(c === v.Canceled, () => F)}
|
|
935
|
+
`;
|
|
936
|
+
}
|
|
937
|
+
renderUploadingStatus() {
|
|
938
|
+
return n`
|
|
939
|
+
${this.renderProgress({
|
|
940
|
+
isPaused: this.asset.isPaused,
|
|
941
|
+
progress: (this.asset.size ?? 0) - (this.asset.remainingSize ?? 0),
|
|
942
|
+
remainingTime: this.asset.remainingTime,
|
|
943
|
+
size: this.asset.size ?? 0,
|
|
944
|
+
timestamp: this.asset.uploadTimestamp,
|
|
945
|
+
uploadErrorMessage: this.asset.uploadErrorMessage,
|
|
946
|
+
uploadStatus: this.asset.uploadStatus
|
|
947
|
+
})}
|
|
948
|
+
`;
|
|
949
|
+
}
|
|
950
|
+
renderPinnedStatus() {
|
|
951
|
+
return n`<cx-file-on-demand-pinned-status size=${this.asset.size ?? 0} remaining-size=${this.asset.remainingSize ?? 0} upload-status=${this.asset.uploadStatus} ?is-folder=${this.isFolder} children-count=${this.asset.childrenCount ?? 0} assets-count=${this.asset.assetsCount ?? 0}></cx-file-on-demand-pinned-status>`;
|
|
952
|
+
}
|
|
953
|
+
renderThumbnailContent() {
|
|
954
|
+
return this.isFolder ? this.listType === x.FAVORITES ? n`<cx-icon class="asset__folder__icon" name="folder_special"></cx-icon>` : n`<cx-icon class="asset__folder__icon" name="topic"></cx-icon>` : n`${p(
|
|
955
|
+
!!this.thumbnailUrl,
|
|
956
|
+
() => n`<img alt=${this.asset.fileName} class="asset__thumbnail__image" src=${this.thumbnailUrl} @error=${this.handleImgError} @load=${this.handleImgLoad}>`
|
|
957
|
+
)}<cx-icon class="asset__thumbnail__icon" name="insert_drive_file" variant="filled"></cx-icon><div class="asset__thumbnail__extension"><cx-line-clamp class="asset__thumbnail__extension__line-clamp" lines="1"><cx-typography class="asset__thumbnail__extension__text" variant="small">${be(this.asset.fileName)}</cx-typography></cx-line-clamp></div>`;
|
|
958
|
+
}
|
|
959
|
+
renderThumbnail() {
|
|
960
|
+
return n`<div class=${C({
|
|
961
|
+
asset__thumbnail: !0,
|
|
962
|
+
"asset__thumbnail--folder": this.isFolder,
|
|
963
|
+
"asset__thumbnail--placeholder": this.showThumbnailPlaceholder
|
|
964
|
+
})}>${this.renderThumbnailContent()}</div>`;
|
|
965
|
+
}
|
|
966
|
+
renderOpenDriveButton() {
|
|
967
|
+
return n`<cx-tooltip content=${this.localize.term("openInDrive")} hoist><cx-icon-button data-testid="asset__drive-button" name="folder_open" @click=${this.handleOpenDriveClick}></cx-icon-button></cx-tooltip>`;
|
|
968
|
+
}
|
|
969
|
+
renderNormalActions() {
|
|
970
|
+
return n`${this.renderOpenDriveButton()}
|
|
971
|
+
${p(
|
|
972
|
+
this.favoriteInProgressAssets.includes(this.asset.recordId),
|
|
973
|
+
() => n`<cx-spinner class="asset__actions__spinner"></cx-spinner>`,
|
|
974
|
+
() => n`<cx-tooltip content=${this.asset.isInFavorite ? this.localize.term("unfavorite") : this.localize.term("favorite")} hoist><cx-icon-button data-testid="asset__favorite-button" name="star" variant=${this.asset.isInFavorite ? "filled" : "outlined"} @click=${this.handleFavoriteClick}></cx-icon-button></cx-tooltip>`
|
|
975
|
+
)} `;
|
|
976
|
+
}
|
|
977
|
+
renderRetryableUploadActions() {
|
|
978
|
+
return n`${this.renderOpenDriveButton()}<cx-tooltip content=${this.localize.term("retry")} hoist><cx-icon-button data-testid="asset__retry-button" name="refresh" @click=${this.handleRetryUploadClick}></cx-icon-button></cx-tooltip>`;
|
|
979
|
+
}
|
|
980
|
+
renderInProgressActions() {
|
|
981
|
+
return n`<cx-tooltip content=${this.asset.isPaused ? this.localize.term("resume") : this.localize.term("pause")} hoist><cx-icon-button data-testid=${this.asset.isPaused ? "asset__resume-button" : "asset__pause-button"} name=${this.asset.isPaused ? "play_arrow" : "pause"} variant="filled" @click=${this.handlePauseUploadClick}></cx-icon-button></cx-tooltip><cx-tooltip content=${this.localize.term("cancel")} hoist><cx-icon-button data-testid="asset__cancel-button" name="close" @click=${this.handleCancelUploadClick}></cx-icon-button></cx-tooltip>`;
|
|
982
|
+
}
|
|
983
|
+
renderPinnedActions() {
|
|
984
|
+
return n`${p(
|
|
985
|
+
this.pinInProgressAssets.includes(this.asset.recordId),
|
|
986
|
+
() => n`<cx-spinner class="asset__actions__spinner"></cx-spinner>`,
|
|
987
|
+
() => n`<cx-tooltip content=${this.asset.isPinned ? this.localize.term("unpin") : this.localize.term("pin")} hoist><cx-icon-button data-testid="asset__pin-button" name="keep" variant=${this.asset.isPinned ? "filled" : "outlined"} @click=${this.handlePinClick}></cx-icon-button></cx-tooltip>`
|
|
988
|
+
)} `;
|
|
989
|
+
}
|
|
990
|
+
render() {
|
|
991
|
+
return n`<div data-id=${this.asset.recordId} data-testid=${`asset-${this.asset.uploadStatus}`} class="asset">${this.renderThumbnail()}<div class="asset__description"><div class="asset__description__label"><cx-line-clamp class="asset__description__label__text" lines="1"><cx-typography variant="body3">${this.asset.fileName}</cx-typography></cx-line-clamp></div><div class="asset__description__status">${p(
|
|
992
|
+
this.listType === x.RECENT,
|
|
993
|
+
() => n`<cx-typography variant="small" class="asset__description__status__time"><cx-relative-time format="narrow" numeric="always" date=${new Date(this.asset.uploadTimestamp)} sync sync-interval=${O}></cx-relative-time></cx-typography>`
|
|
994
|
+
)}
|
|
995
|
+
${p(
|
|
996
|
+
this.listType === x.UPLOADS,
|
|
997
|
+
() => this.renderUploadingStatus()
|
|
998
|
+
)}
|
|
999
|
+
${p(
|
|
1000
|
+
this.listType === x.PINNED,
|
|
1001
|
+
() => this.renderPinnedStatus()
|
|
1002
|
+
)}</div></div><div class="asset__actions">${p(this.showNormalActions, () => this.renderNormalActions())}
|
|
1003
|
+
${p(
|
|
1004
|
+
this.showInProgressActions,
|
|
1005
|
+
() => this.renderInProgressActions()
|
|
1006
|
+
)}
|
|
1007
|
+
${p(
|
|
1008
|
+
this.showRetryableUploadActions,
|
|
1009
|
+
() => this.renderRetryableUploadActions()
|
|
1010
|
+
)}
|
|
1011
|
+
${p(this.showPinnedActions, () => this.renderPinnedActions())}</div></div>`;
|
|
1012
|
+
}
|
|
1013
|
+
};
|
|
1014
|
+
L.styles = [tt, Ye];
|
|
1015
|
+
L.dependencies = {
|
|
1016
|
+
"cx-file-on-demand-pinned-status": T,
|
|
1017
|
+
"cx-format-bytes": ot,
|
|
1018
|
+
"cx-icon": J,
|
|
1019
|
+
"cx-icon-button": Ct,
|
|
1020
|
+
"cx-line-clamp": Q,
|
|
1021
|
+
"cx-progress-bar": ie,
|
|
1022
|
+
"cx-relative-time": At,
|
|
1023
|
+
"cx-spinner": ae,
|
|
1024
|
+
"cx-tooltip": Dt,
|
|
1025
|
+
"cx-typography": nt
|
|
1026
|
+
};
|
|
1027
|
+
V([
|
|
1028
|
+
d({ type: Object })
|
|
1029
|
+
], L.prototype, "asset", 2);
|
|
1030
|
+
V([
|
|
1031
|
+
d({
|
|
1032
|
+
attribute: "list-type",
|
|
1033
|
+
type: String
|
|
1034
|
+
})
|
|
1035
|
+
], L.prototype, "listType", 2);
|
|
1036
|
+
V([
|
|
1037
|
+
d({
|
|
1038
|
+
attribute: "favorite-in-progress-assets",
|
|
1039
|
+
converter: {
|
|
1040
|
+
fromAttribute: (t) => t.split(" ").filter(Boolean),
|
|
1041
|
+
toAttribute: (t) => t.join(" ")
|
|
1042
|
+
},
|
|
1043
|
+
type: String
|
|
1044
|
+
})
|
|
1045
|
+
], L.prototype, "favoriteInProgressAssets", 2);
|
|
1046
|
+
V([
|
|
1047
|
+
d({
|
|
1048
|
+
attribute: "pin-in-progress-assets",
|
|
1049
|
+
converter: {
|
|
1050
|
+
fromAttribute: (t) => t.split(" ").filter(Boolean),
|
|
1051
|
+
toAttribute: (t) => t.join(" ")
|
|
1052
|
+
},
|
|
1053
|
+
type: String
|
|
1054
|
+
})
|
|
1055
|
+
], L.prototype, "pinInProgressAssets", 2);
|
|
1056
|
+
V([
|
|
1057
|
+
u()
|
|
1058
|
+
], L.prototype, "thumbnailLoadError", 2);
|
|
1059
|
+
L = V([
|
|
1060
|
+
W("cx-file-on-demand-asset")
|
|
1061
|
+
], L);
|
|
1062
|
+
const Ze = at`:host{--asset-height:40px;color:var(--cx-color-neutral-900);--cx-button-text-transform:none;--tooltip-max-width:min(80vw, 640px);height:100%;display:block}.container{height:100%;display:block}.container--user-interaction-blocked{pointer-events:none;user-select:none}.loading-overlay{background-color:var(--cx-color-neutral-50);opacity:.8;width:100%;height:100%;z-index:var(--cx-z-index-tooltip);justify-content:center;align-items:center;display:flex;position:absolute;top:0;left:0}.assets,.welcome{flex-direction:column;height:100%;display:flex}.assets-list__tab-group .empty-icon{color:var(--cx-color-neutral-600);font-size:var(--cx-font-size-3x-large)}cx-tab{line-height:var(--cx-line-height-large)}.assets-list__tab-group cx-tab{width:25%}.settings__tab-group cx-tab{width:50%}cx-tab::part(base){justify-content:center;display:flex}cx-tab::part(label){text-align:center}cx-tab-panel{--padding:0 0 var(--cx-spacing-x-small) 0}cx-icon[slot=prefix]{font-size:var(--cx-font-size-large)}.error-message{color:var(--cx-color-danger);min-height:1ch}.welcome{padding:var(--cx-spacing-x-large) var(--cx-spacing-medium) var(--cx-spacing-medium) var(--cx-spacing-medium);justify-content:center;align-items:center;gap:var(--cx-spacing-x-large)}.welcome__message{justify-content:center;align-items:center;gap:var(--cx-spacing-x-small);flex-direction:column;display:flex}.welcome__actions{justify-content:center;gap:var(--cx-spacing-x-small);flex-direction:column;width:100%;display:flex}.welcome__connect-button,.welcome__cancel-connection-button,.welcome__input{width:100%}.welcome__connect-button--disabled::part(base){cursor:help}.welcome .error-message{text-align:center}.header{background-color:var(--cx-color-neutral-50);padding:var(--cx-spacing-x-small) var(--cx-spacing-small);justify-content:space-between;line-height:1;display:flex}.header__user{align-items:center;gap:var(--cx-spacing-x-small);display:flex;overflow:hidden}.header__username{display:flex;overflow:hidden}.header__username__text{flex-grow:1;flex-shrink:1;overflow:hidden}.header__avatar{--size:24px}.header__actions{min-width:fit-content}.settings__version__badge::part(base){width:var(--cx-spacing-x-small);padding:0}.assets-list{flex:1;height:0}.assets-list__tab-group,.assets-list__tab-group::part(base),.assets-list__tab-group::part(body),.assets-list__tab-group cx-tab-panel,.assets-list__tab-group cx-tab-panel::part(base){height:100%;overflow:hidden}.assets-list__tab-group .assets-list__tab-group__empty-message{justify-content:center;align-items:center;gap:var(--cx-spacing-medium);font-size:var(--cx-font-size-x-large);padding:var(--cx-spacing-large) 0;text-align:center;flex-direction:column;display:flex}.assets-list__tab-group .assets-list__tab-group__empty-message:not(.favorites-empty){margin-top:40px}.assets-list__tab-group .recent__list,.assets-list__tab-group .favorites__list,.assets-list__tab-group .uploads__list,.assets-list__tab-group .pinned__list{height:100%;padding:0 0 var(--cx-spacing-x-small) 0;flex-direction:column;display:flex;overflow:hidden auto}.favorites-tab-panel__content,.pinned-tab-panel__content{flex-direction:column;height:100%;display:flex}.favorites__sync-time{justify-content:center;align-items:center;display:flex}.assets-list__tab-group .favorites__list,.assets-list__tab-group .pinned__list{flex:1;height:0}.recent__other.empty,.uploads__other.empty,.recent__today.empty,.uploads__today.empty{display:none}.status-footer{padding:0 var(--cx-spacing-small) var(--cx-spacing-small) var(--cx-spacing-small);gap:var(--cx-spacing-2x-small);flex-direction:column;display:flex}.status-footer cx-typography,.status-footer cx-line-clamp{line-height:1}.status-footer .cache-usage,.status-footer .connected-url,.status-footer .connection-status,.status-footer .asset-index-sync-status{justify-content:space-between;align-items:center;display:flex}.status-footer .label{color:var(--cx-color-neutral-600)}.status-footer__divider{--spacing:0;margin-bottom:var(--cx-spacing-small)}.connected-url .label{white-space:nowrap}.connected-url .value-line-clamp{padding:0 var(--cx-spacing-2x-small)}.connected-url .value::part(base){font-weight:var(--cx-font-weight-medium);color:var(--cx-color-neutral-900)}.cache-usage__warning-icon{color:var(--cx-color-warning-500)}.status-footer .cache-usage .label{color:var(--cx-color-primary-600)}.connection-status__value{justify-content:center;align-items:center;gap:var(--cx-spacing-2x-small);cursor:help;display:flex}.connection-status__value cx-typography{display:inline-flex}.connection-status__value cx-typography::part(base){text-transform:capitalize;font-weight:var(--cx-font-weight-medium)}.connection-status--excellent .connection-status__value{color:var(--cx-color-success)}.connection-status--good .connection-status__value{color:var(--cx-color-warning)}.connection-status--bad .connection-status__value{color:var(--cx-color-danger)}.connection-status cx-icon{font-size:var(--cx-font-size-medium)}.asset-index-sync-status .value{justify-content:center;align-items:center;gap:var(--cx-spacing-2x-small);display:flex}.asset-index-sync-status .value cx-typography{display:inline-flex}.asset-index-sync-status .value cx-typography::part(base){text-transform:capitalize;font-weight:var(--cx-font-weight-medium)}.asset-index-sync-status--loaded .value{color:var(--cx-color-success)}.asset-index-sync-status--loading .value{color:var(--cx-color-warning)}.asset-index-sync-status--error .value{color:var(--cx-color-danger)}.asset-index-sync-status cx-icon{font-size:var(--cx-font-size-medium)}.uploads__list .asset-group__label{justify-content:space-between;align-items:center;display:flex}.asset-group__clear-button::part(base){color:var(--cx-color-primary-500);font-size:var(--cx-font-size-x-small)}.asset-group__label{padding:var(--cx-spacing-x-small) var(--cx-spacing-small);color:var(--cx-color-neutral-400);line-height:var(--cx-line-height-large)}.settings{height:100%}.settings .error-message{text-align:center}.settings__form{flex-direction:column;height:100%;display:flex}.settings__tab-group{flex:1;height:0}.settings__tab-group::part(base),.settings__tab-group::part(body){height:100%;overflow:hidden}.settings__tab-group cx-tab-panel{padding:var(--cx-spacing-medium) var(--cx-spacing-large) var(--cx-spacing-large) var(--cx-spacing-large);height:100%;overflow-y:auto}.settings-group{gap:var(--cx-spacing-x-small);flex-direction:column;display:flex}.settings__general,.settings__advanced{gap:calc(var(--cx-spacing-small) * 2);flex-direction:column;display:flex}.settings__footer{border-top:1px solid var(--cx-color-neutral-200);padding:var(--cx-spacing-x-small) var(--cx-spacing-small);justify-content:flex-end;display:flex}.settings__footer__actions{gap:var(--cx-spacing-x-small);display:flex}.settings__connection-url{justify-content:space-between;display:flex}.settings__connection-url__value{padding:0 var(--cx-spacing-small);flex-grow:1;flex-shrink:1;overflow:hidden}.settings__software__version{gap:var(--cx-spacing-small);flex-direction:column;display:flex}.settings__software__version__value{justify-content:space-between;align-items:center;gap:var(--cx-spacing-2x-small);display:flex}.settings__software__version__value__text{flex-grow:1;flex-shrink:1;overflow:hidden}.settings__software__version__install-button{flex-shrink:0}.settings__about{text-align:center;color:var(--cx-color-neutral-500)}.settings__disconnect-button{width:100%}.settings__disconnect-button::part(base),.settings__disconnect-button cx-icon{color:var(--cx-color-danger)}.settings__cache__size{gap:var(--cx-spacing-x-small);flex-direction:column;justify-content:center;display:flex}.settings__cache__size cx-input{width:150px}.settings__cache__location{gap:var(--cx-spacing-small);flex-direction:column;display:flex}.settings__cache__location__label,.settings__cache__size__label{--color:var(--cx-color-neutral-600)}.settings__cache__location__value{justify-content:space-between;align-items:center;display:flex}.settings__cache__location__value__text{padding:0 var(--cx-spacing-small);flex-grow:1;flex-shrink:1;overflow:hidden}.settings__cache__location__actions{flex-wrap:nowrap}.settings__cache__location__change-button{flex-shrink:0}cx-tree-item:not(.selectable){--selected-color:var(--cx-color-neutral-700)}cx-tree-item:not(:hover):not(.selectable)::part(item){background-color:unset;color:var(--cx-color-neutral-700)}.folder-tree{flex:1;overflow:auto}.folder-tree:not(.selectable){max-height:200px}.folder-tree__item::part(label){width:100%;overflow:hidden}.folder-tree__icon{font-size:var(--cx-font-size-large);color:var(--cx-color-neutral-600)}.folder-tree__label{gap:var(--cx-spacing-x-small);width:100%;line-height:var(--cx-line-height-medium);display:flex;overflow:hidden}.folder-tree__label__value{flex-grow:1;flex-shrink:1;overflow:hidden}.select-folders-popup::part(body){gap:var(--cx-spacing-medium);flex-direction:column;display:flex;overflow:hidden}.select-folders-popup .selectable-folder-tree{flex:1;overflow:auto}.select-folders-popup__actions{justify-content:flex-end;display:flex}`;
|
|
1063
|
+
var Je = Object.defineProperty, Qe = Object.getOwnPropertyDescriptor, l = (t, e, i, a) => {
|
|
1064
|
+
for (var s = a > 1 ? void 0 : a ? Qe(e, i) : e, o = t.length - 1, c; o >= 0; o--)
|
|
1065
|
+
(c = t[o]) && (s = (a ? c(e, i, s) : c(s)) || s);
|
|
1066
|
+
return a && s && Je(e, i, s), s;
|
|
1067
|
+
};
|
|
1068
|
+
let r = class extends H {
|
|
1069
|
+
constructor() {
|
|
1070
|
+
super(...arguments), this.localize = new q(this), this.connectionEstablished = !1, this.connectionStatus = "excellent", this.connectionStatusTooltip = "", this.assetIndexSyncStatus = "loading", this.userAvatarUrl = "", this.username = "", this.recentAssets = { assets: [], hasMore: !1 }, this.favoriteAssets = { assets: [], hasMore: !1 }, this.favoritesLastSync = Date.now(), this.favoriteInProgressAssets = [], this.pinInProgressAssets = [], this.uploadingAssets = { assets: [], hasMore: !1 }, this.pinnedAssets = { assets: [], hasMore: !1 }, this.availableFolderIdentifiers = [], this.isLoading = !1, this.settings = {
|
|
1071
|
+
cacheLocation: "Default",
|
|
1072
|
+
cacheSize: 0,
|
|
1073
|
+
cacheUsage: 0,
|
|
1074
|
+
config: {
|
|
1075
|
+
latestVersion: "",
|
|
1076
|
+
monitoringActivated: !1,
|
|
1077
|
+
mountPoint: "",
|
|
1078
|
+
mountProxy: !1,
|
|
1079
|
+
proxyTypes: [],
|
|
1080
|
+
rootIDs: [],
|
|
1081
|
+
siteUrl: "",
|
|
1082
|
+
version: ""
|
|
1083
|
+
// unlimitedDownloadRate: false,
|
|
1084
|
+
// unlimitedUploadRate: false,
|
|
1085
|
+
// maxDownloadRate: 0,
|
|
1086
|
+
// maxUploadRate: 0,
|
|
1087
|
+
}
|
|
1088
|
+
}, this.pickCacheLocation = async () => "Default", this.hasNewVersion = !1, this.aboutContent = "", this.token = "", this.userInteractionBlocked = !1, this.isConnecting = !1, this.isCancellingConnection = !1, this.isDisconnecting = !1, this.isUpgrading = !1, this.isSettingsOpened = !1, this.rootIDs = this.settings.config.rootIDs, this._activeFoldersMode = this.rootIDs.length > 0, this.removedIds = [], this.cacheSize = et({
|
|
1089
|
+
decimals: 2,
|
|
1090
|
+
inputUnit: "B",
|
|
1091
|
+
targetUnit: Z,
|
|
1092
|
+
value: this.settings.cacheSize ?? 0
|
|
1093
|
+
}), this.cacheLocation = this.settings.cacheLocation, this.proxyTypes = this.settings.config.proxyTypes ?? [], this.siteUrl = this.settings.config.siteUrl, this.isRecentAssetsLoading = !1, this.isFavoriteAssetsLoading = !1, this.isUploadingAssetsLoading = !1, this.isPinnedAssetsLoading = !1, this.connectError = "", this.disconnectError = "", this.upgradeError = "", this.totalCount = 0, this.folderPathsSet = /* @__PURE__ */ new Set(), this.validConnectionUrl = !1, this.isAddingRootIDs = !1, this.fetchFolders = async ({
|
|
1094
|
+
excludes: t = [],
|
|
1095
|
+
folderId: e,
|
|
1096
|
+
folderPathsSet: i,
|
|
1097
|
+
limit: a = void 0,
|
|
1098
|
+
start: s = 0
|
|
1099
|
+
}) => {
|
|
1100
|
+
try {
|
|
1101
|
+
return await Tt({
|
|
1102
|
+
excludes: t,
|
|
1103
|
+
folderId: e,
|
|
1104
|
+
folderPathsSet: i,
|
|
1105
|
+
limit: a,
|
|
1106
|
+
searchText: this.searchText,
|
|
1107
|
+
siteUrl: this.settings.config.siteUrl,
|
|
1108
|
+
start: s,
|
|
1109
|
+
token: this.token
|
|
1110
|
+
});
|
|
1111
|
+
} catch (o) {
|
|
1112
|
+
o instanceof Error && o.message === "Failed to fetch" && this.emit("cx-renew-token");
|
|
1113
|
+
}
|
|
1114
|
+
return {
|
|
1115
|
+
data: this.availableFolderIdentifiers,
|
|
1116
|
+
totalCount: this.availableFolderIdentifiers.length
|
|
1117
|
+
};
|
|
1118
|
+
}, this.searchText = "", this.loadMore = async () => {
|
|
1119
|
+
const t = this.availableFolderIdentifiers?.length ?? 0;
|
|
1120
|
+
if (t >= this.totalCount)
|
|
1121
|
+
return;
|
|
1122
|
+
this.isLoading = !0;
|
|
1123
|
+
const { data: e, totalCount: i } = await this.fetchFolders({
|
|
1124
|
+
folderId: "",
|
|
1125
|
+
folderPathsSet: this.folderPathsSet,
|
|
1126
|
+
start: t
|
|
1127
|
+
});
|
|
1128
|
+
this.availableFolderIdentifiers = [
|
|
1129
|
+
...this.availableFolderIdentifiers ?? [],
|
|
1130
|
+
...e
|
|
1131
|
+
], this.totalCount = i, this.isLoading = !1;
|
|
1132
|
+
};
|
|
1133
|
+
}
|
|
1134
|
+
connectedCallback() {
|
|
1135
|
+
super.connectedCallback();
|
|
1136
|
+
}
|
|
1137
|
+
runFirstUpdated() {
|
|
1138
|
+
this.settings.config.siteUrl && this.connect();
|
|
1139
|
+
}
|
|
1140
|
+
fetchData() {
|
|
1141
|
+
if (!this.connectionEstablished) {
|
|
1142
|
+
this.validConnectionUrl = K(this.settings.config.siteUrl);
|
|
1143
|
+
return;
|
|
1144
|
+
}
|
|
1145
|
+
this.folderPathsSet = /* @__PURE__ */ new Set(), this.fetchFolders({
|
|
1146
|
+
folderId: "",
|
|
1147
|
+
folderPathsSet: this.folderPathsSet
|
|
1148
|
+
}).then((t) => {
|
|
1149
|
+
this.availableFolderIdentifiers = t.data, this.totalCount = t.totalCount;
|
|
1150
|
+
});
|
|
1151
|
+
}
|
|
1152
|
+
// set recent tab as active when connection is established
|
|
1153
|
+
async showRecentTab() {
|
|
1154
|
+
this.connectionEstablished && (await this.updateComplete, await this.assetsListTabGroup?.updateComplete, this.assetsListTabGroup?.show(x.RECENT));
|
|
1155
|
+
}
|
|
1156
|
+
updateSettingsStates() {
|
|
1157
|
+
this._activeFoldersMode = this.settings.config.rootIDs?.length > 0, this.rootIDs = this.settings.config.rootIDs ?? [], this.cacheSize = et({
|
|
1158
|
+
decimals: 2,
|
|
1159
|
+
inputUnit: "B",
|
|
1160
|
+
targetUnit: Z,
|
|
1161
|
+
value: this.settings.cacheSize ?? 0
|
|
1162
|
+
}), this.cacheLocation = this.settings.cacheLocation ?? "Default", this.proxyTypes = this.settings.config.proxyTypes ?? [], this.siteUrl = this.settings.config.siteUrl ?? "", this.validConnectionUrl = K(this.settings.config.siteUrl);
|
|
1163
|
+
}
|
|
1164
|
+
get formHasChanges() {
|
|
1165
|
+
return this.settings.cacheSize !== this.cacheSize || this.settings.cacheLocation !== this.cacheLocation || !!st(this.settings.config.proxyTypes, this.proxyTypes).length || !!st(this.settings.config.rootIDs, this.rootIDs).length;
|
|
1166
|
+
}
|
|
1167
|
+
connect(t = null) {
|
|
1168
|
+
if (t?.preventDefault(), this.connectError = "", !this.siteUrl?.trim())
|
|
1169
|
+
return;
|
|
1170
|
+
const e = ht(this.siteUrl);
|
|
1171
|
+
if (!K(e)) {
|
|
1172
|
+
this.connectError = this.localize.term("pleaseEnterAValidUrl");
|
|
1173
|
+
return;
|
|
1174
|
+
}
|
|
1175
|
+
this.settings.config.siteUrl = e, this.emit("cx-connect", {
|
|
1176
|
+
detail: {
|
|
1177
|
+
connectionUrl: this.settings.config.siteUrl
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
cancelConnection() {
|
|
1182
|
+
this.emit("cx-cancel-connection", {
|
|
1183
|
+
detail: {
|
|
1184
|
+
connectionUrl: this.settings.config.siteUrl
|
|
1185
|
+
}
|
|
1186
|
+
});
|
|
1187
|
+
}
|
|
1188
|
+
disconnect() {
|
|
1189
|
+
this.emit("cx-disconnect", {
|
|
1190
|
+
detail: {
|
|
1191
|
+
connectionUrl: this.settings.config.siteUrl
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1195
|
+
upgrade() {
|
|
1196
|
+
this.emit("cx-upgrade");
|
|
1197
|
+
}
|
|
1198
|
+
clearCache() {
|
|
1199
|
+
this.emit("cx-clear-cache");
|
|
1200
|
+
}
|
|
1201
|
+
importSettings() {
|
|
1202
|
+
this.emit("cx-import-settings");
|
|
1203
|
+
}
|
|
1204
|
+
exportSettings() {
|
|
1205
|
+
this.emit("cx-export-settings");
|
|
1206
|
+
}
|
|
1207
|
+
viewLogs(t = "") {
|
|
1208
|
+
this.emit("cx-view-logs", {
|
|
1209
|
+
detail: {
|
|
1210
|
+
assetId: t
|
|
1211
|
+
}
|
|
1212
|
+
});
|
|
1213
|
+
}
|
|
1214
|
+
clearUpload() {
|
|
1215
|
+
this.emit("cx-clear-upload");
|
|
1216
|
+
}
|
|
1217
|
+
saveSettings() {
|
|
1218
|
+
this.emit("cx-save-settings", {
|
|
1219
|
+
detail: {
|
|
1220
|
+
settings: {
|
|
1221
|
+
cacheLocation: this.cacheLocation,
|
|
1222
|
+
cacheSize: et({
|
|
1223
|
+
decimals: 2,
|
|
1224
|
+
inputUnit: Z,
|
|
1225
|
+
targetUnit: "B",
|
|
1226
|
+
value: this.cacheSize
|
|
1227
|
+
}),
|
|
1228
|
+
cacheUsage: this.settings.cacheUsage,
|
|
1229
|
+
config: {
|
|
1230
|
+
latestVersion: this.settings.config.latestVersion,
|
|
1231
|
+
monitoringActivated: this.settings.config.monitoringActivated,
|
|
1232
|
+
mountPoint: this.settings.config.mountPoint,
|
|
1233
|
+
mountProxy: this.settings.config.mountProxy,
|
|
1234
|
+
proxyTypes: this.proxyTypes,
|
|
1235
|
+
rootIDs: this.rootIDs.filter(
|
|
1236
|
+
(t) => !this.removedIds.includes(t)
|
|
1237
|
+
),
|
|
1238
|
+
siteUrl: this.settings.config.siteUrl,
|
|
1239
|
+
version: this.settings.config.version
|
|
1240
|
+
// maxDownloadRate: this._maxDownloadRate,
|
|
1241
|
+
// maxUploadRate: this._maxUploadRate,
|
|
1242
|
+
// unlimitedDownloadRate: this._unlimitedDownloadRate,
|
|
1243
|
+
// unlimitedUploadRate: this._unlimitedUploadRate,
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1249
|
+
openSearch() {
|
|
1250
|
+
this.emit("cx-open-search");
|
|
1251
|
+
}
|
|
1252
|
+
openDrive(t) {
|
|
1253
|
+
this.emit("cx-open-drive", {
|
|
1254
|
+
detail: {
|
|
1255
|
+
asset: t
|
|
1256
|
+
}
|
|
1257
|
+
});
|
|
1258
|
+
}
|
|
1259
|
+
openCacheLocation() {
|
|
1260
|
+
this.emit("cx-open-cache-location");
|
|
1261
|
+
}
|
|
1262
|
+
hideSettings() {
|
|
1263
|
+
this.isSettingsOpened = !1, this.isDisconnecting = !1, this.disconnectError = "", this.isUpgrading = !1, this.upgradeError = "", this.updateSettingsStates();
|
|
1264
|
+
}
|
|
1265
|
+
showSettings() {
|
|
1266
|
+
this.isSettingsOpened = !0;
|
|
1267
|
+
}
|
|
1268
|
+
requestMoreRecentAssets() {
|
|
1269
|
+
if (!this.recentAssetsList)
|
|
1270
|
+
return;
|
|
1271
|
+
const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.recentAssetsList;
|
|
1272
|
+
!this.isRecentAssetsLoading && this.recentAssets.hasMore && i + t >= e - X && (this.isRecentAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
|
|
1273
|
+
detail: {
|
|
1274
|
+
type: "recent"
|
|
1275
|
+
}
|
|
1276
|
+
}));
|
|
1277
|
+
}
|
|
1278
|
+
onRecentAssetsChanged() {
|
|
1279
|
+
this.isRecentAssetsLoading = !1;
|
|
1280
|
+
}
|
|
1281
|
+
requestMoreFavoriteAssets() {
|
|
1282
|
+
if (!this.favoritesAssetsList)
|
|
1283
|
+
return;
|
|
1284
|
+
const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.favoritesAssetsList;
|
|
1285
|
+
!this.isFavoriteAssetsLoading && this.favoriteAssets.hasMore && i + t >= e - X && (this.isFavoriteAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
|
|
1286
|
+
detail: {
|
|
1287
|
+
type: "favorites"
|
|
1288
|
+
}
|
|
1289
|
+
}));
|
|
1290
|
+
}
|
|
1291
|
+
requestMorePinnedAssets() {
|
|
1292
|
+
if (!this.pinnedAssetsList)
|
|
1293
|
+
return;
|
|
1294
|
+
const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.pinnedAssetsList;
|
|
1295
|
+
!this.isPinnedAssetsLoading && this.pinnedAssets.hasMore && i + t >= e - X && (this.isPinnedAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
|
|
1296
|
+
detail: {
|
|
1297
|
+
type: "pinned"
|
|
1298
|
+
}
|
|
1299
|
+
}));
|
|
1300
|
+
}
|
|
1301
|
+
onPinnedAssetsChanged() {
|
|
1302
|
+
this.isPinnedAssetsLoading = !1;
|
|
1303
|
+
}
|
|
1304
|
+
onFavoriteAssetsChanged() {
|
|
1305
|
+
this.isFavoriteAssetsLoading = !1;
|
|
1306
|
+
}
|
|
1307
|
+
requestMoreUploadingAssets() {
|
|
1308
|
+
if (!this.uploadsAssetsList)
|
|
1309
|
+
return;
|
|
1310
|
+
const { clientHeight: t, scrollHeight: e, scrollTop: i } = this.uploadsAssetsList;
|
|
1311
|
+
!this.isUploadingAssetsLoading && this.uploadingAssets.hasMore && i + t >= e - X && (this.isUploadingAssetsLoading = !0, this.emit("cx-file-on-demand-load-more", {
|
|
1312
|
+
detail: {
|
|
1313
|
+
type: "uploads"
|
|
1314
|
+
}
|
|
1315
|
+
}));
|
|
1316
|
+
}
|
|
1317
|
+
onUploadingAssetsChanged() {
|
|
1318
|
+
this.isUploadingAssetsLoading = !1;
|
|
1319
|
+
}
|
|
1320
|
+
async updateActiveFolderIdentifiers(t) {
|
|
1321
|
+
const e = this.rootIDs;
|
|
1322
|
+
this.rootIDs = t, await this.updateComplete;
|
|
1323
|
+
const i = this.container.querySelectorAll("cx-tree-item"), a = st(this.rootIDs, e);
|
|
1324
|
+
i.forEach((s) => {
|
|
1325
|
+
a.includes(s.dataset.id ?? "") && bt(s);
|
|
1326
|
+
});
|
|
1327
|
+
}
|
|
1328
|
+
// #region Render
|
|
1329
|
+
renderHeader() {
|
|
1330
|
+
const t = () => {
|
|
1331
|
+
this.openDrive();
|
|
1332
|
+
};
|
|
1333
|
+
return n`<div class="header"><div class="header__user"><cx-avatar class="header__avatar" image=${this.userAvatarUrl} label=${this.username}></cx-avatar><div class="header__username"><cx-line-clamp lines="1" class="header__username__text"><cx-typography variant="body3">${this.username}</cx-typography></cx-line-clamp></div></div><div class="header__actions"><cx-tooltip content=${this.localize.term("search")} hoist><cx-icon-button data-testid="header__search-button" name="search" @click=${this.openSearch}></cx-icon-button></cx-tooltip><cx-tooltip content=${this.localize.term("openDrive")} hoist><cx-icon-button data-testid="header__drive-button" name="folder_open" @click=${t}></cx-icon-button></cx-tooltip><cx-tooltip content=${this.localize.term("settings")} hoist><cx-icon-button data-testid="header__settings-button" class="header__settings" name="settings" @click=${this.showSettings}>${p(
|
|
1334
|
+
this.hasNewVersion,
|
|
1335
|
+
() => n`<cx-badge class="settings__version__badge" slot="badge" variant="danger" pill size="x-small"></cx-badge>`
|
|
1336
|
+
)}</cx-icon-button></cx-tooltip></div></div>`;
|
|
1337
|
+
}
|
|
1338
|
+
// #region Assets
|
|
1339
|
+
renderAsset(t, e) {
|
|
1340
|
+
return n`<cx-file-on-demand-asset .asset=${t} .listType=${e} .favoriteInProgressAssets=${this.favoriteInProgressAssets} .pinInProgressAssets=${this.pinInProgressAssets}></cx-file-on-demand-asset>`;
|
|
1341
|
+
}
|
|
1342
|
+
renderRecentAssets() {
|
|
1343
|
+
const t = n`<div class="recent-empty assets-list__tab-group__empty-message"><cx-icon class="empty-icon" name="explore"></cx-icon><cx-typography variant="body2">${this.localize.term("allViewedAssetsWillBeVisibleHere")}</cx-typography></div>`, [e, i] = ut(
|
|
1344
|
+
this.recentAssets.assets
|
|
1345
|
+
), a = n`<div class="recent__list" @scroll=${this.requestMoreRecentAssets}><div class=${C({
|
|
1346
|
+
empty: e.length === 0,
|
|
1347
|
+
recent__today: !0
|
|
1348
|
+
})} data-testid="recent__today"><div class="asset-group__label"><cx-typography variant="small">${this.localize.term("today")}</cx-typography></div>${U(
|
|
1349
|
+
e,
|
|
1350
|
+
(s) => s.recordId,
|
|
1351
|
+
(s) => this.renderAsset(s, x.RECENT)
|
|
1352
|
+
)}</div><div class=${C({
|
|
1353
|
+
empty: i.length === 0,
|
|
1354
|
+
recent__other: !0
|
|
1355
|
+
})}><div class="asset-group__label"><cx-typography variant="small">${this.localize.term("allOther")}</cx-typography></div>${U(
|
|
1356
|
+
i,
|
|
1357
|
+
(s) => s.recordId,
|
|
1358
|
+
(s) => this.renderAsset(s, x.RECENT)
|
|
1359
|
+
)}</div></div>`;
|
|
1360
|
+
return n`<cx-tab-panel name=${x.RECENT} class="assets-list__recent-tab-panel">${p(
|
|
1361
|
+
this.recentAssets.assets.length > 0,
|
|
1362
|
+
() => a,
|
|
1363
|
+
() => t
|
|
1364
|
+
)}</cx-tab-panel>`;
|
|
1365
|
+
}
|
|
1366
|
+
renderFavoriteAssets() {
|
|
1367
|
+
const t = n`<div class="favorites-empty assets-list__tab-group__empty-message"><cx-icon class="empty-icon" name="star"></cx-icon><cx-typography variant="body2">${this.localize.term("allFavoriteAssetsWillBeVisibleHere")}</cx-typography></div>`, e = mt(this.favoriteAssets.assets), i = n`<div class="favorites__list" @scroll=${this.requestMoreFavoriteAssets}>${U(
|
|
1368
|
+
e,
|
|
1369
|
+
(a) => a.recordId,
|
|
1370
|
+
(a) => this.renderAsset(a, x.FAVORITES)
|
|
1371
|
+
)}</div>`;
|
|
1372
|
+
return n`<cx-tab-panel name=${x.FAVORITES} class="assets-list__favorites-tab-panel"><div class="favorites-tab-panel__content"><div class="asset-group__label favorites__sync-time"><cx-typography variant="small">${this.localize.term("favoritesSync")} -
|
|
1373
|
+
<cx-relative-time format="narrow" numeric="always" date=${new Date(this.favoritesLastSync)} sync sync-interval=${O}></cx-relative-time></cx-typography></div>${p(
|
|
1374
|
+
e.length > 0,
|
|
1375
|
+
() => i,
|
|
1376
|
+
() => t
|
|
1377
|
+
)}</div></cx-tab-panel>`;
|
|
1378
|
+
}
|
|
1379
|
+
renderUploadingAssets() {
|
|
1380
|
+
const t = n`<div class="uploads-empty assets-list__tab-group__empty-message"><cx-icon class="empty-icon" name="arrow_upward"></cx-icon><cx-typography variant="body2">${this.localize.term("allAssetUploadsWillBeVisibleHere")}</cx-typography></div>`, [e, i] = ut(
|
|
1381
|
+
this.uploadingAssets.assets
|
|
1382
|
+
), a = n`<div class="uploads__list" @scroll=${this.requestMoreUploadingAssets}><div class=${C({
|
|
1383
|
+
empty: e.length === 0,
|
|
1384
|
+
recent__today: !0
|
|
1385
|
+
})} data-testid="uploads__today"><div class="asset-group__label"><cx-typography variant="small">${this.localize.term("today")}</cx-typography><cx-button class="asset-group__clear-button" variant="text" size="small" @click=${this.clearUpload}>${this.localize.term("clearAll")}</cx-button></div>${U(
|
|
1386
|
+
e,
|
|
1387
|
+
(s) => s.recordId,
|
|
1388
|
+
(s) => this.renderAsset(s, x.UPLOADS)
|
|
1389
|
+
)}</div><div class=${C({
|
|
1390
|
+
empty: i.length === 0,
|
|
1391
|
+
uploads__other: !0
|
|
1392
|
+
})}><div class="asset-group__label"><cx-typography variant="small">${this.localize.term("allOther")}</cx-typography></div>${U(
|
|
1393
|
+
i,
|
|
1394
|
+
(s) => s.recordId,
|
|
1395
|
+
(s) => this.renderAsset(s, x.UPLOADS)
|
|
1396
|
+
)}</div></div>`;
|
|
1397
|
+
return n`<cx-tab-panel name=${x.UPLOADS} class="assets-list__uploads-tab-panel">${p(
|
|
1398
|
+
this.uploadingAssets.assets.length > 0,
|
|
1399
|
+
() => a,
|
|
1400
|
+
() => t
|
|
1401
|
+
)}</cx-tab-panel>`;
|
|
1402
|
+
}
|
|
1403
|
+
renderPinnedAssets() {
|
|
1404
|
+
const t = n`<div class="pinned-empty assets-list__tab-group__empty-message"><cx-icon class="empty-icon" name="keep"></cx-icon><cx-typography variant="body2">${this.localize.term("allPinnedAssetsWillBeVisibleHere")}</cx-typography></div>`, e = mt(this.pinnedAssets.assets), i = n`<div class="pinned__list" @scroll=${this.requestMorePinnedAssets}>${U(
|
|
1405
|
+
e,
|
|
1406
|
+
(a) => a.recordId,
|
|
1407
|
+
(a) => this.renderAsset(a, x.PINNED)
|
|
1408
|
+
)}</div>`;
|
|
1409
|
+
return n`<cx-tab-panel name=${x.PINNED} class="assets-list__pinned-tab-panel"><div class="pinned-tab-panel__content">${p(
|
|
1410
|
+
e.length > 0,
|
|
1411
|
+
() => i,
|
|
1412
|
+
() => t
|
|
1413
|
+
)}</div></cx-tab-panel>`;
|
|
1414
|
+
}
|
|
1415
|
+
renderAssetsList() {
|
|
1416
|
+
return n`<div class="assets-list"><cx-tab-group @cx-tab-show=${async (e) => {
|
|
1417
|
+
switch (await e.target.updateComplete, e.detail.name) {
|
|
1418
|
+
case x.RECENT:
|
|
1419
|
+
this.requestMoreRecentAssets();
|
|
1420
|
+
break;
|
|
1421
|
+
case x.FAVORITES:
|
|
1422
|
+
this.requestMoreFavoriteAssets();
|
|
1423
|
+
break;
|
|
1424
|
+
case x.UPLOADS:
|
|
1425
|
+
this.requestMoreUploadingAssets();
|
|
1426
|
+
break;
|
|
1427
|
+
case x.PINNED:
|
|
1428
|
+
this.requestMorePinnedAssets();
|
|
1429
|
+
break;
|
|
1430
|
+
}
|
|
1431
|
+
}} no-scroll-controls class="assets-list__tab-group"><cx-tab active data-testid="assets-list__recent-tab" slot="nav" panel=${x.RECENT}>${this.localize.term("recent")}</cx-tab><cx-tab data-testid="assets-list__pins-tab" slot="nav" panel=${x.PINNED}>${this.localize.term("pins")}</cx-tab><cx-tab data-testid="assets-list__favorites-tab" slot="nav" panel=${x.FAVORITES}>${this.localize.term("favorites")}</cx-tab><cx-tab data-testid="assets-list__uploads-tab" slot="nav" panel=${x.UPLOADS}>${this.localize.term("uploads")}</cx-tab>${this.renderRecentAssets()} ${this.renderFavoriteAssets()}
|
|
1432
|
+
${this.renderUploadingAssets()} ${this.renderPinnedAssets()}</cx-tab-group></div>`;
|
|
1433
|
+
}
|
|
1434
|
+
renderAssetsView() {
|
|
1435
|
+
return n`<div class="assets">${this.renderHeader()}${this.renderAssetsList()}${this.renderStatusFooter()}</div>`;
|
|
1436
|
+
}
|
|
1437
|
+
onSearch() {
|
|
1438
|
+
this.folderPathsSet = /* @__PURE__ */ new Set(), this.fetchFolders({
|
|
1439
|
+
folderId: "",
|
|
1440
|
+
folderPathsSet: this.folderPathsSet
|
|
1441
|
+
}).then((t) => {
|
|
1442
|
+
this.availableFolderIdentifiers = t.data, this.totalCount = t.totalCount;
|
|
1443
|
+
});
|
|
1444
|
+
}
|
|
1445
|
+
renderSelectFoldersPopup() {
|
|
1446
|
+
const t = () => {
|
|
1447
|
+
this.folderTree.rootIDs = this.rootIDs, this.dialog.show();
|
|
1448
|
+
}, e = (s = null) => {
|
|
1449
|
+
s?.target && s.target !== this.dialog || (this.folderTree.resetTree(), this.folderTree.rootIDs = [], this.folderTree.removedIDs = [], this.dialog.hide(), this.searchText = "");
|
|
1450
|
+
}, i = async () => {
|
|
1451
|
+
this.isAddingRootIDs = !0, await this.updateComplete, this.searchText = "";
|
|
1452
|
+
const s = this.rootIDs.filter((h) => {
|
|
1453
|
+
if (!this.folderTree.shadowRoot?.querySelector(
|
|
1454
|
+
`[data-id="${S(h).id}"]`
|
|
1455
|
+
))
|
|
1456
|
+
return !0;
|
|
1457
|
+
}), o = /* @__PURE__ */ new Set([
|
|
1458
|
+
...this.folderTree.currentRootIDs,
|
|
1459
|
+
...s
|
|
1460
|
+
]);
|
|
1461
|
+
for (const h of o) {
|
|
1462
|
+
const _ = R(S(h).path), m = this.folderTree.removedIDs.filter(
|
|
1463
|
+
(g) => R(S(g).path).startsWith(_)
|
|
1464
|
+
);
|
|
1465
|
+
if (m.length > 0) {
|
|
1466
|
+
const { totalCount: g } = await this.fetchFolders({
|
|
1467
|
+
excludes: m.map((f) => S(f).id),
|
|
1468
|
+
folderId: S(h).id,
|
|
1469
|
+
start: 0
|
|
1470
|
+
}), { data: $ } = await this.fetchFolders({
|
|
1471
|
+
excludes: m.map((f) => S(f).id),
|
|
1472
|
+
folderId: S(h).id,
|
|
1473
|
+
limit: g || 10,
|
|
1474
|
+
start: 0
|
|
1475
|
+
});
|
|
1476
|
+
$.forEach((f) => {
|
|
1477
|
+
o.add(
|
|
1478
|
+
N({ id: f.id, path: f.fullPath })
|
|
1479
|
+
);
|
|
1480
|
+
}), o.delete(h);
|
|
1481
|
+
}
|
|
1482
|
+
}
|
|
1483
|
+
const c = Array.from(o);
|
|
1484
|
+
this.updateActiveFolderIdentifiers(c), this.removedIds = c.filter(
|
|
1485
|
+
(h) => [...c].some((_) => {
|
|
1486
|
+
const m = S(h), g = S(_), $ = R(g.path);
|
|
1487
|
+
return _ !== h && m.path.startsWith($);
|
|
1488
|
+
})
|
|
1489
|
+
), e(), this.isAddingRootIDs = !1;
|
|
1490
|
+
}, a = (s) => {
|
|
1491
|
+
const o = s.target;
|
|
1492
|
+
this.searchText = (o.value ?? "").trim();
|
|
1493
|
+
};
|
|
1494
|
+
return n`<cx-dialog class="select-folders-popup" no-header @cx-after-hide=${e} .boundary=${this.container}><cx-input autofocus clearable @cx-input=${a} value=${this.searchText} placeholder=${this.localize.term("search")}><cx-icon name="search" slot="prefix"></cx-icon></cx-input>${this.renderSelectableFolderTree()}<div class="select-folders-popup__actions"><cx-button ?loading=${this.isAddingRootIDs} variant="primary" @click=${i}>${this.localize.term("add")}</cx-button></div></cx-dialog><cx-button data-testid="settings__select-folders-button" @click=${t}><cx-icon name="folder" slot="prefix"></cx-icon>${this.localize.term("selectFolders")}</cx-button>`;
|
|
1495
|
+
}
|
|
1496
|
+
renderSelectableFolderTree() {
|
|
1497
|
+
const t = this.availableFolderIdentifiers;
|
|
1498
|
+
return n`<cx-folder-tree class="selectable-folder-tree" .siteUrl=${this.settings.config.siteUrl} .token=${this.token} .searchText=${this.searchText} .folders=${t} .rootIDs=${this.rootIDs} .totalCount=${this.totalCount} .loadMore=${this.loadMore} .folderPathsSet=${this.folderPathsSet} ?isLoading=${this.isLoading}></cx-folder-tree>`;
|
|
1499
|
+
}
|
|
1500
|
+
renderRootFolderTree() {
|
|
1501
|
+
if (!this.rootIDs.length)
|
|
1502
|
+
return Nt;
|
|
1503
|
+
const t = this.rootIDs.filter(
|
|
1504
|
+
(a) => !this.removedIds.includes(a)
|
|
1505
|
+
), e = (a) => {
|
|
1506
|
+
this.updateActiveFolderIdentifiers(
|
|
1507
|
+
t.filter(
|
|
1508
|
+
(s) => S(s).id !== a
|
|
1509
|
+
)
|
|
1510
|
+
), this.folderTree.rootIDs = this.rootIDs, this.folderTree.resetTree();
|
|
1511
|
+
}, i = (a) => {
|
|
1512
|
+
const { id: s, path: o } = S(a), c = () => {
|
|
1513
|
+
e(s);
|
|
1514
|
+
};
|
|
1515
|
+
return n`<cx-tree-item data-id=${s} class=${C({
|
|
1516
|
+
"folder-tree__item": !0
|
|
1517
|
+
})}><div class="folder-tree__label"><cx-icon class="folder-tree__icon" name="folder"></cx-icon><cx-line-clamp lines="1" class="folder-tree__label__value">${o}</cx-line-clamp></div><cx-tooltip slot="actions" content=${this.localize.term("removeFolder", 1)} hoist><cx-icon-button @click=${c} name="close"></cx-icon-button></cx-tooltip></cx-tree-item>`;
|
|
1518
|
+
};
|
|
1519
|
+
return n`<div data-testid="root-folder-tree" class="folder-tree"><cx-tree selection="none">${U(
|
|
1520
|
+
t,
|
|
1521
|
+
(a) => a,
|
|
1522
|
+
(a) => i(a)
|
|
1523
|
+
)}
|
|
1524
|
+
></cx-tree></div>`;
|
|
1525
|
+
}
|
|
1526
|
+
handleActiveFolderChange(t) {
|
|
1527
|
+
t.target.value === "custom" ? (this._activeFoldersMode = !0, this.rootIDs = this.settings.config.rootIDs ?? []) : (this._activeFoldersMode = !1, this.rootIDs = []);
|
|
1528
|
+
}
|
|
1529
|
+
renderGeneralSettings() {
|
|
1530
|
+
const t = n`<div class="settings-group settings__active-folder"><cx-typography variant="h5">${this.localize.term("activeFolders")}</cx-typography><cx-typography variant="body3">${this.localize.term("activeFoldersHelpText")}</cx-typography><cx-select data-testid="settings__active-folder-select" hoist input-behavior="none" value=${this._activeFoldersMode ? "custom" : "all"} @cx-change=${this.handleActiveFolderChange}><cx-option value="all">${this.localize.term("allFoldersDefault")}</cx-option><cx-option value="custom">${this.localize.term("custom")}</cx-option></cx-select>${p(
|
|
1531
|
+
this._activeFoldersMode,
|
|
1532
|
+
() => n`
|
|
1533
|
+
${this.renderRootFolderTree()} ${this.renderSelectFoldersPopup()}
|
|
1534
|
+
`
|
|
1535
|
+
)}</div>`;
|
|
1536
|
+
return n`<div class="settings__general">${t}<div class="settings-group settings__software"><cx-typography variant="h5">${this.localize.term("software")}</cx-typography><div class="settings__software__version"><div class="settings__software__version__value"><cx-line-clamp lines="1" class="settings__software__version__value__text"><cx-typography variant="body3">${this.localize.term("currentVersion")}
|
|
1537
|
+
${gt(this.settings.config.version ?? "")}</cx-typography></cx-line-clamp></div>${p(
|
|
1538
|
+
this.hasNewVersion,
|
|
1539
|
+
() => n`<div class="settings__software__version__value"><cx-badge class="settings__version__badge" slot="badge" variant="danger" pill size="x-small"></cx-badge><cx-line-clamp lines="1" class="settings__software__version__value__text"><cx-typography variant="body3">${this.localize.term(
|
|
1540
|
+
"newVersionAvailable",
|
|
1541
|
+
gt(
|
|
1542
|
+
this.settings.config.latestVersion ?? ""
|
|
1543
|
+
)
|
|
1544
|
+
)}</cx-typography></cx-line-clamp><cx-button size="small" ?loading=${this.isUpgrading} class="settings__software__version__install-button" outline @click=${this.upgrade}><cx-icon name="install_desktop" slot="prefix"></cx-icon>${this.localize.term("download")}</cx-button></div>`
|
|
1545
|
+
)}</div></div><div class="settings-group settings__connection"><cx-typography variant="h5">${this.localize.term("connection")}</cx-typography><div class="settings__connection-url"><cx-typography variant="body3">URL:</cx-typography><cx-line-clamp class="settings__connection-url__value" lines="1"><cx-typography variant="body3">${this.settings.config.siteUrl}</cx-typography></cx-line-clamp></div></div><cx-space direction="vertical"><div class="settings__disconnect"><cx-button slot="trigger" ?loading=${this.isDisconnecting} text variant="text" class="settings__disconnect-button" @click=${this.disconnect}><cx-icon name="cloud_off" slot="prefix"></cx-icon>${this.localize.term("disconnect")}</cx-button><cx-typography class="error-message" variant="body3">${this.disconnectError}</cx-typography></div></cx-space><div class="settings-group settings__about"><div data-testid="settings__about__content"><cx-typography variant="small">${this.aboutContent}</cx-typography></div></div></div>`;
|
|
1546
|
+
}
|
|
1547
|
+
handleProxyChange(t) {
|
|
1548
|
+
const i = t.target.value;
|
|
1549
|
+
i.includes("All") ? this.proxyTypes = ["All"] : this.proxyTypes = i;
|
|
1550
|
+
}
|
|
1551
|
+
handleCacheSizeKeydown(t) {
|
|
1552
|
+
const e = /\d/;
|
|
1553
|
+
// Block minus sign and non-numeric characters
|
|
1554
|
+
(t.key === "Minus" || // for key="-" (Firefox)
|
|
1555
|
+
t.key === "-" || // for key="-" (Chrome)
|
|
1556
|
+
t.key.length === 1 && !e.test(t.key)) && t.preventDefault();
|
|
1557
|
+
}
|
|
1558
|
+
handleCacheSizeChange(t) {
|
|
1559
|
+
const e = t.target;
|
|
1560
|
+
if (Number(e.value) < 0) {
|
|
1561
|
+
e.setCustomValidity(this.localize.term("cacheSizeCannotBeNegative"));
|
|
1562
|
+
return;
|
|
1563
|
+
}
|
|
1564
|
+
this.cacheSize = Number(e.value);
|
|
1565
|
+
}
|
|
1566
|
+
async handleCacheLocationClick() {
|
|
1567
|
+
const t = await this.pickCacheLocation();
|
|
1568
|
+
this.cacheLocation = t;
|
|
1569
|
+
}
|
|
1570
|
+
async handleCacheLocationChange() {
|
|
1571
|
+
await this.updateComplete, this.cacheLocationValueText?.handleResize();
|
|
1572
|
+
}
|
|
1573
|
+
renderAdvancedSettings() {
|
|
1574
|
+
const t = n`<cx-tooltip content=${this.localize.term("openDrive")} hoist><cx-icon-button data-testid="settings__cache__location__open-button" name="folder_open" outline @click=${this.openCacheLocation}></cx-icon-button></cx-tooltip>`;
|
|
1575
|
+
return n`<div class="settings__advanced"><div class="settings-group settings__proxy"><cx-typography variant="h5">Proxy</cx-typography><cx-select class="settings__proxy__select" label=${this.localize.term("types")} multiple=multiple input-behavior="none" value=${(this.proxyTypes ?? []).join(" ")} @cx-change=${this.handleProxyChange}><cx-option value="Image" ?disabled=${(this.proxyTypes ?? []).includes("All")}>${this.localize.term("image")}</cx-option><cx-option value="Video" ?disabled=${(this.proxyTypes ?? []).includes("All")}>${this.localize.term("video")}</cx-option><cx-option value="Audio" ?disabled=${(this.proxyTypes ?? []).includes("All")}>${this.localize.term("audio")}</cx-option><cx-option value="All">${this.localize.term("all")}</cx-option></cx-select><cx-typography variant="small">${this.localize.term(
|
|
1576
|
+
"itCanTakeAFewMinutesForThisSettingToTakeEffect"
|
|
1577
|
+
)}</cx-typography></div><div class="settings-group settings__cache"><cx-typography variant="h5">${this.localize.term("cache")}</cx-typography><div class="settings__cache__size"><cx-typography variant="body3" class="settings__cache__size__label">${this.localize.term("currentUsage")}: <cx-format-bytes .value=${this.settings.cacheUsage}></cx-format-bytes></cx-typography><cx-typography variant="body3" class="settings__cache__size__label">${this.localize.term("capacity")}</cx-typography><cx-input data-testid="settings__cache__size__input" label=${this.localize.term("size")} type="number" no-spin-buttons min="0" step="any" value=${this.cacheSize} @keydown=${this.handleCacheSizeKeydown} @cx-change=${this.handleCacheSizeChange}><cx-typography slot="suffix" variant="body2">${Z}</cx-typography></cx-input></div><div class="settings__cache__location"><cx-typography variant="body3" class="settings__cache__location__label">${this.localize.term("location")}</cx-typography><div class="settings__cache__location__value"><cx-line-clamp lines="1" class="settings__cache__location__value__text"><cx-typography variant="body3">${this.cacheLocation}</cx-typography></cx-line-clamp><cx-space spacing="x-small" class="settings__cache__location__actions"><cx-button class="settings__cache__location__change-button" outline @click=${this.handleCacheLocationClick}><cx-icon name="edit" slot="prefix"></cx-icon>${this.localize.term("change")}</cx-button>${t}</cx-space></div></div><div class="settings__cache__buttons"><cx-button data-testid="settings__cache__clear-button" @click=${this.clearCache}><cx-icon name="delete" slot="prefix"></cx-icon>${this.localize.term("clearCache")}</cx-button></div></div><div class="settings-group settings__config"><cx-typography variant="h5">${this.localize.term("config")}</cx-typography><div class="settings__config__buttons"><cx-button data-testid="settings__config__export-button" @click=${this.exportSettings}><cx-icon name="file_download" slot="prefix"></cx-icon>${this.localize.term("export")}</cx-button><cx-button @click=${this.importSettings} data-testid="settings__config__import-button"><cx-icon name="file_upload" slot="prefix"></cx-icon>${this.localize.term("import")}</cx-button></div></div><div class="settings-group settings__logs"><cx-typography variant="h5">${this.localize.term("logs")}</cx-typography><div class="settings__logs__buttons"><cx-button data-testid="settings__logs__view-button" @click=${this.viewLogs}><cx-icon name="code" slot="prefix"></cx-icon>${this.localize.term("view")}</cx-button></div></div></div>`;
|
|
1578
|
+
}
|
|
1579
|
+
renderSettingsView() {
|
|
1580
|
+
const t = () => {
|
|
1581
|
+
this.hideSettings();
|
|
1582
|
+
};
|
|
1583
|
+
return n`<div class="settings"><form class="settings__form" @submit=${(i) => {
|
|
1584
|
+
i.preventDefault(), this.saveSettings();
|
|
1585
|
+
}}><cx-tab-group no-scroll-controls class="settings__tab-group"><cx-tab active class="settings_general-tab" slot="nav" panel="general">${this.localize.term("general")}</cx-tab><cx-tab data-testid="settings_advanced-tab" slot="nav" panel="advanced">${this.localize.term("advanced")}</cx-tab><cx-tab-panel name="general">${this.renderGeneralSettings()}</cx-tab-panel><cx-tab-panel name="advanced" class="settings_advanced-tab-panel">${this.renderAdvancedSettings()}</cx-tab-panel></cx-tab-group><div class="settings__footer"><div class="settings__footer__actions"><cx-button data-testid="settings__cancel-button" type="button" @click=${t}>${this.localize.term("cancel")}</cx-button><cx-button data-testid="settings__save-button" ?disabled=${!this.formHasChanges} type="submit" variant="primary">${this.localize.term("save")}</cx-button></div></div></form></div>`;
|
|
1586
|
+
}
|
|
1587
|
+
// #endregion
|
|
1588
|
+
renderStatusFooter() {
|
|
1589
|
+
const t = n`<cx-typography class="error-message" variant="small">${this.localize.term("fileOnDemandSyncErrorMessage")}</cx-typography>`, e = () => {
|
|
1590
|
+
switch (this.connectionStatus) {
|
|
1591
|
+
case "excellent":
|
|
1592
|
+
return n`<cx-icon variant="filled" name="check_circle"></cx-icon>`;
|
|
1593
|
+
case "good":
|
|
1594
|
+
return n`<cx-icon variant="filled" name="circle"></cx-icon>`;
|
|
1595
|
+
case "bad":
|
|
1596
|
+
return n`<cx-icon variant="filled" name="circle"></cx-icon>`;
|
|
1597
|
+
}
|
|
1598
|
+
}, i = () => {
|
|
1599
|
+
switch (this.assetIndexSyncStatus) {
|
|
1600
|
+
case "loaded":
|
|
1601
|
+
return n`<cx-icon variant="filled" name="check_circle"></cx-icon>`;
|
|
1602
|
+
case "loading":
|
|
1603
|
+
return n`<cx-icon variant="filled" name="cached"></cx-icon>`;
|
|
1604
|
+
case "error":
|
|
1605
|
+
return n`<cx-icon variant="filled" name="error"></cx-icon>`;
|
|
1606
|
+
}
|
|
1607
|
+
}, a = n`<div class=${C({
|
|
1608
|
+
"connection-status": !0,
|
|
1609
|
+
"connection-status--bad": this.connectionStatus === "bad",
|
|
1610
|
+
"connection-status--excellent": this.connectionStatus === "excellent",
|
|
1611
|
+
"connection-status--good": this.connectionStatus === "good"
|
|
1612
|
+
})}><cx-typography class="label" variant="small">${this.localize.term("connection")}</cx-typography><cx-tooltip class="connection-status__tooltip" content=${this.connectionStatusTooltip} hoist ?disabled=${!this.connectionStatusTooltip.trim()}><div class="connection-status__value"><cx-typography variant="small">${this.connectionStatus}</cx-typography>${e()}</div></cx-tooltip></div>`, s = this.settings.cacheUsage >= this.settings.cacheSize;
|
|
1613
|
+
return n`<cx-divider class="status-footer__divider"></cx-divider><div class="status-footer"><div class="connected-url"><cx-typography class="label" variant="small">${this.localize.term("connectedTo")}</cx-typography><cx-line-clamp class="value-line-clamp" lines="1"><cx-typography class="value" variant="small">${this.settings.config.siteUrl}</cx-typography></cx-line-clamp></div>${a}<div class=${C({
|
|
1614
|
+
"asset-index-sync-status": !0,
|
|
1615
|
+
"asset-index-sync-status--error": this.assetIndexSyncStatus === "error",
|
|
1616
|
+
"asset-index-sync-status--loaded": this.assetIndexSyncStatus === "loaded",
|
|
1617
|
+
"asset-index-sync-status--loading": this.assetIndexSyncStatus === "loading"
|
|
1618
|
+
})}><cx-typography class="label" variant="small">${this.localize.term("assetIndexSync")}</cx-typography><div class="value"><cx-typography variant="small">${me[this.assetIndexSyncStatus]}</cx-typography>${i()}</div></div><div class="cache-usage"><cx-typography class="label" variant="small">${this.localize.term("cache")}</cx-typography><cx-tooltip ?disabled=${!s} content=${this.localize.term("cacheUsageWarning")}><cx-space spacing="3x-small"><cx-line-clamp class="value-line-clamp" lines="1"><cx-typography class="value" variant="small"><cx-format-bytes .value=${this.settings.cacheUsage}></cx-format-bytes>
|
|
1619
|
+
/
|
|
1620
|
+
<cx-format-bytes .value=${this.settings.cacheSize}></cx-format-bytes></cx-typography></cx-line-clamp>${p(s, () => n`<cx-icon class="cache-usage__warning-icon" name="warning" variant="filled"></cx-icon>`)}</cx-space></cx-tooltip></div>${p(this.assetIndexSyncStatus === "error", () => t)}</div>`;
|
|
1621
|
+
}
|
|
1622
|
+
handleConnectionURLInput(t) {
|
|
1623
|
+
this.validConnectionUrl = !0, this.siteUrl = t.target.value.trim();
|
|
1624
|
+
const e = ht(this.siteUrl);
|
|
1625
|
+
K(e) || (this.validConnectionUrl = !1);
|
|
1626
|
+
}
|
|
1627
|
+
renderWelcomeView() {
|
|
1628
|
+
return n`<div class="welcome"><div class="welcome__message"><cx-typography variant="h5">${this.localize.term("welcomeToFileOnDemand")}</cx-typography><cx-typography variant="body3">${this.localize.term("enterYourSiteUrlToConnect")}</cx-typography></div><form class="welcome__actions" @submit=${this.connect}><cx-input aria-label=${this.localize.term("connectionURLInput")} class="welcome__input" placeholder="Ex: https://cortex.orangelogic.com/" value=${this.settings.config.siteUrl} @cx-input=${this.handleConnectionURLInput}></cx-input><cx-tooltip class="welcome__connect-button__tooltip" ?disabled=${this.siteUrl.trim() && this.validConnectionUrl} content=${this.siteUrl.trim() ? this.localize.term("pleaseEnterAValidUrl") : this.localize.term("connectionCannotBeEmpty")}><cx-button type="submit" ?loading=${this.isConnecting} variant="primary" class=${C({
|
|
1629
|
+
"welcome__connect-button": !0,
|
|
1630
|
+
"welcome__connect-button--disabled": !this.siteUrl.trim() || !this.validConnectionUrl
|
|
1631
|
+
})} ?disabled=${!this.siteUrl.trim() || !this.validConnectionUrl}>${this.localize.term("connect")}</cx-button></cx-tooltip><cx-button type="button" ?loading=${this.isCancellingConnection} variant="text" class=${C({
|
|
1632
|
+
"welcome__cancel-connection-button": !0
|
|
1633
|
+
})} ?disabled=${!this.isConnecting} @click=${this.cancelConnection}>${this.localize.term("cancel")}</cx-button><cx-typography class="error-message" variant="body3">${p(
|
|
1634
|
+
this.connectError,
|
|
1635
|
+
() => this.connectError,
|
|
1636
|
+
() => " "
|
|
1637
|
+
)}</cx-typography></form></div>`;
|
|
1638
|
+
}
|
|
1639
|
+
renderView() {
|
|
1640
|
+
return this.connectionEstablished ? this.isSettingsOpened ? this.renderSettingsView() : this.renderAssetsView() : this.renderWelcomeView();
|
|
1641
|
+
}
|
|
1642
|
+
renderLoadingOverlay() {
|
|
1643
|
+
return n`<div class="loading-overlay"><cx-spinner></cx-spinner></div>`;
|
|
1644
|
+
}
|
|
1645
|
+
render() {
|
|
1646
|
+
return n`<div class=${C({
|
|
1647
|
+
container: !0,
|
|
1648
|
+
"container--connected": this.connectionEstablished,
|
|
1649
|
+
"container--user-interaction-blocked": this.userInteractionBlocked
|
|
1650
|
+
})}>${this.renderView()}
|
|
1651
|
+
${p(this.userInteractionBlocked, () => this.renderLoadingOverlay())}</div>`;
|
|
1652
|
+
}
|
|
1653
|
+
// #endregion
|
|
1654
|
+
};
|
|
1655
|
+
r.styles = Ze;
|
|
1656
|
+
r.dependencies = {
|
|
1657
|
+
"cx-avatar": Mt,
|
|
1658
|
+
"cx-button": Vt,
|
|
1659
|
+
"cx-confirm-popover": Qt,
|
|
1660
|
+
"cx-dialog": Ht,
|
|
1661
|
+
"cx-divider": Wt,
|
|
1662
|
+
"cx-file-on-demand-asset": L,
|
|
1663
|
+
"cx-folder-tree": b,
|
|
1664
|
+
"cx-format-bytes": ot,
|
|
1665
|
+
"cx-icon": J,
|
|
1666
|
+
"cx-icon-button": Ct,
|
|
1667
|
+
"cx-input": qt,
|
|
1668
|
+
"cx-line-clamp": Q,
|
|
1669
|
+
"cx-option": Gt,
|
|
1670
|
+
"cx-relative-time": At,
|
|
1671
|
+
"cx-select": Yt,
|
|
1672
|
+
"cx-space": Kt,
|
|
1673
|
+
"cx-tab": Xt,
|
|
1674
|
+
"cx-tab-group": Zt,
|
|
1675
|
+
"cx-tab-panel": Jt,
|
|
1676
|
+
"cx-tooltip": Dt,
|
|
1677
|
+
"cx-tree": $t,
|
|
1678
|
+
"cx-tree-item": yt,
|
|
1679
|
+
"cx-typography": nt
|
|
1680
|
+
};
|
|
1681
|
+
l([
|
|
1682
|
+
z(".container")
|
|
1683
|
+
], r.prototype, "container", 2);
|
|
1684
|
+
l([
|
|
1685
|
+
z("cx-folder-tree")
|
|
1686
|
+
], r.prototype, "folderTree", 2);
|
|
1687
|
+
l([
|
|
1688
|
+
z("cx-dialog")
|
|
1689
|
+
], r.prototype, "dialog", 2);
|
|
1690
|
+
l([
|
|
1691
|
+
z(".recent__list")
|
|
1692
|
+
], r.prototype, "recentAssetsList", 2);
|
|
1693
|
+
l([
|
|
1694
|
+
z(".favorites__list")
|
|
1695
|
+
], r.prototype, "favoritesAssetsList", 2);
|
|
1696
|
+
l([
|
|
1697
|
+
z(".uploads__list")
|
|
1698
|
+
], r.prototype, "uploadsAssetsList", 2);
|
|
1699
|
+
l([
|
|
1700
|
+
z(".pinned__list")
|
|
1701
|
+
], r.prototype, "pinnedAssetsList", 2);
|
|
1702
|
+
l([
|
|
1703
|
+
z(".assets-list__tab-group")
|
|
1704
|
+
], r.prototype, "assetsListTabGroup", 2);
|
|
1705
|
+
l([
|
|
1706
|
+
z(".settings__cache__location__value__text")
|
|
1707
|
+
], r.prototype, "cacheLocationValueText", 2);
|
|
1708
|
+
l([
|
|
1709
|
+
d({
|
|
1710
|
+
attribute: "connection-established",
|
|
1711
|
+
type: Boolean
|
|
1712
|
+
})
|
|
1713
|
+
], r.prototype, "connectionEstablished", 2);
|
|
1714
|
+
l([
|
|
1715
|
+
d({
|
|
1716
|
+
attribute: "connection-status",
|
|
1717
|
+
reflect: !0,
|
|
1718
|
+
type: String
|
|
1719
|
+
})
|
|
1720
|
+
], r.prototype, "connectionStatus", 2);
|
|
1721
|
+
l([
|
|
1722
|
+
d({
|
|
1723
|
+
attribute: "connection-status-tooltip",
|
|
1724
|
+
type: String
|
|
1725
|
+
})
|
|
1726
|
+
], r.prototype, "connectionStatusTooltip", 2);
|
|
1727
|
+
l([
|
|
1728
|
+
d({
|
|
1729
|
+
attribute: "asset-index-sync-status",
|
|
1730
|
+
reflect: !0,
|
|
1731
|
+
type: String
|
|
1732
|
+
})
|
|
1733
|
+
], r.prototype, "assetIndexSyncStatus", 2);
|
|
1734
|
+
l([
|
|
1735
|
+
d({
|
|
1736
|
+
attribute: "user-avatar-url",
|
|
1737
|
+
type: String
|
|
1738
|
+
})
|
|
1739
|
+
], r.prototype, "userAvatarUrl", 2);
|
|
1740
|
+
l([
|
|
1741
|
+
d({
|
|
1742
|
+
type: String
|
|
1743
|
+
})
|
|
1744
|
+
], r.prototype, "username", 2);
|
|
1745
|
+
l([
|
|
1746
|
+
d({
|
|
1747
|
+
attribute: "recent-assets",
|
|
1748
|
+
type: Object
|
|
1749
|
+
})
|
|
1750
|
+
], r.prototype, "recentAssets", 2);
|
|
1751
|
+
l([
|
|
1752
|
+
d({
|
|
1753
|
+
attribute: "favorite-assets",
|
|
1754
|
+
type: Object
|
|
1755
|
+
})
|
|
1756
|
+
], r.prototype, "favoriteAssets", 2);
|
|
1757
|
+
l([
|
|
1758
|
+
d({
|
|
1759
|
+
attribute: "favorite-last-sync",
|
|
1760
|
+
type: Number
|
|
1761
|
+
})
|
|
1762
|
+
], r.prototype, "favoritesLastSync", 2);
|
|
1763
|
+
l([
|
|
1764
|
+
d({
|
|
1765
|
+
attribute: "favorite-in-progress-assets",
|
|
1766
|
+
converter: {
|
|
1767
|
+
fromAttribute: (t) => t.split(" ").filter(Boolean),
|
|
1768
|
+
toAttribute: (t) => t.join(" ")
|
|
1769
|
+
},
|
|
1770
|
+
type: String
|
|
1771
|
+
})
|
|
1772
|
+
], r.prototype, "favoriteInProgressAssets", 2);
|
|
1773
|
+
l([
|
|
1774
|
+
d({
|
|
1775
|
+
attribute: "pin-in-progress-assets",
|
|
1776
|
+
converter: {
|
|
1777
|
+
fromAttribute: (t) => t.split(" ").filter(Boolean),
|
|
1778
|
+
toAttribute: (t) => t.join(" ")
|
|
1779
|
+
},
|
|
1780
|
+
type: String
|
|
1781
|
+
})
|
|
1782
|
+
], r.prototype, "pinInProgressAssets", 2);
|
|
1783
|
+
l([
|
|
1784
|
+
d({
|
|
1785
|
+
attribute: "uploading-assets",
|
|
1786
|
+
type: Object
|
|
1787
|
+
})
|
|
1788
|
+
], r.prototype, "uploadingAssets", 2);
|
|
1789
|
+
l([
|
|
1790
|
+
d({
|
|
1791
|
+
attribute: "pinned-assets",
|
|
1792
|
+
type: Object
|
|
1793
|
+
})
|
|
1794
|
+
], r.prototype, "pinnedAssets", 2);
|
|
1795
|
+
l([
|
|
1796
|
+
u()
|
|
1797
|
+
], r.prototype, "availableFolderIdentifiers", 2);
|
|
1798
|
+
l([
|
|
1799
|
+
u()
|
|
1800
|
+
], r.prototype, "isLoading", 2);
|
|
1801
|
+
l([
|
|
1802
|
+
d({
|
|
1803
|
+
attribute: "settings",
|
|
1804
|
+
type: Object
|
|
1805
|
+
})
|
|
1806
|
+
], r.prototype, "settings", 2);
|
|
1807
|
+
l([
|
|
1808
|
+
d({ attribute: "pick-cache-location", type: Function })
|
|
1809
|
+
], r.prototype, "pickCacheLocation", 2);
|
|
1810
|
+
l([
|
|
1811
|
+
d({
|
|
1812
|
+
attribute: "has-new-version",
|
|
1813
|
+
type: Boolean
|
|
1814
|
+
})
|
|
1815
|
+
], r.prototype, "hasNewVersion", 2);
|
|
1816
|
+
l([
|
|
1817
|
+
d({
|
|
1818
|
+
attribute: "about-content",
|
|
1819
|
+
type: String
|
|
1820
|
+
})
|
|
1821
|
+
], r.prototype, "aboutContent", 2);
|
|
1822
|
+
l([
|
|
1823
|
+
d({ type: String })
|
|
1824
|
+
], r.prototype, "token", 2);
|
|
1825
|
+
l([
|
|
1826
|
+
d({
|
|
1827
|
+
attribute: "user-interaction-blocked",
|
|
1828
|
+
type: Boolean
|
|
1829
|
+
})
|
|
1830
|
+
], r.prototype, "userInteractionBlocked", 2);
|
|
1831
|
+
l([
|
|
1832
|
+
d({
|
|
1833
|
+
attribute: "is-connecting",
|
|
1834
|
+
type: Boolean
|
|
1835
|
+
})
|
|
1836
|
+
], r.prototype, "isConnecting", 2);
|
|
1837
|
+
l([
|
|
1838
|
+
d({
|
|
1839
|
+
attribute: "is-cancelling-connection",
|
|
1840
|
+
type: Boolean
|
|
1841
|
+
})
|
|
1842
|
+
], r.prototype, "isCancellingConnection", 2);
|
|
1843
|
+
l([
|
|
1844
|
+
d({
|
|
1845
|
+
attribute: "is-disconnecting",
|
|
1846
|
+
type: Boolean
|
|
1847
|
+
})
|
|
1848
|
+
], r.prototype, "isDisconnecting", 2);
|
|
1849
|
+
l([
|
|
1850
|
+
d({
|
|
1851
|
+
attribute: "is-upgrading",
|
|
1852
|
+
type: Boolean
|
|
1853
|
+
})
|
|
1854
|
+
], r.prototype, "isUpgrading", 2);
|
|
1855
|
+
l([
|
|
1856
|
+
u()
|
|
1857
|
+
], r.prototype, "isSettingsOpened", 2);
|
|
1858
|
+
l([
|
|
1859
|
+
u()
|
|
1860
|
+
], r.prototype, "rootIDs", 2);
|
|
1861
|
+
l([
|
|
1862
|
+
u()
|
|
1863
|
+
], r.prototype, "_activeFoldersMode", 2);
|
|
1864
|
+
l([
|
|
1865
|
+
u()
|
|
1866
|
+
], r.prototype, "removedIds", 2);
|
|
1867
|
+
l([
|
|
1868
|
+
u()
|
|
1869
|
+
], r.prototype, "cacheSize", 2);
|
|
1870
|
+
l([
|
|
1871
|
+
u()
|
|
1872
|
+
], r.prototype, "cacheLocation", 2);
|
|
1873
|
+
l([
|
|
1874
|
+
u()
|
|
1875
|
+
], r.prototype, "proxyTypes", 2);
|
|
1876
|
+
l([
|
|
1877
|
+
u()
|
|
1878
|
+
], r.prototype, "siteUrl", 2);
|
|
1879
|
+
l([
|
|
1880
|
+
u()
|
|
1881
|
+
], r.prototype, "isRecentAssetsLoading", 2);
|
|
1882
|
+
l([
|
|
1883
|
+
u()
|
|
1884
|
+
], r.prototype, "isFavoriteAssetsLoading", 2);
|
|
1885
|
+
l([
|
|
1886
|
+
u()
|
|
1887
|
+
], r.prototype, "isUploadingAssetsLoading", 2);
|
|
1888
|
+
l([
|
|
1889
|
+
u()
|
|
1890
|
+
], r.prototype, "isPinnedAssetsLoading", 2);
|
|
1891
|
+
l([
|
|
1892
|
+
u()
|
|
1893
|
+
], r.prototype, "connectError", 2);
|
|
1894
|
+
l([
|
|
1895
|
+
u()
|
|
1896
|
+
], r.prototype, "disconnectError", 2);
|
|
1897
|
+
l([
|
|
1898
|
+
u()
|
|
1899
|
+
], r.prototype, "upgradeError", 2);
|
|
1900
|
+
l([
|
|
1901
|
+
u()
|
|
1902
|
+
], r.prototype, "totalCount", 2);
|
|
1903
|
+
l([
|
|
1904
|
+
u()
|
|
1905
|
+
], r.prototype, "folderPathsSet", 2);
|
|
1906
|
+
l([
|
|
1907
|
+
u()
|
|
1908
|
+
], r.prototype, "validConnectionUrl", 2);
|
|
1909
|
+
l([
|
|
1910
|
+
u()
|
|
1911
|
+
], r.prototype, "isAddingRootIDs", 2);
|
|
1912
|
+
l([
|
|
1913
|
+
P(["connectionEstablished", "token"])
|
|
1914
|
+
], r.prototype, "fetchData", 1);
|
|
1915
|
+
l([
|
|
1916
|
+
P(["connectionEstablished"])
|
|
1917
|
+
], r.prototype, "showRecentTab", 1);
|
|
1918
|
+
l([
|
|
1919
|
+
P("settings")
|
|
1920
|
+
], r.prototype, "updateSettingsStates", 1);
|
|
1921
|
+
l([
|
|
1922
|
+
P("recentAssets")
|
|
1923
|
+
], r.prototype, "onRecentAssetsChanged", 1);
|
|
1924
|
+
l([
|
|
1925
|
+
P("pinnedAssets")
|
|
1926
|
+
], r.prototype, "onPinnedAssetsChanged", 1);
|
|
1927
|
+
l([
|
|
1928
|
+
P("favoriteAssets")
|
|
1929
|
+
], r.prototype, "onFavoriteAssetsChanged", 1);
|
|
1930
|
+
l([
|
|
1931
|
+
P("uploadingAssets")
|
|
1932
|
+
], r.prototype, "onUploadingAssetsChanged", 1);
|
|
1933
|
+
l([
|
|
1934
|
+
u()
|
|
1935
|
+
], r.prototype, "searchText", 2);
|
|
1936
|
+
l([
|
|
1937
|
+
P(["searchText"]),
|
|
1938
|
+
te(200)
|
|
1939
|
+
], r.prototype, "onSearch", 1);
|
|
1940
|
+
l([
|
|
1941
|
+
P("cacheLocation")
|
|
1942
|
+
], r.prototype, "handleCacheLocationChange", 1);
|
|
1943
|
+
r = l([
|
|
1944
|
+
W("cx-file-on-demand")
|
|
1945
|
+
], r);
|
|
1946
|
+
export {
|
|
1947
|
+
r as C,
|
|
1948
|
+
Ve as a,
|
|
1949
|
+
Ne as b,
|
|
1950
|
+
Be as c,
|
|
1951
|
+
ft as d,
|
|
1952
|
+
He as e,
|
|
1953
|
+
We as i,
|
|
1954
|
+
ze as o,
|
|
1955
|
+
Oe as s
|
|
1956
|
+
};
|