@tiptap/extension-drag-handle-vue-3 3.19.0 → 3.20.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 CHANGED
@@ -688,6 +688,26 @@ interface ExtendableConfig<Options = any, Storage = any, Config extends Extensio
688
688
  type: PMType;
689
689
  parent: ParentConfig<Config>['addProseMirrorPlugins'];
690
690
  }) => Plugin[];
691
+ /**
692
+ * This function transforms pasted HTML content before it's parsed.
693
+ * Extensions can use this to modify or clean up pasted HTML.
694
+ * The transformations are chained - each extension's transform receives
695
+ * the output from the previous extension's transform.
696
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#transform-pasted-html
697
+ * @example
698
+ * transformPastedHTML(html) {
699
+ * // Remove all style attributes
700
+ * return html.replace(/style="[^"]*"/g, '')
701
+ * }
702
+ */
703
+ transformPastedHTML?: (this: {
704
+ name: string;
705
+ options: Options;
706
+ storage: Storage;
707
+ editor: Editor;
708
+ type: PMType;
709
+ parent: ParentConfig<Config>['transformPastedHTML'];
710
+ }, html: string) => string;
691
711
  /**
692
712
  * This function adds additional extensions to the editor. This is useful for
693
713
  * building extension kits.
@@ -1454,8 +1474,18 @@ type ExtensionAttribute = {
1454
1474
  type GlobalAttributes = {
1455
1475
  /**
1456
1476
  * The node & mark types this attribute should be applied to.
1477
+ * Can be a specific array of type names, or a shorthand string:
1478
+ * - `'*'` applies to all nodes (excluding text) and all marks
1479
+ * - `'nodes'` applies to all nodes (excluding the built-in text node)
1480
+ * - `'marks'` applies to all marks
1481
+ * - `string[]` applies to specific node/mark types by name
1482
+ * @example
1483
+ * types: '*' // All nodes and marks
1484
+ * types: 'nodes' // All nodes
1485
+ * types: 'marks' // All marks
1486
+ * types: ['heading', 'paragraph'] // Specific types
1457
1487
  */
1458
- types: string[];
1488
+ types: string[] | 'nodes' | 'marks' | '*';
1459
1489
  /**
1460
1490
  * The attributes to add to the node or mark types.
1461
1491
  */
@@ -1781,6 +1811,12 @@ declare class ExtensionManager {
1781
1811
  * @returns A composed dispatch function
1782
1812
  */
1783
1813
  dispatchTransaction(baseDispatch: (tr: Transaction) => void): (tr: Transaction) => void;
1814
+ /**
1815
+ * Get the composed transformPastedHTML function from all extensions.
1816
+ * @param baseTransform The base transform function (e.g. from the editor props)
1817
+ * @returns A composed transform function that chains all extension transforms
1818
+ */
1819
+ transformPastedHTML(baseTransform?: (html: string, view?: any) => string): (html: string, view?: EditorView) => string;
1784
1820
  get markViews(): Record<string, MarkViewConstructor>;
1785
1821
  /**
1786
1822
  * Go through all extensions, create extension storages & setup marks
@@ -2807,7 +2843,7 @@ declare class Editor extends EventEmitter<EditorEvents> {
2807
2843
  */
2808
2844
  get isEditable(): boolean;
2809
2845
  /**
2810
- * Returns the editor state.
2846
+ * Returns the editor view.
2811
2847
  */
2812
2848
  get view(): EditorView;
2813
2849
  /**
package/dist/index.d.ts CHANGED
@@ -688,6 +688,26 @@ interface ExtendableConfig<Options = any, Storage = any, Config extends Extensio
688
688
  type: PMType;
689
689
  parent: ParentConfig<Config>['addProseMirrorPlugins'];
690
690
  }) => Plugin[];
691
+ /**
692
+ * This function transforms pasted HTML content before it's parsed.
693
+ * Extensions can use this to modify or clean up pasted HTML.
694
+ * The transformations are chained - each extension's transform receives
695
+ * the output from the previous extension's transform.
696
+ * @see https://tiptap.dev/docs/editor/guide/custom-extensions#transform-pasted-html
697
+ * @example
698
+ * transformPastedHTML(html) {
699
+ * // Remove all style attributes
700
+ * return html.replace(/style="[^"]*"/g, '')
701
+ * }
702
+ */
703
+ transformPastedHTML?: (this: {
704
+ name: string;
705
+ options: Options;
706
+ storage: Storage;
707
+ editor: Editor;
708
+ type: PMType;
709
+ parent: ParentConfig<Config>['transformPastedHTML'];
710
+ }, html: string) => string;
691
711
  /**
692
712
  * This function adds additional extensions to the editor. This is useful for
693
713
  * building extension kits.
@@ -1454,8 +1474,18 @@ type ExtensionAttribute = {
1454
1474
  type GlobalAttributes = {
1455
1475
  /**
1456
1476
  * The node & mark types this attribute should be applied to.
1477
+ * Can be a specific array of type names, or a shorthand string:
1478
+ * - `'*'` applies to all nodes (excluding text) and all marks
1479
+ * - `'nodes'` applies to all nodes (excluding the built-in text node)
1480
+ * - `'marks'` applies to all marks
1481
+ * - `string[]` applies to specific node/mark types by name
1482
+ * @example
1483
+ * types: '*' // All nodes and marks
1484
+ * types: 'nodes' // All nodes
1485
+ * types: 'marks' // All marks
1486
+ * types: ['heading', 'paragraph'] // Specific types
1457
1487
  */
1458
- types: string[];
1488
+ types: string[] | 'nodes' | 'marks' | '*';
1459
1489
  /**
1460
1490
  * The attributes to add to the node or mark types.
1461
1491
  */
@@ -1781,6 +1811,12 @@ declare class ExtensionManager {
1781
1811
  * @returns A composed dispatch function
1782
1812
  */
1783
1813
  dispatchTransaction(baseDispatch: (tr: Transaction) => void): (tr: Transaction) => void;
1814
+ /**
1815
+ * Get the composed transformPastedHTML function from all extensions.
1816
+ * @param baseTransform The base transform function (e.g. from the editor props)
1817
+ * @returns A composed transform function that chains all extension transforms
1818
+ */
1819
+ transformPastedHTML(baseTransform?: (html: string, view?: any) => string): (html: string, view?: EditorView) => string;
1784
1820
  get markViews(): Record<string, MarkViewConstructor>;
1785
1821
  /**
1786
1822
  * Go through all extensions, create extension storages & setup marks
@@ -2807,7 +2843,7 @@ declare class Editor extends EventEmitter<EditorEvents> {
2807
2843
  */
2808
2844
  get isEditable(): boolean;
2809
2845
  /**
2810
- * Returns the editor state.
2846
+ * Returns the editor view.
2811
2847
  */
2812
2848
  get view(): EditorView;
2813
2849
  /**
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.19.0",
4
+ "version": "3.20.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.19.0",
41
- "@tiptap/pm": "^3.19.0",
42
- "@tiptap/vue-3": "^3.19.0"
40
+ "@tiptap/extension-drag-handle": "^3.20.0",
41
+ "@tiptap/pm": "^3.20.0",
42
+ "@tiptap/vue-3": "^3.20.0"
43
43
  },
44
44
  "devDependencies": {
45
45
  "vue": "^3.0.0",
46
- "@tiptap/pm": "^3.19.0",
47
- "@tiptap/extension-drag-handle": "^3.19.0",
48
- "@tiptap/vue-3": "^3.19.0"
46
+ "@tiptap/pm": "^3.20.0",
47
+ "@tiptap/extension-drag-handle": "^3.20.0",
48
+ "@tiptap/vue-3": "^3.20.0"
49
49
  },
50
50
  "scripts": {
51
51
  "build": "tsup",