smbls 2.9.13 → 2.10.3
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/index.js +7 -9
- package/dist/index.js.map +3 -3
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -8388,7 +8388,7 @@ __reExport(smbls_exports, __toESM(require_dist()), module.exports);
|
|
|
8388
8388
|
|
|
8389
8389
|
// ../fetch/index.js
|
|
8390
8390
|
var BACKEND_URL = window.location.host.includes("local") ? "localhost:13335" : "api.symbols.app";
|
|
8391
|
-
var
|
|
8391
|
+
var fetchRemote = async (key, route) => {
|
|
8392
8392
|
let data = {};
|
|
8393
8393
|
await window.fetch(`https://${BACKEND_URL}/${route || ""}`, {
|
|
8394
8394
|
method: "GET",
|
|
@@ -8423,23 +8423,20 @@ var defaultOptions = {
|
|
|
8423
8423
|
components: {},
|
|
8424
8424
|
define
|
|
8425
8425
|
};
|
|
8426
|
-
var create2 = (App, options = defaultOptions) => {
|
|
8427
|
-
const designSystem = init2(options.system);
|
|
8426
|
+
var create2 = async (App, options = defaultOptions) => {
|
|
8428
8427
|
const appIsKey = isString(App);
|
|
8429
8428
|
const key = options.key || SYMBOLS_KEY || appIsKey && App;
|
|
8430
|
-
console.log(App, options, key);
|
|
8431
8429
|
if (appIsKey)
|
|
8432
8430
|
App = {};
|
|
8433
8431
|
if (key) {
|
|
8434
8432
|
if (options.remote) {
|
|
8435
|
-
const data =
|
|
8433
|
+
const data = await fetchRemote(key);
|
|
8434
|
+
console.log(data);
|
|
8436
8435
|
overwriteDeep(data, options);
|
|
8437
8436
|
}
|
|
8438
8437
|
}
|
|
8439
|
-
const
|
|
8440
|
-
|
|
8441
|
-
src_default.define(options.define);
|
|
8442
|
-
console.log(options.state);
|
|
8438
|
+
const designSystem = init2(options.system);
|
|
8439
|
+
src_default.define(options.define || define);
|
|
8443
8440
|
return src_default.create({
|
|
8444
8441
|
extend: [App, {
|
|
8445
8442
|
routes: options.pages,
|
|
@@ -8448,6 +8445,7 @@ var create2 = (App, options = defaultOptions) => {
|
|
|
8448
8445
|
}, null, "app", {
|
|
8449
8446
|
extend: [Box],
|
|
8450
8447
|
context: {
|
|
8448
|
+
key,
|
|
8451
8449
|
components: { ...src_exports, ...options.components },
|
|
8452
8450
|
state: options.state,
|
|
8453
8451
|
pages: options.pages,
|