camox 0.10.0 → 0.11.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/core/components/lexical/SidebarLexicalEditor.js +14 -41
- package/dist/core/createApp.d.ts +3 -3
- package/dist/core/createBlock.d.ts +14 -13
- package/dist/core/createBlock.js +114 -98
- package/dist/core/lib/contentType.d.ts +11 -9
- package/dist/core/lib/contentType.js +19 -2
- package/dist/features/content/CamoxContent.js +1 -1
- package/dist/features/preview/CamoxPreview.js +1 -1
- package/dist/features/preview/components/AddBlockSheet.js +1 -1
- package/dist/features/preview/components/AssetFieldEditor.js +1 -1
- package/dist/features/preview/components/CreatePageModal.js +1 -1
- package/dist/features/preview/components/EditPageModal.js +1 -1
- package/dist/features/preview/components/PagePicker.js +1 -1
- package/dist/features/preview/components/useUpdateBlockPosition.js +1 -1
- package/dist/features/provider/CamoxProvider.js +1 -1
- package/dist/features/routes/pageRoute.js +4 -3
- package/dist/features/studio/CamoxStudio.js +1 -1
- package/dist/features/studio/components/Navbar.js +1 -1
- package/dist/features/studio/components/ProjectMenu.js +1 -1
- package/dist/features/vite/blockBoilerplate.js +1 -1
- package/dist/features/vite/vite.js +45 -42
- package/dist/studio.css +1 -1
- package/package.json +4 -4
- package/skills/camox-block/SKILL.md +30 -24
|
@@ -194,7 +194,7 @@ const SingleAssetFieldEditor = (t0) => {
|
|
|
194
194
|
children: [
|
|
195
195
|
/* @__PURE__ */ jsxs("button", {
|
|
196
196
|
type: "button",
|
|
197
|
-
className: "flex min-w-0 flex-1 cursor-zoom-in items-center gap-2 rounded-sm p-1
|
|
197
|
+
className: "flex min-w-0 flex-1 cursor-zoom-in items-center gap-2 rounded-sm p-1",
|
|
198
198
|
onClick: () => setLightboxOpen(true),
|
|
199
199
|
children: [isImage ? /* @__PURE__ */ jsx("div", {
|
|
200
200
|
className: "border-border h-10 w-10 shrink-0 overflow-hidden rounded border",
|
|
@@ -7,11 +7,11 @@ import { PageLocationFieldset } from "./PageLocationFieldset.js";
|
|
|
7
7
|
import { Label } from "@camox/ui/label";
|
|
8
8
|
import { toast } from "@camox/ui/toaster";
|
|
9
9
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
10
|
+
import { useNavigate } from "@tanstack/react-router";
|
|
10
11
|
import { useSelector } from "@xstate/store/react";
|
|
11
12
|
import { useEffect } from "react";
|
|
12
13
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
13
14
|
import { Button } from "@camox/ui/button";
|
|
14
|
-
import { useNavigate } from "@tanstack/react-router";
|
|
15
15
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
16
16
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
17
17
|
import { Spinner } from "@camox/ui/spinner";
|
|
@@ -11,12 +11,12 @@ import { c } from "react/compiler-runtime";
|
|
|
11
11
|
import { Label } from "@camox/ui/label";
|
|
12
12
|
import { toast } from "@camox/ui/toaster";
|
|
13
13
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
14
|
+
import { useNavigate } from "@tanstack/react-router";
|
|
14
15
|
import { useSelector } from "@xstate/store/react";
|
|
15
16
|
import * as React from "react";
|
|
16
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
17
18
|
import { Button } from "@camox/ui/button";
|
|
18
19
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@camox/ui/tooltip";
|
|
19
|
-
import { useNavigate } from "@tanstack/react-router";
|
|
20
20
|
import { Globe, Info } from "lucide-react";
|
|
21
21
|
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@camox/ui/dialog";
|
|
22
22
|
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@camox/ui/select";
|
|
@@ -5,11 +5,11 @@ import { cn, formatPathSegment } from "../../../lib/utils.js";
|
|
|
5
5
|
import { Popover, PopoverContent, PopoverTrigger } from "@camox/ui/popover";
|
|
6
6
|
import { toast } from "@camox/ui/toaster";
|
|
7
7
|
import { useMutation, useQuery } from "@tanstack/react-query";
|
|
8
|
+
import { useLocation, useNavigate } from "@tanstack/react-router";
|
|
8
9
|
import { useSelector } from "@xstate/store/react";
|
|
9
10
|
import * as React from "react";
|
|
10
11
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
11
12
|
import { Button } from "@camox/ui/button";
|
|
12
|
-
import { useLocation, useNavigate } from "@tanstack/react-router";
|
|
13
13
|
import { Check, ChevronsUpDown, Pencil, Plus, Trash2 } from "lucide-react";
|
|
14
14
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
15
15
|
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator } from "@camox/ui/command";
|
|
@@ -2,10 +2,10 @@ import { previewStore } from "../previewStore.js";
|
|
|
2
2
|
import { blockMutations } from "../../../lib/queries.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useMutation, useQueryClient } from "@tanstack/react-query";
|
|
5
|
+
import { useLocation } from "@tanstack/react-router";
|
|
5
6
|
import { useSelector } from "@xstate/store/react";
|
|
6
7
|
import { generateKeyBetween } from "fractional-indexing";
|
|
7
8
|
import { queryKeys } from "@camox/api-contract/query-keys";
|
|
8
|
-
import { useLocation } from "@tanstack/react-router";
|
|
9
9
|
|
|
10
10
|
//#region src/features/preview/components/useUpdateBlockPosition.ts
|
|
11
11
|
function useUpdateBlockPosition() {
|
|
@@ -93,7 +93,7 @@ const UnauthenticatedCamoxProvider = (t0) => {
|
|
|
93
93
|
let t4;
|
|
94
94
|
if ($[5] !== signInRedirect) {
|
|
95
95
|
t3 = () => {
|
|
96
|
-
if (
|
|
96
|
+
if (import.meta.env.PROD) return;
|
|
97
97
|
const toastId = toast("Sign in to open Camox Studio", {
|
|
98
98
|
duration: Infinity,
|
|
99
99
|
action: {
|
|
@@ -2,11 +2,11 @@ import { seedBlockCaches } from "../../lib/normalized-data.js";
|
|
|
2
2
|
import { CamoxPreview, PageContent } from "../preview/CamoxPreview.js";
|
|
3
3
|
import { trackEvent } from "../../lib/analytics.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
|
+
import { notFound } from "@tanstack/react-router";
|
|
5
6
|
import { jsx } from "react/jsx-runtime";
|
|
6
7
|
import { queryKeys } from "@camox/api-contract/query-keys";
|
|
7
8
|
import { createORPCClient } from "@orpc/client";
|
|
8
9
|
import { RPCLink } from "@orpc/client/fetch";
|
|
9
|
-
import { notFound } from "@tanstack/react-router";
|
|
10
10
|
import { createMiddleware, createServerFn } from "@tanstack/react-start";
|
|
11
11
|
import { getRequest } from "@tanstack/react-start/server";
|
|
12
12
|
|
|
@@ -70,11 +70,12 @@ function createPageLoader(apiUrl, projectSlug, environmentName) {
|
|
|
70
70
|
const [page, origin] = await Promise.all([context.queryClient.ensureQueryData({
|
|
71
71
|
queryKey: queryKeys.pages.getByPath(location.pathname),
|
|
72
72
|
queryFn: async () => {
|
|
73
|
-
const data = await serverApi.pages.getByPath({
|
|
73
|
+
const [data, pagesList] = await Promise.all([serverApi.pages.getByPath({
|
|
74
74
|
path: location.pathname,
|
|
75
75
|
projectSlug
|
|
76
|
-
});
|
|
76
|
+
}), serverApi.pages.listBySlug({ projectSlug }).catch(() => null)]);
|
|
77
77
|
seedBlockCaches(context.queryClient, data);
|
|
78
|
+
if (pagesList) context.queryClient.setQueryData(queryKeys.pages.list, pagesList);
|
|
78
79
|
return {
|
|
79
80
|
page: data.page,
|
|
80
81
|
layout: data.layout,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useAuthState, useSignInRedirect } from "../../lib/auth.js";
|
|
2
2
|
import { Navbar } from "./components/Navbar.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
|
+
import { Navigate, useLocation } from "@tanstack/react-router";
|
|
4
5
|
import * as React from "react";
|
|
5
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
|
-
import { Navigate, useLocation } from "@tanstack/react-router";
|
|
7
7
|
|
|
8
8
|
//#region src/features/studio/CamoxStudio.tsx
|
|
9
9
|
const CamoxStudio = (t0) => {
|
|
@@ -10,10 +10,10 @@ import { UserButton } from "./UserButton.js";
|
|
|
10
10
|
import { c } from "react/compiler-runtime";
|
|
11
11
|
import { Kbd } from "@camox/ui/kbd";
|
|
12
12
|
import { useQuery } from "@tanstack/react-query";
|
|
13
|
+
import { Link, useLocation, useNavigate } from "@tanstack/react-router";
|
|
13
14
|
import * as React from "react";
|
|
14
15
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
15
16
|
import { Button } from "@camox/ui/button";
|
|
16
|
-
import { Link, useLocation, useNavigate } from "@tanstack/react-router";
|
|
17
17
|
import { Database, Globe, SearchIcon } from "lucide-react";
|
|
18
18
|
|
|
19
19
|
//#region src/features/studio/components/Navbar.tsx
|
|
@@ -2,10 +2,10 @@ import { AuthContext } from "../../../lib/auth.js";
|
|
|
2
2
|
import { projectQueries } from "../../../lib/queries.js";
|
|
3
3
|
import { c } from "react/compiler-runtime";
|
|
4
4
|
import { useQuery } from "@tanstack/react-query";
|
|
5
|
+
import { Link } from "@tanstack/react-router";
|
|
5
6
|
import * as React from "react";
|
|
6
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
8
|
import { Button } from "@camox/ui/button";
|
|
8
|
-
import { Link } from "@tanstack/react-router";
|
|
9
9
|
import { ChevronDown, Globe, Info, Settings, Users } from "lucide-react";
|
|
10
10
|
import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuTrigger } from "@camox/ui/dropdown-menu";
|
|
11
11
|
import { Skeleton } from "@camox/ui/skeleton";
|
|
@@ -74,48 +74,51 @@ function camox(options) {
|
|
|
74
74
|
__CAMOX_API_URL__: JSON.stringify(apiUrl),
|
|
75
75
|
__CAMOX_PROJECT_SLUG__: JSON.stringify(options.projectSlug)
|
|
76
76
|
},
|
|
77
|
-
optimizeDeps: {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
77
|
+
optimizeDeps: {
|
|
78
|
+
include: [
|
|
79
|
+
"camox > @base-ui/react/accordion",
|
|
80
|
+
"camox > @base-ui/react/alert-dialog",
|
|
81
|
+
"camox > @base-ui/react/avatar",
|
|
82
|
+
"camox > @base-ui/react/dialog",
|
|
83
|
+
"camox > @base-ui/react/input",
|
|
84
|
+
"camox > @base-ui/react/menu",
|
|
85
|
+
"camox > @base-ui/react/merge-props",
|
|
86
|
+
"camox > @base-ui/react/popover",
|
|
87
|
+
"camox > @base-ui/react/select",
|
|
88
|
+
"camox > @base-ui/react/separator",
|
|
89
|
+
"camox > @base-ui/react/switch",
|
|
90
|
+
"camox > @base-ui/react/tabs",
|
|
91
|
+
"camox > @base-ui/react/toggle",
|
|
92
|
+
"camox > @base-ui/react/tooltip",
|
|
93
|
+
"camox > @base-ui/react/use-render",
|
|
94
|
+
"camox > @dnd-kit/core",
|
|
95
|
+
"camox > @dnd-kit/modifiers",
|
|
96
|
+
"camox > @dnd-kit/sortable",
|
|
97
|
+
"camox > @dnd-kit/utilities",
|
|
98
|
+
"camox > @lexical/react/LexicalComposer",
|
|
99
|
+
"camox > @lexical/react/LexicalComposerContext",
|
|
100
|
+
"camox > @lexical/react/LexicalContentEditable",
|
|
101
|
+
"camox > @lexical/react/LexicalOnChangePlugin",
|
|
102
|
+
"camox > @lexical/react/LexicalRichTextPlugin",
|
|
103
|
+
"camox > @orpc/client",
|
|
104
|
+
"camox > @orpc/client/fetch",
|
|
105
|
+
"camox > @orpc/tanstack-query",
|
|
106
|
+
"camox > @sinclair/typebox",
|
|
107
|
+
"camox > @takumi-rs/image-response",
|
|
108
|
+
"camox > @tanstack/react-form",
|
|
109
|
+
"camox > @xstate/store",
|
|
110
|
+
"camox > @xstate/store/react",
|
|
111
|
+
"camox > @camox/ui > cmdk",
|
|
112
|
+
"camox > fractional-indexing",
|
|
113
|
+
"camox > lexical",
|
|
114
|
+
"camox > posthog-js",
|
|
115
|
+
"camox > shiki",
|
|
116
|
+
"camox > @camox/ui > sonner",
|
|
117
|
+
"camox > @tanstack/react-query-devtools/production",
|
|
118
|
+
"camox > partysocket/react"
|
|
119
|
+
],
|
|
120
|
+
exclude: ["virtual:tanstack-start-client-entry"]
|
|
121
|
+
}
|
|
119
122
|
};
|
|
120
123
|
},
|
|
121
124
|
configResolved(config) {
|