Git Product home page Git Product logo

molecule's Introduction

watchman-logo

Molecule

A lightweight Web IDE UI Framework

CI CII Best Practices Codecov NPM downloads NPM version Chat

中文 | English | 한국어

The Molecule is a lightweight Web IDE UI framework which is built with React.js and inspired by the VSCode. We have designed the Extension APIs similar to the VSCode, to help developers extend the Workbench in an easier way. It's convenient to integrate the Molecule with React.js applications. It has been applied to many products in DTStack

Online Preview

Features

  • Built-in the Visual Studio Code Workbench UI
  • Compatible with the Visual Studio Code ColorTheme
  • Customize the Workbench via React Component easily
  • Built-in Monaco-Editor Command Palette, Keybinding features
  • Support the i18n, built-in Simplified Chinese, Korean and English
  • Built-in Settings, support to edit and extend via the Extension
  • Built-in basic Explorer, Search components, and support extending via the Extension
  • Typescript Ready

Installation

npm install @dtinsight/molecule
# Or
yarn add @dtinsight/molecule

Basic Usage

import React from 'react';
import ReactDOM from 'react-dom';
import { create, Workbench } from '@dtinsight/molecule';
import '@dtinsight/molecule/esm/style/mo.css';

const moInstance = create({
    extensions: [],
});

const App = () => moInstance.render(<Workbench />);

ReactDOM.render(<App />, document.getElementById('root'));

The extension is the Extension applications entry, more details about Extension, please read the Quick Start.

Document

Development

git clone [email protected]:DTStack/molecule.git

Clone the source code into your local

Development Mode

yarn # Install dependencies

yarn dev # Start dev mode

The Molecule using the Storybook to manage and develop the React components, the default visiting address is http://localhost:6006/.

Test

yarn test -u

Build & Preview

yarn build # Compile to ESM
yarn web # Web Preview Mode

We compile the source code into the ES6 modules and output to the esm folder. Besides the Storybook development mode, there also builtin a Web Preview mode using the ESM modules.

Contributing

Refer to the CONTRIBUTING.

Communication

  • We use DingTalk to communicate,You can search the group number 30537511 or scan the QR code below to join the communication group

License

Copyright © DTStack. All rights reserved.

Licensed under the MIT license.

molecule's People

Contributors

kiwiwong avatar mortalyoung avatar mumiao avatar profbramble avatar sqlgate avatar wewoor avatar yyllff avatar zaoei avatar zhangtengjin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

molecule's Issues

Appearance 显示隐藏 SideBar

通过 Appearance 菜单,显示隐藏 SideBar,支持通过点击 Explorer/Search 打开 Siebar

image

隐藏后的 MenuBar 可以通过 ActivitBar 重新展示 MenuBar

image

Explorer 模块一些功能点以及问题汇总

  • 监听 workspace 区域右键事件(Add Folder)
  • 缓存当前 select node 数据(支持 collapse header 右侧快捷新建操作)
  • 支持新建后 tree 自动 expand 以及 input focus
  • rename 数据更新(input 数据回填、tab 数据更新)
  • Tree 文件夹目录下无文件时导致图标丢失
  • vscode 还原度提高

Support IPanelItem extends ITab renderPanel interface

Use ITab renderPanel interface and cancel render interface definition

export interface IPanelItem<T = any> extends ITab<any> {
    id: string;
    title?: string;
    toolbox?: IActionBarItem[];
    data?: T;
    render?(item: IPanelItem): ReactNode;
}
export interface ITab<T, P = any> {
    renderPanel?: ((item: P) => ReactNode) | ReactNode;
    data?: T;
}

0.9.0-alpha.1

Workbench

Sidebar

  • Explorer Actions 支持隐藏/显示 OPEN EDITORS #9
  • Explorer TreeView 支持增、删、改操作 #10
  • Search Pane 支持简单文本/正则搜索规则,和搜索结果展示树 #11
  • 重构 Explorer 模块代码 #12

Editor

  • Editor 支持 Close Others, Close To Left, Close To Right, Close All 等基本功能 #13
  • Menu 菜单 Edit 支持 Undo, Redo 触发 #14
  • 支持自定义 Editor Renderer, 根据 Tab Data 具体展示面板 #15

Menu

  • 支持 Settings 菜单触发 Command Palette #16

ActivityBar

  • 支持基本的上下文菜单 #28
  • 支持显示隐藏 MenuBar/Search/Explorer 等操作 #28

StatusBar

  • 支持统计显示来自 EditorText 的 Errors 和 Warnings 信息(Problems) #17
  • 支持消息面板的查阅,推送,清除功能 #18

Panel

  • 支持 Panel 的展示/关闭 #19
  • 支持 Panel 增加/删除/修改默认面板(Pane) #21
  • 支持展示 Problems 具体信息 #20
  • 支持默认的 Output 面板,基本的 Append, Clear 等操作 #22

Appearance

  • 显示隐藏 MenuBar #23
  • 显示隐藏 SideBar,支持通过点击 Explorer/Search 打开 Siebar #24
  • 显示隐藏 StatusBar #25
  • 显示隐藏 ActivityBar #26

ColorTheme

  • 优化 Monaco 部分样式无法显示的问题,部分组件颜色取错的问题 #27

Notification 支持面板的查阅,推送,清除功能

消息按钮主要用于收纳 IDE 通知(Notification)相关信息,具体功能如下:

  • 根据状态展示消息按钮(有消息/无消息)
  • 点击信息按钮可查阅/关闭通知面板
  • 支持推送/删除新的消息

参考:

image

Tab组件 因 editorGroup重构导致的问题修复

Descipition

@wewoor 重构editorGroup 部分逻辑丢失 需要完成如下:

  • Tab active 效果失效 #49
  • Close editor 对应的renderPanel内容不会更新
  • Close editor 关闭当前eidtorTab, 默认向后/向前切换一个tab;关闭otherTab;直接splice
  • Open Editor 默认打开当前trigger的tab #41

KeyBinding 支持热键绑定

增加热键支持服务,直接引用 vscode 内置服务

Reference

模块: vs/workbench/borwser/actions/quickAccessActions.ts

import { KeybindingsRegistry, KeybindingWeight, IKeybindingRule } from 'vs/platform/keybinding/common/keybindingsRegistry';


KeybindingsRegistry.registerKeybindingRule({
	id: QUICKACCESS_ACTION_ID,
	weight: KeybindingWeight.WorkbenchContrib,
	when: undefined,
	primary: globalQuickAccessKeybinding.primary,
	secondary: globalQuickAccessKeybinding.secondary,
	mac: globalQuickAccessKeybinding.mac
});

Test Always

v0.9.0-alpha.1 Test Plan

测试计划执行至少发布前一周开始执行

Workbench

  • editor
  • sideBar
  • activityBar
  • statusBar
  • menu
  • panel

Services

  • activityBarService
  • explorerService
  • sidebarService
  • menuBarService
  • statusBarService
  • panelService
  • editorService
  • extensionService
  • colorThemeService
  • settingsService

Components

  • actionBar
  • breadcrumb
  • button
  • checkbox
  • collapse
  • contextMenu
  • contextView
  • dialog
  • dropdown
  • icon
  • input
  • list
  • menu
  • monaco
  • scrollable
  • select
  • tabs
  • toolbar
  • tree

ColorTheme 优化

优化 Monaco 部分样式无法显示的问题,部分组件颜色取错的问题

参考:

  1. miniMap 并未刷新

image

ref #61

  1. Code Editor 中 部分 Token 没有解析

Model 对象移除默认 DI 模式,跟最新重构的`Service`保持一致;eg:**PanelService**

DI 注入参数初始化值太过麻烦 跟最新重构的Service保持一致;eg:PanelService

  • activityBar
  • menuBar
  • sideBar
   export class SidebarModel implements ISidebar {
    public current: string;
    public panes: ISidebarPane[];

    constructor(
        @inject('SidebarPane') panes: ISidebarPane[] = [],
        @inject('Selected') selected: string = ''
    ) {
        this.panes = panes;
        this.current = selected;
    }
}

container.register('SidebarPane', { useValue: [] });
container.register('Selected', { useValue: '' });

@wewoor 需要新增issue去剔掉

Originally posted by @mumiao in #38 (comment)

重构 Explorer 模块代码

Explorer 历史代码 Model, View, Controller, Service 划分还不够清楚

例如 Model 中包含大量的数据处理逻辑方法:

image

react/connector 组件支持单个View 组件链接多个Service

目前 connect 函数只能链接单个 service/view/controller, 如下:

const PanelView = connect(panelService, Panel, panelController);

考虑支持如下场景:
单个组件链接多个Service state, 用法例如:

const PanelView = connect({
  A: serviceA, 
  B: serviceB
}
, Panel, {controllerA: controllerA, controllerB: controllerB}
);

The Molecule Roadmap 2021

The Molecule Roadmap 2021

Q1

Workbench

  • 完善 Workbench 基本的 Editor, Sidebar, ActivityBar, StatusBar, Menu,Explorer,Search 等基本功能

Q2

国际化

  • 基本的国际化能力,默认英文/中文

Settings

  • 支持通过 JSON/UI 的方式完成基本的默认 Theme, Text Editor、Layout 设置

KeyBinding

  • 支持通过修改 settings 配置文件,来自定义部分内置功能的热键

Release Experimental Version

  • 官网和基本使用指南
  • 基本的 API 文档

Q3

  • DAGScheduleX 落地
  • 单测补充
  • API 文档 & 使用指南(Tutorials)
  • 开发官方网站

Q4

  • 文档完善/优化
  • 开放代码

Document

  • 优化

Panel Question collections

  • editor panel 背景颜色不一致,导致Maximize后 颜色差异大,但是新增的PanelItem 没有问题
    unexpected
    image
    image
    expected
    image

  • panel 缺少选中状态
    unexpected
    image
    expected
    image

  • suggestion
    PanelService 维护 currentPane

   <Tabs
      data={tabs}
      activeTab={activeTab}
      onMoveTab={onMoveTab}
      onSelectTab={onSelectTab}
  />

ActivityBar 支持基本的上下文菜单

ActivityBar 支持基本的上下文菜单,和默认操作,具体功能如下:

  • 支持通过 activityBarService 操作(增删改) contextMenu
  • 支持基本的 MenuBar/Search/Explorer 显示隐藏 功能

参考:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.