npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

craft-codeless-designer

v1.0.31

Published

An approach to build a Codeless Designer with React, and Craft.js.

Downloads

3

Readme

1.简介

Craft Codeless Designer 是一款可视化的低代码/零代码页面设计器,基于 craft.js 扩展而来。

2.用法

  • 在你的 React 项目中安装依赖: yarn add craft-codeless-designer
  • 引用 <CraftDesigner> 组件
render() {
    //只要给 CraftDesigner 传递 pageData 参数,它自己会反序列化成页面。
    const pageData = this.state.pageEntity.pageData;
    return (
        <CraftDesigner
            onSaveData={this.onSaveData.bind(this)}
            onLoadData={this.loadData.bind(this)}
            onPreview={this.onPreview.bind(this)}
            pageData={pageData}
            ></CraftDesigner>
    );
}

完整的实例项目参见: https://github.com/craft-codeless-designer/craft-codeless-designer-demo

3.核心 API

<CraftDesigner> 是唯一的核心组件,它集成了所有功能。

<CraftDesigner> 核心 props 说明:

| props | 说明 | | -------------- | ------------------------------------------------------------------------------ | | onPreview | 预览按钮回调函数 | | onDelete | 删除按钮回调函数 | | onUndo | Undo 按钮回调函数 | | onRedo | Redo 按钮回调函数 | | onSaveData | 保存 按钮回调函数 | | onLoadData | 加载 按钮回调函数 | | onHelp | Help 按钮回调函数 | | showNavBar | 是否渲染顶部导航条,默认为 true | | showSiderBar | 是否渲染侧边工具栏,默认为 true | | componentTypes | 组件类型列表, CraftDesigner 内置的组件已经全部添加在列表中 | | iconList | 组件图标列表, CraftDesigner 内置的图标已经全部添加在列表中 | | pageData | 页面数据,传递和修改 pageData 会触发 CraftDesigner 重新渲染页面 | | enabled | 是否启用编辑状态,默认为 true ,如果需要进入预览状态,请把此配置项设置为 false |

4.继续开发

  • git clone 此项目
  • yarn install
  • npm start

此工程使用 storybook 编写测试用例和文档。

5.主要优点

  • 支持无限嵌套布局,可以设计出结构非常复杂的页面
  • 支持所有原生 HTML 标签拖拽布局
  • 支持任意 React 组件拖拽布局,包括开源组件,无需对现有组件进行修改
  • 支持 iframe 嵌入组件
  • 支持 ECharts 图形拖拽布局
  • 整个页面序列化成 JSON 数据,不生成代码
  • CraftDesigner 自身也是一个普通的 React 组件,可以被随意集成到任意 React 项目中
  • CraftDesigner 自身是服务端无关的,只输出和输入 JSON 数据

6.效果图

7.主要依赖

8.License

MIT licensed.