@nocobase/app 2.1.0-alpha.10 → 2.1.0-alpha.11

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.
Files changed (131) hide show
  1. package/client/.umirc.ts +2 -2
  2. package/client/index.html +14 -0
  3. package/client/rsbuild.config.ts +261 -0
  4. package/{client-v2/src/routes/AppInfoDemoRoute.tsx → client/src/main.tsx} +2 -4
  5. package/client-v2/index.html +3 -17
  6. package/client-v2/public/browser-checker.js +186 -0
  7. package/client-v2/public/favicon/favicon.ico +0 -0
  8. package/client-v2/public/file-placeholder/ai-200-200.png +0 -0
  9. package/client-v2/public/file-placeholder/audio-200-200.png +0 -0
  10. package/client-v2/public/file-placeholder/docx-200-200.png +0 -0
  11. package/client-v2/public/file-placeholder/eps-200-200.png +0 -0
  12. package/client-v2/public/file-placeholder/gif-200-200.png +0 -0
  13. package/client-v2/public/file-placeholder/jpeg-200-200.png +0 -0
  14. package/client-v2/public/file-placeholder/pdf-200-200.png +0 -0
  15. package/client-v2/public/file-placeholder/png-200-200.png +0 -0
  16. package/client-v2/public/file-placeholder/pptx-200-200.png +0 -0
  17. package/client-v2/public/file-placeholder/psd-200-200.png +0 -0
  18. package/client-v2/public/file-placeholder/svg-200-200.png +0 -0
  19. package/client-v2/public/file-placeholder/unknown-200-200.png +0 -0
  20. package/client-v2/public/file-placeholder/video-200-200.png +0 -0
  21. package/client-v2/public/file-placeholder/xlsx-200-200.png +0 -0
  22. package/client-v2/public/file-placeholder/zip-200-200.png +0 -0
  23. package/client-v2/public/global.css +63 -0
  24. package/client-v2/public/nocobase.png +0 -0
  25. package/client-v2/public/robots.txt +2 -0
  26. package/client-v2/rsbuild.config.ts +85 -23
  27. package/client-v2/src/.plugins/index.ts +4 -0
  28. package/client-v2/src/main.tsx +3 -3
  29. package/dist/client/{1708.645e826c.async.js → 600.1751a15d.async.js} +23 -23
  30. package/dist/client/index.html +1 -1
  31. package/dist/client/index.html.tpl +1 -1
  32. package/dist/client/p__index.482f66b1.async.js +2752 -0
  33. package/dist/client/umi.96c93a47.js +63 -0
  34. package/dist/client/v2/assets/{1310-fbaee3cb.js → 1310-21e5c8a8.js} +1 -1
  35. package/dist/client/v2/assets/1331-9092cf22.js +1 -0
  36. package/dist/client/v2/assets/{1425-0d0cc788.js → 1425-a2b446a6.js} +1 -1
  37. package/dist/client/v2/assets/{1507-3a78eb3b.js → 1507-a673a0c0.js} +1 -1
  38. package/dist/client/v2/assets/{158-9800497f.js → 158-6a033567.js} +1 -1
  39. package/dist/client/v2/assets/{1725-6bb35fdf.js → 1725-6f5b8d53.js} +1 -1
  40. package/dist/client/v2/assets/{1786-8fd8cc53.js → 1786-8969223a.js} +2 -2
  41. package/dist/client/v2/assets/{1951-3af0a41f.js → 1951-f63bc4b3.js} +1 -1
  42. package/dist/client/v2/assets/{2017-7bc3cc87.js → 2017-b35f125d.js} +1 -1
  43. package/dist/client/v2/assets/{212-30d011b4.js → 212-59d29e60.js} +1 -1
  44. package/dist/client/v2/assets/{2335-40fc71a2.js → 2335-1d33c3cf.js} +1 -1
  45. package/dist/client/v2/assets/{2555-0744d7fe.js → 2555-dee484a1.js} +1 -1
  46. package/dist/client/v2/assets/{2702-2f40d8de.js → 2702-8d5ab2a8.js} +1 -1
  47. package/dist/client/v2/assets/2710-93d67bf0.js +36 -0
  48. package/dist/client/v2/assets/{2726-927c9cfb.js → 2726-f6cc5db9.js} +1 -1
  49. package/dist/client/v2/assets/{2861-da0bb151.js → 2861-48106fd8.js} +1 -1
  50. package/dist/client/v2/assets/{2898-cf256b0e.js → 2898-2a7d5793.js} +2 -2
  51. package/dist/client/v2/assets/{2958-e4b6ff73.js → 2958-5a85effa.js} +3 -3
  52. package/dist/client/v2/assets/{3117-54ef67b5.js → 3117-3d38bb4d.js} +1 -1
  53. package/dist/client/v2/assets/{338-3d2099ef.js → 338-2f192edd.js} +1 -1
  54. package/dist/client/v2/assets/3475-c42974e1.js +1 -0
  55. package/dist/client/v2/assets/{3660-c7fcb199.js → 3660-27f9c6c5.js} +1 -1
  56. package/dist/client/v2/assets/{3662-b25a5e70.js → 3662-135bbea1.js} +1 -1
  57. package/dist/client/v2/assets/{3690-3dd94e4c.js → 3690-4a8bdf43.js} +1 -1
  58. package/dist/client/v2/assets/{3727-da97de5f.js → 3727-b74fc29b.js} +1 -1
  59. package/dist/client/v2/assets/{3916-250bcfe2.js → 3916-ba5b43b5.js} +1 -1
  60. package/dist/client/v2/assets/{3989-f2860cc7.js → 3989-e72345bb.js} +1 -1
  61. package/dist/client/v2/assets/{4313-afee0e7e.js → 4313-9687f912.js} +1 -1
  62. package/dist/client/v2/assets/{5064-2ca0d32b.js → 5064-93d8e29e.js} +1 -1
  63. package/dist/client/v2/assets/{5501-a146926a.js → 5501-a3b5b97f.js} +1 -1
  64. package/dist/client/v2/assets/{5721-b76fecc5.js → 5721-f00ddbf2.js} +1 -1
  65. package/dist/client/v2/assets/{5759-11ca4d36.js → 5759-d5b1d946.js} +2 -2
  66. package/dist/client/v2/assets/{5761-5b4fcc0f.js → 5761-8ab1974d.js} +1 -1
  67. package/dist/client/v2/assets/6064-1517304e.js +2 -0
  68. package/dist/client/v2/assets/{9261-5b0e2178.js.LICENSE.txt → 6064-1517304e.js.LICENSE.txt} +7 -0
  69. package/dist/client/v2/assets/6269-35e90156.js +1 -0
  70. package/dist/client/v2/assets/{6437-18d1e044.js → 6437-2f91d29a.js} +1 -1
  71. package/dist/client/v2/assets/{6581-4874c6dc.js → 6581-51c928bf.js} +1 -1
  72. package/dist/client/v2/assets/{6738-06ce7af7.js → 6738-eb09fa59.js} +1 -1
  73. package/dist/client/v2/assets/{700-8f6e9747.js → 700-5f166286.js} +2 -2
  74. package/dist/client/v2/assets/{7021-32b49ced.js → 7021-01608dc5.js} +2 -2
  75. package/dist/client/v2/assets/{7201-2049816a.js → 7201-8e6e91a3.js} +1 -1
  76. package/dist/client/v2/assets/{7959-f9145d32.js → 7959-ab57fce2.js} +1 -1
  77. package/dist/client/v2/assets/{8138-f2234325.js → 8138-704104a5.js} +1 -1
  78. package/dist/client/v2/assets/{8262-09946e21.js → 8262-7a324b59.js} +1 -1
  79. package/dist/client/v2/assets/{8434-7296f545.js → 8434-79232eec.js} +1 -1
  80. package/dist/client/v2/assets/{8438-55cc74f0.js → 8438-9d210970.js} +2 -2
  81. package/dist/client/v2/assets/{8562-022da9fa.js → 8562-215edc37.js} +1 -1
  82. package/dist/client/v2/assets/9836-288424d8.js +22 -0
  83. package/dist/client/v2/assets/index-a2c43823.js +269 -0
  84. package/dist/client/v2/assets/runtime-d6e0ee3d.js +1 -0
  85. package/dist/client/v2/assets/vendor-antd-ecosystem-1ffc870c.js +2 -0
  86. package/dist/client/v2/assets/vendor-antd-icons-db04cf76.js +2 -0
  87. package/dist/client/v2/browser-checker.js +186 -0
  88. package/dist/client/v2/favicon/favicon.ico +0 -0
  89. package/dist/client/v2/file-placeholder/ai-200-200.png +0 -0
  90. package/dist/client/v2/file-placeholder/audio-200-200.png +0 -0
  91. package/dist/client/v2/file-placeholder/docx-200-200.png +0 -0
  92. package/dist/client/v2/file-placeholder/eps-200-200.png +0 -0
  93. package/dist/client/v2/file-placeholder/gif-200-200.png +0 -0
  94. package/dist/client/v2/file-placeholder/jpeg-200-200.png +0 -0
  95. package/dist/client/v2/file-placeholder/pdf-200-200.png +0 -0
  96. package/dist/client/v2/file-placeholder/png-200-200.png +0 -0
  97. package/dist/client/v2/file-placeholder/pptx-200-200.png +0 -0
  98. package/dist/client/v2/file-placeholder/psd-200-200.png +0 -0
  99. package/dist/client/v2/file-placeholder/svg-200-200.png +0 -0
  100. package/dist/client/v2/file-placeholder/unknown-200-200.png +0 -0
  101. package/dist/client/v2/file-placeholder/video-200-200.png +0 -0
  102. package/dist/client/v2/file-placeholder/xlsx-200-200.png +0 -0
  103. package/dist/client/v2/file-placeholder/zip-200-200.png +0 -0
  104. package/dist/client/v2/global.css +63 -0
  105. package/dist/client/v2/index.html +12 -18
  106. package/dist/client/v2/nocobase.png +0 -0
  107. package/dist/client/v2/robots.txt +2 -0
  108. package/package.json +6 -6
  109. package/client-v2/src/plugins/AppInfoDemoPlugin.ts +0 -40
  110. package/client-v2/src/routes/DemoHomepageRoute.tsx +0 -28
  111. package/client-v2/src/routes/FlowSettingsComponentLoaderDemoRoute.tsx +0 -40
  112. package/client-v2/src/settings/DemoFlowSettingsLazyField.tsx +0 -14
  113. package/dist/client/p__index.ce72fd4e.async.js +0 -2738
  114. package/dist/client/umi.daa4a9d2.js +0 -63
  115. package/dist/client/v2/assets/2710-ddca03eb.js +0 -36
  116. package/dist/client/v2/assets/3475-d92f065a.js +0 -1
  117. package/dist/client/v2/assets/465-1cb2158a.js +0 -1
  118. package/dist/client/v2/assets/5366-53bf100a.js +0 -1
  119. package/dist/client/v2/assets/6269-1fd42a11.js +0 -1
  120. package/dist/client/v2/assets/6830-d23120a0.js +0 -1
  121. package/dist/client/v2/assets/7482-c3d402ea.js +0 -1
  122. package/dist/client/v2/assets/7928-c2116323.js +0 -1
  123. package/dist/client/v2/assets/9261-5b0e2178.js +0 -2
  124. package/dist/client/v2/assets/9836-65eadc90.js +0 -22
  125. package/dist/client/v2/assets/index-df3f23f2.js +0 -236
  126. package/dist/client/v2/assets/runtime-9ee03ea7.js +0 -1
  127. package/dist/client/v2/assets/vendor-antd-ecosystem-3072b8fa.js +0 -2
  128. package/dist/client/v2/assets/vendor-antd-icons-b7d99c50.js +0 -2
  129. /package/dist/client/v2/assets/{index-df3f23f2.js.LICENSE.txt → index-a2c43823.js.LICENSE.txt} +0 -0
  130. /package/dist/client/v2/assets/{vendor-antd-ecosystem-3072b8fa.js.LICENSE.txt → vendor-antd-ecosystem-1ffc870c.js.LICENSE.txt} +0 -0
  131. /package/dist/client/v2/assets/{vendor-antd-icons-b7d99c50.js.LICENSE.txt → vendor-antd-icons-db04cf76.js.LICENSE.txt} +0 -0
package/client/.umirc.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { generatePlugins, getUmiConfig } from '@nocobase/devtools/umiConfig';
1
+ import { generatePlugins } from '@nocobase/devtools/common';
2
+ import { getUmiConfig } from '@nocobase/devtools/umiConfig';
2
3
  import path from 'path';
3
4
  import { defineConfig } from 'umi';
4
5
 
@@ -88,6 +89,5 @@ export default defineConfig({
88
89
  }
89
90
  return config;
90
91
  },
91
- extraBabelPlugins: ['react-imported-component/babel'],
92
92
  routes: [{ path: '/*', component: 'index' }],
93
93
  });
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8" />
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
7
+ <title>Loading...</title>
8
+ </head>
9
+
10
+ <body>
11
+ <div id="root"></div>
12
+ </body>
13
+
14
+ </html>
@@ -0,0 +1,261 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ import path from 'node:path';
11
+ import { createRequire } from 'node:module';
12
+ import { fileURLToPath } from 'node:url';
13
+ import { defineConfig } from '@rsbuild/core';
14
+ import { pluginLess } from '@rsbuild/plugin-less';
15
+ import { pluginNodePolyfill } from '@rsbuild/plugin-node-polyfill';
16
+ import { pluginReact } from '@rsbuild/plugin-react';
17
+ import { pluginSvgr } from '@rsbuild/plugin-svgr';
18
+ import { generatePlugins, getRsbuildAlias } from '@nocobase/devtools/rsbuildConfig';
19
+
20
+ const __filename = fileURLToPath(import.meta.url);
21
+ const __dirname = path.dirname(__filename);
22
+ const require = createRequire(import.meta.url);
23
+ const devtoolsPackageJson = require('../../devtools/package.json') as { version?: string };
24
+ const appVersion = devtoolsPackageJson.version || '';
25
+
26
+ generatePlugins();
27
+
28
+ function ensurePublicPath(value: string | undefined, fallback = '/') {
29
+ let normalized = value || fallback;
30
+ if (!normalized.startsWith('/')) {
31
+ normalized = `/${normalized}`;
32
+ }
33
+ if (!normalized.endsWith('/')) {
34
+ normalized = `${normalized}/`;
35
+ }
36
+ return normalized;
37
+ }
38
+
39
+ function toNumber(value: string | undefined, fallback: number) {
40
+ const parsed = Number(value);
41
+ return Number.isFinite(parsed) ? parsed : fallback;
42
+ }
43
+
44
+ function toDefineLiteral(value: string | undefined) {
45
+ return value === undefined ? 'undefined' : JSON.stringify(value);
46
+ }
47
+
48
+ function createRuntimeHeadScript(appPublicPath: string, isBuild: boolean) {
49
+ if (!isBuild) {
50
+ return [
51
+ `window['__nocobase_public_path__'] = ${JSON.stringify(appPublicPath)};`,
52
+ `window['__nocobase_dev_public_path__'] = "/";`,
53
+ `window['__esm_cdn_base_url__'] = ${JSON.stringify(process.env.ESM_CDN_BASE_URL || '')};`,
54
+ `window['__esm_cdn_suffix__'] = ${JSON.stringify(process.env.ESM_CDN_SUFFIX || '')};`,
55
+ ].join('\n');
56
+ }
57
+
58
+ return [
59
+ `window['__webpack_public_path__'] = ${JSON.stringify(process.env.CDN_BASE_URL || '')};`,
60
+ `window['__nocobase_public_path__'] = ${JSON.stringify(appPublicPath)};`,
61
+ `window['__nocobase_api_base_url__'] = ${JSON.stringify(
62
+ process.env.API_BASE_URL || process.env.API_BASE_PATH || '',
63
+ )};`,
64
+ `window['__nocobase_api_client_storage_prefix__'] = ${JSON.stringify(
65
+ process.env.API_CLIENT_STORAGE_PREFIX || '',
66
+ )};`,
67
+ `window['__nocobase_api_client_storage_type__'] = ${JSON.stringify(process.env.API_CLIENT_STORAGE_TYPE || '')};`,
68
+ `window['__nocobase_api_client_share_token__'] = ${process.env.API_CLIENT_SHARE_TOKEN === 'true'};`,
69
+ `window['__nocobase_ws_url__'] = ${JSON.stringify(process.env.WEBSOCKET_URL || '')};`,
70
+ `window['__nocobase_ws_path__'] = ${JSON.stringify(process.env.WS_PATH || '')};`,
71
+ `window['__esm_cdn_base_url__'] = ${JSON.stringify(process.env.ESM_CDN_BASE_URL || '')};`,
72
+ `window['__esm_cdn_suffix__'] = ${JSON.stringify(process.env.ESM_CDN_SUFFIX || '')};`,
73
+ ].join('\n');
74
+ }
75
+
76
+ function createDefineValues(appPublicPath: string) {
77
+ return {
78
+ 'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
79
+ 'process.env.APP_PUBLIC_PATH': JSON.stringify(appPublicPath),
80
+ 'process.env.API_BASE_URL': JSON.stringify(process.env.API_BASE_URL || process.env.API_BASE_PATH || ''),
81
+ 'process.env.API_CLIENT_STORAGE_PREFIX': JSON.stringify(process.env.API_CLIENT_STORAGE_PREFIX || ''),
82
+ 'process.env.API_CLIENT_STORAGE_TYPE': JSON.stringify(process.env.API_CLIENT_STORAGE_TYPE || ''),
83
+ 'process.env.API_CLIENT_SHARE_TOKEN': JSON.stringify(process.env.API_CLIENT_SHARE_TOKEN || 'false'),
84
+ 'process.env.WEBSOCKET_URL': JSON.stringify(process.env.WEBSOCKET_URL || ''),
85
+ 'process.env.WS_PATH': JSON.stringify(process.env.WS_PATH || ''),
86
+ 'process.env.APP_ENV': toDefineLiteral(process.env.APP_ENV),
87
+ 'process.env.VERSION': JSON.stringify(appVersion),
88
+ 'process.env.__E2E__': toDefineLiteral(process.env.__E2E__),
89
+ 'process.env.USE_REMOTE_PLUGIN': toDefineLiteral(process.env.USE_REMOTE_PLUGIN),
90
+ };
91
+ }
92
+
93
+ export default defineConfig(({ command }) => {
94
+ const isBuild = command === 'build';
95
+ const isDev = !isBuild;
96
+ const appPublicPath = ensurePublicPath(process.env.APP_PUBLIC_PATH, '/');
97
+ const htmlPublicPath = isDev ? '/' : appPublicPath;
98
+ const apiBasePath = ensurePublicPath(process.env.API_BASE_PATH, '/api/');
99
+ const localStorageBasePath = ensurePublicPath(`${appPublicPath}storage/uploads/`, '/storage/uploads/');
100
+ const staticBasePath = ensurePublicPath(`${appPublicPath}static/`, '/static/');
101
+ const wsBasePath = ensurePublicPath(process.env.WS_PATH, '/ws/');
102
+ const v2BasePath = ensurePublicPath(`${appPublicPath.replace(/\/$/, '')}/v2/`, '/v2/');
103
+ const clientPort = toNumber(process.env.APP_PORT, 13001);
104
+ const v2Port = toNumber(process.env.APP_V2_PORT, clientPort + 2);
105
+ const hmrPath = `${appPublicPath.replace(/\/$/, '')}/__rspack_hmr`;
106
+ const proxyTargetUrl = process.env.PROXY_TARGET_URL || `http://127.0.0.1:${clientPort + 1}`;
107
+ const hmrClientHost = process.env.RSPACK_HMR_CLIENT_HOST || 'localhost';
108
+ const hmrClientPort = toNumber(process.env.RSPACK_HMR_CLIENT_PORT, clientPort);
109
+ const workspaceAliases = getRsbuildAlias();
110
+
111
+ return {
112
+ plugins: [pluginReact(), pluginLess(), pluginNodePolyfill(), pluginSvgr()],
113
+ resolve: {
114
+ alias: workspaceAliases,
115
+ },
116
+ source: {
117
+ entry: {
118
+ index: path.resolve(__dirname, 'src/main.tsx'),
119
+ },
120
+ tsconfigPath: path.resolve(__dirname, 'tsconfig.json'),
121
+ define: createDefineValues(appPublicPath),
122
+ decorators: {
123
+ version: 'legacy',
124
+ },
125
+ },
126
+ html: {
127
+ template: path.resolve(__dirname, 'index.html'),
128
+ scriptLoading: isBuild ? 'module' : 'defer',
129
+ tags: [
130
+ {
131
+ tag: 'link',
132
+ attrs: {
133
+ rel: 'stylesheet',
134
+ href: `${htmlPublicPath}global.css`,
135
+ },
136
+ publicPath: false,
137
+ head: true,
138
+ append: false,
139
+ },
140
+ {
141
+ tag: 'script',
142
+ children: createRuntimeHeadScript(appPublicPath, isBuild),
143
+ head: true,
144
+ append: false,
145
+ },
146
+ {
147
+ tag: 'script',
148
+ attrs: {
149
+ src: `${htmlPublicPath}browser-checker.js?v=1`,
150
+ },
151
+ publicPath: false,
152
+ head: true,
153
+ append: false,
154
+ },
155
+ ],
156
+ },
157
+ output: {
158
+ target: 'web',
159
+ distPath: {
160
+ root: path.resolve(__dirname, '../dist/client'),
161
+ js: 'assets',
162
+ jsAsync: 'assets',
163
+ css: 'assets',
164
+ cssAsync: 'assets',
165
+ svg: 'assets',
166
+ font: 'assets',
167
+ image: 'assets',
168
+ media: 'assets',
169
+ },
170
+ filename: {
171
+ js: '[name]-[contenthash:8].js',
172
+ css: '[name]-[contenthash:8].css',
173
+ svg: '[name]-[contenthash:8][ext][query]',
174
+ font: '[name]-[contenthash:8][ext][query]',
175
+ image: '[name]-[contenthash:8][ext][query]',
176
+ media: '[name]-[contenthash:8][ext][query]',
177
+ },
178
+ assetPrefix: appPublicPath,
179
+ cleanDistPath: true,
180
+ sourceMap: {
181
+ js: isBuild ? false : 'eval-cheap-module-source-map',
182
+ css: false,
183
+ },
184
+ },
185
+ server: {
186
+ base: appPublicPath,
187
+ host: '0.0.0.0',
188
+ port: clientPort,
189
+ compress: true,
190
+ publicDir: {
191
+ name: path.resolve(__dirname, 'public'),
192
+ },
193
+ proxy: {
194
+ [apiBasePath]: {
195
+ target: proxyTargetUrl,
196
+ changeOrigin: true,
197
+ ws: true,
198
+ xfwd: true,
199
+ pathRewrite: {
200
+ [`^${apiBasePath}`]: apiBasePath,
201
+ },
202
+ onProxyRes(proxyRes, req, res) {
203
+ if (req.headers.accept === 'text/event-stream') {
204
+ res.writeHead(res.statusCode, {
205
+ 'Content-Type': 'text/event-stream',
206
+ 'Cache-Control': 'no-transform',
207
+ Connection: 'keep-alive',
208
+ });
209
+ }
210
+ },
211
+ },
212
+ [localStorageBasePath]: {
213
+ target: proxyTargetUrl,
214
+ changeOrigin: true,
215
+ },
216
+ [staticBasePath]: {
217
+ target: proxyTargetUrl,
218
+ changeOrigin: true,
219
+ },
220
+ [wsBasePath]: {
221
+ target: proxyTargetUrl,
222
+ changeOrigin: true,
223
+ ws: true,
224
+ xfwd: true,
225
+ },
226
+ [v2BasePath]: {
227
+ target: `http://127.0.0.1:${v2Port}`,
228
+ changeOrigin: true,
229
+ ws: true,
230
+ pathRewrite: {
231
+ [`^${v2BasePath}`]: v2BasePath,
232
+ },
233
+ xfwd: true,
234
+ },
235
+ },
236
+ historyApiFallback: {
237
+ disableDotRule: true,
238
+ index: `${appPublicPath}index.html`,
239
+ },
240
+ },
241
+ dev: {
242
+ assetPrefix: appPublicPath,
243
+ lazyCompilation: false,
244
+ client: {
245
+ overlay: false,
246
+ protocol: 'ws',
247
+ host: hmrClientHost,
248
+ port: hmrClientPort,
249
+ path: hmrPath,
250
+ },
251
+ progressBar: true,
252
+ },
253
+ tools: {
254
+ rspack(config) {
255
+ config.target = ['web', 'es2020'];
256
+ config.performance = false;
257
+ config.stats = 'errors-warnings';
258
+ },
259
+ },
260
+ };
261
+ });
@@ -7,8 +7,6 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- import React from 'react';
10
+ import { app } from './pages/index';
11
11
 
12
- export default function AppInfoDemoRoute() {
13
- return <div>App Info Demo Route</div>;
14
- }
12
+ app.mount('#root');
@@ -1,23 +1,9 @@
1
- <!doctype html>
1
+ <!DOCTYPE html>
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
- <title>NocoBase v2</title>
7
- <script>
8
- window.__nocobase_public_path__ = window.__nocobase_public_path__ || '<%= BASE_URL %>';
9
- window.__nocobase_api_base_url__ = window.__nocobase_api_base_url__ || '<%= API_BASE_URL %>';
10
- window.__nocobase_api_client_storage_prefix__ =
11
- window.__nocobase_api_client_storage_prefix__ || '<%= API_CLIENT_STORAGE_PREFIX %>';
12
- window.__nocobase_api_client_storage_type__ =
13
- window.__nocobase_api_client_storage_type__ || '<%= API_CLIENT_STORAGE_TYPE %>';
14
- window.__nocobase_api_client_share_token__ =
15
- window.__nocobase_api_client_share_token__ || '<%= API_CLIENT_SHARE_TOKEN %>';
16
- window.__nocobase_ws_url__ = window.__nocobase_ws_url__ || '<%= WS_URL %>';
17
- window.__nocobase_ws_path__ = window.__nocobase_ws_path__ || '<%= WS_PATH %>';
18
- window.__esm_cdn_base_url__ = window.__esm_cdn_base_url__ || '<%= ESM_CDN_BASE_URL %>';
19
- window.__esm_cdn_suffix__ = window.__esm_cdn_suffix__ || '<%= ESM_CDN_SUFFIX %>';
20
- </script>
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6
+ <title>Loading...</title>
21
7
  </head>
22
8
  <body>
23
9
  <div id="root"></div>
@@ -0,0 +1,186 @@
1
+ const basename = window['__nocobase_public_path__'] || '/';
2
+ let currentPath = window.location.pathname;
3
+ if (currentPath === basename.slice(0, -1)) {
4
+ const newUrl = `${window.location.origin}${basename}${window.location.search}${window.location.hash}`;
5
+ window.location.replace(newUrl);
6
+ } else if (!currentPath.startsWith(basename)) {
7
+ let newPath = basename + (currentPath.startsWith('/') ? currentPath.slice(1) : currentPath);
8
+ let newUrl = window.location.origin + newPath + window.location.search + window.location.hash;
9
+ window.location.replace(newUrl);
10
+ }
11
+ showLog = true;
12
+ function log(m) {
13
+ if (window.console && showLog) {
14
+ console.log(m);
15
+ }
16
+ }
17
+ function css_browser_selector(u) {
18
+ var uaInfo = {},
19
+ screens = [320, 480, 640, 768, 1024, 1152, 1280, 1440, 1680, 1920, 2560],
20
+ allScreens = screens.length,
21
+ ua = u.toLowerCase(),
22
+ is = function (t) {
23
+ return RegExp(t, 'i').test(ua);
24
+ },
25
+ version = function (p, n) {
26
+ n = n.replace('.', '_');
27
+ var i = n.indexOf('_'),
28
+ ver = '';
29
+ while (i > 0) {
30
+ ver += ' ' + p + n.substring(0, i);
31
+ i = n.indexOf('_', i + 1);
32
+ }
33
+ ver += ' ' + p + n;
34
+ return ver;
35
+ },
36
+ g = 'gecko',
37
+ w = 'webkit',
38
+ c = 'chrome',
39
+ f = 'firefox',
40
+ s = 'safari',
41
+ o = 'opera',
42
+ m = 'mobile',
43
+ a = 'android',
44
+ bb = 'blackberry',
45
+ lang = 'lang_',
46
+ dv = 'device_',
47
+ html = document.documentElement,
48
+ b = [
49
+ (!/opera|webtv/i.test(ua) && /msie\s(\d+)/.test(ua)) || /trident\/.*rv:([0-9]{1,}[\.0-9]{0,})/.test(ua)
50
+ ? 'ie ie' + (/trident\/4\.0/.test(ua) ? '8' : RegExp.$1 == '11.0' ? '11' : RegExp.$1)
51
+ : is('firefox/')
52
+ ? g +
53
+ ' ' +
54
+ f +
55
+ (/firefox\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua)
56
+ ? ' ' + f + RegExp.$2 + ' ' + f + RegExp.$2 + '_' + RegExp.$4
57
+ : '')
58
+ : is('gecko/')
59
+ ? g
60
+ : is('opera')
61
+ ? o +
62
+ (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua)
63
+ ? ' ' + o + RegExp.$2 + ' ' + o + RegExp.$2 + '_' + RegExp.$4
64
+ : /opera(\s|\/)(\d+)\.(\d+)/.test(ua)
65
+ ? ' ' + o + RegExp.$2 + ' ' + o + RegExp.$2 + '_' + RegExp.$3
66
+ : '')
67
+ : is('konqueror')
68
+ ? 'konqueror'
69
+ : is('blackberry')
70
+ ? bb +
71
+ (/Version\/(\d+)(\.(\d+)+)/i.test(ua)
72
+ ? ' ' + bb + RegExp.$1 + ' ' + bb + RegExp.$1 + RegExp.$2.replace('.', '_')
73
+ : /Blackberry ?(([0-9]+)([a-z]?))[\/|;]/gi.test(ua)
74
+ ? ' ' + bb + RegExp.$2 + (RegExp.$3 ? ' ' + bb + RegExp.$2 + RegExp.$3 : '')
75
+ : '')
76
+ : is('android')
77
+ ? a +
78
+ (/Version\/(\d+)(\.(\d+))+/i.test(ua)
79
+ ? ' ' + a + RegExp.$1 + ' ' + a + RegExp.$1 + RegExp.$2.replace('.', '_')
80
+ : '') +
81
+ (/Android (.+); (.+) Build/i.test(ua) ? ' ' + dv + RegExp.$2.replace(/ /g, '_').replace(/-/g, '_') : '')
82
+ : is('chrome')
83
+ ? w +
84
+ ' ' +
85
+ c +
86
+ (/chrome\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua)
87
+ ? ' ' + c + RegExp.$2 + (RegExp.$4 > 0 ? ' ' + c + RegExp.$2 + '_' + RegExp.$4 : '')
88
+ : '')
89
+ : is('iron')
90
+ ? w + ' iron'
91
+ : is('applewebkit/')
92
+ ? w +
93
+ ' ' +
94
+ s +
95
+ (/version\/((\d+)(\.(\d+))(\.\d+)*)/.test(ua)
96
+ ? ' ' + s + RegExp.$2 + ' ' + s + RegExp.$2 + RegExp.$3.replace('.', '_')
97
+ : / Safari\/(\d+)/i.test(ua)
98
+ ? RegExp.$1 == '419' || RegExp.$1 == '417' || RegExp.$1 == '416' || RegExp.$1 == '412'
99
+ ? ' ' + s + '2_0'
100
+ : RegExp.$1 == '312'
101
+ ? ' ' + s + '1_3'
102
+ : RegExp.$1 == '125'
103
+ ? ' ' + s + '1_2'
104
+ : RegExp.$1 == '85'
105
+ ? ' ' + s + '1_0'
106
+ : ''
107
+ : '')
108
+ : is('mozilla/')
109
+ ? g
110
+ : '',
111
+ is('android|mobi|mobile|j2me|iphone|ipod|ipad|blackberry|playbook|kindle|silk') ? m : '',
112
+ is('j2me')
113
+ ? 'j2me'
114
+ : is('ipad|ipod|iphone')
115
+ ? (/CPU( iPhone)? OS (\d+[_|\.]\d+([_|\.]\d+)*)/i.test(ua) ? 'ios' + version('ios', RegExp.$2) : '') +
116
+ ' ' +
117
+ (/(ip(ad|od|hone))/gi.test(ua) ? RegExp.$1 : '')
118
+ : is('playbook')
119
+ ? 'playbook'
120
+ : is('kindle|silk')
121
+ ? 'kindle'
122
+ : is('playbook')
123
+ ? 'playbook'
124
+ : is('mac')
125
+ ? 'mac' +
126
+ (/mac os x ((\d+)[.|_](\d+))/.test(ua) ? ' mac' + RegExp.$2 + ' mac' + RegExp.$1.replace('.', '_') : '')
127
+ : is('win')
128
+ ? 'win' +
129
+ (is('windows nt 6.2')
130
+ ? ' win8'
131
+ : is('windows nt 6.1')
132
+ ? ' win7'
133
+ : is('windows nt 6.0')
134
+ ? ' vista'
135
+ : is('windows nt 5.2') || is('windows nt 5.1')
136
+ ? ' win_xp'
137
+ : is('windows nt 5.0')
138
+ ? ' win_2k'
139
+ : is('windows nt 4.0') || is('WinNT4.0')
140
+ ? ' win_nt'
141
+ : '')
142
+ : is('freebsd')
143
+ ? 'freebsd'
144
+ : is('x11|linux')
145
+ ? 'linux'
146
+ : '',
147
+ /[; |\[](([a-z]{2})(\-[a-z]{2})?)[)|;|\]]/i.test(ua)
148
+ ? (lang + RegExp.$2).replace('-', '_') + (RegExp.$3 != '' ? (' ' + lang + RegExp.$1).replace('-', '_') : '')
149
+ : '',
150
+ is('ipad|iphone|ipod') && !is('safari') ? 'ipad_app' : '',
151
+ ];
152
+ console.debug(ua);
153
+ function screenSize() {
154
+ var w = window.outerWidth || html.clientWidth;
155
+ var h = window.outerHeight || html.clientHeight;
156
+ uaInfo.orientation = w < h ? 'portrait' : 'landscape';
157
+ html.className = html.className.replace(/ ?orientation_\w+/g, '').replace(/ [min|max|cl]+[w|h]_\d+/g, '');
158
+ for (var i = allScreens - 1; i >= 0; i--) {
159
+ if (w >= screens[i]) {
160
+ uaInfo.maxw = screens[i];
161
+ break;
162
+ }
163
+ }
164
+ widthClasses = '';
165
+ for (var info in uaInfo) {
166
+ widthClasses += ' ' + info + '_' + uaInfo[info];
167
+ }
168
+ html.className = html.className + widthClasses;
169
+ return widthClasses;
170
+ }
171
+ window.onresize = screenSize;
172
+ screenSize();
173
+ function retina() {
174
+ var r = window.devicePixelRatio > 1;
175
+ if (r) {
176
+ html.className += ' retina';
177
+ } else {
178
+ html.className += ' non-retina';
179
+ }
180
+ }
181
+ retina();
182
+ var cssbs = b.join(' ') + ' js ';
183
+ html.className = (cssbs + html.className.replace(/\b(no[-|_]?)?js\b/g, '')).replace(/^ /, '').replace(/ +/g, ' ');
184
+ return cssbs;
185
+ }
186
+ css_browser_selector(navigator.userAgent);
@@ -0,0 +1,63 @@
1
+ #root {
2
+ width: 100%;
3
+ height: 100%;
4
+ }
5
+ /* width */
6
+ .win ::-webkit-scrollbar {
7
+ width: 8px;
8
+ height: 8px;
9
+ }
10
+
11
+ /* Track */
12
+ .win ::-webkit-scrollbar-track {
13
+ background: var(--colorBgScrollTrack);
14
+ }
15
+
16
+ /* Handle */
17
+ .win ::-webkit-scrollbar-thumb {
18
+ background: var(--colorBgScrollBar);
19
+ border-radius: 4px;
20
+ }
21
+
22
+ /* Handle on hover */
23
+ .win ::-webkit-scrollbar-thumb:hover {
24
+ background: var(--colorBgScrollBarHover);
25
+ }
26
+
27
+ .win ::-webkit-scrollbar-thumb:active {
28
+ background: var(--colorBgScrollBarActive);
29
+ }
30
+
31
+ .win .rc-virtual-list-scrollbar-thumb {
32
+ background: var(--colorBgScrollBar);
33
+ }
34
+ .win .rc-virtual-list-scrollbar-thumb:hover {
35
+ background: var(--colorBgScrollBarHover);
36
+ }
37
+ .win .rc-virtual-list-scrollbar-thumb:active {
38
+ background: var(--colorBgScrollBarActive);
39
+ }
40
+
41
+ body a {
42
+ color: var(--colorPrimaryText);
43
+ }
44
+
45
+ body a:hover {
46
+ color: var(--colorPrimaryTextHover);
47
+ }
48
+
49
+ body a:active {
50
+ color: var(--colorPrimaryTextActive);
51
+ }
52
+
53
+ .ant-btn-link {
54
+ color: var(--colorPrimaryText);
55
+ }
56
+
57
+ .ant-btn-link:hover {
58
+ color: var(--colorPrimaryTextHover);
59
+ }
60
+
61
+ .ant-btn-link:active {
62
+ color: var(--colorPrimaryTextActive);
63
+ }
Binary file
@@ -0,0 +1,2 @@
1
+ User-agent: *
2
+ Disallow: /