@innovatorved/code-lab 0.6.1 → 0.7.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.
Files changed (131) hide show
  1. package/ARCHITECTURE.md +2 -2
  2. package/CHANGELOG.md +35 -0
  3. package/README.md +38 -1
  4. package/dist/apps/web/src/index.d.ts +0 -9
  5. package/dist/code-lab-sql.esm.js +19 -19
  6. package/dist/code-lab-sql.umd.js +20 -20
  7. package/dist/code-lab.css +1 -1
  8. package/dist/code-lab.d.ts +19 -1
  9. package/dist/code-lab.esm.js +933 -1685
  10. package/dist/code-lab.js +932 -1684
  11. package/dist/extensions/cpp.esm.js +132 -8751
  12. package/dist/extensions/cpp.js +124 -8761
  13. package/dist/extensions/guided-lab.esm.js +33 -6827
  14. package/dist/extensions/guided-lab.js +33 -6845
  15. package/dist/extensions/javascript.esm.js +1 -36
  16. package/dist/extensions/javascript.js +1 -58
  17. package/dist/extensions/python.esm.js +79 -8109
  18. package/dist/extensions/python.js +79 -8127
  19. package/dist/extensions/typescript.esm.js +1 -55
  20. package/dist/extensions/typescript.js +1 -77
  21. package/dist/index.d.ts +1 -1
  22. package/dist/modular-kernel.d.ts +0 -4
  23. package/dist/preview-sw.js +1 -1
  24. package/dist/runtime.esm.js +79 -79
  25. package/dist/runtime.js +79 -79
  26. package/dist/schemas.d.ts +22 -1
  27. package/dist/schemas.esm.js +33 -6806
  28. package/dist/schemas.js +33 -6822
  29. package/dist/shell.esm.js +248 -242
  30. package/dist/shell.js +248 -242
  31. package/dist/terminal.esm.js +8 -6
  32. package/dist/terminal.js +6 -6
  33. package/dist/workbench/command-palette.d.ts +0 -4
  34. package/dist/workbench/index.d.ts +0 -20
  35. package/dist/workbench/intellisense.d.ts +1 -7
  36. package/package.json +3 -10
  37. package/src/code-lab.css +11 -503
  38. package/src/extensions/cpp.ts +11 -29
  39. package/src/extensions/guided-lab.ts +6 -2
  40. package/src/extensions/python.ts +9 -3
  41. package/src/index.ts +1 -1
  42. package/src/modular-kernel.ts +0 -4
  43. package/src/runtime.ts +153 -42
  44. package/src/schemas.ts +12 -3
  45. package/src/shell.ts +109 -16
  46. package/src/terminal.ts +4 -2
  47. package/src/workbench/command-palette.ts +22 -302
  48. package/src/workbench/diff-editor.ts +2 -0
  49. package/src/workbench/icons.ts +1 -1
  50. package/src/workbench/index.ts +0 -15
  51. package/src/workbench/intellisense.ts +17 -4
  52. package/src/workbench.ts +432 -456
  53. package/dist/code-lab.umd.js +0 -6109
  54. package/dist/packages/editor/src/index.d.ts +0 -118
  55. package/dist/packages/preview/src/index.d.ts +0 -34
  56. package/dist/packages/runtime/src/index.d.ts +0 -47
  57. package/dist/packages/terminal/src/index.d.ts +0 -54
  58. package/dist/workbench/drawer.d.ts +0 -18
  59. package/dist/workbench/file-tree.d.ts +0 -11
  60. package/dist/workbench/guided-pane.d.ts +0 -11
  61. package/dist/workbench/styles.d.ts +0 -4
  62. package/dist/workbench/toolbar.d.ts +0 -17
  63. package/packages/commands/README.md +0 -7
  64. package/packages/commands/package.json +0 -16
  65. package/packages/commands/src/index.ts +0 -467
  66. package/packages/commands/tsconfig.json +0 -22
  67. package/packages/core/README.md +0 -12
  68. package/packages/core/package.json +0 -13
  69. package/packages/core/src/di.ts +0 -147
  70. package/packages/core/src/disposable.ts +0 -112
  71. package/packages/core/src/errors.ts +0 -205
  72. package/packages/core/src/events.ts +0 -157
  73. package/packages/core/src/index.ts +0 -49
  74. package/packages/core/src/path.ts +0 -118
  75. package/packages/core/src/registry.ts +0 -61
  76. package/packages/core/tsconfig.json +0 -19
  77. package/packages/editor/README.md +0 -9
  78. package/packages/editor/package.json +0 -18
  79. package/packages/editor/src/index.ts +0 -344
  80. package/packages/editor/tsconfig.json +0 -24
  81. package/packages/fs/README.md +0 -7
  82. package/packages/fs/package.json +0 -16
  83. package/packages/fs/src/backends.ts +0 -301
  84. package/packages/fs/src/index.ts +0 -18
  85. package/packages/fs/src/types.ts +0 -44
  86. package/packages/fs/src/vfs-service.ts +0 -257
  87. package/packages/fs/tsconfig.json +0 -22
  88. package/packages/preview/README.md +0 -3
  89. package/packages/preview/package.json +0 -16
  90. package/packages/preview/src/index.ts +0 -125
  91. package/packages/preview/tsconfig.json +0 -22
  92. package/packages/runtime/README.md +0 -3
  93. package/packages/runtime/package.json +0 -17
  94. package/packages/runtime/src/index.ts +0 -134
  95. package/packages/runtime/tsconfig.json +0 -23
  96. package/packages/settings/README.md +0 -7
  97. package/packages/settings/package.json +0 -16
  98. package/packages/settings/src/builtin-schemas.ts +0 -246
  99. package/packages/settings/src/configuration-service.ts +0 -609
  100. package/packages/settings/src/index.ts +0 -38
  101. package/packages/settings/src/jsonc.ts +0 -189
  102. package/packages/settings/src/schema.ts +0 -164
  103. package/packages/settings/tsconfig.json +0 -22
  104. package/packages/sql/README.md +0 -12
  105. package/packages/sql/package.json +0 -13
  106. package/packages/sql/src/completions.ts +0 -359
  107. package/packages/sql/src/diagnostics.ts +0 -200
  108. package/packages/sql/src/formatter.ts +0 -271
  109. package/packages/sql/src/index.ts +0 -54
  110. package/packages/sql/src/sql-editor.ts +0 -802
  111. package/packages/sql/src/styles.ts +0 -524
  112. package/packages/sql/src/tokenizer.ts +0 -457
  113. package/packages/sql/src/types.ts +0 -148
  114. package/packages/sql/tsconfig.json +0 -19
  115. package/packages/terminal/README.md +0 -3
  116. package/packages/terminal/package.json +0 -16
  117. package/packages/terminal/src/index.ts +0 -183
  118. package/packages/terminal/tsconfig.json +0 -22
  119. package/packages/ui/README.md +0 -8
  120. package/packages/ui/package.json +0 -18
  121. package/packages/ui/src/index.ts +0 -40
  122. package/packages/ui/src/observability.ts +0 -173
  123. package/packages/ui/src/plugin-registry.ts +0 -289
  124. package/packages/ui/src/settings-dialog.ts +0 -911
  125. package/packages/ui/src/themes.ts +0 -333
  126. package/packages/ui/tsconfig.json +0 -24
  127. package/src/workbench/drawer.ts +0 -157
  128. package/src/workbench/file-tree.ts +0 -51
  129. package/src/workbench/guided-pane.ts +0 -43
  130. package/src/workbench/styles.ts +0 -211
  131. package/src/workbench/toolbar.ts +0 -182
@@ -1,183 +0,0 @@
1
- import {
2
- CodeLabError,
3
- createServiceId,
4
- Emitter,
5
- type Event,
6
- type IDisposable
7
- } from '@code-lab/core';
8
-
9
- export interface AnsiSegment {
10
- readonly text: string;
11
- readonly fg?: string;
12
- readonly bold?: boolean;
13
- }
14
-
15
- const SGR_COLORS: Readonly<Record<number, string>> = {
16
- 30: '#525252',
17
- 31: '#ef4444',
18
- 32: '#22c55e',
19
- 33: '#eab308',
20
- 34: '#3b82f6',
21
- 35: '#a855f7',
22
- 36: '#06b6d4',
23
- 37: '#e5e5e5',
24
- 90: '#737373',
25
- 91: '#f87171',
26
- 92: '#4ade80',
27
- 93: '#facc15',
28
- 94: '#60a5fa',
29
- 95: '#c084fc',
30
- 96: '#22d3ee',
31
- 97: '#ffffff'
32
- };
33
-
34
- export function parseAnsiSegments(input: string): AnsiSegment[] {
35
- const segments: AnsiSegment[] = [];
36
- // eslint-disable-next-line no-control-regex
37
- const sgrRegex = /\x1b\[([0-9;]*)m/g;
38
- let lastIdx = 0;
39
- let fg: string | undefined;
40
- let bold = false;
41
- let match: RegExpExecArray | null;
42
-
43
- while ((match = sgrRegex.exec(input)) !== null) {
44
- if (match.index > lastIdx) {
45
- segments.push({
46
- text: input.slice(lastIdx, match.index),
47
- ...(fg ? { fg } : {}),
48
- ...(bold ? { bold: true } : {})
49
- });
50
- }
51
- const codes = match[1] ? match[1].split(';').map((n) => Number(n)) : [0];
52
- for (const code of codes) {
53
- if (code === 0) {
54
- fg = undefined;
55
- bold = false;
56
- } else if (code === 1) {
57
- bold = true;
58
- } else if (code === 22) {
59
- bold = false;
60
- } else if (code === 39) {
61
- fg = undefined;
62
- } else if (SGR_COLORS[code]) {
63
- fg = SGR_COLORS[code];
64
- }
65
- }
66
- lastIdx = sgrRegex.lastIndex;
67
- }
68
-
69
- if (lastIdx < input.length) {
70
- segments.push({
71
- text: input.slice(lastIdx),
72
- ...(fg ? { fg } : {}),
73
- ...(bold ? { bold: true } : {})
74
- });
75
- }
76
- return segments;
77
- }
78
-
79
- export interface TerminalSession {
80
- readonly id: string;
81
- readonly title: string;
82
- readonly cwd: string;
83
- readonly lines: readonly string[];
84
- write(chunk: string): void;
85
- clear(): void;
86
- }
87
-
88
- export interface ITerminalService extends IDisposable {
89
- readonly activeSessionId: string | undefined;
90
- readonly onDidWrite: Event<{ sessionId: string; chunk: string }>;
91
- readonly onDidChangeSessions: Event<void>;
92
- createSession(options?: { title?: string; cwd?: string; maxScrollback?: number }): TerminalSession;
93
- getSessions(): TerminalSession[];
94
- setActiveSession(id: string): void;
95
- closeSession(id: string): void;
96
- }
97
-
98
- export const ITerminalServiceId = createServiceId<ITerminalService>('code-lab.terminal');
99
-
100
- export class TerminalService implements ITerminalService {
101
- private readonly sessions = new Map<string, TerminalSession & { _setLines: (l: string[]) => void }>();
102
- private currentSessionId: string | undefined;
103
- private seq = 0;
104
- private readonly writeEmitter = new Emitter<{ sessionId: string; chunk: string }>({ name: 'terminal.write' });
105
- private readonly sessionsEmitter = new Emitter<void>({ name: 'terminal.sessions' });
106
-
107
- public get activeSessionId(): string | undefined {
108
- return this.currentSessionId;
109
- }
110
-
111
- public get onDidWrite(): Event<{ sessionId: string; chunk: string }> {
112
- return this.writeEmitter.event;
113
- }
114
-
115
- public get onDidChangeSessions(): Event<void> {
116
- return this.sessionsEmitter.event;
117
- }
118
-
119
- public createSession(
120
- options: { title?: string; cwd?: string; maxScrollback?: number } = {}
121
- ): TerminalSession {
122
- const id = `term-${++this.seq}`;
123
- const title = options.title ?? `zsh ${this.seq}`;
124
- const cwd = options.cwd ?? '/workspace';
125
- const maxScrollback = Math.max(50, options.maxScrollback ?? 1000);
126
- let buffer: string[] = [];
127
-
128
- const session: TerminalSession & { _setLines: (l: string[]) => void } = {
129
- id,
130
- title,
131
- cwd,
132
- get lines(): readonly string[] {
133
- return buffer;
134
- },
135
- write: (chunk: string): void => {
136
- const incoming = chunk.split('\n');
137
- buffer.push(...incoming);
138
- if (buffer.length > maxScrollback) {
139
- buffer = buffer.slice(buffer.length - maxScrollback);
140
- }
141
- this.writeEmitter.fire({ sessionId: id, chunk });
142
- },
143
- clear: (): void => {
144
- buffer = [];
145
- },
146
- _setLines: (l: string[]): void => {
147
- buffer = l;
148
- }
149
- };
150
-
151
- this.sessions.set(id, session);
152
- this.currentSessionId = id;
153
- this.sessionsEmitter.fire();
154
- return session;
155
- }
156
-
157
- public getSessions(): TerminalSession[] {
158
- return Array.from(this.sessions.values());
159
- }
160
-
161
- public setActiveSession(id: string): void {
162
- if (!this.sessions.has(id)) {
163
- throw new CodeLabError('ERR_INVALID_ARGUMENT', `Terminal session "${id}" does not exist`);
164
- }
165
- this.currentSessionId = id;
166
- this.sessionsEmitter.fire();
167
- }
168
-
169
- public closeSession(id: string): void {
170
- if (!this.sessions.delete(id)) return;
171
- if (this.currentSessionId === id) {
172
- this.currentSessionId = this.sessions.keys().next().value;
173
- }
174
- this.sessionsEmitter.fire();
175
- }
176
-
177
- public dispose(): void {
178
- this.sessions.clear();
179
- this.currentSessionId = undefined;
180
- this.writeEmitter.dispose();
181
- this.sessionsEmitter.dispose();
182
- }
183
- }
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "ESNext",
5
- "moduleResolution": "bundler",
6
- "lib": ["ES2022", "DOM"],
7
- "strict": true,
8
- "noImplicitAny": true,
9
- "strictNullChecks": true,
10
- "noUnusedLocals": true,
11
- "noUnusedParameters": true,
12
- "noImplicitReturns": true,
13
- "noFallthroughCasesInSwitch": true,
14
- "noEmit": true,
15
- "skipLibCheck": true,
16
- "forceConsistentCasingInFileNames": true,
17
- "paths": {
18
- "@code-lab/core": ["../core/src/index.ts"]
19
- }
20
- },
21
- "include": ["src/**/*.ts"]
22
- }
@@ -1,8 +0,0 @@
1
- # `@code-lab/ui`
2
-
3
- Layer 3 (`workbench`) UI controllers, theming, plugin contribution points, and developer observability for **CodeLab**:
4
-
5
- - `ThemeService` — built-in `dark`, `light`, and `high-contrast` themes plus JSON custom theme loader (`parseCustomTheme`).
6
- - `SettingsDialogController` — searchable modal `<dialog closedby="any">` Settings UI with category filters, Reset to Default, Export, and Open `.codelab/settings.json`.
7
- - `PluginRegistry` — VS Code-inspired declarative contribution points (`commands`, `settings`, `keybindings`, `themes`, `panels`, `languages`) with lazy activation events and clean `IDisposable` deactivation.
8
- - `renderObservabilityPanelHtml` & `WorkbenchErrorBoundary` — Dev Observability Inspector and user-visible error boundary.
@@ -1,18 +0,0 @@
1
- {
2
- "name": "@code-lab/ui",
3
- "version": "0.6.1",
4
- "description": "Workbench UI services and components for CodeLab: ThemeService (dark/light/high-contrast/custom), Searchable Settings Dialog, Quick Open, PluginRegistry, ErrorBoundary, and Dev Observability Inspector.",
5
- "type": "module",
6
- "main": "./src/index.ts",
7
- "types": "./src/index.ts",
8
- "exports": {
9
- ".": "./src/index.ts"
10
- },
11
- "dependencies": {
12
- "@code-lab/core": "workspace:*",
13
- "@code-lab/settings": "workspace:*",
14
- "@code-lab/commands": "workspace:*"
15
- },
16
- "sideEffects": false,
17
- "license": "MIT"
18
- }
@@ -1,40 +0,0 @@
1
- export {
2
- type ThemeKind,
3
- type ThemeDefinition,
4
- type IThemeService,
5
- DARK_THEME,
6
- LIGHT_THEME,
7
- HIGH_CONTRAST_THEME,
8
- IThemeServiceId,
9
- pickContrastingFg,
10
- parseCustomTheme,
11
- ThemeService
12
- } from './themes';
13
-
14
- export {
15
- type PanelContribution,
16
- type LanguageContribution,
17
- type PluginContributions,
18
- type PluginActivationContext,
19
- type CodeLabPluginManifest,
20
- type RegisteredPluginInfo,
21
- type IPluginRegistry,
22
- IPluginRegistryId,
23
- PluginRegistry
24
- } from './plugin-registry';
25
-
26
- export {
27
- type SettingsScope,
28
- type SettingsInlineMountOptions,
29
- type SettingsOpenOptions,
30
- type SettingsDialogOptions,
31
- SettingsDialogController
32
- } from './settings-dialog';
33
-
34
- export {
35
- type ObservabilitySnapshotInput,
36
- scoreFuzzyFileMatch,
37
- rankWorkspaceFiles,
38
- renderObservabilityPanelHtml,
39
- WorkbenchErrorBoundary
40
- } from './observability';
@@ -1,173 +0,0 @@
1
- import type { EventTraceRecord, ILogger, IServiceContainer, LogEntry } from '@code-lab/core';
2
- import type { IConfigurationService } from '@code-lab/settings';
3
- import type { IPluginRegistry } from './plugin-registry';
4
-
5
- function escapeHtml(raw: string): string {
6
- return raw
7
- .replace(/&/g, '&amp;')
8
- .replace(/</g, '&lt;')
9
- .replace(/>/g, '&gt;')
10
- .replace(/"/g, '&quot;');
11
- }
12
-
13
- export function scoreFuzzyFileMatch(candidatePath: string, query: string): number {
14
- if (!query) return 1;
15
- const cleanQuery = query.toLowerCase().replace(/\s+/g, '');
16
- const lowerPath = candidatePath.toLowerCase();
17
- if (lowerPath === cleanQuery) return 1000;
18
- const baseIdx = lowerPath.lastIndexOf('/');
19
- const baseName = baseIdx === -1 ? lowerPath : lowerPath.slice(baseIdx + 1);
20
- if (baseName.startsWith(cleanQuery)) return 500 - baseName.length;
21
- if (lowerPath.includes(cleanQuery)) return 300 - lowerPath.length;
22
-
23
- let qIdx = 0;
24
- let score = 0;
25
- let streak = 0;
26
- for (let i = 0; i < lowerPath.length && qIdx < cleanQuery.length; i++) {
27
- if (lowerPath[i] === cleanQuery[qIdx]) {
28
- qIdx++;
29
- streak++;
30
- score += 10 + streak * 4;
31
- } else {
32
- streak = 0;
33
- }
34
- }
35
- return qIdx === cleanQuery.length ? score : -1;
36
- }
37
-
38
- export function rankWorkspaceFiles(
39
- filePaths: readonly string[],
40
- query: string,
41
- excludePatterns: readonly string[] = []
42
- ): string[] {
43
- const filtered = filePaths.filter((p) => {
44
- for (const ex of excludePatterns) {
45
- const token = ex.replace(/\*\*/g, '').replace(/\*/g, '').replace(/^\/+|\/+$/g, '');
46
- if (token && p.includes(token)) return false;
47
- }
48
- return true;
49
- });
50
- const scored: Array<{ path: string; score: number }> = [];
51
- for (const p of filtered) {
52
- const score = scoreFuzzyFileMatch(p, query);
53
- if (score >= 0) scored.push({ path: p, score });
54
- }
55
- scored.sort((a, b) => b.score - a.score || a.path.localeCompare(b.path));
56
- return scored.map((s) => s.path);
57
- }
58
-
59
- export interface ObservabilitySnapshotInput {
60
- readonly container: IServiceContainer;
61
- readonly configuration: IConfigurationService;
62
- readonly plugins: IPluginRegistry;
63
- readonly logger: ILogger;
64
- readonly recentEvents: readonly EventTraceRecord[];
65
- readonly workerStatus?: string;
66
- }
67
-
68
- export function renderObservabilityPanelHtml(input: ObservabilitySnapshotInput): string {
69
- const serviceIds = input.container.listRegisteredIds();
70
- const plugins = input.plugins.getPlugins();
71
- const logs: readonly LogEntry[] = input.logger.getRecentEntries().slice(-15).reverse();
72
- const events = input.recentEvents.slice(-15).reverse();
73
- const configDiags = input.configuration.getDiagnostics();
74
-
75
- return (
76
- `<div class="cl-observability-panel">` +
77
- `<section class="cl-observability-card">` +
78
- `<strong>Services & Runtime (${serviceIds.length})</strong>` +
79
- `<div class="cl-observability-meta">Worker Host: <code>${escapeHtml(input.workerStatus ?? 'ready')}</code></div>` +
80
- `<ul class="cl-observability-list">` +
81
- serviceIds.map((id) => `<li><code>${escapeHtml(id)}</code></li>`).join('') +
82
- `</ul>` +
83
- `</section>` +
84
- `<section class="cl-observability-card">` +
85
- `<strong>Plugins (${plugins.length}) & Config Diagnostics (${configDiags.length})</strong>` +
86
- `<ul class="cl-observability-list">` +
87
- (plugins.length > 0
88
- ? plugins
89
- .map(
90
- (p) =>
91
- `<li><code>${escapeHtml(p.manifest.id)}</code> v${escapeHtml(p.manifest.version)} — ${p.active ? 'active' : 'lazy'}</li>`
92
- )
93
- .join('')
94
- : `<li>No external plugins registered</li>`) +
95
- `</ul>` +
96
- (configDiags.length > 0
97
- ? `<div class="cl-observability-warn">` +
98
- configDiags.map((d) => `<div>⚠ ${escapeHtml(d.message)}</div>`).join('') +
99
- `</div>`
100
- : '') +
101
- `</section>` +
102
- `<section class="cl-observability-card">` +
103
- `<strong>Recent Event Bus (${events.length})</strong>` +
104
- `<ul class="cl-observability-list cl-observability-list--scroll">` +
105
- (events.length > 0
106
- ? events
107
- .map(
108
- (e) =>
109
- `<li><code>${escapeHtml(e.channel)}</code> (${e.listenerCount}) — ${escapeHtml(e.payloadSummary)}</li>`
110
- )
111
- .join('')
112
- : `<li>No events recorded yet</li>`) +
113
- `</ul>` +
114
- `</section>` +
115
- `<section class="cl-observability-card">` +
116
- `<strong>Recent Logs (${logs.length})</strong>` +
117
- `<ul class="cl-observability-list cl-observability-list--scroll">` +
118
- (logs.length > 0
119
- ? logs
120
- .map(
121
- (l) =>
122
- `<li><strong>[${escapeHtml(l.level)}]</strong> <code>${escapeHtml(l.scope)}</code>: ${escapeHtml(l.message)}</li>`
123
- )
124
- .join('')
125
- : `<li>No log entries</li>`) +
126
- `</ul>` +
127
- `</section>` +
128
- `</div>`
129
- );
130
- }
131
-
132
- export class WorkbenchErrorBoundary {
133
- private readonly host: HTMLElement;
134
- private readonly logger: ILogger;
135
- private bannerEl: HTMLElement | null = null;
136
-
137
- public constructor(host: HTMLElement, logger: ILogger) {
138
- this.host = host;
139
- this.logger = logger.child('error-boundary');
140
- }
141
-
142
- public capture(error: unknown, contextLabel = 'Workbench operation'): void {
143
- const msg = error instanceof Error ? error.message : String(error);
144
- this.logger.error(`${contextLabel} failed: ${msg}`, error);
145
- const doc = this.host.ownerDocument ?? document;
146
- if (!this.bannerEl) {
147
- this.bannerEl = doc.createElement('div');
148
- this.bannerEl.className = 'cl-error-boundary-banner';
149
- this.bannerEl.setAttribute('role', 'alert');
150
- if (typeof this.host.prepend === 'function') {
151
- this.host.prepend(this.bannerEl);
152
- } else {
153
- this.host.appendChild(this.bannerEl);
154
- }
155
- }
156
- this.bannerEl.innerHTML =
157
- `<span><strong>${escapeHtml(contextLabel)}:</strong> ${escapeHtml(msg)}</span>` +
158
- `<button type="button" class="codelab-btn cl-ui-btn" data-dismiss-error="1">Dismiss</button>`;
159
- const dismissBtn = this.bannerEl.querySelector('[data-dismiss-error]');
160
- dismissBtn?.addEventListener(
161
- 'click',
162
- () => {
163
- this.clear();
164
- },
165
- { once: true }
166
- );
167
- }
168
-
169
- public clear(): void {
170
- this.bannerEl?.remove();
171
- this.bannerEl = null;
172
- }
173
- }