@almadar/patterns 2.11.0 → 2.12.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/helpers/prompt-helpers.d.ts +2 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pattern-types.d.ts +45 -39
- package/dist/types.d.ts +10 -0
- package/package.json +4 -1
package/dist/pattern-types.d.ts
CHANGED
|
@@ -7,6 +7,12 @@
|
|
|
7
7
|
* Generated: 2026-02-10T14:06:03.975Z
|
|
8
8
|
* Pattern count: 120
|
|
9
9
|
*/
|
|
10
|
+
import type { FieldValue } from '@almadar/core/types';
|
|
11
|
+
/**
|
|
12
|
+
* Object-typed pattern prop value. Represents dynamic config objects
|
|
13
|
+
* within pattern props (e.g., style, assetManifest, payload).
|
|
14
|
+
*/
|
|
15
|
+
export type PatternPropValue = Record<string, FieldValue | undefined>;
|
|
10
16
|
/**
|
|
11
17
|
* All valid pattern type names from almadar-patterns registry.
|
|
12
18
|
* Use this type in render-ui effects for compile-time validation.
|
|
@@ -126,7 +132,7 @@ export interface PatternPropsMap {
|
|
|
126
132
|
/** Board height for bounds checking */
|
|
127
133
|
boardHeight?: number | string;
|
|
128
134
|
/** Asset manifest for IsometricCanvas */
|
|
129
|
-
assetManifest?:
|
|
135
|
+
assetManifest?: PatternPropValue | string;
|
|
130
136
|
/** Background image URL for canvas */
|
|
131
137
|
backgroundImage?: string;
|
|
132
138
|
/** Unit draw-size multiplier */
|
|
@@ -303,7 +309,7 @@ export interface PatternPropsMap {
|
|
|
303
309
|
/** Canvas render scale */
|
|
304
310
|
scale?: number | string;
|
|
305
311
|
/** Asset manifest for IsometricCanvas */
|
|
306
|
-
assetManifest?:
|
|
312
|
+
assetManifest?: PatternPropValue | string;
|
|
307
313
|
/** Background image URL */
|
|
308
314
|
backgroundImage?: string;
|
|
309
315
|
/** -- Slots -- */
|
|
@@ -340,7 +346,7 @@ export interface PatternPropsMap {
|
|
|
340
346
|
/** Custom class name */
|
|
341
347
|
className?: string;
|
|
342
348
|
/** Inline styles */
|
|
343
|
-
style?:
|
|
349
|
+
style?: PatternPropValue | string;
|
|
344
350
|
/** Children elements */
|
|
345
351
|
children: unknown | string;
|
|
346
352
|
/** HTML element to render as */
|
|
@@ -598,7 +604,7 @@ export interface PatternPropsMap {
|
|
|
598
604
|
/** Event to emit on click (REQUIRED for interactive elements) */
|
|
599
605
|
action?: string;
|
|
600
606
|
/** Event payload */
|
|
601
|
-
payload?:
|
|
607
|
+
payload?: PatternPropValue | string;
|
|
602
608
|
/** Nested children patterns */
|
|
603
609
|
children?: unknown | string;
|
|
604
610
|
/** Image source (for img elements) */
|
|
@@ -612,7 +618,7 @@ export interface PatternPropsMap {
|
|
|
612
618
|
/** Disabled state */
|
|
613
619
|
disabled?: boolean | string;
|
|
614
620
|
/** Additional HTML attributes */
|
|
615
|
-
htmlProps?:
|
|
621
|
+
htmlProps?: PatternPropValue | string;
|
|
616
622
|
};
|
|
617
623
|
'd-pad': {
|
|
618
624
|
type: 'd-pad';
|
|
@@ -647,7 +653,7 @@ export interface PatternPropsMap {
|
|
|
647
653
|
/** Navigation items */
|
|
648
654
|
navItems?: unknown[] | string;
|
|
649
655
|
/** Current user info (optional - auto-populated from auth context if not provided) */
|
|
650
|
-
user?:
|
|
656
|
+
user?: PatternPropValue | string;
|
|
651
657
|
/** Header actions (notifications, etc.) */
|
|
652
658
|
headerActions?: unknown | string;
|
|
653
659
|
/** Show search in header */
|
|
@@ -664,7 +670,7 @@ export interface PatternPropsMap {
|
|
|
664
670
|
/** subtitle prop */
|
|
665
671
|
subtitle?: string;
|
|
666
672
|
/** status prop */
|
|
667
|
-
status?:
|
|
673
|
+
status?: PatternPropValue | string;
|
|
668
674
|
/** avatar prop */
|
|
669
675
|
avatar?: unknown | string;
|
|
670
676
|
/** sections prop */
|
|
@@ -686,7 +692,7 @@ export interface PatternPropsMap {
|
|
|
686
692
|
/** Alias for fields - backwards compatibility */
|
|
687
693
|
fieldNames?: unknown | string;
|
|
688
694
|
/** data prop */
|
|
689
|
-
data?:
|
|
695
|
+
data?: PatternPropValue | unknown | string;
|
|
690
696
|
/** isLoading prop */
|
|
691
697
|
isLoading?: boolean | string;
|
|
692
698
|
/** error prop */
|
|
@@ -857,7 +863,7 @@ export interface PatternPropsMap {
|
|
|
857
863
|
/** Show total count in pagination */
|
|
858
864
|
showTotal?: boolean | string;
|
|
859
865
|
/** Filter configuration for entity data */
|
|
860
|
-
filter?:
|
|
866
|
+
filter?: PatternPropValue | string;
|
|
861
867
|
/** Query singleton binding for filter/sort state. When provided, syncs with the query singleton for filtering and sorting. Example: "@TaskQuery" */
|
|
862
868
|
query?: string;
|
|
863
869
|
};
|
|
@@ -927,7 +933,7 @@ export interface PatternPropsMap {
|
|
|
927
933
|
/** emptyDescription prop */
|
|
928
934
|
emptyDescription?: string;
|
|
929
935
|
/** emptyAction prop */
|
|
930
|
-
emptyAction?:
|
|
936
|
+
emptyAction?: PatternPropValue | string;
|
|
931
937
|
/** Selection */
|
|
932
938
|
selectable?: boolean | string;
|
|
933
939
|
/** selectedIds prop */
|
|
@@ -941,7 +947,7 @@ export interface PatternPropsMap {
|
|
|
941
947
|
/** onSort prop */
|
|
942
948
|
onSort?: ((...args: unknown[]) => unknown) | string;
|
|
943
949
|
/** Pagination (manual control) */
|
|
944
|
-
pagination?:
|
|
950
|
+
pagination?: PatternPropValue | string;
|
|
945
951
|
/** Server-side pagination (automatic when enabled) */
|
|
946
952
|
enablePagination?: boolean | string;
|
|
947
953
|
/** Items per page for automatic pagination (default: 20) */
|
|
@@ -1033,7 +1039,7 @@ export interface PatternPropsMap {
|
|
|
1033
1039
|
'floating-action-button': {
|
|
1034
1040
|
type: 'floating-action-button';
|
|
1035
1041
|
/** Single action (if only one action, button will directly trigger onClick) */
|
|
1036
|
-
action?:
|
|
1042
|
+
action?: PatternPropValue | string;
|
|
1037
1043
|
/** Multiple actions (if provided, button will expand to show all actions) */
|
|
1038
1044
|
actions?: unknown[] | string;
|
|
1039
1045
|
/** Icon name (simplified API for pattern compatibility) */
|
|
@@ -1068,7 +1074,7 @@ export interface PatternPropsMap {
|
|
|
1068
1074
|
/** Fields definition (schema format) - accepts readonly for generated const arrays */
|
|
1069
1075
|
fields?: unknown | string;
|
|
1070
1076
|
/** Initial form data */
|
|
1071
|
-
initialData?:
|
|
1077
|
+
initialData?: PatternPropValue | unknown | string;
|
|
1072
1078
|
/** Loading state */
|
|
1073
1079
|
isLoading?: boolean | string;
|
|
1074
1080
|
/** Error state */
|
|
@@ -1086,17 +1092,17 @@ export interface PatternPropsMap {
|
|
|
1086
1092
|
/** Event to dispatch on cancel (defaults to 'CANCEL') */
|
|
1087
1093
|
cancelEvent?: string;
|
|
1088
1094
|
/** Relation data props */
|
|
1089
|
-
relationsData?:
|
|
1095
|
+
relationsData?: PatternPropValue | string;
|
|
1090
1096
|
/** Loading state for relation data: { fieldName: boolean } */
|
|
1091
|
-
relationsLoading?:
|
|
1097
|
+
relationsLoading?: PatternPropValue | string;
|
|
1092
1098
|
/** Inspection form extensions */
|
|
1093
|
-
conditionalFields?:
|
|
1099
|
+
conditionalFields?: PatternPropValue | boolean | string;
|
|
1094
1100
|
/** Hidden calculations that emit GLOBAL_VARIABLE_SET on field change (boolean true means enabled but config loaded separately) */
|
|
1095
1101
|
hiddenCalculations?: unknown[] | boolean | string;
|
|
1096
1102
|
/** Violation conditions that emit VIOLATION_DETECTED when met (boolean true means enabled but config loaded separately) */
|
|
1097
1103
|
violationTriggers?: unknown[] | boolean | string;
|
|
1098
1104
|
/** Context for S-expression evaluation - accepts flexible types from generated code */
|
|
1099
|
-
evaluationContext?: unknown |
|
|
1105
|
+
evaluationContext?: unknown | PatternPropValue | string;
|
|
1100
1106
|
/** Nested form sections with optional conditions */
|
|
1101
1107
|
sections?: unknown[] | string;
|
|
1102
1108
|
/** Callback when any field value changes */
|
|
@@ -1161,7 +1167,7 @@ export interface PatternPropsMap {
|
|
|
1161
1167
|
/** Fields definition (schema format) - accepts readonly for generated const arrays */
|
|
1162
1168
|
fields?: unknown | string;
|
|
1163
1169
|
/** Initial form data */
|
|
1164
|
-
initialData?:
|
|
1170
|
+
initialData?: PatternPropValue | unknown | string;
|
|
1165
1171
|
/** Loading state */
|
|
1166
1172
|
isLoading?: boolean | string;
|
|
1167
1173
|
/** Error state */
|
|
@@ -1179,17 +1185,17 @@ export interface PatternPropsMap {
|
|
|
1179
1185
|
/** Event to dispatch on cancel (defaults to 'CANCEL') */
|
|
1180
1186
|
cancelEvent?: string;
|
|
1181
1187
|
/** Relation data props */
|
|
1182
|
-
relationsData?:
|
|
1188
|
+
relationsData?: PatternPropValue | string;
|
|
1183
1189
|
/** Loading state for relation data: { fieldName: boolean } */
|
|
1184
|
-
relationsLoading?:
|
|
1190
|
+
relationsLoading?: PatternPropValue | string;
|
|
1185
1191
|
/** Inspection form extensions */
|
|
1186
|
-
conditionalFields?:
|
|
1192
|
+
conditionalFields?: PatternPropValue | boolean | string;
|
|
1187
1193
|
/** Hidden calculations that emit GLOBAL_VARIABLE_SET on field change (boolean true means enabled but config loaded separately) */
|
|
1188
1194
|
hiddenCalculations?: unknown[] | boolean | string;
|
|
1189
1195
|
/** Violation conditions that emit VIOLATION_DETECTED when met (boolean true means enabled but config loaded separately) */
|
|
1190
1196
|
violationTriggers?: unknown[] | boolean | string;
|
|
1191
1197
|
/** Context for S-expression evaluation - accepts flexible types from generated code */
|
|
1192
|
-
evaluationContext?: unknown |
|
|
1198
|
+
evaluationContext?: unknown | PatternPropValue | string;
|
|
1193
1199
|
/** Nested form sections with optional conditions */
|
|
1194
1200
|
sections?: unknown[] | string;
|
|
1195
1201
|
/** Callback when any field value changes */
|
|
@@ -1225,7 +1231,7 @@ export interface PatternPropsMap {
|
|
|
1225
1231
|
'form-template': {
|
|
1226
1232
|
type: 'form-template';
|
|
1227
1233
|
/** Current form field values */
|
|
1228
|
-
formData:
|
|
1234
|
+
formData: PatternPropValue | string;
|
|
1229
1235
|
/** Whether form is being submitted */
|
|
1230
1236
|
isSubmitting?: boolean | string;
|
|
1231
1237
|
/** Whether submission was successful */
|
|
@@ -1233,7 +1239,7 @@ export interface PatternPropsMap {
|
|
|
1233
1239
|
/** Error object if submission failed */
|
|
1234
1240
|
error?: unknown | string;
|
|
1235
1241
|
/** Field-level validation errors */
|
|
1236
|
-
validationErrors?:
|
|
1242
|
+
validationErrors?: PatternPropValue | string;
|
|
1237
1243
|
/** Called when form is submitted */
|
|
1238
1244
|
onSubmit?: ((...args: unknown[]) => unknown) | string;
|
|
1239
1245
|
/** Called when a field value changes */
|
|
@@ -1346,7 +1352,7 @@ export interface PatternPropsMap {
|
|
|
1346
1352
|
/** Whether the debug panel is visible */
|
|
1347
1353
|
showDebugPanel?: boolean | string;
|
|
1348
1354
|
/** Game controls */
|
|
1349
|
-
controls?:
|
|
1355
|
+
controls?: PatternPropValue | string;
|
|
1350
1356
|
/** Additional class name */
|
|
1351
1357
|
className?: string;
|
|
1352
1358
|
};
|
|
@@ -1419,7 +1425,7 @@ export interface PatternPropsMap {
|
|
|
1419
1425
|
/** Custom class name */
|
|
1420
1426
|
className?: string;
|
|
1421
1427
|
/** Inline styles */
|
|
1422
|
-
style?:
|
|
1428
|
+
style?: PatternPropValue | string;
|
|
1423
1429
|
/** Children elements */
|
|
1424
1430
|
children: unknown | string;
|
|
1425
1431
|
/** HTML element to render as */
|
|
@@ -1448,7 +1454,7 @@ export interface PatternPropsMap {
|
|
|
1448
1454
|
/** Search callback */
|
|
1449
1455
|
onSearch?: ((...args: unknown[]) => unknown) | string;
|
|
1450
1456
|
/** User avatar configuration */
|
|
1451
|
-
userAvatar?:
|
|
1457
|
+
userAvatar?: PatternPropValue | string;
|
|
1452
1458
|
/** User name (display name or email) */
|
|
1453
1459
|
userName?: string;
|
|
1454
1460
|
/** Callback when user avatar is clicked */
|
|
@@ -1496,7 +1502,7 @@ export interface PatternPropsMap {
|
|
|
1496
1502
|
/** Icon stroke width - uses theme default if not specified */
|
|
1497
1503
|
strokeWidth?: number | string;
|
|
1498
1504
|
/** Inline style */
|
|
1499
|
-
style?:
|
|
1505
|
+
style?: PatternPropValue | string;
|
|
1500
1506
|
};
|
|
1501
1507
|
'input': {
|
|
1502
1508
|
type: 'input';
|
|
@@ -1576,7 +1582,7 @@ export interface PatternPropsMap {
|
|
|
1576
1582
|
/** Attack target positions (shown as pulsing red highlights) */
|
|
1577
1583
|
attackTargets?: unknown[] | string;
|
|
1578
1584
|
/** Hovered tile position */
|
|
1579
|
-
hoveredTile?:
|
|
1585
|
+
hoveredTile?: PatternPropValue | string;
|
|
1580
1586
|
/** --- Event handlers --- */
|
|
1581
1587
|
onTileClick?: ((...args: unknown[]) => unknown) | string;
|
|
1582
1588
|
/** Unit click handler */
|
|
@@ -1614,7 +1620,7 @@ export interface PatternPropsMap {
|
|
|
1614
1620
|
/** --- Remote asset loading --- */
|
|
1615
1621
|
assetBaseUrl?: string;
|
|
1616
1622
|
/** Manifest mapping entity keys to relative sprite paths. Combined with assetBaseUrl to produce full URLs. Used as a fallback when inline URLs and callbacks don't resolve. */
|
|
1617
|
-
assetManifest?:
|
|
1623
|
+
assetManifest?: PatternPropValue | string;
|
|
1618
1624
|
};
|
|
1619
1625
|
'label': {
|
|
1620
1626
|
type: 'label';
|
|
@@ -1639,7 +1645,7 @@ export interface PatternPropsMap {
|
|
|
1639
1645
|
/** Additional CSS classes */
|
|
1640
1646
|
className?: string;
|
|
1641
1647
|
/** Inline styles */
|
|
1642
|
-
style?:
|
|
1648
|
+
style?: PatternPropValue | string;
|
|
1643
1649
|
};
|
|
1644
1650
|
'list-template': {
|
|
1645
1651
|
type: 'list-template';
|
|
@@ -1848,7 +1854,7 @@ export interface PatternPropsMap {
|
|
|
1848
1854
|
'orbital-visualization': {
|
|
1849
1855
|
type: 'orbital-visualization';
|
|
1850
1856
|
/** Full KFlow schema object */
|
|
1851
|
-
schema?:
|
|
1857
|
+
schema?: PatternPropValue | string;
|
|
1852
1858
|
/** Direct complexity override (1-100+) */
|
|
1853
1859
|
complexity?: number | string;
|
|
1854
1860
|
/** Size of the visualization */
|
|
@@ -1886,7 +1892,7 @@ export interface PatternPropsMap {
|
|
|
1886
1892
|
/** Breadcrumbs */
|
|
1887
1893
|
breadcrumbs?: unknown | string;
|
|
1888
1894
|
/** Status badge */
|
|
1889
|
-
status?:
|
|
1895
|
+
status?: PatternPropValue | string;
|
|
1890
1896
|
/** Actions array - first action with variant='primary' (or first action) is the main action */
|
|
1891
1897
|
actions?: unknown | string;
|
|
1892
1898
|
/** Loading state indicator */
|
|
@@ -2132,7 +2138,7 @@ export interface PatternPropsMap {
|
|
|
2132
2138
|
'settings-template': {
|
|
2133
2139
|
type: 'settings-template';
|
|
2134
2140
|
/** Current settings values */
|
|
2135
|
-
settings:
|
|
2141
|
+
settings: PatternPropValue | string;
|
|
2136
2142
|
/** Whether settings are being saved */
|
|
2137
2143
|
isSaving?: boolean | string;
|
|
2138
2144
|
/** Whether there are unsaved changes */
|
|
@@ -2368,7 +2374,7 @@ export interface PatternPropsMap {
|
|
|
2368
2374
|
/** Custom class name */
|
|
2369
2375
|
className?: string;
|
|
2370
2376
|
/** Inline styles */
|
|
2371
|
-
style?:
|
|
2377
|
+
style?: PatternPropValue | string;
|
|
2372
2378
|
/** Children elements */
|
|
2373
2379
|
children?: unknown | string;
|
|
2374
2380
|
/** HTML element to render as */
|
|
@@ -2432,7 +2438,7 @@ export interface PatternPropsMap {
|
|
|
2432
2438
|
/** Subtitle or description */
|
|
2433
2439
|
subtitle?: string;
|
|
2434
2440
|
/** Action button */
|
|
2435
|
-
action?:
|
|
2441
|
+
action?: PatternPropValue | string;
|
|
2436
2442
|
/** className prop */
|
|
2437
2443
|
className?: string;
|
|
2438
2444
|
/** Schema-based props */
|
|
@@ -2651,7 +2657,7 @@ export interface PatternPropsMap {
|
|
|
2651
2657
|
/** Additional class names */
|
|
2652
2658
|
className?: string;
|
|
2653
2659
|
/** Inline style */
|
|
2654
|
-
style?:
|
|
2660
|
+
style?: PatternPropValue | string;
|
|
2655
2661
|
/** Text content (alternative to children) */
|
|
2656
2662
|
content?: unknown | string;
|
|
2657
2663
|
/** Children elements */
|
|
@@ -2771,7 +2777,7 @@ export interface PatternPropsMap {
|
|
|
2771
2777
|
/** Unit draw-size multiplier */
|
|
2772
2778
|
unitScale?: number | string;
|
|
2773
2779
|
/** Asset manifest for IsometricCanvas */
|
|
2774
|
-
assetManifest?:
|
|
2780
|
+
assetManifest?: PatternPropValue | string;
|
|
2775
2781
|
/** Background image URL */
|
|
2776
2782
|
backgroundImage?: string;
|
|
2777
2783
|
/** Allow selecting / moving ALL heroes (including enemy). For testing. */
|
|
@@ -2807,7 +2813,7 @@ export interface PatternPropsMap {
|
|
|
2807
2813
|
*
|
|
2808
2814
|
* @example
|
|
2809
2815
|
* type TableProps = PatternProps<'entity-table'>;
|
|
2810
|
-
* // { type: 'entity-table'; columns: unknown[]; data?:
|
|
2816
|
+
* // { type: 'entity-table'; columns: unknown[]; data?: PatternPropValue; ... }
|
|
2811
2817
|
*/
|
|
2812
2818
|
export type PatternProps<T extends PatternType> = PatternPropsMap[T];
|
|
2813
2819
|
/**
|
package/dist/types.d.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/patterns",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.12.0",
|
|
4
4
|
"description": "Pattern registry and component mappings for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -47,6 +47,9 @@
|
|
|
47
47
|
"registry"
|
|
48
48
|
],
|
|
49
49
|
"homepage": "https://github.com/almadar-io/almadar#readme",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@almadar/core": ">=2.13.0"
|
|
52
|
+
},
|
|
50
53
|
"scripts": {
|
|
51
54
|
"build": "tsup && tsc -p tsconfig.build.json",
|
|
52
55
|
"build:watch": "tsup --watch",
|