@yoobic/yobi 8.3.0-17 → 8.3.0-18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/design-system.cjs.js +1 -1
- package/dist/cjs/{form-choice-helpers-1003243c.js → form-choice-helpers-5a83f5c9.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{swiper-fedb543f.js → swiper-bbba57e0.js} +1 -1
- package/dist/cjs/yoo-form-choice-button.cjs.entry.js +2 -2
- package/dist/cjs/yoo-form-choice-card.cjs.entry.js +1 -1
- package/dist/cjs/yoo-form-choice-chat.cjs.entry.js +2 -2
- package/dist/cjs/yoo-form-choice-image.cjs.entry.js +2 -2
- package/dist/cjs/yoo-form-choice-radio.cjs.entry.js +2 -2
- package/dist/cjs/yoo-form-creator-block-expandable.cjs.entry.js +3 -3
- package/dist/cjs/yoo-form-creator.cjs.entry.js +8 -3
- package/dist/cjs/yoo-form-dynamic.cjs.entry.js +2 -0
- package/dist/cjs/yoo-form-swipe-cards.cjs.entry.js +60 -63
- package/dist/cjs/{yoo-ion-slides-ddaabe00.js → yoo-ion-slides-272e7ebb.js} +8 -2
- package/dist/cjs/yoo-ion-slides.cjs.entry.js +1 -1
- package/dist/cjs/yoo-lesson-question-result.cjs.entry.js +4 -3
- package/dist/cjs/yoo-lottie.cjs.entry.js +32 -6
- package/dist/cjs/yoo-points-recap.cjs.entry.js +5 -4
- package/dist/collection/components/2.molecules/points-recap/points-recap.js +23 -4
- package/dist/collection/components/2.molecules/slides/slides.js +7 -1
- package/dist/collection/components/form/form-choice/button/form-choice-button.css +0 -1
- package/dist/collection/components/form/form-choice/card/form-choice-card.css +0 -1
- package/dist/collection/components/form/form-choice/chat/form-choice-chat.css +0 -1
- package/dist/collection/components/form/form-choice/image/form-choice-image.css +0 -1
- package/dist/collection/components/form/form-choice/radio/form-choice-radio.css +0 -1
- package/dist/collection/components/form/form-dynamic/form-dynamic.js +2 -0
- package/dist/collection/components/form/form-swipe-cards/form-swipe-cards.css +80 -58
- package/dist/collection/components/form/form-swipe-cards/form-swipe-cards.js +63 -66
- package/dist/collection/components/form-creator/form-creator/form-creator.js +8 -3
- package/dist/collection/components/form-creator/form-creator-block-expandable/form-creator-block-expandable.js +3 -3
- package/dist/collection/feature-learn/learning/lesson-question-result/lesson-question-result.js +4 -3
- package/dist/design-system/design-system.esm.js +1 -1
- package/dist/{esm/form-choice-helpers-ac31afd4.js → design-system/form-choice-helpers-82020d4b.js} +1 -1
- package/dist/design-system/{swiper-28bd92bd.js → swiper-80225cb6.js} +2 -2
- package/dist/design-system/yoo-form-choice-button.entry.js +2 -2
- package/dist/design-system/yoo-form-choice-card.entry.js +1 -1
- package/dist/design-system/yoo-form-choice-chat.entry.js +2 -2
- package/dist/design-system/yoo-form-choice-image.entry.js +2 -2
- package/dist/design-system/yoo-form-choice-radio.entry.js +2 -2
- package/dist/design-system/yoo-form-creator-block-expandable.entry.js +3 -3
- package/dist/design-system/yoo-form-creator.entry.js +8 -3
- package/dist/design-system/yoo-form-dynamic.entry.js +2 -0
- package/dist/design-system/yoo-form-swipe-cards.entry.js +62 -65
- package/dist/design-system/{yoo-ion-slides-ddda50eb.js → yoo-ion-slides-f06207d9.js} +8 -2
- package/dist/design-system/yoo-ion-slides.entry.js +1 -1
- package/dist/design-system/yoo-lesson-question-result.entry.js +4 -3
- package/dist/design-system/yoo-lottie.entry.js +32 -6
- package/dist/design-system/yoo-points-recap.entry.js +5 -4
- package/dist/esm/design-system.js +1 -1
- package/dist/{design-system/form-choice-helpers-ac31afd4.js → esm/form-choice-helpers-82020d4b.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{swiper-28bd92bd.js → swiper-80225cb6.js} +2 -2
- package/dist/esm/yoo-form-choice-button.entry.js +2 -2
- package/dist/esm/yoo-form-choice-card.entry.js +1 -1
- package/dist/esm/yoo-form-choice-chat.entry.js +2 -2
- package/dist/esm/yoo-form-choice-image.entry.js +2 -2
- package/dist/esm/yoo-form-choice-radio.entry.js +2 -2
- package/dist/esm/yoo-form-creator-block-expandable.entry.js +3 -3
- package/dist/esm/yoo-form-creator.entry.js +8 -3
- package/dist/esm/yoo-form-dynamic.entry.js +2 -0
- package/dist/esm/yoo-form-swipe-cards.entry.js +62 -65
- package/dist/esm/{yoo-ion-slides-ddda50eb.js → yoo-ion-slides-f06207d9.js} +8 -2
- package/dist/esm/yoo-ion-slides.entry.js +1 -1
- package/dist/esm/yoo-lesson-question-result.entry.js +4 -3
- package/dist/esm/yoo-lottie.entry.js +32 -6
- package/dist/esm/yoo-points-recap.entry.js +5 -4
- package/dist/types/components/2.molecules/points-recap/points-recap.d.ts +2 -1
- package/dist/types/components/form/form-swipe-cards/form-swipe-cards.d.ts +12 -17
- package/dist/types/components.d.ts +2 -0
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/entities/form-field/form-field.interface.d.ts +11 -3
- package/dist/types/home/runner/work/yoobic-ng-6/yoobic-ng-6/design-system/stencil/.stencil/shared/interfaces/src/ui/points-recap/points-recap.interface.d.ts +1 -0
- package/package.json +1 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { r as registerInstance, i as createEvent, h, e as Host, g as getElement } from './index-54cb3c5d.js';
|
|
1
|
+
import { r as registerInstance, i as createEvent, f as forceUpdate, h, e as Host, g as getElement } from './index-54cb3c5d.js';
|
|
2
2
|
import './index-4cc245a0.js';
|
|
3
3
|
import { y as isEqual, Q as shuffle, T as inRange, V as clamp } from './lodash-9e6ab91e.js';
|
|
4
4
|
import { b as getAppContext } from './common-helpers-36ac7622.js';
|
|
5
5
|
import { s as showWarningAlert, h as hasDuplicates } from './draggable-tags-helpers-b5167def.js';
|
|
6
6
|
import { a as setValueAndValidateInput } from './form-input-helpers-b90bf146.js';
|
|
7
|
-
import {
|
|
7
|
+
import { am as isCloudinaryLink, v as findParent, aC as Draggable, aB as getUUID, V as translateMulti, L as gsapTimeline, bC as Power1, aD as gsapTo, b4 as getMedia, q as isWeb, t as translate } from './overlays-733d0adb.js';
|
|
8
8
|
import './index-58b8d008.js';
|
|
9
9
|
import './_commonjsHelpers-f4d11124.js';
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ var SwipeCardsMode;
|
|
|
21
21
|
SwipeCardsMode["text"] = "text";
|
|
22
22
|
})(SwipeCardsMode || (SwipeCardsMode = {}));
|
|
23
23
|
|
|
24
|
-
const formSwipeCardsCss = ".accent{color:var(--accent, #276ef1);fill:var(--accent, #276ef1)}.app-color{color:var(--app-color, #5a30f4);fill:var(--app-color, #5a30f4)}.danger{color:var(--danger, #d44333);fill:var(--danger, #d44333)}.dark{color:var(--dark, #000000);fill:var(--dark, #000000)}.energized{color:var(--energized, #ffc043);fill:var(--energized, #ffc043)}.info{color:var(--info, #d84c96);fill:var(--info, #d84c96)}.light{color:var(--light, #ffffff);fill:var(--light, #ffffff)}.stable{color:var(--stable, #adadad);fill:var(--stable, #adadad)}.stable-alt{color:var(--stable-alt, #d0d0d0);fill:var(--stable-alt, #d0d0d0)}.stable-light{color:var(--stable-light, #f1f1f1);fill:var(--stable-light, #f1f1f1)}.stable-ultralight{color:var(--stable-ultralight, #fafafa);fill:var(--stable-ultralight, #fafafa)}.success{color:var(--success, #3aa76d);fill:var(--success, #3aa76d)}.text-color{color:var(--text-color, #807f83);fill:var(--text-color, #807f83)}.warning{color:var(--warning, #ed6e33);fill:var(--warning, #ed6e33)}.wood{color:var(--wood, #99644c);fill:var(--wood, #99644c)}@-webkit-keyframes fade-out{from{opacity:1}to{opacity:0}}@keyframes fade-out{from{opacity:1}to{opacity:0}}.hidden{display:none !important}.flex{display:-ms-flexbox !important;display:flex !important}.block{display:block !important}:host{position:relative;display:block;height:100%;overflow:hidden}:host yoo-banner{height:0}:host #instructions{height:100%;-webkit-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}:host #instructions #header{padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);background:var(--dark, #000000);border-radius:var(--border-radius-04, 0.25rem)}:host #instructions #header h1{margin:0;color:var(--light, #ffffff)}:host #instructions #categories{display:inline-grid;grid-template-columns:1fr 0.5fr 1fr;width:100%;margin:var(--spacing-24, 1.5rem) 0;text-align:center}:host #instructions #categories yoo-icon{margin:0 auto}:host #instructions #categories .category{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;padding:0;color:var(--stable, #adadad)}:host #instructions #categories .category p{max-width:75%;margin:auto;padding:var(--spacing-16, 1rem) 0}:host #instructions #categories .category yoo-tag{margin:0 auto}:host #instructions yoo-button{padding:var(--spacing-16, 1rem)}:host #instructions #document{background-color:var(--light, #ffffff)}:host #instructions #document .document-title{padding:0 var(--spacing-16, 1rem);font-size:var(--font-size-16, 1rem)}:host #instructions #document yoo-form-document{--outer-container-padding:cssvar(spacing-16) cssvar(spacing-16);width:calc(100% - var(--spacing-16, 1rem))}:host [direction].card{z-index:5;-webkit-transition:-webkit-transform 0.35s !important;transition:-webkit-transform 0.35s !important;transition:transform 0.35s !important;transition:transform 0.35s, -webkit-transform 0.35s !important;-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}:host [direction].card.current .content-category{color:var(--light, #ffffff);opacity:1 !important;-webkit-transition:opacity 0.35s linear;transition:opacity 0.35s linear}:host [direction].card.current.card+.card{-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}:host [direction].card.current.card+.card .content-image,:host [direction].card.current.card+.card .content-text{opacity:1 !important}:host [direction].card.current.card+.card+.card{-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1}:host [direction].card.current.card+.card+.card+.card{-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:0.7}:host [direction=left]#game,:host [direction=left].current>.content-category{background-color:var(--app-color, #5a30f4) !important}:host [direction=left].current{-webkit-transform:translate(0%, 9%) scale(1) rotate(-3.5deg) !important;transform:translate(0%, 9%) scale(1) rotate(-3.5deg) !important}:host [direction=right]#game,:host [direction=right].current>.content-category{background-color:var(--warning, #ed6e33) !important}:host [direction=right].current{-webkit-transform:translate(0%, 9%) scale(1) rotate(3.5deg) !important;transform:translate(0%, 9%) scale(1) rotate(3.5deg) !important}:host #game{position:relative;width:100%;background-color:var(--dark, #000000);-webkit-transition:background-color 0.25s ease-in-out;transition:background-color 0.25s ease-in-out}:host #game #end-message{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:calc(100% - 4rem);max-width:25rem;color:var(--light, #ffffff);font-size:var(--font-size-18, 1.125rem);text-align:center;visibility:hidden;opacity:0;-webkit-transition:opacity 0.5s ease-in-out;transition:opacity 0.5s ease-in-out}:host #game #end-message.rtl{top:50%;right:50%;-webkit-transform:translate(50%, -50%);transform:translate(50%, -50%)}:host #game #end-message yoo-lottie{width:30%;margin:0 auto}:host #game #end-message div{padding:var(--spacing-16, 1rem) 0;font-weight:bold;font-size:var(--font-size-24, 1.5rem)}:host #game #end-message.active{visibility:visible;opacity:1}:host #game:after{display:block;height:0;padding-top:85%;content:\"\"}:host #stack{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:100%;width:65%;max-width:25rem;height:100%;margin-top:var(--spacing-16, 1rem)}:host #stack.rtl{top:50%;right:50%;-webkit-transform:translate(50%, -50%);transform:translate(50%, -50%)}:host #stack .card{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;max-width:16rem;height:100%;max-height:21.3333333333rem;margin:0 auto;overflow:hidden;color:var(--dark, #000000);font-size:var(--font-size-28, 1.75rem);text-align:center;background-color:var(--stable-light, #f1f1f1);border-radius:var(--border-radius-08, 0.5rem);-webkit-box-shadow:var(--shadow-05, -0.375rem -0.375rem 0.5rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-05, -0.375rem -0.375rem 0.5rem 0 rgba(0, 0, 0, 0.1));-webkit-transition:opacity 0.25s, background-color 0.25s, -webkit-transform 0.25s;transition:opacity 0.25s, background-color 0.25s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.25s, background-color 0.25s;transition:transform 0.25s, opacity 0.25s, background-color 0.25s, -webkit-transform 0.25s}:host #stack .card:not([direction]){-webkit-transform:translate(0, -5%) scale(0.85);transform:translate(0, -5%) scale(0.85);opacity:0}:host #stack .card.current{z-index:3}:host #stack .card.current:not(.revealing){-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1;-webkit-transition-delay:200ms;transition-delay:200ms}:host #stack .card.current.revealing{-webkit-animation:\"current\" 0.25s ease-in-out;animation:\"current\" 0.25s ease-in-out;-webkit-animation-delay:150ms;animation-delay:150ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes current{to{-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}}@keyframes current{to{-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}}:host #stack .card.second{z-index:2}:host #stack .card.second:not(.revealing){-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1;-webkit-transition-delay:400ms;transition-delay:400ms}:host #stack .card.second.revealing{-webkit-animation:\"second\" 0.25s ease-in-out;animation:\"second\" 0.25s ease-in-out;-webkit-animation-delay:300ms;animation-delay:300ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes second{to{-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1}}@keyframes second{to{-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1}}:host #stack .card.third{z-index:1}:host #stack .card.third:not(.revealing){-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:0.7;-webkit-transition-delay:600ms;transition-delay:600ms}:host #stack .card.third.revealing{-webkit-animation:\"third\" 0.25s ease-in-out;animation:\"third\" 0.25s ease-in-out;-webkit-animation-delay:450ms;animation-delay:450ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes third{to{-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:0.7}}@keyframes third{to{-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:0.7}}:host #stack .card:after{display:block;height:0;padding-top:133%;content:\"\"}:host #stack .card.current .content-image,:host #stack .card.current .content-text,:host #stack .card[direction] .content-image,:host #stack .card[direction] .content-text{opacity:1 !important}:host #stack .card[swiped]{-webkit-animation:fade-out 1s ease-out;animation:fade-out 1s ease-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host #stack .card[swiped=left]{-webkit-transform:translate(-100%, 15%) rotate(-15deg);transform:translate(-100%, 15%) rotate(-15deg)}:host #stack .card[swiped=right]{-webkit-transform:translate(100%, 15%) rotate(15deg);transform:translate(100%, 15%) rotate(15deg)}:host #stack .card .content-category,:host #stack .card .content-image,:host #stack .card .content-text{position:absolute;width:100%;height:100%;word-break:break-word;opacity:0}:host #stack .card .content-category,:host #stack .card .content-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}:host #stack .card .content-image{-webkit-transition:opacity 0.25s linear;transition:opacity 0.25s linear}:host #stack .card[type=image] yoo-img{height:100%}:host #stack .card[type=textimage] .content-image{top:0;bottom:3.5rem}:host #stack .card[type=textimage] .content-image yoo-img{height:calc(100% - 3.5rem)}:host #stack .card[type=textimage] .content-text,:host #stack .card[type=textimage] .content-category{bottom:0;height:3.5rem}:host #actions{position:absolute;left:50%;z-index:1;display:inline-grid;grid-template-columns:1fr 1fr 1fr;width:100%;max-width:85%;line-height:2.5;-webkit-transform:translate(-50%, 80%);transform:translate(-50%, 80%)}:host #actions .action{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;text-align:center}:host([readonly]){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}:host([readonly]) .category-title{margin-bottom:var(--spacing-08, 0.5rem)}:host([readonly]) ul{display:grid;grid-gap:var(--spacing-16, 1rem);grid-template-columns:repeat(auto-fill, 6rem);margin:0;padding-left:0;list-style:none}:host([readonly]) ul+.category-title{margin-top:var(--spacing-16, 1rem)}:host([readonly]) ul li{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;height:8rem;overflow:hidden;border-style:solid;border-width:var(--border-width-01, 0.0625rem);border-radius:var(--border-radius-08, 0.5rem)}:host([readonly]) ul li.invalid{border-color:var(--danger, #d44333)}:host([readonly]) ul li.invalid yoo-img::before{position:absolute;width:100%;height:100%;background:var(--danger-20, rgba(212, 67, 51, 0.2));content:\"\"}:host([readonly]) ul li.invalid yoo-truncate{background:var(--danger, #d44333)}:host([readonly]) ul li.valid{border-color:var(--success, #3aa76d)}:host([readonly]) ul li.valid yoo-img::before{position:absolute;width:100%;height:100%;background:var(--success-20, rgba(58, 167, 109, 0.2));content:\"\"}:host([readonly]) ul li.valid yoo-truncate{background:var(--success, #3aa76d)}:host([readonly]) ul li yoo-img{position:relative;-ms-flex-positive:1;flex-grow:1}:host([readonly]) ul li yoo-truncate{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--light, #ffffff);font-size:var(--font-size-14, 0.875rem)}:host([readonly]) ul li yoo-truncate:only-child{--max-lines:4;height:100%;padding:0 var(--spacing-08, 0.5rem)}:host([readonly]) ul li yoo-truncate:not(:only-child){--max-lines:1;height:2.125rem;padding:0 var(--spacing-04, 0.25rem)}:host([animated]) #game{-webkit-animation:show 0.5s ease-in-out forwards;animation:show 0.5s ease-in-out forwards}@-webkit-keyframes show{from{-webkit-transform:scale(0.85);transform:scale(0.85);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes show{from{-webkit-transform:scale(0.85);transform:scale(0.85);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}:host([animated]) .action.hide>*{-webkit-animation:fadeOut 0.75s ease-in-out forwards;animation:fadeOut 0.75s ease-in-out forwards}@-webkit-keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}:host([animated]) .action:not(.hide)>*{-webkit-animation:fadeIn 0.75s ease-in-out forwards;animation:fadeIn 0.75s ease-in-out forwards}@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}:host([animated]) .action yoo-button{-webkit-transition:-webkit-transform 0.8s linear;transition:-webkit-transform 0.8s linear;transition:transform 0.8s linear;transition:transform 0.8s linear, -webkit-transform 0.8s linear}:host([live-preview]) #instructions yoo-button,:host(.mobile) #instructions yoo-button{position:absolute;bottom:0;width:-webkit-fill-available;width:-moz-available;width:stretch}:host(.web:not([live-preview])) #instructions #header{background:unset}:host(.web:not([live-preview])) #instructions yoo-button{position:fixed;right:var(--spacing-16, 1rem);bottom:var(--spacing-16, 1rem);z-index:1;-webkit-transform:translateY(-50%);transform:translateY(-50%)}:host(.web:not([live-preview])) #game{max-height:21rem}:host(.web:not([live-preview])) #game #stack{top:5%;margin-top:unset;-webkit-transform:translate(-50%, 0);transform:translate(-50%, 0)}:host(.web:not([live-preview])) #actions{-ms-flex-align:start;align-items:start;max-width:unset;margin-top:2.5%;-webkit-transform:translate(-50%, 0);transform:translate(-50%, 0)}:host(.web:not([live-preview])) #actions .action:nth-child(2){-ms-flex-item-align:end;align-self:end}:host(.web:not([live-preview])) #header{margin-bottom:var(--spacing-24, 1.5rem);line-height:1.75;text-align:center}:host(.web:not([live-preview])) #header h1{margin:var(--spacing-08, 0.5rem) 0 !important;color:var(--dark, #000000) !important}";
|
|
24
|
+
const formSwipeCardsCss = ".accent{color:var(--accent, #276ef1);fill:var(--accent, #276ef1)}.app-color{color:var(--app-color, #5a30f4);fill:var(--app-color, #5a30f4)}.danger{color:var(--danger, #d44333);fill:var(--danger, #d44333)}.dark{color:var(--dark, #000000);fill:var(--dark, #000000)}.energized{color:var(--energized, #ffc043);fill:var(--energized, #ffc043)}.info{color:var(--info, #d84c96);fill:var(--info, #d84c96)}.light{color:var(--light, #ffffff);fill:var(--light, #ffffff)}.stable{color:var(--stable, #adadad);fill:var(--stable, #adadad)}.stable-alt{color:var(--stable-alt, #d0d0d0);fill:var(--stable-alt, #d0d0d0)}.stable-light{color:var(--stable-light, #f1f1f1);fill:var(--stable-light, #f1f1f1)}.stable-ultralight{color:var(--stable-ultralight, #fafafa);fill:var(--stable-ultralight, #fafafa)}.success{color:var(--success, #3aa76d);fill:var(--success, #3aa76d)}.text-color{color:var(--text-color, #807f83);fill:var(--text-color, #807f83)}.warning{color:var(--warning, #ed6e33);fill:var(--warning, #ed6e33)}.wood{color:var(--wood, #99644c);fill:var(--wood, #99644c)}@-webkit-keyframes fade-out{from{opacity:1}to{opacity:0}}@keyframes fade-out{from{opacity:1}to{opacity:0}}.hidden{display:none !important}.flex{display:-ms-flexbox !important;display:flex !important}.block{display:block !important}:host{position:relative;display:block;height:100%}:host yoo-banner{height:0}:host #instructions{height:100%;-webkit-transition:opacity 1s ease-in-out;transition:opacity 1s ease-in-out}:host #instructions #header{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}:host #instructions #header #title{font-weight:bold}:host #instructions #categories{display:inline-grid;grid-template-columns:1fr 0.5fr 1fr;width:100%;margin:var(--spacing-24, 1.5rem) 0;text-align:center}:host #instructions #categories .category{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:100%;padding:0;color:var(--stable, #adadad)}:host #instructions #categories .category p{max-width:75%;margin:auto;padding:var(--spacing-16, 1rem) 0;font-weight:bold}:host #instructions #categories .category yoo-tag{margin:0 auto}:host #instructions yoo-button{position:absolute;right:0;bottom:0;z-index:1;-webkit-box-sizing:border-box;box-sizing:border-box}:host #instructions #document{background-color:var(--light, #ffffff)}:host #instructions #document .document-title{padding:0 var(--spacing-16, 1rem);font-size:var(--font-size-16, 1rem)}:host #instructions #document yoo-form-document{--outer-container-padding:cssvar(spacing-16) cssvar(spacing-16);width:calc(100% - var(--spacing-16, 1rem))}:host [direction].card{z-index:5;-webkit-transition:-webkit-transform 0.35s !important;transition:-webkit-transform 0.35s !important;transition:transform 0.35s !important;transition:transform 0.35s, -webkit-transform 0.35s !important;-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}:host [direction].card.current .content-category{color:var(--light, #ffffff);opacity:1 !important;-webkit-transition:opacity 0.35s linear;transition:opacity 0.35s linear}:host [direction].card.current.card+.card{-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}:host [direction].card.current.card+.card .content-image,:host [direction].card.current.card+.card .content-text{opacity:1 !important}:host [direction].card.current.card+.card+.card{-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1}:host [direction].card.current.card+.card+.card+.card{-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:1}:host [direction=left]#game,:host [direction=left].current>.content-category{background-color:var(--app-color, #5a30f4) !important}:host [direction=left].current{-webkit-transform:translate(0%, 9%) scale(1) rotate(-3.5deg) !important;transform:translate(0%, 9%) scale(1) rotate(-3.5deg) !important}:host [direction=right]#game,:host [direction=right].current>.content-category{background-color:var(--warning, #ed6e33) !important}:host [direction=right].current{-webkit-transform:translate(0%, 9%) scale(1) rotate(3.5deg) !important;transform:translate(0%, 9%) scale(1) rotate(3.5deg) !important}:host #game{position:relative;width:100%;background-color:var(--dark, #000000);-webkit-transition:background-color 0.25s ease-in-out;transition:background-color 0.25s ease-in-out}:host #game #end-message{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:calc(100% - 4rem);max-width:25rem;color:var(--light, #ffffff);font-size:var(--font-size-18, 1.125rem);text-align:center;visibility:hidden;opacity:0;-webkit-transition:opacity 0.5s ease-in-out;transition:opacity 0.5s ease-in-out}:host #game #end-message.rtl{top:50%;right:50%;-webkit-transform:translate(50%, -50%);transform:translate(50%, -50%)}:host #game #end-message yoo-lottie{width:30%;margin:0 auto}:host #game #end-message div{padding:var(--spacing-16, 1rem) 0;font-weight:bold;font-size:var(--font-size-24, 1.5rem)}:host #game #end-message.active{visibility:visible;opacity:1}:host #game:after{display:block;height:0;padding-top:85%;content:\"\"}:host #cards{position:absolute;top:50%;left:50%;-webkit-transform:translate(-50%, -50%);transform:translate(-50%, -50%);width:100%;width:65%;max-width:16rem;height:100%;margin-top:var(--spacing-16, 1rem)}:host #cards.rtl{top:50%;right:50%;-webkit-transform:translate(50%, -50%);transform:translate(50%, -50%)}:host #cards .card{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;max-width:16rem;height:100%;max-height:21.3333333333rem;margin:0 auto;overflow:hidden;color:var(--dark, #000000);font-size:var(--font-size-28, 1.75rem);text-align:center;background-color:var(--stable-light, #f1f1f1);border-radius:var(--border-radius-08, 0.5rem);-webkit-box-shadow:var(--shadow-05, -0.375rem -0.375rem 0.5rem 0 rgba(0, 0, 0, 0.1));box-shadow:var(--shadow-05, -0.375rem -0.375rem 0.5rem 0 rgba(0, 0, 0, 0.1));-webkit-transition:opacity 0.25s, background-color 0.25s, -webkit-transform 0.25s;transition:opacity 0.25s, background-color 0.25s, -webkit-transform 0.25s;transition:transform 0.25s, opacity 0.25s, background-color 0.25s;transition:transform 0.25s, opacity 0.25s, background-color 0.25s, -webkit-transform 0.25s;will-change:transform, opacity}:host #cards .card:not([direction]){-webkit-transform:translate(0, -5%) scale(0.85);transform:translate(0, -5%) scale(0.85);opacity:0}:host #cards .card.current{z-index:3}:host #cards .card.current:not(.revealing){-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1;-webkit-transition-delay:200ms;transition-delay:200ms}:host #cards .card.current.revealing{-webkit-animation:\"current\" 0.25s ease-in-out;animation:\"current\" 0.25s ease-in-out;-webkit-animation-delay:150ms;animation-delay:150ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes current{to{-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}}@keyframes current{to{-webkit-transform:translate(0%, 9%) scale(1);transform:translate(0%, 9%) scale(1);opacity:1}}:host #cards .card.second{z-index:2}:host #cards .card.second:not(.revealing){-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1;-webkit-transition-delay:400ms;transition-delay:400ms}:host #cards .card.second.revealing{-webkit-animation:\"second\" 0.25s ease-in-out;animation:\"second\" 0.25s ease-in-out;-webkit-animation-delay:300ms;animation-delay:300ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes second{to{-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1}}@keyframes second{to{-webkit-transform:translate(0%, 3.5%) scale(0.95);transform:translate(0%, 3.5%) scale(0.95);opacity:1}}:host #cards .card.third{z-index:1}:host #cards .card.third:not(.revealing){-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:1;-webkit-transition-delay:600ms;transition-delay:600ms}:host #cards .card.third.revealing{-webkit-animation:\"third\" 0.25s ease-in-out;animation:\"third\" 0.25s ease-in-out;-webkit-animation-delay:450ms;animation-delay:450ms;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}@-webkit-keyframes third{to{-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:1}}@keyframes third{to{-webkit-transform:translate(0%, -2%) scale(0.9);transform:translate(0%, -2%) scale(0.9);opacity:1}}:host #cards .card.current .content-image,:host #cards .card.current .content-text,:host #cards .card[direction] .content-image,:host #cards .card[direction] .content-text{opacity:1 !important}:host #cards .card[swiped]{-webkit-animation:fade-out 1s ease-out;animation:fade-out 1s ease-out;-webkit-animation-fill-mode:forwards;animation-fill-mode:forwards}:host #cards .card[swiped=left]{-webkit-transform:translate(-100%, 15%) rotate(-15deg);transform:translate(-100%, 15%) rotate(-15deg)}:host #cards .card[swiped=right]{-webkit-transform:translate(100%, 15%) rotate(15deg);transform:translate(100%, 15%) rotate(15deg)}:host #cards .card [class^=content]{position:absolute;width:100%;height:100%;word-break:break-word;opacity:0}:host #cards .card .content-category,:host #cards .card .content-text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;-webkit-box-sizing:border-box;box-sizing:border-box;padding:var(--spacing-16, 1rem)}:host #cards .card .content-image{-webkit-transition:opacity 0.25s linear;transition:opacity 0.25s linear}:host #cards .card[type=image] yoo-img{height:100%}:host #cards .card[type=textimage] .content-image{top:0;bottom:3.5rem}:host #cards .card[type=textimage] .content-image yoo-img{height:calc(100% - 3.5rem)}:host #cards .card[type=textimage] .content-text,:host #cards .card[type=textimage] .content-category{bottom:0;height:3.5rem}:host #actions{position:absolute;left:50%;z-index:1;display:inline-grid;grid-template-columns:1fr 1fr 1fr;width:100%;max-width:85%;line-height:2.5;-webkit-transform:translate(-50%, 80%);transform:translate(-50%, 80%)}:host #actions .action{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-ms-flex-align:center;align-items:center;-ms-flex-pack:start;justify-content:flex-start;text-align:center}:host([readonly]){display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content}:host([readonly]) .category-title{margin-bottom:var(--spacing-08, 0.5rem)}:host([readonly]) ul{display:grid;grid-gap:var(--spacing-16, 1rem);grid-template-columns:repeat(auto-fill, 6rem);margin:0;padding-left:0;list-style:none}:host([readonly]) ul+.category-title{margin-top:var(--spacing-16, 1rem)}:host([readonly]) ul li{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;-webkit-box-sizing:border-box;box-sizing:border-box;height:8rem;overflow:hidden;border-style:solid;border-width:var(--border-width-01, 0.0625rem);border-radius:var(--border-radius-08, 0.5rem)}:host([readonly]) ul li.invalid{border-color:var(--danger, #d44333)}:host([readonly]) ul li.invalid yoo-img::before{position:absolute;width:100%;height:100%;background:var(--danger-20, rgba(212, 67, 51, 0.2));content:\"\"}:host([readonly]) ul li.invalid yoo-truncate{background:var(--danger, #d44333)}:host([readonly]) ul li.valid{border-color:var(--success, #3aa76d)}:host([readonly]) ul li.valid yoo-img::before{position:absolute;width:100%;height:100%;background:var(--success-20, rgba(58, 167, 109, 0.2));content:\"\"}:host([readonly]) ul li.valid yoo-truncate{background:var(--success, #3aa76d)}:host([readonly]) ul li yoo-img{position:relative;-ms-flex-positive:1;flex-grow:1}:host([readonly]) ul li yoo-truncate{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center;color:var(--light, #ffffff);font-size:var(--font-size-14, 0.875rem)}:host([readonly]) ul li yoo-truncate:only-child{--max-lines:4;height:100%;padding:0 var(--spacing-08, 0.5rem)}:host([readonly]) ul li yoo-truncate:not(:only-child){--max-lines:1;height:2.125rem;padding:0 var(--spacing-04, 0.25rem)}:host([animated]) #game{-webkit-animation:show 0.5s ease-in-out forwards;animation:show 0.5s ease-in-out forwards}@-webkit-keyframes show{from{-webkit-transform:scale(0.85);transform:scale(0.85);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}@keyframes show{from{-webkit-transform:scale(0.85);transform:scale(0.85);opacity:0}to{-webkit-transform:scale(1);transform:scale(1);opacity:1}}:host([animated]) .action.hide>*{-webkit-animation:fadeOut 0.75s ease-in-out forwards;animation:fadeOut 0.75s ease-in-out forwards}@-webkit-keyframes fadeOut{from{opacity:1}to{opacity:0}}@keyframes fadeOut{from{opacity:1}to{opacity:0}}:host([animated]) .action:not(.hide)>*{-webkit-animation:fadeIn 0.75s ease-in-out forwards;animation:fadeIn 0.75s ease-in-out forwards}@-webkit-keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}:host([animated]) .action yoo-button{-webkit-transition:-webkit-transform 0.8s linear;transition:-webkit-transform 0.8s linear;transition:transform 0.8s linear;transition:transform 0.8s linear, -webkit-transform 0.8s linear}:host([live-preview]),:host(.mobile){min-height:70vh}:host([live-preview]) #instructions #header,:host(.mobile) #instructions #header{padding:var(--spacing-16, 1rem);background:var(--dark, #000000);border-radius:var(--border-radius-04, 0.25rem)}:host([live-preview]) #instructions #header #title,:host(.mobile) #instructions #header #title{color:var(--light, #ffffff);font-weight:bold;font-size:var(--font-size-28, 1.75rem)}:host([live-preview]) #instructions yoo-button,:host(.mobile) #instructions yoo-button{position:absolute;bottom:0;width:-webkit-fill-available;width:-moz-available;width:stretch}:host(.web:not([live-preview])) #instructions{position:relative}:host(.web:not([live-preview])) #instructions yoo-icon[name=swipe-explanation]{width:5rem;height:5rem;margin:auto;--inner-width:5rem;--inner-height:5rem}:host(.web:not([live-preview])) #instructions yoo-button{position:fixed;right:var(--spacing-32, 2rem);bottom:var(--spacing-16, 1rem);z-index:1;-webkit-transform:translateY(-50%);transform:translateY(-50%)}:host(.web:not([live-preview])) #game{height:60%;max-height:21rem}:host(.web:not([live-preview])) #game #cards{top:5%;margin-top:unset;-webkit-transform:translate(-50%, 0);transform:translate(-50%, 0)}:host(.web:not([live-preview])) #actions{-ms-flex-align:start;align-items:start;max-width:unset;margin-top:2.5%;-webkit-transform:translate(-50%, 0);transform:translate(-50%, 0)}:host(.web:not([live-preview])) #actions .action:nth-child(2){-ms-flex-item-align:end;align-self:end}:host(.web:not([live-preview])) #header{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column;padding:var(--spacing-08, 0.5rem) var(--spacing-16, 1rem);line-height:1.75;text-align:center;background-color:var(--stable-ultralight, #fafafa)}:host(.web:not([live-preview])) #header #title{color:var(--dark, #000000) !important;font-weight:bold;font-size:var(--font-size-28, 1.75rem)}";
|
|
25
25
|
|
|
26
26
|
const YooFormSwipeCardsComponent = class {
|
|
27
27
|
constructor(hostRef) {
|
|
@@ -36,25 +36,23 @@ const YooFormSwipeCardsComponent = class {
|
|
|
36
36
|
this.shuffled = true;
|
|
37
37
|
this.values = [];
|
|
38
38
|
this.swipeCards = [];
|
|
39
|
-
this.animationDelay = this.animated ? .25 : 0;
|
|
40
39
|
this.cardsElements = [];
|
|
41
40
|
this.swipeButtons = [];
|
|
42
41
|
}
|
|
43
42
|
onCategoriesChanged(nv, ov) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
if (showAlert) {
|
|
48
|
-
this.showInstructionView = true;
|
|
49
|
-
}
|
|
43
|
+
this.hasDataChanged = !isEqual(nv, ov);
|
|
44
|
+
if (this.hasDataChanged) {
|
|
45
|
+
this.spyOnValuesChanged();
|
|
50
46
|
}
|
|
51
47
|
}
|
|
52
|
-
onValuesChanged() {
|
|
48
|
+
onValuesChanged(nv, ov) {
|
|
49
|
+
this.hasDataChanged = !isEqual(nv, ov);
|
|
53
50
|
if (!this.isMode.image) {
|
|
54
51
|
this.spyOnValuesChanged();
|
|
55
52
|
}
|
|
56
53
|
}
|
|
57
|
-
onImagesChanged() {
|
|
54
|
+
onImagesChanged(nv, ov) {
|
|
55
|
+
this.hasDataChanged = !isEqual(nv, ov);
|
|
58
56
|
if (!this.isMode.text) {
|
|
59
57
|
this.spyOnValuesChanged();
|
|
60
58
|
}
|
|
@@ -69,10 +67,11 @@ const YooFormSwipeCardsComponent = class {
|
|
|
69
67
|
setTimeout(() => this.displayFooterElement(!this.showInstructionView), 150);
|
|
70
68
|
}
|
|
71
69
|
get isMode() {
|
|
70
|
+
const { image, text, textimage } = SwipeCardsMode;
|
|
72
71
|
return {
|
|
73
|
-
image: this.mode ===
|
|
74
|
-
textimage: this.mode ===
|
|
75
|
-
text: this.mode ===
|
|
72
|
+
image: this.mode === image,
|
|
73
|
+
textimage: this.mode === textimage,
|
|
74
|
+
text: this.mode === text
|
|
76
75
|
};
|
|
77
76
|
}
|
|
78
77
|
get numberEmptyItems() {
|
|
@@ -95,14 +94,15 @@ const YooFormSwipeCardsComponent = class {
|
|
|
95
94
|
}
|
|
96
95
|
get hasAllCardBeenSwiped() {
|
|
97
96
|
var _a;
|
|
98
|
-
return !((_a = this.swipeCards) === null || _a === void 0 ? void 0 : _a.filter(
|
|
97
|
+
return !((_a = this.swipeCards) === null || _a === void 0 ? void 0 : _a.filter(({ swipedDirection }) => !swipedDirection).length);
|
|
99
98
|
}
|
|
100
99
|
get buttons() {
|
|
101
|
-
const
|
|
100
|
+
const { left, right, undo } = SwipeCardsDirection;
|
|
101
|
+
const getButton = (direction) => { var _a, _b; return (_b = (_a = this.swipeButtons) === null || _a === void 0 ? void 0 : _a.filter(({ id }) => id === `swipe-${direction}`)) === null || _b === void 0 ? void 0 : _b[0]; };
|
|
102
102
|
return {
|
|
103
|
-
left: getButton(
|
|
104
|
-
undo: getButton(
|
|
105
|
-
right: getButton(
|
|
103
|
+
left: getButton(left),
|
|
104
|
+
undo: getButton(undo),
|
|
105
|
+
right: getButton(right)
|
|
106
106
|
};
|
|
107
107
|
}
|
|
108
108
|
get currentCard() {
|
|
@@ -112,12 +112,8 @@ const YooFormSwipeCardsComponent = class {
|
|
|
112
112
|
var _a;
|
|
113
113
|
return this.getCardElement((_a = this.currentCard) === null || _a === void 0 ? void 0 : _a.id);
|
|
114
114
|
}
|
|
115
|
-
get formHeight() {
|
|
116
|
-
var _a;
|
|
117
|
-
return ((_a = findParent(this.host, 'form')) === null || _a === void 0 ? void 0 : _a.clientHeight) - 1.5 * 16;
|
|
118
|
-
}
|
|
119
115
|
componentWillLoad() {
|
|
120
|
-
this.
|
|
116
|
+
this.prepareGame();
|
|
121
117
|
}
|
|
122
118
|
componentDidLoad() {
|
|
123
119
|
this.initGame();
|
|
@@ -135,17 +131,15 @@ const YooFormSwipeCardsComponent = class {
|
|
|
135
131
|
this.validityChanged.emit(this.validity);
|
|
136
132
|
return this.validity;
|
|
137
133
|
}
|
|
138
|
-
|
|
134
|
+
prepareGame() {
|
|
139
135
|
this.shuffleCardValues();
|
|
136
|
+
this.animationDelay = this.animated ? .25 : 0;
|
|
140
137
|
this.revealCards = !this.showInstructionView;
|
|
141
138
|
this.swipeCards = this.initCards();
|
|
142
139
|
}
|
|
143
140
|
initGame() {
|
|
144
141
|
this.displayFooterElement(false);
|
|
145
|
-
|
|
146
|
-
this.initDraggable();
|
|
147
|
-
}
|
|
148
|
-
this.showWarnings();
|
|
142
|
+
!this.showInstructionView && this.initDraggable();
|
|
149
143
|
}
|
|
150
144
|
updateCardsData() {
|
|
151
145
|
if (this.hasDataChanged) {
|
|
@@ -172,7 +166,7 @@ const YooFormSwipeCardsComponent = class {
|
|
|
172
166
|
return (_a = this.cardsElements) === null || _a === void 0 ? void 0 : _a.find((cardElement) => (cardElement === null || cardElement === void 0 ? void 0 : cardElement.id) === id);
|
|
173
167
|
}
|
|
174
168
|
spyOnValuesChanged() {
|
|
175
|
-
this.showWarnings();
|
|
169
|
+
this.hasDataChanged && this.showWarnings();
|
|
176
170
|
}
|
|
177
171
|
showWarnings() {
|
|
178
172
|
var _a;
|
|
@@ -205,7 +199,7 @@ const YooFormSwipeCardsComponent = class {
|
|
|
205
199
|
return value;
|
|
206
200
|
};
|
|
207
201
|
const getValuesFromDirection = (direction) => this.swipeCards.filter(c => c.swipedDirection === direction).map(c => formatCardValue(c.value));
|
|
208
|
-
setValueAndValidateInput([
|
|
202
|
+
this.livePreview ? forceUpdate(this) : setValueAndValidateInput([
|
|
209
203
|
getValuesFromDirection(SwipeCardsDirection.left),
|
|
210
204
|
getValuesFromDirection(SwipeCardsDirection.right)
|
|
211
205
|
], this);
|
|
@@ -258,9 +252,11 @@ const YooFormSwipeCardsComponent = class {
|
|
|
258
252
|
}
|
|
259
253
|
setSwipingColor(swipingDirection) {
|
|
260
254
|
if (this.currentCardElement) {
|
|
255
|
+
const { left, right } = SwipeCardsDirection;
|
|
256
|
+
const [categoryLeft, categoryRight] = this.categories;
|
|
261
257
|
const categoryContainer = this.currentCardElement.querySelector('.content-category');
|
|
262
|
-
const isThrowable = [
|
|
263
|
-
categoryContainer.textContent =
|
|
258
|
+
const isThrowable = [left, right].includes(swipingDirection);
|
|
259
|
+
categoryContainer.textContent = translateMulti(swipingDirection === left ? categoryLeft : swipingDirection === right ? categoryRight : '');
|
|
264
260
|
[this.gameContainerElement, this.currentCardElement].forEach(e => {
|
|
265
261
|
isThrowable ? e.setAttribute('direction', swipingDirection) : e.removeAttribute('direction');
|
|
266
262
|
});
|
|
@@ -276,13 +272,13 @@ const YooFormSwipeCardsComponent = class {
|
|
|
276
272
|
const returnedAnimation = timeline();
|
|
277
273
|
// building swiping animation
|
|
278
274
|
const swipeAnimation = timeline({ paused: true });
|
|
279
|
-
const isSwipeable =
|
|
275
|
+
const isSwipeable = el => el.classList.contains('current');
|
|
280
276
|
swipeAnimation
|
|
281
277
|
.fromTo(this.buttons.left, 1, { scale: 1.5 }, { scale: 1 }, 0)
|
|
282
278
|
.fromTo(this.buttons.right, 1, { scale: 1 }, { scale: 1.5 }, 1)
|
|
283
279
|
.progress(.5);
|
|
284
|
-
const onStartSwiping = (
|
|
285
|
-
if (isSwipeable(
|
|
280
|
+
const onStartSwiping = () => {
|
|
281
|
+
if (isSwipeable(cardElement)) {
|
|
286
282
|
this.blockMoves.emit(true);
|
|
287
283
|
returnedAnimation === null || returnedAnimation === void 0 ? void 0 : returnedAnimation.kill();
|
|
288
284
|
}
|
|
@@ -294,33 +290,35 @@ const YooFormSwipeCardsComponent = class {
|
|
|
294
290
|
this.setSwipingColor(this.getSwipedState(swipeProgress).swipedDirection);
|
|
295
291
|
}
|
|
296
292
|
};
|
|
297
|
-
const onThrowing = (
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
293
|
+
const onThrowing = () => {
|
|
294
|
+
const baseProps = { left: 0, top: 0 };
|
|
295
|
+
if (isSwipeable(cardElement)) {
|
|
296
|
+
const { isCardThrowable, swipedDirection } = this.getSwipedState(swipeAnimation.progress());
|
|
297
|
+
!isCardThrowable ?
|
|
301
298
|
returnedAnimation
|
|
302
|
-
.to(cardElement, this.animationDelay,
|
|
299
|
+
.to(cardElement, this.animationDelay, baseProps)
|
|
303
300
|
.to([this.buttons.left, this.buttons.right], { scale: 1, ease: Power1.easeInOut }, 0) :
|
|
304
|
-
this.swipeCard(
|
|
301
|
+
this.swipeCard(swipedDirection);
|
|
305
302
|
}
|
|
306
303
|
else {
|
|
307
|
-
gsapTo(cardElement, this.animationDelay,
|
|
304
|
+
gsapTo(cardElement, this.animationDelay, baseProps);
|
|
308
305
|
}
|
|
306
|
+
this.blockMoves.emit(false);
|
|
309
307
|
};
|
|
310
308
|
return (new Draggable(cardElement, {
|
|
311
309
|
bound: this.host,
|
|
312
310
|
type: 'left, top',
|
|
313
311
|
cursor: 'grab',
|
|
314
312
|
zIndexBoost: false,
|
|
315
|
-
onDragStart()
|
|
313
|
+
onDragStart: () => onStartSwiping(),
|
|
316
314
|
onDrag() { onSwiping(this); },
|
|
317
|
-
onDragEnd()
|
|
315
|
+
onDragEnd: () => onThrowing()
|
|
318
316
|
}));
|
|
319
317
|
}
|
|
320
318
|
clickToSwipe(clickedDirection) {
|
|
321
319
|
if (!this.buttons[clickedDirection].disabled) {
|
|
322
320
|
this.setSwipingColor(clickedDirection);
|
|
323
|
-
|
|
321
|
+
this.swipeCard(clickedDirection);
|
|
324
322
|
}
|
|
325
323
|
}
|
|
326
324
|
async undoSwipe() {
|
|
@@ -339,22 +337,20 @@ const YooFormSwipeCardsComponent = class {
|
|
|
339
337
|
}
|
|
340
338
|
}
|
|
341
339
|
}
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
}
|
|
346
|
-
renderStack() {
|
|
347
|
-
return h("section", { id: "stack" }, this.swipeCards.map((card, i, s) => {
|
|
348
|
-
var _a;
|
|
349
|
-
const currentCardIndex = s.indexOf(this.currentCard) || 0;
|
|
340
|
+
renderCards() {
|
|
341
|
+
return h("section", { id: "cards" }, this.swipeCards.map(({ swipedDirection, value, id }, i, s) => {
|
|
342
|
+
const currentCardIndex = s.indexOf(this.currentCard);
|
|
350
343
|
const hasCurrentCard = currentCardIndex !== -1;
|
|
351
|
-
return h("
|
|
344
|
+
return h("div", { id: id, class: {
|
|
352
345
|
card: true,
|
|
353
346
|
current: i === currentCardIndex,
|
|
354
347
|
second: hasCurrentCard && i === currentCardIndex + 1,
|
|
355
348
|
third: hasCurrentCard && i === currentCardIndex + 2,
|
|
356
349
|
revealing: this.revealCards
|
|
357
|
-
},
|
|
350
|
+
}, ref: el => this.cardsElements[i] = el, ...{
|
|
351
|
+
type: this.mode,
|
|
352
|
+
...(swipedDirection && { direction: swipedDirection })
|
|
353
|
+
} }, this.hasImage && (h("div", { class: "content-image" }, h("yoo-img", { instant: true, src: getMedia(value['_downloadURL']) }))), this.hasText && (h("div", { class: "content-text" }, translateMulti((value === null || value === void 0 ? void 0 : value['_filename']) || value))), h("div", { class: "content-category" }));
|
|
358
354
|
}));
|
|
359
355
|
}
|
|
360
356
|
renderInstructionCategory(side) {
|
|
@@ -363,10 +359,10 @@ const YooFormSwipeCardsComponent = class {
|
|
|
363
359
|
const iconColor = isWeb(this.host) ? categoryColor : 'light';
|
|
364
360
|
const iconSize = isWeb(this.host) ? 'large' : 'medium';
|
|
365
361
|
const category = this.categories && translateMulti(isLeftCategory ? this.categories[0] : this.categories[1]);
|
|
366
|
-
return h("div", { class:
|
|
362
|
+
return h("div", { class: { category: true, [side]: true } }, h("yoo-tag", { noBackground: isWeb(this.host), color: categoryColor, size: "large", icon: `big-arrow-${side}`, iconOnlyColor: iconColor, iconOnlySize: iconSize }), h("p", { class: `${categoryColor}` }, category), h("span", { class: "stable" }, translate(`SWIPE${side.toUpperCase()}`)));
|
|
367
363
|
}
|
|
368
364
|
renderTopDescription() {
|
|
369
|
-
return h("div", { id: "header" }, h("
|
|
365
|
+
return h("div", { id: "header" }, h("span", { id: "title", innerHTML: translateMulti(this.label) }), h("span", { class: "stable" }, translate(this.description || 'CARDSWIPEDEFAULTINSTRUCTIONS')));
|
|
370
366
|
}
|
|
371
367
|
renderInstructions() {
|
|
372
368
|
return (h("section", { id: "instructions" }, this.renderTopDescription(), h("section", { id: "categories" }, this.renderInstructionCategory(SwipeCardsDirection.left), h("yoo-icon", { size: "extra-extra-large", name: "swipe-explanation", color: "stable-alt" }), this.renderInstructionCategory(SwipeCardsDirection.right)), this.instructionsDocument && (h("section", { id: "document" }, h("div", { class: "document-title" }, translate('ATTACHMENTS')), h("yoo-form-document", { document: this.instructionsDocument, readonly: true, onInputChanged: (ev) => ev.stopPropagation() }))), h("yoo-button", { disabled: !(this.hasTwoCategories && !this.hasDuplicatesValues), size: (isWeb(this.host) && !this.livePreview) ? 'medium' : 'large', color: "app-color", onClick: () => {
|
|
@@ -376,7 +372,8 @@ const YooFormSwipeCardsComponent = class {
|
|
|
376
372
|
} }, translate('START'))));
|
|
377
373
|
}
|
|
378
374
|
renderSwipeButtons() {
|
|
379
|
-
|
|
375
|
+
const { left, undo, right } = SwipeCardsDirection;
|
|
376
|
+
return h("section", { id: "actions" }, [left, undo, right].map((d, i) => this.renderSwipeAction(d, i)));
|
|
380
377
|
}
|
|
381
378
|
renderSwipeAction(direction, index) {
|
|
382
379
|
var _a;
|
|
@@ -386,15 +383,15 @@ const YooFormSwipeCardsComponent = class {
|
|
|
386
383
|
const actionColor = isUndo ? isWeb(this.host) ? 'light' : 'stable-alt' : isLeft ? 'app-color' : 'warning';
|
|
387
384
|
const swipeIcon = isUndo ? 'undo' : `big-arrow-${direction}`;
|
|
388
385
|
const categoryIndex = isLeft ? 0 : 1;
|
|
389
|
-
return (h("div", { class: {
|
|
386
|
+
return (h("div", { class: { action: true, hide: this.hasAllCardBeenSwiped && !isUndo } }, h("yoo-button", { shape: "circular", rippleType: "unbounded", id: `swipe-${direction}`, size: (isUndo && !isMobile) ? 'medium' : 'large', fill: (isMobile || isUndo) ? 'solid' : 'transparent', color: isUndo ? isMobile ? 'stable-light' : 'text-color' : actionColor.concat('-20'), ref: (element) => (this.swipeButtons[index] = element), onClick: () => isUndo ? this.undoSwipe() : this.clickToSwipe(direction) }, h("yoo-icon", { name: swipeIcon, color: actionColor, size: isMobile ? 'medium' : isUndo ? 'small' : 'large' })), !isUndo && ((_a = this.categories) === null || _a === void 0 ? void 0 : _a.length) && h("span", { class: actionColor }, translateMulti(this.categories[categoryIndex]))));
|
|
390
387
|
}
|
|
391
388
|
renderEndGameMessage() {
|
|
392
|
-
return h("section", { id: "end-message", class: {
|
|
389
|
+
return h("section", { id: "end-message", class: { active: this.hasAllCardBeenSwiped } }, h("yoo-lottie", { autoplay: this.hasAllCardBeenSwiped, type: "check" }), h("div", { innerHTML: translate('ENDSWIPINGCARDSMESSAGE') }), h("span", null, translate('CLICKTOCONTINUE', { buttonName: this.nextButtonText })));
|
|
393
390
|
}
|
|
394
|
-
|
|
391
|
+
renderGame() {
|
|
395
392
|
return [
|
|
396
393
|
isWeb(this.host) && !this.livePreview && this.renderTopDescription(),
|
|
397
|
-
h("section", { id: "game", ref: (element) => (this.gameContainerElement = element) }, this.renderEndGameMessage(), this.
|
|
394
|
+
h("section", { id: "game", ref: (element) => (this.gameContainerElement = element) }, this.renderEndGameMessage(), this.renderCards()),
|
|
398
395
|
this.renderSwipeButtons()
|
|
399
396
|
];
|
|
400
397
|
}
|
|
@@ -419,7 +416,7 @@ const YooFormSwipeCardsComponent = class {
|
|
|
419
416
|
return this.livePreview && h("yoo-banner", null, h("p", { slot: "content" }));
|
|
420
417
|
}
|
|
421
418
|
render() {
|
|
422
|
-
return (h(Host, {
|
|
419
|
+
return (h(Host, { class: { ...getAppContext(this.host), 'swiper-no-swiping': !this.readonly, instructions: this.showInstructionView } }, this.renderBanner(), !this.readonly && (this.showInstructionView ? this.renderInstructions() : this.renderGame()), this.readonly && this.renderSummary()));
|
|
423
420
|
}
|
|
424
421
|
get host() { return getElement(this); }
|
|
425
422
|
static get watchers() { return {
|
|
@@ -11376,8 +11376,14 @@ const YooIonSlidesComponent = class {
|
|
|
11376
11376
|
* Transition to the specified slide.
|
|
11377
11377
|
*/
|
|
11378
11378
|
async slideTo(index, speed, runCallbacks) {
|
|
11379
|
+
var _a;
|
|
11379
11380
|
const swiper = await this.getSwiper();
|
|
11380
|
-
|
|
11381
|
+
if (index >= ((_a = swiper.slides) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
11382
|
+
swiper.once('slidesLengthChange', () => swiper.slideTo(index, speed, runCallbacks));
|
|
11383
|
+
}
|
|
11384
|
+
else {
|
|
11385
|
+
swiper.slideTo(index, speed, runCallbacks);
|
|
11386
|
+
}
|
|
11381
11387
|
}
|
|
11382
11388
|
/**
|
|
11383
11389
|
* Transition to the next slide.
|
|
@@ -11573,7 +11579,7 @@ const YooIonSlidesComponent = class {
|
|
|
11573
11579
|
async initSwiper() {
|
|
11574
11580
|
const finalOptions = this.normalizeOptions();
|
|
11575
11581
|
// init swiper core
|
|
11576
|
-
const { Swiper } = await import('./swiper-
|
|
11582
|
+
const { Swiper } = await import('./swiper-80225cb6.js');
|
|
11577
11583
|
await waitForSlides(this.el);
|
|
11578
11584
|
const swiper = new Swiper(this.el, finalOptions);
|
|
11579
11585
|
this.swiperReady = true;
|
|
@@ -216,7 +216,7 @@ const YooLessonQuestionResultComponent = class {
|
|
|
216
216
|
}
|
|
217
217
|
else if (!isContentOnly(this.lessonType)) {
|
|
218
218
|
items = (_b = this.fields) === null || _b === void 0 ? void 0 : _b.map((field, i) => {
|
|
219
|
-
var _a, _b, _c, _d, _e, _f;
|
|
219
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
220
220
|
return ({
|
|
221
221
|
name: `${translate('QUESTION')} ${i + 1}`,
|
|
222
222
|
description: translateMulti(field.sentence || field.description || field.title),
|
|
@@ -228,11 +228,12 @@ const YooLessonQuestionResultComponent = class {
|
|
|
228
228
|
? ((_d = this.lessonData[field.name]) === null || _d === void 0 ? void 0 : _d.earnedConfidencePoints) + ((_e = this.lessonData[field.name]) === null || _e === void 0 ? void 0 : _e.earnedQuestionPoints)
|
|
229
229
|
: ((_f = this.lessonData[field.name]) === null || _f === void 0 ? void 0 : _f.fieldValidity)
|
|
230
230
|
? Math.round(this.points)
|
|
231
|
-
: 0
|
|
231
|
+
: 0,
|
|
232
|
+
isCorrect: (_g = this.lessonData[field.name]) === null || _g === void 0 ? void 0 : _g.fieldValidity
|
|
232
233
|
});
|
|
233
234
|
});
|
|
234
235
|
}
|
|
235
|
-
return h("yoo-points-recap", { heading: translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon });
|
|
236
|
+
return h("yoo-points-recap", { heading: translate('TOTALPOINTSEARNED'), totalPoints: Math.round(this.earnedPoints), items: items, showItemIcon: showItemIcon, forceTotalPoints: true });
|
|
236
237
|
}
|
|
237
238
|
renderProgressBarLessonRecap() {
|
|
238
239
|
var _a;
|
|
@@ -5226,7 +5226,7 @@ var lottie = createCommonjsModule(function (module, exports) {
|
|
|
5226
5226
|
lottie.useWebWorker = setWebWorker;
|
|
5227
5227
|
lottie.setIDPrefix = setPrefix;
|
|
5228
5228
|
lottie.__getFactory = getFactory;
|
|
5229
|
-
lottie.version = '5.9.
|
|
5229
|
+
lottie.version = '5.9.5';
|
|
5230
5230
|
|
|
5231
5231
|
function checkReady() {
|
|
5232
5232
|
if (document.readyState === 'complete') {
|
|
@@ -15237,10 +15237,35 @@ var lottie = createCommonjsModule(function (module, exports) {
|
|
|
15237
15237
|
this.calculateShapeBoundingBox(itemsData[i], boundingBox);
|
|
15238
15238
|
} else if (itemsData[i] && itemsData[i].it) {
|
|
15239
15239
|
this.calculateBoundingBox(itemsData[i].it, boundingBox);
|
|
15240
|
+
} else if (itemsData[i] && itemsData[i].style && itemsData[i].w) {
|
|
15241
|
+
this.expandStrokeBoundingBox(itemsData[i].w, boundingBox);
|
|
15240
15242
|
}
|
|
15241
15243
|
}
|
|
15242
15244
|
};
|
|
15243
15245
|
|
|
15246
|
+
HShapeElement.prototype.expandStrokeBoundingBox = function (widthProperty, boundingBox) {
|
|
15247
|
+
var width = 0;
|
|
15248
|
+
|
|
15249
|
+
if (widthProperty.keyframes) {
|
|
15250
|
+
for (var i = 0; i < widthProperty.keyframes.length; i += 1) {
|
|
15251
|
+
var kfw = widthProperty.keyframes[i].s;
|
|
15252
|
+
|
|
15253
|
+
if (kfw > width) {
|
|
15254
|
+
width = kfw;
|
|
15255
|
+
}
|
|
15256
|
+
}
|
|
15257
|
+
|
|
15258
|
+
width *= widthProperty.mult;
|
|
15259
|
+
} else {
|
|
15260
|
+
width = widthProperty.v * widthProperty.mult;
|
|
15261
|
+
}
|
|
15262
|
+
|
|
15263
|
+
boundingBox.x -= width;
|
|
15264
|
+
boundingBox.xMax += width;
|
|
15265
|
+
boundingBox.y -= width;
|
|
15266
|
+
boundingBox.yMax += width;
|
|
15267
|
+
};
|
|
15268
|
+
|
|
15244
15269
|
HShapeElement.prototype.currentBoxContains = function (box) {
|
|
15245
15270
|
return this.currentBBox.x <= box.x && this.currentBBox.y <= box.y && this.currentBBox.width + this.currentBBox.x >= box.x + box.width && this.currentBBox.height + this.currentBBox.y >= box.y + box.height;
|
|
15246
15271
|
};
|
|
@@ -18417,11 +18442,12 @@ var lottie = createCommonjsModule(function (module, exports) {
|
|
|
18417
18442
|
};
|
|
18418
18443
|
|
|
18419
18444
|
function SVGDropShadowEffect(filter, filterManager, elem, id, source) {
|
|
18420
|
-
var
|
|
18421
|
-
|
|
18422
|
-
filter.setAttribute('
|
|
18423
|
-
filter.setAttribute('
|
|
18424
|
-
filter.setAttribute('
|
|
18445
|
+
var globalFilterSize = filterManager.container.globalData.renderConfig.filterSize;
|
|
18446
|
+
var filterSize = filterManager.data.fs || globalFilterSize;
|
|
18447
|
+
filter.setAttribute('x', filterSize.x || globalFilterSize.x);
|
|
18448
|
+
filter.setAttribute('y', filterSize.y || globalFilterSize.y);
|
|
18449
|
+
filter.setAttribute('width', filterSize.width || globalFilterSize.width);
|
|
18450
|
+
filter.setAttribute('height', filterSize.height || globalFilterSize.height);
|
|
18425
18451
|
this.filterManager = filterManager;
|
|
18426
18452
|
var feGaussianBlur = createNS('feGaussianBlur');
|
|
18427
18453
|
feGaussianBlur.setAttribute('in', 'SourceAlpha');
|
|
@@ -6,6 +6,7 @@ const YooPointsRecap = class {
|
|
|
6
6
|
constructor(hostRef) {
|
|
7
7
|
registerInstance(this, hostRef);
|
|
8
8
|
this.showItemIcon = true;
|
|
9
|
+
this.forceTotalPoints = false;
|
|
9
10
|
}
|
|
10
11
|
onItemsUpdated() {
|
|
11
12
|
this.updatePoints();
|
|
@@ -31,8 +32,8 @@ const YooPointsRecap = class {
|
|
|
31
32
|
return 'success';
|
|
32
33
|
}
|
|
33
34
|
}
|
|
34
|
-
getItemIconAttr(
|
|
35
|
-
if (
|
|
35
|
+
getItemIconAttr(isCorrect) {
|
|
36
|
+
if (!isCorrect) {
|
|
36
37
|
return { name: 'close', color: 'danger' };
|
|
37
38
|
}
|
|
38
39
|
else {
|
|
@@ -42,7 +43,7 @@ const YooPointsRecap = class {
|
|
|
42
43
|
renderTitle(title) {
|
|
43
44
|
var _a, _b;
|
|
44
45
|
const titleClass = `item ${((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) > 0 ? this.heading ? 'heading' : this.footer && 'footer' : 'content'}`;
|
|
45
|
-
const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length)) ? this.totalPoints : this.totalItemsPoints;
|
|
46
|
+
const points = (this.footer || !((_b = this.items) === null || _b === void 0 ? void 0 : _b.length) || this.forceTotalPoints) ? this.totalPoints : this.totalItemsPoints;
|
|
46
47
|
const tagColor = this.getTagColor(points);
|
|
47
48
|
return (h("div", { class: "row" }, this.footer && this.renderSeparator(), h("div", { class: titleClass }, h("div", null, h("b", null, title)), h("div", null, h("yoo-tag", { size: "medium", color: `${tagColor}-10` }, h("yoo-icon", { slot: "start", name: "star", size: "small", color: tagColor }), h("div", null, points)))), this.heading && this.renderSeparator()));
|
|
48
49
|
}
|
|
@@ -53,7 +54,7 @@ const YooPointsRecap = class {
|
|
|
53
54
|
renderItem(item, index) {
|
|
54
55
|
var _a;
|
|
55
56
|
const tagColor = this.getTagColor(item.points);
|
|
56
|
-
const itemIcon = this.getItemIconAttr(item.
|
|
57
|
+
const itemIcon = this.getItemIconAttr(item.isCorrect);
|
|
57
58
|
return (h("div", { class: "row" }, h("div", { class: "item content" }, h("div", { class: "sub-item" }, this.showItemIcon && h("yoo-icon", { slot: "start", name: itemIcon.name, size: "medium", color: itemIcon.color }), item.subItem ? this.renderSubItem(item) :
|
|
58
59
|
h("yoo-tooltip", { placement: "top", content: item.description }, h("div", { class: "name" }, item.name))), h("div", null, h("yoo-tag", { size: "medium", color: `${tagColor}-10` }, h("yoo-icon", { slot: "start", name: "star", size: "small", color: tagColor }), h("div", null, item.points)))), (((_a = this.items) === null || _a === void 0 ? void 0 : _a.length) - 1) !== index && h("div", { class: "separator" })));
|
|
59
60
|
}
|