Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

support framework frames for Aframe #2980 #4458

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions assets/images/Svg.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const svg = {
"pause-exceptions": require("./pause-exceptions.svg"),
plus: require("./plus.svg"),
preact: require("./preact.svg"),
aframe: require("./aframe.svg"),
prettyPrint: require("./prettyPrint.svg"),
react: require("./react.svg"),
"regex-match": require("./regex-match.svg"),
Expand Down
19 changes: 19 additions & 0 deletions assets/images/aframe.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 4 additions & 1 deletion src/utils/frame.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,16 @@ const libraryMap = [
{
label: "Marko",
pattern: /marko/i
},
{
label: "Aframe",
pattern: /aframe/i
}
];

export function getLibraryFromUrl(frame: Frame) {
// @TODO each of these fns calls getFrameUrl, just call it once
// (assuming there's not more complex logic to identify a lib)

const frameUrl = getFrameUrl(frame);
const match = find(libraryMap, o => frameUrl.match(o.pattern));
return match && match.label;
Expand Down