You're Invited:Meet the Socket Team at RSAC and BSidesSF 2026, March 23–26.RSVP
Socket
Book a DemoSign in
Socket

@leafer-ui/interface

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@leafer-ui/interface - npm Package Compare versions

Comparing version
1.0.0-rc.21
to
1.0.0-rc.22
+2
-2
package.json
{
"name": "@leafer-ui/interface",
"version": "1.0.0-rc.21",
"version": "1.0.0-rc.22",
"description": "@leafer-ui/interface",

@@ -25,4 +25,4 @@ "author": "Chao (Leafer) Wan",

"dependencies": {
"@leafer/interface": "1.0.0-rc.21"
"@leafer/interface": "1.0.0-rc.22"
}
}

@@ -1,5 +0,6 @@

import { IGroup, IUI, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAround, IDragEvent, IRotateEvent, IStroke, IFill, ILeaf, IObject, IBoxInputData, IGroupInputData, IImageCursor } from '@leafer-ui/interface'
import { IGroup, IUI, IBox, IRectInputData, ISelectorProxy, IEditSize, ICursorType, IAround, IDragEvent, IRotateEvent, IStroke, IFill, ILeaf, ILeafList, IObject, IBoxInputData, IGroupInputData, IImageCursor, IRect, IBoundsData, IKeyEvent, IUIInputData } from '@leafer-ui/interface'
export interface IEditorBase extends IGroup, ISelectorProxy {
config: IEditorConfig
mergeConfig: IEditorConfig // 实际使用,合并了选中元素上的editConfig

@@ -10,4 +11,9 @@ hoverTarget: IUI

readonly list: IUI[]
leafList: ILeafList
openedGroupList: ILeafList
readonly hasTarget: boolean
readonly editing: boolean
innerEditing: boolean
readonly groupOpening: boolean
readonly multiple: boolean

@@ -22,4 +28,5 @@ readonly single: boolean

selector: IGroup
editBox: IGroup
editBox: IEditBoxBase
editTool: IObject
innerEditor: IObject

@@ -43,3 +50,8 @@ hasItem(item: IUI): boolean

ungroup(): IUI[]
openGroup(group: IGroup): void
closeGroup(group: IGroup): void
openInnerEditor(): void
closeInnerEditor(): void
lock(): void

@@ -90,5 +102,7 @@ unlock(): void

hover?: boolean
hoverStyle?: IUIInputData
select?: 'press' | 'tap'
boxSelect?: boolean
continuousSelect?: boolean // 点击可以连续选择
openInner?: 'double' | 'long' // 双击/长按打开内部

@@ -99,2 +113,52 @@ moveable?: boolean

skewable?: boolean
}
}
export interface IEditPoint extends IBox {
direction: number
pointType: IEditPointType
}
export type IEditPointType = 'rotate' | 'resize'
export interface IEditBoxBase extends IGroup {
editor: IEditorBase
dragging: boolean
moving: boolean
view: IGroup // 放置默认编辑工具控制点
circle: IEditPoint
rect: IRect
buttons: IGroup
resizePoints: IEditPoint[]
rotatePoints: IEditPoint[]
resizeLines: IEditPoint[]
readonly flipped: boolean
readonly flippedX: boolean
readonly flippedY: boolean
readonly flippedOne: boolean
enterPoint: IEditPoint
getPointStyle(userStyle?: IBoxInputData): IBoxInputData
getPointsStyle(): IBoxInputData[]
getMiddlePointsStyle(): IBoxInputData[]
load(): void
update(bounds: IBoundsData): void
unload(): void
onArrow(e: IKeyEvent): void
}
export interface IEditorConfigFunction {
(ui: any): IEditorConfig
}
export interface IEditToolFunction {
(ui: any): string
}

@@ -1,2 +0,2 @@

import { INumber, IBoolean, IString } from '@leafer/interface'
import { INumber, IBoolean, IString, IFourNumber } from '@leafer/interface'
import { IStrokeAlign, IStrokeCap, IStrokeJoin, IBlurEffect, IFontWeight, ITextCase, ITextDecoration, IShadowEffect, IGrayscaleEffect, ITextAlign, IVerticalAlign, IOverflow, IUnitData, ITextWrap, IStroke, IFill, IArrowType } from './type/IType'

@@ -9,7 +9,7 @@ import { ILeafStrokePaint, ILeafShadowEffect, ILeafPaint } from './type/IComputedType'

export interface ICornerRadiusAttrData {
cornerRadius: INumber | INumber[] | ICornerRadiusString
cornerRadius: IFourNumber | ICornerRadiusString
cornerSmoothing: INumber
}
export interface ICornerRadiusInputData {
cornerRadius?: INumber | INumber[] | ICornerRadiusString
cornerRadius?: IFourNumber | ICornerRadiusString
cornerSmoothing?: INumber

@@ -44,3 +44,3 @@ }

strokeAlign: IStrokeAlign
strokeWidth: INumber | INumber[] | IStrokeWidthString
strokeWidth: IFourNumber | IStrokeWidthString
strokeWidthFixed: IBoolean

@@ -60,3 +60,3 @@ strokeCap: IStrokeCap

strokeAlign?: IStrokeAlign
strokeWidth?: INumber | INumber[] | IStrokeWidthString
strokeWidth?: IFourNumber | IStrokeWidthString
strokeWidthFixed?: IBoolean

@@ -63,0 +63,0 @@ strokeCap?: IStrokeCap

@@ -44,2 +44,2 @@ export * from '@leafer/interface'

export { IEditorBase, IEditorConfig } from './editor/IEditor'
export { IEditorBase, IEditorConfig, IEditBoxBase, IEditPoint, IEditPointType, IEditToolFunction, IEditorConfigFunction } from './editor/IEditor'

@@ -1,2 +0,2 @@

import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, ILeaferImageConfig, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings } from '@leafer/interface'
import { ILeaf, ILeafComputedData, ILeafData, ILeafInputData, ILeaferCanvas, IRenderOptions, IExportOptions, IExportResult, IPathDrawer, IPointData, IPathCommandData, ILeaferImageConfig, IBoundsData, IObject, IPathString, ILeaferImage, IPathCreator, IAnswer, IPickOptions, IPickResult, IValue, ICanvasContext2DSettings, IFourNumber } from '@leafer/interface'

@@ -125,5 +125,7 @@ import {

text: string
padding: IFourNumber
}
interface ITextAttrData {
text?: string
padding?: IFourNumber
}

@@ -297,3 +299,5 @@

editorStyle: IEditorConfig
editConfig: IEditorConfig
editOuter: string
editInner: string

@@ -339,4 +343,2 @@ children?: IUI[]

editorStyle?: IEditorConfig
// 非数据属性, 自动计算的缓存数据

@@ -389,4 +391,2 @@ __isFills?: boolean

editorStyle?: IEditorConfig
children?: IUIInputData[]

@@ -393,0 +393,0 @@ }

@@ -1,2 +0,2 @@

import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage } from '@leafer/interface'
import { ILeaferCanvas, IRenderOptions, IBooleanMap, IBoundsData, ILeaferImage, IAround } from '@leafer/interface'

@@ -6,3 +6,3 @@ import { ILeafPaint, ILeafPaintPatternData } from '../type/IComputedType'

import { ICachedShape } from '../ICachedShape'
import { IGradientPaint, IImagePaint, IImagePaintMode, IPaintAttr } from '../type/IType'
import { IGradientPaint, IImagePaint, IPaintAttr } from '../type/IType'

@@ -34,5 +34,5 @@ export interface IPaintModule {

createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void
fillOrFitMode(data: ILeafPaintPatternData, mode: IImagePaintMode, box: IBoundsData, width: number, height: number, rotation: number): void
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround): void
}

@@ -39,0 +39,0 @@

@@ -1,2 +0,2 @@

import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData, IFourNumber } from '@leafer/interface'
import { IPointData, IPathCommandData, IWindingRule, IBlendMode, IExportFileType, ISizeData, IFourNumber, IDirection } from '@leafer/interface'
import { IColorString, IPaintString } from './IStringType'

@@ -75,3 +75,6 @@

padding?: IFourNumber
around?: IDirection
offset?: IPointData
size?: number | ISizeData

@@ -92,3 +95,3 @@ scale?: number | IPointData

}
export type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat'
export type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'strench' | 'clip' | 'repeat'
export type IRepeat = boolean | 'x' | 'y'

@@ -95,0 +98,0 @@

@@ -1,4 +0,4 @@

import { IPointData, IExportFileType, IFourNumber, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData, ILeaferImageConfig, ICanvasContext2DSettings, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject as IObject$1, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, IStateStyleType, ICachedLeaf, IBooleanMap } from '@leafer/interface';
import { IPointData, IExportFileType, IFourNumber, IDirection, ISizeData, IPathCommandData, IWindingRule, IBlendMode, IMatrixData, ILeaferImage, ITaskItem, INumber, IBoolean, IString, IPathCreator, IBoundsData as IBoundsData$1, ILeaferImageConfig, ICanvasContext2DSettings, ILeaferCanvas, IRenderOptions, IPickOptions, IPickResult, ILeaf as ILeaf$1, IValue, IPathString, IPathDrawer, IExportOptions, IExportResult, IAnswer, ILeafData, ILeafComputedData, ILeafInputData, IObject as IObject$1, ILeaferAttrData, IControl, ILeaferConfig, ILeaferType, ILeafRender, ILeafBounds, ILeafHit, IStateStyleType, ICachedLeaf, IBooleanMap, IAround as IAround$1 } from '@leafer/interface';
export * from '@leafer/interface';
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, IObject, ILeaf, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor, IAround } from '@leafer-ui/interface';
import { IGroup as IGroup$1, ISelectorProxy, IUI as IUI$1, ILeafList, IObject, ILeaf, IEditSize, IDragEvent, IRotateEvent, IGroupInputData as IGroupInputData$1, IStroke as IStroke$1, IFill as IFill$1, IBoxInputData as IBoxInputData$1, IRectInputData as IRectInputData$1, ICursorType, IImageCursor, IAround, IUIInputData as IUIInputData$1, IBox as IBox$1, IRect as IRect$1, IBoundsData, IKeyEvent } from '@leafer-ui/interface';

@@ -64,2 +64,3 @@ type IPercent = string;

padding?: IFourNumber;
around?: IDirection;
offset?: IPointData;

@@ -80,3 +81,3 @@ size?: number | ISizeData;

}
type IImagePaintMode = 'cover' | 'fit' | 'strench' | 'clip' | 'repeat';
type IImagePaintMode = 'normal' | 'cover' | 'fit' | 'strench' | 'clip' | 'repeat';
type IRepeat = boolean | 'x' | 'y';

@@ -175,7 +176,7 @@ type IStrokeAlign = 'inside' | 'outside' | 'center';

interface ICornerRadiusAttrData {
cornerRadius: INumber | INumber[] | ICornerRadiusString;
cornerRadius: IFourNumber | ICornerRadiusString;
cornerSmoothing: INumber;
}
interface ICornerRadiusInputData {
cornerRadius?: INumber | INumber[] | ICornerRadiusString;
cornerRadius?: IFourNumber | ICornerRadiusString;
cornerSmoothing?: INumber;

@@ -203,3 +204,3 @@ }

strokeAlign: IStrokeAlign;
strokeWidth: INumber | INumber[] | IStrokeWidthString;
strokeWidth: IFourNumber | IStrokeWidthString;
strokeWidthFixed: IBoolean;

@@ -217,3 +218,3 @@ strokeCap: IStrokeCap;

strokeAlign?: IStrokeAlign;
strokeWidth?: INumber | INumber[] | IStrokeWidthString;
strokeWidth?: IFourNumber | IStrokeWidthString;
strokeWidthFixed?: IBoolean;

@@ -314,6 +315,11 @@ strokeCap?: IStrokeCap;

config: IEditorConfig;
mergeConfig: IEditorConfig;
hoverTarget: IUI$1;
target: IUI$1 | IUI$1[];
readonly list: IUI$1[];
readonly hasTarget: boolean;
leafList: ILeafList;
openedGroupList: ILeafList;
readonly editing: boolean;
innerEditing: boolean;
readonly groupOpening: boolean;
readonly multiple: boolean;

@@ -325,4 +331,5 @@ readonly single: boolean;

selector: IGroup$1;
editBox: IGroup$1;
editBox: IEditBoxBase;
editTool: IObject;
innerEditor: IObject;
hasItem(item: IUI$1): boolean;

@@ -341,2 +348,6 @@ shiftItem(item: IUI$1): void;

ungroup(): IUI$1[];
openGroup(group: IGroup$1): void;
closeGroup(group: IGroup$1): void;
openInnerEditor(): void;
closeInnerEditor(): void;
lock(): void;

@@ -376,5 +387,7 @@ unlock(): void;

hover?: boolean;
hoverStyle?: IUIInputData$1;
select?: 'press' | 'tap';
boxSelect?: boolean;
continuousSelect?: boolean;
openInner?: 'double' | 'long';
moveable?: boolean;

@@ -385,2 +398,37 @@ rotateable?: boolean;

}
interface IEditPoint extends IBox$1 {
direction: number;
pointType: IEditPointType;
}
type IEditPointType = 'rotate' | 'resize';
interface IEditBoxBase extends IGroup$1 {
editor: IEditorBase;
dragging: boolean;
moving: boolean;
view: IGroup$1;
circle: IEditPoint;
rect: IRect$1;
buttons: IGroup$1;
resizePoints: IEditPoint[];
rotatePoints: IEditPoint[];
resizeLines: IEditPoint[];
readonly flipped: boolean;
readonly flippedX: boolean;
readonly flippedY: boolean;
readonly flippedOne: boolean;
enterPoint: IEditPoint;
getPointStyle(userStyle?: IBoxInputData$1): IBoxInputData$1;
getPointsStyle(): IBoxInputData$1[];
getMiddlePointsStyle(): IBoxInputData$1[];
load(): void;
update(bounds: IBoundsData): void;
unload(): void;
onArrow(e: IKeyEvent): void;
}
interface IEditorConfigFunction {
(ui: any): IEditorConfig;
}
interface IEditToolFunction {
(ui: any): string;
}

@@ -482,5 +530,7 @@ interface ILine extends IUI {

text: string;
padding: IFourNumber;
}
interface ITextAttrData {
text?: string;
padding?: IFourNumber;
}

@@ -493,3 +543,3 @@ interface ITextData extends ITextAttrData, ITextStyleComputedData, IUIData {

__clipText?: boolean;
__textBoxBounds?: IBoundsData;
__textBoxBounds?: IBoundsData$1;
}

@@ -528,3 +578,3 @@ interface ITextInputData extends ITextAttrData, ITextStyleInputData, IUIBaseInputData {

interface ITextDrawData {
bounds: IBoundsData;
bounds: IBoundsData$1;
rows: ITextRowData[];

@@ -625,3 +675,5 @@ paraNumber: number;

disabledStyle: IUIInputData;
editorStyle: IEditorConfig;
editConfig: IEditorConfig;
editOuter: string;
editInner: string;
children?: IUI[];

@@ -654,3 +706,2 @@ reset(data?: IUIInputData): void;

disabledStyle?: IUIInputData;
editorStyle?: IEditorConfig;
__isFills?: boolean;

@@ -688,3 +739,2 @@ __isStrokes?: boolean;

disabledStyle?: IUIInputData;
editorStyle?: IEditorConfig;
children?: IUIInputData[];

@@ -778,3 +828,3 @@ }

worldCanvas?: ILeaferCanvas;
shapeBounds: IBoundsData;
shapeBounds: IBoundsData$1;
scaleX: number;

@@ -796,15 +846,15 @@ scaleY: number;

interface IPaintImageModule {
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData, firstUse: boolean): ILeafPaint;
image(ui: IUI, attrName: string, paint: IImagePaint, boxBounds: IBoundsData$1, firstUse: boolean): ILeafPaint;
checkImage(ui: IUI, canvas: ILeaferCanvas, paint: ILeafPaint, allowPaint?: boolean): boolean;
createPattern(ui: IUI, paint: ILeafPaint, pixelRatio: number): boolean;
recycleImage(attrName: IPaintAttr, data: IUIData): IBooleanMap;
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData): void;
fillOrFitMode(data: ILeafPaintPatternData, mode: IImagePaintMode, box: IBoundsData, width: number, height: number, rotation: number): void;
clipMode(data: ILeafPaintPatternData, box: IBoundsData, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
repeatMode(data: ILeafPaintPatternData, box: IBoundsData, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
createData(leafPaint: ILeafPaint, image: ILeaferImage, paint: IImagePaint, box: IBoundsData$1): void;
fillOrFitMode(data: ILeafPaintPatternData, box: IBoundsData$1, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
clipMode(data: ILeafPaintPatternData, box: IBoundsData$1, x: number, y: number, scaleX: number, scaleY: number, rotation: number): void;
repeatMode(data: ILeafPaintPatternData, box: IBoundsData$1, width: number, height: number, x: number, y: number, scaleX: number, scaleY: number, rotation: number, around: IAround$1): void;
}
interface IPaintGradientModule {
linearGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
radialGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
conicGradient(paint: IGradientPaint, box: IBoundsData): ILeafPaint;
linearGradient(paint: IGradientPaint, box: IBoundsData$1): ILeafPaint;
radialGradient(paint: IGradientPaint, box: IBoundsData$1): ILeafPaint;
conicGradient(paint: IGradientPaint, box: IBoundsData$1): ILeafPaint;
}

@@ -819,2 +869,2 @@

export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditorBase, IEditorConfig, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };
export type { IApp, IAppConfig, IAppData, IAppInputData, IArrow, IArrowData, IArrowInputData, IArrowType, IBlurEffect, IBox, IBoxData, IBoxInputData, ICachedShape, ICanvas, ICanvasData, ICanvasInputData, IColor, IColorConvertModule, IColorStop, IColorString, ICornerRadiusString, IDashPatternString, IEditBoxBase, IEditPoint, IEditPointType, IEditToolFunction, IEditorBase, IEditorConfig, IEditorConfigFunction, IEffectModule, IEllipse, IEllipseData, IEllipseInputData, IExportModule, IFill, IFindUIMethod, IFontWeight, IFrame, IFrameData, IFrameInputData, IFrameRenderModule, IGradientPaint, IGrayscaleEffect, IGroup, IGroupData, IGroupInputData, IGroupRenderModule, IImage, IImageData, IImageInputData, IImagePaint, IImagePaintMode, IImageRenderModule, ILeafFill, ILeafPaint, ILeafPaintColor, ILeafPaintPatternData, ILeafShadowEffect, ILeafStrokePaint, ILeafer, ILeaferData, ILeaferInputData, ILine, ILineData, ILineInputData, IOverflow, IPaint, IPaintAttr, IPaintGradientModule, IPaintImageModule, IPaintModule, IPaintString, IPath, IPathArrowModule, IPathData, IPathDataArrow, IPathDataArrowMap, IPathInputData, IPen, IPenData, IPenInputData, IPercent, IPolygon, IPolygonData, IPolygonInputData, IRGB, IRGBA, IRect, IRectData, IRectInputData, IRectRenderModule, IRepeat, IShadowEffect, IShadowString, IStar, IStarData, IStarInputData, IStateModule, IStroke, IStrokeAlign, IStrokeCap, IStrokeJoin, IStrokeWidthString, IText, ITextAlign, ITextCase, ITextCharData, ITextConvertModule, ITextData, ITextDecoration, ITextDrawData, ITextInputData, ITextRenderModule, ITextRowData, ITextWordData, ITextWrap, IUI, IUIBaseInputData, IUIBoundsModule, IUIData, IUIHitModule, IUIInputData, IUIRenderModule, IUITag, IUnitData, IVectorPath, IVerticalAlign };