@valbuild/ui 0.26.0 → 0.28.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/dist/valbuild-ui.cjs.js +41 -15
- package/dist/valbuild-ui.esm.js +41 -15
- package/package.json +7 -3
- package/server/.tmp/assets/index-18cfa26c.css +1 -0
- package/server/.tmp/assets/index-513f7a9c.js +197 -0
- package/{index.html → server/.tmp/index.html} +3 -1
- package/server/dist/style.css +0 -3
- package/server/dist/valbuild-ui-main.cjs.js +60 -34
- package/server/dist/valbuild-ui-main.esm.js +60 -34
- package/server/dist/valbuild-ui-server.cjs.js +1 -1
- package/server/dist/valbuild-ui-server.esm.js +1 -1
- package/.babelrc.json +0 -10
- package/.storybook/main.js +0 -25
- package/.storybook/preview-head.html +0 -6
- package/.storybook/preview.js +0 -33
- package/.storybook/theme.css +0 -34
- package/CHANGELOG.md +0 -0
- package/components.json +0 -16
- package/fix-server-hack.js +0 -54
- package/fullscreen.vite.config.ts +0 -9
- package/jest.config.js +0 -4
- package/postcss.config.js +0 -6
- package/rollup.config.js +0 -23
- package/server.vite.config.ts +0 -31
- package/src/App.tsx +0 -73
- package/src/assets/icons/Bold.tsx +0 -23
- package/src/assets/icons/Chevron.tsx +0 -28
- package/src/assets/icons/FontColor.tsx +0 -30
- package/src/assets/icons/ImageIcon.tsx +0 -29
- package/src/assets/icons/Italic.tsx +0 -24
- package/src/assets/icons/Logo.tsx +0 -103
- package/src/assets/icons/Section.tsx +0 -41
- package/src/assets/icons/Strikethrough.tsx +0 -22
- package/src/assets/icons/TextIcon.tsx +0 -20
- package/src/assets/icons/Underline.tsx +0 -22
- package/src/assets/icons/Undo.tsx +0 -20
- package/src/components/Button.tsx +0 -68
- package/src/components/Checkbox.tsx +0 -51
- package/src/components/DraggableList.stories.tsx +0 -20
- package/src/components/DraggableList.tsx +0 -95
- package/src/components/Dropdown.tsx +0 -101
- package/src/components/EditButton.tsx +0 -10
- package/src/components/ErrorText.tsx +0 -3
- package/src/components/ExpandLogo.tsx +0 -72
- package/src/components/Grid.stories.tsx +0 -43
- package/src/components/Grid.tsx +0 -139
- package/src/components/RichTextEditor/ContentEditable.tsx +0 -117
- package/src/components/RichTextEditor/Nodes/ImageNode.tsx +0 -100
- package/src/components/RichTextEditor/Plugins/AutoFocus.tsx +0 -12
- package/src/components/RichTextEditor/Plugins/ImagePlugin.tsx +0 -45
- package/src/components/RichTextEditor/Plugins/LinkEditorPlugin.tsx +0 -58
- package/src/components/RichTextEditor/Plugins/Toolbar.tsx +0 -412
- package/src/components/RichTextEditor/RichTextEditor.tsx +0 -105
- package/src/components/UploadModal.tsx +0 -109
- package/src/components/User.tsx +0 -17
- package/src/components/ValFormField.tsx +0 -574
- package/src/components/ValFullscreen.tsx +0 -1278
- package/src/components/ValMenu.tsx +0 -92
- package/src/components/ValOverlay.tsx +0 -488
- package/src/components/ValOverlayContext.tsx +0 -80
- package/src/components/ValWindow.stories.tsx +0 -146
- package/src/components/ValWindow.tsx +0 -220
- package/src/components/dashboard/DashboardButton.tsx +0 -25
- package/src/components/dashboard/DashboardDropdown.tsx +0 -59
- package/src/components/dashboard/Dropdown.stories.tsx +0 -11
- package/src/components/dashboard/Dropdown.tsx +0 -70
- package/src/components/dashboard/FormGroup.stories.tsx +0 -37
- package/src/components/dashboard/FormGroup.tsx +0 -42
- package/src/components/dashboard/Grid2.stories.tsx +0 -56
- package/src/components/dashboard/Grid2.tsx +0 -72
- package/src/components/dashboard/Tree.stories.tsx +0 -91
- package/src/components/dashboard/Tree.tsx +0 -72
- package/src/components/dashboard/ValDashboardEditor.tsx +0 -269
- package/src/components/dashboard/ValDashboardGrid.tsx +0 -142
- package/src/components/dashboard/ValTreeNavigator.tsx +0 -253
- package/src/components/forms/Form.tsx +0 -126
- package/src/components/forms/FormContainer.tsx +0 -24
- package/src/components/forms/ImageForm.tsx +0 -195
- package/src/components/forms/TextArea.tsx +0 -24
- package/src/components/ui/accordion.tsx +0 -58
- package/src/components/ui/alert-dialog.tsx +0 -139
- package/src/components/ui/avatar.tsx +0 -48
- package/src/components/ui/button.tsx +0 -56
- package/src/components/ui/calendar.tsx +0 -62
- package/src/components/ui/card.tsx +0 -86
- package/src/components/ui/checkbox.tsx +0 -28
- package/src/components/ui/command.tsx +0 -153
- package/src/components/ui/dialog.tsx +0 -120
- package/src/components/ui/dropdown-menu.tsx +0 -198
- package/src/components/ui/form.tsx +0 -177
- package/src/components/ui/input.tsx +0 -24
- package/src/components/ui/label.tsx +0 -24
- package/src/components/ui/popover.tsx +0 -29
- package/src/components/ui/progress.tsx +0 -26
- package/src/components/ui/radio-group.tsx +0 -42
- package/src/components/ui/scroll-area.tsx +0 -51
- package/src/components/ui/select.tsx +0 -119
- package/src/components/ui/switch.tsx +0 -27
- package/src/components/ui/tabs.tsx +0 -53
- package/src/components/ui/toggle.tsx +0 -43
- package/src/components/ui/tooltip.tsx +0 -28
- package/src/components/usePatch.ts +0 -86
- package/src/components/useTheme.ts +0 -45
- package/src/dto/SerializedSchema.ts +0 -69
- package/src/dto/Session.ts +0 -12
- package/src/dto/SessionMode.ts +0 -5
- package/src/dto/Tree.ts +0 -18
- package/src/exports.ts +0 -6
- package/src/index.css +0 -115
- package/src/index.tsx +0 -14
- package/src/lib/IValStore.ts +0 -6
- package/src/lib/utils.ts +0 -6
- package/src/main.jsx +0 -10
- package/src/richtext/conversion/conversion.test.ts +0 -146
- package/src/richtext/conversion/lexicalToRichTextSource.test.ts +0 -89
- package/src/richtext/conversion/lexicalToRichTextSource.ts +0 -285
- package/src/richtext/conversion/parseRichTextSource.test.ts +0 -469
- package/src/richtext/conversion/parseRichTextSource.ts +0 -233
- package/src/richtext/conversion/richTextSourceToLexical.test.ts +0 -381
- package/src/richtext/conversion/richTextSourceToLexical.ts +0 -293
- package/src/richtext/shadowRootPolyFill.js +0 -115
- package/src/server.ts +0 -70
- package/src/stories/Button.stories.tsx +0 -20
- package/src/stories/Checkbox.stories.tsx +0 -14
- package/src/stories/Dropdown.stories.tsx +0 -23
- package/src/stories/Introduction.mdx +0 -221
- package/src/stories/RichTextEditor.stories.tsx +0 -24
- package/src/stories/assets/code-brackets.svg +0 -1
- package/src/stories/assets/colors.svg +0 -1
- package/src/stories/assets/comments.svg +0 -1
- package/src/stories/assets/direction.svg +0 -1
- package/src/stories/assets/flow.svg +0 -1
- package/src/stories/assets/plugin.svg +0 -1
- package/src/stories/assets/repo.svg +0 -1
- package/src/stories/assets/stackalt.svg +0 -1
- package/src/utils/Remote.ts +0 -15
- package/src/utils/imageMimeType.ts +0 -23
- package/src/utils/readImage.ts +0 -54
- package/src/utils/resolvePath.ts +0 -32
- package/src/vite-env.d.ts +0 -1
- package/src/vite-index.tsx +0 -7
- package/src/vite-server.ts +0 -42
- package/tailwind.config.js +0 -83
- package/tsconfig.json +0 -19
- package/vite.config.ts +0 -43
package/src/utils/resolvePath.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ApiTreeResponse,
|
|
3
|
-
Internal,
|
|
4
|
-
Json,
|
|
5
|
-
SerializedSchema,
|
|
6
|
-
SourcePath,
|
|
7
|
-
} from "@valbuild/core";
|
|
8
|
-
import { result } from "@valbuild/core/fp";
|
|
9
|
-
|
|
10
|
-
export type Modules = ApiTreeResponse["modules"];
|
|
11
|
-
|
|
12
|
-
export function resolvePath(sourcePath: SourcePath, modules: Modules) {
|
|
13
|
-
const [moduleId, modulePath] =
|
|
14
|
-
Internal.splitModuleIdAndModulePath(sourcePath);
|
|
15
|
-
const valModule = modules[moduleId];
|
|
16
|
-
if (!valModule?.source) {
|
|
17
|
-
return result.err({
|
|
18
|
-
message: `Module "${moduleId}" has no source`,
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
if (!valModule?.schema) {
|
|
22
|
-
return result.err({
|
|
23
|
-
message: `Module "${moduleId}" has no schema`,
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
return result.ok(
|
|
27
|
-
Internal.resolvePath(modulePath, valModule.source, valModule.schema) as {
|
|
28
|
-
source: Json;
|
|
29
|
-
schema: SerializedSchema;
|
|
30
|
-
}
|
|
31
|
-
);
|
|
32
|
-
}
|
package/src/vite-env.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
/// <reference types="vite/client" />
|
package/src/vite-index.tsx
DELETED
package/src/vite-server.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import type { RequestHandler } from "express";
|
|
2
|
-
|
|
3
|
-
const files: Record<string, string> = JSON.parse(
|
|
4
|
-
`BUILD_REPLACE_THIS_WITH_RECORD`
|
|
5
|
-
) as unknown as Record<string, string>;
|
|
6
|
-
|
|
7
|
-
export function createRequestHandler(): RequestHandler {
|
|
8
|
-
if (typeof files !== "object") {
|
|
9
|
-
throw new Error("Files is not an object! Your Val build is corrupted!");
|
|
10
|
-
}
|
|
11
|
-
return (req, res, next) => {
|
|
12
|
-
if (!files["/index.html"]) {
|
|
13
|
-
console.error(
|
|
14
|
-
"No index.html found! Your Val build is corrupted!",
|
|
15
|
-
Object.keys(files)
|
|
16
|
-
);
|
|
17
|
-
next();
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
if (req.url.startsWith("/edit")) {
|
|
21
|
-
res
|
|
22
|
-
.header({ "Content-Type": "text/html" })
|
|
23
|
-
.end(Buffer.from(files["/index.html"], "base64").toString("utf-8"));
|
|
24
|
-
} else {
|
|
25
|
-
if (Object.keys(files).includes(req.url)) {
|
|
26
|
-
if (req.url.endsWith(".js")) {
|
|
27
|
-
res
|
|
28
|
-
.header({ "Content-Type": "application/javascript" })
|
|
29
|
-
.end(Buffer.from(files[req.url], "base64").toString("utf-8"));
|
|
30
|
-
} else if (req.url.endsWith(".css")) {
|
|
31
|
-
res
|
|
32
|
-
.header({ "Content-Type": "text/css" })
|
|
33
|
-
.end(Buffer.from(files[req.url], "base64").toString("utf-8"));
|
|
34
|
-
} else {
|
|
35
|
-
res.end(Buffer.from(files[req.url], "base64").toString("utf-8"));
|
|
36
|
-
}
|
|
37
|
-
} else {
|
|
38
|
-
next();
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
}
|
package/tailwind.config.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
module.exports = {
|
|
3
|
-
content: [__dirname + "/src/**/*.{js,ts,jsx,tsx}"],
|
|
4
|
-
darkMode: ["class", '[data-mode="dark"]'],
|
|
5
|
-
theme: {
|
|
6
|
-
container: {
|
|
7
|
-
center: true,
|
|
8
|
-
padding: "2rem",
|
|
9
|
-
screens: {
|
|
10
|
-
"2xl": "1400px",
|
|
11
|
-
},
|
|
12
|
-
},
|
|
13
|
-
zIndex: {
|
|
14
|
-
hover: 1,
|
|
15
|
-
window: 2,
|
|
16
|
-
full: 3,
|
|
17
|
-
overlay: 4,
|
|
18
|
-
50: 50,
|
|
19
|
-
},
|
|
20
|
-
|
|
21
|
-
fontFamily: {
|
|
22
|
-
sans: "'Roboto', sans-serif",
|
|
23
|
-
serif: "'Space Mono', monospace",
|
|
24
|
-
},
|
|
25
|
-
extend: {
|
|
26
|
-
colors: {
|
|
27
|
-
border: "hsl(var(--border))",
|
|
28
|
-
input: "hsl(var(--input))",
|
|
29
|
-
ring: "hsl(var(--ring))",
|
|
30
|
-
background: "hsl(var(--background))",
|
|
31
|
-
foreground: "hsl(var(--foreground))",
|
|
32
|
-
primary: {
|
|
33
|
-
DEFAULT: "hsl(var(--primary))",
|
|
34
|
-
foreground: "hsl(var(--primary-foreground))",
|
|
35
|
-
},
|
|
36
|
-
secondary: {
|
|
37
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
38
|
-
foreground: "hsl(var(--secondary-foreground))",
|
|
39
|
-
},
|
|
40
|
-
destructive: {
|
|
41
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
42
|
-
foreground: "hsl(var(--destructive-foreground))",
|
|
43
|
-
},
|
|
44
|
-
muted: {
|
|
45
|
-
DEFAULT: "hsl(var(--muted))",
|
|
46
|
-
foreground: "hsl(var(--muted-foreground))",
|
|
47
|
-
},
|
|
48
|
-
accent: {
|
|
49
|
-
DEFAULT: "hsl(var(--accent))",
|
|
50
|
-
foreground: "hsl(var(--accent-foreground))",
|
|
51
|
-
},
|
|
52
|
-
popover: {
|
|
53
|
-
DEFAULT: "hsl(var(--popover))",
|
|
54
|
-
foreground: "hsl(var(--popover-foreground))",
|
|
55
|
-
},
|
|
56
|
-
card: {
|
|
57
|
-
DEFAULT: "hsl(var(--card))",
|
|
58
|
-
foreground: "hsl(var(--card-foreground))",
|
|
59
|
-
},
|
|
60
|
-
},
|
|
61
|
-
borderRadius: {
|
|
62
|
-
lg: "var(--radius)",
|
|
63
|
-
md: "calc(var(--radius) - 2px)",
|
|
64
|
-
sm: "calc(var(--radius) - 4px)",
|
|
65
|
-
},
|
|
66
|
-
keyframes: {
|
|
67
|
-
"accordion-down": {
|
|
68
|
-
from: { height: 0 },
|
|
69
|
-
to: { height: "var(--radix-accordion-content-height)" },
|
|
70
|
-
},
|
|
71
|
-
"accordion-up": {
|
|
72
|
-
from: { height: "var(--radix-accordion-content-height)" },
|
|
73
|
-
to: { height: 0 },
|
|
74
|
-
},
|
|
75
|
-
},
|
|
76
|
-
animation: {
|
|
77
|
-
"accordion-down": "accordion-down 0.2s ease-out",
|
|
78
|
-
"accordion-up": "accordion-up 0.2s ease-out",
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
plugins: [require("tailwindcss-animate")],
|
|
83
|
-
};
|
package/tsconfig.json
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"esModuleInterop": true,
|
|
4
|
-
"strict": true,
|
|
5
|
-
"allowJs": true,
|
|
6
|
-
"isolatedModules": true,
|
|
7
|
-
"jsx": "react-jsx",
|
|
8
|
-
"lib": ["es6", "dom"],
|
|
9
|
-
"module": "esnext",
|
|
10
|
-
"moduleResolution": "node",
|
|
11
|
-
"noEmit": true,
|
|
12
|
-
"target": "ES5",
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"rootDir": "src",
|
|
15
|
-
"skipLibCheck": true,
|
|
16
|
-
"baseUrl": "."
|
|
17
|
-
},
|
|
18
|
-
"include": ["src/**/*"]
|
|
19
|
-
}
|
package/vite.config.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import path from "path";
|
|
2
|
-
import { defineConfig } from "vite";
|
|
3
|
-
import react from "@vitejs/plugin-react";
|
|
4
|
-
|
|
5
|
-
// https://vitejs.dev/config/
|
|
6
|
-
export default defineConfig({
|
|
7
|
-
base: "/api/val/static",
|
|
8
|
-
plugins: [react()],
|
|
9
|
-
resolve: {
|
|
10
|
-
alias: {
|
|
11
|
-
"@": path.resolve(__dirname, "./src"),
|
|
12
|
-
},
|
|
13
|
-
},
|
|
14
|
-
build: {
|
|
15
|
-
lib: {
|
|
16
|
-
entry: {
|
|
17
|
-
"valbuild-ui": "./src/vite-index.tsx",
|
|
18
|
-
},
|
|
19
|
-
formats: ["cjs", "es"],
|
|
20
|
-
/**
|
|
21
|
-
* Sets file names to match the output from Preconstruct
|
|
22
|
-
*/
|
|
23
|
-
fileName(format, entryName) {
|
|
24
|
-
switch (format) {
|
|
25
|
-
case "es":
|
|
26
|
-
return `${entryName}.esm.js`;
|
|
27
|
-
case "cjs":
|
|
28
|
-
return `${entryName}.cjs.js`;
|
|
29
|
-
default:
|
|
30
|
-
throw Error(`Unexpected format: ${format}`);
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
// Output semi-readable code and let consumers handle minification
|
|
35
|
-
minify: false,
|
|
36
|
-
rollupOptions: {
|
|
37
|
-
external: ["react", "react/jsx-runtime", "react/jsx-dev-runtime"],
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
optimizeDeps: {
|
|
41
|
-
include: ["react/jsx-runtime", "react/jsx-dev-runtime"],
|
|
42
|
-
},
|
|
43
|
-
});
|