-
Classes as the only way to create Code Components to Framer X.
- ES6 Classes are awesome but hardly the only way to code reusable components in React. If I wanted to create a stateless functional component there is no way for Framer X to view or create an instance of such component inside the Components panel.
-
Examples on how to Extend a Framer X Class component (ie: PageComponent)
- This might be solved with a little documentation effort. I’m doing that to understand the relationship between the core components of Framer X and external community driven components (FX/React/JS).
This file contains hidden or 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
const isCanvasOrPreview = (source: any) => { | |
const searchLoop: (node: any) => 'canvas' | 'preview' = node => { | |
if (!node) return 'canvas' | |
if (node.key === 'preview') return 'preview' | |
return searchLoop(node._debugOwner) | |
} | |
return searchLoop(source._reactInternalFiber) | |
} |
This file contains hidden or 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
import * as React from 'react' | |
import { PropertyControls, ControlType } from 'framer' | |
interface WithPropertyControls<P> extends React.SFC<P> { | |
propertyControls?: PropertyControls | |
} | |
declare type RFC<P> = WithPropertyControls<P> | |
interface Props { |
This file contains hidden or 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
import React, { Component, useCallback, useState, useRef } from "react"; | |
import "./App.css"; | |
const imgUrl = require("./assets/iPhone-XS-Portrait-Space-Gray.png"); | |
const fullSize = { | |
width: 1325, | |
height: 2616 | |
}; |
This file contains hidden or 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
copy( | |
Array.from(document.querySelectorAll('p')).map(p => { | |
const t = p.innerText | |
return { | |
t | |
} | |
}) | |
) |
This file contains hidden or 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
{ | |
"workbench.colorCustomizations": { | |
"titleBar.activeBackground": "#05f", | |
"titleBar.inactiveBackground": "#09f", | |
"titleBar.inactiveForeground": "#262626", | |
"titleBar.activeForeground": "#ffffff" | |
} | |
} |
This file contains hidden or 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
import * as React from 'react' | |
import { fonts } from './fonts' | |
const fontNames = fontArray => { | |
let fontList = [] | |
fontArray.forEach((elem, index) => fontList.push(elem.family)) | |
return fontList | |
} | |
const filterFontsByCategory = (category: string) => { |
This file contains hidden or 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
{ | |
"compatibleVersion": 3, | |
"bundleVersion": 1, | |
"commands": [ | |
{ | |
"name": "SVG", | |
"identifier": "main", | |
"script": "./svg.js" | |
} | |
], |
https://www.nngroup.com/articles/ten-usability-heuristics/
- Visibility of system status
- Match between system & the real world
- User control & freedom
- Consistency & standards
- Error prevention
- Recognition rather than recall
- Flexibility & efficiency of use
- Aesthetic & minimalist design
This file contains hidden or 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
license: mit |