Skip to content

Commit

Permalink
feat(table): make all table packages be in one package, add a new Tab…
Browse files Browse the repository at this point in the history
…leKit extension to configure them
  • Loading branch information
nperez0111 committed Dec 30, 2024
1 parent f9c598a commit 049c2ff
Show file tree
Hide file tree
Showing 33 changed files with 115 additions and 106 deletions.
3 changes: 0 additions & 3 deletions .changeset/chilled-trees-agree.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
"@tiptap/extension-collaboration": major
"@tiptap/extension-floating-menu": major
"@tiptap/extension-ordered-list": major
"@tiptap/extension-table-header": major
"@tiptap/extension-bubble-menu": major
"@tiptap/extension-bullet-list": major
"@tiptap/extension-font-family": major
Expand All @@ -17,7 +16,6 @@
"@tiptap/extension-code-block": major
"@tiptap/extension-dropcursor": major
"@tiptap/extension-hard-break": major
"@tiptap/extension-table-cell": major
"@tiptap/extension-text-align": major
"@tiptap/extension-text-style": major
"@tiptap/extension-typography": major
Expand All @@ -26,7 +24,6 @@
"@tiptap/extension-list-item": major
"@tiptap/extension-paragraph": major
"@tiptap/extension-subscript": major
"@tiptap/extension-table-row": major
"@tiptap/extension-task-item": major
"@tiptap/extension-task-list": major
"@tiptap/extension-underline": major
Expand Down
28 changes: 1 addition & 27 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@
"@tiptap/extension-subscript": "2.5.6",
"@tiptap/extension-superscript": "2.5.6",
"@tiptap/extension-table": "2.5.6",
"@tiptap/extension-table-cell": "2.5.6",
"@tiptap/extension-table-header": "2.5.6",
"@tiptap/extension-table-row": "2.5.6",
"@tiptap/extension-task-item": "2.5.6",
"@tiptap/extension-task-list": "2.5.6",
"@tiptap/extension-text": "2.5.6",
Expand All @@ -58,28 +55,5 @@
"@tiptap/vue-2": "2.5.6",
"@tiptap/vue-3": "2.5.6"
},
"changesets": [
"big-wolves-design",
"chilled-pigs-drum",
"chilled-trees-agree",
"dirty-bats-look",
"famous-bags-breathe",
"few-geckos-brush",
"five-lobsters-sing",
"four-islands-chew",
"green-wolves-arrive",
"honest-ears-trade",
"lazy-needles-train",
"lazy-wombats-grab",
"many-glasses-reflect",
"nasty-turtles-rule",
"perfect-rice-vanish",
"plenty-readers-sin",
"silver-waves-deny",
"six-islands-breathe",
"stupid-shrimps-speak",
"tasty-sheep-compare",
"unlucky-ravens-build",
"weak-books-eat"
]
"changesets": ["dirty-bats-look", "early-singers-begin", "wise-beers-reflect"]
}
12 changes: 4 additions & 8 deletions demos/src/Examples/Tables/React/index.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import './styles.scss'

import Table from '@tiptap/extension-table'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import TableRow from '@tiptap/extension-table-row'
import { TableCell, TableKit } from '@tiptap/extension-table'
import { EditorContent, useEditor } from '@tiptap/react'
import StarterKit from '@tiptap/starter-kit'
import React from 'react'
Expand Down Expand Up @@ -132,11 +129,10 @@ export default () => {
const editor = useEditor({
extensions: [
StarterKit,
Table.configure({
resizable: true,
TableKit.configure({
table: { resizable: true },
tableCell: false,
}),
TableRow,
TableHeader,
// Default TableCell
// TableCell,
// Custom TableCell with backgroundColor attribute
Expand Down
14 changes: 6 additions & 8 deletions demos/src/Examples/Tables/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,7 @@
</template>

<script>
import Table from '@tiptap/extension-table'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import TableRow from '@tiptap/extension-table-row'
import { TableCell, TableKit } from '@tiptap/extension-table'
import StarterKit from '@tiptap/starter-kit'
import { Editor, EditorContent } from '@tiptap/vue-3'
Expand Down Expand Up @@ -134,11 +131,12 @@ export default {
this.editor = new Editor({
extensions: [
StarterKit,
Table.configure({
resizable: true,
TableKit.configure({
table: {
resizable: true,
},
tableCell: false,
}),
TableRow,
TableHeader,
// Default TableCell
// TableCell,
// Custom TableCell with backgroundColor attribute
Expand Down
12 changes: 3 additions & 9 deletions demos/src/Experiments/All/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,7 @@ import Placeholder from '@tiptap/extension-placeholder'
import Strike from '@tiptap/extension-strike'
import Subscript from '@tiptap/extension-subscript'
import Superscript from '@tiptap/extension-superscript'
import Table from '@tiptap/extension-table'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import TableRow from '@tiptap/extension-table-row'
import { TableKit } from '@tiptap/extension-table'
import TaskItem from '@tiptap/extension-task-item'
import TaskList from '@tiptap/extension-task-list'
import Text from '@tiptap/extension-text'
Expand Down Expand Up @@ -155,12 +152,9 @@ export default {
class: 'mention',
},
}),
Table.configure({
resizable: true,
TableKit.configure({
table: { resizable: true },
}),
TableRow,
TableHeader,
TableCell,
Image,
TaskList,
TaskItem,
Expand Down
14 changes: 6 additions & 8 deletions demos/src/Experiments/GenericFigure/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,7 @@

<script>
import Image from '@tiptap/extension-image'
import Table from '@tiptap/extension-table'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import TableRow from '@tiptap/extension-table-row'
import { TableKit } from '@tiptap/extension-table'
import StarterKit from '@tiptap/starter-kit'
import { Editor, EditorContent } from '@tiptap/vue-3'
Expand Down Expand Up @@ -161,10 +158,11 @@ export default {
this.editor = new Editor({
extensions: [
StarterKit,
Table,
TableRow,
TableHeader,
TableCell,
TableKit.configure({
table: {
resizable: true,
},
}),
ImageFigure,
TableFigure,
Figcaption,
Expand Down
12 changes: 3 additions & 9 deletions demos/src/Nodes/Table/React/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import './styles.scss'
import Document from '@tiptap/extension-document'
import Gapcursor from '@tiptap/extension-gapcursor'
import Paragraph from '@tiptap/extension-paragraph'
import Table from '@tiptap/extension-table'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import TableRow from '@tiptap/extension-table-row'
import { TableKit } from '@tiptap/extension-table'
import Text from '@tiptap/extension-text'
import { EditorContent, useEditor } from '@tiptap/react'
import React from 'react'
Expand All @@ -18,12 +15,9 @@ export default () => {
Paragraph,
Text,
Gapcursor,
Table.configure({
resizable: true,
TableKit.configure({
table: { resizable: true },
}),
TableRow,
TableHeader,
TableCell,
],
content: `
<table>
Expand Down
12 changes: 3 additions & 9 deletions demos/src/Nodes/Table/Vue/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,7 @@
import Document from '@tiptap/extension-document'
import Gapcursor from '@tiptap/extension-gapcursor'
import Paragraph from '@tiptap/extension-paragraph'
import Table from '@tiptap/extension-table'
import TableCell from '@tiptap/extension-table-cell'
import TableHeader from '@tiptap/extension-table-header'
import TableRow from '@tiptap/extension-table-row'
import { TableKit } from '@tiptap/extension-table'
import Text from '@tiptap/extension-text'
import { Editor, EditorContent } from '@tiptap/vue-3'
Expand All @@ -91,12 +88,9 @@ export default {
Paragraph,
Text,
Gapcursor,
Table.configure({
resizable: true,
TableKit.configure({
table: { resizable: true },
}),
TableRow,
TableHeader,
TableCell,
],
content: `
<table>
Expand Down
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/extension-table-cell/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^3.0.0-next.3"
"@tiptap/extension-table": "^3.0.0-next.3"
},
"peerDependencies": {
"@tiptap/core": "^3.0.0-next.1"
"@tiptap/extension-table": "^3.0.0-next.3"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-table-cell/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TableCell } from './table-cell.js'
import { TableCell } from '@tiptap/extension-table'

export * from './table-cell.js'
export { TableCell, TableCellOptions } from '@tiptap/extension-table'

export default TableCell
4 changes: 2 additions & 2 deletions packages/extension-table-header/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^3.0.0-next.3"
"@tiptap/extension-table": "^3.0.0-next.3"
},
"peerDependencies": {
"@tiptap/core": "^3.0.0-next.1"
"@tiptap/extension-table": "^3.0.0-next.3"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-table-header/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TableHeader } from './table-header.js'
import { TableHeader } from '@tiptap/extension-table'

export * from './table-header.js'
export { TableHeader, TableHeaderOptions } from '@tiptap/extension-table'

export default TableHeader
4 changes: 2 additions & 2 deletions packages/extension-table-row/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@
"dist"
],
"devDependencies": {
"@tiptap/core": "^3.0.0-next.3"
"@tiptap/extension-table": "^3.0.0-next.3"
},
"peerDependencies": {
"@tiptap/core": "^3.0.0-next.1"
"@tiptap/extension-table": "^3.0.0-next.3"
},
"repository": {
"type": "git",
Expand Down
4 changes: 2 additions & 2 deletions packages/extension-table-row/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { TableRow } from './table-row.js'
import { TableRow } from '@tiptap/extension-table'

export * from './table-row.js'
export { TableRow, TableRowOptions } from '@tiptap/extension-table'

export default TableRow
12 changes: 5 additions & 7 deletions packages/extension-table/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import { Table } from './table.js'

export * from './table.js'
export * from './utilities/createColGroup.js'
export * from './utilities/createTable.js'

export default Table
export * from './table/index.js'
export * from './table-cell/index.js'
export * from './table-header/index.js'
export * from './table-kit.js'
export * from './table-row/index.js'
1 change: 1 addition & 0 deletions packages/extension-table/src/table-cell/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './table-cell.js'
1 change: 1 addition & 0 deletions packages/extension-table/src/table-header/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './table-header.js'
Loading

0 comments on commit 049c2ff

Please sign in to comment.