Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
tweaks, fixes, etc, change style-panel lib/ source folder to shared/ lib is in .gitignore
Sultana730524763aa
diff --git a/apps/designer/app/designer/designer.tsx b/apps/designer/app/designer/designer.tsxindex 62a810eb8a..d9bc59107a 100644--- a/apps/designer/app/designer/designer.tsx+++ b/apps/designer/app/designer/designer.tsx@@ -19,7 +19,7 @@ import {} from "./shared/nano-states";import { Topbar } from "./features/topbar";import designerStyles from "./designer.css";-import { Breadcrumbs } from "./features/footer";+import { Footer } from "./features/footer";import { TreePrevew } from "./features/tree-preview";import {useUpdateCanvasWidth,@@ -144,7 +144,7 @@ const ChromeWrapper = ({ children, isPreviewMode }: ChromeWrapperProps) => {`,}: {- gridTemplateColumns: "auto 1fr 240px",+ gridTemplateColumns: "auto 1fr $sizes$sidebarRight",gridTemplateRows: "auto 1fr auto",gridTemplateAreas: `"header header header"@@ -234,7 +234,7 @@ export const Designer = ({ config, project, assets }: DesignerProps) => {>{isDragging ? <TreePrevew /> : <Inspector publish={publish} />}</SidePanel>- <Breadcrumbs publish={publish} />+ <Footer publish={publish} /></ChromeWrapper></DndProvider>);diff --git a/apps/designer/app/designer/features/footer/breadcrumbs.tsx b/apps/designer/app/designer/features/footer/breadcrumbs.tsxindex ad4d78f8c1..f17d4673bf 100644--- a/apps/designer/app/designer/features/footer/breadcrumbs.tsx+++ b/apps/designer/app/designer/features/footer/breadcrumbs.tsx@@ -1,40 +1,35 @@import { ChevronRightIcon } from "@webstudio-is/icons";-import { Button, Flex, Text, darkTheme } from "@webstudio-is/design-system";+import { Button, Flex, Text } from "@webstudio-is/design-system";import { useSelectedInstancePath } from "~/designer/shared/instance/use-selected-instance-path";import { type Publish, type Instance } from "@webstudio-is/react-sdk";import { useSelectedInstanceData } from "~/designer/shared/nano-states";type BreadcrumbProps = {component: Instance["component"];- onClick: () => void;+ onClick?: () => void;};const Breadcrumb = ({ component, onClick }: BreadcrumbProps) => {return (- <Flex- align="center"- css={{- // @todo: this could be on the button itself, right?- "& button": {+ <>+ <Button+ ghost+ onClick={onClick}+ css={{color: "$hiContrast",- px: "0",- },- // @todo: and this on the svg, e.g. styled(Chevron...)(style)- "& path": {- fill: "$hiContrast",- },- }}- >- <Button ghost onClick={onClick}>+ px: "$2",+ borderRadius: "100vh",+ height: "100%",+ lineHeight: "100%",+ }}+ >{component}</Button>- <ChevronRightIcon />- </Flex>+ <ChevronRightIcon color="white" />+ </>);};-const EmptyState = () => <Text size="1">No instance selected</Text>;-type BreadcrumbsProps = {publish: Publish;};@@ -44,22 +39,9 @@ export const Breadcrumbs = ({ publish }: BreadcrumbsProps) => {selectedInstanceData?.id);return (- <Flex- className={darkTheme}- as="footer"- align="center"- css={{- gridArea: "footer",- height: "$5",- background: "$loContrast",- padding: "$2",- "[data-theme=dark] &": {- boxShadow: "inset 0 1px 0 0 $colors$gray7",- },- }}- >+ <Flex align="center" css={{ height: "100%" }}>{selectedInstancePath.length === 0 ? (- <EmptyState />+ <Breadcrumb component={<Text size="1">No instance selected</Text>} />) : (selectedInstancePath.map((instance) => (<Breadcrumbdiff --git a/apps/designer/app/designer/features/footer/footer.tsx b/apps/designer/app/designer/features/footer/footer.tsxnew file mode 100644index 0000000000..29eea38c7d--- /dev/null+++ b/apps/designer/app/designer/features/footer/footer.tsx@@ -0,0 +1,23 @@+import { Box, Flex, darkTheme } from "@webstudio-is/design-system";+import { type Publish } from "@webstudio-is/react-sdk";+import { Breadcrumbs } from "./breadcrumbs";++export const Footer = ({ publish }: { publish: Publish }) => {+ return (+ <Flex+ className={darkTheme}+ as="footer"+ align="center"+ css={{+ gridArea: "footer",+ height: "$sizes$5",+ background: "$loContrast",+ boxShadow: "inset 0 1px 0 0 $colors$panelOutline",+ }}+ >+ <Box css={{ height: "100%", p: "$sizes$1" }}>+ <Breadcrumbs publish={publish} />+ </Box>+ </Flex>+ );+};diff --git a/apps/designer/app/designer/features/footer/index.ts b/apps/designer/app/designer/features/footer/index.tsindex 669f557577..564d0ae429 100644--- a/apps/designer/app/designer/features/footer/index.ts+++ b/apps/designer/app/designer/features/footer/index.ts@@ -1 +1,2 @@export * from "./breadcrumbs";+export * from "./footer";diff --git a/apps/designer/app/designer/features/style-panel/lib/color-picker.tsx b/apps/designer/app/designer/features/style-panel/shared/color-picker.tsxsimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/color-picker.tsxrename to apps/designer/app/designer/features/style-panel/shared/color-picker.tsxdiff --git a/apps/designer/app/designer/features/style-panel/lib/configs.ts b/apps/designer/app/designer/features/style-panel/shared/configs.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/configs.tsrename to apps/designer/app/designer/features/style-panel/shared/configs.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/constants.ts b/apps/designer/app/designer/features/style-panel/shared/constants.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/constants.tsrename to apps/designer/app/designer/features/style-panel/shared/constants.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/dependencies.ts b/apps/designer/app/designer/features/style-panel/shared/dependencies.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/dependencies.tsrename to apps/designer/app/designer/features/style-panel/shared/dependencies.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/get-css-rule-for-breakpoint.ts b/apps/designer/app/designer/features/style-panel/shared/get-css-rule-for-breakpoint.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/get-css-rule-for-breakpoint.tsrename to apps/designer/app/designer/features/style-panel/shared/get-css-rule-for-breakpoint.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/get-inherited-style.ts b/apps/designer/app/designer/features/style-panel/shared/get-inherited-style.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/get-inherited-style.tsrename to apps/designer/app/designer/features/style-panel/shared/get-inherited-style.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/parse-css-value.test.ts b/apps/designer/app/designer/features/style-panel/shared/parse-css-value.test.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/parse-css-value.test.tsrename to apps/designer/app/designer/features/style-panel/shared/parse-css-value.test.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/parse-css-value.ts b/apps/designer/app/designer/features/style-panel/shared/parse-css-value.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/parse-css-value.tsrename to apps/designer/app/designer/features/style-panel/shared/parse-css-value.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/spacing-widget.tsx b/apps/designer/app/designer/features/style-panel/shared/spacing-widget.tsxsimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/spacing-widget.tsxrename to apps/designer/app/designer/features/style-panel/shared/spacing-widget.tsxdiff --git a/apps/designer/app/designer/features/style-panel/lib/use-is-from-current-breakpoint.ts b/apps/designer/app/designer/features/style-panel/shared/use-is-from-current-breakpoint.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/use-is-from-current-breakpoint.tsrename to apps/designer/app/designer/features/style-panel/shared/use-is-from-current-breakpoint.tsdiff --git a/apps/designer/app/designer/features/style-panel/lib/use-style-data.ts b/apps/designer/app/designer/features/style-panel/shared/use-style-data.tssimilarity index 100%rename from apps/designer/app/designer/features/style-panel/lib/use-style-data.tsrename to apps/designer/app/designer/features/style-panel/shared/use-style-data.tsdiff --git a/apps/designer/app/designer/features/style-panel/style-panel.tsx b/apps/designer/app/designer/features/style-panel/style-panel.tsxindex 33700f698e..4291348f6d 100644--- a/apps/designer/app/designer/features/style-panel/style-panel.tsx+++ b/apps/designer/app/designer/features/style-panel/style-panel.tsx@@ -2,7 +2,7 @@ import type { Publish } from "@webstudio-is/react-sdk";import { willRender } from "~/designer/shared/breakpoints";import { Box, Card, Paragraph } from "@webstudio-is/design-system";import type { SelectedInstanceData } from "~/shared/canvas-components";-import { useStyleData } from "./lib/use-style-data";+import { useStyleData } from "./shared/use-style-data";import { StyleSettings } from "./style-settings";import { Search } from "./search";import { useState } from "react";diff --git a/apps/designer/app/designer/features/style-panel/style-section.tsx b/apps/designer/app/designer/features/style-panel/style-section.tsxindex 8106f0c7c1..60e7d33184 100644--- a/apps/designer/app/designer/features/style-panel/style-section.tsx+++ b/apps/designer/app/designer/features/style-panel/style-section.tsx@@ -1,4 +1,4 @@-import { useState } from "react";+import { useState, KeyboardEvent } from "react";import {Box,Flex,@@ -15,7 +15,7 @@ import {} from "@webstudio-is/design-system";import { TriangleRightIcon, TriangleDownIcon } from "@webstudio-is/icons";import * as icons from "@webstudio-is/icons";-import type { StyleConfig } from "./lib/configs";+import type { StyleConfig } from "./shared/configs";import {categories,type Style,@@ -24,16 +24,16 @@ import {type StyleValue,type CSS,} from "@webstudio-is/react-sdk";-import type { SetProperty, CreateBatchUpdate } from "./lib/use-style-data";-import type { InheritedStyle } from "./lib/get-inherited-style";-import { ColorPicker } from "./lib/color-picker";+import type { SetProperty, CreateBatchUpdate } from "./shared/use-style-data";+import type { InheritedStyle } from "./shared/get-inherited-style";+import { ColorPicker } from "./shared/color-picker";import {SpacingWidget,type SpacingProperty,type SpacingStyles,-} from "./lib/spacing-widget";-import { useIsFromCurrentBreakpoint } from "./lib/use-is-from-current-breakpoint";-import { propertyNameColorForSelectedBreakpoint } from "./lib/constants";+} from "./shared/spacing-widget";+import { useIsFromCurrentBreakpoint } from "./shared/use-is-from-current-breakpoint";+import { propertyNameColorForSelectedBreakpoint } from "./shared/constants";const getFinalValue = ({currentStyle,@@ -203,6 +203,7 @@ const ComboboxControl = ({switch (styleConfig.property) {case "rowGap":case "columnGap": {+ console.log(currentStyle, styleConfig);const Icon = (icons as unknown as {gap: Record<string, (props: unknown) => JSX.Element>;@@ -244,7 +245,7 @@ const ComboboxControl = ({defaultValue={parseFloat(String(value.value)) || 0}// @todo looses input state and focus// onChange={(event: ChangeEvent<HTMLInputElement>) => setValue(event.target.value + "px")- onKeyDown={(event) =>+ onKeyDown={(event: KeyboardEvent<HTMLInputElement>) =>event.key === "Enter" &&setValue(event.currentTarget.value + "px")}@@ -276,6 +277,7 @@ const ComboboxControl = ({}}state={value.type === "invalid" ? "invalid" : undefined}value={String(value.value)}+ // @todo new combobox doesn't include any of these event handlersonValueSelect={setValue}onValueEnter={setValue}onItemEnter={(value) => {@@ -390,12 +392,10 @@ const ComboiconControl = ({const GridControl = ({css,currentStyle,- setProperty,createBatchUpdate,}: {css: CSS;currentStyle: Style;- setProperty: SetProperty;createBatchUpdate: CreateBatchUpdate;}) => {const isCurrentBreakpoint = useIsFromCurrentBreakpoint([@@ -562,7 +562,6 @@ const ShowMore = ({ styleConfigs }: { styleConfigs: Array<JSX.Element> }) => {type RenderPropertyProps = {setProperty: SetProperty;- createBatchUpdate: CreateBatchUpdate;currentStyle: Style;inheritedStyle: InheritedStyle;styleConfig: StyleConfig;@@ -573,7 +572,6 @@ export const renderProperty = ({currentStyle,inheritedStyle,setProperty,- createBatchUpdate,styleConfig,category,}: RenderPropertyProps) => {@@ -645,7 +643,7 @@ export const renderCategory = ({"${"grid ".repeat(5)} . . . . . . .""${"columnGap ".repeat(5)} lock lock ${"rowGap ".repeat(5)}"`,- // @todo justify icons are using justifycontent icons atm+ // @todo justifyItems icons are using justifycontent icons atm"& > [data-property=justifyItems]": {display: "none",},@@ -662,7 +660,6 @@ export const renderCategory = ({data-property="grid"css={{ gridArea: "grid" }}currentStyle={currentStyle}- setProperty={setProperty}createBatchUpdate={createBatchUpdate}/></Grid>diff --git a/apps/designer/app/designer/features/style-panel/style-settings.tsx b/apps/designer/app/designer/features/style-panel/style-settings.tsxindex f76796c7ae..78e1c22ffe 100644--- a/apps/designer/app/designer/features/style-panel/style-settings.tsx+++ b/apps/designer/app/designer/features/style-panel/style-settings.tsx@@ -6,12 +6,15 @@ import {type Style,} from "@webstudio-is/react-sdk";-import { type StyleConfig, styleConfigs } from "./lib/configs";+import { type StyleConfig, styleConfigs } from "./shared/configs";import { CollapsibleSection } from "~/designer/shared/inspector";import { renderProperty, renderCategory } from "./style-section";-import { dependencies } from "./lib/dependencies";-import { type InheritedStyle } from "./lib/get-inherited-style";-import { type SetProperty, type CreateBatchUpdate } from "./lib/use-style-data";+import { dependencies } from "./shared/dependencies";+import { type InheritedStyle } from "./shared/get-inherited-style";+import {+ type SetProperty,+ type CreateBatchUpdate,+} from "./shared/use-style-data";import { type SelectedInstanceData } from "~/shared/canvas-components";// Finds a property/value by using any available form: property, label, valuediff --git a/packages/design-system/src/stitches.config.ts b/packages/design-system/src/stitches.config.tsindex 799caa4d04..e690c07725 100644--- a/packages/design-system/src/stitches.config.ts+++ b/packages/design-system/src/stitches.config.ts@@ -231,6 +231,8 @@ export const {7: "45px",8: "65px",9: "80px",+ sidebarLeft: "45px",+ sidebarRight: "240px",},// space: {// 1: '4px',diff --git a/packages/react-sdk/src/css/categories.ts b/packages/react-sdk/src/css/categories.tsindex 2b1e46467e..59fc14d144 100644--- a/packages/react-sdk/src/css/categories.ts+++ b/packages/react-sdk/src/css/categories.ts@@ -89,7 +89,6 @@ const typography = ["textIndent","columnCount",- "columnGap","columnRuleStyle","columnRuleWidth","columnRuleColor",