@wizishop/wizi-block 4.2.31-beta → 4.2.34-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.
Files changed (60) hide show
  1. package/bundles/wizishop-wizi-block.umd.js +337 -379
  2. package/bundles/wizishop-wizi-block.umd.js.map +1 -1
  3. package/bundles/wizishop-wizi-block.umd.min.js +1 -1
  4. package/bundles/wizishop-wizi-block.umd.min.js.map +1 -1
  5. package/esm2015/lib/services/blocks/images/images-banner.service.js +2 -2
  6. package/esm2015/lib/services/blocks/images/images-simple.service.js +2 -2
  7. package/esm2015/lib/services/blocks/text-backgrounds/text-backgrounds-simple.service.js +2 -2
  8. package/esm2015/lib/services/blocks/text-backgrounds/text-backgrounds-with-banner.service.js +2 -2
  9. package/esm2015/lib/services/blocks/text-backgrounds/text-backgrounds-with-txt.service.js +2 -2
  10. package/esm2015/lib/shared/components/editorjs/editorjs.component.js +21 -12
  11. package/esm2015/lib/shared/components/editorjs/tools/inline/bold-tool.component.js +1 -1
  12. package/esm2015/lib/shared/components/editorjs/tools/inline/capitalize-tool.component.js +1 -1
  13. package/esm2015/lib/shared/components/editorjs/tools/inline/italic-tool.component.js +1 -1
  14. package/esm2015/lib/shared/components/editorjs/tools/inline/link-tool.component.js +1 -1
  15. package/esm2015/lib/shared/components/editorjs/tools/inline/strike-tool.component.js +1 -1
  16. package/esm2015/lib/shared/components/editorjs/tools/inline/subscript-tool.component.js +1 -1
  17. package/esm2015/lib/shared/components/editorjs/tools/inline/superscript-tool.component.js +1 -1
  18. package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/inline-style-tool.component.js +110 -64
  19. package/esm2015/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.js +1 -18
  20. package/esm2015/lib/shared/components/editorjs/tools/inline/underline-tool.component.js +1 -1
  21. package/esm2015/lib/shared/components/editorjs/tools/paragraph/ordered-list-tool.component.js +2 -2
  22. package/esm2015/lib/shared/components/editorjs/tools/paragraph/quote-tool.component.js +2 -2
  23. package/esm2015/lib/shared/components/editorjs/tools/paragraph/text-align-tool.component.js +2 -2
  24. package/esm2015/lib/shared/components/editorjs/tools/paragraph/text-type-tool.component.js +2 -2
  25. package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/paragraph-style-tool.component.js +2 -18
  26. package/esm2015/lib/shared/components/editorjs/tools/paragraph/tool-type/text-edition.component.js +15 -17
  27. package/esm2015/lib/shared/components/editorjs/tools/paragraph/unordered-list-tool.component.js +2 -2
  28. package/esm2015/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.js +8 -1
  29. package/esm2015/lib/shared/components/quill/quill.component.js +2 -1
  30. package/esm2015/lib/structures/map/background-form-left/map-background-form-left.component.js +32 -41
  31. package/esm2015/lib/structures/map/background-form-right/map-background-form-right.component.js +32 -41
  32. package/esm2015/lib/structures/map/fullpage/map-fullpage.component.js +32 -43
  33. package/esm2015/lib/structures/map/left-text/map-left-text.component.js +30 -41
  34. package/esm2015/lib/structures/map/right-text/map-right-text.component.js +30 -41
  35. package/esm2015/lib/structures/map/text-form/map-text-form.component.js +32 -43
  36. package/esm2015/lib/structures/structures.module.js +3 -1
  37. package/fesm2015/wizishop-wizi-block.js +347 -370
  38. package/fesm2015/wizishop-wizi-block.js.map +1 -1
  39. package/lib/shared/components/editorjs/editorjs.component.d.ts +1 -0
  40. package/lib/shared/components/editorjs/tools/inline/bold-tool.component.d.ts +1 -1
  41. package/lib/shared/components/editorjs/tools/inline/capitalize-tool.component.d.ts +1 -1
  42. package/lib/shared/components/editorjs/tools/inline/italic-tool.component.d.ts +1 -1
  43. package/lib/shared/components/editorjs/tools/inline/link-tool.component.d.ts +1 -1
  44. package/lib/shared/components/editorjs/tools/inline/strike-tool.component.d.ts +1 -1
  45. package/lib/shared/components/editorjs/tools/inline/subscript-tool.component.d.ts +1 -1
  46. package/lib/shared/components/editorjs/tools/inline/superscript-tool.component.d.ts +1 -1
  47. package/lib/shared/components/editorjs/tools/inline/tool-type/inline-style-tool.component.d.ts +2 -0
  48. package/lib/shared/components/editorjs/tools/inline/tool-type/text-tool.component.d.ts +0 -1
  49. package/lib/shared/components/editorjs/tools/inline/underline-tool.component.d.ts +1 -1
  50. package/lib/shared/components/editorjs/tools/paragraph/tool-type/paragraph-style-tool.component.d.ts +0 -1
  51. package/lib/shared/components/editorjs/tools/utils/editorjs-tool.component.d.ts +2 -0
  52. package/lib/structures/map/background-form-left/map-background-form-left.component.d.ts +8 -6
  53. package/lib/structures/map/background-form-right/map-background-form-right.component.d.ts +8 -6
  54. package/lib/structures/map/fullpage/map-fullpage.component.d.ts +7 -5
  55. package/lib/structures/map/left-text/map-left-text.component.d.ts +7 -5
  56. package/lib/structures/map/right-text/map-right-text.component.d.ts +7 -5
  57. package/lib/structures/map/text-form/map-text-form.component.d.ts +8 -6
  58. package/package.json +1 -1
  59. package/wizi-block.scss +35 -30
  60. package/wizishop-wizi-block.metadata.json +1 -1
@@ -23,10 +23,13 @@ import { NgScrollbarModule } from 'ngx-scrollbar';
23
23
  import { __awaiter } from 'tslib';
24
24
  import EditorJS from '@editorjs/editorjs';
25
25
  import iro from '@jaames/iro';
26
+ import { basicSetup, EditorView } from 'codemirror';
27
+ import { EditorState } from '@codemirror/state';
28
+ import { html } from '@codemirror/lang-html';
26
29
  import { MonacoEditorModule } from 'ngx-monaco-editor';
27
30
  import { tileLayer, latLng, marker, icon } from 'leaflet';
28
- import places from 'places.js';
29
31
  import { LeafletModule } from '@asymmetrik/ngx-leaflet';
32
+ import { GooglePlaceModule } from 'ngx-google-places-autocomplete';
30
33
  import { ColorPickerModule } from 'ngx-color-picker';
31
34
 
32
35
  class MediaConnectorService {
@@ -3123,7 +3126,7 @@ class ImagesSimpleService {
3123
3126
  'wb.blocks.FormContentDto.117',
3124
3127
  ], ['0', '0.25', '0.5', '1']);
3125
3128
  imgSimpleFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
3126
- const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.forms.FormsContentDto.27', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
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');
3127
3130
  imgSimpleFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
3128
3131
  return imgSimpleFormDto;
3129
3132
  }
@@ -4113,7 +4116,7 @@ class TextBackgroundsSimpleService {
4113
4116
  'wb.blocks.FormContentDto.117',
4114
4117
  ], ['0', '0.25', '0.5', '1']);
4115
4118
  TextBackgroundsSimpleFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
4116
- const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.forms.FormsContentDto.27', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
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');
4117
4120
  TextBackgroundsSimpleFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
4118
4121
  return TextBackgroundsSimpleFormDto;
4119
4122
  }
@@ -4188,7 +4191,7 @@ class TextBackgroundsWithTxtService {
4188
4191
  'wb.blocks.FormContentDto.117',
4189
4192
  ], ['0', '0.25', '0.5', '1']);
4190
4193
  formsDto.forms.push(parallaxSpeedImgSimpleContentDto);
4191
- const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.forms.FormsContentDto.27', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
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');
4192
4195
  formsDto.forms.push(parallaxInvertedImgSimpleContentDto);
4193
4196
  return formsDto;
4194
4197
  }
@@ -4263,7 +4266,7 @@ class TextBackgroundsWithBannerService {
4263
4266
  'wb.blocks.FormContentDto.117',
4264
4267
  ], ['0', '0.25', '0.5', '1']);
4265
4268
  formsDto.forms.push(parallaxSpeedImgSimpleContentDto);
4266
- const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.forms.FormsContentDto.27', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
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');
4267
4270
  formsDto.forms.push(parallaxInvertedImgSimpleContentDto);
4268
4271
  const colorContentDto = new FormsContentDto(FORM_NAME_COLOR, 'wb.blocks.FormContentDto.112', FORM_TYPE_COLOR, content[FORM_NAME_COLOR], '#122231', '');
4269
4272
  formsDto.forms.push(colorContentDto);
@@ -5683,7 +5686,7 @@ class ImagesBannerService {
5683
5686
  'wb.blocks.FormContentDto.117',
5684
5687
  ], ['0', '0.25', '0.5', '1']);
5685
5688
  imgBannerFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
5686
- const parallaxInvertedImgSimpleContentDto = new FormsContentDto(FORM_NAME_PARALLAX_INVERTED, 'wb.forms.FormsContentDto.27', FORM_TYPE_CHECKBOX, content[FORM_NAME_PARALLAX_INVERTED], '', '', [], [], [true, false], false, 'wb.forms.FormsContentDto.28');
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');
5687
5690
  imgBannerFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
5688
5691
  return imgBannerFormDto;
5689
5692
  }
@@ -9611,6 +9614,7 @@ class QuillComponent {
9611
9614
  },
9612
9615
  clipboard: {
9613
9616
  matchers: [['BR', this.lineBreakMatcher]],
9617
+ matchVisual: false,
9614
9618
  },
9615
9619
  keyboard: {
9616
9620
  bindings: {
@@ -18648,6 +18652,13 @@ class EditorJSTool {
18648
18652
  const selection = this.currentSelection ? this.currentSelection : this.getSelection();
18649
18653
  return selection.anchorNode.parentElement.closest('.editorJs');
18650
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
+ }
18651
18662
  clear() {
18652
18663
  resetBlockFocus(this.parentEditor);
18653
18664
  }
@@ -18728,29 +18739,28 @@ class InlineStyleTool extends EditorJSTool {
18728
18739
  : anchorNode.parentElement;
18729
18740
  const sameSelection = container && container.innerText === selection.toString();
18730
18741
  yield this.saveInlineSelection(container, true);
18731
- try {
18732
- // Link delete exception
18733
- if (this.linkDeletion) {
18734
- yield this.replaceLink(selection, this.hasStyle(container));
18742
+ console.log('=== inline tool execCommandStyle method ===');
18743
+ console.log(this.hasStyle(container));
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);
18735
18755
  }
18736
18756
  else {
18737
- if (sameSelection &&
18738
- !this.isContainer(this.textContainers, container) &&
18739
- this.hasStyle(container) &&
18740
- selection.toString() === this.hasStyle(container).innerText) {
18741
- yield this.updateSelection(selection, this.hasStyle(container), action, this.textContainers);
18742
- }
18743
- else {
18744
- yield this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers);
18745
- }
18746
- }
18747
- yield this.cleanupContainer(selection, container, true);
18748
- if (this.modifiedContent) {
18749
- yield this.resetInlineSelection(container, true);
18757
+ console.log('-> replace selection');
18758
+ yield this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers);
18750
18759
  }
18751
18760
  }
18752
- catch (error) {
18753
- console.warn('Inline Tool Error : ' + error);
18761
+ yield this.cleanupContainer(selection, container, true);
18762
+ if (this.modifiedContent) {
18763
+ yield this.resetInlineSelection(container, true);
18754
18764
  }
18755
18765
  });
18756
18766
  }
@@ -18794,16 +18804,17 @@ class InlineStyleTool extends EditorJSTool {
18794
18804
  replaceSelection(container, action, selection, containers) {
18795
18805
  var _a;
18796
18806
  return __awaiter(this, void 0, void 0, function* () {
18797
- let parentContainer = this.hasStyle(container);
18798
18807
  const focusNode = selection.focusNode;
18799
18808
  let offsetContainer = focusNode.nodeType !== Node.TEXT_NODE && focusNode.nodeType !== Node.COMMENT_NODE
18800
18809
  ? focusNode
18801
18810
  : focusNode.parentElement;
18811
+ let parentContainer = this.hasStyle(container);
18802
18812
  let offsetParentContainer = this.hasStyle(offsetContainer);
18803
18813
  if (parentContainer &&
18804
18814
  parentContainer === offsetParentContainer &&
18805
18815
  ((parentContainer.children.length > 0 && parentContainer.innerText !== parentContainer.children[0].textContent) ||
18806
18816
  parentContainer.innerText !== selection.toString())) {
18817
+ console.log('if');
18807
18818
  const range = this.getRangeObject(selection);
18808
18819
  const currentFragment = range.extractContents();
18809
18820
  const currentElement = document.createElement('span');
@@ -18845,14 +18856,19 @@ class InlineStyleTool extends EditorJSTool {
18845
18856
  newElement.appendChild(preFragment);
18846
18857
  parentContainer.parentElement.insertBefore(currentElementToAppend, parentContainer);
18847
18858
  parentContainer.parentElement.insertBefore(newElement, currentElementToAppend);
18859
+ if (!parentContainer.textContent || parentContainer.textContent.length === 0) {
18860
+ parentContainer.parentElement.removeChild(parentContainer);
18861
+ }
18848
18862
  selection.selectAllChildren(currentElementToAppend);
18849
18863
  }
18850
18864
  else {
18865
+ console.log('else');
18851
18866
  const range = this.getRangeObject(selection);
18852
18867
  const fragment = range.extractContents();
18853
18868
  let fragmentElement = document.createElement('div');
18854
18869
  let newElement = yield this.createElement(container, action, containers);
18855
18870
  let elementToAppend = newElement;
18871
+ console.log(newElement);
18856
18872
  fragmentElement.append(fragment);
18857
18873
  if (((_a = fragmentElement.children) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
18858
18874
  this.textContainers.split(',').indexOf(fragmentElement.children[0].tagName.toLowerCase()) > -1) {
@@ -19024,8 +19040,28 @@ class InlineStyleTool extends EditorJSTool {
19024
19040
  }
19025
19041
  });
19026
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
+ }
19027
19063
  cleanupContainer(selection, container, firstTimeCall) {
19028
- var _a, _b;
19064
+ var _a;
19029
19065
  return __awaiter(this, void 0, void 0, function* () {
19030
19066
  let parentContainer;
19031
19067
  let parentFound = false;
@@ -19050,51 +19086,59 @@ class InlineStyleTool extends EditorJSTool {
19050
19086
  const children = Array.from(parentContainer.childNodes);
19051
19087
  if ((children === null || children === void 0 ? void 0 : children.length) > 0) {
19052
19088
  for (var currentNode = children[0]; currentNode; currentNode = currentNode.nextSibling) {
19053
- console.log('currentNode');
19054
- console.log(currentNode);
19055
- console.log(currentNode.textContent);
19056
- console.log((_b = currentNode.textContent) === null || _b === void 0 ? void 0 : _b.length);
19057
- if (!currentNode.textContent || currentNode.textContent.length === 0) {
19089
+ if (!currentNode.textContent ||
19090
+ currentNode.textContent.length === 0 ||
19091
+ (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.innerText.length === 0)) {
19092
+ let previousSibling = currentNode.previousSibling;
19058
19093
  parentContainer.removeChild(currentNode);
19094
+ currentNode = previousSibling;
19059
19095
  }
19060
- else {
19061
- if (currentNode.childNodes.length > 0) {
19062
- yield this.cleanupContainer(selection, currentNode, false);
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;
19063
19103
  }
19064
- let identicalElements = true;
19065
- while (identicalElements &&
19066
- currentNode.nextSibling &&
19067
- currentNode.nodeType === Node.ELEMENT_NODE &&
19068
- currentNode.nextSibling.nodeType === Node.ELEMENT_NODE) {
19069
- let currentElement = currentNode;
19070
- let nextElement = currentNode.nextSibling;
19071
- if (this.identicalInlineStyle(currentElement, nextElement) &&
19072
- currentElement.tagName.toLowerCase() === nextElement.tagName.toLowerCase() &&
19073
- this.identicalClassList(currentElement, nextElement) &&
19074
- !currentElement.hasAttributes() &&
19075
- !nextElement.hasAttributes()) {
19076
- currentElement.innerHTML += nextElement.innerHTML;
19077
- nextElement.remove();
19078
- this.modifiedContent = true;
19079
- }
19080
- else {
19081
- identicalElements = false;
19082
- }
19083
- }
19084
- if (currentNode.nodeType === Node.ELEMENT_NODE &&
19085
- currentNode.tagName.toLowerCase() === 'span' &&
19086
- Object.keys(this.getInlineStyle(currentNode)).length === 0 &&
19087
- (!currentNode.classList || currentNode.classList.length === 0) &&
19088
- this.hasNoAttributes(currentNode)) {
19089
- let currentNodeFirstChild = currentNode;
19090
- while (currentNode.firstChild) {
19091
- currentNodeFirstChild.parentElement.insertBefore(currentNode.firstChild, currentNodeFirstChild.nextSibling);
19092
- currentNodeFirstChild = currentNodeFirstChild.nextSibling;
19093
- }
19094
- currentNode.remove();
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();
19095
19120
  this.modifiedContent = true;
19096
19121
  }
19097
- currentNode.normalize();
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);
19098
19142
  }
19099
19143
  }
19100
19144
  }
@@ -19114,6 +19158,18 @@ class InlineStyleTool extends EditorJSTool {
19114
19158
  return ([...currentElement.classList].every((classList) => nextElement.classList.contains(classList)) &&
19115
19159
  [...nextElement.classList].every((classList) => currentElement.classList.contains(classList)));
19116
19160
  }
19161
+ identicalAttributes(currentElement, nextElement) {
19162
+ let currentElementAttributes = currentElement.getAttributeNames();
19163
+ currentElementAttributes.forEach((attribute) => {
19164
+ if (attribute !== 'style') {
19165
+ if (!nextElement.getAttribute(attribute) ||
19166
+ nextElement.getAttribute(attribute) !== currentElement.getAttribute(attribute)) {
19167
+ return false;
19168
+ }
19169
+ }
19170
+ });
19171
+ return true;
19172
+ }
19117
19173
  identicalInlineStyle(currentElement, nextElement) {
19118
19174
  const currentElementInlineStyle = this.getInlineStyle(currentElement);
19119
19175
  const nextElementInlineStyle = this.getInlineStyle(nextElement);
@@ -19167,9 +19223,10 @@ class InlineStyleTool extends EditorJSTool {
19167
19223
  let nextNode = container.firstChild;
19168
19224
  while (nextNode && (!this.foundAnchorNode || !this.foundFocusNode)) {
19169
19225
  if (nextNode === this.selectedAnchorNode) {
19170
- this.foundAnchorNode = true;
19171
- this.foundAnchorOffset += this.anchorOffset;
19172
19226
  let selection = this.getSelection();
19227
+ const isLTR = this.isAnchorBeforeFocus(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
19228
+ this.foundAnchorNode = true;
19229
+ this.foundAnchorOffset += isLTR ? this.anchorOffset : this.focusOffset;
19173
19230
  let range = this.getRangeObject(selection);
19174
19231
  const currentFragment = range.cloneContents();
19175
19232
  const currentElement = document.createElement('span');
@@ -20549,7 +20606,7 @@ class ParagraphStyleTool extends EditorJSTool {
20549
20606
  if (!anchorNode) {
20550
20607
  return;
20551
20608
  }
20552
- let parentModifier = this.findParentModifier(anchorNode.parentElement);
20609
+ let parentModifier = this.findParentModifier();
20553
20610
  try {
20554
20611
  if (this.tag.toLowerCase() !== 'span') {
20555
20612
  this.changeContainerTag(parentModifier, selection);
@@ -20684,22 +20741,6 @@ class ParagraphStyleTool extends EditorJSTool {
20684
20741
  container.className += (container.className.length > 0 ? ' ' : '') + this.classToApply;
20685
20742
  }
20686
20743
  }
20687
- findParentModifier(element) {
20688
- let currentElement = element;
20689
- if (currentElement.tagName.toLowerCase() === 'div') {
20690
- if (currentElement.classList.contains('ce-paragraph')) {
20691
- return currentElement.children[0];
20692
- }
20693
- return currentElement.closest('.codex-editor__redactor').querySelector('.ce-paragraph').children[0];
20694
- }
20695
- while (this.modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
20696
- if (currentElement.tagName.toLowerCase() === 'div') {
20697
- return null;
20698
- }
20699
- currentElement = currentElement.parentElement;
20700
- }
20701
- return currentElement;
20702
- }
20703
20744
  }
20704
20745
  var listApi = null;
20705
20746
  var listEditor = null;
@@ -20996,7 +21037,7 @@ class TextTypeTool extends ParagraphTextTool {
20996
21037
  if (!isBlockFocused) {
20997
21038
  setBlockFocus(this.parentEditor);
20998
21039
  }
20999
- const parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
21040
+ const parentModifier = this.findParentModifier();
21000
21041
  if (!parentModifier) {
21001
21042
  return false;
21002
21043
  }
@@ -21271,7 +21312,7 @@ class TextAlignTool extends ParagraphTextTool {
21271
21312
  if (!isBlockFocused) {
21272
21313
  setBlockFocus(this.parentEditor);
21273
21314
  }
21274
- const parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
21315
+ const parentModifier = this.findParentModifier();
21275
21316
  if (!parentModifier) {
21276
21317
  return false;
21277
21318
  }
@@ -21375,7 +21416,7 @@ class UnorderedListTool extends ParagraphStyleTool {
21375
21416
  if (!isBlockFocused) {
21376
21417
  setBlockFocus(this.parentEditor);
21377
21418
  }
21378
- const parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
21419
+ const parentModifier = this.findParentModifier();
21379
21420
  if (!parentModifier) {
21380
21421
  return false;
21381
21422
  }
@@ -21440,7 +21481,7 @@ class OrderedListTool extends ParagraphStyleTool {
21440
21481
  if (!isBlockFocused) {
21441
21482
  setBlockFocus(this.parentEditor);
21442
21483
  }
21443
- const parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
21484
+ const parentModifier = this.findParentModifier();
21444
21485
  if (!parentModifier) {
21445
21486
  return false;
21446
21487
  }
@@ -21505,7 +21546,7 @@ class QuoteTool extends ParagraphStyleTool {
21505
21546
  if (!isBlockFocused) {
21506
21547
  setBlockFocus(this.parentEditor);
21507
21548
  }
21508
- const parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
21549
+ const parentModifier = this.findParentModifier();
21509
21550
  if (!parentModifier) {
21510
21551
  return false;
21511
21552
  }
@@ -22040,23 +22081,6 @@ class InlineTextTool extends InlineStyleTool {
22040
22081
  return true;
22041
22082
  }
22042
22083
  }
22043
- findParentModifier(element) {
22044
- const modifiers = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
22045
- let currentElement = element;
22046
- if (currentElement.tagName.toLowerCase() === 'div') {
22047
- if (currentElement.classList.contains('ce-paragraph')) {
22048
- return currentElement.firstElementChild;
22049
- }
22050
- return currentElement.querySelector('.ce-paragraph').children[0];
22051
- }
22052
- while (modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
22053
- if (currentElement.tagName.toLowerCase() === 'div') {
22054
- return null;
22055
- }
22056
- currentElement = currentElement.parentElement;
22057
- }
22058
- return currentElement;
22059
- }
22060
22084
  }
22061
22085
 
22062
22086
  // @dynamic
@@ -22256,21 +22280,17 @@ class TextEditionTool extends ParagraphStyleTool {
22256
22280
  modal.appendChild(editorContainer);
22257
22281
  modal.appendChild(buttonContainer);
22258
22282
  container.appendChild(modal);
22259
- document.querySelector('body').appendChild(container);
22260
- setTimeout(() => {
22261
- console.log('monacoeditor init');
22262
- console.log(modal);
22263
- var monacoEditor = editor.create(editorContainer, {
22264
- value: content,
22265
- language: 'html',
22266
- ariaContainerElement: modal
22267
- });
22268
- saveButton.addEventListener('click', () => {
22269
- let content = monacoEditor.getValue();
22270
- saveCodeEditModal(content);
22271
- }, true);
22272
- buttonContainer.appendChild(saveButton);
22273
- }, 200);
22283
+ document.body.appendChild(container);
22284
+ let state = EditorState.create({
22285
+ doc: content,
22286
+ extensions: [basicSetup, html()],
22287
+ });
22288
+ let view = new EditorView({
22289
+ state: state,
22290
+ parent: editorContainer,
22291
+ });
22292
+ saveButton.addEventListener('click', () => saveCodeEditModal(view.state.doc.toString()), true);
22293
+ buttonContainer.appendChild(saveButton);
22274
22294
  }
22275
22295
  getSavedEditorContent(name) {
22276
22296
  return localStorage.getItem(name);
@@ -22759,6 +22779,7 @@ class EditorJsComponent {
22759
22779
  this.timeoutHandle = null;
22760
22780
  this.timeoutTextEditionHandle = null;
22761
22781
  this.onChangeTimeoutHandle = null;
22782
+ this.editorInitialized = false;
22762
22783
  this.wrapperTags = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
22763
22784
  }
22764
22785
  ngOnInit() {
@@ -22820,7 +22841,7 @@ class EditorJsComponent {
22820
22841
  clearTimeout(this.onChangeTimeoutHandle);
22821
22842
  this.onChangeTimeoutHandle = setTimeout(() => {
22822
22843
  this.contentChanged(api, event);
22823
- }, 300);
22844
+ }, 200);
22824
22845
  },
22825
22846
  i18n: this.getI18nDictionnary(),
22826
22847
  });
@@ -22831,12 +22852,10 @@ class EditorJsComponent {
22831
22852
  this.content = content;
22832
22853
  this.applyContent();
22833
22854
  this.checkSingleChild();
22834
- setTimeout(() => {
22835
- const editorElement = document.getElementById('editorJs-' + this.uuid);
22836
- editorElement.addEventListener('focusin', () => {
22837
- setlistApiEditor(this.editor, editorElement);
22838
- });
22839
- }, 0);
22855
+ const editorElement = document.getElementById('editorJs-' + this.uuid);
22856
+ editorElement.addEventListener('focusin', () => {
22857
+ setlistApiEditor(this.editor, editorElement);
22858
+ });
22840
22859
  });
22841
22860
  }
22842
22861
  catch (reason) {
@@ -22847,7 +22866,6 @@ class EditorJsComponent {
22847
22866
  ngOnDestroy() {
22848
22867
  const editorName = 'editorJs-' + this.uuid;
22849
22868
  this.deleteSavedEditorContent(editorName);
22850
- this.deleteSavedEditorContent(editorName);
22851
22869
  this.editor.destroy();
22852
22870
  }
22853
22871
  handleDefaultContentTranslation() {
@@ -22864,7 +22882,13 @@ class EditorJsComponent {
22864
22882
  .save()
22865
22883
  .then(() => {
22866
22884
  this.content = this.getEditorContent();
22867
- this.saveEditorContent(this.content, this.uuid);
22885
+ if (!this.editorInitialized) {
22886
+ this.handleSaveEditor(this.content, this.uuid);
22887
+ this.editorInitialized = true;
22888
+ }
22889
+ else {
22890
+ this.saveEditorContent(this.content);
22891
+ }
22868
22892
  this.contentChange.emit(this.content);
22869
22893
  })
22870
22894
  .catch((error) => {
@@ -23006,11 +23030,11 @@ class EditorJsComponent {
23006
23030
  }
23007
23031
  return null;
23008
23032
  }
23009
- saveEditorContent(data, uuid) {
23033
+ saveEditorContent(data) {
23010
23034
  if (!isTextEditionTool) {
23011
23035
  clearTimeout(this.timeoutHandle);
23012
23036
  this.timeoutHandle = setTimeout(() => {
23013
- this.handleSaveEditor(data, uuid);
23037
+ this.handleSaveEditor(data, this.uuid);
23014
23038
  }, 2000);
23015
23039
  }
23016
23040
  else {
@@ -23026,6 +23050,10 @@ class EditorJsComponent {
23026
23050
  let savedDataIndex = this.getSavedEditorContent(editorName + '-index')
23027
23051
  ? parseInt(this.getSavedEditorContent(editorName + '-index'))
23028
23052
  : -1;
23053
+ if (!this.editorInitialized) {
23054
+ savedData = null;
23055
+ savedDataIndex = -1;
23056
+ }
23029
23057
  let parsedSavedData = [];
23030
23058
  if (savedData) {
23031
23059
  parsedSavedData = JSON.parse(savedData);
@@ -23047,6 +23075,7 @@ class EditorJsComponent {
23047
23075
  }
23048
23076
  deleteSavedEditorContent(name) {
23049
23077
  localStorage.removeItem(name);
23078
+ localStorage.removeItem(name + '-index');
23050
23079
  }
23051
23080
  }
23052
23081
  EditorJsComponent.decorators = [
@@ -26432,15 +26461,14 @@ QuotesSimpleBackgroundComponent.decorators = [
26432
26461
  ];
26433
26462
  QuotesSimpleBackgroundComponent.ctorParameters = () => [];
26434
26463
 
26435
- class OpenMapDto {
26436
- }
26437
-
26438
26464
  class MapFullpageComponent extends StructuresComponent {
26439
26465
  constructor(externalConfigService) {
26440
26466
  super();
26441
26467
  this.externalConfigService = externalConfigService;
26442
26468
  this.address = '';
26469
+ this.triggerAddress = '';
26443
26470
  this.editPlaceMap = null;
26471
+ this.firstTimeTrigger = false;
26444
26472
  this.options = {};
26445
26473
  this.layers = [];
26446
26474
  this.showMap = false;
@@ -26449,40 +26477,29 @@ class MapFullpageComponent extends StructuresComponent {
26449
26477
  ngOnInit() {
26450
26478
  super.ngOnInit();
26451
26479
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
26452
- const algolia = new OpenMapDto();
26453
- algolia.suggestion = {
26454
- latlng: {
26455
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
26456
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
26480
+ this.googleMapReturnElement = {
26481
+ suggestion: {
26482
+ latlng: {
26483
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
26484
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
26485
+ },
26486
+ value: '',
26457
26487
  },
26458
- value: '',
26459
26488
  };
26460
- this.setCoordinateOnPlaces(algolia);
26489
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26461
26490
  }
26462
26491
  }
26463
- ngAfterViewInit() {
26464
- if (!this.showMap) {
26465
- const placesAutocomplete = places({
26466
- appId: this.externalConfigService.getAlgoliaAppId(),
26467
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26468
- container: this.input.nativeElement,
26469
- });
26470
- placesAutocomplete.on('change', (algoliaReturnElement) => {
26471
- this.setCoordinateOnPlaces(algoliaReturnElement);
26472
- });
26473
- }
26474
- }
26475
- setCoordinateOnPlaces(algoliaReturnElement) {
26492
+ setCoordinateOnPlaces(googleResults) {
26476
26493
  this.showMap = false;
26477
26494
  this.options = {
26478
26495
  layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
26479
26496
  zoom: 18,
26480
26497
  zoomControl: false,
26481
- center: latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
26498
+ center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
26482
26499
  };
26483
- this.center = latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
26500
+ this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
26484
26501
  this.layers = [
26485
- marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
26502
+ marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
26486
26503
  icon: icon({
26487
26504
  iconSize: [25, 41],
26488
26505
  iconAnchor: [13, 41],
@@ -26491,23 +26508,23 @@ class MapFullpageComponent extends StructuresComponent {
26491
26508
  }),
26492
26509
  }),
26493
26510
  ];
26494
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
26495
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
26496
- this.address = algoliaReturnElement.suggestion.value;
26511
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
26512
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
26513
+ this.address = googleResults.suggestion.value;
26497
26514
  this.showMap = true;
26498
26515
  this.persist();
26499
26516
  }
26500
- createEditAlgoliaInput() {
26501
- if (this.editPlaceMap === null) {
26502
- this.editPlaceMap = places({
26503
- appId: this.externalConfigService.getAlgoliaAppId(),
26504
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26505
- container: document.querySelector('#address-input-edit' + this.uuid),
26506
- });
26507
- this.editPlaceMap.on('change', (algoliaReturnElement) => {
26508
- this.setCoordinateOnPlaces(algoliaReturnElement);
26509
- });
26510
- }
26517
+ handleAddressChange(event) {
26518
+ this.googleMapReturnElement = {
26519
+ suggestion: {
26520
+ latlng: {
26521
+ lat: event.geometry.location.lat(),
26522
+ lng: event.geometry.location.lng(),
26523
+ },
26524
+ value: event.name,
26525
+ },
26526
+ };
26527
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26511
26528
  }
26512
26529
  /**
26513
26530
  * Avoid partial map loaded at the initialization
@@ -26522,7 +26539,7 @@ class MapFullpageComponent extends StructuresComponent {
26522
26539
  MapFullpageComponent.decorators = [
26523
26540
  { type: Component, args: [{
26524
26541
  selector: MapFullpageService.selector(),
26525
- 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\" (click)=\"createEditAlgoliaInput()\">\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 />\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 id=\"address-input{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInput (click)=\"myInput.select()\" />\n </div>\n</div>\n"
26542
+ 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"
26526
26543
  },] }
26527
26544
  ];
26528
26545
  MapFullpageComponent.ctorParameters = () => [
@@ -26537,7 +26554,9 @@ class MapLeftTextComponent extends StructuresComponent {
26537
26554
  super();
26538
26555
  this.externalConfigService = externalConfigService;
26539
26556
  this.address = '';
26557
+ this.triggerAddress = '';
26540
26558
  this.editPlaceMap = null;
26559
+ this.firstTimeTrigger = false;
26541
26560
  this.options = {};
26542
26561
  this.layers = [];
26543
26562
  this.showMap = false;
@@ -26546,40 +26565,29 @@ class MapLeftTextComponent extends StructuresComponent {
26546
26565
  ngOnInit() {
26547
26566
  super.ngOnInit();
26548
26567
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
26549
- const algolia = new OpenMapDto();
26550
- algolia.suggestion = {
26551
- latlng: {
26552
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
26553
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
26568
+ this.googleMapReturnElement = {
26569
+ suggestion: {
26570
+ latlng: {
26571
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
26572
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
26573
+ },
26574
+ value: '',
26554
26575
  },
26555
- value: '',
26556
26576
  };
26557
- this.setCoordinateOnPlaces(algolia);
26558
- }
26559
- }
26560
- ngAfterViewInit() {
26561
- if (!this.showMap) {
26562
- const placesAutocomplete = places({
26563
- appId: this.externalConfigService.getAlgoliaAppId(),
26564
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26565
- container: this.input.nativeElement,
26566
- });
26567
- placesAutocomplete.on('change', (algoliaReturnElement) => {
26568
- this.setCoordinateOnPlaces(algoliaReturnElement);
26569
- });
26577
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26570
26578
  }
26571
26579
  }
26572
- setCoordinateOnPlaces(algoliaReturnElement) {
26580
+ setCoordinateOnPlaces(googleResults) {
26573
26581
  this.showMap = false;
26574
26582
  this.options = {
26575
26583
  layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
26576
26584
  zoom: 18,
26577
26585
  zoomControl: false,
26578
- center: latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
26586
+ center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
26579
26587
  };
26580
- this.center = latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
26588
+ this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
26581
26589
  this.layers = [
26582
- marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
26590
+ marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
26583
26591
  icon: icon({
26584
26592
  iconSize: [25, 41],
26585
26593
  iconAnchor: [13, 41],
@@ -26588,23 +26596,23 @@ class MapLeftTextComponent extends StructuresComponent {
26588
26596
  }),
26589
26597
  }),
26590
26598
  ];
26591
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
26592
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
26593
- this.address = algoliaReturnElement.suggestion.value;
26599
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
26600
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
26601
+ this.address = googleResults.suggestion.value;
26594
26602
  this.showMap = true;
26595
26603
  this.persist();
26596
26604
  }
26597
- createEditAlgoliaInput() {
26598
- if (this.editPlaceMap === null) {
26599
- this.editPlaceMap = places({
26600
- appId: this.externalConfigService.getAlgoliaAppId(),
26601
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26602
- container: document.querySelector('#address-input-edit' + this.uuid),
26603
- });
26604
- this.editPlaceMap.on('change', (algoliaReturnElement) => {
26605
- this.setCoordinateOnPlaces(algoliaReturnElement);
26606
- });
26607
- }
26605
+ handleAddressChange(event) {
26606
+ this.googleMapReturnElement = {
26607
+ suggestion: {
26608
+ latlng: {
26609
+ lat: event.geometry.location.lat(),
26610
+ lng: event.geometry.location.lng(),
26611
+ },
26612
+ value: event.name,
26613
+ },
26614
+ };
26615
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26608
26616
  }
26609
26617
  /**
26610
26618
  * Avoid partial map loaded at the initialization
@@ -26619,7 +26627,7 @@ class MapLeftTextComponent extends StructuresComponent {
26619
26627
  MapLeftTextComponent.decorators = [
26620
26628
  { type: Component, args: [{
26621
26629
  selector: MapLeftTextService.selector(),
26622
- 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\n [blockUUID]=\"uuid\"\n [position]=\"TYPE_CONFIG_POSITION_RIGHT_TOP\"\n (click)=\"createEditAlgoliaInput()\"\n [isFullwidth]=\"true\"\n >\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 />\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 id=\"address-input{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInput (click)=\"myInput.select()\" />\n </div>\n </div>\n </div>\n</div>\n"
26630
+ 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"
26623
26631
  },] }
26624
26632
  ];
26625
26633
  MapLeftTextComponent.ctorParameters = () => [
@@ -26634,7 +26642,9 @@ class MapRightTextComponent extends StructuresComponent {
26634
26642
  super();
26635
26643
  this.externalConfigService = externalConfigService;
26636
26644
  this.address = '';
26645
+ this.triggerAddress = '';
26637
26646
  this.editPlaceMap = null;
26647
+ this.firstTimeTrigger = false;
26638
26648
  this.options = {};
26639
26649
  this.layers = [];
26640
26650
  this.showMap = false;
@@ -26643,40 +26653,29 @@ class MapRightTextComponent extends StructuresComponent {
26643
26653
  ngOnInit() {
26644
26654
  super.ngOnInit();
26645
26655
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
26646
- const algolia = new OpenMapDto();
26647
- algolia.suggestion = {
26648
- latlng: {
26649
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
26650
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
26656
+ this.googleMapReturnElement = {
26657
+ suggestion: {
26658
+ latlng: {
26659
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
26660
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
26661
+ },
26662
+ value: '',
26651
26663
  },
26652
- value: '',
26653
26664
  };
26654
- this.setCoordinateOnPlaces(algolia);
26665
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26655
26666
  }
26656
26667
  }
26657
- ngAfterViewInit() {
26658
- if (!this.showMap) {
26659
- const placesAutocomplete = places({
26660
- appId: this.externalConfigService.getAlgoliaAppId(),
26661
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26662
- container: this.input.nativeElement,
26663
- });
26664
- placesAutocomplete.on('change', (algoliaReturnElement) => {
26665
- this.setCoordinateOnPlaces(algoliaReturnElement);
26666
- });
26667
- }
26668
- }
26669
- setCoordinateOnPlaces(algoliaReturnElement) {
26668
+ setCoordinateOnPlaces(googleResults) {
26670
26669
  this.showMap = false;
26671
26670
  this.options = {
26672
26671
  layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
26673
26672
  zoom: 18,
26674
26673
  zoomControl: false,
26675
- center: latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
26674
+ center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
26676
26675
  };
26677
- this.center = latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
26676
+ this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
26678
26677
  this.layers = [
26679
- marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
26678
+ marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
26680
26679
  icon: icon({
26681
26680
  iconSize: [25, 41],
26682
26681
  iconAnchor: [13, 41],
@@ -26685,23 +26684,23 @@ class MapRightTextComponent extends StructuresComponent {
26685
26684
  }),
26686
26685
  }),
26687
26686
  ];
26688
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
26689
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
26690
- this.address = algoliaReturnElement.suggestion.value;
26687
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
26688
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
26689
+ this.address = googleResults.suggestion.value;
26691
26690
  this.showMap = true;
26692
26691
  this.persist();
26693
26692
  }
26694
- createEditAlgoliaInput() {
26695
- if (this.editPlaceMap === null) {
26696
- this.editPlaceMap = places({
26697
- appId: this.externalConfigService.getAlgoliaAppId(),
26698
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26699
- container: document.querySelector('#address-input-edit' + this.uuid),
26700
- });
26701
- this.editPlaceMap.on('change', (algoliaReturnElement) => {
26702
- this.setCoordinateOnPlaces(algoliaReturnElement);
26703
- });
26704
- }
26693
+ handleAddressChange(event) {
26694
+ this.googleMapReturnElement = {
26695
+ suggestion: {
26696
+ latlng: {
26697
+ lat: event.geometry.location.lat(),
26698
+ lng: event.geometry.location.lng(),
26699
+ },
26700
+ value: event.name,
26701
+ },
26702
+ };
26703
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26705
26704
  }
26706
26705
  /**
26707
26706
  * Avoid partial map loaded at the initialization
@@ -26716,7 +26715,7 @@ class MapRightTextComponent extends StructuresComponent {
26716
26715
  MapRightTextComponent.decorators = [
26717
26716
  { type: Component, args: [{
26718
26717
  selector: MapRightTextService.selector(),
26719
- 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\n [blockUUID]=\"uuid\"\n [position]=\"TYPE_CONFIG_POSITION_RIGHT_TOP\"\n (click)=\"createEditAlgoliaInput()\"\n [isFullwidth]=\"true\"\n >\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 />\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 id=\"address-input{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInput (click)=\"myInput.select()\" />\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"
26718
+ 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"
26720
26719
  },] }
26721
26720
  ];
26722
26721
  MapRightTextComponent.ctorParameters = () => [
@@ -26726,13 +26725,18 @@ MapRightTextComponent.propDecorators = {
26726
26725
  input: [{ type: ViewChild, args: ['myInput',] }]
26727
26726
  };
26728
26727
 
26728
+ class OpenMapDto {
26729
+ }
26730
+
26729
26731
  class MapTextFormComponent extends StructuresComponent {
26730
26732
  constructor(apiService, externalConfigService) {
26731
26733
  super();
26732
26734
  this.apiService = apiService;
26733
26735
  this.externalConfigService = externalConfigService;
26734
26736
  this.address = '';
26737
+ this.triggerAddress = '';
26735
26738
  this.editPlaceMap = null;
26739
+ this.firstTimeTrigger = false;
26736
26740
  this.options = {};
26737
26741
  this.layers = [];
26738
26742
  this.showMap = false;
@@ -26766,29 +26770,17 @@ class MapTextFormComponent extends StructuresComponent {
26766
26770
  }
26767
26771
  });
26768
26772
  }
26769
- ngAfterViewInit() {
26770
- if (!this.showMap) {
26771
- const placesAutocomplete = places({
26772
- appId: this.externalConfigService.getAlgoliaAppId(),
26773
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26774
- container: this.input.nativeElement,
26775
- });
26776
- placesAutocomplete.on('change', (algoliaReturnElement) => {
26777
- this.setCoordinateOnPlaces(algoliaReturnElement);
26778
- });
26779
- }
26780
- }
26781
- setCoordinateOnPlaces(algoliaReturnElement) {
26773
+ setCoordinateOnPlaces(googleResults) {
26782
26774
  this.showMap = false;
26783
26775
  this.options = {
26784
- layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
26776
+ layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
26785
26777
  zoom: 18,
26786
26778
  zoomControl: false,
26787
- center: latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
26779
+ center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
26788
26780
  };
26789
- this.center = latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
26781
+ this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
26790
26782
  this.layers = [
26791
- marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
26783
+ marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
26792
26784
  icon: icon({
26793
26785
  iconSize: [25, 41],
26794
26786
  iconAnchor: [13, 41],
@@ -26797,23 +26789,32 @@ class MapTextFormComponent extends StructuresComponent {
26797
26789
  }),
26798
26790
  }),
26799
26791
  ];
26800
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
26801
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
26802
- this.address = algoliaReturnElement.suggestion.value;
26792
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
26793
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
26794
+ this.address = googleResults.suggestion.value;
26803
26795
  this.showMap = true;
26804
26796
  this.persist();
26805
26797
  }
26806
- createEditAlgoliaInput() {
26807
- if (this.editPlaceMap === null) {
26808
- this.editPlaceMap = places({
26809
- appId: this.externalConfigService.getAlgoliaAppId(),
26810
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
26811
- container: document.querySelector('#address-input-edit' + this.uuid),
26812
- });
26813
- this.editPlaceMap.on('change', (algoliaReturnElement) => {
26814
- this.setCoordinateOnPlaces(algoliaReturnElement);
26815
- });
26816
- }
26798
+ handleAddressChange(event) {
26799
+ this.googleMapReturnElement = {
26800
+ suggestion: {
26801
+ latlng: {
26802
+ lat: event.geometry.location.lat(),
26803
+ lng: event.geometry.location.lng(),
26804
+ },
26805
+ value: event.name,
26806
+ },
26807
+ };
26808
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26809
+ }
26810
+ /**
26811
+ * Avoid partial map loaded at the initialization
26812
+ * @param map
26813
+ */
26814
+ onMapReady(map) {
26815
+ setTimeout(() => {
26816
+ map.invalidateSize();
26817
+ }, 0);
26817
26818
  }
26818
26819
  selectThisForm() {
26819
26820
  if (this.selectedValue === null) {
@@ -26825,20 +26826,11 @@ class MapTextFormComponent extends StructuresComponent {
26825
26826
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
26826
26827
  this.persist();
26827
26828
  }
26828
- /**
26829
- * Avoid partial map loaded at the initialization
26830
- * @param map
26831
- */
26832
- onMapReady(map) {
26833
- setTimeout(() => {
26834
- map.invalidateSize();
26835
- }, 0);
26836
- }
26837
26829
  }
26838
26830
  MapTextFormComponent.decorators = [
26839
26831
  { type: Component, args: [{
26840
26832
  selector: MapTextFormService.selector(),
26841
- template: "<div class=\"wb-map-text-form\">\n <div class=\"wb-map-text-form__container__config\" *ngIf=\"showMap\">\n <wb-structure-config\n [blockUUID]=\"uuid\"\n [position]=\"TYPE_CONFIG_POSITION_LEFT_TOP\"\n (click)=\"createEditAlgoliaInput()\"\n [isFullwidth]=\"true\"\n >\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input id=\"address-input-edit{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInputEdit (click)=\"myInputEdit.select()\" />\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 id=\"address-input{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInput (click)=\"myInput.select()\" />\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 &nbsp;&nbsp;&nbsp;\n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
26833
+ 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 &nbsp;&nbsp;&nbsp;\n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
26842
26834
  },] }
26843
26835
  ];
26844
26836
  MapTextFormComponent.ctorParameters = () => [
@@ -26854,7 +26846,9 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
26854
26846
  super();
26855
26847
  this.apiService = apiService;
26856
26848
  this.address = '';
26849
+ this.triggerAddress = '';
26857
26850
  this.editPlaceMap = null;
26851
+ this.firstTimeTrigger = false;
26858
26852
  this.options = {};
26859
26853
  this.layers = [];
26860
26854
  this.showMap = false;
@@ -26877,27 +26871,17 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
26877
26871
  }
26878
26872
  });
26879
26873
  }
26880
- ngAfterViewInit() {
26881
- const placesAutocomplete = places({
26882
- appId: 'pl9OI1NPY62Y',
26883
- apiKey: '290e5a0e33e751c85c36690d502991fc',
26884
- container: this.input.nativeElement,
26885
- });
26886
- placesAutocomplete.on('change', (algoliaReturnElement) => {
26887
- this.setCoordinateOnPlaces(algoliaReturnElement);
26888
- });
26889
- }
26890
- setCoordinateOnPlaces(algoliaReturnElement) {
26874
+ setCoordinateOnPlaces(googleResults) {
26891
26875
  this.showMap = false;
26892
26876
  this.options = {
26893
- layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
26877
+ layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
26894
26878
  zoom: 18,
26895
26879
  zoomControl: false,
26896
- center: latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
26880
+ center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
26897
26881
  };
26898
- this.center = latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
26882
+ this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
26899
26883
  this.layers = [
26900
- marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
26884
+ marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
26901
26885
  icon: icon({
26902
26886
  iconSize: [25, 41],
26903
26887
  iconAnchor: [13, 41],
@@ -26906,23 +26890,32 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
26906
26890
  }),
26907
26891
  }),
26908
26892
  ];
26909
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
26910
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
26911
- this.address = algoliaReturnElement.suggestion.value;
26893
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
26894
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
26895
+ this.address = googleResults.suggestion.value;
26912
26896
  this.showMap = true;
26913
26897
  this.persist();
26914
26898
  }
26915
- createEditAlgoliaInput() {
26916
- if (this.editPlaceMap === null) {
26917
- this.editPlaceMap = places({
26918
- appId: 'pl9OI1NPY62Y',
26919
- apiKey: '290e5a0e33e751c85c36690d502991fc',
26920
- container: document.querySelector('#address-input-edit' + this.uuid),
26921
- });
26922
- this.editPlaceMap.on('change', (algoliaReturnElement) => {
26923
- this.setCoordinateOnPlaces(algoliaReturnElement);
26924
- });
26925
- }
26899
+ handleAddressChange(event) {
26900
+ this.googleMapReturnElement = {
26901
+ suggestion: {
26902
+ latlng: {
26903
+ lat: event.geometry.location.lat(),
26904
+ lng: event.geometry.location.lng(),
26905
+ },
26906
+ value: event.name,
26907
+ },
26908
+ };
26909
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
26910
+ }
26911
+ /**
26912
+ * Avoid partial map loaded at the initialization
26913
+ * @param map
26914
+ */
26915
+ onMapReady(map) {
26916
+ setTimeout(() => {
26917
+ map.invalidateSize();
26918
+ }, 0);
26926
26919
  }
26927
26920
  selectThisForm() {
26928
26921
  if (this.selectedValue === null) {
@@ -26934,20 +26927,11 @@ class MapBackgroundFormLeftComponent extends StructuresComponent {
26934
26927
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
26935
26928
  this.persist();
26936
26929
  }
26937
- /**
26938
- * Avoid partial map loaded at the initialization
26939
- * @param map
26940
- */
26941
- onMapReady(map) {
26942
- setTimeout(() => {
26943
- map.invalidateSize();
26944
- }, 0);
26945
- }
26946
26930
  }
26947
26931
  MapBackgroundFormLeftComponent.decorators = [
26948
26932
  { type: Component, args: [{
26949
26933
  selector: MapBackgroundFormLeftService.selector(),
26950
- template: "<div class=\"wb-map-background-form-left\">\n <div class=\"wb-map-background-form-left__container__config\" *ngIf=\"showMap\">\n <wb-structure-config\n [blockUUID]=\"uuid\"\n [position]=\"TYPE_CONFIG_POSITION_RIGHT_TOP\"\n (click)=\"createEditAlgoliaInput()\"\n [isFullwidth]=\"true\"\n >\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input id=\"address-input-edit{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInputEdit (click)=\"myInputEdit.select()\" />\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 id=\"address-input{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInput (click)=\"myInput.select()\" />\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 &nbsp;&nbsp;&nbsp;\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"
26934
+ 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 &nbsp;&nbsp;&nbsp;\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"
26951
26935
  },] }
26952
26936
  ];
26953
26937
  MapBackgroundFormLeftComponent.ctorParameters = () => [
@@ -26962,7 +26946,9 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
26962
26946
  super();
26963
26947
  this.apiService = apiService;
26964
26948
  this.address = '';
26949
+ this.triggerAddress = '';
26965
26950
  this.editPlaceMap = null;
26951
+ this.firstTimeTrigger = false;
26966
26952
  this.options = {};
26967
26953
  this.layers = [];
26968
26954
  this.showMap = false;
@@ -26985,27 +26971,17 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
26985
26971
  }
26986
26972
  });
26987
26973
  }
26988
- ngAfterViewInit() {
26989
- const placesAutocomplete = places({
26990
- appId: 'pl9OI1NPY62Y',
26991
- apiKey: '290e5a0e33e751c85c36690d502991fc',
26992
- container: this.input.nativeElement,
26993
- });
26994
- placesAutocomplete.on('change', (algoliaReturnElement) => {
26995
- this.setCoordinateOnPlaces(algoliaReturnElement);
26996
- });
26997
- }
26998
- setCoordinateOnPlaces(algoliaReturnElement) {
26974
+ setCoordinateOnPlaces(googleResults) {
26999
26975
  this.showMap = false;
27000
26976
  this.options = {
27001
- layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
26977
+ layers: [tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
27002
26978
  zoom: 18,
27003
26979
  zoomControl: false,
27004
- center: latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
26980
+ center: latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
27005
26981
  };
27006
- this.center = latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
26982
+ this.center = latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
27007
26983
  this.layers = [
27008
- marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
26984
+ marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
27009
26985
  icon: icon({
27010
26986
  iconSize: [25, 41],
27011
26987
  iconAnchor: [13, 41],
@@ -27014,23 +26990,32 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
27014
26990
  }),
27015
26991
  }),
27016
26992
  ];
27017
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
27018
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
27019
- this.address = algoliaReturnElement.suggestion.value;
26993
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
26994
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
26995
+ this.address = googleResults.suggestion.value;
27020
26996
  this.showMap = true;
27021
26997
  this.persist();
27022
26998
  }
27023
- createEditAlgoliaInput() {
27024
- if (this.editPlaceMap === null) {
27025
- this.editPlaceMap = places({
27026
- appId: 'pl9OI1NPY62Y',
27027
- apiKey: '290e5a0e33e751c85c36690d502991fc',
27028
- container: document.querySelector('#address-input-edit' + this.uuid),
27029
- });
27030
- this.editPlaceMap.on('change', (algoliaReturnElement) => {
27031
- this.setCoordinateOnPlaces(algoliaReturnElement);
27032
- });
27033
- }
26999
+ handleAddressChange(event) {
27000
+ this.googleMapReturnElement = {
27001
+ suggestion: {
27002
+ latlng: {
27003
+ lat: event.geometry.location.lat(),
27004
+ lng: event.geometry.location.lng(),
27005
+ },
27006
+ value: event.name,
27007
+ },
27008
+ };
27009
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
27010
+ }
27011
+ /**
27012
+ * Avoid partial map loaded at the initialization
27013
+ * @param map
27014
+ */
27015
+ onMapReady(map) {
27016
+ setTimeout(() => {
27017
+ map.invalidateSize();
27018
+ }, 0);
27034
27019
  }
27035
27020
  selectThisForm() {
27036
27021
  if (this.selectedValue === null) {
@@ -27042,20 +27027,11 @@ class MapBackgroundFormRightComponent extends StructuresComponent {
27042
27027
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
27043
27028
  this.persist();
27044
27029
  }
27045
- /**
27046
- * Avoid partial map loaded at the initialization
27047
- * @param map
27048
- */
27049
- onMapReady(map) {
27050
- setTimeout(() => {
27051
- map.invalidateSize();
27052
- }, 0);
27053
- }
27054
27030
  }
27055
27031
  MapBackgroundFormRightComponent.decorators = [
27056
27032
  { type: Component, args: [{
27057
27033
  selector: MapBackgroundFormRightService.selector(),
27058
- template: "<div class=\"wb-map-background-form-right\">\n <div class=\"wb-map-background-form-right__container__config\" *ngIf=\"showMap\">\n <wb-structure-config\n [blockUUID]=\"uuid\"\n [position]=\"TYPE_CONFIG_POSITION_LEFT_TOP\"\n (click)=\"createEditAlgoliaInput()\"\n [isFullwidth]=\"true\"\n >\n <p>{{ 'wb.structures.template.19' | translate }}</p>\n <input id=\"address-input-edit{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInputEdit (click)=\"myInputEdit.select()\" />\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 id=\"address-input{{ uuid }}\" type=\"text\" [(ngModel)]=\"address\" #myInput (click)=\"myInput.select()\" />\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 &nbsp;&nbsp;&nbsp;\n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
27034
+ 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 &nbsp;&nbsp;&nbsp;\n <button>{{ selectedValue.submit_label }}</button>\n </div>\n </div>\n </div>\n </div>\n </div>\n</div>\n"
27059
27035
  },] }
27060
27036
  ];
27061
27037
  MapBackgroundFormRightComponent.ctorParameters = () => [
@@ -29957,6 +29933,7 @@ StructuresModule.decorators = [
29957
29933
  imports: [
29958
29934
  SharedModule,
29959
29935
  MonacoEditorModule,
29936
+ GooglePlaceModule,
29960
29937
  QuillModule,
29961
29938
  LeafletModule,
29962
29939
  NwbCommonModule,