@omnia/fx
Version:
Provide Omnia Fx typings and tooling for clientside Omnia development.
144 lines (143 loc) • 9.45 kB
TypeScript
import { Layout, LayoutEditorModes, LayoutItem, DisplayBreakPoint, LayoutItemActionState, SettingsPanelState, DisplayBreakPointSetting, DeleteItemFromLayoutPayLoad, AddItemToLayoutPayLoad, LayoutItemRegistration, LoadedLayout, ILayoutCanvasStore, LayoutCanvasModes, BlockRenderingModes, IBlockInstance, ILayoutSectionRenderer, GuidValue, Block, LayoutDrawerState, LayoutDrawerTabs, SectionSettings, SectionTypes, Section, LayoutInheritanceBehaviors, ThemeDefinition, ClipboardLayoutItem } from "../../../models";
import { EditorLayoutItemFactory } from "../factories";
import { LayoutEditorThemingManager } from "../shared";
import { BlockSettingsProvider, LayoutDefinitionBuilder } from "../shared";
import { MessageBusExposeOnlySubscription } from "../../..";
import { ThemeStore } from "../../theming";
import { Store, StoreState } from "../../../stores";
import { ServiceContainerContext } from "../../../core";
export interface IBlockInstanceExtends<TSettings = void> extends IBlockInstance<TSettings> {
settings: TSettings;
serviceContainerContext: ServiceContainerContext;
}
type BlockInstancesByManifestResult<TSettings = void> = {
result: IBlockInstanceExtends<TSettings>[];
};
export declare class LayoutCanvasStore extends Store implements ILayoutCanvasStore {
themeStore: ThemeStore;
private subscriptionHandler;
private serviceContainerContext;
layout: StoreState<LoadedLayout>;
previewUrl: StoreState<string>;
provider: StoreState<string>;
elementId: StoreState<string>;
canvasMode: StoreState<LayoutCanvasModes>;
editorMode: StoreState<LayoutEditorModes>;
selectedLayoutItem: StoreState<LayoutItem>;
selectedClipBoardItem: StoreState<ClipboardLayoutItem>;
selectedDisplayBreakPoint: StoreState<DisplayBreakPoint>;
activeLayoutItemAction: StoreState<LayoutItemActionState>;
selectedLayoutItem4Action: StoreState<LayoutItem>;
registrations: StoreState<LayoutItemRegistration[]>;
definitions: StoreState<LayoutDefinitionBuilder>;
blockInstances: StoreState<{
[id: string]: IBlockInstance<void>;
}>;
themeManager: LayoutEditorThemingManager;
layoutItemFactory: EditorLayoutItemFactory;
suggestedBlocks: StoreState<string[]>;
layoutInheritanceBehaviors: StoreState<LayoutInheritanceBehaviors>;
enableDisplayBreakpointSettings: StoreState<boolean>;
blockThemeDefinition: StoreState<ThemeDefinition>;
layoutThemeDefinition: StoreState<ThemeDefinition>;
isDesignRender: StoreState<boolean>;
authDisabled: StoreState<boolean>;
private disabledAnchorLink;
private onBlockInstanceCreatedHook;
private onBlockRemovedHook;
private onBlockCopiedHook;
private onLayoutItemMovedHook;
private onLayoutSectionRendererCreatedHook;
private blockSettingsProvider;
private onLayoutPastedHook;
settingsPanel: StoreState<SettingsPanelState>;
layoutDrawer: StoreState<LayoutDrawerState>;
constructor(provider?: string);
static getBlockInstancesByManifestId<TSettings = void>(manifestId: GuidValue): BlockInstancesByManifestResult<TSettings> & MessageBusExposeOnlySubscription<IBlockInstanceExtends<TSettings>[]>;
onActivated(): void;
onDisposing(): void;
/**
* Implementation of getters
*/
getters: {
getSelectedLayoutItem: () => LayoutItem;
extractSelectedLayoutItemForClipBoard: () => ClipboardLayoutItem;
isEnableAnchorLink: () => boolean;
getLayout: () => Layout;
getSuggestedBlocks: () => string[];
getDefinitionBuilder: () => LayoutDefinitionBuilder;
getLayoutBackgroundImageElementId: () => string;
blockRenderMode: () => BlockRenderingModes;
isLayoutItemLocked: (item: LayoutItem) => boolean;
isTemplateEnabledLayout: () => boolean;
isAdvancedModeActivated: () => boolean;
getBlockSettingsProvider: () => BlockSettingsProvider;
isSectionInlineManagementActivated: (section: Section) => boolean;
isAuthDisabled: () => boolean;
};
private realLayoutId;
/**
* Implementation of mutations
*/
mutations: {
setLayout: (layout: Layout) => void;
createNewLayout: () => void;
setTheme: (layoutThemeDefinition: ThemeDefinition, blockThemeDefinition: ThemeDefinition) => void;
setCanvasMode: (mode: LayoutCanvasModes) => void;
setSuggestedBlocks: (blocks: string[]) => void;
setPreviewUrl: (url: string) => void;
setEditorMode: (mode: LayoutEditorModes) => void;
setActiveTab: (tab: LayoutDrawerTabs) => void;
toggleSettingsPanel: (show: boolean) => void;
removeSelectedLayoutItem: () => void;
setLayoutBackgroundImageElementId: (elementId: string) => void;
configureLayoutBehaviors: (layoutInheritanceBehaviors: LayoutInheritanceBehaviors) => void;
enableDisplayBreakpointSettings: (enable: boolean) => void;
disableAnchorLink: () => void;
disableAuth: () => void;
unlockBlock: import("../../../stores").StoreMutation<(layoutItem: LayoutItem) => void, (layoutItem: LayoutItem) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
lockBlock: import("../../../stores").StoreMutation<(layoutItem: LayoutItem) => void, (layoutItem: LayoutItem) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
setSelectedLayoutItem: import("../../../stores").StoreMutation<(item: LayoutItem, toggleSettings: boolean) => void, (item: LayoutItem, toggleSettings: boolean) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
toggleActionForLayoutItem: import("../../../stores").StoreMutation<(item: LayoutItem | ClipboardLayoutItem, action: LayoutItemActionState) => void, (item: ClipboardLayoutItem | LayoutItem, action: LayoutItemActionState) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
addDeviceBreakPointSetting: import("../../../stores").StoreMutation<(breakPointSetting: DisplayBreakPointSetting) => void, (breakPointSetting: DisplayBreakPointSetting) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
removeDeviceBreakPointSetting: import("../../../stores").StoreMutation<(propertyName: string, displayBreakPoint: DisplayBreakPoint) => void, (propertyName: string, displayBreakPoint: DisplayBreakPoint) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
moveItemInLayout: import("../../../stores").StoreMutation<(item2Move: LayoutItem, container: LayoutItem, siblingId?: string, postInsert?: boolean) => void, (item2Move: LayoutItem, container: LayoutItem, siblingId?: string, postInsert?: boolean) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
changeSectionType: import("../../../stores").StoreMutation<(section: Section, type: SectionTypes) => void, (section: Section<SectionSettings>, type: SectionTypes) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
copyItemInLayout: import("../../../stores").StoreMutation<(item2Copy: LayoutItem, container: LayoutItem, siblingId?: string, postInsert?: boolean) => void, (item2Copy: LayoutItem, container: LayoutItem, siblingId?: string, postInsert?: boolean) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
insertClipboardItemIntoLayout: import("../../../stores").StoreMutation<(clipboard: ClipboardLayoutItem, container: LayoutItem, siblingId?: string, postInsert?: boolean) => void, (clipboard: ClipboardLayoutItem, container: LayoutItem, siblingId?: string, postInsert?: boolean) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
addItem2Layout: import("../../../stores").StoreMutation<(itemreference: AddItemToLayoutPayLoad) => void, (itemreference: AddItemToLayoutPayLoad) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
deleteItemFromLayout: import("../../../stores").StoreMutation<(itemreference: DeleteItemFromLayoutPayLoad) => void, (itemreference: DeleteItemFromLayoutPayLoad) => import("@omnia/fx-models").IMessageBusSubscriptionHandler>;
};
/**
* Implementation of events
*/
events: {
onBlockInstanceCreated: (cb: (blockInstance: IBlockInstance) => void) => void;
onBlockRemoved: (cb: (block: Block) => void) => void;
onBlockCopied: (cb: (originalBlock: Block, newBlock: Block) => void) => void;
onLayoutItemMoved: (cb: (layoutItem: LayoutItem) => void) => void;
onLayoutSectionRendererCreated: (cb: (layoutSectionRenderer: ILayoutSectionRenderer) => void) => void;
onLayoutItemPasted: (cb: (layoutItem: ClipboardLayoutItem) => void) => void;
};
onLayoutItemPasted(layoutItem: ClipboardLayoutItem): void;
private onLayoutItemMoved;
private onBlockRemoved;
onBlockInstanceCreated(blockInstance: IBlockInstance): IBlockInstance<void>;
onLayoutSectionRendererCreated(layoutSectionRenderer: ILayoutSectionRenderer): void;
private ensureRemoveDeletedBlocks;
private ensureRealLayoutId;
private ensureUniqueLayoutId;
private getOwnerLayoutItemsOverride;
private recursiveEnsureProperties;
private deleteItem;
private addItem;
private moveItem;
private copyItem;
private changeIdAndCopyData;
private addItemAtCorrectSibling;
private getLayoutItemFromParentLayout;
private getBlocks;
private renewOldBlockIdClipBoardItem;
private renewOldBlockIdClipBoardLayout;
}
export {};