@webstudio-is/react-sdk 0.60.0 → 0.61.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/blockquote.ws.js +36 -48
- package/lib/cjs/components/body.ws.js +20 -17
- package/lib/cjs/components/button.ws.js +1 -1
- package/lib/cjs/components/code.ws.js +20 -28
- package/lib/cjs/components/component-meta.js +2 -1
- package/lib/cjs/components/form.ws.js +14 -7
- package/lib/cjs/components/heading.ws.js +1 -1
- package/lib/cjs/components/image.ws.js +8 -9
- package/lib/cjs/components/italic.ws.js +5 -5
- package/lib/cjs/components/link-block.ws.js +5 -5
- package/lib/cjs/components/link.ws.js +9 -10
- package/lib/cjs/components/list-item.ws.js +1 -1
- package/lib/cjs/components/list.ws.js +22 -22
- package/lib/cjs/components/paragraph.ws.js +1 -1
- package/lib/cjs/components/separator.ws.js +20 -20
- package/lib/cjs/components/text-block.ws.js +6 -7
- package/lib/cjs/css/css.js +6 -9
- package/lib/cjs/css/normalize.js +166 -185
- package/lib/cjs/css/presets.js +14 -34
- package/lib/cjs/css/style-rules.js +17 -0
- package/lib/cjs/embed-template.js +160 -0
- package/lib/cjs/index.js +1 -0
- package/lib/components/blockquote.ws.js +36 -48
- package/lib/components/body.ws.js +20 -17
- package/lib/components/button.ws.js +1 -1
- package/lib/components/code.ws.js +20 -28
- package/lib/components/component-meta.js +2 -1
- package/lib/components/form.ws.js +14 -7
- package/lib/components/heading.ws.js +1 -1
- package/lib/components/image.ws.js +8 -9
- package/lib/components/italic.ws.js +5 -5
- package/lib/components/link-block.ws.js +5 -5
- package/lib/components/link.ws.js +9 -10
- package/lib/components/list-item.ws.js +1 -1
- package/lib/components/list.ws.js +22 -22
- package/lib/components/paragraph.ws.js +1 -1
- package/lib/components/separator.ws.js +20 -20
- package/lib/components/text-block.ws.js +6 -7
- package/lib/css/css.js +8 -11
- package/lib/css/normalize.js +166 -185
- package/lib/css/presets.js +14 -34
- package/lib/css/style-rules.js +17 -0
- package/lib/embed-template.js +140 -0
- package/lib/index.js +1 -0
- package/lib/types/components/box.stories.d.ts +2 -2
- package/lib/types/components/component-meta.d.ts +20 -5
- package/lib/types/components/components-utils.d.ts +1 -1
- package/lib/types/css/normalize.d.ts +8786 -2286
- package/lib/types/css/presets.d.ts +2 -38
- package/lib/types/css/style-rules.d.ts +11 -9
- package/lib/types/embed-template.d.ts +1725 -0
- package/lib/types/embed-template.test.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +14 -13
- package/src/components/blockquote.ws.tsx +42 -52
- package/src/components/body.ws.tsx +26 -23
- package/src/components/bold.ws.tsx +6 -3
- package/src/components/box.ws.ts +6 -3
- package/src/components/button.ws.tsx +7 -4
- package/src/components/code.ws.tsx +26 -32
- package/src/components/component-meta.ts +5 -3
- package/src/components/form.ws.tsx +19 -9
- package/src/components/heading.ws.tsx +7 -4
- package/src/components/image.ws.tsx +14 -12
- package/src/components/input.ws.tsx +6 -3
- package/src/components/italic.ws.tsx +11 -8
- package/src/components/link-block.ws.tsx +11 -8
- package/src/components/link.ws.tsx +15 -13
- package/src/components/list-item.ws.tsx +7 -4
- package/src/components/list.ws.tsx +28 -25
- package/src/components/paragraph.ws.tsx +7 -4
- package/src/components/separator.ws.tsx +26 -25
- package/src/components/span.ws.tsx +6 -3
- package/src/components/subscript.ws.tsx +6 -3
- package/src/components/superscript.ws.tsx +6 -3
- package/src/components/text-block.ws.tsx +12 -11
- package/src/css/css.ts +8 -11
- package/src/css/normalize.ts +165 -188
- package/src/css/presets.ts +15 -37
- package/src/css/style-rules.ts +24 -0
- package/src/embed-template.test.ts +210 -0
- package/src/embed-template.ts +187 -0
- package/src/index.ts +1 -0
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import type { FunctionComponent } from "react";
|
|
3
3
|
import type { IconProps } from "@webstudio-is/icons";
|
|
4
|
-
import type { Style } from "@webstudio-is/css-data";
|
|
5
4
|
import type { htmlTags as HtmlTags } from "html-tags";
|
|
6
|
-
|
|
5
|
+
import { EmbedTemplateStyleDecl } from "../embed-template";
|
|
6
|
+
export type PresetStyle<Tag extends HtmlTags = HtmlTags> = Partial<Record<Tag, EmbedTemplateStyleDecl[]>>;
|
|
7
7
|
declare const WsComponentPropsMeta: z.ZodObject<{
|
|
8
8
|
props: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
9
9
|
control: z.ZodLiteral<"number">;
|
|
@@ -608,9 +608,21 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
608
608
|
label: string;
|
|
609
609
|
selector: string;
|
|
610
610
|
}>, "many">>;
|
|
611
|
-
children: z.ZodOptional<z.ZodArray<z.
|
|
611
|
+
children: z.ZodOptional<z.ZodLazy<z.ZodArray<z.ZodUnion<[z.ZodType<import("../embed-template").EmbedTemplateInstance, z.ZodTypeDef, import("../embed-template").EmbedTemplateInstance>, z.ZodObject<{
|
|
612
|
+
type: z.ZodLiteral<"text">;
|
|
613
|
+
value: z.ZodString;
|
|
614
|
+
}, "strip", z.ZodTypeAny, {
|
|
615
|
+
type: "text";
|
|
616
|
+
value: string;
|
|
617
|
+
}, {
|
|
618
|
+
type: "text";
|
|
619
|
+
value: string;
|
|
620
|
+
}>]>, "many">>>;
|
|
612
621
|
}, "strip", z.ZodTypeAny, {
|
|
613
|
-
children?:
|
|
622
|
+
children?: ({
|
|
623
|
+
type: "text";
|
|
624
|
+
value: string;
|
|
625
|
+
} | import("../embed-template").EmbedTemplateInstance)[] | undefined;
|
|
614
626
|
category?: "media" | "general" | "typography" | "forms" | undefined;
|
|
615
627
|
presetStyle?: any;
|
|
616
628
|
states?: {
|
|
@@ -621,7 +633,10 @@ declare const WsComponentMeta: z.ZodObject<{
|
|
|
621
633
|
label: string;
|
|
622
634
|
Icon: (...args: unknown[]) => unknown;
|
|
623
635
|
}, {
|
|
624
|
-
children?:
|
|
636
|
+
children?: ({
|
|
637
|
+
type: "text";
|
|
638
|
+
value: string;
|
|
639
|
+
} | import("../embed-template").EmbedTemplateInstance)[] | undefined;
|
|
625
640
|
category?: "media" | "general" | "typography" | "forms" | undefined;
|
|
626
641
|
presetStyle?: any;
|
|
627
642
|
states?: {
|
|
@@ -16,7 +16,7 @@ export declare const getComponent: (name: string) => undefined | (typeof compone
|
|
|
16
16
|
export declare const createGetComponent: (comps: Partial<typeof components>) => (name: string) => import("react").ForwardRefExoticComponent<{
|
|
17
17
|
children?: import("react").ReactNode;
|
|
18
18
|
} & import("react").RefAttributes<HTMLDivElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLBodyElement>, HTMLBodyElement>, "ref"> & import("react").RefAttributes<HTMLBodyElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
19
|
-
tag?: "
|
|
19
|
+
tag?: "address" | "article" | "aside" | "div" | "figure" | "footer" | "header" | "main" | "nav" | "section" | undefined;
|
|
20
20
|
}, "ref"> & import("react").RefAttributes<HTMLDivElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>> | import("react").ForwardRefExoticComponent<Omit<import("react").ClassAttributes<HTMLHeadingElement> & import("react").HTMLAttributes<HTMLHeadingElement> & {
|
|
21
21
|
tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | undefined;
|
|
22
22
|
}, "ref"> & import("react").RefAttributes<HTMLHeadingElement>> | import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "href" | "target"> & {
|