mirror of
https://github.com/idrawjs/idraw
synced 2026-05-24 10:08:34 +00:00
refactor: refactor @idraw/board export
This commit is contained in:
parent
ebfa1905dd
commit
32b02e9ff7
9 changed files with 19 additions and 17 deletions
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.2.0-alpha.26",
|
||||
"description": "",
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.es.js",
|
||||
"module": "dist/index.esm.js",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
|
|
|
|||
3
packages/board/src/default.ts
Normal file
3
packages/board/src/default.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
import { Board } from './index';
|
||||
|
||||
export default Board;
|
||||
5
packages/board/src/esm.ts
Normal file
5
packages/board/src/esm.ts
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
import { Board } from './index';
|
||||
|
||||
export * from './index';
|
||||
|
||||
export default Board;
|
||||
|
|
@ -2,7 +2,7 @@ import {
|
|||
TypeScreenPosition, TypeScreenSize, TypeScreenContext, TypePoint, TypePointCursor,
|
||||
TypeBoardOptions, TypeBoardSizeOptions, TypeContext,
|
||||
} from '@idraw/types';
|
||||
import util from '@idraw/util';
|
||||
import { throttle, Context } from '@idraw/util';
|
||||
import { ScreenWatcher } from './lib/screen-watcher';
|
||||
import { setStyle } from './lib/style';
|
||||
import { TypeBoardEventArgMap } from './lib/event';
|
||||
|
|
@ -16,14 +16,11 @@ import {
|
|||
_screen, _tempData
|
||||
} from './names';
|
||||
|
||||
const { Context } = util;
|
||||
const { throttle } = util.time;
|
||||
|
||||
type PrivateOptions = TypeBoardOptions & {
|
||||
devicePixelRatio: number
|
||||
}
|
||||
|
||||
class Board {
|
||||
export class Board {
|
||||
|
||||
private [_hasRendered] = false;
|
||||
|
||||
|
|
@ -342,5 +339,5 @@ class Board {
|
|||
|
||||
}
|
||||
|
||||
export default Board;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
import util from '@idraw/util';
|
||||
import { istype } from '@idraw/util';
|
||||
|
||||
export default util.istype;
|
||||
export default istype;
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
import { TypePoint, TypeContext } from '@idraw/types';
|
||||
// import util from '@idraw/util';
|
||||
import { TypePoint, TypeContext } from '@idraw/types';
|
||||
import { BoardEvent, TypeBoardEventArgMap } from './event';
|
||||
import { TempData } from './watcher-temp';
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import {
|
|||
TypeScreenPosition,
|
||||
TypeBoardScrollConfig,
|
||||
} from '@idraw/types';
|
||||
import util from '@idraw/util';
|
||||
import { isColorStr } from '@idraw/util';
|
||||
|
||||
type TypeOptions = {
|
||||
width: number,
|
||||
|
|
@ -184,7 +184,7 @@ export class Scroller {
|
|||
}
|
||||
options.scrollConfig.lineWidth = Math.max(options.scrollConfig.lineWidth, defaultScrollConfig.lineWidth);
|
||||
|
||||
if (util.color.isColorStr(options.scrollConfig.color) !== true) {
|
||||
if (isColorStr(options.scrollConfig.color) !== true) {
|
||||
options.scrollConfig.color = options.scrollConfig.color;
|
||||
}
|
||||
return options;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,5 @@
|
|||
import { TypeBoardOptions, TypeContext } from '@idraw/types';
|
||||
import util from '@idraw/util';
|
||||
|
||||
const Context = util.Context;
|
||||
import { Context } from '@idraw/util';
|
||||
|
||||
type TempDataDesc = {
|
||||
ctx: TypeContext,
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
"version": "0.2.0-alpha.26",
|
||||
"description": "",
|
||||
"main": "dist/index.cjs.js",
|
||||
"module": "dist/index.es.js",
|
||||
"module": "dist/index.esm.js",
|
||||
"unpkg": "dist/index.global.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
|
|
|
|||
Loading…
Reference in a new issue