@symbo.ls/create 2.10.177 → 2.10.178

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/index.js CHANGED
@@ -10,7 +10,7 @@ import { defaultDefine } from './define'
10
10
  import { initRouter, popStateRouter } from './router'
11
11
  import { fetchAsync, fetchSync } from './ferchOnCreate'
12
12
  import { initEmotion } from './initEmotion'
13
- import { applyKeyDebugListener, applySyncDebug } from './syncExtend'
13
+ import { applyInspectListener, applySyncDebug } from './syncExtend'
14
14
 
15
15
  import DEFAULT_CREATE_OPTIONS from './options'
16
16
  import DYNAMIC_JSON from '@symbo.ls/init/dynamic.json'
@@ -68,7 +68,7 @@ export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExter
68
68
  ...options.domqlOptions
69
69
  })
70
70
 
71
- applyKeyDebugListener(domqlApp, options)
71
+ applyInspectListener(domqlApp, options)
72
72
  popStateRouter(domqlApp, options)
73
73
 
74
74
  fetchAsync(domqlApp, key, options)
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.10.177",
3
+ "version": "2.10.178",
4
4
  "license": "MIT",
5
- "gitHead": "9ccec871ab3f201c9b42b4f05f49a1497454c87e",
5
+ "gitHead": "84add6c407610efe1ffd4f80adc42debeea3ca61",
6
6
  "source": "index.js",
7
7
  "main": "index.js",
8
8
  "dependencies": {
package/syncExtend.js CHANGED
@@ -1,19 +1,22 @@
1
1
  'use strict'
2
2
 
3
3
  import { Sync, DevFocus, inspectOnKey } from '@symbo.ls/socket-ui'
4
- import { isProduction, isTest } from '@domql/env'
5
-
6
- const { NODE_ENV } = process.env
4
+ import { isDevelopment, isProduction, isTest } from '@domql/env'
5
+ import { isUndefined } from '@domql/utils'
7
6
 
8
7
  export const applySyncDebug = (extend, options) => {
9
8
  const { editor } = options
10
9
  if (!editor) return extend
11
- if (editor.inspect) extend.push[DevFocus]
12
- if (editor.liveSync) extend.push[Sync]
10
+ const inspect = isUndefined(editor.inspect) ? isDevelopment() : editor.inspect
11
+ const liveSync = isUndefined(editor.liveSync) ? isDevelopment() : editor.liveSync
12
+ if (inspect) extend.push[DevFocus]
13
+ if (liveSync) extend.push[Sync]
13
14
  return extend
14
15
  }
15
16
 
16
- export const applyKeyDebugListener = (root, options) => {
17
+ export const applyInspectListener = (root, options) => {
17
18
  const { editor } = options
18
- if (editor && editor.inspect) inspectOnKey(root)
19
+ if (!editor) return
20
+ const inspect = isUndefined(editor.inspect) ? isDevelopment() : editor.inspect
21
+ if (inspect) inspectOnKey(root)
19
22
  }