@nvidia-elements/core 2.22.5 → 2.23.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 +6 -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 +4 -0
- package/dist/bundles/index.d.ts +336 -0
- package/dist/bundles/index.js +14 -14
- 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 +6 -6
- package/dist/combobox/combobox2.js +1 -1
- package/dist/copy-button/copy-button2.js +1 -1
- package/dist/custom-elements-jsx.d.ts +189 -0
- package/dist/custom-elements-vue.d.ts +189 -0
- package/dist/custom-elements.json +6555 -0
- package/dist/data.html.json +133 -0
- package/dist/data.snippets.json +27 -27
- package/dist/date/date2.js +6 -6
- package/dist/datetime/datetime2.js +6 -6
- 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-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/ghost/define.d.ts +6 -0
- package/dist/ghost/define.js +6 -0
- package/dist/ghost/define.js.map +1 -0
- package/dist/ghost/ghost.d.ts +27 -0
- package/dist/ghost/ghost.examples.js +5 -0
- package/dist/ghost/ghost.examples.js.map +1 -0
- package/dist/ghost/ghost.examples.json +37 -0
- package/dist/ghost/ghost.js +5 -0
- package/dist/ghost/ghost.js.map +1 -0
- package/dist/ghost/ghost2.js +28 -0
- package/dist/ghost/ghost2.js.map +1 -0
- package/dist/ghost/index.d.ts +1 -0
- package/dist/ghost/index.js +1 -0
- 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/iframe/iframe2.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/joystick/joystick2.js +5 -5
- 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 +6 -6
- 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 +6 -6
- package/dist/preferences-input/preferences-input2.js +5 -5
- package/dist/progress-bar/progress-bar2.js +1 -1
- package/dist/progress-dot/progress-dot2.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 +5 -5
- package/dist/search/search2.js +6 -6
- 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 +6 -6
- 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/tabs-item-group2.js +1 -1
- package/dist/tabs/tabs2.js +2 -2
- package/dist/tag/tag2.js +5 -5
- package/dist/textarea/textarea2.js +1 -1
- package/dist/time/time2.js +6 -6
- 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/week/week2.js +6 -6
- package/dist/workspace/controllers/workspace-command.controller.d.ts +34 -0
- package/dist/workspace/controllers/workspace-command.controller.js +87 -0
- package/dist/workspace/controllers/workspace-command.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-composition.controller.d.ts +54 -0
- package/dist/workspace/controllers/workspace-composition.controller.js +169 -0
- package/dist/workspace/controllers/workspace-composition.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-fullscreen.controller.d.ts +25 -0
- package/dist/workspace/controllers/workspace-fullscreen.controller.js +84 -0
- package/dist/workspace/controllers/workspace-fullscreen.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-measurement.controller.d.ts +19 -0
- package/dist/workspace/controllers/workspace-measurement.controller.js +188 -0
- package/dist/workspace/controllers/workspace-measurement.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-rearrange.controller.d.ts +40 -0
- package/dist/workspace/controllers/workspace-rearrange.controller.js +385 -0
- package/dist/workspace/controllers/workspace-rearrange.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-resize.controller.d.ts +43 -0
- package/dist/workspace/controllers/workspace-resize.controller.js +168 -0
- package/dist/workspace/controllers/workspace-resize.controller.js.map +1 -0
- package/dist/workspace/controllers/workspace-restoration.controller.d.ts +24 -0
- package/dist/workspace/controllers/workspace-restoration.controller.js +193 -0
- package/dist/workspace/controllers/workspace-restoration.controller.js.map +1 -0
- package/dist/workspace/define.d.ts +10 -0
- package/dist/workspace/define.js +9 -0
- package/dist/workspace/define.js.map +1 -0
- package/dist/workspace/index.d.ts +8 -0
- package/dist/workspace/index.js +6 -0
- package/dist/workspace/panel/panel.d.ts +48 -0
- package/dist/workspace/panel/panel.js +5 -0
- package/dist/workspace/panel/panel.js.map +1 -0
- package/dist/workspace/panel/panel2.js +53 -0
- package/dist/workspace/panel/panel2.js.map +1 -0
- package/dist/workspace/panel-content/panel-content.d.ts +20 -0
- package/dist/workspace/panel-content/panel-content.js +5 -0
- package/dist/workspace/panel-content/panel-content.js.map +1 -0
- package/dist/workspace/panel-content/panel-content2.js +22 -0
- package/dist/workspace/panel-content/panel-content2.js.map +1 -0
- package/dist/workspace/panel-footer/panel-footer.d.ts +24 -0
- package/dist/workspace/panel-footer/panel-footer.js +5 -0
- package/dist/workspace/panel-footer/panel-footer.js.map +1 -0
- package/dist/workspace/panel-footer/panel-footer2.js +28 -0
- package/dist/workspace/panel-footer/panel-footer2.js.map +1 -0
- package/dist/workspace/panel-header/panel-header.d.ts +61 -0
- package/dist/workspace/panel-header/panel-header.js +5 -0
- package/dist/workspace/panel-header/panel-header.js.map +1 -0
- package/dist/workspace/panel-header/panel-header2.js +102 -0
- package/dist/workspace/panel-header/panel-header2.js.map +1 -0
- package/dist/workspace/utils/evaluation.utils.d.ts +83 -0
- package/dist/workspace/utils/evaluation.utils.js +294 -0
- package/dist/workspace/utils/evaluation.utils.js.map +1 -0
- package/dist/workspace/utils/geometry/allocation.utils.d.ts +40 -0
- package/dist/workspace/utils/geometry/allocation.utils.js +73 -0
- package/dist/workspace/utils/geometry/allocation.utils.js.map +1 -0
- package/dist/workspace/utils/geometry/partition.utils.d.ts +10 -0
- package/dist/workspace/utils/geometry/partition.utils.js +40 -0
- package/dist/workspace/utils/geometry/partition.utils.js.map +1 -0
- package/dist/workspace/utils/geometry/sizing.utils.d.ts +35 -0
- package/dist/workspace/utils/geometry/sizing.utils.js +42 -0
- package/dist/workspace/utils/geometry/sizing.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/boundary.utils.d.ts +40 -0
- package/dist/workspace/utils/interaction/boundary.utils.js +91 -0
- package/dist/workspace/utils/interaction/boundary.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/command.utils.d.ts +74 -0
- package/dist/workspace/utils/interaction/command.utils.js +189 -0
- package/dist/workspace/utils/interaction/command.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/drag-preview.utils.d.ts +79 -0
- package/dist/workspace/utils/interaction/drag-preview.utils.js +16 -0
- package/dist/workspace/utils/interaction/drag-preview.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/insertion-offers.utils.d.ts +58 -0
- package/dist/workspace/utils/interaction/insertion-offers.utils.js +259 -0
- package/dist/workspace/utils/interaction/insertion-offers.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/placement-decision.utils.d.ts +55 -0
- package/dist/workspace/utils/interaction/placement-decision.utils.js +242 -0
- package/dist/workspace/utils/interaction/placement-decision.utils.js.map +1 -0
- package/dist/workspace/utils/interaction/resize-input.utils.d.ts +1 -0
- package/dist/workspace/utils/interaction/resize-input.utils.js +17 -0
- package/dist/workspace/utils/interaction/resize-input.utils.js.map +1 -0
- package/dist/workspace/utils/model/layout.utils.d.ts +22 -0
- package/dist/workspace/utils/model/layout.utils.js +41 -0
- package/dist/workspace/utils/model/layout.utils.js.map +1 -0
- package/dist/workspace/utils/model/membership.utils.d.ts +14 -0
- package/dist/workspace/utils/model/membership.utils.js +17 -0
- package/dist/workspace/utils/model/membership.utils.js.map +1 -0
- package/dist/workspace/utils/model/operations.utils.d.ts +31 -0
- package/dist/workspace/utils/model/operations.utils.js +178 -0
- package/dist/workspace/utils/model/operations.utils.js.map +1 -0
- package/dist/workspace/utils/model/projection.utils.d.ts +7 -0
- package/dist/workspace/utils/model/projection.utils.js +87 -0
- package/dist/workspace/utils/model/projection.utils.js.map +1 -0
- package/dist/workspace/utils/model/value.utils.d.ts +5 -0
- package/dist/workspace/utils/model/value.utils.js +68 -0
- package/dist/workspace/utils/model/value.utils.js.map +1 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.d.ts +32 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.js +152 -0
- package/dist/workspace/utils/placement/acquisition-sizing.utils.js.map +1 -0
- package/dist/workspace/utils/placement/context.utils.d.ts +36 -0
- package/dist/workspace/utils/placement/context.utils.js +135 -0
- package/dist/workspace/utils/placement/context.utils.js.map +1 -0
- package/dist/workspace/utils/placement/group-insertion.utils.d.ts +26 -0
- package/dist/workspace/utils/placement/group-insertion.utils.js +171 -0
- package/dist/workspace/utils/placement/group-insertion.utils.js.map +1 -0
- package/dist/workspace/utils/placement/origin.utils.d.ts +13 -0
- package/dist/workspace/utils/placement/origin.utils.js +49 -0
- package/dist/workspace/utils/placement/origin.utils.js.map +1 -0
- package/dist/workspace/utils/placement/planner.utils.d.ts +22 -0
- package/dist/workspace/utils/placement/planner.utils.js +184 -0
- package/dist/workspace/utils/placement/planner.utils.js.map +1 -0
- package/dist/workspace/utils/placement/preparation.utils.d.ts +28 -0
- package/dist/workspace/utils/placement/preparation.utils.js +140 -0
- package/dist/workspace/utils/placement/preparation.utils.js.map +1 -0
- package/dist/workspace/utils/placement/region.utils.d.ts +15 -0
- package/dist/workspace/utils/placement/region.utils.js +111 -0
- package/dist/workspace/utils/placement/region.utils.js.map +1 -0
- package/dist/workspace/utils/placement/split-sizing.utils.d.ts +18 -0
- package/dist/workspace/utils/placement/split-sizing.utils.js +108 -0
- package/dist/workspace/utils/placement/split-sizing.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/composition.utils.d.ts +17 -0
- package/dist/workspace/utils/presentation/composition.utils.js +95 -0
- package/dist/workspace/utils/presentation/composition.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/groups.utils.d.ts +91 -0
- package/dist/workspace/utils/presentation/groups.utils.js +169 -0
- package/dist/workspace/utils/presentation/groups.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/header-configuration.utils.d.ts +11 -0
- package/dist/workspace/utils/presentation/header-configuration.utils.js +7 -0
- package/dist/workspace/utils/presentation/header-configuration.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/measurements.utils.d.ts +21 -0
- package/dist/workspace/utils/presentation/measurements.utils.js +28 -0
- package/dist/workspace/utils/presentation/measurements.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/offers.utils.d.ts +43 -0
- package/dist/workspace/utils/presentation/offers.utils.js +137 -0
- package/dist/workspace/utils/presentation/offers.utils.js.map +1 -0
- package/dist/workspace/utils/presentation/preview.utils.d.ts +6 -0
- package/dist/workspace/utils/presentation/preview.utils.js +36 -0
- package/dist/workspace/utils/presentation/preview.utils.js.map +1 -0
- package/dist/workspace/workspace.d.ts +103 -0
- package/dist/workspace/workspace.examples.js +5 -0
- package/dist/workspace/workspace.examples.js.map +1 -0
- package/dist/workspace/workspace.examples.json +133 -0
- package/dist/workspace/workspace.js +5 -0
- package/dist/workspace/workspace.js.map +1 -0
- package/dist/workspace/workspace.types.d.ts +3 -0
- package/dist/workspace/workspace2.js +518 -0
- package/dist/workspace/workspace2.js.map +1 -0
- package/package.json +25 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-resize.controller.js","names":["WorkspaceResizeController","#presenting","handle","#findOwnedHandle","event","input","#delegate","boundary","item","#begin","#endPointer","#guardStart","isResizeKey","#pointerPending","#transaction","#globalKeydown","#host","host","delegate","transaction","#document","#finishPresentation","value","#updatePreview","#settleFrame","change","#resize","terminal","#resetHandle","isResizeHandle","layout","target","committed","preview","#commit","#queuePreview","#createResizePreview","#beginPresentation","delta","origin","sizes","resizeSizes","size","index","baseline","rebaseProjectedSplit","matchesElementName","ResizeHandle"],"sources":["../../../src/workspace/controllers/workspace-resize.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveControllerHost } from 'lit';\n\nimport { type GestureInput, matchesElementName } from '@nvidia-elements/core/internal';\n\nimport { ResizeHandle } from '@nvidia-elements/core/resize-handle';\n\nimport { resizeSizes } from '../utils/geometry/partition.utils.js';\nimport { isResizeKey } from '../utils/interaction/resize-input.utils.js';\nimport { rebaseProjectedSplit } from '../utils/model/projection.utils.js';\n\nimport type { WorkspaceBoundary } from '../utils/geometry/allocation.utils.js';\nimport type { WorkspaceLayout } from '../utils/model/layout.utils.js';\nimport type { WorkspaceMeasurementChange, WorkspaceMeasurements } from '../utils/presentation/measurements.utils.js';\n\ninterface WorkspaceResizeHost extends HTMLElement, ReactiveControllerHost {\n readonly resizePolicy: 'stop' | 'propagate';\n}\n\ninterface ResizePresentation {\n measurements: WorkspaceMeasurements;\n rearrangeable: boolean;\n closable: boolean;\n fullscreenable: boolean;\n}\n\ninterface WorkspaceResizeDelegate {\n readonly isEnabled: () => boolean;\n readonly getLayout: () => WorkspaceLayout | undefined;\n readonly getBoundaries: () => WorkspaceBoundary[];\n readonly getAvailablePanels: () => string[];\n readonly getPresentation: () => ResizePresentation;\n readonly cancelForUser: () => void;\n readonly commitLayout: (layout: WorkspaceLayout) => void;\n}\n\ninterface ResizeOperation {\n handle: ResizeHandle;\n pointerId?: number;\n status: 'active' | 'committed';\n baseline: WorkspaceLayout;\n origin: WorkspaceBoundary;\n policy: 'stop' | 'propagate';\n available: string[];\n presentation: ResizePresentation;\n pendingValue?: number;\n preview?: { value: number; layout: WorkspaceLayout };\n}\n\ntype ResizeTransaction = ResizeOperation | { handle: ResizeHandle; pointerId?: number; status: 'cancelled' };\n\nexport class WorkspaceResizeController {\n readonly #host: WorkspaceResizeHost;\n readonly #delegate: WorkspaceResizeDelegate;\n #transaction?: ResizeTransaction;\n #document?: Document;\n #presenting = false;\n #settleFrame?: number;\n\n constructor(host: WorkspaceResizeHost, delegate: WorkspaceResizeDelegate) {\n this.#host = host;\n this.#delegate = delegate;\n host.addController(this);\n }\n\n get preview() {\n return this.#transaction?.status !== 'cancelled' ? this.#transaction?.preview?.layout : undefined;\n }\n\n get presentation() {\n const transaction = this.#transaction;\n return transaction?.status !== 'cancelled' ? transaction?.presentation : undefined;\n }\n\n get retainingHandles() {\n return this.#transaction?.pointerId !== undefined && this.#transaction.status !== 'cancelled';\n }\n\n get resizing() {\n return this.#presenting;\n }\n\n get policy(): 'stop' | 'propagate' {\n const transaction = this.#transaction;\n if (transaction && transaction.status !== 'cancelled') return transaction.policy;\n return this.#host.resizePolicy === 'propagate' ? 'propagate' : 'stop';\n }\n\n hostConnected() {\n this.#document = this.#host.ownerDocument;\n this.#host.addEventListener('pointerdown', this.#guardStart, true);\n this.#host.addEventListener('keydown', this.#guardStart, true);\n this.#document.addEventListener('keydown', this.#globalKeydown);\n }\n\n hostDisconnected() {\n this.#host.removeEventListener('pointerdown', this.#guardStart, true);\n this.#host.removeEventListener('keydown', this.#guardStart, true);\n this.#document?.removeEventListener('keydown', this.#globalKeydown);\n this.#document = undefined;\n this.#transaction = undefined;\n this.#finishPresentation();\n }\n\n hostUpdate() {\n const transaction = this.#transaction;\n if (transaction?.status !== 'active' || transaction.pendingValue === undefined) return;\n\n const value = transaction.pendingValue;\n transaction.pendingValue = undefined;\n this.#updatePreview(value, transaction);\n }\n\n hostUpdated() {\n if (!this.#presenting || this.preview || this.retainingHandles || this.#settleFrame !== undefined) return;\n this.#settleFrame = requestAnimationFrame(() => {\n this.#settleFrame = requestAnimationFrame(() => {\n this.#settleFrame = undefined;\n if (this.preview || this.retainingHandles) return;\n this.#finishPresentation();\n this.#host.requestUpdate();\n });\n });\n }\n\n handleMeasurementsChange(change: WorkspaceMeasurementChange) {\n if (change.spaceChanged) {\n this.cancel();\n }\n }\n\n resetForRestore() {\n this.cancel();\n this.#finishPresentation();\n }\n\n cancel() {\n const transaction = this.#transaction;\n if (!transaction || transaction.status === 'cancelled') return;\n this.#transaction = { handle: transaction.handle, pointerId: transaction.pointerId, status: 'cancelled' };\n this.#host.requestUpdate();\n }\n\n input(event: Event, boundary: WorkspaceBoundary) {\n this.#resize(event, boundary, false);\n }\n\n change(event: Event, boundary: WorkspaceBoundary) {\n this.#resize(event, boundary, true);\n }\n\n gesture = (event: CustomEvent<GestureInput>) => {\n const handle = this.#findOwnedHandle(event);\n if (!handle) return;\n const input = event.detail;\n if (\n input.kind === 'pointerdown' &&\n input.event.button === 0 &&\n input.event.isPrimary &&\n this.#delegate.isEnabled()\n ) {\n const boundary = this.#delegate.getBoundaries().find(item => item.key === handle.dataset.boundary);\n if (boundary) {\n this.#begin(handle, boundary, input.event.pointerId);\n }\n }\n if (input.kind === 'pointerend') {\n this.#endPointer(handle, input);\n }\n };\n\n #endPointer(handle: ResizeHandle, input: Extract<GestureInput, { kind: 'pointerend' }>) {\n const transaction = this.#transaction;\n if (transaction?.handle !== handle || transaction.pointerId !== input.event.pointerId) return;\n\n if (input.interrupted) {\n this.cancel();\n }\n\n const terminal = this.#transaction;\n if (!terminal) return;\n if (terminal.status === 'cancelled') {\n terminal.pointerId = undefined;\n void this.#resetHandle(handle);\n } else if (terminal.status === 'committed') {\n this.#transaction = undefined;\n } else {\n terminal.pointerId = undefined;\n }\n\n this.#host.requestUpdate();\n }\n\n #findOwnedHandle(event: Event): ResizeHandle | undefined {\n return event\n .composedPath()\n .find(\n (item): item is ResizeHandle =>\n isResizeHandle(item) && item.isConnected && item.getRootNode() === this.#host.shadowRoot\n );\n }\n\n #guardStart = (event: Event) => {\n if (!this.#findOwnedHandle(event)) return;\n if (event instanceof KeyboardEvent && !isResizeKey(event.key)) {\n return;\n }\n if (this.#delegate.isEnabled() && !this.#pointerPending) {\n if (event instanceof KeyboardEvent && this.#transaction?.status === 'cancelled') {\n this.#transaction = undefined;\n }\n return;\n }\n event.preventDefault();\n event.stopImmediatePropagation();\n };\n\n get #pointerPending() {\n const transaction = this.#transaction;\n return (\n transaction?.pointerId !== undefined &&\n transaction.handle.isConnected &&\n transaction.handle.getRootNode() === this.#host.shadowRoot\n );\n }\n\n #begin(handle: ResizeHandle, origin: WorkspaceBoundary, pointerId?: number) {\n const layout = this.#delegate.getLayout();\n if (!layout) return;\n this.#transaction = {\n handle,\n pointerId,\n status: 'active',\n baseline: structuredClone(layout),\n origin,\n policy: this.policy,\n available: this.#delegate.getAvailablePanels(),\n presentation: this.#delegate.getPresentation()\n };\n }\n\n #beginPresentation() {\n if (this.#settleFrame !== undefined) {\n cancelAnimationFrame(this.#settleFrame);\n }\n this.#settleFrame = undefined;\n this.#presenting = true;\n }\n\n #finishPresentation() {\n if (this.#settleFrame !== undefined) {\n cancelAnimationFrame(this.#settleFrame);\n }\n this.#settleFrame = undefined;\n this.#presenting = false;\n }\n\n async #resetHandle(target: ResizeHandle) {\n await this.#host.updateComplete;\n if (!target.isConnected || target.getRootNode() !== this.#host.shadowRoot) return;\n\n const boundary = this.#delegate.getBoundaries().find(item => item.key === target.dataset.boundary);\n if (boundary) {\n target.valueAsNumber = boundary.value;\n }\n }\n\n #globalKeydown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape' || event.defaultPrevented || this.#transaction?.status !== 'active') return;\n event.preventDefault();\n this.#delegate.cancelForUser();\n };\n\n #resize(event: Event, boundary: WorkspaceBoundary, committed: boolean) {\n event.stopPropagation();\n const handle = event.currentTarget;\n if (!isResizeHandle(handle) || !this.#findOwnedHandle(event)) return;\n if (!this.#transaction && this.#delegate.isEnabled()) {\n this.#begin(handle, boundary);\n }\n const transaction = this.#transaction;\n if (!transaction || transaction.handle !== handle || transaction.status !== 'active') return;\n const value = handle.valueAsNumber;\n if (committed) {\n transaction.pendingValue = undefined;\n const preview = this.#updatePreview(value, transaction);\n if (preview) {\n this.#commit(preview, transaction);\n }\n return;\n }\n this.#queuePreview(value, transaction);\n }\n\n #queuePreview(value: number, transaction: ResizeOperation) {\n if (\n transaction.pendingValue === value ||\n (transaction.pendingValue === undefined && transaction.preview?.value === value)\n ) {\n return;\n }\n transaction.pendingValue = value;\n this.#host.requestUpdate();\n }\n\n #updatePreview(value: number, transaction: ResizeOperation) {\n if (transaction.preview?.value === value) {\n return transaction.preview.layout;\n }\n const layout = this.#createResizePreview(value, transaction);\n if (layout) {\n this.#beginPresentation();\n transaction.preview = { value, layout };\n }\n return layout;\n }\n\n #commit(preview: WorkspaceLayout, transaction: ResizeOperation) {\n transaction.preview = undefined;\n transaction.status = 'committed';\n if (transaction.pointerId === undefined) {\n this.#transaction = undefined;\n }\n this.#delegate.commitLayout(preview);\n }\n\n #createResizePreview(value: number, transaction: ResizeOperation): WorkspaceLayout | undefined {\n const { origin, baseline } = transaction;\n const delta = (value - origin.value) * (origin.branch.axis === 'horizontal' ? 1 : -1);\n const sizes = resizeSizes(origin.sizes, origin.minima, {\n boundary: origin.index,\n delta,\n policy: transaction.policy\n });\n if (sizes.every((size, index) => size === origin.sizes[index])) return structuredClone(baseline);\n return rebaseProjectedSplit(baseline, origin.branch, sizes, transaction.available);\n }\n}\n\nfunction isResizeHandle(target: EventTarget | null): target is ResizeHandle {\n return target !== null && matchesElementName(target, ResizeHandle);\n}\n"],"mappings":";;;;;;AAqDA,IAAaA,IAAb,MAAuC;CACrC;CACA;CACA;CACA;CACA;CACA;CAEA,YAAY,GAA2B,GAAmC;EAGxE,AANY,KAAAC,KAAA,IA+FH,KAAA,WAAA,MAAqC;GAC9C,IAAMC,IAAS,KAAKC,GAAiBC,CAAK;GAC1C,IAAI,CAACF,GAAQ;GACb,IAAMG,IAAQD,EAAM;GACpB,IACEC,EAAM,SAAS,iBACfA,EAAM,MAAM,WAAW,KACvBA,EAAM,MAAM,aACZ,KAAKC,GAAU,UAAU,GACzB;IACA,IAAMC,IAAW,KAAKD,GAAU,cAAc,CAAC,CAAC,MAAK,MAAQE,EAAK,QAAQN,EAAO,QAAQ,QAAQ;IACjG,AAAIK,KACF,KAAKE,GAAOP,GAAQK,GAAUF,EAAM,MAAM,SAAS;GAEvD;GACA,AAAIA,EAAM,SAAS,gBACjB,KAAKK,GAAYR,GAAQG,CAAK;EAElC,GAiCe,KAAAM,MAAA,MAAiB;GAC9B,AAAK,KAAKR,GAAiBC,CAAK,MAC5BA,aAAiB,iBAAiB,CAACQ,EAAYR,EAAM,GAAG,MAGxD,KAAKE,GAAU,UAAU,KAAK,CAAC,KAAKO,KAClCT,aAAiB,iBAAiB,KAAKU,IAAc,WAAW,gBAClE,KAAKA,KAAe,KAAA,MAIxBV,EAAM,eAAe,GACrBA,EAAM,yBAAyB;EACjC,GAoDkB,KAAAW,MAAA,MAAyB;GACzC,AAAIX,EAAM,QAAQ,YAAYA,EAAM,oBAAoB,KAAKU,IAAc,WAAW,aACtFV,EAAM,eAAe,GACrB,KAAKE,GAAU,cAAc;EAC/B,GAnNE,KAAKU,KAAQC,GACb,KAAKX,KAAYY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AAY;AACnE"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactiveControllerHost } from 'lit';
|
|
2
|
+
import type { WorkspaceTransitionTargets } from './workspace-composition.controller.js';
|
|
3
|
+
import type { WorkspaceLayout } from '../utils/model/layout.utils.js';
|
|
4
|
+
import type { WorkspaceMeasurementChange } from '../utils/presentation/measurements.utils.js';
|
|
5
|
+
import type { WorkspaceAnimationOptions } from '../workspace.types.js';
|
|
6
|
+
interface WorkspaceRestorationDelegate {
|
|
7
|
+
readonly getLayout: () => WorkspaceLayout | undefined;
|
|
8
|
+
readonly applyLayout: (layout: WorkspaceLayout | undefined) => void;
|
|
9
|
+
readonly getTransitionTargets: () => WorkspaceTransitionTargets;
|
|
10
|
+
}
|
|
11
|
+
export declare class WorkspaceRestorationController {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(host: HTMLElement & ReactiveControllerHost, delegate: WorkspaceRestorationDelegate);
|
|
14
|
+
get active(): boolean;
|
|
15
|
+
hostConnected(): void;
|
|
16
|
+
hostDisconnected(): void;
|
|
17
|
+
handleMeasurementsChange(change: WorkspaceMeasurementChange): void;
|
|
18
|
+
animateTo(layout: WorkspaceLayout | undefined, options: WorkspaceAnimationOptions): void;
|
|
19
|
+
transition(apply: () => void, options?: WorkspaceAnimationOptions, target?: {
|
|
20
|
+
layout: WorkspaceLayout | undefined;
|
|
21
|
+
}): void;
|
|
22
|
+
finish(): void;
|
|
23
|
+
}
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { matchesElementName as e } from "../../internal/utils/dom.js";
|
|
2
|
+
import { sameSerializedWorkspaceLayout as t } from "../utils/model/value.utils.js";
|
|
3
|
+
import { WorkspacePanel as n } from "../panel/panel2.js";
|
|
4
|
+
import { isResizeKey as r } from "../utils/interaction/resize-input.utils.js";
|
|
5
|
+
// src/workspace/controllers/workspace-restoration.controller.ts
|
|
6
|
+
var i = class {
|
|
7
|
+
#e;
|
|
8
|
+
#t;
|
|
9
|
+
#n;
|
|
10
|
+
constructor(e, t) {
|
|
11
|
+
this.#e = e, this.#t = t, e.addController(this);
|
|
12
|
+
}
|
|
13
|
+
get active() {
|
|
14
|
+
return this.#n !== void 0;
|
|
15
|
+
}
|
|
16
|
+
hostConnected() {
|
|
17
|
+
this.#e.addEventListener("pointerdown", this.#i, !0), this.#e.addEventListener("keydown", this.#i, !0);
|
|
18
|
+
}
|
|
19
|
+
hostDisconnected() {
|
|
20
|
+
this.finish(), this.#e.removeEventListener("pointerdown", this.#i, !0), this.#e.removeEventListener("keydown", this.#i, !0);
|
|
21
|
+
}
|
|
22
|
+
handleMeasurementsChange(e) {
|
|
23
|
+
e.spaceChanged && this.finish();
|
|
24
|
+
}
|
|
25
|
+
animateTo(e, n) {
|
|
26
|
+
let r = this.#n?.target;
|
|
27
|
+
r && t(e, r.layout) || (!this.active && t(e, this.#t.getLayout()) ? this.#t.applyLayout(e) : this.transition(() => this.#t.applyLayout(e), n, { layout: e }));
|
|
28
|
+
}
|
|
29
|
+
transition(e, t = {}, n) {
|
|
30
|
+
let r = this.#e.isConnected && !matchMedia("(prefers-reduced-motion: reduce)").matches ? l(this.#e, t.duration) : 0;
|
|
31
|
+
if (r === 0) {
|
|
32
|
+
this.finish(), e();
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
let i = c(this.#t.getTransitionTargets());
|
|
36
|
+
if (this.finish(), !i.panels.size) {
|
|
37
|
+
e();
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
let a = {
|
|
41
|
+
target: n,
|
|
42
|
+
before: i,
|
|
43
|
+
duration: r,
|
|
44
|
+
animations: []
|
|
45
|
+
};
|
|
46
|
+
this.#n = a, e(), this.#r(a);
|
|
47
|
+
}
|
|
48
|
+
finish() {
|
|
49
|
+
let e = this.#n;
|
|
50
|
+
this.#n = void 0, e?.animations.forEach((e) => e.cancel());
|
|
51
|
+
}
|
|
52
|
+
async #r(e) {
|
|
53
|
+
if (await this.#e.updateComplete, await Promise.all(d(this.#e)), this.#n !== e || !this.#e.isConnected) return;
|
|
54
|
+
let t = c(this.#t.getTransitionTargets()), n = u(this.#e);
|
|
55
|
+
e.animations = f({
|
|
56
|
+
...e,
|
|
57
|
+
after: t,
|
|
58
|
+
easing: n
|
|
59
|
+
}), await Promise.allSettled(e.animations.map((e) => e.finished)), this.#n === e && this.finish();
|
|
60
|
+
}
|
|
61
|
+
#i = (e) => {
|
|
62
|
+
if (!this.active) return;
|
|
63
|
+
let t = this.#a(e);
|
|
64
|
+
if (!t) return;
|
|
65
|
+
let n = t.hasAttribute("data-boundary");
|
|
66
|
+
e instanceof KeyboardEvent && (!n || !r(e.key)) || (e.stopImmediatePropagation(), n && e.preventDefault());
|
|
67
|
+
};
|
|
68
|
+
#a(e) {
|
|
69
|
+
return e.composedPath().find((e) => e instanceof HTMLElement && e.getRootNode() === this.#e.shadowRoot && (e.hasAttribute("data-panel") || e.hasAttribute("data-drag-group") || e.hasAttribute("data-boundary")));
|
|
70
|
+
}
|
|
71
|
+
};
|
|
72
|
+
function a(e) {
|
|
73
|
+
let t = getComputedStyle(e);
|
|
74
|
+
return {
|
|
75
|
+
element: e,
|
|
76
|
+
rect: e.getBoundingClientRect(),
|
|
77
|
+
frame: {
|
|
78
|
+
left: t.left,
|
|
79
|
+
top: t.top,
|
|
80
|
+
width: t.width,
|
|
81
|
+
height: t.height
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
function o(e) {
|
|
86
|
+
let t = /* @__PURE__ */ new Map();
|
|
87
|
+
for (let [n, r] of Object.entries(e ?? {})) {
|
|
88
|
+
if (!r) continue;
|
|
89
|
+
let e = a(r);
|
|
90
|
+
n === "labelTrack" && (e.frame.transform = getComputedStyle(r).transform), t.set(n, e);
|
|
91
|
+
}
|
|
92
|
+
return t;
|
|
93
|
+
}
|
|
94
|
+
function s(e) {
|
|
95
|
+
let t = /* @__PURE__ */ new Map();
|
|
96
|
+
for (let { element: n, tabs: r } of e) {
|
|
97
|
+
let e = /* @__PURE__ */ new Map();
|
|
98
|
+
r.forEach((t, n) => e.set(n, a(t)));
|
|
99
|
+
let i = {
|
|
100
|
+
...a(n),
|
|
101
|
+
tabs: e
|
|
102
|
+
};
|
|
103
|
+
r.forEach((e, n) => t.set(n, i));
|
|
104
|
+
}
|
|
105
|
+
return t;
|
|
106
|
+
}
|
|
107
|
+
function c(e) {
|
|
108
|
+
let t = /* @__PURE__ */ new Map();
|
|
109
|
+
e.panels.forEach((e, n) => {
|
|
110
|
+
t.set(n, {
|
|
111
|
+
box: a(e.element),
|
|
112
|
+
header: o(e.header)
|
|
113
|
+
});
|
|
114
|
+
});
|
|
115
|
+
let n = /* @__PURE__ */ new Map();
|
|
116
|
+
return e.gutters.forEach((e, t) => n.set(t, a(e))), {
|
|
117
|
+
panels: t,
|
|
118
|
+
groups: s(e.groups),
|
|
119
|
+
gutters: n
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
function l(e, t) {
|
|
123
|
+
if (t !== void 0 && Number.isFinite(t) && t >= 0) return t;
|
|
124
|
+
let n = e.shadowRoot?.querySelector("[data-chrome]");
|
|
125
|
+
if (!e.isConnected || !n) return 0;
|
|
126
|
+
let r = getComputedStyle(n).animationDuration, i = Number.parseFloat(r);
|
|
127
|
+
return Number.isFinite(i) ? Math.max(0, r.endsWith("ms") ? i : i * 1e3) : 150;
|
|
128
|
+
}
|
|
129
|
+
function u(e) {
|
|
130
|
+
let t = e.shadowRoot?.querySelector("[data-chrome]");
|
|
131
|
+
return t ? getComputedStyle(t).animationTimingFunction : "ease";
|
|
132
|
+
}
|
|
133
|
+
function d(t) {
|
|
134
|
+
let r = [];
|
|
135
|
+
for (let i of t.children) {
|
|
136
|
+
if (!e(i, n)) continue;
|
|
137
|
+
let t = i;
|
|
138
|
+
r.push(t.updateComplete);
|
|
139
|
+
let a = t.querySelector(":scope > nve-workspace-panel-header");
|
|
140
|
+
a && r.push(a.updateComplete);
|
|
141
|
+
}
|
|
142
|
+
return r;
|
|
143
|
+
}
|
|
144
|
+
function f(e) {
|
|
145
|
+
let t = [], n = (n, r) => {
|
|
146
|
+
JSON.stringify(n) !== JSON.stringify(r.frame) && t.push(r.element.animate([n, r.frame], {
|
|
147
|
+
duration: e.duration,
|
|
148
|
+
easing: e.easing
|
|
149
|
+
}));
|
|
150
|
+
};
|
|
151
|
+
e.after.panels.forEach((t, r) => {
|
|
152
|
+
let i = e.before.panels.get(r);
|
|
153
|
+
i && (n(i.box.frame, t.box), t.header.forEach((e, t) => {
|
|
154
|
+
let r = i.header.get(t);
|
|
155
|
+
r && n(r.frame, e);
|
|
156
|
+
}));
|
|
157
|
+
});
|
|
158
|
+
let r = {
|
|
159
|
+
input: e,
|
|
160
|
+
animations: t
|
|
161
|
+
}, i = /* @__PURE__ */ new Set();
|
|
162
|
+
return e.after.groups.forEach((t, a) => {
|
|
163
|
+
if (i.has(t.element)) return;
|
|
164
|
+
i.add(t.element);
|
|
165
|
+
let o = e.before.groups.get(a);
|
|
166
|
+
o && (n(o.frame, t), p(r, o, t));
|
|
167
|
+
}), e.after.gutters.forEach((t, r) => {
|
|
168
|
+
let i = e.before.gutters.get(r);
|
|
169
|
+
i && n(i.frame, t);
|
|
170
|
+
}), t;
|
|
171
|
+
}
|
|
172
|
+
function p({ input: e, animations: t }, n, r) {
|
|
173
|
+
r.tabs.forEach((i, a) => {
|
|
174
|
+
let o = e.before.groups.get(a)?.tabs.get(a);
|
|
175
|
+
if (!o) return;
|
|
176
|
+
let s = o.rect.x - n.rect.x - (i.rect.x - r.rect.x), c = o.rect.y - n.rect.y - (i.rect.y - r.rect.y), l = {
|
|
177
|
+
width: o.frame.width,
|
|
178
|
+
height: o.frame.height,
|
|
179
|
+
translate: `${s}px ${c}px`
|
|
180
|
+
}, u = {
|
|
181
|
+
width: i.frame.width,
|
|
182
|
+
height: i.frame.height,
|
|
183
|
+
translate: "0px 0px"
|
|
184
|
+
};
|
|
185
|
+
(s || c || l.width !== u.width || l.height !== u.height) && t.push(i.element.animate([l, u], {
|
|
186
|
+
duration: e.duration,
|
|
187
|
+
easing: e.easing
|
|
188
|
+
}));
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
export { i as WorkspaceRestorationController };
|
|
192
|
+
|
|
193
|
+
//# sourceMappingURL=workspace-restoration.controller.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace-restoration.controller.js","names":["WorkspaceRestorationController","#host","host","#delegate","delegate","#restoration","#guardStart","change","target","sameSerializedWorkspaceLayout","layout","options","duration","getWorkspaceAnimationDuration","apply","before","captureWorkspacePresentation","restoration","#animate","animation","getPanelUpdatePromises","after","easing","getWorkspaceAnimationEasing","animateWorkspacePresentation","control","#findInteractionControl","event","isResizeControl","isResizeKey","node","captureBox","style","element","captureHeader","parts","role","elements","entry","captureGroups","groups","capturedTabs","id","tab","group","panels","panel","gutters","gutter","probe","value","number","updates","child","matchesElementName","WorkspacePanel","header","animations","animate","from","to","input","previous","oldPart","key","part","transition","visited","animateGroupTabs","oldTab","panelId","x","y"],"sources":["../../../src/workspace/controllers/workspace-restoration.controller.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { ReactiveControllerHost } from 'lit';\n\nimport { matchesElementName } from '@nvidia-elements/core/internal';\n\nimport { isResizeKey } from '../utils/interaction/resize-input.utils.js';\nimport { sameSerializedWorkspaceLayout } from '../utils/model/value.utils.js';\n\nimport { WorkspacePanel } from '../panel/panel.js';\n\nimport type {\n WorkspacePanelTransitionTargets,\n WorkspaceTransitionTargets\n} from './workspace-composition.controller.js';\nimport type { WorkspaceLayout } from '../utils/model/layout.utils.js';\nimport type { WorkspaceMeasurementChange } from '../utils/presentation/measurements.utils.js';\n\nimport type { WorkspacePanelHeader } from '../panel-header/panel-header.js';\nimport type { WorkspaceAnimationOptions } from '../workspace.types.js';\n\ninterface Box {\n element: HTMLElement;\n rect: DOMRect;\n frame: Keyframe;\n}\n\ninterface GroupBox extends Box {\n tabs: Map<string, Box>;\n}\n\ninterface WorkspacePresentation {\n panels: Map<string, { box: Box; header: Map<string, Box> }>;\n groups: Map<string, GroupBox>;\n gutters: Map<string, Box>;\n}\n\ninterface Restoration {\n target?: { layout: WorkspaceLayout | undefined };\n before: WorkspacePresentation;\n duration: number;\n animations: Animation[];\n}\n\ninterface WorkspaceRestorationDelegate {\n readonly getLayout: () => WorkspaceLayout | undefined;\n readonly applyLayout: (layout: WorkspaceLayout | undefined) => void;\n readonly getTransitionTargets: () => WorkspaceTransitionTargets;\n}\n\nexport class WorkspaceRestorationController {\n readonly #host: HTMLElement & ReactiveControllerHost;\n readonly #delegate: WorkspaceRestorationDelegate;\n #restoration?: Restoration;\n\n constructor(host: HTMLElement & ReactiveControllerHost, delegate: WorkspaceRestorationDelegate) {\n this.#host = host;\n this.#delegate = delegate;\n host.addController(this);\n }\n\n get active() {\n return this.#restoration !== undefined;\n }\n\n hostConnected() {\n this.#host.addEventListener('pointerdown', this.#guardStart, true);\n this.#host.addEventListener('keydown', this.#guardStart, true);\n }\n\n hostDisconnected() {\n this.finish();\n this.#host.removeEventListener('pointerdown', this.#guardStart, true);\n this.#host.removeEventListener('keydown', this.#guardStart, true);\n }\n\n handleMeasurementsChange(change: WorkspaceMeasurementChange) {\n if (change.spaceChanged) {\n this.finish();\n }\n }\n\n animateTo(layout: WorkspaceLayout | undefined, options: WorkspaceAnimationOptions) {\n const target = this.#restoration?.target;\n if (target && sameSerializedWorkspaceLayout(layout, target.layout)) {\n return;\n }\n if (!this.active && sameSerializedWorkspaceLayout(layout, this.#delegate.getLayout())) {\n this.#delegate.applyLayout(layout);\n return;\n }\n this.transition(() => this.#delegate.applyLayout(layout), options, { layout });\n }\n\n transition(\n apply: () => void,\n options: WorkspaceAnimationOptions = {},\n target?: { layout: WorkspaceLayout | undefined }\n ) {\n const canAnimate = this.#host.isConnected && !matchMedia('(prefers-reduced-motion: reduce)').matches;\n const duration = canAnimate ? getWorkspaceAnimationDuration(this.#host, options.duration) : 0;\n if (duration === 0) {\n this.finish();\n apply();\n return;\n }\n\n const before = captureWorkspacePresentation(this.#delegate.getTransitionTargets());\n this.finish();\n if (!before.panels.size) {\n apply();\n return;\n }\n const restoration: Restoration = { target, before, duration, animations: [] };\n this.#restoration = restoration;\n apply();\n void this.#animate(restoration);\n }\n\n finish() {\n const restoration = this.#restoration;\n this.#restoration = undefined;\n restoration?.animations.forEach(animation => animation.cancel());\n }\n\n async #animate(restoration: Restoration) {\n await this.#host.updateComplete;\n await Promise.all(getPanelUpdatePromises(this.#host));\n if (this.#restoration !== restoration || !this.#host.isConnected) return;\n const after = captureWorkspacePresentation(this.#delegate.getTransitionTargets());\n const easing = getWorkspaceAnimationEasing(this.#host);\n restoration.animations = animateWorkspacePresentation({ ...restoration, after, easing });\n await Promise.allSettled(restoration.animations.map(animation => animation.finished));\n if (this.#restoration === restoration) {\n this.finish();\n }\n }\n\n #guardStart = (event: Event) => {\n if (!this.active) {\n return;\n }\n const control = this.#findInteractionControl(event);\n if (!control) {\n return;\n }\n const isResizeControl = control.hasAttribute('data-boundary');\n if (event instanceof KeyboardEvent && (!isResizeControl || !isResizeKey(event.key))) {\n return;\n }\n\n event.stopImmediatePropagation();\n if (isResizeControl) {\n event.preventDefault();\n }\n };\n\n #findInteractionControl(event: Event): HTMLElement | undefined {\n return event\n .composedPath()\n .find(\n (node): node is HTMLElement =>\n node instanceof HTMLElement &&\n node.getRootNode() === this.#host.shadowRoot &&\n (node.hasAttribute('data-panel') ||\n node.hasAttribute('data-drag-group') ||\n node.hasAttribute('data-boundary'))\n );\n }\n}\n\nfunction captureBox(element: HTMLElement): Box {\n const style = getComputedStyle(element);\n return {\n element,\n rect: element.getBoundingClientRect(),\n frame: { left: style.left, top: style.top, width: style.width, height: style.height }\n };\n}\n\nfunction captureHeader(elements: WorkspacePanelTransitionTargets['header']) {\n const parts = new Map<string, Box>();\n for (const [role, element] of Object.entries(elements ?? {})) {\n if (!element) continue;\n const entry = captureBox(element);\n if (role === 'labelTrack') {\n entry.frame.transform = getComputedStyle(element).transform;\n }\n parts.set(role, entry);\n }\n return parts;\n}\n\nfunction captureGroups(elements: WorkspaceTransitionTargets['groups']): WorkspacePresentation['groups'] {\n const groups: WorkspacePresentation['groups'] = new Map();\n for (const { element, tabs } of elements) {\n const capturedTabs = new Map<string, Box>();\n tabs.forEach((tab, id) => capturedTabs.set(id, captureBox(tab)));\n const group = { ...captureBox(element), tabs: capturedTabs };\n tabs.forEach((_, id) => groups.set(id, group));\n }\n return groups;\n}\n\nfunction captureWorkspacePresentation(elements: WorkspaceTransitionTargets): WorkspacePresentation {\n const panels: WorkspacePresentation['panels'] = new Map();\n elements.panels.forEach((panel, id) => {\n panels.set(id, { box: captureBox(panel.element), header: captureHeader(panel.header) });\n });\n const gutters = new Map<string, Box>();\n elements.gutters.forEach((gutter, id) => gutters.set(id, captureBox(gutter)));\n return { panels, groups: captureGroups(elements.groups), gutters };\n}\n\nfunction getWorkspaceAnimationDuration(host: HTMLElement, duration?: number): number {\n if (duration !== undefined && Number.isFinite(duration) && duration >= 0) return duration;\n\n const probe = host.shadowRoot?.querySelector('[data-chrome]');\n if (!host.isConnected || !probe) return 0;\n const value = getComputedStyle(probe).animationDuration;\n const number = Number.parseFloat(value);\n return Number.isFinite(number) ? Math.max(0, value.endsWith('ms') ? number : number * 1000) : 150;\n}\n\nfunction getWorkspaceAnimationEasing(host: HTMLElement): string {\n const probe = host.shadowRoot?.querySelector('[data-chrome]');\n return probe ? getComputedStyle(probe).animationTimingFunction : 'ease';\n}\n\nfunction getPanelUpdatePromises(host: HTMLElement): Promise<unknown>[] {\n const updates: Promise<unknown>[] = [];\n for (const child of host.children) {\n if (!matchesElementName(child, WorkspacePanel)) continue;\n const panel = child as WorkspacePanel;\n updates.push(panel.updateComplete);\n const header = panel.querySelector<WorkspacePanelHeader>(':scope > nve-workspace-panel-header');\n if (header) {\n updates.push(header.updateComplete);\n }\n }\n return updates;\n}\n\nfunction animateWorkspacePresentation(input: {\n before: WorkspacePresentation;\n after: WorkspacePresentation;\n duration: number;\n easing: string;\n}): Animation[] {\n const animations: Animation[] = [];\n const animate = (from: Keyframe, to: Box) => {\n if (JSON.stringify(from) === JSON.stringify(to.frame)) return;\n animations.push(to.element.animate([from, to.frame], { duration: input.duration, easing: input.easing }));\n };\n input.after.panels.forEach((panel, id) => {\n const previous = input.before.panels.get(id);\n if (!previous) return;\n animate(previous.box.frame, panel.box);\n panel.header.forEach((part, key) => {\n const oldPart = previous.header.get(key);\n if (oldPart) {\n animate(oldPart.frame, part);\n }\n });\n });\n const transition = { input, animations };\n const visited = new Set<HTMLElement>();\n input.after.groups.forEach((group, id) => {\n if (visited.has(group.element)) return;\n visited.add(group.element);\n const previous = input.before.groups.get(id);\n if (!previous) return;\n animate(previous.frame, group);\n animateGroupTabs(transition, previous, group);\n });\n input.after.gutters.forEach((gutter, id) => {\n const previous = input.before.gutters.get(id);\n if (previous) {\n animate(previous.frame, gutter);\n }\n });\n return animations;\n}\n\nfunction animateGroupTabs(\n { input, animations }: { input: Parameters<typeof animateWorkspacePresentation>[0]; animations: Animation[] },\n previous: GroupBox,\n group: GroupBox\n) {\n group.tabs.forEach((tab, panelId) => {\n const oldGroup = input.before.groups.get(panelId);\n const oldTab = oldGroup?.tabs.get(panelId);\n if (!oldTab) return;\n const x = oldTab.rect.x - previous.rect.x - (tab.rect.x - group.rect.x);\n const y = oldTab.rect.y - previous.rect.y - (tab.rect.y - group.rect.y);\n const from = { width: oldTab.frame.width, height: oldTab.frame.height, translate: `${x}px ${y}px` };\n const to = { width: tab.frame.width, height: tab.frame.height, translate: '0px 0px' };\n if (x || y || from.width !== to.width || from.height !== to.height) {\n animations.push(tab.element.animate([from, to], { duration: input.duration, easing: input.easing }));\n }\n });\n}\n"],"mappings":";;;;;AAmDA,IAAaA,IAAb,MAA4C;CAC1C;CACA;CACA;CAEA,YA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AAI,MAAM;GAAO,QAAQA,EAAI,MAAM;GAAQ,WAAW;EAAU;EACpF,CAAI4B,KAAKC,KAAKb,EAAK,UAAUC,EAAG,SAASD,EAAK,WAAWC,EAAG,WAC1DH,EAAW,KAAKd,EAAI,QAAQ,QAAQ,CAACgB,GAAMC,CAAE,GAAG;GAAE,UAAUC,EAAM;GAAU,QAAQA,EAAM;EAAO,CAAC,CAAC;CAEvG,CAAC;AACH"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Workspace, WorkspacePanel, WorkspacePanelContent, WorkspacePanelFooter, WorkspacePanelHeader } from '@nvidia-elements/core/workspace';
|
|
2
|
+
declare global {
|
|
3
|
+
interface HTMLElementTagNameMap {
|
|
4
|
+
'nve-workspace': Workspace;
|
|
5
|
+
'nve-workspace-panel': WorkspacePanel;
|
|
6
|
+
'nve-workspace-panel-header': WorkspacePanelHeader;
|
|
7
|
+
'nve-workspace-panel-content': WorkspacePanelContent;
|
|
8
|
+
'nve-workspace-panel-footer': WorkspacePanelFooter;
|
|
9
|
+
}
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WorkspacePanel as e } from "./panel/panel2.js";
|
|
2
|
+
import { Workspace as t } from "./workspace2.js";
|
|
3
|
+
import { WorkspacePanelHeader as n } from "./panel-header/panel-header2.js";
|
|
4
|
+
import { WorkspacePanelContent as r } from "./panel-content/panel-content2.js";
|
|
5
|
+
import { WorkspacePanelFooter as i } from "./panel-footer/panel-footer2.js";
|
|
6
|
+
import { define as a } from "@nvidia-elements/foundations/internal/define";
|
|
7
|
+
a(n), a(r), a(i), a(e), a(t);
|
|
8
|
+
|
|
9
|
+
//# sourceMappingURL=define.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"define.js","names":["define","WorkspacePanelHeader","WorkspacePanelContent","WorkspacePanelFooter","WorkspacePanel","Workspace"],"sources":["../../src/workspace/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/foundations/internal/define';\n\nimport {\n Workspace,\n WorkspacePanel,\n WorkspacePanelContent,\n WorkspacePanelFooter,\n WorkspacePanelHeader\n} from '@nvidia-elements/core/workspace';\n\ndefine(WorkspacePanelHeader);\ndefine(WorkspacePanelContent);\ndefine(WorkspacePanelFooter);\ndefine(WorkspacePanel);\n\ndefine(Workspace);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'nve-workspace': Workspace;\n 'nve-workspace-panel': WorkspacePanel;\n 'nve-workspace-panel-header': WorkspacePanelHeader;\n 'nve-workspace-panel-content': WorkspacePanelContent;\n 'nve-workspace-panel-footer': WorkspacePanelFooter;\n }\n}\n"],"mappings":";;;;;;AAaAA,EAAOC,CAAoB,GAC3BD,EAAOE,CAAqB,GAC5BF,EAAOG,CAAoB,GAC3BH,EAAOI,CAAc,GAErBJ,EAAOK,CAAS"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './workspace.js';
|
|
2
|
+
export * from './panel/panel.js';
|
|
3
|
+
export type { WorkspaceLayout, WorkspaceNode, WorkspaceGroup, WorkspaceSplit } from './utils/model/layout.utils.js';
|
|
4
|
+
export type { WorkspacePlacement, WorkspaceSide, WorkspaceCommandContext, WorkspaceCommandSource } from './utils/interaction/command.utils.js';
|
|
5
|
+
export * from './panel-header/panel-header.js';
|
|
6
|
+
export * from './panel-content/panel-content.js';
|
|
7
|
+
export * from './panel-footer/panel-footer.js';
|
|
8
|
+
export type { WorkspaceAnimationOptions } from './workspace.types.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { WorkspacePanel as e } from "./panel/panel2.js";
|
|
2
|
+
import { Workspace as t } from "./workspace2.js";
|
|
3
|
+
import { WorkspacePanelHeader as n } from "./panel-header/panel-header2.js";
|
|
4
|
+
import { WorkspacePanelContent as r } from "./panel-content/panel-content2.js";
|
|
5
|
+
import { WorkspacePanelFooter as i } from "./panel-footer/panel-footer2.js";
|
|
6
|
+
export { t as Workspace, e as WorkspacePanel, r as WorkspacePanelContent, i as WorkspacePanelFooter, n as WorkspacePanelHeader };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { WorkspaceHeaderConfiguration } from '../utils/presentation/header-configuration.utils.js';
|
|
3
|
+
/**
|
|
4
|
+
* @element nve-workspace-panel
|
|
5
|
+
* @description Stable application content and its workspace chrome.
|
|
6
|
+
* @documentation https://nvidia.github.io/elements/docs/elements/workspace/
|
|
7
|
+
* @since 0.0.0
|
|
8
|
+
* @stable false
|
|
9
|
+
* @entrypoint \@nvidia-elements/core/workspace
|
|
10
|
+
* @command --enter-fullscreen - Present this panel's group in native fullscreen.
|
|
11
|
+
* @command --exit-fullscreen - Exit native fullscreen.
|
|
12
|
+
* @command --toggle-fullscreen - Toggle native fullscreen for this panel's group.
|
|
13
|
+
* @command --open - Open and activate the targeted supplied panel. Repeated activation is silent.
|
|
14
|
+
* @command --close - Close the targeted panel when its workspace is closable.
|
|
15
|
+
* @command --select - Activate an open supplied panel without reopening a closed panel.
|
|
16
|
+
* @command --place - Apply the invoker's typed placement request when rearrangeable; membership changes also require groupable.
|
|
17
|
+
* @slot - Application content.
|
|
18
|
+
* @slot header - Title and controls.
|
|
19
|
+
* @slot footer - Status and actions.
|
|
20
|
+
* @cssprop --background
|
|
21
|
+
* @cssprop --border
|
|
22
|
+
* @cssprop --box-shadow
|
|
23
|
+
*/
|
|
24
|
+
export declare class WorkspacePanel extends LitElement {
|
|
25
|
+
static styles: import("lit").CSSResult[];
|
|
26
|
+
static readonly metadata: {
|
|
27
|
+
tag: string;
|
|
28
|
+
version: string;
|
|
29
|
+
parents: string[];
|
|
30
|
+
children: string[];
|
|
31
|
+
};
|
|
32
|
+
/** Application minimum total panel width in pixels. */
|
|
33
|
+
minWidth: number;
|
|
34
|
+
/** Application minimum total panel height in pixels. */
|
|
35
|
+
minHeight: number;
|
|
36
|
+
private selected;
|
|
37
|
+
private headerHeight;
|
|
38
|
+
/** @internal */
|
|
39
|
+
_internals: ElementInternals;
|
|
40
|
+
connectedCallback(): void;
|
|
41
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
42
|
+
/** @internal */
|
|
43
|
+
_present(presented: boolean): void;
|
|
44
|
+
/** @internal */
|
|
45
|
+
_configure(configuration: WorkspaceHeaderConfiguration & {
|
|
46
|
+
scrollLeft: number;
|
|
47
|
+
}): void;
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// src/workspace/panel/panel.css?inline
|
|
2
|
+
var e = ":host{--background: var(--nve-sys-layer-container-background);--border: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color);--box-shadow: var(--nve-ref-shadow-100);display:block;pointer-events:none;border-radius:var(--_workspace-border-radius, var(--nve-ref-border-radius-lg))}[internal-host]{height:100%;position:relative;border-radius:inherit}.surface{position:absolute;inset:0;overflow:hidden;border-radius:inherit}.content{box-sizing:border-box;position:absolute;inset:0;display:flex;flex-direction:column;min-height:0;pointer-events:auto;background:var(--background);border:var(--border);border-color:transparent}.frame{position:absolute;inset:0;box-sizing:border-box;border:var(--border);border-right:var(--_workspace-border-right, var(--border));border-bottom:var(--_workspace-border-bottom, var(--border));border-radius:inherit;pointer-events:none;z-index:4}.body{flex:1;min-height:0;overflow:auto;scrollbar-color:var(--nve-sys-scrollbar-thumb-color) var(--nve-sys-scrollbar-track-color);scrollbar-width:var(--nve-sys-scrollbar-width)}::slotted(nve-workspace-panel-footer){flex:0 0 auto}[hidden]{display:none}:host([container=\"flat\"]) .content{background:transparent}:host([container=\"full\"]),:host([container=\"flat\"]){border-radius:var(--nve-ref-border-radius-none);--box-shadow: none}:host([aria-hidden=\"false\"]){box-shadow:var(--box-shadow)}";
|
|
3
|
+
export { e as default };
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=panel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel.js","names":["panel_default"],"sources":["../../../src/workspace/panel/panel.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n\n:host {\n --background: var(--nve-sys-layer-container-background);\n --border: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color);\n --box-shadow: var(--nve-ref-shadow-100);\n display: block;\n pointer-events: none;\n border-radius: var(--_workspace-border-radius, var(--nve-ref-border-radius-lg));\n}\n\n[internal-host] {\n height: 100%;\n position: relative;\n border-radius: inherit;\n}\n\n.surface {\n position: absolute;\n inset: 0;\n overflow: hidden;\n border-radius: inherit;\n}\n\n.content {\n box-sizing: border-box;\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n min-height: 0;\n pointer-events: auto;\n background: var(--background);\n border: var(--border);\n /* Preserve border insets while the selected frame owns the visible border. */\n border-color: transparent;\n}\n\n.frame {\n position: absolute;\n inset: 0;\n box-sizing: border-box;\n border: var(--border);\n border-right: var(--_workspace-border-right, var(--border));\n border-bottom: var(--_workspace-border-bottom, var(--border));\n border-radius: inherit;\n pointer-events: none;\n z-index: 4;\n}\n\n.body {\n flex: 1;\n min-height: 0;\n overflow: auto;\n scrollbar-color: var(--nve-sys-scrollbar-thumb-color) var(--nve-sys-scrollbar-track-color);\n scrollbar-width: var(--nve-sys-scrollbar-width);\n}\n\n::slotted(nve-workspace-panel-footer) {\n flex: 0 0 auto;\n}\n\n[hidden] {\n display: none;\n}\n\n:host([container='flat']) .content {\n background: transparent;\n}\n\n:host([container='full']),\n:host([container='flat']) {\n border-radius: var(--nve-ref-border-radius-none);\n --box-shadow: none;\n}\n\n:host([aria-hidden='false']) {\n box-shadow: var(--box-shadow);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { attachInternals as e } from "../../internal/utils/a11y.js";
|
|
2
|
+
import { useStyles as t } from "../../internal/styles/index.js";
|
|
3
|
+
import n from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
4
|
+
import r from "./panel.js";
|
|
5
|
+
import { LitElement as i, html as a } from "lit";
|
|
6
|
+
import { property as o } from "lit/decorators/property.js";
|
|
7
|
+
import { state as s } from "lit/decorators/state.js";
|
|
8
|
+
// src/workspace/panel/panel.ts
|
|
9
|
+
var c = class extends i {
|
|
10
|
+
constructor(...e) {
|
|
11
|
+
super(...e), this.minWidth = 0, this.minHeight = 0, this.selected = !1, this.headerHeight = 0;
|
|
12
|
+
}
|
|
13
|
+
static {
|
|
14
|
+
this.styles = t([r]);
|
|
15
|
+
}
|
|
16
|
+
static {
|
|
17
|
+
this.metadata = {
|
|
18
|
+
tag: "nve-workspace-panel",
|
|
19
|
+
version: "2.23.0",
|
|
20
|
+
parents: ["nve-workspace"],
|
|
21
|
+
children: [
|
|
22
|
+
"nve-workspace-panel-header",
|
|
23
|
+
"nve-workspace-panel-content",
|
|
24
|
+
"nve-workspace-panel-footer"
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
connectedCallback() {
|
|
29
|
+
super.connectedCallback(), e(this);
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
let { selected: e, headerHeight: t } = this;
|
|
33
|
+
return a`<div internal-host><div class="surface"><slot name="header"></slot><div class="content" style="${`top:${t}px`}" ?hidden="${!e}"><div class="body" tabindex="0"><slot></slot></div><slot name="footer"></slot></div></div><div class="frame" ?hidden="${!e}"></div></div>`;
|
|
34
|
+
}
|
|
35
|
+
_present(e) {
|
|
36
|
+
e ? this._internals.states.add("workspace-presented") : this._internals.states.delete("workspace-presented");
|
|
37
|
+
}
|
|
38
|
+
_configure(e) {
|
|
39
|
+
this.selected = e.selected, this.headerHeight = e.headerHeight, this.querySelector(":scope > nve-workspace-panel-header")?._configure(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
n([o({
|
|
43
|
+
type: Number,
|
|
44
|
+
attribute: "min-width",
|
|
45
|
+
reflect: !0
|
|
46
|
+
})], c.prototype, "minWidth", void 0), n([o({
|
|
47
|
+
type: Number,
|
|
48
|
+
attribute: "min-height",
|
|
49
|
+
reflect: !0
|
|
50
|
+
})], c.prototype, "minHeight", void 0), n([s()], c.prototype, "selected", void 0), n([s()], c.prototype, "headerHeight", void 0);
|
|
51
|
+
export { c as WorkspacePanel };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=panel2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel2.js","names":["styles","_decorate","__decorate","panel_default","WorkspacePanel","LitElement","_args","useStyles","attachInternals","headerHeight","selected","presented","configuration","property","state"],"sources":["../../../src/workspace/panel/panel.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\nimport { property } from 'lit/decorators/property.js';\nimport { state } from 'lit/decorators/state.js';\n\nimport { attachInternals, useStyles } from '@nvidia-elements/core/internal';\n\nimport type { WorkspaceHeaderConfiguration } from '../utils/presentation/header-configuration.utils.js';\n\nimport type { WorkspacePanelHeader } from '../panel-header/panel-header.js';\n\nimport styles from './panel.css?inline';\n\n/**\n * @element nve-workspace-panel\n * @description Stable application content and its workspace chrome.\n * @documentation https://nvidia.github.io/elements/docs/elements/workspace/\n * @since 0.0.0\n * @stable false\n * @entrypoint \\@nvidia-elements/core/workspace\n * @command --enter-fullscreen - Present this panel's group in native fullscreen.\n * @command --exit-fullscreen - Exit native fullscreen.\n * @command --toggle-fullscreen - Toggle native fullscreen for this panel's group.\n * @command --open - Open and activate the targeted supplied panel. Repeated activation is silent.\n * @command --close - Close the targeted panel when its workspace is closable.\n * @command --select - Activate an open supplied panel without reopening a closed panel.\n * @command --place - Apply the invoker's typed placement request when rearrangeable; membership changes also require groupable.\n * @slot - Application content.\n * @slot header - Title and controls.\n * @slot footer - Status and actions.\n * @cssprop --background\n * @cssprop --border\n * @cssprop --box-shadow\n */\nexport class WorkspacePanel extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = {\n tag: 'nve-workspace-panel',\n version: '0.0.0',\n parents: ['nve-workspace'],\n children: ['nve-workspace-panel-header', 'nve-workspace-panel-content', 'nve-workspace-panel-footer']\n };\n\n /** Application minimum total panel width in pixels. */\n @property({ type: Number, attribute: 'min-width', reflect: true }) minWidth = 0;\n\n /** Application minimum total panel height in pixels. */\n @property({ type: Number, attribute: 'min-height', reflect: true }) minHeight = 0;\n\n @state() private selected = false;\n\n @state() private headerHeight = 0;\n\n /** @internal */\n declare _internals: ElementInternals;\n\n connectedCallback() {\n super.connectedCallback();\n attachInternals(this);\n }\n\n render() {\n const { selected, headerHeight } = this;\n return html`\n <div internal-host>\n <div class=\"surface\">\n <slot name=\"header\"></slot>\n <div class=\"content\" style=${`top:${headerHeight}px`} ?hidden=${!selected}>\n <div class=\"body\" tabindex=\"0\"><slot></slot></div>\n <slot name=\"footer\"></slot>\n </div>\n </div>\n <div class=\"frame\" ?hidden=${!selected}></div>\n </div>\n `;\n }\n\n /** @internal */\n _present(presented: boolean) {\n if (presented) this._internals.states.add('workspace-presented');\n else this._internals.states.delete('workspace-presented');\n }\n\n /** @internal */\n _configure(configuration: WorkspaceHeaderConfiguration & { scrollLeft: number }) {\n this.selected = configuration.selected;\n this.headerHeight = configuration.headerHeight;\n this.querySelector<WorkspacePanelHeader>(':scope > nve-workspace-panel-header')?._configure(configuration);\n }\n}\n"],"mappings":";;;;;;;;AAoCA,IAAaI,IAAb,cAAoCC,EAAW;;EAkBb,A,aAP8C,KAAA,WAAA,GAGE,KAAA,YAAA,GAEpD,KAAA,WAAA,IAEI,KAAA,eAAA;;;EAjBhB,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GACzB,KAAK;GACL,SAAS;GACT,SAAS,CAAC,eAAe;GACzB,UAAU;IAAC;IAA8B;IAA+B;GAA4B;EACtG;;CAeA,oBAAoB;EAElB,AADA,MAAM,kBAAkB,GACxBQ,EAAgB,IAAI;CACtB;CAEA,SAAS;EACP,IAAM,EAAE,aAAU,oBAAiB;EACnC,OAAO,CAAI,kGAIwB,OAAOC,EAAa,IAAI,aAAW,CAACC,EAAS,yHAK/C,CAACA,EAAS;CAG7C;CAGA,SAAS,GAAoB;EAC3B,AAAIC,IAAW,KAAK,WAAW,OAAO,IAAI,qBAAqB,IAC1D,KAAK,WAAW,OAAO,OAAO,qBAAqB;CAC1D;CAGA,WAAW,GAAsE;EAG/E,AAFA,KAAK,WAAWC,EAAc,UAC9B,KAAK,eAAeA,EAAc,cAClC,KAAK,cAAoC,qCAAqC,CAAC,EAAE,WAAWA,CAAa;CAC3G;AACF;AA7CGX,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAa,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,YAAA,KAAA,CAAA,GAGhEH,EAAA,CAAAY,EAAS;CAAE,MAAM;CAAQ,WAAW;CAAc,SAAS;AAAK,CAAC,CAAA,GAAAT,EAAA,WAAA,aAAA,KAAA,CAAA,GAEjEH,EAAA,CAAAa,EAAM,CAAA,GAAAV,EAAA,WAAA,YAAA,KAAA,CAAA,GAENH,EAAA,CAAAa,EAAM,CAAA,GAAAV,EAAA,WAAA,gBAAA,KAAA,CAAA"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @element nve-workspace-panel-content
|
|
4
|
+
* @description Provides padding for workspace panel content.
|
|
5
|
+
* @documentation https://nvidia.github.io/elements/docs/elements/workspace/
|
|
6
|
+
* @since 0.0.0
|
|
7
|
+
* @stable false
|
|
8
|
+
* @entrypoint \@nvidia-elements/core/workspace
|
|
9
|
+
* @slot - Application content.
|
|
10
|
+
* @cssprop --padding
|
|
11
|
+
*/
|
|
12
|
+
export declare class WorkspacePanelContent extends LitElement {
|
|
13
|
+
static styles: import("lit").CSSResult[];
|
|
14
|
+
static readonly metadata: {
|
|
15
|
+
tag: string;
|
|
16
|
+
version: string;
|
|
17
|
+
parents: string[];
|
|
18
|
+
};
|
|
19
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-content.js","names":["panel_content_default"],"sources":["../../../src/workspace/panel-content/panel-content.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n:host {\n --padding: var(--nve-ref-space-sm);\n display: block;\n contain: none;\n}\n\n[internal-host] {\n padding: var(--padding);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useStyles as e } from "../../internal/styles/index.js";
|
|
2
|
+
import t from "./panel-content.js";
|
|
3
|
+
import { LitElement as n, html as r } from "lit";
|
|
4
|
+
// src/workspace/panel-content/panel-content.ts
|
|
5
|
+
var i = class extends n {
|
|
6
|
+
static {
|
|
7
|
+
this.styles = e([t]);
|
|
8
|
+
}
|
|
9
|
+
static {
|
|
10
|
+
this.metadata = {
|
|
11
|
+
tag: "nve-workspace-panel-content",
|
|
12
|
+
version: "2.23.0",
|
|
13
|
+
parents: ["nve-workspace-panel"]
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return r`<div internal-host><slot></slot></div>`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
export { i as WorkspacePanelContent };
|
|
21
|
+
|
|
22
|
+
//# sourceMappingURL=panel-content2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-content2.js","names":["styles","panel_content_default","WorkspacePanelContent","LitElement","useStyles"],"sources":["../../../src/workspace/panel-content/panel-content.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\n\nimport { useStyles } from '@nvidia-elements/core/internal';\n\nimport styles from './panel-content.css?inline';\n\n/**\n * @element nve-workspace-panel-content\n * @description Provides padding for workspace panel content.\n * @documentation https://nvidia.github.io/elements/docs/elements/workspace/\n * @since 0.0.0\n * @stable false\n * @entrypoint \\@nvidia-elements/core/workspace\n * @slot - Application content.\n * @cssprop --padding\n */\nexport class WorkspacePanelContent extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = { tag: 'nve-workspace-panel-content', version: '0.0.0', parents: ['nve-workspace-panel'] };\n\n render() {\n return html`\n <div internal-host><slot></slot></div>\n `;\n }\n}\n"],"mappings":";;;;AAmBA,IAAaE,IAAb,cAA2CC,EAAW;;EACpC,KAAA,SAAAC,EAAU,CAACJ,CAAM,CAAC;;;EAEP,KAAA,WAAA;GAAE,KAAK;GAA+B,SAAS;GAAS,SAAS,CAAC,qBAAqB;EAAE;;CAEpH,SAAS;EACP,OAAO,CAAI;CAGb;AACF"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* @element nve-workspace-panel-footer
|
|
4
|
+
* @description Provides workspace panel status and actions outside the scrolling body.
|
|
5
|
+
* @documentation https://nvidia.github.io/elements/docs/elements/workspace/
|
|
6
|
+
* @since 0.0.0
|
|
7
|
+
* @stable false
|
|
8
|
+
* @entrypoint \@nvidia-elements/core/workspace
|
|
9
|
+
* @slot - Status and actions.
|
|
10
|
+
* @cssprop --padding
|
|
11
|
+
* @cssprop --border-top
|
|
12
|
+
* @cssprop --gap
|
|
13
|
+
*/
|
|
14
|
+
export declare class WorkspacePanelFooter extends LitElement {
|
|
15
|
+
static styles: import("lit").CSSResult[];
|
|
16
|
+
static readonly metadata: {
|
|
17
|
+
tag: string;
|
|
18
|
+
version: string;
|
|
19
|
+
parents: string[];
|
|
20
|
+
};
|
|
21
|
+
/** @private */
|
|
22
|
+
slot: string;
|
|
23
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
24
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// src/workspace/panel-footer/panel-footer.css?inline
|
|
2
|
+
var e = ":host{--padding: var(--nve-ref-space-sm);--border-top: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color-muted);--gap: var(--nve-ref-space-xs);display:block;contain:none}[internal-host]{padding:var(--padding);display:flex;align-items:center;gap:var(--gap);border-top:var(--border-top)}";
|
|
3
|
+
export { e as default };
|
|
4
|
+
|
|
5
|
+
//# sourceMappingURL=panel-footer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-footer.js","names":["panel_footer_default"],"sources":["../../../src/workspace/panel-footer/panel-footer.css?inline"],"sourcesContent":["/* SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. */\n/* SPDX-License-Identifier: Apache-2.0 */\n:host {\n --padding: var(--nve-ref-space-sm);\n --border-top: var(--nve-ref-border-width-sm) solid var(--nve-ref-border-color-muted);\n --gap: var(--nve-ref-space-xs);\n display: block;\n contain: none;\n}\n\n[internal-host] {\n padding: var(--padding);\n display: flex;\n align-items: center;\n gap: var(--gap);\n border-top: var(--border-top);\n}\n"],"mappings":""}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { hostAttr as e } from "../../internal/decorators/host-attr.js";
|
|
2
|
+
import { useStyles as t } from "../../internal/styles/index.js";
|
|
3
|
+
import n from "../../_virtual/_@oxc-project_runtime@0.155.0/helpers/esm/decorate.js";
|
|
4
|
+
import r from "./panel-footer.js";
|
|
5
|
+
import { LitElement as i, html as a } from "lit";
|
|
6
|
+
// src/workspace/panel-footer/panel-footer.ts
|
|
7
|
+
var o = class extends i {
|
|
8
|
+
constructor(...e) {
|
|
9
|
+
super(...e), this.slot = "footer";
|
|
10
|
+
}
|
|
11
|
+
static {
|
|
12
|
+
this.styles = t([r]);
|
|
13
|
+
}
|
|
14
|
+
static {
|
|
15
|
+
this.metadata = {
|
|
16
|
+
tag: "nve-workspace-panel-footer",
|
|
17
|
+
version: "2.23.0",
|
|
18
|
+
parents: ["nve-workspace-panel"]
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
render() {
|
|
22
|
+
return a`<div internal-host><slot></slot></div>`;
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
n([e()], o.prototype, "slot", void 0);
|
|
26
|
+
export { o as WorkspacePanelFooter };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=panel-footer2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"panel-footer2.js","names":["styles","_decorate","__decorate","panel_footer_default","WorkspacePanelFooter","LitElement","_args","useStyles","hostAttr"],"sources":["../../../src/workspace/panel-footer/panel-footer.ts"],"sourcesContent":["// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { html, LitElement } from 'lit';\n\nimport { hostAttr, useStyles } from '@nvidia-elements/core/internal';\n\nimport styles from './panel-footer.css?inline';\n\n/**\n * @element nve-workspace-panel-footer\n * @description Provides workspace panel status and actions outside the scrolling body.\n * @documentation https://nvidia.github.io/elements/docs/elements/workspace/\n * @since 0.0.0\n * @stable false\n * @entrypoint \\@nvidia-elements/core/workspace\n * @slot - Status and actions.\n * @cssprop --padding\n * @cssprop --border-top\n * @cssprop --gap\n */\nexport class WorkspacePanelFooter extends LitElement {\n static styles = useStyles([styles]);\n\n static readonly metadata = { tag: 'nve-workspace-panel-footer', version: '0.0.0', parents: ['nve-workspace-panel'] };\n\n /** @private */\n @hostAttr() slot = 'footer';\n\n render() {\n return html`\n <div internal-host><slot></slot></div>\n `;\n }\n}\n"],"mappings":";;;;;;AAqBA,IAAaI,IAAb,cAA0CC,EAAW;;EAMhC,A,aAAA,KAAA,OAAA;;;EALH,KAAA,SAAAE,EAAU,CAACP,CAAM,CAAC;;;EAEP,KAAA,WAAA;GAAE,KAAK;GAA8B,SAAS;GAAS,SAAS,CAAC,qBAAqB;EAAE;;CAKnH,SAAS;EACP,OAAO,CAAI;CAGb;AACF;AAPGC,EAAA,CAAAO,EAAS,CAAA,GAAAJ,EAAA,WAAA,QAAA,KAAA,CAAA"}
|