@wizishop/wizi-block 4.2.32-beta → 4.2.35-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/bundles/wizishop-wizi-block.umd.js +320 -364
  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 +105 -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 +1 -1
  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 +328 -355
  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('codemirror'), require('@codemirror/state'), require('@codemirror/lang-html'), 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', 'codemirror', '@codemirror/state', '@codemirror/lang-html', '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.codemirror, global.state, global.langHtml, 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, codemirror, state, langHtml, 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,46 +20451,38 @@
20444
20451
  return [4 /*yield*/, this.saveInlineSelection(container, true)];
20445
20452
  case 1:
20446
20453
  _c.sent();
20447
- console.log('here');
20454
+ console.log('=== inline tool execCommandStyle method ===');
20448
20455
  console.log(this.hasStyle(container));
20449
- _c.label = 2;
20450
- case 2:
20451
- _c.trys.push([2, 12, , 13]);
20452
- if (!this.linkDeletion) return [3 /*break*/, 4];
20456
+ if (!this.linkDeletion) return [3 /*break*/, 3];
20453
20457
  return [4 /*yield*/, this.replaceLink(selection, this.hasStyle(container))];
20454
- case 3:
20458
+ case 2:
20455
20459
  _c.sent();
20456
- return [3 /*break*/, 8];
20457
- case 4:
20460
+ return [3 /*break*/, 7];
20461
+ case 3:
20458
20462
  if (!(sameSelection &&
20459
20463
  !this.isContainer(this.textContainers, container) &&
20460
20464
  this.hasStyle(container) &&
20461
- selection.toString() === this.hasStyle(container).innerText)) return [3 /*break*/, 6];
20462
- console.log('update');
20465
+ selection.toString() === this.hasStyle(container).innerText)) return [3 /*break*/, 5];
20466
+ console.log('-> update selection');
20463
20467
  return [4 /*yield*/, this.updateSelection(selection, this.hasStyle(container), action, this.textContainers)];
20464
- case 5:
20468
+ case 4:
20465
20469
  _c.sent();
20466
- return [3 /*break*/, 8];
20467
- case 6:
20468
- console.log('replace');
20470
+ return [3 /*break*/, 7];
20471
+ case 5:
20472
+ console.log('-> replace selection');
20469
20473
  return [4 /*yield*/, this.replaceSelection(this.getMostDescendantChild(container), action, selection, this.textContainers)];
20470
- case 7:
20474
+ case 6:
20471
20475
  _c.sent();
20472
- _c.label = 8;
20473
- case 8: return [4 /*yield*/, this.cleanupContainer(selection, container, true)];
20474
- case 9:
20476
+ _c.label = 7;
20477
+ case 7: return [4 /*yield*/, this.cleanupContainer(selection, container, true)];
20478
+ case 8:
20475
20479
  _c.sent();
20476
- if (!this.modifiedContent) return [3 /*break*/, 11];
20480
+ if (!this.modifiedContent) return [3 /*break*/, 10];
20477
20481
  return [4 /*yield*/, this.resetInlineSelection(container, true)];
20478
- case 10:
20482
+ case 9:
20479
20483
  _c.sent();
20480
- _c.label = 11;
20481
- case 11: return [3 /*break*/, 13];
20482
- case 12:
20483
- error_1 = _c.sent();
20484
- console.warn('Inline Tool Error : ' + error_1);
20485
- return [3 /*break*/, 13];
20486
- case 13: return [2 /*return*/];
20484
+ _c.label = 10;
20485
+ case 10: return [2 /*return*/];
20487
20486
  }
20488
20487
  });
20489
20488
  });
@@ -20540,15 +20539,15 @@
20540
20539
  InlineStyleTool.prototype.replaceSelection = function (container, action, selection, containers) {
20541
20540
  var _a;
20542
20541
  return __awaiter(this, void 0, void 0, function () {
20543
- 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;
20544
20543
  return __generator(this, function (_c) {
20545
20544
  switch (_c.label) {
20546
20545
  case 0:
20547
- parentContainer = this.hasStyle(container);
20548
20546
  focusNode = selection.focusNode;
20549
20547
  offsetContainer = focusNode.nodeType !== Node.TEXT_NODE && focusNode.nodeType !== Node.COMMENT_NODE
20550
20548
  ? focusNode
20551
20549
  : focusNode.parentElement;
20550
+ parentContainer = this.hasStyle(container);
20552
20551
  offsetParentContainer = this.hasStyle(offsetContainer);
20553
20552
  if (!(parentContainer &&
20554
20553
  parentContainer === offsetParentContainer &&
@@ -20580,8 +20579,6 @@
20580
20579
  currentParentElement = container;
20581
20580
  if (parentContainer.contains(currentParentElement)) {
20582
20581
  while (currentParentElement !== parentContainer) {
20583
- console.warn('currentParentElement');
20584
- console.log(currentParentElement);
20585
20582
  tmpElement = document.createElement(currentParentElement.tagName);
20586
20583
  tmpElement = this.setInlineStyle(currentParentElement, tmpElement);
20587
20584
  tmpElement.appendChild(currentElementToAppend);
@@ -20615,6 +20612,7 @@
20615
20612
  case 4:
20616
20613
  newElement_2 = _c.sent();
20617
20614
  elementToAppend = newElement_2;
20615
+ console.log(newElement_2);
20618
20616
  fragmentElement.append(fragment);
20619
20617
  if (((_a = fragmentElement.children) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
20620
20618
  this.textContainers.split(',').indexOf(fragmentElement.children[0].tagName.toLowerCase()) > -1) {
@@ -20834,10 +20832,30 @@
20834
20832
  });
20835
20833
  });
20836
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
+ };
20837
20855
  InlineStyleTool.prototype.cleanupContainer = function (selection, container, firstTimeCall) {
20838
20856
  var _a;
20839
20857
  return __awaiter(this, void 0, void 0, function () {
20840
- var parentContainer, parentFound, children, currentNode, identicalElements, currentElement, nextElement, currentNodeFirstChild;
20858
+ var parentContainer, parentFound, children, currentNode, previousSibling, currentNodeFirstChild, nextCurrentElement, identicalElements, currentElement, nextElement, currentNodeFirstChild;
20841
20859
  return __generator(this, function (_c) {
20842
20860
  switch (_c.label) {
20843
20861
  case 0:
@@ -20861,21 +20879,29 @@
20861
20879
  }
20862
20880
  parentContainer.normalize();
20863
20881
  children = Array.from(parentContainer.childNodes);
20864
- 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];
20865
20883
  currentNode = children[0];
20866
20884
  _c.label = 1;
20867
20885
  case 1:
20868
- if (!currentNode) return [3 /*break*/, 6];
20869
- if (!(!currentNode.textContent || currentNode.textContent.length === 0)) return [3 /*break*/, 2];
20870
- parentContainer.removeChild(currentNode);
20871
- return [3 /*break*/, 5];
20872
- case 2:
20873
- if (!(currentNode.childNodes.length > 0)) return [3 /*break*/, 4];
20874
- return [4 /*yield*/, this.cleanupContainer(selection, currentNode, false)];
20875
- case 3:
20876
- _c.sent();
20877
- _c.label = 4;
20878
- 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
+ }
20879
20905
  identicalElements = true;
20880
20906
  while (identicalElements &&
20881
20907
  currentNode.nextSibling &&
@@ -20886,8 +20912,7 @@
20886
20912
  if (this.identicalInlineStyle(currentElement, nextElement) &&
20887
20913
  currentElement.tagName.toLowerCase() === nextElement.tagName.toLowerCase() &&
20888
20914
  this.identicalClassList(currentElement, nextElement) &&
20889
- !currentElement.hasAttributes() &&
20890
- !nextElement.hasAttributes()) {
20915
+ this.identicalAttributes(currentElement, nextElement)) {
20891
20916
  currentElement.innerHTML += nextElement.innerHTML;
20892
20917
  nextElement.remove();
20893
20918
  this.modifiedContent = true;
@@ -20910,11 +20935,15 @@
20910
20935
  this.modifiedContent = true;
20911
20936
  }
20912
20937
  currentNode.normalize();
20913
- _c.label = 5;
20914
- 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:
20915
20944
  currentNode = currentNode.nextSibling;
20916
20945
  return [3 /*break*/, 1];
20917
- case 6: return [2 /*return*/];
20946
+ case 4: return [2 /*return*/];
20918
20947
  }
20919
20948
  });
20920
20949
  });
@@ -20934,6 +20963,20 @@
20934
20963
  return (__spread(currentElement.classList).every(function (classList) { return nextElement.classList.contains(classList); }) &&
20935
20964
  __spread(nextElement.classList).every(function (classList) { return currentElement.classList.contains(classList); }));
20936
20965
  };
20966
+ InlineStyleTool.prototype.identicalAttributes = function (currentElement, nextElement) {
20967
+ var currentElementAttributes = currentElement.getAttributeNames();
20968
+ if (currentElementAttributes) {
20969
+ currentElementAttributes.forEach(function (attribute) {
20970
+ if (attribute !== 'style') {
20971
+ if (!nextElement.getAttribute(attribute) ||
20972
+ nextElement.getAttribute(attribute) !== currentElement.getAttribute(attribute)) {
20973
+ return false;
20974
+ }
20975
+ }
20976
+ });
20977
+ }
20978
+ return true;
20979
+ };
20937
20980
  InlineStyleTool.prototype.identicalInlineStyle = function (currentElement, nextElement) {
20938
20981
  var currentElementInlineStyle = this.getInlineStyle(currentElement);
20939
20982
  var nextElementInlineStyle = this.getInlineStyle(nextElement);
@@ -20979,7 +21022,7 @@
20979
21022
  InlineStyleTool.prototype.saveInlineSelection = function (container, firstTimeCall) {
20980
21023
  if (firstTimeCall === void 0) { firstTimeCall = false; }
20981
21024
  return __awaiter(this, void 0, void 0, function () {
20982
- var nextNode, selection, range, currentFragment, currentElement;
21025
+ var nextNode, selection, isLTR, range, currentFragment, currentElement;
20983
21026
  return __generator(this, function (_c) {
20984
21027
  switch (_c.label) {
20985
21028
  case 0:
@@ -21002,9 +21045,10 @@
21002
21045
  case 1:
21003
21046
  if (!(nextNode && (!this.foundAnchorNode || !this.foundFocusNode))) return [3 /*break*/, 4];
21004
21047
  if (nextNode === this.selectedAnchorNode) {
21005
- this.foundAnchorNode = true;
21006
- this.foundAnchorOffset += this.anchorOffset;
21007
21048
  selection = this.getSelection();
21049
+ isLTR = this.isAnchorBeforeFocus(selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);
21050
+ this.foundAnchorNode = true;
21051
+ this.foundAnchorOffset += isLTR ? this.anchorOffset : this.focusOffset;
21008
21052
  range = this.getRangeObject(selection);
21009
21053
  currentFragment = range.cloneContents();
21010
21054
  currentElement = document.createElement('span');
@@ -22675,7 +22719,7 @@
22675
22719
  if (!anchorNode) {
22676
22720
  return [2 /*return*/];
22677
22721
  }
22678
- parentModifier = this.findParentModifier(anchorNode.parentElement);
22722
+ parentModifier = this.findParentModifier();
22679
22723
  try {
22680
22724
  if (this.tag.toLowerCase() !== 'span') {
22681
22725
  this.changeContainerTag(parentModifier, selection);
@@ -22812,22 +22856,6 @@
22812
22856
  container.className += (container.className.length > 0 ? ' ' : '') + this.classToApply;
22813
22857
  }
22814
22858
  };
22815
- ParagraphStyleTool.prototype.findParentModifier = function (element) {
22816
- var currentElement = element;
22817
- if (currentElement.tagName.toLowerCase() === 'div') {
22818
- if (currentElement.classList.contains('ce-paragraph')) {
22819
- return currentElement.children[0];
22820
- }
22821
- return currentElement.closest('.codex-editor__redactor').querySelector('.ce-paragraph').children[0];
22822
- }
22823
- while (this.modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
22824
- if (currentElement.tagName.toLowerCase() === 'div') {
22825
- return null;
22826
- }
22827
- currentElement = currentElement.parentElement;
22828
- }
22829
- return currentElement;
22830
- };
22831
22859
  return ParagraphStyleTool;
22832
22860
  }(EditorJSTool));
22833
22861
  var listApi = null;
@@ -23166,7 +23194,7 @@
23166
23194
  if (!isBlockFocused) {
23167
23195
  setBlockFocus(this.parentEditor);
23168
23196
  }
23169
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23197
+ var parentModifier = this.findParentModifier();
23170
23198
  if (!parentModifier) {
23171
23199
  return false;
23172
23200
  }
@@ -23477,7 +23505,7 @@
23477
23505
  if (!isBlockFocused) {
23478
23506
  setBlockFocus(this.parentEditor);
23479
23507
  }
23480
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23508
+ var parentModifier = this.findParentModifier();
23481
23509
  if (!parentModifier) {
23482
23510
  return false;
23483
23511
  }
@@ -23613,7 +23641,7 @@
23613
23641
  if (!isBlockFocused) {
23614
23642
  setBlockFocus(this.parentEditor);
23615
23643
  }
23616
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23644
+ var parentModifier = this.findParentModifier();
23617
23645
  if (!parentModifier) {
23618
23646
  return false;
23619
23647
  }
@@ -23701,7 +23729,7 @@
23701
23729
  if (!isBlockFocused) {
23702
23730
  setBlockFocus(this.parentEditor);
23703
23731
  }
23704
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23732
+ var parentModifier = this.findParentModifier();
23705
23733
  if (!parentModifier) {
23706
23734
  return false;
23707
23735
  }
@@ -23789,7 +23817,7 @@
23789
23817
  if (!isBlockFocused) {
23790
23818
  setBlockFocus(this.parentEditor);
23791
23819
  }
23792
- var parentModifier = this.findParentModifier(selection.anchorNode.parentElement);
23820
+ var parentModifier = this.findParentModifier();
23793
23821
  if (!parentModifier) {
23794
23822
  return false;
23795
23823
  }
@@ -24427,23 +24455,6 @@
24427
24455
  return true;
24428
24456
  }
24429
24457
  };
24430
- InlineTextTool.prototype.findParentModifier = function (element) {
24431
- var modifiers = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
24432
- var currentElement = element;
24433
- if (currentElement.tagName.toLowerCase() === 'div') {
24434
- if (currentElement.classList.contains('ce-paragraph')) {
24435
- return currentElement.firstElementChild;
24436
- }
24437
- return currentElement.querySelector('.ce-paragraph').children[0];
24438
- }
24439
- while (modifiers.split(',').indexOf(currentElement.tagName.toLowerCase()) === -1) {
24440
- if (currentElement.tagName.toLowerCase() === 'div') {
24441
- return null;
24442
- }
24443
- currentElement = currentElement.parentElement;
24444
- }
24445
- return currentElement;
24446
- };
24447
24458
  return InlineTextTool;
24448
24459
  }(InlineStyleTool));
24449
24460
 
@@ -25276,6 +25287,7 @@
25276
25287
  this.timeoutHandle = null;
25277
25288
  this.timeoutTextEditionHandle = null;
25278
25289
  this.onChangeTimeoutHandle = null;
25290
+ this.editorInitialized = false;
25279
25291
  this.wrapperTags = 'h1,h2,h3,h4,h5,h6,p,ul,ol,blockquote';
25280
25292
  }
25281
25293
  EditorJsComponent.prototype.ngOnInit = function () {
@@ -25342,7 +25354,7 @@
25342
25354
  clearTimeout(_this.onChangeTimeoutHandle);
25343
25355
  _this.onChangeTimeoutHandle = setTimeout(function () {
25344
25356
  _this.contentChanged(api, event);
25345
- }, 300);
25357
+ }, 200);
25346
25358
  },
25347
25359
  i18n: this.getI18nDictionnary(),
25348
25360
  });
@@ -25357,12 +25369,10 @@
25357
25369
  _this.content = content;
25358
25370
  _this.applyContent();
25359
25371
  _this.checkSingleChild();
25360
- setTimeout(function () {
25361
- var editorElement = document.getElementById('editorJs-' + _this.uuid);
25362
- editorElement.addEventListener('focusin', function () {
25363
- setlistApiEditor(_this.editor, editorElement);
25364
- });
25365
- }, 0);
25372
+ var editorElement = document.getElementById('editorJs-' + _this.uuid);
25373
+ editorElement.addEventListener('focusin', function () {
25374
+ setlistApiEditor(_this.editor, editorElement);
25375
+ });
25366
25376
  });
25367
25377
  return [3 /*break*/, 4];
25368
25378
  case 3:
@@ -25377,7 +25387,6 @@
25377
25387
  EditorJsComponent.prototype.ngOnDestroy = function () {
25378
25388
  var editorName = 'editorJs-' + this.uuid;
25379
25389
  this.deleteSavedEditorContent(editorName);
25380
- this.deleteSavedEditorContent(editorName);
25381
25390
  this.editor.destroy();
25382
25391
  };
25383
25392
  EditorJsComponent.prototype.handleDefaultContentTranslation = function () {
@@ -25395,7 +25404,13 @@
25395
25404
  .save()
25396
25405
  .then(function () {
25397
25406
  _this.content = _this.getEditorContent();
25398
- _this.saveEditorContent(_this.content, _this.uuid);
25407
+ if (!_this.editorInitialized) {
25408
+ _this.handleSaveEditor(_this.content, _this.uuid);
25409
+ _this.editorInitialized = true;
25410
+ }
25411
+ else {
25412
+ _this.saveEditorContent(_this.content);
25413
+ }
25399
25414
  _this.contentChange.emit(_this.content);
25400
25415
  })
25401
25416
  .catch(function (error) {
@@ -25538,12 +25553,12 @@
25538
25553
  }
25539
25554
  return null;
25540
25555
  };
25541
- EditorJsComponent.prototype.saveEditorContent = function (data, uuid) {
25556
+ EditorJsComponent.prototype.saveEditorContent = function (data) {
25542
25557
  var _this = this;
25543
25558
  if (!isTextEditionTool) {
25544
25559
  clearTimeout(this.timeoutHandle);
25545
25560
  this.timeoutHandle = setTimeout(function () {
25546
- _this.handleSaveEditor(data, uuid);
25561
+ _this.handleSaveEditor(data, _this.uuid);
25547
25562
  }, 2000);
25548
25563
  }
25549
25564
  else {
@@ -25559,6 +25574,10 @@
25559
25574
  var savedDataIndex = this.getSavedEditorContent(editorName + '-index')
25560
25575
  ? parseInt(this.getSavedEditorContent(editorName + '-index'))
25561
25576
  : -1;
25577
+ if (!this.editorInitialized) {
25578
+ savedData = null;
25579
+ savedDataIndex = -1;
25580
+ }
25562
25581
  var parsedSavedData = [];
25563
25582
  if (savedData) {
25564
25583
  parsedSavedData = JSON.parse(savedData);
@@ -25580,6 +25599,7 @@
25580
25599
  };
25581
25600
  EditorJsComponent.prototype.deleteSavedEditorContent = function (name) {
25582
25601
  localStorage.removeItem(name);
25602
+ localStorage.removeItem(name + '-index');
25583
25603
  };
25584
25604
  return EditorJsComponent;
25585
25605
  }());
@@ -29359,19 +29379,15 @@
29359
29379
  ];
29360
29380
  QuotesSimpleBackgroundComponent.ctorParameters = function () { return []; };
29361
29381
 
29362
- var OpenMapDto = /** @class */ (function () {
29363
- function OpenMapDto() {
29364
- }
29365
- return OpenMapDto;
29366
- }());
29367
-
29368
29382
  var MapFullpageComponent = /** @class */ (function (_super) {
29369
29383
  __extends(MapFullpageComponent, _super);
29370
29384
  function MapFullpageComponent(externalConfigService) {
29371
29385
  var _this = _super.call(this) || this;
29372
29386
  _this.externalConfigService = externalConfigService;
29373
29387
  _this.address = '';
29388
+ _this.triggerAddress = '';
29374
29389
  _this.editPlaceMap = null;
29390
+ _this.firstTimeTrigger = false;
29375
29391
  _this.options = {};
29376
29392
  _this.layers = [];
29377
29393
  _this.showMap = false;
@@ -29381,41 +29397,29 @@
29381
29397
  MapFullpageComponent.prototype.ngOnInit = function () {
29382
29398
  _super.prototype.ngOnInit.call(this);
29383
29399
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
29384
- var algolia = new OpenMapDto();
29385
- algolia.suggestion = {
29386
- latlng: {
29387
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29388
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29400
+ this.googleMapReturnElement = {
29401
+ suggestion: {
29402
+ latlng: {
29403
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29404
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29405
+ },
29406
+ value: '',
29389
29407
  },
29390
- value: '',
29391
29408
  };
29392
- this.setCoordinateOnPlaces(algolia);
29393
- }
29394
- };
29395
- MapFullpageComponent.prototype.ngAfterViewInit = function () {
29396
- var _this = this;
29397
- if (!this.showMap) {
29398
- var placesAutocomplete = places__default['default']({
29399
- appId: this.externalConfigService.getAlgoliaAppId(),
29400
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29401
- container: this.input.nativeElement,
29402
- });
29403
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29404
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29405
- });
29409
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29406
29410
  }
29407
29411
  };
29408
- MapFullpageComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29412
+ MapFullpageComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29409
29413
  this.showMap = false;
29410
29414
  this.options = {
29411
29415
  layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29412
29416
  zoom: 18,
29413
29417
  zoomControl: false,
29414
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29418
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29415
29419
  };
29416
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29420
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29417
29421
  this.layers = [
29418
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29422
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29419
29423
  icon: leaflet.icon({
29420
29424
  iconSize: [25, 41],
29421
29425
  iconAnchor: [13, 41],
@@ -29424,24 +29428,23 @@
29424
29428
  }),
29425
29429
  }),
29426
29430
  ];
29427
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29428
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29429
- this.address = algoliaReturnElement.suggestion.value;
29431
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29432
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29433
+ this.address = googleResults.suggestion.value;
29430
29434
  this.showMap = true;
29431
29435
  this.persist();
29432
29436
  };
29433
- MapFullpageComponent.prototype.createEditAlgoliaInput = function () {
29434
- var _this = this;
29435
- if (this.editPlaceMap === null) {
29436
- this.editPlaceMap = places__default['default']({
29437
- appId: this.externalConfigService.getAlgoliaAppId(),
29438
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29439
- container: document.querySelector('#address-input-edit' + this.uuid),
29440
- });
29441
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29442
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29443
- });
29444
- }
29437
+ MapFullpageComponent.prototype.handleAddressChange = function (event) {
29438
+ this.googleMapReturnElement = {
29439
+ suggestion: {
29440
+ latlng: {
29441
+ lat: event.geometry.location.lat(),
29442
+ lng: event.geometry.location.lng(),
29443
+ },
29444
+ value: event.name,
29445
+ },
29446
+ };
29447
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29445
29448
  };
29446
29449
  /**
29447
29450
  * Avoid partial map loaded at the initialization
@@ -29457,7 +29460,7 @@
29457
29460
  MapFullpageComponent.decorators = [
29458
29461
  { type: i0.Component, args: [{
29459
29462
  selector: MapFullpageService.selector(),
29460
- 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"
29463
+ 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"
29461
29464
  },] }
29462
29465
  ];
29463
29466
  MapFullpageComponent.ctorParameters = function () { return [
@@ -29473,7 +29476,9 @@
29473
29476
  var _this = _super.call(this) || this;
29474
29477
  _this.externalConfigService = externalConfigService;
29475
29478
  _this.address = '';
29479
+ _this.triggerAddress = '';
29476
29480
  _this.editPlaceMap = null;
29481
+ _this.firstTimeTrigger = false;
29477
29482
  _this.options = {};
29478
29483
  _this.layers = [];
29479
29484
  _this.showMap = false;
@@ -29483,41 +29488,29 @@
29483
29488
  MapLeftTextComponent.prototype.ngOnInit = function () {
29484
29489
  _super.prototype.ngOnInit.call(this);
29485
29490
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
29486
- var algolia = new OpenMapDto();
29487
- algolia.suggestion = {
29488
- latlng: {
29489
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29490
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29491
+ this.googleMapReturnElement = {
29492
+ suggestion: {
29493
+ latlng: {
29494
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29495
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29496
+ },
29497
+ value: '',
29491
29498
  },
29492
- value: '',
29493
29499
  };
29494
- this.setCoordinateOnPlaces(algolia);
29500
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29495
29501
  }
29496
29502
  };
29497
- MapLeftTextComponent.prototype.ngAfterViewInit = function () {
29498
- var _this = this;
29499
- if (!this.showMap) {
29500
- var placesAutocomplete = places__default['default']({
29501
- appId: this.externalConfigService.getAlgoliaAppId(),
29502
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29503
- container: this.input.nativeElement,
29504
- });
29505
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29506
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29507
- });
29508
- }
29509
- };
29510
- MapLeftTextComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29503
+ MapLeftTextComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29511
29504
  this.showMap = false;
29512
29505
  this.options = {
29513
29506
  layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29514
29507
  zoom: 18,
29515
29508
  zoomControl: false,
29516
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29509
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29517
29510
  };
29518
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29511
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29519
29512
  this.layers = [
29520
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29513
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29521
29514
  icon: leaflet.icon({
29522
29515
  iconSize: [25, 41],
29523
29516
  iconAnchor: [13, 41],
@@ -29526,24 +29519,23 @@
29526
29519
  }),
29527
29520
  }),
29528
29521
  ];
29529
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29530
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29531
- this.address = algoliaReturnElement.suggestion.value;
29522
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29523
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29524
+ this.address = googleResults.suggestion.value;
29532
29525
  this.showMap = true;
29533
29526
  this.persist();
29534
29527
  };
29535
- MapLeftTextComponent.prototype.createEditAlgoliaInput = function () {
29536
- var _this = this;
29537
- if (this.editPlaceMap === null) {
29538
- this.editPlaceMap = places__default['default']({
29539
- appId: this.externalConfigService.getAlgoliaAppId(),
29540
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29541
- container: document.querySelector('#address-input-edit' + this.uuid),
29542
- });
29543
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29544
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29545
- });
29546
- }
29528
+ MapLeftTextComponent.prototype.handleAddressChange = function (event) {
29529
+ this.googleMapReturnElement = {
29530
+ suggestion: {
29531
+ latlng: {
29532
+ lat: event.geometry.location.lat(),
29533
+ lng: event.geometry.location.lng(),
29534
+ },
29535
+ value: event.name,
29536
+ },
29537
+ };
29538
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29547
29539
  };
29548
29540
  /**
29549
29541
  * Avoid partial map loaded at the initialization
@@ -29559,7 +29551,7 @@
29559
29551
  MapLeftTextComponent.decorators = [
29560
29552
  { type: i0.Component, args: [{
29561
29553
  selector: MapLeftTextService.selector(),
29562
- 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"
29554
+ 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"
29563
29555
  },] }
29564
29556
  ];
29565
29557
  MapLeftTextComponent.ctorParameters = function () { return [
@@ -29575,7 +29567,9 @@
29575
29567
  var _this = _super.call(this) || this;
29576
29568
  _this.externalConfigService = externalConfigService;
29577
29569
  _this.address = '';
29570
+ _this.triggerAddress = '';
29578
29571
  _this.editPlaceMap = null;
29572
+ _this.firstTimeTrigger = false;
29579
29573
  _this.options = {};
29580
29574
  _this.layers = [];
29581
29575
  _this.showMap = false;
@@ -29585,41 +29579,29 @@
29585
29579
  MapRightTextComponent.prototype.ngOnInit = function () {
29586
29580
  _super.prototype.ngOnInit.call(this);
29587
29581
  if (this.contentBlock[this.FORM_NAME_COORDINATE_Y] && this.contentBlock[this.FORM_NAME_COORDINATE_X]) {
29588
- var algolia = new OpenMapDto();
29589
- algolia.suggestion = {
29590
- latlng: {
29591
- lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29592
- lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29582
+ this.googleMapReturnElement = {
29583
+ suggestion: {
29584
+ latlng: {
29585
+ lat: this.contentBlock[this.FORM_NAME_COORDINATE_Y],
29586
+ lng: this.contentBlock[this.FORM_NAME_COORDINATE_X],
29587
+ },
29588
+ value: '',
29593
29589
  },
29594
- value: '',
29595
29590
  };
29596
- this.setCoordinateOnPlaces(algolia);
29597
- }
29598
- };
29599
- MapRightTextComponent.prototype.ngAfterViewInit = function () {
29600
- var _this = this;
29601
- if (!this.showMap) {
29602
- var placesAutocomplete = places__default['default']({
29603
- appId: this.externalConfigService.getAlgoliaAppId(),
29604
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29605
- container: this.input.nativeElement,
29606
- });
29607
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29608
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29609
- });
29591
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29610
29592
  }
29611
29593
  };
29612
- MapRightTextComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29594
+ MapRightTextComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29613
29595
  this.showMap = false;
29614
29596
  this.options = {
29615
29597
  layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29616
29598
  zoom: 18,
29617
29599
  zoomControl: false,
29618
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29600
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29619
29601
  };
29620
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29602
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29621
29603
  this.layers = [
29622
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29604
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29623
29605
  icon: leaflet.icon({
29624
29606
  iconSize: [25, 41],
29625
29607
  iconAnchor: [13, 41],
@@ -29628,24 +29610,23 @@
29628
29610
  }),
29629
29611
  }),
29630
29612
  ];
29631
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29632
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29633
- this.address = algoliaReturnElement.suggestion.value;
29613
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29614
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29615
+ this.address = googleResults.suggestion.value;
29634
29616
  this.showMap = true;
29635
29617
  this.persist();
29636
29618
  };
29637
- MapRightTextComponent.prototype.createEditAlgoliaInput = function () {
29638
- var _this = this;
29639
- if (this.editPlaceMap === null) {
29640
- this.editPlaceMap = places__default['default']({
29641
- appId: this.externalConfigService.getAlgoliaAppId(),
29642
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29643
- container: document.querySelector('#address-input-edit' + this.uuid),
29644
- });
29645
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29646
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29647
- });
29648
- }
29619
+ MapRightTextComponent.prototype.handleAddressChange = function (event) {
29620
+ this.googleMapReturnElement = {
29621
+ suggestion: {
29622
+ latlng: {
29623
+ lat: event.geometry.location.lat(),
29624
+ lng: event.geometry.location.lng(),
29625
+ },
29626
+ value: event.name,
29627
+ },
29628
+ };
29629
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29649
29630
  };
29650
29631
  /**
29651
29632
  * Avoid partial map loaded at the initialization
@@ -29661,7 +29642,7 @@
29661
29642
  MapRightTextComponent.decorators = [
29662
29643
  { type: i0.Component, args: [{
29663
29644
  selector: MapRightTextService.selector(),
29664
- 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"
29645
+ 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"
29665
29646
  },] }
29666
29647
  ];
29667
29648
  MapRightTextComponent.ctorParameters = function () { return [
@@ -29671,6 +29652,12 @@
29671
29652
  input: [{ type: i0.ViewChild, args: ['myInput',] }]
29672
29653
  };
29673
29654
 
29655
+ var OpenMapDto = /** @class */ (function () {
29656
+ function OpenMapDto() {
29657
+ }
29658
+ return OpenMapDto;
29659
+ }());
29660
+
29674
29661
  var MapTextFormComponent = /** @class */ (function (_super) {
29675
29662
  __extends(MapTextFormComponent, _super);
29676
29663
  function MapTextFormComponent(apiService, externalConfigService) {
@@ -29678,7 +29665,9 @@
29678
29665
  _this.apiService = apiService;
29679
29666
  _this.externalConfigService = externalConfigService;
29680
29667
  _this.address = '';
29668
+ _this.triggerAddress = '';
29681
29669
  _this.editPlaceMap = null;
29670
+ _this.firstTimeTrigger = false;
29682
29671
  _this.options = {};
29683
29672
  _this.layers = [];
29684
29673
  _this.showMap = false;
@@ -29714,30 +29703,17 @@
29714
29703
  }
29715
29704
  });
29716
29705
  };
29717
- MapTextFormComponent.prototype.ngAfterViewInit = function () {
29718
- var _this = this;
29719
- if (!this.showMap) {
29720
- var placesAutocomplete = places__default['default']({
29721
- appId: this.externalConfigService.getAlgoliaAppId(),
29722
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29723
- container: this.input.nativeElement,
29724
- });
29725
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29726
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29727
- });
29728
- }
29729
- };
29730
- MapTextFormComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29706
+ MapTextFormComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29731
29707
  this.showMap = false;
29732
29708
  this.options = {
29733
- layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
29709
+ layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29734
29710
  zoom: 18,
29735
29711
  zoomControl: false,
29736
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29712
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29737
29713
  };
29738
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29714
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29739
29715
  this.layers = [
29740
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29716
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29741
29717
  icon: leaflet.icon({
29742
29718
  iconSize: [25, 41],
29743
29719
  iconAnchor: [13, 41],
@@ -29746,24 +29722,32 @@
29746
29722
  }),
29747
29723
  }),
29748
29724
  ];
29749
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29750
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29751
- this.address = algoliaReturnElement.suggestion.value;
29725
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29726
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29727
+ this.address = googleResults.suggestion.value;
29752
29728
  this.showMap = true;
29753
29729
  this.persist();
29754
29730
  };
29755
- MapTextFormComponent.prototype.createEditAlgoliaInput = function () {
29756
- var _this = this;
29757
- if (this.editPlaceMap === null) {
29758
- this.editPlaceMap = places__default['default']({
29759
- appId: this.externalConfigService.getAlgoliaAppId(),
29760
- apiKey: this.externalConfigService.getAlgoliaApiKey(),
29761
- container: document.querySelector('#address-input-edit' + this.uuid),
29762
- });
29763
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29764
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29765
- });
29766
- }
29731
+ MapTextFormComponent.prototype.handleAddressChange = function (event) {
29732
+ this.googleMapReturnElement = {
29733
+ suggestion: {
29734
+ latlng: {
29735
+ lat: event.geometry.location.lat(),
29736
+ lng: event.geometry.location.lng(),
29737
+ },
29738
+ value: event.name,
29739
+ },
29740
+ };
29741
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29742
+ };
29743
+ /**
29744
+ * Avoid partial map loaded at the initialization
29745
+ * @param map
29746
+ */
29747
+ MapTextFormComponent.prototype.onMapReady = function (map) {
29748
+ setTimeout(function () {
29749
+ map.invalidateSize();
29750
+ }, 0);
29767
29751
  };
29768
29752
  MapTextFormComponent.prototype.selectThisForm = function () {
29769
29753
  var _this = this;
@@ -29776,21 +29760,12 @@
29776
29760
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
29777
29761
  this.persist();
29778
29762
  };
29779
- /**
29780
- * Avoid partial map loaded at the initialization
29781
- * @param map
29782
- */
29783
- MapTextFormComponent.prototype.onMapReady = function (map) {
29784
- setTimeout(function () {
29785
- map.invalidateSize();
29786
- }, 0);
29787
- };
29788
29763
  return MapTextFormComponent;
29789
29764
  }(StructuresComponent));
29790
29765
  MapTextFormComponent.decorators = [
29791
29766
  { type: i0.Component, args: [{
29792
29767
  selector: MapTextFormService.selector(),
29793
- 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"
29768
+ 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"
29794
29769
  },] }
29795
29770
  ];
29796
29771
  MapTextFormComponent.ctorParameters = function () { return [
@@ -29807,7 +29782,9 @@
29807
29782
  var _this = _super.call(this) || this;
29808
29783
  _this.apiService = apiService;
29809
29784
  _this.address = '';
29785
+ _this.triggerAddress = '';
29810
29786
  _this.editPlaceMap = null;
29787
+ _this.firstTimeTrigger = false;
29811
29788
  _this.options = {};
29812
29789
  _this.layers = [];
29813
29790
  _this.showMap = false;
@@ -29832,28 +29809,17 @@
29832
29809
  }
29833
29810
  });
29834
29811
  };
29835
- MapBackgroundFormLeftComponent.prototype.ngAfterViewInit = function () {
29836
- var _this = this;
29837
- var placesAutocomplete = places__default['default']({
29838
- appId: 'pl9OI1NPY62Y',
29839
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29840
- container: this.input.nativeElement,
29841
- });
29842
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29843
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29844
- });
29845
- };
29846
- MapBackgroundFormLeftComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29812
+ MapBackgroundFormLeftComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29847
29813
  this.showMap = false;
29848
29814
  this.options = {
29849
- layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
29815
+ layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29850
29816
  zoom: 18,
29851
29817
  zoomControl: false,
29852
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29818
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29853
29819
  };
29854
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29820
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29855
29821
  this.layers = [
29856
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29822
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29857
29823
  icon: leaflet.icon({
29858
29824
  iconSize: [25, 41],
29859
29825
  iconAnchor: [13, 41],
@@ -29862,24 +29828,32 @@
29862
29828
  }),
29863
29829
  }),
29864
29830
  ];
29865
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29866
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29867
- this.address = algoliaReturnElement.suggestion.value;
29831
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29832
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29833
+ this.address = googleResults.suggestion.value;
29868
29834
  this.showMap = true;
29869
29835
  this.persist();
29870
29836
  };
29871
- MapBackgroundFormLeftComponent.prototype.createEditAlgoliaInput = function () {
29872
- var _this = this;
29873
- if (this.editPlaceMap === null) {
29874
- this.editPlaceMap = places__default['default']({
29875
- appId: 'pl9OI1NPY62Y',
29876
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29877
- container: document.querySelector('#address-input-edit' + this.uuid),
29878
- });
29879
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29880
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29881
- });
29882
- }
29837
+ MapBackgroundFormLeftComponent.prototype.handleAddressChange = function (event) {
29838
+ this.googleMapReturnElement = {
29839
+ suggestion: {
29840
+ latlng: {
29841
+ lat: event.geometry.location.lat(),
29842
+ lng: event.geometry.location.lng(),
29843
+ },
29844
+ value: event.name,
29845
+ },
29846
+ };
29847
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29848
+ };
29849
+ /**
29850
+ * Avoid partial map loaded at the initialization
29851
+ * @param map
29852
+ */
29853
+ MapBackgroundFormLeftComponent.prototype.onMapReady = function (map) {
29854
+ setTimeout(function () {
29855
+ map.invalidateSize();
29856
+ }, 0);
29883
29857
  };
29884
29858
  MapBackgroundFormLeftComponent.prototype.selectThisForm = function () {
29885
29859
  var _this = this;
@@ -29892,21 +29866,12 @@
29892
29866
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
29893
29867
  this.persist();
29894
29868
  };
29895
- /**
29896
- * Avoid partial map loaded at the initialization
29897
- * @param map
29898
- */
29899
- MapBackgroundFormLeftComponent.prototype.onMapReady = function (map) {
29900
- setTimeout(function () {
29901
- map.invalidateSize();
29902
- }, 0);
29903
- };
29904
29869
  return MapBackgroundFormLeftComponent;
29905
29870
  }(StructuresComponent));
29906
29871
  MapBackgroundFormLeftComponent.decorators = [
29907
29872
  { type: i0.Component, args: [{
29908
29873
  selector: MapBackgroundFormLeftService.selector(),
29909
- 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"
29874
+ 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"
29910
29875
  },] }
29911
29876
  ];
29912
29877
  MapBackgroundFormLeftComponent.ctorParameters = function () { return [
@@ -29922,7 +29887,9 @@
29922
29887
  var _this = _super.call(this) || this;
29923
29888
  _this.apiService = apiService;
29924
29889
  _this.address = '';
29890
+ _this.triggerAddress = '';
29925
29891
  _this.editPlaceMap = null;
29892
+ _this.firstTimeTrigger = false;
29926
29893
  _this.options = {};
29927
29894
  _this.layers = [];
29928
29895
  _this.showMap = false;
@@ -29947,28 +29914,17 @@
29947
29914
  }
29948
29915
  });
29949
29916
  };
29950
- MapBackgroundFormRightComponent.prototype.ngAfterViewInit = function () {
29951
- var _this = this;
29952
- var placesAutocomplete = places__default['default']({
29953
- appId: 'pl9OI1NPY62Y',
29954
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29955
- container: this.input.nativeElement,
29956
- });
29957
- placesAutocomplete.on('change', function (algoliaReturnElement) {
29958
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29959
- });
29960
- };
29961
- MapBackgroundFormRightComponent.prototype.setCoordinateOnPlaces = function (algoliaReturnElement) {
29917
+ MapBackgroundFormRightComponent.prototype.setCoordinateOnPlaces = function (googleResults) {
29962
29918
  this.showMap = false;
29963
29919
  this.options = {
29964
- layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 16, attribution: 'WiziShop' })],
29920
+ layers: [leaflet.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { maxZoom: 18, attribution: 'WiziShop' })],
29965
29921
  zoom: 18,
29966
29922
  zoomControl: false,
29967
- center: leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng),
29923
+ center: leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng),
29968
29924
  };
29969
- this.center = leaflet.latLng(algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng);
29925
+ this.center = leaflet.latLng(googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng);
29970
29926
  this.layers = [
29971
- leaflet.marker([algoliaReturnElement.suggestion.latlng.lat, algoliaReturnElement.suggestion.latlng.lng], {
29927
+ leaflet.marker([googleResults.suggestion.latlng.lat, googleResults.suggestion.latlng.lng], {
29972
29928
  icon: leaflet.icon({
29973
29929
  iconSize: [25, 41],
29974
29930
  iconAnchor: [13, 41],
@@ -29977,24 +29933,32 @@
29977
29933
  }),
29978
29934
  }),
29979
29935
  ];
29980
- this.contentBlock[this.FORM_NAME_COORDINATE_Y] = algoliaReturnElement.suggestion.latlng.lat;
29981
- this.contentBlock[this.FORM_NAME_COORDINATE_X] = algoliaReturnElement.suggestion.latlng.lng;
29982
- this.address = algoliaReturnElement.suggestion.value;
29936
+ this.contentBlock[this.FORM_NAME_COORDINATE_Y] = googleResults.suggestion.latlng.lat;
29937
+ this.contentBlock[this.FORM_NAME_COORDINATE_X] = googleResults.suggestion.latlng.lng;
29938
+ this.address = googleResults.suggestion.value;
29983
29939
  this.showMap = true;
29984
29940
  this.persist();
29985
29941
  };
29986
- MapBackgroundFormRightComponent.prototype.createEditAlgoliaInput = function () {
29987
- var _this = this;
29988
- if (this.editPlaceMap === null) {
29989
- this.editPlaceMap = places__default['default']({
29990
- appId: 'pl9OI1NPY62Y',
29991
- apiKey: '290e5a0e33e751c85c36690d502991fc',
29992
- container: document.querySelector('#address-input-edit' + this.uuid),
29993
- });
29994
- this.editPlaceMap.on('change', function (algoliaReturnElement) {
29995
- _this.setCoordinateOnPlaces(algoliaReturnElement);
29996
- });
29997
- }
29942
+ MapBackgroundFormRightComponent.prototype.handleAddressChange = function (event) {
29943
+ this.googleMapReturnElement = {
29944
+ suggestion: {
29945
+ latlng: {
29946
+ lat: event.geometry.location.lat(),
29947
+ lng: event.geometry.location.lng(),
29948
+ },
29949
+ value: event.name,
29950
+ },
29951
+ };
29952
+ this.setCoordinateOnPlaces(this.googleMapReturnElement);
29953
+ };
29954
+ /**
29955
+ * Avoid partial map loaded at the initialization
29956
+ * @param map
29957
+ */
29958
+ MapBackgroundFormRightComponent.prototype.onMapReady = function (map) {
29959
+ setTimeout(function () {
29960
+ map.invalidateSize();
29961
+ }, 0);
29998
29962
  };
29999
29963
  MapBackgroundFormRightComponent.prototype.selectThisForm = function () {
30000
29964
  var _this = this;
@@ -30007,21 +29971,12 @@
30007
29971
  this.contentBlock[FORM_NAME_ID_FORM] = this.selectedValue.id;
30008
29972
  this.persist();
30009
29973
  };
30010
- /**
30011
- * Avoid partial map loaded at the initialization
30012
- * @param map
30013
- */
30014
- MapBackgroundFormRightComponent.prototype.onMapReady = function (map) {
30015
- setTimeout(function () {
30016
- map.invalidateSize();
30017
- }, 0);
30018
- };
30019
29974
  return MapBackgroundFormRightComponent;
30020
29975
  }(StructuresComponent));
30021
29976
  MapBackgroundFormRightComponent.decorators = [
30022
29977
  { type: i0.Component, args: [{
30023
29978
  selector: MapBackgroundFormRightService.selector(),
30024
- 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"
29979
+ 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"
30025
29980
  },] }
30026
29981
  ];
30027
29982
  MapBackgroundFormRightComponent.ctorParameters = function () { return [
@@ -33187,6 +33142,7 @@
33187
33142
  imports: [
33188
33143
  SharedModule,
33189
33144
  ngxMonacoEditor.MonacoEditorModule,
33145
+ ngxGooglePlacesAutocomplete.GooglePlaceModule,
33190
33146
  ngxQuill.QuillModule,
33191
33147
  ngxLeaflet.LeafletModule,
33192
33148
  ngWiziBulma.NwbCommonModule,