@symbo.ls/create 2.11.26 → 2.11.39

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/ferchOnCreate.js CHANGED
@@ -1,6 +1,7 @@
1
1
  'use strict'
2
2
 
3
- import { fetchProject, fetchStateAsync } from '@symbo.ls/fetch'
3
+ import { isObject } from '@domql/utils'
4
+ import { fetchProject, fetchProjectAsync } from '@symbo.ls/fetch'
4
5
 
5
6
  export const fetchSync = async (key, options) => {
6
7
  if (key && options.editor) {
@@ -15,8 +16,15 @@ export const fetchSync = async (key, options) => {
15
16
  export const fetchAsync = (app, key, options, callback) => {
16
17
  if (key && options.editor) {
17
18
  try {
18
- const defaultCallback = (data) => app.state.set(data)
19
- if (options.editor.async) fetchStateAsync(key, options, callback || defaultCallback)
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
+ }
26
+ }
27
+ if (options.editor.async) fetchProjectAsync(key, options, callback || defaultCallback)
20
28
  } catch (e) {
21
29
  console.error(e)
22
30
  }
package/index.js CHANGED
@@ -71,7 +71,10 @@ export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExter
71
71
  applyInspectListener(domqlApp, options)
72
72
  popStateRouter(domqlApp, options)
73
73
  if (options.on && options.on.create) options.on.create(domqlApp, options)
74
- fetchAsync(domqlApp, key, options)
74
+ fetchAsync(domqlApp, key, {
75
+ utils,
76
+ ...options
77
+ })
75
78
 
76
79
  return domqlApp
77
80
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.26",
3
+ "version": "2.11.39",
4
4
  "license": "MIT",
5
- "gitHead": "38079adee748d068bdd5edb21b5925f5f58b3ce6",
5
+ "gitHead": "2f40754c45ab3e9132e5335d3f01fcf7d2ac977b",
6
6
  "source": "index.js",
7
7
  "main": "index.js",
8
8
  "dependencies": {