@panneau/core 4.0.11 → 4.0.14
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/contexts.d.ts +450 -0
- package/{es → dist}/contexts.js +23 -23
- package/dist/hooks.d.ts +362 -0
- package/{es → dist}/hooks.js +4 -4
- package/dist/index.d.ts +502 -0
- package/{es → dist}/index.js +7 -258
- package/dist/utils.d.ts +207 -0
- package/{es → dist}/utils.js +7 -7
- package/package.json +23 -23
- package/es/types/core.d.ts +0 -133
- package/es/types/form.d.ts +0 -58
- package/es/types/index.d.ts +0 -20
- package/es/types/panneau.d.ts +0 -50
- package/es/types/resource.d.ts +0 -112
- package/lib/contexts.js +0 -1432
- package/lib/hooks.js +0 -1168
- package/lib/index.js +0 -1019
- package/lib/utils.js +0 -789
package/es/types/core.d.ts
DELETED
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Core UI Types
|
|
3
|
-
* TypeScript interfaces corresponding to PanneauPropTypes
|
|
4
|
-
*/
|
|
5
|
-
import { ReactNode } from 'react';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Internationalization message definition
|
|
9
|
-
*/
|
|
10
|
-
export interface Message {
|
|
11
|
-
id: string;
|
|
12
|
-
defaultMessage?: string;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* Label can be either a message object or any React node
|
|
17
|
-
*/
|
|
18
|
-
export type Label = Message | ReactNode;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* HTTP status code (number or string)
|
|
22
|
-
*/
|
|
23
|
-
export type StatusCode = number | string;
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Menu item definition
|
|
27
|
-
*/
|
|
28
|
-
export interface MenuItem {
|
|
29
|
-
id?: number | string;
|
|
30
|
-
label?: Label;
|
|
31
|
-
url?: string;
|
|
32
|
-
external?: boolean;
|
|
33
|
-
active?: boolean;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Button definition
|
|
38
|
-
*/
|
|
39
|
-
export interface Button {
|
|
40
|
-
id?: string;
|
|
41
|
-
label?: Label;
|
|
42
|
-
onClick?: () => void;
|
|
43
|
-
href?: string;
|
|
44
|
-
target?: string;
|
|
45
|
-
theme?: ButtonTheme;
|
|
46
|
-
size?: ButtonSize;
|
|
47
|
-
type?: ButtonType;
|
|
48
|
-
disabled?: boolean;
|
|
49
|
-
external?: boolean;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
* Button theme variants (Bootstrap 5)
|
|
54
|
-
*/
|
|
55
|
-
export type ButtonTheme =
|
|
56
|
-
| 'primary'
|
|
57
|
-
| 'secondary'
|
|
58
|
-
| 'success'
|
|
59
|
-
| 'danger'
|
|
60
|
-
| 'warning'
|
|
61
|
-
| 'info'
|
|
62
|
-
| 'light'
|
|
63
|
-
| 'dark'
|
|
64
|
-
| null;
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Button size variants
|
|
68
|
-
*/
|
|
69
|
-
export type ButtonSize = 'lg' | 'md' | 'sm' | null;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Button type attribute
|
|
73
|
-
*/
|
|
74
|
-
export type ButtonType = 'button' | 'submit';
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Dropdown alignment
|
|
78
|
-
*/
|
|
79
|
-
export type DropdownAlign = 'start' | 'end';
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Form control size
|
|
83
|
-
*/
|
|
84
|
-
export type ControlSize = 'lg' | 'sm' | null;
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Form status states
|
|
88
|
-
*/
|
|
89
|
-
export type FormStatus = 'loading' | 'success' | 'error' | null;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Form feedback states
|
|
93
|
-
*/
|
|
94
|
-
export type Feedback = 'valid' | 'invalid' | 'loading' | null;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Form error object
|
|
98
|
-
*/
|
|
99
|
-
export interface FormError {
|
|
100
|
-
message?: string;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Toggle definition
|
|
105
|
-
*/
|
|
106
|
-
export interface Toggle {
|
|
107
|
-
key?: string;
|
|
108
|
-
label?: string;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* Breadcrumb definition
|
|
113
|
-
*/
|
|
114
|
-
export interface Breadcrumb {
|
|
115
|
-
url?: string;
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Font definition
|
|
120
|
-
*/
|
|
121
|
-
export interface Font {
|
|
122
|
-
// Properties to be defined based on requirements
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Tracking variables
|
|
127
|
-
*/
|
|
128
|
-
export type TrackingVariables = Record<string, unknown>;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Trigger update identifier
|
|
132
|
-
*/
|
|
133
|
-
export type TriggerUpdate = string;
|
package/es/types/form.d.ts
DELETED
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Form Types
|
|
3
|
-
* TypeScript interfaces for form-related components
|
|
4
|
-
*/
|
|
5
|
-
import { ReactNode } from 'react';
|
|
6
|
-
|
|
7
|
-
import { Label } from './core';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Field option for select/radio inputs
|
|
11
|
-
*/
|
|
12
|
-
export interface FieldOption {
|
|
13
|
-
value?: string;
|
|
14
|
-
label?: string;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* Select option (more flexible than FieldOption)
|
|
19
|
-
*/
|
|
20
|
-
export type SelectOption =
|
|
21
|
-
| string
|
|
22
|
-
| number
|
|
23
|
-
| {
|
|
24
|
-
value?: unknown;
|
|
25
|
-
label?: Label | string;
|
|
26
|
-
}
|
|
27
|
-
| Record<string, unknown>;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Field definition
|
|
31
|
-
*/
|
|
32
|
-
export interface Field {
|
|
33
|
-
name?: string; // Not required on localized fields
|
|
34
|
-
type?: string;
|
|
35
|
-
component?: string;
|
|
36
|
-
label?: ReactNode;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Form definition
|
|
41
|
-
*/
|
|
42
|
-
export interface Form {
|
|
43
|
-
title: ReactNode;
|
|
44
|
-
fields?: Field[];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Table column definition
|
|
49
|
-
*/
|
|
50
|
-
export type TableColumn =
|
|
51
|
-
| string
|
|
52
|
-
| {
|
|
53
|
-
id?: string;
|
|
54
|
-
component?: string;
|
|
55
|
-
path?: string;
|
|
56
|
-
field?: string;
|
|
57
|
-
columnClassName?: string;
|
|
58
|
-
};
|
package/es/types/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Panneau TypeScript Type Definitions
|
|
3
|
-
*
|
|
4
|
-
* This module exports TypeScript interfaces corresponding to the PanneauPropTypes
|
|
5
|
-
* defined in packages/core/src/lib/PropTypes.js
|
|
6
|
-
*
|
|
7
|
-
* @module @panneau/core/types
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
// Core UI Types
|
|
11
|
-
export type * from './core';
|
|
12
|
-
|
|
13
|
-
// Form Types
|
|
14
|
-
export type * from './form';
|
|
15
|
-
|
|
16
|
-
// Resource Types
|
|
17
|
-
export type * from './resource';
|
|
18
|
-
|
|
19
|
-
// Panneau Definition Types
|
|
20
|
-
export type * from './panneau';
|
package/es/types/panneau.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Panneau Definition Types
|
|
3
|
-
* TypeScript interfaces for main Panneau configuration and definitions
|
|
4
|
-
*/
|
|
5
|
-
import { Intl, Resource } from './resource';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* Panneau route configuration
|
|
9
|
-
*/
|
|
10
|
-
export interface Routes {
|
|
11
|
-
'resources.index': string;
|
|
12
|
-
'resources.create': string;
|
|
13
|
-
'resources.store': string;
|
|
14
|
-
'resources.show': string;
|
|
15
|
-
'resources.edit': string;
|
|
16
|
-
'resources.update': string;
|
|
17
|
-
'resources.delete': string;
|
|
18
|
-
'resources.destroy': string;
|
|
19
|
-
'resources.duplicate': string;
|
|
20
|
-
'resources.clone': string;
|
|
21
|
-
'resources.restore': string;
|
|
22
|
-
[key: string]: string;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
/**
|
|
26
|
-
* Page definition
|
|
27
|
-
*/
|
|
28
|
-
export interface Page {
|
|
29
|
-
component: string;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Panneau definition (main configuration)
|
|
35
|
-
*/
|
|
36
|
-
export interface PanneauDefinition {
|
|
37
|
-
name?: string;
|
|
38
|
-
resources?: Resource[];
|
|
39
|
-
routes?: Routes;
|
|
40
|
-
pages?: Record<string, Page>;
|
|
41
|
-
intl?: Intl;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Generic definition
|
|
46
|
-
*/
|
|
47
|
-
export interface Definition {
|
|
48
|
-
name?: string;
|
|
49
|
-
[key: string]: unknown;
|
|
50
|
-
}
|
package/es/types/resource.d.ts
DELETED
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resource Types
|
|
3
|
-
* TypeScript interfaces for resources, items, users, media, and other entities
|
|
4
|
-
*/
|
|
5
|
-
import { Field } from './form';
|
|
6
|
-
|
|
7
|
-
export interface Action {
|
|
8
|
-
id?: string;
|
|
9
|
-
component?: string;
|
|
10
|
-
label?: string | null;
|
|
11
|
-
icon?: string | null;
|
|
12
|
-
href?: string | null;
|
|
13
|
-
external?: boolean;
|
|
14
|
-
theme?: string;
|
|
15
|
-
target?: string;
|
|
16
|
-
onClick?: (() => void) | null;
|
|
17
|
-
endpoint?: string | null;
|
|
18
|
-
withConfirmation?: boolean;
|
|
19
|
-
[key: string]: unknown;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export type ActionDefinition = string | Action;
|
|
23
|
-
|
|
24
|
-
type ActionValue = Item | Item[] | null;
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Internationalization configuration
|
|
28
|
-
*/
|
|
29
|
-
export interface Intl {
|
|
30
|
-
locale?: string;
|
|
31
|
-
messages?: Record<string, string>;
|
|
32
|
-
values?: Record<string, string>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Resource definition
|
|
37
|
-
*/
|
|
38
|
-
export interface Resource {
|
|
39
|
-
id: string;
|
|
40
|
-
name: string;
|
|
41
|
-
intl?: Intl;
|
|
42
|
-
fields?: Field[];
|
|
43
|
-
forms?: Record<string, unknown>;
|
|
44
|
-
shows_in_navbar?: boolean;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Generic item (base interface for data items)
|
|
49
|
-
*/
|
|
50
|
-
export interface Item {
|
|
51
|
-
id: string;
|
|
52
|
-
[key: string]: unknown;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* User definition
|
|
57
|
-
*/
|
|
58
|
-
export interface User {
|
|
59
|
-
id?: number | string;
|
|
60
|
-
[key: string]: unknown;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Media file definition
|
|
65
|
-
*/
|
|
66
|
-
export interface Media {
|
|
67
|
-
id: string;
|
|
68
|
-
name: string;
|
|
69
|
-
type: string;
|
|
70
|
-
thumbnail_url?: string;
|
|
71
|
-
[key: string]: unknown;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Preview definition
|
|
76
|
-
*/
|
|
77
|
-
export interface Preview {
|
|
78
|
-
id?: string;
|
|
79
|
-
[key: string]: unknown;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
/**
|
|
83
|
-
* Modal definition
|
|
84
|
-
*/
|
|
85
|
-
export interface Modal {
|
|
86
|
-
name?: string;
|
|
87
|
-
[key: string]: unknown;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
/**
|
|
91
|
-
* Filter definition
|
|
92
|
-
*/
|
|
93
|
-
export interface Filter {
|
|
94
|
-
id?: string;
|
|
95
|
-
component?: string;
|
|
96
|
-
[key: string]: unknown;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
/**
|
|
100
|
-
* Uppy configuration
|
|
101
|
-
*/
|
|
102
|
-
export interface Uppy {
|
|
103
|
-
tus?: Record<string, unknown>;
|
|
104
|
-
[key: string]: unknown;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Uppy instance
|
|
109
|
-
*/
|
|
110
|
-
export interface uppy {
|
|
111
|
-
[key: string]: unknown;
|
|
112
|
-
}
|