@pie-element/complex-rubric 2.0.2-next.3 → 2.1.1
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 +36 -0
- package/configure/CHANGELOG.md +24 -0
- package/configure/lib/index.js.map +1 -1
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.json +937 -0
- package/configure/node_modules/@pie-lib/render-ui/CHANGELOG.md +848 -0
- package/configure/node_modules/@pie-lib/render-ui/LICENSE.md +5 -0
- package/configure/node_modules/@pie-lib/render-ui/README.md +33 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js +134 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/collapsible/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js +157 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/color.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js +151 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/feedback.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js +24 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/has-text.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js +90 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/html-and-math.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js +104 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/index.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js +60 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/input-container.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js +133 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-layout.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js +206 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/preview-prompt.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/purpose.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js +28 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/readable.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js +151 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/response-indicators.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js +181 -0
- package/configure/node_modules/@pie-lib/render-ui/lib/withUndoReset.js.map +1 -0
- package/configure/node_modules/@pie-lib/render-ui/package.json +30 -0
- package/configure/node_modules/@pie-lib/render-ui/src/collapsible/index.jsx +63 -0
- package/configure/node_modules/@pie-lib/render-ui/src/color.js +55 -0
- package/configure/node_modules/@pie-lib/render-ui/src/feedback.jsx +100 -0
- package/configure/node_modules/@pie-lib/render-ui/src/has-text.js +14 -0
- package/configure/node_modules/@pie-lib/render-ui/src/html-and-math.js +34 -0
- package/configure/node_modules/@pie-lib/render-ui/src/index.js +27 -0
- package/configure/node_modules/@pie-lib/render-ui/src/input-container.jsx +41 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-layout.jsx +84 -0
- package/configure/node_modules/@pie-lib/render-ui/src/preview-prompt.jsx +130 -0
- package/configure/node_modules/@pie-lib/render-ui/src/purpose.jsx +17 -0
- package/configure/node_modules/@pie-lib/render-ui/src/readable.jsx +19 -0
- package/configure/node_modules/@pie-lib/render-ui/src/response-indicators.jsx +89 -0
- package/configure/node_modules/@pie-lib/render-ui/src/withUndoReset.jsx +116 -0
- package/configure/package.json +8 -8
- package/configure/src/index.js +1 -0
- package/controller/CHANGELOG.md +23 -0
- package/controller/package.json +2 -2
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,42 @@
|
|
|
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
|
+
## [2.1.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.1.0...@pie-element/complex-rubric@2.1.1) (2023-11-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* trigger new version ([0ac3b67](https://github.com/pie-framework/pie-elements/commit/0ac3b676f3b1d3b390769b2479fb38525e5e521a))
|
|
12
|
+
* update pie-lib ([74283d7](https://github.com/pie-framework/pie-elements/commit/74283d71b12ab9c82875ce995368e5e39f4face6))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
# [2.1.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.0.1...@pie-element/complex-rubric@2.1.0) (2023-11-27)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* update pie-lib/pie-toolbox PD-3271, PD-3261 ([7a795bf](https://github.com/pie-framework/pie-elements/commit/7a795bfd7e2fd865774828ad23b0a8cbbac98356))
|
|
24
|
+
* update pie-lib/pie-toolbox PD-597 ([1ec84aa](https://github.com/pie-framework/pie-elements/commit/1ec84aadae515088ef65b99f780a5e5dca516f99))
|
|
25
|
+
* update pie-lib/pie-toolbox to test build ([9750cdd](https://github.com/pie-framework/pie-elements/commit/9750cdd3ce3018ef8bb63bc2c6db6abba3dad0c4))
|
|
26
|
+
* update pie-lib/pie-toolbox to test build ([4e04cef](https://github.com/pie-framework/pie-elements/commit/4e04cefc163d504d136c9e3b17dbb32d1e22326b))
|
|
27
|
+
* update pie-libs PD-2996 ([cd092c6](https://github.com/pie-framework/pie-elements/commit/cd092c6b5c4db91645394cd23febc1f9a07f46f9))
|
|
28
|
+
* update pie-libs PD-3011, PD-3130, PD-3271 ([7a36106](https://github.com/pie-framework/pie-elements/commit/7a36106efeac0448b7b825989c1eb0b29b6688d4))
|
|
29
|
+
* update pie-toolbox version PD-3298 ([0c282d5](https://github.com/pie-framework/pie-elements/commit/0c282d540aba5b2bb7a8b515bcaa2dba8302d49a))
|
|
30
|
+
* use next pie-element versions ([073ef79](https://github.com/pie-framework/pie-elements/commit/073ef790b3a39f2baaf91ec58983f52f20484fe4))
|
|
31
|
+
* use next pie-element versions ([eafc185](https://github.com/pie-framework/pie-elements/commit/eafc185e7bbe508f93f5c2e342354cbb8ee3c5c6))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Features
|
|
35
|
+
|
|
36
|
+
* update pie-lib/pie-toolbox PD-1886 ([4a978d0](https://github.com/pie-framework/pie-elements/commit/4a978d058b865cc21c1fc84d7d39224e0d7cc88d))
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
6
42
|
## [2.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.0.0...@pie-element/complex-rubric@2.0.1) (2023-11-09)
|
|
7
43
|
|
|
8
44
|
|
package/configure/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,30 @@
|
|
|
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
|
+
## [2.0.3](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.0.2...@pie-element/complex-rubric-configure@2.0.3) (2023-11-27)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* trigger new version ([0ac3b67](https://github.com/pie-framework/pie-elements/commit/0ac3b676f3b1d3b390769b2479fb38525e5e521a))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [2.0.2](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.0.1...@pie-element/complex-rubric-configure@2.0.2) (2023-11-27)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* update pie-toolbox version PD-3298 ([0c282d5](https://github.com/pie-framework/pie-elements/commit/0c282d540aba5b2bb7a8b515bcaa2dba8302d49a))
|
|
23
|
+
* use next pie-element versions ([073ef79](https://github.com/pie-framework/pie-elements/commit/073ef790b3a39f2baaf91ec58983f52f20484fe4))
|
|
24
|
+
* use next pie-element versions ([eafc185](https://github.com/pie-framework/pie-elements/commit/eafc185e7bbe508f93f5c2e342354cbb8ee3c5c6))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
6
30
|
## [2.0.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.0.0...@pie-element/complex-rubric-configure@2.0.1) (2023-11-09)
|
|
7
31
|
|
|
8
32
|
**Note:** Version bump only for package @pie-element/complex-rubric-configure
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.js"],"names":["MODEL_UPDATED","ModelUpdatedEvent","TYPE","RUBRIC_TAG_NAME","MULTI_TRAIT_RUBRIC_TAG_NAME","ComplexSimpleRubricConfigure","RubricConfigure","ComplexMTRConfigure","MultiTraitRubricConfigure","defineComplexRubric","customElements","get","define","prepareCustomizationObject","config","model","configuration","sensibleDefaults","ComplexRubricConfigureElement","m","reset","_model","createDefaultModel","dispatchModelUpdated","_render","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","update","rubrics","dispatchEvent","canUpdateModel","debug","log","_configuration","onConfigurationChanged","bind","resetValue","c","info","onModelChanged","addEventListener","onModelUpdated","removeEventListener","element","React","createElement","Main","ReactDOM","render","HTMLElement","simpleRubric","multiTraitRubric","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,aAAa,GAAGC,sCAAkBC,IAAxC;AACA,IAAMC,eAAe,GAAG,kBAAxB;AACA,IAAMC,2BAA2B,GAAG,8BAApC;;IAEMC,4B;;;;;;;;;;;EAAqCC,e;;IAGrCC,mB;;;;;;;;;;;EAA4BC,gB;;AAGlC,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAM;AAChC,MAAI,CAACC,cAAc,CAACC,GAAf,CAAmBR,eAAnB,CAAL,EAA0C;AACxCO,IAAAA,cAAc,CAACE,MAAf,CAAsBT,eAAtB,EAAuCE,4BAAvC;AACD;;AACD,MAAI,CAACK,cAAc,CAACC,GAAf,CAAmBP,2BAAnB,CAAL,EAAsD;AACpDM,IAAAA,cAAc,CAACE,MAAf,CAAsBR,2BAAtB,EAAmDG,mBAAnD;AACD;AACF,CAPD;;AASAE,mBAAmB;;AAEnB,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,MAAD,EAASC,KAAT,EAAmB;AACpD,MAAMC,aAAa,GAAG,0BAASF,MAAT,EAAiBG,sBAAiBD,aAAlC,CAAtB;AAEA,SAAO;AACLA,IAAAA,aAAa,EAAbA,aADK;AAELD,IAAAA,KAAK,EAALA;AAFK,GAAP;AAID,CAPD;;IASqBG,6B;;;;;AAsBnB,2CAAc;AAAA;;AAAA;AACZ;AADY,uGAyBG,UAACC,CAAD,EAAIC,KAAJ,EAAc;AAC7B,YAAKC,MAAL,GAAcH,6BAA6B,CAACI,kBAA9B,CAAiDH,CAAjD,EAAoD,MAAKE,MAAzD,CAAd;;AAEA,YAAKE,oBAAL,CAA0BH,KAA1B;;
|
|
1
|
+
{"version":3,"sources":["../src/index.js"],"names":["MODEL_UPDATED","ModelUpdatedEvent","TYPE","RUBRIC_TAG_NAME","MULTI_TRAIT_RUBRIC_TAG_NAME","ComplexSimpleRubricConfigure","RubricConfigure","ComplexMTRConfigure","MultiTraitRubricConfigure","defineComplexRubric","customElements","get","define","prepareCustomizationObject","config","model","configuration","sensibleDefaults","ComplexRubricConfigureElement","m","reset","_model","createDefaultModel","dispatchModelUpdated","_render","e","target","preventDefault","stopImmediatePropagation","id","getAttribute","update","rubrics","dispatchEvent","canUpdateModel","debug","log","_configuration","onConfigurationChanged","bind","resetValue","c","info","onModelChanged","addEventListener","onModelUpdated","removeEventListener","element","React","createElement","Main","ReactDOM","render","HTMLElement","simpleRubric","multiTraitRubric","defaults"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;AAEA,IAAMA,aAAa,GAAGC,sCAAkBC,IAAxC;AACA,IAAMC,eAAe,GAAG,kBAAxB;AACA,IAAMC,2BAA2B,GAAG,8BAApC;;IAEMC,4B;;;;;;;;;;;EAAqCC,e;;IAGrCC,mB;;;;;;;;;;;EAA4BC,gB;;AAGlC,IAAMC,mBAAmB,GAAG,SAAtBA,mBAAsB,GAAM;AAChC,MAAI,CAACC,cAAc,CAACC,GAAf,CAAmBR,eAAnB,CAAL,EAA0C;AACxCO,IAAAA,cAAc,CAACE,MAAf,CAAsBT,eAAtB,EAAuCE,4BAAvC;AACD;;AACD,MAAI,CAACK,cAAc,CAACC,GAAf,CAAmBP,2BAAnB,CAAL,EAAsD;AACpDM,IAAAA,cAAc,CAACE,MAAf,CAAsBR,2BAAtB,EAAmDG,mBAAnD;AACD;AACF,CAPD;;AASAE,mBAAmB;;AAEnB,IAAMI,0BAA0B,GAAG,SAA7BA,0BAA6B,CAACC,MAAD,EAASC,KAAT,EAAmB;AACpD,MAAMC,aAAa,GAAG,0BAASF,MAAT,EAAiBG,sBAAiBD,aAAlC,CAAtB;AAEA,SAAO;AACLA,IAAAA,aAAa,EAAbA,aADK;AAELD,IAAAA,KAAK,EAALA;AAFK,GAAP;AAID,CAPD;;IASqBG,6B;;;;;AAsBnB,2CAAc;AAAA;;AAAA;AACZ;AADY,uGAyBG,UAACC,CAAD,EAAIC,KAAJ,EAAc;AAC7B,YAAKC,MAAL,GAAcH,6BAA6B,CAACI,kBAA9B,CAAiDH,CAAjD,EAAoD,MAAKE,MAAzD,CAAd;;AAEA,YAAKE,oBAA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AAAA,uDAOvBA,QAPuB,GAQvBzC,KARuB;AAS1BiB,IAAAA,OAAO,EAAE;AACPsB,MAAAA,YAAY,kCACP,CAACE,QAAQ,CAACxB,OAAT,IAAoB,EAArB,EAAyBsB,YADlB,GAEPA,YAFO,CADL;AAKPC,MAAAA,gBAAgB,kCACX,CAACC,QAAQ,CAACxB,OAAT,IAAoB,EAArB,EAAyBuB,gBADd,GAEXA,gBAFW;AALT;AATiB;AAAA,C","sourcesContent":["import { ModelUpdatedEvent } from '@pie-framework/pie-configure-events';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport RubricConfigure from '@pie-element/rubric/configure/lib';\nimport MultiTraitRubricConfigure from '@pie-element/multi-trait-rubric/configure/lib';\nimport debug from 'debug';\nimport defaults from 'lodash/defaults';\nimport Main from './main';\nimport sensibleDefaults from './defaults';\n\nconst MODEL_UPDATED = ModelUpdatedEvent.TYPE;\nconst RUBRIC_TAG_NAME = 'rubric-configure';\nconst MULTI_TRAIT_RUBRIC_TAG_NAME = 'multi-trait-rubric-configure';\n\nclass ComplexSimpleRubricConfigure extends RubricConfigure {\n}\n\nclass ComplexMTRConfigure extends MultiTraitRubricConfigure {\n}\n\nconst defineComplexRubric = () => {\n if (!customElements.get(RUBRIC_TAG_NAME)) {\n customElements.define(RUBRIC_TAG_NAME, ComplexSimpleRubricConfigure);\n }\n if (!customElements.get(MULTI_TRAIT_RUBRIC_TAG_NAME)) {\n customElements.define(MULTI_TRAIT_RUBRIC_TAG_NAME, ComplexMTRConfigure);\n }\n};\n\ndefineComplexRubric();\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 ComplexRubricConfigureElement extends HTMLElement {\n static createDefaultModel = (\n {\n rubrics: { simpleRubric = {}, multiTraitRubric = {} } = { simpleRubric: {}, multiTraitRubric: {} },\n ...model\n } = {},\n defaults = {},\n ) => ({\n ...defaults,\n ...model,\n rubrics: {\n simpleRubric: {\n ...(defaults.rubrics || {}).simpleRubric,\n ...simpleRubric,\n },\n multiTraitRubric: {\n ...(defaults.rubrics || {}).multiTraitRubric,\n ...multiTraitRubric,\n },\n },\n });\n\n constructor() {\n super();\n this.canUpdateModel = false;\n\n debug.log('constructor called');\n\n this._model = ComplexRubricConfigureElement.createDefaultModel();\n this._configuration = sensibleDefaults.configuration;\n\n this.onConfigurationChanged = this.onConfigurationChanged.bind(this);\n }\n\n set model(m) {\n this._model = ComplexRubricConfigureElement.createDefaultModel(m, this._model);\n\n this.canUpdateModel = true;\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 = ComplexRubricConfigureElement.createDefaultModel(m, this._model);\n\n this.dispatchModelUpdated(reset);\n\n this._render();\n };\n\n set configuration(c) {\n const info = prepareCustomizationObject(c, this._model);\n this._configuration = info.configuration;\n\n this._render();\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 onModelUpdated = (e) => {\n if (e.target === this) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n\n const id = e.target && e.target.getAttribute('id');\n\n if (id) {\n if (e.update) {\n this._model.rubrics[id] = e.update;\n }\n\n this.dispatchEvent(new ModelUpdatedEvent(this._model));\n }\n };\n\n connectedCallback() {\n this.addEventListener(MODEL_UPDATED, this.onModelUpdated);\n this._render();\n }\n\n disconnectedCallback() {\n this.removeEventListener(MODEL_UPDATED, this.onModelUpdated);\n }\n\n _render() {\n let element = React.createElement(Main, {\n model: this._model,\n configuration: this._configuration,\n onModelChanged: this.onModelChanged,\n onConfigurationChanged: this.onConfigurationChanged,\n canUpdateModel: this.canUpdateModel\n });\n\n ReactDOM.render(element, this);\n }\n}\n"],"file":"index.js"}
|