@blockslides/core 0.2.0 → 0.3.1
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 +17 -9
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -9
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
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) => {
|
|
@@ -5550,14 +5554,14 @@ function parseLayout(layout, columnCount) {
|
|
|
5550
5554
|
const ratios = layout.split("-").map(Number);
|
|
5551
5555
|
if (ratios.length !== columnCount) {
|
|
5552
5556
|
console.warn(
|
|
5553
|
-
`[BlockSlides] Layout '${layout}' expects ${ratios.length} column(s) but found ${columnCount} column(s) in the
|
|
5557
|
+
`[BlockSlides] Layout '${layout}' expects ${ratios.length} column(s) but found ${columnCount} column(s) in the columnGroup. Using equal distribution.`
|
|
5554
5558
|
);
|
|
5555
5559
|
return new Array(columnCount).fill(1);
|
|
5556
5560
|
}
|
|
5557
5561
|
return ratios;
|
|
5558
5562
|
}
|
|
5559
|
-
function
|
|
5560
|
-
const columns = Array.from(
|
|
5563
|
+
function applyLayoutToColumnGroup(columnGroupElement, layout) {
|
|
5564
|
+
const columns = Array.from(columnGroupElement.children).filter(
|
|
5561
5565
|
(el) => el.getAttribute("data-node-type") === "column"
|
|
5562
5566
|
);
|
|
5563
5567
|
if (columns.length === 0) {
|
|
@@ -5573,16 +5577,19 @@ function applyLayoutToRow(rowElement, layout) {
|
|
|
5573
5577
|
});
|
|
5574
5578
|
}
|
|
5575
5579
|
function applyAllLayouts(editorElement) {
|
|
5576
|
-
const
|
|
5577
|
-
'[data-node-type="
|
|
5580
|
+
const columnGroups = editorElement.querySelectorAll(
|
|
5581
|
+
'[data-node-type="columnGroup"]'
|
|
5578
5582
|
);
|
|
5579
|
-
|
|
5580
|
-
const layout =
|
|
5583
|
+
columnGroups.forEach((columnGroup) => {
|
|
5584
|
+
const layout = columnGroup.getAttribute("data-layout");
|
|
5581
5585
|
if (layout && layout !== "auto") {
|
|
5582
|
-
|
|
5586
|
+
applyLayoutToColumnGroup(columnGroup, layout);
|
|
5583
5587
|
}
|
|
5584
5588
|
});
|
|
5585
5589
|
}
|
|
5590
|
+
function applyLayoutToRow(rowElement, layout) {
|
|
5591
|
+
applyLayoutToColumnGroup(rowElement, layout);
|
|
5592
|
+
}
|
|
5586
5593
|
|
|
5587
5594
|
// src/utilities/markdown/index.ts
|
|
5588
5595
|
var markdown_exports = {};
|
|
@@ -6511,6 +6518,7 @@ var Tracker = class {
|
|
|
6511
6518
|
SlideEditor,
|
|
6512
6519
|
Tracker,
|
|
6513
6520
|
applyAllLayouts,
|
|
6521
|
+
applyLayoutToColumnGroup,
|
|
6514
6522
|
applyLayoutToRow,
|
|
6515
6523
|
applyTheme,
|
|
6516
6524
|
callOrReturn,
|