@prismiq/react 0.1.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 (82) hide show
  1. package/README.md +88 -0
  2. package/dist/CustomSQLEditor-BXB4rf1q.d.cts +1297 -0
  3. package/dist/CustomSQLEditor-DYeId0Gp.d.ts +1297 -0
  4. package/dist/DashboardDialog-B3vYC5Gs.d.ts +1106 -0
  5. package/dist/DashboardDialog-LHmrtNQU.d.cts +1106 -0
  6. package/dist/accessibility-2yy5yqRR.d.cts +145 -0
  7. package/dist/accessibility-2yy5yqRR.d.ts +145 -0
  8. package/dist/charts/index.cjs +110 -0
  9. package/dist/charts/index.cjs.map +1 -0
  10. package/dist/charts/index.d.cts +2 -0
  11. package/dist/charts/index.d.ts +2 -0
  12. package/dist/charts/index.js +5 -0
  13. package/dist/charts/index.js.map +1 -0
  14. package/dist/chunk-2H5WTH4K.js +2409 -0
  15. package/dist/chunk-2H5WTH4K.js.map +1 -0
  16. package/dist/chunk-4AVL6GQK.cjs +470 -0
  17. package/dist/chunk-4AVL6GQK.cjs.map +1 -0
  18. package/dist/chunk-EX74SI67.js +455 -0
  19. package/dist/chunk-EX74SI67.js.map +1 -0
  20. package/dist/chunk-FEABEF3J.cjs +7543 -0
  21. package/dist/chunk-FEABEF3J.cjs.map +1 -0
  22. package/dist/chunk-JTCBZDHY.js +126 -0
  23. package/dist/chunk-JTCBZDHY.js.map +1 -0
  24. package/dist/chunk-LMTG3LRC.cjs +326 -0
  25. package/dist/chunk-LMTG3LRC.cjs.map +1 -0
  26. package/dist/chunk-MDXGGZSW.cjs +273 -0
  27. package/dist/chunk-MDXGGZSW.cjs.map +1 -0
  28. package/dist/chunk-MOAEEF5P.js +7510 -0
  29. package/dist/chunk-MOAEEF5P.js.map +1 -0
  30. package/dist/chunk-NK7HKX2J.cjs +2459 -0
  31. package/dist/chunk-NK7HKX2J.cjs.map +1 -0
  32. package/dist/chunk-NY6TZLST.cjs +8781 -0
  33. package/dist/chunk-NY6TZLST.cjs.map +1 -0
  34. package/dist/chunk-T6STUE7E.js +321 -0
  35. package/dist/chunk-T6STUE7E.js.map +1 -0
  36. package/dist/chunk-TRW7DKLP.cjs +141 -0
  37. package/dist/chunk-TRW7DKLP.cjs.map +1 -0
  38. package/dist/chunk-UPYINBZU.js +8706 -0
  39. package/dist/chunk-UPYINBZU.js.map +1 -0
  40. package/dist/chunk-WWTT2OJ5.js +246 -0
  41. package/dist/chunk-WWTT2OJ5.js.map +1 -0
  42. package/dist/components/index.cjs +222 -0
  43. package/dist/components/index.cjs.map +1 -0
  44. package/dist/components/index.d.cts +207 -0
  45. package/dist/components/index.d.ts +207 -0
  46. package/dist/components/index.js +5 -0
  47. package/dist/components/index.js.map +1 -0
  48. package/dist/dashboard/index.cjs +140 -0
  49. package/dist/dashboard/index.cjs.map +1 -0
  50. package/dist/dashboard/index.d.cts +302 -0
  51. package/dist/dashboard/index.d.ts +302 -0
  52. package/dist/dashboard/index.js +7 -0
  53. package/dist/dashboard/index.js.map +1 -0
  54. package/dist/export/index.cjs +32 -0
  55. package/dist/export/index.cjs.map +1 -0
  56. package/dist/export/index.d.cts +197 -0
  57. package/dist/export/index.d.ts +197 -0
  58. package/dist/export/index.js +3 -0
  59. package/dist/export/index.js.map +1 -0
  60. package/dist/index-C-Qcuu4Y.d.cts +821 -0
  61. package/dist/index-rPc7ijt8.d.ts +821 -0
  62. package/dist/index.cjs +1486 -0
  63. package/dist/index.cjs.map +1 -0
  64. package/dist/index.d.cts +1435 -0
  65. package/dist/index.d.ts +1435 -0
  66. package/dist/index.js +926 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/ssr/index.cjs +64 -0
  69. package/dist/ssr/index.cjs.map +1 -0
  70. package/dist/ssr/index.d.cts +213 -0
  71. package/dist/ssr/index.d.ts +213 -0
  72. package/dist/ssr/index.js +3 -0
  73. package/dist/ssr/index.js.map +1 -0
  74. package/dist/types-WrCbOeAV.d.cts +569 -0
  75. package/dist/types-WrCbOeAV.d.ts +569 -0
  76. package/dist/utils/index.cjs +64 -0
  77. package/dist/utils/index.cjs.map +1 -0
  78. package/dist/utils/index.d.cts +112 -0
  79. package/dist/utils/index.d.ts +112 -0
  80. package/dist/utils/index.js +3 -0
  81. package/dist/utils/index.js.map +1 -0
  82. package/package.json +110 -0
@@ -0,0 +1,112 @@
1
+ export { A as ArrowNavigationOptions, F as FocusTrapOptions, S as SkipLinkProps, g as UseArrowNavigationResult, U as UseFocusTrapResult, d as announceToScreenReader, f as focusVisibleStyles, e as skipLinkFocusStyles, s as skipLinkStyles, a as useArrowNavigation, u as useFocusTrap, c as useFocusVisible, b as useRovingTabIndex } from '../accessibility-2yy5yqRR.cjs';
2
+ import { Q as QueryResult } from '../types-WrCbOeAV.cjs';
3
+ import 'react';
4
+
5
+ /**
6
+ * Date formatting utilities for converting .NET format strings to JavaScript date formatters.
7
+ *
8
+ * Supports common .NET date format patterns used by RevealBI.
9
+ */
10
+ /**
11
+ * Convert .NET date format string to JavaScript date formatter.
12
+ *
13
+ * Common patterns:
14
+ * - dd-MMM-yyyy HH:mm -> 20-Mar-2025 17:00
15
+ * - yyyy-MM-dd -> 2025-03-20
16
+ * - MM/dd/yyyy -> 03/20/2025
17
+ * - yyyy-MM-dd HH:mm:ss -> 2025-03-20 17:00:00
18
+ *
19
+ * @param formatString .NET date format string
20
+ * @returns Formatter function
21
+ */
22
+ declare function createDateFormatter(formatString: string): (value: unknown) => string;
23
+ /**
24
+ * Create date formatters from config map.
25
+ *
26
+ * @param dateFormats Map of column name to .NET format string
27
+ * @returns Map of column name to formatter function
28
+ */
29
+ declare function createDateFormatters(dateFormats: Record<string, string>): Record<string, (value: unknown) => string>;
30
+ /**
31
+ * Format a Unix timestamp as relative time (e.g., "5 min ago").
32
+ *
33
+ * @param timestamp Unix timestamp in seconds
34
+ * @returns Relative time string
35
+ */
36
+ declare function formatRelativeTime(timestamp: number | null | undefined): string;
37
+
38
+ /**
39
+ * Pivot utility for transforming query results from long format to wide format.
40
+ */
41
+
42
+ interface PivotConfig {
43
+ /** Column whose unique values become new columns. */
44
+ pivotColumn: string;
45
+ /** Column containing values to distribute across pivot columns. */
46
+ valueColumn: string;
47
+ /** Columns to keep as-is (dimension/grouping columns). */
48
+ dimensionColumns: string[];
49
+ }
50
+ /**
51
+ * Pivot a query result by transforming unique values in pivotColumn
52
+ * into separate columns.
53
+ *
54
+ * Example:
55
+ * Input (long format):
56
+ * account | date | name | value
57
+ * Cerby | 2025-02-01 | MAU | 9
58
+ * Cerby | 2025-02-01 | Searches | 1
59
+ *
60
+ * Output (wide format):
61
+ * account | date | MAU | Searches
62
+ * Cerby | 2025-02-01 | 9 | 1
63
+ *
64
+ * @param result - The query result to pivot
65
+ * @param config - Pivot configuration
66
+ * @returns Pivoted query result
67
+ */
68
+ declare function pivotQueryResult(result: QueryResult, config: PivotConfig): QueryResult;
69
+
70
+ /**
71
+ * Utilities for parsing column references in "tableId.column" format.
72
+ */
73
+ /**
74
+ * Parsed column reference with table ID and column name.
75
+ */
76
+ interface ColumnReference {
77
+ tableId: string;
78
+ column: string;
79
+ }
80
+ /**
81
+ * Parse a column reference in "tableId.column" format.
82
+ *
83
+ * @param ref - The column reference string (e.g., "t1.created_at")
84
+ * @param defaultTableId - Table ID to use when ref has no table prefix
85
+ * @returns Parsed reference, or null if invalid. Logs a warning only for
86
+ * malformed references (e.g., "table." or ".column" or "a.b.c").
87
+ * Empty/whitespace inputs return null without warning.
88
+ */
89
+ declare function parseColumnRef(ref: string, defaultTableId: string): ColumnReference | null;
90
+
91
+ /**
92
+ * Safe markdown parser that escapes HTML to prevent XSS attacks.
93
+ *
94
+ * Supports a limited subset of markdown:
95
+ * - Headings (#, ##, ###)
96
+ * - Bold (**text**)
97
+ * - Italic (*text*)
98
+ * - Inline code (`code`)
99
+ * - Line breaks
100
+ */
101
+ /**
102
+ * Parse markdown text into safe HTML.
103
+ *
104
+ * HTML is escaped first to prevent XSS, then markdown syntax is converted.
105
+ *
106
+ * @param text - Raw markdown text
107
+ * @param codeStyle - Optional inline styles for code blocks
108
+ * @returns Safe HTML string
109
+ */
110
+ declare function parseMarkdownSafe(text: string, codeStyle?: string): string;
111
+
112
+ export { type ColumnReference, type PivotConfig, createDateFormatter, createDateFormatters, formatRelativeTime, parseColumnRef, parseMarkdownSafe, pivotQueryResult };
@@ -0,0 +1,112 @@
1
+ export { A as ArrowNavigationOptions, F as FocusTrapOptions, S as SkipLinkProps, g as UseArrowNavigationResult, U as UseFocusTrapResult, d as announceToScreenReader, f as focusVisibleStyles, e as skipLinkFocusStyles, s as skipLinkStyles, a as useArrowNavigation, u as useFocusTrap, c as useFocusVisible, b as useRovingTabIndex } from '../accessibility-2yy5yqRR.js';
2
+ import { Q as QueryResult } from '../types-WrCbOeAV.js';
3
+ import 'react';
4
+
5
+ /**
6
+ * Date formatting utilities for converting .NET format strings to JavaScript date formatters.
7
+ *
8
+ * Supports common .NET date format patterns used by RevealBI.
9
+ */
10
+ /**
11
+ * Convert .NET date format string to JavaScript date formatter.
12
+ *
13
+ * Common patterns:
14
+ * - dd-MMM-yyyy HH:mm -> 20-Mar-2025 17:00
15
+ * - yyyy-MM-dd -> 2025-03-20
16
+ * - MM/dd/yyyy -> 03/20/2025
17
+ * - yyyy-MM-dd HH:mm:ss -> 2025-03-20 17:00:00
18
+ *
19
+ * @param formatString .NET date format string
20
+ * @returns Formatter function
21
+ */
22
+ declare function createDateFormatter(formatString: string): (value: unknown) => string;
23
+ /**
24
+ * Create date formatters from config map.
25
+ *
26
+ * @param dateFormats Map of column name to .NET format string
27
+ * @returns Map of column name to formatter function
28
+ */
29
+ declare function createDateFormatters(dateFormats: Record<string, string>): Record<string, (value: unknown) => string>;
30
+ /**
31
+ * Format a Unix timestamp as relative time (e.g., "5 min ago").
32
+ *
33
+ * @param timestamp Unix timestamp in seconds
34
+ * @returns Relative time string
35
+ */
36
+ declare function formatRelativeTime(timestamp: number | null | undefined): string;
37
+
38
+ /**
39
+ * Pivot utility for transforming query results from long format to wide format.
40
+ */
41
+
42
+ interface PivotConfig {
43
+ /** Column whose unique values become new columns. */
44
+ pivotColumn: string;
45
+ /** Column containing values to distribute across pivot columns. */
46
+ valueColumn: string;
47
+ /** Columns to keep as-is (dimension/grouping columns). */
48
+ dimensionColumns: string[];
49
+ }
50
+ /**
51
+ * Pivot a query result by transforming unique values in pivotColumn
52
+ * into separate columns.
53
+ *
54
+ * Example:
55
+ * Input (long format):
56
+ * account | date | name | value
57
+ * Cerby | 2025-02-01 | MAU | 9
58
+ * Cerby | 2025-02-01 | Searches | 1
59
+ *
60
+ * Output (wide format):
61
+ * account | date | MAU | Searches
62
+ * Cerby | 2025-02-01 | 9 | 1
63
+ *
64
+ * @param result - The query result to pivot
65
+ * @param config - Pivot configuration
66
+ * @returns Pivoted query result
67
+ */
68
+ declare function pivotQueryResult(result: QueryResult, config: PivotConfig): QueryResult;
69
+
70
+ /**
71
+ * Utilities for parsing column references in "tableId.column" format.
72
+ */
73
+ /**
74
+ * Parsed column reference with table ID and column name.
75
+ */
76
+ interface ColumnReference {
77
+ tableId: string;
78
+ column: string;
79
+ }
80
+ /**
81
+ * Parse a column reference in "tableId.column" format.
82
+ *
83
+ * @param ref - The column reference string (e.g., "t1.created_at")
84
+ * @param defaultTableId - Table ID to use when ref has no table prefix
85
+ * @returns Parsed reference, or null if invalid. Logs a warning only for
86
+ * malformed references (e.g., "table." or ".column" or "a.b.c").
87
+ * Empty/whitespace inputs return null without warning.
88
+ */
89
+ declare function parseColumnRef(ref: string, defaultTableId: string): ColumnReference | null;
90
+
91
+ /**
92
+ * Safe markdown parser that escapes HTML to prevent XSS attacks.
93
+ *
94
+ * Supports a limited subset of markdown:
95
+ * - Headings (#, ##, ###)
96
+ * - Bold (**text**)
97
+ * - Italic (*text*)
98
+ * - Inline code (`code`)
99
+ * - Line breaks
100
+ */
101
+ /**
102
+ * Parse markdown text into safe HTML.
103
+ *
104
+ * HTML is escaped first to prevent XSS, then markdown syntax is converted.
105
+ *
106
+ * @param text - Raw markdown text
107
+ * @param codeStyle - Optional inline styles for code blocks
108
+ * @returns Safe HTML string
109
+ */
110
+ declare function parseMarkdownSafe(text: string, codeStyle?: string): string;
111
+
112
+ export { type ColumnReference, type PivotConfig, createDateFormatter, createDateFormatters, formatRelativeTime, parseColumnRef, parseMarkdownSafe, pivotQueryResult };
@@ -0,0 +1,3 @@
1
+ export { announceToScreenReader, createDateFormatter, createDateFormatters, focusVisibleStyles, formatRelativeTime, parseColumnRef, parseMarkdownSafe, pivotQueryResult, skipLinkFocusStyles, skipLinkStyles, useArrowNavigation, useFocusTrap, useFocusVisible, useRovingTabIndex } from '../chunk-EX74SI67.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "name": "@prismiq/react",
3
+ "version": "0.1.0",
4
+ "description": "React SDK for Prismiq embedded analytics",
5
+ "type": "module",
6
+ "main": "./dist/index.cjs",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "sideEffects": false,
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/index.js",
14
+ "require": "./dist/index.cjs"
15
+ },
16
+ "./charts": {
17
+ "types": "./dist/charts/index.d.ts",
18
+ "import": "./dist/charts/index.js",
19
+ "require": "./dist/charts/index.cjs"
20
+ },
21
+ "./dashboard": {
22
+ "types": "./dist/dashboard/index.d.ts",
23
+ "import": "./dist/dashboard/index.js",
24
+ "require": "./dist/dashboard/index.cjs"
25
+ },
26
+ "./components": {
27
+ "types": "./dist/components/index.d.ts",
28
+ "import": "./dist/components/index.js",
29
+ "require": "./dist/components/index.cjs"
30
+ },
31
+ "./export": {
32
+ "types": "./dist/export/index.d.ts",
33
+ "import": "./dist/export/index.js",
34
+ "require": "./dist/export/index.cjs"
35
+ },
36
+ "./ssr": {
37
+ "types": "./dist/ssr/index.d.ts",
38
+ "import": "./dist/ssr/index.js",
39
+ "require": "./dist/ssr/index.cjs"
40
+ },
41
+ "./utils": {
42
+ "types": "./dist/utils/index.d.ts",
43
+ "import": "./dist/utils/index.js",
44
+ "require": "./dist/utils/index.cjs"
45
+ }
46
+ },
47
+ "files": [
48
+ "dist"
49
+ ],
50
+ "scripts": {
51
+ "build": "tsup",
52
+ "dev": "tsup --watch",
53
+ "typecheck": "tsc --noEmit",
54
+ "lint": "eslint src --ext .ts,.tsx",
55
+ "clean": "rm -rf dist",
56
+ "size": "tsup && du -sh dist/*",
57
+ "prepublishOnly": "npm run typecheck && npm run build"
58
+ },
59
+ "peerDependencies": {
60
+ "echarts": "^5.4.0 || ^6.0.0",
61
+ "echarts-for-react": "^3.0.0",
62
+ "react": "^18.0.0 || ^19.0.0",
63
+ "react-grid-layout": "^1.4.0 || ^2.0.0",
64
+ "xlsx": "^0.18.0"
65
+ },
66
+ "peerDependenciesMeta": {
67
+ "echarts": {
68
+ "optional": true
69
+ },
70
+ "echarts-for-react": {
71
+ "optional": true
72
+ },
73
+ "react-grid-layout": {
74
+ "optional": true
75
+ },
76
+ "xlsx": {
77
+ "optional": true
78
+ }
79
+ },
80
+ "devDependencies": {
81
+ "@types/node": "^25.0.3",
82
+ "@types/react": "^18.2.0",
83
+ "@types/react-dom": "^18.3.7",
84
+ "@types/react-grid-layout": "^1.3.6",
85
+ "echarts": "^6.0.0",
86
+ "echarts-for-react": "^3.0.5",
87
+ "react": "^18.2.0",
88
+ "react-grid-layout": "^2.1.1",
89
+ "tsup": "^8.0.0",
90
+ "typescript": "^5.3.0",
91
+ "xlsx": "^0.18.5"
92
+ },
93
+ "keywords": [
94
+ "react",
95
+ "analytics",
96
+ "dashboard",
97
+ "embedded",
98
+ "postgresql",
99
+ "visualization",
100
+ "charts",
101
+ "echarts",
102
+ "query-builder"
103
+ ],
104
+ "license": "MIT",
105
+ "repository": {
106
+ "type": "git",
107
+ "url": "https://github.com/prismiq/prismiq.git",
108
+ "directory": "packages/react"
109
+ }
110
+ }