@pie-element/likert 3.0.0-next.42 → 3.1.0-next.0
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/configure/lib/defaults.js +3 -0
- package/configure/lib/defaults.js.map +1 -1
- package/configure/lib/index.js +5 -5
- package/configure/lib/index.js.map +1 -1
- package/configure/lib/main.js +2 -2
- package/configure/lib/main.js.map +1 -1
- package/configure/package.json +6 -6
- package/controller/package.json +2 -2
- package/package.json +11 -8
- package/module/configure.js +0 -1
- package/module/controller.js +0 -77
- package/module/demo.js +0 -47
- package/module/element.js +0 -1
- package/module/index.html +0 -21
- package/module/manifest.json +0 -14
- package/module/print-demo.js +0 -85
- package/module/print.html +0 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","names":["_default","exports","default","model","choices","likertOrientation","likertScale","likertType","prompt","promptEnabled","teacherInstructions","teacherInstructionsEnabled","configuration","baseInputConfiguration","
|
|
1
|
+
{"version":3,"file":"defaults.js","names":["_default","exports","default","model","choices","likertOrientation","likertScale","likertType","prompt","promptEnabled","teacherInstructions","teacherInstructionsEnabled","configuration","baseInputConfiguration","h3","disabled","audio","video","image","textAlign","showParagraphs","separateParagraphs","settings","label","inputConfiguration","required","settingsPanelDisabled","spellCheck","enabled","likertChoice"],"sources":["../src/defaults.js"],"sourcesContent":["/** NOTE: teacherInstructions, studentInstructions, rationale & scoringType\n * functionalities are not defined yet - the value for those can belong to\n * model or to configure\n */\nexport default {\n model: {\n choices: [],\n likertOrientation: 'horizontal',\n likertScale: 'likert3',\n likertType: 'agreement',\n prompt: '',\n promptEnabled: true,\n teacherInstructions: '',\n teacherInstructionsEnabled: true,\n },\n configuration: {\n baseInputConfiguration: {\n h3: { disabled: true },\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n textAlign: { disabled: true },\n showParagraphs: { disabled: false },\n separateParagraphs: { disabled: true },\n },\n prompt: {\n settings: true,\n label: 'Prompt',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n settingsPanelDisabled: false,\n spellCheck: {\n label: 'Spellcheck',\n settings: false,\n enabled: true,\n },\n teacherInstructions: {\n settings: true,\n label: 'Teacher Instructions',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n required: false,\n },\n likertChoice: {\n label: 'Choice',\n inputConfiguration: {\n audio: { disabled: false },\n video: { disabled: false },\n image: { disabled: false },\n },\n },\n },\n};\n"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AAHA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAIe;EACbC,KAAK,EAAE;IACLC,OAAO,EAAE,EAAE;IACXC,iBAAiB,EAAE,YAAY;IAC/BC,WAAW,EAAE,SAAS;IACtBC,UAAU,EAAE,WAAW;IACvBC,MAAM,EAAE,EAAE;IACVC,aAAa,EAAE,IAAI;IACnBC,mBAAmB,EAAE,EAAE;IACvBC,0BAA0B,EAAE;EAC9B,CAAC;EACDC,aAAa,EAAE;IACbC,sBAAsB,EAAE;MACtBC,EAAE,EAAE;QAAEC,QAAQ,EAAE;MAAK,CAAC;MACtBC,KAAK,EAAE;QAAED,QAAQ,EAAE;MAAM,CAAC;MAC1BE,KAAK,EAAE;QAAEF,QAAQ,EAAE;MAAM,CAAC;MAC1BG,KAAK,EAAE;QAAEH,QAAQ,EAAE;MAAM,CAAC;MAC1BI,SAAS,EAAE;QAAEJ,QAAQ,EAAE;MAAK,CAAC;MAC7BK,cAAc,EAAE;QAAEL,QAAQ,EAAE;MAAM,CAAC;MACnCM,kBAAkB,EAAE;QAAEN,QAAQ,EAAE;MAAK;IACvC,CAAC;IACDP,MAAM,EAAE;MACNc,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE,QAAQ;MACfC,kBAAkB,EAAE;QAClBR,KAAK,EAAE;UAAED,QAAQ,EAAE;QAAM,CAAC;QAC1BE,KAAK,EAAE;UAAEF,QAAQ,EAAE;QAAM,CAAC;QAC1BG,KAAK,EAAE;UAAEH,QAAQ,EAAE;QAAM;MAC3B,CAAC;MACDU,QAAQ,EAAE;IACZ,CAAC;IACDC,qBAAqB,EAAE,KAAK;IAC5BC,UAAU,EAAE;MACVJ,KAAK,EAAE,YAAY;MACnBD,QAAQ,EAAE,KAAK;MACfM,OAAO,EAAE;IACX,CAAC;IACDlB,mBAAmB,EAAE;MACnBY,QAAQ,EAAE,IAAI;MACdC,KAAK,EAAE,sBAAsB;MAC7BC,kBAAkB,EAAE;QAClBR,KAAK,EAAE;UAAED,QAAQ,EAAE;QAAM,CAAC;QAC1BE,KAAK,EAAE;UAAEF,QAAQ,EAAE;QAAM,CAAC;QAC1BG,KAAK,EAAE;UAAEH,QAAQ,EAAE;QAAM;MAC3B,CAAC;MACDU,QAAQ,EAAE;IACZ,CAAC;IACDI,YAAY,EAAE;MACZN,KAAK,EAAE,QAAQ;MACfC,kBAAkB,EAAE;QAClBR,KAAK,EAAE;UAAED,QAAQ,EAAE;QAAM,CAAC;QAC1BE,KAAK,EAAE;UAAEF,QAAQ,EAAE;QAAM,CAAC;QAC1BG,KAAK,EAAE;UAAEH,QAAQ,EAAE;QAAM;MAC3B;IACF;EACF;AACF,CAAC","ignoreList":[]}
|
package/configure/lib/index.js
CHANGED
|
@@ -11,11 +11,11 @@ var _client = require("react-dom/client");
|
|
|
11
11
|
var _debug = _interopRequireDefault(require("debug"));
|
|
12
12
|
var _pieConfigureEvents = require("@pie-framework/pie-configure-events");
|
|
13
13
|
var _main = _interopRequireDefault(require("./main"));
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var _lodashEs = require("lodash-es");
|
|
15
|
+
var _defaults = _interopRequireDefault(require("./defaults"));
|
|
16
16
|
const log = (0, _debug.default)('likert:configure');
|
|
17
17
|
const prepareCustomizationObject = (config, model) => {
|
|
18
|
-
const configuration = (0,
|
|
18
|
+
const configuration = (0, _lodashEs.defaults)(config, _defaults.default.configuration);
|
|
19
19
|
return {
|
|
20
20
|
configuration,
|
|
21
21
|
model
|
|
@@ -26,7 +26,7 @@ class Likert extends HTMLElement {
|
|
|
26
26
|
super();
|
|
27
27
|
this._root = null;
|
|
28
28
|
this._model = Likert.createDefaultModel();
|
|
29
|
-
this._configuration =
|
|
29
|
+
this._configuration = _defaults.default.configuration;
|
|
30
30
|
this.onModelChanged = this.onModelChanged.bind(this);
|
|
31
31
|
this.onConfigurationChanged = this.onConfigurationChanged.bind(this);
|
|
32
32
|
}
|
|
@@ -99,7 +99,7 @@ class Likert extends HTMLElement {
|
|
|
99
99
|
}
|
|
100
100
|
exports.default = Likert;
|
|
101
101
|
(0, _defineProperty2.default)(Likert, "createDefaultModel", (model = {}) => ({
|
|
102
|
-
...
|
|
102
|
+
..._defaults.default.model,
|
|
103
103
|
...model,
|
|
104
104
|
choices: model && model.choices || []
|
|
105
105
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_debug","_pieConfigureEvents","_main","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_client","_debug","_pieConfigureEvents","_main","_lodashEs","_defaults","log","debug","prepareCustomizationObject","config","model","configuration","defaults","sensibleDefaults","Likert","HTMLElement","constructor","_root","_model","createDefaultModel","_configuration","onModelChanged","bind","onConfigurationChanged","s","choices","map","choice","value","parseInt","_render","c","info","disableSidePanel","_disableSidePanel","dispatchModelUpdated","reset","resetValue","dispatchEvent","ModelUpdatedEvent","m","insertSound","handler","InsertSoundEvent","onDeleteSound","src","done","DeleteSoundEvent","element","React","createElement","Main","uploadSoundSupport","add","delete","createRoot","render","disconnectedCallback","unmount","exports","default","_defineProperty2"],"sources":["../src/index.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\nimport { ModelUpdatedEvent, InsertSoundEvent, DeleteSoundEvent } from '@pie-framework/pie-configure-events';\n\nimport Main from './main';\nimport { defaults } from 'lodash-es';\n\nimport sensibleDefaults from './defaults';\n\nconst log = debug('likert:configure');\n\nconst prepareCustomizationObject = (config, model) => {\n const configuration = defaults(config, sensibleDefaults.configuration);\n\n return {\n configuration,\n model,\n };\n};\n\nexport default class Likert extends HTMLElement {\n static createDefaultModel = (model = {}) => ({\n ...sensibleDefaults.model,\n ...model,\n choices: (model && model.choices) || [],\n });\n\n constructor() {\n super();\n this._root = null;\n this._model = Likert.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n this.onModelChanged = this.onModelChanged.bind(this);\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(s) {\n this._model = Likert.createDefaultModel(s);\n this._model = {\n ...this._model,\n choices: this._model.choices.map((choice) => ({ ...choice, value: parseInt(choice.value) })),\n };\n this._render();\n }\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n\n this.onModelChanged(info.model);\n this._configuration = info.configuration;\n this._render();\n }\n\n set disableSidePanel(s) {\n this._disableSidePanel = s;\n this._render();\n }\n\n dispatchModelUpdated(reset) {\n const resetValue = !!reset;\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model, resetValue));\n }\n\n onModelChanged(m, reset) {\n this._model = m;\n this._render();\n this.dispatchModelUpdated(reset);\n }\n\n onConfigurationChanged(c) {\n this._configuration = prepareCustomizationObject(c, this._model).configuration;\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this._render();\n }\n\n insertSound(handler) {\n this.dispatchEvent(new InsertSoundEvent(handler));\n }\n\n onDeleteSound(src, done) {\n this.dispatchEvent(new DeleteSoundEvent(src, done));\n }\n\n _render() {\n log('_render');\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n disableSidePanel: this._disableSidePanel,\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAEA,IAAAI,KAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAL,OAAA;AAEA,IAAAM,SAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,MAAMO,GAAG,GAAG,IAAAC,cAAK,EAAC,kBAAkB,CAAC;AAErC,MAAMC,0BAA0B,GAAGA,CAACC,MAAM,EAAEC,KAAK,KAAK;EACpD,MAAMC,aAAa,GAAG,IAAAC,kBAAQ,EAACH,MAAM,EAAEI,iBAAgB,CAACF,aAAa,CAAC;EAEtE,OAAO;IACLA,aAAa;IACbD;EACF,CAAC;AACH,CAAC;AAEc,MAAMI,MAAM,SAASC,WAAW,CAAC;EAO9CC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,KAAK,GAAG,IAAI;IACjB,IAAI,CAACC,MAAM,GAAGJ,MAAM,CAACK,kBAAkB,CAAC,CAAC;IACzC,IAAI,CAACC,cAAc,GAAGP,iBAAgB,CAACF,aAAa;IACpD,IAAI,CAACU,cAAc,GAAG,IAAI,CAACA,cAAc,CAACC,IAAI,CAAC,IAAI,CAAC;IACpD,IAAI,CAACC,sBAAsB,GAAG,IAAI,CAACA,sBAAsB,CAACD,IAAI,CAAC,IAAI,CAAC;EACtE;EAEA,IAAIZ,KAAKA,CAACc,CAAC,EAAE;IACX,IAAI,CAACN,MAAM,GAAGJ,MAAM,CAACK,kBAAkB,CAACK,CAAC,CAAC;IAC1C,IAAI,CAACN,MAAM,GAAG;MACZ,GAAG,IAAI,CAACA,MAAM;MACdO,OAAO,EAAE,IAAI,CA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AO,EAAGf,KAAK,IAAIA,KAAK,CAACe,OAAO,IAAK;AACvC,CAAC,CAAC","ignoreList":[]}
|
package/configure/lib/main.js
CHANGED
|
@@ -15,7 +15,7 @@ var _RadioGroup = _interopRequireDefault(require("@mui/material/RadioGroup"));
|
|
|
15
15
|
var _FormControlLabel = _interopRequireDefault(require("@mui/material/FormControlLabel"));
|
|
16
16
|
var _configUi = require("@pie-lib/config-ui");
|
|
17
17
|
var _styles = require("@mui/material/styles");
|
|
18
|
-
var
|
|
18
|
+
var _lodashEs = require("lodash-es");
|
|
19
19
|
var _likertEntities = require("./likertEntities");
|
|
20
20
|
var _choiceGenerator = _interopRequireDefault(require("./choiceGenerator"));
|
|
21
21
|
var _renderUi = require("@pie-lib/render-ui");
|
|
@@ -347,7 +347,7 @@ class Main extends _react.default.Component {
|
|
|
347
347
|
model,
|
|
348
348
|
onModelChanged
|
|
349
349
|
} = this.props;
|
|
350
|
-
model.choices = model.choices.map(choice => (0,
|
|
350
|
+
model.choices = model.choices.map(choice => (0, _lodashEs.merge)({}, choice));
|
|
351
351
|
model.choices.splice(index, 1, choice);
|
|
352
352
|
onModelChanged(model);
|
|
353
353
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtmlTipTap","_Radio","_RadioGroup","_FormControlLabel","_configUi","_styles","_merge","_likertEntities","_choiceGenerator","_renderUi","Panel","toggle","radio","settings","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","RadioButtonsWrapper","display","flexDirection","RadioButtonsColumnHeader","color","palette","grey","fontSize","typography","LikertLabelHolder","alignItems","LikertOptionsHolder","justifyContent","LikertLabelInput","marginRight","ErrorMessage","error","main","StyledNumberTextField","NumberTextField","FlexRow","LikertValueHolder","paddingLeft","StyledEditableHtml","EditableHtml","InputFormGroupIndex","ErrorText","CustomColorRadio","Radio","tertiary","LikertOrientation","props","model","onChangeModel","onChangeLikertOrientation","e","likertOrientation","target","value","default","createElement","name","onChange","LIKERT_ORIENTATION","horizontal","control","label","vertical","LikertScale","onChangeLikertScale","likertScale","choices","generateChoices","likertType","LIKERT_SCALE","likert3","likert5","likert7","LikertType","onChangeLikertType","LIKERT_TYPE","agreement","frequency","yesNo","importance","likelihood","like","buildValuesMap","reduce","acc","choice","accClone","choiceValue","parseInt","Design","configuration","imageSupport","onChoiceChanged","onConfigurationChanged","onPromptChanged","onTeacherInstructionsChanged","uploadSoundSupport","contentDimensions","prompt","scoringType","settingsPanelDisabled","spellCheck","teacherInstructions","baseInputConfiguration","likertChoice","errors","extraCSSRules","spellCheckEnabled","teacherInstructionsEnabled","promptError","teacherInstructionsError","valuesMap","panelProperties","getPluginProps","Object","assign","layout","ConfigLayout","dimensions","hideSettings","onChangeConfiguration","groups","Properties","markup","nonEmpty","pluginProps","inputConfiguration","disableUnderline","map","index","key","c","max","min","t","Main","React","Component","constructor","args","_defineProperty2","onModelChanged","merge","splice","render","_extends2","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport Radio from '@mui/material/Radio';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { InputContainer, settings, layout, NumberTextField } from '@pie-lib/config-ui';\nimport { styled } from '@mui/material/styles';\nimport merge from 'lodash/merge';\nimport { LIKERT_TYPE, LIKERT_SCALE, LIKERT_ORIENTATION } from './likertEntities';\nimport generateChoices from './choiceGenerator';\nimport { color } from '@pie-lib/render-ui';\n\nconst { Panel, toggle, radio } = settings;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst RadioButtonsWrapper = styled('div')({\n display: 'flex',\n flexDirection: 'column',\n});\n\nconst RadioButtonsColumnHeader = styled('p')(({ theme }) => ({\n color: theme.palette.grey[400],\n fontSize: theme.typography.fontSize - 2,\n}));\n\nconst LikertLabelHolder = styled('div')(({ theme }) => ({\n display: 'flex',\n width: '100%',\n alignItems: 'flex-start',\n marginBottom: theme.spacing(2),\n}));\n\nconst LikertOptionsHolder = styled('div')(({ theme }) => ({\n display: 'flex',\n width: '100%',\n justifyContent: 'space-around',\n marginBottom: theme.spacing(2.5),\n}));\n\nconst LikertLabelInput = styled(InputContainer)({\n width: 'calc(100% - 200px)',\n marginRight: 0,\n});\n\nconst ErrorMessage = styled('p')(({ theme }) => ({\n color: theme.palette.error.main,\n fontSize: theme.typography.fontSize - 2,\n}));\n\nconst StyledNumberTextField = styled(NumberTextField)({\n width: '100%',\n});\n\nconst FlexRow = styled('div')({\n display: 'flex',\n flexDirection: 'row',\n});\n\nconst LikertValueHolder = styled('div')(({ theme }) => ({\n paddingLeft: theme.spacing(2.5),\n width: '150px',\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst InputFormGroupIndex = styled('span')(({ theme }) => ({\n width: '30px',\n paddingTop: theme.spacing(4),\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst CustomColorRadio = styled(Radio)({\n color: `${color.tertiary()} !important`,\n});\n\nconst LikertOrientation = (props) => {\n const { model, onChangeModel } = props;\n\n const onChangeLikertOrientation = (e) => {\n const likertOrientation = e.target.value;\n\n onChangeModel({ ...model, likertOrientation });\n };\n\n return (\n <RadioButtonsWrapper>\n <RadioButtonsColumnHeader>Likert Orientation</RadioButtonsColumnHeader>\n <RadioGroup\n aria-label=\"likertOrientation\"\n name=\"likertOrientation\"\n value={model.likertOrientation}\n onChange={onChangeLikertOrientation}\n >\n <FormControlLabel\n value={LIKERT_ORIENTATION.horizontal}\n control={<CustomColorRadio />}\n label=\"Horizontal\"\n />\n <FormControlLabel\n value={LIKERT_ORIENTATION.vertical}\n control={<CustomColorRadio />}\n label=\"Vertical\"\n />\n </RadioGroup>\n </RadioButtonsWrapper>\n );\n};\n\nconst LikertScale = (props) => {\n const { model, onChangeModel } = props;\n const onChangeLikertScale = (e) => {\n const likertScale = e.target.value;\n\n onChangeModel({\n ...model,\n likertScale,\n choices: generateChoices(likertScale, model.likertType),\n });\n };\n\n return (\n <RadioButtonsWrapper>\n <RadioButtonsColumnHeader>Likert Scale</RadioButtonsColumnHeader>\n <RadioGroup aria-label=\"likertScale\" name=\"likertScale\" value={model.likertScale} onChange={onChangeLikertScale}>\n <FormControlLabel\n value={LIKERT_SCALE.likert3}\n control={<CustomColorRadio />}\n label=\"Likert 3\"\n />\n <FormControlLabel\n value={LIKERT_SCALE.likert5}\n control={<CustomColorRadio />}\n label=\"Likert 5\"\n />\n <FormControlLabel\n value={LIKERT_SCALE.likert7}\n control={<CustomColorRadio />}\n label=\"Likert 7\"\n />\n </RadioGroup>\n </RadioButtonsWrapper>\n );\n};\n\nconst LikertType = (props) => {\n const { model, onChangeModel } = props;\n const onChangeLikertType = (e) => {\n const likertType = e.target.value;\n\n onChangeModel({\n ...model,\n likertType,\n choices: generateChoices(model.likertScale, likertType),\n });\n };\n\n return (\n <RadioButtonsWrapper>\n <RadioButtonsColumnHeader>Label Type</RadioButtonsColumnHeader>\n\n <FlexRow>\n <RadioGroup\n aria-label=\"likertLabelType\"\n name=\"likertLabelType\"\n value={model.likertType}\n onChange={onChangeLikertType}\n >\n <FormControlLabel\n value={LIKERT_TYPE.agreement}\n control={<CustomColorRadio />}\n label=\"Agreement\"\n />\n <FormControlLabel\n value={LIKERT_TYPE.frequency}\n control={<CustomColorRadio />}\n label=\"Frequency\"\n />\n <FormControlLabel\n value={LIKERT_TYPE.yesNo}\n control={<CustomColorRadio />}\n label=\"Yes/No\"\n />\n </RadioGroup>\n\n <RadioGroup\n aria-label=\"likertLabelType\"\n name=\"likertLabelType\"\n value={model.likertType}\n onChange={onChangeLikertType}\n >\n <FormControlLabel\n value={LIKERT_TYPE.importance}\n control={<CustomColorRadio />}\n label=\"Importance\"\n />\n <FormControlLabel\n value={LIKERT_TYPE.likelihood}\n control={<CustomColorRadio />}\n label=\"Likelihood\"\n />\n <FormControlLabel value={LIKERT_TYPE.like} control={<CustomColorRadio />} label=\"Like\" />\n </RadioGroup>\n </FlexRow>\n </RadioButtonsWrapper>\n );\n};\n\nconst buildValuesMap = (model) =>\n model.choices.reduce((acc, choice) => {\n const accClone = { ...acc };\n const choiceValue = parseInt(choice.value);\n\n if (!accClone[choiceValue]) {\n accClone[choiceValue] = 0;\n }\n\n return { ...accClone, [choiceValue]: accClone[choiceValue] + 1 };\n }, {});\n\nconst Design = (props) => {\n const {\n configuration,\n imageSupport,\n model,\n onChangeModel,\n onChoiceChanged,\n onConfigurationChanged,\n onPromptChanged,\n onTeacherInstructionsChanged,\n uploadSoundSupport,\n } = props;\n const {\n contentDimensions = {},\n prompt = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n baseInputConfiguration = {},\n likertChoice = {},\n } = configuration || {};\n const { errors = {}, extraCSSRules, spellCheckEnabled, teacherInstructionsEnabled } = model || {};\n const { prompt: promptError, teacherInstructions: teacherInstructionsError } = errors;\n\n const valuesMap = buildValuesMap(model);\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n };\n\n const getPluginProps = (props = {}) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onChangeModel}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n <PromptHolder label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={promptError}\n spellCheck={spellCheckEnabled}\n disableUnderline\n uploadSoundSupport={uploadSoundSupport}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n\n <LikertOptionsHolder>\n <LikertScale model={model} onChangeModel={onChangeModel} />\n <LikertType model={model} onChangeModel={onChangeModel} />\n <LikertOrientation model={model} onChangeModel={onChangeModel} />\n </LikertOptionsHolder>\n\n {model.choices.map((choice, index) => (\n <LikertLabelHolder key={`choice-${index}`}>\n <InputFormGroupIndex>{index + 1}.</InputFormGroupIndex>\n <LikertLabelInput key={`likert-label-${index}`} label={'Likert Label'}>\n <StyledEditableHtml\n markup={choice.label || ''}\n onChange={(c) => onChoiceChanged(index, { ...choice, label: c })}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n pluginProps={getPluginProps(likertChoice?.inputConfiguration)}\n />\n </LikertLabelInput>\n\n <LikertValueHolder>\n <StyledNumberTextField\n label={'Likert Value'}\n value={choice.value}\n max={100}\n min={-100}\n onChange={(e, t) => {\n onChoiceChanged(index, { ...choice, value: t });\n }}\n imageSupport={imageSupport}\n />\n {valuesMap[choice.value] && valuesMap[choice.value] > 1 && (\n <ErrorMessage>Value should be unique</ErrorMessage>\n )}\n </LikertValueHolder>\n </LikertLabelHolder>\n ))}\n </layout.ConfigLayout>\n );\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n onChoiceChanged = (index, choice) => {\n const { model, onModelChanged } = this.props;\n\n model.choices = model.choices.map((choice) => merge({}, choice));\n model.choices.splice(index, 1, choice);\n\n onModelChanged(model);\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({ ...this.props.model, prompt });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({ ...this.props.model, teacherInstructions });\n };\n\n render() {\n return (\n <Design\n {...this.props}\n onChangeModel={this.props.onModelChanged}\n onChoiceChanged={this.onChoiceChanged}\n onPromptChanged={this.onPromptChanged}\n onTeacherInstructionsChanged={this.onTeacherInstructionsChanged}\n />\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,iBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,MAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,eAAA,GAAAT,OAAA;AACA,IAAAU,gBAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,SAAA,GAAAX,OAAA;AAEA,MA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version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_editableHtmlTipTap","_Radio","_RadioGroup","_FormControlLabel","_configUi","_styles","_lodashEs","_likertEntities","_choiceGenerator","_renderUi","Panel","toggle","radio","settings","PromptHolder","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","RadioButtonsWrapper","display","flexDirection","RadioButtonsColumnHeader","color","palette","grey","fontSize","typography","LikertLabelHolder","alignItems","LikertOptionsHolder","justifyContent","LikertLabelInput","marginRight","ErrorMessage","error","main","StyledNumberTextField","NumberTextField","FlexRow","LikertValueHolder","paddingLeft","StyledEditableHtml","EditableHtml","InputFormGroupIndex","ErrorText","CustomColorRadio","Radio","tertiary","LikertOrientation","props","model","onChangeModel","onChangeLikertOrientation","e","likertOrientation","target","value","default","createElement","name","onChange","LIKERT_ORIENTATION","horizontal","control","label","vertical","LikertScale","onChangeLikertScale","likertScale","choices","generateChoices","likertType","LIKERT_SCALE","likert3","likert5","likert7","LikertType","onChangeLikertType","LIKERT_TYPE","agreement","frequency","yesNo","importance","likelihood","like","buildValuesMap","reduce","acc","choice","accClone","choiceValue","parseInt","Design","configuration","imageSupport","onChoiceChanged","onConfigurationChanged","onPromptChanged","onTeacherInstructionsChanged","uploadSoundSupport","contentDimensions","prompt","scoringType","settingsPanelDisabled","spellCheck","teacherInstructions","baseInputConfiguration","likertChoice","errors","extraCSSRules","spellCheckEnabled","teacherInstructionsEnabled","promptError","teacherInstructionsError","valuesMap","panelProperties","getPluginProps","Object","assign","layout","ConfigLayout","dimensions","hideSettings","onChangeConfiguration","groups","Properties","markup","nonEmpty","pluginProps","inputConfiguration","disableUnderline","map","index","key","c","max","min","t","Main","React","Component","constructor","args","_defineProperty2","onModelChanged","merge","splice","render","_extends2","exports","PropTypes","object","isRequired","disableSidePanel","bool","func","shape","add","delete","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport Radio from '@mui/material/Radio';\nimport RadioGroup from '@mui/material/RadioGroup';\nimport FormControlLabel from '@mui/material/FormControlLabel';\nimport { InputContainer, settings, layout, NumberTextField } from '@pie-lib/config-ui';\nimport { styled } from '@mui/material/styles';\nimport { merge } from 'lodash-es';\nimport { LIKERT_TYPE, LIKERT_SCALE, LIKERT_ORIENTATION } from './likertEntities';\nimport generateChoices from './choiceGenerator';\nimport { color } from '@pie-lib/render-ui';\n\nconst { Panel, toggle, radio } = settings;\n\nconst PromptHolder = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n}));\n\nconst RadioButtonsWrapper = styled('div')({\n display: 'flex',\n flexDirection: 'column',\n});\n\nconst RadioButtonsColumnHeader = styled('p')(({ theme }) => ({\n color: theme.palette.grey[400],\n fontSize: theme.typography.fontSize - 2,\n}));\n\nconst LikertLabelHolder = styled('div')(({ theme }) => ({\n display: 'flex',\n width: '100%',\n alignItems: 'flex-start',\n marginBottom: theme.spacing(2),\n}));\n\nconst LikertOptionsHolder = styled('div')(({ theme }) => ({\n display: 'flex',\n width: '100%',\n justifyContent: 'space-around',\n marginBottom: theme.spacing(2.5),\n}));\n\nconst LikertLabelInput = styled(InputContainer)({\n width: 'calc(100% - 200px)',\n marginRight: 0,\n});\n\nconst ErrorMessage = styled('p')(({ theme }) => ({\n color: theme.palette.error.main,\n fontSize: theme.typography.fontSize - 2,\n}));\n\nconst StyledNumberTextField = styled(NumberTextField)({\n width: '100%',\n});\n\nconst FlexRow = styled('div')({\n display: 'flex',\n flexDirection: 'row',\n});\n\nconst LikertValueHolder = styled('div')(({ theme }) => ({\n paddingLeft: theme.spacing(2.5),\n width: '150px',\n}));\n\nconst StyledEditableHtml = styled(EditableHtml)(({ theme }) => ({\n paddingTop: theme.spacing(2),\n}));\n\nconst InputFormGroupIndex = styled('span')(({ theme }) => ({\n width: '30px',\n paddingTop: theme.spacing(4),\n}));\n\nconst ErrorText = styled('div')(({ theme }) => ({\n fontSize: theme.typography.fontSize - 2,\n color: theme.palette.error.main,\n paddingTop: theme.spacing(1),\n}));\n\nconst CustomColorRadio = styled(Radio)({\n color: `${color.tertiary()} !important`,\n});\n\nconst LikertOrientation = (props) => {\n const { model, onChangeModel } = props;\n\n const onChangeLikertOrientation = (e) => {\n const likertOrientation = e.target.value;\n\n onChangeModel({ ...model, likertOrientation });\n };\n\n return (\n <RadioButtonsWrapper>\n <RadioButtonsColumnHeader>Likert Orientation</RadioButtonsColumnHeader>\n <RadioGroup\n aria-label=\"likertOrientation\"\n name=\"likertOrientation\"\n value={model.likertOrientation}\n onChange={onChangeLikertOrientation}\n >\n <FormControlLabel value={LIKERT_ORIENTATION.horizontal} control={<CustomColorRadio />} label=\"Horizontal\" />\n <FormControlLabel value={LIKERT_ORIENTATION.vertical} control={<CustomColorRadio />} label=\"Vertical\" />\n </RadioGroup>\n </RadioButtonsWrapper>\n );\n};\n\nconst LikertScale = (props) => {\n const { model, onChangeModel } = props;\n const onChangeLikertScale = (e) => {\n const likertScale = e.target.value;\n\n onChangeModel({\n ...model,\n likertScale,\n choices: generateChoices(likertScale, model.likertType),\n });\n };\n\n return (\n <RadioButtonsWrapper>\n <RadioButtonsColumnHeader>Likert Scale</RadioButtonsColumnHeader>\n <RadioGroup aria-label=\"likertScale\" name=\"likertScale\" value={model.likertScale} onChange={onChangeLikertScale}>\n <FormControlLabel value={LIKERT_SCALE.likert3} control={<CustomColorRadio />} label=\"Likert 3\" />\n <FormControlLabel value={LIKERT_SCALE.likert5} control={<CustomColorRadio />} label=\"Likert 5\" />\n <FormControlLabel value={LIKERT_SCALE.likert7} control={<CustomColorRadio />} label=\"Likert 7\" />\n </RadioGroup>\n </RadioButtonsWrapper>\n );\n};\n\nconst LikertType = (props) => {\n const { model, onChangeModel } = props;\n const onChangeLikertType = (e) => {\n const likertType = e.target.value;\n\n onChangeModel({\n ...model,\n likertType,\n choices: generateChoices(model.likertScale, likertType),\n });\n };\n\n return (\n <RadioButtonsWrapper>\n <RadioButtonsColumnHeader>Label Type</RadioButtonsColumnHeader>\n\n <FlexRow>\n <RadioGroup\n aria-label=\"likertLabelType\"\n name=\"likertLabelType\"\n value={model.likertType}\n onChange={onChangeLikertType}\n >\n <FormControlLabel value={LIKERT_TYPE.agreement} control={<CustomColorRadio />} label=\"Agreement\" />\n <FormControlLabel value={LIKERT_TYPE.frequency} control={<CustomColorRadio />} label=\"Frequency\" />\n <FormControlLabel value={LIKERT_TYPE.yesNo} control={<CustomColorRadio />} label=\"Yes/No\" />\n </RadioGroup>\n\n <RadioGroup\n aria-label=\"likertLabelType\"\n name=\"likertLabelType\"\n value={model.likertType}\n onChange={onChangeLikertType}\n >\n <FormControlLabel value={LIKERT_TYPE.importance} control={<CustomColorRadio />} label=\"Importance\" />\n <FormControlLabel value={LIKERT_TYPE.likelihood} control={<CustomColorRadio />} label=\"Likelihood\" />\n <FormControlLabel value={LIKERT_TYPE.like} control={<CustomColorRadio />} label=\"Like\" />\n </RadioGroup>\n </FlexRow>\n </RadioButtonsWrapper>\n );\n};\n\nconst buildValuesMap = (model) =>\n model.choices.reduce((acc, choice) => {\n const accClone = { ...acc };\n const choiceValue = parseInt(choice.value);\n\n if (!accClone[choiceValue]) {\n accClone[choiceValue] = 0;\n }\n\n return { ...accClone, [choiceValue]: accClone[choiceValue] + 1 };\n }, {});\n\nconst Design = (props) => {\n const {\n configuration,\n imageSupport,\n model,\n onChangeModel,\n onChoiceChanged,\n onConfigurationChanged,\n onPromptChanged,\n onTeacherInstructionsChanged,\n uploadSoundSupport,\n } = props;\n const {\n contentDimensions = {},\n prompt = {},\n scoringType = {},\n settingsPanelDisabled,\n spellCheck = {},\n teacherInstructions = {},\n baseInputConfiguration = {},\n likertChoice = {},\n } = configuration || {};\n const { errors = {}, extraCSSRules, spellCheckEnabled, teacherInstructionsEnabled } = model || {};\n const { prompt: promptError, teacherInstructions: teacherInstructionsError } = errors;\n\n const valuesMap = buildValuesMap(model);\n const panelProperties = {\n teacherInstructionsEnabled: teacherInstructions.settings && toggle(teacherInstructions.label),\n spellCheckEnabled: spellCheck.settings && toggle(spellCheck.label),\n scoringType: scoringType.settings && radio(scoringType.label, ['auto', 'rubric']),\n };\n\n const getPluginProps = (props = {}) => {\n return Object.assign(\n {\n ...baseInputConfiguration,\n },\n props || {},\n );\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n onChangeModel={onChangeModel}\n configuration={configuration}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Properties: panelProperties,\n }}\n />\n }\n >\n {teacherInstructionsEnabled && (\n <PromptHolder label={teacherInstructions.label}>\n <EditableHtml\n markup={model.teacherInstructions || ''}\n onChange={onTeacherInstructionsChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={teacherInstructionsError}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n pluginProps={getPluginProps(teacherInstructions?.inputConfiguration)}\n />\n {teacherInstructionsError && <ErrorText>{teacherInstructionsError}</ErrorText>}\n </PromptHolder>\n )}\n\n <PromptHolder label={prompt.label}>\n <EditableHtml\n markup={model.prompt}\n onChange={onPromptChanged}\n imageSupport={imageSupport}\n nonEmpty={false}\n error={promptError}\n spellCheck={spellCheckEnabled}\n disableUnderline\n uploadSoundSupport={uploadSoundSupport}\n pluginProps={getPluginProps(prompt?.inputConfiguration)}\n />\n {promptError && <ErrorText>{promptError}</ErrorText>}\n </PromptHolder>\n\n <LikertOptionsHolder>\n <LikertScale model={model} onChangeModel={onChangeModel} />\n <LikertType model={model} onChangeModel={onChangeModel} />\n <LikertOrientation model={model} onChangeModel={onChangeModel} />\n </LikertOptionsHolder>\n\n {model.choices.map((choice, index) => (\n <LikertLabelHolder key={`choice-${index}`}>\n <InputFormGroupIndex>{index + 1}.</InputFormGroupIndex>\n <LikertLabelInput key={`likert-label-${index}`} label={'Likert Label'}>\n <StyledEditableHtml\n markup={choice.label || ''}\n onChange={(c) => onChoiceChanged(index, { ...choice, label: c })}\n imageSupport={imageSupport}\n spellCheck={spellCheckEnabled}\n uploadSoundSupport={uploadSoundSupport}\n pluginProps={getPluginProps(likertChoice?.inputConfiguration)}\n />\n </LikertLabelInput>\n\n <LikertValueHolder>\n <StyledNumberTextField\n label={'Likert Value'}\n value={choice.value}\n max={100}\n min={-100}\n onChange={(e, t) => {\n onChoiceChanged(index, { ...choice, value: t });\n }}\n imageSupport={imageSupport}\n />\n {valuesMap[choice.value] && valuesMap[choice.value] > 1 && (\n <ErrorMessage>Value should be unique</ErrorMessage>\n )}\n </LikertValueHolder>\n </LikertLabelHolder>\n ))}\n </layout.ConfigLayout>\n );\n};\n\nexport class Main extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n disableSidePanel: PropTypes.bool,\n onModelChanged: PropTypes.func.isRequired,\n onConfigurationChanged: PropTypes.func.isRequired,\n imageSupport: PropTypes.shape({\n add: PropTypes.func.isRequired,\n delete: PropTypes.func.isRequired,\n }),\n };\n\n onChoiceChanged = (index, choice) => {\n const { model, onModelChanged } = this.props;\n\n model.choices = model.choices.map((choice) => merge({}, choice));\n model.choices.splice(index, 1, choice);\n\n onModelChanged(model);\n };\n\n onPromptChanged = (prompt) => {\n this.props.onModelChanged({ ...this.props.model, prompt });\n };\n\n onTeacherInstructionsChanged = (teacherInstructions) => {\n this.props.onModelChanged({ ...this.props.model, teacherInstructions });\n };\n\n render() {\n return (\n <Design\n {...this.props}\n onChangeModel={this.props.onModelChanged}\n onChoiceChanged={this.onChoiceChanged}\n onPromptChanged={this.onPromptChanged}\n onTeacherInstructionsChanged={this.onTeacherInstructionsChanged}\n />\n );\n }\n}\n\nexport default Main;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,mBAAA,GAAAH,sBAAA,CAA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IAAI,CAACH,UAAU;EACzCxD,sBAAsB,EAAEsD,kBAAS,CAACK,IAAI,CAACH,UAAU;EACjD1D,YAAY,EAAEwD,kBAAS,CAACM,KAAK,CAAC;IAC5BC,GAAG,EAAEP,kBAAS,CAACK,IAAI,CAACH,UAAU;IAC9BM,MAAM,EAAER,kBAAS,CAACK,IAAI,CAACH;EACzB,CAAC;AACH,CAAC;AAAA,IAAAO,QAAA,GAAAV,OAAA,CAAA5F,OAAA,GAgCYiF,IAAI","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/likert-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0-next.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"@mui/icons-material": "^7.3.4",
|
|
13
13
|
"@mui/material": "^7.3.4",
|
|
14
14
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
15
|
-
"@pie-lib/config-ui": "12.1.1-next.
|
|
16
|
-
"@pie-lib/editable-html-tip-tap": "1.1.1-next.
|
|
17
|
-
"@pie-lib/render-ui": "5.1.1-next.
|
|
15
|
+
"@pie-lib/config-ui": "12.1.1-next.3",
|
|
16
|
+
"@pie-lib/editable-html-tip-tap": "1.1.1-next.3",
|
|
17
|
+
"@pie-lib/render-ui": "5.1.1-next.1",
|
|
18
18
|
"debug": "^4.1.1",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
|
-
"react": "18.
|
|
21
|
-
"react-dom": "18.
|
|
20
|
+
"react": "18.3.1",
|
|
21
|
+
"react-dom": "18.3.1"
|
|
22
22
|
},
|
|
23
23
|
"scripts": {
|
|
24
24
|
"test": "./node_modules/.bin/jest"
|
package/controller/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/likert-controller",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "2.
|
|
4
|
+
"version": "2.1.0-next.0",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"debug": "^4.1.1",
|
|
13
|
-
"lodash": "^4.17.
|
|
13
|
+
"lodash-es": "^4.17.23"
|
|
14
14
|
},
|
|
15
15
|
"author": "",
|
|
16
16
|
"license": "ISC"
|
package/package.json
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/likert",
|
|
3
|
+
"repository": {
|
|
4
|
+
"type": "git",
|
|
5
|
+
"url": "https://github.com/pie-framework/pie-elements"
|
|
6
|
+
},
|
|
3
7
|
"publishConfig": {
|
|
4
8
|
"access": "public"
|
|
5
9
|
},
|
|
6
|
-
"
|
|
7
|
-
"version": "3.0.0-next.42+bb1f3eb4e",
|
|
10
|
+
"version": "3.1.0-next.0+20d879b",
|
|
8
11
|
"description": "",
|
|
9
12
|
"scripts": {
|
|
10
13
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -15,20 +18,20 @@
|
|
|
15
18
|
"@mui/icons-material": "^7.3.4",
|
|
16
19
|
"@mui/material": "^7.3.4",
|
|
17
20
|
"@pie-framework/pie-player-events": "^0.1.0",
|
|
18
|
-
"@pie-lib/math-rendering": "4.1.1-next.
|
|
19
|
-
"@pie-lib/render-ui": "5.1.1-next.
|
|
21
|
+
"@pie-lib/math-rendering": "4.1.1-next.1",
|
|
22
|
+
"@pie-lib/render-ui": "5.1.1-next.1",
|
|
20
23
|
"classnames": "^2.2.5",
|
|
21
24
|
"debug": "^4.1.1",
|
|
22
|
-
"lodash": "^4.17.23",
|
|
25
|
+
"lodash-es": "^4.17.23",
|
|
23
26
|
"prop-types": "^15.8.1",
|
|
24
|
-
"react": "18.
|
|
25
|
-
"react-dom": "18.
|
|
27
|
+
"react": "18.3.1",
|
|
28
|
+
"react-dom": "18.3.1",
|
|
26
29
|
"react-test-renderer": "18.2.0",
|
|
27
30
|
"react-transition-group": "^2.3.1"
|
|
28
31
|
},
|
|
29
32
|
"author": "",
|
|
30
33
|
"license": "ISC",
|
|
31
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "20d879b8b8fa74decf5028d860d54cd09cbdf051",
|
|
32
35
|
"main": "lib/index.js",
|
|
33
36
|
"module": "src/index.js"
|
|
34
37
|
}
|
package/module/configure.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_react_dom as e,_dll_react as l,_dll_prop_types as t,_dll_mui__material as a,_dll_mui__material_styles as n,_dll_lodash as o,_dll_pie_lib__render_ui as i,_dll_debug as r}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as s}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";import{_dll_pie_lib__config_ui as u}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";var d,c=e;d=c.createRoot,c.hydrateRoot;var p={};Object.defineProperty(p,"__esModule",{value:!0});class h extends CustomEvent{constructor(e,l=!1){super(h.TYPE,{bubbles:!0,detail:{update:e,reset:l}}),this.update=e,this.reset=l}}h.TYPE="model.updated";var m=p.ModelUpdatedEvent=h;class g extends CustomEvent{constructor(e,l){super(g.TYPE,{bubbles:!0,detail:{src:e,done:l}}),this.src=e,this.done=l}}g.TYPE="delete.image",p.DeleteImageEvent=g;class b extends CustomEvent{constructor(e){super(b.TYPE,{bubbles:!0,detail:e}),this.handler=e}}b.TYPE="insert.image",p.InsertImageEvent=b;class v extends CustomEvent{constructor(e,l){super(v.TYPE,{bubbles:!0,detail:{src:e,done:l}}),this.src=e,this.done=l}}v.TYPE="delete.sound";var C=p.DeleteSoundEvent=v;class E extends CustomEvent{constructor(e){super(E.TYPE,{bubbles:!0,detail:e}),this.handler=e}}E.TYPE="insert.sound";var _=p.InsertSoundEvent=E;const y="likert3",f="likert5",k="likert7",S="agreement",$="frequency",x="yesNo",T="importance",I="likelihood",P="like",M=[{label:"Disagree",value:-1},{label:"Unsure",value:0},{label:"Agree",value:1}],L=[{label:"Strongly Disagree",value:-2},...M,{label:"Strongly Agree",value:2}],D=[{label:"Extremely Disagree",value:-3},...L,{label:"Extremely Agree",value:3}],w=[{label:"Infrequently",value:-1},{label:"Unsure",value:0},{label:"Frequently",value:1}],R=[{label:"Very Infrequently",value:-2},...w,{label:"Very Frequently",value:2}],q=[{label:"Never",value:-3},...R,{label:"Always",value:3}],U=[{label:"No",value:-1},{label:"Unsure",value:0},{label:"Yes",value:1}],N=[{label:"No",value:-2},{label:"Not really",value:-1},{label:"Unsure",value:0},{label:"Sometimes",value:1},{label:"Yes",value:2}],Y=[{label:"No",value:-3},{label:"Rarely",value:-2},{label:"Not really",value:-1},{label:"Unsure",value:0},{label:"Sometimes",value:1},{label:"Very Often",value:2},{label:"Always",value:3}],A=[{label:"Not Likely",value:-1},{label:"Unsure",value:0},{label:"Likely",value:1}],V=[{label:"Very Unlikely",value:-2},...A,{label:"Very Likely",value:2}],z=[{label:"Extremely Unlikely",value:-3},...V,{label:"Extremely Likely",value:3}],O=[{label:"Not Important",value:-1},{label:"Unsure",value:0},{label:"Important",value:1}],j=[{label:"Very Not Important",value:-2},...O,{label:"Very Important",value:2}],F=[{label:"Extremely Not Important",value:-3},...j,{label:"Extremely Important",value:3}],B=[{label:"Dislike",value:-1},{label:"Unsure",value:0},{label:"Like",value:1}],H=[{label:"Really Dislike",value:-2},...B,{label:"Really Like",value:2}],G=[{label:"Extremely Dislike",value:-3},...H,{label:"Extremely Like",value:3}],J=(e,l)=>{switch(`${e}-${l}`){case`${y}-${S}`:return[...M];case`${f}-${S}`:return[...L];case`${k}-${S}`:return[...D];case`${y}-${$}`:return[...w];case`${f}-${$}`:return[...R];case`${k}-${$}`:return[...q];case`${y}-${x}`:return[...U];case`${f}-${x}`:return[...N];case`${k}-${x}`:return[...Y];case`${y}-${I}`:return[...A];case`${f}-${I}`:return[...V];case`${k}-${I}`:return[...z];case`${y}-${T}`:return[...O];case`${f}-${T}`:return[...j];case`${k}-${T}`:return[...F];case`${y}-${P}`:return[...B];case`${f}-${P}`:return[...H];case`${k}-${P}`:return[...G];default:return[]}},K=l,Q=t,{Radio:W}=a,{RadioGroup:X}=a,{FormControlLabel:Z}=a,{styled:ee}=n,{merge:le}=o,{color:te}=i,ae=s,{InputContainer:ne}=u,{settings:oe}=u,{layout:ie}=u,{NumberTextField:re}=u;function se(e){let l,t=e[0],a=1;for(;a<e.length;){const n=e[a],o=e[a+1];if(a+=2,("optionalAccess"===n||"optionalCall"===n)&&null==t)return;"access"===n||"optionalAccess"===n?(l=t,t=o(t)):"call"!==n&&"optionalCall"!==n||(t=o((...e)=>t.call(l,...e)),l=void 0)}return t}const{Panel:ue,toggle:de,radio:ce}=oe,pe=ee(ne)(({theme:e})=>({width:"100%",paddingTop:e.spacing(2),marginBottom:e.spacing(2)})),he=ee("div")({display:"flex",flexDirection:"column"}),me=ee("p")(({theme:e})=>({color:e.palette.grey[400],fontSize:e.typography.fontSize-2})),ge=ee("div")(({theme:e})=>({display:"flex",width:"100%",alignItems:"flex-start",marginBottom:e.spacing(2)})),be=ee("div")(({theme:e})=>({display:"flex",width:"100%",justifyContent:"space-around",marginBottom:e.spacing(2.5)})),ve=ee(ne)({width:"calc(100% - 200px)",marginRight:0}),Ce=ee("p")(({theme:e})=>({color:e.palette.error.main,fontSize:e.typography.fontSize-2})),Ee=ee(re)({width:"100%"}),_e=ee("div")({display:"flex",flexDirection:"row"}),ye=ee("div")(({theme:e})=>({paddingLeft:e.spacing(2.5),width:"150px"})),fe=ee(ae)(({theme:e})=>({paddingTop:e.spacing(2)})),ke=ee("span")(({theme:e})=>({width:"30px",paddingTop:e.spacing(4)})),Se=ee("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)})),$e=ee(W)({color:`${te.tertiary()} !important`}),xe=e=>{const{model:l,onChangeModel:t}=e;return K.createElement(he,null,K.createElement(me,null,"Likert Orientation"),K.createElement(X,{"aria-label":"likertOrientation",name:"likertOrientation",value:l.likertOrientation,onChange:e=>{const a=e.target.value;t({...l,likertOrientation:a})}},K.createElement(Z,{value:"horizontal",control:K.createElement($e,null),label:"Horizontal"}),K.createElement(Z,{value:"vertical",control:K.createElement($e,null),label:"Vertical"})))},Te=e=>{const{model:l,onChangeModel:t}=e;return K.createElement(he,null,K.createElement(me,null,"Likert Scale"),K.createElement(X,{"aria-label":"likertScale",name:"likertScale",value:l.likertScale,onChange:e=>{const a=e.target.value;t({...l,likertScale:a,choices:J(a,l.likertType)})}},K.createElement(Z,{value:y,control:K.createElement($e,null),label:"Likert 3"}),K.createElement(Z,{value:f,control:K.createElement($e,null),label:"Likert 5"}),K.createElement(Z,{value:k,control:K.createElement($e,null),label:"Likert 7"})))},Ie=e=>{const{model:l,onChangeModel:t}=e,a=e=>{const a=e.target.value;t({...l,likertType:a,choices:J(l.likertScale,a)})};return K.createElement(he,null,K.createElement(me,null,"Label Type"),K.createElement(_e,null,K.createElement(X,{"aria-label":"likertLabelType",name:"likertLabelType",value:l.likertType,onChange:a},K.createElement(Z,{value:S,control:K.createElement($e,null),label:"Agreement"}),K.createElement(Z,{value:$,control:K.createElement($e,null),label:"Frequency"}),K.createElement(Z,{value:x,control:K.createElement($e,null),label:"Yes/No"})),K.createElement(X,{"aria-label":"likertLabelType",name:"likertLabelType",value:l.likertType,onChange:a},K.createElement(Z,{value:T,control:K.createElement($e,null),label:"Importance"}),K.createElement(Z,{value:I,control:K.createElement($e,null),label:"Likelihood"}),K.createElement(Z,{value:P,control:K.createElement($e,null),label:"Like"}))))},Pe=e=>{const{configuration:l,imageSupport:t,model:a,onChangeModel:n,onChoiceChanged:o,onConfigurationChanged:i,onPromptChanged:r,onTeacherInstructionsChanged:s,uploadSoundSupport:u}=e,{contentDimensions:d={},prompt:c={},scoringType:p={},settingsPanelDisabled:h,spellCheck:m={},teacherInstructions:g={},baseInputConfiguration:b={},likertChoice:v={}}=l||{},{errors:C={},extraCSSRules:E,spellCheckEnabled:_,teacherInstructionsEnabled:y}=a||{},{prompt:f,teacherInstructions:k}=C,S=(e=>e.choices.reduce((e,l)=>{const t={...e},a=parseInt(l.value);return t[a]||(t[a]=0),{...t,[a]:t[a]+1}},{}))(a),$={teacherInstructionsEnabled:g.settings&&de(g.label),spellCheckEnabled:m.settings&&de(m.label),scoringType:p.settings&&ce(p.label,["auto","rubric"])},x=(e={})=>Object.assign({...b},e||{});return K.createElement(ie.ConfigLayout,{extraCSSRules:E,dimensions:d,hideSettings:h,settings:K.createElement(ue,{model:a,onChangeModel:n,configuration:l,onChangeConfiguration:i,groups:{Properties:$}})},y&&K.createElement(pe,{label:g.label},K.createElement(ae,{markup:a.teacherInstructions||"",onChange:s,imageSupport:t,nonEmpty:!1,error:k,spellCheck:_,uploadSoundSupport:u,pluginProps:x(se([g,"optionalAccess",e=>e.inputConfiguration]))}),k&&K.createElement(Se,null,k)),K.createElement(pe,{label:c.label},K.createElement(ae,{markup:a.prompt,onChange:r,imageSupport:t,nonEmpty:!1,error:f,spellCheck:_,disableUnderline:!0,uploadSoundSupport:u,pluginProps:x(se([c,"optionalAccess",e=>e.inputConfiguration]))}),f&&K.createElement(Se,null,f)),K.createElement(be,null,K.createElement(Te,{model:a,onChangeModel:n}),K.createElement(Ie,{model:a,onChangeModel:n}),K.createElement(xe,{model:a,onChangeModel:n})),a.choices.map((e,l)=>K.createElement(ge,{key:`choice-${l}`},K.createElement(ke,null,l+1,"."),K.createElement(ve,{key:`likert-label-${l}`,label:"Likert Label"},K.createElement(fe,{markup:e.label||"",onChange:t=>o(l,{...e,label:t}),imageSupport:t,spellCheck:_,uploadSoundSupport:u,pluginProps:x(se([v,"optionalAccess",e=>e.inputConfiguration]))})),K.createElement(ye,null,K.createElement(Ee,{label:"Likert Value",value:e.value,max:100,min:-100,onChange:(t,a)=>{o(l,{...e,value:a})},imageSupport:t}),S[e.value]&&S[e.value]>1&&K.createElement(Ce,null,"Value should be unique")))))};class Me extends K.Component{constructor(...e){super(...e),Me.prototype.__init.call(this),Me.prototype.__init2.call(this),Me.prototype.__init3.call(this)}static __initStatic(){this.propTypes={model:Q.object.isRequired,disableSidePanel:Q.bool,onModelChanged:Q.func.isRequired,onConfigurationChanged:Q.func.isRequired,imageSupport:Q.shape({add:Q.func.isRequired,delete:Q.func.isRequired})}}__init(){this.onChoiceChanged=(e,l)=>{const{model:t,onModelChanged:a}=this.props;t.choices=t.choices.map(e=>le({},e)),t.choices.splice(e,1,l),a(t)}}__init2(){this.onPromptChanged=e=>{this.props.onModelChanged({...this.props.model,prompt:e})}}__init3(){this.onTeacherInstructionsChanged=e=>{this.props.onModelChanged({...this.props.model,teacherInstructions:e})}}render(){return K.createElement(Pe,{...this.props,onChangeModel:this.props.onModelChanged,onChoiceChanged:this.onChoiceChanged,onPromptChanged:this.onPromptChanged,onTeacherInstructionsChanged:this.onTeacherInstructionsChanged})}}Me.__initStatic();var Le={choices:[],likertOrientation:"horizontal",likertScale:"likert3",likertType:"agreement",prompt:"",promptEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0},De={baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},settingsPanelDisabled:!1,spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},likertChoice:{label:"Choice",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}}}};const we=l,Re=r,{defaults:qe}=o,Ue=Re("likert:configure"),Ne=(e,l)=>({configuration:qe(e,De),model:l});class Ye extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...Le,...e,choices:e&&e.choices||[]})}constructor(){super(),this._root=null,this._model=Ye.createDefaultModel(),this._configuration=De,this.onModelChanged=this.onModelChanged.bind(this),this.onConfigurationChanged=this.onConfigurationChanged.bind(this)}set model(e){this._model=Ye.createDefaultModel(e),this._model={...this._model,choices:this._model.choices.map(e=>({...e,value:parseInt(e.value)}))},this._render()}set configuration(e){const l=Ne(e,this._model);this.onModelChanged(l.model),this._configuration=l.configuration,this._render()}set disableSidePanel(e){this._disableSidePanel=e,this._render()}dispatchModelUpdated(e){const l=!!e;this.dispatchEvent(new m(this._model,l))}onModelChanged(e,l){this._model=e,this._render(),this.dispatchModelUpdated(l)}onConfigurationChanged(e){this._configuration=Ne(e,this._model).configuration,this._model&&this.onModelChanged(this._model),this._render()}insertSound(e){this.dispatchEvent(new _(e))}onDeleteSound(e,l){this.dispatchEvent(new C(e,l))}_render(){Ue("_render");let e=we.createElement(Me,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged,onConfigurationChanged:this.onConfigurationChanged,disableSidePanel:this._disableSidePanel,uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=d(this)),this._root.render(e)}disconnectedCallback(){this._root&&this._root.unmount()}}Ye.__initStatic();export{Ye as default};
|
package/module/controller.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
var defaults = {
|
|
2
|
-
choices: [],
|
|
3
|
-
likertOrientation: 'horizontal',
|
|
4
|
-
likertScale: 'likert3',
|
|
5
|
-
likertType: 'agreement',
|
|
6
|
-
prompt: '',
|
|
7
|
-
promptEnabled: true,
|
|
8
|
-
teacherInstructions: '',
|
|
9
|
-
teacherInstructionsEnabled: true,
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
const prepareChoice = (choice) => {
|
|
13
|
-
return {
|
|
14
|
-
label: choice.label,
|
|
15
|
-
value: choice.value,
|
|
16
|
-
};
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
function createDefaultModel(model = {}) {
|
|
20
|
-
return new Promise((resolve) => resolve({ ...defaults, ...model }));
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const normalize = (question) => ({ ...defaults, ...question });
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @param {*} question
|
|
28
|
-
* @param {*} session
|
|
29
|
-
* @param {*} env
|
|
30
|
-
*/
|
|
31
|
-
async function model(question, session, env) {
|
|
32
|
-
const normalizedQuestion = normalize(question);
|
|
33
|
-
|
|
34
|
-
let choices = normalizedQuestion.choices.map(prepareChoice);
|
|
35
|
-
|
|
36
|
-
const out = {
|
|
37
|
-
...normalizedQuestion,
|
|
38
|
-
choices,
|
|
39
|
-
disabled: env.mode !== 'gather',
|
|
40
|
-
mode: env.mode,
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
const { role, mode } = env || {};
|
|
44
|
-
|
|
45
|
-
if (role === 'instructor' && (mode === 'view' || mode === 'evaluate')) {
|
|
46
|
-
out.teacherInstructions = normalizedQuestion.teacherInstructionsEnabled
|
|
47
|
-
? normalizedQuestion.teacherInstructions
|
|
48
|
-
: null;
|
|
49
|
-
} else {
|
|
50
|
-
out.teacherInstructions = null;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return out;
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
function outcome() {
|
|
57
|
-
return new Promise((resolve) => {
|
|
58
|
-
resolve({ score: 0, empty: false });
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// remove all html tags except img, iframe and source tag for audio
|
|
63
|
-
const getContent = (html) => (html || '').replace(/(<(?!img|iframe|source)([^>]+)>)/gi, '');
|
|
64
|
-
|
|
65
|
-
const validate = (model = {}, config = {}) => {
|
|
66
|
-
const errors = {};
|
|
67
|
-
|
|
68
|
-
['teacherInstructions', 'prompt'].forEach((field) => {
|
|
69
|
-
if (config[field]?.required && !getContent(model[field])) {
|
|
70
|
-
errors[field] = 'This field is required.';
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
return errors;
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export { createDefaultModel, model, normalize, outcome, validate };
|
package/module/demo.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import Configure from './configure.js';
|
|
2
|
-
import Element from './element.js';
|
|
3
|
-
import * as controller from './controller.js';
|
|
4
|
-
|
|
5
|
-
var generate = {};
|
|
6
|
-
|
|
7
|
-
generate.model = (id, element) => ({
|
|
8
|
-
id,
|
|
9
|
-
element,
|
|
10
|
-
likertScale: 'likert3',
|
|
11
|
-
likertType: 'agreement',
|
|
12
|
-
likertOrientation: 'horizontal',
|
|
13
|
-
choices: [
|
|
14
|
-
{
|
|
15
|
-
label: 'Disagree',
|
|
16
|
-
value: -1,
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
label: 'Unsure',
|
|
20
|
-
value: 0,
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
label: 'Agree',
|
|
24
|
-
value: 1,
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
|
-
prompt: 'How likely are you to report a problem?',
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
const { model } = generate;
|
|
31
|
-
|
|
32
|
-
var config = {
|
|
33
|
-
elements: {
|
|
34
|
-
'likert-element': '../..',
|
|
35
|
-
},
|
|
36
|
-
models: [model('1', 'likert-element')],
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
//Note: demo-el is a custom element loaded in the markup.
|
|
40
|
-
customElements.whenDefined("demo-el").then(() => {
|
|
41
|
-
config.models.forEach((m) => {
|
|
42
|
-
const de = document.createElement("demo-el");
|
|
43
|
-
document.body.appendChild(de);
|
|
44
|
-
de.def = { tagName: m.element, Element, Configure, controller };
|
|
45
|
-
de.model = m;
|
|
46
|
-
});
|
|
47
|
-
});
|
package/module/element.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{_dll_pie_lib__math_rendering as e}from"../../../@pie-lib/math-rendering-module@^4.0.5/module/index.js";import{_dll_mui__material as t,_dll_prop_types as r,_dll_mui__material_styles as n,_dll_pie_lib__render_ui as o,_dll_react_dom as s}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";var i={exports:{}},a={},c=Symbol.for("react.element"),u=Symbol.for("react.portal"),l=Symbol.for("react.fragment"),p=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.provider"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),_=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.iterator;var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,E={};function C(e,t,r){this.props=e,this.context=t,this.refs=E,this.updater=r||S}function k(){}function x(e,t,r){this.props=e,this.context=t,this.refs=E,this.updater=r||S}C.prototype.isReactComponent={},C.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},k.prototype=C.prototype;var R=x.prototype=new k;R.constructor=x,g(R,C.prototype),R.isPureReactComponent=!0;var w=Array.isArray,$=Object.prototype.hasOwnProperty,P={current:null},j={key:!0,ref:!0,__self:!0,__source:!0};function T(e,t,r){var n,o={},s=null,i=null;if(null!=t)for(n in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(s=""+t.key),t)$.call(t,n)&&!j.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var u=Array(a),l=0;l<a;l++)u[l]=arguments[l+2];o.children=u}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:c,type:e,key:s,ref:i,props:o,_owner:P.current}}function O(e){return"object"==typeof e&&null!==e&&e.$$typeof===c}var I=/\/+/g;function q(e,t){return"object"==typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(e){return t[e]})}(""+e.key):t.toString(36)}function M(e,t,r,n,o){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var i=!1;if(null===e)i=!0;else switch(s){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case c:case u:i=!0}}if(i)return o=o(i=e),e=""===n?"."+q(i,0):n,w(o)?(r="",null!=e&&(r=e.replace(I,"$&/")+"/"),M(o,t,r,"",function(e){return e})):null!=o&&(O(o)&&(o=function(e,t){return{$$typeof:c,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(o,r+(!o.key||i&&i.key===o.key?"":(""+o.key).replace(I,"$&/")+"/")+e)),t.push(o)),1;if(i=0,n=""===n?".":n+":",w(e))for(var a=0;a<e.length;a++){var l=n+q(s=e[a],a);i+=M(s,t,r,l,o)}else if(l=function(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=v&&e[v]||e["@@iterator"])?e:null}(e),"function"==typeof l)for(e=l.call(e),a=0;!(s=e.next()).done;)i+=M(s=s.value,t,r,l=n+q(s,a++),o);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return i}function L(e,t,r){if(null==e)return e;var n=[],o=0;return M(e,n,"","",function(e){return t.call(r,e,o++)}),n}function A(e){if(-1===e._status){var t=e._result;(t=t()).then(function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)},function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)}),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var D={current:null},N={transition:null},F={ReactCurrentDispatcher:D,ReactCurrentBatchConfig:N,ReactCurrentOwner:P};function U(){throw Error("act(...) is not supported in production builds of React.")}a.Children={map:L,forEach:function(e,t,r){L(e,function(){t.apply(this,arguments)},r)},count:function(e){var t=0;return L(e,function(){t++}),t},toArray:function(e){return L(e,function(e){return e})||[]},only:function(e){if(!O(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},a.Component=C,a.Fragment=l,a.Profiler=f,a.PureComponent=x,a.StrictMode=p,a.Suspense=y,a.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=F,a.act=U,a.cloneElement=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n=g({},e.props),o=e.key,s=e.ref,i=e._owner;if(null!=t){if(void 0!==t.ref&&(s=t.ref,i=P.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(u in t)$.call(t,u)&&!j.hasOwnProperty(u)&&(n[u]=void 0===t[u]&&void 0!==a?a[u]:t[u])}var u=arguments.length-2;if(1===u)n.children=r;else if(1<u){a=Array(u);for(var l=0;l<u;l++)a[l]=arguments[l+2];n.children=a}return{$$typeof:c,type:e.type,key:o,ref:s,props:n,_owner:i}},a.createContext=function(e){return(e={$$typeof:h,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:d,_context:e},e.Consumer=e},a.createElement=T,a.createFactory=function(e){var t=T.bind(null,e);return t.type=e,t},a.createRef=function(){return{current:null}},a.forwardRef=function(e){return{$$typeof:m,render:e}},a.isValidElement=O,a.lazy=function(e){return{$$typeof:b,_payload:{_status:-1,_result:e},_init:A}},a.memo=function(e,t){return{$$typeof:_,type:e,compare:void 0===t?null:t}},a.startTransition=function(e){var t=N.transition;N.transition={};try{e()}finally{N.transition=t}},a.unstable_act=U,a.useCallback=function(e,t){return D.current.useCallback(e,t)},a.useContext=function(e){return D.current.useContext(e)},a.useDebugValue=function(){},a.useDeferredValue=function(e){return D.current.useDeferredValue(e)},a.useEffect=function(e,t){return D.current.useEffect(e,t)},a.useId=function(){return D.current.useId()},a.useImperativeHandle=function(e,t,r){return D.current.useImperativeHandle(e,t,r)},a.useInsertionEffect=function(e,t){return D.current.useInsertionEffect(e,t)},a.useLayoutEffect=function(e,t){return D.current.useLayoutEffect(e,t)},a.useMemo=function(e,t){return D.current.useMemo(e,t)},a.useReducer=function(e,t,r){return D.current.useReducer(e,t,r)},a.useRef=function(e){return D.current.useRef(e)},a.useState=function(e){return D.current.useState(e)},a.useSyncExternalStore=function(e,t,r){return D.current.useSyncExternalStore(e,t,r)},a.useTransition=function(){return D.current.useTransition()},a.version="18.3.1",i.exports=a;var V=i.exports;const B="vertical",{FormControlLabel:H}=t,{Radio:Y}=t,z=r,{styled:W}=n,{color:G}=o,J=W(Y)({color:`var(--choice-input-color, ${G.text()})`,"&.Mui-checked":{color:`var(--choice-input-selected-color, ${G.primary()})`},"&.Mui-disabled":{color:`var(--choice-input-disabled-color, ${G.defaults.DISABLED})`}}),K=W("p")({color:G.text(),textAlign:"center",cursor:"pointer"}),Q=W("div")({display:"flex",alignItems:"center",flex:1,padding:"0 5px","& label":{}}),X=W(H)({margin:0});class Z extends V.Component{constructor(...e){super(...e),Z.prototype.__init.call(this)}static __initStatic(){this.propTypes={checked:z.bool.isRequired,disabled:z.bool.isRequired,label:z.string.isRequired,likertOrientation:z.string.isRequired,onChange:z.func.isRequired,value:z.number.isRequired}}static __initStatic2(){this.defaultProps={checked:!1}}__init(){this.onToggleChoice=()=>{this.props.onChange({value:this.props.value,selected:!this.props.checked})}}render(){const{disabled:e,label:t,checked:r,likertOrientation:n}=this.props,o=n===B?"row":"column";return V.createElement(Q,{style:{flexDirection:o}},V.createElement(X,{disabled:e,control:V.createElement(J,{checked:r,onChange:this.onToggleChoice,disabled:e})}),V.createElement(K,{onClick:this.onToggleChoice,dangerouslySetInnerHTML:{__html:t}}))}}Z.__initStatic(),Z.__initStatic2();const ee=r,{styled:te}=n,{color:re}=o,{Collapsible:ne}=o,{PreviewPrompt:oe}=o,se=te("div")({color:re.text(),backgroundColor:re.background(),"& *":{"-webkit-font-smoothing":"antialiased"}}),ie=te(ne)(({theme:e})=>({marginBottom:e.spacing(2)})),ae=te("div")(({theme:e})=>({verticalAlign:"middle",color:"var(--pie-primary-text, var(--pie-text, #000000))",paddingBottom:e.spacing(2)})),ce=te("div")({display:"flex"});class ue extends V.Component{static __initStatic(){this.propTypes={className:ee.string,choices:ee.array,prompt:ee.string,teacherInstructions:ee.string,session:ee.object,disabled:ee.bool.isRequired,onSessionChange:ee.func.isRequired,likertOrientation:ee.string.isRequired}}UNSAFE_componentWillReceiveProps(){}isSelected(e){return this.props.session&&this.props.session.value===e}render(){const{disabled:e,choices:t=[],prompt:r,onSessionChange:n,teacherInstructions:o,className:s,likertOrientation:i}=this.props,a=i===B?"column":"row";return V.createElement(se,{className:s},o&&V.createElement(ie,{labels:{hidden:"Show Teacher Instructions",visible:"Hide Teacher Instructions"}},V.createElement(oe,{prompt:o})),r&&V.createElement(ae,null,V.createElement(oe,{prompt:r})),V.createElement(ce,{style:{flexDirection:a}},t.map((t,r)=>V.createElement(Z,{key:`choice-${r}`,label:t.label,value:t.value,index:r,disabled:e,onChange:n,likertOrientation:i,checked:this.isSelected(t.value)}))))}}ue.__initStatic(),ue.defaultProps={session:{value:[]}};const le=r,{PreviewLayout:pe}=o;class fe extends V.Component{static __initStatic(){this.propTypes={model:le.object,session:le.object,onSessionChange:le.func}}static __initStatic2(){this.defaultProps={model:{},session:{}}}render(){const{model:e,onSessionChange:t,session:r}=this.props,{extraCSSRules:n}=e;return V.createElement(pe,{extraCSSRules:n},V.createElement(ue,{...e,session:r,onSessionChange:t}))}}fe.__initStatic(),fe.__initStatic2();var de,he=s;de=he.createRoot,he.hydrateRoot;var me={};Object.defineProperty(me,"__esModule",{value:!0});class ye extends CustomEvent{constructor(e,t,r){super(ye.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e,hasModel:r}}),this.component=e,this.complete=t}}ye.TYPE="model-set",me.ModelSetEvent=ye;class _e extends CustomEvent{constructor(e,t){super(_e.TYPE,{bubbles:!0,composed:!0,detail:{complete:t,component:e}}),this.component=e,this.complete=t}}_e.TYPE="session-changed";var be=me.SessionChangedEvent=_e;const{renderMath:ve}=e,Se=e=>!!(e&&e.value&&e.value.length);class ge extends HTMLElement{constructor(){super(),this._root=null}set model(e){this._model=e,this._render()}set session(e){this._session=e,this._render()}get session(){return this._session}sessionChanged(e){this._session.value=e.value;const t=Se(this._session,this._model);this.dispatchEvent(new be(this.tagName.toLowerCase(),t)),this._render()}connectedCallback(){this._render()}_render(){if(!this._model||!this._session)return;const e=V.createElement(fe,{model:this._model,session:this._session,onSessionChange:this.sessionChanged.bind(this)});this._root||(this._root=de(this)),this._root.render(e),queueMicrotask(()=>{ve(this)})}disconnectedCallback(){this._root&&this._root.unmount()}}export{ge as default,Se as isComplete};
|
package/module/index.html
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/likert@3.0.0-beta.1</title>
|
|
6
|
-
<script
|
|
7
|
-
type="module"
|
|
8
|
-
src="https://cdn.jsdelivr.net/npm/@pslb/demo-el@^1.0.0/dist/demo-el/demo-el.esm.js"></script>
|
|
9
|
-
|
|
10
|
-
<link
|
|
11
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
12
|
-
rel="stylesheet"
|
|
13
|
-
/>
|
|
14
|
-
<style>
|
|
15
|
-
html, body {
|
|
16
|
-
font-family: 'Roboto', sans-serif;
|
|
17
|
-
}
|
|
18
|
-
</style>
|
|
19
|
-
<script type="module" src="./demo.js"></script>
|
|
20
|
-
</head>
|
|
21
|
-
</html>
|
package/module/manifest.json
DELETED
package/module/print-demo.js
DELETED
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import PrintElement from './print.js';
|
|
2
|
-
|
|
3
|
-
var generate = {};
|
|
4
|
-
|
|
5
|
-
generate.model = (id, element) => ({
|
|
6
|
-
id,
|
|
7
|
-
element,
|
|
8
|
-
likertScale: 'likert3',
|
|
9
|
-
likertType: 'agreement',
|
|
10
|
-
likertOrientation: 'horizontal',
|
|
11
|
-
choices: [
|
|
12
|
-
{
|
|
13
|
-
label: 'Disagree',
|
|
14
|
-
value: -1,
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
label: 'Unsure',
|
|
18
|
-
value: 0,
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
label: 'Agree',
|
|
22
|
-
value: 1,
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
prompt: 'How likely are you to report a problem?',
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
const { model } = generate;
|
|
29
|
-
|
|
30
|
-
var config = {
|
|
31
|
-
elements: {
|
|
32
|
-
'likert-element': '../..',
|
|
33
|
-
},
|
|
34
|
-
models: [model('1', 'likert-element')],
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// new init - just shows off print!
|
|
38
|
-
|
|
39
|
-
const init = async () => {
|
|
40
|
-
console.log('define the element...');
|
|
41
|
-
await Promise.all(
|
|
42
|
-
config.models.map(async (m) => {
|
|
43
|
-
try {
|
|
44
|
-
const printTag = `${m.element}-print`;
|
|
45
|
-
if (customElements.get(printTag)) {
|
|
46
|
-
return true;
|
|
47
|
-
} else {
|
|
48
|
-
customElements.define(printTag, PrintElement);
|
|
49
|
-
await customElements.whenDefined(printTag);
|
|
50
|
-
return true;
|
|
51
|
-
}
|
|
52
|
-
} catch (e) {
|
|
53
|
-
return false;
|
|
54
|
-
}
|
|
55
|
-
})
|
|
56
|
-
);
|
|
57
|
-
|
|
58
|
-
console.log('now apply the model...');
|
|
59
|
-
config.models.forEach((m) => {
|
|
60
|
-
const printTag = `${m.element}-print`;
|
|
61
|
-
const h3s = document.createElement('h3');
|
|
62
|
-
h3s.textContent = 'student mode';
|
|
63
|
-
document.body.appendChild(h3s);
|
|
64
|
-
const de = document.createElement(printTag);
|
|
65
|
-
document.body.appendChild(de);
|
|
66
|
-
de.options = {};
|
|
67
|
-
de.model = m;
|
|
68
|
-
|
|
69
|
-
const h3 = document.createElement('h3');
|
|
70
|
-
h3.textContent = 'instructor mode';
|
|
71
|
-
document.body.appendChild(h3);
|
|
72
|
-
const instr = document.createElement(printTag);
|
|
73
|
-
document.body.appendChild(instr);
|
|
74
|
-
instr.options = { mode: 'instructor' };
|
|
75
|
-
instr.model = JSON.parse(JSON.stringify(m));
|
|
76
|
-
});
|
|
77
|
-
};
|
|
78
|
-
|
|
79
|
-
init()
|
|
80
|
-
.then(() => {
|
|
81
|
-
console.log('ready');
|
|
82
|
-
})
|
|
83
|
-
.catch((e) => {
|
|
84
|
-
console.error(e);
|
|
85
|
-
});
|
package/module/print.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
<!doctype html>
|
|
3
|
-
<html>
|
|
4
|
-
<head>
|
|
5
|
-
<title>@pie-element/likert@3.0.0-beta.1</title>
|
|
6
|
-
<link
|
|
7
|
-
href="https://fonts.googleapis.com/css?family=Roboto&display=swap"
|
|
8
|
-
rel="stylesheet"
|
|
9
|
-
/>
|
|
10
|
-
<style>
|
|
11
|
-
html, body {
|
|
12
|
-
font-family: 'Roboto', sans-serif;
|
|
13
|
-
}
|
|
14
|
-
</style>
|
|
15
|
-
<script type="module" src="./print-demo.js"></script>
|
|
16
|
-
</head>
|
|
17
|
-
<body></body>
|
|
18
|
-
</html>
|