Skip to content

Latest commit

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

scriptable-transform

用 react 来写 scriptable 脚本的插件。

项目启发

来自 scriptable-jsx 的启发,觉得这个小工具挺有意思的。希望自己也能实现一个。

本项目和原项目在思路上有点不同,所以如果提 PR 的话改动太大,所以干脆就直接重写了。

使用方式

npm install -D scriptable-transform
// .babelrc
{
...
"plugins": [
...
[
"@babel/plugin-transform-react-jsx",
{
"throwIfNamespace": false,
"runtime": "automatic",
"importSource": "scriptable-transform"
}
]
]
}
import{render}from'scriptable-transform';constroot=newListWidget();functionApp(){return(<><textonCreate={(text: WidgetText)=>text.textColor=Color.cyan()}text={'AAAA'}/><texttext={'BBBB'}/><stack><texttext={'CCC'}/><texttext={'DDD'}/></stack><stackonCreate={(stack: WidgetText)=>stack.url='https://github.com/kyuuseiryuu'}><texttext={'EEEE'}/><datedate={newDate()}/></stack></>);}render(<App/>,root);root.presentMedium().then();

About

use react to write scriptable

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages