@datawheel/bespoke 0.7.3-rc.1 → 0.8.0-rc.2
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/auth.js +5 -4
- package/dist/cms.js +60 -60
- package/dist/redux-store.js +7 -7
- package/dist/report.js +27 -27
- package/dist/server.js +34 -32
- package/package.json +9 -15
- package/dist/ExploreProvider-ee7762cb.d.ts +0 -64
- package/dist/auth-693a652d.d.ts +0 -54
- package/dist/auth.d.ts +0 -39
- package/dist/cms.d.ts +0 -12
- package/dist/explore.d.ts +0 -94
- package/dist/index.d.ts +0 -24
- package/dist/redux-store.d.ts +0 -190
- package/dist/report.d.ts +0 -50
- package/dist/server.d.ts +0 -98
- package/dist/store-a09ce360.d.ts +0 -915
- package/dist/types-76133c94.d.ts +0 -767
package/package.json
CHANGED
|
@@ -1,35 +1,28 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datawheel/bespoke",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0-rc.2",
|
|
4
4
|
"description": "Content management system for creating automated data reports",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
-
"import": "./dist/index.js"
|
|
8
|
-
"types": "./dist/index.d.ts"
|
|
7
|
+
"import": "./dist/index.js"
|
|
9
8
|
},
|
|
10
9
|
"./server": {
|
|
11
|
-
"import": "./dist/server.js"
|
|
12
|
-
"types": "./dist/server.d.ts"
|
|
10
|
+
"import": "./dist/server.js"
|
|
13
11
|
},
|
|
14
12
|
"./explore": {
|
|
15
|
-
"import": "./dist/explore.js"
|
|
16
|
-
"types": "./dist/explore.d.ts"
|
|
13
|
+
"import": "./dist/explore.js"
|
|
17
14
|
},
|
|
18
15
|
"./store": {
|
|
19
|
-
"import": "./dist/redux-store.js"
|
|
20
|
-
"types": "./dist/redux-store.d.ts"
|
|
16
|
+
"import": "./dist/redux-store.js"
|
|
21
17
|
},
|
|
22
18
|
"./cms": {
|
|
23
|
-
"import": "./dist/cms.js"
|
|
24
|
-
"types": "./dist/cms.d.ts"
|
|
19
|
+
"import": "./dist/cms.js"
|
|
25
20
|
},
|
|
26
21
|
"./report": {
|
|
27
|
-
"import": "./dist/report.js"
|
|
28
|
-
"types": "./dist/report.d.ts"
|
|
22
|
+
"import": "./dist/report.js"
|
|
29
23
|
},
|
|
30
24
|
"./auth": {
|
|
31
|
-
"import": "./dist/auth.js"
|
|
32
|
-
"types": "./dist/auth.d.ts"
|
|
25
|
+
"import": "./dist/auth.js"
|
|
33
26
|
}
|
|
34
27
|
},
|
|
35
28
|
"files": [
|
|
@@ -120,6 +113,7 @@
|
|
|
120
113
|
"jszip": "^3.10.1",
|
|
121
114
|
"mantine-react-table": "^1.3.4",
|
|
122
115
|
"monaco-themes": "^0.4.2",
|
|
116
|
+
"next-auth": "^4.24.7",
|
|
123
117
|
"next-redux-wrapper": "^7.0.0",
|
|
124
118
|
"nextjs-cors": "^2.1.1",
|
|
125
119
|
"normalizr": "^3.6.2",
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { P as SearchReportItem } from './types-76133c94.js';
|
|
3
|
-
|
|
4
|
-
type TranslationKeys = "try_another" | "search" | "filters_all" | "no_results" | "load_more";
|
|
5
|
-
type MetaTranslations = {
|
|
6
|
-
dimension?: Record<string, string>;
|
|
7
|
-
report?: Record<string, string>;
|
|
8
|
-
variant?: Record<string, string>;
|
|
9
|
-
tooltip?: string;
|
|
10
|
-
};
|
|
11
|
-
type ExploreTranslations = Partial<Record<TranslationKeys, string> & MetaTranslations>;
|
|
12
|
-
type FiltersType = {
|
|
13
|
-
profile?: number | undefined;
|
|
14
|
-
variant?: number | undefined;
|
|
15
|
-
};
|
|
16
|
-
interface Selector {
|
|
17
|
-
id?: number;
|
|
18
|
-
name: string;
|
|
19
|
-
members_count?: number;
|
|
20
|
-
variants?: {
|
|
21
|
-
id?: number;
|
|
22
|
-
name: string;
|
|
23
|
-
members_count?: number;
|
|
24
|
-
}[];
|
|
25
|
-
}
|
|
26
|
-
interface ExploreContextType {
|
|
27
|
-
metadata: any[];
|
|
28
|
-
loadingItems: boolean;
|
|
29
|
-
setLoadingItems: (q: boolean) => void;
|
|
30
|
-
loadingMetadata: boolean;
|
|
31
|
-
setLoadingMetadata: (q: boolean) => void;
|
|
32
|
-
resultCount: {
|
|
33
|
-
[key: number]: number;
|
|
34
|
-
};
|
|
35
|
-
totalCount: {
|
|
36
|
-
[key: number]: number;
|
|
37
|
-
};
|
|
38
|
-
setResultCount: (params: {
|
|
39
|
-
[key: number]: number;
|
|
40
|
-
} | false) => void;
|
|
41
|
-
activePage: number;
|
|
42
|
-
setActivePage: (page: number) => void;
|
|
43
|
-
pageSize: number;
|
|
44
|
-
results: SearchReportItem[];
|
|
45
|
-
filters: FiltersType;
|
|
46
|
-
doQuery: (cancelled: any, newOffset: any) => void;
|
|
47
|
-
setFilters: (filter: FiltersType) => void;
|
|
48
|
-
query: string;
|
|
49
|
-
setQuery: (q: string) => void;
|
|
50
|
-
debouncedQuery: string;
|
|
51
|
-
currentPageTotal: number;
|
|
52
|
-
selectorStructure: Selector[];
|
|
53
|
-
translations: ExploreTranslations;
|
|
54
|
-
setTranslations: (t: ExploreTranslations) => void;
|
|
55
|
-
showSelectors: boolean;
|
|
56
|
-
initExplore?: (p: number | undefined, v: number | undefined) => void;
|
|
57
|
-
}
|
|
58
|
-
declare const useExplore: () => ExploreContextType;
|
|
59
|
-
declare function ExploreProvider({ children, pageSize }: {
|
|
60
|
-
children: any;
|
|
61
|
-
pageSize?: number | undefined;
|
|
62
|
-
}): react_jsx_runtime.JSX.Element;
|
|
63
|
-
|
|
64
|
-
export { ExploreTranslations as E, ExploreProvider as a, useExplore as u };
|
package/dist/auth-693a652d.d.ts
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { UserProfile } from '@auth0/nextjs-auth0/client';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Auth and roles
|
|
5
|
-
* There is a convention for roles names (no diference with IDs);
|
|
6
|
-
* "Admin" : Manage users and roles
|
|
7
|
-
* "Editor": Manage reports
|
|
8
|
-
* "Writer": Manage posts
|
|
9
|
-
*/
|
|
10
|
-
declare const CMS_ROLES: {
|
|
11
|
-
ADMIN: string;
|
|
12
|
-
EDITOR: string;
|
|
13
|
-
WRITER: string;
|
|
14
|
-
};
|
|
15
|
-
type BespokeRole = {
|
|
16
|
-
id: string;
|
|
17
|
-
name: string;
|
|
18
|
-
description: string;
|
|
19
|
-
};
|
|
20
|
-
interface BespokeUserInfo extends UserProfile {
|
|
21
|
-
bespoke_app_metadata: {
|
|
22
|
-
reports?: {
|
|
23
|
-
reportId: number;
|
|
24
|
-
favorites: {
|
|
25
|
-
variantId: number;
|
|
26
|
-
contentId: number;
|
|
27
|
-
}[];
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
}[];
|
|
30
|
-
preferredLocale: string;
|
|
31
|
-
};
|
|
32
|
-
bespoke_user_metadata: {
|
|
33
|
-
preferredLocale?: string;
|
|
34
|
-
};
|
|
35
|
-
bespoke_roles: string[];
|
|
36
|
-
}
|
|
37
|
-
interface BespokeUserProfile extends UserProfile {
|
|
38
|
-
app_metadata: {
|
|
39
|
-
reports?: {
|
|
40
|
-
reportId: number;
|
|
41
|
-
favorites: {
|
|
42
|
-
variantId: number;
|
|
43
|
-
contentId: number;
|
|
44
|
-
}[];
|
|
45
|
-
[key: string]: unknown;
|
|
46
|
-
}[];
|
|
47
|
-
};
|
|
48
|
-
user_metadata: {
|
|
49
|
-
preferredLocale?: string;
|
|
50
|
-
};
|
|
51
|
-
roles: BespokeRole[];
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
export { BespokeUserProfile as B, CMS_ROLES as C, BespokeRole as a, BespokeUserInfo as b };
|
package/dist/auth.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as react from 'react';
|
|
2
|
-
import { WithPageAuthRequiredOptions } from '@auth0/nextjs-auth0/client';
|
|
3
|
-
export { UserProvider as BespokeUserProvider, useUser as useBespokeUser } from '@auth0/nextjs-auth0/client';
|
|
4
|
-
import { b as BespokeUserInfo } from './auth-693a652d.js';
|
|
5
|
-
export { C as CMS_ROLES } from './auth-693a652d.js';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
|
-
import { ButtonProps, MenuItemProps, MenuProps } from '@mantine/core';
|
|
8
|
-
|
|
9
|
-
declare function withPageRoleAuthRequired(params: {
|
|
10
|
-
allowedRoles: string[];
|
|
11
|
-
SuccessComponent: React.ComponentType<{
|
|
12
|
-
user: BespokeUserInfo;
|
|
13
|
-
}>;
|
|
14
|
-
FailureComponent: React.ComponentType;
|
|
15
|
-
options?: WithPageAuthRequiredOptions;
|
|
16
|
-
}): react.FC<{}>;
|
|
17
|
-
|
|
18
|
-
type BespokeLoginBtnTranslations = {
|
|
19
|
-
"Welcome message"?: string;
|
|
20
|
-
"Disconnect"?: string;
|
|
21
|
-
"Go to editor"?: string;
|
|
22
|
-
"Signing in"?: string;
|
|
23
|
-
"Sign in"?: string;
|
|
24
|
-
};
|
|
25
|
-
type BespokeLoginBtnProps = {
|
|
26
|
-
buttonProps?: ButtonProps;
|
|
27
|
-
editorMenuItemProps?: MenuItemProps;
|
|
28
|
-
editorMenuItemRoute?: string;
|
|
29
|
-
logoutButtonProps?: MenuItemProps;
|
|
30
|
-
menuProps?: MenuProps;
|
|
31
|
-
options?: React.ReactNode;
|
|
32
|
-
optionsPosition?: string;
|
|
33
|
-
translations?: BespokeLoginBtnTranslations;
|
|
34
|
-
withEditorMenuItem?: boolean;
|
|
35
|
-
withSession?: boolean;
|
|
36
|
-
};
|
|
37
|
-
declare function BespokeLoginBtn({ buttonProps, editorMenuItemProps, editorMenuItemRoute, logoutButtonProps, menuProps, options, optionsPosition, translations, withEditorMenuItem, withSession, }: BespokeLoginBtnProps): react_jsx_runtime.JSX.Element;
|
|
38
|
-
|
|
39
|
-
export { BespokeLoginBtn, withPageRoleAuthRequired as BespokeWithPageRoleAuthRequired };
|
package/dist/cms.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { NotificationsProps } from '@mantine/notifications';
|
|
2
|
-
|
|
3
|
-
interface BespokeManagerOptions {
|
|
4
|
-
title?: string;
|
|
5
|
-
notifications?: NotificationsProps;
|
|
6
|
-
pathSegment?: string;
|
|
7
|
-
locale?: string;
|
|
8
|
-
profilePrefix?: string;
|
|
9
|
-
}
|
|
10
|
-
declare function BespokeManager(options: BespokeManagerOptions): React.FC;
|
|
11
|
-
|
|
12
|
-
export { BespokeManager, BespokeManagerOptions };
|
package/dist/explore.d.ts
DELETED
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { FC, ReactElement, ReactNode } from 'react';
|
|
3
|
-
import { E as ExploreTranslations } from './ExploreProvider-ee7762cb.js';
|
|
4
|
-
export { a as BespokeExploreProvider, u as useBespokeExplore } from './ExploreProvider-ee7762cb.js';
|
|
5
|
-
import { ActionIconProps, ModalProps, TooltipProps, SelectItemProps, AutocompleteProps, AutocompleteItem } from '@mantine/core';
|
|
6
|
-
import { h as SearchReportParams } from './types-76133c94.js';
|
|
7
|
-
import 'sequelize';
|
|
8
|
-
|
|
9
|
-
interface ReportTileProps {
|
|
10
|
-
reportName: string;
|
|
11
|
-
members: Array<{
|
|
12
|
-
original_id: string;
|
|
13
|
-
name: string;
|
|
14
|
-
id: number;
|
|
15
|
-
variant: string;
|
|
16
|
-
image: {
|
|
17
|
-
src: string;
|
|
18
|
-
alt: string;
|
|
19
|
-
};
|
|
20
|
-
}>;
|
|
21
|
-
href: string;
|
|
22
|
-
onClick: (e: React.MouseEvent) => void;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
type BespokeExploreProps = {
|
|
26
|
-
locale?: string;
|
|
27
|
-
profilePrefix: string;
|
|
28
|
-
initialReportId?: number;
|
|
29
|
-
initialVariantId?: number;
|
|
30
|
-
translations?: ExploreTranslations;
|
|
31
|
-
reportTile?: FC<ReportTileProps>;
|
|
32
|
-
onSelect?: () => void;
|
|
33
|
-
};
|
|
34
|
-
/**
|
|
35
|
-
* React component for rendering a fully featured explore page
|
|
36
|
-
*/
|
|
37
|
-
declare function BespokeExplore({ profilePrefix, initialReportId, initialVariantId, translations, onSelect, reportTile, }: BespokeExploreProps): react_jsx_runtime.JSX.Element;
|
|
38
|
-
|
|
39
|
-
type BespokeExploreModalProps = {
|
|
40
|
-
exploreProps: BespokeExploreProps;
|
|
41
|
-
icon?: ReactElement;
|
|
42
|
-
actionIconProps?: Partial<ActionIconProps>;
|
|
43
|
-
modalProps?: Partial<ModalProps>;
|
|
44
|
-
tooltipProps?: Partial<TooltipProps>;
|
|
45
|
-
tooltipText?: string;
|
|
46
|
-
children?: ReactNode;
|
|
47
|
-
showIcon?: boolean;
|
|
48
|
-
showTooltip?: boolean;
|
|
49
|
-
};
|
|
50
|
-
/**
|
|
51
|
-
* React component for rendering a button that opens the Modal with explore
|
|
52
|
-
*/
|
|
53
|
-
declare function BespokeExploreModal({ exploreProps, icon, actionIconProps, modalProps, tooltipProps, tooltipText, showIcon, showTooltip, children }: BespokeExploreModalProps): react_jsx_runtime.JSX.Element;
|
|
54
|
-
|
|
55
|
-
type BespokeSearchProps = {
|
|
56
|
-
locale: string;
|
|
57
|
-
profilePrefix: string;
|
|
58
|
-
autocompleteProps?: Partial<AutocompleteProps & {
|
|
59
|
-
searchConfig: {
|
|
60
|
-
searchLimit?: number;
|
|
61
|
-
queryThreshold?: number;
|
|
62
|
-
};
|
|
63
|
-
}> | Record<string, never>;
|
|
64
|
-
tooltipProps?: Partial<TooltipProps>;
|
|
65
|
-
tooltipText?: string;
|
|
66
|
-
searchReportParams?: Partial<SearchReportParams>;
|
|
67
|
-
callback?: (item: AutocompleteItem) => void;
|
|
68
|
-
children?: ReactNode;
|
|
69
|
-
};
|
|
70
|
-
interface ReportItemPropsInner {
|
|
71
|
-
id: string;
|
|
72
|
-
reportName: string;
|
|
73
|
-
reportPath: string;
|
|
74
|
-
profilePrefix: string;
|
|
75
|
-
members: Array<{
|
|
76
|
-
original_id: string;
|
|
77
|
-
name: string;
|
|
78
|
-
id: number;
|
|
79
|
-
variant: string;
|
|
80
|
-
image: {
|
|
81
|
-
src: string;
|
|
82
|
-
alt: string;
|
|
83
|
-
};
|
|
84
|
-
}>;
|
|
85
|
-
href: string;
|
|
86
|
-
value: string;
|
|
87
|
-
}
|
|
88
|
-
type ReportItemProps = ReportItemPropsInner & SelectItemProps;
|
|
89
|
-
/**
|
|
90
|
-
* React component for rendering an inline search autocomplete
|
|
91
|
-
*/
|
|
92
|
-
declare function BespokeSearch({ locale, profilePrefix, autocompleteProps, tooltipProps, tooltipText, searchReportParams, callback, children }: BespokeSearchProps): react_jsx_runtime.JSX.Element;
|
|
93
|
-
|
|
94
|
-
export { BespokeExplore, BespokeExploreModal, ReportItemProps as BespokeReportItemProps, BespokeSearch };
|
package/dist/index.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import react__default from 'react';
|
|
3
|
-
|
|
4
|
-
interface ConfirmPrompt {
|
|
5
|
-
title?: string;
|
|
6
|
-
message: string;
|
|
7
|
-
cancelText?: string;
|
|
8
|
-
confirmText?: string;
|
|
9
|
-
}
|
|
10
|
-
type Prompt = ConfirmPrompt;
|
|
11
|
-
interface RequestFactory<T extends Prompt> {
|
|
12
|
-
(request: T, delayed?: false): Promise<void>;
|
|
13
|
-
(request: T, delayed: true): {
|
|
14
|
-
show(): Promise<void>;
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
type DialogContextProps = {
|
|
18
|
-
newConfirmation: RequestFactory<ConfirmPrompt>;
|
|
19
|
-
};
|
|
20
|
-
type DialogProviderProps = react__default.PropsWithChildren<{}>;
|
|
21
|
-
declare function DialogProvider(props: DialogProviderProps): react_jsx_runtime.JSX.Element;
|
|
22
|
-
declare function useDialog(): DialogContextProps;
|
|
23
|
-
|
|
24
|
-
export { DialogProvider, useDialog };
|
package/dist/redux-store.d.ts
DELETED
|
@@ -1,190 +0,0 @@
|
|
|
1
|
-
import { R as RecordsKey, b as AppThunk, S as StatusState, c as ReadMembersResult, V as ValidateVariantSlugResponse, d as RegenerateSearchResponse, e as ReadMembersParams, f as ReadMembersResponse, g as SearchMemberParams, h as SearchMemberResponse, i as AppDispatch, j as AppState } from './store-a09ce360.js';
|
|
2
|
-
export { s as storeWrapper } from './store-a09ce360.js';
|
|
3
|
-
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
4
|
-
import { A as AnyBlock, a as Result, b as AnyNestedBlock, N as NestedDimension, F as Formatter, c as AnyReport, d as AnyNestedReport, S as Section, e as NestedSection, V as Variant, f as ReadParams, D as Dimension, g as DeleteParams, h as SearchReportParams, i as SearchReportResponse, j as ReadMetadataParams, k as ReadMetadataResponse, l as SearchUsersParams, U as UpdateUserParams, m as UpdateMyDataParams, n as ReadPrivateBlocksParams, o as ReadPrivateBlocksResponse, p as RevalidateUrlRequest, q as RevalidateUrlResponse, r as RevalidateReportRequest, s as RevalidateReportResponse } from './types-76133c94.js';
|
|
5
|
-
import { B as BespokeUserProfile } from './auth-693a652d.js';
|
|
6
|
-
import { TypedUseSelectorHook } from 'react-redux';
|
|
7
|
-
import 'react';
|
|
8
|
-
import 'next/app';
|
|
9
|
-
import 'next';
|
|
10
|
-
import 'querystring';
|
|
11
|
-
import 'next-redux-wrapper';
|
|
12
|
-
import '@reduxjs/toolkit/dist/configureStore';
|
|
13
|
-
import '@mantine/core';
|
|
14
|
-
import 'sequelize';
|
|
15
|
-
import '@auth0/nextjs-auth0/client';
|
|
16
|
-
|
|
17
|
-
interface ResourceContextType {
|
|
18
|
-
pathSegment: string;
|
|
19
|
-
formatterFunctions: Record<string, Record<string, (value: any) => string>>;
|
|
20
|
-
profilePrefix: string;
|
|
21
|
-
siteProps?: Record<string, any>;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
type VariableUpdateParams = {
|
|
25
|
-
sid: number;
|
|
26
|
-
bid: number;
|
|
27
|
-
previews: Record<string, any>[];
|
|
28
|
-
query: Record<string, any>;
|
|
29
|
-
};
|
|
30
|
-
|
|
31
|
-
declare const createEntity: <T extends RecordsKey>(type: T, payload: Parameters<{
|
|
32
|
-
block: (payload: Pick<AnyBlock, "type" | "blockrow" | "blockcol" | "section_id"> & {
|
|
33
|
-
locales: string[];
|
|
34
|
-
}) => AppThunk<Promise<Result<AnyNestedBlock, string>>>;
|
|
35
|
-
dimension: (payload: Pick<NestedDimension, "name" | "report_id">) => AppThunk<Promise<Result<NestedDimension, string>>>;
|
|
36
|
-
formatter: (payload: Pick<Formatter, "content" | "name">) => AppThunk<Promise<Result<Formatter, string>>>;
|
|
37
|
-
report: (payload: Pick<AnyReport, "name">) => AppThunk<Promise<Result<AnyNestedReport, string>>>;
|
|
38
|
-
section: (payload: Pick<Section, "report_id" | "ordering">) => AppThunk<Promise<Result<NestedSection, string>>>;
|
|
39
|
-
variant: (payload: Pick<Variant, "name" | "dimension_id" | "slug">) => AppThunk<Promise<Result<Variant, string>>>;
|
|
40
|
-
}[T]>[0]) => any;
|
|
41
|
-
declare const readEntity: <T extends RecordsKey>(type: T, payload: Parameters<{
|
|
42
|
-
block: (payload: ReadParams) => AppThunk<Promise<Result<AnyNestedBlock[] | AnyBlock[], string>>>;
|
|
43
|
-
dimension: (payload: ReadParams) => AppThunk<Promise<Result<NestedDimension[] | Dimension[], string>>>;
|
|
44
|
-
formatter: (payload: ReadParams) => AppThunk<Promise<Result<Formatter[], string>>>;
|
|
45
|
-
report: (payload: ReadParams) => AppThunk<Promise<Result<AnyNestedReport[] | AnyReport[], string>>>;
|
|
46
|
-
section: (payload: ReadParams) => AppThunk<Promise<Result<NestedSection[] | Section[], string>>>;
|
|
47
|
-
variant: (payload: ReadParams) => AppThunk<Promise<Result<Variant[], string>>>;
|
|
48
|
-
}[T]>[0]) => any;
|
|
49
|
-
declare const updateEntity: <T extends RecordsKey>(type: T, payload: Parameters<{
|
|
50
|
-
block: (payload: Partial<AnyNestedBlock> & {
|
|
51
|
-
id: number;
|
|
52
|
-
inputAction?: {
|
|
53
|
-
operation: "create" | "delete";
|
|
54
|
-
input: {
|
|
55
|
-
input_id: number;
|
|
56
|
-
block_id: number;
|
|
57
|
-
};
|
|
58
|
-
} | undefined;
|
|
59
|
-
}) => AppThunk<Promise<Result<AnyNestedBlock, string>>>;
|
|
60
|
-
dimension: (payload: Partial<NestedDimension> & {
|
|
61
|
-
id: number;
|
|
62
|
-
}) => AppThunk<Promise<Result<NestedDimension, string>>>;
|
|
63
|
-
formatter: (payload: Partial<Formatter> & {
|
|
64
|
-
id: number;
|
|
65
|
-
}) => AppThunk<Promise<Result<Formatter, string>>>;
|
|
66
|
-
report: (payload: Partial<AnyNestedReport> & {
|
|
67
|
-
id: number;
|
|
68
|
-
}) => AppThunk<Promise<Result<AnyNestedReport, string>>>;
|
|
69
|
-
section: (payload: Partial<NestedSection> & {
|
|
70
|
-
id: number;
|
|
71
|
-
}) => AppThunk<Promise<Result<NestedSection, string>>>;
|
|
72
|
-
variant: (payload: Partial<Variant> & {
|
|
73
|
-
id: number;
|
|
74
|
-
}) => AppThunk<Promise<Result<Variant, string>>>;
|
|
75
|
-
}[T]>[0]) => any;
|
|
76
|
-
declare const deleteEntity: <T extends RecordsKey>(type: T, payload: Parameters<{
|
|
77
|
-
block: (payload: DeleteParams) => AppThunk<Promise<void>>;
|
|
78
|
-
dimension: (payload: DeleteParams) => AppThunk<Promise<void>>;
|
|
79
|
-
formatter: (payload: DeleteParams) => AppThunk<Promise<void>>;
|
|
80
|
-
report: (payload: DeleteParams) => AppThunk<Promise<void>>;
|
|
81
|
-
section: (payload: DeleteParams) => AppThunk<Promise<void>>;
|
|
82
|
-
variant: (payload: DeleteParams) => AppThunk<Promise<void>>;
|
|
83
|
-
}[T]>[0]) => any;
|
|
84
|
-
declare const cloneEntity: <T extends RecordsKey>(type: T, payload: Parameters<Record<RecordsKey, AnyThunk>[T]>[0]) => any;
|
|
85
|
-
type AnyThunk = (p: any) => any;
|
|
86
|
-
|
|
87
|
-
declare const setStatus: _reduxjs_toolkit.ActionCreatorWithPayload<Partial<StatusState>, "status/setStatus">;
|
|
88
|
-
declare const setPreviews: _reduxjs_toolkit.ActionCreatorWithPayload<ReadMembersResult[], "status/setPreviews">;
|
|
89
|
-
declare const setSectionState: _reduxjs_toolkit.ActionCreatorWithPayload<Record<number, any>, "status/setSectionState">;
|
|
90
|
-
declare const resetSectionState: _reduxjs_toolkit.ActionCreatorWithPayload<number, "status/resetSectionState">;
|
|
91
|
-
declare const setCurrentLocale: _reduxjs_toolkit.ActionCreatorWithPayload<string, "status/setCurrentLocale">;
|
|
92
|
-
declare const setPreferredLocale: _reduxjs_toolkit.ActionCreatorWithPayload<string, "status/setPreferredLocale">;
|
|
93
|
-
declare function variantValidateSlug(dimension: number, slug: string): AppThunk<Promise<ValidateVariantSlugResponse>>;
|
|
94
|
-
declare function reportSearch(filters: SearchReportParams): AppThunk<Promise<SearchReportResponse>>;
|
|
95
|
-
declare function searchRegenerate(): AppThunk<Promise<RegenerateSearchResponse>>;
|
|
96
|
-
declare function readMember(params: ReadMembersParams): AppThunk<Promise<ReadMembersResponse>>;
|
|
97
|
-
declare function searchMember(params: SearchMemberParams): AppThunk<Promise<SearchMemberResponse>>;
|
|
98
|
-
/** Deletes a given key from the current query parameters */
|
|
99
|
-
declare function deleteQueryParam(resource: any, key: any): (dispatch: any, getState: any) => Promise<void>;
|
|
100
|
-
/** Adds to or edits the current status query parameters to include the given key/val */
|
|
101
|
-
declare function setQueryParam(resource: any, key: any, value: any): (dispatch: any, getState: any) => Promise<void>;
|
|
102
|
-
declare function recalculateVariables(resource: Pick<ResourceContextType, "formatterFunctions">, params?: Partial<VariableUpdateParams>): AppThunk;
|
|
103
|
-
declare function readMetadata(filters: ReadMetadataParams): AppThunk<Promise<ReadMetadataResponse>>;
|
|
104
|
-
declare function urlProxy(url: string): AppThunk<Promise<any>>;
|
|
105
|
-
/** Users actions */
|
|
106
|
-
declare function searchRole(): AppThunk<Promise<any>>;
|
|
107
|
-
declare function searchUser(filters: SearchUsersParams): AppThunk<Promise<any>>;
|
|
108
|
-
declare function readUser(userId: string): AppThunk<Promise<BespokeUserProfile>>;
|
|
109
|
-
declare function updateUser({ user }: {
|
|
110
|
-
user: UpdateUserParams;
|
|
111
|
-
}): AppThunk<Promise<any>>;
|
|
112
|
-
declare function updateMyData(params: UpdateMyDataParams): AppThunk<Promise<any>>;
|
|
113
|
-
/** Remove a list of blocks from state, only used for private blocks during getStaticProps */
|
|
114
|
-
declare function removeBlocksFromState(privateBlockIds: any): (dispatch: any) => Promise<void>;
|
|
115
|
-
declare function addBlockToState(newBlocks: any): (dispatch: any) => Promise<void>;
|
|
116
|
-
declare function readPrivateBlocks(params: ReadPrivateBlocksParams): AppThunk<Promise<ReadPrivateBlocksResponse>>;
|
|
117
|
-
declare function revalidateUrl(params: RevalidateUrlRequest): AppThunk<Promise<RevalidateUrlResponse>>;
|
|
118
|
-
declare function revalidateReport(params: RevalidateReportRequest): AppThunk<Promise<RevalidateReportResponse>>;
|
|
119
|
-
|
|
120
|
-
declare const actions_addBlockToState: typeof addBlockToState;
|
|
121
|
-
declare const actions_cloneEntity: typeof cloneEntity;
|
|
122
|
-
declare const actions_createEntity: typeof createEntity;
|
|
123
|
-
declare const actions_deleteEntity: typeof deleteEntity;
|
|
124
|
-
declare const actions_deleteQueryParam: typeof deleteQueryParam;
|
|
125
|
-
declare const actions_readEntity: typeof readEntity;
|
|
126
|
-
declare const actions_readMember: typeof readMember;
|
|
127
|
-
declare const actions_readMetadata: typeof readMetadata;
|
|
128
|
-
declare const actions_readPrivateBlocks: typeof readPrivateBlocks;
|
|
129
|
-
declare const actions_readUser: typeof readUser;
|
|
130
|
-
declare const actions_recalculateVariables: typeof recalculateVariables;
|
|
131
|
-
declare const actions_removeBlocksFromState: typeof removeBlocksFromState;
|
|
132
|
-
declare const actions_reportSearch: typeof reportSearch;
|
|
133
|
-
declare const actions_resetSectionState: typeof resetSectionState;
|
|
134
|
-
declare const actions_revalidateReport: typeof revalidateReport;
|
|
135
|
-
declare const actions_revalidateUrl: typeof revalidateUrl;
|
|
136
|
-
declare const actions_searchMember: typeof searchMember;
|
|
137
|
-
declare const actions_searchRegenerate: typeof searchRegenerate;
|
|
138
|
-
declare const actions_searchRole: typeof searchRole;
|
|
139
|
-
declare const actions_searchUser: typeof searchUser;
|
|
140
|
-
declare const actions_setCurrentLocale: typeof setCurrentLocale;
|
|
141
|
-
declare const actions_setPreferredLocale: typeof setPreferredLocale;
|
|
142
|
-
declare const actions_setPreviews: typeof setPreviews;
|
|
143
|
-
declare const actions_setQueryParam: typeof setQueryParam;
|
|
144
|
-
declare const actions_setSectionState: typeof setSectionState;
|
|
145
|
-
declare const actions_setStatus: typeof setStatus;
|
|
146
|
-
declare const actions_updateEntity: typeof updateEntity;
|
|
147
|
-
declare const actions_updateMyData: typeof updateMyData;
|
|
148
|
-
declare const actions_updateUser: typeof updateUser;
|
|
149
|
-
declare const actions_urlProxy: typeof urlProxy;
|
|
150
|
-
declare const actions_variantValidateSlug: typeof variantValidateSlug;
|
|
151
|
-
declare namespace actions {
|
|
152
|
-
export {
|
|
153
|
-
actions_addBlockToState as addBlockToState,
|
|
154
|
-
actions_cloneEntity as cloneEntity,
|
|
155
|
-
actions_createEntity as createEntity,
|
|
156
|
-
actions_deleteEntity as deleteEntity,
|
|
157
|
-
actions_deleteQueryParam as deleteQueryParam,
|
|
158
|
-
actions_readEntity as readEntity,
|
|
159
|
-
actions_readMember as readMember,
|
|
160
|
-
actions_readMetadata as readMetadata,
|
|
161
|
-
actions_readPrivateBlocks as readPrivateBlocks,
|
|
162
|
-
actions_readUser as readUser,
|
|
163
|
-
actions_recalculateVariables as recalculateVariables,
|
|
164
|
-
actions_removeBlocksFromState as removeBlocksFromState,
|
|
165
|
-
actions_reportSearch as reportSearch,
|
|
166
|
-
actions_resetSectionState as resetSectionState,
|
|
167
|
-
actions_revalidateReport as revalidateReport,
|
|
168
|
-
actions_revalidateUrl as revalidateUrl,
|
|
169
|
-
actions_searchMember as searchMember,
|
|
170
|
-
actions_searchRegenerate as searchRegenerate,
|
|
171
|
-
actions_searchRole as searchRole,
|
|
172
|
-
actions_searchUser as searchUser,
|
|
173
|
-
actions_setCurrentLocale as setCurrentLocale,
|
|
174
|
-
actions_setPreferredLocale as setPreferredLocale,
|
|
175
|
-
actions_setPreviews as setPreviews,
|
|
176
|
-
actions_setQueryParam as setQueryParam,
|
|
177
|
-
actions_setSectionState as setSectionState,
|
|
178
|
-
actions_setStatus as setStatus,
|
|
179
|
-
actions_updateEntity as updateEntity,
|
|
180
|
-
actions_updateMyData as updateMyData,
|
|
181
|
-
actions_updateUser as updateUser,
|
|
182
|
-
actions_urlProxy as urlProxy,
|
|
183
|
-
actions_variantValidateSlug as variantValidateSlug,
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
declare const useAppDispatch: () => AppDispatch;
|
|
188
|
-
declare const useAppSelector: TypedUseSelectorHook<AppState>;
|
|
189
|
-
|
|
190
|
-
export { AppDispatch, AppState, actions, useAppDispatch as useBespokeDispatch, useAppSelector as useBespokeSelector };
|
package/dist/report.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { MantineProviderProps } from '@mantine/core';
|
|
3
|
-
import { E as ExploreTranslations } from './ExploreProvider-ee7762cb.js';
|
|
4
|
-
import { ReactNode } from 'react';
|
|
5
|
-
import './types-76133c94.js';
|
|
6
|
-
import 'sequelize';
|
|
7
|
-
|
|
8
|
-
type TranslationKeys$3 = "data_source" | "no_data_src" | "viz_source" | "error_generating" | "choose_data_src" | "original_src" | "loading" | "error_preview" | "open_in_window" | "formatted_src" | "formatted_group" | "raw_group" | "rows_preview" | "choose_format" | "processing_file" | "download" | "preview" | "copy" | "copied";
|
|
9
|
-
type DataTabTranslations = Record<TranslationKeys$3, string>;
|
|
10
|
-
|
|
11
|
-
type TranslationKeys$2 = "wrong_node" | "choose_area" | "choose_viz" | "choose_format" | "transparent_bg" | "processing" | "download" | "entire_section" | "source" | "viz_only";
|
|
12
|
-
type ImageTabTranslations = Record<TranslationKeys$2, string>;
|
|
13
|
-
|
|
14
|
-
type TranslationKeys$1 = "title" | "include_section";
|
|
15
|
-
type ShareTabTraslations = Record<TranslationKeys$1, string>;
|
|
16
|
-
|
|
17
|
-
interface OptionsModalTranslations {
|
|
18
|
-
download_title: string;
|
|
19
|
-
image_title: string;
|
|
20
|
-
share_title: string;
|
|
21
|
-
download_tab?: Partial<DataTabTranslations>;
|
|
22
|
-
image_tab?: Partial<ImageTabTranslations>;
|
|
23
|
-
share_tab?: Partial<ShareTabTraslations>;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
type TranslationKeys = "image_by";
|
|
27
|
-
type SectionTranslations = Record<TranslationKeys, string>;
|
|
28
|
-
|
|
29
|
-
interface ReportTranslations {
|
|
30
|
-
"options"?: Partial<OptionsModalTranslations>;
|
|
31
|
-
"explore"?: Partial<ExploreTranslations>;
|
|
32
|
-
"sections"?: Partial<SectionTranslations>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
interface BespokeRendererProps {
|
|
36
|
-
pathSegmentsKey: string;
|
|
37
|
-
translations: ReportTranslations;
|
|
38
|
-
bespokeStyles: any;
|
|
39
|
-
buildTime: string;
|
|
40
|
-
profilePrefix: string;
|
|
41
|
-
siteProps: Record<string, any>;
|
|
42
|
-
loader?: ReactNode;
|
|
43
|
-
mantineProviderProps?: Partial<MantineProviderProps>;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* React component for rendering a report
|
|
47
|
-
*/
|
|
48
|
-
declare function BespokeRenderer({ pathSegmentsKey, translations, bespokeStyles, buildTime, siteProps, profilePrefix, loader, mantineProviderProps, }: BespokeRendererProps): react_jsx_runtime.JSX.Element;
|
|
49
|
-
|
|
50
|
-
export { BespokeRenderer, BespokeRendererProps, ReportTranslations as BespokeReportTranslations };
|