@pie-element/extended-text-entry 15.1.4 → 15.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/configure/CHANGELOG.md +8 -0
- package/configure/lib/index.js +4 -0
- package/configure/lib/index.js.map +1 -1
- package/configure/package.json +3 -3
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/main.js +2 -1
- package/lib/main.js.map +1 -1
- package/module/configure.js +1 -1
- package/module/element.js +1 -1
- package/module/index.html +1 -1
- package/module/manifest.json +5 -9
- package/module/print.html +1 -1
- package/module/print.js +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [15.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.4...@pie-element/extended-text-entry@15.1.5) (2026-06-22)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump shared modules and libs PIE-674, PIE-662, PIE-705, PIE-674, PIE-963 ([78a3f64](https://github.com/pie-framework/pie-elements/commit/78a3f64652c9581c61bd4159f3210fc1e32d8bcf))
|
|
11
|
+
- **extended-text-entry:** ensure StyledPrompt is displayed as a block element PIE-692 ([a230a25](https://github.com/pie-framework/pie-elements/commit/a230a253451996a15fb24adfc53f43c5e7550fa5))
|
|
12
|
+
- **extended-text-entry:** re-render elements on reconnect PIE-672 ([9b241e8](https://github.com/pie-framework/pie-elements/commit/9b241e850263da72de72692265d244dbb023e3a1))
|
|
13
|
+
- if allowMultiplePlacements default should be false PIE-682 ([b7447f4](https://github.com/pie-framework/pie-elements/commit/b7447f4d97e9d7cc2415f54a17ffe13ed15d1ebb))
|
|
14
|
+
|
|
6
15
|
## [15.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry@15.1.3...@pie-element/extended-text-entry@15.1.4) (2026-06-17)
|
|
7
16
|
|
|
8
17
|
### Bug Fixes
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [13.1.5](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.4...@pie-element/extended-text-entry-configure@13.1.5) (2026-06-22)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- bump shared modules and libs PIE-674, PIE-662, PIE-705, PIE-674, PIE-963 ([78a3f64](https://github.com/pie-framework/pie-elements/commit/78a3f64652c9581c61bd4159f3210fc1e32d8bcf))
|
|
11
|
+
- **extended-text-entry:** re-render elements on reconnect PIE-672 ([9b241e8](https://github.com/pie-framework/pie-elements/commit/9b241e850263da72de72692265d244dbb023e3a1))
|
|
12
|
+
- if allowMultiplePlacements default should be false PIE-682 ([b7447f4](https://github.com/pie-framework/pie-elements/commit/b7447f4d97e9d7cc2415f54a17ffe13ed15d1ebb))
|
|
13
|
+
|
|
6
14
|
## [13.1.4](https://github.com/pie-framework/pie-elements/compare/@pie-element/extended-text-entry-configure@13.1.3...@pie-element/extended-text-entry-configure@13.1.4) (2026-06-17)
|
|
7
15
|
|
|
8
16
|
### Bug Fixes
|
package/configure/lib/index.js
CHANGED
|
@@ -102,9 +102,13 @@ class ExtendedTextEntry extends HTMLElement {
|
|
|
102
102
|
this._root.render(element);
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
+
connectedCallback() {
|
|
106
|
+
this.render();
|
|
107
|
+
}
|
|
105
108
|
disconnectedCallback() {
|
|
106
109
|
if (this._root) {
|
|
107
110
|
this._root.unmount();
|
|
111
|
+
this._root = null;
|
|
108
112
|
}
|
|
109
113
|
}
|
|
110
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_pieConfigureEvents","require","_react","_interopRequireDefault","_client","_main","_defaults","ExtendedTextEntry","HTMLElement","constructor","_root","_configuration","defaults","configuration","withRubric","forceEnabled","settings","_model","createDefaultModel","model","m","render","c","rubricEnabled","onModelChanged","dispatchEvent","ModelUpdatedEvent","onConfigurationChanged","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","element","React","createElement","Main","bind","imageSupport","add","delete","uploadSoundSupport","createRoot","disconnectedCallback","unmount","exports","default","_defineProperty2","config","defaultModel"],"sources":["../src/index.js"],"sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Main from './main';\n\nimport defaults from './defaults';\n\nexport default class ExtendedTextEntry extends HTMLElement {\n static createDefaultModel = (model = {}, config) => {\n const defaultModel = { ...defaults.model, ...model };\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n if (config?.withRubric?.forceEnabled && !defaultModel.rubricEnabled) {\n defaultModel.rubricEnabled = true;\n }\n\n return defaultModel;\n };\n\n constructor() {\n super();\n this._root = null;\n this._configuration = defaults.configuration;\n\n // if configuration.withRubric.forceEnabled is true, then we\n // update the configuration (we do not want to display the toggle in the Settings Panel)\n if (this._configuration.withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n }\n\n this._model = ExtendedTextEntry.createDefaultModel({}, this._configuration);\n }\n\n set model(m) {\n this._model = ExtendedTextEntry.createDefaultModel(m, this._configuration);\n this.render();\n }\n\n set configuration(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n const { withRubric = {} } = c || {};\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n // and also update the configuration (we do not want to display the toggle in the Settings Panel)\n if (withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n\n if (!this._model.rubricEnabled) {\n this._model.rubricEnabled = true;\n }\n }\n\n this.render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this.render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this.render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\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 if (this._model) {\n const element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEe,MAAMM,iBAAiB,SAASC,WAAW,CA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CG,MAAM,EAAE,IAAI,CAACf,aAAa,CAACY,IAAI,CAAC,IAAI;QACtC,CAAC;QACDI,kBAAkB,EAAE;UAClBF,GAAG,EAAE,IAAI,CAACV,WAAW,CAACQ,IAAI,CAAC,IAAI,CAAC;UAChCG,MAAM,EAAE,IAAI,CAACT,aAAa,CAACM,IAAI,CAAC,IAAI;QACtC;MACF,CAAC,CAAC;MAEF,IAAI,CAAC,IAAI,CAACjC,KAAK,EAAE;QACf,IAAI,CAACA,KAAK,GAAG,IAAAsC,kBAAU,EAAC,IAAI,CAAC;MAC/B;MACA,IAAI,CAACtC,KAAK,CAACW,MAAM,CAACkB,OAAO,CAAC;IAC5B;EACF;EAEAU,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_pieConfigureEvents","require","_react","_interopRequireDefault","_client","_main","_defaults","ExtendedTextEntry","HTMLElement","constructor","_root","_configuration","defaults","configuration","withRubric","forceEnabled","settings","_model","createDefaultModel","model","m","render","c","rubricEnabled","onModelChanged","dispatchEvent","ModelUpdatedEvent","onConfigurationChanged","insertImage","handler","InsertImageEvent","onDeleteImage","src","done","DeleteImageEvent","insertSound","InsertSoundEvent","onDeleteSound","DeleteSoundEvent","element","React","createElement","Main","bind","imageSupport","add","delete","uploadSoundSupport","createRoot","connectedCallback","disconnectedCallback","unmount","exports","default","_defineProperty2","config","defaultModel"],"sources":["../src/index.js"],"sourcesContent":["import {\n ModelUpdatedEvent,\n DeleteImageEvent,\n InsertImageEvent,\n InsertSoundEvent,\n DeleteSoundEvent,\n} from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport Main from './main';\n\nimport defaults from './defaults';\n\nexport default class ExtendedTextEntry extends HTMLElement {\n static createDefaultModel = (model = {}, config) => {\n const defaultModel = { ...defaults.model, ...model };\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n if (config?.withRubric?.forceEnabled && !defaultModel.rubricEnabled) {\n defaultModel.rubricEnabled = true;\n }\n\n return defaultModel;\n };\n\n constructor() {\n super();\n this._root = null;\n this._configuration = defaults.configuration;\n\n // if configuration.withRubric.forceEnabled is true, then we\n // update the configuration (we do not want to display the toggle in the Settings Panel)\n if (this._configuration.withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n }\n\n this._model = ExtendedTextEntry.createDefaultModel({}, this._configuration);\n }\n\n set model(m) {\n this._model = ExtendedTextEntry.createDefaultModel(m, this._configuration);\n this.render();\n }\n\n set configuration(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n const { withRubric = {} } = c || {};\n\n // if configuration.withRubric.forceEnabled is true, then we update the model (rubricEnabled)\n // without triggering the Model Updated event (for more details, check documentation)\n // and also update the configuration (we do not want to display the toggle in the Settings Panel)\n if (withRubric?.forceEnabled) {\n this._configuration.withRubric.settings = false;\n\n if (!this._model.rubricEnabled) {\n this._model.rubricEnabled = true;\n }\n }\n\n this.render();\n }\n\n onModelChanged(m) {\n this._model = m;\n this.render();\n this.dispatchEvent(new ModelUpdatedEvent(this._model, false));\n }\n\n onConfigurationChanged(c) {\n this._configuration = {\n ...defaults.configuration,\n ...c,\n };\n\n if (this._model) {\n this.onModelChanged(this._model);\n }\n\n this.render();\n }\n\n /**\n *\n * @param {done, progress, file} handler\n */\n insertImage(handler) {\n this.dispatchEvent(new InsertImageEvent(handler));\n }\n\n onDeleteImage(src, done) {\n this.dispatchEvent(new DeleteImageEvent(src, done));\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 if (this._model) {\n const element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged.bind(this),\n onConfigurationChanged: this.onConfigurationChanged.bind(this),\n imageSupport: {\n add: this.insertImage.bind(this),\n delete: this.onDeleteImage.bind(this),\n },\n uploadSoundSupport: {\n add: this.insertSound.bind(this),\n delete: this.onDeleteSound.bind(this),\n },\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n }\n }\n\n connectedCallback() {\n this.render();\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._root = null;\n }\n }\n}\n"],"mappings":";;;;;;;;AAAA,IAAAA,mBAAA,GAAAC,OAAA;AAOA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAF,sBAAA,CAAAF,OAAA;AAEA,IAAAK,SAAA,GAAAH,sBAAA,CAAAF,OAAA;AAEe,MAAMM,iBAAiB,SAASC,WAAW,CAAC;EAazDC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,KAAK,GAAG,IAAI;IACjB,IAAI,CAACC,cAAc,GAAGC,iBAAQ,CAACC,aAAa;;IAE5C;IACA;IACA,IAAI,IAAI,CAACF,cAAc,CAACG,UAAU,EAAEC,YAAY,EAAE;MAChD,IAAI,CAACJ,cAAc,CAACG,UAAU,CAACE,QAAQ,GAAG,KAAK;IACjD;IAEA,IAAI,CAACC,MAAM,GAAGV,iBAAiB,CAACW,kBAAkB,CAAC,CAAC,CAAC,EAAE,IAAI,CAACP,cAAc,CAAC;EAC7E;EAEA,IAAIQ,KAAKA,CAACC,CAAC,EAAE;IACX,IAAI,CAACH,MAAM,GAAGV,iBAAiB,CAACW,kBAAkB,CAACE,CAAC,EAAE,IAAI,CAACT,cAAc,CAAC;IAC1E,IAAI,CAACU,MAAM,CAAC,CAAC;EACf;EAEA,IAAIR,aAAaA,CAACS,CAAC,EAAE;IACnB,IAAI,CAACX,cAAc,GAAG;MACpB,GAAGC,iBAAQ,CAACC,aAAa;MACzB,GAAGS;IACL,CAAC;IAED,MAAM;MAAER,UAAU,GAAG,CAAC;IAAE,CAAC,GAAGQ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B9C,iBAAiB,wBACR,CAACY,KAAK,GAAG,CAAC,CAAC,EAAEoC,MAAM,KAAK;EAClD,MAAMC,YAAY,GAAG;IAAE,GAAG5C,iBAAQ,CAACO,KAAK;IAAE,GAAGA;EAAM,CAAC;;EAEpD;EACA;EACA,IAAIoC,MAAM,EAAEzC,UAAU,EAAEC,YAAY,IAAI,CAACyC,YAAY,CAACjC,aAAa,EAAE;IACnEiC,YAAY,CAACjC,aAAa,GAAG,IAAI;EACnC;EAEA,OAAOiC,YAAY;AACrB,CAAC","ignoreList":[]}
|
package/configure/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/extended-text-entry-configure",
|
|
3
3
|
"private": true,
|
|
4
|
-
"version": "13.1.
|
|
4
|
+
"version": "13.1.5",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"module": "src/index.js",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"@mui/icons-material": "^7.3.4",
|
|
14
14
|
"@mui/material": "^7.3.4",
|
|
15
15
|
"@pie-framework/pie-configure-events": "^1.3.0",
|
|
16
|
-
"@pie-lib/config-ui": "13.0.
|
|
17
|
-
"@pie-lib/editable-html-tip-tap": "2.1.
|
|
16
|
+
"@pie-lib/config-ui": "13.0.9",
|
|
17
|
+
"@pie-lib/editable-html-tip-tap": "2.1.7",
|
|
18
18
|
"lodash-es": "^4.17.23",
|
|
19
19
|
"prop-types": "^15.8.1",
|
|
20
20
|
"react": "18.3.1",
|
package/lib/index.js
CHANGED
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_main","_interopRequireDefault","require","_react","_client","_debug","_mathRendering","_piePlayerEvents","log","debug","domParser","window","undefined","DOMParser","parseFromString","v","textContent","value","document","body","err","isComplete","tc","out","length","RootExtendedTextEntry","HTMLElement","constructor","_model","_session","_root","setLangAttribute","language","lang","slice","setAttribute","model","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","session","s","valueChange","SessionChangedEvent","annotationsChange","annotations","commentChange","comment","connectedCallback","elem","React","createElement","Main","onValueChange","bind","onAnnotationsChange","onCommentChange","createRoot","queueMicrotask","renderMath","disconnectedCallback","unmount","exports","default"],"sources":["../src/index.js"],"sourcesContent":["import Main from './main';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\n\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\n\nconst log = debug('@pie-elements:extended-text-entry');\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n\n return textContent;\n } catch (err) {\n log('tried to parse as dom and failed', value);\n return value;\n }\n}\n\nexport function isComplete(value) {\n const tc = textContent(value);\n const out = tc !== undefined && tc.length > 0;\n\n return out;\n}\n\nexport default class RootExtendedTextEntry extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n this._root = null;\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\n\n this.render();\n }\n\n set session(s) {\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n valueChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));\n\n this.render();\n }\n\n annotationsChange(annotations) {\n this._session.annotations = annotations;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n\n this.render();\n }\n\n commentChange(comment) {\n this._session.comment = comment;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(comment)));\n\n this.render();\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question');\n this.setAttribute('role', 'region');\n\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onValueChange: this.valueChange.bind(this),\n onAnnotationsChange: this.annotationsChange.bind(this),\n onCommentChange: this.commentChange.bind(this),\n });\n\n this.setLangAttribute();\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(elem);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n }\n }\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAL,OAAA;AAEA,MAAMM,GAAG,GAAG,IAAAC,cAAK,EAAC,mCAAmC,CAAC;AAEtD,MAAMC,SAAS,GAAG,OAAOC,MAAM,KAAKC,SAAS,GAAG,IAAIC,SAAS,CAAC,CAAC,GAAG;EAAEC,eAAe,EAAGC,CAAC,IAAKA;AAAE,CAAC;AAExF,SAASC,WAAWA,CAACC,KAAK,EAAE;EACjC,IAAI,OAAOA,KAAK,KAAK,QAAQ,EAAE;IAC7B,OAAOL,SAAS;EAClB;EAEA,IAAI;IACF,MAAMM,QAAQ,GAAGR,SAAS,CAACI,eAAe,CAACG,KAAK,EAAE,WAAW,CAAC;IAC9D,MAAMD,WAAW,GAAGE,QAAQ,CAACC,IAAI,CAACH,WAAW;IAE7C,OAAOA,WAAW;EACpB,CAAC,CAAC,OAAOI,GAAG,EAAE;IACZZ,GAAG,CAAC,kCAAkC,EAAES,KAAK,CAAC;IA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AAW,CAACY,IAAI,CAAC,IAAI,CAAC;QAC1CC,mBAAmB,EAAE,IAAI,CAACX,iBAAiB,CAACU,IAAI,CAAC,IAAI,CAAC;QACtDE,eAAe,EAAE,IAAI,CAACV,aAAa,CAACQ,IAAI,CAAC,IAAI;MAC/C,CAAC,CAAC;MAEF,IAAI,CAAC1B,gBAAgB,CAAC,CAAC;MAEvB,IAAI,CAAC,IAAI,CAACD,KAAK,EAAE;QACf,IAAI,CAACA,KAAK,GAAG,IAAA8B,kBAAU,EAAC,IAAI,CAAC;MAC/B;MACA,IAAI,CAAC9B,KAAK,CAACY,MAAM,CAACU,IAAI,CAAC;MACvBS,cAAc,CAAC,MAAM;QACnB,IAAAC,yBAAU,EAAC,IAAI,CAAC;MAClB,CAAC,CAAC;IACJ;EACF;EAEAC,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACjC,KAAK,EAAE;MACd,IAAI,CAACA,KAAK,CAACkC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","names":["_main","_interopRequireDefault","require","_react","_client","_debug","_mathRendering","_piePlayerEvents","log","debug","domParser","window","undefined","DOMParser","parseFromString","v","textContent","value","document","body","err","isComplete","tc","out","length","RootExtendedTextEntry","HTMLElement","constructor","_model","_session","_root","setLangAttribute","language","lang","slice","setAttribute","model","m","dispatchEvent","ModelSetEvent","tagName","toLowerCase","render","session","s","valueChange","SessionChangedEvent","annotationsChange","annotations","commentChange","comment","connectedCallback","elem","React","createElement","Main","onValueChange","bind","onAnnotationsChange","onCommentChange","createRoot","queueMicrotask","renderMath","disconnectedCallback","unmount","exports","default"],"sources":["../src/index.js"],"sourcesContent":["import Main from './main';\nimport React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debug from 'debug';\n\nimport { renderMath } from '@pie-lib/math-rendering';\nimport { ModelSetEvent, SessionChangedEvent } from '@pie-framework/pie-player-events';\n\nconst log = debug('@pie-elements:extended-text-entry');\n\nconst domParser = typeof window !== undefined ? new DOMParser() : { parseFromString: (v) => v };\n\nexport function textContent(value) {\n if (typeof value !== 'string') {\n return undefined;\n }\n\n try {\n const document = domParser.parseFromString(value, 'text/html');\n const textContent = document.body.textContent;\n\n return textContent;\n } catch (err) {\n log('tried to parse as dom and failed', value);\n return value;\n }\n}\n\nexport function isComplete(value) {\n const tc = textContent(value);\n const out = tc !== undefined && tc.length > 0;\n\n return out;\n}\n\nexport default class RootExtendedTextEntry extends HTMLElement {\n constructor() {\n super();\n this._model = null;\n this._session = null;\n this._root = null;\n }\n\n setLangAttribute() {\n const language = this._model && typeof this._model.language ? this._model.language : '';\n const lang = language ? language.slice(0, 2) : 'en';\n this.setAttribute('lang', lang);\n }\n\n set model(m) {\n this._model = m;\n this.dispatchEvent(new ModelSetEvent(this.tagName.toLowerCase(), false, !!this._model));\n\n this.render();\n }\n\n set session(s) {\n this._session = s;\n this.render();\n }\n\n get session() {\n return this._session;\n }\n\n valueChange(value) {\n this._session.value = value;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(value)));\n\n this.render();\n }\n\n annotationsChange(annotations) {\n this._session.annotations = annotations;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), true));\n\n this.render();\n }\n\n commentChange(comment) {\n this._session.comment = comment;\n\n this.dispatchEvent(new SessionChangedEvent(this.tagName.toLowerCase(), isComplete(comment)));\n\n this.render();\n }\n\n connectedCallback() {\n this.setAttribute('aria-label', 'Written Response Question');\n this.setAttribute('role', 'region');\n\n this.render();\n }\n\n render() {\n if (this._model && this._session) {\n let elem = React.createElement(Main, {\n model: this._model,\n session: this._session,\n onValueChange: this.valueChange.bind(this),\n onAnnotationsChange: this.annotationsChange.bind(this),\n onCommentChange: this.commentChange.bind(this),\n });\n\n this.setLangAttribute();\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(elem);\n queueMicrotask(() => {\n renderMath(this);\n });\n }\n }\n\n disconnectedCallback() {\n if (this._root) {\n this._root.unmount();\n this._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BS,cAAc,CAAC,MAAM;QACnB,IAAAC,yBAAU,EAAC,IAAI,CAAC;MAClB,CAAC,CAAC;IACJ;EACF;EAEAC,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACjC,KAAK,EAAE;MACd,IAAI,CAACA,KAAK,CAACkC,OAAO,CAAC,CAAC;MACpB,IAAI,CAAClC,KAAK,GAAG,IAAI;IACnB;EACF;AACF;AAACmC,OAAA,CAAAC,OAAA,GAAAzC,qBAAA","ignoreList":[]}
|
package/lib/main.js
CHANGED
|
@@ -26,7 +26,8 @@ const StyledPrompt = (0, _styles.styled)(_Typography.default)(({
|
|
|
26
26
|
width: '100%',
|
|
27
27
|
color: _renderUi.color.text(),
|
|
28
28
|
marginBottom: theme.spacing(2),
|
|
29
|
-
fontSize: 'inherit'
|
|
29
|
+
fontSize: 'inherit',
|
|
30
|
+
display: 'block'
|
|
30
31
|
}));
|
|
31
32
|
const TeacherInstructions = (0, _styles.styled)('div')(({
|
|
32
33
|
theme
|
package/lib/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodashEs","_debug","_Typography","_styles","_editableHtmlTipTap","_renderUi","_annotationEditor","log","debug","MainContainer","styled","UiLayout","backgroundColor","color","background","text","StyledPrompt","Typography","theme","width","marginBottom","spacing","fontSize","TeacherInstructions","Editor","EditableHtml","borderRadius","SrOnly","position","left","top","height","overflow","Main","React","Component","constructor","args","_defineProperty2","default","debounce","props","onValueChange","onCommentChange","render","model","session","onAnnotationsChange","animationsDisabled","annotatorMode","customKeys","dimensions","disabled","disabledAnnotator","equationEditor","extraCSSRules","feedback","mathInput","playersToolbarPosition","predefinedAnnotations","prompt","spanishInput","specialInput","spellCheckEnabled","teacherInstructions","annotations","comment","value","maxHeight","toolbarOpts","teacherInstructionsDiv","createElement","PreviewPrompt","defaultClassName","languageCharactersProps","push","language","ref","containerRef","Collapsible","labels","hidden","visible","component","onChange","changeSessionComment","disabledMath","keypadMode","className","changeSessionValue","markup","maxWidth","toString","minWidth","minHeight","highlightShape","spellCheck","charactersLimit","autoWidthToolbar","pluginProps","math","controlledKeypadMode","video","audio","table","textAlign","h3","separateParagraphs","ul_list","ol_list","Feedback","correctness","exports","PropTypes","func","isRequired","object","shape","string","array","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'lodash-es';\nimport debug from 'debug';\n\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\n\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { color, Feedback, Collapsible, PreviewPrompt, UiLayout } from '@pie-lib/render-ui';\n\nimport AnnotationEditor from './annotation/annotation-editor';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst MainContainer = styled(UiLayout)({\n backgroundColor: color.background(),\n color: color.text(),\n});\n\nconst StyledPrompt = styled(Typography)(({ theme }) => ({\n width: '100%',\n color: color.text(),\n marginBottom: theme.spacing(2),\n fontSize: 'inherit',\n}));\n\nconst TeacherInstructions = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst Editor = styled(EditableHtml)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n borderRadius: '4px',\n}));\n\nconst SrOnly = styled('h2')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n onValueChange: PropTypes.func.isRequired,\n onAnnotationsChange: PropTypes.func.isRequired,\n onCommentChange: PropTypes.func.isRequired,\n model: PropTypes.object,\n session: PropTypes.shape({\n value: PropTypes.string,\n annotations: PropTypes.array,\n comment: PropTypes.string,\n }).isRequired,\n };\n\n changeSessionValue = debounce(this.props.onValueChange, 1500);\n\n changeSessionComment = debounce(this.props.onCommentChange, 1500);\n\n render() {\n const { model, session, onAnnotationsChange } = this.props;\n const {\n animationsDisabled,\n annotatorMode,\n customKeys,\n dimensions,\n disabled,\n disabledAnnotator,\n equationEditor,\n extraCSSRules,\n feedback,\n mathInput,\n playersToolbarPosition,\n predefinedAnnotations,\n prompt,\n spanishInput,\n specialInput,\n spellCheckEnabled,\n teacherInstructions,\n } = model;\n const { annotations, comment, value } = session;\n const { width, height } = dimensions || {};\n const maxHeight = '40vh';\n const toolbarOpts = { position: playersToolbarPosition === 'top' ? 'top' : 'bottom' };\n\n log('[render] disabled? ', disabled);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const languageCharactersProps = [];\n\n if (spanishInput) {\n languageCharactersProps.push({ language: 'spanish' });\n }\n\n if (specialInput) {\n languageCharactersProps.push({ language: 'special' });\n }\n\n return (\n <MainContainer\n extraCSSRules={extraCSSRules}\n ref={(ref) => {\n this.containerRef = ref;\n }}\n >\n <SrOnly>Constructed Response Question</SrOnly>\n\n {teacherInstructions && (\n <TeacherInstructions>\n {!animationsDisabled ? (\n <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </TeacherInstructions>\n )}\n\n {prompt && (\n <StyledPrompt component={'span'}>\n <PreviewPrompt defaultClassName=\"prompt\" prompt={model.prompt} />\n </StyledPrompt>\n )}\n\n {annotatorMode ? (\n <AnnotationEditor\n text={value || ''}\n annotations={annotations || []}\n comment={comment || ''}\n predefinedAnnotations={predefinedAnnotations || []}\n onChange={onAnnotationsChange}\n onCommentChange={this.changeSessionComment}\n width={width}\n height={height}\n maxHeight={maxHeight}\n disabled={disabledAnnotator}\n disabledMath={!mathInput}\n customKeys={customKeys}\n keypadMode={equationEditor}\n />\n ) : (\n <Editor\n className=\"response-area-editor\"\n onChange={this.changeSessionValue}\n markup={value || ''}\n maxWidth={width && width.toString()}\n minWidth={'100px'}\n minHeight={height && height.toString()}\n maxHeight={maxHeight}\n disabled={disabled}\n highlightShape={true}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n charactersLimit={50000}\n autoWidthToolbar\n pluginProps={{\n math: {\n disabled: !mathInput,\n customKeys: this.props.model.customKeys,\n keypadMode: this.props.model.equationEditor,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n table: {\n disabled: true,\n },\n textAlign: {\n disabled: true,\n },\n h3: {\n disabled: true,\n },\n separateParagraphs: { disabled: false },\n ul_list: { disabled: true },\n ol_list: { disabled: true },\n }}\n languageCharactersProps={languageCharactersProps}\n />\n )}\n\n {feedback && <Feedback correctness=\"correct\" feedback={feedback} />}\n </MainContainer>\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,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEA,IAAAQ,iBAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,MAAMS,GAAG,GAAG,IAAAC,cAAK,EAAC,6BAA6B,CAAC;AAEhD,MAAMC,aAAa,GAAG,IAAAC,cAAM,EAACC,kBAAQ,CAAC,CAAC;EACrCC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC,CAAC;EACnCD,KAAK,EAAEA,eAAK,CAACE,IAAI,CAAC;AACpB,CAAC,CAAC;AAEF,MAAMC,YAAY,GAAG,IAAAN,cAAM,EAACO,mBAAU,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACtDC,KAAK,EAAE,MAAM;EACbN,KAA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AAAA,IAAA;AAAA,IAAAK,gBAAA,CAAAC,OAAA,EAzJYN,IAAI,eACI;EACjBS,aAAa,EAAEuE,kBAAS,CAACC,IAAI,CAACC,UAAU;EACxCpE,mBAAmB,EAAEkE,kBAAS,CAACC,IAAI,CAACC,UAAU;EAC9CxE,eAAe,EAAEsE,kBAAS,CAACC,IAAI,CAACC,UAAU;EAC1CtE,KAAK,EAAEoE,kBAAS,CAACG,MAAM;EACvBtE,OAAO,EAAEmE,kBAAS,CAACI,KAAK,CAAC;IACvBlD,KAAK,EAAE8C,kBAAS,CAACK,MAAM;IACvBrD,WAAW,EAAEgD,kBAAS,CAACM,KAAK;IAC5BrD,OAAO,EAAE+C,kBAAS,CAACK;EACrB,CAAC,CAAC,CAACH;AACL,CAAC;AAAA,IAAAK,QAAA,GAAAR,OAAA,CAAAzE,OAAA,GAgJYN,IAAI","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"main.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodashEs","_debug","_Typography","_styles","_editableHtmlTipTap","_renderUi","_annotationEditor","log","debug","MainContainer","styled","UiLayout","backgroundColor","color","background","text","StyledPrompt","Typography","theme","width","marginBottom","spacing","fontSize","display","TeacherInstructions","Editor","EditableHtml","borderRadius","SrOnly","position","left","top","height","overflow","Main","React","Component","constructor","args","_defineProperty2","default","debounce","props","onValueChange","onCommentChange","render","model","session","onAnnotationsChange","animationsDisabled","annotatorMode","customKeys","dimensions","disabled","disabledAnnotator","equationEditor","extraCSSRules","feedback","mathInput","playersToolbarPosition","predefinedAnnotations","prompt","spanishInput","specialInput","spellCheckEnabled","teacherInstructions","annotations","comment","value","maxHeight","toolbarOpts","teacherInstructionsDiv","createElement","PreviewPrompt","defaultClassName","languageCharactersProps","push","language","ref","containerRef","Collapsible","labels","hidden","visible","component","onChange","changeSessionComment","disabledMath","keypadMode","className","changeSessionValue","markup","maxWidth","toString","minWidth","minHeight","highlightShape","spellCheck","charactersLimit","autoWidthToolbar","pluginProps","math","controlledKeypadMode","video","audio","table","textAlign","h3","separateParagraphs","ul_list","ol_list","Feedback","correctness","exports","PropTypes","func","isRequired","object","shape","string","array","_default"],"sources":["../src/main.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { debounce } from 'lodash-es';\nimport debug from 'debug';\n\nimport Typography from '@mui/material/Typography';\nimport { styled } from '@mui/material/styles';\n\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\nimport { color, Feedback, Collapsible, PreviewPrompt, UiLayout } from '@pie-lib/render-ui';\n\nimport AnnotationEditor from './annotation/annotation-editor';\n\nconst log = debug('@pie-ui:extended-text-entry');\n\nconst MainContainer = styled(UiLayout)({\n backgroundColor: color.background(),\n color: color.text(),\n});\n\nconst StyledPrompt = styled(Typography)(({ theme }) => ({\n width: '100%',\n color: color.text(),\n marginBottom: theme.spacing(2),\n fontSize: 'inherit',\n display: 'block',\n}));\n\nconst TeacherInstructions = styled('div')(({ theme }) => ({\n marginBottom: theme.spacing(2),\n}));\n\nconst Editor = styled(EditableHtml)(({ theme }) => ({\n marginBottom: theme.spacing(2),\n borderRadius: '4px',\n}));\n\nconst SrOnly = styled('h2')({\n position: 'absolute',\n left: '-10000px',\n top: 'auto',\n width: '1px',\n height: '1px',\n overflow: 'hidden',\n});\n\nexport class Main extends React.Component {\n static propTypes = {\n onValueChange: PropTypes.func.isRequired,\n onAnnotationsChange: PropTypes.func.isRequired,\n onCommentChange: PropTypes.func.isRequired,\n model: PropTypes.object,\n session: PropTypes.shape({\n value: PropTypes.string,\n annotations: PropTypes.array,\n comment: PropTypes.string,\n }).isRequired,\n };\n\n changeSessionValue = debounce(this.props.onValueChange, 1500);\n\n changeSessionComment = debounce(this.props.onCommentChange, 1500);\n\n render() {\n const { model, session, onAnnotationsChange } = this.props;\n const {\n animationsDisabled,\n annotatorMode,\n customKeys,\n dimensions,\n disabled,\n disabledAnnotator,\n equationEditor,\n extraCSSRules,\n feedback,\n mathInput,\n playersToolbarPosition,\n predefinedAnnotations,\n prompt,\n spanishInput,\n specialInput,\n spellCheckEnabled,\n teacherInstructions,\n } = model;\n const { annotations, comment, value } = session;\n const { width, height } = dimensions || {};\n const maxHeight = '40vh';\n const toolbarOpts = { position: playersToolbarPosition === 'top' ? 'top' : 'bottom' };\n\n log('[render] disabled? ', disabled);\n\n const teacherInstructionsDiv = (\n <PreviewPrompt defaultClassName=\"teacher-instructions\" prompt={teacherInstructions} />\n );\n\n const languageCharactersProps = [];\n\n if (spanishInput) {\n languageCharactersProps.push({ language: 'spanish' });\n }\n\n if (specialInput) {\n languageCharactersProps.push({ language: 'special' });\n }\n\n return (\n <MainContainer\n extraCSSRules={extraCSSRules}\n ref={(ref) => {\n this.containerRef = ref;\n }}\n >\n <SrOnly>Constructed Response Question</SrOnly>\n\n {teacherInstructions && (\n <TeacherInstructions>\n {!animationsDisabled ? (\n <Collapsible\n labels={{ hidden: 'Show Teacher Instructions', visible: 'Hide Teacher Instructions' }}\n >\n {teacherInstructionsDiv}\n </Collapsible>\n ) : (\n teacherInstructionsDiv\n )}\n </TeacherInstructions>\n )}\n\n {prompt && (\n <StyledPrompt component={'span'}>\n <PreviewPrompt defaultClassName=\"prompt\" prompt={model.prompt} />\n </StyledPrompt>\n )}\n\n {annotatorMode ? (\n <AnnotationEditor\n text={value || ''}\n annotations={annotations || []}\n comment={comment || ''}\n predefinedAnnotations={predefinedAnnotations || []}\n onChange={onAnnotationsChange}\n onCommentChange={this.changeSessionComment}\n width={width}\n height={height}\n maxHeight={maxHeight}\n disabled={disabledAnnotator}\n disabledMath={!mathInput}\n customKeys={customKeys}\n keypadMode={equationEditor}\n />\n ) : (\n <Editor\n className=\"response-area-editor\"\n onChange={this.changeSessionValue}\n markup={value || ''}\n maxWidth={width && width.toString()}\n minWidth={'100px'}\n minHeight={height && height.toString()}\n maxHeight={maxHeight}\n disabled={disabled}\n highlightShape={true}\n toolbarOpts={toolbarOpts}\n spellCheck={spellCheckEnabled}\n charactersLimit={50000}\n autoWidthToolbar\n pluginProps={{\n math: {\n disabled: !mathInput,\n customKeys: this.props.model.customKeys,\n keypadMode: this.props.model.equationEditor,\n controlledKeypadMode: false,\n },\n video: {\n disabled: true,\n },\n audio: {\n disabled: true,\n },\n table: {\n disabled: true,\n },\n textAlign: {\n disabled: true,\n },\n h3: {\n disabled: true,\n },\n separateParagraphs: { disabled: false },\n ul_list: { disabled: true },\n ol_list: { disabled: true },\n }}\n languageCharactersProps={languageCharactersProps}\n />\n )}\n\n {feedback && <Feedback correctness=\"correct\" feedback={feedback} />}\n </MainContainer>\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,SAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAEA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AAEA,IAAAM,mBAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AAEA,IAAAQ,iBAAA,GAAAT,sBAAA,CAAAC,OAAA;AAEA,MAAMS,GAAG,GAAG,IAAAC,cAAK,EAAC,6BAA6B,CAAC;AAEhD,MAAMC,aAAa,GAAG,IAAAC,cAAM,EAACC,kBAAQ,CAAC,CAAC;EACrCC,eAAe,EAAEC,eAAK,CAACC,UAAU,CAAC,CAAC;EACnCD,KAAK,EAAEA,eAAK,CAACE,IAAI,CAAC;AACpB,CAAC,CAAC;AAEF,MAAMC,YAAY,GAAG,IAAAN,cAAM,EAACO,mBAAU,CAAC,CAAC,CAAC;EAAEC;AAAM,CAAC,MAAM;EACtDC,KAAK,EAAE,MAAM;EACbN,KAAK,EAAEA,eAAK,CAACE,IAAI,CAAC,CAAC;EACnBK,YAAY,EAAEF,KAAK,CAACG,OAAO,CAAC,CAAC,CAAC;EA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aAAa,EAAEuE,kBAAS,CAACC,IAAI,CAACC,UAAU;EACxCpE,mBAAmB,EAAEkE,kBAAS,CAACC,IAAI,CAACC,UAAU;EAC9CxE,eAAe,EAAEsE,kBAAS,CAACC,IAAI,CAACC,UAAU;EAC1CtE,KAAK,EAAEoE,kBAAS,CAACG,MAAM;EACvBtE,OAAO,EAAEmE,kBAAS,CAACI,KAAK,CAAC;IACvBlD,KAAK,EAAE8C,kBAAS,CAACK,MAAM;IACvBrD,WAAW,EAAEgD,kBAAS,CAACM,KAAK;IAC5BrD,OAAO,EAAE+C,kBAAS,CAACK;EACrB,CAAC,CAAC,CAACH;AACL,CAAC;AAAA,IAAAK,QAAA,GAAAR,OAAA,CAAAzE,OAAA,GAgJYN,IAAI","ignoreList":[]}
|
package/module/configure.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_dll_react as e,_dll_prop_types as t,_dll_mui__material as n,_dll_mui__material_styles as i,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@^5.2.6/module/index.js";import{_dll_pie_lib__config_ui as s}from"../../../@pie-lib/config-module@^4.0.11/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@^7.1.8/module/index.js";var l={};Object.defineProperty(l,"__esModule",{value:!0});class r extends CustomEvent{constructor(e,t=!1){super(r.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}r.TYPE="model.updated";var d=l.ModelUpdatedEvent=r;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var p=l.DeleteImageEvent=c;class u extends CustomEvent{constructor(e){super(u.TYPE,{bubbles:!0,detail:e}),this.handler=e}}u.TYPE="insert.image";var h=l.InsertImageEvent=u;class g extends CustomEvent{constructor(e,t){super(g.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}g.TYPE="delete.sound";var b=l.DeleteSoundEvent=g;class m extends CustomEvent{constructor(e){super(m.TYPE,{bubbles:!0,detail:e}),this.handler=e}}m.TYPE="insert.sound";var _=l.InsertSoundEvent=m;const E=e,f=t,{Typography:C}=n,{styled:I}=i,{FeedbackSelector:v}=s,{InputContainer:S}=s,{settings:x}=s,{layout:y}=s,k=o,{ALL_PLUGINS:P}=o;function w(e){let t,n=e[0],i=1;for(;i<e.length;){const a=e[i],s=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=s(n)):"call"!==a&&"optionalCall"!==a||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}const{Panel:M,toggle:T,numberFields:A,dropdown:D}=x,R={type:"default",default:"Your answer has been submitted"},q=I(C)(({theme:e})=>({paddingBottom:e.spacing(1)})),Y=I(S)(({theme:e})=>({paddingTop:e.spacing(1),marginTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),O=I("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class j extends E.Component{static __initStatic(){this.propTypes={onModelChanged:f.func.isRequired,onConfigurationChanged:f.func,model:f.object.isRequired,configuration:f.object.isRequired,imageSupport:f.object.isRequired,uploadSoundSupport:f.object.isRequired}}constructor(e){super(e),j.prototype.__init.call(this),j.prototype.__init2.call(this),j.prototype.__init3.call(this),this.state={setDimensions:!0}}__init(){this.onPromptChange=e=>{const{onModelChanged:t,model:n}=this.props;t({...n,prompt:e})}}__init2(){this.changeFeedback=e=>{const{model:t,onModelChanged:n}=this.props;n({...t,feedback:e})}}__init3(){this.changeTeacherInstructions=e=>{const{model:t,onModelChanged:n}=this.props;n({...t,teacherInstructions:e})}}render(){const{model:e,configuration:t,imageSupport:n,onConfigurationChanged:i,onModelChanged:a,uploadSoundSupport:s}=this.props,{annotations:o={},contentDimensions:l={},dimensions:r={},equationEditor:d={},feedback:c={},playerSpellCheck:p={},prompt:u={},settingsPanelDisabled:h,spanishInput:g={},specialInput:b={},spellCheck:m={},studentInstructions:_={},teacherInstructions:f={},mathInput:C={},maxImageWidth:I={},maxImageHeight:S={},multiple:x={},withRubric:j={},mathMlOptions:H={},baseInputConfiguration:F={}}=t||{},{errors:G={},extraCSSRules:W,feedbackEnabled:L,promptEnabled:z,spellCheckEnabled:N,teacherInstructionsEnabled:B,toolbarEditorPosition:U}=e||{},{prompt:J,teacherInstructions:K}=G,Q=I&&I.prompt,V=S&&S.prompt,X={position:"top"===U?"top":"bottom"},Z={mathInput:C.settings&&T(C.label),equationEditor:d.enabled&&e.mathInput&&D(d.label,["non-negative-integers","integers","decimals","fractions","Grade 1 - 2","Grade 3 - 5","Grade 6 - 7","Grade 8 - HS","geometry","advanced-algebra","statistics","item-authoring"]),spanishInput:g.settings&&T(g.label),specialInput:b.settings&&T(b.label),dimensions:r.settings&&A(r.label,{width:{label:"Width (px)",suffix:"px",min:100,max:1200},height:{label:"Height (px)",suffix:"px",min:100,max:500}}),"multiple.enabled":x.settings&&T(x.label,!0),promptEnabled:u.settings&&T(u.label),feedbackEnabled:c.settings&&T(c.label),annotationsEnabled:o.settings&&T(o.label),spellCheckEnabled:m.settings&&T(m.label),playerSpellCheckDisabled:p.settings&&T(p.label)},$={teacherInstructionsEnabled:f.settings&&T(f.label),studentInstructionsEnabled:_.settings&&T(_.label),rubricEnabled:w([j,"optionalAccess",e=>e.settings])&&T(w([j,"optionalAccess",e=>e.label]))},ee=e=>Object.assign({...F},e||{});return E.createElement(y.ConfigLayout,{extraCSSRules:W,dimensions:l,hideSettings:h,settings:E.createElement(M,{model:e,configuration:t,onChangeModel:e=>a(e),onChangeConfiguration:e=>i(e),groups:{Settings:Z,Properties:$}})},B&&E.createElement(Y,{label:f.label},E.createElement(k,{className:"prompt",markup:e.teacherInstructions||"",onChange:this.changeTeacherInstructions,imageSupport:n,nonEmpty:!1,error:K,toolbarOpts:X,spellCheck:N,maxImageWidth:I&&I.teacherInstructions||Q,maxImageHeight:S&&S.teacherInstructions||V,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:H,pluginProps:ee(w([f,"optionalAccess",e=>e.inputConfiguration]))}),K&&E.createElement(O,null,K)),z&&E.createElement(Y,{label:u.label},E.createElement(k,{activePlugins:P,className:"prompt",markup:e.prompt||"",onChange:this.onPromptChange,imageSupport:n,nonEmpty:!1,error:J,toolbarOpts:X,spellCheck:N,maxImageWidth:Q,maxImageHeight:V,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:H,pluginProps:ee(w([u,"optionalAccess",e=>e.inputConfiguration]))}),J&&E.createElement(O,null,J)),L&&E.createElement(E.Fragment,null,E.createElement(q,{variant:"h6"},"Feedback"),E.createElement(v,{label:"When submitted, show",feedback:e.feedback||R,onChange:this.changeFeedback,toolbarOpts:X})))}}j.__initStatic();var H={annotationsEnabled:!1,dimensions:{height:100,width:500},equationEditor:"Grade 8 - HS",feedbackEnabled:!1,mathInput:!1,playerSpellCheckDisabled:!0,predefinedAnnotations:[{label:"good",text:"good",type:"positive"},{label:"★",text:"★",type:"positive"},{label:":-)",text:":-)",type:"positive"},{label:"creative",text:"creative",type:"positive"},{label:"run-on",text:"run-on",type:"negative"},{label:"frag",text:"fragment",type:"negative"},{label:"tran",text:"transition",type:"negative"},{label:"supp",text:"support needed",type:"negative"},{label:"punc",text:"punctuation",type:"negative"},{label:"agr",text:"agreement wrong",type:"negative"},{label:"unclear",text:"unclear",type:"negative"},{label:"cut",text:"cut",type:"negative"},{label:"sp",text:"spelling",type:"negative"},{label:"cap",text:"capitalization",type:"negative"},{label:"inf",text:"informal",type:"negative"},{label:"awk",text:"awkward",type:"negative"}],prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,spanishInput:!1,specialInput:!1,spellCheckEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom"},F={annotations:{settings:!1,label:"Annotations"},baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},dimensions:{settings:!0,label:"Text-Entry Display Size"},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},playerSpellCheck:{label:"Disable Student Spellcheck",settings:!0,enabled:!0},equationEditor:{settings:!1,label:"Equation Editor",enabled:!0},feedback:{settings:!0,label:"Feedback"},mathInput:{settings:!0,label:"Student response can include math notation",enabled:!1},settingsPanelDisabled:!1,spanishInput:{settings:!0,label:"Students can insert Spanish",enabled:!1},specialInput:{settings:!0,label:"Students can insert Special Characters",enabled:!1},multiple:{settings:!1,label:"Multiple Parts",enabled:!1},studentInstructions:{settings:!1,label:"Student Instructions"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,prompt:300},maxImageHeight:{teacherInstructions:300,prompt:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1}};const G=e,{createRoot:W}=a;function L(e){let t,n=e[0],i=1;for(;i<e.length;){const a=e[i],s=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=s(n)):"call"!==a&&"optionalCall"!==a||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}class z extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={},t)=>{const n={...H,...e};return L([t,"optionalAccess",e=>e.withRubric,"optionalAccess",e=>e.forceEnabled])&&!n.rubricEnabled&&(n.rubricEnabled=!0),n}}constructor(){super(),this._root=null,this._configuration=F,L([this,"access",e=>e._configuration,"access",e=>e.withRubric,"optionalAccess",e=>e.forceEnabled])&&(this._configuration.withRubric.settings=!1),this._model=z.createDefaultModel({},this._configuration)}set model(e){this._model=z.createDefaultModel(e,this._configuration),this.render()}set configuration(e){this._configuration={...F,...e};const{withRubric:t={}}=e||{};L([t,"optionalAccess",e=>e.forceEnabled])&&(this._configuration.withRubric.settings=!1,this._model.rubricEnabled||(this._model.rubricEnabled=!0)),this.render()}onModelChanged(e){this._model=e,this.render(),this.dispatchEvent(new d(this._model,!1))}onConfigurationChanged(e){this._configuration={...F,...e},this._model&&this.onModelChanged(this._model),this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new p(e,t))}insertSound(e){this.dispatchEvent(new _(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=G.createElement(j,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=W(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}z.__initStatic();export{z as default};
|
|
1
|
+
import{_dll_react as e,_dll_prop_types as t,_dll_mui__material as n,_dll_mui__material_styles as i,_dll_react_dom_client as a}from"../../../@pie-lib/shared-module@^5.2.7/module/index.js";import{_dll_pie_lib__config_ui as s}from"../../../@pie-lib/config-module@^4.0.12/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as o}from"../../../@pie-lib/editable-html-module@^7.1.9/module/index.js";var l={};Object.defineProperty(l,"__esModule",{value:!0});class r extends CustomEvent{constructor(e,t=!1){super(r.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}r.TYPE="model.updated";var d=l.ModelUpdatedEvent=r;class c extends CustomEvent{constructor(e,t){super(c.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}c.TYPE="delete.image";var p=l.DeleteImageEvent=c;class u extends CustomEvent{constructor(e){super(u.TYPE,{bubbles:!0,detail:e}),this.handler=e}}u.TYPE="insert.image";var h=l.InsertImageEvent=u;class g extends CustomEvent{constructor(e,t){super(g.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}g.TYPE="delete.sound";var b=l.DeleteSoundEvent=g;class m extends CustomEvent{constructor(e){super(m.TYPE,{bubbles:!0,detail:e}),this.handler=e}}m.TYPE="insert.sound";var _=l.InsertSoundEvent=m;const E=e,f=t,{Typography:C}=n,{styled:I}=i,{FeedbackSelector:v}=s,{InputContainer:S}=s,{settings:x}=s,{layout:y}=s,k=o,{ALL_PLUGINS:P}=o;function w(e){let t,n=e[0],i=1;for(;i<e.length;){const a=e[i],s=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=s(n)):"call"!==a&&"optionalCall"!==a||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}const{Panel:M,toggle:T,numberFields:A,dropdown:D}=x,R={type:"default",default:"Your answer has been submitted"},q=I(C)(({theme:e})=>({paddingBottom:e.spacing(1)})),Y=I(S)(({theme:e})=>({paddingTop:e.spacing(1),marginTop:e.spacing(2),marginBottom:e.spacing(2),width:"100%"})),O=I("div")(({theme:e})=>({fontSize:e.typography.fontSize-2,color:e.palette.error.main,paddingTop:e.spacing(1)}));class j extends E.Component{static __initStatic(){this.propTypes={onModelChanged:f.func.isRequired,onConfigurationChanged:f.func,model:f.object.isRequired,configuration:f.object.isRequired,imageSupport:f.object.isRequired,uploadSoundSupport:f.object.isRequired}}constructor(e){super(e),j.prototype.__init.call(this),j.prototype.__init2.call(this),j.prototype.__init3.call(this),this.state={setDimensions:!0}}__init(){this.onPromptChange=e=>{const{onModelChanged:t,model:n}=this.props;t({...n,prompt:e})}}__init2(){this.changeFeedback=e=>{const{model:t,onModelChanged:n}=this.props;n({...t,feedback:e})}}__init3(){this.changeTeacherInstructions=e=>{const{model:t,onModelChanged:n}=this.props;n({...t,teacherInstructions:e})}}render(){const{model:e,configuration:t,imageSupport:n,onConfigurationChanged:i,onModelChanged:a,uploadSoundSupport:s}=this.props,{annotations:o={},contentDimensions:l={},dimensions:r={},equationEditor:d={},feedback:c={},playerSpellCheck:p={},prompt:u={},settingsPanelDisabled:h,spanishInput:g={},specialInput:b={},spellCheck:m={},studentInstructions:_={},teacherInstructions:f={},mathInput:C={},maxImageWidth:I={},maxImageHeight:S={},multiple:x={},withRubric:j={},mathMlOptions:H={},baseInputConfiguration:F={}}=t||{},{errors:G={},extraCSSRules:W,feedbackEnabled:L,promptEnabled:z,spellCheckEnabled:N,teacherInstructionsEnabled:B,toolbarEditorPosition:U}=e||{},{prompt:J,teacherInstructions:K}=G,Q=I&&I.prompt,V=S&&S.prompt,X={position:"top"===U?"top":"bottom"},Z={mathInput:C.settings&&T(C.label),equationEditor:d.enabled&&e.mathInput&&D(d.label,["non-negative-integers","integers","decimals","fractions","Grade 1 - 2","Grade 3 - 5","Grade 6 - 7","Grade 8 - HS","geometry","advanced-algebra","statistics","item-authoring"]),spanishInput:g.settings&&T(g.label),specialInput:b.settings&&T(b.label),dimensions:r.settings&&A(r.label,{width:{label:"Width (px)",suffix:"px",min:100,max:1200},height:{label:"Height (px)",suffix:"px",min:100,max:500}}),"multiple.enabled":x.settings&&T(x.label,!0),promptEnabled:u.settings&&T(u.label),feedbackEnabled:c.settings&&T(c.label),annotationsEnabled:o.settings&&T(o.label),spellCheckEnabled:m.settings&&T(m.label),playerSpellCheckDisabled:p.settings&&T(p.label)},$={teacherInstructionsEnabled:f.settings&&T(f.label),studentInstructionsEnabled:_.settings&&T(_.label),rubricEnabled:w([j,"optionalAccess",e=>e.settings])&&T(w([j,"optionalAccess",e=>e.label]))},ee=e=>Object.assign({...F},e||{});return E.createElement(y.ConfigLayout,{extraCSSRules:W,dimensions:l,hideSettings:h,settings:E.createElement(M,{model:e,configuration:t,onChangeModel:e=>a(e),onChangeConfiguration:e=>i(e),groups:{Settings:Z,Properties:$}})},B&&E.createElement(Y,{label:f.label},E.createElement(k,{className:"prompt",markup:e.teacherInstructions||"",onChange:this.changeTeacherInstructions,imageSupport:n,nonEmpty:!1,error:K,toolbarOpts:X,spellCheck:N,maxImageWidth:I&&I.teacherInstructions||Q,maxImageHeight:S&&S.teacherInstructions||V,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:H,pluginProps:ee(w([f,"optionalAccess",e=>e.inputConfiguration]))}),K&&E.createElement(O,null,K)),z&&E.createElement(Y,{label:u.label},E.createElement(k,{activePlugins:P,className:"prompt",markup:e.prompt||"",onChange:this.onPromptChange,imageSupport:n,nonEmpty:!1,error:J,toolbarOpts:X,spellCheck:N,maxImageWidth:Q,maxImageHeight:V,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}],mathMlOptions:H,pluginProps:ee(w([u,"optionalAccess",e=>e.inputConfiguration]))}),J&&E.createElement(O,null,J)),L&&E.createElement(E.Fragment,null,E.createElement(q,{variant:"h6"},"Feedback"),E.createElement(v,{label:"When submitted, show",feedback:e.feedback||R,onChange:this.changeFeedback,toolbarOpts:X})))}}j.__initStatic();var H={annotationsEnabled:!1,dimensions:{height:100,width:500},equationEditor:"Grade 8 - HS",feedbackEnabled:!1,mathInput:!1,playerSpellCheckDisabled:!0,predefinedAnnotations:[{label:"good",text:"good",type:"positive"},{label:"★",text:"★",type:"positive"},{label:":-)",text:":-)",type:"positive"},{label:"creative",text:"creative",type:"positive"},{label:"run-on",text:"run-on",type:"negative"},{label:"frag",text:"fragment",type:"negative"},{label:"tran",text:"transition",type:"negative"},{label:"supp",text:"support needed",type:"negative"},{label:"punc",text:"punctuation",type:"negative"},{label:"agr",text:"agreement wrong",type:"negative"},{label:"unclear",text:"unclear",type:"negative"},{label:"cut",text:"cut",type:"negative"},{label:"sp",text:"spelling",type:"negative"},{label:"cap",text:"capitalization",type:"negative"},{label:"inf",text:"informal",type:"negative"},{label:"awk",text:"awkward",type:"negative"}],prompt:"",promptEnabled:!0,rationale:"",rationaleEnabled:!0,spanishInput:!1,specialInput:!1,spellCheckEnabled:!0,studentInstructionsEnabled:!0,teacherInstructions:"",teacherInstructionsEnabled:!0,toolbarEditorPosition:"bottom"},F={annotations:{settings:!1,label:"Annotations"},baseInputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1},h3:{disabled:!0},blockquote:{disabled:!0},textAlign:{disabled:!0},showParagraphs:{disabled:!1},separateParagraphs:{disabled:!0}},dimensions:{settings:!0,label:"Text-Entry Display Size"},spellCheck:{label:"Spellcheck",settings:!1,enabled:!0},playerSpellCheck:{label:"Disable Student Spellcheck",settings:!0,enabled:!0},equationEditor:{settings:!1,label:"Equation Editor",enabled:!0},feedback:{settings:!0,label:"Feedback"},mathInput:{settings:!0,label:"Student response can include math notation",enabled:!1},settingsPanelDisabled:!1,spanishInput:{settings:!0,label:"Students can insert Spanish",enabled:!1},specialInput:{settings:!0,label:"Students can insert Special Characters",enabled:!1},multiple:{settings:!1,label:"Multiple Parts",enabled:!1},studentInstructions:{settings:!1,label:"Student Instructions"},prompt:{settings:!0,label:"Prompt",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},teacherInstructions:{settings:!0,label:"Teacher Instructions",inputConfiguration:{audio:{disabled:!1},video:{disabled:!1},image:{disabled:!1}},required:!1},maxImageWidth:{teacherInstructions:300,prompt:300},maxImageHeight:{teacherInstructions:300,prompt:300},withRubric:{settings:!1,label:"Add Rubric"},mathMlOptions:{mmlOutput:!1,mmlEditing:!1}};const G=e,{createRoot:W}=a;function L(e){let t,n=e[0],i=1;for(;i<e.length;){const a=e[i],s=e[i+1];if(i+=2,("optionalAccess"===a||"optionalCall"===a)&&null==n)return;"access"===a||"optionalAccess"===a?(t=n,n=s(n)):"call"!==a&&"optionalCall"!==a||(n=s((...e)=>n.call(t,...e)),t=void 0)}return n}class z extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={},t)=>{const n={...H,...e};return L([t,"optionalAccess",e=>e.withRubric,"optionalAccess",e=>e.forceEnabled])&&!n.rubricEnabled&&(n.rubricEnabled=!0),n}}constructor(){super(),this._root=null,this._configuration=F,L([this,"access",e=>e._configuration,"access",e=>e.withRubric,"optionalAccess",e=>e.forceEnabled])&&(this._configuration.withRubric.settings=!1),this._model=z.createDefaultModel({},this._configuration)}set model(e){this._model=z.createDefaultModel(e,this._configuration),this.render()}set configuration(e){this._configuration={...F,...e};const{withRubric:t={}}=e||{};L([t,"optionalAccess",e=>e.forceEnabled])&&(this._configuration.withRubric.settings=!1,this._model.rubricEnabled||(this._model.rubricEnabled=!0)),this.render()}onModelChanged(e){this._model=e,this.render(),this.dispatchEvent(new d(this._model,!1))}onConfigurationChanged(e){this._configuration={...F,...e},this._model&&this.onModelChanged(this._model),this.render()}insertImage(e){this.dispatchEvent(new h(e))}onDeleteImage(e,t){this.dispatchEvent(new p(e,t))}insertSound(e){this.dispatchEvent(new _(e))}onDeleteSound(e,t){this.dispatchEvent(new b(e,t))}render(){if(this._model){const e=G.createElement(j,{model:this._model,configuration:this._configuration,onModelChanged:this.onModelChanged.bind(this),onConfigurationChanged:this.onConfigurationChanged.bind(this),imageSupport:{add:this.insertImage.bind(this),delete:this.onDeleteImage.bind(this)},uploadSoundSupport:{add:this.insertSound.bind(this),delete:this.onDeleteSound.bind(this)}});this._root||(this._root=W(this)),this._root.render(e)}}connectedCallback(){this.render()}disconnectedCallback(){this._root&&(this._root.unmount(),this._root=null)}}z.__initStatic();export{z as default};
|