@mintplayer/web-components 2.16.0 → 2.17.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 (117) hide show
  1. package/accordion/index.mjs +5 -5
  2. package/calendar/index.mjs +1 -1
  3. package/carousel/index.mjs +57 -143
  4. package/charts/core/index.mjs +30 -20
  5. package/charts/core/src/attributes.d.ts +18 -0
  6. package/charts/core/src/index.d.ts +2 -0
  7. package/charts/core/src/view-window.d.ts +46 -0
  8. package/charts/hierarchy/index.mjs +245 -256
  9. package/charts/hierarchy/src/components/mp-hierarchy-chart.d.ts +1 -3
  10. package/charts/sparkline/index.mjs +27 -26
  11. package/charts/trend/index.mjs +21 -20
  12. package/checkbox/index.mjs +1 -1
  13. package/checkbox/src/components/mp-checkbox.d.ts +1 -0
  14. package/chunks/attributes-L3eKsbdy.mjs +16 -0
  15. package/chunks/color-mode-warning-71FmlzWX.mjs +13 -0
  16. package/chunks/{form-check.styles-B0pxJ6YC.mjs → form-check.styles-DqvBnspm.mjs} +24 -3
  17. package/chunks/{mp-calendar.element-CJ8-t-Zn.mjs → mp-calendar.element-BIHS9SZZ.mjs} +11 -6
  18. package/chunks/{mp-checkbox-CzwS7Y_t.mjs → mp-checkbox-zV83gILn.mjs} +44 -36
  19. package/chunks/{mp-datatable-B7st6G-I.mjs → mp-datatable-eRpl7-2V.mjs} +173 -173
  20. package/chunks/{mp-datetime-picker.element-DsWA1AFs.mjs → mp-datetime-picker.element-Cxu5-qRE.mjs} +29 -32
  21. package/chunks/{mp-pagination-Dea75mD4.mjs → mp-pagination-hGy4dL7p.mjs} +9 -4
  22. package/chunks/{mp-radio-cL46sUA0.mjs → mp-radio-BhRVNdKp.mjs} +32 -28
  23. package/chunks/{mp-select-BNrbPwN4.mjs → mp-select-CgqYFvUj.mjs} +41 -26
  24. package/chunks/{mp-splitter-Ckn1kN4v.mjs → mp-splitter-DLehrw3Y.mjs} +144 -120
  25. package/chunks/{mp-timepicker.element-CwaAAOcm.mjs → mp-timepicker.element-BiB9lkgc.mjs} +58 -45
  26. package/chunks/{mp-toggle-button-eo_aTQtu.mjs → mp-toggle-button-CaS9uYLE.mjs} +26 -24
  27. package/chunks/{mp-treeview-C8iltDbq.mjs → mp-treeview-CaMTDrvY.mjs} +51 -50
  28. package/chunks/{overlay-controller-DifgO6jT.mjs → overlay-controller-BHDagokg.mjs} +96 -92
  29. package/chunks/{id-DNZVAnGC.mjs → resource.service--lqLwEqk.mjs} +144 -206
  30. package/chunks/view-window-DGvFiDnW.mjs +263 -0
  31. package/code-snippet/index.mjs +70 -66
  32. package/code-snippet/src/hljs-loaders.generated.d.ts +1 -1
  33. package/custom-elements.json +65750 -0
  34. package/datatable/index.mjs +1 -1
  35. package/datatable/src/components/column-resize.d.ts +11 -0
  36. package/datatable/src/components/mp-datatable.d.ts +5 -0
  37. package/datepicker/index.mjs +10 -9
  38. package/datetime-picker/index.mjs +1 -1
  39. package/datetime-picker/src/mp-datetime-picker.element.d.ts +3 -0
  40. package/dock/index.mjs +430 -463
  41. package/dock/src/components/mint-dock-manager.element.d.ts +25 -2
  42. package/dock/src/core/resize.d.ts +60 -0
  43. package/dropdown-menu/index.mjs +4 -2
  44. package/dropdown-menu/src/components/mp-dropdown-menu.d.ts +6 -1
  45. package/dropdown-menu/src/index.d.ts +1 -1
  46. package/dropdown-menu/src/types/dropdown.d.ts +14 -1
  47. package/dropdown-menu/src/types/index.d.ts +1 -1
  48. package/file-manager/index.mjs +63 -61
  49. package/file-manager/src/components/mp-file-manager.d.ts +4 -3
  50. package/multi-range/index.mjs +56 -50
  51. package/multi-range/src/mint-multi-range.element.d.ts +4 -10
  52. package/multi-range/src/pointer-geometry.d.ts +31 -0
  53. package/navbar/index.mjs +89 -439
  54. package/overlay/index.mjs +1 -1
  55. package/overlay/src/overlay-controller.d.ts +0 -14
  56. package/overlay/src/placement.d.ts +48 -0
  57. package/package.json +7 -1
  58. package/pagination/index.mjs +1 -1
  59. package/phone-input/index.mjs +44 -40
  60. package/phone-input/src/components/stack.d.ts +8 -0
  61. package/query-builder/index.mjs +418 -466
  62. package/query-builder/src/dnd/drag-controller.d.ts +12 -8
  63. package/query-builder/src/mp-query-builder.element.d.ts +5 -1
  64. package/query-builder/src/mp-query-condition.element.d.ts +1 -0
  65. package/radio/index.mjs +1 -1
  66. package/radio-group/index.mjs +1 -1
  67. package/ribbon/index.mjs +477 -498
  68. package/ribbon/src/core/band-text-color.d.ts +10 -0
  69. package/ribbon/src/core/key-tip-allocator.d.ts +10 -0
  70. package/ribbon/src/core/plan-reduce-steps.d.ts +62 -0
  71. package/ribbon/src/mp-ribbon.element.d.ts +0 -27
  72. package/scheduler/index.mjs +726 -711
  73. package/scheduler/src/components/mp-scheduler.d.ts +19 -3
  74. package/scheduler/src/drag/drag-manager.d.ts +1 -9
  75. package/scheduler/src/input/input-handler.d.ts +12 -2
  76. package/scheduler/src/utils/geometry.d.ts +39 -0
  77. package/scheduler/src/views/timeline-view.d.ts +0 -1
  78. package/scheduler-core/index.mjs +84 -71
  79. package/scheduler-core/src/services/resource.service.d.ts +0 -12
  80. package/scheduler-core/src/services/timeline.service.d.ts +0 -9
  81. package/select/index.mjs +1 -1
  82. package/select/src/components/mp-select.d.ts +1 -0
  83. package/signature-pad/index.mjs +21 -23
  84. package/signature-pad/src/canvas-point.d.ts +26 -0
  85. package/signature-pad/src/mp-signature-pad.element.d.ts +1 -7
  86. package/splitter/index.mjs +1 -1
  87. package/splitter/src/components/mp-splitter.d.ts +16 -0
  88. package/splitter/src/managers/index.d.ts +1 -0
  89. package/splitter/src/managers/rescale-panel-sizes.d.ts +14 -0
  90. package/swiper-core/index.mjs +2 -2
  91. package/theming/bs-theme-preboot.js +1 -0
  92. package/theming/color-mode.css +36 -0
  93. package/theming/index.d.ts +1 -0
  94. package/theming/index.mjs +327 -0
  95. package/theming/src/components/mp-theme-toggle.d.ts +71 -0
  96. package/theming/src/cookie.d.ts +31 -0
  97. package/theming/src/index.d.ts +5 -0
  98. package/theming/src/preboot.d.ts +1 -0
  99. package/theming/src/resolve.d.ts +36 -0
  100. package/theming/src/store.d.ts +27 -0
  101. package/theming/src/styles/theme-toggle.styles.d.ts +2 -0
  102. package/theming/src/testing/fake-broadcast-channel.d.ts +35 -0
  103. package/theming/src/toggle-modes.d.ts +23 -0
  104. package/tile-manager/index.mjs +252 -211
  105. package/tile-manager/src/components/mint-tile-manager.element.d.ts +8 -0
  106. package/tile-manager/src/utils/grid-geometry.d.ts +49 -0
  107. package/timeline/index.mjs +156 -164
  108. package/timeline/src/components/mp-timeline.d.ts +41 -7
  109. package/timepicker/index.mjs +7 -4
  110. package/timepicker/src/mp-time-list.element.d.ts +26 -0
  111. package/timepicker/src/mp-timepicker.element.d.ts +3 -0
  112. package/toggle-button/index.mjs +1 -1
  113. package/tree-select/index.mjs +21 -9
  114. package/treeview/index.mjs +1 -1
  115. package/treeview/src/components/mp-treeview.d.ts +6 -4
  116. package/chunks/color-DIeST-IS.mjs +0 -224
  117. package/query-builder/src/mp-query-condition.element.template.d.ts +0 -2
@@ -178,8 +178,8 @@ export declare class MintDockManagerElement extends LitElement {
178
178
  */
179
179
  private getSplitterPanels;
180
180
  /**
181
- * Locate the rendered `<mp-splitter>` element for a given DockPath
182
- * `segments` value (the split-tree path). Searches the dock's shadow.
181
+ * Locate the rendered `<mp-splitter>` for a split path — layer included,
182
+ * so a floating window's splitter never answers for a docked one.
183
183
  */
184
184
  private findSplitterByPath;
185
185
  private onPointerMove;
@@ -225,6 +225,20 @@ export declare class MintDockManagerElement extends LitElement {
225
225
  private updatePaneDragDropTargetFromPoint;
226
226
  private isPointerOverSourceHeader;
227
227
  private ensureHeaderDragPlaceholder;
228
+ /**
229
+ * The slotted children of a stack — the header spans, pane hosts and drag
230
+ * placeholders the dock owns. Every lookup among them walks this list and
231
+ * matches on the dataset instead of building a `:scope > [data-…="…"]`
232
+ * selector: an arbitrary pane name then never has to survive CSS escaping,
233
+ * and nothing depends on `CSS.escape` or `:scope`, neither of which every
234
+ * DOM implementation provides (jsdom has no `CSS.escape`, and matches
235
+ * nothing for `:scope >` here). Same reasoning as verifyProjectionSlots.
236
+ */
237
+ private stackChildren;
238
+ /** The direct child of `stack` carrying `className` for `pane`. */
239
+ private stackChildForPane;
240
+ /** The drag placeholder of `className` (header span or pane host) in `stack`. */
241
+ private stackPlaceholder;
228
242
  private updateHeaderDragPlaceholderPosition;
229
243
  private clearHeaderDragPlaceholder;
230
244
  private startDragPointerTracking;
@@ -251,6 +265,15 @@ export declare class MintDockManagerElement extends LitElement {
251
265
  private isDropZone;
252
266
  private showDropIndicator;
253
267
  private hideDropIndicator;
268
+ /**
269
+ * The dock's single hit-test: which of its own shadow elements lie under a
270
+ * client point, topmost first. Every "what is the pointer over" question —
271
+ * the target stack, the joystick button, the empty docked surface — is
272
+ * answered from this list, so the answers can never disagree with each
273
+ * other, and a test can say what is under the pointer in one place without
274
+ * inventing any geometry.
275
+ */
276
+ private elementsAt;
254
277
  private findStackAtPoint;
255
278
  private findStackInTargets;
256
279
  private activatePane;
@@ -69,6 +69,66 @@ export declare function resizePair(beforeSize: number, afterSize: number, delta:
69
69
  before: number;
70
70
  after: number;
71
71
  };
72
+ /**
73
+ * One splitter track after the divider at `index` moves by `delta`: the pixel
74
+ * sizes to push into the splitter and the weights they normalize to.
75
+ *
76
+ * This is the pair rule applied to a whole track, which is what a corner
77
+ * (intersection) drag needs — it moves one divider in each of several
78
+ * splitters at once, and each must keep the panels it does not touch exactly
79
+ * as they were.
80
+ *
81
+ * `null` means there is nothing to move: no divider at `index`, or a track
82
+ * with no measured size (every panel reads zero, as in a frame before layout). There is nothing to redistribute then, and writing
83
+ * anything would be worse than writing nothing: normalizing a zero total used
84
+ * to wipe the stored weights to `[]`, and the pair rule on a zero track yields
85
+ * negative pixel sizes.
86
+ */
87
+ export declare function resizeTrackPair(initialSizes: readonly number[], index: number, delta: number, minSize: number, snap?: boolean): {
88
+ pixels: number[];
89
+ weights: number[];
90
+ } | null;
91
+ /** The numbers of a measured rect that the corner-snap rule reads. */
92
+ export interface SnapRect {
93
+ left: number;
94
+ top: number;
95
+ right: number;
96
+ bottom: number;
97
+ width: number;
98
+ height: number;
99
+ }
100
+ /**
101
+ * A splitter divider as the snap rule sees it. `direction` is the SPLITTER's
102
+ * flow: a `horizontal` split lays its children left to right, so its dividers
103
+ * are vertical bars, and vice versa.
104
+ */
105
+ export interface SnapDivider {
106
+ direction: 'horizontal' | 'vertical' | undefined;
107
+ rect: SnapRect;
108
+ }
109
+ /**
110
+ * The lines a corner drag should snap to, relative to `origin`.
111
+ *
112
+ * A corner sits where a vertical and a horizontal divider cross, at
113
+ * (`center.x`, `center.y`). Any OTHER vertical bar that the corner's horizontal
114
+ * line passes through is somewhere the corner could line up with, so its
115
+ * centre becomes an x target; symmetrically for y. Bars the line misses belong
116
+ * to an unrelated region of the layout and are ignored — snapping to them would
117
+ * pull the corner towards something the user cannot see it aligning with.
118
+ *
119
+ * A missing coordinate (the corner has no divider on that axis) contributes no
120
+ * targets on the other axis.
121
+ */
122
+ export declare function collectCornerSnapTargets(center: {
123
+ x: number | null;
124
+ y: number | null;
125
+ }, dividers: readonly SnapDivider[], origin: {
126
+ left: number;
127
+ top: number;
128
+ }): {
129
+ x: number[];
130
+ y: number[];
131
+ };
72
132
  /**
73
133
  * Where a dragged tab would land in a header, given the horizontal midpoint of
74
134
  * each tab that is a candidate target.
@@ -545,8 +545,10 @@ class u extends m {
545
545
  return o.classList.contains("disabled") || o.getAttribute("aria-disabled") === "true";
546
546
  }
547
547
  #b(o) {
548
- const r = o.value;
549
- return o instanceof HTMLLIElement && !o.hasAttribute("value") ? o.dataset.value ?? (r !== 0 ? r : void 0) : r !== void 0 ? r : o.dataset.value;
548
+ const r = o.dropdownValue;
549
+ if (r !== void 0) return r;
550
+ const e = o.value;
551
+ return o instanceof HTMLLIElement && !o.hasAttribute("value") ? o.dataset.value ?? (e !== 0 ? e : void 0) : e !== void 0 ? e : o.dataset.value;
550
552
  }
551
553
  #p;
552
554
  /** Assign roles, aria, and the roving tabindex across the current items. */
@@ -29,7 +29,12 @@ import { DropdownMode } from '../types';
29
29
  * it copied an IDREF into the shadow root, where it resolved to nothing.
30
30
  *
31
31
  * An item is disabled via the `.disabled` class (or `aria-disabled="true"`), and
32
- * carries an opaque `value` via a `value` JS property or a `data-value` attribute.
32
+ * carries an opaque value, read in this order: a `dropdownValue` JS property (any
33
+ * value, passed through unchanged; see `DropdownItemElement`), a `data-value`
34
+ * attribute (a string), then the element's own `value` (an authored `value`
35
+ * attribute on an `<li>` is its native number; a non-`<li>` item's `value`
36
+ * property). Never assign an object or a string to an `<li>`'s `value`
37
+ * property: `HTMLLIElement.value` is a native long and coerces it to 0.
33
38
  * Events: `select` (`detail: { item, value }`) when an enabled item is activated.
34
39
  */
35
40
  export declare class MpDropdownMenu extends MpDropdownElement {
@@ -1,3 +1,3 @@
1
1
  export { MpDropdownMenu } from './components';
2
- export type { DropdownMode, DropdownSelectEventDetail } from './types';
2
+ export type { DropdownItemElement, DropdownMode, DropdownSelectEventDetail } from './types';
3
3
  export { dropdownMenuStyles } from './styles';
@@ -1,9 +1,22 @@
1
1
  /** How the menu exposes itself to assistive tech (and how items are roled). */
2
2
  export type DropdownMode = 'menu' | 'listbox';
3
+ /**
4
+ * A `.dropdown-item` carrying an opaque value for the menu's `select` event.
5
+ * Assign any value (object, string, number) to `dropdownValue`; the menu reports
6
+ * it unchanged. This is the channel the framework wrappers use. `value` cannot
7
+ * serve on an `<li>`: `HTMLLIElement.value` is a native long, so an object or a
8
+ * string assigned to it becomes 0.
9
+ */
10
+ export type DropdownItemElement = HTMLElement & {
11
+ dropdownValue?: unknown;
12
+ };
3
13
  /** `detail` of the `select` event the menu dispatches when an item is activated. */
4
14
  export interface DropdownSelectEventDetail {
5
15
  /** The activated `.dropdown-item` element. */
6
16
  item: HTMLElement;
7
- /** The item's opaque value (a `value` JS property or `data-value` attribute), if set. */
17
+ /**
18
+ * The item's opaque value, if set: its `dropdownValue` property, else its
19
+ * `data-value` attribute, else its own `value`.
20
+ */
8
21
  value?: unknown;
9
22
  }
@@ -1 +1 @@
1
- export type { DropdownMode, DropdownSelectEventDetail } from './dropdown';
1
+ export type { DropdownItemElement, DropdownMode, DropdownSelectEventDetail } from './dropdown';
@@ -1,16 +1,16 @@
1
- import { unsafeCSS as g, LitElement as _, html as d, nothing as c } from "lit";
2
- import { a as v } from "../chunks/install-light-styles-DbCAGFOC.mjs";
1
+ import { unsafeCSS as _, LitElement as v, html as d, nothing as c } from "lit";
2
+ import { a as w } from "../chunks/install-light-styles-DbCAGFOC.mjs";
3
3
  import { L as m } from "../chunks/live-announcer-Bi0orG4n.mjs";
4
- import { d as w } from "../chunks/focus-restore-DxuP1Oe2.mjs";
5
- import { R as y } from "../chunks/roving-focus-CrL9982a.mjs";
6
- import { repeat as $ } from "lit/directives/repeat.js";
4
+ import { d as y } from "../chunks/focus-restore-DxuP1Oe2.mjs";
5
+ import { R as $ } from "../chunks/roving-focus-CrL9982a.mjs";
6
+ import { repeat as x } from "lit/directives/repeat.js";
7
7
  import { unsafeHTML as u } from "lit/directives/unsafe-html.js";
8
- import { createRef as x, ref as C } from "lit/directives/ref.js";
9
- import { styleMap as k } from "lit/directives/style-map.js";
10
- import "../chunks/mp-splitter-Ckn1kN4v.mjs";
11
- import "../chunks/mp-treeview-C8iltDbq.mjs";
12
- import "../chunks/mp-datatable-B7st6G-I.mjs";
13
- const E = g(`:host {
8
+ import { createRef as C, ref as k } from "lit/directives/ref.js";
9
+ import { styleMap as E } from "lit/directives/style-map.js";
10
+ import "../chunks/mp-splitter-DLehrw3Y.mjs";
11
+ import "../chunks/mp-treeview-CaMTDrvY.mjs";
12
+ import "../chunks/mp-datatable-eRpl7-2V.mjs";
13
+ const M = _(`:host {
14
14
  display: flex;
15
15
  flex-direction: column;
16
16
  width: 100%;
@@ -372,36 +372,33 @@ mp-datatable {
372
372
  ariaFileList: "Files and folders",
373
373
  ariaFileManager: "File manager"
374
374
  };
375
- function T(a) {
375
+ function F(a) {
376
376
  return a ? { ...p, ...a } : p;
377
377
  }
378
- let M = 0;
379
- const f = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H2.454l-.913-3.13a.5.5 0 0 1 .013-.087.5.5 0 0 1-.014-.913zM13.81 4H2.19l-.572 6 1.193 4 11.078-2.5L15.81 5.66A1 1 0 0 0 14.81 4z"/></svg>', F = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/></svg>', I = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/></svg>', S = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zm8 0A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm-8 8A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm8 0A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3z"/></svg>';
380
- class R extends _ {
378
+ let I = 0;
379
+ const f = "[data-node-id], tr[data-row-key]", b = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181L15.546 8H2.454l-.913-3.13a.5.5 0 0 1 .013-.087.5.5 0 0 1-.014-.913zM13.81 4H2.19l-.572 6 1.193 4 11.078-2.5L15.81 5.66A1 1 0 0 0 14.81 4z"/></svg>', T = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M14 4.5V14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2h5.5L14 4.5zm-3 0A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V4.5h-2z"/></svg>', S = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/></svg>', R = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" aria-hidden="true"><path d="M1 2.5A1.5 1.5 0 0 1 2.5 1h3A1.5 1.5 0 0 1 7 2.5v3A1.5 1.5 0 0 1 5.5 7h-3A1.5 1.5 0 0 1 1 5.5v-3zm8 0A1.5 1.5 0 0 1 10.5 1h3A1.5 1.5 0 0 1 15 2.5v3A1.5 1.5 0 0 1 13.5 7h-3A1.5 1.5 0 0 1 9 5.5v-3zm-8 8A1.5 1.5 0 0 1 2.5 9h3A1.5 1.5 0 0 1 7 10.5v3A1.5 1.5 0 0 1 5.5 15h-3A1.5 1.5 0 0 1 1 13.5v-3zm8 0A1.5 1.5 0 0 1 10.5 9h3a1.5 1.5 0 0 1 1.5 1.5v3a1.5 1.5 0 0 1-1.5 1.5h-3A1.5 1.5 0 0 1 9 13.5v-3z"/></svg>';
380
+ class A extends v {
381
381
  constructor() {
382
- super(...arguments), this.instanceId = `mp-file-manager-${++M}`, this._nodes = [], this._rootFolderId = null, this._currentFolderId = null, this._allowUpload = !1, this._allowOperations = !0, this._viewMode = "list", this._selectionMode = "multiple", this._searchPlaceholder = "", this._messages = p, this._selection = /* @__PURE__ */ new Set(), this._expandedTreeIds = /* @__PURE__ */ new Set(), this._clipboard = null, this._searchQuery = "", this._searchAnnounceTimer = null, this._iconFocusId = null, this.liveAnnouncer = new m(this), this.alertAnnouncer = new m(this, { politeness: "assertive" }), this._renameTarget = null, this._renameInputRef = x(), this._dragDepth = 0, this._contextMenu = null, this._isTouchMode = !1, this._touchHoldTimer = null, this._touchHoldTarget = null, this._pendingOps = /* @__PURE__ */ new Map(), this._uploads = [], this._loadedFolders = /* @__PURE__ */ new Set(), this.onTouchStart = (e) => {
383
- if (e.touches.length !== 1) return;
384
- const t = e.touches[0], n = (e.composedPath().find(
385
- (s) => s instanceof HTMLElement && s.hasAttribute("data-node-id")
386
- ) ?? this.shadowRoot?.elementFromPoint(t.clientX, t.clientY)?.closest("[data-node-id]"))?.getAttribute("data-node-id");
382
+ super(...arguments), this.instanceId = `mp-file-manager-${++I}`, this._nodes = [], this._rootFolderId = null, this._currentFolderId = null, this._allowUpload = !1, this._allowOperations = !0, this._viewMode = "list", this._selectionMode = "multiple", this._searchPlaceholder = "", this._messages = p, this._selection = /* @__PURE__ */ new Set(), this._expandedTreeIds = /* @__PURE__ */ new Set(), this._clipboard = null, this._searchQuery = "", this._searchAnnounceTimer = null, this._iconFocusId = null, this.liveAnnouncer = new m(this), this.alertAnnouncer = new m(this, { politeness: "assertive" }), this._renameTarget = null, this._renameInputRef = C(), this._dragDepth = 0, this._contextMenu = null, this._isTouchMode = !1, this._touchHoldTimer = null, this._pendingOps = /* @__PURE__ */ new Map(), this._uploads = [], this._loadedFolders = /* @__PURE__ */ new Set(), this.onTouchStart = (e) => {
383
+ if (this.cancelTouchHold(), e.touches.length !== 1) return;
384
+ const t = e.touches[0], i = e.composedPath().find(
385
+ (s) => s instanceof HTMLElement && s.matches(f)
386
+ ) ?? this.elementAt(t.clientX, t.clientY)?.closest(f), n = i?.getAttribute("data-node-id") ?? i?.getAttribute("data-row-key");
387
387
  if (!n) return;
388
- this._touchHoldTarget = n;
389
388
  const o = t.clientX, r = t.clientY;
390
389
  this._touchHoldTimer = setTimeout(() => {
391
- this._touchHoldTarget === n && (this._touchHoldTimer = null, this._selectionMode !== "none" && !this._selection.has(n) && (this._selection = /* @__PURE__ */ new Set([n]), this.emitSelectionChange()), this.openContextMenu(n, o, r));
390
+ this._touchHoldTimer = null, this._selectionMode !== "none" && !this._selection.has(n) && (this._selection = /* @__PURE__ */ new Set([n]), this.emitSelectionChange()), this.openContextMenu(n, o, r);
392
391
  }, 600);
393
- }, this.onTouchMove = () => {
394
- this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null), this._touchHoldTarget = null;
395
- }, this.onTouchEnd = () => {
396
- this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null), this._touchHoldTarget = null;
392
+ }, this.cancelTouchHold = () => {
393
+ this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null);
397
394
  }, this.openUploadPicker = () => {
398
395
  if (!this._allowUpload) return;
399
396
  const e = document.createElement("input");
400
- e.type = "file", e.multiple = !0, e.style.display = "none", e.addEventListener("change", () => {
397
+ e.type = "file", e.multiple = !0, e.hidden = !0, e.addEventListener("change", () => {
401
398
  const t = Array.from(e.files ?? []);
402
399
  t.length > 0 && this.handleFiles(t), e.remove();
403
- }), document.body.appendChild(e), e.click();
404
- }, this._contextMenuReturnTarget = null, this.contextMenuRoving = new y({
400
+ }), e.addEventListener("cancel", () => e.remove()), document.body.appendChild(e), e.click();
401
+ }, this._contextMenuReturnTarget = null, this.contextMenuRoving = new $({
405
402
  items: () => Array.from(this.renderRoot?.querySelectorAll(".context-menu .menu-item:not([disabled])") ?? []),
406
403
  orientation: "vertical",
407
404
  wrap: !0
@@ -419,8 +416,8 @@ class R extends _ {
419
416
  }, this.onDatatableSelection = (e) => {
420
417
  const t = e.detail;
421
418
  this._selection = new Set(t.selectedIds), this.emitSelectionChange(), this.requestUpdate();
422
- }, this.onRowClick = (e) => {
423
- e.detail, this.emitSelectionChange();
419
+ }, this.onRowClick = () => {
420
+ this.emitSelectionChange();
424
421
  }, this.onRowDblClick = (e) => {
425
422
  const t = e.detail;
426
423
  this.activateNode(t.row);
@@ -542,7 +539,7 @@ class R extends _ {
542
539
  };
543
540
  }
544
541
  static {
545
- this.styles = [E];
542
+ this.styles = [M];
546
543
  }
547
544
  static get observedAttributes() {
548
545
  return [
@@ -602,7 +599,7 @@ class R extends _ {
602
599
  return this._searchPlaceholder;
603
600
  }
604
601
  set searchPlaceholder(e) {
605
- this._searchPlaceholder = e || "Search…", this.requestUpdate();
602
+ this._searchPlaceholder = e || "", this.requestUpdate();
606
603
  }
607
604
  get iconResolver() {
608
605
  return this._iconResolver;
@@ -618,7 +615,7 @@ class R extends _ {
618
615
  return this._messages;
619
616
  }
620
617
  set messages(e) {
621
- this._messages = T(e), this.hasAttribute("aria-label") && this.setAttribute("aria-label", this._messages.ariaFileManager), this.requestUpdate();
618
+ this._messages = F(e), this.hasAttribute("aria-label") && this.setAttribute("aria-label", this._messages.ariaFileManager), this.requestUpdate();
622
619
  }
623
620
  /**
624
621
  * Replacement for `window.confirm` / `window.prompt`. When unset, falls
@@ -712,28 +709,36 @@ class R extends _ {
712
709
  case "allow-upload":
713
710
  this._allowUpload = i !== null, this.requestUpdate();
714
711
  break;
715
- case "view-mode":
716
- (i === "list" || i === "icons") && (this._viewMode = i, this.requestUpdate());
712
+ case "view-mode": {
713
+ const n = i ?? "list";
714
+ (n === "list" || n === "icons") && (this._viewMode = n, this.requestUpdate());
717
715
  break;
718
- case "selection-mode":
719
- (i === "none" || i === "single" || i === "multiple") && (this._selectionMode = i, i === "none" && this._selection.clear(), this.requestUpdate());
716
+ }
717
+ case "selection-mode": {
718
+ const n = i ?? "multiple";
719
+ (n === "none" || n === "single" || n === "multiple") && (this._selectionMode = n, n === "none" && this._selection.clear(), this.requestUpdate());
720
720
  break;
721
+ }
721
722
  case "search-placeholder":
722
- this._searchPlaceholder = i ?? "Search…", this.requestUpdate();
723
+ this._searchPlaceholder = i ?? "", this.requestUpdate();
723
724
  break;
724
725
  }
725
726
  }
726
727
  connectedCallback() {
727
- if (super.connectedCallback(), this.renderRoot instanceof ShadowRoot && (this._releaseLightStyles?.(), this._releaseLightStyles = v(this.renderRoot)), this.hasAttribute("role") || this.setAttribute("role", "region"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", this._messages.ariaFileManager), typeof window < "u" && typeof window.matchMedia == "function")
728
+ if (super.connectedCallback(), this.renderRoot instanceof ShadowRoot && (this._releaseLightStyles?.(), this._releaseLightStyles = w(this.renderRoot)), this.hasAttribute("role") || this.setAttribute("role", "region"), this.hasAttribute("aria-label") || this.setAttribute("aria-label", this._messages.ariaFileManager), typeof window < "u" && typeof window.matchMedia == "function")
728
729
  try {
729
730
  this._isTouchMode = window.matchMedia("(pointer: coarse)").matches;
730
731
  } catch {
731
732
  this._isTouchMode = !1;
732
733
  }
733
- this.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), this.addEventListener("touchend", this.onTouchEnd), this.addEventListener("touchcancel", this.onTouchEnd), this.addEventListener("touchmove", this.onTouchMove);
734
+ this.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), this.addEventListener("touchend", this.cancelTouchHold), this.addEventListener("touchcancel", this.cancelTouchHold), this.addEventListener("touchmove", this.cancelTouchHold);
734
735
  }
735
736
  disconnectedCallback() {
736
- super.disconnectedCallback(), this._releaseLightStyles?.(), this._releaseLightStyles = void 0, this.removeEventListener("touchstart", this.onTouchStart), this.removeEventListener("touchend", this.onTouchEnd), this.removeEventListener("touchcancel", this.onTouchEnd), this.removeEventListener("touchmove", this.onTouchMove), this._touchHoldTimer && (clearTimeout(this._touchHoldTimer), this._touchHoldTimer = null);
737
+ super.disconnectedCallback(), this._releaseLightStyles?.(), this._releaseLightStyles = void 0, this.removeEventListener("touchstart", this.onTouchStart), this.removeEventListener("touchend", this.cancelTouchHold), this.removeEventListener("touchcancel", this.cancelTouchHold), this.removeEventListener("touchmove", this.cancelTouchHold), this.cancelTouchHold();
738
+ }
739
+ /** The one hit-test seam: which element of this component is under a viewport point. */
740
+ elementAt(e, t) {
741
+ return this.shadowRoot?.elementFromPoint?.(e, t) ?? null;
737
742
  }
738
743
  // ─── Operation flags helper ─────────────────────────────────────────────
739
744
  /**
@@ -766,13 +771,13 @@ class R extends _ {
766
771
  const i = !!this._loadChildren, n = (r) => {
767
772
  const s = t.get(r);
768
773
  return s ? s.map((l) => {
769
- const h = n(l.id), b = i && h.length === 0 && !this._loadedFolders.has(l.id);
774
+ const h = n(l.id), g = i && h.length === 0 && !this._loadedFolders.has(l.id);
770
775
  return {
771
776
  id: l.id,
772
777
  label: l.name,
773
778
  iconKey: l.iconKey ?? "folder",
774
779
  children: h,
775
- lazy: b || void 0
780
+ lazy: g || void 0
776
781
  };
777
782
  }) : [];
778
783
  }, o = this._rootFolderId;
@@ -869,7 +874,7 @@ class R extends _ {
869
874
  class="context-menu"
870
875
  role="menu"
871
876
  aria-label=${this._messages.ariaFileOperations}
872
- style=${k({ left: `${e.x}px`, top: `${e.y}px` })}
877
+ style=${E({ left: `${e.x}px`, top: `${e.y}px` })}
873
878
  @click=${(o) => o.stopPropagation()}
874
879
  @keydown=${this.onContextMenuKeydown}
875
880
  >
@@ -898,7 +903,7 @@ class R extends _ {
898
903
  }
899
904
  openContextMenu(e, t, i) {
900
905
  if (this._allowOperations === !1) return;
901
- const n = w();
906
+ const n = y();
902
907
  this._contextMenuReturnTarget = n instanceof HTMLElement && n !== n.ownerDocument.body ? n : null, this._contextMenu = { x: t, y: i, targetId: e }, this.requestUpdate(), this.updateComplete.then(() => {
903
908
  this.contextMenuRoving.sync(), this.contextMenuRoving.moveTo(0);
904
909
  const o = (r) => {
@@ -966,14 +971,14 @@ class R extends _ {
966
971
  @click=${() => this.setViewMode("list")}
967
972
  aria-label=${e.listView}
968
973
  aria-pressed=${this._viewMode === "list"}
969
- >${u(I)}</button>
974
+ >${u(S)}</button>
970
975
  <button
971
976
  type="button"
972
977
  data-active=${this._viewMode === "icons" ? "true" : "false"}
973
978
  @click=${() => this.setViewMode("icons")}
974
979
  aria-label=${e.iconsView}
975
980
  aria-pressed=${this._viewMode === "icons"}
976
- >${u(S)}</button>
981
+ >${u(R)}</button>
977
982
  </div>
978
983
  </div>
979
984
  `;
@@ -1060,7 +1065,7 @@ class R extends _ {
1060
1065
  <span class="row-cell">
1061
1066
  <span class="row-icon" aria-hidden="true">${t ? u(t) : c}</span>
1062
1067
  <input
1063
- ${C(this._renameInputRef)}
1068
+ ${k(this._renameInputRef)}
1064
1069
  type="text"
1065
1070
  class="rename-input"
1066
1071
  .value=${e.name}
@@ -1085,7 +1090,7 @@ class R extends _ {
1085
1090
  renderIconGridView(e) {
1086
1091
  return d`
1087
1092
  <div class="icon-grid" role="listbox" aria-multiselectable="true" aria-label=${this._messages.ariaFileList} @keydown=${this.onContentKeydown}>
1088
- ${$(
1093
+ ${x(
1089
1094
  e,
1090
1095
  (t) => t.id,
1091
1096
  (t, i) => this.renderIconCard(t, i, e)
@@ -1124,7 +1129,7 @@ class R extends _ {
1124
1129
  const i = this._iconResolver(t, e);
1125
1130
  if (i) return i;
1126
1131
  }
1127
- return e.type === "folder" ? f : F;
1132
+ return e.type === "folder" ? b : T;
1128
1133
  }
1129
1134
  resolveIconForTree(e, t) {
1130
1135
  const i = this._nodes.find((n) => n.id === t.id);
@@ -1132,7 +1137,7 @@ class R extends _ {
1132
1137
  const n = this._iconResolver(e, i);
1133
1138
  if (n) return n;
1134
1139
  }
1135
- return f;
1140
+ return b;
1136
1141
  }
1137
1142
  onIconCardContextMenu(e, t) {
1138
1143
  t.preventDefault(), this._selectionMode !== "none" && !this._selection.has(e.id) && (this._selection = /* @__PURE__ */ new Set([e.id]), this.emitSelectionChange()), this.openContextMenu(e.id, t.clientX, t.clientY);
@@ -1314,17 +1319,14 @@ class R extends _ {
1314
1319
  }
1315
1320
  formatDate(e) {
1316
1321
  if (!e.modifiedAt) return "—";
1317
- try {
1318
- return new Date(e.modifiedAt).toLocaleDateString();
1319
- } catch {
1320
- return e.modifiedAt;
1321
- }
1322
+ const t = new Date(e.modifiedAt);
1323
+ return Number.isNaN(t.getTime()) ? e.modifiedAt : t.toLocaleDateString();
1322
1324
  }
1323
1325
  }
1324
- typeof customElements < "u" && !customElements.get("mp-file-manager") && customElements.define("mp-file-manager", R);
1326
+ typeof customElements < "u" && !customElements.get("mp-file-manager") && customElements.define("mp-file-manager", A);
1325
1327
  export {
1326
1328
  p as DEFAULT_FILE_MANAGER_MESSAGES,
1327
- R as MpFileManager,
1328
- E as fileManagerStyles,
1329
- T as mergeMessages
1329
+ A as MpFileManager,
1330
+ M as fileManagerStyles,
1331
+ F as mergeMessages
1330
1332
  };
@@ -155,7 +155,6 @@ export declare class MpFileManager extends LitElement {
155
155
  private _contextMenu;
156
156
  private _isTouchMode;
157
157
  private _touchHoldTimer;
158
- private _touchHoldTarget;
159
158
  private _pendingOps;
160
159
  private _uploads;
161
160
  private _dialogResolver;
@@ -241,8 +240,10 @@ export declare class MpFileManager extends LitElement {
241
240
  * the context menu on the touched row. Movement aborts the long-press.
242
241
  */
243
242
  private onTouchStart;
244
- private onTouchMove;
245
- private onTouchEnd;
243
+ /** The one hit-test seam: which element of this component is under a viewport point. */
244
+ private elementAt;
245
+ /** Movement (a scroll), lifting (a tap) and touchcancel all abandon the hold. */
246
+ private cancelTouchHold;
246
247
  /**
247
248
  * Opens an `<input type="file" multiple>` picker for touch consumers
248
249
  * (replaces OS file-drop on phones/tablets). Emits `mp-upload-request`