44 type Collection ,
55 framer ,
66 isComponentNode ,
7+ isDesignPageNode ,
78 isFrameNode ,
89 isTextNode ,
910 isWebPageNode ,
@@ -27,6 +28,10 @@ async function getNodeName(node: AnyNode): Promise<string | null> {
2728 return node . path
2829 }
2930
31+ if ( isDesignPageNode ( node ) ) {
32+ return node . name ?? "Design"
33+ }
34+
3035 if ( isComponentNode ( node ) ) {
3136 return node . name ?? "Component"
3237 }
@@ -203,7 +208,9 @@ export class GlobalSearchIndexer {
203208 rootNodes : readonly CanvasRootNode [ ] ,
204209 abortSignal ?: AbortSignal
205210 ) {
206- const validRootNodes = rootNodes . filter ( rootNode => isComponentNode ( rootNode ) || isWebPageNode ( rootNode ) )
211+ const validRootNodes = rootNodes . filter (
212+ rootNode => isComponentNode ( rootNode ) || isWebPageNode ( rootNode ) || isDesignPageNode ( rootNode )
213+ )
207214
208215 for await ( const batch of this . crawlNodes ( currentIndexRun , validRootNodes ) ) {
209216 if ( this . abortRequested || abortSignal ?. aborted ) break
@@ -258,10 +265,11 @@ export class GlobalSearchIndexer {
258265 const lastIndexRun = await this . db . getLastIndexRun ( )
259266 const currentIndexRun = lastIndexRun + 1
260267
261- const [ pages , components , canvasRoot ] = await Promise . all ( [
268+ const [ canvasRoot , ...rootNodes ] = await Promise . all ( [
269+ framer . getCanvasRoot ( ) ,
262270 framer . getNodesWithType ( "WebPageNode" ) ,
263271 framer . getNodesWithType ( "ComponentNode" ) ,
264- framer . getCanvasRoot ( ) ,
272+ framer . getNodesWithType ( "DesignPageNode" ) ,
265273 ] )
266274
267275 this . abortRequested = false
@@ -273,9 +281,7 @@ export class GlobalSearchIndexer {
273281
274282 // Remove the current open canvas root from the list of root nodes to index
275283 // as it's already being indexed by the canvas root watcher
276- const rootNodesWithoutCurrentRoot = [ ...pages , ...components ] . filter (
277- rootNode => rootNode . id !== canvasRoot . id
278- )
284+ const rootNodesWithoutCurrentRoot = rootNodes . flat ( ) . filter ( rootNode => rootNode . id !== canvasRoot . id )
279285
280286 await Promise . all ( [
281287 this . processNodes ( currentIndexRun , rootNodesWithoutCurrentRoot ) ,
0 commit comments