wapplr 1.0.65 → 1.0.67

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.
@@ -118,23 +118,22 @@ function createDefaultStateManager() {
118
118
 
119
119
  var found;
120
120
  find(keys.split("."), state);
121
- return typeof found === "object" && found ? (0, _utils.copyObject)(found) : found;
121
+ return typeof found === "object" && found ? typeof structuredClone !== 'undefined' ? structuredClone(found) : (0, _utils.copyObject)(found) : found;
122
122
  }
123
123
 
124
- try {
125
- if (!cachedString) {
126
- cachedString = JSON.stringify(state);
127
- }
124
+ if (typeof structuredClone !== 'undefined') {
125
+ return structuredClone(state);
126
+ }
128
127
 
129
- return JSON.parse(cachedString);
128
+ try {
129
+ return JSON.parse(JSON.stringify(state));
130
130
  } catch (e) {
131
131
  console.log(e);
132
132
  state = {};
133
133
  Object.keys(initialState).forEach(function (key) {
134
134
  state[key] = initialState[key];
135
135
  });
136
- cachedString = JSON.stringify(state);
137
- return JSON.parse(cachedString);
136
+ return JSON.parse(JSON.stringify(state));
138
137
  }
139
138
  },
140
139
  dispatch: function dispatch(action) {
@@ -144,8 +143,6 @@ function createDefaultStateManager() {
144
143
  console.log(e);
145
144
  }
146
145
 
147
- cachedString = "";
148
-
149
146
  try {
150
147
  stateManager.runListeners(action);
151
148
  } catch (e) {
@@ -65,7 +65,7 @@ function createDefaultStyleManager() {
65
65
  }
66
66
 
67
67
  function defaultAdd(style) {
68
- var cssText = style._getCss();
68
+ var cssText = style._getCss ? style._getCss() : '';
69
69
 
70
70
  style._insertCss = function _insertCss() {
71
71
  var insertCss = styleManager.insertCss;
@@ -122,7 +122,7 @@ function createDefaultStyleManager() {
122
122
  WAPP = _globals$WAPP === void 0 ? "buildHash" : _globals$WAPP,
123
123
  DEV = globals.DEV;
124
124
  var cssText = (0, _toConsumableArray2["default"])(styleManager.css).map(function (style) {
125
- return style._getCss();
125
+ return style._getCss ? style._getCss() : '';
126
126
  }).join("");
127
127
 
128
128
  if (!DEV) {
package/package.json CHANGED
@@ -22,7 +22,7 @@
22
22
  "files": [
23
23
  "dist/*"
24
24
  ],
25
- "version": "1.0.65",
25
+ "version": "1.0.67",
26
26
  "main": "dist/server",
27
27
  "browser": "dist/client",
28
28
  "repository": {