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
@@ -1,522 +0,0 @@
1
- <template>
2
- <div>
3
- <div v-show="errors.length <= 0" class="p_popup">
4
- <!----------------------- POPUP CUSTOM ---------------------------->
5
- <b-modal
6
- v-show="isPopupCustom === true"
7
- id="popup-custom"
8
- ref="popup-custom"
9
- :content-class="[pType, pName]"
10
- :no-fade="animationOff"
11
- :header-close-label="$t('button.alert_close')"
12
- v-bind="pContent.$bvArgs"
13
- @cancel="$cancel(pContent.cb_$cancel)"
14
- @ok="$confirm(pContent.cb_$confirm)"
15
- @hidden="$close(pContent.cb_$close)"
16
- >
17
- <template v-slot:default>
18
- <div class="box-content-popUp" v-html="pContent.hypertext" />
19
- </template>
20
- </b-modal>
21
- <!----------------------- OTHER POPUP ---------------------------->
22
-
23
- +
24
- <b-modal
25
- v-show="isPopupCustom === false"
26
- :id="getAppState"
27
- ref="someModal"
28
- :header-close-label="$t('button.alert_close')"
29
- :hide-footer="true"
30
- :content-class="[pType, pName, typeRetro, getAppState]"
31
- :no-fade="animationOff"
32
- @hidden="$close(pContent.cb_$close)"
33
- >
34
- <!------------------- Custom DIV: Use to add any custom Css (visual) to your Popup ------------------------->
35
- <!-- <div v-show="pType == 'popup-retro'" class="pop-deco"></div> -->
36
- <!----------------------------- END Custom DIV ------------------------------------->
37
- <div class="popUp-title">
38
- <h4 v-html="pTitle"></h4>
39
- </div>
40
-
41
- <div v-if="contentLength > 0" class="box-content-popUp">
42
- <div
43
- v-for="(content, _key, index) of pContent"
44
- :id="`col-ref-${_key}`"
45
- :key="`ref_${_key}_${content}`"
46
- class="col-popUp"
47
- >
48
- <!-------- Create TEXT element -------------->
49
- <p
50
- v-if="_key.includes('text') && !_key.includes('hyper')"
51
- :id="`${_key}_${index}`"
52
- :key="_key"
53
- >
54
- {{ content }}
55
- </p>
56
-
57
- <!-------- Create HTMLelement -------------->
58
- <div
59
- v-else-if="_key.includes('hypertext')"
60
- :id="`${_key}_${index}`"
61
- :key="_key"
62
- v-html="content"
63
- />
64
-
65
- <!-------- Create IMAGE element ------------->
66
- <img
67
- v-else-if="_key.includes('image')"
68
- :id="`${_key}_${index}`"
69
- :key="_key"
70
- :src="require(`@/assets/${content.path}`)"
71
- :alt="content.label || 'image'"
72
- />
73
-
74
- <!-------- Create LINK element -------------->
75
- <a
76
- v-else-if="_key.includes('link')"
77
- :id="`${_key}_${index}`"
78
- :key="_key"
79
- :href="content.ref"
80
- target="_blank"
81
- :title="`${content.label}`"
82
- >
83
- {{ content.label }}
84
- </a>
85
-
86
- <!-------- Create VIDEO element ------------->
87
- <video
88
- v-else-if="_key.includes('video')"
89
- :id="`${_key}_${index}`"
90
- :key="_key"
91
- :src="require(`@/assets/${content}`)"
92
- controls
93
- disablepictureinpicture
94
- controlslist="nofullscreen nodownload"
95
- />
96
-
97
- <!--------Create AUDIO element--------------->
98
- <audio
99
- v-else-if="_key.includes('audio')"
100
- :id="`${_key}_${index}`"
101
- :key="_key"
102
- :src="require(`@/assets/${content}`)"
103
- controls
104
- controlslist="nodownload"
105
- />
106
- </div>
107
- </div>
108
- <!--------Default Button of Pop up --------------->
109
- <div v-show="pType === 'popup-avert'" class="col-bouton">
110
- <app-base-button
111
- id="btn-cancel-popup"
112
- :name-acces="'Annuler'"
113
- class="btn-cancel"
114
- :title="$t('button.cancel_pop')"
115
- @click="$cancel(pContent.cb_$cancel)"
116
- >
117
- {{ $t('button.cancel_pop') }}
118
- </app-base-button>
119
- <app-base-button
120
- id="btn-confirm-popup"
121
- :name-acces="'Confirmer'"
122
- class="btn-confirm"
123
- :title="$t('button.confirm_pop')"
124
- @click="$confirm(pContent.cb_$confirm)"
125
- >
126
- {{ $t('button.confirm_pop') }}
127
- </app-base-button>
128
- </div>
129
- <div v-if="pType === 'popup-info'" id="popup-bottom-buttons">
130
- {{ pType }}
131
- <button
132
- id="popup-retro-close-btn"
133
- :title="$t('button.alert_close')"
134
- @click="$close(pContent.cb_$close)"
135
- >
136
- {{ $t('button.alert_close') }}
137
- </button>
138
- <portal-target
139
- id="end-activity"
140
- name="wrap-end-activity"
141
- ></portal-target>
142
- </div>
143
- <!----------------------------------------------------------------->
144
- <div v-if="pType === 'popup-endActivity'">
145
- <portal-target
146
- id="end-activity"
147
- name="wrap-end-activity"
148
- ></portal-target>
149
- </div>
150
- </b-modal>
151
- </div>
152
- <div v-show="errors.length > 0" class="pop-error">
153
- <app-base-error-display :errors-list="errors" :doc-link="docLink" />
154
- </div>
155
- </div>
156
- </template>
157
-
158
- <script>
159
- //import { mapGetters } from 'vuex'
160
- export default {
161
- name: 'AppCompPopUp',
162
- data() {
163
- return {
164
- pType: 'popup-info',
165
- pName: 'noName',
166
- typeRetro: 'none',
167
- pContent: {},
168
- pContenttype: 'pg_normal',
169
- pTitle: '',
170
- errors: [],
171
- docLink:
172
- 'https://fcaddocumentation.netlify.app/guide/ressources.html#creer-un-popup-custom',
173
- animationOff: false
174
- }
175
- },
176
- computed: {
177
- contentLength() {
178
- let size = null
179
- if (this.pType && this.pType !== 'popup-custom') {
180
- if (this.pContent && Object.keys(this.pContent).length > 0)
181
- size = Object.keys(this.pContent).length
182
- }
183
- return size
184
- },
185
- isPopupCustom() {
186
- if (this.pType && this.pType === 'popup-custom') return true
187
- return false
188
- },
189
- popup() {
190
- /**
191
- * Get the istance of the bvModal that is open and return it as our active popup
192
- */
193
- let id
194
- if (this.isPopupCustom) id = 'popup-custom'
195
- else id = `${this.getAppState}`
196
- const p = this.$bvModal._vm.$children.find((p) => p.id === id)
197
- return p
198
- },
199
- getAppState() {
200
- let toto
201
- if (!this.$store.state.$appStore.isDr) {
202
- toto = 'not-popup-custom full '
203
- } else {
204
- toto = 'not-popup-custom lites '
205
- }
206
- return toto
207
- }
208
- },
209
- mounted() {
210
- this.$bus.$on('popup-open', (e) => {
211
- if (e) {
212
- this.validateContent(e)
213
- }
214
- })
215
- this.$bus.$on('popup-close', (options, cb) => {
216
- this.$close(options, cb)
217
- })
218
-
219
- this.$bus.$on('retro-type', (b) => {
220
- this.retroType(b)
221
- })
222
- },
223
- methods: {
224
- /**
225
- * @description - Validate the data for the component
226
- * @param {Object} data
227
- */
228
- validateContent(data) {
229
- const typeList = [
230
- 'popup-info',
231
- 'popup-retro',
232
- 'popup-avert',
233
- 'popup-custom',
234
- 'popup-noanswer',
235
- 'popup-endActivity'
236
- ]
237
- const callbacksFunctionList = [
238
- 'cb_$confirm',
239
- 'cb_$cancel',
240
- 'cb_$open',
241
- 'cb_$close'
242
- ]
243
-
244
- if (this.errors.length > 0) this.errors = []
245
-
246
- if (data.type) {
247
- // validate the type value of popup
248
- const validType = typeList.includes(data.type)
249
-
250
- if (!validType) this.errors.push('Invalid value for type')
251
- } else this.errors.push('Missing argument: type')
252
-
253
- // validate value of the popup according to popup type
254
- // Content must be String|Object
255
- if (data.value) {
256
- let validObject = false
257
- if (
258
- data.value.constructor === Object &&
259
- Object.keys(data.value).length > 0
260
- )
261
- validObject = true
262
- if (validObject) {
263
- let KeywordsList
264
- switch (data.type) {
265
- case 'popup-custom':
266
- KeywordsList = ['hypertext', '$bvArgs'] // accepted keyword in value declartion for pop-up custom
267
-
268
- for (const key of Object.keys(data.value)) {
269
- // search if key match lists
270
- if (![...KeywordsList, ...callbacksFunctionList].includes(key))
271
- this.errors.push('Invalid key declaration in value')
272
-
273
- // Validating content of hypertext key
274
- if (
275
- key.includes('hypertext') &&
276
- data.value[key].constructor != String
277
- ) {
278
- this.errors.push(
279
- 'Invalid assignment for hypertext. Must be a String'
280
- )
281
- }
282
-
283
- // validating content of cb_$ keys
284
- if (
285
- key.includes('cb_$') &&
286
- data.value[key].constructor != Function
287
- ) {
288
- this.errors.push(
289
- `Invalid assignment for ${key}. Must be a Function`
290
- )
291
- }
292
-
293
- // validating content of $bvArgs keys. Must be an array.
294
- // validating content of $bvArgs. Content in $bvArgs must be objects
295
- if (
296
- (key.includes('$bvArgs') &&
297
- data.value[key].constructor != Array) ||
298
- (data.value[key].constructor === Array &&
299
- data.value[key].length < 1)
300
- ) {
301
- this.errors.push(
302
- `Invalid assignment for ${key}. Must be an Array of Objects`
303
- )
304
- } else if (
305
- key.includes('$bvArgs') &&
306
- data.value[key].constructor === Array &&
307
- data.value[key].length > 0
308
- ) {
309
- let count = 0
310
- data.value[key].forEach((element) => {
311
- if (element.constructor !== Object && count < 1) {
312
- this.errors.push(
313
- `Invalid value(s) found in ${key}. Must be an Array of Objects`
314
- )
315
- count++
316
- }
317
- })
318
- }
319
- }
320
- break
321
-
322
- default:
323
- KeywordsList = [
324
- 'title',
325
- 'text_',
326
- 'image_',
327
- 'video_',
328
- 'audio_',
329
- 'link_',
330
- 'hypertext_',
331
- 'object'
332
- ] // accepted keyword in value declaration for pop-up custom
333
-
334
- for (let key of Object.keys(data.value)) {
335
- const savedKey = key // backup key
336
-
337
- if (key.includes('_') && !key.includes('cb_$'))
338
- key = `${key.split('_')[0]}_`
339
-
340
- // search if key match lists
341
- if (![...KeywordsList, ...callbacksFunctionList].includes(key))
342
- this.errors.push(`Invalid key declaration in value: ${key}`)
343
-
344
- // Validating content of link element
345
- if (key.includes('link') && !data.value[savedKey].ref) {
346
- this.errors.push('Missing ref for link')
347
- }
348
-
349
- // validating content of image element
350
- if (key.includes('image') && !data.value[savedKey].path)
351
- this.errors.push('Missing path for image')
352
-
353
- // validating content of cb_$ keys
354
- if (
355
- key.includes('cb_$') &&
356
- data.value[key].constructor != Function
357
- )
358
- this.errors.push(
359
- `Invalid assignment for ${key}. Must be a Function`
360
- )
361
- }
362
- }
363
- } else this.errors.push('Invalid object declaration for value')
364
- } else this.errors.push('Missing argument - value')
365
-
366
- if (process.env.NODE_ENV === 'development') {
367
- for (const err of this.errors)
368
- console.warn(
369
- `%c WARNING!>>> POP-UP: ${err} `,
370
- 'background: orange; color: white; display: block; border-radius:5px; margin:5px;'
371
- )
372
- }
373
-
374
- // No error detected proceed
375
- if (!this.errors.length) {
376
- if (data.type === 'popup-endActivity') {
377
- const { title, ...filtered } = data.value
378
- this.pContent = filtered
379
- this.pTitle = title
380
- } else if (data.type === 'popup-custom') {
381
- this.pContent = data.value
382
- } else {
383
- const { title, ...filtered } = data.value
384
- this.pContent = filtered
385
- this.pTitle = title
386
- }
387
- this.pType = data.type
388
- this.pName = data.name
389
- const cb_open = data.value.cb_$open || null
390
- this.$open(cb_open)
391
- }
392
- },
393
-
394
- /**
395
- * @param {String} type
396
- */
397
- retroType(type) {
398
- this.typeRetro = type
399
- return this.typeRetro
400
- },
401
- /**
402
- * @description - method to open the popup
403
- * @param {Function} cb
404
- */
405
- $open(cb) {
406
- if (this.animationOff === true) this.animationOff = false
407
- this.popup.show()
408
- if (cb && typeof cb === 'function') cb()
409
- },
410
- /**
411
- * @description - method to close the popup
412
- * @param {Function} cb
413
- */
414
- $close(options, cb) {
415
- //this.animationOff =true
416
- if (options && options.animationOff) {
417
- this.animationOff = options.animationOff
418
- }
419
- this.popup.hide()
420
- //reset popup class name
421
- this.typeRetro = 'none'
422
- if (cb && typeof cb === 'function') cb()
423
- },
424
- /**
425
- * @description - method for action confirm
426
- * @param {Function} cb
427
- */
428
- $confirm(cb) {
429
- cb = cb || null
430
- this.popup.hide()
431
- if (cb && typeof cb === 'function') cb()
432
- },
433
- /**
434
- * @description - method for action cancel
435
- * @param {Function} cb
436
- */
437
- $cancel(cb) {
438
- cb = cb || null
439
- this.popup.hide()
440
- if (cb && typeof cb === 'function') cb()
441
- }
442
- }
443
- }
444
- </script>
445
- <style lang="scss">
446
- .modal {
447
- .modal-dialog {
448
- max-width: 100% !important;
449
- height: 100%;
450
- margin: 0 0 !important;
451
-
452
- // DR pop-up
453
- .lites {
454
- width: 450px;
455
- margin: 10% auto;
456
-
457
- .modal-header {
458
- border-bottom: 0 solid transparent;
459
- }
460
-
461
- #popup-bottom-buttons {
462
- display: none;
463
- }
464
- }
465
-
466
- // full minou pop-up
467
- .full {
468
- &.popup-retro {
469
- width: 50%;
470
- height: 100%;
471
- position: relative;
472
- border-radius: 0;
473
- border-width: 0;
474
-
475
- .modal-header {
476
- position: absolute;
477
- top: 0;
478
- right: 0;
479
- z-index: 2;
480
- border-bottom: 0 solid transparent;
481
- }
482
-
483
- .modal-body {
484
- #popup-bottom-buttons {
485
- position: absolute;
486
- bottom: 0;
487
- margin-bottom: 65px;
488
-
489
- #popup-retro-close-btn {
490
- display: inline-block;
491
- vertical-align: top;
492
- }
493
-
494
- #popup_retro_nav_wrapper {
495
- display: inline-block;
496
- vertical-align: top;
497
- }
498
- }
499
- }
500
- }
501
-
502
- &.popup-info,
503
- &.popup-noanswer {
504
- width: 660px;
505
- margin: 10% auto;
506
- .modal-header {
507
- border-bottom: 0 solid transparent;
508
- }
509
-
510
- #popup_retro_nav_wrapper {
511
- display: inline-block;
512
- order: 1;
513
- }
514
-
515
- #popup-retro-close-btn {
516
- order: 2;
517
- }
518
- }
519
- }
520
- }
521
- }
522
- </style>
@@ -1,27 +0,0 @@
1
- <!--
2
- @ Description: This component is used to create a popover that is accessible via keyboard navigation (tab + space/enter)
3
- -->
4
- <template>
5
- <b-popover v-bind="$attrs" triggers="hover click" @shown="onShown">
6
- <slot>Popover</slot>
7
- </b-popover>
8
- </template>
9
-
10
- <script>
11
- export default {
12
- name: 'AppCompPopover',
13
- data() {
14
- return {}
15
- },
16
- methods: {
17
- /* focus on the popover when it is shown, pressing tab returns the focus on the popover button*/
18
- onShown(event) {
19
- const button = event.target
20
- event.relatedTarget.onblur = () => {
21
- button.click()
22
- }
23
- event.relatedTarget.focus()
24
- }
25
- }
26
- }
27
- </script>