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.

experimental: Animations section, new component names, new icons (#5062)

Oleg Isonen64dde50c70f6
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 3e81b0135e..cfff717c0d 100644
--- a/apps/builder/app/builder/features/command-panel/command-panel.tsx
+++ b/apps/builder/app/builder/features/command-panel/command-panel.tsx
@@ -45,6 +45,7 @@ import { mapGroupBy } from "~/shared/shim";
import { setActiveSidebarPanel } from "~/builder/shared/nano-states";
import { $commandMetas } from "~/shared/commands-emitter";
import { emitCommand } from "~/builder/shared/commands";
+import { isFeatureEnabled } from "@webstudio-is/feature-flags";
const $commandPanel = atom<
| undefined
@@ -103,6 +104,12 @@ const $componentOptions = computed(
if (category === "hidden" || category === "internal") {
continue;
}
+ if (
+ category === "animations" &&
+ isFeatureEnabled("animation") === false
+ ) {
+ continue;
+ }
// show only xml category and collection component in xml documents
if (selectedPage?.meta.documentType === "xml") {
if (category !== "xml" && name !== collectionComponent) {
diff --git a/packages/icons/icons/animation-group.svg b/packages/icons/icons/animation-group.svg
new file mode 100644
index 0000000000..6b0e451285
--- /dev/null
+++ b/packages/icons/icons/animation-group.svg
@@ -0,0 +1,20 @@
+<svg
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+>
+ <path
+ d="M4.5 8.3C6.3 7.7 7.8 8 9.3 11C9.6 9.2 10.5 6.5 11.4 5"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ <path
+ d="M4.20833 1.5H2.94444C2.56135 1.5 2.19395 1.65218 1.92307 1.92307C1.65218 2.19395 1.5 2.56135 1.5 2.94444V4.20833M14.5 4.20833V2.94444C14.5 2.56135 14.3478 2.19395 14.0769 1.92307C13.806 1.65218 13.4386 1.5 13.0555 1.5H11.7917M14.5 13.0556C14.5 13.0787 14.4994 13.1018 14.4983 13.1248M11.7917 14.5H13.0555C13.4386 14.5 13.806 14.3478 14.0769 14.0769C14.3315 13.8224 14.4812 13.4827 14.4983 13.1248M14.4983 13.1248V11.7917M1.5 11.7917V13.0556C1.5 13.4386 1.65218 13.806 1.92307 14.0769C2.19395 14.3478 2.56135 14.5 2.94444 14.5H4.20833M6.91667 1.5H9.08333M6.91667 14.5H9.08333M1.5 6.91667V9.08333M14.5 6.91667V9.08333"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+</svg>
diff --git a/packages/icons/icons/text-animation.svg b/packages/icons/icons/text-animation.svg
new file mode 100644
index 0000000000..f79ad5944f
--- /dev/null
+++ b/packages/icons/icons/text-animation.svg
@@ -0,0 +1,20 @@
+<svg
+ width="16"
+ height="16"
+ viewBox="0 0 16 16"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+>
+ <path
+ d="M7.47647 4.30036L7.8172 3L14.7524 4.81721L14.4117 6.11757M8.16724 10.5031L10.768 11.1846M11.2848 3.9086L9.4676 10.8438"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+ <path
+ d="M2 9.9375V9H7V9.9375M3.56249 14H5.43749M4.49999 9V14"
+ stroke="currentColor"
+ stroke-linecap="round"
+ stroke-linejoin="round"
+ />
+</svg>
diff --git a/packages/icons/src/__generated__/components.tsx b/packages/icons/src/__generated__/components.tsx
index 09c7a84d17..f0c017f94b 100644
--- a/packages/icons/src/__generated__/components.tsx
+++ b/packages/icons/src/__generated__/components.tsx
@@ -746,6 +746,30 @@ export const AlignStartHorizontalIcon: IconComponent = forwardRef(
);
AlignStartHorizontalIcon.displayName = "AlignStartHorizontalIcon";
+export const AnimationGroupIcon: IconComponent = forwardRef(
+ ({ fill = "none", size = 16, ...props }, forwardedRef) => {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 16 16"
+ width={size}
+ height={size}
+ fill={fill}
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M4.5 8.3C6.3 7.7 7.8 8 9.3 11c.3-1.8 1.2-4.5 2.1-6M4.208 1.5H2.944A1.444 1.444 0 0 0 1.5 2.944v1.264m13 0V2.944A1.444 1.444 0 0 0 13.056 1.5h-1.264M14.5 13.056c0 .023 0 .046-.002.069M11.792 14.5h1.264a1.444 1.444 0 0 0 1.442-1.375m0 0v-1.333m-12.998 0v1.264A1.444 1.444 0 0 0 2.944 14.5h1.264m2.709-13h2.166m-2.166 13h2.166M1.5 6.917v2.166m13-2.166v2.166"
+ />
+ </svg>
+ );
+ }
+);
+AnimationGroupIcon.displayName = "AnimationGroupIcon";
+
export const ArrowDownIcon: IconComponent = forwardRef(
({ fill = "none", size = 16, ...props }, forwardedRef) => {
return (
@@ -4604,6 +4628,30 @@ export const TextAlignRightIcon: IconComponent = forwardRef(
);
TextAlignRightIcon.displayName = "TextAlignRightIcon";
+export const TextAnimationIcon: IconComponent = forwardRef(
+ ({ fill = "none", size = 16, ...props }, forwardedRef) => {
+ return (
+ <svg
+ xmlns="http://www.w3.org/2000/svg"
+ viewBox="0 0 16 16"
+ width={size}
+ height={size}
+ fill={fill}
+ {...props}
+ ref={forwardedRef}
+ >
+ <path
+ stroke="currentColor"
+ strokeLinecap="round"
+ strokeLinejoin="round"
+ d="M7.476 4.3 7.817 3l6.935 1.817-.34 1.3m-6.245 4.386 2.601.682m.517-7.276-1.817 6.935M2 9.938V9h5v.938M3.562 14h1.875M4.5 9v5"
+ />
+ </svg>
+ );
+ }
+);
+TextAnimationIcon.displayName = "TextAnimationIcon";
+
export const TextCapitalizeIcon: IconComponent = forwardRef(
({ fill = "none", size = 16, ...props }, forwardedRef) => {
return (
diff --git a/packages/icons/src/__generated__/svg.ts b/packages/icons/src/__generated__/svg.ts
index f18a242776..f7f9447391 100644
--- a/packages/icons/src/__generated__/svg.ts
+++ b/packages/icons/src/__generated__/svg.ts
@@ -50,6 +50,8 @@ export const AlignSelfStretchIcon = `<svg xmlns="http://www.w3.org/2000/svg" fil
export const AlignStartHorizontalIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M5.4 4.097H4.1c-.72 0-1.302.582-1.302 1.3v7.807c0 .719.583 1.301 1.301 1.301H5.4c.719 0 1.301-.582 1.301-1.3V5.397c0-.719-.582-1.301-1.3-1.301ZM11.906 4.097h-1.301c-.719 0-1.301.582-1.301 1.3v3.254c0 .718.582 1.3 1.3 1.3h1.302c.718 0 1.3-.582 1.3-1.3V5.398c0-.719-.582-1.301-1.3-1.301ZM1.5 2h13"/></svg>`;
+export const AnimationGroupIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M4.5 8.3C6.3 7.7 7.8 8 9.3 11c.3-1.8 1.2-4.5 2.1-6M4.208 1.5H2.944A1.444 1.444 0 0 0 1.5 2.944v1.264m13 0V2.944A1.444 1.444 0 0 0 13.056 1.5h-1.264M14.5 13.056c0 .023 0 .046-.002.069M11.792 14.5h1.264a1.444 1.444 0 0 0 1.442-1.375m0 0v-1.333m-12.998 0v1.264A1.444 1.444 0 0 0 2.944 14.5h1.264m2.709-13h2.166m-2.166 13h2.166M1.5 6.917v2.166m13-2.166v2.166"/></svg>`;
+
export const ArrowDownIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M8 3.333v9.334M12.667 8 8 12.667 3.333 8"/></svg>`;
export const ArrowLeftIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M12.667 8H3.333M8 3.333 3.333 8 8 12.667"/></svg>`;
@@ -340,6 +342,8 @@ export const TextAlignLeftIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="
export const TextAlignRightIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path fill="currentColor" fill-rule="evenodd" d="M2 3.5a.5.5 0 0 0 0 1h12a.5.5 0 0 0 0-1H2ZM5.5 8a.5.5 0 0 1 .5-.5h8a.5.5 0 0 1 0 1H6a.5.5 0 0 1-.5-.5Zm-1.333 4a.5.5 0 0 1 .5-.5H14a.5.5 0 0 1 0 1H4.667a.5.5 0 0 1-.5-.5Z" clip-rule="evenodd"/></svg>`;
+export const TextAnimationIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M7.476 4.3 7.817 3l6.935 1.817-.34 1.3m-6.245 4.386 2.601.682m.517-7.276-1.817 6.935M2 9.938V9h5v.938M3.562 14h1.875M4.5 9v5"/></svg>`;
+
export const TextCapitalizeIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M1.5 10.889 4.389 5.11l2.889 5.778M2.222 9.444h4.334M12.333 10.889a2.167 2.167 0 1 0 0-4.334 2.167 2.167 0 0 0 0 4.334ZM14.5 6.556v4.333"/></svg>`;
export const TextItalicIcon = `<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 16 16" width="100%" height="100%" style="display: block;"><path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" d="M12.667 2.667h-6M9.333 13.333h-6M10 2.667 6 13.333"/></svg>`;
diff --git a/packages/sdk-components-animation/src/animate-children.ws.ts b/packages/sdk-components-animation/src/animate-children.ws.ts
index e5dba50d36..361b4cbcd8 100644
--- a/packages/sdk-components-animation/src/animate-children.ws.ts
+++ b/packages/sdk-components-animation/src/animate-children.ws.ts
@@ -1,13 +1,13 @@
-import { SlotComponentIcon } from "@webstudio-is/icons/svg";
+import { AnimationGroupIcon } from "@webstudio-is/icons/svg";
import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
export const meta: WsComponentMeta = {
- category: "general",
+ category: "animations",
type: "container",
- description: "Animate Children",
- icon: SlotComponentIcon,
+ description: "Animation Group component is designed to animate its children.",
+ icon: AnimationGroupIcon,
order: 5,
- label: "Animate Children",
+ label: "Animation Group",
constraints: {
relation: "child",
text: false,
diff --git a/packages/sdk-components-animation/src/animate-text.ws.ts b/packages/sdk-components-animation/src/animate-text.ws.ts
index 6fd02eea52..fb723dfd4f 100644
--- a/packages/sdk-components-animation/src/animate-text.ws.ts
+++ b/packages/sdk-components-animation/src/animate-text.ws.ts
@@ -1,14 +1,15 @@
-import { TextIcon } from "@webstudio-is/icons/svg";
+import { TextAnimationIcon } from "@webstudio-is/icons/svg";
import type { WsComponentMeta, WsComponentPropsMeta } from "@webstudio-is/sdk";
import { props } from "./__generated__/animate-text.props";
export const meta: WsComponentMeta = {
- category: "general",
+ category: "animations",
type: "container",
- description: "Animate Text",
- icon: TextIcon,
+ description:
+ "Text animation allows you to split text by char or by word to animate it.",
+ icon: TextAnimationIcon,
order: 6,
- label: "Animate Text",
+ label: "Text Animation",
constraints: [
{ relation: "parent", component: { $eq: "AnimateChildren" } },
{
diff --git a/packages/sdk/src/schema/component-meta.ts b/packages/sdk/src/schema/component-meta.ts
index 1a2f31d26a..cfe9028228 100644
--- a/packages/sdk/src/schema/component-meta.ts
+++ b/packages/sdk/src/schema/component-meta.ts
@@ -36,6 +36,7 @@ export const componentCategories = [
"general",
"typography",
"media",
+ "animations",
"data",
"forms",
"localization",
diff --git a/packages/template/src/template.ts b/packages/template/src/template.ts
index 4843606c98..9ccf49d5ee 100644
--- a/packages/template/src/template.ts
+++ b/packages/template/src/template.ts
@@ -5,6 +5,7 @@ export const templateCategories = [
"general",
"typography",
"media",
+ "animations",
"data",
"forms",
"localization",