smbls 2.10.3 → 2.10.8

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 CHANGED
@@ -2987,6 +2987,51 @@ var require_dist2 = __commonJS({
2987
2987
  }
2988
2988
  });
2989
2989
 
2990
+ // ../fetch/dist/index.js
2991
+ var require_dist3 = __commonJS({
2992
+ "../fetch/dist/index.js"(exports, module2) {
2993
+ "use strict";
2994
+ var __defProp2 = Object.defineProperty;
2995
+ var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
2996
+ var __getOwnPropNames2 = Object.getOwnPropertyNames;
2997
+ var __hasOwnProp2 = Object.prototype.hasOwnProperty;
2998
+ var __export2 = (target, all) => {
2999
+ for (var name in all)
3000
+ __defProp2(target, name, { get: all[name], enumerable: true });
3001
+ };
3002
+ var __copyProps2 = (to, from2, except, desc) => {
3003
+ if (from2 && typeof from2 === "object" || typeof from2 === "function") {
3004
+ for (let key of __getOwnPropNames2(from2))
3005
+ if (!__hasOwnProp2.call(to, key) && key !== except)
3006
+ __defProp2(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc2(from2, key)) || desc.enumerable });
3007
+ }
3008
+ return to;
3009
+ };
3010
+ var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
3011
+ var fetch_exports = {};
3012
+ __export2(fetch_exports, {
3013
+ fetch: () => fetch,
3014
+ fetchRemote: () => fetchRemote2
3015
+ });
3016
+ module2.exports = __toCommonJS2(fetch_exports);
3017
+ var SERVER_URL = window.location.host.includes("local") ? "localhost:13335" : "api.symbols.app";
3018
+ var defaultOptions2 = {
3019
+ endpoint: SERVER_URL
3020
+ };
3021
+ var fetchRemote2 = async (key, options = defaultOptions2) => {
3022
+ let data = {};
3023
+ await window.fetch(`https://${options.endpoint}/${options.route || ""}`, {
3024
+ method: "GET",
3025
+ headers: { "Content-Type": "application/json", "X-AppKey": key }
3026
+ }).then((response) => {
3027
+ return response.json().then((d) => data = d);
3028
+ });
3029
+ return data;
3030
+ };
3031
+ var fetch = fetchRemote2;
3032
+ }
3033
+ });
3034
+
2990
3035
  // index.js
2991
3036
  var smbls_exports = {};
2992
3037
  __export(smbls_exports, {
@@ -8386,18 +8431,8 @@ var RangeWithButtons = {
8386
8431
  // index.js
8387
8432
  __reExport(smbls_exports, __toESM(require_dist()), module.exports);
8388
8433
 
8389
- // ../fetch/index.js
8390
- var BACKEND_URL = window.location.host.includes("local") ? "localhost:13335" : "api.symbols.app";
8391
- var fetchRemote = async (key, route) => {
8392
- let data = {};
8393
- await window.fetch(`https://${BACKEND_URL}/${route || ""}`, {
8394
- method: "GET",
8395
- headers: { "Content-Type": "application/json", "X-AppKey": key }
8396
- }).then((response) => {
8397
- return response.json().then((d) => data = d);
8398
- });
8399
- return data;
8400
- };
8434
+ // ../create/index.js
8435
+ var import_fetch = __toESM(require_dist3());
8401
8436
 
8402
8437
  // ../create/define.js
8403
8438
  var define = {
@@ -8414,6 +8449,7 @@ var define = {
8414
8449
  // ../create/index.js
8415
8450
  var { SYMBOLS_KEY } = process.env;
8416
8451
  var defaultOptions = {
8452
+ endpoint: "localhost:13335",
8417
8453
  state: {},
8418
8454
  pages: {},
8419
8455
  system: {
@@ -8430,8 +8466,7 @@ var create2 = async (App, options = defaultOptions) => {
8430
8466
  App = {};
8431
8467
  if (key) {
8432
8468
  if (options.remote) {
8433
- const data = await fetchRemote(key);
8434
- console.log(data);
8469
+ const data = await (0, import_fetch.fetchRemote)(key, { endpoint: options.endpoint });
8435
8470
  overwriteDeep(data, options);
8436
8471
  }
8437
8472
  }