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