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