@datawheel/bespoke 0.10.0-beta.1 → 0.10.0-test.6
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/README.md +0 -8
- package/dist/auth.js +1 -1
- package/dist/cms.css +1 -1
- package/dist/cms.js +66 -38
- package/dist/explore.css +1 -1
- package/dist/explore.js +36 -8
- package/dist/index.js +1 -1
- package/dist/redux-store.js +4 -3
- package/dist/report.css +1 -1
- package/dist/report.js +42 -14
- package/dist/server.js +11 -10
- package/package.json +40 -76
- package/css/mixins.scss +0 -178
- package/dist/Search-BWmRyIa9.d.mts +0 -129
- package/dist/auth-BwgF4GT9.d.mts +0 -139
- package/dist/auth.d.mts +0 -42
- package/dist/cms.d.mts +0 -13
- package/dist/explore.d.mts +0 -40
- package/dist/index.d.mts +0 -24
- package/dist/redux-store.d.mts +0 -175
- package/dist/report.d.mts +0 -132
- package/dist/server.d.mts +0 -108
- package/dist/store-De3Xknzr.d.mts +0 -545
- package/dist/types-BcIo0oyw.d.mts +0 -847
package/package.json
CHANGED
|
@@ -1,51 +1,38 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datawheel/bespoke",
|
|
3
|
-
"version": "0.10.0-
|
|
3
|
+
"version": "0.10.0-test.6",
|
|
4
4
|
"description": "Content management system for creating automated data reports",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
7
|
-
"types": "./dist/index.d.mts",
|
|
8
7
|
"import": "./dist/index.js"
|
|
9
8
|
},
|
|
10
9
|
"./server": {
|
|
11
|
-
"types": "./dist/server.d.mts",
|
|
12
10
|
"import": "./dist/server.js"
|
|
13
11
|
},
|
|
14
12
|
"./explore": {
|
|
15
|
-
"types": "./dist/explore.d.mts",
|
|
16
13
|
"import": "./dist/explore.js"
|
|
17
14
|
},
|
|
18
15
|
"./store": {
|
|
19
|
-
"types": "./dist/redux-store.d.mts",
|
|
20
16
|
"import": "./dist/redux-store.js"
|
|
21
17
|
},
|
|
22
18
|
"./cms": {
|
|
23
|
-
"types": "./dist/cms.d.mts",
|
|
24
19
|
"import": "./dist/cms.js"
|
|
25
20
|
},
|
|
26
21
|
"./report": {
|
|
27
|
-
"types": "./dist/report.d.mts",
|
|
28
22
|
"import": "./dist/report.js"
|
|
29
23
|
},
|
|
30
24
|
"./auth": {
|
|
31
|
-
"types": "./dist/auth.d.mts",
|
|
32
25
|
"import": "./dist/auth.js"
|
|
33
|
-
}
|
|
34
|
-
"./cms.css": "./dist/cms.css",
|
|
35
|
-
"./explore.css": "./dist/explore.css",
|
|
36
|
-
"./report.css": "./dist/report.css",
|
|
37
|
-
"./css/mixins.scss": "./css/mixins.scss"
|
|
26
|
+
}
|
|
38
27
|
},
|
|
39
28
|
"files": [
|
|
40
29
|
"dist",
|
|
41
|
-
"css",
|
|
42
30
|
"README.md"
|
|
43
31
|
],
|
|
44
32
|
"style": "./dist/index.css",
|
|
45
33
|
"scripts": {
|
|
46
|
-
"prepublishOnly": "
|
|
47
|
-
"build": "
|
|
48
|
-
"typecheck": "tsc --noEmit",
|
|
34
|
+
"prepublishOnly": "tsup",
|
|
35
|
+
"build": "tsup",
|
|
49
36
|
"dev": "tsup --watch",
|
|
50
37
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
51
38
|
"lint": "eslint . --ext .ts,.tsx,.js,.jsx --fix"
|
|
@@ -67,16 +54,20 @@
|
|
|
67
54
|
},
|
|
68
55
|
"homepage": "https://github.com/Datawheel/reports#readme",
|
|
69
56
|
"dependencies": {
|
|
70
|
-
"@auth0/nextjs-auth0": "^3.
|
|
71
|
-
"@
|
|
72
|
-
"@
|
|
73
|
-
"@
|
|
74
|
-
"@
|
|
75
|
-
"@
|
|
76
|
-
"@
|
|
77
|
-
"@
|
|
78
|
-
"@
|
|
57
|
+
"@auth0/nextjs-auth0": "^3.6.0",
|
|
58
|
+
"@emotion/react": "^11.10.4",
|
|
59
|
+
"@hello-pangea/dnd": "16.3.0",
|
|
60
|
+
"@mantine/core": "^6.0.19",
|
|
61
|
+
"@mantine/dates": "^6.0.19",
|
|
62
|
+
"@mantine/dropzone": "^6.0.19",
|
|
63
|
+
"@mantine/form": "^6.0.19",
|
|
64
|
+
"@mantine/hooks": "^6.0.19",
|
|
65
|
+
"@mantine/next": "^6.0.19",
|
|
66
|
+
"@mantine/notifications": "^6.0.19",
|
|
67
|
+
"@mantine/prism": "^6.0.19",
|
|
79
68
|
"@monaco-editor/react": "^4.4.5",
|
|
69
|
+
"@reduxjs/toolkit": "^1.8.4",
|
|
70
|
+
"@tabler/icons-react": "^2.15.0",
|
|
80
71
|
"@tiptap/extension-hard-break": "^2.5.9",
|
|
81
72
|
"@tiptap/extension-history": "^2.5.9",
|
|
82
73
|
"@tiptap/extension-mention": "^2.5.9",
|
|
@@ -93,9 +84,7 @@
|
|
|
93
84
|
"axios-retry": "^3.8.0",
|
|
94
85
|
"base58": "^2.0.1",
|
|
95
86
|
"buble": "^0.20.0",
|
|
96
|
-
"clsx": "^2.1.1",
|
|
97
87
|
"comment-parser": "^1.3.1",
|
|
98
|
-
"cors": "^2.8.5",
|
|
99
88
|
"d3": "^7.8.4",
|
|
100
89
|
"d3-array": "^3.1.6",
|
|
101
90
|
"d3-collection": "^1.0.7",
|
|
@@ -104,7 +93,13 @@
|
|
|
104
93
|
"d3-format": "^3.1.0",
|
|
105
94
|
"d3-selection": "^3.0.0",
|
|
106
95
|
"d3-time-format": "^4.1.0",
|
|
107
|
-
"
|
|
96
|
+
"d3plus-axis": "^1.2.24",
|
|
97
|
+
"d3plus-common": "^1.2.8",
|
|
98
|
+
"d3plus-export": "^1.3.0",
|
|
99
|
+
"d3plus-format": "^1.2.8",
|
|
100
|
+
"d3plus-react": "^1.3.3",
|
|
101
|
+
"d3plus-text": "^1.2.5",
|
|
102
|
+
"d3plus-viz": "^1.3.11",
|
|
108
103
|
"dom-parser": "^0.1.6",
|
|
109
104
|
"fast-glob": "^3.2.12",
|
|
110
105
|
"file-loader": "^6.2.0",
|
|
@@ -112,20 +107,26 @@
|
|
|
112
107
|
"flexsearch": "^0.7.43",
|
|
113
108
|
"flickr-sdk": "6.3.0",
|
|
114
109
|
"formidable": "^2.1.1",
|
|
115
|
-
"html-react-parser": "^
|
|
110
|
+
"html-react-parser": "^3.0.15",
|
|
116
111
|
"html-to-image": "^1.10.8",
|
|
117
112
|
"image-type": "^5.2.0",
|
|
118
|
-
"immer": "^10.1.1",
|
|
119
113
|
"jsonwebtoken": "^9.0.2",
|
|
120
114
|
"jszip": "^3.10.1",
|
|
121
|
-
"mantine-react-table": "^
|
|
115
|
+
"mantine-react-table": "^1.3.4",
|
|
122
116
|
"monaco-themes": "^0.4.2",
|
|
117
|
+
"next-auth": "^4.24.7",
|
|
118
|
+
"next-redux-wrapper": "^7.0.0",
|
|
119
|
+
"nextjs-cors": "^2.1.1",
|
|
123
120
|
"normalizr": "^3.6.2",
|
|
124
121
|
"pg": "^8.7.3",
|
|
125
122
|
"pretty-format": "^28.1.1",
|
|
123
|
+
"react": "^18.2.0",
|
|
124
|
+
"react-dom": "^18.2.0",
|
|
125
|
+
"react-icons": "^4.3.1",
|
|
126
|
+
"react-redux": "^7.2.6",
|
|
126
127
|
"react-share": "^5.2.2",
|
|
127
128
|
"sequelize": "^6.17.0",
|
|
128
|
-
"sharp": "^0.
|
|
129
|
+
"sharp": "^0.32.6",
|
|
129
130
|
"shelljs": "^0.8.5",
|
|
130
131
|
"slugify": "^1.6.5",
|
|
131
132
|
"toposort": "^2.0.2",
|
|
@@ -134,20 +135,10 @@
|
|
|
134
135
|
"yn": "^5.0.0"
|
|
135
136
|
},
|
|
136
137
|
"devDependencies": {
|
|
137
|
-
"@
|
|
138
|
-
"@mantine/core": "^8.3.0",
|
|
139
|
-
"@mantine/dates": "^8.3.0",
|
|
140
|
-
"@mantine/dropzone": "^8.3.0",
|
|
141
|
-
"@mantine/form": "^8.3.0",
|
|
142
|
-
"@mantine/hooks": "^8.3.0",
|
|
143
|
-
"@mantine/notifications": "^8.3.0",
|
|
144
|
-
"@next/bundle-analyzer": "^15.3.4",
|
|
145
|
-
"@reduxjs/toolkit": "^2.8.2",
|
|
146
|
-
"@tabler/icons-react": "^3.34.0",
|
|
138
|
+
"@next/bundle-analyzer": "^14.2.5",
|
|
147
139
|
"@types/express": "^4.17.13",
|
|
148
140
|
"@types/node": "^17.0.45",
|
|
149
|
-
"@types/react": "^
|
|
150
|
-
"@types/react-beautiful-dnd": "^13.1.8",
|
|
141
|
+
"@types/react-beautiful-dnd": "^13.1.2",
|
|
151
142
|
"@typescript-eslint/eslint-plugin": "^5.15.0",
|
|
152
143
|
"@typescript-eslint/parser": "^5.15.0",
|
|
153
144
|
"autoprefixer": "^10.0.0",
|
|
@@ -155,42 +146,15 @@
|
|
|
155
146
|
"eslint": "^8.11.0",
|
|
156
147
|
"eslint-import-resolver-typescript": "^3.5.2",
|
|
157
148
|
"eslint-plugin-jsx-a11y": "^6.5.1",
|
|
158
|
-
"eslint-plugin-react": "^7.
|
|
159
|
-
"eslint-plugin-react-hooks": "^4.
|
|
149
|
+
"eslint-plugin-react": "^7.29.4",
|
|
150
|
+
"eslint-plugin-react-hooks": "^4.3.0",
|
|
160
151
|
"monaco-editor": "^0.34.1",
|
|
161
|
-
"next-auth": "^4.24.7",
|
|
162
|
-
"next-redux-wrapper": "^8.1.0",
|
|
163
152
|
"postcss": "^8.4.20",
|
|
164
153
|
"postcss-mixins": "^9.0.4",
|
|
165
154
|
"postcss-nested": "^6.0.0",
|
|
166
|
-
"
|
|
167
|
-
"react-dom": "^18.3.1",
|
|
168
|
-
"react-redux": "^8.1.3",
|
|
169
|
-
"tsup": "^8.5.0",
|
|
170
|
-
"typescript": "^5.9.3"
|
|
155
|
+
"tsup": "^8.3.7"
|
|
171
156
|
},
|
|
172
157
|
"peerDependencies": {
|
|
173
|
-
"
|
|
174
|
-
"@mantine/core": "^8.3.0",
|
|
175
|
-
"@mantine/dates": "^8.3.0",
|
|
176
|
-
"@mantine/dropzone": "^8.3.0",
|
|
177
|
-
"@mantine/form": "^8.3.0",
|
|
178
|
-
"@mantine/hooks": "^8.3.0",
|
|
179
|
-
"@mantine/notifications": "^8.3.0",
|
|
180
|
-
"@reduxjs/toolkit": "^2.0.0",
|
|
181
|
-
"@tabler/icons-react": "^3.0.0",
|
|
182
|
-
"next": "^15.3.4",
|
|
183
|
-
"next-auth": "^4.24.0",
|
|
184
|
-
"next-redux-wrapper": "^8.1.0",
|
|
185
|
-
"react": "^18.3.1",
|
|
186
|
-
"react-dom": "^18.3.1",
|
|
187
|
-
"react-redux": "^8.0.0 || ^9.0.0"
|
|
188
|
-
},
|
|
189
|
-
"overrides": {
|
|
190
|
-
"mantine-react-table": {
|
|
191
|
-
"@mantine/core": "^8.0.0",
|
|
192
|
-
"@mantine/hooks": "^8.0.0",
|
|
193
|
-
"@mantine/dates": "^8.0.0"
|
|
194
|
-
}
|
|
158
|
+
"next": "^14.2.3"
|
|
195
159
|
}
|
|
196
160
|
}
|
package/css/mixins.scss
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
@use "sass:string";
|
|
2
|
-
@use "sass:math";
|
|
3
|
-
|
|
4
|
-
/* -----------------------------------
|
|
5
|
-
Bespoke Component Mixins
|
|
6
|
-
----------------------------------- */
|
|
7
|
-
|
|
8
|
-
/// @mixin bespoke($component, $element)
|
|
9
|
-
/// Converts @bespoke(Component, element) into :global(.bespoke-Component-element)
|
|
10
|
-
@mixin bespoke($component, $element: "root") {
|
|
11
|
-
// 1. Construct the class name: .bespoke-Component-element
|
|
12
|
-
$class-name: ".bespoke-" + $component + "-" + $element;
|
|
13
|
-
|
|
14
|
-
// 2. Construct the full selector: :global(.bespoke-Component-element)
|
|
15
|
-
$selector: ":global(" + $class-name + ")";
|
|
16
|
-
|
|
17
|
-
// 3. Output the selector and its content placeholder
|
|
18
|
-
// The @content directive allows you to pass CSS rules to the mixin call
|
|
19
|
-
|
|
20
|
-
#{$selector} {
|
|
21
|
-
@content;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/* -----------------------------------
|
|
27
|
-
Mantine Mixins
|
|
28
|
-
----------------------------------- */
|
|
29
|
-
|
|
30
|
-
// Define variables for your breakpoints,
|
|
31
|
-
// values must be the same as in your theme
|
|
32
|
-
$mantine-breakpoint-xs: '36em';
|
|
33
|
-
$mantine-breakpoint-sm: '48em';
|
|
34
|
-
$mantine-breakpoint-md: '62em';
|
|
35
|
-
$mantine-breakpoint-lg: '75em';
|
|
36
|
-
$mantine-breakpoint-xl: '94em';
|
|
37
|
-
|
|
38
|
-
@function rem($value) {
|
|
39
|
-
@return #{math.div(math.div($value, $value * 0 + 1), 16)}rem;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
@mixin light {
|
|
43
|
-
[data-mantine-color-scheme='light'] & {
|
|
44
|
-
@content;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
@mixin dark {
|
|
49
|
-
[data-mantine-color-scheme='dark'] & {
|
|
50
|
-
@content;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
@mixin hover {
|
|
55
|
-
@media (hover: hover) {
|
|
56
|
-
&:hover {
|
|
57
|
-
@content;
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
@media (hover: none) {
|
|
62
|
-
&:active {
|
|
63
|
-
@content;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
@mixin smaller-than($breakpoint) {
|
|
69
|
-
@media (max-width: $breakpoint) {
|
|
70
|
-
@content;
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
@mixin larger-than($breakpoint) {
|
|
75
|
-
@media (min-width: $breakpoint) {
|
|
76
|
-
@content;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// Add direction mixins if you need rtl support
|
|
81
|
-
@mixin rtl {
|
|
82
|
-
[dir='rtl'] & {
|
|
83
|
-
@content;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
@mixin ltr {
|
|
88
|
-
[dir='ltr'] & {
|
|
89
|
-
@content;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
/* -----------------------------------
|
|
95
|
-
Accessibility
|
|
96
|
-
----------------------------------- */
|
|
97
|
-
|
|
98
|
-
/* accessibly hidden text and elements */
|
|
99
|
-
@mixin visually-hidden {
|
|
100
|
-
clip: rect(1px, 1px, 1px, 1px);
|
|
101
|
-
position: absolute !important;
|
|
102
|
-
height: 1px;
|
|
103
|
-
width: 1px;
|
|
104
|
-
overflow: hidden;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/* reset visually-hidden properties */
|
|
108
|
-
@mixin reset-visually-hidden {
|
|
109
|
-
clip: auto;
|
|
110
|
-
position: relative !important;
|
|
111
|
-
height: auto;
|
|
112
|
-
width: 100%;
|
|
113
|
-
overflow: auto;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
/* -----------------------------------
|
|
118
|
-
Layout
|
|
119
|
-
----------------------------------- */
|
|
120
|
-
|
|
121
|
-
@mixin clearfix {
|
|
122
|
-
&:after {
|
|
123
|
-
content: "";
|
|
124
|
-
display: table;
|
|
125
|
-
clear: both;
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
/* fill up all the space — make sure the parent has pos:rel */
|
|
130
|
-
@mixin absolute-expand {
|
|
131
|
-
position: absolute;
|
|
132
|
-
top: 0; right: 0; bottom: 0; left: 0;
|
|
133
|
-
width: 100%;
|
|
134
|
-
height: 100%;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
/* center elements the dumb but sometimes useful way */
|
|
138
|
-
@mixin absolute-center {
|
|
139
|
-
position: absolute;
|
|
140
|
-
top: 50%;
|
|
141
|
-
left: 50%;
|
|
142
|
-
transform: translate(-50%, -50%);
|
|
143
|
-
}
|
|
144
|
-
@mixin absolute-vertical-center {
|
|
145
|
-
position: absolute;
|
|
146
|
-
top: 50%;
|
|
147
|
-
transform: translate(0, -50%);
|
|
148
|
-
}
|
|
149
|
-
@mixin absolute-horizontal-center {
|
|
150
|
-
position: absolute;
|
|
151
|
-
left: 50%;
|
|
152
|
-
transform: translate(-50%, 0);
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
@mixin hide-scrollbars {
|
|
156
|
-
&::-webkit-scrollbar {
|
|
157
|
-
display: none;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
/* overflow with inertia scrolling */
|
|
162
|
-
@mixin overflow-container {
|
|
163
|
-
overflow: auto;
|
|
164
|
-
overscroll-behavior: contain;
|
|
165
|
-
-webkit-overflow-scrolling: touch;
|
|
166
|
-
}
|
|
167
|
-
@mixin vertical-overflow-container {
|
|
168
|
-
overflow-y: auto;
|
|
169
|
-
overscroll-behavior-y: contain;
|
|
170
|
-
-webkit-overflow-scrolling: touch;
|
|
171
|
-
}
|
|
172
|
-
@mixin horizontal-overflow-container {
|
|
173
|
-
overflow-x: auto;
|
|
174
|
-
overscroll-behavior-x: contain;
|
|
175
|
-
-webkit-overflow-scrolling: touch;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { ReactNode } from 'react';
|
|
3
|
-
import { u as SearchReportItem, i as SearchReportParams } from './types-BcIo0oyw.mjs';
|
|
4
|
-
import { AutocompleteProps, TooltipProps } from '@mantine/core';
|
|
5
|
-
|
|
6
|
-
interface ReportTileProps {
|
|
7
|
-
reportId: string;
|
|
8
|
-
reportName: string;
|
|
9
|
-
members: Array<{
|
|
10
|
-
original_id: string;
|
|
11
|
-
name: string;
|
|
12
|
-
id: number;
|
|
13
|
-
variant: string;
|
|
14
|
-
variant_id: number;
|
|
15
|
-
dimension: string;
|
|
16
|
-
dimension_id: number;
|
|
17
|
-
image: {
|
|
18
|
-
src: string;
|
|
19
|
-
alt: string;
|
|
20
|
-
};
|
|
21
|
-
}>;
|
|
22
|
-
href: string;
|
|
23
|
-
onClick: (e: React.MouseEvent) => void;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
type TranslationKeys = "try_another" | "search" | "filters_all" | "no_results" | "load_more" | "select_report" | "select_variant" | "count_format";
|
|
27
|
-
type MetaTranslations = {
|
|
28
|
-
dimension?: Record<string, string>;
|
|
29
|
-
dimensionIcon?: Record<string, string>;
|
|
30
|
-
report?: Record<string, string>;
|
|
31
|
-
variant?: Record<string, string>;
|
|
32
|
-
variantIcon?: Record<string, string>;
|
|
33
|
-
tooltip?: string;
|
|
34
|
-
};
|
|
35
|
-
type ExploreTranslations = Partial<Record<TranslationKeys, string> & MetaTranslations>;
|
|
36
|
-
type FiltersType = {
|
|
37
|
-
profile?: number | undefined;
|
|
38
|
-
variant?: number | string | undefined;
|
|
39
|
-
};
|
|
40
|
-
interface Selector {
|
|
41
|
-
id?: number;
|
|
42
|
-
name: string;
|
|
43
|
-
members_count?: number;
|
|
44
|
-
variants?: {
|
|
45
|
-
id?: number;
|
|
46
|
-
name: string;
|
|
47
|
-
members_count?: number;
|
|
48
|
-
}[];
|
|
49
|
-
}
|
|
50
|
-
interface ExploreContextType {
|
|
51
|
-
metadata: any[];
|
|
52
|
-
loadingItems: boolean;
|
|
53
|
-
setLoadingItems: (q: boolean) => void;
|
|
54
|
-
loadingMetadata: boolean;
|
|
55
|
-
setLoadingMetadata: (q: boolean) => void;
|
|
56
|
-
resultCount: {
|
|
57
|
-
[key: number]: number;
|
|
58
|
-
};
|
|
59
|
-
totalCount: {
|
|
60
|
-
[key: number]: number;
|
|
61
|
-
};
|
|
62
|
-
setResultCount: (params: {
|
|
63
|
-
[key: number]: number;
|
|
64
|
-
} | false) => void;
|
|
65
|
-
activePage: number;
|
|
66
|
-
setActivePage: (page: number) => void;
|
|
67
|
-
pageSize: number;
|
|
68
|
-
results: SearchReportItem[];
|
|
69
|
-
filters: FiltersType;
|
|
70
|
-
doQuery: (cancelled: any, newOffset: any) => void;
|
|
71
|
-
setFilters: (filter: FiltersType) => void;
|
|
72
|
-
query: string;
|
|
73
|
-
setQuery: (q: string) => void;
|
|
74
|
-
debouncedQuery: string;
|
|
75
|
-
currentPageTotal: number;
|
|
76
|
-
selectorStructure: Selector[];
|
|
77
|
-
translations: ExploreTranslations;
|
|
78
|
-
setTranslations: (t: ExploreTranslations) => void;
|
|
79
|
-
showSelectors: boolean;
|
|
80
|
-
initExplore?: (p?: number | undefined, v?: number | undefined, q?: string | undefined) => void;
|
|
81
|
-
}
|
|
82
|
-
declare const useExplore: () => ExploreContextType;
|
|
83
|
-
interface ExploreProviderProps {
|
|
84
|
-
children: ReactNode;
|
|
85
|
-
pageSize?: number;
|
|
86
|
-
sort?: string;
|
|
87
|
-
}
|
|
88
|
-
declare function ExploreProvider({ children, pageSize, sort }: ExploreProviderProps): react_jsx_runtime.JSX.Element;
|
|
89
|
-
|
|
90
|
-
type BespokeSearchProps = {
|
|
91
|
-
locale: string;
|
|
92
|
-
profilePrefix: string;
|
|
93
|
-
autocompleteProps?: Partial<AutocompleteProps & {
|
|
94
|
-
searchConfig: {
|
|
95
|
-
searchLimit?: number;
|
|
96
|
-
queryThreshold?: number;
|
|
97
|
-
};
|
|
98
|
-
}> | Record<string, never>;
|
|
99
|
-
tooltipProps?: Partial<TooltipProps>;
|
|
100
|
-
tooltipText?: string;
|
|
101
|
-
searchReportParams?: Partial<SearchReportParams>;
|
|
102
|
-
callback?: (item: ReportItemProps) => void;
|
|
103
|
-
children?: ReactNode;
|
|
104
|
-
};
|
|
105
|
-
interface ReportItemPropsInner {
|
|
106
|
-
id: string;
|
|
107
|
-
reportName: string;
|
|
108
|
-
reportPath: string;
|
|
109
|
-
profilePrefix: string;
|
|
110
|
-
members: Array<{
|
|
111
|
-
original_id: string;
|
|
112
|
-
name: string;
|
|
113
|
-
id: number;
|
|
114
|
-
variant: string;
|
|
115
|
-
image: {
|
|
116
|
-
src: string;
|
|
117
|
-
alt: string;
|
|
118
|
-
};
|
|
119
|
-
}>;
|
|
120
|
-
href: string;
|
|
121
|
-
value: string;
|
|
122
|
-
}
|
|
123
|
-
type ReportItemProps = ReportItemPropsInner;
|
|
124
|
-
/**
|
|
125
|
-
* React component for rendering an inline search autocomplete
|
|
126
|
-
*/
|
|
127
|
-
declare function BespokeSearch({ locale, profilePrefix, autocompleteProps, tooltipProps, tooltipText, searchReportParams, callback, children }: BespokeSearchProps): react_jsx_runtime.JSX.Element;
|
|
128
|
-
|
|
129
|
-
export { BespokeSearch as B, type ExploreTranslations as E, type ReportTileProps as R, type ReportItemProps as a, ExploreProvider as b, useExplore as u };
|
package/dist/auth-BwgF4GT9.d.mts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import { S as SearchUsersParams, U as UpdateUserParams } from './types-BcIo0oyw.mjs';
|
|
2
|
-
import { User, DefaultSession, NextAuthOptions } from 'next-auth';
|
|
3
|
-
import { SessionContextValue } from 'next-auth/react';
|
|
4
|
-
|
|
5
|
-
interface BespokeUserInfo {
|
|
6
|
-
id?: string | null;
|
|
7
|
-
name?: string | null;
|
|
8
|
-
email?: string | null;
|
|
9
|
-
image?: string | null;
|
|
10
|
-
bespoke_app_metadata: {
|
|
11
|
-
reports?: {
|
|
12
|
-
reportId: number;
|
|
13
|
-
favorites: {
|
|
14
|
-
variantId: number;
|
|
15
|
-
contentId: number;
|
|
16
|
-
}[];
|
|
17
|
-
[key: string]: any;
|
|
18
|
-
}[];
|
|
19
|
-
[key: string]: any;
|
|
20
|
-
};
|
|
21
|
-
bespoke_user_metadata: {
|
|
22
|
-
preferredLocale?: string;
|
|
23
|
-
[key: string]: any;
|
|
24
|
-
};
|
|
25
|
-
bespoke_roles: string[];
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
}
|
|
28
|
-
declare module "next-auth" {
|
|
29
|
-
interface User extends User, BespokeUserInfo {
|
|
30
|
-
}
|
|
31
|
-
interface Session extends DefaultSession {
|
|
32
|
-
user: BespokeUserInfo;
|
|
33
|
-
}
|
|
34
|
-
interface Profile {
|
|
35
|
-
bespoke_app_metadata?: {
|
|
36
|
-
reports?: {
|
|
37
|
-
reportId: number;
|
|
38
|
-
favorites: {
|
|
39
|
-
variantId: number;
|
|
40
|
-
contentId: number;
|
|
41
|
-
}[];
|
|
42
|
-
[key: string]: any;
|
|
43
|
-
}[];
|
|
44
|
-
preferredLocale?: string;
|
|
45
|
-
[key: string]: any;
|
|
46
|
-
};
|
|
47
|
-
bespoke_user_metadata?: {
|
|
48
|
-
preferredLocale?: string;
|
|
49
|
-
[key: string]: any;
|
|
50
|
-
};
|
|
51
|
-
bespoke_roles?: string[];
|
|
52
|
-
name?: string;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
declare module "next-auth/jwt" {
|
|
56
|
-
interface JWT {
|
|
57
|
-
bespoke_app_metadata: {
|
|
58
|
-
reports?: {
|
|
59
|
-
reportId: number;
|
|
60
|
-
favorites: {
|
|
61
|
-
variantId: number;
|
|
62
|
-
contentId: number;
|
|
63
|
-
}[];
|
|
64
|
-
[key: string]: any;
|
|
65
|
-
}[];
|
|
66
|
-
[key: string]: any;
|
|
67
|
-
};
|
|
68
|
-
bespoke_user_metadata: {
|
|
69
|
-
preferredLocale?: string;
|
|
70
|
-
[key: string]: any;
|
|
71
|
-
};
|
|
72
|
-
bespoke_roles: string[];
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
/**
|
|
76
|
-
* Auth and roles
|
|
77
|
-
* There is a convention for roles names (no diference with IDs);
|
|
78
|
-
* "Admin" : Manage users and roles
|
|
79
|
-
* "Editor": Manage reports
|
|
80
|
-
* "Writer": Manage posts
|
|
81
|
-
*/
|
|
82
|
-
declare const CMS_ROLES: {
|
|
83
|
-
ADMIN: string;
|
|
84
|
-
EDITOR: string;
|
|
85
|
-
WRITER: string;
|
|
86
|
-
};
|
|
87
|
-
/**
|
|
88
|
-
* Roles could be SYSTEM: Defined by the app and needed to work; or USER: Defined by the user
|
|
89
|
-
* */
|
|
90
|
-
declare const addRoleTypes: (roles: BespokeRole[]) => BespokeRole[];
|
|
91
|
-
type BespokeRole = {
|
|
92
|
-
id: string;
|
|
93
|
-
name: string;
|
|
94
|
-
description: string;
|
|
95
|
-
type?: string;
|
|
96
|
-
};
|
|
97
|
-
interface BespokeUserProfile {
|
|
98
|
-
app_metadata: {
|
|
99
|
-
reports?: {
|
|
100
|
-
reportId: number;
|
|
101
|
-
favorites: {
|
|
102
|
-
variantId: number;
|
|
103
|
-
contentId: number;
|
|
104
|
-
}[];
|
|
105
|
-
[key: string]: any;
|
|
106
|
-
}[];
|
|
107
|
-
};
|
|
108
|
-
user_metadata: {
|
|
109
|
-
preferredLocale?: string;
|
|
110
|
-
};
|
|
111
|
-
roles: BespokeRole[];
|
|
112
|
-
[key: string]: any;
|
|
113
|
-
}
|
|
114
|
-
type BespokeUserData = {
|
|
115
|
-
isLoading: boolean;
|
|
116
|
-
update: SessionContextValue["update"];
|
|
117
|
-
user?: BespokeUserInfo;
|
|
118
|
-
status: SessionContextValue["status"];
|
|
119
|
-
};
|
|
120
|
-
interface SearchUserResult {
|
|
121
|
-
users: BespokeUserProfile[];
|
|
122
|
-
start: number;
|
|
123
|
-
limit: number;
|
|
124
|
-
length: number;
|
|
125
|
-
total: number;
|
|
126
|
-
}
|
|
127
|
-
interface BespokeAuthOptions extends NextAuthOptions {
|
|
128
|
-
actions?: {
|
|
129
|
-
searchRole: () => () => Promise<{
|
|
130
|
-
roles: BespokeRole[];
|
|
131
|
-
}>;
|
|
132
|
-
searchUser: () => (filters: SearchUsersParams) => Promise<SearchUserResult>;
|
|
133
|
-
readUser: () => (userId: string) => Promise<BespokeUserProfile>;
|
|
134
|
-
updateUser: () => (user: UpdateUserParams) => Promise<Record<string, string>>;
|
|
135
|
-
};
|
|
136
|
-
source?: string;
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
export { type BespokeUserInfo as B, CMS_ROLES as C, type SearchUserResult as S, type BespokeUserData as a, addRoleTypes as b, type BespokeRole as c, type BespokeUserProfile as d, type BespokeAuthOptions as e };
|
package/dist/auth.d.mts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import { B as BespokeUserInfo, a as BespokeUserData } from './auth-BwgF4GT9.mjs';
|
|
3
|
-
export { e as BespokeAuthOptions, c as BespokeRole, S as BespokeSearchUserResult, d as BespokeUserProfile, C as CMS_ROLES, b as addRoleTypes } from './auth-BwgF4GT9.mjs';
|
|
4
|
-
import { UseSessionOptions } from 'next-auth/react';
|
|
5
|
-
export { SessionProvider as BespokeUserProvider } from 'next-auth/react';
|
|
6
|
-
import { ButtonProps, MenuItemProps, MenuProps } from '@mantine/core';
|
|
7
|
-
export { S as BespokeSearchUsersParams, U as BespokeUpdateUserParams } from './types-BcIo0oyw.mjs';
|
|
8
|
-
import 'next-auth';
|
|
9
|
-
import 'sequelize';
|
|
10
|
-
|
|
11
|
-
declare function withPageRoleAuthRequired(params: {
|
|
12
|
-
allowedRoles: string[];
|
|
13
|
-
SuccessComponent: React.ComponentType<{
|
|
14
|
-
user: BespokeUserInfo;
|
|
15
|
-
}>;
|
|
16
|
-
FailureComponent: React.ComponentType;
|
|
17
|
-
}): (props: any) => react_jsx_runtime.JSX.Element;
|
|
18
|
-
|
|
19
|
-
declare function useBespokeUser(options?: UseSessionOptions<boolean>): BespokeUserData;
|
|
20
|
-
|
|
21
|
-
type BespokeLoginBtnTranslations = {
|
|
22
|
-
"Welcome message"?: string;
|
|
23
|
-
"Disconnect"?: string;
|
|
24
|
-
"Go to editor"?: string;
|
|
25
|
-
"Signing in"?: string;
|
|
26
|
-
"Sign in"?: string;
|
|
27
|
-
};
|
|
28
|
-
type BespokeLoginBtnProps = {
|
|
29
|
-
buttonProps?: ButtonProps;
|
|
30
|
-
editorMenuItemProps?: MenuItemProps;
|
|
31
|
-
editorMenuItemRoute?: string;
|
|
32
|
-
logoutButtonProps?: ButtonProps;
|
|
33
|
-
menuProps?: MenuProps;
|
|
34
|
-
options?: React.ReactNode;
|
|
35
|
-
optionsPosition?: string;
|
|
36
|
-
translations?: BespokeLoginBtnTranslations;
|
|
37
|
-
withEditorMenuItem?: boolean;
|
|
38
|
-
withSession?: boolean;
|
|
39
|
-
};
|
|
40
|
-
declare function BespokeLoginBtn({ buttonProps, editorMenuItemProps, editorMenuItemRoute, logoutButtonProps, menuProps, options, optionsPosition, translations, withEditorMenuItem, withSession, }: BespokeLoginBtnProps): react_jsx_runtime.JSX.Element;
|
|
41
|
-
|
|
42
|
-
export { BespokeLoginBtn, BespokeUserData, withPageRoleAuthRequired as BespokeWithPageRoleAuthRequired, useBespokeUser };
|