@usecsv/react 0.2.10 → 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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.2.11](https://github.com/layercodedev/usecsv-react-plugin/compare/v0.2.10...v0.2.11) (2022-10-23)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update "@usecsv/js", support inline importer modal ([5224955](https://github.com/layercodedev/usecsv-react-plugin/commit/5224955ae470c9eafc1a1d170763532b4a9bbff8))
7
+
1
8
  ## [0.2.10](https://github.com/layercodedev/usecsv-react-plugin/compare/v0.2.9...v0.2.10) (2022-10-06)
2
9
 
3
10
 
package/build/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @usecsv/react v0.2.10
2
+ * @usecsv/react v0.2.11
3
3
  * (c) layercode
4
4
  * Released under the MIT License.
5
5
  */
@@ -34,7 +34,7 @@ function __rest(s, e) {
34
34
  }
35
35
 
36
36
  /*!
37
- * @usecsv/js v0.7.0
37
+ * @usecsv/js v0.8.0
38
38
  * (c) layercode
39
39
  * Released under the MIT License.
40
40
  */
@@ -616,20 +616,28 @@ whenDomReady.resume = function (doc) {
616
616
 
617
617
  // eslint-disable-next-line dot-notation
618
618
  var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
619
- var insertIframe = function (id) {
620
- var _a;
621
- 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");
622
- document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\">\n</div>"));
619
+ var insertIframe = function (id, importerDisplay) {
620
+ var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
621
+ var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
622
+ ? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
623
+ : "";
624
+ 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"));
625
+ document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
623
626
  var iframe = document.createElement("iframe");
624
627
  iframe.setAttribute("src", MOUNT_URL);
625
- (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.appendChild(iframe);
628
+ var usecsvContainer = document.getElementById(id);
629
+ usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
630
+ if (importerDisplay === "inline" && usecsvInlineWrapper) {
631
+ // usecsvInlineWrapper > usecsvContainer > iframe
632
+ usecsvInlineWrapper === null || usecsvInlineWrapper === void 0 ? void 0 : usecsvInlineWrapper.appendChild(usecsvContainer);
633
+ }
626
634
  return iframe;
627
635
  };
628
636
  var useCsvPlugin = function (_a) {
629
- var importerKey = _a.importerKey, user = _a.user, metadata = _a.metadata, onData = _a.onData, onRecordsInitial = _a.onRecordsInitial, onRecordEdit = _a.onRecordEdit;
637
+ 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;
630
638
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
631
639
  return whenDomReady().then(function () {
632
- var iframe = insertIframe(id);
640
+ var iframe = insertIframe(id, importerDisplay);
633
641
  var closeIframe = function () {
634
642
  var _a;
635
643
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();