@tiptap/extension-table-header 2.0.0-beta.21 → 2.0.0-beta.210

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 ADDED
@@ -0,0 +1,46 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/table-header.ts
2
+ var _core = require('@tiptap/core');
3
+ var TableHeader = _core.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 ? [parseInt(colwidth, 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", _core.mergeAttributes.call(void 0, this.options.HTMLAttributes, HTMLAttributes), 0];
38
+ }
39
+ });
40
+
41
+ // src/index.ts
42
+ var src_default = TableHeader;
43
+
44
+
45
+
46
+ exports.TableHeader = TableHeader; exports.default = src_default;
@@ -0,0 +1,8 @@
1
+ import { Node } from '@tiptap/core';
2
+
3
+ interface TableHeaderOptions {
4
+ HTMLAttributes: Record<string, any>;
5
+ }
6
+ declare const TableHeader: Node<TableHeaderOptions, any>;
7
+
8
+ export { TableHeader, TableHeaderOptions, TableHeader as default };
package/dist/index.js ADDED
@@ -0,0 +1,46 @@
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 ? [parseInt(colwidth, 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
+ // src/index.ts
42
+ var src_default = TableHeader;
43
+ export {
44
+ TableHeader,
45
+ src_default as default
46
+ };
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": "2.0.0-beta.21",
4
+ "version": "2.0.0-beta.210",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -12,21 +12,44 @@
12
12
  "type": "github",
13
13
  "url": "https://github.com/sponsors/ueberdosis"
14
14
  },
15
- "main": "dist/tiptap-extension-table-header.cjs.js",
16
- "umd": "dist/tiptap-extension-table-header.umd.js",
17
- "module": "dist/tiptap-extension-table-header.esm.js",
18
- "types": "dist/packages/extension-table-header/src/index.d.ts",
15
+ "type": "module",
16
+ "exports": {
17
+ ".": {
18
+ "types": "./dist/index.d.ts",
19
+ "import": "./dist/index.js",
20
+ "require": "./dist/index.cjs"
21
+ }
22
+ },
23
+ "main": "dist/index.cjs",
24
+ "module": "dist/index.js",
25
+ "types": "dist/index.d.ts",
19
26
  "files": [
20
27
  "src",
21
28
  "dist"
22
29
  ],
23
30
  "peerDependencies": {
24
- "@tiptap/core": "^2.0.0-beta.1"
31
+ "@tiptap/core": "^2.0.0-beta.209"
32
+ },
33
+ "devDependencies": {
34
+ "@tiptap/core": "^2.0.0-beta.210"
25
35
  },
26
36
  "repository": {
27
37
  "type": "git",
28
38
  "url": "https://github.com/ueberdosis/tiptap",
29
39
  "directory": "packages/extension-table-header"
30
40
  },
31
- "gitHead": "fce16e805824972834d5a8ce8d60e3ff41d63c7e"
41
+ "scripts": {
42
+ "build": "tsup"
43
+ },
44
+ "tsup": {
45
+ "entry": [
46
+ "src/index.ts"
47
+ ],
48
+ "dts": true,
49
+ "splitting": true,
50
+ "format": [
51
+ "esm",
52
+ "cjs"
53
+ ]
54
+ }
32
55
  }
@@ -1,4 +1,4 @@
1
- import { Node, mergeAttributes } from '@tiptap/core'
1
+ import { mergeAttributes, Node } from '@tiptap/core'
2
2
 
3
3
  export interface TableHeaderOptions {
4
4
  HTMLAttributes: Record<string, any>,
package/LICENSE.md DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2021, überdosis GbR
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.