@symbo.ls/create 2.11.310 → 2.11.312

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.
@@ -37,16 +37,16 @@ const fetchSync = async (key, options) => {
37
37
  const fetchAsync = (app, key, options, callback) => {
38
38
  if (key && options.editor) {
39
39
  try {
40
- const defaultCallback = (data) => {
41
- if ((0, import_utils.isObject)(data.designsystem)) {
42
- options.utils.init(data.designsystem);
43
- }
44
- if ((0, import_utils.isObject)(data.state)) {
45
- app.state.set(data.state);
46
- }
47
- };
48
- if (options.editor.async)
49
- (0, import_fetch.fetchProjectAsync)(key, options, callback || defaultCallback);
40
+ if (options.editor.async) {
41
+ (0, import_fetch.fetchProjectAsync)(key, options, callback || ((data) => {
42
+ if ((0, import_utils.isObject)(data.designsystem)) {
43
+ options.utils.init(data.designsystem);
44
+ }
45
+ if ((0, import_utils.isObject)(data.state)) {
46
+ app.state.set(data.state);
47
+ }
48
+ }));
49
+ }
50
50
  } catch (e) {
51
51
  console.error(e);
52
52
  }
@@ -45,7 +45,7 @@ const initEmotion = (key, options = {}) => {
45
45
  initOptions.emotion = import_emotion2.emotion;
46
46
  const registry = options.registry || (0, import_emotion.transformDOMQLEmotion)(initOptions.emotion, options);
47
47
  const defaultDesignSystem = (0, import_utils.deepClone)(import_default_config.default);
48
- const designSystem = initOptions.useDefaultConfig ? (0, import_utils.deepMerge)(options.designSystem, defaultDesignSystem) : options.designSystem || defaultDesignSystem;
48
+ const designSystem = options.useDefaultConfig ? (0, import_utils.deepMerge)(options.designSystem, defaultDesignSystem) : options.designSystem || defaultDesignSystem;
49
49
  const scratchSystem = (0, import_init.init)(designSystem, {
50
50
  key,
51
51
  emotion,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.310",
3
+ "version": "2.11.312",
4
4
  "license": "MIT",
5
- "gitHead": "3e774509842b471eda7cd8d34ea79bd8c70c79a9",
5
+ "gitHead": "513a605a59275b54c8a81b82ce6e7d7177521da9",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
@@ -16,15 +16,16 @@ export const fetchSync = async (key, options) => {
16
16
  export const fetchAsync = (app, key, options, callback) => {
17
17
  if (key && options.editor) {
18
18
  try {
19
- const defaultCallback = (data) => {
20
- if (isObject(data.designsystem)) {
21
- options.utils.init(data.designsystem)
22
- }
23
- if (isObject(data.state)) {
24
- app.state.set(data.state)
25
- }
19
+ if (options.editor.async) {
20
+ fetchProjectAsync(key, options, callback || ((data) => {
21
+ if (isObject(data.designsystem)) {
22
+ options.utils.init(data.designsystem)
23
+ }
24
+ if (isObject(data.state)) {
25
+ app.state.set(data.state)
26
+ }
27
+ }))
26
28
  }
27
- if (options.editor.async) fetchProjectAsync(key, options, callback || defaultCallback)
28
29
  } catch (e) {
29
30
  console.error(e)
30
31
  }
@@ -17,7 +17,7 @@ export const initEmotion = (key, options = {}) => {
17
17
 
18
18
  const registry = options.registry || transformDOMQLEmotion(initOptions.emotion, options)
19
19
  const defaultDesignSystem = deepClone(DEFAULT_CONFIG)
20
- const designSystem = initOptions.useDefaultConfig ? deepMerge(options.designSystem, defaultDesignSystem) : options.designSystem || defaultDesignSystem
20
+ const designSystem = options.useDefaultConfig ? deepMerge(options.designSystem, defaultDesignSystem) : options.designSystem || defaultDesignSystem
21
21
 
22
22
  const scratchSystem = init(designSystem, {
23
23
  key,