@vscode-elements/elements 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"vscode-scrollable.js","sourceRoot":"","sources":["../../src/vscode-scrollable/vscode-scrollable.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAClE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAC,gBAAgB,EAAC,MAAM,mCAAmC,CAAC;AACnE,OAAO,MAAM,MAAM,+BAA+B,CAAC;AAInD;;;;;;;GAOG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IA6C9C;;OAEG;IAEH,IAAI,SAAS,CAAC,GAAW;QACvB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACxB,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5B,IAAI,CAAC,aAAa,EAAE,CAAC;IACvB,CAAC;IACD,IAAI,SAAS;QACX,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAID;;OAEG;IACH,IAAI,SAAS;QACX,IAAI,CAAC,IAAI,CAAC,oBAAoB,EAAE,CAAC;YAC/B,OAAO,CAAC,CAAC;QACX,CAAC;QAED,OAAO,CACL,IAAI,CAAC,oBAAoB,CAAC,YAAY;YACtC,IAAI,CAAC,oBAAoB,CAAC,YAAY,CACvC,CAAC;IACJ,CAAC;IAuCD,2BAA2B;IAE3B;QACE,KAAK,EAAE,CAAC;QAhHV;;;WAGG;QAEH,kBAAa,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AAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;gDAC3B;AAMd;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;kDACxB;AAMjB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;iDAMjD;AAsBO;IADP,KAAK,EAAE;qDACoB;AAGpB;IADP,KAAK,EAAE;sDACiB;AAGjB;IADP,KAAK,EAAE;iDACY;AAGZ;IADP,KAAK,EAAE;uDACsB;AAGtB;IADP,KAAK,EAAE;oDACmB;AAGnB;IADP,KAAK,EAAE;sDACqB;AAGrB;IADP,KAAK,CAAC,UAAU,CAAC;yDACuB;AAGjC;IADP,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC;6DACa;AAGrC;IADP,KAAK,CAAC,uBAAuB,CAAC;8DACe;AAGtC;IADP,qBAAqB,EAAE;2DACa;AAvG1B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAyY5B","sourcesContent":["import {html, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement, VscElement} from '../includes/VscElement.js';\nimport {stylePropertyMap} from '../includes/style-property-map.js';\nimport styles from './vscode-scrollable.styles.js';\n\nexport type VscScrollableScrollEvent = CustomEvent<number>;\n\n/**\n * @tag vscode-scrollable\n *\n * @cssprop [--vscode-scrollbar-shadow=#000000]\n * @cssprop [--vscode-scrollbarSlider-background=rgba(121, 121, 121, 0.4)]\n * @cssprop [--vscode-scrollbarSlider-hoverBackground=rgba(100, 100, 100, 0.7)]\n * @cssprop [--vscode-scrollbarSlider-activeBackground=rgba(191, 191, 191, 0.4)]\n */\n@customElement('vscode-scrollable')\nexport class VscodeScrollable extends VscElement {\n static override styles = styles;\n\n /**\n * By default, the scrollbar appears only when the cursor hovers over the\n * component. With this option, the scrollbar will always be visible.\n */\n @property({type: Boolean, reflect: true, attribute: 'always-visible'})\n alwaysVisible = false;\n\n /**\n * Scrolling speed multiplier when pressing `Alt`. This property is designed to use the value of\n * `editor.fastScrollSensitivity`, `workbench.list.fastScrollSensitivity` or\n * `terminal.integrated.fastScrollSensitivity` depending on the context.\n */\n @property({type: Number, attribute: 'fast-scroll-sensitivity'})\n fastScrollSensitivity = 5;\n\n /**\n * This setting defines the scrollbar's minimum size when the component contains a large amount of content.\n */\n @property({type: Number, attribute: 'min-thumb-size'})\n minThumbSize = 20;\n\n /**\n * A multiplier to be used on the `deltaY` of the mouse wheel scroll events. This property is\n * designed to use the value of `editor.mouseWheelScrollSensitivity`,\n * `workbench.list.mouseWheelScrollSensitivity` or\n * `terminal.integrated.mouseWheelScrollSensitivity` depending on the context.\n */\n @property({type: Number, attribute: 'mouse-wheel-scroll-sensitivity'})\n mouseWheelScrollSensitivity = 1;\n\n /**\n * Controls shadow visibility when content overflows.\n */\n @property({type: Boolean, reflect: true})\n shadow = true;\n\n /**\n * It's true when `scrollPos` greater than 0\n */\n @property({type: Boolean, reflect: true})\n scrolled = false;\n\n /**\n * Scroll position.\n */\n @property({type: Number, attribute: 'scroll-pos'})\n set scrollPos(val: number) {\n this._scrollPos = val;\n this._updateScrollbar();\n this._updateThumbPosition();\n this.requestUpdate();\n }\n get scrollPos(): number {\n return this._scrollPos;\n }\n\n private _scrollPos = 0;\n\n /**\n * The maximum amount of the `scrollPos`.\n */\n get scrollMax(): number {\n if (!this._scrollableContainer) {\n return 0;\n }\n\n return (\n this._scrollableContainer.scrollHeight -\n this._scrollableContainer.clientHeight\n );\n }\n\n @state()\n private _isDragging = false;\n\n @state()\n private _thumbHeight = 0;\n\n @state()\n private _thumbY = 0;\n\n @state()\n private _thumbVisible = false;\n\n @state()\n private _thumbFade = false;\n\n @state()\n private _thumbActive = false;\n\n @query('.content')\n private _contentElement!: HTMLDivElement;\n\n @query('.scrollbar-thumb', true)\n private _scrollThumbElement!: HTMLDivElement;\n\n @query('.scrollable-container')\n private _scrollableContainer!: HTMLDivElement;\n\n @queryAssignedElements()\n private _assignedElements!: NodeList;\n\n private _hostResizeObserver!: ResizeObserver;\n private _contentResizeObserver!: ResizeObserver;\n private _scrollThumbStartY = 0;\n private _mouseStartY = 0;\n private _scrollbarVisible = true;\n private _scrollbarTrackZ = 0;\n\n //#region lifecycle methods\n\n constructor() {\n super();\n this.addEventListener('mouseover', this._handleComponentMouseOver);\n this.addEventListener('mouseout', this._handleComponentMouseOut);\n this.addEventListener('wheel', this._handleComponentWheel);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this._hostResizeObserver = new ResizeObserver(this._resizeObserverCallback);\n this._contentResizeObserver = new ResizeObserver(\n this._resizeObserverCallback\n );\n\n this.requestUpdate();\n\n this.updateComplete.then(() => {\n this._hostResizeObserver.observe(this);\n this._contentResizeObserver.observe(this._contentElement);\n this._updateThumbPosition();\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this._hostResizeObserver.unobserve(this);\n this._hostResizeObserver.disconnect();\n this._contentResizeObserver.unobserve(this._contentElement);\n this._contentResizeObserver.disconnect();\n }\n\n protected override firstUpdated(_changedProperties: PropertyValues): void {\n this._updateThumbPosition();\n }\n\n //#endregion\n\n private _resizeObserverCallback = () => {\n this._updateScrollbar();\n this._updateThumbPosition();\n };\n\n private _calcThumbHeight() {\n const componentHeight = this.offsetHeight;\n const contentHeight = this._contentElement?.offsetHeight ?? 0;\n const proposedSize = componentHeight * (componentHeight / contentHeight);\n\n return Math.max(this.minThumbSize, proposedSize);\n }\n\n private _updateScrollbar() {\n const contentHeight = this._contentElement?.offsetHeight ?? 0;\n const componentHeight = this.offsetHeight;\n\n if (componentHeight >= contentHeight) {\n this._scrollbarVisible = false;\n } else {\n this._scrollbarVisible = true;\n this._thumbHeight = this._calcThumbHeight();\n }\n\n this.requestUpdate();\n }\n\n private _zIndexFix() {\n let highestZ = 0;\n\n this._assignedElements.forEach((n) => {\n if ('style' in n) {\n const computedZIndex = window.getComputedStyle(n as HTMLElement).zIndex;\n const isNumber = /([0-9-])+/g.test(computedZIndex);\n\n if (isNumber) {\n highestZ =\n Number(computedZIndex) > highestZ\n ? Number(computedZIndex)\n : highestZ;\n }\n }\n });\n\n this._scrollbarTrackZ = highestZ + 1;\n this.requestUpdate();\n }\n\n private _updateThumbPosition() {\n if (!this._scrollableContainer) {\n return;\n }\n\n this.scrolled = this.scrollPos > 0;\n\n const componentH = this.offsetHeight;\n const thumbH = this._thumbHeight;\n const contentH = this._contentElement.offsetHeight;\n\n const overflown = contentH - componentH;\n const ratio = this.scrollPos / overflown;\n const thumbYMax = componentH - thumbH;\n\n this._thumbY = Math.min(ratio * (componentH - thumbH), thumbYMax);\n }\n\n private _calculateScrollPosFromThumbPos(scrollPos: number) {\n const cmpH = this.getBoundingClientRect().height;\n const thumbH = this._scrollThumbElement.getBoundingClientRect().height;\n const contentH = this._contentElement.getBoundingClientRect().height;\n const rawScrollPos = (scrollPos / (cmpH - thumbH)) * (contentH - cmpH);\n\n return this._limitScrollPos(rawScrollPos);\n }\n\n private _limitScrollPos(newPos: number) {\n if (newPos < 0) {\n return 0;\n } else if (newPos > this.scrollMax) {\n return this.scrollMax;\n } else {\n return newPos;\n }\n }\n\n private _limitThumbPos(newPos: number) {\n const cmpH = this.getBoundingClientRect().height;\n const thumbH = this._scrollThumbElement.getBoundingClientRect().height;\n\n if (newPos < 0) {\n return 0;\n } else if (newPos > cmpH - thumbH) {\n return cmpH - thumbH;\n } else {\n return newPos;\n }\n }\n\n //#region event handlers\n private _handleSlotChange = () => {\n this._updateScrollbar();\n this._updateThumbPosition();\n this._zIndexFix();\n };\n\n private _handleScrollThumbMouseDown(event: MouseEvent) {\n const cmpCr = this.getBoundingClientRect();\n const thCr = this._scrollThumbElement.getBoundingClientRect();\n\n this._mouseStartY = event.screenY;\n this._scrollThumbStartY = thCr.top - cmpCr.top;\n this._isDragging = true;\n this._thumbActive = true;\n\n document.addEventListener('mousemove', this._handleScrollThumbMouseMove);\n document.addEventListener('mouseup', this._handleScrollThumbMouseUp);\n }\n\n private _handleScrollThumbMouseMove = (event: MouseEvent) => {\n const rawThumbPos =\n this._scrollThumbStartY + (event.screenY - this._mouseStartY);\n this._thumbY = this._limitThumbPos(rawThumbPos);\n this.scrollPos = this._calculateScrollPosFromThumbPos(this._thumbY);\n\n this.dispatchEvent(\n new CustomEvent('vsc-scrollable-scroll', {\n detail: this.scrollPos,\n })\n );\n };\n\n private _handleScrollThumbMouseUp = (event: MouseEvent) => {\n this._isDragging = false;\n this._thumbActive = false;\n\n const cr = this.getBoundingClientRect();\n const {x, y, width, height} = cr;\n const {pageX, pageY} = event;\n\n if (pageX > x + width || pageX < x || pageY > y + height || pageY < y) {\n this._thumbFade = true;\n this._thumbVisible = false;\n }\n\n document.removeEventListener('mousemove', this._handleScrollThumbMouseMove);\n document.removeEventListener('mouseup', this._handleScrollThumbMouseUp);\n };\n\n private _handleComponentMouseOver = () => {\n this._thumbVisible = true;\n this._thumbFade = false;\n };\n\n private _handleComponentMouseOut = () => {\n if (!this._thumbActive) {\n this._thumbVisible = false;\n this._thumbFade = true;\n }\n };\n\n private _handleComponentWheel = (ev: WheelEvent) => {\n ev.preventDefault();\n\n const multiplier = ev.altKey\n ? this.mouseWheelScrollSensitivity * this.fastScrollSensitivity\n : this.mouseWheelScrollSensitivity;\n\n this.scrollPos = this._limitScrollPos(\n this.scrollPos + ev.deltaY * multiplier\n );\n this.dispatchEvent(\n new CustomEvent('vsc-scrollable-scroll', {\n detail: this.scrollPos,\n })\n );\n };\n\n private _handleScrollbarTrackPress(ev: PointerEvent) {\n if (ev.target !== ev.currentTarget) {\n return;\n }\n\n this._thumbY = ev.offsetY - this._thumbHeight / 2;\n this.scrollPos = this._calculateScrollPosFromThumbPos(this._thumbY);\n }\n\n private _handleScrollableContainerScroll = (ev: Event) => {\n if (ev.currentTarget) {\n this.scrollPos = (ev.currentTarget as HTMLDivElement).scrollTop;\n }\n };\n\n //#endregion\n\n override render(): TemplateResult {\n return html`\n <div\n class=\"scrollable-container\"\n .style=${stylePropertyMap({\n userSelect: this._isDragging ? 'none' : 'auto',\n })}\n .scrollTop=${this.scrollPos}\n @scroll=${this._handleScrollableContainerScroll}\n >\n <div\n class=${classMap({shadow: true, visible: this.scrolled})}\n .style=${stylePropertyMap({\n zIndex: String(this._scrollbarTrackZ),\n })}\n ></div>\n ${this._isDragging\n ? html`<div class=\"prevent-interaction\"></div>`\n : nothing}\n <div\n class=${classMap({\n 'scrollbar-track': true,\n hidden: !this._scrollbarVisible,\n })}\n @mousedown=${this._handleScrollbarTrackPress}\n >\n <div\n class=${classMap({\n 'scrollbar-thumb': true,\n visible: this.alwaysVisible ? true : this._thumbVisible,\n fade: this.alwaysVisible ? false : this._thumbFade,\n active: this._thumbActive,\n })}\n .style=${stylePropertyMap({\n height: `${this._thumbHeight}px`,\n top: `${this._thumbY}px`,\n })}\n @mousedown=${this._handleScrollThumbMouseDown}\n ></div>\n </div>\n <div class=\"content\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-scrollable': VscodeScrollable;\n }\n\n interface GlobalEventHandlersEventMap {\n 'vsc-scrollable-scroll': VscScrollableScrollEvent;\n }\n}\n"]}
1
+ {"version":3,"file":"vscode-scrollable.js","sourceRoot":"","sources":["../../src/vscode-scrollable/vscode-scrollable.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAC,IAAI,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAClE,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,aAAa,EAAE,UAAU,EAAC,MAAM,2BAA2B,CAAC;AACpE,O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AAC;yDACuB;AAGjC;IADP,KAAK,CAAC,kBAAkB,EAAE,IAAI,CAAC;6DACa;AAGrC;IADP,KAAK,CAAC,uBAAuB,CAAC;8DACe;AAGtC;IADP,qBAAqB,EAAE;2DACa;AAvG1B,gBAAgB;IAD5B,aAAa,CAAC,mBAAmB,CAAC;GACtB,gBAAgB,CAyY5B","sourcesContent":["import {html, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {customElement, VscElement} from '../includes/VscElement.js';\nimport {stylePropertyMap} from '../includes/style-property-map.js';\nimport styles from './vscode-scrollable.styles.js';\n\nexport type VscScrollableScrollEvent = CustomEvent<number>;\n\n/**\n * @tag vscode-scrollable\n *\n * @cssprop [--vscode-scrollbar-shadow=#000000]\n * @cssprop [--vscode-scrollbarSlider-background=rgba(121, 121, 121, 0.4)]\n * @cssprop [--vscode-scrollbarSlider-hoverBackground=rgba(100, 100, 100, 0.7)]\n * @cssprop [--vscode-scrollbarSlider-activeBackground=rgba(191, 191, 191, 0.4)]\n */\n@customElement('vscode-scrollable')\nexport class VscodeScrollable extends VscElement {\n static override styles = styles;\n\n /**\n * By default, the scrollbar appears only when the cursor hovers over the\n * component. With this option, the scrollbar will always be visible.\n */\n @property({type: Boolean, reflect: true, attribute: 'always-visible'})\n alwaysVisible = false;\n\n /**\n * Scrolling speed multiplier when pressing `Alt`. This property is designed to use the value of\n * `editor.fastScrollSensitivity`, `workbench.list.fastScrollSensitivity` or\n * `terminal.integrated.fastScrollSensitivity` depending on the context.\n */\n @property({type: Number, attribute: 'fast-scroll-sensitivity'})\n fastScrollSensitivity = 5;\n\n /**\n * This setting defines the scrollbar's minimum size when the component contains a large amount of content.\n */\n @property({type: Number, attribute: 'min-thumb-size'})\n minThumbSize = 20;\n\n /**\n * A multiplier to be used on the `deltaY` of the mouse wheel scroll events. This property is\n * designed to use the value of `editor.mouseWheelScrollSensitivity`,\n * `workbench.list.mouseWheelScrollSensitivity` or\n * `terminal.integrated.mouseWheelScrollSensitivity` depending on the context.\n */\n @property({type: Number, attribute: 'mouse-wheel-scroll-sensitivity'})\n mouseWheelScrollSensitivity = 1;\n\n /**\n * Controls shadow visibility when content overflows.\n */\n @property({type: Boolean, reflect: true})\n shadow = true;\n\n /**\n * It's true when `scrollPos` greater than 0\n */\n @property({type: Boolean, reflect: true})\n scrolled = false;\n\n /**\n * Scroll position.\n */\n @property({type: Number, attribute: 'scroll-pos'})\n set scrollPos(val: number) {\n this._scrollPos = this._limitScrollPos(val);\n this._updateScrollbar();\n this._updateThumbPosition();\n this.requestUpdate();\n }\n get scrollPos(): number {\n return this._scrollPos;\n }\n\n private _scrollPos = 0;\n\n /**\n * The maximum amount of the `scrollPos`.\n */\n get scrollMax(): number {\n if (!this._scrollableContainer) {\n return 0;\n }\n\n return (\n this._scrollableContainer.scrollHeight -\n this._scrollableContainer.clientHeight\n );\n }\n\n @state()\n private _isDragging = false;\n\n @state()\n private _thumbHeight = 0;\n\n @state()\n private _thumbY = 0;\n\n @state()\n private _thumbVisible = false;\n\n @state()\n private _thumbFade = false;\n\n @state()\n private _thumbActive = false;\n\n @query('.content')\n private _contentElement!: HTMLDivElement;\n\n @query('.scrollbar-thumb', true)\n private _scrollThumbElement!: HTMLDivElement;\n\n @query('.scrollable-container')\n private _scrollableContainer!: HTMLDivElement;\n\n @queryAssignedElements()\n private _assignedElements!: NodeList;\n\n private _hostResizeObserver!: ResizeObserver;\n private _contentResizeObserver!: ResizeObserver;\n private _scrollThumbStartY = 0;\n private _mouseStartY = 0;\n private _scrollbarVisible = true;\n private _scrollbarTrackZ = 0;\n\n //#region lifecycle methods\n\n constructor() {\n super();\n this.addEventListener('mouseover', this._handleComponentMouseOver);\n this.addEventListener('mouseout', this._handleComponentMouseOut);\n this.addEventListener('wheel', this._handleComponentWheel);\n }\n\n override connectedCallback(): void {\n super.connectedCallback();\n\n this._hostResizeObserver = new ResizeObserver(this._resizeObserverCallback);\n this._contentResizeObserver = new ResizeObserver(\n this._resizeObserverCallback\n );\n\n this.requestUpdate();\n\n this.updateComplete.then(() => {\n this._hostResizeObserver.observe(this);\n this._contentResizeObserver.observe(this._contentElement);\n this._updateThumbPosition();\n });\n }\n\n override disconnectedCallback(): void {\n super.disconnectedCallback();\n\n this._hostResizeObserver.unobserve(this);\n this._hostResizeObserver.disconnect();\n this._contentResizeObserver.unobserve(this._contentElement);\n this._contentResizeObserver.disconnect();\n }\n\n protected override firstUpdated(_changedProperties: PropertyValues): void {\n this._updateThumbPosition();\n }\n\n //#endregion\n\n private _resizeObserverCallback = () => {\n this._updateScrollbar();\n this._updateThumbPosition();\n };\n\n private _calcThumbHeight() {\n const componentHeight = this.offsetHeight;\n const contentHeight = this._contentElement?.offsetHeight ?? 0;\n const proposedSize = componentHeight * (componentHeight / contentHeight);\n\n return Math.max(this.minThumbSize, proposedSize);\n }\n\n private _updateScrollbar() {\n const contentHeight = this._contentElement?.offsetHeight ?? 0;\n const componentHeight = this.offsetHeight;\n\n if (componentHeight >= contentHeight) {\n this._scrollbarVisible = false;\n } else {\n this._scrollbarVisible = true;\n this._thumbHeight = this._calcThumbHeight();\n }\n\n this.requestUpdate();\n }\n\n private _zIndexFix() {\n let highestZ = 0;\n\n this._assignedElements.forEach((n) => {\n if ('style' in n) {\n const computedZIndex = window.getComputedStyle(n as HTMLElement).zIndex;\n const isNumber = /([0-9-])+/g.test(computedZIndex);\n\n if (isNumber) {\n highestZ =\n Number(computedZIndex) > highestZ\n ? Number(computedZIndex)\n : highestZ;\n }\n }\n });\n\n this._scrollbarTrackZ = highestZ + 1;\n this.requestUpdate();\n }\n\n private _updateThumbPosition() {\n if (!this._scrollableContainer) {\n return;\n }\n\n this.scrolled = this.scrollPos > 0;\n\n const componentH = this.offsetHeight;\n const thumbH = this._thumbHeight;\n const contentH = this._contentElement.offsetHeight;\n\n const overflown = contentH - componentH;\n const ratio = this.scrollPos / overflown;\n const thumbYMax = componentH - thumbH;\n\n this._thumbY = Math.min(ratio * (componentH - thumbH), thumbYMax);\n }\n\n private _calculateScrollPosFromThumbPos(scrollPos: number) {\n const cmpH = this.getBoundingClientRect().height;\n const thumbH = this._scrollThumbElement.getBoundingClientRect().height;\n const contentH = this._contentElement.getBoundingClientRect().height;\n const rawScrollPos = (scrollPos / (cmpH - thumbH)) * (contentH - cmpH);\n\n return this._limitScrollPos(rawScrollPos);\n }\n\n private _limitScrollPos(newPos: number) {\n if (newPos < 0) {\n return 0;\n } else if (newPos > this.scrollMax) {\n return this.scrollMax;\n } else {\n return newPos;\n }\n }\n\n private _limitThumbPos(newPos: number) {\n const cmpH = this.getBoundingClientRect().height;\n const thumbH = this._scrollThumbElement.getBoundingClientRect().height;\n\n if (newPos < 0) {\n return 0;\n } else if (newPos > cmpH - thumbH) {\n return cmpH - thumbH;\n } else {\n return newPos;\n }\n }\n\n //#region event handlers\n private _handleSlotChange = () => {\n this._updateScrollbar();\n this._updateThumbPosition();\n this._zIndexFix();\n };\n\n private _handleScrollThumbMouseDown(event: MouseEvent) {\n const cmpCr = this.getBoundingClientRect();\n const thCr = this._scrollThumbElement.getBoundingClientRect();\n\n this._mouseStartY = event.screenY;\n this._scrollThumbStartY = thCr.top - cmpCr.top;\n this._isDragging = true;\n this._thumbActive = true;\n\n document.addEventListener('mousemove', this._handleScrollThumbMouseMove);\n document.addEventListener('mouseup', this._handleScrollThumbMouseUp);\n }\n\n private _handleScrollThumbMouseMove = (event: MouseEvent) => {\n const rawThumbPos =\n this._scrollThumbStartY + (event.screenY - this._mouseStartY);\n this._thumbY = this._limitThumbPos(rawThumbPos);\n this.scrollPos = this._calculateScrollPosFromThumbPos(this._thumbY);\n\n this.dispatchEvent(\n new CustomEvent('vsc-scrollable-scroll', {\n detail: this.scrollPos,\n })\n );\n };\n\n private _handleScrollThumbMouseUp = (event: MouseEvent) => {\n this._isDragging = false;\n this._thumbActive = false;\n\n const cr = this.getBoundingClientRect();\n const {x, y, width, height} = cr;\n const {pageX, pageY} = event;\n\n if (pageX > x + width || pageX < x || pageY > y + height || pageY < y) {\n this._thumbFade = true;\n this._thumbVisible = false;\n }\n\n document.removeEventListener('mousemove', this._handleScrollThumbMouseMove);\n document.removeEventListener('mouseup', this._handleScrollThumbMouseUp);\n };\n\n private _handleComponentMouseOver = () => {\n this._thumbVisible = true;\n this._thumbFade = false;\n };\n\n private _handleComponentMouseOut = () => {\n if (!this._thumbActive) {\n this._thumbVisible = false;\n this._thumbFade = true;\n }\n };\n\n private _handleComponentWheel = (ev: WheelEvent) => {\n ev.preventDefault();\n\n const multiplier = ev.altKey\n ? this.mouseWheelScrollSensitivity * this.fastScrollSensitivity\n : this.mouseWheelScrollSensitivity;\n\n this.scrollPos = this._limitScrollPos(\n this.scrollPos + ev.deltaY * multiplier\n );\n this.dispatchEvent(\n new CustomEvent('vsc-scrollable-scroll', {\n detail: this.scrollPos,\n })\n );\n };\n\n private _handleScrollbarTrackPress(ev: PointerEvent) {\n if (ev.target !== ev.currentTarget) {\n return;\n }\n\n this._thumbY = ev.offsetY - this._thumbHeight / 2;\n this.scrollPos = this._calculateScrollPosFromThumbPos(this._thumbY);\n }\n\n private _handleScrollableContainerScroll = (ev: Event) => {\n if (ev.currentTarget) {\n this.scrollPos = (ev.currentTarget as HTMLDivElement).scrollTop;\n }\n };\n\n //#endregion\n\n override render(): TemplateResult {\n return html`\n <div\n class=\"scrollable-container\"\n .style=${stylePropertyMap({\n userSelect: this._isDragging ? 'none' : 'auto',\n })}\n .scrollTop=${this.scrollPos}\n @scroll=${this._handleScrollableContainerScroll}\n >\n <div\n class=${classMap({shadow: true, visible: this.scrolled})}\n .style=${stylePropertyMap({\n zIndex: String(this._scrollbarTrackZ),\n })}\n ></div>\n ${this._isDragging\n ? html`<div class=\"prevent-interaction\"></div>`\n : nothing}\n <div\n class=${classMap({\n 'scrollbar-track': true,\n hidden: !this._scrollbarVisible,\n })}\n @mousedown=${this._handleScrollbarTrackPress}\n >\n <div\n class=${classMap({\n 'scrollbar-thumb': true,\n visible: this.alwaysVisible ? true : this._thumbVisible,\n fade: this.alwaysVisible ? false : this._thumbFade,\n active: this._thumbActive,\n })}\n .style=${stylePropertyMap({\n height: `${this._thumbHeight}px`,\n top: `${this._thumbY}px`,\n })}\n @mousedown=${this._handleScrollThumbMouseDown}\n ></div>\n </div>\n <div class=\"content\">\n <slot @slotchange=${this._handleSlotChange}></slot>\n </div>\n </div>\n `;\n }\n}\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'vscode-scrollable': VscodeScrollable;\n }\n\n interface GlobalEventHandlersEventMap {\n 'vsc-scrollable-scroll': VscScrollableScrollEvent;\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vscode-elements/elements",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "Web components for creating Visual Studio Code extensions",
5
5
  "main": "dist/main.js",
6
6
  "module": "dist/main.js",
@@ -116,35 +116,23 @@
116
116
  { "name": "--vscode-menu-separatorBackground", "values": [] },
117
117
  { "name": "--vscode-foreground", "values": [] },
118
118
  {
119
- "name": "--vsc-foreground-translucent",
120
- "description": "Default text color. 90% transparency version of `--vscode-foreground` by default.",
119
+ "name": "--label-width",
120
+ "description": "The width of the label in horizontal mode",
121
121
  "values": []
122
122
  },
123
- { "name": "--vscode-icon-foreground", "values": [] },
124
123
  {
125
- "name": "--vscode-toolbar-hoverBackground",
126
- "description": "Hover state background color in `active-icon` mode",
124
+ "name": "--label-right-margin",
125
+ "description": "The right margin of the label in horizontal mode",
127
126
  "values": []
128
127
  },
129
128
  {
130
- "name": "--vscode-toolbar-activeBackground",
131
- "description": "Active state background color in `active-icon` mode",
129
+ "name": "--vsc-foreground-translucent",
130
+ "description": "Default text color. 90% transparency version of `--vscode-foreground` by default.",
132
131
  "values": []
133
132
  },
134
- { "name": "--vscode-focusBorder", "values": [] },
135
133
  { "name": "--vscode-font-family", "values": [] },
136
134
  { "name": "--vscode-font-size", "values": [] },
137
135
  { "name": "--vscode-foreground", "values": [] },
138
- {
139
- "name": "--label-width",
140
- "description": "The width of the label in horizontal mode",
141
- "values": []
142
- },
143
- {
144
- "name": "--label-right-margin",
145
- "description": "The right margin of the label in horizontal mode",
146
- "values": []
147
- },
148
136
  {
149
137
  "name": "--dropdown-z-index",
150
138
  "description": "workaround for dropdown z-index issues",
@@ -171,6 +159,18 @@
171
159
  { "name": "--vscode-list-highlightForeground", "values": [] },
172
160
  { "name": "--vscode-list-hoverBackground", "values": [] },
173
161
  { "name": "--vscode-list-hoverForeground", "values": [] },
162
+ { "name": "--vscode-icon-foreground", "values": [] },
163
+ {
164
+ "name": "--vscode-toolbar-hoverBackground",
165
+ "description": "Hover state background color in `active-icon` mode",
166
+ "values": []
167
+ },
168
+ {
169
+ "name": "--vscode-toolbar-activeBackground",
170
+ "description": "Active state background color in `active-icon` mode",
171
+ "values": []
172
+ },
173
+ { "name": "--vscode-focusBorder", "values": [] },
174
174
  { "name": "--vscode-progressBar-background", "values": [] },
175
175
  { "name": "--vscode-font-family", "values": [] },
176
176
  { "name": "--vscode-font-size", "values": [] },
@@ -211,9 +211,6 @@
211
211
  { "name": "--vscode-list-highlightForeground", "values": [] },
212
212
  { "name": "--vscode-list-hoverBackground", "values": [] },
213
213
  { "name": "--vscode-list-hoverForeground", "values": [] },
214
- { "name": "--separator-border", "values": [] },
215
- { "name": "--vscode-editorWidget-border", "values": [] },
216
- { "name": "--vscode-sash-hoverBorder", "values": [] },
217
214
  { "name": "--vscode-focusBorder", "values": [] },
218
215
  { "name": "--vscode-foreground", "values": [] },
219
216
  { "name": "--vscode-panelTitle-activeBorder", "values": [] },
@@ -236,6 +233,9 @@
236
233
  { "name": "--vscode-foreground", "values": [] },
237
234
  { "name": "--vscode-font-family", "values": [] },
238
235
  { "name": "--vscode-font-size", "values": [] },
236
+ { "name": "--separator-border", "values": [] },
237
+ { "name": "--vscode-editorWidget-border", "values": [] },
238
+ { "name": "--vscode-sash-hoverBorder", "values": [] },
239
239
  { "name": "--vscode-editorGroup-border", "values": [] },
240
240
  { "name": "--vscode-font-family", "values": [] },
241
241
  { "name": "--vscode-font-size", "values": [] },
@@ -195,42 +195,17 @@
195
195
  "references": []
196
196
  },
197
197
  {
198
- "name": "vscode-form-helper",
199
- "description": "Adds more detailed description to a [FromGroup](https://bendera.github.io/vscode-webview-elements/components/vscode-form-group/)\n---\n\n\n### **CSS Properties:**\n - **--vsc-foreground-translucent** - Default text color. 90% transparency version of `--vscode-foreground` by default. _(default: undefined)_",
200
- "attributes": [],
198
+ "name": "vscode-form-group",
199
+ "description": "\n---\n\n\n### **CSS Properties:**\n - **--label-width** - The width of the label in horizontal mode _(default: 150px)_\n- **--label-right-margin** - The right margin of the label in horizontal mode _(default: 14px)_",
200
+ "attributes": [
201
+ { "name": "variant", "values": [{ "name": "FormGroupVariant" }] }
202
+ ],
201
203
  "references": []
202
204
  },
203
205
  {
204
- "name": "vscode-icon",
205
- "description": "Display a [Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html).\nIn \"action-icon\" mode it behaves like a button. In this case, it is\nrecommended that a meaningful label is specified with the `label` property.\n---\n\n\n### **CSS Properties:**\n - **--vscode-icon-foreground** - undefined _(default: #cccccc)_\n- **--vscode-toolbar-hoverBackground** - Hover state background color in `active-icon` mode _(default: rgba(90, 93, 94, 0.31))_\n- **--vscode-toolbar-activeBackground** - Active state background color in `active-icon` mode _(default: rgba(99, 102, 103, 0.31))_\n- **--vscode-focusBorder** - undefined _(default: #0078d4)_",
206
- "attributes": [
207
- {
208
- "name": "label",
209
- "description": "Set a meaningful label in `action-icon` mode for the screen readers",
210
- "values": []
211
- },
212
- {
213
- "name": "name",
214
- "description": "[Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html) icon name.",
215
- "values": []
216
- },
217
- { "name": "size", "description": "Icon size in pixels", "values": [] },
218
- {
219
- "name": "spin",
220
- "description": "Enable rotation animation",
221
- "values": []
222
- },
223
- {
224
- "name": "spin-duration",
225
- "description": "Animation duration in seconds",
226
- "values": []
227
- },
228
- {
229
- "name": "action-icon",
230
- "description": "Behaves like a button",
231
- "values": []
232
- }
233
- ],
206
+ "name": "vscode-form-helper",
207
+ "description": "Adds more detailed description to a [FromGroup](https://bendera.github.io/vscode-webview-elements/components/vscode-form-group/)\n---\n\n\n### **CSS Properties:**\n - **--vsc-foreground-translucent** - Default text color. 90% transparency version of `--vscode-foreground` by default. _(default: undefined)_",
208
+ "attributes": [],
234
209
  "references": []
235
210
  },
236
211
  {
@@ -243,14 +218,6 @@
243
218
  ],
244
219
  "references": []
245
220
  },
246
- {
247
- "name": "vscode-form-group",
248
- "description": "\n---\n\n\n### **CSS Properties:**\n - **--label-width** - The width of the label in horizontal mode _(default: 150px)_\n- **--label-right-margin** - The right margin of the label in horizontal mode _(default: 14px)_",
249
- "attributes": [
250
- { "name": "variant", "values": [{ "name": "FormGroupVariant" }] }
251
- ],
252
- "references": []
253
- },
254
221
  {
255
222
  "name": "vscode-multi-select",
256
223
  "description": "Allows to select multiple items from a list of options.\n\nWhen participating in a form, it supports the `:invalid` pseudo class. Otherwise the error styles\ncan be applied through the `invalid` property.\n---\n\n\n### **Events:**\n - **change**\n- **input**\n\n### **CSS Properties:**\n - **--dropdown-z-index** - workaround for dropdown z-index issues _(default: 2)_\n- **--vscode-badge-background** - undefined _(default: #616161)_\n- **--vscode-badge-foreground** - undefined _(default: #f8f8f8)_\n- **--vscode-settings-dropdownBorder** - undefined _(default: #3c3c3c)_\n- **--vscode-settings-checkboxBackground** - undefined _(default: #313131)_\n- **--vscode-settings-dropdownBackground** - undefined _(default: #313131)_\n- **--vscode-settings-dropdownForeground** - undefined _(default: #cccccc)_\n- **--vscode-settings-dropdownListBorder** - undefined _(default: #454545)_\n- **--vscode-focusBorder** - undefined _(default: #0078d4)_\n- **--vscode-foreground** - undefined _(default: #cccccc)_\n- **--vscode-font-family** - undefined _(default: sans-serif)_\n- **--vscode-font-size** - undefined _(default: 13px)_\n- **--vscode-font-weight** - undefined _(default: normal)_\n- **--vscode-inputValidation-errorBackground** - undefined _(default: #5a1d1d)_\n- **--vscode-inputValidation-errorBorder** - undefined _(default: #be1100)_\n- **--vscode-list-activeSelectionBackground** - undefined _(default: #04395e)_\n- **--vscode-list-activeSelectionForeground** - undefined _(default: #ffffff)_\n- **--vscode-list-focusOutline** - undefined _(default: #0078d4)_\n- **--vscode-list-focusHighlightForeground** - undefined _(default: #2aaaff)_\n- **--vscode-list-highlightForeground** - undefined _(default: #2aaaff)_\n- **--vscode-list-hoverBackground** - undefined _(default: #2a2d2e)_\n- **--vscode-list-hoverForeground** - undefined _(default: #ffffff)_",
@@ -313,6 +280,39 @@
313
280
  ],
314
281
  "references": []
315
282
  },
283
+ {
284
+ "name": "vscode-icon",
285
+ "description": "Display a [Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html).\nIn \"action-icon\" mode it behaves like a button. In this case, it is\nrecommended that a meaningful label is specified with the `label` property.\n---\n\n\n### **CSS Properties:**\n - **--vscode-icon-foreground** - undefined _(default: #cccccc)_\n- **--vscode-toolbar-hoverBackground** - Hover state background color in `active-icon` mode _(default: rgba(90, 93, 94, 0.31))_\n- **--vscode-toolbar-activeBackground** - Active state background color in `active-icon` mode _(default: rgba(99, 102, 103, 0.31))_\n- **--vscode-focusBorder** - undefined _(default: #0078d4)_",
286
+ "attributes": [
287
+ {
288
+ "name": "label",
289
+ "description": "Set a meaningful label in `action-icon` mode for the screen readers",
290
+ "values": []
291
+ },
292
+ {
293
+ "name": "name",
294
+ "description": "[Codicon](https://microsoft.github.io/vscode-codicons/dist/codicon.html) icon name.",
295
+ "values": []
296
+ },
297
+ { "name": "size", "description": "Icon size in pixels", "values": [] },
298
+ {
299
+ "name": "spin",
300
+ "description": "Enable rotation animation",
301
+ "values": []
302
+ },
303
+ {
304
+ "name": "spin-duration",
305
+ "description": "Animation duration in seconds",
306
+ "values": []
307
+ },
308
+ {
309
+ "name": "action-icon",
310
+ "description": "Behaves like a button",
311
+ "values": []
312
+ }
313
+ ],
314
+ "references": []
315
+ },
316
316
  {
317
317
  "name": "vscode-option",
318
318
  "description": "\n---\n",
@@ -475,43 +475,6 @@
475
475
  ],
476
476
  "references": []
477
477
  },
478
- {
479
- "name": "vscode-split-layout",
480
- "description": "\n---\n\n\n### **Methods:**\n - **resetHandlePosition()** - Sets the handle position to the value specified in the `initialHandlePosition` property.\n\n### **CSS Properties:**\n - **--separator-border** - undefined _(default: #454545)_\n- **--vscode-editorWidget-border** - undefined _(default: #454545)_\n- **--vscode-sash-hoverBorder** - undefined _(default: #0078d4)_",
481
- "attributes": [
482
- {
483
- "name": "split",
484
- "description": "Direction of the divider.",
485
- "values": [{ "name": "Orientation" }]
486
- },
487
- {
488
- "name": "reset-on-dbl-click",
489
- "description": "Controls whether the handle position should reset to the value set in the\n`initialHandlePosition` when it is double-clicked.",
490
- "values": []
491
- },
492
- {
493
- "name": "handle-size",
494
- "description": "Controls the draggable area size in pixels. it is intended to use the value\nof `workbench.sash.size`.",
495
- "values": []
496
- },
497
- {
498
- "name": "initial-handle-position",
499
- "description": "The handler position will reset to this position when it is double-clicked,\nor the `resetHandlePosition()` is called.",
500
- "values": []
501
- },
502
- {
503
- "name": "handle-position",
504
- "description": "Set the handle position programmatically. The value must include a unit,\neither `%` or `px`. If no unit is specified, the value is interpreted as\n`px`.",
505
- "values": []
506
- },
507
- {
508
- "name": "fixed-pane",
509
- "description": "The size of the fixed pane will not change when the component is resized.",
510
- "values": [{ "name": "start" }, { "name": "end" }, { "name": "none" }]
511
- }
512
- ],
513
- "references": []
514
- },
515
478
  {
516
479
  "name": "vscode-tab-header",
517
480
  "description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-focusBorder** - undefined _(default: #0078d4)_\n- **--vscode-foreground** - undefined _(default: #cccccc)_\n- **--vscode-panelTitle-activeBorder** - undefined _(default: #0078d4)_\n- **--vscode-panelTitle-activeForeground** - undefined _(default: #cccccc)_\n- **--vscode-panelTitle-inactiveForeground** - undefined _(default: #9d9d9d)_",
@@ -611,6 +574,43 @@
611
574
  "attributes": [],
612
575
  "references": []
613
576
  },
577
+ {
578
+ "name": "vscode-split-layout",
579
+ "description": "\n---\n\n\n### **Methods:**\n - **resetHandlePosition()** - Sets the handle position to the value specified in the `initialHandlePosition` property.\n\n### **CSS Properties:**\n - **--separator-border** - undefined _(default: #454545)_\n- **--vscode-editorWidget-border** - undefined _(default: #454545)_\n- **--vscode-sash-hoverBorder** - undefined _(default: #0078d4)_",
580
+ "attributes": [
581
+ {
582
+ "name": "split",
583
+ "description": "Direction of the divider.",
584
+ "values": [{ "name": "Orientation" }]
585
+ },
586
+ {
587
+ "name": "reset-on-dbl-click",
588
+ "description": "Controls whether the handle position should reset to the value set in the\n`initialHandlePosition` when it is double-clicked.",
589
+ "values": []
590
+ },
591
+ {
592
+ "name": "handle-size",
593
+ "description": "Controls the draggable area size in pixels. it is intended to use the value\nof `workbench.sash.size`.",
594
+ "values": []
595
+ },
596
+ {
597
+ "name": "initial-handle-position",
598
+ "description": "The handler position will reset to this position when it is double-clicked,\nor the `resetHandlePosition()` is called.",
599
+ "values": []
600
+ },
601
+ {
602
+ "name": "handle-position",
603
+ "description": "Set the handle position programmatically. The value must include a unit,\neither `%` or `px`. If no unit is specified, the value is interpreted as\n`px`.",
604
+ "values": []
605
+ },
606
+ {
607
+ "name": "fixed-pane",
608
+ "description": "The size of the fixed pane will not change when the component is resized.",
609
+ "values": [{ "name": "start" }, { "name": "end" }, { "name": "none" }]
610
+ }
611
+ ],
612
+ "references": []
613
+ },
614
614
  {
615
615
  "name": "vscode-table-row",
616
616
  "description": "\n---\n\n\n### **CSS Properties:**\n - **--vscode-editorGroup-border** - undefined _(default: rgba(255, 255, 255, 0.09))_",