tungsten 0.3.2 → 0.3.4

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 (397) hide show
  1. package/dist/.build-complete +1 -0
  2. package/dist/Components.d.ts +6 -1
  3. package/dist/Components.d.ts.map +1 -1
  4. package/dist/Components.js +103 -40
  5. package/dist/DomPointer.d.ts +11 -0
  6. package/dist/DomPointer.d.ts.map +1 -1
  7. package/dist/DomPointer.js +15 -0
  8. package/dist/DomRegion.d.ts +2 -0
  9. package/dist/DomRegion.d.ts.map +1 -1
  10. package/dist/DomRegion.js +23 -3
  11. package/dist/Framework.d.ts +2 -0
  12. package/dist/Framework.d.ts.map +1 -1
  13. package/dist/Framework.js +94 -61
  14. package/dist/FrameworkConfig.d.ts +4 -0
  15. package/dist/FrameworkConfig.d.ts.map +1 -1
  16. package/dist/Instance/Instance.d.ts +1 -1
  17. package/dist/Instance/Instance.d.ts.map +1 -1
  18. package/dist/Instance/Instance.js +18 -1
  19. package/dist/Instance/InstanceConfig.d.ts +1 -0
  20. package/dist/Instance/InstanceConfig.d.ts.map +1 -1
  21. package/dist/PopMessage.type.d.ts +6 -0
  22. package/dist/PopMessage.type.d.ts.map +1 -0
  23. package/dist/PopMessage.type.js +1 -0
  24. package/dist/Servers/DevServer.d.ts +2 -0
  25. package/dist/Servers/DevServer.d.ts.map +1 -1
  26. package/dist/Servers/DevServer.js +87 -11
  27. package/dist/Servers/MatchedRouteInfo.d.ts +1 -1
  28. package/dist/Servers/MatchedRouteInfo.d.ts.map +1 -1
  29. package/dist/Servers/ProdServer.d.ts +2 -1
  30. package/dist/Servers/ProdServer.d.ts.map +1 -1
  31. package/dist/Servers/ProdServer.js +92 -8
  32. package/dist/Servers/hono/DevServerHono.js +25 -29
  33. package/dist/Servers/hono/ProdServerHono.js +49 -142
  34. package/dist/Servers/hono/TungstenServerHono.d.ts +1 -1
  35. package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
  36. package/dist/Servers/hono/TungstenServerHono.js +12 -29
  37. package/dist/Servers/loadEnvsDev.d.ts.map +1 -1
  38. package/dist/Servers/loadEnvsDev.js +16 -5
  39. package/dist/Servers/routing.d.ts.map +1 -1
  40. package/dist/Servers/routing.js +10 -6
  41. package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts +0 -3
  42. package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +1 -1
  43. package/dist/Servers/tungstenCorePrivateEnvSchema.js +3 -3
  44. package/dist/Servers/tungstenCorePublicEnvSchema.d.ts +8 -0
  45. package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +1 -0
  46. package/dist/Servers/tungstenCorePublicEnvSchema.js +14 -0
  47. package/dist/Store/InternalStoreSchema.d.ts +2 -0
  48. package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
  49. package/dist/Store/InternalStoreSchema.js +1 -0
  50. package/dist/api/Request.d.ts +1 -1
  51. package/dist/api/Request.d.ts.map +1 -1
  52. package/dist/api/Response.d.ts +1 -1
  53. package/dist/api/Response.d.ts.map +1 -1
  54. package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts +13 -0
  55. package/dist/babelPlugins/BabelExtractComponentStylesheet.d.ts.map +1 -0
  56. package/dist/babelPlugins/BabelExtractComponentStylesheet.js +24 -0
  57. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts +2 -0
  58. package/dist/babelPlugins/BabelTransformComponentStyles.d.ts.map +1 -1
  59. package/dist/babelPlugins/BabelTransformComponentStyles.js +21 -5
  60. package/dist/babelPlugins/BabelTransformPackageImports.d.ts +1 -0
  61. package/dist/babelPlugins/BabelTransformPackageImports.d.ts.map +1 -1
  62. package/dist/babelPlugins/BabelTransformPackageImports.js +21 -9
  63. package/dist/babelPlugins/BabelTypes.d.ts +2 -2
  64. package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
  65. package/dist/babelPlugins/BabelTypes.js +0 -1
  66. package/dist/bin/commands/build.d.ts.map +1 -1
  67. package/dist/bin/commands/build.js +12 -2
  68. package/dist/bin/commands/compile.d.ts.map +1 -1
  69. package/dist/bin/commands/compile.js +7 -2
  70. package/dist/bin/commands/dev.d.ts.map +1 -1
  71. package/dist/bin/commands/dev.js +15 -4
  72. package/dist/bin/commands/devmon.d.ts +2 -0
  73. package/dist/bin/commands/devmon.d.ts.map +1 -0
  74. package/dist/bin/commands/devmon.js +66 -0
  75. package/dist/bin/index.d.ts.map +1 -1
  76. package/dist/bin/index.js +6 -0
  77. package/dist/booleanAttributeValue.d.ts +21 -0
  78. package/dist/booleanAttributeValue.d.ts.map +1 -0
  79. package/dist/booleanAttributeValue.js +23 -0
  80. package/dist/build/CompilationInfo.d.ts +1 -0
  81. package/dist/build/CompilationInfo.d.ts.map +1 -1
  82. package/dist/build/combineComponentCss.d.ts +1 -1
  83. package/dist/build/combineComponentCss.d.ts.map +1 -1
  84. package/dist/build/combineComponentCss.js +3 -3
  85. package/dist/build/compileJavascript.d.ts.map +1 -1
  86. package/dist/build/compileJavascript.js +3 -3
  87. package/dist/build/compileUserApp.d.ts +2 -1
  88. package/dist/build/compileUserApp.d.ts.map +1 -1
  89. package/dist/build/compileUserApp.js +18 -8
  90. package/dist/build/createInstanceConfigFile.js +1 -1
  91. package/dist/build/frameworkStylesheets.d.ts +5 -0
  92. package/dist/build/frameworkStylesheets.d.ts.map +1 -0
  93. package/dist/build/frameworkStylesheets.js +49 -0
  94. package/dist/build/getPackageDirForFile.d.ts +2 -0
  95. package/dist/build/getPackageDirForFile.d.ts.map +1 -0
  96. package/dist/build/getPackageDirForFile.js +11 -0
  97. package/dist/build/getSxyClientPackageAliases.d.ts.map +1 -1
  98. package/dist/build/getSxyClientPackageAliases.js +3 -1
  99. package/dist/build/makeBabelUserDevConfig.d.ts +1 -1
  100. package/dist/build/makeBabelUserDevConfig.d.ts.map +1 -1
  101. package/dist/build/makeBabelUserDevConfig.js +3 -2
  102. package/dist/build/makeBabelUserProdConfig.d.ts +1 -1
  103. package/dist/build/makeBabelUserProdConfig.d.ts.map +1 -1
  104. package/dist/build/makeBabelUserProdConfig.js +4 -2
  105. package/dist/build/rollup.user.prod.config.d.ts.map +1 -1
  106. package/dist/build/rollup.user.prod.config.js +4 -1
  107. package/dist/build/rollupExtractComponentStylesheets.d.ts +12 -0
  108. package/dist/build/rollupExtractComponentStylesheets.d.ts.map +1 -0
  109. package/dist/build/rollupExtractComponentStylesheets.js +35 -0
  110. package/dist/compat/context.d.ts +1 -1
  111. package/dist/compat/context.d.ts.map +1 -1
  112. package/dist/compat/types.d.ts +1 -1
  113. package/dist/compat/types.d.ts.map +1 -1
  114. package/dist/componentCss/i/T-components-library-RichTextEditor-RichTextEditor.css +115 -0
  115. package/dist/componentCss/i/T-components-library-__StatefulMessage-StatefulMessage.css +25 -0
  116. package/dist/componentCss/tungsten.css +2 -0
  117. package/dist/componentProxyHandlers.d.ts +2 -1
  118. package/dist/componentProxyHandlers.d.ts.map +1 -1
  119. package/dist/componentProxyHandlers.js +45 -9
  120. package/dist/components/GoToComponent.d.ts +1 -1
  121. package/dist/components/GoToComponent.d.ts.map +1 -1
  122. package/dist/components/PopMessages.d.ts +12 -0
  123. package/dist/components/PopMessages.d.ts.map +1 -0
  124. package/dist/components/PopMessages.js +45 -0
  125. package/dist/components/_GoToComponent.d.ts +10 -0
  126. package/dist/components/_GoToComponent.d.ts.map +1 -0
  127. package/dist/components/_GoToComponent.js +13 -0
  128. package/dist/components/library/RichTextEditor/RichTextEditor.d.ts +50 -0
  129. package/dist/components/library/RichTextEditor/RichTextEditor.d.ts.map +1 -0
  130. package/dist/components/library/RichTextEditor/RichTextEditor.js +458 -0
  131. package/dist/components/library/RichTextEditor/StoredContentNode.d.ts +5 -0
  132. package/dist/components/library/RichTextEditor/StoredContentNode.d.ts.map +1 -0
  133. package/dist/components/library/RichTextEditor/StoredContentNode.js +1 -0
  134. package/dist/components/library/RichTextEditor/activeFormats.d.ts +20 -0
  135. package/dist/components/library/RichTextEditor/activeFormats.d.ts.map +1 -0
  136. package/dist/components/library/RichTextEditor/activeFormats.js +48 -0
  137. package/dist/components/library/RichTextEditor/contentTree.d.ts +30 -0
  138. package/dist/components/library/RichTextEditor/contentTree.d.ts.map +1 -0
  139. package/dist/components/library/RichTextEditor/contentTree.js +81 -0
  140. package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts +30 -0
  141. package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.d.ts.map +1 -0
  142. package/dist/components/library/RichTextEditor/sanitizeAuthoredHtml.js +97 -0
  143. package/dist/components/library/__StatefulMessage/MessageData.d.ts +7 -0
  144. package/dist/components/library/__StatefulMessage/MessageData.d.ts.map +1 -0
  145. package/dist/components/library/__StatefulMessage/MessageData.js +1 -0
  146. package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts +22 -0
  147. package/dist/components/library/__StatefulMessage/StatefulMessage.d.ts.map +1 -0
  148. package/dist/components/library/__StatefulMessage/StatefulMessage.js +88 -0
  149. package/dist/components/library/index.d.ts +5 -0
  150. package/dist/components/library/index.d.ts.map +1 -0
  151. package/dist/components/library/index.js +7 -0
  152. package/dist/defaultConfig.d.ts +2 -0
  153. package/dist/defaultConfig.d.ts.map +1 -1
  154. package/dist/defaultConfig.js +3 -1
  155. package/dist/env/Interfaces.d.ts +2 -1
  156. package/dist/env/Interfaces.d.ts.map +1 -1
  157. package/dist/env/getEnvSchemas.d.ts +1 -1
  158. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  159. package/dist/env/injectEnv.d.ts +1 -1
  160. package/dist/env/injectEnv.d.ts.map +1 -1
  161. package/dist/env/injectEnv.js +16 -6
  162. package/dist/env/publicEnv.d.ts.map +1 -1
  163. package/dist/env/publicEnv.js +4 -1
  164. package/dist/findUserConfig.d.ts +1 -1
  165. package/dist/frameworkConfigSchema.d.ts +4 -0
  166. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  167. package/dist/frameworkConfigSchema.js +2 -1
  168. package/dist/hooks/index.d.ts +1 -0
  169. package/dist/hooks/index.d.ts.map +1 -1
  170. package/dist/hooks/index.js +1 -0
  171. package/dist/hooks/useInstance.d.ts +3 -0
  172. package/dist/hooks/useInstance.d.ts.map +1 -0
  173. package/dist/hooks/useInstance.js +4 -0
  174. package/dist/hydrate/hydrate.d.ts +6 -4
  175. package/dist/hydrate/hydrate.d.ts.map +1 -1
  176. package/dist/hydrate/hydrate.js +51 -13
  177. package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
  178. package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
  179. package/dist/hydrate/renderHydrationMismatchBanner.d.ts +7 -0
  180. package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -0
  181. package/dist/hydrate/renderHydrationMismatchBanner.js +69 -0
  182. package/dist/indexInner.d.ts +13 -5
  183. package/dist/indexInner.d.ts.map +1 -1
  184. package/dist/indexInner.js +9 -2
  185. package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
  186. package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -1
  187. package/dist/pop.d.ts +10 -0
  188. package/dist/pop.d.ts.map +1 -0
  189. package/dist/pop.js +49 -0
  190. package/dist/postcssPlugins/TransformCssNames.d.ts.map +1 -1
  191. package/dist/postcssPlugins/TransformCssNames.js +10 -2
  192. package/dist/propsAreEqual.d.ts +8 -0
  193. package/dist/propsAreEqual.d.ts.map +1 -0
  194. package/dist/propsAreEqual.js +97 -0
  195. package/dist/rawHtml/filterContentNode.d.ts +20 -0
  196. package/dist/rawHtml/filterContentNode.d.ts.map +1 -0
  197. package/dist/rawHtml/filterContentNode.js +96 -0
  198. package/dist/rawHtml/parseHtml.d.ts +14 -0
  199. package/dist/rawHtml/parseHtml.d.ts.map +1 -1
  200. package/dist/rawHtml/parseHtml.js +4 -4
  201. package/dist/rawHtml/sanitizeHtml.d.ts +17 -0
  202. package/dist/rawHtml/sanitizeHtml.d.ts.map +1 -0
  203. package/dist/rawHtml/sanitizeHtml.js +19 -0
  204. package/dist/render/HeadData.d.ts +2 -0
  205. package/dist/render/HeadData.d.ts.map +1 -1
  206. package/dist/render/contentNodeToHtml.d.ts +18 -0
  207. package/dist/render/contentNodeToHtml.d.ts.map +1 -0
  208. package/dist/render/contentNodeToHtml.js +66 -0
  209. package/dist/render/contentToHtml.d.ts.map +1 -1
  210. package/dist/render/contentToHtml.js +3 -1
  211. package/dist/render/instantiateClassComponent.d.ts.map +1 -1
  212. package/dist/render/instantiateClassComponent.js +4 -0
  213. package/dist/render/processHead.d.ts.map +1 -1
  214. package/dist/render/processHead.js +22 -3
  215. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  216. package/dist/render/renderingTreeToHtml.js +8 -1
  217. package/dist/routing/ErrorRouteType.d.ts +6 -0
  218. package/dist/routing/ErrorRouteType.d.ts.map +1 -0
  219. package/dist/routing/ErrorRouteType.js +1 -0
  220. package/dist/routing/RouteTypes.d.ts +2 -1
  221. package/dist/routing/RouteTypes.d.ts.map +1 -1
  222. package/dist/routing/Routes.d.ts +5 -0
  223. package/dist/routing/Routes.d.ts.map +1 -1
  224. package/dist/routing/TungstenErrorInfo.d.ts +6 -0
  225. package/dist/routing/TungstenErrorInfo.d.ts.map +1 -0
  226. package/dist/routing/TungstenErrorInfo.js +6 -0
  227. package/dist/settings.d.ts +2 -0
  228. package/dist/settings.d.ts.map +1 -1
  229. package/dist/settings.js +3 -0
  230. package/dist/stateTracking.d.ts +47 -0
  231. package/dist/stateTracking.d.ts.map +1 -0
  232. package/dist/stateTracking.js +83 -0
  233. package/dist/staticGen/staticGen.d.ts.map +1 -1
  234. package/dist/staticGen/staticGen.js +117 -107
  235. package/dist/style/styleContentSxy.js +21 -0
  236. package/dist/testing/hydrateTestApp.d.ts +38 -0
  237. package/dist/testing/hydrateTestApp.d.ts.map +1 -0
  238. package/dist/testing/hydrateTestApp.js +242 -0
  239. package/dist/testing/index.d.ts +4 -3
  240. package/dist/testing/index.d.ts.map +1 -1
  241. package/dist/testing/index.js +16 -2
  242. package/dist/testing/installTestStyleProcessors.d.ts +2 -0
  243. package/dist/testing/installTestStyleProcessors.d.ts.map +1 -0
  244. package/dist/testing/installTestStyleProcessors.js +21 -0
  245. package/dist/testing/temp/componentPackageMock.d.ts +18 -0
  246. package/dist/testing/temp/componentPackageMock.d.ts.map +1 -0
  247. package/dist/testing/temp/componentPackageMock.js +37 -0
  248. package/dist/testing/temp/contentHtmlElements.d.ts +3 -0
  249. package/dist/testing/temp/contentHtmlElements.d.ts.map +1 -0
  250. package/dist/testing/temp/contentHtmlElements.js +12 -0
  251. package/dist/timeProfiler.d.ts +6 -0
  252. package/dist/timeProfiler.d.ts.map +1 -0
  253. package/dist/timeProfiler.js +31 -0
  254. package/dist/update/integrateUpdateVdom.d.ts +11 -0
  255. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  256. package/dist/update/integrateUpdateVdom.js +169 -54
  257. package/dist/update/pendingMounts.d.ts +25 -0
  258. package/dist/update/pendingMounts.d.ts.map +1 -0
  259. package/dist/update/pendingMounts.js +55 -0
  260. package/dist/warnOnFrameworkChange.d.ts.map +1 -1
  261. package/dist/warnOnFrameworkChange.js +8 -8
  262. package/package.json +21 -17
  263. package/dist/FunctionComponentStandIn.sxyt.d.ts +0 -2
  264. package/dist/FunctionComponentStandIn.sxyt.d.ts.map +0 -1
  265. package/dist/FunctionComponentStandIn.sxyt.js +0 -52
  266. package/dist/Instance/gotoRedirect.sxyt.d.ts +0 -2
  267. package/dist/Instance/gotoRedirect.sxyt.d.ts.map +0 -1
  268. package/dist/Instance/gotoRedirect.sxyt.js +0 -148
  269. package/dist/Instance/runTrackedWork.sxyt.d.ts +0 -2
  270. package/dist/Instance/runTrackedWork.sxyt.d.ts.map +0 -1
  271. package/dist/Instance/runTrackedWork.sxyt.js +0 -35
  272. package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts +0 -2
  273. package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts.map +0 -1
  274. package/dist/Servers/devErrorPageAutoRetry.sxyt.js +0 -117
  275. package/dist/_client/cjsHelpers.sxyt.d.ts +0 -2
  276. package/dist/_client/cjsHelpers.sxyt.d.ts.map +0 -1
  277. package/dist/_client/cjsHelpers.sxyt.js +0 -45
  278. package/dist/auth/passwordHashing.sxyt.d.ts +0 -2
  279. package/dist/auth/passwordHashing.sxyt.d.ts.map +0 -1
  280. package/dist/auth/passwordHashing.sxyt.js +0 -46
  281. package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts +0 -2
  282. package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts.map +0 -1
  283. package/dist/auth/ref/checkPasswordResetToken.sxyt.js +0 -40
  284. package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts +0 -2
  285. package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts.map +0 -1
  286. package/dist/auth/ref/createPasswordResetToken.sxyt.js +0 -10
  287. package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts +0 -2
  288. package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts.map +0 -1
  289. package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.js +0 -138
  290. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts +0 -2
  291. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts.map +0 -1
  292. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.js +0 -108
  293. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts +0 -2
  294. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts.map +0 -1
  295. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.js +0 -104
  296. package/dist/bin/commands/compile.sxyt.d.ts +0 -2
  297. package/dist/bin/commands/compile.sxyt.d.ts.map +0 -1
  298. package/dist/bin/commands/compile.sxyt.js +0 -255
  299. package/dist/build/modifySassImports.sxyt.d.ts +0 -2
  300. package/dist/build/modifySassImports.sxyt.d.ts.map +0 -1
  301. package/dist/build/modifySassImports.sxyt.js +0 -55
  302. package/dist/build/sassImportParser.sxyt.d.ts +0 -2
  303. package/dist/build/sassImportParser.sxyt.d.ts.map +0 -1
  304. package/dist/build/sassImportParser.sxyt.js +0 -110
  305. package/dist/build/scssImportParserChatgpt.sxyt.d.ts +0 -2
  306. package/dist/build/scssImportParserChatgpt.sxyt.d.ts.map +0 -1
  307. package/dist/build/scssImportParserChatgpt.sxyt.js +0 -120
  308. package/dist/clone.sxyt.d.ts +0 -2
  309. package/dist/clone.sxyt.d.ts.map +0 -1
  310. package/dist/clone.sxyt.js +0 -24
  311. package/dist/componentProxyHandlers.sxyt.d.ts +0 -2
  312. package/dist/componentProxyHandlers.sxyt.d.ts.map +0 -1
  313. package/dist/componentProxyHandlers.sxyt.js +0 -130
  314. package/dist/components/RawHtml.sxyt.d.ts +0 -2
  315. package/dist/components/RawHtml.sxyt.d.ts.map +0 -1
  316. package/dist/components/RawHtml.sxyt.js +0 -104
  317. package/dist/components/bindable/BindableSelect.sxyt.d.ts +0 -2
  318. package/dist/components/bindable/BindableSelect.sxyt.d.ts.map +0 -1
  319. package/dist/components/bindable/BindableSelect.sxyt.js +0 -186
  320. package/dist/env/injectEnv.sxyt.d.ts +0 -2
  321. package/dist/env/injectEnv.sxyt.d.ts.map +0 -1
  322. package/dist/env/injectEnv.sxyt.js +0 -20
  323. package/dist/env/parseEnv.d.ts +0 -2
  324. package/dist/env/parseEnv.d.ts.map +0 -1
  325. package/dist/env/parseEnv.js +0 -14
  326. package/dist/env/parseEnv.sxyt.d.ts +0 -2
  327. package/dist/env/parseEnv.sxyt.d.ts.map +0 -1
  328. package/dist/env/parseEnv.sxyt.js +0 -11
  329. package/dist/findProjectDir.sxyt.d.ts +0 -2
  330. package/dist/findProjectDir.sxyt.d.ts.map +0 -1
  331. package/dist/findProjectDir.sxyt.js +0 -82
  332. package/dist/hmr/applyHmrModule.sxyt.d.ts +0 -2
  333. package/dist/hmr/applyHmrModule.sxyt.d.ts.map +0 -1
  334. package/dist/hmr/applyHmrModule.sxyt.js +0 -182
  335. package/dist/hmr/instanceRegistry.sxyt.d.ts +0 -2
  336. package/dist/hmr/instanceRegistry.sxyt.d.ts.map +0 -1
  337. package/dist/hmr/instanceRegistry.sxyt.js +0 -24
  338. package/dist/hmr/refreshStylesheets.sxyt.d.ts +0 -2
  339. package/dist/hmr/refreshStylesheets.sxyt.d.ts.map +0 -1
  340. package/dist/hmr/refreshStylesheets.sxyt.js +0 -46
  341. package/dist/hydrate/hydrate.sxyt.d.ts +0 -2
  342. package/dist/hydrate/hydrate.sxyt.d.ts.map +0 -1
  343. package/dist/hydrate/hydrate.sxyt.js +0 -302
  344. package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts +0 -2
  345. package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts.map +0 -1
  346. package/dist/hydrate/reconcileHydratedAttributes.sxyt.js +0 -190
  347. package/dist/importDevModuleWithRetry.sxyt.d.ts +0 -2
  348. package/dist/importDevModuleWithRetry.sxyt.d.ts.map +0 -1
  349. package/dist/importDevModuleWithRetry.sxyt.js +0 -104
  350. package/dist/innerHtmlFromProps.sxyt.d.ts +0 -2
  351. package/dist/innerHtmlFromProps.sxyt.d.ts.map +0 -1
  352. package/dist/innerHtmlFromProps.sxyt.js +0 -99
  353. package/dist/postcssPlugins/parseSelectors.sxyt.d.ts +0 -2
  354. package/dist/postcssPlugins/parseSelectors.sxyt.d.ts.map +0 -1
  355. package/dist/postcssPlugins/parseSelectors.sxyt.js +0 -62
  356. package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts +0 -2
  357. package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts.map +0 -1
  358. package/dist/postcssPlugins/parseSelectorsRich.sxyt.js +0 -155
  359. package/dist/rawHtml/parseHtml.sxyt.d.ts +0 -2
  360. package/dist/rawHtml/parseHtml.sxyt.d.ts.map +0 -1
  361. package/dist/rawHtml/parseHtml.sxyt.js +0 -239
  362. package/dist/render/getFunctionBodyAsString.sxyt.d.ts +0 -2
  363. package/dist/render/getFunctionBodyAsString.sxyt.d.ts.map +0 -1
  364. package/dist/render/getFunctionBodyAsString.sxyt.js +0 -37
  365. package/dist/render/processHead.sxyt.d.ts +0 -2
  366. package/dist/render/processHead.sxyt.d.ts.map +0 -1
  367. package/dist/render/processHead.sxyt.js +0 -93
  368. package/dist/render/processProps.sxyt.d.ts +0 -2
  369. package/dist/render/processProps.sxyt.d.ts.map +0 -1
  370. package/dist/render/processProps.sxyt.js +0 -90
  371. package/dist/routing/compareRequestToRegex.sxyt.d.ts +0 -2
  372. package/dist/routing/compareRequestToRegex.sxyt.d.ts.map +0 -1
  373. package/dist/routing/compareRequestToRegex.sxyt.js +0 -65
  374. package/dist/routing/getPathPriority.sxyt.d.ts +0 -2
  375. package/dist/routing/getPathPriority.sxyt.d.ts.map +0 -1
  376. package/dist/routing/getPathPriority.sxyt.js +0 -24
  377. package/dist/routing/matchPath.sxyt.d.ts +0 -2
  378. package/dist/routing/matchPath.sxyt.d.ts.map +0 -1
  379. package/dist/routing/matchPath.sxyt.js +0 -41
  380. package/dist/routing/patternToRegex.sxyt.d.ts +0 -2
  381. package/dist/routing/patternToRegex.sxyt.d.ts.map +0 -1
  382. package/dist/routing/patternToRegex.sxyt.js +0 -69
  383. package/dist/routing/splitRequest.sxyt.d.ts +0 -2
  384. package/dist/routing/splitRequest.sxyt.d.ts.map +0 -1
  385. package/dist/routing/splitRequest.sxyt.js +0 -47
  386. package/dist/style/jssToCss.sxyt.d.ts +0 -2
  387. package/dist/style/jssToCss.sxyt.d.ts.map +0 -1
  388. package/dist/style/jssToCss.sxyt.js +0 -17
  389. package/dist/testing/createTestApp.sxyt.d.ts +0 -2
  390. package/dist/testing/createTestApp.sxyt.d.ts.map +0 -1
  391. package/dist/testing/createTestApp.sxyt.js +0 -470
  392. package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts +0 -2
  393. package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts.map +0 -1
  394. package/dist/testing/ensureTestEnvLoaded.sxyt.js +0 -20
  395. package/dist/update/hotSwap.sxyt.d.ts +0 -2
  396. package/dist/update/hotSwap.sxyt.d.ts.map +0 -1
  397. package/dist/update/hotSwap.sxyt.js +0 -252
@@ -1,69 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { patternToRegex } from "./patternToRegex.js";
3
- import { regexEquals } from "../_testing/regexEquals.js";
4
- describe('routing/patternToRegex()', ({
5
- it
6
- }) => {
7
- it(`Converts /foo to /^\\/foo\\/?$/ with no keys`, () => {
8
- const {
9
- regex,
10
- keys
11
- } = patternToRegex('/foo');
12
- regexEquals(regex, /^\/foo\/?$/).should.equal(true);
13
- keys.length.should.equal(0);
14
- });
15
- it(`Converts /foo/:bar to /^\\/foo\\/([^/]+)\\/?$/ and saves the key "bar"`, () => {
16
- const {
17
- regex,
18
- keys
19
- } = patternToRegex('/foo/:bar');
20
- regexEquals(regex, /^\/foo\/([^/]+)\/?$/).should.equal(true);
21
- keys.length.should.equal(1);
22
- keys[0].should.equal('bar');
23
- });
24
- it(`Converts /foo/:bar(\\d+) to /^\\/foo\\/(\\d+)\\/?$/, preserving the regex matcher, and saves the key "bar"`, () => {
25
- const {
26
- regex,
27
- keys
28
- } = patternToRegex('/foo/:bar(\\d+)');
29
- regexEquals(regex, /^\/foo\/(\d+)\/?$/).should.equal(true);
30
- keys.length.should.equal(1);
31
- keys[0].should.equal('bar');
32
- });
33
- it(`Converts /foo/:bar/baz to /^\\/foo\\/([^/]+)\\/baz/?$/ and saves the key "bar"`, () => {
34
- const {
35
- regex,
36
- keys
37
- } = patternToRegex('/foo/:bar/baz');
38
- regexEquals(regex, /^\/foo\/([^/]+)\/baz\/?$/).should.equal(true);
39
- keys.length.should.equal(1);
40
- keys[0].should.equal('bar');
41
- });
42
- it(`Converts /foo/:bar<digits> to /^\\/foo\\/(\\d+)\\/?$/ and saves the key "bar"`, () => {
43
- const {
44
- regex,
45
- keys
46
- } = patternToRegex('/foo/:bar<digits>');
47
- regexEquals(regex, /^\/foo\/(\d+)\/?$/).should.equal(true);
48
- keys.length.should.equal(1);
49
- keys[0].should.equal('bar');
50
- });
51
- it(`Converts /foo/:bar<int-ge1> to /^\\/foo\\/([1-9]\\d*)\\/?$/ and saves the key "bar"`, () => {
52
- const {
53
- regex,
54
- keys
55
- } = patternToRegex('/foo/:bar<int-ge1>');
56
- regexEquals(regex, /^\/foo\/([1-9]\d*)\/?$/).should.equal(true);
57
- keys.length.should.equal(1);
58
- keys[0].should.equal('bar');
59
- });
60
- it(`Converts /foo/:bar<1+> to /^\\/foo\\/([1-9]\\d*)\\/?$/ and saves the key "bar"`, () => {
61
- const {
62
- regex,
63
- keys
64
- } = patternToRegex('/foo/:bar<1+>');
65
- regexEquals(regex, /^\/foo\/([1-9]\d*)\/?$/).should.equal(true);
66
- keys.length.should.equal(1);
67
- keys[0].should.equal('bar');
68
- });
69
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=splitRequest.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"splitRequest.sxyt.d.ts","sourceRoot":"","sources":["../../src/routing/splitRequest.sxyt.ts"],"names":[],"mappings":""}
@@ -1,47 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { expect } from 'chai';
3
- import { splitRequest } from "./splitRequest.js";
4
- describe('routing/splitRequest()', ({
5
- it
6
- }) => {
7
- it(`returns the path unchanged when there is no query or hash`, () => {
8
- expect(splitRequest('/foo/bar')).to.deep.equal({
9
- pathname: '/foo/bar',
10
- query: {},
11
- hash: ''
12
- });
13
- });
14
- it(`splits off a query string and parses it`, () => {
15
- expect(splitRequest('/foo?a=1&b=2')).to.deep.equal({
16
- pathname: '/foo',
17
- query: {
18
- a: '1',
19
- b: '2'
20
- },
21
- hash: ''
22
- });
23
- });
24
- it(`splits off a hash fragment`, () => {
25
- expect(splitRequest('/foo#section')).to.deep.equal({
26
- pathname: '/foo',
27
- query: {},
28
- hash: 'section'
29
- });
30
- });
31
- it(`splits off both query and hash`, () => {
32
- expect(splitRequest('/foo?a=1#section')).to.deep.equal({
33
- pathname: '/foo',
34
- query: {
35
- a: '1'
36
- },
37
- hash: 'section'
38
- });
39
- });
40
- it(`does not treat a '?' inside the hash as a query delimiter`, () => {
41
- expect(splitRequest('/foo#a?b')).to.deep.equal({
42
- pathname: '/foo',
43
- query: {},
44
- hash: 'a?b'
45
- });
46
- });
47
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=jssToCss.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"jssToCss.sxyt.d.ts","sourceRoot":"","sources":["../../src/style/jssToCss.sxyt.ts"],"names":[],"mappings":""}
@@ -1,17 +0,0 @@
1
- export {};
2
- /*
3
- describe('jssToCss()', ({it}: DescribeArg) => {
4
- it(`Converts color: red`, () => {
5
- // @ts-ignore
6
- jssToCss({ color: 'red'}).should.equal('color: red;')
7
- })
8
- it(`Converts border-color: red`, () => {
9
- // @ts-ignore
10
- jssToCss({ borderColor: 'red'}).should.equal('border-color: red;')
11
- })
12
- it(`Converts font-size: 14px`, () => {
13
- // @ts-ignore
14
- jssToCss({ fontSize: 14}).should.equal('font-size: 14px;')
15
- })
16
- })
17
- */
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=createTestApp.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createTestApp.sxyt.d.ts","sourceRoot":"","sources":["../../src/testing/createTestApp.sxyt.tsx"],"names":[],"mappings":""}
@@ -1,470 +0,0 @@
1
- function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
2
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
3
- function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
4
- import { expect } from 'chai';
5
- import { Window } from 'happy-dom';
6
- import { describe } from 'sxy-test-runner';
7
- import { TungstenBaseSimpleStoreComponent, TungstenSimpleComponent, TungstenStatefulComponent } from "../Components.js";
8
- import { registerStore } from "../Store/registerStore.js";
9
- import { createTestApp, testStore } from "./index.js";
10
- import { jsxs as _jsxs, jsx as _jsx } from "tungsten/jsxRuntime.js";
11
- class Counter extends TungstenStatefulComponent {
12
- constructor(...args) {
13
- super(...args);
14
- _defineProperty(this, "state", {
15
- count: 0
16
- });
17
- _defineProperty(this, "clientInitialized", false);
18
- _defineProperty(this, "clientInit", () => {
19
- this.clientInitialized = true;
20
- });
21
- _defineProperty(this, "content", () => _jsxs("button", {
22
- onClick: () => {
23
- this.state.count++;
24
- },
25
- children: [this.props.label, ":", this.state.count]
26
- }));
27
- }
28
- }
29
- class TestStoreSchema {
30
- constructor() {
31
- _defineProperty(this, "value", 0);
32
- }
33
- }
34
- const testStoreRegistration = registerStore(TestStoreSchema);
35
- class StoreRoot extends TungstenBaseSimpleStoreComponent {
36
- constructor(...args) {
37
- super(...args);
38
- _defineProperty(this, "store", testStoreRegistration.getComponentStore(this));
39
- _defineProperty(this, "init", () => {
40
- this.store.value.subscribe();
41
- });
42
- _defineProperty(this, "content", () => _jsx("p", {
43
- children: this.store.value.get()
44
- }));
45
- }
46
- }
47
- describe('createTestApp()', ({
48
- it
49
- }) => {
50
- it('mounts, resolves updates, preserves the root for props, and unmounts', async () => {
51
- const window = new Window();
52
- const document = window.document;
53
- const testApp = await createTestApp(Counter, {
54
- document,
55
- props: {
56
- label: 'Count'
57
- }
58
- });
59
- const root = testApp.component;
60
- expect(root.clientInitialized).to.equal(true);
61
- expect(testApp.container.textContent).to.equal('Count:0');
62
- const button = testApp.container.querySelector('button');
63
- expect(button).not.to.equal(null);
64
- button.dispatchEvent(new window.Event('click', {
65
- bubbles: true
66
- }));
67
- await testApp.resolved();
68
- expect(testApp.container.textContent).to.equal('Count:1');
69
- await testApp.setProps({
70
- label: 'Total'
71
- });
72
- expect(testApp.component).to.equal(root);
73
- expect(testApp.container.textContent).to.equal('Total:1');
74
- const container = testApp.container;
75
- await testApp.unmount();
76
- await testApp.unmount();
77
- expect(container.isConnected).to.equal(false);
78
- });
79
- it('tracks asynchronous event work', async () => {
80
- const window = new Window();
81
- const document = window.document;
82
- let release;
83
- const released = new Promise(resolve => {
84
- release = resolve;
85
- });
86
- class AsyncButton extends TungstenStatefulComponent {
87
- constructor(...args) {
88
- super(...args);
89
- _defineProperty(this, "state", {
90
- finished: false
91
- });
92
- _defineProperty(this, "content", () => _jsx("button", {
93
- onClick: async () => {
94
- await released;
95
- this.state.finished = true;
96
- },
97
- children: this.state.finished ? 'finished' : 'waiting'
98
- }));
99
- }
100
- }
101
- const testApp = await createTestApp(AsyncButton, {
102
- document
103
- });
104
- testApp.container.querySelector('button').dispatchEvent(new window.Event('click'));
105
- release();
106
- await testApp.resolved();
107
- expect(testApp.container.textContent).to.equal('finished');
108
- await testApp.unmount();
109
- });
110
- it('settles asynchronous lifecycle-triggered updates', async () => {
111
- const window = new Window();
112
- const document = window.document;
113
- class LifecycleRoot extends TungstenStatefulComponent {
114
- constructor(...args) {
115
- super(...args);
116
- _defineProperty(this, "state", {
117
- phase: 'mounting'
118
- });
119
- _defineProperty(this, "componentDidMount", async () => {
120
- await Promise.resolve();
121
- this.state.phase = 'ready';
122
- });
123
- _defineProperty(this, "componentDidUpdate", async () => {
124
- if (this.state.phase !== 'clicked') return;
125
- await Promise.resolve();
126
- this.state.phase = 'settled';
127
- });
128
- _defineProperty(this, "content", () => _jsx("button", {
129
- onClick: () => {
130
- this.state.phase = 'clicked';
131
- },
132
- children: this.state.phase
133
- }));
134
- }
135
- }
136
- const testApp = await createTestApp(LifecycleRoot, {
137
- document
138
- });
139
- expect(testApp.container.textContent).to.equal('ready');
140
- testApp.container.querySelector('button').dispatchEvent(new window.Event('click'));
141
- await testApp.resolved();
142
- expect(testApp.container.textContent).to.equal('settled');
143
- await testApp.unmount();
144
- });
145
- it('initializes independent real stores before mounting', async () => {
146
- const firstWindow = new Window();
147
- const secondWindow = new Window();
148
- const first = await createTestApp(StoreRoot, {
149
- document: firstWindow.document,
150
- stores: [testStore(testStoreRegistration, store => {
151
- store.value.set(1);
152
- })]
153
- });
154
- const second = await createTestApp(StoreRoot, {
155
- document: secondWindow.document,
156
- stores: [testStore(testStoreRegistration, store => {
157
- store.value.set(2);
158
- })]
159
- });
160
- expect(first.container.textContent).to.equal('1');
161
- expect(second.container.textContent).to.equal('2');
162
- first.component.store.value.set(3);
163
- await first.resolved();
164
- expect(first.container.textContent).to.equal('3');
165
- expect(second.container.textContent).to.equal('2');
166
- await first.unmount();
167
- await second.unmount();
168
- });
169
- it('recursively unmounts components below HTML elements', async () => {
170
- const window = new Window();
171
- const document = window.document;
172
- const lifecycle = [];
173
- class Child extends TungstenSimpleComponent {
174
- constructor(...args) {
175
- super(...args);
176
- _defineProperty(this, "content", () => _jsx("span", {
177
- children: "child"
178
- }));
179
- _defineProperty(this, "componentWillUnmount", () => {
180
- lifecycle.push('will');
181
- });
182
- _defineProperty(this, "componentDidUnmount", () => {
183
- lifecycle.push('did');
184
- });
185
- }
186
- }
187
- class Root extends TungstenSimpleComponent {
188
- constructor(...args) {
189
- super(...args);
190
- _defineProperty(this, "content", () => _jsx("main", {
191
- children: _jsx(Child, {})
192
- }));
193
- }
194
- }
195
- const container = window.document.createElement('section');
196
- window.document.body.appendChild(container);
197
- const testApp = await createTestApp(Root, {
198
- document,
199
- container: container
200
- });
201
- await testApp.unmount();
202
- expect(lifecycle).to.deep.equal(['will', 'did']);
203
- expect(window.document.body.contains(container)).to.equal(true);
204
- expect(container.childNodes.length).to.equal(0);
205
- });
206
- it('rejects a non-empty container without modifying it', async () => {
207
- const window = new Window();
208
- const document = window.document;
209
- const container = window.document.createElement('div');
210
- container.textContent = 'existing';
211
- let error;
212
- try {
213
- await createTestApp(Counter, {
214
- document,
215
- container: container,
216
- props: {
217
- label: 'Count'
218
- }
219
- });
220
- } catch (caught) {
221
- error = caught;
222
- }
223
- expect(error).to.be.instanceOf(Error);
224
- expect(container.textContent).to.equal('existing');
225
- });
226
- it('rolls back partially mounted descendants after an error', async () => {
227
- const window = new Window();
228
- const document = window.document;
229
- const lifecycle = [];
230
- class MountedChild extends TungstenSimpleComponent {
231
- constructor(...args) {
232
- super(...args);
233
- _defineProperty(this, "content", () => _jsx("span", {
234
- children: "mounted"
235
- }));
236
- _defineProperty(this, "componentDidMount", () => {
237
- lifecycle.push('mount');
238
- });
239
- _defineProperty(this, "componentWillUnmount", () => {
240
- lifecycle.push('will');
241
- });
242
- _defineProperty(this, "componentDidUnmount", () => {
243
- lifecycle.push('did');
244
- });
245
- }
246
- }
247
- class BrokenChild extends TungstenSimpleComponent {
248
- constructor(...args) {
249
- super(...args);
250
- _defineProperty(this, "content", () => {
251
- throw new Error('broken child');
252
- });
253
- }
254
- }
255
- class BrokenRoot extends TungstenSimpleComponent {
256
- constructor(...args) {
257
- super(...args);
258
- _defineProperty(this, "content", () => _jsxs("main", {
259
- children: [_jsx(MountedChild, {}), _jsx(BrokenChild, {})]
260
- }));
261
- }
262
- }
263
- const originalBodyChildren = window.document.body.childNodes.length;
264
- let error;
265
- try {
266
- await createTestApp(BrokenRoot, {
267
- document
268
- });
269
- } catch (caught) {
270
- error = caught;
271
- }
272
- expect(error).to.be.instanceOf(Error);
273
- expect(lifecycle).to.deep.equal(['mount', 'will', 'did']);
274
- expect(window.document.body.childNodes.length).to.equal(originalBodyChildren);
275
- });
276
- it('supports input, checkbox, and select bindings', async () => {
277
- const window = new Window();
278
- const document = window.document;
279
- class FormRoot extends TungstenStatefulComponent {
280
- constructor(...args) {
281
- super(...args);
282
- _defineProperty(this, "state", {
283
- name: 'Robert',
284
- checked: false,
285
- choice: 'b'
286
- });
287
- _defineProperty(this, "content", () => _jsxs("form", {
288
- children: [_jsx("input", {
289
- name: "name",
290
- bind: [this.state, 'name']
291
- }), _jsx("input", {
292
- name: "enabled",
293
- type: "checkbox",
294
- bindChecked: [this.state, 'checked']
295
- }), _jsxs("select", {
296
- name: "choice",
297
- bind: [this.state, 'choice'],
298
- children: [_jsx("option", {
299
- value: "a",
300
- children: "A"
301
- }), _jsx("option", {
302
- value: "b",
303
- children: "B"
304
- }), _jsx("option", {
305
- value: "c",
306
- children: "C"
307
- })]
308
- }), _jsxs("output", {
309
- children: [this.state.name, ":", String(this.state.checked), ":", this.state.choice]
310
- })]
311
- }));
312
- }
313
- }
314
- const testApp = await createTestApp(FormRoot, {
315
- document
316
- });
317
- const name = testApp.container.querySelector('input[name="name"]');
318
- const enabled = testApp.container.querySelector('input[name="enabled"]');
319
- const choice = testApp.container.querySelector('select');
320
- name.value = 'Alice';
321
- name.dispatchEvent(new window.Event('input', {
322
- bubbles: true
323
- }));
324
- enabled.checked = true;
325
- enabled.dispatchEvent(new window.Event('change', {
326
- bubbles: true
327
- }));
328
- choice.value = 'c';
329
- choice.dispatchEvent(new window.Event('input', {
330
- bubbles: true
331
- }));
332
- await testApp.resolved();
333
- expect(testApp.component.state.name).to.equal('Alice');
334
- expect(testApp.component.state.checked).to.equal(true);
335
- expect(testApp.component.state.choice).to.equal('c');
336
- expect(testApp.container.querySelector('output').textContent).to.equal('Alice:true:c');
337
- await testApp.unmount();
338
- });
339
- it('preserves keyed nodes and controlled select values during reconciliation', async () => {
340
- const window = new Window();
341
- const document = window.document;
342
- class ReconciliationRoot extends TungstenStatefulComponent {
343
- constructor(...args) {
344
- super(...args);
345
- _defineProperty(this, "state", {
346
- items: ['a', 'b', 'c'],
347
- selected: 'b',
348
- updates: 0
349
- });
350
- _defineProperty(this, "content", () => _jsxs("main", {
351
- children: [_jsx("ul", {
352
- children: this.state.items.map(item => _jsx("li", {
353
- "data-key": item,
354
- children: item
355
- }, item))
356
- }), _jsxs("select", {
357
- value: this.state.selected,
358
- children: [_jsx("option", {
359
- value: "a",
360
- children: "A"
361
- }), _jsx("option", {
362
- value: "b",
363
- children: "B"
364
- }), _jsx("option", {
365
- value: "c",
366
- children: "C"
367
- })]
368
- }), _jsx("button", {
369
- onClick: () => {
370
- this.state.updates++;
371
- },
372
- children: "update"
373
- }), _jsx("output", {
374
- children: this.state.updates
375
- })]
376
- }));
377
- }
378
- }
379
- const testApp = await createTestApp(ReconciliationRoot, {
380
- document
381
- });
382
- const nodeA = testApp.container.querySelector('[data-key="a"]');
383
- const nodeB = testApp.container.querySelector('[data-key="b"]');
384
- const select = testApp.container.querySelector('select');
385
- testApp.component.state.items = ['c', 'a', 'b'];
386
- await testApp.resolved();
387
- expect(testApp.container.querySelector('[data-key="a"]')).to.equal(nodeA);
388
- expect(testApp.container.querySelector('[data-key="b"]')).to.equal(nodeB);
389
- expect(select.value).to.equal('b');
390
- testApp.container.querySelector('button').dispatchEvent(new window.Event('click'));
391
- await testApp.resolved();
392
- expect(select.value).to.equal('b');
393
- await testApp.unmount();
394
- });
395
- it('runs componentDidUpdate exactly once for a props-driven update', async () => {
396
- const window = new Window();
397
- const document = window.document;
398
- const updates = [];
399
- class Child extends TungstenStatefulComponent {
400
- constructor(...args) {
401
- super(...args);
402
- _defineProperty(this, "state", {
403
- local: 0
404
- });
405
- _defineProperty(this, "componentDidUpdate", () => {
406
- updates.push('child');
407
- });
408
- _defineProperty(this, "content", () => _jsxs("span", {
409
- children: [this.props.value, ":", this.state.local]
410
- }));
411
- }
412
- }
413
- class Parent extends TungstenStatefulComponent {
414
- constructor(...args) {
415
- super(...args);
416
- _defineProperty(this, "state", {
417
- value: 0
418
- });
419
- _defineProperty(this, "content", () => _jsxs("main", {
420
- children: [_jsx("button", {
421
- onClick: () => {
422
- this.state.value++;
423
- },
424
- children: "bump"
425
- }), _jsx(Child, {
426
- value: this.state.value
427
- })]
428
- }));
429
- }
430
- }
431
- const testApp = await createTestApp(Parent, {
432
- document
433
- });
434
- updates.length = 0;
435
- testApp.container.querySelector('button').dispatchEvent(new window.Event('click'));
436
- await testApp.resolved();
437
- expect(testApp.container.querySelector('span').textContent).to.equal('1:0');
438
- expect(updates).to.deep.equal(['child']);
439
- await testApp.unmount();
440
- });
441
- it('rejects resolved() when an asynchronous event handler fails', async () => {
442
- const window = new Window();
443
- const document = window.document;
444
- class BrokenEventRoot extends TungstenSimpleComponent {
445
- constructor(...args) {
446
- super(...args);
447
- _defineProperty(this, "content", () => _jsx("button", {
448
- onClick: async () => {
449
- await Promise.resolve();
450
- throw new Error('event failed');
451
- },
452
- children: "break"
453
- }));
454
- }
455
- }
456
- const testApp = await createTestApp(BrokenEventRoot, {
457
- document
458
- });
459
- testApp.container.querySelector('button').dispatchEvent(new window.Event('click'));
460
- let error;
461
- try {
462
- await testApp.resolved();
463
- } catch (caught) {
464
- error = caught;
465
- }
466
- expect(error).to.be.instanceOf(Error);
467
- expect(error.message).to.contain('BrokenEventRoot click event handler');
468
- await testApp.unmount();
469
- });
470
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ensureTestEnvLoaded.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureTestEnvLoaded.sxyt.d.ts","sourceRoot":"","sources":["../../src/testing/ensureTestEnvLoaded.sxyt.ts"],"names":[],"mappings":""}
@@ -1,20 +0,0 @@
1
- import { expect } from 'chai';
2
- import { describe } from 'sxy-test-runner';
3
- import { testEnvIsRequested, testEnvVariableName } from "./ensureTestEnvLoaded.js";
4
- describe('testEnvIsRequested()', ({
5
- it
6
- }) => {
7
- it(`treats an unset ${testEnvVariableName} as no env loading`, () => {
8
- expect(testEnvIsRequested(undefined)).to.equal(false);
9
- });
10
- it('treats blank, 0 and false as no env loading', () => {
11
- for (const value of ['', ' ', '0', 'false', 'FALSE', ' False ']) {
12
- expect(testEnvIsRequested(value), value).to.equal(false);
13
- }
14
- });
15
- it('treats any other value as a request to load env', () => {
16
- for (const value of ['1', 'true', 'yes', 'test']) {
17
- expect(testEnvIsRequested(value), value).to.equal(true);
18
- }
19
- });
20
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=hotSwap.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hotSwap.sxyt.d.ts","sourceRoot":"","sources":["../../src/update/hotSwap.sxyt.tsx"],"names":[],"mappings":""}