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

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 (163) hide show
  1. package/.editorconfig +6 -31
  2. package/.prettierrc +11 -0
  3. package/.vscode/extensions.json +8 -0
  4. package/.vscode/settings.json +16 -0
  5. package/CHANGELOG +153 -0
  6. package/README.md +28 -43
  7. package/documentation/.vitepress/config.js +114 -0
  8. package/documentation/api-examples.md +49 -0
  9. package/documentation/composants/app-base-button.md +58 -0
  10. package/documentation/composants/app-base-error-display.md +59 -0
  11. package/documentation/composants/app-base-popover.md +68 -0
  12. package/documentation/composants/app-comp-audio.md +75 -0
  13. package/documentation/composants/app-comp-branch-buttons.md +111 -0
  14. package/documentation/composants/app-comp-button-progress.md +53 -0
  15. package/documentation/composants/app-comp-carousel.md +53 -0
  16. package/documentation/composants/app-comp-container.md +53 -0
  17. package/documentation/composants/app-comp-input-checkbox-next.md +42 -0
  18. package/documentation/composants/app-comp-input-dropdown-next.md +34 -0
  19. package/documentation/composants/app-comp-input-radio-next.md +39 -0
  20. package/documentation/composants/app-comp-input-text-next.md +35 -0
  21. package/documentation/composants/app-comp-input-text-table-next.md +34 -0
  22. package/documentation/composants/app-comp-input-text-to-fill-dropdown-next.md +53 -0
  23. package/documentation/composants/app-comp-input-text-to-fill-next.md +31 -0
  24. package/documentation/composants/app-comp-jauge.md +31 -0
  25. package/documentation/composants/app-comp-menu-item.md +55 -0
  26. package/documentation/composants/app-comp-menu.md +29 -0
  27. package/documentation/composants/app-comp-navigation.md +41 -0
  28. package/documentation/composants/app-comp-note-call.md +53 -0
  29. package/documentation/composants/app-comp-note-credit.md +53 -0
  30. package/documentation/composants/app-comp-play-bar-next.md +53 -0
  31. package/documentation/composants/app-comp-pop-up-next.md +93 -0
  32. package/documentation/composants/app-comp-quiz-next.md +235 -0
  33. package/documentation/composants/app-comp-quiz-recall.md +53 -0
  34. package/documentation/composants/app-comp-svg-next.md +53 -0
  35. package/documentation/composants/app-comp-table-of-content.md +50 -0
  36. package/documentation/composants/app-comp-video-player.md +82 -0
  37. package/documentation/composants.md +46 -0
  38. package/documentation/composants_critiques/ModelPageComposant.md +53 -0
  39. package/documentation/composants_critiques/app-base-module.md +43 -0
  40. package/documentation/composants_critiques/app-base-page.md +48 -0
  41. package/documentation/composants_critiques/app-base.md +311 -0
  42. package/documentation/composants_critiques/main.md +15 -0
  43. package/documentation/demarrage.md +50 -0
  44. package/documentation/deploiement.md +58 -0
  45. package/documentation/index.md +33 -0
  46. package/documentation/markdown-examples.md +85 -0
  47. package/documentation/public/npm_version.png +0 -0
  48. package/documentation/public/vite.svg +15 -0
  49. package/documentation/public/vuejs.svg +2 -0
  50. package/documentation/public/vuetify.svg +6 -0
  51. package/eslint.config.js +60 -0
  52. package/package.json +43 -47
  53. package/src/$locales/en.json +86 -108
  54. package/src/$locales/fr.json +66 -127
  55. package/src/assets/data/onboardingMessages.json +1 -1
  56. package/src/components/AppBase.vue +960 -405
  57. package/src/components/AppBaseButton.test.js +21 -0
  58. package/src/components/AppBaseButton.vue +42 -10
  59. package/src/components/AppBaseErrorDisplay.vue +207 -189
  60. package/src/components/AppBaseFlipCard.vue +1 -0
  61. package/src/components/AppBaseModule.vue +769 -977
  62. package/src/components/AppBasePage.vue +635 -81
  63. package/src/components/AppBasePopover.vue +41 -0
  64. package/src/components/AppBaseSkeleton.vue +66 -0
  65. package/src/components/AppCompAudio.vue +256 -0
  66. package/src/components/AppCompBranchButtons.vue +79 -153
  67. package/src/components/AppCompButtonProgress.vue +21 -36
  68. package/src/components/AppCompCarousel.vue +231 -87
  69. package/src/components/{AppCompTranscript.vue → AppCompContainer.vue} +12 -2
  70. package/src/components/AppCompInputCheckBoxNx.vue +323 -0
  71. package/src/components/AppCompInputDropdownNx.vue +299 -0
  72. package/src/components/AppCompInputRadioNx.vue +284 -0
  73. package/src/components/AppCompInputTextNx.vue +153 -0
  74. package/src/components/AppCompInputTextTableNx.vue +202 -0
  75. package/src/components/AppCompInputTextToFillDropdownNx.vue +340 -0
  76. package/src/components/AppCompInputTextToFillNx.vue +313 -0
  77. package/src/components/AppCompJauge.vue +36 -10
  78. package/src/components/AppCompMenu.vue +246 -32
  79. package/src/components/AppCompMenuItem.vue +87 -21
  80. package/src/components/AppCompNavigation.vue +470 -447
  81. package/src/components/AppCompNoteCall.vue +93 -58
  82. package/src/components/AppCompNoteCredit.vue +423 -96
  83. package/src/components/AppCompPlayBarNext.vue +2288 -0
  84. package/src/components/AppCompPopUpNext.vue +504 -0
  85. package/src/components/AppCompQuizNext.vue +510 -0
  86. package/src/components/AppCompQuizRecall.vue +199 -99
  87. package/src/components/AppCompSVGNext.vue +346 -0
  88. package/src/components/AppCompSettingsMenu.vue +17 -16
  89. package/src/components/AppCompTableOfContent.vue +262 -99
  90. package/src/components/AppCompVideoPlayer.vue +183 -142
  91. package/src/components/BaseModule.vue +8 -20
  92. package/src/components/tests__/AppBaseButton.spec.js +53 -0
  93. package/src/components/tests__/useTimer.spec.js +91 -0
  94. package/src/composables/useIdleDetector.js +56 -0
  95. package/src/composables/useQuiz.js +89 -0
  96. package/src/composables/useTimer.js +172 -0
  97. package/src/directives/nvdaFix.js +53 -0
  98. package/src/externalComps/ModuleView.vue +22 -0
  99. package/src/externalComps/SummaryView.vue +91 -0
  100. package/src/main.js +397 -148
  101. package/src/module/stores/appStore.js +947 -0
  102. package/src/module/xapi/ADL.js +241 -60
  103. package/src/module/xapi/Crypto/Hasher.js +8 -8
  104. package/src/module/xapi/Crypto/WordArray.js +6 -6
  105. package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +4 -4
  106. package/src/module/xapi/Crypto/algorithms/C_algo.js +14 -18
  107. package/src/module/xapi/Crypto/algorithms/HMAC.js +1 -1
  108. package/src/module/xapi/Crypto/algorithms/SHA1.js +1 -1
  109. package/src/module/xapi/Crypto/encoders/Base.js +7 -7
  110. package/src/module/xapi/Crypto/encoders/Base64.js +3 -3
  111. package/src/module/xapi/Crypto/encoders/Hex.js +2 -2
  112. package/src/module/xapi/Crypto/encoders/Latin1.js +3 -3
  113. package/src/module/xapi/Crypto/encoders/Utf8.js +3 -3
  114. package/src/module/xapi/Statement/index.js +3 -3
  115. package/src/module/xapi/launch.js +10 -10
  116. package/src/module/xapi/utils.js +17 -17
  117. package/src/module/xapi/wrapper.js +219 -214
  118. package/src/module/xapi/xapiStatement.js +29 -29
  119. package/src/plugins/analytics.js +34 -0
  120. package/src/plugins/bus.js +7 -2
  121. package/src/plugins/gsap.js +5 -7
  122. package/src/plugins/helper.js +97 -34
  123. package/src/plugins/i18n.js +13 -18
  124. package/src/plugins/idb.js +45 -30
  125. package/src/plugins/save.js +1 -1
  126. package/src/plugins/scorm.js +15 -15
  127. package/src/plugins/xapi.js +2 -2
  128. package/src/public/index.html +22 -10
  129. package/src/router/index.js +29 -13
  130. package/src/router/routes.js +29 -54
  131. package/src/shared/generalfuncs.js +186 -30
  132. package/src/shared/validators.js +809 -40
  133. package/vitest.config.js +19 -0
  134. package/.eslintignore +0 -29
  135. package/.eslintrc.js +0 -86
  136. package/.prettierrc.js +0 -5
  137. package/babel.config.js +0 -3
  138. package/src/components/AppBaseDragChoice.vue +0 -91
  139. package/src/components/AppBaseDropZone.vue +0 -112
  140. package/src/components/AppCompBif.vue +0 -120
  141. package/src/components/AppCompDragAndDrop.vue +0 -339
  142. package/src/components/AppCompInputAssociation.vue +0 -332
  143. package/src/components/AppCompInputCheckBox.vue +0 -227
  144. package/src/components/AppCompInputDropdown.vue +0 -184
  145. package/src/components/AppCompInputRadio.vue +0 -169
  146. package/src/components/AppCompInputTextBox.vue +0 -91
  147. package/src/components/AppCompInputTextTable.vue +0 -155
  148. package/src/components/AppCompInputTextToFillDropdown.vue +0 -255
  149. package/src/components/AppCompInputTextToFillText.vue +0 -164
  150. package/src/components/AppCompMediaPlayer.vue +0 -397
  151. package/src/components/AppCompPlayBar.vue +0 -1319
  152. package/src/components/AppCompPopUp.vue +0 -522
  153. package/src/components/AppCompPopover.vue +0 -27
  154. package/src/components/AppCompQuiz.vue +0 -2989
  155. package/src/components/AppCompSVG.vue +0 -309
  156. package/src/mixins/$pageMixins.js +0 -459
  157. package/src/mixins/$quizMixins.js +0 -456
  158. package/src/mixins/timerMixin.js +0 -156
  159. package/src/module/store.js +0 -895
  160. package/src/plugins/timeManager.js +0 -77
  161. package/src/routes_bckp.js +0 -313
  162. package/src/routes_static.js +0 -344
  163. package/vue.config.js +0 -83
@@ -1,106 +1,141 @@
1
1
  <!--
2
- ----------------- MUST DO STYLE!! -----------------------
3
2
  @ Description:
4
3
  @ What it does:
5
4
  -->
6
-
7
5
  <template>
8
6
  <div
9
- :id="`rnt_${stripRefNote}`"
7
+ :id="`rnt_${pageRef}__${stripRefNote}`"
10
8
  :ref="`#rnt_${stripRefNote}`"
9
+ :data-ref="`nt_${pageRef}__${stripRefNote}`"
11
10
  class="callEndNote"
12
- :dataRef="`nt_${stripRefNote}`"
13
11
  >
14
- <b-link
12
+ <button
15
13
  v-if="!error"
16
14
  class="nrlm"
17
15
  tabindex="0"
18
16
  :title="$t('text.title_link_call')"
17
+ :aria-label="`${$t('label.note_reference')} ${stripRefNote}`"
19
18
  @click="openNote()"
20
19
  >
21
20
  <sup>{{ stripRefNote }}</sup>
22
- </b-link>
21
+ </button>
23
22
 
24
- <div v-else>
25
- <sup>error</sup>
23
+ <div v-else class="nrlm error-Nc" tabindex="0">
24
+ <sup>{{ $t('text.error') }}</sup>
26
25
  </div>
27
26
  </div>
28
27
  </template>
29
28
  <script>
29
+ import { mapState } from 'pinia'
30
+ import { useAppStore } from '../module/stores/appStore'
30
31
  export default {
31
32
  props: {
32
33
  refNote: {
33
34
  type: String,
34
35
  default: ' '
36
+ },
37
+ pageRef: {
38
+ type: String,
39
+ default: ' '
35
40
  }
36
41
  },
37
42
  data() {
38
43
  return {
39
- route: this.$route.meta.activity_ref,
40
- notes: null,
41
- jsons: null
44
+ notes: null
42
45
  }
43
46
  },
44
47
  computed: {
48
+ ...mapState(useAppStore, ['getNotes', 'getWidgetOpen']),
45
49
  // Return the number for the note
46
50
  stripRefNote() {
47
- let ref = this.refNote
48
51
  let newRef
52
+
53
+ let ref = this.refNote
49
54
  let toStrip = ref.indexOf('_')
50
55
  newRef = this.refNote.substr(toStrip + 1)
51
-
52
56
  return newRef
53
57
  },
54
- error() {
55
- ///// -------------------------- MUST REDO INFORMATION NOT FROM JSON ANYMORE
56
- let er = false
57
- // let info = this.jsons
58
+ linkedNote() {
59
+ const _notes = this.getNotes(
60
+ this.$route.meta.activity_ref,
61
+ this.$route.meta.id
62
+ )
63
+ if (!_notes) return null
64
+ let thisPageNotes = null
58
65
 
59
- // if (info) {
60
- // if (Object.keys(info.note).length === 0) {
61
- // er = true
62
- // console.warn(
63
- // '%c WARNING!>>> AppCompNoteCall: Your note file is empty, note cannot be call',
64
- // 'background: orange; color: white; display: block; margin:5px;'
65
- // )
66
- // } else if (
67
- // info.note.value[this.stripRefNote - 1] === ' ' ||
68
- // info.note.value[this.stripRefNote - 1] === undefined
69
- // ) {
70
- // er = true
71
- // console.warn(
72
- // '%c WARNING!>>> AppCompNoteCall: The note you try to call doesnt existe.',
73
- // 'background: orange; color: white; display: block; margin:5px;'
74
- // )
75
- // } else {
76
- // //check if value are the same :
77
- // ///https://stackoverflow.com/questions/7376598/in-javascript-how-do-i-check-if-an-array-has-duplicate-values
78
- // const items = [...document.getElementsByClassName('callEndNote')]
79
-
80
- // let cltn = []
81
- // items.forEach((element) => {
82
- // cltn.push(element.getAttribute('dataref'))
83
- // })
84
- // const l = cltn.some((e, i) => cltn.indexOf(e) < i)
85
- // if (l) {
86
- // er = true
87
- // console.warn(
88
- // '%c WARNING!>>> AppCompNoteCall: You call this note twice',
89
- // 'background: orange; color: white; display: block; margin:5px;'
90
- // )
91
- // }
92
- // }
93
- // }
66
+ for (let p of _notes) {
67
+ //find the related page and get its notes
68
+ if (Object.keys(p)[0] !== this.pageRef) continue
69
+ thisPageNotes = p[this.pageRef]
70
+ }
71
+ //return weither the note exist or note
72
+ return thisPageNotes && thisPageNotes.find((n) => n.id == this.refNote)
73
+ },
94
74
 
95
- return er
75
+ error() {
76
+ let err = false
77
+ if (!this.linkedNote) {
78
+ err = true
79
+ console.warn(
80
+ `%c WARNING!>>> AppCompNoteCall: cette note n'existe pas nt_${this.pageRef}__${this.stripRefNote}.`,
81
+ 'background: orange; color: white; display: block; margin:5px;'
82
+ )
83
+ }
84
+ return err
96
85
  }
97
86
  },
98
- mounted() {},
87
+ beforeUnmount() {
88
+ this.$bus.$off('close-widget', this.onCloseWidget)
89
+ this.$bus.$off('credit-note', this.onCreditNote)
90
+ },
91
+ mounted() {
92
+ this.$bus.$on('close-widget', this.onCloseWidget)
93
+ this.$bus.$on('credit-note', this.onCreditNote)
94
+ },
99
95
  methods: {
96
+ onCreditNote(data) {
97
+ this.notes = data.note
98
+ },
99
+ onCloseWidget() {
100
+ let el = document.getElementsByClassName('callEndNote')
101
+
102
+ for (let element of el) {
103
+ element.setAttribute('datacurrentnote', false)
104
+ }
105
+ },
100
106
  //open the widget and give information to highlight
101
107
  openNote() {
102
- this.$bus.$emit('note-to-show', this.$el)
108
+ if (!this.getWidgetOpen) {
109
+ this.$bus.$emit('open-notes')
110
+
111
+ setTimeout(() => {
112
+ this.$bus.$emit('note-to-show', this.$el)
113
+
114
+ let e = document.getElementsByClassName('callEndNote')
115
+ let t = this.$el.getAttribute('id')
116
+
117
+ for (let element of e) {
118
+ element.setAttribute('dataCurrentnote', false)
119
+ if (element.id === t) {
120
+ element.setAttribute('dataCurrentnote', true)
121
+ }
122
+ }
123
+ }, 200)
124
+ } else {
125
+ this.$bus.$emit('close-widget')
126
+ this.$bus.$emit('note-to-show', this.$el)
127
+ let e = document.getElementsByClassName('callEndNote')
128
+ let t = this.$el.getAttribute('id')
129
+
130
+ for (let element of e) {
131
+ element.setAttribute('dataCurrentnote', false)
132
+ if (element.id === t) {
133
+ element.setAttribute('dataCurrentnote', true)
134
+ }
135
+ }
136
+ }
103
137
  },
138
+
104
139
  lookForElement(elId) {
105
140
  let clcn = document.getElementsByClassName('endNoteLink')
106
141
 
@@ -118,9 +153,9 @@ export default {
118
153
  display: inline-block;
119
154
  margin-left: -4px;
120
155
 
121
- &.b {
122
- margin-left: 0 !important ;
123
- margin-right: -4px !important ;
156
+ .error-Nc {
157
+ color: red;
158
+ font-weight: bold;
124
159
  }
125
160
  }
126
161
  </style>