Skip to main content

Class: ImageCroppingExtension<T>

This extension enables cropping related state manangement for an image item. You could persist cropping interaction state using this, and also commit a crop to a Cimdoc with the history intact

Type parameters

NameType
Textends ImageItem

Hierarchy

  • BaseExtension

    ImageCroppingExtension

Constructors

constructor

new ImageCroppingExtension<T>(designState, designExtensionSystem, layoutStore, executeCommand, cimDocStore)

Type parameters

NameType
Textends ImageItem

Parameters

NameType
designStateDesignState
designExtensionSystemDesignExtensionSystem
layoutStoreLayoutStore
executeCommandExecuteCommand
cimDocStoreCimDocStore

Overrides

BaseExtension.constructor

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:68

Properties

cimDocStore

Private cimDocStore: CimDocStore

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:73


designExtensionSystem

Private designExtensionSystem: DesignExtensionSystem

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:70


designState

designState: ItemState<T>

Overrides

BaseExtension.designState

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:54


executeCommand

Private executeCommand: ExecuteCommand

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:72


initialCrop

Readonly initialCrop: Crop

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:56


layoutStore

Private layoutStore: LayoutStore

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:71


temporaryCropping

temporaryCropping: TemporaryCroppingValues = undefined

Partial or Full Cropping values with dimensions and position in IDA units

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:61


temporaryDimensionsScale

temporaryDimensionsScale: undefined | number

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:62


inject

Static inject: string[]

Overrides

BaseExtension.inject

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:53

Accessors

crop

get crop(): Crop

Returns crop fractions set on the Image item on Cimdoc as numbers

Returns

Crop

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:191


cropChanged

get cropChanged(): boolean

Returns

boolean

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:183


currentCropping

get currentCropping(): undefined | FullCroppingValues

Returns currently set cropping values

Returns

undefined | FullCroppingValues

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:166


itemLayout

Private get itemLayout(): undefined | IDAItemLayoutExtension

Returns

undefined | IDAItemLayoutExtension

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:79


uncroppedDimensions

get uncroppedDimensions(): Object

Returns dimensions of the full image

Returns

Object

NameType
heightnumber
widthnumber

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:200


uncroppedUrl

get uncroppedUrl(): string

Full image item preview url without cropping

Returns

string

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:140

Methods

commitCrop

commitCrop(autoUpdatePosition?): void

Commits a crop operation to Cimdoc

Parameters

NameTypeDefault value
autoUpdatePositionbooleanfalse

Returns

void

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:107


setTemporaryCropping

setTemporaryCropping(cropping): void

Sets Partial or Full Cropping values for an image item

Parameters

NameType
croppingTemporaryCroppingValues

Returns

void

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:87


setTemporaryDimensionsScale

setTemporaryDimensionsScale(scale): void

Sets the height/width ratio of the crop

Parameters

NameType
scaleundefined | number

Returns

void

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:99


supports

Static supports(state): boolean

Parameters

NameType
stateDesignState

Returns

boolean

Overrides

BaseExtension.supports

Defined in

packages/design-engine-react-components/src/extensions/imageCropping/ImageCroppingExtension.ts:64