@widgetic/editor 3.10.48 → 3.10.50
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/lib/dev/editor.js
CHANGED
|
@@ -6641,7 +6641,7 @@ var template = function () {
|
|
|
6641
6641
|
computed: {
|
|
6642
6642
|
instance: function instance(service) {
|
|
6643
6643
|
return __WEBPACK_IMPORTED_MODULE_0_Core_services_container_instance__["default"][service];
|
|
6644
|
-
}
|
|
6644
|
+
} // get the service instance
|
|
6645
6645
|
},
|
|
6646
6646
|
|
|
6647
6647
|
oncreate: function oncreate() {
|
|
@@ -13347,7 +13347,7 @@ WidgetEditor = (function(superClass) {
|
|
|
13347
13347
|
this.el.append(this.tabs.el);
|
|
13348
13348
|
LoginPopup.place(this.el);
|
|
13349
13349
|
Blogvio.pubsub.subscribe('api/token/update', this._updateLoggedInStatus);
|
|
13350
|
-
this.el.attr('editorVersion', "3.10.
|
|
13350
|
+
this.el.attr('editorVersion', "3.10.50");
|
|
13351
13351
|
}
|
|
13352
13352
|
|
|
13353
13353
|
|
|
@@ -16747,43 +16747,58 @@ var UploadService = function (_EventsMixin) {
|
|
|
16747
16747
|
}, {
|
|
16748
16748
|
key: 'upload',
|
|
16749
16749
|
value: function upload(uploadFile) {
|
|
16750
|
-
// console.log("upload file:", uploadFile);
|
|
16750
|
+
// console.log("on upload file:", uploadFile);
|
|
16751
16751
|
|
|
16752
|
-
|
|
16752
|
+
// create a new File instance from the uploadFile
|
|
16753
|
+
var file = new File({
|
|
16753
16754
|
state: 'new',
|
|
16754
16755
|
size: uploadFile.size,
|
|
16755
16756
|
name: uploadFile.name,
|
|
16756
16757
|
type: parseType(uploadFile.type),
|
|
16757
|
-
|
|
16758
|
+
lastModified: Date.now(),
|
|
16758
16759
|
uploadFile: uploadFile
|
|
16759
|
-
})
|
|
16760
|
+
});
|
|
16761
|
+
console.log("on upload file:", file);
|
|
16762
|
+
|
|
16763
|
+
// push it to the files array
|
|
16764
|
+
this.files.push(file);
|
|
16765
|
+
|
|
16766
|
+
// increase used quota
|
|
16760
16767
|
this.used += uploadFile.size;
|
|
16768
|
+
|
|
16769
|
+
// broadcast the update of the files array
|
|
16761
16770
|
this._broadcast.update();
|
|
16762
16771
|
}
|
|
16763
16772
|
}, {
|
|
16764
16773
|
key: 'uploadComplete',
|
|
16765
16774
|
value: function uploadComplete(uploadFile, instanceId) {
|
|
16766
16775
|
// console.log("uploadComplete file:", uploadFile);
|
|
16776
|
+
|
|
16767
16777
|
if (uploadFile.status === 'error') return;
|
|
16768
16778
|
|
|
16769
|
-
// read metadata
|
|
16779
|
+
// read metadata from the file that's on the server
|
|
16770
16780
|
var response = JSON.parse(uploadFile.xhr.response);
|
|
16771
|
-
// console.log("uploadComplete
|
|
16772
|
-
|
|
16781
|
+
// console.log("uploadComplete server response:", response);
|
|
16782
|
+
|
|
16783
|
+
// read file from the response
|
|
16784
|
+
var serverFile = response.files.data[0];
|
|
16785
|
+
// console.log("uploadComplete file on the server:", serverFile);
|
|
16773
16786
|
|
|
16774
16787
|
// read quota from response
|
|
16775
16788
|
// this.quota = response.quota.max;
|
|
16776
16789
|
this.used = response.quota.used;
|
|
16777
16790
|
|
|
16791
|
+
// update the file in the files array with the data from the server
|
|
16778
16792
|
this._update(uploadFile, function (f) {
|
|
16779
16793
|
f.state = 'complete';
|
|
16780
|
-
f.id = id;
|
|
16781
|
-
f.path =
|
|
16794
|
+
f.id = serverFile.id;
|
|
16795
|
+
f.path = serverFile.path;
|
|
16782
16796
|
f.url = response.hostUrl + f.path;
|
|
16783
|
-
|
|
16797
|
+
f.lastModified = serverFile.lastModified;
|
|
16784
16798
|
});
|
|
16785
16799
|
|
|
16786
|
-
|
|
16800
|
+
// broadcast the completion of the upload based on the fileId and instanceId
|
|
16801
|
+
this._broadcast.complete([this.get(serverFile.id), instanceId]);
|
|
16787
16802
|
}
|
|
16788
16803
|
}, {
|
|
16789
16804
|
key: 'accept',
|
|
@@ -16840,10 +16855,13 @@ var UploadService = function (_EventsMixin) {
|
|
|
16840
16855
|
}, {
|
|
16841
16856
|
key: '_update',
|
|
16842
16857
|
value: function _update(file, transform) {
|
|
16858
|
+
// apply the transform function to the file in the array
|
|
16843
16859
|
this.files = this.files.map(function (f) {
|
|
16844
16860
|
if (f.uploadFile === file) transform(f);
|
|
16845
16861
|
return f;
|
|
16846
16862
|
});
|
|
16863
|
+
|
|
16864
|
+
// broadcast the update of the files array
|
|
16847
16865
|
this._broadcast.update();
|
|
16848
16866
|
}
|
|
16849
16867
|
}, {
|
|
@@ -17039,6 +17057,8 @@ var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = [
|
|
|
17039
17057
|
|
|
17040
17058
|
|
|
17041
17059
|
var template = function () {
|
|
17060
|
+
// actually imports services/uploads.js
|
|
17061
|
+
|
|
17042
17062
|
var instanceId = 0;
|
|
17043
17063
|
|
|
17044
17064
|
return {
|
|
@@ -17086,7 +17106,7 @@ var template = function () {
|
|
|
17086
17106
|
|
|
17087
17107
|
// on selecting a file square
|
|
17088
17108
|
toggle: function toggle(file) {
|
|
17089
|
-
console.log("on toggle file:", file);
|
|
17109
|
+
// console.log("on toggle file:", file);
|
|
17090
17110
|
|
|
17091
17111
|
if (file.error) {
|
|
17092
17112
|
this.Uploads.remove(file);
|
|
@@ -17102,7 +17122,7 @@ var template = function () {
|
|
|
17102
17122
|
refresh: function refresh(ev) {
|
|
17103
17123
|
var _this = this;
|
|
17104
17124
|
|
|
17105
|
-
console.log("refreshing...");
|
|
17125
|
+
// console.log("refreshing...");
|
|
17106
17126
|
if (ev) ev.preventDefault();
|
|
17107
17127
|
|
|
17108
17128
|
return this.Uploads.getFiles(this.get('filetypes')).then(function (files) {
|
|
@@ -17114,14 +17134,39 @@ var template = function () {
|
|
|
17114
17134
|
// if(!a.id.indexOf) return -1;
|
|
17115
17135
|
// let noIdA = a.id.substr(a.id.indexOf('_t')+2, 4);
|
|
17116
17136
|
// let noIdB = b.id.substr(a.id.indexOf('_t')+2, 4);
|
|
17117
|
-
// // console.log("noIdA & noIdB: ", noIdA, noIdB, (noIdA
|
|
17137
|
+
// // console.log("noIdA & noIdB: ", noIdA, noIdB, (noIdA - noIdB));
|
|
17118
17138
|
// return noIdA - noIdB;
|
|
17119
17139
|
// });
|
|
17120
17140
|
// console.log("uploadedFiles after sort: ", files);
|
|
17121
17141
|
|
|
17122
|
-
// sort files by last modified date
|
|
17142
|
+
// sort files by last modified(uploadTime) date
|
|
17123
17143
|
files = files.sort(function (a, b) {
|
|
17124
|
-
|
|
17144
|
+
|
|
17145
|
+
// read a lastModified timestamp
|
|
17146
|
+
var x = a.lastModified;
|
|
17147
|
+
|
|
17148
|
+
// read the lastModified date from the id
|
|
17149
|
+
if (!x) x = a.id.substring(a.id.indexOf('_u') + 3);
|
|
17150
|
+
|
|
17151
|
+
// if still not available then set it to 0
|
|
17152
|
+
if (!x) x = 0;
|
|
17153
|
+
// a.lastModified = x;
|
|
17154
|
+
|
|
17155
|
+
|
|
17156
|
+
// read b lastModified timestamp
|
|
17157
|
+
var y = b.lastModified;
|
|
17158
|
+
|
|
17159
|
+
// read the lastModified date from the id
|
|
17160
|
+
if (!y) y = b.id.substring(b.id.indexOf('_u') + 3);
|
|
17161
|
+
|
|
17162
|
+
// if still not available then set it to 0
|
|
17163
|
+
if (!y) y = 0;
|
|
17164
|
+
// b.lastModified = y;
|
|
17165
|
+
|
|
17166
|
+
|
|
17167
|
+
// console.log("x & y: ", a.lastModified, x, b.lastModified, y);
|
|
17168
|
+
|
|
17169
|
+
return x - y;
|
|
17125
17170
|
});
|
|
17126
17171
|
console.log("uploadedFiles after sort: ", files);
|
|
17127
17172
|
|
|
@@ -17186,11 +17231,11 @@ var template = function () {
|
|
|
17186
17231
|
*/
|
|
17187
17232
|
|
|
17188
17233
|
_onDropZoneNewUpload: function _onDropZoneNewUpload(event) {
|
|
17189
|
-
console.log("on DropZone New Upload:", event);
|
|
17234
|
+
// console.log("on DropZone New Upload:", event);
|
|
17190
17235
|
this.refs.scrollPane && this.refs.scrollPane.scrollBottom();
|
|
17191
17236
|
},
|
|
17192
17237
|
_onDropZoneUpload: function _onDropZoneUpload(event) {
|
|
17193
|
-
console.log("on DropZone Upload:", event);
|
|
17238
|
+
// console.log("on DropZone Upload:", event);
|
|
17194
17239
|
this.toggle(event);
|
|
17195
17240
|
},
|
|
17196
17241
|
|
|
@@ -17200,7 +17245,7 @@ var template = function () {
|
|
|
17200
17245
|
*/
|
|
17201
17246
|
|
|
17202
17247
|
_onUpdate: function _onUpdate(event) {
|
|
17203
|
-
console.log("on Update Content:", event);
|
|
17248
|
+
// console.log("on Update Content:", event);
|
|
17204
17249
|
|
|
17205
17250
|
// re-load uploaded files
|
|
17206
17251
|
this.refresh();
|
|
@@ -17210,12 +17255,12 @@ var template = function () {
|
|
|
17210
17255
|
file = _ref2[0],
|
|
17211
17256
|
instanceId = _ref2[1];
|
|
17212
17257
|
|
|
17213
|
-
console.log("on Upload Complete:", file, instanceId);
|
|
17258
|
+
// console.log("on Upload Complete:", file, instanceId);
|
|
17214
17259
|
|
|
17215
17260
|
// toggle the file only if it's upload originated from this instance
|
|
17216
17261
|
if (instanceId === this.get('instanceId')) this._toggleSelect(file, { afterUpload: true });
|
|
17217
17262
|
|
|
17218
|
-
//
|
|
17263
|
+
// reload files by upload date
|
|
17219
17264
|
// this.refresh();
|
|
17220
17265
|
}
|
|
17221
17266
|
}
|
|
@@ -17224,8 +17269,8 @@ var template = function () {
|
|
|
17224
17269
|
|
|
17225
17270
|
function add_css() {
|
|
17226
17271
|
var style = __WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["e" /* createElement */]('style');
|
|
17227
|
-
style.id = "svelte-
|
|
17228
|
-
style.textContent = "\n section[svelte-
|
|
17272
|
+
style.id = "svelte-3857146246-style";
|
|
17273
|
+
style.textContent = "\n section[svelte-3857146246], [svelte-3857146246] section {\n display: flex;\n flex-direction: column;\n padding-left: 20px;\n height: calc(100% - 25px);\n color: #665b68;\n }\n\n a[svelte-3857146246]:focus, [svelte-3857146246] a:focus {\n outline: none;\n }\n\n [svelte-3857146246].error-panel, [svelte-3857146246] .error-panel {\n position: relative;\n top: 50%;\n transform: translateY(-50%);\n text-align: center;\n padding-right: 20px;\n }\n\n [svelte-3857146246].browser-nav, [svelte-3857146246] .browser-nav {\n position: static;\n\n font-family: ProximaNova-Regular;\n font-size: 16px;\n color: #0055FF;\n }\n\n [svelte-3857146246].blogvio-browser-title, [svelte-3857146246] .blogvio-browser-title {\n margin-top: 0;\n font: 30px/60px \"ProximaNova-Regular\";\n color: #0055FF;\n }\n\n [svelte-3857146246].nano, [svelte-3857146246] .nano {\n flex: 1;\n }\n\n strong[svelte-3857146246], [svelte-3857146246] strong {\n color: #0055FF;\n }\n\n [svelte-3857146246].dropzone_plchldr, [svelte-3857146246] .dropzone_plchldr {\n position: relative;\n margin: 20px 20px 20px 0;\n height: 75px;\n }\n\n [svelte-3857146246].dropzone, [svelte-3857146246] .dropzone {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n\n [svelte-3857146246].scrolling-container, [svelte-3857146246] .scrolling-container {\n transition: opacity 200ms ease-in;\n }\n\n [svelte-3857146246].dropzone--dragging .scrolling-container, [svelte-3857146246] .dropzone--dragging .scrolling-container {\n opacity: 0.4;\n }\n\n [svelte-3857146246].dropzone--dragging .dropzone, [svelte-3857146246] .dropzone--dragging .dropzone {\n top: -100px;\n }\n\n [svelte-3857146246].dropzone--large .dropzone, [svelte-3857146246] .dropzone--large .dropzone,\n [svelte-3857146246].dropzone--dragging .dropzone--large .dropzone, [svelte-3857146246] .dropzone--dragging .dropzone--large .dropzone {\n top: -200px;\n }\n\n [svelte-3857146246].icon, [svelte-3857146246] .icon {\n display: inline-block;\n width: 1em;\n height: 1em;\n stroke-width: 0;\n stroke: currentColor;\n fill: currentColor\n }\n\n [svelte-3857146246].clear-content svg, [svelte-3857146246] .clear-content svg {\n width: 14px;\n fill: #a0a0a0;\n position: relative;\n top: 1px;\n right: 2px;\n }\n\n [svelte-3857146246].clear-content:hover svg, [svelte-3857146246] .clear-content:hover svg {\n fill: #665b68;\n }\n";
|
|
17229
17274
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["b" /* appendNode */](style, document.head);
|
|
17230
17275
|
}
|
|
17231
17276
|
|
|
@@ -17270,7 +17315,7 @@ function create_main_fragment(state, component) {
|
|
|
17270
17315
|
},
|
|
17271
17316
|
|
|
17272
17317
|
hydrate: function hydrate(nodes) {
|
|
17273
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'svelte-
|
|
17318
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'svelte-3857146246', '');
|
|
17274
17319
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'style', "position: absolute; width: 0; height: 0; overflow: hidden");
|
|
17275
17320
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'version', "1.1");
|
|
17276
17321
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'xmlns', "http://www.w3.org/2000/svg");
|
|
@@ -17838,7 +17883,7 @@ function create_if_block_1(state, component) {
|
|
|
17838
17883
|
},
|
|
17839
17884
|
|
|
17840
17885
|
hydrate: function hydrate(nodes) {
|
|
17841
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-
|
|
17886
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-3857146246', '');
|
|
17842
17887
|
div.className = "error-panel";
|
|
17843
17888
|
h2.className = "blogvio-browser-title";
|
|
17844
17889
|
a.href = "#";
|
|
@@ -17942,9 +17987,9 @@ function create_if_block_2(state, component) {
|
|
|
17942
17987
|
},
|
|
17943
17988
|
|
|
17944
17989
|
hydrate: function hydrate(nodes) {
|
|
17945
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-
|
|
17990
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-3857146246', '');
|
|
17946
17991
|
div.className = "browser-nav";
|
|
17947
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](section, 'svelte-
|
|
17992
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](section, 'svelte-3857146246', '');
|
|
17948
17993
|
section.className = section_class_value = state.dragging ? 'dropzone--dragging' : '';
|
|
17949
17994
|
div_1.className = div_1_class_value = "dropzone_plchldr " + (!state.files.length ? 'dropzone--large' : '');
|
|
17950
17995
|
},
|
|
@@ -18077,7 +18122,7 @@ function SvelteComponent(options) {
|
|
|
18077
18122
|
this._yield = options._yield;
|
|
18078
18123
|
|
|
18079
18124
|
this._torndown = false;
|
|
18080
|
-
if (!document.getElementById("svelte-
|
|
18125
|
+
if (!document.getElementById("svelte-3857146246-style")) add_css();
|
|
18081
18126
|
this._renderHooks = [];
|
|
18082
18127
|
|
|
18083
18128
|
this._fragment = create_main_fragment(this._state, this);
|