@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.
@@ -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 designSystem = options.designSystem || (options.defaultConfig ? (0, import_utils.deepClone)(import_default_config.default) : {});
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,
@@ -30,7 +30,8 @@ const DESIGN_SYSTEM_OPTIONS = {
30
30
  useIconSprite: true,
31
31
  useSvgSprite: true,
32
32
  useDocumentTheme: true,
33
- useFontImport: true
33
+ useFontImport: true,
34
+ useDefaultConfig: true
34
35
  };
35
36
  const CREATE_OPTIONS = {
36
37
  defaultConfig: true,
@@ -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
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.222",
3
+ "version": "2.11.236",
4
4
  "license": "MIT",
5
- "gitHead": "6e6a08383cbffe4c4ed682998b6c7610db57a000",
5
+ "gitHead": "d2a083322de551a55d184ccd6d3933ab465c209e",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
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 || {}) }
@@ -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 designSystem = options.designSystem || (options.defaultConfig ? deepClone(DEFAULT_CONFIG) : {})
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
@@ -8,7 +8,8 @@ export const DESIGN_SYSTEM_OPTIONS = {
8
8
  useIconSprite: true,
9
9
  useSvgSprite: true,
10
10
  useDocumentTheme: true,
11
- useFontImport: true
11
+ useFontImport: true,
12
+ useDefaultConfig: true
12
13
  }
13
14
 
14
15
  export const CREATE_OPTIONS = {
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