Socket
Socket
Sign inDemoInstall

roosterjs-content-model-types

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

roosterjs-content-model-types - npm Package Compare versions

Comparing version 0.23.0 to 0.24.0

lib-amd/context/DarkColorHandler.d.ts

18

lib-amd/context/DomToModelSettings.d.ts

@@ -0,1 +1,2 @@

import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { ContentModelFormatBase } from '../format/ContentModelFormatBase';

@@ -26,2 +27,9 @@ import type { ContentModelFormatMap } from '../format/ContentModelFormatMap';

/**
* Parse format from the given text node
* @param format The format object to parse into
* @param textNode The text node to parse format from
* @param context The context object that provide related context information
*/
export declare type TextFormatParser<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: DomToModelContext) => void;
/**
* All format parsers

@@ -33,8 +41,14 @@ */

/**
* A map from format parser category name to an array of parsers
* A map from format parser category name to an array of parsers. This is for HTML Element only
*/
export declare type FormatParsersPerCategory = {
export declare type ElementFormatParserPerCategory = {
[Key in keyof ContentModelFormatMap]: (FormatParser<ContentModelFormatMap[Key]> | null)[];
};
/**
* A map from format parser category name to an array of parsers
*/
export declare type FormatParsersPerCategory = ElementFormatParserPerCategory & {
text: TextFormatParser[];
};
/**
* A map from element processor name to its processor type

@@ -41,0 +55,0 @@ */

9

lib-amd/context/EditorContext.d.ts

@@ -1,4 +0,5 @@

import type { ColorManager } from './ColorManager';
import type { DarkColorHandler } from './DarkColorHandler';
import type { ContentModelDomIndexer } from './ContentModelDomIndexer';
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { PendingFormat } from '../pluginState/ContentModelFormatPluginState';
/**

@@ -17,5 +18,9 @@ * An editor context interface used by ContentModel PAI

/**
* Pending format if any
*/
pendingFormat?: PendingFormat;
/**
* Color manager, to help manager color in dark mode
*/
darkColorHandler?: ColorManager;
darkColorHandler?: DarkColorHandler;
/**

@@ -22,0 +27,0 @@ * Whether to handle delimiters in Content Model

@@ -40,2 +40,9 @@ import type { Definition } from '../metadata/Definition';

/**
* Apply format to the given text node
* @param format The format object to apply
* @param textNode The text node to apply format to
* @param context The context object that provide related context information
*/
export declare type TextFormatApplier<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: ModelToDomContext) => void;
/**
* All format appliers

@@ -47,8 +54,14 @@ */

/**
* A map from format parser category name to an array of parsers
* A map from format parser category name to an array of parsers. This is for HTMLElement only
*/
export declare type FormatAppliersPerCategory = {
export declare type ElementFormatAppliersPerCategory = {
[Key in keyof ContentModelFormatMap]: (FormatApplier<ContentModelFormatMap[Key]> | null)[];
};
/**
* A map from format parser category name to an array of parsers
*/
export declare type FormatAppliersPerCategory = ElementFormatAppliersPerCategory & {
text: TextFormatApplier[];
};
/**
* Represents a map from content model handler name to its handle type

@@ -55,0 +68,0 @@ */

@@ -0,1 +1,3 @@

import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';
import type { PluginEventType } from '../event/PluginEventType';
import type { PasteType } from '../enum/PasteType';

@@ -6,3 +8,2 @@ import type { ClipboardData } from '../parameter/ClipboardData';

import type { Snapshot } from '../parameter/Snapshot';
import type { CompatiblePluginEventType } from 'roosterjs-editor-types/lib/compatibleTypes';
import type { ContentModelDocument } from '../group/ContentModelDocument';

@@ -16,3 +17,4 @@ import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';

import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';
import type { DarkColorHandler, PluginEventData, PluginEventFromType, PluginEventType } from 'roosterjs-editor-types';
import type { DarkColorHandler } from '../context/DarkColorHandler';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
/**

@@ -89,3 +91,3 @@ * An interface of standalone Content Model editor.

*/
triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
triggerEvent<T extends PluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
/**

@@ -113,5 +115,11 @@ * Get undo snapshots manager

/**
* Set current zoom scale, default value is 1
* When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale
* to let editor behave correctly especially for those mouse drag/drop behaviors
*/
setZoomScale(scale: number): void;
/**
* Add a single undo snapshot to undo stack
*/
takeSnapshot(): void;
takeSnapshot(): Snapshot | null;
/**

@@ -163,3 +171,3 @@ * Restore an undo snapshot into editor

*/
getDarkColorHandler(): DarkColorHandler;
getColorManager(): DarkColorHandler;
/**

@@ -174,2 +182,9 @@ * Dispose this editor, dispose all plugins and custom data

hasFocus(): boolean;
/**
* Get a function to convert HTML string to trusted HTML string.
* By default it will just return the input HTML directly. To override this behavior,
* pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types
*/
getTrustedHTMLHandler(): TrustedHTMLHandler;
}

@@ -0,1 +1,4 @@

import type { PluginEvent } from '../event/PluginEvent';
import type { PluginState } from '../pluginState/PluginState';
import type { EditorPlugin } from './EditorPlugin';
import type { ClipboardData } from '../parameter/ClipboardData';

@@ -6,5 +9,4 @@ import type { PasteType } from '../enum/PasteType';

import type { EntityState } from '../parameter/FormatWithContentModelContext';
import type { DarkColorHandler, EditorPlugin, PluginEvent, Rect, TrustedHTMLHandler } from 'roosterjs-editor-types';
import type { DarkColorHandler } from '../context/DarkColorHandler';
import type { ContentModelDocument } from '../group/ContentModelDocument';
import type { StandaloneEditorCorePluginState } from '../pluginState/StandaloneEditorPluginState';
import type { DOMSelection } from '../selection/DOMSelection';

@@ -17,2 +19,4 @@ import type { DomToModelOption } from '../context/DomToModelOption';

import type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
import type { Rect } from '../parameter/Rect';
import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';

@@ -82,3 +86,3 @@ /**

*/
export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => void;
export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => Snapshot | null;
/**

@@ -225,3 +229,3 @@ * Retrieves the rect of the visible viewport of the editor.

*/
export interface StandaloneEditorCore extends StandaloneEditorCorePluginState {
export interface StandaloneEditorCore extends PluginState {
/**

@@ -228,0 +232,0 @@ * The content DIV element of this editor

@@ -0,1 +1,2 @@

import type { PluginWithState } from './PluginWithState';
import type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';

@@ -9,3 +10,2 @@ import type { UndoPluginState } from '../pluginState/UndoPluginState';

import type { ContentModelFormatPluginState } from '../pluginState/ContentModelFormatPluginState';
import type { PluginWithState } from 'roosterjs-editor-types';
/**

@@ -12,0 +12,0 @@ * Core plugins for standalone editor

@@ -0,8 +1,10 @@

import type { Colors, ColorTransformFunction } from '../context/DarkColorHandler';
import type { EditorPlugin } from './EditorPlugin';
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { StandaloneCoreApiMap } from './StandaloneEditorCore';
import type { EditorPlugin, TrustedHTMLHandler } from 'roosterjs-editor-types';
import type { DomToModelOption } from '../context/DomToModelOption';
import type { ModelToDomOption } from '../context/ModelToDomOption';
import type { ContentModelDocument } from '../group/ContentModelDocument';
import type { SnapshotsManager } from '../parameter/SnapshotsManager';
import type { Snapshots } from '../parameter/Snapshot';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
/**

@@ -51,4 +53,8 @@ * Options for Content Model editor

*/
getDarkColor?: (lightColor: string) => string;
getDarkColor?: ColorTransformFunction;
/**
* Existing known color pairs
*/
knownColors?: Record<string, Colors>;
/**
* Customized trusted type handler used for sanitizing HTML string before assign to DOM tree

@@ -81,6 +87,5 @@ * This is required when trusted-type Content-Security-Policy (CSP) is enabled.

/**
* Undo snapshot service based on content metadata. Use this parameter to customize the undo snapshot service.
* When this property is set, value of undoSnapshotService will be ignored.
* Undo snapshot. Use this parameter to provide an external storage of undo snapshots
*/
snapshotsManager?: SnapshotsManager;
snapshots?: Snapshots;
/**

@@ -87,0 +92,0 @@ * A callback to be invoked when any exception is thrown during disposing editor

@@ -9,2 +9,3 @@ import type { BackgroundColorFormat } from './formatParts/BackgroundColorFormat';

import type { TextAlignFormat } from './formatParts/TextAlignFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
import type { WhiteSpaceFormat } from './formatParts/WhiteSpaceFormat';

@@ -14,2 +15,2 @@ /**

*/
export declare type ContentModelBlockFormat = BackgroundColorFormat & DirectionFormat & TextAlignFormat & HtmlAlignFormat & MarginFormat & PaddingFormat & LineHeightFormat & WhiteSpaceFormat & BorderFormat;
export declare type ContentModelBlockFormat = BackgroundColorFormat & DirectionFormat & TextAlignFormat & HtmlAlignFormat & MarginFormat & PaddingFormat & LineHeightFormat & WhiteSpaceFormat & BorderFormat & TextIndentFormat;

@@ -0,1 +1,2 @@

import type { SizeFormat } from './formatParts/SizeFormat';
import type { ContentModelBlockFormat } from './ContentModelBlockFormat';

@@ -60,2 +61,6 @@ import type { ContentModelDividerFormat } from './ContentModelDividerFormat';

/**
* Format type for tableColumn
*/
tableColumn: SizeFormat;
/**
* Format type for table border

@@ -62,0 +67,0 @@ */

@@ -7,5 +7,6 @@ import type { DirectionFormat } from './formatParts/DirectionFormat';

import type { TextAlignFormat } from './formatParts/TextAlignFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
/**
* The format object for a list item in Content Model
*/
export declare type ContentModelListItemFormat = DirectionFormat & LineHeightFormat & MarginFormat & PaddingFormat & TextAlignFormat & ListStyleFormat;
export declare type ContentModelListItemFormat = DirectionFormat & LineHeightFormat & MarginFormat & PaddingFormat & TextAlignFormat & ListStyleFormat & TextIndentFormat;

@@ -30,2 +30,3 @@ import type { BackgroundColorFormat } from './formatParts/BackgroundColorFormat';

import type { TextColorFormat } from './formatParts/TextColorFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
import type { UnderlineFormat } from './formatParts/UnderlineFormat';

@@ -164,2 +165,6 @@ import type { VerticalAlignFormat } from './formatParts/VerticalAlignFormat';

/**
* Format for TextIndentFormat
*/
textIndent: TextIndentFormat;
/**
* Format for UnderlineFormat

@@ -166,0 +171,0 @@ */

@@ -25,2 +25,18 @@ /**

borderRadius?: string;
/**
* Radius to be applied in top left corner
*/
borderTopLeftRadius?: string;
/**
* Radius to be applied in top right corner
*/
borderTopRightRadius?: string;
/**
* Radius to be applied in bottom left corner
*/
borderBottomLeftRadius?: string;
/**
* Radius to be applied in bottom right corner
*/
borderBottomRightRadius?: string;
};

@@ -9,2 +9,6 @@ /**

borderCollapse?: boolean;
/**
* Whether borders of cells are separated
*/
borderSeparate?: boolean;
};

@@ -38,2 +38,3 @@ export { ContentModelSegmentFormat } from './format/ContentModelSegmentFormat';

export { TextAlignFormat } from './format/formatParts/TextAlignFormat';
export { TextIndentFormat } from './format/formatParts/TextIndentFormat';
export { WhiteSpaceFormat } from './format/formatParts/WhiteSpaceFormat';

@@ -97,4 +98,4 @@ export { DisplayFormat } from './format/formatParts/DisplayFormat';

export { TableSelectionCoordinates } from './selection/TableSelectionCoordinates';
export { ContentModelHandlerMap, DefaultImplicitFormatMap, FormatAppliers, FormatAppliersPerCategory, OnNodeCreated, ModelToDomSettings, FormatApplier, ApplyMetadata, MetadataApplier, MetadataAppliers, } from './context/ModelToDomSettings';
export { DefaultStyleMap, ElementProcessorMap, FormatParsers, FormatParsersPerCategory, DomToModelSettings, FormatParser, } from './context/DomToModelSettings';
export { ContentModelHandlerMap, DefaultImplicitFormatMap, FormatAppliers, FormatAppliersPerCategory, OnNodeCreated, ModelToDomSettings, FormatApplier, ApplyMetadata, MetadataApplier, MetadataAppliers, TextFormatApplier, ElementFormatAppliersPerCategory, } from './context/ModelToDomSettings';
export { DefaultStyleMap, ElementProcessorMap, FormatParsers, FormatParsersPerCategory, DomToModelSettings, FormatParser, TextFormatParser, ElementFormatParserPerCategory, } from './context/DomToModelSettings';
export { DomToModelContext } from './context/DomToModelContext';

@@ -114,3 +115,3 @@ export { ElementProcessor } from './context/ElementProcessor';

export { ArrayItemType, DefinitionBase, StringDefinition, NumberDefinition, BooleanDefinition, ArrayDefinition, ObjectPropertyDefinition, ObjectDefinition, Definition, } from './metadata/Definition';
export { ColorManager, Colors } from './context/ColorManager';
export { DarkColorHandler, Colors, ColorTransformFunction } from './context/DarkColorHandler';
export { IStandaloneEditor } from './editor/IStandaloneEditor';

@@ -120,4 +121,6 @@ export { StandaloneEditorOptions } from './editor/StandaloneEditorOptions';

export { StandaloneEditorCorePlugins } from './editor/StandaloneEditorCorePlugins';
export { EditorPlugin } from './editor/EditorPlugin';
export { PluginWithState } from './editor/PluginWithState';
export { ContextMenuProvider } from './editor/ContextMenuProvider';
export { ContentModelCachePluginState } from './pluginState/ContentModelCachePluginState';
export { StandaloneEditorCorePluginState } from './pluginState/StandaloneEditorPluginState';
export { ContentModelFormatPluginState, PendingFormat, } from './pluginState/ContentModelFormatPluginState';

@@ -130,2 +133,3 @@ export { CopyPastePluginState } from './pluginState/CopyPastePluginState';

export { UndoPluginState } from './pluginState/UndoPluginState';
export { PluginKey, KeyOfStatePlugin, TypeOfStatePlugin, StatePluginKeys, GenericPluginState, PluginState, } from './pluginState/PluginState';
export { EditorEnvironment } from './parameter/EditorEnvironment';

@@ -144,5 +148,27 @@ export { EntityState, DeletedEntity, FormatWithContentModelContext, } from './parameter/FormatWithContentModelContext';

export { ClipboardData } from './parameter/ClipboardData';
export { AnnounceData, KnownAnnounceStrings } from './parameter/AnnounceData';
export { TrustedHTMLHandler } from './parameter/TrustedHTMLHandler';
export { Rect } from './parameter/Rect';
export { ValueSanitizer } from './parameter/ValueSanitizer';
export { MergePastedContentFunc, DomToModelOptionForPaste, ContentModelBeforePasteEvent, ContentModelBeforePasteEventData, CompatibleContentModelBeforePasteEvent, } from './event/ContentModelBeforePasteEvent';
export { ContentModelContentChangedEvent, CompatibleContentModelContentChangedEvent, ContentModelContentChangedEventData, ChangedEntity, } from './event/ContentModelContentChangedEvent';
export { CompatibleContentModelSelectionChangedEvent, ContentModelSelectionChangedEvent, ContentModelSelectionChangedEventData, } from './event/ContentModelSelectionChangedEvent';
export { BasePluginEvent, BasePluginDomEvent } from './event/BasePluginEvent';
export { BeforeCutCopyEvent } from './event/BeforeCutCopyEvent';
export { BeforeDisposeEvent } from './event/BeforeDisposeEvent';
export { BeforeKeyboardEditingEvent } from './event/BeforeKeyboardEditingEvent';
export { BeforePasteEvent, DomToModelOptionForPaste, MergePastedContentFunc, } from './event/BeforePasteEvent';
export { BeforeSetContentEvent } from './event/BeforeSetContentEvent';
export { ContentChangedEvent, ChangedEntity } from './event/ContentChangedEvent';
export { ContextMenuEvent } from './event/ContextMenuEvent';
export { EditImageEvent } from './event/EditImageEvent';
export { EditorReadyEvent } from './event/EditorReadyEvent';
export { EntityOperationEvent, Entity } from './event/EntityOperationEvent';
export { ExtractContentWithDomEvent } from './event/ExtractContentWithDomEvent';
export { EditorInputEvent } from './event/EditorInputEvent';
export { KeyDownEvent, KeyPressEvent, KeyUpEvent, CompositionEndEvent, } from './event/KeyboardEvent';
export { MouseDownEvent, MouseUpEvent } from './event/MouseEvent';
export { PluginEvent } from './event/PluginEvent';
export { PluginEventData, PluginEventFromTypeGeneric, PluginEventFromType, PluginEventDataGeneric, } from './event/PluginEventData';
export { PluginEventType } from './event/PluginEventType';
export { ScrollEvent } from './event/ScrollEvent';
export { SelectionChangedEvent } from './event/SelectionChangedEvent';
export { EnterShadowEditEvent, LeaveShadowEditEvent } from './event/ShadowEditEvent';
export { ZoomChangedEvent } from './event/ZoomChangedEvent';

@@ -1,2 +0,2 @@

import type { PluginEventType } from 'roosterjs-editor-types';
import type { PluginEventType } from '../event/PluginEventType';
/**

@@ -3,0 +3,0 @@ * Handler function type of DOM event

import type { TableSelectionCoordinates } from '../selection/TableSelectionCoordinates';
import type { EntityState } from './FormatWithContentModelContext';
import type { ModeIndependentColor } from 'roosterjs-editor-types';
import type { SelectionType } from '../selection/DOMSelection';

@@ -55,6 +54,2 @@ /**

/**
* Known colors for dark mode
*/
knownColors: Readonly<ModeIndependentColor>[];
/**
* Entity states related to this undo snapshots. When undo/redo to this snapshot, each entity state will trigger

@@ -94,2 +89,6 @@ * an EntityOperation event with operation = EntityOperation.UpdateEntityState

/**
* An optional callback to be invoked when snapshots are changed
*/
onChanged?: (type: 'add' | 'move' | 'clear') => void;
/**
* Max size of all snapshots

@@ -96,0 +95,0 @@ */

@@ -1,2 +0,1 @@

import type { DarkColorHandler } from 'roosterjs-editor-types';
/**

@@ -14,6 +13,2 @@ * The state object for LifecyclePlugin

shadowEditFragment: DocumentFragment | null;
/**
* External content transform function to help do color transform for existing content
*/
onExternalContentTransform: ((element: HTMLElement, fromDarkMode: boolean, toDarkMode: boolean, darkColorHandler: DarkColorHandler) => void) | null;
}

@@ -0,1 +1,2 @@

import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { ContentModelFormatBase } from '../format/ContentModelFormatBase';

@@ -26,2 +27,9 @@ import type { ContentModelFormatMap } from '../format/ContentModelFormatMap';

/**
* Parse format from the given text node
* @param format The format object to parse into
* @param textNode The text node to parse format from
* @param context The context object that provide related context information
*/
export declare type TextFormatParser<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: DomToModelContext) => void;
/**
* All format parsers

@@ -33,8 +41,14 @@ */

/**
* A map from format parser category name to an array of parsers
* A map from format parser category name to an array of parsers. This is for HTML Element only
*/
export declare type FormatParsersPerCategory = {
export declare type ElementFormatParserPerCategory = {
[Key in keyof ContentModelFormatMap]: (FormatParser<ContentModelFormatMap[Key]> | null)[];
};
/**
* A map from format parser category name to an array of parsers
*/
export declare type FormatParsersPerCategory = ElementFormatParserPerCategory & {
text: TextFormatParser[];
};
/**
* A map from element processor name to its processor type

@@ -41,0 +55,0 @@ */

@@ -1,4 +0,5 @@

import type { ColorManager } from './ColorManager';
import type { DarkColorHandler } from './DarkColorHandler';
import type { ContentModelDomIndexer } from './ContentModelDomIndexer';
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { PendingFormat } from '../pluginState/ContentModelFormatPluginState';
/**

@@ -17,5 +18,9 @@ * An editor context interface used by ContentModel PAI

/**
* Pending format if any
*/
pendingFormat?: PendingFormat;
/**
* Color manager, to help manager color in dark mode
*/
darkColorHandler?: ColorManager;
darkColorHandler?: DarkColorHandler;
/**

@@ -22,0 +27,0 @@ * Whether to handle delimiters in Content Model

@@ -40,2 +40,9 @@ import type { Definition } from '../metadata/Definition';

/**
* Apply format to the given text node
* @param format The format object to apply
* @param textNode The text node to apply format to
* @param context The context object that provide related context information
*/
export declare type TextFormatApplier<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: ModelToDomContext) => void;
/**
* All format appliers

@@ -47,8 +54,14 @@ */

/**
* A map from format parser category name to an array of parsers
* A map from format parser category name to an array of parsers. This is for HTMLElement only
*/
export declare type FormatAppliersPerCategory = {
export declare type ElementFormatAppliersPerCategory = {
[Key in keyof ContentModelFormatMap]: (FormatApplier<ContentModelFormatMap[Key]> | null)[];
};
/**
* A map from format parser category name to an array of parsers
*/
export declare type FormatAppliersPerCategory = ElementFormatAppliersPerCategory & {
text: TextFormatApplier[];
};
/**
* Represents a map from content model handler name to its handle type

@@ -55,0 +68,0 @@ */

@@ -0,1 +1,3 @@

import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';
import type { PluginEventType } from '../event/PluginEventType';
import type { PasteType } from '../enum/PasteType';

@@ -6,3 +8,2 @@ import type { ClipboardData } from '../parameter/ClipboardData';

import type { Snapshot } from '../parameter/Snapshot';
import type { CompatiblePluginEventType } from 'roosterjs-editor-types/lib/compatibleTypes';
import type { ContentModelDocument } from '../group/ContentModelDocument';

@@ -16,3 +17,4 @@ import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';

import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';
import type { DarkColorHandler, PluginEventData, PluginEventFromType, PluginEventType } from 'roosterjs-editor-types';
import type { DarkColorHandler } from '../context/DarkColorHandler';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
/**

@@ -89,3 +91,3 @@ * An interface of standalone Content Model editor.

*/
triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
triggerEvent<T extends PluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
/**

@@ -113,5 +115,11 @@ * Get undo snapshots manager

/**
* Set current zoom scale, default value is 1
* When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale
* to let editor behave correctly especially for those mouse drag/drop behaviors
*/
setZoomScale(scale: number): void;
/**
* Add a single undo snapshot to undo stack
*/
takeSnapshot(): void;
takeSnapshot(): Snapshot | null;
/**

@@ -163,3 +171,3 @@ * Restore an undo snapshot into editor

*/
getDarkColorHandler(): DarkColorHandler;
getColorManager(): DarkColorHandler;
/**

@@ -174,2 +182,9 @@ * Dispose this editor, dispose all plugins and custom data

hasFocus(): boolean;
/**
* Get a function to convert HTML string to trusted HTML string.
* By default it will just return the input HTML directly. To override this behavior,
* pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types
*/
getTrustedHTMLHandler(): TrustedHTMLHandler;
}

@@ -0,1 +1,4 @@

import type { PluginEvent } from '../event/PluginEvent';
import type { PluginState } from '../pluginState/PluginState';
import type { EditorPlugin } from './EditorPlugin';
import type { ClipboardData } from '../parameter/ClipboardData';

@@ -6,5 +9,4 @@ import type { PasteType } from '../enum/PasteType';

import type { EntityState } from '../parameter/FormatWithContentModelContext';
import type { DarkColorHandler, EditorPlugin, PluginEvent, Rect, TrustedHTMLHandler } from 'roosterjs-editor-types';
import type { DarkColorHandler } from '../context/DarkColorHandler';
import type { ContentModelDocument } from '../group/ContentModelDocument';
import type { StandaloneEditorCorePluginState } from '../pluginState/StandaloneEditorPluginState';
import type { DOMSelection } from '../selection/DOMSelection';

@@ -17,2 +19,4 @@ import type { DomToModelOption } from '../context/DomToModelOption';

import type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
import type { Rect } from '../parameter/Rect';
import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';

@@ -82,3 +86,3 @@ /**

*/
export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => void;
export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => Snapshot | null;
/**

@@ -225,3 +229,3 @@ * Retrieves the rect of the visible viewport of the editor.

*/
export interface StandaloneEditorCore extends StandaloneEditorCorePluginState {
export interface StandaloneEditorCore extends PluginState {
/**

@@ -228,0 +232,0 @@ * The content DIV element of this editor

@@ -0,1 +1,2 @@

import type { PluginWithState } from './PluginWithState';
import type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';

@@ -9,3 +10,2 @@ import type { UndoPluginState } from '../pluginState/UndoPluginState';

import type { ContentModelFormatPluginState } from '../pluginState/ContentModelFormatPluginState';
import type { PluginWithState } from 'roosterjs-editor-types';
/**

@@ -12,0 +12,0 @@ * Core plugins for standalone editor

@@ -0,8 +1,10 @@

import type { Colors, ColorTransformFunction } from '../context/DarkColorHandler';
import type { EditorPlugin } from './EditorPlugin';
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { StandaloneCoreApiMap } from './StandaloneEditorCore';
import type { EditorPlugin, TrustedHTMLHandler } from 'roosterjs-editor-types';
import type { DomToModelOption } from '../context/DomToModelOption';
import type { ModelToDomOption } from '../context/ModelToDomOption';
import type { ContentModelDocument } from '../group/ContentModelDocument';
import type { SnapshotsManager } from '../parameter/SnapshotsManager';
import type { Snapshots } from '../parameter/Snapshot';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
/**

@@ -51,4 +53,8 @@ * Options for Content Model editor

*/
getDarkColor?: (lightColor: string) => string;
getDarkColor?: ColorTransformFunction;
/**
* Existing known color pairs
*/
knownColors?: Record<string, Colors>;
/**
* Customized trusted type handler used for sanitizing HTML string before assign to DOM tree

@@ -81,6 +87,5 @@ * This is required when trusted-type Content-Security-Policy (CSP) is enabled.

/**
* Undo snapshot service based on content metadata. Use this parameter to customize the undo snapshot service.
* When this property is set, value of undoSnapshotService will be ignored.
* Undo snapshot. Use this parameter to provide an external storage of undo snapshots
*/
snapshotsManager?: SnapshotsManager;
snapshots?: Snapshots;
/**

@@ -87,0 +92,0 @@ * A callback to be invoked when any exception is thrown during disposing editor

@@ -9,2 +9,3 @@ import type { BackgroundColorFormat } from './formatParts/BackgroundColorFormat';

import type { TextAlignFormat } from './formatParts/TextAlignFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
import type { WhiteSpaceFormat } from './formatParts/WhiteSpaceFormat';

@@ -14,2 +15,2 @@ /**

*/
export declare type ContentModelBlockFormat = BackgroundColorFormat & DirectionFormat & TextAlignFormat & HtmlAlignFormat & MarginFormat & PaddingFormat & LineHeightFormat & WhiteSpaceFormat & BorderFormat;
export declare type ContentModelBlockFormat = BackgroundColorFormat & DirectionFormat & TextAlignFormat & HtmlAlignFormat & MarginFormat & PaddingFormat & LineHeightFormat & WhiteSpaceFormat & BorderFormat & TextIndentFormat;

@@ -0,1 +1,2 @@

import type { SizeFormat } from './formatParts/SizeFormat';
import type { ContentModelBlockFormat } from './ContentModelBlockFormat';

@@ -60,2 +61,6 @@ import type { ContentModelDividerFormat } from './ContentModelDividerFormat';

/**
* Format type for tableColumn
*/
tableColumn: SizeFormat;
/**
* Format type for table border

@@ -62,0 +67,0 @@ */

@@ -7,5 +7,6 @@ import type { DirectionFormat } from './formatParts/DirectionFormat';

import type { TextAlignFormat } from './formatParts/TextAlignFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
/**
* The format object for a list item in Content Model
*/
export declare type ContentModelListItemFormat = DirectionFormat & LineHeightFormat & MarginFormat & PaddingFormat & TextAlignFormat & ListStyleFormat;
export declare type ContentModelListItemFormat = DirectionFormat & LineHeightFormat & MarginFormat & PaddingFormat & TextAlignFormat & ListStyleFormat & TextIndentFormat;

@@ -30,2 +30,3 @@ import type { BackgroundColorFormat } from './formatParts/BackgroundColorFormat';

import type { TextColorFormat } from './formatParts/TextColorFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
import type { UnderlineFormat } from './formatParts/UnderlineFormat';

@@ -164,2 +165,6 @@ import type { VerticalAlignFormat } from './formatParts/VerticalAlignFormat';

/**
* Format for TextIndentFormat
*/
textIndent: TextIndentFormat;
/**
* Format for UnderlineFormat

@@ -166,0 +171,0 @@ */

@@ -25,2 +25,18 @@ /**

borderRadius?: string;
/**
* Radius to be applied in top left corner
*/
borderTopLeftRadius?: string;
/**
* Radius to be applied in top right corner
*/
borderTopRightRadius?: string;
/**
* Radius to be applied in bottom left corner
*/
borderBottomLeftRadius?: string;
/**
* Radius to be applied in bottom right corner
*/
borderBottomRightRadius?: string;
};

@@ -9,2 +9,6 @@ /**

borderCollapse?: boolean;
/**
* Whether borders of cells are separated
*/
borderSeparate?: boolean;
};

@@ -38,2 +38,3 @@ export { ContentModelSegmentFormat } from './format/ContentModelSegmentFormat';

export { TextAlignFormat } from './format/formatParts/TextAlignFormat';
export { TextIndentFormat } from './format/formatParts/TextIndentFormat';
export { WhiteSpaceFormat } from './format/formatParts/WhiteSpaceFormat';

@@ -97,4 +98,4 @@ export { DisplayFormat } from './format/formatParts/DisplayFormat';

export { TableSelectionCoordinates } from './selection/TableSelectionCoordinates';
export { ContentModelHandlerMap, DefaultImplicitFormatMap, FormatAppliers, FormatAppliersPerCategory, OnNodeCreated, ModelToDomSettings, FormatApplier, ApplyMetadata, MetadataApplier, MetadataAppliers, } from './context/ModelToDomSettings';
export { DefaultStyleMap, ElementProcessorMap, FormatParsers, FormatParsersPerCategory, DomToModelSettings, FormatParser, } from './context/DomToModelSettings';
export { ContentModelHandlerMap, DefaultImplicitFormatMap, FormatAppliers, FormatAppliersPerCategory, OnNodeCreated, ModelToDomSettings, FormatApplier, ApplyMetadata, MetadataApplier, MetadataAppliers, TextFormatApplier, ElementFormatAppliersPerCategory, } from './context/ModelToDomSettings';
export { DefaultStyleMap, ElementProcessorMap, FormatParsers, FormatParsersPerCategory, DomToModelSettings, FormatParser, TextFormatParser, ElementFormatParserPerCategory, } from './context/DomToModelSettings';
export { DomToModelContext } from './context/DomToModelContext';

@@ -114,3 +115,3 @@ export { ElementProcessor } from './context/ElementProcessor';

export { ArrayItemType, DefinitionBase, StringDefinition, NumberDefinition, BooleanDefinition, ArrayDefinition, ObjectPropertyDefinition, ObjectDefinition, Definition, } from './metadata/Definition';
export { ColorManager, Colors } from './context/ColorManager';
export { DarkColorHandler, Colors, ColorTransformFunction } from './context/DarkColorHandler';
export { IStandaloneEditor } from './editor/IStandaloneEditor';

@@ -120,4 +121,6 @@ export { StandaloneEditorOptions } from './editor/StandaloneEditorOptions';

export { StandaloneEditorCorePlugins } from './editor/StandaloneEditorCorePlugins';
export { EditorPlugin } from './editor/EditorPlugin';
export { PluginWithState } from './editor/PluginWithState';
export { ContextMenuProvider } from './editor/ContextMenuProvider';
export { ContentModelCachePluginState } from './pluginState/ContentModelCachePluginState';
export { StandaloneEditorCorePluginState } from './pluginState/StandaloneEditorPluginState';
export { ContentModelFormatPluginState, PendingFormat, } from './pluginState/ContentModelFormatPluginState';

@@ -130,2 +133,3 @@ export { CopyPastePluginState } from './pluginState/CopyPastePluginState';

export { UndoPluginState } from './pluginState/UndoPluginState';
export { PluginKey, KeyOfStatePlugin, TypeOfStatePlugin, StatePluginKeys, GenericPluginState, PluginState, } from './pluginState/PluginState';
export { EditorEnvironment } from './parameter/EditorEnvironment';

@@ -144,5 +148,27 @@ export { EntityState, DeletedEntity, FormatWithContentModelContext, } from './parameter/FormatWithContentModelContext';

export { ClipboardData } from './parameter/ClipboardData';
export { AnnounceData, KnownAnnounceStrings } from './parameter/AnnounceData';
export { TrustedHTMLHandler } from './parameter/TrustedHTMLHandler';
export { Rect } from './parameter/Rect';
export { ValueSanitizer } from './parameter/ValueSanitizer';
export { MergePastedContentFunc, DomToModelOptionForPaste, ContentModelBeforePasteEvent, ContentModelBeforePasteEventData, CompatibleContentModelBeforePasteEvent, } from './event/ContentModelBeforePasteEvent';
export { ContentModelContentChangedEvent, CompatibleContentModelContentChangedEvent, ContentModelContentChangedEventData, ChangedEntity, } from './event/ContentModelContentChangedEvent';
export { CompatibleContentModelSelectionChangedEvent, ContentModelSelectionChangedEvent, ContentModelSelectionChangedEventData, } from './event/ContentModelSelectionChangedEvent';
export { BasePluginEvent, BasePluginDomEvent } from './event/BasePluginEvent';
export { BeforeCutCopyEvent } from './event/BeforeCutCopyEvent';
export { BeforeDisposeEvent } from './event/BeforeDisposeEvent';
export { BeforeKeyboardEditingEvent } from './event/BeforeKeyboardEditingEvent';
export { BeforePasteEvent, DomToModelOptionForPaste, MergePastedContentFunc, } from './event/BeforePasteEvent';
export { BeforeSetContentEvent } from './event/BeforeSetContentEvent';
export { ContentChangedEvent, ChangedEntity } from './event/ContentChangedEvent';
export { ContextMenuEvent } from './event/ContextMenuEvent';
export { EditImageEvent } from './event/EditImageEvent';
export { EditorReadyEvent } from './event/EditorReadyEvent';
export { EntityOperationEvent, Entity } from './event/EntityOperationEvent';
export { ExtractContentWithDomEvent } from './event/ExtractContentWithDomEvent';
export { EditorInputEvent } from './event/EditorInputEvent';
export { KeyDownEvent, KeyPressEvent, KeyUpEvent, CompositionEndEvent, } from './event/KeyboardEvent';
export { MouseDownEvent, MouseUpEvent } from './event/MouseEvent';
export { PluginEvent } from './event/PluginEvent';
export { PluginEventData, PluginEventFromTypeGeneric, PluginEventFromType, PluginEventDataGeneric, } from './event/PluginEventData';
export { PluginEventType } from './event/PluginEventType';
export { ScrollEvent } from './event/ScrollEvent';
export { SelectionChangedEvent } from './event/SelectionChangedEvent';
export { EnterShadowEditEvent, LeaveShadowEditEvent } from './event/ShadowEditEvent';
export { ZoomChangedEvent } from './event/ZoomChangedEvent';

@@ -1,2 +0,2 @@

import type { PluginEventType } from 'roosterjs-editor-types';
import type { PluginEventType } from '../event/PluginEventType';
/**

@@ -3,0 +3,0 @@ * Handler function type of DOM event

import type { TableSelectionCoordinates } from '../selection/TableSelectionCoordinates';
import type { EntityState } from './FormatWithContentModelContext';
import type { ModeIndependentColor } from 'roosterjs-editor-types';
import type { SelectionType } from '../selection/DOMSelection';

@@ -55,6 +54,2 @@ /**

/**
* Known colors for dark mode
*/
knownColors: Readonly<ModeIndependentColor>[];
/**
* Entity states related to this undo snapshots. When undo/redo to this snapshot, each entity state will trigger

@@ -94,2 +89,6 @@ * an EntityOperation event with operation = EntityOperation.UpdateEntityState

/**
* An optional callback to be invoked when snapshots are changed
*/
onChanged?: (type: 'add' | 'move' | 'clear') => void;
/**
* Max size of all snapshots

@@ -96,0 +95,0 @@ */

@@ -1,2 +0,1 @@

import type { DarkColorHandler } from 'roosterjs-editor-types';
/**

@@ -14,6 +13,2 @@ * The state object for LifecyclePlugin

shadowEditFragment: DocumentFragment | null;
/**
* External content transform function to help do color transform for existing content
*/
onExternalContentTransform: ((element: HTMLElement, fromDarkMode: boolean, toDarkMode: boolean, darkColorHandler: DarkColorHandler) => void) | null;
}

@@ -0,1 +1,2 @@

import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { ContentModelFormatBase } from '../format/ContentModelFormatBase';

@@ -26,2 +27,9 @@ import type { ContentModelFormatMap } from '../format/ContentModelFormatMap';

/**
* Parse format from the given text node
* @param format The format object to parse into
* @param textNode The text node to parse format from
* @param context The context object that provide related context information
*/
export declare type TextFormatParser<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: DomToModelContext) => void;
/**
* All format parsers

@@ -33,8 +41,14 @@ */

/**
* A map from format parser category name to an array of parsers
* A map from format parser category name to an array of parsers. This is for HTML Element only
*/
export declare type FormatParsersPerCategory = {
export declare type ElementFormatParserPerCategory = {
[Key in keyof ContentModelFormatMap]: (FormatParser<ContentModelFormatMap[Key]> | null)[];
};
/**
* A map from format parser category name to an array of parsers
*/
export declare type FormatParsersPerCategory = ElementFormatParserPerCategory & {
text: TextFormatParser[];
};
/**
* A map from element processor name to its processor type

@@ -41,0 +55,0 @@ */

@@ -1,4 +0,5 @@

import type { ColorManager } from './ColorManager';
import type { DarkColorHandler } from './DarkColorHandler';
import type { ContentModelDomIndexer } from './ContentModelDomIndexer';
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { PendingFormat } from '../pluginState/ContentModelFormatPluginState';
/**

@@ -17,5 +18,9 @@ * An editor context interface used by ContentModel PAI

/**
* Pending format if any
*/
pendingFormat?: PendingFormat;
/**
* Color manager, to help manager color in dark mode
*/
darkColorHandler?: ColorManager;
darkColorHandler?: DarkColorHandler;
/**

@@ -22,0 +27,0 @@ * Whether to handle delimiters in Content Model

@@ -40,2 +40,9 @@ import type { Definition } from '../metadata/Definition';

/**
* Apply format to the given text node
* @param format The format object to apply
* @param textNode The text node to apply format to
* @param context The context object that provide related context information
*/
export declare type TextFormatApplier<TFormat extends ContentModelSegmentFormat = ContentModelSegmentFormat> = (format: TFormat, textNode: Text, context: ModelToDomContext) => void;
/**
* All format appliers

@@ -47,8 +54,14 @@ */

/**
* A map from format parser category name to an array of parsers
* A map from format parser category name to an array of parsers. This is for HTMLElement only
*/
export declare type FormatAppliersPerCategory = {
export declare type ElementFormatAppliersPerCategory = {
[Key in keyof ContentModelFormatMap]: (FormatApplier<ContentModelFormatMap[Key]> | null)[];
};
/**
* A map from format parser category name to an array of parsers
*/
export declare type FormatAppliersPerCategory = ElementFormatAppliersPerCategory & {
text: TextFormatApplier[];
};
/**
* Represents a map from content model handler name to its handle type

@@ -55,0 +68,0 @@ */

@@ -0,1 +1,3 @@

import type { PluginEventData, PluginEventFromType } from '../event/PluginEventData';
import type { PluginEventType } from '../event/PluginEventType';
import type { PasteType } from '../enum/PasteType';

@@ -6,3 +8,2 @@ import type { ClipboardData } from '../parameter/ClipboardData';

import type { Snapshot } from '../parameter/Snapshot';
import type { CompatiblePluginEventType } from 'roosterjs-editor-types/lib/compatibleTypes';
import type { ContentModelDocument } from '../group/ContentModelDocument';

@@ -16,3 +17,4 @@ import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';

import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';
import type { DarkColorHandler, PluginEventData, PluginEventFromType, PluginEventType } from 'roosterjs-editor-types';
import type { DarkColorHandler } from '../context/DarkColorHandler';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
/**

@@ -89,3 +91,3 @@ * An interface of standalone Content Model editor.

*/
triggerPluginEvent<T extends PluginEventType | CompatiblePluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
triggerEvent<T extends PluginEventType>(eventType: T, data: PluginEventData<T>, broadcast?: boolean): PluginEventFromType<T>;
/**

@@ -113,5 +115,11 @@ * Get undo snapshots manager

/**
* Set current zoom scale, default value is 1
* When editor is put under a zoomed container, need to pass the zoom scale number using EditorOptions.zoomScale
* to let editor behave correctly especially for those mouse drag/drop behaviors
*/
setZoomScale(scale: number): void;
/**
* Add a single undo snapshot to undo stack
*/
takeSnapshot(): void;
takeSnapshot(): Snapshot | null;
/**

@@ -163,3 +171,3 @@ * Restore an undo snapshot into editor

*/
getDarkColorHandler(): DarkColorHandler;
getColorManager(): DarkColorHandler;
/**

@@ -174,2 +182,9 @@ * Dispose this editor, dispose all plugins and custom data

hasFocus(): boolean;
/**
* Get a function to convert HTML string to trusted HTML string.
* By default it will just return the input HTML directly. To override this behavior,
* pass your own trusted HTML handler to EditorOptions.trustedHTMLHandler
* See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy/trusted-types
*/
getTrustedHTMLHandler(): TrustedHTMLHandler;
}

@@ -0,1 +1,4 @@

import type { PluginEvent } from '../event/PluginEvent';
import type { PluginState } from '../pluginState/PluginState';
import type { EditorPlugin } from './EditorPlugin';
import type { ClipboardData } from '../parameter/ClipboardData';

@@ -6,5 +9,4 @@ import type { PasteType } from '../enum/PasteType';

import type { EntityState } from '../parameter/FormatWithContentModelContext';
import type { DarkColorHandler, EditorPlugin, PluginEvent, Rect, TrustedHTMLHandler } from 'roosterjs-editor-types';
import type { DarkColorHandler } from '../context/DarkColorHandler';
import type { ContentModelDocument } from '../group/ContentModelDocument';
import type { StandaloneEditorCorePluginState } from '../pluginState/StandaloneEditorPluginState';
import type { DOMSelection } from '../selection/DOMSelection';

@@ -17,2 +19,4 @@ import type { DomToModelOption } from '../context/DomToModelOption';

import type { ModelToDomSettings, OnNodeCreated } from '../context/ModelToDomSettings';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
import type { Rect } from '../parameter/Rect';
import type { ContentModelFormatter, FormatWithContentModelOptions } from '../parameter/FormatWithContentModelOptions';

@@ -82,3 +86,3 @@ /**

*/
export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => void;
export declare type AddUndoSnapshot = (core: StandaloneEditorCore, canUndoByBackspace: boolean, entityStates?: EntityState[]) => Snapshot | null;
/**

@@ -225,3 +229,3 @@ * Retrieves the rect of the visible viewport of the editor.

*/
export interface StandaloneEditorCore extends StandaloneEditorCorePluginState {
export interface StandaloneEditorCore extends PluginState {
/**

@@ -228,0 +232,0 @@ * The content DIV element of this editor

@@ -0,1 +1,2 @@

import type { PluginWithState } from './PluginWithState';
import type { CopyPastePluginState } from '../pluginState/CopyPastePluginState';

@@ -9,3 +10,2 @@ import type { UndoPluginState } from '../pluginState/UndoPluginState';

import type { ContentModelFormatPluginState } from '../pluginState/ContentModelFormatPluginState';
import type { PluginWithState } from 'roosterjs-editor-types';
/**

@@ -12,0 +12,0 @@ * Core plugins for standalone editor

@@ -0,8 +1,10 @@

import type { Colors, ColorTransformFunction } from '../context/DarkColorHandler';
import type { EditorPlugin } from './EditorPlugin';
import type { ContentModelSegmentFormat } from '../format/ContentModelSegmentFormat';
import type { StandaloneCoreApiMap } from './StandaloneEditorCore';
import type { EditorPlugin, TrustedHTMLHandler } from 'roosterjs-editor-types';
import type { DomToModelOption } from '../context/DomToModelOption';
import type { ModelToDomOption } from '../context/ModelToDomOption';
import type { ContentModelDocument } from '../group/ContentModelDocument';
import type { SnapshotsManager } from '../parameter/SnapshotsManager';
import type { Snapshots } from '../parameter/Snapshot';
import type { TrustedHTMLHandler } from '../parameter/TrustedHTMLHandler';
/**

@@ -51,4 +53,8 @@ * Options for Content Model editor

*/
getDarkColor?: (lightColor: string) => string;
getDarkColor?: ColorTransformFunction;
/**
* Existing known color pairs
*/
knownColors?: Record<string, Colors>;
/**
* Customized trusted type handler used for sanitizing HTML string before assign to DOM tree

@@ -81,6 +87,5 @@ * This is required when trusted-type Content-Security-Policy (CSP) is enabled.

/**
* Undo snapshot service based on content metadata. Use this parameter to customize the undo snapshot service.
* When this property is set, value of undoSnapshotService will be ignored.
* Undo snapshot. Use this parameter to provide an external storage of undo snapshots
*/
snapshotsManager?: SnapshotsManager;
snapshots?: Snapshots;
/**

@@ -87,0 +92,0 @@ * A callback to be invoked when any exception is thrown during disposing editor

@@ -9,2 +9,3 @@ import type { BackgroundColorFormat } from './formatParts/BackgroundColorFormat';

import type { TextAlignFormat } from './formatParts/TextAlignFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
import type { WhiteSpaceFormat } from './formatParts/WhiteSpaceFormat';

@@ -14,2 +15,2 @@ /**

*/
export declare type ContentModelBlockFormat = BackgroundColorFormat & DirectionFormat & TextAlignFormat & HtmlAlignFormat & MarginFormat & PaddingFormat & LineHeightFormat & WhiteSpaceFormat & BorderFormat;
export declare type ContentModelBlockFormat = BackgroundColorFormat & DirectionFormat & TextAlignFormat & HtmlAlignFormat & MarginFormat & PaddingFormat & LineHeightFormat & WhiteSpaceFormat & BorderFormat & TextIndentFormat;

@@ -0,1 +1,2 @@

import type { SizeFormat } from './formatParts/SizeFormat';
import type { ContentModelBlockFormat } from './ContentModelBlockFormat';

@@ -60,2 +61,6 @@ import type { ContentModelDividerFormat } from './ContentModelDividerFormat';

/**
* Format type for tableColumn
*/
tableColumn: SizeFormat;
/**
* Format type for table border

@@ -62,0 +67,0 @@ */

@@ -7,5 +7,6 @@ import type { DirectionFormat } from './formatParts/DirectionFormat';

import type { TextAlignFormat } from './formatParts/TextAlignFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
/**
* The format object for a list item in Content Model
*/
export declare type ContentModelListItemFormat = DirectionFormat & LineHeightFormat & MarginFormat & PaddingFormat & TextAlignFormat & ListStyleFormat;
export declare type ContentModelListItemFormat = DirectionFormat & LineHeightFormat & MarginFormat & PaddingFormat & TextAlignFormat & ListStyleFormat & TextIndentFormat;

@@ -30,2 +30,3 @@ import type { BackgroundColorFormat } from './formatParts/BackgroundColorFormat';

import type { TextColorFormat } from './formatParts/TextColorFormat';
import type { TextIndentFormat } from './formatParts/TextIndentFormat';
import type { UnderlineFormat } from './formatParts/UnderlineFormat';

@@ -164,2 +165,6 @@ import type { VerticalAlignFormat } from './formatParts/VerticalAlignFormat';

/**
* Format for TextIndentFormat
*/
textIndent: TextIndentFormat;
/**
* Format for UnderlineFormat

@@ -166,0 +171,0 @@ */

@@ -25,2 +25,18 @@ /**

borderRadius?: string;
/**
* Radius to be applied in top left corner
*/
borderTopLeftRadius?: string;
/**
* Radius to be applied in top right corner
*/
borderTopRightRadius?: string;
/**
* Radius to be applied in bottom left corner
*/
borderBottomLeftRadius?: string;
/**
* Radius to be applied in bottom right corner
*/
borderBottomRightRadius?: string;
};

@@ -9,2 +9,6 @@ /**

borderCollapse?: boolean;
/**
* Whether borders of cells are separated
*/
borderSeparate?: boolean;
};

@@ -38,2 +38,3 @@ export { ContentModelSegmentFormat } from './format/ContentModelSegmentFormat';

export { TextAlignFormat } from './format/formatParts/TextAlignFormat';
export { TextIndentFormat } from './format/formatParts/TextIndentFormat';
export { WhiteSpaceFormat } from './format/formatParts/WhiteSpaceFormat';

@@ -97,4 +98,4 @@ export { DisplayFormat } from './format/formatParts/DisplayFormat';

export { TableSelectionCoordinates } from './selection/TableSelectionCoordinates';
export { ContentModelHandlerMap, DefaultImplicitFormatMap, FormatAppliers, FormatAppliersPerCategory, OnNodeCreated, ModelToDomSettings, FormatApplier, ApplyMetadata, MetadataApplier, MetadataAppliers, } from './context/ModelToDomSettings';
export { DefaultStyleMap, ElementProcessorMap, FormatParsers, FormatParsersPerCategory, DomToModelSettings, FormatParser, } from './context/DomToModelSettings';
export { ContentModelHandlerMap, DefaultImplicitFormatMap, FormatAppliers, FormatAppliersPerCategory, OnNodeCreated, ModelToDomSettings, FormatApplier, ApplyMetadata, MetadataApplier, MetadataAppliers, TextFormatApplier, ElementFormatAppliersPerCategory, } from './context/ModelToDomSettings';
export { DefaultStyleMap, ElementProcessorMap, FormatParsers, FormatParsersPerCategory, DomToModelSettings, FormatParser, TextFormatParser, ElementFormatParserPerCategory, } from './context/DomToModelSettings';
export { DomToModelContext } from './context/DomToModelContext';

@@ -114,3 +115,3 @@ export { ElementProcessor } from './context/ElementProcessor';

export { ArrayItemType, DefinitionBase, StringDefinition, NumberDefinition, BooleanDefinition, ArrayDefinition, ObjectPropertyDefinition, ObjectDefinition, Definition, } from './metadata/Definition';
export { ColorManager, Colors } from './context/ColorManager';
export { DarkColorHandler, Colors, ColorTransformFunction } from './context/DarkColorHandler';
export { IStandaloneEditor } from './editor/IStandaloneEditor';

@@ -120,4 +121,6 @@ export { StandaloneEditorOptions } from './editor/StandaloneEditorOptions';

export { StandaloneEditorCorePlugins } from './editor/StandaloneEditorCorePlugins';
export { EditorPlugin } from './editor/EditorPlugin';
export { PluginWithState } from './editor/PluginWithState';
export { ContextMenuProvider } from './editor/ContextMenuProvider';
export { ContentModelCachePluginState } from './pluginState/ContentModelCachePluginState';
export { StandaloneEditorCorePluginState } from './pluginState/StandaloneEditorPluginState';
export { ContentModelFormatPluginState, PendingFormat, } from './pluginState/ContentModelFormatPluginState';

@@ -130,2 +133,3 @@ export { CopyPastePluginState } from './pluginState/CopyPastePluginState';

export { UndoPluginState } from './pluginState/UndoPluginState';
export { PluginKey, KeyOfStatePlugin, TypeOfStatePlugin, StatePluginKeys, GenericPluginState, PluginState, } from './pluginState/PluginState';
export { EditorEnvironment } from './parameter/EditorEnvironment';

@@ -144,5 +148,27 @@ export { EntityState, DeletedEntity, FormatWithContentModelContext, } from './parameter/FormatWithContentModelContext';

export { ClipboardData } from './parameter/ClipboardData';
export { AnnounceData, KnownAnnounceStrings } from './parameter/AnnounceData';
export { TrustedHTMLHandler } from './parameter/TrustedHTMLHandler';
export { Rect } from './parameter/Rect';
export { ValueSanitizer } from './parameter/ValueSanitizer';
export { MergePastedContentFunc, DomToModelOptionForPaste, ContentModelBeforePasteEvent, ContentModelBeforePasteEventData, CompatibleContentModelBeforePasteEvent, } from './event/ContentModelBeforePasteEvent';
export { ContentModelContentChangedEvent, CompatibleContentModelContentChangedEvent, ContentModelContentChangedEventData, ChangedEntity, } from './event/ContentModelContentChangedEvent';
export { CompatibleContentModelSelectionChangedEvent, ContentModelSelectionChangedEvent, ContentModelSelectionChangedEventData, } from './event/ContentModelSelectionChangedEvent';
export { BasePluginEvent, BasePluginDomEvent } from './event/BasePluginEvent';
export { BeforeCutCopyEvent } from './event/BeforeCutCopyEvent';
export { BeforeDisposeEvent } from './event/BeforeDisposeEvent';
export { BeforeKeyboardEditingEvent } from './event/BeforeKeyboardEditingEvent';
export { BeforePasteEvent, DomToModelOptionForPaste, MergePastedContentFunc, } from './event/BeforePasteEvent';
export { BeforeSetContentEvent } from './event/BeforeSetContentEvent';
export { ContentChangedEvent, ChangedEntity } from './event/ContentChangedEvent';
export { ContextMenuEvent } from './event/ContextMenuEvent';
export { EditImageEvent } from './event/EditImageEvent';
export { EditorReadyEvent } from './event/EditorReadyEvent';
export { EntityOperationEvent, Entity } from './event/EntityOperationEvent';
export { ExtractContentWithDomEvent } from './event/ExtractContentWithDomEvent';
export { EditorInputEvent } from './event/EditorInputEvent';
export { KeyDownEvent, KeyPressEvent, KeyUpEvent, CompositionEndEvent, } from './event/KeyboardEvent';
export { MouseDownEvent, MouseUpEvent } from './event/MouseEvent';
export { PluginEvent } from './event/PluginEvent';
export { PluginEventData, PluginEventFromTypeGeneric, PluginEventFromType, PluginEventDataGeneric, } from './event/PluginEventData';
export { PluginEventType } from './event/PluginEventType';
export { ScrollEvent } from './event/ScrollEvent';
export { SelectionChangedEvent } from './event/SelectionChangedEvent';
export { EnterShadowEditEvent, LeaveShadowEditEvent } from './event/ShadowEditEvent';
export { ZoomChangedEvent } from './event/ZoomChangedEvent';

@@ -1,2 +0,2 @@

import type { PluginEventType } from 'roosterjs-editor-types';
import type { PluginEventType } from '../event/PluginEventType';
/**

@@ -3,0 +3,0 @@ * Handler function type of DOM event

import type { TableSelectionCoordinates } from '../selection/TableSelectionCoordinates';
import type { EntityState } from './FormatWithContentModelContext';
import type { ModeIndependentColor } from 'roosterjs-editor-types';
import type { SelectionType } from '../selection/DOMSelection';

@@ -55,6 +54,2 @@ /**

/**
* Known colors for dark mode
*/
knownColors: Readonly<ModeIndependentColor>[];
/**
* Entity states related to this undo snapshots. When undo/redo to this snapshot, each entity state will trigger

@@ -94,2 +89,6 @@ * an EntityOperation event with operation = EntityOperation.UpdateEntityState

/**
* An optional callback to be invoked when snapshots are changed
*/
onChanged?: (type: 'add' | 'move' | 'clear') => void;
/**
* Max size of all snapshots

@@ -96,0 +95,0 @@ */

@@ -1,2 +0,1 @@

import type { DarkColorHandler } from 'roosterjs-editor-types';
/**

@@ -14,6 +13,2 @@ * The state object for LifecyclePlugin

shadowEditFragment: DocumentFragment | null;
/**
* External content transform function to help do color transform for existing content
*/
onExternalContentTransform: ((element: HTMLElement, fromDarkMode: boolean, toDarkMode: boolean, darkColorHandler: DarkColorHandler) => void) | null;
}
{
"name": "roosterjs-content-model-types",
"description": "Types for Content Model for roosterjs (Under development)",
"dependencies": {
"roosterjs-editor-types": "^8.59.0"
},
"version": "0.23.0",
"dependencies": {},
"version": "0.24.0",
"main": "./lib/index.js",

@@ -9,0 +7,0 @@ "typings": "./lib/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc