@usecsv/react 0.17.0 → 0.18.0

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.18.0](https://github.com/usecsv/usecsv-react-plugin/compare/v0.17.0...v0.18.0) (2025-03-04)
2
+
3
+
4
+ ### Features
5
+
6
+ * add iframeId option ([a85d905](https://github.com/usecsv/usecsv-react-plugin/commit/a85d905e722264a280fea3ade0ef5f64d43b73d2))
7
+
1
8
  # [0.17.0](https://github.com/usecsv/usecsv-react-plugin/compare/v0.16.4...v0.17.0) (2024-12-10)
2
9
 
3
10
 
package/build/index.cjs CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @usecsv/react v0.17.0
2
+ * @usecsv/react v0.18.0
3
3
  * (c) usecsv
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.30.0
37
+ * @usecsv/js v0.31.0
38
38
  * (c) usecsv
39
39
  * Released under the MIT License.
40
40
  */
@@ -697,7 +697,7 @@ whenDomReady.resume = function (doc) {
697
697
 
698
698
  // eslint-disable-next-line dot-notation
699
699
  var MOUNT_URL = {"MOUNT_URL":"https://app.usecsv.com/importer"}["MOUNT_URL"] ;
700
- var insertIframe = function (id, importerDisplay) {
700
+ var insertIframe = function (id, importerDisplay, iframeId) {
701
701
  var usecsvInlineWrapper = document.getElementById("usecsv-importer-inline-wrapper");
702
702
  var usecsvContainerStyles = importerDisplay === "modal" || !usecsvInlineWrapper
703
703
  ? ".usecsv_container { position: fixed; top: 0px; bottom: 0; right: 0; left: 0; z-index: 100000; }"
@@ -706,6 +706,9 @@ var insertIframe = function (id, importerDisplay) {
706
706
  document.body.insertAdjacentHTML("beforeend", "<div id=".concat(id, " class=\"usecsv_container loading\"></div>"));
707
707
  var iframe = document.createElement("iframe");
708
708
  iframe.setAttribute("src", MOUNT_URL);
709
+ if (iframeId) {
710
+ iframe.setAttribute("id", iframeId);
711
+ }
709
712
  var usecsvContainer = document.getElementById(id);
710
713
  usecsvContainer === null || usecsvContainer === void 0 ? void 0 : usecsvContainer.appendChild(iframe);
711
714
  if (importerDisplay === "inline" && usecsvInlineWrapper) {
@@ -715,10 +718,10 @@ var insertIframe = function (id, importerDisplay) {
715
718
  return iframe;
716
719
  };
717
720
  var useCsvPlugin = function (_a) {
718
- 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, onClose = _a.onClose, theme = _a.theme, batchSize = _a.batchSize, sampleFileURL = _a.sampleFileURL, downloadExampleButton = _a.downloadExampleButton, dynamicColumns = _a.dynamicColumns, defaultLanguage = _a.defaultLanguage, onError = _a.onError, customText = _a.customText, acceptedFileFormats = _a.acceptedFileFormats, onFileUpload = _a.onFileUpload, columnWidth = _a.columnWidth, onMatchColumns = _a.onMatchColumns;
721
+ 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, onClose = _a.onClose, theme = _a.theme, batchSize = _a.batchSize, sampleFileURL = _a.sampleFileURL, downloadExampleButton = _a.downloadExampleButton, dynamicColumns = _a.dynamicColumns, defaultLanguage = _a.defaultLanguage, onError = _a.onError, customText = _a.customText, acceptedFileFormats = _a.acceptedFileFormats, onFileUpload = _a.onFileUpload, columnWidth = _a.columnWidth, onMatchColumns = _a.onMatchColumns, iframeId = _a.iframeId;
719
722
  var id = "usecsv-".concat(Math.round(Math.random() * 100000000));
720
723
  return whenDomReady().then(function () {
721
- var iframe = insertIframe(id, importerDisplay);
724
+ var iframe = insertIframe(id, importerDisplay, iframeId);
722
725
  var closeIframe = function () {
723
726
  var _a;
724
727
  (_a = document.getElementById(id)) === null || _a === void 0 ? void 0 : _a.remove();