init table, table-row and table-cell

This commit is contained in:
Hans Pagel
2021-01-20 23:42:01 +01:00
parent 85306e697d
commit 45ed1c7fc6
15 changed files with 244 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
context('/api/nodes/table', () => {
before(() => {
cy.visit('/api/nodes/table')
})
// TODO: Write tests
})

View File

@@ -0,0 +1,62 @@
<template>
<div v-if="editor">
<editor-content :editor="editor" />
</div>
</template>
<script>
import { Editor } from '@tiptap/core'
import { EditorContent } from '@tiptap/vue'
import Document from '@tiptap/extension-document'
import Paragraph from '@tiptap/extension-paragraph'
import Text from '@tiptap/extension-text'
import Table from '@tiptap/extension-table'
import TableRow from '@tiptap/extension-table-row'
import TableCell from '@tiptap/extension-table-cell'
export default {
components: {
EditorContent,
},
data() {
return {
editor: null,
}
},
mounted() {
this.editor = new Editor({
extensions: [
Document,
Paragraph,
Text,
Table,
TableRow,
TableCell,
],
content: `
<p>Example Text</p>
<table>
<tr>
<td>Test</td>
<td>Test</td>
<td>Test</td>
</tr>
</table>
<p>Example Text</p>
`,
})
},
beforeDestroy() {
this.editor.destroy()
},
}
</script>
<style>
table {
border: 3px solid red;
}
</style>

View File

@@ -5,3 +5,7 @@ We need your support to maintain, update, support and develop tiptap 2. If you
:::
TODO
⚠️ Preview
<demo name="Nodes/Table" />

View File

@@ -0,0 +1,14 @@
# @tiptap/extension-table-cell
[![Version](https://img.shields.io/npm/v/@tiptap/extension-table-cell.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-table-cell)
[![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-table-cell.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
[![License](https://img.shields.io/npm/l/@tiptap/extension-table-cell.svg)](https://www.npmjs.com/package/@tiptap/extension-table-cell)
[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
## Introduction
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*.
## Offical Documentation
Documentation can be found on the [tiptap website](https://tiptap.dev).
## License
tiptap is open-sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap-next/blob/main/LICENSE.md).

View File

@@ -0,0 +1,27 @@
{
"name": "@tiptap/extension-table-cell",
"description": "table cell extension for tiptap",
"version": "2.0.0-alpha.5",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
"tiptap extension"
],
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"main": "dist/tiptap-extension-table-cell.cjs.js",
"umd": "dist/tiptap-extension-table-cell.umd.js",
"module": "dist/tiptap-extension-table-cell.esm.js",
"unpkg": "dist/tiptap-extension-table-cell.bundle.umd.min.js",
"types": "dist/packages/extension-table-cell/src/index.d.ts",
"files": [
"src",
"dist"
],
"peerDependencies": {
"@tiptap/core": "^2.0.0-alpha.6"
}
}

View File

@@ -0,0 +1,5 @@
import { TableCell } from './table-cell'
export * from './table-cell'
export default TableCell

View File

@@ -0,0 +1,11 @@
import { Node } from '@tiptap/core'
export const TableCell = Node.create({
name: 'tableCell',
})
declare module '@tiptap/core' {
interface AllExtensions {
TableCell: typeof TableCell,
}
}

View File

@@ -0,0 +1,14 @@
# @tiptap/extension-table-row
[![Version](https://img.shields.io/npm/v/@tiptap/extension-table-row.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-table-row)
[![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-table-row.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
[![License](https://img.shields.io/npm/l/@tiptap/extension-table-row.svg)](https://www.npmjs.com/package/@tiptap/extension-table-row)
[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
## Introduction
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*.
## Offical Documentation
Documentation can be found on the [tiptap website](https://tiptap.dev).
## License
tiptap is open-sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap-next/blob/main/LICENSE.md).

View File

@@ -0,0 +1,27 @@
{
"name": "@tiptap/extension-table-row",
"description": "table row extension for tiptap",
"version": "2.0.0-alpha.5",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
"tiptap extension"
],
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"main": "dist/tiptap-extension-table-row.cjs.js",
"umd": "dist/tiptap-extension-table-row.umd.js",
"module": "dist/tiptap-extension-table-row.esm.js",
"unpkg": "dist/tiptap-extension-table-row.bundle.umd.min.js",
"types": "dist/packages/extension-table-row/src/index.d.ts",
"files": [
"src",
"dist"
],
"peerDependencies": {
"@tiptap/core": "^2.0.0-alpha.6"
}
}

View File

@@ -0,0 +1,5 @@
import { TableRow } from './table-row'
export * from './table-row'
export default TableRow

View File

@@ -0,0 +1,11 @@
import { Node } from '@tiptap/core'
export const TableRow = Node.create({
name: 'tableRow',
})
declare module '@tiptap/core' {
interface AllExtensions {
TableRow: typeof TableRow,
}
}

View File

@@ -0,0 +1,14 @@
# @tiptap/extension-table
[![Version](https://img.shields.io/npm/v/@tiptap/extension-table.svg?label=version)](https://www.npmjs.com/package/@tiptap/extension-table)
[![Downloads](https://img.shields.io/npm/dm/@tiptap/extension-table.svg)](https://npmcharts.com/compare/tiptap?minimal=true)
[![License](https://img.shields.io/npm/l/@tiptap/extension-table.svg)](https://www.npmjs.com/package/@tiptap/extension-table)
[![Sponsor](https://img.shields.io/static/v1?label=Sponsor&message=%E2%9D%A4&logo=GitHub)](https://github.com/sponsors/ueberdosis)
## Introduction
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*.
## Offical Documentation
Documentation can be found on the [tiptap website](https://tiptap.dev).
## License
tiptap is open-sourced software licensed under the [MIT license](https://github.com/ueberdosis/tiptap-next/blob/main/LICENSE.md).

View File

@@ -0,0 +1,27 @@
{
"name": "@tiptap/extension-table",
"description": "table extension for tiptap",
"version": "2.0.0-alpha.5",
"homepage": "https://tiptap.dev",
"keywords": [
"tiptap",
"tiptap extension"
],
"license": "MIT",
"funding": {
"type": "github",
"url": "https://github.com/sponsors/ueberdosis"
},
"main": "dist/tiptap-extension-table.cjs.js",
"umd": "dist/tiptap-extension-table.umd.js",
"module": "dist/tiptap-extension-table.esm.js",
"unpkg": "dist/tiptap-extension-table.bundle.umd.min.js",
"types": "dist/packages/extension-table/src/index.d.ts",
"files": [
"src",
"dist"
],
"peerDependencies": {
"@tiptap/core": "^2.0.0-alpha.6"
}
}

View File

@@ -0,0 +1,5 @@
import { Table } from './table'
export * from './table'
export default Table

View File

@@ -0,0 +1,11 @@
import { Node } from '@tiptap/core'
export const Table = Node.create({
name: 'table',
})
declare module '@tiptap/core' {
interface AllExtensions {
Table: typeof Table,
}
}