@chaibuilder/pages 0.8.2 → 0.8.4

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/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-DnQq2t4R.cjs"),t=require("@chaibuilder/sdk");exports.ChaiBuilderPagesRealtime=e.ChaiBuilderPagesRealtime;exports.ChaiJsonInput=e.SmartJsonInput;exports.ImagePicker=e.ImagePicker;exports.LanguageSwitcher=e.LanguageSwitcher;exports.NestedPathSelector=e.NestedPathSelector;exports.PermissionChecker=e.PermissionChecker;exports.default=e.ChaiBuilderPages;exports.registerChaiLoginComponent=e.registerLoginComponent;exports.registerChaiSiteSetting=e.registerChaiSiteSetting;exports.useActivePage=e.useActivePage;exports.useBuilderPageData=e.useBuilderPageData;exports.useChaiAuth=e.useChaiAuth;exports.useChaiCurrentPage=e.useCurrentPage;exports.useChaiFetch=e.useChaiFetch;exports.useChaiUserInfo=e.useChaiUserInfo;exports.useFallbackLang=e.useFallbackLang;exports.useFetch=e.useFetch;exports.useGotoPage=e.useGotoPage;exports.useLanguagePages=e.useLanguagePages;exports.usePageTypes=e.usePageTypes;exports.useUpdateActivePageMetadata=e.useUpdateActivePageMetadata;exports.useUserPermissions=e.useUserRoleAndPermissions;exports.useWebsitePages=e.useWebsitePages;exports.useWebsiteSetting=e.useWebsiteSetting;Object.keys(t).forEach(a=>{a!=="default"&&!Object.prototype.hasOwnProperty.call(exports,a)&&Object.defineProperty(exports,a,{enumerable:!0,get:()=>t[a]})});
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./index-CoSDO0MU.cjs"),t=require("@chaibuilder/sdk");exports.ChaiBuilderPagesRealtime=e.ChaiBuilderPagesRealtime;exports.ChaiJsonInput=e.SmartJsonInput;exports.ImagePicker=e.ImagePicker;exports.LanguageSwitcher=e.LanguageSwitcher;exports.NestedPathSelector=e.NestedPathSelector;exports.PermissionChecker=e.PermissionChecker;exports.default=e.ChaiBuilderPages;exports.registerChaiLoginComponent=e.registerLoginComponent;exports.registerChaiSiteSetting=e.registerChaiSiteSetting;exports.useActivePage=e.useActivePage;exports.useBuilderPageData=e.useBuilderPageData;exports.useChaiAuth=e.useChaiAuth;exports.useChaiCurrentPage=e.useCurrentPage;exports.useChaiFetch=e.useChaiFetch;exports.useChaiUserInfo=e.useChaiUserInfo;exports.useFallbackLang=e.useFallbackLang;exports.useFetch=e.useFetch;exports.useGotoPage=e.useGotoPage;exports.useLanguagePages=e.useLanguagePages;exports.usePageTypes=e.usePageTypes;exports.useUpdateActivePageMetadata=e.useUpdateActivePageMetadata;exports.useUserPermissions=e.useUserRoleAndPermissions;exports.useWebsitePages=e.useWebsitePages;exports.useWebsiteSetting=e.useWebsiteSetting;Object.keys(t).forEach(a=>{a!=="default"&&!Object.prototype.hasOwnProperty.call(exports,a)&&Object.defineProperty(exports,a,{enumerable:!0,get:()=>t[a]})});
package/dist/index.d.ts CHANGED
@@ -26,23 +26,19 @@ declare type ChaiBuilderPagesProps = {
26
26
  export declare class ChaiBuilderPagesRealtime implements ChaiBuilderPagesRealtimeInterface {
27
27
  private client;
28
28
  private channel;
29
+ private currentUserId;
29
30
  constructor(socketProvider: any);
30
- listenEvent(event: "TAKE_OVER_REQUESTED" | "TAKE_OVER_REQUEST_ACCEPTED" | "TAKE_OVER_REQUEST_REJECTED", callback: (payload: any) => void): void;
31
- joinPage(pageId: string, userId: string): Promise<boolean>;
31
+ joinPage(pageId: string, userId: string, callback: (event: LISTEN_EVENTS, payload?: any) => void): Promise<void>;
32
32
  leavePage(): Promise<void>;
33
- requestTakeOver(pageId: string, userId: string): Promise<void>;
34
- acceptTakeOver(pageId: string, userId: string): Promise<void>;
35
- rejectTakeOver(pageId: string, userId: string): Promise<void>;
36
- private getOnlineUsers;
33
+ sendEvent(event: LISTEN_EVENTS, payload?: any): Promise<void>;
34
+ private updateLockingState;
35
+ private getCurrentOnlineUser;
37
36
  }
38
37
 
39
38
  declare interface ChaiBuilderPagesRealtimeInterface {
40
- joinPage: (pageId: string, userId: string) => Promise<boolean>;
39
+ joinPage: (pageId: string, userId: string, callback: (event: LISTEN_EVENTS, payload?: any) => void) => Promise<void>;
41
40
  leavePage: (pageId: string, userId: string) => Promise<void>;
42
- requestTakeOver: (pageId: string, userId: string) => Promise<void>;
43
- acceptTakeOver: (pageId: string, userId: string) => Promise<void>;
44
- rejectTakeOver: (pageId: string, userId: string) => Promise<void>;
45
- listenEvent: (event: LISTEN_EVENTS, callback: (payload: any) => void) => void;
41
+ sendEvent: (event: LISTEN_EVENTS, payload?: any) => Promise<void>;
46
42
  }
47
43
 
48
44
  export declare const ChaiJsonInput: React.FC<SmartJsonInputProps>;
@@ -82,7 +78,7 @@ export declare const LanguageSwitcher: ({ showAdd, variant, }: {
82
78
  variant?: "ghost" | "outline";
83
79
  }) => JSX_2.Element | null;
84
80
 
85
- declare type LISTEN_EVENTS = "TAKE_OVER_REQUESTED" | "TAKE_OVER_REQUEST_ACCEPTED" | "TAKE_OVER_REQUEST_REJECTED";
81
+ declare type LISTEN_EVENTS = "PAGE_LOCKED" | "USER_JOINED" | "TAKE_OVER_REQUESTED" | "TAKE_OVER_REQUEST_ACCEPTED" | "TAKE_OVER_REQUEST_REJECTED";
86
82
 
87
83
  declare type LoggedInUser = {
88
84
  accessToken: string;
@@ -159,8 +155,8 @@ export declare const useChaiFetch: () => ({ url, method, body, headers, }: {
159
155
  }) => Promise<any>;
160
156
 
161
157
  export declare const useChaiUserInfo: (currentEditor: string) => UseQueryResult< {
162
- id: string;
163
158
  name: string;
159
+ id: string;
164
160
  email: string;
165
161
  avatar: string;
166
162
  }, Error>;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { ai as s, a6 as t, a5 as i, a4 as u, X as g, a3 as r, W as h, a7 as n, a8 as o, Y as P, Z as C, ad as c, a9 as d, af as l, ah as m, _ as p, ag as f, a0 as S, aa as b, a1 as L, a2 as k, ae as A, ab as F, ac as I } from "./index-PEtpqNUl.js";
1
+ import { ai as s, a6 as t, a5 as i, a4 as u, X as g, a3 as r, W as h, a7 as n, a8 as o, Y as P, Z as C, ad as c, a9 as d, af as l, ah as m, _ as p, ag as f, a0 as S, aa as b, a1 as L, a2 as k, ae as A, ab as F, ac as I } from "./index-XCmQ-5KX.js";
2
2
  export * from "@chaibuilder/sdk";
3
3
  export {
4
4
  s as ChaiBuilderPagesRealtime,
package/dist/utils.cjs ADDED
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("@chaibuilder/sdk/tailwind");Object.keys(t).forEach(e=>{e!=="default"&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:()=>t[e]})});
@@ -0,0 +1,4 @@
1
+
2
+ export * from "@chaibuilder/sdk/tailwind";
3
+
4
+ export { }
package/dist/utils.js ADDED
@@ -0,0 +1 @@
1
+ export * from "@chaibuilder/sdk/tailwind";
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "author": "Suraj Air",
4
4
  "license": "Private",
5
5
  "homepage": "https://chaibuilder.com",
6
- "version": "0.8.2",
6
+ "version": "0.8.4",
7
7
  "type": "module",
8
8
  "files": [
9
9
  "dist"
@@ -16,6 +16,16 @@
16
16
  "import": "./dist/index.js",
17
17
  "require": "./dist/index.cjs"
18
18
  },
19
+ "./blocks": {
20
+ "types": "./dist/blocks.d.ts",
21
+ "import": "./dist/blocks.js",
22
+ "require": "./dist/blocks.cjs"
23
+ },
24
+ "./utils": {
25
+ "types": "./dist/utils.d.ts",
26
+ "import": "./dist/utils.js",
27
+ "require": "./dist/utils.cjs"
28
+ },
19
29
  "./server": {
20
30
  "types": "./dist/server.d.ts",
21
31
  "import": "./dist/server.js",
@@ -55,7 +65,7 @@
55
65
  },
56
66
  "peerDependencies": {
57
67
  "@chaibuilder/runtime": "2.2.0",
58
- "@chaibuilder/sdk": "2.3.3",
68
+ "@chaibuilder/sdk": "2.3.7",
59
69
  "@types/react": "*",
60
70
  "@types/react-dom": "*",
61
71
  "react": "^18.0 || ^19.0 || ^19.1",
@@ -71,7 +81,7 @@
71
81
  },
72
82
  "dependencies": {
73
83
  "@chaibuilder/runtime": "2.2.0",
74
- "@chaibuilder/sdk": "2.3.5",
84
+ "@chaibuilder/sdk": "2.3.7",
75
85
  "@mhsdesign/jit-browser-tailwindcss": "^0.4.2",
76
86
  "@tailwindcss/aspect-ratio": "^0.4.2",
77
87
  "@tailwindcss/forms": "^0.5.10",