Skip to content

Commit 0219de6

Browse files
authored
feat: Built with webstudio badge (#5243)
## Description 1. What is this PR about (link the issue and add a short description) ## 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
1 parent 14e6ced commit 0219de6

File tree

3 files changed

+68
-1
lines changed

3 files changed

+68
-1
lines changed

packages/sdk/src/core-templates.tsx

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import {
77
ws,
88
type TemplateMeta,
99
} from "@webstudio-is/template";
10-
import { CheckboxCheckedIcon, RadioCheckedIcon } from "@webstudio-is/icons/svg";
10+
import {
11+
CheckboxCheckedIcon,
12+
RadioCheckedIcon,
13+
Webstudio1cIcon,
14+
} from "@webstudio-is/icons/svg";
1115
import {
1216
blockComponent,
1317
collectionComponent,
@@ -350,6 +354,66 @@ const forms: Record<string, TemplateMeta> = {
350354
},
351355
};
352356

357+
const builtWithWebstudioMeta: TemplateMeta = {
358+
category: "other",
359+
description:
360+
"A “Built with Webstudio” badge should be added to every project page on the free plan. This helps Webstudio spread awareness as a platform.",
361+
icon: Webstudio1cIcon,
362+
template: (
363+
<ws.element
364+
ws:tag="a"
365+
ws:label="Built with Webstudio"
366+
href="https://webstudio.is"
367+
target="_blank"
368+
ws:style={css`
369+
display: inline-flex;
370+
gap: 6px;
371+
align-items: center;
372+
justify-content: center;
373+
position: fixed;
374+
z-index: 1000;
375+
padding: 6px 10px;
376+
right: 16px;
377+
bottom: 16px;
378+
color: rgba(251, 252, 253, 1);
379+
font-family: system-ui, sans-serif;
380+
font-size: 12px;
381+
font-weight: 500;
382+
line-height: 1;
383+
border: 1px solid transparent;
384+
border-radius: 9px;
385+
text-decoration-line: none;
386+
text-wrap-mode: nowrap;
387+
background-clip: padding-box, border-box;
388+
background-origin: padding-box, border-box;
389+
background-image:
390+
linear-gradient(135deg, #4a4efa 0%, #bd2fdb 66%, #ec59ce 100%),
391+
linear-gradient(
392+
135deg,
393+
#92fddc 0%,
394+
#7d7ffb 31.94%,
395+
#ed72fe 64.24%,
396+
#fdd791 100%
397+
);
398+
`}
399+
>
400+
<$.HtmlEmbed
401+
ws:label="Logo"
402+
code={Webstudio1cIcon}
403+
ws:style={css`
404+
display: block;
405+
width: 16px;
406+
height: 16px;
407+
flex-shrink: 0;
408+
`}
409+
></$.HtmlEmbed>
410+
<ws.element ws:tag="div" ws:label="Text">
411+
Built with Webstudio
412+
</ws.element>
413+
</ws.element>
414+
),
415+
};
416+
353417
export const coreTemplates = {
354418
[elementComponent]: elementMeta,
355419
link: linkMeta,
@@ -358,4 +422,5 @@ export const coreTemplates = {
358422
[blockComponent]: blockMeta,
359423
...typography,
360424
...forms,
425+
builtWithWebstudio: builtWithWebstudioMeta,
361426
};

packages/sdk/src/schema/component-meta.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ export const componentCategories = [
3131
"localization",
3232
"radix",
3333
"xml",
34+
"other",
3435
"hidden",
3536
"internal",
3637
] as const;

packages/template/src/template.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export const templateCategories = [
1111
"localization",
1212
"radix",
1313
"xml",
14+
"other",
1415
"hidden",
1516
"internal",
1617
] as const;

0 commit comments

Comments
 (0)