@zzdadelu/schema-builder 1.0.0-alpha.127 → 1.0.0-alpha.128

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/dist/index.js CHANGED
@@ -4136,21 +4136,21 @@
4136
4136
  });
4137
4137
 
4138
4138
  var _excluded = ["widgets", "settings"];
4139
- var iframe;
4140
4139
  var Design = function Design(props, ref) {
4141
4140
  var widgets = props.widgets,
4142
4141
  settings = props.settings,
4143
4142
  restProps = _objectWithoutProperties(props, _excluded);
4144
4143
  var containerRef = React.useRef();
4144
+ var iframeRef = React.useRef(null);
4145
4145
  React.useImperativeHandle(ref, function () {
4146
4146
  return {
4147
4147
  getValue: function getValue() {
4148
- var _iframe, _iframe$contentWindow, _iframe$contentWindow2, _iframe$contentWindow3;
4149
- return (_iframe = iframe) === null || _iframe === void 0 ? void 0 : (_iframe$contentWindow = _iframe.contentWindow) === null || _iframe$contentWindow === void 0 ? void 0 : (_iframe$contentWindow2 = _iframe$contentWindow.__FR_ENGINE__) === null || _iframe$contentWindow2 === void 0 ? void 0 : (_iframe$contentWindow3 = _iframe$contentWindow2.exportSchema) === null || _iframe$contentWindow3 === void 0 ? void 0 : _iframe$contentWindow3.call(_iframe$contentWindow2);
4148
+ var _iframeRef$current, _iframeRef$current$co, _iframeRef$current$co2, _iframeRef$current$co3;
4149
+ return (_iframeRef$current = iframeRef.current) === null || _iframeRef$current === void 0 ? void 0 : (_iframeRef$current$co = _iframeRef$current.contentWindow) === null || _iframeRef$current$co === void 0 ? void 0 : (_iframeRef$current$co2 = _iframeRef$current$co.__FR_ENGINE__) === null || _iframeRef$current$co2 === void 0 ? void 0 : (_iframeRef$current$co3 = _iframeRef$current$co2.exportSchema) === null || _iframeRef$current$co3 === void 0 ? void 0 : _iframeRef$current$co3.call(_iframeRef$current$co2);
4150
4150
  },
4151
4151
  setValue: function setValue(schema) {
4152
- var _iframe2, _iframe2$contentWindo, _iframe2$contentWindo2, _iframe2$contentWindo3;
4153
- return (_iframe2 = iframe) === null || _iframe2 === void 0 ? void 0 : (_iframe2$contentWindo = _iframe2.contentWindow) === null || _iframe2$contentWindo === void 0 ? void 0 : (_iframe2$contentWindo2 = _iframe2$contentWindo.__FR_ENGINE__) === null || _iframe2$contentWindo2 === void 0 ? void 0 : (_iframe2$contentWindo3 = _iframe2$contentWindo2.importSchema) === null || _iframe2$contentWindo3 === void 0 ? void 0 : _iframe2$contentWindo3.call(_iframe2$contentWindo2, schema);
4152
+ var _iframeRef$current2, _iframeRef$current2$c, _iframeRef$current2$c2, _iframeRef$current2$c3;
4153
+ return (_iframeRef$current2 = iframeRef.current) === null || _iframeRef$current2 === void 0 ? void 0 : (_iframeRef$current2$c = _iframeRef$current2.contentWindow) === null || _iframeRef$current2$c === void 0 ? void 0 : (_iframeRef$current2$c2 = _iframeRef$current2$c.__FR_ENGINE__) === null || _iframeRef$current2$c2 === void 0 ? void 0 : (_iframeRef$current2$c3 = _iframeRef$current2$c2.importSchema) === null || _iframeRef$current2$c3 === void 0 ? void 0 : _iframeRef$current2$c3.call(_iframeRef$current2$c2, schema);
4154
4154
  }
4155
4155
  };
4156
4156
  });
@@ -4162,15 +4162,16 @@
4162
4162
  };
4163
4163
  }, []);
4164
4164
  var initIframe = function initIframe() {
4165
- iframe = createIframe();
4165
+ var iframe = createIframe();
4166
+ iframeRef.current = iframe;
4166
4167
  containerRef.current.appendChild(iframe);
4167
4168
  };
4168
4169
  var engineOnLoad = function engineOnLoad(event) {
4169
- var _iframe3, _iframe3$contentWindo, _iframe3$contentWindo2;
4170
+ var _iframeRef$current3, _iframeRef$current3$c, _iframeRef$current3$c2;
4170
4171
  if (event.data.type !== 'engine-load') {
4171
4172
  return;
4172
4173
  }
4173
- (_iframe3 = iframe) === null || _iframe3 === void 0 ? void 0 : (_iframe3$contentWindo = _iframe3.contentWindow) === null || _iframe3$contentWindo === void 0 ? void 0 : (_iframe3$contentWindo2 = _iframe3$contentWindo.__FR_ENGINE__) === null || _iframe3$contentWindo2 === void 0 ? void 0 : _iframe3$contentWindo2.init(_objectSpread2({
4174
+ (_iframeRef$current3 = iframeRef.current) === null || _iframeRef$current3 === void 0 ? void 0 : (_iframeRef$current3$c = _iframeRef$current3.contentWindow) === null || _iframeRef$current3$c === void 0 ? void 0 : (_iframeRef$current3$c2 = _iframeRef$current3$c.__FR_ENGINE__) === null || _iframeRef$current3$c2 === void 0 ? void 0 : _iframeRef$current3$c2.init(_objectSpread2({
4174
4175
  settings: _objectSpread2(_objectSpread2({}, defaultSetting), settings),
4175
4176
  widgets: widgets,
4176
4177
  // recordEnable: true,