@frontlit/text-editor 0.1.0-alpha.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.
- package/LICENSE +21 -0
- package/README.md +60 -0
- package/dist/index.d.ts +135 -0
- package/dist/index.js +1474 -0
- package/dist/index.js.map +1 -0
- package/dist/prose.css +403 -0
- package/dist/styles.css +1058 -0
- package/dist/tokens.css +58 -0
- package/package.json +91 -0
package/dist/tokens.css
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Fallback semantic tokens for the editing chrome. These are concrete
|
|
3
|
+
* colors — `--popover: var(--popover, …)` is cyclic and computes to
|
|
4
|
+
* invalid, which made `bg-popover` paint as transparent.
|
|
5
|
+
*
|
|
6
|
+
* Inside page-builder's `.pb-theme` the host tokens still win on
|
|
7
|
+
* inherited properties the editor does not set; these rules cover
|
|
8
|
+
* standalone hosts and the bubble menu when it is portaled to <body>.
|
|
9
|
+
*/
|
|
10
|
+
.tiptap-editor,
|
|
11
|
+
.bubble-menu {
|
|
12
|
+
--background: hsl(0 0% 100%);
|
|
13
|
+
--foreground: hsl(222.2 84% 4.9%);
|
|
14
|
+
--card: hsl(0 0% 100%);
|
|
15
|
+
--card-foreground: hsl(222.2 84% 4.9%);
|
|
16
|
+
--popover: hsl(0 0% 100%);
|
|
17
|
+
--popover-foreground: hsl(222.2 84% 4.9%);
|
|
18
|
+
--primary: hsl(222.2 47.4% 11.2%);
|
|
19
|
+
--primary-foreground: hsl(210 40% 98%);
|
|
20
|
+
--primary-soft: hsl(222.2 47.4% 11.2% / 0.08);
|
|
21
|
+
--secondary: hsl(210 40% 96.1%);
|
|
22
|
+
--secondary-foreground: hsl(222.2 47.4% 11.2%);
|
|
23
|
+
--muted: hsl(210 40% 96.1%);
|
|
24
|
+
--muted-foreground: hsl(215.4 16.3% 46.9%);
|
|
25
|
+
--accent: hsl(210 40% 96.1%);
|
|
26
|
+
--accent-foreground: hsl(222.2 47.4% 11.2%);
|
|
27
|
+
--destructive: hsl(0 84.2% 60.2%);
|
|
28
|
+
--destructive-foreground: hsl(210 40% 98%);
|
|
29
|
+
--border: hsl(214.3 31.8% 91.4%);
|
|
30
|
+
--input: hsl(214.3 31.8% 91.4%);
|
|
31
|
+
--ring: hsl(222.2 84% 4.9%);
|
|
32
|
+
--radius: 0.5rem;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
@theme inline {
|
|
36
|
+
--color-background: var(--background);
|
|
37
|
+
--color-foreground: var(--foreground);
|
|
38
|
+
--color-card: var(--card);
|
|
39
|
+
--color-card-foreground: var(--card-foreground);
|
|
40
|
+
--color-popover: var(--popover);
|
|
41
|
+
--color-popover-foreground: var(--popover-foreground);
|
|
42
|
+
--color-primary: var(--primary);
|
|
43
|
+
--color-primary-foreground: var(--primary-foreground);
|
|
44
|
+
--color-secondary: var(--secondary);
|
|
45
|
+
--color-secondary-foreground: var(--secondary-foreground);
|
|
46
|
+
--color-muted: var(--muted);
|
|
47
|
+
--color-muted-foreground: var(--muted-foreground);
|
|
48
|
+
--color-accent: var(--accent);
|
|
49
|
+
--color-accent-foreground: var(--accent-foreground);
|
|
50
|
+
--color-destructive: var(--destructive);
|
|
51
|
+
--color-destructive-foreground: var(--destructive-foreground);
|
|
52
|
+
--color-border: var(--border);
|
|
53
|
+
--color-input: var(--input);
|
|
54
|
+
--color-ring: var(--ring);
|
|
55
|
+
--radius-lg: var(--radius);
|
|
56
|
+
--radius-md: calc(var(--radius) - 2px);
|
|
57
|
+
--radius-sm: calc(var(--radius) - 4px);
|
|
58
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@frontlit/text-editor",
|
|
3
|
+
"version": "0.1.0-alpha.1",
|
|
4
|
+
"description": "A TipTap-based rich text editor and static renderer for React",
|
|
5
|
+
"author": "FrontLit",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "./dist/index.js",
|
|
9
|
+
"module": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"files": [
|
|
12
|
+
"dist",
|
|
13
|
+
"README.md",
|
|
14
|
+
"LICENSE"
|
|
15
|
+
],
|
|
16
|
+
"exports": {
|
|
17
|
+
".": {
|
|
18
|
+
"types": "./dist/index.d.ts",
|
|
19
|
+
"import": "./dist/index.js",
|
|
20
|
+
"default": "./dist/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./styles.css": "./dist/styles.css",
|
|
23
|
+
"./prose.css": "./dist/prose.css",
|
|
24
|
+
"./tokens.css": "./dist/tokens.css"
|
|
25
|
+
},
|
|
26
|
+
"sideEffects": [
|
|
27
|
+
"**/*.css"
|
|
28
|
+
],
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"repository": {
|
|
33
|
+
"type": "git",
|
|
34
|
+
"url": "git+https://github.com/codelitdev/frontlit.git",
|
|
35
|
+
"directory": "packages/text-editor"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/codelitdev/frontlit/tree/main/packages/text-editor",
|
|
38
|
+
"bugs": {
|
|
39
|
+
"url": "https://github.com/codelitdev/frontlit/issues"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [
|
|
42
|
+
"react",
|
|
43
|
+
"tiptap",
|
|
44
|
+
"wysiwyg",
|
|
45
|
+
"rich-text",
|
|
46
|
+
"editor",
|
|
47
|
+
"frontlit"
|
|
48
|
+
],
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
51
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@floating-ui/dom": "^1.6.0",
|
|
55
|
+
"@tiptap/core": "^3.0.0",
|
|
56
|
+
"@tiptap/extension-bubble-menu": "^3.10.4",
|
|
57
|
+
"@tiptap/extension-code-block-lowlight": "^3.0.0",
|
|
58
|
+
"@tiptap/extension-dropcursor": "^3.0.0",
|
|
59
|
+
"@tiptap/extension-gapcursor": "^3.0.0",
|
|
60
|
+
"@tiptap/extension-heading": "^3.0.0",
|
|
61
|
+
"@tiptap/extension-highlight": "^3.11.0",
|
|
62
|
+
"@tiptap/extension-image": "^3.0.0",
|
|
63
|
+
"@tiptap/extension-link": "^3.0.0",
|
|
64
|
+
"@tiptap/extension-placeholder": "^3.0.0",
|
|
65
|
+
"@tiptap/extension-table": "^3.10.7",
|
|
66
|
+
"@tiptap/react": "^3.0.0",
|
|
67
|
+
"@tiptap/starter-kit": "^3.0.0",
|
|
68
|
+
"@tiptap/static-renderer": "^3.10.7",
|
|
69
|
+
"clsx": "^2.1.1",
|
|
70
|
+
"highlight.js": "^11.10.0",
|
|
71
|
+
"lowlight": "^2.9.0",
|
|
72
|
+
"lucide-react": "^0.553.0",
|
|
73
|
+
"tailwind-merge": "^3.4.0"
|
|
74
|
+
},
|
|
75
|
+
"devDependencies": {
|
|
76
|
+
"@types/node": "^20.0.0",
|
|
77
|
+
"@types/react": "^19.0.0",
|
|
78
|
+
"@types/react-dom": "^19.0.0",
|
|
79
|
+
"@tailwindcss/cli": "^4.1.0",
|
|
80
|
+
"rimraf": "^5.0.0",
|
|
81
|
+
"tailwindcss": "^4.1.0",
|
|
82
|
+
"tsup": "^8.3.0",
|
|
83
|
+
"typescript": "^5.6.2"
|
|
84
|
+
},
|
|
85
|
+
"scripts": {
|
|
86
|
+
"build": "tsup && node scripts/add-use-client.mjs && tailwindcss -i src/styles.css -o dist/styles.css && cp src/prose.css dist/prose.css && cp src/tokens.css dist/tokens.css",
|
|
87
|
+
"dev": "tsup --watch",
|
|
88
|
+
"clean": "rimraf dist",
|
|
89
|
+
"check-types": "tsc --noEmit"
|
|
90
|
+
}
|
|
91
|
+
}
|