@judo/model-api 0.30.0 → 0.31.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/index.js +31 -29
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -1,32 +1,33 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/enums.ts
|
|
2
|
+
var e = {
|
|
2
3
|
HORIZONTAL: "HORIZONTAL",
|
|
3
4
|
VERTICAL: "VERTICAL"
|
|
4
|
-
},
|
|
5
|
+
}, t = {
|
|
5
6
|
NONE: "NONE",
|
|
6
7
|
LOOSE: "LOOSE",
|
|
7
8
|
TIGHT: "TIGHT"
|
|
8
|
-
},
|
|
9
|
+
}, n = {
|
|
9
10
|
NONE: "NONE",
|
|
10
11
|
HORIZONTAL: "HORIZONTAL",
|
|
11
12
|
VERTICAL: "VERTICAL",
|
|
12
13
|
BOTH: "BOTH"
|
|
13
|
-
},
|
|
14
|
+
}, r = {
|
|
14
15
|
CENTER: "CENTER",
|
|
15
16
|
END: "END",
|
|
16
17
|
SPACEAROUND: "SPACEAROUND",
|
|
17
18
|
SPACEBETWEEN: "SPACEBETWEEN",
|
|
18
19
|
SPACEEVENLY: "SPACEEVENLY",
|
|
19
20
|
START: "START"
|
|
20
|
-
},
|
|
21
|
+
}, i = {
|
|
21
22
|
BASELINE: "BASELINE",
|
|
22
23
|
CENTER: "CENTER",
|
|
23
24
|
END: "END",
|
|
24
25
|
START: "START",
|
|
25
26
|
STRETCH: "STRETCH"
|
|
26
|
-
},
|
|
27
|
+
}, a = {
|
|
27
28
|
MIN: "MIN",
|
|
28
29
|
MAX: "MAX"
|
|
29
|
-
},
|
|
30
|
+
}, o = {
|
|
30
31
|
TOP_LEFT: "TOP_LEFT",
|
|
31
32
|
TOP_CENTER: "TOP_CENTER",
|
|
32
33
|
TOP_RIGHT: "TOP_RIGHT",
|
|
@@ -36,29 +37,29 @@ const Axis = {
|
|
|
36
37
|
BOTTOM_LEFT: "BOTTOM_LEFT",
|
|
37
38
|
BOTTOM_CENTER: "BOTTOM_CENTER",
|
|
38
39
|
BOTTOM_RIGHT: "BOTTOM_RIGHT"
|
|
39
|
-
},
|
|
40
|
+
}, s = {
|
|
40
41
|
XS: "XS",
|
|
41
42
|
SM: "SM",
|
|
42
43
|
MD: "MD",
|
|
43
44
|
LG: "LG",
|
|
44
45
|
XL: "XL"
|
|
45
|
-
},
|
|
46
|
+
}, c = {
|
|
46
47
|
TABLE: "TABLE",
|
|
47
48
|
FORM: "FORM",
|
|
48
49
|
VIEW: "VIEW"
|
|
49
|
-
},
|
|
50
|
+
}, l = {
|
|
50
51
|
CONTAINED: "contained",
|
|
51
52
|
TEXT: "text",
|
|
52
53
|
OUTLINED: "outlined"
|
|
53
|
-
},
|
|
54
|
+
}, u = {
|
|
54
55
|
NONE: "NONE",
|
|
55
56
|
CONDITIONAL: "CONDITIONAL",
|
|
56
57
|
MANDATORY: "MANDATORY"
|
|
57
|
-
},
|
|
58
|
+
}, d = {
|
|
58
59
|
NONE: "NONE",
|
|
59
60
|
ASC: "ASC",
|
|
60
61
|
DESC: "DESC"
|
|
61
|
-
},
|
|
62
|
+
}, f = {
|
|
62
63
|
EQUAL: "EQUAL",
|
|
63
64
|
NOT_EQUAL: "NOT_EQUAL",
|
|
64
65
|
IS_EMPTY: "IS_EMPTY",
|
|
@@ -68,21 +69,21 @@ const Axis = {
|
|
|
68
69
|
GREATER: "GREATER",
|
|
69
70
|
GREATER_OR_EQUAL: "GREATER_OR_EQUAL",
|
|
70
71
|
LIKE: "LIKE"
|
|
71
|
-
},
|
|
72
|
+
}, p = {
|
|
72
73
|
AUTO: "AUTO",
|
|
73
74
|
ENABLED: "ENABLED",
|
|
74
75
|
DISABLED: "DISABLED"
|
|
75
|
-
},
|
|
76
|
+
}, m = {
|
|
76
77
|
TABLE: "TABLE",
|
|
77
78
|
TAG: "TAG",
|
|
78
79
|
CARD: "CARD"
|
|
79
|
-
},
|
|
80
|
+
}, h = {
|
|
80
81
|
VERTICAL: "VERTICAL",
|
|
81
82
|
HORIZONTAL: "HORIZONTAL"
|
|
82
|
-
},
|
|
83
|
+
}, g = {
|
|
83
84
|
HORIZONTAL: "HORIZONTAL",
|
|
84
85
|
VERTICAL: "VERTICAL"
|
|
85
|
-
},
|
|
86
|
+
}, _ = {
|
|
86
87
|
NANOSECOND: "NANOSECOND",
|
|
87
88
|
MICROSECOND: "MICROSECOND",
|
|
88
89
|
MILLISECOND: "MILLISECOND",
|
|
@@ -93,31 +94,31 @@ const Axis = {
|
|
|
93
94
|
WEEK: "WEEK",
|
|
94
95
|
MONTH: "MONTH",
|
|
95
96
|
YEAR: "YEAR"
|
|
96
|
-
},
|
|
97
|
+
}, v = {
|
|
97
98
|
TOP: "TOP",
|
|
98
99
|
BOTTOM: "BOTTOM",
|
|
99
100
|
START: "START",
|
|
100
101
|
END: "END",
|
|
101
102
|
DEFAULT: "DEFAULT"
|
|
102
|
-
},
|
|
103
|
+
}, y = {
|
|
103
104
|
LABEL: "LABEL",
|
|
104
105
|
ATTRIBUTE: "ATTRIBUTE"
|
|
105
|
-
},
|
|
106
|
+
}, b = {
|
|
106
107
|
UNDEFINED: "UNDEFINED",
|
|
107
108
|
EMAIL: "EMAIL",
|
|
108
109
|
USERNAME: "USERNAME"
|
|
109
|
-
},
|
|
110
|
+
}, x = {
|
|
110
111
|
ASSOCIATION: "ASSOCIATION",
|
|
111
112
|
COMPOSITION: "COMPOSITION",
|
|
112
113
|
AGGREGATION: "AGGREGATION",
|
|
113
114
|
STATIC: "STATIC"
|
|
114
|
-
},
|
|
115
|
+
}, S = {
|
|
115
116
|
STORED: "STORED",
|
|
116
117
|
DERIVED: "DERIVED",
|
|
117
118
|
MAPPED: "MAPPED",
|
|
118
119
|
TRANSIENT: "TRANSIENT",
|
|
119
120
|
ACCESS: "ACCESS"
|
|
120
|
-
},
|
|
121
|
+
}, C = {
|
|
121
122
|
LIST: "LIST",
|
|
122
123
|
CREATE: "CREATE",
|
|
123
124
|
SET: "SET",
|
|
@@ -132,19 +133,20 @@ const Axis = {
|
|
|
132
133
|
DELETE: "DELETE",
|
|
133
134
|
REFRESH: "REFRESH",
|
|
134
135
|
EXPORT: "EXPORT"
|
|
135
|
-
},
|
|
136
|
+
}, w = {
|
|
136
137
|
REFRESH: "REFRESH",
|
|
137
138
|
UPDATE: "UPDATE",
|
|
138
139
|
VALIDATE_UPDATE: "VALIDATE_UPDATE",
|
|
139
140
|
DELETE: "DELETE",
|
|
140
141
|
TEMPLATE: "TEMPLATE"
|
|
141
|
-
},
|
|
142
|
+
}, T = {
|
|
142
143
|
MAPPED: "MAPPED",
|
|
143
144
|
STATIC: "STATIC"
|
|
144
|
-
},
|
|
145
|
+
}, E = {
|
|
145
146
|
REFRESH: "REFRESH",
|
|
146
147
|
UPDATE: "UPDATE",
|
|
147
148
|
DELETE: "DELETE",
|
|
148
149
|
VALIDATE_INPUT: "VALIDATE_INPUT"
|
|
149
|
-
},
|
|
150
|
-
|
|
150
|
+
}, D = Symbol.for("@judo/MODEL_LOADER_SERVICE"), O = Symbol.for("@judo/MODEL_REGISTRY_SERVICE"), k = Symbol.for("@judo/NAVIGATION_BADGE_SERVICE"), A = Symbol.for("@judo/THEME_SERVICE"), j = Symbol.for("@judo/ACTION_HANDLER_FACTORY"), M = Symbol.for("@judo/COMPONENT_OVERRIDE"), N = Symbol.for("@judo/COMPONENT_OVERRIDE_SERVICE"), P = Symbol.for("@judo/NOTIFICATION_SERVICE"), F = Symbol.for("@judo/DIALOG_SERVICE"), I = Symbol.for("@judo/UNSAVED_CHANGES_GUARD"), L = Symbol.for("@judo/SESSION_TIMEOUT_GUARD"), R = Symbol.for("@judo/LOADING_SERVICE"), z = Symbol.for("@judo/I18N_SERVICE");
|
|
151
|
+
//#endregion
|
|
152
|
+
export { j as ACTION_HANDLER_FACTORY, o as Alignment, e as Axis, l as ButtonStyle, M as COMPONENT_OVERRIDE, N as COMPONENT_OVERRIDE_SERVICE, p as CheckboxSelection, b as ClaimType, w as ClassBehaviourType, u as ConfirmationType, i as CrossAxisAlignment, F as DIALOG_SERVICE, s as DialogSize, _ as DurationUnit, f as FilterOperationType, t as Fit, z as I18N_SERVICE, R as LOADING_SERVICE, D as MODEL_LOADER_SERVICE, O as MODEL_REGISTRY_SERVICE, r as MainAxisAlignment, a as MainAxisSize, S as MemberType, h as MenuLayout, k as NAVIGATION_BADGE_SERVICE, P as NOTIFICATION_SERVICE, E as OperationTargetBehaviourType, T as OperationTypeEnum, c as PageContainerType, v as Placement, C as RelationBehaviourType, x as RelationKind, L as SESSION_TIMEOUT_GUARD, d as Sort, n as Stretch, A as THEME_SERVICE, g as TabOrientation, m as TableRepresentation, y as TitleFrom, I as UNSAVED_CHANGES_GUARD };
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"sources":["../src/enums.ts","../src/services.ts"],"sourcesContent":["// ============================================\n// LAYOUT ENUMS\n// ============================================\n// Using `as const` objects instead of TypeScript enums for better tree-shaking.\n// Rolldown/Rollup can eliminate unused const objects but cannot tree-shake enum IIFEs.\n// See: specs/HMR.md — Standard VII: Elimination of TypeScript Enums\n\nexport const Axis = {\n\tHORIZONTAL: \"HORIZONTAL\",\n\tVERTICAL: \"VERTICAL\",\n} as const;\nexport type Axis = (typeof Axis)[keyof typeof Axis];\n\nexport const Fit = {\n\tNONE: \"NONE\",\n\tLOOSE: \"LOOSE\",\n\tTIGHT: \"TIGHT\",\n} as const;\nexport type Fit = (typeof Fit)[keyof typeof Fit];\n\nexport const Stretch = {\n\tNONE: \"NONE\",\n\tHORIZONTAL: \"HORIZONTAL\",\n\tVERTICAL: \"VERTICAL\",\n\tBOTH: \"BOTH\",\n} as const;\nexport type Stretch = (typeof Stretch)[keyof typeof Stretch];\n\nexport const MainAxisAlignment = {\n\tCENTER: \"CENTER\",\n\tEND: \"END\",\n\tSPACEAROUND: \"SPACEAROUND\",\n\tSPACEBETWEEN: \"SPACEBETWEEN\",\n\tSPACEEVENLY: \"SPACEEVENLY\",\n\tSTART: \"START\",\n} as const;\nexport type MainAxisAlignment = (typeof MainAxisAlignment)[keyof typeof MainAxisAlignment];\n\nexport const CrossAxisAlignment = {\n\tBASELINE: \"BASELINE\",\n\tCENTER: \"CENTER\",\n\tEND: \"END\",\n\tSTART: \"START\",\n\tSTRETCH: \"STRETCH\",\n} as const;\nexport type CrossAxisAlignment = (typeof CrossAxisAlignment)[keyof typeof CrossAxisAlignment];\n\nexport const MainAxisSize = {\n\tMIN: \"MIN\",\n\tMAX: \"MAX\",\n} as const;\nexport type MainAxisSize = (typeof MainAxisSize)[keyof typeof MainAxisSize];\n\nexport const Alignment = {\n\tTOP_LEFT: \"TOP_LEFT\",\n\tTOP_CENTER: \"TOP_CENTER\",\n\tTOP_RIGHT: \"TOP_RIGHT\",\n\tCENTER_LEFT: \"CENTER_LEFT\",\n\tCENTER: \"CENTER\",\n\tCENTER_RIGHT: \"CENTER_RIGHT\",\n\tBOTTOM_LEFT: \"BOTTOM_LEFT\",\n\tBOTTOM_CENTER: \"BOTTOM_CENTER\",\n\tBOTTOM_RIGHT: \"BOTTOM_RIGHT\",\n} as const;\nexport type Alignment = (typeof Alignment)[keyof typeof Alignment];\n\n// ============================================\n// UI ENUMS\n// ============================================\n\nexport const DialogSize = {\n\tXS: \"XS\",\n\tSM: \"SM\",\n\tMD: \"MD\",\n\tLG: \"LG\",\n\tXL: \"XL\",\n} as const;\nexport type DialogSize = (typeof DialogSize)[keyof typeof DialogSize];\n\nexport const PageContainerType = {\n\tTABLE: \"TABLE\",\n\tFORM: \"FORM\",\n\tVIEW: \"VIEW\",\n} as const;\nexport type PageContainerType = (typeof PageContainerType)[keyof typeof PageContainerType];\n\nexport const ButtonStyle = {\n\tCONTAINED: \"contained\",\n\tTEXT: \"text\",\n\tOUTLINED: \"outlined\",\n} as const;\nexport type ButtonStyle = (typeof ButtonStyle)[keyof typeof ButtonStyle];\n\nexport const ConfirmationType = {\n\tNONE: \"NONE\",\n\tCONDITIONAL: \"CONDITIONAL\",\n\tMANDATORY: \"MANDATORY\",\n} as const;\nexport type ConfirmationType = (typeof ConfirmationType)[keyof typeof ConfirmationType];\n\nexport const Sort = {\n\tNONE: \"NONE\",\n\tASC: \"ASC\",\n\tDESC: \"DESC\",\n} as const;\nexport type Sort = (typeof Sort)[keyof typeof Sort];\n\nexport const FilterOperationType = {\n\tEQUAL: \"EQUAL\",\n\tNOT_EQUAL: \"NOT_EQUAL\",\n\tIS_EMPTY: \"IS_EMPTY\",\n\tIS_NOT_EMPTY: \"IS_NOT_EMPTY\",\n\tLESS: \"LESS\",\n\tLESS_OR_EQUAL: \"LESS_OR_EQUAL\",\n\tGREATER: \"GREATER\",\n\tGREATER_OR_EQUAL: \"GREATER_OR_EQUAL\",\n\tLIKE: \"LIKE\",\n} as const;\nexport type FilterOperationType = (typeof FilterOperationType)[keyof typeof FilterOperationType];\n\nexport const CheckboxSelection = {\n\tAUTO: \"AUTO\",\n\tENABLED: \"ENABLED\",\n\tDISABLED: \"DISABLED\",\n} as const;\nexport type CheckboxSelection = (typeof CheckboxSelection)[keyof typeof CheckboxSelection];\n\nexport const TableRepresentation = {\n\tTABLE: \"TABLE\",\n\tTAG: \"TAG\",\n\tCARD: \"CARD\",\n} as const;\nexport type TableRepresentation = (typeof TableRepresentation)[keyof typeof TableRepresentation];\n\nexport const MenuLayout = {\n\tVERTICAL: \"VERTICAL\",\n\tHORIZONTAL: \"HORIZONTAL\",\n} as const;\nexport type MenuLayout = (typeof MenuLayout)[keyof typeof MenuLayout];\n\nexport const TabOrientation = {\n\tHORIZONTAL: \"HORIZONTAL\",\n\tVERTICAL: \"VERTICAL\",\n} as const;\nexport type TabOrientation = (typeof TabOrientation)[keyof typeof TabOrientation];\n\nexport const DurationUnit = {\n\tNANOSECOND: \"NANOSECOND\",\n\tMICROSECOND: \"MICROSECOND\",\n\tMILLISECOND: \"MILLISECOND\",\n\tSECOND: \"SECOND\",\n\tMINUTE: \"MINUTE\",\n\tHOUR: \"HOUR\",\n\tDAY: \"DAY\",\n\tWEEK: \"WEEK\",\n\tMONTH: \"MONTH\",\n\tYEAR: \"YEAR\",\n} as const;\nexport type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit];\n\nexport const Placement = {\n\tTOP: \"TOP\",\n\tBOTTOM: \"BOTTOM\",\n\tSTART: \"START\",\n\tEND: \"END\",\n\tDEFAULT: \"DEFAULT\",\n} as const;\nexport type Placement = (typeof Placement)[keyof typeof Placement];\n\nexport const TitleFrom = {\n\tLABEL: \"LABEL\",\n\tATTRIBUTE: \"ATTRIBUTE\",\n} as const;\nexport type TitleFrom = (typeof TitleFrom)[keyof typeof TitleFrom];\n\nexport const ClaimType = {\n\tUNDEFINED: \"UNDEFINED\",\n\tEMAIL: \"EMAIL\",\n\tUSERNAME: \"USERNAME\",\n} as const;\nexport type ClaimType = (typeof ClaimType)[keyof typeof ClaimType];\n\n// ============================================\n// DATA ENUMS\n// ============================================\n\nexport const RelationKind = {\n\tASSOCIATION: \"ASSOCIATION\",\n\tCOMPOSITION: \"COMPOSITION\",\n\tAGGREGATION: \"AGGREGATION\",\n\tSTATIC: \"STATIC\",\n} as const;\nexport type RelationKind = (typeof RelationKind)[keyof typeof RelationKind];\n\nexport const MemberType = {\n\tSTORED: \"STORED\",\n\tDERIVED: \"DERIVED\",\n\tMAPPED: \"MAPPED\",\n\tTRANSIENT: \"TRANSIENT\",\n\tACCESS: \"ACCESS\",\n} as const;\nexport type MemberType = (typeof MemberType)[keyof typeof MemberType];\n\nexport const RelationBehaviourType = {\n\tLIST: \"LIST\",\n\tCREATE: \"CREATE\",\n\tSET: \"SET\",\n\tUNSET: \"UNSET\",\n\tADD: \"ADD\",\n\tREMOVE: \"REMOVE\",\n\tRANGE: \"RANGE\",\n\tVALIDATE_CREATE: \"VALIDATE_CREATE\",\n\tTEMPLATE: \"TEMPLATE\",\n\tUPDATE: \"UPDATE\",\n\tVALIDATE_UPDATE: \"VALIDATE_UPDATE\",\n\tDELETE: \"DELETE\",\n\tREFRESH: \"REFRESH\",\n\tEXPORT: \"EXPORT\",\n} as const;\nexport type RelationBehaviourType = (typeof RelationBehaviourType)[keyof typeof RelationBehaviourType];\n\nexport const ClassBehaviourType = {\n\tREFRESH: \"REFRESH\",\n\tUPDATE: \"UPDATE\",\n\tVALIDATE_UPDATE: \"VALIDATE_UPDATE\",\n\tDELETE: \"DELETE\",\n\tTEMPLATE: \"TEMPLATE\",\n} as const;\nexport type ClassBehaviourType = (typeof ClassBehaviourType)[keyof typeof ClassBehaviourType];\n\nexport const OperationTypeEnum = {\n\tMAPPED: \"MAPPED\",\n\tSTATIC: \"STATIC\",\n} as const;\nexport type OperationTypeEnum = (typeof OperationTypeEnum)[keyof typeof OperationTypeEnum];\n\nexport const OperationTargetBehaviourType = {\n\tREFRESH: \"REFRESH\",\n\tUPDATE: \"UPDATE\",\n\tDELETE: \"DELETE\",\n\tVALIDATE_INPUT: \"VALIDATE_INPUT\",\n} as const;\nexport type OperationTargetBehaviourType =\n\t(typeof OperationTargetBehaviourType)[keyof typeof OperationTargetBehaviourType];\n","import type { ComponentType } from \"react\";\nimport type { AttributeType, ClassType, DataType, OperationType, RelationType } from \"./data/elements\";\nimport type { PageContainerType } from \"./enums\";\nimport type { ActionDefinition } from \"./structural/actions\";\nimport type { Action, Application, NavigationItem, PageDefinition } from \"./structural/application\";\nimport type { PageContainer, VisualElement } from \"./visual/layout\";\n\n// ============================================\n// CORE SERVICES\n// ============================================\nexport const MODEL_LOADER_SERVICE = Symbol.for(\"@judo/MODEL_LOADER_SERVICE\");\nexport const MODEL_REGISTRY_SERVICE = Symbol.for(\"@judo/MODEL_REGISTRY_SERVICE\");\nexport const NAVIGATION_BADGE_SERVICE = Symbol.for(\"@judo/NAVIGATION_BADGE_SERVICE\");\nexport const THEME_SERVICE = Symbol.for(\"@judo/THEME_SERVICE\");\n\n// ============================================\n// HOOK FACTORY SERVICES (React hooks compatible)\n// ============================================\n\n/**\n * @internal Framework service token for action handler hook factories.\n * Built-in handlers are registered by actionType.\n * Developers override actions via the type-safe `createCustomizations()` factory.\n */\nexport const ACTION_HANDLER_FACTORY = Symbol.for(\"@judo/ACTION_HANDLER_FACTORY\");\n\n/**\n * @internal Framework service token for component overrides.\n * Developers register components via the type-safe `createCustomizations()` factory.\n * Framework INJECTS the VisualElement as `element` prop.\n */\nexport const COMPONENT_OVERRIDE = Symbol.for(\"@judo/COMPONENT_OVERRIDE\");\n\n/**\n * @internal Framework service token for the component override manager.\n * Used internally by `useComponentOverride` hook.\n */\nexport const COMPONENT_OVERRIDE_SERVICE = Symbol.for(\"@judo/COMPONENT_OVERRIDE_SERVICE\");\n\n// ============================================\n// ENTERPRISE SERVICES\n// ============================================\nexport const NOTIFICATION_SERVICE = Symbol.for(\"@judo/NOTIFICATION_SERVICE\");\nexport const DIALOG_SERVICE = Symbol.for(\"@judo/DIALOG_SERVICE\");\nexport const UNSAVED_CHANGES_GUARD = Symbol.for(\"@judo/UNSAVED_CHANGES_GUARD\");\nexport const SESSION_TIMEOUT_GUARD = Symbol.for(\"@judo/SESSION_TIMEOUT_GUARD\");\nexport const LOADING_SERVICE = Symbol.for(\"@judo/LOADING_SERVICE\");\nexport const I18N_SERVICE = Symbol.for(\"@judo/I18N_SERVICE\");\n\n// ============================================\n// ACTION HANDLER FACTORY TYPES\n// ============================================\n\n/**\n * Runtime context passed to action handlers when action triggers.\n */\nexport interface ActionHandlerContext {\n\t/** The transfer being acted upon */\n\ttransfer?: unknown;\n\t/** Selected rows for bulk/table operations */\n\tselectedRows?: unknown[];\n\t/** Dialog closer if action is in a dialog */\n\tcloseDialog?: () => void;\n\t/** Navigation context for page transitions */\n\tnavigation?: unknown;\n\t/** Data store for transfer operations */\n\tdata?: unknown;\n\t/** Model registry for lookups */\n\tregistry?: ModelRegistryService;\n}\n\n/**\n * Action handler hook factory type.\n * Framework INJECTS the Action model element when calling your handler.\n *\n * @param action - The Action model element (injected by framework)\n * @returns Handler function to execute when action triggers\n *\n * @example\n * ```typescript\n * function useMyHandler(action: Action) {\n * const { showSuccess } = useNotification();\n * const operation = action.actionDefinition.operation;\n *\n * return async (ctx: ActionHandlerContext) => {\n * console.log(`Handling ${action.name}:`, ctx.transfer);\n * showSuccess('Done!');\n * };\n * }\n * ```\n */\nexport type ActionHandlerHook = (action: Action) => ActionHandlerFn;\n\n/**\n * Handler function called when the action is triggered.\n */\nexport type ActionHandlerFn = (context: ActionHandlerContext) => Promise<unknown>;\n\n/**\n * @internal Framework-internal service properties for action handler registration.\n *\n * **Do not use directly.** Developers should use the generated `createCustomizations()`\n * factory with human-readable page and action names instead.\n *\n * @see {@link CustomizationsConfig} for the runtime format (also internal)\n */\nexport interface ActionHandlerFactoryProperties {\n\t/** @internal The action's xmi:id — resolved automatically by the factory */\n\tsourceId: string;\n}\n\n/**\n * Service properties for built-in action handler registration (internal).\n */\nexport interface BuiltInActionHandlerFactoryProperties {\n\t/** The action type this built-in handles (e.g., 'ui:DeleteActionDefinition') */\n\tactionType: string;\n\t/** Marker for built-in handlers */\n\tbuiltin: true;\n}\n\n// ============================================\n// COMPONENT OVERRIDE TYPES\n// ============================================\n\n/**\n * Type for a component that can be used as an override.\n * Framework INJECTS the VisualElement as the `element` prop.\n *\n * @example\n * ```typescript\n * const MyTableComponent: OverrideComponent<Table> = ({ element }) => {\n * return <DefaultTable element={element} />;\n * };\n * ```\n */\nexport type OverrideComponent<T extends VisualElement = VisualElement> = ComponentType<\n\t{ element: T } & Record<string, unknown>\n>;\n\n/**\n * @internal Framework-internal component override registration object.\n *\n * **Do not use directly.** Developers should register component overrides via\n * the generated `createCustomizations()` factory using human-readable names:\n *\n * @example\n * ```typescript\n * // Use the generated type-safe factory:\n * createCustomizations({\n * components: {\n * OrderSummaryWidget: MyCustomComponent,\n * },\n * componentInterceptors: {\n * TextInput: (element, page) => isEmail(element) ? EmailInput : null,\n * },\n * });\n * ```\n */\nexport interface ComponentOverride {\n\t/** @internal Override a specific element — resolved automatically by the factory */\n\tsourceId?: string;\n\t/** Override all elements of this type (e.g., 'Table', 'TextInput') */\n\telementType?: string;\n\t/** Override all elements within a container type */\n\tcontainerType?: PageContainerType;\n\t/** The component to render instead of the default */\n\tcomponent: OverrideComponent;\n}\n\n/**\n * @internal Framework-internal service properties for component override registration.\n *\n * **Do not use directly.** Use the generated `createCustomizations()` factory\n * with `components` (by name) or `componentInterceptors` (by @type) instead.\n */\nexport interface ComponentOverrideProperties {\n\t/** @internal Element identity — resolved automatically by the factory */\n\tsourceId?: string;\n\t/** Override all elements of this type (e.g., 'Table', 'TextInput') */\n\telementType?: string;\n}\n\n/**\n * @internal Framework-internal service for managing component overrides at runtime.\n * Used internally by `useComponentOverride` hook.\n */\nexport interface ComponentOverrideService {\n\t/** Register a component override, returns unregister function */\n\tregister(override: ComponentOverride): () => void;\n\t/** Get override for element with priority: sourceId > elementType > containerType */\n\tgetOverride(element: VisualElement, containerType?: PageContainerType): OverrideComponent | null;\n\t/** Subscribe to override changes */\n\tsubscribe(callback: () => void): () => void;\n\t/** Get current snapshot of all registered overrides */\n\tgetSnapshot(): ComponentOverride[];\n}\n\n// ============================================\n// SERVICE INTERFACES\n// ============================================\n\nexport interface ModelLoaderService {\n\tload(source: string): Promise<Application[]>;\n}\n\nexport interface RegistrySnapshot {\n\tapplications: Application[];\n\tactiveApplication: Application | null;\n\tactiveActorName: string | null;\n}\n\nexport interface ModelRegistryService {\n\tregisterModel(apps: Application[]): void;\n\tgetApplications(): Application[];\n\tgetApplication(actorName: string): Application;\n\tgetActiveApplication(): Application;\n\tsetActiveApplication(actorName: string): void;\n\tresolveById<T = unknown>(id: string): T | undefined;\n\tresolveClassType(ref: string): ClassType | undefined;\n\tresolveRelationType(ref: string): RelationType | undefined;\n\tresolveAttributeType(ref: string): AttributeType | undefined;\n\tresolvePageDefinition(ref: string): PageDefinition | undefined;\n\tresolvePageContainer(ref: string): PageContainer | undefined;\n\tresolveVisualElement(id: string): VisualElement | undefined;\n\tresolveActionDefinition(ref: string): ActionDefinition | undefined;\n\tresolveDataType(ref: string): DataType | undefined;\n\tresolveOperationType(ref: string): OperationType | undefined;\n\tresolveNavigationItem(id: string): NavigationItem | undefined;\n\tsubscribe(callback: () => void): () => void;\n\tgetSnapshot(): RegistrySnapshot;\n}\n\nexport interface BadgeInfo {\n\tcount?: number;\n\tcolor?: \"primary\" | \"secondary\" | \"error\" | \"warning\" | \"info\" | \"success\";\n\tmax?: number;\n\tshowZero?: boolean;\n}\n\nexport interface NavigationBadgeService {\n\tgetBadge(itemId: string): BadgeInfo | null;\n\tsetBadge(itemId: string, badge: BadgeInfo | null): void;\n\tsubscribe(callback: () => void): () => void;\n\tgetSnapshot(): Map<string, BadgeInfo>;\n}\n\nexport interface ThemeConfig {\n\tmode: \"light\" | \"dark\";\n\t/** @deprecated Use muiThemeOptions.palette.primary instead */\n\tprimaryColor?: string;\n\t/** @deprecated Use muiThemeOptions.palette.secondary instead */\n\tsecondaryColor?: string;\n\t/**\n\t * MUI theme options to merge with defaults.\n\t * Provides full customization of Material-UI theme.\n\t */\n\tmuiThemeOptions?: Record<string, unknown>;\n\t/**\n\t * Whether the theme is using system preference.\n\t * When true, mode will automatically track OS/browser preference.\n\t */\n\tisSystemMode?: boolean;\n\t/**\n\t * Density level controlling semantic spacing and sizing.\n\t * - `compact` — tight spacing, smaller controls\n\t * - `comfortable` — default MUI sizing (no overrides)\n\t * - `standard` — generous spacing, larger touch targets\n\t */\n\tdensity?: \"compact\" | \"comfortable\" | \"standard\";\n\t/**\n\t * Named theme preset. When set, provides default primary/secondary colors\n\t * and background tints. Explicit `primaryColor`/`secondaryColor` override\n\t * the preset values.\n\t *\n\t * Built-in presets: 'corporate', 'ocean', 'slate', 'indigo', 'forest', 'royal'\n\t */\n\tpreset?: \"corporate\" | \"ocean\" | \"slate\" | \"indigo\" | \"forest\" | \"royal\" | (string & {});\n}\n\nexport interface ThemeService {\n\tgetTheme(): ThemeConfig;\n\tsetTheme(config: Partial<ThemeConfig>): void;\n\tsubscribe(callback: () => void): () => void;\n\tgetSnapshot(): ThemeConfig;\n}\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/enums.ts","../src/services.ts"],"sourcesContent":["// ============================================\n// LAYOUT ENUMS\n// ============================================\n// Using `as const` objects instead of TypeScript enums for better tree-shaking.\n// Rolldown/Rollup can eliminate unused const objects but cannot tree-shake enum IIFEs.\n// See: specs/HMR.md — Standard VII: Elimination of TypeScript Enums\n\nexport const Axis = {\n\tHORIZONTAL: \"HORIZONTAL\",\n\tVERTICAL: \"VERTICAL\",\n} as const;\nexport type Axis = (typeof Axis)[keyof typeof Axis];\n\nexport const Fit = {\n\tNONE: \"NONE\",\n\tLOOSE: \"LOOSE\",\n\tTIGHT: \"TIGHT\",\n} as const;\nexport type Fit = (typeof Fit)[keyof typeof Fit];\n\nexport const Stretch = {\n\tNONE: \"NONE\",\n\tHORIZONTAL: \"HORIZONTAL\",\n\tVERTICAL: \"VERTICAL\",\n\tBOTH: \"BOTH\",\n} as const;\nexport type Stretch = (typeof Stretch)[keyof typeof Stretch];\n\nexport const MainAxisAlignment = {\n\tCENTER: \"CENTER\",\n\tEND: \"END\",\n\tSPACEAROUND: \"SPACEAROUND\",\n\tSPACEBETWEEN: \"SPACEBETWEEN\",\n\tSPACEEVENLY: \"SPACEEVENLY\",\n\tSTART: \"START\",\n} as const;\nexport type MainAxisAlignment = (typeof MainAxisAlignment)[keyof typeof MainAxisAlignment];\n\nexport const CrossAxisAlignment = {\n\tBASELINE: \"BASELINE\",\n\tCENTER: \"CENTER\",\n\tEND: \"END\",\n\tSTART: \"START\",\n\tSTRETCH: \"STRETCH\",\n} as const;\nexport type CrossAxisAlignment = (typeof CrossAxisAlignment)[keyof typeof CrossAxisAlignment];\n\nexport const MainAxisSize = {\n\tMIN: \"MIN\",\n\tMAX: \"MAX\",\n} as const;\nexport type MainAxisSize = (typeof MainAxisSize)[keyof typeof MainAxisSize];\n\nexport const Alignment = {\n\tTOP_LEFT: \"TOP_LEFT\",\n\tTOP_CENTER: \"TOP_CENTER\",\n\tTOP_RIGHT: \"TOP_RIGHT\",\n\tCENTER_LEFT: \"CENTER_LEFT\",\n\tCENTER: \"CENTER\",\n\tCENTER_RIGHT: \"CENTER_RIGHT\",\n\tBOTTOM_LEFT: \"BOTTOM_LEFT\",\n\tBOTTOM_CENTER: \"BOTTOM_CENTER\",\n\tBOTTOM_RIGHT: \"BOTTOM_RIGHT\",\n} as const;\nexport type Alignment = (typeof Alignment)[keyof typeof Alignment];\n\n// ============================================\n// UI ENUMS\n// ============================================\n\nexport const DialogSize = {\n\tXS: \"XS\",\n\tSM: \"SM\",\n\tMD: \"MD\",\n\tLG: \"LG\",\n\tXL: \"XL\",\n} as const;\nexport type DialogSize = (typeof DialogSize)[keyof typeof DialogSize];\n\nexport const PageContainerType = {\n\tTABLE: \"TABLE\",\n\tFORM: \"FORM\",\n\tVIEW: \"VIEW\",\n} as const;\nexport type PageContainerType = (typeof PageContainerType)[keyof typeof PageContainerType];\n\nexport const ButtonStyle = {\n\tCONTAINED: \"contained\",\n\tTEXT: \"text\",\n\tOUTLINED: \"outlined\",\n} as const;\nexport type ButtonStyle = (typeof ButtonStyle)[keyof typeof ButtonStyle];\n\nexport const ConfirmationType = {\n\tNONE: \"NONE\",\n\tCONDITIONAL: \"CONDITIONAL\",\n\tMANDATORY: \"MANDATORY\",\n} as const;\nexport type ConfirmationType = (typeof ConfirmationType)[keyof typeof ConfirmationType];\n\nexport const Sort = {\n\tNONE: \"NONE\",\n\tASC: \"ASC\",\n\tDESC: \"DESC\",\n} as const;\nexport type Sort = (typeof Sort)[keyof typeof Sort];\n\nexport const FilterOperationType = {\n\tEQUAL: \"EQUAL\",\n\tNOT_EQUAL: \"NOT_EQUAL\",\n\tIS_EMPTY: \"IS_EMPTY\",\n\tIS_NOT_EMPTY: \"IS_NOT_EMPTY\",\n\tLESS: \"LESS\",\n\tLESS_OR_EQUAL: \"LESS_OR_EQUAL\",\n\tGREATER: \"GREATER\",\n\tGREATER_OR_EQUAL: \"GREATER_OR_EQUAL\",\n\tLIKE: \"LIKE\",\n} as const;\nexport type FilterOperationType = (typeof FilterOperationType)[keyof typeof FilterOperationType];\n\nexport const CheckboxSelection = {\n\tAUTO: \"AUTO\",\n\tENABLED: \"ENABLED\",\n\tDISABLED: \"DISABLED\",\n} as const;\nexport type CheckboxSelection = (typeof CheckboxSelection)[keyof typeof CheckboxSelection];\n\nexport const TableRepresentation = {\n\tTABLE: \"TABLE\",\n\tTAG: \"TAG\",\n\tCARD: \"CARD\",\n} as const;\nexport type TableRepresentation = (typeof TableRepresentation)[keyof typeof TableRepresentation];\n\nexport const MenuLayout = {\n\tVERTICAL: \"VERTICAL\",\n\tHORIZONTAL: \"HORIZONTAL\",\n} as const;\nexport type MenuLayout = (typeof MenuLayout)[keyof typeof MenuLayout];\n\nexport const TabOrientation = {\n\tHORIZONTAL: \"HORIZONTAL\",\n\tVERTICAL: \"VERTICAL\",\n} as const;\nexport type TabOrientation = (typeof TabOrientation)[keyof typeof TabOrientation];\n\nexport const DurationUnit = {\n\tNANOSECOND: \"NANOSECOND\",\n\tMICROSECOND: \"MICROSECOND\",\n\tMILLISECOND: \"MILLISECOND\",\n\tSECOND: \"SECOND\",\n\tMINUTE: \"MINUTE\",\n\tHOUR: \"HOUR\",\n\tDAY: \"DAY\",\n\tWEEK: \"WEEK\",\n\tMONTH: \"MONTH\",\n\tYEAR: \"YEAR\",\n} as const;\nexport type DurationUnit = (typeof DurationUnit)[keyof typeof DurationUnit];\n\nexport const Placement = {\n\tTOP: \"TOP\",\n\tBOTTOM: \"BOTTOM\",\n\tSTART: \"START\",\n\tEND: \"END\",\n\tDEFAULT: \"DEFAULT\",\n} as const;\nexport type Placement = (typeof Placement)[keyof typeof Placement];\n\nexport const TitleFrom = {\n\tLABEL: \"LABEL\",\n\tATTRIBUTE: \"ATTRIBUTE\",\n} as const;\nexport type TitleFrom = (typeof TitleFrom)[keyof typeof TitleFrom];\n\nexport const ClaimType = {\n\tUNDEFINED: \"UNDEFINED\",\n\tEMAIL: \"EMAIL\",\n\tUSERNAME: \"USERNAME\",\n} as const;\nexport type ClaimType = (typeof ClaimType)[keyof typeof ClaimType];\n\n// ============================================\n// DATA ENUMS\n// ============================================\n\nexport const RelationKind = {\n\tASSOCIATION: \"ASSOCIATION\",\n\tCOMPOSITION: \"COMPOSITION\",\n\tAGGREGATION: \"AGGREGATION\",\n\tSTATIC: \"STATIC\",\n} as const;\nexport type RelationKind = (typeof RelationKind)[keyof typeof RelationKind];\n\nexport const MemberType = {\n\tSTORED: \"STORED\",\n\tDERIVED: \"DERIVED\",\n\tMAPPED: \"MAPPED\",\n\tTRANSIENT: \"TRANSIENT\",\n\tACCESS: \"ACCESS\",\n} as const;\nexport type MemberType = (typeof MemberType)[keyof typeof MemberType];\n\nexport const RelationBehaviourType = {\n\tLIST: \"LIST\",\n\tCREATE: \"CREATE\",\n\tSET: \"SET\",\n\tUNSET: \"UNSET\",\n\tADD: \"ADD\",\n\tREMOVE: \"REMOVE\",\n\tRANGE: \"RANGE\",\n\tVALIDATE_CREATE: \"VALIDATE_CREATE\",\n\tTEMPLATE: \"TEMPLATE\",\n\tUPDATE: \"UPDATE\",\n\tVALIDATE_UPDATE: \"VALIDATE_UPDATE\",\n\tDELETE: \"DELETE\",\n\tREFRESH: \"REFRESH\",\n\tEXPORT: \"EXPORT\",\n} as const;\nexport type RelationBehaviourType = (typeof RelationBehaviourType)[keyof typeof RelationBehaviourType];\n\nexport const ClassBehaviourType = {\n\tREFRESH: \"REFRESH\",\n\tUPDATE: \"UPDATE\",\n\tVALIDATE_UPDATE: \"VALIDATE_UPDATE\",\n\tDELETE: \"DELETE\",\n\tTEMPLATE: \"TEMPLATE\",\n} as const;\nexport type ClassBehaviourType = (typeof ClassBehaviourType)[keyof typeof ClassBehaviourType];\n\nexport const OperationTypeEnum = {\n\tMAPPED: \"MAPPED\",\n\tSTATIC: \"STATIC\",\n} as const;\nexport type OperationTypeEnum = (typeof OperationTypeEnum)[keyof typeof OperationTypeEnum];\n\nexport const OperationTargetBehaviourType = {\n\tREFRESH: \"REFRESH\",\n\tUPDATE: \"UPDATE\",\n\tDELETE: \"DELETE\",\n\tVALIDATE_INPUT: \"VALIDATE_INPUT\",\n} as const;\nexport type OperationTargetBehaviourType =\n\t(typeof OperationTargetBehaviourType)[keyof typeof OperationTargetBehaviourType];\n","import type { ComponentType } from \"react\";\nimport type { AttributeType, ClassType, DataType, OperationType, RelationType } from \"./data/elements\";\nimport type { PageContainerType } from \"./enums\";\nimport type { ActionDefinition } from \"./structural/actions\";\nimport type { Action, Application, NavigationItem, PageDefinition } from \"./structural/application\";\nimport type { PageContainer, VisualElement } from \"./visual/layout\";\n\n// ============================================\n// CORE SERVICES\n// ============================================\nexport const MODEL_LOADER_SERVICE = Symbol.for(\"@judo/MODEL_LOADER_SERVICE\");\nexport const MODEL_REGISTRY_SERVICE = Symbol.for(\"@judo/MODEL_REGISTRY_SERVICE\");\nexport const NAVIGATION_BADGE_SERVICE = Symbol.for(\"@judo/NAVIGATION_BADGE_SERVICE\");\nexport const THEME_SERVICE = Symbol.for(\"@judo/THEME_SERVICE\");\n\n// ============================================\n// HOOK FACTORY SERVICES (React hooks compatible)\n// ============================================\n\n/**\n * @internal Framework service token for action handler hook factories.\n * Built-in handlers are registered by actionType.\n * Developers override actions via the type-safe `createCustomizations()` factory.\n */\nexport const ACTION_HANDLER_FACTORY = Symbol.for(\"@judo/ACTION_HANDLER_FACTORY\");\n\n/**\n * @internal Framework service token for component overrides.\n * Developers register components via the type-safe `createCustomizations()` factory.\n * Framework INJECTS the VisualElement as `element` prop.\n */\nexport const COMPONENT_OVERRIDE = Symbol.for(\"@judo/COMPONENT_OVERRIDE\");\n\n/**\n * @internal Framework service token for the component override manager.\n * Used internally by `useComponentOverride` hook.\n */\nexport const COMPONENT_OVERRIDE_SERVICE = Symbol.for(\"@judo/COMPONENT_OVERRIDE_SERVICE\");\n\n// ============================================\n// ENTERPRISE SERVICES\n// ============================================\nexport const NOTIFICATION_SERVICE = Symbol.for(\"@judo/NOTIFICATION_SERVICE\");\nexport const DIALOG_SERVICE = Symbol.for(\"@judo/DIALOG_SERVICE\");\nexport const UNSAVED_CHANGES_GUARD = Symbol.for(\"@judo/UNSAVED_CHANGES_GUARD\");\nexport const SESSION_TIMEOUT_GUARD = Symbol.for(\"@judo/SESSION_TIMEOUT_GUARD\");\nexport const LOADING_SERVICE = Symbol.for(\"@judo/LOADING_SERVICE\");\nexport const I18N_SERVICE = Symbol.for(\"@judo/I18N_SERVICE\");\n\n// ============================================\n// ACTION HANDLER FACTORY TYPES\n// ============================================\n\n/**\n * Runtime context passed to action handlers when action triggers.\n */\nexport interface ActionHandlerContext {\n\t/** The transfer being acted upon */\n\ttransfer?: unknown;\n\t/** Selected rows for bulk/table operations */\n\tselectedRows?: unknown[];\n\t/** Dialog closer if action is in a dialog */\n\tcloseDialog?: () => void;\n\t/** Navigation context for page transitions */\n\tnavigation?: unknown;\n\t/** Data store for transfer operations */\n\tdata?: unknown;\n\t/** Model registry for lookups */\n\tregistry?: ModelRegistryService;\n}\n\n/**\n * Action handler hook factory type.\n * Framework INJECTS the Action model element when calling your handler.\n *\n * @param action - The Action model element (injected by framework)\n * @returns Handler function to execute when action triggers\n *\n * @example\n * ```typescript\n * function useMyHandler(action: Action) {\n * const { showSuccess } = useNotification();\n * const operation = action.actionDefinition.operation;\n *\n * return async (ctx: ActionHandlerContext) => {\n * console.log(`Handling ${action.name}:`, ctx.transfer);\n * showSuccess('Done!');\n * };\n * }\n * ```\n */\nexport type ActionHandlerHook = (action: Action) => ActionHandlerFn;\n\n/**\n * Handler function called when the action is triggered.\n */\nexport type ActionHandlerFn = (context: ActionHandlerContext) => Promise<unknown>;\n\n/**\n * @internal Framework-internal service properties for action handler registration.\n *\n * **Do not use directly.** Developers should use the generated `createCustomizations()`\n * factory with human-readable page and action names instead.\n *\n * @see {@link CustomizationsConfig} for the runtime format (also internal)\n */\nexport interface ActionHandlerFactoryProperties {\n\t/** @internal The action's xmi:id — resolved automatically by the factory */\n\tsourceId: string;\n}\n\n/**\n * Service properties for built-in action handler registration (internal).\n */\nexport interface BuiltInActionHandlerFactoryProperties {\n\t/** The action type this built-in handles (e.g., 'ui:DeleteActionDefinition') */\n\tactionType: string;\n\t/** Marker for built-in handlers */\n\tbuiltin: true;\n}\n\n// ============================================\n// COMPONENT OVERRIDE TYPES\n// ============================================\n\n/**\n * Type for a component that can be used as an override.\n * Framework INJECTS the VisualElement as the `element` prop.\n *\n * @example\n * ```typescript\n * const MyTableComponent: OverrideComponent<Table> = ({ element }) => {\n * return <DefaultTable element={element} />;\n * };\n * ```\n */\nexport type OverrideComponent<T extends VisualElement = VisualElement> = ComponentType<\n\t{ element: T } & Record<string, unknown>\n>;\n\n/**\n * @internal Framework-internal component override registration object.\n *\n * **Do not use directly.** Developers should register component overrides via\n * the generated `createCustomizations()` factory using human-readable names:\n *\n * @example\n * ```typescript\n * // Use the generated type-safe factory:\n * createCustomizations({\n * components: {\n * OrderSummaryWidget: MyCustomComponent,\n * },\n * componentInterceptors: {\n * TextInput: (element, page) => isEmail(element) ? EmailInput : null,\n * },\n * });\n * ```\n */\nexport interface ComponentOverride {\n\t/** @internal Override a specific element — resolved automatically by the factory */\n\tsourceId?: string;\n\t/** Override all elements of this type (e.g., 'Table', 'TextInput') */\n\telementType?: string;\n\t/** Override all elements within a container type */\n\tcontainerType?: PageContainerType;\n\t/** The component to render instead of the default */\n\tcomponent: OverrideComponent;\n}\n\n/**\n * @internal Framework-internal service properties for component override registration.\n *\n * **Do not use directly.** Use the generated `createCustomizations()` factory\n * with `components` (by name) or `componentInterceptors` (by @type) instead.\n */\nexport interface ComponentOverrideProperties {\n\t/** @internal Element identity — resolved automatically by the factory */\n\tsourceId?: string;\n\t/** Override all elements of this type (e.g., 'Table', 'TextInput') */\n\telementType?: string;\n}\n\n/**\n * @internal Framework-internal service for managing component overrides at runtime.\n * Used internally by `useComponentOverride` hook.\n */\nexport interface ComponentOverrideService {\n\t/** Register a component override, returns unregister function */\n\tregister(override: ComponentOverride): () => void;\n\t/** Get override for element with priority: sourceId > elementType > containerType */\n\tgetOverride(element: VisualElement, containerType?: PageContainerType): OverrideComponent | null;\n\t/** Subscribe to override changes */\n\tsubscribe(callback: () => void): () => void;\n\t/** Get current snapshot of all registered overrides */\n\tgetSnapshot(): ComponentOverride[];\n}\n\n// ============================================\n// SERVICE INTERFACES\n// ============================================\n\nexport interface ModelLoaderService {\n\tload(source: string): Promise<Application[]>;\n}\n\nexport interface RegistrySnapshot {\n\tapplications: Application[];\n\tactiveApplication: Application | null;\n\tactiveActorName: string | null;\n}\n\nexport interface ModelRegistryService {\n\tregisterModel(apps: Application[]): void;\n\tgetApplications(): Application[];\n\tgetApplication(actorName: string): Application;\n\tgetActiveApplication(): Application;\n\tsetActiveApplication(actorName: string): void;\n\tresolveById<T = unknown>(id: string): T | undefined;\n\tresolveClassType(ref: string): ClassType | undefined;\n\tresolveRelationType(ref: string): RelationType | undefined;\n\tresolveAttributeType(ref: string): AttributeType | undefined;\n\tresolvePageDefinition(ref: string): PageDefinition | undefined;\n\tresolvePageContainer(ref: string): PageContainer | undefined;\n\tresolveVisualElement(id: string): VisualElement | undefined;\n\tresolveActionDefinition(ref: string): ActionDefinition | undefined;\n\tresolveDataType(ref: string): DataType | undefined;\n\tresolveOperationType(ref: string): OperationType | undefined;\n\tresolveNavigationItem(id: string): NavigationItem | undefined;\n\tsubscribe(callback: () => void): () => void;\n\tgetSnapshot(): RegistrySnapshot;\n}\n\nexport interface BadgeInfo {\n\tcount?: number;\n\tcolor?: \"primary\" | \"secondary\" | \"error\" | \"warning\" | \"info\" | \"success\";\n\tmax?: number;\n\tshowZero?: boolean;\n}\n\nexport interface NavigationBadgeService {\n\tgetBadge(itemId: string): BadgeInfo | null;\n\tsetBadge(itemId: string, badge: BadgeInfo | null): void;\n\tsubscribe(callback: () => void): () => void;\n\tgetSnapshot(): Map<string, BadgeInfo>;\n}\n\nexport interface ThemeConfig {\n\tmode: \"light\" | \"dark\";\n\t/** @deprecated Use muiThemeOptions.palette.primary instead */\n\tprimaryColor?: string;\n\t/** @deprecated Use muiThemeOptions.palette.secondary instead */\n\tsecondaryColor?: string;\n\t/**\n\t * MUI theme options to merge with defaults.\n\t * Provides full customization of Material-UI theme.\n\t */\n\tmuiThemeOptions?: Record<string, unknown>;\n\t/**\n\t * Whether the theme is using system preference.\n\t * When true, mode will automatically track OS/browser preference.\n\t */\n\tisSystemMode?: boolean;\n\t/**\n\t * Density level controlling semantic spacing and sizing.\n\t * - `compact` — tight spacing, smaller controls\n\t * - `comfortable` — default MUI sizing (no overrides)\n\t * - `standard` — generous spacing, larger touch targets\n\t */\n\tdensity?: \"compact\" | \"comfortable\" | \"standard\";\n\t/**\n\t * Named theme preset. When set, provides default primary/secondary colors\n\t * and background tints. Explicit `primaryColor`/`secondaryColor` override\n\t * the preset values.\n\t *\n\t * Built-in presets: 'corporate', 'ocean', 'slate', 'indigo', 'forest', 'royal'\n\t */\n\tpreset?: \"corporate\" | \"ocean\" | \"slate\" | \"indigo\" | \"forest\" | \"royal\" | (string & {});\n}\n\nexport interface ThemeService {\n\tgetTheme(): ThemeConfig;\n\tsetTheme(config: Partial<ThemeConfig>): void;\n\tsubscribe(callback: () => void): () => void;\n\tgetSnapshot(): ThemeConfig;\n}\n"],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@judo/model-api",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "TypeScript interfaces mirroring the ECore meta-model for JUDO UI Runtime",
|
|
5
5
|
"license": "EPL-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/react": "^19.2.14",
|
|
31
|
-
"typescript": "^
|
|
31
|
+
"typescript": "^6.0.2"
|
|
32
32
|
},
|
|
33
33
|
"peerDependencies": {
|
|
34
34
|
"react": "^19.0.0"
|