@webstudio-is/sdk-components-react 0.151.0 → 0.163.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/metas.js CHANGED
@@ -63,6 +63,113 @@ var propsMeta = {
63
63
  initialProps: ["clientOnly", "executeScriptOnCanvas"]
64
64
  };
65
65
 
66
+ // src/content-embed.ws.ts
67
+ import { ContentEmbedIcon } from "@webstudio-is/icons/svg";
68
+ import {
69
+ descendantComponent
70
+ } from "@webstudio-is/react-sdk";
71
+ var imagePlaceholder = `
72
+ <svg
73
+ width="140"
74
+ height="140"
75
+ viewBox="0 0 600 600"
76
+ fill="none"
77
+ xmlns="http://www.w3.org/2000/svg"
78
+ >
79
+ <rect width="600" height="600" fill="#CCCCCC" />
80
+ <path
81
+ fill-rule="evenodd"
82
+ clip-rule="evenodd"
83
+ d="M450 170H150C141.716 170 135 176.716 135 185V415C135 423.284 141.716 430 150 430H450C458.284 430 465 423.284 465 415V185C465 176.716 458.284 170 450 170ZM150 145C127.909 145 110 162.909 110 185V415C110 437.091 127.909 455 150 455H450C472.091 455 490 437.091 490 415V185C490 162.909 472.091 145 450 145H150Z"
84
+ fill="#A2A2A2"
85
+ />
86
+ <path
87
+ d="M237.135 235.012C237.135 255.723 220.345 272.512 199.635 272.512C178.924 272.512 162.135 255.723 162.135 235.012C162.135 214.301 178.924 197.512 199.635 197.512C220.345 197.512 237.135 214.301 237.135 235.012Z"
88
+ fill="#A2A2A2"
89
+ />
90
+ <path
91
+ d="M160 405V367.205L221.609 306.364L256.552 338.628L358.161 234L440 316.043V405H160Z"
92
+ fill="#A2A2A2"
93
+ />
94
+ </svg>
95
+ `.trim();
96
+ var htmlSample = `
97
+ <h1>Styling HTML with Content Embed</h1>
98
+ <p>Content Embed allows styling of HTML, which primarily comes from external data.</p>
99
+ <h2>How to Use Content Embed</h2>
100
+ <ul>
101
+ <li>Every element is shown in the Navigator.</li>
102
+ <li>Apply styles and Tokens to each element.</li>
103
+ <li>Adjustments to elements apply universally within this embed, ensuring consistency across your content.</li>
104
+ </ul>
105
+ <hr>
106
+ <h2>This sample text contains all the elements that can be styled.</h2>
107
+ <p>Any elements that were not used above are used below.</p>
108
+ <h3>Heading 3</h3>
109
+ <h4>Heading 4</h4>
110
+ <h5>Heading 5</h5>
111
+ <h6>Heading 6</h6>
112
+ <p><a href="#">Links</a> connect your content to relevant resources.</p>
113
+ <p><strong>Bold text</strong> makes your important points stand out.</p>
114
+ <p><em>Italic text</em> is great for emphasizing terms.</p>
115
+ <ol>
116
+ <li>First Step</li>
117
+ <li>Second Step</li>
118
+ </ol>
119
+ <img src="data:image/svg+xml;base64,${btoa(imagePlaceholder)}">
120
+ <blockquote>Capture attention with a powerful quote.</blockquote>
121
+ <p>Using <code>console.log("Hello World");</code> will log to the console.</p>
122
+ `.trimStart();
123
+ var descendant = (label2, tag) => {
124
+ return {
125
+ type: "instance",
126
+ component: descendantComponent,
127
+ label: label2,
128
+ props: [{ type: "string", name: "selector", value: ` ${tag}` }],
129
+ children: []
130
+ };
131
+ };
132
+ var meta4 = {
133
+ category: "data",
134
+ type: "control",
135
+ label: "Content Embed",
136
+ description: "Content Embed allows styling of HTML, which can be provided via the Code property statically or loaded dynamically from any Resource, for example, from a CMS.",
137
+ icon: ContentEmbedIcon,
138
+ order: 3,
139
+ template: [
140
+ {
141
+ type: "instance",
142
+ component: "HtmlEmbed",
143
+ label: "Content Embed",
144
+ props: [
145
+ {
146
+ name: "code",
147
+ type: "string",
148
+ value: htmlSample
149
+ }
150
+ ],
151
+ children: [
152
+ descendant("Paragraph", "p"),
153
+ descendant("Heading 1", "h1"),
154
+ descendant("Heading 2", "h2"),
155
+ descendant("Heading 3", "h3"),
156
+ descendant("Heading 4", "h4"),
157
+ descendant("Heading 5", "h5"),
158
+ descendant("Heading 6", "h6"),
159
+ descendant("Bold", ":where(strong, b)"),
160
+ descendant("Italic", ":where(em, i)"),
161
+ descendant("Link", "a"),
162
+ descendant("Image", "img"),
163
+ descendant("Blockquote", "blockquote"),
164
+ descendant("Code Text", "code"),
165
+ descendant("List", ":where(ul, ol)"),
166
+ descendant("List Item", "li"),
167
+ descendant("Separator", "hr")
168
+ ]
169
+ }
170
+ ]
171
+ };
172
+
66
173
  // src/body.ws.ts
67
174
  import { BodyIcon } from "@webstudio-is/icons/svg";
68
175
  import {
@@ -82,7 +189,7 @@ var presetStyle = {
82
189
  }
83
190
  ]
84
191
  };
85
- var meta4 = {
192
+ var meta5 = {
86
193
  type: "container",
87
194
  label: "Body",
88
195
  icon: BodyIcon,
@@ -119,7 +226,7 @@ var presetStyle2 = {
119
226
  nav,
120
227
  section
121
228
  };
122
- var meta5 = {
229
+ var meta6 = {
123
230
  category: "general",
124
231
  type: "container",
125
232
  label: "Box",
@@ -145,7 +252,7 @@ var presetStyle3 = {
145
252
  }
146
253
  ]
147
254
  };
148
- var meta6 = {
255
+ var meta7 = {
149
256
  category: "text",
150
257
  type: "container",
151
258
  label: "Text",
@@ -170,7 +277,7 @@ var presetStyle4 = {
170
277
  h5,
171
278
  h6
172
279
  };
173
- var meta7 = {
280
+ var meta8 = {
174
281
  category: "text",
175
282
  type: "container",
176
283
  label: "Heading",
@@ -191,7 +298,7 @@ import { p } from "@webstudio-is/react-sdk/css-normalize";
191
298
  var presetStyle5 = {
192
299
  p
193
300
  };
194
- var meta8 = {
301
+ var meta9 = {
195
302
  category: "text",
196
303
  type: "container",
197
304
  label: "Paragraph",
@@ -780,7 +887,7 @@ var presetStyle6 = {
780
887
  }
781
888
  ]
782
889
  };
783
- var meta9 = {
890
+ var meta10 = {
784
891
  category: "general",
785
892
  type: "container",
786
893
  label: "Link",
@@ -815,8 +922,8 @@ var propsMeta2 = {
815
922
  };
816
923
 
817
924
  // src/rich-text-link.ws.ts
818
- var meta10 = {
819
- ...meta9,
925
+ var meta11 = {
926
+ ...meta10,
820
927
  category: "hidden",
821
928
  type: "rich-text-child",
822
929
  template: []
@@ -831,7 +938,7 @@ import { span } from "@webstudio-is/react-sdk/css-normalize";
831
938
  var presetStyle7 = {
832
939
  span
833
940
  };
834
- var meta11 = {
941
+ var meta12 = {
835
942
  type: "rich-text-child",
836
943
  label: "Text",
837
944
  icon: PaintBrushIcon,
@@ -848,7 +955,7 @@ import { b } from "@webstudio-is/react-sdk/css-normalize";
848
955
  var presetStyle8 = {
849
956
  b
850
957
  };
851
- var meta12 = {
958
+ var meta13 = {
852
959
  type: "rich-text-child",
853
960
  label: "Bold Text",
854
961
  icon: BoldIcon,
@@ -871,7 +978,7 @@ var presetStyle9 = {
871
978
  }
872
979
  ]
873
980
  };
874
- var meta13 = {
981
+ var meta14 = {
875
982
  type: "rich-text-child",
876
983
  label: "Italic Text",
877
984
  icon: TextItalicIcon,
@@ -888,7 +995,7 @@ import { sup } from "@webstudio-is/react-sdk/css-normalize";
888
995
  var presetStyle10 = {
889
996
  sup
890
997
  };
891
- var meta14 = {
998
+ var meta15 = {
892
999
  type: "rich-text-child",
893
1000
  label: "Superscript Text",
894
1001
  icon: SuperscriptIcon,
@@ -905,7 +1012,7 @@ import { sub } from "@webstudio-is/react-sdk/css-normalize";
905
1012
  var presetStyle11 = {
906
1013
  sub
907
1014
  };
908
- var meta15 = {
1015
+ var meta16 = {
909
1016
  type: "rich-text-child",
910
1017
  label: "Subscript Text",
911
1018
  icon: SubscriptIcon,
@@ -922,7 +1029,7 @@ import { button } from "@webstudio-is/react-sdk/css-normalize";
922
1029
  var presetStyle12 = {
923
1030
  button
924
1031
  };
925
- var meta16 = {
1032
+ var meta17 = {
926
1033
  category: "forms",
927
1034
  type: "container",
928
1035
  invalidAncestors: ["Button", "Link"],
@@ -953,7 +1060,7 @@ var presetStyle13 = {
953
1060
  }
954
1061
  ]
955
1062
  };
956
- var meta17 = {
1063
+ var meta18 = {
957
1064
  category: "forms",
958
1065
  invalidAncestors: ["Button", "Link"],
959
1066
  type: "control",
@@ -989,7 +1096,7 @@ var presetStyle14 = {
989
1096
  { property: "minHeight", value: { type: "unit", unit: "px", value: 20 } }
990
1097
  ]
991
1098
  };
992
- var meta18 = {
1099
+ var meta19 = {
993
1100
  category: "forms",
994
1101
  type: "container",
995
1102
  invalidAncestors: ["Form", "Button", "Link"],
@@ -1613,7 +1720,7 @@ var presetStyle15 = {
1613
1720
  }
1614
1721
  ]
1615
1722
  };
1616
- var meta19 = {
1723
+ var meta20 = {
1617
1724
  category: "media",
1618
1725
  type: "embed",
1619
1726
  label: "Image",
@@ -1692,7 +1799,7 @@ var presetStyle16 = {
1692
1799
  }
1693
1800
  ]
1694
1801
  };
1695
- var meta20 = {
1802
+ var meta21 = {
1696
1803
  category: "text",
1697
1804
  type: "container",
1698
1805
  label: "Blockquote",
@@ -1741,7 +1848,7 @@ var presetStyle17 = {
1741
1848
  }
1742
1849
  ]
1743
1850
  };
1744
- var meta21 = {
1851
+ var meta22 = {
1745
1852
  category: "general",
1746
1853
  type: "container",
1747
1854
  label: "List",
@@ -1784,7 +1891,7 @@ import { li } from "@webstudio-is/react-sdk/css-normalize";
1784
1891
  var presetStyle18 = {
1785
1892
  li
1786
1893
  };
1787
- var meta22 = {
1894
+ var meta23 = {
1788
1895
  category: "general",
1789
1896
  type: "container",
1790
1897
  requiredAncestors: ["List"],
@@ -1831,7 +1938,7 @@ var presetStyle19 = {
1831
1938
  }
1832
1939
  ]
1833
1940
  };
1834
- var meta23 = {
1941
+ var meta24 = {
1835
1942
  category: "general",
1836
1943
  type: "embed",
1837
1944
  label: "Separator",
@@ -2378,7 +2485,7 @@ var presetStyle20 = {
2378
2485
  }
2379
2486
  ]
2380
2487
  };
2381
- var meta24 = {
2488
+ var meta25 = {
2382
2489
  category: "general",
2383
2490
  type: "embed",
2384
2491
  label: "Code Text",
@@ -2929,7 +3036,7 @@ var presetStyle21 = {
2929
3036
  { property: "display", value: { type: "keyword", value: "block" } }
2930
3037
  ]
2931
3038
  };
2932
- var meta25 = {
3039
+ var meta26 = {
2933
3040
  category: "forms",
2934
3041
  invalidAncestors: ["Button", "Label"],
2935
3042
  type: "container",
@@ -2974,7 +3081,7 @@ var presetStyle22 = {
2974
3081
  }
2975
3082
  ]
2976
3083
  };
2977
- var meta26 = {
3084
+ var meta27 = {
2978
3085
  category: "forms",
2979
3086
  type: "control",
2980
3087
  label: "Text Area",
@@ -3013,7 +3120,7 @@ var presetStyle23 = {
3013
3120
  }
3014
3121
  ]
3015
3122
  };
3016
- var meta27 = {
3123
+ var meta28 = {
3017
3124
  category: "forms",
3018
3125
  invalidAncestors: ["Button", "Link"],
3019
3126
  type: "control",
@@ -3067,7 +3174,7 @@ var presetStyle24 = {
3067
3174
  }
3068
3175
  ]
3069
3176
  };
3070
- var meta28 = {
3177
+ var meta29 = {
3071
3178
  category: "forms",
3072
3179
  invalidAncestors: ["Button", "Link"],
3073
3180
  type: "control",
@@ -3114,7 +3221,7 @@ import { div as div3 } from "@webstudio-is/react-sdk/css-normalize";
3114
3221
  var presetStyle25 = {
3115
3222
  div: div3
3116
3223
  };
3117
- var meta29 = {
3224
+ var meta30 = {
3118
3225
  category: "media",
3119
3226
  type: "container",
3120
3227
  label: "Vimeo",
@@ -3996,8 +4103,8 @@ var props6 = {
3996
4103
  };
3997
4104
 
3998
4105
  // src/vimeo-preview-image.ws.ts
3999
- var meta30 = {
4000
- ...meta19,
4106
+ var meta31 = {
4107
+ ...meta20,
4001
4108
  category: "hidden",
4002
4109
  label: "Preview Image",
4003
4110
  requiredAncestors: ["Vimeo"]
@@ -4016,7 +4123,7 @@ import { button as button2 } from "@webstudio-is/react-sdk/css-normalize";
4016
4123
  var presetStyle26 = {
4017
4124
  button: button2
4018
4125
  };
4019
- var meta31 = {
4126
+ var meta32 = {
4020
4127
  category: "hidden",
4021
4128
  type: "container",
4022
4129
  invalidAncestors: ["Button"],
@@ -4036,7 +4143,7 @@ import { BoxIcon as BoxIcon2 } from "@webstudio-is/icons/svg";
4036
4143
  var presetStyle27 = {
4037
4144
  div: div4
4038
4145
  };
4039
- var meta32 = {
4146
+ var meta33 = {
4040
4147
  type: "container",
4041
4148
  icon: BoxIcon2,
4042
4149
  states: defaultStates27,
@@ -4049,7 +4156,7 @@ var meta32 = {
4049
4156
  // src/xml-node.ws.ts
4050
4157
  import { XmlIcon } from "@webstudio-is/icons/svg";
4051
4158
  import "@webstudio-is/react-sdk";
4052
- var meta33 = {
4159
+ var meta34 = {
4053
4160
  category: "xml",
4054
4161
  order: 6,
4055
4162
  type: "container",
@@ -4057,38 +4164,59 @@ var meta33 = {
4057
4164
  stylable: false,
4058
4165
  description: "Xml Node"
4059
4166
  };
4167
+
4168
+ // src/time.ws.ts
4169
+ import { CalendarIcon } from "@webstudio-is/icons/svg";
4170
+ import {
4171
+ defaultStates as defaultStates28
4172
+ } from "@webstudio-is/react-sdk";
4173
+ import { time } from "@webstudio-is/react-sdk/css-normalize";
4174
+ var presetStyle28 = {
4175
+ time
4176
+ };
4177
+ var meta35 = {
4178
+ category: "data",
4179
+ type: "container",
4180
+ description: "Converts machine-readable date and time to a human-readable format.",
4181
+ icon: CalendarIcon,
4182
+ states: defaultStates28,
4183
+ presetStyle: presetStyle28,
4184
+ order: 4
4185
+ };
4060
4186
  export {
4061
- meta20 as Blockquote,
4062
- meta4 as Body,
4063
- meta12 as Bold,
4064
- meta5 as Box,
4065
- meta16 as Button,
4066
- meta28 as Checkbox,
4067
- meta24 as CodeText,
4068
- meta18 as Form,
4187
+ meta21 as Blockquote,
4188
+ meta5 as Body,
4189
+ meta13 as Bold,
4190
+ meta6 as Box,
4191
+ meta17 as Button,
4192
+ meta29 as Checkbox,
4193
+ meta25 as CodeText,
4194
+ meta4 as ContentEmbed,
4195
+ meta19 as Form,
4069
4196
  meta2 as Fragment,
4070
- meta7 as Heading,
4197
+ meta8 as Heading,
4071
4198
  meta3 as HtmlEmbed,
4072
- meta19 as Image,
4073
- meta17 as Input,
4074
- meta13 as Italic,
4075
- meta25 as Label,
4076
- meta9 as Link,
4077
- meta21 as List,
4078
- meta22 as ListItem,
4079
- meta8 as Paragraph,
4080
- meta27 as RadioButton,
4081
- meta10 as RichTextLink,
4082
- meta23 as Separator,
4199
+ meta20 as Image,
4200
+ meta18 as Input,
4201
+ meta14 as Italic,
4202
+ meta26 as Label,
4203
+ meta10 as Link,
4204
+ meta22 as List,
4205
+ meta23 as ListItem,
4206
+ meta9 as Paragraph,
4207
+ meta28 as RadioButton,
4208
+ meta11 as RichTextLink,
4209
+ meta24 as Separator,
4083
4210
  meta as Slot,
4084
- meta11 as Span,
4085
- meta15 as Subscript,
4086
- meta14 as Superscript,
4087
- meta6 as Text,
4088
- meta26 as Textarea,
4089
- meta29 as Vimeo,
4090
- meta31 as VimeoPlayButton,
4091
- meta30 as VimeoPreviewImage,
4092
- meta32 as VimeoSpinner,
4093
- meta33 as XmlNode
4211
+ meta12 as Span,
4212
+ meta16 as Subscript,
4213
+ meta15 as Superscript,
4214
+ meta7 as Text,
4215
+ meta27 as Textarea,
4216
+ meta35 as Time,
4217
+ meta30 as Vimeo,
4218
+ meta32 as VimeoPlayButton,
4219
+ meta31 as VimeoPreviewImage,
4220
+ meta33 as VimeoSpinner,
4221
+ meta34 as XmlNode
4094
4222
  };