@wise/dynamic-flow-client 3.16.0 → 3.16.2

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.mjs CHANGED
@@ -12871,7 +12871,7 @@ function BackButton({ title, onClick }) {
12871
12871
  var BackButton_default = BackButton;
12872
12872
 
12873
12873
  // ../renderers/src/step/StepRenderer.tsx
12874
- import { Alert as Alert3 } from "@transferwise/components";
12874
+ import { Alert as Alert3, Title } from "@transferwise/components";
12875
12875
  import { jsx as jsx57, jsxs as jsxs22 } from "react/jsx-runtime";
12876
12876
  var StepRenderer = {
12877
12877
  canRenderType: "step",
@@ -12886,7 +12886,7 @@ function StepRendererComponent(props) {
12886
12886
  }
12887
12887
  return /* @__PURE__ */ jsxs22(StepRendererContextProvider, { value, children: [
12888
12888
  back ? /* @__PURE__ */ jsx57(BackButton_default, __spreadValues({}, back)) : null,
12889
- title ? /* @__PURE__ */ jsx57("h2", { className: "text-xs-center m-b-2", children: title }) : void 0,
12889
+ title ? /* @__PURE__ */ jsx57(Title, { as: "h1", type: "title-section", className: "text-xs-center m-b-2", children: title }) : void 0,
12890
12890
  description ? /* @__PURE__ */ jsx57("p", { className: "text-xs-center m-b-2", children: description }) : void 0,
12891
12891
  error ? /* @__PURE__ */ jsx57(Alert3, { type: "negative", className: "m-b-2", message: error }) : void 0,
12892
12892
  children
@@ -12964,9 +12964,10 @@ var useHasHttpClientProvider = () => {
12964
12964
  import { jsx as jsx60 } from "react/jsx-runtime";
12965
12965
  var wiseRenderers2 = getWiseRenderers();
12966
12966
  var DynamicFragmentWise = forwardRef2(function DynamicFragmentWise2(props, ref) {
12967
- const { httpClient, onEvent, onError, renderers } = props;
12967
+ const { httpClient, onCompletion = () => {
12968
+ }, onEvent, onError, renderers } = props;
12968
12969
  const mergedRenderers = useMemo6(() => [...renderers != null ? renderers : [], ...wiseRenderers2], [renderers]);
12969
- const { stepComponentRef } = useDynamicFlowCore(props);
12970
+ const { stepComponentRef } = useDynamicFlowCore(__spreadValues({ onCompletion }, props));
12970
12971
  useImperativeHandle(
12971
12972
  ref,
12972
12973
  () => ({
@@ -13003,8 +13004,9 @@ var DynamicFragmentWise_default = DynamicFragmentWise;
13003
13004
  import { forwardRef as forwardRef3, useImperativeHandle as useImperativeHandle2, useMemo as useMemo7 } from "react";
13004
13005
  import { jsx as jsx61 } from "react/jsx-runtime";
13005
13006
  var DynamicFragmentCore = forwardRef3(function DynamicFragmentCore2(props, ref) {
13006
- const { onEvent, onError, renderers } = props;
13007
- const { stepComponentRef } = useDynamicFlowCore(props);
13007
+ const { onCompletion = () => {
13008
+ }, onEvent, onError, renderers } = props;
13009
+ const { stepComponentRef } = useDynamicFlowCore(__spreadValues({ onCompletion }, props));
13008
13010
  useImperativeHandle2(
13009
13011
  ref,
13010
13012
  () => ({
@@ -16521,8 +16523,12 @@ var getControlType = (schema) => {
16521
16523
  };
16522
16524
  var getStringSchemaControlType = ({
16523
16525
  format,
16524
- control
16526
+ control,
16527
+ displayFormat
16525
16528
  }) => {
16529
+ if (displayFormat) {
16530
+ return "text";
16531
+ }
16526
16532
  if (control) {
16527
16533
  return stringControlToFormControlType[control] || control;
16528
16534
  }
@@ -2,7 +2,7 @@ import type { BasicModel, Schema, StringSchema } from '@wise/dynamic-flow-types'
2
2
  import { FormControlType } from '../../common/constants';
3
3
  import type { OnChangeProps } from '../JsonSchemaForm';
4
4
  export declare const getControlType: (schema: Schema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
5
- export declare const getStringSchemaControlType: ({ format, control, }: StringSchema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
5
+ export declare const getStringSchemaControlType: ({ format, control, displayFormat, }: StringSchema) => (typeof FormControlType)[keyof typeof FormControlType] | undefined;
6
6
  declare function SchemaFormControl(props: SchemaFormControlProps): import("react/jsx-runtime").JSX.Element;
7
7
  declare namespace SchemaFormControl {
8
8
  var defaultProps: {
@@ -1,13 +1,12 @@
1
1
  /// <reference types="react" />
2
2
  import type { DynamicFlowCoreProps, DynamicFragmentController } from './types';
3
3
  import type { OnValueChange } from './domain/types';
4
- type Props = DynamicFlowCoreProps & {
5
- onValueChange?: OnValueChange;
6
- };
7
4
  /**
8
5
  * DynamicFragmentCore is like DynamicFlowCore, but it also accepts a ForwardedRef.
9
6
  * This ref conforms to the DynamicFragmentController type, containing two functions: `getValue` and `validate`.
10
7
  * @experimental This component may be changed in the future without notice.
11
8
  */
12
- export declare const DynamicFragmentCore: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<DynamicFragmentController>>;
13
- export {};
9
+ export declare const DynamicFragmentCore: import("react").ForwardRefExoticComponent<Omit<DynamicFlowCoreProps, "onCompletion"> & {
10
+ onValueChange?: OnValueChange | undefined;
11
+ onCompletion?: ((result: import("@wise/dynamic-flow-types/build/next").JsonElement) => void) | undefined;
12
+ } & import("react").RefAttributes<DynamicFragmentController>>;
@@ -1,8 +1,8 @@
1
1
  /// <reference types="react" />
2
2
  import type { DynamicFlowWiseProps, DynamicFragmentController } from './types';
3
- import type { OnValueChange } from './domain/types';
4
3
  /** @deprecated This component is deprecated. Please use `DynamicFragment` from `@wise/dynamic-flow-client-internal` instead. */
5
- declare const DynamicFragmentWise: import("react").ForwardRefExoticComponent<(DynamicFlowWiseProps & {
6
- onValueChange?: OnValueChange | undefined;
7
- }) & import("react").RefAttributes<DynamicFragmentController>>;
4
+ declare const DynamicFragmentWise: import("react").ForwardRefExoticComponent<Omit<DynamicFlowWiseProps, "onCompletion"> & {
5
+ onValueChange?: (() => void) | undefined;
6
+ onCompletion?: ((result: import("@wise/dynamic-flow-types/build/next").JsonElement) => void) | undefined;
7
+ } & import("react").RefAttributes<DynamicFragmentController>>;
8
8
  export default DynamicFragmentWise;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wise/dynamic-flow-client",
3
- "version": "3.16.0",
3
+ "version": "3.16.2",
4
4
  "description": "Dynamic Flow web client",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./build/main.min.js",
@@ -104,7 +104,7 @@
104
104
  "nanoid": "5.0.7",
105
105
  "react-webcam": "^7.2.0",
106
106
  "screenfull": "^5.2.0",
107
- "@wise/dynamic-flow-types": "2.18.0"
107
+ "@wise/dynamic-flow-types": "2.18.2"
108
108
  },
109
109
  "scripts": {
110
110
  "dev": "pnpm build:visual-tests && storybook dev -p 3003",