diff --git a/.vscode/settings.json b/.vscode/settings.json index 37dde12..cf4b29b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -4,8 +4,20 @@ // - Linux: $HOME/.config/Code/User/settings.json // - Mac: $HOME/Library/Application Support/Code/User/settings.json { - "editor.formatOnSave": true, - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - } + "editor.formatOnSave": true, + "editor.codeActionsOnSave": { + "source.fixAll.eslint": "explicit" + }, + "[javascript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[typescript]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[typescriptreact]": { + "editor.defaultFormatter": "vscode.typescript-language-features" + }, + "[json]": { + "editor.defaultFormatter": "vscode.json-language-features" + }, } \ No newline at end of file diff --git a/package.json b/package.json index dea1426..bc00d35 100644 --- a/package.json +++ b/package.json @@ -38,22 +38,14 @@ "serve": "serve --cors -p 9000" }, "dependencies": { - "@floating-ui/react": "^0.26.17", "@vscode/codicons": "0.0.20", - "@vscode/webview-ui-toolkit": "^1.4.0", - "antd": "^5.22.1", + "@eclipse-cdt-cloud/vscode-ui-components": "0.0.1", "jszip": "^3.10.1", "node-fetch": "^2.6.7", - "primeflex": "^3.3.1", - "re-resizable": "^6.11.2", "react": "^18.2.0", "react-dom": "^18.2.0", - "react-markdown": "^9.0.1", - "remark-gfm": "^4.0.0", - "throttle-debounce": "5.0.2", "vscode-messenger": "^0.4.5", "vscode-messenger-common": "^0.4.5", - "vscode-messenger-webview": "^0.4.5", "xml2js": "^0.4.23", "xmlbuilder2": "^3.0.0" }, @@ -61,7 +53,6 @@ "@types/node": "^20.17.17", "@types/react": "^18.0.26", "@types/react-dom": "^18.0.9", - "@types/throttle-debounce": "5.0.2", "@types/vscode": "^1.63.2", "@types/vscode-webview": "^1.57.0", "@types/xml2js": "^0.4.9", @@ -79,7 +70,7 @@ "timers-browserify": "^2.0.12", "ts-loader": "^9.2.6", "typescript": "^4.9.4", - "webpack": "^5.70.0", + "webpack": "^5.98.0", "webpack-cli": "4.9.1" }, "contributes": { @@ -433,4 +424,4 @@ "workspace", "ui" ] -} +} \ No newline at end of file diff --git a/src/commands.ts b/src/commands.ts index ce2707d..6f51608 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -5,17 +5,17 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ +import { CDTTreeMessengerType, CDTTreeWebviewContext } from '@eclipse-cdt-cloud/vscode-ui-components'; import * as vscode from 'vscode'; import { NumberFormat } from './common/format'; import { PERIPHERAL_ID_SEP } from './common/peripheral-dto'; import { VSCodeContextKeys } from './common/vscode-context'; -import { CTDTreeMessengerType, CTDTreeWebviewContext } from './components/tree/types'; import { getFilePath } from './fileUtils'; import { Commands } from './manifest'; -import { PeripheralBaseNode } from './plugin/peripheral/nodes'; -import { PeripheralConfigurationProvider } from './plugin/peripheral/tree/peripheral-configuration-provider'; -import { PeripheralDataTracker } from './plugin/peripheral/tree/peripheral-data-tracker'; -import { PeripheralsTreeTableWebView } from './plugin/peripheral/webview/peripheral-tree-webview-main'; +import { PeripheralBaseNode } from './model/peripheral/nodes'; +import { PeripheralConfigurationProvider } from './model/peripheral/tree/peripheral-configuration-provider'; +import { PeripheralDataTracker } from './model/peripheral/tree/peripheral-data-tracker'; +import { PeripheralsTreeTableWebView } from './views/peripheral/peripheral-view-provider'; export class PeripheralCommands { public constructor( @@ -98,7 +98,7 @@ export class PeripheralCommands { this.dataTracker.collapseAll(); } - private async peripheralsSetFormat(context: PeripheralBaseNode | CTDTreeWebviewContext): Promise { + private async peripheralsSetFormat(context: PeripheralBaseNode | CDTTreeWebviewContext): Promise { const result = await vscode.window.showQuickPick([ { label: 'Auto', description: 'Automatically choose format (Inherits from parent)', value: NumberFormat.Auto }, { label: 'Hex', description: 'Format value in hexadecimal', value: NumberFormat.Hexadecimal }, @@ -110,7 +110,7 @@ export class PeripheralCommands { } let node: PeripheralBaseNode; - if (CTDTreeWebviewContext.is(context)) { + if (CDTTreeWebviewContext.is(context)) { node = this.dataTracker.getNodeByPath(context.cdtTreeItemId.split(PERIPHERAL_ID_SEP)); } else { node = context; @@ -121,7 +121,7 @@ export class PeripheralCommands { } private async find(): Promise { - this.webview.sendNotification(CTDTreeMessengerType.openSearch); + this.webview.sendNotification(CDTTreeMessengerType.openSearch); } private async peripheralsForceRefresh(node?: PeripheralBaseNode): Promise { @@ -141,7 +141,7 @@ export class PeripheralCommands { this.dataTracker.togglePin(node); } - private ignorePeripheral(context: CTDTreeWebviewContext): void { + private ignorePeripheral(context: CDTTreeWebviewContext): void { const node = this.dataTracker.getNodeByPath(context.cdtTreeItemId.split(PERIPHERAL_ID_SEP)); if (node.name) { this.config.addIgnorePeripherals(node.name); @@ -152,11 +152,11 @@ export class PeripheralCommands { this.config.setIgnorePeripherals(); } - private periodicRefreshMode(_context?: CTDTreeWebviewContext): void { + private periodicRefreshMode(_context?: CDTTreeWebviewContext): void { this.config.queryPeriodicRefreshMode(); } - private periodicRefreshInterval(_context?: CTDTreeWebviewContext): void { + private periodicRefreshInterval(_context?: CDTTreeWebviewContext): void { this.config.queryPeriodicRefreshInterval(); } } diff --git a/src/common/index.ts b/src/common/index.ts index 34c2f47..a81201d 100644 --- a/src/common/index.ts +++ b/src/common/index.ts @@ -9,5 +9,4 @@ export * from './format'; export * from './notification'; export * from './peripheral-sort'; export * from './peripheral-dto'; -export * from './utils'; export * from './vscode'; diff --git a/src/common/peripheral-dto.ts b/src/common/peripheral-dto.ts index 18ca064..5624fc8 100644 --- a/src/common/peripheral-dto.ts +++ b/src/common/peripheral-dto.ts @@ -5,9 +5,9 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ +import { hasProperty } from '@eclipse-cdt-cloud/vscode-ui-components'; import { ClusterOptions, FieldOptions, PeripheralOptions, PeripheralRegisterOptions } from '../api-types'; import { NumberFormat } from './format'; -import { hasProperty } from './utils'; // ==== PeripheralBaseTreeNode ==== diff --git a/src/common/utils.ts b/src/common/utils.ts deleted file mode 100644 index f43f45e..0000000 --- a/src/common/utils.ts +++ /dev/null @@ -1,28 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -/** - * Finds a nested value from an object using a dot-separated path. - */ -export function findNestedValue( - // eslint-disable-next-line @typescript-eslint/no-explicit-any - obj: Record, - path: string | string[], -): T | undefined { - const keys = Array.isArray(path) ? path : path.split('.'); - return keys.reduce((acc, key) => acc?.[key], obj) as T | undefined; -} - -/** - * Check if an object has a property. - */ -export function hasProperty(object: object, ...keys: (keyof TKey)[]): object is TKey { - return keys.every(key => key in object); -} - -export type WithRequired = T & { [P in K]-?: T[P] } -export type MaybePromise = T | Promise diff --git a/src/common/vscode.ts b/src/common/vscode.ts index 5d3c93d..dc7f7a3 100644 --- a/src/common/vscode.ts +++ b/src/common/vscode.ts @@ -7,32 +7,9 @@ import { NumberFormat } from './format'; -export interface VSCodeContext { - 'data-vscode-context': string; -} - -export namespace VSCodeContext { - export function create(context: object): VSCodeContext { - return { - 'data-vscode-context': JSON.stringify({ - ...context, - }) - }; - } -} - export interface NodeSetting { node: string; expanded?: boolean; format?: NumberFormat; pinned?: boolean; } - -/** - * A command definition that is manually inserted into the DOM and not by VSCode. - */ -export interface CommandDefinition { - commandId: string; - icon: string; - title?: string; -} diff --git a/src/components/tooltip/tooltip.css b/src/components/tooltip/tooltip.css deleted file mode 100644 index cb594bb..0000000 --- a/src/components/tooltip/tooltip.css +++ /dev/null @@ -1,27 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -.tooltip { - background: var(--vscode-editorHoverWidget-background); - border: 1px solid var(--vscode-editorHoverWidget-border); - border-radius: 3px; - box-shadow: 0 2px 8px var(--vscode-widget-shadow); - max-width: 700px; - max-height: 375px; - padding: 0; -} - -.tooltip .tooltip-content { - background: var(--vscode-editorHoverWidget-background); - color: var(--vscode-editorHoverWidget-foreground); - font-size: 12px; - padding: 2px 8px; - max-width: var(--vscode-hover-maxWidth, 500px); - word-wrap: break-word; - display: block; - flex-direction: column; -} diff --git a/src/components/tooltip/tooltip.tsx b/src/components/tooltip/tooltip.tsx deleted file mode 100644 index 04b46cb..0000000 --- a/src/components/tooltip/tooltip.tsx +++ /dev/null @@ -1,158 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ -import type { Placement } from '@floating-ui/react'; -import { - FloatingPortal, - autoUpdate, - offset, - shift, - useDismiss, - useFloating, - useFocus, - useHover, - useInteractions, - useMergeRefs, - useRole -} from '@floating-ui/react'; -import * as React from 'react'; - -import './tooltip.css'; - -// https://floating-ui.com/docs/tooltip - -interface TooltipOptions { - initialOpen?: boolean; - placement?: Placement; - onOpenChange?: (open: boolean) => void; -} -type ContextType = ReturnType | null; -const TooltipContext = React.createContext(null); - -function useTooltip({ - initialOpen = false, - placement = 'bottom', -}: TooltipOptions = {}) { - const [open, setOpen] = React.useState(initialOpen); - - const floating = useFloating({ - placement, - open, - transform: false, - onOpenChange: setOpen, - whileElementsMounted: autoUpdate, - middleware: [ - offset(5), - shift({ padding: 5 }) - ] - }); - const context = floating.context; - - const hover = useHover(context, { - move: false, - restMs: 600, - delay: { - open: 1000 - } - }); - const focus = useFocus(context); - const dismiss = useDismiss(context); - const role = useRole(context, { role: 'tooltip' }); - - const interactions = useInteractions([hover, focus, dismiss, role]); - - return React.useMemo( - () => ({ - open, - setOpen, - ...interactions, - ...floating - }), - [open, setOpen, interactions, floating] - ); -} - -const useTooltipContext = () => { - const context = React.useContext(TooltipContext); - - if (context == null) { - throw new Error('Tooltip components must be wrapped in '); - } - - return context; -}; - -export function Tooltip({ - children, - ...options -}: { children: React.ReactNode } & TooltipOptions) { - // This can accept any props as options, e.g. `placement`, - // or other positioning options. - const tooltip = useTooltip(options); - return ( - - {children} - - ); -} - -export const TooltipTrigger = React.forwardRef< - HTMLElement, - React.HTMLProps & { asChild?: boolean } ->(function TooltipTrigger({ children, asChild = true, ...props }, propRef) { - const context = useTooltipContext(); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const childrenRef = (children as any).ref; - const ref = useMergeRefs([context.refs.setReference, propRef, childrenRef]); - - // `asChild` allows the user to pass any element as the anchor - if (asChild && React.isValidElement(children)) { - return React.cloneElement( - children, - context.getReferenceProps({ - ref, - ...props, - ...children.props, - 'data-tooltip-state': context.open ? 'open' : 'closed' - }) - ); - } - - return ( -
- {children} -
- ); -}); - -export const TooltipContent = React.forwardRef< - HTMLDivElement, - React.HTMLProps ->(function TooltipContent({ style, ...props }, propRef) { - const context = useTooltipContext(); - const ref = useMergeRefs([context.refs.setFloating, propRef]); - - if (!context.open) return null; - - return ( - -
-
-
- - ); -}); diff --git a/src/components/tree/components/cells/ActionCell.tsx b/src/components/tree/components/cells/ActionCell.tsx deleted file mode 100644 index 7f87fbf..0000000 --- a/src/components/tree/components/cells/ActionCell.tsx +++ /dev/null @@ -1,37 +0,0 @@ -import React from 'react'; -import { CDTTreeTableActionColumn, CDTTreeItem, CDTTreeTableActionColumnCommand, CDTTreeItemResource } from '../../types'; -import { CommandDefinition } from '../../../../common'; - -export interface ActionCellProps { - column: CDTTreeTableActionColumn; - record: CDTTreeItem; - actions: CDTTreeTableActionColumnCommand[]; - onAction?: (event: React.UIEvent, command: CommandDefinition, value: unknown, record: CDTTreeItem) => void; -} - -const ActionCell = ({ record, actions, onAction }: ActionCellProps) => { - return ( -
- {actions.map((action) => { - const handleAction = (e: React.MouseEvent | React.KeyboardEvent) => { - e.stopPropagation(); - e.preventDefault(); - onAction?.(e, action, action.value, record); - }; - return ( - e.key === 'Enter' && handleAction(e)} - /> - ); - })} -
- ); -}; - -export default ActionCell; diff --git a/src/components/tree/components/cells/EditableStringCell.tsx b/src/components/tree/components/cells/EditableStringCell.tsx deleted file mode 100644 index eb70f63..0000000 --- a/src/components/tree/components/cells/EditableStringCell.tsx +++ /dev/null @@ -1,148 +0,0 @@ -import './editable-string-cell.css'; - -import { Checkbox, Input, Select } from 'antd'; -import type { CheckboxChangeEvent } from 'antd/lib/checkbox'; -import React, { useCallback, useEffect, useRef } from 'react'; -import { CDTTreeItem, CDTTreeItemResource, EditableCDTTreeTableStringColumn } from '../../types'; -import LabelCell from './LabelCell'; - -interface EditableLabelCellProps { - column: EditableCDTTreeTableStringColumn; - record: CDTTreeItem; - editing: boolean; - autoFocus: boolean; - onSubmit: (newValue: string) => void; - onCancel: () => void; - onEdit?: (edit: boolean) => void; -} - -const EditableLabelCell = ({ - column, - record, - editing, - autoFocus, - onSubmit, - onCancel, - onEdit -}: EditableLabelCellProps) => { - const containerRef = useRef(null); - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const editorRef = useRef(null); - - const commitEdit = useCallback((newValue: string, event?: { stopPropagation: () => void; preventDefault: () => void; }) => { - event?.stopPropagation(); - event?.preventDefault(); - onSubmit(newValue); - onEdit?.(false); - }, [onSubmit]); - - const cancelEdit = useCallback(() => { - onCancel(); - onEdit?.(false); - }, [column.edit.value, onCancel, onEdit]); - - // Cancel the edit only if focus leaves the entire container. - const handleBlur = useCallback(() => { - setTimeout(() => { - if ( - containerRef.current && - document.activeElement && - !containerRef.current.contains(document.activeElement) - ) { - cancelEdit(); - } - }, 0); - }, [cancelEdit]); - - const handleKeyDown = useCallback( - (e: React.KeyboardEvent) => { - if (e.key === 'Escape') { - cancelEdit(); - } - e.stopPropagation(); - }, - [cancelEdit] - ); - - // Consume the double-click event so no other handler is triggered. - const handleDoubleClick = useCallback((e: React.MouseEvent) => { - e.preventDefault(); - e.stopPropagation(); - onEdit?.(true); - }, [column, onEdit]); - - // Focus the editor when entering edit mode. - useEffect(() => { - if (editing && editorRef.current && autoFocus) { - editorRef.current.focus(); - } - }, [editing, autoFocus]); - - if (editing) { - return ( -
- {(() => { - switch (column.edit.type) { - case 'text': - return ( - commitEdit(e.currentTarget.value, e)} - onBlur={handleBlur} - onClick={e => e.stopPropagation()} - onKeyDown={handleKeyDown} - /> - ); - case 'boolean': { - const checked = column.edit.value === '1'; - return ( - commitEdit(e.target.checked ? '1' : '0', e)} - onBlur={handleBlur} - onClick={e => e.stopPropagation()} - onKeyDown={handleKeyDown} - /> - ); - } - case 'enum': { - return ( - - ); - } - default: - return null; - } - })()} -
- ); - } - - return ( -
- -
- ); -}; - -export default React.memo(EditableLabelCell); diff --git a/src/components/tree/components/cells/LabelCell.tsx b/src/components/tree/components/cells/LabelCell.tsx deleted file mode 100644 index 8651a2f..0000000 --- a/src/components/tree/components/cells/LabelCell.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import React from 'react'; -import classNames from 'classnames'; -import { CDTTreeTableStringColumn, CDTTreeItem, CDTTreeItemResource } from '../../types'; -import { createLabelWithTooltip, createHighlightedText } from '../utils'; - -export interface LabelCellProps { - column: CDTTreeTableStringColumn; - record: CDTTreeItem; -} - -const LabelCell = ({ column }: LabelCellProps) => { - const icon = column.icon && ; - - const content = column.tooltip - ? createLabelWithTooltip({createHighlightedText(column.label, column.highlight)}, column.tooltip) - : createHighlightedText(column.label, column.highlight); - - return ( -
- {icon} - {content} -
- ); -}; - -export default React.memo(LabelCell); diff --git a/src/components/tree/components/cells/StringCell.tsx b/src/components/tree/components/cells/StringCell.tsx deleted file mode 100644 index 7bcbff7..0000000 --- a/src/components/tree/components/cells/StringCell.tsx +++ /dev/null @@ -1,38 +0,0 @@ -import React, { useCallback } from 'react'; -import { CDTTreeItem, CDTTreeItemResource, CDTTreeTableStringColumn, EditableCDTTreeTableStringColumn } from '../../types'; -import EditableStringCell from './EditableStringCell'; -import LabelCell from './LabelCell'; - -interface StringCellProps { - column: CDTTreeTableStringColumn; - record: CDTTreeItem; - editing?: boolean; - autoFocus?: boolean; - onSubmit?: (record: CDTTreeItem, newValue: string) => void; - onCancel?: (record: CDTTreeItem) => void; - onEdit?: (record: CDTTreeItem, edit: boolean) => void; -} - -const StringCell = ({ column, record, editing = false, autoFocus = false, onSubmit, onCancel, onEdit }: StringCellProps) => { - const handleSubmit = useCallback( - (newValue: string) => onSubmit?.(record, newValue), - [record, onSubmit] - ); - - const handleCancel = useCallback( - () => onCancel?.(record), - [record, onCancel] - ); - - const handleEdit = useCallback( - (edit: boolean) => onEdit?.(record, edit), - [record, onEdit] - ); - - - return column.edit && onSubmit - ? - : ; -}; - -export default StringCell; diff --git a/src/components/tree/components/cells/editable-string-cell.css b/src/components/tree/components/cells/editable-string-cell.css deleted file mode 100644 index 9ffbdb1..0000000 --- a/src/components/tree/components/cells/editable-string-cell.css +++ /dev/null @@ -1,117 +0,0 @@ -/********************************************************************* - * Copyright (c) 2024 Arm Limited and others - * - * This program and the accompanying materials are made - * available under the terms of the Eclipse Public License 2.0 - * which is available at https://www.eclipse.org/legal/epl-2.0/ - * - * SPDX-License-Identifier: EPL-2.0 - *********************************************************************/ - -.ant-input.text-field-cell { - background: var(--ant-color-bg-container); - color: var(--ant-color-text); - font-family: var(--ant-font-family-code); - font-size: var(--ant-table-cell-font-size); - line-height: var(--ant-line-height); - padding: 1px; - padding-left: 3px; - border-radius: 0; - border-style: dotted; -} - -.css-var-r0.ant-select-css-var { - --ant-control-height: auto; - --ant-color-text-placeholder: var(--vscode-sideBar-foreground); - --ant-select-show-arrow-padding-inline-end: 2em; - --ant-border-radius-sm: 0; - --ant-border-radius-lg: 0; - --ant-select-option-active-bg: var(--vscode-list-hoverBackground); - --ant-select-option-font-size: 12px; - --ant-select-option-selected-bg: var(--vscode-list-inactiveSelectionBackground); - --ant-select-option-selected-color: var(--vscode-sideBar-foreground); - --ant-select-option-height: auto; - --ant-select-option-padding: 3px 6px; -} - -.enum-field-cell.ant-select-outlined:not(.ant-select-customize-input) .ant-select-selector { - background: var(--ant-color-bg-container); - color: var(--ant-color-text); - font-family: var(--ant-font-family-code); - font-size: var(--ant-table-cell-font-size); - line-height: var(--ant-line-height); - padding: 1px; - padding-left: 3px; - border-radius: 0; - border-style: dotted; -} - -.ant-select-dropdown { - background: var(--ant-color-bg-container); - color: var(--ant-color-text); - font-family: var(--ant-font-family-code); - font-size: var(--ant-table-cell-font-size); - line-height: var(--ant-line-height); - padding: 1px; - padding-left: 3px; -} - -.enum-field-cell.ant-select-outlined:not(.ant-select-customize-input) .ant-select-arrow { - color: var(--ant-color-text); -} - -.editable-string-cell { - cursor: pointer; - display: contents; -} - -.editable-string-cell .tree-label>span>span { - border-bottom: 1px dotted; -} - -.edit-field-container, -.editable-string-cell { - font-family: var(--ant-font-family-code); - font-style: normal; - filter: unset; - opacity: 1; -} - -.ant-table-cell.value>.tree-cell { - font-family: var(--ant-font-family-code); - opacity: 0.8; -} - -.edit-field-container { - display: contents; - flex-grow: 1; -} - -.edit-field-container>* { - flex-grow: 1; -} - -.edit-field-container .ant-select { - display: contents; - --ant-font-size-icon: 10px; -} - -.ant-table-cell.value .tree-cell, -.ant-table-cell.value .ant-checkbox-wrapper { - padding-left: 4px; -} - -.ant-select-selector::before { - content: ''; - position: absolute; - bottom: 0; - left: 4px; - /* Indent from the left */ - width: calc(100% - 4px); - /* Make the dotted border span the remaining width */ - border-bottom: 1px dotted; -} - -.ant-select-selector { - border: 0 !important; -} \ No newline at end of file diff --git a/src/components/tree/components/common.css b/src/components/tree/components/common.css deleted file mode 100644 index 7ca2743..0000000 --- a/src/components/tree/components/common.css +++ /dev/null @@ -1,48 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -.tree-label { - overflow: hidden; - text-overflow: ellipsis; - white-space: pre; -} - -.tree-label > span { - overflow: hidden; - text-overflow: ellipsis; - white-space: pre; -} - -.label-highlight { - background-color: var(--vscode-list-filterMatchBackground); - color: unset; - outline: 1px dotted var(--vscode-list-filterMatchBorder); - outline-offset: -1px; -} - -.tree-toggler-container { - width: 1rem; - margin-right: 6px; - cursor: pointer; - padding-top: 3px; -} - -.tree-actions { - display: none; - flex: 1; - justify-content: end; -} - -.tree-actions .codicon { - padding: 2px; - border-radius: 5px; - font-size: var(--vscode-font-size); -} - -.tree-actions .codicon:hover { - background: var(--vscode-toolbar-hoverBackground); -} diff --git a/src/components/tree/components/expand-icon.tsx b/src/components/tree/components/expand-icon.tsx deleted file mode 100644 index ae71aba..0000000 --- a/src/components/tree/components/expand-icon.tsx +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ -import { CDTTreeItem, CDTTreeItemResource } from '../types'; -import { classNames } from './utils'; -import React from 'react'; - -export interface RenderExpandIconProps { - prefixCls: string; - expanded: boolean; - record: RecordType; - expandable: boolean; - onExpand: TriggerEventHandler; -} - -export type TriggerEventHandler = (record: RecordType, event: React.MouseEvent) => void; - -export function ExpandIcon({ expanded, onExpand, record, expandable }: RenderExpandIconProps>): React.ReactElement { - if (!expandable) { - // simulate spacing to the left that we gain through expand icon so that leaf items look correctly intended - return ; - } - - const doExpand = (event: React.MouseEvent) => { - event.stopPropagation(); - onExpand(record, event); - }; - - const iconClass = expanded ? 'codicon-chevron-down' : 'codicon-chevron-right'; - return ( -
{ if (event.key === 'Enter' || event.key === ' ') doExpand(event as unknown as React.MouseEvent); }} - >
- ); -} diff --git a/src/components/tree/components/search-overlay.tsx b/src/components/tree/components/search-overlay.tsx deleted file mode 100644 index abb614e..0000000 --- a/src/components/tree/components/search-overlay.tsx +++ /dev/null @@ -1,88 +0,0 @@ -/********************************************************************* - * Copyright (c) 2024 Arm Limited and others - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import { VSCodeButton } from '@vscode/webview-ui-toolkit/react'; -import React from 'react'; -import './search.css'; - -export interface SearchOverlayProps { - onChange?: (text: string) => void; - onShow?: () => void; - onHide?: () => void; -} - -export interface SearchOverlay { - input: () => HTMLInputElement | null; - focus: () => void; - value(): string; - setValue: (value: string) => void; - show: () => void; - hide: () => void; -} - -export const SearchOverlay = React.forwardRef((props, ref) => { - const [showSearch, setShowSearch] = React.useState(false); - const searchTextRef = React.useRef(null); - const previousFocusedElementRef = React.useRef(null); - - const show = () => { - previousFocusedElementRef.current = document.activeElement as HTMLElement; - setShowSearch(true); - setTimeout(() => searchTextRef.current?.select(), 100); - props.onShow?.(); - }; - - const hide = () => { - setShowSearch(false); - props.onHide?.(); - if (previousFocusedElementRef.current) { - previousFocusedElementRef.current.focus(); - } - }; - - const onTextChange = (e: React.ChangeEvent) => { - const value = e.target.value; - props.onChange?.(value); - }; - - const onKeyDown = (e: React.KeyboardEvent) => { - if (e.ctrlKey && e.key === 'f') { - e.preventDefault(); - e.stopPropagation(); - show(); - } else if (e.key === 'Escape') { - e.preventDefault(); - e.stopPropagation(); - hide(); - } - }; - - const onFocus = (e: React.FocusEvent) => { - if (e.relatedTarget) { - previousFocusedElementRef.current = e.relatedTarget as HTMLElement; - } - }; - - React.useImperativeHandle(ref, () => ({ - input: () => searchTextRef.current, - focus: () => searchTextRef.current?.focus(), - value: () => searchTextRef.current?.value ?? '', - setValue: (newValue: string) => { - if (searchTextRef.current) { - searchTextRef.current.value = newValue; - } - }, - show: () => show(), - hide: () => hide() - })); - - return (
- - hide()} /> -
- ); -}); diff --git a/src/components/tree/components/search.css b/src/components/tree/components/search.css deleted file mode 100644 index b804d0a..0000000 --- a/src/components/tree/components/search.css +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -.search-overlay { - position: fixed; - top: -33px; - opacity: 0; - right: 20px; - background-color: var(--vscode-editorWidget-background); - box-shadow: 0 0 4px 1px var(--vscode-widget-shadow); - color: var(--vscode-editorWidget-foreground); - border-bottom: 1px solid var(--vscode-widget-border); - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - border-left: 1px solid var(--vscode-widget-border); - border-right: 1px solid var(--vscode-widget-border); - box-sizing: border-box; - height: 33px; - line-height: 19px; - overflow: hidden; - padding: 4px; - z-index: 35; - display: flex; - flex-direction: row; - gap: 5px; - - -webkit-transition: top 0.2s ease, opacity 0.2s ease; - -moz-transition: top 0.2s ease, opacity 0.2s ease; - -ms-transition: top 0.2s ease, opacity 0.2s ease; - -o-transition: top 0.2s ease, opacity 0.2s ease; - transition: top 0.2s ease, opacity 0.2s ease; -} - -.search-overlay.visible { - top: 5px; - opacity: 1; -} - -body.has-scrollbar .search-overlay { - right: 5px; -} - -.search-overlay .search-input { - color: var(--vscode-input-foreground); - background-color: var(--vscode-input-background); - outline: none; - scrollbar-width: none; - border: none; - box-sizing: border-box; - display: inline-block; - font-family: inherit; - font-size: inherit; - height: 100%; - line-height: inherit; - resize: none; - width: 100%; - padding: 4px 6px; - margin: 0; -} - -.search-overlay input.search-input:focus { - outline: 1px solid var(--vscode-focusBorder) -} - - -.search-input::placeholder { - color: var(--vscode-input-placeholderForeground); -} - -.search-input::-moz-placeholder { - color: var(--vscode-input-placeholderForeground); -} - -.search-input:-ms-input-placeholder { - color: var(--vscode-input-placeholderForeground); -} - -.search-input:-webkit-input-placeholder { - color: var(--vscode-input-placeholderForeground); -} \ No newline at end of file diff --git a/src/components/tree/components/treetable-navigator.tsx b/src/components/tree/components/treetable-navigator.tsx deleted file mode 100644 index 89f7b86..0000000 --- a/src/components/tree/components/treetable-navigator.tsx +++ /dev/null @@ -1,171 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ -import { CDTTreeItem, CDTTreeItemResource } from '../types'; - -export interface TreeNavigatorProps { - ref: React.RefObject; - rowIndex: Map; - expandedRowKeys: string[]; - expand: (expanded: boolean, record: CDTTreeItem) => void; - select: (record: CDTTreeItem) => void; -} - -/** - * TreeNavigator is a helper class to navigate - * through a tree table. - */ -export class TreeNavigator { - constructor(private readonly props: TreeNavigatorProps) { - } - - next(node: CDTTreeItem) { - if (node.children && node.children.length > 0 && this.props.expandedRowKeys.includes(node.id)) { - // Go deeper - this.select(node.children[0]); - } else { - let nextNode = this.getNext(node); - if (nextNode) { - this.select(nextNode); - } else { - // Go to parent sibling recursively - nextNode = this.getParentNext(node.parent); - if (nextNode) { - this.select(nextNode); - } - } - } - } - - nextPage() { - this.scrollRelative(this.visibleDomElementCount); - } - - private getSiblings(node: CDTTreeItem): CDTTreeItem[] { - return node.parent?.children?.filter(child => this.props.rowIndex.has(child.id)) ?? []; - } - - private getNext(node: CDTTreeItem): CDTTreeItem | undefined { - const siblings = this.getSiblings(node); - const index = siblings.findIndex(n => n.id === node.id); - return siblings[index + 1]; - } - - private getParentNext(node: CDTTreeItem | undefined): CDTTreeItem | undefined { - if (!node) return undefined; - const nextSibling = this.getNext(node); - if (nextSibling) { - return nextSibling; - } else { - return this.getParentNext(node.parent); - } - } - - previous(node: CDTTreeItem) { - let prevNode = this.getPrevious(node); - if (prevNode) { - // Go deeper to the last child if the previous node has children and is expanded - while (prevNode.children && prevNode.children.length > 0 && this.props.expandedRowKeys.includes(prevNode.id)) { - prevNode = prevNode.children[prevNode.children.length - 1]; - } - this.select(prevNode); - } else { - const parent = node.parent; - // Go to parent if no previous sibling - if (parent && !CDTTreeItem.isRoot(parent)) { - this.select(parent); - } - } - } - - previousPage() { - this.scrollRelative(-(this.visibleDomElementCount - 1)); - } - - private getPrevious(node: CDTTreeItem): CDTTreeItem | undefined { - const siblings = this.getSiblings(node); - const index = siblings.findIndex(n => n.id === node.id); - return siblings[index - 1]; - } - - toggle(node: CDTTreeItem) { - if (this.props.expandedRowKeys.includes(node.id)) { - this.collapse(node); - } else { - this.expand(node); - } - } - - expand(node: CDTTreeItem) { - if (node.children && node.children.length > 0) { - if (this.props.expandedRowKeys.includes(node.id)) { - this.next(node); - } else { - this.props.expand(true, node as CDTTreeItem); - } - } - } - - collapse(node: CDTTreeItem) { - if (node.children && node.children.length > 0 && this.props.expandedRowKeys.includes(node.id)) { - this.props.expand(false, node as CDTTreeItem); - } else if (node.parent && !CDTTreeItem.isRoot(node.parent)) { - this.select(node.parent, 'absolute'); - } - } - - private select(node: CDTTreeItem, scrollMode: 'relative' | 'absolute' = 'absolute') { - // Virtual scrolling may have hidden the node - if (!this.isDomVisible(node)) { - if (scrollMode === 'absolute') { - this.scrollAbsolute(node); - this.props.select(node as CDTTreeItem); - } else { - this.scrollRelative(-(this.visibleDomElementCount / 2)); - } - - this.props.select(node as CDTTreeItem); - // Allow the DOM to update before focusing - setTimeout(() => this.getDomElement(node)?.focus(), 100); - } else { - this.props.select(node as CDTTreeItem); - this.getDomElement(node)?.focus(); - } - - this.getDomElement(node)?.addEventListener; - } - - // ==== DOM ==== - - private scrollRelative(count = this.visibleDomElementCount) { - const rowHeight = this.props.ref.current?.querySelector('.ant-table-row')?.clientHeight ?? 22; - const body = this.props.ref.current?.querySelector('.ant-table-tbody-virtual-holder'); - if (body) { - body.scrollTop = Math.max(body.scrollTop + count * rowHeight, 0); - } - } - - private scrollAbsolute(node: CDTTreeItem) { - const rowHeight = this.props.ref.current?.querySelector('.ant-table-row')?.clientHeight ?? 22; - const body = this.props.ref.current?.querySelector('.ant-table-tbody-virtual-holder'); - if (body) { - const index = this.props.rowIndex.get(node.id) ?? 1; - body.scrollTop = Math.max(index * rowHeight, 0); - } - } - - private getDomElement(record: CDTTreeItem) { - return this.props.ref.current?.querySelector(`[data-row-key="${record.key}"]`); - } - - private isDomVisible(record: CDTTreeItem) { - return !!this.getDomElement(record); - } - - private get visibleDomElementCount() { - return this.props.ref.current?.querySelectorAll('.ant-table-row').length ?? 1; - } -} diff --git a/src/components/tree/components/treetable.css b/src/components/tree/components/treetable.css deleted file mode 100644 index 0a78f8b..0000000 --- a/src/components/tree/components/treetable.css +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -/* AntD Table Variables */ - -.css-var-r0 { - --ant-font-family: var(--vscode-font-family); - --ant-color-text: var(--vscode-sideBar-foreground); - --ant-color-bg-container: var(--vscode-sideBar-background); -} - -.ant-table-tbody-virtual-scrollbar-thumb { - background: var(--vscode-scrollbarSlider-background) !important; -} - -.ant-table.ant-table-css-var { - --ant-table-row-selected-bg: var(--vscode-list-inactiveSelectionBackground); - --ant-table-row-selected-hover-bg: var( - --vscode-list-inactiveSelectionBackground - ); - --ant-table-row-hover-bg: var(--vscode-list-hoverBackground); - --ant-table-border-color: var(--vscode-sideBar-background); - --ant-table-cell-font-size: var(--vscode-font-size); - --ant-table-cell-padding-block: 0; - --ant-table-cell-padding-inline: 4px; -} - -.ant-table:focus-within { - --ant-table-row-selected-bg: var(--vscode-list-activeSelectionBackground); - --ant-table-row-selected-hover-bg: var( - --vscode-list-activeSelectionBackground - ); -} - -.ant-table .ant-table-row { - border: 1px solid transparent; - outline: none; - height: 22px; - cursor: pointer; -} - -.ant-table:focus-within .ant-table-row.ant-table-row-selected { - border-color: var( - --vscode-list-focusAndSelectionOutline, - var(--vscode-contrastActiveBorder, var(--vscode-list-focusOutline)) - ); -} - -.ant-table .ant-table-row .ant-table-cell { - display: flex; - transition: none; - border-bottom: none; -} - -.ant-table .ant-table-row .ant-table-cell .cell-icon { - margin-right: 4px; - padding-top: 4px; - font-size: var(--vscode-font-size); -} - -.ant-table .ant-table-row .ant-table-cell .tree-cell { - display: flex; -} - -.ant-table .ant-table-row:hover .tree-actions, -.ant-table .ant-table-row:focus .tree-actions { - display: flex; - align-items: center; -} - -.ant-table .tree-actions { - padding-right: 8px; -} - -.ant-table .tree-actions > i { - cursor: pointer; -} - -.ant-table .leaf-item-spacer { - display: inline-block; - width: 16px; -} - -.ant-table-empty .empty-message { - display: inline-block; - padding-top: 4em; - color: var(--vscode-editor-foreground); -} - -.ant-table-empty .ant-table-body { - overflow: hidden !important; -} - -/* The horizontal scrollbar is not necessary */ -.ant-table .ant-table-tbody-virtual-scrollbar-horizontal { - display: none; -} - -.ant-table .resizable-handle { - border-left: var(--vscode-sideBarSectionHeader-border) 2px solid; -} - -.ant-table .resizable-handle:hover, -.ant-table .resizable-handle:active { - border-color: var(--vscode-sash-hoverBorder); -} - -.ant-table .ant-table-row.ant-table-row-resizing .tree-actions { - display: none; -} diff --git a/src/components/tree/components/treetable.tsx b/src/components/tree/components/treetable.tsx deleted file mode 100644 index 4c9ec10..0000000 --- a/src/components/tree/components/treetable.tsx +++ /dev/null @@ -1,602 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import './common.css'; -import './treetable.css'; - -import { ConfigProvider, Table } from 'antd'; -import { ColumnType, ExpandableConfig } from 'antd/es/table/interface'; -import { Resizable } from 're-resizable'; -import { default as React, useCallback, useEffect, useLayoutEffect, useMemo, useState } from 'react'; -import { debounce } from 'throttle-debounce'; -import { CommandDefinition, findNestedValue } from '../../../common'; -import { Commands } from '../../../manifest'; -import { CDTTreeItem, CDTTreeItemResource, CDTTreeTableActionColumn, CDTTreeTableActionColumnCommand, CDTTreeTableColumnDefinition, CDTTreeTableStringColumn, CTDTreeWebviewContext } from '../types'; -import ActionCell from './cells/ActionCell'; -import StringCell from './cells/StringCell'; -import { ExpandIcon } from './expand-icon'; -import { SearchOverlay } from './search-overlay'; -import { TreeNavigator } from './treetable-navigator'; -import { classNames, filterTree, getAncestors, traverseTree, useClickHook } from './utils'; - -const COLUMN_MIN_WIDTH = 50; -const ACTION_COLUMN_WIDTH = 16 * 5; - -/** - * Component to render a tree table. - */ -export type ComponentTreeTableProps = { - /** - * Information about the columns to be rendered. - */ - columnDefinitions?: CDTTreeTableColumnDefinition[]; - /** - * Data source to be rendered. - */ - dataSource?: CDTTreeItem[]; - /** - * Function to sort the data source. - */ - dataSourceSorter?: (dataSource: CDTTreeItem[]) => CDTTreeItem[]; - /** - * Configuration for the expansion of the tree table. - */ - expansion?: { - /** - * List of expanded row keys. - */ - expandedRowKeys?: string[]; - /** - * Callback to be called when a row is expanded or collapsed. - */ - onExpand?: ExpandableConfig>['onExpand']; - }, - /** - * Configuration for the pinning of the tree table. - */ - pin?: { - /** - * List of pinned row keys. - */ - pinnedRowKeys?: string[]; - /** - * Callback to be called when a row is pinned or unpinned. - */ - onPin?: (event: React.UIEvent, pinned: boolean, record: CDTTreeItem) => void; - }, - /** - * Configuration for the actions of the tree table. - */ - action?: { - /** - * Callback to be called when an action is triggered. - */ - onAction?: (event: React.UIEvent, command: CommandDefinition, value: unknown, record: CDTTreeItem) => void; - }, - edit?: { - /** - * Callback to be called when a row is edited. - */ - onEdit?: (record: CDTTreeItem, value: string) => void; - } -}; - -interface ResizeableCell { - resizeable?: boolean; - maxWidth?: number; - onDidColumnResize?: (event: MouseEvent | TouchEvent, width: number) => void; -} - -interface BodyRowProps extends React.HTMLAttributes { - 'data-row-key': string; - record: CDTTreeItem; -} - -const BodyRow = React.forwardRef((props, ref) => { - // Support VSCode context menu items - return ( -
- ); -}); - - -interface BodyCellProps extends React.HTMLAttributes, ResizeableCell { -} - -const BodyCell = React.forwardRef((props, ref) => { - const { resizeable, onDidColumnResize, maxWidth, className, onResize, style, ...rest } = props; - const [width, setWidth] = useState(props.style?.width); - - useEffect(() => { - if (resizeable) { - setWidth(props.style?.width); - } - }, [props.style?.width]); - - const cell =
; - - if (!resizeable) { - return cell; - } - - return ( - { - const row = ref.closest('.ant-table-row'); - row?.classList.add('ant-table-row-resizing'); - }} - onResize={(event, _direction, ref, _delta) => { - onDidColumnResize?.(event, ref.clientWidth); - - }} - onResizeStop={(event, _direction, ref, _delta) => { - onDidColumnResize?.(event, ref.clientWidth); - const row = ref.closest('.ant-table-row'); - row?.classList.remove('ant-table-row-resizing'); - }} - handleClasses={{ - right: 'resizable-handle', - }} - enable={{ - bottom: false, - bottomLeft: false, - bottomRight: false, - left: false, - right: true, - top: false, - topLeft: false, - topRight: false - }} - {...rest} - > - - ); -}); - -function useWindowSize() { - const [size, setSize] = useState({ width: window.innerWidth, height: window.innerHeight }); - useLayoutEffect(() => { - const updateSize = debounce(100, () => { - setSize({ width: window.innerWidth, height: window.innerHeight }); - }); - - window.addEventListener('resize', updateSize); - return () => { - window.removeEventListener('resize', updateSize); - updateSize.cancel(); - }; - }, []); - - return size; -} - -export const AntDComponentTreeTable = (props: ComponentTreeTableProps) => { - const { width, height } = useWindowSize(); - const [globalSearchText, setGlobalSearchText] = useState(); - const globalSearchRef = React.useRef(null); - const autoSelectRowRef = React.useRef(false); - - const ref = React.useRef(null); - const tblRef: Parameters[0]['ref'] = React.useRef(null); - - // ==== Data ==== - - const filteredData = useMemo(() => { - let data = props.dataSource ?? []; - if (globalSearchText) { - data = filterTree(data, globalSearchText); - } - if (props.dataSourceSorter) { - data = props.dataSourceSorter([...data]); - } - return data; - }, [props.dataSource, props.dataSourceSorter, globalSearchText]); - - // ==== Search ==== - - const onKeyDown = useCallback((e: React.KeyboardEvent) => { - if (e.ctrlKey && e.key === 'f') { - e.preventDefault(); - e.stopPropagation(); - globalSearchRef.current?.show(); - } - }, []); - - const onSearchShow = useCallback(() => setGlobalSearchText(globalSearchRef.current?.value()), []); - const onSearchHide = useCallback(() => { - setGlobalSearchText(undefined); - autoSelectRowRef.current = true; - }, [autoSelectRowRef]); - const onSearchChange = useMemo(() => debounce(300, (text: string) => setGlobalSearchText(text)), []); - - // ==== Selection ==== - - const [selection, setSelection] = useState(); - - const selectRow = useCallback((record: CDTTreeItem) => { - // Single select only - if (selection?.key !== record.key) { - setSelection(record); - } - }, [selection]); - - // ==== Expansion ==== - - const expandedRowKeys = useMemo(() => { - const expanded = new Set(props.expansion?.expandedRowKeys ?? []); - if (globalSearchText) { - // on search expand all nodes that match the search - const matchingExpansion = traverseTree(filteredData, { predicate: item => item.matching ?? false, mapper: getAncestors }); - matchingExpansion.forEach(ancestorHierarchy => ancestorHierarchy.forEach(ancestor => expanded.add(ancestor.key))); - } else { - // otherwise use the expandedRowKeys from the props but ensure that the selected element is also expanded - if (autoSelectRowRef.current && selection) { - getAncestors(selection).forEach(ancestor => expanded.add(ancestor.key)); - } - } - return Array.from(expanded); - }, [filteredData, globalSearchText, props.expansion?.expandedRowKeys, selection, autoSelectRowRef.current]); - - - const handleExpand = useCallback( - (expanded: boolean, record: CDTTreeItem) => { - props.expansion?.onExpand?.(expanded, record); - }, - [props.expansion?.onExpand] - ); - - // ==== Edit ==== - const [editRowKey, setEditRowKey] = useState(); - - // ==== Index ==== - - const dataSourceIndex = useMemo(() => { - const rowIndex = new Map(); - const keyIndex = new Map(); - - let currentIndex = 0; - - const traverse = (nodes: CDTTreeItem[]) => { - nodes.forEach(node => { - rowIndex.set(node.id, currentIndex++); - keyIndex.set(node.key, node); - - if (node.children && node.children.length > 0 && expandedRowKeys.includes(node.id)) { - traverse(node.children); - } - }); - }; - - traverse(filteredData ?? []); - return { - rowIndex, - keyIndex - }; - }, [filteredData, expandedRowKeys]); - - // ==== Navigation ==== - - const navigator = React.useMemo(() => new TreeNavigator({ - ref, - rowIndex: dataSourceIndex.rowIndex, - expandedRowKeys, - expand: handleExpand, - select: selectRow - }), [ref, dataSourceIndex.rowIndex, expandedRowKeys, handleExpand, selectRow]); - - const onTableKeyDown = useCallback((event: React.KeyboardEvent) => { - const selectedKey = selection?.key; - if (!selectedKey) { - return; - } - - const record = dataSourceIndex.keyIndex.get(selectedKey); - if (!record) { - return; - } - - switch (event.key) { - case 'ArrowDown': { - navigator.next(record); - break; - } - case 'ArrowUp': { - navigator.previous(record); - break; - } - case 'ArrowLeft': { - navigator.collapse(record); - break; - } - case 'ArrowRight': { - navigator.expand(record); - break; - } - case 'Enter': { - navigator.toggle(record); - break; - } - case ' ': { - navigator.toggle(record); - break; - } - case 'PageUp': { - navigator.previousPage(); - break; - } - case 'PageDown': { - navigator.nextPage(); - break; - } - } - }, [selection, dataSourceIndex]); - - - // ==== Columns ==== - const [columnWidths, setColumnWidths] = useState>({}); - const [prevWindowWidth, setPrevWindowWidth] = useState(width); - const availableWidth = useMemo(() => width - ACTION_COLUMN_WIDTH - COLUMN_MIN_WIDTH * (props.columnDefinitions?.filter(c => c.resizable).length ?? 0), [width, props.columnDefinitions]); - - const handleResize = (field: string) => - (_: MouseEvent | TouchEvent, width: number) => { - setColumnWidths((prev) => ({ ...prev, [field]: width })); - }; - - useEffect(() => { - const delta = width - prevWindowWidth; - if (delta < 0) { - // Shrink columns that are too wide - setColumnWidths((prev) => { - const newWidths = { ...prev }; - for (const key in newWidths) { - const currentWidth = newWidths[key]; - if (currentWidth > availableWidth) { - newWidths[key] = Math.max(currentWidth + delta, COLUMN_MIN_WIDTH); - } - } - return newWidths; - }); - } - setPrevWindowWidth(width); - }, [width]); - - const getActions = useCallback((record: CDTTreeItem, column: CDTTreeTableActionColumn) => { - const actions: CDTTreeTableActionColumnCommand[] = []; - if (record.pinned !== undefined) { - actions.push({ - commandId: record.pinned ? Commands.UNPIN_COMMAND.commandId : Commands.PIN_COMMAND.commandId, - title: record.pinned ? 'Unpin row' : 'Pin row', - icon: record.pinned ? 'pin' : 'pinned', - value: !record.pinned, - }); - } - actions.push(...column.commands); - return actions; - }, []); - - const onAction = useCallback((event: React.UIEvent, command: CommandDefinition, value: unknown, record: CDTTreeItem) => { - if (command.commandId === Commands.PIN_COMMAND.commandId || command.commandId === Commands.UNPIN_COMMAND.commandId) { - event.stopPropagation(); - return props.pin?.onPin?.(event, !record.pinned, record); - } - if (command.commandId === Commands.UPDATE_NODE_COMMAND.commandId) { - selectRow(record); - return setEditRowKey(record.key); - } - return props.action?.onAction?.(event, command, value, record); - }, [props.action, props.pin?.onPin]); - - const renderActionCell = useCallback((column: CDTTreeTableActionColumn | undefined, record: CDTTreeItem) => { - if (!column) { - return undefined; - } - - return ; - }, [props.pin, props.action]); - - const onSubmitEdit = useCallback((record: CDTTreeItem, value: string) => { - setEditRowKey(undefined); - props.edit?.onEdit?.(record, value); - }, [props.edit?.onEdit]); - - const onSubmitCancel = useCallback(() => { - setEditRowKey(undefined); - }, []); - - const onEdit = useCallback((record: CDTTreeItem, edit: boolean) => { - if (edit) { - selectRow(record); - setEditRowKey(record.key); - } else { - setEditRowKey(undefined); - } - }, []); - - const isEditing = useCallback((column: CDTTreeTableStringColumn, record: CDTTreeItem) => editRowKey === record.key || column.edit?.type === 'boolean' || column.edit?.type === 'enum', [editRowKey]); - - const renderStringCell = useCallback((column: CDTTreeTableStringColumn | undefined, record: CDTTreeItem) => { - if (!column) { - return undefined; - } - - return (); - }, [editRowKey]); - - const columns = useMemo(() => { - return props.columnDefinitions?.map>>(colDef => { - const resizeable: ResizeableCell = { - resizeable: colDef.resizable, - maxWidth: availableWidth, - onDidColumnResize: handleResize(colDef.field) - }; - - if (colDef.type === 'string') { - return { - title: colDef.field, - dataIndex: ['columns', colDef.field], - width: columnWidths[colDef.field] ?? 0, - ellipsis: true, - render: renderStringCell, - className: colDef.field, - onCell: (record) => { - const column = findNestedValue(record, ['columns', colDef.field]); - - return !column || !column.colSpan - ? { - ...resizeable, - } as React.HTMLAttributes & React.TdHTMLAttributes - : { - ...resizeable, - resizeable: column.colSpan !== 'fill', - colSpan: column.colSpan === 'fill' ? props.columnDefinitions?.length : column.colSpan, - style: { zIndex: 1 } - }; - } - }; - } - if (colDef.type === 'action') { - return { - title: colDef.field, - dataIndex: ['columns', colDef.field], - width: ACTION_COLUMN_WIDTH, - render: renderActionCell, - }; - } - return { - ...resizeable, - title: colDef.field, - dataIndex: ['columns', colDef.field, 'label'], - width: 200, - }; - }) ?? []; - }, [props.columnDefinitions, columnWidths, renderStringCell, renderActionCell]); - - // ==== Handlers ==== - - // Ensure that even if we lose the active element through scrolling or other means, we can still navigate by restoring the focus - useEffect(() => { - if (!ref.current) { - return; - } - - const observer = new MutationObserver(() => { - if (document.activeElement === globalSearchRef.current?.input()) { - // do not steal focus from the search input - return; - } - const selectedRow = document.querySelector('.ant-table-row-selected'); - if (!selectedRow) { - // Selected row was removed from the DOM, focus on the table - ref.current?.focus(); - } else if (selectedRow !== document.activeElement && !selectedRow.contains(document.activeElement)) { - // Selected row is still in the DOM, but not focused - selectedRow?.focus(); - } - }); - - observer.observe(ref.current, { childList: true, subtree: true }); - return () => observer.disconnect(); - }, [ref.current]); - - // Abort scrolling when mouse drag was finished (e.g., left mouse button is no longer pressed) outside the iframe - useEffect(() => { - const abortScroll = (event: MouseEvent) => { - if (!(event.buttons & 1)) { - // left button is no longer pressed... - const elements = document.getElementsByClassName('ant-table-tbody-virtual-scrollbar-thumb-moving'); - if (elements.length > 0) { - // ...but we are still scrolling the thumb (left button was released outside iframe) -> abort scrolling - window.dispatchEvent(new MouseEvent('mouseup')); - } - } - }; - document.addEventListener('mouseenter', abortScroll); - return () => document.removeEventListener('mouseenter', abortScroll); - }, []); - - // Scroll to selected row if autoSelectRowRef is set - useEffect(() => { - if (autoSelectRowRef.current && selection) { - tblRef.current?.scrollTo({ key: selection.key }); - autoSelectRowRef.current = false; - } - }, [autoSelectRowRef.current]); - - const onRowSingleClick = useCallback( - (_event: React.MouseEvent, record: CDTTreeItem) => { - const isExpanded = expandedRowKeys?.includes(record.id); - handleExpand(!isExpanded, record); - selectRow(record); - }, - [props.expansion?.expandedRowKeys] - ); - - const onRowClick = useClickHook({ - onSingleClick: onRowSingleClick, - delay: 10 // We don't have a double click event for now - }); - - // ==== Return ==== - - return
- -
No data available.
} - > -
- > - ref={tblRef} - columns={columns} - dataSource={filteredData} - components={{ body: { row: BodyRow, cell: BodyCell } }} - virtual - scroll={{ x: width, y: height - 2 }} - showHeader={false} - pagination={false} - rowClassName={(record) => classNames({ 'ant-table-row-selected': record.key === selection?.key, 'ant-table-row-matched': record.matching ?? false })} - onRow={(record) => ({ - record, - onClick: (event) => onRowClick(event, record) - })} - expandable={{ - expandIcon: props => , - showExpandColumn: true, - expandedRowKeys: expandedRowKeys, - onExpand: handleExpand - }} - /> -
-
-
; -}; diff --git a/src/components/tree/components/utils.tsx b/src/components/tree/components/utils.tsx deleted file mode 100644 index a2f3c68..0000000 --- a/src/components/tree/components/utils.tsx +++ /dev/null @@ -1,233 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ -import React, { useEffect, useRef, useState } from 'react'; -import Markdown from 'react-markdown'; -import remarkGfm from 'remark-gfm'; -import { Tooltip, TooltipContent, TooltipTrigger } from '../../tooltip/tooltip'; -import { CDTTreeItem, CDTTreeItemResource, CDTTreeTableStringColumn } from '../types'; - -export function classNames(...classes: (string | Record | undefined)[]): string { - return classes.map(className => { - if (!className) { - return ''; - } - if (typeof className === 'string') { - return className; - } - return Object.entries(className).filter(([, value]) => value).map(([key]) => key); - }).filter(className => className.length > 0).join(' '); -} - -export function createHighlightedText(label?: string, highlights?: [number, number][]): React.JSX.Element { - if (label === undefined) { - return No label provided; - } - if (highlights === undefined || highlights.length === 0) { - return {label}; - } - - highlights.sort((a, b) => a[0] - b[0]); - - const result: React.JSX.Element[] = []; - let currentPosition = 0; - - highlights.forEach(([start, end], index) => { - if (currentPosition < start) { - result.push({label.slice(currentPosition, start)}); - } - result.push({label.slice(start, end + 1)}); - currentPosition = end + 1; - }); - - // Add any remaining text after the last highlight - if (currentPosition < label.length) { - result.push({label.slice(currentPosition)}); - } - - return
- {result} -
; -} - -export function createLabelWithTooltip(child: React.JSX.Element, tooltip?: string): React.JSX.Element { - const label =
- {child} -
; - - if (tooltip === undefined) { - return label; - } - - return - - {label} - - - {tooltip} - - ; -} - -/** - * Recursively filters the tree to include items that match the search text - * and their ancestor hierarchy. If children are not to be filtered, all children - * of a matched item are included. Elements that match the search text are marked. - */ -export function filterTree( - items: CDTTreeItem[], - searchText: string, - options: { filterChildren?: boolean } = { filterChildren: false } -): CDTTreeItem[] { - const matching: CDTTreeItem[] = []; - items.forEach(item => { - // Check if the current item matches the search - const matches = Object.values(item.columns ?? {}) - .filter(column => column.type === 'string') - .some(column => - ((column as CDTTreeTableStringColumn).label || '').toLowerCase().includes(searchText.toLowerCase()) - ); - - if (matches) { - // item matches: show all or only matching children - const children = options.filterChildren - ? item.children ? filterTree(item.children, searchText, options) : [] - : item.children ?? []; - matching.push({ - ...item, - children: children.length > 0 ? children : undefined, - matching: true, - }); - } else if (item.children) { - // item does not match: check if a child matches as we need to show the item as ancestor in that case - const matchingChildren = filterTree(item.children, searchText, options); - if (matchingChildren.length > 0) { - matching.push({ - ...item, - children: matchingChildren, - matching: false - }); - } - } - }); - return matching; -} - -/** - * Options for traversing the tree. - */ -export interface TraverseOptions { - /** - * A predicate function to determine if an item should be included. - * If omitted, all items are included. - */ - predicate?: (item: CDTTreeItem) => boolean; - - /** - * A mapping function to transform items. - * If omitted, items are returned as-is. - */ - mapper?: (item: CDTTreeItem) => U; -} - -/** - * Recursively traverses the tree, optionally filtering and mapping items. - * - * @param items - The root items of the tree. - * @param options - Optional traversal options including predicate and mapFn. - * @returns An array of items that satisfy the predicate and are optionally mapped. - */ -export function traverseTree>( - items: CDTTreeItem[], - options?: TraverseOptions -): U[] { - const result: U[] = []; - - const { predicate, mapper } = options || {}; - - for (const item of items) { - // Determine if the current item satisfies the predicate - const shouldInclude = predicate ? predicate(item) : true; - - if (shouldInclude) { - // Apply the mapping function if provided, else return the item as-is - const mappedItem = mapper ? mapper(item) : (item as unknown as U); - result.push(mappedItem); - } - - if (item.children && item.children.length > 0) { - // Recursively traverse the children - const childResults = traverseTree(item.children, options); - - // If mapping is applied, childResults are already mapped - // Push all child results into the main result array - result.push(...childResults); - } - } - return result; -} - -export function getAncestors( - item: CDTTreeItem -): CDTTreeItem[] { - const ancestors: CDTTreeItem[] = []; - let current: CDTTreeItem | undefined = item.parent; - while (current) { - ancestors.push(current); - current = current.parent as unknown as CDTTreeItem; - } - return ancestors; -} - -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type ClickHookHandler = (event: React.MouseEvent, payload: any) => void; - -type UseClickHookProps = { - onSingleClick?: ClickHookHandler; - onDoubleClick?: ClickHookHandler; - delay?: number; -}; - -export function useClickHook({ - onSingleClick, - onDoubleClick, - delay = 250, -}: UseClickHookProps): ClickHookHandler { - const [clicks, setClicks] = useState(0); - const [payload, setPayload] = useState(undefined); - const eventRef = useRef | null>(null); - - useEffect(() => { - let singleClickTimer: ReturnType | null = null; - - if (clicks === 1) { - // Trigger single-click after delay - singleClickTimer = setTimeout(() => { - if (clicks === 1 && onSingleClick && eventRef.current) { - onSingleClick(eventRef.current, payload); // Trigger onClick - } - setClicks(0); // Reset clicks after the delay - }, delay); - } else if (clicks === 2) { - // Trigger double-click immediately - if (onDoubleClick && eventRef.current) { - onDoubleClick(eventRef.current, payload); // Trigger onDoubleClick - } - setClicks(0); // Reset clicks immediately - } - - // Cleanup the timer on effect cleanup or if clicks change - return () => { - if (singleClickTimer) clearTimeout(singleClickTimer); - }; - }, [clicks, delay, onSingleClick, onDoubleClick]); - - return (event, payload) => { - eventRef.current = event; - setPayload(payload); - setClicks((prev) => prev + 1); // Increment the click count - }; -} diff --git a/src/components/tree/integration/tree-converter.ts b/src/components/tree/integration/tree-converter.ts deleted file mode 100644 index 5ffc029..0000000 --- a/src/components/tree/integration/tree-converter.ts +++ /dev/null @@ -1,44 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import { CDTTreeItem, CDTTreeItemResource } from '../types'; - -/** - * A TreeConverterContext is used to pass additional information to the TreeResourceConverter. - * It contains the expanded keys, pinned keys and a resource map. - * It will be propagated to all TreeResourceConverters. - */ -export interface TreeConverterContext { - parent?: CDTTreeItem, - /** - * The expanded keys of the tree. This is used to determine if a node should be expanded or not. - */ - expandedKeys: string[], - /** - * The pinned keys of the tree. This is used to determine if a node should be pinned or not. - */ - pinnedKeys: string[] - /** - * A map of all resources that are currently in the tree. - * This can be useful to access parent resources. - * It is filled while converting the tree. - */ - assignedResources: Record - /** - * A map of all items that are currently in the tree. - */ - assignedItems: Record | undefined> -} - -/** - * A TreeResourceConverter is responsible for converting a resource into a CDTTreeItem. - */ -export interface TreeResourceConverter { - canHandle(resource: TResource): boolean; - - convert(resource: TResource, context: TreeConverterContext): CDTTreeItem; -} diff --git a/src/components/tree/integration/tree-data-provider.ts b/src/components/tree/integration/tree-data-provider.ts deleted file mode 100644 index ededaca..0000000 --- a/src/components/tree/integration/tree-data-provider.ts +++ /dev/null @@ -1,37 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import * as vscode from 'vscode'; -import { MaybePromise } from '../../../common'; -import { TreeNotification, TreeTerminatedEvent } from '../../../common/notification'; -import { CDTTreeTableColumnDefinition } from '../types'; - -/** - * A tree data provider that provides data for the CDTTreeView. - * - * @param TNode The type of the tree nodes in the domain model. - * @param TSerializedNode The type of the serialized tree nodes. Those are the nodes that - * are actually send to the webview to be display in the tree. - */ -export interface CDTTreeDataProvider { - onDidTerminate: vscode.Event>; - onDidChangeTreeData: vscode.Event>; - /** - * Get the column definitions for the tree table. - */ - getColumnDefinitions(): CDTTreeTableColumnDefinition[]; - - /** - * Get the root elements of the tree. - */ - getSerializedRoots(): MaybePromise; - - /** - * Get the children of the given element. - */ - getSerializedData(element: TNode): MaybePromise; -} diff --git a/src/components/tree/integration/webview/tree-webview-view-provider.ts b/src/components/tree/integration/webview/tree-webview-view-provider.ts deleted file mode 100644 index b38fc14..0000000 --- a/src/components/tree/integration/webview/tree-webview-view-provider.ts +++ /dev/null @@ -1,155 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 Arm Limited and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import * as vscode from 'vscode'; -import { Messenger } from 'vscode-messenger'; -import { NotificationType, WebviewIdMessageParticipant } from 'vscode-messenger-common'; -import { TreeNotification } from '../../../../common/notification'; -import { CDTTreeExecuteCommand, CTDTreeMessengerType } from '../../types'; -import { CDTTreeDataProvider } from '../tree-data-provider'; - -export abstract class CDTTreeWebviewViewProvider implements vscode.WebviewViewProvider { - - protected onDidToggleNodeEvent = new vscode.EventEmitter>(); - public readonly onDidToggleNode = this.onDidToggleNodeEvent.event; - protected onDidExecuteCommandEvent = new vscode.EventEmitter>(); - public readonly onDidExecuteCommand = this.onDidExecuteCommandEvent.event; - protected onDidClickNodeEvent = new vscode.EventEmitter>(); - public readonly onDidClickNode = this.onDidClickNodeEvent.event; - - protected get extensionUri(): vscode.Uri { - return this.context.extensionUri; - } - - protected _view?: vscode.WebviewView; - protected participant: WebviewIdMessageParticipant | undefined; - - public constructor( - protected readonly dataProvider: CDTTreeDataProvider, - protected readonly context: vscode.ExtensionContext, - protected readonly messenger = new Messenger({ ignoreHiddenViews: false, debugLog: true }) - ) { - } - - public async resolveWebviewView(webviewView: vscode.WebviewView, _context: vscode.WebviewViewResolveContext, - _token: vscode.CancellationToken): Promise { - this._view = webviewView; - - const baseExtensionUriString = this.extensionUri.toString(); - const distPathUri = vscode.Uri.parse(`${baseExtensionUriString}/dist/views`, true /* strict */); - const mediaPathUri = vscode.Uri.parse(`${baseExtensionUriString}/media`, true /* strict */); - const nodeModulesPathUri = vscode.Uri.parse(`${baseExtensionUriString}/node_modules`, true /* strict */); - - // Allow scripts in the webview - webviewView.webview.options = { - enableScripts: true, // enable scripts in the webview - localResourceRoots: [distPathUri, mediaPathUri, nodeModulesPathUri] // restrict extension's local file access - }; - - // Set the HTML content that will fill the webview view - webviewView.webview.html = await this.getWebviewContent(webviewView.webview, this.extensionUri); - - // Sets up an event listener to listen for messages passed from the webview view context - // and executes code based on the message that is received - this.setWebviewMessageListener(webviewView); - this.setWebviewData(webviewView); - } - - protected setWebviewData(_webviewView: vscode.WebviewView): void { - // Nothing to do - } - - protected async getWebviewContent(webview: vscode.Webview, extensionUri: vscode.Uri): Promise { - const codiconsUri = webview.asWebviewUri(vscode.Uri.joinPath(extensionUri, 'node_modules', '@vscode/codicons', 'dist', 'codicon.css')); - const mainUri = webview.asWebviewUri(vscode.Uri.joinPath( - extensionUri, - 'dist', - 'views', - 'treeWebView.js' - )); - - return ` - - - - - - - - - - -
- - - `; - } - - protected setWebviewMessageListener(webview: vscode.WebviewView): void { - const participant = this.participant = this.messenger.registerWebviewView(webview); - - if (this.participant === undefined) { - return; - } - - const disposables = [ - this.dataProvider.onDidTerminate(async (event) => { - if (event.remaining > 0) { - this.refreshFull(); - } - }), - this.dataProvider.onDidChangeTreeData(async (event) => { - if (event.data) { - if (Array.isArray(event.data)) { - await this.refreshPartial(event.data); - } else { - await this.refreshPartial([event.data]); - } - } else { - this.refreshFull(); - } - }), - this.messenger.onNotification(CTDTreeMessengerType.ready, () => this.onReady(), { sender: participant }), - this.messenger.onNotification(CTDTreeMessengerType.executeCommand, (event) => this.onDidExecuteCommandEvent.fire(event), { sender: participant }), - this.messenger.onNotification(CTDTreeMessengerType.toggleNode, event => this.onDidToggleNodeEvent.fire(event), { sender: participant }), - this.messenger.onNotification(CTDTreeMessengerType.clickNode, event => this.onDidClickNodeEvent.fire(event), { sender: participant }), - ]; - - webview.onDidDispose(() => disposables.forEach(disposible => disposible.dispose())); - } - - protected async onReady(): Promise { - await this.refreshFull(); - } - - protected async refreshFull(): Promise { - if (!this.participant) { - return; - } - - const columnFields = this.dataProvider.getColumnDefinitions(); - const items = await this.dataProvider.getSerializedRoots(); - - this.sendNotification(CTDTreeMessengerType.updateState, { columnFields, items }); - } - - protected async refreshPartial(nodes: TNode[]): Promise { - if (!this.participant) { - return; - } - - const items = await Promise.all(nodes.map(async node => this.dataProvider.getSerializedData(node))); - - this.sendNotification(CTDTreeMessengerType.updatePartial, { items }); - } - - sendNotification

(type: NotificationType

, params?: P): void { - if (this.participant) { - this.messenger.sendNotification(type, this.participant, params); - } - } -} diff --git a/src/components/tree/tree-view.css b/src/components/tree/tree-view.css deleted file mode 100644 index 0313087..0000000 --- a/src/components/tree/tree-view.css +++ /dev/null @@ -1,35 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 Arm Limited and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -body { - padding: 0; -} - -.markdown { - word-wrap: break-word; - word-break: break-word; -} - -.markdown hr { - border: 0; - box-sizing: border-box; - height: 1px; - margin: 4px -8px 0; - border-top: 1px solid rgba(69, 69, 69, 0.5); -} - -.markdown .code, -.markdown h1, -.markdown h2, -.markdown h3, -.markdown h4, -.markdown h5, -.markdown h6, -.markdown p, -.markdown ul { - margin: 8px 0; -} diff --git a/src/components/tree/types.ts b/src/components/tree/types.ts deleted file mode 100644 index b43d1c4..0000000 --- a/src/components/tree/types.ts +++ /dev/null @@ -1,243 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 Arm Limited and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import { NotificationType } from 'vscode-messenger-common'; -import { CommandDefinition, VSCodeContext } from '../../common'; -import { TreeNotification } from '../../common/notification'; - -// ==== Items ==== - -export interface CDTTreeItemResource { - __type: string; -} - -/** - * A tree item that is used in the CDT tree view. - */ -export interface CDTTreeItem { - __type: 'CDTTreeItem' - id: string; - key: string; - parent?: CDTTreeItem; - children?: CDTTreeItem[]; - /** - * The resource that this tree item represents. This can be any type of object. - */ - resource: T; - /** - * The columns that are displayed for this tree item. - */ - columns?: Record; - /** - * Whether this item is pinned. Undefined means that the item can not be pinned. - */ - pinned?: boolean; - /** - * Whether this item is expanded. Undefined means that the item is not expanded. - */ - expanded?: boolean; - /** - * Whether this item is matched by the current filter. Undefined means that the item is not matched. - */ - matching?: boolean; -} - -export namespace CDTTreeItem { - export function create(options: Omit, '__type'>): CDTTreeItem { - return { - __type: 'CDTTreeItem', - ...options - }; - } - - export function createRoot(): CDTTreeItem { - return create({ - id: 'root', - key: 'root', - resource: { __type: 'root' }, - children: [] - }); - } - - export function isRoot(item: CDTTreeItem): boolean { - return item.id === 'root'; - } -} - -// ==== Columns ==== - -/** - * A string column represents a column that displays a string value. - */ -export interface CDTTreeTableStringColumn { - type: 'string'; - icon?: string; - label: string; - colSpan?: number | 'fill'; - /** - * Allows to highlight parts of the string. - */ - highlight?: [number, number][]; - /** - * The tooltip that is displayed when hovering over the string. - */ - tooltip?: string; - /** - * If the column is editable, this property contains the data that is used to provide proper UI for it. - */ - edit?: EditableData; -} - -/** - * An editable column represents a column that allows to edit a string value. - */ -export interface EditableCDTTreeTableStringColumn extends CDTTreeTableStringColumn { - /** - * Contains the data that is used to provide proper UI for it. - */ - edit: EditableData; -} - -export interface EditableCellData { - type: string; -} - -export interface EditableTextData extends EditableCellData { - type: 'text'; - value: string; -} - -export interface EditableEnumData extends EditableCellData { - type: 'enum'; - options: EditableEnumDataOption[]; - value: string; -} - -export interface EditableEnumDataOption { - label: string; - value: string; -} - -export interface EditableBooleanData extends EditableCellData { - type: 'boolean'; - value: '0' | '1'; -} - -export type EditableData = EditableTextData | EditableEnumData | EditableBooleanData; - -/** - * An action column represents a column that displays multiple interactable buttons/icons. - */ -export interface CDTTreeTableActionColumn { - type: 'action'; - commands: CDTTreeTableActionColumnCommand[]; -} - -/** - * A command that can be executed when clicking on a button/icon in an action column. - */ -export interface CDTTreeTableActionColumnCommand extends CommandDefinition { - /** - * The value that is passed to the command when it is executed. - */ - value?: unknown; -} - -export type CDTTreeTableColumn = CDTTreeTableStringColumn | CDTTreeTableActionColumn; - -export type CDTTreeTableColumnTypes = - | CDTTreeTableStringColumn['type'] - | CDTTreeTableActionColumn['type']; - -/** - * A column definition for a tree table. - * This is used to define the columns that are displayed in the tree table. - */ -export interface CDTTreeTableColumnDefinition { - /** - * The type of the column. It can be used to show different types of columns. - */ - type: CDTTreeTableColumnTypes; - /** - * The field that is used to get the value for this column. See {@link CDTTreeItem.columns}. - */ - field: string; - /** - * Whether the column is resizable. Default is false. - * The resize handle is display on the right side. - * That means the column after this column is also resized. - */ - resizable?: boolean; -} - -// ==== Model ==== - -/** - * The model that is used to initialize the CDT tree view. - * It is passed to the webview when the tree view is created / updated. - */ -export interface CDTTreeExtensionModel { - items?: TItems[]; - columnFields?: CDTTreeTableColumnDefinition[]; -} - -/** - * The view model that is used to update the CDT tree view. - * It is the actual model that is used to render the tree view. - */ -export interface CDTTreeViewModel { - root: CDTTreeItem; - items: CDTTreeItem[]; - expandedKeys: string[]; - pinnedKeys: string[]; - references: Record | undefined> - resources: Record -} - - -export interface CTDTreeWebviewContext { - webviewSection: string; - cdtTreeItemId: string; - cdtTreeItemType: string; -} - -export namespace CTDTreeWebviewContext { - export function is(context: object): context is CTDTreeWebviewContext { - return 'cdtTreeItemId' in context; - } - - export function create(context: CTDTreeWebviewContext): VSCodeContext { - return VSCodeContext.create(context); - } -} - -export interface CDTTreeExecuteCommand { - commandId: string; - itemId: string; - value?: unknown; -} - -export interface CDTTreePartialUpdate { - items?: TItem[]; -} - -export namespace CTDTreeMessengerType { - /** - * Replace the current state with the given state. - */ - export const updateState: NotificationType = { method: 'updateState' }; - /** - * Update the nodes with the given nodes. - */ - export const updatePartial: NotificationType = { method: 'updatePartial' }; - export const ready: NotificationType = { method: 'ready' }; - - export const executeCommand: NotificationType> = { method: 'executeCommand' }; - export const toggleNode: NotificationType> = { method: 'toggleNode' }; - export const clickNode: NotificationType> = { method: 'clickNode' }; - export const openSearch: NotificationType = { method: 'openSearch' }; -} diff --git a/src/components/webview/messenger.ts b/src/components/webview/messenger.ts deleted file mode 100644 index 9434c57..0000000 --- a/src/components/webview/messenger.ts +++ /dev/null @@ -1,12 +0,0 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -import { Messenger } from 'vscode-messenger-webview'; - -export const vscode = acquireVsCodeApi(); -export const messenger = new Messenger(vscode); -messenger.start(); diff --git a/src/entry-points/browser/extension.ts b/src/entry-points/browser/extension.ts index 61abc36..0c248f0 100644 --- a/src/entry-points/browser/extension.ts +++ b/src/entry-points/browser/extension.ts @@ -10,11 +10,11 @@ import { IPeripheralInspectorAPI } from '../../api-types'; import { PeripheralCommands } from '../../commands'; import { DebugTracker } from '../../debug-tracker'; import { PeripheralInspectorAPI } from '../../peripheral-inspector-api'; -import { PeripheralDataTracker } from '../../plugin/peripheral/tree/peripheral-data-tracker'; +import { PeripheralDataTracker } from '../../model/peripheral/tree/peripheral-data-tracker'; import { SvdResolver } from '../../svd-resolver'; -import { PeripheralTreeDataProvider } from '../../plugin/peripheral/tree/peripheral-tree-data-provider'; -import { PeripheralsTreeTableWebView } from '../../plugin/peripheral/webview/peripheral-tree-webview-main'; -import { PeripheralConfigurationProvider } from '../../plugin/peripheral/tree/peripheral-configuration-provider'; +import { PeripheralConfigurationProvider } from '../../model/peripheral/tree/peripheral-configuration-provider'; +import { PeripheralTreeDataProvider } from '../../views/peripheral/peripheral-data-provider'; +import { PeripheralsTreeTableWebView } from '../../views/peripheral/peripheral-view-provider'; export * as api from '../../api-types'; export const activate = async (context: vscode.ExtensionContext): Promise => { diff --git a/src/entry-points/desktop/extension.ts b/src/entry-points/desktop/extension.ts index 61abc36..0c248f0 100644 --- a/src/entry-points/desktop/extension.ts +++ b/src/entry-points/desktop/extension.ts @@ -10,11 +10,11 @@ import { IPeripheralInspectorAPI } from '../../api-types'; import { PeripheralCommands } from '../../commands'; import { DebugTracker } from '../../debug-tracker'; import { PeripheralInspectorAPI } from '../../peripheral-inspector-api'; -import { PeripheralDataTracker } from '../../plugin/peripheral/tree/peripheral-data-tracker'; +import { PeripheralDataTracker } from '../../model/peripheral/tree/peripheral-data-tracker'; import { SvdResolver } from '../../svd-resolver'; -import { PeripheralTreeDataProvider } from '../../plugin/peripheral/tree/peripheral-tree-data-provider'; -import { PeripheralsTreeTableWebView } from '../../plugin/peripheral/webview/peripheral-tree-webview-main'; -import { PeripheralConfigurationProvider } from '../../plugin/peripheral/tree/peripheral-configuration-provider'; +import { PeripheralConfigurationProvider } from '../../model/peripheral/tree/peripheral-configuration-provider'; +import { PeripheralTreeDataProvider } from '../../views/peripheral/peripheral-data-provider'; +import { PeripheralsTreeTableWebView } from '../../views/peripheral/peripheral-view-provider'; export * as api from '../../api-types'; export const activate = async (context: vscode.ExtensionContext): Promise => { diff --git a/src/manifest.ts b/src/manifest.ts index f8e8209..6eb1f59 100644 --- a/src/manifest.ts +++ b/src/manifest.ts @@ -5,7 +5,7 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ -import { CommandDefinition } from './common'; +import { CommandDefinition } from '@eclipse-cdt-cloud/vscode-ui-components/lib/vscode/webview-types'; export const PACKAGE_NAME = 'peripheral-inspector'; export const CONFIG_SVD_PATH = 'definitionPathConfig'; diff --git a/src/plugin/peripheral/nodes/base-node.ts b/src/model/peripheral/nodes/base-node.ts similarity index 100% rename from src/plugin/peripheral/nodes/base-node.ts rename to src/model/peripheral/nodes/base-node.ts diff --git a/src/plugin/peripheral/nodes/index.ts b/src/model/peripheral/nodes/index.ts similarity index 100% rename from src/plugin/peripheral/nodes/index.ts rename to src/model/peripheral/nodes/index.ts diff --git a/src/plugin/peripheral/nodes/message-node.ts b/src/model/peripheral/nodes/message-node.ts similarity index 96% rename from src/plugin/peripheral/nodes/message-node.ts rename to src/model/peripheral/nodes/message-node.ts index 6e52ebb..f44b30a 100644 --- a/src/plugin/peripheral/nodes/message-node.ts +++ b/src/model/peripheral/nodes/message-node.ts @@ -5,10 +5,10 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ +import { CDTTreeItem } from '@eclipse-cdt-cloud/vscode-ui-components'; import * as vscode from 'vscode'; import { AddrRange } from '../../../addrranges'; import { NodeSetting, PeripheralBaseNodeDTO } from '../../../common'; -import { CDTTreeItem } from '../../../components/tree/types'; import { PeripheralBaseNode } from './base-node'; export class MessageNode extends PeripheralBaseNode { diff --git a/src/plugin/peripheral/nodes/peripheral-cluster-node.ts b/src/model/peripheral/nodes/peripheral-cluster-node.ts similarity index 100% rename from src/plugin/peripheral/nodes/peripheral-cluster-node.ts rename to src/model/peripheral/nodes/peripheral-cluster-node.ts diff --git a/src/plugin/peripheral/nodes/peripheral-field-node.ts b/src/model/peripheral/nodes/peripheral-field-node.ts similarity index 100% rename from src/plugin/peripheral/nodes/peripheral-field-node.ts rename to src/model/peripheral/nodes/peripheral-field-node.ts diff --git a/src/plugin/peripheral/nodes/peripheral-node.ts b/src/model/peripheral/nodes/peripheral-node.ts similarity index 100% rename from src/plugin/peripheral/nodes/peripheral-node.ts rename to src/model/peripheral/nodes/peripheral-node.ts diff --git a/src/plugin/peripheral/nodes/peripheral-register-node.ts b/src/model/peripheral/nodes/peripheral-register-node.ts similarity index 100% rename from src/plugin/peripheral/nodes/peripheral-register-node.ts rename to src/model/peripheral/nodes/peripheral-register-node.ts diff --git a/src/plugin/peripheral/tree/peripheral-configuration-provider.ts b/src/model/peripheral/tree/peripheral-configuration-provider.ts similarity index 100% rename from src/plugin/peripheral/tree/peripheral-configuration-provider.ts rename to src/model/peripheral/tree/peripheral-configuration-provider.ts diff --git a/src/plugin/peripheral/tree/peripheral-data-tracker.ts b/src/model/peripheral/tree/peripheral-data-tracker.ts similarity index 99% rename from src/plugin/peripheral/tree/peripheral-data-tracker.ts rename to src/model/peripheral/tree/peripheral-data-tracker.ts index 816239b..82387d6 100644 --- a/src/plugin/peripheral/tree/peripheral-data-tracker.ts +++ b/src/model/peripheral/tree/peripheral-data-tracker.ts @@ -19,7 +19,7 @@ import { } from '../nodes'; import { PeripheralTreeForSession } from './peripheral-session-tree'; import { TreeNotification, TreeTerminatedEvent } from '../../../common/notification'; -import { PeripheralTreeDataProvider } from './peripheral-tree-data-provider'; +import { PeripheralTreeDataProvider } from '../../../views/peripheral/peripheral-data-provider'; import * as xmlWriter from 'xmlbuilder2'; import { XMLBuilder } from 'xmlbuilder2/lib/interfaces'; import { hexFormat } from '../../../utils'; diff --git a/src/plugin/peripheral/tree/peripheral-session-tree.ts b/src/model/peripheral/tree/peripheral-session-tree.ts similarity index 100% rename from src/plugin/peripheral/tree/peripheral-session-tree.ts rename to src/model/peripheral/tree/peripheral-session-tree.ts diff --git a/src/svd-resolver.ts b/src/svd-resolver.ts index ad09f78..b813d5d 100644 --- a/src/svd-resolver.ts +++ b/src/svd-resolver.ts @@ -12,7 +12,7 @@ import { PeripheralInspectorAPI } from './peripheral-inspector-api'; import { parsePackString, pdscFromPack, fileFromPack, Pack } from './cmsis-pack/pack-utils'; import { PDSC, Device, DeviceVariant, getDevices, getSvdPath, getProcessors } from './cmsis-pack/pdsc'; import { readFromUrl } from './utils'; -import { PeripheralConfigurationProvider } from './plugin/peripheral/tree/peripheral-configuration-provider'; +import { PeripheralConfigurationProvider } from './model/peripheral/tree/peripheral-configuration-provider'; export class SvdResolver { public constructor(protected api: PeripheralInspectorAPI, protected readonly config: PeripheralConfigurationProvider) { diff --git a/src/plugin/peripheral/tree/peripheral-tree-data-provider.ts b/src/views/peripheral/peripheral-data-provider.ts similarity index 88% rename from src/plugin/peripheral/tree/peripheral-tree-data-provider.ts rename to src/views/peripheral/peripheral-data-provider.ts index 8b20ecb..0af4f76 100644 --- a/src/plugin/peripheral/tree/peripheral-tree-data-provider.ts +++ b/src/views/peripheral/peripheral-data-provider.ts @@ -5,15 +5,14 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ +import { CDTTreeTableColumnDefinition } from '@eclipse-cdt-cloud/vscode-ui-components'; +import { CDTTreeDataProvider, CDTTreeWebviewViewProvider } from '@eclipse-cdt-cloud/vscode-ui-components/lib/tree/vscode'; import * as vscode from 'vscode'; -import { TreeNotification, TreeTerminatedEvent } from '../../../common/notification'; -import { PERIPHERAL_ID_SEP, PeripheralBaseNodeDTO } from '../../../common/peripheral-dto'; -import { CDTTreeDataProvider } from '../../../components/tree/integration/tree-data-provider'; -import { CDTTreeWebviewViewProvider } from '../../../components/tree/integration/webview'; -import { CDTTreeTableColumnDefinition } from '../../../components/tree/types'; -import * as manifest from '../../../manifest'; -import { PeripheralBaseNode } from '../nodes'; -import { PeripheralDataTracker } from './peripheral-data-tracker'; +import { TreeNotification, TreeTerminatedEvent } from '../../common/notification'; +import { PERIPHERAL_ID_SEP, PeripheralBaseNodeDTO } from '../../common/peripheral-dto'; +import * as manifest from '../../manifest'; +import { PeripheralBaseNode } from '../../model/peripheral/nodes'; +import { PeripheralDataTracker } from '../../model/peripheral/tree/peripheral-data-tracker'; export class PeripheralTreeDataProvider implements CDTTreeDataProvider { public static viewName = `${manifest.PACKAGE_NAME}.svd`; diff --git a/src/components/tree/integration/peripheral-tree-converter.ts b/src/views/peripheral/peripheral-resource-converter.ts similarity index 84% rename from src/components/tree/integration/peripheral-tree-converter.ts rename to src/views/peripheral/peripheral-resource-converter.ts index 1277388..67bac63 100644 --- a/src/components/tree/integration/peripheral-tree-converter.ts +++ b/src/views/peripheral/peripheral-resource-converter.ts @@ -5,19 +5,16 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ -import { AccessType, IEnumeratedValue } from '../../../api-types'; -import { CommandDefinition } from '../../../common'; -import { formatValue, NumberFormat } from '../../../common/format'; -import { PeripheralClusterNodeDTO, PeripheralFieldNodeDTO, PeripheralFieldNodeContextValue, PeripheralNodeDTO, PeripheralRegisterNodeDTO, PeripheralTreeNodeDTOs, PeripheralRegisterNodeContextValue, PeripheralSessionNodeDTO, PeripheralBaseNodeDTO } from '../../../common/peripheral-dto'; -import { Commands } from '../../../manifest'; -import { binaryFormat, extractBits, hexFormat } from '../../../utils'; -import { CDTTreeItem, CDTTreeTableActionColumnCommand, CDTTreeTableColumn, EditableData, EditableEnumDataOption } from '../types'; -import { TreeConverterContext, TreeResourceConverter } from './tree-converter'; +import { CDTTreeResourceConverter, CDTTreeConverterContext, CDTTreeItem, CDTTreeTableColumn, EditableData, CDTTreeTableActionColumnCommand, EditableEnumDataOption } from '@eclipse-cdt-cloud/vscode-ui-components'; +import { AccessType, IEnumeratedValue } from '../../api-types'; +import { PeripheralTreeNodeDTOs, PeripheralBaseNodeDTO, PeripheralSessionNodeDTO, PeripheralNodeDTO, formatValue, PeripheralRegisterNodeDTO, PeripheralRegisterNodeContextValue, NumberFormat, PeripheralClusterNodeDTO, PeripheralFieldNodeDTO, PeripheralFieldNodeContextValue } from '../../common'; +import { Commands } from '../../manifest'; +import { hexFormat, binaryFormat, extractBits } from '../../utils'; +import { CommandDefinition } from '@eclipse-cdt-cloud/vscode-ui-components/lib/vscode/webview-types'; +export class PeripheralTreeConverter implements CDTTreeResourceConverter { -export class PeripheralTreeConverter implements TreeResourceConverter { - - protected converters: TreeResourceConverter[] = [ + protected converters: CDTTreeResourceConverter[] = [ new PeripheralBaseNodeConverter(), new PeripheralSessionNodeConverter(), new PeripheralNodeConverter(), @@ -29,7 +26,7 @@ export class PeripheralTreeConverter implements TreeResourceConverter c.canHandle(resource)); } - convert(resource: PeripheralTreeNodeDTOs, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralTreeNodeDTOs, context: CDTTreeConverterContext): CDTTreeItem { const converter = this.converters.find(c => c.canHandle(resource)); if (converter) { context.assignedResources[resource.id] = resource; @@ -62,12 +59,12 @@ export class PeripheralTreeConverter implements TreeResourceConverter { +export class PeripheralBaseNodeConverter implements CDTTreeResourceConverter { canHandle(resource: PeripheralTreeNodeDTOs): boolean { return PeripheralBaseNodeDTO.is(resource); } - convert(resource: PeripheralBaseNodeDTO, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralBaseNodeDTO, context: CDTTreeConverterContext): CDTTreeItem { return CDTTreeItem.create({ id: resource.id, key: resource.id, @@ -91,12 +88,12 @@ export class PeripheralBaseNodeConverter implements TreeResourceConverter { +export class PeripheralSessionNodeConverter implements CDTTreeResourceConverter { canHandle(resource: PeripheralTreeNodeDTOs): boolean { return PeripheralSessionNodeDTO.is(resource); } - convert(resource: PeripheralSessionNodeDTO, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralSessionNodeDTO, context: CDTTreeConverterContext): CDTTreeItem { return CDTTreeItem.create({ id: resource.id, key: resource.id, @@ -120,12 +117,12 @@ export class PeripheralSessionNodeConverter implements TreeResourceConverter { +export class PeripheralNodeConverter implements CDTTreeResourceConverter { canHandle(resource: PeripheralTreeNodeDTOs): boolean { return PeripheralNodeDTO.is(resource); } - convert(resource: PeripheralNodeDTO, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralNodeDTO, context: CDTTreeConverterContext): CDTTreeItem { return CDTTreeItem.create({ id: resource.id, key: resource.id, @@ -139,7 +136,7 @@ export class PeripheralNodeConverter implements TreeResourceConverter): Record { + private getColumns(resource: PeripheralNodeDTO, _context: CDTTreeConverterContext): Record { const value = formatValue(resource.baseAddress, 8, resource.format); return { @@ -162,12 +159,12 @@ export class PeripheralNodeConverter implements TreeResourceConverter { +export class PeripheralRegisterNodeConverter implements CDTTreeResourceConverter { canHandle(resource: PeripheralTreeNodeDTOs): boolean { return PeripheralRegisterNodeDTO.is(resource); } - convert(resource: PeripheralRegisterNodeDTO, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralRegisterNodeDTO, context: CDTTreeConverterContext): CDTTreeItem { return CDTTreeItem.create({ id: resource.id, key: resource.id, @@ -183,7 +180,7 @@ export class PeripheralRegisterNodeConverter implements TreeResourceConverter): CDTTreeTableActionColumnCommand[] { + private getCommands(resource: PeripheralRegisterNodeDTO, contextValue: string, edit: EditableData | undefined, context: CDTTreeConverterContext): CDTTreeTableActionColumnCommand[] { const value = this.getValue(resource, context); const commands: CDTTreeTableActionColumnCommand[] = []; commands.push({ ...Commands.COPY_VALUE_COMMAND, value }); @@ -199,7 +196,7 @@ export class PeripheralRegisterNodeConverter implements TreeResourceConverter): string { + private getValue(resource: PeripheralRegisterNodeDTO, context: CDTTreeConverterContext): string { return this.formatValue(resource, resource.currentValue, PeripheralTreeNodeDTOs.getFormat(resource.id, context.assignedResources)); } @@ -213,7 +210,7 @@ export class PeripheralRegisterNodeConverter implements TreeResourceConverter): Record { + private getColumns(resource: PeripheralRegisterNodeDTO, context: CDTTreeConverterContext): Record { const value = this.getValue(resource, context); const contextValue = this.getContextValue(resource); const edit = this.isEditable(contextValue) ? this.getEdit(resource, value) : undefined; @@ -247,7 +244,7 @@ export class PeripheralRegisterNodeConverter implements TreeResourceConverter): string { + private getTooltipMarkdown(resource: PeripheralRegisterNodeDTO, context: CDTTreeConverterContext): string { let mds = ''; const address = `${hexFormat(resource.address)}`; @@ -312,7 +309,7 @@ export class PeripheralClusterNodeConverter { return PeripheralClusterNodeDTO.is(resource); } - convert(resource: PeripheralClusterNodeDTO, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralClusterNodeDTO, context: CDTTreeConverterContext): CDTTreeItem { return CDTTreeItem.create({ id: resource.id, key: resource.id, @@ -330,7 +327,7 @@ export class PeripheralClusterNodeConverter { return [Commands.EXPORT_NODE_COMMAND]; } - private getColumns(peripheral: PeripheralClusterNodeDTO, _context: TreeConverterContext): Record { + private getColumns(peripheral: PeripheralClusterNodeDTO, _context: CDTTreeConverterContext): Record { const labelValue = hexFormat(peripheral.offset, 0); return { @@ -353,12 +350,12 @@ export class PeripheralClusterNodeConverter { } -export class PeripheralFieldNodeConverter implements TreeResourceConverter { +export class PeripheralFieldNodeConverter implements CDTTreeResourceConverter { canHandle(resource: PeripheralTreeNodeDTOs): boolean { return PeripheralFieldNodeDTO.is(resource); } - convert(resource: PeripheralFieldNodeDTO, context: TreeConverterContext): CDTTreeItem { + convert(resource: PeripheralFieldNodeDTO, context: CDTTreeConverterContext): CDTTreeItem { return CDTTreeItem.create({ id: resource.id, key: resource.id, @@ -387,7 +384,7 @@ export class PeripheralFieldNodeConverter implements TreeResourceConverter): CommandDefinition[] { + private getCommands(resource: PeripheralFieldNodeDTO, contextValue: PeripheralFieldNodeContextValue, edit: EditableData | undefined, context: CDTTreeConverterContext): CommandDefinition[] { const value = this.getValue(resource, context); const commands: CDTTreeTableActionColumnCommand[] = []; if (this.isCopyable(contextValue)) { @@ -403,7 +400,7 @@ export class PeripheralFieldNodeConverter implements TreeResourceConverter): string { + private getValue(resource: PeripheralFieldNodeDTO, context: CDTTreeConverterContext): string { return this.formatValue(resource, resource.currentValue, PeripheralTreeNodeDTOs.getFormat(resource.id, context.assignedResources)); } @@ -415,7 +412,7 @@ export class PeripheralFieldNodeConverter implements TreeResourceConverter): EditableData | undefined { + private getEdit(resource: PeripheralFieldNodeDTO, value: string, context: CDTTreeConverterContext): EditableData | undefined { if (resource.enumeration) { return { type: 'enum', @@ -434,7 +431,7 @@ export class PeripheralFieldNodeConverter implements TreeResourceConverter): Record { + private getColumns(resource: PeripheralFieldNodeDTO, context: CDTTreeConverterContext): Record { const value = this.getValue(resource, context); const contextValue = this.getContextValue(resource); const edit = this.isEditable(contextValue) ? this.getEdit(resource, value, context) : undefined; @@ -497,7 +494,7 @@ export class PeripheralFieldNodeConverter implements TreeResourceConverter): string { + private getTooltipMarkdown(resource: PeripheralFieldNodeDTO, context: CDTTreeConverterContext): string { let mds = ''; const address = `${hexFormat(resource.parentAddress)}${this.getRange(resource)}`; diff --git a/src/plugin/peripheral/webview/peripheral-tree-webview-main.ts b/src/views/peripheral/peripheral-view-provider.ts similarity index 74% rename from src/plugin/peripheral/webview/peripheral-tree-webview-main.ts rename to src/views/peripheral/peripheral-view-provider.ts index 66eb71e..42eeb73 100644 --- a/src/plugin/peripheral/webview/peripheral-tree-webview-main.ts +++ b/src/views/peripheral/peripheral-view-provider.ts @@ -6,11 +6,10 @@ ********************************************************************************/ import * as vscode from 'vscode'; -import * as manifest from '../../../manifest'; -import { PeripheralBaseNode } from '../nodes'; -import { CDTTreeWebviewViewProvider } from '../../../components/tree/integration/webview'; -import { CDTTreeDataProvider } from '../../../components/tree/integration/tree-data-provider'; -import { PeripheralBaseNodeDTO } from '../../../common/peripheral-dto'; +import * as manifest from '../../manifest'; +import { PeripheralBaseNode } from '../../model/peripheral/nodes'; +import { PeripheralBaseNodeDTO } from '../../common/peripheral-dto'; +import { CDTTreeDataProvider, CDTTreeWebviewViewProvider } from '@eclipse-cdt-cloud/vscode-ui-components/lib/vscode-types'; export class PeripheralsTreeTableWebView extends CDTTreeWebviewViewProvider { public static viewType = `${manifest.PACKAGE_NAME}.peripheral-treetable`; diff --git a/src/components/tree/integration/webview/index.ts b/src/views/peripheral/peripheral-view.css similarity index 76% rename from src/components/tree/integration/webview/index.ts rename to src/views/peripheral/peripheral-view.css index 3128ec9..784735a 100644 --- a/src/components/tree/integration/webview/index.ts +++ b/src/views/peripheral/peripheral-view.css @@ -1,8 +1,10 @@ -/******************************************************************************** - * Copyright (C) 2024 EclipseSource and others. - * - * This program and the accompanying materials are made available under the - * terms of the MIT License as outlined in the LICENSE File - ********************************************************************************/ - -export * from './tree-webview-view-provider'; +/******************************************************************************** + * Copyright (C) 2024 Arm Limited and others. + * + * This program and the accompanying materials are made available under the + * terms of the MIT License as outlined in the LICENSE File + ********************************************************************************/ + +body { + padding: 0; +} diff --git a/src/components/tree/tree-view.tsx b/src/views/peripheral/peripheral-view.tsx similarity index 86% rename from src/components/tree/tree-view.tsx rename to src/views/peripheral/peripheral-view.tsx index 7d22dfa..6bff958 100644 --- a/src/components/tree/tree-view.tsx +++ b/src/views/peripheral/peripheral-view.tsx @@ -5,27 +5,33 @@ * terms of the MIT License as outlined in the LICENSE File ********************************************************************************/ -import 'primeflex/primeflex.css'; -import './tree-view.css'; +import './peripheral-view.css'; -import React from 'react'; -import { createRoot } from 'react-dom/client'; -import { HOST_EXTENSION, NotificationType } from 'vscode-messenger-common'; -import { PeripheralNodeDTO, PeripheralSessionNodeDTO, PeripheralTreeNodeDTOs } from '../../common/peripheral-dto'; -import { Commands } from '../../manifest'; -import { messenger } from '../webview/messenger'; -import { AntDComponentTreeTable } from './components/treetable'; -import { PeripheralTreeConverter } from './integration/peripheral-tree-converter'; -import { TreeConverterContext } from './integration/tree-converter'; import { CDTTreeExtensionModel, CDTTreeItem, - CDTTreePartialUpdate, + CDTTreeMessengerType, CDTTreeViewModel, - CTDTreeMessengerType -} from './types'; + CDTTreeConverterContext, + CDTTreePartialUpdate, +} from '@eclipse-cdt-cloud/vscode-ui-components'; +import { + messenger, + CDTTree +} from '@eclipse-cdt-cloud/vscode-ui-components/lib/browser-types'; +import React from 'react'; +import { createRoot } from 'react-dom/client'; +import { HOST_EXTENSION, NotificationType } from 'vscode-messenger-common'; import { PeripheralNodeSort } from '../../common'; +import { + PeripheralNodeDTO, + PeripheralSessionNodeDTO, + PeripheralTreeNodeDTOs, +} from '../../common/peripheral-dto'; +import { Commands } from '../../manifest'; +import { PeripheralTreeConverter } from './peripheral-resource-converter'; +messenger.start(); interface State { extensionModel: CDTTreeExtensionModel; @@ -50,16 +56,16 @@ export class CDTTreeView extends React.Component { } public async componentDidMount(): Promise { - messenger.onNotification(CTDTreeMessengerType.updateState, (state: CDTTreeExtensionModel) => { + messenger.onNotification(CDTTreeMessengerType.updateState, (state: CDTTreeExtensionModel) => { this.setState(prev => ({ ...prev, extensionModel: state, })); this.refreshFull(state.items); }); - messenger.onNotification(CTDTreeMessengerType.updatePartial, (message: CDTTreePartialUpdate) => { + messenger.onNotification(CDTTreeMessengerType.updatePartial, (message: CDTTreePartialUpdate) => { this.refreshPartial(message.items ?? []); }); - messenger.onNotification(CTDTreeMessengerType.openSearch, () => { + messenger.onNotification(CDTTreeMessengerType.openSearch, () => { const elements = document.getElementsByClassName('search-overlay visible'); if (elements.length > 0) { // search overlay is already visible @@ -81,11 +87,11 @@ export class CDTTreeView extends React.Component { })); } }); - messenger.sendNotification(CTDTreeMessengerType.ready, HOST_EXTENSION, undefined); + messenger.sendNotification(CDTTreeMessengerType.ready, HOST_EXTENSION, undefined); } protected refreshFull(items: PeripheralTreeNodeDTOs[] | undefined): void { - const context: TreeConverterContext = { + const context: CDTTreeConverterContext = { assignedItems: {}, assignedResources: {}, expandedKeys: [], @@ -122,7 +128,7 @@ export class CDTTreeView extends React.Component { } this.setState(prev => { - const context: TreeConverterContext = { + const context: CDTTreeConverterContext = { expandedKeys: prev.viewModel.expandedKeys, pinnedKeys: prev.viewModel.pinnedKeys, assignedItems: prev.viewModel.references, @@ -183,7 +189,7 @@ export class CDTTreeView extends React.Component { protected createTreeTable(): React.ReactNode { return

- + dataSource={this.state.viewModel.items} dataSourceSorter={(dataSource) => this.dataSourceSorter(dataSource)} columnDefinitions={this.state.extensionModel.columnFields} @@ -191,7 +197,7 @@ export class CDTTreeView extends React.Component { expandedRowKeys: this.state.viewModel.expandedKeys, onExpand: (expanded, record) => { this.setState(prev => ({ ...prev, viewModel: { ...prev.viewModel, expandedKeys: updateKeys(this.state.viewModel.expandedKeys, record.id, expanded) } })); - this.notify(CTDTreeMessengerType.toggleNode, + this.notify(CDTTreeMessengerType.toggleNode, { data: record.id }, ); } @@ -202,11 +208,11 @@ export class CDTTreeView extends React.Component { this.setState(prev => ({ ...prev, viewModel: { ...prev.viewModel, pinnedKeys: updateKeys(this.state.viewModel.pinnedKeys, record.id, pinned) } })); if (pinned) { - this.notify(CTDTreeMessengerType.executeCommand, + this.notify(CDTTreeMessengerType.executeCommand, { data: { commandId: Commands.UNPIN_COMMAND.commandId, itemId: record.id } }, ); } else { - this.notify(CTDTreeMessengerType.executeCommand, + this.notify(CDTTreeMessengerType.executeCommand, { data: { commandId: Commands.PIN_COMMAND.commandId, itemId: record.id } }, ); } @@ -216,16 +222,21 @@ export class CDTTreeView extends React.Component { }} action={ { - onAction: (event, command, value, record) => { + onAction: (event, command, value, record, api) => { + if (command.commandId === Commands.UPDATE_NODE_COMMAND.commandId) { + api.selectRow(record); + return api.setEditRowKey(record.key); + } + event.stopPropagation(); - this.notify(CTDTreeMessengerType.executeCommand, { data: { commandId: command.commandId, itemId: record.id, value } }); + this.notify(CDTTreeMessengerType.executeCommand, { data: { commandId: command.commandId, itemId: record.id, value } }); } } } edit={ { onEdit: (record, value) => { - this.notify(CTDTreeMessengerType.executeCommand, { data: { commandId: Commands.UPDATE_NODE_COMMAND.commandId, itemId: record.id, value } }); + this.notify(CDTTreeMessengerType.executeCommand, { data: { commandId: Commands.UPDATE_NODE_COMMAND.commandId, itemId: record.id, value } }); } } } diff --git a/tsconfig.json b/tsconfig.json index b26a490..690b305 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,17 +1,17 @@ { - "compilerOptions": { - "target": "ES2020", - "module": "commonjs", - "strict": true, - "sourceMap": true, - "esModuleInterop": true, - "jsx": "react", - "lib": [ - "es2020", - "dom" - ] - }, - "include": [ - "src" + "compilerOptions": { + "target": "ES2020", + "module": "commonjs", + "strict": true, + "sourceMap": true, + "esModuleInterop": true, + "jsx": "react", + "lib": [ + "es2020", + "dom" ] -} + }, + "include": [ + "src" + ] +} \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index cd2144a..cfb49fd 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -82,22 +82,18 @@ module.exports = [ ...common, target: 'web', entry: { - treeWebView: './src/components/tree/tree-view.tsx' + treeWebView: './src/views/peripheral/peripheral-view.tsx', }, output: { filename: '[name].js', - path: path.resolve(__dirname, 'dist', 'views') + path: path.resolve(__dirname, 'dist', 'views'), }, resolve: { extensions: ['.tsx', '.ts', '.js', '.css'], - fallback: { - buffer: require.resolve('buffer') + alias: { + react: path.resolve('./node_modules/react'), + 'react-dom': path.resolve('./node_modules/react-dom'), } - }, - plugins: [ - new webpack.ProvidePlugin({ - Buffer: ['buffer', 'Buffer'] - }) - ] + } } ]; diff --git a/yarn.lock b/yarn.lock index 0c1cd23..574f2a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -198,6 +198,23 @@ resolved "https://registry.yarnpkg.com/@discoveryjs/json-ext/-/json-ext-0.5.7.tgz#1d572bfbbe14b7704e0ba0f39b74815b84870d70" integrity sha512-dBVuXR082gk3jsFp7Rd/JI4kytwGHecnCoTtXFb7DB6CNHp4rg5k1bhg0nWdLGLnOV71lmDzGQaLMy8iPLY0pw== +"@eclipse-cdt-cloud/vscode-ui-components@0.0.1": + version "0.0.1" + resolved "https://registry.yarnpkg.com/@eclipse-cdt-cloud/vscode-ui-components/-/vscode-ui-components-0.0.1.tgz#40b5026f6c3649263ed2e144fcc42e6f0d4342d8" + integrity sha512-2gNkyedlQeRvsAK5PGsXLqI7uhgxaDCx8A3ObpLEfwxwGwgsH89ETGEZBKY6pdMWvK9lGhfNlJx0EFLrr4Eheg== + dependencies: + "@floating-ui/react" "^0.26.17" + "@vscode/codicons" "0.0.20" + "@vscode/webview-ui-toolkit" "^1.4.0" + antd "^5.22.1" + re-resizable "^6.11.2" + react-markdown "^9.0.1" + remark-gfm "^4.0.0" + throttle-debounce "5.0.2" + vscode-messenger "^0.4.5" + vscode-messenger-common "^0.4.5" + vscode-messenger-webview "^0.4.5" + "@emotion/hash@^0.8.0": version "0.8.0" resolved "https://registry.yarnpkg.com/@emotion/hash/-/hash-0.8.0.tgz#bbbff68978fefdbe68ccb533bc8cbe1d1afb5413" @@ -307,45 +324,50 @@ wrap-ansi "^8.1.0" wrap-ansi-cjs "npm:wrap-ansi@^7.0.0" -"@jridgewell/gen-mapping@^0.3.0": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== +"@jridgewell/gen-mapping@^0.3.5": + version "0.3.8" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.8.tgz#4f0e06362e01362f823d348f1872b08f666d8142" + integrity sha512-imAbBGkb+ebQyxKgzv5Hu2nmROxoDOXHh80evxdoXNOrvAnVx7zimzc1Oo5h9RlfV4vPXaE2iM5pOFbvOCClWA== dependencies: - "@jridgewell/set-array" "^1.0.1" + "@jridgewell/set-array" "^1.2.1" "@jridgewell/sourcemap-codec" "^1.4.10" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/trace-mapping" "^0.3.24" -"@jridgewell/resolve-uri@^3.0.3": - version "3.1.0" - resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" - integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== +"@jridgewell/resolve-uri@^3.1.0": + version "3.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6" + integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw== -"@jridgewell/set-array@^1.0.1": - version "1.1.2" - resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" - integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== +"@jridgewell/set-array@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.2.1.tgz#558fb6472ed16a4c850b889530e6b36438c49280" + integrity sha512-R8gLRTZeyp03ymzP/6Lil/28tGeGEzhx1q2k703KGWRAI1VdvPIXdG70VJc2pAMw3NA6JKL5hhFu1sJX0Mnn/A== -"@jridgewell/source-map@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.2.tgz#f45351aaed4527a298512ec72f81040c998580fb" - integrity sha512-m7O9o2uR8k2ObDysZYzdfhb08VuEml5oWGiosa1VdaPZ/A6QyPkAJuwN0Q1lhULOf6B7MtQmHENS743hWtCrgw== +"@jridgewell/source-map@^0.3.3": + version "0.3.6" + resolved "https://registry.yarnpkg.com/@jridgewell/source-map/-/source-map-0.3.6.tgz#9d71ca886e32502eb9362c9a74a46787c36df81a" + integrity sha512-1ZJTZebgqllO79ue2bm3rIGud/bOe0pP5BjSRCRxxYkEZS8STV7zN84UBbiYu7jy+eCKSnVIUgoWWE/tt+shMQ== dependencies: - "@jridgewell/gen-mapping" "^0.3.0" - "@jridgewell/trace-mapping" "^0.3.9" + "@jridgewell/gen-mapping" "^0.3.5" + "@jridgewell/trace-mapping" "^0.3.25" "@jridgewell/sourcemap-codec@^1.4.10": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.14", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.15" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz#aba35c48a38d3fd84b37e66c9c0423f9744f9774" - integrity sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g== +"@jridgewell/sourcemap-codec@^1.4.14": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz#3188bcb273a414b0d215fd22a58540b989b9409a" + integrity sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ== + +"@jridgewell/trace-mapping@^0.3.24", "@jridgewell/trace-mapping@^0.3.25": + version "0.3.25" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.25.tgz#15f190e98895f3fc23276ee14bc76b675c2e50f0" + integrity sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ== dependencies: - "@jridgewell/resolve-uri" "^3.0.3" - "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/resolve-uri" "^3.1.0" + "@jridgewell/sourcemap-codec" "^1.4.14" "@microsoft/fast-element@^1.12.0", "@microsoft/fast-element@^1.13.0": version "1.13.0" @@ -516,10 +538,10 @@ dependencies: "@types/ms" "*" -"@types/eslint-scope@^3.7.3": - version "3.7.4" - resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.4.tgz#37fc1223f0786c39627068a12e94d6e6fc61de16" - integrity sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA== +"@types/eslint-scope@^3.7.7": + version "3.7.7" + resolved "https://registry.yarnpkg.com/@types/eslint-scope/-/eslint-scope-3.7.7.tgz#3108bd5f18b0cdb277c867b3dd449c9ed7079ac5" + integrity sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg== dependencies: "@types/eslint" "*" "@types/estree" "*" @@ -544,16 +566,16 @@ resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.0.tgz#5fb2e536c1ae9bf35366eed879e827fa59ca41c2" integrity sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ== -"@types/estree@^0.0.51": - version "0.0.51" - resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40" - integrity sha512-CuPgU6f3eT/XgKKPqKd/gLZV1Xmvf1a2R5POBOGQa6uv82xpls89HU5zKeVoyR8XzHd1RGNOlQlvUe3CFkjWNQ== - "@types/estree@^1.0.0": version "1.0.5" resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.5.tgz#a6ce3e556e00fd9895dd872dd172ad0d4bd687f4" integrity sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw== +"@types/estree@^1.0.6": + version "1.0.6" + resolved "https://registry.yarnpkg.com/@types/estree/-/estree-1.0.6.tgz#628effeeae2064a1b4e79f78e81d87b7e5fc7b50" + integrity sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw== + "@types/hast@^3.0.0": version "3.0.4" resolved "https://registry.yarnpkg.com/@types/hast/-/hast-3.0.4.tgz#1d6b39993b82cea6ad783945b0508c25903e15aa" @@ -561,7 +583,7 @@ dependencies: "@types/unist" "*" -"@types/json-schema@*", "@types/json-schema@^7.0.8": +"@types/json-schema@*": version "7.0.11" resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== @@ -620,11 +642,6 @@ resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.4.tgz#0a41252ad431c473158b22f9bfb9a63df7541cff" integrity sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ== -"@types/throttle-debounce@5.0.2": - version "5.0.2" - resolved "https://registry.yarnpkg.com/@types/throttle-debounce/-/throttle-debounce-5.0.2.tgz#3489d91673a4be830c2c9e2acf1f6cdab724102c" - integrity sha512-pDzSNulqooSKvSNcksnV72nk8p7gRqN8As71Sp28nov1IgmPKWbOEIwAWvBME5pPTtaXJAvG3O4oc76HlQ4kqQ== - "@types/unist@*", "@types/unist@^3.0.0": version "3.0.2" resolved "https://registry.yarnpkg.com/@types/unist/-/unist-3.0.2.tgz#6dd61e43ef60b34086287f83683a5c1b2dc53d20" @@ -853,125 +870,125 @@ "@microsoft/fast-react-wrapper" "^0.3.22" tslib "^2.6.2" -"@webassemblyjs/ast@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.1.tgz#2bfd767eae1a6996f432ff7e8d7fc75679c0b6a7" - integrity sha512-ukBh14qFLjxTQNTXocdyksN5QdM28S1CxHt2rdskFyL+xFV7VremuBLVbmCePj+URalXBENx/9Lm7lnhihtCSw== +"@webassemblyjs/ast@1.14.1", "@webassemblyjs/ast@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.14.1.tgz#a9f6a07f2b03c95c8d38c4536a1fdfb521ff55b6" + integrity sha512-nuBEDgQfm1ccRp/8bCQrx1frohyufl4JlbMMZ4P1wpeOfDhF6FQkxZJ1b/e+PLwr6X1Nhw6OLme5usuBWYBvuQ== dependencies: - "@webassemblyjs/helper-numbers" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" + "@webassemblyjs/helper-numbers" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" -"@webassemblyjs/floating-point-hex-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.11.1.tgz#f6c61a705f0fd7a6aecaa4e8198f23d9dc179e4f" - integrity sha512-iGRfyc5Bq+NnNuX8b5hwBrRjzf0ocrJPI6GWFodBFzmFnyvrQ83SHKhmilCU/8Jv67i4GJZBMhEzltxzcNagtQ== +"@webassemblyjs/floating-point-hex-parser@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.13.2.tgz#fcca1eeddb1cc4e7b6eed4fc7956d6813b21b9fb" + integrity sha512-6oXyTOzbKxGH4steLbLNOu71Oj+C8Lg34n6CqRvqfS2O71BxY6ByfMDRhBytzknj9yGUPVJ1qIKhRlAwO1AovA== -"@webassemblyjs/helper-api-error@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.11.1.tgz#1a63192d8788e5c012800ba6a7a46c705288fd16" - integrity sha512-RlhS8CBCXfRUR/cwo2ho9bkheSXG0+NwooXcc3PAILALf2QLdFyj7KGsKRbVc95hZnhnERon4kW/D3SZpp6Tcg== +"@webassemblyjs/helper-api-error@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-api-error/-/helper-api-error-1.13.2.tgz#e0a16152248bc38daee76dd7e21f15c5ef3ab1e7" + integrity sha512-U56GMYxy4ZQCbDZd6JuvvNV/WFildOjsaWD3Tzzvmw/mas3cXzRJPMjP83JqEsgSbyrmaGjBfDtV7KDXV9UzFQ== -"@webassemblyjs/helper-buffer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.11.1.tgz#832a900eb444884cde9a7cad467f81500f5e5ab5" - integrity sha512-gwikF65aDNeeXa8JxXa2BAk+REjSyhrNC9ZwdT0f8jc4dQQeDQ7G4m0f2QCLPJiMTTO6wfDmRmj/pW0PsUvIcA== +"@webassemblyjs/helper-buffer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-buffer/-/helper-buffer-1.14.1.tgz#822a9bc603166531f7d5df84e67b5bf99b72b96b" + integrity sha512-jyH7wtcHiKssDtFPRB+iQdxlDf96m0E39yb0k5uJVhFGleZFoNw1c4aeIcVUPPbXUVJ94wwnMOAqUHyzoEPVMA== -"@webassemblyjs/helper-numbers@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.11.1.tgz#64d81da219fbbba1e3bd1bfc74f6e8c4e10a62ae" - integrity sha512-vDkbxiB8zfnPdNK9Rajcey5C0w+QJugEglN0of+kmO8l7lDb77AnlKYQF7aarZuCrv+l0UvqL+68gSDr3k9LPQ== +"@webassemblyjs/helper-numbers@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-numbers/-/helper-numbers-1.13.2.tgz#dbd932548e7119f4b8a7877fd5a8d20e63490b2d" + integrity sha512-FE8aCmS5Q6eQYcV3gI35O4J789wlQA+7JrqTTpJqn5emA4U2hvwJmvFRC0HODS+3Ye6WioDklgd6scJ3+PLnEA== dependencies: - "@webassemblyjs/floating-point-hex-parser" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" + "@webassemblyjs/floating-point-hex-parser" "1.13.2" + "@webassemblyjs/helper-api-error" "1.13.2" "@xtuc/long" "4.2.2" -"@webassemblyjs/helper-wasm-bytecode@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.11.1.tgz#f328241e41e7b199d0b20c18e88429c4433295e1" - integrity sha512-PvpoOGiJwXeTrSf/qfudJhwlvDQxFgelbMqtq52WWiXC6Xgg1IREdngmPN3bs4RoO83PnL/nFrxucXj1+BX62Q== +"@webassemblyjs/helper-wasm-bytecode@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.13.2.tgz#e556108758f448aae84c850e593ce18a0eb31e0b" + integrity sha512-3QbLKy93F0EAIXLh0ogEVR6rOubA9AoZ+WRYhNbFyuB70j3dRdwH9g+qXhLAO0kiYGlg3TxDV+I4rQTr/YNXkA== -"@webassemblyjs/helper-wasm-section@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.11.1.tgz#21ee065a7b635f319e738f0dd73bfbda281c097a" - integrity sha512-10P9No29rYX1j7F3EVPX3JvGPQPae+AomuSTPiF9eBQeChHI6iqjMIwR9JmOJXwpnn/oVGDk7I5IlskuMwU/pg== +"@webassemblyjs/helper-wasm-section@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.14.1.tgz#9629dda9c4430eab54b591053d6dc6f3ba050348" + integrity sha512-ds5mXEqTJ6oxRoqjhWDU83OgzAYjwsCV8Lo/N+oRsNDmx/ZDpqalmrtgOMkHwxsG0iI//3BwWAErYRHtgn0dZw== dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/wasm-gen" "1.14.1" -"@webassemblyjs/ieee754@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.11.1.tgz#963929e9bbd05709e7e12243a099180812992614" - integrity sha512-hJ87QIPtAMKbFq6CGTkZYJivEwZDbQUgYd3qKSadTNOhVY7p+gfP6Sr0lLRVTaG1JjFj+r3YchoqRYxNH3M0GQ== +"@webassemblyjs/ieee754@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/ieee754/-/ieee754-1.13.2.tgz#1c5eaace1d606ada2c7fd7045ea9356c59ee0dba" + integrity sha512-4LtOzh58S/5lX4ITKxnAK2USuNEvpdVV9AlgGQb8rJDHaLeHciwG4zlGr0j/SNWlr7x3vO1lDEsuePvtcDNCkw== dependencies: "@xtuc/ieee754" "^1.2.0" -"@webassemblyjs/leb128@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.11.1.tgz#ce814b45574e93d76bae1fb2644ab9cdd9527aa5" - integrity sha512-BJ2P0hNZ0u+Th1YZXJpzW6miwqQUGcIHT1G/sf72gLVD9DZ5AdYTqPNbHZh6K1M5VmKvFXwGSWZADz+qBWxeRw== +"@webassemblyjs/leb128@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/leb128/-/leb128-1.13.2.tgz#57c5c3deb0105d02ce25fa3fd74f4ebc9fd0bbb0" + integrity sha512-Lde1oNoIdzVzdkNEAWZ1dZ5orIbff80YPdHx20mrHwHrVNNTjNr8E3xz9BdpcGqRQbAEa+fkrCb+fRFTl/6sQw== dependencies: "@xtuc/long" "4.2.2" -"@webassemblyjs/utf8@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.11.1.tgz#d1f8b764369e7c6e6bae350e854dec9a59f0a3ff" - integrity sha512-9kqcxAEdMhiwQkHpkNiorZzqpGrodQQ2IGrHHxCy+Ozng0ofyMA0lTqiLkVs1uzTRejX+/O0EOT7KxqVPuXosQ== - -"@webassemblyjs/wasm-edit@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.11.1.tgz#ad206ebf4bf95a058ce9880a8c092c5dec8193d6" - integrity sha512-g+RsupUC1aTHfR8CDgnsVRVZFJqdkFHpsHMfJuWQzWU3tvnLC07UqHICfP+4XyL2tnr1amvl1Sdp06TnYCmVkA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/helper-wasm-section" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-opt" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - "@webassemblyjs/wast-printer" "1.11.1" - -"@webassemblyjs/wasm-gen@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.11.1.tgz#86c5ea304849759b7d88c47a32f4f039ae3c8f76" - integrity sha512-F7QqKXwwNlMmsulj6+O7r4mmtAlCWfO/0HdgOxSklZfQcDu0TpLiD1mRt/zF25Bk59FIjEuGAIyn5ei4yMfLhA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wasm-opt@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.11.1.tgz#657b4c2202f4cf3b345f8a4c6461c8c2418985f2" - integrity sha512-VqnkNqnZlU5EB64pp1l7hdm3hmQw7Vgqa0KF/KCNO9sIpI6Fk6brDEiX+iCOYrvMuBWDws0NkTOxYEb85XQHHw== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-buffer" "1.11.1" - "@webassemblyjs/wasm-gen" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - -"@webassemblyjs/wasm-parser@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.11.1.tgz#86ca734534f417e9bd3c67c7a1c75d8be41fb199" - integrity sha512-rrBujw+dJu32gYB7/Lup6UhdkPx9S9SnobZzRVL7VcBH9Bt9bCBLEuX/YXOOtBsOZ4NQrRykKhffRWHvigQvOA== - dependencies: - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/helper-api-error" "1.11.1" - "@webassemblyjs/helper-wasm-bytecode" "1.11.1" - "@webassemblyjs/ieee754" "1.11.1" - "@webassemblyjs/leb128" "1.11.1" - "@webassemblyjs/utf8" "1.11.1" - -"@webassemblyjs/wast-printer@1.11.1": - version "1.11.1" - resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.11.1.tgz#d0c73beda8eec5426f10ae8ef55cee5e7084c2f0" - integrity sha512-IQboUWM4eKzWW+N/jij2sRatKMh99QEelo3Eb2q0qXkvPRISAj8Qxtmw5itwqK+TTkBuUIE45AxYPToqPtL5gg== - dependencies: - "@webassemblyjs/ast" "1.11.1" +"@webassemblyjs/utf8@1.13.2": + version "1.13.2" + resolved "https://registry.yarnpkg.com/@webassemblyjs/utf8/-/utf8-1.13.2.tgz#917a20e93f71ad5602966c2d685ae0c6c21f60f1" + integrity sha512-3NQWGjKTASY1xV5m7Hr0iPeXD9+RDobLll3T9d2AO+g3my8xy5peVyjSag4I50mR1bBSN/Ct12lo+R9tJk0NZQ== + +"@webassemblyjs/wasm-edit@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-edit/-/wasm-edit-1.14.1.tgz#ac6689f502219b59198ddec42dcd496b1004d597" + integrity sha512-RNJUIQH/J8iA/1NzlE4N7KtyZNHi3w7at7hDjvRNm5rcUXa00z1vRz3glZoULfJ5mpvYhLybmVcwcjGrC1pRrQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/helper-wasm-section" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-opt" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + "@webassemblyjs/wast-printer" "1.14.1" + +"@webassemblyjs/wasm-gen@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-gen/-/wasm-gen-1.14.1.tgz#991e7f0c090cb0bb62bbac882076e3d219da9570" + integrity sha512-AmomSIjP8ZbfGQhumkNvgC33AY7qtMCXnN6bL2u2Js4gVCg8fp735aEiMSBbDR7UQIj90n4wKAFUSEd0QN2Ukg== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wasm-opt@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-opt/-/wasm-opt-1.14.1.tgz#e6f71ed7ccae46781c206017d3c14c50efa8106b" + integrity sha512-PTcKLUNvBqnY2U6E5bdOQcSM+oVP/PmrDY9NzowJjislEjwP/C4an2303MCVS2Mg9d3AJpIGdUFIQQWbPds0Sw== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-buffer" "1.14.1" + "@webassemblyjs/wasm-gen" "1.14.1" + "@webassemblyjs/wasm-parser" "1.14.1" + +"@webassemblyjs/wasm-parser@1.14.1", "@webassemblyjs/wasm-parser@^1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wasm-parser/-/wasm-parser-1.14.1.tgz#b3e13f1893605ca78b52c68e54cf6a865f90b9fb" + integrity sha512-JLBl+KZ0R5qB7mCnud/yyX08jWFw5MsoalJ1pQ4EdFlgj9VdXKGuENGsiCIjegI1W7p91rUlcB/LB5yRJKNTcQ== + dependencies: + "@webassemblyjs/ast" "1.14.1" + "@webassemblyjs/helper-api-error" "1.13.2" + "@webassemblyjs/helper-wasm-bytecode" "1.13.2" + "@webassemblyjs/ieee754" "1.13.2" + "@webassemblyjs/leb128" "1.13.2" + "@webassemblyjs/utf8" "1.13.2" + +"@webassemblyjs/wast-printer@1.14.1": + version "1.14.1" + resolved "https://registry.yarnpkg.com/@webassemblyjs/wast-printer/-/wast-printer-1.14.1.tgz#3bb3e9638a8ae5fdaf9610e7a06b4d9f9aa6fe07" + integrity sha512-kPSSXE6De1XOR820C90RIo2ogvZG+c3KiHzqUoO/F34Y2shGzesfqv7o57xrxovZJH/MetF5UjroJ/R/3isoiw== + dependencies: + "@webassemblyjs/ast" "1.14.1" "@xtuc/long" "4.2.2" "@webpack-cli/configtest@^1.1.0": @@ -1014,20 +1031,15 @@ accepts@~1.3.5: mime-types "~2.1.34" negotiator "0.6.3" -acorn-import-assertions@^1.7.6: - version "1.8.0" - resolved "https://registry.yarnpkg.com/acorn-import-assertions/-/acorn-import-assertions-1.8.0.tgz#ba2b5939ce62c238db6d93d81c9b111b29b855e9" - integrity sha512-m7VZ3jwz4eK6A4Vtt8Ew1/mNbP24u0FhdyfA7fSvnJR6LMdfOYnmuIrrJAgrYfYJ10F/otaHTtrtrtmHdMNzEw== - acorn-jsx@^5.3.2: version "5.3.2" resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== -acorn@^8.5.0, acorn@^8.7.1: - version "8.8.0" - resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.0.tgz#88c0187620435c7f6015803f5539dae05a9dbea8" - integrity sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w== +acorn@^8.14.0, acorn@^8.8.2: + version "8.14.0" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.14.0.tgz#063e2c70cac5fb4f6467f0b11152e04c682795b0" + integrity sha512-cl669nCJTZBsL97OF4kUQm5g5hC2uihk0NxY3WENAC0TYdILVkAyHymAntgxGkl7K+t0cXIrH5siy5S4XkFycA== acorn@^8.9.0: version "8.10.0" @@ -1039,10 +1051,19 @@ agent-base@^7.1.0, agent-base@^7.1.2: resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-7.1.3.tgz#29435eb821bc4194633a5b89e5bc4703bafc25a1" integrity sha512-jRR5wdylq8CkOe6hei19GGZnxM6rBGwFl3Bg0YItGDimvjGtAvdZk4Pu6Cl4u4Igsws4a1fd1Vq3ezrhn4KmFw== -ajv-keywords@^3.5.2: - version "3.5.2" - resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-3.5.2.tgz#31f29da5ab6e00d1c2d329acf7b5929614d5014d" - integrity sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ== +ajv-formats@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ajv-formats/-/ajv-formats-2.1.1.tgz#6e669400659eb74973bbf2e33327180a0996b520" + integrity sha512-Wx0Kx52hxE7C18hkMEggYlEifqWZtYaRgouJor+WMdPnQyEK13vgEWyVNup7SoeeoLMsr4kf5h6dOW11I15MUA== + dependencies: + ajv "^8.0.0" + +ajv-keywords@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/ajv-keywords/-/ajv-keywords-5.1.0.tgz#69d4d385a4733cdbeab44964a1170a88f87f0e16" + integrity sha512-YCS/JNFAUyr5vAuhk1DWm1CBxRHW9LbJ2ozWeemrIqpbsqKjHVxYPyi5GC0rjZIT5JxJ3virVTS8wk4i/Z+krw== + dependencies: + fast-deep-equal "^3.1.3" ajv@8.11.0: version "8.11.0" @@ -1054,7 +1075,7 @@ ajv@8.11.0: require-from-string "^2.0.2" uri-js "^4.2.2" -ajv@^6.12.4, ajv@^6.12.5: +ajv@^6.12.4: version "6.12.6" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== @@ -1064,6 +1085,16 @@ ajv@^6.12.4, ajv@^6.12.5: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.0.0, ajv@^8.9.0: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ansi-align@^3.0.1: version "3.0.1" resolved "https://registry.yarnpkg.com/ansi-align/-/ansi-align-3.0.1.tgz#0cdf12e111ace773a86e9a1fad1225c43cb19a59" @@ -1278,15 +1309,15 @@ braces@^3.0.1, braces@^3.0.2: dependencies: fill-range "^7.0.1" -browserslist@^4.14.5: - version "4.21.3" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.3.tgz#5df277694eb3c48bc5c4b05af3e8b7e09c5a6d1a" - integrity sha512-898rgRXLAyRkM1GryrrBHGkqA5hlpkV5MhtZwg9QXeiyLUYs2k00Un05aX5l2/yJIOObYKOpS2JNo8nJDE7fWQ== +browserslist@^4.24.0: + version "4.24.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.24.4.tgz#c6b2865a3f08bcb860a0e827389003b9fe686e4b" + integrity sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A== dependencies: - caniuse-lite "^1.0.30001370" - electron-to-chromium "^1.4.202" - node-releases "^2.0.6" - update-browserslist-db "^1.0.5" + caniuse-lite "^1.0.30001688" + electron-to-chromium "^1.5.73" + node-releases "^2.0.19" + update-browserslist-db "^1.1.1" buffer-crc32@~0.2.3: version "0.2.13" @@ -1342,10 +1373,10 @@ camelcase@^7.0.0: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-7.0.0.tgz#fd112621b212126741f998d614cbc2a8623fd174" integrity sha512-JToIvOmz6nhGsUhAYScbo2d6Py5wojjNfoxoc2mEVLUdJ70gJK2gnd+ABY1Tc3sVMyK7QDPtN0T/XdlCQWITyQ== -caniuse-lite@^1.0.30001370: - version "1.0.30001387" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001387.tgz#90d2b9bdfcc3ab9a5b9addee00a25ef86c9e2e1e" - integrity sha512-fKDH0F1KOJvR+mWSOvhj8lVRr/Q/mc5u5nabU2vi1/sgvlSqEsE8dOq0Hy/BqVbDkCYQPRRHB1WRjW6PGB/7PA== +caniuse-lite@^1.0.30001688: + version "1.0.30001700" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001700.tgz#26cd429cf09b4fd4e745daf4916039c794d720f6" + integrity sha512-2S6XIXwaE7K7erT8dY+kLQcpa5ms63XlRkMkReXjle+kf6c5g38vyMl+Z5y8dSxOFDhcFe+nxnn261PLxBSQsQ== ccount@^2.0.0: version "2.0.1" @@ -1791,10 +1822,10 @@ ecdsa-sig-formatter@1.0.11: dependencies: safe-buffer "^5.0.1" -electron-to-chromium@^1.4.202: - version "1.4.239" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.239.tgz#5b04acb39c16b897a508980d1be95ba5f0201771" - integrity sha512-XbhfzxPIFzMjJm17T7yUGZEyYh5XuUjrA/FQ7JUy2bEd4qQ7MvFTaKpZ6zXZog1cfVttESo2Lx0ctnf7eQOaAQ== +electron-to-chromium@^1.5.73: + version "1.5.128" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.5.128.tgz#8ea537b369c32527b3cc47df7973bffe5d3c2980" + integrity sha512-bo1A4HH/NS522Ws0QNFIzyPcyUUNV/yyy70Ho1xqfGYzPUme2F/xr4tlEOuM6/A538U1vDA7a4XfCd1CKRegKQ== emoji-regex@^8.0.0: version "8.0.0" @@ -1813,7 +1844,7 @@ end-of-stream@^1.1.0, end-of-stream@^1.4.1: dependencies: once "^1.4.0" -enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: +enhanced-resolve@^5.0.0: version "5.10.0" resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz#0dc579c3bb2a1032e357ac45b8f3a6f3ad4fb1e6" integrity sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ== @@ -1821,6 +1852,14 @@ enhanced-resolve@^5.0.0, enhanced-resolve@^5.10.0: graceful-fs "^4.2.4" tapable "^2.2.0" +enhanced-resolve@^5.17.1: + version "5.18.1" + resolved "https://registry.yarnpkg.com/enhanced-resolve/-/enhanced-resolve-5.18.1.tgz#728ab082f8b7b6836de51f1637aab5d3b9568faf" + integrity sha512-ZSW3ma5GkcQBIpwZTSRAI8N71Uuwgs93IezB7mf7R60tC8ZbJideoDNKjHn2O9KIlx6rkGTTEk1xUCK2E1Y2Yg== + dependencies: + graceful-fs "^4.2.4" + tapable "^2.2.0" + entities@^2.0.0: version "2.2.0" resolved "https://registry.yarnpkg.com/entities/-/entities-2.2.0.tgz#098dc90ebb83d8dffa089d55256b351d34c4da55" @@ -1836,15 +1875,15 @@ envinfo@^7.7.3: resolved "https://registry.yarnpkg.com/envinfo/-/envinfo-7.8.1.tgz#06377e3e5f4d379fea7ac592d5ad8927e0c4d475" integrity sha512-/o+BXHmB7ocbHEAs6F2EnG0ogybVVUdkRunTT2glZU9XAaGmhqskrvKwqXuDfNjEO0LZKWdejEEpnq8aM0tOaw== -es-module-lexer@^0.9.0: - version "0.9.3" - resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-0.9.3.tgz#6f13db00cc38417137daf74366f535c8eb438f19" - integrity sha512-1HQ2M2sPtxwnvOvT1ZClHyQDiggdNjURWpY2we6aMKCQiUVxTmVs2UYPLIrD84sS+kMdUwfBSylbJPwNnBrnHQ== +es-module-lexer@^1.2.1: + version "1.6.0" + resolved "https://registry.yarnpkg.com/es-module-lexer/-/es-module-lexer-1.6.0.tgz#da49f587fd9e68ee2404fe4e256c0c7d3a81be21" + integrity sha512-qqnD1yMU6tk/jnaMosogGySTZP8YtUgAffA9nMN+E/rjxcfRQ6IEk7IiozUjgxKoFHBGjTLnrHB/YC45r/59EQ== -escalade@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" - integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== +escalade@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.2.0.tgz#011a3f69856ba189dffa7dc8fcce99d2a87903e5" + integrity sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA== escape-string-regexp@^1.0.5: version "1.0.5" @@ -2034,6 +2073,11 @@ fast-levenshtein@^2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= +fast-uri@^3.0.1: + version "3.0.6" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.6.tgz#88f130b77cfaea2378d56bf970dea21257a68748" + integrity sha512-Atfo14OibSv5wAp4VWNsFYE1AchQRTv9cBGWET4pZWHzYshFSS9NQI6I57rdKn9croWVMbYFbLhJ+yJvmZIIHw== + fast-url-parser@1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" @@ -2230,11 +2274,16 @@ globby@^11.1.0: merge2 "^1.4.1" slash "^3.0.0" -graceful-fs@^4.1.2, graceful-fs@^4.2.4, graceful-fs@^4.2.9: +graceful-fs@^4.1.2, graceful-fs@^4.2.4: version "4.2.10" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== +graceful-fs@^4.2.11: + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== + graphemer@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/graphemer/-/graphemer-1.4.0.tgz#fb2f1d55e0e3a1849aeffc90c4fa0dd53a0e66c6" @@ -3416,10 +3465,10 @@ node-fetch@^2.6.7: dependencies: whatwg-url "^5.0.0" -node-releases@^2.0.6: - version "2.0.6" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.6.tgz#8a7088c63a55e493845683ebf3c828d8c51c5503" - integrity sha512-PiVXnNuFm5+iYkLBNeq5211hvO38y63T0i2KKh2KnUs3RpzJ+JtODFjkD8yjLwnDkTYF1eKXheUwdssR+NRZdg== +node-releases@^2.0.19: + version "2.0.19" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.19.tgz#9e445a52950951ec4d177d843af370b411caf314" + integrity sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw== npm-run-path@^4.0.1: version "4.0.1" @@ -3641,6 +3690,11 @@ picocolors@^1.0.0: resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== +picocolors@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.1.1.tgz#3d321af3eab939b083c8f929a1d12cda81c26b6b" + integrity sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA== + picomatch@^2.2.3, picomatch@^2.3.1: version "2.3.1" resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" @@ -3727,11 +3781,6 @@ prelude-ls@^1.2.1: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== -primeflex@^3.3.1: - version "3.3.1" - resolved "https://registry.yarnpkg.com/primeflex/-/primeflex-3.3.1.tgz#361dddf6eb5db50d733e4cddd4b6e376a3d7bd68" - integrity sha512-zaOq3YvcOYytbAmKv3zYc+0VNS9Wg5d37dfxZnveKBFPr7vEIwfV5ydrpiouTft8MVW6qNjfkaQphHSnvgQbpQ== - process-nextick-args@~2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2" @@ -4365,14 +4414,15 @@ scheduler@^0.23.2: dependencies: loose-envify "^1.1.0" -schema-utils@^3.1.0, schema-utils@^3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-3.1.1.tgz#bc74c4b6b6995c1d88f76a8b77bea7219e0c8281" - integrity sha512-Y5PQxS4ITlC+EahLuXaY86TXfR7Dc5lw294alXOq86JAHCihAIZfqv8nNCWvaEJvaC51uN9hbLGeV0cFBdH+Fw== +schema-utils@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/schema-utils/-/schema-utils-4.3.0.tgz#3b669f04f71ff2dfb5aba7ce2d5a9d79b35622c0" + integrity sha512-Gf9qqc58SpCA/xdziiHz35F4GNIWYWZrEshUc/G/r5BnLph6xpKuLeoJoQuj5WfBIx/eQLf+hmVPYHaxJu7V2g== dependencies: - "@types/json-schema" "^7.0.8" - ajv "^6.12.5" - ajv-keywords "^3.5.2" + "@types/json-schema" "^7.0.9" + ajv "^8.9.0" + ajv-formats "^2.1.1" + ajv-keywords "^5.1.0" scroll-into-view-if-needed@^3.1.0: version "3.1.0" @@ -4412,10 +4462,10 @@ semver@^7.5.4: resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.2.tgz#1e3b34759f896e8f14d6134732ce798aeb0c6e13" integrity sha512-FNAIBWCx9qcRhoHcgcJ0gvU7SN1lYU2ZXuSfl04bSC5OpvDHFyJCjdNHomPXxjQlCBU67YW64PzY7/VIEH7F2w== -serialize-javascript@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.0.tgz#efae5d88f45d7924141da8b5c3a7a7e663fefeb8" - integrity sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag== +serialize-javascript@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-6.0.2.tgz#defa1e055c83bf6d59ea805d8da862254eb6a6c2" + integrity sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g== dependencies: randombytes "^2.1.0" @@ -4748,24 +4798,24 @@ tar-stream@^2.1.4: inherits "^2.0.3" readable-stream "^3.1.1" -terser-webpack-plugin@^5.1.3: - version "5.3.6" - resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.6.tgz#5590aec31aa3c6f771ce1b1acca60639eab3195c" - integrity sha512-kfLFk+PoLUQIbLmB1+PZDMRSZS99Mp+/MHqDNmMA6tOItzRt+Npe3E+fsMs5mfcM0wCtrrdU387UnV+vnSffXQ== +terser-webpack-plugin@^5.3.11: + version "5.3.11" + resolved "https://registry.yarnpkg.com/terser-webpack-plugin/-/terser-webpack-plugin-5.3.11.tgz#93c21f44ca86634257cac176f884f942b7ba3832" + integrity sha512-RVCsMfuD0+cTt3EwX8hSl2Ks56EbFHWmhluwcqoPKtBnfjiT6olaq7PRIRfhyU8nnC2MrnDrBLfrD/RGE+cVXQ== dependencies: - "@jridgewell/trace-mapping" "^0.3.14" + "@jridgewell/trace-mapping" "^0.3.25" jest-worker "^27.4.5" - schema-utils "^3.1.1" - serialize-javascript "^6.0.0" - terser "^5.14.1" + schema-utils "^4.3.0" + serialize-javascript "^6.0.2" + terser "^5.31.1" -terser@^5.14.1: - version "5.15.0" - resolved "https://registry.yarnpkg.com/terser/-/terser-5.15.0.tgz#e16967894eeba6e1091509ec83f0c60e179f2425" - integrity sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA== +terser@^5.31.1: + version "5.39.0" + resolved "https://registry.yarnpkg.com/terser/-/terser-5.39.0.tgz#0e82033ed57b3ddf1f96708d123cca717d86ca3a" + integrity sha512-LBAhFyLho16harJoWMg/nZsQYgTrg5jXOn2nCYjRUcZZEdE3qa2zb8QEDRUGVZBW4rlazf2fxkg8tztybTaqWw== dependencies: - "@jridgewell/source-map" "^0.3.2" - acorn "^8.5.0" + "@jridgewell/source-map" "^0.3.3" + acorn "^8.8.2" commander "^2.20.0" source-map-support "~0.5.20" @@ -4967,13 +5017,13 @@ unist-util-visit@^5.0.0: unist-util-is "^6.0.0" unist-util-visit-parents "^6.0.0" -update-browserslist-db@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.5.tgz#be06a5eedd62f107b7c19eb5bcefb194411abf38" - integrity sha512-dteFFpCyvuDdr9S/ff1ISkKt/9YZxKjI9WlRR99c180GaztJtRa/fn18FdxGVKVsnPY7/a/FDN68mcvUmP4U7Q== +update-browserslist-db@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.1.2.tgz#97e9c96ab0ae7bcac08e9ae5151d26e6bc6b5580" + integrity sha512-PPypAm5qvlD7XMZC3BujecnaOxwhrtoFR+Dqkk5Aa/6DssiH0ibKoketaj9w8LP7Bont1rYeoV5plxD7RTEPRg== dependencies: - escalade "^3.1.1" - picocolors "^1.0.0" + escalade "^3.2.0" + picocolors "^1.1.1" update-check@1.5.4: version "1.5.4" @@ -5046,10 +5096,10 @@ vscode-messenger@^0.4.5: dependencies: vscode-messenger-common "^0.4.5" -watchpack@^2.4.0: - version "2.4.0" - resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.0.tgz#fa33032374962c78113f93c7f2fb4c54c9862a5d" - integrity sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg== +watchpack@^2.4.1: + version "2.4.2" + resolved "https://registry.yarnpkg.com/watchpack/-/watchpack-2.4.2.tgz#2feeaed67412e7c33184e5a79ca738fbd38564da" + integrity sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw== dependencies: glob-to-regexp "^0.4.1" graceful-fs "^4.1.2" @@ -5090,34 +5140,33 @@ webpack-sources@^3.2.3: resolved "https://registry.yarnpkg.com/webpack-sources/-/webpack-sources-3.2.3.tgz#2d4daab8451fd4b240cc27055ff6a0c2ccea0cde" integrity sha512-/DyMEOrDgLKKIG0fmvtz+4dUX/3Ghozwgm6iPp8KRhvn+eQf9+Q7GWxVNMk3+uCPWfdXYC4ExGBckIXdFEfH1w== -webpack@^5.70.0: - version "5.74.0" - resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.74.0.tgz#02a5dac19a17e0bb47093f2be67c695102a55980" - integrity sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA== - dependencies: - "@types/eslint-scope" "^3.7.3" - "@types/estree" "^0.0.51" - "@webassemblyjs/ast" "1.11.1" - "@webassemblyjs/wasm-edit" "1.11.1" - "@webassemblyjs/wasm-parser" "1.11.1" - acorn "^8.7.1" - acorn-import-assertions "^1.7.6" - browserslist "^4.14.5" +webpack@^5.98.0: + version "5.98.0" + resolved "https://registry.yarnpkg.com/webpack/-/webpack-5.98.0.tgz#44ae19a8f2ba97537978246072fb89d10d1fbd17" + integrity sha512-UFynvx+gM44Gv9qFgj0acCQK2VE1CtdfwFdimkapco3hlPCJ/zeq73n2yVKimVbtm+TnApIugGhLJnkU6gjYXA== + dependencies: + "@types/eslint-scope" "^3.7.7" + "@types/estree" "^1.0.6" + "@webassemblyjs/ast" "^1.14.1" + "@webassemblyjs/wasm-edit" "^1.14.1" + "@webassemblyjs/wasm-parser" "^1.14.1" + acorn "^8.14.0" + browserslist "^4.24.0" chrome-trace-event "^1.0.2" - enhanced-resolve "^5.10.0" - es-module-lexer "^0.9.0" + enhanced-resolve "^5.17.1" + es-module-lexer "^1.2.1" eslint-scope "5.1.1" events "^3.2.0" glob-to-regexp "^0.4.1" - graceful-fs "^4.2.9" + graceful-fs "^4.2.11" json-parse-even-better-errors "^2.3.1" loader-runner "^4.2.0" mime-types "^2.1.27" neo-async "^2.6.2" - schema-utils "^3.1.0" + schema-utils "^4.3.0" tapable "^2.1.1" - terser-webpack-plugin "^5.1.3" - watchpack "^2.4.0" + terser-webpack-plugin "^5.3.11" + watchpack "^2.4.1" webpack-sources "^3.2.3" whatwg-url@^5.0.0: