-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #30 from bridgedxyz/feature/atom-detection
atom detection - icon button detection implemented
- Loading branch information
Showing
9 changed files
with
111 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ImageRepository } from "../assets-repository" | ||
|
||
export abstract class BuildProcess { | ||
readonly id: string | ||
readonly processes: Array<BuildProcess> = [] | ||
imageAssetRepository: ImageRepository | ||
|
||
constructor() { | ||
this.id = Date.now().toString() | ||
} | ||
|
||
|
||
registerProcess(process: BuildProcess) { | ||
this.processes.push(process) | ||
} | ||
|
||
} | ||
|
||
export class FlutterBuilder extends BuildProcess { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import { detectIfScreen } from "@reflect.bridged.xyz/detection/lib/screen.detection"; | ||
import { isRouteAction } from "../interpreter/action.interpret"; | ||
|
||
export function makeRoutes(): Array<string> { | ||
const routes = Array<string>() | ||
const allScreenReactions = fetchAllActionsGlobal({ | ||
onlyScreen: true | ||
}) | ||
|
||
for (const id of Object.keys(allScreenReactions)) { | ||
const singleScreenReactions: Reaction[] = allScreenReactions[id] | ||
const validReactions = singleScreenReactions.filter((r) => isRouteAction(r)) | ||
for (const reaction of validReactions) { | ||
if (reaction.action.type == "NODE") { | ||
routes.push(reaction.action.destinationId) | ||
} | ||
} | ||
} | ||
return routes | ||
} | ||
|
||
|
||
function fetchAllActionsGlobal(options?: { | ||
onlyScreen: boolean | ||
}): Map<string, Array<Reaction>> { | ||
|
||
const filter = options?.onlyScreen ? (n: SceneNode): boolean => { | ||
// as any type casting might cause an error afterwards. | ||
return detectIfScreen(n as any).result | ||
} : () => true | ||
|
||
let reactions = new Map<string, Array<Reaction>>(); | ||
figma.root.children.forEach(page => { | ||
page.children.forEach(node => { | ||
if (filter(node)) | ||
reactions = new Map([...reactions, ...fetchAllActionsUnderNode(node)]) | ||
}) | ||
}); | ||
return reactions | ||
} | ||
|
||
function fetchAllActionsUnderNode(node: SceneNode): Map<string, Array<Reaction>> { | ||
let reactions = new Map<string, Array<Reaction>>(); | ||
if ('reactions' in node) { | ||
reactions[node.id] = node.reactions | ||
} | ||
if ('children' in node) { | ||
reactions = new Map<string, Array<Reaction>>([...reactions, ...fetchAllActionsUnderNode(node)]) | ||
} | ||
return reactions; | ||
} |
Submodule design-sdk
updated
from 90a604 to 7eb36f
Submodule flutter-builder
updated
from 3019b6 to e54cb8
Submodule reflect-detection
updated
from e8b62c to ef8a3e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2900,6 +2900,11 @@ cocoascript-class@^0.1.2: | |
resolved "https://registry.yarnpkg.com/cocoascript-class/-/cocoascript-class-0.1.2.tgz#dab25f20389946d9986c1812b88ac3783eec42d3" | ||
integrity sha1-2rJfIDiZRtmYbBgSuIrDeD7sQtM= | ||
|
||
[email protected]: | ||
version "0.0.1" | ||
resolved "https://registry.yarnpkg.com/coli/-/coli-0.0.1.tgz#039d81bb8a45fc53ac51a640e4e8e9f3db6d3acf" | ||
integrity sha512-0H1UGi0qix1aRTbAT/jP/ZtqrErb0gIWzSR5UXCnbBwL6YXkzXhiJ9M/gFhKLqjBuedCPk/wk1ev0ws5HPPYNg== | ||
|
||
collect-v8-coverage@^1.0.0: | ||
version "1.0.1" | ||
resolved "https://registry.yarnpkg.com/collect-v8-coverage/-/collect-v8-coverage-1.0.1.tgz#cc2c8e94fc18bbdffe64d6534570c8a673b27f59" | ||
|