@wizishop/wizi-block 4.2.32-beta → 4.2.35-beta
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/bundles/wizishop-wizi-block.umd.js +320 -364
- package/bundles/wizishop-wizi-block.umd.js.map +1 -1
- package/bundles/wizishop-wizi-block.umd.min.js +1 -1
- package/bundles/wizishop-wizi-block.umd.min.js.map +1 -1
- package/esm2015/lib/services/blocks/images/images-banner.service.js +2 -2
- package/esm2015/lib/services/blocks/images/images-simple.service.js +2 -2
- package/esm2015/lib/services/blocks/text-backgrounds/text-backgrounds-simple.service.js +2 -2
- package/esm2015/lib/services/blocks/text-backgrounds/text-backgrounds-with-banner.service.js +2 -2
- package/esm2015/lib/services/blocks/text-backgrounds/text-backgrounds-with-txt.service.js +2 -2
- package/esm2015/lib/shared/components/editorjs/editorjs.component.js +21 -12
- package/esm2015/lib/shared/components/editorjs/tools/inline/bold-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/capitalize-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/italic-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/link-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/strike-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/subscript-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/superscript-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/inline-style-tool.component.js +105 -64
- package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.js +1 -18
- package/esm2015/lib/shared/components/editorjs/tools/inline/underline-tool.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/ordered-list-tool.component.js +2 -2
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/quote-tool.component.js +2 -2
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/text-align-tool.component.js +2 -2
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/text-type-tool.component.js +2 -2
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/paragraph-style-tool.component.js +2 -18
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/text-edition.component.js +1 -1
- package/esm2015/lib/shared/components/editorjs/tools/paragraph/unordered-list-tool.component.js +2 -2
- package/esm2015/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.js +8 -1
- package/esm2015/lib/shared/components/quill/quill.component.js +2 -1
- package/esm2015/lib/structures/map/background-form-left/map-background-form-left.component.js +32 -41
- package/esm2015/lib/structures/map/background-form-right/map-background-form-right.component.js +32 -41
- package/esm2015/lib/structures/map/fullpage/map-fullpage.component.js +32 -43
- package/esm2015/lib/structures/map/left-text/map-left-text.component.js +30 -41
- package/esm2015/lib/structures/map/right-text/map-right-text.component.js +30 -41
- package/esm2015/lib/structures/map/text-form/map-text-form.component.js +32 -43
- package/esm2015/lib/structures/structures.module.js +3 -1
- package/fesm2015/wizishop-wizi-block.js +328 -355
- package/fesm2015/wizishop-wizi-block.js.map +1 -1
- package/lib/shared/components/editorjs/editorjs.component.d.ts +1 -0
- package/lib/shared/components/editorjs/tools/inline/bold-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/capitalize-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/italic-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/link-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/strike-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/subscript-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/superscript-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/inline/tool-type/inline-style-tool.component.d.ts +2 -0
- package/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.d.ts +0 -1
- package/lib/shared/components/editorjs/tools/inline/underline-tool.component.d.ts +1 -1
- package/lib/shared/components/editorjs/tools/paragraph/tool-type/paragraph-style-tool.component.d.ts +0 -1
- package/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.d.ts +2 -0
- package/lib/structures/map/background-form-left/map-background-form-left.component.d.ts +8 -6
- package/lib/structures/map/background-form-right/map-background-form-right.component.d.ts +8 -6
- package/lib/structures/map/fullpage/map-fullpage.component.d.ts +7 -5
- package/lib/structures/map/left-text/map-left-text.component.d.ts +7 -5
- package/lib/structures/map/right-text/map-right-text.component.d.ts +7 -5
- package/lib/structures/map/text-form/map-text-form.component.d.ts +8 -6
- package/package.json +1 -1
- package/wizi-block.scss +35 -30
- package/wizishop-wizi-block.metadata.json +1 -1
|
@@ -28,8 +28,8 @@ import { EditorState } from '@codemirror/state';
|
|
|
28
28
|
import { html } from '@codemirror/lang-html';
|
|
29
29
|
import { MonacoEditorModule } from 'ngx-monaco-editor';
|
|
30
30
|
import { tileLayer, latLng, marker, icon } from 'leaflet';
|
|
31
|
-
import places from 'places.js';
|
|
32
31
|
import { LeafletModule } from '@asymmetrik/ngx-leaflet';
|
|
32
|
+
import { GooglePlaceModule } from 'ngx-google-places-autocomplete';
|
|
33
33
|
import { ColorPickerModule } from 'ngx-color-picker';
|
|
34
34
|
|
|
35
35
|
class MediaConnectorService {
|
|
@@ -3126,7 +3126,7 @@ class ImagesSimpleService {
|
|
|
3126
3126
|
'wb.blocks.FormContentDto.117',
|
|
3127
3127
|
], ['0', '0.25', '0.5', '1']);
|
|
3128
3128
|
imgSimpleFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
|
|
3129
|
-
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.
|
|
3129
|
+
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.blocks.FormContentDto.114', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
|
|
3130
3130
|
imgSimpleFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
|
|
3131
3131
|
return imgSimpleFormDto;
|
|
3132
3132
|
}
|
|
@@ -4116,7 +4116,7 @@ class TextBackgroundsSimpleService {
|
|
|
4116
4116
|
'wb.blocks.FormContentDto.117',
|
|
4117
4117
|
], ['0', '0.25', '0.5', '1']);
|
|
4118
4118
|
TextBackgroundsSimpleFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
|
|
4119
|
-
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.
|
|
4119
|
+
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.blocks.FormContentDto.114', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
|
|
4120
4120
|
TextBackgroundsSimpleFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
|
|
4121
4121
|
return TextBackgroundsSimpleFormDto;
|
|
4122
4122
|
}
|
|
@@ -4191,7 +4191,7 @@ class TextBackgroundsWithTxtService {
|
|
|
4191
4191
|
'wb.blocks.FormContentDto.117',
|
|
4192
4192
|
], ['0', '0.25', '0.5', '1']);
|
|
4193
4193
|
formsDto.forms.push(parallaxSpeedImgSimpleContentDto);
|
|
4194
|
-
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.
|
|
4194
|
+
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.blocks.FormContentDto.114', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
|
|
4195
4195
|
formsDto.forms.push(parallaxInvertedImgSimpleContentDto);
|
|
4196
4196
|
return formsDto;
|
|
4197
4197
|
}
|
|
@@ -4266,7 +4266,7 @@ class TextBackgroundsWithBannerService {
|
|
|
4266
4266
|
'wb.blocks.FormContentDto.117',
|
|
4267
4267
|
], ['0', '0.25', '0.5', '1']);
|
|
4268
4268
|
formsDto.forms.push(parallaxSpeedImgSimpleContentDto);
|
|
4269
|
-
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.
|
|
4269
|
+
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.blocks.FormContentDto.114', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
|
|
4270
4270
|
formsDto.forms.push(parallaxInvertedImgSimpleContentDto);
|
|
4271
4271
|
const colorContentDto = new FormsContentDto(FORM_NAME_COLOR, 'wb.blocks.FormContentDto.112', FORM_TYPE_COLOR, content[FORM_NAME_COLOR], '#122231', '');
|
|
4272
4272
|
formsDto.forms.push(colorContentDto);
|
|
@@ -5686,7 +5686,7 @@ class ImagesBannerService {
|
|
|
5686
5686
|
'wb.blocks.FormContentDto.117',
|
|
5687
5687
|
], ['0', '0.25', '0.5', '1']);
|
|
5688
5688
|
imgBannerFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
|
|
5689
|
-
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.
|
|
5689
|
+
const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.blocks.FormContentDto.114', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
|
|
5690
5690
|
imgBannerFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
|
|
5691
5691
|
return imgBannerFormDto;
|
|
5692
5692
|
}
|
|
@@ -9614,6 +9614,7 @@ class QuillComponent {
|
|
|
9614
9614
|
},
|
|
9615
9615
|
clipboard: {
|
|
9616
9616
|
matchers: [['BR', this.lineBreakMatcher]],
|
|
9617
|
+
matchVisual: false,
|
|
9617
9618
|
},
|
|
9618
9619
|
keyboard: {
|
|
9619
9620
|
bindings: {
|
|
@@ -18651,6 +18652,13 @@ class EditorJSTool {
|
|
|
18651
18652
|
const selection = this.currentSelection ? this.currentSelection : this.getSelection();
|
|
18652
18653
|
return selection.anchorNode.parentElement.closest('.editorJs');
|
|
18653
18654
|
}
|
|
18655
|
+
findParentModifier() {
|
|
18656
|
+
if (!this.parentEditor) {
|
|
18657
|
+
this.parentEditor = this.findParentEditor();
|
|
18658
|
+
}
|
|
18659
|
+
return (this.parentEditor.querySelectorAll('.ce-block')[this.api.blocks.getCurrentBlockIndex()].querySelector('.ce-paragraph')
|
|
18660
|
+
.children[0]);
|
|
18661
|
+
}
|
|
18654
18662
|
clear() {
|
|
18655
18663
|
resetBlockFocus(this.parentEditor);
|
|
18656
18664
|
}
|
|
@@ -18731,33 +18739,28 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
18731
18739
|
: anchorNode.parentElement;
|
|
18732
18740
|
const sameSelection = container && container.innerText === selection.toString();
|
|
18733
18741
|
yield this.saveInlineSelection(container, true);
|
|
18734
|
-
console.log('
|
|
18742
|
+
console.log('=== inline tool execCommandStyle method ===');
|
|
18735
18743
|
console.log(this.hasStyle(container));
|
|
18736
|
-
|
|
18737
|
-
|
|
18738
|
-
|
|
18739
|
-
|
|
18744
|
+
// Link delete exception
|
|
18745
|
+
if (this.linkDeletion) {
|
|
18746
|
+
yield this.replaceLink(selection, this.hasStyle(container));
|
|
18747
|
+
}
|
|
18748
|
+
else {
|
|
18749
|
+
if (sameSelection &&
|
|
18750
|
+
!this.isContainer(this.textContainers, container) &&
|
|
18751
|
+
this.hasStyle(container) &&
|
|
18752
|
+
selection.toString() === this.hasStyle(container).innerText) {
|
|
18753
|
+
console.log('-> update selection');
|
|
18754
|
+
yield this.updateSelection(selection, this.hasStyle(container), action, this.textContainers);
|
|
18740
18755
|
}
|
|
18741
18756
|
else {
|
|
18742
|
-
|
|
18743
|
-
|
|
18744
|
-
this.hasStyle(container) &&
|
|
18745
|
-
selection.toString() === this.hasStyle(container).innerText) {
|
|
18746
|
-
console.log('update');
|
|
18747
|
-
yield this.updateSelection(selection, this.hasStyle(container), action, this.textContainers);
|
|
18748
|
-
}
|
|
18749
|
-
else {
|
|
18750
|
-
console.log('replace');
|
|
18751
|
-
yield this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers);
|
|
18752
|
-
}
|
|
18753
|
-
}
|
|
18754
|
-
yield this.cleanupContainer(selection, container, true);
|
|
18755
|
-
if (this.modifiedContent) {
|
|
18756
|
-
yield this.resetInlineSelection(container, true);
|
|
18757
|
+
console.log('-> replace selection');
|
|
18758
|
+
yield this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers);
|
|
18757
18759
|
}
|
|
18758
18760
|
}
|
|
18759
|
-
|
|
18760
|
-
|
|
18761
|
+
yield this.cleanupContainer(selection, container, true);
|
|
18762
|
+
if (this.modifiedContent) {
|
|
18763
|
+
yield this.resetInlineSelection(container, true);
|
|
18761
18764
|
}
|
|
18762
18765
|
});
|
|
18763
18766
|
}
|
|
@@ -18801,11 +18804,11 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
18801
18804
|
replaceSelection(container, action, selection, containers) {
|
|
18802
18805
|
var _a;
|
|
18803
18806
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18804
|
-
let parentContainer = this.hasStyle(container);
|
|
18805
18807
|
const focusNode = selection.focusNode;
|
|
18806
18808
|
let offsetContainer = focusNode.nodeType !== Node.TEXT_NODE && focusNode.nodeType !== Node.COMMENT_NODE
|
|
18807
18809
|
? focusNode
|
|
18808
18810
|
: focusNode.parentElement;
|
|
18811
|
+
let parentContainer = this.hasStyle(container);
|
|
18809
18812
|
let offsetParentContainer = this.hasStyle(offsetContainer);
|
|
18810
18813
|
if (parentContainer &&
|
|
18811
18814
|
parentContainer === offsetParentContainer &&
|
|
@@ -18834,8 +18837,6 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
18834
18837
|
let currentParentElement = container;
|
|
18835
18838
|
if (parentContainer.contains(currentParentElement)) {
|
|
18836
18839
|
while (currentParentElement !== parentContainer) {
|
|
18837
|
-
console.warn('currentParentElement');
|
|
18838
|
-
console.log(currentParentElement);
|
|
18839
18840
|
let tmpElement = document.createElement(currentParentElement.tagName);
|
|
18840
18841
|
tmpElement = this.setInlineStyle(currentParentElement, tmpElement);
|
|
18841
18842
|
tmpElement.appendChild(currentElementToAppend);
|
|
@@ -18867,6 +18868,7 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
18867
18868
|
let fragmentElement = document.createElement('div');
|
|
18868
18869
|
let newElement = yield this.createElement(container, action, containers);
|
|
18869
18870
|
let elementToAppend = newElement;
|
|
18871
|
+
console.log(newElement);
|
|
18870
18872
|
fragmentElement.append(fragment);
|
|
18871
18873
|
if (((_a = fragmentElement.children) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
18872
18874
|
this.textContainers.split(',').indexOf(fragmentElement.children[0].tagName.toLowerCase()) > -1) {
|
|
@@ -19038,6 +19040,26 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
19038
19040
|
}
|
|
19039
19041
|
});
|
|
19040
19042
|
}
|
|
19043
|
+
parentHasStyle(currentElement, referenceElement) {
|
|
19044
|
+
// Link exception
|
|
19045
|
+
if (!currentElement || referenceElement.tagName.toLowerCase() === 'a' || referenceElement.tagName.toLowerCase() === 'div') {
|
|
19046
|
+
return false;
|
|
19047
|
+
}
|
|
19048
|
+
if (referenceElement.tagName.toLowerCase() !== 'span' &&
|
|
19049
|
+
referenceElement.tagName.toLowerCase() === currentElement.tagName.toLowerCase()) {
|
|
19050
|
+
return true;
|
|
19051
|
+
}
|
|
19052
|
+
if (Object.keys(this.getInlineStyle(currentElement)).length > 0 && this.identicalInlineStyle(currentElement, referenceElement)) {
|
|
19053
|
+
return true;
|
|
19054
|
+
}
|
|
19055
|
+
if (currentElement.classList.length > 0 && this.identicalClassList(currentElement, referenceElement)) {
|
|
19056
|
+
return true;
|
|
19057
|
+
}
|
|
19058
|
+
if (currentElement.parentElement && currentElement.parentElement.tagName.toLowerCase() !== 'div') {
|
|
19059
|
+
return this.parentHasStyle(currentElement.parentElement, referenceElement);
|
|
19060
|
+
}
|
|
19061
|
+
return false;
|
|
19062
|
+
}
|
|
19041
19063
|
cleanupContainer(selection, container, firstTimeCall) {
|
|
19042
19064
|
var _a;
|
|
19043
19065
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -19064,47 +19086,59 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
19064
19086
|
const children = Array.from(parentContainer.childNodes);
|
|
19065
19087
|
if ((children === null || children === void 0 ? void 0 : children.length) > 0) {
|
|
19066
19088
|
for (var currentNode = children[0]; currentNode; currentNode = currentNode.nextSibling) {
|
|
19067
|
-
if (!currentNode.textContent ||
|
|
19089
|
+
if (!currentNode.textContent ||
|
|
19090
|
+
currentNode.textContent.length === 0 ||
|
|
19091
|
+
(currentNode.nodeType === Node.ELEMENT_NODE && currentNode.innerText.length === 0)) {
|
|
19092
|
+
let previousSibling = currentNode.previousSibling;
|
|
19068
19093
|
parentContainer.removeChild(currentNode);
|
|
19094
|
+
currentNode = previousSibling;
|
|
19069
19095
|
}
|
|
19070
|
-
|
|
19071
|
-
|
|
19072
|
-
|
|
19073
|
-
|
|
19074
|
-
|
|
19075
|
-
|
|
19076
|
-
|
|
19077
|
-
currentNode.nodeType === Node.ELEMENT_NODE &&
|
|
19078
|
-
currentNode.nextSibling.nodeType === Node.ELEMENT_NODE) {
|
|
19079
|
-
let currentElement = currentNode;
|
|
19080
|
-
let nextElement = currentNode.nextSibling;
|
|
19081
|
-
if (this.identicalInlineStyle(currentElement, nextElement) &&
|
|
19082
|
-
currentElement.tagName.toLowerCase() === nextElement.tagName.toLowerCase() &&
|
|
19083
|
-
this.identicalClassList(currentElement, nextElement) &&
|
|
19084
|
-
!currentElement.hasAttributes() &&
|
|
19085
|
-
!nextElement.hasAttributes()) {
|
|
19086
|
-
currentElement.innerHTML += nextElement.innerHTML;
|
|
19087
|
-
nextElement.remove();
|
|
19088
|
-
this.modifiedContent = true;
|
|
19089
|
-
}
|
|
19090
|
-
else {
|
|
19091
|
-
identicalElements = false;
|
|
19092
|
-
}
|
|
19096
|
+
if (currentNode.nodeType === Node.ELEMENT_NODE &&
|
|
19097
|
+
this.parentHasStyle(currentNode.parentElement, currentNode)) {
|
|
19098
|
+
let currentNodeFirstChild = currentNode;
|
|
19099
|
+
let nextCurrentElement = currentNode.firstChild;
|
|
19100
|
+
while (currentNode.firstChild) {
|
|
19101
|
+
parentContainer.insertBefore(currentNode.firstChild, currentNodeFirstChild.nextSibling);
|
|
19102
|
+
currentNodeFirstChild = currentNodeFirstChild.nextSibling;
|
|
19093
19103
|
}
|
|
19094
|
-
|
|
19095
|
-
|
|
19096
|
-
|
|
19097
|
-
|
|
19098
|
-
|
|
19099
|
-
|
|
19100
|
-
|
|
19101
|
-
|
|
19102
|
-
|
|
19103
|
-
|
|
19104
|
-
|
|
19104
|
+
parentContainer.removeChild(currentNode);
|
|
19105
|
+
currentNode = nextCurrentElement;
|
|
19106
|
+
}
|
|
19107
|
+
let identicalElements = true;
|
|
19108
|
+
while (identicalElements &&
|
|
19109
|
+
currentNode.nextSibling &&
|
|
19110
|
+
currentNode.nodeType === Node.ELEMENT_NODE &&
|
|
19111
|
+
currentNode.nextSibling.nodeType === Node.ELEMENT_NODE) {
|
|
19112
|
+
let currentElement = currentNode;
|
|
19113
|
+
let nextElement = currentNode.nextSibling;
|
|
19114
|
+
if (this.identicalInlineStyle(currentElement, nextElement) &&
|
|
19115
|
+
currentElement.tagName.toLowerCase() === nextElement.tagName.toLowerCase() &&
|
|
19116
|
+
this.identicalClassList(currentElement, nextElement) &&
|
|
19117
|
+
this.identicalAttributes(currentElement, nextElement)) {
|
|
19118
|
+
currentElement.innerHTML += nextElement.innerHTML;
|
|
19119
|
+
nextElement.remove();
|
|
19105
19120
|
this.modifiedContent = true;
|
|
19106
19121
|
}
|
|
19107
|
-
|
|
19122
|
+
else {
|
|
19123
|
+
identicalElements = false;
|
|
19124
|
+
}
|
|
19125
|
+
}
|
|
19126
|
+
if (currentNode.nodeType === Node.ELEMENT_NODE &&
|
|
19127
|
+
currentNode.tagName.toLowerCase() === 'span' &&
|
|
19128
|
+
Object.keys(this.getInlineStyle(currentNode)).length === 0 &&
|
|
19129
|
+
(!currentNode.classList || currentNode.classList.length === 0) &&
|
|
19130
|
+
this.hasNoAttributes(currentNode)) {
|
|
19131
|
+
let currentNodeFirstChild = currentNode;
|
|
19132
|
+
while (currentNode.firstChild) {
|
|
19133
|
+
currentNodeFirstChild.parentElement.insertBefore(currentNode.firstChild, currentNodeFirstChild.nextSibling);
|
|
19134
|
+
currentNodeFirstChild = currentNodeFirstChild.nextSibling;
|
|
19135
|
+
}
|
|
19136
|
+
currentNode.remove();
|
|
19137
|
+
this.modifiedContent = true;
|
|
19138
|
+
}
|
|
19139
|
+
currentNode.normalize();
|
|
19140
|
+
if (currentNode.childNodes.length > 0) {
|
|
19141
|
+
yield this.cleanupContainer(selection, currentNode, false);
|
|
19108
19142
|
}
|
|
19109
19143
|
}
|
|
19110
19144
|
}
|
|
@@ -19124,6 +19158,20 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
19124
19158
|
return ([...currentElement.classList].every((classList) => nextElement.classList.contains(classList)) &&
|
|
19125
19159
|
[...nextElement.classList].every((classList) => currentElement.classList.contains(classList)));
|
|
19126
19160
|
}
|
|
19161
|
+
identicalAttributes(currentElement, nextElement) {
|
|
19162
|
+
let currentElementAttributes = currentElement.getAttributeNames();
|
|
19163
|
+
if (currentElementAttributes) {
|
|
19164
|
+
currentElementAttributes.forEach((attribute) => {
|
|
19165
|
+
if (attribute !== 'style') {
|
|
19166
|
+
if (!nextElement.getAttribute(attribute) ||
|
|
19167
|
+
nextElement.getAttribute(attribute) !== currentElement.getAttribute(attribute)) {
|
|
19168
|
+
return false;
|
|
19169
|
+
}
|
|
19170
|
+
}
|
|
19171
|
+
});
|
|
19172
|
+
}
|
|
19173
|
+
return true;
|
|
19174
|
+
}
|
|
19127
19175
|
identicalInlineStyle(currentElement, nextElement) {
|
|
19128
19176
|
const currentElementInlineStyle = this.getInlineStyle(currentElement);
|
|
19129
19177
|
const nextElementInlineStyle = this.getInlineStyle(nextElement);
|
|
@@ -19177,9 +19225,10 @@ class InlineStyleTool extends EditorJSTool {
|
|
|
19177
19225
|
let nextNode = container.firstChild;
|
|
19178
19226
|
while (nextNode && (!this.foundAnchorNode || !this.foundFocusNode)) {
|
|
19179
19227
|
if (nextNode === this.selectedAnchorNode) {
|
|
19180
|
-
this.foundAnchorNode = true;
|
|
19181
|
-
this.foundAnchorOffset += this.anchorOffset;
|
|
19182
19228
|
let selection = this.getSelection();
|
|
19229
|
+
const isLTR = this.isAnchorBeforeFocus(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
|
|
19230
|
+
this.foundAnchorNode = true;
|
|
19231
|
+
this.foundAnchorOffset += isLTR ? this.anchorOffset : this.focusOffset;
|
|
19183
19232
|
let range = this.getRangeObject(selection);
|
|
19184
19233
|
const currentFragment = range.cloneContents();
|
|
19185
19234
|
const currentElement = document.createElement('span');
|
|
@@ -20559,7 +20608,7 @@ class ParagraphStyleTool extends EditorJSTool {
|
|
|
20559
20608
|
if (!anchorNode) {
|
|
20560
20609
|
return;
|
|
20561
20610
|
}
|
|
20562
|
-
let parentModifier = this.findParentModifier(
|
|
20611
|
+
let parentModifier = this.findParentModifier();
|
|
20563
20612
|
try {
|
|
20564
20613
|
if (this.tag.toLowerCase() !== 'span') {
|
|
20565
20614
|
this.changeContainerTag(parentModifier, selection);
|
|
@@ -20694,22 +20743,6 @@ class ParagraphStyleTool extends EditorJSTool {
|
|
|
20694
20743
|
container.className += (container.className.length > 0 ? ' ' : '') + this.classToApply;
|
|
20695
20744
|
}
|
|
20696
20745
|
}
|
|
20697
|
-
findParentModifier(element) {
|
|
20698
|
-
let currentElement = element;
|
|
20699
|
-
if (currentElement.tagName.toLowerCase() === 'div') {
|
|
20700
|
-
if (currentElement.classList.contains('ce-paragraph')) {
|
|
20701
|
-
return currentElement.children[0];
|
|
20702
|
-
}
|
|
20703
|
-
return currentElement.closest('.codex-editor__redactor').querySelector('.ce-paragraph').children[0];
|
|
20704
|
-
}
|
|
20705
|
-
while (this.modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
|
|
20706
|
-
if (currentElement.tagName.toLowerCase() === 'div') {
|
|
20707
|
-
return null;
|
|
20708
|
-
}
|
|
20709
|
-
currentElement = currentElement.parentElement;
|
|
20710
|
-
}
|
|
20711
|
-
return currentElement;
|
|
20712
|
-
}
|
|
20713
20746
|
}
|
|
20714
20747
|
var listApi = null;
|
|
20715
20748
|
var listEditor = null;
|
|
@@ -21006,7 +21039,7 @@ class TextTypeTool extends ParagraphTextTool {
|
|
|
21006
21039
|
if (!isBlockFocused) {
|
|
21007
21040
|
setBlockFocus(this.parentEditor);
|
|
21008
21041
|
}
|
|
21009
|
-
const parentModifier = this.findParentModifier(
|
|
21042
|
+
const parentModifier = this.findParentModifier();
|
|
21010
21043
|
if (!parentModifier) {
|
|
21011
21044
|
return false;
|
|
21012
21045
|
}
|
|
@@ -21281,7 +21314,7 @@ class TextAlignTool extends ParagraphTextTool {
|
|
|
21281
21314
|
if (!isBlockFocused) {
|
|
21282
21315
|
setBlockFocus(this.parentEditor);
|
|
21283
21316
|
}
|
|
21284
|
-
const parentModifier = this.findParentModifier(
|
|
21317
|
+
const parentModifier = this.findParentModifier();
|
|
21285
21318
|
if (!parentModifier) {
|
|
21286
21319
|
return false;
|
|
21287
21320
|
}
|
|
@@ -21385,7 +21418,7 @@ class UnorderedListTool extends ParagraphStyleTool {
|
|
|
21385
21418
|
if (!isBlockFocused) {
|
|
21386
21419
|
setBlockFocus(this.parentEditor);
|
|
21387
21420
|
}
|
|
21388
|
-
const parentModifier = this.findParentModifier(
|
|
21421
|
+
const parentModifier = this.findParentModifier();
|
|
21389
21422
|
if (!parentModifier) {
|
|
21390
21423
|
return false;
|
|
21391
21424
|
}
|
|
@@ -21450,7 +21483,7 @@ class OrderedListTool extends ParagraphStyleTool {
|
|
|
21450
21483
|
if (!isBlockFocused) {
|
|
21451
21484
|
setBlockFocus(this.parentEditor);
|
|
21452
21485
|
}
|
|
21453
|
-
const parentModifier = this.findParentModifier(
|
|
21486
|
+
const parentModifier = this.findParentModifier();
|
|
21454
21487
|
if (!parentModifier) {
|
|
21455
21488
|
return false;
|
|
21456
21489
|
}
|
|
@@ -21515,7 +21548,7 @@ class QuoteTool extends ParagraphStyleTool {
|
|
|
21515
21548
|
if (!isBlockFocused) {
|
|
21516
21549
|
setBlockFocus(this.parentEditor);
|
|
21517
21550
|
}
|
|
21518
|
-
const parentModifier = this.findParentModifier(
|
|
21551
|
+
const parentModifier = this.findParentModifier();
|
|
21519
21552
|
if (!parentModifier) {
|
|
21520
21553
|
return false;
|
|
21521
21554
|
}
|
|
@@ -22050,23 +22083,6 @@ class InlineTextTool extends InlineStyleTool {
|
|
|
22050
22083
|
return true;
|
|
22051
22084
|
}
|
|
22052
22085
|
}
|
|
22053
|
-
findParentModifier(element) {
|
|
22054
|
-
const modifiers = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
|
|
22055
|
-
let currentElement = element;
|
|
22056
|
-
if (currentElement.tagName.toLowerCase() === 'div') {
|
|
22057
|
-
if (currentElement.classList.contains('ce-paragraph')) {
|
|
22058
|
-
return currentElement.firstElementChild;
|
|
22059
|
-
}
|
|
22060
|
-
return currentElement.querySelector('.ce-paragraph').children[0];
|
|
22061
|
-
}
|
|
22062
|
-
while (modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
|
|
22063
|
-
if (currentElement.tagName.toLowerCase() === 'div') {
|
|
22064
|
-
return null;
|
|
22065
|
-
}
|
|
22066
|
-
currentElement = currentElement.parentElement;
|
|
22067
|
-
}
|
|
22068
|
-
return currentElement;
|
|
22069
|
-
}
|
|
22070
22086
|
}
|
|
22071
22087
|
|
|
22072
22088
|
// @dynamic
|
|
@@ -22765,6 +22781,7 @@ class EditorJsComponent {
|
|
|
22765
22781
|
this.timeoutHandle = null;
|
|
22766
22782
|
this.timeoutTextEditionHandle = null;
|
|
22767
22783
|
this.onChangeTimeoutHandle = null;
|
|
22784
|
+
this.editorInitialized = false;
|
|
22768
22785
|
this.wrapperTags = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
|
|
22769
22786
|
}
|
|
22770
22787
|
ngOnInit() {
|
|
@@ -22826,7 +22843,7 @@ class EditorJsComponent {
|
|
|
22826
22843
|
clearTimeout(this.onChangeTimeoutHandle);
|
|
22827
22844
|
this.onChangeTimeoutHandle = setTimeout(() => {
|
|
22828
22845
|
this.contentChanged(api, event);
|
|
22829
|
-
},
|
|
22846
|
+
}, 200);
|
|
22830
22847
|
},
|
|
22831
22848
|
i18n: this.getI18nDictionnary(),
|
|
22832
22849
|
});
|
|
@@ -22837,12 +22854,10 @@ class EditorJsComponent {
|
|
|
22837
22854
|
this.content = content;
|
|
22838
22855
|
this.applyContent();
|
|
22839
22856
|
this.checkSingleChild();
|
|
22840
|
-
|
|
22841
|
-
|
|
22842
|
-
|
|
22843
|
-
|
|
22844
|
-
});
|
|
22845
|
-
}, 0);
|
|
22857
|
+
const editorElement = document.getElementById('editorJs-' + this.uuid);
|
|
22858
|
+
editorElement.addEventListener('focusin', () => {
|
|
22859
|
+
setlistApiEditor(this.editor, editorElement);
|
|
22860
|
+
});
|
|
22846
22861
|
});
|
|
22847
22862
|
}
|
|
22848
22863
|
catch (reason) {
|
|
@@ -22853,7 +22868,6 @@ class EditorJsComponent {
|
|
|
22853
22868
|
ngOnDestroy() {
|
|
22854
22869
|
const editorName = 'editorJs-' + this.uuid;
|
|
22855
22870
|
this.deleteSavedEditorContent(editorName);
|
|
22856
|
-
this.deleteSavedEditorContent(editorName);
|
|
22857
22871
|
this.editor.destroy();
|
|
22858
22872
|
}
|
|
22859
22873
|
handleDefaultContentTranslation() {
|
|
@@ -22870,7 +22884,13 @@ class EditorJsComponent {
|
|
|
22870
22884
|
.save()
|
|
22871
22885
|
.then(() => {
|
|
22872
22886
|
this.content = this.getEditorContent();
|
|
22873
|
-
|
|
22887
|
+
if (!this.editorInitialized) {
|
|
22888
|
+
this.handleSaveEditor(this.content, this.uuid);
|
|
22889
|
+
this.editorInitialized = true;
|
|
22890
|
+
}
|
|
22891
|
+
else {
|
|
22892
|
+
this.saveEditorContent(this.content);
|
|
22893
|
+
}
|
|
22874
22894
|
this.contentChange.emit(this.content);
|
|
22875
22895
|
})
|
|
22876
22896
|
.catch((error) => {
|
|
@@ -23012,11 +23032,11 @@ class EditorJsComponent {
|
|
|
23012
23032
|
}
|
|
23013
23033
|
return null;
|
|
23014
23034
|
}
|
|
23015
|
-
saveEditorContent(data
|
|
23035
|
+
saveEditorContent(data) {
|
|
23016
23036
|
if (!isTextEditionTool) {
|
|
23017
23037
|
clearTimeout(this.timeoutHandle);
|
|
23018
23038
|
this.timeoutHandle = setTimeout(() => {
|
|
23019
|
-
this.handleSaveEditor(data, uuid);
|
|
23039
|
+
this.handleSaveEditor(data, this.uuid);
|
|
23020
23040
|
}, 2000);
|
|
23021
23041
|
}
|
|
23022
23042
|
else {
|
|
@@ -23032,6 +23052,10 @@ class EditorJsComponent {
|
|
|
23032
23052
|
let savedDataIndex = this.getSavedEditorContent(editorName + '-index')
|
|
23033
23053
|
? parseInt(this.getSavedEditorContent(editorName + '-index'))
|
|
23034
23054
|
: -1;
|
|
23055
|
+
if (!this.editorInitialized) {
|
|
23056
|
+
savedData = null;
|
|
23057
|
+
savedDataIndex = -1;
|
|
23058
|
+
}
|
|
23035
23059
|
let parsedSavedData = [];
|
|
23036
23060
|
if (savedData) {
|
|
23037
23061
|
parsedSavedData = JSON.parse(savedData);
|
|
@@ -23053,6 +23077,7 @@ class EditorJsComponent {
|
|
|
23053
23077
|
}
|
|
23054
23078
|
deleteSavedEditorContent(name) {
|
|
23055
23079
|
localStorage.removeItem(name);
|
|
23080
|
+
localStorage.removeItem(name + '-index');
|
|
23056
23081
|
}
|
|
23057
23082
|
}
|
|
23058
23083
|
EditorJsComponent.decorators = [
|
|
@@ -26438,15 +26463,14 @@ QuotesSimpleBackgroundComponent.decorators = [
|
|
|
26438
26463
|
];
|
|
26439
26464
|
QuotesSimpleBackgroundComponent.ctorParameters = () => [];
|
|
26440
26465
|
|
|
26441
|
-
class OpenMapDto {
|
|
26442
|
-
}
|
|
26443
|
-
|
|
26444
26466
|
class MapFullpageComponent extends StructuresComponent {
|
|
26445
26467
|
constructor(externalConfigService) {
|
|
26446
26468
|
super();
|
|
26447
26469
|
this.externalConfigService = externalConfigService;
|
|
26448
26470
|
this.address = '';
|
|
26471
|
+
this.triggerAddress = '';
|
|
26449
26472
|
this.editPlaceMap = null;
|
|
26473
|
+
this.firstTimeTrigger = false;
|
|
26450
26474
|
this.options = {};
|
|
26451
26475
|
this.layers = [];
|
|
26452
26476
|
this.showMap = false;
|
|
@@ -26455,40 +26479,29 @@ class MapFullpageComponent extends StructuresComponent {
|
|
|
26455
26479
|
ngOnInit() {
|
|
26456
26480
|
super.ngOnInit();
|
|
26457
26481
|
if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
|
|
26458
|
-
|
|
26459
|
-
|
|
26460
|
-
|
|
26461
|
-
|
|
26462
|
-
|
|
26482
|
+
this.googleMapReturnElement = {
|
|
26483
|
+
suggestion: {
|
|
26484
|
+
latlng: {
|
|
26485
|
+
lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
|
|
26486
|
+
lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
|
|
26487
|
+
},
|
|
26488
|
+
value: '',
|
|
26463
26489
|
},
|
|
26464
|
-
value: '',
|
|
26465
26490
|
};
|
|
26466
|
-
this.setCoordinateOnPlaces(
|
|
26467
|
-
}
|
|
26468
|
-
}
|
|
26469
|
-
ngAfterViewInit() {
|
|
26470
|
-
if (!this.showMap) {
|
|
26471
|
-
const placesAutocomplete = places({
|
|
26472
|
-
appId: this.externalConfigService.getAlgoliaAppId(),
|
|
26473
|
-
apiKey: this.externalConfigService.getAlgoliaApiKey(),
|
|
26474
|
-
container: this.input.nativeElement,
|
|
26475
|
-
});
|
|
26476
|
-
placesAutocomplete.on('change', (algoliaReturnElement) => {
|
|
26477
|
-
this.setCoordinateOnPlaces(algoliaReturnElement);
|
|
26478
|
-
});
|
|
26491
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26479
26492
|
}
|
|
26480
26493
|
}
|
|
26481
|
-
setCoordinateOnPlaces(
|
|
26494
|
+
setCoordinateOnPlaces(googleResults) {
|
|
26482
26495
|
this.showMap = false;
|
|
26483
26496
|
this.options = {
|
|
26484
26497
|
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
|
|
26485
26498
|
zoom: 18,
|
|
26486
26499
|
zoomControl: false,
|
|
26487
|
-
center: latLng(
|
|
26500
|
+
center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
|
|
26488
26501
|
};
|
|
26489
|
-
this.center = latLng(
|
|
26502
|
+
this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
|
|
26490
26503
|
this.layers = [
|
|
26491
|
-
marker([
|
|
26504
|
+
marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
|
|
26492
26505
|
icon: icon({
|
|
26493
26506
|
iconSize: [25, 41],
|
|
26494
26507
|
iconAnchor: [13, 41],
|
|
@@ -26497,23 +26510,23 @@ class MapFullpageComponent extends StructuresComponent {
|
|
|
26497
26510
|
}),
|
|
26498
26511
|
}),
|
|
26499
26512
|
];
|
|
26500
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_Y] =
|
|
26501
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_X] =
|
|
26502
|
-
this.address =
|
|
26513
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
|
|
26514
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
|
|
26515
|
+
this.address = googleResults.suggestion.value;
|
|
26503
26516
|
this.showMap = true;
|
|
26504
26517
|
this.persist();
|
|
26505
26518
|
}
|
|
26506
|
-
|
|
26507
|
-
|
|
26508
|
-
|
|
26509
|
-
|
|
26510
|
-
|
|
26511
|
-
|
|
26512
|
-
|
|
26513
|
-
|
|
26514
|
-
|
|
26515
|
-
|
|
26516
|
-
|
|
26519
|
+
handleAddressChange(event) {
|
|
26520
|
+
this.googleMapReturnElement = {
|
|
26521
|
+
suggestion: {
|
|
26522
|
+
latlng: {
|
|
26523
|
+
lat: event.geometry.location.lat(),
|
|
26524
|
+
lng: event.geometry.location.lng(),
|
|
26525
|
+
},
|
|
26526
|
+
value: event.name,
|
|
26527
|
+
},
|
|
26528
|
+
};
|
|
26529
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26517
26530
|
}
|
|
26518
26531
|
/**
|
|
26519
26532
|
* Avoid partial map loaded at the initialization
|
|
@@ -26528,7 +26541,7 @@ class MapFullpageComponent extends StructuresComponent {
|
|
|
26528
26541
|
MapFullpageComponent.decorators = [
|
|
26529
26542
|
{ type: Component, args: [{
|
|
26530
26543
|
selector: MapFullpageService.selector(),
|
|
26531
|
-
template: "<div class=\"wb-map-fullpage\">\n <div class=\"wb-map-fullpage__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-fullpage__container__config\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_LEFT_TOP\"
|
|
26544
|
+
template: "<div class=\"wb-map-fullpage\">\n <div class=\"wb-map-fullpage__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-fullpage__container__config\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_LEFT_TOP\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input-edit{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInputEdit\n (click)=\"myInputEdit.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </wb-structure-config>\n </div>\n <div class=\"wb-map-fullpage__cover\"></div>\n <div\n class=\"wb-map-fullpage__container__map\"\n leaflet\n [leafletOptions]=\"options\"\n [leafletLayers]=\"layers\"\n [(leafletCenter)]=\"center\"\n (leafletMapReady)=\"onMapReady($event)\"\n ></div>\n </div>\n </div>\n <div class=\"wb-map-fullpage__selector\" *ngIf=\"!showMap\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInput\n (click)=\"myInput.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </div>\n</div>\n"
|
|
26532
26545
|
},] }
|
|
26533
26546
|
];
|
|
26534
26547
|
MapFullpageComponent.ctorParameters = () => [
|
|
@@ -26543,7 +26556,9 @@ class MapLeftTextComponent extends StructuresComponent {
|
|
|
26543
26556
|
super();
|
|
26544
26557
|
this.externalConfigService = externalConfigService;
|
|
26545
26558
|
this.address = '';
|
|
26559
|
+
this.triggerAddress = '';
|
|
26546
26560
|
this.editPlaceMap = null;
|
|
26561
|
+
this.firstTimeTrigger = false;
|
|
26547
26562
|
this.options = {};
|
|
26548
26563
|
this.layers = [];
|
|
26549
26564
|
this.showMap = false;
|
|
@@ -26552,40 +26567,29 @@ class MapLeftTextComponent extends StructuresComponent {
|
|
|
26552
26567
|
ngOnInit() {
|
|
26553
26568
|
super.ngOnInit();
|
|
26554
26569
|
if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
|
|
26555
|
-
|
|
26556
|
-
|
|
26557
|
-
|
|
26558
|
-
|
|
26559
|
-
|
|
26570
|
+
this.googleMapReturnElement = {
|
|
26571
|
+
suggestion: {
|
|
26572
|
+
latlng: {
|
|
26573
|
+
lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
|
|
26574
|
+
lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
|
|
26575
|
+
},
|
|
26576
|
+
value: '',
|
|
26560
26577
|
},
|
|
26561
|
-
value: '',
|
|
26562
26578
|
};
|
|
26563
|
-
this.setCoordinateOnPlaces(
|
|
26579
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26564
26580
|
}
|
|
26565
26581
|
}
|
|
26566
|
-
|
|
26567
|
-
if (!this.showMap) {
|
|
26568
|
-
const placesAutocomplete = places({
|
|
26569
|
-
appId: this.externalConfigService.getAlgoliaAppId(),
|
|
26570
|
-
apiKey: this.externalConfigService.getAlgoliaApiKey(),
|
|
26571
|
-
container: this.input.nativeElement,
|
|
26572
|
-
});
|
|
26573
|
-
placesAutocomplete.on('change', (algoliaReturnElement) => {
|
|
26574
|
-
this.setCoordinateOnPlaces(algoliaReturnElement);
|
|
26575
|
-
});
|
|
26576
|
-
}
|
|
26577
|
-
}
|
|
26578
|
-
setCoordinateOnPlaces(algoliaReturnElement) {
|
|
26582
|
+
setCoordinateOnPlaces(googleResults) {
|
|
26579
26583
|
this.showMap = false;
|
|
26580
26584
|
this.options = {
|
|
26581
26585
|
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
|
|
26582
26586
|
zoom: 18,
|
|
26583
26587
|
zoomControl: false,
|
|
26584
|
-
center: latLng(
|
|
26588
|
+
center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
|
|
26585
26589
|
};
|
|
26586
|
-
this.center = latLng(
|
|
26590
|
+
this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
|
|
26587
26591
|
this.layers = [
|
|
26588
|
-
marker([
|
|
26592
|
+
marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
|
|
26589
26593
|
icon: icon({
|
|
26590
26594
|
iconSize: [25, 41],
|
|
26591
26595
|
iconAnchor: [13, 41],
|
|
@@ -26594,23 +26598,23 @@ class MapLeftTextComponent extends StructuresComponent {
|
|
|
26594
26598
|
}),
|
|
26595
26599
|
}),
|
|
26596
26600
|
];
|
|
26597
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_Y] =
|
|
26598
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_X] =
|
|
26599
|
-
this.address =
|
|
26601
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
|
|
26602
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
|
|
26603
|
+
this.address = googleResults.suggestion.value;
|
|
26600
26604
|
this.showMap = true;
|
|
26601
26605
|
this.persist();
|
|
26602
26606
|
}
|
|
26603
|
-
|
|
26604
|
-
|
|
26605
|
-
|
|
26606
|
-
|
|
26607
|
-
|
|
26608
|
-
|
|
26609
|
-
|
|
26610
|
-
|
|
26611
|
-
|
|
26612
|
-
|
|
26613
|
-
|
|
26607
|
+
handleAddressChange(event) {
|
|
26608
|
+
this.googleMapReturnElement = {
|
|
26609
|
+
suggestion: {
|
|
26610
|
+
latlng: {
|
|
26611
|
+
lat: event.geometry.location.lat(),
|
|
26612
|
+
lng: event.geometry.location.lng(),
|
|
26613
|
+
},
|
|
26614
|
+
value: event.name,
|
|
26615
|
+
},
|
|
26616
|
+
};
|
|
26617
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26614
26618
|
}
|
|
26615
26619
|
/**
|
|
26616
26620
|
* Avoid partial map loaded at the initialization
|
|
@@ -26625,7 +26629,7 @@ class MapLeftTextComponent extends StructuresComponent {
|
|
|
26625
26629
|
MapLeftTextComponent.decorators = [
|
|
26626
26630
|
{ type: Component, args: [{
|
|
26627
26631
|
selector: MapLeftTextService.selector(),
|
|
26628
|
-
template: "<div class=\"wb-map-left-text\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"wb-map-left-text__addresses\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TITLE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ADDRESS]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PHONE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_EMAIL]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"wb-map-left-text__social\"\n *ngIf=\"\n contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\n \"\n >\n <div class=\"wb-map-left-text__social__facebook\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK]\">\n <i class=\"fab fa-facebook-f\"></i>\n </div>\n <div class=\"wb-map-left-text__social__twitter\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER]\">\n <i class=\"fab fa-twitter\"></i>\n </div>\n <div class=\"wb-map-left-text__social__pinterest\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST]\">\n <i class=\"fab fa-pinterest-p\"></i>\n </div>\n <div class=\"wb-map-left-text__social__instagram\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\">\n <i class=\"fab fa-instagram\"></i>\n </div>\n </div>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-left-text__container__config\">\n <wb-structure-config
|
|
26632
|
+
template: "<div class=\"wb-map-left-text\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"wb-map-left-text__addresses\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TITLE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ADDRESS]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PHONE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_EMAIL]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"wb-map-left-text__social\"\n *ngIf=\"\n contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\n \"\n >\n <div class=\"wb-map-left-text__social__facebook\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK]\">\n <i class=\"fab fa-facebook-f\"></i>\n </div>\n <div class=\"wb-map-left-text__social__twitter\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER]\">\n <i class=\"fab fa-twitter\"></i>\n </div>\n <div class=\"wb-map-left-text__social__pinterest\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST]\">\n <i class=\"fab fa-pinterest-p\"></i>\n </div>\n <div class=\"wb-map-left-text__social__instagram\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\">\n <i class=\"fab fa-instagram\"></i>\n </div>\n </div>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-left-text__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-left-text__container__config\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_RIGHT_TOP\" [isFullwidth]=\"true\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input-edit{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInputEdit\n (click)=\"myInputEdit.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </wb-structure-config>\n </div>\n <div class=\"wb-map-left-text__cover\"></div>\n <div\n class=\"wb-map-left-text__container__map\"\n leaflet\n [leafletOptions]=\"options\"\n [leafletLayers]=\"layers\"\n [(leafletCenter)]=\"center\"\n (leafletMapReady)=\"onMapReady($event)\"\n ></div>\n </div>\n </div>\n <div class=\"wb-map-left-text__selector\" *ngIf=\"!showMap\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInput\n (click)=\"myInput.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </div>\n </div>\n </div>\n</div>\n"
|
|
26629
26633
|
},] }
|
|
26630
26634
|
];
|
|
26631
26635
|
MapLeftTextComponent.ctorParameters = () => [
|
|
@@ -26640,7 +26644,9 @@ class MapRightTextComponent extends StructuresComponent {
|
|
|
26640
26644
|
super();
|
|
26641
26645
|
this.externalConfigService = externalConfigService;
|
|
26642
26646
|
this.address = '';
|
|
26647
|
+
this.triggerAddress = '';
|
|
26643
26648
|
this.editPlaceMap = null;
|
|
26649
|
+
this.firstTimeTrigger = false;
|
|
26644
26650
|
this.options = {};
|
|
26645
26651
|
this.layers = [];
|
|
26646
26652
|
this.showMap = false;
|
|
@@ -26649,40 +26655,29 @@ class MapRightTextComponent extends StructuresComponent {
|
|
|
26649
26655
|
ngOnInit() {
|
|
26650
26656
|
super.ngOnInit();
|
|
26651
26657
|
if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
|
|
26652
|
-
|
|
26653
|
-
|
|
26654
|
-
|
|
26655
|
-
|
|
26656
|
-
|
|
26658
|
+
this.googleMapReturnElement = {
|
|
26659
|
+
suggestion: {
|
|
26660
|
+
latlng: {
|
|
26661
|
+
lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
|
|
26662
|
+
lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
|
|
26663
|
+
},
|
|
26664
|
+
value: '',
|
|
26657
26665
|
},
|
|
26658
|
-
value: '',
|
|
26659
26666
|
};
|
|
26660
|
-
this.setCoordinateOnPlaces(
|
|
26661
|
-
}
|
|
26662
|
-
}
|
|
26663
|
-
ngAfterViewInit() {
|
|
26664
|
-
if (!this.showMap) {
|
|
26665
|
-
const placesAutocomplete = places({
|
|
26666
|
-
appId: this.externalConfigService.getAlgoliaAppId(),
|
|
26667
|
-
apiKey: this.externalConfigService.getAlgoliaApiKey(),
|
|
26668
|
-
container: this.input.nativeElement,
|
|
26669
|
-
});
|
|
26670
|
-
placesAutocomplete.on('change', (algoliaReturnElement) => {
|
|
26671
|
-
this.setCoordinateOnPlaces(algoliaReturnElement);
|
|
26672
|
-
});
|
|
26667
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26673
26668
|
}
|
|
26674
26669
|
}
|
|
26675
|
-
setCoordinateOnPlaces(
|
|
26670
|
+
setCoordinateOnPlaces(googleResults) {
|
|
26676
26671
|
this.showMap = false;
|
|
26677
26672
|
this.options = {
|
|
26678
26673
|
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
|
|
26679
26674
|
zoom: 18,
|
|
26680
26675
|
zoomControl: false,
|
|
26681
|
-
center: latLng(
|
|
26676
|
+
center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
|
|
26682
26677
|
};
|
|
26683
|
-
this.center = latLng(
|
|
26678
|
+
this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
|
|
26684
26679
|
this.layers = [
|
|
26685
|
-
marker([
|
|
26680
|
+
marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
|
|
26686
26681
|
icon: icon({
|
|
26687
26682
|
iconSize: [25, 41],
|
|
26688
26683
|
iconAnchor: [13, 41],
|
|
@@ -26691,23 +26686,23 @@ class MapRightTextComponent extends StructuresComponent {
|
|
|
26691
26686
|
}),
|
|
26692
26687
|
}),
|
|
26693
26688
|
];
|
|
26694
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_Y] =
|
|
26695
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_X] =
|
|
26696
|
-
this.address =
|
|
26689
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
|
|
26690
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
|
|
26691
|
+
this.address = googleResults.suggestion.value;
|
|
26697
26692
|
this.showMap = true;
|
|
26698
26693
|
this.persist();
|
|
26699
26694
|
}
|
|
26700
|
-
|
|
26701
|
-
|
|
26702
|
-
|
|
26703
|
-
|
|
26704
|
-
|
|
26705
|
-
|
|
26706
|
-
|
|
26707
|
-
|
|
26708
|
-
|
|
26709
|
-
|
|
26710
|
-
|
|
26695
|
+
handleAddressChange(event) {
|
|
26696
|
+
this.googleMapReturnElement = {
|
|
26697
|
+
suggestion: {
|
|
26698
|
+
latlng: {
|
|
26699
|
+
lat: event.geometry.location.lat(),
|
|
26700
|
+
lng: event.geometry.location.lng(),
|
|
26701
|
+
},
|
|
26702
|
+
value: event.name,
|
|
26703
|
+
},
|
|
26704
|
+
};
|
|
26705
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26711
26706
|
}
|
|
26712
26707
|
/**
|
|
26713
26708
|
* Avoid partial map loaded at the initialization
|
|
@@ -26722,7 +26717,7 @@ class MapRightTextComponent extends StructuresComponent {
|
|
|
26722
26717
|
MapRightTextComponent.decorators = [
|
|
26723
26718
|
{ type: Component, args: [{
|
|
26724
26719
|
selector: MapRightTextService.selector(),
|
|
26725
|
-
template: "<div class=\"wb-map-right-text\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"wb-map-right-text__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-right-text__container__config\">\n <wb-structure-config
|
|
26720
|
+
template: "<div class=\"wb-map-right-text\">\n <div class=\"columns is-gapless\">\n <div class=\"column\">\n <div class=\"wb-map-right-text__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-right-text__container__config\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_RIGHT_TOP\" [isFullwidth]=\"true\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input-edit{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInputEdit\n (click)=\"myInputEdit.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </wb-structure-config>\n </div>\n <div class=\"wb-map-right-text__cover\"></div>\n <div\n class=\"wb-map-right-text__container__map\"\n leaflet\n [leafletOptions]=\"options\"\n [leafletLayers]=\"layers\"\n [(leafletCenter)]=\"center\"\n (leafletMapReady)=\"onMapReady($event)\"\n ></div>\n </div>\n </div>\n <div class=\"wb-map-right-text__selector\" *ngIf=\"!showMap\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInput\n (click)=\"myInput.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </div>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-right-text__addresses\">\n <div class=\"wb-map-right-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TITLE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-right-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ADDRESS]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-right-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PHONE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-right-text__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_EMAIL]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"wb-map-right-text__social\"\n *ngIf=\"\n contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\n \"\n >\n <div class=\"wb-map-right-text__social__facebook\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK]\">\n <i class=\"fab fa-facebook-f\"></i>\n </div>\n <div class=\"wb-map-right-text__social__twitter\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER]\">\n <i class=\"fab fa-twitter\"></i>\n </div>\n <div class=\"wb-map-right-text__social__pinterest\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST]\">\n <i class=\"fab fa-pinterest-p\"></i>\n </div>\n <div class=\"wb-map-right-text__social__instagram\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\">\n <i class=\"fab fa-instagram\"></i>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
|
|
26726
26721
|
},] }
|
|
26727
26722
|
];
|
|
26728
26723
|
MapRightTextComponent.ctorParameters = () => [
|
|
@@ -26732,13 +26727,18 @@ MapRightTextComponent.propDecorators = {
|
|
|
26732
26727
|
input: [{ type: ViewChild, args: ['myInput',] }]
|
|
26733
26728
|
};
|
|
26734
26729
|
|
|
26730
|
+
class OpenMapDto {
|
|
26731
|
+
}
|
|
26732
|
+
|
|
26735
26733
|
class MapTextFormComponent extends StructuresComponent {
|
|
26736
26734
|
constructor(apiService, externalConfigService) {
|
|
26737
26735
|
super();
|
|
26738
26736
|
this.apiService = apiService;
|
|
26739
26737
|
this.externalConfigService = externalConfigService;
|
|
26740
26738
|
this.address = '';
|
|
26739
|
+
this.triggerAddress = '';
|
|
26741
26740
|
this.editPlaceMap = null;
|
|
26741
|
+
this.firstTimeTrigger = false;
|
|
26742
26742
|
this.options = {};
|
|
26743
26743
|
this.layers = [];
|
|
26744
26744
|
this.showMap = false;
|
|
@@ -26772,29 +26772,17 @@ class MapTextFormComponent extends StructuresComponent {
|
|
|
26772
26772
|
}
|
|
26773
26773
|
});
|
|
26774
26774
|
}
|
|
26775
|
-
|
|
26776
|
-
if (!this.showMap) {
|
|
26777
|
-
const placesAutocomplete = places({
|
|
26778
|
-
appId: this.externalConfigService.getAlgoliaAppId(),
|
|
26779
|
-
apiKey: this.externalConfigService.getAlgoliaApiKey(),
|
|
26780
|
-
container: this.input.nativeElement,
|
|
26781
|
-
});
|
|
26782
|
-
placesAutocomplete.on('change', (algoliaReturnElement) => {
|
|
26783
|
-
this.setCoordinateOnPlaces(algoliaReturnElement);
|
|
26784
|
-
});
|
|
26785
|
-
}
|
|
26786
|
-
}
|
|
26787
|
-
setCoordinateOnPlaces(algoliaReturnElement) {
|
|
26775
|
+
setCoordinateOnPlaces(googleResults) {
|
|
26788
26776
|
this.showMap = false;
|
|
26789
26777
|
this.options = {
|
|
26790
|
-
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom:
|
|
26778
|
+
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
|
|
26791
26779
|
zoom: 18,
|
|
26792
26780
|
zoomControl: false,
|
|
26793
|
-
center: latLng(
|
|
26781
|
+
center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
|
|
26794
26782
|
};
|
|
26795
|
-
this.center = latLng(
|
|
26783
|
+
this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
|
|
26796
26784
|
this.layers = [
|
|
26797
|
-
marker([
|
|
26785
|
+
marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
|
|
26798
26786
|
icon: icon({
|
|
26799
26787
|
iconSize: [25, 41],
|
|
26800
26788
|
iconAnchor: [13, 41],
|
|
@@ -26803,23 +26791,32 @@ class MapTextFormComponent extends StructuresComponent {
|
|
|
26803
26791
|
}),
|
|
26804
26792
|
}),
|
|
26805
26793
|
];
|
|
26806
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_Y] =
|
|
26807
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_X] =
|
|
26808
|
-
this.address =
|
|
26794
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
|
|
26795
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
|
|
26796
|
+
this.address = googleResults.suggestion.value;
|
|
26809
26797
|
this.showMap = true;
|
|
26810
26798
|
this.persist();
|
|
26811
26799
|
}
|
|
26812
|
-
|
|
26813
|
-
|
|
26814
|
-
|
|
26815
|
-
|
|
26816
|
-
|
|
26817
|
-
|
|
26818
|
-
|
|
26819
|
-
|
|
26820
|
-
|
|
26821
|
-
|
|
26822
|
-
|
|
26800
|
+
handleAddressChange(event) {
|
|
26801
|
+
this.googleMapReturnElement = {
|
|
26802
|
+
suggestion: {
|
|
26803
|
+
latlng: {
|
|
26804
|
+
lat: event.geometry.location.lat(),
|
|
26805
|
+
lng: event.geometry.location.lng(),
|
|
26806
|
+
},
|
|
26807
|
+
value: event.name,
|
|
26808
|
+
},
|
|
26809
|
+
};
|
|
26810
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26811
|
+
}
|
|
26812
|
+
/**
|
|
26813
|
+
* Avoid partial map loaded at the initialization
|
|
26814
|
+
* @param map
|
|
26815
|
+
*/
|
|
26816
|
+
onMapReady(map) {
|
|
26817
|
+
setTimeout(() => {
|
|
26818
|
+
map.invalidateSize();
|
|
26819
|
+
}, 0);
|
|
26823
26820
|
}
|
|
26824
26821
|
selectThisForm() {
|
|
26825
26822
|
if (this.selectedValue === null) {
|
|
@@ -26831,20 +26828,11 @@ class MapTextFormComponent extends StructuresComponent {
|
|
|
26831
26828
|
this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
|
|
26832
26829
|
this.persist();
|
|
26833
26830
|
}
|
|
26834
|
-
/**
|
|
26835
|
-
* Avoid partial map loaded at the initialization
|
|
26836
|
-
* @param map
|
|
26837
|
-
*/
|
|
26838
|
-
onMapReady(map) {
|
|
26839
|
-
setTimeout(() => {
|
|
26840
|
-
map.invalidateSize();
|
|
26841
|
-
}, 0);
|
|
26842
|
-
}
|
|
26843
26831
|
}
|
|
26844
26832
|
MapTextFormComponent.decorators = [
|
|
26845
26833
|
{ type: Component, args: [{
|
|
26846
26834
|
selector: MapTextFormService.selector(),
|
|
26847
|
-
template: "<div class=\"wb-map-text-form\">\n <div class=\"wb-map-text-form__container__config\" *ngIf=\"showMap\">\n <wb-structure-config
|
|
26835
|
+
template: "<div class=\"wb-map-text-form\">\n <div class=\"wb-map-text-form__container__config\" *ngIf=\"showMap\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_LEFT_TOP\" [isFullwidth]=\"true\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input-edit{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInputEdit\n (click)=\"myInputEdit.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </wb-structure-config>\n </div>\n <div class=\"wb-map-text-form__selector\" *ngIf=\"!showMap\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInput\n (click)=\"myInput.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </div>\n <div class=\"columns is-gapless\" *ngIf=\"showMap\">\n <div class=\"column\">\n <div class=\"wb-map-text-form__addresses\">\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_ADDRESS] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-text-form__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ADDRESS]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_PHONE] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-text-form__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PHONE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n <div class=\"columns is-gapless\">\n <div class=\"column is-1\">\n <wb-structure-config-font\n [(value)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL]\"\n [white]=\"false\"\n [isSmall]=\"true\"\n [withImage]=\"false\"\n (valueChange)=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_ICON_EMAIL] = $event; persist()\"\n ></wb-structure-config-font>\n </div>\n <div class=\"column\">\n <div class=\"wb-map-text-form__address\">\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_EMAIL]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n </div>\n </div>\n <div\n class=\"wb-map-text-form__social\"\n *ngIf=\"\n contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST] ||\n contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\n \"\n >\n <div class=\"wb-map-text-form__social__facebook\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_FACEBOOK]\">\n <i class=\"fab fa-facebook-f\"></i>\n </div>\n <div class=\"wb-map-text-form__social__twitter\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TWITTER]\">\n <i class=\"fab fa-twitter\"></i>\n </div>\n <div class=\"wb-map-text-form__social__pinterest\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_PINTEREST]\">\n <i class=\"fab fa-pinterest-p\"></i>\n </div>\n <div class=\"wb-map-text-form__social__instagram\" *ngIf=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_INSTAGRAM]\">\n <i class=\"fab fa-instagram\"></i>\n </div>\n </div>\n <div class=\"wb-map-text-form__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-text-form__cover\"></div>\n <div\n class=\"wb-map-text-form__container__map\"\n leaflet\n [leafletOptions]=\"options\"\n [leafletLayers]=\"layers\"\n [(leafletCenter)]=\"center\"\n (leafletMapReady)=\"onMapReady($event)\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"column\">\n <div *ngIf=\"selectedDetailForm.length === 0\">\n <div *ngIf=\"forms.length === 0\" class=\"wb-map-text-form__loader\">\n <wb-loader></wb-loader>\n </div>\n <div class=\"wb-map-text-form__selector\" *ngIf=\"forms.length > 0\">\n <wb-structure-select\n [selectedValue]=\"selectedValue\"\n [forms]=\"forms\"\n (changed)=\"selectedValue = $event; selectThisForm()\"\n ></wb-structure-select>\n </div>\n </div>\n <div *ngIf=\"selectedDetailForm.length > 0\" class=\"wb-map-text-form__container-form\">\n <div class=\"wb-map-text-form__container-form__editor\">\n <div>\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TITLE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n <div>\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_CONTENT]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n <div class=\"wb-map-text-form__container-form__content\">\n <div *ngFor=\"let select of selectedDetailForm\">\n <p [innerHTML]=\"select.title\"></p>\n <p>{{ select.type | answerPipe | translate }}</p>\n </div>\n <div>\n <wb-structure-select\n [selectedValue]=\"selectedValue\"\n [forms]=\"forms\"\n (changed)=\"selectedValue = $event; selectThisForm()\"\n ></wb-structure-select>\n \n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
|
|
26848
26836
|
},] }
|
|
26849
26837
|
];
|
|
26850
26838
|
MapTextFormComponent.ctorParameters = () => [
|
|
@@ -26860,7 +26848,9 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
|
|
|
26860
26848
|
super();
|
|
26861
26849
|
this.apiService = apiService;
|
|
26862
26850
|
this.address = '';
|
|
26851
|
+
this.triggerAddress = '';
|
|
26863
26852
|
this.editPlaceMap = null;
|
|
26853
|
+
this.firstTimeTrigger = false;
|
|
26864
26854
|
this.options = {};
|
|
26865
26855
|
this.layers = [];
|
|
26866
26856
|
this.showMap = false;
|
|
@@ -26883,27 +26873,17 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
|
|
|
26883
26873
|
}
|
|
26884
26874
|
});
|
|
26885
26875
|
}
|
|
26886
|
-
|
|
26887
|
-
const placesAutocomplete = places({
|
|
26888
|
-
appId: 'pl9OI1NPY62Y',
|
|
26889
|
-
apiKey: '290e5a0e33e751c85c36690d502991fc',
|
|
26890
|
-
container: this.input.nativeElement,
|
|
26891
|
-
});
|
|
26892
|
-
placesAutocomplete.on('change', (algoliaReturnElement) => {
|
|
26893
|
-
this.setCoordinateOnPlaces(algoliaReturnElement);
|
|
26894
|
-
});
|
|
26895
|
-
}
|
|
26896
|
-
setCoordinateOnPlaces(algoliaReturnElement) {
|
|
26876
|
+
setCoordinateOnPlaces(googleResults) {
|
|
26897
26877
|
this.showMap = false;
|
|
26898
26878
|
this.options = {
|
|
26899
|
-
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom:
|
|
26879
|
+
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
|
|
26900
26880
|
zoom: 18,
|
|
26901
26881
|
zoomControl: false,
|
|
26902
|
-
center: latLng(
|
|
26882
|
+
center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
|
|
26903
26883
|
};
|
|
26904
|
-
this.center = latLng(
|
|
26884
|
+
this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
|
|
26905
26885
|
this.layers = [
|
|
26906
|
-
marker([
|
|
26886
|
+
marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
|
|
26907
26887
|
icon: icon({
|
|
26908
26888
|
iconSize: [25, 41],
|
|
26909
26889
|
iconAnchor: [13, 41],
|
|
@@ -26912,23 +26892,32 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
|
|
|
26912
26892
|
}),
|
|
26913
26893
|
}),
|
|
26914
26894
|
];
|
|
26915
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_Y] =
|
|
26916
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_X] =
|
|
26917
|
-
this.address =
|
|
26895
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
|
|
26896
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
|
|
26897
|
+
this.address = googleResults.suggestion.value;
|
|
26918
26898
|
this.showMap = true;
|
|
26919
26899
|
this.persist();
|
|
26920
26900
|
}
|
|
26921
|
-
|
|
26922
|
-
|
|
26923
|
-
|
|
26924
|
-
|
|
26925
|
-
|
|
26926
|
-
|
|
26927
|
-
|
|
26928
|
-
|
|
26929
|
-
|
|
26930
|
-
|
|
26931
|
-
|
|
26901
|
+
handleAddressChange(event) {
|
|
26902
|
+
this.googleMapReturnElement = {
|
|
26903
|
+
suggestion: {
|
|
26904
|
+
latlng: {
|
|
26905
|
+
lat: event.geometry.location.lat(),
|
|
26906
|
+
lng: event.geometry.location.lng(),
|
|
26907
|
+
},
|
|
26908
|
+
value: event.name,
|
|
26909
|
+
},
|
|
26910
|
+
};
|
|
26911
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
26912
|
+
}
|
|
26913
|
+
/**
|
|
26914
|
+
* Avoid partial map loaded at the initialization
|
|
26915
|
+
* @param map
|
|
26916
|
+
*/
|
|
26917
|
+
onMapReady(map) {
|
|
26918
|
+
setTimeout(() => {
|
|
26919
|
+
map.invalidateSize();
|
|
26920
|
+
}, 0);
|
|
26932
26921
|
}
|
|
26933
26922
|
selectThisForm() {
|
|
26934
26923
|
if (this.selectedValue === null) {
|
|
@@ -26940,20 +26929,11 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
|
|
|
26940
26929
|
this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
|
|
26941
26930
|
this.persist();
|
|
26942
26931
|
}
|
|
26943
|
-
/**
|
|
26944
|
-
* Avoid partial map loaded at the initialization
|
|
26945
|
-
* @param map
|
|
26946
|
-
*/
|
|
26947
|
-
onMapReady(map) {
|
|
26948
|
-
setTimeout(() => {
|
|
26949
|
-
map.invalidateSize();
|
|
26950
|
-
}, 0);
|
|
26951
|
-
}
|
|
26952
26932
|
}
|
|
26953
26933
|
MapBackgroundFormLeftComponent.decorators = [
|
|
26954
26934
|
{ type: Component, args: [{
|
|
26955
26935
|
selector: MapBackgroundFormLeftService.selector(),
|
|
26956
|
-
template: "<div class=\"wb-map-background-form-left\">\n <div class=\"wb-map-background-form-left__container__config\" *ngIf=\"showMap\">\n <wb-structure-config
|
|
26936
|
+
template: "<div class=\"wb-map-background-form-left\">\n <div class=\"wb-map-background-form-left__container__config\" *ngIf=\"showMap\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_RIGHT_TOP\" [isFullwidth]=\"true\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input-edit{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInputEdit\n (click)=\"myInputEdit.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </wb-structure-config>\n </div>\n <div class=\"wb-map-background-form-left__selector\" *ngIf=\"!showMap\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInput\n (click)=\"myInput.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </div>\n <div class=\"columns is-gapless\" *ngIf=\"showMap\">\n <div class=\"column\">\n <div *ngIf=\"selectedDetailForm.length === 0\">\n <div *ngIf=\"forms.length === 0\" class=\"wb-map-background-form-left__loader\">\n <wb-loader></wb-loader>\n </div>\n <div class=\"wb-map-background-form-left__selector-form\" *ngIf=\"forms.length > 0\">\n <wb-structure-select\n [selectedValue]=\"selectedValue\"\n [forms]=\"forms\"\n (changed)=\"selectedValue = $event; selectThisForm()\"\n ></wb-structure-select>\n </div>\n </div>\n <div *ngIf=\"selectedDetailForm.length > 0\" class=\"wb-map-background-form-left__container-form\">\n <div class=\"wb-map-background-form-left__container-form__editor\">\n <div>\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TITLE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n <div>\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_CONTENT]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n <div class=\"wb-map-background-form-left__container-form__content\">\n <div *ngFor=\"let select of selectedDetailForm\">\n <p [innerHTML]=\"select.title\"></p>\n <p>{{ select.type | answerPipe | translate }}</p>\n </div>\n <div>\n <wb-structure-select\n [selectedValue]=\"selectedValue\"\n [forms]=\"forms\"\n (changed)=\"selectedValue = $event; selectThisForm()\"\n ></wb-structure-select>\n \n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n <div class=\"wb-map-background-form-left__container\">\n <div>\n <div class=\"wb-map-background-form-left__cover\"></div>\n <div\n class=\"wb-map-background-form-left__container__map\"\n leaflet\n [leafletOptions]=\"options\"\n [leafletLayers]=\"layers\"\n [(leafletCenter)]=\"center\"\n (leafletMapReady)=\"onMapReady($event)\"\n ></div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
|
|
26957
26937
|
},] }
|
|
26958
26938
|
];
|
|
26959
26939
|
MapBackgroundFormLeftComponent.ctorParameters = () => [
|
|
@@ -26968,7 +26948,9 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
|
|
|
26968
26948
|
super();
|
|
26969
26949
|
this.apiService = apiService;
|
|
26970
26950
|
this.address = '';
|
|
26951
|
+
this.triggerAddress = '';
|
|
26971
26952
|
this.editPlaceMap = null;
|
|
26953
|
+
this.firstTimeTrigger = false;
|
|
26972
26954
|
this.options = {};
|
|
26973
26955
|
this.layers = [];
|
|
26974
26956
|
this.showMap = false;
|
|
@@ -26991,27 +26973,17 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
|
|
|
26991
26973
|
}
|
|
26992
26974
|
});
|
|
26993
26975
|
}
|
|
26994
|
-
|
|
26995
|
-
const placesAutocomplete = places({
|
|
26996
|
-
appId: 'pl9OI1NPY62Y',
|
|
26997
|
-
apiKey: '290e5a0e33e751c85c36690d502991fc',
|
|
26998
|
-
container: this.input.nativeElement,
|
|
26999
|
-
});
|
|
27000
|
-
placesAutocomplete.on('change', (algoliaReturnElement) => {
|
|
27001
|
-
this.setCoordinateOnPlaces(algoliaReturnElement);
|
|
27002
|
-
});
|
|
27003
|
-
}
|
|
27004
|
-
setCoordinateOnPlaces(algoliaReturnElement) {
|
|
26976
|
+
setCoordinateOnPlaces(googleResults) {
|
|
27005
26977
|
this.showMap = false;
|
|
27006
26978
|
this.options = {
|
|
27007
|
-
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom:
|
|
26979
|
+
layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
|
|
27008
26980
|
zoom: 18,
|
|
27009
26981
|
zoomControl: false,
|
|
27010
|
-
center: latLng(
|
|
26982
|
+
center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
|
|
27011
26983
|
};
|
|
27012
|
-
this.center = latLng(
|
|
26984
|
+
this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
|
|
27013
26985
|
this.layers = [
|
|
27014
|
-
marker([
|
|
26986
|
+
marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
|
|
27015
26987
|
icon: icon({
|
|
27016
26988
|
iconSize: [25, 41],
|
|
27017
26989
|
iconAnchor: [13, 41],
|
|
@@ -27020,23 +26992,32 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
|
|
|
27020
26992
|
}),
|
|
27021
26993
|
}),
|
|
27022
26994
|
];
|
|
27023
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_Y] =
|
|
27024
|
-
this.contentBlock[this.FORM_NAME_COORDINATE_X] =
|
|
27025
|
-
this.address =
|
|
26995
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
|
|
26996
|
+
this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
|
|
26997
|
+
this.address = googleResults.suggestion.value;
|
|
27026
26998
|
this.showMap = true;
|
|
27027
26999
|
this.persist();
|
|
27028
27000
|
}
|
|
27029
|
-
|
|
27030
|
-
|
|
27031
|
-
|
|
27032
|
-
|
|
27033
|
-
|
|
27034
|
-
|
|
27035
|
-
|
|
27036
|
-
|
|
27037
|
-
|
|
27038
|
-
|
|
27039
|
-
|
|
27001
|
+
handleAddressChange(event) {
|
|
27002
|
+
this.googleMapReturnElement = {
|
|
27003
|
+
suggestion: {
|
|
27004
|
+
latlng: {
|
|
27005
|
+
lat: event.geometry.location.lat(),
|
|
27006
|
+
lng: event.geometry.location.lng(),
|
|
27007
|
+
},
|
|
27008
|
+
value: event.name,
|
|
27009
|
+
},
|
|
27010
|
+
};
|
|
27011
|
+
this.setCoordinateOnPlaces(this.googleMapReturnElement);
|
|
27012
|
+
}
|
|
27013
|
+
/**
|
|
27014
|
+
* Avoid partial map loaded at the initialization
|
|
27015
|
+
* @param map
|
|
27016
|
+
*/
|
|
27017
|
+
onMapReady(map) {
|
|
27018
|
+
setTimeout(() => {
|
|
27019
|
+
map.invalidateSize();
|
|
27020
|
+
}, 0);
|
|
27040
27021
|
}
|
|
27041
27022
|
selectThisForm() {
|
|
27042
27023
|
if (this.selectedValue === null) {
|
|
@@ -27048,20 +27029,11 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
|
|
|
27048
27029
|
this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
|
|
27049
27030
|
this.persist();
|
|
27050
27031
|
}
|
|
27051
|
-
/**
|
|
27052
|
-
* Avoid partial map loaded at the initialization
|
|
27053
|
-
* @param map
|
|
27054
|
-
*/
|
|
27055
|
-
onMapReady(map) {
|
|
27056
|
-
setTimeout(() => {
|
|
27057
|
-
map.invalidateSize();
|
|
27058
|
-
}, 0);
|
|
27059
|
-
}
|
|
27060
27032
|
}
|
|
27061
27033
|
MapBackgroundFormRightComponent.decorators = [
|
|
27062
27034
|
{ type: Component, args: [{
|
|
27063
27035
|
selector: MapBackgroundFormRightService.selector(),
|
|
27064
|
-
template: "<div class=\"wb-map-background-form-right\">\n <div class=\"wb-map-background-form-right__container__config\" *ngIf=\"showMap\">\n <wb-structure-config
|
|
27036
|
+
template: "<div class=\"wb-map-background-form-right\">\n <div class=\"wb-map-background-form-right__container__config\" *ngIf=\"showMap\">\n <wb-structure-config [blockUUID]=\"uuid\" [position]=\"TYPE_CONFIG_POSITION_LEFT_TOP\" [isFullwidth]=\"true\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input-edit{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInputEdit\n (click)=\"myInputEdit.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </wb-structure-config>\n </div>\n <div class=\"wb-map-background-form-right__selector\" *ngIf=\"!showMap\">\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input\n id=\"address-input{{ uuid }}\"\n type=\"text\"\n [(ngModel)]=\"address\"\n #myInput\n (click)=\"myInput.select()\"\n ngx-google-places-autocomplete\n (onAddressChange)=\"handleAddressChange($event)\"\n />\n </div>\n <div class=\"columns is-gapless\" *ngIf=\"showMap\">\n <div class=\"column\">\n <div class=\"wb-map-background-form-right__container\">\n <div *ngIf=\"showMap\">\n <div class=\"wb-map-background-form-right__cover\"></div>\n <div\n class=\"wb-map-background-form-right__container__map\"\n leaflet\n [leafletOptions]=\"options\"\n [leafletLayers]=\"layers\"\n [(leafletCenter)]=\"center\"\n (leafletMapReady)=\"onMapReady($event)\"\n ></div>\n </div>\n </div>\n </div>\n <div class=\"column\">\n <div *ngIf=\"selectedDetailForm.length === 0\">\n <div *ngIf=\"forms.length === 0\" class=\"wb-map-background-form-right__loader\">\n <wb-loader></wb-loader>\n </div>\n <div class=\"wb-map-background-form-right__selector\" *ngIf=\"forms.length > 0\">\n <wb-structure-select\n [selectedValue]=\"selectedValue\"\n [forms]=\"forms\"\n (changed)=\"selectedValue = $event; selectThisForm()\"\n ></wb-structure-select>\n </div>\n </div>\n <div *ngIf=\"selectedDetailForm.length > 0\" class=\"wb-map-background-form-right__container-form\">\n <div class=\"wb-map-background-form-right__container-form__editor\">\n <div>\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_TITLE]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n <div>\n <wb-editorjs\n [(content)]=\"contents[BASE_BLOCK_CONTENT][FORM_NAME_CONTENT]\"\n (contentChange)=\"persist()\"\n [placeholder]=\"'wb.shared.components.quill.1' | translate\"\n >\n </wb-editorjs>\n </div>\n </div>\n <div class=\"wb-map-background-form-right__container-form__content\">\n <div *ngFor=\"let select of selectedDetailForm\">\n <p [innerHTML]=\"select.title\"></p>\n <p>{{ select.type | answerPipe | translate }}</p>\n </div>\n <div>\n <wb-structure-select\n [selectedValue]=\"selectedValue\"\n [forms]=\"forms\"\n (changed)=\"selectedValue = $event; selectThisForm()\"\n ></wb-structure-select>\n \n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
|
|
27065
27037
|
},] }
|
|
27066
27038
|
];
|
|
27067
27039
|
MapBackgroundFormRightComponent.ctorParameters = () => [
|
|
@@ -29963,6 +29935,7 @@ StructuresModule.decorators = [
|
|
|
29963
29935
|
imports: [
|
|
29964
29936
|
SharedModule,
|
|
29965
29937
|
MonacoEditorModule,
|
|
29938
|
+
GooglePlaceModule,
|
|
29966
29939
|
QuillModule,
|
|
29967
29940
|
LeafletModule,
|
|
29968
29941
|
NwbCommonModule,
|