0.7.8 • Published 9 months ago

zhihui-editor v0.7.8

Weekly downloads
-
License
ISC
Repository
-
Last release
9 months ago

特征

  • 📝 开箱即用 - 简单的配置即可获得功能齐全的图像编辑器
  • 🧑‍💻 自定义样式 - 高度自定义扩展,可个性化为自己喜爱的样式
  • 🎨 设计资源 - 10万+优质模板、创意素材随心选
  • 📤 多种格式导出 - 导出PDF、PNG、JPG、JSON等多种格式
  • 🛠 高可扩展 - 所有对画布的工具组件都可自定义扩展,高度个性化定制,匹配各种场景
  • 🤹 结合AI - 结合各种AI能力,来提效编辑器功能的创新型,提高生产效率

快速开始

在线尝试 ⚡️

npm.io

本地初始化项目

安装 Node.js >=18 并运行以下命令:

npm install zhihui-editor

初始化演示应用程序(基于 React 框架):

// css导入
import 'zhihui-editor/lib/zhihui-editor.min.css';

import { WorkspaceWrap, ZhihuiEditorContainer, SidePanelWrap } from 'zhihui-editor';
import { createStore } from 'zhihui-editor/lib/model/store';
import { SidePanel } from 'zhihui-editor/lib/side-panel';
import { Workspace } from 'zhihui-editor/lib/canvas/workspace';
import { Toolbar } from 'zhihui-editor/lib/toolbar/toolbar';
import { ZoomButtons } from 'zhihui-editor/lib/toolbar/zoomButtons';

// 设置语言的方法
import { setTranslations } from 'zhihui-editor/lib/config';

// 默认提供两种语言包
import en_US from 'zhihui-editor/lib/locale/enUS';
import zh_CN from 'zhihui-editor/lib/locale/zhCN';

// 控制工程的辅助工具
import { createProject } from 'zhihui-editor/lib/project';
function App() {
  const store = createStore({});
  const project = createProject({ store });

  const init = async () => {
    // 加载字体资源库
    await project.getGlobalFont();
    // 加载模板
    project.firstLoad();
  };

  useEffect(() => {
    init();
  }, []);

  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <ZhihuiEditorContainer>
        <SidePanelWrap>
          <SidePanel store={store} />
        </SidePanelWrap>
        <WorkspaceWrap>
          <Toolbar store={store} />
          <Workspace store={store} />
          <ZoomButtons store={store} />
        </WorkspaceWrap>
      </ZhihuiEditorContainer>
    </div>
  );
}

核心技术栈

  • React - 用于渲染用户界面 (UI) 的 JavaScript 库
  • Rollup - 用于 JavaScript 的模块打包工具
  • Tailwind CSS - 是一个功能类优先的 CSS 框架,它提供了一套预先定义的类,提供了构建组件的原子类
  • Fabric.js - 是一个强大而简单的Javascript HTML5画布库
  • IconPack - 图标库
  • Mobx - 状态管理库

License

Licensed under the MIT License.

0.7.4

9 months ago

0.7.3

9 months ago

0.7.6

9 months ago

0.7.5

9 months ago

0.7.8

9 months ago

0.7.7

9 months ago

0.7.2

9 months ago

0.7.1

9 months ago

0.6.7

9 months ago

0.6.6

9 months ago

0.6.9

9 months ago

0.6.8

9 months ago

0.6.3

10 months ago

0.6.5

10 months ago

0.6.4

10 months ago

0.7.0

9 months ago

0.5.8

12 months ago

0.4.9

1 year ago

0.5.7

12 months ago

0.4.8

1 year ago

0.3.9

1 year ago

0.5.9

12 months ago

0.3.0

1 year ago

0.5.4

1 year ago

0.4.5

1 year ago

0.3.6

1 year ago

0.2.7

1 year ago

0.6.2

11 months ago

0.5.3

1 year ago

0.4.4

1 year ago

0.3.5

1 year ago

0.2.6

1 year ago

0.5.6

12 months ago

0.4.7

1 year ago

0.3.8

1 year ago

0.2.9

1 year ago

0.5.5

12 months ago

0.4.6

1 year ago

0.3.7

1 year ago

0.2.8

1 year ago

0.5.0

1 year ago

0.4.1

1 year ago

0.3.2

1 year ago

0.4.0

1 year ago

0.3.1

1 year ago

0.6.1

11 months ago

0.5.2

1 year ago

0.4.3

1 year ago

0.3.4

1 year ago

0.6.0

12 months ago

0.5.1

1 year ago

0.4.2

1 year ago

0.3.3

1 year ago

1.0.0

2 years ago