@datawheel/bespoke 0.9.2 → 0.10.0-beta.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.
@@ -0,0 +1,132 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { E as ExploreTranslations, a as ReportItemProps, R as ReportTileProps } from './Search-BWmRyIa9.mjs';
3
+ import './auth-BwgF4GT9.mjs';
4
+ import { MRT_Localization } from 'mantine-react-table';
5
+ import { ReactNode } from 'react';
6
+ import { ModalProps, AutocompleteProps } from '@mantine/core';
7
+ export { u as SearchReportItem } from './types-BcIo0oyw.mjs';
8
+ import 'next-auth';
9
+ import 'next-auth/react';
10
+ import 'sequelize';
11
+
12
+ 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";
13
+ type DataTabTranslations = Record<TranslationKeys$3, string>;
14
+
15
+ type TranslationKeys$2 = "wrong_node" | "choose_area" | "choose_viz" | "choose_format" | "transparent_bg" | "processing" | "download" | "entire_section" | "source" | "viz_only";
16
+ type ImageTabTranslations = Record<TranslationKeys$2, string>;
17
+
18
+ type TranslationKeys$1 = "title" | "include_section";
19
+ type ShareTabTraslations = Record<TranslationKeys$1, string>;
20
+
21
+ interface OptionsModalTranslations {
22
+ download_title: string;
23
+ image_title: string;
24
+ share_title: string;
25
+ download_tab?: Partial<DataTabTranslations>;
26
+ image_tab?: Partial<ImageTabTranslations>;
27
+ share_tab?: Partial<ShareTabTraslations>;
28
+ }
29
+
30
+ type TranslationKeys = "image_by";
31
+ type SectionTranslations = Record<TranslationKeys, string>;
32
+
33
+ type OutlineNode = {
34
+ id: number;
35
+ order: number;
36
+ label: string;
37
+ iconProps: {
38
+ iconType: string;
39
+ icon: string;
40
+ iconSize: string;
41
+ iconVariant: string;
42
+ iconRadius: string;
43
+ };
44
+ properties: {
45
+ sectionId?: number;
46
+ titleType?: "primary" | "secondary";
47
+ [key: string]: any;
48
+ };
49
+ children: OutlineNode[];
50
+ };
51
+
52
+ interface DownloadOptionsTranslations {
53
+ export: string;
54
+ pdf: {
55
+ label: string;
56
+ desc: string;
57
+ cancel: string;
58
+ export: string;
59
+ generating: string;
60
+ selectAll: string;
61
+ deselectAll: string;
62
+ selectSectionsDescription: string;
63
+ sectionsSelected: string;
64
+ };
65
+ xlsx: {
66
+ label: string;
67
+ desc: string;
68
+ };
69
+ }
70
+ interface PdfSectionSelectorPanelProps {
71
+ translations: DownloadOptionsTranslations;
72
+ content: OutlineNode[];
73
+ selection: {
74
+ topLevelState: {
75
+ isChecked: boolean;
76
+ isIndeterminate: boolean;
77
+ };
78
+ getSelectionState: (node: OutlineNode) => {
79
+ isChecked: boolean;
80
+ isIndeterminate: boolean;
81
+ };
82
+ selectedSections: Set<number>;
83
+ };
84
+ download: {
85
+ isDownloading: boolean;
86
+ handleDownload: () => void;
87
+ };
88
+ callbacks: {
89
+ handleToggleSection: (id: number, isSelected: boolean) => void;
90
+ handleTopLevelToggle: (checked: boolean) => void;
91
+ handleSelectAll: () => void;
92
+ handleDeselectAll: () => void;
93
+ };
94
+ }
95
+
96
+ interface ReportTranslations {
97
+ "options"?: Partial<OptionsModalTranslations>;
98
+ "explore"?: Partial<ExploreTranslations>;
99
+ "sections"?: Partial<SectionTranslations>;
100
+ "export"?: Partial<DownloadOptionsTranslations>;
101
+ "table"?: Partial<MRT_Localization>;
102
+ }
103
+
104
+ interface BespokeComponentsType {
105
+ SearchResultItem?: React.ComponentType<ReportItemProps>;
106
+ ExploreCard?: React.FC<ReportTileProps>;
107
+ FallbackComponent?: React.FC<{
108
+ block: any;
109
+ }>;
110
+ PdfSectionPanel?: (state: PdfSectionSelectorPanelProps) => React.ReactElement;
111
+ SearchModalProps?: Partial<ModalProps>;
112
+ SearchFieldProps?: Partial<AutocompleteProps>;
113
+ }
114
+
115
+ interface BespokeRendererProps {
116
+ className?: string;
117
+ pathSegmentsKey: string;
118
+ translations?: ReportTranslations;
119
+ buildTime: string;
120
+ components?: Partial<BespokeComponentsType>;
121
+ profilePrefix: string;
122
+ siteProps: Record<string, any>;
123
+ loader?: ReactNode;
124
+ sectionLoader?: ReactNode;
125
+ mode?: "embed";
126
+ }
127
+ /**
128
+ * React component for rendering a report
129
+ */
130
+ declare function BespokeRenderer({ className, pathSegmentsKey, translations, components, buildTime, siteProps, profilePrefix, loader, sectionLoader, mode, }: BespokeRendererProps): react_jsx_runtime.JSX.Element;
131
+
132
+ export { type BespokeComponentsType, BespokeRenderer, type BespokeRendererProps, type ReportTranslations as BespokeReportTranslations, type PdfSectionSelectorPanelProps, ReportItemProps, ReportTileProps };