@webstudio-is/react-sdk 0.218.0 → 0.219.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/index.js +63 -450
- package/lib/runtime.js +9 -2
- package/lib/types/__generated__/standard-attributes.d.ts +2 -0
- package/lib/types/component-generator.d.ts +4 -2
- package/lib/types/index.d.ts +1 -0
- package/lib/types/page-settings-meta.d.ts +2 -1
- package/lib/types/props.d.ts +0 -1
- package/package.json +8 -8
- package/lib/types/standard-attributes.d.ts +0 -7
package/lib/index.js
CHANGED
|
@@ -155,7 +155,6 @@ var componentAttribute = "data-ws-component";
|
|
|
155
155
|
var showAttribute = "data-ws-show";
|
|
156
156
|
var collapsedAttribute = "data-ws-collapsed";
|
|
157
157
|
var textContentAttribute = "data-ws-text-content";
|
|
158
|
-
var animationCanPlayOnCanvasAttribute = "data-ws-animation-can-play-on-canvas";
|
|
159
158
|
var attributeNameStartChar = "A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD";
|
|
160
159
|
var attributeNameChar = attributeNameStartChar + ":\\-0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040";
|
|
161
160
|
var validAttributeNameRegex = new RegExp(
|
|
@@ -194,505 +193,111 @@ import {
|
|
|
194
193
|
} from "@webstudio-is/sdk";
|
|
195
194
|
import { indexProperty, tagProperty } from "@webstudio-is/sdk/runtime";
|
|
196
195
|
|
|
197
|
-
// src/standard-attributes.ts
|
|
196
|
+
// src/__generated__/standard-attributes.ts
|
|
198
197
|
var standardAttributesToReactProps = {
|
|
199
|
-
// HTML
|
|
200
|
-
accept: "accept",
|
|
201
|
-
acceptcharset: "acceptCharset",
|
|
202
198
|
"accept-charset": "acceptCharset",
|
|
203
199
|
accesskey: "accessKey",
|
|
204
|
-
action: "action",
|
|
205
200
|
allowfullscreen: "allowFullScreen",
|
|
206
|
-
alt: "alt",
|
|
207
|
-
as: "as",
|
|
208
|
-
async: "async",
|
|
209
201
|
autocapitalize: "autoCapitalize",
|
|
210
202
|
autocomplete: "autoComplete",
|
|
211
203
|
autocorrect: "autoCorrect",
|
|
212
204
|
autofocus: "autoFocus",
|
|
213
205
|
autoplay: "autoPlay",
|
|
214
|
-
autosave: "autoSave",
|
|
215
|
-
capture: "capture",
|
|
216
|
-
cellpadding: "cellPadding",
|
|
217
|
-
cellspacing: "cellSpacing",
|
|
218
|
-
challenge: "challenge",
|
|
219
206
|
charset: "charSet",
|
|
220
|
-
checked: "checked",
|
|
221
|
-
children: "children",
|
|
222
|
-
cite: "cite",
|
|
223
207
|
class: "className",
|
|
224
|
-
classid: "classID",
|
|
225
|
-
classname: "className",
|
|
226
|
-
cols: "cols",
|
|
227
208
|
colspan: "colSpan",
|
|
228
|
-
content: "content",
|
|
229
209
|
contenteditable: "contentEditable",
|
|
230
|
-
contextmenu: "contextMenu",
|
|
231
|
-
controls: "controls",
|
|
232
|
-
controlslist: "controlsList",
|
|
233
|
-
coords: "coords",
|
|
234
210
|
crossorigin: "crossOrigin",
|
|
235
|
-
dangerouslysetinnerhtml: "dangerouslySetInnerHTML",
|
|
236
|
-
data: "data",
|
|
237
211
|
datetime: "dateTime",
|
|
238
|
-
default: "default",
|
|
239
|
-
defaultchecked: "defaultChecked",
|
|
240
|
-
defaultvalue: "defaultValue",
|
|
241
|
-
defer: "defer",
|
|
242
|
-
dir: "dir",
|
|
243
|
-
disabled: "disabled",
|
|
244
|
-
disablepictureinpicture: "disablePictureInPicture",
|
|
245
|
-
disableremoteplayback: "disableRemotePlayback",
|
|
246
|
-
download: "download",
|
|
247
|
-
draggable: "draggable",
|
|
248
212
|
enctype: "encType",
|
|
249
213
|
enterkeyhint: "enterKeyHint",
|
|
250
214
|
fetchpriority: "fetchPriority",
|
|
251
215
|
for: "htmlFor",
|
|
252
|
-
form: "form",
|
|
253
216
|
formmethod: "formMethod",
|
|
254
217
|
formaction: "formAction",
|
|
255
218
|
formenctype: "formEncType",
|
|
256
219
|
formnovalidate: "formNoValidate",
|
|
257
220
|
formtarget: "formTarget",
|
|
258
|
-
frameborder: "frameBorder",
|
|
259
|
-
headers: "headers",
|
|
260
|
-
height: "height",
|
|
261
|
-
hidden: "hidden",
|
|
262
|
-
high: "high",
|
|
263
|
-
href: "href",
|
|
264
221
|
hreflang: "hrefLang",
|
|
265
|
-
htmlfor: "htmlFor",
|
|
266
|
-
httpequiv: "httpEquiv",
|
|
267
222
|
"http-equiv": "httpEquiv",
|
|
268
|
-
icon: "icon",
|
|
269
|
-
id: "id",
|
|
270
223
|
imagesizes: "imageSizes",
|
|
271
224
|
imagesrcset: "imageSrcSet",
|
|
272
|
-
inert: "inert",
|
|
273
|
-
innerhtml: "innerHTML",
|
|
274
225
|
inputmode: "inputMode",
|
|
275
|
-
integrity: "integrity",
|
|
276
|
-
is: "is",
|
|
277
226
|
itemid: "itemID",
|
|
278
227
|
itemprop: "itemProp",
|
|
279
228
|
itemref: "itemRef",
|
|
280
229
|
itemscope: "itemScope",
|
|
281
230
|
itemtype: "itemType",
|
|
282
|
-
keyparams: "keyParams",
|
|
283
|
-
keytype: "keyType",
|
|
284
|
-
kind: "kind",
|
|
285
|
-
label: "label",
|
|
286
|
-
lang: "lang",
|
|
287
|
-
list: "list",
|
|
288
|
-
loop: "loop",
|
|
289
|
-
low: "low",
|
|
290
|
-
manifest: "manifest",
|
|
291
|
-
marginwidth: "marginWidth",
|
|
292
|
-
marginheight: "marginHeight",
|
|
293
|
-
max: "max",
|
|
294
231
|
maxlength: "maxLength",
|
|
295
|
-
media: "media",
|
|
296
|
-
mediagroup: "mediaGroup",
|
|
297
|
-
method: "method",
|
|
298
|
-
min: "min",
|
|
299
232
|
minlength: "minLength",
|
|
300
|
-
multiple: "multiple",
|
|
301
|
-
muted: "muted",
|
|
302
|
-
name: "name",
|
|
303
233
|
nomodule: "noModule",
|
|
304
|
-
nonce: "nonce",
|
|
305
234
|
novalidate: "noValidate",
|
|
306
|
-
open: "open",
|
|
307
|
-
optimum: "optimum",
|
|
308
|
-
pattern: "pattern",
|
|
309
|
-
placeholder: "placeholder",
|
|
310
235
|
playsinline: "playsInline",
|
|
311
|
-
poster: "poster",
|
|
312
|
-
preload: "preload",
|
|
313
|
-
profile: "profile",
|
|
314
|
-
radiogroup: "radioGroup",
|
|
315
236
|
readonly: "readOnly",
|
|
316
237
|
referrerpolicy: "referrerPolicy",
|
|
317
|
-
rel: "rel",
|
|
318
|
-
required: "required",
|
|
319
|
-
reversed: "reversed",
|
|
320
|
-
role: "role",
|
|
321
|
-
rows: "rows",
|
|
322
238
|
rowspan: "rowSpan",
|
|
323
|
-
sandbox: "sandbox",
|
|
324
|
-
scope: "scope",
|
|
325
|
-
scoped: "scoped",
|
|
326
|
-
scrolling: "scrolling",
|
|
327
|
-
seamless: "seamless",
|
|
328
|
-
selected: "selected",
|
|
329
|
-
shape: "shape",
|
|
330
|
-
size: "size",
|
|
331
|
-
sizes: "sizes",
|
|
332
|
-
span: "span",
|
|
333
239
|
spellcheck: "spellCheck",
|
|
334
|
-
src: "src",
|
|
335
240
|
srcdoc: "srcDoc",
|
|
336
241
|
srclang: "srcLang",
|
|
337
242
|
srcset: "srcSet",
|
|
338
|
-
start: "start",
|
|
339
|
-
step: "step",
|
|
340
|
-
style: "style",
|
|
341
|
-
summary: "summary",
|
|
342
243
|
tabindex: "tabIndex",
|
|
343
|
-
target: "target",
|
|
344
|
-
title: "title",
|
|
345
|
-
type: "type",
|
|
346
244
|
usemap: "useMap",
|
|
347
|
-
value: "value",
|
|
348
|
-
width: "width",
|
|
349
|
-
wmode: "wmode",
|
|
350
|
-
wrap: "wrap",
|
|
351
|
-
// SVG
|
|
352
|
-
about: "about",
|
|
353
|
-
accentheight: "accentHeight",
|
|
354
|
-
"accent-height": "accentHeight",
|
|
355
|
-
accumulate: "accumulate",
|
|
356
|
-
additive: "additive",
|
|
357
|
-
alignmentbaseline: "alignmentBaseline",
|
|
358
|
-
"alignment-baseline": "alignmentBaseline",
|
|
359
|
-
allowreorder: "allowReorder",
|
|
360
|
-
alphabetic: "alphabetic",
|
|
361
|
-
amplitude: "amplitude",
|
|
362
|
-
arabicform: "arabicForm",
|
|
363
|
-
"arabic-form": "arabicForm",
|
|
364
|
-
ascent: "ascent",
|
|
365
|
-
attributename: "attributeName",
|
|
366
|
-
attributetype: "attributeType",
|
|
367
|
-
autoreverse: "autoReverse",
|
|
368
|
-
azimuth: "azimuth",
|
|
369
|
-
basefrequency: "baseFrequency",
|
|
370
|
-
baselineshift: "baselineShift",
|
|
371
|
-
"baseline-shift": "baselineShift",
|
|
372
|
-
baseprofile: "baseProfile",
|
|
373
|
-
bbox: "bbox",
|
|
374
|
-
begin: "begin",
|
|
375
|
-
bias: "bias",
|
|
376
|
-
by: "by",
|
|
377
|
-
calcmode: "calcMode",
|
|
378
|
-
capheight: "capHeight",
|
|
379
|
-
"cap-height": "capHeight",
|
|
380
|
-
clip: "clip",
|
|
381
|
-
clippath: "clipPath",
|
|
382
|
-
"clip-path": "clipPath",
|
|
383
|
-
clippathunits: "clipPathUnits",
|
|
384
|
-
cliprule: "clipRule",
|
|
385
|
-
"clip-rule": "clipRule",
|
|
386
|
-
color: "color",
|
|
387
|
-
colorinterpolation: "colorInterpolation",
|
|
388
|
-
"color-interpolation": "colorInterpolation",
|
|
389
|
-
colorinterpolationfilters: "colorInterpolationFilters",
|
|
390
|
-
"color-interpolation-filters": "colorInterpolationFilters",
|
|
391
|
-
colorprofile: "colorProfile",
|
|
392
|
-
"color-profile": "colorProfile",
|
|
393
|
-
colorrendering: "colorRendering",
|
|
394
|
-
"color-rendering": "colorRendering",
|
|
395
|
-
contentscripttype: "contentScriptType",
|
|
396
|
-
contentstyletype: "contentStyleType",
|
|
397
|
-
cursor: "cursor",
|
|
398
|
-
cx: "cx",
|
|
399
|
-
cy: "cy",
|
|
400
|
-
d: "d",
|
|
401
|
-
datatype: "datatype",
|
|
402
|
-
decelerate: "decelerate",
|
|
403
|
-
descent: "descent",
|
|
404
|
-
diffuseconstant: "diffuseConstant",
|
|
405
|
-
direction: "direction",
|
|
406
|
-
display: "display",
|
|
407
|
-
divisor: "divisor",
|
|
408
|
-
dominantbaseline: "dominantBaseline",
|
|
409
|
-
"dominant-baseline": "dominantBaseline",
|
|
410
|
-
dur: "dur",
|
|
411
|
-
dx: "dx",
|
|
412
|
-
dy: "dy",
|
|
413
|
-
edgemode: "edgeMode",
|
|
414
|
-
elevation: "elevation",
|
|
415
|
-
enablebackground: "enableBackground",
|
|
416
|
-
"enable-background": "enableBackground",
|
|
417
|
-
end: "end",
|
|
418
|
-
exponent: "exponent",
|
|
419
|
-
externalresourcesrequired: "externalResourcesRequired",
|
|
420
|
-
fill: "fill",
|
|
421
|
-
fillopacity: "fillOpacity",
|
|
422
|
-
"fill-opacity": "fillOpacity",
|
|
423
|
-
fillrule: "fillRule",
|
|
424
|
-
"fill-rule": "fillRule",
|
|
425
|
-
filter: "filter",
|
|
426
|
-
filterres: "filterRes",
|
|
427
|
-
filterunits: "filterUnits",
|
|
428
|
-
floodopacity: "floodOpacity",
|
|
429
|
-
"flood-opacity": "floodOpacity",
|
|
430
|
-
floodcolor: "floodColor",
|
|
431
|
-
"flood-color": "floodColor",
|
|
432
|
-
focusable: "focusable",
|
|
433
|
-
fontfamily: "fontFamily",
|
|
434
|
-
"font-family": "fontFamily",
|
|
435
|
-
fontsize: "fontSize",
|
|
436
|
-
"font-size": "fontSize",
|
|
437
|
-
fontsizeadjust: "fontSizeAdjust",
|
|
438
|
-
"font-size-adjust": "fontSizeAdjust",
|
|
439
|
-
fontstretch: "fontStretch",
|
|
440
|
-
"font-stretch": "fontStretch",
|
|
441
|
-
fontstyle: "fontStyle",
|
|
442
|
-
"font-style": "fontStyle",
|
|
443
|
-
fontvariant: "fontVariant",
|
|
444
|
-
"font-variant": "fontVariant",
|
|
445
|
-
fontweight: "fontWeight",
|
|
446
|
-
"font-weight": "fontWeight",
|
|
447
|
-
format: "format",
|
|
448
|
-
from: "from",
|
|
449
|
-
fx: "fx",
|
|
450
|
-
fy: "fy",
|
|
451
|
-
g1: "g1",
|
|
452
|
-
g2: "g2",
|
|
453
|
-
glyphname: "glyphName",
|
|
454
|
-
"glyph-name": "glyphName",
|
|
455
|
-
glyphorientationhorizontal: "glyphOrientationHorizontal",
|
|
456
|
-
"glyph-orientation-horizontal": "glyphOrientationHorizontal",
|
|
457
|
-
glyphorientationvertical: "glyphOrientationVertical",
|
|
458
|
-
"glyph-orientation-vertical": "glyphOrientationVertical",
|
|
459
|
-
glyphref: "glyphRef",
|
|
460
|
-
gradienttransform: "gradientTransform",
|
|
461
|
-
gradientunits: "gradientUnits",
|
|
462
|
-
hanging: "hanging",
|
|
463
|
-
horizadvx: "horizAdvX",
|
|
464
|
-
"horiz-adv-x": "horizAdvX",
|
|
465
|
-
horizoriginx: "horizOriginX",
|
|
466
|
-
"horiz-origin-x": "horizOriginX",
|
|
467
|
-
ideographic: "ideographic",
|
|
468
|
-
imagerendering: "imageRendering",
|
|
469
|
-
"image-rendering": "imageRendering",
|
|
470
|
-
in2: "in2",
|
|
471
|
-
in: "in",
|
|
472
|
-
inlist: "inlist",
|
|
473
|
-
intercept: "intercept",
|
|
474
|
-
k1: "k1",
|
|
475
|
-
k2: "k2",
|
|
476
|
-
k3: "k3",
|
|
477
|
-
k4: "k4",
|
|
478
|
-
k: "k",
|
|
479
|
-
kernelmatrix: "kernelMatrix",
|
|
480
|
-
kernelunitlength: "kernelUnitLength",
|
|
481
|
-
kerning: "kerning",
|
|
482
|
-
keypoints: "keyPoints",
|
|
483
|
-
keysplines: "keySplines",
|
|
484
|
-
keytimes: "keyTimes",
|
|
485
|
-
lengthadjust: "lengthAdjust",
|
|
486
|
-
letterspacing: "letterSpacing",
|
|
487
|
-
"letter-spacing": "letterSpacing",
|
|
488
|
-
lightingcolor: "lightingColor",
|
|
489
|
-
"lighting-color": "lightingColor",
|
|
490
|
-
limitingconeangle: "limitingConeAngle",
|
|
491
|
-
local: "local",
|
|
492
|
-
markerend: "markerEnd",
|
|
493
|
-
"marker-end": "markerEnd",
|
|
494
|
-
markerheight: "markerHeight",
|
|
495
|
-
markermid: "markerMid",
|
|
496
|
-
"marker-mid": "markerMid",
|
|
497
|
-
markerstart: "markerStart",
|
|
498
|
-
"marker-start": "markerStart",
|
|
499
|
-
markerunits: "markerUnits",
|
|
500
|
-
markerwidth: "markerWidth",
|
|
501
|
-
mask: "mask",
|
|
502
|
-
maskcontentunits: "maskContentUnits",
|
|
503
|
-
maskunits: "maskUnits",
|
|
504
|
-
mathematical: "mathematical",
|
|
505
|
-
mode: "mode",
|
|
506
|
-
numoctaves: "numOctaves",
|
|
507
|
-
offset: "offset",
|
|
508
|
-
opacity: "opacity",
|
|
509
|
-
operator: "operator",
|
|
510
|
-
order: "order",
|
|
511
|
-
orient: "orient",
|
|
512
|
-
orientation: "orientation",
|
|
513
|
-
origin: "origin",
|
|
514
|
-
overflow: "overflow",
|
|
515
|
-
overlineposition: "overlinePosition",
|
|
516
|
-
"overline-position": "overlinePosition",
|
|
517
|
-
overlinethickness: "overlineThickness",
|
|
518
|
-
"overline-thickness": "overlineThickness",
|
|
519
|
-
paintorder: "paintOrder",
|
|
520
|
-
"paint-order": "paintOrder",
|
|
521
|
-
panose1: "panose1",
|
|
522
|
-
"panose-1": "panose1",
|
|
523
|
-
pathlength: "pathLength",
|
|
524
|
-
patterncontentunits: "patternContentUnits",
|
|
525
|
-
patterntransform: "patternTransform",
|
|
526
|
-
patternunits: "patternUnits",
|
|
527
|
-
pointerevents: "pointerEvents",
|
|
528
|
-
"pointer-events": "pointerEvents",
|
|
529
|
-
points: "points",
|
|
530
|
-
pointsatx: "pointsAtX",
|
|
531
|
-
pointsaty: "pointsAtY",
|
|
532
|
-
pointsatz: "pointsAtZ",
|
|
533
|
-
popover: "popover",
|
|
534
245
|
popovertarget: "popoverTarget",
|
|
535
246
|
popovertargetaction: "popoverTargetAction",
|
|
536
|
-
prefix: "prefix",
|
|
537
|
-
preservealpha: "preserveAlpha",
|
|
538
|
-
preserveaspectratio: "preserveAspectRatio",
|
|
539
|
-
primitiveunits: "primitiveUnits",
|
|
540
|
-
property: "property",
|
|
541
|
-
r: "r",
|
|
542
|
-
radius: "radius",
|
|
543
|
-
refx: "refX",
|
|
544
|
-
refy: "refY",
|
|
545
|
-
renderingintent: "renderingIntent",
|
|
546
|
-
"rendering-intent": "renderingIntent",
|
|
547
|
-
repeatcount: "repeatCount",
|
|
548
|
-
repeatdur: "repeatDur",
|
|
549
|
-
requiredextensions: "requiredExtensions",
|
|
550
|
-
requiredfeatures: "requiredFeatures",
|
|
551
|
-
resource: "resource",
|
|
552
|
-
restart: "restart",
|
|
553
|
-
result: "result",
|
|
554
|
-
results: "results",
|
|
555
|
-
rotate: "rotate",
|
|
556
|
-
rx: "rx",
|
|
557
|
-
ry: "ry",
|
|
558
|
-
scale: "scale",
|
|
559
|
-
security: "security",
|
|
560
|
-
seed: "seed",
|
|
561
|
-
shaperendering: "shapeRendering",
|
|
562
|
-
"shape-rendering": "shapeRendering",
|
|
563
|
-
slope: "slope",
|
|
564
|
-
spacing: "spacing",
|
|
565
|
-
specularconstant: "specularConstant",
|
|
566
|
-
specularexponent: "specularExponent",
|
|
567
|
-
speed: "speed",
|
|
568
|
-
spreadmethod: "spreadMethod",
|
|
569
|
-
startoffset: "startOffset",
|
|
570
|
-
stddeviation: "stdDeviation",
|
|
571
|
-
stemh: "stemh",
|
|
572
|
-
stemv: "stemv",
|
|
573
|
-
stitchtiles: "stitchTiles",
|
|
574
|
-
stopcolor: "stopColor",
|
|
575
|
-
"stop-color": "stopColor",
|
|
576
|
-
stopopacity: "stopOpacity",
|
|
577
|
-
"stop-opacity": "stopOpacity",
|
|
578
|
-
strikethroughposition: "strikethroughPosition",
|
|
579
|
-
"strikethrough-position": "strikethroughPosition",
|
|
580
|
-
strikethroughthickness: "strikethroughThickness",
|
|
581
|
-
"strikethrough-thickness": "strikethroughThickness",
|
|
582
|
-
string: "string",
|
|
583
|
-
stroke: "stroke",
|
|
584
|
-
strokedasharray: "strokeDasharray",
|
|
585
|
-
"stroke-dasharray": "strokeDasharray",
|
|
586
|
-
strokedashoffset: "strokeDashoffset",
|
|
587
|
-
"stroke-dashoffset": "strokeDashoffset",
|
|
588
|
-
strokelinecap: "strokeLinecap",
|
|
589
|
-
"stroke-linecap": "strokeLinecap",
|
|
590
|
-
strokelinejoin: "strokeLinejoin",
|
|
591
|
-
"stroke-linejoin": "strokeLinejoin",
|
|
592
|
-
strokemiterlimit: "strokeMiterlimit",
|
|
593
|
-
"stroke-miterlimit": "strokeMiterlimit",
|
|
594
|
-
strokewidth: "strokeWidth",
|
|
595
|
-
"stroke-width": "strokeWidth",
|
|
596
|
-
strokeopacity: "strokeOpacity",
|
|
597
|
-
"stroke-opacity": "strokeOpacity",
|
|
598
|
-
suppresscontenteditablewarning: "suppressContentEditableWarning",
|
|
599
|
-
suppresshydrationwarning: "suppressHydrationWarning",
|
|
600
|
-
surfacescale: "surfaceScale",
|
|
601
|
-
systemlanguage: "systemLanguage",
|
|
602
|
-
tablevalues: "tableValues",
|
|
603
|
-
targetx: "targetX",
|
|
604
|
-
targety: "targetY",
|
|
605
|
-
textanchor: "textAnchor",
|
|
606
|
-
"text-anchor": "textAnchor",
|
|
607
|
-
textdecoration: "textDecoration",
|
|
608
|
-
"text-decoration": "textDecoration",
|
|
609
|
-
textlength: "textLength",
|
|
610
|
-
textrendering: "textRendering",
|
|
611
|
-
"text-rendering": "textRendering",
|
|
612
|
-
to: "to",
|
|
613
|
-
transform: "transform",
|
|
614
|
-
transformorigin: "transformOrigin",
|
|
615
|
-
"transform-origin": "transformOrigin",
|
|
616
|
-
typeof: "typeof",
|
|
617
|
-
u1: "u1",
|
|
618
|
-
u2: "u2",
|
|
619
|
-
underlineposition: "underlinePosition",
|
|
620
|
-
"underline-position": "underlinePosition",
|
|
621
|
-
underlinethickness: "underlineThickness",
|
|
622
|
-
"underline-thickness": "underlineThickness",
|
|
623
|
-
unicode: "unicode",
|
|
624
|
-
unicodebidi: "unicodeBidi",
|
|
625
|
-
"unicode-bidi": "unicodeBidi",
|
|
626
|
-
unicoderange: "unicodeRange",
|
|
627
|
-
"unicode-range": "unicodeRange",
|
|
628
|
-
unitsperem: "unitsPerEm",
|
|
629
|
-
"units-per-em": "unitsPerEm",
|
|
630
|
-
unselectable: "unselectable",
|
|
631
|
-
valphabetic: "vAlphabetic",
|
|
632
|
-
"v-alphabetic": "vAlphabetic",
|
|
633
|
-
values: "values",
|
|
634
|
-
vectoreffect: "vectorEffect",
|
|
635
|
-
"vector-effect": "vectorEffect",
|
|
636
|
-
version: "version",
|
|
637
|
-
vertadvy: "vertAdvY",
|
|
638
|
-
"vert-adv-y": "vertAdvY",
|
|
639
|
-
vertoriginx: "vertOriginX",
|
|
640
|
-
"vert-origin-x": "vertOriginX",
|
|
641
|
-
vertoriginy: "vertOriginY",
|
|
642
|
-
"vert-origin-y": "vertOriginY",
|
|
643
|
-
vhanging: "vHanging",
|
|
644
|
-
"v-hanging": "vHanging",
|
|
645
|
-
videographic: "vIdeographic",
|
|
646
|
-
"v-ideographic": "vIdeographic",
|
|
647
|
-
viewbox: "viewBox",
|
|
648
|
-
viewtarget: "viewTarget",
|
|
649
|
-
visibility: "visibility",
|
|
650
|
-
vmathematical: "vMathematical",
|
|
651
|
-
"v-mathematical": "vMathematical",
|
|
652
|
-
vocab: "vocab",
|
|
653
|
-
widths: "widths",
|
|
654
|
-
wordspacing: "wordSpacing",
|
|
655
|
-
"word-spacing": "wordSpacing",
|
|
656
|
-
writingmode: "writingMode",
|
|
657
|
-
"writing-mode": "writingMode",
|
|
658
|
-
x1: "x1",
|
|
659
|
-
x2: "x2",
|
|
660
|
-
x: "x",
|
|
661
|
-
xchannelselector: "xChannelSelector",
|
|
662
|
-
xheight: "xHeight",
|
|
663
|
-
"x-height": "xHeight",
|
|
664
|
-
xlinkactuate: "xlinkActuate",
|
|
665
|
-
"xlink:actuate": "xlinkActuate",
|
|
666
|
-
xlinkarcrole: "xlinkArcrole",
|
|
667
|
-
"xlink:arcrole": "xlinkArcrole",
|
|
668
|
-
xlinkhref: "xlinkHref",
|
|
669
|
-
"xlink:href": "xlinkHref",
|
|
670
|
-
xlinkrole: "xlinkRole",
|
|
671
|
-
"xlink:role": "xlinkRole",
|
|
672
|
-
xlinkshow: "xlinkShow",
|
|
673
|
-
"xlink:show": "xlinkShow",
|
|
674
|
-
xlinktitle: "xlinkTitle",
|
|
675
|
-
"xlink:title": "xlinkTitle",
|
|
676
|
-
xlinktype: "xlinkType",
|
|
677
|
-
"xlink:type": "xlinkType",
|
|
678
|
-
xmlbase: "xmlBase",
|
|
679
|
-
"xml:base": "xmlBase",
|
|
680
|
-
xmllang: "xmlLang",
|
|
681
|
-
"xml:lang": "xmlLang",
|
|
682
|
-
xmlns: "xmlns",
|
|
683
|
-
"xml:space": "xmlSpace",
|
|
684
|
-
xmlnsxlink: "xmlnsXlink",
|
|
685
|
-
"xmlns:xlink": "xmlnsXlink",
|
|
686
|
-
xmlspace: "xmlSpace",
|
|
687
|
-
y1: "y1",
|
|
688
|
-
y2: "y2",
|
|
689
|
-
y: "y",
|
|
690
|
-
ychannelselector: "yChannelSelector",
|
|
691
|
-
z: "z",
|
|
692
|
-
zoomandpan: "zoomAndPan",
|
|
693
|
-
// added by us
|
|
694
247
|
dirname: "dirName"
|
|
695
248
|
};
|
|
249
|
+
var reactPropsToStandardAttributes = {
|
|
250
|
+
acceptCharset: "accept-charset",
|
|
251
|
+
accessKey: "accesskey",
|
|
252
|
+
allowFullScreen: "allowfullscreen",
|
|
253
|
+
autoCapitalize: "autocapitalize",
|
|
254
|
+
autoComplete: "autocomplete",
|
|
255
|
+
autoCorrect: "autocorrect",
|
|
256
|
+
autoFocus: "autofocus",
|
|
257
|
+
autoPlay: "autoplay",
|
|
258
|
+
charSet: "charset",
|
|
259
|
+
className: "class",
|
|
260
|
+
colSpan: "colspan",
|
|
261
|
+
contentEditable: "contenteditable",
|
|
262
|
+
crossOrigin: "crossorigin",
|
|
263
|
+
dateTime: "datetime",
|
|
264
|
+
encType: "enctype",
|
|
265
|
+
enterKeyHint: "enterkeyhint",
|
|
266
|
+
fetchPriority: "fetchpriority",
|
|
267
|
+
htmlFor: "for",
|
|
268
|
+
formMethod: "formmethod",
|
|
269
|
+
formAction: "formaction",
|
|
270
|
+
formEncType: "formenctype",
|
|
271
|
+
formNoValidate: "formnovalidate",
|
|
272
|
+
formTarget: "formtarget",
|
|
273
|
+
hrefLang: "hreflang",
|
|
274
|
+
httpEquiv: "http-equiv",
|
|
275
|
+
imageSizes: "imagesizes",
|
|
276
|
+
imageSrcSet: "imagesrcset",
|
|
277
|
+
inputMode: "inputmode",
|
|
278
|
+
itemID: "itemid",
|
|
279
|
+
itemProp: "itemprop",
|
|
280
|
+
itemRef: "itemref",
|
|
281
|
+
itemScope: "itemscope",
|
|
282
|
+
itemType: "itemtype",
|
|
283
|
+
maxLength: "maxlength",
|
|
284
|
+
minLength: "minlength",
|
|
285
|
+
noModule: "nomodule",
|
|
286
|
+
noValidate: "novalidate",
|
|
287
|
+
playsInline: "playsinline",
|
|
288
|
+
readOnly: "readonly",
|
|
289
|
+
referrerPolicy: "referrerpolicy",
|
|
290
|
+
rowSpan: "rowspan",
|
|
291
|
+
spellCheck: "spellcheck",
|
|
292
|
+
srcDoc: "srcdoc",
|
|
293
|
+
srcLang: "srclang",
|
|
294
|
+
srcSet: "srcset",
|
|
295
|
+
tabIndex: "tabindex",
|
|
296
|
+
useMap: "usemap",
|
|
297
|
+
popoverTarget: "popovertarget",
|
|
298
|
+
popoverTargetAction: "popovertargetaction",
|
|
299
|
+
dirName: "dirname"
|
|
300
|
+
};
|
|
696
301
|
|
|
697
302
|
// src/component-generator.ts
|
|
698
303
|
var generateAction = ({
|
|
@@ -787,6 +392,7 @@ var generatePropValue = ({
|
|
|
787
392
|
var generateJsxElement = ({
|
|
788
393
|
context = "jsx",
|
|
789
394
|
scope,
|
|
395
|
+
metas,
|
|
790
396
|
instance,
|
|
791
397
|
props,
|
|
792
398
|
dataSources,
|
|
@@ -798,6 +404,7 @@ var generateJsxElement = ({
|
|
|
798
404
|
if (instance.component === descendantComponent) {
|
|
799
405
|
return "";
|
|
800
406
|
}
|
|
407
|
+
const hasTags = Object.keys(metas.get(instance.component)?.presetStyle ?? {}).length > 0;
|
|
801
408
|
let generatedProps = "";
|
|
802
409
|
const index = indexesWithinAncestors.get(instance.id);
|
|
803
410
|
if (index !== void 0) {
|
|
@@ -826,7 +433,7 @@ ${tagProperty}=${JSON.stringify(instance.tag)}`;
|
|
|
826
433
|
continue;
|
|
827
434
|
}
|
|
828
435
|
let name = prop.name;
|
|
829
|
-
if (instance.component === elementComponent) {
|
|
436
|
+
if (instance.component === elementComponent || hasTags) {
|
|
830
437
|
name = standardAttributesToReactProps[prop.name] ?? prop.name;
|
|
831
438
|
}
|
|
832
439
|
if (prop.name === showAttribute) {
|
|
@@ -939,6 +546,7 @@ ${name}={${propValue}}`;
|
|
|
939
546
|
};
|
|
940
547
|
var generateJsxChildren = ({
|
|
941
548
|
scope,
|
|
549
|
+
metas,
|
|
942
550
|
children,
|
|
943
551
|
instances,
|
|
944
552
|
props,
|
|
@@ -979,6 +587,7 @@ var generateJsxChildren = ({
|
|
|
979
587
|
generatedChildren += generateJsxElement({
|
|
980
588
|
context: "jsx",
|
|
981
589
|
scope,
|
|
590
|
+
metas,
|
|
982
591
|
instance,
|
|
983
592
|
props,
|
|
984
593
|
dataSources,
|
|
@@ -988,6 +597,7 @@ var generateJsxChildren = ({
|
|
|
988
597
|
children: generateJsxChildren({
|
|
989
598
|
classesMap,
|
|
990
599
|
scope,
|
|
600
|
+
metas,
|
|
991
601
|
children: instance.children,
|
|
992
602
|
instances,
|
|
993
603
|
props,
|
|
@@ -1024,6 +634,7 @@ var generateWebstudioComponent = ({
|
|
|
1024
634
|
generatedJsx = generateJsxElement({
|
|
1025
635
|
context: "expression",
|
|
1026
636
|
scope,
|
|
637
|
+
metas,
|
|
1027
638
|
instance,
|
|
1028
639
|
props,
|
|
1029
640
|
dataSources,
|
|
@@ -1032,6 +643,7 @@ var generateWebstudioComponent = ({
|
|
|
1032
643
|
classesMap,
|
|
1033
644
|
children: generateJsxChildren({
|
|
1034
645
|
scope,
|
|
646
|
+
metas,
|
|
1035
647
|
children: instance.children,
|
|
1036
648
|
instances,
|
|
1037
649
|
props,
|
|
@@ -1097,7 +709,6 @@ var generateWebstudioComponent = ({
|
|
|
1097
709
|
return generatedComponent;
|
|
1098
710
|
};
|
|
1099
711
|
export {
|
|
1100
|
-
animationCanPlayOnCanvasAttribute,
|
|
1101
712
|
collapsedAttribute,
|
|
1102
713
|
componentAttribute,
|
|
1103
714
|
generateJsxChildren,
|
|
@@ -1108,7 +719,9 @@ export {
|
|
|
1108
719
|
idAttribute,
|
|
1109
720
|
isAttributeNameSafe,
|
|
1110
721
|
normalizeProps,
|
|
722
|
+
reactPropsToStandardAttributes,
|
|
1111
723
|
selectorIdAttribute,
|
|
1112
724
|
showAttribute,
|
|
725
|
+
standardAttributesToReactProps,
|
|
1113
726
|
textContentAttribute
|
|
1114
727
|
};
|
package/lib/runtime.js
CHANGED
|
@@ -86,7 +86,8 @@ var PageSettingsMeta = ({
|
|
|
86
86
|
host,
|
|
87
87
|
siteName,
|
|
88
88
|
pageMeta,
|
|
89
|
-
imageLoader
|
|
89
|
+
imageLoader,
|
|
90
|
+
assetBaseUrl
|
|
90
91
|
}) => {
|
|
91
92
|
const metas = [];
|
|
92
93
|
if (url !== void 0) {
|
|
@@ -128,7 +129,7 @@ var PageSettingsMeta = ({
|
|
|
128
129
|
metas.push({
|
|
129
130
|
property: "og:image",
|
|
130
131
|
content: `https://${host}${imageLoader({
|
|
131
|
-
src: pageMeta.socialImageAssetName
|
|
132
|
+
src: `${assetBaseUrl}${pageMeta.socialImageAssetName}`,
|
|
132
133
|
// Do not transform social image (not enough information do we need to do this)
|
|
133
134
|
format: "raw"
|
|
134
135
|
})}`
|
|
@@ -140,6 +141,12 @@ var PageSettingsMeta = ({
|
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
143
|
metas.push(...pageMeta.custom);
|
|
144
|
+
const isTwitterCardSizeDefined = pageMeta.custom.some(
|
|
145
|
+
(meta) => meta.property === "twitter:card"
|
|
146
|
+
);
|
|
147
|
+
if ((pageMeta.socialImageAssetName !== void 0 || pageMeta.socialImageUrl !== void 0) && isTwitterCardSizeDefined === false) {
|
|
148
|
+
metas.push({ property: "twitter:card", content: "summary_large_image" });
|
|
149
|
+
}
|
|
143
150
|
return metas.map((meta, index) => /* @__PURE__ */ jsx(Meta, { ...meta }, index));
|
|
144
151
|
};
|
|
145
152
|
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Instances, Instance, Props, Scope, DataSources, Prop, WsComponentMeta, IndexesWithinAncestors } from "@webstudio-is/sdk";
|
|
2
|
-
export declare const generateJsxElement: ({ context, scope, instance, props, dataSources, usedDataSources, indexesWithinAncestors, children, classesMap, }: {
|
|
2
|
+
export declare const generateJsxElement: ({ context, scope, metas, instance, props, dataSources, usedDataSources, indexesWithinAncestors, children, classesMap, }: {
|
|
3
3
|
context?: "expression" | "jsx";
|
|
4
4
|
scope: Scope;
|
|
5
|
+
metas: Map<Instance["component"], WsComponentMeta>;
|
|
5
6
|
instance: Instance;
|
|
6
7
|
props: Props;
|
|
7
8
|
dataSources: DataSources;
|
|
@@ -10,8 +11,9 @@ export declare const generateJsxElement: ({ context, scope, instance, props, dat
|
|
|
10
11
|
children: string;
|
|
11
12
|
classesMap?: Map<string, Array<string>>;
|
|
12
13
|
}) => string;
|
|
13
|
-
export declare const generateJsxChildren: ({ scope, children, instances, props, dataSources, usedDataSources, indexesWithinAncestors, classesMap, excludePlaceholders, }: {
|
|
14
|
+
export declare const generateJsxChildren: ({ scope, metas, children, instances, props, dataSources, usedDataSources, indexesWithinAncestors, classesMap, excludePlaceholders, }: {
|
|
14
15
|
scope: Scope;
|
|
16
|
+
metas: Map<Instance["component"], WsComponentMeta>;
|
|
15
17
|
children: Instance["children"];
|
|
16
18
|
instances: Instances;
|
|
17
19
|
props: Props;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import type { ImageLoader } from "@webstudio-is/image";
|
|
2
2
|
import type { PageMeta } from "@webstudio-is/sdk";
|
|
3
3
|
export declare const isElementRenderedWithReact: (element: Element) => boolean;
|
|
4
|
-
export declare const PageSettingsMeta: ({ url, host, siteName, pageMeta, imageLoader, }: {
|
|
4
|
+
export declare const PageSettingsMeta: ({ url, host, siteName, pageMeta, imageLoader, assetBaseUrl, }: {
|
|
5
5
|
url?: string;
|
|
6
6
|
host: string;
|
|
7
7
|
siteName: string;
|
|
8
8
|
pageMeta: PageMeta;
|
|
9
9
|
imageLoader: ImageLoader;
|
|
10
|
+
assetBaseUrl: string;
|
|
10
11
|
}) => import("react/jsx-runtime").JSX.Element[];
|
package/lib/types/props.d.ts
CHANGED
|
@@ -1432,5 +1432,4 @@ export declare const componentAttribute: "data-ws-component";
|
|
|
1432
1432
|
export declare const showAttribute: "data-ws-show";
|
|
1433
1433
|
export declare const collapsedAttribute: "data-ws-collapsed";
|
|
1434
1434
|
export declare const textContentAttribute: "data-ws-text-content";
|
|
1435
|
-
export declare const animationCanPlayOnCanvasAttribute = "data-ws-animation-can-play-on-canvas";
|
|
1436
1435
|
export declare const isAttributeNameSafe: (attributeName: string) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webstudio-is/react-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.219.0",
|
|
4
4
|
"description": "Webstudio JavaScript / TypeScript API",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -12,9 +12,9 @@
|
|
|
12
12
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
13
13
|
"strip-indent": "^4.0.0",
|
|
14
14
|
"type-fest": "^4.37.0",
|
|
15
|
-
"vitest": "^3.
|
|
15
|
+
"vitest": "^3.1.2",
|
|
16
16
|
"zod": "^3.24.2",
|
|
17
|
-
"@webstudio-is/template": "0.
|
|
17
|
+
"@webstudio-is/template": "0.219.0",
|
|
18
18
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
@@ -26,11 +26,11 @@
|
|
|
26
26
|
"change-case": "^5.4.4",
|
|
27
27
|
"html-tags": "^4.0.0",
|
|
28
28
|
"nanoid": "^5.1.5",
|
|
29
|
-
"@webstudio-is/
|
|
30
|
-
"@webstudio-is/
|
|
31
|
-
"@webstudio-is/
|
|
32
|
-
"@webstudio-is/
|
|
33
|
-
"@webstudio-is/
|
|
29
|
+
"@webstudio-is/css-engine": "0.219.0",
|
|
30
|
+
"@webstudio-is/fonts": "0.219.0",
|
|
31
|
+
"@webstudio-is/image": "0.219.0",
|
|
32
|
+
"@webstudio-is/icons": "^0.219.0",
|
|
33
|
+
"@webstudio-is/sdk": "0.219.0"
|
|
34
34
|
},
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
3
|
-
*
|
|
4
|
-
* This source code is licensed under the MIT license found in the
|
|
5
|
-
* LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/
|
|
7
|
-
export declare const standardAttributesToReactProps: Record<string, string>;
|