@symbo.ls/create 2.11.135 → 2.11.136

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
@@ -56,6 +56,8 @@ const create = async (App, options = import_options.default, optionsExternalFile
56
56
  if (appIsKey)
57
57
  App = {};
58
58
  await (0, import_ferchOnCreate.fetchSync)(key, options);
59
+ if (typeof document === "undefined")
60
+ document = {};
59
61
  const doc = options.parent || options.document || document;
60
62
  const [scratchSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
61
63
  const state = options.state || {};
@@ -105,7 +107,15 @@ const createSync = (App, options = import_options.default, optionsExternalFile)
105
107
  const key = options.key || SYMBOLS_KEY || (appIsKey ? App : "");
106
108
  if (appIsKey)
107
109
  App = {};
108
- const doc = options.parent || options.document || document;
110
+ if (typeof document === "undefined")
111
+ document = { body: {} };
112
+ let parent;
113
+ if (options.parent)
114
+ parent = options.parent;
115
+ else if (options.document)
116
+ parent = options.document;
117
+ else
118
+ parent = document.body;
109
119
  const [scratchSystem, emotion, registry] = (0, import_initEmotion.initEmotion)(key, options);
110
120
  const state = options.state || {};
111
121
  const pages = options.pages || {};
@@ -130,9 +140,9 @@ const createSync = (App, options = import_options.default, optionsExternalFile)
130
140
  registry,
131
141
  emotion,
132
142
  //routerOptions,
133
- document: doc
143
+ document
134
144
  }
135
- }, doc.body, key, {
145
+ }, parent, key, {
136
146
  //extend: [uikit.Box],
137
147
  verbose: options.verbose,
138
148
  ...options.domqlOptions
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@symbo.ls/create",
3
- "version": "2.11.135",
3
+ "version": "2.11.136",
4
4
  "license": "MIT",
5
- "gitHead": "dc141236d426b13d6bb17214df425fcf21f7a2fc",
5
+ "gitHead": "72072245574e6d80ff12e379ed18a4507a164910",
6
6
  "files": [
7
7
  "src",
8
8
  "dist"
package/src/index.js CHANGED
@@ -31,6 +31,7 @@ export const create = async (App, options = DEFAULT_CREATE_OPTIONS, optionsExter
31
31
  if (appIsKey) App = {}
32
32
  await fetchSync(key, options)
33
33
 
34
+ if (typeof(document) === 'undefined') document = {}
34
35
  const doc = options.parent || options.document || document
35
36
  const [scratchSystem, emotion, registry] = initEmotion(key, options)
36
37
 
@@ -87,7 +88,13 @@ export const createSync = (App, options = DEFAULT_CREATE_OPTIONS, optionsExterna
87
88
 
88
89
  if (appIsKey) App = {}
89
90
 
90
- const doc = options.parent || options.document || document
91
+ // Set parent
92
+ if (typeof(document) === 'undefined') document = { body: {} }
93
+ let parent
94
+ if (options.parent) parent = options.parent
95
+ else if (options.document) parent = options.document
96
+ else parent = document.body
97
+
91
98
  const [scratchSystem, emotion, registry] = initEmotion(key, options)
92
99
 
93
100
  const state = options.state || {}
@@ -116,9 +123,9 @@ export const createSync = (App, options = DEFAULT_CREATE_OPTIONS, optionsExterna
116
123
  registry,
117
124
  emotion,
118
125
  //routerOptions,
119
- document: doc
126
+ document
120
127
  }
121
- }, doc.body, key, {
128
+ }, parent, key, {
122
129
  //extend: [uikit.Box],
123
130
  verbose: options.verbose,
124
131
  ...options.domqlOptions
package/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 symbo.ls
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.