fcad-core-dragon 2.0.0-beta.1 → 2.0.0-beta.3

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 (118) hide show
  1. package/.editorconfig +33 -33
  2. package/.eslintignore +29 -29
  3. package/{.eslintrc.js → .eslintrc.cjs} +81 -86
  4. package/CHANGELOG +364 -364
  5. package/README.md +71 -71
  6. package/bk.scss +117 -0
  7. package/package.json +61 -63
  8. package/src/$locales/en.json +143 -179
  9. package/src/$locales/fr.json +105 -181
  10. package/src/assets/data/onboardingMessages.json +47 -47
  11. package/src/components/AppBase.vue +1054 -614
  12. package/src/components/AppBaseButton.vue +87 -63
  13. package/src/components/AppBaseErrorDisplay.vue +438 -420
  14. package/src/components/AppBaseFlipCard.vue +84 -83
  15. package/src/components/AppBaseModule.vue +1673 -1842
  16. package/src/components/AppBasePage.vue +779 -312
  17. package/src/components/AppBasePopover.vue +41 -0
  18. package/src/components/AppCompAudio.vue +234 -0
  19. package/src/components/AppCompBranchButtons.vue +552 -582
  20. package/src/components/AppCompButtonProgress.vue +126 -147
  21. package/src/components/AppCompCarousel.vue +298 -192
  22. package/src/components/AppCompInputCheckBoxNext.vue +195 -0
  23. package/src/components/AppCompInputDropdownNext.vue +159 -0
  24. package/src/components/AppCompInputRadioNext.vue +152 -0
  25. package/src/components/{AppCompInputTextBox.vue → AppCompInputTextNext.vue} +106 -91
  26. package/src/components/AppCompInputTextTableNext.vue +141 -0
  27. package/src/components/AppCompInputTextToFillDropdownNext.vue +230 -0
  28. package/src/components/{AppCompInputTextToFillText.vue → AppCompInputTextToFillNext.vue} +171 -164
  29. package/src/components/AppCompJauge.vue +74 -55
  30. package/src/components/AppCompMenu.vue +413 -209
  31. package/src/components/AppCompMenuItem.vue +228 -174
  32. package/src/components/AppCompNavigation.vue +960 -949
  33. package/src/components/AppCompNoteCall.vue +133 -126
  34. package/src/components/AppCompNoteCredit.vue +292 -164
  35. package/src/components/AppCompPlayBar.vue +1218 -1319
  36. package/src/components/AppCompPlayBarNext.vue +2052 -0
  37. package/src/components/AppCompPlayBarProgress.vue +82 -0
  38. package/src/components/AppCompPopUpNext.vue +503 -0
  39. package/src/components/{AppCompQuiz.vue → AppCompQuizNext.vue} +2904 -2989
  40. package/src/components/AppCompQuizRecall.vue +276 -250
  41. package/src/components/AppCompSVGNext.vue +347 -0
  42. package/src/components/AppCompSettingsMenu.vue +172 -171
  43. package/src/components/AppCompTableOfContent.vue +387 -264
  44. package/src/components/AppCompTranscript.vue +24 -19
  45. package/src/components/AppCompVideoPlayer.vue +368 -336
  46. package/src/components/AppCompViewDisplay.vue +6 -6
  47. package/src/components/BaseModule.vue +72 -67
  48. package/src/composables/useQuiz.js +206 -0
  49. package/src/externalComps/ModuleView.vue +22 -0
  50. package/src/externalComps/SummaryView.vue +91 -0
  51. package/src/main.js +272 -227
  52. package/src/mixins/$mediaMixins.js +819 -0
  53. package/src/mixins/timerMixin.js +155 -156
  54. package/src/module/stores/appStore.js +893 -0
  55. package/src/module/xapi/ADL.js +376 -339
  56. package/src/module/xapi/Crypto/Hasher.js +241 -241
  57. package/src/module/xapi/Crypto/WordArray.js +278 -278
  58. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
  59. package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -319
  60. package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
  61. package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
  62. package/src/module/xapi/Crypto/encoders/Base.js +105 -105
  63. package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
  64. package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
  65. package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
  66. package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
  67. package/src/module/xapi/Crypto/index.js +53 -53
  68. package/src/module/xapi/Statement/activity.js +47 -47
  69. package/src/module/xapi/Statement/agent.js +55 -55
  70. package/src/module/xapi/Statement/group.js +26 -26
  71. package/src/module/xapi/Statement/index.js +259 -259
  72. package/src/module/xapi/Statement/statement.js +253 -253
  73. package/src/module/xapi/Statement/statementRef.js +23 -23
  74. package/src/module/xapi/Statement/substatement.js +22 -22
  75. package/src/module/xapi/Statement/verb.js +36 -36
  76. package/src/module/xapi/activitytypes.js +17 -17
  77. package/src/module/xapi/launch.js +157 -157
  78. package/src/module/xapi/utils.js +167 -167
  79. package/src/module/xapi/verbs.js +294 -294
  80. package/src/module/xapi/wrapper.js +1963 -1890
  81. package/src/module/xapi/xapiStatement.js +444 -444
  82. package/src/plugins/bus.js +8 -3
  83. package/src/plugins/gsap.js +14 -17
  84. package/src/plugins/helper.js +308 -295
  85. package/src/plugins/i18n.js +44 -31
  86. package/src/plugins/idb.js +219 -212
  87. package/src/plugins/save.js +37 -37
  88. package/src/plugins/scorm.js +287 -287
  89. package/src/plugins/xapi.js +11 -11
  90. package/src/public/index.html +33 -21
  91. package/src/router/index.js +43 -41
  92. package/src/router/routes.js +312 -337
  93. package/src/shared/generalfuncs.js +210 -188
  94. package/src/shared/validators.js +1069 -249
  95. package/vite.config.js +27 -0
  96. package/.prettierrc.js +0 -5
  97. package/babel.config.js +0 -3
  98. package/src/components/AppBaseDragChoice.vue +0 -91
  99. package/src/components/AppBaseDropZone.vue +0 -112
  100. package/src/components/AppCompBif.vue +0 -120
  101. package/src/components/AppCompDragAndDrop.vue +0 -339
  102. package/src/components/AppCompInputAssociation.vue +0 -332
  103. package/src/components/AppCompInputCheckBox.vue +0 -227
  104. package/src/components/AppCompInputDropdown.vue +0 -184
  105. package/src/components/AppCompInputRadio.vue +0 -169
  106. package/src/components/AppCompInputTextTable.vue +0 -155
  107. package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
  108. package/src/components/AppCompMediaPlayer.vue +0 -397
  109. package/src/components/AppCompPopUp.vue +0 -522
  110. package/src/components/AppCompPopover.vue +0 -27
  111. package/src/components/AppCompSVG.vue +0 -309
  112. package/src/mixins/$pageMixins.js +0 -459
  113. package/src/mixins/$quizMixins.js +0 -456
  114. package/src/module/store.js +0 -895
  115. package/src/plugins/timeManager.js +0 -77
  116. package/src/routes_bckp.js +0 -313
  117. package/src/routes_static.js +0 -344
  118. package/vue.config.js +0 -83
@@ -0,0 +1,41 @@
1
+ <!--
2
+ @ Description: This component is used to create a popover that is accessible via keyboard navigation (tab + space/enter)
3
+ -->
4
+ <template>
5
+ <v-tooltip
6
+ ref="tooltip"
7
+ v-bind="$attrs"
8
+ v-model="show"
9
+ transition="false"
10
+ :open-on-click="true"
11
+ :persistent="false"
12
+ >
13
+ <slot></slot>
14
+ </v-tooltip>
15
+ </template>
16
+
17
+ <script>
18
+ export default {
19
+ name: 'AppBasePopover',
20
+ data() {
21
+ return {
22
+ show: false,
23
+ alertContainer: null
24
+ }
25
+ },
26
+ watch: {
27
+ show: {
28
+ handler(newValue) {
29
+ if (newValue) {
30
+ const content = this.$refs.tooltip.contentEl.textContent
31
+ this.alertContainer.textContent = ''
32
+ this.alertContainer.textContent = content
33
+ }
34
+ }
35
+ }
36
+ },
37
+ mounted() {
38
+ this.alertContainer = document.getElementById('hiddenAlertContainer')
39
+ }
40
+ }
41
+ </script>
@@ -0,0 +1,234 @@
1
+ <template>
2
+ <section
3
+ :id="'audio_' + id"
4
+ ref="$media-container"
5
+ class="__media-container"
6
+ aria-label="Audio"
7
+ >
8
+ <!--Integration error display-->
9
+ <app-base-error-display
10
+ v-if="hasErr.length"
11
+ :error-group="'component'"
12
+ :error-title="`ERREUR: COMPOSANT D'AUDIO`"
13
+ :errors-list="hasErr"
14
+ />
15
+
16
+ <div v-else class="audio-card">
17
+ <!--Waiting and loading error -- skeleton-->
18
+ <div
19
+ v-if="isLoading || hasSourceLoadingError"
20
+ class="skeleton audio"
21
+ :class="{ isloading: isLoading, error: hasSourceLoadingError }"
22
+ >
23
+ <p v-if="hasSourceLoadingError">
24
+ Une erreur s'est produite lors du chargement du média, veuillez
25
+ réessayer
26
+ </p>
27
+ </div>
28
+ <!--Audio content-->
29
+ <div v-show="!isLoading && !hasSourceLoadingError" class="audio-content">
30
+ <img v-if="mPoster" class="audio-img" :src="mPoster" :alt="mAlt" />
31
+ <div class="audio-media">
32
+ <h5>{{ mTitle }}</h5>
33
+ <div class="audio-media-player">
34
+ <audio
35
+ :id="id"
36
+ ref="m-audio"
37
+ @loadedmetadata="updateMediaData($event)"
38
+ >
39
+ <source
40
+ v-for="(aSource, index) in mSources"
41
+ :key="index"
42
+ :src="aSource.src"
43
+ :type="aSource.type ? `audio/${aSource.type}` : 'audio/mp3'"
44
+ @error="errorHandling($event)"
45
+ />
46
+ </audio>
47
+ <app-comp-play-bar-next
48
+ v-if="$audElement"
49
+ :ref="`plyr_${id}`"
50
+ :media-to-play="$audElement"
51
+ />
52
+ </div>
53
+ </div>
54
+ </div>
55
+ <div class="audio-transcript">
56
+ <v-expansion-panels class="audio">
57
+ <v-expansion-panel>
58
+ <v-expansion-panel-title>
59
+ {{ $t('text.transcript') }}
60
+ </v-expansion-panel-title>
61
+ <v-expansion-panel-text>
62
+ <div v-html="mTranscript"></div>
63
+ </v-expansion-panel-text>
64
+ </v-expansion-panel>
65
+ </v-expansion-panels>
66
+ </div>
67
+ </div>
68
+ </section>
69
+ </template>
70
+ <script>
71
+ import { mapState, mapActions } from 'pinia'
72
+ import { useAppStore } from '../module/stores/appStore'
73
+ import { validateAudioData } from '../shared/validators'
74
+ import AppCompPlayBarNext from './AppCompPlayBarNext.vue'
75
+
76
+ export default {
77
+ components: { AppCompPlayBarNext },
78
+ props: {
79
+ audData: {
80
+ type: Object,
81
+ required: true
82
+ }
83
+ },
84
+ data() {
85
+ return {
86
+ id: this.audData.id,
87
+ mTitle: this.audData.mTitle,
88
+ mSources: this.audData.mSources,
89
+ mTranscript: this.audData.mTranscript,
90
+ mPoster: this.audData.mPoster,
91
+ mAlt: this.audData.mAlt ? this.audData.mAlt : ' ',
92
+ isSet: false,
93
+ hasSourceLoadingError: false,
94
+ hasErr: validateAudioData(this.audData)
95
+ }
96
+ },
97
+ computed: {
98
+ ...mapState(useAppStore, ['getCurrentBrowser', 'getCurrentPage']),
99
+ $audElement() {
100
+ if (!this.isSet) return null
101
+ return {
102
+ id: this.id,
103
+ mTranscript: null,
104
+ mType: 'audio',
105
+ mSubtitles: null,
106
+ mElement: this.$refs['m-audio']
107
+ }
108
+ },
109
+ //MediaElement
110
+ mediaElement() {
111
+ if (!this.$audElement) return null
112
+ const { mElement } = this.$audElement
113
+ let thisElement = null
114
+
115
+ if (!mElement) return null
116
+ thisElement = mElement
117
+
118
+ return thisElement
119
+ },
120
+ //Loading display
121
+ isLoading() {
122
+ if (!this.isSet && !this.hasSourceLoadingError) return true
123
+ else return false
124
+ }
125
+ },
126
+ mounted() {},
127
+ beforeUnmount() {},
128
+
129
+ methods: {
130
+ ...mapActions(useAppStore, ['updateCurrentMediaElements']),
131
+ /**
132
+ * @description update the information for the mediaElement in the store
133
+ * @param {htmlElement} e
134
+ * @fires update-page to AppBaseModule.vue
135
+ */
136
+ updateMediaData(e) {
137
+ //dispatch loading status of for this component
138
+ this.$bus.$emit('set-comp-status', 'AppCompMediaPlayer', 'loading')
139
+ this.$bus.$emit('update-media-duration')
140
+
141
+ //Should Check that the the media Element is unique im Media Liste
142
+ const { mElements } = this.getCurrentPage
143
+
144
+ const hasEntry = mElements.findLastIndex(
145
+ (media) => media.id === e.target.id
146
+ )
147
+
148
+ if (hasEntry !== -1) {
149
+ // Should report Error to Console and Component template about this media
150
+ const errmsg = `Cet élément a le même ID q'un autre media. Vous ne devez pas avoir de médias avec le même ID dans une page.`
151
+
152
+ console.warn(
153
+ `%c WARNING!>>> You cannot use the same ID in your media elements for your page.`,
154
+ 'background: orange; color: white; display: block; border-radius:5px; margin:5px;'
155
+ )
156
+
157
+ this.$bus.$emit('set-comp-status', 'AppCompMediaPlayer', 'ready')
158
+ return this.hasErr.push(errmsg)
159
+ }
160
+
161
+ this.updateCurrentMediaElements(e.target).then(() => {
162
+ this.isSet = true
163
+ this.$bus.$emit('set-comp-status', 'AppCompMediaPlayer', 'ready')
164
+ })
165
+ },
166
+ errorHandling(e) {
167
+ this.hasSourceLoadingError = true
168
+ }
169
+ }
170
+ }
171
+ </script>
172
+ <style scoped lang="scss">
173
+ .audio-card {
174
+ // --primary100: #deeff8;
175
+ // --primary700: #005c8d;
176
+ position: relative;
177
+ border-radius: 4px;
178
+ padding: 24px;
179
+ max-width: 600px;
180
+ box-shadow: 0px 3px 6px rgb(26 25 25 / 0.16);
181
+ .audio-img {
182
+ width: 128px;
183
+ margin-right: 24px;
184
+ }
185
+ .audio-content {
186
+ display: flex;
187
+ flex-direction: row;
188
+ align-items: center;
189
+ padding-bottom: 24px;
190
+ .audio-media {
191
+ width: 100%;
192
+ h5 {
193
+ margin-bottom: 16px;
194
+ }
195
+ }
196
+ }
197
+ .audio-transcript {
198
+ padding-top: 24px;
199
+ }
200
+ .audio-transcript-header {
201
+ display: flex;
202
+ justify-content: space-between;
203
+ align-items: center;
204
+ }
205
+
206
+ .audio-transcript-button {
207
+ height: 52px;
208
+ width: 52px;
209
+ display: flex;
210
+ justify-content: center;
211
+ align-items: center;
212
+ svg {
213
+ max-width: 18px;
214
+ height: 10.25px;
215
+ }
216
+ &.rotate svg {
217
+ transition: transform 0.5s;
218
+ transform-origin: center;
219
+ }
220
+ &.rotate.click svg {
221
+ transform: rotate(180deg);
222
+ }
223
+ }
224
+ }
225
+
226
+ .skeleton {
227
+ &.audio {
228
+ height: 100%;
229
+ width: 100%;
230
+ left: 0;
231
+ top: 0;
232
+ }
233
+ }
234
+ </style>