@pie-element/complex-rubric 2.11.1-next.9 → 2.11.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 CHANGED
@@ -3,6 +3,17 @@
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.11.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.11.0...@pie-element/complex-rubric@2.11.1) (2024-06-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-3788, PD-1273 ([f4b6aba](https://github.com/pie-framework/pie-elements/commit/f4b6aba5c741fbf6305dba71bf47d2226f39f2ee))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.11.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric@2.10.6...@pie-element/complex-rubric@2.11.0) (2024-05-27)
7
18
 
8
19
 
@@ -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
+ ## [2.2.23](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.22...@pie-element/complex-rubric-configure@2.2.23) (2024-06-03)
7
+
8
+ **Note:** Version bump only for package @pie-element/complex-rubric-configure
9
+
10
+
11
+
12
+
13
+
6
14
  ## [2.2.22](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-configure@2.2.21...@pie-element/complex-rubric-configure@2.2.22) (2024-05-27)
7
15
 
8
16
  **Note:** Version bump only for package @pie-element/complex-rubric-configure
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric-configure",
3
3
  "private": true,
4
- "version": "2.2.22",
4
+ "version": "2.2.23",
5
5
  "description": "Complex Rubric authoring view",
6
6
  "main": "lib/index.js",
7
7
  "module": "src/index.js",
8
8
  "author": "Pie Framework Authors",
9
9
  "dependencies": {
10
10
  "@material-ui/core": "^3.9.2",
11
- "@pie-element/multi-trait-rubric": "^3.11.0",
12
- "@pie-element/rubric": "^3.11.0",
11
+ "@pie-element/multi-trait-rubric": "^3.11.1",
12
+ "@pie-element/rubric": "^3.11.1",
13
13
  "@pie-framework/pie-configure-events": "^1.3.0",
14
14
  "@pie-lib/config-ui": "^11.9.25-next.0",
15
15
  "@pie-lib/editable-html": "^11.1.2-next.0",
@@ -3,6 +3,17 @@
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.10.1](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.10.0...@pie-element/complex-rubric-controller@2.10.1) (2024-06-03)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * update pie-lib/pie-toolbox PD-3788, PD-1273 ([f4b6aba](https://github.com/pie-framework/pie-elements/commit/f4b6aba5c741fbf6305dba71bf47d2226f39f2ee))
12
+
13
+
14
+
15
+
16
+
6
17
  # [2.10.0](https://github.com/pie-framework/pie-elements/compare/@pie-element/complex-rubric-controller@2.9.6...@pie-element/complex-rubric-controller@2.10.0) (2024-05-27)
7
18
 
8
19
 
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric-controller",
3
3
  "private": true,
4
- "version": "2.10.0",
4
+ "version": "2.10.1",
5
5
  "description": "",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
8
8
  },
9
9
  "dependencies": {
10
- "@pie-lib/pie-toolbox": "1.20.0",
10
+ "@pie-lib/pie-toolbox": "1.20.1",
11
11
  "lodash": "^4.17.15"
12
12
  },
13
13
  "author": "",
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.12.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_classnames, _dll_react_dom, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.13.0/module/index.js";
2
2
  import RubricConfigure from '@pie-element/rubric/configure/lib';
3
3
  import {_dll_pie_lib__pie_toolbox_editable_html, _dll_pie_lib__pie_toolbox_render_ui, _dll_pie_lib__pie_toolbox_config_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
4
4
  function _mergeNamespaces(n, m) {
@@ -145090,50 +145090,41 @@ const require$$8$e = _dll_prop_types;
145090
145090
  node: _propTypes["default"].object
145091
145091
  };
145092
145092
  core.normalizeNode = function (node) {
145093
- if (node.object !== 'document') {
145094
- return;
145095
- }
145096
- var tableAdded = node.findDescendant(function (d) {
145097
- return d.data && d.data.get('newTable');
145098
- });
145099
- if (!tableAdded) {
145100
- return;
145101
- }
145102
- var nodeToSearch = node.getParent(tableAdded.key) || node;
145103
- var shouldAddTextAfterNode = false;
145104
- var indexToNotHaveTableOn = nodeToSearch.nodes.size - 1;
145105
- var indexOfLastTable = nodeToSearch.nodes.findLastIndex(function (d) {
145106
- return d.type === 'table';
145093
+ var addNodeBeforeArray = [];
145094
+ if (node.object !== 'document') return;
145095
+ node.findDescendant(function (d) {
145096
+ if (d.type === 'table') {
145097
+ var tablePath = node.getPath(d.key);
145098
+ var prevNode = node.getPreviousNode(tablePath);
145099
+ var nextNode = node.getNextNode(tablePath);
145100
+ if (!prevNode || !nextNode) {
145101
+ addNodeBeforeArray.push({
145102
+ node: d,
145103
+ prevNode: prevNode,
145104
+ nextNode: nextNode
145105
+ });
145106
+ }
145107
+ }
145107
145108
  });
145108
- if (indexOfLastTable === indexToNotHaveTableOn) {
145109
- shouldAddTextAfterNode = true;
145110
- }
145111
- if (!shouldAddTextAfterNode) {
145109
+ if (!addNodeBeforeArray.length) {
145112
145110
  return;
145113
145111
  }
145114
145112
  return function (change) {
145115
- if (shouldAddTextAfterNode) {
145116
- var tableJSON = tableAdded.toJSON();
145117
- change.removeNodeByKey(tableAdded.key);
145118
- var newBlock = _slate.Block.create({
145119
- object: 'block',
145120
- type: 'div'
145121
- });
145122
- change.insertBlock(newBlock);
145123
- change.withoutNormalization(function () {
145124
- var prevText = change.value.document.getPreviousText(newBlock.key);
145125
- if (prevText) {
145126
- var _prevText$text, _prevText$text2;
145127
- change.moveFocusTo(prevText.key, (_prevText$text = prevText.text) === null || _prevText$text === void 0 ? void 0 : _prevText$text.length).moveAnchorTo(prevText.key, (_prevText$text2 = prevText.text) === null || _prevText$text2 === void 0 ? void 0 : _prevText$text2.length);
145128
- }
145129
- change.insertBlock(_objectSpread(_objectSpread({}, tableJSON), {}, {
145130
- data: _objectSpread(_objectSpread({}, tableJSON.data), {}, {
145131
- newTable: true
145132
- })
145133
- }));
145134
- moveFocusToBeginningOfTable(change);
145135
- });
145136
- }
145113
+ var newBlock = {
145114
+ object: 'block',
145115
+ type: 'div'
145116
+ };
145117
+ addNodeBeforeArray.forEach(function (n) {
145118
+ var tablePath = change.value.document.getPath(n.node.key).toJSON();
145119
+ var indexToAdd = tablePath.splice(-1)[0];
145120
+ if (!n.prevNode) {
145121
+ change.insertNodeByPath(tablePath, indexToAdd, newBlock);
145122
+ return;
145123
+ }
145124
+ if (!n.nextNode) {
145125
+ change.insertNodeByPath(tablePath, indexToAdd + 1, newBlock);
145126
+ }
145127
+ });
145137
145128
  };
145138
145129
  };
145139
145130
  core.renderNode = Node;
package/module/element.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.12.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.13.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -135281,50 +135281,41 @@ const require$$8$f = _dll_prop_types;
135281
135281
  node: _propTypes["default"].object
135282
135282
  };
135283
135283
  core.normalizeNode = function (node) {
135284
- if (node.object !== 'document') {
135285
- return;
135286
- }
135287
- var tableAdded = node.findDescendant(function (d) {
135288
- return d.data && d.data.get('newTable');
135289
- });
135290
- if (!tableAdded) {
135291
- return;
135292
- }
135293
- var nodeToSearch = node.getParent(tableAdded.key) || node;
135294
- var shouldAddTextAfterNode = false;
135295
- var indexToNotHaveTableOn = nodeToSearch.nodes.size - 1;
135296
- var indexOfLastTable = nodeToSearch.nodes.findLastIndex(function (d) {
135297
- return d.type === 'table';
135284
+ var addNodeBeforeArray = [];
135285
+ if (node.object !== 'document') return;
135286
+ node.findDescendant(function (d) {
135287
+ if (d.type === 'table') {
135288
+ var tablePath = node.getPath(d.key);
135289
+ var prevNode = node.getPreviousNode(tablePath);
135290
+ var nextNode = node.getNextNode(tablePath);
135291
+ if (!prevNode || !nextNode) {
135292
+ addNodeBeforeArray.push({
135293
+ node: d,
135294
+ prevNode: prevNode,
135295
+ nextNode: nextNode
135296
+ });
135297
+ }
135298
+ }
135298
135299
  });
135299
- if (indexOfLastTable === indexToNotHaveTableOn) {
135300
- shouldAddTextAfterNode = true;
135301
- }
135302
- if (!shouldAddTextAfterNode) {
135300
+ if (!addNodeBeforeArray.length) {
135303
135301
  return;
135304
135302
  }
135305
135303
  return function (change) {
135306
- if (shouldAddTextAfterNode) {
135307
- var tableJSON = tableAdded.toJSON();
135308
- change.removeNodeByKey(tableAdded.key);
135309
- var newBlock = _slate.Block.create({
135310
- object: 'block',
135311
- type: 'div'
135312
- });
135313
- change.insertBlock(newBlock);
135314
- change.withoutNormalization(function () {
135315
- var prevText = change.value.document.getPreviousText(newBlock.key);
135316
- if (prevText) {
135317
- var _prevText$text, _prevText$text2;
135318
- change.moveFocusTo(prevText.key, (_prevText$text = prevText.text) === null || _prevText$text === void 0 ? void 0 : _prevText$text.length).moveAnchorTo(prevText.key, (_prevText$text2 = prevText.text) === null || _prevText$text2 === void 0 ? void 0 : _prevText$text2.length);
135319
- }
135320
- change.insertBlock(_objectSpread(_objectSpread({}, tableJSON), {}, {
135321
- data: _objectSpread(_objectSpread({}, tableJSON.data), {}, {
135322
- newTable: true
135323
- })
135324
- }));
135325
- moveFocusToBeginningOfTable(change);
135326
- });
135327
- }
135304
+ var newBlock = {
135305
+ object: 'block',
135306
+ type: 'div'
135307
+ };
135308
+ addNodeBeforeArray.forEach(function (n) {
135309
+ var tablePath = change.value.document.getPath(n.node.key).toJSON();
135310
+ var indexToAdd = tablePath.splice(-1)[0];
135311
+ if (!n.prevNode) {
135312
+ change.insertNodeByPath(tablePath, indexToAdd, newBlock);
135313
+ return;
135314
+ }
135315
+ if (!n.nextNode) {
135316
+ change.insertNodeByPath(tablePath, indexToAdd + 1, newBlock);
135317
+ }
135318
+ });
135328
135319
  };
135329
135320
  };
135330
135321
  core.renderNode = Node;
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "name": "@pie-lib/pie-toolbox-math-rendering-module",
7
- "version": "1.12.1"
7
+ "version": "1.13.0"
8
8
  },
9
9
  {
10
10
  "name": "@pie-lib/pie-toolbox-module",
package/module/print.js CHANGED
@@ -1,4 +1,4 @@
1
- import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.12.1/module/index.js";
1
+ import {_dll_react, _dll_prop_types, _dll_react_dom, _dll_classnames, _dll_debug, _dll_lodash, _dll_react_dom_server, _dll_pie_framework__mathquill} from "../../../@pie-lib/pie-toolbox-math-rendering-module@1.13.0/module/index.js";
2
2
  import {_dll_pie_lib__pie_toolbox_render_ui} from "../../../@pie-lib/pie-toolbox-module@4.12.0/module/index.js";
3
3
  function _mergeNamespaces(n, m) {
4
4
  m.forEach(function (e) {
@@ -135281,50 +135281,41 @@ const require$$8$f = _dll_prop_types;
135281
135281
  node: _propTypes["default"].object
135282
135282
  };
135283
135283
  core.normalizeNode = function (node) {
135284
- if (node.object !== 'document') {
135285
- return;
135286
- }
135287
- var tableAdded = node.findDescendant(function (d) {
135288
- return d.data && d.data.get('newTable');
135289
- });
135290
- if (!tableAdded) {
135291
- return;
135292
- }
135293
- var nodeToSearch = node.getParent(tableAdded.key) || node;
135294
- var shouldAddTextAfterNode = false;
135295
- var indexToNotHaveTableOn = nodeToSearch.nodes.size - 1;
135296
- var indexOfLastTable = nodeToSearch.nodes.findLastIndex(function (d) {
135297
- return d.type === 'table';
135284
+ var addNodeBeforeArray = [];
135285
+ if (node.object !== 'document') return;
135286
+ node.findDescendant(function (d) {
135287
+ if (d.type === 'table') {
135288
+ var tablePath = node.getPath(d.key);
135289
+ var prevNode = node.getPreviousNode(tablePath);
135290
+ var nextNode = node.getNextNode(tablePath);
135291
+ if (!prevNode || !nextNode) {
135292
+ addNodeBeforeArray.push({
135293
+ node: d,
135294
+ prevNode: prevNode,
135295
+ nextNode: nextNode
135296
+ });
135297
+ }
135298
+ }
135298
135299
  });
135299
- if (indexOfLastTable === indexToNotHaveTableOn) {
135300
- shouldAddTextAfterNode = true;
135301
- }
135302
- if (!shouldAddTextAfterNode) {
135300
+ if (!addNodeBeforeArray.length) {
135303
135301
  return;
135304
135302
  }
135305
135303
  return function (change) {
135306
- if (shouldAddTextAfterNode) {
135307
- var tableJSON = tableAdded.toJSON();
135308
- change.removeNodeByKey(tableAdded.key);
135309
- var newBlock = _slate.Block.create({
135310
- object: 'block',
135311
- type: 'div'
135312
- });
135313
- change.insertBlock(newBlock);
135314
- change.withoutNormalization(function () {
135315
- var prevText = change.value.document.getPreviousText(newBlock.key);
135316
- if (prevText) {
135317
- var _prevText$text, _prevText$text2;
135318
- change.moveFocusTo(prevText.key, (_prevText$text = prevText.text) === null || _prevText$text === void 0 ? void 0 : _prevText$text.length).moveAnchorTo(prevText.key, (_prevText$text2 = prevText.text) === null || _prevText$text2 === void 0 ? void 0 : _prevText$text2.length);
135319
- }
135320
- change.insertBlock(_objectSpread(_objectSpread({}, tableJSON), {}, {
135321
- data: _objectSpread(_objectSpread({}, tableJSON.data), {}, {
135322
- newTable: true
135323
- })
135324
- }));
135325
- moveFocusToBeginningOfTable(change);
135326
- });
135327
- }
135304
+ var newBlock = {
135305
+ object: 'block',
135306
+ type: 'div'
135307
+ };
135308
+ addNodeBeforeArray.forEach(function (n) {
135309
+ var tablePath = change.value.document.getPath(n.node.key).toJSON();
135310
+ var indexToAdd = tablePath.splice(-1)[0];
135311
+ if (!n.prevNode) {
135312
+ change.insertNodeByPath(tablePath, indexToAdd, newBlock);
135313
+ return;
135314
+ }
135315
+ if (!n.nextNode) {
135316
+ change.insertNodeByPath(tablePath, indexToAdd + 1, newBlock);
135317
+ }
135318
+ });
135328
135319
  };
135329
135320
  };
135330
135321
  core.renderNode = Node;
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@pie-element/complex-rubric",
3
3
  "repository": "pie-framework/pie-elements",
4
- "version": "2.11.1-next.9+b9980bc25",
4
+ "version": "2.11.1",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
8
8
  "dependencies": {
9
9
  "@material-ui/core": "^3.9.2",
10
- "@pie-element/multi-trait-rubric": "^3.11.1-next.9+b9980bc25",
11
- "@pie-element/rubric": "^3.11.1-next.9+b9980bc25",
10
+ "@pie-element/multi-trait-rubric": "^3.11.1",
11
+ "@pie-element/rubric": "^3.11.1",
12
12
  "@pie-framework/pie-player-events": "^0.1.0",
13
13
  "classnames": "^2.2.5",
14
14
  "debug": "^4.1.1",
15
15
  "lodash": "^4.17.11",
16
16
  "prop-types": "^15.7.2"
17
17
  },
18
- "gitHead": "b9980bc25dc024e53eb08ef3f932d5e1629bf38a",
18
+ "gitHead": "cf58eaf9b251bc65863a00b3f70846d00b7fa42b",
19
19
  "scripts": {
20
20
  "postpublish": "../../scripts/postpublish"
21
21
  },