solarite 0.1.0 → 0.2.0

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 (48) hide show
  1. package/benchmarks/naive/Solarite.min.js +4 -0
  2. package/benchmarks/naive/index.html +14 -0
  3. package/benchmarks/naive/main.js +339 -0
  4. package/benchmarks/naive/package-lock.json +13 -0
  5. package/benchmarks/naive/package.json +23 -0
  6. package/benchmarks/readme.md +48 -0
  7. package/build/build.bat +3 -2
  8. package/build/build.js +1 -1
  9. package/dist/Solarite-debug.js +1941 -2791
  10. package/dist/Solarite.js +1697 -2511
  11. package/dist/Solarite.min.js +3 -3
  12. package/dist/udomdiff-license.txt +18 -0
  13. package/docs/index.md +695 -235
  14. package/docs/js/Playground.js +1 -1
  15. package/docs/js/codemirror/codemirror6.js +3683 -3206
  16. package/docs/js/codemirror/themeSolarIce.js +2 -2
  17. package/docs/js/documentation.js +2 -2
  18. package/docs/js/ui/CodeEditor.js +183 -45
  19. package/docs/js/ui/FlexResizer.js +15 -5
  20. package/docs/js/util/Errors.js +11 -0
  21. package/docs/media/documentation.css +6 -3
  22. package/index.html +462 -26
  23. package/package.json +1 -1
  24. package/readme.md +11 -1
  25. package/src/solarite/ExprPath.js +422 -135
  26. package/src/solarite/Globals.js +53 -0
  27. package/src/solarite/NodeGroup.js +300 -388
  28. package/src/solarite/Shell.js +31 -33
  29. package/src/solarite/Solarite.js +17 -2
  30. package/src/solarite/Template.js +75 -25
  31. package/src/solarite/Util.js +131 -7
  32. package/src/solarite/createSolarite.js +32 -25
  33. package/src/solarite/getArg.js +12 -12
  34. package/src/solarite/hash.js +18 -35
  35. package/src/solarite/r.js +128 -118
  36. package/src/solarite/watch3.js +98 -0
  37. package/src/{solarite → unused}/NodeGroupManager.js +86 -224
  38. package/src/unused/onConnect.js +79 -0
  39. package/src/{solarite → unused}/watch.js +2 -2
  40. package/src/{solarite → unused}/watch2.js +4 -4
  41. package/src/{solarite → util}/MultiValueMap.js +23 -12
  42. package/src/util/WeakArray.js +33 -0
  43. package/tests/Solarite.test.js +1108 -166
  44. package/tests/Testimony.js +274 -67
  45. package/tests/index.html +6 -35
  46. package/tests/run.bat +2 -0
  47. package/tests/NodeGroup.test.js +0 -115
  48. package/tests/Shell.test.js +0 -75
@@ -0,0 +1,53 @@
1
+ var Globals = {
2
+
3
+ /**
4
+ * Used by NodeGroup.applyComponentExprs() */
5
+ componentHash: new WeakMap(),
6
+
7
+ /**
8
+ * Store which instances of Solarite have already been added to the DOM.
9
+ * @type {WeakSet<HTMLElement>} */
10
+ connected: new WeakSet(),
11
+
12
+ /**
13
+ * Elements that have been rendered to by r() at least once.
14
+ * This is used by the Solarite class to know when to call onFirstConnect()
15
+ * @type {WeakSet<HTMLElement>} */
16
+ rendered: new WeakSet(),
17
+
18
+ /**
19
+ * Used by watch3 to see which expressions are being accessed. */
20
+ currentExprPath: [],
21
+
22
+ /**
23
+ * @type {Object<string, Class<Node>>} A map from built-in tag names to the constructors that create them. */
24
+ elementClasses: {},
25
+
26
+ /**
27
+ * Used by ExprPath.applyEventAttrib()
28
+ * @type {WeakMap<Node, Object<eventName:string, [original:function, bound:function, args:*[]]>>} */
29
+ nodeEvents: new WeakMap(),
30
+
31
+ /**
32
+ * Get the RootNodeGroup for an element.
33
+ * @type {WeakMap<HTMLElement, RootNodeGroup>} */
34
+ nodeGroups: new WeakMap(),
35
+
36
+ /**
37
+ * Used by r() path 9. */
38
+ objToEl: new WeakMap(),
39
+
40
+ pendingChildren: [],
41
+
42
+ /**
43
+ * Elements that are currently rendering via the r() function.
44
+ * @type {WeakSet<HTMLElement>} */
45
+ rendering: new WeakSet(),
46
+
47
+ /**
48
+ * Map from array of Html strings to a Shell created from them.
49
+ * @type {WeakMap<string[], Shell>} */
50
+ shells: new WeakMap()
51
+ };
52
+
53
+ export default Globals;