@design.estate/dees-catalog 3.35.1 → 3.36.0

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.
@@ -25,6 +25,24 @@ export interface IXtermFitAddonBundle {
25
25
  FitAddon: typeof FitAddon;
26
26
  }
27
27
 
28
+ /**
29
+ * Bundle type for xterm-addon-search
30
+ * SearchAddon is loaded from CDN, so we use a minimal interface
31
+ */
32
+ export interface IXtermSearchAddonBundle {
33
+ SearchAddon: new () => IXtermSearchAddon;
34
+ }
35
+
36
+ /**
37
+ * Minimal interface for xterm SearchAddon
38
+ */
39
+ export interface IXtermSearchAddon {
40
+ activate(terminal: Terminal): void;
41
+ dispose(): void;
42
+ findNext(term: string, searchOptions?: { regex?: boolean; wholeWord?: boolean; caseSensitive?: boolean; incremental?: boolean }): boolean;
43
+ findPrevious(term: string, searchOptions?: { regex?: boolean; wholeWord?: boolean; caseSensitive?: boolean; incremental?: boolean }): boolean;
44
+ }
45
+
28
46
  /**
29
47
  * Bundle type for Tiptap editor and extensions
30
48
  */
@@ -56,6 +74,7 @@ export class DeesServiceLibLoader {
56
74
  // Cached library references
57
75
  private xtermLib: IXtermBundle | null = null;
58
76
  private xtermFitAddonLib: IXtermFitAddonBundle | null = null;
77
+ private xtermSearchAddonLib: IXtermSearchAddonBundle | null = null;
59
78
  private highlightJsLib: HLJSApi | null = null;
60
79
  private apexChartsLib: typeof ApexChartsType | null = null;
61
80
  private tiptapLib: ITiptapBundle | null = null;
@@ -63,6 +82,7 @@ export class DeesServiceLibLoader {
63
82
  // Loading promises to prevent duplicate concurrent loads
64
83
  private xtermLoadingPromise: Promise<IXtermBundle> | null = null;
65
84
  private xtermFitAddonLoadingPromise: Promise<IXtermFitAddonBundle> | null = null;
85
+ private xtermSearchAddonLoadingPromise: Promise<IXtermSearchAddonBundle> | null = null;
66
86
  private highlightJsLoadingPromise: Promise<HLJSApi> | null = null;
67
87
  private apexChartsLoadingPromise: Promise<typeof ApexChartsType> | null = null;
68
88
  private tiptapLoadingPromise: Promise<ITiptapBundle> | null = null;
@@ -134,6 +154,32 @@ export class DeesServiceLibLoader {
134
154
  return this.xtermFitAddonLoadingPromise;
135
155
  }
136
156
 
157
+ /**
158
+ * Load xterm-addon-search from CDN
159
+ * @returns Promise resolving to SearchAddon class
160
+ */
161
+ public async loadXtermSearchAddon(): Promise<IXtermSearchAddonBundle> {
162
+ if (this.xtermSearchAddonLib) {
163
+ return this.xtermSearchAddonLib;
164
+ }
165
+
166
+ if (this.xtermSearchAddonLoadingPromise) {
167
+ return this.xtermSearchAddonLoadingPromise;
168
+ }
169
+
170
+ this.xtermSearchAddonLoadingPromise = (async () => {
171
+ const url = `${CDN_BASE}/xterm-addon-search@${CDN_VERSIONS.xtermAddonSearch}/+esm`;
172
+ const module = await import(/* @vite-ignore */ url);
173
+
174
+ this.xtermSearchAddonLib = {
175
+ SearchAddon: module.SearchAddon,
176
+ };
177
+ return this.xtermSearchAddonLib;
178
+ })();
179
+
180
+ return this.xtermSearchAddonLoadingPromise;
181
+ }
182
+
137
183
  /**
138
184
  * Inject xterm CSS styles into the document head
139
185
  */
@@ -257,6 +303,7 @@ export class DeesServiceLibLoader {
257
303
  await Promise.all([
258
304
  this.loadXterm(),
259
305
  this.loadXtermFitAddon(),
306
+ this.loadXtermSearchAddon(),
260
307
  this.loadHighlightJs(),
261
308
  this.loadApexCharts(),
262
309
  this.loadTiptap(),
@@ -266,12 +313,14 @@ export class DeesServiceLibLoader {
266
313
  /**
267
314
  * Check if a specific library is already loaded
268
315
  */
269
- public isLoaded(library: 'xterm' | 'xtermFitAddon' | 'highlightJs' | 'apexCharts' | 'tiptap'): boolean {
316
+ public isLoaded(library: 'xterm' | 'xtermFitAddon' | 'xtermSearchAddon' | 'highlightJs' | 'apexCharts' | 'tiptap'): boolean {
270
317
  switch (library) {
271
318
  case 'xterm':
272
319
  return this.xtermLib !== null;
273
320
  case 'xtermFitAddon':
274
321
  return this.xtermFitAddonLib !== null;
322
+ case 'xtermSearchAddon':
323
+ return this.xtermSearchAddonLib !== null;
275
324
  case 'highlightJs':
276
325
  return this.highlightJsLib !== null;
277
326
  case 'apexCharts':
@@ -1,3 +1,3 @@
1
1
  export { DeesServiceLibLoader } from './DeesServiceLibLoader.js';
2
- export type { IXtermBundle, IXtermFitAddonBundle, ITiptapBundle } from './DeesServiceLibLoader.js';
2
+ export type { IXtermBundle, IXtermFitAddonBundle, IXtermSearchAddonBundle, IXtermSearchAddon, ITiptapBundle } from './DeesServiceLibLoader.js';
3
3
  export { CDN_BASE, CDN_VERSIONS } from './versions.js';
@@ -5,6 +5,7 @@
5
5
  export const CDN_VERSIONS = {
6
6
  xterm: '5.3.0',
7
7
  xtermAddonFit: '0.8.0',
8
+ xtermAddonSearch: '0.13.0',
8
9
  highlightJs: '11.11.1',
9
10
  apexcharts: '5.3.6',
10
11
  tiptap: '2.23.0',