@zzdadelu/schema-builder 1.0.0-alpha.118 → 1.0.0-alpha.119
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 +1 -1
- package/lib/createIframe.js +1 -1
- package/package.json +1 -1
package/es/createIframe.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// createIframe.ts
|
|
2
2
|
var createIframeContent = function createIframeContent() {
|
|
3
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\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css\" />\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\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css\" />\n \n <script>\n // \u5728 iframe \u4E2D\u6CE8\u518C Service Worker\n if ('serviceWorker' in navigator) {\n // \u521B\u5EFA Service Worker \u4EE3\u7801\n const swCode = `\n self.addEventListener('install', (event) => {\n self.skipWaiting();\n });\n \n self.addEventListener('activate', (event) => {\n event.waitUntil(clients.claim());\n });\n \n self.addEventListener('fetch', (event) => {\n const url = event.request.url;\n \n // \u62E6\u622A fr-generator \u76F8\u5173\u7684\u811A\u672C\u8BF7\u6C42\n const resourcesToIntercept = [\n 'react-simulator-renderer',\n 'moment.min.js',\n 'lodash.min.js',\n 'antd.min.js',\n 'next.min.js',\n 'index.umd.min.js',\n 'ant-design-icons-cdn',\n 'lowcode-react-simulator-renderer'\n ];\n \n const shouldIntercept = resourcesToIntercept.some(resource => \n url.includes(resource)\n );\n \n if (shouldIntercept) {\n console.log('Service Worker \u62E6\u622A\u8BF7\u6C42:', url);\n \n // \u6DFB\u52A0\u65F6\u95F4\u6233\n let modifiedUrl = url;\n if (!url.includes('t=')) {\n const separator = url.includes('?') ? '&' : '?';\n modifiedUrl = url + separator + 't=' + Date.now();\n }\n \n // \u521B\u5EFA\u65B0\u8BF7\u6C42\n const modifiedRequest = new Request(modifiedUrl, event.request);\n event.respondWith(fetch(modifiedRequest));\n }\n });\n `;\n \n const blob = new Blob([swCode], { type: 'application/javascript' });\n const swUrl = URL.createObjectURL(blob);\n \n navigator.serviceWorker.register(swUrl, {\n scope: './'\n }).then(registration => {\n console.log('Service Worker \u6CE8\u518C\u6210\u529F');\n }).catch(error => {\n console.error('Service Worker \u6CE8\u518C\u5931\u8D25:', error);\n });\n }\n \n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n </script>\n </head>\n\n <body>\n <div id=\"lce-container\"></div>\n \n <!-- \u52A0\u8F7D\u57FA\u7840\u5E93 -->\n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js\"></script>\n \n <!-- \u6700\u540E\u52A0\u8F7D fr-generator\uFF0C\u5B83\u4F1A\u88AB\u6211\u4EEC\u7684\u62E6\u622A\u5668\u76D1\u63A7 -->\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 </body>\n </html>\n ");
|
|
5
5
|
return html;
|
|
6
6
|
};
|
|
7
7
|
export default (function () {
|
package/lib/createIframe.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
// createIframe.ts
|
|
8
8
|
var createIframeContent = function createIframeContent() {
|
|
9
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\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css\" />\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\" rel=\"stylesheet\" />\n <link href=\"https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css\" rel=\"stylesheet\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/css/engine-core.css\" />\n <link rel=\"stylesheet\" href=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/css/engine-ext.css\" />\n <link rel=\"stylesheet\" href=\"https://g.alicdn.com/fone-lowcode/fr-generator/1.1.0/css/index.css\" />\n \n <script>\n // \u5728 iframe \u4E2D\u6CE8\u518C Service Worker\n if ('serviceWorker' in navigator) {\n // \u521B\u5EFA Service Worker \u4EE3\u7801\n const swCode = `\n self.addEventListener('install', (event) => {\n self.skipWaiting();\n });\n \n self.addEventListener('activate', (event) => {\n event.waitUntil(clients.claim());\n });\n \n self.addEventListener('fetch', (event) => {\n const url = event.request.url;\n \n // \u62E6\u622A fr-generator \u76F8\u5173\u7684\u811A\u672C\u8BF7\u6C42\n const resourcesToIntercept = [\n 'react-simulator-renderer',\n 'moment.min.js',\n 'lodash.min.js',\n 'antd.min.js',\n 'next.min.js',\n 'index.umd.min.js',\n 'ant-design-icons-cdn',\n 'lowcode-react-simulator-renderer'\n ];\n \n const shouldIntercept = resourcesToIntercept.some(resource => \n url.includes(resource)\n );\n \n if (shouldIntercept) {\n console.log('Service Worker \u62E6\u622A\u8BF7\u6C42:', url);\n \n // \u6DFB\u52A0\u65F6\u95F4\u6233\n let modifiedUrl = url;\n if (!url.includes('t=')) {\n const separator = url.includes('?') ? '&' : '?';\n modifiedUrl = url + separator + 't=' + Date.now();\n }\n \n // \u521B\u5EFA\u65B0\u8BF7\u6C42\n const modifiedRequest = new Request(modifiedUrl, event.request);\n event.respondWith(fetch(modifiedRequest));\n }\n });\n `;\n \n const blob = new Blob([swCode], { type: 'application/javascript' });\n const swUrl = URL.createObjectURL(blob);\n \n navigator.serviceWorker.register(swUrl, {\n scope: './'\n }).then(registration => {\n console.log('Service Worker \u6CE8\u518C\u6210\u529F');\n }).catch(error => {\n console.error('Service Worker \u6CE8\u518C\u5931\u8D25:', error);\n });\n }\n \n window.React = window.parent.React;\n window.ReactDOM = window.parent.ReactDOM;\n </script>\n </head>\n\n <body>\n <div id=\"lce-container\"></div>\n \n <!-- \u52A0\u8F7D\u57FA\u7840\u5E93 -->\n <script src=\"https://g.alicdn.com/code/lib/prop-types/15.7.2/prop-types.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/react15-polyfill/0.0.1/dist/index.js\"></script>\n <script src=\"https://g.alicdn.com/platform/c/lodash/4.6.1/lodash.min.js\"></script>\n <script src=\"https://g.alicdn.com/mylib/moment/2.24.0/min/moment.min.js\"></script>\n <script src=\"https://g.alicdn.com/code/lib/alifd__next/1.23.24/next.min.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.2.3/dist/js/engine-core.js\"></script>\n <script crossorigin=\"anonymous\" src=\"https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6/dist/js/engine-ext.js\"></script>\n \n <!-- \u6700\u540E\u52A0\u8F7D fr-generator\uFF0C\u5B83\u4F1A\u88AB\u6211\u4EEC\u7684\u62E6\u622A\u5668\u76D1\u63A7 -->\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 </body>\n </html>\n ");
|
|
11
11
|
return html;
|
|
12
12
|
};
|
|
13
13
|
var _default = exports.default = function _default() {
|