formlab-mcp 0.6.89 → 0.6.91
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/README.md +3 -2
- package/package.json +1 -1
- package/server.json +2 -2
- package/theoretical.js +22 -1
- package/tools/documents.js +1 -1
- package/tools/formulations.js +36 -2
- package/tools/ingredients.js +7 -2
- package/vendor/cost.js +66 -28
- package/vendor/equipment-calibration.js +6 -2
- package/vendor/fragrance.js +1146 -0
- package/vendor/nutrition-label.js +3 -3
- package/vendor/theoretical-params.js +3 -0
|
@@ -851,7 +851,7 @@ function _nlGate() {
|
|
|
851
851
|
}
|
|
852
852
|
function flNlCopyStatement(fid) {
|
|
853
853
|
if (!_nlGate()) return;
|
|
854
|
-
if (typeof flExportAllowed === 'function' && !flExportAllowed('single', 'an ingredient statement')) return; // what members can take out (0114)
|
|
854
|
+
if (typeof flExportAllowed === 'function' && !flExportAllowed('single', 'an ingredient statement', { records: (db.formulations || []).filter(x => x.id === fid), format: 'text' })) return; // what members can take out (0114); EX1
|
|
855
855
|
const f = (db.formulations || []).find(x => x.id === fid);
|
|
856
856
|
if (!f) return;
|
|
857
857
|
const text = _nlStatementText(f);
|
|
@@ -860,7 +860,7 @@ function flNlCopyStatement(fid) {
|
|
|
860
860
|
}
|
|
861
861
|
function flNlSavePng(fid) {
|
|
862
862
|
if (!_nlGate()) return;
|
|
863
|
-
if (typeof flExportAllowed === 'function' && !flExportAllowed('image', 'a nutrition label image')) return; // what members can take out (0114)
|
|
863
|
+
if (typeof flExportAllowed === 'function' && !flExportAllowed('image', 'a nutrition label image', { records: (db.formulations || []).filter(x => x.id === fid), format: 'PNG' })) return; // what members can take out (0114); EX1
|
|
864
864
|
const f = (db.formulations || []).find(x => x.id === fid);
|
|
865
865
|
const el = document.getElementById('nl-panel');
|
|
866
866
|
if (!f || !el) return;
|
|
@@ -929,7 +929,7 @@ const FL_NL_PANEL_CSS = `.nl-panel{box-sizing:border-box;width:280px;padding:4px
|
|
|
929
929
|
.nl-eu tr:last-child td{border-bottom:0}.nl-ri th:first-child{width:37%}.nl-eu th.nl-e-ri{width:13%}.nl-eu.nl-ri td{white-space:normal}.nl-eu.nl-ri .nl-e-in td:first-child{padding-left:12px}.nl-eu .nl-e-note td{text-align:left;font-size:9.5px;white-space:normal}.nl-eu .nl-e-note td + td{border-left:0}.nl-eu .nl-e-in td:first-child{padding-left:16px}`;
|
|
930
930
|
function flNlPrint(fid) {
|
|
931
931
|
if (!_nlGate()) return;
|
|
932
|
-
if (typeof flExportAllowed === 'function' && !flExportAllowed('single', 'a nutrition label print')) return; // what members can take out (0114)
|
|
932
|
+
if (typeof flExportAllowed === 'function' && !flExportAllowed('single', 'a nutrition label print', { records: (db.formulations || []).filter(x => x.id === fid), format: 'print' })) return; // what members can take out (0114); EX1
|
|
933
933
|
const f = (db.formulations || []).find(x => x.id === fid);
|
|
934
934
|
if (!f) return;
|
|
935
935
|
const s = flNlStatement(f);
|
|
@@ -794,6 +794,9 @@ function _tpIngredientView(ing) {
|
|
|
794
794
|
// the Reactive presets' sums; the datasheet terms (ing.eew, ing.ohv, ing.ncoPct …) null when absent, so
|
|
795
795
|
// `eew < 200` skips ingredients without one. Custom fields below still win on a name clash.
|
|
796
796
|
if (typeof flRxViewFields === 'function') Object.assign(out, flRxViewFields(ing));
|
|
797
|
+
// Fragrance (js/fragrance.js): ing.fragranceAllergens (the allergens it contains, by label name) and ing.ifra5A …
|
|
798
|
+
// (its max % in that IFRA category), so `fragranceAllergens contains linalool` and `ifra5A < 0.5` filter the list.
|
|
799
|
+
if (typeof flFrViewFields === 'function') Object.assign(out, flFrViewFields(ing));
|
|
797
800
|
(ing.customFields || []).forEach(cf => {
|
|
798
801
|
if (!cf || !cf.name) return;
|
|
799
802
|
const raw = cf.value;
|