@plasmicpkgs/plasmic-cms 0.0.214 → 0.0.215
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/api.d.ts +4 -2
- package/dist/components.d.ts +8 -1
- package/dist/context.d.ts +10 -1
- package/dist/plasmic-cms.cjs.development.js +306 -116
- package/dist/plasmic-cms.cjs.development.js.map +1 -1
- package/dist/plasmic-cms.cjs.production.min.js +1 -1
- package/dist/plasmic-cms.cjs.production.min.js.map +1 -1
- package/dist/plasmic-cms.esm.js +269 -80
- package/dist/plasmic-cms.esm.js.map +1 -1
- package/dist/schema.d.ts +1 -0
- package/package.json +2 -2
package/dist/api.d.ts
CHANGED
|
@@ -7,10 +7,11 @@ export interface DatabaseConfig {
|
|
|
7
7
|
}
|
|
8
8
|
export interface QueryParams {
|
|
9
9
|
useDraft?: boolean;
|
|
10
|
-
where?:
|
|
10
|
+
where?: any;
|
|
11
11
|
orderBy?: string;
|
|
12
12
|
desc?: boolean;
|
|
13
13
|
limit?: number;
|
|
14
|
+
offset?: number;
|
|
14
15
|
}
|
|
15
16
|
export declare class HttpError extends Error {
|
|
16
17
|
status: number;
|
|
@@ -19,8 +20,9 @@ export declare class HttpError extends Error {
|
|
|
19
20
|
export declare class API {
|
|
20
21
|
private config;
|
|
21
22
|
constructor(config: DatabaseConfig);
|
|
22
|
-
get(endpoint: string, params?:
|
|
23
|
+
get(endpoint: string, params?: any): Promise<any>;
|
|
23
24
|
fetchTables(): Promise<ApiCmsTable[]>;
|
|
24
25
|
query(table: string, params?: QueryParams): Promise<ApiCmsRow[]>;
|
|
26
|
+
count(table: string, params?: Pick<QueryParams, "where" | "useDraft">): Promise<number>;
|
|
25
27
|
}
|
|
26
28
|
export declare function mkApi(config: DatabaseConfig | undefined): API;
|
package/dist/components.d.ts
CHANGED
|
@@ -30,9 +30,10 @@ interface CmsQueryRepeaterProps extends QueryParams, CanvasComponentProps<TableC
|
|
|
30
30
|
className?: string;
|
|
31
31
|
filterField?: string;
|
|
32
32
|
filterValue?: string;
|
|
33
|
+
mode?: "rows" | "count";
|
|
33
34
|
}
|
|
34
35
|
export declare const cmsQueryRepeaterMeta: ComponentMeta<CmsQueryRepeaterProps>;
|
|
35
|
-
export declare function CmsQueryRepeater({ table, children, setControlContextData, where, useDraft, orderBy, desc, limit, emptyMessage, forceEmptyState, loadingMessage, forceLoadingState, noLayout, noAutoRepeat, className, filterField, filterValue, }: CmsQueryRepeaterProps): React.JSX.Element;
|
|
36
|
+
export declare function CmsQueryRepeater({ table, children, setControlContextData, mode, where, useDraft, orderBy, desc, limit, offset, emptyMessage, forceEmptyState, loadingMessage, forceLoadingState, noLayout, noAutoRepeat, className, filterField, filterValue, }: CmsQueryRepeaterProps): React.JSX.Element;
|
|
36
37
|
interface CmsRowFieldProps extends CanvasComponentProps<RowContextData> {
|
|
37
38
|
table: string;
|
|
38
39
|
field: string;
|
|
@@ -41,6 +42,12 @@ interface CmsRowFieldProps extends CanvasComponentProps<RowContextData> {
|
|
|
41
42
|
}
|
|
42
43
|
export declare const cmsRowFieldMeta: ComponentMeta<CmsRowFieldProps>;
|
|
43
44
|
export declare function CmsRowField({ className, table, field, dateFormat, setControlContextData, ...rest }: CmsRowFieldProps): React.JSX.Element | null;
|
|
45
|
+
interface CmsCountProps extends CanvasComponentProps<RowContextData> {
|
|
46
|
+
table: string;
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
export declare const cmsCountFieldMeta: ComponentMeta<CmsCountProps>;
|
|
50
|
+
export declare function CmsCount({ className, table, setControlContextData, ...rest }: CmsCountProps): React.JSX.Element | null;
|
|
44
51
|
interface CmsRowLinkProps extends CanvasComponentProps<RowContextData> {
|
|
45
52
|
table: string;
|
|
46
53
|
field: string;
|
package/dist/context.d.ts
CHANGED
|
@@ -22,13 +22,22 @@ export declare function QueryResultProvider({ children, table, rows, hidden, }:
|
|
|
22
22
|
rows: ApiCmsRow[] | undefined;
|
|
23
23
|
hidden?: boolean;
|
|
24
24
|
}): React.JSX.Element;
|
|
25
|
-
export declare function useTablesWithDataLoaded(): ApiCmsTable[] | undefined;
|
|
25
|
+
export declare function useTablesWithDataLoaded(mode: "rows" | "count" | undefined): ApiCmsTable[] | undefined;
|
|
26
26
|
export declare function useRow(tables?: ApiCmsTable[], table?: string): {
|
|
27
27
|
table: string;
|
|
28
28
|
row: ApiCmsRow | undefined;
|
|
29
29
|
} | undefined;
|
|
30
|
+
export declare function useCount(tables?: ApiCmsTable[], table?: string): {
|
|
31
|
+
table: string;
|
|
32
|
+
count: number | undefined;
|
|
33
|
+
} | undefined;
|
|
30
34
|
export declare function RowProvider({ children, table, row, }: {
|
|
31
35
|
children?: React.ReactNode;
|
|
32
36
|
table: string;
|
|
33
37
|
row: ApiCmsRow;
|
|
34
38
|
}): React.JSX.Element;
|
|
39
|
+
export declare function CountProvider({ children, table, count, }: {
|
|
40
|
+
children?: React.ReactNode;
|
|
41
|
+
table: string | undefined;
|
|
42
|
+
count: number | undefined;
|
|
43
|
+
}): React.JSX.Element;
|