Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port datasource to new component library #442

Merged
merged 21 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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