@innovastudio/contentbuilder 1.4.45 → 1.4.48

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.
@@ -2,466 +2,466 @@ var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof win
2
2
 
3
3
  var rangyCore = {exports: {}};
4
4
 
5
- /**
6
- * Rangy, a cross-browser JavaScript range and selection library
7
- * https://github.com/timdown/rangy
8
- *
9
- * Copyright 2015, Tim Down
10
- * Licensed under the MIT license.
11
- * Version: 1.3.0
12
- * Build date: 10 May 2015
5
+ /**
6
+ * Rangy, a cross-browser JavaScript range and selection library
7
+ * https://github.com/timdown/rangy
8
+ *
9
+ * Copyright 2022, Tim Down
10
+ * Licensed under the MIT license.
11
+ * Version: 1.3.1
12
+ * Build date: 17 August 2022
13
13
  */
14
14
 
15
15
  (function (module, exports) {
16
- (function(factory, root) {
17
- {
18
- // Node/CommonJS style
19
- module.exports = factory();
20
- }
21
- })(function() {
22
-
23
- var OBJECT = "object", FUNCTION = "function", UNDEFINED = "undefined";
24
-
25
- // Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START
26
- // are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.
27
- var domRangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
28
- "commonAncestorContainer"];
29
-
30
- // Minimal set of methods required for DOM Level 2 Range compliance
31
- var domRangeMethods = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore",
32
- "setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents",
33
- "extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"];
34
-
35
- var textRangeProperties = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"];
36
-
37
- // Subset of TextRange's full set of methods that we're interested in
38
- var textRangeMethods = ["collapse", "compareEndPoints", "duplicate", "moveToElementText", "parentElement", "select",
39
- "setEndPoint", "getBoundingClientRect"];
40
-
41
- /*----------------------------------------------------------------------------------------------------------------*/
42
-
43
- // Trio of functions taken from Peter Michaux's article:
44
- // http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
45
- function isHostMethod(o, p) {
46
- var t = typeof o[p];
47
- return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
48
- }
49
-
50
- function isHostObject(o, p) {
51
- return !!(typeof o[p] == OBJECT && o[p]);
52
- }
53
-
54
- function isHostProperty(o, p) {
55
- return typeof o[p] != UNDEFINED;
56
- }
57
-
58
- // Creates a convenience function to save verbose repeated calls to tests functions
59
- function createMultiplePropertyTest(testFunc) {
60
- return function(o, props) {
61
- var i = props.length;
62
- while (i--) {
63
- if (!testFunc(o, props[i])) {
64
- return false;
65
- }
66
- }
67
- return true;
68
- };
69
- }
70
-
71
- // Next trio of functions are a convenience to save verbose repeated calls to previous two functions
72
- var areHostMethods = createMultiplePropertyTest(isHostMethod);
73
- var areHostObjects = createMultiplePropertyTest(isHostObject);
74
- var areHostProperties = createMultiplePropertyTest(isHostProperty);
75
-
76
- function isTextRange(range) {
77
- return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);
78
- }
79
-
80
- function getBody(doc) {
81
- return isHostObject(doc, "body") ? doc.body : doc.getElementsByTagName("body")[0];
82
- }
83
-
84
- var forEach = [].forEach ?
85
- function(arr, func) {
86
- arr.forEach(func);
87
- } :
88
- function(arr, func) {
89
- for (var i = 0, len = arr.length; i < len; ++i) {
90
- func(arr[i], i);
91
- }
92
- };
93
-
94
- var modules = {};
95
-
96
- var isBrowser = (typeof window != UNDEFINED && typeof document != UNDEFINED);
97
-
98
- var util = {
99
- isHostMethod: isHostMethod,
100
- isHostObject: isHostObject,
101
- isHostProperty: isHostProperty,
102
- areHostMethods: areHostMethods,
103
- areHostObjects: areHostObjects,
104
- areHostProperties: areHostProperties,
105
- isTextRange: isTextRange,
106
- getBody: getBody,
107
- forEach: forEach
108
- };
109
-
110
- var api = {
111
- version: "1.3.0",
112
- initialized: false,
113
- isBrowser: isBrowser,
114
- supported: true,
115
- util: util,
116
- features: {},
117
- modules: modules,
118
- config: {
119
- alertOnFail: false,
120
- alertOnWarn: false,
121
- preferTextRange: false,
122
- autoInitialize: (typeof rangyAutoInitialize == UNDEFINED) ? true : rangyAutoInitialize
123
- }
124
- };
125
-
126
- function consoleLog(msg) {
127
- if (typeof console != UNDEFINED && isHostMethod(console, "log")) {
128
- console.log(msg);
129
- }
130
- }
131
-
132
- function alertOrLog(msg, shouldAlert) {
133
- if (isBrowser && shouldAlert) {
134
- alert(msg);
135
- } else {
136
- consoleLog(msg);
137
- }
138
- }
139
-
140
- function fail(reason) {
141
- api.initialized = true;
142
- api.supported = false;
143
- alertOrLog("Rangy is not supported in this environment. Reason: " + reason, api.config.alertOnFail);
144
- }
145
-
146
- api.fail = fail;
147
-
148
- function warn(msg) {
149
- alertOrLog("Rangy warning: " + msg, api.config.alertOnWarn);
150
- }
151
-
152
- api.warn = warn;
153
-
154
- // Add utility extend() method
155
- var extend;
156
- if ({}.hasOwnProperty) {
157
- util.extend = extend = function(obj, props, deep) {
158
- var o, p;
159
- for (var i in props) {
160
- if (props.hasOwnProperty(i)) {
161
- o = obj[i];
162
- p = props[i];
163
- if (deep && o !== null && typeof o == "object" && p !== null && typeof p == "object") {
164
- extend(o, p, true);
165
- }
166
- obj[i] = p;
167
- }
168
- }
169
- // Special case for toString, which does not show up in for...in loops in IE <= 8
170
- if (props.hasOwnProperty("toString")) {
171
- obj.toString = props.toString;
172
- }
173
- return obj;
174
- };
175
-
176
- util.createOptions = function(optionsParam, defaults) {
177
- var options = {};
178
- extend(options, defaults);
179
- if (optionsParam) {
180
- extend(options, optionsParam);
181
- }
182
- return options;
183
- };
184
- } else {
185
- fail("hasOwnProperty not supported");
186
- }
187
-
188
- // Test whether we're in a browser and bail out if not
189
- if (!isBrowser) {
190
- fail("Rangy can only run in a browser");
191
- }
192
-
193
- // Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not
194
- (function() {
195
- var toArray;
196
-
197
- if (isBrowser) {
198
- var el = document.createElement("div");
199
- el.appendChild(document.createElement("span"));
200
- var slice = [].slice;
201
- try {
202
- if (slice.call(el.childNodes, 0)[0].nodeType == 1) {
203
- toArray = function(arrayLike) {
204
- return slice.call(arrayLike, 0);
205
- };
206
- }
207
- } catch (e) {}
208
- }
209
-
210
- if (!toArray) {
211
- toArray = function(arrayLike) {
212
- var arr = [];
213
- for (var i = 0, len = arrayLike.length; i < len; ++i) {
214
- arr[i] = arrayLike[i];
215
- }
216
- return arr;
217
- };
218
- }
219
-
220
- util.toArray = toArray;
221
- })();
222
-
223
- // Very simple event handler wrapper function that doesn't attempt to solve issues such as "this" handling or
224
- // normalization of event properties
225
- var addListener;
226
- if (isBrowser) {
227
- if (isHostMethod(document, "addEventListener")) {
228
- addListener = function(obj, eventType, listener) {
229
- obj.addEventListener(eventType, listener, false);
230
- };
231
- } else if (isHostMethod(document, "attachEvent")) {
232
- addListener = function(obj, eventType, listener) {
233
- obj.attachEvent("on" + eventType, listener);
234
- };
235
- } else {
236
- fail("Document does not have required addEventListener or attachEvent method");
237
- }
238
-
239
- util.addListener = addListener;
240
- }
241
-
242
- var initListeners = [];
243
-
244
- function getErrorDesc(ex) {
245
- return ex.message || ex.description || String(ex);
246
- }
247
-
248
- // Initialization
249
- function init() {
250
- if (!isBrowser || api.initialized) {
251
- return;
252
- }
253
- var testRange;
254
- var implementsDomRange = false, implementsTextRange = false;
255
-
256
- // First, perform basic feature tests
257
-
258
- if (isHostMethod(document, "createRange")) {
259
- testRange = document.createRange();
260
- if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {
261
- implementsDomRange = true;
262
- }
263
- }
264
-
265
- var body = getBody(document);
266
- if (!body || body.nodeName.toLowerCase() != "body") {
267
- fail("No body element found");
268
- return;
269
- }
270
-
271
- if (body && isHostMethod(body, "createTextRange")) {
272
- testRange = body.createTextRange();
273
- if (isTextRange(testRange)) {
274
- implementsTextRange = true;
275
- }
276
- }
277
-
278
- if (!implementsDomRange && !implementsTextRange) {
279
- fail("Neither Range nor TextRange are available");
280
- return;
281
- }
282
-
283
- api.initialized = true;
284
- api.features = {
285
- implementsDomRange: implementsDomRange,
286
- implementsTextRange: implementsTextRange
287
- };
288
-
289
- // Initialize modules
290
- var module, errorMessage;
291
- for (var moduleName in modules) {
292
- if ( (module = modules[moduleName]) instanceof Module ) {
293
- module.init(module, api);
294
- }
295
- }
296
-
297
- // Call init listeners
298
- for (var i = 0, len = initListeners.length; i < len; ++i) {
299
- try {
300
- initListeners[i](api);
301
- } catch (ex) {
302
- errorMessage = "Rangy init listener threw an exception. Continuing. Detail: " + getErrorDesc(ex);
303
- consoleLog(errorMessage);
304
- }
305
- }
306
- }
307
-
308
- function deprecationNotice(deprecated, replacement, module) {
309
- if (module) {
310
- deprecated += " in module " + module.name;
311
- }
312
- api.warn("DEPRECATED: " + deprecated + " is deprecated. Please use " +
313
- replacement + " instead.");
314
- }
315
-
316
- function createAliasForDeprecatedMethod(owner, deprecated, replacement, module) {
317
- owner[deprecated] = function() {
318
- deprecationNotice(deprecated, replacement, module);
319
- return owner[replacement].apply(owner, util.toArray(arguments));
320
- };
321
- }
322
-
323
- util.deprecationNotice = deprecationNotice;
324
- util.createAliasForDeprecatedMethod = createAliasForDeprecatedMethod;
325
-
326
- // Allow external scripts to initialize this library in case it's loaded after the document has loaded
327
- api.init = init;
328
-
329
- // Execute listener immediately if already initialized
330
- api.addInitListener = function(listener) {
331
- if (api.initialized) {
332
- listener(api);
333
- } else {
334
- initListeners.push(listener);
335
- }
336
- };
337
-
338
- var shimListeners = [];
339
-
340
- api.addShimListener = function(listener) {
341
- shimListeners.push(listener);
342
- };
343
-
344
- function shim(win) {
345
- win = win || window;
346
- init();
347
-
348
- // Notify listeners
349
- for (var i = 0, len = shimListeners.length; i < len; ++i) {
350
- shimListeners[i](win);
351
- }
352
- }
353
-
354
- if (isBrowser) {
355
- api.shim = api.createMissingNativeApi = shim;
356
- createAliasForDeprecatedMethod(api, "createMissingNativeApi", "shim");
357
- }
358
-
359
- function Module(name, dependencies, initializer) {
360
- this.name = name;
361
- this.dependencies = dependencies;
362
- this.initialized = false;
363
- this.supported = false;
364
- this.initializer = initializer;
365
- }
366
-
367
- Module.prototype = {
368
- init: function() {
369
- var requiredModuleNames = this.dependencies || [];
370
- for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {
371
- moduleName = requiredModuleNames[i];
372
-
373
- requiredModule = modules[moduleName];
374
- if (!requiredModule || !(requiredModule instanceof Module)) {
375
- throw new Error("required module '" + moduleName + "' not found");
376
- }
377
-
378
- requiredModule.init();
379
-
380
- if (!requiredModule.supported) {
381
- throw new Error("required module '" + moduleName + "' not supported");
382
- }
383
- }
384
-
385
- // Now run initializer
386
- this.initializer(this);
387
- },
388
-
389
- fail: function(reason) {
390
- this.initialized = true;
391
- this.supported = false;
392
- throw new Error(reason);
393
- },
394
-
395
- warn: function(msg) {
396
- api.warn("Module " + this.name + ": " + msg);
397
- },
398
-
399
- deprecationNotice: function(deprecated, replacement) {
400
- api.warn("DEPRECATED: " + deprecated + " in module " + this.name + " is deprecated. Please use " +
401
- replacement + " instead");
402
- },
403
-
404
- createError: function(msg) {
405
- return new Error("Error in Rangy " + this.name + " module: " + msg);
406
- }
407
- };
408
-
409
- function createModule(name, dependencies, initFunc) {
410
- var newModule = new Module(name, dependencies, function(module) {
411
- if (!module.initialized) {
412
- module.initialized = true;
413
- try {
414
- initFunc(api, module);
415
- module.supported = true;
416
- } catch (ex) {
417
- var errorMessage = "Module '" + name + "' failed to load: " + getErrorDesc(ex);
418
- consoleLog(errorMessage);
419
- if (ex.stack) {
420
- consoleLog(ex.stack);
421
- }
422
- }
423
- }
424
- });
425
- modules[name] = newModule;
426
- return newModule;
427
- }
428
-
429
- api.createModule = function(name) {
430
- // Allow 2 or 3 arguments (second argument is an optional array of dependencies)
431
- var initFunc, dependencies;
432
- if (arguments.length == 2) {
433
- initFunc = arguments[1];
434
- dependencies = [];
435
- } else {
436
- initFunc = arguments[2];
437
- dependencies = arguments[1];
438
- }
439
-
440
- var module = createModule(name, dependencies, initFunc);
441
-
442
- // Initialize the module immediately if the core is already initialized
443
- if (api.initialized && api.supported) {
444
- module.init();
445
- }
446
- };
447
-
448
- api.createCoreModule = function(name, dependencies, initFunc) {
449
- createModule(name, dependencies, initFunc);
450
- };
451
-
452
- /*----------------------------------------------------------------------------------------------------------------*/
453
-
454
- // Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately
455
-
456
- function RangePrototype() {}
457
- api.RangePrototype = RangePrototype;
458
- api.rangePrototype = new RangePrototype();
459
-
460
- function SelectionPrototype() {}
461
- api.selectionPrototype = new SelectionPrototype();
462
-
463
- /*----------------------------------------------------------------------------------------------------------------*/
464
-
16
+ (function(factory, root) {
17
+ {
18
+ // Node/CommonJS style
19
+ module.exports = factory();
20
+ }
21
+ })(function() {
22
+
23
+ var OBJECT = "object", FUNCTION = "function", UNDEFINED = "undefined";
24
+
25
+ // Minimal set of properties required for DOM Level 2 Range compliance. Comparison constants such as START_TO_START
26
+ // are omitted because ranges in KHTML do not have them but otherwise work perfectly well. See issue 113.
27
+ var domRangeProperties = ["startContainer", "startOffset", "endContainer", "endOffset", "collapsed",
28
+ "commonAncestorContainer"];
29
+
30
+ // Minimal set of methods required for DOM Level 2 Range compliance
31
+ var domRangeMethods = ["setStart", "setStartBefore", "setStartAfter", "setEnd", "setEndBefore",
32
+ "setEndAfter", "collapse", "selectNode", "selectNodeContents", "compareBoundaryPoints", "deleteContents",
33
+ "extractContents", "cloneContents", "insertNode", "surroundContents", "cloneRange", "toString", "detach"];
34
+
35
+ var textRangeProperties = ["boundingHeight", "boundingLeft", "boundingTop", "boundingWidth", "htmlText", "text"];
36
+
37
+ // Subset of TextRange's full set of methods that we're interested in
38
+ var textRangeMethods = ["collapse", "compareEndPoints", "duplicate", "moveToElementText", "parentElement", "select",
39
+ "setEndPoint", "getBoundingClientRect"];
40
+
41
+ /*----------------------------------------------------------------------------------------------------------------*/
42
+
43
+ // Trio of functions taken from Peter Michaux's article:
44
+ // http://peter.michaux.ca/articles/feature-detection-state-of-the-art-browser-scripting
45
+ function isHostMethod(o, p) {
46
+ var t = typeof o[p];
47
+ return t == FUNCTION || (!!(t == OBJECT && o[p])) || t == "unknown";
48
+ }
49
+
50
+ function isHostObject(o, p) {
51
+ return !!(typeof o[p] == OBJECT && o[p]);
52
+ }
53
+
54
+ function isHostProperty(o, p) {
55
+ return typeof o[p] != UNDEFINED;
56
+ }
57
+
58
+ // Creates a convenience function to save verbose repeated calls to tests functions
59
+ function createMultiplePropertyTest(testFunc) {
60
+ return function(o, props) {
61
+ var i = props.length;
62
+ while (i--) {
63
+ if (!testFunc(o, props[i])) {
64
+ return false;
65
+ }
66
+ }
67
+ return true;
68
+ };
69
+ }
70
+
71
+ // Next trio of functions are a convenience to save verbose repeated calls to previous two functions
72
+ var areHostMethods = createMultiplePropertyTest(isHostMethod);
73
+ var areHostObjects = createMultiplePropertyTest(isHostObject);
74
+ var areHostProperties = createMultiplePropertyTest(isHostProperty);
75
+
76
+ function isTextRange(range) {
77
+ return range && areHostMethods(range, textRangeMethods) && areHostProperties(range, textRangeProperties);
78
+ }
79
+
80
+ function getBody(doc) {
81
+ return isHostObject(doc, "body") ? doc.body : doc.getElementsByTagName("body")[0];
82
+ }
83
+
84
+ var forEach = [].forEach ?
85
+ function(arr, func) {
86
+ arr.forEach(func);
87
+ } :
88
+ function(arr, func) {
89
+ for (var i = 0, len = arr.length; i < len; ++i) {
90
+ func(arr[i], i);
91
+ }
92
+ };
93
+
94
+ var modules = {};
95
+
96
+ var isBrowser = (typeof window != UNDEFINED && typeof document != UNDEFINED);
97
+
98
+ var util = {
99
+ isHostMethod: isHostMethod,
100
+ isHostObject: isHostObject,
101
+ isHostProperty: isHostProperty,
102
+ areHostMethods: areHostMethods,
103
+ areHostObjects: areHostObjects,
104
+ areHostProperties: areHostProperties,
105
+ isTextRange: isTextRange,
106
+ getBody: getBody,
107
+ forEach: forEach
108
+ };
109
+
110
+ var api = {
111
+ version: "1.3.1",
112
+ initialized: false,
113
+ isBrowser: isBrowser,
114
+ supported: true,
115
+ util: util,
116
+ features: {},
117
+ modules: modules,
118
+ config: {
119
+ alertOnFail: false,
120
+ alertOnWarn: false,
121
+ preferTextRange: false,
122
+ autoInitialize: (typeof rangyAutoInitialize == UNDEFINED) ? true : rangyAutoInitialize
123
+ }
124
+ };
125
+
126
+ function consoleLog(msg) {
127
+ if (typeof console != UNDEFINED && isHostMethod(console, "log")) {
128
+ console.log(msg);
129
+ }
130
+ }
131
+
132
+ function alertOrLog(msg, shouldAlert) {
133
+ if (isBrowser && shouldAlert) {
134
+ alert(msg);
135
+ } else {
136
+ consoleLog(msg);
137
+ }
138
+ }
139
+
140
+ function fail(reason) {
141
+ api.initialized = true;
142
+ api.supported = false;
143
+ alertOrLog("Rangy is not supported in this environment. Reason: " + reason, api.config.alertOnFail);
144
+ }
145
+
146
+ api.fail = fail;
147
+
148
+ function warn(msg) {
149
+ alertOrLog("Rangy warning: " + msg, api.config.alertOnWarn);
150
+ }
151
+
152
+ api.warn = warn;
153
+
154
+ // Add utility extend() method
155
+ var extend;
156
+ if ({}.hasOwnProperty) {
157
+ util.extend = extend = function(obj, props, deep) {
158
+ var o, p;
159
+ for (var i in props) {
160
+ if (props.hasOwnProperty(i)) {
161
+ o = obj[i];
162
+ p = props[i];
163
+ if (deep && o !== null && typeof o == "object" && p !== null && typeof p == "object") {
164
+ extend(o, p, true);
165
+ }
166
+ obj[i] = p;
167
+ }
168
+ }
169
+ // Special case for toString, which does not show up in for...in loops in IE <= 8
170
+ if (props.hasOwnProperty("toString")) {
171
+ obj.toString = props.toString;
172
+ }
173
+ return obj;
174
+ };
175
+
176
+ util.createOptions = function(optionsParam, defaults) {
177
+ var options = {};
178
+ extend(options, defaults);
179
+ if (optionsParam) {
180
+ extend(options, optionsParam);
181
+ }
182
+ return options;
183
+ };
184
+ } else {
185
+ fail("hasOwnProperty not supported");
186
+ }
187
+
188
+ // Test whether we're in a browser and bail out if not
189
+ if (!isBrowser) {
190
+ fail("Rangy can only run in a browser");
191
+ }
192
+
193
+ // Test whether Array.prototype.slice can be relied on for NodeLists and use an alternative toArray() if not
194
+ (function() {
195
+ var toArray;
196
+
197
+ if (isBrowser) {
198
+ var el = document.createElement("div");
199
+ el.appendChild(document.createElement("span"));
200
+ var slice = [].slice;
201
+ try {
202
+ if (slice.call(el.childNodes, 0)[0].nodeType == 1) {
203
+ toArray = function(arrayLike) {
204
+ return slice.call(arrayLike, 0);
205
+ };
206
+ }
207
+ } catch (e) {}
208
+ }
209
+
210
+ if (!toArray) {
211
+ toArray = function(arrayLike) {
212
+ var arr = [];
213
+ for (var i = 0, len = arrayLike.length; i < len; ++i) {
214
+ arr[i] = arrayLike[i];
215
+ }
216
+ return arr;
217
+ };
218
+ }
219
+
220
+ util.toArray = toArray;
221
+ })();
222
+
223
+ // Very simple event handler wrapper function that doesn't attempt to solve issues such as "this" handling or
224
+ // normalization of event properties because we don't need this.
225
+ var addListener;
226
+ if (isBrowser) {
227
+ if (isHostMethod(document, "addEventListener")) {
228
+ addListener = function(obj, eventType, listener) {
229
+ obj.addEventListener(eventType, listener, false);
230
+ };
231
+ } else if (isHostMethod(document, "attachEvent")) {
232
+ addListener = function(obj, eventType, listener) {
233
+ obj.attachEvent("on" + eventType, listener);
234
+ };
235
+ } else {
236
+ fail("Document does not have required addEventListener or attachEvent method");
237
+ }
238
+
239
+ util.addListener = addListener;
240
+ }
241
+
242
+ var initListeners = [];
243
+
244
+ function getErrorDesc(ex) {
245
+ return ex.message || ex.description || String(ex);
246
+ }
247
+
248
+ // Initialization
249
+ function init() {
250
+ if (!isBrowser || api.initialized) {
251
+ return;
252
+ }
253
+ var testRange;
254
+ var implementsDomRange = false, implementsTextRange = false;
255
+
256
+ // First, perform basic feature tests
257
+
258
+ if (isHostMethod(document, "createRange")) {
259
+ testRange = document.createRange();
260
+ if (areHostMethods(testRange, domRangeMethods) && areHostProperties(testRange, domRangeProperties)) {
261
+ implementsDomRange = true;
262
+ }
263
+ }
264
+
265
+ var body = getBody(document);
266
+ if (!body || body.nodeName.toLowerCase() != "body") {
267
+ fail("No body element found");
268
+ return;
269
+ }
270
+
271
+ if (body && isHostMethod(body, "createTextRange")) {
272
+ testRange = body.createTextRange();
273
+ if (isTextRange(testRange)) {
274
+ implementsTextRange = true;
275
+ }
276
+ }
277
+
278
+ if (!implementsDomRange && !implementsTextRange) {
279
+ fail("Neither Range nor TextRange are available");
280
+ return;
281
+ }
282
+
283
+ api.initialized = true;
284
+ api.features = {
285
+ implementsDomRange: implementsDomRange,
286
+ implementsTextRange: implementsTextRange
287
+ };
288
+
289
+ // Initialize modules
290
+ var module, errorMessage;
291
+ for (var moduleName in modules) {
292
+ if ( (module = modules[moduleName]) instanceof Module ) {
293
+ module.init(module, api);
294
+ }
295
+ }
296
+
297
+ // Call init listeners
298
+ for (var i = 0, len = initListeners.length; i < len; ++i) {
299
+ try {
300
+ initListeners[i](api);
301
+ } catch (ex) {
302
+ errorMessage = "Rangy init listener threw an exception. Continuing. Detail: " + getErrorDesc(ex);
303
+ consoleLog(errorMessage);
304
+ }
305
+ }
306
+ }
307
+
308
+ function deprecationNotice(deprecated, replacement, module) {
309
+ if (module) {
310
+ deprecated += " in module " + module.name;
311
+ }
312
+ api.warn("DEPRECATED: " + deprecated + " is deprecated. Please use " +
313
+ replacement + " instead.");
314
+ }
315
+
316
+ function createAliasForDeprecatedMethod(owner, deprecated, replacement, module) {
317
+ owner[deprecated] = function() {
318
+ deprecationNotice(deprecated, replacement, module);
319
+ return owner[replacement].apply(owner, util.toArray(arguments));
320
+ };
321
+ }
322
+
323
+ util.deprecationNotice = deprecationNotice;
324
+ util.createAliasForDeprecatedMethod = createAliasForDeprecatedMethod;
325
+
326
+ // Allow external scripts to initialize this library in case it's loaded after the document has loaded
327
+ api.init = init;
328
+
329
+ // Execute listener immediately if already initialized
330
+ api.addInitListener = function(listener) {
331
+ if (api.initialized) {
332
+ listener(api);
333
+ } else {
334
+ initListeners.push(listener);
335
+ }
336
+ };
337
+
338
+ var shimListeners = [];
339
+
340
+ api.addShimListener = function(listener) {
341
+ shimListeners.push(listener);
342
+ };
343
+
344
+ function shim(win) {
345
+ win = win || window;
346
+ init();
347
+
348
+ // Notify listeners
349
+ for (var i = 0, len = shimListeners.length; i < len; ++i) {
350
+ shimListeners[i](win);
351
+ }
352
+ }
353
+
354
+ if (isBrowser) {
355
+ api.shim = api.createMissingNativeApi = shim;
356
+ createAliasForDeprecatedMethod(api, "createMissingNativeApi", "shim");
357
+ }
358
+
359
+ function Module(name, dependencies, initializer) {
360
+ this.name = name;
361
+ this.dependencies = dependencies;
362
+ this.initialized = false;
363
+ this.supported = false;
364
+ this.initializer = initializer;
365
+ }
366
+
367
+ Module.prototype = {
368
+ init: function() {
369
+ var requiredModuleNames = this.dependencies || [];
370
+ for (var i = 0, len = requiredModuleNames.length, requiredModule, moduleName; i < len; ++i) {
371
+ moduleName = requiredModuleNames[i];
372
+
373
+ requiredModule = modules[moduleName];
374
+ if (!requiredModule || !(requiredModule instanceof Module)) {
375
+ throw new Error("required module '" + moduleName + "' not found");
376
+ }
377
+
378
+ requiredModule.init();
379
+
380
+ if (!requiredModule.supported) {
381
+ throw new Error("required module '" + moduleName + "' not supported");
382
+ }
383
+ }
384
+
385
+ // Now run initializer
386
+ this.initializer(this);
387
+ },
388
+
389
+ fail: function(reason) {
390
+ this.initialized = true;
391
+ this.supported = false;
392
+ throw new Error(reason);
393
+ },
394
+
395
+ warn: function(msg) {
396
+ api.warn("Module " + this.name + ": " + msg);
397
+ },
398
+
399
+ deprecationNotice: function(deprecated, replacement) {
400
+ api.warn("DEPRECATED: " + deprecated + " in module " + this.name + " is deprecated. Please use " +
401
+ replacement + " instead");
402
+ },
403
+
404
+ createError: function(msg) {
405
+ return new Error("Error in Rangy " + this.name + " module: " + msg);
406
+ }
407
+ };
408
+
409
+ function createModule(name, dependencies, initFunc) {
410
+ var newModule = new Module(name, dependencies, function(module) {
411
+ if (!module.initialized) {
412
+ module.initialized = true;
413
+ try {
414
+ initFunc(api, module);
415
+ module.supported = true;
416
+ } catch (ex) {
417
+ var errorMessage = "Module '" + name + "' failed to load: " + getErrorDesc(ex);
418
+ consoleLog(errorMessage);
419
+ if (ex.stack) {
420
+ consoleLog(ex.stack);
421
+ }
422
+ }
423
+ }
424
+ });
425
+ modules[name] = newModule;
426
+ return newModule;
427
+ }
428
+
429
+ api.createModule = function(name) {
430
+ // Allow 2 or 3 arguments (second argument is an optional array of dependencies)
431
+ var initFunc, dependencies;
432
+ if (arguments.length == 2) {
433
+ initFunc = arguments[1];
434
+ dependencies = [];
435
+ } else {
436
+ initFunc = arguments[2];
437
+ dependencies = arguments[1];
438
+ }
439
+
440
+ var module = createModule(name, dependencies, initFunc);
441
+
442
+ // Initialize the module immediately if the core is already initialized
443
+ if (api.initialized && api.supported) {
444
+ module.init();
445
+ }
446
+ };
447
+
448
+ api.createCoreModule = function(name, dependencies, initFunc) {
449
+ createModule(name, dependencies, initFunc);
450
+ };
451
+
452
+ /*----------------------------------------------------------------------------------------------------------------*/
453
+
454
+ // Ensure rangy.rangePrototype and rangy.selectionPrototype are available immediately
455
+
456
+ function RangePrototype() {}
457
+ api.RangePrototype = RangePrototype;
458
+ api.rangePrototype = new RangePrototype();
459
+
460
+ function SelectionPrototype() {}
461
+ api.selectionPrototype = new SelectionPrototype();
462
+
463
+ /*----------------------------------------------------------------------------------------------------------------*/
464
+
465
465
  // DOM utility methods used by Rangy
466
466
  api.createCoreModule("DomUtil", [], function(api, module) {
467
467
  var UNDEF = "undefined";
@@ -960,10 +960,10 @@ var rangyCore = {exports: {}};
960
960
  };
961
961
 
962
962
  api.DOMException = DOMException;
963
- });
964
-
965
- /*----------------------------------------------------------------------------------------------------------------*/
966
-
963
+ });
964
+
965
+ /*----------------------------------------------------------------------------------------------------------------*/
966
+
967
967
  // Pure JavaScript implementation of DOM Range
968
968
  api.createCoreModule("DomRange", ["DomUtil"], function(api, module) {
969
969
  var dom = api.dom;
@@ -1301,6 +1301,7 @@ var rangyCore = {exports: {}};
1301
1301
  var getDocumentOrFragmentContainer = createAncestorFinder( [9, 11] );
1302
1302
  var getReadonlyAncestor = createAncestorFinder(readonlyNodeTypes);
1303
1303
  var getDocTypeNotationEntityAncestor = createAncestorFinder( [6, 10, 12] );
1304
+ var getElementAncestor = createAncestorFinder( [1] );
1304
1305
 
1305
1306
  function assertNoDocTypeNotationEntityAncestor(node, allowSelf) {
1306
1307
  if (getDocTypeNotationEntityAncestor(node, allowSelf)) {
@@ -1363,7 +1364,7 @@ var rangyCore = {exports: {}};
1363
1364
  var htmlParsingConforms = false;
1364
1365
  try {
1365
1366
  styleEl.innerHTML = "<b>x</b>";
1366
- htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Opera incorrectly creates an element node
1367
+ htmlParsingConforms = (styleEl.firstChild.nodeType == 3); // Pre-Blink Opera incorrectly creates an element node
1367
1368
  } catch (e) {
1368
1369
  // IE 6 and 7 throw
1369
1370
  }
@@ -1964,6 +1965,12 @@ var rangyCore = {exports: {}};
1964
1965
  break;
1965
1966
  }
1966
1967
 
1968
+ assertNoDocTypeNotationEntityAncestor(sc, true);
1969
+ assertValidOffset(sc, so);
1970
+
1971
+ assertNoDocTypeNotationEntityAncestor(ec, true);
1972
+ assertValidOffset(ec, eo);
1973
+
1967
1974
  boundaryUpdater(this, sc, so, ec, eo);
1968
1975
  },
1969
1976
 
@@ -2126,6 +2133,12 @@ var rangyCore = {exports: {}};
2126
2133
  assertNoDocTypeNotationEntityAncestor(node, true);
2127
2134
  assertValidOffset(node, offset);
2128
2135
  this.setStartAndEnd(node, offset);
2136
+ },
2137
+
2138
+ parentElement: function() {
2139
+ assertRangeValid(this);
2140
+ var parentNode = this.commonAncestorContainer;
2141
+ return parentNode ? getElementAncestor(this.commonAncestorContainer, true) : null;
2129
2142
  }
2130
2143
  });
2131
2144
 
@@ -2147,17 +2160,11 @@ var rangyCore = {exports: {}};
2147
2160
  range.endContainer = endContainer;
2148
2161
  range.endOffset = endOffset;
2149
2162
  range.document = dom.getDocument(startContainer);
2150
-
2151
2163
  updateCollapsedAndCommonAncestor(range);
2152
2164
  }
2153
2165
 
2154
2166
  function Range(doc) {
2155
- this.startContainer = doc;
2156
- this.startOffset = 0;
2157
- this.endContainer = doc;
2158
- this.endOffset = 0;
2159
- this.document = doc;
2160
- updateCollapsedAndCommonAncestor(this);
2167
+ updateBoundaries(this, doc, 0, doc, 0);
2161
2168
  }
2162
2169
 
2163
2170
  createPrototypeRange(Range, updateBoundaries);
@@ -2179,10 +2186,10 @@ var rangyCore = {exports: {}};
2179
2186
  });
2180
2187
 
2181
2188
  api.DomRange = Range;
2182
- });
2183
-
2184
- /*----------------------------------------------------------------------------------------------------------------*/
2185
-
2189
+ });
2190
+
2191
+ /*----------------------------------------------------------------------------------------------------------------*/
2192
+
2186
2193
  // Wrappers for the browser's native DOM Range and/or TextRange implementation
2187
2194
  api.createCoreModule("WrappedRange", ["DomRange"], function(api, module) {
2188
2195
  var WrappedRange, WrappedTextRange;
@@ -2785,12 +2792,12 @@ var rangyCore = {exports: {}};
2785
2792
  }
2786
2793
  doc = win = null;
2787
2794
  });
2788
- });
2789
-
2790
- /*----------------------------------------------------------------------------------------------------------------*/
2791
-
2795
+ });
2796
+
2797
+ /*----------------------------------------------------------------------------------------------------------------*/
2798
+
2792
2799
  // This module creates a selection object wrapper that conforms as closely as possible to the Selection specification
2793
- // in the HTML Editing spec (http://dvcs.w3.org/hg/editing/raw-file/tip/editing.html#selections)
2800
+ // in the W3C Selection API spec (https://www.w3.org/TR/selection-api)
2794
2801
  api.createCoreModule("WrappedSelection", ["DomRange", "WrappedRange"], function(api, module) {
2795
2802
  api.config.checkSelectionRanges = true;
2796
2803
 
@@ -2898,6 +2905,10 @@ var rangyCore = {exports: {}};
2898
2905
  var selectionHasExtend = isHostMethod(testSelection, "extend");
2899
2906
  features.selectionHasExtend = selectionHasExtend;
2900
2907
 
2908
+ // Test for existence of native selection setBaseAndExtent() method
2909
+ var selectionHasSetBaseAndExtent = isHostMethod(testSelection, "setBaseAndExtent");
2910
+ features.selectionHasSetBaseAndExtent = selectionHasSetBaseAndExtent;
2911
+
2901
2912
  // Test if rangeCount exists
2902
2913
  var selectionHasRangeCount = (typeof testSelection.rangeCount == NUMBER);
2903
2914
  features.selectionHasRangeCount = selectionHasRangeCount;
@@ -2922,7 +2933,7 @@ var rangyCore = {exports: {}};
2922
2933
  // performed on the current document's selection. See issue 109.
2923
2934
 
2924
2935
  // Note also that if a selection previously existed, it is wiped and later restored by these tests. This
2925
- // will result in the selection direction begin reversed if the original selection was backwards and the
2936
+ // will result in the selection direction being reversed if the original selection was backwards and the
2926
2937
  // browser does not support setting backwards selections (Internet Explorer, I'm looking at you).
2927
2938
  var sel = window.getSelection();
2928
2939
  if (sel) {
@@ -3037,6 +3048,11 @@ var rangyCore = {exports: {}};
3037
3048
  sel.rangeCount = 0;
3038
3049
  sel.isCollapsed = true;
3039
3050
  sel._ranges.length = 0;
3051
+ updateType(sel);
3052
+ }
3053
+
3054
+ function updateType(sel) {
3055
+ sel.type = (sel.rangeCount == 0) ? "None" : (selectionIsCollapsed(sel) ? "Caret" : "Range");
3040
3056
  }
3041
3057
 
3042
3058
  function getNativeRange(range) {
@@ -3086,6 +3102,7 @@ var rangyCore = {exports: {}};
3086
3102
  updateAnchorAndFocusFromRange(sel, wrappedRange, false);
3087
3103
  sel.rangeCount = 1;
3088
3104
  sel.isCollapsed = wrappedRange.collapsed;
3105
+ updateType(sel);
3089
3106
  }
3090
3107
 
3091
3108
  function updateControlSelection(sel) {
@@ -3110,6 +3127,7 @@ var rangyCore = {exports: {}};
3110
3127
  }
3111
3128
  sel.isCollapsed = sel.rangeCount == 1 && sel._ranges[0].collapsed;
3112
3129
  updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], false);
3130
+ updateType(sel);
3113
3131
  }
3114
3132
  }
3115
3133
  }
@@ -3179,6 +3197,7 @@ var rangyCore = {exports: {}};
3179
3197
  sel.win = sel.anchorNode = sel.focusNode = sel._ranges = null;
3180
3198
  sel.rangeCount = sel.anchorOffset = sel.focusOffset = 0;
3181
3199
  sel.detached = true;
3200
+ updateType(sel);
3182
3201
  }
3183
3202
 
3184
3203
  var cachedRangySelections = [];
@@ -3305,6 +3324,7 @@ var rangyCore = {exports: {}};
3305
3324
  this._ranges[this.rangeCount - 1] = range;
3306
3325
  updateAnchorAndFocusFromRange(this, range, selectionIsBackward(this.nativeSelection));
3307
3326
  this.isCollapsed = selectionIsCollapsed(this);
3327
+ updateType(this);
3308
3328
  } else {
3309
3329
  // The range was not added successfully. The simplest thing is to refresh
3310
3330
  this.refresh();
@@ -3373,6 +3393,7 @@ var rangyCore = {exports: {}};
3373
3393
  this.rangeCount = 1;
3374
3394
  this.isCollapsed = this._ranges[0].collapsed;
3375
3395
  updateAnchorAndFocusFromRange(this, range, false);
3396
+ updateType(this);
3376
3397
  }
3377
3398
  };
3378
3399
 
@@ -3431,6 +3452,7 @@ var rangyCore = {exports: {}};
3431
3452
  }
3432
3453
  updateAnchorAndFocusFromRange(sel, sel._ranges[sel.rangeCount - 1], selectionIsBackward(sel.nativeSelection));
3433
3454
  sel.isCollapsed = selectionIsCollapsed(sel);
3455
+ updateType(sel);
3434
3456
  } else {
3435
3457
  updateEmptySelection(sel);
3436
3458
  }
@@ -3445,6 +3467,7 @@ var rangyCore = {exports: {}};
3445
3467
  sel.rangeCount = 1;
3446
3468
  updateAnchorAndFocusFromNativeSelection(sel);
3447
3469
  sel.isCollapsed = selectionIsCollapsed(sel);
3470
+ updateType(sel);
3448
3471
  } else {
3449
3472
  updateEmptySelection(sel);
3450
3473
  }
@@ -3563,6 +3586,12 @@ var rangyCore = {exports: {}};
3563
3586
  }
3564
3587
  }
3565
3588
 
3589
+ function assertValidOffset(node, offset) {
3590
+ if (offset < 0 || offset > (dom.isCharacterDataNode(node) ? node.length : node.childNodes.length)) {
3591
+ throw new DOMException("INDEX_SIZE_ERR");
3592
+ }
3593
+ }
3594
+
3566
3595
  // No current browser conforms fully to the spec for this method, so Rangy's own method is always used
3567
3596
  selProto.collapse = function(node, offset) {
3568
3597
  assertNodeInSameDocument(this, node);
@@ -3599,6 +3628,28 @@ var rangyCore = {exports: {}};
3599
3628
  this.setSingleRange(range);
3600
3629
  };
3601
3630
 
3631
+ if (selectionHasSetBaseAndExtent) {
3632
+ selProto.setBaseAndExtent = function(anchorNode, anchorOffset, focusNode, focusOffset) {
3633
+ this.nativeSelection.setBaseAndExtent(anchorNode, anchorOffset, focusNode, focusOffset);
3634
+ this.refresh();
3635
+ };
3636
+ } else if (selectionHasExtend) {
3637
+ selProto.setBaseAndExtent = function(anchorNode, anchorOffset, focusNode, focusOffset) {
3638
+ assertValidOffset(anchorNode, anchorOffset);
3639
+ assertValidOffset(focusNode, focusOffset);
3640
+ assertNodeInSameDocument(this, anchorNode);
3641
+ assertNodeInSameDocument(this, focusNode);
3642
+ var range = api.createRange(node);
3643
+ var isBackwards = (dom.comparePoints(anchorNode, anchorOffset, focusNode, focusOffset) == -1);
3644
+ if (isBackwards) {
3645
+ range.setStartAndEnd(focusNode, focusOffset, anchorNode, anchorOffset);
3646
+ } else {
3647
+ range.setStartAndEnd(anchorNode, anchorOffset, focusNode, focusOffset);
3648
+ }
3649
+ this.setSingleRange(range, isBackwards);
3650
+ };
3651
+ }
3652
+
3602
3653
  selProto.deleteFromDocument = function() {
3603
3654
  // Sepcial behaviour required for IE's control selections
3604
3655
  if (implementsControlRange && implementsDocSelection && this.docSelection.type == CONTROL) {
@@ -3808,256 +3859,42 @@ var rangyCore = {exports: {}};
3808
3859
  win = null;
3809
3860
  });
3810
3861
  });
3811
-
3812
-
3813
- /*----------------------------------------------------------------------------------------------------------------*/
3814
-
3815
- // Wait for document to load before initializing
3816
- var docReady = false;
3817
-
3818
- var loadHandler = function(e) {
3819
- if (!docReady) {
3820
- docReady = true;
3821
- if (!api.initialized && api.config.autoInitialize) {
3822
- init();
3823
- }
3824
- }
3825
- };
3826
-
3827
- if (isBrowser) {
3828
- // Test whether the document has already been loaded and initialize immediately if so
3829
- if (document.readyState == "complete") {
3830
- loadHandler();
3831
- } else {
3832
- if (isHostMethod(document, "addEventListener")) {
3833
- document.addEventListener("DOMContentLoaded", loadHandler, false);
3834
- }
3835
-
3836
- // Add a fallback in case the DOMContentLoaded event isn't supported
3837
- addListener(window, "load", loadHandler);
3838
- }
3839
- }
3840
-
3841
- return api;
3862
+
3863
+
3864
+ /*----------------------------------------------------------------------------------------------------------------*/
3865
+
3866
+ // Wait for document to load before initializing
3867
+ var docReady = false;
3868
+
3869
+ var loadHandler = function(e) {
3870
+ if (!docReady) {
3871
+ docReady = true;
3872
+ if (!api.initialized && api.config.autoInitialize) {
3873
+ init();
3874
+ }
3875
+ }
3876
+ };
3877
+
3878
+ if (isBrowser) {
3879
+ // Test whether the document has already been loaded and initialize immediately if so
3880
+ if (document.readyState == "complete") {
3881
+ loadHandler();
3882
+ } else {
3883
+ if (isHostMethod(document, "addEventListener")) {
3884
+ document.addEventListener("DOMContentLoaded", loadHandler, false);
3885
+ }
3886
+
3887
+ // Add a fallback in case the DOMContentLoaded event isn't supported
3888
+ addListener(window, "load", loadHandler);
3889
+ }
3890
+ }
3891
+
3892
+ return api;
3842
3893
  });
3843
3894
  }(rangyCore));
3844
3895
 
3845
3896
  var rangy = rangyCore.exports;
3846
3897
 
3847
- /*
3848
- import font_arial from './fonts/arial.png';
3849
- import font_courier from './fonts/courier.png';
3850
- import font_georgia from './fonts/georgia.png';
3851
- import font_monospace from './fonts/monospace.png';
3852
- import font_sans_serif from './fonts/sans_serif.png';
3853
- import font_serif from './fonts/serif.png';
3854
- import font_abel from './fonts/abel.png';
3855
- import font_abril_fatface from './fonts/abril_fatface.png';
3856
- import font_advent_pro from './fonts/advent_pro.png';
3857
- import font_aladin from './fonts/aladin.png';
3858
- import font_alegreya from './fonts/alegreya.png';
3859
- import font_alegreya_sans_sc from './fonts/alegreya_sans_sc.png';
3860
- import font_alegreya_sc from './fonts/alegreya_sc.png';
3861
- import font_alice from './fonts/alice.png';
3862
- import font_allerta_stencil from './fonts/allerta_stencil.png';
3863
- import font_allura from './fonts/allura.png';
3864
- import font_almendra_display from './fonts/almendra_display.png';
3865
- import font_amatic_sc from './fonts/amatic_sc.png';
3866
- import font_andika from './fonts/andika.png';
3867
- import font_anonymous_pro from './fonts/anonymous_pro.png';
3868
- import font_architects_daughter from './fonts/architects_daughter.png';
3869
- import font_arimo from './fonts/arimo.png';
3870
- import font_arsenal from './fonts/arsenal.png';
3871
- import font_assistant from './fonts/assistant.png';
3872
- import font_aubrey from './fonts/aubrey.png';
3873
- import font_anton from './fonts/anton.png';
3874
- import font_archivo_narrow from './fonts/archivo_narrow.png';
3875
- import font_bad_script from './fonts/bad_script.png';
3876
- import font_benchNine from './fonts/benchNine.png';
3877
- import font_bevan from './fonts/bevan.png';
3878
- import font_bigelow_rules from './fonts/bigelow_rules.png';
3879
- import font_bilbo from './fonts/bilbo.png';
3880
- import font_bonbon from './fonts/bonbon.png';
3881
- import font_bowlby_one_sc from './fonts/bowlby_one_sc.png';
3882
- import font_cabin_condensed from './fonts/cabin_condensed.png';
3883
- import font_carrois_gothic_sc from './fonts/carrois_gothic_sc.png';
3884
- import font_caveat from './fonts/caveat.png';
3885
- import font_chewy from './fonts/chewy.png';
3886
- import font_cinzel from './fonts/cinzel.png';
3887
- import font_comfortaa from './fonts/comfortaa.png';
3888
- import font_concert_one from './fonts/concert_one.png';
3889
- import font_cormorant from './fonts/cormorant.png';
3890
- import font_cormorant_garamond from './fonts/cormorant_garamond.png';
3891
- import font_cormorant_infant from './fonts/cormorant_infant.png';
3892
- import font_cormorant_sc from './fonts/cormorant_sc.png';
3893
- import font_cormorant_unicase from './fonts/cormorant_unicase.png';
3894
- import font_cousine from './fonts/cousine.png';
3895
- import font_crafty_girls from './fonts/crafty_girls.png';
3896
- import font_cuprum from './fonts/cuprum.png';
3897
- import font_cutive_mono from './fonts/cutive_mono.png';
3898
- import font_devonshire from './fonts/devonshire.png';
3899
- import font_didact_gothic from './fonts/didact_gothic.png';
3900
- import font_diplomata_sc from './fonts/diplomata_sc.png';
3901
- import font_dosis from './fonts/dosis.png';
3902
- import font_eb_garamond from './fonts/eb_garamond.png';
3903
- import font_el_messiri from './fonts/el_messiri.png';
3904
- import font_elsie from './fonts/elsie.png';
3905
- import font_encode_sans from './fonts/encode_sans.png';
3906
- import font_exo from './fonts/exo.png';
3907
- import font_exo_2 from './fonts/exo_2.png';
3908
- import font_felipa from './fonts/felipa.png';
3909
- import font_fira_code from './fonts/fira_code.png';
3910
- import font_fira_mono from './fonts/fira_mono.png';
3911
- import font_fira_sans from './fonts/fira_sans.png';
3912
- import font_fira_sans_condensed from './fonts/fira_sans_condensed.png';
3913
- import font_fira_sans_extra_condensed from './fonts/fira_sans_extra_condensed.png';
3914
- import font_fjalla_one from './fonts/fjalla_one.png';
3915
- import font_forum from './fonts/forum.png';
3916
- import font_frank_ruhl_libre from './fonts/frank_ruhl_libre.png';
3917
- import font_fredericka_the_great from './fonts/fredericka_the_great.png';
3918
- import font_gabriela from './fonts/gabriela.png';
3919
- import font_gilda_display from './fonts/gilda_display.png';
3920
- import font_give_you_glory from './fonts/give_you_glory.png';
3921
- import font_gruppo from './fonts/gruppo.png';
3922
- import font_handlee from './fonts/handlee.png';
3923
- import font_happy_monkey from './fonts/happy_monkey.png';
3924
- import font_hind from './fonts/hind.png';
3925
- import font_ibm_plex_mono from './fonts/ibm_plex_mono.png';
3926
- import font_ibm_plex_sans from './fonts/ibm_plex_sans.png';
3927
- import font_ibm_plex_serif from './fonts/ibm_plex_serif.png';
3928
- import font_iceland from './fonts/iceland.png';
3929
- import font_inconsolata from './fonts/inconsolata.png';
3930
- import font_josefin_sans from './fonts/josefin_sans.png';
3931
- import font_istok_web from './fonts/istok_web.png';
3932
- import font_julee from './fonts/julee.png';
3933
- import font_julius_sans_one from './fonts/julius_sans_one.png';
3934
- import font_junge from './fonts/junge.png';
3935
- import font_jura from './fonts/jura.png';
3936
- import font_just_me_again_down_here from './fonts/just_me_again_down_here.png';
3937
- import font_kaushan_script from './fonts/kaushan_script.png';
3938
- import font_kelly_slab from './fonts/kelly_slab.png';
3939
- import font_kite_one from './fonts/kite_one.png';
3940
- import font_kosugi from './fonts/kosugi.png';
3941
- import font_kosugi_maru from './fonts/kosugi_maru.png';
3942
- import font_kurale from './fonts/kurale.png';
3943
- import font_lato from './fonts/lato.png';
3944
- import font_ledger from './fonts/ledger.png';
3945
- import font_lekton from './fonts/lekton.png';
3946
- import font_life_savers from './fonts/life_savers.png';
3947
- import font_literata from './fonts/literata.png';
3948
- import font_lobster from './fonts/lobster.png';
3949
- import font_lobster_two from './fonts/lobster_two.png';
3950
- import font_londrina_shadow from './fonts/londrina_shadow.png';
3951
- import font_lora from './fonts/lora.png';
3952
- import font_lovers_quarrel from './fonts/lovers_quarrel.png';
3953
- import font_m_plus_1p from './fonts/m_plus_1p.png';
3954
- import font_m_plus_rounded_1c from './fonts/m_plus_rounded_1c.png';
3955
- import font_macondo from './fonts/macondo.png';
3956
- import font_marcellus_sc from './fonts/marcellus_sc.png';
3957
- import font_marck_script from './fonts/marck_script.png';
3958
- import font_martel from './fonts/martel.png';
3959
- import font_maven_pro from './fonts/maven_pro.png';
3960
- import font_merriweather from './fonts/merriweather.png';
3961
- import font_merriweather_sans from './fonts/merriweather_sans.png';
3962
- import font_mogra from './fonts/mogra.png';
3963
- import font_monoton from './fonts/monoton.png';
3964
- import font_montez from './fonts/montez.png';
3965
- import font_montserrat from './fonts/montserrat.png';
3966
- import font_montserrat_alternates from './fonts/montserrat_alternates.png';
3967
- import font_montserrat_subrayada from './fonts/montserrat_subrayada.png';
3968
- import font_neucha from './fonts/neucha.png';
3969
- import font_neuton from './fonts/neuton.png';
3970
- import font_nixie_one from './fonts/nixie_one.png';
3971
- import font_nothing_you_could_do from './fonts/nothing_you_could_do.png';
3972
- import font_noto_sans from './fonts/noto_sans.png';
3973
- import font_noto_sans_sc from './fonts/noto_sans_sc.png';
3974
- import font_noto_serif from './fonts/noto_serif.png';
3975
- import font_noto_serif_tc from './fonts/noto_serif_tc.png';
3976
- import font_nunito from './fonts/nunito.png';
3977
- import font_old_standard_tt from './fonts/old_standard_tt.png';
3978
- import font_open_sans from './fonts/open_sans.png';
3979
- import font_open_sans_condensed from './fonts/open_sans_condensed.png';
3980
- import font_oranienbaum from './fonts/oranienbaum.png';
3981
- import font_oswald from './fonts/oswald.png';
3982
- import font_oxygen from './fonts/oxygen.png';
3983
- import font_pacifico from './fonts/pacifico.png';
3984
- import font_pangolin from './fonts/pangolin.png';
3985
- import font_passion_one from './fonts/passion_one.png';
3986
- import font_pathway_gothic_one from './fonts/pathway_gothic_one.png';
3987
- import font_pattaya from './fonts/pattaya.png';
3988
- import font_petit_formal_script from './fonts/petit_formal_script.png';
3989
- import font_philosopher from './fonts/philosopher.png';
3990
- import font_play from './fonts/play.png';
3991
- import font_playfair_display from './fonts/playfair_display.png';
3992
- import font_playfair_display_sc from './fonts/playfair_display_sc.png';
3993
- import font_podkova from './fonts/podkova.png';
3994
- import font_poiret_one from './fonts/poiret_one.png';
3995
- import font_pompiere from './fonts/pompiere.png';
3996
- import font_poppins from './fonts/poppins.png';
3997
- import font_prata from './fonts/prata.png';
3998
- import font_press_start_2p from './fonts/press_start_2p.png';
3999
- import font_prosto_one from './fonts/prosto_one.png';
4000
- import font_pt_mono from './fonts/pt_mono.png';
4001
- import font_pt_sans from './fonts/pt_sans.png';
4002
- import font_pt_sans_caption from './fonts/pt_sans_caption.png';
4003
- import font_pt_sans_narrow from './fonts/pt_sans_narrow.png';
4004
- import font_pt_serif from './fonts/pt_serif.png';
4005
- import font_pt_serif_caption from './fonts/pt_serif_caption.png';
4006
- import font_quattrocento_sans from './fonts/quattrocento_sans.png';
4007
- import font_quattrocento from './fonts/quattrocento.png';
4008
- import font_quicksand from './fonts/quicksand.png';
4009
- import font_qwigley from './fonts/qwigley.png';
4010
- import font_raleway from './fonts/raleway.png';
4011
- import font_raleway_dots from './fonts/raleway_dots.png';
4012
- import font_redressed from './fonts/redressed.png';
4013
- import font_ribeye_marrow from './fonts/ribeye_marrow.png';
4014
- import font_righteous from './fonts/righteous.png';
4015
- import font_roboto from './fonts/roboto.png';
4016
- import font_roboto_condensed from './fonts/roboto_condensed.png';
4017
- import font_roboto_mono from './fonts/roboto_mono.png';
4018
- import font_roboto_slab from './fonts/roboto_slab.png';
4019
- import font_rochester from './fonts/rochester.png';
4020
- import font_rouge_script from './fonts/rouge_script.png';
4021
- import font_rubik from './fonts/rubik.png';
4022
- import font_rubik_mono_one from './fonts/rubik_mono_one.png';
4023
- import font_ruslan_display from './fonts/ruslan_display.png';
4024
- import font_russo_one from './fonts/russo_one.png';
4025
- import font_sacramento from './fonts/sacramento.png';
4026
- import font_sanchez from './fonts/sanchez.png';
4027
- import font_satisfy from './fonts/satisfy.png';
4028
- import font_sawarabi_gothic from './fonts/sawarabi_gothic.png';
4029
- import font_scada from './fonts/scada.png';
4030
- import font_seaweed_script from './fonts/seaweed_script.png';
4031
- import font_seymour_one from './fonts/seymour_one.png';
4032
- import font_shadows_into_light_two from './fonts/shadows_into_light_two.png';
4033
- import font_six_caps from './fonts/six_caps.png';
4034
- import font_snowburst_one from './fonts/snowburst_one.png';
4035
- import font_source_code_pro from './fonts/source_code_pro.png';
4036
- import font_source_sans_pro from './fonts/source_sans_pro.png';
4037
- import font_special_elite from './fonts/special_elite.png';
4038
- import font_spectral from './fonts/spectral.png';
4039
- import font_spectral_sc from './fonts/spectral_sc.png';
4040
- import font_squada_one from './fonts/squada_one.png';
4041
- import font_stalinist_one from './fonts/stalinist_one.png';
4042
- import font_stint_ultra_expanded from './fonts/stint_ultra_expanded.png';
4043
- import font_syncopate from './fonts/syncopate.png';
4044
- import font_tangerine from './fonts/tangerine.png';
4045
- import font_tenor_sans from './fonts/tenor_sans.png';
4046
- import font_tinos from './fonts/tinos.png';
4047
- import font_ubuntu from './fonts/ubuntu.png';
4048
- import font_ubuntu_condensed from './fonts/ubuntu_condensed.png';
4049
- import font_ubuntu_mono from './fonts/ubuntu_mono.png';
4050
- import font_underdog from './fonts/underdog.png';
4051
- import font_unifrakturmaguntia from './fonts/unifrakturmaguntia.png';
4052
- import font_vast_shadow from './fonts/vast_shadow.png';
4053
- import font_viga from './fonts/viga.png';
4054
- import font_vollkorn from './fonts/vollkorn.png';
4055
- import font_vollkorn_sc from './fonts/vollkorn_sc.png';
4056
- import font_voltaire from './fonts/voltaire.png';
4057
- import font_wire_one from './fonts/wire_one.png';
4058
- import font_yanone_kaffeesatz from './fonts/yanone_kaffeesatz.png';
4059
- import font_yeseva_one from './fonts/yeseva_one.png';
4060
- */
4061
3898
  class Util {
4062
3899
  constructor(builder) {
4063
3900
  this.builder = builder;
@@ -4515,6 +4352,25 @@ class Util {
4515
4352
  });
4516
4353
  }
4517
4354
 
4355
+ removeColClasses(cell) {
4356
+ cell.classList.remove('full');
4357
+ cell.classList.remove('two-third');
4358
+ cell.classList.remove('two-fourth');
4359
+ cell.classList.remove('two-fifth');
4360
+ cell.classList.remove('two-sixth');
4361
+ cell.classList.remove('half');
4362
+ cell.classList.remove('third');
4363
+ cell.classList.remove('fourth');
4364
+ cell.classList.remove('fifth');
4365
+ cell.classList.remove('sixth');
4366
+ cell.classList.remove('seventh');
4367
+ cell.classList.remove('eighth');
4368
+ cell.classList.remove('ninth');
4369
+ cell.classList.remove('tenth');
4370
+ cell.classList.remove('eleventh');
4371
+ cell.classList.remove('twelfth');
4372
+ }
4373
+
4518
4374
  fixLayout(row) {
4519
4375
  const dom = this.dom; // if(this.builder.opts.enableDragResize) {
4520
4376
  // Array.from(row.children).map((item) => {
@@ -4557,6 +4413,25 @@ class Util {
4557
4413
  row.classList.remove('md-autofit');
4558
4414
  }
4559
4415
 
4416
+ if (this.builder.useDefaultGrid) {
4417
+ const cols = dom.elementChildren(row);
4418
+ cols.forEach(col => {
4419
+ if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
4420
+ this.removeColClasses(col);
4421
+ }); // Refresh Module
4422
+
4423
+ Array.from(row.children).map(item => {
4424
+ if (item.classList.contains('is-row-tool')) return;
4425
+ if (item.classList.contains('is-rowadd-tool')) return;
4426
+ if (item.classList.contains('is-col-tool')) return;
4427
+
4428
+ if (item.getAttribute('data-module')) {
4429
+ this.refreshModuleLayout(item);
4430
+ }
4431
+ });
4432
+ return;
4433
+ }
4434
+
4560
4435
  let num = 3; //is-row-tool, is-col-tool & is-rowadd-tool
4561
4436
 
4562
4437
  if (row.querySelector('.is-row-overlay')) {
@@ -17664,7 +17539,7 @@ const renderQuickAdd = builder => {
17664
17539
  if (elm) dom.addEventListener(elm, 'click', () => {
17665
17540
  const mode = quickadd.getAttribute('data-mode');
17666
17541
  let html = `<div>
17667
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-12 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
17542
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
17668
17543
  </div>`;
17669
17544
 
17670
17545
  if (builder.opts.emailMode) {
@@ -17677,8 +17552,8 @@ const renderQuickAdd = builder => {
17677
17552
  if (elm) dom.addEventListener(elm, 'click', () => {
17678
17553
  const mode = quickadd.getAttribute('data-mode');
17679
17554
  let html = `<div>
17680
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-12 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
17681
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-12 rounded tracking-wide">Get Started</a>
17555
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Read More</a>
17556
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Get Started</a>
17682
17557
  </div>`;
17683
17558
 
17684
17559
  if (builder.opts.emailMode) {
@@ -18127,24 +18002,275 @@ class Grid {
18127
18002
  });
18128
18003
  }
18129
18004
 
18005
+ removeColClasses(cell) {
18006
+ cell.classList.remove('full');
18007
+ cell.classList.remove('two-third');
18008
+ cell.classList.remove('two-fourth');
18009
+ cell.classList.remove('two-fifth');
18010
+ cell.classList.remove('two-sixth');
18011
+ cell.classList.remove('half');
18012
+ cell.classList.remove('third');
18013
+ cell.classList.remove('fourth');
18014
+ cell.classList.remove('fifth');
18015
+ cell.classList.remove('sixth');
18016
+ cell.classList.remove('seventh');
18017
+ cell.classList.remove('eighth');
18018
+ cell.classList.remove('ninth');
18019
+ cell.classList.remove('tenth');
18020
+ cell.classList.remove('eleventh');
18021
+ cell.classList.remove('twelfth');
18022
+ }
18023
+
18024
+ getAllColumns(cell) {
18025
+ let arrCells = [];
18026
+ let dom = this.dom;
18027
+ const cols = dom.elementChildren(cell.parentNode);
18028
+ cols.forEach(col => {
18029
+ if (dom.hasClass(col, 'is-row-tool') || dom.hasClass(col, 'is-col-tool') || dom.hasClass(col, 'is-rowadd-tool') || dom.hasClass(col, 'is-row-overlay')) return;
18030
+
18031
+ if (cell !== col) {
18032
+ arrCells.push(col);
18033
+ }
18034
+ });
18035
+ const newArray = [cell].concat(arrCells);
18036
+ return newArray;
18037
+ }
18038
+
18039
+ getCellWidth(cell) {
18040
+ if (cell.classList.contains('two-third')) {
18041
+ return 66.666;
18042
+ }
18043
+
18044
+ if (cell.classList.contains('two-fourth')) {
18045
+ return 75;
18046
+ }
18047
+
18048
+ if (cell.classList.contains('two-fifth')) {
18049
+ return 80;
18050
+ }
18051
+
18052
+ if (cell.classList.contains('two-sixth')) {
18053
+ return 83.333;
18054
+ }
18055
+
18056
+ if (cell.classList.contains('half')) {
18057
+ return 50;
18058
+ }
18059
+
18060
+ if (cell.classList.contains('third')) {
18061
+ return 33.333;
18062
+ }
18063
+
18064
+ if (cell.classList.contains('fourth')) {
18065
+ return 25;
18066
+ }
18067
+
18068
+ if (cell.classList.contains('fifth')) {
18069
+ return 20;
18070
+ }
18071
+
18072
+ if (cell.classList.contains('sixth')) {
18073
+ return 16.666;
18074
+ }
18075
+
18076
+ if (cell.classList.contains('seventh')) {
18077
+ return 14.2857;
18078
+ }
18079
+
18080
+ if (cell.classList.contains('eighth')) {
18081
+ return 12.5;
18082
+ }
18083
+
18084
+ if (cell.classList.contains('ninth')) {
18085
+ return 11.111;
18086
+ }
18087
+
18088
+ if (cell.classList.contains('tenth')) {
18089
+ return 10;
18090
+ }
18091
+
18092
+ if (cell.classList.contains('eleventh')) {
18093
+ return 9.09;
18094
+ }
18095
+
18096
+ if (cell.classList.contains('twelfth')) {
18097
+ return 8.333;
18098
+ }
18099
+
18100
+ return false;
18101
+ }
18102
+
18103
+ resizeColumn(cell, increase, num) {
18104
+ let cellWidth = this.getCellWidth(cell);
18105
+
18106
+ if (!cellWidth) {
18107
+ let cellW = parseFloat(window.getComputedStyle(cell).getPropertyValue('width'));
18108
+ let rowW = parseFloat(window.getComputedStyle(cell.parentNode).getPropertyValue('width'));
18109
+ cellWidth = cellW / rowW * 100;
18110
+ }
18111
+
18112
+ if (increase) {
18113
+ if (num === 3) {
18114
+ if (cellWidth >= 28 && cellWidth <= 30) {
18115
+ return '33.333%';
18116
+ } else if (cellWidth > 30 && cellWidth < 38) {
18117
+ return '40%';
18118
+ } //max 80%
18119
+
18120
+
18121
+ if (cellWidth >= 68 && cellWidth <= 90) {
18122
+ return '75%';
18123
+ }
18124
+ }
18125
+
18126
+ if (num === 4) {
18127
+ //max 70%
18128
+ if (cellWidth >= 48 && cellWidth <= 90) {
18129
+ return '60%';
18130
+ }
18131
+ }
18132
+
18133
+ if (num === 5) {
18134
+ //max 50%
18135
+ if (cellWidth >= 38 && cellWidth <= 90) {
18136
+ return '50%';
18137
+ }
18138
+ }
18139
+
18140
+ if (num === 6) {
18141
+ if (cellWidth >= 10 && cellWidth < 13) {
18142
+ return '16.666%';
18143
+ } //max 40%
18144
+
18145
+
18146
+ if (cellWidth >= 28 && cellWidth <= 90) {
18147
+ return '40%';
18148
+ }
18149
+ }
18150
+
18151
+ if (num === 7) {
18152
+ //max 30%
18153
+ if (cellWidth >= 23 && cellWidth <= 90) {
18154
+ return '30%';
18155
+ }
18156
+ }
18157
+
18158
+ if (num === 8) {
18159
+ //max 20%
18160
+ if (cellWidth >= 13 && cellWidth <= 90) {
18161
+ return '20%';
18162
+ }
18163
+ }
18164
+
18165
+ if (cellWidth >= 78 && cellWidth <= 90) {
18166
+ return '90%';
18167
+ } else if (cellWidth >= 73 && cellWidth < 78) {
18168
+ return '80%';
18169
+ } else if (cellWidth >= 68 && cellWidth < 73) {
18170
+ return '75%';
18171
+ } else if (cellWidth >= 58 && cellWidth < 68) {
18172
+ return '70%';
18173
+ } else if (cellWidth >= 48 && cellWidth < 58) {
18174
+ return '60%';
18175
+ } else if (cellWidth >= 38 && cellWidth < 48) {
18176
+ return '50%';
18177
+ } else if (cellWidth >= 28 && cellWidth < 38) {
18178
+ return '40%';
18179
+ } else if (cellWidth >= 23 && cellWidth < 28) {
18180
+ return '30%';
18181
+ } else if (cellWidth >= 18 && cellWidth < 23) {
18182
+ return '25%';
18183
+ } else if (cellWidth >= 13 && cellWidth < 18) {
18184
+ return '20%';
18185
+ } else if (cellWidth >= 10 && cellWidth < 13) {
18186
+ return '15%';
18187
+ }
18188
+ } else {
18189
+ // decrease
18190
+ if (num === 3) {
18191
+ if (cellWidth > 35 && cellWidth <= 43) {
18192
+ return '33.333%';
18193
+ }
18194
+
18195
+ if (cellWidth > 33 && cellWidth <= 35) {
18196
+ return '30%';
18197
+ }
18198
+ }
18199
+
18200
+ if (num === 6) {
18201
+ if (cellWidth > 18 && cellWidth <= 23) {
18202
+ return '16.666%';
18203
+ }
18204
+ }
18205
+
18206
+ if (cellWidth > 93 && cellWidth <= 100) {
18207
+ return '90%';
18208
+ } else if (cellWidth > 83 && cellWidth <= 93) {
18209
+ return '80%';
18210
+ } else if (cellWidth > 78 && cellWidth <= 83) {
18211
+ return '75%';
18212
+ } else if (cellWidth > 73 && cellWidth <= 78) {
18213
+ return '70%';
18214
+ } else if (cellWidth > 63 && cellWidth <= 73) {
18215
+ return '60%';
18216
+ } else if (cellWidth > 53 && cellWidth <= 63) {
18217
+ return '50%';
18218
+ } else if (cellWidth > 43 && cellWidth <= 53) {
18219
+ return '40%';
18220
+ } else if (cellWidth > 33 && cellWidth <= 43) {
18221
+ return '30%';
18222
+ } else if (cellWidth > 28 && cellWidth <= 33) {
18223
+ return '25%';
18224
+ } else if (cellWidth > 23 && cellWidth <= 28) {
18225
+ return '20%';
18226
+ } else if (cellWidth > 18 && cellWidth <= 23) {
18227
+ return '15%';
18228
+ } else if (cellWidth >= 10 && cellWidth <= 18) {
18229
+ return '10%';
18230
+ }
18231
+ }
18232
+
18233
+ return false;
18234
+ }
18235
+
18130
18236
  increaseColumn() {
18131
18237
  let builder = this.builder;
18132
18238
  let util = this.util;
18133
18239
  let dom = this.dom;
18134
- const cell = util.cellSelected();
18240
+ let cell = util.cellSelected();
18135
18241
  if (!cell) return;
18136
- let cellnext = util.cellNext(cell);
18137
- let cellnext2;
18138
18242
 
18139
- if (!cellnext) {
18140
- cellnext = cell.previousElementSibling;
18141
- if (!cellnext) return;
18142
- cellnext2 = cellnext.previousElementSibling;
18143
- } else {
18144
- cellnext2 = util.cellNext(cellnext);
18145
- if (!cellnext2) cellnext2 = cell.previousElementSibling;
18243
+ if (this.builder.useDefaultGrid) {
18244
+ let arrColumns = this.getAllColumns(cell);
18245
+
18246
+ for (let i = 1; i < arrColumns.length; i++) {
18247
+ let cellNext = arrColumns[i]; // cellNext.style.width = '100%';
18248
+
18249
+ cellNext.style.width = '';
18250
+ cellNext.style.flex = '';
18251
+ this.removeColClasses(cellNext);
18252
+ }
18253
+
18254
+ if (arrColumns.length > 1 && arrColumns.length < 9) {
18255
+ this.builder.uo.saveForUndo();
18256
+ let w = this.resizeColumn(cell, true, arrColumns.length);
18257
+
18258
+ if (w) {
18259
+ cell.style.width = w;
18260
+ cell.style.flex = '0 0 auto';
18261
+ this.removeColClasses(cell);
18262
+ }
18263
+
18264
+ this.builder.opts.onChange();
18265
+ }
18266
+
18267
+ return;
18146
18268
  }
18147
18269
 
18270
+ let cellnext, cellnext2;
18271
+ let arrColumns = this.getAllColumns(cell);
18272
+ if (arrColumns[1]) cellnext = arrColumns[1];
18273
+ if (arrColumns[2]) cellnext2 = arrColumns[2];
18148
18274
  const rowClass = builder.opts.row;
18149
18275
  let colClass = builder.opts.cols;
18150
18276
  const colSizes = builder.opts.colsizes;
@@ -18305,18 +18431,38 @@ class Grid {
18305
18431
  let dom = this.dom;
18306
18432
  const cell = util.cellSelected();
18307
18433
  if (!cell) return;
18308
- let cellnext = util.cellNext(cell);
18309
- let cellnext2;
18310
18434
 
18311
- if (!cellnext) {
18312
- cellnext = cell.previousElementSibling;
18313
- if (!cellnext) return;
18314
- cellnext2 = cellnext.previousElementSibling;
18315
- } else {
18316
- cellnext2 = util.cellNext(cellnext);
18317
- if (!cellnext2) cellnext2 = cell.previousElementSibling;
18435
+ if (this.builder.useDefaultGrid) {
18436
+ let arrColumns = this.getAllColumns(cell);
18437
+
18438
+ for (let i = 1; i < arrColumns.length; i++) {
18439
+ let cellNext = arrColumns[i]; // cellNext.style.width = '100%';
18440
+
18441
+ cellNext.style.width = '';
18442
+ cellNext.style.flex = '';
18443
+ this.removeColClasses(cellNext);
18444
+ }
18445
+
18446
+ if (arrColumns.length > 1 && arrColumns.length < 9) {
18447
+ this.builder.uo.saveForUndo();
18448
+ let w = this.resizeColumn(cell, false, arrColumns.length);
18449
+
18450
+ if (w) {
18451
+ cell.style.width = w;
18452
+ cell.style.flex = '0 0 auto';
18453
+ this.removeColClasses(cell);
18454
+ }
18455
+
18456
+ this.builder.opts.onChange();
18457
+ }
18458
+
18459
+ return;
18318
18460
  }
18319
18461
 
18462
+ let cellnext, cellnext2;
18463
+ let arrColumns = this.getAllColumns(cell);
18464
+ if (arrColumns[1]) cellnext = arrColumns[1];
18465
+ if (arrColumns[2]) cellnext2 = arrColumns[2];
18320
18466
  const rowClass = builder.opts.row;
18321
18467
  let colClass = builder.opts.cols;
18322
18468
  const colSizes = builder.opts.colsizes;
@@ -52471,89 +52617,89 @@ class ButtonEditor {
52471
52617
  /* rounded */
52472
52618
  {
52473
52619
  html: `
52474
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-12 rounded-full tracking-wide">Read More</a>
52620
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-14 rounded-full tracking-wide">Read More</a>
52475
52621
  `
52476
52622
  }, {
52477
52623
  html: `
52478
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 text-black leading-12 rounded-full border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Get Started</a>
52624
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 text-black leading-14 rounded-full border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Get Started</a>
52479
52625
  `
52480
52626
  }, {
52481
52627
  html: `
52482
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
52628
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
52483
52629
  `
52484
52630
  }, {
52485
52631
  html: `
52486
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
52632
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
52487
52633
  `
52488
52634
  }, {
52489
52635
  html: `
52490
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
52636
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
52491
52637
  `
52492
52638
  }, {
52493
52639
  html: `
52494
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-12 tracking-wide rounded-full" style="color: rgb(255, 255, 255);">Get Started</a>
52640
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-7 border-current hover:border-current font-normal leading-14 tracking-wide rounded-full" style="color: rgb(255, 255, 255);">Get Started</a>
52495
52641
  `
52496
52642
  },
52497
52643
  /* colors */
52498
52644
  {
52499
52645
  html: `
52500
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
52646
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
52501
52647
  `
52502
52648
  }, {
52503
52649
  html: `
52504
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
52650
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
52505
52651
  `
52506
52652
  }, {
52507
52653
  html: `
52508
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
52654
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
52509
52655
  `
52510
52656
  }, {
52511
52657
  html: `
52512
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-12 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
52658
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-7 font-normal leading-14 border-transparent rounded-full size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
52513
52659
  `
52514
52660
  },
52515
52661
  /* square */
52516
52662
  {
52517
52663
  html: `
52518
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-12 rounded tracking-wide">Read More</a>
52664
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 rounded tracking-wide">Read More</a>
52519
52665
  `
52520
52666
  }, {
52521
52667
  html: `
52522
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-12 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Get Started</a>
52668
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 text-black leading-14 rounded border-transparent hover:border-transparent font-normal tracking-wide" style="background-color: rgb(240, 240, 240);">Get Started</a>
52523
52669
  `
52524
52670
  }, {
52525
52671
  html: `
52526
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
52672
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(255, 127, 0);">Get Started</a>
52527
52673
  `
52528
52674
  }, {
52529
52675
  html: `
52530
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
52676
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(83,98,208);">Get Started</a>
52531
52677
  `
52532
52678
  }, {
52533
52679
  html: `
52534
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
52680
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255);">Get Started</a>
52535
52681
  `
52536
52682
  }, {
52537
52683
  html: `
52538
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-12 tracking-wide rounded" style="color: rgb(255, 255, 255);">Get Started</a>
52684
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 size-17 px-6 border-current hover:border-current font-normal leading-14 tracking-wide rounded" style="color: rgb(255, 255, 255);">Get Started</a>
52539
52685
  `
52540
52686
  },
52541
52687
  /* colors */
52542
52688
  {
52543
52689
  html: `
52544
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
52690
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(0, 200, 218);">Get Started</a>
52545
52691
  `
52546
52692
  }, {
52547
52693
  html: `
52548
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
52694
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(55, 148, 59);">Get Started</a>
52549
52695
  `
52550
52696
  }, {
52551
52697
  html: `
52552
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
52698
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded size-17 tracking-wide hover:border-transparent" style="color: rgb(255, 255, 255); background-color: rgb(233,2,0);">Get Started</a>
52553
52699
  `
52554
52700
  }, {
52555
52701
  html: `
52556
- <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-12 border-transparent rounded ml-0 mt-1 size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
52702
+ <a href="#" role="button" class="transition-all inline-block whitespace-nowrap cursor-pointer no-underline border-2 border-solid mr-2 mt-2 mb-1 py-2 px-6 font-normal leading-14 border-transparent rounded ml-0 mt-1 size-17 tracking-wide hover:border-transparent" style="color: rgb(0, 0, 0); background-color: rgb(254, 222, 76);">Get Started</a>
52557
52703
  `
52558
52704
  },
52559
52705
  /* MEDIUM */
@@ -59470,27 +59616,30 @@ class ColumnTool {
59470
59616
  dom.addEventListener(elm, 'click', () => {
59471
59617
  const cell = util.cellSelected();
59472
59618
  if (!cell) return;
59473
- const row = cell.parentNode; // Check if reset needed (reset will remove inline width, etc)
59474
-
59475
- let needed = false;
59476
- Array.from(row.children).map(item => {
59477
- if (item.classList.contains('is-row-tool')) return;
59478
- if (item.classList.contains('is-rowadd-tool')) return;
59479
- if (item.classList.contains('is-col-tool')) return;
59480
- if (item.style.width) needed = true;
59481
- });
59619
+ const row = cell.parentNode;
59482
59620
 
59483
- if (needed) {
59621
+ if (!this.builder.useDefaultGrid) {
59622
+ // Check if reset needed (reset will remove inline width, etc)
59623
+ let needed = false;
59484
59624
  Array.from(row.children).map(item => {
59485
59625
  if (item.classList.contains('is-row-tool')) return;
59486
59626
  if (item.classList.contains('is-rowadd-tool')) return;
59487
59627
  if (item.classList.contains('is-col-tool')) return;
59488
- item.style.width = '';
59489
- item.style.flex = '';
59490
- item.style.height = '';
59491
- item.style.minHeight = '';
59628
+ if (item.style.width) needed = true;
59492
59629
  });
59493
- util.fixLayout(row);
59630
+
59631
+ if (needed) {
59632
+ Array.from(row.children).map(item => {
59633
+ if (item.classList.contains('is-row-tool')) return;
59634
+ if (item.classList.contains('is-rowadd-tool')) return;
59635
+ if (item.classList.contains('is-col-tool')) return;
59636
+ item.style.width = '';
59637
+ item.style.flex = '';
59638
+ item.style.height = '';
59639
+ item.style.minHeight = '';
59640
+ });
59641
+ util.fixLayout(row);
59642
+ }
59494
59643
  }
59495
59644
 
59496
59645
  this.grid.increaseColumn(); // Refresh Module
@@ -59510,27 +59659,30 @@ class ColumnTool {
59510
59659
  dom.addEventListener(elm, 'click', () => {
59511
59660
  const cell = util.cellSelected();
59512
59661
  if (!cell) return;
59513
- const row = cell.parentNode; // Check if reset needed (reset will remove inline width, etc)
59514
-
59515
- let needed = false;
59516
- Array.from(row.children).map(item => {
59517
- if (item.classList.contains('is-row-tool')) return;
59518
- if (item.classList.contains('is-rowadd-tool')) return;
59519
- if (item.classList.contains('is-col-tool')) return;
59520
- if (item.style.width) needed = true;
59521
- });
59662
+ const row = cell.parentNode;
59522
59663
 
59523
- if (needed) {
59664
+ if (!this.builder.useDefaultGrid) {
59665
+ // Check if reset needed (reset will remove inline width, etc)
59666
+ let needed = false;
59524
59667
  Array.from(row.children).map(item => {
59525
59668
  if (item.classList.contains('is-row-tool')) return;
59526
59669
  if (item.classList.contains('is-rowadd-tool')) return;
59527
59670
  if (item.classList.contains('is-col-tool')) return;
59528
- item.style.width = '';
59529
- item.style.flex = '';
59530
- item.style.height = '';
59531
- item.style.minHeight = '';
59671
+ if (item.style.width) needed = true;
59532
59672
  });
59533
- util.fixLayout(row);
59673
+
59674
+ if (needed) {
59675
+ Array.from(row.children).map(item => {
59676
+ if (item.classList.contains('is-row-tool')) return;
59677
+ if (item.classList.contains('is-rowadd-tool')) return;
59678
+ if (item.classList.contains('is-col-tool')) return;
59679
+ item.style.width = '';
59680
+ item.style.flex = '';
59681
+ item.style.height = '';
59682
+ item.style.minHeight = '';
59683
+ });
59684
+ util.fixLayout(row);
59685
+ }
59534
59686
  }
59535
59687
 
59536
59688
  this.grid.decreaseColumn(); // Refresh Module
@@ -69045,11 +69197,15 @@ class Rte {
69045
69197
 
69046
69198
  for (j = 0; j < builder.opts.defaultFontSizes.length; j++) {
69047
69199
  html_fontsizes += `<button title="${builder.opts.defaultFontSizes[j]}px" data-value="${builder.opts.defaultFontSizes[j]}">${builder.opts.defaultFontSizes[j]}</button>`;
69048
- } // <div class="is-draggable" style="width: 5px;height: 45pxpx;background:#fff;cursor: move;"></div>
69200
+ }
69201
+
69202
+ let html_leading = '';
69203
+ this.builder.leadingPreset.forEach(val => {
69204
+ html_leading += `<button title="${val}" data-value="${val}">${val}</button>`;
69205
+ }); // <div class="is-draggable" style="width: 5px;height: 45pxpx;background:#fff;cursor: move;"></div>
69049
69206
  // <div style="height:55px;background:#fff;border-top:#f5f5f5 1px solid;">
69050
69207
  // </div>
69051
69208
 
69052
-
69053
69209
  let html = `<div class="is-rte-tool" style="position:fixed;flex-direction:column;display:none;">
69054
69210
  <div class="rte-for-text" style="display:flex">
69055
69211
  ${html_rte}
@@ -69095,12 +69251,13 @@ class Rte {
69095
69251
 
69096
69252
  <div class="rte-paragraph-options is-rte-pop" tabindex="-1" role="dialog" aria-modal="true" aria-hidden="true">
69097
69253
  <ul>
69098
- <li title="${util.out('Heading 1')}" data-block="h1" tabindex="0"><h1>Heading 1</h1></li>
69099
- <li title="${util.out('Heading 2')}" data-block="h2" tabindex="0"><h2>Heading 2</h2></li>
69100
- <li title="${util.out('Heading 3')}" data-block="h3" tabindex="0"><h3>Heading 3</h3></li>
69101
- <li title="${util.out('Heading 4')}" data-block="h4" tabindex="0"><h4>Heading 4</h4></li>
69102
- <li title="${util.out('Paragraph')}" data-block="p" tabindex="0"><p>Paragraph</p></li>
69103
- <li title="${util.out('Preformatted')}" data-block="pre" tabindex="0"><p style="font-family:courier, monospace;">Preformatted</p></li>
69254
+ <li style="height:58px" title="${util.out('Heading 1')}" data-block="h1" tabindex="0"><h1>Heading 1</h1></li>
69255
+ <li style="height:50px" title="${util.out('Heading 2')}" data-block="h2" tabindex="0"><h2>Heading 2</h2></li>
69256
+ <li style="height:45px" title="${util.out('Heading 3')}" data-block="h3" tabindex="0"><h3>Heading 3</h3></li>
69257
+ <li style="height:40px" title="${util.out('Heading 4')}" data-block="h4" tabindex="0"><h4>Heading 4</h4></li>
69258
+ <li style="height:28px" title="${util.out('Paragraph')}" data-block="p" tabindex="0"><p>Paragraph</p></li>
69259
+ <li style="height:28px" title="${util.out('DIV')}" data-block="div" tabindex="0"><p>div</p></li>
69260
+ <li style="height:28px" title="${util.out('Preformatted')}" data-block="pre" tabindex="0"><p style="font-family:courier, monospace;">Preformatted</p></li>
69104
69261
  </ul>
69105
69262
  </div>
69106
69263
 
@@ -69141,13 +69298,9 @@ class Rte {
69141
69298
  </div>
69142
69299
  <div class="is-label separator">${util.out('Line Spacing')}</div>
69143
69300
  <div class="rte-lineheight-options" style="display: flex;flex-flow: wrap;">
69144
- <button title="1" data-value="1">1</button>
69145
- <button title="1.2" data-value="1.2">1.2</button>
69146
- <button title="1.4" data-value="1.4">1.4</button>
69147
- <button title="1.6" data-value="1.6">1.6</button>
69148
- <button title="1.8" data-value="1.8">1.8</button>
69149
- <button title="2" data-value="2">2</button>
69150
- <button title="2.2" data-value="2.2">2.2</button>
69301
+
69302
+ ${html_leading}
69303
+
69151
69304
  <button title="${util.out('Decrease')}" data-value="-" style="font-size:13px">-</button>
69152
69305
  <button title="${util.out('Increase')}" data-value="+" style="font-size:13px">+</button>
69153
69306
  <button title="${util.out('Clear')}" data-value=""><svg class="is-icon-flex" style="width:18px;height:18px;margin-top: 2px;"><use xlink:href="#ion-ios-close-empty"></use></svg></button>
@@ -69423,7 +69576,10 @@ class Rte {
69423
69576
  }); // Custom Tags
69424
69577
 
69425
69578
  const setTagValue = btn => {
69426
- this.builder.uo.saveForUndo();
69579
+ this.builder.uo.saveForUndo(); //restore selection
69580
+
69581
+ util.restoreSelection(); //a must
69582
+
69427
69583
  const tag = btn.getAttribute('data-value');
69428
69584
  util.pasteHtmlAtCaret(tag, true);
69429
69585
  this.util.hideRtePop(this.rteCustomTagOptions);
@@ -69474,6 +69630,8 @@ class Rte {
69474
69630
  let btnRteTags = builderStuff.querySelectorAll('button.rte-tags');
69475
69631
  btnRteTags.forEach(btn => {
69476
69632
  btn.addEventListener('click', () => {
69633
+ //save selection
69634
+ util.saveSelection();
69477
69635
  const pop = this.rteCustomTagOptions;
69478
69636
 
69479
69637
  if (!dom.hasClass(pop, 'active')) {
@@ -69568,7 +69726,7 @@ class Rte {
69568
69726
  }
69569
69727
 
69570
69728
  if (!container) return;
69571
- let element = container.closest('h1') || container.closest('h2') || container.closest('h3') || container.closest('h4') || container.closest('h5') || container.closest('h6') || container.closest('pre') || container.closest('p');
69729
+ let element = container.closest('h1') || container.closest('h2') || container.closest('h3') || container.closest('h4') || container.closest('h5') || container.closest('h6') || container.closest('pre') || container.closest('p') || container.closest('div');
69572
69730
 
69573
69731
  if (element) {
69574
69732
  // const tagName = element.tagName.toLowerCase();
@@ -69788,6 +69946,8 @@ class Rte {
69788
69946
  let btnRteIcons = builderStuff.querySelectorAll('button.rte-icon');
69789
69947
  btnRteIcons.forEach(btn => {
69790
69948
  btn.addEventListener('click', e => {
69949
+ //save selection
69950
+ util.saveSelection();
69791
69951
  this.openIcon(e);
69792
69952
  });
69793
69953
  }); // Color
@@ -71218,18 +71378,34 @@ class Rte {
71218
71378
  }
71219
71379
  }
71220
71380
  } else {
71221
- if (num === '1') {
71381
+ if (num === '0.8') {
71382
+ newClassName = classes.leading_8;
71383
+ } else if (num === '0.9') {
71384
+ newClassName = classes.leading_9;
71385
+ } else if (num === '1') {
71222
71386
  newClassName = classes.leading_10;
71387
+ } else if (num === '1.1') {
71388
+ newClassName = classes.leading_11;
71223
71389
  } else if (num === '1.2') {
71224
71390
  newClassName = classes.leading_12;
71391
+ } else if (num === '1.3') {
71392
+ newClassName = classes.leading_13;
71225
71393
  } else if (num === '1.4') {
71226
71394
  newClassName = classes.leading_14;
71395
+ } else if (num === '1.5') {
71396
+ newClassName = classes.leading_15;
71227
71397
  } else if (num === '1.6') {
71228
71398
  newClassName = classes.leading_16;
71399
+ } else if (num === '1.7') {
71400
+ newClassName = classes.leading_17;
71229
71401
  } else if (num === '1.8') {
71230
71402
  newClassName = classes.leading_18;
71403
+ } else if (num === '1.9') {
71404
+ newClassName = classes.leading_19;
71231
71405
  } else if (num === '2') {
71232
71406
  newClassName = classes.leading_20;
71407
+ } else if (num === '2.1') {
71408
+ newClassName = classes.leading_21;
71233
71409
  } else if (num === '2.2') {
71234
71410
  newClassName = classes.leading_22;
71235
71411
  }
@@ -72392,7 +72568,7 @@ class Rte {
72392
72568
  if (block === 'heading 4') block = 'h4';
72393
72569
  if (block === 'formatted') block = 'pre';
72394
72570
 
72395
- if (block === 'p' || block === 'h1' || block === 'h2' || block === 'h3' || block === 'h4' || block === 'pre') {
72571
+ if (block === 'p' || block === 'h1' || block === 'h2' || block === 'h3' || block === 'h4' || block === 'div' || block === 'pre') {
72396
72572
  dom.addClass(this.rteParagraphOptions.querySelector('[data-block="' + block + '"]'), 'on');
72397
72573
  }
72398
72574
  }
@@ -72484,12 +72660,20 @@ class Rte {
72484
72660
  Array.prototype.forEach.call(btns, btn => {
72485
72661
  let num = btn.getAttribute('data-value');
72486
72662
  let val;
72663
+ if (className === classes.leading_8) val = '0.8';
72664
+ if (className === classes.leading_9) val = '0.9';
72487
72665
  if (className === classes.leading_10) val = '1';
72666
+ if (className === classes.leading_11) val = '1.1';
72488
72667
  if (className === classes.leading_12) val = '1.2';
72668
+ if (className === classes.leading_13) val = '1.3';
72489
72669
  if (className === classes.leading_14) val = '1.4';
72670
+ if (className === classes.leading_15) val = '1.5';
72490
72671
  if (className === classes.leading_16) val = '1.6';
72672
+ if (className === classes.leading_17) val = '1.7';
72491
72673
  if (className === classes.leading_18) val = '1.8';
72674
+ if (className === classes.leading_19) val = '1.9';
72492
72675
  if (className === classes.leading_20) val = '2';
72676
+ if (className === classes.leading_21) val = '2.1';
72493
72677
  if (className === classes.leading_22) val = '2.2';
72494
72678
 
72495
72679
  if (num === val) {
@@ -77943,7 +78127,7 @@ class ContentBuilder {
77943
78127
  // snippetSampleImage: 'uploads/office2.png', // if enabled, will be used to insert image block
77944
78128
  // snippetSampleVideo: 'uploads/person1.mp4', // if enabled, will be used to insert video block
77945
78129
  // snippetSampleAudio: 'uploads/intro.mp4', // if enabled, will be used to insert audio block
77946
- snippetCategories: [[120, 'Basic'], [118, 'Article'], [101, 'Headline'], [119, 'Buttons'], [102, 'Photos'], [103, 'Profile'], [116, 'Contact'], [104, 'Products'], [105, 'Features'], [106, 'Process'], [107, 'Pricing'], [108, 'Skills'], [109, 'Achievements'], [110, 'Quotes'], [111, 'Partners'], [112, 'As Featured On'], [113, 'Page Not Found'], [114, 'Coming Soon'], [115, 'Help, FAQ']],
78130
+ snippetCategories: [[120, 'Basic'], [118, 'Article'], [101, 'Headline'], [119, 'Buttons'], [102, 'Photos'], [103, 'Profile'], [116, 'Contact'], [104, 'Products, Services'], [105, 'Features'], [108, 'Skills'], [109, 'Achievements'], [106, 'Process'], [107, 'Pricing'], [110, 'Quotes'], [111, 'Partners'], [112, 'As Featured On'], [113, 'Page Not Found'], [114, 'Coming Soon'], [115, 'Help, FAQ']],
77947
78131
  defaultSnippetCategory: 120,
77948
78132
  snippetHandle: true,
77949
78133
  sidePanel: 'right',
@@ -78173,7 +78357,10 @@ class ContentBuilder {
78173
78357
  ],
78174
78358
  */
78175
78359
  colHeight: [300, 350, 400, 450, 500, 550, 600, 650, 700],
78176
- // maxColumns: 6,
78360
+ maxColumns: 6,
78361
+ // leadingPreset: [0.8, 0.9, 1, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 2],
78362
+ // leadingPreset: [1, 1.1, 1.2, 1.3, 1.4, 1.6, 2],
78363
+ leadingPreset: [1, 1.2, 1.4, 1.6, 1.8, 2, 2.2],
78177
78364
  cssClasses: {
78178
78365
  fontWeight: {
78179
78366
  thin: 'font-thin',
@@ -78590,10 +78777,12 @@ class ContentBuilder {
78590
78777
  // If framework param is not used
78591
78778
  if (this.opts.row !== '' && this.opts.cols.length > 0) ; else {
78592
78779
  if (this.opts.cellFormat === '' && this.opts.rowFormat === '') {
78780
+ this.useDefaultGrid = true; // used in columntool.js, grid.js & util.js
78593
78781
  // DEFAULT: Built-in simple css grid
78782
+
78594
78783
  this.opts.row = 'row'; //row clrfx
78595
78784
 
78596
- this.opts.cols = ['column twelfth', 'column eleventh', 'column tenth', 'column ninth', 'column eighth', 'column seventh', 'column sixth', 'column fifth', 'column fourth', 'column third', 'column half', 'column two-third', 'column two-fourth', 'column two-fifth', 'column two-sixth', 'column full'];
78785
+ this.opts.cols = ['column twelfth', 'column eleventh', 'column tenth', 'column ninth', 'column eighth', 'column seventh', 'column sixth', 'column fifth', 'column fourth', 'column third', 'column half', 'column two-third', 'column two-fourth', 'column two-fifth', 'column two-sixth', 'column'];
78597
78786
  this.opts.colequal = [['column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth', 'column twelfth'], ['column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh', 'column eleventh'], ['column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth', 'column tenth'], ['column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth', 'column ninth'], ['column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth', 'column eighth'], ['column seventh', 'column seventh', 'column seventh', 'column seventh', 'column seventh', 'column seventh', 'column seventh'], ['column sixth', 'column sixth', 'column sixth', 'column sixth', 'column sixth', 'column sixth'], ['column fifth', 'column fifth', 'column fifth', 'column fifth', 'column fifth'], ['column fourth', 'column fourth', 'column fourth', 'column fourth'], ['column third', 'column third', 'column third'], ['column half', 'column half']];
78598
78787
  this.opts.colsizes = [//needed for columns in which the size increment is not constant.
78599
78788
  [//increment for 3 columns
@@ -80448,6 +80637,14 @@ class ContentBuilder {
80448
80637
  return area;
80449
80638
  }
80450
80639
 
80640
+ saveSelection() {
80641
+ this.util.saveSelection();
80642
+ }
80643
+
80644
+ restoreSelection() {
80645
+ this.util.restoreSelection();
80646
+ }
80647
+
80451
80648
  pasteHtmlAtCaret(html, selectPastedContent) {
80452
80649
  this.util.pasteHtmlAtCaret(html, selectPastedContent);
80453
80650
  }