Skip to content

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.

rename files

istarkovdd02f2e7a03f
diff --git a/apps/designer/app/designer/features/style-panel/controls/font-weight/font-weight-control.tsx b/apps/designer/app/designer/features/style-panel/controls/font-weight/font-weight-control.tsx
index b26d60678d..7d73cfe79f 100644
--- a/apps/designer/app/designer/features/style-panel/controls/font-weight/font-weight-control.tsx
+++ b/apps/designer/app/designer/features/style-panel/controls/font-weight/font-weight-control.tsx
@@ -2,7 +2,7 @@ import { Select } from "@webstudio-is/design-system";
import { FontWeight, fontWeights } from "@webstudio-is/fonts";
import { toValue } from "@webstudio-is/css-engine";
import { useMemo } from "react";
-import { useAssets } from "~/designer/shared/assets";
+import { useAssetContainers } from "~/designer/shared/assets";
import { getFinalValue } from "../../shared/get-final-value";
import type { ControlProps } from "../../style-sections";
@@ -22,7 +22,7 @@ const allFontWeights: Array<FontWeightItem> = (
const useAvailableFontWeights = (
currentFamily: string
): Array<FontWeightItem> => {
- const { assets } = useAssets("font");
+ const { assets } = useAssetContainers("font");
// Find all font weights that are available for the current font family.
return useMemo(() => {
diff --git a/apps/designer/app/designer/features/style-panel/controls/image/image-control.tsx b/apps/designer/app/designer/features/style-panel/controls/image/image-control.tsx
index 1b7773e3a8..28285d4df9 100644
--- a/apps/designer/app/designer/features/style-panel/controls/image/image-control.tsx
+++ b/apps/designer/app/designer/features/style-panel/controls/image/image-control.tsx
@@ -3,7 +3,7 @@ import type { ControlProps } from "../../style-sections";
import { getFinalValue } from "../../shared/get-final-value";
import { ValuePickerPopover } from "../../shared/value-picker-popover";
import { ImageManager } from "~/designer/shared/image-manager";
-import { useAssets } from "~/designer/shared/assets";
+import { useAssetContainers } from "~/designer/shared/assets";
import { toValue } from "@webstudio-is/css-engine";
export const ImageControl = ({
@@ -12,7 +12,7 @@ export const ImageControl = ({
setProperty,
styleConfig,
}: ControlProps) => {
- const { assets } = useAssets("image");
+ const { assets } = useAssetContainers("image");
// @todo show which instance we inherited the value from
const value = getFinalValue({
currentStyle,
diff --git a/apps/designer/app/designer/shared/assets/asset-upload.tsx b/apps/designer/app/designer/shared/assets/asset-upload.tsx
index 78afa07061..f3aadeb8d8 100644
--- a/apps/designer/app/designer/shared/assets/asset-upload.tsx
+++ b/apps/designer/app/designer/shared/assets/asset-upload.tsx
@@ -3,10 +3,10 @@ import { Button, Flex, Text } from "@webstudio-is/design-system";
import { UploadIcon } from "@webstudio-is/icons";
import { type AssetType } from "@webstudio-is/asset-uploader";
import { FONT_MIME_TYPES } from "@webstudio-is/fonts";
-import { useAssets } from "./use-assets";
+import { useAssetContainers } from "./use-asset-containers";
const useUpload = (type: AssetType) => {
- const { handleSubmit } = useAssets(type);
+ const { handleSubmit } = useAssetContainers(type);
const inputRef = useRef<HTMLInputElement | null>(null);
const onChange = (event: ChangeEvent<HTMLFormElement>) => {
diff --git a/apps/designer/app/designer/shared/assets/index.ts b/apps/designer/app/designer/shared/assets/index.ts
index dc3e837c4d..0459328405 100644
--- a/apps/designer/app/designer/shared/assets/index.ts
+++ b/apps/designer/app/designer/shared/assets/index.ts
@@ -1,4 +1,4 @@
-export * from "./use-assets";
+export * from "./use-asset-containers";
export * from "./types";
export * from "./separator";
export * from "./use-search";
diff --git a/apps/designer/app/designer/shared/assets/update-state-assets.test.ts b/apps/designer/app/designer/shared/assets/update-asset-containers.test.ts
similarity index 98%
rename from apps/designer/app/designer/shared/assets/update-state-assets.test.ts
rename to apps/designer/app/designer/shared/assets/update-asset-containers.test.ts
index c8fdeaff9d..848ae1788b 100644
--- a/apps/designer/app/designer/shared/assets/update-state-assets.test.ts
+++ b/apps/designer/app/designer/shared/assets/update-asset-containers.test.ts
@@ -6,7 +6,7 @@ import {
DeletingClientAsset,
ClientAsset,
} from "./types";
-import { updateStateAssets } from "./update-state-assets";
+import { updateStateAssets } from "./update-asset-containers";
const getAssetId = (clientAsset: ClientAsset): string =>
clientAsset.status === "uploading"
diff --git a/apps/designer/app/designer/shared/assets/update-state-assets.ts b/apps/designer/app/designer/shared/assets/update-asset-containers.ts
similarity index 100%
rename from apps/designer/app/designer/shared/assets/update-state-assets.ts
rename to apps/designer/app/designer/shared/assets/update-asset-containers.ts
diff --git a/apps/designer/app/designer/shared/assets/use-assets.tsx b/apps/designer/app/designer/shared/assets/use-asset-containers.tsx
similarity index 98%
rename from apps/designer/app/designer/shared/assets/use-assets.tsx
rename to apps/designer/app/designer/shared/assets/use-asset-containers.tsx
index ad85ea8f42..192b2e5884 100644
--- a/apps/designer/app/designer/shared/assets/use-assets.tsx
+++ b/apps/designer/app/designer/shared/assets/use-asset-containers.tsx
@@ -33,7 +33,7 @@ import {
import { Publish } from "~/shared/pubsub";
import { useFetcher } from "@remix-run/react";
import warnOnce from "warn-once";
-import { updateStateAssets } from "./update-state-assets";
+import { updateStateAssets } from "./update-asset-containers";
declare module "~/shared/pubsub" {
export interface PubsubMap {
@@ -325,7 +325,7 @@ const filterByType = (clientAssets: RenderableAsset[], type: AssetType) => {
});
};
-export const useAssets = (type: AssetType) => {
+export const useAssetContainers = (type: AssetType) => {
const assetsContext = useContext(Context);
if (!assetsContext) {
throw new Error("useAssets is used without AssetsProvider");
diff --git a/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx b/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx
index 200a4c24ee..e3579fb6c5 100644
--- a/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx
+++ b/apps/designer/app/designer/shared/fonts-manager/fonts-manager.tsx
@@ -7,7 +7,7 @@ import {
import {
AssetsShell,
Separator,
- useAssets,
+ useAssetContainers,
useSearch,
} from "~/designer/shared/assets";
import { useEffect, useMemo, useState } from "react";
@@ -29,7 +29,8 @@ const useLogic = ({
onChange: (value: string) => void;
value: string;
}) => {
- const { assets, handleDelete: handleDeleteAssets } = useAssets("font");
+ const { assets, handleDelete: handleDeleteAssets } =
+ useAssetContainers("font");
const [selectedIndex, setSelectedIndex] = useState(-1);
const fontItems = useMemo(() => toItems(assets), [assets]);
const { filteredItems, resetFilteredItems, setFilteredItems } = useFilter({
diff --git a/apps/designer/app/designer/shared/image-manager/image-manager.tsx b/apps/designer/app/designer/shared/image-manager/image-manager.tsx
index 9bbc6f2c8c..242f438fcb 100644
--- a/apps/designer/app/designer/shared/image-manager/image-manager.tsx
+++ b/apps/designer/app/designer/shared/image-manager/image-manager.tsx
@@ -3,7 +3,7 @@ import { findNextListIndex, Grid } from "@webstudio-is/design-system";
import {
AssetsShell,
type RenderableAsset,
- useAssets,
+ useAssetContainers,
useSearch,
} from "../assets";
import { useFilter } from "../assets/use-filter";
@@ -24,7 +24,7 @@ const useLogic = ({
}: {
onChange?: (asset: RenderableAsset) => void;
}) => {
- const { assets, handleDelete } = useAssets("image");
+ const { assets, handleDelete } = useAssetContainers("image");
const [selectedIndex, setSelectedIndex] = useState(-1);