@blockslides/core 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +10 -8
- package/dist/index.d.ts +10 -8
- package/dist/index.js +28 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +27 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -3649,7 +3649,7 @@ declare function isString(value: any): value is string;
|
|
|
3649
3649
|
* Parses a layout string and returns flex ratios for each column
|
|
3650
3650
|
*
|
|
3651
3651
|
* @param layout - Layout string (e.g., '2-1', '1-1-1')
|
|
3652
|
-
* @param columnCount - Number of columns in the
|
|
3652
|
+
* @param columnCount - Number of columns in the columnGroup
|
|
3653
3653
|
* @returns Array of flex ratio numbers
|
|
3654
3654
|
*
|
|
3655
3655
|
* @example
|
|
@@ -3659,25 +3659,27 @@ declare function isString(value: any): value is string;
|
|
|
3659
3659
|
*/
|
|
3660
3660
|
declare function parseLayout(layout: string, columnCount: number): number[];
|
|
3661
3661
|
/**
|
|
3662
|
-
* Applies layout ratios to a
|
|
3662
|
+
* Applies layout ratios to a columnGroup's columns by setting flex values
|
|
3663
3663
|
*
|
|
3664
|
-
* @param
|
|
3664
|
+
* @param columnGroupElement - The DOM element for the columnGroup
|
|
3665
3665
|
* @param layout - Layout string (e.g., '2-1')
|
|
3666
3666
|
*
|
|
3667
3667
|
* @example
|
|
3668
|
-
* const
|
|
3669
|
-
*
|
|
3668
|
+
* const columnGroup = document.querySelector('[data-node-type="columnGroup"]');
|
|
3669
|
+
* applyLayoutToColumnGroup(columnGroup, '2-1');
|
|
3670
3670
|
* // First column will have flex: 2 1 0%
|
|
3671
3671
|
* // Second column will have flex: 1 1 0%
|
|
3672
3672
|
*/
|
|
3673
|
-
declare function
|
|
3673
|
+
declare function applyLayoutToColumnGroup(columnGroupElement: HTMLElement, layout: string): void;
|
|
3674
3674
|
/**
|
|
3675
|
-
* Applies layouts to all
|
|
3675
|
+
* Applies layouts to all columnGroups in the editor
|
|
3676
3676
|
* Should be called after editor mount and after content updates
|
|
3677
3677
|
*
|
|
3678
3678
|
* @param editorElement - The root editor DOM element
|
|
3679
3679
|
*/
|
|
3680
3680
|
declare function applyAllLayouts(editorElement: HTMLElement): void;
|
|
3681
|
+
/** @deprecated Use applyLayoutToColumnGroup instead */
|
|
3682
|
+
declare function applyLayoutToRow(rowElement: HTMLElement, layout: string): void;
|
|
3681
3683
|
|
|
3682
3684
|
/**
|
|
3683
3685
|
* @fileoverview Utility functions for parsing and serializing markdown attributes.
|
|
@@ -4128,4 +4130,4 @@ interface Commands<ReturnType = any> {
|
|
|
4128
4130
|
interface Storage {
|
|
4129
4131
|
}
|
|
4130
4132
|
|
|
4131
|
-
export { type AnyCommands, type AnyConfig, type AnyExtension, type AtomBlockMarkdownSpecOptions, type Attribute, type Attributes$1 as Attributes, type BlockMarkdownSpecOptions, type BlockParserConfig, type CanCommands, type ChainedCommands, type ChangedRange, type Command, CommandManager, type CommandProps, type CommandSpec, type Commands, type Content, type CreateNodeFromContentOptions, type DOMNode, type DOMOutputSpecArray$1 as DOMOutputSpecArray, type DecorationType, type DecorationWithType, type Diff, type Dispatch, type DocumentType, SlideEditor as Editor, type EditorEvents, type EditorOptions, type EnableRules, Extendable, type ExtendableConfig, type ExtendedRegExpMatchArray, Extension, type ExtensionAttribute, type ExtensionConfig, type Extensions, type FocusPosition, Fragment, type FullMarkdownHelpers, type GlobalAttributes, type HTMLContent, type InlineMarkdownSpecOptions, InputRule, type InputRuleFinder, type InputRuleMatch, type InsertContentAtOptions, type InsertContentOptions, type JSONContent, type KeyboardShortcutCommand, type KeysWithTypeOf, Mark, type MarkConfig, type MarkRange, type MarkType, MarkView, type MarkViewProps, type MarkViewRenderer, type MarkViewRendererOptions, type MarkViewRendererProps, type MarkdownExtensionSpec, type MarkdownHelpers, type MarkdownLexerConfiguration, type MarkdownParseHelpers, type MarkdownParseResult, type MarkdownRendererHelpers, type MarkdownToken, type MarkdownTokenizer, type MaybeReturnType, type MaybeThisParameterType, Node, type NodeConfig, NodePos, type NodeRange, type NodeType, NodeView, type NodeViewProps, type NodeViewRenderer, type NodeViewRendererOptions, type NodeViewRendererProps, type NodeWithPos, type Overwrite, type ParentConfig, type ParsedBlock, type PartialTheme, PasteRule, type PasteRuleFinder, type PasteRuleMatch, type PickValue, type Predicate, type Primitive, type Range, type RawCommands, type RemoveThis, type RenderContext, type ResolvedTheme, type SetContentOptions, type SingleCommands, SlideEditor, type Storage, type TextSerializer, type TextType, type Theme, type ThemeConfig, type ThemeInput, type TiptapEditorHTMLElement, Tracker, type TrackerResult, type UnionCommands, type UnionToIntersection, type ValuesOf, applyAllLayouts, applyLayoutToRow, applyTheme, blur, callOrReturn, canInsertNode, clearContent, clearNodes, combineTransactionSteps, command, index$2 as commands, createAtomBlockMarkdownSpec, createBlockMarkdownSpec, createChainableState, createDocument, h as createElement, createInlineMarkdownSpec, createNodeFromContent, createParagraphNear, createStyleTag, cut, darkTheme, defaultBlockAt, deleteCurrentNode, deleteNode, deleteProps, deleteRange, deleteSelection, elementFromString, enter, escapeForRegEx, exitCode, extendMarkRange, index$1 as extensions, findChildren, findChildrenInRange, findDuplicates, findParentNode, findParentNodeClosestToPos, first, flattenExtensions, focus, forEach, fromString, generateHTML, generateJSON, generateText, getAttributes, getAttributesFromExtensions, getChangedRanges, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAtPosition, getNodeAttributes, getNodeType, getRenderedAttributes, getSchema, getSchemaByResolvedExtensions, getSchemaTypeByName, getSchemaTypeNameByName, getSplittedAttributes, getText, getTextBetween, getTextContentFromNodes, getTextSerializersFromSchema, getTheme, getThemeNames, h, injectExtensionAttributesToParseRule, inputRulesPlugin, insertContent, insertContentAt, isActive, isAndroid, isAtEndOfNode, isAtStartOfNode, isEmptyObject, isExtensionRulesEnabled, isFunction, isList, isMacOS, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isNumber, isPlainObject, isRegExp, isString, isTextSelection, isiOS, joinBackward, joinDown, joinForward, joinItemBackward, joinItemForward, joinTextblockBackward, joinTextblockForward, joinUp, keyboardShortcut, lift, liftEmptyBlock, liftListItem, lightTheme, markInputRule, markPasteRule, index as markdown, mergeAttributes, mergeDeep, minMax, newlineInCode, nodeInputRule, nodePasteRule, objectIncludes, parseAttributes, parseIndentedBlocks, parseLayout, pasteRulesPlugin, posToDOMRect, registerTheme, removeDuplicates, renderNestedMarkdownContent, resetAttributes, resolveExtensions, resolveFocusPosition, resolveTheme, rewriteUnknownContent, scrollIntoView, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, selectionToInsertionEnd, serializeAttributes, setContent, setMark, setMeta, setNode, setNodeSelection, setTextSelection, sinkListItem, sortExtensions, splitBlock, splitExtensions, splitListItem, textInputRule, textPasteRule, textblockTypeInputRule, toggleList, toggleMark, toggleNode, toggleWrap, undoInputRule, unsetAllMarks, unsetMark, updateAttributes, updateMarkViewAttributes, wrapIn, wrapInList, wrappingInputRule };
|
|
4133
|
+
export { type AnyCommands, type AnyConfig, type AnyExtension, type AtomBlockMarkdownSpecOptions, type Attribute, type Attributes$1 as Attributes, type BlockMarkdownSpecOptions, type BlockParserConfig, type CanCommands, type ChainedCommands, type ChangedRange, type Command, CommandManager, type CommandProps, type CommandSpec, type Commands, type Content, type CreateNodeFromContentOptions, type DOMNode, type DOMOutputSpecArray$1 as DOMOutputSpecArray, type DecorationType, type DecorationWithType, type Diff, type Dispatch, type DocumentType, SlideEditor as Editor, type EditorEvents, type EditorOptions, type EnableRules, Extendable, type ExtendableConfig, type ExtendedRegExpMatchArray, Extension, type ExtensionAttribute, type ExtensionConfig, type Extensions, type FocusPosition, Fragment, type FullMarkdownHelpers, type GlobalAttributes, type HTMLContent, type InlineMarkdownSpecOptions, InputRule, type InputRuleFinder, type InputRuleMatch, type InsertContentAtOptions, type InsertContentOptions, type JSONContent, type KeyboardShortcutCommand, type KeysWithTypeOf, Mark, type MarkConfig, type MarkRange, type MarkType, MarkView, type MarkViewProps, type MarkViewRenderer, type MarkViewRendererOptions, type MarkViewRendererProps, type MarkdownExtensionSpec, type MarkdownHelpers, type MarkdownLexerConfiguration, type MarkdownParseHelpers, type MarkdownParseResult, type MarkdownRendererHelpers, type MarkdownToken, type MarkdownTokenizer, type MaybeReturnType, type MaybeThisParameterType, Node, type NodeConfig, NodePos, type NodeRange, type NodeType, NodeView, type NodeViewProps, type NodeViewRenderer, type NodeViewRendererOptions, type NodeViewRendererProps, type NodeWithPos, type Overwrite, type ParentConfig, type ParsedBlock, type PartialTheme, PasteRule, type PasteRuleFinder, type PasteRuleMatch, type PickValue, type Predicate, type Primitive, type Range, type RawCommands, type RemoveThis, type RenderContext, type ResolvedTheme, type SetContentOptions, type SingleCommands, SlideEditor, type Storage, type TextSerializer, type TextType, type Theme, type ThemeConfig, type ThemeInput, type TiptapEditorHTMLElement, Tracker, type TrackerResult, type UnionCommands, type UnionToIntersection, type ValuesOf, applyAllLayouts, applyLayoutToColumnGroup, applyLayoutToRow, applyTheme, blur, callOrReturn, canInsertNode, clearContent, clearNodes, combineTransactionSteps, command, index$2 as commands, createAtomBlockMarkdownSpec, createBlockMarkdownSpec, createChainableState, createDocument, h as createElement, createInlineMarkdownSpec, createNodeFromContent, createParagraphNear, createStyleTag, cut, darkTheme, defaultBlockAt, deleteCurrentNode, deleteNode, deleteProps, deleteRange, deleteSelection, elementFromString, enter, escapeForRegEx, exitCode, extendMarkRange, index$1 as extensions, findChildren, findChildrenInRange, findDuplicates, findParentNode, findParentNodeClosestToPos, first, flattenExtensions, focus, forEach, fromString, generateHTML, generateJSON, generateText, getAttributes, getAttributesFromExtensions, getChangedRanges, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAtPosition, getNodeAttributes, getNodeType, getRenderedAttributes, getSchema, getSchemaByResolvedExtensions, getSchemaTypeByName, getSchemaTypeNameByName, getSplittedAttributes, getText, getTextBetween, getTextContentFromNodes, getTextSerializersFromSchema, getTheme, getThemeNames, h, injectExtensionAttributesToParseRule, inputRulesPlugin, insertContent, insertContentAt, isActive, isAndroid, isAtEndOfNode, isAtStartOfNode, isEmptyObject, isExtensionRulesEnabled, isFunction, isList, isMacOS, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isNumber, isPlainObject, isRegExp, isString, isTextSelection, isiOS, joinBackward, joinDown, joinForward, joinItemBackward, joinItemForward, joinTextblockBackward, joinTextblockForward, joinUp, keyboardShortcut, lift, liftEmptyBlock, liftListItem, lightTheme, markInputRule, markPasteRule, index as markdown, mergeAttributes, mergeDeep, minMax, newlineInCode, nodeInputRule, nodePasteRule, objectIncludes, parseAttributes, parseIndentedBlocks, parseLayout, pasteRulesPlugin, posToDOMRect, registerTheme, removeDuplicates, renderNestedMarkdownContent, resetAttributes, resolveExtensions, resolveFocusPosition, resolveTheme, rewriteUnknownContent, scrollIntoView, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, selectionToInsertionEnd, serializeAttributes, setContent, setMark, setMeta, setNode, setNodeSelection, setTextSelection, sinkListItem, sortExtensions, splitBlock, splitExtensions, splitListItem, textInputRule, textPasteRule, textblockTypeInputRule, toggleList, toggleMark, toggleNode, toggleWrap, undoInputRule, unsetAllMarks, unsetMark, updateAttributes, updateMarkViewAttributes, wrapIn, wrapInList, wrappingInputRule };
|
package/dist/index.d.ts
CHANGED
|
@@ -3649,7 +3649,7 @@ declare function isString(value: any): value is string;
|
|
|
3649
3649
|
* Parses a layout string and returns flex ratios for each column
|
|
3650
3650
|
*
|
|
3651
3651
|
* @param layout - Layout string (e.g., '2-1', '1-1-1')
|
|
3652
|
-
* @param columnCount - Number of columns in the
|
|
3652
|
+
* @param columnCount - Number of columns in the columnGroup
|
|
3653
3653
|
* @returns Array of flex ratio numbers
|
|
3654
3654
|
*
|
|
3655
3655
|
* @example
|
|
@@ -3659,25 +3659,27 @@ declare function isString(value: any): value is string;
|
|
|
3659
3659
|
*/
|
|
3660
3660
|
declare function parseLayout(layout: string, columnCount: number): number[];
|
|
3661
3661
|
/**
|
|
3662
|
-
* Applies layout ratios to a
|
|
3662
|
+
* Applies layout ratios to a columnGroup's columns by setting flex values
|
|
3663
3663
|
*
|
|
3664
|
-
* @param
|
|
3664
|
+
* @param columnGroupElement - The DOM element for the columnGroup
|
|
3665
3665
|
* @param layout - Layout string (e.g., '2-1')
|
|
3666
3666
|
*
|
|
3667
3667
|
* @example
|
|
3668
|
-
* const
|
|
3669
|
-
*
|
|
3668
|
+
* const columnGroup = document.querySelector('[data-node-type="columnGroup"]');
|
|
3669
|
+
* applyLayoutToColumnGroup(columnGroup, '2-1');
|
|
3670
3670
|
* // First column will have flex: 2 1 0%
|
|
3671
3671
|
* // Second column will have flex: 1 1 0%
|
|
3672
3672
|
*/
|
|
3673
|
-
declare function
|
|
3673
|
+
declare function applyLayoutToColumnGroup(columnGroupElement: HTMLElement, layout: string): void;
|
|
3674
3674
|
/**
|
|
3675
|
-
* Applies layouts to all
|
|
3675
|
+
* Applies layouts to all columnGroups in the editor
|
|
3676
3676
|
* Should be called after editor mount and after content updates
|
|
3677
3677
|
*
|
|
3678
3678
|
* @param editorElement - The root editor DOM element
|
|
3679
3679
|
*/
|
|
3680
3680
|
declare function applyAllLayouts(editorElement: HTMLElement): void;
|
|
3681
|
+
/** @deprecated Use applyLayoutToColumnGroup instead */
|
|
3682
|
+
declare function applyLayoutToRow(rowElement: HTMLElement, layout: string): void;
|
|
3681
3683
|
|
|
3682
3684
|
/**
|
|
3683
3685
|
* @fileoverview Utility functions for parsing and serializing markdown attributes.
|
|
@@ -4128,4 +4130,4 @@ interface Commands<ReturnType = any> {
|
|
|
4128
4130
|
interface Storage {
|
|
4129
4131
|
}
|
|
4130
4132
|
|
|
4131
|
-
export { type AnyCommands, type AnyConfig, type AnyExtension, type AtomBlockMarkdownSpecOptions, type Attribute, type Attributes$1 as Attributes, type BlockMarkdownSpecOptions, type BlockParserConfig, type CanCommands, type ChainedCommands, type ChangedRange, type Command, CommandManager, type CommandProps, type CommandSpec, type Commands, type Content, type CreateNodeFromContentOptions, type DOMNode, type DOMOutputSpecArray$1 as DOMOutputSpecArray, type DecorationType, type DecorationWithType, type Diff, type Dispatch, type DocumentType, SlideEditor as Editor, type EditorEvents, type EditorOptions, type EnableRules, Extendable, type ExtendableConfig, type ExtendedRegExpMatchArray, Extension, type ExtensionAttribute, type ExtensionConfig, type Extensions, type FocusPosition, Fragment, type FullMarkdownHelpers, type GlobalAttributes, type HTMLContent, type InlineMarkdownSpecOptions, InputRule, type InputRuleFinder, type InputRuleMatch, type InsertContentAtOptions, type InsertContentOptions, type JSONContent, type KeyboardShortcutCommand, type KeysWithTypeOf, Mark, type MarkConfig, type MarkRange, type MarkType, MarkView, type MarkViewProps, type MarkViewRenderer, type MarkViewRendererOptions, type MarkViewRendererProps, type MarkdownExtensionSpec, type MarkdownHelpers, type MarkdownLexerConfiguration, type MarkdownParseHelpers, type MarkdownParseResult, type MarkdownRendererHelpers, type MarkdownToken, type MarkdownTokenizer, type MaybeReturnType, type MaybeThisParameterType, Node, type NodeConfig, NodePos, type NodeRange, type NodeType, NodeView, type NodeViewProps, type NodeViewRenderer, type NodeViewRendererOptions, type NodeViewRendererProps, type NodeWithPos, type Overwrite, type ParentConfig, type ParsedBlock, type PartialTheme, PasteRule, type PasteRuleFinder, type PasteRuleMatch, type PickValue, type Predicate, type Primitive, type Range, type RawCommands, type RemoveThis, type RenderContext, type ResolvedTheme, type SetContentOptions, type SingleCommands, SlideEditor, type Storage, type TextSerializer, type TextType, type Theme, type ThemeConfig, type ThemeInput, type TiptapEditorHTMLElement, Tracker, type TrackerResult, type UnionCommands, type UnionToIntersection, type ValuesOf, applyAllLayouts, applyLayoutToRow, applyTheme, blur, callOrReturn, canInsertNode, clearContent, clearNodes, combineTransactionSteps, command, index$2 as commands, createAtomBlockMarkdownSpec, createBlockMarkdownSpec, createChainableState, createDocument, h as createElement, createInlineMarkdownSpec, createNodeFromContent, createParagraphNear, createStyleTag, cut, darkTheme, defaultBlockAt, deleteCurrentNode, deleteNode, deleteProps, deleteRange, deleteSelection, elementFromString, enter, escapeForRegEx, exitCode, extendMarkRange, index$1 as extensions, findChildren, findChildrenInRange, findDuplicates, findParentNode, findParentNodeClosestToPos, first, flattenExtensions, focus, forEach, fromString, generateHTML, generateJSON, generateText, getAttributes, getAttributesFromExtensions, getChangedRanges, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAtPosition, getNodeAttributes, getNodeType, getRenderedAttributes, getSchema, getSchemaByResolvedExtensions, getSchemaTypeByName, getSchemaTypeNameByName, getSplittedAttributes, getText, getTextBetween, getTextContentFromNodes, getTextSerializersFromSchema, getTheme, getThemeNames, h, injectExtensionAttributesToParseRule, inputRulesPlugin, insertContent, insertContentAt, isActive, isAndroid, isAtEndOfNode, isAtStartOfNode, isEmptyObject, isExtensionRulesEnabled, isFunction, isList, isMacOS, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isNumber, isPlainObject, isRegExp, isString, isTextSelection, isiOS, joinBackward, joinDown, joinForward, joinItemBackward, joinItemForward, joinTextblockBackward, joinTextblockForward, joinUp, keyboardShortcut, lift, liftEmptyBlock, liftListItem, lightTheme, markInputRule, markPasteRule, index as markdown, mergeAttributes, mergeDeep, minMax, newlineInCode, nodeInputRule, nodePasteRule, objectIncludes, parseAttributes, parseIndentedBlocks, parseLayout, pasteRulesPlugin, posToDOMRect, registerTheme, removeDuplicates, renderNestedMarkdownContent, resetAttributes, resolveExtensions, resolveFocusPosition, resolveTheme, rewriteUnknownContent, scrollIntoView, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, selectionToInsertionEnd, serializeAttributes, setContent, setMark, setMeta, setNode, setNodeSelection, setTextSelection, sinkListItem, sortExtensions, splitBlock, splitExtensions, splitListItem, textInputRule, textPasteRule, textblockTypeInputRule, toggleList, toggleMark, toggleNode, toggleWrap, undoInputRule, unsetAllMarks, unsetMark, updateAttributes, updateMarkViewAttributes, wrapIn, wrapInList, wrappingInputRule };
|
|
4133
|
+
export { type AnyCommands, type AnyConfig, type AnyExtension, type AtomBlockMarkdownSpecOptions, type Attribute, type Attributes$1 as Attributes, type BlockMarkdownSpecOptions, type BlockParserConfig, type CanCommands, type ChainedCommands, type ChangedRange, type Command, CommandManager, type CommandProps, type CommandSpec, type Commands, type Content, type CreateNodeFromContentOptions, type DOMNode, type DOMOutputSpecArray$1 as DOMOutputSpecArray, type DecorationType, type DecorationWithType, type Diff, type Dispatch, type DocumentType, SlideEditor as Editor, type EditorEvents, type EditorOptions, type EnableRules, Extendable, type ExtendableConfig, type ExtendedRegExpMatchArray, Extension, type ExtensionAttribute, type ExtensionConfig, type Extensions, type FocusPosition, Fragment, type FullMarkdownHelpers, type GlobalAttributes, type HTMLContent, type InlineMarkdownSpecOptions, InputRule, type InputRuleFinder, type InputRuleMatch, type InsertContentAtOptions, type InsertContentOptions, type JSONContent, type KeyboardShortcutCommand, type KeysWithTypeOf, Mark, type MarkConfig, type MarkRange, type MarkType, MarkView, type MarkViewProps, type MarkViewRenderer, type MarkViewRendererOptions, type MarkViewRendererProps, type MarkdownExtensionSpec, type MarkdownHelpers, type MarkdownLexerConfiguration, type MarkdownParseHelpers, type MarkdownParseResult, type MarkdownRendererHelpers, type MarkdownToken, type MarkdownTokenizer, type MaybeReturnType, type MaybeThisParameterType, Node, type NodeConfig, NodePos, type NodeRange, type NodeType, NodeView, type NodeViewProps, type NodeViewRenderer, type NodeViewRendererOptions, type NodeViewRendererProps, type NodeWithPos, type Overwrite, type ParentConfig, type ParsedBlock, type PartialTheme, PasteRule, type PasteRuleFinder, type PasteRuleMatch, type PickValue, type Predicate, type Primitive, type Range, type RawCommands, type RemoveThis, type RenderContext, type ResolvedTheme, type SetContentOptions, type SingleCommands, SlideEditor, type Storage, type TextSerializer, type TextType, type Theme, type ThemeConfig, type ThemeInput, type TiptapEditorHTMLElement, Tracker, type TrackerResult, type UnionCommands, type UnionToIntersection, type ValuesOf, applyAllLayouts, applyLayoutToColumnGroup, applyLayoutToRow, applyTheme, blur, callOrReturn, canInsertNode, clearContent, clearNodes, combineTransactionSteps, command, index$2 as commands, createAtomBlockMarkdownSpec, createBlockMarkdownSpec, createChainableState, createDocument, h as createElement, createInlineMarkdownSpec, createNodeFromContent, createParagraphNear, createStyleTag, cut, darkTheme, defaultBlockAt, deleteCurrentNode, deleteNode, deleteProps, deleteRange, deleteSelection, elementFromString, enter, escapeForRegEx, exitCode, extendMarkRange, index$1 as extensions, findChildren, findChildrenInRange, findDuplicates, findParentNode, findParentNodeClosestToPos, first, flattenExtensions, focus, forEach, fromString, generateHTML, generateJSON, generateText, getAttributes, getAttributesFromExtensions, getChangedRanges, getDebugJSON, getExtensionField, getHTMLFromFragment, getMarkAttributes, getMarkRange, getMarkType, getMarksBetween, getNodeAtPosition, getNodeAttributes, getNodeType, getRenderedAttributes, getSchema, getSchemaByResolvedExtensions, getSchemaTypeByName, getSchemaTypeNameByName, getSplittedAttributes, getText, getTextBetween, getTextContentFromNodes, getTextSerializersFromSchema, getTheme, getThemeNames, h, injectExtensionAttributesToParseRule, inputRulesPlugin, insertContent, insertContentAt, isActive, isAndroid, isAtEndOfNode, isAtStartOfNode, isEmptyObject, isExtensionRulesEnabled, isFunction, isList, isMacOS, isMarkActive, isNodeActive, isNodeEmpty, isNodeSelection, isNumber, isPlainObject, isRegExp, isString, isTextSelection, isiOS, joinBackward, joinDown, joinForward, joinItemBackward, joinItemForward, joinTextblockBackward, joinTextblockForward, joinUp, keyboardShortcut, lift, liftEmptyBlock, liftListItem, lightTheme, markInputRule, markPasteRule, index as markdown, mergeAttributes, mergeDeep, minMax, newlineInCode, nodeInputRule, nodePasteRule, objectIncludes, parseAttributes, parseIndentedBlocks, parseLayout, pasteRulesPlugin, posToDOMRect, registerTheme, removeDuplicates, renderNestedMarkdownContent, resetAttributes, resolveExtensions, resolveFocusPosition, resolveTheme, rewriteUnknownContent, scrollIntoView, selectAll, selectNodeBackward, selectNodeForward, selectParentNode, selectTextblockEnd, selectTextblockStart, selectionToInsertionEnd, serializeAttributes, setContent, setMark, setMeta, setNode, setNodeSelection, setTextSelection, sinkListItem, sortExtensions, splitBlock, splitExtensions, splitListItem, textInputRule, textPasteRule, textblockTypeInputRule, toggleList, toggleMark, toggleNode, toggleWrap, undoInputRule, unsetAllMarks, unsetMark, updateAttributes, updateMarkViewAttributes, wrapIn, wrapInList, wrappingInputRule };
|
package/dist/index.js
CHANGED
|
@@ -35,6 +35,7 @@ __export(index_exports, {
|
|
|
35
35
|
SlideEditor: () => SlideEditor,
|
|
36
36
|
Tracker: () => Tracker,
|
|
37
37
|
applyAllLayouts: () => applyAllLayouts,
|
|
38
|
+
applyLayoutToColumnGroup: () => applyLayoutToColumnGroup,
|
|
38
39
|
applyLayoutToRow: () => applyLayoutToRow,
|
|
39
40
|
applyTheme: () => applyTheme,
|
|
40
41
|
callOrReturn: () => callOrReturn,
|
|
@@ -4932,6 +4933,7 @@ var SlideEditor = class extends EventEmitter {
|
|
|
4932
4933
|
if (this.editorView) {
|
|
4933
4934
|
return this.editorView;
|
|
4934
4935
|
}
|
|
4936
|
+
const editor = this;
|
|
4935
4937
|
return new Proxy(
|
|
4936
4938
|
{
|
|
4937
4939
|
state: this.editorState,
|
|
@@ -4945,7 +4947,9 @@ var SlideEditor = class extends EventEmitter {
|
|
|
4945
4947
|
composing: false,
|
|
4946
4948
|
dragging: null,
|
|
4947
4949
|
editable: true,
|
|
4948
|
-
isDestroyed
|
|
4950
|
+
get isDestroyed() {
|
|
4951
|
+
return editor.editorView == null;
|
|
4952
|
+
}
|
|
4949
4953
|
},
|
|
4950
4954
|
{
|
|
4951
4955
|
get: (obj, key) => {
|
|
@@ -5164,6 +5168,14 @@ var SlideEditor = class extends EventEmitter {
|
|
|
5164
5168
|
* @param transaction An editor state transaction
|
|
5165
5169
|
*/
|
|
5166
5170
|
dispatchTransaction(transaction) {
|
|
5171
|
+
var _a;
|
|
5172
|
+
console.log("[dispatchTransaction]", {
|
|
5173
|
+
hasView: !!this.editorView,
|
|
5174
|
+
isDestroyed: this.isDestroyed,
|
|
5175
|
+
hasState: !!this.state,
|
|
5176
|
+
selection: (_a = this.state) == null ? void 0 : _a.selection,
|
|
5177
|
+
bubbleMenuMeta: typeof transaction.getMeta === "function" ? transaction.getMeta("bubbleMenu") : void 0
|
|
5178
|
+
});
|
|
5167
5179
|
if (this.view.isDestroyed) {
|
|
5168
5180
|
return;
|
|
5169
5181
|
}
|
|
@@ -5173,8 +5185,8 @@ var SlideEditor = class extends EventEmitter {
|
|
|
5173
5185
|
return;
|
|
5174
5186
|
}
|
|
5175
5187
|
transaction.steps.forEach((step) => {
|
|
5176
|
-
var
|
|
5177
|
-
return (
|
|
5188
|
+
var _a2;
|
|
5189
|
+
return (_a2 = this.capturedTransaction) == null ? void 0 : _a2.step(step);
|
|
5178
5190
|
});
|
|
5179
5191
|
return;
|
|
5180
5192
|
}
|
|
@@ -5308,6 +5320,7 @@ var SlideEditor = class extends EventEmitter {
|
|
|
5308
5320
|
* Destroy the editor.
|
|
5309
5321
|
*/
|
|
5310
5322
|
destroy() {
|
|
5323
|
+
console.log("[editor destroy]", { instanceId: this.instanceId });
|
|
5311
5324
|
this.emit("destroy");
|
|
5312
5325
|
this.unmount();
|
|
5313
5326
|
this.removeAllListeners();
|
|
@@ -5550,14 +5563,14 @@ function parseLayout(layout, columnCount) {
|
|
|
5550
5563
|
const ratios = layout.split("-").map(Number);
|
|
5551
5564
|
if (ratios.length !== columnCount) {
|
|
5552
5565
|
console.warn(
|
|
5553
|
-
`[BlockSlides] Layout '${layout}' expects ${ratios.length} column(s) but found ${columnCount} column(s) in the
|
|
5566
|
+
`[BlockSlides] Layout '${layout}' expects ${ratios.length} column(s) but found ${columnCount} column(s) in the columnGroup. Using equal distribution.`
|
|
5554
5567
|
);
|
|
5555
5568
|
return new Array(columnCount).fill(1);
|
|
5556
5569
|
}
|
|
5557
5570
|
return ratios;
|
|
5558
5571
|
}
|
|
5559
|
-
function
|
|
5560
|
-
const columns = Array.from(
|
|
5572
|
+
function applyLayoutToColumnGroup(columnGroupElement, layout) {
|
|
5573
|
+
const columns = Array.from(columnGroupElement.children).filter(
|
|
5561
5574
|
(el) => el.getAttribute("data-node-type") === "column"
|
|
5562
5575
|
);
|
|
5563
5576
|
if (columns.length === 0) {
|
|
@@ -5573,16 +5586,19 @@ function applyLayoutToRow(rowElement, layout) {
|
|
|
5573
5586
|
});
|
|
5574
5587
|
}
|
|
5575
5588
|
function applyAllLayouts(editorElement) {
|
|
5576
|
-
const
|
|
5577
|
-
'[data-node-type="
|
|
5589
|
+
const columnGroups = editorElement.querySelectorAll(
|
|
5590
|
+
'[data-node-type="columnGroup"]'
|
|
5578
5591
|
);
|
|
5579
|
-
|
|
5580
|
-
const layout =
|
|
5592
|
+
columnGroups.forEach((columnGroup) => {
|
|
5593
|
+
const layout = columnGroup.getAttribute("data-layout");
|
|
5581
5594
|
if (layout && layout !== "auto") {
|
|
5582
|
-
|
|
5595
|
+
applyLayoutToColumnGroup(columnGroup, layout);
|
|
5583
5596
|
}
|
|
5584
5597
|
});
|
|
5585
5598
|
}
|
|
5599
|
+
function applyLayoutToRow(rowElement, layout) {
|
|
5600
|
+
applyLayoutToColumnGroup(rowElement, layout);
|
|
5601
|
+
}
|
|
5586
5602
|
|
|
5587
5603
|
// src/utilities/markdown/index.ts
|
|
5588
5604
|
var markdown_exports = {};
|
|
@@ -6511,6 +6527,7 @@ var Tracker = class {
|
|
|
6511
6527
|
SlideEditor,
|
|
6512
6528
|
Tracker,
|
|
6513
6529
|
applyAllLayouts,
|
|
6530
|
+
applyLayoutToColumnGroup,
|
|
6514
6531
|
applyLayoutToRow,
|
|
6515
6532
|
applyTheme,
|
|
6516
6533
|
callOrReturn,
|