@zeyos/zx 3.0.0 → 4.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.
- package/CHANGELOG.md +51 -0
- package/DESIGN-SYSTEM.md +28 -68
- package/README.md +16 -37
- package/dist/types/components/app-sidebar/app-sidebar.d.ts +106 -32
- package/dist/types/components/card/card.d.ts +128 -0
- package/dist/types/components/chart/chart.d.ts +1 -0
- package/dist/types/components/launcher/launcher.d.ts +65 -6
- package/dist/types/components/select/select.d.ts +51 -0
- package/dist/types/components/table/table.d.ts +4 -3
- package/dist/types/core/dom.d.ts +8 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/{components/app-rail → internal}/app-rail.d.ts +34 -19
- package/dist/types/zeyos/icons.d.ts +5 -0
- package/dist/types/zeyos/index.d.ts +2 -1
- package/dist/types/zeyos/launcher.d.ts +147 -0
- package/dist/types/zeyos/select.d.ts +39 -0
- package/dist/zx-zeyos.esm.js +1324 -46
- package/dist/zx-zeyos.esm.min.js +1 -1
- package/dist/zx.css +400 -12
- package/dist/zx.esm.js +1059 -189
- package/dist/zx.esm.min.js +3 -3
- package/dist/zx.global.js +1059 -189
- package/dist/zx.global.min.js +3 -3
- package/dist/zx.min.css +1 -1
- package/docs/api.json +258 -145
- package/docs/llms.md +93 -112
- package/docs/llms.txt +16 -15
- package/package.json +8 -17
- package/src/components/app-sidebar/app-sidebar.css +12 -0
- package/src/components/app-sidebar/app-sidebar.js +310 -110
- package/src/components/card/card.css +149 -0
- package/src/components/card/card.js +285 -0
- package/src/components/chart/chart.js +8 -3
- package/src/components/grid/grid.js +10 -3
- package/src/components/launcher/launcher.css +113 -3
- package/src/components/launcher/launcher.js +234 -26
- package/src/components/select/field-adapter.js +9 -4
- package/src/components/select/select.css +144 -10
- package/src/components/select/select.js +259 -27
- package/src/components/table/table.js +8 -7
- package/src/core/dom.js +20 -0
- package/src/index.js +2 -1
- package/src/{components/app-rail → internal}/app-rail.js +80 -30
- package/src/zeyos/icons.js +8 -3
- package/src/zeyos/index.js +7 -1
- package/src/zeyos/launcher.js +338 -0
- package/src/zeyos/modules.js +1 -0
- package/src/zeyos/select.js +115 -1
- package/styles/tokens/global.css +1 -1
- package/styles/tokens/modules.css +1 -0
- package/styles/zx.css +1 -0
- package/MIGRATION.md +0 -749
- package/dist/types/compat/base.d.ts +0 -156
- package/dist/types/compat/globals.d.ts +0 -20
- package/dist/types/compat/index.d.ts +0 -128
- package/dist/types/compat/map/basic.d.ts +0 -175
- package/dist/types/compat/map/data.d.ts +0 -103
- package/dist/types/compat/map/date-time.d.ts +0 -80
- package/dist/types/compat/map/factory.d.ts +0 -9
- package/dist/types/compat/map/form.d.ts +0 -98
- package/dist/types/compat/map/helpers.d.ts +0 -12
- package/dist/types/compat/map/http.d.ts +0 -36
- package/dist/types/compat/map/layout.d.ts +0 -106
- package/dist/types/compat/map/options.d.ts +0 -80
- package/dist/types/compat/map/select.d.ts +0 -95
- package/dist/types/compat/map/stubs.d.ts +0 -32
- package/dist/types/compat/map/utilities.d.ts +0 -37
- package/dist/types/compat-entry.d.ts +0 -5
- package/dist/zx-compat.esm.js +0 -17848
- package/dist/zx-compat.esm.min.js +0 -1
- package/dist/zx-compat.global.js +0 -29008
- package/dist/zx-compat.global.min.js +0 -3
- package/src/compat/base.js +0 -291
- package/src/compat/globals.js +0 -167
- package/src/compat/index.js +0 -84
- package/src/compat/map/basic.js +0 -464
- package/src/compat/map/data.js +0 -254
- package/src/compat/map/date-time.js +0 -177
- package/src/compat/map/factory.js +0 -45
- package/src/compat/map/form.js +0 -330
- package/src/compat/map/helpers.js +0 -46
- package/src/compat/map/http.js +0 -117
- package/src/compat/map/layout.js +0 -256
- package/src/compat/map/options.js +0 -267
- package/src/compat/map/select.js +0 -198
- package/src/compat/map/stubs.js +0 -26
- package/src/compat/map/utilities.js +0 -113
- package/src/compat-entry.js +0 -11
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Launcher } from '../components/launcher/launcher.js';
|
|
2
|
+
/** Static application identifiers present in the current ZeyOS shell prototype. */
|
|
3
|
+
export declare const ZEYOS_LAUNCHER_APPLICATIONS: readonly string[];
|
|
4
|
+
export type ZeyosLauncherState = {
|
|
5
|
+
/**
|
|
6
|
+
* Permitted module catalogue.
|
|
7
|
+
*/
|
|
8
|
+
modules?: Record<string, string> | Array<string | Record<string, any>>;
|
|
9
|
+
/**
|
|
10
|
+
* Forks/weblets and authoritative menu entries.
|
|
11
|
+
*/
|
|
12
|
+
menuApps?: Array<Array<any> | Record<string, any>>;
|
|
13
|
+
/**
|
|
14
|
+
* Application identifiers in pinned order.
|
|
15
|
+
*/
|
|
16
|
+
pinned?: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Recent records.
|
|
19
|
+
*/
|
|
20
|
+
recent?: Array<Array<any> | Record<string, any>>;
|
|
21
|
+
/**
|
|
22
|
+
* Current module, `fork#…`, or `weblet#…` identifier.
|
|
23
|
+
*/
|
|
24
|
+
activeIdentifier?: string | null;
|
|
25
|
+
/**
|
|
26
|
+
* Permission predicate.
|
|
27
|
+
*/
|
|
28
|
+
canUseModule?: (module: string) => boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Record search loader.
|
|
31
|
+
*/
|
|
32
|
+
search?: (query: string, context: {
|
|
33
|
+
signal: AbortSignal;
|
|
34
|
+
}) => Promise<unknown> | unknown;
|
|
35
|
+
/**
|
|
36
|
+
* Recent-record loader.
|
|
37
|
+
*/
|
|
38
|
+
loadRecent?: (context: {
|
|
39
|
+
signal: AbortSignal;
|
|
40
|
+
}) => Promise<unknown> | unknown;
|
|
41
|
+
/**
|
|
42
|
+
* Maps an app to href/invoke/value metadata.
|
|
43
|
+
*/
|
|
44
|
+
resolveApplication?: (app: unknown) => Record<string, any> | null;
|
|
45
|
+
/**
|
|
46
|
+
* Maps a record to href/invoke/value metadata.
|
|
47
|
+
*/
|
|
48
|
+
resolveRecord?: (record: unknown) => Record<string, any> | null;
|
|
49
|
+
/**
|
|
50
|
+
* Localized applications/recent/results/entity labels and hints.
|
|
51
|
+
*/
|
|
52
|
+
labels?: Record<string, any>;
|
|
53
|
+
/**
|
|
54
|
+
* Host icon renderer for modules, forks, and weblets.
|
|
55
|
+
*/
|
|
56
|
+
renderApplicationIcon?: (app: unknown, normalized: Record<string, any>) => Node | null;
|
|
57
|
+
/**
|
|
58
|
+
* Host record icon renderer.
|
|
59
|
+
*/
|
|
60
|
+
renderRecordIcon?: (record: unknown, normalized: Record<string, any>) => Node | null;
|
|
61
|
+
/**
|
|
62
|
+
* Legacy weblet-only icon renderer.
|
|
63
|
+
*/
|
|
64
|
+
renderWebletIcon?: (app: unknown, normalized: Record<string, any>) => Node | null;
|
|
65
|
+
};
|
|
66
|
+
export type ZeyosLauncherOptions = {
|
|
67
|
+
/**
|
|
68
|
+
* Use stock icon fallbacks instead of the optional ZeyOS kit.
|
|
69
|
+
*/
|
|
70
|
+
standardIcons?: boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Extra generic Launcher items.
|
|
73
|
+
*/
|
|
74
|
+
items?: Array<Record<string, any>>;
|
|
75
|
+
/**
|
|
76
|
+
* Extra generic Launcher sources.
|
|
77
|
+
*/
|
|
78
|
+
sources?: Array<Record<string, any>>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* @typedef {Object} ZeyosLauncherState
|
|
82
|
+
* @property {Record<string, string>|Array<string|Record<string, any>>} [modules={}] Permitted module catalogue.
|
|
83
|
+
* @property {Array<Array<any>|Record<string, any>>} [menuApps=[]] Forks/weblets and authoritative menu entries.
|
|
84
|
+
* @property {string[]} [pinned=[]] Application identifiers in pinned order.
|
|
85
|
+
* @property {Array<Array<any>|Record<string, any>>} [recent=[]] Recent records.
|
|
86
|
+
* @property {string|null} [activeIdentifier=null] Current module, `fork#…`, or `weblet#…` identifier.
|
|
87
|
+
* @property {(module: string) => boolean} [canUseModule] Permission predicate.
|
|
88
|
+
* @property {(query: string, context: {signal: AbortSignal}) => Promise<unknown>|unknown} [search] Record search loader.
|
|
89
|
+
* @property {(context: {signal: AbortSignal}) => Promise<unknown>|unknown} [loadRecent] Recent-record loader.
|
|
90
|
+
* @property {(app: unknown) => Record<string, any>|null} [resolveApplication] Maps an app to href/invoke/value metadata.
|
|
91
|
+
* @property {(record: unknown) => Record<string, any>|null} [resolveRecord] Maps a record to href/invoke/value metadata.
|
|
92
|
+
* @property {Record<string, any>} [labels] Localized applications/recent/results/entity labels and hints.
|
|
93
|
+
* @property {(app: unknown, normalized: Record<string, any>) => Node|null} [renderApplicationIcon] Host icon renderer for modules, forks, and weblets.
|
|
94
|
+
* @property {(record: unknown, normalized: Record<string, any>) => Node|null} [renderRecordIcon] Host record icon renderer.
|
|
95
|
+
* @property {(app: unknown, normalized: Record<string, any>) => Node|null} [renderWebletIcon] Legacy weblet-only icon renderer.
|
|
96
|
+
*/
|
|
97
|
+
/**
|
|
98
|
+
* @typedef {Object} ZeyosLauncherOptions
|
|
99
|
+
* @property {boolean} [standardIcons=false] Use stock icon fallbacks instead of the optional ZeyOS kit.
|
|
100
|
+
* @property {Array<Record<string, any>>} [items] Extra generic Launcher items.
|
|
101
|
+
* @property {Array<Record<string, any>>} [sources] Extra generic Launcher sources.
|
|
102
|
+
*/
|
|
103
|
+
/**
|
|
104
|
+
* Builds a generic Launcher configuration from explicitly injected ZeyOS shell state. It never
|
|
105
|
+
* reads PG/C globals and never resolves a route itself.
|
|
106
|
+
* @param {ZeyosLauncherState} [state={}] Application-owned shell state.
|
|
107
|
+
* @param {ZeyosLauncherOptions & Record<string, any>} [options={}] Adapter and Launcher options.
|
|
108
|
+
* @returns {Record<string, any>} Plain Launcher options.
|
|
109
|
+
*/
|
|
110
|
+
export declare function buildZeyosLauncherConfig(state?: ZeyosLauncherState, options?: ZeyosLauncherOptions & Record<string, any>): Record<string, any>;
|
|
111
|
+
/**
|
|
112
|
+
* Creates the ZeyOS-configured Launcher. State and route resolvers remain caller-owned inputs.
|
|
113
|
+
* @param {ZeyosLauncherState} [state={}] Injected shell state.
|
|
114
|
+
* @param {ZeyosLauncherOptions & Record<string, any>} [options={}] Adapter and Launcher options.
|
|
115
|
+
* @returns {Launcher}
|
|
116
|
+
*/
|
|
117
|
+
export declare function zeyosLauncher(state?: ZeyosLauncherState, options?: ZeyosLauncherOptions & Record<string, any>): Launcher;
|
|
118
|
+
/**
|
|
119
|
+
* Normalizes module, fork, and weblet applications while preserving menu authority and pin order.
|
|
120
|
+
* @param {ZeyosLauncherState} [state={}] Injected shell state.
|
|
121
|
+
* @param {{standardIcons?: boolean, renderApplicationIcon?: Function, renderWebletIcon?: Function}} [options={}] Icon options.
|
|
122
|
+
* @returns {Array<Record<string, any>>}
|
|
123
|
+
*/
|
|
124
|
+
export declare function normalizeZeyosLauncherApplications(state?: ZeyosLauncherState, options?: {
|
|
125
|
+
standardIcons?: boolean;
|
|
126
|
+
renderApplicationIcon?: Function;
|
|
127
|
+
renderWebletIcon?: Function;
|
|
128
|
+
}): Array<Record<string, any>>;
|
|
129
|
+
/**
|
|
130
|
+
* Normalizes recent records or grouped search payloads without losing server/group order.
|
|
131
|
+
* @param {unknown} payload Recent/search payload.
|
|
132
|
+
* @param {{query?: string, labels?: Record<string, any>, resolveRecord?: Function, renderRecordIcon?: Function, standardIcons?: boolean}} [options={}] Mapping options.
|
|
133
|
+
* @returns {Array<Record<string, any>>}
|
|
134
|
+
*/
|
|
135
|
+
export declare function normalizeZeyosLauncherRecords(payload: unknown, options?: {
|
|
136
|
+
query?: string;
|
|
137
|
+
labels?: Record<string, any>;
|
|
138
|
+
resolveRecord?: Function;
|
|
139
|
+
renderRecordIcon?: Function;
|
|
140
|
+
standardIcons?: boolean;
|
|
141
|
+
}): Array<Record<string, any>>;
|
|
142
|
+
/** @param {{module?: string, fork?: unknown, weblet?: unknown}} state @returns {string} */
|
|
143
|
+
export declare function zeyosActiveIdentifier(state?: {
|
|
144
|
+
module?: string;
|
|
145
|
+
fork?: unknown;
|
|
146
|
+
weblet?: unknown;
|
|
147
|
+
}): string;
|
|
@@ -156,6 +156,45 @@ export declare function buildZeyosSelectConfig(client: Record<string, any>, reso
|
|
|
156
156
|
export declare function zeyosSelect(client: Record<string, any>, resource: string, opts?: ZeyosSelectOptions): Select & {
|
|
157
157
|
ready: Promise<Select>;
|
|
158
158
|
};
|
|
159
|
+
/**
|
|
160
|
+
* Builds the rich, resource-specific Entity-box preset over the generic injected Select binding.
|
|
161
|
+
* It adds module-colored icons, optional subtitles/groups, a fixed clear row, and an optional
|
|
162
|
+
* application-owned create command without changing the selected ID contract.
|
|
163
|
+
* @param {Record<string, any>} client Injected ZeyOS client instance.
|
|
164
|
+
* @param {string} resource Resource such as `projects` or `accounts`.
|
|
165
|
+
* @param {ZeyosSelectOptions & {
|
|
166
|
+
* subtitleKey?: string|((item: Record<string, unknown>) => unknown)|null,
|
|
167
|
+
* moduleKey?: string|((item: Record<string, unknown>) => unknown),
|
|
168
|
+
* none?: boolean|string,
|
|
169
|
+
* create?: boolean|{id?: string|number, label?: string, group?: string, icon?: string|Node, oninvoke?: Function},
|
|
170
|
+
* renderIcon?: ((item: Record<string, unknown>, context: Record<string, unknown>) => Node|null)|null
|
|
171
|
+
* }} [opts={}] Entity presentation, query, and Select options.
|
|
172
|
+
* @returns {Record<string, any>} Plain Select options.
|
|
173
|
+
*/
|
|
174
|
+
export declare function buildZeyosEntitySelectConfig(client: Record<string, any>, resource: string, opts?: ZeyosSelectOptions & {
|
|
175
|
+
subtitleKey?: string | ((item: Record<string, unknown>) => unknown) | null;
|
|
176
|
+
moduleKey?: string | ((item: Record<string, unknown>) => unknown);
|
|
177
|
+
none?: boolean | string;
|
|
178
|
+
create?: boolean | {
|
|
179
|
+
id?: string | number;
|
|
180
|
+
label?: string;
|
|
181
|
+
group?: string;
|
|
182
|
+
icon?: string | Node;
|
|
183
|
+
oninvoke?: Function;
|
|
184
|
+
};
|
|
185
|
+
renderIcon?: ((item: Record<string, unknown>, context: Record<string, unknown>) => Node | null) | null;
|
|
186
|
+
}): Record<string, any>;
|
|
187
|
+
/**
|
|
188
|
+
* Creates a ZeyOS Entity-box preset. Await `select.ready` when a non-null initial ID must be
|
|
189
|
+
* hydrated before presentation.
|
|
190
|
+
* @param {Record<string, any>} client Injected ZeyOS client instance.
|
|
191
|
+
* @param {string} resource Resource name.
|
|
192
|
+
* @param {Record<string, any>} [opts={}] Entity Select options.
|
|
193
|
+
* @returns {Select & {ready: Promise<Select>}}
|
|
194
|
+
*/
|
|
195
|
+
export declare function zeyosEntitySelect(client: Record<string, any>, resource: string, opts?: Record<string, any>): Select & {
|
|
196
|
+
ready: Promise<Select>;
|
|
197
|
+
};
|
|
159
198
|
/**
|
|
160
199
|
* Normalizes list output without importing the client package. If the injected client exposes its
|
|
161
200
|
* own `normalizeListResult`, that implementation wins; otherwise arrays and `.data` are handled
|