@notionhq/custom-blocks-host 0.4.3 → 0.5.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.
Files changed (39) hide show
  1. package/README.md +4 -0
  2. package/dist/browser.js +1 -1
  3. package/dist/context/initialState.d.ts +5 -13
  4. package/dist/context/initialState.d.ts.map +1 -1
  5. package/dist/createCustomBlockHost.d.ts +20 -9
  6. package/dist/createCustomBlockHost.d.ts.map +1 -1
  7. package/dist/createCustomBlockHost.js +9 -4
  8. package/dist/dataSources/types.d.ts +7 -3
  9. package/dist/dataSources/types.d.ts.map +1 -1
  10. package/dist/index.d.ts +5 -4
  11. package/dist/index.d.ts.map +1 -1
  12. package/dist/manifest/types.d.ts +3 -7
  13. package/dist/manifest/types.d.ts.map +1 -1
  14. package/dist/messages/handlers.d.ts +10 -9
  15. package/dist/messages/handlers.d.ts.map +1 -1
  16. package/dist/messages/result.d.ts +12 -0
  17. package/dist/messages/result.d.ts.map +1 -0
  18. package/dist/messages/result.js +1 -0
  19. package/dist/navigation/types.d.ts +1 -3
  20. package/dist/navigation/types.d.ts.map +1 -1
  21. package/dist/pages/types.d.ts +12 -14
  22. package/dist/pages/types.d.ts.map +1 -1
  23. package/dist/protocol/pages/makeBridgePage.d.ts +3 -1
  24. package/dist/protocol/users/makeBridgeUser.d.ts +3 -1
  25. package/dist/users/types.d.ts +11 -5
  26. package/dist/users/types.d.ts.map +1 -1
  27. package/docs/handlers.md +15 -7
  28. package/docs/lifecycle.md +14 -0
  29. package/package.json +1 -1
  30. package/src/context/initialState.ts +7 -16
  31. package/src/createCustomBlockHost.ts +38 -19
  32. package/src/dataSources/types.ts +8 -11
  33. package/src/index.ts +5 -6
  34. package/src/manifest/types.ts +4 -4
  35. package/src/messages/handlers.ts +11 -19
  36. package/src/messages/result.ts +11 -0
  37. package/src/navigation/types.ts +1 -11
  38. package/src/pages/types.ts +13 -46
  39. package/src/users/types.ts +12 -21
@@ -1,26 +1,17 @@
1
- import type { BridgeMessagePayload } from "@notionhq/custom-blocks-protocol/messages/messagePayload.js"
2
- import type {
3
- CustomBlockGetUserErrorInfo,
4
- getUserMessageSchema,
5
- getUserResultMessageSchema,
6
- } from "@notionhq/custom-blocks-protocol/users/messages/getUser.js"
7
- import type {
8
- CustomBlockListUsersErrorInfo,
9
- listUsersMessageSchema,
10
- listUsersResultMessageSchema,
11
- } from "@notionhq/custom-blocks-protocol/users/messages/listUsers.js"
1
+ import type { BridgeUser } from "@notionhq/custom-blocks-protocol/users/bridgeUser.js"
2
+ import type { BridgeUserList } from "@notionhq/custom-blocks-protocol/users/bridgeUserList.js"
3
+ import type { getUserMessageSchema } from "@notionhq/custom-blocks-protocol/users/messages/getUser.js"
4
+ import type { listUsersMessageSchema } from "@notionhq/custom-blocks-protocol/users/messages/listUsers.js"
12
5
  import type { InferInput } from "valibot"
13
-
14
- export type CustomBlockHostGetUserResult = BridgeMessagePayload<
15
- InferInput<typeof getUserResultMessageSchema>,
16
- CustomBlockGetUserErrorInfo
17
- >
18
-
19
- export type CustomBlockHostListUsersResult = BridgeMessagePayload<
20
- InferInput<typeof listUsersResultMessageSchema>,
21
- CustomBlockListUsersErrorInfo
22
- >
6
+ import type { CustomBlockHostResult } from "../messages/result.js"
23
7
 
24
8
  export type GetUserMessageInput = InferInput<typeof getUserMessageSchema>
25
9
 
26
10
  export type ListUsersMessageInput = InferInput<typeof listUsersMessageSchema>
11
+
12
+ export type CustomBlockHostUserResult = CustomBlockHostResult<{
13
+ user: BridgeUser
14
+ }>
15
+ export type CustomBlockHostUserListResult = CustomBlockHostResult<{
16
+ list: BridgeUserList
17
+ }>