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,188 +1,210 @@
1
- const allfile = require.context('@/', true, /\.vue$/) //get all .vue file at the root of the project where lib will be installed
2
-
3
- const fileAssets = {
4
- // return the collection of all the files in the project directory
5
- allFiles: () => allfile.keys(),
6
-
7
- // Return all the file in './views' with the Name Module
8
- getViews: () => {
9
- return fileAssets.allFiles().filter((file) => file.startsWith('./views'))
10
- },
11
- // return all files that are in the folder './src/module' of the project with name respecting following condition:
12
- // must start with a capital P followed by a digit (P0, P1, P2...) and not contain keyword "copy"
13
- getActivities: () => {
14
- return fileAssets.allFiles().filter((file) => {
15
- if (
16
- file.startsWith('./module/A') &&
17
- /^P[0-9]{2,3}/.test(file.split('/')[3]) &&
18
- !file.split('/')[3].includes('copy')
19
- )
20
- return true
21
- else return false
22
- })
23
- },
24
-
25
- // search a specific file and return its content
26
- fetchFileContent: (file) => allfile(file),
27
-
28
- /**
29
- * @description Validator for the content of menu setting file
30
- * @param {String} fName- name of the file for use case
31
- * @param {Object} fData: file's data to validate
32
- * @param {Object} [requiredArgs] list of arguments to include consider in validation ()
33
- */
34
- validatefileContent: (fName, fData, requiredArgs = {}) => {
35
- let err = null
36
- if (process.env.NODE_ENV === 'development') {
37
- switch (fName) {
38
- case 'menuSettings': {
39
- const { keys4Activity, keys4Anchors } = requiredArgs
40
-
41
- //*validate that data is an {Object}. if Not send error message
42
- if (fData.constructor !== Object)
43
- err = '💥Invalid file provided for menu settings'
44
-
45
- if (Object.entries(fData).length > 0) {
46
- const content = Object.entries(fData)
47
-
48
- for (let el of content) {
49
- // validate that the content of each entry is an object
50
- if (el[1].constructor !== Object || !Object.keys(el[1]).length) {
51
- err = `💥 invalid data provided for key 👉 ${el[0]} 👈 in menu.setting.js \n 🚩Must be of type {Object}`
52
- break
53
- }
54
- }
55
- // Validate that each entry has the required key
56
- if (!err) {
57
- for (let el of content) {
58
- const entry = el[1]
59
- for (let k of keys4Activity) {
60
- if (!entry[k]) {
61
- err = `💥 Missing 👉 ${k} 👈 in ${el[0]} in ➡ menu.setting.js \n 🚩Allowed indexes are: 👉 ${keys4Activity}`
62
- break
63
- } else {
64
- //validate that each entry as correct value type
65
- switch (k) {
66
- case 'anchors':
67
- if (entry[k].constructor !== Array)
68
- err = `💥 Invalid anchors declaration for 👉 ${el[0]} 👈 in ➡ menu.setting.j \n 🚩Must be of type {Array}`
69
- else {
70
- const anchors = entry.anchors
71
-
72
- for (let a of anchors) {
73
- //trow error if numbers of keys are not the same as required
74
- const a_numb = anchors.indexOf(a) + 1
75
- if (Object.keys(a).length !== keys4Anchors.length) {
76
- err = `💥 Invalid declaration in 👉anchor ${a_numb}👈 for ➡ ${el[0]} in ➡ menu.setting.js \n 🚩 Allowed indexes are: 👉 ${keys4Anchors}`
77
- break
78
- }
79
- // Validated that required keys condition and type is met
80
- for (let k of keys4Anchors) {
81
- if (!a[k]) {
82
- err = `💥 Missing 👉 ${k} 👈 for anchor ${a_numb} ➡ ${el[0]} ➡ menu.setting.js \n 🚩 Allowed indexes are: 👉 ${keys4Anchors}`
83
- } else if (a[k].constructor !== String) {
84
- err = `💥 Invalid 👉 ${k} 👈 declaration for anchor ${a_numb} ➡ ${el[0]} ➡ menu.setting.js \n 🚩 Must be of type {String}`
85
- }
86
- if (err) break
87
- }
88
- if (err) break
89
- }
90
- }
91
-
92
- break
93
- default:
94
- if (entry[k].constructor !== String)
95
- err = `Invalid 👉 ${k} 👈 declaration for ➡ ${el[0]} in ➡ menu.setting.js \n 🚩 Must be of type {String}`
96
- break
97
- }
98
- }
99
- }
100
-
101
- if (err) break
102
- }
103
- }
104
- }
105
- break
106
- }
107
- }
108
- }
109
- return err
110
- },
111
-
112
- /**
113
- * @description Validator for the content of menu setting file
114
- * @param {String} a- array of file for use case
115
- * @param {Object} [requiredArgs] list of arguments to include consider in validation ()
116
- */
117
- buildMapTree: (a) => {
118
- // Load files in module folder
119
- if (a.length < 0) return
120
-
121
- const mapTree = new Map()
122
- // There is a file in the module folder
123
-
124
- a.forEach((key) => {
125
- const fileRef = key.replace(/(\.\/)/g, '')
126
- const splitted = fileRef.split('/')
127
- const activityName = splitted[1]
128
- const fileName = splitted[splitted.length - 1].replace(/(\.vue)/g, '')
129
- const fileContent = fileAssets.fetchFileContent(`./${fileRef}`).default
130
-
131
- if (!Object.keys(fileContent).includes('data')) return
132
- // Handling single page type
133
- // adding the page in a map for the Pages
134
-
135
- // Add the key in the map for the routes if it is not in the map, with its data as new Map;
136
- if (!mapTree.get(activityName)) {
137
- mapTree.set(activityName, new Map())
138
- }
139
-
140
- if (fileName.length === 3) {
141
- mapTree.get(activityName).set(fileName, {
142
- ref: fileRef,
143
- content: fileContent.data()
144
- }) // add entry for the page
145
- }
146
- // Handleling Groupe page type
147
- else if (fileName.length > 3 && fileName.includes('_')) {
148
- const keyToFind = fileName.split('_', 1)[0] // Pxx
149
- const KeyToAdd = fileName.split('_')[1] // Exx
150
-
151
- // // search for the page key in the map
152
- if (!mapTree.get(activityName).has(keyToFind)) return
153
-
154
- // save a reference for the value of the key
155
- const tempSave = mapTree.get(activityName).get(keyToFind)
156
-
157
- // transform value of found key to a new map
158
- if (!mapTree.get(activityName).get(keyToFind).size) {
159
- mapTree.get(activityName).set(keyToFind, new Map())
160
- // Update reference of key's
161
- mapTree
162
- .get(activityName)
163
- .get(keyToFind)
164
- .set(keyToFind, tempSave)
165
- }
166
-
167
- // Add page EXX in Map if it is not already added
168
- if (
169
- !mapTree
170
- .get(activityName)
171
- .get(keyToFind)
172
- .get(KeyToAdd)
173
- )
174
- mapTree
175
- .get(activityName)
176
- .get(keyToFind)
177
- .set(fileName, {
178
- ref: fileRef,
179
- content: fileContent.data()
180
- })
181
- }
182
- })
183
-
184
- return mapTree
185
- }
186
- }
187
-
188
- export { fileAssets }
1
+ // const allfile = require.context('@/', true, /\.vue$/) //get all .vue file at the root of the project where lib will be installed
2
+ const allfile = import.meta.glob(['@/**/*.vue', '!@/**/_*'], {
3
+ eager: true
4
+ }) //get all .vue file at the root of the project where lib will be installed
5
+
6
+ const allfileKeys = Object.keys(allfile)
7
+
8
+ //console.log('ALL PATHS', fileArray)
9
+ allfileKeys.forEach(function (key, index, array) {
10
+ array[index] = {
11
+ name: key.replace('/src', '.').replace('.vue', ''),
12
+ fullPath: allfile[key].default.__file,
13
+ content: allfile[key].default
14
+ }
15
+ })
16
+
17
+ const fileAssets = {
18
+ // return the collection of all the files in the project directory
19
+ allFiles: () => allfileKeys,
20
+
21
+ // Return all the file in './views' with the Name Module
22
+ getViews: () => {
23
+ return fileAssets
24
+ .allFiles()
25
+ .filter(
26
+ (file) =>
27
+ file.name.startsWith('./views') &&
28
+ !file.name.split('/')[2].includes('copy')
29
+ )
30
+ },
31
+ // return all files that are in the folder './src/module' of the project with name respecting following condition:
32
+ // must start with a capital P followed by a digit (P0, P1, P2...) and not contain keyword "copy"
33
+ getActivities: () => {
34
+ return fileAssets.allFiles().filter((file) => {
35
+ if (
36
+ file.name.startsWith('./module/A') &&
37
+ /^P[0-9]{2,3}/.test(file.name.split('/')[3]) &&
38
+ !file.name.split('/')[3].includes('copy')
39
+ )
40
+ return true
41
+ else return false
42
+ })
43
+ },
44
+
45
+ // search a specific file and return its content
46
+ fetchFileContent: (file) => allfile[file].default,
47
+
48
+ /**
49
+ * @description Validator for the content of menu setting file
50
+ * @param {String} fName- name of the file for use case
51
+ * @param {Object} fData: file's data to validate
52
+ * @param {Object} [requiredArgs] list of arguments to include consider in validation ()
53
+ */
54
+ validatefileContent: (fName, fData, requiredArgs = {}) => {
55
+ let err = null
56
+ if (import.meta.env.DEV) {
57
+ switch (fName) {
58
+ case 'menuSettings': {
59
+ const { keys4Activity, keys4Anchors } = requiredArgs
60
+
61
+ //*validate that data is an {Object}. if Not send error message
62
+ if (fData.constructor !== Object)
63
+ err = '💥Invalid file provided for menu settings'
64
+
65
+ if (Object.entries(fData).length > 0) {
66
+ const content = Object.entries(fData)
67
+
68
+ for (let el of content) {
69
+ // validate that the content of each entry is an object
70
+ if (el[1].constructor !== Object || !Object.keys(el[1]).length) {
71
+ err = `💥 invalid data provided for key 👉 ${el[0]} 👈 in ➡ menu.setting.js \n 🚩Must be of type {Object}`
72
+ break
73
+ }
74
+ }
75
+ // Validate that each entry has the required key
76
+ if (!err) {
77
+ for (let el of content) {
78
+ const entry = el[1]
79
+ for (let k of keys4Activity) {
80
+ if (!entry[k]) {
81
+ err = `💥 Missing 👉 ${k} 👈 in ${el[0]} in ➡ menu.setting.js \n 🚩Allowed indexes are: 👉 ${keys4Activity}`
82
+ break
83
+ } else {
84
+ //validate that each entry as correct value type
85
+ switch (k) {
86
+ case 'anchors':
87
+ if (entry[k].constructor !== Array)
88
+ err = `💥 Invalid anchors declaration for 👉 ${el[0]} 👈 in ➡ menu.setting.j \n 🚩Must be of type {Array}`
89
+ else {
90
+ const anchors = entry.anchors
91
+
92
+ for (let a of anchors) {
93
+ //trow error if numbers of keys are not the same as required
94
+ const a_numb = anchors.indexOf(a) + 1
95
+ if (Object.keys(a).length !== keys4Anchors.length) {
96
+ err = `💥 Invalid declaration in 👉anchor ${a_numb}👈 for ➡ ${el[0]} in ➡ menu.setting.js \n 🚩 Allowed indexes are: 👉 ${keys4Anchors}`
97
+ break
98
+ }
99
+ // Validated that required keys condition and type is met
100
+ for (let k of keys4Anchors) {
101
+ if (!a[k]) {
102
+ err = `💥 Missing 👉 ${k} 👈 for anchor ${a_numb} ➡ ${el[0]} ➡ menu.setting.js \n 🚩 Allowed indexes are: 👉 ${keys4Anchors}`
103
+ } else if (a[k].constructor !== String) {
104
+ err = `💥 Invalid 👉 ${k} 👈 declaration for anchor ${a_numb} ➡ ${el[0]} ➡ menu.setting.js \n 🚩 Must be of type {String}`
105
+ }
106
+ if (err) break
107
+ }
108
+ if (err) break
109
+ }
110
+ }
111
+
112
+ break
113
+ default:
114
+ if (entry[k].constructor !== String)
115
+ err = `Invalid 👉 ${k} 👈 declaration for ➡ ${el[0]} in menu.setting.js \n 🚩 Must be of type {String}`
116
+ break
117
+ }
118
+ }
119
+ }
120
+
121
+ if (err) break
122
+ }
123
+ }
124
+ }
125
+ break
126
+ }
127
+ }
128
+ }
129
+ return err
130
+ },
131
+
132
+ /**
133
+ * @description Validator for the content of menu setting file
134
+ * @param {String} a- array of file for use case
135
+ * @param {Object} [requiredArgs] list of arguments to include consider in validation ()
136
+ */
137
+ buildMapTree: (a) => {
138
+ // Load files in module folder
139
+
140
+ if (a.length < 0) return
141
+
142
+ const mapTree = new Map()
143
+ // There is a file in the module folder
144
+
145
+ a.forEach((e) => {
146
+ const fileRef = e.name.replace(/(\.\/)/g, '')
147
+ const splitted = fileRef.split('/')
148
+ const activityName = splitted[1]
149
+ const fileName = splitted[splitted.length - 1].replace(/(\.vue)/g, '')
150
+ const fileContent = e.content
151
+ if (!Object.keys(fileContent).includes('data')) return
152
+ // Handling single page type
153
+ // adding the page in a map for the Pages
154
+
155
+ // Add the key in the map for the routes if it is not in the map, with its data as new Map;
156
+ if (!mapTree.get(activityName)) {
157
+ mapTree.set(activityName, new Map())
158
+ }
159
+
160
+ if (fileName.length === 3) {
161
+ mapTree.get(activityName).set(fileName, {
162
+ ref: fileRef,
163
+ content: fileContent.data(),
164
+ fullPath: e.fullPath
165
+ }) // add entry for the page
166
+ }
167
+ // Handleling Groupe page type
168
+ else if (fileName.length > 3 && fileName.includes('_')) {
169
+ const keyToFind = fileName.split('_', 1)[0] // Pxx
170
+ const KeyToAdd = fileName.split('_')[1] // Exx
171
+
172
+ // // search for the page key in the map
173
+ if (!mapTree.get(activityName).has(keyToFind)) return
174
+
175
+ // save a reference for the value of the key
176
+ const tempSave = mapTree.get(activityName).get(keyToFind)
177
+
178
+ // transform value of found key to a new map
179
+ if (!mapTree.get(activityName).get(keyToFind).size) {
180
+ mapTree.get(activityName).set(keyToFind, new Map())
181
+ // Update reference of key's
182
+ mapTree.get(activityName).get(keyToFind).set(keyToFind, tempSave)
183
+ }
184
+
185
+ // Add page EXX in Map if it is not already added
186
+ if (!mapTree.get(activityName).get(keyToFind).get(KeyToAdd))
187
+ mapTree.get(activityName).get(keyToFind).set(fileName, {
188
+ ref: fileRef,
189
+ content: fileContent.data(),
190
+ fullPath: e.fullPath
191
+ })
192
+ }
193
+ })
194
+
195
+ return mapTree
196
+ },
197
+
198
+ /**
199
+ * @description Capitalize word in string
200
+ * @param {String} a- array of file for use case
201
+ * @param {Object} [requiredArgs] list of arguments to include consider in validation ()
202
+ */
203
+ capitalize: (string) => {
204
+ let formatted = string.replaceAll('_', ' ').toLowerCase()
205
+ formatted = `${formatted.substring(0, 1).toUpperCase()}${formatted.slice(1).toLowerCase()}`
206
+ return formatted
207
+ }
208
+ }
209
+
210
+ export { fileAssets }