@marianmeres/collection-types 1.19.0 → 1.21.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.
- package/dist/custom-pages.d.ts +88 -49
- package/dist/custom-pages.js +9 -3
- package/dist/joy-config.d.ts +31 -0
- package/dist/joy-config.js +1 -0
- package/dist/mod.d.ts +1 -0
- package/dist/mod.js +2 -0
- package/package.json +1 -1
package/dist/custom-pages.d.ts
CHANGED
|
@@ -1,29 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Custom Pages Configuration Types
|
|
2
|
+
* Custom Pages Configuration Types (v2 - 3-Level Hierarchy)
|
|
3
3
|
*
|
|
4
4
|
* These types define the structure of the `__joy_custom_pages__` config record
|
|
5
|
-
* stored in the project's config collection.
|
|
6
|
-
*
|
|
5
|
+
* stored in the project's config collection.
|
|
6
|
+
*
|
|
7
|
+
* Hierarchy:
|
|
8
|
+
* - Level 1: Group (shown in sidebar with expand/collapse)
|
|
9
|
+
* - Level 2: Page (shown as items within expanded group)
|
|
10
|
+
* - Level 3: Tab (shown as tabs within a page)
|
|
11
|
+
*
|
|
12
|
+
* URL Pattern: #/p/{projectId}/custom/{groupId}/{pageId}?/{tabPath}?
|
|
7
13
|
*
|
|
8
14
|
* @module custom-pages/types
|
|
9
15
|
*/
|
|
10
16
|
import type { MaybeLocalized } from "./utils.js";
|
|
11
17
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
18
|
+
* Tab definition within a page (Level 3).
|
|
19
|
+
* Tabs are rendered as secondary navigation within a page.
|
|
14
20
|
*/
|
|
15
|
-
export interface
|
|
21
|
+
export interface CustomPageTab {
|
|
16
22
|
/**
|
|
17
|
-
* Unique path segment
|
|
18
|
-
* Used in URL: #/p/{projectId}/custom/{pageId}/{path}
|
|
23
|
+
* Unique path segment for this tab.
|
|
24
|
+
* Used in URL: #/p/{projectId}/custom/{groupId}/{pageId}/{path}
|
|
19
25
|
*/
|
|
20
26
|
path: string;
|
|
21
27
|
/**
|
|
22
|
-
* Display label for
|
|
28
|
+
* Display label for the tab.
|
|
23
29
|
*/
|
|
24
30
|
label: MaybeLocalized<string>;
|
|
25
31
|
/**
|
|
26
|
-
* Icon identifier for the tab
|
|
32
|
+
* Icon identifier for the tab.
|
|
27
33
|
*/
|
|
28
34
|
icon?: string;
|
|
29
35
|
/**
|
|
@@ -32,85 +38,119 @@ export interface CustomPageNestedRoute {
|
|
|
32
38
|
*/
|
|
33
39
|
order?: number;
|
|
34
40
|
/**
|
|
35
|
-
* Whether this is the default
|
|
36
|
-
* If no default is specified, the first
|
|
41
|
+
* Whether this is the default tab when page is accessed without tab path.
|
|
42
|
+
* If no default is specified, the first tab by order is used.
|
|
37
43
|
*/
|
|
38
44
|
default?: boolean;
|
|
39
45
|
/**
|
|
40
|
-
* Component file name within
|
|
41
|
-
* Defaults to path if not specified.
|
|
42
|
-
* @example "Overview" for "
|
|
46
|
+
* Component file name within _tabs/ directory.
|
|
47
|
+
* Defaults to capitalized path if not specified.
|
|
48
|
+
* @example "Overview" for "_tabs/Overview.svelte"
|
|
43
49
|
*/
|
|
44
50
|
component?: string;
|
|
45
51
|
}
|
|
46
52
|
/**
|
|
47
|
-
*
|
|
53
|
+
* Page definition within a group (Level 2).
|
|
54
|
+
* Pages are shown as items within an expanded group in the sidebar.
|
|
48
55
|
*/
|
|
49
|
-
export interface
|
|
56
|
+
export interface CustomPageDef {
|
|
50
57
|
/**
|
|
51
|
-
*
|
|
58
|
+
* Unique identifier for this page within the group.
|
|
59
|
+
* Used in URL: #/p/{projectId}/custom/{groupId}/{id}
|
|
60
|
+
* Must match directory name: src/custom-pages/pages/{groupId}/{id}/
|
|
61
|
+
*/
|
|
62
|
+
id: string;
|
|
63
|
+
/**
|
|
64
|
+
* Display label for the page in navigation.
|
|
52
65
|
*/
|
|
53
66
|
label: MaybeLocalized<string>;
|
|
54
67
|
/**
|
|
55
|
-
*
|
|
68
|
+
* Human-readable description of what this page does.
|
|
69
|
+
*/
|
|
70
|
+
description?: string;
|
|
71
|
+
/**
|
|
72
|
+
* Icon identifier for the page.
|
|
56
73
|
*/
|
|
57
74
|
icon?: string;
|
|
58
75
|
/**
|
|
59
|
-
* Display order
|
|
76
|
+
* Display order within the group (lower = first).
|
|
60
77
|
* @default 0
|
|
61
78
|
*/
|
|
62
79
|
order?: number;
|
|
63
80
|
/**
|
|
64
|
-
*
|
|
81
|
+
* Whether this is the default page when group is accessed without page ID.
|
|
82
|
+
* If no default is specified, the first page by order is used.
|
|
65
83
|
*/
|
|
66
|
-
|
|
84
|
+
default?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Whether this page is enabled.
|
|
87
|
+
* @default true
|
|
88
|
+
*/
|
|
89
|
+
enabled?: boolean;
|
|
67
90
|
/**
|
|
68
|
-
*
|
|
91
|
+
* Component file name (defaults to "Page" for Page.svelte).
|
|
69
92
|
*/
|
|
70
|
-
|
|
93
|
+
component?: string;
|
|
94
|
+
/**
|
|
95
|
+
* Tabs within this page (Level 3).
|
|
96
|
+
* If specified and non-empty, the page will show tab navigation.
|
|
97
|
+
* If empty or undefined, page content is rendered directly.
|
|
98
|
+
*/
|
|
99
|
+
tabs?: CustomPageTab[];
|
|
71
100
|
}
|
|
72
101
|
/**
|
|
73
|
-
*
|
|
102
|
+
* Navigation metadata for a group.
|
|
74
103
|
*/
|
|
75
|
-
export interface
|
|
104
|
+
export interface CustomPageNavMeta {
|
|
76
105
|
/**
|
|
77
|
-
*
|
|
78
|
-
* Used in URL: #/p/{projectId}/custom/{id}
|
|
79
|
-
* Must match directory name in src/custom-pages/pages/{id}/
|
|
106
|
+
* Display label in navigation.
|
|
80
107
|
*/
|
|
81
|
-
|
|
108
|
+
label: MaybeLocalized<string>;
|
|
82
109
|
/**
|
|
83
|
-
*
|
|
110
|
+
* Icon identifier (matches ICON_MAP in LeftSidebarNav).
|
|
84
111
|
*/
|
|
85
|
-
|
|
112
|
+
icon?: string;
|
|
86
113
|
/**
|
|
87
|
-
*
|
|
88
|
-
*
|
|
89
|
-
* Defaults to "/{id}" if not specified.
|
|
114
|
+
* Display order in the custom pages section (lower = first).
|
|
115
|
+
* @default 0
|
|
90
116
|
*/
|
|
91
|
-
|
|
117
|
+
order?: number;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Group definition (Level 1).
|
|
121
|
+
* Groups are shown in the sidebar with expand/collapse functionality.
|
|
122
|
+
*/
|
|
123
|
+
export interface CustomPageGroupDef {
|
|
92
124
|
/**
|
|
93
|
-
*
|
|
125
|
+
* Unique identifier for this group.
|
|
126
|
+
* Used in URL: #/p/{projectId}/custom/{id}
|
|
127
|
+
* Must match directory name: src/custom-pages/pages/{id}/
|
|
94
128
|
*/
|
|
95
|
-
|
|
129
|
+
id: string;
|
|
96
130
|
/**
|
|
97
|
-
*
|
|
98
|
-
* If specified, the page component receives an `activeNestedRoute` prop.
|
|
131
|
+
* Human-readable description of this group.
|
|
99
132
|
*/
|
|
100
|
-
|
|
133
|
+
description?: string;
|
|
101
134
|
/**
|
|
102
|
-
* Whether this
|
|
135
|
+
* Whether this group is enabled.
|
|
103
136
|
* @default true
|
|
104
137
|
*/
|
|
105
138
|
enabled?: boolean;
|
|
139
|
+
/**
|
|
140
|
+
* Navigation metadata for the group.
|
|
141
|
+
*/
|
|
142
|
+
nav: CustomPageNavMeta;
|
|
143
|
+
/**
|
|
144
|
+
* Pages within this group (Level 2).
|
|
145
|
+
*/
|
|
146
|
+
pages: CustomPageDef[];
|
|
106
147
|
/**
|
|
107
148
|
* Priority for route matching (higher = checked first).
|
|
108
|
-
* Prevents conflicts with more generic routes.
|
|
109
149
|
* @default 0
|
|
110
150
|
*/
|
|
111
151
|
priority?: number;
|
|
112
152
|
/**
|
|
113
|
-
* Required permissions to access this
|
|
153
|
+
* Required permissions to access this group.
|
|
114
154
|
* If specified, user must have at least one of these permissions.
|
|
115
155
|
*/
|
|
116
156
|
permissions?: string[];
|
|
@@ -133,19 +173,18 @@ export interface CustomPagesNavSection {
|
|
|
133
173
|
divider?: boolean;
|
|
134
174
|
}
|
|
135
175
|
/**
|
|
136
|
-
* The complete custom pages configuration structure.
|
|
176
|
+
* The complete custom pages configuration structure (v2).
|
|
137
177
|
* Stored as the `value` of the `__joy_custom_pages__` config record.
|
|
138
178
|
*/
|
|
139
179
|
export interface CustomPagesConfig {
|
|
140
180
|
/**
|
|
141
|
-
* Schema version for
|
|
142
|
-
* @default 1
|
|
181
|
+
* Schema version. Must be 2 for 3-level hierarchy.
|
|
143
182
|
*/
|
|
144
183
|
version: number;
|
|
145
184
|
/**
|
|
146
|
-
* Array of
|
|
185
|
+
* Array of group definitions (Level 1).
|
|
147
186
|
*/
|
|
148
|
-
|
|
187
|
+
groups: CustomPageGroupDef[];
|
|
149
188
|
/**
|
|
150
189
|
* Section configuration for the navigation.
|
|
151
190
|
*/
|
package/dist/custom-pages.js
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Custom Pages Configuration Types
|
|
2
|
+
* Custom Pages Configuration Types (v2 - 3-Level Hierarchy)
|
|
3
3
|
*
|
|
4
4
|
* These types define the structure of the `__joy_custom_pages__` config record
|
|
5
|
-
* stored in the project's config collection.
|
|
6
|
-
*
|
|
5
|
+
* stored in the project's config collection.
|
|
6
|
+
*
|
|
7
|
+
* Hierarchy:
|
|
8
|
+
* - Level 1: Group (shown in sidebar with expand/collapse)
|
|
9
|
+
* - Level 2: Page (shown as items within expanded group)
|
|
10
|
+
* - Level 3: Tab (shown as tabs within a page)
|
|
11
|
+
*
|
|
12
|
+
* URL Pattern: #/p/{projectId}/custom/{groupId}/{pageId}?/{tabPath}?
|
|
7
13
|
*
|
|
8
14
|
* @module custom-pages/types
|
|
9
15
|
*/
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Base configuration interface for Joy admin UI.
|
|
3
|
+
* Extensible via index signature - consumers can add custom fields.
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* // Extend with custom fields
|
|
8
|
+
* interface MyJoyConfig extends JoyConfig {
|
|
9
|
+
* myCustomField: string;
|
|
10
|
+
* stuic: {
|
|
11
|
+
* DismissibleMessage: {
|
|
12
|
+
* theme: "red" | "blue"; // Stricter typing
|
|
13
|
+
* };
|
|
14
|
+
* };
|
|
15
|
+
* }
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export interface JoyConfig {
|
|
19
|
+
/** Project/app title */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** Stuic component configuration overrides */
|
|
22
|
+
stuic?: {
|
|
23
|
+
DismissibleMessage?: {
|
|
24
|
+
/** Theme color for dismissible messages */
|
|
25
|
+
theme?: string;
|
|
26
|
+
};
|
|
27
|
+
[component: string]: Record<string, unknown> | undefined;
|
|
28
|
+
};
|
|
29
|
+
/** Index signature for custom extensions */
|
|
30
|
+
[key: string]: unknown;
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/mod.d.ts
CHANGED
package/dist/mod.js
CHANGED