@@ -1632,6 +1632,33 @@ function Element({ model }) {
1632
1632
}
1633
1633
}
1634
1634
1635
+ function elementChildren ( modelChildren ) {
1636
+ if ( ! modelChildren ) {
1637
+ return [ ] ;
1638
+ } else {
1639
+ return modelChildren . map ( ( child ) => {
1640
+ switch ( typeof child ) {
1641
+ case "object" :
1642
+ return html `< ${ Element } key =${ child . key } model=${ child } /> ` ;
1643
+ case "string" :
1644
+ return child ;
1645
+ }
1646
+ } ) ;
1647
+ }
1648
+ }
1649
+
1650
+ function elementAttributes ( model , sendEvent ) {
1651
+ const attributes = Object . assign ( { } , model . attributes ) ;
1652
+
1653
+ if ( model . eventHandlers ) {
1654
+ for ( const [ eventName , eventSpec ] of Object . entries ( model . eventHandlers ) ) {
1655
+ attributes [ eventName ] = eventHandler ( sendEvent , eventSpec ) ;
1656
+ }
1657
+ }
1658
+
1659
+ return attributes ;
1660
+ }
1661
+
1635
1662
function StandardElement ( { model } ) {
1636
1663
const config = react . useContext ( LayoutConfigContext ) ;
1637
1664
const children = elementChildren ( model . children ) ;
@@ -1691,33 +1718,6 @@ function RenderImportedElement({ model, importSource }) {
1691
1718
return html `< div ref =${ mountPoint } / > ` ;
1692
1719
}
1693
1720
1694
- function elementChildren ( modelChildren ) {
1695
- if ( ! modelChildren ) {
1696
- return [ ] ;
1697
- } else {
1698
- return modelChildren . map ( ( child ) => {
1699
- switch ( typeof child ) {
1700
- case "object" :
1701
- return html `< ${ Element } key =${ child . key } model=${ child } /> ` ;
1702
- case "string" :
1703
- return child ;
1704
- }
1705
- } ) ;
1706
- }
1707
- }
1708
-
1709
- function elementAttributes ( model , sendEvent ) {
1710
- const attributes = Object . assign ( { } , model . attributes ) ;
1711
-
1712
- if ( model . eventHandlers ) {
1713
- for ( const [ eventName , eventSpec ] of Object . entries ( model . eventHandlers ) ) {
1714
- attributes [ eventName ] = eventHandler ( sendEvent , eventSpec ) ;
1715
- }
1716
- }
1717
-
1718
- return attributes ;
1719
- }
1720
-
1721
1721
function eventHandler ( sendEvent , eventSpec ) {
1722
1722
return function ( ) {
1723
1723
const data = Array . from ( arguments ) . map ( ( value ) => {
@@ -1748,7 +1748,11 @@ function loadImportSource$1(config, importSource) {
1748
1748
return {
1749
1749
data : importSource ,
1750
1750
bind : ( node ) => {
1751
- const binding = module . bind ( node , config ) ;
1751
+ const shortImportSource = {
1752
+ source : importSource . source ,
1753
+ sourceType : importSource . sourceType ,
1754
+ } ;
1755
+ const binding = module . bind ( node , config , shortImportSource ) ;
1752
1756
if (
1753
1757
typeof binding . render == "function" &&
1754
1758
typeof binding . unmount == "function"
0 commit comments