spyne 0.19.0 → 0.20.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 (129) hide show
  1. package/.eslintrc.js +4 -3
  2. package/.travis.yml +24 -11
  3. package/karma.conf.js +76 -86
  4. package/lib/spyne.esm.js +15 -0
  5. package/lib/spyne.esm.js.map +1 -0
  6. package/lib/spyne.umd.js +9565 -0
  7. package/package.json +46 -26
  8. package/rollup.config.js +26 -0
  9. package/src/spyne/channels/channel-fetch-class.js +39 -43
  10. package/src/spyne/channels/channel-payload-class.js +61 -74
  11. package/src/spyne/channels/channel-proxy.js +25 -26
  12. package/src/spyne/channels/channel.js +141 -149
  13. package/src/spyne/channels/channels-config.js +46 -47
  14. package/src/spyne/channels/channels-map.js +61 -65
  15. package/src/spyne/channels/spyne-channel-lifecycle.js +12 -12
  16. package/src/spyne/channels/spyne-channel-route.js +241 -250
  17. package/src/spyne/channels/spyne-channel-ui.js +213 -75
  18. package/src/spyne/channels/spyne-channel-window.js +157 -157
  19. package/src/spyne/spyne-app.js +32 -19
  20. package/src/spyne/spyne-plugins.js +55 -70
  21. package/src/spyne/spyne.js +23 -23
  22. package/src/spyne/utils/channel-config-validator.js +10 -10
  23. package/src/spyne/utils/channel-fetch-util.js +72 -55
  24. package/src/spyne/utils/channel-payload-filter.js +89 -100
  25. package/src/spyne/utils/deep-merge.js +31 -29
  26. package/src/spyne/utils/frp-tools.js +108 -92
  27. package/src/spyne/utils/gc.js +6 -6
  28. package/src/spyne/utils/mixins/base-core-mixins.js +17 -15
  29. package/src/spyne/utils/mixins/base-streams-mixins.js +9 -9
  30. package/src/spyne/utils/route-channel-updater.js +23 -29
  31. package/src/spyne/utils/safe-clone.js +40 -58
  32. package/src/spyne/utils/sanitize-html.js +35 -0
  33. package/src/spyne/utils/security-policy.js +11 -0
  34. package/src/spyne/utils/spyne-app-properties.js +110 -114
  35. package/src/spyne/utils/spyne-logger.js +4 -11
  36. package/src/spyne/utils/spyne-plugins-methods.js +38 -63
  37. package/src/spyne/utils/spyne-trait.js +33 -33
  38. package/src/spyne/utils/spyne-utils-channel-route-url.js +229 -153
  39. package/src/spyne/utils/spyne-utils-channel-route.js +128 -138
  40. package/src/spyne/utils/spyne-utils-channel-window.js +39 -39
  41. package/src/spyne/utils/viewstream-animations.js +12 -12
  42. package/src/spyne/utils/viewstream-observables.js +45 -45
  43. package/src/spyne/views/dom-element-template.js +111 -114
  44. package/src/spyne/views/dom-element.js +82 -84
  45. package/src/spyne/views/view-stream-broadcaster.js +66 -62
  46. package/src/spyne/views/view-stream-element.js +105 -106
  47. package/src/spyne/views/view-stream-payload.js +25 -27
  48. package/src/spyne/views/view-stream-selector.js +157 -163
  49. package/src/spyne/views/view-stream.js +416 -640
  50. package/src/tests/channels/channel-dom.test.js +15 -15
  51. package/src/tests/channels/channel-fetch.test.js +51 -62
  52. package/src/tests/channels/channel-payload-class.test.js +50 -63
  53. package/src/tests/channels/channel-payload-filter.test.js +133 -193
  54. package/src/tests/channels/channel-route.test.js +102 -112
  55. package/src/tests/channels/channel-stream-item.test.js +19 -19
  56. package/src/tests/channels/channel-ui.test.js +15 -27
  57. package/src/tests/channels/channel-util-dom.test.js +31 -31
  58. package/src/tests/channels/channel.test.js +20 -25
  59. package/src/tests/channels/route-utils.test.js +61 -66
  60. package/src/tests/channels/url-utils.test.js +151 -151
  61. package/src/tests/channels/view-stream-broadcaster.test.js +7 -7
  62. package/src/tests/import.test.js +5 -5
  63. package/src/tests/index.js +6 -7
  64. package/src/tests/index.test.js +6 -8
  65. package/src/tests/mocks/channel-payload-data.js +218 -220
  66. package/src/tests/mocks/enhancer.test.js +5 -5
  67. package/src/tests/mocks/payload-ui.js +87 -90
  68. package/src/tests/mocks/routes-data.js +264 -266
  69. package/src/tests/mocks/spyne-docs.mocks.js +3 -3
  70. package/src/tests/mocks/template-renderer.mocks.js +47 -47
  71. package/src/tests/mocks/utils-data.js +78 -79
  72. package/src/tests/mocks/viewstream-internal-payload.mocks.js +50 -50
  73. package/src/tests/mocks/window-events-arr.js +1 -1
  74. package/src/tests/package-json.spec.test.js +9 -0
  75. package/src/tests/spyne-app.test.js +15 -18
  76. package/src/tests/spyne-plugin.test.js +16 -20
  77. package/src/tests/utils/channel-action-filter.test.js +84 -86
  78. package/src/tests/utils/channel-data-packet-generator.unused.js +62 -86
  79. package/src/tests/utils/channel-fetch-util.test.js +64 -66
  80. package/src/tests/utils/frp-tools.test.js +19 -19
  81. package/src/tests/utils/plugins-methods.test.js +31 -55
  82. package/src/tests/utils/security.test.js +10 -0
  83. package/src/tests/utils/spyne-app-properties.test.js +4 -8
  84. package/src/tests/views/dom-el-selectors.test.js +112 -119
  85. package/src/tests/views/dom-el-template-proxy.test.js +7 -0
  86. package/src/tests/views/dom-el-template.test.js +186 -156
  87. package/src/tests/views/dom-el.test.js +58 -56
  88. package/src/tests/views/view-stream-enhancer-loader.test.js +2 -2
  89. package/src/tests/views/view-stream-enhancer.test.js +11 -11
  90. package/src/tests/views/view-stream.test.js +22 -33
  91. package/webpack.config.js +76 -67
  92. package/docs/-_%20Solves%20equations%20of%20the%20form%20a%20_%20x%20=%20b.html +0 -487
  93. package/docs/DomItem.html +0 -298
  94. package/docs/DomItem_DomItem.html +0 -314
  95. package/docs/ViewStream.html +0 -2249
  96. package/docs/ViewStream_ViewStream.html +0 -503
  97. package/docs/custom/css/jsdoc-viewstream.css +0 -377
  98. package/docs/custom/layout.tmpl +0 -47
  99. package/docs/dom-item.js.html +0 -213
  100. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  101. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  102. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  103. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  104. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  105. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  106. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  107. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  108. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  109. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  110. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  111. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  112. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  113. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  114. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  115. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  116. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  117. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  118. package/docs/global.html +0 -548
  119. package/docs/index-custom.html +0 -79
  120. package/docs/index.html +0 -82
  121. package/docs/jsdoc.config.json +0 -22
  122. package/docs/scripts/linenumber.js +0 -25
  123. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  124. package/docs/scripts/prettify/lang-css.js +0 -2
  125. package/docs/scripts/prettify/prettify.js +0 -28
  126. package/docs/styles/jsdoc-default.css +0 -358
  127. package/docs/styles/prettify-jsdoc.css +0 -111
  128. package/docs/styles/prettify-tomorrow.css +0 -132
  129. package/docs/view-stream.js.html +0 -767
@@ -1,84 +1,84 @@
1
1
  const starWarsData = {
2
2
 
3
- 'name': 'Rodolfo',
3
+ name: 'Rodolfo',
4
4
 
5
- 'characters': ['Dart Vader', 'Yoda', 'Porgi', 'Princess Leia'],
5
+ characters: ['Dart Vader', 'Yoda', 'Porgi', 'Princess Leia'],
6
6
 
7
- 'movies': [
7
+ movies: [
8
8
  {
9
- 'title': 'A New Hope',
10
- 'year': '1977'
9
+ title: 'A New Hope',
10
+ year: '1977'
11
11
  },
12
12
  {
13
- 'title': 'Attack of the Clones',
14
- 'year': '2002'
13
+ title: 'Attack of the Clones',
14
+ year: '2002'
15
15
  },
16
16
  {
17
- 'title': 'The Phantom Menace',
18
- 'year': '1999'
17
+ title: 'The Phantom Menace',
18
+ year: '1999'
19
19
  },
20
20
  {
21
- 'title': 'Revenge of the Sith',
22
- 'year': '2005'
21
+ title: 'Revenge of the Sith',
22
+ year: '2005'
23
23
  },
24
24
  {
25
- 'title': 'Return of the Jedi',
26
- 'year': '1983'
25
+ title: 'Return of the Jedi',
26
+ year: '1983'
27
27
  },
28
28
  {
29
- 'title': 'The Empire Strikes Back',
30
- 'year': '1980'
29
+ title: 'The Empire Strikes Back',
30
+ year: '1980'
31
31
  },
32
32
  {
33
- 'title': 'The Force Awakens',
34
- 'year': '2015'
33
+ title: 'The Force Awakens',
34
+ year: '2015'
35
35
  }
36
36
  ]
37
- };
37
+ }
38
38
 
39
39
  // ====================
40
40
 
41
- const ScriptTemplate = document.createElement('script');
41
+ const ScriptTemplate = document.createElement('script')
42
42
 
43
- const theDiv = document.createElement('div');
43
+ const theDiv = document.createElement('div')
44
44
 
45
- const theH1 = document.createElement('h1');
46
- theH1.textContent = 'Hello, {{name}}, here are your favorite Star Wars characters';
45
+ const theH1 = document.createElement('h1')
46
+ theH1.textContent = 'Hello, {{name}}, here are your favorite Star Wars characters'
47
47
 
48
- const charactersStart = document.createTextNode('{{#characters}}');
49
- const charactersEnd = document.createTextNode('{{/characters}}');
50
- const charactersUl = document.createElement('ul');
51
- const charactersLi = document.createElement('li');
52
- charactersLi.textContent = '{{.*}}';
48
+ const charactersStart = document.createTextNode('{{#characters}}')
49
+ const charactersEnd = document.createTextNode('{{/characters}}')
50
+ const charactersUl = document.createElement('ul')
51
+ const charactersLi = document.createElement('li')
52
+ charactersLi.textContent = '{{.*}}'
53
53
 
54
- charactersUl.appendChild(charactersStart);
55
- charactersUl.appendChild(charactersLi);
56
- charactersUl.appendChild(charactersEnd);
54
+ charactersUl.appendChild(charactersStart)
55
+ charactersUl.appendChild(charactersLi)
56
+ charactersUl.appendChild(charactersEnd)
57
57
 
58
- const theH2 = document.createElement('h2');
59
- theH2.textContent = 'And {{name}}, the movies were released on';
60
- const moviesStart = document.createTextNode('{{#movies}}');
61
- const moviesEnd = document.createTextNode('{{/movies}}');
62
- const moviesUl = document.createElement('ul');
63
- const moviesLi = document.createElement('li');
64
- moviesLi.textContent = '{{title}} year:{{year}}';
58
+ const theH2 = document.createElement('h2')
59
+ theH2.textContent = 'And {{name}}, the movies were released on'
60
+ const moviesStart = document.createTextNode('{{#movies}}')
61
+ const moviesEnd = document.createTextNode('{{/movies}}')
62
+ const moviesUl = document.createElement('ul')
63
+ const moviesLi = document.createElement('li')
64
+ moviesLi.textContent = '{{title}} year:{{year}}'
65
65
 
66
- moviesUl.appendChild(moviesStart);
67
- moviesUl.appendChild(moviesLi);
68
- moviesUl.appendChild(moviesEnd);
66
+ moviesUl.appendChild(moviesStart)
67
+ moviesUl.appendChild(moviesLi)
68
+ moviesUl.appendChild(moviesEnd)
69
69
 
70
- theDiv.appendChild(theH1);
71
- theDiv.appendChild(charactersUl);
72
- theDiv.appendChild(theH2);
73
- theDiv.appendChild(moviesUl);
70
+ theDiv.appendChild(theH1)
71
+ theDiv.appendChild(charactersUl)
72
+ theDiv.appendChild(theH2)
73
+ theDiv.appendChild(moviesUl)
74
74
 
75
- ScriptTemplate.appendChild(theDiv);
75
+ ScriptTemplate.appendChild(theDiv)
76
76
  // ScriptTemplate.text+="{{#test}}";
77
77
 
78
78
  // const elSrc = new window.WINDOWParser().parseFromString(ScriptTemplate.innerHTML, 'text/html').body.childNodes;
79
79
 
80
- const StringTemplate = '<div><h1>Hello, {{name}}, here are your favorite Star Wars characters</h1><ul>{{#characters}}<li>{{.*}}</li>{{/characters}}</ul><h2>And {{name}}, the movies were released on</h2><ul>{{#movies}}<li>{{title}} year:{{year}}</li>{{/movies}}</ul></div>';
80
+ const StringTemplate = '<div><h1>Hello, {{name}}, here are your favorite Star Wars characters</h1><ul>{{#characters}}<li>{{.*}}</li>{{/characters}}</ul><h2>And {{name}}, the movies were released on</h2><ul>{{#movies}}<li>{{title}} year:{{year}}</li>{{/movies}}</ul></div>'
81
81
 
82
- export { ScriptTemplate, StringTemplate, starWarsData };
82
+ export { ScriptTemplate, StringTemplate, starWarsData }
83
83
 
84
84
  // const markup = `<div><h1>Hello {{name}}, here are your favorite Star Wars characters</h1><ul> {{#characters}} <li>{{.*}} </li>{{/characters}}</ul><h2>And {{name}}, the movies were released on</h2><ul>{{#movies}}<li>{{title}} year:{{year}}</li>{{/movies}}<ul></div>`;
@@ -2,9 +2,9 @@ const SpyneConfigData = {
2
2
 
3
3
  channels: {
4
4
  WINDOW: {
5
- mediqQueries: {
6
- 'test' : '(max-width: 500px)',
7
- 'newTest' : '(max-width: 800px)'
5
+ mediaQueries: {
6
+ test : '(max-width: 500px)',
7
+ newTest : '(max-width: 800px)'
8
8
  },
9
9
  listenForResize: true,
10
10
  listenForOrientation: true,
@@ -19,41 +19,41 @@ const SpyneConfigData = {
19
19
  isHash: false,
20
20
  isHidden: true,
21
21
  routes: {
22
- 'routePath': {
23
- 'routeName': 'pageId',
24
- 'home': '',
22
+ routePath: {
23
+ routeName: 'pageId',
24
+ home: '',
25
25
  'page-one': {
26
- 'routePath': {
27
- 'routeName': 'imageNum',
28
- "work" : {
29
- 'routePath': {
30
- 'routeName': 'author',
31
- 'hemingway': 'hemingway'
26
+ routePath: {
27
+ routeName: 'imageNum',
28
+ work : {
29
+ routePath: {
30
+ routeName: 'author',
31
+ hemingway: 'hemingway'
32
32
  }
33
- },
34
- 'routePath': {
35
- 'routeName': 'author',
36
- 'hemingway': 'hemingway'
33
+ },
34
+ routePath: {
35
+ routeName: 'author',
36
+ hemingway: 'hemingway'
37
37
  }
38
38
  }
39
39
  },
40
40
  'page-one-up': {
41
- 'routePath': {
42
- 'routeName': 'imageNum',
43
- 'routePath': {
44
- 'routeName': 'pixels'
41
+ routePath: {
42
+ routeName: 'imageNum',
43
+ routePath: {
44
+ routeName: 'pixels'
45
45
  }
46
46
  }
47
47
  },
48
48
  'page-two': {
49
- 'routePath': {
50
- 'routeName': 'photogNum'
49
+ routePath: {
50
+ routeName: 'photogNum'
51
51
  }
52
52
  },
53
53
  'page-.*': {
54
- 'routePath': {
55
- 'routeName': 'randomNum',
56
- "thirty-two" : "32"
54
+ routePath: {
55
+ routeName: 'randomNum',
56
+ 'thirty-two' : '32'
57
57
  }
58
58
  }
59
59
  }
@@ -63,35 +63,35 @@ const SpyneConfigData = {
63
63
  }
64
64
  }
65
65
 
66
- };
66
+ }
67
67
 
68
68
  const routeConfigWithRegexOverride = {
69
- 'type': 'slash',
70
- 'isHash': false,
71
- 'isHidden': false,
72
- 'routes': {
73
- 'routePath': {
74
- '404': '.*',
75
- 'routeName': 'pageId',
76
- 'home': '^$|index.html',
77
- 'about': 'about',
78
- 'guide': {
79
- 'routePath': {
80
- 'routeName': 'section',
69
+ type: 'slash',
70
+ isHash: false,
71
+ isHidden: false,
72
+ routes: {
73
+ routePath: {
74
+ 404: '.*',
75
+ routeName: 'pageId',
76
+ home: '^$|index.html',
77
+ about: 'about',
78
+ guide: {
79
+ routePath: {
80
+ routeName: 'section',
81
81
  'overview|reference': {
82
- 'routePath': {
83
- 'routeName': 'menuItem'
82
+ routePath: {
83
+ routeName: 'menuItem'
84
84
  }
85
85
  }
86
86
  }
87
87
  }
88
88
  }
89
89
  },
90
- 'regexTokens': {
90
+ regexTokens: {
91
91
  '^$|index.html': ''
92
92
  },
93
- 'routeNamesArr' : ['pageId', 'section', 'menuItem'],
94
- 'paramsArr': [
93
+ routeNamesArr : ['pageId', 'section', 'menuItem'],
94
+ paramsArr: [
95
95
  '.*',
96
96
  'pageId',
97
97
  '^$|index.html',
@@ -99,16 +99,16 @@ const routeConfigWithRegexOverride = {
99
99
  'section',
100
100
  'menuItem'
101
101
  ]
102
- };
102
+ }
103
103
 
104
104
  const RouteDataForTests = {
105
105
 
106
106
  multiple: {
107
107
 
108
108
  data: {
109
- 'pageId': 'page-one',
110
- 'imageNum': '2',
111
- 'author': 'ubalu'
109
+ pageId: 'page-one',
110
+ imageNum: '2',
111
+ author: 'ubalu'
112
112
  },
113
113
  arr: '[{"pageId":"page-one"},{"imageNum":"2"},{"author":"ubalu"}]',
114
114
  slash: 'page-one/2/ubalu',
@@ -119,8 +119,8 @@ const RouteDataForTests = {
119
119
  multipleRegex: {
120
120
 
121
121
  data: {
122
- 'pageId': 'page-three',
123
- 'randomNum': '2'
122
+ pageId: 'page-three',
123
+ randomNum: '2'
124
124
  },
125
125
  arr: '[{"pageId":"page-three"},{"randomNum":"2"}]',
126
126
  slash: 'page-three/2',
@@ -132,7 +132,7 @@ const RouteDataForTests = {
132
132
  multipleRegexComplex: {
133
133
 
134
134
  data: {
135
- 'pageId': 'work'
135
+ pageId: 'work'
136
136
  },
137
137
  arr: '[{"pageId":"work"},{"randomNum":"2"}]',
138
138
  slash: 'photos/2',
@@ -141,13 +141,12 @@ const RouteDataForTests = {
141
141
 
142
142
  },
143
143
 
144
-
145
144
  multipleWrong: {
146
145
 
147
146
  data: {
148
- 'pageId': 'page-four',
149
- 'imageNum': '2',
150
- 'author': 'ubalu'
147
+ pageId: 'page-four',
148
+ imageNum: '2',
149
+ author: 'ubalu'
151
150
  },
152
151
  arr: '[{"pageId":"page-one"},{"imageNum":"2"},{"author":"ubalu"}]',
153
152
  slash: 'page-one/2/ubalu',
@@ -159,7 +158,7 @@ const RouteDataForTests = {
159
158
  singleBasic: {
160
159
 
161
160
  data: {
162
- 'pageId': 'page-two'
161
+ pageId: 'page-two'
163
162
  },
164
163
  arr: '[{"pageId":"page-two"}]',
165
164
  slash: 'page-two',
@@ -171,8 +170,8 @@ const RouteDataForTests = {
171
170
  single: {
172
171
 
173
172
  data: {
174
- 'pageId': 'page-two',
175
- 'imageNum': '2'
173
+ pageId: 'page-two',
174
+ imageNum: '2'
176
175
  },
177
176
  arr: '[{"pageId":"page-two"}]',
178
177
  slash: 'page-two',
@@ -183,7 +182,7 @@ const RouteDataForTests = {
183
182
  home: {
184
183
 
185
184
  data: {
186
- 'pageId': 'home'
185
+ pageId: 'home'
187
186
  },
188
187
  arr: [],
189
188
  slash: '',
@@ -202,34 +201,34 @@ const RouteDataForTests = {
202
201
 
203
202
  }
204
203
 
205
- };
204
+ }
206
205
 
207
206
  const payloadDataForUrlUtils = {
208
- 'pageId': 'home',
209
- 'pageIdValue': '',
210
- 'section': '',
211
- 'menuItem': ''
212
- };
207
+ pageId: 'home',
208
+ pageIdValue: '',
209
+ section: '',
210
+ menuItem: ''
211
+ }
213
212
 
214
213
  const urlUtilsArr = [
215
214
  {
216
- 'pageId': '^$|index.html'
215
+ pageId: '^$|index.html'
217
216
  }
218
- ];
217
+ ]
219
218
 
220
219
  const ViewStreamHashMethodsObj = {
221
- 'DISPOSING': () => {},
222
- 'DISPOSE': () => {},
223
- 'RENDERED': () => {},
224
- 'RENDERED_AND_ATTACHED_TO_WINDOW': () => {},
225
- 'RENDERED_AND_ATTACHED_TO_PARENT': () => {},
226
- 'READY_FOR_GC': () => {},
227
- 'NOTHING': () => {},
228
- 'CHANNEL_ROUTE_CHANGE_EVENT': () => {},
229
- 'UI_EVENT_BLUR': () => {},
220
+ DISPOSING: () => {},
221
+ DISPOSE: () => {},
222
+ RENDERED: () => {},
223
+ RENDERED_AND_ATTACHED_TO_WINDOW: () => {},
224
+ RENDERED_AND_ATTACHED_TO_PARENT: () => {},
225
+ READY_FOR_GC: () => {},
226
+ NOTHING: () => {},
227
+ CHANNEL_ROUTE_CHANGE_EVENT: () => {},
228
+ UI_EVENT_BLUR: () => {},
230
229
  'UI_EVENT_.*': () => {},
231
- 'UI_EVENT_CLICK': () => {},
232
- 'UI_EVENT_DBLCLICK': () => {}
233
- };
230
+ UI_EVENT_CLICK: () => {},
231
+ UI_EVENT_DBLCLICK: () => {}
232
+ }
234
233
 
235
- export { SpyneConfigData, RouteDataForTests, ViewStreamHashMethodsObj, routeConfigWithRegexOverride, payloadDataForUrlUtils, urlUtilsArr };
234
+ export { SpyneConfigData, RouteDataForTests, ViewStreamHashMethodsObj, routeConfigWithRegexOverride, payloadDataForUrlUtils, urlUtilsArr }
@@ -1,64 +1,64 @@
1
1
  const internalViewStreamPayload = {
2
- 'channel': 'UI',
3
- 'action': 'CHANNEL_UI_CLICK_EVENT',
4
- 'channelPayload': {
5
- 'type': 'link',
6
- 'linkType': 'external',
7
- 'url': 'https://github.com/spynejs/spyne'
2
+ channel: 'UI',
3
+ action: 'CHANNEL_UI_CLICK_EVENT',
4
+ channelPayload: {
5
+ type: 'link',
6
+ linkType: 'external',
7
+ url: 'https://github.com/spynejs/spyne'
8
8
  },
9
- 'srcElement': {
10
- 'vsid': 'header',
11
- 'isLocalEvent': false,
12
- 'viewName': 'HeaderView',
13
- 'event': 'click',
14
- 'el': ''
9
+ srcElement: {
10
+ vsid: 'header',
11
+ isLocalEvent: false,
12
+ viewName: 'HeaderView',
13
+ event: 'click',
14
+ el: ''
15
15
  },
16
- 'event': {
17
- 'isTrusted': true
16
+ event: {
17
+ isTrusted: true
18
18
  }
19
- };
19
+ }
20
20
 
21
21
  const internvalRouteChannelPayload = {
22
- 'channel': 'CHANNEL_ROUTE',
23
- 'action': 'CHANNEL_ROUTE_CHANGE_EVENT',
24
- 'channelPayload': {
25
- 'isDeepLink': false,
26
- 'routeCount': 1,
27
- 'routeKeyword': 'pageId',
28
- 'routeKeywordsArr': [
22
+ channel: 'CHANNEL_ROUTE',
23
+ action: 'CHANNEL_ROUTE_CHANGE_EVENT',
24
+ channelPayload: {
25
+ isDeepLink: false,
26
+ routeCount: 1,
27
+ routeKeyword: 'pageId',
28
+ routeKeywordsArr: [
29
29
  'pageId'
30
30
  ],
31
- 'routeData': {
32
- 'pageId': 'guide',
33
- 'section': 'reference',
34
- 'menuItem': ''
31
+ routeData: {
32
+ pageId: 'guide',
33
+ section: 'reference',
34
+ menuItem: ''
35
35
  },
36
- 'routeValue': 'guide/reference',
37
- 'isHash': false,
38
- 'isHidden': false,
39
- 'routeType': 'slash'
36
+ routeValue: 'guide/reference',
37
+ isHash: false,
38
+ isHidden: false,
39
+ routeType: 'slash'
40
40
  },
41
- 'srcElement': {
42
- 'vsid': 'header',
43
- 'isLocalEvent': false,
44
- 'viewName': 'HeaderView',
45
- 'event': 'click',
46
- 'el': {}
41
+ srcElement: {
42
+ vsid: 'header',
43
+ isLocalEvent: false,
44
+ viewName: 'HeaderView',
45
+ event: 'click',
46
+ el: {}
47
47
  },
48
- 'event': {
49
- 'isTrusted': true
48
+ event: {
49
+ isTrusted: true
50
50
  },
51
- 'location': {
52
- 'href': 'http://10.0.1.34:8080/guide/reference',
53
- 'origin': 'http://10.0.1.34:8080',
54
- 'protocol': 'http:',
55
- 'host': '10.0.1.34:8080',
56
- 'hostname': '10.0.1.34',
57
- 'port': '8080',
58
- 'pathname': '/guide/reference',
59
- 'search': '',
60
- 'hash': ''
51
+ location: {
52
+ href: 'http://10.0.1.34:8080/guide/reference',
53
+ origin: 'http://10.0.1.34:8080',
54
+ protocol: 'http:',
55
+ host: '10.0.1.34:8080',
56
+ hostname: '10.0.1.34',
57
+ port: '8080',
58
+ pathname: '/guide/reference',
59
+ search: '',
60
+ hash: ''
61
61
  }
62
- };
62
+ }
63
63
 
64
- export { internalViewStreamPayload, internvalRouteChannelPayload };
64
+ export { internalViewStreamPayload, internvalRouteChannelPayload }
@@ -518,4 +518,4 @@ const windowEventsArr = [
518
518
  'ValueChange',
519
519
  'notification',
520
520
  'notification'
521
- ];
521
+ ]
@@ -0,0 +1,9 @@
1
+ import { expect } from 'chai'
2
+ import pkg from '../../package.json' // Import package.json
3
+
4
+ describe('package.json export import statement', () => {
5
+ it('should be set to "./lib/spyne.esm.js"', () => {
6
+ const exports = pkg.exports['.']
7
+ expect(exports.import).to.equal('./lib/spyne.esm.js')
8
+ })
9
+ })
@@ -1,27 +1,24 @@
1
- const {expect, assert} = require('chai');
2
- const {SpyneApp} = require('../spyne/spyne-app');
1
+ const { expect, assert } = require('chai')
2
+ const { SpyneApp } = require('../spyne/spyne-app')
3
3
 
4
4
  describe('should run spyne app tests', () => {
5
- before(()=>{
5
+ before(() => {
6
6
 
7
- //SpyneApp.init();
8
-
9
- })
7
+ // SpyneApp.init();
10
8
 
9
+ })
11
10
 
12
11
  it('spyne app constructor should exist', () => {
13
- const constructorName = SpyneApp.constructor.name;
14
- expect(constructorName).to.equal('SpyneApplication');
15
- return true;
16
- });
17
-
18
- it('should return warn if trying to initialize spyne application again', ()=>{
12
+ const constructorName = SpyneApp.constructor.name
13
+ expect(constructorName).to.equal('SpyneApplication')
14
+ return true
15
+ })
19
16
 
20
- const warnStr = "The Spyne Application has already been initialized!";
21
- const spyneAppInit2 = SpyneApp.init({}, true);
17
+ it('should return warn if trying to initialize spyne application again', () => {
18
+ const warnStr = 'The Spyne Application has already been initialized!'
19
+ const spyneAppInit2 = SpyneApp.init({}, true)
22
20
 
23
- //console.log('second init returns string ',{spyneAppInit2, warnStr})
24
- expect(spyneAppInit2).to.equal(warnStr);
21
+ // console.log('second init returns string ',{spyneAppInit2, warnStr})
22
+ expect(spyneAppInit2).to.equal(warnStr)
25
23
  })
26
-
27
- });
24
+ })
@@ -1,28 +1,25 @@
1
- //import {SpyneApp} from '../spyne/spyne';
2
- //const {SpyneApp} = require('../spyne/spyne');
3
- const {expect, assert} = require('chai');
4
- const {SpynePlugin} = require('../spyne/spyne-plugins.js');
1
+ // import {SpyneApp} from '../spyne/spyne';
2
+ // const {SpyneApp} = require('../spyne/spyne');
3
+ const { expect, assert } = require('chai')
4
+ const { SpynePlugin } = require('../spyne/spyne-plugins.js')
5
5
 
6
- const name = 'mySpynePlugin';
7
- const config = {debug:true};
6
+ const name = 'mySpynePlugin'
7
+ const config = { debug:true }
8
8
 
9
9
  describe('should test use of spyne plugin', () => {
10
- const baseConfig = {debug:false};
11
- beforeEach(()=>{
12
-
10
+ const baseConfig = { debug:false }
11
+ beforeEach(() => {
13
12
 
14
13
  })
15
14
 
16
-
17
15
  it('spyne plugin should exist', () => {
18
- //console.log('spyne plugin1 is ',spyneApp);
19
-
20
- return true;
21
- // expect(SpynePlugin).to.exist;
16
+ // console.log('spyne plugin1 is ',spyneApp);
22
17
 
23
- });
18
+ return true
19
+ // expect(SpynePlugin).to.exist;
20
+ })
24
21
 
25
- /*
22
+ /*
26
23
  it('should get or create new spyne app', ()=>{
27
24
  const spyneApp = SpynePlugin.getSpyneApp({name, config})
28
25
  console.log("HERE IS ",{name, config, spyneApp})
@@ -33,7 +30,7 @@ describe('should test use of spyne plugin', () => {
33
30
 
34
31
  */
35
32
 
36
- /* it('should set the plugin name', ()=>{
33
+ /* it('should set the plugin name', ()=>{
37
34
  const spynePluginSetConfig = SpynePlugin.updateSpyneConfig(spyneApp, name, config);
38
35
 
39
36
  expect(spynePluginSetConfig).to.deep.equal(config);
@@ -44,6 +41,5 @@ describe('should test use of spyne plugin', () => {
44
41
  const config1 = SpynePlugin.updateSpyneConfig(spyneApp, name, config);
45
42
  const configDupe = SpynePlugin.updateSpyneConfig(spyneApp, name, config);
46
43
  expect(configDupe).to.be.false;
47
- })*/
48
-
49
- });
44
+ }) */
45
+ })