@shortfuse/materialdesignweb 0.8.0 → 0.9.1

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 (405) hide show
  1. package/README.md +50 -198
  2. package/bin/mdw-css.js +1 -1
  3. package/components/Badge.js +15 -5
  4. package/components/Body.js +7 -0
  5. package/components/BottomAppBar.js +7 -10
  6. package/components/BottomSheet.js +472 -0
  7. package/components/Box.js +11 -49
  8. package/components/Button.js +81 -82
  9. package/components/Card.js +74 -62
  10. package/components/Checkbox.js +15 -25
  11. package/components/CheckboxIcon.js +19 -31
  12. package/components/Chip.js +18 -13
  13. package/components/Dialog.js +70 -100
  14. package/components/DialogActions.js +4 -0
  15. package/components/Display.js +64 -0
  16. package/components/Divider.js +5 -0
  17. package/components/Fab.js +94 -17
  18. package/components/FabContainer.js +57 -0
  19. package/components/FilterChip.js +43 -32
  20. package/components/Grid.js +187 -0
  21. package/components/Headline.js +9 -28
  22. package/components/Icon.js +80 -71
  23. package/components/IconButton.js +77 -120
  24. package/components/Input.js +745 -86
  25. package/components/InputChip.js +193 -0
  26. package/components/Label.js +7 -0
  27. package/components/List.js +11 -5
  28. package/components/ListItem.js +92 -23
  29. package/components/ListOption.js +143 -65
  30. package/components/Listbox.js +57 -17
  31. package/components/Menu.js +39 -27
  32. package/components/MenuItem.js +49 -36
  33. package/components/NavBar.js +66 -21
  34. package/components/NavBarItem.js +5 -0
  35. package/components/NavDrawer.js +33 -16
  36. package/components/NavDrawerItem.js +7 -4
  37. package/components/NavItem.js +61 -34
  38. package/components/NavRail.js +32 -21
  39. package/components/NavRailItem.js +10 -2
  40. package/components/Page.js +119 -0
  41. package/components/Pane.js +24 -0
  42. package/components/Popup.js +23 -8
  43. package/components/Progress.js +25 -5
  44. package/components/Radio.js +8 -7
  45. package/components/RadioIcon.js +24 -15
  46. package/components/Ripple.js +25 -7
  47. package/components/Root.js +225 -0
  48. package/components/Scrim.js +95 -0
  49. package/components/Search.js +30 -25
  50. package/components/SegmentedButton.js +53 -40
  51. package/components/SegmentedButtonGroup.js +15 -12
  52. package/components/Select.js +19 -10
  53. package/components/Shape.js +10 -66
  54. package/components/SideSheet.js +337 -0
  55. package/components/Slider.js +93 -36
  56. package/components/Snackbar.js +52 -20
  57. package/components/SnackbarContainer.js +51 -0
  58. package/components/Surface.js +20 -10
  59. package/components/Switch.js +21 -18
  60. package/components/SwitchIcon.js +62 -33
  61. package/components/Tab.js +78 -38
  62. package/components/TabContent.js +33 -12
  63. package/components/TabList.js +95 -34
  64. package/components/TabPanel.js +10 -1
  65. package/components/Table.js +151 -0
  66. package/components/TextArea.js +48 -16
  67. package/components/Title.js +8 -9
  68. package/components/Tooltip.js +51 -22
  69. package/components/TopAppBar.js +71 -78
  70. package/constants/shapes.js +36 -0
  71. package/constants/typography.js +127 -0
  72. package/core/Composition.js +391 -201
  73. package/core/CompositionAdapter.js +35 -18
  74. package/core/CustomElement.js +634 -254
  75. package/core/css.js +117 -12
  76. package/core/customTypes.js +161 -49
  77. package/core/dom.js +18 -11
  78. package/core/jsonMergePatch.js +27 -11
  79. package/core/observe.js +308 -256
  80. package/core/optimizations.js +9 -9
  81. package/core/template.js +14 -57
  82. package/dist/CustomElement.min.js +2 -0
  83. package/dist/CustomElement.min.js.map +7 -0
  84. package/dist/core/CustomElement.min.js +2 -0
  85. package/dist/core/CustomElement.min.js.map +7 -0
  86. package/dist/index.min.js +85 -115
  87. package/dist/index.min.js.map +4 -4
  88. package/dist/meta.json +1 -1
  89. package/dom/HTMLOptionsCollectionProxy.js +108 -0
  90. package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
  91. package/loaders/theme.js +12 -0
  92. package/mixins/AriaReflectorMixin.js +64 -15
  93. package/mixins/AriaToolbarMixin.js +6 -0
  94. package/mixins/ControlMixin.js +79 -33
  95. package/mixins/DelegatesFocusMixin.js +62 -0
  96. package/mixins/DensityMixin.js +7 -3
  97. package/mixins/ElevationMixin.js +61 -0
  98. package/mixins/FlexableMixin.js +87 -39
  99. package/mixins/FormAssociatedMixin.js +76 -10
  100. package/mixins/HyperlinkMixin.js +76 -0
  101. package/mixins/InputMixin.js +227 -32
  102. package/mixins/KeyboardNavMixin.js +11 -7
  103. package/mixins/NavigationListenerMixin.js +33 -0
  104. package/mixins/PopupMixin.js +216 -219
  105. package/mixins/RTLObserverMixin.js +2 -0
  106. package/mixins/ResizeObserverMixin.js +18 -4
  107. package/mixins/RippleMixin.js +11 -7
  108. package/mixins/ScrollListenerMixin.js +14 -2
  109. package/mixins/SemiStickyMixin.js +51 -98
  110. package/mixins/ShapeMaskedMixin.js +125 -0
  111. package/mixins/ShapeMixin.js +30 -203
  112. package/mixins/StateMixin.js +74 -34
  113. package/mixins/TextFieldMixin.js +128 -145
  114. package/mixins/ThemableMixin.js +57 -56
  115. package/mixins/TooltipTriggerMixin.js +305 -359
  116. package/mixins/TouchTargetMixin.js +5 -2
  117. package/mixins/TypographyMixin.js +128 -0
  118. package/package.json +125 -81
  119. package/services/rtl.js +10 -0
  120. package/services/svgAlias.js +17 -0
  121. package/{theming/index.js → services/theme.js} +25 -176
  122. package/types/bin/mdw-css.d.ts +3 -0
  123. package/types/bin/mdw-css.d.ts.map +1 -0
  124. package/types/components/Badge.d.ts +39 -0
  125. package/types/components/Badge.d.ts.map +1 -0
  126. package/types/components/Body.d.ts +29 -0
  127. package/types/components/Body.d.ts.map +1 -0
  128. package/types/components/BottomAppBar.d.ts +72 -0
  129. package/types/components/BottomAppBar.d.ts.map +1 -0
  130. package/types/components/BottomSheet.d.ts +135 -0
  131. package/types/components/BottomSheet.d.ts.map +1 -0
  132. package/types/components/Box.d.ts +16 -0
  133. package/types/components/Box.d.ts.map +1 -0
  134. package/types/components/Button.d.ts +245 -0
  135. package/types/components/Button.d.ts.map +1 -0
  136. package/types/components/Card.d.ts +147 -0
  137. package/types/components/Card.d.ts.map +1 -0
  138. package/types/components/Checkbox.d.ts +207 -0
  139. package/types/components/Checkbox.d.ts.map +1 -0
  140. package/types/components/CheckboxIcon.d.ts +44 -0
  141. package/types/components/CheckboxIcon.d.ts.map +1 -0
  142. package/types/components/Chip.d.ts +248 -0
  143. package/types/components/Chip.d.ts.map +1 -0
  144. package/types/components/Dialog.d.ts +103 -0
  145. package/types/components/Dialog.d.ts.map +1 -0
  146. package/types/components/DialogActions.d.ts +4 -0
  147. package/types/components/DialogActions.d.ts.map +1 -0
  148. package/types/components/Display.d.ts +46 -0
  149. package/types/components/Display.d.ts.map +1 -0
  150. package/types/components/Divider.d.ts +10 -0
  151. package/types/components/Divider.d.ts.map +1 -0
  152. package/types/components/Fab.d.ts +273 -0
  153. package/types/components/Fab.d.ts.map +1 -0
  154. package/types/components/FabContainer.d.ts +10 -0
  155. package/types/components/FabContainer.d.ts.map +1 -0
  156. package/types/components/FilterChip.d.ts +256 -0
  157. package/types/components/FilterChip.d.ts.map +1 -0
  158. package/types/components/Grid.d.ts +38 -0
  159. package/types/components/Grid.d.ts.map +1 -0
  160. package/types/components/Headline.d.ts +46 -0
  161. package/types/components/Headline.d.ts.map +1 -0
  162. package/types/components/Icon.d.ts +55 -0
  163. package/types/components/Icon.d.ts.map +1 -0
  164. package/types/components/IconButton.d.ts +284 -0
  165. package/types/components/IconButton.d.ts.map +1 -0
  166. package/types/components/Input.d.ts +2528 -0
  167. package/types/components/Input.d.ts.map +1 -0
  168. package/types/components/InputChip.d.ts +85 -0
  169. package/types/components/InputChip.d.ts.map +1 -0
  170. package/types/components/Label.d.ts +29 -0
  171. package/types/components/Label.d.ts.map +1 -0
  172. package/types/components/List.d.ts +35 -0
  173. package/types/components/List.d.ts.map +1 -0
  174. package/types/components/ListItem.d.ts +124 -0
  175. package/types/components/ListItem.d.ts.map +1 -0
  176. package/types/components/ListOption.d.ts +158 -0
  177. package/types/components/ListOption.d.ts.map +1 -0
  178. package/types/components/Listbox.d.ts +763 -0
  179. package/types/components/Listbox.d.ts.map +1 -0
  180. package/types/components/Menu.d.ts +130 -0
  181. package/types/components/Menu.d.ts.map +1 -0
  182. package/types/components/MenuItem.d.ts +232 -0
  183. package/types/components/MenuItem.d.ts.map +1 -0
  184. package/types/components/NavBar.d.ts +20 -0
  185. package/types/components/NavBar.d.ts.map +1 -0
  186. package/types/components/NavBarItem.d.ts +97 -0
  187. package/types/components/NavBarItem.d.ts.map +1 -0
  188. package/types/components/NavDrawer.d.ts +107 -0
  189. package/types/components/NavDrawer.d.ts.map +1 -0
  190. package/types/components/NavDrawerItem.d.ts +97 -0
  191. package/types/components/NavDrawerItem.d.ts.map +1 -0
  192. package/types/components/NavItem.d.ts +99 -0
  193. package/types/components/NavItem.d.ts.map +1 -0
  194. package/types/components/NavRail.d.ts +108 -0
  195. package/types/components/NavRail.d.ts.map +1 -0
  196. package/types/components/NavRailItem.d.ts +97 -0
  197. package/types/components/NavRailItem.d.ts.map +1 -0
  198. package/types/components/Page.d.ts +25 -0
  199. package/types/components/Page.d.ts.map +1 -0
  200. package/types/components/Pane.d.ts +44 -0
  201. package/types/components/Pane.d.ts.map +1 -0
  202. package/types/components/Popup.d.ts +78 -0
  203. package/types/components/Popup.d.ts.map +1 -0
  204. package/types/components/Progress.d.ts +21 -0
  205. package/types/components/Progress.d.ts.map +1 -0
  206. package/types/components/Radio.d.ts +201 -0
  207. package/types/components/Radio.d.ts.map +1 -0
  208. package/types/components/RadioIcon.d.ts +46 -0
  209. package/types/components/RadioIcon.d.ts.map +1 -0
  210. package/types/components/Ripple.d.ts +35 -0
  211. package/types/components/Ripple.d.ts.map +1 -0
  212. package/types/components/Root.d.ts +68 -0
  213. package/types/components/Root.d.ts.map +1 -0
  214. package/types/components/Scrim.d.ts +6 -0
  215. package/types/components/Scrim.d.ts.map +1 -0
  216. package/types/components/Search.d.ts +516 -0
  217. package/types/components/Search.d.ts.map +1 -0
  218. package/types/components/SegmentedButton.d.ts +252 -0
  219. package/types/components/SegmentedButton.d.ts.map +1 -0
  220. package/types/components/SegmentedButtonGroup.d.ts +43 -0
  221. package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
  222. package/types/components/Select.d.ts +158 -0
  223. package/types/components/Select.d.ts.map +1 -0
  224. package/types/components/Shape.d.ts +10 -0
  225. package/types/components/Shape.d.ts.map +1 -0
  226. package/types/components/SideSheet.d.ts +111 -0
  227. package/types/components/SideSheet.d.ts.map +1 -0
  228. package/types/components/Slider.d.ts +203 -0
  229. package/types/components/Slider.d.ts.map +1 -0
  230. package/types/components/Snackbar.d.ts +73 -0
  231. package/types/components/Snackbar.d.ts.map +1 -0
  232. package/types/components/SnackbarContainer.d.ts +6 -0
  233. package/types/components/SnackbarContainer.d.ts.map +1 -0
  234. package/types/components/Surface.d.ts +45 -0
  235. package/types/components/Surface.d.ts.map +1 -0
  236. package/types/components/Switch.d.ts +187 -0
  237. package/types/components/Switch.d.ts.map +1 -0
  238. package/types/components/SwitchIcon.d.ts +61 -0
  239. package/types/components/SwitchIcon.d.ts.map +1 -0
  240. package/types/components/Tab.d.ts +139 -0
  241. package/types/components/Tab.d.ts.map +1 -0
  242. package/types/components/TabContent.d.ts +124 -0
  243. package/types/components/TabContent.d.ts.map +1 -0
  244. package/types/components/TabList.d.ts +1111 -0
  245. package/types/components/TabList.d.ts.map +1 -0
  246. package/types/components/TabPanel.d.ts +28 -0
  247. package/types/components/TabPanel.d.ts.map +1 -0
  248. package/types/components/Table.d.ts +25 -0
  249. package/types/components/Table.d.ts.map +1 -0
  250. package/types/components/TextArea.d.ts +201 -0
  251. package/types/components/TextArea.d.ts.map +1 -0
  252. package/types/components/Title.d.ts +46 -0
  253. package/types/components/Title.d.ts.map +1 -0
  254. package/types/components/Tooltip.d.ts +49 -0
  255. package/types/components/Tooltip.d.ts.map +1 -0
  256. package/types/components/TopAppBar.d.ts +129 -0
  257. package/types/components/TopAppBar.d.ts.map +1 -0
  258. package/types/constants/colorKeywords.d.ts +2 -0
  259. package/types/constants/colorKeywords.d.ts.map +1 -0
  260. package/types/constants/shapes.d.ts +38 -0
  261. package/types/constants/shapes.d.ts.map +1 -0
  262. package/types/constants/typography.d.ts +212 -0
  263. package/types/constants/typography.d.ts.map +1 -0
  264. package/types/core/Composition.d.ts +260 -0
  265. package/types/core/Composition.d.ts.map +1 -0
  266. package/types/core/CompositionAdapter.d.ts +114 -0
  267. package/types/core/CompositionAdapter.d.ts.map +1 -0
  268. package/types/core/CustomElement.d.ts +304 -0
  269. package/types/core/CustomElement.d.ts.map +1 -0
  270. package/types/core/css.d.ts +44 -0
  271. package/types/core/css.d.ts.map +1 -0
  272. package/types/core/customTypes.d.ts +22 -0
  273. package/types/core/customTypes.d.ts.map +1 -0
  274. package/types/core/dom.d.ts +32 -0
  275. package/types/core/dom.d.ts.map +1 -0
  276. package/types/core/jsonMergePatch.d.ts +31 -0
  277. package/types/core/jsonMergePatch.d.ts.map +1 -0
  278. package/types/core/observe.d.ts +114 -0
  279. package/types/core/observe.d.ts.map +1 -0
  280. package/types/core/optimizations.d.ts +7 -0
  281. package/types/core/optimizations.d.ts.map +1 -0
  282. package/types/core/template.d.ts +47 -0
  283. package/types/core/template.d.ts.map +1 -0
  284. package/types/core/uid.d.ts +6 -0
  285. package/types/core/uid.d.ts.map +1 -0
  286. package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
  287. package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
  288. package/types/index.d.ts +88 -0
  289. package/types/index.d.ts.map +1 -0
  290. package/types/loaders/palette.d.ts +2 -0
  291. package/types/loaders/palette.d.ts.map +1 -0
  292. package/types/loaders/theme.d.ts +2 -0
  293. package/types/loaders/theme.d.ts.map +1 -0
  294. package/types/mixins/AriaReflectorMixin.d.ts +31 -0
  295. package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
  296. package/types/mixins/AriaToolbarMixin.d.ts +34 -0
  297. package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
  298. package/types/mixins/ControlMixin.d.ts +124 -0
  299. package/types/mixins/ControlMixin.d.ts.map +1 -0
  300. package/types/mixins/DelegatesFocusMixin.d.ts +13 -0
  301. package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
  302. package/types/mixins/DensityMixin.d.ts +8 -0
  303. package/types/mixins/DensityMixin.d.ts.map +1 -0
  304. package/types/mixins/ElevationMixin.d.ts +32 -0
  305. package/types/mixins/ElevationMixin.d.ts.map +1 -0
  306. package/types/mixins/FlexableMixin.d.ts +14 -0
  307. package/types/mixins/FlexableMixin.d.ts.map +1 -0
  308. package/types/mixins/FormAssociatedMixin.d.ts +123 -0
  309. package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
  310. package/types/mixins/HyperlinkMixin.d.ts +25 -0
  311. package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
  312. package/types/mixins/InputMixin.d.ts +173 -0
  313. package/types/mixins/InputMixin.d.ts.map +1 -0
  314. package/types/mixins/KeyboardNavMixin.d.ts +46 -0
  315. package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
  316. package/types/mixins/NavigationListenerMixin.d.ts +8 -0
  317. package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
  318. package/types/mixins/PopupMixin.d.ts +98 -0
  319. package/types/mixins/PopupMixin.d.ts.map +1 -0
  320. package/types/mixins/RTLObserverMixin.d.ts +8 -0
  321. package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
  322. package/types/mixins/ResizeObserverMixin.d.ts +13 -0
  323. package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
  324. package/types/mixins/RippleMixin.d.ts +94 -0
  325. package/types/mixins/RippleMixin.d.ts.map +1 -0
  326. package/types/mixins/ScrollListenerMixin.d.ts +46 -0
  327. package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
  328. package/types/mixins/SemiStickyMixin.d.ts +50 -0
  329. package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
  330. package/types/mixins/ShapeMaskedMixin.d.ts +12 -0
  331. package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
  332. package/types/mixins/ShapeMixin.d.ts +39 -0
  333. package/types/mixins/ShapeMixin.d.ts.map +1 -0
  334. package/types/mixins/StateMixin.d.ts +29 -0
  335. package/types/mixins/StateMixin.d.ts.map +1 -0
  336. package/types/mixins/TextFieldMixin.d.ts +153 -0
  337. package/types/mixins/TextFieldMixin.d.ts.map +1 -0
  338. package/types/mixins/ThemableMixin.d.ts +10 -0
  339. package/types/mixins/ThemableMixin.d.ts.map +1 -0
  340. package/types/mixins/TooltipTriggerMixin.d.ts +114 -0
  341. package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
  342. package/types/mixins/TouchTargetMixin.d.ts +6 -0
  343. package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
  344. package/types/mixins/TypographyMixin.d.ts +20 -0
  345. package/types/mixins/TypographyMixin.d.ts.map +1 -0
  346. package/types/services/rtl.d.ts +3 -0
  347. package/types/services/rtl.d.ts.map +1 -0
  348. package/types/services/svgAlias.d.ts +13 -0
  349. package/types/services/svgAlias.d.ts.map +1 -0
  350. package/types/services/theme.d.ts +45 -0
  351. package/types/services/theme.d.ts.map +1 -0
  352. package/types/utils/cli.d.ts +3 -0
  353. package/types/utils/cli.d.ts.map +1 -0
  354. package/types/utils/function.d.ts +3 -0
  355. package/types/utils/function.d.ts.map +1 -0
  356. package/types/utils/jsx-runtime.d.ts +20 -0
  357. package/types/utils/jsx-runtime.d.ts.map +1 -0
  358. package/types/utils/material-color/blend.d.ts +34 -0
  359. package/types/utils/material-color/blend.d.ts.map +1 -0
  360. package/types/utils/material-color/hct/Cam16.d.ts +142 -0
  361. package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
  362. package/types/utils/material-color/hct/Hct.d.ts +93 -0
  363. package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
  364. package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
  365. package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
  366. package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
  367. package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
  368. package/types/utils/material-color/helper.d.ts +8 -0
  369. package/types/utils/material-color/helper.d.ts.map +1 -0
  370. package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
  371. package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
  372. package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
  373. package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
  374. package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
  375. package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
  376. package/types/utils/material-color/utils/color.d.ts +172 -0
  377. package/types/utils/material-color/utils/color.d.ts.map +1 -0
  378. package/types/utils/material-color/utils/math.d.ts +94 -0
  379. package/types/utils/material-color/utils/math.d.ts.map +1 -0
  380. package/types/utils/pixelmatch.d.ts +22 -0
  381. package/types/utils/pixelmatch.d.ts.map +1 -0
  382. package/types/utils/popup.d.ts +106 -0
  383. package/types/utils/popup.d.ts.map +1 -0
  384. package/types/utils/searchParams.d.ts +3 -0
  385. package/types/utils/searchParams.d.ts.map +1 -0
  386. package/types/utils/svg.d.ts +7 -0
  387. package/types/utils/svg.d.ts.map +1 -0
  388. package/utils/jsx-runtime.js +9 -4
  389. package/utils/material-color/scheme/Scheme.js +1 -1
  390. package/utils/pixelmatch.js +363 -0
  391. package/utils/popup.js +86 -10
  392. package/utils/searchParams.js +22 -0
  393. package/components/Button.md +0 -61
  394. package/components/ExtendedFab.js +0 -32
  395. package/components/Layout.js +0 -504
  396. package/components/Nav.js +0 -38
  397. package/core/DomAdapter.js +0 -586
  398. package/core/ICustomElement.d.ts +0 -291
  399. package/core/ICustomElement.js +0 -1
  400. package/core/test.js +0 -126
  401. package/core/typings.d.ts +0 -142
  402. package/core/typings.js +0 -1
  403. package/mixins/SurfaceMixin.js +0 -127
  404. package/theming/loader.js +0 -22
  405. /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
@@ -0,0 +1,212 @@
1
+ export namespace TYPOGRAPHY_DEFAULT {
2
+ namespace face {
3
+ let brand: string;
4
+ let plain: string;
5
+ namespace weight {
6
+ let regular: number;
7
+ let medium: number;
8
+ }
9
+ }
10
+ namespace scale {
11
+ namespace display {
12
+ export namespace large {
13
+ export let fontFamily: string;
14
+ export let lineHeight: number;
15
+ export let fontSize: number;
16
+ export let letterSpacing: number;
17
+ let weight_1: string;
18
+ export { weight_1 as weight };
19
+ }
20
+ export namespace medium_1 {
21
+ let fontFamily_1: string;
22
+ export { fontFamily_1 as fontFamily };
23
+ let lineHeight_1: number;
24
+ export { lineHeight_1 as lineHeight };
25
+ let fontSize_1: number;
26
+ export { fontSize_1 as fontSize };
27
+ let letterSpacing_1: number;
28
+ export { letterSpacing_1 as letterSpacing };
29
+ let weight_2: string;
30
+ export { weight_2 as weight };
31
+ }
32
+ export { medium_1 as medium };
33
+ export namespace small {
34
+ let fontFamily_2: string;
35
+ export { fontFamily_2 as fontFamily };
36
+ let lineHeight_2: number;
37
+ export { lineHeight_2 as lineHeight };
38
+ let fontSize_2: number;
39
+ export { fontSize_2 as fontSize };
40
+ let letterSpacing_2: number;
41
+ export { letterSpacing_2 as letterSpacing };
42
+ let weight_3: string;
43
+ export { weight_3 as weight };
44
+ }
45
+ }
46
+ namespace headline {
47
+ export namespace large_1 {
48
+ let fontFamily_3: string;
49
+ export { fontFamily_3 as fontFamily };
50
+ let lineHeight_3: number;
51
+ export { lineHeight_3 as lineHeight };
52
+ let fontSize_3: number;
53
+ export { fontSize_3 as fontSize };
54
+ let letterSpacing_3: number;
55
+ export { letterSpacing_3 as letterSpacing };
56
+ let weight_4: string;
57
+ export { weight_4 as weight };
58
+ }
59
+ export { large_1 as large };
60
+ export namespace medium_2 {
61
+ let fontFamily_4: string;
62
+ export { fontFamily_4 as fontFamily };
63
+ let lineHeight_4: number;
64
+ export { lineHeight_4 as lineHeight };
65
+ let fontSize_4: number;
66
+ export { fontSize_4 as fontSize };
67
+ let letterSpacing_4: number;
68
+ export { letterSpacing_4 as letterSpacing };
69
+ let weight_5: string;
70
+ export { weight_5 as weight };
71
+ }
72
+ export { medium_2 as medium };
73
+ export namespace small_1 {
74
+ let fontFamily_5: string;
75
+ export { fontFamily_5 as fontFamily };
76
+ let lineHeight_5: number;
77
+ export { lineHeight_5 as lineHeight };
78
+ let fontSize_5: number;
79
+ export { fontSize_5 as fontSize };
80
+ let letterSpacing_5: number;
81
+ export { letterSpacing_5 as letterSpacing };
82
+ let weight_6: string;
83
+ export { weight_6 as weight };
84
+ }
85
+ export { small_1 as small };
86
+ }
87
+ namespace title {
88
+ export namespace large_2 {
89
+ let fontFamily_6: string;
90
+ export { fontFamily_6 as fontFamily };
91
+ let lineHeight_6: number;
92
+ export { lineHeight_6 as lineHeight };
93
+ let fontSize_6: number;
94
+ export { fontSize_6 as fontSize };
95
+ let letterSpacing_6: number;
96
+ export { letterSpacing_6 as letterSpacing };
97
+ let weight_7: string;
98
+ export { weight_7 as weight };
99
+ }
100
+ export { large_2 as large };
101
+ export namespace medium_3 {
102
+ let fontFamily_7: string;
103
+ export { fontFamily_7 as fontFamily };
104
+ let lineHeight_7: number;
105
+ export { lineHeight_7 as lineHeight };
106
+ let fontSize_7: number;
107
+ export { fontSize_7 as fontSize };
108
+ let letterSpacing_7: number;
109
+ export { letterSpacing_7 as letterSpacing };
110
+ let weight_8: string;
111
+ export { weight_8 as weight };
112
+ }
113
+ export { medium_3 as medium };
114
+ export namespace small_2 {
115
+ let fontFamily_8: string;
116
+ export { fontFamily_8 as fontFamily };
117
+ let lineHeight_8: number;
118
+ export { lineHeight_8 as lineHeight };
119
+ let fontSize_8: number;
120
+ export { fontSize_8 as fontSize };
121
+ let letterSpacing_8: number;
122
+ export { letterSpacing_8 as letterSpacing };
123
+ let weight_9: string;
124
+ export { weight_9 as weight };
125
+ }
126
+ export { small_2 as small };
127
+ }
128
+ namespace label {
129
+ export namespace large_3 {
130
+ let fontFamily_9: string;
131
+ export { fontFamily_9 as fontFamily };
132
+ let lineHeight_9: number;
133
+ export { lineHeight_9 as lineHeight };
134
+ let fontSize_9: number;
135
+ export { fontSize_9 as fontSize };
136
+ let letterSpacing_9: number;
137
+ export { letterSpacing_9 as letterSpacing };
138
+ let weight_10: string;
139
+ export { weight_10 as weight };
140
+ }
141
+ export { large_3 as large };
142
+ export namespace medium_4 {
143
+ let fontFamily_10: string;
144
+ export { fontFamily_10 as fontFamily };
145
+ let lineHeight_10: number;
146
+ export { lineHeight_10 as lineHeight };
147
+ let fontSize_10: number;
148
+ export { fontSize_10 as fontSize };
149
+ let letterSpacing_10: number;
150
+ export { letterSpacing_10 as letterSpacing };
151
+ let weight_11: string;
152
+ export { weight_11 as weight };
153
+ }
154
+ export { medium_4 as medium };
155
+ export namespace small_3 {
156
+ let fontFamily_11: string;
157
+ export { fontFamily_11 as fontFamily };
158
+ let lineHeight_11: number;
159
+ export { lineHeight_11 as lineHeight };
160
+ let fontSize_11: number;
161
+ export { fontSize_11 as fontSize };
162
+ let letterSpacing_11: number;
163
+ export { letterSpacing_11 as letterSpacing };
164
+ let weight_12: string;
165
+ export { weight_12 as weight };
166
+ }
167
+ export { small_3 as small };
168
+ }
169
+ namespace body {
170
+ export namespace large_4 {
171
+ let fontFamily_12: string;
172
+ export { fontFamily_12 as fontFamily };
173
+ let lineHeight_12: number;
174
+ export { lineHeight_12 as lineHeight };
175
+ let fontSize_12: number;
176
+ export { fontSize_12 as fontSize };
177
+ let letterSpacing_12: number;
178
+ export { letterSpacing_12 as letterSpacing };
179
+ let weight_13: string;
180
+ export { weight_13 as weight };
181
+ }
182
+ export { large_4 as large };
183
+ export namespace medium_5 {
184
+ let fontFamily_13: string;
185
+ export { fontFamily_13 as fontFamily };
186
+ let lineHeight_13: number;
187
+ export { lineHeight_13 as lineHeight };
188
+ let fontSize_13: number;
189
+ export { fontSize_13 as fontSize };
190
+ let letterSpacing_13: number;
191
+ export { letterSpacing_13 as letterSpacing };
192
+ let weight_14: string;
193
+ export { weight_14 as weight };
194
+ }
195
+ export { medium_5 as medium };
196
+ export namespace small_4 {
197
+ let fontFamily_14: string;
198
+ export { fontFamily_14 as fontFamily };
199
+ let lineHeight_14: number;
200
+ export { lineHeight_14 as lineHeight };
201
+ let fontSize_14: number;
202
+ export { fontSize_14 as fontSize };
203
+ let letterSpacing_14: number;
204
+ export { letterSpacing_14 as letterSpacing };
205
+ let weight_15: string;
206
+ export { weight_15 as weight };
207
+ }
208
+ export { small_4 as small };
209
+ }
210
+ }
211
+ }
212
+ //# sourceMappingURL=typography.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typography.d.ts","sourceRoot":"","sources":["../../constants/typography.js"],"names":[],"mappings":""}
@@ -0,0 +1,260 @@
1
+ /** @template T */
2
+ export default class Composition<T> {
3
+ static EVENT_PREFIX_REGEX: RegExp;
4
+ static shadowRootTag: symbol;
5
+ /**
6
+ * @template T
7
+ * @param {ConstructorParameters<typeof Composition<T>>} parts
8
+ * @return {Composition<T>}
9
+ */
10
+ static compose<T_1>(...parts: ConstructorParameters<typeof Composition<T_1>>): Composition<T_1>;
11
+ /**
12
+ * @param {(CompositionPart<T>)[]} parts
13
+ */
14
+ constructor(...parts: (CompositionPart<T>)[]);
15
+ _interpolationState: {
16
+ nodeIndex: number;
17
+ searchIndex: number;
18
+ cacheIndex: number;
19
+ commentIndex: number;
20
+ /** @type {this['nodesToBind'][0]} */
21
+ nodeEntry: this["nodesToBind"][0];
22
+ };
23
+ /** @type {{tag:string, textNodes: number[]}[]} */
24
+ nodesToBind: {
25
+ tag: string;
26
+ textNodes: number[];
27
+ }[];
28
+ /** @type {string[]} */
29
+ props: string[];
30
+ /** @type {RenderGraphSearch[]} */
31
+ searches: RenderGraphSearch[];
32
+ /** @type {any[]} */
33
+ initCache: any[];
34
+ /**
35
+ * Index of searches by query (dotted notation for deep props)
36
+ * @type {Map<Function|string, RenderGraphSearch>}
37
+ */
38
+ searchByQuery: Map<Function | string, RenderGraphSearch>;
39
+ /**
40
+ * Index of searches by query (dotted notation for deep props)
41
+ * @type {Map<string, RenderGraphAction[]>}
42
+ */
43
+ actionsByPropsUsed: Map<string, RenderGraphAction[]>;
44
+ /** @type {RenderGraphAction[]} */
45
+ postInitActions: RenderGraphAction[];
46
+ /** @type {Set<string>} */
47
+ tagsWithBindings: Set<string>;
48
+ /**
49
+ * Array of element tags
50
+ * @type {string[]}
51
+ */
52
+ tags: string[];
53
+ /**
54
+ * Data of arrays used in templates
55
+ * Usage of a [mdw-for] will create an ArrayLike expectation based on key
56
+ * Only store metadata, not actual data. Currently only needs length.
57
+ * TBD if more is needed later
58
+ * Referenced by property key (string)
59
+ * @type {CompositionAdapter<T>}
60
+ */
61
+ adapter: CompositionAdapter<T>;
62
+ /**
63
+ * Collection of events to bind.
64
+ * Indexed by ID
65
+ * @type {Map<string|symbol, CompositionEventListener<any>[]>}
66
+ */
67
+ events: Map<string | symbol, CompositionEventListener<any>[]>;
68
+ /**
69
+ * Snapshot of composition at initial state.
70
+ * This fragment can be cloned for first rendering, instead of calling
71
+ * of using `render()` to construct the initial DOM tree.
72
+ * @type {DocumentFragment}
73
+ */
74
+ cloneable: DocumentFragment;
75
+ /** @type {(HTMLStyleElement|CSSStyleSheet)[]} */
76
+ styles: (HTMLStyleElement | CSSStyleSheet)[];
77
+ /** @type {CSSStyleSheet[]} */
78
+ adoptedStyleSheets: CSSStyleSheet[];
79
+ /** @type {DocumentFragment} */
80
+ stylesFragment: DocumentFragment;
81
+ /**
82
+ * List of IDs used by template elements
83
+ * May be needed to be removed when adding to non-DocumentFragment
84
+ * @type {string[]}
85
+ */
86
+ allIds: string[];
87
+ /**
88
+ * Collection of IDs used for referencing elements
89
+ * Not meant for live DOM. Removed before attaching to document
90
+ */
91
+ /** @type {Set<string>} */
92
+ temporaryIds: Set<string>;
93
+ /** Flag set when template and styles have been interpolated */
94
+ interpolated: boolean;
95
+ /**
96
+ * Template used to build interpolation and cloneable
97
+ */
98
+ template: DocumentFragment;
99
+ /**
100
+ * @param {CompositionPart<T>[]} parts
101
+ */
102
+ append(...parts: CompositionPart<T>[]): this;
103
+ /** @param {CompositionEventListener<T>} listener */
104
+ addCompositionEventListener(listener: CompositionEventListener<T>): this;
105
+ /**
106
+ * TODO: Add types and clean up closure leak
107
+ * Updates component nodes based on data.
108
+ * Expects data in JSON Merge Patch format
109
+ * @see https://www.rfc-editor.org/rfc/rfc7386
110
+ * @template {Object} T
111
+ * @param {Partial<T>} changes what specifically
112
+ * @param {T} [data]
113
+ * @param {RenderOptions<T>} [options]
114
+ * @return {RenderDraw<T>} anchor
115
+ */
116
+ render<T_1 extends Object>(changes: Partial<T_1>, data?: T_1, options?: RenderOptions<T_1>): RenderDraw<T_1>;
117
+ /**
118
+ * @param {InterpolateOptions} [options]
119
+ */
120
+ interpolate(options?: InterpolateOptions): void;
121
+ interpolateOptions: InterpolateOptions;
122
+ /**
123
+ * @param {RenderGraphSearch} search
124
+ * @return {RenderGraphSearch}
125
+ */
126
+ addSearch(search: RenderGraphSearch): RenderGraphSearch;
127
+ /**
128
+ * @param {RenderGraphAction} action
129
+ * @return {RenderGraphAction}
130
+ */
131
+ addAction(action: RenderGraphAction): RenderGraphAction;
132
+ [Symbol.iterator](): Generator<DocumentFragment | CSSStyleSheet | HTMLStyleElement, void, unknown>;
133
+ #private;
134
+ }
135
+ export type CompositionPart<T> = Composition<unknown> | HTMLStyleElement | CSSStyleSheet | DocumentFragment | string;
136
+ export type Compositor<T extends unknown> = (...parts: (CompositionPart<T>)[]) => Composition<T>;
137
+ export type RenderOptions<T> = {
138
+ /**
139
+ * what
140
+ */
141
+ defaults?: T;
142
+ /**
143
+ * what
144
+ */
145
+ store?: T;
146
+ /**
147
+ * where
148
+ */
149
+ target?: DocumentFragment | HTMLElement | Element;
150
+ /**
151
+ * where
152
+ */
153
+ shadowRoot?: ShadowRoot;
154
+ /**
155
+ * `this` on callbacks/events
156
+ */
157
+ context?: any;
158
+ injections?: any;
159
+ };
160
+ export type RenderDraw<T> = {
161
+ target: Element | DocumentFragment;
162
+ byProp: (prop: keyof T & string, value: any, data?: Partial<T>) => void;
163
+ state: InitializationState;
164
+ } & ((changes: Partial<T>, data: T) => void);
165
+ export type HTMLElementEventMapFixed = HTMLElementEventMap & {
166
+ input: InputEvent;
167
+ };
168
+ export type HTMLElementCancellableEventMap = (Pick<HTMLElementEventMapFixed, "auxclick" | "beforeinput" | "click" | "compositionstart" | "contextmenu" | "drag" | "dragenter" | "dragover" | "dragstart" | "drop" | "invalid" | "keydown" | "keypress" | "keyup" | "mousedown" | "mousemove" | "mouseout" | "mouseover" | "mouseup" | "pointerdown" | "pointermove" | "pointerout" | "pointerover" | "pointerup" | "reset" | "selectstart" | "submit" | "touchend" | "touchmove" | "touchstart" | "wheel">);
169
+ export type CompositionEventMap = (HTMLElementEventMapFixed & { [P in keyof HTMLElementCancellableEventMap as `~${P}`]: HTMLElementCancellableEventMap[P]; } & Record<string, Event | CustomEvent<any>>);
170
+ export type CompositionEventListener<T extends unknown, K extends keyof CompositionEventMap = string> = {
171
+ type?: K;
172
+ tag?: string | symbol;
173
+ capture?: boolean;
174
+ once?: boolean;
175
+ passive?: boolean;
176
+ signal?: AbortSignal;
177
+ handleEvent?: (this: T, event: (K extends keyof CompositionEventMap ? CompositionEventMap[K] : Event) & {
178
+ currentTarget: HTMLElement;
179
+ }) => any;
180
+ prop?: string;
181
+ deepProp?: string[];
182
+ };
183
+ export type CompositionEventListenerObject<T> = { [P in keyof CompositionEventMap]?: (keyof T & string) | ((this: T, event: CompositionEventMap[P] & {
184
+ currentTarget: HTMLElement;
185
+ }) => any) | CompositionEventListener<T, P>; };
186
+ export type NodeBindEntry<T extends unknown> = {
187
+ key?: string;
188
+ index?: number;
189
+ tag: string;
190
+ /**
191
+ * Index of childNode or attrName
192
+ */
193
+ subnode: string | number;
194
+ props: string[];
195
+ deepProps: string[][];
196
+ negate?: boolean;
197
+ doubleNegate?: boolean;
198
+ expression?: Function;
199
+ /**
200
+ * custom render function
201
+ */
202
+ render?: (options: RenderOptions<unknown>, element: Element, changes: any, data: any) => any;
203
+ listeners?: CompositionEventListener<T>[];
204
+ composition?: Composition<any>;
205
+ defaultValue: T;
206
+ };
207
+ export type RenderState = any[];
208
+ export type RenderGraphSearch = {
209
+ invocation: (state: InitializationState, changes: any, data: any) => any;
210
+ cacheIndex: number;
211
+ searchIndex: number;
212
+ query: string | Function | string[];
213
+ negate?: boolean;
214
+ doubleNegate?: boolean;
215
+ expression?: Function;
216
+ prop: string;
217
+ deepProp: string[];
218
+ propsUsed: string[];
219
+ deepPropsUsed: string[][];
220
+ defaultValue: any;
221
+ subSearch?: RenderGraphSearch;
222
+ };
223
+ export type RenderGraphAction = {
224
+ invocation: (state: InitializationState, value: any, changes: any, data: any) => any;
225
+ commentIndex?: number;
226
+ nodeIndex?: number;
227
+ cacheIndex?: number;
228
+ attrName?: string;
229
+ defaultValue?: any;
230
+ search: RenderGraphSearch;
231
+ injections?: InterpolateOptions["injections"];
232
+ };
233
+ export type InterpolateOptions = {
234
+ /**
235
+ * Default values to use for interpolation
236
+ */
237
+ defaults?: Record<string, any>;
238
+ /**
239
+ * Context-specific injected properties. (Experimental)
240
+ */
241
+ injections?: {
242
+ iterable: string;
243
+ } & Record<string, any> & {
244
+ index: number;
245
+ };
246
+ };
247
+ export type InitializationState = {
248
+ lastElement: Element;
249
+ lastChildNode: ChildNode;
250
+ nodes: (Element | Text)[];
251
+ caches: any[];
252
+ comments: Comment[];
253
+ nodeStates: Uint8Array;
254
+ searchStates: Uint8Array;
255
+ refs: HTMLElement[];
256
+ lastChildNodeIndex: number;
257
+ options: RenderOptions<unknown>;
258
+ };
259
+ import CompositionAdapter from './CompositionAdapter.js';
260
+ //# sourceMappingURL=Composition.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Composition.d.ts","sourceRoot":"","sources":["../../core/Composition.js"],"names":[],"mappings":"AAydA,kBAAkB;AAClB,iCADc,CAAC;IAEb,kCAA8C;IAY9C,6BAAgC;IA2GhC;;;;OAIG;IACH,8BAHY,qBAAqB,CAAC,OAAO,WAAW,CAAC,GAAC,CAAC,CAAC,GAC5C,WA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G,MAAM,CAAC,MAAM,EAAC,GAAG,CAAC,GAAG;QAAC,KAAK,EAAC,MAAM,CAAA;KAAC;;;iBAKvD,OAAO;mBACP,SAAS;WACT,CAAC,OAAO,GAAC,IAAI,CAAC,EAAE;YAChB,GAAG,EAAE;cACL,OAAO,EAAE;gBACT,UAAU;kBACV,UAAU;UACV,WAAW,EAAE;wBACb,MAAM;aACN,aAAa,CAAC,OAAC,CAAC;;+BAlYK,yBAAyB"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * @template T
3
+ * @typedef {import('./Composition.js').default<T>} Composition
4
+ */
5
+ /**
6
+ * @template T
7
+ * @typedef {import('./Composition.js').RenderOptions<T>} RenderOptions
8
+ */
9
+ /**
10
+ * @template T
11
+ * @typedef {Object} DomAdapterCreateOptions
12
+ * @prop {Comment} anchorNode
13
+ * @prop {(...args:any[]) => HTMLElement} [create]
14
+ * @prop {Composition<T>} composition
15
+ * @prop {RenderOptions<T>} renderOptions
16
+ */
17
+ /**
18
+ * @typedef {Object} ItemMetadata
19
+ * @prop {Element} element
20
+ * @prop {any} key
21
+ * @prop {Element|Comment} domNode
22
+ * @prop {Function} render
23
+ * @prop {boolean} [hidden]
24
+ * @prop {Comment} [comment]
25
+ */
26
+ /** @template T */
27
+ export default class CompositionAdapter<T> {
28
+ /** @param {DomAdapterCreateOptions<T>} options */
29
+ constructor(options: DomAdapterCreateOptions<T>);
30
+ anchorNode: Comment;
31
+ /** @type {ItemMetadata[]} */
32
+ metadata: ItemMetadata[];
33
+ /**
34
+ * Ordered-list of metadata keys
35
+ * Chrome and FireFox optimize arrays for indexOf/includes
36
+ * Safari is faster with WeakMap.get(), but can't use Primitive keys
37
+ * TODO: Add Safari path
38
+ * @type {any[]}
39
+ */
40
+ keys: any[];
41
+ /**
42
+ * Chrome needs a hint to know we will need a fast path for array by keys.
43
+ */
44
+ needsArrayKeyFastPath: boolean;
45
+ /** @type {Composition<T>} */
46
+ composition: Composition<T>;
47
+ /** @type {RenderOptions<T>} */
48
+ renderOptions: RenderOptions<T>;
49
+ /** @type {Map<any, ItemMetadata>} */
50
+ metadataCache: Map<any, ItemMetadata>;
51
+ /** @type {Element[]} */
52
+ queuedElements: Element[];
53
+ /** @type {number|null} */
54
+ batchStartIndex: number | null;
55
+ /** @type {number|null} */
56
+ batchEndIndex: number | null;
57
+ /**
58
+ * @param {Partial<T>} changes
59
+ * @param {T} data
60
+ * @return {import('./Composition.js').RenderDraw<T>}
61
+ */
62
+ render(changes: Partial<T>, data: T): import("./Composition.js").RenderDraw<T>;
63
+ startBatch(): void;
64
+ writeBatch(): void;
65
+ stopBatch(): void;
66
+ /** @param {number} index */
67
+ removeByIndex(index: number): void;
68
+ /**
69
+ * Worst case scenario
70
+ * @param {number} newIndex expectedIndex
71
+ * @param {*} changes
72
+ * @param {*} data
73
+ * @param {*} key
74
+ * @param {*} change
75
+ * @param {boolean} [skipOnMatch]
76
+ * JSON Merge has no way to express sort change and data change. Best
77
+ * performance is done via invoking render on sort change and another on
78
+ * inner change. Can't skip if mixing change types.
79
+ */
80
+ renderData(newIndex: number, changes: any, data: any, key: any, change: any, skipOnMatch?: boolean): void;
81
+ needsArrayFastPath: boolean;
82
+ removeEntries(startIndex?: number): void;
83
+ /**
84
+ * @param {number} [index]
85
+ * @param {ItemMetadata} [metadata]
86
+ * @param {any} [key]
87
+ * @return {boolean} changed
88
+ */
89
+ hide(index?: number, metadata?: ItemMetadata, key?: any): boolean;
90
+ /**
91
+ * @param {number} [index]
92
+ * @param {ItemMetadata} [metadata]
93
+ * @param {any} [key]
94
+ * @return {boolean} changed
95
+ */
96
+ show(index?: number, metadata?: ItemMetadata, key?: any): boolean;
97
+ }
98
+ export type Composition<T> = import("./Composition.js").default<T>;
99
+ export type RenderOptions<T> = import("./Composition.js").RenderOptions<T>;
100
+ export type DomAdapterCreateOptions<T> = {
101
+ anchorNode: Comment;
102
+ create?: (...args: any[]) => HTMLElement;
103
+ composition: Composition<T>;
104
+ renderOptions: RenderOptions<T>;
105
+ };
106
+ export type ItemMetadata = {
107
+ element: Element;
108
+ key: any;
109
+ domNode: Element | Comment;
110
+ render: Function;
111
+ hidden?: boolean;
112
+ comment?: Comment;
113
+ };
114
+ //# sourceMappingURL=CompositionAdapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CompositionAdapter.d.ts","sourceRoot":"","sources":["../../core/CompositionAdapter.js"],"names":[],"mappings":"AAEA;;;GAGG;AAEH;;;GAGG;AAEH;;;;;;;GAOG;AAEH;;;;;;;;GAQG;AAEH,kBAAkB;AAClB,wCADc,CAAC;IAEb,kDAAkD;IAClD,qBADY,uBAAuB,CAAC,CAAC,CAAC,EAmCrC;IAjCC,oBAAoC;IAEpC,6BAA6B;IAC7B,UADW,YAAY,EAAE,CACP;IAClB;;;;;;OAMG;IACH,MAFU,GAAG,EAAE,CAED;IAEd;;OAEG;IACH,+BAAkC;IAElC,6BAA6B;IAC7B,aADW,WAAW,CAAC,CAAC,CAAC,CACa;IACtC,+BAA+B;IAC/B,eADW,aAAa,CAAC,CAAC,CAAC,CACe;IAE1C,qCAAqC;IACrC,eADW,GAAG,CAAC,GAAG,EAAE,YAAY,CAAC,CACR;IAEzB,wBAAwB;IACxB,gBADW,OAAO,EAAE,CACI;IAExB,0BAA0B;IAC1B,iBADW,MAAM,GAAC,IAAI,CACK;IAC3B,0BAA0B;IAC1B,eADW,MAAM,GAAC,IAAI,CACG;IAG3B;;;;OAIG;IACH,gBAJW,OAAO,CAAC,CAAC,CAAC,QACV,CAAC,GACA,OAAO,kBAAkB,EAAE,UAAU,CAAC,CAAC,CAAC,CAInD;IAED,mBAGC;IAED,mBAMC;IAED,kBAYC;IAED,4BAA4B;IAC5B,qBADY,MAAM,QAajB;IAED;;;;;;;;;;;OAWG;IACH,qBAVW,MAAM,WACN,GAAC,QACD,GAAC,OACD,GAAC,UACD,GAAC,gBACD,OAAO,QAuIjB;IAhGK,4BAA+B;IAkGrC,yCAOC;IAED;;;;;OAKG;IACH,aALW,MAAM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