@leafer-ui/interface 1.0.4 → 1.0.5
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/package.json +5 -5
- package/src/ICommonAttr.ts +3 -0
- package/src/IUI.ts +8 -6
- package/src/editor/IEditor.ts +2 -1
- package/types/index.d.ts +14 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leafer-ui/interface",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.5",
|
|
4
4
|
"description": "@leafer-ui/interface",
|
|
5
5
|
"author": "Chao (Leafer) Wan",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,15 +13,15 @@
|
|
|
13
13
|
],
|
|
14
14
|
"repository": {
|
|
15
15
|
"type": "git",
|
|
16
|
-
"url": "https://github.com/leaferjs/ui.git"
|
|
16
|
+
"url": "https://github.com/leaferjs/leafer-ui.git"
|
|
17
17
|
},
|
|
18
|
-
"homepage": "https://github.com/leaferjs/ui/tree/main/packages/interface",
|
|
19
|
-
"bugs": "https://github.com/leaferjs/ui/issues",
|
|
18
|
+
"homepage": "https://github.com/leaferjs/leafer-ui/tree/main/packages/interface",
|
|
19
|
+
"bugs": "https://github.com/leaferjs/leafer-ui/issues",
|
|
20
20
|
"keywords": [
|
|
21
21
|
"leafer-ui",
|
|
22
22
|
"leaferjs"
|
|
23
23
|
],
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@leafer/interface": "1.0.
|
|
25
|
+
"@leafer/interface": "1.0.5"
|
|
26
26
|
}
|
|
27
27
|
}
|
package/src/ICommonAttr.ts
CHANGED
|
@@ -99,6 +99,7 @@ export interface ITextStyleAttrData {
|
|
|
99
99
|
|
|
100
100
|
textAlign?: ITextAlign
|
|
101
101
|
verticalAlign?: IVerticalAlign
|
|
102
|
+
autoSizeAlign?: IBoolean
|
|
102
103
|
|
|
103
104
|
textWrap?: ITextWrap
|
|
104
105
|
textOverflow?: IOverflow | string
|
|
@@ -118,6 +119,7 @@ export interface ITextStyleInputData {
|
|
|
118
119
|
|
|
119
120
|
textAlign?: ITextAlign
|
|
120
121
|
verticalAlign?: IVerticalAlign
|
|
122
|
+
autoSizeAlign?: IBoolean
|
|
121
123
|
|
|
122
124
|
textWrap?: ITextWrap
|
|
123
125
|
textOverflow?: IOverflow | string
|
|
@@ -137,6 +139,7 @@ export interface ITextStyleComputedData {
|
|
|
137
139
|
|
|
138
140
|
textAlign?: ITextAlign
|
|
139
141
|
verticalAlign?: IVerticalAlign
|
|
142
|
+
autoSizeAlign?: boolean // 自动宽高的文本,是否仍进行整体对齐操作
|
|
140
143
|
|
|
141
144
|
textWrap?: ITextWrap
|
|
142
145
|
textOverflow?: IOverflow | string
|
package/src/IUI.ts
CHANGED
|
@@ -262,6 +262,7 @@ export interface ITextDrawData {
|
|
|
262
262
|
rows: ITextRowData[]
|
|
263
263
|
paraNumber: number
|
|
264
264
|
font: string
|
|
265
|
+
maxWidth?: number // 获取最大的行宽,自动宽度 且非 autoSizeAlign 时才有值
|
|
265
266
|
decorationY?: number
|
|
266
267
|
decorationHeight?: number
|
|
267
268
|
overflow?: number // overflowed row number, not index
|
|
@@ -334,6 +335,7 @@ export interface IBox extends IBoxAttrData, IGroup {
|
|
|
334
335
|
interface IBoxAttrData {
|
|
335
336
|
overflow?: IOverflow
|
|
336
337
|
resizeChildren?: IBoolean
|
|
338
|
+
textBox?: IBoolean // 编辑器中,textBox双击会直接进入编辑文本状态,如便利贴文本
|
|
337
339
|
}
|
|
338
340
|
export interface IBoxData extends IBoxAttrData, IGroupData { }
|
|
339
341
|
export interface IBoxInputData extends IBoxAttrData, IGroupInputData { }
|
|
@@ -344,12 +346,12 @@ export interface IGroup extends IUI {
|
|
|
344
346
|
__: IGroupData
|
|
345
347
|
children: IUI[]
|
|
346
348
|
pick(hitPoint: IPointData, options?: IPickOptions): IPickResult
|
|
347
|
-
add(child: IUI, index?: number): void
|
|
348
|
-
addAt(child: IUI, index: number): void
|
|
349
|
-
addAfter(child: IUI, after: IUI): void
|
|
350
|
-
addBefore(child: IUI, before: IUI): void
|
|
351
|
-
addMany(...children: ILeaf[]): void
|
|
352
|
-
remove(child?: IUI): void
|
|
349
|
+
add(child: IUI | IUIInputData, index?: number): void
|
|
350
|
+
addAt(child: IUI | IUIInputData, index: number): void
|
|
351
|
+
addAfter(child: IUI | IUIInputData, after: IUI): void
|
|
352
|
+
addBefore(child: IUI | IUIInputData, before: IUI): void
|
|
353
|
+
addMany(...children: ILeaf[] | IUIInputData[]): void
|
|
354
|
+
remove(child?: IUI | number | string | IFindCondition | IFindUIMethod): void
|
|
353
355
|
removeAll(): void
|
|
354
356
|
clear(): void
|
|
355
357
|
}
|
package/src/editor/IEditor.ts
CHANGED
|
@@ -20,6 +20,7 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
20
20
|
readonly single: boolean
|
|
21
21
|
|
|
22
22
|
readonly dragging: boolean
|
|
23
|
+
readonly moving: boolean
|
|
23
24
|
|
|
24
25
|
element?: IUI
|
|
25
26
|
buttons: IGroup
|
|
@@ -53,7 +54,7 @@ export interface IEditorBase extends IGroup, ISelectorProxy {
|
|
|
53
54
|
openGroup(group: IGroup): void
|
|
54
55
|
closeGroup(group: IGroup): void
|
|
55
56
|
|
|
56
|
-
openInnerEditor(target?: IUI): void
|
|
57
|
+
openInnerEditor(target?: IUI, select?: boolean): void
|
|
57
58
|
closeInnerEditor(): void
|
|
58
59
|
|
|
59
60
|
lock(): void
|
package/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, ISizeData, IPathCommandData, IWindingRule, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IObject, IEventer, IEventMap, IPercentData, IBoundsData as IBoundsData$1, IPathCreator, ILeaferCanvas, ICanvasContext2D, ICanvasContext2DSettings, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IJSONOptions, IValue,
|
|
1
|
+
import { IBlendMode, IAlign, IUnitPointData, IExportFileType, IFourNumber, IPointData, ISizeData, IPathCommandData, IWindingRule, IMatrixData, ILeaferImage, ITaskItem, IBoolean, INumber, IString, IUnitData, IObject, IEventer, IEventMap, IPercentData, IBoundsData as IBoundsData$1, IPathCreator, ILeaferCanvas, ICanvasContext2D, ICanvasContext2DSettings, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IFindCondition, IJSONOptions, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, ICachedLeaf, IBooleanMap, IAround } from '@leafer/interface';
|
|
2
2
|
export * from '@leafer/interface';
|
|
3
3
|
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject as IObject$1, ILeaf, IEditSize, IDragEvent, IZoomEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, IColorString as IColorString$1, IDirection4, ICursorType, IImageCursor, IAlign as IAlign$1, IUnitPointData as IUnitPointData$1, IUIInputData as IUIInputData$1, IBox as IBox$1, IRect as IRect$1, IBoundsData, IKeyEvent, IStateName as IStateName$1, IString as IString$1, IBoolean as IBoolean$1, IStateStyle as IStateStyle$1 } from '@leafer-ui/interface';
|
|
4
4
|
|
|
@@ -246,6 +246,7 @@ interface ITextStyleAttrData {
|
|
|
246
246
|
paraSpacing?: INumber;
|
|
247
247
|
textAlign?: ITextAlign;
|
|
248
248
|
verticalAlign?: IVerticalAlign;
|
|
249
|
+
autoSizeAlign?: IBoolean;
|
|
249
250
|
textWrap?: ITextWrap;
|
|
250
251
|
textOverflow?: IOverflow | string;
|
|
251
252
|
}
|
|
@@ -262,6 +263,7 @@ interface ITextStyleInputData {
|
|
|
262
263
|
paraSpacing?: INumber;
|
|
263
264
|
textAlign?: ITextAlign;
|
|
264
265
|
verticalAlign?: IVerticalAlign;
|
|
266
|
+
autoSizeAlign?: IBoolean;
|
|
265
267
|
textWrap?: ITextWrap;
|
|
266
268
|
textOverflow?: IOverflow | string;
|
|
267
269
|
}
|
|
@@ -278,6 +280,7 @@ interface ITextStyleComputedData {
|
|
|
278
280
|
paraSpacing?: number;
|
|
279
281
|
textAlign?: ITextAlign;
|
|
280
282
|
verticalAlign?: IVerticalAlign;
|
|
283
|
+
autoSizeAlign?: boolean;
|
|
281
284
|
textWrap?: ITextWrap;
|
|
282
285
|
textOverflow?: IOverflow | string;
|
|
283
286
|
}
|
|
@@ -417,6 +420,7 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
417
420
|
readonly multiple: boolean;
|
|
418
421
|
readonly single: boolean;
|
|
419
422
|
readonly dragging: boolean;
|
|
423
|
+
readonly moving: boolean;
|
|
420
424
|
element?: IUI$1;
|
|
421
425
|
buttons: IGroup$1;
|
|
422
426
|
selector: IGroup$1;
|
|
@@ -441,7 +445,7 @@ interface IEditorBase extends IGroup$1, ISelectorProxy {
|
|
|
441
445
|
ungroup(): IUI$1[];
|
|
442
446
|
openGroup(group: IGroup$1): void;
|
|
443
447
|
closeGroup(group: IGroup$1): void;
|
|
444
|
-
openInnerEditor(target?: IUI$1): void;
|
|
448
|
+
openInnerEditor(target?: IUI$1, select?: boolean): void;
|
|
445
449
|
closeInnerEditor(): void;
|
|
446
450
|
lock(): void;
|
|
447
451
|
unlock(): void;
|
|
@@ -737,6 +741,7 @@ interface ITextDrawData {
|
|
|
737
741
|
rows: ITextRowData[];
|
|
738
742
|
paraNumber: number;
|
|
739
743
|
font: string;
|
|
744
|
+
maxWidth?: number;
|
|
740
745
|
decorationY?: number;
|
|
741
746
|
decorationHeight?: number;
|
|
742
747
|
overflow?: number;
|
|
@@ -792,6 +797,7 @@ interface IBox extends IBoxAttrData, IGroup {
|
|
|
792
797
|
interface IBoxAttrData {
|
|
793
798
|
overflow?: IOverflow;
|
|
794
799
|
resizeChildren?: IBoolean;
|
|
800
|
+
textBox?: IBoolean;
|
|
795
801
|
}
|
|
796
802
|
interface IBoxData extends IBoxAttrData, IGroupData {
|
|
797
803
|
}
|
|
@@ -801,12 +807,12 @@ interface IGroup extends IUI {
|
|
|
801
807
|
__: IGroupData;
|
|
802
808
|
children: IUI[];
|
|
803
809
|
pick(hitPoint: IPointData, options?: IPickOptions): IPickResult;
|
|
804
|
-
add(child: IUI, index?: number): void;
|
|
805
|
-
addAt(child: IUI, index: number): void;
|
|
806
|
-
addAfter(child: IUI, after: IUI): void;
|
|
807
|
-
addBefore(child: IUI, before: IUI): void;
|
|
808
|
-
addMany(...children: ILeaf$1[]): void;
|
|
809
|
-
remove(child?: IUI): void;
|
|
810
|
+
add(child: IUI | IUIInputData, index?: number): void;
|
|
811
|
+
addAt(child: IUI | IUIInputData, index: number): void;
|
|
812
|
+
addAfter(child: IUI | IUIInputData, after: IUI): void;
|
|
813
|
+
addBefore(child: IUI | IUIInputData, before: IUI): void;
|
|
814
|
+
addMany(...children: ILeaf$1[] | IUIInputData[]): void;
|
|
815
|
+
remove(child?: IUI | number | string | IFindCondition | IFindUIMethod): void;
|
|
810
816
|
removeAll(): void;
|
|
811
817
|
clear(): void;
|
|
812
818
|
}
|