Skip to content

Commit 1685b41

Browse files
authored
Merge pull request framer#454 from framer/design-pages-support
Support design pages in Tidy Up and Renamer
2 parents 4ef4652 + 98e6d96 commit 1685b41

6 files changed

Lines changed: 34 additions & 9 deletions

File tree

55.1 KB
Binary file not shown.

plugins/renamer/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
},
1515
"dependencies": {
1616
"classnames": "^2.5.1",
17-
"framer-plugin": "^3.6.0",
17+
"framer-plugin": "^3.7.0",
1818
"react": "^18.3.1",
1919
"react-dom": "^18.3.1"
2020
},

plugins/renamer/src/search/indexer.ts

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
import { type CanvasRootNode, framer, isComponentNode, isFrameNode, isTextNode, isWebPageNode } from "framer-plugin"
1+
import {
2+
type CanvasRootNode,
3+
framer,
4+
isComponentNode,
5+
isDesignPageNode,
6+
isFrameNode,
7+
isTextNode,
8+
isWebPageNode,
9+
} from "framer-plugin"
210
import { isCanvasNode } from "./traits"
311
import type { CanvasNode, IndexEntry } from "./types"
412

@@ -104,15 +112,16 @@ export class Indexer {
104112

105113
private async getRootNodes(): Promise<CanvasRootNode[]> {
106114
if (this.scope === "project") {
107-
const [webPages, componentNodes] = await Promise.all([
115+
const [webPages, componentNodes, designPages] = await Promise.all([
108116
framer.getNodesWithType("WebPageNode"),
109117
framer.getNodesWithType("ComponentNode"),
118+
framer.getNodesWithType("DesignPageNode"),
110119
])
111-
return [...webPages, ...componentNodes]
120+
return [...webPages, ...componentNodes, ...designPages]
112121
}
113122

114123
const root = await framer.getCanvasRoot()
115-
if (!isWebPageNode(root) && !isComponentNode(root)) return []
124+
if (!isWebPageNode(root) && !isComponentNode(root) && !isDesignPageNode(root)) return []
116125

117126
return [root]
118127
}

plugins/tidyup/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"check-typescript": "run g:check-typescript"
1414
},
1515
"dependencies": {
16-
"framer-plugin": "^3.6.0",
16+
"framer-plugin": "^3.7.0",
1717
"react": "^18.3.1",
1818
"react-dom": "^18.3.1",
1919
"valibot": "^1.1.0"

plugins/tidyup/src/App.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
type CanvasRootNode,
44
framer,
55
isComponentNode,
6+
isDesignPageNode,
67
isVectorSetNode,
78
isWebPageNode,
89
supportsPins,
@@ -105,7 +106,12 @@ function useGroundNodeRects() {
105106
const parent = await node.getParent()
106107
if (!parent) continue
107108
if (!active) return
108-
if (isWebPageNode(parent) || isComponentNode(parent) || isVectorSetNode(parent)) {
109+
if (
110+
isWebPageNode(parent) ||
111+
isComponentNode(parent) ||
112+
isVectorSetNode(parent) ||
113+
isDesignPageNode(parent)
114+
) {
109115
groundNodes.push(node)
110116
}
111117
}

yarn.lock

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4604,6 +4604,16 @@ __metadata:
46044604
languageName: node
46054605
linkType: hard
46064606

4607+
"framer-plugin@npm:^3.7.0":
4608+
version: 3.7.0
4609+
resolution: "framer-plugin@npm:3.7.0"
4610+
peerDependencies:
4611+
react: ^18.2.0
4612+
react-dom: ^18.2.0
4613+
checksum: 10/30b7231daafc1142df63859a1eadcd193faa6a9c97dac254868ca1381cdb1d1b53841390ba14b596b7d75c7fdc4b3602a85b79a911b8528fbb206ded61a8ac0b
4614+
languageName: node
4615+
linkType: hard
4616+
46074617
"fs-minipass@npm:^3.0.0":
46084618
version: 3.0.3
46094619
resolution: "fs-minipass@npm:3.0.3"
@@ -6393,7 +6403,7 @@ __metadata:
63936403
"@types/react": "npm:^18.3.24"
63946404
"@types/react-dom": "npm:^18.3.7"
63956405
classnames: "npm:^2.5.1"
6396-
framer-plugin: "npm:^3.6.0"
6406+
framer-plugin: "npm:^3.7.0"
63976407
framer-plugin-tools: "npm:^1.0.0"
63986408
react: "npm:^18.3.1"
63996409
react-dom: "npm:^18.3.1"
@@ -6807,7 +6817,7 @@ __metadata:
68076817
dependencies:
68086818
"@types/react": "npm:^18.3.24"
68096819
"@types/react-dom": "npm:^18.3.7"
6810-
framer-plugin: "npm:^3.6.0"
6820+
framer-plugin: "npm:^3.7.0"
68116821
react: "npm:^18.3.1"
68126822
react-dom: "npm:^18.3.1"
68136823
valibot: "npm:^1.1.0"

0 commit comments

Comments
 (0)