@symbo.ls/create 2.10.17 → 2.10.19
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/define.js +18 -1
- package/index.js +5 -10
- package/package.json +2 -2
package/define.js
CHANGED
|
@@ -3,8 +3,25 @@
|
|
|
3
3
|
import { Collection } from '@symbo.ls/uikit'
|
|
4
4
|
|
|
5
5
|
export const define = {
|
|
6
|
-
__filepath: param => param,
|
|
7
6
|
routes: param => param,
|
|
7
|
+
|
|
8
|
+
$router: (param, el) => {
|
|
9
|
+
if (!param) return
|
|
10
|
+
|
|
11
|
+
const obj = { tag: 'fragment', ...param }
|
|
12
|
+
|
|
13
|
+
const set = () => {
|
|
14
|
+
el.set(obj, { preventDefineUpdate: '$router' })
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
if (el.props.lazyLoad) {
|
|
18
|
+
window.requestAnimationFrame(set)
|
|
19
|
+
} else set()
|
|
20
|
+
|
|
21
|
+
return obj
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
__filepath: param => param,
|
|
8
25
|
__collectionCache: param => param,
|
|
9
26
|
$setCollection: Collection.define.$setCollection,
|
|
10
27
|
__stateCollectionCache: param => param,
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
3
|
import DOM from 'domql'
|
|
4
|
-
import { isString, overwriteDeep } from '@domql/utils'
|
|
4
|
+
import { isString, overwriteDeep, deepDestringify } from '@domql/utils'
|
|
5
5
|
|
|
6
6
|
import * as smbls from '@symbo.ls/uikit'
|
|
7
7
|
import { init, DYNAMIC_JSON } from '@symbo.ls/init' // eslint-disable-line no-unused-vars
|
|
@@ -23,29 +23,24 @@ const defaultOptions = {
|
|
|
23
23
|
define
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
export const create =
|
|
26
|
+
export const create = (App, options = defaultOptions) => {
|
|
27
27
|
const appIsKey = isString(App)
|
|
28
28
|
const key = options.key || SYMBOLS_KEY || (appIsKey && App)
|
|
29
29
|
|
|
30
30
|
if (appIsKey) App = {}
|
|
31
31
|
if (key) {
|
|
32
32
|
if (options.remote) {
|
|
33
|
-
const data =
|
|
34
|
-
|
|
33
|
+
const data = fetchRemote(key, { endpoint: options.endpoint })
|
|
34
|
+
const evalData = deepDestringify(data)
|
|
35
|
+
overwriteDeep(evalData, options)
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
38
|
|
|
38
|
-
console.log(App, options)
|
|
39
|
-
|
|
40
39
|
const components = { ...smbls, ...options.components }
|
|
41
40
|
const designSystem = init(options.system)
|
|
42
41
|
|
|
43
42
|
DOM.define(options.define || define)
|
|
44
43
|
|
|
45
|
-
console.group(key)
|
|
46
|
-
console.dir(options)
|
|
47
|
-
console.groupEnd(key)
|
|
48
|
-
|
|
49
44
|
return DOM.create({
|
|
50
45
|
extend: [App, {
|
|
51
46
|
routes: options.pages,
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@symbo.ls/create",
|
|
3
|
-
"version": "2.10.
|
|
3
|
+
"version": "2.10.19",
|
|
4
4
|
"license": "MIT",
|
|
5
|
-
"gitHead": "
|
|
5
|
+
"gitHead": "b92cd34ea33622b491ed9199823c23f26d27a7e9",
|
|
6
6
|
"source": "index.js",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"dependencies": {
|