@mintplayer/web-components 2.14.0 → 2.15.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 (44) 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-GmKqaN8y.mjs → mp-datatable-UJI8E73X.mjs} +484 -476
  5. package/chunks/{mp-treeview-tkWu28iF.mjs → mp-treeview-C8iltDbq.mjs} +61 -63
  6. package/datatable/index.mjs +2 -2
  7. package/datatable/src/components/mp-datatable.d.ts +9 -1
  8. package/datatable/src/index.d.ts +1 -1
  9. package/datatable/src/styles/datatable.light.styles.d.ts +2 -0
  10. package/datatable/src/styles/index.d.ts +1 -1
  11. package/dock/index.mjs +477 -492
  12. package/dock/src/components/mint-dock-manager.element.d.ts +10 -8
  13. package/dock/src/core/index.d.ts +1 -0
  14. package/dock/src/core/intersection-sizing.d.ts +83 -0
  15. package/dock/src/core/layout-tree.d.ts +23 -2
  16. package/dock/src/core/types.d.ts +14 -0
  17. package/file-manager/index.mjs +30 -29
  18. package/file-manager/src/components/mp-file-manager.d.ts +2 -0
  19. package/light-dom/index.d.ts +1 -0
  20. package/light-dom/index.mjs +11 -0
  21. package/light-dom/src/index.d.ts +2 -0
  22. package/light-dom/src/install-light-styles.d.ts +25 -0
  23. package/light-dom/src/scoped-html.d.ts +26 -0
  24. package/package.json +5 -1
  25. package/query-builder/index.mjs +1472 -2651
  26. package/query-builder/src/index.d.ts +4 -0
  27. package/query-builder/src/mp-query-builder.element.d.ts +1 -1
  28. package/query-builder/src/mp-query-builder.light.styles.d.ts +2 -0
  29. package/query-builder/src/mp-query-condition.element.d.ts +1 -1
  30. package/query-builder/src/mp-query-condition.light.styles.d.ts +2 -0
  31. package/query-builder/src/mp-query-group.element.d.ts +1 -1
  32. package/query-builder/src/mp-query-group.light.styles.d.ts +2 -0
  33. package/query-builder/src/mp-query-subquery.element.d.ts +1 -1
  34. package/query-builder/src/mp-query-subquery.light.styles.d.ts +2 -0
  35. package/tree-select/index.mjs +60 -58
  36. package/tree-select/src/components/mp-tree-select.d.ts +1 -1
  37. package/tree-select/src/index.d.ts +1 -1
  38. package/tree-select/src/styles/index.d.ts +1 -1
  39. package/tree-select/src/styles/tree-select.light.styles.d.ts +2 -0
  40. package/treeview/index.mjs +3 -3
  41. package/treeview/src/components/mp-treeview.d.ts +1 -1
  42. package/treeview/src/index.d.ts +1 -1
  43. package/treeview/src/styles/index.d.ts +1 -1
  44. package/treeview/src/styles/treeview.light.styles.d.ts +2 -0
@@ -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-UJI8E73X.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mintplayer/web-components",
3
- "version": "2.14.0",
3
+ "version": "2.15.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"