@wise/dynamic-flow-client 4.2.0 → 4.2.1
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/build/main.js
CHANGED
|
@@ -10991,7 +10991,7 @@ var formatDateOptions = {
|
|
|
10991
10991
|
};
|
|
10992
10992
|
|
|
10993
10993
|
// src/revamp/utils/findComponent.ts
|
|
10994
|
-
var findComponent = (components, id) => {
|
|
10994
|
+
var findComponent = (components, id, logEvent) => {
|
|
10995
10995
|
const flattened = flattenComponents(components);
|
|
10996
10996
|
const matching = flattened.filter((component) => component.uid === id);
|
|
10997
10997
|
if (matching.length === 1) {
|
|
@@ -11000,6 +11000,10 @@ var findComponent = (components, id) => {
|
|
|
11000
11000
|
if (matching.length > 1) {
|
|
11001
11001
|
throw new Error(`Multiple components with the same uid: ${id}`);
|
|
11002
11002
|
}
|
|
11003
|
+
logEvent("error", "Failed to find domain layer component", {
|
|
11004
|
+
componentUid: id,
|
|
11005
|
+
componentsTree: flattened.map((component) => component.uid)
|
|
11006
|
+
});
|
|
11003
11007
|
throw new Error(`Failed to find any components with uid: ${id}`);
|
|
11004
11008
|
};
|
|
11005
11009
|
var flattenComponents = (components) => components.reduce((acc, component) => {
|
|
@@ -11080,7 +11084,7 @@ function useDynamicFlowCore(props) {
|
|
|
11080
11084
|
const updateComponent = (id, update) => {
|
|
11081
11085
|
const currentStepComponent = stepComponentRef.current;
|
|
11082
11086
|
if (currentStepComponent) {
|
|
11083
|
-
update(findComponent([currentStepComponent], id));
|
|
11087
|
+
update(findComponent([currentStepComponent], id, logEvent));
|
|
11084
11088
|
setStepComponent(() => {
|
|
11085
11089
|
const newStepDomainComponent = __spreadValues({}, currentStepComponent);
|
|
11086
11090
|
stepComponentRef.current = newStepDomainComponent;
|
package/build/main.mjs
CHANGED
|
@@ -10968,7 +10968,7 @@ var formatDateOptions = {
|
|
|
10968
10968
|
};
|
|
10969
10969
|
|
|
10970
10970
|
// src/revamp/utils/findComponent.ts
|
|
10971
|
-
var findComponent = (components, id) => {
|
|
10971
|
+
var findComponent = (components, id, logEvent) => {
|
|
10972
10972
|
const flattened = flattenComponents(components);
|
|
10973
10973
|
const matching = flattened.filter((component) => component.uid === id);
|
|
10974
10974
|
if (matching.length === 1) {
|
|
@@ -10977,6 +10977,10 @@ var findComponent = (components, id) => {
|
|
|
10977
10977
|
if (matching.length > 1) {
|
|
10978
10978
|
throw new Error(`Multiple components with the same uid: ${id}`);
|
|
10979
10979
|
}
|
|
10980
|
+
logEvent("error", "Failed to find domain layer component", {
|
|
10981
|
+
componentUid: id,
|
|
10982
|
+
componentsTree: flattened.map((component) => component.uid)
|
|
10983
|
+
});
|
|
10980
10984
|
throw new Error(`Failed to find any components with uid: ${id}`);
|
|
10981
10985
|
};
|
|
10982
10986
|
var flattenComponents = (components) => components.reduce((acc, component) => {
|
|
@@ -11057,7 +11061,7 @@ function useDynamicFlowCore(props) {
|
|
|
11057
11061
|
const updateComponent = (id, update) => {
|
|
11058
11062
|
const currentStepComponent = stepComponentRef.current;
|
|
11059
11063
|
if (currentStepComponent) {
|
|
11060
|
-
update(findComponent([currentStepComponent], id));
|
|
11064
|
+
update(findComponent([currentStepComponent], id, logEvent));
|
|
11061
11065
|
setStepComponent(() => {
|
|
11062
11066
|
const newStepDomainComponent = __spreadValues({}, currentStepComponent);
|
|
11063
11067
|
stepComponentRef.current = newStepDomainComponent;
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
+
import { LoggingEventDispatcher } from '../domain/features/events';
|
|
1
2
|
import type { DomainComponent } from '../domain/types';
|
|
2
|
-
export declare const findComponent: (components: DomainComponent[], id: string) => DomainComponent;
|
|
3
|
+
export declare const findComponent: (components: DomainComponent[], id: string, logEvent: LoggingEventDispatcher) => DomainComponent;
|