Skip to content

Commit

Permalink
experimental: Head Slot Icons (#4770)
Browse files Browse the repository at this point in the history
## Description

<img width="255" alt="image"
src="https://github.com/user-attachments/assets/85782344-e992-4f13-a26c-53970136b2ff"
/>

<img width="242" alt="image"
src="https://github.com/user-attachments/assets/d2446c2d-011f-4363-ae35-0a79c66bbbad"
/>


-  additionally replaced blockquote icon
- changed the order of the components in general

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
  • Loading branch information
kof authored Jan 22, 2025
1 parent 7376743 commit 627ab09
Show file tree
Hide file tree
Showing 16 changed files with 213 additions and 36 deletions.
13 changes: 3 additions & 10 deletions packages/icons/icons/blockquote.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions packages/icons/icons/content-embed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion packages/icons/icons/markdown-embed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions packages/icons/icons/resource.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions packages/icons/icons/window-info.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions packages/icons/icons/window-title.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
99 changes: 92 additions & 7 deletions packages/icons/src/__generated__/components.tsx

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 9 additions & 3 deletions packages/icons/src/__generated__/svg.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/sdk-components-react/src/code-text.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const meta: WsComponentMeta = {
},
states: defaultStates,
presetStyle,
order: 9,
order: 5,
};

export const propsMeta: WsComponentPropsMeta = {
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-components-react/src/head-link.ws.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link2Icon } from "@webstudio-is/icons/svg";
import { ResourceIcon } from "@webstudio-is/icons/svg";
import {
type WsComponentMeta,
type WsComponentPropsMeta,
Expand All @@ -8,7 +8,7 @@ import { props } from "./__generated__/head-link.props";

export const meta: WsComponentMeta = {
category: "hidden",
icon: Link2Icon,
icon: ResourceIcon,
type: "container",
stylable: false,
constraints: {
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-components-react/src/head-meta.ws.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link2Icon } from "@webstudio-is/icons/svg";
import { WindowInfoIcon } from "@webstudio-is/icons/svg";
import {
type WsComponentMeta,
type WsComponentPropsMeta,
Expand All @@ -8,7 +8,7 @@ import { props } from "./__generated__/head-meta.props";

export const meta: WsComponentMeta = {
category: "hidden",
icon: Link2Icon,
icon: WindowInfoIcon,
type: "container",
stylable: false,
constraints: {
Expand Down
5 changes: 3 additions & 2 deletions packages/sdk-components-react/src/head-slot.template.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ import { type TemplateMeta, $ } from "@webstudio-is/template";

export const meta: TemplateMeta = {
category: "general",
description: "Head",
order: 4,
description:
"The Head Slot component lets you customize page-specific head elements (like canonical URLs), which merge with your site's global head settings, with Head Slot definitions taking priority over Page Settings. For site-wide head changes, use Project Settings instead.",
order: 6,
template: (
<$.HeadSlot>
<$.HeadTitle ws:label="Title">Title</$.HeadTitle>
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk-components-react/src/head-title.ws.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link2Icon } from "@webstudio-is/icons/svg";
import { WindowTitleIcon } from "@webstudio-is/icons/svg";
import {
type WsComponentMeta,
type WsComponentPropsMeta,
Expand All @@ -8,7 +8,7 @@ import { props } from "./__generated__/head-title.props";

export const meta: WsComponentMeta = {
category: "hidden",
icon: Link2Icon,
icon: WindowTitleIcon,
type: "container",
stylable: false,
constraints: {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-react/src/html-embed.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const meta: WsComponentMeta = {
description: "Used to add HTML code to the page, such as an SVG or script.",
icon: EmbedIcon,
presetStyle,
order: 8,
order: 2,
};

export const propsMeta: WsComponentPropsMeta = {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-react/src/separator.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const meta: WsComponentMeta = {
icon: MinusIcon,
states: defaultStates,
presetStyle,
order: 5,
order: 3,
};

export const propsMeta: WsComponentPropsMeta = {
Expand Down
2 changes: 1 addition & 1 deletion packages/sdk-components-react/src/slot.ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export const meta: WsComponentMeta = {
"Slot is a container for content that you want to reference across the project. Changes made to a Slot's children will be reflected in all other instances of that Slot.",
icon: SlotComponentIcon,
stylable: false,
order: 6,
order: 5,
};

export const propsMeta: WsComponentPropsMeta = {
Expand Down

0 comments on commit 627ab09

Please sign in to comment.