@cratis/scene.engine 4.23.0 → 4.24.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/descriptors/componentBadge.ts +41 -0
- package/descriptors/index.ts +7 -0
- package/descriptors/matchComponentQuery.ts +55 -0
- package/descriptors/rankFrequentlyUsedComponents.ts +29 -0
- package/descriptors/validateComponentDescriptors.ts +122 -0
- package/dist/cjs/descriptors/componentBadge.js +35 -0
- package/dist/cjs/descriptors/componentBadge.js.map +1 -0
- package/dist/cjs/descriptors/matchComponentQuery.js +56 -0
- package/dist/cjs/descriptors/matchComponentQuery.js.map +1 -0
- package/dist/cjs/descriptors/rankFrequentlyUsedComponents.js +18 -0
- package/dist/cjs/descriptors/rankFrequentlyUsedComponents.js.map +1 -0
- package/dist/cjs/descriptors/validateComponentDescriptors.js +116 -0
- package/dist/cjs/descriptors/validateComponentDescriptors.js.map +1 -0
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/descriptors/componentBadge.d.ts +3 -0
- package/dist/esm/descriptors/componentBadge.d.ts.map +1 -0
- package/dist/esm/descriptors/componentBadge.js +33 -0
- package/dist/esm/descriptors/componentBadge.js.map +1 -0
- package/dist/esm/descriptors/index.d.ts +5 -0
- package/dist/esm/descriptors/index.d.ts.map +1 -0
- package/dist/esm/descriptors/index.js +5 -0
- package/dist/esm/descriptors/index.js.map +1 -0
- package/dist/esm/descriptors/matchComponentQuery.d.ts +9 -0
- package/dist/esm/descriptors/matchComponentQuery.d.ts.map +1 -0
- package/dist/esm/descriptors/matchComponentQuery.js +54 -0
- package/dist/esm/descriptors/matchComponentQuery.js.map +1 -0
- package/dist/esm/descriptors/rankFrequentlyUsedComponents.d.ts +7 -0
- package/dist/esm/descriptors/rankFrequentlyUsedComponents.d.ts.map +1 -0
- package/dist/esm/descriptors/rankFrequentlyUsedComponents.js +15 -0
- package/dist/esm/descriptors/rankFrequentlyUsedComponents.js.map +1 -0
- package/dist/esm/descriptors/validateComponentDescriptors.d.ts +3 -0
- package/dist/esm/descriptors/validateComponentDescriptors.d.ts.map +1 -0
- package/dist/esm/descriptors/validateComponentDescriptors.js +114 -0
- package/dist/esm/descriptors/validateComponentDescriptors.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.d.ts.map +1 -1
- package/dist/esm/index.js +4 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/tsconfig.tsbuildinfo +1 -1
- package/index.ts +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../descriptors/index.ts"],"names":[],"mappings":"AAGA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../descriptors/index.ts"],"names":[],"mappings":"AAGA,cAAc,gCAAgC,CAAC;AAC/C,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentDescriptor } from '@cratis/scene.model';
|
|
2
|
+
export interface ComponentQueryMatch {
|
|
3
|
+
matched: boolean;
|
|
4
|
+
via?: 'name' | 'category' | 'keyword';
|
|
5
|
+
ranges: [number, number][];
|
|
6
|
+
keyword?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function matchComponentQuery(descriptor: Pick<ComponentDescriptor, 'component' | 'displayName' | 'category' | 'keywords'>, query: string): ComponentQueryMatch;
|
|
9
|
+
//# sourceMappingURL=matchComponentQuery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchComponentQuery.d.ts","sourceRoot":"","sources":["../../../descriptors/matchComponentQuery.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAK1D,MAAM,WAAW,mBAAmB;IAEhC,OAAO,EAAE,OAAO,CAAC;IAGjB,GAAG,CAAC,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC;IAGtC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IAG3B,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAWD,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,IAAI,CAAC,mBAAmB,EAAE,WAAW,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,CAAC,EAAE,KAAK,EAAE,MAAM,GAAG,mBAAmB,CAcpK"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* Decides whether a component is shown for the text typed in a picker's filter, and why.
|
|
5
|
+
*
|
|
6
|
+
* Matching is case-insensitive. The display name (or, when the descriptor has none, the bare component name) and the keywords match by
|
|
7
|
+
* substring. The category matches by the start of one of its words - `nav` finds every Navigation component, while `ta` does not find
|
|
8
|
+
* everything under `Data display`, which a substring match on the category would. A component is shown when any of the three
|
|
9
|
+
* match; it reports the first of name, category, keyword that did, so the picker highlights the name and shows a hint only when a
|
|
10
|
+
* keyword alone brought the component in. An empty filter matches everything and highlights nothing.
|
|
11
|
+
*/ function matchComponentQuery(descriptor, query) {
|
|
12
|
+
const needle = query.trim().toLowerCase();
|
|
13
|
+
if (needle.length === 0) return {
|
|
14
|
+
matched: true,
|
|
15
|
+
ranges: []
|
|
16
|
+
};
|
|
17
|
+
const name = descriptor.displayName ?? descriptor.component.slice(descriptor.component.lastIndexOf(':') + 1);
|
|
18
|
+
const ranges = occurrencesOf(name.toLowerCase(), needle);
|
|
19
|
+
if (ranges.length > 0) return {
|
|
20
|
+
matched: true,
|
|
21
|
+
via: 'name',
|
|
22
|
+
ranges
|
|
23
|
+
};
|
|
24
|
+
if (descriptor.category !== undefined && descriptor.category.toLowerCase().split(/\s+/).some((word)=>word.startsWith(needle))) {
|
|
25
|
+
return {
|
|
26
|
+
matched: true,
|
|
27
|
+
via: 'category',
|
|
28
|
+
ranges: []
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
const keyword = (descriptor.keywords ?? []).find((candidate)=>candidate.toLowerCase().includes(needle));
|
|
32
|
+
return keyword === undefined ? {
|
|
33
|
+
matched: false,
|
|
34
|
+
ranges: []
|
|
35
|
+
} : {
|
|
36
|
+
matched: true,
|
|
37
|
+
via: 'keyword',
|
|
38
|
+
ranges: [],
|
|
39
|
+
keyword
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function occurrencesOf(text, needle) {
|
|
43
|
+
const found = [];
|
|
44
|
+
for(let at = text.indexOf(needle); at >= 0; at = text.indexOf(needle, at + needle.length)){
|
|
45
|
+
found.push([
|
|
46
|
+
at,
|
|
47
|
+
at + needle.length
|
|
48
|
+
]);
|
|
49
|
+
}
|
|
50
|
+
return found;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { matchComponentQuery };
|
|
54
|
+
//# sourceMappingURL=matchComponentQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchComponentQuery.js","sources":["../../../descriptors/matchComponentQuery.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport { ComponentDescriptor } from '@cratis/scene.model';\n\n/**\n * How a component answers a picker's filter text (spec PICK2).\n */\nexport interface ComponentQueryMatch {\n /** The component is shown for this filter. */\n matched: boolean;\n\n /** What matched, strongest first: the display name, the category, or one of the keywords. Absent when nothing matched. */\n via?: 'name' | 'category' | 'keyword';\n\n /** The `[start, end)` ranges of the display name to highlight. Empty unless the name matched. */\n ranges: [number, number][];\n\n /** The keyword the component matched through. Present only when `via` is `keyword`: the picker shows it as a hint. */\n keyword?: string;\n}\n\n/**\n * Decides whether a component is shown for the text typed in a picker's filter, and why.\n *\n * Matching is case-insensitive. The display name (or, when the descriptor has none, the bare component name) and the keywords match by\n * substring. The category matches by the start of one of its words - `nav` finds every Navigation component, while `ta` does not find\n * everything under `Data display`, which a substring match on the category would. A component is shown when any of the three\n * match; it reports the first of name, category, keyword that did, so the picker highlights the name and shows a hint only when a\n * keyword alone brought the component in. An empty filter matches everything and highlights nothing.\n */\nexport function matchComponentQuery(descriptor: Pick<ComponentDescriptor, 'component' | 'displayName' | 'category' | 'keywords'>, query: string): ComponentQueryMatch {\n const needle = query.trim().toLowerCase();\n if (needle.length === 0) return { matched: true, ranges: [] };\n\n const name = descriptor.displayName ?? descriptor.component.slice(descriptor.component.lastIndexOf(':') + 1);\n const ranges = occurrencesOf(name.toLowerCase(), needle);\n if (ranges.length > 0) return { matched: true, via: 'name', ranges };\n\n if (descriptor.category !== undefined && descriptor.category.toLowerCase().split(/\\s+/).some(word => word.startsWith(needle))) {\n return { matched: true, via: 'category', ranges: [] };\n }\n\n const keyword = (descriptor.keywords ?? []).find(candidate => candidate.toLowerCase().includes(needle));\n return keyword === undefined ? { matched: false, ranges: [] } : { matched: true, via: 'keyword', ranges: [], keyword };\n}\n\nfunction occurrencesOf(text: string, needle: string): [number, number][] {\n const found: [number, number][] = [];\n for (let at = text.indexOf(needle); at >= 0; at = text.indexOf(needle, at + needle.length)) {\n found.push([at, at + needle.length]);\n }\n\n return found;\n}\n"],"names":["matchComponentQuery","descriptor","query","needle","trim","toLowerCase","length","matched","ranges","name","displayName","component","slice","lastIndexOf","occurrencesOf","via","category","undefined","split","some","word","startsWith","keyword","keywords","find","candidate","includes","text","found","at","indexOf","push"],"mappings":"AAAA;AACA;AAqBA;;;;;;;;AAQC,IACM,SAASA,mBAAAA,CAAoBC,UAA4F,EAAEC,KAAa,EAAA;AAC3I,IAAA,MAAMC,MAAAA,GAASD,KAAAA,CAAME,IAAI,EAAA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A,MAAAA,EAAQ,EAAE;AAAEc,QAAAA;AAAQ,KAAA;AACzH;AAEA,SAASR,aAAAA,CAAca,IAAY,EAAExB,MAAc,EAAA;AAC/C,IAAA,MAAMyB,QAA4B,EAAE;AACpC,IAAA,IAAK,IAAIC,EAAAA,GAAKF,IAAAA,CAAKG,OAAO,CAAC3B,SAAS0B,EAAAA,IAAM,CAAA,EAAGA,EAAAA,GAAKF,IAAAA,CAAKG,OAAO,CAAC3B,MAAAA,EAAQ0B,EAAAA,GAAK1B,MAAAA,CAAOG,MAAM,CAAA,CAAG;AACxFsB,QAAAA,KAAAA,CAAMG,IAAI,CAAC;AAACF,YAAAA,EAAAA;AAAIA,YAAAA,EAAAA,GAAK1B,OAAOG;AAAO,SAAA,CAAA;AACvC,IAAA;IAEA,OAAOsB,KAAAA;AACX;;"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export interface ComponentUsage {
|
|
2
|
+
count: number;
|
|
3
|
+
last: number;
|
|
4
|
+
}
|
|
5
|
+
export declare const frequentlyUsedLimit = 6;
|
|
6
|
+
export declare function rankFrequentlyUsedComponents(usage: Readonly<Record<string, ComponentUsage>>, limit?: number): string[];
|
|
7
|
+
//# sourceMappingURL=rankFrequentlyUsedComponents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rankFrequentlyUsedComponents.d.ts","sourceRoot":"","sources":["../../../descriptors/rankFrequentlyUsedComponents.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,cAAc;IAE3B,KAAK,EAAE,MAAM,CAAC;IAGd,IAAI,EAAE,MAAM,CAAC;CAChB;AAGD,eAAO,MAAM,mBAAmB,IAAI,CAAC;AAOrC,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC,EAAE,KAAK,GAAE,MAA4B,GAAG,MAAM,EAAE,CAM3I"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
2
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
3
|
+
/**
|
|
4
|
+
* How often and how recently one component was added to a canvas.
|
|
5
|
+
*/ /** The number of components the "Frequently used" group lists (spec PICK3). */ const frequentlyUsedLimit = 6;
|
|
6
|
+
/**
|
|
7
|
+
* The components the "Frequently used" group lists: at most `limit` (6 by default), the most used first, ties broken by the most
|
|
8
|
+
* recent use, and any remaining tie by the component name so the order is stable. Components never used, or whose count is not a
|
|
9
|
+
* positive number, are not listed, so a picker hides the group when this is empty.
|
|
10
|
+
*/ function rankFrequentlyUsedComponents(usage, limit = frequentlyUsedLimit) {
|
|
11
|
+
return Object.entries(usage).filter(([, entry])=>Number.isFinite(entry.count) && entry.count > 0).sort(([leftName, left], [rightName, right])=>right.count - left.count || right.last - left.last || leftName.localeCompare(rightName)).slice(0, Math.max(0, limit)).map(([name])=>name);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export { frequentlyUsedLimit, rankFrequentlyUsedComponents };
|
|
15
|
+
//# sourceMappingURL=rankFrequentlyUsedComponents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rankFrequentlyUsedComponents.js","sources":["../../../descriptors/rankFrequentlyUsedComponents.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\n/**\n * How often and how recently one component was added to a canvas.\n */\nexport interface ComponentUsage {\n /** How many times the component was added. */\n count: number;\n\n /** When it was last added, in milliseconds since the epoch. */\n last: number;\n}\n\n/** The number of components the \"Frequently used\" group lists (spec PICK3). */\nexport const frequentlyUsedLimit = 6;\n\n/**\n * The components the \"Frequently used\" group lists: at most `limit` (6 by default), the most used first, ties broken by the most\n * recent use, and any remaining tie by the component name so the order is stable. Components never used, or whose count is not a\n * positive number, are not listed, so a picker hides the group when this is empty.\n */\nexport function rankFrequentlyUsedComponents(usage: Readonly<Record<string, ComponentUsage>>, limit: number = frequentlyUsedLimit): string[] {\n return Object.entries(usage)\n .filter(([, entry]) => Number.isFinite(entry.count) && entry.count > 0)\n .sort(([leftName, left], [rightName, right]) => right.count - left.count || right.last - left.last || leftName.localeCompare(rightName))\n .slice(0, Math.max(0, limit))\n .map(([name]) => name);\n}\n"],"names":["frequentlyUsedLimit","rankFrequentlyUsedComponents","usage","limit","Object","entries","filter","entry","Number","isFinite","count","sort","leftName","left","rightName","right","last","localeCompare","slice","Math","max","map","name"],"mappings":"AAAA;AACA;AAEA;;AAEC,oFAUM,MAAMA,sBAAsB;AAEnC;;;;AAIC,IACM,SAASC,4BAAAA,CAA6BC,KAA+C,EAAEC,QAAgBH,mBAAmB,EAAA;AAC7H,IAAA,OAAOI,MAAAA,CAAOC,OAAO,CAACH,KAAAA,CAAAA,CACjBI,MAAM,CAAC,CAAC,GAAGC,KAAAA,CAAM,GAAKC,MAAAA,CAAOC,QAAQ,CAACF,KAAAA,CAAMG,KAAK,CAAA,IAAKH,KAAAA,CAAMG,KAAK,GAAG,CAAA,CAAA,CACpEC,IAAI,CAAC,CAAC,CAACC,QAAAA,EAAUC,IAAAA,CAAK,EAAE,CAACC,SAAAA,EAAWC,KAAAA,CAAM,GAAKA,KAAAA,CAAML,KAAK,GAAGG,IAAAA,CAAKH,KAAK,IAAIK,KAAAA,CAAMC,IAAI,GAAGH,IAAAA,CAAKG,IAAI,IAAIJ,QAAAA,CAASK,aAAa,CAACH,SAAAA,CAAAA,CAAAA,CAC5HI,KAAK,CAAC,CAAA,EAAGC,IAAAA,CAAKC,GAAG,CAAC,CAAA,EAAGjB,KAAAA,CAAAA,CAAAA,CACrBkB,GAAG,CAAC,CAAC,CAACC,IAAAA,CAAK,GAAKA,IAAAA,CAAAA;AACzB;;"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { ComponentDescriptor, SceneDiagnostic } from '@cratis/scene.model';
|
|
2
|
+
export declare function validateComponentDescriptors(descriptors: readonly ComponentDescriptor[], registered?: readonly string[], knownCategories?: readonly string[]): SceneDiagnostic[];
|
|
3
|
+
//# sourceMappingURL=validateComponentDescriptors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateComponentDescriptors.d.ts","sourceRoot":"","sources":["../../../descriptors/validateComponentDescriptors.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,mBAAmB,EACnB,eAAe,EAClB,MAAM,qBAAqB,CAAC;AAgB7B,wBAAgB,4BAA4B,CACxC,WAAW,EAAE,SAAS,mBAAmB,EAAE,EAC3C,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,EAC9B,eAAe,GAAE,SAAS,MAAM,EAAwB,GACzD,eAAe,EAAE,CA8BnB"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { componentCategories, DiagnosticSeverity, DiagnosticCode, PropertyValueType, PropertyEditorKind } from '@cratis/scene.model';
|
|
2
|
+
|
|
3
|
+
// Copyright (c) Cratis. All rights reserved.
|
|
4
|
+
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
|
5
|
+
/**
|
|
6
|
+
* Checks the component metadata a package ships - what a picker and a designer read without loading a component.
|
|
7
|
+
*
|
|
8
|
+
* - **CMP1** `componentCategoryMissing` (error): a registered component has no descriptor, or its descriptor declares no category.
|
|
9
|
+
* - `componentCategoryUnknown` (warning): the category is not one of the model's; a package may add its own, so this is a
|
|
10
|
+
* nudge towards the shared vocabulary, not a refusal.
|
|
11
|
+
* - `componentDesignModeInvalid` (error): the design-mode descriptor names an items or collection path that is not a `Collection`
|
|
12
|
+
* property of the component, or repeats an action id.
|
|
13
|
+
* - `propertyEditorOptionsInvalid` (error): an editor's parameters cannot work - a `reference` editor that does not say what it
|
|
14
|
+
* references, a step that is not positive, an empty list of slice kinds.
|
|
15
|
+
*
|
|
16
|
+
* `registered` is the bare or package-qualified names of the components the package registers; when given, each must be described.
|
|
17
|
+
* The result is in a stable order: registered components first (in the order given), then each descriptor's findings in its own order.
|
|
18
|
+
*/ function validateComponentDescriptors(descriptors, registered, knownCategories = componentCategories) {
|
|
19
|
+
const diagnostics = [];
|
|
20
|
+
const described = new Map(descriptors.map((descriptor)=>[
|
|
21
|
+
descriptor.component,
|
|
22
|
+
descriptor
|
|
23
|
+
]));
|
|
24
|
+
for (const component of registered ?? []){
|
|
25
|
+
if (!described.has(component)) {
|
|
26
|
+
diagnostics.push(missingCategory(component, `'${component}' is registered but has no descriptor, so it declares no category`));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
for (const descriptor of descriptors){
|
|
30
|
+
const { component } = descriptor;
|
|
31
|
+
if (descriptor.category === undefined || descriptor.category.trim().length === 0) {
|
|
32
|
+
diagnostics.push(missingCategory(component, `'${component}' declares no category`));
|
|
33
|
+
} else if (!knownCategories.includes(descriptor.category)) {
|
|
34
|
+
diagnostics.push({
|
|
35
|
+
code: DiagnosticCode.ComponentCategoryUnknown,
|
|
36
|
+
severity: DiagnosticSeverity.Warning,
|
|
37
|
+
component,
|
|
38
|
+
message: `'${component}' declares the category '${descriptor.category}', which is not one of ${knownCategories.join(', ')}`
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
if (descriptor.designMode) {
|
|
42
|
+
diagnostics.push(...validateDesignMode(descriptor, descriptor.designMode));
|
|
43
|
+
}
|
|
44
|
+
diagnostics.push(...validateEditorOptions(component, descriptor.properties, ''));
|
|
45
|
+
}
|
|
46
|
+
return diagnostics;
|
|
47
|
+
}
|
|
48
|
+
function missingCategory(component, message) {
|
|
49
|
+
return {
|
|
50
|
+
code: DiagnosticCode.ComponentCategoryMissing,
|
|
51
|
+
severity: DiagnosticSeverity.Error,
|
|
52
|
+
component,
|
|
53
|
+
message
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function invalidDesignMode(component, message) {
|
|
57
|
+
return {
|
|
58
|
+
code: DiagnosticCode.ComponentDesignModeInvalid,
|
|
59
|
+
severity: DiagnosticSeverity.Error,
|
|
60
|
+
component,
|
|
61
|
+
message
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function validateDesignMode(descriptor, designMode) {
|
|
65
|
+
const { component } = descriptor;
|
|
66
|
+
const diagnostics = [];
|
|
67
|
+
const collections = new Set(descriptor.properties.filter((property)=>property.valueType === PropertyValueType.Collection).map((property)=>property.path));
|
|
68
|
+
if (designMode.itemsPath !== undefined && !collections.has(designMode.itemsPath)) {
|
|
69
|
+
diagnostics.push(invalidDesignMode(component, `'${component}' names '${designMode.itemsPath}' as its design-mode items, which is not one of its Collection properties`));
|
|
70
|
+
}
|
|
71
|
+
const seenAdd = new Set();
|
|
72
|
+
for (const action of designMode.addActions){
|
|
73
|
+
if (seenAdd.has(action.id)) diagnostics.push(invalidDesignMode(component, `'${component}' declares the design-mode add action '${action.id}' more than once`));
|
|
74
|
+
seenAdd.add(action.id);
|
|
75
|
+
if (action.collectionPath !== undefined && !collections.has(action.collectionPath)) {
|
|
76
|
+
diagnostics.push(invalidDesignMode(component, `the design-mode add action '${action.id}' of '${component}' adds to '${action.collectionPath}', which is not one of its Collection properties`));
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
const seenItem = new Set();
|
|
80
|
+
for (const action of designMode.itemToolbar){
|
|
81
|
+
if (seenItem.has(action.id)) diagnostics.push(invalidDesignMode(component, `'${component}' declares the design-mode item action '${action.id}' more than once`));
|
|
82
|
+
seenItem.add(action.id);
|
|
83
|
+
}
|
|
84
|
+
return diagnostics;
|
|
85
|
+
}
|
|
86
|
+
function validateEditorOptions(component, properties, parent) {
|
|
87
|
+
const diagnostics = [];
|
|
88
|
+
const invalid = (path, message)=>({
|
|
89
|
+
code: DiagnosticCode.PropertyEditorOptionsInvalid,
|
|
90
|
+
severity: DiagnosticSeverity.Error,
|
|
91
|
+
component,
|
|
92
|
+
path,
|
|
93
|
+
message: `'${component}' property '${path}' ${message}`
|
|
94
|
+
});
|
|
95
|
+
for (const property of properties){
|
|
96
|
+
const path = `${parent}${property.path}`;
|
|
97
|
+
const options = property.editorOptions;
|
|
98
|
+
if (property.editorKind === PropertyEditorKind.Reference && !options?.reference?.target) {
|
|
99
|
+
diagnostics.push(invalid(path, "uses the 'reference' editor without saying what it references (editorOptions.reference.target)"));
|
|
100
|
+
}
|
|
101
|
+
if (options?.step !== undefined && !(options.step > 0)) {
|
|
102
|
+
diagnostics.push(invalid(path, 'declares a step that is not greater than zero'));
|
|
103
|
+
}
|
|
104
|
+
if (options?.kinds !== undefined && options.kinds.length === 0) {
|
|
105
|
+
diagnostics.push(invalid(path, 'declares an empty list of kinds, which would offer nothing'));
|
|
106
|
+
}
|
|
107
|
+
if (property.item) diagnostics.push(...validateEditorOptions(component, property.item.properties, `${path}[].`));
|
|
108
|
+
if (property.properties) diagnostics.push(...validateEditorOptions(component, property.properties, `${path}.`));
|
|
109
|
+
}
|
|
110
|
+
return diagnostics;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export { validateComponentDescriptors };
|
|
114
|
+
//# sourceMappingURL=validateComponentDescriptors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validateComponentDescriptors.js","sources":["../../../descriptors/validateComponentDescriptors.ts"],"sourcesContent":["// Copyright (c) Cratis. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nimport {\n ComponentDescriptor, ComponentDesignModeDescriptor, DiagnosticCode, DiagnosticSeverity, PropertyDescriptor, PropertyEditorKind, PropertyValueType,\n SceneDiagnostic, componentCategories,\n} from '@cratis/scene.model';\n\n/**\n * Checks the component metadata a package ships - what a picker and a designer read without loading a component.\n *\n * - **CMP1** `componentCategoryMissing` (error): a registered component has no descriptor, or its descriptor declares no category.\n * - `componentCategoryUnknown` (warning): the category is not one of the model's; a package may add its own, so this is a\n * nudge towards the shared vocabulary, not a refusal.\n * - `componentDesignModeInvalid` (error): the design-mode descriptor names an items or collection path that is not a `Collection`\n * property of the component, or repeats an action id.\n * - `propertyEditorOptionsInvalid` (error): an editor's parameters cannot work - a `reference` editor that does not say what it\n * references, a step that is not positive, an empty list of slice kinds.\n *\n * `registered` is the bare or package-qualified names of the components the package registers; when given, each must be described.\n * The result is in a stable order: registered components first (in the order given), then each descriptor's findings in its own order.\n */\nexport function validateComponentDescriptors(\n descriptors: readonly ComponentDescriptor[],\n registered?: readonly string[],\n knownCategories: readonly string[] = componentCategories\n): SceneDiagnostic[] {\n const diagnostics: SceneDiagnostic[] = [];\n const described = new Map(descriptors.map(descriptor => [descriptor.component, descriptor]));\n\n for (const component of registered ?? []) {\n if (!described.has(component)) {\n diagnostics.push(missingCategory(component, `'${component}' is registered but has no descriptor, so it declares no category`));\n }\n }\n\n for (const descriptor of descriptors) {\n const { component } = descriptor;\n\n if (descriptor.category === undefined || descriptor.category.trim().length === 0) {\n diagnostics.push(missingCategory(component, `'${component}' declares no category`));\n } else if (!knownCategories.includes(descriptor.category)) {\n diagnostics.push({\n code: DiagnosticCode.ComponentCategoryUnknown, severity: DiagnosticSeverity.Warning, component,\n message: `'${component}' declares the category '${descriptor.category}', which is not one of ${knownCategories.join(', ')}`,\n });\n }\n\n if (descriptor.designMode) {\n diagnostics.push(...validateDesignMode(descriptor, descriptor.designMode));\n }\n\n diagnostics.push(...validateEditorOptions(component, descriptor.properties, ''));\n }\n\n return diagnostics;\n}\n\nfunction missingCategory(component: string, message: string): SceneDiagnostic {\n return { code: DiagnosticCode.ComponentCategoryMissing, severity: DiagnosticSeverity.Error, component, message };\n}\n\nfunction invalidDesignMode(component: string, message: string): SceneDiagnostic {\n return { code: DiagnosticCode.ComponentDesignModeInvalid, severity: DiagnosticSeverity.Error, component, message };\n}\n\nfunction validateDesignMode(descriptor: ComponentDescriptor, designMode: ComponentDesignModeDescriptor): SceneDiagnostic[] {\n const { component } = descriptor;\n const diagnostics: SceneDiagnostic[] = [];\n const collections = new Set(descriptor.properties.filter(property => property.valueType === PropertyValueType.Collection).map(property => property.path));\n\n if (designMode.itemsPath !== undefined && !collections.has(designMode.itemsPath)) {\n diagnostics.push(invalidDesignMode(component, `'${component}' names '${designMode.itemsPath}' as its design-mode items, which is not one of its Collection properties`));\n }\n\n const seenAdd = new Set<string>();\n for (const action of designMode.addActions) {\n if (seenAdd.has(action.id)) diagnostics.push(invalidDesignMode(component, `'${component}' declares the design-mode add action '${action.id}' more than once`));\n seenAdd.add(action.id);\n\n if (action.collectionPath !== undefined && !collections.has(action.collectionPath)) {\n diagnostics.push(invalidDesignMode(component, `the design-mode add action '${action.id}' of '${component}' adds to '${action.collectionPath}', which is not one of its Collection properties`));\n }\n }\n\n const seenItem = new Set<string>();\n for (const action of designMode.itemToolbar) {\n if (seenItem.has(action.id)) diagnostics.push(invalidDesignMode(component, `'${component}' declares the design-mode item action '${action.id}' more than once`));\n seenItem.add(action.id);\n }\n\n return diagnostics;\n}\n\nfunction validateEditorOptions(component: string, properties: readonly PropertyDescriptor[], parent: string): SceneDiagnostic[] {\n const diagnostics: SceneDiagnostic[] = [];\n const invalid = (path: string, message: string): SceneDiagnostic => ({\n code: DiagnosticCode.PropertyEditorOptionsInvalid, severity: DiagnosticSeverity.Error, component, path, message: `'${component}' property '${path}' ${message}`,\n });\n\n for (const property of properties) {\n const path = `${parent}${property.path}`;\n const options = property.editorOptions;\n\n if (property.editorKind === PropertyEditorKind.Reference && !options?.reference?.target) {\n diagnostics.push(invalid(path, \"uses the 'reference' editor without saying what it references (editorOptions.reference.target)\"));\n }\n\n if (options?.step !== undefined && !(options.step > 0)) {\n diagnostics.push(invalid(path, 'declares a step that is not greater than zero'));\n }\n\n if (options?.kinds !== undefined && options.kinds.length === 0) {\n diagnostics.push(invalid(path, 'declares an empty list of kinds, which would offer nothing'));\n }\n\n if (property.item) diagnostics.push(...validateEditorOptions(component, property.item.properties, `${path}[].`));\n if (property.properties) diagnostics.push(...validateEditorOptions(component, property.properties, `${path}.`));\n }\n\n return diagnostics;\n}\n"],"names":["validateComponentDescriptors","descriptors","registered","knownCategories","componentCategories","diagnostics","described","Map","map","descriptor","component","has","push","missingCategory","category","undefined","trim","length","includes","code","DiagnosticCode","ComponentCategoryUnknown","severity","DiagnosticSeverity","Warning","message","join","designMode","validateDesignMode","validateEditorOptions","properties","ComponentCategoryMissing","Error","invalidDesignMode","ComponentDesignModeInvalid","collections","Set","filter","property","valueType","PropertyValueType","Collection","path","itemsPath","seenAdd","action","addActions","id","add","collectionPath","seenItem","itemToolbar","parent","invalid","PropertyEditorOptionsInvalid","options","editorOptions","editorKind","PropertyEditorKind","Reference","reference","target","step","kinds","item"],"mappings":";;AAAA;AACA;AAOA;;;;;;;;;;;;;IAcO,SAASA,4BAAAA,CACZC,WAA2C,EAC3CC,UAA8B,EAC9BC,kBAAqCC,mBAAmB,EAAA;AAExD,IAAA,MAAMC,cAAiC,EAAE;AACzC,IAAA,MAAMC,YAAY,IAAIC,GAAAA,CAAIN,YAAYO,GAAG,CAACC,CAAAA,UAAAA,GAAc;AAACA,YAAAA,UAAAA,CAAWC,SAAS;AAAED,YAAAA;AAAW,SAAA,CAAA,CAAA;AAE1F,IAAA,KAAK,MAAMC,SAAAA,IAAaR,UAAAA,IAAc,EAAE,CAAE;AACtC,QAAA,IAAI,CAACI,SAAAA,CAAUK,GAAG,CAACD,SAAAA,CAAAA,EAAY;YAC3BL,WAAAA,CAAYO,IAAI,CAACC,eAAAA,CAAgBH,SAAAA,EAAW,CAAC,CAAC,EAAEA,SAAAA,CAAU,iEAAiE,CAAC,CAAA,CAAA;AAChI,QAAA;AACJ,IAAA;IAEA,KAAK,MAAMD,cAAcR,WAAAA,CAAa;QAClC,MAAM,EAAES,SAAS,EAAE,GAAGD,UAAAA;QAEtB,IAAIA,UAAAA,CAAWK,QAAQ,KAAKC,SAAAA,IAAaN,UAAAA,CAAWK,QAAQ,CAACE,IAAI,EAAA,CAAGC,MAAM,KAAK,CAAA,EAAG;YAC9EZ,WAAAA,CAAYO,IAAI,CAACC,eAAAA,CAAgBH,SAAAA,EAAW,CAAC,CAAC,EAAEA,SAAAA,CAAU,sBAAsB,CAAC,CAAA,CA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;QAEtC,IAAIlB,QAAAA,CAASmB,UAAU,KAAKC,kBAAAA,CAAmBC,SAAS,IAAI,CAACJ,OAAAA,EAASK,SAAAA,EAAWC,MAAAA,EAAQ;YACrFxD,WAAAA,CAAYO,IAAI,CAACyC,OAAAA,CAAQX,IAAAA,EAAM,gGAAA,CAAA,CAAA;AACnC,QAAA;QAEA,IAAIa,OAAAA,EAASO,SAAS/C,SAAAA,IAAa,EAAEwC,OAAAA,CAAQO,IAAI,GAAG,CAAA,CAAA,EAAI;YACpDzD,WAAAA,CAAYO,IAAI,CAACyC,OAAAA,CAAQX,IAAAA,EAAM,+CAAA,CAAA,CAAA;AACnC,QAAA;QAEA,IAAIa,OAAAA,EAASQ,UAAUhD,SAAAA,IAAawC,OAAAA,CAAQQ,KAAK,CAAC9C,MAAM,KAAK,CAAA,EAAG;YAC5DZ,WAAAA,CAAYO,IAAI,CAACyC,OAAAA,CAAQX,IAAAA,EAAM,4DAAA,CAAA,CAAA;AACnC,QAAA;AAEA,QAAA,IAAIJ,SAAS0B,IAAI,EAAE3D,WAAAA,CAAYO,IAAI,IAAIiB,qBAAAA,CAAsBnB,SAAAA,EAAW4B,QAAAA,CAAS0B,IAAI,CAAClC,UAAU,EAAE,CAAA,EAAGY,IAAAA,CAAK,GAAG,CAAC,CAAA,CAAA;AAC9G,QAAA,IAAIJ,QAAAA,CAASR,UAAU,EAAEzB,WAAAA,CAAYO,IAAI,CAAA,GAAIiB,qBAAAA,CAAsBnB,SAAAA,EAAW4B,QAAAA,CAASR,UAAU,EAAE,CAAA,EAAGY,IAAAA,CAAK,CAAC,CAAC,CAAA,CAAA;AACjH,IAAA;IAEA,OAAOrC,WAAAA;AACX;;"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './panelKind';
|
|
|
16
16
|
export * from './flowNodeKind';
|
|
17
17
|
export * from './ComponentResolution';
|
|
18
18
|
export * from './icons';
|
|
19
|
+
export * from './descriptors';
|
|
19
20
|
export * from './resolveComponentName';
|
|
20
21
|
export * from './computeSizeClass';
|
|
21
22
|
export * from './evaluateFlowArrangement';
|
package/dist/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAGA,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,SAAS,CAAC;AACxB,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,mCAAmC,CAAC;AAClD,cAAc,0BAA0B,CAAC;AACzC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,aAAa,CAAC;AAC5B,cAAc,uBAAuB,CAAC;AACtC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,cAAc,CAAC;AAC7B,cAAc,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AAW,CAAC;AAC1B,cAAc,aAAa,CAAC"}
|
package/dist/esm/index.js
CHANGED
|
@@ -25,6 +25,10 @@ export { resolveIconLibraries } from './icons/resolveIconLibraries.js';
|
|
|
25
25
|
export { referencesOfEntry } from './icons/EffectiveIconEntry.js';
|
|
26
26
|
export { EffectiveIconCatalog } from './icons/EffectiveIconCatalog.js';
|
|
27
27
|
export { analyzeIconImpact } from './icons/analyzeIconImpact.js';
|
|
28
|
+
export { validateComponentDescriptors } from './descriptors/validateComponentDescriptors.js';
|
|
29
|
+
export { componentBadge } from './descriptors/componentBadge.js';
|
|
30
|
+
export { matchComponentQuery } from './descriptors/matchComponentQuery.js';
|
|
31
|
+
export { frequentlyUsedLimit, rankFrequentlyUsedComponents } from './descriptors/rankFrequentlyUsedComponents.js';
|
|
28
32
|
export { corePackage, effectivePackages, resolveComponentName } from './resolveComponentName.js';
|
|
29
33
|
export { computeSizeClass, defaultHeightBreakpoint, defaultWidthBreakpoint } from './computeSizeClass.js';
|
|
30
34
|
export { evaluateFlowArrangement } from './evaluateFlowArrangement.js';
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|