@symbo.ls/create 2.11.222 → 2.11.236
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 +4048 -2789
- package/dist/cjs/initEmotion.js +2 -1
- package/dist/cjs/options.js +2 -1
- package/dist/cjs/router.js +1 -1
- package/package.json +2 -2
- package/src/index.js +17 -0
- package/src/initEmotion.js +3 -2
- package/src/options.js +2 -1
- package/src/router.js +1 -1
package/dist/cjs/initEmotion.js
CHANGED
|
@@ -44,7 +44,8 @@ const initEmotion = (key, options = import_options.DESIGN_SYSTEM_OPTIONS) => {
|
|
|
44
44
|
if (!initOptions.emotion)
|
|
45
45
|
initOptions.emotion = import_emotion2.emotion;
|
|
46
46
|
const registry = options.registry || (0, import_emotion.transformDOMQLEmotion)(initOptions.emotion, options);
|
|
47
|
-
const
|
|
47
|
+
const defaultDesignSystem = (0, import_utils.deepClone)(import_default_config.default);
|
|
48
|
+
const designSystem = options.useDefaultConfig ? (0, import_utils.deepMerge)(options.designSystem, defaultDesignSystem) : options.designSystem;
|
|
48
49
|
const scratchSystem = (0, import_init.init)(designSystem, {
|
|
49
50
|
key,
|
|
50
51
|
emotion,
|
package/dist/cjs/options.js
CHANGED
package/dist/cjs/router.js
CHANGED
|
@@ -71,7 +71,7 @@ const popStateRouter = (element, options) => {
|
|
|
71
71
|
import_utils.window.onpopstate = (e) => {
|
|
72
72
|
const { pathname, hash } = import_utils.window.location;
|
|
73
73
|
const url = pathname + hash;
|
|
74
|
-
router(url, element, {}, { pushState: false, level: 0 });
|
|
74
|
+
router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 });
|
|
75
75
|
};
|
|
76
76
|
};
|
|
77
77
|
const injectRouterInLinkComponent = (routerOptions) => {
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import DOM from 'domql'
|
|
4
4
|
import { deepMerge, isObject, isString } from '@domql/utils'
|
|
5
|
+
// import { checkIfKeyIsComponent } from '@domql/element/dist/cjs/component'
|
|
5
6
|
|
|
6
7
|
import * as utils from './utilImports'
|
|
7
8
|
import * as uikit from '@symbo.ls/uikit'
|
|
@@ -22,6 +23,21 @@ const mergeWithLocalFile = (options, optionsExternalFile) => {
|
|
|
22
23
|
return deepMerge(options, rcfile)
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
// const UIkitWithPrefix = () => {
|
|
27
|
+
// const newObj = {}
|
|
28
|
+
// for (const key in uikit) {
|
|
29
|
+
// if (Object.prototype.hasOwnProperty.call(uikit, key)) {
|
|
30
|
+
// if (checkIfKeyIsComponent(key)) {
|
|
31
|
+
// newObj[`smbls.${key}`] = uikit[key]
|
|
32
|
+
// } else {
|
|
33
|
+
// newObj[key] = uikit[key]
|
|
34
|
+
// }
|
|
35
|
+
// }
|
|
36
|
+
// }
|
|
37
|
+
// console.log(newObj, uikit)
|
|
38
|
+
// return newObj
|
|
39
|
+
// }
|
|
40
|
+
|
|
25
41
|
export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExternalFile) => {
|
|
26
42
|
const appIsKey = isString(App)
|
|
27
43
|
options = { ...DEFAULT_CREATE_OPTIONS, ...mergeWithLocalFile(options, optionsExternalFile) }
|
|
@@ -44,6 +60,7 @@ export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExter
|
|
|
44
60
|
if (App && App.state) deepMerge(state, App.state)
|
|
45
61
|
|
|
46
62
|
const pages = options.pages || {}
|
|
63
|
+
// const components = options.components ? { ...UIkitWithPrefix(), ...options.components } : UIkitWithPrefix()
|
|
47
64
|
const components = options.components ? { ...uikit, ...options.components } : uikit
|
|
48
65
|
const designSystem = scratcDesignhSystem || {}
|
|
49
66
|
const snippets = { ...utils, ...utils.scratchUtils, ...(options.snippets || {}) }
|
package/src/initEmotion.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { transformDOMQLEmotion } from '@domql/emotion'
|
|
4
4
|
import { emotion as defaultEmotion } from '@symbo.ls/emotion'
|
|
5
5
|
import { init } from '@symbo.ls/init'
|
|
6
|
-
import { deepClone } from '@domql/utils'
|
|
6
|
+
import { deepClone, deepMerge } from '@domql/utils'
|
|
7
7
|
|
|
8
8
|
import { DESIGN_SYSTEM_OPTIONS } from './options'
|
|
9
9
|
import DEFAULT_CONFIG from '@symbo.ls/default-config'
|
|
@@ -16,7 +16,8 @@ export const initEmotion = (key, options = DESIGN_SYSTEM_OPTIONS) => {
|
|
|
16
16
|
if (!initOptions.emotion) initOptions.emotion = defaultEmotion
|
|
17
17
|
|
|
18
18
|
const registry = options.registry || transformDOMQLEmotion(initOptions.emotion, options)
|
|
19
|
-
const
|
|
19
|
+
const defaultDesignSystem = deepClone(DEFAULT_CONFIG)
|
|
20
|
+
const designSystem = options.useDefaultConfig ? deepMerge(options.designSystem, defaultDesignSystem) : options.designSystem
|
|
20
21
|
|
|
21
22
|
const scratchSystem = init(designSystem, {
|
|
22
23
|
key,
|
package/src/options.js
CHANGED
package/src/router.js
CHANGED
|
@@ -52,7 +52,7 @@ export const popStateRouter = (element, options) => {
|
|
|
52
52
|
window.onpopstate = e => {
|
|
53
53
|
const { pathname, hash } = window.location
|
|
54
54
|
const url = pathname + hash
|
|
55
|
-
router(url, element, {}, { pushState: false, level: 0 })
|
|
55
|
+
router(url, element, {}, { pushState: false, scrollToTop: false, level: 0 })
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
|