@yoobic/yobi 8.2.0-29 → 8.2.0-31

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 (44) hide show
  1. package/dist/cjs/{swiper-e29dad5a.js → swiper-1fba6f3d.js} +1 -1
  2. package/dist/cjs/yoo-form-dynamic.cjs.entry.js +1 -1
  3. package/dist/cjs/yoo-form-hotzones.cjs.entry.js +17 -10
  4. package/dist/cjs/yoo-form-image-collection.cjs.entry.js +2 -2
  5. package/dist/cjs/yoo-form-image-tagging.cjs.entry.js +2 -2
  6. package/dist/cjs/yoo-form-json.cjs.entry.js +18 -17
  7. package/dist/cjs/yoo-form-uploader.cjs.entry.js +16 -6
  8. package/dist/cjs/yoo-grid.cjs.entry.js +6 -4
  9. package/dist/cjs/yoo-input-bar.cjs.entry.js +2 -2
  10. package/dist/cjs/{yoo-ion-slides-9e7d1a37.js → yoo-ion-slides-51a49cb5.js} +138 -29
  11. package/dist/cjs/yoo-ion-slides.cjs.entry.js +1 -1
  12. package/dist/collection/components/form/form-dynamic/form-dynamic.css +3 -0
  13. package/dist/collection/components/form/form-hotzones/form-hotzones.js +22 -10
  14. package/dist/collection/components/form/form-image-collection/form-image-collection.css +2 -0
  15. package/dist/collection/components/form/form-image-collection/form-image-collection.js +1 -1
  16. package/dist/collection/components/form/form-image-tagging/form-image-tagging.js +2 -2
  17. package/dist/collection/components/form/form-json/form-json.css +1 -1
  18. package/dist/collection/components/form/form-uploader/form-uploader.css +1 -1
  19. package/dist/collection/components/grid/grid/grid.js +6 -4
  20. package/dist/{esm/swiper-4d8b4f1c.js → design-system/swiper-c812ecbb.js} +2 -2
  21. package/dist/design-system/yoo-form-dynamic.entry.js +1 -1
  22. package/dist/design-system/yoo-form-hotzones.entry.js +17 -10
  23. package/dist/design-system/yoo-form-image-collection.entry.js +2 -2
  24. package/dist/design-system/yoo-form-image-tagging.entry.js +2 -2
  25. package/dist/design-system/yoo-form-json.entry.js +18 -17
  26. package/dist/design-system/yoo-form-uploader.entry.js +16 -6
  27. package/dist/design-system/yoo-grid.entry.js +6 -4
  28. package/dist/design-system/yoo-input-bar.entry.js +2 -2
  29. package/dist/{esm/yoo-ion-slides-5eeb8685.js → design-system/yoo-ion-slides-c79b0f35.js} +138 -29
  30. package/dist/design-system/yoo-ion-slides.entry.js +1 -1
  31. package/dist/{design-system/swiper-4d8b4f1c.js → esm/swiper-c812ecbb.js} +2 -2
  32. package/dist/esm/yoo-form-dynamic.entry.js +1 -1
  33. package/dist/esm/yoo-form-hotzones.entry.js +17 -10
  34. package/dist/esm/yoo-form-image-collection.entry.js +2 -2
  35. package/dist/esm/yoo-form-image-tagging.entry.js +2 -2
  36. package/dist/esm/yoo-form-json.entry.js +18 -17
  37. package/dist/esm/yoo-form-uploader.entry.js +16 -6
  38. package/dist/esm/yoo-grid.entry.js +6 -4
  39. package/dist/esm/yoo-input-bar.entry.js +2 -2
  40. package/dist/{design-system/yoo-ion-slides-5eeb8685.js → esm/yoo-ion-slides-c79b0f35.js} +138 -29
  41. package/dist/esm/yoo-ion-slides.entry.js +1 -1
  42. package/dist/types/components/3.organisms/photo-editor/components/tools.d.ts +3 -3
  43. package/dist/types/components/form/form-hotzones/form-hotzones.d.ts +2 -0
  44. package/package.json +1 -1
@@ -3,6 +3,7 @@ import { aK as gsapTo, aJ as Draggable, bb as getMedia, n as showModal, I as clo
3
3
  import { g as getFromOfflineStorage } from './localForage-ff5caa60.js';
4
4
  import { a as isElementInsideContainer, c as calcCoordPercentage } from './annotations-helpers-06bdd868.js';
5
5
  import { b as getAppContext } from './common-helpers-7760f0f6.js';
6
+ import { s as showWarningAlert } from './draggable-tags-helpers-aa182ebb.js';
6
7
  import { a as setValueAndValidateInput } from './form-input-helpers-21c08c10.js';
7
8
  import './lodash-b0ad17f3.js';
8
9
  import './_commonjsHelpers-f4d11124.js';
@@ -26,6 +27,9 @@ const YooFormHotzonesComponent = class {
26
27
  !this.imageSrc && forceUpdate(this);
27
28
  this.init();
28
29
  }
30
+ onHotzonesChanged() {
31
+ showWarningAlert(this.host, !!this.hotzones.find(({ description, image }) => !(description || image)), 'NOEMPTYVALUES');
32
+ }
29
33
  onIsVisibleChanged() {
30
34
  if (this.isVisible) {
31
35
  this.flipImage = true;
@@ -91,27 +95,26 @@ const YooFormHotzonesComponent = class {
91
95
  return getMedia((await getFromOfflineStorage(this.image)), { forceCookieUrlParam: true });
92
96
  }
93
97
  async showZoneDetails(hotzone) {
98
+ var _a, _b, _c, _d;
94
99
  const { description, image } = hotzone || {};
95
100
  if (description || image) {
96
101
  await showModal('yoo-form-hotzones', { detailedView: true, selectedHotspot: hotzone }, 'bg-dark-40', 'scaleEnterAnimation', 'scaleLeaveAnimation', true);
97
102
  hotzone.revealed = true;
98
- this.validity = this.hotzones.filter(h => h.revealed).length === this.hotzones.length;
99
- !this.validity && forceUpdate(this);
100
103
  }
104
+ this.validity = ((_b = (_a = this.hotzones) === null || _a === void 0 ? void 0 : _a.filter(({ revealed }) => revealed)) === null || _b === void 0 ? void 0 : _b.length) === ((_d = (_c = this.hotzones) === null || _c === void 0 ? void 0 : _c.filter(({ description, image }) => description || image)) === null || _d === void 0 ? void 0 : _d.length);
105
+ !this.validity && forceUpdate(this);
101
106
  }
102
107
  renderZones() {
103
108
  var _a;
104
109
  return (_a = this.hotzones) === null || _a === void 0 ? void 0 : _a.map(hotzone => {
105
- const { x, y } = hotzone.style || {};
106
- return h("div", { class: {
107
- hotzone: true,
108
- revealed: hotzone.revealed,
109
- hidden: !this.readonly && this.isHotZones
110
- }, style: {
110
+ const { style, revealed, description, image } = hotzone || {};
111
+ const { x, y } = style || {};
112
+ const isValid = !!(description || image);
113
+ return isValid && h("div", { class: { hotzone: true, revealed, hidden: !this.readonly && this.isHotZones }, style: {
111
114
  left: x,
112
115
  top: y,
113
116
  ...hotzone.style,
114
- ...(!hotzone.revealed && !this.readonly && {
117
+ ...(!revealed && !this.readonly && {
115
118
  backgroundColor: this.hotzonesColor + '66',
116
119
  borderColor: this.hotzonesColor
117
120
  })
@@ -153,12 +156,16 @@ const YooFormHotzonesComponent = class {
153
156
  flipped: this.animated && !!this.flipImage && !this.readonly
154
157
  } }, h("div", { class: "inner-container" }, h("section", { class: "flip-box-front" }, h("yoo-img", { allowCloudinary: false, ref: e => this.imageElement = e, contained: true, src: this.imageSrc }), this.renderZones()), h("section", { class: "flip-box-back" })));
155
158
  }
159
+ renderBanner() {
160
+ return this.livePreview && h("yoo-banner", null, h("p", { slot: "content" }));
161
+ }
156
162
  render() {
157
- return (h(Host, { class: { 'swiper-no-swiping': true, ...getAppContext(this.host) } }, this.detailedView ? this.renderDetailedView() : [this.renderImage(), this.renderTarget()]));
163
+ return (h(Host, { class: { 'swiper-no-swiping': true, ...getAppContext(this.host) } }, this.renderBanner(), this.detailedView ? this.renderDetailedView() : [this.renderImage(), this.renderTarget()]));
158
164
  }
159
165
  get host() { return getElement(this); }
160
166
  static get watchers() { return {
161
167
  "image": ["onImageChanged"],
168
+ "hotzones": ["onHotzonesChanged"],
162
169
  "isVisible": ["onIsVisibleChanged"],
163
170
  "validity": ["onValidityChanged"],
164
171
  "flipImage": ["onFlipImageChanged"]
@@ -7,7 +7,7 @@ import './lodash-b0ad17f3.js';
7
7
  import './_commonjsHelpers-f4d11124.js';
8
8
  import './index-da54e081.js';
9
9
 
10
- const formImageCollectionCss = ":host{width:100%}:host #gallery{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));margin:0 auto;-webkit-column-gap:var(--spacing-16, 1rem);-moz-column-gap:var(--spacing-16, 1rem);column-gap:var(--spacing-16, 1rem);row-gap:var(--spacing-16, 1rem)}:host #gallery .image{position:relative;cursor:pointer}:host #gallery .image yoo-img{background-position:center;background-size:cover;border-radius:var(--border-radius-08, 0.5rem);-webkit-box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1))}:host #gallery .image yoo-img:before{display:block;width:0;height:0;padding-bottom:75%;content:\"\"}:host #gallery .image yoo-icon{position:absolute;top:var(--spacing-08, 0.5rem);right:var(--spacing-08, 0.5rem);z-index:3;background:var(--light, #ffffff);border-radius:50%}:host #gallery .image #overlay{position:absolute;top:0;z-index:2;width:100%;height:100%;background:var(--stable-60, rgba(173, 173, 173, 0.6));border-radius:var(--border-radius-08, 0.5rem)}:host .main-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:var(--spacing-32, 2rem) var(--spacing-16, 1rem)}:host .main-container .detail-description{padding:var(--spacing-24, 1.5rem) var(--spacing-16, 1rem);color:var(--light, #ffffff);text-align:center}:host .main-container yoo-img:before{display:block;width:0;height:0;padding-bottom:75%;content:\"\"}:host(.web) #gallery{grid-template-columns:repeat(3, minmax(0, 1fr));max-width:82rem}:host(.web) .main-container{width:40%;max-width:37.5rem;margin:var(--spacing-32, 2rem) auto}:host(.web) .main-container .detail-description{padding:var(--spacing-32, 2rem) 0}:host(.web) .main-container .button{margin:auto}:host([detailed-view]){background:transparent !important}:host(:not(.web)) .main-container{height:100%;overflow:auto}:host(:not(.web)) .button{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;height:100%}:host(:not(.web)) .button yoo-button{width:100%}:host([animated]) .image{--image-index:0;-webkit-transform:translateY(100vh);transform:translateY(100vh);-webkit-animation-name:slide-up;animation-name:slide-up;-webkit-animation-duration:0.75s;animation-duration:0.75s;-webkit-animation-timing-function:var(--ease-out-quad);animation-timing-function:var(--ease-out-quad);-webkit-animation-delay:calc(0.5s + var(--image-index) * 0.1s);animation-delay:calc(0.5s + var(--image-index) * 0.1s);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes slide-up{from{-webkit-transform:translateY(100vh);transform:translateY(100vh)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes slide-up{from{-webkit-transform:translateY(100vh);transform:translateY(100vh)}to{-webkit-transform:translateY(0);transform:translateY(0)}}";
10
+ const formImageCollectionCss = ":host{display:block;width:100%}:host #gallery{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));margin:0 auto;-webkit-column-gap:var(--spacing-16, 1rem);-moz-column-gap:var(--spacing-16, 1rem);column-gap:var(--spacing-16, 1rem);row-gap:var(--spacing-16, 1rem)}:host #gallery .image{position:relative;cursor:pointer}:host #gallery .image yoo-img{background-position:center;background-size:cover;border-radius:var(--border-radius-08, 0.5rem);-webkit-box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-01, 0 0.0625rem 0.25rem 0 rgba(0, 0, 0, 0.1))}:host #gallery .image yoo-img:before{display:block;width:0;height:0;padding-bottom:75%;content:\"\"}:host #gallery .image yoo-icon{position:absolute;top:var(--spacing-08, 0.5rem);right:var(--spacing-08, 0.5rem);z-index:3;background:var(--light, #ffffff);border-radius:50%}:host #gallery .image #overlay{position:absolute;top:0;z-index:2;width:100%;height:100%;background:var(--stable-60, rgba(173, 173, 173, 0.6));border-radius:var(--border-radius-08, 0.5rem)}:host .main-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;margin:var(--spacing-32, 2rem) var(--spacing-16, 1rem)}:host .main-container .detail-description{padding:var(--spacing-24, 1.5rem) var(--spacing-16, 1rem);color:var(--light, #ffffff);text-align:center}:host .main-container yoo-img:before{display:block;width:0;height:0;padding-bottom:75%;content:\"\"}:host(.web) #gallery{grid-template-columns:repeat(3, minmax(0, 1fr));max-width:82rem}:host(.web) .main-container{width:40%;max-width:37.5rem;margin:var(--spacing-32, 2rem) auto}:host(.web) .main-container .detail-description{padding:var(--spacing-32, 2rem) 0}:host(.web) .main-container .button{margin:auto;padding:var(--spacing-16, 1rem)}:host([detailed-view]){background:transparent !important}:host(:not(.web)) .main-container{height:100%;overflow:auto}:host(:not(.web)) .button{display:-ms-flexbox;display:flex;-ms-flex-align:end;align-items:flex-end;height:100%}:host(:not(.web)) .button yoo-button{width:100%}:host([animated]) .image{--image-index:0;-webkit-transform:translateY(100vh);transform:translateY(100vh);-webkit-animation-name:slide-up;animation-name:slide-up;-webkit-animation-duration:0.75s;animation-duration:0.75s;-webkit-animation-timing-function:var(--ease-out-quad);animation-timing-function:var(--ease-out-quad);-webkit-animation-delay:calc(0.5s + var(--image-index) * 0.1s);animation-delay:calc(0.5s + var(--image-index) * 0.1s);-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes slide-up{from{-webkit-transform:translateY(100vh);transform:translateY(100vh)}to{-webkit-transform:translateY(0);transform:translateY(0)}}@keyframes slide-up{from{-webkit-transform:translateY(100vh);transform:translateY(100vh)}to{-webkit-transform:translateY(0);transform:translateY(0)}}";
11
11
 
12
12
  const YooFormImageCollectionComponent = class {
13
13
  constructor(hostRef) {
@@ -39,7 +39,7 @@ const YooFormImageCollectionComponent = class {
39
39
  openImageDetailFromRTE(this.detailDescription, (_a = ev === null || ev === void 0 ? void 0 : ev.target) === null || _a === void 0 ? void 0 : _a.src);
40
40
  }
41
41
  async imageClicked(imagePair, index) {
42
- await showModal('yoo-form-image-collection', { detailedView: true, selectedPair: imagePair }, 'bg-dark-40 fullscreen', 'scaleEnterAnimation', 'scaleLeaveAnimation', true);
42
+ await showModal('yoo-form-image-collection', { detailedView: true, selectedPair: imagePair }, 'bg-dark-40', 'scaleEnterAnimation', 'scaleLeaveAnimation', true);
43
43
  if (!this.images[index].revealed) {
44
44
  this.imagesRevealed += 1;
45
45
  this.images[index].revealed = true;
@@ -138,10 +138,10 @@ const YooFormImageTaggingComponent = class {
138
138
  return h("section", { class: "tags" }, h("div", { class: "dropzone", id: "zone-tags" }));
139
139
  }
140
140
  renderBanner() {
141
- return h("yoo-banner", null, h("p", { slot: "content" }));
141
+ return this.livePreview && h("yoo-banner", null, h("p", { slot: "content" }));
142
142
  }
143
143
  render() {
144
- return (h(Host, { class: { ...getAppContext(this.host), 'live-preview': this.livePreview } }, this.livePreview && this.renderBanner(), this.renderImageContainer(), !this.readonly && this.renderInstruction(), !this.readonly && this.renderTagsZone()));
144
+ return (h(Host, { class: { ...getAppContext(this.host), 'live-preview': this.livePreview } }, this.renderBanner(), this.renderImageContainer(), !this.readonly && this.renderInstruction(), !this.readonly && this.renderTagsZone()));
145
145
  }
146
146
  get host() { return getElement(this); }
147
147
  static get watchers() { return {