@xeger/quill-image-actions
Advanced tools
Comparing version 0.5.3 to 0.5.4
@@ -1,414 +0,12 @@ | ||
declare module "actions/Action" { | ||
import ImageActions from "ImageActions"; | ||
export default class Action { | ||
static formats: string[]; | ||
formatter: ImageActions; | ||
constructor(formatter: ImageActions); | ||
onCreate(): void; | ||
onDestroy(): void; | ||
onUpdate(): void; | ||
} | ||
} | ||
declare module "actions/align/Alignment" { | ||
export type Alignment = { | ||
name: string; | ||
icon: string; | ||
apply: (el: HTMLElement) => void; | ||
}; | ||
} | ||
declare module "actions/align/Aligner" { | ||
import { Alignment } from "actions/align/Alignment"; | ||
export interface Aligner { | ||
getAlignments(): Alignment[]; | ||
isAligned(el: HTMLElement, alignment: Alignment): boolean; | ||
clear(el: HTMLElement): void; | ||
} | ||
} | ||
declare module "actions/align/DefaultAligner" { | ||
import type { Quill as IQuill } from 'quill'; | ||
import { Aligner } from "actions/align/Aligner"; | ||
import { Alignment } from "actions/align/Alignment"; | ||
import DefaultOptions from "Options"; | ||
export default class DefaultAligner implements Aligner { | ||
alignments: { | ||
[key: string]: Alignment; | ||
}; | ||
alignAttribute: string; | ||
applyStyle: boolean; | ||
quill: IQuill; | ||
constructor(quill: IQuill, options: typeof DefaultOptions['align']); | ||
getContext(el: HTMLElement): { | ||
blot: any; | ||
index: number; | ||
precedesNewline: boolean | undefined; | ||
} | null; | ||
getAlignments(): Alignment[]; | ||
clear(el: HTMLElement): void; | ||
isAligned(el: HTMLElement, alignment: Alignment): boolean; | ||
} | ||
} | ||
declare module "actions/align/Toolbar" { | ||
import { Aligner } from "actions/align/Aligner"; | ||
import ImageActions from "ImageActions"; | ||
export interface Toolbar { | ||
create(formatter: ImageActions, alignmentHelper: Aligner): HTMLElement; | ||
destroy(): void; | ||
getElement(): HTMLElement | null | undefined; | ||
} | ||
} | ||
declare module "actions/align/DefaultToolbar" { | ||
import { Toolbar } from "actions/align/Toolbar"; | ||
import { Aligner } from "actions/align/Aligner"; | ||
import { Alignment } from "actions/align/Alignment"; | ||
import ImageActions from "ImageActions"; | ||
export default class DefaultToolbar implements Toolbar { | ||
toolbar: HTMLElement | null | undefined; | ||
buttons: HTMLElement[]; | ||
constructor(); | ||
create(formatter: ImageActions, aligner: Aligner): HTMLElement; | ||
destroy(): void; | ||
getElement(): HTMLElement | null | undefined; | ||
addToolbarStyle(formatter: ImageActions, toolbar: HTMLElement): void; | ||
addButtonStyle(button: HTMLElement, index: number, formatter: ImageActions): void; | ||
addButtons(formatter: ImageActions, toolbar: HTMLElement, aligner: Aligner): void; | ||
preselectButton(button: HTMLElement, alignment: Alignment, formatter: ImageActions, aligner: Aligner): void; | ||
onButtonClick(button: HTMLElement, formatter: ImageActions, alignment: Alignment, aligner: Aligner): void; | ||
clickButton(button: HTMLElement, alignTarget: HTMLElement, formatter: ImageActions, alignment: Alignment, aligner: Aligner): void; | ||
selectButton(formatter: ImageActions, button: HTMLElement): void; | ||
deselectButton(formatter: ImageActions, button: HTMLElement): void; | ||
} | ||
} | ||
declare module "actions/align/AlignAction" { | ||
import Action from "actions/Action"; | ||
import ImageActions from "ImageActions"; | ||
import { Aligner } from "actions/align/Aligner"; | ||
import { Toolbar } from "actions/align/Toolbar"; | ||
export default class AlignAction extends Action { | ||
static formats: string[]; | ||
toolbar: Toolbar; | ||
aligner: Aligner; | ||
constructor(formatter: ImageActions); | ||
onCreate(): void; | ||
onDestroy(): void; | ||
} | ||
} | ||
declare module "actions/ResizeAction" { | ||
import Action from "actions/Action"; | ||
import ImageActions from "ImageActions"; | ||
interface HandleStyle { | ||
width: string; | ||
height: string; | ||
} | ||
export default class ResizeAction extends Action { | ||
static formats: string[]; | ||
topLeftHandle: HTMLElement; | ||
topRightHandle: HTMLElement; | ||
bottomRightHandle: HTMLElement; | ||
bottomLeftHandle: HTMLElement; | ||
dragHandle: HTMLElement | null | undefined; | ||
dragStartX: number; | ||
preDragWidth: number; | ||
targetRatio: number; | ||
constructor(formatter: ImageActions); | ||
onCreate(): void; | ||
onDestroy(): void; | ||
createHandle(position: string, cursor: string): HTMLElement; | ||
repositionHandles(handleStyle: HandleStyle | null | undefined): void; | ||
setCursor(value: string): void; | ||
onMouseDown: (event: MouseEvent) => void; | ||
onDrag: (event: MouseEvent) => void; | ||
onMouseUp: () => void; | ||
} | ||
} | ||
declare module "actions/DeleteAction" { | ||
import Action from "actions/Action"; | ||
export default class DeleteAction extends Action { | ||
onCreate(): void; | ||
onDestroy(): void; | ||
onKeyUp: (e: KeyboardEvent) => void; | ||
} | ||
} | ||
declare module "specs/BlotSpec" { | ||
import ImageActions from "ImageActions"; | ||
interface Action { | ||
onCreate(): void; | ||
onDestroy(): void; | ||
onUpdate(): void; | ||
} | ||
interface ExtendsAction { | ||
new (...rest: any): Action; | ||
} | ||
export default class BlotSpec { | ||
formatter: ImageActions; | ||
constructor(formatter: ImageActions); | ||
init(): void; | ||
getActions(): ExtendsAction[]; | ||
getTargetElement(): HTMLElement | null | undefined; | ||
getOverlayElement(): HTMLElement | null | undefined; | ||
setSelection(): void; | ||
onHide(): void; | ||
} | ||
} | ||
declare module "specs/ImageSpec" { | ||
import BlotSpec from "specs/BlotSpec"; | ||
import ImageActions from "ImageActions"; | ||
export default class ImageSpec extends BlotSpec { | ||
img: HTMLElement | null | undefined; | ||
constructor(formatter: ImageActions); | ||
init(): void; | ||
getTargetElement(): HTMLElement | null | undefined; | ||
onHide(): void; | ||
onClick: (event: MouseEvent) => void; | ||
} | ||
} | ||
declare module "specs/UnclickableBlotSpec" { | ||
import BlotSpec from "specs/BlotSpec"; | ||
import ImageActions from "ImageActions"; | ||
export default class UnclickableBlotSpec extends BlotSpec { | ||
selector: string; | ||
unclickable?: HTMLElement | null; | ||
nextUnclickable?: HTMLElement | null; | ||
proxyImage?: HTMLImageElement; | ||
constructor(formatter: ImageActions, selector: string); | ||
init(): void; | ||
getTargetElement(): HTMLElement | null | undefined; | ||
getOverlayElement(): HTMLElement | null | undefined; | ||
onHide(): void; | ||
createProxyImage(): HTMLElement; | ||
hideProxyImage(): void; | ||
repositionProxyImage(unclickable: HTMLElement): void; | ||
onTextChange: () => void; | ||
onMouseEnter: (event: MouseEvent) => void; | ||
onProxyImageClick: () => void; | ||
} | ||
} | ||
declare module "specs/IframeVideoSpec" { | ||
import UnclickableBlotSpec from "specs/UnclickableBlotSpec"; | ||
import ImageActions from "ImageActions"; | ||
export default class IframeVideoSpec extends UnclickableBlotSpec { | ||
constructor(formatter: ImageActions); | ||
} | ||
} | ||
declare module "Options" { | ||
import BlotSpec from "specs/BlotSpec"; | ||
import ImageSpec from "specs/ImageSpec"; | ||
import IframeVideoSpec from "specs/IframeVideoSpec"; | ||
interface ExtendsBlotSpec { | ||
new (): BlotSpec; | ||
} | ||
type Styles = Record<string, string>; | ||
export type OverlayOptions = { | ||
className?: string; | ||
style?: Styles | null; | ||
}; | ||
export type ResizeOptions = { | ||
handleClassName?: string; | ||
handleStyle?: Styles | null; | ||
}; | ||
export type AlignOptions = { | ||
attribute?: string; | ||
aligner?: { | ||
applyStyle?: boolean; | ||
}; | ||
icons?: { | ||
left?: string; | ||
center?: string; | ||
right?: string; | ||
}; | ||
toolbar?: { | ||
allowDeselect?: boolean; | ||
mainClassName?: string; | ||
mainStyle?: Styles | null; | ||
buttonClassName?: string; | ||
addButtonSelectStyle?: boolean; | ||
buttonStyle?: Styles | null; | ||
svgStyle?: Styles | null; | ||
}; | ||
}; | ||
export type Options = { | ||
specs?: ExtendsBlotSpec[]; | ||
overlay?: OverlayOptions; | ||
align?: AlignOptions; | ||
resize?: ResizeOptions; | ||
}; | ||
const DefaultOptions: { | ||
specs: (typeof ImageSpec | typeof IframeVideoSpec)[]; | ||
overlay: { | ||
className: string; | ||
style: { | ||
position: string; | ||
boxSizing: string; | ||
border: string; | ||
}; | ||
}; | ||
align: { | ||
attribute: string; | ||
aligner: { | ||
applyStyle: boolean; | ||
}; | ||
icons: { | ||
left: string; | ||
center: string; | ||
right: string; | ||
}; | ||
toolbar: { | ||
allowDeselect: boolean; | ||
mainClassName: string; | ||
mainStyle: { | ||
position: string; | ||
top: string; | ||
right: string; | ||
left: string; | ||
height: string; | ||
minWidth: string; | ||
font: string; | ||
textAlign: string; | ||
color: string; | ||
boxSizing: string; | ||
cursor: string; | ||
zIndex: string; | ||
}; | ||
buttonClassName: string; | ||
addButtonSelectStyle: boolean; | ||
buttonStyle: { | ||
display: string; | ||
width: string; | ||
height: string; | ||
background: string; | ||
border: string; | ||
verticalAlign: string; | ||
}; | ||
svgStyle: { | ||
display: string; | ||
width: string; | ||
height: string; | ||
background: string; | ||
border: string; | ||
verticalAlign: string; | ||
}; | ||
}; | ||
}; | ||
resize: { | ||
handleClassName: string; | ||
handleStyle: { | ||
position: string; | ||
height: string; | ||
width: string; | ||
backgroundColor: string; | ||
border: string; | ||
boxSizing: string; | ||
opacity: string; | ||
}; | ||
}; | ||
}; | ||
export default DefaultOptions; | ||
} | ||
declare module "ImageActions" { | ||
import type { Quill } from 'quill'; | ||
import { Options } from "Options"; | ||
import DefaultOptions from "Options"; | ||
import Action from "actions/Action"; | ||
import BlotSpec from "specs/BlotSpec"; | ||
export default class ImageActions { | ||
static DefaultOptions: { | ||
specs: (typeof import("index").ImageSpec | typeof import("index").IframeVideoSpec)[]; | ||
overlay: { | ||
className: string; | ||
style: { | ||
position: string; | ||
boxSizing: string; | ||
border: string; | ||
}; | ||
}; | ||
align: { | ||
attribute: string; | ||
aligner: { | ||
applyStyle: boolean; | ||
}; | ||
icons: { | ||
left: string; | ||
center: string; | ||
right: string; | ||
}; | ||
toolbar: { | ||
allowDeselect: boolean; | ||
mainClassName: string; | ||
mainStyle: { | ||
position: string; | ||
top: string; | ||
right: string; | ||
left: string; | ||
height: string; | ||
minWidth: string; | ||
font: string; | ||
textAlign: string; | ||
color: string; | ||
boxSizing: string; | ||
cursor: string; | ||
zIndex: string; | ||
}; | ||
buttonClassName: string; | ||
addButtonSelectStyle: boolean; | ||
buttonStyle: { | ||
display: string; | ||
width: string; | ||
height: string; | ||
background: string; | ||
border: string; | ||
verticalAlign: string; | ||
}; | ||
svgStyle: { | ||
display: string; | ||
width: string; | ||
height: string; | ||
background: string; | ||
border: string; | ||
verticalAlign: string; | ||
}; | ||
}; | ||
}; | ||
resize: { | ||
handleClassName: string; | ||
handleStyle: { | ||
position: string; | ||
height: string; | ||
width: string; | ||
backgroundColor: string; | ||
border: string; | ||
boxSizing: string; | ||
opacity: string; | ||
}; | ||
}; | ||
}; | ||
quill: Quill; | ||
options: typeof DefaultOptions; | ||
currentSpec?: BlotSpec | null; | ||
specs: BlotSpec[]; | ||
overlay: HTMLElement; | ||
actions: Action[]; | ||
constructor(quill: Quill, options?: Options); | ||
withParentNode(callback: (HTMLElement: any) => any): void; | ||
show(spec: BlotSpec): void; | ||
hide(): void; | ||
update(): void; | ||
createActions(spec: BlotSpec): void; | ||
destroyActions(): void; | ||
repositionOverlay(): void; | ||
setUserSelect(value: string): void; | ||
onClick: () => void; | ||
} | ||
} | ||
declare module "index" { | ||
export { default as DefaultOptions } from "Options"; | ||
export { default as ImageActions } from "ImageActions"; | ||
export { default as Action } from "actions/Action"; | ||
export { default as AlignAction } from "actions/align/AlignAction"; | ||
export { default as DefaultAligner } from "actions/align/DefaultAligner"; | ||
export { default as DefaultToolbar } from "actions/align/DefaultToolbar"; | ||
export { default as DeleteAction } from "actions/DeleteAction"; | ||
export { default as ResizeAction } from "actions/ResizeAction"; | ||
export { default as BlotSpec } from "specs/BlotSpec"; | ||
export { default as ImageSpec } from "specs/ImageSpec"; | ||
export { default as UnclickableBlotSpec } from "specs/UnclickableBlotSpec"; | ||
export { default as IframeVideoSpec } from "specs/IframeVideoSpec"; | ||
} | ||
export { default as DefaultOptions } from './Options'; | ||
export { default as ImageActions } from './ImageActions'; | ||
export { default as Action } from './actions/Action'; | ||
export { default as AlignAction } from './actions/align/AlignAction'; | ||
export { default as DefaultAligner } from './actions/align/DefaultAligner'; | ||
export { default as DefaultToolbar } from './actions/align/DefaultToolbar'; | ||
export { default as DeleteAction } from './actions/DeleteAction'; | ||
export { default as ResizeAction } from './actions/ResizeAction'; | ||
export { default as BlotSpec } from './specs/BlotSpec'; | ||
export { default as ImageSpec } from './specs/ImageSpec'; | ||
export { default as UnclickableBlotSpec } from './specs/UnclickableBlotSpec'; | ||
export { default as IframeVideoSpec } from './specs/IframeVideoSpec'; |
{ | ||
"name": "@xeger/quill-image-actions", | ||
"version": "0.5.3", | ||
"version": "0.5.4", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "packageManager": "npm@8.5.0", |
21
98620
2763