@mintplayer/web-components 2.14.0 → 2.16.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 (63) hide show
  1. package/README.md +15 -0
  2. package/badge/src/styles/badge.styles.d.ts +2 -0
  3. package/chunks/install-light-styles-DbCAGFOC.mjs +209 -0
  4. package/chunks/mp-datatable-B7st6G-I.mjs +2238 -0
  5. package/chunks/{mp-datetime-picker.element-D1CiLbHm.mjs → mp-datetime-picker.element-DsWA1AFs.mjs} +2 -2
  6. package/chunks/{mp-timepicker.element-COZEUIoE.mjs → mp-timepicker.element-CwaAAOcm.mjs} +1 -1
  7. package/chunks/{mp-treeview-tkWu28iF.mjs → mp-treeview-C8iltDbq.mjs} +61 -63
  8. package/chunks/{overlay-controller-D6agzzOI.mjs → overlay-controller-DifgO6jT.mjs} +103 -47
  9. package/datatable/index.mjs +6 -5
  10. package/datatable/src/components/mp-datatable.d.ts +210 -2
  11. package/datatable/src/index.d.ts +4 -2
  12. package/datatable/src/styles/datatable.light.styles.d.ts +2 -0
  13. package/datatable/src/styles/index.d.ts +1 -1
  14. package/datatable/src/types/column-def.d.ts +61 -0
  15. package/datatable/src/types/filter.d.ts +138 -0
  16. package/datatable/src/types/index.d.ts +3 -2
  17. package/datatable/src/types/labels.d.ts +58 -0
  18. package/datepicker/index.mjs +1 -1
  19. package/datetime-picker/index.mjs +1 -1
  20. package/dock/index.mjs +477 -492
  21. package/dock/src/components/mint-dock-manager.element.d.ts +10 -8
  22. package/dock/src/core/index.d.ts +1 -0
  23. package/dock/src/core/intersection-sizing.d.ts +83 -0
  24. package/dock/src/core/layout-tree.d.ts +23 -2
  25. package/dock/src/core/types.d.ts +14 -0
  26. package/file-manager/index.mjs +30 -29
  27. package/file-manager/src/components/mp-file-manager.d.ts +2 -0
  28. package/light-dom/index.d.ts +1 -0
  29. package/light-dom/index.mjs +11 -0
  30. package/light-dom/src/index.d.ts +2 -0
  31. package/light-dom/src/install-light-styles.d.ts +25 -0
  32. package/light-dom/src/scoped-html.d.ts +26 -0
  33. package/navbar/index.mjs +1 -1
  34. package/overlay/index.mjs +5 -2
  35. package/overlay/src/index.d.ts +2 -0
  36. package/overlay/src/overlay-controller.d.ts +27 -0
  37. package/overlay/src/overlay-portal.d.ts +53 -0
  38. package/package.json +5 -1
  39. package/query-builder/index.mjs +1472 -2651
  40. package/query-builder/src/index.d.ts +4 -0
  41. package/query-builder/src/mp-query-builder.element.d.ts +1 -1
  42. package/query-builder/src/mp-query-builder.light.styles.d.ts +2 -0
  43. package/query-builder/src/mp-query-condition.element.d.ts +1 -1
  44. package/query-builder/src/mp-query-condition.light.styles.d.ts +2 -0
  45. package/query-builder/src/mp-query-group.element.d.ts +1 -1
  46. package/query-builder/src/mp-query-group.light.styles.d.ts +2 -0
  47. package/query-builder/src/mp-query-subquery.element.d.ts +1 -1
  48. package/query-builder/src/mp-query-subquery.light.styles.d.ts +2 -0
  49. package/ribbon/index.mjs +1 -1
  50. package/scheduler/index.mjs +2 -2
  51. package/timepicker/index.mjs +1 -1
  52. package/tree-select/index.mjs +60 -58
  53. package/tree-select/src/components/mp-tree-select.d.ts +1 -1
  54. package/tree-select/src/index.d.ts +1 -1
  55. package/tree-select/src/styles/index.d.ts +1 -1
  56. package/tree-select/src/styles/tree-select.light.styles.d.ts +2 -0
  57. package/treeview/index.mjs +3 -3
  58. package/treeview/src/components/mp-treeview.d.ts +1 -1
  59. package/treeview/src/index.d.ts +1 -1
  60. package/treeview/src/styles/index.d.ts +1 -1
  61. package/treeview/src/styles/treeview.light.styles.d.ts +2 -0
  62. package/chunks/mp-datatable-GmKqaN8y.mjs +0 -1392
  63. package/datatable/src/styles/datatable.styles.d.ts +0 -2
@@ -53,10 +53,7 @@ export declare class MintDockManagerElement extends LitElement {
53
53
  private lastDragPointerPosition;
54
54
  private cornerSnapXTargets;
55
55
  private cornerSnapYTargets;
56
- private showSnapMarkers;
57
56
  debugLayoutIntegrity: boolean;
58
- private renderSnapMarkersForCorner;
59
- private clearSnapMarkers;
60
57
  private pendingDragEndTimeout;
61
58
  private previousSplitSizes;
62
59
  constructor();
@@ -110,6 +107,16 @@ export declare class MintDockManagerElement extends LitElement {
110
107
  private handleCornerResizeMove;
111
108
  private endCornerResize;
112
109
  private onIntersectionDoubleClick;
110
+ /**
111
+ * Push normalized weights into the matching `<mp-splitter>` as pixel sizes.
112
+ * The splitter's panel wrappers live in its shadow DOM, so direct flex
113
+ * mutation is not an option.
114
+ *
115
+ * Returns without writing when the splitter has no measured size — which is
116
+ * every case under jsdom, and is why the double-click logic above had to move
117
+ * out of this method's shadow to become testable.
118
+ */
119
+ private pushSizesToSplitter;
113
120
  private beginFloatingDrag;
114
121
  /** The percent-of-host size of the dimension a handle drives (width for
115
122
  * horizontal/corner handles, height for pure-vertical ones). */
@@ -247,12 +254,7 @@ export declare class MintDockManagerElement extends LitElement {
247
254
  private findStackAtPoint;
248
255
  private findStackInTargets;
249
256
  private activatePane;
250
- private resolveSplitNode;
251
- private normalizeFloatingLayout;
252
257
  private splitterLayerKey;
253
- private clonePath;
254
- private isOrIsAncestorOf;
255
- private countPanesInTree;
256
258
  private resolveStackLocation;
257
259
  private removePaneFromLocation;
258
260
  private addPaneToLocation;
@@ -1,4 +1,5 @@
1
1
  export * from './geometry';
2
+ export * from './intersection-sizing';
2
3
  export * from './layout-tree';
3
4
  export * from './resize';
4
5
  export * from './sizes';
@@ -0,0 +1,83 @@
1
+ /**
2
+ * Double-clicking an intersection handle toggles between "equalize the panes
3
+ * adjacent to every divider that crosses here" and "put back what was there
4
+ * before". This module owns that decision; the element owns the layout tree and
5
+ * the DOM.
6
+ *
7
+ * The split matters because the decision is the part worth testing and the part
8
+ * that was previously unreachable: it lived inside a method whose only other
9
+ * job was writing measured pixel sizes into `<mp-splitter>`, which made the
10
+ * whole thing look like geometry. It is not — the toggle reads and writes
11
+ * normalized weights and never consults a rect.
12
+ *
13
+ * `planIntersectionResize` returns writes **in call order rather than one per
14
+ * path**. Two pairs crossing the same split legitimately compound, and the
15
+ * element re-pushes to the splitter after each write; collapsing them would
16
+ * change how often `setPanelSizes` is called.
17
+ */
18
+ /** One divider crossing: a horizontal split and a vertical split, each by path and divider index. */
19
+ export interface IntersectionPair {
20
+ h: {
21
+ pathStr: string;
22
+ index: number;
23
+ };
24
+ v: {
25
+ pathStr: string;
26
+ index: number;
27
+ };
28
+ }
29
+ /**
30
+ * What the caller knows about a split node, without exposing the node itself.
31
+ * `sizes` is undefined for a split that has never been given explicit weights —
32
+ * such a split is still equalized, but there is nothing about it worth
33
+ * remembering, since restoring an implicit even split is imperceptible.
34
+ */
35
+ export interface SplitSizes {
36
+ sizes: number[] | undefined;
37
+ childCount: number;
38
+ }
39
+ export interface IntersectionResizePlan {
40
+ /** Ordered: apply each in turn, pushing to the splitter after each, as the element did inline. */
41
+ writes: Array<{
42
+ pathStr: string;
43
+ sizes: number[];
44
+ }>;
45
+ /** Sizes to remember so the next double-click can restore them. Empty when restoring. */
46
+ remember: Array<{
47
+ pathStr: string;
48
+ sizes: number[];
49
+ }>;
50
+ /** True when this double-click consumed the stored sizes and they should be dropped. */
51
+ clearStored: boolean;
52
+ }
53
+ /**
54
+ * Recover the crossing pairs a handle describes.
55
+ *
56
+ * `data-pairs` is the real channel; `data-key` is the single-crossing fallback
57
+ * written by handles that predate it, encoded as `<hPath>:<hIndex>|<vPath>:<vIndex>`.
58
+ * Paths themselves contain `:` separators, so the index is split off at the LAST
59
+ * colon, not the first.
60
+ *
61
+ * Malformed input yields an empty array rather than throwing — a handle with a
62
+ * corrupt dataset should do nothing, not break the element.
63
+ */
64
+ export declare function parseIntersectionPairs(pairsRaw: string | undefined, keyRaw: string | undefined): IntersectionPair[];
65
+ /**
66
+ * Give the two panes either side of `index` an equal share of the space they
67
+ * currently occupy between them, then renormalize the whole row so the weights
68
+ * still sum to 1. Returns the input untouched when the pair has no space to
69
+ * share — halving zero is not an improvement.
70
+ */
71
+ export declare function equalizeAtDivider(sizes: number[], index: number): number[];
72
+ /**
73
+ * Decide what a double-click on this intersection should do.
74
+ *
75
+ * Restore wins whenever *any* split touched by these pairs has stored sizes —
76
+ * one remembered split is enough to make the gesture a restore, and a restore
77
+ * puts back every stored split, not only the ones under this handle. That is
78
+ * deliberate: the stored map is a single undo step for the whole layout.
79
+ *
80
+ * `lookup` returns null for a path that is not a split node, which is how a
81
+ * stale handle left over from a layout change is ignored.
82
+ */
83
+ export declare function planIntersectionResize(pairs: readonly IntersectionPair[], stored: ReadonlyMap<string, number[]>, lookup: (pathStr: string) => SplitSizes | null): IntersectionResizePlan;
@@ -1,5 +1,5 @@
1
- import { DockLayoutNode, DockSplitNode, DockStackNode } from '../types/dock-layout';
2
- import { DropZone } from './types';
1
+ import { DockFloatingStackLayout, DockLayoutNode, DockSplitNode, DockStackNode } from '../types/dock-layout';
2
+ import { DockPath, DropZone } from './types';
3
3
  /**
4
4
  * The dock's layout is a tree of splits and stacks, and every drag, drop, close
5
5
  * and resize is a transformation of that tree. This module is that algebra,
@@ -82,3 +82,24 @@ export declare function normalizeLayoutNode(node: DockLayoutNode | null): DockLa
82
82
  */
83
83
  export declare function cloneLayoutNode(layout: DockLayoutNode): DockLayoutNode;
84
84
  export declare function cloneLayoutNode(layout: DockLayoutNode | null): DockLayoutNode | null;
85
+ /** How many panes a subtree holds. A stack contributes its pane count; a split, the sum of its children. */
86
+ export declare function countPanesInTree(node: DockLayoutNode | null): number;
87
+ /**
88
+ * The split node a path addresses, in whichever layer the path names, or null
89
+ * when the path leaves the tree or lands on a stack.
90
+ *
91
+ * Returning null rather than throwing is what makes a stale `data-path` on a
92
+ * handle harmless: the layout changed under it, the lookup misses, and the
93
+ * gesture does nothing.
94
+ */
95
+ export declare function resolveSplitNode(path: DockPath, rootLayout: DockLayoutNode | null, floatingLayouts: readonly DockFloatingStackLayout[]): DockSplitNode | null;
96
+ /**
97
+ * Give a floating window a complete, finite set of bounds and a detached root.
98
+ *
99
+ * Every field is defended because floating layouts arrive from the `layout`
100
+ * attribute, i.e. from JSON a consumer wrote: a missing `bounds`, a NaN left
101
+ * from a bad parse, or a window sized to nothing would each render an
102
+ * unusable window rather than fail loudly. The minimums (160x120) are the
103
+ * smallest size at which a window's chrome is still operable.
104
+ */
105
+ export declare function normalizeFloatingLayout(layout: DockFloatingStackLayout): DockFloatingStackLayout;
@@ -42,3 +42,17 @@ export declare function formatPath(path: DockPath): string;
42
42
  export declare function parsePath(path: string | null | undefined): DockPath | null;
43
43
  /** Two paths address the same node. */
44
44
  export declare function pathsEqual(a: DockPath, b: DockPath): boolean;
45
+ /** A copy that shares no array with the original, so callers can hold onto it across a mutation. */
46
+ export declare function clonePath(path: DockPath): DockPath;
47
+ /**
48
+ * `ancestor` addresses `descendant` or something containing it.
49
+ *
50
+ * Reflexive by design: a path is its own ancestor. The dock uses this to refuse
51
+ * a drop into the subtree being dragged, and dropping a node onto itself has to
52
+ * be refused by the same test as dropping it into its own child.
53
+ *
54
+ * Paths in different layers are never related, even when their segments match —
55
+ * `f:0/[1]` and `f:1/[1]` are different windows, and a docked path is never an
56
+ * ancestor of a floating one.
57
+ */
58
+ export declare function isOrIsAncestorOf(ancestor: DockPath, descendant: DockPath): boolean;
@@ -1,15 +1,16 @@
1
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";
2
3
  import { L as m } from "../chunks/live-announcer-Bi0orG4n.mjs";
3
- import { d as v } from "../chunks/focus-restore-DxuP1Oe2.mjs";
4
- import { R as w } from "../chunks/roving-focus-CrL9982a.mjs";
5
- import { repeat as y } from "lit/directives/repeat.js";
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";
6
7
  import { unsafeHTML as u } from "lit/directives/unsafe-html.js";
7
- import { createRef as $, ref as x } from "lit/directives/ref.js";
8
- import { styleMap as C } from "lit/directives/style-map.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";
9
10
  import "../chunks/mp-splitter-Ckn1kN4v.mjs";
10
- import "../chunks/mp-treeview-tkWu28iF.mjs";
11
- import "../chunks/mp-datatable-GmKqaN8y.mjs";
12
- const k = g(`:host {
11
+ import "../chunks/mp-treeview-C8iltDbq.mjs";
12
+ import "../chunks/mp-datatable-B7st6G-I.mjs";
13
+ const E = g(`:host {
13
14
  display: flex;
14
15
  flex-direction: column;
15
16
  width: 100%;
@@ -371,14 +372,14 @@ mp-datatable {
371
372
  ariaFileList: "Files and folders",
372
373
  ariaFileManager: "File manager"
373
374
  };
374
- function E(a) {
375
+ function T(a) {
375
376
  return a ? { ...p, ...a } : p;
376
377
  }
377
- let T = 0;
378
- 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>', M = '<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>', F = '<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>', I = '<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>';
379
- class S extends _ {
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 _ {
380
381
  constructor() {
381
- super(...arguments), this.instanceId = `mp-file-manager-${++T}`, 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 = $(), 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) => {
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) => {
382
383
  if (e.touches.length !== 1) return;
383
384
  const t = e.touches[0], n = (e.composedPath().find(
384
385
  (s) => s instanceof HTMLElement && s.hasAttribute("data-node-id")
@@ -400,7 +401,7 @@ class S extends _ {
400
401
  const t = Array.from(e.files ?? []);
401
402
  t.length > 0 && this.handleFiles(t), e.remove();
402
403
  }), document.body.appendChild(e), e.click();
403
- }, this._contextMenuReturnTarget = null, this.contextMenuRoving = new w({
404
+ }, this._contextMenuReturnTarget = null, this.contextMenuRoving = new y({
404
405
  items: () => Array.from(this.renderRoot?.querySelectorAll(".context-menu .menu-item:not([disabled])") ?? []),
405
406
  orientation: "vertical",
406
407
  wrap: !0
@@ -541,7 +542,7 @@ class S extends _ {
541
542
  };
542
543
  }
543
544
  static {
544
- this.styles = [k];
545
+ this.styles = [E];
545
546
  }
546
547
  static get observedAttributes() {
547
548
  return [
@@ -617,7 +618,7 @@ class S extends _ {
617
618
  return this._messages;
618
619
  }
619
620
  set messages(e) {
620
- this._messages = E(e), this.hasAttribute("aria-label") && this.setAttribute("aria-label", this._messages.ariaFileManager), this.requestUpdate();
621
+ this._messages = T(e), this.hasAttribute("aria-label") && this.setAttribute("aria-label", this._messages.ariaFileManager), this.requestUpdate();
621
622
  }
622
623
  /**
623
624
  * Replacement for `window.confirm` / `window.prompt`. When unset, falls
@@ -723,7 +724,7 @@ class S extends _ {
723
724
  }
724
725
  }
725
726
  connectedCallback() {
726
- if (super.connectedCallback(), 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")
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")
727
728
  try {
728
729
  this._isTouchMode = window.matchMedia("(pointer: coarse)").matches;
729
730
  } catch {
@@ -732,7 +733,7 @@ class S extends _ {
732
733
  this.addEventListener("touchstart", this.onTouchStart, { passive: !1 }), this.addEventListener("touchend", this.onTouchEnd), this.addEventListener("touchcancel", this.onTouchEnd), this.addEventListener("touchmove", this.onTouchMove);
733
734
  }
734
735
  disconnectedCallback() {
735
- super.disconnectedCallback(), 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);
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);
736
737
  }
737
738
  // ─── Operation flags helper ─────────────────────────────────────────────
738
739
  /**
@@ -868,7 +869,7 @@ class S extends _ {
868
869
  class="context-menu"
869
870
  role="menu"
870
871
  aria-label=${this._messages.ariaFileOperations}
871
- style=${C({ left: `${e.x}px`, top: `${e.y}px` })}
872
+ style=${k({ left: `${e.x}px`, top: `${e.y}px` })}
872
873
  @click=${(o) => o.stopPropagation()}
873
874
  @keydown=${this.onContextMenuKeydown}
874
875
  >
@@ -897,7 +898,7 @@ class S extends _ {
897
898
  }
898
899
  openContextMenu(e, t, i) {
899
900
  if (this._allowOperations === !1) return;
900
- const n = v();
901
+ const n = w();
901
902
  this._contextMenuReturnTarget = n instanceof HTMLElement && n !== n.ownerDocument.body ? n : null, this._contextMenu = { x: t, y: i, targetId: e }, this.requestUpdate(), this.updateComplete.then(() => {
902
903
  this.contextMenuRoving.sync(), this.contextMenuRoving.moveTo(0);
903
904
  const o = (r) => {
@@ -965,14 +966,14 @@ class S extends _ {
965
966
  @click=${() => this.setViewMode("list")}
966
967
  aria-label=${e.listView}
967
968
  aria-pressed=${this._viewMode === "list"}
968
- >${u(F)}</button>
969
+ >${u(I)}</button>
969
970
  <button
970
971
  type="button"
971
972
  data-active=${this._viewMode === "icons" ? "true" : "false"}
972
973
  @click=${() => this.setViewMode("icons")}
973
974
  aria-label=${e.iconsView}
974
975
  aria-pressed=${this._viewMode === "icons"}
975
- >${u(I)}</button>
976
+ >${u(S)}</button>
976
977
  </div>
977
978
  </div>
978
979
  `;
@@ -1059,7 +1060,7 @@ class S extends _ {
1059
1060
  <span class="row-cell">
1060
1061
  <span class="row-icon" aria-hidden="true">${t ? u(t) : c}</span>
1061
1062
  <input
1062
- ${x(this._renameInputRef)}
1063
+ ${C(this._renameInputRef)}
1063
1064
  type="text"
1064
1065
  class="rename-input"
1065
1066
  .value=${e.name}
@@ -1084,7 +1085,7 @@ class S extends _ {
1084
1085
  renderIconGridView(e) {
1085
1086
  return d`
1086
1087
  <div class="icon-grid" role="listbox" aria-multiselectable="true" aria-label=${this._messages.ariaFileList} @keydown=${this.onContentKeydown}>
1087
- ${y(
1088
+ ${$(
1088
1089
  e,
1089
1090
  (t) => t.id,
1090
1091
  (t, i) => this.renderIconCard(t, i, e)
@@ -1123,7 +1124,7 @@ class S extends _ {
1123
1124
  const i = this._iconResolver(t, e);
1124
1125
  if (i) return i;
1125
1126
  }
1126
- return e.type === "folder" ? f : M;
1127
+ return e.type === "folder" ? f : F;
1127
1128
  }
1128
1129
  resolveIconForTree(e, t) {
1129
1130
  const i = this._nodes.find((n) => n.id === t.id);
@@ -1320,10 +1321,10 @@ class S extends _ {
1320
1321
  }
1321
1322
  }
1322
1323
  }
1323
- typeof customElements < "u" && !customElements.get("mp-file-manager") && customElements.define("mp-file-manager", S);
1324
+ typeof customElements < "u" && !customElements.get("mp-file-manager") && customElements.define("mp-file-manager", R);
1324
1325
  export {
1325
1326
  p as DEFAULT_FILE_MANAGER_MESSAGES,
1326
- S as MpFileManager,
1327
- k as fileManagerStyles,
1328
- E as mergeMessages
1327
+ R as MpFileManager,
1328
+ E as fileManagerStyles,
1329
+ T as mergeMessages
1329
1330
  };
@@ -232,6 +232,8 @@ export declare class MpFileManager extends LitElement {
232
232
  /** Remove a finished/aborted upload from the tracking list. */
233
233
  clearUpload(uploadId: string): void;
234
234
  attributeChangedCallback(name: string, oldValue: string | null, newValue: string | null): void;
235
+ /** Disposes the light-style mirror; see connectedCallback. */
236
+ private _releaseLightStyles?;
235
237
  connectedCallback(): void;
236
238
  disconnectedCallback(): void;
237
239
  /**
@@ -0,0 +1 @@
1
+ export * from './src';
@@ -0,0 +1,11 @@
1
+ import { a, c as e, g as i, i as o, r as c, s as g, b as l, d as p } from "../chunks/install-light-styles-DbCAGFOC.mjs";
2
+ export {
3
+ a as adoptLightStyles,
4
+ e as configureScopedHtml,
5
+ i as getLightStyleEntries,
6
+ o as installLightStyles,
7
+ c as rewriteStatics,
8
+ g as scopedHtml,
9
+ l as scopedSvg,
10
+ p as stampScope
11
+ };
@@ -0,0 +1,2 @@
1
+ export * from './scoped-html';
2
+ export * from './install-light-styles';
@@ -0,0 +1,25 @@
1
+ import { CSSResult } from 'lit';
2
+ export interface LightStyleEntry {
3
+ key: string;
4
+ cssText: string;
5
+ /** Present when constructable stylesheets are supported. */
6
+ sheet?: CSSStyleSheet;
7
+ }
8
+ /**
9
+ * Install a light-tier component's rescoped stylesheet at document level.
10
+ * Idempotent per `key`, cross-bundle safe, no-op during SSR. Call it right
11
+ * before `customElements.define`, so styles precede the first render.
12
+ *
13
+ * A `<style data-mp-light-styles="<key>">` already present in `<head>` (an
14
+ * SSR-emitted copy) counts as installed — only the registry entry is added,
15
+ * so shadow adopters still get a sheet.
16
+ */
17
+ export declare function installLightStyles(key: string, styles: CSSResult | string): void;
18
+ /** Snapshot of everything installed so far. */
19
+ export declare function getLightStyleEntries(): LightStyleEntry[];
20
+ /**
21
+ * Mirror all light-tier sheets — current and future — into a shadow root, so
22
+ * consumer DOM adopted into it (render callbacks) keeps its light-tier
23
+ * styling. Returns a disposer; call it from `disconnectedCallback`.
24
+ */
25
+ export declare function adoptLightStyles(root: ShadowRoot): () => void;
@@ -0,0 +1,26 @@
1
+ import { TemplateResult } from 'lit';
2
+ /**
3
+ * Rewrite a template's static strings, stamping the scope attribute after
4
+ * every element tag name. Pure and deterministic; exported for the codegen
5
+ * (static `.element.html` templates route through the same rewriter) and for
6
+ * tests.
7
+ */
8
+ export declare function rewriteStatics(strings: TemplateStringsArray, scope: string): TemplateStringsArray;
9
+ /** Disable the once-per-template structural verification (see below) — an
10
+ * escape hatch for a false positive; the rewrite itself still runs. */
11
+ export declare function configureScopedHtml(options: {
12
+ verify?: boolean;
13
+ }): void;
14
+ type TemplateTag = (strings: TemplateStringsArray, ...values: unknown[]) => TemplateResult;
15
+ /** A scope-stamping replacement for lit's `html`. One factory call per
16
+ * component module; use the result for every template the component owns. */
17
+ export declare function scopedHtml(scope: string): TemplateTag;
18
+ /** The `svg` twin (data-* attributes are valid on SVG elements). */
19
+ export declare function scopedSvg(scope: string): TemplateTag;
20
+ /**
21
+ * Imperatively stamp a DOM subtree with a scope — for DOM the rewriter can't
22
+ * see (`unsafeHTML` output, `document.createElement`, an overlay panel built
23
+ * by hand). Skips subtrees that already belong to another scope.
24
+ */
25
+ export declare function stampScope(root: Element, scope: string): void;
26
+ export {};
package/navbar/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { unsafeCSS as n, LitElement as d, html as o } from "lit";
2
- import { O as v } from "../chunks/overlay-controller-D6agzzOI.mjs";
2
+ import { O as v } from "../chunks/overlay-controller-DifgO6jT.mjs";
3
3
  const p = n(`.navbar {
4
4
  --bs-navbar-padding-x: 0;
5
5
  --bs-navbar-padding-y: 0.5rem;
package/overlay/index.mjs CHANGED
@@ -1,4 +1,7 @@
1
- import { O as e } from "../chunks/overlay-controller-D6agzzOI.mjs";
1
+ import { O as e, a as o, c as n, o as t } from "../chunks/overlay-controller-DifgO6jT.mjs";
2
2
  export {
3
- e as OverlayController
3
+ e as OverlayController,
4
+ o as acquirePortal,
5
+ n as currentOverlayContainer,
6
+ t as openPaneCount
4
7
  };
@@ -1,2 +1,4 @@
1
+ export { acquirePortal, currentOverlayContainer, openPaneCount } from './overlay-portal';
2
+ export type { PortalHandle } from './overlay-portal';
1
3
  export { OverlayController } from './overlay-controller';
2
4
  export type { OverlayControllerOptions, OverlayPosition, OverlayOriginX, OverlayOriginY, PanelWidth, ScrollStrategy, } from './overlay-controller';
@@ -91,6 +91,24 @@ export interface OverlayControllerOptions {
91
91
  * - `string` — any CSS width value (`'50vw'`, `'fit-content'`, …)
92
92
  */
93
93
  panelWidth?: PanelWidth;
94
+ /**
95
+ * Render the panel into a document-root overlay pane instead of leaving it
96
+ * where the host rendered it. Default: false, so every existing consumer is
97
+ * unaffected.
98
+ *
99
+ * A panel left in place is clipped by any `overflow: auto` ancestor and
100
+ * stacked against whatever `z-index` its neighbours use; a portalled one is
101
+ * neither. Use it when the panel opens from inside a scroll container, or
102
+ * when the host's ancestors belong to a consumer's application and so cannot
103
+ * be relied on to avoid establishing a fixed containing block.
104
+ *
105
+ * The controller does **not** render the panel — it never has. It acquires
106
+ * the pane before the host's update, so the host can render into
107
+ * {@link OverlayController.portalContainer} during that same update, and
108
+ * releases it on close. `panel()` must therefore resolve to an element inside
109
+ * that container while the overlay is open.
110
+ */
111
+ portal?: boolean;
94
112
  onOpen?: () => void;
95
113
  onClose?: () => void;
96
114
  }
@@ -160,10 +178,19 @@ export declare class OverlayController implements ReactiveController {
160
178
  /** Inline `padding-right` we wrote on <body> to compensate for the
161
179
  * disappearing scrollbar — captured so release() can restore exactly. */
162
180
  private blockedBodyPaddingRight;
181
+ /** Live pane in the document-root container, when `options.portal` is set. */
182
+ private portalHandle;
163
183
  constructor(host: ReactiveControllerHost & HTMLElement, options: OverlayControllerOptions);
164
184
  hostConnected(): void;
165
185
  hostDisconnected(): void;
166
186
  get isOpen(): boolean;
187
+ /**
188
+ * The document-root pane to render the panel into, or `null` when this
189
+ * overlay is closed or not portalled. Read it from the host's update so the
190
+ * panel exists by the time the controller positions it.
191
+ */
192
+ get portalContainer(): HTMLElement | null;
193
+ private releasePortal;
167
194
  /**
168
195
  * Whether this overlay is the top-most dismissible layer — i.e. whether an
169
196
  * Escape belongs to IT rather than to something opened on top of it.
@@ -0,0 +1,53 @@
1
+ /**
2
+ * A document-root overlay container, in the spirit of `@angular/cdk/overlay`'s
3
+ * `OverlayContainer` — the DOM-ownership half that `OverlayController` has
4
+ * deliberately never had. The controller positions; this owns where the panel
5
+ * lives. They compose, and either works without the other.
6
+ *
7
+ * ## Why a panel would leave its own subtree
8
+ *
9
+ * A panel rendered in place is clipped by any `overflow: auto` ancestor and
10
+ * stacked against whatever `z-index` its neighbours happen to use. The house
11
+ * answer so far has been `position: fixed` plus a hand-picked `z-index` per
12
+ * component, which holds only while **no ancestor establishes a fixed
13
+ * containing block**. That rule is enforced by comments, and it is unenforceable
14
+ * outright when the ancestors belong to a consumer's application — as they do
15
+ * for a light-DOM component such as `mp-datatable`.
16
+ *
17
+ * Moving the panel to a container that is the last child of `<body>` removes
18
+ * both problems at once: nothing clips it, and panes stack in DOM order rather
19
+ * than by a number each component invented on its own.
20
+ *
21
+ * ## The invariant this file exists to protect
22
+ *
23
+ * **The container must never establish a containing block.** No `transform`,
24
+ * `filter`, `backdrop-filter`, `perspective`, `contain`, `will-change` or
25
+ * `container-type`. Any of those would make it the containing block for the
26
+ * `position: fixed` panes inside it, and every panel's viewport coordinates —
27
+ * written by `OverlayController` from `getBoundingClientRect()` — would be
28
+ * silently wrong. This is the one ancestor we control; `overlay-portal.spec.ts`
29
+ * asserts the computed style so a later edit cannot quietly reintroduce the trap.
30
+ *
31
+ * Measured (Chromium 151, Firefox 153, WebKit 26.5): with these styles a
32
+ * `position: fixed` child of a pane resolves against the viewport at exactly
33
+ * (0, 0), and 20 acquire/release cycles leave no orphaned nodes.
34
+ */
35
+ /** A single pane inside the shared container. Release it when the panel closes. */
36
+ export interface PortalHandle {
37
+ /** The element to render the panel into. Positioned by `OverlayController`. */
38
+ readonly container: HTMLElement;
39
+ /** Removes the pane, and the shared container with it when this was the last one. */
40
+ release(): void;
41
+ }
42
+ /**
43
+ * Acquires a pane in the shared document-root container.
44
+ *
45
+ * Returns `null` during SSR, where there is no document to attach to; callers
46
+ * fall back to rendering in place, which is correct for a non-interactive
47
+ * server render.
48
+ */
49
+ export declare function acquirePortal(): PortalHandle | null;
50
+ /** Test seam: the live container, or null when nothing is open. */
51
+ export declare function currentOverlayContainer(): HTMLElement | null;
52
+ /** Test seam. */
53
+ export declare function openPaneCount(): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/web-components",
3
- "version": "2.14.0",
3
+ "version": "2.16.0",
4
4
  "description": "Framework-agnostic Lit web components for the @mintplayer/bootstrap design system. Consumed by @mintplayer/ng-bootstrap, @mintplayer/react-bootstrap, and @mintplayer/vue-bootstrap.",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -101,6 +101,10 @@
101
101
  "types": "./input-group/index.d.ts",
102
102
  "import": "./input-group/index.mjs"
103
103
  },
104
+ "./light-dom": {
105
+ "types": "./light-dom/index.d.ts",
106
+ "import": "./light-dom/index.mjs"
107
+ },
104
108
  "./multi-range": {
105
109
  "types": "./multi-range/index.d.ts",
106
110
  "import": "./multi-range/index.mjs"