@cometchat/card-builder 1.0.2 → 2.0.1
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/card-builder.es.js +3994 -3986
- package/dist/card-builder.umd.js +9 -9
- package/dist/config/app-credentials.d.ts +6 -1
- package/dist/lib.d.ts +2 -2
- package/dist/store/builder-store.d.ts +1 -0
- package/dist/types/schema.d.ts +2 -2
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@ export interface AppCredentials {
|
|
|
15
15
|
apiKey: string;
|
|
16
16
|
}
|
|
17
17
|
/** Initialize credentials from mount props (highest priority, read-only) */
|
|
18
|
-
export declare function initCredentials(appId?: string, region?: string, token?: string, apiKey?: string): void;
|
|
18
|
+
export declare function initCredentials(appId?: string, region?: string, token?: string, apiKey?: string, lock?: boolean): void;
|
|
19
19
|
/**
|
|
20
20
|
* Get resolved credentials (props > user-entered).
|
|
21
21
|
* Each field is resolved independently — props field wins if non-empty.
|
|
@@ -37,3 +37,8 @@ export declare function getUserCredentials(): AppCredentials;
|
|
|
37
37
|
export declare function subscribeCredentials(fn: () => void): () => void;
|
|
38
38
|
/** Reset credentials (used on destroy) */
|
|
39
39
|
export declare function resetCredentials(): void;
|
|
40
|
+
/**
|
|
41
|
+
* React hook: reactively reports whether template/variable (apimgmt) APIs are usable
|
|
42
|
+
* (appId + bearer token). Use this to hide token-requiring UI when no token is present.
|
|
43
|
+
*/
|
|
44
|
+
export declare function useHasApiCredentials(): boolean;
|
package/dist/lib.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ export interface CardBuilderOptions {
|
|
|
9
9
|
appId?: string;
|
|
10
10
|
/** App region — us, eu, etc. (required for template save/load APIs) */
|
|
11
11
|
region?: string;
|
|
12
|
-
/** Bearer token
|
|
12
|
+
/** Bearer token — legacy; no longer used for template save/load auth (apiKey is). */
|
|
13
13
|
token?: string;
|
|
14
|
-
/** CometChat REST API Key (required for sending messages) */
|
|
14
|
+
/** CometChat REST API Key (required for template save/load and sending messages) */
|
|
15
15
|
apiKey?: string;
|
|
16
16
|
/** Existing card JSON to load for editing */
|
|
17
17
|
card?: CardMessage;
|
package/dist/types/schema.d.ts
CHANGED
|
@@ -303,7 +303,7 @@ export interface TableElement {
|
|
|
303
303
|
export type CardElement = TextElement | ImageElement | IconElement | AvatarElement | BadgeElement | DividerElement | SpacerElement | ChipElement | ProgressBarElement | CodeBlockElement | MarkdownElement | RowElement | ColumnElement | GridElement | AccordionElement | TabsElement | ButtonElement | IconButtonElement | LinkElement | TableElement;
|
|
304
304
|
export type ElementType = CardElement['type'];
|
|
305
305
|
export interface CardStyle {
|
|
306
|
-
background
|
|
306
|
+
background: ColorValue;
|
|
307
307
|
borderRadius?: number;
|
|
308
308
|
borderColor?: ColorValue;
|
|
309
309
|
borderWidth?: number;
|
|
@@ -312,7 +312,7 @@ export interface CardStyle {
|
|
|
312
312
|
export interface CardMessage {
|
|
313
313
|
version: '1.0';
|
|
314
314
|
body: CardElement[];
|
|
315
|
-
style
|
|
315
|
+
style: CardStyle;
|
|
316
316
|
fallbackText: string;
|
|
317
317
|
}
|
|
318
318
|
export interface MessageData {
|