@symbo.ls/create 2.11.138 → 2.11.144

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/index.js CHANGED
@@ -60,7 +60,13 @@ const create = async (App, options = import_options.default, optionsExternalFile
60
60
  window.document = {};
61
61
  const doc = options.parent || options.document || document;
62
62
  const [scratchSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
63
- const state = options.state || {};
63
+ let state;
64
+ if (options.state)
65
+ state = options.state;
66
+ else if (App == null ? void 0 : App.state)
67
+ state = App.state;
68
+ else
69
+ state = {};
64
70
  const pages = options.pages || {};
65
71
  const components = options.components ? { ...uikit, ...options.components } : uikit;
66
72
  const designSystem = scratchSystem || {};
@@ -108,7 +114,7 @@ const createSync = (App, options = import_options.default, optionsExternalFile)
108
114
  if (appIsKey)
109
115
  App = {};
110
116
  if (typeof document === "undefined")
111
- document = { body: {} };
117
+ window.document = { body: {} };
112
118
  let parent;
113
119
  if (options.parent)
114
120
  parent = options.parent;
@@ -117,7 +123,13 @@ const createSync = (App, options = import_options.default, optionsExternalFile)
117
123
  else
118
124
  parent = document.body;
119
125
  const [scratchSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
120
- const state = options.state || {};
126
+ let state;
127
+ if (options.state)
128
+ state = options.state;
129
+ else if (App == null ? void 0 : App.state)
130
+ state = App.state;
131
+ else
132
+ state = {};
121
133
  const pages = options.pages || {};
122
134
  const components = options.components ? { ...uikit, ...options.components } : uikit;
123
135
  const designSystem = scratchSystem || {};
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.138",
3
+ "version": "2.11.144",
4
4
  "license": "MIT",
5
- "gitHead": "d106932603cf5402acd55e4c03b8163f9beccc5c",
5
+ "gitHead": "55bad058b20f9df61004931a56efc2ee8d221cef",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
package/src/index.js CHANGED
@@ -35,7 +35,11 @@ export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExter
35
35
  const doc = options.parent || options.document || document
36
36
  const [scratchSystem, emotion, registry] = initEmotion(key, options)
37
37
 
38
- const state = options.state || {}
38
+ let state
39
+ if (options.state) state = options.state
40
+ else if (App?.state) state = App.state
41
+ else state = {}
42
+
39
43
  const pages = options.pages || {}
40
44
  const components = options.components ? { ...uikit, ...options.components } : uikit
41
45
  const designSystem = scratchSystem || {}
@@ -89,7 +93,7 @@ export const createSync = (App, options = DEFAULT_CREATE_OPTIONS, optionsExterna
89
93
  if (appIsKey) App = {}
90
94
 
91
95
  // Set parent
92
- if (typeof (document) === 'undefined') document = { body: {} }
96
+ if (typeof (document) === 'undefined') window.document = { body: {} }
93
97
  let parent
94
98
  if (options.parent) parent = options.parent
95
99
  else if (options.document) parent = options.document
@@ -97,7 +101,11 @@ export const createSync = (App, options = DEFAULT_CREATE_OPTIONS, optionsExterna
97
101
 
98
102
  const [scratchSystem, emotion, registry] = initEmotion(key, options)
99
103
 
100
- const state = options.state || {}
104
+ let state
105
+ if (options.state) state = options.state
106
+ else if (App?.state) state = App.state
107
+ else state = {}
108
+
101
109
  const pages = options.pages || {}
102
110
  const components = options.components ? { ...uikit, ...options.components } : uikit
103
111
  const designSystem = scratchSystem || {}