@dotbase/safe-frame-sync 1.4.0 → 1.6.0

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/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # safe-frame-sync
2
2
 
3
- Typesafe iframe and parent communication between Dotstudio and Dotclinic.
3
+ Typesafe iframe and parent communication between Frontend and Dotclinic.
4
4
 
5
5
  This library provides a **Pub/Sub** system for secure, typesafe communication between a parent host and an iframe, abstracting `window.top.postMessage` and `window.onmessage`. Events and corresponding payloads are typed to ensure error-free communication and improve developer experience.
6
6
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type MessageType = "editResource" | "createResource" | "closeBuilder" | "setBreadcrumbs" | "goToPatient" | "iframeRouteChange" | "sessionExpired";
1
+ export type MessageType = "editResource" | "createResource" | "closeBuilder" | "closeDocument" | "setBreadcrumbs" | "goToPatient" | "iframeRouteChange" | "sessionExpired" | "iframeReady";
2
2
  export type WorkflowType = "document" | "patient-report";
3
3
  export interface BreadcrumbItemType {
4
4
  to: string;
@@ -24,6 +24,9 @@ export interface CreateResourceType {
24
24
  export interface CloseBuilderType {
25
25
  type: "closeBuilder";
26
26
  }
27
+ export interface CloseDocumentType {
28
+ type: "closeDocument";
29
+ }
27
30
  export interface SetBreadcrumbsType {
28
31
  type: "setBreadcrumbs";
29
32
  breadcrumbs: BreadcrumbsType;
@@ -39,15 +42,20 @@ export interface IframeRouteChangeType {
39
42
  export interface SessionExpiredType {
40
43
  type: "sessionExpired";
41
44
  }
42
- export type MesssageDataType = EditResourceType | CreateResourceType | CloseBuilderType | SetBreadcrumbsType | GoToPatientType | IframeRouteChangeType | SessionExpiredType;
45
+ export interface IframeReadyType {
46
+ type: "iframeReady";
47
+ }
48
+ export type MesssageDataType = EditResourceType | CreateResourceType | CloseBuilderType | CloseDocumentType | SetBreadcrumbsType | GoToPatientType | IframeRouteChangeType | SessionExpiredType | IframeReadyType;
43
49
  export interface MessageDataMapType {
44
50
  editResource: EditResourceType;
45
51
  createResource: CreateResourceType;
46
52
  closeBuilder: CloseBuilderType;
53
+ closeDocument: CloseDocumentType;
47
54
  setBreadcrumbs: SetBreadcrumbsType;
48
55
  goToPatient: GoToPatientType;
49
56
  iframeRouteChange: IframeRouteChangeType;
50
57
  sessionExpired: SessionExpiredType;
58
+ iframeReady: IframeReadyType;
51
59
  }
52
60
  export declare const publishMessage: (data: MesssageDataType, target?: Window) => void;
53
61
  declare function subscribeMessage<T extends MessageType>(type: T, callback: (data: MessageDataMapType[T]) => void): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dotbase/safe-frame-sync",
3
- "version": "1.4.0",
3
+ "version": "1.6.0",
4
4
  "description": "Typesafe iframe and parent communication between Dotstudio and Dotclinic",
5
5
  "homepage": "https://github.com/dot-base/safe-frame-sync",
6
6
  "types": "dist/index.d.ts",
@@ -27,18 +27,18 @@
27
27
  "typecheck": "tsc --noEmit --incremental --tsBuildInfoFile .cache/tsbuildinfo"
28
28
  },
29
29
  "devDependencies": {
30
- "@eslint/js": "^9.39.1",
31
- "@types/node": "^24.10.0",
32
- "eslint": "^9.39.1",
33
- "eslint-config-prettier": "^10.1.8",
34
- "globals": "^16.5.0",
35
- "jsdom": "^27.1.0",
36
- "prettier": "3.6.2",
37
- "typescript": "^5.9.3",
38
- "vitest": "^4.0.8",
39
- "typescript-eslint": "^8.46.3",
40
- "vite": "^7.2.2",
41
- "vite-plugin-dts": "^4.5.4"
30
+ "@eslint/js": "9.39.2",
31
+ "@types/node": "25.0.10",
32
+ "eslint": "9.39.2",
33
+ "eslint-config-prettier": "10.1.8",
34
+ "globals": "17.2.0",
35
+ "jsdom": "27.4.0",
36
+ "prettier": "3.8.1",
37
+ "typescript": "5.9.3",
38
+ "vitest": "4.0.18",
39
+ "typescript-eslint": "8.54.0",
40
+ "vite": "7.3.1",
41
+ "vite-plugin-dts": "4.5.4"
42
42
  },
43
43
  "repository": {
44
44
  "type": "git",