@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.
Files changed (88) hide show
  1. package/CHANGELOG.md +51 -0
  2. package/DESIGN-SYSTEM.md +28 -68
  3. package/README.md +16 -37
  4. package/dist/types/components/app-sidebar/app-sidebar.d.ts +106 -32
  5. package/dist/types/components/card/card.d.ts +128 -0
  6. package/dist/types/components/chart/chart.d.ts +1 -0
  7. package/dist/types/components/launcher/launcher.d.ts +65 -6
  8. package/dist/types/components/select/select.d.ts +51 -0
  9. package/dist/types/components/table/table.d.ts +4 -3
  10. package/dist/types/core/dom.d.ts +8 -0
  11. package/dist/types/index.d.ts +2 -1
  12. package/dist/types/{components/app-rail → internal}/app-rail.d.ts +34 -19
  13. package/dist/types/zeyos/icons.d.ts +5 -0
  14. package/dist/types/zeyos/index.d.ts +2 -1
  15. package/dist/types/zeyos/launcher.d.ts +147 -0
  16. package/dist/types/zeyos/select.d.ts +39 -0
  17. package/dist/zx-zeyos.esm.js +1324 -46
  18. package/dist/zx-zeyos.esm.min.js +1 -1
  19. package/dist/zx.css +400 -12
  20. package/dist/zx.esm.js +1059 -189
  21. package/dist/zx.esm.min.js +3 -3
  22. package/dist/zx.global.js +1059 -189
  23. package/dist/zx.global.min.js +3 -3
  24. package/dist/zx.min.css +1 -1
  25. package/docs/api.json +258 -145
  26. package/docs/llms.md +93 -112
  27. package/docs/llms.txt +16 -15
  28. package/package.json +8 -17
  29. package/src/components/app-sidebar/app-sidebar.css +12 -0
  30. package/src/components/app-sidebar/app-sidebar.js +310 -110
  31. package/src/components/card/card.css +149 -0
  32. package/src/components/card/card.js +285 -0
  33. package/src/components/chart/chart.js +8 -3
  34. package/src/components/grid/grid.js +10 -3
  35. package/src/components/launcher/launcher.css +113 -3
  36. package/src/components/launcher/launcher.js +234 -26
  37. package/src/components/select/field-adapter.js +9 -4
  38. package/src/components/select/select.css +144 -10
  39. package/src/components/select/select.js +259 -27
  40. package/src/components/table/table.js +8 -7
  41. package/src/core/dom.js +20 -0
  42. package/src/index.js +2 -1
  43. package/src/{components/app-rail → internal}/app-rail.js +80 -30
  44. package/src/zeyos/icons.js +8 -3
  45. package/src/zeyos/index.js +7 -1
  46. package/src/zeyos/launcher.js +338 -0
  47. package/src/zeyos/modules.js +1 -0
  48. package/src/zeyos/select.js +115 -1
  49. package/styles/tokens/global.css +1 -1
  50. package/styles/tokens/modules.css +1 -0
  51. package/styles/zx.css +1 -0
  52. package/MIGRATION.md +0 -749
  53. package/dist/types/compat/base.d.ts +0 -156
  54. package/dist/types/compat/globals.d.ts +0 -20
  55. package/dist/types/compat/index.d.ts +0 -128
  56. package/dist/types/compat/map/basic.d.ts +0 -175
  57. package/dist/types/compat/map/data.d.ts +0 -103
  58. package/dist/types/compat/map/date-time.d.ts +0 -80
  59. package/dist/types/compat/map/factory.d.ts +0 -9
  60. package/dist/types/compat/map/form.d.ts +0 -98
  61. package/dist/types/compat/map/helpers.d.ts +0 -12
  62. package/dist/types/compat/map/http.d.ts +0 -36
  63. package/dist/types/compat/map/layout.d.ts +0 -106
  64. package/dist/types/compat/map/options.d.ts +0 -80
  65. package/dist/types/compat/map/select.d.ts +0 -95
  66. package/dist/types/compat/map/stubs.d.ts +0 -32
  67. package/dist/types/compat/map/utilities.d.ts +0 -37
  68. package/dist/types/compat-entry.d.ts +0 -5
  69. package/dist/zx-compat.esm.js +0 -17848
  70. package/dist/zx-compat.esm.min.js +0 -1
  71. package/dist/zx-compat.global.js +0 -29008
  72. package/dist/zx-compat.global.min.js +0 -3
  73. package/src/compat/base.js +0 -291
  74. package/src/compat/globals.js +0 -167
  75. package/src/compat/index.js +0 -84
  76. package/src/compat/map/basic.js +0 -464
  77. package/src/compat/map/data.js +0 -254
  78. package/src/compat/map/date-time.js +0 -177
  79. package/src/compat/map/factory.js +0 -45
  80. package/src/compat/map/form.js +0 -330
  81. package/src/compat/map/helpers.js +0 -46
  82. package/src/compat/map/http.js +0 -117
  83. package/src/compat/map/layout.js +0 -256
  84. package/src/compat/map/options.js +0 -267
  85. package/src/compat/map/select.js +0 -198
  86. package/src/compat/map/stubs.js +0 -26
  87. package/src/compat/map/utilities.js +0 -113
  88. 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