@samatawy/diagrams
    Preparing search index...

    Class DiagramEditor

    A composed diagram editing component that wires a DiagramEditView together with a tool palette, action toolbars, and style controls. It provides a ready-to-mount editor surface with optional prompts for unsaved-change flows.

    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    host: HTMLElement
    eventDispatcher: EventDispatcher
    sheet_repository: SheetRepository
    topMenuHost?: HTMLElement
    topMenu?: DiagramTopMenu
    headerHost?: HTMLElement
    stageHost?: HTMLElement
    statusBarHost?: HTMLElement
    toolbarsHost?: HTMLElement
    toolbars: DiagramToolBar[] = []
    toolboxHost?: HTMLElement
    toolbox?: DiagramToolbox
    inspectorHost?: HTMLElement
    inspector?: DiagramInspector
    statusBar?: DiagramStatusBar
    hintService?: DiagramHintService
    freehandToolbar?: HTMLElement
    freehandColorHost?: HTMLElement
    freehandWidthHost?: HTMLElement
    freehandColorSelect?: ColorSelect
    freehandWidthSelect?: WidthSelect
    textToolbar?: HTMLElement
    fontSelectHost?: HTMLElement
    fontSizeSelectHost?: HTMLElement
    textColorSelectHost?: HTMLElement
    fontSelect?: FontSelect
    fontSizeSelect?: SizeSelect
    textColorSelect?: ColorSelect
    textAlignToolbar?: DiagramToolBar
    textFormatToolbar?: DiagramToolBar
    strokeToolbar?: HTMLElement
    strokeColorSelectHost?: HTMLElement
    strokeWidthSelectHost?: HTMLElement
    dashSelectHost?: HTMLElement
    arrowDirectionSelectHost?: HTMLElement
    arrowTypeSelect?: ArrowTypeSelect
    strokeColorSelect?: ColorSelect
    strokeWidthSelect?: WidthSelect
    dashSelect?: DashSelect
    arrowDirectionSelect?: ArrowDirectionSelect
    arrowTypeSelectHost?: HTMLElement
    shadowToolbar?: HTMLElement
    shadowPresetSelectHost?: HTMLElement
    shadowPresetSelect?: ShadowPresetSelect
    shadowEnableCheckbox?: HTMLInputElement
    haloEnableCheckbox?: HTMLInputElement
    shadowOffsetXHost?: HTMLElement
    shadowOffsetYHost?: HTMLElement
    shadowBlurHost?: HTMLElement
    shadowOffsetXSelect?: IntegerRangeSelect
    shadowOffsetYSelect?: IntegerRangeSelect
    shadowBlurSelect?: IntegerRangeSelect
    fillToolbar?: HTMLElement
    fillStyleSelectHost?: HTMLElement
    fillStyleSelect?: ColorSelect
    imageSelectHost?: HTMLElement
    imageSelect?: ImageSelect
    imageModeSelectHost?: HTMLElement
    imageModeSelect?: ImageModeSelect
    imageAlignSelectHost?: HTMLElement
    imageAlignSelect?: ImageAlignSelect
    imagePaddingHost?: HTMLElement
    imagePaddingSelect?: IntegerRangeSelect
    listenerDisposers: (() => void)[] = []
    syncingControls: boolean = false

    Accessors

    Methods

    • Clears the current diagram after resolving any unsaved-change prompt. A prompt will be shown if the diagram has unsaved changes.

      Returns Promise<boolean>

      True when a new empty diagram was created; otherwise false.

    • Loads a diagram from a live diagram instance, a serialized JSON string, or a deserialized payload. A prompt will be shown if the diagram has unsaved changes.

      Parameters

      Returns Promise<boolean>

      True when the source was loaded; otherwise false when loading was canceled.

    • Opens a diagram using configured file dialog behavior after resolving unsaved-change prompts.

      Parameters

      Returns Promise<boolean>

      True when a diagram was opened; otherwise false.

    • Saves the current diagram using the underlying DiagramEditView. A prompt will be shown if the diagram has no changes to save.

      Parameters

      Returns Promise<string | undefined>

      The serialized diagram string, or undefined when saving was canceled.

    • Closes the current diagram after resolving any unsaved-change prompt. A prompt will be shown if the diagram has unsaved changes.

      Returns Promise<boolean>

      True when the diagram was closed; otherwise false.

    • Shows the default prompt used when a save is requested without any pending changes.

      Returns Promise<boolean>

      True when saving should continue; otherwise false.