@@ -534,38 +534,6 @@ test("Section", async () => {
534
534
` ) ;
535
535
} ) ;
536
536
537
- test ( "Figure" , async ( ) => {
538
- const fragment = await toWebstudioFragment ( {
539
- type : "@webflow/XscpData" ,
540
- payload : {
541
- nodes : [
542
- {
543
- _id : "7c6bc1fd-128d-514b-167b-605a910e435c" ,
544
- type : "Block" ,
545
- tag : "figure" ,
546
- classes : [ ] ,
547
- children : [ ] ,
548
- } ,
549
- ] ,
550
- styles : [ ] ,
551
- assets : [ ] ,
552
- } ,
553
- } ) ;
554
-
555
- equalFragment ( fragment , < $ . Box tag = "figure" /> ) ;
556
- expect ( toCss ( fragment ) ) . toMatchInlineSnapshot ( `
557
- "@media all {
558
- figure {
559
- display: block;
560
- margin-top: 0;
561
- margin-right: 0;
562
- margin-bottom: 10px;
563
- margin-left: 0
564
- }
565
- }"
566
- ` ) ;
567
- } ) ;
568
-
569
537
test ( "BlockContainer" , async ( ) => {
570
538
const fragment = await toWebstudioFragment ( {
571
539
type : "@webflow/XscpData" ,
@@ -1550,6 +1518,163 @@ test("RichText", async () => {
1550
1518
` ) ;
1551
1519
} ) ;
1552
1520
1521
+ test ( "RichText with Figure and Figcaption" , async ( ) => {
1522
+ const fragment = await toWebstudioFragment ( {
1523
+ type : "@webflow/XscpData" ,
1524
+ payload : {
1525
+ nodes : [
1526
+ {
1527
+ _id : "a7a2b490-c6c5-30aa-1827-b38a0ae42a08" ,
1528
+ type : "RichText" ,
1529
+ tag : "div" ,
1530
+ classes : [ ] ,
1531
+ children : [ "3ddc1727-a0f4-33c5-3879-cb1d9d932c59" ] ,
1532
+ } ,
1533
+ {
1534
+ _id : "3ddc1727-a0f4-33c5-3879-cb1d9d932c59" ,
1535
+ type : "Figure" ,
1536
+ tag : "figure" ,
1537
+ classes : [ ] ,
1538
+ children : [
1539
+ "72cdf71c-b2da-c44a-3ecd-9ec9891f6023" ,
1540
+ "f48219da-c3ef-2439-07e3-a843ef8c0891" ,
1541
+ ] ,
1542
+ data : {
1543
+ figure : {
1544
+ type : "image" ,
1545
+ align : "center" ,
1546
+ maxWidth : "" ,
1547
+ } ,
1548
+ } ,
1549
+ } ,
1550
+ {
1551
+ _id : "72cdf71c-b2da-c44a-3ecd-9ec9891f6023" ,
1552
+ type : "Block" ,
1553
+ tag : "div" ,
1554
+ classes : [ ] ,
1555
+ children : [ "4b0dc79a-bbb0-b136-d913-f1e3581f2b36" ] ,
1556
+ data : {
1557
+ text : false ,
1558
+ } ,
1559
+ } ,
1560
+ {
1561
+ _id : "4b0dc79a-bbb0-b136-d913-f1e3581f2b36" ,
1562
+ type : "Image" ,
1563
+ tag : "img" ,
1564
+ classes : [ ] ,
1565
+ children : [ ] ,
1566
+ data : {
1567
+ //srcsetDisabled: false,
1568
+ attr : {
1569
+ width : "auto" ,
1570
+ height : "auto" ,
1571
+ alt : "__wf_reserved_inherit" ,
1572
+ src : "https://test.com/image.jpg" ,
1573
+ loading : "lazy" ,
1574
+ id : "" ,
1575
+ } ,
1576
+ sizes : [ ] ,
1577
+ devlink : {
1578
+ runtimeProps : { } ,
1579
+ slot : "" ,
1580
+ } ,
1581
+ displayName : "" ,
1582
+ xattr : [ ] ,
1583
+ search : {
1584
+ exclude : false ,
1585
+ } ,
1586
+ visibility : {
1587
+ conditions : [ ] ,
1588
+ } ,
1589
+ } ,
1590
+ } ,
1591
+ {
1592
+ _id : "f48219da-c3ef-2439-07e3-a843ef8c0891" ,
1593
+ type : "Figcaption" ,
1594
+ tag : "figcaption" ,
1595
+ classes : [ ] ,
1596
+ children : [ "d5e8480a-f395-38d5-530b-78cb05b6888f" ] ,
1597
+ } ,
1598
+ {
1599
+ _id : "d5e8480a-f395-38d5-530b-78cb05b6888f" ,
1600
+ text : true ,
1601
+ v : "test" ,
1602
+ } ,
1603
+ ] ,
1604
+ styles : [ ] ,
1605
+ assets : [
1606
+ {
1607
+ cdnUrl : "https://test.com/image.jpg" ,
1608
+ siteId : "66ab8a32bcc969149d6a7a1a" ,
1609
+ width : 174 ,
1610
+ height : 136 ,
1611
+ fileName :
1612
+ "66d8522c8e9dbb5e2b2de76c_Screenshot 2024-09-02 at 18.20.14.png" ,
1613
+ createdOn : "2024-09-04T12:27:24.621Z" ,
1614
+ origFileName : "Screenshot 2024-09-02 at 18.20.14.png" ,
1615
+ fileHash : "496bace14fbde33d31e0417dd70216d0" ,
1616
+ //translationLoading: false,
1617
+ variants : [ ] ,
1618
+ mimeType : "image/png" ,
1619
+ _id : "66d8522c8e9dbb5e2b2de76c" ,
1620
+ updatedOn : "2024-09-04T12:55:38.572Z" ,
1621
+ fileSize : 20599 ,
1622
+ localizedSettings : { } ,
1623
+ } ,
1624
+ ] ,
1625
+ ix1 : [ ] ,
1626
+ ix2 : {
1627
+ interactions : [ ] ,
1628
+ events : [ ] ,
1629
+ actionLists : [ ] ,
1630
+ } ,
1631
+ } ,
1632
+ meta : {
1633
+ droppedLinks : 0 ,
1634
+ dynBindRemovedCount : 0 ,
1635
+ dynListBindRemovedCount : 0 ,
1636
+ paginationRemovedCount : 0 ,
1637
+ universalBindingsRemovedCount : 0 ,
1638
+ unlinkedSymbolCount : 0 ,
1639
+ } ,
1640
+ } ) ;
1641
+
1642
+ equalFragment (
1643
+ fragment ,
1644
+ < $ . Box >
1645
+ < $ . Box tag = "figure" >
1646
+ < $ . Box >
1647
+ < $ . Image loading = "lazy" src = "https://test.com/image.jpg" />
1648
+ </ $ . Box >
1649
+ < $ . Text tag = "figcaption" > test</ $ . Text >
1650
+ </ $ . Box >
1651
+ </ $ . Box >
1652
+ ) ;
1653
+
1654
+ expect ( toCss ( fragment ) ) . toMatchInlineSnapshot ( `
1655
+ "@media all {
1656
+ figure {
1657
+ display: block;
1658
+ margin-top: 0;
1659
+ margin-right: 0;
1660
+ margin-bottom: 10px;
1661
+ margin-left: 0
1662
+ }
1663
+ img {
1664
+ vertical-align: middle;
1665
+ max-width: 100%;
1666
+ display: inline-block;
1667
+ border: 0 none currentcolor
1668
+ }
1669
+ figcaption {
1670
+ display: block;
1671
+ text-align: center;
1672
+ margin-top: 5px
1673
+ }
1674
+ }"
1675
+ ` ) ;
1676
+ } ) ;
1677
+
1553
1678
test ( "Form" , async ( ) => {
1554
1679
const fragment = await toWebstudioFragment ( {
1555
1680
type : "@webflow/XscpData" ,
0 commit comments