@nvidia-elements/core 2.15.1 → 2.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/accordion/accordion2.js +4 -4
- package/dist/alert/alert-group2.js +1 -1
- package/dist/alert/alert2.js +1 -1
- package/dist/avatar/avatar-group2.js +1 -1
- package/dist/avatar/avatar2.js +1 -1
- package/dist/badge/badge2.js +1 -1
- package/dist/breadcrumb/breadcrumb2.js +1 -1
- package/dist/bundle.d.ts +0 -2
- package/dist/bundles/index.d.ts +0 -289
- package/dist/bundles/index.js +6 -6
- package/dist/button/button2.js +1 -1
- package/dist/button-group/button-group2.js +1 -1
- package/dist/card/card2.js +4 -4
- package/dist/chat-message/chat-message2.js +1 -1
- package/dist/checkbox/checkbox-group2.js +1 -1
- package/dist/checkbox/checkbox2.js +1 -1
- package/dist/color/color2.js +1 -1
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/custom-elements-jsx.d.ts +0 -157
- package/dist/custom-elements-vue.d.ts +0 -155
- package/dist/custom-elements.json +0 -3259
- package/dist/data.html.json +0 -119
- package/dist/data.snippets.json +45 -45
- package/dist/date/date2.js +1 -1
- package/dist/datetime/datetime2.js +1 -1
- package/dist/dialog/dialog-footer2.js +1 -1
- package/dist/dialog/dialog-header2.js +1 -1
- package/dist/dialog/dialog2.js +1 -1
- package/dist/divider/divider2.js +1 -1
- package/dist/dot/dot2.js +1 -1
- package/dist/drag-handle/drag-handle2.js +1 -1
- package/dist/drawer/drawer-content2.js +1 -1
- package/dist/drawer/drawer-footer2.js +1 -1
- package/dist/drawer/drawer-header2.js +1 -1
- package/dist/drawer/drawer2.js +1 -1
- package/dist/dropdown/dropdown-footer2.js +1 -1
- package/dist/dropdown/dropdown-header2.js +1 -1
- package/dist/dropdown/dropdown2.js +1 -1
- package/dist/dropdown-group/dropdown-group.js +1 -1
- package/dist/dropzone/dropzone2.js +1 -1
- package/dist/file/file2.js +1 -1
- package/dist/format-bytes/format-bytes2.js +1 -1
- package/dist/format-datetime/format-datetime2.js +1 -1
- package/dist/format-number/format-number2.js +1 -1
- package/dist/format-relative-time/format-relative-time2.js +1 -1
- package/dist/format-truncate/format-truncate2.js +1 -1
- package/dist/forms/control/control2.js +1 -1
- package/dist/forms/control/control2.js.map +1 -1
- package/dist/forms/control-group/control-group2.js +1 -1
- package/dist/forms/control-message/control-message2.js +1 -1
- package/dist/gauge/gauge2.js +1 -1
- package/dist/grid/cell/cell2.js +1 -1
- package/dist/grid/column/column2.js +1 -1
- package/dist/grid/footer/footer2.js +1 -1
- package/dist/grid/grid2.js +1 -1
- package/dist/grid/header/header2.js +1 -1
- package/dist/grid/placeholder/placeholder2.js +1 -1
- package/dist/grid/row/row2.js +1 -1
- package/dist/icon/icon2.js +2 -2
- package/dist/icon-button/icon-button2.js +1 -1
- package/dist/index.js +1 -1
- package/dist/input/input-group2.js +1 -1
- package/dist/input/input2.js +1 -1
- package/dist/internal/services/global.service.js +1 -1
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/menu-group2.js +1 -1
- package/dist/menu/menu-item2.js +1 -1
- package/dist/menu/menu2.js +1 -1
- package/dist/month/month2.js +1 -1
- package/dist/notification/notification-group2.js +1 -1
- package/dist/notification/notification2.js +1 -1
- package/dist/page/page-panel/page-panel-content2.js +1 -1
- package/dist/page/page-panel/page-panel-footer2.js +1 -1
- package/dist/page/page-panel/page-panel-header2.js +1 -1
- package/dist/page/page-panel/page-panel2.js +1 -1
- package/dist/page/page2.js +1 -1
- package/dist/page-header/page-header2.js +1 -1
- package/dist/page-loader/page-loader2.js +1 -1
- package/dist/pagination/pagination2.js +1 -1
- package/dist/panel/panel2.js +4 -4
- package/dist/password/password2.js +1 -1
- package/dist/preferences-input/preferences-input2.js +1 -1
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-ring/progress-ring2.js +1 -1
- package/dist/progressive-filter-chip/progressive-filter-chip2.js +1 -1
- package/dist/pulse/pulse2.js +1 -1
- package/dist/radio/radio-group2.js +1 -1
- package/dist/radio/radio2.js +1 -1
- package/dist/range/range2.js +1 -1
- package/dist/resize-handle/resize-handle2.js +1 -1
- package/dist/search/search2.js +1 -1
- package/dist/select/select2.js +1 -1
- package/dist/skeleton/skeleton2.js +1 -1
- package/dist/sort-button/sort-button2.js +1 -1
- package/dist/sparkline/sparkline2.js +1 -1
- package/dist/star-rating/star-rating2.js +1 -1
- package/dist/steps/steps2.js +2 -2
- package/dist/switch/switch-group2.js +1 -1
- package/dist/switch/switch2.js +1 -1
- package/dist/tabs/tabs-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +1 -1
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +1 -1
- package/dist/toast/toast2.js +1 -1
- package/dist/toggletip/toggletip-footer2.js +1 -1
- package/dist/toggletip/toggletip-header2.js +1 -1
- package/dist/toggletip/toggletip2.js +1 -1
- package/dist/toolbar/toolbar2.js +1 -1
- package/dist/tooltip/tooltip2.js +1 -1
- package/dist/tree/tree-node.js +1 -1
- package/dist/tree/tree-node.js.map +1 -1
- package/dist/tree/tree-node2.js +1 -1
- package/dist/tree/tree.examples.js.map +1 -1
- package/dist/tree/tree.examples.json +11 -0
- package/dist/tree/tree.js +1 -1
- package/dist/tree/tree.js.map +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/week/week2.js +1 -1
- package/package.json +2 -14
- package/dist/viewport/define.d.ts +0 -8
- package/dist/viewport/define.js +0 -8
- package/dist/viewport/define.js.map +0 -1
- package/dist/viewport/index.d.ts +0 -4
- package/dist/viewport/index.js +0 -4
- package/dist/viewport/viewport-animation.controller.d.ts +0 -21
- package/dist/viewport/viewport-animation.controller.js +0 -93
- package/dist/viewport/viewport-animation.controller.js.map +0 -1
- package/dist/viewport/viewport-autofit.controller.d.ts +0 -18
- package/dist/viewport/viewport-autofit.controller.js +0 -105
- package/dist/viewport/viewport-autofit.controller.js.map +0 -1
- package/dist/viewport/viewport-fitting.utils.d.ts +0 -36
- package/dist/viewport/viewport-fitting.utils.js +0 -35
- package/dist/viewport/viewport-fitting.utils.js.map +0 -1
- package/dist/viewport/viewport-gesture-navigation.controller.d.ts +0 -27
- package/dist/viewport/viewport-gesture-navigation.controller.js +0 -318
- package/dist/viewport/viewport-gesture-navigation.controller.js.map +0 -1
- package/dist/viewport/viewport-gridlines.d.ts +0 -42
- package/dist/viewport/viewport-gridlines.js +0 -6
- package/dist/viewport/viewport-gridlines.js.map +0 -1
- package/dist/viewport/viewport-gridlines.utils.d.ts +0 -11
- package/dist/viewport/viewport-gridlines.utils.js +0 -54
- package/dist/viewport/viewport-gridlines.utils.js.map +0 -1
- package/dist/viewport/viewport-gridlines2.js +0 -164
- package/dist/viewport/viewport-gridlines2.js.map +0 -1
- package/dist/viewport/viewport-minimap.d.ts +0 -36
- package/dist/viewport/viewport-minimap.js +0 -6
- package/dist/viewport/viewport-minimap.js.map +0 -1
- package/dist/viewport/viewport-minimap.utils.d.ts +0 -13
- package/dist/viewport/viewport-minimap.utils.js +0 -49
- package/dist/viewport/viewport-minimap.utils.js.map +0 -1
- package/dist/viewport/viewport-minimap2.js +0 -309
- package/dist/viewport/viewport-minimap2.js.map +0 -1
- package/dist/viewport/viewport-navigation.controller.d.ts +0 -21
- package/dist/viewport/viewport-navigation.controller.js +0 -136
- package/dist/viewport/viewport-navigation.controller.js.map +0 -1
- package/dist/viewport/viewport-navigation.types.d.ts +0 -1
- package/dist/viewport/viewport-projection.utils.d.ts +0 -7
- package/dist/viewport/viewport-projection.utils.js +0 -25
- package/dist/viewport/viewport-projection.utils.js.map +0 -1
- package/dist/viewport/viewport.d.ts +0 -122
- package/dist/viewport/viewport.examples.js +0 -6
- package/dist/viewport/viewport.examples.js.map +0 -1
- package/dist/viewport/viewport.examples.json +0 -87
- package/dist/viewport/viewport.js +0 -6
- package/dist/viewport/viewport.js.map +0 -1
- package/dist/viewport/viewport.types.d.ts +0 -93
- package/dist/viewport/viewport2.js +0 -440
- package/dist/viewport/viewport2.js.map +0 -1
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
import { hostAttr as e } from "../internal/decorators/host-attr.js";
|
|
2
|
-
import { useStyles as t } from "../internal/styles/index.js";
|
|
3
|
-
import { finiteOr as n, positiveFiniteOr as r } from "../internal/utils/numeric.js";
|
|
4
|
-
import i from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
5
|
-
import { Viewport as a } from "./viewport2.js";
|
|
6
|
-
import o from "./viewport-gridlines.js";
|
|
7
|
-
import { createGridlineCoverage as s, gridlineCoverageNeedsUpdate as c, selectGridlineInterval as l } from "./viewport-gridlines.utils.js";
|
|
8
|
-
import { LitElement as u, html as d, nothing as f, svg as p } from "lit";
|
|
9
|
-
import { property as m } from "lit/decorators/property.js";
|
|
10
|
-
import { styleMap as h } from "lit/directives/style-map.js";
|
|
11
|
-
//#region src/viewport/viewport-gridlines.ts
|
|
12
|
-
var g = 10, _ = 64, v = class extends u {
|
|
13
|
-
constructor(...e) {
|
|
14
|
-
super(...e), this.slot = "background", this.accessibilityHidden = "true", this.#e = g, this.#t = 0, this.#n = 0, this.#r = _, this.pattern = "lines", this.#c = () => {
|
|
15
|
-
let e = this.#i;
|
|
16
|
-
e && (this.style.setProperty("--_scale", `${e.scale}`), this.#u());
|
|
17
|
-
}, this.#l = () => {
|
|
18
|
-
this.#u({ forceCoverage: !0 });
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
static {
|
|
22
|
-
this.styles = t([o]);
|
|
23
|
-
}
|
|
24
|
-
static {
|
|
25
|
-
this.metadata = {
|
|
26
|
-
tag: "nve-viewport-gridlines",
|
|
27
|
-
version: "2.15.1"
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
#e;
|
|
31
|
-
#t;
|
|
32
|
-
#n;
|
|
33
|
-
#r;
|
|
34
|
-
#i;
|
|
35
|
-
#a;
|
|
36
|
-
#o;
|
|
37
|
-
get step() {
|
|
38
|
-
return this.#e;
|
|
39
|
-
}
|
|
40
|
-
set step(e) {
|
|
41
|
-
let t = r(e, g);
|
|
42
|
-
if (t === this.#e) return;
|
|
43
|
-
let n = this.#e;
|
|
44
|
-
this.#e = t, this.requestUpdate("step", n);
|
|
45
|
-
}
|
|
46
|
-
get originX() {
|
|
47
|
-
return this.#t;
|
|
48
|
-
}
|
|
49
|
-
set originX(e) {
|
|
50
|
-
let t = n(e, 0);
|
|
51
|
-
if (t === this.#t) return;
|
|
52
|
-
let r = this.#t;
|
|
53
|
-
this.#t = t, this.requestUpdate("originX", r);
|
|
54
|
-
}
|
|
55
|
-
get originY() {
|
|
56
|
-
return this.#n;
|
|
57
|
-
}
|
|
58
|
-
set originY(e) {
|
|
59
|
-
let t = n(e, 0);
|
|
60
|
-
if (t === this.#n) return;
|
|
61
|
-
let r = this.#n;
|
|
62
|
-
this.#n = t, this.requestUpdate("originY", r);
|
|
63
|
-
}
|
|
64
|
-
get targetSpacing() {
|
|
65
|
-
return this.#r;
|
|
66
|
-
}
|
|
67
|
-
set targetSpacing(e) {
|
|
68
|
-
let t = r(e, _);
|
|
69
|
-
if (t === this.#r) return;
|
|
70
|
-
let n = this.#r;
|
|
71
|
-
this.#r = t, this.requestUpdate("targetSpacing", n);
|
|
72
|
-
}
|
|
73
|
-
connectedCallback() {
|
|
74
|
-
super.connectedCallback();
|
|
75
|
-
let e = this.parentElement;
|
|
76
|
-
e instanceof a && (this.#i = e, this.style.setProperty("--_scale", `${e.scale}`), this.#i.addEventListener("viewportchange", this.#c), typeof ResizeObserver < "u" && (this.#a = new ResizeObserver(this.#l), this.#a.observe(e)), this.#d({
|
|
77
|
-
forceCoverage: !0,
|
|
78
|
-
resetInterval: !0
|
|
79
|
-
}));
|
|
80
|
-
}
|
|
81
|
-
disconnectedCallback() {
|
|
82
|
-
this.#i && this.#i.removeEventListener("viewportchange", this.#c), this.#a?.disconnect(), this.#a = void 0, this.#i = void 0, this.#o = void 0, super.disconnectedCallback();
|
|
83
|
-
}
|
|
84
|
-
willUpdate(e) {
|
|
85
|
-
super.willUpdate(e), (e.has("step") || e.has("targetSpacing")) && this.#d({
|
|
86
|
-
forceCoverage: !0,
|
|
87
|
-
resetInterval: !0
|
|
88
|
-
});
|
|
89
|
-
}
|
|
90
|
-
render() {
|
|
91
|
-
let e = this.#o;
|
|
92
|
-
if (!e) return f;
|
|
93
|
-
let { coverage: t, interval: n } = e, r = this.pattern === "dots" || this.pattern === "crosses";
|
|
94
|
-
return d`<svg internal-host aria-hidden="true" focusable="false" preserveAspectRatio="none" style="${h(b(t))}" viewBox="${t.x} ${t.y} ${t.width} ${t.height}"><defs><pattern data-gridline-pattern id="gridlines" x="${this.#t - (r ? n / 2 : 0)}" y="${this.#n - (r ? n / 2 : 0)}" width="${n}" height="${n}" patternUnits="userSpaceOnUse">${this.#s(n)}</pattern></defs><rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" fill="url(#gridlines)"></rect></svg>`;
|
|
95
|
-
}
|
|
96
|
-
#s(e) {
|
|
97
|
-
switch (this.pattern) {
|
|
98
|
-
case "dots": return p`<circle cx="${e / 2}" cy="${e / 2}" r="2"></circle>`;
|
|
99
|
-
case "crosses": return p`<g transform="translate(${e / 2} ${e / 2})"><clipPath id="cross-clip"><rect class="cross-horizontal"></rect><rect class="cross-vertical"></rect></clipPath><rect class="cross" x="${-e / 2}" y="${-e / 2}" width="${e}" height="${e}" clip-path="url(#cross-clip)"></rect></g>`;
|
|
100
|
-
default: return p`<path d="M ${e} 0 H 0 V ${e}"></path>`;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
#c;
|
|
104
|
-
#l;
|
|
105
|
-
#u(e = {}) {
|
|
106
|
-
this.#d(e) && this.requestUpdate();
|
|
107
|
-
}
|
|
108
|
-
#d(e = {}) {
|
|
109
|
-
let t = this.#i;
|
|
110
|
-
if (!t) return !1;
|
|
111
|
-
let n = t.getVisibleRect();
|
|
112
|
-
if (n.width <= 0 || n.height <= 0) return !1;
|
|
113
|
-
let r = l({
|
|
114
|
-
current: e.resetInterval ? void 0 : this.#o?.interval,
|
|
115
|
-
scale: t.scale,
|
|
116
|
-
step: this.#e,
|
|
117
|
-
targetSpacing: this.#r
|
|
118
|
-
}), i = y({
|
|
119
|
-
forceCoverage: e.forceCoverage === !0,
|
|
120
|
-
interval: r,
|
|
121
|
-
previous: this.#o,
|
|
122
|
-
visible: n
|
|
123
|
-
});
|
|
124
|
-
return i ? (this.#o = i, !0) : !1;
|
|
125
|
-
}
|
|
126
|
-
};
|
|
127
|
-
i([e()], v.prototype, "slot", void 0), i([e({ attribute: "aria-hidden" })], v.prototype, "accessibilityHidden", void 0), i([m({
|
|
128
|
-
type: String,
|
|
129
|
-
reflect: !0
|
|
130
|
-
})], v.prototype, "pattern", void 0), i([m({
|
|
131
|
-
type: Number,
|
|
132
|
-
reflect: !0
|
|
133
|
-
})], v.prototype, "step", null), i([m({
|
|
134
|
-
type: Number,
|
|
135
|
-
attribute: "origin-x",
|
|
136
|
-
reflect: !0
|
|
137
|
-
})], v.prototype, "originX", null), i([m({
|
|
138
|
-
type: Number,
|
|
139
|
-
attribute: "origin-y",
|
|
140
|
-
reflect: !0
|
|
141
|
-
})], v.prototype, "originY", null), i([m({
|
|
142
|
-
type: Number,
|
|
143
|
-
attribute: "target-spacing",
|
|
144
|
-
reflect: !0
|
|
145
|
-
})], v.prototype, "targetSpacing", null);
|
|
146
|
-
function y({ forceCoverage: e, interval: t, previous: n, visible: r }) {
|
|
147
|
-
let i = e || c(n?.coverage, r), a = t !== n?.interval;
|
|
148
|
-
if (!(!i && !a)) return {
|
|
149
|
-
coverage: i || !n ? s(r) : n.coverage,
|
|
150
|
-
interval: t
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
function b(e) {
|
|
154
|
-
return {
|
|
155
|
-
height: `${e.height}px`,
|
|
156
|
-
left: `${e.x}px`,
|
|
157
|
-
top: `${e.y}px`,
|
|
158
|
-
width: `${e.width}px`
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
//#endregion
|
|
162
|
-
export { v as ViewportGridlines };
|
|
163
|
-
|
|
164
|
-
//# sourceMappingURL=viewport-gridlines2.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-gridlines2.js","names":[],"sources":["../../src/viewport/viewport-gridlines.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement, nothing, svg, type PropertyValues } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport { finiteOr, hostAttr, positiveFiniteOr, useStyles } from '@nvidia-elements/core/internal';\nimport styles from './viewport-gridlines.css?inline';\nimport {\n createGridlineCoverage,\n gridlineCoverageNeedsUpdate,\n selectGridlineInterval\n} from './viewport-gridlines.utils.js';\nimport { Viewport } from './viewport.js';\nimport type { ViewportRect } from './viewport.types.js';\n\nconst DEFAULT_STEP = 10;\nconst DEFAULT_TARGET_SPACING = 64;\n\ninterface GridlineProjection {\n readonly coverage: ViewportRect;\n readonly interval: number;\n}\n\ninterface ProjectionSyncOptions {\n readonly forceCoverage?: boolean;\n readonly resetInterval?: boolean;\n}\n\n/**\n * @element nve-viewport-gridlines\n * @description Renders origin-stable, zoom-adaptive gridline patterns behind viewport content.\n * @documentation https://nvidia.github.io/elements/docs/elements/viewport/\n * @since 0.0.0\n * @entrypoint \\@nvidia-elements/core/viewport\n * @cssprop --color - Sets the gridline pattern color.\n * @cssprop --line-width - Sets the approximate stroke width in CSS pixels.\n * @cssprop --dot-radius - Sets the approximate dot radius in CSS pixels.\n * @cssprop --cross-size - Sets the approximate full width and height of each cross in CSS pixels.\n */\nexport class ViewportGridlines extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-viewport-gridlines',\n version: '0.0.0'\n };\n\n /** @private */\n @hostAttr() slot = 'background';\n\n /** @private */\n @hostAttr({ attribute: 'aria-hidden' }) protected accessibilityHidden = 'true';\n\n #step = DEFAULT_STEP;\n #originX = 0;\n #originY = 0;\n #targetSpacing = DEFAULT_TARGET_SPACING;\n #viewport?: Viewport;\n #resizeObserver?: ResizeObserver;\n #projection?: GridlineProjection;\n\n /** Grid pattern to render. */\n @property({ type: String, reflect: true }) pattern: 'lines' | 'dots' | 'crosses' = 'lines';\n\n /** Smallest gridline interval in content-space units. */\n @property({ type: Number, reflect: true })\n get step(): number {\n return this.#step;\n }\n\n set step(value: number) {\n const next = positiveFiniteOr(value, DEFAULT_STEP);\n if (next === this.#step) return;\n const previous = this.#step;\n this.#step = next;\n this.requestUpdate('step', previous);\n }\n\n /** Content-space x coordinate of the grid origin. */\n @property({ type: Number, attribute: 'origin-x', reflect: true })\n get originX(): number {\n return this.#originX;\n }\n\n set originX(value: number) {\n const next = finiteOr(value, 0);\n if (next === this.#originX) return;\n const previous = this.#originX;\n this.#originX = next;\n this.requestUpdate('originX', previous);\n }\n\n /** Content-space y coordinate of the grid origin. */\n @property({ type: Number, attribute: 'origin-y', reflect: true })\n get originY(): number {\n return this.#originY;\n }\n\n set originY(value: number) {\n const next = finiteOr(value, 0);\n if (next === this.#originY) return;\n const previous = this.#originY;\n this.#originY = next;\n this.requestUpdate('originY', previous);\n }\n\n /** Target on-screen separation used to choose the adaptive gridline interval, in CSS pixels. */\n @property({ type: Number, attribute: 'target-spacing', reflect: true })\n get targetSpacing(): number {\n return this.#targetSpacing;\n }\n\n set targetSpacing(value: number) {\n const next = positiveFiniteOr(value, DEFAULT_TARGET_SPACING);\n if (next === this.#targetSpacing) return;\n const previous = this.#targetSpacing;\n this.#targetSpacing = next;\n this.requestUpdate('targetSpacing', previous);\n }\n\n connectedCallback(): void {\n super.connectedCallback();\n const viewport = this.parentElement;\n if (!(viewport instanceof Viewport)) return;\n this.#viewport = viewport;\n this.style.setProperty('--_scale', `${viewport.scale}`);\n this.#viewport.addEventListener('viewportchange', this.#handleViewportChange);\n if (typeof ResizeObserver !== 'undefined') {\n this.#resizeObserver = new ResizeObserver(this.#handleViewportResize);\n this.#resizeObserver.observe(viewport);\n }\n this.#updateProjection({ forceCoverage: true, resetInterval: true });\n }\n\n disconnectedCallback(): void {\n if (this.#viewport) {\n this.#viewport.removeEventListener('viewportchange', this.#handleViewportChange);\n }\n this.#resizeObserver?.disconnect();\n this.#resizeObserver = undefined;\n this.#viewport = undefined;\n this.#projection = undefined;\n super.disconnectedCallback();\n }\n\n protected willUpdate(changed: PropertyValues<this>): void {\n super.willUpdate(changed);\n if (changed.has('step') || changed.has('targetSpacing')) {\n this.#updateProjection({ forceCoverage: true, resetInterval: true });\n }\n }\n\n render() {\n const projection = this.#projection;\n if (!projection) return nothing;\n const { coverage, interval } = projection;\n const centered = this.pattern === 'dots' || this.pattern === 'crosses';\n return html`\n <svg\n internal-host\n aria-hidden=\"true\"\n focusable=\"false\"\n preserveAspectRatio=\"none\"\n style=${styleMap(coverageStyles(coverage))}\n viewBox=\"${coverage.x} ${coverage.y} ${coverage.width} ${coverage.height}\"\n >\n <defs>\n <pattern\n data-gridline-pattern\n id=\"gridlines\"\n x=${this.#originX - (centered ? interval / 2 : 0)}\n y=${this.#originY - (centered ? interval / 2 : 0)}\n width=${interval}\n height=${interval}\n patternUnits=\"userSpaceOnUse\"\n >\n ${this.#renderPattern(interval)}\n </pattern>\n </defs>\n <rect\n x=${coverage.x}\n y=${coverage.y}\n width=${coverage.width}\n height=${coverage.height}\n fill=\"url(#gridlines)\"\n ></rect>\n </svg>\n `;\n }\n\n #renderPattern(interval: number) {\n switch (this.pattern) {\n case 'dots':\n return svg`<circle cx=${interval / 2} cy=${interval / 2} r=\"2\"></circle>`;\n case 'crosses':\n return svg`\n <g transform=\"translate(${interval / 2} ${interval / 2})\">\n <clipPath id=\"cross-clip\">\n <rect class=\"cross-horizontal\"></rect>\n <rect class=\"cross-vertical\"></rect>\n </clipPath>\n <rect\n class=\"cross\"\n x=${-interval / 2}\n y=${-interval / 2}\n width=${interval}\n height=${interval}\n clip-path=\"url(#cross-clip)\"\n ></rect>\n </g>\n `;\n case 'lines':\n default:\n return svg`<path d=\"M ${interval} 0 H 0 V ${interval}\"></path>`;\n }\n }\n\n #handleViewportChange = (): void => {\n const viewport = this.#viewport;\n if (!viewport) return;\n this.style.setProperty('--_scale', `${viewport.scale}`);\n this.#requestProjectionUpdate();\n };\n\n #handleViewportResize = (): void => {\n this.#requestProjectionUpdate({ forceCoverage: true });\n };\n\n #requestProjectionUpdate(options: ProjectionSyncOptions = {}): void {\n if (this.#updateProjection(options)) this.requestUpdate();\n }\n\n #updateProjection(options: ProjectionSyncOptions = {}): boolean {\n const viewport = this.#viewport;\n if (!viewport) return false;\n const visible = viewport.getVisibleRect();\n if (visible.width <= 0 || visible.height <= 0) return false;\n const interval = selectGridlineInterval({\n current: options.resetInterval ? undefined : this.#projection?.interval,\n scale: viewport.scale,\n step: this.#step,\n targetSpacing: this.#targetSpacing\n });\n const projection = nextProjection({\n forceCoverage: options.forceCoverage === true,\n interval,\n previous: this.#projection,\n visible\n });\n if (!projection) return false;\n this.#projection = projection;\n return true;\n }\n}\n\nfunction nextProjection({\n forceCoverage,\n interval,\n previous,\n visible\n}: {\n forceCoverage: boolean;\n interval: number;\n previous?: GridlineProjection;\n visible: ViewportRect;\n}): GridlineProjection | undefined {\n const coverageChanged = forceCoverage || gridlineCoverageNeedsUpdate(previous?.coverage, visible);\n const intervalChanged = interval !== previous?.interval;\n if (!coverageChanged && !intervalChanged) return undefined;\n const coverage = coverageChanged || !previous ? createGridlineCoverage(visible) : previous.coverage;\n return { coverage, interval };\n}\n\nfunction coverageStyles(coverage: ViewportRect): Record<string, string> {\n return {\n height: `${coverage.height}px`,\n left: `${coverage.x}px`,\n top: `${coverage.y}px`,\n width: `${coverage.width}px`\n };\n}\n"],"mappings":"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"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { LitElement } from 'lit';
|
|
2
|
-
/**
|
|
3
|
-
* @element nve-viewport-minimap
|
|
4
|
-
* @description Provides a simplified overview and direct navigation for its parent viewport.
|
|
5
|
-
* @documentation https://nvidia.github.io/elements/docs/elements/viewport/
|
|
6
|
-
* @since 0.0.0
|
|
7
|
-
* @entrypoint \@nvidia-elements/core/viewport
|
|
8
|
-
* @cssprop --background - Color of the surface behind preview geometry.
|
|
9
|
-
* @cssprop --color - Color of automatically drawn root rectangles.
|
|
10
|
-
* @cssprop --indicator-color - Color of the current visible-region indicator.
|
|
11
|
-
* @cssprop --border-radius - Corner radius of the minimap.
|
|
12
|
-
* @cssprop --recenter-cursor - Cursor for clicking the background to center the viewport.
|
|
13
|
-
* @cssprop --pan-cursor - Cursor over a draggable visible region.
|
|
14
|
-
* @cssprop --panning-cursor - Cursor during a visible-region drag.
|
|
15
|
-
* @slot preview - Optional simplified content drawn in viewport content coordinates. Replaces automatic root rectangles.
|
|
16
|
-
*/
|
|
17
|
-
export declare class ViewportMinimap extends LitElement {
|
|
18
|
-
#private;
|
|
19
|
-
static styles: import("lit").CSSResult[];
|
|
20
|
-
static readonly metadata: {
|
|
21
|
-
tag: string;
|
|
22
|
-
version: string;
|
|
23
|
-
};
|
|
24
|
-
/** @private */
|
|
25
|
-
_internals: ElementInternals;
|
|
26
|
-
/** @private */
|
|
27
|
-
slot: string;
|
|
28
|
-
/** @private */
|
|
29
|
-
protected accessibilityHidden: string;
|
|
30
|
-
constructor();
|
|
31
|
-
connectedCallback(): void;
|
|
32
|
-
disconnectedCallback(): void;
|
|
33
|
-
/** Remeasures content bounds after preview or viewport roots move without resizing. */
|
|
34
|
-
refresh(): void;
|
|
35
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
36
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
//#region src/viewport/viewport-minimap.css?inline
|
|
2
|
-
var e = ":host{--background: var(--nve-sys-layer-container-background);--color: var(--nve-sys-text-muted-color);--indicator-color: var(--nve-sys-support-accent-color);--border-radius: var(--nve-ref-border-radius-md);position:absolute;inset-block-end:var(--nve-ref-space-xs);inset-inline-end:var(--nve-ref-space-xs);display:block;box-sizing:border-box;inline-size:clamp(8rem,32%,10rem);max-inline-size:calc(100% - 1rem);aspect-ratio:4 / 3;overflow:hidden;border-radius:var(--border-radius);contain:content;cursor:default;user-select:none}.surface{position:relative;inline-size:100%;block-size:100%}svg{position:absolute;inset:0;display:block;inline-size:100%;block-size:100%;overflow:hidden;border-radius:inherit}.preview{position:absolute;inset:0;transform-origin:0 0;pointer-events:none}.foreground-layer{pointer-events:none}.background{fill:var(--background)}.item{fill:var(--color);pointer-events:none}.visible-region{fill:var(--indicator-color);fill-opacity:.15;stroke:var(--indicator-color);stroke-width:1.5;vector-effect:non-scaling-stroke;pointer-events:all}:host(:state(pan-eligible)) .background{cursor:var(--recenter-cursor, pointer)}:host(:state(pan-eligible)) .visible-region{cursor:var(--pan-cursor, grab)}:host(:state(panning)),:host(:state(panning)) .background,:host(:state(panning)) .visible-region{cursor:var(--panning-cursor, grabbing)}";
|
|
3
|
-
//#endregion
|
|
4
|
-
export { e as default };
|
|
5
|
-
|
|
6
|
-
//# sourceMappingURL=viewport-minimap.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-minimap.js","names":[],"sources":["../../src/viewport/viewport-minimap.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n:host {\n --background: var(--nve-sys-layer-container-background);\n --color: var(--nve-sys-text-muted-color);\n --indicator-color: var(--nve-sys-support-accent-color);\n --border-radius: var(--nve-ref-border-radius-md);\n\n position: absolute;\n inset-block-end: var(--nve-ref-space-xs);\n inset-inline-end: var(--nve-ref-space-xs);\n display: block;\n box-sizing: border-box;\n inline-size: clamp(8rem, 32%, 10rem);\n max-inline-size: calc(100% - 1rem);\n aspect-ratio: 4 / 3;\n overflow: hidden;\n border-radius: var(--border-radius);\n contain: content;\n cursor: default;\n user-select: none;\n}\n\n.surface {\n position: relative;\n inline-size: 100%;\n block-size: 100%;\n}\n\nsvg {\n position: absolute;\n inset: 0;\n display: block;\n inline-size: 100%;\n block-size: 100%;\n overflow: hidden;\n border-radius: inherit;\n}\n\n.preview {\n position: absolute;\n inset: 0;\n transform-origin: 0 0;\n pointer-events: none;\n}\n\n.foreground-layer {\n pointer-events: none;\n}\n\n.background {\n fill: var(--background);\n}\n\n.item {\n fill: var(--color);\n pointer-events: none;\n}\n\n.visible-region {\n fill: var(--indicator-color);\n fill-opacity: 0.15;\n stroke: var(--indicator-color);\n stroke-width: 1.5;\n vector-effect: non-scaling-stroke;\n pointer-events: all;\n}\n\n:host(:state(pan-eligible)) .background {\n cursor: var(--recenter-cursor, pointer);\n}\n\n:host(:state(pan-eligible)) .visible-region {\n cursor: var(--pan-cursor, grab);\n}\n\n:host(:state(panning)),\n:host(:state(panning)) .background,\n:host(:state(panning)) .visible-region {\n cursor: var(--panning-cursor, grabbing);\n}\n"],"mappings":""}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { ViewportPoint, ViewportRect } from './viewport.types.js';
|
|
2
|
-
export interface ViewportMinimapProjection {
|
|
3
|
-
readonly offsetX: number;
|
|
4
|
-
readonly offsetY: number;
|
|
5
|
-
readonly scale: number;
|
|
6
|
-
}
|
|
7
|
-
export declare function hasPositiveFiniteRect(rect: ViewportRect): boolean;
|
|
8
|
-
export declare function createViewportMinimapProjection(content: readonly ViewportRect[], visible: ViewportRect, size: {
|
|
9
|
-
readonly width: number;
|
|
10
|
-
readonly height: number;
|
|
11
|
-
}): ViewportMinimapProjection | undefined;
|
|
12
|
-
export declare function projectViewportMinimapRect(rect: ViewportRect, projection: ViewportMinimapProjection): ViewportRect;
|
|
13
|
-
export declare function unprojectViewportMinimapPoint(point: ViewportPoint, projection: ViewportMinimapProjection): ViewportPoint;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
//#region src/viewport/viewport-minimap.utils.ts
|
|
2
|
-
var e = .1;
|
|
3
|
-
function t(e) {
|
|
4
|
-
return Number.isFinite(e.x) && Number.isFinite(e.y) && Number.isFinite(e.width) && Number.isFinite(e.height) && e.width > 0 && e.height > 0;
|
|
5
|
-
}
|
|
6
|
-
function n(t, n, r) {
|
|
7
|
-
if (r.width <= 0 || r.height <= 0 || n.width <= 0 || n.height <= 0) return;
|
|
8
|
-
let i = a([n, ...t]);
|
|
9
|
-
if (!i) return;
|
|
10
|
-
let o = Math.max(i.width * e, 2 ** -52), s = Math.max(i.height * e, 2 ** -52), c = {
|
|
11
|
-
x: i.x - o,
|
|
12
|
-
y: i.y - s,
|
|
13
|
-
width: i.width + o * 2,
|
|
14
|
-
height: i.height + s * 2
|
|
15
|
-
}, l = Math.min(r.width / c.width, r.height / c.height);
|
|
16
|
-
if (!(!Number.isFinite(l) || l <= 0)) return {
|
|
17
|
-
offsetX: (r.width - c.width * l) / 2 - c.x * l,
|
|
18
|
-
offsetY: (r.height - c.height * l) / 2 - c.y * l,
|
|
19
|
-
scale: l
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
function r(e, t) {
|
|
23
|
-
return {
|
|
24
|
-
x: e.x * t.scale + t.offsetX,
|
|
25
|
-
y: e.y * t.scale + t.offsetY,
|
|
26
|
-
width: e.width * t.scale,
|
|
27
|
-
height: e.height * t.scale
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
function i(e, t) {
|
|
31
|
-
return {
|
|
32
|
-
x: (e.x - t.offsetX) / t.scale,
|
|
33
|
-
y: (e.y - t.offsetY) / t.scale
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function a(e) {
|
|
37
|
-
let n = Infinity, r = Infinity, i = -Infinity, a = -Infinity;
|
|
38
|
-
for (let o of e) t(o) && (n = Math.min(n, o.x), r = Math.min(r, o.y), i = Math.max(i, o.x + o.width), a = Math.max(a, o.y + o.height));
|
|
39
|
-
if (!(!Number.isFinite(n) || !Number.isFinite(r) || i <= n || a <= r)) return {
|
|
40
|
-
x: n,
|
|
41
|
-
y: r,
|
|
42
|
-
width: i - n,
|
|
43
|
-
height: a - r
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
//#endregion
|
|
47
|
-
export { n as createViewportMinimapProjection, t as hasPositiveFiniteRect, r as projectViewportMinimapRect, i as unprojectViewportMinimapPoint };
|
|
48
|
-
|
|
49
|
-
//# sourceMappingURL=viewport-minimap.utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewport-minimap.utils.js","names":[],"sources":["../../src/viewport/viewport-minimap.utils.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ViewportPoint, ViewportRect } from './viewport.types.js';\n\nconst PROJECTION_PADDING = 0.1;\n\nexport interface ViewportMinimapProjection {\n readonly offsetX: number;\n readonly offsetY: number;\n readonly scale: number;\n}\n\nexport function hasPositiveFiniteRect(rect: ViewportRect): boolean {\n return (\n Number.isFinite(rect.x) &&\n Number.isFinite(rect.y) &&\n Number.isFinite(rect.width) &&\n Number.isFinite(rect.height) &&\n rect.width > 0 &&\n rect.height > 0\n );\n}\n\nexport function createViewportMinimapProjection(\n content: readonly ViewportRect[],\n visible: ViewportRect,\n size: { readonly width: number; readonly height: number }\n): ViewportMinimapProjection | undefined {\n if (size.width <= 0 || size.height <= 0 || visible.width <= 0 || visible.height <= 0) return undefined;\n const extent = unionRects([visible, ...content]);\n if (!extent) return undefined;\n const paddingX = Math.max(extent.width * PROJECTION_PADDING, Number.EPSILON);\n const paddingY = Math.max(extent.height * PROJECTION_PADDING, Number.EPSILON);\n const coverage = {\n x: extent.x - paddingX,\n y: extent.y - paddingY,\n width: extent.width + paddingX * 2,\n height: extent.height + paddingY * 2\n };\n const scale = Math.min(size.width / coverage.width, size.height / coverage.height);\n if (!Number.isFinite(scale) || scale <= 0) return undefined;\n return {\n offsetX: (size.width - coverage.width * scale) / 2 - coverage.x * scale,\n offsetY: (size.height - coverage.height * scale) / 2 - coverage.y * scale,\n scale\n };\n}\n\nexport function projectViewportMinimapRect(rect: ViewportRect, projection: ViewportMinimapProjection): ViewportRect {\n return {\n x: rect.x * projection.scale + projection.offsetX,\n y: rect.y * projection.scale + projection.offsetY,\n width: rect.width * projection.scale,\n height: rect.height * projection.scale\n };\n}\n\nexport function unprojectViewportMinimapPoint(\n point: ViewportPoint,\n projection: ViewportMinimapProjection\n): ViewportPoint {\n return {\n x: (point.x - projection.offsetX) / projection.scale,\n y: (point.y - projection.offsetY) / projection.scale\n };\n}\n\nfunction unionRects(rects: readonly ViewportRect[]): ViewportRect | undefined {\n let left = Number.POSITIVE_INFINITY;\n let top = Number.POSITIVE_INFINITY;\n let right = Number.NEGATIVE_INFINITY;\n let bottom = Number.NEGATIVE_INFINITY;\n for (const rect of rects) {\n if (!hasPositiveFiniteRect(rect)) continue;\n left = Math.min(left, rect.x);\n top = Math.min(top, rect.y);\n right = Math.max(right, rect.x + rect.width);\n bottom = Math.max(bottom, rect.y + rect.height);\n }\n if (!Number.isFinite(left) || !Number.isFinite(top) || right <= left || bottom <= top) return undefined;\n return { x: left, y: top, width: right - left, height: bottom - top };\n}\n"],"mappings":";AAKA,IAAM,IAAqB;AAQ3B,SAAgB,EAAsB,GAA6B;CACjE,OACE,OAAO,SAAS,EAAK,CAAC,KACtB,OAAO,SAAS,EAAK,CAAC,KACtB,OAAO,SAAS,EAAK,KAAK,KAC1B,OAAO,SAAS,EAAK,MAAM,KAC3B,EAAK,QAAQ,KACb,EAAK,SAAS;AAElB;AAEA,SAAgB,EACd,GACA,GACA,GACuC;CACvC,IAAI,EAAK,SAAS,KAAK,EAAK,UAAU,KAAK,EAAQ,SAAS,KAAK,EAAQ,UAAU,GAAG;CACtF,IAAM,IAAS,EAAW,CAAC,GAAS,GAAG,CAAO,CAAC;CAC/C,IAAI,CAAC,GAAQ;CACb,IAAM,IAAW,KAAK,IAAI,EAAO,QAAQ,WAAkC,GACrE,IAAW,KAAK,IAAI,EAAO,SAAS,WAAkC,GACtE,IAAW;EACf,GAAG,EAAO,IAAI;EACd,GAAG,EAAO,IAAI;EACd,OAAO,EAAO,QAAQ,IAAW;EACjC,QAAQ,EAAO,SAAS,IAAW;CACrC,GACM,IAAQ,KAAK,IAAI,EAAK,QAAQ,EAAS,OAAO,EAAK,SAAS,EAAS,MAAM;CAC7E,OAAC,OAAO,SAAS,CAAK,KAAK,KAAS,IACxC,OAAO;EACL,UAAU,EAAK,QAAQ,EAAS,QAAQ,KAAS,IAAI,EAAS,IAAI;EAClE,UAAU,EAAK,SAAS,EAAS,SAAS,KAAS,IAAI,EAAS,IAAI;EACpE;CACF;AACF;AAEA,SAAgB,EAA2B,GAAoB,GAAqD;CAClH,OAAO;EACL,GAAG,EAAK,IAAI,EAAW,QAAQ,EAAW;EAC1C,GAAG,EAAK,IAAI,EAAW,QAAQ,EAAW;EAC1C,OAAO,EAAK,QAAQ,EAAW;EAC/B,QAAQ,EAAK,SAAS,EAAW;CACnC;AACF;AAEA,SAAgB,EACd,GACA,GACe;CACf,OAAO;EACL,IAAI,EAAM,IAAI,EAAW,WAAW,EAAW;EAC/C,IAAI,EAAM,IAAI,EAAW,WAAW,EAAW;CACjD;AACF;AAEA,SAAS,EAAW,GAA0D;CAC5E,IAAI,IAAO,UACP,IAAM,UACN,IAAQ,WACR,IAAS;CACb,KAAK,IAAM,KAAQ,GACZ,EAAsB,CAAI,MAC/B,IAAO,KAAK,IAAI,GAAM,EAAK,CAAC,GAC5B,IAAM,KAAK,IAAI,GAAK,EAAK,CAAC,GAC1B,IAAQ,KAAK,IAAI,GAAO,EAAK,IAAI,EAAK,KAAK,GAC3C,IAAS,KAAK,IAAI,GAAQ,EAAK,IAAI,EAAK,MAAM;CAE5C,OAAC,OAAO,SAAS,CAAI,KAAK,CAAC,OAAO,SAAS,CAAG,KAAK,KAAS,KAAQ,KAAU,IAClF,OAAO;EAAE,GAAG;EAAM,GAAG;EAAK,OAAO,IAAQ;EAAM,QAAQ,IAAS;CAAI;AACtE"}
|
|
@@ -1,309 +0,0 @@
|
|
|
1
|
-
import { GestureController as e } from "../internal/controllers/gesture.controller.js";
|
|
2
|
-
import { isImmediateRootActiveElement as t } from "../internal/utils/focus.js";
|
|
3
|
-
import { attachInternals as n } from "../internal/utils/a11y.js";
|
|
4
|
-
import { hostAttr as r } from "../internal/decorators/host-attr.js";
|
|
5
|
-
import { useStyles as i } from "../internal/styles/index.js";
|
|
6
|
-
import a from "../_virtual/_@oxc-project_runtime@0.147.0/helpers/esm/decorate.js";
|
|
7
|
-
import { anchoredTransform as o } from "./viewport-projection.utils.js";
|
|
8
|
-
import { Viewport as s } from "./viewport2.js";
|
|
9
|
-
import c from "./viewport-minimap.js";
|
|
10
|
-
import { createViewportMinimapProjection as l, projectViewportMinimapRect as u, unprojectViewportMinimapPoint as d } from "./viewport-minimap.utils.js";
|
|
11
|
-
import { LitElement as f, html as p, nothing as m, svg as h } from "lit";
|
|
12
|
-
import { styleMap as g } from "lit/directives/style-map.js";
|
|
13
|
-
//#region src/viewport/viewport-minimap.ts
|
|
14
|
-
var _ = 3, v = class extends f {
|
|
15
|
-
static {
|
|
16
|
-
this.styles = i([c]);
|
|
17
|
-
}
|
|
18
|
-
static {
|
|
19
|
-
this.metadata = {
|
|
20
|
-
tag: "nve-viewport-minimap",
|
|
21
|
-
version: "2.15.1"
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
#e;
|
|
25
|
-
#t;
|
|
26
|
-
#n;
|
|
27
|
-
#r;
|
|
28
|
-
#i;
|
|
29
|
-
#a;
|
|
30
|
-
#o;
|
|
31
|
-
#s;
|
|
32
|
-
#c;
|
|
33
|
-
#l;
|
|
34
|
-
#u;
|
|
35
|
-
#d;
|
|
36
|
-
#f;
|
|
37
|
-
get #p() {
|
|
38
|
-
return Array.from(this.children).filter((e) => e.slot === "preview");
|
|
39
|
-
}
|
|
40
|
-
get #m() {
|
|
41
|
-
let e = this.#r;
|
|
42
|
-
return e ? Array.from(e.children).filter((e) => !e.slot) : [];
|
|
43
|
-
}
|
|
44
|
-
constructor() {
|
|
45
|
-
super(), this.slot = "overlay", this.accessibilityHidden = "true", this.#t = /* @__PURE__ */ new WeakMap(), this.#n = 0, this.#s = [], this.#c = [], this.#f = !1, this.#E = () => {
|
|
46
|
-
this.#D(), this.#j({ measureRoots: !0 });
|
|
47
|
-
}, this.#O = () => {
|
|
48
|
-
let e = this.#r?.getTransform(), t = this.#u;
|
|
49
|
-
t?.active && e && (t.transformStart = e, t.transformStartDisplacementX = t.lastTotalDisplacementX, t.transformStartDisplacementY = t.lastTotalDisplacementY), this.#j({ measureRoots: !1 });
|
|
50
|
-
}, this.#k = () => {
|
|
51
|
-
this.#A(), this.requestUpdate();
|
|
52
|
-
}, this.#I = (e) => {
|
|
53
|
-
let t = e.detail;
|
|
54
|
-
t.kind === "pointerdown" ? this.#R(t) : t.kind === "pointerend" ? this.#U(t) : this.#L(t);
|
|
55
|
-
}, this.#z = (e) => {
|
|
56
|
-
let t = e.detail;
|
|
57
|
-
t.kind === "drag" && this.#B(t);
|
|
58
|
-
}, this.#e = new e(this, {
|
|
59
|
-
claimPriority: "self-first",
|
|
60
|
-
suppressNativeDrag: !0,
|
|
61
|
-
touchAction: () => this.#u || this.#r?.pannable ? "none" : void 0
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
connectedCallback() {
|
|
65
|
-
super.connectedCallback(), n(this);
|
|
66
|
-
let e = this.parentElement;
|
|
67
|
-
e instanceof s && (this.#r = e, this.#r.addEventListener("viewportchange", this.#O), this.#r.addEventListener("capabilitieschange", this.#k), this.#h(e), this.requestUpdate());
|
|
68
|
-
}
|
|
69
|
-
#h(e) {
|
|
70
|
-
this.#e.target = this, this.addEventListener("nve-gesture-input", this.#I), this.addEventListener("nve-gesture", this.#z), this.#T(), e.updateComplete.then(() => {
|
|
71
|
-
this.#r === e && (this.#i = e.shadowRoot?.querySelector("slot:not([name])") ?? void 0, this.#i?.addEventListener("slotchange", this.#E), this.#D(), this.#j({ measureRoots: !0 }));
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
disconnectedCallback() {
|
|
75
|
-
this.#K(), this.#r?.removeEventListener("viewportchange", this.#O), this.#r?.removeEventListener("capabilitieschange", this.#k), this.#g(), this.#_(), this.#v(), super.disconnectedCallback();
|
|
76
|
-
}
|
|
77
|
-
#g() {
|
|
78
|
-
this.removeEventListener("nve-gesture-input", this.#I), this.removeEventListener("nve-gesture", this.#z), this.#i?.removeEventListener("slotchange", this.#E);
|
|
79
|
-
}
|
|
80
|
-
#_() {
|
|
81
|
-
this.#a?.disconnect(), this.#o?.disconnect(), this.#d !== void 0 && cancelAnimationFrame(this.#d);
|
|
82
|
-
}
|
|
83
|
-
#v() {
|
|
84
|
-
this.#d = void 0, this.#f = !1, this.#e.target = void 0, this.#u = void 0, this.#r = void 0, this.#i = void 0, this.#l = void 0, this.#s = [], this.#c = [], this._internals.states.delete("pan-eligible"), this._internals.states.delete("panning");
|
|
85
|
-
}
|
|
86
|
-
refresh() {
|
|
87
|
-
this.#j({ measureRoots: !0 });
|
|
88
|
-
}
|
|
89
|
-
render() {
|
|
90
|
-
let e = this.#l, t = this.#r, n = t && e ? u(t.getVisibleRect(), e) : void 0;
|
|
91
|
-
return p`<div internal-host class="surface">${this.#y()} ${this.#b(e)} ${this.#x(e, n)}</div>`;
|
|
92
|
-
}
|
|
93
|
-
#y() {
|
|
94
|
-
return p`<svg class="background-layer" aria-hidden="true" focusable="false"><rect class="background" data-minimap-background width="100%" height="100%"></rect></svg>`;
|
|
95
|
-
}
|
|
96
|
-
#b(e) {
|
|
97
|
-
return p`<div class="preview" style="${g({ transform: e ? `translate(${e.offsetX}px, ${e.offsetY}px) scale(${e.scale})` : "none" })}"><slot name="preview" @slotchange="${this.#E}"></slot></div>`;
|
|
98
|
-
}
|
|
99
|
-
#x(e, t) {
|
|
100
|
-
return p`<svg class="foreground-layer" aria-hidden="true" focusable="false" viewBox="0 0 ${this.clientWidth} ${this.clientHeight}" preserveAspectRatio="none">${this.#S(e)} ${this.#C(t)}</svg>`;
|
|
101
|
-
}
|
|
102
|
-
#S(e) {
|
|
103
|
-
return !e || this.#p.length ? m : this.#c.map((t) => this.#w(t, e));
|
|
104
|
-
}
|
|
105
|
-
#C(e) {
|
|
106
|
-
return e ? h`<rect class="visible-region" data-visible-region x="${e.x}" y="${e.y}" width="${e.width}" height="${e.height}" rx="2"></rect>` : m;
|
|
107
|
-
}
|
|
108
|
-
#w(e, t) {
|
|
109
|
-
let n = u(e, t);
|
|
110
|
-
return h`<rect class="item" data-item-key="${e.id}" x="${n.x}" y="${n.y}" width="${n.width}" height="${n.height}" rx="2"></rect>`;
|
|
111
|
-
}
|
|
112
|
-
#T() {
|
|
113
|
-
let e = this.#r;
|
|
114
|
-
!e || typeof ResizeObserver > "u" || (this.#a = new ResizeObserver((t) => {
|
|
115
|
-
this.#j({ measureRoots: t.some((t) => t.target === e || t.target === this) });
|
|
116
|
-
}), this.#a.observe(e), this.#a.observe(this), this.#o = new ResizeObserver(() => this.#j({ measureRoots: !0 })));
|
|
117
|
-
}
|
|
118
|
-
#E;
|
|
119
|
-
#D() {
|
|
120
|
-
let e = this.#r;
|
|
121
|
-
if (this.#o?.disconnect(), !e) return;
|
|
122
|
-
let t = this.#p, n = t.length ? t : this.#m;
|
|
123
|
-
for (let e of n) this.#o?.observe(e);
|
|
124
|
-
}
|
|
125
|
-
#O;
|
|
126
|
-
#k;
|
|
127
|
-
#A() {
|
|
128
|
-
let e = !!(this.#r?.pannable && this.#l);
|
|
129
|
-
this._internals.states.has("pan-eligible") !== e && (e ? this._internals.states.add("pan-eligible") : this._internals.states.delete("pan-eligible"));
|
|
130
|
-
}
|
|
131
|
-
#j({ measureRoots: e }) {
|
|
132
|
-
this.#f ||= e, this.#d === void 0 && (this.#d = requestAnimationFrame(() => {
|
|
133
|
-
this.#d = void 0;
|
|
134
|
-
let e = this.#f;
|
|
135
|
-
this.#f = !1, this.#M({ measureRoots: e });
|
|
136
|
-
}));
|
|
137
|
-
}
|
|
138
|
-
#M({ measureRoots: e }) {
|
|
139
|
-
let t = this.#r;
|
|
140
|
-
if (t) {
|
|
141
|
-
if (e) {
|
|
142
|
-
let e = this.#p;
|
|
143
|
-
e.length ? (this.#c = [], this.#s = this.#N(e)) : (this.#c = this.#P(t, this.#m), this.#s = this.#c);
|
|
144
|
-
}
|
|
145
|
-
this.#l = l(this.#s, t.getVisibleRect(), {
|
|
146
|
-
height: this.clientHeight,
|
|
147
|
-
width: this.clientWidth
|
|
148
|
-
}), this.#A(), this.requestUpdate();
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
#N(e) {
|
|
152
|
-
let t = this.renderRoot.querySelector(".preview");
|
|
153
|
-
if (!t) return [];
|
|
154
|
-
let n = t.getBoundingClientRect(), r = getComputedStyle(t).transform, i = new DOMMatrixReadOnly(r === "none" ? void 0 : r), a = [];
|
|
155
|
-
for (let t of e) {
|
|
156
|
-
let e = t.getBoundingClientRect();
|
|
157
|
-
e.width <= 0 || e.height <= 0 || a.push({
|
|
158
|
-
x: (e.left - n.left) / i.m11,
|
|
159
|
-
y: (e.top - n.top) / i.m11,
|
|
160
|
-
width: e.width / i.m11,
|
|
161
|
-
height: e.height / i.m11
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
return a;
|
|
165
|
-
}
|
|
166
|
-
#P(e, t) {
|
|
167
|
-
let n = e.getBoundingClientRect(), r = e.getTransform(), i = [];
|
|
168
|
-
for (let e of t) {
|
|
169
|
-
let t = e.getBoundingClientRect();
|
|
170
|
-
t.width <= 0 || t.height <= 0 || i.push({
|
|
171
|
-
id: this.#F(e),
|
|
172
|
-
x: r.x + (t.left - n.left) / r.scale,
|
|
173
|
-
y: r.y + (t.top - n.top) / r.scale,
|
|
174
|
-
width: t.width / r.scale,
|
|
175
|
-
height: t.height / r.scale
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
return i;
|
|
179
|
-
}
|
|
180
|
-
#F(e) {
|
|
181
|
-
let t = e.id.trim();
|
|
182
|
-
if (t) return t;
|
|
183
|
-
let n = this.#t.get(e);
|
|
184
|
-
if (n) return n;
|
|
185
|
-
let r = `root-${this.#n}`;
|
|
186
|
-
return this.#n += 1, this.#t.set(e, r), r;
|
|
187
|
-
}
|
|
188
|
-
#I;
|
|
189
|
-
#L(e) {
|
|
190
|
-
let n = this.#r;
|
|
191
|
-
if (e.deltaY === 0 || !n || !n.zoomable || !t(n) || !e.claim()) return;
|
|
192
|
-
let r = n.getTransform(), i = n.getVisibleRect(), a = {
|
|
193
|
-
x: i.x + i.width / 2,
|
|
194
|
-
y: i.y + i.height / 2
|
|
195
|
-
}, s = this.#e.getWheelZoomFactor(e), c = {
|
|
196
|
-
x: n.clientWidth / 2,
|
|
197
|
-
y: n.clientHeight / 2
|
|
198
|
-
};
|
|
199
|
-
n.requestZoom({
|
|
200
|
-
anchor: a,
|
|
201
|
-
event: e.event,
|
|
202
|
-
factor: s,
|
|
203
|
-
next: o(a, c, Math.min(n.maxScale, Math.max(n.minScale, r.scale * s))),
|
|
204
|
-
source: "minimap"
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
#R(e) {
|
|
208
|
-
let t = e.event, n = this.#r, r = this.#l;
|
|
209
|
-
if (!n || t.button !== 0 || !t.isPrimary || !n.pannable && !n.zoomable || (n.focus({ preventScroll: !0 }), !r || !n.pannable || !e.claim({ kind: "drag" }))) return;
|
|
210
|
-
let i = n.getTransform(), a = t.composedPath().some((e) => e instanceof Element && e.hasAttribute("data-visible-region"));
|
|
211
|
-
this.#u = {
|
|
212
|
-
active: !1,
|
|
213
|
-
activating: !1,
|
|
214
|
-
exceededThreshold: !1,
|
|
215
|
-
indicator: a,
|
|
216
|
-
lastTotalDisplacementX: 0,
|
|
217
|
-
lastTotalDisplacementY: 0,
|
|
218
|
-
pointerId: t.pointerId,
|
|
219
|
-
dragProjection: r,
|
|
220
|
-
transformStart: i,
|
|
221
|
-
transformStartDisplacementX: 0,
|
|
222
|
-
transformStartDisplacementY: 0
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
|
-
#z;
|
|
226
|
-
#B(e) {
|
|
227
|
-
let t = this.#u;
|
|
228
|
-
if (!t || t.pointerId !== e.event.pointerId || (t.lastTotalDisplacementX = e.totalDisplacementX, t.lastTotalDisplacementY = e.totalDisplacementY, e.totalDisplacementX ** 2 + e.totalDisplacementY ** 2 < _ ** 2) || (t.exceededThreshold = !0, !t.indicator)) return;
|
|
229
|
-
let n = this.#H(e, t);
|
|
230
|
-
t.active ? t.navigation?.update(n) : this.#V(t, n);
|
|
231
|
-
}
|
|
232
|
-
#V(e, t) {
|
|
233
|
-
e.activating = !0;
|
|
234
|
-
let n = this.#r?.startPan({
|
|
235
|
-
...t,
|
|
236
|
-
source: "minimap"
|
|
237
|
-
});
|
|
238
|
-
if (e.activating = !1, n) {
|
|
239
|
-
if (this.#u !== e) {
|
|
240
|
-
e.pendingEnd && n.end(e.pendingEnd);
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
e.navigation = n, e.active = !0, this._internals.states.add("panning");
|
|
244
|
-
}
|
|
245
|
-
}
|
|
246
|
-
#H(e, t) {
|
|
247
|
-
let n = e.totalDisplacementX - t.transformStartDisplacementX, r = e.totalDisplacementY - t.transformStartDisplacementY;
|
|
248
|
-
return {
|
|
249
|
-
clientX: e.clientX,
|
|
250
|
-
clientY: e.clientY,
|
|
251
|
-
event: e.event,
|
|
252
|
-
next: {
|
|
253
|
-
scale: t.transformStart.scale,
|
|
254
|
-
x: t.transformStart.x + n / t.dragProjection.scale,
|
|
255
|
-
y: t.transformStart.y + r / t.dragProjection.scale
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
}
|
|
259
|
-
#U(e) {
|
|
260
|
-
let t = this.#u;
|
|
261
|
-
!t || t.pointerId !== e.event.pointerId || (t.lastTotalDisplacementX = e.totalDisplacementX, t.lastTotalDisplacementY = e.totalDisplacementY, t.active ? t.navigation?.end({
|
|
262
|
-
event: e.event,
|
|
263
|
-
interrupted: e.interrupted,
|
|
264
|
-
reason: e.reason
|
|
265
|
-
}) : t.activating ? t.pendingEnd = {
|
|
266
|
-
event: e.event,
|
|
267
|
-
interrupted: e.interrupted,
|
|
268
|
-
reason: e.reason
|
|
269
|
-
} : e.reason === "up" && !t.exceededThreshold && this.#W(e.event, t), this.#G(t));
|
|
270
|
-
}
|
|
271
|
-
#W(e, t) {
|
|
272
|
-
let n = this.#r;
|
|
273
|
-
if (!n) return;
|
|
274
|
-
let r = this.getBoundingClientRect(), i = d({
|
|
275
|
-
x: e.clientX - r.left,
|
|
276
|
-
y: e.clientY - r.top
|
|
277
|
-
}, t.dragProjection), a = n.getTransform(), o = n.getVisibleRect();
|
|
278
|
-
n.requestPan({
|
|
279
|
-
clientX: e.clientX,
|
|
280
|
-
clientY: e.clientY,
|
|
281
|
-
event: e,
|
|
282
|
-
next: {
|
|
283
|
-
scale: a.scale,
|
|
284
|
-
x: i.x - o.width / 2,
|
|
285
|
-
y: i.y - o.height / 2
|
|
286
|
-
},
|
|
287
|
-
source: "minimap"
|
|
288
|
-
});
|
|
289
|
-
}
|
|
290
|
-
#G(e) {
|
|
291
|
-
this.#u === e && (this.#u = void 0, this._internals.states.delete("panning"), this.requestUpdate());
|
|
292
|
-
}
|
|
293
|
-
#K() {
|
|
294
|
-
let e = this.#u;
|
|
295
|
-
if (!e) return;
|
|
296
|
-
this.#G(e);
|
|
297
|
-
let t = {
|
|
298
|
-
event: new Event("disconnect"),
|
|
299
|
-
interrupted: !0,
|
|
300
|
-
reason: "cancel"
|
|
301
|
-
};
|
|
302
|
-
e.active ? e.navigation?.end(t) : e.activating && (e.pendingEnd = t);
|
|
303
|
-
}
|
|
304
|
-
};
|
|
305
|
-
a([r()], v.prototype, "slot", void 0), a([r({ attribute: "aria-hidden" })], v.prototype, "accessibilityHidden", void 0);
|
|
306
|
-
//#endregion
|
|
307
|
-
export { v as ViewportMinimap };
|
|
308
|
-
|
|
309
|
-
//# sourceMappingURL=viewport-minimap2.js.map
|