@widgetic/editor 3.10.49 → 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,20 +17134,37 @@ 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) {
|
|
17144
|
+
|
|
17145
|
+
// read a lastModified timestamp
|
|
17124
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
|
|
17125
17152
|
if (!x) x = 0;
|
|
17153
|
+
// a.lastModified = x;
|
|
17126
17154
|
|
|
17155
|
+
|
|
17156
|
+
// read b lastModified timestamp
|
|
17127
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
|
|
17128
17163
|
if (!y) y = 0;
|
|
17164
|
+
// b.lastModified = y;
|
|
17165
|
+
|
|
17129
17166
|
|
|
17130
|
-
// console.log("x & y: ", x, y);
|
|
17167
|
+
// console.log("x & y: ", a.lastModified, x, b.lastModified, y);
|
|
17131
17168
|
|
|
17132
17169
|
return x - y;
|
|
17133
17170
|
});
|
|
@@ -17194,11 +17231,11 @@ var template = function () {
|
|
|
17194
17231
|
*/
|
|
17195
17232
|
|
|
17196
17233
|
_onDropZoneNewUpload: function _onDropZoneNewUpload(event) {
|
|
17197
|
-
console.log("on DropZone New Upload:", event);
|
|
17234
|
+
// console.log("on DropZone New Upload:", event);
|
|
17198
17235
|
this.refs.scrollPane && this.refs.scrollPane.scrollBottom();
|
|
17199
17236
|
},
|
|
17200
17237
|
_onDropZoneUpload: function _onDropZoneUpload(event) {
|
|
17201
|
-
console.log("on DropZone Upload:", event);
|
|
17238
|
+
// console.log("on DropZone Upload:", event);
|
|
17202
17239
|
this.toggle(event);
|
|
17203
17240
|
},
|
|
17204
17241
|
|
|
@@ -17232,8 +17269,8 @@ var template = function () {
|
|
|
17232
17269
|
|
|
17233
17270
|
function add_css() {
|
|
17234
17271
|
var style = __WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["e" /* createElement */]('style');
|
|
17235
|
-
style.id = "svelte-
|
|
17236
|
-
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";
|
|
17237
17274
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["b" /* appendNode */](style, document.head);
|
|
17238
17275
|
}
|
|
17239
17276
|
|
|
@@ -17278,7 +17315,7 @@ function create_main_fragment(state, component) {
|
|
|
17278
17315
|
},
|
|
17279
17316
|
|
|
17280
17317
|
hydrate: function hydrate(nodes) {
|
|
17281
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'svelte-
|
|
17318
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'svelte-3857146246', '');
|
|
17282
17319
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'style', "position: absolute; width: 0; height: 0; overflow: hidden");
|
|
17283
17320
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'version', "1.1");
|
|
17284
17321
|
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](svg, 'xmlns', "http://www.w3.org/2000/svg");
|
|
@@ -17846,7 +17883,7 @@ function create_if_block_1(state, component) {
|
|
|
17846
17883
|
},
|
|
17847
17884
|
|
|
17848
17885
|
hydrate: function hydrate(nodes) {
|
|
17849
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-
|
|
17886
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-3857146246', '');
|
|
17850
17887
|
div.className = "error-panel";
|
|
17851
17888
|
h2.className = "blogvio-browser-title";
|
|
17852
17889
|
a.href = "#";
|
|
@@ -17950,9 +17987,9 @@ function create_if_block_2(state, component) {
|
|
|
17950
17987
|
},
|
|
17951
17988
|
|
|
17952
17989
|
hydrate: function hydrate(nodes) {
|
|
17953
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-
|
|
17990
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](div, 'svelte-3857146246', '');
|
|
17954
17991
|
div.className = "browser-nav";
|
|
17955
|
-
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](section, 'svelte-
|
|
17992
|
+
__WEBPACK_IMPORTED_MODULE_4_svelte_shared_js__["p" /* setAttribute */](section, 'svelte-3857146246', '');
|
|
17956
17993
|
section.className = section_class_value = state.dragging ? 'dropzone--dragging' : '';
|
|
17957
17994
|
div_1.className = div_1_class_value = "dropzone_plchldr " + (!state.files.length ? 'dropzone--large' : '');
|
|
17958
17995
|
},
|
|
@@ -18085,7 +18122,7 @@ function SvelteComponent(options) {
|
|
|
18085
18122
|
this._yield = options._yield;
|
|
18086
18123
|
|
|
18087
18124
|
this._torndown = false;
|
|
18088
|
-
if (!document.getElementById("svelte-
|
|
18125
|
+
if (!document.getElementById("svelte-3857146246-style")) add_css();
|
|
18089
18126
|
this._renderHooks = [];
|
|
18090
18127
|
|
|
18091
18128
|
this._fragment = create_main_fragment(this._state, this);
|