@pie-element/multi-trait-rubric 2.5.1-beta.1 → 2.5.1-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/configure/lib/common.js +467 -0
- package/configure/lib/common.js.map +1 -0
- package/configure/lib/defaults.js +93 -0
- package/configure/lib/defaults.js.map +1 -0
- package/configure/lib/index.js +94 -0
- package/configure/lib/index.js.map +1 -0
- package/configure/lib/main.js +419 -0
- package/configure/lib/main.js.map +1 -0
- package/configure/lib/modals.js +329 -0
- package/configure/lib/modals.js.map +1 -0
- package/configure/lib/scale.js +469 -0
- package/configure/lib/scale.js.map +1 -0
- package/configure/lib/trait.js +300 -0
- package/configure/lib/trait.js.map +1 -0
- package/configure/lib/traitsHeader.js +223 -0
- package/configure/lib/traitsHeader.js.map +1 -0
- package/configure/lib/utils.js +27 -0
- package/configure/lib/utils.js.map +1 -0
- package/configure/package.json +4 -4
- package/controller/lib/defaults.js +93 -0
- package/controller/lib/defaults.js.map +1 -0
- package/controller/lib/index.js +100 -0
- package/controller/lib/index.js.map +1 -0
- package/lib/index.js +64 -0
- package/lib/index.js.map +1 -0
- package/lib/main.js +110 -0
- package/lib/main.js.map +1 -0
- package/lib/scale.js +181 -0
- package/lib/scale.js.map +1 -0
- package/lib/trait.js +89 -0
- package/lib/trait.js.map +1 -0
- package/package.json +2 -2
package/lib/scale.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_renderUi","_trait","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","result","NewTarget","constructor","Reflect","construct","arguments","apply","_possibleConstructorReturn2","sham","Proxy","Boolean","prototype","valueOf","call","e","styles","table","borderSpacing","marginBottom","borderRadius","color","text","fontSize","lineHeight","marginBlockStart","paddingInlineStart","padding","textAlign","backgroundColor","secondaryBackground","verticalAlign","width","scorePointHeader","border","minWidth","pointLabel","scorePointValue","fontWeight","Scale","_React$Component","_inherits2","_super","_classCallCheck2","_createClass2","key","value","render","_this$props","props","classes","scale","scaleIndex","showDescription","showPointsLabels","showStandards","_ref","excludeZero","maxPoints","traitLabel","traits","scorePointsLabels","scorePointsValues","descriptions","pointsLabels","standards","pointValue","push","_traits$reduce","reduce","tcc","trait","traitStandards","concat","_toConsumableArray2","traitDescriptions","description","length","createElement","className","dangerouslySetInnerHTML","__html","map","index","traitIndex","React","Component","propTypes","PropTypes","object","number","shape","bool","arrayOf","string","name","scorePointsDescriptors","_default","withStyles","exports"],"sources":["../src/scale.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\nimport Trait from './trait';\n\nconst styles = () => ({\n table: {\n borderSpacing: 0,\n marginBottom: '16px',\n borderRadius: '4px',\n color: color.text(),\n fontSize: '14px',\n lineHeight: '16px',\n\n '& ul, ol': {\n marginBlockStart: 0,\n paddingInlineStart: '16px',\n },\n\n '& th': {\n padding: '16px',\n textAlign: 'left',\n backgroundColor: color.secondaryBackground(),\n verticalAlign: 'bottom',\n },\n\n '& th div': {\n width: '200px',\n },\n\n '& td': {\n width: '200px',\n padding: '16px 8px',\n verticalAlign: 'top',\n },\n },\n scorePointHeader: {\n '& td': {\n border: 0,\n padding: 0,\n textAlign: 'center',\n minWidth: '200px',\n },\n },\n pointLabel: {\n marginBottom: '4px',\n },\n scorePointValue: {\n fontWeight: 'normal',\n },\n});\n\nclass Scale extends React.Component {\n render() {\n const { classes, scale, scaleIndex, showDescription, showPointsLabels, showStandards } = this.props;\n const { excludeZero, maxPoints, traitLabel, traits, scorePointsLabels } = scale || {};\n\n let scorePointsValues = [];\n let descriptions;\n let pointsLabels;\n let standards;\n try {\n // determining the score points values\n for (let pointValue = maxPoints; pointValue >= excludeZero ? 1 : 0; pointValue -= 1) {\n scorePointsValues.push(pointValue);\n }\n\n const { traitStandards, traitDescriptions } = traits.reduce(\n (tcc, trait) => ({\n traitStandards: [...tcc.traitStandards, ...(trait.standards || [])],\n traitDescriptions: [...tcc.traitDescriptions, ...(trait.description || [])],\n }),\n {\n traitStandards: [],\n traitDescriptions: [],\n },\n );\n\n descriptions = showDescription && traitDescriptions.length;\n pointsLabels = showPointsLabels && scorePointsLabels.length;\n standards = showStandards && traitStandards.length;\n } catch (e) {\n descriptions = false;\n pointsLabels = false;\n standards = false;\n }\n\n return (\n <table key={`scale-${scaleIndex}`} className={classes.table}>\n <thead>\n <tr>\n <th>\n <div dangerouslySetInnerHTML={{ __html: traitLabel }} />\n </th>\n\n {standards ? (\n <th>\n <div>Standard(s)</div>\n </th>\n ) : null}\n\n {descriptions ? (\n <th>\n <div>Description</div>\n </th>\n ) : null}\n\n {scorePointsValues &&\n scorePointsValues.map((scorePointValue, index) => {\n let pointLabel = '';\n\n // to handle the case when there aren't enough labels\n try {\n pointLabel = scorePointsLabels[scorePointsValues.length - index - 1] || '';\n } catch (e) {\n pointLabel = '';\n }\n\n return (\n <th key={`table-header-${index}`}>\n <table className={classes.scorePointHeader}>\n <thead>\n {pointsLabels ? (\n <tr>\n <td>\n <div className={classes.pointLabel} dangerouslySetInnerHTML={{ __html: pointLabel }} />\n </td>\n </tr>\n ) : null}\n <tr>\n <td className={classes.scorePointValue}>\n {scorePointValue === 1 ? `${scorePointValue} point` : `${scorePointValue} points`}\n </td>\n </tr>\n </thead>\n </table>\n </th>\n );\n })}\n </tr>\n </thead>\n\n <tbody>\n {traits &&\n traits.map((trait, traitIndex) => (\n <Trait\n key={`trait_${scaleIndex}_${traitIndex}`}\n trait={trait}\n traitIndex={traitIndex}\n showDescription={!!descriptions}\n showStandards={!!standards}\n scaleIndex={scaleIndex}\n scorePointsValues={scorePointsValues}\n excludeZero={excludeZero}\n />\n ))}\n </tbody>\n </table>\n );\n }\n}\n\nScale.propTypes = {\n classes: PropTypes.object,\n scaleIndex: PropTypes.number,\n scale: PropTypes.shape({\n excludeZero: PropTypes.bool,\n maxPoints: PropTypes.number,\n scorePointsLabels: PropTypes.arrayOf(PropTypes.string),\n traitLabel: PropTypes.string,\n traits: PropTypes.arrayOf(\n PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n ),\n }),\n showPointsLabels: PropTypes.bool,\n showDescription: PropTypes.bool,\n showStandards: PropTypes.bool,\n};\n\nexport default withStyles(styles)(Scale);\n"],"mappings":";;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AAA4B,SAAAK,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,aAAAL,OAAA,GAAAM,MAAA,MAAAL,yBAAA,QAAAM,SAAA,OAAAF,gBAAA,mBAAAG,WAAA,EAAAF,MAAA,GAAAG,OAAA,CAAAC,SAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAJ,SAAA,YAAAD,MAAA,GAAAF,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,mBAAAP,MAAA;AAAA,SAAAJ,0BAAA,eAAAO,OAAA,qBAAAA,OAAA,CAAAC,SAAA,oBAAAD,OAAA,CAAAC,SAAA,CAAAI,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,OAAA,CAAAC,SAAA,CAAAM,OAAA,8CAAAI,CAAA;AAE5B,IAAMC,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAU;IACpBC,KAAK,EAAE;MACLC,aAAa,EA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EAC5BvC,KAAK,EAAEqC,qBAAS,CAACG,KAAK,CAAC;IACrBlC,WAAW,EAAE+B,qBAAS,CAACI,IAAI;IAC3BlC,SAAS,EAAE8B,qBAAS,CAACE,MAAM;IAC3B7B,iBAAiB,EAAE2B,qBAAS,CAACK,OAAO,CAACL,qBAAS,CAACM,MAAM,CAAC;IACtDnC,UAAU,EAAE6B,qBAAS,CAACM,MAAM;IAC5BlC,MAAM,EAAE4B,qBAAS,CAACK,OAAO,CACvBL,qBAAS,CAACG,KAAK,CAAC;MACdI,IAAI,EAAEP,qBAAS,CAACM,MAAM;MACtB7B,SAAS,EAAEuB,qBAAS,CAACK,OAAO,CAACL,qBAAS,CAACM,MAAM,CAAC;MAC9CE,sBAAsB,EAAER,qBAAS,CAACK,OAAO,CAACL,qBAAS,CAACM,MAAM,CAAC;MAC3DlB,WAAW,EAAEY,qBAAS,CAACM;IACzB,CAAC,CACH;EACF,CAAC,CAAC;EACFxC,gBAAgB,EAAEkC,qBAAS,CAACI,IAAI;EAChCvC,eAAe,EAAEmC,qBAAS,CAACI,IAAI;EAC/BrC,aAAa,EAAEiC,qBAAS,CAACI;AAC3B,CAAC;AAAC,IAAAK,QAAA,GAEa,IAAAC,kBAAU,EAAClF,MAAM,CAAC,CAACuB,KAAK,CAAC;AAAA4D,OAAA,cAAAF,QAAA"}
|
package/lib/trait.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports["default"] = void 0;
|
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
|
9
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
10
|
+
var _styles = require("@material-ui/core/styles");
|
|
11
|
+
var _renderUi = require("@pie-lib/render-ui");
|
|
12
|
+
var styles = function styles() {
|
|
13
|
+
return {
|
|
14
|
+
trait: {
|
|
15
|
+
'&$traitName': {
|
|
16
|
+
color: _renderUi.color.primaryDark(),
|
|
17
|
+
verticalAlign: 'middle'
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
noDescription: {
|
|
21
|
+
color: _renderUi.color.secondaryBackground(),
|
|
22
|
+
textAlign: 'center'
|
|
23
|
+
},
|
|
24
|
+
traitName: {}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
var Trait = function Trait(props) {
|
|
28
|
+
var trait = props.trait,
|
|
29
|
+
traitIndex = props.traitIndex,
|
|
30
|
+
scaleIndex = props.scaleIndex,
|
|
31
|
+
showStandards = props.showStandards,
|
|
32
|
+
showDescription = props.showDescription,
|
|
33
|
+
scorePointsValues = props.scorePointsValues,
|
|
34
|
+
classes = props.classes;
|
|
35
|
+
var _ref = trait || {},
|
|
36
|
+
name = _ref.name,
|
|
37
|
+
standards = _ref.standards,
|
|
38
|
+
scorePointsDescriptors = _ref.scorePointsDescriptors,
|
|
39
|
+
description = _ref.description;
|
|
40
|
+
return /*#__PURE__*/_react["default"].createElement("tr", {
|
|
41
|
+
key: "scale-".concat(scaleIndex, "-trait-").concat(traitIndex)
|
|
42
|
+
}, /*#__PURE__*/_react["default"].createElement("td", {
|
|
43
|
+
className: "".concat(classes.trait, " ").concat(classes.traitName)
|
|
44
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
45
|
+
dangerouslySetInnerHTML: {
|
|
46
|
+
__html: name
|
|
47
|
+
}
|
|
48
|
+
})), showStandards ? /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
49
|
+
dangerouslySetInnerHTML: {
|
|
50
|
+
__html: standards.join(',')
|
|
51
|
+
}
|
|
52
|
+
})) : null, showDescription ? /*#__PURE__*/_react["default"].createElement("td", null, /*#__PURE__*/_react["default"].createElement("div", {
|
|
53
|
+
dangerouslySetInnerHTML: {
|
|
54
|
+
__html: description
|
|
55
|
+
}
|
|
56
|
+
})) : null, scorePointsValues && scorePointsValues.map(function (scorePointValue, index) {
|
|
57
|
+
var scoreDescriptor;
|
|
58
|
+
try {
|
|
59
|
+
scoreDescriptor = scorePointsDescriptors[scorePointsValues.length - index - 1] || '';
|
|
60
|
+
} catch (e) {
|
|
61
|
+
scoreDescriptor = '';
|
|
62
|
+
}
|
|
63
|
+
return /*#__PURE__*/_react["default"].createElement("td", {
|
|
64
|
+
key: "table-cell-".concat(index)
|
|
65
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
|
66
|
+
className: !scoreDescriptor ? classes.noDescription : '',
|
|
67
|
+
dangerouslySetInnerHTML: {
|
|
68
|
+
__html: scoreDescriptor || 'No Description'
|
|
69
|
+
}
|
|
70
|
+
}));
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
Trait.propTypes = {
|
|
74
|
+
classes: _propTypes["default"].object,
|
|
75
|
+
showStandards: _propTypes["default"].bool,
|
|
76
|
+
showDescription: _propTypes["default"].bool,
|
|
77
|
+
scorePointsValues: _propTypes["default"].arrayOf(_propTypes["default"].number),
|
|
78
|
+
scaleIndex: _propTypes["default"].number,
|
|
79
|
+
traitIndex: _propTypes["default"].number,
|
|
80
|
+
trait: _propTypes["default"].shape({
|
|
81
|
+
name: _propTypes["default"].string,
|
|
82
|
+
standards: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
83
|
+
scorePointsDescriptors: _propTypes["default"].arrayOf(_propTypes["default"].string),
|
|
84
|
+
description: _propTypes["default"].string
|
|
85
|
+
})
|
|
86
|
+
};
|
|
87
|
+
var _default = (0, _styles.withStyles)(styles)(Trait);
|
|
88
|
+
exports["default"] = _default;
|
|
89
|
+
//# sourceMappingURL=trait.js.map
|
package/lib/trait.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trait.js","names":["_react","_interopRequireDefault","require","_propTypes","_styles","_renderUi","styles","trait","color","primaryDark","verticalAlign","noDescription","secondaryBackground","textAlign","traitName","Trait","props","traitIndex","scaleIndex","showStandards","showDescription","scorePointsValues","classes","_ref","name","standards","scorePointsDescriptors","description","createElement","key","concat","className","dangerouslySetInnerHTML","__html","join","map","scorePointValue","index","scoreDescriptor","length","e","propTypes","PropTypes","object","bool","arrayOf","number","shape","string","_default","withStyles","exports"],"sources":["../src/trait.jsx"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport { color } from '@pie-lib/render-ui';\n\nconst styles = () => ({\n trait: {\n '&$traitName': {\n color: color.primaryDark(),\n verticalAlign: 'middle',\n },\n },\n noDescription: {\n color: color.secondaryBackground(),\n textAlign: 'center',\n },\n traitName: {},\n});\n\nconst Trait = (props) => {\n const { trait, traitIndex, scaleIndex, showStandards, showDescription, scorePointsValues, classes } = props;\n const { name, standards, scorePointsDescriptors, description } = trait || {};\n\n return (\n <tr key={`scale-${scaleIndex}-trait-${traitIndex}`}>\n <td className={`${classes.trait} ${classes.traitName}`}>\n <div dangerouslySetInnerHTML={{ __html: name }} />\n </td>\n\n {showStandards ? (\n <td>\n <div dangerouslySetInnerHTML={{ __html: standards.join(',') }} />\n </td>\n ) : null}\n\n {showDescription ? (\n <td>\n <div dangerouslySetInnerHTML={{ __html: description }} />\n </td>\n ) : null}\n\n {scorePointsValues &&\n scorePointsValues.map((scorePointValue, index) => {\n let scoreDescriptor;\n\n try {\n scoreDescriptor = scorePointsDescriptors[scorePointsValues.length - index - 1] || '';\n } catch (e) {\n scoreDescriptor = '';\n }\n\n return (\n <td key={`table-cell-${index}`}>\n <div\n className={!scoreDescriptor ? classes.noDescription : ''}\n dangerouslySetInnerHTML={{ __html: scoreDescriptor || 'No Description' }}\n />\n </td>\n );\n })}\n </tr>\n );\n};\n\nTrait.propTypes = {\n classes: PropTypes.object,\n showStandards: PropTypes.bool,\n showDescription: PropTypes.bool,\n scorePointsValues: PropTypes.arrayOf(PropTypes.number),\n scaleIndex: PropTypes.number,\n traitIndex: PropTypes.number,\n trait: PropTypes.shape({\n name: PropTypes.string,\n standards: PropTypes.arrayOf(PropTypes.string),\n scorePointsDescriptors: PropTypes.arrayOf(PropTypes.string),\n description: PropTypes.string,\n }),\n};\n\nexport default withStyles(styles)(Trait);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AAEA,IAAMI,MAAM,GAAG,SAATA,MAAMA,CAAA;EAAA,OAAU;IACpBC,KAAK,EAAE;MACL,aAAa,EAAE;QACbC,KAAK,EAAEA,eAAK,CAACC,WAAW,CAAC,CAAC;QAC1BC,aAAa,EAAE;MACjB;IACF,CAAC;IACDC,aAAa,EAAE;MACbH,KAAK,EAAEA,eAAK,CAACI,mBAAmB,CAAC,CAAC;MAClCC,SAAS,EAAE;IACb,CAAC;IACDC,SAAS,EAAE,CAAC;EACd,CAAC;AAAA,CAAC;AAEF,IAAMC,KAAK,GAAG,SAARA,KAAKA,CAAIC,KAAK,EAAK;EACvB,IAAQT,KAAK,GAAyFS,KAAK,CAAnGT,KAAK;IAAEU,UAAU,GAA6ED,KAAK,CAA5FC,UAAU;IAAEC,UAAU,GAAiEF,KAAK,CAAhFE,UAAU;IAAEC,aAAa,GAAkDH,KAAK,CAApEG,aAAa;IAAEC,eAAe,GAAiCJ,KAAK,CAArDI,eAAe;IAAEC,iBAAiB,GAAcL,KAAK,CAApCK,iBAAiB;IAAEC,OAAO,GAAKN,KAAK,CAAjBM,OAAO;EACjG,IAAAC,IAAA,GAAiEhB,KAAK,IAAI,CAAC,CAAC;IAApEiB,IAAI,GAAAD,IAAA,CAAJC,IAAI;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS;IAAEC,sBAAsB,GAAAH,IAAA,CAAtBG,sBAAsB;IAAEC,WAAW,GAAAJ,IAAA,C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CAAC;EAET,CAAC,CACD,CAAC;AAET,CAAC;AAEDvB,KAAK,CAAC0B,SAAS,GAAG;EAChBnB,OAAO,EAAEoB,qBAAS,CAACC,MAAM;EACzBxB,aAAa,EAAEuB,qBAAS,CAACE,IAAI;EAC7BxB,eAAe,EAAEsB,qBAAS,CAACE,IAAI;EAC/BvB,iBAAiB,EAAEqB,qBAAS,CAACG,OAAO,CAACH,qBAAS,CAACI,MAAM,CAAC;EACtD5B,UAAU,EAAEwB,qBAAS,CAACI,MAAM;EAC5B7B,UAAU,EAAEyB,qBAAS,CAACI,MAAM;EAC5BvC,KAAK,EAAEmC,qBAAS,CAACK,KAAK,CAAC;IACrBvB,IAAI,EAAEkB,qBAAS,CAACM,MAAM;IACtBvB,SAAS,EAAEiB,qBAAS,CAACG,OAAO,CAACH,qBAAS,CAACM,MAAM,CAAC;IAC9CtB,sBAAsB,EAAEgB,qBAAS,CAACG,OAAO,CAACH,qBAAS,CAACM,MAAM,CAAC;IAC3DrB,WAAW,EAAEe,qBAAS,CAACM;EACzB,CAAC;AACH,CAAC;AAAC,IAAAC,QAAA,GAEa,IAAAC,kBAAU,EAAC5C,MAAM,CAAC,CAACS,KAAK,CAAC;AAAAoC,OAAA,cAAAF,QAAA"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pie-element/multi-trait-rubric",
|
|
3
3
|
"repository": "pie-framework/pie-elements",
|
|
4
|
-
"version": "2.5.1-beta.
|
|
4
|
+
"version": "2.5.1-beta.4+4157b2b34",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"react": "^16.8.1",
|
|
17
17
|
"react-dom": "^16.8.1"
|
|
18
18
|
},
|
|
19
|
-
"gitHead": "
|
|
19
|
+
"gitHead": "4157b2b34711d36e3fea05d833ab5ed9d4b05b48",
|
|
20
20
|
"scripts": {
|
|
21
21
|
"postpublish": "../../scripts/postpublish"
|
|
22
22
|
},
|