@seorii/tiptap 0.0.1

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.
Files changed (37) hide show
  1. package/README.md +38 -0
  2. package/dist/index.d.ts +2 -0
  3. package/dist/index.js +4 -0
  4. package/dist/plugin/iframe.d.ts +18 -0
  5. package/dist/plugin/iframe.js +43 -0
  6. package/dist/plugin/indent.d.ts +20 -0
  7. package/dist/plugin/indent.js +116 -0
  8. package/dist/plugin/orderedlist/index.d.ts +3 -0
  9. package/dist/plugin/orderedlist/index.js +81 -0
  10. package/dist/plugin/orderedlist/korean.scss +22 -0
  11. package/dist/plugin/orderedlist/toggleList.d.ts +2 -0
  12. package/dist/plugin/orderedlist/toggleList.js +67 -0
  13. package/dist/plugin/table/deleteTable.d.ts +3 -0
  14. package/dist/plugin/table/deleteTable.js +24 -0
  15. package/dist/plugin/table/index.d.ts +3 -0
  16. package/dist/plugin/table/index.js +69 -0
  17. package/dist/plugin/table/style/cell.scss +16 -0
  18. package/dist/plugin/table/style/grip.scss +72 -0
  19. package/dist/plugin/table/style/resize.scss +28 -0
  20. package/dist/plugin/table/style/table.scss +83 -0
  21. package/dist/plugin/table/style/theme.scss +6 -0
  22. package/dist/plugin/table/style.scss +5 -0
  23. package/dist/plugin/table/tableCell/index.d.ts +2 -0
  24. package/dist/plugin/table/tableCell/index.js +80 -0
  25. package/dist/plugin/table/tableHeader/index.d.ts +2 -0
  26. package/dist/plugin/table/tableHeader/index.js +59 -0
  27. package/dist/plugin/table/tableRow/index.d.ts +2 -0
  28. package/dist/plugin/table/tableRow/index.js +4 -0
  29. package/dist/plugin/table/util.d.ts +46 -0
  30. package/dist/plugin/table/util.js +195 -0
  31. package/dist/tiptap/TipTap.svelte +144 -0
  32. package/dist/tiptap/TipTap.svelte.d.ts +19 -0
  33. package/dist/tiptap/index.d.ts +2 -0
  34. package/dist/tiptap/index.js +3 -0
  35. package/dist/tiptap/tiptap.d.ts +3 -0
  36. package/dist/tiptap/tiptap.js +56 -0
  37. package/package.json +83 -0
@@ -0,0 +1,56 @@
1
+ import { Editor, mergeAttributes } from "@tiptap/core";
2
+ import { CodeBlockLowlight } from "@tiptap/extension-code-block-lowlight";
3
+ import { lowlight } from "lowlight";
4
+ import Image from "@tiptap/extension-image";
5
+ import StarterKit from "@tiptap/starter-kit";
6
+ import Underline from "@tiptap/extension-underline";
7
+ import Highlight from "@tiptap/extension-highlight";
8
+ import Link from "@tiptap/extension-link";
9
+ import TextAlign from "@tiptap/extension-text-align";
10
+ import DropCursor from "@tiptap/extension-dropcursor";
11
+ import orderedlist from "../plugin/orderedlist";
12
+ import table from "../plugin/table";
13
+ import tableHeader from "../plugin/table/tableHeader";
14
+ import tableRow from "../plugin/table/tableRow";
15
+ import tableCell from "../plugin/table/tableCell";
16
+ import Superscript from '@tiptap/extension-superscript';
17
+ import Subscript from "@tiptap/extension-subscript";
18
+ import Placeholder from "@tiptap/extension-placeholder";
19
+ import { Indent } from "../plugin/indent";
20
+ import { Color } from '@tiptap/extension-color';
21
+ import TextStyle from '@tiptap/extension-text-style';
22
+ import Iframe from "../plugin/iframe";
23
+ import Math from "tiptap-katex";
24
+ export default (element, content, { placeholder = '내용을 입력하세요...', ...props } = {}) => new Editor({
25
+ element, content, ...props,
26
+ extensions: [
27
+ CodeBlockLowlight.configure({ lowlight }),
28
+ Image.extend({
29
+ defaultOptions: { ...Image.options, sizes: ["inline", "block", "left", "right"] },
30
+ parseHTML: () => [{ tag: 'img' }],
31
+ renderHTML({ HTMLAttributes }) {
32
+ const { style } = HTMLAttributes;
33
+ return ["figure", { style }, ["img", mergeAttributes(this.options.HTMLAttributes, HTMLAttributes)]];
34
+ }
35
+ }).configure({ HTMLAttributes: { crossorigin: 'anonymous' } }),
36
+ StarterKit,
37
+ Underline,
38
+ Highlight.configure({ multicolor: true }),
39
+ Link.configure({ openOnClick: true }),
40
+ TextAlign.configure({ types: ['heading', 'paragraph', 'image'] }),
41
+ DropCursor,
42
+ orderedlist,
43
+ table,
44
+ tableHeader,
45
+ tableRow,
46
+ tableCell,
47
+ Superscript,
48
+ Subscript,
49
+ Placeholder.configure({ placeholder }),
50
+ Indent,
51
+ Color,
52
+ TextStyle,
53
+ Math,
54
+ Iframe,
55
+ ],
56
+ });
package/package.json ADDED
@@ -0,0 +1,83 @@
1
+ {
2
+ "name": "@seorii/tiptap",
3
+ "version": "0.0.1",
4
+ "scripts": {
5
+ "dev": "vite dev",
6
+ "build": "svelte-kit sync && svelte-package",
7
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
8
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
9
+ "lint": "prettier --plugin-search-dir . --check . && eslint .",
10
+ "format": "prettier --plugin-search-dir . --write .",
11
+ "deploy": "svelte-kit sync && svelte-package && npm publish --access public"
12
+ },
13
+ "devDependencies": {
14
+ "@sveltejs/adapter-auto": "^2.1.0",
15
+ "@sveltejs/kit": "^1.22.3",
16
+ "@sveltejs/package": "^2.2.0",
17
+ "@typescript-eslint/eslint-plugin": "^6.2.0",
18
+ "@typescript-eslint/parser": "^6.2.0",
19
+ "eslint": "^8.45.0",
20
+ "eslint-config-prettier": "^8.8.0",
21
+ "eslint-plugin-svelte3": "^4.0.0",
22
+ "prettier": "^3.0.0",
23
+ "prettier-plugin-svelte": "^3.0.1",
24
+ "sass": "^1.64.1",
25
+ "svelte": "^4.1.1",
26
+ "svelte-check": "^3.4.6",
27
+ "svelte-preprocess": "^5.0.4",
28
+ "tslib": "^2.6.1",
29
+ "typescript": "^5.1.6",
30
+ "vite": "^4.4.7"
31
+ },
32
+ "type": "module",
33
+ "dependencies": {
34
+ "@tiptap/core": "^2.0.4",
35
+ "@tiptap/extension-code-block-lowlight": "^2.0.4",
36
+ "@tiptap/extension-color": "^2.0.4",
37
+ "@tiptap/extension-dropcursor": "^2.0.4",
38
+ "@tiptap/extension-highlight": "^2.0.4",
39
+ "@tiptap/extension-image": "^2.0.4",
40
+ "@tiptap/extension-link": "^2.0.4",
41
+ "@tiptap/extension-ordered-list": "^2.0.4",
42
+ "@tiptap/extension-placeholder": "^2.0.4",
43
+ "@tiptap/extension-subscript": "^2.0.4",
44
+ "@tiptap/extension-superscript": "^2.0.4",
45
+ "@tiptap/extension-table": "^2.0.4",
46
+ "@tiptap/extension-table-cell": "^2.0.4",
47
+ "@tiptap/extension-table-header": "^2.0.4",
48
+ "@tiptap/extension-table-row": "^2.0.4",
49
+ "@tiptap/extension-text-align": "^2.0.4",
50
+ "@tiptap/extension-text-style": "^2.0.4",
51
+ "@tiptap/extension-underline": "^2.0.4",
52
+ "@tiptap/starter-kit": "^2.0.4",
53
+ "lowlight": "^2.9.0",
54
+ "nunui": "^0.0.97",
55
+ "prosemirror-model": "^1.19.3",
56
+ "prosemirror-state": "^1.4.3",
57
+ "prosemirror-tables": "^1.3.4",
58
+ "prosemirror-transform": "^1.7.3",
59
+ "prosemirror-view": "^1.31.6",
60
+ "sanitize-html": "^2.11.0",
61
+ "tiptap-katex": "^0.0.2"
62
+ },
63
+ "exports": {
64
+ ".": {
65
+ "require": "./dist/index.js",
66
+ "import": "./dist/index.js",
67
+ "types": "./dist/index.d.ts"
68
+ }
69
+ },
70
+ "license": "MIT",
71
+ "files": [
72
+ "dist",
73
+ "package.json",
74
+ "README.md"
75
+ ],
76
+ "publishConfig": {
77
+ "access": "public"
78
+ },
79
+ "repository": {
80
+ "type": "git",
81
+ "url": "https://github.com/seorii/tiptap.git"
82
+ }
83
+ }