create-next-imagicma 0.1.12 → 0.1.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-next-imagicma",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-next-imagicma": "./bin/create-next-imagicma.mjs"
@@ -3,7 +3,11 @@
3
3
  var VERSION = 1;
4
4
  var MAX_TEXT_LENGTH = 240;
5
5
  var MAX_SELECTOR_LENGTH = 512;
6
- var PROD_PARENT_ORIGIN = 'https://imagicma.cn';
6
+ var PROD_PARENT_ORIGINS = {
7
+ 'https://agentma.cn': true,
8
+ 'https://imagicma.cn': true,
9
+ 'https://nanocoda.com': true,
10
+ };
7
11
  var LOCAL_PARENT_RE = /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/i;
8
12
  var LOCAL_IMAGICMA_PARENT_RE = /^https?:\/\/([a-z0-9-]+\.)?local\.imagicma\.cn(:\d+)?$/i;
9
13
 
@@ -21,7 +25,7 @@
21
25
 
22
26
  function isAllowedParentOrigin(origin) {
23
27
  if (!origin) return false;
24
- return origin === PROD_PARENT_ORIGIN || LOCAL_PARENT_RE.test(origin) || LOCAL_IMAGICMA_PARENT_RE.test(origin);
28
+ return !!PROD_PARENT_ORIGINS[origin] || LOCAL_PARENT_RE.test(origin) || LOCAL_IMAGICMA_PARENT_RE.test(origin);
25
29
  }
26
30
 
27
31
  function isRecord(value) {
@@ -4,6 +4,7 @@
4
4
  var PROD_PARENT_ORIGINS = {
5
5
  'https://agentma.cn': true,
6
6
  'https://imagicma.cn': true,
7
+ 'https://nanocoda.com': true
7
8
  };
8
9
  var LOCAL_PARENT_RE = /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/i;
9
10
  var LOCAL_IMAGICMA_PARENT_RE = /^https?:\/\/([a-z0-9-]+\.)?local\.(agentma\.cn|imagicma\.cn)(:\d+)?$/i;
@@ -1,4 +1,4 @@
1
- const PROD_PARENT_ORIGINS = new Set(["https://agentma.cn", "https://imagicma.cn"]);
1
+ const PROD_PARENT_ORIGINS = new Set(["https://agentma.cn", "https://imagicma.cn", "https://nanocoda.com"]);
2
2
  const LOCAL_PARENT_RE = /^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/i;
3
3
  const LOCAL_IMAGICMA_PARENT_RE = /^https?:\/\/([a-z0-9-]+\.)?local\.(agentma\.cn|imagicma\.cn)(:\d+)?$/i;
4
4
 
@@ -126,7 +126,7 @@ export default defineConfig(async ({ command }) => {
126
126
  : {
127
127
  host: "0.0.0.0",
128
128
  port: runtimePort,
129
- allowedHosts: ["localhost", "127.0.0.1", ".preview.imagicma.cn", ".preview.agentma.cn", ".preview.agentma.com"],
129
+ allowedHosts: ["localhost", "127.0.0.1", ".preview.imagicma.cn", ".preview.agentma.cn", ".preview.agentma.com", ".preview.nanocoda.com"],
130
130
  strictPort: true,
131
131
  hmr: { overlay: false },
132
132
  },