@tiptap/extension-table-cell 2.3.2 → 2.5.0-beta.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.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -0
- package/dist/index.umd.js.map +1 -1
- package/dist/packages/extension-table-cell/src/table-cell.d.ts +9 -0
- package/package.json +2 -2
- package/src/table-cell.ts +9 -0
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var core = require('@tiptap/core');
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* This extension allows you to create table cells.
|
|
9
|
+
* @see https://www.tiptap.dev/api/nodes/table-cell
|
|
10
|
+
*/
|
|
7
11
|
const TableCell = core.Node.create({
|
|
8
12
|
name: 'tableCell',
|
|
9
13
|
addOptions() {
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","sources":["../src/table-cell.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableCellOptions {\n HTMLAttributes: Record<string, any>,\n}\n\nexport const TableCell = Node.create<TableCellOptions>({\n name: 'tableCell',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n addAttributes() {\n return {\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n parseHTML: element => {\n const colwidth = element.getAttribute('colwidth')\n const value = colwidth\n ? [parseInt(colwidth, 10)]\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'td' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['td', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":["../src/table-cell.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableCellOptions {\n /**\n * The HTML attributes for a table cell node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>,\n}\n\n/**\n * This extension allows you to create table cells.\n * @see https://www.tiptap.dev/api/nodes/table-cell\n */\nexport const TableCell = Node.create<TableCellOptions>({\n name: 'tableCell',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n addAttributes() {\n return {\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n parseHTML: element => {\n const colwidth = element.getAttribute('colwidth')\n const value = colwidth\n ? [parseInt(colwidth, 10)]\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'td' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['td', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;AAWA;;;AAGG;AACU,MAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAAmB;AACrD,IAAA,IAAI,EAAE,WAAW;IAEjB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;AAED,IAAA,OAAO,EAAE,QAAQ;IAEjB,aAAa,GAAA;QACX,OAAO;AACL,YAAA,OAAO,EAAE;AACP,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA,OAAO,EAAE;AACP,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,OAAO,IAAG;oBACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;oBACjD,MAAM,KAAK,GAAG,QAAQ;0BAClB,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;0BACxB,IAAI,CAAA;AAER,oBAAA,OAAO,KAAK,CAAA;iBACb;AACF,aAAA;SACF,CAAA;KACF;AAED,IAAA,SAAS,EAAE,MAAM;AAEjB,IAAA,SAAS,EAAE,IAAI;IAEf,SAAS,GAAA;QACP,OAAO;YACL,EAAE,GAAG,EAAE,IAAI,EAAE;SACd,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,IAAI,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAC/E;AAEF,CAAA;;;;;"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../src/table-cell.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableCellOptions {\n HTMLAttributes: Record<string, any>,\n}\n\nexport const TableCell = Node.create<TableCellOptions>({\n name: 'tableCell',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n addAttributes() {\n return {\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n parseHTML: element => {\n const colwidth = element.getAttribute('colwidth')\n const value = colwidth\n ? [parseInt(colwidth, 10)]\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'td' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['td', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/table-cell.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableCellOptions {\n /**\n * The HTML attributes for a table cell node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>,\n}\n\n/**\n * This extension allows you to create table cells.\n * @see https://www.tiptap.dev/api/nodes/table-cell\n */\nexport const TableCell = Node.create<TableCellOptions>({\n name: 'tableCell',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n addAttributes() {\n return {\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n parseHTML: element => {\n const colwidth = element.getAttribute('colwidth')\n const value = colwidth\n ? [parseInt(colwidth, 10)]\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'td' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['td', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"names":[],"mappings":";;AAWA;;;AAGG;AACU,MAAA,SAAS,GAAG,IAAI,CAAC,MAAM,CAAmB;AACrD,IAAA,IAAI,EAAE,WAAW;IAEjB,UAAU,GAAA;QACR,OAAO;AACL,YAAA,cAAc,EAAE,EAAE;SACnB,CAAA;KACF;AAED,IAAA,OAAO,EAAE,QAAQ;IAEjB,aAAa,GAAA;QACX,OAAO;AACL,YAAA,OAAO,EAAE;AACP,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA,OAAO,EAAE;AACP,gBAAA,OAAO,EAAE,CAAC;AACX,aAAA;AACD,YAAA,QAAQ,EAAE;AACR,gBAAA,OAAO,EAAE,IAAI;gBACb,SAAS,EAAE,OAAO,IAAG;oBACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;oBACjD,MAAM,KAAK,GAAG,QAAQ;0BAClB,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;0BACxB,IAAI,CAAA;AAER,oBAAA,OAAO,KAAK,CAAA;iBACb;AACF,aAAA;SACF,CAAA;KACF;AAED,IAAA,SAAS,EAAE,MAAM;AAEjB,IAAA,SAAS,EAAE,IAAI;IAEf,SAAS,GAAA;QACP,OAAO;YACL,EAAE,GAAG,EAAE,IAAI,EAAE;SACd,CAAA;KACF;IAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;AAC3B,QAAA,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;KAC/E;AAEF,CAAA;;;;"}
|
package/dist/index.umd.js
CHANGED
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["@tiptap/extension-table-cell"] = {}, global.core));
|
|
5
5
|
})(this, (function (exports, core) { 'use strict';
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* This extension allows you to create table cells.
|
|
9
|
+
* @see https://www.tiptap.dev/api/nodes/table-cell
|
|
10
|
+
*/
|
|
7
11
|
const TableCell = core.Node.create({
|
|
8
12
|
name: 'tableCell',
|
|
9
13
|
addOptions() {
|
package/dist/index.umd.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.umd.js","sources":["../src/table-cell.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableCellOptions {\n HTMLAttributes: Record<string, any>,\n}\n\nexport const TableCell = Node.create<TableCellOptions>({\n name: 'tableCell',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n addAttributes() {\n return {\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n parseHTML: element => {\n const colwidth = element.getAttribute('colwidth')\n const value = colwidth\n ? [parseInt(colwidth, 10)]\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'td' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['td', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"index.umd.js","sources":["../src/table-cell.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableCellOptions {\n /**\n * The HTML attributes for a table cell node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>,\n}\n\n/**\n * This extension allows you to create table cells.\n * @see https://www.tiptap.dev/api/nodes/table-cell\n */\nexport const TableCell = Node.create<TableCellOptions>({\n name: 'tableCell',\n\n addOptions() {\n return {\n HTMLAttributes: {},\n }\n },\n\n content: 'block+',\n\n addAttributes() {\n return {\n colspan: {\n default: 1,\n },\n rowspan: {\n default: 1,\n },\n colwidth: {\n default: null,\n parseHTML: element => {\n const colwidth = element.getAttribute('colwidth')\n const value = colwidth\n ? [parseInt(colwidth, 10)]\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'td' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['td', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"names":["Node","mergeAttributes"],"mappings":";;;;;;EAWA;;;EAGG;AACU,QAAA,SAAS,GAAGA,SAAI,CAAC,MAAM,CAAmB;EACrD,IAAA,IAAI,EAAE,WAAW;MAEjB,UAAU,GAAA;UACR,OAAO;EACL,YAAA,cAAc,EAAE,EAAE;WACnB,CAAA;OACF;EAED,IAAA,OAAO,EAAE,QAAQ;MAEjB,aAAa,GAAA;UACX,OAAO;EACL,YAAA,OAAO,EAAE;EACP,gBAAA,OAAO,EAAE,CAAC;EACX,aAAA;EACD,YAAA,OAAO,EAAE;EACP,gBAAA,OAAO,EAAE,CAAC;EACX,aAAA;EACD,YAAA,QAAQ,EAAE;EACR,gBAAA,OAAO,EAAE,IAAI;kBACb,SAAS,EAAE,OAAO,IAAG;sBACnB,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;sBACjD,MAAM,KAAK,GAAG,QAAQ;4BAClB,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;4BACxB,IAAI,CAAA;EAER,oBAAA,OAAO,KAAK,CAAA;mBACb;EACF,aAAA;WACF,CAAA;OACF;EAED,IAAA,SAAS,EAAE,MAAM;EAEjB,IAAA,SAAS,EAAE,IAAI;MAEf,SAAS,GAAA;UACP,OAAO;cACL,EAAE,GAAG,EAAE,IAAI,EAAE;WACd,CAAA;OACF;MAED,UAAU,CAAC,EAAE,cAAc,EAAE,EAAA;EAC3B,QAAA,OAAO,CAAC,IAAI,EAAEC,oBAAe,CAAC,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,cAAc,CAAC,EAAE,CAAC,CAAC,CAAA;OAC/E;EAEF,CAAA;;;;;;;;;;;"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { Node } from '@tiptap/core';
|
|
2
2
|
export interface TableCellOptions {
|
|
3
|
+
/**
|
|
4
|
+
* The HTML attributes for a table cell node.
|
|
5
|
+
* @default {}
|
|
6
|
+
* @example { class: 'foo' }
|
|
7
|
+
*/
|
|
3
8
|
HTMLAttributes: Record<string, any>;
|
|
4
9
|
}
|
|
10
|
+
/**
|
|
11
|
+
* This extension allows you to create table cells.
|
|
12
|
+
* @see https://www.tiptap.dev/api/nodes/table-cell
|
|
13
|
+
*/
|
|
5
14
|
export declare const TableCell: Node<TableCellOptions, any>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tiptap/extension-table-cell",
|
|
3
3
|
"description": "table cell extension for tiptap",
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.5.0-beta.0",
|
|
5
5
|
"homepage": "https://tiptap.dev",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"tiptap",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@tiptap/core": "^2.
|
|
32
|
+
"@tiptap/core": "^2.5.0-beta.0"
|
|
33
33
|
},
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@tiptap/core": "^2.0.0"
|
package/src/table-cell.ts
CHANGED
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import { mergeAttributes, Node } from '@tiptap/core'
|
|
2
2
|
|
|
3
3
|
export interface TableCellOptions {
|
|
4
|
+
/**
|
|
5
|
+
* The HTML attributes for a table cell node.
|
|
6
|
+
* @default {}
|
|
7
|
+
* @example { class: 'foo' }
|
|
8
|
+
*/
|
|
4
9
|
HTMLAttributes: Record<string, any>,
|
|
5
10
|
}
|
|
6
11
|
|
|
12
|
+
/**
|
|
13
|
+
* This extension allows you to create table cells.
|
|
14
|
+
* @see https://www.tiptap.dev/api/nodes/table-cell
|
|
15
|
+
*/
|
|
7
16
|
export const TableCell = Node.create<TableCellOptions>({
|
|
8
17
|
name: 'tableCell',
|
|
9
18
|
|