@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
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as SwitchPrimitives from "@radix-ui/react-switch";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const Switch = React.forwardRef<
|
|
7
|
-
React.ElementRef<typeof SwitchPrimitives.Root>,
|
|
8
|
-
React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root>
|
|
9
|
-
>(({ className, ...props }, ref) => (
|
|
10
|
-
<SwitchPrimitives.Root
|
|
11
|
-
className={cn(
|
|
12
|
-
"peer inline-flex h-[22px] w-[44px] shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-accent data-[state=unchecked]:bg-primary",
|
|
13
|
-
className
|
|
14
|
-
)}
|
|
15
|
-
{...props}
|
|
16
|
-
ref={ref}
|
|
17
|
-
>
|
|
18
|
-
<SwitchPrimitives.Thumb
|
|
19
|
-
className={cn(
|
|
20
|
-
"pointer-events-none block h-[18px] w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
|
|
21
|
-
)}
|
|
22
|
-
/>
|
|
23
|
-
</SwitchPrimitives.Root>
|
|
24
|
-
));
|
|
25
|
-
Switch.displayName = SwitchPrimitives.Root.displayName;
|
|
26
|
-
|
|
27
|
-
export { Switch };
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const Tabs = TabsPrimitive.Root;
|
|
7
|
-
|
|
8
|
-
const TabsList = React.forwardRef<
|
|
9
|
-
React.ElementRef<typeof TabsPrimitive.List>,
|
|
10
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
11
|
-
>(({ className, ...props }, ref) => (
|
|
12
|
-
<TabsPrimitive.List
|
|
13
|
-
ref={ref}
|
|
14
|
-
className={cn(
|
|
15
|
-
"inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
|
|
16
|
-
className
|
|
17
|
-
)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
));
|
|
21
|
-
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
22
|
-
|
|
23
|
-
const TabsTrigger = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
26
|
-
>(({ className, ...props }, ref) => (
|
|
27
|
-
<TabsPrimitive.Trigger
|
|
28
|
-
ref={ref}
|
|
29
|
-
className={cn(
|
|
30
|
-
"inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
|
|
31
|
-
className
|
|
32
|
-
)}
|
|
33
|
-
{...props}
|
|
34
|
-
/>
|
|
35
|
-
));
|
|
36
|
-
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
37
|
-
|
|
38
|
-
const TabsContent = React.forwardRef<
|
|
39
|
-
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
40
|
-
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
41
|
-
>(({ className, ...props }, ref) => (
|
|
42
|
-
<TabsPrimitive.Content
|
|
43
|
-
ref={ref}
|
|
44
|
-
className={cn(
|
|
45
|
-
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
46
|
-
className
|
|
47
|
-
)}
|
|
48
|
-
{...props}
|
|
49
|
-
/>
|
|
50
|
-
));
|
|
51
|
-
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
52
|
-
|
|
53
|
-
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as TogglePrimitive from "@radix-ui/react-toggle";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
import { cn } from "../../lib/utils";
|
|
6
|
-
|
|
7
|
-
const toggleVariants = cva(
|
|
8
|
-
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "bg-transparent",
|
|
13
|
-
outline:
|
|
14
|
-
"border border-input bg-transparent hover:bg-accent hover:text-accent-foreground",
|
|
15
|
-
},
|
|
16
|
-
size: {
|
|
17
|
-
default: "h-10 px-3",
|
|
18
|
-
sm: "h-9 px-2.5",
|
|
19
|
-
lg: "h-11 px-5",
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
defaultVariants: {
|
|
23
|
-
variant: "default",
|
|
24
|
-
size: "default",
|
|
25
|
-
},
|
|
26
|
-
}
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
const Toggle = React.forwardRef<
|
|
30
|
-
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
31
|
-
React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root> &
|
|
32
|
-
VariantProps<typeof toggleVariants>
|
|
33
|
-
>(({ className, variant, size, ...props }, ref) => (
|
|
34
|
-
<TogglePrimitive.Root
|
|
35
|
-
ref={ref}
|
|
36
|
-
className={cn(toggleVariants({ variant, size, className }))}
|
|
37
|
-
{...props}
|
|
38
|
-
/>
|
|
39
|
-
));
|
|
40
|
-
|
|
41
|
-
Toggle.displayName = TogglePrimitive.Root.displayName;
|
|
42
|
-
|
|
43
|
-
export { Toggle, toggleVariants };
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
3
|
-
|
|
4
|
-
import { cn } from "../../lib/utils";
|
|
5
|
-
|
|
6
|
-
const TooltipProvider = TooltipPrimitive.Provider;
|
|
7
|
-
|
|
8
|
-
const Tooltip = TooltipPrimitive.Root;
|
|
9
|
-
|
|
10
|
-
const TooltipTrigger = TooltipPrimitive.Trigger;
|
|
11
|
-
|
|
12
|
-
const TooltipContent = React.forwardRef<
|
|
13
|
-
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
14
|
-
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>
|
|
15
|
-
>(({ className, sideOffset = 4, ...props }, ref) => (
|
|
16
|
-
<TooltipPrimitive.Content
|
|
17
|
-
ref={ref}
|
|
18
|
-
sideOffset={sideOffset}
|
|
19
|
-
className={cn(
|
|
20
|
-
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
21
|
-
className
|
|
22
|
-
)}
|
|
23
|
-
{...props}
|
|
24
|
-
/>
|
|
25
|
-
));
|
|
26
|
-
TooltipContent.displayName = TooltipPrimitive.Content.displayName;
|
|
27
|
-
|
|
28
|
-
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { SourcePath, Internal, ModuleId, ValApi } from "@valbuild/core";
|
|
2
|
-
import { result } from "@valbuild/core/fp";
|
|
3
|
-
import { PatchJSON } from "@valbuild/core/patch";
|
|
4
|
-
import { useCallback, useEffect, useState } from "react";
|
|
5
|
-
import { IValStore } from "../exports";
|
|
6
|
-
|
|
7
|
-
export type PatchCallback = (modulePath: string) => Promise<PatchJSON>;
|
|
8
|
-
|
|
9
|
-
export type InitPatchCallback = (
|
|
10
|
-
currentPath: SourcePath
|
|
11
|
-
) => (callback: PatchCallback) => void;
|
|
12
|
-
|
|
13
|
-
export type PatchCallbackState = {
|
|
14
|
-
[path: SourcePath]: () => Promise<PatchJSON>;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export function usePatch(
|
|
18
|
-
paths: SourcePath[],
|
|
19
|
-
api: ValApi,
|
|
20
|
-
valStore: IValStore
|
|
21
|
-
) {
|
|
22
|
-
const [state, setState] = useState<PatchCallbackState>({});
|
|
23
|
-
|
|
24
|
-
const initPatchCallback: InitPatchCallback = useCallback(
|
|
25
|
-
(currentPath: SourcePath) => {
|
|
26
|
-
return (callback: PatchCallback) => {
|
|
27
|
-
const patchPath = Internal.createPatchJSONPath(
|
|
28
|
-
Internal.splitModuleIdAndModulePath(currentPath)[1]
|
|
29
|
-
);
|
|
30
|
-
setState((prev) => {
|
|
31
|
-
return {
|
|
32
|
-
...prev,
|
|
33
|
-
[currentPath]: () => callback(patchPath),
|
|
34
|
-
};
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
},
|
|
38
|
-
[]
|
|
39
|
-
);
|
|
40
|
-
useEffect(() => {
|
|
41
|
-
setState((prev) => {
|
|
42
|
-
const newState: PatchCallbackState = {};
|
|
43
|
-
// filter out paths that no longer are selected
|
|
44
|
-
for (const path of paths) {
|
|
45
|
-
if (prev[path]) {
|
|
46
|
-
newState[path] = prev[path];
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
if (Object.keys(newState).length === Object.keys(prev).length) {
|
|
50
|
-
// avoid infinite loops
|
|
51
|
-
return prev;
|
|
52
|
-
}
|
|
53
|
-
return newState;
|
|
54
|
-
});
|
|
55
|
-
}, [paths]);
|
|
56
|
-
|
|
57
|
-
const onSubmitPatch = useCallback(async () => {
|
|
58
|
-
const patches: Record<ModuleId, PatchJSON> = {};
|
|
59
|
-
for (const path in state) {
|
|
60
|
-
const [moduleId] = Internal.splitModuleIdAndModulePath(
|
|
61
|
-
path as SourcePath
|
|
62
|
-
);
|
|
63
|
-
const patch = await state[path as SourcePath]();
|
|
64
|
-
patches[moduleId] = patch;
|
|
65
|
-
}
|
|
66
|
-
return Promise.all(
|
|
67
|
-
Object.entries(patches).map(([moduleId, patch]) =>
|
|
68
|
-
api.postPatches(moduleId as ModuleId, patch).then((res) => {
|
|
69
|
-
if (result.isErr(res)) {
|
|
70
|
-
throw res.error;
|
|
71
|
-
} else {
|
|
72
|
-
res.value;
|
|
73
|
-
}
|
|
74
|
-
})
|
|
75
|
-
)
|
|
76
|
-
).then(() => {
|
|
77
|
-
return valStore.update(
|
|
78
|
-
paths.map(
|
|
79
|
-
(path) => Internal.splitModuleIdAndModulePath(path as SourcePath)[0]
|
|
80
|
-
)
|
|
81
|
-
);
|
|
82
|
-
});
|
|
83
|
-
}, [state]);
|
|
84
|
-
|
|
85
|
-
return { initPatchCallback, onSubmitPatch };
|
|
86
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect } from "react";
|
|
2
|
-
import { Theme } from "./ValOverlayContext";
|
|
3
|
-
|
|
4
|
-
export function useTheme(defaultTheme: Theme = "dark") {
|
|
5
|
-
const [theme, setTheme] = useState<Theme>(defaultTheme);
|
|
6
|
-
|
|
7
|
-
useEffect(() => {
|
|
8
|
-
if (localStorage.getItem("val-theme") === "light") {
|
|
9
|
-
setTheme("light");
|
|
10
|
-
} else if (localStorage.getItem("val-theme") === "dark") {
|
|
11
|
-
setTheme("dark");
|
|
12
|
-
} else if (
|
|
13
|
-
window.matchMedia &&
|
|
14
|
-
window.matchMedia("(prefers-color-scheme: dark)").matches
|
|
15
|
-
) {
|
|
16
|
-
setTheme("dark");
|
|
17
|
-
} else if (
|
|
18
|
-
window.matchMedia &&
|
|
19
|
-
window.matchMedia("(prefers-color-scheme: light)").matches
|
|
20
|
-
) {
|
|
21
|
-
setTheme("light");
|
|
22
|
-
}
|
|
23
|
-
const themeListener = (e: MediaQueryListEvent) => {
|
|
24
|
-
if (!localStorage.getItem("val-theme")) {
|
|
25
|
-
setTheme(e.matches ? "dark" : "light");
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
window
|
|
29
|
-
.matchMedia("(prefers-color-scheme: dark)")
|
|
30
|
-
.addEventListener("change", themeListener);
|
|
31
|
-
return () => {
|
|
32
|
-
window
|
|
33
|
-
.matchMedia("(prefers-color-scheme: dark)")
|
|
34
|
-
.removeEventListener("change", themeListener);
|
|
35
|
-
};
|
|
36
|
-
}, []);
|
|
37
|
-
|
|
38
|
-
return [
|
|
39
|
-
theme,
|
|
40
|
-
(theme: Theme) => {
|
|
41
|
-
localStorage.setItem("val-theme", theme);
|
|
42
|
-
setTheme(theme);
|
|
43
|
-
},
|
|
44
|
-
] as const;
|
|
45
|
-
}
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
export default {};
|
|
2
|
-
// TODO:
|
|
3
|
-
// import type { SerializedSchema as SerializedSchemaT } from "@valbuild/core";
|
|
4
|
-
// import { z } from "zod";
|
|
5
|
-
//
|
|
6
|
-
// export const SerializedSchema: z.ZodType<SerializedSchemaT> = z.lazy(() => {
|
|
7
|
-
// const SerializedStringSchema = z.object({
|
|
8
|
-
// _type: z.literal("string"),
|
|
9
|
-
// opt: z.boolean(),
|
|
10
|
-
// });
|
|
11
|
-
// const SerializedBooleanSchema = z.object({
|
|
12
|
-
// _type: z.literal("boolean"),
|
|
13
|
-
// opt: z.boolean(),
|
|
14
|
-
// });
|
|
15
|
-
// const SerializedNumberSchema = z.object({
|
|
16
|
-
// _type: z.literal("number"),
|
|
17
|
-
// opt: z.boolean(),
|
|
18
|
-
// });
|
|
19
|
-
// const SerializedLiteralSchema = z.object({
|
|
20
|
-
// _type: z.literal("literal"),
|
|
21
|
-
// value: z.string(),
|
|
22
|
-
// opt: z.boolean(),
|
|
23
|
-
// });
|
|
24
|
-
// const SerializedObjectSchema = z.object({
|
|
25
|
-
// _type: z.literal("object"),
|
|
26
|
-
// opt: z.boolean(),
|
|
27
|
-
// items: z.record(SerializedSchema),
|
|
28
|
-
// });
|
|
29
|
-
// const SerializedOneOfSchema = z.object({
|
|
30
|
-
// _type: z.literal("oneOf"),
|
|
31
|
-
// opt: z.boolean(),
|
|
32
|
-
// });
|
|
33
|
-
// const SerializedArraySchema = z.object({
|
|
34
|
-
// _type: z.literal("array"),
|
|
35
|
-
// item: SerializedSchema,
|
|
36
|
-
// opt: z.boolean(),
|
|
37
|
-
// });
|
|
38
|
-
// const SerializedUnionSchema = z.object({
|
|
39
|
-
// _type: z.literal("union"),
|
|
40
|
-
// opt: z.boolean(),
|
|
41
|
-
// });
|
|
42
|
-
// const SerializedRichTextSchema = z.object({
|
|
43
|
-
// _type: z.literal("richtext"),
|
|
44
|
-
// opt: z.boolean(),
|
|
45
|
-
// });
|
|
46
|
-
// const SerializedImageSchema = z.object({
|
|
47
|
-
// _type: z.literal("image"),
|
|
48
|
-
// opt: z.boolean(),
|
|
49
|
-
// });
|
|
50
|
-
// const SerializedI18nSchema = z.object({
|
|
51
|
-
// _type: z.literal("i18n"),
|
|
52
|
-
// locales: z.array(z.string()),
|
|
53
|
-
// item: SerializedSchema,
|
|
54
|
-
// opt: z.boolean(),
|
|
55
|
-
// });
|
|
56
|
-
// return z.union([
|
|
57
|
-
// SerializedStringSchema,
|
|
58
|
-
// SerializedLiteralSchema,
|
|
59
|
-
// SerializedBooleanSchema,
|
|
60
|
-
// SerializedNumberSchema,
|
|
61
|
-
// SerializedObjectSchema,
|
|
62
|
-
// SerializedOneOfSchema,
|
|
63
|
-
// SerializedArraySchema,
|
|
64
|
-
// SerializedUnionSchema,
|
|
65
|
-
// SerializedRichTextSchema,
|
|
66
|
-
// SerializedImageSchema,
|
|
67
|
-
// SerializedI18nSchema,
|
|
68
|
-
// ]);
|
|
69
|
-
// });
|
package/src/dto/Session.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
import { SessionMode } from "./SessionMode";
|
|
3
|
-
|
|
4
|
-
export const Session = z.object({
|
|
5
|
-
id: z.string(),
|
|
6
|
-
mode: SessionMode,
|
|
7
|
-
full_name: z.string().nullable(),
|
|
8
|
-
username: z.string().nullable(),
|
|
9
|
-
avatar_url: z.string().url().nullable(),
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export type Session = z.infer<typeof Session>;
|
package/src/dto/SessionMode.ts
DELETED
package/src/dto/Tree.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
export const Tree = z.object({
|
|
4
|
-
git: z.object({
|
|
5
|
-
commit: z.string(),
|
|
6
|
-
branch: z.string(),
|
|
7
|
-
}),
|
|
8
|
-
modules: z.record(
|
|
9
|
-
z.object({
|
|
10
|
-
// TODO: types!
|
|
11
|
-
schema: z.any().optional(),
|
|
12
|
-
source: z.any().optional(),
|
|
13
|
-
// TODO: patches
|
|
14
|
-
})
|
|
15
|
-
),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
export type Tree = z.infer<typeof Tree>;
|
package/src/exports.ts
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export { RichTextEditor } from "./components/RichTextEditor/RichTextEditor";
|
|
2
|
-
export { ValOverlay } from "./components/ValOverlay";
|
|
3
|
-
export { type Inputs } from "./components/forms/Form";
|
|
4
|
-
export { ValFullscreen } from "./components/ValFullscreen";
|
|
5
|
-
export { parseRichTextSource } from "./richtext/conversion/parseRichTextSource";
|
|
6
|
-
export { type IValStore } from "./lib/IValStore";
|
package/src/index.css
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
Need to explicitly set config path, otherwise it may fail to resolve when
|
|
3
|
-
built from outside packages/ui.
|
|
4
|
-
*/
|
|
5
|
-
@config "../tailwind.config.js";
|
|
6
|
-
|
|
7
|
-
@tailwind base;
|
|
8
|
-
@tailwind components;
|
|
9
|
-
@tailwind utilities;
|
|
10
|
-
|
|
11
|
-
@layer base {
|
|
12
|
-
/* :host for use with Shadow DOM, copied from the TailwindCSS prelude */
|
|
13
|
-
:host {
|
|
14
|
-
--background: 0 0% 100%;
|
|
15
|
-
--foreground: 222.2 84% 4.9%;
|
|
16
|
-
|
|
17
|
-
--card: 0 0% 100%;
|
|
18
|
-
--card-foreground: 222.2 84% 4.9%;
|
|
19
|
-
|
|
20
|
-
--popover: 0 0% 100%;
|
|
21
|
-
--popover-foreground: 222.2 84% 4.9%;
|
|
22
|
-
|
|
23
|
-
--primary: 222.2 47.4% 11.2%;
|
|
24
|
-
--primary-foreground: 210 40% 98%;
|
|
25
|
-
|
|
26
|
-
--secondary: 210 40% 96.1%;
|
|
27
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
28
|
-
|
|
29
|
-
--muted: 0 0% 57.3%;
|
|
30
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
31
|
-
|
|
32
|
-
--accent: 159, 60%, 51%, 1;
|
|
33
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
34
|
-
|
|
35
|
-
--destructive: 0 84.2% 60.2%;
|
|
36
|
-
--destructive-foreground: 210 40% 98%;
|
|
37
|
-
|
|
38
|
-
--border: 214.3 31.8% 91.4%;
|
|
39
|
-
--input: 214.3 31.8% 91.4%;
|
|
40
|
-
--ring: 222.2 84% 4.9%;
|
|
41
|
-
|
|
42
|
-
--radius: 0.5rem;
|
|
43
|
-
}
|
|
44
|
-
:root {
|
|
45
|
-
--background: 0 0% 100%;
|
|
46
|
-
--foreground: 222.2 84% 4.9%;
|
|
47
|
-
|
|
48
|
-
--card: 0 0% 100%;
|
|
49
|
-
--card-foreground: 222.2 84% 4.9%;
|
|
50
|
-
|
|
51
|
-
--popover: 0 0% 100%;
|
|
52
|
-
--popover-foreground: 222.2 84% 4.9%;
|
|
53
|
-
|
|
54
|
-
--primary: 222.2 47.4% 11.2%;
|
|
55
|
-
--primary-foreground: 210 40% 98%;
|
|
56
|
-
|
|
57
|
-
--secondary: 210 40% 96.1%;
|
|
58
|
-
--secondary-foreground: 222.2 47.4% 11.2%;
|
|
59
|
-
|
|
60
|
-
--muted: 0 0% 57.3%;
|
|
61
|
-
--muted-foreground: 215.4 16.3% 46.9%;
|
|
62
|
-
|
|
63
|
-
--accent: 159, 60%, 51%, 1;
|
|
64
|
-
--accent-foreground: 222.2 47.4% 11.2%;
|
|
65
|
-
|
|
66
|
-
--destructive: 0 84.2% 60.2%;
|
|
67
|
-
--destructive-foreground: 210 40% 98%;
|
|
68
|
-
|
|
69
|
-
--border: 214.3 31.8% 91.4%;
|
|
70
|
-
--input: 214.3 31.8% 91.4%;
|
|
71
|
-
--ring: 222.2 84% 4.9%;
|
|
72
|
-
|
|
73
|
-
--radius: 0.5rem;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
/* dark theme */
|
|
77
|
-
*[data-mode="dark"] {
|
|
78
|
-
--background: 0 0% 4%;
|
|
79
|
-
--foreground: 210 40% 98%;
|
|
80
|
-
|
|
81
|
-
--card: 222.2 84% 4.9%;
|
|
82
|
-
--card-foreground: 210 40% 98%;
|
|
83
|
-
|
|
84
|
-
--popover: 222.2 84% 4.9%;
|
|
85
|
-
--popover-foreground: 210 40% 98%;
|
|
86
|
-
|
|
87
|
-
--primary: 210 40% 98%;
|
|
88
|
-
--primary-foreground: 222.2 47.4% 11.2%;
|
|
89
|
-
|
|
90
|
-
--secondary: 217.2 32.6% 17.5%;
|
|
91
|
-
--secondary-foreground: 210 40% 98%;
|
|
92
|
-
|
|
93
|
-
--muted: 178, 23%, 76%, 1;
|
|
94
|
-
--muted-foreground: 215 20.2% 65.1%;
|
|
95
|
-
|
|
96
|
-
--accent: 159, 60%, 51%, 1;
|
|
97
|
-
--accent-foreground: 210 40% 98%;
|
|
98
|
-
|
|
99
|
-
--destructive: 0 62.8% 30.6%;
|
|
100
|
-
--destructive-foreground: 210 40% 98%;
|
|
101
|
-
|
|
102
|
-
--border: 217.2 32.6% 17.5%;
|
|
103
|
-
--input: 217.2 32.6% 17.5%;
|
|
104
|
-
--ring: 212.7 26.8% 83.9%;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
@layer base {
|
|
109
|
-
* {
|
|
110
|
-
@apply border-border;
|
|
111
|
-
}
|
|
112
|
-
body {
|
|
113
|
-
@apply bg-background text-foreground;
|
|
114
|
-
}
|
|
115
|
-
}
|
package/src/index.tsx
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This module is the entrypoint of @valbuild/ui until the package is built with
|
|
3
|
-
* Vite. It is used only as a shim during local development, and is actually not
|
|
4
|
-
* part of the build output meant for consumers.
|
|
5
|
-
*
|
|
6
|
-
* After building with Vite, this entrypoint is replaced by ./vite-index.tsx,
|
|
7
|
-
* which is optimized for consumers.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
export * from "./exports";
|
|
11
|
-
|
|
12
|
-
export function Style(): JSX.Element | null {
|
|
13
|
-
return <link rel="stylesheet" href="/api/val/static/style.css" />;
|
|
14
|
-
}
|
package/src/lib/IValStore.ts
DELETED
package/src/lib/utils.ts
DELETED
package/src/main.jsx
DELETED