fcad-core-dragon 2.1.0-beta.2 → 2.1.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.
- package/.editorconfig +33 -33
- package/.eslintignore +29 -29
- package/.eslintrc.cjs +81 -81
- package/CHANGELOG +20 -0
- package/bk.scss +117 -117
- package/package.json +30 -31
- package/src/assets/data/onboardingMessages.json +47 -47
- package/src/components/AppBase.vue +167 -39
- package/src/components/AppBaseButton.test.js +0 -1
- package/src/components/AppBaseErrorDisplay.vue +438 -438
- package/src/components/AppBaseFlipCard.vue +84 -84
- package/src/components/AppBaseModule.vue +103 -116
- package/src/components/AppBasePage.vue +13 -13
- package/src/components/AppBasePopover.vue +41 -41
- package/src/components/AppCompMenu.vue +2 -1
- package/src/components/AppCompPlayBarNext.vue +157 -16
- package/src/components/AppCompPopUpNext.vue +3 -3
- package/src/components/AppCompQuizRecall.vue +2 -3
- package/src/components/AppCompSettingsMenu.vue +172 -172
- package/src/components/AppCompTableOfContent.vue +1 -1
- package/src/components/AppCompViewDisplay.vue +6 -6
- package/src/components/tests__/useTimer.spec.js +91 -0
- package/src/composables/useIdleDetector.js +56 -0
- package/src/composables/useQuiz.js +1 -1
- package/src/composables/useTimer.js +175 -0
- package/src/externalComps/ModuleView.vue +22 -22
- package/src/externalComps/SummaryView.vue +91 -91
- package/src/main.js +2 -0
- package/src/module/stores/appStore.js +10 -34
- package/src/module/xapi/ADL.js +1 -0
- package/src/module/xapi/Crypto/Hasher.js +241 -241
- package/src/module/xapi/Crypto/WordArray.js +278 -278
- package/src/module/xapi/Crypto/algorithms/BufferedBlockAlgorithm.js +103 -103
- package/src/module/xapi/Crypto/algorithms/C_algo.js +315 -315
- package/src/module/xapi/Crypto/algorithms/HMAC.js +9 -9
- package/src/module/xapi/Crypto/algorithms/SHA1.js +9 -9
- package/src/module/xapi/Crypto/encoders/Base.js +105 -105
- package/src/module/xapi/Crypto/encoders/Base64.js +99 -99
- package/src/module/xapi/Crypto/encoders/Hex.js +61 -61
- package/src/module/xapi/Crypto/encoders/Latin1.js +61 -61
- package/src/module/xapi/Crypto/encoders/Utf8.js +45 -45
- package/src/module/xapi/Crypto/index.js +53 -53
- package/src/module/xapi/Statement/activity.js +47 -47
- package/src/module/xapi/Statement/agent.js +55 -55
- package/src/module/xapi/Statement/group.js +26 -26
- package/src/module/xapi/Statement/index.js +259 -259
- package/src/module/xapi/Statement/statement.js +253 -253
- package/src/module/xapi/Statement/statementRef.js +23 -23
- package/src/module/xapi/Statement/substatement.js +22 -22
- package/src/module/xapi/Statement/verb.js +36 -36
- package/src/module/xapi/activitytypes.js +17 -17
- package/src/module/xapi/utils.js +167 -167
- package/src/module/xapi/verbs.js +294 -294
- package/src/module/xapi/xapiStatement.js +444 -444
- package/src/plugins/analytics.js +34 -0
- package/src/plugins/bus.js +8 -8
- package/src/plugins/gsap.js +14 -14
- package/src/plugins/i18n.js +26 -44
- package/src/plugins/save.js +37 -37
- package/src/plugins/scorm.js +287 -287
- package/src/plugins/xapi.js +11 -11
- package/src/public/index.html +33 -33
- package/src/router/index.js +6 -3
- package/src/components/AppCompPlayBarProgress.vue +0 -82
- package/src/mixins/$mediaMixins.js +0 -809
- package/src/mixins/timerMixin.js +0 -195
- package/src/module/xapi/wrapper copy.js +0 -1963
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { event } from 'vue-gtag'
|
|
2
|
+
import VueGtag from 'vue-gtag'
|
|
3
|
+
|
|
4
|
+
export default function analytics(app, name) {
|
|
5
|
+
Object.defineProperty(app.config.globalProperties, name, {
|
|
6
|
+
value: {
|
|
7
|
+
analyticsEnabled: false,
|
|
8
|
+
//Initialize the vue-gtag plugin if a valid analytics id is provided in App.vue
|
|
9
|
+
init(analytics_id, router) {
|
|
10
|
+
if (typeof analytics_id !== 'undefined' && analytics_id.length > 1) {
|
|
11
|
+
const pluginConfig = {
|
|
12
|
+
config: { id: analytics_id }
|
|
13
|
+
}
|
|
14
|
+
app.use(VueGtag, pluginConfig, router)
|
|
15
|
+
this.analyticsEnabled = true
|
|
16
|
+
} else {
|
|
17
|
+
console.log(
|
|
18
|
+
'no valid analytics_id provided in App.vue : analytics disabled'
|
|
19
|
+
)
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
//track an event
|
|
23
|
+
sendEvent(name, params) {
|
|
24
|
+
if (this.analyticsEnabled) {
|
|
25
|
+
console.log(`GA|track event named: ${name}`)
|
|
26
|
+
if (params) {
|
|
27
|
+
console.log(`GA|with params:`, params)
|
|
28
|
+
}
|
|
29
|
+
event(name, params)
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
}
|
package/src/plugins/bus.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import emitter from 'tiny-emitter/instance'
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
$on: (...args) => emitter.on(...args),
|
|
5
|
-
$once: (...args) => emitter.once(...args),
|
|
6
|
-
$off: (...args) => emitter.off(...args),
|
|
7
|
-
$emit: (...args) => emitter.emit(...args)
|
|
8
|
-
}
|
|
1
|
+
import emitter from 'tiny-emitter/instance'
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
$on: (...args) => emitter.on(...args),
|
|
5
|
+
$once: (...args) => emitter.once(...args),
|
|
6
|
+
$off: (...args) => emitter.off(...args),
|
|
7
|
+
$emit: (...args) => emitter.emit(...args)
|
|
8
|
+
}
|
package/src/plugins/gsap.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Integrating gsap library as Vue plug in
|
|
3
|
-
* usage: import GsapPlugin from './utilies.js';
|
|
4
|
-
* ref: https: //vuejsdevelopers.com/2017/04/22/vue-js-libraries-plugins/
|
|
5
|
-
*/
|
|
6
|
-
import gsap from 'gsap'
|
|
7
|
-
import { MotionPathPlugin } from 'gsap/MotionPathPlugin'
|
|
8
|
-
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
|
9
|
-
import { Flip } from 'gsap/Flip'
|
|
10
|
-
|
|
11
|
-
gsap.registerPlugin(MotionPathPlugin, ScrollTrigger, Flip)
|
|
12
|
-
export default function GsapPlugin(app, name) {
|
|
13
|
-
app.config.globalProperties.$gsap = gsap
|
|
14
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Integrating gsap library as Vue plug in
|
|
3
|
+
* usage: import GsapPlugin from './utilies.js';
|
|
4
|
+
* ref: https: //vuejsdevelopers.com/2017/04/22/vue-js-libraries-plugins/
|
|
5
|
+
*/
|
|
6
|
+
import gsap from 'gsap'
|
|
7
|
+
import { MotionPathPlugin } from 'gsap/MotionPathPlugin'
|
|
8
|
+
import { ScrollTrigger } from 'gsap/ScrollTrigger'
|
|
9
|
+
import { Flip } from 'gsap/Flip'
|
|
10
|
+
|
|
11
|
+
gsap.registerPlugin(MotionPathPlugin, ScrollTrigger, Flip)
|
|
12
|
+
export default function GsapPlugin(app, name) {
|
|
13
|
+
app.config.globalProperties.$gsap = gsap
|
|
14
|
+
}
|
package/src/plugins/i18n.js
CHANGED
|
@@ -1,44 +1,26 @@
|
|
|
1
|
-
import _ from 'lodash'
|
|
2
|
-
/**
|
|
3
|
-
* Merge locales message in project.
|
|
4
|
-
* @summary To merge the locales dictionnary of this library with the locales that user will create
|
|
5
|
-
* @param {Object} i18n - vue-i18n internalization object.
|
|
6
|
-
*/
|
|
7
|
-
export default function mergeLocales(i18n) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// Using lodash to deeply merge objects
|
|
28
|
-
const messagesDeepCopy = JSON.parse(JSON.stringify(i18n.messages[locale]))
|
|
29
|
-
const mergedMessages = _.merge(messagesDeepCopy, thisLocales[path])
|
|
30
|
-
// Since merLocalMessage will do a shallow merge of the object. We will use setLocalMessage to replace the message with new message object
|
|
31
|
-
i18n.setLocaleMessage(locale, mergedMessages)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
// thisLocales.keys().forEach((key) => {
|
|
35
|
-
// const matched = key.match(/([A-Za-z0-9-_]+)\./i)
|
|
36
|
-
// if (matched && matched.length > 1) {
|
|
37
|
-
// const locale = matched[1]
|
|
38
|
-
// // Using lodash to deeply merge objects
|
|
39
|
-
// const mergedMessages = deep.merge(i18n.messages[locale], thisLocales(key))
|
|
40
|
-
// // Since merLocalMessage will do a shallow merge of the object. We will use setLocalMessage to replace the message with new message object
|
|
41
|
-
// i18n.setLocaleMessage(locale, mergedMessages)
|
|
42
|
-
// }
|
|
43
|
-
// })
|
|
44
|
-
}
|
|
1
|
+
import _ from 'lodash'
|
|
2
|
+
/**
|
|
3
|
+
* Merge locales message in project.
|
|
4
|
+
* @summary To merge the locales dictionnary of this library with the locales that user will create
|
|
5
|
+
* @param {Object} i18n - vue-i18n internalization object.
|
|
6
|
+
*/
|
|
7
|
+
export default function mergeLocales(i18n) {
|
|
8
|
+
const thisLocales = import.meta.glob('../$locales/*.json', {
|
|
9
|
+
import: 'default',
|
|
10
|
+
eager: true
|
|
11
|
+
})
|
|
12
|
+
for (const path in thisLocales) {
|
|
13
|
+
const matched = path.match(/([A-Za-z0-9-_]+)\./i)
|
|
14
|
+
if (matched && matched.length > 1) {
|
|
15
|
+
const locale = matched[1]
|
|
16
|
+
|
|
17
|
+
// Using lodash to deeply merge objects
|
|
18
|
+
const coreMessages = JSON.parse(JSON.stringify(thisLocales[path]))
|
|
19
|
+
const templateMessages = JSON.parse(JSON.stringify(i18n.messages[locale]))
|
|
20
|
+
const mergedMessages = _.merge(coreMessages, templateMessages)
|
|
21
|
+
|
|
22
|
+
// Since merLocalMessage will do a shallow merge of the object. We will use setLocalMessage to replace the message with new message object
|
|
23
|
+
i18n.setLocaleMessage(locale, mergedMessages)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/plugins/save.js
CHANGED
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
/* creating a small save plug-in to save store state in the localStorage
|
|
2
|
-
* the plugin listen for mutations made to the Pinia store and store them in the local browser storage.
|
|
3
|
-
* This prevent reseting the store to initial state when the browser refreshes
|
|
4
|
-
* Note: the plugin is used in the store.js
|
|
5
|
-
*/
|
|
6
|
-
export function saveStatePlugin(store) {
|
|
7
|
-
store.subscribe((mutation, state) => {
|
|
8
|
-
// save the user data
|
|
9
|
-
if (Object.entries(state.$appStore.userMetaData).length) {
|
|
10
|
-
localStorage.setItem(
|
|
11
|
-
'userData',
|
|
12
|
-
JSON.stringify(state.$appStore.userMetaData)
|
|
13
|
-
)
|
|
14
|
-
} else if (
|
|
15
|
-
!localStorage.getItem('userData') &&
|
|
16
|
-
!Object.entries(state.$appStore.userMetaData).length
|
|
17
|
-
) {
|
|
18
|
-
localStorage.setItem('userData', JSON.stringify({}))
|
|
19
|
-
}
|
|
20
|
-
})
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* creating a small save plug-in to get stored state from the localStorage
|
|
25
|
-
*/
|
|
26
|
-
export function getSavedStatePlugin(type, id) {
|
|
27
|
-
if (localStorage.getItem('thisModule')) {
|
|
28
|
-
const savedData = JSON.parse(localStorage.getItem('thisModule'))
|
|
29
|
-
|
|
30
|
-
if (type === 'module' && savedData.id === id) return savedData
|
|
31
|
-
if (type === 'page' && savedData.children.length) {
|
|
32
|
-
return savedData.children.find((p) => id === p.id)
|
|
33
|
-
}
|
|
34
|
-
return JSON.parse(localStorage.getItem('thisModule'))
|
|
35
|
-
}
|
|
36
|
-
return null
|
|
37
|
-
}
|
|
1
|
+
/* creating a small save plug-in to save store state in the localStorage
|
|
2
|
+
* the plugin listen for mutations made to the Pinia store and store them in the local browser storage.
|
|
3
|
+
* This prevent reseting the store to initial state when the browser refreshes
|
|
4
|
+
* Note: the plugin is used in the store.js
|
|
5
|
+
*/
|
|
6
|
+
export function saveStatePlugin(store) {
|
|
7
|
+
store.subscribe((mutation, state) => {
|
|
8
|
+
// save the user data
|
|
9
|
+
if (Object.entries(state.$appStore.userMetaData).length) {
|
|
10
|
+
localStorage.setItem(
|
|
11
|
+
'userData',
|
|
12
|
+
JSON.stringify(state.$appStore.userMetaData)
|
|
13
|
+
)
|
|
14
|
+
} else if (
|
|
15
|
+
!localStorage.getItem('userData') &&
|
|
16
|
+
!Object.entries(state.$appStore.userMetaData).length
|
|
17
|
+
) {
|
|
18
|
+
localStorage.setItem('userData', JSON.stringify({}))
|
|
19
|
+
}
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* creating a small save plug-in to get stored state from the localStorage
|
|
25
|
+
*/
|
|
26
|
+
export function getSavedStatePlugin(type, id) {
|
|
27
|
+
if (localStorage.getItem('thisModule')) {
|
|
28
|
+
const savedData = JSON.parse(localStorage.getItem('thisModule'))
|
|
29
|
+
|
|
30
|
+
if (type === 'module' && savedData.id === id) return savedData
|
|
31
|
+
if (type === 'page' && savedData.children.length) {
|
|
32
|
+
return savedData.children.find((p) => id === p.id)
|
|
33
|
+
}
|
|
34
|
+
return JSON.parse(localStorage.getItem('thisModule'))
|
|
35
|
+
}
|
|
36
|
+
return null
|
|
37
|
+
}
|