@opensalt/ob3-definer 1.2.3 → 1.2.5

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 (45) hide show
  1. package/dist/index.html +3 -1
  2. package/dist/ob3-definer.js +11 -11
  3. package/package.json +4 -1
  4. package/.vscode/extensions.json +0 -3
  5. package/NOTES +0 -6
  6. package/Test Achievement-bug1.json +0 -42
  7. package/formkit.config.js +0 -27
  8. package/index-2.html +0 -22
  9. package/index.html +0 -19
  10. package/jsconfig.json +0 -8
  11. package/public/favicon.svg +0 -7
  12. package/src/App.vue +0 -23
  13. package/src/assets/base.css +0 -86
  14. package/src/assets/main.css +0 -24
  15. package/src/assets/style.scss +0 -33
  16. package/src/components/AchievementCriteria.vue +0 -78
  17. package/src/components/AchievementDefiner.vue +0 -223
  18. package/src/components/AchievementImage.vue +0 -167
  19. package/src/components/AchievementType.vue +0 -118
  20. package/src/components/AdditionalTab.vue +0 -33
  21. package/src/components/AddressComponent.vue +0 -118
  22. package/src/components/AlignmentComponent.vue +0 -103
  23. package/src/components/AlignmentType.vue +0 -98
  24. package/src/components/AlignmentsComponent.vue +0 -13
  25. package/src/components/AlignmentsTab.vue +0 -18
  26. package/src/components/BasicTab.vue +0 -55
  27. package/src/components/CreatorProfile.vue +0 -166
  28. package/src/components/CriterionLevels.vue +0 -97
  29. package/src/components/DetailTab.vue +0 -72
  30. package/src/components/IndividualName.vue +0 -63
  31. package/src/components/MarkdownRenderer.vue +0 -20
  32. package/src/components/OtherIdentifiers.vue +0 -116
  33. package/src/components/RelatedList.vue +0 -89
  34. package/src/components/ResultDescription.vue +0 -121
  35. package/src/components/ResultType.vue +0 -94
  36. package/src/components/TagList.vue +0 -121
  37. package/src/components/ValueList.vue +0 -144
  38. package/src/inputs/innerLabelTextInput.js +0 -62
  39. package/src/inputs/innerLabelTextareaInput.js +0 -57
  40. package/src/inputs/selectInputGroup.js +0 -76
  41. package/src/main.js +0 -57
  42. package/src/stores/credential.js +0 -292
  43. package/src/validation/uri.js +0 -13
  44. package/test-index.html +0 -17
  45. package/vite.config.js +0 -39
package/src/main.js DELETED
@@ -1,57 +0,0 @@
1
- //import "bootstrap/dist/css/bootstrap.min.css";
2
- //import "bootstrap";
3
- //import './assets/main.css'
4
- //import './assets/style.scss';
5
-
6
- import { createApp } from 'vue';
7
- import App from './App.vue';
8
- import { plugin, defaultConfig } from "@formkit/vue";
9
- import customConfig from '../formkit.config.js';
10
- import { innerLabelTextInput } from '@/inputs/innerLabelTextInput.js';
11
- import { innerLabelTextareaInput } from '@/inputs/innerLabelTextareaInput.js';
12
- import { selectInputGroup } from '@/inputs/selectInputGroup.js';
13
- import uri from "@/validation/uri.js";
14
-
15
- const createDefiner = (el, props) => {
16
- const app = createApp(App, props);
17
- app.use(plugin, defaultConfig({
18
- config: customConfig.config,
19
- inputs: {
20
- innerLabelTextInput,
21
- innerLabelTextareaInput,
22
- selectInputGroup,
23
- },
24
- rules: {
25
- uri,
26
- },
27
- }));
28
- return app;
29
- }
30
-
31
- window.addEventListener('ob3-open', function(event) {
32
- const selector = event.detail?.selector || '#ob3-definer';
33
- const mountEl = document.querySelector(selector);
34
- if (!mountEl) {
35
- throw new Error('No element found for selector ' + selector);
36
- }
37
- const props = { ...mountEl.dataset };
38
- if (event.detail?.achievement) {
39
- const achievement = event.detail.achievement;
40
- if (typeof achievement === 'string') {
41
- props.achievement = event.detail.achievement;
42
- } else {
43
- props.achievement = JSON.stringify(event.detail.achievement);
44
- }
45
- }
46
- if (event.detail?.submitText) {
47
- props.submitText = event.detail.submitText;
48
- }
49
- const app = createDefiner(selector, props);
50
- app.mount(selector);
51
- window.addEventListener('ob3-close', function close() {
52
- window.removeEventListener('ob3-open', close);
53
- app.unmount();
54
- });
55
- });
56
-
57
- export default createDefiner;
@@ -1,292 +0,0 @@
1
- import { defineStore, acceptHMRUpdate } from "pinia";
2
- import { v4 as uuidV4 } from "uuid";
3
-
4
- function removeEmpty(obj) {
5
- return Object.fromEntries(
6
- Object.entries(obj)
7
- .filter(([_, v]) => v != null && v !== '' && (!Array.isArray(v) || v.length > 0))
8
- .map(([k, v]) => [k, (v === Object(v) && !Array.isArray(v)) ? removeEmpty(v) : v])
9
- );
10
- }
11
-
12
- export const useCredentialStore = defineStore('credential', {
13
- state: () => ({
14
- id: '',
15
- name: '',
16
- achievementType: '',
17
- image: {},
18
- description: '',
19
- criteria: {},
20
- humanCode: '',
21
- inLanguage: '',
22
- version: '',
23
- creditsAvailable: '',
24
- specialization: '',
25
- fieldOfStudy: '',
26
- alignment: [],
27
- related: [],
28
- resultDescription: [],
29
- tag: [],
30
- otherIdentifier: [],
31
- creator: {
32
- image: {
33
- id: '',
34
- type: 'Image',
35
- caption: '',
36
- },
37
- address: {
38
- geo: {},
39
- },
40
- },
41
- }),
42
- getters: {
43
- hasRequired(state) {
44
- if (!state.name) {
45
- return false;
46
- }
47
- if (!state.achievementType) {
48
- return false;
49
- }
50
- if (!state.description) {
51
- return false;
52
- }
53
- if (!state.criteria.narrative && !state.criteria.url) {
54
- return false;
55
- }
56
-
57
- return true;
58
- },
59
- credential(state) {
60
- const result = {
61
- "@context": [
62
- "https://www.w3.org/2018/credentials/v2",
63
- "https://purl.imsglobal.org/spec/ob/v3p0/context-3.0.3.json",
64
- ],
65
- type: ["Achievement"],
66
- name: state.name,
67
- achievementType: state.achievementType,
68
- description: state.description,
69
- criteria: {},
70
- };
71
-
72
- if (state.image.id) {
73
- result.image = {
74
- id: state.image.id,
75
- type: 'Image',
76
- };
77
-
78
- if (state.image.caption) {
79
- result.image.caption = state.image.caption;
80
- }
81
- }
82
-
83
- if (state.id.trim()) {
84
- result.id = state.id.trim();
85
- }
86
-
87
- if (state.criteria.narrative.trim()) {
88
- result.criteria.narrative = state.criteria.narrative.trim();
89
- }
90
- if (state.criteria.url.trim()) {
91
- result.criteria.id = state.criteria.url.trim();
92
- }
93
-
94
- if (state.humanCode.trim()) {
95
- result.humanCode = state.humanCode.trim();
96
- }
97
-
98
- if (state.inLanguage.trim()) {
99
- result.inLanguage = state.inLanguage.trim();
100
- }
101
-
102
- if (state.version.trim()) {
103
- result.version = state.version.trim();
104
- }
105
-
106
- if (state.creditsAvailable) {
107
- result.creditsAvailable = state.creditsAvailable;
108
- }
109
-
110
- if (state.fieldOfStudy.trim()) {
111
- result.fieldOfStudy = state.fieldOfStudy.trim();
112
- }
113
-
114
- if (state.specialization.trim()) {
115
- result.specialization = state.specialization.trim();
116
- }
117
-
118
- if (state.alignment.length > 0) {
119
- result.alignment = [];
120
- state.alignment.forEach((alignment) => {
121
- alignment = removeEmpty(alignment);
122
- if (Object.keys(alignment).length > 0) {
123
- //console.log(Object.keys(alignment).length, alignment);
124
- result.alignment.push(alignment);
125
- }
126
- })
127
-
128
- if (result.alignment.length === 0) {
129
- delete result.alignment;
130
- }
131
- }
132
-
133
- if (state.resultDescription.length > 0) {
134
- result.resultDescription = [];
135
- state.resultDescription.forEach((resultDescription) => {
136
- resultDescription = removeEmpty(resultDescription);
137
- if (Object.keys(resultDescription).length > 0) {
138
- //console.log(Object.keys(result).length, result);
139
- result.resultDescription.push(resultDescription);
140
- }
141
- })
142
-
143
- if (result.resultDescription.length === 0) {
144
- delete result.resultDescription;
145
- }
146
- }
147
-
148
- if (state.tag.length > 0) {
149
- result.tag = state.tag;
150
- }
151
-
152
- if (state.related.length > 0) {
153
- result.related = [];
154
- state.related.forEach((related) => {
155
- related = removeEmpty(related);
156
- if (Object.keys(related).length > 0) {
157
- //console.log(Object.keys(result).length, result);
158
- result.related.push(related);
159
- }
160
- })
161
-
162
- if (result.related.length === 0) {
163
- delete result.related;
164
- }
165
- }
166
-
167
- if (state.otherIdentifier.length > 0) {
168
- result.otherIdentifier = [];
169
- state.otherIdentifier.forEach((otherIdentifier) => {
170
- otherIdentifier = removeEmpty(otherIdentifier);
171
- if (Object.keys(otherIdentifier).length > 0) {
172
- //console.log(Object.keys(result).length, result);
173
- result.otherIdentifier.push(otherIdentifier);
174
- }
175
- })
176
-
177
- if (result.otherIdentifier.length === 0) {
178
- delete result.otherIdentifier;
179
- }
180
- }
181
-
182
- if (state.creator.id) {
183
- result.creator = {
184
- id: state.creator.id,
185
- type: ["Profile"],
186
- };
187
- if (state.creator.name) {
188
- result.creator.name = state.creator.name;
189
- }
190
- if (state.creator.url) {
191
- result.creator.url = state.creator.url;
192
- }
193
- }
194
-
195
- return JSON.stringify(result);
196
-
197
- /*
198
- {
199
- "humanCode": "",
200
- "inLanguage": "",
201
- "version": "",
202
- "creditsAvailable": "",
203
- "fieldOfStudy": "",
204
- "specialization": "",
205
- "tag": [],
206
- "otherIdentifier": [],
207
- "related": [{
208
- "id": "",
209
- "type": ["Related"],
210
- "inLanguage": "",
211
- "version": "",
212
- }],
213
- "resultDescription": [{
214
- "id": "",
215
- "type": ["ResultDescription"],
216
- "name": "",
217
- "resultType": "",
218
- - GradePointAverage
219
- - LetterGrade
220
- - Percent
221
- - PerformanceLevel
222
- - PredictedScore
223
- - RawScore
224
- - Result
225
- - RubricCriterion
226
- - RubricCriterionLevel
227
- - RubricScore
228
- - ScaledScore
229
- - Status
230
- - ext:[a-zA-Z0-9\\.\\-_]+
231
- "valueMax": "",
232
- "valueMin": "",
233
- "rubricCriterionLevel": [{
234
- "id": "", // required
235
- "type": ["RubricCriterionLevel"], // required
236
- "name": "", // required
237
- "level": "",
238
- "description": "",
239
- "alignment": [],
240
- "points": ""
241
- }],
242
- "requiredLevel": "",
243
- "allowedValue": [],
244
- "alignment": [],
245
- "requiredValue": "",
246
- }],
247
- "alignment": [{
248
- "type": ["Alignment"],
249
- "targetName": "",
250
- "targetUrl": "",
251
- "targetFramework": "",
252
- "targetDescription": "",
253
- "targetCode": "",
254
- "targetType": "",
255
- }],
256
- "creator": {
257
- "id": "",
258
- "type": ["Profile"],
259
- "address": {
260
- },
261
- "givenName": "",
262
- "description": "",
263
- "official": "",
264
- "honorificPrefix": "",
265
- "dateOfBirth": "",
266
- "url": "",
267
- "honorificSuffix": "",
268
- "phone": "",
269
- "familyName": "",
270
- "familyNamePrefix": "",
271
- "name": "",
272
- "patronymicName": "",
273
- "otherIdentifier": [],
274
- "additionalName": "",
275
- "email": "",
276
- "parentOrg": "",
277
- },
278
- }
279
- */
280
- },
281
- uuid: state => {
282
- return uuidV4();
283
- }
284
- },
285
- actions: {
286
-
287
- },
288
- });
289
-
290
- if (import.meta.hot) {
291
- import.meta.hot.accept(acceptHMRUpdate(useCredentialStore, import.meta.hot));
292
- }
@@ -1,13 +0,0 @@
1
- import * as URI from 'uri-js'
2
-
3
- const uri = function (node) {
4
- try {
5
- const checkUri = URI.parse(node.value, {reference: 'absolute', absolutePath: true});
6
-
7
- return !checkUri.error;
8
- } catch (e) {
9
- return false;
10
- }
11
- }
12
-
13
- export default uri
package/test-index.html DELETED
@@ -1,17 +0,0 @@
1
- <!DOCTYPE html>
2
- <html lang="en">
3
- <head>
4
- <meta charset="UTF-8">
5
- <link rel="icon" href="/favicon.svg">
6
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
- <title>OB3 Achievement Definer</title>
8
- <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
9
- <script type="module" crossorigin src="/ob3-definer.js"></script>
10
- <link rel="stylesheet" crossorigin href="/ob3-definer.css">
11
- </head>
12
- <body>
13
- <div id="ob3-definer"
14
- data-achievement='{"id":"https://bismarckstate.edu/academics/programs/computersupport/","type":["Achievement"],"alignment":[],"achievementType":null,"creator":null,"creditsAvailable":null,"criteria":{"id":null,"narrative":"Test narrative"},"description":"This degree program combines cybersecurity with system and network administration. Classes focus on best practices in security, networking, operating systems, and their administration.\r\n\r\nOur students experience real-life scenarios through hands-on labs and simulations that are constructed based on feedback from the cybersecurity community and continually adapted to todays changing world. Not only do we teach security concepts and technologies, we also teach the information technology component that goes with it. Upon graduation, you will be ready to use your knowledge and skills in the workforce.\r\n\r\nThe curriculum contains core classes in computer hardware, Windows and Linux operating systems, networking, security, and programming. Students may have the opportunity to earn college credit for cooperative education or internship opportunities with local businesses.\r\n\r\nAll classes in the program can be taken online or on campus. We continue to evolve our advanced instructional methodologies to complement cutting-edge and remote learning technologies, providing our students with synchronous, virtual classroom environments. Our flexible, online and/or on-campus courses make it easier to achieve your educational goals. \r\n\r\nStudents can complete the program in two years, three years, or longer, depending upon prior preparation in Math, English, and Computers.","fieldOfStudy":"CIP Code Data Pulled From Campus Solutions","humanCode":null,"image":null,"inLanguage":null,"name":"Cybersecurity&Computer Network","otherIdentifier":null,"related":null,"resultDescription":[{"id":"urn:uuid:229c6a36-e66a-4096-b659-6258ef66ec02","type":["ResultDescription"],"alignment":null,"allowedValue":[],"name":"Program Completed","requiredLevel":null,"requiredValue":null,"resultType":"Status","rubricCriterionLevel":null,"valueMax":null,"valueMin":null}],"specialization":null,"tag":null,"version":null}'
15
- ></div>
16
- </body>
17
- </html>
package/vite.config.js DELETED
@@ -1,39 +0,0 @@
1
- import { fileURLToPath, URL } from 'node:url'
2
-
3
- import { defineConfig } from 'vite'
4
- import vue from '@vitejs/plugin-vue'
5
-
6
- // https://vitejs.dev/config/
7
- export default defineConfig({
8
- plugins: [
9
- vue({
10
- template: {
11
- compilerOptions: {
12
- isCustomElment: (tag) => tag.includes('-')
13
- },
14
- },
15
- }),
16
- ],
17
- resolve: {
18
- alias: {
19
- '@': fileURLToPath(new URL('./src', import.meta.url))
20
- }
21
- },
22
- build: {
23
- /* lib: {
24
- entry: resolve(__dirname, 'src/main.js'),
25
- name: 'CredentialMaker',
26
- filename: 'ob3definer',
27
- },*/
28
- rollupOptions: {
29
- input: ['./index.html'],
30
- output: {
31
- dir: 'dist/',
32
- entryFileNames: 'ob3-definer.js',
33
- assetFileNames: 'ob3-definer.css',
34
- chunkFileNames: 'chunk.js',
35
- manualChunks: undefined,
36
- }
37
- }
38
- }
39
- })