@orangelogic/design-system 2.114.0 → 2.116.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.
Files changed (43) hide show
  1. package/library/chunks/{asset.Drl4D1c7.js → asset.D_xAgoOX.js} +16 -14
  2. package/library/chunks/{color-swatch-group.5Mqr0rNP.js → color-swatch-group.BvLicLI4.js} +1 -1
  3. package/library/chunks/{document-viewer.Cui5mV3v.js → document-viewer.CKCX8ueu.js} +2285 -2269
  4. package/library/chunks/{list-editor.BBgFSBlF.js → list-editor.on8VVRn-.js} +161 -161
  5. package/library/chunks/{table.DLrle5SR.js → table.GCs54Y2t.js} +764 -666
  6. package/library/chunks/{time.BiQnh9wt.js → time.BSmpFe2G.js} +2 -2
  7. package/library/chunks/waveform.1U9U_0rd.js +60 -0
  8. package/library/components/asset-link-format.js +1 -1
  9. package/library/components/atoms.js +2 -2
  10. package/library/components/audio.js +132 -183
  11. package/library/components/color-swatch-group.js +2 -2
  12. package/library/components/document-viewer.js +1 -1
  13. package/library/components/format-time.js +1 -1
  14. package/library/components/list-editor.js +2 -2
  15. package/library/components/molecules.js +1 -1
  16. package/library/components/organisms.js +1 -1
  17. package/library/components/table.js +6 -6
  18. package/library/components/types.js +23098 -22860
  19. package/library/package.json +1 -1
  20. package/library/packages/atoms/src/components/audio/audio.d.ts +36 -28
  21. package/library/packages/atoms/src/components/table/table-data-loader.d.ts +1 -0
  22. package/library/packages/atoms/src/components/table/table.d.ts +1 -0
  23. package/library/packages/events/src/cx-facet-change.d.ts +16 -0
  24. package/library/packages/events/src/cx-faceted-filter-change.d.ts +6 -1
  25. package/library/packages/events/src/events.d.ts +1 -0
  26. package/library/packages/hybrid/book-reader/src/react/components/Controller/PageControl.d.ts +2 -1
  27. package/library/packages/hybrid/book-reader/src/react/hooks/useBreakpoint.d.ts +5 -1
  28. package/library/packages/molecules/src/faceted-filter/components/facet-date-picker/facet-date-picker.d.ts +43 -0
  29. package/library/packages/molecules/src/faceted-filter/components/facet-date-picker/facet-date-picker.styles.d.ts +2 -0
  30. package/library/packages/molecules/src/faceted-filter/components/facet-date-range/facet-date-range.d.ts +51 -0
  31. package/library/packages/molecules/src/faceted-filter/components/facet-date-range/facet-date-range.styles.d.ts +2 -0
  32. package/library/packages/molecules/src/faceted-filter/facet-adapters.d.ts +12 -0
  33. package/library/packages/molecules/src/faceted-filter/faceted-filter.d.ts +14 -3
  34. package/library/packages/molecules/src/index.d.ts +3 -0
  35. package/library/packages/organisms/src/content-builder/configs/audio.d.ts +1 -1
  36. package/library/packages/organisms/src/content-builder/configs-controller.d.ts +2 -2
  37. package/library/packages/types/src/faceted-filter.d.ts +71 -2
  38. package/library/packages/utils/src/image/index.d.ts +1 -0
  39. package/library/packages/utils/src/image/waveform.d.ts +29 -0
  40. package/library/react-web-component.d.ts +317 -194
  41. package/library/utils.js +174 -171
  42. package/package.json +1 -1
  43. package/library/chunks/wavesurfer.esm.Cwi1pz64.js +0 -1276
@@ -111,8 +111,8 @@ export {
111
111
  D as M,
112
112
  m as S,
113
113
  a as U,
114
- N as a,
114
+ w as a,
115
115
  H as c,
116
- w as f,
116
+ N as f,
117
117
  y as g
118
118
  };
@@ -0,0 +1,60 @@
1
+ function $(o, l, u, e, c, n) {
2
+ let r = -1, a = -1;
3
+ for (let t = e; t < c; t++)
4
+ for (let s = 0; s < u; s++) {
5
+ const i = (s * l + t) * 4;
6
+ (0.299 * o[i] + 0.587 * o[i + 1] + 0.114 * o[i + 2]) / 255 < n && o[i + 3] > 128 && (r === -1 && (r = s), a = s);
7
+ }
8
+ return r === -1 ? 0 : (a - r) / u;
9
+ }
10
+ async function p(o, l) {
11
+ const u = l?.threshold ?? 0.92;
12
+ try {
13
+ const e = new Image();
14
+ e.crossOrigin = "anonymous", e.src = o, await e.decode();
15
+ const { naturalHeight: c, naturalWidth: n } = e, r = l?.sampleCount ?? n, a = document.createElement("canvas");
16
+ a.width = n, a.height = c;
17
+ const t = a.getContext("2d");
18
+ if (!t)
19
+ return null;
20
+ let s;
21
+ try {
22
+ t.drawImage(e, 0, 0), s = t.getImageData(0, 0, n, c);
23
+ } catch {
24
+ return null;
25
+ }
26
+ const { data: i } = s, m = [];
27
+ for (let h = 0; h < r; h++) {
28
+ const f = Math.floor(h / r * n), x = Math.floor((h + 1) / r * n);
29
+ m.push($(i, n, c, f, x === f ? f + 1 : x, u));
30
+ }
31
+ const d = Math.max(...m), g = d > 0 ? m.map((h) => h / d) : m;
32
+ return { height: c, peaks: g, width: n };
33
+ } catch {
34
+ return null;
35
+ }
36
+ }
37
+ function F(o, l, u) {
38
+ if (o.length === 0)
39
+ return "";
40
+ const e = u / 2, c = u / 2, n = o.length, r = l / n, a = [`M0 ${(e - o[0] * c).toFixed(2)}`];
41
+ for (let t = 0; t < n - 1; t++)
42
+ a.push(
43
+ `H${((t + 1) * r).toFixed(2)}`,
44
+ `V${(e - o[t + 1] * c).toFixed(2)}`
45
+ );
46
+ a.push(
47
+ `H${l}`,
48
+ `V${(e + o[n - 1] * c).toFixed(2)}`
49
+ );
50
+ for (let t = n - 1; t > 0; t--)
51
+ a.push(
52
+ `H${(t * r).toFixed(2)}`,
53
+ `V${(e + o[t - 1] * c).toFixed(2)}`
54
+ );
55
+ return a.push("H0", "Z"), a.join(" ");
56
+ }
57
+ export {
58
+ F as b,
59
+ p as e
60
+ };
@@ -3,7 +3,7 @@ import { C as B } from "../chunks/button.DwJEeW2t.js";
3
3
  import _ from "./space.js";
4
4
  import { C as F } from "../chunks/typography.DJC_UXgs.js";
5
5
  import { n, C as W } from "../chunks/lib-cortex-element.CVMmyPMC.js";
6
- import { b as rt, c as ht } from "../chunks/asset.Drl4D1c7.js";
6
+ import { c as rt, d as ht } from "../chunks/asset.D_xAgoOX.js";
7
7
  import { c as E } from "../chunks/component.styles.CRO4Odto.js";
8
8
  import { U as a, T as l } from "../chunks/asset-link-format.B0c92pSs.js";
9
9
  import { c as N } from "../chunks/custom-element.L4WJXn1j.js";
@@ -19,7 +19,7 @@ import { default as K } from "./date-calendar.js";
19
19
  import { default as W } from "./details.js";
20
20
  import { C as Y } from "../chunks/dialog.BYCWepBc.js";
21
21
  import { default as _ } from "./divider.js";
22
- import { C as oe } from "../chunks/document-viewer.Cui5mV3v.js";
22
+ import { C as oe } from "../chunks/document-viewer.CKCX8ueu.js";
23
23
  import { C as ae } from "../chunks/dot-pagination.C4l5vKor.js";
24
24
  import { default as xe } from "./dot-status.js";
25
25
  import { default as me } from "./drawer.js";
@@ -74,7 +74,7 @@ import { default as Uo } from "./stepper.js";
74
74
  import { default as Xo } from "./switch.js";
75
75
  import { default as Zo } from "./tab.js";
76
76
  import { C as et } from "../chunks/tab-group.DvMX02hY.js";
77
- import { C as tt } from "../chunks/table.DLrle5SR.js";
77
+ import { C as tt } from "../chunks/table.GCs54Y2t.js";
78
78
  import { default as rt } from "./tab-panel.js";
79
79
  import { default as ft } from "./tag.js";
80
80
  import { default as st } from "./textarea.js";
@@ -1,45 +1,27 @@
1
- import { r as m, R as y } from "../chunks/resizable-component.styles.DpK0TTP5.js";
1
+ import { r as f, R as y } from "../chunks/resizable-component.styles.DpK0TTP5.js";
2
2
  import { c as v } from "../chunks/component.styles.CRO4Odto.js";
3
- import { c as g } from "../chunks/custom-element.L4WJXn1j.js";
4
- import { L as S } from "../chunks/i18n.CH-wak_P.js";
5
- import { w as f } from "../chunks/watch.CThbualB.js";
6
- import { i as w, x as p } from "../chunks/lit-element.jLBm65_O.js";
7
- import { n as c } from "../chunks/lib-cortex-element.CVMmyPMC.js";
8
- import { r as u } from "../chunks/state.CSDxrqLd.js";
9
- import { r as x } from "../chunks/query-async.CTgXGyQ5.js";
3
+ import { U as u, g, f as x, D as w } from "../chunks/time.BSmpFe2G.js";
4
+ import { c as _ } from "../chunks/custom-element.L4WJXn1j.js";
5
+ import { L as b } from "../chunks/i18n.CH-wak_P.js";
6
+ import { w as m } from "../chunks/watch.CThbualB.js";
7
+ import { e as S, b as P } from "../chunks/waveform.1U9U_0rd.js";
8
+ import { i as $, b as z, x as h } from "../chunks/lit-element.jLBm65_O.js";
9
+ import { n } from "../chunks/lib-cortex-element.CVMmyPMC.js";
10
+ import { r as s } from "../chunks/state.CSDxrqLd.js";
11
+ import { e as E } from "../chunks/query.BBf1UFkC.js";
10
12
  import { e as C } from "../chunks/class-map.BiVq-cVR.js";
11
13
  import { n as d } from "../chunks/when.Dr1es41R.js";
12
- import { C as b } from "../chunks/icon-button.CQiBjznj.js";
13
- import { C as W } from "../chunks/typography.DJC_UXgs.js";
14
- const _ = w`:host{background-color:var(--background-color,var(--cx-color-neutral-0));border-radius:var(--border-radius,0px);border:var(--border,0px);box-sizing:border-box;color:var(--text-color,var(--cx-color-neutral));height:var(--height,auto);width:var(--width,100%);border-style:solid;display:block;position:relative}.audio{border-radius:inherit;gap:var(--cx-spacing-x-small,4px);height:100%;padding:var(--cx-spacing-small,8px);flex-direction:column;justify-content:center;display:flex;overflow:hidden}.audio--empty{height:var(--height,200px);min-height:var(--min-height,100%);padding:0}.audio--empty:before{background-color:var(--cx-color-neutral-1000);color:var(--cx-color-neutral-0);content:attr(data-empty-label);font-family:var(--cx-font-sans);font-size:clamp(var(--cx-font-size-x-small), 4cqw, var(--cx-font-size-large));font-weight:var(--cx-font-weight-semibold);text-align:center;height:100%;text-shadow:.05em .05em .1em var(--cx-color-neutral-1000);justify-content:center;align-items:center;width:100%;line-height:1;display:flex}.audio__play-button{--cx-input-border-width:2px;--cx-input-border-color:var(--text-color,var(--cx-color-neutral))}.audio__play-button::part(base){width:50px;height:50px;color:var(--text-color,var(--cx-color-neutral))!important}.audio__player{align-items:center;gap:var(--cx-spacing-small,8px);display:flex}.audio__waveform{flex:1;min-width:0;overflow:hidden}.audio__footer{font-size:var(--cx-font-size-x-small,11px);color:var(--text-color,var(--cx-color-neutral));flex-direction:column;gap:0;padding-left:2px;display:flex}.audio__time{color:var(--text-color,var(--cx-color-neutral));font-variant-numeric:tabular-nums}.audio__filename{opacity:.75;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}`;
15
- var P = Object.defineProperty, z = Object.getOwnPropertyDescriptor, n = (e, t, r, o) => {
16
- for (var i = o > 1 ? void 0 : o ? z(t, r) : t, s = e.length - 1, l; s >= 0; s--)
17
- (l = e[s]) && (i = (o ? l(t, r, i) : l(i)) || i);
18
- return o && i && P(t, r, i), i;
14
+ import { C as k } from "../chunks/icon-button.CQiBjznj.js";
15
+ import { C as T } from "../chunks/typography.DJC_UXgs.js";
16
+ const A = $`audio{display:none}:host{background-color:var(--background-color,var(--cx-color-neutral-0));border-radius:var(--border-radius,0px);border:var(--border,0px);box-sizing:border-box;color:var(--text-color,var(--cx-color-neutral));height:var(--height,auto);width:var(--width,100%);border-style:solid;display:block;position:relative}.audio{border-radius:inherit;gap:var(--cx-spacing-x-small,4px);height:100%;padding:var(--cx-spacing-small,8px);flex-direction:column;justify-content:center;display:flex;overflow:hidden}.audio--empty{height:var(--height,200px);min-height:var(--min-height,100%);padding:0}.audio--empty:before{background-color:var(--cx-color-neutral-1000);color:var(--cx-color-neutral-0);content:attr(data-empty-label);font-family:var(--cx-font-sans);font-size:clamp(var(--cx-font-size-x-small), 4cqw, var(--cx-font-size-large));font-weight:var(--cx-font-weight-semibold);text-align:center;height:100%;text-shadow:.05em .05em .1em var(--cx-color-neutral-1000);justify-content:center;align-items:center;width:100%;line-height:1;display:flex}.audio__play-button{--cx-input-border-width:2px;--cx-input-border-color:var(--text-color,var(--cx-color-neutral))}.audio__play-button::part(base){width:50px;height:50px;color:var(--text-color,var(--cx-color-neutral))!important}.audio__player{align-items:center;gap:var(--cx-spacing-small,8px);height:148px;display:flex}.audio__waveform{flex:1;min-width:0;overflow:hidden}.audio__waveform-svg{cursor:pointer;flex:1;width:100%;min-width:0;height:100%;display:block;overflow:hidden}.audio__waveform-wave{fill:var(--waves-color,var(--cx-color-primary))}.audio__waveform-played{fill:var(--played-color,color-mix(in srgb, var(--waves-color,var(--cx-color-primary)) 50%, white))}.audio__waveform-playhead{fill:var(--playhead-color,var(--cx-color-neutral-0));opacity:.9}.audio__footer{font-size:var(--cx-font-size-x-small,11px);color:var(--text-color,var(--cx-color-neutral));flex-direction:column;gap:0;padding-left:2px;display:flex}.audio__time{color:var(--text-color,var(--cx-color-neutral));font-variant-numeric:tabular-nums}.audio__filename{opacity:.75;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}`;
17
+ var B = Object.defineProperty, W = Object.getOwnPropertyDescriptor, i = (t, a, o, r) => {
18
+ for (var l = r > 1 ? void 0 : r ? W(a, o) : a, c = t.length - 1, p; c >= 0; c--)
19
+ (p = t[c]) && (l = (r ? p(a, o, l) : p(l)) || l);
20
+ return r && l && B(a, o, l), l;
19
21
  };
20
- function $(e) {
21
- const t = "light-dark(";
22
- if (!e.startsWith(t) || !e.endsWith(")"))
23
- return null;
24
- const r = e.slice(t.length, -1);
25
- let o = 0, i = -1;
26
- for (let h = 0; h < r.length; h++)
27
- if (r[h] === "(")
28
- o++;
29
- else if (r[h] === ")")
30
- o--;
31
- else if (r[h] === "," && o === 0) {
32
- i = h;
33
- break;
34
- }
35
- if (i === -1)
36
- return null;
37
- const s = r.slice(0, i).trim(), l = r.slice(i + 1).trim();
38
- return !CSS.supports("color", s) || !CSS.supports("color", l) ? null : [s, l];
39
- }
40
- let a = class extends y {
22
+ let e = class extends y {
41
23
  constructor() {
42
- super(), this.localize = new S(this), this.waveSurfer = null, this.srcLoadVersion = 0, this.src = "", this.name = "", this.autoplay = !1, this.loop = !1, this.waveColor = ["", ""], this.isPlaying = !1, this.isLoaded = !1, this.isError = !1, this.currentTimeSeconds = 0, this.durationSeconds = 0, this.onWaveSurferReady = this.onWaveSurferReady.bind(this), this.onWaveSurferPlay = this.onWaveSurferPlay.bind(this), this.onWaveSurferPause = this.onWaveSurferPause.bind(this), this.onWaveSurferTimeUpdate = this.onWaveSurferTimeUpdate.bind(this), this.onWaveSurferFinish = this.onWaveSurferFinish.bind(this), this.onWaveSurferError = this.onWaveSurferError.bind(this);
24
+ super(...arguments), this.localize = new b(this), this.srcLoadVersion = 0, this.extractWaveformPeaks = S, this.src = "", this.name = "", this.autoplay = !1, this.loop = !1, this.waveformSrc = "", this.isPlaying = !1, this.isLoaded = !1, this.isError = !1, this.currentTimeSeconds = 0, this.durationSeconds = 0, this.waveformPath = "", this.waveformViewBoxWidth = 1e3, this.playedFraction = 0, this.audioSrc = "";
43
25
  }
44
26
  runConnectedCallback() {
45
27
  this.hasUpdated && this.requestUpdate("src");
@@ -50,188 +32,155 @@ let a = class extends y {
50
32
  async handleSrcChange() {
51
33
  await this.applySrc(this.src);
52
34
  }
53
- async applySrc(e) {
54
- const t = ++this.srcLoadVersion;
55
- if (this.isLoaded = !1, this.isPlaying = !1, !e) {
35
+ async applySrc(t) {
36
+ const a = ++this.srcLoadVersion;
37
+ if (this.isLoaded = !1, this.isPlaying = !1, !this.waveformSrc) {
56
38
  this.cleanUp();
57
39
  return;
58
40
  }
59
- await this.waveformContainerAsync, !(t !== this.srcLoadVersion || !this.isConnected) && await this.setupWaveSurfer(e, t);
41
+ await this.setupPngWaveform(t, a);
60
42
  }
61
- async handleWaveColorThemeChange() {
62
- this.src && this.waveSurfer && (await this.updateComplete, this.waveSurfer.setOptions(this.setupColors()));
43
+ updated(t) {
44
+ super.updated(t), (t.has("width") || t.has("height") || t.has("resizeSize")) && this.handleSizeChange();
63
45
  }
64
- updated(e) {
65
- super.updated(e), (e.has("width") || e.has("height") || e.has("resizeSize")) && this.handleSizeChange();
46
+ cleanUp() {
47
+ this.audioEl?.pause(), this.audioSrc = "", this.waveformPath = "", this.waveformViewBoxWidth = 1e3, this.playedFraction = 0, this.isLoaded = !1, this.isPlaying = !1, this.currentTimeSeconds = 0, this.durationSeconds = 0;
66
48
  }
67
- onWaveSurferReady() {
68
- this.isLoaded = !0, this.durationSeconds = this.waveSurfer.getDuration();
49
+ async setupPngWaveform(t, a) {
50
+ this.cleanUp();
51
+ const o = await this.extractWaveformPeaks(this.waveformSrc);
52
+ if (a !== this.srcLoadVersion || !this.isConnected)
53
+ return;
54
+ if (!o) {
55
+ this.isError = !0, this.emit("cx-error");
56
+ return;
57
+ }
58
+ const r = o.peaks.length;
59
+ this.waveformViewBoxWidth = r, this.waveformPath = P(o.peaks, r, 200), t && (this.audioSrc = t), this.isLoaded = !0, this.autoplay && t && (await this.updateComplete, this.audioEl?.play());
69
60
  }
70
- onWaveSurferPlay() {
61
+ handleAudioPlay() {
71
62
  this.isPlaying = !0, this.emit("cx-play");
72
63
  }
73
- onWaveSurferPause() {
64
+ handleAudioPause() {
74
65
  this.isPlaying = !1, this.emit("cx-pause");
75
66
  }
76
- onWaveSurferTimeUpdate(e) {
77
- this.currentTimeSeconds = e, this.emit("cx-time-update", {
78
- detail: {
79
- time: e
80
- }
81
- });
67
+ handleAudioTimeUpdate() {
68
+ if (!this.audioEl)
69
+ return;
70
+ const t = this.audioEl.duration ? this.audioEl.currentTime / this.audioEl.duration : 0;
71
+ this.playedFraction = t, this.style.setProperty("--played-fraction", String(t)), this.currentTimeSeconds = this.audioEl.currentTime, this.emit("cx-time-update", { detail: { time: this.audioEl.currentTime } });
72
+ }
73
+ handleAudioDurationChange() {
74
+ this.durationSeconds = this.audioEl?.duration || 0;
82
75
  }
83
- onWaveSurferFinish() {
76
+ handleAudioEnded() {
84
77
  this.isPlaying = !1, this.emit("cx-ended");
85
78
  }
86
- onWaveSurferError() {
87
- this.isError = !0, this.emit("cx-error");
88
- }
89
- resolveColorValue(e) {
90
- if (!e.startsWith("var("))
91
- return e;
92
- const t = e.match(/var\(\s*(--[\w-]+)/)?.[1];
93
- return t && getComputedStyle(this).getPropertyValue(t).trim() || e;
94
- }
95
- computeCursorColor(e) {
96
- const t = document.createElement("canvas");
97
- t.width = 1, t.height = 1;
98
- const r = t.getContext("2d");
99
- if (!r)
100
- return e;
101
- r.fillStyle = e, r.fillRect(0, 0, 1, 1);
102
- const [o, i, s] = r.getImageData(0, 0, 1, 1).data;
103
- return (0.299 * o + 0.587 * i + 0.114 * s) / 255 > 0.5 ? `rgb(${Math.round(o * 0.5)}, ${Math.round(i * 0.5)}, ${Math.round(s * 0.5)})` : `rgb(${Math.round(o + (255 - o) * 0.5)}, ${Math.round(i + (255 - i) * 0.5)}, ${Math.round(s + (255 - s) * 0.5)})`;
104
- }
105
- setupColors() {
106
- const t = getComputedStyle(this).getPropertyValue("--cx-color-primary").trim(), r = (this.theme === "dark" ? this.waveColor[1] : this.waveColor[0]) || t, o = this.resolveColorValue(r), i = this.resolveColorValue(
107
- this.theme === "dark" ? this.waveColor[1] : this.waveColor[0]
108
- ), s = this.computeCursorColor(o);
109
- return {
110
- cursorColor: s,
111
- progressColor: s,
112
- waveColor: i
113
- };
114
- }
115
- async setupWaveSurfer(e, t = this.srcLoadVersion) {
116
- this.cleanUp();
117
- const r = await this.waveformContainerAsync;
118
- if (t !== this.srcLoadVersion || !r || !e || !this.isConnected)
119
- return;
120
- const { default: o } = await import("../chunks/wavesurfer.esm.Cwi1pz64.js");
121
- t !== this.srcLoadVersion || !this.isConnected || (this.waveSurfer = o.create({
122
- barGap: 1,
123
- barRadius: 2,
124
- barWidth: 2,
125
- container: r,
126
- height: "auto",
127
- normalize: !0,
128
- url: e,
129
- ...this.setupColors()
130
- }), this.attachWaveSurferEvents(), this.autoplay && this.waveSurfer.play());
131
- }
132
- attachWaveSurferEvents() {
133
- this.waveSurfer && (this.waveSurfer.on("ready", this.onWaveSurferReady), this.waveSurfer.on("play", this.onWaveSurferPlay), this.waveSurfer.on("pause", this.onWaveSurferPause), this.waveSurfer.on("timeupdate", this.onWaveSurferTimeUpdate), this.waveSurfer.on("finish", this.onWaveSurferFinish), this.waveSurfer.on("error", this.onWaveSurferError));
134
- }
135
- cleanUp() {
136
- this.waveSurfer && (this.waveSurfer.destroy(), this.waveSurfer = null), this.isLoaded = !1, this.isPlaying = !1, this.currentTimeSeconds = 0, this.durationSeconds = 0;
79
+ handleAudioError() {
80
+ this.audioSrc && (this.isError = !0, this.emit("cx-error"));
137
81
  }
138
82
  handleSizeChange() {
139
- const e = this.isResizing ? `${this.resizeSize.width}px` : this.width, t = this.isResizing ? `${this.resizeSize.height}px` : this.height;
140
- this.width || this.isResizing ? this.style.setProperty("--width", e) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", t) : this.style.removeProperty("--height");
83
+ const t = this.isResizing ? `${this.resizeSize.width}px` : this.width, a = this.isResizing ? `${this.resizeSize.height}px` : this.height;
84
+ this.width || this.isResizing ? this.style.setProperty("--width", t) : this.style.removeProperty("--width"), this.height || this.isResizing ? this.style.setProperty("--height", a) : this.style.removeProperty("--height");
141
85
  }
142
86
  /** Starts audio playback. */
143
87
  play() {
144
- this.waveSurfer?.play();
88
+ this.audioEl?.play();
145
89
  }
146
90
  /** Pauses audio playback. */
147
91
  pause() {
148
- this.waveSurfer?.pause();
92
+ this.audioEl?.pause();
149
93
  }
150
94
  /** Toggles between play and pause. */
151
95
  togglePlay() {
152
96
  this.isPlaying ? this.pause() : this.play();
153
97
  }
154
- formatTime(e) {
155
- const t = Math.floor(e / 60), r = Math.floor(e % 60);
156
- return `${t}:${r.toString().padStart(2, "0")}`;
98
+ formatTime(t) {
99
+ const o = this.durationSeconds >= 3600 ? u.HourMinuteSecond : u.MinuteSecond, r = g(t * 1e3, o);
100
+ return x(r, w.Digital);
101
+ }
102
+ handleWaveformClick(t) {
103
+ if (t.stopPropagation(), !this.audioEl || !this.durationSeconds)
104
+ return;
105
+ const o = t.currentTarget.getBoundingClientRect(), r = Math.max(0, Math.min(1, (t.clientX - o.left) / o.width));
106
+ this.audioEl.currentTime = r * this.durationSeconds;
157
107
  }
158
- handlePlayButtonKeyDown(e) {
159
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), this.togglePlay());
108
+ handlePlayButtonKeyDown(t) {
109
+ (t.key === "Enter" || t.key === " ") && (t.preventDefault(), this.togglePlay());
160
110
  }
161
111
  render() {
162
- const e = !this.src, t = this.formatTime(this.currentTimeSeconds), r = this.formatTime(this.durationSeconds);
163
- return p`<div part="base" class=${C({ audio: !0, "audio--empty": e })} data-empty-label=${this.localize.term("emptyAudio")} @click=${this.startResizing}>${d(
164
- !e,
165
- () => p`<div part="player" class="audio__player"><cx-icon-button part="play-button" class="audio__play-button" aria-pressed=${String(this.isPlaying)} circle label=${this.localize.term(this.isPlaying ? "pause" : "play")} name=${this.isPlaying ? "pause" : "play_arrow"} variant="filled" outline @click=${this.togglePlay} @keydown=${this.handlePlayButtonKeyDown}></cx-icon-button><div part="waveform" class="audio__waveform"></div></div><div part="footer" class="audio__footer"><cx-typography part="time" variant="small" class="audio__time">${t} / ${r}</cx-typography>${d(
112
+ const t = !this.src && !this.waveformSrc, a = this.formatTime(this.currentTimeSeconds), o = this.formatTime(this.durationSeconds);
113
+ return h`<audio src=${this.audioSrc} ?loop=${this.loop} @play=${this.handleAudioPlay} @pause=${this.handleAudioPause} @timeupdate=${this.handleAudioTimeUpdate} @durationchange=${this.handleAudioDurationChange} @ended=${this.handleAudioEnded} @error=${this.handleAudioError}></audio><div part="base" class=${C({ audio: !0, "audio--empty": t })} data-empty-label=${this.localize.term("emptyAudio")} @click=${this.startResizing}>${d(
114
+ !t,
115
+ () => h`<div part="player" class="audio__player"><cx-icon-button part="play-button" class="audio__play-button" aria-pressed=${String(this.isPlaying)} circle label=${this.localize.term(this.isPlaying ? "pause" : "play")} name=${this.isPlaying ? "pause" : "play_arrow"} variant="filled" outline @click=${this.togglePlay} @keydown=${this.handlePlayButtonKeyDown}></cx-icon-button>${d(
116
+ this.waveformPath,
117
+ () => z`<svg class="audio__waveform-svg" part="waveform-svg" viewBox="0 0 ${this.waveformViewBoxWidth} 200" preserveAspectRatio="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true" @click=${this.handleWaveformClick}><path class="audio__waveform-wave" d=${this.waveformPath} /><svg x="0" y="0" width=${String(Math.round(this.playedFraction * this.waveformViewBoxWidth))} height="200" overflow="hidden"><path class="audio__waveform-played" d=${this.waveformPath} /></svg><rect class="audio__waveform-playhead" x=${String(Math.max(0, Math.round(this.playedFraction * this.waveformViewBoxWidth) - 1))} y="0" width="2" height="200"/></svg>`,
118
+ () => h`<div part="waveform" class="audio__waveform"></div>`
119
+ )}</div><div part="footer" class="audio__footer"><cx-typography part="time" variant="small" class="audio__time">${a} / ${o}</cx-typography>${d(
166
120
  this.name,
167
- () => p`<cx-typography part="filename" class="audio__filename">${this.name}</cx-typography>`
121
+ () => h`<cx-typography part="filename" class="audio__filename">${this.name}</cx-typography>`
168
122
  )}</div>`
169
123
  )}</div>${d(this.resizable && this.isResizeActive, () => this.renderResizer())}
170
124
  `;
171
125
  }
172
126
  };
173
- a.styles = [v, m, _];
174
- a.dependencies = {
175
- "cx-icon-button": b,
176
- "cx-typography": W
127
+ e.styles = [v, f, A];
128
+ e.dependencies = {
129
+ "cx-icon-button": k,
130
+ "cx-typography": T
177
131
  };
178
- n([
179
- x(".audio__waveform")
180
- ], a.prototype, "waveformContainerAsync", 2);
181
- n([
182
- c({ reflect: !0, type: String })
183
- ], a.prototype, "src", 2);
184
- n([
185
- c({ reflect: !0, type: String })
186
- ], a.prototype, "name", 2);
187
- n([
188
- c({ reflect: !0, type: Boolean })
189
- ], a.prototype, "autoplay", 2);
190
- n([
191
- c({ reflect: !0, type: Boolean })
192
- ], a.prototype, "loop", 2);
193
- n([
194
- c({
195
- attribute: "wave-color",
196
- converter: {
197
- fromAttribute(e) {
198
- if (!e)
199
- return ["", ""];
200
- const t = $(e);
201
- return t || (CSS.supports("color", e) ? [e, e] : ["", ""]);
202
- },
203
- toAttribute([e, t]) {
204
- return e === t ? e : `light-dark(${e}, ${t})`;
205
- }
206
- },
207
- reflect: !0
208
- })
209
- ], a.prototype, "waveColor", 2);
210
- n([
211
- u()
212
- ], a.prototype, "isPlaying", 2);
213
- n([
214
- u()
215
- ], a.prototype, "isLoaded", 2);
216
- n([
217
- u()
218
- ], a.prototype, "isError", 2);
219
- n([
220
- u()
221
- ], a.prototype, "currentTimeSeconds", 2);
222
- n([
223
- u()
224
- ], a.prototype, "durationSeconds", 2);
225
- n([
226
- f("src")
227
- ], a.prototype, "handleSrcChange", 1);
228
- n([
229
- f("theme", { waitUntilFirstUpdate: !0 }),
230
- f("waveColor", { waitUntilFirstUpdate: !0 })
231
- ], a.prototype, "handleWaveColorThemeChange", 1);
232
- a = n([
233
- g("cx-audio")
234
- ], a);
132
+ i([
133
+ E("audio")
134
+ ], e.prototype, "audioEl", 2);
135
+ i([
136
+ n({ reflect: !0, type: String })
137
+ ], e.prototype, "src", 2);
138
+ i([
139
+ n({ reflect: !0, type: String })
140
+ ], e.prototype, "name", 2);
141
+ i([
142
+ n({ reflect: !0, type: Boolean })
143
+ ], e.prototype, "autoplay", 2);
144
+ i([
145
+ n({ reflect: !0, type: Boolean })
146
+ ], e.prototype, "loop", 2);
147
+ i([
148
+ n({ attribute: "waveform-src", reflect: !0, type: String })
149
+ ], e.prototype, "waveformSrc", 2);
150
+ i([
151
+ s()
152
+ ], e.prototype, "isPlaying", 2);
153
+ i([
154
+ s()
155
+ ], e.prototype, "isLoaded", 2);
156
+ i([
157
+ s()
158
+ ], e.prototype, "isError", 2);
159
+ i([
160
+ s()
161
+ ], e.prototype, "currentTimeSeconds", 2);
162
+ i([
163
+ s()
164
+ ], e.prototype, "durationSeconds", 2);
165
+ i([
166
+ s()
167
+ ], e.prototype, "waveformPath", 2);
168
+ i([
169
+ s()
170
+ ], e.prototype, "waveformViewBoxWidth", 2);
171
+ i([
172
+ s()
173
+ ], e.prototype, "playedFraction", 2);
174
+ i([
175
+ s()
176
+ ], e.prototype, "audioSrc", 2);
177
+ i([
178
+ m("waveformSrc", { waitUntilFirstUpdate: !0 }),
179
+ m("src")
180
+ ], e.prototype, "handleSrcChange", 1);
181
+ e = i([
182
+ _("cx-audio")
183
+ ], e);
235
184
  export {
236
- a as default
185
+ e as default
237
186
  };
@@ -1,10 +1,10 @@
1
1
  import "./space.js";
2
- import "../chunks/table.DLrle5SR.js";
2
+ import "../chunks/table.GCs54Y2t.js";
3
3
  import "../chunks/typography.DJC_UXgs.js";
4
4
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
5
5
  import "../chunks/color-swatch.DVzEaNeL.js";
6
6
  import "../chunks/component.styles.CRO4Odto.js";
7
- import { C as w } from "../chunks/color-swatch-group.5Mqr0rNP.js";
7
+ import { C as w } from "../chunks/color-swatch-group.BvLicLI4.js";
8
8
  import "../chunks/content-builder.OsUmm8Wu.js";
9
9
  import "../chunks/custom-element.L4WJXn1j.js";
10
10
  import "../chunks/debounce.CIEhztrj.js";
@@ -1,5 +1,5 @@
1
1
  import "../chunks/resizable-component.styles.DpK0TTP5.js";
2
- import { C as b } from "../chunks/document-viewer.Cui5mV3v.js";
2
+ import { C as b } from "../chunks/document-viewer.CKCX8ueu.js";
3
3
  import "../chunks/component.styles.CRO4Odto.js";
4
4
  import "../chunks/index.Cpamj0jB.js";
5
5
  import "../chunks/custom-element.L4WJXn1j.js";
@@ -1,6 +1,6 @@
1
1
  import { n as l, C as h } from "../chunks/lib-cortex-element.CVMmyPMC.js";
2
2
  import { c as y } from "../chunks/component.styles.CRO4Odto.js";
3
- import { U as r, D as u, L as D, F as d, g as S, f as F, c as U, a as g, S as _ } from "../chunks/time.BiQnh9wt.js";
3
+ import { U as r, D as u, L as D, F as d, g as S, a as F, c as U, f as g, S as _ } from "../chunks/time.BSmpFe2G.js";
4
4
  import { c as b } from "../chunks/custom-element.L4WJXn1j.js";
5
5
  import { L as N } from "../chunks/i18n.CH-wak_P.js";
6
6
  import { w as m } from "../chunks/watch.CThbualB.js";
@@ -9,7 +9,7 @@ import "./radio.js";
9
9
  import "./radio-group.js";
10
10
  import "./select.js";
11
11
  import "./space.js";
12
- import "../chunks/table.DLrle5SR.js";
12
+ import "../chunks/table.GCs54Y2t.js";
13
13
  import "../chunks/typography.DJC_UXgs.js";
14
14
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
15
15
  import "./dynamic-select.js";
@@ -18,7 +18,7 @@ import "../chunks/custom-element.L4WJXn1j.js";
18
18
  import "../chunks/debounce.CIEhztrj.js";
19
19
  import "../chunks/i18n.CH-wak_P.js";
20
20
  import "../chunks/watch.CThbualB.js";
21
- import { c as E, C as F } from "../chunks/list-editor.BBgFSBlF.js";
21
+ import { c as E, C as F } from "../chunks/list-editor.on8VVRn-.js";
22
22
  import "../chunks/lit-element.jLBm65_O.js";
23
23
  import "../chunks/state.CSDxrqLd.js";
24
24
  import "../chunks/query.BBf1UFkC.js";
@@ -6,7 +6,7 @@ import { default as s } from "./corner-position-input-group.js";
6
6
  import { default as m } from "./cropper.js";
7
7
  import { default as i } from "./dynamic-select.js";
8
8
  import { C as c } from "../chunks/folder-select.Bc9x2hMO.js";
9
- import { C as P } from "../chunks/list-editor.BBgFSBlF.js";
9
+ import { C as P } from "../chunks/list-editor.on8VVRn-.js";
10
10
  import { default as I } from "./masonry.js";
11
11
  import { default as y } from "./padding-input-group.js";
12
12
  import { default as w } from "./position-picker.js";
@@ -1,5 +1,5 @@
1
1
  import { default as a } from "./asset-link-format.js";
2
- import { C as t } from "../chunks/color-swatch-group.5Mqr0rNP.js";
2
+ import { C as t } from "../chunks/color-swatch-group.BvLicLI4.js";
3
3
  import { C } from "../chunks/file-on-demand.AwMj4AfO.js";
4
4
  export {
5
5
  a as CxAssetLinkFormat,
@@ -9,7 +9,7 @@ import "./spinner.js";
9
9
  import "../chunks/lib-cortex-element.CVMmyPMC.js";
10
10
  import "../chunks/component.styles.CRO4Odto.js";
11
11
  import "../chunks/overlayscrollbars.BMav4RQ4.js";
12
- import { A as z, k as F, l as P, d as S, g, b as y, i as A, m as D, n as I, c as f, a2 as h, a3 as E, D as G, o as H, E as j, p as k, F as K, q as L, r as V, s as q, G as B, t as J, u as N, j as O, v as Q, I as U, w as W, K as X, x as Y, M as Z, y as _, z as $, B as oo, J as eo, L as ao, N as so, O as lo, P as to, e as uo, Q as ro, h as Mo, U as io, V as po, W as mo, X as no, f as Co, R as Ro, Z as co, Y as bo, S as wo, _ as To, $ as vo, T as xo, a as zo, a0 as Fo, a1 as Po, C as So } from "../chunks/table.DLrle5SR.js";
12
+ import { A as z, l as F, m as P, d as g, h as y, b as A, j as S, n as D, o as I, c as f, a3 as h, a4 as E, D as G, p as H, E as j, q as k, F as K, r as L, s as V, t as q, G as B, u as J, v as N, k as O, w as Q, I as U, x as W, K as X, y as Y, M as Z, z as _, B as $, J as oo, L as eo, N as ao, O as so, Q as lo, P as to, e as uo, U as ro, i as Mo, V as io, W as po, X as mo, Y as no, g as Co, R as Ro, _ as co, Z as bo, f as wo, $ as To, a0 as vo, T as xo, a as zo, a1 as Fo, a2 as Po, C as go } from "../chunks/table.GCs54Y2t.js";
13
13
  import "../chunks/pagination.zQ2FFtxB.js";
14
14
  import "../chunks/custom-element.L4WJXn1j.js";
15
15
  import "../chunks/i18n.CH-wak_P.js";
@@ -23,10 +23,10 @@ export {
23
23
  z as AccessibilityModule,
24
24
  F as AccessorModule,
25
25
  P as AjaxModule,
26
- S as CalcComponent,
27
- g as Cell,
28
- y as CellComponent,
29
- A as ClickableCellModule,
26
+ g as CalcComponent,
27
+ y as Cell,
28
+ A as CellComponent,
29
+ S as ClickableCellModule,
30
30
  D as ClipboardModule,
31
31
  I as ColumnCalcsModule,
32
32
  f as ColumnComponent,
@@ -76,5 +76,5 @@ export {
76
76
  zo as TabulatorFull,
77
77
  Fo as TooltipModule,
78
78
  Po as ValidateModule,
79
- So as default
79
+ go as default
80
80
  };