tungsten 0.3.2 → 0.3.3

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 (278) hide show
  1. package/dist/.build-complete +1 -0
  2. package/dist/Framework.d.ts +2 -0
  3. package/dist/Framework.d.ts.map +1 -1
  4. package/dist/Framework.js +68 -57
  5. package/dist/FrameworkConfig.d.ts +2 -0
  6. package/dist/FrameworkConfig.d.ts.map +1 -1
  7. package/dist/Instance/Instance.d.ts.map +1 -1
  8. package/dist/Instance/Instance.js +18 -1
  9. package/dist/Instance/InstanceConfig.d.ts +1 -0
  10. package/dist/Instance/InstanceConfig.d.ts.map +1 -1
  11. package/dist/PopMessage.type.d.ts +6 -0
  12. package/dist/PopMessage.type.d.ts.map +1 -0
  13. package/dist/PopMessage.type.js +1 -0
  14. package/dist/Servers/DevServer.d.ts +2 -0
  15. package/dist/Servers/DevServer.d.ts.map +1 -1
  16. package/dist/Servers/DevServer.js +84 -8
  17. package/dist/Servers/MatchedRouteInfo.d.ts +1 -1
  18. package/dist/Servers/MatchedRouteInfo.d.ts.map +1 -1
  19. package/dist/Servers/ProdServer.d.ts +1 -0
  20. package/dist/Servers/ProdServer.d.ts.map +1 -1
  21. package/dist/Servers/ProdServer.js +79 -5
  22. package/dist/Servers/hono/DevServerHono.js +25 -29
  23. package/dist/Servers/hono/ProdServerHono.js +49 -142
  24. package/dist/Servers/hono/TungstenServerHono.d.ts +1 -1
  25. package/dist/Servers/hono/TungstenServerHono.d.ts.map +1 -1
  26. package/dist/Servers/hono/TungstenServerHono.js +12 -29
  27. package/dist/Servers/routing.d.ts.map +1 -1
  28. package/dist/Servers/routing.js +10 -6
  29. package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts +0 -3
  30. package/dist/Servers/tungstenCorePrivateEnvSchema.d.ts.map +1 -1
  31. package/dist/Servers/tungstenCorePrivateEnvSchema.js +3 -3
  32. package/dist/Servers/tungstenCorePublicEnvSchema.d.ts +8 -0
  33. package/dist/Servers/tungstenCorePublicEnvSchema.d.ts.map +1 -0
  34. package/dist/Servers/tungstenCorePublicEnvSchema.js +14 -0
  35. package/dist/Store/InternalStoreSchema.d.ts +2 -0
  36. package/dist/Store/InternalStoreSchema.d.ts.map +1 -1
  37. package/dist/Store/InternalStoreSchema.js +1 -0
  38. package/dist/api/Request.d.ts +1 -1
  39. package/dist/api/Request.d.ts.map +1 -1
  40. package/dist/api/Response.d.ts +1 -1
  41. package/dist/api/Response.d.ts.map +1 -1
  42. package/dist/babelPlugins/BabelTypes.d.ts +2 -2
  43. package/dist/babelPlugins/BabelTypes.d.ts.map +1 -1
  44. package/dist/babelPlugins/BabelTypes.js +0 -1
  45. package/dist/bin/commands/build.d.ts.map +1 -1
  46. package/dist/bin/commands/build.js +3 -0
  47. package/dist/bin/commands/dev.d.ts.map +1 -1
  48. package/dist/bin/commands/dev.js +15 -4
  49. package/dist/bin/commands/devmon.d.ts +2 -0
  50. package/dist/bin/commands/devmon.d.ts.map +1 -0
  51. package/dist/bin/commands/devmon.js +66 -0
  52. package/dist/bin/index.d.ts.map +1 -1
  53. package/dist/bin/index.js +6 -0
  54. package/dist/booleanAttributeValue.d.ts +21 -0
  55. package/dist/booleanAttributeValue.d.ts.map +1 -0
  56. package/dist/booleanAttributeValue.js +23 -0
  57. package/dist/build/compileJavascript.js +1 -1
  58. package/dist/build/compileUserApp.d.ts +2 -1
  59. package/dist/build/compileUserApp.d.ts.map +1 -1
  60. package/dist/build/compileUserApp.js +8 -7
  61. package/dist/build/createInstanceConfigFile.js +1 -1
  62. package/dist/compat/types.d.ts +1 -1
  63. package/dist/compat/types.d.ts.map +1 -1
  64. package/dist/components/PopMessages.d.ts +12 -0
  65. package/dist/components/PopMessages.d.ts.map +1 -0
  66. package/dist/components/PopMessages.js +45 -0
  67. package/dist/defaultConfig.d.ts +1 -0
  68. package/dist/defaultConfig.d.ts.map +1 -1
  69. package/dist/defaultConfig.js +2 -1
  70. package/dist/env/Interfaces.d.ts +2 -1
  71. package/dist/env/Interfaces.d.ts.map +1 -1
  72. package/dist/env/getEnvSchemas.d.ts +1 -1
  73. package/dist/env/getEnvSchemas.d.ts.map +1 -1
  74. package/dist/env/publicEnv.d.ts.map +1 -1
  75. package/dist/env/publicEnv.js +4 -1
  76. package/dist/frameworkConfigSchema.d.ts +4 -0
  77. package/dist/frameworkConfigSchema.d.ts.map +1 -1
  78. package/dist/frameworkConfigSchema.js +2 -1
  79. package/dist/hooks/index.d.ts +1 -0
  80. package/dist/hooks/index.d.ts.map +1 -1
  81. package/dist/hooks/index.js +1 -0
  82. package/dist/hooks/useInstance.d.ts +3 -0
  83. package/dist/hooks/useInstance.d.ts.map +1 -0
  84. package/dist/hooks/useInstance.js +4 -0
  85. package/dist/hydrate/hydrate.d.ts +6 -4
  86. package/dist/hydrate/hydrate.d.ts.map +1 -1
  87. package/dist/hydrate/hydrate.js +51 -13
  88. package/dist/hydrate/reconcileHydratedAttributes.d.ts.map +1 -1
  89. package/dist/hydrate/reconcileHydratedAttributes.js +4 -3
  90. package/dist/hydrate/renderHydrationMismatchBanner.d.ts +7 -0
  91. package/dist/hydrate/renderHydrationMismatchBanner.d.ts.map +1 -0
  92. package/dist/hydrate/renderHydrationMismatchBanner.js +69 -0
  93. package/dist/indexInner.d.ts +8 -0
  94. package/dist/indexInner.d.ts.map +1 -1
  95. package/dist/indexInner.js +7 -1
  96. package/dist/makeInstanceConfigFromFrameworkConfig.d.ts.map +1 -1
  97. package/dist/makeInstanceConfigFromFrameworkConfig.js +2 -1
  98. package/dist/pop.d.ts +10 -0
  99. package/dist/pop.d.ts.map +1 -0
  100. package/dist/pop.js +49 -0
  101. package/dist/rawHtml/filterContentNode.d.ts +20 -0
  102. package/dist/rawHtml/filterContentNode.d.ts.map +1 -0
  103. package/dist/rawHtml/filterContentNode.js +96 -0
  104. package/dist/rawHtml/parseHtml.d.ts +14 -0
  105. package/dist/rawHtml/parseHtml.d.ts.map +1 -1
  106. package/dist/rawHtml/parseHtml.js +4 -4
  107. package/dist/rawHtml/sanitizeHtml.d.ts +17 -0
  108. package/dist/rawHtml/sanitizeHtml.d.ts.map +1 -0
  109. package/dist/rawHtml/sanitizeHtml.js +19 -0
  110. package/dist/render/HeadData.d.ts +1 -0
  111. package/dist/render/HeadData.d.ts.map +1 -1
  112. package/dist/render/contentNodeToHtml.d.ts +18 -0
  113. package/dist/render/contentNodeToHtml.d.ts.map +1 -0
  114. package/dist/render/contentNodeToHtml.js +66 -0
  115. package/dist/render/contentToHtml.d.ts.map +1 -1
  116. package/dist/render/contentToHtml.js +2 -1
  117. package/dist/render/processHead.d.ts.map +1 -1
  118. package/dist/render/processHead.js +8 -2
  119. package/dist/render/renderingTreeToHtml.d.ts.map +1 -1
  120. package/dist/render/renderingTreeToHtml.js +8 -1
  121. package/dist/routing/ErrorRouteType.d.ts +6 -0
  122. package/dist/routing/ErrorRouteType.d.ts.map +1 -0
  123. package/dist/routing/ErrorRouteType.js +1 -0
  124. package/dist/routing/RouteTypes.d.ts +2 -1
  125. package/dist/routing/RouteTypes.d.ts.map +1 -1
  126. package/dist/routing/Routes.d.ts +5 -0
  127. package/dist/routing/Routes.d.ts.map +1 -1
  128. package/dist/routing/TungstenErrorInfo.d.ts +6 -0
  129. package/dist/routing/TungstenErrorInfo.d.ts.map +1 -0
  130. package/dist/routing/TungstenErrorInfo.js +6 -0
  131. package/dist/style/styleContentSxy.js +21 -0
  132. package/dist/testing/hydrateTestApp.d.ts +38 -0
  133. package/dist/testing/hydrateTestApp.d.ts.map +1 -0
  134. package/dist/testing/hydrateTestApp.js +242 -0
  135. package/dist/testing/index.d.ts +4 -3
  136. package/dist/testing/index.d.ts.map +1 -1
  137. package/dist/testing/index.js +16 -2
  138. package/dist/timeProfiler.d.ts +6 -0
  139. package/dist/timeProfiler.d.ts.map +1 -0
  140. package/dist/timeProfiler.js +31 -0
  141. package/dist/update/integrateUpdateVdom.d.ts +11 -0
  142. package/dist/update/integrateUpdateVdom.d.ts.map +1 -1
  143. package/dist/update/integrateUpdateVdom.js +9 -3
  144. package/dist/warnOnFrameworkChange.d.ts.map +1 -1
  145. package/dist/warnOnFrameworkChange.js +8 -8
  146. package/package.json +18 -16
  147. package/dist/FunctionComponentStandIn.sxyt.d.ts +0 -2
  148. package/dist/FunctionComponentStandIn.sxyt.d.ts.map +0 -1
  149. package/dist/FunctionComponentStandIn.sxyt.js +0 -52
  150. package/dist/Instance/gotoRedirect.sxyt.d.ts +0 -2
  151. package/dist/Instance/gotoRedirect.sxyt.d.ts.map +0 -1
  152. package/dist/Instance/gotoRedirect.sxyt.js +0 -148
  153. package/dist/Instance/runTrackedWork.sxyt.d.ts +0 -2
  154. package/dist/Instance/runTrackedWork.sxyt.d.ts.map +0 -1
  155. package/dist/Instance/runTrackedWork.sxyt.js +0 -35
  156. package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts +0 -2
  157. package/dist/Servers/devErrorPageAutoRetry.sxyt.d.ts.map +0 -1
  158. package/dist/Servers/devErrorPageAutoRetry.sxyt.js +0 -117
  159. package/dist/_client/cjsHelpers.sxyt.d.ts +0 -2
  160. package/dist/_client/cjsHelpers.sxyt.d.ts.map +0 -1
  161. package/dist/_client/cjsHelpers.sxyt.js +0 -45
  162. package/dist/auth/passwordHashing.sxyt.d.ts +0 -2
  163. package/dist/auth/passwordHashing.sxyt.d.ts.map +0 -1
  164. package/dist/auth/passwordHashing.sxyt.js +0 -46
  165. package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts +0 -2
  166. package/dist/auth/ref/checkPasswordResetToken.sxyt.d.ts.map +0 -1
  167. package/dist/auth/ref/checkPasswordResetToken.sxyt.js +0 -40
  168. package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts +0 -2
  169. package/dist/auth/ref/createPasswordResetToken.sxyt.d.ts.map +0 -1
  170. package/dist/auth/ref/createPasswordResetToken.sxyt.js +0 -10
  171. package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts +0 -2
  172. package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.d.ts.map +0 -1
  173. package/dist/babelPlugins/BabelAddDevCacheBust.sxyt.js +0 -138
  174. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts +0 -2
  175. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.d.ts.map +0 -1
  176. package/dist/babelPlugins/fixImportsInSassErrorMessage.sxyt.js +0 -108
  177. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts +0 -2
  178. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.d.ts.map +0 -1
  179. package/dist/babelPlugins/transformPackageImports/resolveBareImport.sxyt.js +0 -104
  180. package/dist/bin/commands/compile.sxyt.d.ts +0 -2
  181. package/dist/bin/commands/compile.sxyt.d.ts.map +0 -1
  182. package/dist/bin/commands/compile.sxyt.js +0 -255
  183. package/dist/build/modifySassImports.sxyt.d.ts +0 -2
  184. package/dist/build/modifySassImports.sxyt.d.ts.map +0 -1
  185. package/dist/build/modifySassImports.sxyt.js +0 -55
  186. package/dist/build/sassImportParser.sxyt.d.ts +0 -2
  187. package/dist/build/sassImportParser.sxyt.d.ts.map +0 -1
  188. package/dist/build/sassImportParser.sxyt.js +0 -110
  189. package/dist/build/scssImportParserChatgpt.sxyt.d.ts +0 -2
  190. package/dist/build/scssImportParserChatgpt.sxyt.d.ts.map +0 -1
  191. package/dist/build/scssImportParserChatgpt.sxyt.js +0 -120
  192. package/dist/clone.sxyt.d.ts +0 -2
  193. package/dist/clone.sxyt.d.ts.map +0 -1
  194. package/dist/clone.sxyt.js +0 -24
  195. package/dist/componentProxyHandlers.sxyt.d.ts +0 -2
  196. package/dist/componentProxyHandlers.sxyt.d.ts.map +0 -1
  197. package/dist/componentProxyHandlers.sxyt.js +0 -130
  198. package/dist/components/RawHtml.sxyt.d.ts +0 -2
  199. package/dist/components/RawHtml.sxyt.d.ts.map +0 -1
  200. package/dist/components/RawHtml.sxyt.js +0 -104
  201. package/dist/components/bindable/BindableSelect.sxyt.d.ts +0 -2
  202. package/dist/components/bindable/BindableSelect.sxyt.d.ts.map +0 -1
  203. package/dist/components/bindable/BindableSelect.sxyt.js +0 -186
  204. package/dist/env/injectEnv.sxyt.d.ts +0 -2
  205. package/dist/env/injectEnv.sxyt.d.ts.map +0 -1
  206. package/dist/env/injectEnv.sxyt.js +0 -20
  207. package/dist/env/parseEnv.sxyt.d.ts +0 -2
  208. package/dist/env/parseEnv.sxyt.d.ts.map +0 -1
  209. package/dist/env/parseEnv.sxyt.js +0 -11
  210. package/dist/findProjectDir.sxyt.d.ts +0 -2
  211. package/dist/findProjectDir.sxyt.d.ts.map +0 -1
  212. package/dist/findProjectDir.sxyt.js +0 -82
  213. package/dist/hmr/applyHmrModule.sxyt.d.ts +0 -2
  214. package/dist/hmr/applyHmrModule.sxyt.d.ts.map +0 -1
  215. package/dist/hmr/applyHmrModule.sxyt.js +0 -182
  216. package/dist/hmr/instanceRegistry.sxyt.d.ts +0 -2
  217. package/dist/hmr/instanceRegistry.sxyt.d.ts.map +0 -1
  218. package/dist/hmr/instanceRegistry.sxyt.js +0 -24
  219. package/dist/hmr/refreshStylesheets.sxyt.d.ts +0 -2
  220. package/dist/hmr/refreshStylesheets.sxyt.d.ts.map +0 -1
  221. package/dist/hmr/refreshStylesheets.sxyt.js +0 -46
  222. package/dist/hydrate/hydrate.sxyt.d.ts +0 -2
  223. package/dist/hydrate/hydrate.sxyt.d.ts.map +0 -1
  224. package/dist/hydrate/hydrate.sxyt.js +0 -302
  225. package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts +0 -2
  226. package/dist/hydrate/reconcileHydratedAttributes.sxyt.d.ts.map +0 -1
  227. package/dist/hydrate/reconcileHydratedAttributes.sxyt.js +0 -190
  228. package/dist/importDevModuleWithRetry.sxyt.d.ts +0 -2
  229. package/dist/importDevModuleWithRetry.sxyt.d.ts.map +0 -1
  230. package/dist/importDevModuleWithRetry.sxyt.js +0 -104
  231. package/dist/innerHtmlFromProps.sxyt.d.ts +0 -2
  232. package/dist/innerHtmlFromProps.sxyt.d.ts.map +0 -1
  233. package/dist/innerHtmlFromProps.sxyt.js +0 -99
  234. package/dist/postcssPlugins/parseSelectors.sxyt.d.ts +0 -2
  235. package/dist/postcssPlugins/parseSelectors.sxyt.d.ts.map +0 -1
  236. package/dist/postcssPlugins/parseSelectors.sxyt.js +0 -62
  237. package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts +0 -2
  238. package/dist/postcssPlugins/parseSelectorsRich.sxyt.d.ts.map +0 -1
  239. package/dist/postcssPlugins/parseSelectorsRich.sxyt.js +0 -155
  240. package/dist/rawHtml/parseHtml.sxyt.d.ts +0 -2
  241. package/dist/rawHtml/parseHtml.sxyt.d.ts.map +0 -1
  242. package/dist/rawHtml/parseHtml.sxyt.js +0 -239
  243. package/dist/render/getFunctionBodyAsString.sxyt.d.ts +0 -2
  244. package/dist/render/getFunctionBodyAsString.sxyt.d.ts.map +0 -1
  245. package/dist/render/getFunctionBodyAsString.sxyt.js +0 -37
  246. package/dist/render/processHead.sxyt.d.ts +0 -2
  247. package/dist/render/processHead.sxyt.d.ts.map +0 -1
  248. package/dist/render/processHead.sxyt.js +0 -93
  249. package/dist/render/processProps.sxyt.d.ts +0 -2
  250. package/dist/render/processProps.sxyt.d.ts.map +0 -1
  251. package/dist/render/processProps.sxyt.js +0 -90
  252. package/dist/routing/compareRequestToRegex.sxyt.d.ts +0 -2
  253. package/dist/routing/compareRequestToRegex.sxyt.d.ts.map +0 -1
  254. package/dist/routing/compareRequestToRegex.sxyt.js +0 -65
  255. package/dist/routing/getPathPriority.sxyt.d.ts +0 -2
  256. package/dist/routing/getPathPriority.sxyt.d.ts.map +0 -1
  257. package/dist/routing/getPathPriority.sxyt.js +0 -24
  258. package/dist/routing/matchPath.sxyt.d.ts +0 -2
  259. package/dist/routing/matchPath.sxyt.d.ts.map +0 -1
  260. package/dist/routing/matchPath.sxyt.js +0 -41
  261. package/dist/routing/patternToRegex.sxyt.d.ts +0 -2
  262. package/dist/routing/patternToRegex.sxyt.d.ts.map +0 -1
  263. package/dist/routing/patternToRegex.sxyt.js +0 -69
  264. package/dist/routing/splitRequest.sxyt.d.ts +0 -2
  265. package/dist/routing/splitRequest.sxyt.d.ts.map +0 -1
  266. package/dist/routing/splitRequest.sxyt.js +0 -47
  267. package/dist/style/jssToCss.sxyt.d.ts +0 -2
  268. package/dist/style/jssToCss.sxyt.d.ts.map +0 -1
  269. package/dist/style/jssToCss.sxyt.js +0 -17
  270. package/dist/testing/createTestApp.sxyt.d.ts +0 -2
  271. package/dist/testing/createTestApp.sxyt.d.ts.map +0 -1
  272. package/dist/testing/createTestApp.sxyt.js +0 -470
  273. package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts +0 -2
  274. package/dist/testing/ensureTestEnvLoaded.sxyt.d.ts.map +0 -1
  275. package/dist/testing/ensureTestEnvLoaded.sxyt.js +0 -20
  276. package/dist/update/hotSwap.sxyt.d.ts +0 -2
  277. package/dist/update/hotSwap.sxyt.d.ts.map +0 -1
  278. package/dist/update/hotSwap.sxyt.js +0 -252
@@ -1,55 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { modifySassImports } from "./modifySassImports.js";
3
- import { sassImportParser } from "./sassImportParser.js";
4
- describe('modifySassImports()', ({
5
- it
6
- }) => {
7
- const input = `@import 'foo'`;
8
- it(`modifies sass import 'foo' into 'C:/project/styles/foo' in content '${input}'`, () => {
9
- //const imports = sassImportParser(input)
10
- const imports = sassImportParser(input);
11
- imports[0].to = '/project/styles/foo'; // eslint-disable-line no-type-assertion/no-type-assertion
12
- console.log('imports', imports);
13
- // const imports = [
14
- // {
15
- // target: 'foo',
16
- // start: 9,
17
- // to: 'C:/project/styles/foo'
18
- // },
19
- // ]
20
- const result = modifySassImports(input, imports); // eslint-disable-line no-type-assertion/no-type-assertion
21
- console.log('result', result);
22
- result.should.equal(`@import '${imports[0].to}'`); // eslint-disable-line no-type-assertion/no-type-assertion
23
- });
24
- const input2 = `
25
- @use 'foo' as bar
26
- @import 'baz'
27
-
28
- p
29
- color: red
30
- `;
31
- it(`modifies 2 sass imports in content '${input2}'`, () => {
32
- const imports = sassImportParser(input2);
33
- imports[0].to = '/project/styles/foo' // eslint-disable-line no-type-assertion/no-type-assertion
34
- ;
35
- imports[1].to = '/project/styles/baz'; // eslint-disable-line no-type-assertion/no-type-assertion
36
- console.log('imports', imports);
37
- // const imports = [
38
- // {
39
- // target: 'foo',
40
- // start: 9,
41
- // to: 'C:/project/styles/bar'
42
- // },
43
- // {
44
- // target: 'baz',
45
- // start: 19,
46
- // to: 'C:/project/styles/foo'
47
- // },
48
- // ]
49
- const result = modifySassImports(input2, imports); // eslint-disable-line no-type-assertion/no-type-assertion
50
- console.log('result', result);
51
- result.should.equal(input2.replace('foo', imports[0].to) // eslint-disable-line no-type-assertion/no-type-assertion
52
- .replace('baz', imports[1].to) // eslint-disable-line no-type-assertion/no-type-assertion
53
- );
54
- });
55
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=sassImportParser.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sassImportParser.sxyt.d.ts","sourceRoot":"","sources":["../../src/build/sassImportParser.sxyt.ts"],"names":[],"mappings":""}
@@ -1,110 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { sassImportParser } from "./sassImportParser.js";
3
- describe('sassImportParser()', ({
4
- it
5
- }) => {
6
- const input = `@import 'foo'`;
7
- it(`parses out an import '${input}'`, () => {
8
- const imports = sassImportParser(input);
9
- const targets = Array.from(imports).map(x => x.target);
10
- targets.should.deep.equal(['foo']);
11
- });
12
- const input2 = `@import 'foo'
13
- @import 'bar'`;
14
- it(`parses out 2 imports from '${input2}'`, () => {
15
- const imports = sassImportParser(input2);
16
- const targets = Array.from(imports).map(x => x.target);
17
- targets.should.deep.equal(['foo', 'bar']);
18
- });
19
- const input3 = `
20
- @import 'foo'
21
-
22
- @import 'bar'
23
-
24
- `;
25
- it(`parses out 2 imports with spaces from '${input3}'`, () => {
26
- const imports = sassImportParser(input3);
27
- const targets = Array.from(imports).map(x => x.target);
28
- targets.should.deep.equal(['foo', 'bar']);
29
- });
30
- const input4 = `
31
- @import 'foo'
32
- @import 'bar'
33
- p::after
34
- content: "@import 'baz'"
35
- `;
36
- it(`ignores extra imports within style values '${input4}'`, () => {
37
- const imports = sassImportParser(input4);
38
- const targets = Array.from(imports).map(x => x.target);
39
- targets.should.deep.equal(['foo', 'bar']);
40
- });
41
- const input5 = `
42
- @import 'foo'
43
- @import 'bar'
44
- // @import 'ignoreme'
45
- /* @use 'ignoremetoo' */
46
- /*
47
- @use 'ignoremealso'
48
- */
49
- @use 'baz'
50
- `;
51
- it(`ignores imports within comments in '${input5}'`, () => {
52
- const imports = sassImportParser(input5);
53
- const targets = Array.from(imports).map(x => x.target);
54
- targets.should.deep.equal(['foo', 'bar', 'baz']);
55
- });
56
- const input6 = `
57
- @import /* comment */ 'foo'
58
- @import /* comment */'bar'
59
- `;
60
- it(`tolerates comments within @import and @use statements in '${input6}'`, () => {
61
- const imports = sassImportParser(input6);
62
- const targets = Array.from(imports).map(x => x.target);
63
- targets.should.deep.equal(['foo', 'bar']);
64
- });
65
- const input7 = `
66
- @import'foo'
67
- @import/* comment */'bar'
68
- `;
69
- it(`does not require a space between @import / @use and the target using '${input7}'`, () => {
70
- const imports = sassImportParser(input7);
71
- const targets = Array.from(imports).map(x => x.target);
72
- targets.should.deep.equal(['foo', 'bar']);
73
- });
74
- const input8 = `@import 'foo'`;
75
- it(`returns a correct index for the start position when extracting from '${input8}'`, () => {
76
- const imports = sassImportParser(input8);
77
- Array.from(imports).should.deep.equal([{
78
- target: 'foo',
79
- start: 9
80
- }]);
81
- });
82
- const input9 = `
83
-
84
- @import 'bar'`;
85
- it(`returns a correct index for the start position when extracting from '${input9}'`, () => {
86
- const imports = sassImportParser(input9);
87
- Array.from(imports).should.deep.equal([{
88
- target: 'bar',
89
- start: 15
90
- }]);
91
- });
92
- const input10 = `@use 'foo' as bar`;
93
- it(`handles aliasing in @use statements in '${input10}'`, () => {
94
- const imports = sassImportParser(input10);
95
- const targets = Array.from(imports).map(x => x.target);
96
- targets.should.deep.equal(['foo']);
97
- });
98
- const input11 = `@use './foo' as bar`;
99
- it(`extract relative targets from '${input11}'`, () => {
100
- const imports = sassImportParser(input11);
101
- const targets = Array.from(imports).map(x => x.target);
102
- targets.should.deep.equal(['./foo']);
103
- });
104
- const input12 = `@use "foo" as bar`;
105
- it(`handles double quotes in '${input12}'`, () => {
106
- const imports = sassImportParser(input12);
107
- const targets = Array.from(imports).map(x => x.target);
108
- targets.should.deep.equal(['foo']);
109
- });
110
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=scssImportParserChatgpt.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"scssImportParserChatgpt.sxyt.d.ts","sourceRoot":"","sources":["../../src/build/scssImportParserChatgpt.sxyt.ts"],"names":[],"mappings":""}
@@ -1,120 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { scssImportParserChatgpt } from "./scssImportParserChatgpt.js";
3
- describe('sassImportParser()', ({
4
- it
5
- }) => {
6
- const input = `@import 'foo';`;
7
- it(`parses out an import '${input}'`, () => {
8
- const imports = scssImportParserChatgpt(input);
9
- const targets = Array.from(imports).map(x => x.target);
10
- targets.should.deep.equal(['foo']);
11
- });
12
- const input2 = `@import 'foo';
13
- @import 'bar';`;
14
- it(`parses out 2 imports from '${input2}'`, () => {
15
- const imports = scssImportParserChatgpt(input2);
16
- const targets = Array.from(imports).map(x => x.target);
17
- targets.should.deep.equal(['foo', 'bar']);
18
- });
19
- const input3 = `
20
- @import 'foo';
21
-
22
- @import 'bar';
23
-
24
- `;
25
- it(`parses out 2 imports with spaces from '${input3}'`, () => {
26
- const imports = scssImportParserChatgpt(input3);
27
- const targets = Array.from(imports).map(x => x.target);
28
- targets.should.deep.equal(['foo', 'bar']);
29
- });
30
- const input4 = `
31
- @import 'foo';
32
- @import 'bar';
33
- p::after {
34
- content: "@import 'baz'";
35
- }
36
- `;
37
- it(`ignores extra imports within style values '${input4}'`, () => {
38
- const imports = scssImportParserChatgpt(input4);
39
- const targets = Array.from(imports).map(x => x.target);
40
- targets.should.deep.equal(['foo', 'bar']);
41
- });
42
- const input5b = `
43
- @import 'foo';
44
- @import 'bar';
45
- /* @use 'ignoremetoo'; */
46
- @use 'baz';
47
- `;
48
- it(`ignores imports within comments in '${input5b}'`, () => {
49
- const imports = scssImportParserChatgpt(input5b);
50
- const targets = Array.from(imports).map(x => x.target);
51
- targets.should.deep.equal(['foo', 'bar', 'baz']);
52
- });
53
- const input5c = `
54
- @import 'foo';
55
- @import 'bar';
56
- /*
57
- @use 'ignoremealso';
58
- */
59
- @use 'baz';
60
- `;
61
- it(`ignores imports within comments in '${input5c}'`, () => {
62
- const imports = scssImportParserChatgpt(input5c);
63
- const targets = Array.from(imports).map(x => x.target);
64
- targets.should.deep.equal(['foo', 'bar', 'baz']);
65
- });
66
- const input6 = `
67
- @import /* comment */ 'foo';
68
- @import /* comment */'bar';
69
- `;
70
- it(`tolerates comments within @import and @use statements in '${input6}'`, () => {
71
- const imports = scssImportParserChatgpt(input6);
72
- const targets = Array.from(imports).map(x => x.target);
73
- targets.should.deep.equal(['foo', 'bar']);
74
- });
75
- const input7 = `
76
- @import'foo';
77
- @import/* comment */'bar';
78
- `;
79
- it(`does not require a space between @import / @use and the target using '${input7}'`, () => {
80
- const imports = scssImportParserChatgpt(input7);
81
- const targets = Array.from(imports).map(x => x.target);
82
- targets.should.deep.equal(['foo', 'bar']);
83
- });
84
- const input8 = `@import 'foo';`;
85
- it(`returns a correct index for the start position when extracting from '${input8}'`, () => {
86
- const imports = scssImportParserChatgpt(input8);
87
- Array.from(imports).should.deep.equal([{
88
- target: 'foo',
89
- start: 9
90
- }]);
91
- });
92
- const input9 = `
93
-
94
- @import 'bar';`;
95
- it(`returns a correct index for the start position when extracting from '${input9}'`, () => {
96
- const imports = scssImportParserChatgpt(input9);
97
- Array.from(imports).should.deep.equal([{
98
- target: 'bar',
99
- start: 15
100
- }]);
101
- });
102
- const input10 = `@use 'foo' as bar;`;
103
- it(`handles aliasing in @use statements in '${input10}'`, () => {
104
- const imports = scssImportParserChatgpt(input10);
105
- const targets = Array.from(imports).map(x => x.target);
106
- targets.should.deep.equal(['foo']);
107
- });
108
- const input11 = `@use './foo' as bar;`;
109
- it(`extract relative targets from '${input11}'`, () => {
110
- const imports = scssImportParserChatgpt(input11);
111
- const targets = Array.from(imports).map(x => x.target);
112
- targets.should.deep.equal(['./foo']);
113
- });
114
- const input12 = `@use "foo" as bar;`;
115
- it(`handles double quotes in '${input12}'`, () => {
116
- const imports = scssImportParserChatgpt(input12);
117
- const targets = Array.from(imports).map(x => x.target);
118
- targets.should.deep.equal(['foo']);
119
- });
120
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=clone.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"clone.sxyt.d.ts","sourceRoot":"","sources":["../src/clone.sxyt.ts"],"names":[],"mappings":""}
@@ -1,24 +0,0 @@
1
- import { describe } from 'sxy-test-runner';
2
- import { clone } from "./clone.js";
3
- import { expect } from 'chai';
4
- describe('clone()', ({
5
- it
6
- }) => {
7
- it('clones an objects with symbols', () => {
8
- const sym1 = Symbol(1);
9
- const obj = {
10
- a: 'a',
11
- arr: [1, 2],
12
- sub: {
13
- [sym1]: 5,
14
- sub2: {
15
- foo: 'FOO'
16
- }
17
- }
18
- };
19
- const newObj = clone(obj);
20
- expect(newObj).not.to.equal(obj);
21
- expect(newObj.sub).not.to.equal(obj.sub);
22
- expect(newObj).to.deep.equal(obj);
23
- });
24
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=componentProxyHandlers.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"componentProxyHandlers.sxyt.d.ts","sourceRoot":"","sources":["../src/componentProxyHandlers.sxyt.ts"],"names":[],"mappings":""}
@@ -1,130 +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 { describe } from 'sxy-test-runner';
5
- import { expect } from 'chai';
6
- import { proxyObjectContent, getStateProxyHandler, $original, $ownerName } from "./componentProxyHandlers.js";
7
- class FakeComponent {
8
- constructor() {
9
- _defineProperty(this, "__initialized", true);
10
- _defineProperty(this, "updates", 0);
11
- }
12
- __stateUpdated() {
13
- this.updates++;
14
- }
15
- }
16
- class ParentComp extends FakeComponent {}
17
- class ChildComp extends FakeComponent {}
18
- // proxyObjectContent proxies a state object's contents in place, the same entry point
19
- // Components.__init uses, so state.<key> afterwards is a state-object proxy
20
- function makeState(element, state) {
21
- proxyObjectContent(element, state);
22
- return state;
23
- }
24
- describe('componentProxyHandlers state adoption', ({
25
- it
26
- }) => {
27
- it('exposes $original and $ownerName on state object proxies', () => {
28
- const parent = new ParentComp();
29
- const state = makeState(parent, {
30
- data: {
31
- x: 1
32
- }
33
- });
34
- expect(state.data[$ownerName]).to.equal('ParentComp');
35
- expect(state.data[$original]).to.deep.equal({
36
- x: 1
37
- });
38
- });
39
- it('adopts an object owned by another component as a copy instead of throwing', () => {
40
- const parent = new ParentComp();
41
- const parentState = makeState(parent, {
42
- data: {
43
- x: 1,
44
- nested: {
45
- y: 2
46
- }
47
- }
48
- });
49
- const child = new ChildComp();
50
- const childState = makeState(child, {
51
- data: parentState.data
52
- });
53
- expect(childState.data).to.not.equal(parentState.data);
54
- expect(childState.data.x).to.equal(1);
55
- expect(childState.data.nested.y).to.equal(2);
56
- // the two components must not alias, at any depth
57
- childState.data.x = 99;
58
- childState.data.nested.y = 55;
59
- expect(parentState.data.x).to.equal(1);
60
- expect(parentState.data.nested.y).to.equal(2);
61
- expect(parent.updates).to.equal(0);
62
- expect(child.updates).to.be.greaterThan(0);
63
- });
64
- it('adopts via the top-level state set trap too', () => {
65
- const parent = new ParentComp();
66
- const parentState = makeState(parent, {
67
- list: [1, {
68
- deep: true
69
- }]
70
- });
71
- const child = new ChildComp();
72
- const childStateTarget = {
73
- list: undefined
74
- };
75
- const childState = new Proxy(childStateTarget, getStateProxyHandler(child));
76
- childState.list = parentState.list;
77
- expect(childState.list).to.not.equal(parentState.list);
78
- childState.list.push(2);
79
- expect(childState.list.length).to.equal(3);
80
- expect(parentState.list.length).to.equal(2);
81
- });
82
- it('preserves shared references within one state tree', () => {
83
- const el = new ParentComp();
84
- const shared = {
85
- v: 1
86
- };
87
- const state = makeState(el, {
88
- a: shared,
89
- b: shared
90
- });
91
- expect(state.a).to.equal(state.b);
92
- state.a.v = 2;
93
- expect(state.b.v).to.equal(2);
94
- });
95
- it('terminates on self-referencing objects', () => {
96
- const el = new ParentComp();
97
- const cyc = {
98
- n: 1
99
- };
100
- cyc.self = cyc;
101
- const state = makeState(el, {
102
- cyc
103
- });
104
- expect(state.cyc.self).to.equal(state.cyc);
105
- expect(state.cyc.self.self.n).to.equal(1);
106
- });
107
- it('adopts Maps and Sets as copies', () => {
108
- const parent = new ParentComp();
109
- const parentState = makeState(parent, {
110
- m: new Map([['k', 1]]),
111
- s: new Set([1, 2])
112
- });
113
- const child = new ChildComp();
114
- const childState = makeState(child, {
115
- m: parentState.m,
116
- s: parentState.s
117
- });
118
- childState.m.set('k', 2);
119
- childState.s.add(3);
120
- expect(parentState.m.get('k')).to.equal(1);
121
- expect(parentState.s.has(3)).to.equal(false);
122
- });
123
- it('assigns a Map set into top-level state (missing assignment fix)', () => {
124
- const el = new ParentComp();
125
- const state = new Proxy({}, getStateProxyHandler(el));
126
- state.m = new Map([['k', 1]]);
127
- expect(state.m).to.not.equal(undefined);
128
- expect(state.m.get('k')).to.equal(1);
129
- });
130
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=RawHtml.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RawHtml.sxyt.d.ts","sourceRoot":"","sources":["../../src/components/RawHtml.sxyt.ts"],"names":[],"mappings":""}
@@ -1,104 +0,0 @@
1
- import { expect } from 'chai';
2
- import { Window } from 'happy-dom';
3
- import { describe } from 'sxy-test-runner';
4
- import { RawHtml } from "./RawHtml.js";
5
- import { createTestApp } from "../testing/index.js";
6
- // Mounts RawHtml and returns the markup it actually put in the page. The parser
7
- // itself is covered in rawHtml/parseHtml.sxyt.ts; what is under test here is
8
- // that the component hands its props to the parser correctly.
9
- const mount = async props => {
10
- const window = new Window();
11
- const testApp = await createTestApp(RawHtml, {
12
- // eslint-disable-next-line no-type-assertion/no-type-assertion
13
- document: window.document,
14
- props
15
- });
16
- try {
17
- return {
18
- html: testApp.container.innerHTML,
19
- text: testApp.container.textContent,
20
- elements: testApp.container.querySelectorAll('*').length
21
- };
22
- } finally {
23
- await testApp.unmount();
24
- }
25
- };
26
- const render = async props => (await mount(props)).html;
27
- describe('RawHtml', ({
28
- it
29
- }) => {
30
- it('renders parsed markup as real elements', async () => {
31
- const html = await render({
32
- html: '<p>Bonuses for <strong>this month</strong>.</p>'
33
- });
34
- expect(html).to.contain('<p>');
35
- expect(html).to.contain('<strong>this month</strong>');
36
- });
37
- it('renders nothing for empty markup', async () => {
38
- // a component always leaves its delimiter comments behind, so the check
39
- // is that it contributed no content, not that the container is empty
40
- const {
41
- text,
42
- elements
43
- } = await mount({
44
- html: ''
45
- });
46
- expect(text).to.equal('');
47
- expect(elements).to.equal(0);
48
- });
49
- it('drops scripts by default', async () => {
50
- const html = await render({
51
- html: '<p>a</p><script>alert(1)</script>'
52
- });
53
- expect(html).to.contain('<p>a</p>');
54
- expect(html).to.not.contain('script');
55
- expect(html).to.not.contain('alert');
56
- });
57
- it('keeps scripts when sanitizing is turned off', async () => {
58
- expect(await render({
59
- html: '<div><script>x()</script></div>',
60
- sanitize: false
61
- })).to.contain('<script>x()</script>');
62
- });
63
- // `safe` is the shortcut for Tungsten's built-in allow list
64
- it('applies the built-in allow list when safe is set', async () => {
65
- const html = await render({
66
- html: '<p style="position:fixed">a</p><iframe src="//evil"></iframe>',
67
- safe: true
68
- });
69
- expect(html).to.contain('a');
70
- expect(html).to.not.contain('iframe');
71
- // the safe list excludes style, which can disguise a page without script
72
- expect(html).to.not.contain('position:fixed');
73
- });
74
- it('does not apply an allow list unless asked', async () => {
75
- const html = await render({
76
- html: '<p style="position:fixed">a</p>'
77
- });
78
- expect(html).to.contain('position:fixed');
79
- });
80
- it('lets an explicit allowList win over safe', async () => {
81
- const onlyEmphasis = {
82
- tags: ['em'],
83
- attributes: []
84
- };
85
- // <strong> is on the safe list but not on this one, so if allowList is
86
- // being applied it is unwrapped; if safe won, it would survive
87
- const html = await render({
88
- html: '<em>keep</em><strong>unwrap</strong>',
89
- safe: true,
90
- allowList: onlyEmphasis
91
- });
92
- expect(html).to.contain('<em>keep</em>');
93
- expect(html).to.not.contain('<strong>');
94
- expect(html).to.contain('unwrap');
95
- });
96
- it('renders whatever it is given without throwing', async () => {
97
- const malformed = ['<p>unclosed', '</p>stray', '<p class="unterminated>x', '<<>>', '<!-- open'];
98
- for (const html of malformed) {
99
- expect(await render({
100
- html
101
- })).to.be.a('string');
102
- }
103
- });
104
- });
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=BindableSelect.sxyt.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BindableSelect.sxyt.d.ts","sourceRoot":"","sources":["../../../src/components/bindable/BindableSelect.sxyt.tsx"],"names":[],"mappings":""}