@zzdadelu/schema-builder 1.0.0-alpha.68 → 1.0.0-alpha.69
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/es/createIframe.js +2 -1
- package/lib/createIframe.js +2 -1
- package/package.json +1 -1
package/es/createIframe.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
// 修改 createIframe.ts
|
|
1
2
|
var createIframeContent = function createIframeContent() {
|
|
2
3
|
var timestamp = new Date().getTime();
|
|
3
|
-
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
|
|
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 ");
|
|
4
5
|
return html;
|
|
5
6
|
};
|
|
6
7
|
export default (function () {
|
package/lib/createIframe.js
CHANGED
|
@@ -4,9 +4,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
+
// 修改 createIframe.ts
|
|
7
8
|
var createIframeContent = function createIframeContent() {
|
|
8
9
|
var timestamp = new Date().getTime();
|
|
9
|
-
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
|
|
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 ");
|
|
10
11
|
return html;
|
|
11
12
|
};
|
|
12
13
|
var _default = exports.default = function _default() {
|