@pie-element/extended-text-entry 15.1.2-next.2 → 15.1.2
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/CHANGELOG.json +1282 -0
- package/CHANGELOG.md +2270 -0
- package/LICENSE.md +5 -0
- package/README.md +1 -0
- package/configure/CHANGELOG.json +922 -0
- package/configure/CHANGELOG.md +1959 -0
- package/configure/lib/defaults.js +224 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +125 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +247 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/package.json +23 -0
- package/controller/CHANGELOG.json +362 -0
- package/controller/CHANGELOG.md +1183 -0
- package/controller/lib/defaults.js +91 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +101 -0
- package/controller/lib/index.js.map +1 -0
- package/controller/package.json +16 -0
- package/docs/config-schema.json +1782 -0
- package/docs/config-schema.json.md +1333 -0
- package/docs/demo/config.js +7 -0
- package/docs/demo/generate.js +14 -0
- package/docs/demo/index.html +3 -0
- package/docs/demo/session.js +7 -0
- package/docs/pie-schema.json +954 -0
- package/docs/pie-schema.json.md +717 -0
- package/lib/annotation/annotation-editor.js +636 -0
- package/lib/annotation/annotation-editor.js.map +1 -0
- package/lib/annotation/annotation-menu.js +147 -0
- package/lib/annotation/annotation-menu.js.map +1 -0
- package/lib/annotation/annotation-utils.js +205 -0
- package/lib/annotation/annotation-utils.js.map +1 -0
- package/lib/annotation/freeform-editor.js +241 -0
- package/lib/annotation/freeform-editor.js.map +1 -0
- package/lib/index.js +108 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +205 -0
- package/lib/main.js.map +1 -0
- package/lib/print.js +86 -0
- package/lib/print.js.map +1 -0
- package/module/configure.js +1 -0
- package/module/controller.js +139 -0
- package/module/demo.js +38 -0
- package/module/element.js +1 -0
- package/module/index.html +21 -0
- package/module/manifest.json +22 -0
- package/module/print-demo.js +76 -0
- package/module/print.html +18 -0
- package/module/print.js +1 -0
- package/package.json +22 -87
- package/configure.js +0 -2
- package/controller.js +0 -1
- package/dist/author/defaults.d.ts +0 -166
- package/dist/author/defaults.js +0 -209
- package/dist/author/index.d.ts +0 -52
- package/dist/author/index.js +0 -74
- package/dist/author/main.d.ts +0 -26
- package/dist/author/main.js +0 -166
- package/dist/browser/author/index.js +0 -495
- package/dist/browser/author/index.js.map +0 -1
- package/dist/browser/browser-kkT1XVKw.js +0 -219
- package/dist/browser/browser-kkT1XVKw.js.map +0 -1
- package/dist/browser/controller/index.js +0 -184
- package/dist/browser/controller/index.js.map +0 -1
- package/dist/browser/delivery/index.js +0 -98
- package/dist/browser/delivery/index.js.map +0 -1
- package/dist/browser/dist-BCJzhghM.js +0 -47879
- package/dist/browser/dist-BCJzhghM.js.map +0 -1
- package/dist/browser/extended-text-entry.css +0 -2
- package/dist/browser/main-VcQEFn-b.js +0 -714
- package/dist/browser/main-VcQEFn-b.js.map +0 -1
- package/dist/browser/print/index.js +0 -48
- package/dist/browser/print/index.js.map +0 -1
- package/dist/controller/defaults.d.ts +0 -33
- package/dist/controller/defaults.js +0 -104
- package/dist/controller/index.d.ts +0 -59
- package/dist/controller/index.js +0 -72
- package/dist/delivery/annotation/annotation-editor.d.ts +0 -47
- package/dist/delivery/annotation/annotation-editor.js +0 -296
- package/dist/delivery/annotation/annotation-menu.d.ts +0 -25
- package/dist/delivery/annotation/annotation-menu.js +0 -113
- package/dist/delivery/annotation/annotation-utils.d.ts +0 -20
- package/dist/delivery/annotation/annotation-utils.js +0 -65
- package/dist/delivery/annotation/freeform-editor.d.ts +0 -30
- package/dist/delivery/annotation/freeform-editor.js +0 -143
- package/dist/delivery/index.d.ts +0 -23
- package/dist/delivery/index.js +0 -68
- package/dist/delivery/main.d.ts +0 -27
- package/dist/delivery/main.js +0 -134
- package/dist/extended-text-entry.css +0 -2
- package/dist/index.d.ts +0 -1
- package/dist/index.iife.d.ts +0 -8
- package/dist/index.iife.js +0 -403
- package/dist/index.js +0 -2
- package/dist/print/index.d.ts +0 -15
- package/dist/print/index.js +0 -48
- package/dist/runtime-support.d.ts +0 -12
- package/dist/runtime-support.js +0 -12
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _default = exports.default = {
|
|
8
|
+
annotationsEnabled: false,
|
|
9
|
+
dimensions: {
|
|
10
|
+
height: 100,
|
|
11
|
+
width: 500
|
|
12
|
+
},
|
|
13
|
+
equationEditor: 'Grade 8 - HS',
|
|
14
|
+
feedbackEnabled: false,
|
|
15
|
+
mathInput: false,
|
|
16
|
+
playerSpellCheckDisabled: true,
|
|
17
|
+
predefinedAnnotations: [{
|
|
18
|
+
label: 'good',
|
|
19
|
+
text: 'good',
|
|
20
|
+
type: 'positive'
|
|
21
|
+
}, {
|
|
22
|
+
label: '★',
|
|
23
|
+
text: '★',
|
|
24
|
+
type: 'positive'
|
|
25
|
+
}, {
|
|
26
|
+
label: ':-)',
|
|
27
|
+
text: ':-)',
|
|
28
|
+
type: 'positive'
|
|
29
|
+
}, {
|
|
30
|
+
label: 'creative',
|
|
31
|
+
text: 'creative',
|
|
32
|
+
type: 'positive'
|
|
33
|
+
}, {
|
|
34
|
+
label: 'run-on',
|
|
35
|
+
text: 'run-on',
|
|
36
|
+
type: 'negative'
|
|
37
|
+
}, {
|
|
38
|
+
label: 'frag',
|
|
39
|
+
text: 'fragment',
|
|
40
|
+
type: 'negative'
|
|
41
|
+
}, {
|
|
42
|
+
label: 'tran',
|
|
43
|
+
text: 'transition',
|
|
44
|
+
type: 'negative'
|
|
45
|
+
}, {
|
|
46
|
+
label: 'supp',
|
|
47
|
+
text: 'support needed',
|
|
48
|
+
type: 'negative'
|
|
49
|
+
}, {
|
|
50
|
+
label: 'punc',
|
|
51
|
+
text: 'punctuation',
|
|
52
|
+
type: 'negative'
|
|
53
|
+
}, {
|
|
54
|
+
label: 'agr',
|
|
55
|
+
text: 'agreement wrong',
|
|
56
|
+
type: 'negative'
|
|
57
|
+
}, {
|
|
58
|
+
label: 'unclear',
|
|
59
|
+
text: 'unclear',
|
|
60
|
+
type: 'negative'
|
|
61
|
+
}, {
|
|
62
|
+
label: 'cut',
|
|
63
|
+
text: 'cut',
|
|
64
|
+
type: 'negative'
|
|
65
|
+
}, {
|
|
66
|
+
label: 'sp',
|
|
67
|
+
text: 'spelling',
|
|
68
|
+
type: 'negative'
|
|
69
|
+
}, {
|
|
70
|
+
label: 'cap',
|
|
71
|
+
text: 'capitalization',
|
|
72
|
+
type: 'negative'
|
|
73
|
+
}, {
|
|
74
|
+
label: 'inf',
|
|
75
|
+
text: 'informal',
|
|
76
|
+
type: 'negative'
|
|
77
|
+
}, {
|
|
78
|
+
label: 'awk',
|
|
79
|
+
text: 'awkward',
|
|
80
|
+
type: 'negative'
|
|
81
|
+
}],
|
|
82
|
+
prompt: '',
|
|
83
|
+
promptEnabled: true,
|
|
84
|
+
rationale: '',
|
|
85
|
+
rationaleEnabled: true,
|
|
86
|
+
studentInstructionsEnabled: true,
|
|
87
|
+
teacherInstructions: '',
|
|
88
|
+
teacherInstructionsEnabled: true,
|
|
89
|
+
toolbarEditorPosition: 'bottom'
|
|
90
|
+
};
|
|
91
|
+
//# sourceMappingURL=defaults.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["annotationsEnabled","dimensions","height","width","equationEditor","feedbackEnabled","mathInput","playerSpellCheckDisabled","predefinedAnnotations","label","text","type","prompt","promptEnabled","rationale","rationaleEnabled","studentInstructionsEnabled","teacherInstructions","teacherInstructionsEnabled","toolbarEditorPosition"],"sources":["../src/defaults.js"],"sourcesContent":["export default {\n annotationsEnabled: false,\n dimensions: { height: 100, width: 500 },\n equationEditor: 'Grade 8 - HS',\n feedbackEnabled: false,\n mathInput: false,\n playerSpellCheckDisabled: true,\n predefinedAnnotations: [\n { label: 'good', text: 'good', type: 'positive' },\n { label: '★', text: '★', type: 'positive' },\n { label: ':-)', text: ':-)', type: 'positive' },\n { label: 'creative', text: 'creative', type: 'positive' },\n { label: 'run-on', text: 'run-on', type: 'negative' },\n { label: 'frag', text: 'fragment', type: 'negative' },\n { label: 'tran', text: 'transition', type: 'negative' },\n { label: 'supp', text: 'support needed', type: 'negative' },\n { label: 'punc', text: 'punctuation', type: 'negative' },\n { label: 'agr', text: 'agreement wrong', type: 'negative' },\n { label: 'unclear', text: 'unclear', type: 'negative' },\n { label: 'cut', text: 'cut', type: 'negative' },\n { label: 'sp', text: 'spelling', type: 'negative' },\n { label: 'cap', text: 'capitalization', type: 'negative' },\n { label: 'inf', text: 'informal', type: 'negative' },\n { label: 'awk', text: 'awkward', type: 'negative' },\n ],\n prompt: '',\n promptEnabled: true,\n rationale: '',\n rationaleEnabled: true,\n studentInstructionsEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n toolbarEditorPosition: 'bottom',\n};\n"],"mappings":";;;;;;iCAAe;EACbA,kBAAkB,EAAE,KAAK;EACzBC,UAAU,EAAE;IAAEC,MAAM,EAAE,GAAG;IAAEC,KAAK,EAAE;EAAI,CAAC;EACvCC,cAAc,EAAE,cAAc;EAC9BC,eAAe,EAAE,KAAK;EACtBC,SAAS,EAAE,KAAK;EAChBC,wBAAwB,EAAE,IAAI;EAC9BC,qBAAqB,EAAE,CACrB;IAAEC,KAAK,EAAE,MAAM;IAAEC,IAAI,EAAE,MAAM;IAAEC,IAAI,EAAE;EAAW,CAAC,EACjD;IAAEF,KAAK,EAAE,GAAG;IAAEC,IAAI,EAAE,GAAG;IAAEC,IAAI,EAAE;EAAW,CAAC,EAC3C;IAAEF,KAAK,EAAE,KAAK;IAAEC,IAAI,EAAE,KAAK;IAAEC,IAAI,EAAE;EAAW,CAAC,EAC/C;IAAEF,KAAK,EAAE,UAAU;IAAEC,IAAI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B,EAAE,IAAI;EAChCC,mBAAmB,EAAE,EAAE;EACvBC,0BAA0B,EAAE,IAAI;EAChCC,qBAAqB,EAAE;AACzB,CAAC","ignoreList":[]}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createDefaultModel = createDefaultModel;
|
|
8
|
+
exports.model = model;
|
|
9
|
+
exports.normalize = void 0;
|
|
10
|
+
exports.outcome = outcome;
|
|
11
|
+
exports.validate = void 0;
|
|
12
|
+
var _debug = _interopRequireDefault(require("debug"));
|
|
13
|
+
var _feedback = require("@pie-lib/feedback");
|
|
14
|
+
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
15
|
+
const log = (0, _debug.default)('@pie-element:extended-text-entry:controller');
|
|
16
|
+
async function createDefaultModel(model = {}) {
|
|
17
|
+
log('[createDefaultModel]', model);
|
|
18
|
+
return {
|
|
19
|
+
..._defaults.default,
|
|
20
|
+
...model
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
const normalize = question => ({
|
|
24
|
+
..._defaults.default,
|
|
25
|
+
...question
|
|
26
|
+
});
|
|
27
|
+
exports.normalize = normalize;
|
|
28
|
+
async function model(question, session, env) {
|
|
29
|
+
log('[question]', question);
|
|
30
|
+
const normalizedQuestion = normalize(question);
|
|
31
|
+
const fb = env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled ? (0, _feedback.getFeedback)(normalizedQuestion.feedback, 'Your answer has been submitted') : Promise.resolve(undefined);
|
|
32
|
+
let teacherInstructions = null;
|
|
33
|
+
if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {
|
|
34
|
+
teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;
|
|
35
|
+
} else {
|
|
36
|
+
teacherInstructions = null;
|
|
37
|
+
}
|
|
38
|
+
let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';
|
|
39
|
+
switch (normalizedQuestion.equationEditor) {
|
|
40
|
+
case 'Grade 1 - 2':
|
|
41
|
+
equationEditor = 1;
|
|
42
|
+
break;
|
|
43
|
+
case 'Grade 3 - 5':
|
|
44
|
+
equationEditor = 3;
|
|
45
|
+
break;
|
|
46
|
+
case 'Grade 6 - 7':
|
|
47
|
+
equationEditor = 6;
|
|
48
|
+
break;
|
|
49
|
+
case 'Grade 8 - HS':
|
|
50
|
+
equationEditor = 8;
|
|
51
|
+
break;
|
|
52
|
+
default:
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');
|
|
56
|
+
return fb.then(feedback => ({
|
|
57
|
+
prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,
|
|
58
|
+
dimensions: normalizedQuestion.dimensions,
|
|
59
|
+
customKeys: normalizedQuestion.customKeys || [],
|
|
60
|
+
id: normalizedQuestion.id,
|
|
61
|
+
disabled: env.mode !== 'gather',
|
|
62
|
+
feedback,
|
|
63
|
+
teacherInstructions,
|
|
64
|
+
language: normalizedQuestion.language,
|
|
65
|
+
mathInput: normalizedQuestion.mathInput,
|
|
66
|
+
spanishInput: normalizedQuestion.spanishInput,
|
|
67
|
+
specialInput: normalizedQuestion.specialInput,
|
|
68
|
+
equationEditor,
|
|
69
|
+
spellCheckEnabled: !normalizedQuestion.playerSpellCheckDisabled,
|
|
70
|
+
playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',
|
|
71
|
+
annotatorMode,
|
|
72
|
+
disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,
|
|
73
|
+
predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],
|
|
74
|
+
extraCSSRules: normalizedQuestion.extraCSSRules
|
|
75
|
+
}));
|
|
76
|
+
}
|
|
77
|
+
async function outcome(/*question, session, env*/
|
|
78
|
+
) {
|
|
79
|
+
return {
|
|
80
|
+
score: 0,
|
|
81
|
+
completed: 'n/a',
|
|
82
|
+
note: 'Requires manual scoring'
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// remove all html tags
|
|
87
|
+
const getInnerText = html => (html || '').replaceAll(/<[^>]*>/g, '');
|
|
88
|
+
|
|
89
|
+
// remove all html tags except img, iframe and source tag for audio
|
|
90
|
+
const getContent = html => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
91
|
+
const validate = (model = {}, config = {}) => {
|
|
92
|
+
const errors = {};
|
|
93
|
+
['teacherInstructions', 'prompt'].forEach(field => {
|
|
94
|
+
if (config[field]?.required && !getContent(model[field])) {
|
|
95
|
+
errors[field] = 'This field is required.';
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return errors;
|
|
99
|
+
};
|
|
100
|
+
exports.validate = validate;
|
|
101
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_debug","_interopRequireDefault","require","_feedback","_defaults","log","debug","createDefaultModel","model","defaults","normalize","question","exports","session","env","normalizedQuestion","fb","mode","feedbackEnabled","getFeedback","feedback","Promise","resolve","undefined","teacherInstructions","role","teacherInstructionsEnabled","equationEditor","annotatorMode","annotationsEnabled","then","prompt","promptEnabled","dimensions","customKeys","id","disabled","language","mathInput","spanishInput","specialInput","spellCheckEnabled","playerSpellCheckDisabled","playersToolbarPosition","disabledAnnotator","predefinedAnnotations","extraCSSRules","outcome","score","completed","note","getInnerText","html","replaceAll","getContent","replace","validate","config","errors","forEach","field","required"],"sources":["../src/index.js"],"sourcesContent":["import debug from 'debug';\nimport { getFeedback } from '@pie-lib/feedback';\nimport defaults from './defaults';\n\nconst log = debug('@pie-element:extended-text-entry:controller');\n\nexport async function createDefaultModel(model = {}) {\n log('[createDefaultModel]', model);\n\n return { ...defaults, ...model };\n}\n\nexport const normalize = (question) => ({ ...defaults, ...question });\n\nexport async function model(question, session, env) {\n log('[question]', question);\n const normalizedQuestion = normalize(question);\n\n const fb =\n env.mode === 'evaluate' && normalizedQuestion.feedbackEnabled\n ? getFeedback(normalizedQuestion.feedback, 'Your answer has been submitted')\n : Promise.resolve(undefined);\n\n let teacherInstructions = null;\n if (env.role === 'instructor' && (env.mode === 'view' || env.mode === 'evaluate')) {\n teacherInstructions = normalizedQuestion.teacherInstructionsEnabled ? normalizedQuestion.teacherInstructions : null;\n } else {\n teacherInstructions = null;\n }\n\n let equationEditor = normalizedQuestion.equationEditor || 'miscellaneous';\n\n switch (normalizedQuestion.equationEditor) {\n case 'Grade 1 - 2':\n equationEditor = 1;\n break;\n case 'Grade 3 - 5':\n equationEditor = 3;\n break;\n case 'Grade 6 - 7':\n equationEditor = 6;\n break;\n case 'Grade 8 - HS':\n equationEditor = 8;\n break;\n default:\n break;\n }\n\n const annotatorMode = normalizedQuestion.annotationsEnabled && (env.role === 'instructor' || env.mode === 'evaluate');\n\n return fb.then((feedback) => ({\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n dimensions: normalizedQuestion.dimensions,\n customKeys: normalizedQuestion.customKeys || [],\n id: normalizedQuestion.id,\n disabled: env.mode !== 'gather',\n feedback,\n teacherInstructions,\n language: normalizedQuestion.language,\n mathInput: normalizedQuestion.mathInput,\n spanishInput: normalizedQuestion.spanishInput,\n specialInput: normalizedQuestion.specialInput,\n equationEditor,\n spellCheckEnabled: !normalizedQuestion.playerSpellCheckDisabled,\n playersToolbarPosition: normalizedQuestion.playersToolbarPosition || 'bottom',\n annotatorMode,\n disabledAnnotator: normalizedQuestion.annotationsEnabled ? env.role !== 'instructor' : true,\n predefinedAnnotations: normalizedQuestion.annotationsEnabled ? normalizedQuestion.predefinedAnnotations : [],\n extraCSSRules: normalizedQuestion.extraCSSRules,\n }));\n}\n\nexport async function outcome(/*question, session, env*/) {\n return {\n score: 0,\n completed: 'n/a',\n note: 'Requires manual scoring',\n };\n}\n\n// remove all html tags\nconst getInnerText = (html) => (html || '').replaceAll(/<[^>]*>/g, '');\n\n// remove all html tags except img, iframe and source tag for audio\nconst getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n ['teacherInstructions', 'prompt'].forEach((field) => {\n if (config[field]?.required && !getContent(model[field])) {\n errors[field] = 'This field is required.';\n }\n });\n\n return errors;\n};\n"],"mappings":";;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AAEA,MAAMG,GAAG,GAAG,IAAAC,cAAK,EAAC,6CAA6C,CAAC;AAEzD,eAAeC,kBAAkBA,CAACC,KAAK,GAAG,CAAC,CAAC,EAAE;EACnDH,GAAG,CAAC,sBAAsB,EAAEG,KAAK,CAAC;EAElC,OAAO;IAAE,GAAGC,iBAAQ;IAAE,GAAGD;EAAM,CAAC;AAClC;AAEO,MAAME,SAAS,GAAIC,QAAQ,KAAM;EAAE,GAAGF,iBAAQ;EAAE,GAAGE;AAAS,CAAC,CAAC;AAACC,OAAA,CAAAF,SAAA,GAAAA,SAAA;AAE/D,eAAeF,KAAKA,CAACG,QAAQ,EAAEE,OAAO,EAAEC,GAAG,EAAE;EAClDT,GAAG,CAAC,YAAY,EAAEM,QAAQ,CAAC;EAC3B,MAAMI,kBAAkB,GAAGL,SAAS,CAACC,QAAQ,CAAC;EAE9C,MAAMK,EAAE,GACNF,GAAG,CAACG,IAAI,KAAK,UAAU,IAAIF,kBAAkB,CAACG,eAAe,GACzD,IAAAC,qBAAW,EAACJ,kBAAkB,CAACK,QAAQ,EAAE,gCAAgC,CAAC,GAC1EC,OAAO,CAACC,OAAO,CAAC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F,OAAOF,MAAM;AACf,CAAC;AAAC9C,OAAA,CAAA4C,QAAA,GAAAA,QAAA","ignoreList":[]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pie-element/extended-text-entry-controller",
|
|
3
|
+
"private": true,
|
|
4
|
+
"version": "9.1.1",
|
|
5
|
+
"description": "",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"module": "src/index.js",
|
|
8
|
+
"dependencies": {
|
|
9
|
+
"@pie-lib/feedback": "2.0.2"
|
|
10
|
+
},
|
|
11
|
+
"scripts": {
|
|
12
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
|
13
|
+
},
|
|
14
|
+
"author": "",
|
|
15
|
+
"license": "ISC"
|
|
16
|
+
}
|