@tiptap/extension-drag-handle-vue-3 3.10.7 → 3.11.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.cts +156 -62
- package/dist/index.d.ts +156 -62
- package/package.json +7 -7
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _floating_ui_dom from '@floating-ui/dom';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { EditorView, EditorProps,
|
|
2
|
+
import { EditorState, Plugin, Transaction, PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
import { MarkType as MarkType$1, MarkSpec, Mark as Mark$1, DOMOutputSpec, NodeType as NodeType$1, NodeSpec, Node as Node$1, Slice, ParseOptions, Schema, ResolvedPos, Fragment } from '@tiptap/pm/model';
|
|
4
|
+
import { EditorView, EditorProps, NodeView, MarkView, NodeViewConstructor, MarkViewConstructor } from '@tiptap/pm/view';
|
|
5
5
|
import { Transform } from '@tiptap/pm/transform';
|
|
6
6
|
import * as vue from 'vue';
|
|
7
7
|
import { PropType } from 'vue';
|
|
@@ -155,7 +155,7 @@ interface MarkConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
155
155
|
storage: Storage;
|
|
156
156
|
parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
|
|
157
157
|
editor?: Editor;
|
|
158
|
-
}) => Attributes
|
|
158
|
+
}) => Attributes | {};
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* The Mark class is used to create custom mark extensions.
|
|
@@ -452,7 +452,7 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
452
452
|
storage: Storage;
|
|
453
453
|
parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
|
|
454
454
|
editor?: Editor;
|
|
455
|
-
}) => Attributes
|
|
455
|
+
}) => Attributes | {};
|
|
456
456
|
}
|
|
457
457
|
/**
|
|
458
458
|
* The Node class is used to create custom node extensions.
|
|
@@ -871,6 +871,7 @@ declare class Extendable<Options = any, Storage = any, Config = ExtensionConfig<
|
|
|
871
871
|
configure(options?: Partial<Options>): Extendable<Options, Storage, ExtensionConfig<Options, Storage> | NodeConfig<Options, Storage> | MarkConfig<Options, Storage>>;
|
|
872
872
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage, ExtendedConfig = ExtensionConfig<ExtendedOptions, ExtendedStorage> | NodeConfig<ExtendedOptions, ExtendedStorage> | MarkConfig<ExtendedOptions, ExtendedStorage>>(extendedConfig?: Partial<ExtendedConfig>): Extendable<ExtendedOptions, ExtendedStorage>;
|
|
873
873
|
}
|
|
874
|
+
|
|
874
875
|
type AnyExtension = Extendable;
|
|
875
876
|
type Extensions = AnyExtension[];
|
|
876
877
|
type ParentConfig<T> = Partial<{
|
|
@@ -1127,6 +1128,14 @@ interface EditorOptions {
|
|
|
1127
1128
|
* Whether the editor is editable
|
|
1128
1129
|
*/
|
|
1129
1130
|
editable: boolean;
|
|
1131
|
+
/**
|
|
1132
|
+
* The default text direction for all content in the editor.
|
|
1133
|
+
* When set to 'ltr' or 'rtl', all nodes will have the corresponding dir attribute.
|
|
1134
|
+
* When set to 'auto', the dir attribute will be set based on content detection.
|
|
1135
|
+
* When undefined, no dir attribute will be added.
|
|
1136
|
+
* @default undefined
|
|
1137
|
+
*/
|
|
1138
|
+
textDirection?: 'ltr' | 'rtl' | 'auto';
|
|
1130
1139
|
/**
|
|
1131
1140
|
* The editor's props
|
|
1132
1141
|
*/
|
|
@@ -1180,7 +1189,7 @@ interface EditorOptions {
|
|
|
1180
1189
|
*
|
|
1181
1190
|
* @default true
|
|
1182
1191
|
*/
|
|
1183
|
-
enableCoreExtensions?: boolean | Partial<Record<'editable' | 'clipboardTextSerializer' | 'commands' | 'focusEvents' | 'keymap' | 'tabindex' | 'drop' | 'paste' | 'delete', false>>;
|
|
1192
|
+
enableCoreExtensions?: boolean | Partial<Record<'editable' | 'clipboardTextSerializer' | 'commands' | 'focusEvents' | 'keymap' | 'tabindex' | 'drop' | 'paste' | 'delete' | 'textDirection', false>>;
|
|
1184
1193
|
/**
|
|
1185
1194
|
* If `true`, the editor will check the content for errors on initialization.
|
|
1186
1195
|
* Emitting the `contentError` event if the content is invalid.
|
|
@@ -1260,17 +1269,71 @@ interface EditorOptions {
|
|
|
1260
1269
|
*/
|
|
1261
1270
|
type HTMLContent = string;
|
|
1262
1271
|
/**
|
|
1263
|
-
*
|
|
1272
|
+
* A Tiptap JSON node or document. Tiptap JSON is the standard format for
|
|
1273
|
+
* storing and manipulating Tiptap content. It is equivalent to the JSON
|
|
1274
|
+
* representation of a Prosemirror node.
|
|
1275
|
+
*
|
|
1276
|
+
* Tiptap JSON documents are trees of nodes. The root node is usually of type
|
|
1277
|
+
* `doc`. Nodes can have other nodes as children. Nodes can also have marks and
|
|
1278
|
+
* attributes. Text nodes (nodes with type `text`) have a `text` property and no
|
|
1279
|
+
* children.
|
|
1280
|
+
*
|
|
1281
|
+
* @example
|
|
1282
|
+
* ```ts
|
|
1283
|
+
* const content: JSONContent = {
|
|
1284
|
+
* type: 'doc',
|
|
1285
|
+
* content: [
|
|
1286
|
+
* {
|
|
1287
|
+
* type: 'paragraph',
|
|
1288
|
+
* content: [
|
|
1289
|
+
* {
|
|
1290
|
+
* type: 'text',
|
|
1291
|
+
* text: 'Hello ',
|
|
1292
|
+
* },
|
|
1293
|
+
* {
|
|
1294
|
+
* type: 'text',
|
|
1295
|
+
* text: 'world',
|
|
1296
|
+
* marks: [{ type: 'bold' }],
|
|
1297
|
+
* },
|
|
1298
|
+
* ],
|
|
1299
|
+
* },
|
|
1300
|
+
* ],
|
|
1301
|
+
* }
|
|
1302
|
+
* ```
|
|
1264
1303
|
*/
|
|
1265
1304
|
type JSONContent = {
|
|
1305
|
+
/**
|
|
1306
|
+
* The type of the node
|
|
1307
|
+
*/
|
|
1266
1308
|
type?: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* The attributes of the node. Attributes can have any JSON-serializable value.
|
|
1311
|
+
*/
|
|
1267
1312
|
attrs?: Record<string, any> | undefined;
|
|
1313
|
+
/**
|
|
1314
|
+
* The children of the node. A node can have other nodes as children.
|
|
1315
|
+
*/
|
|
1268
1316
|
content?: JSONContent[];
|
|
1317
|
+
/**
|
|
1318
|
+
* A list of marks of the node. Inline nodes can have marks.
|
|
1319
|
+
*/
|
|
1269
1320
|
marks?: {
|
|
1321
|
+
/**
|
|
1322
|
+
* The type of the mark
|
|
1323
|
+
*/
|
|
1270
1324
|
type: string;
|
|
1325
|
+
/**
|
|
1326
|
+
* The attributes of the mark. Attributes can have any JSON-serializable value.
|
|
1327
|
+
*/
|
|
1271
1328
|
attrs?: Record<string, any>;
|
|
1272
1329
|
[key: string]: any;
|
|
1273
1330
|
}[];
|
|
1331
|
+
/**
|
|
1332
|
+
* The text content of the node. This property is only present on text nodes
|
|
1333
|
+
* (i.e. nodes with `type: 'text'`).
|
|
1334
|
+
*
|
|
1335
|
+
* Text nodes cannot have children, but they can have marks.
|
|
1336
|
+
*/
|
|
1274
1337
|
text?: string;
|
|
1275
1338
|
[key: string]: any;
|
|
1276
1339
|
};
|
|
@@ -1332,7 +1395,7 @@ type Attribute = {
|
|
|
1332
1395
|
keepOnSplit?: boolean;
|
|
1333
1396
|
isRequired?: boolean;
|
|
1334
1397
|
};
|
|
1335
|
-
type Attributes
|
|
1398
|
+
type Attributes = {
|
|
1336
1399
|
[key: string]: Attribute;
|
|
1337
1400
|
};
|
|
1338
1401
|
type ExtensionAttribute = {
|
|
@@ -1483,7 +1546,6 @@ type MarkdownParseHelpers = {
|
|
|
1483
1546
|
attrs?: any;
|
|
1484
1547
|
};
|
|
1485
1548
|
};
|
|
1486
|
-
|
|
1487
1549
|
/**
|
|
1488
1550
|
* Return shape for parser-level `parse` handlers.
|
|
1489
1551
|
* - a single JSON-like node
|
|
@@ -1663,59 +1725,6 @@ declare class NodePos {
|
|
|
1663
1725
|
}): void;
|
|
1664
1726
|
}
|
|
1665
1727
|
|
|
1666
|
-
interface InsertContentOptions {
|
|
1667
|
-
/**
|
|
1668
|
-
* Options for parsing the content.
|
|
1669
|
-
*/
|
|
1670
|
-
parseOptions?: ParseOptions;
|
|
1671
|
-
/**
|
|
1672
|
-
* Whether to update the selection after inserting the content.
|
|
1673
|
-
*/
|
|
1674
|
-
updateSelection?: boolean;
|
|
1675
|
-
applyInputRules?: boolean;
|
|
1676
|
-
applyPasteRules?: boolean;
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
interface InsertContentAtOptions {
|
|
1680
|
-
/**
|
|
1681
|
-
* Options for parsing the content.
|
|
1682
|
-
*/
|
|
1683
|
-
parseOptions?: ParseOptions;
|
|
1684
|
-
/**
|
|
1685
|
-
* Whether to update the selection after inserting the content.
|
|
1686
|
-
*/
|
|
1687
|
-
updateSelection?: boolean;
|
|
1688
|
-
/**
|
|
1689
|
-
* Whether to apply input rules after inserting the content.
|
|
1690
|
-
*/
|
|
1691
|
-
applyInputRules?: boolean;
|
|
1692
|
-
/**
|
|
1693
|
-
* Whether to apply paste rules after inserting the content.
|
|
1694
|
-
*/
|
|
1695
|
-
applyPasteRules?: boolean;
|
|
1696
|
-
/**
|
|
1697
|
-
* Whether to throw an error if the content is invalid.
|
|
1698
|
-
*/
|
|
1699
|
-
errorOnInvalidContent?: boolean;
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
interface SetContentOptions {
|
|
1703
|
-
/**
|
|
1704
|
-
* Options for parsing the content.
|
|
1705
|
-
* @default {}
|
|
1706
|
-
*/
|
|
1707
|
-
parseOptions?: ParseOptions;
|
|
1708
|
-
/**
|
|
1709
|
-
* Whether to throw an error if the content is invalid.
|
|
1710
|
-
*/
|
|
1711
|
-
errorOnInvalidContent?: boolean;
|
|
1712
|
-
/**
|
|
1713
|
-
* Whether to emit an update event.
|
|
1714
|
-
* @default true
|
|
1715
|
-
*/
|
|
1716
|
-
emitUpdate?: boolean;
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
1728
|
declare module '@tiptap/core' {
|
|
1720
1729
|
interface Commands<ReturnType> {
|
|
1721
1730
|
blur: {
|
|
@@ -1953,6 +1962,19 @@ declare module '@tiptap/core' {
|
|
|
1953
1962
|
};
|
|
1954
1963
|
}
|
|
1955
1964
|
}
|
|
1965
|
+
|
|
1966
|
+
interface InsertContentOptions {
|
|
1967
|
+
/**
|
|
1968
|
+
* Options for parsing the content.
|
|
1969
|
+
*/
|
|
1970
|
+
parseOptions?: ParseOptions;
|
|
1971
|
+
/**
|
|
1972
|
+
* Whether to update the selection after inserting the content.
|
|
1973
|
+
*/
|
|
1974
|
+
updateSelection?: boolean;
|
|
1975
|
+
applyInputRules?: boolean;
|
|
1976
|
+
applyPasteRules?: boolean;
|
|
1977
|
+
}
|
|
1956
1978
|
declare module '@tiptap/core' {
|
|
1957
1979
|
interface Commands<ReturnType> {
|
|
1958
1980
|
insertContent: {
|
|
@@ -1973,6 +1995,29 @@ declare module '@tiptap/core' {
|
|
|
1973
1995
|
};
|
|
1974
1996
|
}
|
|
1975
1997
|
}
|
|
1998
|
+
|
|
1999
|
+
interface InsertContentAtOptions {
|
|
2000
|
+
/**
|
|
2001
|
+
* Options for parsing the content.
|
|
2002
|
+
*/
|
|
2003
|
+
parseOptions?: ParseOptions;
|
|
2004
|
+
/**
|
|
2005
|
+
* Whether to update the selection after inserting the content.
|
|
2006
|
+
*/
|
|
2007
|
+
updateSelection?: boolean;
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether to apply input rules after inserting the content.
|
|
2010
|
+
*/
|
|
2011
|
+
applyInputRules?: boolean;
|
|
2012
|
+
/**
|
|
2013
|
+
* Whether to apply paste rules after inserting the content.
|
|
2014
|
+
*/
|
|
2015
|
+
applyPasteRules?: boolean;
|
|
2016
|
+
/**
|
|
2017
|
+
* Whether to throw an error if the content is invalid.
|
|
2018
|
+
*/
|
|
2019
|
+
errorOnInvalidContent?: boolean;
|
|
2020
|
+
}
|
|
1976
2021
|
declare module '@tiptap/core' {
|
|
1977
2022
|
interface Commands<ReturnType> {
|
|
1978
2023
|
insertContentAt: {
|
|
@@ -2242,6 +2287,23 @@ declare module '@tiptap/core' {
|
|
|
2242
2287
|
};
|
|
2243
2288
|
}
|
|
2244
2289
|
}
|
|
2290
|
+
|
|
2291
|
+
interface SetContentOptions {
|
|
2292
|
+
/**
|
|
2293
|
+
* Options for parsing the content.
|
|
2294
|
+
* @default {}
|
|
2295
|
+
*/
|
|
2296
|
+
parseOptions?: ParseOptions;
|
|
2297
|
+
/**
|
|
2298
|
+
* Whether to throw an error if the content is invalid.
|
|
2299
|
+
*/
|
|
2300
|
+
errorOnInvalidContent?: boolean;
|
|
2301
|
+
/**
|
|
2302
|
+
* Whether to emit an update event.
|
|
2303
|
+
* @default true
|
|
2304
|
+
*/
|
|
2305
|
+
emitUpdate?: boolean;
|
|
2306
|
+
}
|
|
2245
2307
|
declare module '@tiptap/core' {
|
|
2246
2308
|
interface Commands<ReturnType> {
|
|
2247
2309
|
setContent: {
|
|
@@ -2319,6 +2381,22 @@ declare module '@tiptap/core' {
|
|
|
2319
2381
|
}
|
|
2320
2382
|
}
|
|
2321
2383
|
|
|
2384
|
+
declare module '@tiptap/core' {
|
|
2385
|
+
interface Commands<ReturnType> {
|
|
2386
|
+
setTextDirection: {
|
|
2387
|
+
/**
|
|
2388
|
+
* Set the text direction for nodes.
|
|
2389
|
+
* If no position is provided, it will use the current selection.
|
|
2390
|
+
* @param direction The text direction to set ('ltr', 'rtl', or 'auto')
|
|
2391
|
+
* @param position Optional position or range to apply the direction to
|
|
2392
|
+
* @example editor.commands.setTextDirection('rtl')
|
|
2393
|
+
* @example editor.commands.setTextDirection('ltr', { from: 0, to: 10 })
|
|
2394
|
+
*/
|
|
2395
|
+
setTextDirection: (direction: 'ltr' | 'rtl' | 'auto', position?: number | Range) => ReturnType;
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2322
2400
|
declare module '@tiptap/core' {
|
|
2323
2401
|
interface Commands<ReturnType> {
|
|
2324
2402
|
setTextSelection: {
|
|
@@ -2495,6 +2573,21 @@ declare module '@tiptap/core' {
|
|
|
2495
2573
|
}
|
|
2496
2574
|
}
|
|
2497
2575
|
|
|
2576
|
+
declare module '@tiptap/core' {
|
|
2577
|
+
interface Commands<ReturnType> {
|
|
2578
|
+
unsetTextDirection: {
|
|
2579
|
+
/**
|
|
2580
|
+
* Remove the text direction attribute from nodes.
|
|
2581
|
+
* If no position is provided, it will use the current selection.
|
|
2582
|
+
* @param position Optional position or range to remove the direction from
|
|
2583
|
+
* @example editor.commands.unsetTextDirection()
|
|
2584
|
+
* @example editor.commands.unsetTextDirection({ from: 0, to: 10 })
|
|
2585
|
+
*/
|
|
2586
|
+
unsetTextDirection: (position?: number | Range) => ReturnType;
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2498
2591
|
declare module '@tiptap/core' {
|
|
2499
2592
|
interface Commands<ReturnType> {
|
|
2500
2593
|
updateAttributes: {
|
|
@@ -2544,6 +2637,7 @@ declare module '@tiptap/core' {
|
|
|
2544
2637
|
};
|
|
2545
2638
|
}
|
|
2546
2639
|
}
|
|
2640
|
+
|
|
2547
2641
|
declare class Editor extends EventEmitter<EditorEvents> {
|
|
2548
2642
|
private commandManager;
|
|
2549
2643
|
extensionManager: ExtensionManager;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _floating_ui_dom from '@floating-ui/dom';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { EditorView, EditorProps,
|
|
2
|
+
import { EditorState, Plugin, Transaction, PluginKey } from '@tiptap/pm/state';
|
|
3
|
+
import { MarkType as MarkType$1, MarkSpec, Mark as Mark$1, DOMOutputSpec, NodeType as NodeType$1, NodeSpec, Node as Node$1, Slice, ParseOptions, Schema, ResolvedPos, Fragment } from '@tiptap/pm/model';
|
|
4
|
+
import { EditorView, EditorProps, NodeView, MarkView, NodeViewConstructor, MarkViewConstructor } from '@tiptap/pm/view';
|
|
5
5
|
import { Transform } from '@tiptap/pm/transform';
|
|
6
6
|
import * as vue from 'vue';
|
|
7
7
|
import { PropType } from 'vue';
|
|
@@ -155,7 +155,7 @@ interface MarkConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
155
155
|
storage: Storage;
|
|
156
156
|
parent: ParentConfig<MarkConfig<Options, Storage>>['addAttributes'];
|
|
157
157
|
editor?: Editor;
|
|
158
|
-
}) => Attributes
|
|
158
|
+
}) => Attributes | {};
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
161
|
* The Mark class is used to create custom mark extensions.
|
|
@@ -452,7 +452,7 @@ interface NodeConfig<Options = any, Storage = any> extends ExtendableConfig<Opti
|
|
|
452
452
|
storage: Storage;
|
|
453
453
|
parent: ParentConfig<NodeConfig<Options, Storage>>['addAttributes'];
|
|
454
454
|
editor?: Editor;
|
|
455
|
-
}) => Attributes
|
|
455
|
+
}) => Attributes | {};
|
|
456
456
|
}
|
|
457
457
|
/**
|
|
458
458
|
* The Node class is used to create custom node extensions.
|
|
@@ -871,6 +871,7 @@ declare class Extendable<Options = any, Storage = any, Config = ExtensionConfig<
|
|
|
871
871
|
configure(options?: Partial<Options>): Extendable<Options, Storage, ExtensionConfig<Options, Storage> | NodeConfig<Options, Storage> | MarkConfig<Options, Storage>>;
|
|
872
872
|
extend<ExtendedOptions = Options, ExtendedStorage = Storage, ExtendedConfig = ExtensionConfig<ExtendedOptions, ExtendedStorage> | NodeConfig<ExtendedOptions, ExtendedStorage> | MarkConfig<ExtendedOptions, ExtendedStorage>>(extendedConfig?: Partial<ExtendedConfig>): Extendable<ExtendedOptions, ExtendedStorage>;
|
|
873
873
|
}
|
|
874
|
+
|
|
874
875
|
type AnyExtension = Extendable;
|
|
875
876
|
type Extensions = AnyExtension[];
|
|
876
877
|
type ParentConfig<T> = Partial<{
|
|
@@ -1127,6 +1128,14 @@ interface EditorOptions {
|
|
|
1127
1128
|
* Whether the editor is editable
|
|
1128
1129
|
*/
|
|
1129
1130
|
editable: boolean;
|
|
1131
|
+
/**
|
|
1132
|
+
* The default text direction for all content in the editor.
|
|
1133
|
+
* When set to 'ltr' or 'rtl', all nodes will have the corresponding dir attribute.
|
|
1134
|
+
* When set to 'auto', the dir attribute will be set based on content detection.
|
|
1135
|
+
* When undefined, no dir attribute will be added.
|
|
1136
|
+
* @default undefined
|
|
1137
|
+
*/
|
|
1138
|
+
textDirection?: 'ltr' | 'rtl' | 'auto';
|
|
1130
1139
|
/**
|
|
1131
1140
|
* The editor's props
|
|
1132
1141
|
*/
|
|
@@ -1180,7 +1189,7 @@ interface EditorOptions {
|
|
|
1180
1189
|
*
|
|
1181
1190
|
* @default true
|
|
1182
1191
|
*/
|
|
1183
|
-
enableCoreExtensions?: boolean | Partial<Record<'editable' | 'clipboardTextSerializer' | 'commands' | 'focusEvents' | 'keymap' | 'tabindex' | 'drop' | 'paste' | 'delete', false>>;
|
|
1192
|
+
enableCoreExtensions?: boolean | Partial<Record<'editable' | 'clipboardTextSerializer' | 'commands' | 'focusEvents' | 'keymap' | 'tabindex' | 'drop' | 'paste' | 'delete' | 'textDirection', false>>;
|
|
1184
1193
|
/**
|
|
1185
1194
|
* If `true`, the editor will check the content for errors on initialization.
|
|
1186
1195
|
* Emitting the `contentError` event if the content is invalid.
|
|
@@ -1260,17 +1269,71 @@ interface EditorOptions {
|
|
|
1260
1269
|
*/
|
|
1261
1270
|
type HTMLContent = string;
|
|
1262
1271
|
/**
|
|
1263
|
-
*
|
|
1272
|
+
* A Tiptap JSON node or document. Tiptap JSON is the standard format for
|
|
1273
|
+
* storing and manipulating Tiptap content. It is equivalent to the JSON
|
|
1274
|
+
* representation of a Prosemirror node.
|
|
1275
|
+
*
|
|
1276
|
+
* Tiptap JSON documents are trees of nodes. The root node is usually of type
|
|
1277
|
+
* `doc`. Nodes can have other nodes as children. Nodes can also have marks and
|
|
1278
|
+
* attributes. Text nodes (nodes with type `text`) have a `text` property and no
|
|
1279
|
+
* children.
|
|
1280
|
+
*
|
|
1281
|
+
* @example
|
|
1282
|
+
* ```ts
|
|
1283
|
+
* const content: JSONContent = {
|
|
1284
|
+
* type: 'doc',
|
|
1285
|
+
* content: [
|
|
1286
|
+
* {
|
|
1287
|
+
* type: 'paragraph',
|
|
1288
|
+
* content: [
|
|
1289
|
+
* {
|
|
1290
|
+
* type: 'text',
|
|
1291
|
+
* text: 'Hello ',
|
|
1292
|
+
* },
|
|
1293
|
+
* {
|
|
1294
|
+
* type: 'text',
|
|
1295
|
+
* text: 'world',
|
|
1296
|
+
* marks: [{ type: 'bold' }],
|
|
1297
|
+
* },
|
|
1298
|
+
* ],
|
|
1299
|
+
* },
|
|
1300
|
+
* ],
|
|
1301
|
+
* }
|
|
1302
|
+
* ```
|
|
1264
1303
|
*/
|
|
1265
1304
|
type JSONContent = {
|
|
1305
|
+
/**
|
|
1306
|
+
* The type of the node
|
|
1307
|
+
*/
|
|
1266
1308
|
type?: string;
|
|
1309
|
+
/**
|
|
1310
|
+
* The attributes of the node. Attributes can have any JSON-serializable value.
|
|
1311
|
+
*/
|
|
1267
1312
|
attrs?: Record<string, any> | undefined;
|
|
1313
|
+
/**
|
|
1314
|
+
* The children of the node. A node can have other nodes as children.
|
|
1315
|
+
*/
|
|
1268
1316
|
content?: JSONContent[];
|
|
1317
|
+
/**
|
|
1318
|
+
* A list of marks of the node. Inline nodes can have marks.
|
|
1319
|
+
*/
|
|
1269
1320
|
marks?: {
|
|
1321
|
+
/**
|
|
1322
|
+
* The type of the mark
|
|
1323
|
+
*/
|
|
1270
1324
|
type: string;
|
|
1325
|
+
/**
|
|
1326
|
+
* The attributes of the mark. Attributes can have any JSON-serializable value.
|
|
1327
|
+
*/
|
|
1271
1328
|
attrs?: Record<string, any>;
|
|
1272
1329
|
[key: string]: any;
|
|
1273
1330
|
}[];
|
|
1331
|
+
/**
|
|
1332
|
+
* The text content of the node. This property is only present on text nodes
|
|
1333
|
+
* (i.e. nodes with `type: 'text'`).
|
|
1334
|
+
*
|
|
1335
|
+
* Text nodes cannot have children, but they can have marks.
|
|
1336
|
+
*/
|
|
1274
1337
|
text?: string;
|
|
1275
1338
|
[key: string]: any;
|
|
1276
1339
|
};
|
|
@@ -1332,7 +1395,7 @@ type Attribute = {
|
|
|
1332
1395
|
keepOnSplit?: boolean;
|
|
1333
1396
|
isRequired?: boolean;
|
|
1334
1397
|
};
|
|
1335
|
-
type Attributes
|
|
1398
|
+
type Attributes = {
|
|
1336
1399
|
[key: string]: Attribute;
|
|
1337
1400
|
};
|
|
1338
1401
|
type ExtensionAttribute = {
|
|
@@ -1483,7 +1546,6 @@ type MarkdownParseHelpers = {
|
|
|
1483
1546
|
attrs?: any;
|
|
1484
1547
|
};
|
|
1485
1548
|
};
|
|
1486
|
-
|
|
1487
1549
|
/**
|
|
1488
1550
|
* Return shape for parser-level `parse` handlers.
|
|
1489
1551
|
* - a single JSON-like node
|
|
@@ -1663,59 +1725,6 @@ declare class NodePos {
|
|
|
1663
1725
|
}): void;
|
|
1664
1726
|
}
|
|
1665
1727
|
|
|
1666
|
-
interface InsertContentOptions {
|
|
1667
|
-
/**
|
|
1668
|
-
* Options for parsing the content.
|
|
1669
|
-
*/
|
|
1670
|
-
parseOptions?: ParseOptions;
|
|
1671
|
-
/**
|
|
1672
|
-
* Whether to update the selection after inserting the content.
|
|
1673
|
-
*/
|
|
1674
|
-
updateSelection?: boolean;
|
|
1675
|
-
applyInputRules?: boolean;
|
|
1676
|
-
applyPasteRules?: boolean;
|
|
1677
|
-
}
|
|
1678
|
-
|
|
1679
|
-
interface InsertContentAtOptions {
|
|
1680
|
-
/**
|
|
1681
|
-
* Options for parsing the content.
|
|
1682
|
-
*/
|
|
1683
|
-
parseOptions?: ParseOptions;
|
|
1684
|
-
/**
|
|
1685
|
-
* Whether to update the selection after inserting the content.
|
|
1686
|
-
*/
|
|
1687
|
-
updateSelection?: boolean;
|
|
1688
|
-
/**
|
|
1689
|
-
* Whether to apply input rules after inserting the content.
|
|
1690
|
-
*/
|
|
1691
|
-
applyInputRules?: boolean;
|
|
1692
|
-
/**
|
|
1693
|
-
* Whether to apply paste rules after inserting the content.
|
|
1694
|
-
*/
|
|
1695
|
-
applyPasteRules?: boolean;
|
|
1696
|
-
/**
|
|
1697
|
-
* Whether to throw an error if the content is invalid.
|
|
1698
|
-
*/
|
|
1699
|
-
errorOnInvalidContent?: boolean;
|
|
1700
|
-
}
|
|
1701
|
-
|
|
1702
|
-
interface SetContentOptions {
|
|
1703
|
-
/**
|
|
1704
|
-
* Options for parsing the content.
|
|
1705
|
-
* @default {}
|
|
1706
|
-
*/
|
|
1707
|
-
parseOptions?: ParseOptions;
|
|
1708
|
-
/**
|
|
1709
|
-
* Whether to throw an error if the content is invalid.
|
|
1710
|
-
*/
|
|
1711
|
-
errorOnInvalidContent?: boolean;
|
|
1712
|
-
/**
|
|
1713
|
-
* Whether to emit an update event.
|
|
1714
|
-
* @default true
|
|
1715
|
-
*/
|
|
1716
|
-
emitUpdate?: boolean;
|
|
1717
|
-
}
|
|
1718
|
-
|
|
1719
1728
|
declare module '@tiptap/core' {
|
|
1720
1729
|
interface Commands<ReturnType> {
|
|
1721
1730
|
blur: {
|
|
@@ -1953,6 +1962,19 @@ declare module '@tiptap/core' {
|
|
|
1953
1962
|
};
|
|
1954
1963
|
}
|
|
1955
1964
|
}
|
|
1965
|
+
|
|
1966
|
+
interface InsertContentOptions {
|
|
1967
|
+
/**
|
|
1968
|
+
* Options for parsing the content.
|
|
1969
|
+
*/
|
|
1970
|
+
parseOptions?: ParseOptions;
|
|
1971
|
+
/**
|
|
1972
|
+
* Whether to update the selection after inserting the content.
|
|
1973
|
+
*/
|
|
1974
|
+
updateSelection?: boolean;
|
|
1975
|
+
applyInputRules?: boolean;
|
|
1976
|
+
applyPasteRules?: boolean;
|
|
1977
|
+
}
|
|
1956
1978
|
declare module '@tiptap/core' {
|
|
1957
1979
|
interface Commands<ReturnType> {
|
|
1958
1980
|
insertContent: {
|
|
@@ -1973,6 +1995,29 @@ declare module '@tiptap/core' {
|
|
|
1973
1995
|
};
|
|
1974
1996
|
}
|
|
1975
1997
|
}
|
|
1998
|
+
|
|
1999
|
+
interface InsertContentAtOptions {
|
|
2000
|
+
/**
|
|
2001
|
+
* Options for parsing the content.
|
|
2002
|
+
*/
|
|
2003
|
+
parseOptions?: ParseOptions;
|
|
2004
|
+
/**
|
|
2005
|
+
* Whether to update the selection after inserting the content.
|
|
2006
|
+
*/
|
|
2007
|
+
updateSelection?: boolean;
|
|
2008
|
+
/**
|
|
2009
|
+
* Whether to apply input rules after inserting the content.
|
|
2010
|
+
*/
|
|
2011
|
+
applyInputRules?: boolean;
|
|
2012
|
+
/**
|
|
2013
|
+
* Whether to apply paste rules after inserting the content.
|
|
2014
|
+
*/
|
|
2015
|
+
applyPasteRules?: boolean;
|
|
2016
|
+
/**
|
|
2017
|
+
* Whether to throw an error if the content is invalid.
|
|
2018
|
+
*/
|
|
2019
|
+
errorOnInvalidContent?: boolean;
|
|
2020
|
+
}
|
|
1976
2021
|
declare module '@tiptap/core' {
|
|
1977
2022
|
interface Commands<ReturnType> {
|
|
1978
2023
|
insertContentAt: {
|
|
@@ -2242,6 +2287,23 @@ declare module '@tiptap/core' {
|
|
|
2242
2287
|
};
|
|
2243
2288
|
}
|
|
2244
2289
|
}
|
|
2290
|
+
|
|
2291
|
+
interface SetContentOptions {
|
|
2292
|
+
/**
|
|
2293
|
+
* Options for parsing the content.
|
|
2294
|
+
* @default {}
|
|
2295
|
+
*/
|
|
2296
|
+
parseOptions?: ParseOptions;
|
|
2297
|
+
/**
|
|
2298
|
+
* Whether to throw an error if the content is invalid.
|
|
2299
|
+
*/
|
|
2300
|
+
errorOnInvalidContent?: boolean;
|
|
2301
|
+
/**
|
|
2302
|
+
* Whether to emit an update event.
|
|
2303
|
+
* @default true
|
|
2304
|
+
*/
|
|
2305
|
+
emitUpdate?: boolean;
|
|
2306
|
+
}
|
|
2245
2307
|
declare module '@tiptap/core' {
|
|
2246
2308
|
interface Commands<ReturnType> {
|
|
2247
2309
|
setContent: {
|
|
@@ -2319,6 +2381,22 @@ declare module '@tiptap/core' {
|
|
|
2319
2381
|
}
|
|
2320
2382
|
}
|
|
2321
2383
|
|
|
2384
|
+
declare module '@tiptap/core' {
|
|
2385
|
+
interface Commands<ReturnType> {
|
|
2386
|
+
setTextDirection: {
|
|
2387
|
+
/**
|
|
2388
|
+
* Set the text direction for nodes.
|
|
2389
|
+
* If no position is provided, it will use the current selection.
|
|
2390
|
+
* @param direction The text direction to set ('ltr', 'rtl', or 'auto')
|
|
2391
|
+
* @param position Optional position or range to apply the direction to
|
|
2392
|
+
* @example editor.commands.setTextDirection('rtl')
|
|
2393
|
+
* @example editor.commands.setTextDirection('ltr', { from: 0, to: 10 })
|
|
2394
|
+
*/
|
|
2395
|
+
setTextDirection: (direction: 'ltr' | 'rtl' | 'auto', position?: number | Range) => ReturnType;
|
|
2396
|
+
};
|
|
2397
|
+
}
|
|
2398
|
+
}
|
|
2399
|
+
|
|
2322
2400
|
declare module '@tiptap/core' {
|
|
2323
2401
|
interface Commands<ReturnType> {
|
|
2324
2402
|
setTextSelection: {
|
|
@@ -2495,6 +2573,21 @@ declare module '@tiptap/core' {
|
|
|
2495
2573
|
}
|
|
2496
2574
|
}
|
|
2497
2575
|
|
|
2576
|
+
declare module '@tiptap/core' {
|
|
2577
|
+
interface Commands<ReturnType> {
|
|
2578
|
+
unsetTextDirection: {
|
|
2579
|
+
/**
|
|
2580
|
+
* Remove the text direction attribute from nodes.
|
|
2581
|
+
* If no position is provided, it will use the current selection.
|
|
2582
|
+
* @param position Optional position or range to remove the direction from
|
|
2583
|
+
* @example editor.commands.unsetTextDirection()
|
|
2584
|
+
* @example editor.commands.unsetTextDirection({ from: 0, to: 10 })
|
|
2585
|
+
*/
|
|
2586
|
+
unsetTextDirection: (position?: number | Range) => ReturnType;
|
|
2587
|
+
};
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
|
|
2498
2591
|
declare module '@tiptap/core' {
|
|
2499
2592
|
interface Commands<ReturnType> {
|
|
2500
2593
|
updateAttributes: {
|
|
@@ -2544,6 +2637,7 @@ declare module '@tiptap/core' {
|
|
|
2544
2637
|
};
|
|
2545
2638
|
}
|
|
2546
2639
|
}
|
|
2640
|
+
|
|
2547
2641
|
declare class Editor extends EventEmitter<EditorEvents> {
|
|
2548
2642
|
private commandManager;
|
|
2549
2643
|
extensionManager: ExtensionManager;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-drag-handle-vue-3",
|
|
3
3
|
"description": "drag handle extension for tiptap with vue 3",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.11.0",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -37,15 +37,15 @@
|
|
|
37
37
|
],
|
|
38
38
|
"peerDependencies": {
|
|
39
39
|
"vue": "^3.0.0",
|
|
40
|
-
"@tiptap/extension-drag-handle": "^3.
|
|
41
|
-
"@tiptap/pm": "^3.
|
|
42
|
-
"@tiptap/vue-3": "^3.
|
|
40
|
+
"@tiptap/extension-drag-handle": "^3.11.0",
|
|
41
|
+
"@tiptap/pm": "^3.11.0",
|
|
42
|
+
"@tiptap/vue-3": "^3.11.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"vue": "^3.0.0",
|
|
46
|
-
"@tiptap/extension-drag-handle": "^3.
|
|
47
|
-
"@tiptap/
|
|
48
|
-
"@tiptap/
|
|
46
|
+
"@tiptap/extension-drag-handle": "^3.11.0",
|
|
47
|
+
"@tiptap/vue-3": "^3.11.0",
|
|
48
|
+
"@tiptap/pm": "^3.11.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup",
|