@valbuild/ui 0.26.0 → 0.27.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 (138) hide show
  1. package/package.json +7 -3
  2. package/server/.tmp/assets/index-082e6676.css +1 -0
  3. package/server/.tmp/assets/index-3108ab2a.js +197 -0
  4. package/{index.html → server/.tmp/index.html} +3 -1
  5. package/.babelrc.json +0 -10
  6. package/.storybook/main.js +0 -25
  7. package/.storybook/preview-head.html +0 -6
  8. package/.storybook/preview.js +0 -33
  9. package/.storybook/theme.css +0 -34
  10. package/CHANGELOG.md +0 -0
  11. package/components.json +0 -16
  12. package/fix-server-hack.js +0 -54
  13. package/fullscreen.vite.config.ts +0 -9
  14. package/jest.config.js +0 -4
  15. package/postcss.config.js +0 -6
  16. package/rollup.config.js +0 -23
  17. package/server.vite.config.ts +0 -31
  18. package/src/App.tsx +0 -73
  19. package/src/assets/icons/Bold.tsx +0 -23
  20. package/src/assets/icons/Chevron.tsx +0 -28
  21. package/src/assets/icons/FontColor.tsx +0 -30
  22. package/src/assets/icons/ImageIcon.tsx +0 -29
  23. package/src/assets/icons/Italic.tsx +0 -24
  24. package/src/assets/icons/Logo.tsx +0 -103
  25. package/src/assets/icons/Section.tsx +0 -41
  26. package/src/assets/icons/Strikethrough.tsx +0 -22
  27. package/src/assets/icons/TextIcon.tsx +0 -20
  28. package/src/assets/icons/Underline.tsx +0 -22
  29. package/src/assets/icons/Undo.tsx +0 -20
  30. package/src/components/Button.tsx +0 -68
  31. package/src/components/Checkbox.tsx +0 -51
  32. package/src/components/DraggableList.stories.tsx +0 -20
  33. package/src/components/DraggableList.tsx +0 -95
  34. package/src/components/Dropdown.tsx +0 -101
  35. package/src/components/EditButton.tsx +0 -10
  36. package/src/components/ErrorText.tsx +0 -3
  37. package/src/components/ExpandLogo.tsx +0 -72
  38. package/src/components/Grid.stories.tsx +0 -43
  39. package/src/components/Grid.tsx +0 -139
  40. package/src/components/RichTextEditor/ContentEditable.tsx +0 -117
  41. package/src/components/RichTextEditor/Nodes/ImageNode.tsx +0 -100
  42. package/src/components/RichTextEditor/Plugins/AutoFocus.tsx +0 -12
  43. package/src/components/RichTextEditor/Plugins/ImagePlugin.tsx +0 -45
  44. package/src/components/RichTextEditor/Plugins/LinkEditorPlugin.tsx +0 -58
  45. package/src/components/RichTextEditor/Plugins/Toolbar.tsx +0 -412
  46. package/src/components/RichTextEditor/RichTextEditor.tsx +0 -105
  47. package/src/components/UploadModal.tsx +0 -109
  48. package/src/components/User.tsx +0 -17
  49. package/src/components/ValFormField.tsx +0 -574
  50. package/src/components/ValFullscreen.tsx +0 -1278
  51. package/src/components/ValMenu.tsx +0 -92
  52. package/src/components/ValOverlay.tsx +0 -488
  53. package/src/components/ValOverlayContext.tsx +0 -80
  54. package/src/components/ValWindow.stories.tsx +0 -146
  55. package/src/components/ValWindow.tsx +0 -220
  56. package/src/components/dashboard/DashboardButton.tsx +0 -25
  57. package/src/components/dashboard/DashboardDropdown.tsx +0 -59
  58. package/src/components/dashboard/Dropdown.stories.tsx +0 -11
  59. package/src/components/dashboard/Dropdown.tsx +0 -70
  60. package/src/components/dashboard/FormGroup.stories.tsx +0 -37
  61. package/src/components/dashboard/FormGroup.tsx +0 -42
  62. package/src/components/dashboard/Grid2.stories.tsx +0 -56
  63. package/src/components/dashboard/Grid2.tsx +0 -72
  64. package/src/components/dashboard/Tree.stories.tsx +0 -91
  65. package/src/components/dashboard/Tree.tsx +0 -72
  66. package/src/components/dashboard/ValDashboardEditor.tsx +0 -269
  67. package/src/components/dashboard/ValDashboardGrid.tsx +0 -142
  68. package/src/components/dashboard/ValTreeNavigator.tsx +0 -253
  69. package/src/components/forms/Form.tsx +0 -126
  70. package/src/components/forms/FormContainer.tsx +0 -24
  71. package/src/components/forms/ImageForm.tsx +0 -195
  72. package/src/components/forms/TextArea.tsx +0 -24
  73. package/src/components/ui/accordion.tsx +0 -58
  74. package/src/components/ui/alert-dialog.tsx +0 -139
  75. package/src/components/ui/avatar.tsx +0 -48
  76. package/src/components/ui/button.tsx +0 -56
  77. package/src/components/ui/calendar.tsx +0 -62
  78. package/src/components/ui/card.tsx +0 -86
  79. package/src/components/ui/checkbox.tsx +0 -28
  80. package/src/components/ui/command.tsx +0 -153
  81. package/src/components/ui/dialog.tsx +0 -120
  82. package/src/components/ui/dropdown-menu.tsx +0 -198
  83. package/src/components/ui/form.tsx +0 -177
  84. package/src/components/ui/input.tsx +0 -24
  85. package/src/components/ui/label.tsx +0 -24
  86. package/src/components/ui/popover.tsx +0 -29
  87. package/src/components/ui/progress.tsx +0 -26
  88. package/src/components/ui/radio-group.tsx +0 -42
  89. package/src/components/ui/scroll-area.tsx +0 -51
  90. package/src/components/ui/select.tsx +0 -119
  91. package/src/components/ui/switch.tsx +0 -27
  92. package/src/components/ui/tabs.tsx +0 -53
  93. package/src/components/ui/toggle.tsx +0 -43
  94. package/src/components/ui/tooltip.tsx +0 -28
  95. package/src/components/usePatch.ts +0 -86
  96. package/src/components/useTheme.ts +0 -45
  97. package/src/dto/SerializedSchema.ts +0 -69
  98. package/src/dto/Session.ts +0 -12
  99. package/src/dto/SessionMode.ts +0 -5
  100. package/src/dto/Tree.ts +0 -18
  101. package/src/exports.ts +0 -6
  102. package/src/index.css +0 -115
  103. package/src/index.tsx +0 -14
  104. package/src/lib/IValStore.ts +0 -6
  105. package/src/lib/utils.ts +0 -6
  106. package/src/main.jsx +0 -10
  107. package/src/richtext/conversion/conversion.test.ts +0 -146
  108. package/src/richtext/conversion/lexicalToRichTextSource.test.ts +0 -89
  109. package/src/richtext/conversion/lexicalToRichTextSource.ts +0 -285
  110. package/src/richtext/conversion/parseRichTextSource.test.ts +0 -469
  111. package/src/richtext/conversion/parseRichTextSource.ts +0 -233
  112. package/src/richtext/conversion/richTextSourceToLexical.test.ts +0 -381
  113. package/src/richtext/conversion/richTextSourceToLexical.ts +0 -293
  114. package/src/richtext/shadowRootPolyFill.js +0 -115
  115. package/src/server.ts +0 -70
  116. package/src/stories/Button.stories.tsx +0 -20
  117. package/src/stories/Checkbox.stories.tsx +0 -14
  118. package/src/stories/Dropdown.stories.tsx +0 -23
  119. package/src/stories/Introduction.mdx +0 -221
  120. package/src/stories/RichTextEditor.stories.tsx +0 -24
  121. package/src/stories/assets/code-brackets.svg +0 -1
  122. package/src/stories/assets/colors.svg +0 -1
  123. package/src/stories/assets/comments.svg +0 -1
  124. package/src/stories/assets/direction.svg +0 -1
  125. package/src/stories/assets/flow.svg +0 -1
  126. package/src/stories/assets/plugin.svg +0 -1
  127. package/src/stories/assets/repo.svg +0 -1
  128. package/src/stories/assets/stackalt.svg +0 -1
  129. package/src/utils/Remote.ts +0 -15
  130. package/src/utils/imageMimeType.ts +0 -23
  131. package/src/utils/readImage.ts +0 -54
  132. package/src/utils/resolvePath.ts +0 -32
  133. package/src/vite-env.d.ts +0 -1
  134. package/src/vite-index.tsx +0 -7
  135. package/src/vite-server.ts +0 -42
  136. package/tailwind.config.js +0 -83
  137. package/tsconfig.json +0 -19
  138. package/vite.config.ts +0 -43
@@ -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" />
@@ -1,7 +0,0 @@
1
- export * from "./exports";
2
-
3
- import styleCss from "./index.css?inline";
4
-
5
- export function Style(): JSX.Element {
6
- return <style>{styleCss}</style>;
7
- }
@@ -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
- }
@@ -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
- });