@zzdadelu/schema-builder 1.0.0-alpha.69 → 1.0.0-alpha.70

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,14 +1,15 @@
1
- // 修改 createIframe.ts
2
- var createIframeContent = function createIframeContent() {
3
- var timestamp = new Date().getTime();
4
- var html = "\n <html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css?t=".concat(timestamp, "\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css?t=").concat(timestamp, "\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css?t=").concat(timestamp, "\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css?t=").concat(timestamp, "\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css?t=").concat(timestamp, "\" />\n\n <script>\n // \u5173\u952E\u4FEE\u590D\uFF1A\u5728 iframe \u52A0\u8F7D\u65F6\uFF0C\u66FF\u6362 polling \u65B9\u6CD5\u4E2D\u7684 document \u5F15\u7528\n (function() {\n // \u4FDD\u5B58\u539F\u59CB\u7684 polling \u65B9\u6CD5\n var originalPolling = null;\n \n // \u5728 iframe \u4E2D\u91CD\u5199 getFormRenderMaterial \u7684\u6CE8\u5165\u903B\u8F91\n window.__fixPolling = function() {\n // \u5C1D\u8BD5\u83B7\u53D6\u5F53\u524D iframe\uFF08\u901A\u8FC7 window.frameElement\uFF09\n var currentIframe = window.frameElement;\n \n if (currentIframe) {\n // \u5982\u679C\u627E\u5230\u4E86\u5F53\u524D iframe\uFF0C\u76F4\u63A5\u8BBE\u7F6E getFormRenderMaterial\n console.log('Found current iframe via frameElement');\n window.getFormRenderMaterial = function() {\n console.log('getFormRenderMaterial called from fixed version');\n return {};\n };\n return true;\n }\n \n // \u5982\u679C window.frameElement \u4E0D\u53EF\u7528\uFF0C\u5C1D\u8BD5\u5176\u4ED6\u65B9\u6CD5\n try {\n // \u901A\u8FC7 parent.document \u67E5\u627E\n var iframes = window.parent.document.getElementsByTagName('iframe');\n for (var i = 0; i < iframes.length; i++) {\n if (iframes[i].contentWindow === window) {\n console.log('Found current iframe via parent.document');\n window.getFormRenderMaterial = function() {\n console.log('getFormRenderMaterial called from fixed version');\n return {};\n };\n return true;\n }\n }\n } catch (e) {\n console.warn('Cannot access parent document:', e);\n }\n \n return false;\n };\n \n // \u7ACB\u5373\u5C1D\u8BD5\u4FEE\u590D\n setTimeout(function() {\n if (!window.__fixPolling()) {\n console.warn('Could not fix polling immediately, will retry');\n // \u5982\u679C\u7ACB\u5373\u4FEE\u590D\u5931\u8D25\uFF0C\u8BBE\u7F6E\u4E00\u4E2A\u8F6E\u8BE2\u673A\u5236\n var retryCount = 0;\n var retryInterval = setInterval(function() {\n retryCount++;\n if (window.__fixPolling() || retryCount > 50) {\n clearInterval(retryInterval);\n if (retryCount > 50) {\n console.error('Failed to fix polling after 50 retries');\n }\n }\n }, 100);\n }\n }, 0);\n \n // \u8BBE\u7F6E\u5FC5\u8981\u7684\u5168\u5C40\u53D8\u91CF\n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n window.__is_simulator_env__ = true;\n })();\n </script>\n \n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js?t=").concat(timestamp, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js?t=").concat(timestamp, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js?t=").concat(timestamp, "\"></script>\n </head>\n\n <body>\n <div id=\"lce-container\"></div>\n <script type=\"text/javascript\" src=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/js/index.js?t=").concat(timestamp, "\"></script>\n \n <script>\n // \u5728 fr-generator \u52A0\u8F7D\u540E\uFF0C\u786E\u4FDD polling \u673A\u5236\u6B63\u5E38\u5DE5\u4F5C\n (function() {\n var originalLoad = window.__FR_ENGINE__ && window.__FR_ENGINE__.load;\n if (originalLoad) {\n window.__FR_ENGINE__.load = function() {\n console.log('Fixed load method called');\n // \u786E\u4FDD\u5728\u53D1\u9001 engine-load \u6D88\u606F\u524D\uFF0Cpolling \u5DF2\u7ECF\u5B8C\u6210\n setTimeout(function() {\n if (originalLoad) {\n originalLoad.apply(this, arguments);\n }\n window.parent.postMessage({type: \"engine-load\"}, \"*\");\n }, 100);\n };\n }\n })();\n </script>\n </body>\n </html>\n ");
5
- return html;
6
- };
7
- export default (function () {
1
+ // 创建一个新的 iframe 加载器:iframeLoaderEnhanced.ts
2
+ export var createFixedIframe = function createFixedIframe(widgets) {
8
3
  var iframe = document.createElement('iframe');
9
4
  iframe.width = '100%';
10
5
  iframe.height = '100%';
11
6
  iframe.frameBorder = '0';
12
- iframe.srcdoc = createIframeContent();
7
+ var timestamp = Date.now();
8
+ var cacheBuster = "?t=".concat(timestamp);
9
+
10
+ // 将 widgets 转换为 JSON 字符串用于注入
11
+ var widgetsJson = JSON.stringify(widgets || {});
12
+ var html = "<!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n \n <!-- \u6837\u5F0F -->\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css".concat(cacheBuster, "\" rel=\"stylesheet\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css").concat(cacheBuster, "\" rel=\"stylesheet\">\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css").concat(cacheBuster, "\">\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css").concat(cacheBuster, "\">\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css").concat(cacheBuster, "\">\n \n <script>\n // \u6838\u5FC3\u4FEE\u590D\uFF1A\u5B8C\u5168\u63A5\u7BA1 polling \u673A\u5236\n (function() {\n // \u5B58\u50A8\u539F\u59CB\u7684 polling \u65B9\u6CD5\n var originalPolling = null;\n \n // \u5B9A\u4E49\u6211\u4EEC\u81EA\u5DF1\u7684 polling \u5B9E\u73B0\n var fixedPolling = function(t) {\n console.log('Fixed polling called with data:', t ? 'has data' : 'no data');\n \n // \u76F4\u63A5\u8BBE\u7F6E getFormRenderMaterial\uFF0C\u4E0D\u4F9D\u8D56\u4E8E\u67E5\u627E iframe\n window.getFormRenderMaterial = function() {\n console.log('Fixed getFormRenderMaterial called');\n // \u8FD4\u56DE\u5B9E\u9645\u7684 widgets \u6570\u636E\n var widgetsData = window.__WIDGETS_DATA__ || t || {};\n return Object.assign({__esModule: true}, widgetsData, {});\n };\n \n // \u786E\u4FDD\u65B9\u6CD5\u5DF2\u8BBE\u7F6E\n console.log('getFormRenderMaterial set:', !!window.getFormRenderMaterial);\n \n // \u5982\u679C\u6709\u539F\u59CB polling\uFF0C\u4E5F\u8C03\u7528\u5B83\uFF08\u5982\u679C\u5B83\u5B58\u5728\uFF09\n if (originalPolling) {\n try {\n originalPolling.call(this, t);\n } catch(e) {\n console.error('Original polling failed:', e);\n }\n }\n \n // \u6807\u8BB0 polling \u5B8C\u6210\n window.__POLLING_COMPLETE__ = true;\n };\n \n // \u62E6\u622A fr-generator \u7684 polling \u65B9\u6CD5\n var interceptPolling = function() {\n if (window.__FR_ENGINE__ && typeof window.__FR_ENGINE__.polling === 'function') {\n originalPolling = window.__FR_ENGINE__.polling;\n window.__FR_ENGINE__.polling = fixedPolling;\n console.log('Successfully intercepted polling method');\n return true;\n }\n return false;\n };\n \n // \u7ACB\u5373\u5C1D\u8BD5\u62E6\u622A\n if (!interceptPolling()) {\n // \u5982\u679C fr-generator \u8FD8\u6CA1\u52A0\u8F7D\uFF0C\u8BBE\u7F6E\u4E00\u4E2A\u76D1\u542C\u5668\n var checkInterval = setInterval(function() {\n if (interceptPolling()) {\n clearInterval(checkInterval);\n console.log('Polling interception complete');\n }\n }, 100);\n \n // \u6700\u591A\u68C0\u67E5 5 \u79D2\n setTimeout(function() {\n clearInterval(checkInterval);\n }, 5000);\n }\n \n // \u6CE8\u5165 widgets \u6570\u636E\n window.__WIDGETS_DATA__ = ").concat(widgetsJson, ";\n \n // \u8BBE\u7F6E\u5176\u4ED6\u5FC5\u8981\u7684\u5168\u5C40\u53D8\u91CF\n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n window.__is_simulator_env__ = true;\n window.PropTypes = window.parent.PropTypes;\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n \n // \u9884\u5B9A\u4E49 getFormRenderMaterial \u4F5C\u4E3A\u540E\u5907\n window.getFormRenderMaterial = window.getFormRenderMaterial || function() {\n console.log('Fallback getFormRenderMaterial called');\n return Object.assign({__esModule: true}, window.__WIDGETS_DATA__ || {});\n };\n })();\n </script>\n </head>\n <body>\n <div id=\"lce-container\"></div>\n \n <!-- \u52A0\u8F7D\u6240\u6709\u811A\u672C -->\n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js").concat(cacheBuster, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js").concat(cacheBuster, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js").concat(cacheBuster, "\"></script>\n <script type=\"text/javascript\" src=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/js/index.js").concat(cacheBuster, "\"></script>\n \n <script>\n // \u786E\u4FDD\u5728 iframe \u52A0\u8F7D\u5B8C\u6210\u540E\u901A\u77E5\u7236\u7A97\u53E3\n window.addEventListener('load', function() {\n console.log('iframe fully loaded, polling status:', window.__POLLING_COMPLETE__);\n \n // \u518D\u6B21\u786E\u4FDD getFormRenderMaterial \u5B58\u5728\n if (!window.getFormRenderMaterial) {\n console.warn('getFormRenderMaterial still missing, setting emergency fallback');\n window.getFormRenderMaterial = function() {\n return {};\n };\n }\n \n // \u901A\u77E5\u7236\u7A97\u53E3 iframe \u5DF2\u51C6\u5907\u5C31\u7EEA\n setTimeout(function() {\n window.parent.postMessage({ type: 'iframe-ready' }, '*');\n window.parent.postMessage({ type: 'engine-load' }, '*');\n }, 300);\n });\n </script>\n </body>\n </html>");
13
+ iframe.srcdoc = html;
13
14
  return iframe;
14
- });
15
+ };
package/es/main.js CHANGED
@@ -8,8 +8,8 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
8
8
  function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
9
  function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
10
10
  import React, { useEffect, useRef, useImperativeHandle, forwardRef } from 'react';
11
- import createIframe from './createIframe';
12
11
  import * as defaultSetting from './settings';
12
+ import { createFixedIframe } from './createIframe';
13
13
  var iframe;
14
14
  var Design = function Design(props, ref) {
15
15
  var widgets = props.widgets,
@@ -36,7 +36,7 @@ var Design = function Design(props, ref) {
36
36
  };
37
37
  }, []);
38
38
  var initIframe = function initIframe() {
39
- iframe = createIframe();
39
+ iframe = createFixedIframe;
40
40
  containerRef.current.appendChild(iframe);
41
41
  };
42
42
  var engineOnLoad = function engineOnLoad(event) {
@@ -3,18 +3,19 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.default = void 0;
7
- // 修改 createIframe.ts
8
- var createIframeContent = function createIframeContent() {
9
- var timestamp = new Date().getTime();
10
- var html = "\n <html>\n <head>\n <meta charset=\"UTF-8\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\" />\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css?t=".concat(timestamp, "\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css?t=").concat(timestamp, "\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css?t=").concat(timestamp, "\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css?t=").concat(timestamp, "\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css?t=").concat(timestamp, "\" />\n\n <script>\n // \u5173\u952E\u4FEE\u590D\uFF1A\u5728 iframe \u52A0\u8F7D\u65F6\uFF0C\u66FF\u6362 polling \u65B9\u6CD5\u4E2D\u7684 document \u5F15\u7528\n (function() {\n // \u4FDD\u5B58\u539F\u59CB\u7684 polling \u65B9\u6CD5\n var originalPolling = null;\n \n // \u5728 iframe \u4E2D\u91CD\u5199 getFormRenderMaterial \u7684\u6CE8\u5165\u903B\u8F91\n window.__fixPolling = function() {\n // \u5C1D\u8BD5\u83B7\u53D6\u5F53\u524D iframe\uFF08\u901A\u8FC7 window.frameElement\uFF09\n var currentIframe = window.frameElement;\n \n if (currentIframe) {\n // \u5982\u679C\u627E\u5230\u4E86\u5F53\u524D iframe\uFF0C\u76F4\u63A5\u8BBE\u7F6E getFormRenderMaterial\n console.log('Found current iframe via frameElement');\n window.getFormRenderMaterial = function() {\n console.log('getFormRenderMaterial called from fixed version');\n return {};\n };\n return true;\n }\n \n // \u5982\u679C window.frameElement \u4E0D\u53EF\u7528\uFF0C\u5C1D\u8BD5\u5176\u4ED6\u65B9\u6CD5\n try {\n // \u901A\u8FC7 parent.document \u67E5\u627E\n var iframes = window.parent.document.getElementsByTagName('iframe');\n for (var i = 0; i < iframes.length; i++) {\n if (iframes[i].contentWindow === window) {\n console.log('Found current iframe via parent.document');\n window.getFormRenderMaterial = function() {\n console.log('getFormRenderMaterial called from fixed version');\n return {};\n };\n return true;\n }\n }\n } catch (e) {\n console.warn('Cannot access parent document:', e);\n }\n \n return false;\n };\n \n // \u7ACB\u5373\u5C1D\u8BD5\u4FEE\u590D\n setTimeout(function() {\n if (!window.__fixPolling()) {\n console.warn('Could not fix polling immediately, will retry');\n // \u5982\u679C\u7ACB\u5373\u4FEE\u590D\u5931\u8D25\uFF0C\u8BBE\u7F6E\u4E00\u4E2A\u8F6E\u8BE2\u673A\u5236\n var retryCount = 0;\n var retryInterval = setInterval(function() {\n retryCount++;\n if (window.__fixPolling() || retryCount > 50) {\n clearInterval(retryInterval);\n if (retryCount > 50) {\n console.error('Failed to fix polling after 50 retries');\n }\n }\n }, 100);\n }\n }, 0);\n \n // \u8BBE\u7F6E\u5FC5\u8981\u7684\u5168\u5C40\u53D8\u91CF\n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n window.__is_simulator_env__ = true;\n })();\n </script>\n \n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js?t=").concat(timestamp, "\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js?t=").concat(timestamp, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js?t=").concat(timestamp, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js?t=").concat(timestamp, "\"></script>\n </head>\n\n <body>\n <div id=\"lce-container\"></div>\n <script type=\"text/javascript\" src=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/js/index.js?t=").concat(timestamp, "\"></script>\n \n <script>\n // \u5728 fr-generator \u52A0\u8F7D\u540E\uFF0C\u786E\u4FDD polling \u673A\u5236\u6B63\u5E38\u5DE5\u4F5C\n (function() {\n var originalLoad = window.__FR_ENGINE__ && window.__FR_ENGINE__.load;\n if (originalLoad) {\n window.__FR_ENGINE__.load = function() {\n console.log('Fixed load method called');\n // \u786E\u4FDD\u5728\u53D1\u9001 engine-load \u6D88\u606F\u524D\uFF0Cpolling \u5DF2\u7ECF\u5B8C\u6210\n setTimeout(function() {\n if (originalLoad) {\n originalLoad.apply(this, arguments);\n }\n window.parent.postMessage({type: \"engine-load\"}, \"*\");\n }, 100);\n };\n }\n })();\n </script>\n </body>\n </html>\n ");
11
- return html;
12
- };
13
- var _default = exports.default = function _default() {
6
+ exports.createFixedIframe = void 0;
7
+ // 创建一个新的 iframe 加载器:iframeLoaderEnhanced.ts
8
+ var createFixedIframe = exports.createFixedIframe = function createFixedIframe(widgets) {
14
9
  var iframe = document.createElement('iframe');
15
10
  iframe.width = '100%';
16
11
  iframe.height = '100%';
17
12
  iframe.frameBorder = '0';
18
- iframe.srcdoc = createIframeContent();
13
+ var timestamp = Date.now();
14
+ var cacheBuster = "?t=".concat(timestamp);
15
+
16
+ // 将 widgets 转换为 JSON 字符串用于注入
17
+ var widgetsJson = JSON.stringify(widgets || {});
18
+ var html = "<!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>XRender</title>\n <link rel=\"icon\" href=\"https://img.alicdn.com/tfs/TB17UtINiLaK1RjSZFxXXamPFXa-606-643.png\">\n \n <!-- \u6837\u5F0F -->\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css".concat(cacheBuster, "\" rel=\"stylesheet\">\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css").concat(cacheBuster, "\" rel=\"stylesheet\">\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css").concat(cacheBuster, "\">\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css").concat(cacheBuster, "\">\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css").concat(cacheBuster, "\">\n \n <script>\n // \u6838\u5FC3\u4FEE\u590D\uFF1A\u5B8C\u5168\u63A5\u7BA1 polling \u673A\u5236\n (function() {\n // \u5B58\u50A8\u539F\u59CB\u7684 polling \u65B9\u6CD5\n var originalPolling = null;\n \n // \u5B9A\u4E49\u6211\u4EEC\u81EA\u5DF1\u7684 polling \u5B9E\u73B0\n var fixedPolling = function(t) {\n console.log('Fixed polling called with data:', t ? 'has data' : 'no data');\n \n // \u76F4\u63A5\u8BBE\u7F6E getFormRenderMaterial\uFF0C\u4E0D\u4F9D\u8D56\u4E8E\u67E5\u627E iframe\n window.getFormRenderMaterial = function() {\n console.log('Fixed getFormRenderMaterial called');\n // \u8FD4\u56DE\u5B9E\u9645\u7684 widgets \u6570\u636E\n var widgetsData = window.__WIDGETS_DATA__ || t || {};\n return Object.assign({__esModule: true}, widgetsData, {});\n };\n \n // \u786E\u4FDD\u65B9\u6CD5\u5DF2\u8BBE\u7F6E\n console.log('getFormRenderMaterial set:', !!window.getFormRenderMaterial);\n \n // \u5982\u679C\u6709\u539F\u59CB polling\uFF0C\u4E5F\u8C03\u7528\u5B83\uFF08\u5982\u679C\u5B83\u5B58\u5728\uFF09\n if (originalPolling) {\n try {\n originalPolling.call(this, t);\n } catch(e) {\n console.error('Original polling failed:', e);\n }\n }\n \n // \u6807\u8BB0 polling \u5B8C\u6210\n window.__POLLING_COMPLETE__ = true;\n };\n \n // \u62E6\u622A fr-generator \u7684 polling \u65B9\u6CD5\n var interceptPolling = function() {\n if (window.__FR_ENGINE__ && typeof window.__FR_ENGINE__.polling === 'function') {\n originalPolling = window.__FR_ENGINE__.polling;\n window.__FR_ENGINE__.polling = fixedPolling;\n console.log('Successfully intercepted polling method');\n return true;\n }\n return false;\n };\n \n // \u7ACB\u5373\u5C1D\u8BD5\u62E6\u622A\n if (!interceptPolling()) {\n // \u5982\u679C fr-generator \u8FD8\u6CA1\u52A0\u8F7D\uFF0C\u8BBE\u7F6E\u4E00\u4E2A\u76D1\u542C\u5668\n var checkInterval = setInterval(function() {\n if (interceptPolling()) {\n clearInterval(checkInterval);\n console.log('Polling interception complete');\n }\n }, 100);\n \n // \u6700\u591A\u68C0\u67E5 5 \u79D2\n setTimeout(function() {\n clearInterval(checkInterval);\n }, 5000);\n }\n \n // \u6CE8\u5165 widgets \u6570\u636E\n window.__WIDGETS_DATA__ = ").concat(widgetsJson, ";\n \n // \u8BBE\u7F6E\u5176\u4ED6\u5FC5\u8981\u7684\u5168\u5C40\u53D8\u91CF\n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n window.__is_simulator_env__ = true;\n window.PropTypes = window.parent.PropTypes;\n window.__REACT_DEVTOOLS_GLOBAL_HOOK__ = window.parent.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n \n // \u9884\u5B9A\u4E49 getFormRenderMaterial \u4F5C\u4E3A\u540E\u5907\n window.getFormRenderMaterial = window.getFormRenderMaterial || function() {\n console.log('Fallback getFormRenderMaterial called');\n return Object.assign({__esModule: true}, window.__WIDGETS_DATA__ || {});\n };\n })();\n </script>\n </head>\n <body>\n <div id=\"lce-container\"></div>\n \n <!-- \u52A0\u8F7D\u6240\u6709\u811A\u672C -->\n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js").concat(cacheBuster, "\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js").concat(cacheBuster, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js").concat(cacheBuster, "\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js").concat(cacheBuster, "\"></script>\n <script type=\"text/javascript\" src=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/js/index.js").concat(cacheBuster, "\"></script>\n \n <script>\n // \u786E\u4FDD\u5728 iframe \u52A0\u8F7D\u5B8C\u6210\u540E\u901A\u77E5\u7236\u7A97\u53E3\n window.addEventListener('load', function() {\n console.log('iframe fully loaded, polling status:', window.__POLLING_COMPLETE__);\n \n // \u518D\u6B21\u786E\u4FDD getFormRenderMaterial \u5B58\u5728\n if (!window.getFormRenderMaterial) {\n console.warn('getFormRenderMaterial still missing, setting emergency fallback');\n window.getFormRenderMaterial = function() {\n return {};\n };\n }\n \n // \u901A\u77E5\u7236\u7A97\u53E3 iframe \u5DF2\u51C6\u5907\u5C31\u7EEA\n setTimeout(function() {\n window.parent.postMessage({ type: 'iframe-ready' }, '*');\n window.parent.postMessage({ type: 'engine-load' }, '*');\n }, 300);\n });\n </script>\n </body>\n </html>");
19
+ iframe.srcdoc = html;
19
20
  return iframe;
20
21
  };
package/lib/main.js CHANGED
@@ -6,10 +6,9 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
- var _createIframe = _interopRequireDefault(require("./createIframe"));
10
9
  var defaultSetting = _interopRequireWildcard(require("./settings"));
10
+ var _createIframe = require("./createIframe");
11
11
  var _excluded = ["widgets", "settings"];
12
- function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
13
12
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
14
13
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
15
14
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -44,7 +43,7 @@ var Design = function Design(props, ref) {
44
43
  };
45
44
  }, []);
46
45
  var initIframe = function initIframe() {
47
- iframe = (0, _createIframe.default)();
46
+ iframe = _createIframe.createFixedIframe;
48
47
  containerRef.current.appendChild(iframe);
49
48
  };
50
49
  var engineOnLoad = function engineOnLoad(event) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zzdadelu/schema-builder",
3
- "version": "1.0.0-alpha.69",
3
+ "version": "1.0.0-alpha.70",
4
4
  "description": "通过 JSON Schema 生成标准 Form,常用于自定义搭建配置界面生成",
5
5
  "keywords": [
6
6
  "Form",