@opensalt/ob3-definer 1.2.4 → 1.2.6

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 (42) hide show
  1. package/dist/index.html +1 -3
  2. package/dist/ob3-definer.css +1 -1
  3. package/dist/ob3-definer.js +18 -18
  4. package/package.json +8 -5
  5. package/.vscode/extensions.json +0 -3
  6. package/formkit.config.js +0 -27
  7. package/index.html +0 -19
  8. package/jsconfig.json +0 -8
  9. package/public/favicon.svg +0 -7
  10. package/src/App.vue +0 -23
  11. package/src/assets/base.css +0 -86
  12. package/src/assets/main.css +0 -24
  13. package/src/assets/style.scss +0 -33
  14. package/src/components/AchievementCriteria.vue +0 -78
  15. package/src/components/AchievementDefiner.vue +0 -223
  16. package/src/components/AchievementImage.vue +0 -167
  17. package/src/components/AchievementType.vue +0 -118
  18. package/src/components/AdditionalTab.vue +0 -33
  19. package/src/components/AddressComponent.vue +0 -118
  20. package/src/components/AlignmentComponent.vue +0 -103
  21. package/src/components/AlignmentType.vue +0 -98
  22. package/src/components/AlignmentsComponent.vue +0 -13
  23. package/src/components/AlignmentsTab.vue +0 -18
  24. package/src/components/BasicTab.vue +0 -55
  25. package/src/components/CreatorProfile.vue +0 -166
  26. package/src/components/CriterionLevels.vue +0 -97
  27. package/src/components/DetailTab.vue +0 -72
  28. package/src/components/IndividualName.vue +0 -63
  29. package/src/components/MarkdownRenderer.vue +0 -20
  30. package/src/components/OtherIdentifiers.vue +0 -116
  31. package/src/components/RelatedList.vue +0 -89
  32. package/src/components/ResultDescription.vue +0 -121
  33. package/src/components/ResultType.vue +0 -94
  34. package/src/components/TagList.vue +0 -121
  35. package/src/components/ValueList.vue +0 -144
  36. package/src/inputs/innerLabelTextInput.js +0 -62
  37. package/src/inputs/innerLabelTextareaInput.js +0 -57
  38. package/src/inputs/selectInputGroup.js +0 -76
  39. package/src/main.js +0 -57
  40. package/src/stores/credential.js +0 -292
  41. package/src/validation/uri.js +0 -13
  42. package/vite.config.js +0 -39
@@ -1,121 +0,0 @@
1
- <script setup>
2
- import AlignmentComponent from "@/components/AlignmentComponent.vue";
3
- import ValueList from "@/components/ValueList.vue";
4
- import CriterionLevels from "@/components/CriterionLevels.vue";
5
- import ResultType from "@/components/ResultType.vue";
6
- import { v4 as uuidV4 } from "uuid";
7
-
8
- const results = defineModel({ default: [] });
9
- </script>
10
-
11
- <template>
12
- <FormKit
13
- #default="{ items, node, value }"
14
- type="list"
15
- name="resultDescription"
16
- v-model="results"
17
- dynamic
18
- >
19
- <h5 class="mb-4">Result Descriptions
20
- <button type="button" @click="() => node.input(value.concat({id: 'urn:uuid:'+uuidV4()}))" class="btn btn-sm btn-primary ms-3">
21
- Add Result Description
22
- </button>
23
- </h5>
24
-
25
- <FormKit
26
- type="group"
27
- wrapper-class="card"
28
- v-for="(item, index) in items"
29
- :key="item"
30
- :index="index"
31
- >
32
- <div class="card mb-3">
33
- <h5 class="card-header">Result Description {{index+1}}
34
- <button type="button" @click="() => node.input(value.filter((_, i) => i !== index))" class="btn btn-secondary btn-sm float-end">
35
- Remove
36
- </button>
37
- </h5>
38
-
39
- <div class="card-body">
40
- <FormKit
41
- type="innerLabelTextInput"
42
- label="ID"
43
- name="id"
44
- inner-class="input-group"
45
- label-class="input-group-text"
46
- wrapper-class="required"
47
- validation="uri:required:trim"
48
- help="The unique URI for this result description. Required so a result can link to this result description."
49
- />
50
-
51
- <FormKit
52
- type="hidden"
53
- name="type"
54
- :value="[ 'ResultDescription' ]"
55
- />
56
-
57
- <FormKit
58
- type="innerLabelTextInput"
59
- label="Name"
60
- name="name"
61
- inner-class="input-group"
62
- label-class="input-group-text"
63
- wrapper-class="required"
64
- validation="required:trim"
65
- help="The name of the result."
66
- />
67
-
68
- <ResultType v-model="results[index].resultType" />
69
-
70
- <ValueList v-model="results[index].allowedValue"/>
71
-
72
- <FormKit
73
- type="innerLabelTextInput"
74
- label="Minimum Value"
75
- name="valueMin"
76
- inner-class="input-group"
77
- label-class="input-group-text"
78
- help="The minimum possible `value` that may be asserted in a linked result."
79
- />
80
-
81
- <FormKit
82
- type="innerLabelTextInput"
83
- label="Maximum Value"
84
- name="valueMax"
85
- inner-class="input-group"
86
- label-class="input-group-text"
87
- help="The maximum possible `value` that may be asserted in a linked result."
88
- />
89
-
90
- <CriterionLevels v-model="results[index].rubricCriterionLevel"/>
91
-
92
- <FormKit
93
- type="innerLabelTextInput"
94
- label="Required Level"
95
- name="requiredLevel"
96
- inner-class="input-group"
97
- label-class="input-group-text"
98
- help="The `id` of the rubric criterion level required to pass as determined by the achievement creator."
99
- />
100
-
101
- <FormKit
102
- type="innerLabelTextInput"
103
- label="Required Value"
104
- name="requiredValue"
105
- inner-class="input-group"
106
- label-class="input-group-text"
107
- help="A value from `allowedValue` or within the range of `valueMin` to `valueMax` required to pass as determined by the achievement creator."
108
- />
109
-
110
- <AlignmentComponent v-model="results[index].alignment"/>
111
- </div>
112
- </div>
113
- </FormKit>
114
- </FormKit>
115
- </template>
116
-
117
- <style>
118
- .input-group>.form-label {
119
- margin-bottom: 0;
120
- }
121
- </style>
@@ -1,94 +0,0 @@
1
- <script setup>
2
- import {onMounted, ref, watch} from "vue";
3
-
4
- const model = defineModel({ default: ''});
5
- const selectedType = ref('');
6
- const typeExt = ref('');
7
-
8
- onMounted(() => {
9
- if (model.value?.substring(0, 4) === 'ext:') {
10
- selectedType.value = 'other';
11
- typeExt.value = model.value.substring(4);
12
-
13
- return;
14
- }
15
-
16
- selectedType.value = model.value ? model.value : '';
17
- typeExt.value = '';
18
- });
19
-
20
- watch(selectedType, (value) => {
21
- if (value === 'other') {
22
- model.value = 'ext:'+typeExt.value;
23
-
24
- return;
25
- }
26
-
27
- model.value = value;
28
- });
29
-
30
- watch(typeExt, (value) => {
31
- if (selectedType.value === 'other') {
32
- model.value = 'ext:'+value;
33
-
34
- return;
35
- }
36
-
37
- model.value = selectedType.value;
38
- });
39
- </script>
40
-
41
- <template>
42
- <FormKit
43
- type="selectInputGroup"
44
- label="Result Type"
45
- v-model="selectedType"
46
- name="selectedType"
47
- inner-class="input-group"
48
- label-class="input-group-text"
49
- input-class="$reset formkit-input form-select"
50
- wrapper-class="required"
51
- placeholder="Select Result Type"
52
- validation="required"
53
- :options="{
54
- 'GradePointAverage': 'Grade Point Average',
55
- 'LetterGrade': 'Letter Grade',
56
- 'Percent': 'Percent',
57
- 'PerformanceLevel': 'Performance Level',
58
- 'PredictedScore': 'Predicted Score',
59
- 'RawScore': 'Raw Score',
60
- 'Result': 'Result',
61
- 'RubricCriterion': 'Rubric Criterion',
62
- 'RubricCriterionLevel': 'Rubric Criterion Level',
63
- 'RubricScore': 'Rubric Score',
64
- 'ScaledScore': 'Scaled Score',
65
- 'Status': 'Status',
66
- 'other': 'Other (ext:)'
67
- }"
68
- help="The type of result this description represents. This is an extensible enumerated vocabulary."
69
- >
70
- <template #suffix>
71
- <FormKit
72
- v-if="selectedType === 'other'"
73
- type="innerLabelTextInput"
74
- label="Extended Type"
75
- v-model="typeExt"
76
- name="typeExt"
77
- aria-label="Extended Result Type"
78
- inner-class="input-group ms-3 me-5 pe-3"
79
- outer-class="$reset"
80
- label-class="visually-hidden"
81
- before="ext:"
82
- :validation="[['matches', '/^[a-z|A-Z|0-9|.|-|_]+$/'], ['required']]"
83
- >
84
- <template #prefix>
85
- <span class="input-group-text" aria-label="ext:">ext:</span>
86
- </template>
87
- </FormKit>
88
- </template>
89
- </FormKit>
90
- </template>
91
-
92
- <style scoped>
93
-
94
- </style>
@@ -1,121 +0,0 @@
1
- <script setup>
2
- import {onBeforeMount, ref, watch} from "vue";
3
- import {FormKitIcon} from '@formkit/vue'
4
- import {vAutoAnimate} from '@formkit/auto-animate'
5
-
6
- const values = ref([]);
7
- const model = defineModel({ default: [] });
8
-
9
- onBeforeMount(() => {
10
- values.value = model.value;
11
- });
12
- function distinct(node) {
13
- // 👀 use node traversal to get the parent node
14
- const parent = node.at('$parent')
15
- if (parent.value) {
16
- // Ensure all the siblings are different values
17
- for (const childName in parent.value) {
18
- if (''+childName === ''+node.name) {
19
- continue;
20
- }
21
- if (parent.value[childName] === node.value) {
22
- return false;
23
- }
24
- }
25
- }
26
- return true
27
- }
28
-
29
- watch(values, (newValues) => {
30
- model.value = newValues;
31
- });
32
- </script>
33
-
34
- <template>
35
- <div v-auto-animate>
36
- <FormKit v-model="values" name="tag" type="list" dynamic #default="{ items, node, value }">
37
- <h5>Tags
38
- <button type="button" @click="values.push(null)" class="btn btn-sm btn-primary ms-3">
39
- Add Tag
40
- </button>
41
- </h5>
42
- <p class="form-text">One or more short, human-friendly, searchable, keywords that describe the type of achievement.</p>
43
-
44
- <div class="ms-5 mb-3 p-3 border rounded" v-if="items.length > 0">
45
- <div v-for="(item, index) in items" :key="item" class="value-item">
46
- <FormKit
47
- type="text"
48
- :index="index"
49
- :validation-rules="{ distinct }"
50
- validation="required:trim|distinct"
51
- placeholder="Enter tag"
52
- :validation-messages="{
53
- 'required': 'Value is required',
54
- 'distinct': 'The tags must be distinct',
55
- }"
56
- outer-class="$reset"
57
- />
58
- <ul class="controls mt-2">
59
- <li>
60
- <button
61
- type="button"
62
- @click="values.splice(index, 1)"
63
- class="button close"
64
- >
65
- <FormKitIcon icon="close"/>
66
- </button>
67
- </li>
68
- </ul>
69
- </div>
70
- </div>
71
- </FormKit>
72
- </div>
73
- </template>
74
-
75
- <style scoped>
76
- .value-item {
77
- display: flex;
78
- align-items: start;
79
- margin-bottom: 0.5rem;
80
- }
81
-
82
- .value-item:deep(.formkit-outer) {
83
- margin-bottom: 0;
84
- flex-grow: 1;
85
- }
86
-
87
- .controls {
88
- list-style-type: none;
89
- margin: 0;
90
- padding: 0;
91
- display: flex;
92
- align-items: center;
93
- }
94
-
95
- .controls .button {
96
- border: none;
97
- background: none;
98
- padding: 0;
99
- margin: 0;
100
- cursor: pointer;
101
- color: #999;
102
- line-height: 1;
103
- transition: color 0.3s ease;
104
- appearance: none;
105
- font-size: 1em;
106
- color: var(--fk-color-primary);
107
- margin-left: 0.5rem;
108
- }
109
-
110
- .controls:deep(svg) {
111
- display: block;
112
- width: 1em;
113
- max-height: 1.25em;
114
- height: auto;
115
- fill: currentColor;
116
- }
117
-
118
- .controls .close {
119
- color: var(--fk-color-danger);
120
- }
121
- </style>
@@ -1,144 +0,0 @@
1
- <script setup>
2
- import {ref, watch} from "vue";
3
- import {FormKitIcon} from '@formkit/vue'
4
- import {vAutoAnimate} from '@formkit/auto-animate'
5
-
6
- const values = ref([]);
7
- const model = defineModel({ default: [] });
8
-
9
- function distinct(node) {
10
- // 👀 use node traversal to get the parent node
11
- const parent = node.at('$parent')
12
- if (parent.value) {
13
- // Ensure all the siblings are different values
14
- for (const childName in parent.value) {
15
- if (''+childName === ''+node.name) {
16
- continue;
17
- }
18
- if (parent.value[childName] === node.value) {
19
- return false;
20
- }
21
- }
22
- }
23
- return true
24
- }
25
-
26
- watch(values, (newValues) => {
27
- model.value = newValues;
28
- });
29
- </script>
30
-
31
- <template>
32
- <div v-auto-animate>
33
- <FormKit v-model="values" name="allowedValue" type="list" dynamic #default="{ items, node, value }">
34
- <h5>Allowed Values
35
- <button type="button" @click="values.push(null)" class="btn btn-sm btn-primary ms-3">
36
- Add Value
37
- </button>
38
- </h5>
39
- <p class="form-text">
40
- An ordered list of allowed values. The values should be ordered from low to high as determined by the achievement creator.
41
- </p>
42
-
43
- <div class="ms-5 mb-3 p-3 border rounded col-md-8" v-if="items.length > 0">
44
- <div v-for="(item, index) in items" :key="item" class="value-item">
45
- <FormKit
46
- type="innerLabelTextInput"
47
- :index="index"
48
- inner-class="input-group"
49
- label-class="input-group-text"
50
- :validation-rules="{ distinct }"
51
- validation="required:trim|distinct"
52
- :validation-messages="{
53
- 'required': 'A value is required.',
54
- 'distinct': 'The values must all be different.',
55
- }"
56
- outer-class="$reset"
57
- :aria-label="'Allowed value '+(index+1)"
58
- >
59
- <template #label="context">
60
- <label :class="context.classes.label">{{ index + 1 }}</label>
61
- </template>
62
- </FormKit>
63
- <ul class="controls mt-2">
64
- <li>
65
- <button
66
- type="button"
67
- @click="values.splice(index - 1, 0, values.splice(index, 1)[0])"
68
- class="button"
69
- >
70
- <FormKitIcon icon="arrowUp"/>
71
- </button>
72
- </li>
73
- <li>
74
- <button
75
- type="button"
76
- @click="values.splice(index + 1, 0, values.splice(index, 1)[0])"
77
- class="button"
78
- >
79
- <FormKitIcon icon="arrowDown"/>
80
- </button>
81
- </li>
82
- <li>
83
- <button
84
- type="button"
85
- @click="values.splice(index, 1)"
86
- class="button close"
87
- >
88
- <FormKitIcon icon="close"/>
89
- </button>
90
- </li>
91
- </ul>
92
- </div>
93
- </div>
94
- </FormKit>
95
- </div>
96
- </template>
97
-
98
- <style scoped>
99
- .value-item {
100
- display: flex;
101
- align-items: start;
102
- margin-bottom: 0.5rem;
103
- }
104
-
105
- .value-item:deep(.formkit-outer) {
106
- margin-bottom: 0;
107
- flex-grow: 1;
108
- }
109
-
110
- .controls {
111
- list-style-type: none;
112
- margin: 0;
113
- padding: 0;
114
- display: flex;
115
- align-items: center;
116
- }
117
-
118
- .controls .button {
119
- border: none;
120
- background: none;
121
- padding: 0;
122
- margin: 0;
123
- cursor: pointer;
124
- color: #999;
125
- line-height: 1;
126
- transition: color 0.3s ease;
127
- appearance: none;
128
- font-size: 1em;
129
- color: var(--fk-color-primary);
130
- margin-left: 0.5rem;
131
- }
132
-
133
- .controls:deep(svg) {
134
- display: block;
135
- width: 1em;
136
- max-height: 1.25em;
137
- height: auto;
138
- fill: currentColor;
139
- }
140
-
141
- .controls .close {
142
- color: var(--fk-color-danger);
143
- }
144
- </style>
@@ -1,62 +0,0 @@
1
- import {
2
- outer,
3
- inner,
4
- wrapper,
5
- label,
6
- help,
7
- messages,
8
- message,
9
- icon,
10
- prefix,
11
- suffix,
12
- textInput,
13
- casts,
14
- } from '@formkit/inputs'
15
- /**
16
- * Input definition for a text.
17
- * @public
18
- */
19
- export const innerLabelTextInput = {
20
- /**
21
- * The actual schema of the input, or a function that returns the schema.
22
- */
23
- schema: outer(
24
- wrapper(
25
- inner(
26
- label('$label'),
27
- icon('prefix', 'label'),
28
- prefix(),
29
- textInput(),
30
- suffix(),
31
- icon('suffix')
32
- )
33
- ),
34
- help('$help'),
35
- messages(message('$message.value'))
36
- ),
37
- /**
38
- * The type of node, can be a list, group, or input.
39
- */
40
- type: 'input',
41
- /**
42
- * The family of inputs this one belongs too. For example "text" and "email"
43
- * are both part of the "text" family. This is primary used for styling.
44
- */
45
- family: 'text',
46
- /**
47
- * An array of extra props to accept for this input.
48
- */
49
- props: [],
50
- /**
51
- * Forces node.props.type to be this explicit value.
52
- */
53
- forceTypeProp: 'text',
54
- /**
55
- * Additional features that should be added to your input
56
- */
57
- features: [casts],
58
- /**
59
- * The key used to memoize the schema.
60
- */
61
- schemaMemoKey: 'qmwq6rtsiye',
62
- }
@@ -1,57 +0,0 @@
1
- import {
2
- outer,
3
- inner,
4
- wrapper,
5
- label,
6
- help,
7
- messages,
8
- message,
9
- prefix,
10
- suffix,
11
- icon,
12
- textareaInput,
13
- initialValue,
14
- } from '@formkit/inputs'
15
- /**
16
- * Input definition for a textarea.
17
- * @public
18
- */
19
- export const innerLabelTextareaInput = {
20
- /**
21
- * The actual schema of the input, or a function that returns the schema.
22
- */
23
- schema: outer(
24
- wrapper(
25
- inner(
26
- label('$label'),
27
- icon('prefix', 'label'),
28
- prefix(),
29
- textareaInput(),
30
- suffix(),
31
- icon('suffix')
32
- )
33
- ),
34
- help('$help'),
35
- messages(message('$message.value'))
36
- ),
37
- /**
38
- * The type of node, can be a list, group, or input.
39
- */
40
- type: 'input',
41
- /**
42
- * An array of extra props to accept for this input.
43
- */
44
- props: [],
45
- /**
46
- * Forces node.props.type to be this explicit value.
47
- */
48
- forceTypeProp: 'textarea',
49
- /**
50
- * Additional features that should be added to your input
51
- */
52
- features: [initialValue],
53
- /**
54
- * The key used to memoize the schema.
55
- */
56
- schemaMemoKey: 'zq0nltggno',
57
- }
@@ -1,76 +0,0 @@
1
- import {
2
- outer,
3
- inner,
4
- wrapper,
5
- label,
6
- help,
7
- messages,
8
- message,
9
- prefix,
10
- suffix,
11
- icon,
12
- selectInput,
13
- option,
14
- optionSlot,
15
- optGroup,
16
- $if,
17
- options,
18
- selects,
19
- defaultIcon,
20
- } from '@formkit/inputs'
21
- /**
22
- * Input definition for a select.
23
- * @public
24
- */
25
- export const selectInputGroup = {
26
- /**
27
- * The actual schema of the input, or a function that returns the schema.
28
- */
29
- schema: outer(
30
- wrapper(
31
- inner(
32
- label('$label'),
33
- icon('prefix'),
34
- prefix(),
35
- selectInput(
36
- $if(
37
- '$slots.default',
38
- () => '$slots.default',
39
- optionSlot(
40
- $if(
41
- '$option.group',
42
- optGroup(optionSlot(option('$option.label'))),
43
- option('$option.label')
44
- )
45
- )
46
- )
47
- ),
48
- $if('$attrs.multiple !== undefined', () => '', icon('select')),
49
- suffix(),
50
- icon('suffix')
51
- )
52
- ),
53
- help('$help'),
54
- messages(message('$message.value'))
55
- ),
56
- /**
57
- * The type of node, can be a list, group, or input.
58
- */
59
- type: 'input',
60
- /**
61
- * An array of extra props to accept for this input.
62
- */
63
- props: ['options', 'placeholder', 'optionsLoader'],
64
- /**
65
- * Forces node.props.type to be this explicit value.
66
- */
67
- forceTypeProp: 'select',
68
- /**
69
- * Additional features that should be added to your input
70
- */
71
- features: [options, selects, defaultIcon('select', 'select')],
72
- /**
73
- * The key used to memoize the schema.
74
- */
75
- schemaMemoKey: 'at63zamx5wg',
76
- }