j-templates 7.0.39 → 7.0.40

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 (90) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +36 -0
  3. package/{Node → lib/Node}/vNode.js +21 -0
  4. package/lib/package.json +13 -0
  5. package/package.json +39 -3
  6. /package/{DOM → lib/DOM}/createAssignment.d.ts +0 -0
  7. /package/{DOM → lib/DOM}/createAssignment.js +0 -0
  8. /package/{DOM → lib/DOM}/createAttributeAssignment.d.ts +0 -0
  9. /package/{DOM → lib/DOM}/createAttributeAssignment.js +0 -0
  10. /package/{DOM → lib/DOM}/createEventAssignment.d.ts +0 -0
  11. /package/{DOM → lib/DOM}/createEventAssignment.js +0 -0
  12. /package/{DOM → lib/DOM}/createPropertyAssignment.d.ts +0 -0
  13. /package/{DOM → lib/DOM}/createPropertyAssignment.js +0 -0
  14. /package/{DOM → lib/DOM}/domNodeConfig.d.ts +0 -0
  15. /package/{DOM → lib/DOM}/domNodeConfig.js +0 -0
  16. /package/{DOM → lib/DOM}/elements.d.ts +0 -0
  17. /package/{DOM → lib/DOM}/elements.js +0 -0
  18. /package/{DOM → lib/DOM}/index.d.ts +0 -0
  19. /package/{DOM → lib/DOM}/index.js +0 -0
  20. /package/{DOM → lib/DOM}/svgElements.d.ts +0 -0
  21. /package/{DOM → lib/DOM}/svgElements.js +0 -0
  22. /package/{DOM → lib/DOM}/window.d.ts +0 -0
  23. /package/{DOM → lib/DOM}/window.js +0 -0
  24. /package/{Node → lib/Node}/component.d.ts +0 -0
  25. /package/{Node → lib/Node}/component.js +0 -0
  26. /package/{Node → lib/Node}/component.types.d.ts +0 -0
  27. /package/{Node → lib/Node}/component.types.js +0 -0
  28. /package/{Node → lib/Node}/nodeConfig.d.ts +0 -0
  29. /package/{Node → lib/Node}/nodeConfig.js +0 -0
  30. /package/{Node → lib/Node}/vNode.d.ts +0 -0
  31. /package/{Node → lib/Node}/vNode.types.d.ts +0 -0
  32. /package/{Node → lib/Node}/vNode.types.js +0 -0
  33. /package/{Store → lib/Store}/Diff/diffAsync.d.ts +0 -0
  34. /package/{Store → lib/Store}/Diff/diffAsync.js +0 -0
  35. /package/{Store → lib/Store}/Diff/diffSync.d.ts +0 -0
  36. /package/{Store → lib/Store}/Diff/diffSync.js +0 -0
  37. /package/{Store → lib/Store}/Diff/diffTree.d.ts +0 -0
  38. /package/{Store → lib/Store}/Diff/diffTree.js +0 -0
  39. /package/{Store → lib/Store}/Diff/diffWorker.d.ts +0 -0
  40. /package/{Store → lib/Store}/Diff/diffWorker.js +0 -0
  41. /package/{Store → lib/Store}/Diff/workerQueue.d.ts +0 -0
  42. /package/{Store → lib/Store}/Diff/workerQueue.js +0 -0
  43. /package/{Store → lib/Store}/Store/store.d.ts +0 -0
  44. /package/{Store → lib/Store}/Store/store.js +0 -0
  45. /package/{Store → lib/Store}/Store/storeAsync.d.ts +0 -0
  46. /package/{Store → lib/Store}/Store/storeAsync.js +0 -0
  47. /package/{Store → lib/Store}/Store/storeSync.d.ts +0 -0
  48. /package/{Store → lib/Store}/Store/storeSync.js +0 -0
  49. /package/{Store → lib/Store}/Tree/observableNode.d.ts +0 -0
  50. /package/{Store → lib/Store}/Tree/observableNode.js +0 -0
  51. /package/{Store → lib/Store}/Tree/observableScope.d.ts +0 -0
  52. /package/{Store → lib/Store}/Tree/observableScope.js +0 -0
  53. /package/{Store → lib/Store}/index.d.ts +0 -0
  54. /package/{Store → lib/Store}/index.js +0 -0
  55. /package/{Utils → lib/Utils}/animation.d.ts +0 -0
  56. /package/{Utils → lib/Utils}/animation.js +0 -0
  57. /package/{Utils → lib/Utils}/array.d.ts +0 -0
  58. /package/{Utils → lib/Utils}/array.js +0 -0
  59. /package/{Utils → lib/Utils}/asyncQueue.d.ts +0 -0
  60. /package/{Utils → lib/Utils}/asyncQueue.js +0 -0
  61. /package/{Utils → lib/Utils}/avlTree.d.ts +0 -0
  62. /package/{Utils → lib/Utils}/avlTree.js +0 -0
  63. /package/{Utils → lib/Utils}/decorators.d.ts +0 -0
  64. /package/{Utils → lib/Utils}/decorators.js +0 -0
  65. /package/{Utils → lib/Utils}/distinctArray.d.ts +0 -0
  66. /package/{Utils → lib/Utils}/distinctArray.js +0 -0
  67. /package/{Utils → lib/Utils}/emitter.d.ts +0 -0
  68. /package/{Utils → lib/Utils}/emitter.js +0 -0
  69. /package/{Utils → lib/Utils}/functions.d.ts +0 -0
  70. /package/{Utils → lib/Utils}/functions.js +0 -0
  71. /package/{Utils → lib/Utils}/index.d.ts +0 -0
  72. /package/{Utils → lib/Utils}/index.js +0 -0
  73. /package/{Utils → lib/Utils}/injector.d.ts +0 -0
  74. /package/{Utils → lib/Utils}/injector.js +0 -0
  75. /package/{Utils → lib/Utils}/json.d.ts +0 -0
  76. /package/{Utils → lib/Utils}/json.js +0 -0
  77. /package/{Utils → lib/Utils}/jsonType.d.ts +0 -0
  78. /package/{Utils → lib/Utils}/jsonType.js +0 -0
  79. /package/{Utils → lib/Utils}/list.d.ts +0 -0
  80. /package/{Utils → lib/Utils}/list.js +0 -0
  81. /package/{Utils → lib/Utils}/router.d.ts +0 -0
  82. /package/{Utils → lib/Utils}/router.js +0 -0
  83. /package/{Utils → lib/Utils}/thread.d.ts +0 -0
  84. /package/{Utils → lib/Utils}/thread.js +0 -0
  85. /package/{Utils → lib/Utils}/utils.types.d.ts +0 -0
  86. /package/{Utils → lib/Utils}/utils.types.js +0 -0
  87. /package/{index.d.ts → lib/index.d.ts} +0 -0
  88. /package/{index.debug.d.ts → lib/index.debug.d.ts} +0 -0
  89. /package/{index.debug.js → lib/index.debug.js} +0 -0
  90. /package/{index.js → lib/index.js} +0 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 TypesInCode
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,36 @@
1
+ # j-templates
2
+ Type-safe templating for the browser.
3
+ ## Install
4
+ ```
5
+ npm install --save-dev j-templates
6
+ ```
7
+
8
+ Framework for building reactive browser applications:
9
+ * TypeScript only - no extra transpile or compile steps
10
+ * Bundler agnostic - bundle using your preferred library
11
+ * Low dependencies - hello world only requires this + a bundler to get started
12
+
13
+ ## Hello World
14
+ ```typescript
15
+ import { Component } from 'j-templates';
16
+ import { div } from 'j-templates/DOM';
17
+
18
+ class HelloWorld extends Component {
19
+
20
+ public Template() {
21
+ return div({}, () => "Hello world");
22
+ }
23
+
24
+ }
25
+
26
+ var helloWorld = Component.ToFunction("hello-world", HelloWorld);
27
+ Component.Attach(document.body, helloWorld({}));
28
+ ```
29
+ ### Resulting HTML
30
+ ```html
31
+ <hello-world>
32
+ <div>Hello world</div>
33
+ </hello-world>
34
+ ```
35
+
36
+ [More Examples](https://typesincode.github.io/jTemplates/)
@@ -182,6 +182,27 @@ function WrapChildren(injector, children, data, nodeList) {
182
182
  case 0:
183
183
  DestroyNodeList(nodeList);
184
184
  return [];
185
+ case 1: {
186
+ const data = nextData[0];
187
+ const node = nodeList.head;
188
+ DestroyNodeList(nodeList);
189
+ if (node && node.data.data === data) {
190
+ node.data.nodes = Store_1.ObservableScope.Value(node.data.scope);
191
+ list_1.List.AddNode(nodeList, node);
192
+ }
193
+ else {
194
+ const childrenScope = Store_1.ObservableScope.Create(function () {
195
+ const childNodes = injector_1.Injector.Scope(injector, children, data);
196
+ return CreateNodeArray(childNodes);
197
+ });
198
+ list_1.List.Add(nodeList, {
199
+ data,
200
+ nodes: Store_1.ObservableScope.Value(childrenScope),
201
+ scope: childrenScope
202
+ });
203
+ }
204
+ return nodeList.head.data.nodes;
205
+ }
185
206
  default: {
186
207
  const nodeListMap = list_1.List.ToListMap(nodeList, GetData);
187
208
  const nextNodeList = list_1.List.Create();
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "j-templates",
3
+ "version": "7.0.40",
4
+ "description": "j-templates",
5
+ "license": "MIT",
6
+ "repository": "https://github.com/TypesInCode/jTemplates",
7
+ "author": "Jay Landrum",
8
+ "keywords": [
9
+ ""
10
+ ],
11
+ "main": "./index.js",
12
+ "typings": "./index.d.ts"
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "j-templates",
3
- "version": "7.0.39",
3
+ "version": "7.0.40",
4
4
  "description": "j-templates",
5
5
  "license": "MIT",
6
6
  "repository": "https://github.com/TypesInCode/jTemplates",
@@ -8,6 +8,42 @@
8
8
  "keywords": [
9
9
  ""
10
10
  ],
11
- "main": "./index.js",
12
- "typings": "./index.d.ts"
11
+ "files": [
12
+ "lib"
13
+ ],
14
+ "main": "lib/index.js",
15
+ "typings": "lib/index.d.ts",
16
+ "scripts": {
17
+ "clean": "rimraf lib",
18
+ "build": "npm run buildquick && node ./tools/copy-package-json.js",
19
+ "buildquick": "npm run clean && echo Using TypeScript && tsc --version && tsc --pretty",
20
+ "builddocs": "typedoc --out docs src/index.ts src/DOM/index.ts src/Utils/index.ts src/Store/index.ts && touch docs/.nojekyll",
21
+ "test": "mocha --require ts-node/register --recursive test/**/*-spec.ts",
22
+ "testcoverage": "nyc mocha --require ts-node/register --required source-map-support/register --recursive test/**/*-spec.ts"
23
+ },
24
+ "devDependencies": {
25
+ "@types/chai": "3.4.30",
26
+ "@types/mocha": "2.2.29",
27
+ "@types/node": "^13.1.2",
28
+ "chai": "^3.5.0",
29
+ "fs-extra": "^8.1.0",
30
+ "jsdom": "^13.2.0",
31
+ "mocha": "^7.0.0",
32
+ "nyc": "^15.1.0",
33
+ "rimraf": "^2.5.4",
34
+ "ts-node": "^10.9.2",
35
+ "typedoc": "^0.26.10",
36
+ "typescript": "^5.5.3"
37
+ },
38
+ "engines": {
39
+ "node": ">=4.0.0"
40
+ },
41
+ "nyc": {
42
+ "extension": [
43
+ ".ts"
44
+ ],
45
+ "reporter": [
46
+ "html"
47
+ ]
48
+ }
13
49
  }
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes