@usecsv/react 0.2.9 → 0.2.11

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @usecsv/react v0.2.9
2
+ * @usecsv/react v0.2.11
3
3
  * (c) layercode
4
4
  * Released under the MIT License.
5
5
  */
@@ -38,7 +38,7 @@
38
38
  }
39
39
 
40
40
  /*!
41
- * @usecsv/js v0.6.1
41
+ * @usecsv/js v0.8.0
42
42
  * (c) layercode
43
43
  * Released under the MIT License.
44
44
  */
@@ -620,20 +620,28 @@
620
620
 
621
621
  // eslint-disable-next-line dot-notation
622
622
  var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
623
- var insertIframe = function (id) {
624
- var _a;
625
- insertCss_2("\n .usecsv_container {\n position: fixed;\n top: 0;\n bottom: 0;\n right: 0;\n left: 0;\n z-index: 100000;\n }\n .usecsv_container iframe {\n width: 100%;\n height: 100%;\n position: absolute;\n border-width: 0;\n }\n .usecsv_container {\n overflow: hidden;\n overscroll-behavior-x: none;\n }\n");
626
- document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\">\n</div>"));
623
+ var insertIframe = function (id, importerDisplay) {
624
+ var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
625
+ var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
626
+ ? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
627
+ : "";
628
+ insertCss_2("\n ".concat(usecsvContainerStyles, "\n .usecsv_container iframe {\n width: 100%;\n height: 100%;\n position: absolute;\n border-width: 0;\n }\n .usecsv_container {\n overflow: hidden;\n overscroll-behavior-x: none;\n }\n"));
629
+ document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
627
630
  var iframe = document.createElement("iframe");
628
631
  iframe.setAttribute("src", MOUNT_URL);
629
- (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.appendChild(iframe);
632
+ var usecsvContainer = document.getElementById(id);
633
+ usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
634
+ if (importerDisplay === "inline" && usecsvInlineWrapper) {
635
+ // usecsvInlineWrapper > usecsvContainer > iframe
636
+ usecsvInlineWrapper === null || usecsvInlineWrapper === void 0 ? void 0 : usecsvInlineWrapper.appendChild(usecsvContainer);
637
+ }
630
638
  return iframe;
631
639
  };
632
640
  var useCsvPlugin = function (_a) {
633
- var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit;
641
+ var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit, _b = _a.importerDisplay, importerDisplay = _b === void 0 ? "modal" : _b;
634
642
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
635
643
  return whenDomReady().then(function () {
636
- var iframe = insertIframe(id);
644
+ var iframe = insertIframe(id, importerDisplay);
637
645
  var closeIframe = function () {
638
646
  var _a;
639
647
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();