UNPKG

@craftercms/studio-ui

Version:

Services, components, models & utils to build CrafterCMS authoring extensions.

498 lines (496 loc) 21.4 kB
/* * Copyright (C) 2007-2022 Crafter Software Corporation. All Rights Reserved. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Lesser General Public License version 3 as published by * the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ import { StandardAction } from '../../models/StandardAction'; import ContentType, { ContentTypeField, ValidationResult } from '../../models/ContentType'; import ContentInstance, { InstanceRecord } from '../../models/ContentInstance'; import { WidthAndHeight } from '../../models/WidthAndHeight'; import { ContentInstancePage, SearchItem, SearchResult } from '../../models/Search'; import { ContentTypeDropTarget } from '../../models/ContentTypeDropTarget'; import { WidgetDescriptor } from '../../models'; import LookupTable from '../../models/LookupTable'; import { DetailedItem, SandboxItem } from '../../models/Item'; import GlobalState, { HighlightMode } from '../../models/GlobalState'; interface CommonOperationProps { modelId: string; parentModelId: string; fieldId: string; } export declare const hostCheckIn: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { editMode: boolean; highlightMode: HighlightMode; authoringBase: string; editModePadding: boolean; site: string; username: string; rteConfig: GlobalState['preview']['richTextEditor']; }, string >; export declare const guestCheckIn: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { location: Partial<Location>; path: string; site: string; documentDomain?: string; version?: string; }, string >; export declare const guestCheckOut: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { path: string; }, string >; export declare const fetchGuestModel: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'FETCH_GUEST_MODEL'>; export declare const guestSiteLoad: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'GUEST_SITE_LOAD'>; export declare const sortItemOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { targetIndex: string | number; currentIndex: string | number; } & CommonOperationProps, string >; export declare const sortItemOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: string | number; } & CommonOperationProps, string >; export declare const sortItemOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'SORT_ITEM_OPERATION_FAILED'>; export interface InsertComponentOperationPayload extends CommonOperationProps { targetIndex: string | number; instance: ContentInstance; shared: boolean; create: boolean; } export declare const insertComponentOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< InsertComponentOperationPayload, string >; export declare const insertOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { currentFullUrl: string; index: number; instance: ContentInstance; } & CommonOperationProps, string >; export declare const insertOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'INSERT_COMPONENT_OPERATION_FAILED'>; export declare const insertItemOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: string | number; instance: InstanceRecord; } & CommonOperationProps, string >; export declare const insertItemOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'INSERT_ITEM_OPERATION_COMPLETE'>; export declare const insertItemOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'INSERT_ITEM_OPERATION_FAILED'>; export declare const duplicateItemOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: string | number; } & CommonOperationProps, string >; export declare const duplicateItemOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'DUPLICATE_ITEM_OPERATION_COMPLETE'>; export declare const duplicateItemOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'DUPLICATE_ITEM_OPERATION_FAILED'>; export declare const moveItemOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { originalModelId: string; originalFieldId: string; originalIndex: string | number; targetModelId: string; targetFieldId: string; targetIndex: string | number; originalParentModelId: string; targetParentModelId: string; }, string >; export declare const moveItemOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'MOVE_ITEM_OPERATION_COMPLETE'>; export declare const moveItemOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'MOVE_ITEM_OPERATION_FAILED'>; export declare const deleteItemOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: string | number; } & CommonOperationProps, string >; export declare const deleteItemOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: string | number; } & CommonOperationProps, string >; export declare const deleteItemOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'DELETE_ITEM_OPERATION_FAILED'>; export declare const updateFieldValueOperation: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: string | number; value: unknown; } & CommonOperationProps, string >; export declare const updateFieldValueOperationComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { item: SandboxItem; }, string >; export declare const updateFieldValueOperationFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'UPDATE_FIELD_VALUE_OPERATION_FAILED'>; export declare const iceZoneSelected: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { index: number; coordinates: { x: number; y: number; } & CommonOperationProps; }, string >; export declare const clearSelectedZones: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CLEAR_SELECTED_ZONES'>; export declare const assetDragStarted: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { asset: SearchItem; }, string >; export declare const assetDragEnded: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'ASSET_DRAG_ENDED'>; export declare const componentDragStarted: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentType: ContentType; }, string >; export declare const componentDragEnded: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'COMPONENT_DRAG_ENDED'>; export declare const trashed: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { iceId: number; }, string >; export declare const contentTypesResponse: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypes: Array<ContentType>; }, string >; export declare const instanceDragBegun: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<number, string>; export declare const instanceDragEnded: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'INSTANCE_DRAG_ENDED'>; export declare const navigationRequest: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'NAVIGATION_REQUEST'>; export declare const reloadRequest: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'RELOAD_REQUEST'>; export declare const desktopAssetDrop: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'DESKTOP_ASSET_DROP'>; export declare const componentInstanceDragStarted: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { instance: ContentInstance; contentType: ContentType; }, string >; export declare const componentInstanceDragEnded: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'COMPONENT_INSTANCE_DRAG_ENDED'>; export declare const contentTypeDropTargetsRequest: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypeId: string; }, string >; export declare const contentTypeDropTargetsResponse: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypeId: string; dropTargets: ContentTypeDropTarget[]; }, string >; export declare const scrollToDropTarget: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'SCROLL_TO_DROP_TARGET'>; export declare const clearHighlightedDropTargets: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CLEAR_HIGHLIGHTED_DROP_TARGETS'>; export declare const contentTreeFieldSelected: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { iceProps: any; scrollElement: string; name: string; }, string >; export declare const clearContentTreeFieldSelected: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CLEAR_CONTENT_TREE_FIELD_SELECTED'>; export declare const snackGuestMessage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< ValidationResult, string >; export declare const editModeToggleHotkey: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { mode: string; }, string >; export declare const hotKey: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< Pick<KeyboardEvent, 'type' | 'key' | 'ctrlKey' | 'metaKey' | 'shiftKey'>, string >; export declare const showEditDialog: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'SHOW_EDIT_DIALOG'>; export declare const requestWorkflowCancellationDialog: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { siteId: string; path: string; }, string >; export declare const requestWorkflowCancellationDialogOnResult: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { type: 'continue' | 'close'; }, string >; export declare const updateRteConfig: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'UPDATE_RTE_CONFIG'>; export declare const highlightModeChanged: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'HIGHLIGHT_MODE_CHANGED'>; export declare const contentTypesRequest: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CONTENT_TYPES_REQUEST'>; export declare const guestModelsReceived: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'GUEST_MODELS_RECEIVED'>; export declare const childrenMapUpdate: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CHILDREN_MAP_UPDATE'>; export declare const contentTreeSwitchFieldInstance: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { type: string; scrollElement: string; }, string >; export declare const setEditModePadding: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { editModePadding: boolean; }, string >; export declare const toggleEditModePadding: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'TOGGLE_DRAG_HELP_MODE'>; export declare const SELECT_FOR_EDIT = 'SELECT_FOR_EDIT'; export declare const CLEAR_SELECT_FOR_EDIT = 'CLEAR_SELECT_FOR_EDIT'; export declare const OPEN_TOOLS = 'OPEN_TOOLS'; export declare const CLOSE_TOOLS = 'CLOSE_TOOLS'; export declare const SET_HOST_SIZE = 'SET_HOST_SIZE'; export declare const SET_HOST_WIDTH = 'SET_HOST_WIDTH'; export declare const SET_HOST_HEIGHT = 'SET_HOST_HEIGHT'; export declare const FETCH_CONTENT_TYPES = 'FETCH_CONTENT_TYPES'; export declare const FETCH_CONTENT_TYPES_COMPLETE = 'FETCH_CONTENT_TYPES_COMPLETE'; export declare const FETCH_CONTENT_TYPES_FAILED = 'FETCH_CONTENT_TYPES_FAILED'; export declare const FETCH_CONTENT_MODEL_COMPLETE = 'FETCH_CONTENT_MODEL_COMPLETE'; export declare const SET_ITEM_BEING_DRAGGED = 'SET_ITEM_BEING_DRAGGED'; export declare const CHANGE_CURRENT_URL = 'CHANGE_CURRENT_URL'; export declare const FETCH_ASSETS_PANEL_ITEMS = 'FETCH_ASSETS_PANEL_ITEMS'; export declare const FETCH_ASSETS_PANEL_ITEMS_COMPLETE = 'FETCH_ASSETS_PANEL_ITEMS_COMPLETE'; export declare const FETCH_ASSETS_PANEL_ITEMS_FAILED = 'FETCH_ASSETS_PANEL_ITEMS_FAILED'; export declare const UPDATE_AUDIENCES_PANEL_MODEL = 'UPDATE_AUDIENCES_PANEL_MODEL'; export declare const SET_ACTIVE_TARGETING_MODEL = 'SET_ACTIVE_TARGETING_MODEL'; export declare const SET_ACTIVE_TARGETING_MODEL_COMPLETE = 'SET_ACTIVE_TARGETING_MODEL_COMPLETE'; export declare const SET_ACTIVE_TARGETING_MODEL_FAILED = 'SET_ACTIVE_TARGETING_MODEL_FAILED'; export declare const CLEAR_DROP_TARGETS = 'CLEAR_DROP_TARGETS'; export declare const SET_CONTENT_TYPE_FILTER = 'SET_CONTENT_TYPE_FILTER'; export declare const EMBEDDED_LEGACY_FORM_CLOSE = 'EMBEDDED_LEGACY_FORM_CLOSE'; export declare const EMBEDDED_LEGACY_FORM_SUCCESS = 'EMBEDDED_LEGACY_FORM_SUCCESS'; export declare const EMBEDDED_LEGACY_FORM_RENDERED = 'EMBEDDED_LEGACY_FORM_RENDERED'; export declare const EMBEDDED_LEGACY_FORM_DISABLE_ON_CLOSE = 'EMBEDDED_LEGACY_FORM_DISABLE_ON_CLOSE'; export declare const EMBEDDED_LEGACY_FORM_ENABLE_ON_CLOSE = 'EMBEDDED_LEGACY_FORM_ENABLE_ON_CLOSE'; export declare const EMBEDDED_LEGACY_FORM_ENABLE_HEADER = 'EMBEDDED_LEGACY_FORM_ENABLE_HEADER'; export declare const EMBEDDED_LEGACY_FORM_DISABLE_HEADER = 'EMBEDDED_LEGACY_FORM_DISABLE_HEADER'; export declare const EMBEDDED_LEGACY_FORM_RENDER_FAILED = 'EMBEDDED_LEGACY_FORM_RENDER_FAILED'; export declare const EMBEDDED_LEGACY_FORM_PENDING_CHANGES = 'EMBEDDED_LEGACY_FORM_PENDING_CHANGES'; export declare const EMBEDDED_LEGACY_FORM_SAVE = 'EMBEDDED_LEGACY_FORM_SAVE'; export declare const EMBEDDED_LEGACY_FORM_FAILURE = 'EMBEDDED_LEGACY_FORM_FAILURE'; export declare const EMBEDDED_LEGACY_MINIMIZE_REQUEST = 'EMBEDDED_LEGACY_MINIMIZE_REQUEST'; export declare const EMBEDDED_LEGACY_CHANGE_TO_EDIT_MODE = 'EMBEDDED_LEGACY_CHANGE_TO_EDIT_MODE'; export declare function selectForEdit(data: { modelId: string; fields: string[] }): StandardAction; export declare function clearSelectForEdit(): { type: string; }; export declare const openToolsPanel: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'OPEN_TOOLS'>; export declare const closeToolsPanel: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CLOSE_TOOLS'>; export declare function setHostSize(dimensions: WidthAndHeight): StandardAction; export declare const fetchContentTypes: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'FETCH_CONTENT_TYPES'>; export declare function fetchContentTypesComplete(contentTypes: ContentType[]): StandardAction; export declare function fetchContentTypesFailed(error: any): StandardAction; export declare function fetchContentModelComplete(contentModels: ContentInstance[]): StandardAction; export declare const fetchPrimaryGuestModelComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { model: ContentInstance; modelLookup: LookupTable<ContentInstance>; hierarchyMap: LookupTable<string[]>; }, string >; export declare const fetchGuestModelComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { modelLookup: LookupTable<ContentInstance>; hierarchyMap: LookupTable<string[]>; }, string >; export declare const guestModelUpdated: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { model: ContentInstance; }, string >; export declare const guestPathUpdated: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { path: string; }, string >; export declare const changeCurrentUrl: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, string>; export declare function setItemBeingDragged(iceId: number): StandardAction; export declare const fetchAudiencesPanelModel: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { fields: LookupTable<ContentTypeField>; }, string >; export declare const fetchAudiencesPanelModelComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< ContentInstance, string >; export declare const fetchAudiencesPanelModelFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'FETCH_AUDIENCES_PANEL_MODEL_FAILED'>; export declare function updateAudiencesPanelModel(data: any): StandardAction; export declare function setActiveTargetingModel(): StandardAction; export declare function setActiveTargetingModelComplete(data: any): StandardAction; export declare function setActiveTargetingModelFailed(error: any): StandardAction; export declare const fetchAssetsPanelItems: import('@reduxjs/toolkit').ActionCreatorWithNonInferrablePayload<string>; export declare const fetchAssetsPanelItemsComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< SearchResult, string >; export declare const fetchAssetsPanelItemsFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'FETCH_ASSETS_PANEL_ITEMS_FAILED'>; export declare const fetchComponentsByContentType: import('@reduxjs/toolkit').ActionCreatorWithNonInferrablePayload<string>; export declare const fetchComponentsByContentTypeComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< ContentInstancePage, string >; export declare const fetchComponentsByContentTypeFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'FETCH_COMPONENTS_BY_CONTENT_TYPE_FAILED'>; export declare const clearDropTargets: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'CLEAR_DROP_TARGETS'>; export declare const setContentTypeDropTargets: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentType: string; dropTarget: ContentTypeDropTarget; }, string >; export declare const setContentTypeFilter: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, string>; export declare const updateToolsPanelWidth: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { width: number; }, string >; export declare const setPreviewEditMode: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { editMode: boolean; highlightMode?: HighlightMode; }, string >; export declare const previewItem: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { item: DetailedItem; newTab?: boolean; }, string >; export declare const updateIcePanelWidth: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { width: number; }, string >; export declare const initToolsPanelConfig: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { configXml: string; storedPage?: WidgetDescriptor; toolsPanelWidth?: number; }, string >; export declare const initToolbarConfig: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { configXml: string; }, string >; export declare const initIcePanelConfig: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { configXml: string; storedPage?: WidgetDescriptor; icePanelWidth?: number; }, string >; export declare const initRichTextEditorConfig: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { configXml: string; siteId: string; }, string >; export declare const associateTemplate: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypeId: string; displayTemplate: string; }, string >; export declare const associateTemplateComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypeId: string; displayTemplate: string; }, string >; export declare const associateTemplateFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'ASSOCIATE_TEMPLATE_FAILED'>; export declare const dissociateTemplate: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypeId: string; }, string >; export declare const dissociateTemplateComplete: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { contentTypeId: string; }, string >; export declare const dissociateTemplateFailed: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'DISSOCIATE_TEMPLATE_FAILED'>; export declare const requestEdit: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { typeOfEdit: 'content' | 'controller' | 'template'; modelId: string; fields?: string[]; parentModelId?: string; index?: string | number; }, string >; export declare const pushToolsPanelPage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< WidgetDescriptor, string >; export declare const popToolsPanelPage: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'POP_TOOLS_PANEL_PAGE'>; export declare const pushIcePanelPage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< WidgetDescriptor, string >; export declare const popIcePanelPage: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'POP_ICE_PANEL_PAGE'>; export declare const setHighlightMode: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload< { highlightMode: HighlightMode; }, string >; export declare const goToLastPage: import('@reduxjs/toolkit').ActionCreatorWithOptionalPayload<string, string>; export declare const goToNextPage: import('@reduxjs/toolkit').ActionCreatorWithoutPayload<'GO_TO_NEXT_PAGE'>; export {};