@stratusjs/angular 0.7.3 → 0.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/angular.bundle.js +410 -1252
- package/dist/angular.bundle.min.js +1 -1
- package/package.json +1 -1
- package/src/core/dialog.interface.js.map +1 -0
- package/src/froala/plugins/inputButton.js +0 -2
- package/src/froala/plugins/inputButton.js.map +1 -1
- package/src/froala/plugins/inputButton.min.js +1 -1
- package/src/froala/plugins/inputButton.ts +2 -2
- package/src/froala/plugins/linkManager.js +2 -2
- package/src/froala/plugins/linkManager.js.map +1 -1
- package/src/froala/plugins/linkManager.min.js +1 -1
- package/src/froala/plugins/linkManager.ts +4 -4
- package/src/tree/tree-dialog.component.js +1 -1
- package/src/tree/tree-dialog.component.js.map +1 -1
- package/src/tree/tree-dialog.component.min.js +1 -1
- package/src/tree/tree-dialog.component.ts +1 -1
- package/src/editor/quill-break-blot.plugin.js +0 -38
- package/src/editor/quill-break-blot.plugin.js.map +0 -1
- package/src/editor/quill-break-blot.plugin.min.js +0 -1
- package/src/editor/quill-html-edit.plugin.js +0 -164
- package/src/editor/quill-html-edit.plugin.js.map +0 -1
- package/src/editor/quill-html-edit.plugin.min.js +0 -1
- package/src/editor/quill-image-format.plugin.js +0 -50
- package/src/editor/quill-image-format.plugin.js.map +0 -1
- package/src/editor/quill-image-format.plugin.min.js +0 -1
- package/src/editor/quill-input-button.plugin.js +0 -98
- package/src/editor/quill-input-button.plugin.js.map +0 -1
- package/src/editor/quill-input-button.plugin.min.js +0 -1
- package/src/froala/editor/froala-editor.directive.js +0 -328
- package/src/froala/editor/froala-editor.directive.js.map +0 -1
- package/src/froala/editor/froala-editor.directive.min.js +0 -1
- package/src/froala/editor/froala-editor.module.js +0 -37
- package/src/froala/editor/froala-editor.module.js.map +0 -1
- package/src/froala/editor/froala-editor.module.min.js +0 -1
- package/src/froala/editor/index.js +0 -22
- package/src/froala/editor/index.js.map +0 -1
- package/src/froala/editor/index.min.js +0 -1
- package/src/froala/plugins/image_manager.js +0 -364
- package/src/froala/plugins/image_manager.js.map +0 -1
- package/src/froala/plugins/image_manager.min.js +0 -1
- package/src/froala/view/froala-view.directive.js +0 -49
- package/src/froala/view/froala-view.directive.js.map +0 -1
- package/src/froala/view/froala-view.directive.min.js +0 -1
- package/src/froala/view/froala-view.module.js +0 -37
- package/src/froala/view/froala-view.module.js.map +0 -1
- package/src/froala/view/froala-view.module.min.js +0 -1
- package/src/froala/view/index.js +0 -22
- package/src/froala/view/index.js.map +0 -1
- package/src/froala/view/index.min.js +0 -1
- package/src/root/root.component.js +0 -43
- package/src/root/root.component.js.map +0 -1
- package/src/root/root.component.min.js +0 -1
package/dist/angular.bundle.js
CHANGED
|
@@ -80847,7 +80847,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
80847
80847
|
console.log('[restoreSnapshot]is focused:', this.editor.core.hasFocus());
|
|
80848
80848
|
}
|
|
80849
80849
|
this.editor.events.disableBlur();
|
|
80850
|
-
this.editor.events.focus();
|
|
80851
80850
|
this.editor.snapshot.restore(this.snapshot);
|
|
80852
80851
|
this.editor.events.enableBlur();
|
|
80853
80852
|
return true;
|
|
@@ -80867,7 +80866,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
80867
80866
|
console.log('[restoreSelection]is focused:', this.editor.core.hasFocus());
|
|
80868
80867
|
}
|
|
80869
80868
|
this.editor.events.disableBlur();
|
|
80870
|
-
this.editor.events.focus();
|
|
80871
80869
|
this.editor.selection.restore();
|
|
80872
80870
|
this.editor.events.enableBlur();
|
|
80873
80871
|
return true;
|
|
@@ -81074,6 +81072,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
81074
81072
|
editor.link.insert(link.url, link.text, attrs);
|
|
81075
81073
|
},
|
|
81076
81074
|
autoSaveSelection: true,
|
|
81075
|
+
maintainSnapshot: true,
|
|
81077
81076
|
autoRestoreSelection: true,
|
|
81078
81077
|
debug
|
|
81079
81078
|
});
|
|
@@ -81096,9 +81095,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
81096
81095
|
FroalaEditor.RegisterCommand('linkManager', {
|
|
81097
81096
|
title: 'Insert from Link Library',
|
|
81098
81097
|
undo: false,
|
|
81099
|
-
focus:
|
|
81098
|
+
focus: false,
|
|
81100
81099
|
modal: true,
|
|
81101
|
-
refreshOnCallback: false,
|
|
81102
81100
|
callback() {
|
|
81103
81101
|
this.linkManager.onClick();
|
|
81104
81102
|
},
|
|
@@ -124427,7 +124425,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
124427
124425
|
return this.tree.getSvg(url, options);
|
|
124428
124426
|
}
|
|
124429
124427
|
getQueryUrl(query, id) {
|
|
124430
|
-
query = (!_.isString(query) || _.isEmpty(query)) ? '' :
|
|
124428
|
+
query = (!_.isString(query) || _.isEmpty(query)) ? '' : query;
|
|
124431
124429
|
id = !_.isString(id) && !_.isNumber(id) ? '' : `/${id}`;
|
|
124432
124430
|
return `${this.apiBase}${id}?limit=${this.limit}&${this.basicContentQueryAttributes}&q=${query}`;
|
|
124433
124431
|
}
|
|
@@ -124804,6 +124802,11 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
124804
124802
|
/** Width of the map. Set this to `null` if you'd like to control the width through CSS. */
|
|
124805
124803
|
this.width = DEFAULT_WIDTH;
|
|
124806
124804
|
this._options = DEFAULT_OPTIONS;
|
|
124805
|
+
/**
|
|
124806
|
+
* See
|
|
124807
|
+
* https://developers.google.com/maps/documentation/javascript/events#auth-errors
|
|
124808
|
+
*/
|
|
124809
|
+
this.authFailure = new EventEmitter();
|
|
124807
124810
|
/**
|
|
124808
124811
|
* See
|
|
124809
124812
|
* https://developers.google.com/maps/documentation/javascript/reference/map#Map.bounds_changed
|
|
@@ -124904,6 +124907,13 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
124904
124907
|
'https://developers.google.com/maps/documentation/javascript/' +
|
|
124905
124908
|
'tutorial#Loading_the_Maps_API');
|
|
124906
124909
|
}
|
|
124910
|
+
this._existingAuthFailureCallback = googleMapsWindow.gm_authFailure;
|
|
124911
|
+
googleMapsWindow.gm_authFailure = () => {
|
|
124912
|
+
if (this._existingAuthFailureCallback) {
|
|
124913
|
+
this._existingAuthFailureCallback();
|
|
124914
|
+
}
|
|
124915
|
+
this.authFailure.emit();
|
|
124916
|
+
};
|
|
124907
124917
|
}
|
|
124908
124918
|
}
|
|
124909
124919
|
set center(center) {
|
|
@@ -124952,6 +124962,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
124952
124962
|
}
|
|
124953
124963
|
ngOnDestroy() {
|
|
124954
124964
|
this._eventManager.destroy();
|
|
124965
|
+
if (this._isBrowser) {
|
|
124966
|
+
const googleMapsWindow = window;
|
|
124967
|
+
googleMapsWindow.gm_authFailure = this._existingAuthFailureCallback;
|
|
124968
|
+
}
|
|
124955
124969
|
}
|
|
124956
124970
|
/**
|
|
124957
124971
|
* See
|
|
@@ -125138,6 +125152,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
125138
125152
|
center: [{ type: Input }],
|
|
125139
125153
|
zoom: [{ type: Input }],
|
|
125140
125154
|
options: [{ type: Input }],
|
|
125155
|
+
authFailure: [{ type: Output }],
|
|
125141
125156
|
boundsChanged: [{ type: Output }],
|
|
125142
125157
|
centerChanged: [{ type: Output }],
|
|
125143
125158
|
mapClick: [{ type: Output }],
|
|
@@ -125490,6 +125505,131 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
125490
125505
|
circleRightclick: [{ type: Output }]
|
|
125491
125506
|
};
|
|
125492
125507
|
|
|
125508
|
+
/**
|
|
125509
|
+
* @license
|
|
125510
|
+
* Copyright Google LLC All Rights Reserved.
|
|
125511
|
+
*
|
|
125512
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
125513
|
+
* found in the LICENSE file at https://angular.io/license
|
|
125514
|
+
*/
|
|
125515
|
+
/**
|
|
125516
|
+
* Angular component that renders a Google Maps Directions Renderer via the Google Maps
|
|
125517
|
+
* JavaScript API.
|
|
125518
|
+
*
|
|
125519
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsRenderer
|
|
125520
|
+
*/
|
|
125521
|
+
class MapDirectionsRenderer {
|
|
125522
|
+
constructor(_googleMap, _ngZone) {
|
|
125523
|
+
this._googleMap = _googleMap;
|
|
125524
|
+
this._ngZone = _ngZone;
|
|
125525
|
+
this._eventManager = new MapEventManager(this._ngZone);
|
|
125526
|
+
/**
|
|
125527
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions
|
|
125528
|
+
* #DirectionsRenderer.directions_changed
|
|
125529
|
+
*/
|
|
125530
|
+
this.directionsChanged = this._eventManager.getLazyEmitter('directions_changed');
|
|
125531
|
+
}
|
|
125532
|
+
/**
|
|
125533
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions
|
|
125534
|
+
* #DirectionsRendererOptions.directions
|
|
125535
|
+
*/
|
|
125536
|
+
set directions(directions) {
|
|
125537
|
+
this._directions = directions;
|
|
125538
|
+
}
|
|
125539
|
+
/**
|
|
125540
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions
|
|
125541
|
+
* #DirectionsRendererOptions
|
|
125542
|
+
*/
|
|
125543
|
+
set options(options) {
|
|
125544
|
+
this._options = options;
|
|
125545
|
+
}
|
|
125546
|
+
ngOnInit() {
|
|
125547
|
+
if (this._googleMap._isBrowser) {
|
|
125548
|
+
// Create the object outside the zone so its events don't trigger change detection.
|
|
125549
|
+
// We'll bring it back in inside the `MapEventManager` only for the events that the
|
|
125550
|
+
// user has subscribed to.
|
|
125551
|
+
this._ngZone.runOutsideAngular(() => {
|
|
125552
|
+
this.directionsRenderer = new google.maps.DirectionsRenderer(this._combineOptions());
|
|
125553
|
+
});
|
|
125554
|
+
this._assertInitialized();
|
|
125555
|
+
this.directionsRenderer.setMap(this._googleMap.googleMap);
|
|
125556
|
+
this._eventManager.setTarget(this.directionsRenderer);
|
|
125557
|
+
}
|
|
125558
|
+
}
|
|
125559
|
+
ngOnChanges(changes) {
|
|
125560
|
+
if (this.directionsRenderer) {
|
|
125561
|
+
if (changes['options']) {
|
|
125562
|
+
this.directionsRenderer.setOptions(this._combineOptions());
|
|
125563
|
+
}
|
|
125564
|
+
if (changes['directions'] && this._directions !== undefined) {
|
|
125565
|
+
this.directionsRenderer.setDirections(this._directions);
|
|
125566
|
+
}
|
|
125567
|
+
}
|
|
125568
|
+
}
|
|
125569
|
+
ngOnDestroy() {
|
|
125570
|
+
this._eventManager.destroy();
|
|
125571
|
+
if (this.directionsRenderer) {
|
|
125572
|
+
this.directionsRenderer.setMap(null);
|
|
125573
|
+
}
|
|
125574
|
+
}
|
|
125575
|
+
/**
|
|
125576
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions
|
|
125577
|
+
* #DirectionsRenderer.getDirections
|
|
125578
|
+
*/
|
|
125579
|
+
getDirections() {
|
|
125580
|
+
this._assertInitialized();
|
|
125581
|
+
return this.directionsRenderer.getDirections();
|
|
125582
|
+
}
|
|
125583
|
+
/**
|
|
125584
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions
|
|
125585
|
+
* #DirectionsRenderer.getPanel
|
|
125586
|
+
*/
|
|
125587
|
+
getPanel() {
|
|
125588
|
+
this._assertInitialized();
|
|
125589
|
+
return this.directionsRenderer.getPanel();
|
|
125590
|
+
}
|
|
125591
|
+
/**
|
|
125592
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions
|
|
125593
|
+
* #DirectionsRenderer.getRouteIndex
|
|
125594
|
+
*/
|
|
125595
|
+
getRouteIndex() {
|
|
125596
|
+
this._assertInitialized();
|
|
125597
|
+
return this.directionsRenderer.getRouteIndex();
|
|
125598
|
+
}
|
|
125599
|
+
_combineOptions() {
|
|
125600
|
+
const options = this._options || {};
|
|
125601
|
+
return Object.assign(Object.assign({}, options), { directions: this._directions || options.directions, map: this._googleMap.googleMap });
|
|
125602
|
+
}
|
|
125603
|
+
_assertInitialized() {
|
|
125604
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
125605
|
+
if (!this._googleMap.googleMap) {
|
|
125606
|
+
throw Error('Cannot access Google Map information before the API has been initialized. ' +
|
|
125607
|
+
'Please wait for the API to load before trying to interact with it.');
|
|
125608
|
+
}
|
|
125609
|
+
if (!this.directionsRenderer) {
|
|
125610
|
+
throw Error('Cannot interact with a Google Map Directions Renderer before it has been ' +
|
|
125611
|
+
'initialized. Please wait for the Directions Renderer to load before trying ' +
|
|
125612
|
+
'to interact with it.');
|
|
125613
|
+
}
|
|
125614
|
+
}
|
|
125615
|
+
}
|
|
125616
|
+
}
|
|
125617
|
+
MapDirectionsRenderer.decorators = [
|
|
125618
|
+
{ type: Directive, args: [{
|
|
125619
|
+
selector: 'map-directions-renderer',
|
|
125620
|
+
exportAs: 'mapDirectionsRenderer',
|
|
125621
|
+
},] }
|
|
125622
|
+
];
|
|
125623
|
+
MapDirectionsRenderer.ctorParameters = () => [
|
|
125624
|
+
{ type: GoogleMap },
|
|
125625
|
+
{ type: NgZone }
|
|
125626
|
+
];
|
|
125627
|
+
MapDirectionsRenderer.propDecorators = {
|
|
125628
|
+
directions: [{ type: Input }],
|
|
125629
|
+
options: [{ type: Input }],
|
|
125630
|
+
directionsChanged: [{ type: Output }]
|
|
125631
|
+
};
|
|
125632
|
+
|
|
125493
125633
|
/**
|
|
125494
125634
|
* @license
|
|
125495
125635
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -126158,6 +126298,20 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126158
126298
|
set options(options) {
|
|
126159
126299
|
this._options = options;
|
|
126160
126300
|
}
|
|
126301
|
+
/**
|
|
126302
|
+
* Icon to be used for the marker.
|
|
126303
|
+
* See: https://developers.google.com/maps/documentation/javascript/reference/marker#Icon
|
|
126304
|
+
*/
|
|
126305
|
+
set icon(icon) {
|
|
126306
|
+
this._icon = icon;
|
|
126307
|
+
}
|
|
126308
|
+
/**
|
|
126309
|
+
* Whether the marker is visible.
|
|
126310
|
+
* See: developers.google.com/maps/documentation/javascript/reference/marker#MarkerOptions.visible
|
|
126311
|
+
*/
|
|
126312
|
+
set visible(value) {
|
|
126313
|
+
this._visible = value;
|
|
126314
|
+
}
|
|
126161
126315
|
ngOnInit() {
|
|
126162
126316
|
if (this._googleMap._isBrowser) {
|
|
126163
126317
|
// Create the object outside the zone so its events don't trigger change detection.
|
|
@@ -126172,7 +126326,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126172
126326
|
}
|
|
126173
126327
|
}
|
|
126174
126328
|
ngOnChanges(changes) {
|
|
126175
|
-
const { marker, _title, _position, _label, _clickable } = this;
|
|
126329
|
+
const { marker, _title, _position, _label, _clickable, _icon, _visible } = this;
|
|
126176
126330
|
if (marker) {
|
|
126177
126331
|
if (changes['options']) {
|
|
126178
126332
|
marker.setOptions(this._combineOptions());
|
|
@@ -126189,6 +126343,12 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126189
126343
|
if (changes['clickable'] && _clickable !== undefined) {
|
|
126190
126344
|
marker.setClickable(_clickable);
|
|
126191
126345
|
}
|
|
126346
|
+
if (changes['icon'] && _icon) {
|
|
126347
|
+
marker.setIcon(_icon);
|
|
126348
|
+
}
|
|
126349
|
+
if (changes['visible'] && _visible !== undefined) {
|
|
126350
|
+
marker.setVisible(_visible);
|
|
126351
|
+
}
|
|
126192
126352
|
}
|
|
126193
126353
|
}
|
|
126194
126354
|
ngOnDestroy() {
|
|
@@ -126300,8 +126460,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126300
126460
|
}
|
|
126301
126461
|
/** Creates a combined options object using the passed-in options and the individual inputs. */
|
|
126302
126462
|
_combineOptions() {
|
|
126463
|
+
var _a, _b;
|
|
126303
126464
|
const options = this._options || DEFAULT_MARKER_OPTIONS;
|
|
126304
|
-
return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: this._clickable !==
|
|
126465
|
+
return Object.assign(Object.assign({}, options), { title: this._title || options.title, position: this._position || options.position, label: this._label || options.label, clickable: (_a = this._clickable) !== null && _a !== void 0 ? _a : options.clickable, map: this._googleMap.googleMap, icon: this._icon || options.icon, visible: (_b = this._visible) !== null && _b !== void 0 ? _b : options.visible });
|
|
126305
126466
|
}
|
|
126306
126467
|
_assertInitialized() {
|
|
126307
126468
|
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
@@ -126332,6 +126493,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126332
126493
|
label: [{ type: Input }],
|
|
126333
126494
|
clickable: [{ type: Input }],
|
|
126334
126495
|
options: [{ type: Input }],
|
|
126496
|
+
icon: [{ type: Input }],
|
|
126497
|
+
visible: [{ type: Input }],
|
|
126335
126498
|
animationChanged: [{ type: Output }],
|
|
126336
126499
|
mapClick: [{ type: Output }],
|
|
126337
126500
|
clickableChanged: [{ type: Output }],
|
|
@@ -126362,6 +126525,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126362
126525
|
* Use of this source code is governed by an MIT-style license that can be
|
|
126363
126526
|
* found in the LICENSE file at https://angular.io/license
|
|
126364
126527
|
*/
|
|
126528
|
+
/** Default options for a clusterer. */
|
|
126529
|
+
const DEFAULT_CLUSTERER_OPTIONS = {};
|
|
126365
126530
|
/**
|
|
126366
126531
|
* Angular component for implementing a Google Maps Marker Clusterer.
|
|
126367
126532
|
*
|
|
@@ -126386,6 +126551,8 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126386
126551
|
* googlemaps.github.io/v3-utility-library/modules/_google_markerclustererplus.html#clusteringend
|
|
126387
126552
|
*/
|
|
126388
126553
|
this.clusteringend = this._eventManager.getLazyEmitter('clusteringend');
|
|
126554
|
+
/** Emits when a cluster has been clicked. */
|
|
126555
|
+
this.clusterClick = this._eventManager.getLazyEmitter('click');
|
|
126389
126556
|
this._canInitialize = this._googleMap._isBrowser;
|
|
126390
126557
|
}
|
|
126391
126558
|
set averageCenter(averageCenter) {
|
|
@@ -126436,8 +126603,17 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126436
126603
|
set zoomOnClick(zoomOnClick) {
|
|
126437
126604
|
this._zoomOnClick = zoomOnClick;
|
|
126438
126605
|
}
|
|
126606
|
+
set options(options) {
|
|
126607
|
+
this._options = options;
|
|
126608
|
+
}
|
|
126439
126609
|
ngOnInit() {
|
|
126440
126610
|
if (this._canInitialize) {
|
|
126611
|
+
const clustererWindow = window;
|
|
126612
|
+
if (!clustererWindow.MarkerClusterer && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
126613
|
+
throw Error('MarkerClusterer class not found, cannot construct a marker cluster. ' +
|
|
126614
|
+
'Please install the MarkerClustererPlus library: ' +
|
|
126615
|
+
'https://github.com/googlemaps/js-markerclustererplus');
|
|
126616
|
+
}
|
|
126441
126617
|
// Create the object outside the zone so its events don't trigger change detection.
|
|
126442
126618
|
// We'll bring it back in inside the `MapEventManager` only for the events that the
|
|
126443
126619
|
// user has subscribed to.
|
|
@@ -126456,6 +126632,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126456
126632
|
ngOnChanges(changes) {
|
|
126457
126633
|
const { markerClusterer: clusterer, ariaLabelFn, _averageCenter, _batchSizeIE, _calculator, _styles, _clusterClass, _enableRetinaIcons, _gridSize, _ignoreHidden, _imageExtension, _imagePath, _imageSizes, _maxZoom, _minimumClusterSize, _title, _zIndex, _zoomOnClick } = this;
|
|
126458
126634
|
if (clusterer) {
|
|
126635
|
+
if (changes['options']) {
|
|
126636
|
+
clusterer.setOptions(this._combineOptions());
|
|
126637
|
+
}
|
|
126459
126638
|
if (changes['ariaLabelFn']) {
|
|
126460
126639
|
clusterer.ariaLabelFn = ariaLabelFn;
|
|
126461
126640
|
}
|
|
@@ -126465,7 +126644,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126465
126644
|
if (changes['batchSizeIE'] && _batchSizeIE !== undefined) {
|
|
126466
126645
|
clusterer.setBatchSizeIE(_batchSizeIE);
|
|
126467
126646
|
}
|
|
126468
|
-
if (changes['calculator'] && _calculator) {
|
|
126647
|
+
if (changes['calculator'] && !!_calculator) {
|
|
126469
126648
|
clusterer.setCalculator(_calculator);
|
|
126470
126649
|
}
|
|
126471
126650
|
if (changes['clusterClass'] && _clusterClass !== undefined) {
|
|
@@ -126598,26 +126777,9 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126598
126777
|
return this.markerClusterer.getZoomOnClick();
|
|
126599
126778
|
}
|
|
126600
126779
|
_combineOptions() {
|
|
126601
|
-
|
|
126602
|
-
|
|
126603
|
-
|
|
126604
|
-
batchSize: this.batchSize,
|
|
126605
|
-
batchSizeIE: this._batchSizeIE,
|
|
126606
|
-
calculator: this._calculator,
|
|
126607
|
-
clusterClass: this._clusterClass,
|
|
126608
|
-
enableRetinaIcons: this._enableRetinaIcons,
|
|
126609
|
-
gridSize: this._gridSize,
|
|
126610
|
-
ignoreHidden: this._ignoreHidden,
|
|
126611
|
-
imageExtension: this._imageExtension,
|
|
126612
|
-
imagePath: this._imagePath,
|
|
126613
|
-
imageSizes: this._imageSizes,
|
|
126614
|
-
maxZoom: this._maxZoom,
|
|
126615
|
-
minimumClusterSize: this._minimumClusterSize,
|
|
126616
|
-
styles: this._styles,
|
|
126617
|
-
title: this._title,
|
|
126618
|
-
zIndex: this._zIndex,
|
|
126619
|
-
zoomOnClick: this._zoomOnClick,
|
|
126620
|
-
};
|
|
126780
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t;
|
|
126781
|
+
const options = this._options || DEFAULT_CLUSTERER_OPTIONS;
|
|
126782
|
+
return Object.assign(Object.assign({}, options), { ariaLabelFn: (_a = this.ariaLabelFn) !== null && _a !== void 0 ? _a : options.ariaLabelFn, averageCenter: (_b = this._averageCenter) !== null && _b !== void 0 ? _b : options.averageCenter, batchSize: (_c = this.batchSize) !== null && _c !== void 0 ? _c : options.batchSize, batchSizeIE: (_d = this._batchSizeIE) !== null && _d !== void 0 ? _d : options.batchSizeIE, calculator: (_e = this._calculator) !== null && _e !== void 0 ? _e : options.calculator, clusterClass: (_f = this._clusterClass) !== null && _f !== void 0 ? _f : options.clusterClass, enableRetinaIcons: (_g = this._enableRetinaIcons) !== null && _g !== void 0 ? _g : options.enableRetinaIcons, gridSize: (_h = this._gridSize) !== null && _h !== void 0 ? _h : options.gridSize, ignoreHidden: (_j = this._ignoreHidden) !== null && _j !== void 0 ? _j : options.ignoreHidden, imageExtension: (_k = this._imageExtension) !== null && _k !== void 0 ? _k : options.imageExtension, imagePath: (_l = this._imagePath) !== null && _l !== void 0 ? _l : options.imagePath, imageSizes: (_m = this._imageSizes) !== null && _m !== void 0 ? _m : options.imageSizes, maxZoom: (_o = this._maxZoom) !== null && _o !== void 0 ? _o : options.maxZoom, minimumClusterSize: (_p = this._minimumClusterSize) !== null && _p !== void 0 ? _p : options.minimumClusterSize, styles: (_q = this._styles) !== null && _q !== void 0 ? _q : options.styles, title: (_r = this._title) !== null && _r !== void 0 ? _r : options.title, zIndex: (_s = this._zIndex) !== null && _s !== void 0 ? _s : options.zIndex, zoomOnClick: (_t = this._zoomOnClick) !== null && _t !== void 0 ? _t : options.zoomOnClick });
|
|
126621
126783
|
}
|
|
126622
126784
|
_watchForMarkerChanges() {
|
|
126623
126785
|
this._assertInitialized();
|
|
@@ -126700,8 +126862,10 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
126700
126862
|
title: [{ type: Input }],
|
|
126701
126863
|
zIndex: [{ type: Input }],
|
|
126702
126864
|
zoomOnClick: [{ type: Input }],
|
|
126865
|
+
options: [{ type: Input }],
|
|
126703
126866
|
clusteringbegin: [{ type: Output }],
|
|
126704
126867
|
clusteringend: [{ type: Output }],
|
|
126868
|
+
clusterClick: [{ type: Output }],
|
|
126705
126869
|
_markers: [{ type: ContentChildren, args: [MapMarker, { descendants: true },] }]
|
|
126706
126870
|
};
|
|
126707
126871
|
|
|
@@ -127101,8 +127265,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
127101
127265
|
/**
|
|
127102
127266
|
* See
|
|
127103
127267
|
* developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.boundsChanged
|
|
127104
|
-
*/
|
|
127105
|
-
this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
|
|
127268
|
+
*/ this.boundsChanged = this._eventManager.getLazyEmitter('bounds_changed');
|
|
127106
127269
|
/**
|
|
127107
127270
|
* See
|
|
127108
127271
|
* developers.google.com/maps/documentation/javascript/reference/polygon#Rectangle.click
|
|
@@ -127403,6 +127566,132 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
127403
127566
|
},] }
|
|
127404
127567
|
];
|
|
127405
127568
|
|
|
127569
|
+
/**
|
|
127570
|
+
* @license
|
|
127571
|
+
* Copyright Google LLC All Rights Reserved.
|
|
127572
|
+
*
|
|
127573
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
127574
|
+
* found in the LICENSE file at https://angular.io/license
|
|
127575
|
+
*/
|
|
127576
|
+
/**
|
|
127577
|
+
* Angular directive that renders a Google Maps heatmap via the Google Maps JavaScript API.
|
|
127578
|
+
*
|
|
127579
|
+
* See: https://developers.google.com/maps/documentation/javascript/reference/visualization
|
|
127580
|
+
*/
|
|
127581
|
+
class MapHeatmapLayer {
|
|
127582
|
+
constructor(_googleMap, _ngZone) {
|
|
127583
|
+
this._googleMap = _googleMap;
|
|
127584
|
+
this._ngZone = _ngZone;
|
|
127585
|
+
}
|
|
127586
|
+
/**
|
|
127587
|
+
* Data shown on the heatmap.
|
|
127588
|
+
* See: https://developers.google.com/maps/documentation/javascript/reference/visualization
|
|
127589
|
+
*/
|
|
127590
|
+
set data(data) {
|
|
127591
|
+
this._data = data;
|
|
127592
|
+
}
|
|
127593
|
+
/**
|
|
127594
|
+
* Options used to configure the heatmap. See:
|
|
127595
|
+
* developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayerOptions
|
|
127596
|
+
*/
|
|
127597
|
+
set options(options) {
|
|
127598
|
+
this._options = options;
|
|
127599
|
+
}
|
|
127600
|
+
ngOnInit() {
|
|
127601
|
+
var _a, _b;
|
|
127602
|
+
if (this._googleMap._isBrowser) {
|
|
127603
|
+
if (!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.visualization) && (typeof ngDevMode === 'undefined' || ngDevMode)) {
|
|
127604
|
+
throw Error('Namespace `google.maps.visualization` not found, cannot construct heatmap. ' +
|
|
127605
|
+
'Please install the Google Maps JavaScript API with the "visualization" library: ' +
|
|
127606
|
+
'https://developers.google.com/maps/documentation/javascript/visualization');
|
|
127607
|
+
}
|
|
127608
|
+
// Create the object outside the zone so its events don't trigger change detection.
|
|
127609
|
+
// We'll bring it back in inside the `MapEventManager` only for the events that the
|
|
127610
|
+
// user has subscribed to.
|
|
127611
|
+
this._ngZone.runOutsideAngular(() => {
|
|
127612
|
+
this.heatmap = new google.maps.visualization.HeatmapLayer(this._combineOptions());
|
|
127613
|
+
});
|
|
127614
|
+
this._assertInitialized();
|
|
127615
|
+
this.heatmap.setMap(this._googleMap.googleMap);
|
|
127616
|
+
}
|
|
127617
|
+
}
|
|
127618
|
+
ngOnChanges(changes) {
|
|
127619
|
+
const { _data, heatmap } = this;
|
|
127620
|
+
if (heatmap) {
|
|
127621
|
+
if (changes['options']) {
|
|
127622
|
+
heatmap.setOptions(this._combineOptions());
|
|
127623
|
+
}
|
|
127624
|
+
if (changes['data'] && _data !== undefined) {
|
|
127625
|
+
heatmap.setData(this._normalizeData(_data));
|
|
127626
|
+
}
|
|
127627
|
+
}
|
|
127628
|
+
}
|
|
127629
|
+
ngOnDestroy() {
|
|
127630
|
+
if (this.heatmap) {
|
|
127631
|
+
this.heatmap.setMap(null);
|
|
127632
|
+
}
|
|
127633
|
+
}
|
|
127634
|
+
/**
|
|
127635
|
+
* Gets the data that is currently shown on the heatmap.
|
|
127636
|
+
* See: developers.google.com/maps/documentation/javascript/reference/visualization#HeatmapLayer
|
|
127637
|
+
*/
|
|
127638
|
+
getData() {
|
|
127639
|
+
this._assertInitialized();
|
|
127640
|
+
return this.heatmap.getData();
|
|
127641
|
+
}
|
|
127642
|
+
/** Creates a combined options object using the passed-in options and the individual inputs. */
|
|
127643
|
+
_combineOptions() {
|
|
127644
|
+
const options = this._options || {};
|
|
127645
|
+
return Object.assign(Object.assign({}, options), { data: this._normalizeData(this._data || options.data || []), map: this._googleMap.googleMap });
|
|
127646
|
+
}
|
|
127647
|
+
/**
|
|
127648
|
+
* Most Google Maps APIs support both `LatLng` objects and `LatLngLiteral`. The latter is more
|
|
127649
|
+
* convenient to write out, because the Google Maps API doesn't have to have been loaded in order
|
|
127650
|
+
* to construct them. The `HeatmapLayer` appears to be an exception that only allows a `LatLng`
|
|
127651
|
+
* object, or it throws a runtime error. Since it's more convenient and we expect that Angular
|
|
127652
|
+
* users will load the API asynchronously, we allow them to pass in a `LatLngLiteral` and we
|
|
127653
|
+
* convert it to a `LatLng` object before passing it off to Google Maps.
|
|
127654
|
+
*/
|
|
127655
|
+
_normalizeData(data) {
|
|
127656
|
+
const result = [];
|
|
127657
|
+
data.forEach(item => {
|
|
127658
|
+
result.push(isLatLngLiteral(item) ? new google.maps.LatLng(item.lat, item.lng) : item);
|
|
127659
|
+
});
|
|
127660
|
+
return result;
|
|
127661
|
+
}
|
|
127662
|
+
/** Asserts that the heatmap object has been initialized. */
|
|
127663
|
+
_assertInitialized() {
|
|
127664
|
+
if (typeof ngDevMode === 'undefined' || ngDevMode) {
|
|
127665
|
+
if (!this._googleMap.googleMap) {
|
|
127666
|
+
throw Error('Cannot access Google Map information before the API has been initialized. ' +
|
|
127667
|
+
'Please wait for the API to load before trying to interact with it.');
|
|
127668
|
+
}
|
|
127669
|
+
if (!this.heatmap) {
|
|
127670
|
+
throw Error('Cannot interact with a Google Map HeatmapLayer before it has been ' +
|
|
127671
|
+
'initialized. Please wait for the heatmap to load before trying to interact with it.');
|
|
127672
|
+
}
|
|
127673
|
+
}
|
|
127674
|
+
}
|
|
127675
|
+
}
|
|
127676
|
+
MapHeatmapLayer.decorators = [
|
|
127677
|
+
{ type: Directive, args: [{
|
|
127678
|
+
selector: 'map-heatmap-layer',
|
|
127679
|
+
exportAs: 'mapHeatmapLayer',
|
|
127680
|
+
},] }
|
|
127681
|
+
];
|
|
127682
|
+
MapHeatmapLayer.ctorParameters = () => [
|
|
127683
|
+
{ type: GoogleMap },
|
|
127684
|
+
{ type: NgZone }
|
|
127685
|
+
];
|
|
127686
|
+
MapHeatmapLayer.propDecorators = {
|
|
127687
|
+
data: [{ type: Input }],
|
|
127688
|
+
options: [{ type: Input }]
|
|
127689
|
+
};
|
|
127690
|
+
/** Asserts that an object is a `LatLngLiteral`. */
|
|
127691
|
+
function isLatLngLiteral(value) {
|
|
127692
|
+
return value && typeof value.lat === 'number' && typeof value.lng === 'number';
|
|
127693
|
+
}
|
|
127694
|
+
|
|
127406
127695
|
/**
|
|
127407
127696
|
* @license
|
|
127408
127697
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -127415,6 +127704,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
127415
127704
|
MapBaseLayer,
|
|
127416
127705
|
MapBicyclingLayer,
|
|
127417
127706
|
MapCircle,
|
|
127707
|
+
MapDirectionsRenderer,
|
|
127418
127708
|
MapGroundOverlay,
|
|
127419
127709
|
MapInfoWindow,
|
|
127420
127710
|
MapKmlLayer,
|
|
@@ -127425,6 +127715,7 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
127425
127715
|
MapRectangle,
|
|
127426
127716
|
MapTrafficLayer,
|
|
127427
127717
|
MapTransitLayer,
|
|
127718
|
+
MapHeatmapLayer,
|
|
127428
127719
|
];
|
|
127429
127720
|
class GoogleMapsModule {
|
|
127430
127721
|
}
|
|
@@ -127435,6 +127726,95 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
127435
127726
|
},] }
|
|
127436
127727
|
];
|
|
127437
127728
|
|
|
127729
|
+
/**
|
|
127730
|
+
* @license
|
|
127731
|
+
* Copyright Google LLC All Rights Reserved.
|
|
127732
|
+
*
|
|
127733
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
127734
|
+
* found in the LICENSE file at https://angular.io/license
|
|
127735
|
+
*/
|
|
127736
|
+
/**
|
|
127737
|
+
* Angular service that wraps the Google Maps DirectionsService from the Google Maps JavaScript
|
|
127738
|
+
* API.
|
|
127739
|
+
*
|
|
127740
|
+
* See developers.google.com/maps/documentation/javascript/reference/directions#DirectionsService
|
|
127741
|
+
*/
|
|
127742
|
+
class MapDirectionsService {
|
|
127743
|
+
constructor(_ngZone) {
|
|
127744
|
+
this._ngZone = _ngZone;
|
|
127745
|
+
}
|
|
127746
|
+
/**
|
|
127747
|
+
* See
|
|
127748
|
+
* developers.google.com/maps/documentation/javascript/reference/directions
|
|
127749
|
+
* #DirectionsService.route
|
|
127750
|
+
*/
|
|
127751
|
+
route(request) {
|
|
127752
|
+
return new Observable(observer => {
|
|
127753
|
+
// Initialize the `DirectionsService` lazily since the Google Maps API may
|
|
127754
|
+
// not have been loaded when the provider is instantiated.
|
|
127755
|
+
if (!this._directionsService) {
|
|
127756
|
+
this._directionsService = new google.maps.DirectionsService();
|
|
127757
|
+
}
|
|
127758
|
+
const callback = (result, status) => {
|
|
127759
|
+
this._ngZone.run(() => {
|
|
127760
|
+
observer.next({ result, status });
|
|
127761
|
+
observer.complete();
|
|
127762
|
+
});
|
|
127763
|
+
};
|
|
127764
|
+
this._directionsService.route(request, callback);
|
|
127765
|
+
});
|
|
127766
|
+
}
|
|
127767
|
+
}
|
|
127768
|
+
MapDirectionsService.ɵprov = ɵɵdefineInjectable({ factory: function MapDirectionsService_Factory() { return new MapDirectionsService(ɵɵinject(NgZone)); }, token: MapDirectionsService, providedIn: "root" });
|
|
127769
|
+
MapDirectionsService.decorators = [
|
|
127770
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
127771
|
+
];
|
|
127772
|
+
MapDirectionsService.ctorParameters = () => [
|
|
127773
|
+
{ type: NgZone }
|
|
127774
|
+
];
|
|
127775
|
+
|
|
127776
|
+
/**
|
|
127777
|
+
* @license
|
|
127778
|
+
* Copyright Google LLC All Rights Reserved.
|
|
127779
|
+
*
|
|
127780
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
127781
|
+
* found in the LICENSE file at https://angular.io/license
|
|
127782
|
+
*/
|
|
127783
|
+
/**
|
|
127784
|
+
* Angular service that wraps the Google Maps Geocoder from the Google Maps JavaScript API.
|
|
127785
|
+
* See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder
|
|
127786
|
+
*/
|
|
127787
|
+
class MapGeocoder {
|
|
127788
|
+
constructor(_ngZone) {
|
|
127789
|
+
this._ngZone = _ngZone;
|
|
127790
|
+
}
|
|
127791
|
+
/**
|
|
127792
|
+
* See developers.google.com/maps/documentation/javascript/reference/geocoder#Geocoder.geocode
|
|
127793
|
+
*/
|
|
127794
|
+
geocode(request) {
|
|
127795
|
+
return new Observable(observer => {
|
|
127796
|
+
// Initialize the `Geocoder` lazily since the Google Maps API may
|
|
127797
|
+
// not have been loaded when the provider is instantiated.
|
|
127798
|
+
if (!this._geocoder) {
|
|
127799
|
+
this._geocoder = new google.maps.Geocoder();
|
|
127800
|
+
}
|
|
127801
|
+
this._geocoder.geocode(request, (results, status) => {
|
|
127802
|
+
this._ngZone.run(() => {
|
|
127803
|
+
observer.next({ results, status });
|
|
127804
|
+
observer.complete();
|
|
127805
|
+
});
|
|
127806
|
+
});
|
|
127807
|
+
});
|
|
127808
|
+
}
|
|
127809
|
+
}
|
|
127810
|
+
MapGeocoder.ɵprov = ɵɵdefineInjectable({ factory: function MapGeocoder_Factory() { return new MapGeocoder(ɵɵinject(NgZone)); }, token: MapGeocoder, providedIn: "root" });
|
|
127811
|
+
MapGeocoder.decorators = [
|
|
127812
|
+
{ type: Injectable, args: [{ providedIn: 'root' },] }
|
|
127813
|
+
];
|
|
127814
|
+
MapGeocoder.ctorParameters = () => [
|
|
127815
|
+
{ type: NgZone }
|
|
127816
|
+
];
|
|
127817
|
+
|
|
127438
127818
|
var __decorate$a = (undefined && undefined.__decorate) || function (decorators, target, key, desc) {
|
|
127439
127819
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
127440
127820
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -160996,1126 +161376,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
160996
161376
|
})
|
|
160997
161377
|
.catch(err => console.error('@stratusjs/angular failed to initialize!', err));
|
|
160998
161378
|
|
|
160999
|
-
System.register(["quill", "@stratusjs/core/environment"], function (exports_1, context_1) {
|
|
161000
|
-
var quill_1, environment_1, Break, Embed, QuillBreak;
|
|
161001
|
-
context_1 && context_1.id;
|
|
161002
|
-
return {
|
|
161003
|
-
setters: [
|
|
161004
|
-
function (quill_1_1) {
|
|
161005
|
-
quill_1 = quill_1_1;
|
|
161006
|
-
},
|
|
161007
|
-
function (environment_1_1) {
|
|
161008
|
-
environment_1 = environment_1_1;
|
|
161009
|
-
}
|
|
161010
|
-
],
|
|
161011
|
-
execute: function () {
|
|
161012
|
-
Break = quill_1.default.import('blots/break');
|
|
161013
|
-
Embed = quill_1.default.import('blots/embed');
|
|
161014
|
-
QuillBreak = class QuillBreak extends Break {
|
|
161015
|
-
length() {
|
|
161016
|
-
return 1;
|
|
161017
|
-
}
|
|
161018
|
-
value() {
|
|
161019
|
-
return '\n';
|
|
161020
|
-
}
|
|
161021
|
-
insertInto(parent, ref) {
|
|
161022
|
-
if (environment_1.cookie('env')) {
|
|
161023
|
-
console.log('insertInto:', parent, ref);
|
|
161024
|
-
}
|
|
161025
|
-
Embed.prototype.insertInto.call(this, parent, ref);
|
|
161026
|
-
}
|
|
161027
|
-
};
|
|
161028
|
-
exports_1("QuillBreak", QuillBreak);
|
|
161029
|
-
QuillBreak.blotName = 'break';
|
|
161030
|
-
QuillBreak.tagName = 'BR';
|
|
161031
|
-
}
|
|
161032
|
-
};
|
|
161033
|
-
});
|
|
161034
|
-
|
|
161035
|
-
System.register(["quill"], function (exports_1, context_1) {
|
|
161036
|
-
var quill_1, BaseImage, ATTRIBUTES, QuillImageFormatPlugin;
|
|
161037
|
-
context_1 && context_1.id;
|
|
161038
|
-
return {
|
|
161039
|
-
setters: [
|
|
161040
|
-
function (quill_1_1) {
|
|
161041
|
-
quill_1 = quill_1_1;
|
|
161042
|
-
}
|
|
161043
|
-
],
|
|
161044
|
-
execute: function () {
|
|
161045
|
-
BaseImage = quill_1.default.import('formats/image');
|
|
161046
|
-
ATTRIBUTES = [
|
|
161047
|
-
'alt',
|
|
161048
|
-
'height',
|
|
161049
|
-
'width',
|
|
161050
|
-
'stratus-src',
|
|
161051
|
-
'stratusSrc'
|
|
161052
|
-
];
|
|
161053
|
-
QuillImageFormatPlugin = class QuillImageFormatPlugin extends BaseImage {
|
|
161054
|
-
constructor() {
|
|
161055
|
-
super(...arguments);
|
|
161056
|
-
this.blotName = 'imageCustom';
|
|
161057
|
-
this.tagName = 'IMG';
|
|
161058
|
-
}
|
|
161059
|
-
format(name, value) {
|
|
161060
|
-
console.log('format:', name, value, this.domNode.getAttribute('src'));
|
|
161061
|
-
if (ATTRIBUTES.indexOf(name) === -1) {
|
|
161062
|
-
super.format(name, value);
|
|
161063
|
-
return;
|
|
161064
|
-
}
|
|
161065
|
-
if (!value) {
|
|
161066
|
-
this.domNode.removeAttribute(name);
|
|
161067
|
-
return;
|
|
161068
|
-
}
|
|
161069
|
-
if (name === 'stratus-src') {
|
|
161070
|
-
console.log('stratus-src:', value);
|
|
161071
|
-
}
|
|
161072
|
-
if (name === 'stratusSrc') {
|
|
161073
|
-
console.log('stratusSrc:', value);
|
|
161074
|
-
}
|
|
161075
|
-
this.domNode.setAttribute(name, value);
|
|
161076
|
-
}
|
|
161077
|
-
};
|
|
161078
|
-
exports_1("QuillImageFormatPlugin", QuillImageFormatPlugin);
|
|
161079
|
-
}
|
|
161080
|
-
};
|
|
161081
|
-
});
|
|
161082
|
-
|
|
161083
|
-
System.register(["@stratusjs/runtime/stratus", "lodash", "quill"], function (exports_1, context_1) {
|
|
161084
|
-
var stratus_1, lodash_1, quill_1, QuillInputButtonPlugin;
|
|
161085
|
-
context_1 && context_1.id;
|
|
161086
|
-
return {
|
|
161087
|
-
setters: [
|
|
161088
|
-
function (stratus_1_1) {
|
|
161089
|
-
stratus_1 = stratus_1_1;
|
|
161090
|
-
},
|
|
161091
|
-
function (lodash_1_1) {
|
|
161092
|
-
lodash_1 = lodash_1_1;
|
|
161093
|
-
},
|
|
161094
|
-
function (quill_1_1) {
|
|
161095
|
-
quill_1 = quill_1_1;
|
|
161096
|
-
}
|
|
161097
|
-
],
|
|
161098
|
-
execute: function () {
|
|
161099
|
-
QuillInputButtonPlugin = class QuillInputButtonPlugin {
|
|
161100
|
-
constructor(quill, options) {
|
|
161101
|
-
this.debug = false;
|
|
161102
|
-
this.buttonHTML = '<i class="fas fa-carrot"></i>';
|
|
161103
|
-
this.buttonTitle = 'Input Button';
|
|
161104
|
-
this.name = 'inputButton';
|
|
161105
|
-
this.eventName = 'input-button';
|
|
161106
|
-
this.uid = lodash_1.default.uniqueId(`quill_input_button_`);
|
|
161107
|
-
stratus_1.Stratus.Instances[this.uid] = this;
|
|
161108
|
-
this.debug = options && options.debug;
|
|
161109
|
-
if (!options || typeof options !== 'object') {
|
|
161110
|
-
options = {};
|
|
161111
|
-
}
|
|
161112
|
-
this.buttonHTML = options.buttonHTML || this.buttonHTML;
|
|
161113
|
-
this.buttonTitle = options.buttonTitle || this.buttonTitle;
|
|
161114
|
-
this.name = options.name || this.name;
|
|
161115
|
-
this.eventName = options.eventName || this.eventName;
|
|
161116
|
-
this.createToolbarModule(quill);
|
|
161117
|
-
}
|
|
161118
|
-
createToolbarModule(quill) {
|
|
161119
|
-
const toolbarModule = quill.getModule('toolbar');
|
|
161120
|
-
if (!toolbarModule) {
|
|
161121
|
-
throw new Error(`quill.${this.name} requires the "toolbar" module`);
|
|
161122
|
-
}
|
|
161123
|
-
this.registerDivModule();
|
|
161124
|
-
const toolbarEl = toolbarModule.container;
|
|
161125
|
-
const buttonContainer = document.createElement('span');
|
|
161126
|
-
buttonContainer.setAttribute('class', 'ql-formats');
|
|
161127
|
-
const button = document.createElement('button');
|
|
161128
|
-
button.innerHTML = this.buttonHTML;
|
|
161129
|
-
button.title = this.buttonTitle;
|
|
161130
|
-
button.onclick = (e) => {
|
|
161131
|
-
e.preventDefault();
|
|
161132
|
-
this.onClick(quill);
|
|
161133
|
-
};
|
|
161134
|
-
buttonContainer.appendChild(button);
|
|
161135
|
-
toolbarEl.appendChild(buttonContainer);
|
|
161136
|
-
}
|
|
161137
|
-
registerDivModule() {
|
|
161138
|
-
const Block = quill_1.default.import('blots/block');
|
|
161139
|
-
class Div extends Block {
|
|
161140
|
-
}
|
|
161141
|
-
Div.tagName = 'div';
|
|
161142
|
-
Div.blotName = 'div';
|
|
161143
|
-
Div.allowedChildren = Block.allowedChildren;
|
|
161144
|
-
Div.allowedChildren.push(Block);
|
|
161145
|
-
quill_1.default.register(Div);
|
|
161146
|
-
}
|
|
161147
|
-
findUID(el) {
|
|
161148
|
-
if ('uid' in el.dataset) {
|
|
161149
|
-
return el.dataset.uid;
|
|
161150
|
-
}
|
|
161151
|
-
return this.findUID(el.parentElement);
|
|
161152
|
-
}
|
|
161153
|
-
getInstance(uid) {
|
|
161154
|
-
if (!(uid in stratus_1.Stratus.Instances)) {
|
|
161155
|
-
return undefined;
|
|
161156
|
-
}
|
|
161157
|
-
return stratus_1.Stratus.Instances[uid];
|
|
161158
|
-
}
|
|
161159
|
-
onClick(quill) {
|
|
161160
|
-
const container = quill.container;
|
|
161161
|
-
const uid = this.findUID(container);
|
|
161162
|
-
const instance = this.getInstance(uid);
|
|
161163
|
-
if (!instance) {
|
|
161164
|
-
return;
|
|
161165
|
-
}
|
|
161166
|
-
instance.trigger(this.eventName, null, this);
|
|
161167
|
-
}
|
|
161168
|
-
trigger(name, data, callee) {
|
|
161169
|
-
if (this.debug) {
|
|
161170
|
-
console.log(`quill.${this.name}.trigger:`, name, data, callee);
|
|
161171
|
-
}
|
|
161172
|
-
}
|
|
161173
|
-
};
|
|
161174
|
-
exports_1("QuillInputButtonPlugin", QuillInputButtonPlugin);
|
|
161175
|
-
}
|
|
161176
|
-
};
|
|
161177
|
-
});
|
|
161178
|
-
|
|
161179
|
-
System.register(["quill"], function (exports_1, context_1) {
|
|
161180
|
-
var quill_1, debug, Logger, QuillHtmlEditPlugin;
|
|
161181
|
-
context_1 && context_1.id;
|
|
161182
|
-
function $create(elName) {
|
|
161183
|
-
return document.createElement(elName);
|
|
161184
|
-
}
|
|
161185
|
-
function $setAttr(el, key, value) {
|
|
161186
|
-
return el.setAttribute(key, value);
|
|
161187
|
-
}
|
|
161188
|
-
function launchPopupEditor(quill, options) {
|
|
161189
|
-
const htmlFromEditor = quill.container.querySelector('.ql-editor').innerHTML;
|
|
161190
|
-
const popupContainer = $create('div');
|
|
161191
|
-
const overlayContainer = $create('div');
|
|
161192
|
-
const msg = options.msg || 'Edit HTML here, when you click "OK" the quill editor\'s contents will be replaced';
|
|
161193
|
-
const cancelText = options.cancelText || 'Cancel';
|
|
161194
|
-
const okText = options.okText || 'Ok';
|
|
161195
|
-
$setAttr(overlayContainer, 'class', 'ql-html-overlayContainer');
|
|
161196
|
-
$setAttr(popupContainer, 'class', 'ql-html-popupContainer');
|
|
161197
|
-
const popupTitle = $create('i');
|
|
161198
|
-
$setAttr(popupTitle, 'class', 'ql-html-popupTitle');
|
|
161199
|
-
popupTitle.innerText = msg;
|
|
161200
|
-
const textContainer = $create('div');
|
|
161201
|
-
textContainer.appendChild(popupTitle);
|
|
161202
|
-
$setAttr(textContainer, 'class', 'ql-html-textContainer');
|
|
161203
|
-
const textArea = $create('textarea');
|
|
161204
|
-
$setAttr(textArea, 'class', 'ql-html-textArea');
|
|
161205
|
-
textArea.value = formatHTML(htmlFromEditor);
|
|
161206
|
-
const buttonCancel = $create('button');
|
|
161207
|
-
buttonCancel.innerHTML = cancelText;
|
|
161208
|
-
$setAttr(buttonCancel, 'class', 'ql-html-buttonCancel');
|
|
161209
|
-
const buttonOk = $create('button');
|
|
161210
|
-
buttonOk.innerHTML = okText;
|
|
161211
|
-
const buttonGroup = $create('div');
|
|
161212
|
-
$setAttr(buttonGroup, 'class', 'ql-html-buttonGroup');
|
|
161213
|
-
buttonGroup.appendChild(buttonCancel);
|
|
161214
|
-
buttonGroup.appendChild(buttonOk);
|
|
161215
|
-
textContainer.appendChild(textArea);
|
|
161216
|
-
textContainer.appendChild(buttonGroup);
|
|
161217
|
-
popupContainer.appendChild(textContainer);
|
|
161218
|
-
overlayContainer.appendChild(popupContainer);
|
|
161219
|
-
document.body.appendChild(overlayContainer);
|
|
161220
|
-
buttonCancel.onclick = () => {
|
|
161221
|
-
document.body.removeChild(overlayContainer);
|
|
161222
|
-
};
|
|
161223
|
-
overlayContainer.onclick = buttonCancel.onclick;
|
|
161224
|
-
popupContainer.onclick = (e) => {
|
|
161225
|
-
e.preventDefault();
|
|
161226
|
-
e.stopPropagation();
|
|
161227
|
-
};
|
|
161228
|
-
buttonOk.onclick = () => {
|
|
161229
|
-
const output = textArea.value.split(/\r?\n/g).map((el) => el.trim());
|
|
161230
|
-
const noNewlines = output.join('');
|
|
161231
|
-
quill.container.querySelector('.ql-editor').innerHTML = noNewlines;
|
|
161232
|
-
document.body.removeChild(overlayContainer);
|
|
161233
|
-
};
|
|
161234
|
-
}
|
|
161235
|
-
function formatHTML(code) {
|
|
161236
|
-
const whitespace = ' '.repeat(2);
|
|
161237
|
-
let currentIndent = 0;
|
|
161238
|
-
const newlineChar = '\n';
|
|
161239
|
-
let char = null;
|
|
161240
|
-
let nextChar = null;
|
|
161241
|
-
let result = '';
|
|
161242
|
-
for (let pos = 0; pos <= code.length; pos++) {
|
|
161243
|
-
char = code.substr(pos, 1);
|
|
161244
|
-
nextChar = code.substr(pos + 1, 1);
|
|
161245
|
-
const isBrTag = code.substr(pos, 4) === '<br>';
|
|
161246
|
-
const isOpeningTag = char === '<' && nextChar !== '/' && !isBrTag;
|
|
161247
|
-
const isClosingTag = char === '<' && nextChar === '/' && !isBrTag;
|
|
161248
|
-
if (isBrTag) {
|
|
161249
|
-
result += newlineChar;
|
|
161250
|
-
currentIndent--;
|
|
161251
|
-
pos += 4;
|
|
161252
|
-
}
|
|
161253
|
-
if (isOpeningTag) {
|
|
161254
|
-
result += newlineChar + whitespace.repeat(currentIndent);
|
|
161255
|
-
currentIndent++;
|
|
161256
|
-
}
|
|
161257
|
-
else if (isClosingTag) {
|
|
161258
|
-
if (--currentIndent < 0) {
|
|
161259
|
-
currentIndent = 0;
|
|
161260
|
-
}
|
|
161261
|
-
result += newlineChar + whitespace.repeat(currentIndent);
|
|
161262
|
-
}
|
|
161263
|
-
else if (char === ' ' && nextChar === ' ') {
|
|
161264
|
-
char = '';
|
|
161265
|
-
}
|
|
161266
|
-
else if (char === newlineChar) {
|
|
161267
|
-
if (code.substr(pos, code.substr(pos).indexOf('<')).trim() === '') {
|
|
161268
|
-
char = '';
|
|
161269
|
-
}
|
|
161270
|
-
}
|
|
161271
|
-
result += char;
|
|
161272
|
-
}
|
|
161273
|
-
Logger.log('formatHTML', {
|
|
161274
|
-
before: code,
|
|
161275
|
-
after: result
|
|
161276
|
-
});
|
|
161277
|
-
return result;
|
|
161278
|
-
}
|
|
161279
|
-
return {
|
|
161280
|
-
setters: [
|
|
161281
|
-
function (quill_1_1) {
|
|
161282
|
-
quill_1 = quill_1_1;
|
|
161283
|
-
}
|
|
161284
|
-
],
|
|
161285
|
-
execute: function () {
|
|
161286
|
-
debug = false;
|
|
161287
|
-
Logger = {
|
|
161288
|
-
prefixString() {
|
|
161289
|
-
return `</> quill-html-edit-button: `;
|
|
161290
|
-
},
|
|
161291
|
-
get log() {
|
|
161292
|
-
if (!debug) {
|
|
161293
|
-
return () => { };
|
|
161294
|
-
}
|
|
161295
|
-
const boundLogFn = console.log.bind(console, this.prefixString());
|
|
161296
|
-
return boundLogFn;
|
|
161297
|
-
}
|
|
161298
|
-
};
|
|
161299
|
-
QuillHtmlEditPlugin = class QuillHtmlEditPlugin {
|
|
161300
|
-
constructor(quill, options) {
|
|
161301
|
-
debug = options && options.debug;
|
|
161302
|
-
Logger.log('logging enabled');
|
|
161303
|
-
const toolbarModule = quill.getModule('toolbar');
|
|
161304
|
-
if (!toolbarModule) {
|
|
161305
|
-
throw new Error('quill.htmlEditButton requires the "toolbar" module to be included too');
|
|
161306
|
-
}
|
|
161307
|
-
this.registerDivModule();
|
|
161308
|
-
const toolbarEl = toolbarModule.container;
|
|
161309
|
-
const buttonContainer = $create('span');
|
|
161310
|
-
$setAttr(buttonContainer, 'class', 'ql-formats');
|
|
161311
|
-
const button = $create('button');
|
|
161312
|
-
button.innerHTML = options.buttonHTML || '<>';
|
|
161313
|
-
button.title = options.buttonTitle || 'Show HTML source';
|
|
161314
|
-
button.onclick = (e) => {
|
|
161315
|
-
e.preventDefault();
|
|
161316
|
-
launchPopupEditor(quill, options);
|
|
161317
|
-
};
|
|
161318
|
-
buttonContainer.appendChild(button);
|
|
161319
|
-
toolbarEl.appendChild(buttonContainer);
|
|
161320
|
-
}
|
|
161321
|
-
registerDivModule() {
|
|
161322
|
-
const Block = quill_1.default.import('blots/block');
|
|
161323
|
-
class Div extends Block {
|
|
161324
|
-
}
|
|
161325
|
-
Div.tagName = 'div';
|
|
161326
|
-
Div.blotName = 'div';
|
|
161327
|
-
Div.allowedChildren = Block.allowedChildren;
|
|
161328
|
-
Div.allowedChildren.push(Block);
|
|
161329
|
-
quill_1.default.register(Div);
|
|
161330
|
-
}
|
|
161331
|
-
};
|
|
161332
|
-
exports_1("QuillHtmlEditPlugin", QuillHtmlEditPlugin);
|
|
161333
|
-
exports_1("default", QuillHtmlEditPlugin);
|
|
161334
|
-
}
|
|
161335
|
-
};
|
|
161336
|
-
});
|
|
161337
|
-
|
|
161338
|
-
System.register(["reflect-metadata", "lodash", "@angular/core"], function (exports_1, context_1) {
|
|
161339
|
-
var lodash_1, core_1, RootComponent;
|
|
161340
|
-
context_1 && context_1.id;
|
|
161341
|
-
return {
|
|
161342
|
-
setters: [
|
|
161343
|
-
function (_1) {
|
|
161344
|
-
},
|
|
161345
|
-
function (lodash_1_1) {
|
|
161346
|
-
lodash_1 = lodash_1_1;
|
|
161347
|
-
},
|
|
161348
|
-
function (core_1_1) {
|
|
161349
|
-
core_1 = core_1_1;
|
|
161350
|
-
}
|
|
161351
|
-
],
|
|
161352
|
-
execute: function () {
|
|
161353
|
-
RootComponent = class RootComponent {
|
|
161354
|
-
hydrate(elementRef, sanitizer, attrs) {
|
|
161355
|
-
lodash_1.default.forEach(attrs, (attr) => {
|
|
161356
|
-
const metaDataKeys = Reflect.getMetadataKeys(this, attr);
|
|
161357
|
-
if (!lodash_1.default.includes(metaDataKeys, 'design:type')) {
|
|
161358
|
-
return;
|
|
161359
|
-
}
|
|
161360
|
-
const attrKebab = lodash_1.default.kebabCase(attr);
|
|
161361
|
-
const variants = [
|
|
161362
|
-
attrKebab,
|
|
161363
|
-
'data-' + attrKebab
|
|
161364
|
-
];
|
|
161365
|
-
const variant = lodash_1.default.find(variants, (v) => elementRef.nativeElement.hasAttribute(v));
|
|
161366
|
-
if (lodash_1.default.isEmpty(variant)) {
|
|
161367
|
-
return;
|
|
161368
|
-
}
|
|
161369
|
-
const value = sanitizer.sanitize(core_1.SecurityContext.HTML, elementRef.nativeElement.getAttribute(variant));
|
|
161370
|
-
lodash_1.default.set(this, attr, value);
|
|
161371
|
-
});
|
|
161372
|
-
}
|
|
161373
|
-
};
|
|
161374
|
-
exports_1("RootComponent", RootComponent);
|
|
161375
|
-
}
|
|
161376
|
-
};
|
|
161377
|
-
});
|
|
161378
|
-
|
|
161379
|
-
System.register(["@angular/forms", "@angular/core", "froala-editor"], function (exports_1, context_1) {
|
|
161380
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
161381
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
161382
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
161383
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
161384
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
161385
|
-
};
|
|
161386
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
161387
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
161388
|
-
};
|
|
161389
|
-
var FroalaEditorDirective_1, forms_1, core_1, froala_editor_1, FroalaEditorDirective;
|
|
161390
|
-
context_1 && context_1.id;
|
|
161391
|
-
return {
|
|
161392
|
-
setters: [
|
|
161393
|
-
function (forms_1_1) {
|
|
161394
|
-
forms_1 = forms_1_1;
|
|
161395
|
-
},
|
|
161396
|
-
function (core_1_1) {
|
|
161397
|
-
core_1 = core_1_1;
|
|
161398
|
-
},
|
|
161399
|
-
function (froala_editor_1_1) {
|
|
161400
|
-
froala_editor_1 = froala_editor_1_1;
|
|
161401
|
-
}
|
|
161402
|
-
],
|
|
161403
|
-
execute: function () {
|
|
161404
|
-
FroalaEditorDirective = FroalaEditorDirective_1 = class FroalaEditorDirective {
|
|
161405
|
-
constructor(el, zone) {
|
|
161406
|
-
this.zone = zone;
|
|
161407
|
-
this._opts = {
|
|
161408
|
-
immediateAngularModelUpdate: false,
|
|
161409
|
-
angularIgnoreAttrs: null
|
|
161410
|
-
};
|
|
161411
|
-
this.SPECIAL_TAGS = ['img', 'button', 'input', 'a'];
|
|
161412
|
-
this.INNER_HTML_ATTR = 'innerHTML';
|
|
161413
|
-
this._hasSpecialTag = false;
|
|
161414
|
-
this._editorInitialized = false;
|
|
161415
|
-
this._oldModel = null;
|
|
161416
|
-
this.froalaModelChange = new core_1.EventEmitter();
|
|
161417
|
-
this.froalaInit = new core_1.EventEmitter();
|
|
161418
|
-
this.onChange = (_) => {
|
|
161419
|
-
};
|
|
161420
|
-
this.onTouched = () => {
|
|
161421
|
-
};
|
|
161422
|
-
const element = el.nativeElement;
|
|
161423
|
-
if (this.SPECIAL_TAGS.indexOf(element.tagName.toLowerCase()) != -1) {
|
|
161424
|
-
this._hasSpecialTag = true;
|
|
161425
|
-
}
|
|
161426
|
-
this._element = element;
|
|
161427
|
-
this.zone = zone;
|
|
161428
|
-
}
|
|
161429
|
-
set froalaEditor(opts) {
|
|
161430
|
-
this._opts = this.clone(opts || this._opts);
|
|
161431
|
-
this._opts = Object.assign({}, this._opts);
|
|
161432
|
-
}
|
|
161433
|
-
set froalaModel(content) {
|
|
161434
|
-
this.updateEditor(content);
|
|
161435
|
-
}
|
|
161436
|
-
writeValue(content) {
|
|
161437
|
-
this.updateEditor(content);
|
|
161438
|
-
}
|
|
161439
|
-
registerOnChange(fn) {
|
|
161440
|
-
this.onChange = fn;
|
|
161441
|
-
}
|
|
161442
|
-
registerOnTouched(fn) {
|
|
161443
|
-
this.onTouched = fn;
|
|
161444
|
-
}
|
|
161445
|
-
clone(item) {
|
|
161446
|
-
const me = this;
|
|
161447
|
-
if (!item) {
|
|
161448
|
-
return item;
|
|
161449
|
-
}
|
|
161450
|
-
const types = [Number, String, Boolean];
|
|
161451
|
-
let result;
|
|
161452
|
-
types.forEach((type) => {
|
|
161453
|
-
if (item instanceof type) {
|
|
161454
|
-
result = type(item);
|
|
161455
|
-
}
|
|
161456
|
-
});
|
|
161457
|
-
if (typeof result === 'undefined') {
|
|
161458
|
-
if (Object.prototype.toString.call(item) === '[object Array]') {
|
|
161459
|
-
result = [];
|
|
161460
|
-
item.forEach((child, index, array) => {
|
|
161461
|
-
result[index] = me.clone(child);
|
|
161462
|
-
});
|
|
161463
|
-
}
|
|
161464
|
-
else if (typeof item === 'object') {
|
|
161465
|
-
if (item.nodeType && typeof item.cloneNode === 'function') {
|
|
161466
|
-
result = item.cloneNode(true);
|
|
161467
|
-
}
|
|
161468
|
-
else if (!item.prototype) {
|
|
161469
|
-
if (item instanceof Date) {
|
|
161470
|
-
result = new Date(item);
|
|
161471
|
-
}
|
|
161472
|
-
else {
|
|
161473
|
-
result = {};
|
|
161474
|
-
for (const i in item) {
|
|
161475
|
-
result[i] = me.clone(item[i]);
|
|
161476
|
-
}
|
|
161477
|
-
}
|
|
161478
|
-
}
|
|
161479
|
-
else {
|
|
161480
|
-
{
|
|
161481
|
-
result = item;
|
|
161482
|
-
}
|
|
161483
|
-
}
|
|
161484
|
-
}
|
|
161485
|
-
else {
|
|
161486
|
-
result = item;
|
|
161487
|
-
}
|
|
161488
|
-
}
|
|
161489
|
-
return result;
|
|
161490
|
-
}
|
|
161491
|
-
updateEditor(content) {
|
|
161492
|
-
if (JSON.stringify(this._oldModel) === JSON.stringify(content)) {
|
|
161493
|
-
return;
|
|
161494
|
-
}
|
|
161495
|
-
if (!this._hasSpecialTag) {
|
|
161496
|
-
this._oldModel = content;
|
|
161497
|
-
}
|
|
161498
|
-
else {
|
|
161499
|
-
this._model = content;
|
|
161500
|
-
}
|
|
161501
|
-
if (this._editorInitialized) {
|
|
161502
|
-
if (!this._hasSpecialTag) {
|
|
161503
|
-
this._editor.html.set(content);
|
|
161504
|
-
}
|
|
161505
|
-
else {
|
|
161506
|
-
this.setContent();
|
|
161507
|
-
}
|
|
161508
|
-
}
|
|
161509
|
-
else {
|
|
161510
|
-
if (!this._hasSpecialTag) {
|
|
161511
|
-
this._element.innerHTML = content || '';
|
|
161512
|
-
}
|
|
161513
|
-
else {
|
|
161514
|
-
this.setContent();
|
|
161515
|
-
}
|
|
161516
|
-
}
|
|
161517
|
-
}
|
|
161518
|
-
updateModel() {
|
|
161519
|
-
this.zone.run(() => {
|
|
161520
|
-
let modelContent = null;
|
|
161521
|
-
if (this._hasSpecialTag) {
|
|
161522
|
-
const attributeNodes = this._element.attributes;
|
|
161523
|
-
const attrs = {};
|
|
161524
|
-
for (let i = 0; i < attributeNodes.length; i++) {
|
|
161525
|
-
const attrName = attributeNodes[i].name;
|
|
161526
|
-
if (this._opts.angularIgnoreAttrs && this._opts.angularIgnoreAttrs.indexOf(attrName) != -1) {
|
|
161527
|
-
continue;
|
|
161528
|
-
}
|
|
161529
|
-
attrs[attrName] = attributeNodes[i].value;
|
|
161530
|
-
}
|
|
161531
|
-
if (this._element.innerHTML) {
|
|
161532
|
-
attrs[this.INNER_HTML_ATTR] = this._element.innerHTML;
|
|
161533
|
-
}
|
|
161534
|
-
modelContent = attrs;
|
|
161535
|
-
}
|
|
161536
|
-
else {
|
|
161537
|
-
const returnedHtml = this._editor.html.get();
|
|
161538
|
-
if (typeof returnedHtml === 'string') {
|
|
161539
|
-
modelContent = returnedHtml;
|
|
161540
|
-
}
|
|
161541
|
-
}
|
|
161542
|
-
if (this._oldModel !== modelContent) {
|
|
161543
|
-
this._oldModel = modelContent;
|
|
161544
|
-
this.froalaModelChange.emit(modelContent);
|
|
161545
|
-
this.onChange(modelContent);
|
|
161546
|
-
}
|
|
161547
|
-
});
|
|
161548
|
-
}
|
|
161549
|
-
registerEvent(eventName, callback) {
|
|
161550
|
-
if (!eventName || !callback) {
|
|
161551
|
-
return;
|
|
161552
|
-
}
|
|
161553
|
-
if (!this._opts.events) {
|
|
161554
|
-
this._opts.events = {};
|
|
161555
|
-
}
|
|
161556
|
-
this._opts.events[eventName] = callback;
|
|
161557
|
-
}
|
|
161558
|
-
initListeners() {
|
|
161559
|
-
const self = this;
|
|
161560
|
-
if (this._editor.events) {
|
|
161561
|
-
this._editor.events.on('contentChanged', function () {
|
|
161562
|
-
self.updateModel();
|
|
161563
|
-
});
|
|
161564
|
-
this._editor.events.on('mousedown', function () {
|
|
161565
|
-
setTimeout(function () {
|
|
161566
|
-
self.onTouched();
|
|
161567
|
-
}, 0);
|
|
161568
|
-
});
|
|
161569
|
-
if (this._opts.immediateAngularModelUpdate) {
|
|
161570
|
-
this._editor.events.on('keyup', function () {
|
|
161571
|
-
setTimeout(function () {
|
|
161572
|
-
self.updateModel();
|
|
161573
|
-
}, 0);
|
|
161574
|
-
});
|
|
161575
|
-
}
|
|
161576
|
-
}
|
|
161577
|
-
this._editorInitialized = true;
|
|
161578
|
-
}
|
|
161579
|
-
createEditor() {
|
|
161580
|
-
if (this._editorInitialized) {
|
|
161581
|
-
return;
|
|
161582
|
-
}
|
|
161583
|
-
this.setContent(true);
|
|
161584
|
-
this.zone.runOutsideAngular(() => {
|
|
161585
|
-
if (!this._opts.events) {
|
|
161586
|
-
this._opts.events = {};
|
|
161587
|
-
}
|
|
161588
|
-
this.registerEvent('initialized', this._opts.events && this._opts.events.initialized);
|
|
161589
|
-
const existingInitCallback = this._opts.events.initialized;
|
|
161590
|
-
if (!this._opts.events.initialized || !this._opts.events.initialized.overridden) {
|
|
161591
|
-
this._opts.events.initialized = () => {
|
|
161592
|
-
this.initListeners();
|
|
161593
|
-
existingInitCallback && existingInitCallback.call(this._editor, this);
|
|
161594
|
-
};
|
|
161595
|
-
this._opts.events.initialized.overridden = true;
|
|
161596
|
-
}
|
|
161597
|
-
this._editor = new froala_editor_1.default(this._element, this._opts);
|
|
161598
|
-
});
|
|
161599
|
-
}
|
|
161600
|
-
setHtml() {
|
|
161601
|
-
this._editor.html.set(this._model || '');
|
|
161602
|
-
this._editor.undo.reset();
|
|
161603
|
-
this._editor.undo.saveStep();
|
|
161604
|
-
}
|
|
161605
|
-
setContent(firstTime = false) {
|
|
161606
|
-
const self = this;
|
|
161607
|
-
if (this._model || this._model === '') {
|
|
161608
|
-
this._oldModel = this._model;
|
|
161609
|
-
if (this._hasSpecialTag) {
|
|
161610
|
-
const tags = this._model;
|
|
161611
|
-
if (tags) {
|
|
161612
|
-
for (const attr in tags) {
|
|
161613
|
-
if (tags.hasOwnProperty(attr) && attr != this.INNER_HTML_ATTR) {
|
|
161614
|
-
this._element.setAttribute(attr, tags[attr]);
|
|
161615
|
-
}
|
|
161616
|
-
}
|
|
161617
|
-
if (tags.hasOwnProperty(this.INNER_HTML_ATTR)) {
|
|
161618
|
-
this._element.innerHTML = tags[this.INNER_HTML_ATTR];
|
|
161619
|
-
}
|
|
161620
|
-
}
|
|
161621
|
-
}
|
|
161622
|
-
else {
|
|
161623
|
-
if (firstTime) {
|
|
161624
|
-
this.registerEvent('initialized', function () {
|
|
161625
|
-
self.setHtml();
|
|
161626
|
-
});
|
|
161627
|
-
}
|
|
161628
|
-
else {
|
|
161629
|
-
self.setHtml();
|
|
161630
|
-
}
|
|
161631
|
-
}
|
|
161632
|
-
}
|
|
161633
|
-
}
|
|
161634
|
-
destroyEditor() {
|
|
161635
|
-
if (this._editorInitialized) {
|
|
161636
|
-
this._editor.destroy();
|
|
161637
|
-
this._editorInitialized = false;
|
|
161638
|
-
}
|
|
161639
|
-
}
|
|
161640
|
-
getEditor() {
|
|
161641
|
-
if (this._element) {
|
|
161642
|
-
return this._editor;
|
|
161643
|
-
}
|
|
161644
|
-
return null;
|
|
161645
|
-
}
|
|
161646
|
-
generateManualController() {
|
|
161647
|
-
const controls = {
|
|
161648
|
-
initialize: this.createEditor.bind(this),
|
|
161649
|
-
destroy: this.destroyEditor.bind(this),
|
|
161650
|
-
getEditor: this.getEditor.bind(this),
|
|
161651
|
-
};
|
|
161652
|
-
this.froalaInit.emit(controls);
|
|
161653
|
-
}
|
|
161654
|
-
ngAfterViewInit() {
|
|
161655
|
-
if (!this.froalaInit.observers.length) {
|
|
161656
|
-
this.createEditor();
|
|
161657
|
-
}
|
|
161658
|
-
else {
|
|
161659
|
-
this.generateManualController();
|
|
161660
|
-
}
|
|
161661
|
-
}
|
|
161662
|
-
ngOnDestroy() {
|
|
161663
|
-
this.destroyEditor();
|
|
161664
|
-
}
|
|
161665
|
-
};
|
|
161666
|
-
__decorate([
|
|
161667
|
-
core_1.Input(),
|
|
161668
|
-
__metadata("design:type", Object),
|
|
161669
|
-
__metadata("design:paramtypes", [Object])
|
|
161670
|
-
], FroalaEditorDirective.prototype, "froalaEditor", null);
|
|
161671
|
-
__decorate([
|
|
161672
|
-
core_1.Input(),
|
|
161673
|
-
__metadata("design:type", Object),
|
|
161674
|
-
__metadata("design:paramtypes", [Object])
|
|
161675
|
-
], FroalaEditorDirective.prototype, "froalaModel", null);
|
|
161676
|
-
__decorate([
|
|
161677
|
-
core_1.Output(),
|
|
161678
|
-
__metadata("design:type", core_1.EventEmitter)
|
|
161679
|
-
], FroalaEditorDirective.prototype, "froalaModelChange", void 0);
|
|
161680
|
-
__decorate([
|
|
161681
|
-
core_1.Output(),
|
|
161682
|
-
__metadata("design:type", core_1.EventEmitter)
|
|
161683
|
-
], FroalaEditorDirective.prototype, "froalaInit", void 0);
|
|
161684
|
-
FroalaEditorDirective = FroalaEditorDirective_1 = __decorate([
|
|
161685
|
-
core_1.Directive({
|
|
161686
|
-
selector: '[froalaEditor]',
|
|
161687
|
-
exportAs: 'froalaEditor',
|
|
161688
|
-
providers: [
|
|
161689
|
-
{
|
|
161690
|
-
provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(() => FroalaEditorDirective_1),
|
|
161691
|
-
multi: true
|
|
161692
|
-
}
|
|
161693
|
-
]
|
|
161694
|
-
}),
|
|
161695
|
-
__metadata("design:paramtypes", [core_1.ElementRef, core_1.NgZone])
|
|
161696
|
-
], FroalaEditorDirective);
|
|
161697
|
-
exports_1("FroalaEditorDirective", FroalaEditorDirective);
|
|
161698
|
-
}
|
|
161699
|
-
};
|
|
161700
|
-
});
|
|
161701
|
-
|
|
161702
|
-
System.register(["@angular/core", "@stratusjs/angular/froala/editor/froala-editor.directive"], function (exports_1, context_1) {
|
|
161703
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
161704
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
161705
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
161706
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
161707
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
161708
|
-
};
|
|
161709
|
-
var FroalaEditorModule_1, core_1, froala_editor_directive_1, FroalaEditorModule;
|
|
161710
|
-
context_1 && context_1.id;
|
|
161711
|
-
return {
|
|
161712
|
-
setters: [
|
|
161713
|
-
function (core_1_1) {
|
|
161714
|
-
core_1 = core_1_1;
|
|
161715
|
-
},
|
|
161716
|
-
function (froala_editor_directive_1_1) {
|
|
161717
|
-
froala_editor_directive_1 = froala_editor_directive_1_1;
|
|
161718
|
-
}
|
|
161719
|
-
],
|
|
161720
|
-
execute: function () {
|
|
161721
|
-
FroalaEditorModule = FroalaEditorModule_1 = class FroalaEditorModule {
|
|
161722
|
-
static forRoot() {
|
|
161723
|
-
return { ngModule: FroalaEditorModule_1, providers: [] };
|
|
161724
|
-
}
|
|
161725
|
-
};
|
|
161726
|
-
FroalaEditorModule = FroalaEditorModule_1 = __decorate([
|
|
161727
|
-
core_1.NgModule({
|
|
161728
|
-
declarations: [froala_editor_directive_1.FroalaEditorDirective],
|
|
161729
|
-
exports: [froala_editor_directive_1.FroalaEditorDirective]
|
|
161730
|
-
})
|
|
161731
|
-
], FroalaEditorModule);
|
|
161732
|
-
exports_1("FroalaEditorModule", FroalaEditorModule);
|
|
161733
|
-
}
|
|
161734
|
-
};
|
|
161735
|
-
});
|
|
161736
|
-
|
|
161737
|
-
System.register(["@stratusjs/angular/froala/editor/froala-editor.directive", "@stratusjs/angular/froala/editor/froala-editor.module"], function (exports_1, context_1) {
|
|
161738
|
-
context_1 && context_1.id;
|
|
161739
|
-
return {
|
|
161740
|
-
setters: [
|
|
161741
|
-
function (froala_editor_directive_1_1) {
|
|
161742
|
-
exports_1({
|
|
161743
|
-
"FroalaEditorDirective": froala_editor_directive_1_1["FroalaEditorDirective"]
|
|
161744
|
-
});
|
|
161745
|
-
},
|
|
161746
|
-
function (froala_editor_module_1_1) {
|
|
161747
|
-
exports_1({
|
|
161748
|
-
"FroalaEditorModule": froala_editor_module_1_1["FroalaEditorModule"]
|
|
161749
|
-
});
|
|
161750
|
-
}
|
|
161751
|
-
],
|
|
161752
|
-
execute: function () {
|
|
161753
|
-
}
|
|
161754
|
-
};
|
|
161755
|
-
});
|
|
161756
|
-
|
|
161757
|
-
/*!
|
|
161758
|
-
* froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
|
|
161759
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
|
161760
|
-
* Copyright 2014-2020 Froala Labs
|
|
161761
|
-
*/
|
|
161762
|
-
System.register(["froala-editor"], function (exports_1, context_1) {
|
|
161763
|
-
var froala_editor_1;
|
|
161764
|
-
context_1 && context_1.id;
|
|
161765
|
-
return {
|
|
161766
|
-
setters: [
|
|
161767
|
-
function (froala_editor_1_1) {
|
|
161768
|
-
froala_editor_1 = froala_editor_1_1;
|
|
161769
|
-
}
|
|
161770
|
-
],
|
|
161771
|
-
execute: function () {
|
|
161772
|
-
/*!
|
|
161773
|
-
* froala_editor v3.2.3 (https://www.froala.com/wysiwyg-editor)
|
|
161774
|
-
* License https://froala.com/wysiwyg-editor/terms/
|
|
161775
|
-
* Copyright 2014-2020 Froala Labs
|
|
161776
|
-
*/
|
|
161777
|
-
if (((froala_editor_1.default && froala_editor_1.default.hasOwnProperty('default') ? froala_editor_1.default.default : froala_editor_1.default),
|
|
161778
|
-
Object.assign(froala_editor_1.default.DEFAULTS, {
|
|
161779
|
-
imageManagerLoadURL: 'https://i.froala.com/load-files',
|
|
161780
|
-
imageManagerLoadMethod: 'get',
|
|
161781
|
-
imageManagerLoadParams: {},
|
|
161782
|
-
imageManagerPreloader: null,
|
|
161783
|
-
imageManagerDeleteURL: '',
|
|
161784
|
-
imageManagerDeleteMethod: 'post',
|
|
161785
|
-
imageManagerDeleteParams: {},
|
|
161786
|
-
imageManagerPageSize: 12,
|
|
161787
|
-
imageManagerScrollOffset: 20,
|
|
161788
|
-
imageManagerToggleTags: !0,
|
|
161789
|
-
}),
|
|
161790
|
-
(froala_editor_1.default.PLUGINS.imageManagerCustom = (s) => {
|
|
161791
|
-
let g, l, i, o, d, m, c, f, u, p, h, v = s.$, M = 'image_manager', e = 10, b = 11, w = 12, C = 13, L = 14, D = 15, t = 21, r = 22, n = {};
|
|
161792
|
-
function y() {
|
|
161793
|
-
let e = v(window).outerWidth();
|
|
161794
|
-
return e < 768 ? 2 : e < 1200 ? 3 : 4;
|
|
161795
|
-
}
|
|
161796
|
-
function I() {
|
|
161797
|
-
d.empty();
|
|
161798
|
-
for (let e = 0; e < h; e++) {
|
|
161799
|
-
d.append('<div class="fr-list-column"></div>');
|
|
161800
|
-
}
|
|
161801
|
-
}
|
|
161802
|
-
function P() {
|
|
161803
|
-
if (u < c.length
|
|
161804
|
-
&& (d.outerHeight() <= i.outerHeight() + s.opts.imageManagerScrollOffset
|
|
161805
|
-
|| i.scrollTop() + s.opts.imageManagerScrollOffset > d.outerHeight() - i.outerHeight())) {
|
|
161806
|
-
f++;
|
|
161807
|
-
for (let e = s.opts.imageManagerPageSize * (f - 1); e < Math.min(c.length, s.opts.imageManagerPageSize * f); e++) {
|
|
161808
|
-
a(c[e]);
|
|
161809
|
-
}
|
|
161810
|
-
}
|
|
161811
|
-
}
|
|
161812
|
-
function a(n) {
|
|
161813
|
-
let i = new Image(), o = v(document.createElement('div'))
|
|
161814
|
-
.attr('class', 'fr-image-container fr-empty fr-image-' + p++)
|
|
161815
|
-
.attr('data-loading', s.language.translate('Loading') + '..')
|
|
161816
|
-
.attr('data-deleting', s.language.translate('Deleting') + '..');
|
|
161817
|
-
R(!1),
|
|
161818
|
-
(i.onload = function () {
|
|
161819
|
-
o.height(Math.floor((o.width() / i.width) * i.height));
|
|
161820
|
-
let t = v(document.createElement('img'));
|
|
161821
|
-
if (n.thumb) {
|
|
161822
|
-
t.attr('src', n.thumb);
|
|
161823
|
-
}
|
|
161824
|
-
else {
|
|
161825
|
-
if ((O(L, n), !n.url)) {
|
|
161826
|
-
return O(D, n), !1;
|
|
161827
|
-
}
|
|
161828
|
-
t.attr('src', n.url);
|
|
161829
|
-
}
|
|
161830
|
-
if ((n.url && t.attr('data-url', n.url), n.tag)) {
|
|
161831
|
-
if ((l.find('.fr-modal-more.fr-not-available').removeClass('fr-not-available'), l.find('.fr-modal-tags').show(), 0 <= n.tag.indexOf(','))) {
|
|
161832
|
-
for (let e = n.tag.split(','), a = 0; a < e.length; a++) {
|
|
161833
|
-
(e[a] =
|
|
161834
|
-
e[a].trim()), 0 === m.find('a[title="'.concat(e[a], '"]')).length && m.append('<a role="button" title="'.concat(e[a], '">').concat(e[a], '</a>'));
|
|
161835
|
-
}
|
|
161836
|
-
t.attr('data-tag', e.join());
|
|
161837
|
-
}
|
|
161838
|
-
else {
|
|
161839
|
-
0 === m.find('a[title="'.concat(n.tag.trim(), '"]')).length && m.append('<a role="button" title="'.concat(n.tag.trim(), '">').concat(n.tag.trim(), '</a>')), t.attr('data-tag', n.tag.trim());
|
|
161840
|
-
}
|
|
161841
|
-
}
|
|
161842
|
-
for (let r in (n.name && t.attr('alt', n.name), n)) {
|
|
161843
|
-
n.hasOwnProperty(r) && 'thumb' !== r && 'url' !== r && 'tag' !== r && t.attr('data-'.concat(r), n[r]);
|
|
161844
|
-
}
|
|
161845
|
-
o
|
|
161846
|
-
.append(t)
|
|
161847
|
-
.append(v(s.icon.create('imageManagerDelete')).addClass('fr-delete-img').attr('title', s.language.translate('Delete')))
|
|
161848
|
-
.append(v(s.icon.create('imageManagerInsert')).addClass('fr-insert-img').attr('title', s.language.translate('Insert'))),
|
|
161849
|
-
m.find('.fr-selected-tag').each(function (e, a) {
|
|
161850
|
-
j(t, a.text) || o.hide();
|
|
161851
|
-
}),
|
|
161852
|
-
t.on('load', function () {
|
|
161853
|
-
o.removeClass('fr-empty'),
|
|
161854
|
-
o.height('auto'),
|
|
161855
|
-
u++,
|
|
161856
|
-
E(T(parseInt(t
|
|
161857
|
-
.parent()
|
|
161858
|
-
.attr('class')
|
|
161859
|
-
.match(/fr-image-(\d+)/)[1], 10) + 1)),
|
|
161860
|
-
R(!1),
|
|
161861
|
-
u % s.opts.imageManagerPageSize === 0 && P();
|
|
161862
|
-
}),
|
|
161863
|
-
s.events.trigger('imageManager.imageLoaded', [t]);
|
|
161864
|
-
}),
|
|
161865
|
-
(i.onerror = () => {
|
|
161866
|
-
u++,
|
|
161867
|
-
o.remove(),
|
|
161868
|
-
E(T(parseInt(o.attr('class').match(/fr-image-(\d+)/)[1], 10) + 1)),
|
|
161869
|
-
O(e, n),
|
|
161870
|
-
u % s.opts.imageManagerPageSize === 0 && P();
|
|
161871
|
-
}),
|
|
161872
|
-
(i.src = n.thumb || n.url),
|
|
161873
|
-
S().append(o);
|
|
161874
|
-
}
|
|
161875
|
-
function S() {
|
|
161876
|
-
let r, n;
|
|
161877
|
-
return (d.find('.fr-list-column').each((e, a) => {
|
|
161878
|
-
let t = v(a);
|
|
161879
|
-
0 === e ? ((n = t.outerHeight()), (r = t)) : t.outerHeight() < n && ((n = t.outerHeight()), (r = t));
|
|
161880
|
-
}),
|
|
161881
|
-
r);
|
|
161882
|
-
}
|
|
161883
|
-
function T(e) {
|
|
161884
|
-
e === undefined && (e = 0);
|
|
161885
|
-
for (let a = [], t = p - 1; e <= t; t--) {
|
|
161886
|
-
let r = d.find('.fr-image-'.concat(t));
|
|
161887
|
-
r.length && (a.push(r), v(document.createElement('div')).attr('id', 'fr-image-hidden-container').append(r), d.find('.fr-image-'.concat(t)).remove());
|
|
161888
|
-
}
|
|
161889
|
-
return a;
|
|
161890
|
-
}
|
|
161891
|
-
function E(e) {
|
|
161892
|
-
for (let a = e.length - 1; 0 <= a; a--) {
|
|
161893
|
-
S().append(e[a]);
|
|
161894
|
-
}
|
|
161895
|
-
}
|
|
161896
|
-
function R(e) {
|
|
161897
|
-
if ((e === undefined && (e = !0), !g.isVisible())) {
|
|
161898
|
-
return !0;
|
|
161899
|
-
}
|
|
161900
|
-
let a = y();
|
|
161901
|
-
if (a !== h) {
|
|
161902
|
-
h = a;
|
|
161903
|
-
let t = T();
|
|
161904
|
-
I(), E(t);
|
|
161905
|
-
}
|
|
161906
|
-
s.modals.resize(M), e && P();
|
|
161907
|
-
}
|
|
161908
|
-
function U(e) {
|
|
161909
|
-
for (let a, t = e[0].attributes, r = t.length, n = {}; r--;) {
|
|
161910
|
-
t[r] && 'src' !== (a = t[r].name) && (n[a] = t[r].value);
|
|
161911
|
-
}
|
|
161912
|
-
return n;
|
|
161913
|
-
}
|
|
161914
|
-
function x(e) {
|
|
161915
|
-
let a = v(e.currentTarget).siblings('img'), t = g.data('instance') || s, r = g.data('current-image');
|
|
161916
|
-
if ((s.modals.hide(M), t.image.showProgressBar(), r)) {
|
|
161917
|
-
r.data('fr-old-src', r.attr('src')), r.trigger('click');
|
|
161918
|
-
}
|
|
161919
|
-
else {
|
|
161920
|
-
t.events.focus(!0), t.selection.restore();
|
|
161921
|
-
let n = t.position.getBoundingRect(), i = n.left + n.width / 2 + v(s.doc).scrollLeft(), o = n.top + n.height + v(s.doc).scrollTop();
|
|
161922
|
-
t.popups.setContainer('image.insert', s.$sc), t.popups.show('image.insert', i, o);
|
|
161923
|
-
}
|
|
161924
|
-
t.image.insert(a.data('url'), !1, U(a), r);
|
|
161925
|
-
}
|
|
161926
|
-
function H(e) {
|
|
161927
|
-
let i = v(e.currentTarget).siblings('img'), a = s.language.translate('Are you sure? Image will be deleted.');
|
|
161928
|
-
confirm(a) &&
|
|
161929
|
-
(s.opts.imageManagerDeleteURL
|
|
161930
|
-
? !1 !== s.events.trigger('imageManager.beforeDeleteImage', [i]) &&
|
|
161931
|
-
(i.parent().addClass('fr-image-deleting'),
|
|
161932
|
-
v(this).ajax({
|
|
161933
|
-
method: s.opts.imageManagerDeleteMethod,
|
|
161934
|
-
url: s.opts.imageManagerDeleteURL,
|
|
161935
|
-
data: Object.assign(Object.assign({ src: i.attr('src') }, U(i)), s.opts.imageManagerDeleteParams),
|
|
161936
|
-
crossDomain: s.opts.requestWithCORS,
|
|
161937
|
-
withCredentials: s.opts.requestWithCredentials,
|
|
161938
|
-
headers: s.opts.requestHeaders,
|
|
161939
|
-
done(e, a, t) {
|
|
161940
|
-
s.events.trigger('imageManager.imageDeleted', [e]);
|
|
161941
|
-
let r = T(parseInt(i
|
|
161942
|
-
.parent()
|
|
161943
|
-
.attr('class')
|
|
161944
|
-
.match(/fr-image-(\d+)/)[1], 10) + 1);
|
|
161945
|
-
i.parent().remove(),
|
|
161946
|
-
E(r),
|
|
161947
|
-
(function n() {
|
|
161948
|
-
g.find('#fr-modal-tags > a').each(function () {
|
|
161949
|
-
0 === g.find('#fr-image-list [data-tag*="'.concat(v(this).text(), '"]')).length && v(this).removeClass('fr-selected-tag').hide();
|
|
161950
|
-
}),
|
|
161951
|
-
_();
|
|
161952
|
-
})(),
|
|
161953
|
-
R(!0);
|
|
161954
|
-
},
|
|
161955
|
-
fail(e) {
|
|
161956
|
-
O(t, e.response || e.responseText);
|
|
161957
|
-
},
|
|
161958
|
-
}))
|
|
161959
|
-
: O(r));
|
|
161960
|
-
}
|
|
161961
|
-
function O(e, a) {
|
|
161962
|
-
10 <= e && e < 20
|
|
161963
|
-
? o.hide()
|
|
161964
|
-
: 20 <= e && e < 30 && v('.fr-image-deleting').removeClass('fr-image-deleting'), s.events.trigger('imageManager.error', [
|
|
161965
|
-
{ code: e, message: n[e] },
|
|
161966
|
-
a
|
|
161967
|
-
]);
|
|
161968
|
-
}
|
|
161969
|
-
function q() {
|
|
161970
|
-
let e = l.find('.fr-modal-head-line').outerHeight(), a = m.outerHeight();
|
|
161971
|
-
l.toggleClass('fr-show-tags'), l.hasClass('fr-show-tags')
|
|
161972
|
-
? (l.css('height', e + a), i.css('marginTop', e + a), m.find('a').css('opacity', 1))
|
|
161973
|
-
: (l.css('height', e), i.css('marginTop', e), m.find('a').css('opacity', 0));
|
|
161974
|
-
}
|
|
161975
|
-
function _() {
|
|
161976
|
-
let e = m.find('.fr-selected-tag');
|
|
161977
|
-
0 < e.length
|
|
161978
|
-
? (d.find('img').parents().show(),
|
|
161979
|
-
e.each((e, r) => {
|
|
161980
|
-
d.find('img').each(function (e, a) {
|
|
161981
|
-
let t = v(a);
|
|
161982
|
-
j(t, r.text) || t.parent().hide();
|
|
161983
|
-
});
|
|
161984
|
-
}))
|
|
161985
|
-
: d.find('img').parents().show(),
|
|
161986
|
-
E(T()),
|
|
161987
|
-
P();
|
|
161988
|
-
}
|
|
161989
|
-
function k(e) {
|
|
161990
|
-
e.preventDefault();
|
|
161991
|
-
let a = v(e.currentTarget);
|
|
161992
|
-
a.toggleClass('fr-selected-tag'), s.opts.imageManagerToggleTags && a.siblings('a').removeClass('fr-selected-tag'), _();
|
|
161993
|
-
}
|
|
161994
|
-
function j(e, a) {
|
|
161995
|
-
for (let t = (e.attr('data-tag') || '').split(','), r = 0; r < t.length; r++) {
|
|
161996
|
-
if (t[r] === a) {
|
|
161997
|
-
return !0;
|
|
161998
|
-
}
|
|
161999
|
-
}
|
|
162000
|
-
return !1;
|
|
162001
|
-
}
|
|
162002
|
-
return ((n[e] = 'Image cannot be loaded from the passed link.'),
|
|
162003
|
-
(n[b] = 'Error during load images request.'),
|
|
162004
|
-
(n[w] = 'Missing imageManagerLoadURL option.'),
|
|
162005
|
-
(n[C] = 'Parsing load response failed.'),
|
|
162006
|
-
(n[L] = 'Missing image thumb.'),
|
|
162007
|
-
(n[D] = 'Missing image URL.'),
|
|
162008
|
-
(n[t] = 'Error during delete image request.'),
|
|
162009
|
-
(n[r] = 'Missing imageManagerDeleteURL option.'),
|
|
162010
|
-
{
|
|
162011
|
-
require: ['image'],
|
|
162012
|
-
_init: function z() {
|
|
162013
|
-
if (!s.$wp && 'IMG' !== s.el.tagName) {
|
|
162014
|
-
return !1;
|
|
162015
|
-
}
|
|
162016
|
-
},
|
|
162017
|
-
show: function G() {
|
|
162018
|
-
if (!g) {
|
|
162019
|
-
let e, a = '<button class="fr-command fr-btn fr-modal-more fr-not-available" id="fr-modal-more-'
|
|
162020
|
-
.concat(s.sid, '"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24""><path d="')
|
|
162021
|
-
.concat(froala_editor_1.default.SVG.tags, '"/></svg></button><h4 data-text="true">')
|
|
162022
|
-
.concat(s.language.translate('Manage Images'), '</h4></div>\n <div class="fr-modal-tags" id="fr-modal-tags">');
|
|
162023
|
-
(e = s.opts.imageManagerPreloader
|
|
162024
|
-
? '<img class="fr-preloader" id="fr-preloader" alt="'.concat(s.language.translate('Loading'), '.." src="').concat(s.opts.imageManagerPreloader, '" style="display: none;">')
|
|
162025
|
-
: '<span class="fr-preloader" id="fr-preloader" style="display: none;">'.concat(s.language.translate('Loading'), '</span>')),
|
|
162026
|
-
(e += '<div class="fr-image-list" id="fr-image-list"></div>');
|
|
162027
|
-
let t = s.modals.create(M, a, e);
|
|
162028
|
-
(g = t.$modal), (l = t.$head), (i = t.$body);
|
|
162029
|
-
}
|
|
162030
|
-
g.data('current-image', s.image.get()),
|
|
162031
|
-
s.modals.show(M),
|
|
162032
|
-
o ||
|
|
162033
|
-
(function r() {
|
|
162034
|
-
(o = g.find('#fr-preloader')),
|
|
162035
|
-
(d = g.find('#fr-image-list')),
|
|
162036
|
-
(m = g.find('#fr-modal-tags')),
|
|
162037
|
-
(h = y()),
|
|
162038
|
-
I(),
|
|
162039
|
-
l.css('height', l.find('.fr-modal-head-line').outerHeight()),
|
|
162040
|
-
s.events.$on(v(s.o_win), 'resize', () => {
|
|
162041
|
-
R(!!c);
|
|
162042
|
-
}),
|
|
162043
|
-
s.events.bindClick(d, '.fr-insert-img', x),
|
|
162044
|
-
s.events.bindClick(d, '.fr-delete-img', H),
|
|
162045
|
-
s.helpers.isMobile() &&
|
|
162046
|
-
(s.events.bindClick(d, 'div.fr-image-container', (e) => {
|
|
162047
|
-
g.find('.fr-mobile-selected').removeClass('fr-mobile-selected'),
|
|
162048
|
-
v(e.currentTarget).addClass('fr-mobile-selected');
|
|
162049
|
-
}),
|
|
162050
|
-
g.on(s._mousedown, () => {
|
|
162051
|
-
g.find('.fr-mobile-selected').removeClass('fr-mobile-selected');
|
|
162052
|
-
})),
|
|
162053
|
-
g.on(s._mousedown + ' ' + s._mouseup, (e) => {
|
|
162054
|
-
e.stopPropagation();
|
|
162055
|
-
}),
|
|
162056
|
-
g.on(s._mousedown, '*', () => {
|
|
162057
|
-
s.events.disableBlur();
|
|
162058
|
-
}),
|
|
162059
|
-
i.on('scroll', P),
|
|
162060
|
-
s.events.bindClick(g, 'button#fr-modal-more-'.concat(s.sid), q),
|
|
162061
|
-
s.events.bindClick(m, 'a', k);
|
|
162062
|
-
})(),
|
|
162063
|
-
(function n() {
|
|
162064
|
-
o.show(),
|
|
162065
|
-
d.find('.fr-list-column').empty(),
|
|
162066
|
-
s.opts.imageManagerLoadURL
|
|
162067
|
-
? v(this).ajax({
|
|
162068
|
-
url: s.opts.imageManagerLoadURL,
|
|
162069
|
-
method: s.opts.imageManagerLoadMethod,
|
|
162070
|
-
data: s.opts.imageManagerLoadParams,
|
|
162071
|
-
crossDomain: s.opts.requestWithCORS,
|
|
162072
|
-
withCredentials: s.opts.requestWithCredentials,
|
|
162073
|
-
headers: s.opts.requestHeaders,
|
|
162074
|
-
done(e, a, t) {
|
|
162075
|
-
s.events.trigger('imageManager.imagesLoaded', [e]),
|
|
162076
|
-
(function r(e, a) {
|
|
162077
|
-
try {
|
|
162078
|
-
d.find('.fr-list-column').empty(), (p = u = f = 0), (c = JSON.parse(e)), P();
|
|
162079
|
-
}
|
|
162080
|
-
catch (t) {
|
|
162081
|
-
O(C, a);
|
|
162082
|
-
}
|
|
162083
|
-
})(e, t.response),
|
|
162084
|
-
o.hide();
|
|
162085
|
-
},
|
|
162086
|
-
fail(e) {
|
|
162087
|
-
O(b, e.response || e.responseText);
|
|
162088
|
-
},
|
|
162089
|
-
})
|
|
162090
|
-
: O(w);
|
|
162091
|
-
})();
|
|
162092
|
-
},
|
|
162093
|
-
hide: function N() {
|
|
162094
|
-
s.modals.hide(M);
|
|
162095
|
-
},
|
|
162096
|
-
});
|
|
162097
|
-
}),
|
|
162098
|
-
!froala_editor_1.default.PLUGINS.image)) {
|
|
162099
|
-
throw new Error('Image manager plugin requires image plugin.');
|
|
162100
|
-
}
|
|
162101
|
-
froala_editor_1.default.DEFAULTS.imageInsertButtons.push('imageManagerCustom'),
|
|
162102
|
-
froala_editor_1.default.RegisterCommand('imageManagerCustom', {
|
|
162103
|
-
title: 'Browse',
|
|
162104
|
-
undo: !1,
|
|
162105
|
-
focus: !1,
|
|
162106
|
-
modal: !0,
|
|
162107
|
-
callback() {
|
|
162108
|
-
this.imageManagerCustom.show();
|
|
162109
|
-
},
|
|
162110
|
-
plugin: 'imageManagerCustom',
|
|
162111
|
-
}),
|
|
162112
|
-
froala_editor_1.default.DefineIcon('imageManagerCustom', { NAME: 'folder', SVG_KEY: 'imageManager' }),
|
|
162113
|
-
froala_editor_1.default.DefineIcon('imageManagerCustomInsert', { NAME: 'plus', SVG_KEY: 'add' }),
|
|
162114
|
-
froala_editor_1.default.DefineIcon('imageManagerCustomDelete', { NAME: 'trash', SVG_KEY: 'remove' });
|
|
162115
|
-
}
|
|
162116
|
-
};
|
|
162117
|
-
});
|
|
162118
|
-
|
|
162119
161379
|
FroalaEditor.DEFAULTS = Object.assign(FroalaEditor.DEFAULTS, {});
|
|
162120
161380
|
FroalaEditor.PLUGINS.menuButton = function menuButton(editor) {
|
|
162121
161381
|
let inputButton;
|
|
@@ -162180,108 +161440,6 @@ System.register(['@stratusjs/runtime/stratus', 'lodash', '@stratusjs/core/enviro
|
|
|
162180
161440
|
undo: true
|
|
162181
161441
|
});
|
|
162182
161442
|
|
|
162183
|
-
System.register(["@angular/core"], function (exports_1, context_1) {
|
|
162184
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
162185
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
162186
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
162187
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
162188
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
162189
|
-
};
|
|
162190
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
162191
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
162192
|
-
};
|
|
162193
|
-
var core_1, FroalaViewDirective;
|
|
162194
|
-
context_1 && context_1.id;
|
|
162195
|
-
return {
|
|
162196
|
-
setters: [
|
|
162197
|
-
function (core_1_1) {
|
|
162198
|
-
core_1 = core_1_1;
|
|
162199
|
-
}
|
|
162200
|
-
],
|
|
162201
|
-
execute: function () {
|
|
162202
|
-
FroalaViewDirective = class FroalaViewDirective {
|
|
162203
|
-
constructor(renderer, element) {
|
|
162204
|
-
this.renderer = renderer;
|
|
162205
|
-
this._element = element.nativeElement;
|
|
162206
|
-
}
|
|
162207
|
-
set froalaView(content) {
|
|
162208
|
-
this._element.innerHTML = content;
|
|
162209
|
-
}
|
|
162210
|
-
ngAfterViewInit() {
|
|
162211
|
-
this.renderer.addClass(this._element, 'fr-view');
|
|
162212
|
-
}
|
|
162213
|
-
};
|
|
162214
|
-
__decorate([
|
|
162215
|
-
core_1.Input(),
|
|
162216
|
-
__metadata("design:type", String),
|
|
162217
|
-
__metadata("design:paramtypes", [String])
|
|
162218
|
-
], FroalaViewDirective.prototype, "froalaView", null);
|
|
162219
|
-
FroalaViewDirective = __decorate([
|
|
162220
|
-
core_1.Directive({
|
|
162221
|
-
selector: '[froalaView]'
|
|
162222
|
-
}),
|
|
162223
|
-
__metadata("design:paramtypes", [core_1.Renderer2, core_1.ElementRef])
|
|
162224
|
-
], FroalaViewDirective);
|
|
162225
|
-
exports_1("FroalaViewDirective", FroalaViewDirective);
|
|
162226
|
-
}
|
|
162227
|
-
};
|
|
162228
|
-
});
|
|
162229
|
-
|
|
162230
|
-
System.register(["@angular/core", "@stratusjs/angular/froala/view/froala-view.directive"], function (exports_1, context_1) {
|
|
162231
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
162232
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
162233
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
162234
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
162235
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
162236
|
-
};
|
|
162237
|
-
var FroalaViewModule_1, core_1, froala_view_directive_1, FroalaViewModule;
|
|
162238
|
-
context_1 && context_1.id;
|
|
162239
|
-
return {
|
|
162240
|
-
setters: [
|
|
162241
|
-
function (core_1_1) {
|
|
162242
|
-
core_1 = core_1_1;
|
|
162243
|
-
},
|
|
162244
|
-
function (froala_view_directive_1_1) {
|
|
162245
|
-
froala_view_directive_1 = froala_view_directive_1_1;
|
|
162246
|
-
}
|
|
162247
|
-
],
|
|
162248
|
-
execute: function () {
|
|
162249
|
-
FroalaViewModule = FroalaViewModule_1 = class FroalaViewModule {
|
|
162250
|
-
static forRoot() {
|
|
162251
|
-
return { ngModule: FroalaViewModule_1, providers: [] };
|
|
162252
|
-
}
|
|
162253
|
-
};
|
|
162254
|
-
FroalaViewModule = FroalaViewModule_1 = __decorate([
|
|
162255
|
-
core_1.NgModule({
|
|
162256
|
-
declarations: [froala_view_directive_1.FroalaViewDirective],
|
|
162257
|
-
exports: [froala_view_directive_1.FroalaViewDirective]
|
|
162258
|
-
})
|
|
162259
|
-
], FroalaViewModule);
|
|
162260
|
-
exports_1("FroalaViewModule", FroalaViewModule);
|
|
162261
|
-
}
|
|
162262
|
-
};
|
|
162263
|
-
});
|
|
162264
|
-
|
|
162265
|
-
System.register(["@stratusjs/angular/froala/view/froala-view.directive", "@stratusjs/angular/froala/view/froala-view.module"], function (exports_1, context_1) {
|
|
162266
|
-
context_1 && context_1.id;
|
|
162267
|
-
return {
|
|
162268
|
-
setters: [
|
|
162269
|
-
function (froala_view_directive_1_1) {
|
|
162270
|
-
exports_1({
|
|
162271
|
-
"FroalaViewDirective": froala_view_directive_1_1["FroalaViewDirective"]
|
|
162272
|
-
});
|
|
162273
|
-
},
|
|
162274
|
-
function (froala_view_module_1_1) {
|
|
162275
|
-
exports_1({
|
|
162276
|
-
"FroalaViewModule": froala_view_module_1_1["FroalaViewModule"]
|
|
162277
|
-
});
|
|
162278
|
-
}
|
|
162279
|
-
],
|
|
162280
|
-
execute: function () {
|
|
162281
|
-
}
|
|
162282
|
-
};
|
|
162283
|
-
});
|
|
162284
|
-
|
|
162285
161443
|
})
|
|
162286
161444
|
};
|
|
162287
161445
|
}));
|