@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
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@ngx-translate/core'), require('uuid'), require('@angular/cdk/drag-drop'), require('@angular/animations'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/platform-browser'), require('@ctrl/tinycolor'), require('quill'), require('monaco-editor'), require('ngx-quill'), require('@fortawesome/fontawesome-svg-core'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-brands-svg-icons'), require('@wizishop/ng-wizi-bulma'), require('ngx-scrollbar'), require('@editorjs/editorjs'), require('@jaames/iro'), require('ngx-monaco-editor'), require('leaflet'), require('places.js'), require('@asymmetrik/ngx-leaflet'), require('ngx-color-picker')) :
3
- typeof define === 'function' && define.amd ? define('@wizishop/wizi-block', ['exports', '@angular/core', 'rxjs', '@ngx-translate/core', 'uuid', '@angular/cdk/drag-drop', '@angular/animations', '@angular/common/http', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/platform-browser', '@ctrl/tinycolor', 'quill', 'monaco-editor', 'ngx-quill', '@fortawesome/fontawesome-svg-core', '@fortawesome/free-solid-svg-icons', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-brands-svg-icons', '@wizishop/ng-wizi-bulma', 'ngx-scrollbar', '@editorjs/editorjs', '@jaames/iro', 'ngx-monaco-editor', 'leaflet', 'places.js', '@asymmetrik/ngx-leaflet', 'ngx-color-picker'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['wizi-block'] = {}), global.ng.core, global.rxjs, global.i1, global['^3']['3']['2'], global.ng.cdk.dragDrop, global.ng.animations, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.platformBrowser, global['^2']['5']['2'], global['^1']['3']['6'], global.monaco, global['^5']['0']['0'], global['^1']['2']['27'], global['^5']['12']['1'], global['^5']['12']['1'], global['^5']['12']['1'], global['^7']['0']['11'], global['^7']['2']['1-beta']['0'], global.EditorJS, global.iro, global['^8']['1']['1'], global['^1']['5']['1'], global['^1']['16']['4'], global['^5']['0']['2'], global['^9']['0']['0']));
5
- }(this, (function (exports, i0, rxjs, i1, uuid, dragDrop, animations, i1$1, operators, common, forms, platformBrowser, tinycolor, QuillNamespace, monaco, ngxQuill, fontawesomeSvgCore, freeSolidSvgIcons, freeRegularSvgIcons, freeBrandsSvgIcons, ngWiziBulma, ngxScrollbar, EditorJS, iro, ngxMonacoEditor, leaflet, places, ngxLeaflet, ngxColorPicker) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('rxjs'), require('@ngx-translate/core'), require('uuid'), require('@angular/cdk/drag-drop'), require('@angular/animations'), require('@angular/common/http'), require('rxjs/operators'), require('@angular/common'), require('@angular/forms'), require('@angular/platform-browser'), require('@ctrl/tinycolor'), require('quill'), require('monaco-editor'), require('ngx-quill'), require('@fortawesome/fontawesome-svg-core'), require('@fortawesome/free-solid-svg-icons'), require('@fortawesome/free-regular-svg-icons'), require('@fortawesome/free-brands-svg-icons'), require('@wizishop/ng-wizi-bulma'), require('ngx-scrollbar'), require('@editorjs/editorjs'), require('@jaames/iro'), require('codemirror'), require('@codemirror/state'), require('@codemirror/lang-html'), require('ngx-monaco-editor'), require('leaflet'), require('@asymmetrik/ngx-leaflet'), require('ngx-google-places-autocomplete'), require('ngx-color-picker')) :
3
+ typeof define === 'function' && define.amd ? define('@wizishop/wizi-block', ['exports', '@angular/core', 'rxjs', '@ngx-translate/core', 'uuid', '@angular/cdk/drag-drop', '@angular/animations', '@angular/common/http', 'rxjs/operators', '@angular/common', '@angular/forms', '@angular/platform-browser', '@ctrl/tinycolor', 'quill', 'monaco-editor', 'ngx-quill', '@fortawesome/fontawesome-svg-core', '@fortawesome/free-solid-svg-icons', '@fortawesome/free-regular-svg-icons', '@fortawesome/free-brands-svg-icons', '@wizishop/ng-wizi-bulma', 'ngx-scrollbar', '@editorjs/editorjs', '@jaames/iro', 'codemirror', '@codemirror/state', '@codemirror/lang-html', 'ngx-monaco-editor', 'leaflet', '@asymmetrik/ngx-leaflet', 'ngx-google-places-autocomplete', 'ngx-color-picker'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.wizishop = global.wizishop || {}, global.wizishop['wizi-block'] = {}), global.ng.core, global.rxjs, global.i1, global['^3']['3']['2'], global.ng.cdk.dragDrop, global.ng.animations, global.ng.common.http, global.rxjs.operators, global.ng.common, global.ng.forms, global.ng.platformBrowser, global['^2']['5']['2'], global['^1']['3']['6'], global.monaco, global['^5']['0']['0'], global['^1']['2']['27'], global['^5']['12']['1'], global['^5']['12']['1'], global['^5']['12']['1'], global['^7']['0']['11'], global['^7']['2']['1-beta']['0'], global.EditorJS, global.iro, global.codemirror, global.state, global.langHtml, global['^8']['1']['1'], global['^1']['5']['1'], global['^5']['0']['2'], global.ngxGooglePlacesAutocomplete, global['^9']['0']['0']));
5
+ }(this, (function (exports, i0, rxjs, i1, uuid, dragDrop, animations, i1$1, operators, common, forms, platformBrowser, tinycolor, QuillNamespace, monaco, ngxQuill, fontawesomeSvgCore, freeSolidSvgIcons, freeRegularSvgIcons, freeBrandsSvgIcons, ngWiziBulma, ngxScrollbar, EditorJS, iro, codemirror, state, langHtml, ngxMonacoEditor, leaflet, ngxLeaflet, ngxGooglePlacesAutocomplete, ngxColorPicker) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -31,7 +31,6 @@
31
31
  var QuillNamespace__namespace = /*#__PURE__*/_interopNamespace(QuillNamespace);
32
32
  var EditorJS__default = /*#__PURE__*/_interopDefaultLegacy(EditorJS);
33
33
  var iro__default = /*#__PURE__*/_interopDefaultLegacy(iro);
34
- var places__default = /*#__PURE__*/_interopDefaultLegacy(places);
35
34
 
36
35
  var MediaConnectorService = /** @class */ (function () {
37
36
  function MediaConnectorService() {
@@ -3921,7 +3920,7 @@
3921
3920
  'wb.blocks.FormContentDto.117',
3922
3921
  ], ['0', '0.25', '0.5', '1']);
3923
3922
  imgSimpleFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
3924
- var 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');
3923
+ var 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');
3925
3924
  imgSimpleFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
3926
3925
  return imgSimpleFormDto;
3927
3926
  };
@@ -5082,7 +5081,7 @@
5082
5081
  'wb.blocks.FormContentDto.117',
5083
5082
  ], ['0', '0.25', '0.5', '1']);
5084
5083
  TextBackgroundsSimpleFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
5085
- var 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');
5084
+ var 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');
5086
5085
  TextBackgroundsSimpleFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
5087
5086
  return TextBackgroundsSimpleFormDto;
5088
5087
  };
@@ -5166,7 +5165,7 @@
5166
5165
  'wb.blocks.FormContentDto.117',
5167
5166
  ], ['0', '0.25', '0.5', '1']);
5168
5167
  formsDto.forms.push(parallaxSpeedImgSimpleContentDto);
5169
- var 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');
5168
+ var 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');
5170
5169
  formsDto.forms.push(parallaxInvertedImgSimpleContentDto);
5171
5170
  return formsDto;
5172
5171
  };
@@ -5250,7 +5249,7 @@
5250
5249
  'wb.blocks.FormContentDto.117',
5251
5250
  ], ['0', '0.25', '0.5', '1']);
5252
5251
  formsDto.forms.push(parallaxSpeedImgSimpleContentDto);
5253
- var 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');
5252
+ var 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');
5254
5253
  formsDto.forms.push(parallaxInvertedImgSimpleContentDto);
5255
5254
  var colorContentDto = new FormsContentDto(FORM_NAME_COLOR, 'wb.blocks.FormContentDto.112', FORM_TYPE_COLOR, content[FORM_NAME_COLOR], '#122231', '');
5256
5255
  formsDto.forms.push(colorContentDto);
@@ -6921,7 +6920,7 @@
6921
6920
  'wb.blocks.FormContentDto.117',
6922
6921
  ], ['0', '0.25', '0.5', '1']);
6923
6922
  imgBannerFormDto.forms.push(parallaxSpeedImgSimpleContentDto);
6924
- var 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');
6923
+ var 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');
6925
6924
  imgBannerFormDto.forms.push(parallaxInvertedImgSimpleContentDto);
6926
6925
  return imgBannerFormDto;
6927
6926
  };
@@ -11236,6 +11235,7 @@
11236
11235
  },
11237
11236
  clipboard: {
11238
11237
  matchers: [['BR', this.lineBreakMatcher]],
11238
+ matchVisual: false,
11239
11239
  },
11240
11240
  keyboard: {
11241
11241
  bindings: {
@@ -20355,6 +20355,13 @@
20355
20355
  var selection = this.currentSelection ? this.currentSelection : this.getSelection();
20356
20356
  return selection.anchorNode.parentElement.closest('.editorJs');
20357
20357
  };
20358
+ EditorJSTool.prototype.findParentModifier = function () {
20359
+ if (!this.parentEditor) {
20360
+ this.parentEditor = this.findParentEditor();
20361
+ }
20362
+ return (this.parentEditor.querySelectorAll('.ce-block')[this.api.blocks.getCurrentBlockIndex()].querySelector('.ce-paragraph')
20363
+ .children[0]);
20364
+ };
20358
20365
  EditorJSTool.prototype.clear = function () {
20359
20366
  resetBlockFocus(this.parentEditor);
20360
20367
  };
@@ -20422,7 +20429,7 @@
20422
20429
  }
20423
20430
  InlineStyleTool.prototype.execCommandStyle = function (action) {
20424
20431
  return __awaiter(this, void 0, void 0, function () {
20425
- var selection, anchorNode, container, sameSelection, error_1;
20432
+ var selection, anchorNode, container, sameSelection;
20426
20433
  return __generator(this, function (_c) {
20427
20434
  switch (_c.label) {
20428
20435
  case 0:
@@ -20444,41 +20451,38 @@
20444
20451
  return [4 /*yield*/, this.saveInlineSelection(container, true)];
20445
20452
  case 1:
20446
20453
  _c.sent();
20447
- _c.label = 2;
20448
- case 2:
20449
- _c.trys.push([2, 12, , 13]);
20450
- if (!this.linkDeletion) return [3 /*break*/, 4];
20454
+ console.log('=== inline tool execCommandStyle method ===');
20455
+ console.log(this.hasStyle(container));
20456
+ if (!this.linkDeletion) return [3 /*break*/, 3];
20451
20457
  return [4 /*yield*/, this.replaceLink(selection, this.hasStyle(container))];
20452
- case 3:
20458
+ case 2:
20453
20459
  _c.sent();
20454
- return [3 /*break*/, 8];
20455
- case 4:
20460
+ return [3 /*break*/, 7];
20461
+ case 3:
20456
20462
  if (!(sameSelection &&
20457
20463
  !this.isContainer(this.textContainers, container) &&
20458
20464
  this.hasStyle(container) &&
20459
- selection.toString() === this.hasStyle(container).innerText)) return [3 /*break*/, 6];
20465
+ selection.toString() === this.hasStyle(container).innerText)) return [3 /*break*/, 5];
20466
+ console.log('-> update selection');
20460
20467
  return [4 /*yield*/, this.updateSelection(selection, this.hasStyle(container), action, this.textContainers)];
20461
- case 5:
20468
+ case 4:
20462
20469
  _c.sent();
20463
- return [3 /*break*/, 8];
20464
- case 6: return [4 /*yield*/, this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers)];
20465
- case 7:
20470
+ return [3 /*break*/, 7];
20471
+ case 5:
20472
+ console.log('-> replace selection');
20473
+ return [4 /*yield*/, this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers)];
20474
+ case 6:
20466
20475
  _c.sent();
20467
- _c.label = 8;
20468
- case 8: return [4 /*yield*/, this.cleanupContainer(selection, container, true)];
20469
- case 9:
20476
+ _c.label = 7;
20477
+ case 7: return [4 /*yield*/, this.cleanupContainer(selection, container, true)];
20478
+ case 8:
20470
20479
  _c.sent();
20471
- if (!this.modifiedContent) return [3 /*break*/, 11];
20480
+ if (!this.modifiedContent) return [3 /*break*/, 10];
20472
20481
  return [4 /*yield*/, this.resetInlineSelection(container, true)];
20473
- case 10:
20482
+ case 9:
20474
20483
  _c.sent();
20475
- _c.label = 11;
20476
- case 11: return [3 /*break*/, 13];
20477
- case 12:
20478
- error_1 = _c.sent();
20479
- console.warn('Inline Tool Error : ' + error_1);
20480
- return [3 /*break*/, 13];
20481
- case 13: return [2 /*return*/];
20484
+ _c.label = 10;
20485
+ case 10: return [2 /*return*/];
20482
20486
  }
20483
20487
  });
20484
20488
  });
@@ -20535,20 +20539,21 @@
20535
20539
  InlineStyleTool.prototype.replaceSelection = function (container, action, selection, containers) {
20536
20540
  var _a;
20537
20541
  return __awaiter(this, void 0, void 0, function () {
20538
- var parentContainer, focusNode, offsetContainer, offsetParentContainer, range, currentFragment, currentElement_1, currentElementToAppend, currentParentElement, tmpElement, isLTR, selectionFocusOffset, selectionFocusNode, newSelection, preRange, preFragment, newElement, range, fragment, fragmentElement, newElement_2, elementToAppend;
20542
+ var focusNode, offsetContainer, parentContainer, offsetParentContainer, range, currentFragment, currentElement_1, currentElementToAppend, currentParentElement, tmpElement, isLTR, selectionFocusOffset, selectionFocusNode, newSelection, preRange, preFragment, newElement, range, fragment, fragmentElement, newElement_2, elementToAppend;
20539
20543
  return __generator(this, function (_c) {
20540
20544
  switch (_c.label) {
20541
20545
  case 0:
20542
- parentContainer = this.hasStyle(container);
20543
20546
  focusNode = selection.focusNode;
20544
20547
  offsetContainer = focusNode.nodeType !== Node.TEXT_NODE && focusNode.nodeType !== Node.COMMENT_NODE
20545
20548
  ? focusNode
20546
20549
  : focusNode.parentElement;
20550
+ parentContainer = this.hasStyle(container);
20547
20551
  offsetParentContainer = this.hasStyle(offsetContainer);
20548
20552
  if (!(parentContainer &&
20549
20553
  parentContainer === offsetParentContainer &&
20550
20554
  ((parentContainer.children.length > 0 && parentContainer.innerText !== parentContainer.children[0].textContent) ||
20551
20555
  parentContainer.innerText !== selection.toString()))) return [3 /*break*/, 3];
20556
+ console.log('if');
20552
20557
  range = this.getRangeObject(selection);
20553
20558
  currentFragment = range.extractContents();
20554
20559
  currentElement_1 = document.createElement('span');
@@ -20593,9 +20598,13 @@
20593
20598
  newElement.appendChild(preFragment);
20594
20599
  parentContainer.parentElement.insertBefore(currentElementToAppend, parentContainer);
20595
20600
  parentContainer.parentElement.insertBefore(newElement, currentElementToAppend);
20601
+ if (!parentContainer.textContent || parentContainer.textContent.length === 0) {
20602
+ parentContainer.parentElement.removeChild(parentContainer);
20603
+ }
20596
20604
  selection.selectAllChildren(currentElementToAppend);
20597
20605
  return [3 /*break*/, 7];
20598
20606
  case 3:
20607
+ console.log('else');
20599
20608
  range = this.getRangeObject(selection);
20600
20609
  fragment = range.extractContents();
20601
20610
  fragmentElement = document.createElement('div');
@@ -20603,6 +20612,7 @@
20603
20612
  case 4:
20604
20613
  newElement_2 = _c.sent();
20605
20614
  elementToAppend = newElement_2;
20615
+ console.log(newElement_2);
20606
20616
  fragmentElement.append(fragment);
20607
20617
  if (((_a = fragmentElement.children) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
20608
20618
  this.textContainers.split(',').indexOf(fragmentElement.children[0].tagName.toLowerCase()) > -1) {
@@ -20822,10 +20832,30 @@
20822
20832
  });
20823
20833
  });
20824
20834
  };
20835
+ InlineStyleTool.prototype.parentHasStyle = function (currentElement, referenceElement) {
20836
+ // Link exception
20837
+ if (!currentElement || referenceElement.tagName.toLowerCase() === 'a' || referenceElement.tagName.toLowerCase() === 'div') {
20838
+ return false;
20839
+ }
20840
+ if (referenceElement.tagName.toLowerCase() !== 'span' &&
20841
+ referenceElement.tagName.toLowerCase() === currentElement.tagName.toLowerCase()) {
20842
+ return true;
20843
+ }
20844
+ if (Object.keys(this.getInlineStyle(currentElement)).length > 0 && this.identicalInlineStyle(currentElement, referenceElement)) {
20845
+ return true;
20846
+ }
20847
+ if (currentElement.classList.length > 0 && this.identicalClassList(currentElement, referenceElement)) {
20848
+ return true;
20849
+ }
20850
+ if (currentElement.parentElement && currentElement.parentElement.tagName.toLowerCase() !== 'div') {
20851
+ return this.parentHasStyle(currentElement.parentElement, referenceElement);
20852
+ }
20853
+ return false;
20854
+ };
20825
20855
  InlineStyleTool.prototype.cleanupContainer = function (selection, container, firstTimeCall) {
20826
- var _a, _b;
20856
+ var _a;
20827
20857
  return __awaiter(this, void 0, void 0, function () {
20828
- var parentContainer, parentFound, children, currentNode, identicalElements, currentElement, nextElement, currentNodeFirstChild;
20858
+ var parentContainer, parentFound, children, currentNode, previousSibling, currentNodeFirstChild, nextCurrentElement, identicalElements, currentElement, nextElement, currentNodeFirstChild;
20829
20859
  return __generator(this, function (_c) {
20830
20860
  switch (_c.label) {
20831
20861
  case 0:
@@ -20849,25 +20879,29 @@
20849
20879
  }
20850
20880
  parentContainer.normalize();
20851
20881
  children = Array.from(parentContainer.childNodes);
20852
- if (!((children === null || children === void 0 ? void 0 : children.length) > 0)) return [3 /*break*/, 6];
20882
+ if (!((children === null || children === void 0 ? void 0 : children.length) > 0)) return [3 /*break*/, 4];
20853
20883
  currentNode = children[0];
20854
20884
  _c.label = 1;
20855
20885
  case 1:
20856
- if (!currentNode) return [3 /*break*/, 6];
20857
- console.log('currentNode');
20858
- console.log(currentNode);
20859
- console.log(currentNode.textContent);
20860
- console.log((_b = currentNode.textContent) === null || _b === void 0 ? void 0 : _b.length);
20861
- if (!(!currentNode.textContent || currentNode.textContent.length === 0)) return [3 /*break*/, 2];
20862
- parentContainer.removeChild(currentNode);
20863
- return [3 /*break*/, 5];
20864
- case 2:
20865
- if (!(currentNode.childNodes.length > 0)) return [3 /*break*/, 4];
20866
- return [4 /*yield*/, this.cleanupContainer(selection, currentNode, false)];
20867
- case 3:
20868
- _c.sent();
20869
- _c.label = 4;
20870
- case 4:
20886
+ if (!currentNode) return [3 /*break*/, 4];
20887
+ if (!currentNode.textContent ||
20888
+ currentNode.textContent.length === 0 ||
20889
+ (currentNode.nodeType === Node.ELEMENT_NODE && currentNode.innerText.length === 0)) {
20890
+ previousSibling = currentNode.previousSibling;
20891
+ parentContainer.removeChild(currentNode);
20892
+ currentNode = previousSibling;
20893
+ }
20894
+ if (currentNode.nodeType === Node.ELEMENT_NODE &&
20895
+ this.parentHasStyle(currentNode.parentElement, currentNode)) {
20896
+ currentNodeFirstChild = currentNode;
20897
+ nextCurrentElement = currentNode.firstChild;
20898
+ while (currentNode.firstChild) {
20899
+ parentContainer.insertBefore(currentNode.firstChild, currentNodeFirstChild.nextSibling);
20900
+ currentNodeFirstChild = currentNodeFirstChild.nextSibling;
20901
+ }
20902
+ parentContainer.removeChild(currentNode);
20903
+ currentNode = nextCurrentElement;
20904
+ }
20871
20905
  identicalElements = true;
20872
20906
  while (identicalElements &&
20873
20907
  currentNode.nextSibling &&
@@ -20878,8 +20912,7 @@
20878
20912
  if (this.identicalInlineStyle(currentElement, nextElement) &&
20879
20913
  currentElement.tagName.toLowerCase() === nextElement.tagName.toLowerCase() &&
20880
20914
  this.identicalClassList(currentElement, nextElement) &&
20881
- !currentElement.hasAttributes() &&
20882
- !nextElement.hasAttributes()) {
20915
+ this.identicalAttributes(currentElement, nextElement)) {
20883
20916
  currentElement.innerHTML += nextElement.innerHTML;
20884
20917
  nextElement.remove();
20885
20918
  this.modifiedContent = true;
@@ -20902,11 +20935,15 @@
20902
20935
  this.modifiedContent = true;
20903
20936
  }
20904
20937
  currentNode.normalize();
20905
- _c.label = 5;
20906
- case 5:
20938
+ if (!(currentNode.childNodes.length > 0)) return [3 /*break*/, 3];
20939
+ return [4 /*yield*/, this.cleanupContainer(selection, currentNode, false)];
20940
+ case 2:
20941
+ _c.sent();
20942
+ _c.label = 3;
20943
+ case 3:
20907
20944
  currentNode = currentNode.nextSibling;
20908
20945
  return [3 /*break*/, 1];
20909
- case 6: return [2 /*return*/];
20946
+ case 4: return [2 /*return*/];
20910
20947
  }
20911
20948
  });
20912
20949
  });
@@ -20926,6 +20963,18 @@
20926
20963
  return (__spread(currentElement.classList).every(function (classList) { return nextElement.classList.contains(classList); }) &&
20927
20964
  __spread(nextElement.classList).every(function (classList) { return currentElement.classList.contains(classList); }));
20928
20965
  };
20966
+ InlineStyleTool.prototype.identicalAttributes = function (currentElement, nextElement) {
20967
+ var currentElementAttributes = currentElement.getAttributeNames();
20968
+ currentElementAttributes.forEach(function (attribute) {
20969
+ if (attribute !== 'style') {
20970
+ if (!nextElement.getAttribute(attribute) ||
20971
+ nextElement.getAttribute(attribute) !== currentElement.getAttribute(attribute)) {
20972
+ return false;
20973
+ }
20974
+ }
20975
+ });
20976
+ return true;
20977
+ };
20929
20978
  InlineStyleTool.prototype.identicalInlineStyle = function (currentElement, nextElement) {
20930
20979
  var currentElementInlineStyle = this.getInlineStyle(currentElement);
20931
20980
  var nextElementInlineStyle = this.getInlineStyle(nextElement);
@@ -20971,7 +21020,7 @@
20971
21020
  InlineStyleTool.prototype.saveInlineSelection = function (container, firstTimeCall) {
20972
21021
  if (firstTimeCall === void 0) { firstTimeCall = false; }
20973
21022
  return __awaiter(this, void 0, void 0, function () {
20974
- var nextNode, selection, range, currentFragment, currentElement;
21023
+ var nextNode, selection, isLTR, range, currentFragment, currentElement;
20975
21024
  return __generator(this, function (_c) {
20976
21025
  switch (_c.label) {
20977
21026
  case 0:
@@ -20994,9 +21043,10 @@
20994
21043
  case 1:
20995
21044
  if (!(nextNode && (!this.foundAnchorNode || !this.foundFocusNode))) return [3 /*break*/, 4];
20996
21045
  if (nextNode === this.selectedAnchorNode) {
20997
- this.foundAnchorNode = true;
20998
- this.foundAnchorOffset += this.anchorOffset;
20999
21046
  selection = this.getSelection();
21047
+ isLTR = this.isAnchorBeforeFocus(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
21048
+ this.foundAnchorNode = true;
21049
+ this.foundAnchorOffset += isLTR ? this.anchorOffset : this.focusOffset;
21000
21050
  range = this.getRangeObject(selection);
21001
21051
  currentFragment = range.cloneContents();
21002
21052
  currentElement = document.createElement('span');
@@ -22667,7 +22717,7 @@
22667
22717
  if (!anchorNode) {
22668
22718
  return [2 /*return*/];
22669
22719
  }
22670
- parentModifier = this.findParentModifier(anchorNode.parentElement);
22720
+ parentModifier = this.findParentModifier();
22671
22721
  try {
22672
22722
  if (this.tag.toLowerCase() !== 'span') {
22673
22723
  this.changeContainerTag(parentModifier, selection);
@@ -22804,22 +22854,6 @@
22804
22854
  container.className += (container.className.length > 0 ? ' ' : '') + this.classToApply;
22805
22855
  }
22806
22856
  };
22807
- ParagraphStyleTool.prototype.findParentModifier = function (element) {
22808
- var currentElement = element;
22809
- if (currentElement.tagName.toLowerCase() === 'div') {
22810
- if (currentElement.classList.contains('ce-paragraph')) {
22811
- return currentElement.children[0];
22812
- }
22813
- return currentElement.closest('.codex-editor__redactor').querySelector('.ce-paragraph').children[0];
22814
- }
22815
- while (this.modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
22816
- if (currentElement.tagName.toLowerCase() === 'div') {
22817
- return null;
22818
- }
22819
- currentElement = currentElement.parentElement;
22820
- }
22821
- return currentElement;
22822
- };
22823
22857
  return ParagraphStyleTool;
22824
22858
  }(EditorJSTool));
22825
22859
  var listApi = null;
@@ -23158,7 +23192,7 @@
23158
23192
  if (!isBlockFocused) {
23159
23193
  setBlockFocus(this.parentEditor);
23160
23194
  }
23161
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23195
+ var parentModifier = this.findParentModifier();
23162
23196
  if (!parentModifier) {
23163
23197
  return false;
23164
23198
  }
@@ -23469,7 +23503,7 @@
23469
23503
  if (!isBlockFocused) {
23470
23504
  setBlockFocus(this.parentEditor);
23471
23505
  }
23472
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23506
+ var parentModifier = this.findParentModifier();
23473
23507
  if (!parentModifier) {
23474
23508
  return false;
23475
23509
  }
@@ -23605,7 +23639,7 @@
23605
23639
  if (!isBlockFocused) {
23606
23640
  setBlockFocus(this.parentEditor);
23607
23641
  }
23608
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23642
+ var parentModifier = this.findParentModifier();
23609
23643
  if (!parentModifier) {
23610
23644
  return false;
23611
23645
  }
@@ -23693,7 +23727,7 @@
23693
23727
  if (!isBlockFocused) {
23694
23728
  setBlockFocus(this.parentEditor);
23695
23729
  }
23696
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23730
+ var parentModifier = this.findParentModifier();
23697
23731
  if (!parentModifier) {
23698
23732
  return false;
23699
23733
  }
@@ -23781,7 +23815,7 @@
23781
23815
  if (!isBlockFocused) {
23782
23816
  setBlockFocus(this.parentEditor);
23783
23817
  }
23784
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23818
+ var parentModifier = this.findParentModifier();
23785
23819
  if (!parentModifier) {
23786
23820
  return false;
23787
23821
  }
@@ -24419,23 +24453,6 @@
24419
24453
  return true;
24420
24454
  }
24421
24455
  };
24422
- InlineTextTool.prototype.findParentModifier = function (element) {
24423
- var modifiers = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
24424
- var currentElement = element;
24425
- if (currentElement.tagName.toLowerCase() === 'div') {
24426
- if (currentElement.classList.contains('ce-paragraph')) {
24427
- return currentElement.firstElementChild;
24428
- }
24429
- return currentElement.querySelector('.ce-paragraph').children[0];
24430
- }
24431
- while (modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
24432
- if (currentElement.tagName.toLowerCase() === 'div') {
24433
- return null;
24434
- }
24435
- currentElement = currentElement.parentElement;
24436
- }
24437
- return currentElement;
24438
- };
24439
24456
  return InlineTextTool;
24440
24457
  }(InlineStyleTool));
24441
24458
 
@@ -24674,21 +24691,17 @@
24674
24691
  modal.appendChild(editorContainer);
24675
24692
  modal.appendChild(buttonContainer);
24676
24693
  container.appendChild(modal);
24677
- document.querySelector('body').appendChild(container);
24678
- setTimeout(function () {
24679
- console.log('monacoeditor init');
24680
- console.log(modal);
24681
- var monacoEditor = monaco.editor.create(editorContainer, {
24682
- value: content,
24683
- language: 'html',
24684
- ariaContainerElement: modal
24685
- });
24686
- saveButton.addEventListener('click', function () {
24687
- var content = monacoEditor.getValue();
24688
- saveCodeEditModal(content);
24689
- }, true);
24690
- buttonContainer.appendChild(saveButton);
24691
- }, 200);
24694
+ document.body.appendChild(container);
24695
+ var state$1 = state.EditorState.create({
24696
+ doc: content,
24697
+ extensions: [codemirror.basicSetup, langHtml.html()],
24698
+ });
24699
+ var view = new codemirror.EditorView({
24700
+ state: state$1,
24701
+ parent: editorContainer,
24702
+ });
24703
+ saveButton.addEventListener('click', function () { return saveCodeEditModal(view.state.doc.toString()); }, true);
24704
+ buttonContainer.appendChild(saveButton);
24692
24705
  };
24693
24706
  TextEditionTool.prototype.getSavedEditorContent = function (name) {
24694
24707
  return localStorage.getItem(name);
@@ -25272,6 +25285,7 @@
25272
25285
  this.timeoutHandle = null;
25273
25286
  this.timeoutTextEditionHandle = null;
25274
25287
  this.onChangeTimeoutHandle = null;
25288
+ this.editorInitialized = false;
25275
25289
  this.wrapperTags = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
25276
25290
  }
25277
25291
  EditorJsComponent.prototype.ngOnInit = function () {
@@ -25338,7 +25352,7 @@
25338
25352
  clearTimeout(_this.onChangeTimeoutHandle);
25339
25353
  _this.onChangeTimeoutHandle = setTimeout(function () {
25340
25354
  _this.contentChanged(api, event);
25341
- }, 300);
25355
+ }, 200);
25342
25356
  },
25343
25357
  i18n: this.getI18nDictionnary(),
25344
25358
  });
@@ -25353,12 +25367,10 @@
25353
25367
  _this.content = content;
25354
25368
  _this.applyContent();
25355
25369
  _this.checkSingleChild();
25356
- setTimeout(function () {
25357
- var editorElement = document.getElementById('editorJs-' + _this.uuid);
25358
- editorElement.addEventListener('focusin', function () {
25359
- setlistApiEditor(_this.editor, editorElement);
25360
- });
25361
- }, 0);
25370
+ var editorElement = document.getElementById('editorJs-' + _this.uuid);
25371
+ editorElement.addEventListener('focusin', function () {
25372
+ setlistApiEditor(_this.editor, editorElement);
25373
+ });
25362
25374
  });
25363
25375
  return [3 /*break*/, 4];
25364
25376
  case 3:
@@ -25373,7 +25385,6 @@
25373
25385
  EditorJsComponent.prototype.ngOnDestroy = function () {
25374
25386
  var editorName = 'editorJs-' + this.uuid;
25375
25387
  this.deleteSavedEditorContent(editorName);
25376
- this.deleteSavedEditorContent(editorName);
25377
25388
  this.editor.destroy();
25378
25389
  };
25379
25390
  EditorJsComponent.prototype.handleDefaultContentTranslation = function () {
@@ -25391,7 +25402,13 @@
25391
25402
  .save()
25392
25403
  .then(function () {
25393
25404
  _this.content = _this.getEditorContent();
25394
- _this.saveEditorContent(_this.content, _this.uuid);
25405
+ if (!_this.editorInitialized) {
25406
+ _this.handleSaveEditor(_this.content, _this.uuid);
25407
+ _this.editorInitialized = true;
25408
+ }
25409
+ else {
25410
+ _this.saveEditorContent(_this.content);
25411
+ }
25395
25412
  _this.contentChange.emit(_this.content);
25396
25413
  })
25397
25414
  .catch(function (error) {
@@ -25534,12 +25551,12 @@
25534
25551
  }
25535
25552
  return null;
25536
25553
  };
25537
- EditorJsComponent.prototype.saveEditorContent = function (data, uuid) {
25554
+ EditorJsComponent.prototype.saveEditorContent = function (data) {
25538
25555
  var _this = this;
25539
25556
  if (!isTextEditionTool) {
25540
25557
  clearTimeout(this.timeoutHandle);
25541
25558
  this.timeoutHandle = setTimeout(function () {
25542
- _this.handleSaveEditor(data, uuid);
25559
+ _this.handleSaveEditor(data, _this.uuid);
25543
25560
  }, 2000);
25544
25561
  }
25545
25562
  else {
@@ -25555,6 +25572,10 @@
25555
25572
  var savedDataIndex = this.getSavedEditorContent(editorName + '-index')
25556
25573
  ? parseInt(this.getSavedEditorContent(editorName + '-index'))
25557
25574
  : -1;
25575
+ if (!this.editorInitialized) {
25576
+ savedData = null;
25577
+ savedDataIndex = -1;
25578
+ }
25558
25579
  var parsedSavedData = [];
25559
25580
  if (savedData) {
25560
25581
  parsedSavedData = JSON.parse(savedData);
@@ -25576,6 +25597,7 @@
25576
25597
  };
25577
25598
  EditorJsComponent.prototype.deleteSavedEditorContent = function (name) {
25578
25599
  localStorage.removeItem(name);
25600
+ localStorage.removeItem(name + '-index');
25579
25601
  };
25580
25602
  return EditorJsComponent;
25581
25603
  }());
@@ -29355,19 +29377,15 @@
29355
29377
  ];
29356
29378
  QuotesSimpleBackgroundComponent.ctorParameters = function () { return []; };
29357
29379
 
29358
- var OpenMapDto = /** @class */ (function () {
29359
- function OpenMapDto() {
29360
- }
29361
- return OpenMapDto;
29362
- }());
29363
-
29364
29380
  var MapFullpageComponent = /** @class */ (function (_super) {
29365
29381
  __extends(MapFullpageComponent, _super);
29366
29382
  function MapFullpageComponent(externalConfigService) {
29367
29383
  var _this = _super.call(this) || this;
29368
29384
  _this.externalConfigService = externalConfigService;
29369
29385
  _this.address = '';
29386
+ _this.triggerAddress = '';
29370
29387
  _this.editPlaceMap = null;
29388
+ _this.firstTimeTrigger = false;
29371
29389
  _this.options = {};
29372
29390
  _this.layers = [];
29373
29391
  _this.showMap = false;
@@ -29377,41 +29395,29 @@
29377
29395
  MapFullpageComponent.prototype.ngOnInit = function () {
29378
29396
  _super.prototype.ngOnInit.call(this);
29379
29397
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
29380
- var algolia = new OpenMapDto();
29381
- algolia.suggestion = {
29382
- latlng: {
29383
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29384
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29398
+ this.googleMapReturnElement = {
29399
+ suggestion: {
29400
+ latlng: {
29401
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29402
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29403
+ },
29404
+ value: '',
29385
29405
  },
29386
- value: '',
29387
29406
  };
29388
- this.setCoordinateOnPlaces(algolia);
29389
- }
29390
- };
29391
- MapFullpageComponent.prototype.ngAfterViewInit = function () {
29392
- var _this = this;
29393
- if (!this.showMap) {
29394
- var placesAutocomplete = places__default['default']({
29395
- appId: this.externalConfigService.getAlgoliaAppId(),
29396
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29397
- container: this.input.nativeElement,
29398
- });
29399
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29400
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29401
- });
29407
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29402
29408
  }
29403
29409
  };
29404
- MapFullpageComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29410
+ MapFullpageComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29405
29411
  this.showMap = false;
29406
29412
  this.options = {
29407
29413
  layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29408
29414
  zoom: 18,
29409
29415
  zoomControl: false,
29410
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29416
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29411
29417
  };
29412
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29418
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29413
29419
  this.layers = [
29414
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29420
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29415
29421
  icon: leaflet.icon({
29416
29422
  iconSize: [25, 41],
29417
29423
  iconAnchor: [13, 41],
@@ -29420,24 +29426,23 @@
29420
29426
  }),
29421
29427
  }),
29422
29428
  ];
29423
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29424
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29425
- this.address = algoliaReturnElement.suggestion.value;
29429
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29430
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29431
+ this.address = googleResults.suggestion.value;
29426
29432
  this.showMap = true;
29427
29433
  this.persist();
29428
29434
  };
29429
- MapFullpageComponent.prototype.createEditAlgoliaInput = function () {
29430
- var _this = this;
29431
- if (this.editPlaceMap === null) {
29432
- this.editPlaceMap = places__default['default']({
29433
- appId: this.externalConfigService.getAlgoliaAppId(),
29434
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29435
- container: document.querySelector('#address-input-edit' + this.uuid),
29436
- });
29437
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29438
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29439
- });
29440
- }
29435
+ MapFullpageComponent.prototype.handleAddressChange = function (event) {
29436
+ this.googleMapReturnElement = {
29437
+ suggestion: {
29438
+ latlng: {
29439
+ lat: event.geometry.location.lat(),
29440
+ lng: event.geometry.location.lng(),
29441
+ },
29442
+ value: event.name,
29443
+ },
29444
+ };
29445
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29441
29446
  };
29442
29447
  /**
29443
29448
  * Avoid partial map loaded at the initialization
@@ -29453,7 +29458,7 @@
29453
29458
  MapFullpageComponent.decorators = [
29454
29459
  { type: i0.Component, args: [{
29455
29460
  selector: MapFullpageService.selector(),
29456
- 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"
29461
+ 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"
29457
29462
  },] }
29458
29463
  ];
29459
29464
  MapFullpageComponent.ctorParameters = function () { return [
@@ -29469,7 +29474,9 @@
29469
29474
  var _this = _super.call(this) || this;
29470
29475
  _this.externalConfigService = externalConfigService;
29471
29476
  _this.address = '';
29477
+ _this.triggerAddress = '';
29472
29478
  _this.editPlaceMap = null;
29479
+ _this.firstTimeTrigger = false;
29473
29480
  _this.options = {};
29474
29481
  _this.layers = [];
29475
29482
  _this.showMap = false;
@@ -29479,41 +29486,29 @@
29479
29486
  MapLeftTextComponent.prototype.ngOnInit = function () {
29480
29487
  _super.prototype.ngOnInit.call(this);
29481
29488
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
29482
- var algolia = new OpenMapDto();
29483
- algolia.suggestion = {
29484
- latlng: {
29485
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29486
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29489
+ this.googleMapReturnElement = {
29490
+ suggestion: {
29491
+ latlng: {
29492
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29493
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29494
+ },
29495
+ value: '',
29487
29496
  },
29488
- value: '',
29489
29497
  };
29490
- this.setCoordinateOnPlaces(algolia);
29491
- }
29492
- };
29493
- MapLeftTextComponent.prototype.ngAfterViewInit = function () {
29494
- var _this = this;
29495
- if (!this.showMap) {
29496
- var placesAutocomplete = places__default['default']({
29497
- appId: this.externalConfigService.getAlgoliaAppId(),
29498
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29499
- container: this.input.nativeElement,
29500
- });
29501
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29502
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29503
- });
29498
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29504
29499
  }
29505
29500
  };
29506
- MapLeftTextComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29501
+ MapLeftTextComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29507
29502
  this.showMap = false;
29508
29503
  this.options = {
29509
29504
  layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29510
29505
  zoom: 18,
29511
29506
  zoomControl: false,
29512
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29507
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29513
29508
  };
29514
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29509
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29515
29510
  this.layers = [
29516
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29511
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29517
29512
  icon: leaflet.icon({
29518
29513
  iconSize: [25, 41],
29519
29514
  iconAnchor: [13, 41],
@@ -29522,24 +29517,23 @@
29522
29517
  }),
29523
29518
  }),
29524
29519
  ];
29525
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29526
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29527
- this.address = algoliaReturnElement.suggestion.value;
29520
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29521
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29522
+ this.address = googleResults.suggestion.value;
29528
29523
  this.showMap = true;
29529
29524
  this.persist();
29530
29525
  };
29531
- MapLeftTextComponent.prototype.createEditAlgoliaInput = function () {
29532
- var _this = this;
29533
- if (this.editPlaceMap === null) {
29534
- this.editPlaceMap = places__default['default']({
29535
- appId: this.externalConfigService.getAlgoliaAppId(),
29536
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29537
- container: document.querySelector('#address-input-edit' + this.uuid),
29538
- });
29539
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29540
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29541
- });
29542
- }
29526
+ MapLeftTextComponent.prototype.handleAddressChange = function (event) {
29527
+ this.googleMapReturnElement = {
29528
+ suggestion: {
29529
+ latlng: {
29530
+ lat: event.geometry.location.lat(),
29531
+ lng: event.geometry.location.lng(),
29532
+ },
29533
+ value: event.name,
29534
+ },
29535
+ };
29536
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29543
29537
  };
29544
29538
  /**
29545
29539
  * Avoid partial map loaded at the initialization
@@ -29555,7 +29549,7 @@
29555
29549
  MapLeftTextComponent.decorators = [
29556
29550
  { type: i0.Component, args: [{
29557
29551
  selector: MapLeftTextService.selector(),
29558
- 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"
29552
+ 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"
29559
29553
  },] }
29560
29554
  ];
29561
29555
  MapLeftTextComponent.ctorParameters = function () { return [
@@ -29571,7 +29565,9 @@
29571
29565
  var _this = _super.call(this) || this;
29572
29566
  _this.externalConfigService = externalConfigService;
29573
29567
  _this.address = '';
29568
+ _this.triggerAddress = '';
29574
29569
  _this.editPlaceMap = null;
29570
+ _this.firstTimeTrigger = false;
29575
29571
  _this.options = {};
29576
29572
  _this.layers = [];
29577
29573
  _this.showMap = false;
@@ -29581,41 +29577,29 @@
29581
29577
  MapRightTextComponent.prototype.ngOnInit = function () {
29582
29578
  _super.prototype.ngOnInit.call(this);
29583
29579
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
29584
- var algolia = new OpenMapDto();
29585
- algolia.suggestion = {
29586
- latlng: {
29587
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29588
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29580
+ this.googleMapReturnElement = {
29581
+ suggestion: {
29582
+ latlng: {
29583
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29584
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29585
+ },
29586
+ value: '',
29589
29587
  },
29590
- value: '',
29591
29588
  };
29592
- this.setCoordinateOnPlaces(algolia);
29593
- }
29594
- };
29595
- MapRightTextComponent.prototype.ngAfterViewInit = function () {
29596
- var _this = this;
29597
- if (!this.showMap) {
29598
- var placesAutocomplete = places__default['default']({
29599
- appId: this.externalConfigService.getAlgoliaAppId(),
29600
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29601
- container: this.input.nativeElement,
29602
- });
29603
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29604
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29605
- });
29589
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29606
29590
  }
29607
29591
  };
29608
- MapRightTextComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29592
+ MapRightTextComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29609
29593
  this.showMap = false;
29610
29594
  this.options = {
29611
29595
  layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29612
29596
  zoom: 18,
29613
29597
  zoomControl: false,
29614
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29598
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29615
29599
  };
29616
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29600
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29617
29601
  this.layers = [
29618
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29602
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29619
29603
  icon: leaflet.icon({
29620
29604
  iconSize: [25, 41],
29621
29605
  iconAnchor: [13, 41],
@@ -29624,24 +29608,23 @@
29624
29608
  }),
29625
29609
  }),
29626
29610
  ];
29627
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29628
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29629
- this.address = algoliaReturnElement.suggestion.value;
29611
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29612
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29613
+ this.address = googleResults.suggestion.value;
29630
29614
  this.showMap = true;
29631
29615
  this.persist();
29632
29616
  };
29633
- MapRightTextComponent.prototype.createEditAlgoliaInput = function () {
29634
- var _this = this;
29635
- if (this.editPlaceMap === null) {
29636
- this.editPlaceMap = places__default['default']({
29637
- appId: this.externalConfigService.getAlgoliaAppId(),
29638
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29639
- container: document.querySelector('#address-input-edit' + this.uuid),
29640
- });
29641
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29642
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29643
- });
29644
- }
29617
+ MapRightTextComponent.prototype.handleAddressChange = function (event) {
29618
+ this.googleMapReturnElement = {
29619
+ suggestion: {
29620
+ latlng: {
29621
+ lat: event.geometry.location.lat(),
29622
+ lng: event.geometry.location.lng(),
29623
+ },
29624
+ value: event.name,
29625
+ },
29626
+ };
29627
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29645
29628
  };
29646
29629
  /**
29647
29630
  * Avoid partial map loaded at the initialization
@@ -29657,7 +29640,7 @@
29657
29640
  MapRightTextComponent.decorators = [
29658
29641
  { type: i0.Component, args: [{
29659
29642
  selector: MapRightTextService.selector(),
29660
- 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"
29643
+ 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"
29661
29644
  },] }
29662
29645
  ];
29663
29646
  MapRightTextComponent.ctorParameters = function () { return [
@@ -29667,6 +29650,12 @@
29667
29650
  input: [{ type: i0.ViewChild, args: ['myInput',] }]
29668
29651
  };
29669
29652
 
29653
+ var OpenMapDto = /** @class */ (function () {
29654
+ function OpenMapDto() {
29655
+ }
29656
+ return OpenMapDto;
29657
+ }());
29658
+
29670
29659
  var MapTextFormComponent = /** @class */ (function (_super) {
29671
29660
  __extends(MapTextFormComponent, _super);
29672
29661
  function MapTextFormComponent(apiService, externalConfigService) {
@@ -29674,7 +29663,9 @@
29674
29663
  _this.apiService = apiService;
29675
29664
  _this.externalConfigService = externalConfigService;
29676
29665
  _this.address = '';
29666
+ _this.triggerAddress = '';
29677
29667
  _this.editPlaceMap = null;
29668
+ _this.firstTimeTrigger = false;
29678
29669
  _this.options = {};
29679
29670
  _this.layers = [];
29680
29671
  _this.showMap = false;
@@ -29710,30 +29701,17 @@
29710
29701
  }
29711
29702
  });
29712
29703
  };
29713
- MapTextFormComponent.prototype.ngAfterViewInit = function () {
29714
- var _this = this;
29715
- if (!this.showMap) {
29716
- var placesAutocomplete = places__default['default']({
29717
- appId: this.externalConfigService.getAlgoliaAppId(),
29718
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29719
- container: this.input.nativeElement,
29720
- });
29721
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29722
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29723
- });
29724
- }
29725
- };
29726
- MapTextFormComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29704
+ MapTextFormComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29727
29705
  this.showMap = false;
29728
29706
  this.options = {
29729
- layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
29707
+ layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29730
29708
  zoom: 18,
29731
29709
  zoomControl: false,
29732
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29710
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29733
29711
  };
29734
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29712
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29735
29713
  this.layers = [
29736
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29714
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29737
29715
  icon: leaflet.icon({
29738
29716
  iconSize: [25, 41],
29739
29717
  iconAnchor: [13, 41],
@@ -29742,24 +29720,32 @@
29742
29720
  }),
29743
29721
  }),
29744
29722
  ];
29745
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29746
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29747
- this.address = algoliaReturnElement.suggestion.value;
29723
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29724
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29725
+ this.address = googleResults.suggestion.value;
29748
29726
  this.showMap = true;
29749
29727
  this.persist();
29750
29728
  };
29751
- MapTextFormComponent.prototype.createEditAlgoliaInput = function () {
29752
- var _this = this;
29753
- if (this.editPlaceMap === null) {
29754
- this.editPlaceMap = places__default['default']({
29755
- appId: this.externalConfigService.getAlgoliaAppId(),
29756
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29757
- container: document.querySelector('#address-input-edit' + this.uuid),
29758
- });
29759
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29760
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29761
- });
29762
- }
29729
+ MapTextFormComponent.prototype.handleAddressChange = function (event) {
29730
+ this.googleMapReturnElement = {
29731
+ suggestion: {
29732
+ latlng: {
29733
+ lat: event.geometry.location.lat(),
29734
+ lng: event.geometry.location.lng(),
29735
+ },
29736
+ value: event.name,
29737
+ },
29738
+ };
29739
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29740
+ };
29741
+ /**
29742
+ * Avoid partial map loaded at the initialization
29743
+ * @param map
29744
+ */
29745
+ MapTextFormComponent.prototype.onMapReady = function (map) {
29746
+ setTimeout(function () {
29747
+ map.invalidateSize();
29748
+ }, 0);
29763
29749
  };
29764
29750
  MapTextFormComponent.prototype.selectThisForm = function () {
29765
29751
  var _this = this;
@@ -29772,21 +29758,12 @@
29772
29758
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
29773
29759
  this.persist();
29774
29760
  };
29775
- /**
29776
- * Avoid partial map loaded at the initialization
29777
- * @param map
29778
- */
29779
- MapTextFormComponent.prototype.onMapReady = function (map) {
29780
- setTimeout(function () {
29781
- map.invalidateSize();
29782
- }, 0);
29783
- };
29784
29761
  return MapTextFormComponent;
29785
29762
  }(StructuresComponent));
29786
29763
  MapTextFormComponent.decorators = [
29787
29764
  { type: i0.Component, args: [{
29788
29765
  selector: MapTextFormService.selector(),
29789
- 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"
29766
+ 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"
29790
29767
  },] }
29791
29768
  ];
29792
29769
  MapTextFormComponent.ctorParameters = function () { return [
@@ -29803,7 +29780,9 @@
29803
29780
  var _this = _super.call(this) || this;
29804
29781
  _this.apiService = apiService;
29805
29782
  _this.address = '';
29783
+ _this.triggerAddress = '';
29806
29784
  _this.editPlaceMap = null;
29785
+ _this.firstTimeTrigger = false;
29807
29786
  _this.options = {};
29808
29787
  _this.layers = [];
29809
29788
  _this.showMap = false;
@@ -29828,28 +29807,17 @@
29828
29807
  }
29829
29808
  });
29830
29809
  };
29831
- MapBackgroundFormLeftComponent.prototype.ngAfterViewInit = function () {
29832
- var _this = this;
29833
- var placesAutocomplete = places__default['default']({
29834
- appId: 'pl9OI1NPY62Y',
29835
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29836
- container: this.input.nativeElement,
29837
- });
29838
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29839
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29840
- });
29841
- };
29842
- MapBackgroundFormLeftComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29810
+ MapBackgroundFormLeftComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29843
29811
  this.showMap = false;
29844
29812
  this.options = {
29845
- layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
29813
+ layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29846
29814
  zoom: 18,
29847
29815
  zoomControl: false,
29848
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29816
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29849
29817
  };
29850
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29818
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29851
29819
  this.layers = [
29852
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29820
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29853
29821
  icon: leaflet.icon({
29854
29822
  iconSize: [25, 41],
29855
29823
  iconAnchor: [13, 41],
@@ -29858,24 +29826,32 @@
29858
29826
  }),
29859
29827
  }),
29860
29828
  ];
29861
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29862
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29863
- this.address = algoliaReturnElement.suggestion.value;
29829
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29830
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29831
+ this.address = googleResults.suggestion.value;
29864
29832
  this.showMap = true;
29865
29833
  this.persist();
29866
29834
  };
29867
- MapBackgroundFormLeftComponent.prototype.createEditAlgoliaInput = function () {
29868
- var _this = this;
29869
- if (this.editPlaceMap === null) {
29870
- this.editPlaceMap = places__default['default']({
29871
- appId: 'pl9OI1NPY62Y',
29872
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29873
- container: document.querySelector('#address-input-edit' + this.uuid),
29874
- });
29875
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29876
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29877
- });
29878
- }
29835
+ MapBackgroundFormLeftComponent.prototype.handleAddressChange = function (event) {
29836
+ this.googleMapReturnElement = {
29837
+ suggestion: {
29838
+ latlng: {
29839
+ lat: event.geometry.location.lat(),
29840
+ lng: event.geometry.location.lng(),
29841
+ },
29842
+ value: event.name,
29843
+ },
29844
+ };
29845
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29846
+ };
29847
+ /**
29848
+ * Avoid partial map loaded at the initialization
29849
+ * @param map
29850
+ */
29851
+ MapBackgroundFormLeftComponent.prototype.onMapReady = function (map) {
29852
+ setTimeout(function () {
29853
+ map.invalidateSize();
29854
+ }, 0);
29879
29855
  };
29880
29856
  MapBackgroundFormLeftComponent.prototype.selectThisForm = function () {
29881
29857
  var _this = this;
@@ -29888,21 +29864,12 @@
29888
29864
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
29889
29865
  this.persist();
29890
29866
  };
29891
- /**
29892
- * Avoid partial map loaded at the initialization
29893
- * @param map
29894
- */
29895
- MapBackgroundFormLeftComponent.prototype.onMapReady = function (map) {
29896
- setTimeout(function () {
29897
- map.invalidateSize();
29898
- }, 0);
29899
- };
29900
29867
  return MapBackgroundFormLeftComponent;
29901
29868
  }(StructuresComponent));
29902
29869
  MapBackgroundFormLeftComponent.decorators = [
29903
29870
  { type: i0.Component, args: [{
29904
29871
  selector: MapBackgroundFormLeftService.selector(),
29905
- 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"
29872
+ 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"
29906
29873
  },] }
29907
29874
  ];
29908
29875
  MapBackgroundFormLeftComponent.ctorParameters = function () { return [
@@ -29918,7 +29885,9 @@
29918
29885
  var _this = _super.call(this) || this;
29919
29886
  _this.apiService = apiService;
29920
29887
  _this.address = '';
29888
+ _this.triggerAddress = '';
29921
29889
  _this.editPlaceMap = null;
29890
+ _this.firstTimeTrigger = false;
29922
29891
  _this.options = {};
29923
29892
  _this.layers = [];
29924
29893
  _this.showMap = false;
@@ -29943,28 +29912,17 @@
29943
29912
  }
29944
29913
  });
29945
29914
  };
29946
- MapBackgroundFormRightComponent.prototype.ngAfterViewInit = function () {
29947
- var _this = this;
29948
- var placesAutocomplete = places__default['default']({
29949
- appId: 'pl9OI1NPY62Y',
29950
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29951
- container: this.input.nativeElement,
29952
- });
29953
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29954
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29955
- });
29956
- };
29957
- MapBackgroundFormRightComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29915
+ MapBackgroundFormRightComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29958
29916
  this.showMap = false;
29959
29917
  this.options = {
29960
- layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
29918
+ layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29961
29919
  zoom: 18,
29962
29920
  zoomControl: false,
29963
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29921
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29964
29922
  };
29965
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29923
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29966
29924
  this.layers = [
29967
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29925
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29968
29926
  icon: leaflet.icon({
29969
29927
  iconSize: [25, 41],
29970
29928
  iconAnchor: [13, 41],
@@ -29973,24 +29931,32 @@
29973
29931
  }),
29974
29932
  }),
29975
29933
  ];
29976
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29977
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29978
- this.address = algoliaReturnElement.suggestion.value;
29934
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29935
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29936
+ this.address = googleResults.suggestion.value;
29979
29937
  this.showMap = true;
29980
29938
  this.persist();
29981
29939
  };
29982
- MapBackgroundFormRightComponent.prototype.createEditAlgoliaInput = function () {
29983
- var _this = this;
29984
- if (this.editPlaceMap === null) {
29985
- this.editPlaceMap = places__default['default']({
29986
- appId: 'pl9OI1NPY62Y',
29987
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29988
- container: document.querySelector('#address-input-edit' + this.uuid),
29989
- });
29990
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29991
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29992
- });
29993
- }
29940
+ MapBackgroundFormRightComponent.prototype.handleAddressChange = function (event) {
29941
+ this.googleMapReturnElement = {
29942
+ suggestion: {
29943
+ latlng: {
29944
+ lat: event.geometry.location.lat(),
29945
+ lng: event.geometry.location.lng(),
29946
+ },
29947
+ value: event.name,
29948
+ },
29949
+ };
29950
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29951
+ };
29952
+ /**
29953
+ * Avoid partial map loaded at the initialization
29954
+ * @param map
29955
+ */
29956
+ MapBackgroundFormRightComponent.prototype.onMapReady = function (map) {
29957
+ setTimeout(function () {
29958
+ map.invalidateSize();
29959
+ }, 0);
29994
29960
  };
29995
29961
  MapBackgroundFormRightComponent.prototype.selectThisForm = function () {
29996
29962
  var _this = this;
@@ -30003,21 +29969,12 @@
30003
29969
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
30004
29970
  this.persist();
30005
29971
  };
30006
- /**
30007
- * Avoid partial map loaded at the initialization
30008
- * @param map
30009
- */
30010
- MapBackgroundFormRightComponent.prototype.onMapReady = function (map) {
30011
- setTimeout(function () {
30012
- map.invalidateSize();
30013
- }, 0);
30014
- };
30015
29972
  return MapBackgroundFormRightComponent;
30016
29973
  }(StructuresComponent));
30017
29974
  MapBackgroundFormRightComponent.decorators = [
30018
29975
  { type: i0.Component, args: [{
30019
29976
  selector: MapBackgroundFormRightService.selector(),
30020
- 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"
29977
+ 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"
30021
29978
  },] }
30022
29979
  ];
30023
29980
  MapBackgroundFormRightComponent.ctorParameters = function () { return [
@@ -33183,6 +33140,7 @@
33183
33140
  imports: [
33184
33141
  SharedModule,
33185
33142
  ngxMonacoEditor.MonacoEditorModule,
33143
+ ngxGooglePlacesAutocomplete.GooglePlaceModule,
33186
33144
  ngxQuill.QuillModule,
33187
33145
  ngxLeaflet.LeafletModule,
33188
33146
  ngWiziBulma.NwbCommonModule,