@almadar/patterns 2.6.3 → 2.7.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.d.ts +20 -1
- package/dist/index.js +48 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -22975,6 +22975,25 @@ declare function getAllPatternTypes(): PatternType[];
|
|
|
22975
22975
|
* Get pattern metadata for a specific pattern.
|
|
22976
22976
|
*/
|
|
22977
22977
|
declare function getPatternMetadata(patternType: string): PatternEntry$1 | null;
|
|
22978
|
+
/**
|
|
22979
|
+
* Get patterns allowed in .orb render-ui trees.
|
|
22980
|
+
*
|
|
22981
|
+
* Returns all non-entity patterns (atoms/molecules) plus the allowed
|
|
22982
|
+
* entity-aware exceptions (data-list, data-grid, search-input, form-section, meter).
|
|
22983
|
+
* Excludes game-specific, debug, and template patterns.
|
|
22984
|
+
*
|
|
22985
|
+
* Grouped by registry category with description and key props.
|
|
22986
|
+
*/
|
|
22987
|
+
declare function getOrbAllowedPatterns(): Record<string, Array<{
|
|
22988
|
+
name: string;
|
|
22989
|
+
description: string;
|
|
22990
|
+
keyProps: string[];
|
|
22991
|
+
}>>;
|
|
22992
|
+
/**
|
|
22993
|
+
* Get compact markdown reference of .orb-allowed patterns.
|
|
22994
|
+
* Derives everything from the registry. No hardcoded pattern lists.
|
|
22995
|
+
*/
|
|
22996
|
+
declare function getOrbAllowedPatternsCompact(): string;
|
|
22978
22997
|
|
|
22979
22998
|
/**
|
|
22980
22999
|
* Pattern Recommender
|
|
@@ -48313,4 +48332,4 @@ declare function getComponentForPattern(patternType: string): string | null;
|
|
|
48313
48332
|
*/
|
|
48314
48333
|
declare function isEntityAwarePattern(patternType: string): boolean;
|
|
48315
48334
|
|
|
48316
|
-
export { type AnyPatternConfig, COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, type PatternConfig, type PatternProps, type PatternPropsMap, type PatternRecommendation, type PatternType, type RecommendationContext, buildRecommendationContext, componentMapping, eventContracts, formatRecommendationsForPrompt, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integratorsRegistry, isEntityAwarePattern, isValidPatternType, patternsRegistry, recommendPatterns, registry };
|
|
48335
|
+
export { type AnyPatternConfig, COMPONENT_MAPPING, EVENT_CONTRACTS, INTEGRATORS_REGISTRY, PATTERN_REGISTRY, PATTERN_TYPES, type PatternConfig, type PatternProps, type PatternPropsMap, type PatternRecommendation, type PatternType, type RecommendationContext, buildRecommendationContext, componentMapping, eventContracts, formatRecommendationsForPrompt, generatePatternDescription, getAllPatternTypes, getComponentForPattern, getOrbAllowedPatterns, getOrbAllowedPatternsCompact, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integratorsRegistry, isEntityAwarePattern, isValidPatternType, patternsRegistry, recommendPatterns, registry };
|
package/dist/index.js
CHANGED
|
@@ -20115,6 +20115,53 @@ function getPatternMetadata(patternType) {
|
|
|
20115
20115
|
const patterns = patterns_registry_default.patterns || {};
|
|
20116
20116
|
return patterns[patternType] || null;
|
|
20117
20117
|
}
|
|
20118
|
+
var ORB_ALLOWED_ENTITY_PATTERNS = /* @__PURE__ */ new Set([
|
|
20119
|
+
"data-list",
|
|
20120
|
+
"data-grid",
|
|
20121
|
+
"search-input",
|
|
20122
|
+
"form-section",
|
|
20123
|
+
"meter"
|
|
20124
|
+
]);
|
|
20125
|
+
var ORB_EXCLUDED_CATEGORIES = /* @__PURE__ */ new Set([
|
|
20126
|
+
"game",
|
|
20127
|
+
"debug",
|
|
20128
|
+
"template"
|
|
20129
|
+
]);
|
|
20130
|
+
function getOrbAllowedPatterns() {
|
|
20131
|
+
const patterns = patterns_registry_default.patterns || {};
|
|
20132
|
+
const grouped = {};
|
|
20133
|
+
for (const [name, def] of Object.entries(patterns)) {
|
|
20134
|
+
const cat = def.category || "uncategorized";
|
|
20135
|
+
if (ORB_EXCLUDED_CATEGORIES.has(cat)) continue;
|
|
20136
|
+
if (name.includes("3-d") || name.includes("3d")) continue;
|
|
20137
|
+
const hasEntity = def.propsSchema && "entity" in def.propsSchema;
|
|
20138
|
+
if (hasEntity && !ORB_ALLOWED_ENTITY_PATTERNS.has(name)) continue;
|
|
20139
|
+
const propsSchema = def.propsSchema || {};
|
|
20140
|
+
const keyProps = Object.keys(propsSchema).slice(0, 5);
|
|
20141
|
+
if (!grouped[cat]) grouped[cat] = [];
|
|
20142
|
+
grouped[cat].push({
|
|
20143
|
+
name,
|
|
20144
|
+
description: def.description || "",
|
|
20145
|
+
keyProps
|
|
20146
|
+
});
|
|
20147
|
+
}
|
|
20148
|
+
return grouped;
|
|
20149
|
+
}
|
|
20150
|
+
function getOrbAllowedPatternsCompact() {
|
|
20151
|
+
const grouped = getOrbAllowedPatterns();
|
|
20152
|
+
const lines = [];
|
|
20153
|
+
for (const [cat, items] of Object.entries(grouped).sort()) {
|
|
20154
|
+
lines.push(`#### ${cat} (${items.length})`);
|
|
20155
|
+
lines.push("| Pattern | Description | Key Props |");
|
|
20156
|
+
lines.push("|---------|-------------|-----------|");
|
|
20157
|
+
for (const item of items) {
|
|
20158
|
+
const desc = item.description.split("\n")[0].slice(0, 60);
|
|
20159
|
+
lines.push(`| \`${item.name}\` | ${desc} | ${item.keyProps.join(", ")} |`);
|
|
20160
|
+
}
|
|
20161
|
+
lines.push("");
|
|
20162
|
+
}
|
|
20163
|
+
return lines.join("\n");
|
|
20164
|
+
}
|
|
20118
20165
|
|
|
20119
20166
|
// src/helpers/pattern-recommender.ts
|
|
20120
20167
|
var DOMAIN_KEYWORDS = {
|
|
@@ -20292,6 +20339,6 @@ function isEntityAwarePattern(patternType) {
|
|
|
20292
20339
|
return "entity" in propsSchema;
|
|
20293
20340
|
}
|
|
20294
20341
|
|
|
20295
|
-
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 };
|
|
20342
|
+
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, getOrbAllowedPatterns, getOrbAllowedPatternsCompact, getPatternActionsRef, getPatternDefinition, getPatternMetadata, getPatternPropsCompact, getPatternsGroupedByCategory, integrators_registry_default as integratorsRegistry, isEntityAwarePattern, isValidPatternType, patterns_registry_default as patternsRegistry, recommendPatterns, registry };
|
|
20296
20343
|
//# sourceMappingURL=index.js.map
|
|
20297
20344
|
//# sourceMappingURL=index.js.map
|