@tiptap/extension-table-header 3.0.0-next.3 → 3.0.0-next.4

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/LICENSE.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024, Tiptap GmbH
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,14 +1,18 @@
1
1
  # @tiptap/extension-table-header
2
+
2
3
  [![Version](https://img.shields.io/npm/v/@tiptap/extension-table-header.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-table-header)
3
4
  [![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-table-header.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
4
5
  [![License](https://img.shields.io/npm/l/@tiptap/extension-table-header.svg)](https://www.npmjs.com/package/@tiptap/extension-table-header)
5
6
  [![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
6
7
 
7
8
  ## Introduction
8
- Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as *New York Times*, *The Guardian* or *Atlassian*.
9
+
10
+ Tiptap is a headless wrapper around [ProseMirror](https://ProseMirror.net) – a toolkit for building rich text WYSIWYG editors, which is already in use at many well-known companies such as _New York Times_, _The Guardian_ or _Atlassian_.
9
11
 
10
12
  ## Official Documentation
13
+
11
14
  Documentation can be found on the [Tiptap website](https://tiptap.dev).
12
15
 
13
16
  ## License
17
+
14
18
  Tiptap is open sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap/blob/main/LICENSE.md).
package/dist/index.cjs CHANGED
@@ -18,57 +18,19 @@ var __copyProps = (to, from, except, desc) => {
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
19
 
20
20
  // src/index.ts
21
- var src_exports = {};
22
- __export(src_exports, {
23
- TableHeader: () => TableHeader,
24
- default: () => src_default
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ TableHeader: () => import_extension_table2.TableHeader,
24
+ TableHeaderOptions: () => import_extension_table2.TableHeaderOptions,
25
+ default: () => index_default
25
26
  });
26
- module.exports = __toCommonJS(src_exports);
27
-
28
- // src/table-header.ts
29
- var import_core = require("@tiptap/core");
30
- var TableHeader = import_core.Node.create({
31
- name: "tableHeader",
32
- addOptions() {
33
- return {
34
- HTMLAttributes: {}
35
- };
36
- },
37
- content: "block+",
38
- addAttributes() {
39
- return {
40
- colspan: {
41
- default: 1
42
- },
43
- rowspan: {
44
- default: 1
45
- },
46
- colwidth: {
47
- default: null,
48
- parseHTML: (element) => {
49
- const colwidth = element.getAttribute("colwidth");
50
- const value = colwidth ? colwidth.split(",").map((width) => parseInt(width, 10)) : null;
51
- return value;
52
- }
53
- }
54
- };
55
- },
56
- tableRole: "header_cell",
57
- isolating: true,
58
- parseHTML() {
59
- return [
60
- { tag: "th" }
61
- ];
62
- },
63
- renderHTML({ HTMLAttributes }) {
64
- return ["th", (0, import_core.mergeAttributes)(this.options.HTMLAttributes, HTMLAttributes), 0];
65
- }
66
- });
67
-
68
- // src/index.ts
69
- var src_default = TableHeader;
27
+ module.exports = __toCommonJS(index_exports);
28
+ var import_extension_table = require("@tiptap/extension-table");
29
+ var import_extension_table2 = require("@tiptap/extension-table");
30
+ var index_default = import_extension_table.TableHeader;
70
31
  // Annotate the CommonJS export names for ESM import in node:
71
32
  0 && (module.exports = {
72
- TableHeader
33
+ TableHeader,
34
+ TableHeaderOptions
73
35
  });
74
36
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/table-header.ts"],"sourcesContent":["import { TableHeader } from './table-header.js'\n\nexport * from './table-header.js'\n\nexport default TableHeader\n","import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableHeaderOptions {\n /**\n * The HTML attributes for a table header node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>,\n}\n\n/**\n * This extension allows you to create table headers.\n * @see https://www.tiptap.dev/api/nodes/table-header\n */\nexport const TableHeader = Node.create<TableHeaderOptions>({\n name: 'tableHeader',\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 ? colwidth.split(',').map(width => parseInt(width, 10))\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'header_cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'th' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['th', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AAe/B,IAAM,cAAc,iBAAK,OAA2B;AAAA,EACzD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,SAAS;AAAA,EAET,gBAAgB;AACd,WAAO;AAAA,MACL,SAAS;AAAA,QACP,SAAS;AAAA,MACX;AAAA,MACA,SAAS;AAAA,QACP,SAAS;AAAA,MACX;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,WAAW,aAAW;AACpB,gBAAM,WAAW,QAAQ,aAAa,UAAU;AAChD,gBAAM,QAAQ,WACV,SAAS,MAAM,GAAG,EAAE,IAAI,WAAS,SAAS,OAAO,EAAE,CAAC,IACpD;AAEJ,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW;AAAA,EAEX,WAAW;AAAA,EAEX,YAAY;AACV,WAAO;AAAA,MACL,EAAE,KAAK,KAAK;AAAA,IACd;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,UAAM,6BAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAC/E;AAEF,CAAC;;;AD1DD,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { TableHeader } from '@tiptap/extension-table'\n\nexport { TableHeader, TableHeaderOptions } from '@tiptap/extension-table'\n\nexport default TableHeader\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAA4B;AAE5B,IAAAA,0BAAgD;AAEhD,IAAO,gBAAQ;","names":["import_extension_table"]}
package/dist/index.d.cts CHANGED
@@ -1,17 +1,2 @@
1
- import { Node } from '@tiptap/core';
2
-
3
- interface TableHeaderOptions {
4
- /**
5
- * The HTML attributes for a table header node.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>;
10
- }
11
- /**
12
- * This extension allows you to create table headers.
13
- * @see https://www.tiptap.dev/api/nodes/table-header
14
- */
15
- declare const TableHeader: Node<TableHeaderOptions, any>;
16
-
17
- export { TableHeader, type TableHeaderOptions, TableHeader as default };
1
+ import { TableHeader } from '@tiptap/extension-table';
2
+ export { TableHeader, TableHeaderOptions, TableHeader as default } from '@tiptap/extension-table';
package/dist/index.d.ts CHANGED
@@ -1,17 +1,2 @@
1
- import { Node } from '@tiptap/core';
2
-
3
- interface TableHeaderOptions {
4
- /**
5
- * The HTML attributes for a table header node.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>;
10
- }
11
- /**
12
- * This extension allows you to create table headers.
13
- * @see https://www.tiptap.dev/api/nodes/table-header
14
- */
15
- declare const TableHeader: Node<TableHeaderOptions, any>;
16
-
17
- export { TableHeader, type TableHeaderOptions, TableHeader as default };
1
+ import { TableHeader } from '@tiptap/extension-table';
2
+ export { TableHeader, TableHeaderOptions, TableHeader as default } from '@tiptap/extension-table';
package/dist/index.js CHANGED
@@ -1,47 +1,10 @@
1
- // src/table-header.ts
2
- import { mergeAttributes, Node } from "@tiptap/core";
3
- var TableHeader = Node.create({
4
- name: "tableHeader",
5
- addOptions() {
6
- return {
7
- HTMLAttributes: {}
8
- };
9
- },
10
- content: "block+",
11
- addAttributes() {
12
- return {
13
- colspan: {
14
- default: 1
15
- },
16
- rowspan: {
17
- default: 1
18
- },
19
- colwidth: {
20
- default: null,
21
- parseHTML: (element) => {
22
- const colwidth = element.getAttribute("colwidth");
23
- const value = colwidth ? colwidth.split(",").map((width) => parseInt(width, 10)) : null;
24
- return value;
25
- }
26
- }
27
- };
28
- },
29
- tableRole: "header_cell",
30
- isolating: true,
31
- parseHTML() {
32
- return [
33
- { tag: "th" }
34
- ];
35
- },
36
- renderHTML({ HTMLAttributes }) {
37
- return ["th", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0];
38
- }
39
- });
40
-
41
1
  // src/index.ts
42
- var src_default = TableHeader;
2
+ import { TableHeader } from "@tiptap/extension-table";
3
+ import { TableHeader as TableHeader2, TableHeaderOptions } from "@tiptap/extension-table";
4
+ var index_default = TableHeader;
43
5
  export {
44
- TableHeader,
45
- src_default as default
6
+ TableHeader2 as TableHeader,
7
+ TableHeaderOptions,
8
+ index_default as default
46
9
  };
47
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/table-header.ts","../src/index.ts"],"sourcesContent":["import { mergeAttributes, Node } from '@tiptap/core'\n\nexport interface TableHeaderOptions {\n /**\n * The HTML attributes for a table header node.\n * @default {}\n * @example { class: 'foo' }\n */\n HTMLAttributes: Record<string, any>,\n}\n\n/**\n * This extension allows you to create table headers.\n * @see https://www.tiptap.dev/api/nodes/table-header\n */\nexport const TableHeader = Node.create<TableHeaderOptions>({\n name: 'tableHeader',\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 ? colwidth.split(',').map(width => parseInt(width, 10))\n : null\n\n return value\n },\n },\n }\n },\n\n tableRole: 'header_cell',\n\n isolating: true,\n\n parseHTML() {\n return [\n { tag: 'th' },\n ]\n },\n\n renderHTML({ HTMLAttributes }) {\n return ['th', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]\n },\n\n})\n","import { TableHeader } from './table-header.js'\n\nexport * from './table-header.js'\n\nexport default TableHeader\n"],"mappings":";AAAA,SAAS,iBAAiB,YAAY;AAe/B,IAAM,cAAc,KAAK,OAA2B;AAAA,EACzD,MAAM;AAAA,EAEN,aAAa;AACX,WAAO;AAAA,MACL,gBAAgB,CAAC;AAAA,IACnB;AAAA,EACF;AAAA,EAEA,SAAS;AAAA,EAET,gBAAgB;AACd,WAAO;AAAA,MACL,SAAS;AAAA,QACP,SAAS;AAAA,MACX;AAAA,MACA,SAAS;AAAA,QACP,SAAS;AAAA,MACX;AAAA,MACA,UAAU;AAAA,QACR,SAAS;AAAA,QACT,WAAW,aAAW;AACpB,gBAAM,WAAW,QAAQ,aAAa,UAAU;AAChD,gBAAM,QAAQ,WACV,SAAS,MAAM,GAAG,EAAE,IAAI,WAAS,SAAS,OAAO,EAAE,CAAC,IACpD;AAEJ,iBAAO;AAAA,QACT;AAAA,MACF;AAAA,IACF;AAAA,EACF;AAAA,EAEA,WAAW;AAAA,EAEX,WAAW;AAAA,EAEX,YAAY;AACV,WAAO;AAAA,MACL,EAAE,KAAK,KAAK;AAAA,IACd;AAAA,EACF;AAAA,EAEA,WAAW,EAAE,eAAe,GAAG;AAC7B,WAAO,CAAC,MAAM,gBAAgB,KAAK,QAAQ,gBAAgB,cAAc,GAAG,CAAC;AAAA,EAC/E;AAEF,CAAC;;;AC1DD,IAAO,cAAQ;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["import { TableHeader } from '@tiptap/extension-table'\n\nexport { TableHeader, TableHeaderOptions } from '@tiptap/extension-table'\n\nexport default TableHeader\n"],"mappings":";AAAA,SAAS,mBAAmB;AAE5B,SAAS,eAAAA,cAAa,0BAA0B;AAEhD,IAAO,gBAAQ;","names":["TableHeader"]}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/extension-table-header",
3
3
  "description": "table cell extension for tiptap",
4
- "version": "3.0.0-next.3",
4
+ "version": "3.0.0-next.4",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -15,7 +15,10 @@
15
15
  "type": "module",
16
16
  "exports": {
17
17
  ".": {
18
- "types": "./dist/index.d.ts",
18
+ "types": {
19
+ "import": "./dist/index.d.ts",
20
+ "require": "./dist/index.d.cts"
21
+ },
19
22
  "import": "./dist/index.js",
20
23
  "require": "./dist/index.cjs"
21
24
  }
@@ -28,10 +31,10 @@
28
31
  "dist"
29
32
  ],
30
33
  "devDependencies": {
31
- "@tiptap/core": "^3.0.0-next.3"
34
+ "@tiptap/extension-table": "^3.0.0-next.4"
32
35
  },
33
36
  "peerDependencies": {
34
- "@tiptap/core": "^3.0.0-next.1"
37
+ "@tiptap/extension-table": "^3.0.0-next.3"
35
38
  },
36
39
  "repository": {
37
40
  "type": "git",
@@ -39,6 +42,7 @@
39
42
  "directory": "packages/extension-table-header"
40
43
  },
41
44
  "scripts": {
42
- "build": "tsup"
45
+ "build": "tsup",
46
+ "lint": "prettier ./src/ --check && eslint --cache --quiet --no-error-on-unmatched-pattern ./src/"
43
47
  }
44
- }
48
+ }
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { TableHeader } from './table-header.js'
1
+ import { TableHeader } from '@tiptap/extension-table'
2
2
 
3
- export * from './table-header.js'
3
+ export { TableHeader, TableHeaderOptions } from '@tiptap/extension-table'
4
4
 
5
5
  export default TableHeader
@@ -1,63 +0,0 @@
1
- import { mergeAttributes, Node } from '@tiptap/core'
2
-
3
- export interface TableHeaderOptions {
4
- /**
5
- * The HTML attributes for a table header node.
6
- * @default {}
7
- * @example { class: 'foo' }
8
- */
9
- HTMLAttributes: Record<string, any>,
10
- }
11
-
12
- /**
13
- * This extension allows you to create table headers.
14
- * @see https://www.tiptap.dev/api/nodes/table-header
15
- */
16
- export const TableHeader = Node.create<TableHeaderOptions>({
17
- name: 'tableHeader',
18
-
19
- addOptions() {
20
- return {
21
- HTMLAttributes: {},
22
- }
23
- },
24
-
25
- content: 'block+',
26
-
27
- addAttributes() {
28
- return {
29
- colspan: {
30
- default: 1,
31
- },
32
- rowspan: {
33
- default: 1,
34
- },
35
- colwidth: {
36
- default: null,
37
- parseHTML: element => {
38
- const colwidth = element.getAttribute('colwidth')
39
- const value = colwidth
40
- ? colwidth.split(',').map(width => parseInt(width, 10))
41
- : null
42
-
43
- return value
44
- },
45
- },
46
- }
47
- },
48
-
49
- tableRole: 'header_cell',
50
-
51
- isolating: true,
52
-
53
- parseHTML() {
54
- return [
55
- { tag: 'th' },
56
- ]
57
- },
58
-
59
- renderHTML({ HTMLAttributes }) {
60
- return ['th', mergeAttributes(this.options.HTMLAttributes, HTMLAttributes), 0]
61
- },
62
-
63
- })