@valbuild/ui 0.21.2 → 0.22.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/.storybook/theme.css +5 -1
- package/components.json +16 -0
- package/dist/valbuild-ui.cjs.d.ts +11 -7
- package/dist/valbuild-ui.cjs.js +43607 -33216
- package/dist/valbuild-ui.esm.js +48313 -37938
- package/fix-server-hack.js +45 -0
- package/fullscreen.vite.config.ts +11 -0
- package/index.html +13 -0
- package/package.json +52 -13
- package/server/dist/manifest.json +16 -0
- package/server/dist/style.css +2145 -0
- package/server/dist/valbuild-ui-main.cjs.js +74441 -0
- package/server/dist/valbuild-ui-main.esm.js +74442 -0
- package/server/dist/valbuild-ui-server.cjs.js +19 -2
- package/server/dist/valbuild-ui-server.esm.js +19 -2
- package/server.vite.config.ts +2 -0
- package/src/App.tsx +73 -0
- package/src/assets/icons/Logo.tsx +103 -0
- package/src/components/Button.tsx +10 -2
- package/src/components/Dropdown.tsx +2 -2
- package/src/components/{dashboard/Grid.stories.tsx → Grid.stories.tsx} +8 -17
- package/src/components/{dashboard/Grid.tsx → Grid.tsx} +36 -23
- package/src/components/RichTextEditor/ContentEditable.tsx +109 -1
- package/src/components/RichTextEditor/Plugins/Toolbar.tsx +2 -2
- package/src/components/RichTextEditor/RichTextEditor.tsx +1 -1
- package/src/components/ValFormField.tsx +576 -0
- package/src/components/ValFullscreen.tsx +1283 -0
- package/src/components/ValMenu.tsx +65 -13
- package/src/components/ValOverlay.tsx +32 -338
- package/src/components/ValWindow.tsx +12 -9
- package/src/components/dashboard/FormGroup.tsx +12 -6
- package/src/components/dashboard/Tree.tsx +2 -2
- package/src/components/ui/accordion.tsx +58 -0
- package/src/components/ui/alert-dialog.tsx +139 -0
- package/src/components/ui/avatar.tsx +48 -0
- package/src/components/ui/button.tsx +56 -0
- package/src/components/ui/calendar.tsx +62 -0
- package/src/components/ui/card.tsx +86 -0
- package/src/components/ui/checkbox.tsx +28 -0
- package/src/components/ui/command.tsx +153 -0
- package/src/components/ui/dialog.tsx +120 -0
- package/src/components/ui/dropdown-menu.tsx +198 -0
- package/src/components/ui/form.tsx +177 -0
- package/src/components/ui/input.tsx +24 -0
- package/src/components/ui/label.tsx +24 -0
- package/src/components/ui/popover.tsx +29 -0
- package/src/components/ui/progress.tsx +26 -0
- package/src/components/ui/radio-group.tsx +42 -0
- package/src/components/ui/scroll-area.tsx +51 -0
- package/src/components/ui/select.tsx +119 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/toggle.tsx +43 -0
- package/src/components/ui/tooltip.tsx +28 -0
- package/src/components/usePatch.ts +86 -0
- package/src/components/useTheme.ts +45 -0
- package/src/exports.ts +2 -1
- package/src/index.css +96 -60
- package/src/lib/IValStore.ts +6 -0
- package/src/lib/utils.ts +6 -0
- package/src/main.jsx +10 -0
- package/src/richtext/conversion/lexicalToRichTextSource.ts +0 -1
- package/src/richtext/shadowRootPolyFill.js +115 -0
- package/src/server.ts +39 -2
- package/src/utils/resolvePath.ts +0 -1
- package/src/vite-server.ts +20 -3
- package/tailwind.config.js +63 -51
- package/tsconfig.json +2 -1
- package/vite.config.ts +10 -0
- package/src/components/dashboard/ValDashboard.tsx +0 -150
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// We use this to inject the contents of main.jsx into the server
|
|
2
|
+
// We want to use Vite / rollup to do this, but ran out of time and patience to do it
|
|
3
|
+
|
|
4
|
+
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const path = require("path");
|
|
7
|
+
|
|
8
|
+
const serverFiles = [
|
|
9
|
+
"server/dist/valbuild-ui-server.esm.js",
|
|
10
|
+
"server/dist/valbuild-ui-server.cjs.js",
|
|
11
|
+
];
|
|
12
|
+
const inputFile = "server/.tmp/index.js";
|
|
13
|
+
|
|
14
|
+
for (const serverFile of serverFiles) {
|
|
15
|
+
const filePath = path.join(__dirname, serverFile);
|
|
16
|
+
const replaceString = "/**REPLACE:SCRIPT*/";
|
|
17
|
+
const fileToEncodePath = path.join(__dirname, inputFile);
|
|
18
|
+
|
|
19
|
+
// Read the contents of the file to be encoded
|
|
20
|
+
const fileToEncodeContent = fs.readFileSync(fileToEncodePath, "utf-8");
|
|
21
|
+
|
|
22
|
+
// Encode the file contents to base64
|
|
23
|
+
const encodedContent = Buffer.from(fileToEncodeContent).toString("base64");
|
|
24
|
+
|
|
25
|
+
// Read the main file and replace the placeholder string
|
|
26
|
+
fs.readFile(filePath, "utf-8", (err, data) => {
|
|
27
|
+
if (err) {
|
|
28
|
+
console.error("Error reading file:", err);
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const result = data.replace(replaceString, encodedContent);
|
|
33
|
+
|
|
34
|
+
// Write the modified content back to the file
|
|
35
|
+
fs.writeFile(filePath, result, "utf-8", (err) => {
|
|
36
|
+
if (err) {
|
|
37
|
+
console.error("Error writing file:", err);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
console.log(
|
|
41
|
+
`Replaced script in ${serverFile} with contents of ${inputFile}!`
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
}
|
package/index.html
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
|
|
6
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
|
+
<title>Vite + React</title>
|
|
8
|
+
</head>
|
|
9
|
+
<body>
|
|
10
|
+
<div id="root"></div>
|
|
11
|
+
<script type="module" src="/src/main.jsx"></script>
|
|
12
|
+
</body>
|
|
13
|
+
</html>
|
package/package.json
CHANGED
|
@@ -1,36 +1,71 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valbuild/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"scripts": {
|
|
6
6
|
"typecheck": "tsc --noEmit",
|
|
7
|
-
"build": "vite build && vite --config server.vite.config.ts build && rollup --config rollup.config.js",
|
|
7
|
+
"build": "vite build && vite --config server.vite.config.ts build && rollup --config rollup.config.js && vite --config fullscreen.vite.config.ts build && node fix-server-hack.js",
|
|
8
8
|
"storybook": "storybook dev -p 6006",
|
|
9
9
|
"build-storybook": "storybook build"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"@
|
|
13
|
-
"@lexical/
|
|
14
|
-
"@lexical/
|
|
15
|
-
"@lexical/
|
|
16
|
-
"@lexical/
|
|
17
|
-
"@lexical/
|
|
12
|
+
"@hookform/resolvers": "^3.3.2",
|
|
13
|
+
"@lexical/link": "^0.12.2",
|
|
14
|
+
"@lexical/list": "^0.12.2",
|
|
15
|
+
"@lexical/react": "^0.12.2",
|
|
16
|
+
"@lexical/rich-text": "^0.12.2",
|
|
17
|
+
"@lexical/selection": "^0.12.2",
|
|
18
|
+
"@lexical/utils": "^0.12.2",
|
|
19
|
+
"@radix-ui/react-accordion": "^1.1.2",
|
|
20
|
+
"@radix-ui/react-alert-dialog": "^1.0.5",
|
|
21
|
+
"@radix-ui/react-avatar": "^1.0.4",
|
|
22
|
+
"@radix-ui/react-checkbox": "^1.0.4",
|
|
23
|
+
"@radix-ui/react-dialog": "^1.0.5",
|
|
24
|
+
"@radix-ui/react-dropdown-menu": "^2.0.6",
|
|
25
|
+
"@radix-ui/react-label": "^2.0.2",
|
|
26
|
+
"@radix-ui/react-popover": "^1.0.7",
|
|
27
|
+
"@radix-ui/react-progress": "^1.0.3",
|
|
28
|
+
"@radix-ui/react-radio-group": "^1.1.3",
|
|
29
|
+
"@radix-ui/react-scroll-area": "^1.0.5",
|
|
30
|
+
"@radix-ui/react-select": "^2.0.0",
|
|
31
|
+
"@radix-ui/react-slot": "^1.0.2",
|
|
32
|
+
"@radix-ui/react-switch": "^1.0.3",
|
|
33
|
+
"@radix-ui/react-tabs": "^1.0.4",
|
|
34
|
+
"@radix-ui/react-toggle": "^1.0.3",
|
|
35
|
+
"@radix-ui/react-tooltip": "^1.0.7",
|
|
18
36
|
"@types/express": "^4.17.17",
|
|
19
37
|
"@types/react": "^18.0.26",
|
|
20
|
-
"@valbuild/core": "~0.
|
|
38
|
+
"@valbuild/core": "~0.22.0",
|
|
39
|
+
"class-variance-authority": "^0.7.0",
|
|
21
40
|
"classnames": "^2.3.2",
|
|
41
|
+
"clsx": "^2.0.0",
|
|
42
|
+
"cmdk": "^0.2.0",
|
|
43
|
+
"date-fns": "^2.30.0",
|
|
22
44
|
"esbuild": "^0.17.19",
|
|
23
|
-
"lexical": "^0.
|
|
45
|
+
"lexical": "^0.12.2",
|
|
46
|
+
"lucide-react": "^0.290.0",
|
|
24
47
|
"marked": "^9.0.3",
|
|
48
|
+
"react-day-picker": "^8.9.1",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
50
|
+
"react-error-boundary": "^4.0.11",
|
|
25
51
|
"react-feather": "^2.0.10",
|
|
52
|
+
"react-hook-form": "^7.47.0",
|
|
26
53
|
"react-resizable": "^3.0.5",
|
|
54
|
+
"react-router": "^6.18.0",
|
|
55
|
+
"react-router-dom": "^6.18.0",
|
|
27
56
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
28
57
|
"rollup-plugin-postcss": "^4.0.2",
|
|
29
58
|
"rollup-plugin-typescript2": "^0.34.1",
|
|
30
|
-
"
|
|
59
|
+
"tailwind-merge": "^2.0.0",
|
|
60
|
+
"tailwindcss-animate": "^1.0.7",
|
|
61
|
+
"zod": "^3.22.4"
|
|
31
62
|
},
|
|
32
63
|
"devDependencies": {
|
|
33
64
|
"@lexical/headless": "^0.10.0",
|
|
65
|
+
"@rollup/plugin-babel": "^6.0.4",
|
|
66
|
+
"@rollup/plugin-commonjs": "^25.0.7",
|
|
67
|
+
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
68
|
+
"@rollup/plugin-typescript": "^11.1.5",
|
|
34
69
|
"@storybook/addon-essentials": "^7.0.12",
|
|
35
70
|
"@storybook/addon-interactions": "^7.0.12",
|
|
36
71
|
"@storybook/addon-links": "^7.0.12",
|
|
@@ -41,17 +76,21 @@
|
|
|
41
76
|
"@storybook/react-vite": "^7.0.12",
|
|
42
77
|
"@storybook/testing-library": "^0.0.14-next.2",
|
|
43
78
|
"@types/react-resizable": "^3.0.5",
|
|
79
|
+
"@vitejs/plugin-react": "^4.0.3",
|
|
44
80
|
"autoprefixer": "^10.4.13",
|
|
81
|
+
"eslint": "^8.45.0",
|
|
82
|
+
"eslint-plugin-react": "^7.32.2",
|
|
83
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
84
|
+
"eslint-plugin-react-refresh": "^0.4.3",
|
|
45
85
|
"postcss": "^8.4.21",
|
|
46
86
|
"prop-types": "^15.8.1",
|
|
47
87
|
"react": "^18.2.0",
|
|
48
|
-
"react-dom": "^18.2.0",
|
|
49
88
|
"react-test-renderer": "^18.2.0",
|
|
50
89
|
"rollup": "^3.17.3",
|
|
51
90
|
"rollup-plugin-dts": "^5.3.0",
|
|
52
91
|
"storybook": "^7.0.12",
|
|
53
92
|
"tailwindcss": "^3.2.7",
|
|
54
|
-
"vite": "^4.
|
|
93
|
+
"vite": "^4.4.5"
|
|
55
94
|
},
|
|
56
95
|
"peerDependencies": {
|
|
57
96
|
"react": ">=16.8.0"
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"src/main.jsx": {
|
|
3
|
+
"file": "valbuild-ui-main.esm.js",
|
|
4
|
+
"isEntry": true,
|
|
5
|
+
"src": "src/main.jsx"
|
|
6
|
+
},
|
|
7
|
+
"src/vite-server.ts": {
|
|
8
|
+
"file": "valbuild-ui-server.esm.js",
|
|
9
|
+
"isEntry": true,
|
|
10
|
+
"src": "src/vite-server.ts"
|
|
11
|
+
},
|
|
12
|
+
"style.css": {
|
|
13
|
+
"file": "style.css",
|
|
14
|
+
"src": "style.css"
|
|
15
|
+
}
|
|
16
|
+
}
|