@almadar/patterns 1.0.14 → 1.1.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/LICENSE +72 -0
- package/dist/component-mapping.json +27 -2
- package/dist/event-contracts.json +22 -8
- package/dist/index.d.ts +7638 -5608
- package/dist/index.js +1029 -105
- package/dist/index.js.map +1 -1
- package/dist/patterns-registry.json +750 -23
- package/dist/registry.json +750 -23
- package/package.json +9 -10
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/patterns-registry.json
|
|
2
2
|
var patterns_registry_default = {
|
|
3
3
|
version: "1.0.0",
|
|
4
|
-
exportedAt: "2026-02-
|
|
4
|
+
exportedAt: "2026-02-10T15:35:56.769Z",
|
|
5
5
|
patterns: {
|
|
6
6
|
"entity-table": {
|
|
7
7
|
type: "entity-table",
|
|
@@ -882,62 +882,188 @@ var patterns_registry_default = {
|
|
|
882
882
|
"form-section": {
|
|
883
883
|
type: "form-section",
|
|
884
884
|
category: "form",
|
|
885
|
-
description: "
|
|
885
|
+
description: "Alias for form \u2014 Complete form with fields and actions",
|
|
886
886
|
suggestedFor: [
|
|
887
887
|
"create forms",
|
|
888
888
|
"edit forms",
|
|
889
|
-
"
|
|
889
|
+
"data entry"
|
|
890
890
|
],
|
|
891
|
-
typicalSize: "
|
|
891
|
+
typicalSize: "medium",
|
|
892
892
|
propsSchema: {
|
|
893
|
+
children: {
|
|
894
|
+
types: [
|
|
895
|
+
"node"
|
|
896
|
+
],
|
|
897
|
+
description: "Form fields (traditional React children)"
|
|
898
|
+
},
|
|
899
|
+
onSubmit: {
|
|
900
|
+
types: [
|
|
901
|
+
"function",
|
|
902
|
+
"string"
|
|
903
|
+
],
|
|
904
|
+
description: "Submit handler - receives form data, or event name string for trait dispatch"
|
|
905
|
+
},
|
|
906
|
+
onCancel: {
|
|
907
|
+
types: [
|
|
908
|
+
"function",
|
|
909
|
+
"string"
|
|
910
|
+
],
|
|
911
|
+
description: "Cancel handler - function or event name string for trait dispatch"
|
|
912
|
+
},
|
|
913
|
+
layout: {
|
|
914
|
+
types: [
|
|
915
|
+
"string"
|
|
916
|
+
],
|
|
917
|
+
description: "Form layout"
|
|
918
|
+
},
|
|
919
|
+
gap: {
|
|
920
|
+
types: [
|
|
921
|
+
"string"
|
|
922
|
+
],
|
|
923
|
+
description: "Gap between fields"
|
|
924
|
+
},
|
|
925
|
+
className: {
|
|
926
|
+
types: [
|
|
927
|
+
"string"
|
|
928
|
+
],
|
|
929
|
+
description: "Additional CSS classes"
|
|
930
|
+
},
|
|
931
|
+
entity: {
|
|
932
|
+
types: [
|
|
933
|
+
"string"
|
|
934
|
+
],
|
|
935
|
+
description: "Schema-based props"
|
|
936
|
+
},
|
|
937
|
+
mode: {
|
|
938
|
+
types: [
|
|
939
|
+
"string"
|
|
940
|
+
],
|
|
941
|
+
description: "Form mode - 'create' for new records, 'edit' for updating existing"
|
|
942
|
+
},
|
|
943
|
+
fields: {
|
|
944
|
+
types: [
|
|
945
|
+
"unknown"
|
|
946
|
+
],
|
|
947
|
+
description: "Fields definition (schema format) - accepts readonly for generated const arrays"
|
|
948
|
+
},
|
|
949
|
+
initialData: {
|
|
950
|
+
types: [
|
|
951
|
+
"object",
|
|
952
|
+
"unknown"
|
|
953
|
+
],
|
|
954
|
+
description: "Initial form data"
|
|
955
|
+
},
|
|
956
|
+
isLoading: {
|
|
957
|
+
types: [
|
|
958
|
+
"boolean"
|
|
959
|
+
],
|
|
960
|
+
description: "Loading state"
|
|
961
|
+
},
|
|
962
|
+
error: {
|
|
963
|
+
types: [
|
|
964
|
+
"error"
|
|
965
|
+
],
|
|
966
|
+
description: "Error state"
|
|
967
|
+
},
|
|
968
|
+
submitLabel: {
|
|
969
|
+
types: [
|
|
970
|
+
"string"
|
|
971
|
+
],
|
|
972
|
+
description: "Submit button label"
|
|
973
|
+
},
|
|
974
|
+
cancelLabel: {
|
|
975
|
+
types: [
|
|
976
|
+
"string"
|
|
977
|
+
],
|
|
978
|
+
description: "Cancel button label (if provided, shows cancel button)"
|
|
979
|
+
},
|
|
980
|
+
showCancel: {
|
|
981
|
+
types: [
|
|
982
|
+
"boolean"
|
|
983
|
+
],
|
|
984
|
+
description: "Show cancel button (defaults to true for schema forms)"
|
|
985
|
+
},
|
|
893
986
|
title: {
|
|
894
987
|
types: [
|
|
895
988
|
"string"
|
|
896
989
|
],
|
|
897
|
-
description: "
|
|
990
|
+
description: "Form title (used by ModalSlot to extract title)"
|
|
898
991
|
},
|
|
899
|
-
|
|
992
|
+
submitEvent: {
|
|
900
993
|
types: [
|
|
901
994
|
"string"
|
|
902
995
|
],
|
|
903
|
-
description: "
|
|
996
|
+
description: "Event dispatch props (for trait state machine integration)"
|
|
904
997
|
},
|
|
905
|
-
|
|
998
|
+
cancelEvent: {
|
|
906
999
|
types: [
|
|
907
|
-
"
|
|
1000
|
+
"string"
|
|
908
1001
|
],
|
|
909
|
-
description: "
|
|
910
|
-
|
|
1002
|
+
description: "Event to dispatch on cancel (defaults to 'CANCEL')"
|
|
1003
|
+
},
|
|
1004
|
+
relationsData: {
|
|
1005
|
+
types: [
|
|
1006
|
+
"object"
|
|
1007
|
+
],
|
|
1008
|
+
description: "Relation data props"
|
|
1009
|
+
},
|
|
1010
|
+
relationsLoading: {
|
|
1011
|
+
types: [
|
|
1012
|
+
"object"
|
|
1013
|
+
],
|
|
1014
|
+
description: "Loading state for relation data: { fieldName: boolean }"
|
|
911
1015
|
},
|
|
912
|
-
|
|
1016
|
+
conditionalFields: {
|
|
913
1017
|
types: [
|
|
1018
|
+
"object",
|
|
914
1019
|
"boolean"
|
|
915
1020
|
],
|
|
916
|
-
description: "
|
|
1021
|
+
description: "Inspection form extensions"
|
|
917
1022
|
},
|
|
918
|
-
|
|
1023
|
+
hiddenCalculations: {
|
|
919
1024
|
types: [
|
|
1025
|
+
"array",
|
|
920
1026
|
"boolean"
|
|
921
1027
|
],
|
|
922
|
-
description: "
|
|
1028
|
+
description: "Hidden calculations that emit GLOBAL_VARIABLE_SET on field change (boolean true means enabled but config loaded separately)"
|
|
923
1029
|
},
|
|
924
|
-
|
|
1030
|
+
violationTriggers: {
|
|
925
1031
|
types: [
|
|
1032
|
+
"array",
|
|
926
1033
|
"boolean"
|
|
927
1034
|
],
|
|
928
|
-
description: "
|
|
1035
|
+
description: "Violation conditions that emit VIOLATION_DETECTED when met (boolean true means enabled but config loaded separately)"
|
|
929
1036
|
},
|
|
930
|
-
|
|
1037
|
+
evaluationContext: {
|
|
931
1038
|
types: [
|
|
932
|
-
"
|
|
1039
|
+
"formevaluationcontext",
|
|
1040
|
+
"object"
|
|
933
1041
|
],
|
|
934
|
-
description: "
|
|
1042
|
+
description: "Context for S-expression evaluation - accepts flexible types from generated code"
|
|
935
1043
|
},
|
|
936
|
-
|
|
1044
|
+
sections: {
|
|
1045
|
+
types: [
|
|
1046
|
+
"array"
|
|
1047
|
+
],
|
|
1048
|
+
description: "Nested form sections with optional conditions"
|
|
1049
|
+
},
|
|
1050
|
+
onFieldChange: {
|
|
1051
|
+
types: [
|
|
1052
|
+
"function"
|
|
1053
|
+
],
|
|
1054
|
+
description: "Callback when any field value changes"
|
|
1055
|
+
},
|
|
1056
|
+
configPath: {
|
|
937
1057
|
types: [
|
|
938
1058
|
"string"
|
|
939
1059
|
],
|
|
940
|
-
description: "
|
|
1060
|
+
description: "Config path for form configuration (schema-driven)"
|
|
1061
|
+
},
|
|
1062
|
+
repeatable: {
|
|
1063
|
+
types: [
|
|
1064
|
+
"boolean"
|
|
1065
|
+
],
|
|
1066
|
+
description: "Whether the form supports repeatable entries"
|
|
941
1067
|
}
|
|
942
1068
|
}
|
|
943
1069
|
},
|
|
@@ -8183,7 +8309,7 @@ var patterns_registry_default = {
|
|
|
8183
8309
|
types: [
|
|
8184
8310
|
"number"
|
|
8185
8311
|
],
|
|
8186
|
-
description: "Duration in ms before auto-dismiss (default 800)"
|
|
8312
|
+
description: "Duration in ms before auto-dismiss (default 2000 for canvas, 800 for emoji)"
|
|
8187
8313
|
},
|
|
8188
8314
|
intensity: {
|
|
8189
8315
|
types: [
|
|
@@ -8226,6 +8352,24 @@ var patterns_registry_default = {
|
|
|
8226
8352
|
"string"
|
|
8227
8353
|
],
|
|
8228
8354
|
description: "Base URL for remote assets. Prepended to relative effectSpriteUrl paths."
|
|
8355
|
+
},
|
|
8356
|
+
assetManifest: {
|
|
8357
|
+
types: [
|
|
8358
|
+
"effectassetmanifest"
|
|
8359
|
+
],
|
|
8360
|
+
description: "Full effect asset manifest for the sprite particle engine. When provided, enables the canvas-based particle system."
|
|
8361
|
+
},
|
|
8362
|
+
width: {
|
|
8363
|
+
types: [
|
|
8364
|
+
"number"
|
|
8365
|
+
],
|
|
8366
|
+
description: "Canvas width (default 400)"
|
|
8367
|
+
},
|
|
8368
|
+
height: {
|
|
8369
|
+
types: [
|
|
8370
|
+
"number"
|
|
8371
|
+
],
|
|
8372
|
+
description: "Canvas height (default 300)"
|
|
8229
8373
|
}
|
|
8230
8374
|
}
|
|
8231
8375
|
},
|
|
@@ -8421,78 +8565,661 @@ var patterns_registry_default = {
|
|
|
8421
8565
|
description: "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."
|
|
8422
8566
|
}
|
|
8423
8567
|
}
|
|
8424
|
-
}
|
|
8425
|
-
|
|
8426
|
-
|
|
8427
|
-
|
|
8428
|
-
|
|
8429
|
-
|
|
8430
|
-
|
|
8431
|
-
|
|
8432
|
-
|
|
8433
|
-
|
|
8434
|
-
|
|
8435
|
-
|
|
8436
|
-
|
|
8437
|
-
|
|
8438
|
-
|
|
8439
|
-
"component",
|
|
8440
|
-
"template",
|
|
8441
|
-
"visualization",
|
|
8442
|
-
"media"
|
|
8443
|
-
]
|
|
8444
|
-
};
|
|
8445
|
-
|
|
8446
|
-
// src/integrators-registry.json
|
|
8447
|
-
var integrators_registry_default = {
|
|
8448
|
-
version: "1.0.0",
|
|
8449
|
-
exportedAt: "2026-01-25T00:58:14.172Z",
|
|
8450
|
-
integrators: {
|
|
8451
|
-
youtube: {
|
|
8452
|
-
name: "youtube",
|
|
8453
|
-
description: "YouTube Data API - search videos, get video/channel details",
|
|
8454
|
-
category: "media",
|
|
8455
|
-
actions: [
|
|
8456
|
-
{
|
|
8457
|
-
name: "search",
|
|
8458
|
-
description: "Search for videos",
|
|
8459
|
-
params: [
|
|
8460
|
-
{
|
|
8461
|
-
name: "query",
|
|
8462
|
-
type: "string",
|
|
8463
|
-
required: true,
|
|
8464
|
-
description: "Search query"
|
|
8465
|
-
},
|
|
8466
|
-
{
|
|
8467
|
-
name: "maxResults",
|
|
8468
|
-
type: "number",
|
|
8469
|
-
required: false,
|
|
8470
|
-
description: "Max results (1-50)"
|
|
8471
|
-
},
|
|
8472
|
-
{
|
|
8473
|
-
name: "type",
|
|
8474
|
-
type: "string",
|
|
8475
|
-
required: false,
|
|
8476
|
-
description: "video, channel, or playlist"
|
|
8477
|
-
}
|
|
8568
|
+
},
|
|
8569
|
+
"battle-template": {
|
|
8570
|
+
type: "battle-template",
|
|
8571
|
+
category: "template",
|
|
8572
|
+
description: "BattleTemplate Generalized tactical battle template composing IsometricCanvas from almadar-ui. Provides turn-based phase management, movement animation, valid-move/attack-target calculation, screen shake/flash, and a game-over overlay. Game-specific UI (combat log, trait viewer, damage popups, etc.) is injected via render-prop slots so this template remains project-agnostic.",
|
|
8573
|
+
suggestedFor: [
|
|
8574
|
+
"battle",
|
|
8575
|
+
"template",
|
|
8576
|
+
"battle template"
|
|
8577
|
+
],
|
|
8578
|
+
typicalSize: "full",
|
|
8579
|
+
propsSchema: {
|
|
8580
|
+
initialUnits: {
|
|
8581
|
+
types: [
|
|
8582
|
+
"array"
|
|
8478
8583
|
],
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
title: "string",
|
|
8482
|
-
thumbnail: "string",
|
|
8483
|
-
description: "string"
|
|
8484
|
-
}
|
|
8584
|
+
description: "Initial units for the battle",
|
|
8585
|
+
required: true
|
|
8485
8586
|
},
|
|
8486
|
-
{
|
|
8487
|
-
|
|
8488
|
-
|
|
8489
|
-
|
|
8490
|
-
|
|
8491
|
-
|
|
8492
|
-
|
|
8493
|
-
|
|
8494
|
-
|
|
8495
|
-
|
|
8587
|
+
tiles: {
|
|
8588
|
+
types: [
|
|
8589
|
+
"array"
|
|
8590
|
+
],
|
|
8591
|
+
description: "Isometric tiles (pre-resolved with terrainSprite)",
|
|
8592
|
+
required: true
|
|
8593
|
+
},
|
|
8594
|
+
scale: {
|
|
8595
|
+
types: [
|
|
8596
|
+
"number"
|
|
8597
|
+
],
|
|
8598
|
+
description: "Canvas render scale"
|
|
8599
|
+
},
|
|
8600
|
+
boardWidth: {
|
|
8601
|
+
types: [
|
|
8602
|
+
"number"
|
|
8603
|
+
],
|
|
8604
|
+
description: "Board width for bounds checking"
|
|
8605
|
+
},
|
|
8606
|
+
boardHeight: {
|
|
8607
|
+
types: [
|
|
8608
|
+
"number"
|
|
8609
|
+
],
|
|
8610
|
+
description: "Board height for bounds checking"
|
|
8611
|
+
},
|
|
8612
|
+
assetManifest: {
|
|
8613
|
+
types: [
|
|
8614
|
+
"object"
|
|
8615
|
+
],
|
|
8616
|
+
description: "Asset manifest for IsometricCanvas"
|
|
8617
|
+
},
|
|
8618
|
+
backgroundImage: {
|
|
8619
|
+
types: [
|
|
8620
|
+
"string"
|
|
8621
|
+
],
|
|
8622
|
+
description: "Background image URL for canvas"
|
|
8623
|
+
},
|
|
8624
|
+
unitScale: {
|
|
8625
|
+
types: [
|
|
8626
|
+
"number"
|
|
8627
|
+
],
|
|
8628
|
+
description: "Unit draw-size multiplier"
|
|
8629
|
+
},
|
|
8630
|
+
header: {
|
|
8631
|
+
types: [
|
|
8632
|
+
"function"
|
|
8633
|
+
],
|
|
8634
|
+
description: "-- Slots --"
|
|
8635
|
+
},
|
|
8636
|
+
sidebar: {
|
|
8637
|
+
types: [
|
|
8638
|
+
"function"
|
|
8639
|
+
],
|
|
8640
|
+
description: "Sidebar content (combat log, unit roster, etc.)"
|
|
8641
|
+
},
|
|
8642
|
+
actions: {
|
|
8643
|
+
types: [
|
|
8644
|
+
"function"
|
|
8645
|
+
],
|
|
8646
|
+
description: "Floating action buttons"
|
|
8647
|
+
},
|
|
8648
|
+
overlay: {
|
|
8649
|
+
types: [
|
|
8650
|
+
"function"
|
|
8651
|
+
],
|
|
8652
|
+
description: "Floating overlays above the canvas (damage popups, tooltips)"
|
|
8653
|
+
},
|
|
8654
|
+
gameOverOverlay: {
|
|
8655
|
+
types: [
|
|
8656
|
+
"function"
|
|
8657
|
+
],
|
|
8658
|
+
description: "Game-over screen overlay"
|
|
8659
|
+
},
|
|
8660
|
+
features: {
|
|
8661
|
+
types: [
|
|
8662
|
+
"array"
|
|
8663
|
+
],
|
|
8664
|
+
description: "-- Obstacle features --"
|
|
8665
|
+
},
|
|
8666
|
+
onAttack: {
|
|
8667
|
+
types: [
|
|
8668
|
+
"function"
|
|
8669
|
+
],
|
|
8670
|
+
description: "-- Callbacks --"
|
|
8671
|
+
},
|
|
8672
|
+
onGameEnd: {
|
|
8673
|
+
types: [
|
|
8674
|
+
"function"
|
|
8675
|
+
],
|
|
8676
|
+
description: "Called when battle ends"
|
|
8677
|
+
},
|
|
8678
|
+
onUnitMove: {
|
|
8679
|
+
types: [
|
|
8680
|
+
"function"
|
|
8681
|
+
],
|
|
8682
|
+
description: "Called after a unit moves"
|
|
8683
|
+
},
|
|
8684
|
+
calculateDamage: {
|
|
8685
|
+
types: [
|
|
8686
|
+
"function"
|
|
8687
|
+
],
|
|
8688
|
+
description: "Custom combat damage calculator"
|
|
8689
|
+
},
|
|
8690
|
+
onDrawEffects: {
|
|
8691
|
+
types: [
|
|
8692
|
+
"function"
|
|
8693
|
+
],
|
|
8694
|
+
description: "-- Canvas pass-through --"
|
|
8695
|
+
},
|
|
8696
|
+
hasActiveEffects: {
|
|
8697
|
+
types: [
|
|
8698
|
+
"boolean"
|
|
8699
|
+
],
|
|
8700
|
+
description: "hasActiveEffects prop"
|
|
8701
|
+
},
|
|
8702
|
+
effectSpriteUrls: {
|
|
8703
|
+
types: [
|
|
8704
|
+
"array"
|
|
8705
|
+
],
|
|
8706
|
+
description: "effectSpriteUrls prop"
|
|
8707
|
+
},
|
|
8708
|
+
resolveUnitFrame: {
|
|
8709
|
+
types: [
|
|
8710
|
+
"function"
|
|
8711
|
+
],
|
|
8712
|
+
description: "resolveUnitFrame prop"
|
|
8713
|
+
},
|
|
8714
|
+
className: {
|
|
8715
|
+
types: [
|
|
8716
|
+
"string"
|
|
8717
|
+
],
|
|
8718
|
+
description: "className prop"
|
|
8719
|
+
}
|
|
8720
|
+
}
|
|
8721
|
+
},
|
|
8722
|
+
"castle-template": {
|
|
8723
|
+
type: "castle-template",
|
|
8724
|
+
category: "template",
|
|
8725
|
+
description: "CastleTemplate Generalized castle / base-management template composing IsometricCanvas from almadar-ui. Renders an isometric courtyard/base view and exposes a side-panel area via slots for game-specific UI (building details, recruitment, garrison).",
|
|
8726
|
+
suggestedFor: [
|
|
8727
|
+
"castle",
|
|
8728
|
+
"template",
|
|
8729
|
+
"castle template"
|
|
8730
|
+
],
|
|
8731
|
+
typicalSize: "full",
|
|
8732
|
+
propsSchema: {
|
|
8733
|
+
tiles: {
|
|
8734
|
+
types: [
|
|
8735
|
+
"array"
|
|
8736
|
+
],
|
|
8737
|
+
description: "Isometric tiles (pre-resolved with terrainSprite)",
|
|
8738
|
+
required: true
|
|
8739
|
+
},
|
|
8740
|
+
features: {
|
|
8741
|
+
types: [
|
|
8742
|
+
"array"
|
|
8743
|
+
],
|
|
8744
|
+
description: "Building features rendered on the grid"
|
|
8745
|
+
},
|
|
8746
|
+
units: {
|
|
8747
|
+
types: [
|
|
8748
|
+
"array"
|
|
8749
|
+
],
|
|
8750
|
+
description: "Garrison / stationed units on the grid"
|
|
8751
|
+
},
|
|
8752
|
+
scale: {
|
|
8753
|
+
types: [
|
|
8754
|
+
"number"
|
|
8755
|
+
],
|
|
8756
|
+
description: "Canvas render scale"
|
|
8757
|
+
},
|
|
8758
|
+
assetManifest: {
|
|
8759
|
+
types: [
|
|
8760
|
+
"object"
|
|
8761
|
+
],
|
|
8762
|
+
description: "Asset manifest for IsometricCanvas"
|
|
8763
|
+
},
|
|
8764
|
+
backgroundImage: {
|
|
8765
|
+
types: [
|
|
8766
|
+
"string"
|
|
8767
|
+
],
|
|
8768
|
+
description: "Background image URL"
|
|
8769
|
+
},
|
|
8770
|
+
header: {
|
|
8771
|
+
types: [
|
|
8772
|
+
"function"
|
|
8773
|
+
],
|
|
8774
|
+
description: "-- Slots --"
|
|
8775
|
+
},
|
|
8776
|
+
sidePanel: {
|
|
8777
|
+
types: [
|
|
8778
|
+
"function"
|
|
8779
|
+
],
|
|
8780
|
+
description: "Side panel content (buildings list, recruit tab, garrison tab)"
|
|
8781
|
+
},
|
|
8782
|
+
overlay: {
|
|
8783
|
+
types: [
|
|
8784
|
+
"function"
|
|
8785
|
+
],
|
|
8786
|
+
description: "Canvas overlay (hover tooltips, etc.)"
|
|
8787
|
+
},
|
|
8788
|
+
footer: {
|
|
8789
|
+
types: [
|
|
8790
|
+
"function"
|
|
8791
|
+
],
|
|
8792
|
+
description: "Bottom bar (income summary, etc.)"
|
|
8793
|
+
},
|
|
8794
|
+
onFeatureClick: {
|
|
8795
|
+
types: [
|
|
8796
|
+
"function"
|
|
8797
|
+
],
|
|
8798
|
+
description: "-- Callbacks --"
|
|
8799
|
+
},
|
|
8800
|
+
onUnitClick: {
|
|
8801
|
+
types: [
|
|
8802
|
+
"function"
|
|
8803
|
+
],
|
|
8804
|
+
description: "Called when a unit is clicked"
|
|
8805
|
+
},
|
|
8806
|
+
onTileClick: {
|
|
8807
|
+
types: [
|
|
8808
|
+
"function"
|
|
8809
|
+
],
|
|
8810
|
+
description: "Called when any tile is clicked"
|
|
8811
|
+
},
|
|
8812
|
+
className: {
|
|
8813
|
+
types: [
|
|
8814
|
+
"string"
|
|
8815
|
+
],
|
|
8816
|
+
description: "className prop"
|
|
8817
|
+
}
|
|
8818
|
+
}
|
|
8819
|
+
},
|
|
8820
|
+
"world-map-template": {
|
|
8821
|
+
type: "world-map-template",
|
|
8822
|
+
category: "template",
|
|
8823
|
+
description: "WorldMapTemplate Generalized strategic world-map template composing IsometricCanvas from almadar-ui. Renders an isometric hex/iso map with hero selection, movement animation, and encounter callbacks. Game-specific panels (hero detail, hero lists, resource bars) are injected via render-prop slots.",
|
|
8824
|
+
suggestedFor: [
|
|
8825
|
+
"world",
|
|
8826
|
+
"map",
|
|
8827
|
+
"template",
|
|
8828
|
+
"world map template"
|
|
8829
|
+
],
|
|
8830
|
+
typicalSize: "full",
|
|
8831
|
+
propsSchema: {
|
|
8832
|
+
hexes: {
|
|
8833
|
+
types: [
|
|
8834
|
+
"array"
|
|
8835
|
+
],
|
|
8836
|
+
description: "All map hexes (with pre-resolved terrain sprites)",
|
|
8837
|
+
required: true
|
|
8838
|
+
},
|
|
8839
|
+
heroes: {
|
|
8840
|
+
types: [
|
|
8841
|
+
"array"
|
|
8842
|
+
],
|
|
8843
|
+
description: "Heroes on the map",
|
|
8844
|
+
required: true
|
|
8845
|
+
},
|
|
8846
|
+
features: {
|
|
8847
|
+
types: [
|
|
8848
|
+
"array"
|
|
8849
|
+
],
|
|
8850
|
+
description: "Features rendered on tiles"
|
|
8851
|
+
},
|
|
8852
|
+
selectedHeroId: {
|
|
8853
|
+
types: [
|
|
8854
|
+
"string"
|
|
8855
|
+
],
|
|
8856
|
+
description: "Currently selected hero ID"
|
|
8857
|
+
},
|
|
8858
|
+
scale: {
|
|
8859
|
+
types: [
|
|
8860
|
+
"number"
|
|
8861
|
+
],
|
|
8862
|
+
description: "Canvas render scale"
|
|
8863
|
+
},
|
|
8864
|
+
unitScale: {
|
|
8865
|
+
types: [
|
|
8866
|
+
"number"
|
|
8867
|
+
],
|
|
8868
|
+
description: "Unit draw-size multiplier"
|
|
8869
|
+
},
|
|
8870
|
+
assetManifest: {
|
|
8871
|
+
types: [
|
|
8872
|
+
"object"
|
|
8873
|
+
],
|
|
8874
|
+
description: "Asset manifest for IsometricCanvas"
|
|
8875
|
+
},
|
|
8876
|
+
backgroundImage: {
|
|
8877
|
+
types: [
|
|
8878
|
+
"string"
|
|
8879
|
+
],
|
|
8880
|
+
description: "Background image URL"
|
|
8881
|
+
},
|
|
8882
|
+
allowMoveAllHeroes: {
|
|
8883
|
+
types: [
|
|
8884
|
+
"boolean"
|
|
8885
|
+
],
|
|
8886
|
+
description: "Allow selecting / moving ALL heroes (including enemy). For testing."
|
|
8887
|
+
},
|
|
8888
|
+
isInRange: {
|
|
8889
|
+
types: [
|
|
8890
|
+
"function"
|
|
8891
|
+
],
|
|
8892
|
+
description: "Custom movement range validator"
|
|
8893
|
+
},
|
|
8894
|
+
header: {
|
|
8895
|
+
types: [
|
|
8896
|
+
"function"
|
|
8897
|
+
],
|
|
8898
|
+
description: "-- Slots --"
|
|
8899
|
+
},
|
|
8900
|
+
sidePanel: {
|
|
8901
|
+
types: [
|
|
8902
|
+
"function"
|
|
8903
|
+
],
|
|
8904
|
+
description: "Side panel (hero detail, hero lists, etc.)"
|
|
8905
|
+
},
|
|
8906
|
+
overlay: {
|
|
8907
|
+
types: [
|
|
8908
|
+
"function"
|
|
8909
|
+
],
|
|
8910
|
+
description: "Canvas overlay (tooltips, popups)"
|
|
8911
|
+
},
|
|
8912
|
+
footer: {
|
|
8913
|
+
types: [
|
|
8914
|
+
"function"
|
|
8915
|
+
],
|
|
8916
|
+
description: "Footer"
|
|
8917
|
+
},
|
|
8918
|
+
onHeroSelect: {
|
|
8919
|
+
types: [
|
|
8920
|
+
"function"
|
|
8921
|
+
],
|
|
8922
|
+
description: "-- Callbacks --"
|
|
8923
|
+
},
|
|
8924
|
+
onHeroMove: {
|
|
8925
|
+
types: [
|
|
8926
|
+
"function"
|
|
8927
|
+
],
|
|
8928
|
+
description: "onHeroMove prop"
|
|
8929
|
+
},
|
|
8930
|
+
onBattleEncounter: {
|
|
8931
|
+
types: [
|
|
8932
|
+
"function"
|
|
8933
|
+
],
|
|
8934
|
+
description: "Called when hero clicks an enemy hero tile"
|
|
8935
|
+
},
|
|
8936
|
+
onFeatureEnter: {
|
|
8937
|
+
types: [
|
|
8938
|
+
"function"
|
|
8939
|
+
],
|
|
8940
|
+
description: "Called when hero enters a feature hex (castle, resource, etc.)"
|
|
8941
|
+
},
|
|
8942
|
+
effectSpriteUrls: {
|
|
8943
|
+
types: [
|
|
8944
|
+
"array"
|
|
8945
|
+
],
|
|
8946
|
+
description: "-- Canvas pass-through --"
|
|
8947
|
+
},
|
|
8948
|
+
resolveUnitFrame: {
|
|
8949
|
+
types: [
|
|
8950
|
+
"function"
|
|
8951
|
+
],
|
|
8952
|
+
description: "resolveUnitFrame prop"
|
|
8953
|
+
},
|
|
8954
|
+
className: {
|
|
8955
|
+
types: [
|
|
8956
|
+
"string"
|
|
8957
|
+
],
|
|
8958
|
+
description: "className prop"
|
|
8959
|
+
}
|
|
8960
|
+
}
|
|
8961
|
+
},
|
|
8962
|
+
heading: {
|
|
8963
|
+
type: "heading",
|
|
8964
|
+
category: "component",
|
|
8965
|
+
description: "Alias for typography \u2014 Typography Atom Component Text elements following the KFlow design system with theme-aware styling.",
|
|
8966
|
+
suggestedFor: [
|
|
8967
|
+
"typography"
|
|
8968
|
+
],
|
|
8969
|
+
typicalSize: "small",
|
|
8970
|
+
propsSchema: {
|
|
8971
|
+
variant: {
|
|
8972
|
+
types: [
|
|
8973
|
+
"typographyvariant"
|
|
8974
|
+
],
|
|
8975
|
+
description: "Typography variant"
|
|
8976
|
+
},
|
|
8977
|
+
level: {
|
|
8978
|
+
types: [
|
|
8979
|
+
"number"
|
|
8980
|
+
],
|
|
8981
|
+
description: "Heading level (1-6) - alternative to variant for headings"
|
|
8982
|
+
},
|
|
8983
|
+
color: {
|
|
8984
|
+
types: [
|
|
8985
|
+
"string"
|
|
8986
|
+
],
|
|
8987
|
+
description: "Text color"
|
|
8988
|
+
},
|
|
8989
|
+
align: {
|
|
8990
|
+
types: [
|
|
8991
|
+
"string"
|
|
8992
|
+
],
|
|
8993
|
+
description: "Text alignment"
|
|
8994
|
+
},
|
|
8995
|
+
weight: {
|
|
8996
|
+
types: [
|
|
8997
|
+
"string"
|
|
8998
|
+
],
|
|
8999
|
+
description: "Font weight override"
|
|
9000
|
+
},
|
|
9001
|
+
size: {
|
|
9002
|
+
types: [
|
|
9003
|
+
"typographysize"
|
|
9004
|
+
],
|
|
9005
|
+
description: "Font size override"
|
|
9006
|
+
},
|
|
9007
|
+
truncate: {
|
|
9008
|
+
types: [
|
|
9009
|
+
"boolean"
|
|
9010
|
+
],
|
|
9011
|
+
description: "Truncate with ellipsis (single line)"
|
|
9012
|
+
},
|
|
9013
|
+
overflow: {
|
|
9014
|
+
types: [
|
|
9015
|
+
"string"
|
|
9016
|
+
],
|
|
9017
|
+
description: "Overflow handling mode"
|
|
9018
|
+
},
|
|
9019
|
+
as: {
|
|
9020
|
+
types: [
|
|
9021
|
+
"unknown"
|
|
9022
|
+
],
|
|
9023
|
+
description: "Custom HTML element"
|
|
9024
|
+
},
|
|
9025
|
+
id: {
|
|
9026
|
+
types: [
|
|
9027
|
+
"string"
|
|
9028
|
+
],
|
|
9029
|
+
description: "HTML id attribute"
|
|
9030
|
+
},
|
|
9031
|
+
className: {
|
|
9032
|
+
types: [
|
|
9033
|
+
"string"
|
|
9034
|
+
],
|
|
9035
|
+
description: "Additional class names"
|
|
9036
|
+
},
|
|
9037
|
+
style: {
|
|
9038
|
+
types: [
|
|
9039
|
+
"object"
|
|
9040
|
+
],
|
|
9041
|
+
description: "Inline style"
|
|
9042
|
+
},
|
|
9043
|
+
content: {
|
|
9044
|
+
types: [
|
|
9045
|
+
"node"
|
|
9046
|
+
],
|
|
9047
|
+
description: "Text content (alternative to children)"
|
|
9048
|
+
},
|
|
9049
|
+
children: {
|
|
9050
|
+
types: [
|
|
9051
|
+
"node"
|
|
9052
|
+
],
|
|
9053
|
+
description: "Children elements"
|
|
9054
|
+
}
|
|
9055
|
+
}
|
|
9056
|
+
},
|
|
9057
|
+
text: {
|
|
9058
|
+
type: "text",
|
|
9059
|
+
category: "component",
|
|
9060
|
+
description: "Alias for typography \u2014 Typography Atom Component Text elements following the KFlow design system with theme-aware styling.",
|
|
9061
|
+
suggestedFor: [
|
|
9062
|
+
"typography"
|
|
9063
|
+
],
|
|
9064
|
+
typicalSize: "small",
|
|
9065
|
+
propsSchema: {
|
|
9066
|
+
variant: {
|
|
9067
|
+
types: [
|
|
9068
|
+
"typographyvariant"
|
|
9069
|
+
],
|
|
9070
|
+
description: "Typography variant"
|
|
9071
|
+
},
|
|
9072
|
+
level: {
|
|
9073
|
+
types: [
|
|
9074
|
+
"number"
|
|
9075
|
+
],
|
|
9076
|
+
description: "Heading level (1-6) - alternative to variant for headings"
|
|
9077
|
+
},
|
|
9078
|
+
color: {
|
|
9079
|
+
types: [
|
|
9080
|
+
"string"
|
|
9081
|
+
],
|
|
9082
|
+
description: "Text color"
|
|
9083
|
+
},
|
|
9084
|
+
align: {
|
|
9085
|
+
types: [
|
|
9086
|
+
"string"
|
|
9087
|
+
],
|
|
9088
|
+
description: "Text alignment"
|
|
9089
|
+
},
|
|
9090
|
+
weight: {
|
|
9091
|
+
types: [
|
|
9092
|
+
"string"
|
|
9093
|
+
],
|
|
9094
|
+
description: "Font weight override"
|
|
9095
|
+
},
|
|
9096
|
+
size: {
|
|
9097
|
+
types: [
|
|
9098
|
+
"typographysize"
|
|
9099
|
+
],
|
|
9100
|
+
description: "Font size override"
|
|
9101
|
+
},
|
|
9102
|
+
truncate: {
|
|
9103
|
+
types: [
|
|
9104
|
+
"boolean"
|
|
9105
|
+
],
|
|
9106
|
+
description: "Truncate with ellipsis (single line)"
|
|
9107
|
+
},
|
|
9108
|
+
overflow: {
|
|
9109
|
+
types: [
|
|
9110
|
+
"string"
|
|
9111
|
+
],
|
|
9112
|
+
description: "Overflow handling mode"
|
|
9113
|
+
},
|
|
9114
|
+
as: {
|
|
9115
|
+
types: [
|
|
9116
|
+
"unknown"
|
|
9117
|
+
],
|
|
9118
|
+
description: "Custom HTML element"
|
|
9119
|
+
},
|
|
9120
|
+
id: {
|
|
9121
|
+
types: [
|
|
9122
|
+
"string"
|
|
9123
|
+
],
|
|
9124
|
+
description: "HTML id attribute"
|
|
9125
|
+
},
|
|
9126
|
+
className: {
|
|
9127
|
+
types: [
|
|
9128
|
+
"string"
|
|
9129
|
+
],
|
|
9130
|
+
description: "Additional class names"
|
|
9131
|
+
},
|
|
9132
|
+
style: {
|
|
9133
|
+
types: [
|
|
9134
|
+
"object"
|
|
9135
|
+
],
|
|
9136
|
+
description: "Inline style"
|
|
9137
|
+
},
|
|
9138
|
+
content: {
|
|
9139
|
+
types: [
|
|
9140
|
+
"node"
|
|
9141
|
+
],
|
|
9142
|
+
description: "Text content (alternative to children)"
|
|
9143
|
+
},
|
|
9144
|
+
children: {
|
|
9145
|
+
types: [
|
|
9146
|
+
"node"
|
|
9147
|
+
],
|
|
9148
|
+
description: "Children elements"
|
|
9149
|
+
}
|
|
9150
|
+
}
|
|
9151
|
+
}
|
|
9152
|
+
},
|
|
9153
|
+
categories: [
|
|
9154
|
+
"display",
|
|
9155
|
+
"header",
|
|
9156
|
+
"form",
|
|
9157
|
+
"filter",
|
|
9158
|
+
"navigation",
|
|
9159
|
+
"state",
|
|
9160
|
+
"dashboard",
|
|
9161
|
+
"container",
|
|
9162
|
+
"layout",
|
|
9163
|
+
"game",
|
|
9164
|
+
"debug",
|
|
9165
|
+
"meta",
|
|
9166
|
+
"component",
|
|
9167
|
+
"template",
|
|
9168
|
+
"visualization",
|
|
9169
|
+
"media"
|
|
9170
|
+
]
|
|
9171
|
+
};
|
|
9172
|
+
|
|
9173
|
+
// src/integrators-registry.json
|
|
9174
|
+
var integrators_registry_default = {
|
|
9175
|
+
version: "1.0.0",
|
|
9176
|
+
exportedAt: "2026-01-25T00:58:14.172Z",
|
|
9177
|
+
integrators: {
|
|
9178
|
+
youtube: {
|
|
9179
|
+
name: "youtube",
|
|
9180
|
+
description: "YouTube Data API - search videos, get video/channel details",
|
|
9181
|
+
category: "media",
|
|
9182
|
+
actions: [
|
|
9183
|
+
{
|
|
9184
|
+
name: "search",
|
|
9185
|
+
description: "Search for videos",
|
|
9186
|
+
params: [
|
|
9187
|
+
{
|
|
9188
|
+
name: "query",
|
|
9189
|
+
type: "string",
|
|
9190
|
+
required: true,
|
|
9191
|
+
description: "Search query"
|
|
9192
|
+
},
|
|
9193
|
+
{
|
|
9194
|
+
name: "maxResults",
|
|
9195
|
+
type: "number",
|
|
9196
|
+
required: false,
|
|
9197
|
+
description: "Max results (1-50)"
|
|
9198
|
+
},
|
|
9199
|
+
{
|
|
9200
|
+
name: "type",
|
|
9201
|
+
type: "string",
|
|
9202
|
+
required: false,
|
|
9203
|
+
description: "video, channel, or playlist"
|
|
9204
|
+
}
|
|
9205
|
+
],
|
|
9206
|
+
responseShape: {
|
|
9207
|
+
videoId: "string",
|
|
9208
|
+
title: "string",
|
|
9209
|
+
thumbnail: "string",
|
|
9210
|
+
description: "string"
|
|
9211
|
+
}
|
|
9212
|
+
},
|
|
9213
|
+
{
|
|
9214
|
+
name: "getVideo",
|
|
9215
|
+
description: "Get video details by ID",
|
|
9216
|
+
params: [
|
|
9217
|
+
{
|
|
9218
|
+
name: "videoId",
|
|
9219
|
+
type: "string",
|
|
9220
|
+
required: true,
|
|
9221
|
+
description: "YouTube video ID"
|
|
9222
|
+
}
|
|
8496
9223
|
],
|
|
8497
9224
|
responseShape: {
|
|
8498
9225
|
title: "string",
|
|
@@ -8948,7 +9675,7 @@ var integrators_registry_default = {
|
|
|
8948
9675
|
// src/component-mapping.json
|
|
8949
9676
|
var component_mapping_default = {
|
|
8950
9677
|
version: "1.0.0",
|
|
8951
|
-
exportedAt: "2026-02-
|
|
9678
|
+
exportedAt: "2026-02-10T15:35:56.769Z",
|
|
8952
9679
|
mappings: {
|
|
8953
9680
|
"page-header": {
|
|
8954
9681
|
component: "PageHeader",
|
|
@@ -8986,7 +9713,7 @@ var component_mapping_default = {
|
|
|
8986
9713
|
category: "form"
|
|
8987
9714
|
},
|
|
8988
9715
|
"form-section": {
|
|
8989
|
-
component: "
|
|
9716
|
+
component: "Form",
|
|
8990
9717
|
importPath: "@/components/organisms/Form",
|
|
8991
9718
|
category: "form"
|
|
8992
9719
|
},
|
|
@@ -9587,6 +10314,31 @@ var component_mapping_default = {
|
|
|
9587
10314
|
component: "IsometricCanvas",
|
|
9588
10315
|
importPath: "@/components/organisms/IsometricCanvas",
|
|
9589
10316
|
category: "game"
|
|
10317
|
+
},
|
|
10318
|
+
"battle-template": {
|
|
10319
|
+
component: "BattleTemplate",
|
|
10320
|
+
importPath: "@/components/templates/BattleTemplate",
|
|
10321
|
+
category: "template"
|
|
10322
|
+
},
|
|
10323
|
+
"castle-template": {
|
|
10324
|
+
component: "CastleTemplate",
|
|
10325
|
+
importPath: "@/components/templates/CastleTemplate",
|
|
10326
|
+
category: "template"
|
|
10327
|
+
},
|
|
10328
|
+
"world-map-template": {
|
|
10329
|
+
component: "WorldMapTemplate",
|
|
10330
|
+
importPath: "@/components/templates/WorldMapTemplate",
|
|
10331
|
+
category: "template"
|
|
10332
|
+
},
|
|
10333
|
+
heading: {
|
|
10334
|
+
component: "Typography",
|
|
10335
|
+
importPath: "@/components/atoms/Typography",
|
|
10336
|
+
category: "component"
|
|
10337
|
+
},
|
|
10338
|
+
text: {
|
|
10339
|
+
component: "Typography",
|
|
10340
|
+
importPath: "@/components/atoms/Typography",
|
|
10341
|
+
category: "component"
|
|
9590
10342
|
}
|
|
9591
10343
|
}
|
|
9592
10344
|
};
|
|
@@ -9594,7 +10346,7 @@ var component_mapping_default = {
|
|
|
9594
10346
|
// src/event-contracts.json
|
|
9595
10347
|
var event_contracts_default = {
|
|
9596
10348
|
version: "1.0.0",
|
|
9597
|
-
exportedAt: "2026-02-
|
|
10349
|
+
exportedAt: "2026-02-10T15:35:56.769Z",
|
|
9598
10350
|
contracts: {
|
|
9599
10351
|
form: {
|
|
9600
10352
|
emits: [
|
|
@@ -9636,17 +10388,31 @@ var event_contracts_default = {
|
|
|
9636
10388
|
"form-section": {
|
|
9637
10389
|
emits: [
|
|
9638
10390
|
{
|
|
9639
|
-
event: "
|
|
9640
|
-
trigger: "
|
|
10391
|
+
event: "GLOBAL_VARIABLE_SET",
|
|
10392
|
+
trigger: "action",
|
|
9641
10393
|
payload: {
|
|
9642
|
-
type: "
|
|
10394
|
+
type: "object"
|
|
9643
10395
|
}
|
|
9644
10396
|
},
|
|
9645
10397
|
{
|
|
9646
|
-
event: "
|
|
9647
|
-
trigger: "
|
|
10398
|
+
event: "VIOLATION_DETECTED",
|
|
10399
|
+
trigger: "action",
|
|
9648
10400
|
payload: {
|
|
9649
|
-
type: "
|
|
10401
|
+
type: "object"
|
|
10402
|
+
}
|
|
10403
|
+
},
|
|
10404
|
+
{
|
|
10405
|
+
event: "FIELD_CHANGED",
|
|
10406
|
+
trigger: "action",
|
|
10407
|
+
payload: {
|
|
10408
|
+
type: "object"
|
|
10409
|
+
}
|
|
10410
|
+
},
|
|
10411
|
+
{
|
|
10412
|
+
event: "CLOSE",
|
|
10413
|
+
trigger: "action",
|
|
10414
|
+
payload: {
|
|
10415
|
+
type: "object"
|
|
9650
10416
|
}
|
|
9651
10417
|
}
|
|
9652
10418
|
],
|
|
@@ -9654,7 +10420,7 @@ var event_contracts_default = {
|
|
|
9654
10420
|
"SAVE",
|
|
9655
10421
|
"CANCEL"
|
|
9656
10422
|
],
|
|
9657
|
-
entityAware:
|
|
10423
|
+
entityAware: true
|
|
9658
10424
|
},
|
|
9659
10425
|
"form-actions": {
|
|
9660
10426
|
emits: [
|
|
@@ -10518,12 +11284,14 @@ var PATTERN_TYPES = [
|
|
|
10518
11284
|
"auth-layout",
|
|
10519
11285
|
"avatar",
|
|
10520
11286
|
"badge",
|
|
11287
|
+
"battle-template",
|
|
10521
11288
|
"box",
|
|
10522
11289
|
"breadcrumb",
|
|
10523
11290
|
"button",
|
|
10524
11291
|
"button-pattern",
|
|
10525
11292
|
"canvas-effect",
|
|
10526
11293
|
"card",
|
|
11294
|
+
"castle-template",
|
|
10527
11295
|
"center",
|
|
10528
11296
|
"chart",
|
|
10529
11297
|
"checkbox",
|
|
@@ -10628,7 +11396,8 @@ var PATTERN_TYPES = [
|
|
|
10628
11396
|
"violation-alert",
|
|
10629
11397
|
"wizard-container",
|
|
10630
11398
|
"wizard-navigation",
|
|
10631
|
-
"wizard-progress"
|
|
11399
|
+
"wizard-progress",
|
|
11400
|
+
"world-map-template"
|
|
10632
11401
|
];
|
|
10633
11402
|
function isValidPatternType(type) {
|
|
10634
11403
|
return PATTERN_TYPES.includes(type);
|
|
@@ -10715,6 +11484,161 @@ function getPatternMetadata(patternType) {
|
|
|
10715
11484
|
return patterns[patternType] || null;
|
|
10716
11485
|
}
|
|
10717
11486
|
|
|
11487
|
+
// src/helpers/pattern-recommender.ts
|
|
11488
|
+
var DOMAIN_KEYWORDS = {
|
|
11489
|
+
business: ["admin panels", "data-dense views", "list pages", "data entry", "comparisons"],
|
|
11490
|
+
dashboard: ["dashboards", "analytics", "overview pages", "overview screens", "data visualization", "reporting", "KPI indicators"],
|
|
11491
|
+
"e-commerce": ["visual items", "images", "previews", "data entry", "list pages"],
|
|
11492
|
+
content: ["visual items", "images", "previews", "media", "pages with multiple views"],
|
|
11493
|
+
social: ["activity logs", "visual items", "previews"],
|
|
11494
|
+
workflow: ["process tracking", "workflow steps", "multi-step forms", "wizards"],
|
|
11495
|
+
form: ["data entry", "create forms", "edit forms", "multi-step forms"],
|
|
11496
|
+
game: ["game", "real-time", "interactive"]
|
|
11497
|
+
};
|
|
11498
|
+
var EVENT_KEYWORDS = {
|
|
11499
|
+
INIT: ["list pages", "overview pages", "dashboards", "admin panels"],
|
|
11500
|
+
CREATE: ["create forms", "data entry", "multi-step forms"],
|
|
11501
|
+
EDIT: ["edit forms", "data entry"],
|
|
11502
|
+
VIEW: ["detail pages", "entity management", "pages with multiple views"],
|
|
11503
|
+
DELETE: ["destructive actions", "confirmations"],
|
|
11504
|
+
FILTER: ["filterable data", "search functionality", "quick filters"]
|
|
11505
|
+
};
|
|
11506
|
+
var SLOT_CATEGORY_AFFINITY = {
|
|
11507
|
+
main: ["display", "dashboard", "filter", "header", "layout", "visualization", "navigation", "template"],
|
|
11508
|
+
modal: ["form", "container", "state"],
|
|
11509
|
+
drawer: ["display", "form", "navigation"],
|
|
11510
|
+
sidebar: ["navigation", "filter"],
|
|
11511
|
+
overlay: ["container", "state"]
|
|
11512
|
+
};
|
|
11513
|
+
var STATE_CATEGORY_AFFINITY = {
|
|
11514
|
+
Browsing: ["display", "filter", "header", "dashboard", "visualization"],
|
|
11515
|
+
Creating: ["form", "navigation"],
|
|
11516
|
+
Editing: ["form", "navigation"],
|
|
11517
|
+
Viewing: ["display", "navigation"],
|
|
11518
|
+
Deleting: ["container", "state"]
|
|
11519
|
+
};
|
|
11520
|
+
function recommendPatterns(context, maxResults = 10) {
|
|
11521
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
11522
|
+
const scores = /* @__PURE__ */ new Map();
|
|
11523
|
+
const domainKeywords = context.domainCategory ? DOMAIN_KEYWORDS[context.domainCategory] || [] : [];
|
|
11524
|
+
const eventKeywords = context.event ? EVENT_KEYWORDS[context.event] || [] : [];
|
|
11525
|
+
const slotCategories = context.slot ? SLOT_CATEGORY_AFFINITY[context.slot] || [] : [];
|
|
11526
|
+
const stateCategories = context.state ? STATE_CATEGORY_AFFINITY[context.state] || [] : [];
|
|
11527
|
+
for (const [patternName, patternDef] of Object.entries(patterns)) {
|
|
11528
|
+
const suggestedFor = patternDef.suggestedFor || [];
|
|
11529
|
+
const category = patternDef.category || "";
|
|
11530
|
+
let score = 0;
|
|
11531
|
+
const reasons = [];
|
|
11532
|
+
if (category === "game" && context.domainCategory !== "game") continue;
|
|
11533
|
+
if (category === "debug") continue;
|
|
11534
|
+
if (category === "template") continue;
|
|
11535
|
+
for (const keyword of domainKeywords) {
|
|
11536
|
+
if (suggestedFor.some((sf) => sf.toLowerCase().includes(keyword.toLowerCase()))) {
|
|
11537
|
+
score += 30;
|
|
11538
|
+
reasons.push(`domain:${keyword}`);
|
|
11539
|
+
break;
|
|
11540
|
+
}
|
|
11541
|
+
}
|
|
11542
|
+
for (const keyword of eventKeywords) {
|
|
11543
|
+
if (suggestedFor.some((sf) => sf.toLowerCase().includes(keyword.toLowerCase()))) {
|
|
11544
|
+
score += 25;
|
|
11545
|
+
reasons.push(`event:${keyword}`);
|
|
11546
|
+
break;
|
|
11547
|
+
}
|
|
11548
|
+
}
|
|
11549
|
+
if (slotCategories.includes(category)) {
|
|
11550
|
+
score += 20;
|
|
11551
|
+
reasons.push(`slot:${context.slot}`);
|
|
11552
|
+
}
|
|
11553
|
+
if (stateCategories.includes(category)) {
|
|
11554
|
+
score += 15;
|
|
11555
|
+
reasons.push(`state:${context.state}`);
|
|
11556
|
+
}
|
|
11557
|
+
if (context.hasEnumFields && ["filter-group", "tabs", "badge"].includes(patternName)) {
|
|
11558
|
+
score += 10;
|
|
11559
|
+
reasons.push("enum-fields");
|
|
11560
|
+
}
|
|
11561
|
+
if (context.hasDateFields && ["timeline", "chart"].includes(patternName)) {
|
|
11562
|
+
score += 10;
|
|
11563
|
+
reasons.push("date-fields");
|
|
11564
|
+
}
|
|
11565
|
+
if (context.hasNumericFields && ["stats", "chart", "meter", "progress-bar"].includes(patternName)) {
|
|
11566
|
+
score += 10;
|
|
11567
|
+
reasons.push("numeric-fields");
|
|
11568
|
+
}
|
|
11569
|
+
if (context.hasRelationFields && ["tabs", "master-detail"].includes(patternName)) {
|
|
11570
|
+
score += 10;
|
|
11571
|
+
reasons.push("relation-fields");
|
|
11572
|
+
}
|
|
11573
|
+
if (context.hasMediaFields && ["entity-cards", "media-gallery"].includes(patternName)) {
|
|
11574
|
+
score += 10;
|
|
11575
|
+
reasons.push("media-fields");
|
|
11576
|
+
}
|
|
11577
|
+
if (category === "display" || category === "dashboard") {
|
|
11578
|
+
const propsSchema = patternDef.propsSchema || {};
|
|
11579
|
+
if ("entity" in propsSchema) {
|
|
11580
|
+
score += 5;
|
|
11581
|
+
reasons.push("entity-aware");
|
|
11582
|
+
}
|
|
11583
|
+
}
|
|
11584
|
+
if (score > 0) {
|
|
11585
|
+
scores.set(patternName, { score, reasons });
|
|
11586
|
+
}
|
|
11587
|
+
}
|
|
11588
|
+
const ranked = [...scores.entries()].sort((a, b) => b[1].score - a[1].score).slice(0, maxResults);
|
|
11589
|
+
return ranked.map(([patternName, { score, reasons }]) => {
|
|
11590
|
+
const patternDef = patterns[patternName];
|
|
11591
|
+
const propsSchema = patternDef.propsSchema || {};
|
|
11592
|
+
const keyProps = Object.keys(propsSchema).filter((k) => propsSchema[k]?.required === true).slice(0, 5);
|
|
11593
|
+
if (keyProps.length === 0) {
|
|
11594
|
+
const meaningful = Object.keys(propsSchema).filter(
|
|
11595
|
+
(k) => !["className", "isLoading", "error", "entity"].includes(k)
|
|
11596
|
+
);
|
|
11597
|
+
keyProps.push(...meaningful.slice(0, 4));
|
|
11598
|
+
}
|
|
11599
|
+
return {
|
|
11600
|
+
pattern: patternName,
|
|
11601
|
+
score,
|
|
11602
|
+
reason: reasons.join(", "),
|
|
11603
|
+
category: patternDef.category || "unknown",
|
|
11604
|
+
description: patternDef.description || patternName,
|
|
11605
|
+
keyProps
|
|
11606
|
+
};
|
|
11607
|
+
});
|
|
11608
|
+
}
|
|
11609
|
+
function buildRecommendationContext(options) {
|
|
11610
|
+
const fields = options.entityFields || [];
|
|
11611
|
+
const fieldTypes = fields.map((f) => f.type);
|
|
11612
|
+
return {
|
|
11613
|
+
state: options.state,
|
|
11614
|
+
event: options.event,
|
|
11615
|
+
slot: options.slot,
|
|
11616
|
+
domainCategory: options.domainCategory,
|
|
11617
|
+
entityFieldTypes: fieldTypes,
|
|
11618
|
+
hasEnumFields: fields.some((f) => f.type === "enum" || f.values && f.values.length > 0),
|
|
11619
|
+
hasDateFields: fields.some((f) => ["date", "datetime", "timestamp"].includes(f.type)),
|
|
11620
|
+
hasNumericFields: fields.some((f) => ["number", "integer", "float", "decimal", "currency"].includes(f.type)),
|
|
11621
|
+
hasRelationFields: fields.some((f) => f.type === "relation"),
|
|
11622
|
+
hasMediaFields: fields.some((f) => ["image", "url", "media", "file"].includes(f.type))
|
|
11623
|
+
};
|
|
11624
|
+
}
|
|
11625
|
+
function formatRecommendationsForPrompt(recommendations) {
|
|
11626
|
+
if (recommendations.length === 0) return "";
|
|
11627
|
+
const lines = [
|
|
11628
|
+
"## Recommended Patterns",
|
|
11629
|
+
"",
|
|
11630
|
+
"| Pattern | Category | Key Props | Why |",
|
|
11631
|
+
"|---------|----------|-----------|-----|"
|
|
11632
|
+
];
|
|
11633
|
+
for (const rec of recommendations) {
|
|
11634
|
+
const props = rec.keyProps.length > 0 ? rec.keyProps.join(", ") : "\u2014";
|
|
11635
|
+
lines.push(`| ${rec.pattern} | ${rec.category} | ${props} | ${rec.reason} |`);
|
|
11636
|
+
}
|
|
11637
|
+
lines.push("");
|
|
11638
|
+
lines.push("Use these patterns where appropriate. Combine multiple for rich INIT transitions.");
|
|
11639
|
+
return lines.join("\n");
|
|
11640
|
+
}
|
|
11641
|
+
|
|
10718
11642
|
// src/index.ts
|
|
10719
11643
|
var registry = patterns_registry_default;
|
|
10720
11644
|
var PATTERN_REGISTRY = patterns_registry_default;
|
|
@@ -10738,6 +11662,6 @@ function isEntityAwarePattern(patternType) {
|
|
|
10738
11662
|
return hasEntityProp && hasDataProp;
|
|
10739
11663
|
}
|
|
10740
11664
|
|
|
10741
|
-
export { COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, component_mapping_default as componentMapping, event_contracts_default as eventContracts, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integrators_registry_default as integratorsRegistry, isEntityAwarePattern, isValidPatternType, patterns_registry_default as patternsRegistry, registry };
|
|
11665
|
+
export { COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, buildRecommendationContext, component_mapping_default as componentMapping, event_contracts_default as eventContracts, formatRecommendationsForPrompt, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integrators_registry_default as integratorsRegistry, isEntityAwarePattern, isValidPatternType, patterns_registry_default as patternsRegistry, recommendPatterns, registry };
|
|
10742
11666
|
//# sourceMappingURL=index.js.map
|
|
10743
11667
|
//# sourceMappingURL=index.js.map
|