@asgardeo/react 0.13.0 → 0.13.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.
@@ -40,7 +40,7 @@
40
40
  * This transformer is used by both SignIn and SignUp v2 components to ensure
41
41
  * consistent response handling across all embedded flows.
42
42
  */
43
- import { EmbeddedFlowComponentV2 as EmbeddedFlowComponent } from '@asgardeo/browser';
43
+ import { EmbeddedFlowComponentV2 as EmbeddedFlowComponent, FlowMetadataResponse } from '@asgardeo/browser';
44
44
  import { UseTranslation } from '../../hooks/useTranslation';
45
45
  /**
46
46
  * Generic flow error response interface that covers common error structure
@@ -81,7 +81,7 @@ export interface FlowTransformOptions {
81
81
  * @param resolveTranslations - Whether to resolve translation strings or keep them as i18n keys (default: true)
82
82
  * @returns Array of flow components with resolved or unresolved translations
83
83
  */
84
- export declare const transformComponents: (response: any, t: UseTranslation["t"], resolveTranslations?: boolean) => EmbeddedFlowComponent[];
84
+ export declare const transformComponents: (response: any, t: UseTranslation["t"], resolveTranslations?: boolean, meta?: FlowMetadataResponse | null) => EmbeddedFlowComponent[];
85
85
  /**
86
86
  * Extract error message from flow error response.
87
87
  * Supports any flow error response that follows the standard structure.
@@ -113,7 +113,7 @@ export declare const checkForErrorResponse: (response: any, t: UseTranslation["t
113
113
  * @returns Normalized flow response with flowId and transformed components
114
114
  * @throws {any} The original response if it's an error and throwOnError is true
115
115
  */
116
- export declare const normalizeFlowResponse: (response: any, t: UseTranslation["t"], options?: FlowTransformOptions) => {
116
+ export declare const normalizeFlowResponse: (response: any, t: UseTranslation["t"], options?: FlowTransformOptions, meta?: FlowMetadataResponse | null) => {
117
117
  components: EmbeddedFlowComponent[];
118
118
  flowId: string;
119
119
  };
@@ -15,13 +15,15 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
+ import { FlowMetadataResponse } from '@asgardeo/browser';
18
19
  import { UseTranslation } from '../../hooks/useTranslation';
19
20
  /**
20
- * Recursively resolves translation strings in an array of objects.
21
+ * Recursively resolves translation and meta template strings in an array of objects.
21
22
  * @param items - Array of objects to process
22
23
  * @param t - The translation function from useTranslation
23
24
  * @param properties - Array of property names to resolve (optional)
25
+ * @param meta - Optional flow metadata for resolving meta() expressions
24
26
  * @returns A new array with resolved translations
25
27
  */
26
- declare const resolveTranslationsInArray: <T extends Record<string, any>>(items: T[], t: UseTranslation["t"], properties?: string[]) => T[];
28
+ declare const resolveTranslationsInArray: <T extends Record<string, any>>(items: T[], t: UseTranslation["t"], properties?: string[], meta?: FlowMetadataResponse | null) => T[];
27
29
  export default resolveTranslationsInArray;
@@ -15,13 +15,15 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
+ import { FlowMetadataResponse } from '@asgardeo/browser';
18
19
  import { UseTranslation } from '../../hooks/useTranslation';
19
20
  /**
20
- * Resolves translation strings in an object's properties.
21
+ * Resolves all {{ t() }} and {{ meta() }} template expressions in an object's string properties.
21
22
  * @param obj - The object to process
22
23
  * @param t - The translation function from useTranslation
23
24
  * @param properties - Array of property names to resolve (optional, defaults to common properties)
24
- * @returns A new object with resolved translations
25
+ * @param meta - Optional flow metadata for resolving meta() expressions
26
+ * @returns A new object with resolved template strings
25
27
  */
26
- export declare const resolveTranslationsInObject: <T extends Record<string, any>>(obj: T, t: UseTranslation["t"], properties?: string[]) => T;
28
+ export declare const resolveTranslationsInObject: <T extends Record<string, any>>(obj: T, t: UseTranslation["t"], properties?: string[], meta?: FlowMetadataResponse | null) => T;
27
29
  export default resolveTranslationsInObject;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/react",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "React implementation of Asgardeo JavaScript SDK.",
5
5
  "keywords": [
6
6
  "asgardeo",
@@ -55,11 +55,12 @@
55
55
  "@emotion/css": "11.13.5",
56
56
  "@floating-ui/react": "0.27.12",
57
57
  "@types/react-dom": "19.1.5",
58
+ "dompurify": "3.3.1",
58
59
  "esbuild": "0.25.9",
59
60
  "react-dom": "19.1.4",
60
61
  "tslib": "2.8.1",
61
- "@asgardeo/i18n": "0.4.2",
62
- "@asgardeo/browser": "0.3.0"
62
+ "@asgardeo/browser": "0.4.1",
63
+ "@asgardeo/i18n": "0.4.2"
63
64
  },
64
65
  "publishConfig": {
65
66
  "access": "public"