@blokhaus/core 0.1.0
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/README.md +191 -0
- package/dist/index.cjs +11541 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +834 -0
- package/dist/index.d.ts +834 -0
- package/dist/index.js +11725 -0
- package/dist/index.js.map +1 -0
- package/package.json +91 -0
- package/src/styles/tokens.css +183 -0
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blokhaus/core",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "The shadcn of rich text editors — composable, block-based Notion-style editor components for Next.js, built on Lexical.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "https://github.com/fhswno/blokhaus-js.git",
|
|
9
|
+
"directory": "packages/blokhaus"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/fhswno/blokhaus-js",
|
|
12
|
+
"bugs": "https://github.com/fhswno/blokhaus-js/issues",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"editor",
|
|
15
|
+
"rich-text",
|
|
16
|
+
"lexical",
|
|
17
|
+
"nextjs",
|
|
18
|
+
"react",
|
|
19
|
+
"notion",
|
|
20
|
+
"block-editor",
|
|
21
|
+
"wysiwyg",
|
|
22
|
+
"text-editor",
|
|
23
|
+
"content-editor",
|
|
24
|
+
"composable",
|
|
25
|
+
"headless"
|
|
26
|
+
],
|
|
27
|
+
"private": false,
|
|
28
|
+
"type": "module",
|
|
29
|
+
"main": "./dist/index.cjs",
|
|
30
|
+
"module": "./dist/index.js",
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"exports": {
|
|
33
|
+
".": {
|
|
34
|
+
"import": {
|
|
35
|
+
"types": "./dist/index.d.ts",
|
|
36
|
+
"default": "./dist/index.js"
|
|
37
|
+
},
|
|
38
|
+
"require": {
|
|
39
|
+
"types": "./dist/index.d.cts",
|
|
40
|
+
"default": "./dist/index.cjs"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"./styles": "./src/styles/tokens.css"
|
|
44
|
+
},
|
|
45
|
+
"files": [
|
|
46
|
+
"dist",
|
|
47
|
+
"src/styles/tokens.css",
|
|
48
|
+
"LICENSE",
|
|
49
|
+
"README.md"
|
|
50
|
+
],
|
|
51
|
+
"sideEffects": [
|
|
52
|
+
"**/*.css"
|
|
53
|
+
],
|
|
54
|
+
"scripts": {
|
|
55
|
+
"build": "tsup",
|
|
56
|
+
"dev": "tsup --watch",
|
|
57
|
+
"typecheck": "tsc --noEmit",
|
|
58
|
+
"release": "bun run typecheck && bun run build && npm publish --access public"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"react": ">=18",
|
|
62
|
+
"react-dom": ">=18",
|
|
63
|
+
"lexical": ">=0.40.0 <1.0.0",
|
|
64
|
+
"next": ">=14"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@lexical/history": "^0.40.0",
|
|
68
|
+
"@lexical/html": "^0.40.0",
|
|
69
|
+
"@lexical/link": "^0.40.0",
|
|
70
|
+
"@lexical/list": "^0.40.0",
|
|
71
|
+
"@lexical/react": "^0.40.0",
|
|
72
|
+
"@lexical/rich-text": "^0.40.0",
|
|
73
|
+
"@lexical/selection": "^0.40.0",
|
|
74
|
+
"@lexical/table": "^0.40.0",
|
|
75
|
+
"@lexical/utils": "^0.40.0",
|
|
76
|
+
"@phosphor-icons/react": "^2.1.10",
|
|
77
|
+
"@radix-ui/react-dropdown-menu": "^2.1.16",
|
|
78
|
+
"@radix-ui/react-popover": "^1.1.15",
|
|
79
|
+
"@radix-ui/react-toast": "^1.2.15",
|
|
80
|
+
"shiki": "^3.22.0"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@types/react": "^19.2.14",
|
|
84
|
+
"@types/react-dom": "^19.2.3",
|
|
85
|
+
"lexical": "^0.40.0",
|
|
86
|
+
"react": "^19.0.0",
|
|
87
|
+
"react-dom": "^19.0.0",
|
|
88
|
+
"tsup": "^8.5.1",
|
|
89
|
+
"typescript": "^5.9.3"
|
|
90
|
+
}
|
|
91
|
+
}
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
/* Surface */
|
|
3
|
+
--blokhaus-background: hsl(0 0% 100%);
|
|
4
|
+
--blokhaus-foreground: hsl(222.2 84% 4.9%);
|
|
5
|
+
|
|
6
|
+
/* Editor chrome */
|
|
7
|
+
--blokhaus-border: hsl(214.3 31.8% 91.4%);
|
|
8
|
+
--blokhaus-ring: hsl(221.2 83.2% 53.3%);
|
|
9
|
+
--blokhaus-muted: hsl(210 40% 96.1%);
|
|
10
|
+
--blokhaus-muted-foreground: hsl(215.4 16.3% 46.9%);
|
|
11
|
+
|
|
12
|
+
/* Interactive */
|
|
13
|
+
--blokhaus-accent: hsl(221.2 83.2% 53.3%);
|
|
14
|
+
--blokhaus-accent-foreground: hsl(0 0% 100%);
|
|
15
|
+
|
|
16
|
+
/* Status */
|
|
17
|
+
--blokhaus-destructive: hsl(0 84.2% 60.2%);
|
|
18
|
+
--blokhaus-ai-stream: hsl(220 60% 50%);
|
|
19
|
+
|
|
20
|
+
/* Radius */
|
|
21
|
+
--blokhaus-radius: 0.5rem;
|
|
22
|
+
|
|
23
|
+
/* Typography */
|
|
24
|
+
--blokhaus-font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
25
|
+
--blokhaus-font-serif: Georgia, "Times New Roman", serif;
|
|
26
|
+
--blokhaus-font-mono: ui-monospace, monospace;
|
|
27
|
+
--blokhaus-font-hand: "Caveat", cursive;
|
|
28
|
+
|
|
29
|
+
/* Text colors */
|
|
30
|
+
--blokhaus-text-gray: #9b9a97;
|
|
31
|
+
--blokhaus-text-brown: #64473a;
|
|
32
|
+
--blokhaus-text-orange: #d9730d;
|
|
33
|
+
--blokhaus-text-yellow: #dfab01;
|
|
34
|
+
--blokhaus-text-green: #0f7b6c;
|
|
35
|
+
--blokhaus-text-blue: #0b6e99;
|
|
36
|
+
--blokhaus-text-purple: #6940a5;
|
|
37
|
+
--blokhaus-text-pink: #ad1a72;
|
|
38
|
+
--blokhaus-text-red: #e03e3e;
|
|
39
|
+
|
|
40
|
+
/* Highlight / background colors */
|
|
41
|
+
--blokhaus-highlight-gray: #ebeced;
|
|
42
|
+
--blokhaus-highlight-brown: #e9e5e3;
|
|
43
|
+
--blokhaus-highlight-orange: #faebdd;
|
|
44
|
+
--blokhaus-highlight-yellow: #fbf3db;
|
|
45
|
+
--blokhaus-highlight-green: #ddedea;
|
|
46
|
+
--blokhaus-highlight-blue: #ddebf1;
|
|
47
|
+
--blokhaus-highlight-purple: #eae4f2;
|
|
48
|
+
--blokhaus-highlight-pink: #f4dfeb;
|
|
49
|
+
--blokhaus-highlight-red: #fbe4e4;
|
|
50
|
+
|
|
51
|
+
/* Table */
|
|
52
|
+
--blokhaus-table-border: hsl(214.3 31.8% 91.4%);
|
|
53
|
+
--blokhaus-table-header-bg: hsl(210 40% 96.1%);
|
|
54
|
+
--blokhaus-table-selection: hsla(221.2 83.2% 53.3% / 0.1);
|
|
55
|
+
--blokhaus-table-resize-handle: hsl(221.2 83.2% 53.3%);
|
|
56
|
+
|
|
57
|
+
/* Table cell background colors */
|
|
58
|
+
--blokhaus-cell-bg-gray: #f1f1ef;
|
|
59
|
+
--blokhaus-cell-bg-brown: #f4f0ee;
|
|
60
|
+
--blokhaus-cell-bg-orange: #fbecdd;
|
|
61
|
+
--blokhaus-cell-bg-yellow: #fbf3db;
|
|
62
|
+
--blokhaus-cell-bg-green: #edf3ec;
|
|
63
|
+
--blokhaus-cell-bg-blue: #e7f3f8;
|
|
64
|
+
--blokhaus-cell-bg-purple: #f4f0f7;
|
|
65
|
+
--blokhaus-cell-bg-pink: #f9f0f5;
|
|
66
|
+
--blokhaus-cell-bg-red: #fdebec;
|
|
67
|
+
|
|
68
|
+
/* Callout presets */
|
|
69
|
+
--blokhaus-callout-default-bg: #f1f1ef;
|
|
70
|
+
--blokhaus-callout-default-border: #d4d4d4;
|
|
71
|
+
--blokhaus-callout-info-bg: #ddebf1;
|
|
72
|
+
--blokhaus-callout-info-border: #0b6e99;
|
|
73
|
+
--blokhaus-callout-warning-bg: #fbf3db;
|
|
74
|
+
--blokhaus-callout-warning-border: #dfab01;
|
|
75
|
+
--blokhaus-callout-error-bg: #fbe4e4;
|
|
76
|
+
--blokhaus-callout-error-border: #e03e3e;
|
|
77
|
+
--blokhaus-callout-success-bg: #ddedea;
|
|
78
|
+
--blokhaus-callout-success-border: #0f7b6c;
|
|
79
|
+
--blokhaus-callout-purple-bg: #eae4f2;
|
|
80
|
+
--blokhaus-callout-purple-border: #6940a5;
|
|
81
|
+
|
|
82
|
+
/* Block selection */
|
|
83
|
+
--blokhaus-block-selection: rgba(45, 133, 255, 0.08);
|
|
84
|
+
|
|
85
|
+
/* Loading / overlay */
|
|
86
|
+
--blokhaus-loading-overlay: rgba(0, 0, 0, 0.1);
|
|
87
|
+
|
|
88
|
+
/* AI preview */
|
|
89
|
+
--blokhaus-ai-stream-bg: rgba(51, 102, 204, 0.05);
|
|
90
|
+
|
|
91
|
+
/* Popover / floating UI chrome */
|
|
92
|
+
--blokhaus-popover-bg: rgba(255, 255, 255, 0.96);
|
|
93
|
+
--blokhaus-popover-border: rgba(0, 0, 0, 0.12);
|
|
94
|
+
--blokhaus-popover-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.06), 0 8px 40px rgba(0, 0, 0, 0.16), 0 2px 8px rgba(0, 0, 0, 0.06);
|
|
95
|
+
--blokhaus-icon-secondary: rgba(0, 0, 0, 0.55);
|
|
96
|
+
--blokhaus-separator: rgba(0, 0, 0, 0.1);
|
|
97
|
+
--blokhaus-text-tertiary: rgba(0, 0, 0, 0.3);
|
|
98
|
+
--blokhaus-hover-bg: rgba(0, 0, 0, 0.04);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.dark {
|
|
102
|
+
--blokhaus-background: hsl(222.2 84% 4.9%);
|
|
103
|
+
--blokhaus-foreground: hsl(210 40% 98%);
|
|
104
|
+
--blokhaus-border: hsl(217.2 32.6% 17.5%);
|
|
105
|
+
--blokhaus-ring: hsl(224.3 76.3% 48%);
|
|
106
|
+
--blokhaus-muted: hsl(217.2 32.6% 17.5%);
|
|
107
|
+
--blokhaus-muted-foreground: hsl(215 20.2% 65.1%);
|
|
108
|
+
--blokhaus-accent: hsl(224.3 76.3% 48%);
|
|
109
|
+
--blokhaus-accent-foreground: hsl(210 40% 98%);
|
|
110
|
+
--blokhaus-destructive: hsl(0 62.8% 30.6%);
|
|
111
|
+
--blokhaus-ai-stream: hsl(220 60% 50%);
|
|
112
|
+
|
|
113
|
+
/* Text colors — brighter for dark backgrounds */
|
|
114
|
+
--blokhaus-text-gray: #979a9b;
|
|
115
|
+
--blokhaus-text-brown: #937264;
|
|
116
|
+
--blokhaus-text-orange: #ffa344;
|
|
117
|
+
--blokhaus-text-yellow: #ffdc49;
|
|
118
|
+
--blokhaus-text-green: #4dab9a;
|
|
119
|
+
--blokhaus-text-blue: #529cca;
|
|
120
|
+
--blokhaus-text-purple: #9a6dd7;
|
|
121
|
+
--blokhaus-text-pink: #d44c91;
|
|
122
|
+
--blokhaus-text-red: #ff7369;
|
|
123
|
+
|
|
124
|
+
/* Highlight / background colors — muted for dark backgrounds */
|
|
125
|
+
--blokhaus-highlight-gray: hsl(0 0% 20%);
|
|
126
|
+
--blokhaus-highlight-brown: hsl(20 15% 18%);
|
|
127
|
+
--blokhaus-highlight-orange: hsl(30 30% 18%);
|
|
128
|
+
--blokhaus-highlight-yellow: hsl(45 30% 18%);
|
|
129
|
+
--blokhaus-highlight-green: hsl(160 20% 16%);
|
|
130
|
+
--blokhaus-highlight-blue: hsl(200 25% 18%);
|
|
131
|
+
--blokhaus-highlight-purple: hsl(270 20% 20%);
|
|
132
|
+
--blokhaus-highlight-pink: hsl(330 20% 20%);
|
|
133
|
+
--blokhaus-highlight-red: hsl(0 25% 20%);
|
|
134
|
+
|
|
135
|
+
/* Table */
|
|
136
|
+
--blokhaus-table-border: hsl(217.2 32.6% 22%);
|
|
137
|
+
--blokhaus-table-header-bg: hsl(217.2 32.6% 15%);
|
|
138
|
+
--blokhaus-table-selection: hsla(224.3 76.3% 48% / 0.15);
|
|
139
|
+
--blokhaus-table-resize-handle: hsl(224.3 76.3% 48%);
|
|
140
|
+
|
|
141
|
+
/* Table cell background colors */
|
|
142
|
+
--blokhaus-cell-bg-gray: hsl(0 0% 15%);
|
|
143
|
+
--blokhaus-cell-bg-brown: hsl(20 10% 14%);
|
|
144
|
+
--blokhaus-cell-bg-orange: hsl(30 20% 14%);
|
|
145
|
+
--blokhaus-cell-bg-yellow: hsl(45 20% 14%);
|
|
146
|
+
--blokhaus-cell-bg-green: hsl(160 15% 13%);
|
|
147
|
+
--blokhaus-cell-bg-blue: hsl(200 18% 14%);
|
|
148
|
+
--blokhaus-cell-bg-purple: hsl(270 15% 16%);
|
|
149
|
+
--blokhaus-cell-bg-pink: hsl(330 15% 16%);
|
|
150
|
+
--blokhaus-cell-bg-red: hsl(0 18% 16%);
|
|
151
|
+
|
|
152
|
+
/* Callout presets */
|
|
153
|
+
--blokhaus-callout-default-bg: hsl(0 0% 15%);
|
|
154
|
+
--blokhaus-callout-default-border: hsl(0 0% 35%);
|
|
155
|
+
--blokhaus-callout-info-bg: hsl(200 25% 18%);
|
|
156
|
+
--blokhaus-callout-info-border: hsl(200 60% 45%);
|
|
157
|
+
--blokhaus-callout-warning-bg: hsl(45 30% 18%);
|
|
158
|
+
--blokhaus-callout-warning-border: hsl(45 80% 50%);
|
|
159
|
+
--blokhaus-callout-error-bg: hsl(0 25% 20%);
|
|
160
|
+
--blokhaus-callout-error-border: hsl(0 70% 55%);
|
|
161
|
+
--blokhaus-callout-success-bg: hsl(160 20% 16%);
|
|
162
|
+
--blokhaus-callout-success-border: hsl(160 60% 42%);
|
|
163
|
+
--blokhaus-callout-purple-bg: hsl(270 20% 20%);
|
|
164
|
+
--blokhaus-callout-purple-border: hsl(270 55% 55%);
|
|
165
|
+
|
|
166
|
+
/* Block selection */
|
|
167
|
+
--blokhaus-block-selection: rgba(55, 131, 249, 0.15);
|
|
168
|
+
|
|
169
|
+
/* Loading / overlay */
|
|
170
|
+
--blokhaus-loading-overlay: rgba(255, 255, 255, 0.08);
|
|
171
|
+
|
|
172
|
+
/* AI preview */
|
|
173
|
+
--blokhaus-ai-stream-bg: rgba(100, 150, 255, 0.08);
|
|
174
|
+
|
|
175
|
+
/* Popover / floating UI chrome */
|
|
176
|
+
--blokhaus-popover-bg: rgba(30, 30, 34, 0.88);
|
|
177
|
+
--blokhaus-popover-border: rgba(255, 255, 255, 0.08);
|
|
178
|
+
--blokhaus-popover-shadow: 0 0 0 0.5px rgba(255, 255, 255, 0.06), 0 8px 32px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.2);
|
|
179
|
+
--blokhaus-icon-secondary: rgba(255, 255, 255, 0.55);
|
|
180
|
+
--blokhaus-separator: rgba(255, 255, 255, 0.1);
|
|
181
|
+
--blokhaus-text-tertiary: rgba(255, 255, 255, 0.3);
|
|
182
|
+
--blokhaus-hover-bg: rgba(255, 255, 255, 0.06);
|
|
183
|
+
}
|