@symbo.ls/create 2.11.209 → 2.11.210
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/dist/cjs/bundle/index.js +2404 -863
- package/dist/cjs/index.js +8 -10
- package/dist/cjs/router.js +6 -4
- package/dist/cjs/syncExtend.js +1 -1
- package/package.json +2 -2
- package/src/index.js +7 -8
- package/src/router.js +4 -4
- package/src/syncExtend.js +1 -1
package/dist/cjs/index.js
CHANGED
|
@@ -64,17 +64,15 @@ const create = async (App, options = import_options.default, optionsExternalFile
|
|
|
64
64
|
document = window.document;
|
|
65
65
|
}
|
|
66
66
|
const doc = options.parent || options.document || document;
|
|
67
|
-
const [
|
|
68
|
-
|
|
67
|
+
const [scratcDesignhSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
|
|
68
|
+
const state = {};
|
|
69
69
|
if (options.state)
|
|
70
|
-
state
|
|
71
|
-
|
|
72
|
-
state
|
|
73
|
-
else
|
|
74
|
-
state = {};
|
|
70
|
+
(0, import_utils.deepMerge)(state, options.state);
|
|
71
|
+
if (App && App.state)
|
|
72
|
+
(0, import_utils.deepMerge)(state, App.state);
|
|
75
73
|
const pages = options.pages || {};
|
|
76
74
|
const components = options.components ? { ...uikit, ...options.components } : uikit;
|
|
77
|
-
const designSystem =
|
|
75
|
+
const designSystem = scratcDesignhSystem || {};
|
|
78
76
|
const snippets = { ...utils, ...utils.scratchUtils, ...options.snippets || {} };
|
|
79
77
|
const define = options.define || import_define.defaultDefine;
|
|
80
78
|
const routerOptions = (0, import_router.initRouter)(App, options);
|
|
@@ -132,7 +130,7 @@ const createSync = (App, options = import_options.default, optionsExternalFile)
|
|
|
132
130
|
parent = options.document;
|
|
133
131
|
else
|
|
134
132
|
parent = document.body;
|
|
135
|
-
const [
|
|
133
|
+
const [scratcDesignhSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
|
|
136
134
|
let state;
|
|
137
135
|
if (options.state)
|
|
138
136
|
state = options.state;
|
|
@@ -142,7 +140,7 @@ const createSync = (App, options = import_options.default, optionsExternalFile)
|
|
|
142
140
|
state = {};
|
|
143
141
|
const pages = options.pages || {};
|
|
144
142
|
const components = options.components ? { ...uikit, ...options.components } : uikit;
|
|
145
|
-
const designSystem =
|
|
143
|
+
const designSystem = scratcDesignhSystem || {};
|
|
146
144
|
const snippets = { ...utils, ...utils.scratchUtils, ...options.snippets || {} };
|
|
147
145
|
const define = options.define || import_define.defaultDefine;
|
|
148
146
|
const extend = (0, import_syncExtend.applySyncDebug)([App], options);
|
package/dist/cjs/router.js
CHANGED
|
@@ -32,11 +32,13 @@ const DEFAULT_ROUTING_OPTIONS = {
|
|
|
32
32
|
popState: true
|
|
33
33
|
};
|
|
34
34
|
const initRouter = (element, options) => {
|
|
35
|
-
|
|
36
|
-
if (routerOptions === false)
|
|
35
|
+
if (options.router === false)
|
|
37
36
|
return;
|
|
38
|
-
if (
|
|
39
|
-
|
|
37
|
+
else if (options.router === true)
|
|
38
|
+
options.router = DEFAULT_ROUTING_OPTIONS;
|
|
39
|
+
else
|
|
40
|
+
(0, import_utils.merge)(options.router || {}, DEFAULT_ROUTING_OPTIONS);
|
|
41
|
+
const routerOptions = options.router;
|
|
40
42
|
const router = options.snippets && options.snippets.router ? options.snippets.router : import_router.router;
|
|
41
43
|
const onRouterRenderDefault = (el, s) => {
|
|
42
44
|
const { pathname, hash } = import_utils.window.location;
|
package/dist/cjs/syncExtend.js
CHANGED
|
@@ -29,9 +29,9 @@ const applySyncDebug = (extend, options) => {
|
|
|
29
29
|
if (!editor)
|
|
30
30
|
return extend;
|
|
31
31
|
const inspect = (0, import_utils.isUndefined)(editor.inspect) ? (0, import_utils.isDevelopment)() : editor.inspect;
|
|
32
|
-
const liveSync = (0, import_utils.isUndefined)(editor.liveSync) ? (0, import_utils.isDevelopment)() : editor.liveSync;
|
|
33
32
|
if (inspect)
|
|
34
33
|
extend.push(import_socket_ui.DevFocus);
|
|
34
|
+
const liveSync = (0, import_utils.isUndefined)(editor.liveSync) ? (0, import_utils.isDevelopment)() : editor.liveSync;
|
|
35
35
|
if (liveSync)
|
|
36
36
|
extend.push(import_socket_ui.Sync);
|
|
37
37
|
return extend;
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -37,16 +37,15 @@ export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExter
|
|
|
37
37
|
document = window.document // eslint-disable-line
|
|
38
38
|
}
|
|
39
39
|
const doc = options.parent || options.document || document
|
|
40
|
-
const [
|
|
40
|
+
const [scratcDesignhSystem, emotion, registry] = initEmotion(key, options)
|
|
41
41
|
|
|
42
|
-
|
|
43
|
-
if (options.state) state
|
|
44
|
-
|
|
45
|
-
else state = {}
|
|
42
|
+
const state = {}
|
|
43
|
+
if (options.state) deepMerge(state, options.state)
|
|
44
|
+
if (App && App.state) deepMerge(state, App.state)
|
|
46
45
|
|
|
47
46
|
const pages = options.pages || {}
|
|
48
47
|
const components = options.components ? { ...uikit, ...options.components } : uikit
|
|
49
|
-
const designSystem =
|
|
48
|
+
const designSystem = scratcDesignhSystem || {}
|
|
50
49
|
const snippets = { ...utils, ...utils.scratchUtils, ...(options.snippets || {}) }
|
|
51
50
|
const define = options.define || defaultDefine
|
|
52
51
|
|
|
@@ -107,7 +106,7 @@ export const createSync = (App, options = DEFAULT_CREATE_OPTIONS, optionsExterna
|
|
|
107
106
|
else if (options.document) parent = options.document
|
|
108
107
|
else parent = document.body
|
|
109
108
|
|
|
110
|
-
const [
|
|
109
|
+
const [scratcDesignhSystem, emotion, registry] = initEmotion(key, options)
|
|
111
110
|
|
|
112
111
|
let state
|
|
113
112
|
if (options.state) state = options.state
|
|
@@ -116,7 +115,7 @@ export const createSync = (App, options = DEFAULT_CREATE_OPTIONS, optionsExterna
|
|
|
116
115
|
|
|
117
116
|
const pages = options.pages || {}
|
|
118
117
|
const components = options.components ? { ...uikit, ...options.components } : uikit
|
|
119
|
-
const designSystem =
|
|
118
|
+
const designSystem = scratcDesignhSystem || {}
|
|
120
119
|
const snippets = { ...utils, ...utils.scratchUtils, ...(options.snippets || {}) }
|
|
121
120
|
const define = options.define || defaultDefine
|
|
122
121
|
|
package/src/router.js
CHANGED
|
@@ -11,11 +11,11 @@ const DEFAULT_ROUTING_OPTIONS = {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
export const initRouter = (element, options) => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
if (routerOptions === true) routerOptions = DEFAULT_ROUTING_OPTIONS
|
|
14
|
+
if (options.router === false) return
|
|
15
|
+
else if (options.router === true) options.router = DEFAULT_ROUTING_OPTIONS
|
|
16
|
+
else merge(options.router || {}, DEFAULT_ROUTING_OPTIONS)
|
|
18
17
|
|
|
18
|
+
const routerOptions = options.router
|
|
19
19
|
const router = (options.snippets && options.snippets.router) ? options.snippets.router : defaultRouter
|
|
20
20
|
|
|
21
21
|
const onRouterRenderDefault = (el, s) => {
|
package/src/syncExtend.js
CHANGED
|
@@ -7,8 +7,8 @@ export const applySyncDebug = (extend, options) => {
|
|
|
7
7
|
const { editor } = options
|
|
8
8
|
if (!editor) return extend
|
|
9
9
|
const inspect = isUndefined(editor.inspect) ? isDevelopment() : editor.inspect
|
|
10
|
-
const liveSync = isUndefined(editor.liveSync) ? isDevelopment() : editor.liveSync
|
|
11
10
|
if (inspect) extend.push(DevFocus)
|
|
11
|
+
const liveSync = isUndefined(editor.liveSync) ? isDevelopment() : editor.liveSync
|
|
12
12
|
if (liveSync) extend.push(Sync)
|
|
13
13
|
return extend
|
|
14
14
|
}
|