@thangph2146/nextjs-editor 1.0.4 → 1.0.9

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/dist/styles.css CHANGED
@@ -1,4 +1,37 @@
1
- /* nextjs-editor: theme + scoped utilities (không cần @source, không bị app ghi đè) */
1
+ /* Dùng @layer nextjs-editor để app thể đặt SCSS/CSS trong layer khác tránh ghi đè editor. Xem README. */
2
+ @layer nextjs-editor {
3
+ /* Fallback CSS variables cho #editor-x khi app chưa định nghĩa */
4
+
5
+ /**
6
+ * Fallback CSS variables cho #editor-x khi app chưa định nghĩa (vd. playground).
7
+ * App có :root { --background, ... } sẽ kế thừa; không có thì dùng giá trị dưới đây.
8
+ */
9
+ #editor-x {
10
+ --background: var(--background, #ffffff);
11
+ --foreground: var(--foreground, #0a0a0a);
12
+ --primary: var(--primary, #171717);
13
+ --primary-foreground: var(--primary-foreground, #fafafa);
14
+ --muted: var(--muted, #f5f5f5);
15
+ --muted-foreground: var(--muted-foreground, #737373);
16
+ --accent: var(--accent, #f5f5f5);
17
+ --accent-foreground: var(--accent-foreground, #171717);
18
+ --border: var(--border, #e5e5e5);
19
+ --ring: var(--ring, #171717);
20
+ --destructive: var(--destructive, #ef4444);
21
+ --destructive-foreground: var(--destructive-foreground, #fafafa);
22
+ --card: var(--card, #ffffff);
23
+ --card-foreground: var(--card-foreground, #0a0a0a);
24
+ --popover: var(--popover, #ffffff);
25
+ --popover-foreground: var(--popover-foreground, #0a0a0a);
26
+ --input: var(--input, #e5e5e5);
27
+ --secondary: var(--secondary, #f5f5f5);
28
+ --secondary-foreground: var(--secondary-foreground, #171717);
29
+ --ring-offset: var(--ring-offset, #ffffff);
30
+ --radius: var(--radius, 0.5rem);
31
+ }
32
+
33
+
34
+ /* nextjs-editor: theme + scoped utilities */
2
35
 
3
36
  .EditorTheme__code {
4
37
  background-color: transparent;
@@ -985,6 +1018,9 @@ div.border.border-dashed .editor-image img {
985
1018
  #editor-x .h-\[var\(--radix-select-trigger-height\)\] {
986
1019
  height: var(--radix-select-trigger-height);
987
1020
  }
1021
+ #editor-x .h-auto {
1022
+ height: auto;
1023
+ }
988
1024
  #editor-x .h-full {
989
1025
  height: 100%;
990
1026
  }
@@ -1042,9 +1078,6 @@ div.border.border-dashed .editor-image img {
1042
1078
  #editor-x .min-h-\[54px\] {
1043
1079
  min-height: 54px;
1044
1080
  }
1045
- #editor-x .min-h-\[70vh\] {
1046
- min-height: 70vh;
1047
- }
1048
1081
  #editor-x .min-h-\[300px\] {
1049
1082
  min-height: 300px;
1050
1083
  }
@@ -1529,6 +1562,10 @@ div.border.border-dashed .editor-image img {
1529
1562
  border-start-end-radius: 0;
1530
1563
  border-end-end-radius: 0;
1531
1564
  }
1565
+ #editor-x .rounded-t-xl {
1566
+ border-top-left-radius: var(--radius-xl);
1567
+ border-top-right-radius: var(--radius-xl);
1568
+ }
1532
1569
  #editor-x .rounded-b-xl {
1533
1570
  border-bottom-right-radius: var(--radius-xl);
1534
1571
  border-bottom-left-radius: var(--radius-xl);
@@ -1656,10 +1693,10 @@ div.border.border-dashed .editor-image img {
1656
1693
  background-color: color-mix(in oklab, var(--background) 95%, transparent);
1657
1694
  }
1658
1695
  }
1659
- #editor-x .bg-black\/20 {
1660
- background-color: color-mix(in srgb, #000 20%, transparent);
1696
+ #editor-x .bg-black\/10 {
1697
+ background-color: color-mix(in srgb, #000 10%, transparent);
1661
1698
  @supports (color: color-mix(in lab, red, red)) {
1662
- background-color: color-mix(in oklab, var(--color-black) 20%, transparent);
1699
+ background-color: color-mix(in oklab, var(--color-black) 10%, transparent);
1663
1700
  }
1664
1701
  }
1665
1702
  #editor-x .bg-black\/60 {
@@ -1722,12 +1759,6 @@ div.border.border-dashed .editor-image img {
1722
1759
  background-color: color-mix(in oklab, var(--muted) 20%, transparent);
1723
1760
  }
1724
1761
  }
1725
- #editor-x .bg-muted\/30 {
1726
- background-color: var(--muted);
1727
- @supports (color: color-mix(in lab, red, red)) {
1728
- background-color: color-mix(in oklab, var(--muted) 30%, transparent);
1729
- }
1730
- }
1731
1762
  #editor-x .bg-muted\/40 {
1732
1763
  background-color: var(--muted);
1733
1764
  @supports (color: color-mix(in lab, red, red)) {
@@ -1921,12 +1952,12 @@ div.border.border-dashed .editor-image img {
1921
1952
  #editor-x .pt-0 {
1922
1953
  padding-top: calc(var(--spacing) * 0);
1923
1954
  }
1955
+ #editor-x .pt-3 {
1956
+ padding-top: calc(var(--spacing) * 3);
1957
+ }
1924
1958
  #editor-x .pt-4 {
1925
1959
  padding-top: calc(var(--spacing) * 4);
1926
1960
  }
1927
- #editor-x .pt-5 {
1928
- padding-top: calc(var(--spacing) * 5);
1929
- }
1930
1961
  #editor-x .pt-6 {
1931
1962
  padding-top: calc(var(--spacing) * 6);
1932
1963
  }
@@ -1936,6 +1967,9 @@ div.border.border-dashed .editor-image img {
1936
1967
  #editor-x .pr-10 {
1937
1968
  padding-right: calc(var(--spacing) * 10);
1938
1969
  }
1970
+ #editor-x .pr-12 {
1971
+ padding-right: calc(var(--spacing) * 12);
1972
+ }
1939
1973
  #editor-x .pb-2 {
1940
1974
  padding-bottom: calc(var(--spacing) * 2);
1941
1975
  }
@@ -2205,6 +2239,10 @@ div.border.border-dashed .editor-image img {
2205
2239
  --tw-shadow: 0 4px 6px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 2px 4px -2px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
2206
2240
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2207
2241
  }
2242
+ #editor-x .shadow-none {
2243
+ --tw-shadow: 0 0 #0000;
2244
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2245
+ }
2208
2246
  #editor-x .shadow-sm {
2209
2247
  --tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
2210
2248
  box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
@@ -3281,6 +3319,11 @@ div.border.border-dashed .editor-image img {
3281
3319
  padding-block: calc(var(--spacing) * 6);
3282
3320
  }
3283
3321
  }
3322
+ #editor-x .sm\:text-center {
3323
+ @media (width >= 40rem) {
3324
+ text-align: center;
3325
+ }
3326
+ }
3284
3327
  #editor-x .sm\:text-left {
3285
3328
  @media (width >= 40rem) {
3286
3329
  text-align: left;
@@ -4274,3 +4317,5 @@ div.border.border-dashed .editor-image img {
4274
4317
  }
4275
4318
  }
4276
4319
  }
4320
+
4321
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thangph2146/nextjs-editor",
3
- "version": "1.0.4",
3
+ "version": "1.0.9",
4
4
  "description": "Rich text editor for Next.js built on Lexical",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -20,7 +20,8 @@
20
20
  "./styles.css": "./dist/styles.css"
21
21
  },
22
22
  "files": [
23
- "dist"
23
+ "dist",
24
+ "README.md"
24
25
  ],
25
26
  "scripts": {
26
27
  "build": "tsup && node scripts/build-editor-css.mjs",