Skip to content

Commit 2b7611b

Browse files
committed
Remove the minimal catalog references from the sample gallery app
1 parent a30995b commit 2b7611b

2 files changed

Lines changed: 6 additions & 18 deletions

File tree

samples/client/lit/gallery_v0_9/scripts/sync-specs.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,7 @@ function syncDir(sourceDir, targetDir) {
4040
console.log(`Generated manifest for ${indexFiles.length} files.`);
4141
}
4242

43-
syncDir(
44-
path.resolve(process.cwd(), '../../../../specification/v0_9/json/catalogs/minimal/examples'),
45-
path.resolve(process.cwd(), 'public/specs/v0_9/minimal/examples')
46-
);
47-
4843
syncDir(
4944
path.resolve(process.cwd(), '../../../../specification/v0_9/json/catalogs/basic/examples'),
5045
path.resolve(process.cwd(), 'public/specs/v0_9/basic/examples')
51-
);
46+
);

samples/client/lit/gallery_v0_9/src/local-gallery.ts

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { LitElement, html, css, nothing } from "lit";
1818
import { provide } from "@lit/context";
1919
import { customElement, state } from "lit/decorators.js";
2020
import { MessageProcessor } from "@a2ui/web_core/v0_9";
21-
import { minimalCatalog, basicCatalog, Context } from "@a2ui/lit/v0_9";
21+
import { basicCatalog, Context } from "@a2ui/lit/v0_9";
2222
import { renderMarkdown } from "@a2ui/markdown-it";
2323
// Try avoiding direct deep import if A2uiMessage is not exported at the top level, using any for now as this is just a type for the array of messages
2424
interface DemoItem {
@@ -27,7 +27,6 @@ interface DemoItem {
2727
filename: string;
2828
description: string;
2929
messages: any[];
30-
isBasic?: boolean;
3130
}
3231

3332
@customElement("local-gallery")
@@ -42,7 +41,7 @@ export class LocalGallery extends LitElement {
4241
private accessor markdownRenderer = renderMarkdown;
4342

4443
private processor = new MessageProcessor(
45-
[minimalCatalog, basicCatalog],
44+
[basicCatalog],
4645
(action: any) => {
4746
this.log(`Action dispatched: ${action.surfaceId}`, action);
4847
},
@@ -249,12 +248,7 @@ export class LocalGallery extends LitElement {
249248
async loadExamples() {
250249
try {
251250
const items: DemoItem[] = [];
252-
await this.fetchExamplesFrom(
253-
"./specs/v0_9/minimal/examples",
254-
items,
255-
false,
256-
);
257-
await this.fetchExamplesFrom("./specs/v0_9/basic/examples", items, true);
251+
await this.fetchExamplesFrom("./specs/v0_9/basic/examples", items);
258252

259253
this.demoItems = items;
260254
if (items.length > 0) {
@@ -265,7 +259,7 @@ export class LocalGallery extends LitElement {
265259
}
266260
}
267261

268-
async fetchExamplesFrom(dir: string, items: DemoItem[], isBasic: boolean) {
262+
async fetchExamplesFrom(dir: string, items: DemoItem[]) {
269263
try {
270264
const indexResp = await fetch(`${dir}/index.json`);
271265
if (!indexResp.ok) throw new Error(`Could not load manifest from ${dir}`);
@@ -287,7 +281,7 @@ export class LocalGallery extends LitElement {
287281
version: "v0.9",
288282
createSurface: {
289283
surfaceId,
290-
catalogId: isBasic ? basicCatalog.id : minimalCatalog.id,
284+
catalogId: basicCatalog.id,
291285
},
292286
});
293287
}
@@ -302,7 +296,6 @@ export class LocalGallery extends LitElement {
302296
filename: filename,
303297
description: data.description || `Source: ${filename}`,
304298
messages: messages,
305-
isBasic,
306299
});
307300
} catch (err) {
308301
console.error(`Error loading ${filename}:`, err);

0 commit comments

Comments
 (0)