@symbo.ls/create 2.10.33 → 2.10.41
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 +24 -9
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -13,6 +13,7 @@ import { fetchProject } from '@symbo.ls/fetch'
|
|
|
13
13
|
|
|
14
14
|
import { emotion as defaultEmotion, createEmotion } from '@symbo.ls/emotion'
|
|
15
15
|
import { defaultDefine } from './define'
|
|
16
|
+
import { appendIconsSVGSprite } from '@symbo.ls/scratch'
|
|
16
17
|
|
|
17
18
|
const { SYMBOLS_KEY } = process.env
|
|
18
19
|
|
|
@@ -24,7 +25,10 @@ const defaultOptions = {
|
|
|
24
25
|
pages: {},
|
|
25
26
|
system: {
|
|
26
27
|
useReset: true,
|
|
27
|
-
useVariable: true
|
|
28
|
+
useVariable: true,
|
|
29
|
+
useIconSprite: true,
|
|
30
|
+
useSvgSprite: true,
|
|
31
|
+
useFontImport: true
|
|
28
32
|
},
|
|
29
33
|
components: {},
|
|
30
34
|
initOptions: {
|
|
@@ -38,17 +42,26 @@ export const create = async (App, options = defaultOptions) => {
|
|
|
38
42
|
const key = options.key || SYMBOLS_KEY || (appIsKey ? App : '')
|
|
39
43
|
|
|
40
44
|
if (appIsKey) App = {}
|
|
41
|
-
if (key && options.editor)
|
|
45
|
+
if (key && options.editor) {
|
|
46
|
+
try {
|
|
47
|
+
await fetchProject(key, options)
|
|
48
|
+
} catch (e) {
|
|
49
|
+
console.error(e)
|
|
50
|
+
}
|
|
51
|
+
}
|
|
42
52
|
|
|
43
|
-
const
|
|
44
|
-
const
|
|
53
|
+
const initOptions = options.initOptions || {}
|
|
54
|
+
const emotion = initOptions.emotion || defaultEmotion || createEmotion()
|
|
45
55
|
const emotionDefine = options.registry || transformDOMQLEmotion(initOptions.emotion, options)
|
|
46
56
|
|
|
57
|
+
const doc = options.parent || document
|
|
58
|
+
|
|
47
59
|
const designSystem = init(options.system || {}, null, {
|
|
48
60
|
key,
|
|
61
|
+
emotion,
|
|
49
62
|
verbose: options.verbose,
|
|
50
|
-
|
|
51
|
-
|
|
63
|
+
document: doc,
|
|
64
|
+
...defaultOptions.system,
|
|
52
65
|
...initOptions
|
|
53
66
|
})
|
|
54
67
|
|
|
@@ -65,14 +78,16 @@ export const create = async (App, options = defaultOptions) => {
|
|
|
65
78
|
utils: { ...utils, ...domqlUtils },
|
|
66
79
|
define: defaultDefine,
|
|
67
80
|
registry: emotionDefine,
|
|
68
|
-
router: options.router || router
|
|
81
|
+
router: options.router || router,
|
|
82
|
+
emotion: emotion,
|
|
83
|
+
document: doc
|
|
69
84
|
}
|
|
70
|
-
},
|
|
85
|
+
}, doc.body, key, {
|
|
71
86
|
extend: [uikit.Box],
|
|
72
87
|
verbose: options.verbose,
|
|
73
88
|
...options.domqlOptions
|
|
74
89
|
})
|
|
75
|
-
|
|
90
|
+
|
|
76
91
|
return domqlElement
|
|
77
92
|
}
|
|
78
93
|
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/create",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.41",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "fe191d138564726ccb26fb5a6643c4d78709f0d3",
|
|
6
6
|
"source": "index.js",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"dependencies": {
|