@docen/extensions 0.0.8 → 0.0.10

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.
@@ -1,4 +1,4 @@
1
- import { N as Node, a as Node$1, P as ParentConfig, b as EditorView, c as NodeView, R as ResizableNodeViewDirection, d as PluginKey, e as Editor, f as Range, g as EditorState, h as ResolvedPos, D as DOMOutputSpec, M as Mark, i as Extension } from './extensions.SlCx0Bmn.cjs';
1
+ import { N as Node, a as Node$1, P as ParentConfig, E as EditorView, b as NodeView, R as ResizableNodeViewDirection, c as PluginKey, d as Editor, e as Range, T as Transaction, f as EditorState, g as ResolvedPos, D as DOMOutputSpec, M as Mark, h as Extension } from './extensions.BOBBi1Z_.cjs';
2
2
  import '@tiptap/extension-mathematics';
3
3
 
4
4
  /**
@@ -825,6 +825,25 @@ interface SuggestionOptions<I = any, TSelected = any> {
825
825
  * @example 'mention'
826
826
  */
827
827
  pluginKey?: PluginKey;
828
+ /**
829
+ * A function that returns a boolean to indicate if the suggestion should be active.
830
+ * This is useful to prevent suggestions from opening for remote users in collaborative environments.
831
+ * @param props The props object.
832
+ * @param props.editor The editor instance.
833
+ * @param props.range The range of the suggestion.
834
+ * @param props.query The current suggestion query.
835
+ * @param props.text The current suggestion text.
836
+ * @param props.transaction The current transaction.
837
+ * @returns {boolean}
838
+ * @example ({ transaction }) => isChangeOrigin(transaction)
839
+ */
840
+ shouldShow?: (props: {
841
+ editor: Editor;
842
+ range: Range;
843
+ query: string;
844
+ text: string;
845
+ transaction: Transaction;
846
+ }) => boolean;
828
847
  /**
829
848
  * The editor instance.
830
849
  * @default null
@@ -1420,6 +1439,7 @@ declare module '@tiptap/core' {
1420
1439
  target?: string | null;
1421
1440
  rel?: string | null;
1422
1441
  class?: string | null;
1442
+ title?: string | null;
1423
1443
  }) => ReturnType;
1424
1444
  /**
1425
1445
  * Toggle a link mark
@@ -1431,6 +1451,7 @@ declare module '@tiptap/core' {
1431
1451
  target?: string | null;
1432
1452
  rel?: string | null;
1433
1453
  class?: string | null;
1454
+ title?: string | null;
1434
1455
  }) => ReturnType;
1435
1456
  /**
1436
1457
  * Unset a link mark
@@ -1789,5 +1810,54 @@ declare const LineHeight: Extension<LineHeightOptions, any>;
1789
1810
  interface TextStyleAttributes extends Record<string, any> {
1790
1811
  }
1791
1812
 
1792
- export { TableRow as A, Blockquote as B, CodeBlockLowlight as C, Document as D, Emoji as E, FontFamily as F, Image as G, ListItem as L, Mention as M, OrderedList as O, Strike as S, Underline as U, Text as a, HorizontalRule as b, BulletList as c, TaskList as d, TaskItem as e, Table as f, TableCell as g, TableHeader as h, HardBreak as i, Details as j, DetailsSummary as k, DetailsContent as l, Bold as m, Italic as n, Code as o, Link as p, Highlight as q, Subscript as r, Superscript as s, TextStyle as t, Color as u, BackgroundColor as v, FontSize as w, LineHeight as x, Paragraph as y, Heading as z };
1813
+ interface TextAlignOptions {
1814
+ /**
1815
+ * The types where the text align attribute can be applied.
1816
+ * @default []
1817
+ * @example ['heading', 'paragraph']
1818
+ */
1819
+ types: string[];
1820
+ /**
1821
+ * The alignments which are allowed.
1822
+ * @default ['left', 'center', 'right', 'justify']
1823
+ * @example ['left', 'right']
1824
+ */
1825
+ alignments: string[];
1826
+ /**
1827
+ * The default alignment.
1828
+ * @default null
1829
+ * @example 'center'
1830
+ */
1831
+ defaultAlignment: string | null;
1832
+ }
1833
+ declare module '@tiptap/core' {
1834
+ interface Commands<ReturnType> {
1835
+ textAlign: {
1836
+ /**
1837
+ * Set the text align attribute
1838
+ * @param alignment The alignment
1839
+ * @example editor.commands.setTextAlign('left')
1840
+ */
1841
+ setTextAlign: (alignment: string) => ReturnType;
1842
+ /**
1843
+ * Unset the text align attribute
1844
+ * @example editor.commands.unsetTextAlign()
1845
+ */
1846
+ unsetTextAlign: () => ReturnType;
1847
+ /**
1848
+ * Toggle the text align attribute
1849
+ * @param alignment The alignment
1850
+ * @example editor.commands.toggleTextAlign('right')
1851
+ */
1852
+ toggleTextAlign: (alignment: string) => ReturnType;
1853
+ };
1854
+ }
1855
+ }
1856
+ /**
1857
+ * This extension allows you to align text.
1858
+ * @see https://www.tiptap.dev/api/extensions/text-align
1859
+ */
1860
+ declare const TextAlign: Extension<TextAlignOptions, any>;
1861
+
1862
+ export { Image as A, BackgroundColor as B, Code as C, Details as D, Emoji as E, FontFamily as F, Paragraph as G, TableRow as J, LineHeight as L, Mention as M, OrderedList as O, Strike as S, Underline as U, Blockquote as a, Bold as b, BulletList as c, CodeBlockLowlight as d, Color as e, DetailsContent as f, DetailsSummary as g, Document as h, FontSize as i, HardBreak as j, Highlight as k, HorizontalRule as l, Italic as m, Link as n, ListItem as o, Subscript as p, Superscript as q, Table as r, TableCell as s, TableHeader as t, TaskItem as u, TaskList as v, Text as w, TextAlign as x, TextStyle as y, Heading as z };
1793
1863
  export type { HeadingOptions as H, ImageOptions as I, ParagraphOptions as P, TableRowOptions as T };
@@ -1,4 +1,4 @@
1
- import { N as Node, a as Node$1, P as ParentConfig, b as EditorView, c as NodeView, R as ResizableNodeViewDirection, d as PluginKey, e as Editor, f as Range, g as EditorState, h as ResolvedPos, D as DOMOutputSpec, M as Mark, i as Extension } from './extensions.SlCx0Bmn.mjs';
1
+ import { N as Node, a as Node$1, P as ParentConfig, E as EditorView, b as NodeView, R as ResizableNodeViewDirection, c as PluginKey, d as Editor, e as Range, T as Transaction, f as EditorState, g as ResolvedPos, D as DOMOutputSpec, M as Mark, h as Extension } from './extensions.BOBBi1Z_.mjs';
2
2
  import '@tiptap/extension-mathematics';
3
3
 
4
4
  /**
@@ -825,6 +825,25 @@ interface SuggestionOptions<I = any, TSelected = any> {
825
825
  * @example 'mention'
826
826
  */
827
827
  pluginKey?: PluginKey;
828
+ /**
829
+ * A function that returns a boolean to indicate if the suggestion should be active.
830
+ * This is useful to prevent suggestions from opening for remote users in collaborative environments.
831
+ * @param props The props object.
832
+ * @param props.editor The editor instance.
833
+ * @param props.range The range of the suggestion.
834
+ * @param props.query The current suggestion query.
835
+ * @param props.text The current suggestion text.
836
+ * @param props.transaction The current transaction.
837
+ * @returns {boolean}
838
+ * @example ({ transaction }) => isChangeOrigin(transaction)
839
+ */
840
+ shouldShow?: (props: {
841
+ editor: Editor;
842
+ range: Range;
843
+ query: string;
844
+ text: string;
845
+ transaction: Transaction;
846
+ }) => boolean;
828
847
  /**
829
848
  * The editor instance.
830
849
  * @default null
@@ -1420,6 +1439,7 @@ declare module '@tiptap/core' {
1420
1439
  target?: string | null;
1421
1440
  rel?: string | null;
1422
1441
  class?: string | null;
1442
+ title?: string | null;
1423
1443
  }) => ReturnType;
1424
1444
  /**
1425
1445
  * Toggle a link mark
@@ -1431,6 +1451,7 @@ declare module '@tiptap/core' {
1431
1451
  target?: string | null;
1432
1452
  rel?: string | null;
1433
1453
  class?: string | null;
1454
+ title?: string | null;
1434
1455
  }) => ReturnType;
1435
1456
  /**
1436
1457
  * Unset a link mark
@@ -1789,5 +1810,54 @@ declare const LineHeight: Extension<LineHeightOptions, any>;
1789
1810
  interface TextStyleAttributes extends Record<string, any> {
1790
1811
  }
1791
1812
 
1792
- export { TableRow as A, Blockquote as B, CodeBlockLowlight as C, Document as D, Emoji as E, FontFamily as F, Image as G, ListItem as L, Mention as M, OrderedList as O, Strike as S, Underline as U, Text as a, HorizontalRule as b, BulletList as c, TaskList as d, TaskItem as e, Table as f, TableCell as g, TableHeader as h, HardBreak as i, Details as j, DetailsSummary as k, DetailsContent as l, Bold as m, Italic as n, Code as o, Link as p, Highlight as q, Subscript as r, Superscript as s, TextStyle as t, Color as u, BackgroundColor as v, FontSize as w, LineHeight as x, Paragraph as y, Heading as z };
1813
+ interface TextAlignOptions {
1814
+ /**
1815
+ * The types where the text align attribute can be applied.
1816
+ * @default []
1817
+ * @example ['heading', 'paragraph']
1818
+ */
1819
+ types: string[];
1820
+ /**
1821
+ * The alignments which are allowed.
1822
+ * @default ['left', 'center', 'right', 'justify']
1823
+ * @example ['left', 'right']
1824
+ */
1825
+ alignments: string[];
1826
+ /**
1827
+ * The default alignment.
1828
+ * @default null
1829
+ * @example 'center'
1830
+ */
1831
+ defaultAlignment: string | null;
1832
+ }
1833
+ declare module '@tiptap/core' {
1834
+ interface Commands<ReturnType> {
1835
+ textAlign: {
1836
+ /**
1837
+ * Set the text align attribute
1838
+ * @param alignment The alignment
1839
+ * @example editor.commands.setTextAlign('left')
1840
+ */
1841
+ setTextAlign: (alignment: string) => ReturnType;
1842
+ /**
1843
+ * Unset the text align attribute
1844
+ * @example editor.commands.unsetTextAlign()
1845
+ */
1846
+ unsetTextAlign: () => ReturnType;
1847
+ /**
1848
+ * Toggle the text align attribute
1849
+ * @param alignment The alignment
1850
+ * @example editor.commands.toggleTextAlign('right')
1851
+ */
1852
+ toggleTextAlign: (alignment: string) => ReturnType;
1853
+ };
1854
+ }
1855
+ }
1856
+ /**
1857
+ * This extension allows you to align text.
1858
+ * @see https://www.tiptap.dev/api/extensions/text-align
1859
+ */
1860
+ declare const TextAlign: Extension<TextAlignOptions, any>;
1861
+
1862
+ export { Image as A, BackgroundColor as B, Code as C, Details as D, Emoji as E, FontFamily as F, Paragraph as G, TableRow as J, LineHeight as L, Mention as M, OrderedList as O, Strike as S, Underline as U, Blockquote as a, Bold as b, BulletList as c, CodeBlockLowlight as d, Color as e, DetailsContent as f, DetailsSummary as g, Document as h, FontSize as i, HardBreak as j, Highlight as k, HorizontalRule as l, Italic as m, Link as n, ListItem as o, Subscript as p, Superscript as q, Table as r, TableCell as s, TableHeader as t, TaskItem as u, TaskList as v, Text as w, TextAlign as x, TextStyle as y, Heading as z };
1793
1863
  export type { HeadingOptions as H, ImageOptions as I, ParagraphOptions as P, TableRowOptions as T };
@@ -1,4 +1,4 @@
1
- import { N as Node, a as Node$1, P as ParentConfig, b as EditorView, c as NodeView, R as ResizableNodeViewDirection, d as PluginKey, e as Editor, f as Range, g as EditorState, h as ResolvedPos, D as DOMOutputSpec, M as Mark, i as Extension } from './extensions.SlCx0Bmn.js';
1
+ import { N as Node, a as Node$1, P as ParentConfig, E as EditorView, b as NodeView, R as ResizableNodeViewDirection, c as PluginKey, d as Editor, e as Range, T as Transaction, f as EditorState, g as ResolvedPos, D as DOMOutputSpec, M as Mark, h as Extension } from './extensions.BOBBi1Z_.js';
2
2
  import '@tiptap/extension-mathematics';
3
3
 
4
4
  /**
@@ -825,6 +825,25 @@ interface SuggestionOptions<I = any, TSelected = any> {
825
825
  * @example 'mention'
826
826
  */
827
827
  pluginKey?: PluginKey;
828
+ /**
829
+ * A function that returns a boolean to indicate if the suggestion should be active.
830
+ * This is useful to prevent suggestions from opening for remote users in collaborative environments.
831
+ * @param props The props object.
832
+ * @param props.editor The editor instance.
833
+ * @param props.range The range of the suggestion.
834
+ * @param props.query The current suggestion query.
835
+ * @param props.text The current suggestion text.
836
+ * @param props.transaction The current transaction.
837
+ * @returns {boolean}
838
+ * @example ({ transaction }) => isChangeOrigin(transaction)
839
+ */
840
+ shouldShow?: (props: {
841
+ editor: Editor;
842
+ range: Range;
843
+ query: string;
844
+ text: string;
845
+ transaction: Transaction;
846
+ }) => boolean;
828
847
  /**
829
848
  * The editor instance.
830
849
  * @default null
@@ -1420,6 +1439,7 @@ declare module '@tiptap/core' {
1420
1439
  target?: string | null;
1421
1440
  rel?: string | null;
1422
1441
  class?: string | null;
1442
+ title?: string | null;
1423
1443
  }) => ReturnType;
1424
1444
  /**
1425
1445
  * Toggle a link mark
@@ -1431,6 +1451,7 @@ declare module '@tiptap/core' {
1431
1451
  target?: string | null;
1432
1452
  rel?: string | null;
1433
1453
  class?: string | null;
1454
+ title?: string | null;
1434
1455
  }) => ReturnType;
1435
1456
  /**
1436
1457
  * Unset a link mark
@@ -1789,5 +1810,54 @@ declare const LineHeight: Extension<LineHeightOptions, any>;
1789
1810
  interface TextStyleAttributes extends Record<string, any> {
1790
1811
  }
1791
1812
 
1792
- export { TableRow as A, Blockquote as B, CodeBlockLowlight as C, Document as D, Emoji as E, FontFamily as F, Image as G, ListItem as L, Mention as M, OrderedList as O, Strike as S, Underline as U, Text as a, HorizontalRule as b, BulletList as c, TaskList as d, TaskItem as e, Table as f, TableCell as g, TableHeader as h, HardBreak as i, Details as j, DetailsSummary as k, DetailsContent as l, Bold as m, Italic as n, Code as o, Link as p, Highlight as q, Subscript as r, Superscript as s, TextStyle as t, Color as u, BackgroundColor as v, FontSize as w, LineHeight as x, Paragraph as y, Heading as z };
1813
+ interface TextAlignOptions {
1814
+ /**
1815
+ * The types where the text align attribute can be applied.
1816
+ * @default []
1817
+ * @example ['heading', 'paragraph']
1818
+ */
1819
+ types: string[];
1820
+ /**
1821
+ * The alignments which are allowed.
1822
+ * @default ['left', 'center', 'right', 'justify']
1823
+ * @example ['left', 'right']
1824
+ */
1825
+ alignments: string[];
1826
+ /**
1827
+ * The default alignment.
1828
+ * @default null
1829
+ * @example 'center'
1830
+ */
1831
+ defaultAlignment: string | null;
1832
+ }
1833
+ declare module '@tiptap/core' {
1834
+ interface Commands<ReturnType> {
1835
+ textAlign: {
1836
+ /**
1837
+ * Set the text align attribute
1838
+ * @param alignment The alignment
1839
+ * @example editor.commands.setTextAlign('left')
1840
+ */
1841
+ setTextAlign: (alignment: string) => ReturnType;
1842
+ /**
1843
+ * Unset the text align attribute
1844
+ * @example editor.commands.unsetTextAlign()
1845
+ */
1846
+ unsetTextAlign: () => ReturnType;
1847
+ /**
1848
+ * Toggle the text align attribute
1849
+ * @param alignment The alignment
1850
+ * @example editor.commands.toggleTextAlign('right')
1851
+ */
1852
+ toggleTextAlign: (alignment: string) => ReturnType;
1853
+ };
1854
+ }
1855
+ }
1856
+ /**
1857
+ * This extension allows you to align text.
1858
+ * @see https://www.tiptap.dev/api/extensions/text-align
1859
+ */
1860
+ declare const TextAlign: Extension<TextAlignOptions, any>;
1861
+
1862
+ export { Image as A, BackgroundColor as B, Code as C, Details as D, Emoji as E, FontFamily as F, Paragraph as G, TableRow as J, LineHeight as L, Mention as M, OrderedList as O, Strike as S, Underline as U, Blockquote as a, Bold as b, BulletList as c, CodeBlockLowlight as d, Color as e, DetailsContent as f, DetailsSummary as g, Document as h, FontSize as i, HardBreak as j, Highlight as k, HorizontalRule as l, Italic as m, Link as n, ListItem as o, Subscript as p, Superscript as q, Table as r, TableCell as s, TableHeader as t, TaskItem as u, TaskList as v, Text as w, TextAlign as x, TextStyle as y, Heading as z };
1793
1863
  export type { HeadingOptions as H, ImageOptions as I, ParagraphOptions as P, TableRowOptions as T };