@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.
Files changed (172) hide show
  1. package/lib/app/custom-components/form.ws.js +2 -2
  2. package/lib/app/custom-components/image.js +7 -13
  3. package/lib/app/custom-components/index.js +4 -1
  4. package/lib/app/params.js +1 -0
  5. package/lib/cjs/app/custom-components/form.ws.js +2 -2
  6. package/lib/cjs/app/custom-components/image.js +3 -12
  7. package/lib/cjs/app/custom-components/index.js +4 -1
  8. package/lib/cjs/app/params.js +1 -0
  9. package/lib/cjs/components/__generated__/{code.props.js → code-text.props.js} +3 -3
  10. package/lib/cjs/components/__generated__/html-embed.props.js +31 -0
  11. package/lib/cjs/components/blockquote.ws.js +2 -2
  12. package/lib/cjs/components/body.ws.js +2 -2
  13. package/lib/cjs/components/bold.ws.js +2 -2
  14. package/lib/cjs/components/box.ws.js +2 -2
  15. package/lib/cjs/components/button.ws.js +2 -2
  16. package/lib/cjs/components/checkbox-field.ws.js +2 -2
  17. package/lib/cjs/components/checkbox.ws.js +2 -2
  18. package/lib/cjs/components/{code.js → code-text.js} +6 -6
  19. package/lib/cjs/components/{code.ws.js → code-text.ws.js} +10 -10
  20. package/lib/cjs/components/component-meta.js +2 -2
  21. package/lib/cjs/components/components-utils.js +1 -43
  22. package/lib/cjs/components/components.js +4 -2
  23. package/lib/cjs/components/error-message.ws.js +2 -2
  24. package/lib/cjs/components/form.ws.js +2 -2
  25. package/lib/cjs/components/fragment.ws.js +1 -1
  26. package/lib/cjs/components/heading.ws.js +2 -2
  27. package/lib/cjs/components/html-embed.js +80 -0
  28. package/lib/cjs/components/html-embed.ws.js +43 -0
  29. package/lib/cjs/components/image.ws.js +2 -2
  30. package/lib/cjs/components/index.js +11 -57
  31. package/lib/cjs/components/input.ws.js +2 -2
  32. package/lib/cjs/components/italic.ws.js +2 -2
  33. package/lib/cjs/components/label.ws.js +2 -2
  34. package/lib/cjs/components/link-block.ws.js +2 -2
  35. package/lib/cjs/components/link.ws.js +2 -2
  36. package/lib/cjs/components/list-item.ws.js +2 -2
  37. package/lib/cjs/components/list.ws.js +2 -2
  38. package/lib/cjs/components/paragraph.ws.js +2 -2
  39. package/lib/cjs/components/radio-button-field.ws.js +2 -2
  40. package/lib/cjs/components/radio-button.ws.js +2 -2
  41. package/lib/cjs/components/separator.ws.js +2 -2
  42. package/lib/cjs/components/slot.ws.js +2 -2
  43. package/lib/cjs/components/span.ws.js +2 -2
  44. package/lib/cjs/components/subscript.ws.js +2 -2
  45. package/lib/cjs/components/success-message.ws.js +2 -2
  46. package/lib/cjs/components/superscript.ws.js +2 -2
  47. package/lib/cjs/components/text-block.ws.js +2 -2
  48. package/lib/cjs/components/textarea.ws.js +2 -2
  49. package/lib/cjs/css/css.js +2 -5
  50. package/lib/cjs/css/normalize.js +1 -1
  51. package/lib/cjs/css/presets.js +8 -1
  52. package/lib/cjs/tree/create-elements-tree.js +2 -4
  53. package/lib/components/__generated__/html-embed.props.js +11 -0
  54. package/lib/components/blockquote.ws.js +2 -2
  55. package/lib/components/body.ws.js +2 -2
  56. package/lib/components/bold.ws.js +2 -2
  57. package/lib/components/box.ws.js +2 -2
  58. package/lib/components/button.ws.js +2 -2
  59. package/lib/components/checkbox-field.ws.js +2 -2
  60. package/lib/components/checkbox.ws.js +2 -2
  61. package/lib/components/{code.js → code-text.js} +3 -3
  62. package/lib/components/{code.ws.js → code-text.ws.js} +5 -5
  63. package/lib/components/component-meta.js +3 -3
  64. package/lib/components/components-utils.js +1 -43
  65. package/lib/components/components.js +4 -2
  66. package/lib/components/error-message.ws.js +2 -2
  67. package/lib/components/form.ws.js +2 -2
  68. package/lib/components/fragment.ws.js +1 -1
  69. package/lib/components/heading.ws.js +2 -2
  70. package/lib/components/html-embed.js +65 -0
  71. package/lib/components/html-embed.ws.js +23 -0
  72. package/lib/components/image.ws.js +2 -2
  73. package/lib/components/index.js +11 -57
  74. package/lib/components/input.ws.js +2 -2
  75. package/lib/components/italic.ws.js +2 -2
  76. package/lib/components/label.ws.js +2 -2
  77. package/lib/components/link-block.ws.js +2 -2
  78. package/lib/components/link.ws.js +2 -2
  79. package/lib/components/list-item.ws.js +2 -2
  80. package/lib/components/list.ws.js +2 -2
  81. package/lib/components/paragraph.ws.js +2 -2
  82. package/lib/components/radio-button-field.ws.js +2 -2
  83. package/lib/components/radio-button.ws.js +2 -2
  84. package/lib/components/separator.ws.js +2 -2
  85. package/lib/components/slot.ws.js +2 -2
  86. package/lib/components/span.ws.js +2 -2
  87. package/lib/components/subscript.ws.js +2 -2
  88. package/lib/components/success-message.ws.js +2 -2
  89. package/lib/components/superscript.ws.js +2 -2
  90. package/lib/components/text-block.ws.js +2 -2
  91. package/lib/components/textarea.ws.js +2 -2
  92. package/lib/css/css.js +2 -5
  93. package/lib/css/normalize.js +2 -2
  94. package/lib/css/presets.js +8 -1
  95. package/lib/tree/create-elements-tree.js +2 -4
  96. package/lib/types/app/params.d.ts +22 -1
  97. package/lib/types/components/__generated__/html-embed.props.d.ts +2 -0
  98. package/lib/types/components/{code.d.ts → code-text.d.ts} +1 -1
  99. package/lib/types/components/{code.stories.d.ts → code-text.stories.d.ts} +1 -1
  100. package/lib/types/components/component-meta.d.ts +1785 -10
  101. package/lib/types/components/components-utils.d.ts +6 -3
  102. package/lib/types/components/components.d.ts +2 -1
  103. package/lib/types/components/html-embed.d.ts +7 -0
  104. package/lib/types/components/html-embed.stories.d.ts +11 -0
  105. package/lib/types/components/html-embed.ws.d.ts +3 -0
  106. package/lib/types/components/index.d.ts +2 -2
  107. package/lib/types/context.d.ts +1 -0
  108. package/lib/types/css/css.d.ts +2 -0
  109. package/lib/types/css/presets.d.ts +1 -0
  110. package/lib/types/css/style-rules.d.ts +1 -1
  111. package/lib/types/embed-template.d.ts +1 -1
  112. package/lib/types/tree/create-elements-tree.d.ts +2 -2
  113. package/package.json +14 -13
  114. package/src/app/custom-components/form.ws.tsx +2 -2
  115. package/src/app/custom-components/image.tsx +7 -13
  116. package/src/app/custom-components/index.ts +4 -1
  117. package/src/app/params.ts +23 -1
  118. package/src/components/__generated__/html-embed.props.ts +10 -0
  119. package/src/components/blockquote.ws.tsx +2 -2
  120. package/src/components/body.ws.tsx +2 -2
  121. package/src/components/bold.ws.tsx +2 -2
  122. package/src/components/box.ws.ts +2 -2
  123. package/src/components/button.ws.tsx +2 -2
  124. package/src/components/checkbox-field.ws.tsx +2 -2
  125. package/src/components/checkbox.ws.tsx +2 -2
  126. package/src/components/code-text.stories.tsx +16 -0
  127. package/src/components/{code.tsx → code-text.tsx} +2 -2
  128. package/src/components/{code.ws.tsx → code-text.ws.tsx} +5 -5
  129. package/src/components/component-meta.ts +3 -6
  130. package/src/components/components-utils.ts +14 -58
  131. package/src/components/components.ts +2 -1
  132. package/src/components/error-message.ws.tsx +2 -2
  133. package/src/components/form.ws.tsx +2 -2
  134. package/src/components/fragment.ws.ts +1 -1
  135. package/src/components/heading.ws.tsx +2 -2
  136. package/src/components/html-embed.stories.tsx +16 -0
  137. package/src/components/html-embed.tsx +96 -0
  138. package/src/components/html-embed.ws.ts +22 -0
  139. package/src/components/image.ws.tsx +2 -2
  140. package/src/components/index.ts +10 -87
  141. package/src/components/input.ws.tsx +2 -2
  142. package/src/components/italic.ws.tsx +2 -2
  143. package/src/components/label.ws.tsx +2 -2
  144. package/src/components/link-block.ws.tsx +2 -2
  145. package/src/components/link.ws.tsx +2 -2
  146. package/src/components/list-item.ws.tsx +2 -2
  147. package/src/components/list.ws.tsx +2 -2
  148. package/src/components/paragraph.ws.tsx +2 -2
  149. package/src/components/radio-button-field.ws.tsx +2 -2
  150. package/src/components/radio-button.ws.tsx +2 -2
  151. package/src/components/separator.ws.tsx +2 -2
  152. package/src/components/slot.ws.ts +2 -2
  153. package/src/components/span.ws.tsx +2 -2
  154. package/src/components/subscript.ws.tsx +2 -2
  155. package/src/components/success-message.ws.tsx +2 -2
  156. package/src/components/superscript.ws.tsx +2 -2
  157. package/src/components/text-block.ws.tsx +2 -2
  158. package/src/components/textarea.ws.tsx +2 -2
  159. package/src/context.tsx +1 -0
  160. package/src/css/css.ts +4 -5
  161. package/src/css/normalize.ts +2 -2
  162. package/src/css/presets.ts +7 -0
  163. package/src/tree/create-elements-tree.tsx +3 -5
  164. package/lib/cjs/tree/session-storage-polyfill.js +0 -65
  165. package/lib/tree/session-storage-polyfill.js +0 -45
  166. package/lib/types/tree/session-storage-polyfill.d.ts +0 -2
  167. package/src/components/code.stories.tsx +0 -16
  168. package/src/tree/session-storage-polyfill.tsx +0 -50
  169. /package/lib/components/__generated__/{code.props.js → code-text.props.js} +0 -0
  170. /package/lib/types/components/__generated__/{code.props.d.ts → code-text.props.d.ts} +0 -0
  171. /package/lib/types/components/{code.ws.d.ts → code-text.ws.d.ts} +0 -0
  172. /package/src/components/__generated__/{code.props.ts → code-text.props.ts} +0 -0
@@ -1,8 +1,11 @@
1
- import type { forwardRef } from "react";
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
- export declare const getComponentNames: () => ComponentName[];
5
- type AnyComponent = ReturnType<typeof forwardRef<any, any>>;
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 { Code } from "./code";
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,7 @@
1
+ /// <reference types="react" />
2
+ type Props = {
3
+ code: string;
4
+ executeScriptOnCanvas: boolean;
5
+ };
6
+ export declare const HtmlEmbed: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLDivElement>>;
7
+ export {};
@@ -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>>>;
@@ -0,0 +1,3 @@
1
+ import type { WsComponentMeta, WsComponentPropsMeta } from "./component-meta";
2
+ export declare const meta: WsComponentMeta;
3
+ export declare const propsMeta: WsComponentPropsMeta;
@@ -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 getComponentPropsMeta: (name: string) => WsComponentPropsMeta | undefined;
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
  }>;
@@ -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>;
@@ -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;
@@ -1,2 +1,3 @@
1
1
  import type { Styles } from "./normalize";
2
2
  export declare const borders: Styles;
3
+ export declare const outline: Styles;
@@ -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, sandbox, propsByInstanceIdStore, assetsStore, pagesStore, Component, getComponent, }: {
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.65.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.65.0",
39
- "@webstudio-is/css-data": "^0.65.0",
40
- "@webstudio-is/css-engine": "^0.65.0",
41
- "@webstudio-is/css-vars": "^0.65.0",
42
- "@webstudio-is/fonts": "^0.65.0",
43
- "@webstudio-is/generate-arg-types": "^0.65.0",
44
- "@webstudio-is/icons": "^0.65.0",
45
- "@webstudio-is/image": "^0.65.0",
46
- "@webstudio-is/prisma-client": "^0.65.0",
47
- "@webstudio-is/project-build": "^0.65.0",
48
- "@webstudio-is/form-handlers": "^0.65.0"
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
- Icon: FormIcon,
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 { Image as WebstudioImage, loaders } from "@webstudio-is/image";
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
- if (asset === undefined) {
23
- return null;
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: { props: imageProps },
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
- resizeOrigin?: string;
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
- Icon: BlockquoteIcon,
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
- Icon: BodyIcon,
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
- Icon: BoldIcon,
19
+ icon: BoldIcon,
20
20
  states: defaultStates,
21
21
  presetStyle,
22
22
  };
@@ -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
- Icon: BoxIcon,
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
- Icon: ButtonElementIcon,
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
- Icon: CheckboxCheckedIcon,
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
- Icon: CheckboxCheckedIcon,
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 Code = forwardRef<ElementRef<typeof defaultTag>, Props>(
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
- Code.displayName = "Code";
31
+ CodeText.displayName = "CodeText";
@@ -1,12 +1,12 @@
1
- import { CodeIcon } from "@webstudio-is/icons";
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
- Icon: CodeIcon,
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
- Icon: z.function(),
63
- presetStyle: z.optional(z.any()),
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" | "Icon"
68
+ "presetStyle"
71
69
  > & {
72
70
  presetStyle?: PresetStyle;
73
- Icon: FunctionComponent<IconProps>;
74
71
  };