@devgateway/dvz-wp-commons 1.0.0

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.
Files changed (50) hide show
  1. package/LICENSE +7 -0
  2. package/README.md +0 -0
  3. package/build/APIConfig.d.ts +49 -0
  4. package/build/APIConfig.js +302 -0
  5. package/build/APIutils.d.ts +4 -0
  6. package/build/APIutils.js +30 -0
  7. package/build/Blocks.d.ts +90 -0
  8. package/build/Blocks.js +374 -0
  9. package/build/CSVSourceConfig.d.ts +11 -0
  10. package/build/CSVSourceConfig.js +48 -0
  11. package/build/ChartColors.d.ts +55 -0
  12. package/build/ChartColors.js +401 -0
  13. package/build/ChartLegends.d.ts +33 -0
  14. package/build/ChartLegends.js +71 -0
  15. package/build/ChartMeasures.d.ts +23 -0
  16. package/build/ChartMeasures.js +117 -0
  17. package/build/Constants.d.ts +15 -0
  18. package/build/Constants.js +15 -0
  19. package/build/DataFilters.d.ts +13 -0
  20. package/build/DataFilters.js +98 -0
  21. package/build/Format.d.ts +12 -0
  22. package/build/Format.js +385 -0
  23. package/build/MapCSVSourceConfig.d.ts +12 -0
  24. package/build/MapCSVSourceConfig.js +12 -0
  25. package/build/Measures.d.ts +25 -0
  26. package/build/Measures.js +126 -0
  27. package/build/MobileConfigUtils.d.ts +6 -0
  28. package/build/MobileConfigUtils.js +88 -0
  29. package/build/Tooltip.d.ts +3 -0
  30. package/build/Tooltip.js +53 -0
  31. package/build/Util.d.ts +7 -0
  32. package/build/Util.js +11 -0
  33. package/build/hooks/index.d.ts +0 -0
  34. package/build/hooks/index.js +3 -0
  35. package/build/hooks/useSetting.d.ts +2 -0
  36. package/build/hooks/useSetting.js +11 -0
  37. package/build/icons/Chart.d.ts +3 -0
  38. package/build/icons/Chart.js +14 -0
  39. package/build/icons/Generic.d.ts +3 -0
  40. package/build/icons/Generic.js +5 -0
  41. package/build/icons/index.d.ts +2 -0
  42. package/build/icons/index.js +2 -0
  43. package/build/index.d.ts +18 -0
  44. package/build/index.js +19 -0
  45. package/build/post-type.d.ts +193 -0
  46. package/build/post-type.js +12 -0
  47. package/build/tsconfig.tsbuildinfo +1 -0
  48. package/build/types.d.ts +349 -0
  49. package/build/types.js +33 -0
  50. package/package.json +74 -0
@@ -0,0 +1,126 @@
1
+ import React from 'react';
2
+ import { __ } from '@wordpress/i18n';
3
+ import { CheckboxControl, PanelBody, PanelRow, SelectControl, ToggleControl, TextControl } from '@wordpress/components';
4
+ import Format from './Format';
5
+ import { togglePanel } from "./Util";
6
+ import { getTranslation } from "./APIutils";
7
+ const defaultFormat = {
8
+ "style": "percent",
9
+ "minimumFractionDigits": 1,
10
+ "maximumFractionDigits": 1,
11
+ "currency": "USD"
12
+ };
13
+ export const Measures = (props) => {
14
+ const { onMeasuresChange, onFormatChange, onUseCustomAxisFormatChange, onSetSingleMeasure, onCustomLabelToggleChange, onCustomLabelChange, allMeasures, setAttributes, title, format, attributes: { panelStatus, measures, dimension1, dimension2, type, app } } = props;
15
+ const MToggle = ({ measure }) => {
16
+ const userMeasure = measures[app] ? measures[app][measure.value] : {};
17
+ return (React.createElement(ToggleControl, { label: getTranslation(measure), checked: userMeasure ? userMeasure.selected : false, onChange: (value) => onMeasuresChange?.(measure.value) }));
18
+ };
19
+ const MCheckbox = ({ measure }) => {
20
+ const userMeasure = measures[app] ? measures[app][measure.value] : {};
21
+ let isChecked;
22
+ if (measures instanceof Array) {
23
+ isChecked = measures.includes(measure.value);
24
+ }
25
+ else {
26
+ isChecked = userMeasure ? userMeasure.selected : false;
27
+ }
28
+ return React.createElement(CheckboxControl, { label: getTranslation(measure), checked: isChecked, onChange: (value) => onSetSingleMeasure(measure.value) });
29
+ };
30
+ const MeasureOptions = ({ measure, single }) => {
31
+ return React.createElement(PanelRow, null,
32
+ single && React.createElement(MCheckbox, { measure: measure }),
33
+ !single && React.createElement(MToggle, { measure: measure }));
34
+ };
35
+ const countSelected = (g) => {
36
+ if (measures[app]) {
37
+ const mG = allMeasures.filter(f => getTranslation(f.group) === g);
38
+ let count = 0;
39
+ Object.keys(measures[app]).filter(l => mG.map(m => m.value).indexOf(l) > -1).forEach(k => {
40
+ if (measures[app][k].selected) {
41
+ count++;
42
+ }
43
+ });
44
+ return count;
45
+ }
46
+ return 0;
47
+ };
48
+ const countTotal = (g) => {
49
+ if (g) {
50
+ return allMeasures.filter(f => getTranslation(f.group) === g).length;
51
+ }
52
+ return 0;
53
+ };
54
+ const getSelectedMeasures = () => {
55
+ if (measures[app] && allMeasures) {
56
+ return Object.keys(measures[app]).filter(k => measures[app][k].selected).map(k => {
57
+ return allMeasures.filter(m => m.value === k)[0];
58
+ }).filter(m => m);
59
+ }
60
+ return [];
61
+ };
62
+ const selectedMeasures = getSelectedMeasures();
63
+ return React.createElement(React.Fragment, null,
64
+ React.createElement(PanelBody, { title: title ? title : __("Measures"), initialOpen: panelStatus["MEASURES"], onToggle: e => togglePanel("MEASURES", panelStatus, setAttributes) },
65
+ /*
66
+ Multiple measures conditions
67
+
68
+ Bar:
69
+ no dimensions selected
70
+ one dimension is selected
71
+ - not available when second dimension gets selected
72
+
73
+ Line:
74
+ - Always multi measure as measures represents line series, one dimension should always be selected
75
+
76
+ Pie:
77
+ no dimensions selected
78
+ - not available when any dimension is selected
79
+ */
80
+ ((type == 'line') || (type == 'radar') ||
81
+ (type == 'bar' && dimension2 == 'none') ||
82
+ (type == 'pie' && dimension1 == 'none' && dimension2 == 'none')) && allMeasures && [...new Set(allMeasures.map(p => getTranslation(p.group)))].map(g => {
83
+ return (React.createElement(PanelBody, { initialOpen: panelStatus[g], onToggle: e => togglePanel(g, panelStatus, setAttributes), title: `${g} (${countSelected(g)} / ${countTotal(g)} ) ` }, allMeasures.filter(f => getTranslation(f.group) === g)
84
+ .map(m => React.createElement(PanelRow, null,
85
+ React.createElement(MeasureOptions, { single: false, measure: m })))));
86
+ }),
87
+ /*Single measure conditions
88
+
89
+ Bar:
90
+ 2 dimensions selected
91
+ Line:
92
+ never
93
+ Pie:
94
+ any dimensions selected
95
+
96
+ */
97
+ ((type == 'big-number') || (type == 'bar' && dimension2 != 'none') || (type == 'pie' && (dimension1 != 'none' || dimension2 != 'none'))) && allMeasures && [...new Set(allMeasures.map(p => getTranslation(p.group)))].map(g => {
98
+ return (React.createElement(PanelBody, { initialOpen: panelStatus[g], onToggle: e => togglePanel(g, panelStatus, setAttributes), title: `${g} (${countSelected(g)} / ${countTotal(g)} ) ` }, allMeasures.filter(f => getTranslation(f.group) === g)
99
+ .map(m => React.createElement(PanelRow, null,
100
+ React.createElement(MeasureOptions, { single: true, measure: m })))));
101
+ }),
102
+ (type == 'overlay') && allMeasures && React.createElement(SelectControl, { label: "Measure",
103
+ // @ts-ignore
104
+ value: selectedMeasures && selectedMeasures[0] ? selectedMeasures[0].value : null, options: [{ value: '', label: 'Select Measure' }, ...allMeasures], onChange: (measure) => onSetSingleMeasure(measure), __nextHasNoMarginBottom: true }),
105
+ (type != 'overlay') && React.createElement(PanelBody, { title: __("Format"), initialOpen: panelStatus["FORMAT"], onToggle: e => togglePanel("FORMAT", panelStatus, setAttributes) },
106
+ React.createElement(Format, { hiddenCustomAxisFormat: type == 'radar' || type == 'big-number', format: format || (measures[app] && measures[app].format ? measures[app].format : defaultFormat), customFormat: measures[app] && measures[app].customFormat ? measures[app].customFormat : defaultFormat, useCustomAxisFormat: measures[app] ? measures[app].useCustomAxisFormat : false, onFormatChange: (format, field) => {
107
+ onFormatChange(format, field);
108
+ }, onUseCustomAxisFormatChange: value => {
109
+ onUseCustomAxisFormatChange?.(value);
110
+ } }))),
111
+ (type != 'overlay') && selectedMeasures && selectedMeasures.length > 0 &&
112
+ React.createElement(PanelBody, { title: __("Measure Label Customization"), initialOpen: panelStatus["MEASURES_LABEL_CUSTOMIZATION"], onToggle: e => togglePanel("MEASURES_LABEL_CUSTOMIZATION", panelStatus, setAttributes) }, selectedMeasures && [...new Set(selectedMeasures.map(p => getTranslation(p.group)))].map(g => {
113
+ return (React.createElement(PanelBody, { initialOpen: panelStatus[g + "_LABEL_CUSTOMIZATION"], onToggle: e => togglePanel(g + "_LABEL_CUSTOMIZATION", panelStatus, setAttributes), title: `${g}` }, selectedMeasures.filter(f => getTranslation(f.group) === g)
114
+ .map(m => {
115
+ const userMeasure = measures[app] ? measures[app][m.value] : {};
116
+ return (React.createElement(React.Fragment, null,
117
+ React.createElement(PanelRow, null,
118
+ React.createElement(ToggleControl, { label: getTranslation(m), checked: userMeasure ? userMeasure.hasCustomLabel : false, onChange: (value) => onCustomLabelToggleChange?.(m.value) }),
119
+ " "),
120
+ userMeasure.hasCustomLabel &&
121
+ React.createElement(PanelRow, null,
122
+ React.createElement(TextControl, { label: __("Custom Label"), value: userMeasure ? userMeasure.customLabel : "", onChange: (value) => onCustomLabelChange?.(m.value, value) }))));
123
+ })));
124
+ })));
125
+ };
126
+ export default Measures;
@@ -0,0 +1,6 @@
1
+ export declare function extractAxisValues(csvData: string): string[];
2
+ export declare function transformDataToAppObject(data: any[], appName: string, existingObject?: any): any;
3
+ export declare function getSelectedItemsForApp(config: Record<string, any>, appName: string): {};
4
+ export declare function getSelectedLabelsForApp(data: any, appName: string): any[];
5
+ export declare function updateMeasureLabels(data: any, measures: any, app: string): void;
6
+ export declare function getStoredOrSetItem(key: any, fallback: any, overwrite?: boolean): any;
@@ -0,0 +1,88 @@
1
+ import isEmpty from 'lodash.isempty';
2
+ import { getTranslatedOptions } from "./APIutils";
3
+ export function extractAxisValues(csvData) {
4
+ const lines = csvData.split("\n");
5
+ const firstColumnValues = lines?.slice(1)?.map((row) => {
6
+ return row.split(",")[0];
7
+ });
8
+ return firstColumnValues;
9
+ }
10
+ export function transformDataToAppObject(data, appName, existingObject = {}) {
11
+ if (existingObject[appName] !== undefined) {
12
+ return existingObject;
13
+ }
14
+ existingObject[appName] = {};
15
+ data?.forEach((item) => {
16
+ const key = item.value;
17
+ existingObject[appName][key] = {
18
+ selected: false,
19
+ format: {
20
+ style: "percent",
21
+ minimumFractionDigits: 1,
22
+ maximumFractionDigits: 1,
23
+ currency: "USD",
24
+ },
25
+ hasCustomLabel: false,
26
+ customLabel: item.label || key,
27
+ };
28
+ });
29
+ return existingObject;
30
+ }
31
+ export function getSelectedItemsForApp(config, appName) {
32
+ const appConfig = config[appName];
33
+ if (!appConfig)
34
+ return {};
35
+ const selectedEntries = {};
36
+ for (const key in appConfig) {
37
+ const value = appConfig[key];
38
+ if (value && typeof value === 'object' && value.selected === true) {
39
+ selectedEntries[key] = value;
40
+ }
41
+ }
42
+ return selectedEntries;
43
+ }
44
+ export function getSelectedLabelsForApp(data, appName) {
45
+ const appData = data[appName];
46
+ if (!appData) {
47
+ return [];
48
+ }
49
+ return Object.keys(appData)
50
+ .filter((key) => appData[key].selected) // Filter out the selected items
51
+ .map((key) => {
52
+ return appData[key].hasCustomLabel
53
+ ? appData[key].customLabel
54
+ : appData[key].label;
55
+ });
56
+ }
57
+ export function updateMeasureLabels(data, measures, app) {
58
+ transformDataToAppObject(data, app, measures);
59
+ const apiMeasures = getTranslatedOptions(data);
60
+ // for each api measure, find the corresponding measure in the measures array
61
+ // and add a label property to the measure in the measures array
62
+ apiMeasures?.forEach((apiMeasure) => {
63
+ const measure = measures[app][apiMeasure.value];
64
+ if (measure) {
65
+ measure.label = apiMeasure.label;
66
+ }
67
+ });
68
+ }
69
+ ;
70
+ export function getStoredOrSetItem(key, fallback, overwrite = false) {
71
+ const fallbackValue = fallback || [];
72
+ if (overwrite && !isEmpty(fallbackValue)) {
73
+ sessionStorage
74
+ .setItem(key, JSON.stringify(fallbackValue));
75
+ return fallbackValue;
76
+ }
77
+ const storedItem = sessionStorage.getItem(key);
78
+ if (storedItem === null) {
79
+ sessionStorage.setItem(key, JSON.stringify(fallbackValue));
80
+ return fallbackValue;
81
+ }
82
+ const stored = JSON.parse(storedItem);
83
+ if (!stored) {
84
+ sessionStorage.setItem(key, JSON.stringify(fallbackValue));
85
+ return fallbackValue;
86
+ }
87
+ return stored;
88
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const Tooltip: (props: any) => React.JSX.Element[];
3
+ export default Tooltip;
@@ -0,0 +1,53 @@
1
+ import React from 'react';
2
+ import { PanelRow, PanelBody, TextareaControl } from '@wordpress/components';
3
+ import { __ } from '@wordpress/i18n';
4
+ export const Tooltip = (props) => {
5
+ function repeat(times) {
6
+ return function (strs, ...substs) {
7
+ return cook(strs, ...substs).repeat(times);
8
+ };
9
+ }
10
+ function cook(strs, ...substs) {
11
+ return substs.reduce((prev, cur, i) => prev + cur + strs[i + 1], strs[0]);
12
+ }
13
+ const { setAttributes, attributes: { tooltipHTML, dimension1, dimension2, dimension3, measures }, allMeasures, allDimensions, type } = props;
14
+ return [
15
+ React.createElement(PanelBody, { title: __("Variables") },
16
+ React.createElement("div", null, allDimensions.filter(d => (d.value === dimension1 || d.value === dimension2 || d.value === dimension3))
17
+ .map(d => React.createElement(PanelRow, null,
18
+ React.createElement("span", { style: { fontSize: "11px" } },
19
+ d.label,
20
+ " -> ",
21
+ "{",
22
+ d.value,
23
+ "}")))),
24
+ React.createElement("div", null, allMeasures
25
+ .map(m => React.createElement(PanelRow, null,
26
+ React.createElement("span", { style: { fontSize: "11px" } },
27
+ m.label,
28
+ " -> ",
29
+ "{",
30
+ m.value,
31
+ "}")))),
32
+ dimension1 == "none" && dimension2 == "none" &&
33
+ React.createElement(PanelRow, null,
34
+ React.createElement("span", { style: { fontSize: "11px" } },
35
+ "Corresponding Population -> ",
36
+ "{",
37
+ "populationValue",
38
+ "}")),
39
+ type === "pie" &&
40
+ React.createElement(React.Fragment, null,
41
+ React.createElement(PanelRow, null,
42
+ React.createElement("span", { style: { fontSize: "11px" } },
43
+ "Value Percent -> ",
44
+ '{valuePercent}')),
45
+ React.createElement(PanelRow, null,
46
+ React.createElement("span", { style: { fontSize: "11px" } },
47
+ "Category -> ",
48
+ '{category}')))),
49
+ React.createElement(PanelRow, null,
50
+ React.createElement(TextareaControl, { label: __("Tooltip"), value: tooltipHTML, help: __("You can use variables {var_name}"), onChange: (tooltipHTML) => setAttributes({ tooltipHTML }), rows: 10 }))
51
+ ];
52
+ };
53
+ export default Tooltip;
@@ -0,0 +1,7 @@
1
+ export declare const togglePanel: <T extends Record<string, any> = Record<string, any>>(name: string, panelStatus: Record<string, boolean>, setAttributes: (attributes: T) => void) => void;
2
+ export declare const panelFocus: <T extends Record<string, any> = Record<string, any>>(name: string, panelStatus: Record<string, boolean>, setAttributes: (attributes: T) => void) => void;
3
+ declare const _default: {
4
+ togglePanel: <T extends Record<string, any> = Record<string, any>>(name: string, panelStatus: Record<string, boolean>, setAttributes: (attributes: T) => void) => void;
5
+ panelFocus: <T extends Record<string, any> = Record<string, any>>(name: string, panelStatus: Record<string, boolean>, setAttributes: (attributes: T) => void) => void;
6
+ };
7
+ export default _default;
package/build/Util.js ADDED
@@ -0,0 +1,11 @@
1
+ export const togglePanel = (name, panelStatus, setAttributes) => {
2
+ const newStatus = { ...panelStatus };
3
+ newStatus[name] = newStatus[name] == true ? false : true;
4
+ setAttributes({ panelStatus: newStatus });
5
+ };
6
+ export const panelFocus = (name, panelStatus, setAttributes) => {
7
+ const newStatus = { ...panelStatus };
8
+ newStatus[name] = newStatus[name] == true ? false : true;
9
+ setAttributes({ panelFocus: newStatus });
10
+ };
11
+ export default { togglePanel, panelFocus };
File without changes
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // @ts-ignore
3
+ // export * from './useSetting';
@@ -0,0 +1,2 @@
1
+ export declare const useSetting: (setting: string) => any;
2
+ export declare const useSettingWithFallback: (setting: string, fallback: any) => any;
@@ -0,0 +1,11 @@
1
+ import { useSelect } from "@wordpress/data";
2
+ export const useSetting = (setting) => {
3
+ return useSelect((select) => {
4
+ // @ts-ignore
5
+ const settings = select('core/editor').getSettings();
6
+ return settings[setting];
7
+ }, []);
8
+ };
9
+ export const useSettingWithFallback = (setting, fallback) => {
10
+ return useSetting(setting) ?? fallback;
11
+ };
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const ChartIcon: () => React.JSX.Element;
3
+ export default ChartIcon;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import { Icon } from '@wordpress/components';
3
+ export const ChartIcon = () => {
4
+ return React.createElement(Icon, { icon: () => (React.createElement("svg", { version: "1.1", viewBox: "0 0 18.777 18.777" },
5
+ React.createElement("g", null,
6
+ React.createElement("g", null,
7
+ React.createElement("path", { style: { "fill": "#030104;" }, d: "M2.245,10.496H0.272C0.122,10.496,0,10.62,0,10.77v5.717c0,0.15,0.122,0.272,0.272,0.272h1.973\n\t\t\tc0.15,0,0.272-0.122,0.272-0.272V10.77C2.518,10.62,2.396,10.496,2.245,10.496z" }),
8
+ React.createElement("path", { style: { "fill": "#030104;" }, d: "M18.504,10.496h-1.973c-0.15,0-0.271,0.124-0.271,0.274v5.717c0,0.15,0.121,0.272,0.271,0.272\n\t\t\th1.973c0.152,0,0.273-0.122,0.273-0.272V10.77C18.777,10.62,18.656,10.496,18.504,10.496z" }),
9
+ React.createElement("path", { style: { "fill": "#030104;" }, d: "M5.907,7.228H3.934c-0.15,0-0.273,0.122-0.273,0.273v8.984c0,0.15,0.123,0.272,0.273,0.272h1.973\n\t\t\tc0.151,0,0.273-0.122,0.273-0.272V7.501C6.18,7.349,6.058,7.228,5.907,7.228z" }),
10
+ React.createElement("path", { style: { "fill": "#030104;" }, d: "M14.271,7.228h-1.973c-0.15,0-0.271,0.122-0.271,0.273v8.984c0,0.15,0.121,0.272,0.271,0.272h1.973\n\t\t\tc0.152,0,0.273-0.122,0.273-0.272V7.501C14.545,7.349,14.424,7.228,14.271,7.228z" }),
11
+ React.createElement("path", { style: { "fill": "#030104;" }, d: "M10.01,9.218H8.036c-0.15,0-0.272,0.123-0.272,0.272v6.994c0,0.15,0.122,0.272,0.272,0.272h1.974\n\t\t\tc0.152,0,0.273-0.122,0.273-0.272V9.49C10.283,9.341,10.162,9.218,10.01,9.218z" }),
12
+ React.createElement("path", { style: { "fill": "#030104;" }, d: "M1.259,6.947c0.581,0,1.051-0.47,1.051-1.051c0-0.101-0.019-0.196-0.046-0.288l2.211-1.591\n\t\t\tc0.136,0.064,0.286,0.102,0.446,0.102c0.309,0,0.583-0.135,0.776-0.347L7.784,4.98c-0.012,0.062-0.02,0.126-0.02,0.19\n\t\t\tc0,0.58,0.471,1.051,1.051,1.051c0.559,0,1.012-0.438,1.044-0.989l2.814-0.823c0.191,0.262,0.498,0.435,0.848,0.435\n\t\t\tc0.232,0,0.443-0.077,0.617-0.205l2.365,1.604c-0.02,0.083-0.037,0.17-0.037,0.26c0,0.581,0.471,1.052,1.051,1.052\n\t\t\ts1.053-0.471,1.053-1.052s-0.473-1.051-1.053-1.051c-0.232,0-0.443,0.077-0.617,0.204l-2.363-1.601\n\t\t\tc0.02-0.084,0.035-0.17,0.035-0.26c0-0.581-0.469-1.051-1.051-1.051c-0.559,0-1.012,0.438-1.045,0.989L9.663,4.555\n\t\t\tC9.472,4.292,9.164,4.12,8.815,4.12c-0.259,0-0.492,0.096-0.675,0.251L5.968,3.112c0-0.015,0.004-0.028,0.004-0.042\n\t\t\tc0-0.581-0.47-1.052-1.051-1.052S3.87,2.488,3.87,3.069c0,0.158,0.038,0.306,0.1,0.441L1.855,5.032\n\t\t\tC1.686,4.914,1.481,4.845,1.259,4.845c-0.581,0-1.051,0.471-1.051,1.051C0.208,6.477,0.678,6.947,1.259,6.947z" }))))) });
13
+ };
14
+ export default ChartIcon;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const GenericIcon: () => React.JSX.Element;
3
+ export default GenericIcon;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Icon } from '@wordpress/components';
3
+ export const GenericIcon = () => (React.createElement(Icon, { icon: () => (React.createElement("svg", { width: "24", height: "24", viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", role: "img", "aria-hidden": "true", focusable: "false" },
4
+ React.createElement("path", { d: "M19 6.5H5c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-7c0-1.1-.9-2-2-2zm.5 9c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v7zM8 13h8v-1.5H8V13z" }))) }));
5
+ export default GenericIcon;
@@ -0,0 +1,2 @@
1
+ export { GenericIcon } from './Generic';
2
+ export { ChartIcon } from './Chart';
@@ -0,0 +1,2 @@
1
+ export { GenericIcon } from './Generic';
2
+ export { ChartIcon } from './Chart';
@@ -0,0 +1,18 @@
1
+ export { APIConfig } from './APIConfig';
2
+ export { getTranslatedOptions, getTranslation, isSupersetAPI } from './APIutils';
3
+ export { BlockEditWithAPIMetadata, BlockEditWithFilters, type BlockEditWithFiltersState, type BlockEditWithAPIMetadataState, type BlockEditWithAPIMetadataProps, type BlockEditWithFiltersProps, ComponentWithSettings, type ComponentWithSettingsProps, type ComponentWithSettingsState, SizeConfig, type SizeConfigProps } from './Blocks';
4
+ export { categorical, sequential, diverging, type ChartColorsProps, ChartColors } from './ChartColors';
5
+ export { ChartLegends, type LegendProps as ChartLegendsProps } from './ChartLegends';
6
+ export { ChartMeasures, type ChartMeasuresProps } from './ChartMeasures';
7
+ export { DEFAULT_FORMAT_SETTINGS, BLOCKS_CATEGORY, BLOCKS_NS } from './Constants';
8
+ export { CSVConfig } from './CSVSourceConfig';
9
+ export { DataFilters, type DataFiltersProps } from './DataFilters';
10
+ export { Format, type FormatProps } from './Format';
11
+ export { MapCSVSourceConfig, type MapCSVSourceConfigProps } from './MapCSVSourceConfig';
12
+ export { Measures, type MeasuresProps } from './Measures';
13
+ export { extractAxisValues, getSelectedLabelsForApp, transformDataToAppObject, updateMeasureLabels, getSelectedItemsForApp, getStoredOrSetItem } from './MobileConfigUtils';
14
+ export { Tooltip, } from './Tooltip';
15
+ export * from './types';
16
+ export { panelFocus, togglePanel } from './Util';
17
+ export * from './icons';
18
+ export * from './post-type';
package/build/index.js ADDED
@@ -0,0 +1,19 @@
1
+ export { APIConfig } from './APIConfig';
2
+ export { getTranslatedOptions, getTranslation, isSupersetAPI } from './APIutils';
3
+ export { BlockEditWithAPIMetadata, BlockEditWithFilters, ComponentWithSettings, SizeConfig } from './Blocks';
4
+ export { categorical, sequential, diverging, ChartColors } from './ChartColors';
5
+ export { ChartLegends } from './ChartLegends';
6
+ export { ChartMeasures } from './ChartMeasures';
7
+ export { DEFAULT_FORMAT_SETTINGS, BLOCKS_CATEGORY, BLOCKS_NS } from './Constants';
8
+ export { CSVConfig } from './CSVSourceConfig';
9
+ export { DataFilters } from './DataFilters';
10
+ export { Format } from './Format';
11
+ export { MapCSVSourceConfig } from './MapCSVSourceConfig';
12
+ export { Measures } from './Measures';
13
+ export { extractAxisValues, getSelectedLabelsForApp, transformDataToAppObject, updateMeasureLabels, getSelectedItemsForApp, getStoredOrSetItem } from './MobileConfigUtils';
14
+ export { Tooltip, } from './Tooltip';
15
+ export * from './types';
16
+ export { panelFocus, togglePanel } from './Util';
17
+ export * from './icons';
18
+ // export * from './hooks';
19
+ export * from './post-type';
@@ -0,0 +1,193 @@
1
+ import { About, Cury, Meta, Self, WpTerm } from "./types";
2
+ export interface Post {
3
+ id: number;
4
+ date: Date;
5
+ date_gmt: Date;
6
+ guid: PostGUID;
7
+ modified: Date;
8
+ modified_gmt: Date;
9
+ slug: string;
10
+ status: string;
11
+ type: string;
12
+ link: string;
13
+ title: PostGUID;
14
+ content: PostContent;
15
+ excerpt: PostContent;
16
+ author: number;
17
+ featured_media: number;
18
+ comment_status: string;
19
+ ping_status: string;
20
+ sticky: boolean;
21
+ template: string;
22
+ format: string;
23
+ meta: Meta;
24
+ categories: number[];
25
+ tags: any[];
26
+ bread_crumbs: any[];
27
+ class_list: string[];
28
+ acf: any[];
29
+ yoast_head: string;
30
+ yoast_head_json: PostYoastHeadJSON;
31
+ meta_fields: {
32
+ [key: string]: string[];
33
+ };
34
+ meta_fields_2: {
35
+ [key: string]: string[];
36
+ };
37
+ _links: PostLinks;
38
+ }
39
+ export interface PostLinks {
40
+ self: Self[];
41
+ collection: About[];
42
+ about: About[];
43
+ author: PostAuthorElement[];
44
+ replies: PostAuthorElement[];
45
+ "version-history": PostVersionHistory[];
46
+ "predecessor-version": PostPredecessorVersion[];
47
+ "wp:attachment": About[];
48
+ "wp:term": WpTerm[];
49
+ curies: Cury[];
50
+ }
51
+ export interface PostAuthorElement {
52
+ embeddable: boolean;
53
+ href: string;
54
+ }
55
+ export interface PostPredecessorVersion {
56
+ id: number;
57
+ href: string;
58
+ }
59
+ export interface PostVersionHistory {
60
+ count: number;
61
+ href: string;
62
+ }
63
+ export declare enum PostTaxonomy {
64
+ BreadCrumbs = "bread_crumbs",
65
+ Category = "category",
66
+ PostTag = "post_tag"
67
+ }
68
+ export interface PostContent {
69
+ rendered: string;
70
+ protected: boolean;
71
+ }
72
+ export interface PostGUID {
73
+ rendered: string;
74
+ }
75
+ export interface PostMeta {
76
+ _acf_changed: boolean;
77
+ inline_featured_image: boolean;
78
+ redirect_url: string;
79
+ myguten_meta_block_field: string;
80
+ footnotes: string;
81
+ }
82
+ export interface PostYoastHeadJSON {
83
+ title?: string;
84
+ robots?: PostRobots;
85
+ canonical?: string;
86
+ og_locale?: string;
87
+ og_type?: string;
88
+ og_title?: string;
89
+ og_url?: string;
90
+ og_site_name?: string;
91
+ article_published_time?: Date;
92
+ article_modified_time?: Date;
93
+ og_image?: PostOgImage[];
94
+ author?: string;
95
+ twitter_card?: string;
96
+ twitter_creator?: string;
97
+ twitter_site?: string;
98
+ twitter_misc?: PostTwitterMisc;
99
+ schema?: PostSchema;
100
+ og_description?: string;
101
+ }
102
+ export interface PostOgImage {
103
+ width: number | string;
104
+ height: number | string;
105
+ url: string;
106
+ type: string;
107
+ }
108
+ export interface PostRobots {
109
+ index: string;
110
+ follow: string;
111
+ "max-snippet": string;
112
+ "max-image-preview": string;
113
+ "max-video-preview": string;
114
+ }
115
+ export interface PostSchema {
116
+ "@context": string;
117
+ "@graph": PostGraph[];
118
+ }
119
+ export interface PostGraph {
120
+ "@type": string;
121
+ "@id": string;
122
+ isPartOf?: Breadcrumb;
123
+ author?: GraphAuthorClass;
124
+ headline?: string;
125
+ datePublished?: Date;
126
+ dateModified?: Date;
127
+ mainEntityOfPage?: Breadcrumb;
128
+ wordCount?: number;
129
+ commentCount?: number;
130
+ publisher?: Breadcrumb;
131
+ inLanguage?: string;
132
+ potentialAction?: PotentialAction[];
133
+ url?: string;
134
+ name?: string;
135
+ description?: string;
136
+ alternateName?: string;
137
+ logo?: PostImage;
138
+ image?: PostImage;
139
+ sameAs?: string[];
140
+ articleSection?: string[];
141
+ breadcrumb?: Breadcrumb;
142
+ itemListElement?: ItemListElement[];
143
+ thumbnailUrl?: string;
144
+ primaryImageOfPage?: Breadcrumb;
145
+ contentUrl?: string;
146
+ }
147
+ export interface GraphAuthorClass {
148
+ name: string;
149
+ "@id": string;
150
+ }
151
+ export interface Breadcrumb {
152
+ "@id": string;
153
+ }
154
+ export interface PostImage {
155
+ "@id": string;
156
+ "@type"?: string;
157
+ inLanguage?: string;
158
+ url?: string;
159
+ contentUrl?: string;
160
+ caption?: string;
161
+ width?: number;
162
+ height?: number;
163
+ }
164
+ export interface ItemListElement {
165
+ "@type": string;
166
+ position: number;
167
+ name: string;
168
+ item?: string;
169
+ }
170
+ export interface PotentialAction {
171
+ "@type": PotentialActionType;
172
+ name?: string;
173
+ target: string[] | TargetClass;
174
+ "query-input"?: QueryInput;
175
+ }
176
+ export declare enum PotentialActionType {
177
+ CommentAction = "CommentAction",
178
+ ReadAction = "ReadAction",
179
+ SearchAction = "SearchAction"
180
+ }
181
+ export interface QueryInput {
182
+ "@type": string;
183
+ valueRequired: boolean;
184
+ valueName: string;
185
+ }
186
+ export interface TargetClass {
187
+ "@type": string;
188
+ urlTemplate: string;
189
+ }
190
+ export interface PostTwitterMisc {
191
+ "Written by": string;
192
+ "Est. reading time"?: string;
193
+ }
@@ -0,0 +1,12 @@
1
+ export var PostTaxonomy;
2
+ (function (PostTaxonomy) {
3
+ PostTaxonomy["BreadCrumbs"] = "bread_crumbs";
4
+ PostTaxonomy["Category"] = "category";
5
+ PostTaxonomy["PostTag"] = "post_tag";
6
+ })(PostTaxonomy || (PostTaxonomy = {}));
7
+ export var PotentialActionType;
8
+ (function (PotentialActionType) {
9
+ PotentialActionType["CommentAction"] = "CommentAction";
10
+ PotentialActionType["ReadAction"] = "ReadAction";
11
+ PotentialActionType["SearchAction"] = "SearchAction";
12
+ })(PotentialActionType || (PotentialActionType = {}));
@@ -0,0 +1 @@
1
+ {"root":["../src/apiconfig.tsx","../src/apiutils.ts","../src/blocks.tsx","../src/csvsourceconfig.tsx","../src/chartcolors.tsx","../src/chartlegends.tsx","../src/chartmeasures.tsx","../src/constants.ts","../src/datafilters.tsx","../src/format.tsx","../src/mapcsvsourceconfig.tsx","../src/measures.tsx","../src/mobileconfigutils.ts","../src/tooltip.tsx","../src/util.tsx","../src/common-types.d.ts","../src/index.ts","../src/post-type.ts","../src/types.ts","../src/hooks/index.ts","../src/icons/chart.tsx","../src/icons/generic.tsx","../src/icons/index.ts"],"version":"5.8.3"}