@zhike/queen-editor
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -0,4 +1,32 @@ | ||
import { DomElement, DomElementSelector } from '../utils/dom-core'; | ||
import Text from '../text/index'; | ||
import Menus from '../menus/index'; | ||
import Change from './change/index'; | ||
import SelectionAndRangeAPI from './selection'; | ||
import CommandAPI from './command'; | ||
import { ConfigType } from '../config'; | ||
declare class Editor { | ||
constructor(toolbarSelector: String, textSelector: String); | ||
id: string; | ||
toolbarSelector: DomElementSelector; | ||
textSelector?: DomElementSelector; | ||
config: ConfigType; | ||
$toolbarElem: DomElement; | ||
$textContainerElem: DomElement; | ||
$textElem: DomElement; | ||
toolbarElemId: string; | ||
textElemId: string; | ||
txt: Text; | ||
isComposing: boolean; | ||
change: Change; | ||
menus: Menus; | ||
selection: SelectionAndRangeAPI; | ||
cmd: CommandAPI; | ||
constructor(toolbarSelector: DomElementSelector, textSelector?: DomElementSelector); | ||
/** | ||
* 初始化选区 | ||
* @param newLine 新建一行 | ||
*/ | ||
initSelection(newLine?: boolean): void; | ||
create(): void; | ||
} | ||
export default Editor; |
@@ -1,5 +0,7 @@ | ||
/** | ||
* @description 入口文件 引入样式和ts模块 | ||
*/ | ||
import './assets/style/common.less'; | ||
import './assets/style/text.less'; | ||
import './assets/style/menus.less'; | ||
import './assets/style/panel.less'; | ||
import './assets/style/icon.less'; | ||
import Editor from './editor/index'; | ||
export default Editor; |
{ | ||
"name": "@zhike/queen-editor", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "queen-editor", | ||
@@ -19,6 +19,8 @@ "types": "dist/queenEditor.d.ts", | ||
"check": "eslint \"{src,build}/**/*.{js,ts}\"", | ||
"build-dev": "webpack --config build/webpack.dev.js", | ||
"build": "cross-env NODE_ENV=production webpack --config build/webpack.prod.js", | ||
"prerelease": "git status -s | xargs sh .sh/isWorkingDirClean.sh ", | ||
"try-release": "npm run prerelease && release-it --dry-run", | ||
"release": "npm run build && release-it" | ||
"release": "npm run build && release-it", | ||
"prepare": "husky install" | ||
}, | ||
@@ -41,2 +43,3 @@ "repository": { | ||
"@typescript-eslint/parser": "^4.29.0", | ||
"autoprefixer": "^10.3.1", | ||
"babel-loader": "^8.2.2", | ||
@@ -46,2 +49,3 @@ "clean-webpack-plugin": "^4.0.0-alpha.0", | ||
"cross-env": "^7.0.3", | ||
"css-loader": "^6.2.0", | ||
"eslint": "^7.32.0", | ||
@@ -54,3 +58,3 @@ "eslint-config-standard": "^16.0.3", | ||
"html-webpack-plugin": "^5.3.2", | ||
"husky": "^7.0.1", | ||
"husky": "^7.0.0", | ||
"koa": "^2.13.1", | ||
@@ -60,5 +64,9 @@ "koa-logger": "^3.2.1", | ||
"koa-static": "^5.0.0", | ||
"less": "^4.1.1", | ||
"less-loader": "^10.0.1", | ||
"lint-staged": "^11.1.1", | ||
"nodemon": "^2.0.12", | ||
"postcss-loader": "^6.1.1", | ||
"release-it": "^14.10.1", | ||
"style-loader": "^3.2.1", | ||
"ts-loader": "^9.2.4", | ||
@@ -65,0 +73,0 @@ "typescript": "^4.3.5", |
@@ -93,3 +93,24 @@ # Queen Editor | ||
(待完善) | ||
- `assets` 存放样式字体文件 | ||
- `config` 编辑器默认配置 | ||
- `editor` 编辑器核心功能 | ||
- `index.ts` 编辑器入口文件 | ||
- `init-fns/` 编辑器初始化功能 | ||
- `command.ts` document.exeCommand封装 | ||
- `selection.ts` 封装Selection和Range | ||
- `lib/` 用到的第三方库 | ||
- `menus/` 菜单栏和菜单 | ||
- `index.ts` 菜单栏class | ||
- `menus-constructor/` 生成单个菜单所用到的class | ||
- `menu-list.ts` 汇总所有的菜单 | ||
- 其他文件夹,具体的各个菜单功能。 | ||
- `text/` 文本编辑区域 | ||
- `index.ts` 入口文件,产出class, 封装单个API。 | ||
- `event-hooks/` 初始化text的各个钩子函数,如回车、删除、黏贴等 | ||
- `paste/` 处理黏贴事件 | ||
- `utils` 工具 | ||
- `observer/` 文本区域内容比变化监听器 | ||
- `const.ts` 常量 | ||
- `dom-core.ts` 封装简单jq,进行dom操作 | ||
- `util.ts` 各个工具函数 | ||
@@ -107,4 +128,14 @@ `配置相关目录` | ||
## 3 Refs | ||
## 3 效果演示地址 | ||
[演示demo](https://document.dev.kidkid.com/queen-editor) | ||
## 4 实现规范 | ||
[产品原型](https://lanhuapp.com/web/#/item/project/product?tid=ac435b1e-7945-4667-8dc0-7be5220f62d0&pid=06c03bd0-d480-4a86-a121-af35b8d339e8&versionId=0af69564-85a3-41f8-8e89-a2669b3a6fd0&docId=f2c7a2bd-c346-4967-9bf4-92643b341241&docType=axure&pageId=6258a2f703d2498f9e3e2475ce2ad0de&image_id=f2c7a2bd-c346-4967-9bf4-92643b341241&type=share_mark&tab=product&teamId=ac435b1e-7945-4667-8dc0-7be5220f62d0&userId=22bbe1a2-9281-423f-90e4-8d19025ac895¶m=none) | ||
[设计规范](https://zk-ued.yuque.com/zk-ued/ikwc77/artboards/14083243?artboard_type=artboard&from=&view=) | ||
## 5 Refs | ||
[wangEditor](https://github.com/wangeditor-team/wangEditor) (`respect`) | ||
@@ -111,0 +142,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
964486
33
13638
149
37