solid-ui 3.0.5-test.7 → 3.0.5-test.8
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/pad.d.ts.map +1 -1
- package/dist/pad.js +92 -59
- package/dist/pad.js.map +1 -1
- package/dist/solid-ui.esm.js +44 -20
- package/dist/solid-ui.esm.js.map +1 -1
- package/dist/solid-ui.esm.min.js +1 -1
- package/dist/solid-ui.esm.min.js.map +1 -1
- package/dist/solid-ui.js +44 -20
- package/dist/solid-ui.js.map +1 -1
- package/dist/solid-ui.min.js +1 -1
- package/dist/solid-ui.min.js.map +1 -1
- package/dist/versionInfo.js +15 -15
- package/dist/versionInfo.js.map +1 -1
- package/package.json +3 -3
package/dist/solid-ui.js
CHANGED
|
@@ -19018,8 +19018,8 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19018
19018
|
}
|
|
19019
19019
|
}
|
|
19020
19020
|
/* @@ TODO want to look into this, it seems upstream should be a boolean and default to false ?
|
|
19021
|
-
|
|
19022
|
-
|
|
19021
|
+
*
|
|
19022
|
+
*/
|
|
19023
19023
|
var complain = function complain(message) {
|
|
19024
19024
|
var upstream = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
19025
19025
|
(0,src_debug/* log */.Rm)(message);
|
|
@@ -19031,6 +19031,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19031
19031
|
// @@ TODO need to refactor so that we don't have to type cast
|
|
19032
19032
|
var clearStatus = function clearStatus(_upsteam) {
|
|
19033
19033
|
if (options.statusArea) {
|
|
19034
|
+
;
|
|
19034
19035
|
options.statusArea.innerHTML = '';
|
|
19035
19036
|
}
|
|
19036
19037
|
};
|
|
@@ -19062,7 +19063,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19062
19063
|
var next = kb.any(chunk, PAD('next'));
|
|
19063
19064
|
if (prev.sameTerm(subject) && next.sameTerm(subject)) {
|
|
19064
19065
|
// Last one
|
|
19065
|
-
(0,src_debug/* log */.Rm)(
|
|
19066
|
+
(0,src_debug/* log */.Rm)("You can't delete the only line.");
|
|
19066
19067
|
return;
|
|
19067
19068
|
}
|
|
19068
19069
|
var del = kb.statementsMatching(chunk, undefined, undefined, padDoc).concat(kb.statementsMatching(undefined, undefined, chunk, padDoc));
|
|
@@ -19104,10 +19105,10 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19104
19105
|
}, 1000);
|
|
19105
19106
|
} else {
|
|
19106
19107
|
(0,src_debug/* log */.Rm)(' removePart FAILED ' + chunk + ': ' + errorMessage);
|
|
19107
|
-
(0,src_debug/* log */.Rm)(
|
|
19108
|
+
(0,src_debug/* log */.Rm)(" removePart was deleting :'" + del);
|
|
19108
19109
|
setPartStyle(part, 'color: black; background-color: #fdd;'); // failed
|
|
19109
19110
|
var res = response ? response.status : ' [no response field] ';
|
|
19110
|
-
complain('Error ' + res + ' saving changes: ' + errorMessage
|
|
19111
|
+
complain('Error ' + res + ' saving changes: ' + String(errorMessage)); // upstream,
|
|
19111
19112
|
// updater.requestDownstreamAction(padDoc, reloadAndSync);
|
|
19112
19113
|
}
|
|
19113
19114
|
});
|
|
@@ -19124,7 +19125,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19124
19125
|
}
|
|
19125
19126
|
updater.update(del, ins, function (uri, ok, errorBody) {
|
|
19126
19127
|
if (!ok) {
|
|
19127
|
-
(0,src_debug/* log */.Rm)(
|
|
19128
|
+
(0,src_debug/* log */.Rm)("Indent change FAILED '" + newIndent + "' for " + padDoc + ': ' + errorBody);
|
|
19128
19129
|
setPartStyle(part, 'color: black; background-color: #fdd;'); // failed
|
|
19129
19130
|
updater.requestDownstreamAction(padDoc, reloadAndSync);
|
|
19130
19131
|
} else {
|
|
@@ -19133,6 +19134,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19133
19134
|
});
|
|
19134
19135
|
};
|
|
19135
19136
|
var addListeners = function addListeners(part, chunk) {
|
|
19137
|
+
var inputDebounceTimer = null;
|
|
19136
19138
|
part.addEventListener('keydown', function (event) {
|
|
19137
19139
|
if (!updater) {
|
|
19138
19140
|
throw new Error('no updater');
|
|
@@ -19141,8 +19143,8 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19141
19143
|
// up 38; down 40; left 37; right 39 tab 9; shift 16; escape 27
|
|
19142
19144
|
switch (event.keyCode) {
|
|
19143
19145
|
case 13:
|
|
19144
|
-
// Return
|
|
19145
19146
|
{
|
|
19147
|
+
// Return
|
|
19146
19148
|
var before = event.shiftKey;
|
|
19147
19149
|
(0,src_debug/* log */.Rm)('enter'); // Shift-return inserts before -- only way to add to top of pad.
|
|
19148
19150
|
if (before) {
|
|
@@ -19189,8 +19191,8 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19189
19191
|
}
|
|
19190
19192
|
break;
|
|
19191
19193
|
case 9:
|
|
19192
|
-
// Tab
|
|
19193
19194
|
{
|
|
19195
|
+
// Tab
|
|
19194
19196
|
var delta = event.shiftKey ? -1 : 1;
|
|
19195
19197
|
changeIndent(part, chunk, delta);
|
|
19196
19198
|
event.preventDefault(); // default is to highlight next field
|
|
@@ -19233,7 +19235,8 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19233
19235
|
// DEBUGGING ONLY
|
|
19234
19236
|
if (part.lastSent) {
|
|
19235
19237
|
if (old !== part.lastSent) {
|
|
19236
|
-
|
|
19238
|
+
// Non-fatal: log a warning instead of throwing, to avoid crashing the pad UI.
|
|
19239
|
+
console.warn("Out of order, last sent expected '" + old + "' but found '" + part.lastSent + "'");
|
|
19237
19240
|
}
|
|
19238
19241
|
}
|
|
19239
19242
|
part.lastSent = newOne;
|
|
@@ -19253,7 +19256,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19253
19256
|
updater.update(del, ins, function (uri, ok, errorBody, xhr) {
|
|
19254
19257
|
if (!ok) {
|
|
19255
19258
|
// alert("clash " + errorBody);
|
|
19256
|
-
(0,src_debug/* log */.Rm)(' patch FAILED ' + xhr.status +
|
|
19259
|
+
(0,src_debug/* log */.Rm)(' patch FAILED ' + xhr.status + " for '" + old + "' -> '" + newOne + "': " + errorBody);
|
|
19257
19260
|
if (xhr.status === 409) {
|
|
19258
19261
|
// Conflict - @@ we assume someone else
|
|
19259
19262
|
setPartStyle(part, 'color: black; background-color: #fdd;');
|
|
@@ -19264,15 +19267,28 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19264
19267
|
}, 1000);
|
|
19265
19268
|
} else {
|
|
19266
19269
|
setPartStyle(part, 'color: black; background-color: #fdd;'); // failed pink
|
|
19267
|
-
|
|
19268
|
-
|
|
19269
|
-
|
|
19270
|
-
|
|
19270
|
+
var status = xhr === null || xhr === void 0 ? void 0 : xhr.status;
|
|
19271
|
+
if (!status || status === 502 || status === 503) {
|
|
19272
|
+
// Transient server error – retry after a short delay
|
|
19273
|
+
part.lastSent = undefined;
|
|
19274
|
+
part.state = 0;
|
|
19275
|
+
setTimeout(function () {
|
|
19276
|
+
if (part.state === 0 || part.state === undefined) {
|
|
19277
|
+
part.state = 1;
|
|
19278
|
+
_updateStore(part);
|
|
19279
|
+
}
|
|
19280
|
+
}, 2000);
|
|
19281
|
+
} else {
|
|
19282
|
+
part.state = 0;
|
|
19283
|
+
complain(' Error ' + status + ' sending data: ' + errorBody, true);
|
|
19284
|
+
beep(1.0, 128); // Other
|
|
19285
|
+
// @@@ Do something more serious with other errors eg auth, etc
|
|
19286
|
+
}
|
|
19271
19287
|
}
|
|
19272
19288
|
} else {
|
|
19273
19289
|
clearStatus(true); // upstream
|
|
19274
19290
|
setPartStyle(part); // synced
|
|
19275
|
-
(0,src_debug/* log */.Rm)(
|
|
19291
|
+
(0,src_debug/* log */.Rm)(" Patch ok '" + old + "' -> '" + newOne + "' ");
|
|
19276
19292
|
if (part.state === 4) {
|
|
19277
19293
|
// delete me
|
|
19278
19294
|
part.state = 3;
|
|
@@ -19292,7 +19308,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19292
19308
|
part.addEventListener('input', function inputChangeListener(_event) {
|
|
19293
19309
|
// debug.log("input changed "+part.value);
|
|
19294
19310
|
setPartStyle(part, undefined, true); // grey out - not synced
|
|
19295
|
-
(0,src_debug/* log */.Rm)('Input event state ' + part.state +
|
|
19311
|
+
(0,src_debug/* log */.Rm)('Input event state ' + part.state + " value '" + part.value + "'");
|
|
19296
19312
|
switch (part.state) {
|
|
19297
19313
|
case 3:
|
|
19298
19314
|
// being deleted
|
|
@@ -19308,8 +19324,15 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19308
19324
|
return;
|
|
19309
19325
|
case 0:
|
|
19310
19326
|
case undefined:
|
|
19311
|
-
|
|
19312
|
-
|
|
19327
|
+
// Debounce: wait for a pause in typing before sending PATCH
|
|
19328
|
+
if (inputDebounceTimer !== null) clearTimeout(inputDebounceTimer);
|
|
19329
|
+
inputDebounceTimer = setTimeout(function () {
|
|
19330
|
+
inputDebounceTimer = null;
|
|
19331
|
+
if (part.state === 0 || part.state === undefined) {
|
|
19332
|
+
part.state = 1; // being updated
|
|
19333
|
+
_updateStore(part);
|
|
19334
|
+
}
|
|
19335
|
+
}, 400);
|
|
19313
19336
|
}
|
|
19314
19337
|
}); // listener
|
|
19315
19338
|
}; // addlisteners
|
|
@@ -19339,13 +19362,13 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19339
19362
|
addListeners(part, chunk);
|
|
19340
19363
|
} else {
|
|
19341
19364
|
setPartStyle(part, 'color: #222; background-color: #fff');
|
|
19342
|
-
(0,src_debug/* log */.Rm)(
|
|
19365
|
+
(0,src_debug/* log */.Rm)("Note can't add listeners - not logged in");
|
|
19343
19366
|
}
|
|
19344
19367
|
return part;
|
|
19345
19368
|
};
|
|
19346
19369
|
|
|
19347
19370
|
/* @@ TODO we need to look at indent, it can be a Number or an Object this doesn't seem correct.
|
|
19348
|
-
|
|
19371
|
+
*/
|
|
19349
19372
|
var _newChunk = function newChunk(ele, before) {
|
|
19350
19373
|
// element of chunk being split
|
|
19351
19374
|
var kb = pad_store;
|
|
@@ -19470,6 +19493,7 @@ function notepad(dom, padDoc, subject, me, options) {
|
|
|
19470
19493
|
var msg = 'Pad: Inconsistent data - NEXT pointers: ' + kb.each(subject, PAD('next')).length;
|
|
19471
19494
|
(0,src_debug/* log */.Rm)(msg);
|
|
19472
19495
|
if (options.statusArea) {
|
|
19496
|
+
;
|
|
19473
19497
|
options.statusArea.textContent += msg;
|
|
19474
19498
|
}
|
|
19475
19499
|
return;
|