Skip to content

Commit

Permalink
Merge pull request #442 from KxSystems/ee-shoelace
Browse files Browse the repository at this point in the history
Port datasource to new component library
  • Loading branch information
ecmel authored Oct 16, 2024
2 parents 2a3beb9 + 6a1f20a commit 62bf740
Show file tree
Hide file tree
Showing 8 changed files with 1,292 additions and 624 deletions.
120 changes: 120 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -964,6 +964,7 @@
"bracketSameLine": true
},
"devDependencies": {
"@shoelace-style/shoelace": "^2.17.1",
"@types/extract-zip": "^2.0.1",
"@types/fs-extra": "^11.0.4",
"@types/glob": "^8.1.0",
Expand Down
19 changes: 12 additions & 7 deletions src/services/dataSourceEditorProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

import {
ColorThemeKind,
CustomTextEditorProvider,
Disposable,
ExtensionContext,
Expand Down Expand Up @@ -223,23 +224,27 @@ export class DataSourceEditorProvider implements CustomTextEditorProvider {
}

private getWebviewContent(webview: Webview) {
const webviewUri = getUri(webview, this.context.extensionUri, [
"out",
"webview.js",
]);
const nonce = getNonce();
const getResource = (resource: string) =>
getUri(webview, this.context.extensionUri, ["out", resource]);

return /* html */ `
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="${
window.activeColorTheme.kind === ColorThemeKind.Light ||
window.activeColorTheme.kind === ColorThemeKind.HighContrastLight
? "sl-theme-light"
: "sl-theme-dark"
}">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" href="${getResource("light.css")}" />
<link rel="stylesheet" href="${getResource("style.css")}" />
<script type="module" nonce="${getNonce()}" src="${getResource("webview.js")}"></script>
<title>DataSource</title>
</head>
<body>
<kdb-data-source-view></kdb-data-source-view>
<script type="module" nonce="${nonce}" src="${webviewUri}"></script>
</body>
</html>
`;
Expand Down
Loading

0 comments on commit 62bf740

Please sign in to comment.