arc-ux 0.0.2 → 0.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/ArcUX.js +7 -8
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arc-ux",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "A purely functional router for independently evaluating a path against a list of routes",
5
5
  "main": "src/ArcUX.js",
6
6
  "type": "module",
package/src/ArcUX.js CHANGED
@@ -20,7 +20,7 @@ class ArcUX {
20
20
  #currentTheme;
21
21
  #apis = {};
22
22
  #environment = 'production';
23
- #rootPath = '/cloud';
23
+ #rootPath = '';
24
24
  #keyVal = {};
25
25
 
26
26
  #forms = {};
@@ -99,21 +99,16 @@ class ArcUX {
99
99
  }
100
100
 
101
101
  bindRoute(_route, _Component, _Shell=null) {
102
- this.#routeMap[_route] = { Component: _Component, Shell: _Shell };
102
+ this.#routeMap[`${this.#rootPath}${_route}`] = { Component: _Component, Shell: _Shell };
103
103
  this.#RouteRenderer.setMap(this.#routeMap);
104
- Log.dPink(`Bind Route?`, this.#routeMap);
105
104
  }
106
105
 
107
106
  renderRoute(_route) {
108
107
  const routeData = this.#RouteRenderer.travel(_route)
109
- Log.dRed('RouteData?', routeData);
110
- Log.dYellow('Router?', this.#RouteRenderer);
111
108
  if (routeData.match) {
112
109
  return routeData.match;
113
110
  }
114
111
 
115
- Log.dGreen('NotFound?', this.#handlers);
116
-
117
112
  if(this.getHandler('NotFound')){
118
113
  return this.getHandler('NotFound');
119
114
  }
@@ -139,8 +134,12 @@ class ArcUX {
139
134
  this.#Html.addHeadElement(_headElement)
140
135
  }
141
136
 
137
+ htmlAddWindowVar(key, val){
138
+ this.#Html.addWindowVariable(key, val);
139
+ }
140
+
142
141
  loadPage(_route, _suppressEmit=false) {
143
- this.setKeyVal('route', _route, _suppressEmit);
142
+ this.setKeyVal('route', `${this.#rootPath}${_route}`, _suppressEmit);
144
143
  }
145
144
 
146
145
  renderModal(_Modal, _props) {