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.

refactor: drop old flags (#5028)

Bogdan Chadkindbd4650bc52c
diff --git a/apps/builder/app/builder/features/command-panel/command-panel.tsx b/apps/builder/app/builder/features/command-panel/command-panel.tsx
index c3320ca91f..3e81b0135e 100644
--- a/apps/builder/app/builder/features/command-panel/command-panel.tsx
+++ b/apps/builder/app/builder/features/command-panel/command-panel.tsx
@@ -2,7 +2,6 @@ import { atom, computed } from "nanostores";
import { useStore } from "@nanostores/react";
import { useState } from "react";
import { matchSorter } from "match-sorter";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import {
Command,
CommandDialog,
@@ -55,9 +54,6 @@ const $commandPanel = atom<
>();
export const openCommandPanel = () => {
- if (isFeatureEnabled("command") === false) {
- return;
- }
const activeElement =
document.activeElement instanceof HTMLElement
? document.activeElement
diff --git a/apps/builder/app/builder/features/components/components.tsx b/apps/builder/app/builder/features/components/components.tsx
index a49c809240..dcd008247c 100644
--- a/apps/builder/app/builder/features/components/components.tsx
+++ b/apps/builder/app/builder/features/components/components.tsx
@@ -70,13 +70,6 @@ const $metas = computed(
// only set available components from component meta
availableComponents.add(name);
- if (
- isFeatureEnabled("headSlotComponent") === false &&
- name === "HeadSlot"
- ) {
- continue;
- }
-
metas.push({
name,
category: componentMeta.category ?? "hidden",
diff --git a/apps/builder/app/builder/features/pages/custom-metadata.tsx b/apps/builder/app/builder/features/pages/custom-metadata.tsx
index 275b025afa..84a998483b 100644
--- a/apps/builder/app/builder/features/pages/custom-metadata.tsx
+++ b/apps/builder/app/builder/features/pages/custom-metadata.tsx
@@ -11,7 +11,6 @@ import {
theme,
} from "@webstudio-is/design-system";
import { TrashIcon, PlusIcon } from "@webstudio-is/icons";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import { isLiteralExpression } from "@webstudio-is/sdk";
import { computeExpression } from "~/shared/data-variables";
import {
@@ -72,20 +71,18 @@ const MetadataItem = (props: {
Content
</Label>
<BindingControl>
- {isFeatureEnabled("cms") && (
- <BindingPopover
- scope={scope}
- aliases={aliases}
- variant={isLiteralExpression(props.content) ? "default" : "bound"}
- value={props.content}
- onChange={(value) => {
- props.onChange(props.property, value);
- }}
- onRemove={(evaluatedValue) => {
- props.onChange(props.property, JSON.stringify(evaluatedValue));
- }}
- />
- )}
+ <BindingPopover
+ scope={scope}
+ aliases={aliases}
+ variant={isLiteralExpression(props.content) ? "default" : "bound"}
+ value={props.content}
+ onChange={(value) => {
+ props.onChange(props.property, value);
+ }}
+ onRemove={(evaluatedValue) => {
+ props.onChange(props.property, JSON.stringify(evaluatedValue));
+ }}
+ />
<InputErrorsTooltip errors={undefined}>
<InputField
css={{
diff --git a/apps/builder/app/builder/features/pages/page-settings.tsx b/apps/builder/app/builder/features/pages/page-settings.tsx
index d58404df94..3dec539ba8 100644
--- a/apps/builder/app/builder/features/pages/page-settings.tsx
+++ b/apps/builder/app/builder/features/pages/page-settings.tsx
@@ -13,7 +13,6 @@ import { useStore } from "@nanostores/react";
import { useDebouncedCallback } from "use-debounce";
import * as bcp47 from "bcp-47";
import slugify from "slugify";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import {
type Page,
type Pages,
@@ -81,20 +80,25 @@ import {
BindingPopover,
} from "~/builder/shared/binding-popover";
import { serverSyncStore } from "~/shared/sync";
-import { SearchPreview } from "./search-preview";
// @todo should be moved to shared because features should not depend on features
import { ImageControl } from "~/builder/features/project-settings";
-import { ImageInfo } from "./image-info";
-import { SocialPreview } from "./social-preview";
// @todo should be moved to shared because features should not depend on features
import { useEffectEvent } from "~/shared/hook-utils/effect-event";
-import { CustomMetadata } from "./custom-metadata";
import {
compilePathnamePattern,
isPathnamePattern,
tokenizePathnamePattern,
validatePathnamePattern,
} from "~/builder/shared/url-pattern";
+import type { UserPlanFeatures } from "~/shared/db/user-plan-features.server";
+import { useUnmount } from "~/shared/hook-utils/use-mount";
+import { selectInstance } from "~/shared/awareness";
+import { computeExpression } from "~/shared/data-variables";
+import { $currentSystem } from "~/shared/system";
+import { Card } from "../marketplace/card";
+import { ImageInfo } from "./image-info";
+import { SearchPreview } from "./search-preview";
+import { SocialPreview } from "./social-preview";
import {
registerFolderChildMutable,
deletePageMutable,
@@ -103,12 +107,7 @@ import {
isPathAvailable,
} from "./page-utils";
import { Form } from "./form";
-import type { UserPlanFeatures } from "~/shared/db/user-plan-features.server";
-import { useUnmount } from "~/shared/hook-utils/use-mount";
-import { Card } from "../marketplace/card";
-import { selectInstance } from "~/shared/awareness";
-import { computeExpression } from "~/shared/data-variables";
-import { $currentSystem } from "~/shared/system";
+import { CustomMetadata } from "./custom-metadata";
const fieldDefaultValues = {
name: "Untitled",
@@ -151,30 +150,6 @@ type Errors = {
[fieldName in FieldName]?: string[];
};
-// @todo needs to be removed
-const LegacyPagePath = z
- .string()
- .refine((path) => path !== "", "Can't be empty")
- .refine((path) => path !== "/", "Can't be just a /")
- .refine((path) => path === "" || path.startsWith("/"), "Must start with a /")
- .refine((path) => path.endsWith("/") === false, "Can't end with a /")
- .refine((path) => path.includes("//") === false, "Can't contain repeating /")
- .refine(
- (path) => /^[-_a-z0-9\\/]*$/.test(path),
- "Only a-z, 0-9, -, _, / are allowed"
- )
- .refine(
- // We use /s for our system stuff like /s/css or /s/uploads
- (path) => path !== "/s" && path.startsWith("/s/") === false,
- "/s prefix is reserved for the system"
- )
- .refine(
- // Remix serves build artefacts like JS bundles from /build
- // And we cannot customize it due to bug in Remix: https://github.com/remix-run/remix/issues/2933
- (path) => path !== "/build" && path.startsWith("/build/") === false,
- "/build prefix is reserved for the system"
- );
-
const EmptyString = z.string().refine((string) => string === "");
// 2xx, 3xx, 4xx, 5xx
@@ -218,7 +193,7 @@ const HomePageValues = SharedPageValues.extend({
});
const PageValues = SharedPageValues.extend({
- path: isFeatureEnabled("cms") ? PagePath : LegacyPagePath,
+ path: PagePath,
});
const validateValues = (
@@ -336,7 +311,7 @@ const PathField = ({
const id = useId();
return (
<Grid gap={1}>
- {allowDynamicData && isFeatureEnabled("cms") ? (
+ {allowDynamicData ? (
<Flex align="center" gap={1}>
<Label htmlFor={id}>Dynamic Path</Label>
<Tooltip
@@ -359,7 +334,7 @@ const PathField = ({
Path is a subset of the URL that looks like this:
&quot;/blog&quot;.
</Text>
- {allowDynamicData === false && isFeatureEnabled("cms") && (
+ {allowDynamicData === false && (
<>
<Text>
To make the path dynamic and use it with CMS, you can use
@@ -836,61 +811,53 @@ const FormFields = ({
/>
)}
- {isFeatureEnabled("cms") && (
- <>
- <StatusField
- errors={errors.status}
- value={values.status}
- onChange={(value) => onChange({ field: "status", value })}
- />
- <RedirectField
- errors={errors.redirect}
- value={values.redirect}
- onChange={(value) => onChange({ field: "redirect", value })}
- />
- {allowDynamicData === false && (
- <PanelBanner>
- <Text>
- Dynamic routing, redirect and status code are a part of the
- CMS functionality.
- </Text>
- <Flex align="center" gap={1}>
- <UploadIcon />
- <Link
- color="inherit"
- target="_blank"
- href="https://webstudio.is/pricing"
- >
- Upgrade to Pro
- </Link>
- </Flex>
- </PanelBanner>
- )}
-
- {isFeatureEnabled("xmlElement") && (
- <Grid gap={1}>
- <Label htmlFor={fieldIds.documentType}>Document Type</Label>
- <Select
- options={documentTypes}
- getValue={(docType: (typeof documentTypes)[number]) =>
- docType
- }
- getLabel={(docType: (typeof documentTypes)[number]) =>
- docType.toLocaleUpperCase()
- }
- value={values.documentType}
- disabled={values.isHomePage}
- onChange={(value) => {
- onChange({
- field: "documentType",
- value,
- });
- }}
- />
- </Grid>
- )}
- </>
+ <StatusField
+ errors={errors.status}
+ value={values.status}
+ onChange={(value) => onChange({ field: "status", value })}
+ />
+ <RedirectField
+ errors={errors.redirect}
+ value={values.redirect}
+ onChange={(value) => onChange({ field: "redirect", value })}
+ />
+ {allowDynamicData === false && (
+ <PanelBanner>
+ <Text>
+ Dynamic routing, redirect and status code are a part of the CMS
+ functionality.
+ </Text>
+ <Flex align="center" gap={1}>
+ <UploadIcon />
+ <Link
+ color="inherit"
+ target="_blank"
+ href="https://webstudio.is/pricing"
+ >
+ Upgrade to Pro
+ </Link>
+ </Flex>
+ </PanelBanner>
)}
+
+ <Grid gap={1}>
+ <Label htmlFor={fieldIds.documentType}>Document Type</Label>
+ <Select
+ options={documentTypes}
+ getValue={(docType: (typeof documentTypes)[number]) => docType}
+ getLabel={(docType: (typeof documentTypes)[number]) =>
+ docType.toLocaleUpperCase()
+ }
+ value={values.documentType}
+ disabled={values.isHomePage}
+ onChange={(value) => {
+ onChange({
+ field: "documentType",
+ value,
+ });
+ }}
+ />
+ </Grid>
</Grid>
<Separator />
@@ -942,28 +909,26 @@ const FormFields = ({
<Grid gap={1}>
<Label htmlFor={fieldIds.title}>Title</Label>
<BindingControl>
- {isFeatureEnabled("cms") && (
- <BindingPopover
- scope={scope}
- aliases={aliases}
- variant={
- isLiteralExpression(values.title) ? "default" : "bound"
- }
- value={values.title}
- onChange={(value) => {
- onChange({
- field: "title",
- value,
- });
- }}
- onRemove={(evaluatedValue) => {
- onChange({
- field: "title",
- value: JSON.stringify(evaluatedValue ?? ""),
- });
- }}
- />
- )}
+ <BindingPopover
+ scope={scope}
+ aliases={aliases}
+ variant={
+ isLiteralExpression(values.title) ? "default" : "bound"
+ }
+ value={values.title}
+ onChange={(value) => {
+ onChange({
+ field: "title",
+ value,
+ });
+ }}
+ onRemove={(evaluatedValue) => {
+ onChange({
+ field: "title",
+ value: JSON.stringify(evaluatedValue ?? ""),
+ });
+ }}
+ />
<InputErrorsTooltip errors={errors.title}>
<InputField
color={errors.title && "error"}
@@ -986,30 +951,28 @@ const FormFields = ({
<Grid gap={1}>
<Label htmlFor={fieldIds.description}>Description</Label>
<BindingControl>
- {isFeatureEnabled("cms") && (
- <BindingPopover
- scope={scope}
- aliases={aliases}
- variant={
- isLiteralExpression(values.description)
- ? "default"
- : "bound"
- }
- value={values.description}
- onChange={(value) => {
- onChange({
- field: "description",
- value,
- });
- }}
- onRemove={(evaluatedValue) => {
- onChange({
- field: "description",
- value: JSON.stringify(evaluatedValue ?? ""),
- });
- }}
- />
- )}
+ <BindingPopover
+ scope={scope}
+ aliases={aliases}
+ variant={
+ isLiteralExpression(values.description)
+ ? "default"
+ : "bound"
+ }
+ value={values.description}
+ onChange={(value) => {
+ onChange({
+ field: "description",
+ value,
+ });
+ }}
+ onRemove={(evaluatedValue) => {
+ onChange({
+ field: "description",
+ value: JSON.stringify(evaluatedValue ?? ""),
+ });
+ }}
+ />
<InputErrorsTooltip errors={errors.description}>
<TextArea
color={errors.description ? "error" : undefined}
@@ -1036,30 +999,28 @@ const FormFields = ({
align={"center"}
css={{ py: theme.spacing[2] }}
>
- {isFeatureEnabled("cms") && (
- <BindingPopover
- scope={scope}
- aliases={aliases}
- variant={
- isLiteralExpression(values.excludePageFromSearch)
- ? "default"
- : "bound"
- }
- value={values.excludePageFromSearch}
- onChange={(value) => {
- onChange({
- field: "excludePageFromSearch",
- value,
- });
- }}
- onRemove={(evaluatedValue) => {
- onChange({
- field: "excludePageFromSearch",
- value: JSON.stringify(evaluatedValue ?? ""),
- });
- }}
- />
- )}
+ <BindingPopover
+ scope={scope}
+ aliases={aliases}
+ variant={
+ isLiteralExpression(values.excludePageFromSearch)
+ ? "default"
+ : "bound"
+ }
+ value={values.excludePageFromSearch}
+ onChange={(value) => {
+ onChange({
+ field: "excludePageFromSearch",
+ value,
+ });
+ }}
+ onRemove={(evaluatedValue) => {
+ onChange({
+ field: "excludePageFromSearch",
+ value: JSON.stringify(evaluatedValue ?? ""),
+ });
+ }}
+ />
<Checkbox
id={fieldIds.excludePageFromSearch}
disabled={
@@ -1085,13 +1046,11 @@ const FormFields = ({
</BindingControl>
</Grid>
- {isFeatureEnabled("cms") && (
- <LanguageField
- errors={errors.language}
- value={values.language}
- onChange={(value) => onChange({ field: "language", value })}
- />
- )}
+ <LanguageField
+ errors={errors.language}
+ value={values.language}
+ onChange={(value) => onChange({ field: "language", value })}
+ />
</Grid>
<Separator />
@@ -1109,49 +1068,47 @@ const FormFields = ({
Project Settings will be used. The optimal dimensions for the
image are 1200x630 px or larger with a 1.91:1 aspect ratio.
</Text>
- {isFeatureEnabled("cms") && (
- <BindingControl>
- <BindingPopover
- scope={scope}
- aliases={aliases}
- variant={
- isLiteralExpression(values.socialImageUrl)
- ? "default"
- : "bound"
+ <BindingControl>
+ <BindingPopover
+ scope={scope}
+ aliases={aliases}
+ variant={
+ isLiteralExpression(values.socialImageUrl)
+ ? "default"
+ : "bound"
+ }
+ value={values.socialImageUrl}
+ onChange={(value) => {
+ onChange({
+ field: "socialImageUrl",
+ value,
+ });
+ }}
+ onRemove={(evaluatedValue) => {
+ onChange({
+ field: "socialImageUrl",
+ value: JSON.stringify(evaluatedValue ?? ""),
+ });
+ }}
+ />
+ <InputErrorsTooltip errors={errors.socialImageUrl}>
+ <InputField
+ placeholder="https://www.url.com"
+ disabled={
+ isLiteralExpression(values.socialImageUrl) === false
}
- value={values.socialImageUrl}
- onChange={(value) => {
- onChange({
- field: "socialImageUrl",
- value,
- });
- }}
- onRemove={(evaluatedValue) => {
+ color={errors.socialImageUrl && "error"}
+ value={socialImageUrl}
+ onChange={(event) => {
onChange({
field: "socialImageUrl",
- value: JSON.stringify(evaluatedValue ?? ""),
+ value: JSON.stringify(event.target.value),
});
+ onChange({ field: "socialImageAssetId", value: "" });
}}
/>
- <InputErrorsTooltip errors={errors.socialImageUrl}>
- <InputField
- placeholder="https://www.url.com"
- disabled={
- isLiteralExpression(values.socialImageUrl) === false
- }
- color={errors.socialImageUrl && "error"}
- value={socialImageUrl}
- onChange={(event) => {
- onChange({
- field: "socialImageUrl",
- value: JSON.stringify(event.target.value),
- });
- onChange({ field: "socialImageAssetId", value: "" });
- }}
- />
- </InputErrorsTooltip>
- </BindingControl>
- )}
+ </InputErrorsTooltip>
+ </BindingControl>
<Grid gap={1} flow={"column"}>
<ImageControl
onAssetIdChange={(socialImageAssetId) => {
diff --git a/apps/builder/app/builder/features/style-panel/style-panel.tsx b/apps/builder/app/builder/features/style-panel/style-panel.tsx
index 705c535122..6a7cf91f77 100644
--- a/apps/builder/app/builder/features/style-panel/style-panel.tsx
+++ b/apps/builder/app/builder/features/style-panel/style-panel.tsx
@@ -1,3 +1,6 @@
+import { useState } from "react";
+import { computed } from "nanostores";
+import { useStore } from "@nanostores/react";
import {
theme,
Box,
@@ -18,24 +21,20 @@ import {
DropdownMenuSeparator,
DropdownMenuItem,
} from "@webstudio-is/design-system";
-import { useStore } from "@nanostores/react";
-import { computed } from "nanostores";
-import { StyleSourcesSection } from "./style-source-section";
-import { $selectedInstanceRenderState } from "~/shared/nano-states";
-import { sections } from "./sections";
import { toValue } from "@webstudio-is/css-engine";
-import { $instanceTags, useParentComputedStyleDecl } from "./shared/model";
+import { EllipsesIcon } from "@webstudio-is/icons";
+import { $selectedInstanceRenderState } from "~/shared/nano-states";
import { $selectedInstance } from "~/shared/awareness";
import { CollapsibleProvider } from "~/builder/shared/collapsible-section";
-import { EllipsesIcon } from "@webstudio-is/icons";
import {
$settings,
getSetting,
setSetting,
type Settings,
} from "~/builder/shared/client-settings";
-import { useState } from "react";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
+import { sections } from "./sections";
+import { StyleSourcesSection } from "./style-source-section";
+import { $instanceTags, useParentComputedStyleDecl } from "./shared/model";
const $selectedInstanceTag = computed(
[$selectedInstance, $instanceTags],
@@ -85,18 +84,16 @@ export const ModeMenu = () => {
<Kbd value={["alt", "shift", "s"]} />
</Flex>
</DropdownMenuRadioItem>
- {isFeatureEnabled("stylePanelAdvancedMode") && (
- <DropdownMenuRadioItem
- value="advanced"
- icon={<MenuCheckedIcon />}
- onFocus={() => setFocusedValue("advanced")}
- >
- <Flex justify="between" grow>
- <Text variant="labelsTitleCase">Advanced mode</Text>
- <Kbd value={["alt", "shift", "a"]} />
- </Flex>
- </DropdownMenuRadioItem>
- )}
+ <DropdownMenuRadioItem
+ value="advanced"
+ icon={<MenuCheckedIcon />}
+ onFocus={() => setFocusedValue("advanced")}
+ >
+ <Flex justify="between" grow>
+ <Text variant="labelsTitleCase">Advanced mode</Text>
+ <Kbd value={["alt", "shift", "a"]} />
+ </Flex>
+ </DropdownMenuRadioItem>
</DropdownMenuRadioGroup>
<DropdownMenuSeparator />
diff --git a/apps/builder/app/builder/features/topbar/builder-mode.tsx b/apps/builder/app/builder/features/topbar/builder-mode.tsx
index f4fbfb27a2..4201e395bc 100644
--- a/apps/builder/app/builder/features/topbar/builder-mode.tsx
+++ b/apps/builder/app/builder/features/topbar/builder-mode.tsx
@@ -1,3 +1,4 @@
+import { useState } from "react";
import { useStore } from "@nanostores/react";
import {
ChevronDownIcon,
@@ -31,8 +32,6 @@ import {
isBuilderMode,
setBuilderMode,
} from "~/shared/nano-states";
-import { useState } from "react";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
import { emitCommand } from "~/builder/shared/commands";
export const BuilderModeDropDown = () => {
@@ -53,7 +52,7 @@ export const BuilderModeDropDown = () => {
description: "Modify the page content",
title: "Content",
shortcut: ["cmd", "shift", "c"],
- enabled: isContentModeAllowed && isFeatureEnabled("contentEditableMode"),
+ enabled: isContentModeAllowed,
},
} as const;
diff --git a/apps/builder/app/builder/features/workspace/canvas-tools/outline/block-instance-outline.tsx b/apps/builder/app/builder/features/workspace/canvas-tools/outline/block-instance-outline.tsx
index 9da74b2bb1..2b1af99247 100644
--- a/apps/builder/app/builder/features/workspace/canvas-tools/outline/block-instance-outline.tsx
+++ b/apps/builder/app/builder/features/workspace/canvas-tools/outline/block-instance-outline.tsx
@@ -1,16 +1,5 @@
+import { useRef, useState } from "react";
import { useStore } from "@nanostores/react";
-import {
- $blockChildOutline,
- $hoveredInstanceOutline,
- $hoveredInstanceSelector,
- $instances,
- $isContentMode,
- $modifierKeys,
- $registeredComponentMetas,
- findBlockSelector,
- findTemplates,
- type BlockChildOutline,
-} from "~/shared/nano-states";
import {
Box,
DropdownMenu,
@@ -28,27 +17,34 @@ import {
DropdownMenuSeparator,
menuItemCss,
} from "@webstudio-is/design-system";
-import { Outline } from "./outline";
-import { applyScale } from "./apply-scale";
-import { $clampingRect, $scale } from "~/builder/shared/nano-states";
+import type { Instance } from "@webstudio-is/sdk";
import { PlusIcon, TrashIcon } from "@webstudio-is/icons";
import { BoxIcon } from "@webstudio-is/icons/svg";
-import { useRef, useState } from "react";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
+import {
+ $blockChildOutline,
+ $hoveredInstanceOutline,
+ $hoveredInstanceSelector,
+ $instances,
+ $isContentMode,
+ $modifierKeys,
+ $registeredComponentMetas,
+ findBlockSelector,
+ findTemplates,
+ type BlockChildOutline,
+} from "~/shared/nano-states";
+import { $clampingRect, $scale } from "~/builder/shared/nano-states";
import type { InstanceSelector } from "~/shared/tree-utils";
-import type { Instance } from "@webstudio-is/sdk";
-
import {
deleteInstanceMutable,
updateWebstudioData,
} from "~/shared/instance-utils";
-
import { MetaIcon } from "~/builder/shared/meta-icon";
import { skipInertHandlersAttribute } from "~/builder/shared/inert-handlers";
-
-import { insertTemplateAt } from "./block-utils";
import { useEffectEvent } from "~/shared/hook-utils/effect-event";
import { getInstancePath } from "~/shared/awareness";
+import { insertTemplateAt } from "./block-utils";
+import { Outline } from "./outline";
+import { applyScale } from "./apply-scale";
export const TemplatesMenu = ({
onOpenChange,
@@ -252,10 +248,6 @@ export const BlockChildHoveredInstanceOutline = () => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
- if (isFeatureEnabled("contentEditableMode") === false) {
- return;
- }
-
if (!isContentMode) {
return;
}
diff --git a/apps/builder/app/builder/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx b/apps/builder/app/builder/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx
index 59f52e99fd..8529466fbb 100644
--- a/apps/builder/app/builder/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx
+++ b/apps/builder/app/builder/features/workspace/canvas-tools/outline/hovered-instance-outline.tsx
@@ -1,3 +1,4 @@
+import { shallowEqual } from "shallow-equal";
import { useStore } from "@nanostores/react";
import {
$blockChildOutline,
@@ -7,14 +8,12 @@ import {
$isContentMode,
$textEditingInstanceSelector,
} from "~/shared/nano-states";
-import { Outline } from "./outline";
-import { Label } from "./label";
-import { applyScale } from "./apply-scale";
import { $clampingRect, $scale } from "~/builder/shared/nano-states";
import { findClosestSlot } from "~/shared/instance-utils";
-import { shallowEqual } from "shallow-equal";
import { isDescendantOrSelf } from "~/shared/tree-utils";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
+import { Outline } from "./outline";
+import { Label } from "./label";
+import { applyScale } from "./apply-scale";
export const HoveredInstanceOutline = () => {
const instances = useStore($instances);
@@ -34,7 +33,7 @@ export const HoveredInstanceOutline = () => {
return;
}
- if (isFeatureEnabled("contentEditableMode") && isContentMode) {
+ if (isContentMode) {
if (shallowEqual(blockChildOutline?.selector, hoveredInstanceSelector)) {
return;
}
diff --git a/apps/builder/app/shared/share-project/share-project.tsx b/apps/builder/app/shared/share-project/share-project.tsx
index 1e7faefda4..ad9b399a35 100644
--- a/apps/builder/app/shared/share-project/share-project.tsx
+++ b/apps/builder/app/shared/share-project/share-project.tsx
@@ -1,3 +1,10 @@
+import {
+ Fragment,
+ useId,
+ useState,
+ type ComponentProps,
+ type ReactNode,
+} from "react";
import {
Box,
Button,
@@ -28,16 +35,8 @@ import {
PlusIcon,
InfoCircleIcon,
} from "@webstudio-is/icons";
-import {
- Fragment,
- useId,
- useState,
- type ComponentProps,
- type ReactNode,
-} from "react";
-import { useIds } from "../form-utils";
import { CopyToClipboard } from "~/builder/shared/copy-to-clipboard";
-import { isFeatureEnabled } from "@webstudio-is/feature-flags";
+import { useIds } from "../form-utils";
import type { BuilderMode } from "../nano-states";
const Item = (props: ComponentProps<typeof Flex>) => (
@@ -238,73 +237,65 @@ const Menu = ({ name, hasProPlan, value, onChange, onDelete }: MenuProps) => {
</Grid>
</Grid>
- {isFeatureEnabled("contentEditableMode") && (
- <>
- <Permission
- disabled={hasProPlan !== true}
- onCheckedChange={handleCheckedChange("editors")}
- checked={value.relation === "editors"}
- title="Content"
- info={
- <Flex direction="column">
- Recipients can edit content only, such as text, images, and
- predefined components.
- {hasProPlan !== true && (
- <>
- <br />
- <br />
- Upgrade to a Pro account to share with Content Edit
- permissions.
- <br /> <br />
- <Link
- className={buttonStyle({ color: "gradient" })}
- color="contrast"
- underline="none"
- href="https://webstudio.is/pricing"
- target="_blank"
- >
- Upgrade
- </Link>
- </>
- )}
- </Flex>
- }
- />
- <Grid
- css={{
- ml: theme.spacing[6],
+ <Permission
+ disabled={hasProPlan !== true}
+ onCheckedChange={handleCheckedChange("editors")}
+ checked={value.relation === "editors"}
+ title="Content"
+ info={
+ <Flex direction="column">
+ Recipients can edit content only, such as text, images, and
+ predefined components.
+ {hasProPlan !== true && (
+ <>
+ <br />
+ <br />
+ Upgrade to a Pro account to share with Content Edit
+ permissions.
+ <br /> <br />
+ <Link
+ className={buttonStyle({ color: "gradient" })}
+ color="contrast"
+ underline="none"
+ href="https://webstudio.is/pricing"
+ target="_blank"
+ >
+ Upgrade
+ </Link>
+ </>
+ )}
+ </Flex>
+ }
+ />
+ <Grid
+ css={{
+ ml: theme.spacing[6],
+ }}
+ >
+ <Grid
+ gap={1}
+ flow={"column"}
+ css={{
+ alignItems: "center",
+ justifyContent: "start",
+ }}
+ >
+ <Checkbox
+ disabled={hasProPlan !== true || value.relation !== "editors"}
+ checked={value.canPublish}
+ onCheckedChange={(canPublish) => {
+ onChange({ ...value, canPublish: Boolean(canPublish) });
}}
+ id={ids.canPublish}
+ />
+ <Label
+ htmlFor={ids.canPublish}
+ disabled={hasProPlan !== true || value.relation !== "editors"}
>
- <Grid
- gap={1}
- flow={"column"}
- css={{
- alignItems: "center",
- justifyContent: "start",
- }}
- >
- <Checkbox
- disabled={
- hasProPlan !== true || value.relation !== "editors"
- }
- checked={value.canPublish}
- onCheckedChange={(canPublish) => {
- onChange({ ...value, canPublish: Boolean(canPublish) });
- }}
- id={ids.canPublish}
- />
- <Label
- htmlFor={ids.canPublish}
- disabled={
- hasProPlan !== true || value.relation !== "editors"
- }
- >
- Can publish
- </Label>
- </Grid>
- </Grid>
- </>
- )}
+ Can publish
+ </Label>
+ </Grid>
+ </Grid>
<Permission
onCheckedChange={handleCheckedChange("builders")}
diff --git a/packages/feature-flags/src/flags.ts b/packages/feature-flags/src/flags.ts
index 756ab10915..54f6483eb2 100644
--- a/packages/feature-flags/src/flags.ts
+++ b/packages/feature-flags/src/flags.ts
@@ -2,11 +2,4 @@
export const internalComponents = false;
export const unsupportedBrowsers = false;
export const aiRadixComponents = false;
-export const cms = false;
-export const filters = false;
-export const xmlElement = false;
-export const contentEditableMode = false;
-export const command = false;
-export const headSlotComponent = false;
-export const stylePanelAdvancedMode = false;
export const animation = false;