@webstudio-is/react-sdk 0.65.0 → 0.67.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/app/custom-components/form.ws.js +2 -2
- package/lib/app/custom-components/image.js +7 -13
- package/lib/app/custom-components/index.js +4 -1
- package/lib/app/params.js +1 -0
- package/lib/cjs/app/custom-components/form.ws.js +2 -2
- package/lib/cjs/app/custom-components/image.js +3 -12
- package/lib/cjs/app/custom-components/index.js +4 -1
- package/lib/cjs/app/params.js +1 -0
- package/lib/cjs/components/__generated__/{code.props.js → code-text.props.js} +3 -3
- package/lib/cjs/components/__generated__/html-embed.props.js +31 -0
- package/lib/cjs/components/blockquote.ws.js +2 -2
- package/lib/cjs/components/body.ws.js +2 -2
- package/lib/cjs/components/bold.ws.js +2 -2
- package/lib/cjs/components/box.ws.js +2 -2
- package/lib/cjs/components/button.ws.js +2 -2
- package/lib/cjs/components/checkbox-field.ws.js +2 -2
- package/lib/cjs/components/checkbox.ws.js +2 -2
- package/lib/cjs/components/{code.js → code-text.js} +6 -6
- package/lib/cjs/components/{code.ws.js → code-text.ws.js} +10 -10
- package/lib/cjs/components/component-meta.js +2 -2
- package/lib/cjs/components/components-utils.js +1 -43
- package/lib/cjs/components/components.js +4 -2
- package/lib/cjs/components/error-message.ws.js +2 -2
- package/lib/cjs/components/form.ws.js +2 -2
- package/lib/cjs/components/fragment.ws.js +1 -1
- package/lib/cjs/components/heading.ws.js +2 -2
- package/lib/cjs/components/html-embed.js +80 -0
- package/lib/cjs/components/html-embed.ws.js +43 -0
- package/lib/cjs/components/image.ws.js +2 -2
- package/lib/cjs/components/index.js +11 -57
- package/lib/cjs/components/input.ws.js +2 -2
- package/lib/cjs/components/italic.ws.js +2 -2
- package/lib/cjs/components/label.ws.js +2 -2
- package/lib/cjs/components/link-block.ws.js +2 -2
- package/lib/cjs/components/link.ws.js +2 -2
- package/lib/cjs/components/list-item.ws.js +2 -2
- package/lib/cjs/components/list.ws.js +2 -2
- package/lib/cjs/components/paragraph.ws.js +2 -2
- package/lib/cjs/components/radio-button-field.ws.js +2 -2
- package/lib/cjs/components/radio-button.ws.js +2 -2
- package/lib/cjs/components/separator.ws.js +2 -2
- package/lib/cjs/components/slot.ws.js +2 -2
- package/lib/cjs/components/span.ws.js +2 -2
- package/lib/cjs/components/subscript.ws.js +2 -2
- package/lib/cjs/components/success-message.ws.js +2 -2
- package/lib/cjs/components/superscript.ws.js +2 -2
- package/lib/cjs/components/text-block.ws.js +2 -2
- package/lib/cjs/components/textarea.ws.js +2 -2
- package/lib/cjs/css/css.js +2 -5
- package/lib/cjs/css/normalize.js +1 -1
- package/lib/cjs/css/presets.js +8 -1
- package/lib/cjs/tree/create-elements-tree.js +2 -4
- package/lib/components/__generated__/html-embed.props.js +11 -0
- package/lib/components/blockquote.ws.js +2 -2
- package/lib/components/body.ws.js +2 -2
- package/lib/components/bold.ws.js +2 -2
- package/lib/components/box.ws.js +2 -2
- package/lib/components/button.ws.js +2 -2
- package/lib/components/checkbox-field.ws.js +2 -2
- package/lib/components/checkbox.ws.js +2 -2
- package/lib/components/{code.js → code-text.js} +3 -3
- package/lib/components/{code.ws.js → code-text.ws.js} +5 -5
- package/lib/components/component-meta.js +3 -3
- package/lib/components/components-utils.js +1 -43
- package/lib/components/components.js +4 -2
- package/lib/components/error-message.ws.js +2 -2
- package/lib/components/form.ws.js +2 -2
- package/lib/components/fragment.ws.js +1 -1
- package/lib/components/heading.ws.js +2 -2
- package/lib/components/html-embed.js +65 -0
- package/lib/components/html-embed.ws.js +23 -0
- package/lib/components/image.ws.js +2 -2
- package/lib/components/index.js +11 -57
- package/lib/components/input.ws.js +2 -2
- package/lib/components/italic.ws.js +2 -2
- package/lib/components/label.ws.js +2 -2
- package/lib/components/link-block.ws.js +2 -2
- package/lib/components/link.ws.js +2 -2
- package/lib/components/list-item.ws.js +2 -2
- package/lib/components/list.ws.js +2 -2
- package/lib/components/paragraph.ws.js +2 -2
- package/lib/components/radio-button-field.ws.js +2 -2
- package/lib/components/radio-button.ws.js +2 -2
- package/lib/components/separator.ws.js +2 -2
- package/lib/components/slot.ws.js +2 -2
- package/lib/components/span.ws.js +2 -2
- package/lib/components/subscript.ws.js +2 -2
- package/lib/components/success-message.ws.js +2 -2
- package/lib/components/superscript.ws.js +2 -2
- package/lib/components/text-block.ws.js +2 -2
- package/lib/components/textarea.ws.js +2 -2
- package/lib/css/css.js +2 -5
- package/lib/css/normalize.js +2 -2
- package/lib/css/presets.js +8 -1
- package/lib/tree/create-elements-tree.js +2 -4
- package/lib/types/app/params.d.ts +22 -1
- package/lib/types/components/__generated__/html-embed.props.d.ts +2 -0
- package/lib/types/components/{code.d.ts → code-text.d.ts} +1 -1
- package/lib/types/components/{code.stories.d.ts → code-text.stories.d.ts} +1 -1
- package/lib/types/components/component-meta.d.ts +1785 -10
- package/lib/types/components/components-utils.d.ts +6 -3
- package/lib/types/components/components.d.ts +2 -1
- package/lib/types/components/html-embed.d.ts +7 -0
- package/lib/types/components/html-embed.stories.d.ts +11 -0
- package/lib/types/components/html-embed.ws.d.ts +3 -0
- package/lib/types/components/index.d.ts +2 -2
- package/lib/types/context.d.ts +1 -0
- package/lib/types/css/css.d.ts +2 -0
- package/lib/types/css/presets.d.ts +1 -0
- package/lib/types/css/style-rules.d.ts +1 -1
- package/lib/types/embed-template.d.ts +1 -1
- package/lib/types/tree/create-elements-tree.d.ts +2 -2
- package/package.json +14 -13
- package/src/app/custom-components/form.ws.tsx +2 -2
- package/src/app/custom-components/image.tsx +7 -13
- package/src/app/custom-components/index.ts +4 -1
- package/src/app/params.ts +23 -1
- package/src/components/__generated__/html-embed.props.ts +10 -0
- package/src/components/blockquote.ws.tsx +2 -2
- package/src/components/body.ws.tsx +2 -2
- package/src/components/bold.ws.tsx +2 -2
- package/src/components/box.ws.ts +2 -2
- package/src/components/button.ws.tsx +2 -2
- package/src/components/checkbox-field.ws.tsx +2 -2
- package/src/components/checkbox.ws.tsx +2 -2
- package/src/components/code-text.stories.tsx +16 -0
- package/src/components/{code.tsx → code-text.tsx} +2 -2
- package/src/components/{code.ws.tsx → code-text.ws.tsx} +5 -5
- package/src/components/component-meta.ts +3 -6
- package/src/components/components-utils.ts +14 -58
- package/src/components/components.ts +2 -1
- package/src/components/error-message.ws.tsx +2 -2
- package/src/components/form.ws.tsx +2 -2
- package/src/components/fragment.ws.ts +1 -1
- package/src/components/heading.ws.tsx +2 -2
- package/src/components/html-embed.stories.tsx +16 -0
- package/src/components/html-embed.tsx +96 -0
- package/src/components/html-embed.ws.ts +22 -0
- package/src/components/image.ws.tsx +2 -2
- package/src/components/index.ts +10 -87
- package/src/components/input.ws.tsx +2 -2
- package/src/components/italic.ws.tsx +2 -2
- package/src/components/label.ws.tsx +2 -2
- package/src/components/link-block.ws.tsx +2 -2
- package/src/components/link.ws.tsx +2 -2
- package/src/components/list-item.ws.tsx +2 -2
- package/src/components/list.ws.tsx +2 -2
- package/src/components/paragraph.ws.tsx +2 -2
- package/src/components/radio-button-field.ws.tsx +2 -2
- package/src/components/radio-button.ws.tsx +2 -2
- package/src/components/separator.ws.tsx +2 -2
- package/src/components/slot.ws.ts +2 -2
- package/src/components/span.ws.tsx +2 -2
- package/src/components/subscript.ws.tsx +2 -2
- package/src/components/success-message.ws.tsx +2 -2
- package/src/components/superscript.ws.tsx +2 -2
- package/src/components/text-block.ws.tsx +2 -2
- package/src/components/textarea.ws.tsx +2 -2
- package/src/context.tsx +1 -0
- package/src/css/css.ts +4 -5
- package/src/css/normalize.ts +2 -2
- package/src/css/presets.ts +7 -0
- package/src/tree/create-elements-tree.tsx +3 -5
- package/lib/cjs/tree/session-storage-polyfill.js +0 -65
- package/lib/tree/session-storage-polyfill.js +0 -45
- package/lib/types/tree/session-storage-polyfill.d.ts +0 -2
- package/src/components/code.stories.tsx +0 -16
- package/src/tree/session-storage-polyfill.tsx +0 -50
- /package/lib/components/__generated__/{code.props.js → code-text.props.js} +0 -0
- /package/lib/types/components/__generated__/{code.props.d.ts → code-text.props.d.ts} +0 -0
- /package/lib/types/components/{code.ws.d.ts → code-text.ws.d.ts} +0 -0
- /package/src/components/__generated__/{code.props.ts → code-text.props.ts} +0 -0
|
@@ -1,8 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import * as components from "./components";
|
|
3
|
+
import { componentAttribute, idAttribute } from "../tree";
|
|
3
4
|
export type ComponentName = keyof typeof components;
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
type AnyComponent = React.ForwardRefExoticComponent<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
6
|
+
[componentAttribute]: string;
|
|
7
|
+
[idAttribute]: string;
|
|
8
|
+
} & React.RefAttributes<HTMLElement>>;
|
|
6
9
|
/**
|
|
7
10
|
* Now used only in builder app
|
|
8
11
|
* @todo Consider using the same approach in the builder app as in the published apps . A dynamic import is needed
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { Slot } from "./slot";
|
|
9
9
|
export { Fragment } from "./fragment";
|
|
10
|
+
export { HtmlEmbed } from "./html-embed";
|
|
10
11
|
export { Body } from "./body";
|
|
11
12
|
export { Box } from "./box";
|
|
12
13
|
export { TextBlock } from "./text-block";
|
|
@@ -28,7 +29,7 @@ export { Blockquote } from "./blockquote";
|
|
|
28
29
|
export { List } from "./list";
|
|
29
30
|
export { ListItem } from "./list-item";
|
|
30
31
|
export { Separator } from "./separator";
|
|
31
|
-
export {
|
|
32
|
+
export { CodeText } from "./code-text";
|
|
32
33
|
export { Label } from "./label";
|
|
33
34
|
export { SuccessMessage } from "./success-message";
|
|
34
35
|
export { ErrorMessage } from "./error-message";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
3
|
+
declare const _default: ComponentMeta<import("react").ForwardRefExoticComponent<{
|
|
4
|
+
code: string;
|
|
5
|
+
executeScriptOnCanvas: boolean;
|
|
6
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
7
|
+
export default _default;
|
|
8
|
+
export declare const HtmlEmbed: ComponentStory<import("react").ForwardRefExoticComponent<{
|
|
9
|
+
code: string;
|
|
10
|
+
executeScriptOnCanvas: boolean;
|
|
11
|
+
} & import("react").RefAttributes<HTMLDivElement>>>;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { WsComponentMeta, WsComponentPropsMeta } from "./component-meta";
|
|
2
2
|
import type { ComponentName } from "./components-utils";
|
|
3
|
+
export declare const defaultMetas: Record<string, WsComponentMeta>;
|
|
3
4
|
export declare const getComponentMeta: (name: string) => WsComponentMeta | undefined;
|
|
4
5
|
export declare const registerComponentMetas: (overrides: Record<string, Partial<WsComponentMeta>>) => void;
|
|
5
|
-
export declare const
|
|
6
|
-
export declare const registerComponentPropsMetas: (metas: Record<string, WsComponentPropsMeta>) => void;
|
|
6
|
+
export declare const defaultPropsMetas: Record<string, WsComponentPropsMeta>;
|
|
7
7
|
type RegisteredComponents = Partial<{
|
|
8
8
|
[name in ComponentName]: {};
|
|
9
9
|
}>;
|
package/lib/types/context.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { type ReadableAtom } from "nanostores";
|
|
|
3
3
|
import type { Assets } from "@webstudio-is/asset-uploader";
|
|
4
4
|
import type { Pages, PropsByInstanceId } from "./props";
|
|
5
5
|
export declare const ReactSdkContext: import("react").Context<{
|
|
6
|
+
renderer?: "canvas" | undefined;
|
|
6
7
|
propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
|
|
7
8
|
assetsStore: ReadableAtom<Assets>;
|
|
8
9
|
pagesStore: ReadableAtom<Pages>;
|
package/lib/types/css/css.d.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { type TransformValue } from "@webstudio-is/css-engine";
|
|
2
2
|
import type { Asset } from "@webstudio-is/asset-uploader";
|
|
3
3
|
import type { Build } from "@webstudio-is/project-build";
|
|
4
|
+
import type { WsComponentMeta } from "../components/component-meta";
|
|
4
5
|
type Data = {
|
|
5
6
|
assets: Asset[];
|
|
6
7
|
breakpoints?: Build["breakpoints"];
|
|
7
8
|
styles?: Build["styles"];
|
|
8
9
|
styleSourceSelections?: Build["styleSourceSelections"];
|
|
10
|
+
componentMetas: Map<string, WsComponentMeta>;
|
|
9
11
|
};
|
|
10
12
|
type CssOptions = {
|
|
11
13
|
assetBaseUrl: string;
|
|
@@ -193,9 +193,9 @@ export declare const getStyleRules: (styles: Map<string, {
|
|
|
193
193
|
})[];
|
|
194
194
|
})[];
|
|
195
195
|
};
|
|
196
|
+
property: "filter" | "float" | "fontFamily" | "width" | "height" | "clip" | "top" | "right" | `--${string}` | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationTimeline" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockOverflow" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "color" | "printColorAdjust" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inputSecurity" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex";
|
|
196
197
|
styleSourceId: string;
|
|
197
198
|
breakpointId: string;
|
|
198
|
-
property: "filter" | "float" | "fontFamily" | "width" | "height" | "clip" | "top" | "right" | `--${string}` | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationTimeline" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockOverflow" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "color" | "printColorAdjust" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inputSecurity" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex";
|
|
199
199
|
}>, styleSourceSelections: Map<string, {
|
|
200
200
|
values: string[];
|
|
201
201
|
instanceId: string;
|
|
@@ -1718,9 +1718,9 @@ export declare const generateDataFromEmbedTemplate: (treeTemplate: ({
|
|
|
1718
1718
|
})[];
|
|
1719
1719
|
})[];
|
|
1720
1720
|
};
|
|
1721
|
+
property: "filter" | "float" | "fontFamily" | "width" | "height" | "clip" | "top" | "right" | `--${string}` | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationTimeline" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockOverflow" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "color" | "printColorAdjust" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inputSecurity" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex";
|
|
1721
1722
|
styleSourceId: string;
|
|
1722
1723
|
breakpointId: string;
|
|
1723
|
-
property: "filter" | "float" | "fontFamily" | "width" | "height" | "clip" | "top" | "right" | `--${string}` | "accentColor" | "alignContent" | "alignItems" | "alignSelf" | "alignTracks" | "animationComposition" | "animationDelay" | "animationDirection" | "animationDuration" | "animationFillMode" | "animationIterationCount" | "animationName" | "animationPlayState" | "animationTimingFunction" | "animationTimeline" | "appearance" | "aspectRatio" | "backdropFilter" | "backfaceVisibility" | "backgroundAttachment" | "backgroundBlendMode" | "backgroundClip" | "backgroundColor" | "backgroundImage" | "backgroundOrigin" | "backgroundPosition" | "backgroundPositionX" | "backgroundPositionY" | "backgroundRepeat" | "backgroundSize" | "blockOverflow" | "blockSize" | "borderBlockColor" | "borderBlockStyle" | "borderBlockWidth" | "borderBlockEndColor" | "borderBlockEndStyle" | "borderBlockEndWidth" | "borderBlockStartColor" | "borderBlockStartStyle" | "borderBlockStartWidth" | "borderBottomColor" | "borderBottomLeftRadius" | "borderBottomRightRadius" | "borderBottomStyle" | "borderBottomWidth" | "borderCollapse" | "borderEndEndRadius" | "borderEndStartRadius" | "borderImageOutset" | "borderImageRepeat" | "borderImageSlice" | "borderImageSource" | "borderImageWidth" | "borderInlineColor" | "borderInlineStyle" | "borderInlineWidth" | "borderInlineEndColor" | "borderInlineEndStyle" | "borderInlineEndWidth" | "borderInlineStartColor" | "borderInlineStartStyle" | "borderInlineStartWidth" | "borderLeftColor" | "borderLeftStyle" | "borderLeftWidth" | "borderRightColor" | "borderRightStyle" | "borderRightWidth" | "borderSpacing" | "borderStartEndRadius" | "borderStartStartRadius" | "borderTopColor" | "borderTopLeftRadius" | "borderTopRightRadius" | "borderTopStyle" | "borderTopWidth" | "bottom" | "boxDecorationBreak" | "boxShadow" | "boxSizing" | "breakAfter" | "breakBefore" | "breakInside" | "captionSide" | "caretColor" | "caretShape" | "clear" | "clipPath" | "color" | "printColorAdjust" | "colorScheme" | "columnCount" | "columnFill" | "columnGap" | "columnRuleColor" | "columnRuleStyle" | "columnRuleWidth" | "columnSpan" | "columnWidth" | "contain" | "containIntrinsicBlockSize" | "containIntrinsicHeight" | "containIntrinsicInlineSize" | "containIntrinsicWidth" | "content" | "contentVisibility" | "counterIncrement" | "counterReset" | "counterSet" | "cursor" | "direction" | "display" | "emptyCells" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFeatureSettings" | "fontKerning" | "fontLanguageOverride" | "fontOpticalSizing" | "fontVariationSettings" | "fontSize" | "fontSizeAdjust" | "fontStretch" | "fontStyle" | "fontSynthesis" | "fontVariant" | "fontVariantAlternates" | "fontVariantCaps" | "fontVariantEastAsian" | "fontVariantLigatures" | "fontVariantNumeric" | "fontVariantPosition" | "fontWeight" | "forcedColorAdjust" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridColumnEnd" | "gridColumnStart" | "gridRowEnd" | "gridRowStart" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "hangingPunctuation" | "hyphenateCharacter" | "hyphens" | "imageOrientation" | "imageRendering" | "imageResolution" | "initialLetter" | "initialLetterAlign" | "inlineSize" | "inputSecurity" | "insetBlockEnd" | "insetBlockStart" | "insetInlineEnd" | "insetInlineStart" | "isolation" | "justifyContent" | "justifyItems" | "justifySelf" | "justifyTracks" | "left" | "letterSpacing" | "lineBreak" | "lineClamp" | "lineHeight" | "lineHeightStep" | "listStyleImage" | "listStylePosition" | "listStyleType" | "marginBlockEnd" | "marginBlockStart" | "marginBottom" | "marginInlineEnd" | "marginInlineStart" | "marginLeft" | "marginRight" | "marginTop" | "marginTrim" | "maskBorderMode" | "maskBorderOutset" | "maskBorderRepeat" | "maskBorderSlice" | "maskBorderSource" | "maskBorderWidth" | "maskClip" | "maskComposite" | "maskImage" | "maskMode" | "maskOrigin" | "maskPosition" | "maskRepeat" | "maskSize" | "maskType" | "masonryAutoFlow" | "mathDepth" | "mathShift" | "mathStyle" | "maxBlockSize" | "maxHeight" | "maxInlineSize" | "maxLines" | "maxWidth" | "minBlockSize" | "minHeight" | "minInlineSize" | "minWidth" | "mixBlendMode" | "objectFit" | "objectPosition" | "offsetAnchor" | "offsetDistance" | "offsetPath" | "offsetPosition" | "offsetRotate" | "opacity" | "order" | "orphans" | "outlineColor" | "outlineOffset" | "outlineStyle" | "outlineWidth" | "overflow" | "overflowAnchor" | "overflowBlock" | "overflowClipMargin" | "overflowInline" | "overflowWrap" | "overflowX" | "overflowY" | "overscrollBehavior" | "overscrollBehaviorBlock" | "overscrollBehaviorInline" | "overscrollBehaviorX" | "overscrollBehaviorY" | "paddingBlockEnd" | "paddingBlockStart" | "paddingBottom" | "paddingInlineEnd" | "paddingInlineStart" | "paddingLeft" | "paddingRight" | "paddingTop" | "pageBreakAfter" | "pageBreakBefore" | "pageBreakInside" | "paintOrder" | "perspective" | "perspectiveOrigin" | "pointerEvents" | "position" | "quotes" | "resize" | "rotate" | "rowGap" | "rubyAlign" | "rubyMerge" | "rubyPosition" | "scale" | "scrollbarColor" | "scrollbarGutter" | "scrollbarWidth" | "scrollBehavior" | "scrollMarginBlockStart" | "scrollMarginBlockEnd" | "scrollMarginBottom" | "scrollMarginInlineStart" | "scrollMarginInlineEnd" | "scrollMarginLeft" | "scrollMarginRight" | "scrollMarginTop" | "scrollPaddingBlockStart" | "scrollPaddingBlockEnd" | "scrollPaddingBottom" | "scrollPaddingInlineStart" | "scrollPaddingInlineEnd" | "scrollPaddingLeft" | "scrollPaddingRight" | "scrollPaddingTop" | "scrollSnapAlign" | "scrollSnapStop" | "scrollSnapType" | "scrollTimelineAxis" | "scrollTimelineName" | "shapeImageThreshold" | "shapeMargin" | "shapeOutside" | "tabSize" | "tableLayout" | "textAlign" | "textAlignLast" | "textCombineUpright" | "textDecorationColor" | "textDecorationLine" | "textDecorationSkip" | "textDecorationSkipInk" | "textDecorationStyle" | "textDecorationThickness" | "textEmphasisColor" | "textEmphasisPosition" | "textEmphasisStyle" | "textIndent" | "textJustify" | "textOrientation" | "textOverflow" | "textRendering" | "textShadow" | "textSizeAdjust" | "textTransform" | "textUnderlineOffset" | "textUnderlinePosition" | "touchAction" | "transform" | "transformBox" | "transformOrigin" | "transformStyle" | "transitionDelay" | "transitionDuration" | "transitionProperty" | "transitionTimingFunction" | "translate" | "unicodeBidi" | "userSelect" | "verticalAlign" | "visibility" | "whiteSpace" | "widows" | "willChange" | "wordBreak" | "wordSpacing" | "wordWrap" | "writingMode" | "zIndex";
|
|
1724
1724
|
}[];
|
|
1725
1725
|
};
|
|
1726
1726
|
export {};
|
|
@@ -5,7 +5,8 @@ import type { Instance, Instances } from "@webstudio-is/project-build";
|
|
|
5
5
|
import type { GetComponent } from "../components/components-utils";
|
|
6
6
|
import type { Pages, PropsByInstanceId } from "../props";
|
|
7
7
|
import type { WebstudioComponent } from "./webstudio-component";
|
|
8
|
-
export declare const createElementsTree: ({ instances, rootInstanceId,
|
|
8
|
+
export declare const createElementsTree: ({ renderer, instances, rootInstanceId, propsByInstanceIdStore, assetsStore, pagesStore, Component, getComponent, }: {
|
|
9
|
+
renderer?: "canvas" | undefined;
|
|
9
10
|
instances: Map<string, {
|
|
10
11
|
label?: string | undefined;
|
|
11
12
|
type: "instance";
|
|
@@ -20,7 +21,6 @@ export declare const createElementsTree: ({ instances, rootInstanceId, sandbox,
|
|
|
20
21
|
})[];
|
|
21
22
|
}>;
|
|
22
23
|
rootInstanceId: Instance["id"];
|
|
23
|
-
sandbox?: boolean | undefined;
|
|
24
24
|
propsByInstanceIdStore: ReadableAtom<PropsByInstanceId>;
|
|
25
25
|
assetsStore: ReadableAtom<Assets>;
|
|
26
26
|
pagesStore: ReadableAtom<Pages>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.67.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
"typescript": "5.0.3",
|
|
19
19
|
"zod": "^3.19.1",
|
|
20
20
|
"@webstudio-is/jest-config": "^1.0.6",
|
|
21
|
-
"@webstudio-is/scripts": "^0.0.0",
|
|
22
21
|
"@webstudio-is/storybook-config": "^0.0.0",
|
|
22
|
+
"@webstudio-is/scripts": "^0.0.0",
|
|
23
23
|
"@webstudio-is/tsconfig": "^1.0.6"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -30,22 +30,23 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@nanostores/react": "^0.4.1",
|
|
33
|
+
"@react-aria/utils": "^3.13.3",
|
|
33
34
|
"detect-font": "^0.1.5",
|
|
34
35
|
"html-tags": "^3.2.0",
|
|
35
36
|
"nanoevents": "^7.0.1",
|
|
36
37
|
"nanoid": "^3.2.0",
|
|
37
38
|
"nanostores": "^0.7.1",
|
|
38
|
-
"@webstudio-is/asset-uploader": "^0.
|
|
39
|
-
"@webstudio-is/css-data": "^0.
|
|
40
|
-
"@webstudio-is/css-engine": "^0.
|
|
41
|
-
"@webstudio-is/css-vars": "^0.
|
|
42
|
-
"@webstudio-is/fonts": "^0.
|
|
43
|
-
"@webstudio-is/
|
|
44
|
-
"@webstudio-is/
|
|
45
|
-
"@webstudio-is/
|
|
46
|
-
"@webstudio-is/
|
|
47
|
-
"@webstudio-is/
|
|
48
|
-
"@webstudio-is/
|
|
39
|
+
"@webstudio-is/asset-uploader": "^0.67.0",
|
|
40
|
+
"@webstudio-is/css-data": "^0.67.0",
|
|
41
|
+
"@webstudio-is/css-engine": "^0.67.0",
|
|
42
|
+
"@webstudio-is/css-vars": "^0.67.0",
|
|
43
|
+
"@webstudio-is/fonts": "^0.67.0",
|
|
44
|
+
"@webstudio-is/form-handlers": "^0.67.0",
|
|
45
|
+
"@webstudio-is/generate-arg-types": "^0.67.0",
|
|
46
|
+
"@webstudio-is/icons": "^0.67.0",
|
|
47
|
+
"@webstudio-is/image": "^0.67.0",
|
|
48
|
+
"@webstudio-is/prisma-client": "^0.67.0",
|
|
49
|
+
"@webstudio-is/project-build": "^0.67.0"
|
|
49
50
|
},
|
|
50
51
|
"exports": {
|
|
51
52
|
".": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FormIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { FormIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { form } from "../../css/normalize";
|
|
3
3
|
import type {
|
|
4
4
|
PresetStyle,
|
|
@@ -19,7 +19,7 @@ export const meta: WsComponentMeta = {
|
|
|
19
19
|
category: "forms",
|
|
20
20
|
type: "container",
|
|
21
21
|
label: "Form",
|
|
22
|
-
|
|
22
|
+
icon: FormIcon,
|
|
23
23
|
presetStyle,
|
|
24
24
|
states: [
|
|
25
25
|
{ selector: "[data-state=error]", label: "Error" },
|
|
@@ -4,7 +4,10 @@ import {
|
|
|
4
4
|
type ComponentPropsWithoutRef,
|
|
5
5
|
type ElementRef,
|
|
6
6
|
} from "react";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
Image as WebstudioImage,
|
|
9
|
+
createImageLoader,
|
|
10
|
+
} from "@webstudio-is/image";
|
|
8
11
|
import { Image as SdkImage } from "../../components/image";
|
|
9
12
|
import { usePropAsset, getInstanceIdFromComponentProps } from "../../props";
|
|
10
13
|
import { getParams } from "../params";
|
|
@@ -16,20 +19,11 @@ type Props = ComponentPropsWithoutRef<typeof WebstudioImage>;
|
|
|
16
19
|
export const Image = forwardRef<ElementRef<typeof defaultTag>, Props>(
|
|
17
20
|
(props, ref) => {
|
|
18
21
|
const asset = usePropAsset(getInstanceIdFromComponentProps(props), "src");
|
|
19
|
-
const params = getParams();
|
|
20
22
|
|
|
21
23
|
const loader = useMemo(() => {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (asset.location === "REMOTE") {
|
|
26
|
-
return loaders.cloudflareImageLoader({
|
|
27
|
-
resizeOrigin: params.resizeOrigin,
|
|
28
|
-
cdnUrl: params.assetBaseUrl,
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
return loaders.localImageLoader({ publicPath: params.assetBaseUrl });
|
|
32
|
-
}, [asset, params]);
|
|
24
|
+
const params = getParams();
|
|
25
|
+
return createImageLoader({ imageBaseUrl: params.imageBaseUrl });
|
|
26
|
+
}, []);
|
|
33
27
|
|
|
34
28
|
const src = asset?.name ?? props.src;
|
|
35
29
|
|
|
@@ -16,7 +16,10 @@ export const customComponents = {
|
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
export const customComponentPropsMetas: Record<string, WsComponentPropsMeta> = {
|
|
19
|
-
Image: {
|
|
19
|
+
Image: {
|
|
20
|
+
props: imageProps,
|
|
21
|
+
initialProps: ["src", "width", "height", "alt", "loading"],
|
|
22
|
+
},
|
|
20
23
|
Form: formPropsMeta,
|
|
21
24
|
};
|
|
22
25
|
|
package/src/app/params.ts
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
export type Params = {
|
|
2
|
-
|
|
2
|
+
/**
|
|
3
|
+
* Base url ir base path for images with ending slash.
|
|
4
|
+
* Used for configuring image with different sizes.
|
|
5
|
+
* Concatinated with "name?width=&quality=&format=".
|
|
6
|
+
*
|
|
7
|
+
* For example
|
|
8
|
+
* /asset/image/ used by default in builder
|
|
9
|
+
* https://image-transform.wstd.io/cdn-cgi/image/
|
|
10
|
+
* https://webstudio.is/cdn-cgi/image/
|
|
11
|
+
*/
|
|
12
|
+
imageBaseUrl: string;
|
|
13
|
+
/**
|
|
14
|
+
* Base url or base path for any asset with ending slash.
|
|
15
|
+
* Used to load assets like fonts or images in styles
|
|
16
|
+
* Concatinated with "name".
|
|
17
|
+
*
|
|
18
|
+
* For example
|
|
19
|
+
* /s/uploads/
|
|
20
|
+
* /asset/file/
|
|
21
|
+
* https://assets-dev.webstudio.is/
|
|
22
|
+
* https://assets.webstudio.is/
|
|
23
|
+
*/
|
|
3
24
|
assetBaseUrl: string;
|
|
4
25
|
};
|
|
5
26
|
|
|
6
27
|
let params: undefined | Params;
|
|
7
28
|
|
|
8
29
|
const emptyParams: Params = {
|
|
30
|
+
imageBaseUrl: "/",
|
|
9
31
|
assetBaseUrl: "/",
|
|
10
32
|
};
|
|
11
33
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PropMeta } from "@webstudio-is/generate-arg-types";
|
|
2
|
+
|
|
3
|
+
export const props: Record<string, PropMeta> = {
|
|
4
|
+
code: { required: true, control: "text", type: "string" },
|
|
5
|
+
executeScriptOnCanvas: {
|
|
6
|
+
required: true,
|
|
7
|
+
control: "boolean",
|
|
8
|
+
type: "boolean",
|
|
9
|
+
},
|
|
10
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BlockquoteIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BlockquoteIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import type { defaultTag } from "./blockquote";
|
|
3
3
|
import {
|
|
4
4
|
defaultStates,
|
|
@@ -63,7 +63,7 @@ export const meta: WsComponentMeta = {
|
|
|
63
63
|
category: "typography",
|
|
64
64
|
type: "rich-text",
|
|
65
65
|
label: "Blockquote",
|
|
66
|
-
|
|
66
|
+
icon: BlockquoteIcon,
|
|
67
67
|
states: defaultStates,
|
|
68
68
|
presetStyle,
|
|
69
69
|
children: [{ type: "text", value: "Blockquote you can edit" }],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BodyIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BodyIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { body } from "../css/normalize";
|
|
3
3
|
import {
|
|
4
4
|
defaultStates,
|
|
@@ -41,7 +41,7 @@ const presetStyle = {
|
|
|
41
41
|
export const meta: WsComponentMeta = {
|
|
42
42
|
type: "container",
|
|
43
43
|
label: "Body",
|
|
44
|
-
|
|
44
|
+
icon: BodyIcon,
|
|
45
45
|
states: defaultStates,
|
|
46
46
|
presetStyle,
|
|
47
47
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoldIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BoldIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates,
|
|
4
4
|
type PresetStyle,
|
|
@@ -16,7 +16,7 @@ const presetStyle = {
|
|
|
16
16
|
export const meta: WsComponentMeta = {
|
|
17
17
|
type: "rich-text-child",
|
|
18
18
|
label: "Bold Text",
|
|
19
|
-
|
|
19
|
+
icon: BoldIcon,
|
|
20
20
|
states: defaultStates,
|
|
21
21
|
presetStyle,
|
|
22
22
|
};
|
package/src/components/box.ws.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BoxIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { BoxIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates,
|
|
4
4
|
type PresetStyle,
|
|
@@ -40,7 +40,7 @@ export const meta: WsComponentMeta = {
|
|
|
40
40
|
category: "general",
|
|
41
41
|
type: "container",
|
|
42
42
|
label: "Box",
|
|
43
|
-
|
|
43
|
+
icon: BoxIcon,
|
|
44
44
|
states: defaultStates,
|
|
45
45
|
presetStyle,
|
|
46
46
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ButtonElementIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { ButtonElementIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import { button } from "../css/normalize";
|
|
3
3
|
import {
|
|
4
4
|
defaultStates,
|
|
@@ -17,7 +17,7 @@ export const meta: WsComponentMeta = {
|
|
|
17
17
|
category: "forms",
|
|
18
18
|
type: "container",
|
|
19
19
|
label: "Button",
|
|
20
|
-
|
|
20
|
+
icon: ButtonElementIcon,
|
|
21
21
|
presetStyle,
|
|
22
22
|
states: [
|
|
23
23
|
...defaultStates,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxCheckedIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
type WsComponentMeta,
|
|
4
4
|
type WsComponentPropsMeta,
|
|
@@ -20,7 +20,7 @@ export const meta: WsComponentMeta = {
|
|
|
20
20
|
category: "forms",
|
|
21
21
|
type: "container",
|
|
22
22
|
label: "Checkbox",
|
|
23
|
-
|
|
23
|
+
icon: CheckboxCheckedIcon,
|
|
24
24
|
states: defaultStates,
|
|
25
25
|
presetStyle,
|
|
26
26
|
children: [
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckboxCheckedIcon } from "@webstudio-is/icons";
|
|
1
|
+
import { CheckboxCheckedIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
type WsComponentMeta,
|
|
4
4
|
type WsComponentPropsMeta,
|
|
@@ -22,7 +22,7 @@ const presetStyle = {
|
|
|
22
22
|
export const meta: WsComponentMeta = {
|
|
23
23
|
type: "control",
|
|
24
24
|
label: "Checkbox Input",
|
|
25
|
-
|
|
25
|
+
icon: CheckboxCheckedIcon,
|
|
26
26
|
presetStyle,
|
|
27
27
|
states: [
|
|
28
28
|
...defaultStates,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ComponentStory, ComponentMeta } from "@storybook/react";
|
|
2
|
+
import { CodeText as CodeTextPrimitive } from "./code-text";
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: "Components/CodeText",
|
|
6
|
+
component: CodeTextPrimitive,
|
|
7
|
+
} as ComponentMeta<typeof CodeTextPrimitive>;
|
|
8
|
+
|
|
9
|
+
const Template: ComponentStory<typeof CodeTextPrimitive> = (args) => (
|
|
10
|
+
<CodeTextPrimitive {...args} />
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
export const CodeText = Template.bind({});
|
|
14
|
+
CodeText.args = {
|
|
15
|
+
children: "alert('Hello World!')",
|
|
16
|
+
};
|
|
@@ -19,7 +19,7 @@ type Props = Omit<ComponentProps<typeof defaultTag>, "inline"> & {
|
|
|
19
19
|
meta?: string;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export const
|
|
22
|
+
export const CodeText = forwardRef<ElementRef<typeof defaultTag>, Props>(
|
|
23
23
|
({ inline = false, ...props }, ref) => {
|
|
24
24
|
// @todo in the future we should expose the inline prop a an attribute
|
|
25
25
|
// and define the display style in `presetStyle` in meta.
|
|
@@ -28,4 +28,4 @@ export const Code = forwardRef<ElementRef<typeof defaultTag>, Props>(
|
|
|
28
28
|
}
|
|
29
29
|
);
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
CodeText.displayName = "CodeText";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CodeTextIcon } from "@webstudio-is/icons/svg";
|
|
2
2
|
import {
|
|
3
3
|
defaultStates,
|
|
4
4
|
type PresetStyle,
|
|
5
5
|
type WsComponentMeta,
|
|
6
6
|
type WsComponentPropsMeta,
|
|
7
7
|
} from "./component-meta";
|
|
8
|
-
import { type defaultTag, displayVarNamespace } from "./code";
|
|
9
|
-
import { props } from "./__generated__/code.props";
|
|
8
|
+
import { type defaultTag, displayVarNamespace } from "./code-text";
|
|
9
|
+
import { props } from "./__generated__/code-text.props";
|
|
10
10
|
import { code } from "../css/normalize";
|
|
11
11
|
|
|
12
12
|
const presetStyle = {
|
|
@@ -38,8 +38,8 @@ const presetStyle = {
|
|
|
38
38
|
export const meta: WsComponentMeta = {
|
|
39
39
|
category: "general",
|
|
40
40
|
type: "rich-text",
|
|
41
|
-
label: "Code",
|
|
42
|
-
|
|
41
|
+
label: "Code Text",
|
|
42
|
+
icon: CodeTextIcon,
|
|
43
43
|
states: defaultStates,
|
|
44
44
|
presetStyle,
|
|
45
45
|
children: [{ type: "text", value: "Code you can edit" }],
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
import type { FunctionComponent } from "react";
|
|
3
|
-
import type { IconProps } from "@webstudio-is/icons";
|
|
4
2
|
import { PropMeta } from "@webstudio-is/generate-arg-types";
|
|
5
3
|
import type { htmlTags as HtmlTags } from "html-tags";
|
|
6
4
|
import { EmbedTemplateStyleDecl, WsEmbedTemplate } from "../embed-template";
|
|
@@ -59,16 +57,15 @@ const WsComponentMeta = z.object({
|
|
|
59
57
|
]),
|
|
60
58
|
acceptedParents: z.optional(z.array(z.string())),
|
|
61
59
|
label: z.string(),
|
|
62
|
-
|
|
63
|
-
presetStyle: z.optional(z.
|
|
60
|
+
icon: z.string(),
|
|
61
|
+
presetStyle: z.optional(z.record(z.string(), EmbedTemplateStyleDecl)),
|
|
64
62
|
states: z.optional(z.array(ComponentState)),
|
|
65
63
|
children: z.optional(WsEmbedTemplate),
|
|
66
64
|
});
|
|
67
65
|
|
|
68
66
|
export type WsComponentMeta = Omit<
|
|
69
67
|
z.infer<typeof WsComponentMeta>,
|
|
70
|
-
"presetStyle"
|
|
68
|
+
"presetStyle"
|
|
71
69
|
> & {
|
|
72
70
|
presetStyle?: PresetStyle;
|
|
73
|
-
Icon: FunctionComponent<IconProps>;
|
|
74
71
|
};
|