spyne 0.19.1 → 0.20.1

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 (132) hide show
  1. package/.eslintignore +2 -0
  2. package/.eslintrc.js +4 -3
  3. package/.travis.yml +24 -11
  4. package/karma.conf.js +77 -87
  5. package/lib/spyne.esm.js +15 -0
  6. package/lib/spyne.esm.js.map +1 -0
  7. package/lib/spyne.js +248 -248
  8. package/lib/spyne.umd.js +3 -0
  9. package/lib/spyne.umd.js.LICENSE.txt +16 -0
  10. package/package.json +48 -27
  11. package/rollup.config.js +26 -0
  12. package/src/spyne/channels/channel-fetch-class.js +39 -43
  13. package/src/spyne/channels/channel-payload-class.js +61 -74
  14. package/src/spyne/channels/channel-proxy.js +25 -26
  15. package/src/spyne/channels/channel.js +141 -149
  16. package/src/spyne/channels/channels-config.js +46 -47
  17. package/src/spyne/channels/channels-map.js +61 -65
  18. package/src/spyne/channels/spyne-channel-lifecycle.js +12 -12
  19. package/src/spyne/channels/spyne-channel-route.js +241 -250
  20. package/src/spyne/channels/spyne-channel-ui.js +213 -75
  21. package/src/spyne/channels/spyne-channel-window.js +157 -157
  22. package/src/spyne/spyne-app.js +32 -19
  23. package/src/spyne/spyne-plugins.js +55 -70
  24. package/src/spyne/spyne.js +23 -23
  25. package/src/spyne/utils/channel-config-validator.js +10 -10
  26. package/src/spyne/utils/channel-fetch-util.js +72 -55
  27. package/src/spyne/utils/channel-payload-filter.js +89 -100
  28. package/src/spyne/utils/deep-merge.js +31 -29
  29. package/src/spyne/utils/frp-tools.js +108 -92
  30. package/src/spyne/utils/gc.js +6 -6
  31. package/src/spyne/utils/mixins/base-core-mixins.js +17 -15
  32. package/src/spyne/utils/mixins/base-streams-mixins.js +9 -9
  33. package/src/spyne/utils/route-channel-updater.js +23 -29
  34. package/src/spyne/utils/safe-clone.js +40 -58
  35. package/src/spyne/utils/sanitize-html.js +35 -0
  36. package/src/spyne/utils/security-policy.js +11 -0
  37. package/src/spyne/utils/spyne-app-properties.js +110 -114
  38. package/src/spyne/utils/spyne-logger.js +4 -11
  39. package/src/spyne/utils/spyne-plugins-methods.js +38 -63
  40. package/src/spyne/utils/spyne-trait.js +33 -33
  41. package/src/spyne/utils/spyne-utils-channel-route-url.js +229 -153
  42. package/src/spyne/utils/spyne-utils-channel-route.js +128 -138
  43. package/src/spyne/utils/spyne-utils-channel-window.js +39 -39
  44. package/src/spyne/utils/viewstream-animations.js +12 -12
  45. package/src/spyne/utils/viewstream-observables.js +45 -45
  46. package/src/spyne/views/dom-element-template.js +111 -114
  47. package/src/spyne/views/dom-element.js +82 -84
  48. package/src/spyne/views/view-stream-broadcaster.js +66 -62
  49. package/src/spyne/views/view-stream-element.js +105 -106
  50. package/src/spyne/views/view-stream-payload.js +25 -27
  51. package/src/spyne/views/view-stream-selector.js +157 -163
  52. package/src/spyne/views/view-stream.js +416 -640
  53. package/src/tests/channels/channel-dom.test.js +15 -15
  54. package/src/tests/channels/channel-fetch.test.js +51 -62
  55. package/src/tests/channels/channel-payload-class.test.js +50 -63
  56. package/src/tests/channels/channel-payload-filter.test.js +133 -193
  57. package/src/tests/channels/channel-route.test.js +102 -112
  58. package/src/tests/channels/channel-stream-item.test.js +19 -19
  59. package/src/tests/channels/channel-ui.test.js +15 -27
  60. package/src/tests/channels/channel-util-dom.test.js +31 -31
  61. package/src/tests/channels/channel.test.js +20 -25
  62. package/src/tests/channels/route-utils.test.js +61 -66
  63. package/src/tests/channels/url-utils.test.js +151 -151
  64. package/src/tests/channels/view-stream-broadcaster.test.js +7 -7
  65. package/src/tests/import.test.js +5 -5
  66. package/src/tests/index.js +6 -7
  67. package/src/tests/index.test.js +6 -8
  68. package/src/tests/mocks/channel-payload-data.js +218 -220
  69. package/src/tests/mocks/enhancer.test.js +5 -5
  70. package/src/tests/mocks/payload-ui.js +87 -90
  71. package/src/tests/mocks/routes-data.js +264 -266
  72. package/src/tests/mocks/spyne-docs.mocks.js +3 -3
  73. package/src/tests/mocks/template-renderer.mocks.js +47 -47
  74. package/src/tests/mocks/utils-data.js +78 -79
  75. package/src/tests/mocks/viewstream-internal-payload.mocks.js +50 -50
  76. package/src/tests/mocks/window-events-arr.js +1 -1
  77. package/src/tests/package-json.spec.test.js +9 -0
  78. package/src/tests/spyne-app.test.js +15 -18
  79. package/src/tests/spyne-plugin.test.js +16 -20
  80. package/src/tests/utils/channel-action-filter.test.js +84 -86
  81. package/src/tests/utils/channel-data-packet-generator.unused.js +62 -86
  82. package/src/tests/utils/channel-fetch-util.test.js +64 -66
  83. package/src/tests/utils/frp-tools.test.js +19 -19
  84. package/src/tests/utils/plugins-methods.test.js +31 -55
  85. package/src/tests/utils/security.test.js +10 -0
  86. package/src/tests/utils/spyne-app-properties.test.js +4 -8
  87. package/src/tests/views/dom-el-selectors.test.js +112 -119
  88. package/src/tests/views/dom-el-template-proxy.test.js +7 -0
  89. package/src/tests/views/dom-el-template.test.js +186 -156
  90. package/src/tests/views/dom-el.test.js +58 -56
  91. package/src/tests/views/view-stream-enhancer-loader.test.js +2 -2
  92. package/src/tests/views/view-stream-enhancer.test.js +11 -11
  93. package/src/tests/views/view-stream.test.js +22 -33
  94. package/webpack.config.js +76 -67
  95. package/docs/-_%20Solves%20equations%20of%20the%20form%20a%20_%20x%20=%20b.html +0 -487
  96. package/docs/DomItem.html +0 -298
  97. package/docs/DomItem_DomItem.html +0 -314
  98. package/docs/ViewStream.html +0 -2249
  99. package/docs/ViewStream_ViewStream.html +0 -503
  100. package/docs/custom/css/jsdoc-viewstream.css +0 -377
  101. package/docs/custom/layout.tmpl +0 -47
  102. package/docs/dom-item.js.html +0 -213
  103. package/docs/fonts/OpenSans-Bold-webfont.eot +0 -0
  104. package/docs/fonts/OpenSans-Bold-webfont.svg +0 -1830
  105. package/docs/fonts/OpenSans-Bold-webfont.woff +0 -0
  106. package/docs/fonts/OpenSans-BoldItalic-webfont.eot +0 -0
  107. package/docs/fonts/OpenSans-BoldItalic-webfont.svg +0 -1830
  108. package/docs/fonts/OpenSans-BoldItalic-webfont.woff +0 -0
  109. package/docs/fonts/OpenSans-Italic-webfont.eot +0 -0
  110. package/docs/fonts/OpenSans-Italic-webfont.svg +0 -1830
  111. package/docs/fonts/OpenSans-Italic-webfont.woff +0 -0
  112. package/docs/fonts/OpenSans-Light-webfont.eot +0 -0
  113. package/docs/fonts/OpenSans-Light-webfont.svg +0 -1831
  114. package/docs/fonts/OpenSans-Light-webfont.woff +0 -0
  115. package/docs/fonts/OpenSans-LightItalic-webfont.eot +0 -0
  116. package/docs/fonts/OpenSans-LightItalic-webfont.svg +0 -1835
  117. package/docs/fonts/OpenSans-LightItalic-webfont.woff +0 -0
  118. package/docs/fonts/OpenSans-Regular-webfont.eot +0 -0
  119. package/docs/fonts/OpenSans-Regular-webfont.svg +0 -1831
  120. package/docs/fonts/OpenSans-Regular-webfont.woff +0 -0
  121. package/docs/global.html +0 -548
  122. package/docs/index-custom.html +0 -79
  123. package/docs/index.html +0 -82
  124. package/docs/jsdoc.config.json +0 -22
  125. package/docs/scripts/linenumber.js +0 -25
  126. package/docs/scripts/prettify/Apache-License-2.0.txt +0 -202
  127. package/docs/scripts/prettify/lang-css.js +0 -2
  128. package/docs/scripts/prettify/prettify.js +0 -28
  129. package/docs/styles/jsdoc-default.css +0 -358
  130. package/docs/styles/prettify-jsdoc.css +0 -111
  131. package/docs/styles/prettify-tomorrow.css +0 -132
  132. package/docs/view-stream.js.html +0 -767
@@ -1,120 +1,117 @@
1
1
  const payloadNoEvent = {
2
- "viewStreamInfo": {
3
- "payload": {
4
- "type": "menuItem",
5
- "menuItem": "channel-payload",
6
- "contentMenuSection": "4"
2
+ viewStreamInfo: {
3
+ payload: {
4
+ type: 'menuItem',
5
+ menuItem: 'channel-payload',
6
+ contentMenuSection: '4'
7
7
  },
8
- "channel": "UI",
9
- "srcElement": {
10
- "id": "channel-payload",
11
- "vsid": "vsid-4599787",
12
- "isLocalEvent": false,
13
- "viewName": "PageGuideSidebarItemView",
14
- "srcEvent": "click",
15
- "el": {}
8
+ channel: 'UI',
9
+ srcElement: {
10
+ id: 'channel-payload',
11
+ vsid: 'vsid-4599787',
12
+ isLocalEvent: false,
13
+ viewName: 'PageGuideSidebarItemView',
14
+ srcEvent: 'click',
15
+ el: {}
16
16
  }
17
17
  },
18
- "uiEvent": {
19
- "isTrusted": true
18
+ uiEvent: {
19
+ isTrusted: true
20
20
  },
21
- "action": "CHANNEL_UI_CLICK_EVENT"
22
- };
21
+ action: 'CHANNEL_UI_CLICK_EVENT'
22
+ }
23
23
 
24
24
  const payloadPreventDefault = {
25
- "viewStreamInfo": {
26
- "payload": {
27
- "type": "link",
28
- "eventPreventDefault": "true",
29
- "linkType": "external",
30
- "url": "https://github.com/spynejs/spyne"
25
+ viewStreamInfo: {
26
+ payload: {
27
+ type: 'link',
28
+ eventPreventDefault: 'true',
29
+ linkType: 'external',
30
+ url: 'https://github.com/spynejs/spyne'
31
31
  },
32
- "srcElement": {
33
- "id": "header",
34
- "vsid": "vsid-3248706",
35
- "isLocalEvent": false,
36
- "viewName": "HeaderView",
37
- "srcEvent": "click",
38
- "el": {}
32
+ srcElement: {
33
+ id: 'header',
34
+ vsid: 'vsid-3248706',
35
+ isLocalEvent: false,
36
+ viewName: 'HeaderView',
37
+ srcEvent: 'click',
38
+ el: {}
39
39
  }
40
40
  },
41
- "uiEvent": {
42
- "isTrusted": true
41
+ uiEvent: {
42
+ isTrusted: true
43
43
  },
44
- "action": "CHANNEL_UI_CLICK_EVENT"
45
- };
44
+ action: 'CHANNEL_UI_CLICK_EVENT'
45
+ }
46
46
 
47
47
  const payloadTwoEvents = {
48
- "viewStreamInfo": {
49
- "payload": {
50
- "type": "link",
51
- "eventPreventDefault": "true",
52
- "eventStopPropagation": "true",
53
- "linkType": "external",
54
- "url": "https://github.com/spynejs/spyne"
48
+ viewStreamInfo: {
49
+ payload: {
50
+ type: 'link',
51
+ eventPreventDefault: 'true',
52
+ eventStopPropagation: 'true',
53
+ linkType: 'external',
54
+ url: 'https://github.com/spynejs/spyne'
55
55
  },
56
- "srcElement": {
57
- "id": "header",
58
- "vsid": "vsid-3248706",
59
- "isLocalEvent": false,
60
- "viewName": "HeaderView",
61
- "srcEvent": "click",
62
- "el": {}
56
+ srcElement: {
57
+ id: 'header',
58
+ vsid: 'vsid-3248706',
59
+ isLocalEvent: false,
60
+ viewName: 'HeaderView',
61
+ srcEvent: 'click',
62
+ el: {}
63
63
  }
64
64
  },
65
- "uiEvent": {
66
- "isTrusted": true
65
+ uiEvent: {
66
+ isTrusted: true
67
67
  },
68
- "action": "CHANNEL_UI_CLICK_EVENT"
69
- };
70
-
68
+ action: 'CHANNEL_UI_CLICK_EVENT'
69
+ }
71
70
 
72
71
  const payloadStopPropagation = {
73
- "viewStreamInfo": {
74
- "payload": {
75
- "type": "link",
76
- "eventStopPropagation": "true",
77
- "linkType": "external",
78
- "url": "https://github.com/spynejs/spyne"
72
+ viewStreamInfo: {
73
+ payload: {
74
+ type: 'link',
75
+ eventStopPropagation: 'true',
76
+ linkType: 'external',
77
+ url: 'https://github.com/spynejs/spyne'
79
78
  },
80
- "srcElement": {
81
- "id": "header",
82
- "vsid": "vsid-3248706",
83
- "isLocalEvent": false,
84
- "viewName": "HeaderView",
85
- "srcEvent": "click",
86
- "el": {}
79
+ srcElement: {
80
+ id: 'header',
81
+ vsid: 'vsid-3248706',
82
+ isLocalEvent: false,
83
+ viewName: 'HeaderView',
84
+ srcEvent: 'click',
85
+ el: {}
87
86
  }
88
87
  },
89
- "uiEvent": {
90
- "isTrusted": true
88
+ uiEvent: {
89
+ isTrusted: true
91
90
  },
92
- "action": "CHANNEL_UI_CLICK_EVENT"
93
- };
91
+ action: 'CHANNEL_UI_CLICK_EVENT'
92
+ }
94
93
 
95
94
  const payloadEmptyEvent = {
96
- "viewStreamInfo": {
97
- "payload": {
98
- "type": "link",
99
- "eventTest": "true",
100
- "linkType": "external",
101
- "url": "https://github.com/spynejs/spyne"
95
+ viewStreamInfo: {
96
+ payload: {
97
+ type: 'link',
98
+ eventTest: 'true',
99
+ linkType: 'external',
100
+ url: 'https://github.com/spynejs/spyne'
102
101
  },
103
- "srcElement": {
104
- "id": "header",
105
- "vsid": "vsid-3248706",
106
- "isLocalEvent": false,
107
- "viewName": "HeaderView",
108
- "srcEvent": "click",
109
- "el": {}
102
+ srcElement: {
103
+ id: 'header',
104
+ vsid: 'vsid-3248706',
105
+ isLocalEvent: false,
106
+ viewName: 'HeaderView',
107
+ srcEvent: 'click',
108
+ el: {}
110
109
  }
111
110
  },
112
- "uiEvent": {
113
- "isTrusted": true
111
+ uiEvent: {
112
+ isTrusted: true
114
113
  },
115
- "action": "CHANNEL_UI_CLICK_EVENT"
116
- };
117
-
118
- export {payloadEmptyEvent, payloadNoEvent,payloadTwoEvents, payloadPreventDefault, payloadStopPropagation}
119
-
114
+ action: 'CHANNEL_UI_CLICK_EVENT'
115
+ }
120
116
 
117
+ export { payloadEmptyEvent, payloadNoEvent, payloadTwoEvents, payloadPreventDefault, payloadStopPropagation }