@frontlit/text-editor 0.1.0-alpha.1 → 0.1.0-alpha.2
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 +45 -0
- package/dist/docs.d.ts +90 -0
- package/dist/docs.js +905 -0
- package/dist/docs.js.map +1 -0
- package/dist/headings.d.ts +17 -0
- package/dist/headings.js +35 -0
- package/dist/headings.js.map +1 -0
- package/dist/index.d.ts +13 -7
- package/dist/index.js +264 -128
- package/dist/index.js.map +1 -1
- package/dist/prose.css +191 -193
- package/dist/renderer/index.d.ts +70 -0
- package/dist/renderer/index.js +356 -0
- package/dist/renderer/index.js.map +1 -0
- package/dist/renderer/islands/copy-code-button.js +56 -0
- package/dist/renderer/islands/copy-code-button.js.map +1 -0
- package/dist/styles.css +114 -63
- package/dist/tokens.css +43 -43
- package/package.json +36 -11
package/dist/styles.css
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
/*! tailwindcss v4.3.
|
|
1
|
+
/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
5
5
|
:root, :host {
|
|
6
|
-
--font-sans:
|
|
7
|
-
"
|
|
6
|
+
--font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
|
|
7
|
+
"Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji",
|
|
8
|
+
"Segoe UI Symbol", "Noto Color Emoji";
|
|
8
9
|
--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono",
|
|
9
10
|
"Courier New", monospace;
|
|
10
11
|
--spacing: 0.25rem;
|
|
@@ -44,7 +45,7 @@
|
|
|
44
45
|
line-height: 1.5;
|
|
45
46
|
-webkit-text-size-adjust: 100%;
|
|
46
47
|
tab-size: 4;
|
|
47
|
-
font-family: var(--default-font-family,
|
|
48
|
+
font-family: var(--default-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");
|
|
48
49
|
font-feature-settings: var(--default-font-feature-settings, normal);
|
|
49
50
|
font-variation-settings: var(--default-font-variation-settings, normal);
|
|
50
51
|
-webkit-tap-highlight-color: transparent;
|
|
@@ -96,7 +97,7 @@
|
|
|
96
97
|
border-color: inherit;
|
|
97
98
|
border-collapse: collapse;
|
|
98
99
|
}
|
|
99
|
-
:-moz-focusring {
|
|
100
|
+
:-moz-focusring:where(:not(iframe)) {
|
|
100
101
|
outline: auto;
|
|
101
102
|
}
|
|
102
103
|
progress {
|
|
@@ -198,16 +199,16 @@
|
|
|
198
199
|
position: sticky;
|
|
199
200
|
}
|
|
200
201
|
.top-0 {
|
|
201
|
-
top:
|
|
202
|
+
top: 0px;
|
|
202
203
|
}
|
|
203
204
|
.top-full {
|
|
204
205
|
top: 100%;
|
|
205
206
|
}
|
|
206
207
|
.right-0 {
|
|
207
|
-
right:
|
|
208
|
+
right: 0px;
|
|
208
209
|
}
|
|
209
210
|
.left-0 {
|
|
210
|
-
left:
|
|
211
|
+
left: 0px;
|
|
211
212
|
}
|
|
212
213
|
.left-2 {
|
|
213
214
|
left: calc(var(--spacing) * 2);
|
|
@@ -505,6 +506,9 @@
|
|
|
505
506
|
.text-primary-foreground {
|
|
506
507
|
color: var(--primary-foreground);
|
|
507
508
|
}
|
|
509
|
+
.lowercase {
|
|
510
|
+
text-transform: lowercase;
|
|
511
|
+
}
|
|
508
512
|
.italic {
|
|
509
513
|
font-style: italic;
|
|
510
514
|
}
|
|
@@ -527,79 +531,60 @@
|
|
|
527
531
|
--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|
|
528
532
|
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
529
533
|
}
|
|
534
|
+
.filter {
|
|
535
|
+
filter: var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,);
|
|
536
|
+
}
|
|
530
537
|
.transition-colors {
|
|
531
538
|
transition-property: color, background-color, border-color, outline-color, text-decoration-color, fill, stroke, --tw-gradient-from, --tw-gradient-via, --tw-gradient-to;
|
|
532
539
|
transition-timing-function: var(--tw-ease, var(--default-transition-timing-function));
|
|
533
540
|
transition-duration: var(--tw-duration, var(--default-transition-duration));
|
|
534
541
|
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
background-color: var(--primary-soft);
|
|
539
|
-
}
|
|
542
|
+
@media (hover: hover) {
|
|
543
|
+
.hover\:bg-\[var\(--primary-soft\)\]:hover {
|
|
544
|
+
background-color: var(--primary-soft);
|
|
540
545
|
}
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
&:hover {
|
|
544
|
-
@media (hover: hover) {
|
|
545
|
-
background-color: var(--destructive);
|
|
546
|
-
@supports (color: color-mix(in lab, red, red)) {
|
|
547
|
-
background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
|
|
548
|
-
}
|
|
549
|
-
}
|
|
546
|
+
.hover\:bg-destructive\/10:hover {
|
|
547
|
+
background-color: var(--destructive);
|
|
550
548
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
@media (hover: hover) {
|
|
555
|
-
background-color: var(--muted);
|
|
549
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
550
|
+
.hover\:bg-destructive\/10:hover {
|
|
551
|
+
background-color: color-mix(in oklab, var(--destructive) 10%, transparent);
|
|
556
552
|
}
|
|
557
553
|
}
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
554
|
+
.hover\:bg-muted:hover {
|
|
555
|
+
background-color: var(--muted);
|
|
556
|
+
}
|
|
557
|
+
.hover\:bg-primary\/90:hover {
|
|
558
|
+
background-color: var(--primary);
|
|
559
|
+
}
|
|
560
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
561
|
+
.hover\:bg-primary\/90:hover {
|
|
562
|
+
background-color: color-mix(in oklab, var(--primary) 90%, transparent);
|
|
566
563
|
}
|
|
567
564
|
}
|
|
568
565
|
}
|
|
569
|
-
.focus-visible\:outline {
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
outline-width: 1px;
|
|
573
|
-
}
|
|
566
|
+
.focus-visible\:outline:focus-visible {
|
|
567
|
+
outline-style: var(--tw-outline-style);
|
|
568
|
+
outline-width: 1px;
|
|
574
569
|
}
|
|
575
|
-
.focus-visible\:outline-2 {
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
outline-width: 2px;
|
|
579
|
-
}
|
|
570
|
+
.focus-visible\:outline-2:focus-visible {
|
|
571
|
+
outline-style: var(--tw-outline-style);
|
|
572
|
+
outline-width: 2px;
|
|
580
573
|
}
|
|
581
|
-
.focus-visible\:outline-offset-2 {
|
|
582
|
-
|
|
583
|
-
outline-offset: 2px;
|
|
584
|
-
}
|
|
574
|
+
.focus-visible\:outline-offset-2:focus-visible {
|
|
575
|
+
outline-offset: 2px;
|
|
585
576
|
}
|
|
586
|
-
.focus-visible\:outline-primary {
|
|
587
|
-
|
|
588
|
-
outline-color: var(--primary);
|
|
589
|
-
}
|
|
577
|
+
.focus-visible\:outline-primary:focus-visible {
|
|
578
|
+
outline-color: var(--primary);
|
|
590
579
|
}
|
|
591
|
-
.disabled\:cursor-not-allowed {
|
|
592
|
-
|
|
593
|
-
cursor: not-allowed;
|
|
594
|
-
}
|
|
580
|
+
.disabled\:cursor-not-allowed:disabled {
|
|
581
|
+
cursor: not-allowed;
|
|
595
582
|
}
|
|
596
|
-
.disabled\:opacity-50 {
|
|
597
|
-
|
|
598
|
-
opacity: 50%;
|
|
599
|
-
}
|
|
583
|
+
.disabled\:opacity-50:disabled {
|
|
584
|
+
opacity: 50%;
|
|
600
585
|
}
|
|
601
|
-
|
|
602
|
-
|
|
586
|
+
@media (width >= 80rem) {
|
|
587
|
+
.xl\:inline {
|
|
603
588
|
display: inline;
|
|
604
589
|
}
|
|
605
590
|
}
|
|
@@ -1022,6 +1007,59 @@
|
|
|
1022
1007
|
inherits: false;
|
|
1023
1008
|
initial-value: 0 0 #0000;
|
|
1024
1009
|
}
|
|
1010
|
+
@property --tw-blur {
|
|
1011
|
+
syntax: "*";
|
|
1012
|
+
inherits: false;
|
|
1013
|
+
}
|
|
1014
|
+
@property --tw-brightness {
|
|
1015
|
+
syntax: "*";
|
|
1016
|
+
inherits: false;
|
|
1017
|
+
}
|
|
1018
|
+
@property --tw-contrast {
|
|
1019
|
+
syntax: "*";
|
|
1020
|
+
inherits: false;
|
|
1021
|
+
}
|
|
1022
|
+
@property --tw-grayscale {
|
|
1023
|
+
syntax: "*";
|
|
1024
|
+
inherits: false;
|
|
1025
|
+
}
|
|
1026
|
+
@property --tw-hue-rotate {
|
|
1027
|
+
syntax: "*";
|
|
1028
|
+
inherits: false;
|
|
1029
|
+
}
|
|
1030
|
+
@property --tw-invert {
|
|
1031
|
+
syntax: "*";
|
|
1032
|
+
inherits: false;
|
|
1033
|
+
}
|
|
1034
|
+
@property --tw-opacity {
|
|
1035
|
+
syntax: "*";
|
|
1036
|
+
inherits: false;
|
|
1037
|
+
}
|
|
1038
|
+
@property --tw-saturate {
|
|
1039
|
+
syntax: "*";
|
|
1040
|
+
inherits: false;
|
|
1041
|
+
}
|
|
1042
|
+
@property --tw-sepia {
|
|
1043
|
+
syntax: "*";
|
|
1044
|
+
inherits: false;
|
|
1045
|
+
}
|
|
1046
|
+
@property --tw-drop-shadow {
|
|
1047
|
+
syntax: "*";
|
|
1048
|
+
inherits: false;
|
|
1049
|
+
}
|
|
1050
|
+
@property --tw-drop-shadow-color {
|
|
1051
|
+
syntax: "*";
|
|
1052
|
+
inherits: false;
|
|
1053
|
+
}
|
|
1054
|
+
@property --tw-drop-shadow-alpha {
|
|
1055
|
+
syntax: "<percentage>";
|
|
1056
|
+
inherits: false;
|
|
1057
|
+
initial-value: 100%;
|
|
1058
|
+
}
|
|
1059
|
+
@property --tw-drop-shadow-size {
|
|
1060
|
+
syntax: "*";
|
|
1061
|
+
inherits: false;
|
|
1062
|
+
}
|
|
1025
1063
|
@property --tw-outline-style {
|
|
1026
1064
|
syntax: "*";
|
|
1027
1065
|
inherits: false;
|
|
@@ -1052,6 +1090,19 @@
|
|
|
1052
1090
|
--tw-ring-offset-width: 0px;
|
|
1053
1091
|
--tw-ring-offset-color: #fff;
|
|
1054
1092
|
--tw-ring-offset-shadow: 0 0 #0000;
|
|
1093
|
+
--tw-blur: initial;
|
|
1094
|
+
--tw-brightness: initial;
|
|
1095
|
+
--tw-contrast: initial;
|
|
1096
|
+
--tw-grayscale: initial;
|
|
1097
|
+
--tw-hue-rotate: initial;
|
|
1098
|
+
--tw-invert: initial;
|
|
1099
|
+
--tw-opacity: initial;
|
|
1100
|
+
--tw-saturate: initial;
|
|
1101
|
+
--tw-sepia: initial;
|
|
1102
|
+
--tw-drop-shadow: initial;
|
|
1103
|
+
--tw-drop-shadow-color: initial;
|
|
1104
|
+
--tw-drop-shadow-alpha: 100%;
|
|
1105
|
+
--tw-drop-shadow-size: initial;
|
|
1055
1106
|
--tw-outline-style: solid;
|
|
1056
1107
|
}
|
|
1057
1108
|
}
|
package/dist/tokens.css
CHANGED
|
@@ -9,50 +9,50 @@
|
|
|
9
9
|
*/
|
|
10
10
|
.tiptap-editor,
|
|
11
11
|
.bubble-menu {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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
33
|
}
|
|
34
34
|
|
|
35
35
|
@theme inline {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
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
58
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontlit/text-editor",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.2",
|
|
4
4
|
"description": "A TipTap-based rich text editor and static renderer for React",
|
|
5
5
|
"author": "FrontLit",
|
|
6
6
|
"license": "MIT",
|
|
@@ -19,6 +19,21 @@
|
|
|
19
19
|
"import": "./dist/index.js",
|
|
20
20
|
"default": "./dist/index.js"
|
|
21
21
|
},
|
|
22
|
+
"./renderer": {
|
|
23
|
+
"types": "./dist/renderer/index.d.ts",
|
|
24
|
+
"import": "./dist/renderer/index.js",
|
|
25
|
+
"default": "./dist/renderer/index.js"
|
|
26
|
+
},
|
|
27
|
+
"./docs": {
|
|
28
|
+
"types": "./dist/docs.d.ts",
|
|
29
|
+
"import": "./dist/docs.js",
|
|
30
|
+
"default": "./dist/docs.js"
|
|
31
|
+
},
|
|
32
|
+
"./headings": {
|
|
33
|
+
"types": "./dist/headings.d.ts",
|
|
34
|
+
"import": "./dist/headings.js",
|
|
35
|
+
"default": "./dist/headings.js"
|
|
36
|
+
},
|
|
22
37
|
"./styles.css": "./dist/styles.css",
|
|
23
38
|
"./prose.css": "./dist/prose.css",
|
|
24
39
|
"./tokens.css": "./dist/tokens.css"
|
|
@@ -46,6 +61,14 @@
|
|
|
46
61
|
"editor",
|
|
47
62
|
"frontlit"
|
|
48
63
|
],
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsup && tsup --config tsup.renderer.config.ts && 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",
|
|
66
|
+
"prepublishOnly": "bun run build",
|
|
67
|
+
"dev": "tsup --watch",
|
|
68
|
+
"clean": "rimraf dist",
|
|
69
|
+
"check-types": "tsc --noEmit",
|
|
70
|
+
"test": "vitest run"
|
|
71
|
+
},
|
|
49
72
|
"peerDependencies": {
|
|
50
73
|
"react": "^18.0.0 || ^19.0.0",
|
|
51
74
|
"react-dom": "^18.0.0 || ^19.0.0"
|
|
@@ -63,6 +86,7 @@
|
|
|
63
86
|
"@tiptap/extension-link": "^3.0.0",
|
|
64
87
|
"@tiptap/extension-placeholder": "^3.0.0",
|
|
65
88
|
"@tiptap/extension-table": "^3.10.7",
|
|
89
|
+
"@tiptap/pm": "^3.0.0",
|
|
66
90
|
"@tiptap/react": "^3.0.0",
|
|
67
91
|
"@tiptap/starter-kit": "^3.0.0",
|
|
68
92
|
"@tiptap/static-renderer": "^3.10.7",
|
|
@@ -70,22 +94,23 @@
|
|
|
70
94
|
"highlight.js": "^11.10.0",
|
|
71
95
|
"lowlight": "^2.9.0",
|
|
72
96
|
"lucide-react": "^0.553.0",
|
|
73
|
-
"
|
|
97
|
+
"remark-gfm": "^4.0.1",
|
|
98
|
+
"remark-parse": "^11.0.0",
|
|
99
|
+
"remark-stringify": "^11.0.0",
|
|
100
|
+
"tailwind-merge": "^3.4.0",
|
|
101
|
+
"unified": "^11.0.5",
|
|
102
|
+
"yaml": "^2.9.0"
|
|
74
103
|
},
|
|
75
104
|
"devDependencies": {
|
|
105
|
+
"@tailwindcss/cli": "^4.1.0",
|
|
106
|
+
"@types/mdast": "^4.0.0",
|
|
76
107
|
"@types/node": "^20.0.0",
|
|
77
108
|
"@types/react": "^19.0.0",
|
|
78
109
|
"@types/react-dom": "^19.0.0",
|
|
79
|
-
"@tailwindcss/cli": "^4.1.0",
|
|
80
110
|
"rimraf": "^5.0.0",
|
|
81
111
|
"tailwindcss": "^4.1.0",
|
|
82
112
|
"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"
|
|
113
|
+
"typescript": "^5.6.2",
|
|
114
|
+
"vitest": "^3.2.4"
|
|
90
115
|
}
|
|
91
|
-
}
|
|
116
|
+
}
|