@nvidia-elements/core 2.10.0 → 2.11.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.
- package/CHANGELOG.md +10 -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/bundles/index.d.ts +176 -43
- 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 +101 -9
- package/dist/custom-elements-vue.d.ts +99 -9
- package/dist/custom-elements.json +859 -146
- package/dist/data.html.json +51 -3
- 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/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-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/internal/types/index.d.ts +6 -2
- package/dist/internal/types/index.js.map +1 -1
- package/dist/internal/utils/audit.js +1 -1
- package/dist/internal/utils/audit.js.map +1 -1
- package/dist/logo/logo2.js +1 -1
- package/dist/menu/define.d.ts +2 -1
- package/dist/menu/define.js +3 -2
- package/dist/menu/define.js.map +1 -1
- package/dist/menu/index.d.ts +1 -0
- package/dist/menu/index.js +3 -2
- package/dist/menu/menu-group.d.ts +50 -0
- package/dist/menu/menu-group.js +6 -0
- package/dist/menu/menu-group.js.map +1 -0
- package/dist/menu/menu-group2.js +53 -0
- package/dist/menu/menu-group2.js.map +1 -0
- package/dist/menu/menu-item.d.ts +1 -0
- package/dist/menu/menu-item.js +1 -1
- package/dist/menu/menu-item.js.map +1 -1
- package/dist/menu/menu-item2.js +2 -2
- package/dist/menu/menu-item2.js.map +1 -1
- package/dist/menu/menu.d.ts +6 -1
- package/dist/menu/menu.examples.js.map +1 -1
- package/dist/menu/menu.examples.json +53 -13
- package/dist/menu/menu.global.js +1 -1
- package/dist/menu/menu.global.js.map +1 -1
- package/dist/menu/menu2.js +16 -8
- package/dist/menu/menu2.js.map +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/steps.d.ts +3 -3
- package/dist/steps/steps2.js +2 -2
- package/dist/steps/steps2.js.map +1 -1
- 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-node2.js +1 -1
- package/dist/tree/tree2.js +1 -1
- package/dist/viewport/define.d.ts +2 -1
- package/dist/viewport/define.js +2 -1
- package/dist/viewport/define.js.map +1 -1
- package/dist/viewport/index.d.ts +2 -1
- package/dist/viewport/index.js +2 -1
- package/dist/viewport/viewport-gesture-navigation.controller.d.ts +8 -10
- package/dist/viewport/viewport-gesture-navigation.controller.js +73 -66
- package/dist/viewport/viewport-gesture-navigation.controller.js.map +1 -1
- package/dist/viewport/viewport-gridlines2.js +3 -3
- package/dist/viewport/viewport-gridlines2.js.map +1 -1
- package/dist/viewport/viewport-minimap.d.ts +36 -0
- package/dist/viewport/viewport-minimap.js +6 -0
- package/dist/viewport/viewport-minimap.js.map +1 -0
- package/dist/viewport/viewport-minimap.utils.d.ts +13 -0
- package/dist/viewport/viewport-minimap.utils.js +49 -0
- package/dist/viewport/viewport-minimap.utils.js.map +1 -0
- package/dist/viewport/viewport-minimap2.js +309 -0
- package/dist/viewport/viewport-minimap2.js.map +1 -0
- package/dist/viewport/viewport-navigation.controller.d.ts +7 -13
- package/dist/viewport/viewport-navigation.controller.js +14 -20
- package/dist/viewport/viewport-navigation.controller.js.map +1 -1
- package/dist/viewport/viewport-navigation.types.d.ts +0 -8
- package/dist/viewport/viewport.d.ts +30 -5
- package/dist/viewport/viewport.examples.js.map +1 -1
- package/dist/viewport/viewport.examples.json +13 -4
- package/dist/viewport/viewport.js +1 -1
- package/dist/viewport/viewport.js.map +1 -1
- package/dist/viewport/viewport.types.d.ts +50 -23
- package/dist/viewport/viewport2.js +173 -118
- package/dist/viewport/viewport2.js.map +1 -1
- package/dist/week/week2.js +1 -1
- package/package.json +1 -1
package/dist/steps/steps2.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"steps2.js","names":[],"sources":["../../src/steps/steps.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\nimport { when } from 'lit/directives/when.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport type { KeynavListConfig
|
|
1
|
+
{"version":3,"file":"steps2.js","names":[],"sources":["../../src/steps/steps.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { PropertyValues } from 'lit';\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\nimport { when } from 'lit/directives/when.js';\nimport { queryAssignedElements } from 'lit/decorators/query-assigned-elements.js';\nimport { ButtonFormControlMixin } from '@nvidia-elements/forms/mixins';\nimport type { KeynavListConfig } from '@nvidia-elements/core/internal';\nimport {\n stateSelected,\n useStyles,\n keyNavigationList,\n attachInternals,\n audit,\n scopedRegistry\n} from '@nvidia-elements/core/internal';\nimport stepsItemStyleSheet from './steps-item.css?inline';\nimport stepsStyleSheet from './steps.css?inline';\nimport { IconButton } from '@nvidia-elements/core/icon-button';\nimport { ProgressRing } from '@nvidia-elements/core/progress-ring';\n\n/**\n * @element nve-steps-item\n * @description Represents an individual step within a multi-step workflow, displaying its status and enabling navigation within the parent steps component.\n * @documentation https://nvidia.github.io/elements/docs/elements/steps/\n * @since 0.30.0\n * @entrypoint \\@nvidia-elements/core/steps\n * @slot - default slot for step text\n * @slot status-icon - custom slotted step icon\n * @cssprop --font-size\n * @cssprop --border-top\n * @cssprop --width\n * @cssprop --font-weight\n * @cssprop --border-radius\n * @cssprop --color\n * @cssprop --text-transform\n * @csspart icon-button - The icon button element\n * @csspart progress-ring - The progress ring element\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n */\n@audit()\n@scopedRegistry()\n@stateSelected<StepsItem>()\nexport class StepsItem extends ButtonFormControlMixin(LitElement) {\n /**\n * Determines which item the user selects, defaults to false.\n */\n @property({ type: Boolean, reflect: true }) selected = false;\n\n /**\n * Controls the step status. `accent` has no default status icon, `danger` displays an alert icon, `success` displays a check icon, and `pending` displays a progress indicator. Omit the property to display the step number.\n */\n @property({ type: String, reflect: true }) status?: 'accent' | 'danger' | 'success' | 'pending';\n\n /**\n * Determines whether the steps should display in condensed format with no text labels.\n */\n @property({ type: String, reflect: true }) container?: 'condensed';\n\n /** @private */\n @state() index: number = 0;\n\n static styles = useStyles([stepsItemStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-steps-item',\n version: '0.0.0',\n parents: ['nve-steps']\n };\n\n static elementDefinitions = {\n [IconButton.metadata.tag]: IconButton,\n [ProgressRing.metadata.tag]: ProgressRing\n };\n\n render() {\n return html`\n <div internal-host focus-within>\n <slot name=\"status-icon\">\n ${!this.status ? html`<nve-icon-button part=\"icon-button\" readonly id=\"number-icon\" .disabled=${this.disabled}>${this.index}</nve-icon-button>` : ''}\n ${this.status === 'success' ? html`<nve-icon-button part=\"icon-button\" readonly size=\"sm\" interaction=\"emphasis\" icon-name=\"check\"></nve-icon-button>` : ''}\n ${this.status === 'danger' ? html`<nve-icon-button part=\"icon-button\" readonly size=\"sm\" interaction=\"destructive\" icon-name=\"exclamation-circle\"></nve-icon-button>` : ''}\n ${this.status === 'pending' ? html`<nve-progress-ring part=\"progress-ring\" status=\"accent\" size=\"sm\"></nve-progress-ring>` : ''}\n </slot>\n ${when(this.container !== 'condensed', () => html`<slot></slot>`)}\n </div>\n `;\n }\n\n constructor() {\n super();\n this.type = 'button';\n }\n\n connectedCallback() {\n super.connectedCallback();\n this._internals.role = 'tab';\n }\n}\n\n/**\n * @element nve-steps\n * @description Steps enables a multi-step workflow allowing a user to complete a goal in a specific sequence.\n * @documentation https://nvidia.github.io/elements/docs/elements/steps/\n * @since 0.30.0\n * @entrypoint \\@nvidia-elements/core/steps\n * @slot - default slot for steps-item\n * @cssprop --gap\n * @aria https://www.w3.org/WAI/ARIA/apg/patterns/tabs/\n */\n@audit()\n@keyNavigationList<Steps>()\nexport class Steps extends LitElement {\n /**\n * Determines whether the steps should display in a vertical layout vs. defaulting to horizontal.\n */\n @property({ type: Boolean, reflect: true }) vertical = false;\n\n /**\n * Determines whether the steps should display in condensed format with no text labels.\n */\n @property({ type: String, reflect: true }) container?: 'condensed';\n\n /**\n * Determines whether the steps should handle selection behavior vs. defaults to off.\n */\n @property({ type: Boolean, attribute: 'behavior-select' }) behaviorSelect = false;\n\n static styles = useStyles([stepsStyleSheet]);\n\n static readonly metadata = {\n tag: 'nve-steps',\n version: '0.0.0',\n children: ['nve-steps-item']\n };\n\n /** @private */\n get keynavListConfig(): KeynavListConfig {\n return {\n items: this.steps,\n layout: this.vertical ? 'vertical' : 'horizontal'\n };\n }\n\n @queryAssignedElements({ selector: 'nve-steps-item' }) private steps!: StepsItem[];\n\n /** @private */\n declare _internals: ElementInternals;\n\n #selectTab(stepsItem: HTMLElement & { matches: Element['matches']; disabled?: boolean; selected?: boolean }) {\n if (!this.behaviorSelect || !stepsItem.matches('nve-steps-item') || stepsItem.disabled) {\n return;\n }\n\n this.steps.forEach(i => (i.selected = false));\n stepsItem.selected = true;\n }\n\n render() {\n return html`\n <div internal-host>\n <slot @slotchange=${this.#syncChildSteps}></slot>\n </div>\n `;\n }\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n this._internals.role = 'tablist';\n this.addEventListener('click', this.#onClick);\n }\n\n disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#onClick);\n }\n\n #onClick = (e: Event) => {\n this.#selectTab(e.target as HTMLElement & { matches: Element['matches']; disabled?: boolean; selected?: boolean });\n };\n\n updated(props: PropertyValues<this>) {\n super.updated(props);\n if (props.has('container') || props.has('vertical')) {\n this.#syncChildSteps();\n }\n }\n\n #syncChildSteps() {\n this._internals.ariaOrientation = this.vertical ? 'vertical' : 'horizontal';\n this.steps.forEach((item, i) => {\n item.index = i + 1;\n item.container = this.container;\n });\n }\n}\n"],"mappings":"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"}
|
package/dist/switch/switch2.js
CHANGED
package/dist/tabs/tabs-group2.js
CHANGED
package/dist/tabs/tabs2.js
CHANGED
|
@@ -20,7 +20,7 @@ var _ = class extends h(f) {
|
|
|
20
20
|
static {
|
|
21
21
|
this.metadata = {
|
|
22
22
|
tag: "nve-tabs-item",
|
|
23
|
-
version: "2.
|
|
23
|
+
version: "2.11.0",
|
|
24
24
|
parents: ["nve-tabs"]
|
|
25
25
|
};
|
|
26
26
|
}
|
|
@@ -53,7 +53,7 @@ var v = class extends f {
|
|
|
53
53
|
static {
|
|
54
54
|
this.metadata = {
|
|
55
55
|
tag: "nve-tabs",
|
|
56
|
-
version: "2.
|
|
56
|
+
version: "2.11.0",
|
|
57
57
|
children: ["nve-tabs-item"]
|
|
58
58
|
};
|
|
59
59
|
}
|
package/dist/tag/tag2.js
CHANGED
package/dist/time/time2.js
CHANGED
package/dist/toast/toast2.js
CHANGED
package/dist/toolbar/toolbar2.js
CHANGED
package/dist/tooltip/tooltip2.js
CHANGED
package/dist/tree/tree-node2.js
CHANGED
package/dist/tree/tree2.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { Viewport, ViewportGridlines } from '@nvidia-elements/core/viewport';
|
|
1
|
+
import { Viewport, ViewportGridlines, ViewportMinimap } from '@nvidia-elements/core/viewport';
|
|
2
2
|
declare global {
|
|
3
3
|
interface HTMLElementTagNameMap {
|
|
4
4
|
'nve-viewport': Viewport;
|
|
5
5
|
'nve-viewport-gridlines': ViewportGridlines;
|
|
6
|
+
'nve-viewport-minimap': ViewportMinimap;
|
|
6
7
|
}
|
|
7
8
|
}
|
package/dist/viewport/define.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { define as e } from "../internal/utils/dom.js";
|
|
2
2
|
import { Viewport as t } from "./viewport2.js";
|
|
3
3
|
import { ViewportGridlines as n } from "./viewport-gridlines2.js";
|
|
4
|
-
|
|
4
|
+
import { ViewportMinimap as r } from "./viewport-minimap2.js";
|
|
5
|
+
e(t), e(n), e(r);
|
|
5
6
|
//#endregion
|
|
6
7
|
|
|
7
8
|
//# sourceMappingURL=define.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"define.js","names":[],"sources":["../../src/viewport/define.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { define } from '@nvidia-elements/core/internal';\nimport { Viewport, ViewportGridlines } from '@nvidia-elements/core/viewport';\n\ndefine(Viewport);\ndefine(ViewportGridlines);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nve-viewport': Viewport;\n 'nve-viewport-gridlines': ViewportGridlines;\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"define.js","names":[],"sources":["../../src/viewport/define.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { define } from '@nvidia-elements/core/internal';\nimport { Viewport, ViewportGridlines, ViewportMinimap } from '@nvidia-elements/core/viewport';\n\ndefine(Viewport);\ndefine(ViewportGridlines);\ndefine(ViewportMinimap);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nve-viewport': Viewport;\n 'nve-viewport-gridlines': ViewportGridlines;\n 'nve-viewport-minimap': ViewportMinimap;\n }\n}\n"],"mappings":";;;;AAMA,EAAO,CAAQ,GACf,EAAO,CAAiB,GACxB,EAAO,CAAe"}
|
package/dist/viewport/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export * from './viewport.js';
|
|
2
2
|
export * from './viewport-gridlines.js';
|
|
3
|
-
export
|
|
3
|
+
export * from './viewport-minimap.js';
|
|
4
|
+
export type { ViewportAnimationOptions, ViewportDiscretePanDetail, ViewportPanBehavior, ViewportPanDetail, ViewportPanEndDetail, ViewportPanEndReason, ViewportNavigationSource, ViewportPanProposal, ViewportPanUpdateProposal, ViewportPanEndRequest, ViewportPanSession, ViewportZoomProposal, ViewportZoomRequestOptions, ViewportPoint, ViewportPointerPanDetail, ViewportRect, ViewportRevealOptions, ViewportTransform, ViewportWheelPanDetail, ViewportZoomDetail } from './viewport.types.js';
|
package/dist/viewport/index.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { Viewport as e } from "./viewport2.js";
|
|
2
2
|
import { ViewportGridlines as t } from "./viewport-gridlines2.js";
|
|
3
|
-
|
|
3
|
+
import { ViewportMinimap as n } from "./viewport-minimap2.js";
|
|
4
|
+
export { e as Viewport, t as ViewportGridlines, n as ViewportMinimap };
|
|
@@ -1,29 +1,27 @@
|
|
|
1
1
|
import type { ReactiveController, ReactiveControllerHost } from 'lit';
|
|
2
|
-
import type { ViewportPanBehavior, ViewportPoint, ViewportTransform } from './viewport.types.js';
|
|
3
|
-
import type { ViewportNavigationEventDelegate } from './viewport-navigation.types.js';
|
|
2
|
+
import type { ViewportPanBehavior, ViewportPanSession, ViewportPanProposal, ViewportPoint, ViewportTransform, ViewportZoomProposal } from './viewport.types.js';
|
|
4
3
|
type ViewportGestureNavigationHost = HTMLElement & ReactiveControllerHost & {
|
|
5
4
|
readonly _internals: ElementInternals;
|
|
6
5
|
readonly behaviorPan: ViewportPanBehavior;
|
|
7
|
-
readonly
|
|
6
|
+
readonly pannable: boolean;
|
|
7
|
+
readonly zoomable: boolean;
|
|
8
8
|
readonly dragThreshold: number;
|
|
9
|
+
requestPan(proposal: ViewportPanProposal): boolean;
|
|
10
|
+
requestZoom(proposal: ViewportZoomProposal): boolean;
|
|
11
|
+
startPan(proposal: ViewportPanProposal): ViewportPanSession | undefined;
|
|
9
12
|
};
|
|
10
|
-
|
|
11
|
-
readonly commitTransform: (next: ViewportTransform) => boolean;
|
|
12
|
-
readonly cancelAnimation: () => void;
|
|
13
|
+
interface ViewportGestureNavigationDelegate {
|
|
13
14
|
readonly clampScale: (value: number) => number;
|
|
14
15
|
readonly clientToViewport: (clientX: number, clientY: number) => ViewportPoint;
|
|
15
|
-
readonly consumeAutoFit: () => void;
|
|
16
|
-
readonly events: ViewportNavigationEventDelegate;
|
|
17
16
|
readonly getTransform: () => ViewportTransform;
|
|
17
|
+
readonly requestAdmittedPinchZoom: (proposal: ViewportZoomProposal) => boolean;
|
|
18
18
|
}
|
|
19
|
-
/** Coordinates the viewport's opt-in pointer, touch, pinch, and wheel navigation behavior. */
|
|
20
19
|
export declare class ViewportGestureNavigationController implements ReactiveController {
|
|
21
20
|
#private;
|
|
22
21
|
constructor(host: ViewportGestureNavigationHost, delegate: ViewportGestureNavigationDelegate);
|
|
23
22
|
hostConnected(): void;
|
|
24
23
|
hostDisconnected(): void;
|
|
25
24
|
hostUpdated(): void;
|
|
26
|
-
/** Rebase in-progress pointer math synchronously after an independent transform change. */
|
|
27
25
|
rebasePointerSessions(): void;
|
|
28
26
|
}
|
|
29
27
|
export {};
|
|
@@ -39,11 +39,11 @@ var a = class {
|
|
|
39
39
|
this.#U();
|
|
40
40
|
}
|
|
41
41
|
#d() {
|
|
42
|
-
let e = this.#e.behaviorPan, t = this.#e.
|
|
43
|
-
this.#r.enabled = this.#o && e === "space", this.#n.target = this.#o && (
|
|
42
|
+
let e = this.#e.behaviorPan, t = this.#e.pannable || this.#e.zoomable, n = this.#i.size > 0;
|
|
43
|
+
this.#r.enabled = this.#o && e === "space", this.#n.target = this.#o && (t || n) ? this.#e : void 0, this.#Z(this.#o && e === "space"), this.#Q(this.#o && (this.#e.pannable || this.#a.size > 0)), this.#f();
|
|
44
44
|
}
|
|
45
|
-
#f(
|
|
46
|
-
e || (this.#l = !1, this.#e._internals?.states.delete("pan-eligible"));
|
|
45
|
+
#f() {
|
|
46
|
+
this.#e.pannable || (this.#l = !1, this.#e._internals?.states.delete("pan-eligible"));
|
|
47
47
|
}
|
|
48
48
|
#p = (e) => {
|
|
49
49
|
let t = e.detail;
|
|
@@ -52,13 +52,13 @@ var a = class {
|
|
|
52
52
|
#m(e) {
|
|
53
53
|
let t = e.event;
|
|
54
54
|
this.#q(t.pointerId);
|
|
55
|
-
let n = t.pointerType === "touch", r = n ?
|
|
55
|
+
let n = t.pointerType === "touch", r = n ? this.#e.pannable : this.#L(t), i = n && this.#e.zoomable;
|
|
56
56
|
if (!r && !i) return this.#h(t);
|
|
57
57
|
if (!e.claim({
|
|
58
58
|
kind: r ? "pan" : void 0,
|
|
59
59
|
pinchCandidate: i
|
|
60
60
|
})) return;
|
|
61
|
-
n || this.#e.focus({ preventScroll: !0 }), t.button === 1 && t.preventDefault()
|
|
61
|
+
n || this.#e.focus({ preventScroll: !0 }), t.button === 1 && t.preventDefault();
|
|
62
62
|
let a = this.#t.getTransform();
|
|
63
63
|
this.#i.set(t.pointerId, {
|
|
64
64
|
button: t.button,
|
|
@@ -86,17 +86,23 @@ var a = class {
|
|
|
86
86
|
return this.#u = void 0, !0;
|
|
87
87
|
}
|
|
88
88
|
#v(e, t, n) {
|
|
89
|
+
if (t.lifecycle.state === "pending") {
|
|
90
|
+
t.pendingEnd = {
|
|
91
|
+
event: e.event,
|
|
92
|
+
interrupted: e.interrupted || n,
|
|
93
|
+
reason: e.reason
|
|
94
|
+
};
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
89
97
|
if (t.lifecycle.state !== "active") return;
|
|
90
|
-
this.#j(t), this.#Y();
|
|
91
98
|
let r = e.interrupted || n;
|
|
92
|
-
this.#M(e, t, r), !r && this.#E(e.event.pointerId, t)?.state === "suppressed" && this.#K(e.event.pointerId, t);
|
|
99
|
+
this.#M(e, t, r), this.#j(t), this.#Y(), !r && this.#E(e.event.pointerId, t)?.state === "suppressed" && this.#K(e.event.pointerId, t);
|
|
93
100
|
}
|
|
94
101
|
#y(e) {
|
|
95
102
|
n(this.#e) && (e.event.ctrlKey || e.event.metaKey ? this.#b(e) : this.#x(e));
|
|
96
103
|
}
|
|
97
104
|
#b(e) {
|
|
98
|
-
if (!this.#e.
|
|
99
|
-
this.#t.consumeAutoFit(), this.#t.cancelAnimation();
|
|
105
|
+
if (!this.#e.zoomable || !e.claim()) return;
|
|
100
106
|
let t = this.#t.getTransform(), n = this.#t.clientToViewport(e.clientX, e.clientY), a = i(n.x, n.y, t), o = this.#n.getWheelZoomFactor(e), s = r(a, n, this.#t.clampScale(t.scale * o)), c = {
|
|
101
107
|
anchor: a,
|
|
102
108
|
clientX: e.clientX,
|
|
@@ -104,14 +110,12 @@ var a = class {
|
|
|
104
110
|
event: e.event,
|
|
105
111
|
factor: o,
|
|
106
112
|
next: s,
|
|
107
|
-
source: "wheel"
|
|
108
|
-
start: t
|
|
113
|
+
source: "wheel"
|
|
109
114
|
};
|
|
110
|
-
this.#
|
|
115
|
+
this.#e.requestZoom(c);
|
|
111
116
|
}
|
|
112
117
|
#x(e) {
|
|
113
|
-
if (!this.#e.
|
|
114
|
-
this.#t.consumeAutoFit(), this.#t.cancelAnimation();
|
|
118
|
+
if (!this.#e.pannable || !e.claim()) return;
|
|
115
119
|
let t = this.#t.getTransform(), n = {
|
|
116
120
|
scale: t.scale,
|
|
117
121
|
x: t.x + e.deltaX / t.scale,
|
|
@@ -123,10 +127,9 @@ var a = class {
|
|
|
123
127
|
deltaY: e.deltaY,
|
|
124
128
|
event: e.event,
|
|
125
129
|
next: n,
|
|
126
|
-
source: "wheel"
|
|
127
|
-
start: t
|
|
130
|
+
source: "wheel"
|
|
128
131
|
};
|
|
129
|
-
this.#
|
|
132
|
+
this.#e.requestPan(r);
|
|
130
133
|
}
|
|
131
134
|
#S = (e) => {
|
|
132
135
|
let t = e.detail;
|
|
@@ -134,47 +137,45 @@ var a = class {
|
|
|
134
137
|
};
|
|
135
138
|
#C(e) {
|
|
136
139
|
let t = e.event.pointerId, n = this.#i.get(t);
|
|
137
|
-
if (!n || n.lifecycle.state === "suppressed"
|
|
138
|
-
|
|
139
|
-
let r = e
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
140
|
+
if (!n || n.lifecycle.state === "suppressed") return;
|
|
141
|
+
n.lastTotalDisplacementX = e.totalDisplacementX, n.lastTotalDisplacementY = e.totalDisplacementY;
|
|
142
|
+
let r = this.#w(e, n);
|
|
143
|
+
n.lifecycle.state === "pending" ? this.#T(e, n, r) : n.lifecycle.navigation.update(r);
|
|
144
|
+
}
|
|
145
|
+
#w(e, t) {
|
|
146
|
+
let n = e.totalDisplacementX - t.transformStartDisplacementX, r = e.totalDisplacementY - t.transformStartDisplacementY, i = {
|
|
147
|
+
scale: t.transformStart.scale,
|
|
148
|
+
x: t.transformStart.x - n / t.transformStart.scale,
|
|
149
|
+
y: t.transformStart.y - r / t.transformStart.scale
|
|
150
|
+
};
|
|
151
|
+
return {
|
|
144
152
|
...e,
|
|
145
|
-
next:
|
|
146
|
-
source: "pointer",
|
|
147
|
-
start: n.start
|
|
153
|
+
next: i
|
|
148
154
|
};
|
|
149
|
-
this.#w(t, n, o);
|
|
150
|
-
}
|
|
151
|
-
#w(e, t, n) {
|
|
152
|
-
let r = this.#t.events.dispatchPan(n), i = this.#E(e, t);
|
|
153
|
-
r && i?.state === "active" && i.defaultAction === "apply" && this.#t.commitTransform(n.next);
|
|
154
155
|
}
|
|
155
156
|
#T(e, t, n) {
|
|
156
|
-
if (
|
|
157
|
-
let r =
|
|
158
|
-
scale: t.transformStart.scale,
|
|
159
|
-
x: t.transformStart.x - r / t.transformStart.scale,
|
|
160
|
-
y: t.transformStart.y - i / t.transformStart.scale
|
|
161
|
-
}, o = {
|
|
157
|
+
if (e.totalDisplacementX ** 2 + e.totalDisplacementY ** 2 < t.dragThreshold ** 2) return;
|
|
158
|
+
let r = this.#e.startPan({
|
|
162
159
|
...n,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
160
|
+
source: "pointer"
|
|
161
|
+
});
|
|
162
|
+
if (r) {
|
|
163
|
+
if (this.#E(e.event.pointerId, t)?.state !== "pending") {
|
|
164
|
+
t.pendingEnd && r.end(t.pendingEnd);
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
t.lifecycle = {
|
|
168
|
+
state: "active",
|
|
169
|
+
navigation: r
|
|
170
|
+
}, this.#Y();
|
|
171
|
+
}
|
|
171
172
|
}
|
|
172
173
|
#E(e, t) {
|
|
173
174
|
let n = this.#i.get(e);
|
|
174
175
|
return n === t ? n.lifecycle : void 0;
|
|
175
176
|
}
|
|
176
177
|
#D(e) {
|
|
177
|
-
this.#
|
|
178
|
+
this.#k(e.event);
|
|
178
179
|
let t = this.#t.clientToViewport(e.centerClientX, e.centerClientY), n = this.#t.clampScale(e.context.start.scale * e.scale), i = r(e.context.anchor, t, n), a = {
|
|
179
180
|
anchor: e.context.anchor,
|
|
180
181
|
clientX: e.centerClientX,
|
|
@@ -182,12 +183,12 @@ var a = class {
|
|
|
182
183
|
event: e.event,
|
|
183
184
|
factor: e.scale,
|
|
184
185
|
next: i,
|
|
185
|
-
source: "pinch"
|
|
186
|
-
start: e.context.start
|
|
186
|
+
source: "pinch"
|
|
187
187
|
};
|
|
188
|
-
this.#t.
|
|
188
|
+
this.#t.requestAdmittedPinchZoom(a);
|
|
189
189
|
}
|
|
190
190
|
#O = (e) => {
|
|
191
|
+
if (!this.#e.zoomable) return;
|
|
191
192
|
let t = this.#t.getTransform(), n = this.#t.clientToViewport(e.startCenterClientX, e.startCenterClientY), r = {
|
|
192
193
|
anchor: i(n.x, n.y, t),
|
|
193
194
|
start: t
|
|
@@ -209,21 +210,20 @@ var a = class {
|
|
|
209
210
|
}
|
|
210
211
|
#A(e, t) {
|
|
211
212
|
let n = t.lifecycle.state === "active";
|
|
212
|
-
|
|
213
|
+
t.lifecycle.state === "pending" && (t.pendingEnd = {
|
|
214
|
+
...e,
|
|
215
|
+
interrupted: !0
|
|
216
|
+
}), n && this.#M(e, t, !0), this.#j(t);
|
|
213
217
|
}
|
|
214
218
|
#j(e) {
|
|
215
219
|
e.lifecycle.state !== "suppressed" && (e.lifecycle = { state: "suppressed" });
|
|
216
220
|
}
|
|
217
221
|
#M(e, t, n) {
|
|
218
|
-
|
|
222
|
+
t.lifecycle.state === "active" && t.lifecycle.navigation.end({
|
|
219
223
|
event: e.event,
|
|
220
224
|
interrupted: n,
|
|
221
|
-
reason: e.reason
|
|
222
|
-
|
|
223
|
-
start: t.start,
|
|
224
|
-
transform: this.#t.getTransform()
|
|
225
|
-
};
|
|
226
|
-
this.#t.events.dispatchPanEnd(r);
|
|
225
|
+
reason: e.reason
|
|
226
|
+
});
|
|
227
227
|
}
|
|
228
228
|
#N = (e) => {
|
|
229
229
|
e.code === "Space" && this.#e.behaviorPan === "space" && n(this.#e) && e.preventDefault();
|
|
@@ -235,18 +235,18 @@ var a = class {
|
|
|
235
235
|
this.#e._internals.states.delete("pan-eligible");
|
|
236
236
|
};
|
|
237
237
|
#I = (e) => {
|
|
238
|
-
this.#e.
|
|
238
|
+
this.#e.pannable && (this.#l = s(e, this.#e), this.#X());
|
|
239
239
|
};
|
|
240
240
|
#L(e) {
|
|
241
|
-
return e.button === 0 ? this.#e.behaviorPan === !0 || this.#e.behaviorPan === "space" && this.#R() : e.button === 1 &&
|
|
241
|
+
return e.button === 0 ? this.#e.behaviorPan === !0 || this.#e.behaviorPan === "space" && this.#R() : e.button === 1 && this.#e.pannable;
|
|
242
242
|
}
|
|
243
243
|
#R() {
|
|
244
244
|
return this.#r.isPressed("Space") && n(this.#e);
|
|
245
245
|
}
|
|
246
|
-
#z = (e) => e.type === "dragstart" && !this.#e.
|
|
246
|
+
#z = (e) => e.type === "dragstart" && !this.#e.pannable || o(e, this.#e) || s(e, this.#e);
|
|
247
247
|
#B = (e) => e.ctrlKey ? this.#e.behaviorPan === !0 || this.#e.behaviorPan === "space" && this.#R() : !1;
|
|
248
248
|
#V = (e) => this.#e.behaviorPan === "space" && this.#R() && (e.pointerType === "mouse" || e.pointerType === "pen") && e.button === 0;
|
|
249
|
-
#H = () => this.#e.
|
|
249
|
+
#H = () => this.#e.pannable || this.#e.zoomable || this.#i.size > 0 ? "none" : void 0;
|
|
250
250
|
#U() {
|
|
251
251
|
let e = this.#t.getTransform();
|
|
252
252
|
for (let t of this.#i.values()) this.#W(t, e);
|
|
@@ -295,14 +295,21 @@ var a = class {
|
|
|
295
295
|
function o(e, t) {
|
|
296
296
|
for (let n of e.composedPath()) {
|
|
297
297
|
if (n === t) break;
|
|
298
|
-
if (n instanceof Element &&
|
|
298
|
+
if (n instanceof Element && n.parentElement === t && n.slot === "overlay") return !0;
|
|
299
299
|
}
|
|
300
300
|
return !1;
|
|
301
301
|
}
|
|
302
|
-
function s(e) {
|
|
303
|
-
|
|
302
|
+
function s(e, t) {
|
|
303
|
+
for (let n of e.composedPath()) {
|
|
304
|
+
if (n === t) break;
|
|
305
|
+
if (n instanceof Element && c(n)) return !0;
|
|
306
|
+
}
|
|
307
|
+
return !1;
|
|
304
308
|
}
|
|
305
309
|
function c(e) {
|
|
310
|
+
return e.matches("button, input, textarea, select, a[href], [contenteditable], [tabindex]") || l(e);
|
|
311
|
+
}
|
|
312
|
+
function l(e) {
|
|
306
313
|
return e.localName.includes("-") ? e.constructor.formAssociated === !0 : !1;
|
|
307
314
|
}
|
|
308
315
|
//#endregion
|