spyne 0.16.2 → 0.18.2
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.
- package/.travis.yml +1 -1
- package/README.md +0 -60
- package/karma.conf.js +18 -69
- package/lib/spyne.js +29755 -28678
- package/lib/spyne.min.js +1 -1
- package/lib/spyne.min.js.LICENSE.txt +9 -9
- package/package.json +21 -42
- package/src/spyne/channels/channel-fetch-class.js +25 -5
- package/src/spyne/channels/channel-payload-class.js +36 -23
- package/src/spyne/channels/channel-proxy.js +7 -5
- package/src/spyne/channels/channel.js +54 -28
- package/src/spyne/channels/channels-config.js +2 -4
- package/src/spyne/channels/{channels-delegator.js → channels-map.js} +24 -40
- package/src/spyne/channels/spyne-channel-lifecycle.js +1 -2
- package/src/spyne/channels/spyne-channel-route.js +21 -62
- package/src/spyne/channels/spyne-channel-ui.js +1 -2
- package/src/spyne/channels/spyne-channel-window.js +24 -35
- package/src/spyne/spyne-app.js +165 -0
- package/src/spyne/spyne-plugins.js +39 -41
- package/src/spyne/spyne.js +6 -158
- package/src/spyne/utils/channel-config-validator.js +0 -1
- package/src/spyne/utils/channel-fetch-util.js +1 -2
- package/src/spyne/utils/channel-payload-filter.js +9 -76
- package/src/spyne/utils/frp-tools.js +21 -1
- package/src/spyne/utils/gc.js +1 -1
- package/src/spyne/utils/route-channel-updater.js +0 -4
- package/src/spyne/utils/spyne-app-properties.js +183 -0
- package/src/spyne/utils/spyne-logger.js +18 -0
- package/src/spyne/utils/spyne-plugins-methods.js +97 -0
- package/src/spyne/utils/spyne-trait.js +2 -5
- package/src/spyne/utils/spyne-utils-channel-route-url.js +3 -8
- package/src/spyne/utils/spyne-utils-channel-route.js +6 -14
- package/src/spyne/utils/spyne-utils-channel-window.js +1 -3
- package/src/spyne/utils/viewstream-observables.js +2 -3
- package/src/spyne/views/dom-element-template.js +2 -7
- package/src/spyne/views/dom-element.js +0 -19
- package/src/spyne/views/view-stream-broadcaster.js +5 -10
- package/src/spyne/views/view-stream-element.js +1 -18
- package/src/spyne/views/view-stream-payload.js +31 -37
- package/src/spyne/views/view-stream-selector.js +3 -8
- package/src/spyne/views/view-stream.js +281 -297
- package/src/tests/channels/channel-fetch.test.js +102 -0
- package/src/tests/channels/channel-payload-class.test.js +14 -5
- package/src/tests/channels/channel-payload-filter.test.js +3 -28
- package/src/tests/channels/channel.test.js +38 -0
- package/src/tests/index.js +0 -1
- package/src/tests/index.test.js +6 -0
- package/src/tests/spyne-app.test.js +27 -0
- package/src/tests/spyne-plugin.test.js +13 -9
- package/src/tests/utils/plugins-methods.test.js +103 -0
- package/src/tests/utils/spyne-app-properties.test.js +11 -0
- package/webpack.config.js +19 -34
- package/lib/channel-action-filter.test.3516417154.js +0 -20
- package/lib/channel-dom.test.104366832.js +0 -20
- package/lib/channel-fetch-util.test.3506167575.js +0 -20
- package/lib/channel-payload-class.test.1081032524.js +0 -20
- package/lib/channel-payload-filter.test.977308429.js +0 -20
- package/lib/channel-route.test.3513636042.js +0 -20
- package/lib/channel-stream-item.test.119388071.js +0 -20
- package/lib/channel-ui.test.3778619579.js +0 -20
- package/lib/channel-util-dom.test.908537750.js +0 -20
- package/lib/commons.js +0 -49274
- package/lib/dom-el-selectors.test.1268485916.js +0 -20
- package/lib/dom-el-template.test.842696987.js +0 -20
- package/lib/dom-el.test.2045076905.js +0 -20
- package/lib/frp-tools.test.2503042868.js +0 -20
- package/lib/import.test.2658619365.js +0 -20
- package/lib/index.test.2372977745.js +0 -20
- package/lib/route-utils.test.273346057.js +0 -20
- package/lib/runtime.js +0 -172
- package/lib/spyne-plugin.test.301647328.js +0 -20
- package/lib/spyne.js.map +0 -1
- package/lib/url-utils.test.1931189114.js +0 -20
- package/lib/view-stream-broadcaster.test.1306675435.js +0 -20
- package/lib/view-stream-enhancer-loader.test.3617829096.js +0 -20
- package/lib/view-stream-enhancer.test.1053738169.js +0 -20
- package/lib/view-stream.test.573231784.js +0 -20
- package/src/spyne/channels/lifestream-payload.js +0 -56
- package/src/spyne/utils/channel-data-packet-generator.js +0 -200
- package/src/spyne/utils/channel-data-packet.js +0 -59
- package/src/spyne/utils/viewstream-dom-utils.js +0 -51
- package/src/spyne/views/view-stream-enhancer-loader.js +0 -70
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { validate } from '../utils/channel-config-validator';
|
|
1
|
+
import {SpyneAppProperties} from '../utils/spyne-app-properties';
|
|
3
2
|
import { gc } from '../utils/gc';
|
|
3
|
+
import {
|
|
4
|
+
compose,
|
|
5
|
+
clone,
|
|
6
|
+
fromPairs,
|
|
7
|
+
toPairs,
|
|
8
|
+
is,
|
|
9
|
+
} from 'ramda';
|
|
4
10
|
|
|
5
11
|
export class ViewStreamPayload {
|
|
6
12
|
/**
|
|
@@ -18,52 +24,40 @@ export class ViewStreamPayload {
|
|
|
18
24
|
* @param {Boolean} debug
|
|
19
25
|
*/
|
|
20
26
|
constructor(name, observable, data, action = 'subscribe', debug = false) {
|
|
21
|
-
this.addMixins();
|
|
22
|
-
|
|
27
|
+
//this.addMixins();
|
|
28
|
+
const options = {
|
|
23
29
|
'name' : name,
|
|
24
30
|
'observable': observable,
|
|
25
31
|
'data': data,
|
|
26
32
|
'action': action
|
|
27
33
|
};
|
|
28
|
-
this.
|
|
29
|
-
}
|
|
30
|
-
getValidationChecks(n) {
|
|
31
|
-
let left = e => console.warn(e);
|
|
32
|
-
let right = val => this.onRunValidations(val);
|
|
33
|
-
const channelMap = window.Spyne.channels.map;
|
|
34
|
-
if (channelMap.has(n) === true) {
|
|
35
|
-
return right(uiValidations);
|
|
36
|
-
} else {
|
|
37
|
-
return left('payload Needs a Valid Stream Name!');//
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
onRunValidations(checks) {
|
|
41
|
-
validate(checks(), this.options).fold(
|
|
42
|
-
this.onError.bind(this),
|
|
43
|
-
this.onSuccess.bind(this));
|
|
44
|
-
}
|
|
45
|
-
onPayloadValidated(p) {
|
|
46
|
-
this.sendToDirectorStream(p);
|
|
34
|
+
this.sendToDirectorStream(options);
|
|
47
35
|
}
|
|
36
|
+
|
|
48
37
|
sendToDirectorStream(payload) {
|
|
49
|
-
let
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
let directorStream$ = SpyneAppProperties.channelsMap.getStream('DISPATCHER');
|
|
39
|
+
const frozenPayload = ViewStreamPayload.deepClone(payload);
|
|
40
|
+
directorStream$.next(frozenPayload);
|
|
41
|
+
payload = undefined;
|
|
42
|
+
|
|
43
|
+
delete this;
|
|
54
44
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
|
|
46
|
+
static deepClone(o) {
|
|
47
|
+
const isArr = is(Array);
|
|
48
|
+
const isObj = is(Object);
|
|
49
|
+
const isIter = ob => isArr(ob)===false && isObj(ob)===true;
|
|
50
|
+
const isIterable = isIter(o);
|
|
51
|
+
return isIterable ? compose(fromPairs, toPairs, clone)(o) : clone(o);
|
|
52
|
+
|
|
58
53
|
}
|
|
59
|
-
|
|
60
|
-
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
static getMouseEventKeys() {
|
|
57
|
+
return ['altKey', 'bubbles', 'cancelBubble', 'cancelable', 'clientX', 'clientY', 'composed', 'ctrlKey', 'currentTarget', 'defaultPrevented', 'detail', 'eventPhase', 'fromElement', 'isTrusted', 'layerX', 'layerY', 'metaKey', 'movementX', 'movementY', 'offsetX', 'offsetY', 'pageX', 'pageY', 'path', 'relatedTarget', 'returnValue', 'screenX', 'screenY', 'shiftKey', 'sourceCapabilities', 'srcElement', 'target', 'timeStamp', 'toElement', 'type', 'view', 'which', 'x', 'y'];
|
|
61
58
|
}
|
|
59
|
+
|
|
62
60
|
addMixins() {
|
|
63
|
-
// ==================================
|
|
64
|
-
// BASE CORE MIXINS
|
|
65
|
-
// ==================================
|
|
66
|
-
// let coreMixins = baseCoreMixins();
|
|
67
61
|
this.gc = gc;
|
|
68
62
|
}
|
|
69
63
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
import {head, compose, reject, split, isEmpty,
|
|
2
|
-
|
|
1
|
+
import {head, compose, reject, split, isEmpty, lte, defaultTo, prop} from 'ramda';
|
|
2
|
+
import {SpyneAppProperties} from '../utils/spyne-app-properties';
|
|
3
3
|
|
|
4
4
|
function generateSpyneSelectorId(el) {
|
|
5
|
-
//const num = () => Math.floor(Math.random(10000000) * 10000000);
|
|
6
|
-
//const num = () => Math.random().toString(36).substring(2, 8);;
|
|
7
5
|
const num = () => Math.random().toString(36).replace(/\d/gm, '').substring(1,8);
|
|
8
6
|
let vsid = `${num()}`;
|
|
9
7
|
if (el.dataset.vsid === undefined) {
|
|
@@ -15,7 +13,7 @@ function generateSpyneSelectorId(el) {
|
|
|
15
13
|
}
|
|
16
14
|
|
|
17
15
|
function isDevMode(){
|
|
18
|
-
return
|
|
16
|
+
return SpyneAppProperties.debug === true;
|
|
19
17
|
}
|
|
20
18
|
|
|
21
19
|
|
|
@@ -203,9 +201,6 @@ function ViewStreamSelector(cxt, str) {
|
|
|
203
201
|
};
|
|
204
202
|
|
|
205
203
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
204
|
/**
|
|
210
205
|
* Attaches html to the Selector's element
|
|
211
206
|
* @param htmlElement
|