vsn 0.1.26 → 0.1.27

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 (191) hide show
  1. package/dist/AST.js +2197 -0
  2. package/dist/AST.js.map +1 -0
  3. package/dist/Attribute.d.ts +1 -1
  4. package/dist/Attribute.js +187 -0
  5. package/dist/Attribute.js.map +1 -0
  6. package/dist/Bencmark.js +179 -0
  7. package/dist/Bencmark.js.map +1 -0
  8. package/dist/Configuration.d.ts +1 -1
  9. package/dist/Configuration.js +64 -0
  10. package/dist/Configuration.js.map +1 -0
  11. package/dist/Controller.d.ts +1 -1
  12. package/dist/Controller.js +54 -0
  13. package/dist/Controller.js.map +1 -0
  14. package/dist/DOM/DOMObject.d.ts +1 -1
  15. package/dist/DOM/DOMObject.js +47 -0
  16. package/dist/DOM/DOMObject.js.map +1 -0
  17. package/dist/DOM/WrappedDocument.js +34 -0
  18. package/dist/DOM/WrappedDocument.js.map +1 -0
  19. package/dist/DOM/WrappedWindow.js +45 -0
  20. package/dist/DOM/WrappedWindow.js.map +1 -0
  21. package/dist/DOM.d.ts +1 -1
  22. package/dist/DOM.js +547 -0
  23. package/dist/DOM.js.map +1 -0
  24. package/dist/EventDispatcher.d.ts +26 -0
  25. package/dist/EventDispatcher.js +117 -0
  26. package/dist/EventDispatcher.js.map +1 -0
  27. package/dist/Formats.js +44 -0
  28. package/dist/Formats.js.map +1 -0
  29. package/dist/MessageList.d.ts +14 -0
  30. package/dist/MessageList.js +88 -0
  31. package/dist/MessageList.js.map +1 -0
  32. package/dist/Model/Collection.d.ts +5 -0
  33. package/dist/Model/Collection.js +37 -0
  34. package/dist/Model/Collection.js.map +1 -0
  35. package/dist/Model/DataModel.d.ts +6 -0
  36. package/dist/Model/DataModel.js +54 -0
  37. package/dist/Model/DataModel.js.map +1 -0
  38. package/dist/Model/ModelAbstract.d.ts +20 -0
  39. package/dist/Model/ModelAbstract.js +122 -0
  40. package/dist/Model/ModelAbstract.js.map +1 -0
  41. package/dist/Model/fields/BooleanField.d.ts +5 -0
  42. package/dist/Model/fields/BooleanField.js +43 -0
  43. package/dist/Model/fields/BooleanField.js.map +1 -0
  44. package/dist/Model/fields/EmailField.d.ts +5 -0
  45. package/dist/Model/fields/EmailField.js +36 -0
  46. package/dist/Model/fields/EmailField.js.map +1 -0
  47. package/dist/Model/fields/Field.d.ts +13 -0
  48. package/dist/Model/fields/Field.js +79 -0
  49. package/dist/Model/fields/Field.js.map +1 -0
  50. package/dist/Model/fields/FloatField.d.ts +5 -0
  51. package/dist/Model/fields/FloatField.js +47 -0
  52. package/dist/Model/fields/FloatField.js.map +1 -0
  53. package/dist/Model/fields/PositiveNumberField.d.ts +5 -0
  54. package/dist/Model/fields/PositiveNumberField.js +51 -0
  55. package/dist/Model/fields/PositiveNumberField.js.map +1 -0
  56. package/dist/Model/fields/StringField.d.ts +5 -0
  57. package/dist/Model/fields/StringField.js +43 -0
  58. package/dist/Model/fields/StringField.js.map +1 -0
  59. package/dist/Model.d.ts +11 -0
  60. package/dist/Model.js +72 -0
  61. package/dist/Model.js.map +1 -0
  62. package/dist/Query.js +66 -0
  63. package/dist/Query.js.map +1 -0
  64. package/dist/Registry.d.ts +2 -2
  65. package/dist/Registry.js +128 -0
  66. package/dist/Registry.js.map +1 -0
  67. package/dist/Scope.d.ts +7 -10
  68. package/dist/Scope.js +462 -0
  69. package/dist/Scope.js.map +1 -0
  70. package/dist/SimplePromise.d.ts +42 -0
  71. package/dist/SimplePromise.js +217 -0
  72. package/dist/SimplePromise.js.map +1 -0
  73. package/dist/Tag/List.js +85 -0
  74. package/dist/Tag/List.js.map +1 -0
  75. package/dist/Tag.js +770 -0
  76. package/dist/Tag.js.map +1 -0
  77. package/dist/Types.js +48 -0
  78. package/dist/Types.js.map +1 -0
  79. package/dist/attributes/AddClassIf.js +93 -0
  80. package/dist/attributes/AddClassIf.js.map +1 -0
  81. package/dist/attributes/Bind.js +272 -0
  82. package/dist/attributes/Bind.js.map +1 -0
  83. package/dist/attributes/ClassConstructor.js +104 -0
  84. package/dist/attributes/ClassConstructor.js.map +1 -0
  85. package/dist/attributes/ClickRemoveClass.js +114 -0
  86. package/dist/attributes/ClickRemoveClass.js.map +1 -0
  87. package/dist/attributes/ClickToggleClass.js +114 -0
  88. package/dist/attributes/ClickToggleClass.js.map +1 -0
  89. package/dist/attributes/ControllerAttribute.js +28 -0
  90. package/dist/attributes/ControllerAttribute.js.map +1 -0
  91. package/dist/attributes/DisableIf.js +94 -0
  92. package/dist/attributes/DisableIf.js.map +1 -0
  93. package/dist/attributes/Exec.js +108 -0
  94. package/dist/attributes/Exec.js.map +1 -0
  95. package/dist/attributes/Format.js +99 -0
  96. package/dist/attributes/Format.js.map +1 -0
  97. package/dist/attributes/If.js +159 -0
  98. package/dist/attributes/If.js.map +1 -0
  99. package/dist/attributes/JSONAttribute.js +118 -0
  100. package/dist/attributes/JSONAttribute.js.map +1 -0
  101. package/dist/attributes/KeyAbstract.js +117 -0
  102. package/dist/attributes/KeyAbstract.js.map +1 -0
  103. package/dist/attributes/KeyDown.js +88 -0
  104. package/dist/attributes/KeyDown.js.map +1 -0
  105. package/dist/attributes/KeyUp.js +88 -0
  106. package/dist/attributes/KeyUp.js.map +1 -0
  107. package/dist/attributes/List.js +282 -0
  108. package/dist/attributes/List.js.map +1 -0
  109. package/dist/attributes/ListItem.js +138 -0
  110. package/dist/attributes/ListItem.js.map +1 -0
  111. package/dist/attributes/ListItemModel.js +39 -0
  112. package/dist/attributes/ListItemModel.js.map +1 -0
  113. package/dist/attributes/ModelAttribute.js +29 -0
  114. package/dist/attributes/ModelAttribute.js.map +1 -0
  115. package/dist/attributes/Name.js +88 -0
  116. package/dist/attributes/Name.js.map +1 -0
  117. package/dist/attributes/On.js +135 -0
  118. package/dist/attributes/On.js.map +1 -0
  119. package/dist/attributes/Radio.js +174 -0
  120. package/dist/attributes/Radio.js.map +1 -0
  121. package/dist/attributes/Referenced.js +38 -0
  122. package/dist/attributes/Referenced.js.map +1 -0
  123. package/dist/attributes/RootAttribute.js +91 -0
  124. package/dist/attributes/RootAttribute.js.map +1 -0
  125. package/dist/attributes/ScopeAttribute.js +40 -0
  126. package/dist/attributes/ScopeAttribute.js.map +1 -0
  127. package/dist/attributes/ScopeChange.js +130 -0
  128. package/dist/attributes/ScopeChange.js.map +1 -0
  129. package/dist/attributes/SetAttribute.js +133 -0
  130. package/dist/attributes/SetAttribute.js.map +1 -0
  131. package/dist/attributes/StandardAttribute.js +186 -0
  132. package/dist/attributes/StandardAttribute.js.map +1 -0
  133. package/dist/attributes/StyleAttribute.js +183 -0
  134. package/dist/attributes/StyleAttribute.js.map +1 -0
  135. package/dist/attributes/Template.js +39 -0
  136. package/dist/attributes/Template.js.map +1 -0
  137. package/dist/attributes/TypeAttribute.js +104 -0
  138. package/dist/attributes/TypeAttribute.js.map +1 -0
  139. package/dist/attributes/_imports.js +60 -0
  140. package/dist/attributes/_imports.js.map +1 -0
  141. package/dist/helpers/DOMHelper.js +81 -0
  142. package/dist/helpers/DOMHelper.js.map +1 -0
  143. package/dist/helpers/ElementHelper.js +25 -0
  144. package/dist/helpers/ElementHelper.js.map +1 -0
  145. package/dist/helpers/VisionHelper.js +71 -0
  146. package/dist/helpers/VisionHelper.js.map +1 -0
  147. package/dist/helpers/decorators.js +38 -0
  148. package/dist/helpers/decorators.js.map +1 -0
  149. package/dist/vsn.d.ts +2 -1
  150. package/dist/vsn.js +166 -0
  151. package/dist/vsn.js.map +1 -0
  152. package/package.json +2 -6
  153. package/src/AST.ts +2 -2
  154. package/src/Attribute.ts +2 -2
  155. package/src/Configuration.ts +3 -3
  156. package/src/Controller.ts +1 -1
  157. package/src/DOM/DOMObject.ts +1 -1
  158. package/src/DOM.ts +3 -3
  159. package/src/EventDispatcher.ts +117 -0
  160. package/src/Formats.ts +2 -2
  161. package/src/MessageList.ts +81 -0
  162. package/src/Model/Collection.ts +13 -0
  163. package/src/Model/DataModel.ts +29 -0
  164. package/src/Model/ModelAbstract.ts +114 -0
  165. package/src/Model/fields/BooleanField.ts +16 -0
  166. package/src/Model/fields/EmailField.ts +12 -0
  167. package/src/Model/fields/Field.ts +65 -0
  168. package/src/Model/fields/FloatField.ts +22 -0
  169. package/src/Model/fields/PositiveNumberField.ts +24 -0
  170. package/src/Model/fields/StringField.ts +16 -0
  171. package/src/Model.ts +57 -0
  172. package/src/Registry.ts +3 -3
  173. package/src/Scope.ts +33 -89
  174. package/src/SimplePromise.ts +219 -0
  175. package/src/Tag.ts +2 -2
  176. package/src/attributes/Bind.ts +1 -1
  177. package/src/attributes/List.ts +3 -3
  178. package/src/attributes/Radio.ts +1 -1
  179. package/src/attributes/ScopeChange.ts +1 -1
  180. package/src/attributes/StandardAttribute.ts +1 -1
  181. package/src/attributes/StyleAttribute.ts +1 -1
  182. package/src/vsn.ts +3 -2
  183. package/test/AST.spec.ts +2 -1
  184. package/test/MessageList.spec.ts +101 -0
  185. package/test/Model/DataModel.spec.ts +141 -0
  186. package/test/Model.spec.ts +306 -0
  187. package/test/Scope.spec.ts +2 -2
  188. package/test/SimplePromise.spec.ts +271 -0
  189. package/test/attributes/Bind.spec.ts +5 -5
  190. package/test/attributes/ListItem.spec.ts +1 -1
  191. package/dist/vsn.min.js +0 -1
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
18
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
19
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
20
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
21
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
22
+ };
23
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
24
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
25
+ return new (P || (P = Promise))(function (resolve, reject) {
26
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
27
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
28
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
29
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
30
+ });
31
+ };
32
+ var __generator = (this && this.__generator) || function (thisArg, body) {
33
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
34
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
35
+ function verb(n) { return function (v) { return step([n, v]); }; }
36
+ function step(op) {
37
+ if (f) throw new TypeError("Generator is already executing.");
38
+ while (_) try {
39
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
40
+ if (y = 0, t) op = [op[0] & 2, t.value];
41
+ switch (op[0]) {
42
+ case 0: case 1: t = op; break;
43
+ case 4: _.label++; return { value: op[1], done: false };
44
+ case 5: _.label++; y = op[1]; op = [0]; continue;
45
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
46
+ default:
47
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
48
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
49
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
50
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
51
+ if (t[2]) _.ops.pop();
52
+ _.trys.pop(); continue;
53
+ }
54
+ op = body.call(thisArg, _);
55
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
56
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
57
+ }
58
+ };
59
+ Object.defineProperty(exports, "__esModule", { value: true });
60
+ exports.TypeAttribute = void 0;
61
+ var Attribute_1 = require("../Attribute");
62
+ var Registry_1 = require("../Registry");
63
+ var TypeAttribute = /** @class */ (function (_super) {
64
+ __extends(TypeAttribute, _super);
65
+ function TypeAttribute() {
66
+ return _super !== null && _super.apply(this, arguments) || this;
67
+ }
68
+ TypeAttribute.prototype.extract = function () {
69
+ return __awaiter(this, void 0, void 0, function () {
70
+ var key, type, ref, _a, _b;
71
+ return __generator(this, function (_c) {
72
+ switch (_c.label) {
73
+ case 0:
74
+ key = this.getAttributeBinding();
75
+ type = this.getAttributeValue();
76
+ try {
77
+ ref = this.tag.scope.getReference(key);
78
+ }
79
+ catch (e) {
80
+ console.error('error', e);
81
+ return [2 /*return*/];
82
+ }
83
+ return [4 /*yield*/, ref.getScope()];
84
+ case 1:
85
+ _b = (_a = (_c.sent())).setType;
86
+ return [4 /*yield*/, ref.getKey()];
87
+ case 2:
88
+ _b.apply(_a, [_c.sent(), type]);
89
+ return [4 /*yield*/, _super.prototype.extract.call(this)];
90
+ case 3:
91
+ _c.sent();
92
+ return [2 /*return*/];
93
+ }
94
+ });
95
+ });
96
+ };
97
+ TypeAttribute.canDefer = false;
98
+ TypeAttribute = __decorate([
99
+ Registry_1.Registry.attribute('vsn-type')
100
+ ], TypeAttribute);
101
+ return TypeAttribute;
102
+ }(Attribute_1.Attribute));
103
+ exports.TypeAttribute = TypeAttribute;
104
+ //# sourceMappingURL=TypeAttribute.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeAttribute.js","sourceRoot":"","sources":["../../src/attributes/TypeAttribute.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0CAAuC;AAEvC,wCAAqC;AAGrC;IAAmC,iCAAS;IAA5C;;IAiBA,CAAC;IAfgB,+BAAO,GAApB;;;;;;wBACU,GAAG,GAAW,IAAI,CAAC,mBAAmB,EAAE,CAAC;wBAC3C,IAAI,GAAW,IAAI,CAAC,iBAAiB,EAAE,CAAC;wBAG5C,IAAI;4BACA,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;yBAC1C;wBAAC,OAAO,CAAC,EAAE;4BACR,OAAO,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;4BAC1B,sBAAO;yBACV;wBAEA,qBAAM,GAAG,CAAC,QAAQ,EAAE,EAAA;;wBAArB,KAAA,CAAA,KAAA,CAAC,SAAoB,CAAC,CAAA,CAAC,OAAO,CAAA;wBAAC,qBAAM,GAAG,CAAC,MAAM,EAAE,EAAA;;wBAAjD,cAA+B,SAAkB,EAAE,IAAI,EAAC,CAAC;wBACzD,qBAAM,iBAAM,OAAO,WAAE,EAAA;;wBAArB,SAAqB,CAAC;;;;;KACzB;IAfsB,sBAAQ,GAAY,KAAK,CAAC;IADxC,aAAa;QADzB,mBAAQ,CAAC,SAAS,CAAC,UAAU,CAAC;OAClB,aAAa,CAiBzB;IAAD,oBAAC;CAAA,AAjBD,CAAmC,qBAAS,GAiB3C;AAjBY,sCAAa"}
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TypeAttribute = exports.Template = exports.StyleAttribute = exports.StandardAttribute = exports.SetAttribute = exports.ScopeChange = exports.ScopeAttribute = exports.RootAttribute = exports.Referenced = exports.Radio = exports.On = exports.Name = exports.ModelAttribute = exports.ListItemModel = exports.ListItem = exports.List = exports.KeyUp = exports.KeyDown = exports.JSONAttribute = exports.If = exports.Format = exports.Exec = exports.DisableIf = exports.ControllerAttribute = exports.ClickToggleClass = exports.ClickRemoveClass = exports.Bind = exports.AddClassIf = void 0;
4
+ var AddClassIf_1 = require("./AddClassIf");
5
+ Object.defineProperty(exports, "AddClassIf", { enumerable: true, get: function () { return AddClassIf_1.AddClassIf; } });
6
+ var Bind_1 = require("./Bind");
7
+ Object.defineProperty(exports, "Bind", { enumerable: true, get: function () { return Bind_1.Bind; } });
8
+ var ClickRemoveClass_1 = require("./ClickRemoveClass");
9
+ Object.defineProperty(exports, "ClickRemoveClass", { enumerable: true, get: function () { return ClickRemoveClass_1.ClickRemoveClass; } });
10
+ var ClickToggleClass_1 = require("./ClickToggleClass");
11
+ Object.defineProperty(exports, "ClickToggleClass", { enumerable: true, get: function () { return ClickToggleClass_1.ClickToggleClass; } });
12
+ var ControllerAttribute_1 = require("./ControllerAttribute");
13
+ Object.defineProperty(exports, "ControllerAttribute", { enumerable: true, get: function () { return ControllerAttribute_1.ControllerAttribute; } });
14
+ var DisableIf_1 = require("./DisableIf");
15
+ Object.defineProperty(exports, "DisableIf", { enumerable: true, get: function () { return DisableIf_1.DisableIf; } });
16
+ var Exec_1 = require("./Exec");
17
+ Object.defineProperty(exports, "Exec", { enumerable: true, get: function () { return Exec_1.Exec; } });
18
+ var Format_1 = require("./Format");
19
+ Object.defineProperty(exports, "Format", { enumerable: true, get: function () { return Format_1.Format; } });
20
+ var If_1 = require("./If");
21
+ Object.defineProperty(exports, "If", { enumerable: true, get: function () { return If_1.If; } });
22
+ var JSONAttribute_1 = require("./JSONAttribute");
23
+ Object.defineProperty(exports, "JSONAttribute", { enumerable: true, get: function () { return JSONAttribute_1.JSONAttribute; } });
24
+ var KeyDown_1 = require("./KeyDown");
25
+ Object.defineProperty(exports, "KeyDown", { enumerable: true, get: function () { return KeyDown_1.KeyDown; } });
26
+ var KeyUp_1 = require("./KeyUp");
27
+ Object.defineProperty(exports, "KeyUp", { enumerable: true, get: function () { return KeyUp_1.KeyUp; } });
28
+ var List_1 = require("./List");
29
+ Object.defineProperty(exports, "List", { enumerable: true, get: function () { return List_1.List; } });
30
+ var ListItem_1 = require("./ListItem");
31
+ Object.defineProperty(exports, "ListItem", { enumerable: true, get: function () { return ListItem_1.ListItem; } });
32
+ var ListItemModel_1 = require("./ListItemModel");
33
+ Object.defineProperty(exports, "ListItemModel", { enumerable: true, get: function () { return ListItemModel_1.ListItemModel; } });
34
+ var ModelAttribute_1 = require("./ModelAttribute");
35
+ Object.defineProperty(exports, "ModelAttribute", { enumerable: true, get: function () { return ModelAttribute_1.ModelAttribute; } });
36
+ var Name_1 = require("./Name");
37
+ Object.defineProperty(exports, "Name", { enumerable: true, get: function () { return Name_1.Name; } });
38
+ var On_1 = require("./On");
39
+ Object.defineProperty(exports, "On", { enumerable: true, get: function () { return On_1.On; } });
40
+ var Radio_1 = require("./Radio");
41
+ Object.defineProperty(exports, "Radio", { enumerable: true, get: function () { return Radio_1.Radio; } });
42
+ var Referenced_1 = require("./Referenced");
43
+ Object.defineProperty(exports, "Referenced", { enumerable: true, get: function () { return Referenced_1.Referenced; } });
44
+ var RootAttribute_1 = require("./RootAttribute");
45
+ Object.defineProperty(exports, "RootAttribute", { enumerable: true, get: function () { return RootAttribute_1.RootAttribute; } });
46
+ var ScopeAttribute_1 = require("./ScopeAttribute");
47
+ Object.defineProperty(exports, "ScopeAttribute", { enumerable: true, get: function () { return ScopeAttribute_1.ScopeAttribute; } });
48
+ var ScopeChange_1 = require("./ScopeChange");
49
+ Object.defineProperty(exports, "ScopeChange", { enumerable: true, get: function () { return ScopeChange_1.ScopeChange; } });
50
+ var SetAttribute_1 = require("./SetAttribute");
51
+ Object.defineProperty(exports, "SetAttribute", { enumerable: true, get: function () { return SetAttribute_1.SetAttribute; } });
52
+ var StandardAttribute_1 = require("./StandardAttribute");
53
+ Object.defineProperty(exports, "StandardAttribute", { enumerable: true, get: function () { return StandardAttribute_1.StandardAttribute; } });
54
+ var StyleAttribute_1 = require("./StyleAttribute");
55
+ Object.defineProperty(exports, "StyleAttribute", { enumerable: true, get: function () { return StyleAttribute_1.StyleAttribute; } });
56
+ var Template_1 = require("./Template");
57
+ Object.defineProperty(exports, "Template", { enumerable: true, get: function () { return Template_1.Template; } });
58
+ var TypeAttribute_1 = require("./TypeAttribute");
59
+ Object.defineProperty(exports, "TypeAttribute", { enumerable: true, get: function () { return TypeAttribute_1.TypeAttribute; } });
60
+ //# sourceMappingURL=_imports.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_imports.js","sourceRoot":"","sources":["../../src/attributes/_imports.ts"],"names":[],"mappings":";;;AAAA,2CAAwC;AAAhC,wGAAA,UAAU,OAAA;AAClB,+BAA4B;AAApB,4FAAA,IAAI,OAAA;AACZ,uDAAoD;AAA5C,oHAAA,gBAAgB,OAAA;AACxB,uDAAoD;AAA5C,oHAAA,gBAAgB,OAAA;AACxB,6DAA0D;AAAlD,0HAAA,mBAAmB,OAAA;AAC3B,yCAAsC;AAA9B,sGAAA,SAAS,OAAA;AACjB,+BAA4B;AAApB,4FAAA,IAAI,OAAA;AACZ,mCAAgC;AAAxB,gGAAA,MAAM,OAAA;AACd,2BAAwB;AAAhB,wFAAA,EAAE,OAAA;AACV,iDAA8C;AAAtC,8GAAA,aAAa,OAAA;AACrB,qCAAkC;AAA1B,kGAAA,OAAO,OAAA;AACf,iCAA8B;AAAtB,8FAAA,KAAK,OAAA;AACb,+BAA4B;AAApB,4FAAA,IAAI,OAAA;AACZ,uCAAoC;AAA5B,oGAAA,QAAQ,OAAA;AAChB,iDAA8C;AAAtC,8GAAA,aAAa,OAAA;AACrB,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,+BAA4B;AAApB,4FAAA,IAAI,OAAA;AACZ,2BAAwB;AAAhB,wFAAA,EAAE,OAAA;AACV,iCAA8B;AAAtB,8FAAA,KAAK,OAAA;AACb,2CAAwC;AAAhC,wGAAA,UAAU,OAAA;AAClB,iDAA8C;AAAtC,8GAAA,aAAa,OAAA;AACrB,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,6CAA0C;AAAlC,0GAAA,WAAW,OAAA;AACnB,+CAA4C;AAApC,4GAAA,YAAY,OAAA;AACpB,yDAAsD;AAA9C,sHAAA,iBAAiB,OAAA;AACzB,mDAAgD;AAAxC,gHAAA,cAAc,OAAA;AACtB,uCAAoC;AAA5B,oGAAA,QAAQ,OAAA;AAChB,iDAA8C;AAAtC,8GAAA,aAAa,OAAA"}
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __generator = (this && this.__generator) || function (thisArg, body) {
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
+ function verb(n) { return function (v) { return step([n, v]); }; }
15
+ function step(op) {
16
+ if (f) throw new TypeError("Generator is already executing.");
17
+ while (_) try {
18
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
19
+ if (y = 0, t) op = [op[0] & 2, t.value];
20
+ switch (op[0]) {
21
+ case 0: case 1: t = op; break;
22
+ case 4: _.label++; return { value: op[1], done: false };
23
+ case 5: _.label++; y = op[1]; op = [0]; continue;
24
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
25
+ default:
26
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
27
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
28
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
29
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
30
+ if (t[2]) _.ops.pop();
31
+ _.trys.pop(); continue;
32
+ }
33
+ op = body.call(thisArg, _);
34
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
35
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
+ }
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.DOMHelper = void 0;
40
+ var DOMHelper = /** @class */ (function () {
41
+ function DOMHelper() {
42
+ }
43
+ DOMHelper.walk = function (e, fnc, callOnBaseElement) {
44
+ if (callOnBaseElement === void 0) { callOnBaseElement = true; }
45
+ return __awaiter(this, void 0, void 0, function () {
46
+ var len, i;
47
+ return __generator(this, function (_a) {
48
+ switch (_a.label) {
49
+ case 0:
50
+ if (!callOnBaseElement) return [3 /*break*/, 2];
51
+ return [4 /*yield*/, fnc(e)];
52
+ case 1:
53
+ _a.sent();
54
+ _a.label = 2;
55
+ case 2:
56
+ len = e.childNodes.length;
57
+ if (len <= 0)
58
+ return [2 /*return*/];
59
+ i = 0;
60
+ _a.label = 3;
61
+ case 3:
62
+ if (!(i < len)) return [3 /*break*/, 6];
63
+ if (!e.childNodes[i]) {
64
+ return [3 /*break*/, 5];
65
+ }
66
+ return [4 /*yield*/, DOMHelper.walk(e.childNodes[i], fnc, true)];
67
+ case 4:
68
+ _a.sent();
69
+ _a.label = 5;
70
+ case 5:
71
+ i++;
72
+ return [3 /*break*/, 3];
73
+ case 6: return [2 /*return*/];
74
+ }
75
+ });
76
+ });
77
+ };
78
+ return DOMHelper;
79
+ }());
80
+ exports.DOMHelper = DOMHelper;
81
+ //# sourceMappingURL=DOMHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DOMHelper.js","sourceRoot":"","sources":["../../src/helpers/DOMHelper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA;IAAA;IAeA,CAAC;IAduB,cAAI,GAAxB,UAAyB,CAAc,EAAE,GAA6B,EAAE,iBAAiC;QAAjC,kCAAA,EAAA,wBAAiC;;;;;;6BACjG,iBAAiB,EAAjB,wBAAiB;wBACjB,qBAAM,GAAG,CAAC,CAAC,CAAC,EAAA;;wBAAZ,SAAY,CAAC;;;wBAEX,GAAG,GAAW,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC;wBACxC,IAAI,GAAG,IAAI,CAAC;4BAAE,sBAAO;wBACZ,CAAC,GAAG,CAAC;;;6BAAE,CAAA,CAAC,GAAG,GAAG,CAAA;wBACnB,IAAG,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,EAAC;4BAChB,wBAAS;yBACZ;wBAED,qBAAM,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAgB,EAAE,GAAG,EAAE,IAAI,CAAC,EAAA;;wBAA/D,SAA+D,CAAC;;;wBAL3C,CAAC,EAAE,CAAA;;;;;;KAO/B;IACL,gBAAC;AAAD,CAAC,AAfD,IAeC;AAfY,8BAAS"}
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ElementHelper = void 0;
4
+ var ElementHelper = /** @class */ (function () {
5
+ function ElementHelper() {
6
+ }
7
+ ElementHelper.hasVisionAttribute = function (element, testAttr) {
8
+ if (testAttr === void 0) { testAttr = 'vsn-'; }
9
+ if (!element.attributes || element.attributes.length <= 0)
10
+ return false;
11
+ for (var i = 0; i < element.attributes.length; i++) {
12
+ var attr = element.attributes[i];
13
+ if (attr.name.startsWith(testAttr)) {
14
+ return true;
15
+ }
16
+ }
17
+ return false;
18
+ };
19
+ ElementHelper.normalizeElementID = function (id) {
20
+ return id ? id.replace(/-([a-zA-Z0-9])/g, function (g) { return g[1].toUpperCase(); }) : null;
21
+ };
22
+ return ElementHelper;
23
+ }());
24
+ exports.ElementHelper = ElementHelper;
25
+ //# sourceMappingURL=ElementHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ElementHelper.js","sourceRoot":"","sources":["../../src/helpers/ElementHelper.ts"],"names":[],"mappings":";;;AACA;IAAA;IAiBA,CAAC;IAhBiB,gCAAkB,GAAhC,UAAiC,OAA8B,EAAE,QAAyB;QAAzB,yBAAA,EAAA,iBAAyB;QACtF,IAAI,CAAC,OAAO,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,MAAM,IAAI,CAAC;YAAE,OAAO,KAAK,CAAC;QACxE,KAAK,IAAI,CAAC,GAAW,CAAC,EAAE,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACxD,IAAM,IAAI,GAAS,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;YACzC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAClC;gBACI,OAAO,IAAI,CAAC;aACf;SACJ;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEa,gCAAkB,GAAhC,UAAiC,EAAU;QACvC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,OAAO,CAAC,iBAAiB,EAAE,UAAU,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAClG,CAAC;IACL,oBAAC;AAAD,CAAC,AAjBD,IAiBC;AAjBY,sCAAa"}
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.VisionHelper = void 0;
4
+ var VisionHelper = /** @class */ (function () {
5
+ function VisionHelper() {
6
+ }
7
+ VisionHelper.isConstructor = function (obj) {
8
+ return obj &&
9
+ obj.hasOwnProperty("prototype") &&
10
+ !!obj.prototype &&
11
+ !!obj.prototype.constructor &&
12
+ !!obj.prototype.constructor.name;
13
+ };
14
+ Object.defineProperty(VisionHelper, "document", {
15
+ get: function () {
16
+ return typeof document === 'object' ? document : null;
17
+ },
18
+ enumerable: false,
19
+ configurable: true
20
+ });
21
+ Object.defineProperty(VisionHelper, "window", {
22
+ get: function () {
23
+ return typeof window === 'object' ? window : null;
24
+ },
25
+ enumerable: false,
26
+ configurable: true
27
+ });
28
+ VisionHelper.isMobile = function () {
29
+ var check = false;
30
+ if (navigator && VisionHelper.window) {
31
+ (function (a) {
32
+ if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4)))
33
+ check = true;
34
+ })(navigator.userAgent || navigator.vendor || window['opera']);
35
+ }
36
+ return check;
37
+ };
38
+ Object.defineProperty(VisionHelper, "inDevelopment", {
39
+ get: function () {
40
+ return IN_DEVELOPMENT;
41
+ },
42
+ enumerable: false,
43
+ configurable: true
44
+ });
45
+ Object.defineProperty(VisionHelper, "doBenchmark", {
46
+ get: function () {
47
+ return DO_BENCHMARK;
48
+ },
49
+ enumerable: false,
50
+ configurable: true
51
+ });
52
+ Object.defineProperty(VisionHelper, "inLegacy", {
53
+ get: function () {
54
+ return process.env.BUILD_TARGET === 'es5';
55
+ },
56
+ enumerable: false,
57
+ configurable: true
58
+ });
59
+ VisionHelper.nice = function (callback, timeout) {
60
+ if (timeout === void 0) { timeout = 100; }
61
+ if (VisionHelper.window && window['requestIdleCallback']) {
62
+ window['requestIdleCallback'](callback);
63
+ }
64
+ else {
65
+ setTimeout(callback, timeout);
66
+ }
67
+ };
68
+ return VisionHelper;
69
+ }());
70
+ exports.VisionHelper = VisionHelper;
71
+ //# sourceMappingURL=VisionHelper.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisionHelper.js","sourceRoot":"","sources":["../../src/helpers/VisionHelper.ts"],"names":[],"mappings":";;;AAGA;IAAA;IA8CA,CAAC;IA7CiB,0BAAa,GAA3B,UAA4B,GAAQ;QAChC,OAAO,GAAG;YACN,GAAG,CAAC,cAAc,CAAC,WAAW,CAAC;YAC/B,CAAC,CAAC,GAAG,CAAC,SAAS;YACf,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW;YAC3B,CAAC,CAAC,GAAG,CAAC,SAAS,CAAC,WAAW,CAAC,IAAI,CAAC;IACzC,CAAC;IAED,sBAAkB,wBAAQ;aAA1B;YACI,OAAO,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;QAC1D,CAAC;;;OAAA;IAED,sBAAkB,sBAAM;aAAxB;YACI,OAAO,OAAO,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;QACtD,CAAC;;;OAAA;IAEa,qBAAQ,GAAtB;QACI,IAAI,KAAK,GAAG,KAAK,CAAC;QAClB,IAAI,SAAS,IAAI,YAAY,CAAC,MAAM,EAAE;YAClC,CAAC,UAAU,CAAC;gBACR,IAAI,0TAA0T,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,ykDAAykD,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;oBAAE,KAAK,GAAG,IAAI,CAAC;YAC37D,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,IAAI,SAAS,CAAC,MAAM,IAAI,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;SAClE;QACD,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,sBAAkB,6BAAa;aAA/B;YACI,OAAO,cAAc,CAAC;QAC1B,CAAC;;;OAAA;IAED,sBAAkB,2BAAW;aAA7B;YACI,OAAO,YAAY,CAAC;QACxB,CAAC;;;OAAA;IAED,sBAAkB,wBAAQ;aAA1B;YACI,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,KAAK,KAAK,CAAC;QAC9C,CAAC;;;OAAA;IAEa,iBAAI,GAAlB,UAAmB,QAAQ,EAAE,OAAqB;QAArB,wBAAA,EAAA,aAAqB;QAC9C,IAAI,YAAY,CAAC,MAAM,IAAI,MAAM,CAAC,qBAAqB,CAAC,EAAE;YACtD,MAAM,CAAC,qBAAqB,CAAC,CAAC,QAAQ,CAAC,CAAC;SAC3C;aAAM;YACH,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;SACjC;IACL,CAAC;IACL,mBAAC;AAAD,CAAC,AA9CD,IA8CC;AA9CY,oCAAY"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.extendsarray = void 0;
19
+ function extendsarray(target) {
20
+ return /** @class */ (function (_super) {
21
+ __extends(class_1, _super);
22
+ function class_1() {
23
+ var args = [];
24
+ for (var _i = 0; _i < arguments.length; _i++) {
25
+ args[_i] = arguments[_i];
26
+ }
27
+ var _this = _super.apply(this, args) || this;
28
+ for (var c in target.prototype) {
29
+ _this[c] = target.prototype[c];
30
+ }
31
+ return _this;
32
+ }
33
+ return class_1;
34
+ }(target));
35
+ ;
36
+ }
37
+ exports.extendsarray = extendsarray;
38
+ //# sourceMappingURL=decorators.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"decorators.js","sourceRoot":"","sources":["../../src/helpers/decorators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AACA,SAAgB,YAAY,CAAyC,MAAS;IAC1E;QAAqB,2BAAM;QACvB;YAAY,cAAO;iBAAP,UAAO,EAAP,qBAAO,EAAP,IAAO;gBAAP,yBAAO;;YAAnB,+BACa,IAAI,UAIhB;YAHG,KAAK,IAAM,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE;gBAC9B,KAAI,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;aACjC;;QACL,CAAC;QACL,cAAC;IAAD,CAAC,AAPM,CAAc,MAAM,GAOzB;IAAA,CAAC;AACP,CAAC;AATD,oCASC"}
package/dist/vsn.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { DOM } from "./DOM";
2
- import { EventDispatcher } from "simple-ts-event-dispatcher";
3
2
  import { Registry } from "./Registry";
4
3
  import "./Types";
5
4
  import "./Formats";
6
5
  import { Configuration } from "./Configuration";
6
+ import { EventDispatcher } from "./EventDispatcher";
7
7
  export declare class Vision extends EventDispatcher {
8
8
  protected static _instance: Vision;
9
9
  protected _dom?: DOM;
@@ -22,4 +22,5 @@ export * from './AST';
22
22
  export { DOM } from './DOM';
23
23
  export { WrappedArray, Scope, ScopeReference } from './Scope';
24
24
  export { Controller } from './Controller';
25
+ export { Tag } from './Tag';
25
26
  export declare const vision: Vision;
package/dist/vsn.js ADDED
@@ -0,0 +1,166 @@
1
+ "use strict";
2
+ var __extends = (this && this.__extends) || (function () {
3
+ var extendStatics = function (d, b) {
4
+ extendStatics = Object.setPrototypeOf ||
5
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
7
+ return extendStatics(d, b);
8
+ };
9
+ return function (d, b) {
10
+ if (typeof b !== "function" && b !== null)
11
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
12
+ extendStatics(d, b);
13
+ function __() { this.constructor = d; }
14
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15
+ };
16
+ })();
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
20
+ }) : (function(o, m, k, k2) {
21
+ if (k2 === undefined) k2 = k;
22
+ o[k2] = m[k];
23
+ }));
24
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
25
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
26
+ };
27
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
28
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
29
+ return new (P || (P = Promise))(function (resolve, reject) {
30
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
31
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
32
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
33
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
34
+ });
35
+ };
36
+ var __generator = (this && this.__generator) || function (thisArg, body) {
37
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
38
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
39
+ function verb(n) { return function (v) { return step([n, v]); }; }
40
+ function step(op) {
41
+ if (f) throw new TypeError("Generator is already executing.");
42
+ while (_) try {
43
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
44
+ if (y = 0, t) op = [op[0] & 2, t.value];
45
+ switch (op[0]) {
46
+ case 0: case 1: t = op; break;
47
+ case 4: _.label++; return { value: op[1], done: false };
48
+ case 5: _.label++; y = op[1]; op = [0]; continue;
49
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
50
+ default:
51
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
52
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
53
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
54
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
55
+ if (t[2]) _.ops.pop();
56
+ _.trys.pop(); continue;
57
+ }
58
+ op = body.call(thisArg, _);
59
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
60
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
61
+ }
62
+ };
63
+ Object.defineProperty(exports, "__esModule", { value: true });
64
+ exports.vision = exports.Tag = exports.Controller = exports.ScopeReference = exports.Scope = exports.WrappedArray = exports.DOM = exports.Vision = void 0;
65
+ var DOM_1 = require("./DOM");
66
+ var Scope_1 = require("./Scope");
67
+ var Registry_1 = require("./Registry");
68
+ require("./Types");
69
+ require("./Formats");
70
+ var Configuration_1 = require("./Configuration");
71
+ var VisionHelper_1 = require("./helpers/VisionHelper");
72
+ var AST_1 = require("./AST");
73
+ var Query_1 = require("./Query");
74
+ var EventDispatcher_1 = require("./EventDispatcher");
75
+ var DataModel_1 = require("./Model/DataModel");
76
+ var Vision = /** @class */ (function (_super) {
77
+ __extends(Vision, _super);
78
+ function Vision() {
79
+ var _this = _super.call(this) || this;
80
+ _this.registry = Registry_1.Registry.instance;
81
+ _this.config = Configuration_1.Configuration.instance;
82
+ if (VisionHelper_1.VisionHelper.document) {
83
+ document.addEventListener("DOMContentLoaded", _this.setup.bind(_this));
84
+ }
85
+ else {
86
+ console.warn('No dom, running in CLI mode.');
87
+ }
88
+ _this.registry.classes.register('Object', Object);
89
+ _this.registry.classes.register('WrappedArray', Scope_1.WrappedArray);
90
+ _this.registry.classes.register('DataModel', DataModel_1.DataModel);
91
+ if (VisionHelper_1.VisionHelper.window) {
92
+ window['Vision'] = Vision;
93
+ window['Registry'] = Registry_1.Registry;
94
+ window['vision'] = window['vsn'] = _this;
95
+ window['Tree'] = AST_1.Tree;
96
+ window['$'] = Query_1.Query;
97
+ VisionHelper_1.VisionHelper.window.dispatchEvent(new Event('vsn'));
98
+ }
99
+ return _this;
100
+ }
101
+ Object.defineProperty(Vision.prototype, "dom", {
102
+ get: function () {
103
+ return this._dom;
104
+ },
105
+ enumerable: false,
106
+ configurable: true
107
+ });
108
+ Vision.prototype.eval = function (code) {
109
+ return __awaiter(this, void 0, void 0, function () {
110
+ return __generator(this, function (_a) {
111
+ switch (_a.label) {
112
+ case 0: return [4 /*yield*/, this._dom.eval(code)];
113
+ case 1: return [2 /*return*/, _a.sent()];
114
+ }
115
+ });
116
+ });
117
+ };
118
+ Vision.prototype.setup = function () {
119
+ return __awaiter(this, void 0, void 0, function () {
120
+ var body, startTime, now, setupTime;
121
+ return __generator(this, function (_a) {
122
+ switch (_a.label) {
123
+ case 0:
124
+ body = document.body;
125
+ body.setAttribute('vsn-root', '');
126
+ this._dom = DOM_1.DOM.instance;
127
+ startTime = new Date().getTime();
128
+ return [4 /*yield*/, this._dom.buildFrom(document, true)];
129
+ case 1:
130
+ _a.sent();
131
+ now = (new Date()).getTime();
132
+ setupTime = now - startTime;
133
+ console.warn("Took " + setupTime + "ms to start up VisionJS. https://www.vsnjs.com/");
134
+ return [2 /*return*/];
135
+ }
136
+ });
137
+ });
138
+ };
139
+ Object.defineProperty(Vision, "instance", {
140
+ get: function () {
141
+ if (!Vision._instance)
142
+ Vision._instance = new Vision();
143
+ return Vision._instance;
144
+ },
145
+ enumerable: false,
146
+ configurable: true
147
+ });
148
+ return Vision;
149
+ }(EventDispatcher_1.EventDispatcher));
150
+ exports.Vision = Vision;
151
+ __exportStar(require("./attributes/_imports"), exports);
152
+ __exportStar(require("./Registry"), exports);
153
+ __exportStar(require("./Attribute"), exports);
154
+ __exportStar(require("./AST"), exports);
155
+ var DOM_2 = require("./DOM");
156
+ Object.defineProperty(exports, "DOM", { enumerable: true, get: function () { return DOM_2.DOM; } });
157
+ var Scope_2 = require("./Scope");
158
+ Object.defineProperty(exports, "WrappedArray", { enumerable: true, get: function () { return Scope_2.WrappedArray; } });
159
+ Object.defineProperty(exports, "Scope", { enumerable: true, get: function () { return Scope_2.Scope; } });
160
+ Object.defineProperty(exports, "ScopeReference", { enumerable: true, get: function () { return Scope_2.ScopeReference; } });
161
+ var Controller_1 = require("./Controller");
162
+ Object.defineProperty(exports, "Controller", { enumerable: true, get: function () { return Controller_1.Controller; } });
163
+ var Tag_1 = require("./Tag");
164
+ Object.defineProperty(exports, "Tag", { enumerable: true, get: function () { return Tag_1.Tag; } });
165
+ exports.vision = Vision.instance;
166
+ //# sourceMappingURL=vsn.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vsn.js","sourceRoot":"","sources":["../src/vsn.ts"],"names":[],"mappings":"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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vsn",
3
- "version": "0.1.26",
3
+ "version": "0.1.27",
4
4
  "description": "SEO Friendly Javascript/Typescript Framework",
5
5
  "keywords": [
6
6
  "framework",
@@ -17,11 +17,7 @@
17
17
  "sample": "rm -rf sample/dist/ && tsc -p sample/ && node sample/dist/sample/index.js"
18
18
  },
19
19
  "license": "MIT",
20
- "dependencies": {
21
- "simple-ts-event-dispatcher": "^0.1.6",
22
- "simple-ts-models": "^0.1.3",
23
- "simple-ts-promise": "^0.1.6"
24
- },
20
+ "dependencies": {},
25
21
  "devDependencies": {
26
22
  "@types/jasmine": "^3.6.10",
27
23
  "codecov": "^3.8.1",
package/src/AST.ts CHANGED
@@ -1090,7 +1090,7 @@ class ArithmeticAssignmentNode extends Node implements TreeNode {
1090
1090
  We have to trigger a change manually here. Setting the variable on the scope with an array won't trigger
1091
1091
  it since we are modifying values inside of the array instance.
1092
1092
  */
1093
- scope.trigger(`change:${key}`);
1093
+ scope.dispatch(`change:${key}`);
1094
1094
 
1095
1095
  return left;
1096
1096
  }
@@ -1444,7 +1444,7 @@ export class Tree {
1444
1444
  }
1445
1445
 
1446
1446
  const name = await node.name.evaluate(scope, dom, tag);
1447
- _scope.bind(`change:${name}`, fnc);
1447
+ _scope.on(`change:${name}`, fnc);
1448
1448
  }
1449
1449
  }
1450
1450