Update Build Config (#69)
Update the Rollup build configuration for the toolkit and theme utilities. Additionally, fix some TSDoc/API extractor warnings.
This commit is contained in:
Родитель
119307269e
Коммит
6efd69b01b
|
@ -3,7 +3,7 @@
|
|||
# Visual Studio Code Webview Toolkit
|
||||
|
||||
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen)](https://opensource.org/licenses/MIT)
|
||||
[![NPM Version](https://img.shields.io/badge/npm-v0.2.0-blue)](https://github.com/microsoft/vscode-webview-toolkit)
|
||||
[![NPM Version](https://img.shields.io/badge/npm-v0.2.1-blue)](https://github.com/microsoft/vscode-webview-toolkit)
|
||||
[![TypeScript](https://img.shields.io/badge/%3C%2F%3E-TypeScript-blue)](https://www.typescriptlang.org/)
|
||||
|
||||
## Introduction
|
||||
|
|
|
@ -8,9 +8,10 @@
|
|||
},
|
||||
"docModel": {
|
||||
"enabled": true,
|
||||
"apiJsonFilePath": "dist/vscode-webview-toolkit.api.json"
|
||||
"apiJsonFilePath": "dist/toolkit.api.json"
|
||||
},
|
||||
"dtsRollup": {
|
||||
"enabled": true
|
||||
"enabled": true,
|
||||
"untrimmedFilePath": "dist/toolkit.d.ts"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vscode-webview-toolkit",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.1",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
|
@ -1987,16 +1987,16 @@
|
|||
"dev": true
|
||||
},
|
||||
"@microsoft/api-extractor": {
|
||||
"version": "7.13.3",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@microsoft/api-extractor/-/api-extractor-7.13.3.tgz",
|
||||
"integrity": "sha1-lw3nW8wLVItDE514fjgtKjipyEk=",
|
||||
"version": "7.13.5",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@microsoft/api-extractor/-/api-extractor-7.13.5.tgz",
|
||||
"integrity": "sha1-kn7uIxXJ6W0jwkqfTYttfG0ZV68=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@microsoft/api-extractor-model": "7.12.3",
|
||||
"@microsoft/api-extractor-model": "7.12.5",
|
||||
"@microsoft/tsdoc": "0.12.24",
|
||||
"@rushstack/node-core-library": "3.36.1",
|
||||
"@rushstack/rig-package": "0.2.11",
|
||||
"@rushstack/ts-command-line": "4.7.9",
|
||||
"@rushstack/node-core-library": "3.36.2",
|
||||
"@rushstack/rig-package": "0.2.12",
|
||||
"@rushstack/ts-command-line": "4.7.10",
|
||||
"colors": "~1.2.1",
|
||||
"lodash": "~4.17.15",
|
||||
"resolve": "~1.17.0",
|
||||
|
@ -2038,13 +2038,13 @@
|
|||
}
|
||||
},
|
||||
"@microsoft/api-extractor-model": {
|
||||
"version": "7.12.3",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@microsoft/api-extractor-model/-/api-extractor-model-7.12.3.tgz",
|
||||
"integrity": "sha1-vCHy9L8AW3U7FRxnR1LYTGdrF7A=",
|
||||
"version": "7.12.5",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@microsoft/api-extractor-model/-/api-extractor-model-7.12.5.tgz",
|
||||
"integrity": "sha1-KNKASGXOupzYmrTwXP+Z0W+mybg=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@microsoft/tsdoc": "0.12.24",
|
||||
"@rushstack/node-core-library": "3.36.1"
|
||||
"@rushstack/node-core-library": "3.36.2"
|
||||
}
|
||||
},
|
||||
"@microsoft/eslint-config-fast-dna": {
|
||||
|
@ -2344,9 +2344,9 @@
|
|||
}
|
||||
},
|
||||
"@rushstack/node-core-library": {
|
||||
"version": "3.36.1",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@rushstack/node-core-library/-/node-core-library-3.36.1.tgz",
|
||||
"integrity": "sha1-nBo9W1N5uIV/jgZvFJG4m5+g0T4=",
|
||||
"version": "3.36.2",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@rushstack/node-core-library/-/node-core-library-3.36.2.tgz",
|
||||
"integrity": "sha1-ugDTE1d/mwbVqvqinaDZTllIdMA=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "10.17.13",
|
||||
|
@ -2381,9 +2381,9 @@
|
|||
}
|
||||
},
|
||||
"@rushstack/rig-package": {
|
||||
"version": "0.2.11",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@rushstack/rig-package/-/rig-package-0.2.11.tgz",
|
||||
"integrity": "sha1-sgb1l5x6BHmfJ3CD5YXpMiWaH9I=",
|
||||
"version": "0.2.12",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@rushstack/rig-package/-/rig-package-0.2.12.tgz",
|
||||
"integrity": "sha1-xDTWKyjgQYoECTgib4kTlx0EJMc=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"resolve": "~1.17.0",
|
||||
|
@ -2402,9 +2402,9 @@
|
|||
}
|
||||
},
|
||||
"@rushstack/ts-command-line": {
|
||||
"version": "4.7.9",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@rushstack/ts-command-line/-/ts-command-line-4.7.9.tgz",
|
||||
"integrity": "sha1-Biqha2UzrwkSUoRRandL+aTQApE=",
|
||||
"version": "4.7.10",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/@rushstack/ts-command-line/-/ts-command-line-4.7.10.tgz",
|
||||
"integrity": "sha1-ouxu+xlFt5tJZnHOkOsb5PE5fTE=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/argparse": "1.0.38",
|
||||
|
@ -18787,37 +18787,6 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
"rollup-plugin-terser": {
|
||||
"version": "7.0.2",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/rollup-plugin-terser/-/rollup-plugin-terser-7.0.2.tgz",
|
||||
"integrity": "sha1-6Pu6SGmYGy3DWufopQLVxsBNMk0=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@babel/code-frame": "^7.10.4",
|
||||
"jest-worker": "^26.2.1",
|
||||
"serialize-javascript": "^4.0.0",
|
||||
"terser": "^5.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"source-map": {
|
||||
"version": "0.7.3",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/source-map/-/source-map-0.7.3.tgz",
|
||||
"integrity": "sha1-UwL4FpAxc1ImVECS5kmB91F1A4M=",
|
||||
"dev": true
|
||||
},
|
||||
"terser": {
|
||||
"version": "5.6.1",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/terser/-/terser-5.6.1.tgz",
|
||||
"integrity": "sha1-pI7qxTAMCgmzaFS/kNnCb7IBlzw=",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"commander": "^2.20.0",
|
||||
"source-map": "~0.7.2",
|
||||
"source-map-support": "~0.5.19"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"rollup-plugin-transform-tagged-template": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://mscomdev.pkgs.visualstudio.com/_packaging/vscode-webview-toolkit/npm/registry/rollup-plugin-transform-tagged-template/-/rollup-plugin-transform-tagged-template-0.0.3.tgz",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "vscode-webview-toolkit",
|
||||
"version": "0.2.0",
|
||||
"description": "A component library for creating webview-based extensions in Visual Studio Code.",
|
||||
"version": "0.2.1",
|
||||
"description": "A component library for building webview-based extensions in Visual Studio Code.",
|
||||
"homepage": "https://github.com/microsoft/vscode-webview-toolkit#readme",
|
||||
"license": "MIT",
|
||||
"author": {
|
||||
|
@ -15,7 +15,7 @@
|
|||
"url": "git+https://github.com/microsoft/vscode-webview-toolkit.git"
|
||||
},
|
||||
"main": "dist/esm/index.js",
|
||||
"types": "dist/vscode-webview-toolkit.d.ts",
|
||||
"types": "dist/toolkit.d.ts",
|
||||
"scripts": {
|
||||
"start": "start-storybook -p 6006",
|
||||
"build": "rollup -c && tsc -p ./tsconfig.json && npm run doc",
|
||||
|
@ -40,7 +40,7 @@
|
|||
"@babel/plugin-proposal-decorators": "^7.13.5",
|
||||
"@babel/preset-env": "^7.13.5",
|
||||
"@babel/preset-typescript": "^7.13.0",
|
||||
"@microsoft/api-extractor": "^7.13.2",
|
||||
"@microsoft/api-extractor": "^7.13.5",
|
||||
"@microsoft/eslint-config-fast-dna": "^1.2.0",
|
||||
"@rollup/plugin-commonjs": "^17.1.0",
|
||||
"@rollup/plugin-node-resolve": "^11.2.0",
|
||||
|
@ -65,7 +65,6 @@
|
|||
"rollup": "^2.40.0",
|
||||
"rollup-plugin-delete": "^2.0.0",
|
||||
"rollup-plugin-filesize": "^9.1.1",
|
||||
"rollup-plugin-terser": "^7.0.2",
|
||||
"rollup-plugin-transform-tagged-template": "0.0.3",
|
||||
"ts-loader": "^8.0.17",
|
||||
"tslib": "^2.1.0",
|
||||
|
|
|
@ -2,52 +2,16 @@
|
|||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import filesize from 'rollup-plugin-filesize';
|
||||
import {nodeResolve} from '@rollup/plugin-node-resolve';
|
||||
import {terser} from 'rollup-plugin-terser';
|
||||
import transformTaggedTemplate from 'rollup-plugin-transform-tagged-template';
|
||||
import typescript from '@rollup/plugin-typescript';
|
||||
import del from 'rollup-plugin-delete';
|
||||
|
||||
// ----- Helper Functions -----
|
||||
// ----- Rollup Config -----
|
||||
|
||||
const parserOptions = {
|
||||
sourceType: 'module',
|
||||
};
|
||||
|
||||
function transformHTMLFragment(data) {
|
||||
const onlySpace = /^\s+$/g;
|
||||
const spaceBetforeTagClose = /\s+(>)/g;
|
||||
const spaceBetweenTags = /(>)\s+(<)/g;
|
||||
const spaceBetweenAttrs = /(["'\w])(?!\s*>)\s+/g;
|
||||
const openEnded = /(?:[^="'\w])?(["'\w])\s*$/g;
|
||||
|
||||
if (data.match(onlySpace)) {
|
||||
return data.replace(onlySpace, ' ');
|
||||
}
|
||||
data = data.replace(spaceBetforeTagClose, '$1');
|
||||
data = data.replace(spaceBetweenTags, '$1$2');
|
||||
data = data.replace(spaceBetweenAttrs, '$1 ');
|
||||
if (data.match(openEnded)) {
|
||||
return data.trimStart();
|
||||
}
|
||||
return data.trim();
|
||||
}
|
||||
|
||||
function transformCSSFragment(data) {
|
||||
const newlines = /\n/g;
|
||||
const separators = /\s*([{};])\s*/g;
|
||||
const lastProp = /;\s*(\})/g;
|
||||
const extraSpaces = /\s\s+/g;
|
||||
const endingSpaces = / ?\s+$/g;
|
||||
|
||||
data = data.replace(newlines, '');
|
||||
data = data.replace(separators, '$1');
|
||||
data = data.replace(lastProp, '$1');
|
||||
data = data.replace(endingSpaces, ' ');
|
||||
return data.replace(extraSpaces, ' ');
|
||||
}
|
||||
|
||||
// ----- Rollup Config -----
|
||||
|
||||
export default [
|
||||
{
|
||||
context: 'this',
|
||||
|
@ -56,11 +20,7 @@ export default [
|
|||
{
|
||||
file: 'dist/toolkit.js',
|
||||
format: 'esm',
|
||||
},
|
||||
{
|
||||
file: 'dist/toolkit.min.js',
|
||||
format: 'esm',
|
||||
plugins: [terser()],
|
||||
sourcemap: true,
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
|
@ -86,16 +46,12 @@ export default [
|
|||
},
|
||||
{
|
||||
context: 'this',
|
||||
input: 'src/utilities/vscode-extension/applyCurrentTheme.ts',
|
||||
input: 'src/utilities/vscode-extension/applyTheme.ts',
|
||||
output: [
|
||||
{
|
||||
file: 'dist/applyTheme.js',
|
||||
format: 'esm',
|
||||
},
|
||||
{
|
||||
file: 'dist/applyTheme.min.js',
|
||||
format: 'esm',
|
||||
plugins: [terser()],
|
||||
sourcemap: true,
|
||||
},
|
||||
],
|
||||
plugins: [
|
||||
|
@ -109,3 +65,38 @@ export default [
|
|||
],
|
||||
},
|
||||
];
|
||||
|
||||
// ----- Helper Functions -----
|
||||
|
||||
function transformHTMLFragment(data) {
|
||||
const onlySpace = /^\s+$/g;
|
||||
const spaceBeforeTagClose = /\s+(>)/g;
|
||||
const spaceBetweenTags = /(>)\s+(<)/g;
|
||||
const spaceBetweenAttrs = /(["'\w])(?!\s*>)\s+/g;
|
||||
const openEnded = /(?:[^="'\w])?(["'\w])\s*$/g;
|
||||
|
||||
if (data.match(onlySpace)) {
|
||||
return data.replace(onlySpace, ' ');
|
||||
}
|
||||
data = data.replace(spaceBeforeTagClose, '$1');
|
||||
data = data.replace(spaceBetweenTags, '$1$2');
|
||||
data = data.replace(spaceBetweenAttrs, '$1 ');
|
||||
if (data.match(openEnded)) {
|
||||
return data.trimStart();
|
||||
}
|
||||
return data.trim();
|
||||
}
|
||||
|
||||
function transformCSSFragment(data) {
|
||||
const newlines = /\n/g;
|
||||
const separators = /\s*([{};])\s*/g;
|
||||
const lastProp = /;\s*(\})/g;
|
||||
const extraSpaces = /\s\s+/g;
|
||||
const endingSpaces = / ?\s+$/g;
|
||||
|
||||
data = data.replace(newlines, '');
|
||||
data = data.replace(separators, '$1');
|
||||
data = data.replace(lastProp, '$1');
|
||||
data = data.replace(endingSpaces, ' ');
|
||||
return data.replace(extraSpaces, ' ');
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@ import {BadgeStyles as styles} from './badge.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Badge element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.badge/ Badge} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.badgetemplate/ BadgeTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.badge/ | Badge} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.badgetemplate/ | BadgeTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,14 +7,14 @@ import {BreadcrumbItemStyles as styles} from './breadcrumb-item.styles';
|
|||
|
||||
/**
|
||||
* The VSCode BreadcrumbItem element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumbitem/ BreadcrumbItem} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumbitemtemplate/ BreadcrumbItemTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumbitem/ | BreadcrumbItem} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumbitemtemplate/ | BreadcrumbItemTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
* HTML Element: `<vscode-breadcrumb-item>`
|
||||
*
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus delegatesFocus}
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
||||
*/
|
||||
@customElement({
|
||||
name: 'vscode-breadcrumb-item',
|
||||
|
|
|
@ -7,8 +7,8 @@ import {BreadcrumbStyles as styles} from './breadcrumb.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Breadcrumb element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumb/ Breadcrumb} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumbtemplate/ BreadcrumbTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumb/ | Breadcrumb} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.breadcrumbtemplate/ | BreadcrumbTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -15,8 +15,8 @@ export type ButtonAppearance =
|
|||
|
||||
/**
|
||||
* The VSCode Button Element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.button/ Button} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.buttontemplate/ ButtonTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.button/ | Button} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.buttontemplate/ | ButtonTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
@ -24,7 +24,7 @@ export type ButtonAppearance =
|
|||
*
|
||||
* HTML Attribute: `appearance = primary | secondary | install | text | link`
|
||||
*
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus delegatesFocus}
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
||||
*/
|
||||
@customElement({
|
||||
name: 'vscode-button',
|
||||
|
|
|
@ -7,8 +7,8 @@ import {CheckboxStyles as styles} from './checkbox.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Checkbox element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.checkbox/ Checkbox} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.checkboxtemplate/ CheckboxTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.checkbox/ | Checkbox} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.checkboxtemplate/ | CheckboxTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -21,7 +21,7 @@ const cellTemplate: ViewTemplate = createDataGridCellTemplate('vscode');
|
|||
|
||||
/**
|
||||
* The VSCode Data Grid element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.datagrid/ DataGrid}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.datagrid/ | DataGrid}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
@ -42,7 +42,7 @@ export const DataGridStyles: ElementStyles = gridStyles;
|
|||
|
||||
/**
|
||||
* The VSCode Data Grid Row element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.datagridrow/ DataGridRow}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.datagridrow/ | DataGridRow}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
@ -63,7 +63,7 @@ export const DataGridRowStyles: ElementStyles = rowStyles;
|
|||
|
||||
/**
|
||||
* The VSCode Data Grid Cell element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.datagridcell/ DataGridCell}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.datagridcell/ | DataGridCell}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -13,8 +13,8 @@ import {DesignSystemProviderStyles as styles} from './design-system-provider.sty
|
|||
|
||||
/**
|
||||
* The VSCode DesignSystemProvider element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.designsystemprovider/ DesignSystemProvider} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.designsystemprovidertemplate/ DesignSystemProviderTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.designsystemprovider/ | DesignSystemProvider} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.designsystemprovidertemplate/ | DesignSystemProviderTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -4,8 +4,8 @@ import {DividerStyles as styles} from './divider.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Divider element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.divider/ Divider} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.dividertemplate/ DividerTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.divider/ | Divider} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.dividertemplate/ | DividerTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -11,14 +11,14 @@ export type LinkAppearance = ButtonAppearance | 'hypertext';
|
|||
|
||||
/**
|
||||
* The VSCode Link element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.anchor/ Anchor} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.anchortemplate/ AnchorTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.anchor/ | Anchor} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.anchortemplate/ | AnchorTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
* HTML Element: `<vscode-link>`
|
||||
*
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus delegatesFocus}
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
||||
*/
|
||||
@customElement({
|
||||
name: 'vscode-link',
|
||||
|
|
|
@ -6,8 +6,8 @@ const template = createMenuItemTemplate('vscode');
|
|||
|
||||
/**
|
||||
* The VSCode Menu Item element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menuitem/ MenuItem} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menuitemtemplate/ MenuItemTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menuitem/ | MenuItem} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menuitemtemplate/ | MenuItemTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -4,8 +4,8 @@ import {MenuStyles as styles} from './menu.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Menu element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menu/ Menu} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menutemplate/ MenuTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menu/ | Menu} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.menutemplate/ | MenuTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,8 +7,8 @@ import {OptionStyles as styles} from './option.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Option element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.listboxoption/ ListboxOption} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.listboxoptiontemplate/ ListboxOptionTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.listboxoption/ | ListboxOption} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.listboxoptiontemplate/ | ListboxOptionTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,8 +7,8 @@ import {ProgressBarStyles as styles} from './progress-bar.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Progress Bar element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.baseprogress/ BaseProgress} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.progresstemplate/ ProgressTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.baseprogress/ | BaseProgress} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.progresstemplate/ | ProgressTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,8 +7,8 @@ import {ProgressRingStyles as styles} from './progress-ring.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Progress Ring element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.baseprogress/ BaseProgress} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.progressringtemplate/ ProgressRingTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.baseprogress/ | BaseProgress} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.progressringtemplate/ | ProgressRingTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,8 +7,8 @@ import {RadioGroupStyles as styles} from './radio-group.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Radio Group element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radiogroup/ RadioGroup} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radiogrouptemplate/ RadioGroupTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radiogroup/ | RadioGroup} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radiogrouptemplate/ | RadioGroupTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -4,8 +4,8 @@ import {RadioStyles as styles} from './radio.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Radio element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radio/ Radio} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radiotemplate/ RadioTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radio/ | Radio} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.radiotemplate/ | RadioTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -4,8 +4,8 @@ import {SelectStyles as styles} from './select.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Select element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.select/ Select} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.selecttemplate/ SelectTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.select/ | Select} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.selecttemplate/ | SelectTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,8 +7,8 @@ import {TabPanelStyles as styles} from './tab-panel.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Tab Panel element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabpanel/ TabPanel} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabpaneltemplate/ TabPanelTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabpanel/ | TabPanel} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabpaneltemplate/ | TabPanelTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -4,8 +4,8 @@ import {TabStyles as styles} from './tab.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Tab element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tab/ Tab} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabtemplate/ TabTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tab/ | Tab} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabtemplate/ | TabTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -4,8 +4,8 @@ import {TabsStyles as styles} from './tabs.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Tabs element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabs/ Tabs} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabstemplate/ TabsTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabs/ | Tabs} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.tabstemplate/ | TabsTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
|
|
|
@ -7,15 +7,15 @@ import {TextAreaStyles as styles} from './text-area.styles';
|
|||
|
||||
/**
|
||||
* The VSCode Text Area element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textarea/ TextArea} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textareatemplate/ TextAreaTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textarea/ | TextArea} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textareatemplate/ | TextAreaTemplate}.
|
||||
*
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
* HTML Element: `<vscode-text-area>`
|
||||
*
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus delegatesFocus}
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
||||
*/
|
||||
@customElement({
|
||||
name: 'vscode-text-area',
|
||||
|
|
|
@ -13,14 +13,14 @@ export type TextFieldAppearance = 'filled' | 'outline';
|
|||
|
||||
/**
|
||||
* The VSCode Text Field element. Extends
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textfield/ TextField} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textfieldtemplate/ TextFieldTemplate}.
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textfield/ | TextField} and
|
||||
* {@link https://www.fast.design/docs/api/fast-foundation.textfieldtemplate/ | TextFieldTemplate}.
|
||||
*
|
||||
* @public
|
||||
* @remarks
|
||||
* HTML Element: `<vscode-text-field>`
|
||||
*
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus delegatesFocus}
|
||||
* Shadow Option: {@link https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot/delegatesFocus | delegatesFocus}
|
||||
*/
|
||||
@customElement({
|
||||
name: 'vscode-text-field',
|
||||
|
|
|
@ -1,6 +1,14 @@
|
|||
/**
|
||||
* This script applies the current VSCode theme to the VSCode Webview Toolkit
|
||||
* components.
|
||||
*
|
||||
* Note: This utility function should be used in tandem with the
|
||||
* setThemeEventListener utility function to correctly set up
|
||||
* VSCode theme change handling in the VSCode Webview Toolkit.
|
||||
*/
|
||||
|
||||
import {colorTokensToAttributeNames} from './tokensToAttributes';
|
||||
|
||||
// This code should run automatically when the file is executed
|
||||
window.addEventListener('load', () => {
|
||||
const designProvider = document.querySelector(
|
||||
'vscode-design-system-provider'
|
||||
|
@ -14,10 +22,6 @@ window.addEventListener('load', () => {
|
|||
* Applies the current VSCode theme to the VSCode Webview Toolkit
|
||||
* components.
|
||||
*
|
||||
* Note: This utility function should be used in tandem with the
|
||||
* `setThemeEventListener` utility function to correctly set up
|
||||
* VSCode theme change handling in the VSCode Webview Toolkit.
|
||||
*
|
||||
* @param designProvider A reference to the `<vscode-design-system-provider>` element
|
||||
*/
|
||||
function applyCurrentTheme(designProvider: Element) {
|
|
@ -8,7 +8,8 @@ import {WebviewPanel, window} from 'vscode';
|
|||
* `applyCurrentTheme` utility function to correctly set up VSCode theme
|
||||
* change handling in the VSCode Webview Toolkit.
|
||||
*
|
||||
* @param panel The current VSCode webview panel
|
||||
* @public
|
||||
* @param panel - The current VSCode webview panel
|
||||
*/
|
||||
export function setThemeEventListener(panel: WebviewPanel) {
|
||||
window.onDidChangeActiveColorTheme(e => {
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"pretty": true,
|
||||
"target": "ES2015",
|
||||
"module": "ESNext",
|
||||
"target": "es6",
|
||||
"module": "esnext",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist/esm",
|
||||
"rootDir": "src",
|
||||
"lib": ["dom", "es6"],
|
||||
"declarationDir": "dist/dts",
|
||||
"pretty": true,
|
||||
"esModuleInterop": true,
|
||||
"importHelpers": true,
|
||||
"experimentalDecorators": true,
|
||||
"strictPropertyInitialization": false,
|
||||
"declaration": true,
|
||||
"declarationDir": "dist/dts",
|
||||
"sourceMap": true,
|
||||
"noEmitOnError": true,
|
||||
"strict": true,
|
||||
"strictNullChecks": true,
|
||||
"allowJs": true,
|
||||
"outDir": "dist/esm",
|
||||
"rootDir": "src",
|
||||
"lib": ["DOM", "ES2015"]
|
||||
"allowJs": true
|
||||
},
|
||||
"include": ["src"],
|
||||
"exclude": [
|
||||
|
|
Загрузка…
Ссылка в новой задаче