docblocks-react-ui 0.0.0-stage → 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.
Files changed (89) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/LICENSE +21 -0
  3. package/README.md +585 -2
  4. package/dist/Editor-CiJY5R4v.mjs +26587 -0
  5. package/dist/Editor-DT7RkRXf.d.mts +32 -0
  6. package/dist/LoaderCircle-AGVFE4IP.mjs +19 -0
  7. package/dist/Skeleton-D922Ths5.mjs +13 -0
  8. package/dist/constants-D4FTL0ph.mjs +81 -0
  9. package/dist/fonts/OFL.txt +162 -0
  10. package/dist/fonts/inter-300-c.woff2 +0 -0
  11. package/dist/fonts/inter-300-l.woff2 +0 -0
  12. package/dist/fonts/inter-300i-c.woff2 +0 -0
  13. package/dist/fonts/inter-300i-l.woff2 +0 -0
  14. package/dist/fonts/inter-400-c.woff2 +0 -0
  15. package/dist/fonts/inter-400-l.woff2 +0 -0
  16. package/dist/fonts/inter-400i-c.woff2 +0 -0
  17. package/dist/fonts/inter-400i-l.woff2 +0 -0
  18. package/dist/fonts/inter-600-c.woff2 +0 -0
  19. package/dist/fonts/inter-600-l.woff2 +0 -0
  20. package/dist/fonts/inter-600i-c.woff2 +0 -0
  21. package/dist/fonts/inter-600i-l.woff2 +0 -0
  22. package/dist/fonts/jetbrains-mono-300-c.woff2 +0 -0
  23. package/dist/fonts/jetbrains-mono-300-l.woff2 +0 -0
  24. package/dist/fonts/jetbrains-mono-300i-c.woff2 +0 -0
  25. package/dist/fonts/jetbrains-mono-300i-l.woff2 +0 -0
  26. package/dist/fonts/jetbrains-mono-400-c.woff2 +0 -0
  27. package/dist/fonts/jetbrains-mono-400-l.woff2 +0 -0
  28. package/dist/fonts/jetbrains-mono-400i-c.woff2 +0 -0
  29. package/dist/fonts/jetbrains-mono-400i-l.woff2 +0 -0
  30. package/dist/fonts/jetbrains-mono-600-c.woff2 +0 -0
  31. package/dist/fonts/jetbrains-mono-600-l.woff2 +0 -0
  32. package/dist/fonts/jetbrains-mono-600i-c.woff2 +0 -0
  33. package/dist/fonts/jetbrains-mono-600i-l.woff2 +0 -0
  34. package/dist/fonts/lora-400-c.woff2 +0 -0
  35. package/dist/fonts/lora-400-l.woff2 +0 -0
  36. package/dist/fonts/lora-400i-c.woff2 +0 -0
  37. package/dist/fonts/lora-400i-l.woff2 +0 -0
  38. package/dist/fonts/lora-600-c.woff2 +0 -0
  39. package/dist/fonts/lora-600-l.woff2 +0 -0
  40. package/dist/fonts/lora-600i-c.woff2 +0 -0
  41. package/dist/fonts/lora-600i-l.woff2 +0 -0
  42. package/dist/fonts/lora-700-c.woff2 +0 -0
  43. package/dist/fonts/lora-700-l.woff2 +0 -0
  44. package/dist/fonts/lora-700i-c.woff2 +0 -0
  45. package/dist/fonts/lora-700i-l.woff2 +0 -0
  46. package/dist/fonts/open-sans-300-c.woff2 +0 -0
  47. package/dist/fonts/open-sans-300-l.woff2 +0 -0
  48. package/dist/fonts/open-sans-300i-c.woff2 +0 -0
  49. package/dist/fonts/open-sans-300i-l.woff2 +0 -0
  50. package/dist/fonts/open-sans-400-c.woff2 +0 -0
  51. package/dist/fonts/open-sans-400-l.woff2 +0 -0
  52. package/dist/fonts/open-sans-400i-c.woff2 +0 -0
  53. package/dist/fonts/open-sans-400i-l.woff2 +0 -0
  54. package/dist/fonts/open-sans-600-c.woff2 +0 -0
  55. package/dist/fonts/open-sans-600-l.woff2 +0 -0
  56. package/dist/fonts/open-sans-600i-c.woff2 +0 -0
  57. package/dist/fonts/open-sans-600i-l.woff2 +0 -0
  58. package/dist/fonts/pt-sans-400-c.woff2 +0 -0
  59. package/dist/fonts/pt-sans-400-l.woff2 +0 -0
  60. package/dist/fonts/pt-sans-400i-c.woff2 +0 -0
  61. package/dist/fonts/pt-sans-400i-l.woff2 +0 -0
  62. package/dist/fonts/pt-sans-700-c.woff2 +0 -0
  63. package/dist/fonts/pt-sans-700-l.woff2 +0 -0
  64. package/dist/fonts/pt-sans-700i-c.woff2 +0 -0
  65. package/dist/fonts/pt-sans-700i-l.woff2 +0 -0
  66. package/dist/fonts/pt-serif-400-c.woff2 +0 -0
  67. package/dist/fonts/pt-serif-400-l.woff2 +0 -0
  68. package/dist/fonts/pt-serif-400i-c.woff2 +0 -0
  69. package/dist/fonts/pt-serif-400i-l.woff2 +0 -0
  70. package/dist/fonts/pt-serif-700-c.woff2 +0 -0
  71. package/dist/fonts/pt-serif-700-l.woff2 +0 -0
  72. package/dist/fonts/pt-serif-700i-c.woff2 +0 -0
  73. package/dist/fonts/pt-serif-700i-l.woff2 +0 -0
  74. package/dist/index-D6_ysSmQ.d.mts +1075 -0
  75. package/dist/index-YJcgf8Hh.d.mts +39 -0
  76. package/dist/index.d.mts +388 -0
  77. package/dist/index.mjs +641 -0
  78. package/dist/mermaid/index.d.mts +10 -0
  79. package/dist/mermaid/index.mjs +252 -0
  80. package/dist/motion/index.d.mts +8 -0
  81. package/dist/motion/index.mjs +1009 -0
  82. package/dist/pdf/index.d.mts +5 -0
  83. package/dist/pdf/index.mjs +164 -0
  84. package/dist/pdf/jbig2.wasm +0 -0
  85. package/dist/pdf/jbig2_nowasm_fallback.js +15 -0
  86. package/dist/pdf/pdf.worker.min.mjs +28 -0
  87. package/dist/styles.css +4562 -0
  88. package/package.json +99 -4
  89. package/theme.css +128 -0
package/package.json CHANGED
@@ -1,6 +1,101 @@
1
1
  {
2
2
  "name": "docblocks-react-ui",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "React rendering + editing layer for docblocks: hooks, block renderers, caret/selection, keyboard, clipboard.",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "files": [
8
+ "dist",
9
+ "!dist/.tmp",
10
+ "theme.css",
11
+ "CHANGELOG.md"
12
+ ],
13
+ "sideEffects": [
14
+ "**/*.css",
15
+ "dist/pdf/index.mjs"
16
+ ],
17
+ "exports": {
18
+ ".": {
19
+ "types": "./dist/index.d.mts",
20
+ "import": "./dist/index.mjs"
21
+ },
22
+ "./mermaid": {
23
+ "types": "./dist/mermaid/index.d.mts",
24
+ "import": "./dist/mermaid/index.mjs"
25
+ },
26
+ "./pdf": {
27
+ "types": "./dist/pdf/index.d.mts",
28
+ "import": "./dist/pdf/index.mjs"
29
+ },
30
+ "./motion": {
31
+ "types": "./dist/motion/index.d.mts",
32
+ "import": "./dist/motion/index.mjs"
33
+ },
34
+ "./styles.css": "./dist/styles.css",
35
+ "./theme.css": "./theme.css"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public"
39
+ },
40
+ "peerDependencies": {
41
+ "docblocks-core": "*",
42
+ "framer-motion": "^11.0.0 || ^12.0.0 || ^13.0.0 || ^14.0.0",
43
+ "mermaid": "^12.0.0",
44
+ "pdfjs-dist": "^6.0.0",
45
+ "react": "^19.0.0",
46
+ "react-dom": "^19.0.0"
47
+ },
48
+ "peerDependenciesMeta": {
49
+ "framer-motion": {
50
+ "optional": true
51
+ },
52
+ "mermaid": {
53
+ "optional": true
54
+ },
55
+ "pdfjs-dist": {
56
+ "optional": true
57
+ }
58
+ },
59
+ "dependencies": {
60
+ "@radix-ui/react-checkbox": "^1.3.11",
61
+ "@radix-ui/react-dropdown-menu": "^2.1.24",
62
+ "@radix-ui/react-popover": "^1.1.23",
63
+ "@radix-ui/react-select": "^2.3.7",
64
+ "@radix-ui/react-separator": "^1.1.15",
65
+ "@radix-ui/react-slot": "^1.3.3",
66
+ "@radix-ui/react-tabs": "^1.2.1",
67
+ "@radix-ui/react-tooltip": "^1.2.16",
68
+ "class-variance-authority": "^0.7.1",
69
+ "clsx": "^2.1.1",
70
+ "date-fns": "^4.4.0",
71
+ "highlight.js": "^11.12.0",
72
+ "react-day-picker": "^10.0.2",
73
+ "tailwind-merge": "^3.7.0",
74
+ "zustand": "^5.0.15"
75
+ },
76
+ "devDependencies": {
77
+ "@tailwindcss/cli": "^4.3.3",
78
+ "@testing-library/react": "^16.3.3",
79
+ "@types/node": "^26.6.4",
80
+ "@types/react": "^19.3.0",
81
+ "@types/react-dom": "^19.3.0",
82
+ "docblocks-core": "*",
83
+ "framer-motion": "^14.1.0",
84
+ "jsdom": "^30.1.2",
85
+ "mermaid": "12.2.0",
86
+ "pdfjs-dist": "6.4.299",
87
+ "react": "^19.3.0",
88
+ "react-dom": "^19.3.0",
89
+ "tailwindcss": "^4.3.3",
90
+ "tw-animate-css": "^1.4.0"
91
+ },
92
+ "scripts": {
93
+ "build": "tsdown && tailwindcss -i ui.entry.css -o dist/.tmp/ui-layer.css && node scripts/assemble-styles.mjs && node scripts/copy-pdf-worker.mjs",
94
+ "prepack": "npm run build",
95
+ "typecheck": "tsc --noEmit",
96
+ "test": "vitest run"
97
+ },
98
+ "engines": {
99
+ "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
100
+ }
101
+ }
package/theme.css ADDED
@@ -0,0 +1,128 @@
1
+ /*
2
+ * Standard (shadcn) theme token seed — plain CSS, no build-tool syntax.
3
+ *
4
+ * The editor (styles.css) reads these tokens as optional inputs: when they
5
+ * are defined, the editor follows the theme (the dark set flips under the
6
+ * `dark` class on <html> or any ancestor); when they are not, the shipped
7
+ * literals in styles.css stand. This file also feeds the shipped
8
+ * stylesheet (dist/styles.css: the assemble script appends it after the
9
+ * utility layer), so the standard tokens ship with the default import.
10
+ * Import it standalone for the pure seed (without the utility layer), or
11
+ * skip it and define the same tokens in your own theme (a Tailwind v4 app
12
+ * typically carries them in its `@theme`/global stylesheet, in which case
13
+ * this file is not needed).
14
+ *
15
+ * The tokens the editor reads: --foreground, --primary,
16
+ * --primary-foreground, --muted, --muted-foreground, --accent,
17
+ * --destructive, --border, --card, --popover, --radius, --font-sans,
18
+ * --font-mono. The remaining standard tokens are shipped so a consumer
19
+ * without a theme has the full set.
20
+ * The `--radius-*` scale (the radius steps around `--radius`) stands real
21
+ * CSS variables: the shared primitives (the Calendar's cell radius) read
22
+ * them with `var(--radius-…)`. The `--docblocks-palette-*` set (the color
23
+ * palette's pastel tokens) stands here too — on `:root` / `.dark`, not the
24
+ * editor root, so it cascades to the portaled palette popovers (the toolbar
25
+ * palettes portal to `document.body`, outside the editor root).
26
+ */
27
+
28
+ :root {
29
+ --radius: 0.625rem;
30
+ --radius-xs: calc(var(--radius) - 6px);
31
+ --radius-sm: calc(var(--radius) - 4px);
32
+ --radius-md: calc(var(--radius) - 2px);
33
+ --radius-lg: var(--radius);
34
+ --radius-xl: calc(var(--radius) + 4px);
35
+ --background: oklch(1 0 0);
36
+ --foreground: oklch(0.145 0 0);
37
+ --card: oklch(1 0 0);
38
+ --card-foreground: oklch(0.145 0 0);
39
+ --popover: oklch(1 0 0);
40
+ --popover-foreground: oklch(0.145 0 0);
41
+ --primary: oklch(0.205 0 0);
42
+ --primary-foreground: oklch(0.985 0 0);
43
+ --secondary: oklch(0.97 0 0);
44
+ --secondary-foreground: oklch(0.205 0 0);
45
+ --muted: oklch(0.97 0 0);
46
+ --muted-foreground: oklch(0.556 0 0);
47
+ --accent: oklch(0.97 0 0);
48
+ --accent-foreground: oklch(0.205 0 0);
49
+ --destructive: oklch(0.577 0.245 27.325);
50
+ --border: oklch(0.922 0 0);
51
+ --input: oklch(0.922 0 0);
52
+ --ring: oklch(0.708 0 0);
53
+ --chart-1: oklch(0.646 0.222 41.116);
54
+ --chart-2: oklch(0.6 0.118 184.704);
55
+ --chart-3: oklch(0.398 0.07 227.392);
56
+ --chart-4: oklch(0.828 0.189 84.429);
57
+ --chart-5: oklch(0.769 0.188 70.08);
58
+ --sidebar: oklch(0.985 0 0);
59
+ --sidebar-foreground: oklch(0.145 0 0);
60
+ --sidebar-primary: oklch(0.205 0 0);
61
+ --sidebar-primary-foreground: oklch(0.985 0 0);
62
+ --sidebar-accent: oklch(0.97 0 0);
63
+ --sidebar-accent-foreground: oklch(0.205 0 0);
64
+ --sidebar-border: oklch(0.922 0 0);
65
+ --sidebar-ring: oklch(0.708 0 0);
66
+ --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
67
+ --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
68
+
69
+ /* The color palette's pastel tokens (the shared palette primitive's
70
+ default swatches): the light set stands over the dark set (the `.dark`
71
+ values' same OKLCH hues, raised lightness + raised chroma — a bit
72
+ more saturated, not just lighter), so the swatch stands visibly more
73
+ saturated on the light theme and more muted on the dark. The eighth
74
+ swatch is the theme's own background token (`--background`), not part
75
+ of this set. */
76
+ --docblocks-palette-red: #ff8e8e;
77
+ --docblocks-palette-orange: #ffbc6c;
78
+ --docblocks-palette-yellow: #ffe765;
79
+ --docblocks-palette-green: #7eeea2;
80
+ --docblocks-palette-cyan: #73dbff;
81
+ --docblocks-palette-blue: #88b2ff;
82
+ --docblocks-palette-violet: #c9a1ff;
83
+ }
84
+
85
+ .dark {
86
+ --background: oklch(0.145 0 0);
87
+ --foreground: oklch(0.985 0 0);
88
+ --card: oklch(0.205 0 0);
89
+ --card-foreground: oklch(0.985 0 0);
90
+ --popover: oklch(0.205 0 0);
91
+ --popover-foreground: oklch(0.985 0 0);
92
+ --primary: oklch(0.922 0 0);
93
+ --primary-foreground: oklch(0.205 0 0);
94
+ --secondary: oklch(0.269 0 0);
95
+ --secondary-foreground: oklch(0.985 0 0);
96
+ --muted: oklch(0.269 0 0);
97
+ --muted-foreground: oklch(0.708 0 0);
98
+ --accent: oklch(0.269 0 0);
99
+ --accent-foreground: oklch(0.985 0 0);
100
+ --destructive: oklch(0.704 0.191 22.216);
101
+ --border: oklch(1 0 0 / 10%);
102
+ --input: oklch(1 0 0 / 15%);
103
+ --ring: oklch(0.556 0 0);
104
+ --chart-1: oklch(0.488 0.243 264.376);
105
+ --chart-2: oklch(0.696 0.17 162.48);
106
+ --chart-3: oklch(0.769 0.188 70.08);
107
+ --chart-4: oklch(0.627 0.265 303.9);
108
+ --chart-5: oklch(0.645 0.246 16.439);
109
+ --sidebar: oklch(0.205 0 0);
110
+ --sidebar-foreground: oklch(0.985 0 0);
111
+ --sidebar-primary: oklch(0.922 0 0);
112
+ --sidebar-primary-foreground: oklch(0.205 0 0);
113
+ --sidebar-accent: oklch(0.269 0 0);
114
+ --sidebar-accent-foreground: oklch(0.985 0 0);
115
+ --sidebar-border: oklch(1 0 0 / 10%);
116
+ --sidebar-ring: oklch(0.556 0 0);
117
+
118
+ /* The color palette's pastel tokens, dark set (more muted than the light
119
+ set — the same hues at lower lightness and lower chroma, still legible
120
+ over the dark popover). */
121
+ --docblocks-palette-red: #c96a6a;
122
+ --docblocks-palette-orange: #cf9155;
123
+ --docblocks-palette-yellow: #cdb755;
124
+ --docblocks-palette-green: #63b87e;
125
+ --docblocks-palette-cyan: #5aa8cd;
126
+ --docblocks-palette-blue: #6585cd;
127
+ --docblocks-palette-violet: #9779cd;
128
+ }