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.

revert rename files

istarkovf64694397ea8
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 7d73cfe79f..b26d60678d 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 { useAssetContainers } from "~/designer/shared/assets";
+import { useAssets } 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 } = useAssetContainers("font");
+ const { assets } = useAssets("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 28285d4df9..1b7773e3a8 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 { useAssetContainers } from "~/designer/shared/assets";
+import { useAssets } 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 } = useAssetContainers("image");
+ const { assets } = useAssets("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 f3aadeb8d8..78afa07061 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 { useAssetContainers } from "./use-asset-containers";
+import { useAssets } from "./use-assets";
const useUpload = (type: AssetType) => {
- const { handleSubmit } = useAssetContainers(type);
+ const { handleSubmit } = useAssets(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 0459328405..dc3e837c4d 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-asset-containers";
+export * from "./use-assets";
export * from "./types";
export * from "./separator";
export * from "./use-search";
diff --git a/apps/designer/app/designer/shared/assets/update-asset-containers.test.ts b/apps/designer/app/designer/shared/assets/update-state-assets.test.ts
similarity index 98%
rename from apps/designer/app/designer/shared/assets/update-asset-containers.test.ts
rename to apps/designer/app/designer/shared/assets/update-state-assets.test.ts
index 848ae1788b..c8fdeaff9d 100644
--- a/apps/designer/app/designer/shared/assets/update-asset-containers.test.ts
+++ b/apps/designer/app/designer/shared/assets/update-state-assets.test.ts
@@ -6,7 +6,7 @@ import {
DeletingClientAsset,
ClientAsset,
} from "./types";
-import { updateStateAssets } from "./update-asset-containers";
+import { updateStateAssets } from "./update-state-assets";
const getAssetId = (clientAsset: ClientAsset): string =>
clientAsset.status === "uploading"
diff --git a/apps/designer/app/designer/shared/assets/update-asset-containers.ts b/apps/designer/app/designer/shared/assets/update-state-assets.ts
similarity index 100%
rename from apps/designer/app/designer/shared/assets/update-asset-containers.ts
rename to apps/designer/app/designer/shared/assets/update-state-assets.ts
diff --git a/apps/designer/app/designer/shared/assets/use-asset-containers.tsx b/apps/designer/app/designer/shared/assets/use-assets.tsx
similarity index 98%
rename from apps/designer/app/designer/shared/assets/use-asset-containers.tsx
rename to apps/designer/app/designer/shared/assets/use-assets.tsx
index 192b2e5884..ad85ea8f42 100644
--- a/apps/designer/app/designer/shared/assets/use-asset-containers.tsx
+++ b/apps/designer/app/designer/shared/assets/use-assets.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-asset-containers";
+import { updateStateAssets } from "./update-state-assets";
declare module "~/shared/pubsub" {
export interface PubsubMap {
@@ -325,7 +325,7 @@ const filterByType = (clientAssets: RenderableAsset[], type: AssetType) => {
});
};
-export const useAssetContainers = (type: AssetType) => {
+export const useAssets = (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 e3579fb6c5..200a4c24ee 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,
- useAssetContainers,
+ useAssets,
useSearch,
} from "~/designer/shared/assets";
import { useEffect, useMemo, useState } from "react";
@@ -29,8 +29,7 @@ const useLogic = ({
onChange: (value: string) => void;
value: string;
}) => {
- const { assets, handleDelete: handleDeleteAssets } =
- useAssetContainers("font");
+ const { assets, handleDelete: handleDeleteAssets } = useAssets("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 242f438fcb..9bbc6f2c8c 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,
- useAssetContainers,
+ useAssets,
useSearch,
} from "../assets";
import { useFilter } from "../assets/use-filter";
@@ -24,7 +24,7 @@ const useLogic = ({
}: {
onChange?: (asset: RenderableAsset) => void;
}) => {
- const { assets, handleDelete } = useAssetContainers("image");
+ const { assets, handleDelete } = useAssets("image");
const [selectedIndex, setSelectedIndex] = useState(-1);