roboto-js 1.9.11 → 1.9.12

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/.last-build CHANGED
@@ -1 +1 @@
1
- 2026-01-21T10:14:33.592Z
1
+ 2026-02-01T14:32:37.319Z
@@ -135,10 +135,11 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
135
135
  if (!_lodash["default"].isEqual(currentValue, mergedValue)) {
136
136
  _lodash["default"].set(this._data, path, mergedValue); // Set the merged value at the deep path
137
137
  this._addChange(path);
138
- // Trigger local change events for any registered handlers
138
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
139
139
  this._trigger('change', {
140
140
  path: path,
141
141
  value: mergedValue,
142
+ source: options.source || 'local',
142
143
  options: options
143
144
  });
144
145
  }
@@ -147,20 +148,22 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
147
148
  if (value === undefined) {
148
149
  _lodash["default"].unset(this._data, path);
149
150
  this._addChange(path);
150
- // Trigger local change events for any registered handlers
151
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
151
152
  this._trigger('change', {
152
153
  path: path,
153
154
  value: undefined,
155
+ source: options.source || 'local',
154
156
  options: options
155
157
  });
156
158
  } else if (!_lodash["default"].isEqual(currentValue, value)) {
157
159
  _lodash["default"].set(this._data, path, value); // Set the value directly at the deep path
158
160
  this._addChange(path);
159
161
  this._broadcastChange(path, value);
160
- // Trigger local change events for any registered handlers
162
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
161
163
  this._trigger('change', {
162
164
  path: path,
163
165
  value: value,
166
+ source: options.source || 'local',
164
167
  options: options
165
168
  });
166
169
  }
@@ -192,10 +195,10 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
192
195
  if (!_lodash["default"].isEqual(currentValue, mergedValue)) {
193
196
  _lodash["default"].set(_this2._data, path, mergedValue);
194
197
  _this2._addChange(path);
195
- // Trigger change event for this path
196
198
  _this2._trigger('change', {
197
199
  path: path,
198
200
  value: mergedValue,
201
+ source: options.source || 'local',
199
202
  options: options
200
203
  });
201
204
  }
@@ -207,10 +210,10 @@ var RbtObject = exports["default"] = /*#__PURE__*/function () {
207
210
  return nsValue;
208
211
  });
209
212
  _this2._addChange(path);
210
- // Trigger change event for this path
211
213
  _this2._trigger('change', {
212
214
  path: path,
213
215
  value: newValue,
216
+ source: options.source || 'local',
214
217
  options: options
215
218
  });
216
219
  }
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.version = void 0;
7
7
  // Auto-generated version file
8
8
  // DO NOT EDIT - This file is automatically updated from package.cjson
9
- // Version: 1.9.11
10
- var version = exports.version = '1.9.11';
9
+ // Version: 1.9.12
10
+ var version = exports.version = '1.9.12';
@@ -128,10 +128,11 @@ var RbtObject = /*#__PURE__*/function () {
128
128
  if (!_.isEqual(currentValue, mergedValue)) {
129
129
  _.set(this._data, path, mergedValue); // Set the merged value at the deep path
130
130
  this._addChange(path);
131
- // Trigger local change events for any registered handlers
131
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
132
132
  this._trigger('change', {
133
133
  path: path,
134
134
  value: mergedValue,
135
+ source: options.source || 'local',
135
136
  options: options
136
137
  });
137
138
  }
@@ -140,20 +141,22 @@ var RbtObject = /*#__PURE__*/function () {
140
141
  if (value === undefined) {
141
142
  _.unset(this._data, path);
142
143
  this._addChange(path);
143
- // Trigger local change events for any registered handlers
144
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
144
145
  this._trigger('change', {
145
146
  path: path,
146
147
  value: undefined,
148
+ source: options.source || 'local',
147
149
  options: options
148
150
  });
149
151
  } else if (!_.isEqual(currentValue, value)) {
150
152
  _.set(this._data, path, value); // Set the value directly at the deep path
151
153
  this._addChange(path);
152
154
  this._broadcastChange(path, value);
153
- // Trigger local change events for any registered handlers
155
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
154
156
  this._trigger('change', {
155
157
  path: path,
156
158
  value: value,
159
+ source: options.source || 'local',
157
160
  options: options
158
161
  });
159
162
  }
@@ -185,10 +188,10 @@ var RbtObject = /*#__PURE__*/function () {
185
188
  if (!_.isEqual(currentValue, mergedValue)) {
186
189
  _.set(_this2._data, path, mergedValue);
187
190
  _this2._addChange(path);
188
- // Trigger change event for this path
189
191
  _this2._trigger('change', {
190
192
  path: path,
191
193
  value: mergedValue,
194
+ source: options.source || 'local',
192
195
  options: options
193
196
  });
194
197
  }
@@ -200,10 +203,10 @@ var RbtObject = /*#__PURE__*/function () {
200
203
  return nsValue;
201
204
  });
202
205
  _this2._addChange(path);
203
- // Trigger change event for this path
204
206
  _this2._trigger('change', {
205
207
  path: path,
206
208
  value: newValue,
209
+ source: options.source || 'local',
207
210
  options: options
208
211
  });
209
212
  }
@@ -1,4 +1,4 @@
1
1
  // Auto-generated version file
2
2
  // DO NOT EDIT - This file is automatically updated from package.json
3
- // Version: 1.9.11
4
- export var version = '1.9.11';
3
+ // Version: 1.9.12
4
+ export var version = '1.9.12';
package/dist/rbt_api.js CHANGED
@@ -70,7 +70,7 @@ var RbtApi = /*#__PURE__*/function () {
70
70
  if (localStorageAdaptor) {
71
71
  // must implement getItem, setItem interface
72
72
  this.localStorageAdaptor = localStorageAdaptor;
73
- } else if (typeof localStorage != 'undefined') {
73
+ } else if (typeof localStorage != 'undefined' && typeof localStorage.getItem === 'function' && typeof localStorage.setItem === 'function' && typeof localStorage.removeItem === 'function') {
74
74
  // browser based local storage
75
75
  this.localStorageAdaptor = {
76
76
  getItem: function getItem(key) {
package/dist/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Auto-generated version file
2
2
  // DO NOT EDIT - This file is automatically updated from package.json
3
- // Version: 1.9.10
4
- export var version = '1.9.10';
3
+ // Version: 1.9.11
4
+ export var version = '1.9.11';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "roboto-js",
3
- "version": "1.9.11",
3
+ "version": "1.9.12",
4
4
  "type": "module",
5
5
  "description": "",
6
6
  "main": "dist/cjs/index.cjs",
package/src/rbt_object.js CHANGED
@@ -100,22 +100,22 @@ export default class RbtObject{
100
100
  if (!_.isEqual(currentValue, mergedValue)) {
101
101
  _.set(this._data, path, mergedValue); // Set the merged value at the deep path
102
102
  this._addChange(path);
103
- // Trigger local change events for any registered handlers
104
- this._trigger('change', { path, value: mergedValue, options });
103
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
104
+ this._trigger('change', { path, value: mergedValue, source: options.source || 'local', options });
105
105
  }
106
106
  } else {
107
107
  // If value is undefined and not merging, delete the key
108
108
  if (value === undefined) {
109
109
  _.unset(this._data, path);
110
110
  this._addChange(path);
111
- // Trigger local change events for any registered handlers
112
- this._trigger('change', { path, value: undefined, options });
111
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
112
+ this._trigger('change', { path, value: undefined, source: options.source || 'local', options });
113
113
  } else if (!_.isEqual(currentValue, value)) {
114
114
  _.set(this._data, path, value); // Set the value directly at the deep path
115
115
  this._addChange(path);
116
116
  this._broadcastChange(path, value);
117
- // Trigger local change events for any registered handlers
118
- this._trigger('change', { path, value, options });
117
+ // Trigger local change events for any registered handlers (source so Save/unsaved detection works)
118
+ this._trigger('change', { path, value, source: options.source || 'local', options });
119
119
  }
120
120
  }
121
121
  }
@@ -145,8 +145,7 @@ export default class RbtObject{
145
145
  if (!_.isEqual(currentValue, mergedValue)) {
146
146
  _.set(this._data, path, mergedValue);
147
147
  this._addChange(path);
148
- // Trigger change event for this path
149
- this._trigger('change', { path, value: mergedValue, options });
148
+ this._trigger('change', { path, value: mergedValue, source: options.source || 'local', options });
150
149
  }
151
150
  } else if (!_.isEqual(currentValue, newValue)) {
152
151
  _.setWith(this._data, path, newValue, (nsValue, key, nsObject, nsPath) => {
@@ -156,8 +155,7 @@ export default class RbtObject{
156
155
  return nsValue;
157
156
  });
158
157
  this._addChange(path);
159
- // Trigger change event for this path
160
- this._trigger('change', { path, value: newValue, options });
158
+ this._trigger('change', { path, value: newValue, source: options.source || 'local', options });
161
159
  }
162
160
  });
163
161
  }
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  // Auto-generated version file
2
2
  // DO NOT EDIT - This file is automatically updated from package.json
3
- // Version: 1.9.11
4
- export const version = '1.9.11';
3
+ // Version: 1.9.12
4
+ export const version = '1.9.12';