@player-ui/data-change-listener-plugin 0.4.0-next.5 → 0.4.0-next.7

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.cjs.js CHANGED
@@ -99,7 +99,12 @@ class DataChangeListenerPlugin {
99
99
  const { silent = false } = options || {};
100
100
  if (silent)
101
101
  return;
102
- onFieldUpdateHandler(updates.map((t) => t.binding));
102
+ const validUpdates = updates.filter((update) => {
103
+ var _a;
104
+ const committedVal = (_a = options == null ? void 0 : options.context) == null ? void 0 : _a.model.get(update.binding);
105
+ return committedVal === update.newValue;
106
+ });
107
+ onFieldUpdateHandler(validUpdates.map((t) => t.binding));
103
108
  }));
104
109
  const resolveViewInterceptor = {
105
110
  call: (view) => {
package/dist/index.esm.js CHANGED
@@ -95,7 +95,12 @@ class DataChangeListenerPlugin {
95
95
  const { silent = false } = options || {};
96
96
  if (silent)
97
97
  return;
98
- onFieldUpdateHandler(updates.map((t) => t.binding));
98
+ const validUpdates = updates.filter((update) => {
99
+ var _a;
100
+ const committedVal = (_a = options == null ? void 0 : options.context) == null ? void 0 : _a.model.get(update.binding);
101
+ return committedVal === update.newValue;
102
+ });
103
+ onFieldUpdateHandler(validUpdates.map((t) => t.binding));
99
104
  }));
100
105
  const resolveViewInterceptor = {
101
106
  call: (view) => {
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "@player-ui/data-change-listener-plugin",
3
- "version": "0.4.0-next.5",
3
+ "version": "0.4.0-next.7",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org"
7
7
  },
8
8
  "peerDependencies": {
9
- "@player-ui/player": "0.4.0-next.5"
9
+ "@player-ui/player": "0.4.0-next.7"
10
10
  },
11
11
  "dependencies": {
12
12
  "@babel/runtime": "7.15.4"
package/src/index.ts CHANGED
@@ -230,7 +230,11 @@ export class DataChangeListenerPlugin implements PlayerPlugin {
230
230
  dc.hooks.onUpdate.tap(this.name, (updates, options) => {
231
231
  const { silent = false } = options || {};
232
232
  if (silent) return;
233
- onFieldUpdateHandler(updates.map((t) => t.binding));
233
+ const validUpdates = updates.filter((update) => {
234
+ const committedVal = options?.context?.model.get(update.binding);
235
+ return committedVal === update.newValue;
236
+ });
237
+ onFieldUpdateHandler(validUpdates.map((t) => t.binding));
234
238
  })
235
239
  );
236
240