@teselagen/ui 0.3.66 → 0.3.68

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/index.cjs.js CHANGED
@@ -16995,20 +16995,11 @@ function require_domCreate() {
16995
16995
  return _domCreate;
16996
16996
  }
16997
16997
  __name(require_domCreate, "require_domCreate");
16998
- var _ie8DomDefine;
16999
- var hasRequired_ie8DomDefine;
17000
- function require_ie8DomDefine() {
17001
- if (hasRequired_ie8DomDefine)
17002
- return _ie8DomDefine;
17003
- hasRequired_ie8DomDefine = 1;
17004
- _ie8DomDefine = !require_descriptors() && !_fails(function() {
17005
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
17006
- return 7;
17007
- } }).a != 7;
17008
- });
17009
- return _ie8DomDefine;
17010
- }
17011
- __name(require_ie8DomDefine, "require_ie8DomDefine");
16998
+ var _ie8DomDefine = !require_descriptors() && !_fails(function() {
16999
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
17000
+ return 7;
17001
+ } }).a != 7;
17002
+ });
17012
17003
  var isObject$d = _isObject;
17013
17004
  var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
17014
17005
  if (!isObject$d(it))
@@ -17028,7 +17019,7 @@ function require_objectDp() {
17028
17019
  return _objectDp;
17029
17020
  hasRequired_objectDp = 1;
17030
17021
  var anObject2 = _anObject;
17031
- var IE8_DOM_DEFINE2 = require_ie8DomDefine();
17022
+ var IE8_DOM_DEFINE2 = _ie8DomDefine;
17032
17023
  var toPrimitive2 = _toPrimitive;
17033
17024
  var dP2 = Object.defineProperty;
17034
17025
  _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
@@ -17131,16 +17122,25 @@ var toString$6 = {}.toString;
17131
17122
  var _cof = /* @__PURE__ */ __name(function(it) {
17132
17123
  return toString$6.call(it).slice(8, -1);
17133
17124
  }, "_cof");
17134
- var cof$2 = _cof;
17135
- var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17136
- return cof$2(it) == "String" ? it.split("") : Object(it);
17137
- };
17125
+ var _iobject;
17126
+ var hasRequired_iobject;
17127
+ function require_iobject() {
17128
+ if (hasRequired_iobject)
17129
+ return _iobject;
17130
+ hasRequired_iobject = 1;
17131
+ var cof2 = _cof;
17132
+ _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17133
+ return cof2(it) == "String" ? it.split("") : Object(it);
17134
+ };
17135
+ return _iobject;
17136
+ }
17137
+ __name(require_iobject, "require_iobject");
17138
17138
  var _defined = /* @__PURE__ */ __name(function(it) {
17139
17139
  if (it == void 0)
17140
17140
  throw TypeError("Can't call method on " + it);
17141
17141
  return it;
17142
17142
  }, "_defined");
17143
- var IObject = _iobject;
17143
+ var IObject = require_iobject();
17144
17144
  var defined$2 = _defined;
17145
17145
  var _toIobject = /* @__PURE__ */ __name(function(it) {
17146
17146
  return IObject(defined$2(it));
@@ -17253,7 +17253,7 @@ function require_objectAssign() {
17253
17253
  var gOPS2 = _objectGops;
17254
17254
  var pIE2 = _objectPie;
17255
17255
  var toObject2 = _toObject;
17256
- var IObject2 = _iobject;
17256
+ var IObject2 = require_iobject();
17257
17257
  var $assign = Object.assign;
17258
17258
  _objectAssign = !$assign || _fails(function() {
17259
17259
  var A2 = {};
@@ -17952,7 +17952,7 @@ var createDesc$1 = _propertyDesc;
17952
17952
  var toIObject$1 = _toIobject;
17953
17953
  var toPrimitive$1 = _toPrimitive;
17954
17954
  var has$6 = _has;
17955
- var IE8_DOM_DEFINE = require_ie8DomDefine();
17955
+ var IE8_DOM_DEFINE = _ie8DomDefine;
17956
17956
  var gOPD$2 = Object.getOwnPropertyDescriptor;
17957
17957
  _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17958
17958
  O2 = toIObject$1(O2);
@@ -60480,6 +60480,14 @@ function matchSchemas(_0) {
60480
60480
  csvValidationIssue = "It looks like some of the headers in your uploaded file(s) do not match the expected headers. Please look over and correct any issues with the mappings below.";
60481
60481
  }
60482
60482
  });
60483
+ const ignoredUserSchemaFields = [];
60484
+ userSchema.fields.forEach((uh) => {
60485
+ if (!officialSchema.fields.find(
60486
+ (h2) => norm(h2.path) === norm(uh.path) || norm(h2.displayName) === norm(uh.path) || matchedAltPaths.includes(uh.path)
60487
+ )) {
60488
+ ignoredUserSchemaFields.push(uh);
60489
+ }
60490
+ });
60483
60491
  if (officialSchema.coerceUserSchema) {
60484
60492
  officialSchema.coerceUserSchema({ userSchema, officialSchema });
60485
60493
  }
@@ -60537,6 +60545,9 @@ function matchSchemas(_0) {
60537
60545
  };
60538
60546
  }
60539
60547
  }
60548
+ if (!csvValidationIssue && ignoredUserSchemaFields.length) {
60549
+ csvValidationIssue = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields.map((f2) => f2.displayName || f2.path).join(", ")}`;
60550
+ }
60540
60551
  return {
60541
60552
  searchResults: officialSchema.fields,
60542
60553
  csvValidationIssue
package/index.es.js CHANGED
@@ -16977,20 +16977,11 @@ function require_domCreate() {
16977
16977
  return _domCreate;
16978
16978
  }
16979
16979
  __name(require_domCreate, "require_domCreate");
16980
- var _ie8DomDefine;
16981
- var hasRequired_ie8DomDefine;
16982
- function require_ie8DomDefine() {
16983
- if (hasRequired_ie8DomDefine)
16984
- return _ie8DomDefine;
16985
- hasRequired_ie8DomDefine = 1;
16986
- _ie8DomDefine = !require_descriptors() && !_fails(function() {
16987
- return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
16988
- return 7;
16989
- } }).a != 7;
16990
- });
16991
- return _ie8DomDefine;
16992
- }
16993
- __name(require_ie8DomDefine, "require_ie8DomDefine");
16980
+ var _ie8DomDefine = !require_descriptors() && !_fails(function() {
16981
+ return Object.defineProperty(require_domCreate()("div"), "a", { get: function() {
16982
+ return 7;
16983
+ } }).a != 7;
16984
+ });
16994
16985
  var isObject$d = _isObject;
16995
16986
  var _toPrimitive = /* @__PURE__ */ __name(function(it, S2) {
16996
16987
  if (!isObject$d(it))
@@ -17010,7 +17001,7 @@ function require_objectDp() {
17010
17001
  return _objectDp;
17011
17002
  hasRequired_objectDp = 1;
17012
17003
  var anObject2 = _anObject;
17013
- var IE8_DOM_DEFINE2 = require_ie8DomDefine();
17004
+ var IE8_DOM_DEFINE2 = _ie8DomDefine;
17014
17005
  var toPrimitive2 = _toPrimitive;
17015
17006
  var dP2 = Object.defineProperty;
17016
17007
  _objectDp.f = require_descriptors() ? Object.defineProperty : /* @__PURE__ */ __name(function defineProperty5(O2, P2, Attributes) {
@@ -17113,16 +17104,25 @@ var toString$6 = {}.toString;
17113
17104
  var _cof = /* @__PURE__ */ __name(function(it) {
17114
17105
  return toString$6.call(it).slice(8, -1);
17115
17106
  }, "_cof");
17116
- var cof$2 = _cof;
17117
- var _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17118
- return cof$2(it) == "String" ? it.split("") : Object(it);
17119
- };
17107
+ var _iobject;
17108
+ var hasRequired_iobject;
17109
+ function require_iobject() {
17110
+ if (hasRequired_iobject)
17111
+ return _iobject;
17112
+ hasRequired_iobject = 1;
17113
+ var cof2 = _cof;
17114
+ _iobject = Object("z").propertyIsEnumerable(0) ? Object : function(it) {
17115
+ return cof2(it) == "String" ? it.split("") : Object(it);
17116
+ };
17117
+ return _iobject;
17118
+ }
17119
+ __name(require_iobject, "require_iobject");
17120
17120
  var _defined = /* @__PURE__ */ __name(function(it) {
17121
17121
  if (it == void 0)
17122
17122
  throw TypeError("Can't call method on " + it);
17123
17123
  return it;
17124
17124
  }, "_defined");
17125
- var IObject = _iobject;
17125
+ var IObject = require_iobject();
17126
17126
  var defined$2 = _defined;
17127
17127
  var _toIobject = /* @__PURE__ */ __name(function(it) {
17128
17128
  return IObject(defined$2(it));
@@ -17235,7 +17235,7 @@ function require_objectAssign() {
17235
17235
  var gOPS2 = _objectGops;
17236
17236
  var pIE2 = _objectPie;
17237
17237
  var toObject2 = _toObject;
17238
- var IObject2 = _iobject;
17238
+ var IObject2 = require_iobject();
17239
17239
  var $assign = Object.assign;
17240
17240
  _objectAssign = !$assign || _fails(function() {
17241
17241
  var A2 = {};
@@ -17934,7 +17934,7 @@ var createDesc$1 = _propertyDesc;
17934
17934
  var toIObject$1 = _toIobject;
17935
17935
  var toPrimitive$1 = _toPrimitive;
17936
17936
  var has$6 = _has;
17937
- var IE8_DOM_DEFINE = require_ie8DomDefine();
17937
+ var IE8_DOM_DEFINE = _ie8DomDefine;
17938
17938
  var gOPD$2 = Object.getOwnPropertyDescriptor;
17939
17939
  _objectGopd.f = require_descriptors() ? gOPD$2 : /* @__PURE__ */ __name(function getOwnPropertyDescriptor(O2, P2) {
17940
17940
  O2 = toIObject$1(O2);
@@ -60462,6 +60462,14 @@ function matchSchemas(_0) {
60462
60462
  csvValidationIssue = "It looks like some of the headers in your uploaded file(s) do not match the expected headers. Please look over and correct any issues with the mappings below.";
60463
60463
  }
60464
60464
  });
60465
+ const ignoredUserSchemaFields = [];
60466
+ userSchema.fields.forEach((uh) => {
60467
+ if (!officialSchema.fields.find(
60468
+ (h2) => norm(h2.path) === norm(uh.path) || norm(h2.displayName) === norm(uh.path) || matchedAltPaths.includes(uh.path)
60469
+ )) {
60470
+ ignoredUserSchemaFields.push(uh);
60471
+ }
60472
+ });
60465
60473
  if (officialSchema.coerceUserSchema) {
60466
60474
  officialSchema.coerceUserSchema({ userSchema, officialSchema });
60467
60475
  }
@@ -60519,6 +60527,9 @@ function matchSchemas(_0) {
60519
60527
  };
60520
60528
  }
60521
60529
  }
60530
+ if (!csvValidationIssue && ignoredUserSchemaFields.length) {
60531
+ csvValidationIssue = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields.map((f2) => f2.displayName || f2.path).join(", ")}`;
60532
+ }
60522
60533
  return {
60523
60534
  searchResults: officialSchema.fields,
60524
60535
  csvValidationIssue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teselagen/ui",
3
- "version": "0.3.66",
3
+ "version": "0.3.68",
4
4
  "main": "./src/index.js",
5
5
  "exports": {
6
6
  ".": {
@@ -140,6 +140,20 @@ async function matchSchemas({ userSchema, officialSchema }) {
140
140
  "It looks like some of the headers in your uploaded file(s) do not match the expected headers. Please look over and correct any issues with the mappings below.";
141
141
  }
142
142
  });
143
+ const ignoredUserSchemaFields = [];
144
+ userSchema.fields.forEach(uh => {
145
+ if (
146
+ !officialSchema.fields.find(
147
+ h =>
148
+ norm(h.path) === norm(uh.path) ||
149
+ norm(h.displayName) === norm(uh.path) ||
150
+ matchedAltPaths.includes(uh.path)
151
+ )
152
+ ) {
153
+ ignoredUserSchemaFields.push(uh);
154
+ }
155
+ });
156
+
143
157
  if (officialSchema.coerceUserSchema) {
144
158
  officialSchema.coerceUserSchema({ userSchema, officialSchema });
145
159
  }
@@ -214,7 +228,11 @@ async function matchSchemas({ userSchema, officialSchema }) {
214
228
  // //all the headers match up as does the actual data
215
229
  // return { csvValidationIssue };
216
230
  // }
217
-
231
+ if (!csvValidationIssue && ignoredUserSchemaFields.length) {
232
+ csvValidationIssue = `It looks like the following headers in your file didn't map to any of the accepted headers: ${ignoredUserSchemaFields
233
+ .map(f => f.displayName || f.path)
234
+ .join(", ")}`;
235
+ }
218
236
  return {
219
237
  searchResults: officialSchema.fields,
220
238
  csvValidationIssue