@idraw/core 0.4.2 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/board/index.d.ts +2 -2
- package/dist/esm/board/index.js +23 -12
- package/dist/esm/board/sharer.d.ts +3 -3
- package/dist/esm/board/sharer.js +10 -10
- package/dist/esm/board/viewer.d.ts +3 -3
- package/dist/esm/board/viewer.js +14 -14
- package/dist/esm/board/watcher.d.ts +3 -3
- package/dist/esm/board/watcher.js +68 -43
- package/dist/esm/core.d.ts +52 -0
- package/dist/esm/core.js +393 -0
- package/dist/esm/cursor/cursor-image.d.ts +2 -0
- package/dist/esm/cursor/cursor-image.js +2 -0
- package/dist/esm/cursor/cursor.js +60 -24
- package/dist/esm/index.d.ts +12 -61
- package/dist/esm/index.js +11 -389
- package/dist/esm/middlewares/common.d.ts +4 -0
- package/dist/esm/middlewares/common.js +13 -0
- package/dist/esm/middlewares/creator/dom.d.ts +11 -0
- package/dist/esm/middlewares/creator/dom.js +52 -0
- package/dist/esm/middlewares/creator/index.d.ts +5 -0
- package/dist/esm/middlewares/creator/index.js +136 -0
- package/dist/esm/middlewares/creator/static.d.ts +14 -0
- package/dist/esm/middlewares/creator/static.js +19 -0
- package/dist/esm/middlewares/creator/styles.d.ts +4 -0
- package/dist/esm/middlewares/creator/styles.js +32 -0
- package/dist/esm/middlewares/creator/types.d.ts +7 -0
- package/dist/esm/middlewares/creator/types.js +1 -0
- package/dist/esm/middlewares/creator/util.d.ts +10 -0
- package/dist/esm/middlewares/creator/util.js +52 -0
- package/dist/esm/middlewares/dragger/index.js +5 -5
- package/dist/esm/middlewares/info/draw-info.d.ts +11 -11
- package/dist/esm/middlewares/info/draw-info.js +18 -18
- package/dist/esm/middlewares/info/index.d.ts +2 -1
- package/dist/esm/middlewares/info/index.js +48 -51
- package/dist/esm/middlewares/info/static.d.ts +6 -0
- package/dist/esm/middlewares/info/{config.js → static.js} +6 -1
- package/dist/esm/middlewares/info/types.d.ts +2 -2
- package/dist/esm/middlewares/layout-selector/dom.d.ts +10 -0
- package/dist/esm/middlewares/layout-selector/dom.js +108 -0
- package/dist/esm/middlewares/layout-selector/index.d.ts +1 -1
- package/dist/esm/middlewares/layout-selector/index.js +89 -141
- package/dist/esm/middlewares/layout-selector/static.d.ts +32 -0
- package/dist/esm/middlewares/layout-selector/static.js +39 -0
- package/dist/esm/middlewares/layout-selector/styles.d.ts +4 -0
- package/dist/esm/middlewares/layout-selector/styles.js +127 -0
- package/dist/esm/middlewares/layout-selector/types.d.ts +6 -6
- package/dist/esm/middlewares/layout-selector/types.js +2 -2
- package/dist/esm/middlewares/layout-selector/util.d.ts +4 -4
- package/dist/esm/middlewares/layout-selector/util.js +19 -19
- package/dist/esm/middlewares/path-creator/dom.d.ts +29 -0
- package/dist/esm/middlewares/path-creator/dom.js +145 -0
- package/dist/esm/middlewares/path-creator/index.d.ts +5 -0
- package/dist/esm/middlewares/path-creator/index.js +203 -0
- package/dist/esm/middlewares/path-creator/static.d.ts +23 -0
- package/dist/esm/middlewares/path-creator/static.js +49 -0
- package/dist/esm/middlewares/path-creator/types.d.ts +1 -0
- package/dist/esm/middlewares/path-editor/calc.d.ts +6 -0
- package/dist/esm/middlewares/path-editor/calc.js +51 -0
- package/dist/esm/middlewares/path-editor/dom.d.ts +32 -0
- package/dist/esm/middlewares/path-editor/dom.js +575 -0
- package/dist/esm/middlewares/path-editor/draw.d.ts +7 -0
- package/dist/esm/middlewares/path-editor/draw.js +113 -0
- package/dist/esm/middlewares/path-editor/index.d.ts +5 -0
- package/dist/esm/middlewares/path-editor/index.js +312 -0
- package/dist/esm/middlewares/path-editor/parse.d.ts +5 -0
- package/dist/esm/middlewares/path-editor/parse.js +37 -0
- package/dist/esm/middlewares/path-editor/static.d.ts +34 -0
- package/dist/esm/middlewares/path-editor/static.js +82 -0
- package/dist/esm/middlewares/path-editor/types.d.ts +26 -0
- package/dist/esm/middlewares/path-editor/types.js +1 -0
- package/dist/esm/middlewares/path-editor/util.d.ts +5 -0
- package/dist/esm/middlewares/path-editor/util.js +21 -0
- package/dist/esm/middlewares/pointer/index.js +5 -5
- package/dist/esm/middlewares/pointer/types.d.ts +2 -2
- package/dist/esm/middlewares/ruler/index.d.ts +2 -0
- package/dist/esm/middlewares/ruler/index.js +12 -19
- package/dist/esm/middlewares/ruler/static.d.ts +8 -0
- package/dist/esm/middlewares/ruler/{config.js → static.js} +16 -3
- package/dist/esm/middlewares/ruler/types.d.ts +2 -2
- package/dist/esm/middlewares/ruler/util.d.ts +6 -6
- package/dist/esm/middlewares/ruler/util.js +31 -31
- package/dist/esm/middlewares/scaler/index.js +2 -2
- package/dist/esm/middlewares/scroller/dom.d.ts +14 -0
- package/dist/esm/middlewares/scroller/dom.js +53 -0
- package/dist/esm/middlewares/scroller/index.d.ts +2 -0
- package/dist/esm/middlewares/scroller/index.js +111 -46
- package/dist/esm/middlewares/scroller/static.d.ts +21 -0
- package/dist/esm/middlewares/scroller/static.js +29 -0
- package/dist/esm/middlewares/scroller/styles.d.ts +4 -0
- package/dist/esm/middlewares/scroller/styles.js +73 -0
- package/dist/esm/middlewares/scroller/types.d.ts +8 -6
- package/dist/esm/middlewares/scroller/types.js +1 -1
- package/dist/esm/middlewares/scroller/util.d.ts +6 -13
- package/dist/esm/middlewares/scroller/util.js +15 -144
- package/dist/esm/middlewares/selector/dom.d.ts +21 -0
- package/dist/esm/middlewares/selector/dom.js +395 -0
- package/dist/esm/middlewares/selector/draw-base.d.ts +9 -21
- package/dist/esm/middlewares/selector/draw-base.js +19 -43
- package/dist/esm/middlewares/selector/draw-reference.d.ts +4 -5
- package/dist/esm/middlewares/selector/draw-reference.js +5 -5
- package/dist/esm/middlewares/selector/index.d.ts +4 -2
- package/dist/esm/middlewares/selector/index.js +315 -439
- package/dist/esm/middlewares/selector/reference.d.ts +5 -5
- package/dist/esm/middlewares/selector/reference.js +36 -30
- package/dist/esm/middlewares/selector/render-frame.d.ts +11 -0
- package/dist/esm/middlewares/selector/render-frame.js +107 -0
- package/dist/esm/middlewares/selector/resize.d.ts +7 -0
- package/dist/esm/middlewares/selector/resize.js +27 -0
- package/dist/esm/middlewares/selector/static.d.ts +67 -0
- package/dist/esm/middlewares/selector/static.js +92 -0
- package/dist/esm/middlewares/selector/styles.d.ts +4 -0
- package/dist/esm/middlewares/selector/styles.js +153 -0
- package/dist/esm/middlewares/selector/types.d.ts +27 -27
- package/dist/esm/middlewares/selector/types.js +1 -1
- package/dist/esm/middlewares/selector/util.d.ts +22 -32
- package/dist/esm/middlewares/selector/util.js +226 -243
- package/dist/esm/middlewares/text-editor/dom.d.ts +5 -0
- package/dist/esm/middlewares/text-editor/dom.js +135 -0
- package/dist/esm/middlewares/text-editor/index.d.ts +5 -20
- package/dist/esm/middlewares/text-editor/index.js +201 -207
- package/dist/esm/middlewares/text-editor/static.d.ts +10 -0
- package/dist/esm/middlewares/text-editor/static.js +17 -0
- package/dist/esm/middlewares/text-editor/types.d.ts +21 -0
- package/dist/esm/middlewares/text-editor/types.js +1 -0
- package/dist/esm/record.d.ts +5 -5
- package/dist/esm/record.js +14 -14
- package/dist/esm/{config.d.ts → static.d.ts} +16 -0
- package/dist/esm/{config.js → static.js} +18 -2
- package/dist/index.global.js +8934 -5646
- package/dist/index.global.min.js +1 -1
- package/package.json +4 -4
- package/dist/esm/middlewares/info/config.d.ts +0 -5
- package/dist/esm/middlewares/layout-selector/config.d.ts +0 -11
- package/dist/esm/middlewares/layout-selector/config.js +0 -12
- package/dist/esm/middlewares/ruler/config.d.ts +0 -7
- package/dist/esm/middlewares/scroller/config.d.ts +0 -10
- package/dist/esm/middlewares/scroller/config.js +0 -16
- package/dist/esm/middlewares/selector/config.d.ts +0 -30
- package/dist/esm/middlewares/selector/config.js +0 -38
- package/dist/esm/middlewares/selector/draw-auxiliary.js +0 -12
- package/dist/esm/middlewares/selector/draw-debug.d.ts +0 -5
- package/dist/esm/middlewares/selector/draw-debug.js +0 -30
- package/dist/esm/middlewares/selector/draw-wrapper.d.ts +0 -37
- package/dist/esm/middlewares/selector/draw-wrapper.js +0 -139
- package/dist/esm/middlewares/selector/pattern/icon-rotate.d.ts +0 -4
- package/dist/esm/middlewares/selector/pattern/icon-rotate.js +0 -88
- package/dist/esm/middlewares/selector/pattern/index.d.ts +0 -8
- package/dist/esm/middlewares/selector/pattern/index.js +0 -38
- /package/dist/esm/middlewares/{selector/draw-auxiliary.d.ts → path-creator/types.js} +0 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { deepClone, addClassName, removeClassName, updateMaterialInList } from '@idraw/util';
|
|
2
|
+
import { classNameMap, defaultConfig, defaultStyles, getRootClassName, keyStartPoint, keyEndPoint, keyActiveMaterialType, } from './static';
|
|
3
|
+
import { initStyles, destroyStyles, getMiddlewareCreatorStyles } from './styles';
|
|
4
|
+
import { initRoot, resetCreationAreaBox, clearCreationAreaBox } from './dom';
|
|
5
|
+
import { createMaterialByArea, updateMaterialByArea } from './util';
|
|
6
|
+
import { coreEventKeys } from '../../static';
|
|
7
|
+
import { triggerChangeEvent } from '../common';
|
|
8
|
+
export { getMiddlewareCreatorStyles };
|
|
9
|
+
export const MiddlewareCreator = (opts, config) => {
|
|
10
|
+
const { sharer, viewer, calculator, eventHub } = opts;
|
|
11
|
+
let innerConfig = Object.assign(Object.assign(Object.assign({}, defaultStyles), defaultConfig), config);
|
|
12
|
+
const styles = getMiddlewareCreatorStyles(innerConfig);
|
|
13
|
+
const rootClassName = getRootClassName();
|
|
14
|
+
let $root = null;
|
|
15
|
+
let activeMaterial = null;
|
|
16
|
+
const clear = () => {
|
|
17
|
+
sharer.setSharedStorage(keyStartPoint, null);
|
|
18
|
+
sharer.setSharedStorage(keyEndPoint, null);
|
|
19
|
+
activeMaterial = null;
|
|
20
|
+
};
|
|
21
|
+
clear();
|
|
22
|
+
let creative = false;
|
|
23
|
+
const createCallback = ({ type }) => {
|
|
24
|
+
creative = true;
|
|
25
|
+
if ($root) {
|
|
26
|
+
eventHub.trigger(coreEventKeys.CURSOR, {
|
|
27
|
+
type: 'plus',
|
|
28
|
+
});
|
|
29
|
+
sharer.setSharedStorage(keyActiveMaterialType, type);
|
|
30
|
+
addClassName($root, [classNameMap.creative]);
|
|
31
|
+
eventHub.trigger(coreEventKeys.CLEAR_SELECT);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const clearCreateCallback = () => {
|
|
35
|
+
eventHub.trigger(coreEventKeys.CURSOR, {
|
|
36
|
+
type: 'auto',
|
|
37
|
+
});
|
|
38
|
+
creative = false;
|
|
39
|
+
if ($root) {
|
|
40
|
+
removeClassName($root, [classNameMap.creative]);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
return {
|
|
44
|
+
name: '@middleware/creator',
|
|
45
|
+
use() {
|
|
46
|
+
initStyles(rootClassName, styles);
|
|
47
|
+
$root = initRoot({ rootClassName, $container: opts.container });
|
|
48
|
+
eventHub.on(coreEventKeys.CREATE, createCallback);
|
|
49
|
+
eventHub.on(coreEventKeys.CLEAR_CREATE, clearCreateCallback);
|
|
50
|
+
},
|
|
51
|
+
disuse() {
|
|
52
|
+
destroyStyles(rootClassName);
|
|
53
|
+
$root === null || $root === void 0 ? void 0 : $root.remove();
|
|
54
|
+
$root = null;
|
|
55
|
+
eventHub.trigger(coreEventKeys.CURSOR, {
|
|
56
|
+
type: 'auto',
|
|
57
|
+
});
|
|
58
|
+
eventHub.off(coreEventKeys.CREATE, createCallback);
|
|
59
|
+
eventHub.off(coreEventKeys.CLEAR_CREATE, clearCreateCallback);
|
|
60
|
+
},
|
|
61
|
+
resetConfig(config) {
|
|
62
|
+
innerConfig = Object.assign(Object.assign({}, innerConfig), config);
|
|
63
|
+
},
|
|
64
|
+
pointStart: (e) => {
|
|
65
|
+
clear();
|
|
66
|
+
if (!creative) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
sharer.setSharedStorage(keyStartPoint, e.point);
|
|
70
|
+
},
|
|
71
|
+
pointMove: (e) => {
|
|
72
|
+
if (!creative) {
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
sharer.setSharedStorage(keyEndPoint, e.point);
|
|
76
|
+
const activeMaterialType = sharer.getSharedStorage(keyActiveMaterialType);
|
|
77
|
+
const start = sharer.getSharedStorage(keyStartPoint);
|
|
78
|
+
const end = sharer.getSharedStorage(keyEndPoint);
|
|
79
|
+
const viewScaleInfo = sharer.getActiveViewScaleInfo();
|
|
80
|
+
const viewSizeInfo = sharer.getActiveViewSizeInfo();
|
|
81
|
+
const data = sharer.getActiveStorage('data');
|
|
82
|
+
if (activeMaterial && start && end) {
|
|
83
|
+
activeMaterial = updateMaterialByArea(activeMaterial, { start, end, viewScaleInfo, calculator });
|
|
84
|
+
updateMaterialInList(activeMaterial.id, activeMaterial, data.materials);
|
|
85
|
+
calculator.modifyVirtualAttributes(activeMaterial, { viewScaleInfo, viewSizeInfo, groupQueue: [] });
|
|
86
|
+
}
|
|
87
|
+
else if (activeMaterialType && start && end) {
|
|
88
|
+
activeMaterial = createMaterialByArea(activeMaterialType, { start, end, viewScaleInfo, calculator });
|
|
89
|
+
data.materials.push(activeMaterial);
|
|
90
|
+
calculator.resetVirtualItemMap(data, { viewScaleInfo, viewSizeInfo });
|
|
91
|
+
}
|
|
92
|
+
viewer.drawFrame();
|
|
93
|
+
},
|
|
94
|
+
pointEnd: () => {
|
|
95
|
+
var _a, _b;
|
|
96
|
+
if (!creative) {
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
if (activeMaterial) {
|
|
100
|
+
const data = sharer.getActiveStorage('data');
|
|
101
|
+
const modifyRecord = {
|
|
102
|
+
type: 'addMaterial',
|
|
103
|
+
time: Date.now(),
|
|
104
|
+
content: {
|
|
105
|
+
method: 'addMaterial',
|
|
106
|
+
id: activeMaterial.id,
|
|
107
|
+
position: [(_a = data.materials) === null || _a === void 0 ? void 0 : _a.length],
|
|
108
|
+
material: deepClone(activeMaterial),
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
triggerChangeEvent(eventHub, { data, type: 'addMaterial', modifyRecord }, 'all');
|
|
112
|
+
}
|
|
113
|
+
if (innerConfig.selectAfterCreated === true && (activeMaterial === null || activeMaterial === void 0 ? void 0 : activeMaterial.id)) {
|
|
114
|
+
const id = activeMaterial.id;
|
|
115
|
+
eventHub.trigger(coreEventKeys.SELECT, { ids: [id], type: 'selectMaterial' });
|
|
116
|
+
}
|
|
117
|
+
(_b = innerConfig.afterCreated) === null || _b === void 0 ? void 0 : _b.call(innerConfig);
|
|
118
|
+
clearCreationAreaBox($root);
|
|
119
|
+
clearCreateCallback();
|
|
120
|
+
clear();
|
|
121
|
+
},
|
|
122
|
+
beforeDrawFrame() {
|
|
123
|
+
const start = sharer.getSharedStorage(keyStartPoint);
|
|
124
|
+
const end = sharer.getSharedStorage(keyEndPoint);
|
|
125
|
+
if (start && end) {
|
|
126
|
+
resetCreationAreaBox($root, {
|
|
127
|
+
start,
|
|
128
|
+
end,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
else {
|
|
132
|
+
clearCreationAreaBox($root);
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
};
|
|
136
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { MiddlewareCreatorStyles, MiddlewareCreatorConfig } from '@idraw/types';
|
|
2
|
+
export declare const key = "CREATOR";
|
|
3
|
+
export declare const keyStartPoint: unique symbol;
|
|
4
|
+
export declare const keyEndPoint: unique symbol;
|
|
5
|
+
export declare const keyActiveMaterialType: unique symbol;
|
|
6
|
+
export declare const prefix = "idraw-middleware-creator";
|
|
7
|
+
export declare const getRootClassName: () => string;
|
|
8
|
+
export declare const creationAreaBorderWidth = 1.5;
|
|
9
|
+
export declare const defaultStyles: MiddlewareCreatorStyles;
|
|
10
|
+
export declare const defaultConfig: Partial<MiddlewareCreatorConfig>;
|
|
11
|
+
export declare const classNameMap: {
|
|
12
|
+
creationAreaBox: string;
|
|
13
|
+
creative: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createId } from '@idraw/util';
|
|
2
|
+
export const key = 'CREATOR';
|
|
3
|
+
export const keyStartPoint = Symbol(`${key}_startPoint`);
|
|
4
|
+
export const keyEndPoint = Symbol(`${key}_endPoint`);
|
|
5
|
+
export const keyActiveMaterialType = Symbol(`${key}_activeMaterialType`);
|
|
6
|
+
export const prefix = `idraw-middleware-creator`;
|
|
7
|
+
export const getRootClassName = () => `${prefix}-${createId()}`;
|
|
8
|
+
export const creationAreaBorderWidth = 1.5;
|
|
9
|
+
export const defaultStyles = {
|
|
10
|
+
zIndex: 2,
|
|
11
|
+
creationAreaBorderColor: '#1973ba',
|
|
12
|
+
};
|
|
13
|
+
export const defaultConfig = {
|
|
14
|
+
selectAfterCreated: true,
|
|
15
|
+
};
|
|
16
|
+
export const classNameMap = {
|
|
17
|
+
creationAreaBox: `${prefix}-creationAreaBox`,
|
|
18
|
+
creative: `${prefix}-creative`,
|
|
19
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { MiddlewareCreatorStyles, MiddlewareCreatorConfig } from '@idraw/types';
|
|
2
|
+
export declare function initStyles(rootClassName: string, styles: MiddlewareCreatorStyles): void;
|
|
3
|
+
export declare function destroyStyles(rootClassName: string): void;
|
|
4
|
+
export declare function getMiddlewareCreatorStyles<C = MiddlewareCreatorConfig, S = MiddlewareCreatorStyles>(config: C): S;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { injectStyles, removeStyles, getMiddlewareValidStyles } from '@idraw/util';
|
|
2
|
+
import { classNameMap, creationAreaBorderWidth } from './static';
|
|
3
|
+
export function initStyles(rootClassName, styles) {
|
|
4
|
+
const cls = (str) => `.${str}`;
|
|
5
|
+
const stylesProps = {
|
|
6
|
+
display: 'none',
|
|
7
|
+
zIndex: styles.zIndex,
|
|
8
|
+
position: 'absolute',
|
|
9
|
+
background: 'transparent',
|
|
10
|
+
top: 0,
|
|
11
|
+
bottom: 0,
|
|
12
|
+
left: 0,
|
|
13
|
+
right: 0,
|
|
14
|
+
overflow: 'hidden',
|
|
15
|
+
[`&${cls(classNameMap.creative)}`]: {
|
|
16
|
+
display: 'block',
|
|
17
|
+
},
|
|
18
|
+
[cls(classNameMap.creationAreaBox)]: {
|
|
19
|
+
position: 'absolute',
|
|
20
|
+
outline: `${creationAreaBorderWidth}px solid ${styles.creationAreaBorderColor}`,
|
|
21
|
+
background: '#0000ff1f',
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
injectStyles({ styles: stylesProps, rootClassName, type: 'element' });
|
|
25
|
+
}
|
|
26
|
+
export function destroyStyles(rootClassName) {
|
|
27
|
+
removeStyles({ rootClassName, type: 'element' });
|
|
28
|
+
}
|
|
29
|
+
export function getMiddlewareCreatorStyles(config) {
|
|
30
|
+
const styles = getMiddlewareValidStyles(config, ['zIndex', 'creationAreaBorderColor']);
|
|
31
|
+
return styles;
|
|
32
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Point, MaterialType } from '@idraw/types';
|
|
2
|
+
import { keyStartPoint, keyEndPoint, keyActiveMaterialType } from './static';
|
|
3
|
+
export type CreatorSharedStorage = {
|
|
4
|
+
[keyStartPoint]: Point | null;
|
|
5
|
+
[keyEndPoint]: Point | null;
|
|
6
|
+
[keyActiveMaterialType]: Exclude<MaterialType, 'path' | 'foreignObject' | 'svgCode'> | null;
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { keyStartPoint, keyEndPoint, keyActiveMaterialType } from './static';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { MaterialType, Material, Point, ViewScaleInfo, ViewCalculator } from '@idraw/types';
|
|
2
|
+
type Options = {
|
|
3
|
+
start: Point;
|
|
4
|
+
end: Point;
|
|
5
|
+
viewScaleInfo: ViewScaleInfo;
|
|
6
|
+
calculator: ViewCalculator;
|
|
7
|
+
};
|
|
8
|
+
export declare function createMaterialByArea(type: Exclude<MaterialType, 'path' | 'foreignObject' | 'svgCode'>, opts: Options): Material;
|
|
9
|
+
export declare function updateMaterialByArea(mtrl: Material, opts: Options): Material;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { createId, calcPointFromView, getDefaultMaterialAttributes } from '@idraw/util';
|
|
2
|
+
function getMaterialSizeByArea(opts) {
|
|
3
|
+
const { start, end, viewScaleInfo, calculator } = opts;
|
|
4
|
+
const startPoint = calcPointFromView(start, { viewScaleInfo });
|
|
5
|
+
const endPoint = calcPointFromView(end, { viewScaleInfo });
|
|
6
|
+
const size = {
|
|
7
|
+
x: calculator.toGridNum(Math.min(startPoint.x, endPoint.x)),
|
|
8
|
+
y: calculator.toGridNum(Math.min(startPoint.y, endPoint.y)),
|
|
9
|
+
width: calculator.toGridNum(Math.abs(endPoint.x - startPoint.x)),
|
|
10
|
+
height: calculator.toGridNum(Math.abs(endPoint.y - startPoint.y)),
|
|
11
|
+
};
|
|
12
|
+
return size;
|
|
13
|
+
}
|
|
14
|
+
export function createMaterialByArea(type, opts) {
|
|
15
|
+
const { fill, text, href } = getDefaultMaterialAttributes();
|
|
16
|
+
const defaultMtrlAttrs = { fill };
|
|
17
|
+
if (type === 'circle') {
|
|
18
|
+
defaultMtrlAttrs.r = 1;
|
|
19
|
+
}
|
|
20
|
+
else if (type === 'ellipse') {
|
|
21
|
+
defaultMtrlAttrs.rx = 1;
|
|
22
|
+
defaultMtrlAttrs.ry = 1;
|
|
23
|
+
}
|
|
24
|
+
else if (type === 'text') {
|
|
25
|
+
defaultMtrlAttrs.text = text;
|
|
26
|
+
defaultMtrlAttrs.fontSize = 1;
|
|
27
|
+
}
|
|
28
|
+
else if (type === 'image') {
|
|
29
|
+
defaultMtrlAttrs.href = href;
|
|
30
|
+
}
|
|
31
|
+
else if (type === 'group') {
|
|
32
|
+
defaultMtrlAttrs.children = [];
|
|
33
|
+
}
|
|
34
|
+
const mtrl = Object.assign(Object.assign({ id: createId(), type }, defaultMtrlAttrs), getMaterialSizeByArea(opts));
|
|
35
|
+
return mtrl;
|
|
36
|
+
}
|
|
37
|
+
export function updateMaterialByArea(mtrl, opts) {
|
|
38
|
+
const size = getMaterialSizeByArea(opts);
|
|
39
|
+
const { type } = mtrl;
|
|
40
|
+
const updatedMtrl = Object.assign(Object.assign({}, mtrl), size);
|
|
41
|
+
if (type === 'circle') {
|
|
42
|
+
updatedMtrl.r = Math.min(size.width, size.height) / 2;
|
|
43
|
+
}
|
|
44
|
+
else if (type === 'ellipse') {
|
|
45
|
+
updatedMtrl.rx = size.width / 2;
|
|
46
|
+
updatedMtrl.ry = size.height / 2;
|
|
47
|
+
}
|
|
48
|
+
else if (type === 'text') {
|
|
49
|
+
updatedMtrl.fontSize = Math.min(size.width, size.height);
|
|
50
|
+
}
|
|
51
|
+
return updatedMtrl;
|
|
52
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { coreEventKeys } from '../../
|
|
1
|
+
import { coreEventKeys } from '../../static';
|
|
2
2
|
const key = 'DRAG';
|
|
3
3
|
const keyPrevPoint = Symbol(`${key}_prevPoint`);
|
|
4
4
|
export const MiddlewareDragger = (opts) => {
|
|
@@ -11,7 +11,7 @@ export const MiddlewareDragger = (opts) => {
|
|
|
11
11
|
return;
|
|
12
12
|
}
|
|
13
13
|
eventHub.trigger(coreEventKeys.CURSOR, {
|
|
14
|
-
type: 'drag-default'
|
|
14
|
+
type: 'drag-default',
|
|
15
15
|
});
|
|
16
16
|
},
|
|
17
17
|
pointStart(e) {
|
|
@@ -19,7 +19,7 @@ export const MiddlewareDragger = (opts) => {
|
|
|
19
19
|
sharer.setSharedStorage(keyPrevPoint, point);
|
|
20
20
|
isDragging = true;
|
|
21
21
|
eventHub.trigger(coreEventKeys.CURSOR, {
|
|
22
|
-
type: 'drag-active'
|
|
22
|
+
type: 'drag-active',
|
|
23
23
|
});
|
|
24
24
|
},
|
|
25
25
|
pointMove(e) {
|
|
@@ -37,8 +37,8 @@ export const MiddlewareDragger = (opts) => {
|
|
|
37
37
|
isDragging = false;
|
|
38
38
|
sharer.setSharedStorage(keyPrevPoint, null);
|
|
39
39
|
eventHub.trigger(coreEventKeys.CURSOR, {
|
|
40
|
-
type: 'drag-default'
|
|
40
|
+
type: 'drag-default',
|
|
41
41
|
});
|
|
42
|
-
}
|
|
42
|
+
},
|
|
43
43
|
};
|
|
44
44
|
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { Point, ViewContext2D } from '@idraw/types';
|
|
2
|
+
import type { MiddlewareInfoStyles } from '@idraw/types';
|
|
3
3
|
export declare function drawSizeInfoText(ctx: ViewContext2D, opts: {
|
|
4
|
-
point:
|
|
5
|
-
rotateCenter:
|
|
4
|
+
point: Point;
|
|
5
|
+
rotateCenter: Point;
|
|
6
6
|
angle: number;
|
|
7
7
|
text: string;
|
|
8
8
|
fontSize: number;
|
|
9
9
|
lineHeight: number;
|
|
10
|
-
|
|
10
|
+
styles: MiddlewareInfoStyles;
|
|
11
11
|
}): void;
|
|
12
12
|
export declare function drawPositionInfoText(ctx: ViewContext2D, opts: {
|
|
13
|
-
point:
|
|
14
|
-
rotateCenter:
|
|
13
|
+
point: Point;
|
|
14
|
+
rotateCenter: Point;
|
|
15
15
|
angle: number;
|
|
16
16
|
text: string;
|
|
17
17
|
fontSize: number;
|
|
18
18
|
lineHeight: number;
|
|
19
|
-
|
|
19
|
+
styles: MiddlewareInfoStyles;
|
|
20
20
|
}): void;
|
|
21
21
|
export declare function drawAngleInfoText(ctx: ViewContext2D, opts: {
|
|
22
|
-
point:
|
|
23
|
-
rotateCenter:
|
|
22
|
+
point: Point;
|
|
23
|
+
rotateCenter: Point;
|
|
24
24
|
angle: number;
|
|
25
25
|
text: string;
|
|
26
26
|
fontSize: number;
|
|
27
27
|
lineHeight: number;
|
|
28
|
-
|
|
28
|
+
styles: MiddlewareInfoStyles;
|
|
29
29
|
}): void;
|
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { rotateByCenter } from '@idraw/util';
|
|
2
2
|
const fontFamily = 'monospace';
|
|
3
3
|
export function drawSizeInfoText(ctx, opts) {
|
|
4
|
-
const { point, rotateCenter, angle, text,
|
|
5
|
-
const { textColor, textBackground } =
|
|
4
|
+
const { point, rotateCenter, angle, text, styles, fontSize, lineHeight } = opts;
|
|
5
|
+
const { textColor, textBackground } = styles;
|
|
6
6
|
rotateByCenter(ctx, angle, rotateCenter, () => {
|
|
7
7
|
ctx.$setFont({
|
|
8
8
|
fontWeight: '300',
|
|
9
9
|
fontSize,
|
|
10
|
-
fontFamily
|
|
10
|
+
fontFamily,
|
|
11
11
|
});
|
|
12
12
|
const padding = (lineHeight - fontSize) / 2;
|
|
13
13
|
const textWidth = ctx.$undoPixelRatio(ctx.measureText(text).width);
|
|
14
14
|
const bgStart = {
|
|
15
15
|
x: point.x - textWidth / 2 - padding,
|
|
16
|
-
y: point.y
|
|
16
|
+
y: point.y,
|
|
17
17
|
};
|
|
18
18
|
const bgEnd = {
|
|
19
19
|
x: bgStart.x + textWidth + padding * 2,
|
|
20
|
-
y: bgStart.y + fontSize + padding
|
|
20
|
+
y: bgStart.y + fontSize + padding,
|
|
21
21
|
};
|
|
22
22
|
const textStart = {
|
|
23
23
|
x: point.x - textWidth / 2,
|
|
24
|
-
y: point.y
|
|
24
|
+
y: point.y,
|
|
25
25
|
};
|
|
26
26
|
ctx.setLineDash([]);
|
|
27
27
|
ctx.fillStyle = textBackground;
|
|
@@ -38,27 +38,27 @@ export function drawSizeInfoText(ctx, opts) {
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
export function drawPositionInfoText(ctx, opts) {
|
|
41
|
-
const { point, rotateCenter, angle, text,
|
|
42
|
-
const { textBackground, textColor } =
|
|
41
|
+
const { point, rotateCenter, angle, text, styles, fontSize, lineHeight } = opts;
|
|
42
|
+
const { textBackground, textColor } = styles;
|
|
43
43
|
rotateByCenter(ctx, angle, rotateCenter, () => {
|
|
44
44
|
ctx.$setFont({
|
|
45
45
|
fontWeight: '300',
|
|
46
46
|
fontSize,
|
|
47
|
-
fontFamily
|
|
47
|
+
fontFamily,
|
|
48
48
|
});
|
|
49
49
|
const padding = (lineHeight - fontSize) / 2;
|
|
50
50
|
const textWidth = ctx.$undoPixelRatio(ctx.measureText(text).width);
|
|
51
51
|
const bgStart = {
|
|
52
52
|
x: point.x,
|
|
53
|
-
y: point.y
|
|
53
|
+
y: point.y,
|
|
54
54
|
};
|
|
55
55
|
const bgEnd = {
|
|
56
56
|
x: bgStart.x + textWidth + padding * 2,
|
|
57
|
-
y: bgStart.y + fontSize + padding
|
|
57
|
+
y: bgStart.y + fontSize + padding,
|
|
58
58
|
};
|
|
59
59
|
const textStart = {
|
|
60
60
|
x: point.x + padding,
|
|
61
|
-
y: point.y
|
|
61
|
+
y: point.y,
|
|
62
62
|
};
|
|
63
63
|
ctx.setLineDash([]);
|
|
64
64
|
ctx.fillStyle = textBackground;
|
|
@@ -75,27 +75,27 @@ export function drawPositionInfoText(ctx, opts) {
|
|
|
75
75
|
});
|
|
76
76
|
}
|
|
77
77
|
export function drawAngleInfoText(ctx, opts) {
|
|
78
|
-
const { point, rotateCenter, angle, text,
|
|
79
|
-
const { textBackground, textColor } =
|
|
78
|
+
const { point, rotateCenter, angle, text, styles, fontSize, lineHeight } = opts;
|
|
79
|
+
const { textBackground, textColor } = styles;
|
|
80
80
|
rotateByCenter(ctx, angle, rotateCenter, () => {
|
|
81
81
|
ctx.$setFont({
|
|
82
82
|
fontWeight: '300',
|
|
83
83
|
fontSize,
|
|
84
|
-
fontFamily
|
|
84
|
+
fontFamily,
|
|
85
85
|
});
|
|
86
86
|
const padding = (lineHeight - fontSize) / 2;
|
|
87
87
|
const textWidth = ctx.$undoPixelRatio(ctx.measureText(text).width);
|
|
88
88
|
const bgStart = {
|
|
89
89
|
x: point.x,
|
|
90
|
-
y: point.y
|
|
90
|
+
y: point.y,
|
|
91
91
|
};
|
|
92
92
|
const bgEnd = {
|
|
93
93
|
x: bgStart.x + textWidth + padding * 2,
|
|
94
|
-
y: bgStart.y + fontSize + padding
|
|
94
|
+
y: bgStart.y + fontSize + padding,
|
|
95
95
|
};
|
|
96
96
|
const textStart = {
|
|
97
97
|
x: point.x + padding,
|
|
98
|
-
y: point.y
|
|
98
|
+
y: point.y,
|
|
99
99
|
};
|
|
100
100
|
ctx.setLineDash([]);
|
|
101
101
|
ctx.fillStyle = textBackground;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Middleware, MiddlewareInfoConfig, CoreEventMap } from '@idraw/types';
|
|
2
2
|
import type { DeepInfoSharedStorage } from './types';
|
|
3
|
-
import { MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE } from './
|
|
3
|
+
import { MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE, getMiddlewareInfoStyles } from './static';
|
|
4
4
|
export { MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE };
|
|
5
|
+
export { getMiddlewareInfoStyles };
|
|
5
6
|
export declare const MiddlewareInfo: Middleware<DeepInfoSharedStorage, CoreEventMap & {
|
|
6
7
|
[MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE]: {
|
|
7
8
|
show: boolean;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { formatNumber, getViewScaleInfoFromSnapshot, getViewSizeInfoFromSnapshot, createUUID, limitAngle, rotatePoint, parseAngleToRadian } from '@idraw/util';
|
|
2
|
-
import {
|
|
1
|
+
import { formatNumber, getViewScaleInfoFromSnapshot, getViewSizeInfoFromSnapshot, createUUID, limitAngle, rotatePoint, parseAngleToRadian, } from '@idraw/util';
|
|
2
|
+
import { keySelectedMaterialList, keyActionType, keyGroupQueue } from '../selector';
|
|
3
3
|
import { drawSizeInfoText, drawPositionInfoText, drawAngleInfoText } from './draw-info';
|
|
4
|
-
import { defaltStyle, MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE } from './
|
|
4
|
+
import { defaltStyle, MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE, getMiddlewareInfoStyles } from './static';
|
|
5
5
|
export { MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE };
|
|
6
6
|
const infoFontSize = 10;
|
|
7
7
|
const infoLineHeight = 16;
|
|
8
|
+
export { getMiddlewareInfoStyles };
|
|
8
9
|
export const MiddlewareInfo = (opts, config) => {
|
|
9
10
|
const { boardContent, calculator, eventHub } = opts;
|
|
10
11
|
const { overlayContext } = boardContent;
|
|
11
12
|
let innerConfig = Object.assign(Object.assign({}, defaltStyle), config);
|
|
13
|
+
const styles = getMiddlewareInfoStyles(innerConfig);
|
|
12
14
|
let showAngleInfo = true;
|
|
13
15
|
const showInfoAngleCallback = ({ show }) => {
|
|
14
16
|
showAngleInfo = show;
|
|
@@ -26,106 +28,101 @@ export const MiddlewareInfo = (opts, config) => {
|
|
|
26
28
|
},
|
|
27
29
|
beforeDrawFrame({ snapshot }) {
|
|
28
30
|
var _a;
|
|
29
|
-
const { textBackground, textColor } = innerConfig;
|
|
30
|
-
const style = {
|
|
31
|
-
textBackground,
|
|
32
|
-
textColor
|
|
33
|
-
};
|
|
34
31
|
const { sharedStore } = snapshot;
|
|
35
|
-
const
|
|
32
|
+
const selectedMaterialList = sharedStore[keySelectedMaterialList];
|
|
36
33
|
const actionType = sharedStore[keyActionType];
|
|
37
34
|
const groupQueue = sharedStore[keyGroupQueue] || [];
|
|
38
|
-
if (
|
|
39
|
-
const
|
|
40
|
-
if (
|
|
35
|
+
if ((selectedMaterialList === null || selectedMaterialList === void 0 ? void 0 : selectedMaterialList.length) === 1) {
|
|
36
|
+
const mtrl = selectedMaterialList[0];
|
|
37
|
+
if (mtrl && ['select', 'drag', 'resize'].includes(actionType)) {
|
|
41
38
|
const viewScaleInfo = getViewScaleInfoFromSnapshot(snapshot);
|
|
42
39
|
const viewSizeInfo = getViewSizeInfoFromSnapshot(snapshot);
|
|
43
|
-
const { x, y,
|
|
40
|
+
const { x, y, width, height, angle } = mtrl;
|
|
44
41
|
const totalGroupQueue = [
|
|
45
42
|
...groupQueue,
|
|
46
43
|
...[
|
|
47
44
|
{
|
|
48
|
-
|
|
45
|
+
id: createUUID(),
|
|
49
46
|
x,
|
|
50
47
|
y,
|
|
51
|
-
|
|
52
|
-
|
|
48
|
+
width,
|
|
49
|
+
height,
|
|
53
50
|
angle,
|
|
54
51
|
type: 'group',
|
|
55
|
-
|
|
56
|
-
}
|
|
57
|
-
]
|
|
52
|
+
children: [],
|
|
53
|
+
},
|
|
54
|
+
],
|
|
58
55
|
];
|
|
59
56
|
const calcOpts = { viewScaleInfo, viewSizeInfo };
|
|
60
|
-
const
|
|
57
|
+
const rangeBoundingInfo = calculator.calcViewBoundingInfoFromOrigin(mtrl.id, calcOpts);
|
|
61
58
|
let totalAngle = 0;
|
|
62
59
|
totalGroupQueue.forEach((group) => {
|
|
63
60
|
totalAngle += group.angle || 0;
|
|
64
61
|
});
|
|
65
62
|
const totalRadian = parseAngleToRadian(limitAngle(0 - totalAngle));
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
topLeft: rotatePoint(
|
|
70
|
-
topRight: rotatePoint(
|
|
71
|
-
bottomRight: rotatePoint(
|
|
72
|
-
bottomLeft: rotatePoint(
|
|
73
|
-
center: rotatePoint(
|
|
74
|
-
top: rotatePoint(
|
|
75
|
-
right: rotatePoint(
|
|
76
|
-
bottom: rotatePoint(
|
|
77
|
-
left: rotatePoint(
|
|
63
|
+
if (rangeBoundingInfo) {
|
|
64
|
+
const mtrlCenter = rangeBoundingInfo === null || rangeBoundingInfo === void 0 ? void 0 : rangeBoundingInfo.center;
|
|
65
|
+
const boundingBox = {
|
|
66
|
+
topLeft: rotatePoint(mtrlCenter, rangeBoundingInfo.topLeft, totalRadian),
|
|
67
|
+
topRight: rotatePoint(mtrlCenter, rangeBoundingInfo.topRight, totalRadian),
|
|
68
|
+
bottomRight: rotatePoint(mtrlCenter, rangeBoundingInfo.bottomRight, totalRadian),
|
|
69
|
+
bottomLeft: rotatePoint(mtrlCenter, rangeBoundingInfo.bottomLeft, totalRadian),
|
|
70
|
+
center: rotatePoint(mtrlCenter, rangeBoundingInfo.center, totalRadian),
|
|
71
|
+
top: rotatePoint(mtrlCenter, rangeBoundingInfo.top, totalRadian),
|
|
72
|
+
right: rotatePoint(mtrlCenter, rangeBoundingInfo.right, totalRadian),
|
|
73
|
+
bottom: rotatePoint(mtrlCenter, rangeBoundingInfo.bottom, totalRadian),
|
|
74
|
+
left: rotatePoint(mtrlCenter, rangeBoundingInfo.left, totalRadian),
|
|
78
75
|
};
|
|
79
|
-
const x = formatNumber(
|
|
80
|
-
const y = formatNumber(
|
|
81
|
-
const w = formatNumber(
|
|
82
|
-
const h = formatNumber(
|
|
76
|
+
const x = formatNumber(mtrl.x, { decimalPlaces: 2 });
|
|
77
|
+
const y = formatNumber(mtrl.y, { decimalPlaces: 2 });
|
|
78
|
+
const w = formatNumber(mtrl.width, { decimalPlaces: 2 });
|
|
79
|
+
const h = formatNumber(mtrl.height, { decimalPlaces: 2 });
|
|
83
80
|
const xyText = `${formatNumber(x, { decimalPlaces: 0 })},${formatNumber(y, { decimalPlaces: 0 })}`;
|
|
84
81
|
const whText = `${formatNumber(w, { decimalPlaces: 0 })}x${formatNumber(h, { decimalPlaces: 0 })}`;
|
|
85
|
-
const angleText = `${formatNumber(
|
|
82
|
+
const angleText = `${formatNumber(limitAngle(mtrl.angle || 0), { decimalPlaces: 0 })}°`;
|
|
86
83
|
drawSizeInfoText(overlayContext, {
|
|
87
84
|
point: {
|
|
88
|
-
x:
|
|
89
|
-
y:
|
|
85
|
+
x: boundingBox.bottom.x,
|
|
86
|
+
y: boundingBox.bottom.y + infoFontSize,
|
|
90
87
|
},
|
|
91
|
-
rotateCenter:
|
|
88
|
+
rotateCenter: boundingBox.center,
|
|
92
89
|
angle: totalAngle,
|
|
93
90
|
text: whText,
|
|
94
91
|
fontSize: infoFontSize,
|
|
95
92
|
lineHeight: infoLineHeight,
|
|
96
|
-
|
|
93
|
+
styles,
|
|
97
94
|
});
|
|
98
95
|
drawPositionInfoText(overlayContext, {
|
|
99
96
|
point: {
|
|
100
|
-
x:
|
|
101
|
-
y:
|
|
97
|
+
x: boundingBox.topLeft.x,
|
|
98
|
+
y: boundingBox.topLeft.y - infoFontSize * 2,
|
|
102
99
|
},
|
|
103
|
-
rotateCenter:
|
|
100
|
+
rotateCenter: boundingBox.center,
|
|
104
101
|
angle: totalAngle,
|
|
105
102
|
text: xyText,
|
|
106
103
|
fontSize: infoFontSize,
|
|
107
104
|
lineHeight: infoLineHeight,
|
|
108
|
-
|
|
105
|
+
styles,
|
|
109
106
|
});
|
|
110
107
|
if (showAngleInfo) {
|
|
111
|
-
if (((_a =
|
|
108
|
+
if (((_a = mtrl.operations) === null || _a === void 0 ? void 0 : _a.rotatable) !== false) {
|
|
112
109
|
drawAngleInfoText(overlayContext, {
|
|
113
110
|
point: {
|
|
114
|
-
x:
|
|
115
|
-
y:
|
|
111
|
+
x: boundingBox.top.x + infoFontSize + 4,
|
|
112
|
+
y: boundingBox.top.y - infoFontSize * 2 - 18,
|
|
116
113
|
},
|
|
117
|
-
rotateCenter:
|
|
114
|
+
rotateCenter: boundingBox.center,
|
|
118
115
|
angle: totalAngle,
|
|
119
116
|
text: angleText,
|
|
120
117
|
fontSize: infoFontSize,
|
|
121
118
|
lineHeight: infoLineHeight,
|
|
122
|
-
|
|
119
|
+
styles,
|
|
123
120
|
});
|
|
124
121
|
}
|
|
125
122
|
}
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
125
|
}
|
|
129
|
-
}
|
|
126
|
+
},
|
|
130
127
|
};
|
|
131
128
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { MiddlewareInfoStyles, MiddlewareInfoConfig } from '@idraw/types';
|
|
2
|
+
export declare const infoFontSize = 10;
|
|
3
|
+
export declare const infoLineHeight = 16;
|
|
4
|
+
export declare const MIDDLEWARE_INTERNAL_EVENT_SHOW_INFO_ANGLE = "@middleware/internal-event/show-info-angle";
|
|
5
|
+
export declare const defaltStyle: MiddlewareInfoStyles;
|
|
6
|
+
export declare function getMiddlewareInfoStyles<C = MiddlewareInfoConfig, S = MiddlewareInfoStyles>(config: C): S;
|