@jinntec/fore 2.6.0 → 2.7.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.
- package/dist/fore-dev.js +4470 -2643
- package/dist/fore.js +4415 -2620
- package/index.js +2 -0
- package/package.json +10 -4
- package/resources/fore.css +2 -6
- package/src/DependencyNotifyingDomFacade.js +27 -21
- package/src/ForeElementMixin.js +282 -277
- package/src/actions/abstract-action.js +7 -12
- package/src/actions/fx-append.js +23 -2
- package/src/actions/fx-call.js +2 -2
- package/src/actions/fx-delete.js +54 -29
- package/src/actions/fx-insert.js +23 -15
- package/src/actions/fx-refresh.js +15 -5
- package/src/actions/fx-replace.js +18 -3
- package/src/actions/fx-reset.js +6 -0
- package/src/actions/fx-send.js +10 -7
- package/src/actions/fx-setattribute.js +12 -0
- package/src/actions/fx-setfocus.js +11 -8
- package/src/actions/fx-setvalue.js +93 -93
- package/src/actions/fx-toggle.js +1 -1
- package/src/extract-predicate-deps.js +57 -0
- package/src/extractPredicateDependencies.js +36 -0
- package/src/fore.js +41 -16
- package/src/fx-bind.js +128 -23
- package/src/fx-connection.js +24 -7
- package/src/fx-fore.js +506 -259
- package/src/fx-instance.js +9 -11
- package/src/fx-model.js +154 -65
- package/src/fx-submission.js +19 -30
- package/src/fx-var.js +5 -0
- package/src/getInScopeContext.js +7 -8
- package/src/modelitem.js +247 -112
- package/src/tools/fx-action-log.js +21 -19
- package/src/tools/fx-log-settings.js +4 -2
- package/src/ui/TemplateExpression.js +12 -0
- package/src/ui/UIElement.js +125 -10
- package/src/ui/abstract-control.js +5 -0
- package/src/ui/fx-case.js +15 -3
- package/src/ui/fx-container.js +5 -0
- package/src/ui/fx-control-menu.js +23 -14
- package/src/ui/fx-control.js +55 -15
- package/src/ui/fx-items.js +10 -4
- package/src/ui/fx-repeat-attributes.js +111 -35
- package/src/ui/fx-repeat.js +332 -85
- package/src/ui/fx-repeat.updated.js +821 -0
- package/src/ui/fx-repeatitem.js +23 -20
- package/src/ui/fx-switch.js +5 -3
- package/src/ui/fx-upload.js +36 -40
- package/src/ui/repeat-base.js +532 -0
- package/src/withDraggability.js +8 -4
- package/src/xpath-evaluation.js +26 -8
- package/src/xpath-path.js +79 -0
- package/src/xpath-util.js +357 -289
package/src/fx-connection.js
CHANGED
|
@@ -38,7 +38,7 @@ ${
|
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
static get observedAttributes() {
|
|
41
|
-
return ['url', 'heartbeat', 'message-format'];
|
|
41
|
+
return ['url', 'heartbeat', 'message-format', 'messageformat'];
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
connectedCallback() {
|
|
@@ -78,6 +78,7 @@ ${
|
|
|
78
78
|
this._setupHeartbeat();
|
|
79
79
|
break;
|
|
80
80
|
case 'messageformat':
|
|
81
|
+
case 'message-format':
|
|
81
82
|
this._messageFormat = newValue;
|
|
82
83
|
break;
|
|
83
84
|
default:
|
|
@@ -87,19 +88,35 @@ ${
|
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
send(data) {
|
|
90
|
-
|
|
91
|
-
data
|
|
91
|
+
// If data is provided directly, use it; otherwise evaluate from context
|
|
92
|
+
if (data === undefined) {
|
|
93
|
+
this.evalInContext();
|
|
94
|
+
data = this.nodeset;
|
|
95
|
+
}
|
|
96
|
+
|
|
92
97
|
if (this._socket && this._socket.readyState === WebSocket.OPEN) {
|
|
93
98
|
let message;
|
|
94
99
|
switch (this._messageFormat) {
|
|
95
100
|
case 'json':
|
|
96
|
-
|
|
101
|
+
if (typeof data === 'string') {
|
|
102
|
+
message = data; // Assume it's already JSON string
|
|
103
|
+
} else {
|
|
104
|
+
message = JSON.stringify(data);
|
|
105
|
+
}
|
|
97
106
|
break;
|
|
98
107
|
case 'xml':
|
|
99
|
-
|
|
108
|
+
if (typeof data === 'string') {
|
|
109
|
+
message = data;
|
|
110
|
+
} else {
|
|
111
|
+
message = new XMLSerializer().serializeToString(data);
|
|
112
|
+
}
|
|
100
113
|
break;
|
|
101
114
|
case 'text':
|
|
102
|
-
|
|
115
|
+
if (typeof data === 'string') {
|
|
116
|
+
message = data;
|
|
117
|
+
} else {
|
|
118
|
+
message = data.textContent;
|
|
119
|
+
}
|
|
103
120
|
break;
|
|
104
121
|
default:
|
|
105
122
|
throw new Error(`Unsupported message format: ${this._messageFormat}`);
|
|
@@ -123,7 +140,7 @@ ${
|
|
|
123
140
|
_disconnect() {
|
|
124
141
|
if (this._socket) {
|
|
125
142
|
this._socket.removeEventListener('open', this._onOpen.bind(this));
|
|
126
|
-
this._socket.removeEventListener('message',
|
|
143
|
+
this._socket.removeEventListener('message', this._onMessage);
|
|
127
144
|
this._socket.removeEventListener('close', this._onClose.bind(this));
|
|
128
145
|
this._socket.close();
|
|
129
146
|
this._socket = null;
|