@pie-element/boilerplate-item-type 6.0.0-next.42 → 6.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.
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _propTypes = _interopRequireDefault(require("prop-types"));
11
11
  var _styles = require("@mui/material/styles");
12
- var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
12
+ var _lodashEs = require("lodash-es");
13
13
  var _configUi = require("@pie-lib/config-ui");
14
14
  var _renderUi = require("@pie-lib/render-ui");
15
15
  var _editableHtmlTipTap = _interopRequireDefault(require("@pie-lib/editable-html-tip-tap"));
@@ -33,7 +33,7 @@ class Design extends _react.default.Component {
33
33
  onModelChanged,
34
34
  model
35
35
  } = this.props;
36
- const update = (0, _cloneDeep.default)(model);
36
+ const update = (0, _lodashEs.cloneDeep)(model);
37
37
  update.prompt = prompt;
38
38
  onModelChanged(update);
39
39
  });
@@ -1 +1 @@
1
- {"version":3,"file":"design.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_cloneDeep","_configUi","_renderUi","_editableHtmlTipTap","Panel","toggle","settings","StyledInputContainer","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","marginTop","Design","React","Component","constructor","args","_defineProperty2","default","prompt","onModelChanged","model","props","update","cloneDeep","render","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","contentDimensions","settingsPanelDisabled","extraCSSRules","promptEnabled","panelSettings","panelProperties","label","createElement","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","markup","onChange","onPromptChanged","languageCharactersProps","language","exports","PropTypes","object","isRequired","func","shape","add","delete","_default"],"sources":["../src/design.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport cloneDeep from 'lodash/cloneDeep';\nimport { settings, layout } from '@pie-lib/config-ui';\nimport { InputContainer } from '@pie-lib/render-ui'\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\n\nconst { Panel, toggle } = settings;\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(1),\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(2),\n}));\n\nexport class Design extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\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 uploadSoundSupport: PropTypes.object,\n };\n\n static defaultProps = {};\n\n onPromptChanged = (prompt) => {\n const { onModelChanged, model } = this.props;\n const update = cloneDeep(model);\n\n update.prompt = prompt;\n onModelChanged(update);\n };\n\n render() {\n const { configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const { contentDimensions = {}, prompt = {}, settingsPanelDisabled } = configuration || {};\n const { extraCSSRules, promptEnabled } = model || {};\n\n const panelSettings = {};\n\n const panelProperties = {\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {promptEnabled && (\n <StyledInputContainer label={prompt.label || ''}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </StyledInputContainer>\n )}\n </layout.ConfigLayout>\n );\n }\n}\n\nexport default Design;\n"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AAU,CAAC;IAAE,CAC7E,CACmB,CAEL,CAAC;EAE1B;AACF;AAACC,OAAA,CAAAxC,MAAA,GAAAA,MAAA;AAAA,IAAAK,gBAAA,CAAAC,OAAA,EAnEYN,MAAM,eACE;EACjBS,KAAK,EAAEgC,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClC7B,aAAa,EAAE2B,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1CnC,cAAc,EAAEiC,kBAAS,CAACG,IAAI,CAACD,UAAU;EACzC3B,sBAAsB,EAAEyB,kBAAS,CAACG,IAAI,CAACD,UAAU;EACjD5B,YAAY,EAAE0B,kBAAS,CAACI,KAAK,CAAC;IAC5BC,GAAG,EAAEL,kBAAS,CAACG,IAAI,CAACD,UAAU;IAC9BI,MAAM,EAAEN,kBAAS,CAACG,IAAI,CAACD;EACzB,CAAC,CAAC;EACF1B,kBAAkB,EAAEwB,kBAAS,CAACC;AAChC,CAAC;AAAA,IAAArC,gBAAA,CAAAC,OAAA,EAXUN,MAAM,kBAaK,CAAC,CAAC;AAAA,IAAAgD,QAAA,GAAAR,OAAA,CAAAlC,OAAA,GAwDXN,MAAM","ignoreList":[]}
1
+ {"version":3,"file":"design.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_lodashEs","_configUi","_renderUi","_editableHtmlTipTap","Panel","toggle","settings","StyledInputContainer","styled","InputContainer","theme","width","paddingTop","spacing","marginBottom","marginTop","Design","React","Component","constructor","args","_defineProperty2","default","prompt","onModelChanged","model","props","update","cloneDeep","render","configuration","imageSupport","onConfigurationChanged","uploadSoundSupport","contentDimensions","settingsPanelDisabled","extraCSSRules","promptEnabled","panelSettings","panelProperties","label","createElement","layout","ConfigLayout","dimensions","hideSettings","onChangeModel","onChangeConfiguration","groups","Settings","Properties","markup","onChange","onPromptChanged","languageCharactersProps","language","exports","PropTypes","object","isRequired","func","shape","add","delete","_default"],"sources":["../src/design.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { styled } from '@mui/material/styles';\nimport { cloneDeep } from 'lodash-es';\nimport { settings, layout } from '@pie-lib/config-ui';\nimport { InputContainer } from '@pie-lib/render-ui'\nimport EditableHtml from '@pie-lib/editable-html-tip-tap';\n\nconst { Panel, toggle } = settings;\n\nconst StyledInputContainer = styled(InputContainer)(({ theme }) => ({\n width: '100%',\n paddingTop: theme.spacing(1),\n marginBottom: theme.spacing(2),\n marginTop: theme.spacing(2),\n}));\n\nexport class Design extends React.Component {\n static propTypes = {\n model: PropTypes.object.isRequired,\n configuration: PropTypes.object.isRequired,\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 uploadSoundSupport: PropTypes.object,\n };\n\n static defaultProps = {};\n\n onPromptChanged = (prompt) => {\n const { onModelChanged, model } = this.props;\n const update = cloneDeep(model);\n\n update.prompt = prompt;\n onModelChanged(update);\n };\n\n render() {\n const { configuration, imageSupport, model, onConfigurationChanged, onModelChanged, uploadSoundSupport } =\n this.props;\n const { contentDimensions = {}, prompt = {}, settingsPanelDisabled } = configuration || {};\n const { extraCSSRules, promptEnabled } = model || {};\n\n const panelSettings = {};\n\n const panelProperties = {\n promptEnabled: prompt.settings && toggle(prompt.label),\n };\n\n return (\n <layout.ConfigLayout\n extraCSSRules={extraCSSRules}\n dimensions={contentDimensions}\n hideSettings={settingsPanelDisabled}\n settings={\n <Panel\n model={model}\n configuration={configuration}\n onChangeModel={(model) => onModelChanged(model)}\n onChangeConfiguration={onConfigurationChanged}\n groups={{\n Settings: panelSettings,\n Properties: panelProperties,\n }}\n />\n }\n >\n {promptEnabled && (\n <StyledInputContainer label={prompt.label || ''}>\n <EditableHtml\n markup={model.prompt}\n onChange={this.onPromptChanged}\n imageSupport={imageSupport}\n uploadSoundSupport={uploadSoundSupport}\n languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}\n />\n </StyledInputContainer>\n )}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EAAE;QAAEA,QAAQ,EAAE;MAAU,CAAC;IAAE,CAC7E,CACmB,CAEL,CAAC;EAE1B;AACF;AAACC,OAAA,CAAAxC,MAAA,GAAAA,MAAA;AAAA,IAAAK,gBAAA,CAAAC,OAAA,EAnEYN,MAAM,eACE;EACjBS,KAAK,EAAEgC,kBAAS,CAACC,MAAM,CAACC,UAAU;EAClC7B,aAAa,EAAE2B,kBAAS,CAACC,MAAM,CAACC,UAAU;EAC1CnC,cAAc,EAAEiC,kBAAS,CAACG,IAAI,CAACD,UAAU;EACzC3B,sBAAsB,EAAEyB,kBAAS,CAACG,IAAI,CAACD,UAAU;EACjD5B,YAAY,EAAE0B,kBAAS,CAACI,KAAK,CAAC;IAC5BC,GAAG,EAAEL,kBAAS,CAACG,IAAI,CAACD,UAAU;IAC9BI,MAAM,EAAEN,kBAAS,CAACG,IAAI,CAACD;EACzB,CAAC,CAAC;EACF1B,kBAAkB,EAAEwB,kBAAS,CAACC;AAChC,CAAC;AAAA,IAAArC,gBAAA,CAAAC,OAAA,EAXUN,MAAM,kBAaK,CAAC,CAAC;AAAA,IAAAgD,QAAA,GAAAR,OAAA,CAAAlC,OAAA,GAwDXN,MAAM","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@pie-element/boilerplate-item-type-configure",
3
3
  "private": true,
4
- "version": "5.0.0-beta.1",
4
+ "version": "5.1.0-next.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
@@ -11,14 +11,14 @@
11
11
  "@mui/icons-material": "^7.3.4",
12
12
  "@mui/material": "^7.3.4",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
- "@pie-lib/config-ui": "12.1.1-next.0",
15
- "@pie-lib/editable-html-tip-tap": "1.1.1-next.0",
16
- "@pie-lib/render-ui": "5.1.1-next.0",
14
+ "@pie-lib/config-ui": "12.1.1-next.3",
15
+ "@pie-lib/editable-html-tip-tap": "1.1.1-next.3",
16
+ "@pie-lib/render-ui": "5.1.1-next.1",
17
17
  "debug": "^4.1.1",
18
- "lodash": "^4.17.15",
18
+ "lodash-es": "^4.17.23",
19
19
  "prop-types": "^15.6.2",
20
- "react": "18.2.0",
21
- "react-dom": "18.2.0"
20
+ "react": "18.3.1",
21
+ "react-dom": "18.3.1"
22
22
  },
23
23
  "author": "",
24
24
  "license": "ISC"
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.validate = exports.outcome = exports.normalizeSession = exports.model = exports.getPartialScore = exports.getCorrectness = exports.createDefaultModel = exports.createCorrectResponseSession = void 0;
8
- var _isEmpty = _interopRequireDefault(require("lodash/isEmpty"));
8
+ var _lodashEs = require("lodash-es");
9
9
  var _defaults = _interopRequireDefault(require("./defaults"));
10
10
  const getCorrectness = model => {
11
11
  const correctnessCondition = 'c';
@@ -22,14 +22,14 @@ const getCorrectness = model => {
22
22
  };
23
23
  exports.getCorrectness = getCorrectness;
24
24
  const getPartialScore = (question, session) => {
25
- if (!session || (0, _isEmpty.default)(session)) {
25
+ if (!session || (0, _lodashEs.isEmpty)(session)) {
26
26
  return 0;
27
27
  }
28
28
  return 1;
29
29
  };
30
30
  exports.getPartialScore = getPartialScore;
31
31
  const outcome = (question, session, env) => new Promise(resolve => {
32
- if (!session || (0, _isEmpty.default)(session)) {
32
+ if (!session || (0, _lodashEs.isEmpty)(session)) {
33
33
  resolve({
34
34
  score: 0,
35
35
  empty: true
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["_isEmpty","_interopRequireDefault","require","_defaults","getCorrectness","model","correctnessCondition","exports","getPartialScore","question","session","isEmpty","outcome","env","Promise","resolve","score","empty","normalizeSession","mode","undefined","completed","createDefaultModel","defaults","s","normalizedQuestion","out","prompt","promptEnabled","extraCSSRules","createCorrectResponseSession","role","id","validate","config","errors"],"sources":["../src/index.js"],"sourcesContent":["import isEmpty from 'lodash/isEmpty';\nimport defaults from './defaults';\n\nexport const getCorrectness = (model) => {\n const correctnessCondition = 'c';\n\n switch (correctnessCondition) {\n case 'c':\n return 'correct';\n case 'pc':\n return 'partially-correct';\n case 'i':\n return 'incorrect';\n default:\n return 'unknown';\n }\n};\n\nexport const getPartialScore = (question, session) => {\n if (!session || isEmpty(session)) {\n return 0;\n }\n\n return 1;\n};\n\nexport const outcome = (question, session, env) =>\n new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n\n session = normalizeSession(session);\n\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined });\n } else {\n resolve({ score: 1 });\n }\n });\n\nexport const createDefaultModel = (model = {}) => ({ ...defaults.model, ...model });\n\nexport const normalizeSession = (s) => ({ ...s });\n\nexport const model = (question, session, env) => {\n return new Promise((resolve) => {\n session = session || {};\n const normalizedQuestion = createDefaultModel(question);\n\n const out = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n env,\n };\n\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n return errors;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,SAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEO,MAAME,cAAc,GAAIC,KAAK,IAAK;EACvC,MAAMC,oBAAoB,GAAG,GAAG;EAEhC,QAAQA,oBAAoB;IAC1B,KAAK,GAAG;MACN,OAAO,SAAS;IAClB,KAAK,IAAI;MACP,OAAO,mBAAmB;IAC5B,KAAK,GAAG;MACN,OAAO,WAAW;IACpB;MACE,OAAO,SAAS;EACpB;AACF,CAAC;AAACC,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAEK,MAAMI,eAAe,GAAGA,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B,MAAMe,kBAAkB,GAAGH,kBAAkB,CAACb,QAAQ,CAAC;IAEvD,MAAMiB,GAAG,GAAG;MACVC,MAAM,EAAEF,kBAAkB,CAACG,aAAa,GAAGH,kBAAkB,CAACE,MAAM,GAAG,IAAI;MAC3EE,aAAa,EAAEJ,kBAAkB,CAACI,aAAa;MAC/ChB;IACF,CAAC;IAEDE,OAAO,CAACW,GAAG,CAAC;EACd,CAAC,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAF,KAAA,GAAAA,KAAA;AAEK,MAAMyB,4BAA4B,GAAGA,CAACrB,QAAQ,EAAEI,GAAG,KAAK;EAC7D,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9B,IAAIF,GAAG,CAACM,IAAI,KAAK,UAAU,IAAIN,GAAG,CAACkB,IAAI,KAAK,YAAY,EAAE;MACxDhB,OAAO,CAAC;QAAEiB,EAAE,EAAE;MAAI,CAAC,CAAC;IACtB,CAAC,MAAM;MACLjB,OAAO,CAAC,IAAI,CAAC;IACf;EACF,CAAC,CAAC;AACJ,CAAC;AAACR,OAAA,CAAAuB,4BAAA,GAAAA,4BAAA;AAEK,MAAMG,QAAQ,GAAGA,CAAC5B,KAAK,GAAG,CAAC,CAAC,EAAE6B,MAAM,GAAG,CAAC,CAAC,KAAK;EACnD,MAAMC,MAAM,GAAG,CAAC,CAAC;EAEjB,OAAOA,MAAM;AACf,CAAC;AAAC5B,OAAA,CAAA0B,QAAA,GAAAA,QAAA","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["_lodashEs","require","_defaults","_interopRequireDefault","getCorrectness","model","correctnessCondition","exports","getPartialScore","question","session","isEmpty","outcome","env","Promise","resolve","score","empty","normalizeSession","mode","undefined","completed","createDefaultModel","defaults","s","normalizedQuestion","out","prompt","promptEnabled","extraCSSRules","createCorrectResponseSession","role","id","validate","config","errors"],"sources":["../src/index.js"],"sourcesContent":["import { isEmpty } from 'lodash-es';\nimport defaults from './defaults';\n\nexport const getCorrectness = (model) => {\n const correctnessCondition = 'c';\n\n switch (correctnessCondition) {\n case 'c':\n return 'correct';\n case 'pc':\n return 'partially-correct';\n case 'i':\n return 'incorrect';\n default:\n return 'unknown';\n }\n};\n\nexport const getPartialScore = (question, session) => {\n if (!session || isEmpty(session)) {\n return 0;\n }\n\n return 1;\n};\n\nexport const outcome = (question, session, env) =>\n new Promise((resolve) => {\n if (!session || isEmpty(session)) {\n resolve({ score: 0, empty: true });\n }\n\n session = normalizeSession(session);\n\n if (env.mode !== 'evaluate') {\n resolve({ score: undefined, completed: undefined });\n } else {\n resolve({ score: 1 });\n }\n });\n\nexport const createDefaultModel = (model = {}) => ({ ...defaults.model, ...model });\n\nexport const normalizeSession = (s) => ({ ...s });\n\nexport const model = (question, session, env) => {\n return new Promise((resolve) => {\n session = session || {};\n const normalizedQuestion = createDefaultModel(question);\n\n const out = {\n prompt: normalizedQuestion.promptEnabled ? normalizedQuestion.prompt : null,\n extraCSSRules: normalizedQuestion.extraCSSRules,\n env,\n };\n\n resolve(out);\n });\n};\n\nexport const createCorrectResponseSession = (question, env) => {\n return new Promise((resolve) => {\n if (env.mode !== 'evaluate' && env.role === 'instructor') {\n resolve({ id: '1' });\n } else {\n resolve(null);\n }\n });\n};\n\nexport const validate = (model = {}, config = {}) => {\n const errors = {};\n\n return errors;\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEO,MAAMG,cAAc,GAAIC,KAAK,IAAK;EACvC,MAAMC,oBAAoB,GAAG,GAAG;EAEhC,QAAQA,oBAAoB;IAC1B,KAAK,GAAG;MACN,OAAO,SAAS;IAClB,KAAK,IAAI;MACP,OAAO,mBAAmB;IAC5B,KAAK,GAAG;MACN,OAAO,WAAW;IACpB;MACE,OAAO,SAAS;EACpB;AACF,CAAC;AAACC,OAAA,CAAAH,cAAA,GAAAA,cAAA;AAEK,MAAMI,eAAe,GAAGA,CAACC,QAAQ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BAAkB,GAAGH,kBAAkB,CAACb,QAAQ,CAAC;IAEvD,MAAMiB,GAAG,GAAG;MACVC,MAAM,EAAEF,kBAAkB,CAACG,aAAa,GAAGH,kBAAkB,CAACE,MAAM,GAAG,IAAI;MAC3EE,aAAa,EAAEJ,kBAAkB,CAACI,aAAa;MAC/ChB;IACF,CAAC;IAEDE,OAAO,CAACW,GAAG,CAAC;EACd,CAAC,CAAC;AACJ,CAAC;AAACnB,OAAA,CAAAF,KAAA,GAAAA,KAAA;AAEK,MAAMyB,4BAA4B,GAAGA,CAACrB,QAAQ,EAAEI,GAAG,KAAK;EAC7D,OAAO,IAAIC,OAAO,CAAEC,OAAO,IAAK;IAC9B,IAAIF,GAAG,CAACM,IAAI,KAAK,UAAU,IAAIN,GAAG,CAACkB,IAAI,KAAK,YAAY,EAAE;MACxDhB,OAAO,CAAC;QAAEiB,EAAE,EAAE;MAAI,CAAC,CAAC;IACtB,CAAC,MAAM;MACLjB,OAAO,CAAC,IAAI,CAAC;IACf;EACF,CAAC,CAAC;AACJ,CAAC;AAACR,OAAA,CAAAuB,4BAAA,GAAAA,4BAAA;AAEK,MAAMG,QAAQ,GAAGA,CAAC5B,KAAK,GAAG,CAAC,CAAC,EAAE6B,MAAM,GAAG,CAAC,CAAC,KAAK;EACnD,MAAMC,MAAM,GAAG,CAAC,CAAC;EAEjB,OAAOA,MAAM;AACf,CAAC;AAAC5B,OAAA,CAAA0B,QAAA,GAAAA,QAAA","ignoreList":[]}
@@ -1,16 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/boilerplate-item-type-controller",
3
3
  "private": true,
4
- "version": "5.0.0-beta.0",
4
+ "version": "5.1.0-next.0",
5
5
  "description": "",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "dependencies": {
9
9
  "debug": "^4.1.1",
10
- "lodash": "^4.17.15"
11
- },
12
- "devDependencies": {
13
- "lodash": "^4.17.15"
10
+ "lodash-es": "^4.17.23"
14
11
  },
15
12
  "author": "",
16
13
  "license": "ISC"
package/lib/print.js CHANGED
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireDefault(require("react"));
9
9
  var _client = require("react-dom/client");
10
- var _debounce = _interopRequireDefault(require("lodash/debounce"));
10
+ var _lodashEs = require("lodash-es");
11
11
  var _main = _interopRequireDefault(require("./main"));
12
12
  var _mathRendering = require("@pie-lib/math-rendering");
13
13
  var _debug = _interopRequireDefault(require("debug"));
@@ -31,7 +31,7 @@ class BoilerPlateItemTypePrint extends HTMLElement {
31
31
  this._model = null;
32
32
  this._session = [];
33
33
  this._root = null;
34
- this._rerender = (0, _debounce.default)(() => {
34
+ this._rerender = (0, _lodashEs.debounce)(() => {
35
35
  if (this._model && this._session) {
36
36
  const printModel = preparePrintModel(this._model, this._options);
37
37
  const element = this._options && /*#__PURE__*/_react.default.createElement(_main.default, {
package/lib/print.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"print.js","names":["_react","_interopRequireDefault","require","_client","_debounce","_main","_mathRendering","_debug","log","debug","preparePrintModel","model","BoilerPlateItemTypePrint","HTMLElement","constructor","_options","_model","_session","_root","_rerender","debounce","printModel","element","React","createElement","Main","session","createRoot","render","queueMicrotask","renderMath","leading","trailing","options","o","s","connectedCallback","disconnectedCallback","unmount","exports","default"],"sources":["../src/print.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport debounce from 'lodash/debounce';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport debug from 'debug';\n\nconst log = debug('pie-element:multiple-choice:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model) => {\n return model;\n};\n\nexport default class BoilerPlateItemTypePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n queueMicrotask(() => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\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,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,MAAMM,GAAG,GAAG,IAAAC,cAAK,EAAC,mCAAmC,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,iBAAiB,GAAIC,KAAK,IAAK;EACnC,OAAOA,KAAK;AACd,CAAC;AAEc,MAAMC,wBAAwB,SAASC,WAAW,CAAC;EAChEC,WAAWA,CAAA,EAAG;IACZ,KAAK,CAAC,CAAC;IACP,IAAI,CAACC,QAAQ,GAAG,IAAI;IACpB,IAAI,CAACC,MAAM,GAAG,IAAI;IAClB,IAAI,CAACC,QAAQ,GAAG,EAAE;IAClB,IAAI,CAACC,KAAK,GAAG,IAAI;IACjB,IAAI,CAACC,SAAS,GAAG,IAAAC,iBAAQ,EACvB,MAAM;MACJ,IAAI,IAAI,CAACJ,MAAM,IAAI,IAAI,CAACC,QAAQ,EAAE;QAChC,MAAMI,UAAU,GAAGX,iBAAiB,CAAC,IAAI,CAACM,MAAM,EAAE,IAAI,CAACD,QAAQ,CAAC;QAEhE,MAAMO,OAAO,GACX,IAAI,CAACP,QAAQ,iBACbQ,cAAK,CAACC,aAAa,CAACC,aAAI,EAAE;UACxBd,KAAK,EAAEU,UAAU;UACjBK,OAAO,EAAE,CAAC;QACZ,CAAC,CAAC;QAEJ,IAAI,CAAC,IAAI,CAACR,KAAK,EAAE;UACf,IAAI,CAACA,KAAK,GAAG,IAAAS,kBAAU,EAAC,IAAI,CAAC;QAC/B;QACA,IAAI,CAACT,KAAK,CAACU,MAAM,CAACN,OAAO,CAAC;QAC1BO,cAAc,CAAC,MAAM;UACnBrB,GAAG,CAAC,+BAA+B,CAAC;UACpC,IAAAsB,yBAAU,EAAC,IAAI,CAAC;QAClB,CAAC,CAAC;MACJ,CAAC,MAAM;QACLtB,GAAG,CAAC,MAAM,CAAC;MACb;IACF,CAAC,EACD,EAAE,EACF;MAAEuB,OAAO,EAAE,KAAK;MAAEC,QAAQ,EAAE;IAAK,CACnC,CAAC;EACH;EACA,IAAIC,OAAOA,CAACC,CAAC,EAAE;IACb,IAAI,CAACnB,QAAQ,GAAGmB,CAAC;EACnB;EAEA,IAAIvB,KAAKA,CAACwB,CAAC,EAAE;IACX,IAAI,CAACnB,MAAM,GAAGmB,CAAC;IACf,IAAI,CAAChB,SAAS,CAAC,CAAC;EAClB;EAEAiB,iBAAiBA,CAAA,EAAG,CAAC;EAErBC,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACnB,KAAK,EAAE;MACd,IAAI,CAACA,KAAK,CAACoB,OAAO,CAAC,CAAC;IACtB;EACF;AACF;AAACC,OAAA,CAAAC,OAAA,GAAA5B,wBAAA","ignoreList":[]}
1
+ {"version":3,"file":"print.js","names":["_react","_interopRequireDefault","require","_client","_lodashEs","_main","_mathRendering","_debug","log","debug","preparePrintModel","model","BoilerPlateItemTypePrint","HTMLElement","constructor","_options","_model","_session","_root","_rerender","debounce","printModel","element","React","createElement","Main","session","createRoot","render","queueMicrotask","renderMath","leading","trailing","options","o","s","connectedCallback","disconnectedCallback","unmount","exports","default"],"sources":["../src/print.js"],"sourcesContent":["import React from 'react';\nimport { createRoot } from 'react-dom/client';\nimport { debounce } from 'lodash-es';\nimport Main from './main';\nimport { renderMath } from '@pie-lib/math-rendering';\nimport debug from 'debug';\n\nconst log = debug('pie-element:multiple-choice:print');\n\n/**\n * Live in same package as main element - so we can access some of the shared comps!\n *\n * - update pslb to build print if src/print.js is there\n * - update demo el\n * - get configure/controller building\n */\n\nconst preparePrintModel = (model) => {\n return model;\n};\n\nexport default class BoilerPlateItemTypePrint extends HTMLElement {\n constructor() {\n super();\n this._options = null;\n this._model = null;\n this._session = [];\n this._root = null;\n this._rerender = debounce(\n () => {\n if (this._model && this._session) {\n const printModel = preparePrintModel(this._model, this._options);\n\n const element =\n this._options &&\n React.createElement(Main, {\n model: printModel,\n session: {},\n });\n\n if (!this._root) {\n this._root = createRoot(this);\n }\n this._root.render(element);\n queueMicrotask(() => {\n log('render complete - render math');\n renderMath(this);\n });\n } else {\n log('skip');\n }\n },\n 50,\n { leading: false, trailing: true },\n );\n }\n set options(o) {\n this._options = o;\n }\n\n set model(s) {\n this._model = s;\n this._rerender();\n }\n\n connectedCallback() {}\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,SAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAN,sBAAA,CAAAC,OAAA;AAEA,MAAMM,GAAG,GAAG,IAAAC,cAAK,EAAC,mCAAmC,CAAC;;AAEtD;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,iBAAiB,GAAIC,KAAK,IAAK;EACnC,OAAOA,KAAK;AACd,CAAC;AAEc,MAAMC,wB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AiB,iBAAiBA,CAAA,EAAG,CAAC;EAErBC,oBAAoBA,CAAA,EAAG;IACrB,IAAI,IAAI,CAACnB,KAAK,EAAE;MACd,IAAI,CAACA,KAAK,CAACoB,OAAO,CAAC,CAAC;IACtB;EACF;AACF;AAACC,OAAA,CAAAC,OAAA,GAAA5B,wBAAA","ignoreList":[]}
package/package.json CHANGED
@@ -1,10 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/boilerplate-item-type",
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
- "repository": "pie-framework/pie-elements",
7
- "version": "6.0.0-next.42+bb1f3eb4e",
10
+ "version": "6.1.0-next.0+20d879b",
8
11
  "description": "",
9
12
  "dependencies": {
10
13
  "@emotion/react": "^11.14.0",
@@ -12,18 +15,21 @@
12
15
  "@mui/icons-material": "^7.3.4",
13
16
  "@mui/material": "^7.3.4",
14
17
  "@pie-framework/pie-player-events": "^0.1.0",
15
- "@pie-lib/math-rendering": "4.1.1-next.0",
16
- "@pie-lib/render-ui": "5.1.1-next.0",
18
+ "@pie-lib/math-rendering": "4.1.1-next.1",
19
+ "@pie-lib/render-ui": "5.1.1-next.1",
17
20
  "prop-types": "^15.6.1",
18
- "react": "18.2.0",
19
- "react-dom": "18.2.0"
21
+ "react": "18.3.1",
22
+ "react-dom": "18.3.1"
20
23
  },
21
24
  "author": "",
22
25
  "license": "ISC",
23
- "gitHead": "bb1f3eb4e3b5b1cb15024d459ffd6e94bf419712",
26
+ "gitHead": "20d879b8b8fa74decf5028d860d54cd09cbdf051",
24
27
  "scripts": {
25
28
  "postpublish": "../../scripts/postpublish"
26
29
  },
27
30
  "main": "lib/index.js",
28
- "module": "src/index.js"
31
+ "module": "src/index.js",
32
+ "exports": {
33
+ ".": "./src/index.js"
34
+ }
29
35
  }
@@ -1 +0,0 @@
1
- import{_dll_react_dom as e,_dll_react as t,_dll_prop_types as n,_dll_mui__material_styles as i,_dll_lodash as o,_dll_pie_lib__render_ui as s}from"../../../@pie-lib/shared-module@^3.0.5/module/index.js";import{_dll_pie_lib__config_ui as a}from"../../../@pie-lib/config-module@^3.0.0/module/index.js";import{_dll_pie_lib__editable_html_tip_tap as d}from"../../../@pie-lib/editable-html-module@^6.0.5/module/index.js";var r,l=e;r=l.createRoot,l.hydrateRoot;const u=t,p=n,{styled:h}=i,{cloneDeep:c}=o,{InputContainer:m}=s,{settings:_}=a,{layout:g}=a,b=d,{Panel:C,toggle:E}=_,f=h(m)(({theme:e})=>({width:"100%",paddingTop:e.spacing(1),marginBottom:e.spacing(2),marginTop:e.spacing(2)}));class S extends u.Component{constructor(...e){super(...e),S.prototype.__init.call(this)}static __initStatic(){this.propTypes={model:p.object.isRequired,configuration:p.object.isRequired,onModelChanged:p.func.isRequired,onConfigurationChanged:p.func.isRequired,imageSupport:p.shape({add:p.func.isRequired,delete:p.func.isRequired}),uploadSoundSupport:p.object}}static __initStatic2(){this.defaultProps={}}__init(){this.onPromptChanged=e=>{const{onModelChanged:t,model:n}=this.props,i=c(n);i.prompt=e,t(i)}}render(){const{configuration:e,imageSupport:t,model:n,onConfigurationChanged:i,onModelChanged:o,uploadSoundSupport:s}=this.props,{contentDimensions:a={},prompt:d={},settingsPanelDisabled:r}=e||{},{extraCSSRules:l,promptEnabled:p}=n||{},h={promptEnabled:d.settings&&E(d.label)};return u.createElement(g.ConfigLayout,{extraCSSRules:l,dimensions:a,hideSettings:r,settings:u.createElement(C,{model:n,configuration:e,onChangeModel:e=>o(e),onChangeConfiguration:i,groups:{Settings:{},Properties:h}})},p&&u.createElement(f,{label:d.label||""},u.createElement(b,{markup:n.prompt,onChange:this.onPromptChanged,imageSupport:t,uploadSoundSupport:s,languageCharactersProps:[{language:"spanish"},{language:"special"}]})))}}S.__initStatic(),S.__initStatic2();var v={};Object.defineProperty(v,"__esModule",{value:!0});class P extends CustomEvent{constructor(e,t=!1){super(P.TYPE,{bubbles:!0,detail:{update:e,reset:t}}),this.update=e,this.reset=t}}P.TYPE="model.updated";var T=v.ModelUpdatedEvent=P;class x extends CustomEvent{constructor(e,t){super(x.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}x.TYPE="delete.image";var D=v.DeleteImageEvent=x;class M extends CustomEvent{constructor(e){super(M.TYPE,{bubbles:!0,detail:e}),this.handler=e}}M.TYPE="insert.image";var R=v.InsertImageEvent=M;class Y extends CustomEvent{constructor(e,t){super(Y.TYPE,{bubbles:!0,detail:{src:e,done:t}}),this.src=e,this.done=t}}Y.TYPE="delete.sound";var y=v.DeleteSoundEvent=Y;class I extends CustomEvent{constructor(e){super(I.TYPE,{bubbles:!0,detail:e}),this.handler=e}}I.TYPE="insert.sound";var j=v.InsertSoundEvent=I,q={prompt:"",promptEnabled:!0},w={prompt:{label:"Prompt",settings:!0}};const k=t;class L extends HTMLElement{static __initStatic(){this.createDefaultModel=(e={})=>({...q,...e})}constructor(){super(),this._root=null,this._model=L.createDefaultModel(),this._configuration=w}set model(e){this._model=L.createDefaultModel(e),this.render()}set configuration(e){this._configuration=e,this.render()}connectedCallback(){this.render()}modelChanged(e){this._model=e,this.dispatchEvent(new T(this._model),!0),this.render()}onConfigurationChanged(e){this._configuration=e,this.render()}insertImage(e){this.dispatchEvent(new R(e))}onDeleteImage(e,t){this.dispatchEvent(new D(e,t))}insertSound(e){this.dispatchEvent(new j(e))}onDeleteSound(e,t){this.dispatchEvent(new y(e,t))}render(){if(this._model){const e=k.createElement(S,{model:this._model,configuration:this._configuration,onModelChanged:this.modelChanged.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=r(this)),this._root.render(e)}}disconnectedCallback(){this._root&&this._root.unmount()}}L.__initStatic();export{L as default};