@wise/dynamic-flow-client 3.7.2-experimental-1ba6fef → 3.8.0-experimental-da4e1e5

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 (39) hide show
  1. package/build/index.js +3 -3
  2. package/build/legacy/common/hooks/useExternal/useExternal.js +1 -2
  3. package/build/legacy/common/hooks/useExternal/useExternal.spec.js +35 -21
  4. package/build/main.js +16722 -16711
  5. package/build/main.min.js +1 -1
  6. package/build/main.mjs +14265 -14254
  7. package/build/revamp/DynamicFlowWise.js +12 -2
  8. package/build/revamp/domain/components/IntegerInputComponent.js +4 -1
  9. package/build/revamp/domain/components/NumberInputComponent.js +6 -3
  10. package/build/revamp/domain/components/TextInputComponent.js +6 -3
  11. package/build/revamp/domain/components/utils/debounce.js +2 -2
  12. package/build/revamp/domain/features/refresh/getPerformRefresh.js +5 -42
  13. package/build/revamp/domain/mappers/schema/integerSchemaToComponent.js +2 -2
  14. package/build/revamp/domain/mappers/schema/numberSchemaToComponent.js +2 -2
  15. package/build/revamp/domain/mappers/schema/stringSchemaToComponent/stringSchemaToTextInputComponent.js +2 -2
  16. package/build/revamp/tests/legacy/RefreshStepOnChange.debouncing.spec.js +127 -11
  17. package/build/types/index.d.ts +6 -6
  18. package/build/types/legacy/common/utils/schema-utils.d.ts +1 -1
  19. package/build/types/legacy/dynamicFlow/utils/useLoader.d.ts +1 -1
  20. package/build/types/legacy/layout/search/useSearch.d.ts +1 -1
  21. package/build/types/revamp/DynamicFlowCore.d.ts +1 -5
  22. package/build/types/revamp/DynamicFlowWise.d.ts +2 -2
  23. package/build/types/revamp/domain/components/AllOfComponent.d.ts +1 -1
  24. package/build/types/revamp/domain/components/BooleanInputComponent.d.ts +1 -1
  25. package/build/types/revamp/domain/components/ConstComponent.d.ts +1 -1
  26. package/build/types/revamp/domain/components/DateInputComponent.d.ts +1 -1
  27. package/build/types/revamp/domain/components/IntegerInputComponent.d.ts +2 -2
  28. package/build/types/revamp/domain/components/MultiUploadInputComponent.d.ts +1 -1
  29. package/build/types/revamp/domain/components/NumberInputComponent.d.ts +4 -4
  30. package/build/types/revamp/domain/components/ObjectComponent.d.ts +1 -1
  31. package/build/types/revamp/domain/components/SelectInputComponent.d.ts +1 -1
  32. package/build/types/revamp/domain/components/StepDomainComponent.d.ts +1 -1
  33. package/build/types/revamp/domain/components/TextInputComponent.d.ts +4 -4
  34. package/build/types/revamp/domain/components/UploadInputComponent.d.ts +1 -1
  35. package/build/types/revamp/domain/components/repeatableComponent/RepeatableComponent.d.ts +1 -1
  36. package/build/types/revamp/domain/features/refresh/getPerformRefresh.d.ts +2 -2
  37. package/build/types/revamp/types.d.ts +10 -5
  38. package/build/types/revamp/wise/renderers/getWiseRenderers.d.ts +2 -1
  39. package/package.json +1 -1
package/build/index.js CHANGED
@@ -1,10 +1,10 @@
1
+ export { makeHttpClient } from './common/makeHttpClient';
2
+ export { default as translations } from './i18n';
3
+ export { default as DynamicFlowRevamp } from './revamp/DynamicFlowWise';
1
4
  export { convertStepToLayout, inlineReferences } from './legacy/step/layoutStep/utils';
2
5
  export { default as DynamicFlow } from './legacy/dynamicFlow';
3
- export { makeHttpClient } from './common/makeHttpClient';
4
6
  export { default as JsonSchemaForm } from './legacy/jsonSchemaForm';
5
7
  export { DynamicLayout as Layout } from './legacy/layout';
6
8
  export { isValidSchema } from './legacy/common/validators';
7
- export { default as translations } from './i18n';
8
9
  // eslint-disable-next-line import/export
9
10
  export * from './legacy/dynamicFlow/DynamicFlow';
10
- export { default as DynamicFlowRevamp } from './revamp/DynamicFlowWise';
@@ -7,8 +7,7 @@ export function useExternal(url) {
7
7
  useEffect(function () {
8
8
  if (url) {
9
9
  setHasManuallyTriggered(false);
10
- setExternalWindow(null);
11
- // setExternalWindow(window.open(url, '_blank'));
10
+ setExternalWindow(window.open(url, '_blank'));
12
11
  }
13
12
  }, [url]);
14
13
  var requiresManualTrigger = Boolean(url && !externalWindow && !hasManuallyTriggered);
@@ -65,16 +65,24 @@ describe('useExternal', function () {
65
65
  layout: [{ type: 'paragraph', text: 'This is a paragraph in the step layout' }],
66
66
  schemas: [],
67
67
  };
68
- // it('attempts to open the specified URL, but ONLY ONCE', async () => {
69
- // jest.spyOn(window, 'open');
70
- // mockWindowOpenSuccess();
71
- // renderComponent(step);
72
- // expect(window.open).toHaveBeenCalledTimes(1);
73
- // expect(window.open).toHaveBeenCalledWith('https://third-party.website', '_blank');
74
- // await waitFor(() => {
75
- // expect(window.open).toHaveBeenCalledTimes(1);
76
- // });
77
- // });
68
+ it('attempts to open the specified URL, but ONLY ONCE', function () { return __awaiter(void 0, void 0, void 0, function () {
69
+ return __generator(this, function (_a) {
70
+ switch (_a.label) {
71
+ case 0:
72
+ jest.spyOn(window, 'open');
73
+ mockWindowOpenSuccess();
74
+ renderComponent(step);
75
+ expect(window.open).toHaveBeenCalledTimes(1);
76
+ expect(window.open).toHaveBeenCalledWith('https://third-party.website', '_blank');
77
+ return [4 /*yield*/, waitFor(function () {
78
+ expect(window.open).toHaveBeenCalledTimes(1);
79
+ })];
80
+ case 1:
81
+ _a.sent();
82
+ return [2 /*return*/];
83
+ }
84
+ });
85
+ }); });
78
86
  describe('when the window/tab fails to open', function () {
79
87
  it('displays a confirmation UI (ExternalConfirmationStep)', function () { return __awaiter(void 0, void 0, void 0, function () {
80
88
  return __generator(this, function (_a) {
@@ -181,17 +189,23 @@ describe('useExternal', function () {
181
189
  }); });
182
190
  });
183
191
  });
184
- // describe('when the window/tab opens successfully', () => {
185
- // it('displays the step normally', async () => {
186
- // jest.spyOn(window, 'open');
187
- // mockWindowOpenSuccess();
188
- // renderComponent(step);
189
- // await expect(
190
- // screen.findByText('This is a paragraph in the step layout'),
191
- // ).resolves.toBeInTheDocument();
192
- // expect(screen.queryByText('Please confirm')).not.toBeInTheDocument();
193
- // });
194
- // });
192
+ describe('when the window/tab opens successfully', function () {
193
+ it('displays the step normally', function () { return __awaiter(void 0, void 0, void 0, function () {
194
+ return __generator(this, function (_a) {
195
+ switch (_a.label) {
196
+ case 0:
197
+ jest.spyOn(window, 'open');
198
+ mockWindowOpenSuccess();
199
+ renderComponent(step);
200
+ return [4 /*yield*/, expect(screen.findByText('This is a paragraph in the step layout')).resolves.toBeInTheDocument()];
201
+ case 1:
202
+ _a.sent();
203
+ expect(screen.queryByText('Please confirm')).not.toBeInTheDocument();
204
+ return [2 /*return*/];
205
+ }
206
+ });
207
+ }); });
208
+ });
195
209
  });
196
210
  describe('Given a step with a malformed "external" property', function () {
197
211
  var step = {