@picteus/extension-sdk 0.15.0 → 0.17.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/featureViewGrammar.d.ts +2814 -0
- package/dist/featureViewGrammar.js +2612 -0
- package/dist/generated/featureViewGrammar.d.ts +3913 -0
- package/dist/generated/featureViewGrammar.js +4099 -0
- package/dist/generated/viewKit.d.ts +3853 -0
- package/dist/generated/viewKit.js +4022 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/picteus-ws-client/apis/AdministrationApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/AdministrationApi.js +1 -1
- package/dist/picteus-ws-client/apis/ApiSecretApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/ApiSecretApi.js +1 -1
- package/dist/picteus-ws-client/apis/CollectionApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/CollectionApi.js +1 -1
- package/dist/picteus-ws-client/apis/ExtensionApi.d.ts +69 -34
- package/dist/picteus-ws-client/apis/ExtensionApi.js +83 -38
- package/dist/picteus-ws-client/apis/ImageApi.d.ts +36 -5
- package/dist/picteus-ws-client/apis/ImageApi.js +44 -3
- package/dist/picteus-ws-client/apis/ImageAttachmentApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/ImageAttachmentApi.js +1 -1
- package/dist/picteus-ws-client/apis/MiscellaneousApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/MiscellaneousApi.js +1 -1
- package/dist/picteus-ws-client/apis/RepositoryApi.d.ts +5 -5
- package/dist/picteus-ws-client/apis/RepositoryApi.js +3 -3
- package/dist/picteus-ws-client/apis/SettingsApi.d.ts +1 -1
- package/dist/picteus-ws-client/apis/SettingsApi.js +1 -1
- package/dist/picteus-ws-client/models/ApiSecret.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApiSecret.js +1 -1
- package/dist/picteus-ws-client/models/ApiSecretSummary.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApiSecretSummary.js +1 -1
- package/dist/picteus-ws-client/models/ApiSecretType.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApiSecretType.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationConfiguration.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationConfiguration.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadata.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadata.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItem.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItem.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationMetadataItemValue.d.ts +4 -2
- package/dist/picteus-ws-client/models/ApplicationMetadataItemValue.js +1 -1
- package/dist/picteus-ws-client/models/ApplicationSettings.d.ts +1 -1
- package/dist/picteus-ws-client/models/ApplicationSettings.js +1 -1
- package/dist/picteus-ws-client/models/Collection.d.ts +1 -1
- package/dist/picteus-ws-client/models/Collection.js +1 -1
- package/dist/picteus-ws-client/models/CommandEntity.d.ts +1 -1
- package/dist/picteus-ws-client/models/CommandEntity.js +1 -1
- package/dist/picteus-ws-client/models/ComputedImageFormat.d.ts +1 -1
- package/dist/picteus-ws-client/models/ComputedImageFormat.js +1 -1
- package/dist/picteus-ws-client/models/ConfigurationCapability.d.ts +1 -1
- package/dist/picteus-ws-client/models/ConfigurationCapability.js +1 -1
- package/dist/picteus-ws-client/models/ConfigurationExtensionCommand.d.ts +1 -1
- package/dist/picteus-ws-client/models/ConfigurationExtensionCommand.js +1 -1
- package/dist/picteus-ws-client/models/ConstantsRegistry.d.ts +1 -1
- package/dist/picteus-ws-client/models/ConstantsRegistry.js +1 -1
- package/dist/picteus-ws-client/models/Dates.d.ts +1 -1
- package/dist/picteus-ws-client/models/Dates.js +1 -1
- package/dist/picteus-ws-client/models/Extension.d.ts +5 -5
- package/dist/picteus-ws-client/models/Extension.js +5 -5
- package/dist/picteus-ws-client/models/ExtensionActivity.d.ts +23 -5
- package/dist/picteus-ws-client/models/ExtensionActivity.js +17 -5
- package/dist/picteus-ws-client/models/ExtensionActivityKind.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionActivityKind.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionActivityState.d.ts +25 -0
- package/dist/picteus-ws-client/models/ExtensionActivityState.js +43 -0
- package/dist/picteus-ws-client/models/ExtensionAndManual.d.ts +5 -5
- package/dist/picteus-ws-client/models/ExtensionAndManual.js +5 -5
- package/dist/picteus-ws-client/models/ExtensionCategory.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionCategory.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionGenerationOptions.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionGenerationOptions.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionIdImageEmbeddingName.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionIdImageEmbeddingName.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageEmbeddings.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageEmbeddings.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeature.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeature.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeatureName.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeatureName.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeaturesAttribute.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageFeaturesAttribute.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTag.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTag.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTagsAttribute.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionImageTagsAttribute.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionManual.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionManual.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionSettings.d.ts +5 -3
- package/dist/picteus-ws-client/models/ExtensionSettings.js +1 -1
- package/dist/picteus-ws-client/models/ExtensionState.d.ts +25 -0
- package/dist/picteus-ws-client/models/ExtensionState.js +43 -0
- package/dist/picteus-ws-client/models/ExtensionsConfiguration.d.ts +1 -1
- package/dist/picteus-ws-client/models/ExtensionsConfiguration.js +1 -1
- package/dist/picteus-ws-client/models/GenerationRecipe.d.ts +13 -1
- package/dist/picteus-ws-client/models/GenerationRecipe.js +5 -1
- package/dist/picteus-ws-client/models/GenerationRecipePrompt.d.ts +1 -1
- package/dist/picteus-ws-client/models/GenerationRecipePrompt.js +1 -1
- package/dist/picteus-ws-client/models/Image.d.ts +1 -1
- package/dist/picteus-ws-client/models/Image.js +1 -1
- package/dist/picteus-ws-client/models/ImageDimensions.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageDimensions.js +1 -1
- package/dist/picteus-ws-client/models/ImageDistance.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageDistance.js +1 -1
- package/dist/picteus-ws-client/models/ImageEmbedding.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageEmbedding.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeature.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeature.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureFormat.d.ts +3 -1
- package/dist/picteus-ws-client/models/ImageFeatureFormat.js +4 -2
- package/dist/picteus-ws-client/models/ImageFeatureNullValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureNullValue.js +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureType.d.ts +2 -1
- package/dist/picteus-ws-client/models/ImageFeatureType.js +2 -1
- package/dist/picteus-ws-client/models/ImageFeatureValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFeatureValue.js +1 -1
- package/dist/picteus-ws-client/models/ImageFormat.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageFormat.js +1 -1
- package/dist/picteus-ws-client/models/ImageMediaUrl.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageMediaUrl.js +1 -1
- package/dist/picteus-ws-client/models/ImageMetadata.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageMetadata.js +1 -1
- package/dist/picteus-ws-client/models/ImageResizeRender.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageResizeRender.js +1 -1
- package/dist/picteus-ws-client/models/ImageSummary.d.ts +1 -1
- package/dist/picteus-ws-client/models/ImageSummary.js +1 -1
- package/dist/picteus-ws-client/models/InstructionsPrompt.d.ts +5 -3
- package/dist/picteus-ws-client/models/InstructionsPrompt.js +1 -1
- package/dist/picteus-ws-client/models/Manifest.d.ts +5 -3
- package/dist/picteus-ws-client/models/Manifest.js +1 -1
- package/dist/picteus-ws-client/models/ManifestCapability.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestCapability.js +1 -1
- package/dist/picteus-ws-client/models/ManifestCapabilityId.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestCapabilityId.js +1 -1
- package/dist/picteus-ws-client/models/ManifestEvent.d.ts +1 -3
- package/dist/picteus-ws-client/models/ManifestEvent.js +1 -3
- package/dist/picteus-ws-client/models/ManifestExecution.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExecution.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommand.d.ts +5 -3
- package/dist/picteus-ws-client/models/ManifestExtensionCommand.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandOn.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandOn.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandSpecification.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandSpecification.js +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandUi.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestExtensionCommandUi.js +1 -1
- package/dist/picteus-ws-client/models/ManifestInstructions.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestInstructions.js +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElement.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElement.js +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElementIntegration.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestInterfaceElementIntegration.js +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntime.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntime.js +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntimeEnvironment.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestRuntimeEnvironment.js +1 -1
- package/dist/picteus-ws-client/models/ManifestThrottlingPolicy.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestThrottlingPolicy.js +1 -1
- package/dist/picteus-ws-client/models/ManifestUserInterface.d.ts +1 -1
- package/dist/picteus-ws-client/models/ManifestUserInterface.js +1 -1
- package/dist/picteus-ws-client/models/PromptKind.d.ts +1 -1
- package/dist/picteus-ws-client/models/PromptKind.js +1 -1
- package/dist/picteus-ws-client/models/Repository.d.ts +5 -5
- package/dist/picteus-ws-client/models/Repository.js +5 -5
- package/dist/picteus-ws-client/models/RepositoryActivity.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivity.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivityKind.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryActivityKind.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryLocationType.d.ts +1 -1
- package/dist/picteus-ws-client/models/RepositoryLocationType.js +1 -1
- package/dist/picteus-ws-client/models/RepositoryState.d.ts +27 -0
- package/dist/picteus-ws-client/models/RepositoryState.js +45 -0
- package/dist/picteus-ws-client/models/RunCommandParameters.d.ts +5 -3
- package/dist/picteus-ws-client/models/RunCommandParameters.js +1 -1
- package/dist/picteus-ws-client/models/SearchCriteria.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchCriteria.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureComparisonOperator.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureComparisonOperator.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureCondition.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureCondition.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureConditionValue.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureConditionValue.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureLogicalOperator.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatureLogicalOperator.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeatures.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeatures.js +1 -1
- package/dist/picteus-ws-client/models/SearchFeaturesResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFeaturesResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchFilter.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFilter.js +1 -1
- package/dist/picteus-ws-client/models/SearchFilterOrigin.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchFilterOrigin.js +1 -1
- package/dist/picteus-ws-client/models/SearchImageIdResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImageIdResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchImageResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImageResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchImageSummaryResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImageSummaryResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchImagesOrigin.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchImagesOrigin.js +1 -1
- package/dist/picteus-ws-client/models/SearchKeyword.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchKeyword.js +1 -1
- package/dist/picteus-ws-client/models/SearchMediaUrlResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchMediaUrlResult.js +1 -1
- package/dist/picteus-ws-client/models/SearchOriginNature.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchOriginNature.js +1 -1
- package/dist/picteus-ws-client/models/SearchParameters.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchParameters.js +1 -1
- package/dist/picteus-ws-client/models/SearchProperties.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchProperties.js +1 -1
- package/dist/picteus-ws-client/models/SearchPropertyRange.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchPropertyRange.js +1 -1
- package/dist/picteus-ws-client/models/SearchRange.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchRange.js +1 -1
- package/dist/picteus-ws-client/models/SearchRepositoriesOrigin.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchRepositoriesOrigin.js +1 -1
- package/dist/picteus-ws-client/models/SearchSorting.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchSorting.js +1 -1
- package/dist/picteus-ws-client/models/SearchSortingProperty.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchSortingProperty.js +1 -1
- package/dist/picteus-ws-client/models/SearchTags.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchTags.js +1 -1
- package/dist/picteus-ws-client/models/SearchTagsResult.d.ts +1 -1
- package/dist/picteus-ws-client/models/SearchTagsResult.js +1 -1
- package/dist/picteus-ws-client/models/Software.d.ts +1 -1
- package/dist/picteus-ws-client/models/Software.js +1 -1
- package/dist/picteus-ws-client/models/TextualPrompt.d.ts +1 -1
- package/dist/picteus-ws-client/models/TextualPrompt.js +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceAnchor.d.ts +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceAnchor.js +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceSidebarIntegration.d.ts +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceSidebarIntegration.js +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceWindowIntegration.d.ts +1 -1
- package/dist/picteus-ws-client/models/UserInterfaceWindowIntegration.js +1 -1
- package/dist/picteus-ws-client/models/index.d.ts +3 -3
- package/dist/picteus-ws-client/models/index.js +3 -3
- package/dist/picteus-ws-client/runtime.d.ts +1 -1
- package/dist/picteus-ws-client/runtime.js +1 -1
- package/dist/picteusExtension.d.ts +1 -1
- package/dist/picteusExtension.js +18 -15
- package/package.json +1 -1
|
@@ -0,0 +1,2612 @@
|
|
|
1
|
+
// ---------------------------------------------------------------------------
|
|
2
|
+
// Auto-generated by @picteus/feature-view-grammar emitter. Do not edit directly.
|
|
3
|
+
// ---------------------------------------------------------------------------
|
|
4
|
+
/** Generic base class providing recursive JSON serialization for all model instances. */
|
|
5
|
+
export class GrammarNode {
|
|
6
|
+
/**
|
|
7
|
+
* Serializes this model instance into a strongly-typed, JSON-compatible plain object.
|
|
8
|
+
*
|
|
9
|
+
* @returns The plain object representation conforming to interface `T`.
|
|
10
|
+
*/
|
|
11
|
+
toJSON() {
|
|
12
|
+
const result = {};
|
|
13
|
+
for (const [key, value] of Object.entries(this)) {
|
|
14
|
+
if (value !== undefined) {
|
|
15
|
+
if (Array.isArray(value)) {
|
|
16
|
+
result[key] = value.map((item) => item && typeof item === "object" && typeof item.toJSON === "function"
|
|
17
|
+
? item.toJSON()
|
|
18
|
+
: item);
|
|
19
|
+
}
|
|
20
|
+
else if (value && typeof value === "object" && typeof value.toJSON === "function") {
|
|
21
|
+
result[key] = value.toJSON();
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
result[key] = value;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
/** Text emphasis and visual weight styling. */
|
|
32
|
+
export var Emphasis;
|
|
33
|
+
(function (Emphasis) {
|
|
34
|
+
/** Subdued or secondary appearance with lower visual contrast */
|
|
35
|
+
Emphasis["muted"] = "muted";
|
|
36
|
+
/** Standard text weight and contrast */
|
|
37
|
+
Emphasis["normal"] = "normal";
|
|
38
|
+
/** Emphasized / bold text weight for prominence */
|
|
39
|
+
Emphasis["strong"] = "strong";
|
|
40
|
+
})(Emphasis || (Emphasis = {}));
|
|
41
|
+
/** Representation style for short string values. */
|
|
42
|
+
export var StringShortRepresentation;
|
|
43
|
+
(function (StringShortRepresentation) {
|
|
44
|
+
/** Standard plain text rendering */
|
|
45
|
+
StringShortRepresentation["plain"] = "plain";
|
|
46
|
+
/** Visual chip / tag pill representation */
|
|
47
|
+
StringShortRepresentation["chip"] = "chip";
|
|
48
|
+
})(StringShortRepresentation || (StringShortRepresentation = {}));
|
|
49
|
+
/** Visual color tone variants for badge pill representations. */
|
|
50
|
+
export var BadgeVariant;
|
|
51
|
+
(function (BadgeVariant) {
|
|
52
|
+
/** Neutral gray tone */
|
|
53
|
+
BadgeVariant["neutral"] = "neutral";
|
|
54
|
+
/** Success green tone */
|
|
55
|
+
BadgeVariant["success"] = "success";
|
|
56
|
+
/** Warning yellow/orange tone */
|
|
57
|
+
BadgeVariant["warning"] = "warning";
|
|
58
|
+
/** Danger red tone */
|
|
59
|
+
BadgeVariant["danger"] = "danger";
|
|
60
|
+
})(BadgeVariant || (BadgeVariant = {}));
|
|
61
|
+
/** Presentation format styles for timestamp elements. */
|
|
62
|
+
export var TimestampFormat;
|
|
63
|
+
(function (TimestampFormat) {
|
|
64
|
+
/** Complete date and time display */
|
|
65
|
+
TimestampFormat["full"] = "full";
|
|
66
|
+
/** Date-only display */
|
|
67
|
+
TimestampFormat["date"] = "date";
|
|
68
|
+
/** Time-only display */
|
|
69
|
+
TimestampFormat["time"] = "time";
|
|
70
|
+
/** Relative time expression (e.g. "5 minutes ago") */
|
|
71
|
+
TimestampFormat["relative"] = "relative";
|
|
72
|
+
})(TimestampFormat || (TimestampFormat = {}));
|
|
73
|
+
/** Visual style variants for interactive button actions. */
|
|
74
|
+
export var ButtonVariant;
|
|
75
|
+
(function (ButtonVariant) {
|
|
76
|
+
/** Primary emphasis button style for default/recommended actions */
|
|
77
|
+
ButtonVariant["primary"] = "primary";
|
|
78
|
+
/** Secondary standard button style */
|
|
79
|
+
ButtonVariant["secondary"] = "secondary";
|
|
80
|
+
/** Subtle low-contrast button style */
|
|
81
|
+
ButtonVariant["subtle"] = "subtle";
|
|
82
|
+
/** Destructive / dangerous action button style */
|
|
83
|
+
ButtonVariant["danger"] = "danger";
|
|
84
|
+
})(ButtonVariant || (ButtonVariant = {}));
|
|
85
|
+
/** Text horizontal alignment options for table columns. */
|
|
86
|
+
export var TableColumnAlign;
|
|
87
|
+
(function (TableColumnAlign) {
|
|
88
|
+
/** Left-aligned text */
|
|
89
|
+
TableColumnAlign["left"] = "left";
|
|
90
|
+
/** Center-aligned text */
|
|
91
|
+
TableColumnAlign["center"] = "center";
|
|
92
|
+
/** Right-aligned text */
|
|
93
|
+
TableColumnAlign["right"] = "right";
|
|
94
|
+
})(TableColumnAlign || (TableColumnAlign = {}));
|
|
95
|
+
/** Visual styling variants for hairline dividers. */
|
|
96
|
+
export var DividerStyle;
|
|
97
|
+
(function (DividerStyle) {
|
|
98
|
+
/** Subtle thin hairline border */
|
|
99
|
+
DividerStyle["hairline"] = "hairline";
|
|
100
|
+
/** Solid standard divider line */
|
|
101
|
+
DividerStyle["solid"] = "solid";
|
|
102
|
+
/** Dashed separator line */
|
|
103
|
+
DividerStyle["dashed"] = "dashed";
|
|
104
|
+
})(DividerStyle || (DividerStyle = {}));
|
|
105
|
+
/** Abstract base class for all `UiElement` models. */
|
|
106
|
+
export class BaseUiElement extends GrammarNode {
|
|
107
|
+
}
|
|
108
|
+
/** Abstract base class for all `ActionElement` models. */
|
|
109
|
+
export class BaseActionElement extends GrammarNode {
|
|
110
|
+
}
|
|
111
|
+
// --- Concrete Model Classes Implementing Interfaces ---
|
|
112
|
+
/**
|
|
113
|
+
* Class implementation of the `TruncateOptions` interface.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* Truncation configuration for long textual content with optional expand affordance.
|
|
117
|
+
*/
|
|
118
|
+
export class TruncateOptionsClass extends GrammarNode {
|
|
119
|
+
/** Maximum number of characters to display before truncating */
|
|
120
|
+
characterLimit;
|
|
121
|
+
/**
|
|
122
|
+
* Whether to render a "Show more" / "Show less" toggle affordance
|
|
123
|
+
*
|
|
124
|
+
* @defaultValue true
|
|
125
|
+
*/
|
|
126
|
+
showMore;
|
|
127
|
+
/**
|
|
128
|
+
* Initializes a new `TruncateOptionsClass` instance.
|
|
129
|
+
*
|
|
130
|
+
* @param characterLimit - Maximum number of characters to display before truncating
|
|
131
|
+
* @param options - Optional property overrides.
|
|
132
|
+
*/
|
|
133
|
+
constructor(characterLimit, options) {
|
|
134
|
+
super();
|
|
135
|
+
this.characterLimit = characterLimit;
|
|
136
|
+
this.showMore = options?.showMore ?? true;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Class implementation of the `PrimitiveModifiers` interface.
|
|
141
|
+
*
|
|
142
|
+
* @remarks
|
|
143
|
+
* Common modifier traits that can be attached to primitive elements.
|
|
144
|
+
*/
|
|
145
|
+
export class PrimitiveModifiersClass extends GrammarNode {
|
|
146
|
+
/** Adds an interactive copy button/action next to the rendered value */
|
|
147
|
+
copyable;
|
|
148
|
+
/** Configures character truncation threshold with show-more affordance */
|
|
149
|
+
truncate;
|
|
150
|
+
/**
|
|
151
|
+
* Text emphasis level
|
|
152
|
+
*
|
|
153
|
+
* @defaultValue Emphasis.normal
|
|
154
|
+
*/
|
|
155
|
+
emphasis;
|
|
156
|
+
/**
|
|
157
|
+
* Whether to use monospace font rendering (for hashes, IDs, codes)
|
|
158
|
+
*
|
|
159
|
+
* @defaultValue false
|
|
160
|
+
*/
|
|
161
|
+
monospace;
|
|
162
|
+
/**
|
|
163
|
+
* Initializes a new `PrimitiveModifiersClass` instance.
|
|
164
|
+
*
|
|
165
|
+
* @param options - Optional property overrides.
|
|
166
|
+
*/
|
|
167
|
+
constructor(options) {
|
|
168
|
+
super();
|
|
169
|
+
this.copyable = options?.copyable;
|
|
170
|
+
this.truncate = options?.truncate;
|
|
171
|
+
this.emphasis = options?.emphasis ?? Emphasis.normal;
|
|
172
|
+
this.monospace = options?.monospace ?? false;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Class implementation of the `StringShortElement` interface.
|
|
177
|
+
*
|
|
178
|
+
* @remarks
|
|
179
|
+
* Short string primitive element.
|
|
180
|
+
* Supports plain text or compact chip pill presentation.
|
|
181
|
+
*/
|
|
182
|
+
export class StringShortElementClass extends BaseUiElement {
|
|
183
|
+
/**
|
|
184
|
+
* The discriminator type tag.
|
|
185
|
+
*
|
|
186
|
+
* @defaultValue "string-short"
|
|
187
|
+
*/
|
|
188
|
+
type = "string-short";
|
|
189
|
+
/** Text value */
|
|
190
|
+
value;
|
|
191
|
+
/**
|
|
192
|
+
* Display representation mode
|
|
193
|
+
*
|
|
194
|
+
* @defaultValue StringShortRepresentation.plain
|
|
195
|
+
*/
|
|
196
|
+
representation;
|
|
197
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
198
|
+
modifiers;
|
|
199
|
+
/**
|
|
200
|
+
* Initializes a new `StringShortElementClass` instance.
|
|
201
|
+
*
|
|
202
|
+
* @param value - Text value
|
|
203
|
+
* @param options - Optional property overrides.
|
|
204
|
+
*/
|
|
205
|
+
constructor(value, options) {
|
|
206
|
+
super();
|
|
207
|
+
this.value = value;
|
|
208
|
+
this.representation = options?.representation ?? StringShortRepresentation.plain;
|
|
209
|
+
this.modifiers = options?.modifiers;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Class implementation of the `StringLongElement` interface.
|
|
214
|
+
*
|
|
215
|
+
* @remarks
|
|
216
|
+
* Multiline text block primitive element for descriptions, comments, or prose.
|
|
217
|
+
*/
|
|
218
|
+
export class StringLongElementClass extends BaseUiElement {
|
|
219
|
+
/**
|
|
220
|
+
* The discriminator type tag.
|
|
221
|
+
*
|
|
222
|
+
* @defaultValue "string-long"
|
|
223
|
+
*/
|
|
224
|
+
type = "string-long";
|
|
225
|
+
/** Text value */
|
|
226
|
+
value;
|
|
227
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
228
|
+
modifiers;
|
|
229
|
+
/**
|
|
230
|
+
* Initializes a new `StringLongElementClass` instance.
|
|
231
|
+
*
|
|
232
|
+
* @param value - Text value
|
|
233
|
+
* @param options - Optional property overrides.
|
|
234
|
+
*/
|
|
235
|
+
constructor(value, options) {
|
|
236
|
+
super();
|
|
237
|
+
this.value = value;
|
|
238
|
+
this.modifiers = options?.modifiers;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Class implementation of the `StringCodeElement` interface.
|
|
243
|
+
*
|
|
244
|
+
* @remarks
|
|
245
|
+
* Monospace code block or formatted code snippet representation.
|
|
246
|
+
*/
|
|
247
|
+
export class StringCodeElementClass extends BaseUiElement {
|
|
248
|
+
/**
|
|
249
|
+
* The discriminator type tag.
|
|
250
|
+
*
|
|
251
|
+
* @defaultValue "string-code"
|
|
252
|
+
*/
|
|
253
|
+
type = "string-code";
|
|
254
|
+
/** Text value */
|
|
255
|
+
value;
|
|
256
|
+
/** Optional syntax highlighting language identifier */
|
|
257
|
+
language;
|
|
258
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
259
|
+
modifiers;
|
|
260
|
+
/**
|
|
261
|
+
* Initializes a new `StringCodeElementClass` instance.
|
|
262
|
+
*
|
|
263
|
+
* @param value - Text value
|
|
264
|
+
* @param options - Optional property overrides.
|
|
265
|
+
*/
|
|
266
|
+
constructor(value, options) {
|
|
267
|
+
super();
|
|
268
|
+
this.value = value;
|
|
269
|
+
this.language = options?.language;
|
|
270
|
+
this.modifiers = options?.modifiers;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Class implementation of the `StringUrlElement` interface.
|
|
275
|
+
*
|
|
276
|
+
* @remarks
|
|
277
|
+
* Hyperlink representation for external or internal URL navigation.
|
|
278
|
+
*/
|
|
279
|
+
export class StringUrlElementClass extends BaseUiElement {
|
|
280
|
+
/**
|
|
281
|
+
* The discriminator type tag.
|
|
282
|
+
*
|
|
283
|
+
* @defaultValue "string-url"
|
|
284
|
+
*/
|
|
285
|
+
type = "string-url";
|
|
286
|
+
/** Target URL or navigation destination */
|
|
287
|
+
value;
|
|
288
|
+
/** Optional custom anchor text label */
|
|
289
|
+
label;
|
|
290
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
291
|
+
modifiers;
|
|
292
|
+
/**
|
|
293
|
+
* Initializes a new `StringUrlElementClass` instance.
|
|
294
|
+
*
|
|
295
|
+
* @param value - Target URL or navigation destination
|
|
296
|
+
* @param options - Optional property overrides.
|
|
297
|
+
*/
|
|
298
|
+
constructor(value, options) {
|
|
299
|
+
super();
|
|
300
|
+
this.value = value;
|
|
301
|
+
this.label = options?.label;
|
|
302
|
+
this.modifiers = options?.modifiers;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Class implementation of the `IdentifierElement` interface.
|
|
307
|
+
*
|
|
308
|
+
* @remarks
|
|
309
|
+
* Monospace semantic identifier representation.
|
|
310
|
+
*/
|
|
311
|
+
export class IdentifierElementClass extends BaseUiElement {
|
|
312
|
+
/**
|
|
313
|
+
* The discriminator type tag.
|
|
314
|
+
*
|
|
315
|
+
* @defaultValue "identifier"
|
|
316
|
+
*/
|
|
317
|
+
type = "identifier";
|
|
318
|
+
/** Identifier string value */
|
|
319
|
+
value;
|
|
320
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
321
|
+
modifiers;
|
|
322
|
+
/**
|
|
323
|
+
* Initializes a new `IdentifierElementClass` instance.
|
|
324
|
+
*
|
|
325
|
+
* @param value - Identifier string value
|
|
326
|
+
* @param options - Optional property overrides.
|
|
327
|
+
*/
|
|
328
|
+
constructor(value, options) {
|
|
329
|
+
super();
|
|
330
|
+
this.value = value;
|
|
331
|
+
this.modifiers = options?.modifiers;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
/**
|
|
335
|
+
* Class implementation of the `RatioElement` interface.
|
|
336
|
+
*
|
|
337
|
+
* @remarks
|
|
338
|
+
* Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
|
|
339
|
+
*/
|
|
340
|
+
export class RatioElementClass extends BaseUiElement {
|
|
341
|
+
/**
|
|
342
|
+
* The discriminator type tag.
|
|
343
|
+
*
|
|
344
|
+
* @defaultValue "ratio"
|
|
345
|
+
*/
|
|
346
|
+
type = "ratio";
|
|
347
|
+
/** Aspect ratio textual expression */
|
|
348
|
+
value;
|
|
349
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
350
|
+
modifiers;
|
|
351
|
+
/**
|
|
352
|
+
* Initializes a new `RatioElementClass` instance.
|
|
353
|
+
*
|
|
354
|
+
* @param value - Aspect ratio textual expression
|
|
355
|
+
* @param options - Optional property overrides.
|
|
356
|
+
*/
|
|
357
|
+
constructor(value, options) {
|
|
358
|
+
super();
|
|
359
|
+
this.value = value;
|
|
360
|
+
this.modifiers = options?.modifiers;
|
|
361
|
+
}
|
|
362
|
+
}
|
|
363
|
+
/**
|
|
364
|
+
* Class implementation of the `ColourElement` interface.
|
|
365
|
+
*
|
|
366
|
+
* @remarks
|
|
367
|
+
* Single color swatch representation with hex value and copy affordance.
|
|
368
|
+
*/
|
|
369
|
+
export class ColourElementClass extends BaseUiElement {
|
|
370
|
+
/**
|
|
371
|
+
* The discriminator type tag.
|
|
372
|
+
*
|
|
373
|
+
* @defaultValue "color-swatch"
|
|
374
|
+
*/
|
|
375
|
+
type = "color-swatch";
|
|
376
|
+
/** Hexadecimal color code */
|
|
377
|
+
value;
|
|
378
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
379
|
+
modifiers;
|
|
380
|
+
/**
|
|
381
|
+
* Initializes a new `ColourElementClass` instance.
|
|
382
|
+
*
|
|
383
|
+
* @param value - Hexadecimal color code
|
|
384
|
+
* @param options - Optional property overrides.
|
|
385
|
+
*/
|
|
386
|
+
constructor(value, options) {
|
|
387
|
+
super();
|
|
388
|
+
this.value = value;
|
|
389
|
+
this.modifiers = options?.modifiers;
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
/**
|
|
393
|
+
* Class implementation of the `NumberUnboundedElement` interface.
|
|
394
|
+
*
|
|
395
|
+
* @remarks
|
|
396
|
+
* Plain unbounded numeric value primitive element.
|
|
397
|
+
*/
|
|
398
|
+
export class NumberUnboundedElementClass extends BaseUiElement {
|
|
399
|
+
/**
|
|
400
|
+
* The discriminator type tag.
|
|
401
|
+
*
|
|
402
|
+
* @defaultValue "number-unbounded"
|
|
403
|
+
*/
|
|
404
|
+
type = "number-unbounded";
|
|
405
|
+
/** Numeric value */
|
|
406
|
+
value;
|
|
407
|
+
/** Optional unit suffix (e.g. "px", "ms", "MB") */
|
|
408
|
+
unit;
|
|
409
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
410
|
+
modifiers;
|
|
411
|
+
/**
|
|
412
|
+
* Initializes a new `NumberUnboundedElementClass` instance.
|
|
413
|
+
*
|
|
414
|
+
* @param value - Numeric value
|
|
415
|
+
* @param options - Optional property overrides.
|
|
416
|
+
*/
|
|
417
|
+
constructor(value, options) {
|
|
418
|
+
super();
|
|
419
|
+
this.value = value;
|
|
420
|
+
this.unit = options?.unit;
|
|
421
|
+
this.modifiers = options?.modifiers;
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
/**
|
|
425
|
+
* Class implementation of the `NumberBoundedStarsElement` interface.
|
|
426
|
+
*
|
|
427
|
+
* @remarks
|
|
428
|
+
* Bounded numeric rating represented as visual stars.
|
|
429
|
+
*/
|
|
430
|
+
export class NumberBoundedStarsElementClass extends BaseUiElement {
|
|
431
|
+
/**
|
|
432
|
+
* The discriminator type tag.
|
|
433
|
+
*
|
|
434
|
+
* @defaultValue "number-stars"
|
|
435
|
+
*/
|
|
436
|
+
type = "number-stars";
|
|
437
|
+
/** Numeric rating score */
|
|
438
|
+
value;
|
|
439
|
+
/** Maximum rating scale (defaults to 5) */
|
|
440
|
+
maximum;
|
|
441
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
442
|
+
modifiers;
|
|
443
|
+
/**
|
|
444
|
+
* Initializes a new `NumberBoundedStarsElementClass` instance.
|
|
445
|
+
*
|
|
446
|
+
* @param value - Numeric rating score
|
|
447
|
+
* @param options - Optional property overrides.
|
|
448
|
+
*/
|
|
449
|
+
constructor(value, options) {
|
|
450
|
+
super();
|
|
451
|
+
this.value = value;
|
|
452
|
+
this.maximum = options?.maximum;
|
|
453
|
+
this.modifiers = options?.modifiers;
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Class implementation of the `NumberBoundedMeterElement` interface.
|
|
458
|
+
*
|
|
459
|
+
* @remarks
|
|
460
|
+
* Bounded numeric meter representation (read-only progress / score bar).
|
|
461
|
+
*/
|
|
462
|
+
export class NumberBoundedMeterElementClass extends BaseUiElement {
|
|
463
|
+
/**
|
|
464
|
+
* The discriminator type tag.
|
|
465
|
+
*
|
|
466
|
+
* @defaultValue "number-meter"
|
|
467
|
+
*/
|
|
468
|
+
type = "number-meter";
|
|
469
|
+
/** Numeric value */
|
|
470
|
+
value;
|
|
471
|
+
/** Minimum scale bound (defaults to 0) */
|
|
472
|
+
minimum;
|
|
473
|
+
/** Maximum scale bound (e.g. 100) */
|
|
474
|
+
maximum;
|
|
475
|
+
/** Optional custom text label override (e.g. "68 / 100") */
|
|
476
|
+
label;
|
|
477
|
+
/** Optional unit suffix (e.g. "%") */
|
|
478
|
+
unit;
|
|
479
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
480
|
+
modifiers;
|
|
481
|
+
/**
|
|
482
|
+
* Initializes a new `NumberBoundedMeterElementClass` instance.
|
|
483
|
+
*
|
|
484
|
+
* @param value - Numeric value
|
|
485
|
+
* @param options - Optional property overrides.
|
|
486
|
+
*/
|
|
487
|
+
constructor(value, options) {
|
|
488
|
+
super();
|
|
489
|
+
this.value = value;
|
|
490
|
+
this.minimum = options?.minimum;
|
|
491
|
+
this.maximum = options?.maximum;
|
|
492
|
+
this.label = options?.label;
|
|
493
|
+
this.unit = options?.unit;
|
|
494
|
+
this.modifiers = options?.modifiers;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* Class implementation of the `BooleanPlainElement` interface.
|
|
499
|
+
*
|
|
500
|
+
* @remarks
|
|
501
|
+
* Plain boolean value representation (textual "true" / "false").
|
|
502
|
+
*/
|
|
503
|
+
export class BooleanPlainElementClass extends BaseUiElement {
|
|
504
|
+
/**
|
|
505
|
+
* The discriminator type tag.
|
|
506
|
+
*
|
|
507
|
+
* @defaultValue "boolean-plain"
|
|
508
|
+
*/
|
|
509
|
+
type = "boolean-plain";
|
|
510
|
+
/** Boolean state value */
|
|
511
|
+
value;
|
|
512
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
513
|
+
modifiers;
|
|
514
|
+
/**
|
|
515
|
+
* Initializes a new `BooleanPlainElementClass` instance.
|
|
516
|
+
*
|
|
517
|
+
* @param value - Boolean state value
|
|
518
|
+
* @param options - Optional property overrides.
|
|
519
|
+
*/
|
|
520
|
+
constructor(value, options) {
|
|
521
|
+
super();
|
|
522
|
+
this.value = value;
|
|
523
|
+
this.modifiers = options?.modifiers;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
/**
|
|
527
|
+
* Class implementation of the `BooleanBadgeElement` interface.
|
|
528
|
+
*
|
|
529
|
+
* @remarks
|
|
530
|
+
* Visual badge pill representation of a boolean state.
|
|
531
|
+
*/
|
|
532
|
+
export class BooleanBadgeElementClass extends BaseUiElement {
|
|
533
|
+
/**
|
|
534
|
+
* The discriminator type tag.
|
|
535
|
+
*
|
|
536
|
+
* @defaultValue "boolean-badge"
|
|
537
|
+
*/
|
|
538
|
+
type = "boolean-badge";
|
|
539
|
+
/** Boolean state value */
|
|
540
|
+
value;
|
|
541
|
+
/**
|
|
542
|
+
* Custom display label when true (defaults to "true")
|
|
543
|
+
*
|
|
544
|
+
* @defaultValue "true"
|
|
545
|
+
*/
|
|
546
|
+
trueLabel;
|
|
547
|
+
/**
|
|
548
|
+
* Custom display label when false (defaults to "false")
|
|
549
|
+
*
|
|
550
|
+
* @defaultValue "false"
|
|
551
|
+
*/
|
|
552
|
+
falseLabel;
|
|
553
|
+
/**
|
|
554
|
+
* Badge color tone
|
|
555
|
+
*
|
|
556
|
+
* @defaultValue BadgeVariant.neutral
|
|
557
|
+
*/
|
|
558
|
+
variant;
|
|
559
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
560
|
+
modifiers;
|
|
561
|
+
/**
|
|
562
|
+
* Initializes a new `BooleanBadgeElementClass` instance.
|
|
563
|
+
*
|
|
564
|
+
* @param value - Boolean state value
|
|
565
|
+
* @param options - Optional property overrides.
|
|
566
|
+
*/
|
|
567
|
+
constructor(value, options) {
|
|
568
|
+
super();
|
|
569
|
+
this.value = value;
|
|
570
|
+
this.trueLabel = options?.trueLabel ?? "true";
|
|
571
|
+
this.falseLabel = options?.falseLabel ?? "false";
|
|
572
|
+
this.variant = options?.variant ?? BadgeVariant.neutral;
|
|
573
|
+
this.modifiers = options?.modifiers;
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Class implementation of the `TimestampElement` interface.
|
|
578
|
+
*
|
|
579
|
+
* @remarks
|
|
580
|
+
* Formatted date and time representation.
|
|
581
|
+
*/
|
|
582
|
+
export class TimestampElementClass extends BaseUiElement {
|
|
583
|
+
/**
|
|
584
|
+
* The discriminator type tag.
|
|
585
|
+
*
|
|
586
|
+
* @defaultValue "timestamp"
|
|
587
|
+
*/
|
|
588
|
+
type = "timestamp";
|
|
589
|
+
/** ISO 8601 date string or epoch timestamp in milliseconds */
|
|
590
|
+
value;
|
|
591
|
+
/**
|
|
592
|
+
* Presentation date/time format
|
|
593
|
+
*
|
|
594
|
+
* @defaultValue TimestampFormat.full
|
|
595
|
+
*/
|
|
596
|
+
format;
|
|
597
|
+
/** Optional visual modifiers (copyable, truncate, emphasis, monospace) */
|
|
598
|
+
modifiers;
|
|
599
|
+
/**
|
|
600
|
+
* Initializes a new `TimestampElementClass` instance.
|
|
601
|
+
*
|
|
602
|
+
* @param value - ISO 8601 date string or epoch timestamp in milliseconds
|
|
603
|
+
* @param options - Optional property overrides.
|
|
604
|
+
*/
|
|
605
|
+
constructor(value, options) {
|
|
606
|
+
super();
|
|
607
|
+
this.value = value;
|
|
608
|
+
this.format = options?.format ?? TimestampFormat.full;
|
|
609
|
+
this.modifiers = options?.modifiers;
|
|
610
|
+
}
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Class implementation of the `ImageReferenceElement` interface.
|
|
614
|
+
*
|
|
615
|
+
* @remarks
|
|
616
|
+
* Thumbnail image reference with placeholder fallback handling.
|
|
617
|
+
*/
|
|
618
|
+
export class ImageReferenceElementClass extends BaseUiElement {
|
|
619
|
+
/**
|
|
620
|
+
* The discriminator type tag.
|
|
621
|
+
*
|
|
622
|
+
* @defaultValue "image-ref"
|
|
623
|
+
*/
|
|
624
|
+
type = "image-ref";
|
|
625
|
+
/** Image source URI (HTTPS URL, base64 data URI, or asset path) */
|
|
626
|
+
src;
|
|
627
|
+
/** Accessible alternative description */
|
|
628
|
+
alt;
|
|
629
|
+
/**
|
|
630
|
+
* Aspect ratio of the thumbnail container
|
|
631
|
+
*
|
|
632
|
+
* @defaultValue "1:1"
|
|
633
|
+
*/
|
|
634
|
+
aspectRatio;
|
|
635
|
+
/** Fallback placeholder image URI */
|
|
636
|
+
placeholder;
|
|
637
|
+
/**
|
|
638
|
+
* Initializes a new `ImageReferenceElementClass` instance.
|
|
639
|
+
*
|
|
640
|
+
* @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
|
|
641
|
+
* @param options - Optional property overrides.
|
|
642
|
+
*/
|
|
643
|
+
constructor(src, options) {
|
|
644
|
+
super();
|
|
645
|
+
this.src = src;
|
|
646
|
+
this.alt = options?.alt;
|
|
647
|
+
this.aspectRatio = options?.aspectRatio ?? "1:1";
|
|
648
|
+
this.placeholder = options?.placeholder;
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* Class implementation of the `DominantColourSetElement` interface.
|
|
653
|
+
*
|
|
654
|
+
* @remarks
|
|
655
|
+
* Dominant color set palette rendered in descending dominance order.
|
|
656
|
+
*/
|
|
657
|
+
export class DominantColourSetElementClass extends BaseUiElement {
|
|
658
|
+
/**
|
|
659
|
+
* The discriminator type tag.
|
|
660
|
+
*
|
|
661
|
+
* @defaultValue "color-set"
|
|
662
|
+
*/
|
|
663
|
+
type = "color-set";
|
|
664
|
+
/** List of hexadecimal color strings in descending priority */
|
|
665
|
+
colors;
|
|
666
|
+
/**
|
|
667
|
+
* Initializes a new `DominantColourSetElementClass` instance.
|
|
668
|
+
*
|
|
669
|
+
* @param colors - List of hexadecimal color strings in descending priority
|
|
670
|
+
*/
|
|
671
|
+
constructor(colors) {
|
|
672
|
+
super();
|
|
673
|
+
this.colors = [...colors];
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Class implementation of the `ButtonActionElement` interface.
|
|
678
|
+
*
|
|
679
|
+
* @remarks
|
|
680
|
+
* Interactive button action triggering an extension command.
|
|
681
|
+
*/
|
|
682
|
+
export class ButtonActionElementClass extends BaseActionElement {
|
|
683
|
+
/**
|
|
684
|
+
* The discriminator type tag.
|
|
685
|
+
*
|
|
686
|
+
* @defaultValue "button"
|
|
687
|
+
*/
|
|
688
|
+
type = "button";
|
|
689
|
+
/** Command identifier to invoke */
|
|
690
|
+
commandId;
|
|
691
|
+
/** Display label for the action */
|
|
692
|
+
label;
|
|
693
|
+
/** Extension identifier owning the target command */
|
|
694
|
+
extensionId;
|
|
695
|
+
/** Target entity or context identifier */
|
|
696
|
+
target;
|
|
697
|
+
/** Optional arbitrary parameters payload forwarded to the command handler */
|
|
698
|
+
parameters;
|
|
699
|
+
/**
|
|
700
|
+
* Whether the button is disabled / unavailable
|
|
701
|
+
*
|
|
702
|
+
* @defaultValue false
|
|
703
|
+
*/
|
|
704
|
+
disabled;
|
|
705
|
+
/**
|
|
706
|
+
* Button visual style variant
|
|
707
|
+
*
|
|
708
|
+
* @defaultValue ButtonVariant.secondary
|
|
709
|
+
*/
|
|
710
|
+
variant;
|
|
711
|
+
/**
|
|
712
|
+
* Initializes a new `ButtonActionElementClass` instance.
|
|
713
|
+
*
|
|
714
|
+
* @param commandId - Command identifier to invoke
|
|
715
|
+
* @param label - Display label for the action
|
|
716
|
+
* @param options - Optional property overrides.
|
|
717
|
+
*/
|
|
718
|
+
constructor(commandId, label, options) {
|
|
719
|
+
super();
|
|
720
|
+
this.commandId = commandId;
|
|
721
|
+
this.label = label;
|
|
722
|
+
this.extensionId = options?.extensionId;
|
|
723
|
+
this.target = options?.target;
|
|
724
|
+
this.parameters = options?.parameters;
|
|
725
|
+
this.disabled = options?.disabled ?? false;
|
|
726
|
+
this.variant = options?.variant ?? ButtonVariant.secondary;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* Class implementation of the `ExternalLinkActionElement` interface.
|
|
731
|
+
*
|
|
732
|
+
* @remarks
|
|
733
|
+
* External link action distinct from inline URL text values.
|
|
734
|
+
*/
|
|
735
|
+
export class ExternalLinkActionElementClass extends BaseActionElement {
|
|
736
|
+
/**
|
|
737
|
+
* The discriminator type tag.
|
|
738
|
+
*
|
|
739
|
+
* @defaultValue "external-link"
|
|
740
|
+
*/
|
|
741
|
+
type = "external-link";
|
|
742
|
+
/** Target URL destination */
|
|
743
|
+
url;
|
|
744
|
+
/** Display label for the action */
|
|
745
|
+
label;
|
|
746
|
+
/**
|
|
747
|
+
* Initializes a new `ExternalLinkActionElementClass` instance.
|
|
748
|
+
*
|
|
749
|
+
* @param url - Target URL destination
|
|
750
|
+
* @param label - Display label for the action
|
|
751
|
+
*/
|
|
752
|
+
constructor(url, label) {
|
|
753
|
+
super();
|
|
754
|
+
this.url = url;
|
|
755
|
+
this.label = label;
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Class implementation of the `MarkdownBlockElement` interface.
|
|
760
|
+
*
|
|
761
|
+
* @remarks
|
|
762
|
+
* Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
|
|
763
|
+
*/
|
|
764
|
+
export class MarkdownBlockElementClass extends BaseUiElement {
|
|
765
|
+
/**
|
|
766
|
+
* The discriminator type tag.
|
|
767
|
+
*
|
|
768
|
+
* @defaultValue "markdown"
|
|
769
|
+
*/
|
|
770
|
+
type = "markdown";
|
|
771
|
+
/** Raw Markdown markup content */
|
|
772
|
+
content;
|
|
773
|
+
/**
|
|
774
|
+
* Initializes a new `MarkdownBlockElementClass` instance.
|
|
775
|
+
*
|
|
776
|
+
* @param content - Raw Markdown markup content
|
|
777
|
+
*/
|
|
778
|
+
constructor(content) {
|
|
779
|
+
super();
|
|
780
|
+
this.content = content;
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Class implementation of the `HtmlBlockElement` interface.
|
|
785
|
+
*
|
|
786
|
+
* @remarks
|
|
787
|
+
* Sandboxed HTML rendering escape hatch.
|
|
788
|
+
*/
|
|
789
|
+
export class HtmlBlockElementClass extends BaseUiElement {
|
|
790
|
+
/**
|
|
791
|
+
* The discriminator type tag.
|
|
792
|
+
*
|
|
793
|
+
* @defaultValue "html"
|
|
794
|
+
*/
|
|
795
|
+
type = "html";
|
|
796
|
+
/** Raw HTML markup content */
|
|
797
|
+
content;
|
|
798
|
+
/**
|
|
799
|
+
* Initializes a new `HtmlBlockElementClass` instance.
|
|
800
|
+
*
|
|
801
|
+
* @param content - Raw HTML markup content
|
|
802
|
+
*/
|
|
803
|
+
constructor(content) {
|
|
804
|
+
super();
|
|
805
|
+
this.content = content;
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
/**
|
|
809
|
+
* Class implementation of the `Slot` interface.
|
|
810
|
+
*
|
|
811
|
+
* @remarks
|
|
812
|
+
* Single slot within a multi-slot horizontal row layout.
|
|
813
|
+
*/
|
|
814
|
+
export class SlotClass extends GrammarNode {
|
|
815
|
+
/** Rendered content inside the slot */
|
|
816
|
+
content;
|
|
817
|
+
/** Optional slot label (e.g. "Slot A") */
|
|
818
|
+
label;
|
|
819
|
+
/** Relative or fractional width proportion (e.g. "1/3", "2/3", "100px", "auto") */
|
|
820
|
+
width;
|
|
821
|
+
/**
|
|
822
|
+
* Initializes a new `SlotClass` instance.
|
|
823
|
+
*
|
|
824
|
+
* @param content - Rendered content inside the slot
|
|
825
|
+
* @param options - Optional property overrides.
|
|
826
|
+
*/
|
|
827
|
+
constructor(content, options) {
|
|
828
|
+
super();
|
|
829
|
+
this.content = content;
|
|
830
|
+
this.label = options?.label;
|
|
831
|
+
this.width = options?.width;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
/**
|
|
835
|
+
* Class implementation of the `MultiSlotRowElement` interface.
|
|
836
|
+
*
|
|
837
|
+
* @remarks
|
|
838
|
+
* Multi-slot horizontal row with declared column width proportions.
|
|
839
|
+
* Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
|
|
840
|
+
*/
|
|
841
|
+
export class MultiSlotRowElementClass extends BaseUiElement {
|
|
842
|
+
/**
|
|
843
|
+
* The discriminator type tag.
|
|
844
|
+
*
|
|
845
|
+
* @defaultValue "multi-slot"
|
|
846
|
+
*/
|
|
847
|
+
type = "multi-slot";
|
|
848
|
+
/** List of slots comprising the row */
|
|
849
|
+
slots;
|
|
850
|
+
/** Proportions descriptor (e.g. "1/3 + 2/3", "equal", "1/4 + 3/4") */
|
|
851
|
+
proportions;
|
|
852
|
+
/**
|
|
853
|
+
* Initializes a new `MultiSlotRowElementClass` instance.
|
|
854
|
+
*
|
|
855
|
+
* @param slots - List of slots comprising the row
|
|
856
|
+
* @param options - Optional property overrides.
|
|
857
|
+
*/
|
|
858
|
+
constructor(slots, options) {
|
|
859
|
+
super();
|
|
860
|
+
this.slots = [...slots];
|
|
861
|
+
this.proportions = options?.proportions;
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Class implementation of the `LabelValueRowElement` interface.
|
|
866
|
+
*
|
|
867
|
+
* @remarks
|
|
868
|
+
* Standard label and value row.
|
|
869
|
+
* Displays a muted label on the left and value representation on the right with a vertical dividing line.
|
|
870
|
+
*/
|
|
871
|
+
export class LabelValueRowElementClass extends BaseUiElement {
|
|
872
|
+
/**
|
|
873
|
+
* The discriminator type tag.
|
|
874
|
+
*
|
|
875
|
+
* @defaultValue "label-value"
|
|
876
|
+
*/
|
|
877
|
+
type = "label-value";
|
|
878
|
+
/** Key or descriptive label displayed muted on the left */
|
|
879
|
+
label;
|
|
880
|
+
/** Rendered value element on the right */
|
|
881
|
+
value;
|
|
882
|
+
/**
|
|
883
|
+
* Whether to render a bottom border/hairline divider
|
|
884
|
+
*
|
|
885
|
+
* @defaultValue false
|
|
886
|
+
*/
|
|
887
|
+
withDivider;
|
|
888
|
+
/**
|
|
889
|
+
* Initializes a new `LabelValueRowElementClass` instance.
|
|
890
|
+
*
|
|
891
|
+
* @param label - Key or descriptive label displayed muted on the left
|
|
892
|
+
* @param value - Rendered value element on the right
|
|
893
|
+
* @param options - Optional property overrides.
|
|
894
|
+
*/
|
|
895
|
+
constructor(label, value, options) {
|
|
896
|
+
super();
|
|
897
|
+
this.label = label;
|
|
898
|
+
this.value = value;
|
|
899
|
+
this.withDivider = options?.withDivider ?? false;
|
|
900
|
+
}
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Class implementation of the `TableColumn` interface.
|
|
904
|
+
*
|
|
905
|
+
* @remarks
|
|
906
|
+
* Column definition for structured tables.
|
|
907
|
+
*/
|
|
908
|
+
export class TableColumnClass extends GrammarNode {
|
|
909
|
+
/** Display header text */
|
|
910
|
+
header;
|
|
911
|
+
/**
|
|
912
|
+
* Text horizontal alignment
|
|
913
|
+
*
|
|
914
|
+
* @defaultValue TableColumnAlign.left
|
|
915
|
+
*/
|
|
916
|
+
align;
|
|
917
|
+
/** Optional width constraint */
|
|
918
|
+
width;
|
|
919
|
+
/**
|
|
920
|
+
* Initializes a new `TableColumnClass` instance.
|
|
921
|
+
*
|
|
922
|
+
* @param options - Optional property overrides.
|
|
923
|
+
*/
|
|
924
|
+
constructor(options) {
|
|
925
|
+
super();
|
|
926
|
+
this.header = options?.header;
|
|
927
|
+
this.align = options?.align ?? TableColumnAlign.left;
|
|
928
|
+
this.width = options?.width;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Class implementation of the `TableRow` interface.
|
|
933
|
+
*
|
|
934
|
+
* @remarks
|
|
935
|
+
* Single table row containing an array of cell values.
|
|
936
|
+
*/
|
|
937
|
+
export class TableRowClass extends GrammarNode {
|
|
938
|
+
/** Array of cell values corresponding to table columns */
|
|
939
|
+
cells;
|
|
940
|
+
/**
|
|
941
|
+
* Initializes a new `TableRowClass` instance.
|
|
942
|
+
*
|
|
943
|
+
* @param cells - Array of cell values corresponding to table columns
|
|
944
|
+
*/
|
|
945
|
+
constructor(cells) {
|
|
946
|
+
super();
|
|
947
|
+
this.cells = [...cells];
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Class implementation of the `TableElement` interface.
|
|
952
|
+
*
|
|
953
|
+
* @remarks
|
|
954
|
+
* Structured tabular data representation.
|
|
955
|
+
* Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
|
|
956
|
+
*/
|
|
957
|
+
export class TableElementClass extends BaseUiElement {
|
|
958
|
+
/**
|
|
959
|
+
* The discriminator type tag.
|
|
960
|
+
*
|
|
961
|
+
* @defaultValue "table"
|
|
962
|
+
*/
|
|
963
|
+
type = "table";
|
|
964
|
+
/** Tabular data rows */
|
|
965
|
+
rows;
|
|
966
|
+
/**
|
|
967
|
+
* Whether to render a column header row
|
|
968
|
+
*
|
|
969
|
+
* @defaultValue true
|
|
970
|
+
*/
|
|
971
|
+
hasHeader;
|
|
972
|
+
/** Optional explicit column definitions */
|
|
973
|
+
columns;
|
|
974
|
+
/** Maximum recommended visible columns at 360px panel width */
|
|
975
|
+
maxColumns;
|
|
976
|
+
/**
|
|
977
|
+
* Initializes a new `TableElementClass` instance.
|
|
978
|
+
*
|
|
979
|
+
* @param rows - Tabular data rows
|
|
980
|
+
* @param options - Optional property overrides.
|
|
981
|
+
*/
|
|
982
|
+
constructor(rows, options) {
|
|
983
|
+
super();
|
|
984
|
+
this.rows = [...rows];
|
|
985
|
+
this.hasHeader = options?.hasHeader ?? true;
|
|
986
|
+
this.columns = options?.columns ? [...options.columns] : undefined;
|
|
987
|
+
this.maxColumns = options?.maxColumns;
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Class implementation of the `RepeatingGroupEntry` interface.
|
|
992
|
+
*
|
|
993
|
+
* @remarks
|
|
994
|
+
* Single entry within a repeating group.
|
|
995
|
+
*/
|
|
996
|
+
export class RepeatingGroupEntryClass extends GrammarNode {
|
|
997
|
+
/** Entry label */
|
|
998
|
+
label;
|
|
999
|
+
/** Primary entry value or nested elements */
|
|
1000
|
+
value;
|
|
1001
|
+
/** Nested elements for structured entries */
|
|
1002
|
+
elements;
|
|
1003
|
+
/**
|
|
1004
|
+
* Initializes a new `RepeatingGroupEntryClass` instance.
|
|
1005
|
+
*
|
|
1006
|
+
* @param label - Entry label
|
|
1007
|
+
* @param options - Optional property overrides.
|
|
1008
|
+
*/
|
|
1009
|
+
constructor(label, options) {
|
|
1010
|
+
super();
|
|
1011
|
+
this.label = label;
|
|
1012
|
+
this.value = options?.value;
|
|
1013
|
+
this.elements = options?.elements ? [...options.elements] : undefined;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Class implementation of the `RepeatingGroupElement` interface.
|
|
1018
|
+
*
|
|
1019
|
+
* @remarks
|
|
1020
|
+
* Repeating group container where entries share uniform structure and retain per-entry labels.
|
|
1021
|
+
*/
|
|
1022
|
+
export class RepeatingGroupElementClass extends BaseUiElement {
|
|
1023
|
+
/**
|
|
1024
|
+
* The discriminator type tag.
|
|
1025
|
+
*
|
|
1026
|
+
* @defaultValue "repeating-group"
|
|
1027
|
+
*/
|
|
1028
|
+
type = "repeating-group";
|
|
1029
|
+
/** List of repeated entry records */
|
|
1030
|
+
entries;
|
|
1031
|
+
/** Optional section header for the group */
|
|
1032
|
+
title;
|
|
1033
|
+
/**
|
|
1034
|
+
* Initializes a new `RepeatingGroupElementClass` instance.
|
|
1035
|
+
*
|
|
1036
|
+
* @param entries - List of repeated entry records
|
|
1037
|
+
* @param options - Optional property overrides.
|
|
1038
|
+
*/
|
|
1039
|
+
constructor(entries, options) {
|
|
1040
|
+
super();
|
|
1041
|
+
this.entries = [...entries];
|
|
1042
|
+
this.title = options?.title;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
/**
|
|
1046
|
+
* Class implementation of the `CollapsibleGroupElement` interface.
|
|
1047
|
+
*
|
|
1048
|
+
* @remarks
|
|
1049
|
+
* Collapsible disclosure container (accordion) with summary badge.
|
|
1050
|
+
*/
|
|
1051
|
+
export class CollapsibleGroupElementClass extends BaseUiElement {
|
|
1052
|
+
/**
|
|
1053
|
+
* The discriminator type tag.
|
|
1054
|
+
*
|
|
1055
|
+
* @defaultValue "collapsible-group"
|
|
1056
|
+
*/
|
|
1057
|
+
type = "collapsible-group";
|
|
1058
|
+
/** Group title (e.g. "Show specimen details") */
|
|
1059
|
+
title;
|
|
1060
|
+
/** Nested content elements revealed when expanded */
|
|
1061
|
+
elements;
|
|
1062
|
+
/** Secondary summary indicator (e.g. "2 neutral values") */
|
|
1063
|
+
summary;
|
|
1064
|
+
/**
|
|
1065
|
+
* Whether the disclosure is open/expanded by default
|
|
1066
|
+
*
|
|
1067
|
+
* @defaultValue false
|
|
1068
|
+
*/
|
|
1069
|
+
defaultExpanded;
|
|
1070
|
+
/**
|
|
1071
|
+
* Initializes a new `CollapsibleGroupElementClass` instance.
|
|
1072
|
+
*
|
|
1073
|
+
* @param title - Group title (e.g. "Show specimen details")
|
|
1074
|
+
* @param elements - Nested content elements revealed when expanded
|
|
1075
|
+
* @param options - Optional property overrides.
|
|
1076
|
+
*/
|
|
1077
|
+
constructor(title, elements, options) {
|
|
1078
|
+
super();
|
|
1079
|
+
this.title = title;
|
|
1080
|
+
this.elements = [...elements];
|
|
1081
|
+
this.summary = options?.summary;
|
|
1082
|
+
this.defaultExpanded = options?.defaultExpanded ?? false;
|
|
1083
|
+
}
|
|
1084
|
+
}
|
|
1085
|
+
/**
|
|
1086
|
+
* Class implementation of the `DividerElement` interface.
|
|
1087
|
+
*
|
|
1088
|
+
* @remarks
|
|
1089
|
+
* Visual hairline separator separating sections or element groups.
|
|
1090
|
+
*/
|
|
1091
|
+
export class DividerElementClass extends BaseUiElement {
|
|
1092
|
+
/**
|
|
1093
|
+
* The discriminator type tag.
|
|
1094
|
+
*
|
|
1095
|
+
* @defaultValue "divider"
|
|
1096
|
+
*/
|
|
1097
|
+
type = "divider";
|
|
1098
|
+
/**
|
|
1099
|
+
* Line styling
|
|
1100
|
+
*
|
|
1101
|
+
* @defaultValue DividerStyle.hairline
|
|
1102
|
+
*/
|
|
1103
|
+
style;
|
|
1104
|
+
/**
|
|
1105
|
+
* Initializes a new `DividerElementClass` instance.
|
|
1106
|
+
*
|
|
1107
|
+
* @param options - Optional property overrides.
|
|
1108
|
+
*/
|
|
1109
|
+
constructor(options) {
|
|
1110
|
+
super();
|
|
1111
|
+
this.style = options?.style ?? DividerStyle.hairline;
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
/**
|
|
1115
|
+
* Fluent builder for constructing strongly-typed `FeatureBlock` card instances.
|
|
1116
|
+
*
|
|
1117
|
+
* @remarks
|
|
1118
|
+
* Root Feature Block container model.
|
|
1119
|
+
* Represents a complete feature card rendered inside the 360px panel.
|
|
1120
|
+
*/
|
|
1121
|
+
export class FeatureBlockBuilder {
|
|
1122
|
+
_title;
|
|
1123
|
+
_description;
|
|
1124
|
+
_elements = [];
|
|
1125
|
+
_actions = [];
|
|
1126
|
+
/**
|
|
1127
|
+
* Initializes a new `FeatureBlockBuilder` with mandatory card properties.
|
|
1128
|
+
*
|
|
1129
|
+
* @param title - Human-readable feature title displayed in the card header
|
|
1130
|
+
*/
|
|
1131
|
+
constructor(title) {
|
|
1132
|
+
this._title = title;
|
|
1133
|
+
}
|
|
1134
|
+
/**
|
|
1135
|
+
* Sets the `description` property on this card.
|
|
1136
|
+
*
|
|
1137
|
+
* @param description - Optional neutral subtitle / description for the feature
|
|
1138
|
+
* @returns This builder instance for method chaining.
|
|
1139
|
+
*/
|
|
1140
|
+
description(description) {
|
|
1141
|
+
this._description = description;
|
|
1142
|
+
return this;
|
|
1143
|
+
}
|
|
1144
|
+
/**
|
|
1145
|
+
* Appends a visual element to the card.
|
|
1146
|
+
*
|
|
1147
|
+
* @param element - The visual UI element component to add.
|
|
1148
|
+
* @returns This builder instance for method chaining.
|
|
1149
|
+
*/
|
|
1150
|
+
add(element) {
|
|
1151
|
+
this._elements.push(element);
|
|
1152
|
+
return this;
|
|
1153
|
+
}
|
|
1154
|
+
/**
|
|
1155
|
+
* Appends multiple elements items to the card.
|
|
1156
|
+
*
|
|
1157
|
+
* @param items - The `UiElement` items to add.
|
|
1158
|
+
* @returns This builder instance for method chaining.
|
|
1159
|
+
*/
|
|
1160
|
+
addElements(...items) {
|
|
1161
|
+
this._elements.push(...items);
|
|
1162
|
+
return this;
|
|
1163
|
+
}
|
|
1164
|
+
/**
|
|
1165
|
+
* Appends multiple actions items to the card.
|
|
1166
|
+
*
|
|
1167
|
+
* @param items - The `ActionElement` items to add.
|
|
1168
|
+
* @returns This builder instance for method chaining.
|
|
1169
|
+
*/
|
|
1170
|
+
addActions(...items) {
|
|
1171
|
+
this._actions.push(...items);
|
|
1172
|
+
return this;
|
|
1173
|
+
}
|
|
1174
|
+
/**
|
|
1175
|
+
* Appends a single action to the card.
|
|
1176
|
+
*
|
|
1177
|
+
* @param item - The `ActionElement` item to add.
|
|
1178
|
+
* @returns This builder instance for method chaining.
|
|
1179
|
+
*/
|
|
1180
|
+
addAction(item) {
|
|
1181
|
+
this._actions.push(item);
|
|
1182
|
+
return this;
|
|
1183
|
+
}
|
|
1184
|
+
/**
|
|
1185
|
+
* Appends a `StringShortElement` component to this feature card.
|
|
1186
|
+
*
|
|
1187
|
+
* @remarks
|
|
1188
|
+
* Short string primitive element.
|
|
1189
|
+
* Supports plain text or compact chip pill presentation.
|
|
1190
|
+
*
|
|
1191
|
+
* @param value - Text value
|
|
1192
|
+
* @param options - Optional component settings.
|
|
1193
|
+
* @returns This builder instance for method chaining.
|
|
1194
|
+
*/
|
|
1195
|
+
addStringShort(value, options) {
|
|
1196
|
+
return this.add(stringShort(value, options));
|
|
1197
|
+
}
|
|
1198
|
+
/**
|
|
1199
|
+
* Appends a `StringLongElement` component to this feature card.
|
|
1200
|
+
*
|
|
1201
|
+
* @remarks
|
|
1202
|
+
* Multiline text block primitive element for descriptions, comments, or prose.
|
|
1203
|
+
*
|
|
1204
|
+
* @param value - Text value
|
|
1205
|
+
* @param options - Optional component settings.
|
|
1206
|
+
* @returns This builder instance for method chaining.
|
|
1207
|
+
*/
|
|
1208
|
+
addStringLong(value, options) {
|
|
1209
|
+
return this.add(stringLong(value, options));
|
|
1210
|
+
}
|
|
1211
|
+
/**
|
|
1212
|
+
* Appends a `StringCodeElement` component to this feature card.
|
|
1213
|
+
*
|
|
1214
|
+
* @remarks
|
|
1215
|
+
* Monospace code block or formatted code snippet representation.
|
|
1216
|
+
*
|
|
1217
|
+
* @param value - Text value
|
|
1218
|
+
* @param options - Optional component settings.
|
|
1219
|
+
* @returns This builder instance for method chaining.
|
|
1220
|
+
*/
|
|
1221
|
+
addStringCode(value, options) {
|
|
1222
|
+
return this.add(stringCode(value, options));
|
|
1223
|
+
}
|
|
1224
|
+
/**
|
|
1225
|
+
* Appends a `StringUrlElement` component to this feature card.
|
|
1226
|
+
*
|
|
1227
|
+
* @remarks
|
|
1228
|
+
* Hyperlink representation for external or internal URL navigation.
|
|
1229
|
+
*
|
|
1230
|
+
* @param value - Target URL or navigation destination
|
|
1231
|
+
* @param options - Optional component settings.
|
|
1232
|
+
* @returns This builder instance for method chaining.
|
|
1233
|
+
*/
|
|
1234
|
+
addStringUrl(value, options) {
|
|
1235
|
+
return this.add(stringUrl(value, options));
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Appends a `IdentifierElement` component to this feature card.
|
|
1239
|
+
*
|
|
1240
|
+
* @remarks
|
|
1241
|
+
* Monospace semantic identifier representation.
|
|
1242
|
+
*
|
|
1243
|
+
* @param value - Identifier string value
|
|
1244
|
+
* @param options - Optional component settings.
|
|
1245
|
+
* @returns This builder instance for method chaining.
|
|
1246
|
+
*/
|
|
1247
|
+
addIdentifier(value, options) {
|
|
1248
|
+
return this.add(identifier(value, options));
|
|
1249
|
+
}
|
|
1250
|
+
/**
|
|
1251
|
+
* Appends a `RatioElement` component to this feature card.
|
|
1252
|
+
*
|
|
1253
|
+
* @remarks
|
|
1254
|
+
* Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
|
|
1255
|
+
*
|
|
1256
|
+
* @param value - Aspect ratio textual expression
|
|
1257
|
+
* @param options - Optional component settings.
|
|
1258
|
+
* @returns This builder instance for method chaining.
|
|
1259
|
+
*/
|
|
1260
|
+
addRatio(value, options) {
|
|
1261
|
+
return this.add(ratio(value, options));
|
|
1262
|
+
}
|
|
1263
|
+
/**
|
|
1264
|
+
* Appends a `ColourElement` component to this feature card.
|
|
1265
|
+
*
|
|
1266
|
+
* @remarks
|
|
1267
|
+
* Single color swatch representation with hex value and copy affordance.
|
|
1268
|
+
*
|
|
1269
|
+
* @param value - Hexadecimal color code
|
|
1270
|
+
* @param options - Optional component settings.
|
|
1271
|
+
* @returns This builder instance for method chaining.
|
|
1272
|
+
*/
|
|
1273
|
+
addColour(value, options) {
|
|
1274
|
+
return this.add(colour(value, options));
|
|
1275
|
+
}
|
|
1276
|
+
/**
|
|
1277
|
+
* Appends a `ColourElement` component to this feature card.
|
|
1278
|
+
*
|
|
1279
|
+
* @remarks
|
|
1280
|
+
* Single color swatch representation with hex value and copy affordance.
|
|
1281
|
+
*
|
|
1282
|
+
* @param value - Hexadecimal color code
|
|
1283
|
+
* @param options - Optional component settings.
|
|
1284
|
+
* @returns This builder instance for method chaining.
|
|
1285
|
+
*/
|
|
1286
|
+
addColorSwatch(value, options) {
|
|
1287
|
+
return this.add(colorSwatch(value, options));
|
|
1288
|
+
}
|
|
1289
|
+
/**
|
|
1290
|
+
* Appends a `NumberUnboundedElement` component to this feature card.
|
|
1291
|
+
*
|
|
1292
|
+
* @remarks
|
|
1293
|
+
* Plain unbounded numeric value primitive element.
|
|
1294
|
+
*
|
|
1295
|
+
* @param value - Numeric value
|
|
1296
|
+
* @param options - Optional component settings.
|
|
1297
|
+
* @returns This builder instance for method chaining.
|
|
1298
|
+
*/
|
|
1299
|
+
addNumberUnbounded(value, options) {
|
|
1300
|
+
return this.add(numberUnbounded(value, options));
|
|
1301
|
+
}
|
|
1302
|
+
/**
|
|
1303
|
+
* Appends a `NumberBoundedStarsElement` component to this feature card.
|
|
1304
|
+
*
|
|
1305
|
+
* @remarks
|
|
1306
|
+
* Bounded numeric rating represented as visual stars.
|
|
1307
|
+
*
|
|
1308
|
+
* @param value - Numeric rating score
|
|
1309
|
+
* @param options - Optional component settings.
|
|
1310
|
+
* @returns This builder instance for method chaining.
|
|
1311
|
+
*/
|
|
1312
|
+
addNumberBoundedStars(value, options) {
|
|
1313
|
+
return this.add(numberBoundedStars(value, options));
|
|
1314
|
+
}
|
|
1315
|
+
/**
|
|
1316
|
+
* Appends a `NumberBoundedStarsElement` component to this feature card.
|
|
1317
|
+
*
|
|
1318
|
+
* @remarks
|
|
1319
|
+
* Bounded numeric rating represented as visual stars.
|
|
1320
|
+
*
|
|
1321
|
+
* @param value - Numeric rating score
|
|
1322
|
+
* @param options - Optional component settings.
|
|
1323
|
+
* @returns This builder instance for method chaining.
|
|
1324
|
+
*/
|
|
1325
|
+
addNumberStars(value, options) {
|
|
1326
|
+
return this.add(numberStars(value, options));
|
|
1327
|
+
}
|
|
1328
|
+
/**
|
|
1329
|
+
* Appends a `NumberBoundedMeterElement` component to this feature card.
|
|
1330
|
+
*
|
|
1331
|
+
* @remarks
|
|
1332
|
+
* Bounded numeric meter representation (read-only progress / score bar).
|
|
1333
|
+
*
|
|
1334
|
+
* @param value - Numeric value
|
|
1335
|
+
* @param options - Optional component settings.
|
|
1336
|
+
* @returns This builder instance for method chaining.
|
|
1337
|
+
*/
|
|
1338
|
+
addNumberBoundedMeter(value, options) {
|
|
1339
|
+
return this.add(numberBoundedMeter(value, options));
|
|
1340
|
+
}
|
|
1341
|
+
/**
|
|
1342
|
+
* Appends a `NumberBoundedMeterElement` component to this feature card.
|
|
1343
|
+
*
|
|
1344
|
+
* @remarks
|
|
1345
|
+
* Bounded numeric meter representation (read-only progress / score bar).
|
|
1346
|
+
*
|
|
1347
|
+
* @param value - Numeric value
|
|
1348
|
+
* @param options - Optional component settings.
|
|
1349
|
+
* @returns This builder instance for method chaining.
|
|
1350
|
+
*/
|
|
1351
|
+
addNumberMeter(value, options) {
|
|
1352
|
+
return this.add(numberMeter(value, options));
|
|
1353
|
+
}
|
|
1354
|
+
/**
|
|
1355
|
+
* Appends a `BooleanPlainElement` component to this feature card.
|
|
1356
|
+
*
|
|
1357
|
+
* @remarks
|
|
1358
|
+
* Plain boolean value representation (textual "true" / "false").
|
|
1359
|
+
*
|
|
1360
|
+
* @param value - Boolean state value
|
|
1361
|
+
* @param options - Optional component settings.
|
|
1362
|
+
* @returns This builder instance for method chaining.
|
|
1363
|
+
*/
|
|
1364
|
+
addBooleanPlain(value, options) {
|
|
1365
|
+
return this.add(booleanPlain(value, options));
|
|
1366
|
+
}
|
|
1367
|
+
/**
|
|
1368
|
+
* Appends a `BooleanBadgeElement` component to this feature card.
|
|
1369
|
+
*
|
|
1370
|
+
* @remarks
|
|
1371
|
+
* Visual badge pill representation of a boolean state.
|
|
1372
|
+
*
|
|
1373
|
+
* @param value - Boolean state value
|
|
1374
|
+
* @param options - Optional component settings.
|
|
1375
|
+
* @returns This builder instance for method chaining.
|
|
1376
|
+
*/
|
|
1377
|
+
addBooleanBadge(value, options) {
|
|
1378
|
+
return this.add(booleanBadge(value, options));
|
|
1379
|
+
}
|
|
1380
|
+
/**
|
|
1381
|
+
* Appends a `TimestampElement` component to this feature card.
|
|
1382
|
+
*
|
|
1383
|
+
* @remarks
|
|
1384
|
+
* Formatted date and time representation.
|
|
1385
|
+
*
|
|
1386
|
+
* @param value - ISO 8601 date string or epoch timestamp in milliseconds
|
|
1387
|
+
* @param options - Optional component settings.
|
|
1388
|
+
* @returns This builder instance for method chaining.
|
|
1389
|
+
*/
|
|
1390
|
+
addTimestamp(value, options) {
|
|
1391
|
+
return this.add(timestamp(value, options));
|
|
1392
|
+
}
|
|
1393
|
+
/**
|
|
1394
|
+
* Appends a `ImageReferenceElement` component to this feature card.
|
|
1395
|
+
*
|
|
1396
|
+
* @remarks
|
|
1397
|
+
* Thumbnail image reference with placeholder fallback handling.
|
|
1398
|
+
*
|
|
1399
|
+
* @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
|
|
1400
|
+
* @param options - Optional component settings.
|
|
1401
|
+
* @returns This builder instance for method chaining.
|
|
1402
|
+
*/
|
|
1403
|
+
addImageReference(src, options) {
|
|
1404
|
+
return this.add(imageReference(src, options));
|
|
1405
|
+
}
|
|
1406
|
+
/**
|
|
1407
|
+
* Appends a `ImageReferenceElement` component to this feature card.
|
|
1408
|
+
*
|
|
1409
|
+
* @remarks
|
|
1410
|
+
* Thumbnail image reference with placeholder fallback handling.
|
|
1411
|
+
*
|
|
1412
|
+
* @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
|
|
1413
|
+
* @param options - Optional component settings.
|
|
1414
|
+
* @returns This builder instance for method chaining.
|
|
1415
|
+
*/
|
|
1416
|
+
addImageRef(src, options) {
|
|
1417
|
+
return this.add(imageRef(src, options));
|
|
1418
|
+
}
|
|
1419
|
+
/**
|
|
1420
|
+
* Appends a `DominantColourSetElement` component to this feature card.
|
|
1421
|
+
*
|
|
1422
|
+
* @remarks
|
|
1423
|
+
* Dominant color set palette rendered in descending dominance order.
|
|
1424
|
+
*
|
|
1425
|
+
* @param colors - List of hexadecimal color strings in descending priority
|
|
1426
|
+
* @returns This builder instance for method chaining.
|
|
1427
|
+
*/
|
|
1428
|
+
addDominantColourSet(colors) {
|
|
1429
|
+
return this.add(dominantColourSet(colors));
|
|
1430
|
+
}
|
|
1431
|
+
/**
|
|
1432
|
+
* Appends a `DominantColourSetElement` component to this feature card.
|
|
1433
|
+
*
|
|
1434
|
+
* @remarks
|
|
1435
|
+
* Dominant color set palette rendered in descending dominance order.
|
|
1436
|
+
*
|
|
1437
|
+
* @param colors - List of hexadecimal color strings in descending priority
|
|
1438
|
+
* @returns This builder instance for method chaining.
|
|
1439
|
+
*/
|
|
1440
|
+
addDominantColors(colors) {
|
|
1441
|
+
return this.add(dominantColors(colors));
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Appends a `MarkdownBlockElement` component to this feature card.
|
|
1445
|
+
*
|
|
1446
|
+
* @remarks
|
|
1447
|
+
* Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
|
|
1448
|
+
*
|
|
1449
|
+
* @param content - Raw Markdown markup content
|
|
1450
|
+
* @returns This builder instance for method chaining.
|
|
1451
|
+
*/
|
|
1452
|
+
addMarkdownBlock(content) {
|
|
1453
|
+
return this.add(markdownBlock(content));
|
|
1454
|
+
}
|
|
1455
|
+
/**
|
|
1456
|
+
* Appends a `MarkdownBlockElement` component to this feature card.
|
|
1457
|
+
*
|
|
1458
|
+
* @remarks
|
|
1459
|
+
* Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
|
|
1460
|
+
*
|
|
1461
|
+
* @param content - Raw Markdown markup content
|
|
1462
|
+
* @returns This builder instance for method chaining.
|
|
1463
|
+
*/
|
|
1464
|
+
addMarkdown(content) {
|
|
1465
|
+
return this.add(markdown(content));
|
|
1466
|
+
}
|
|
1467
|
+
/**
|
|
1468
|
+
* Appends a `HtmlBlockElement` component to this feature card.
|
|
1469
|
+
*
|
|
1470
|
+
* @remarks
|
|
1471
|
+
* Sandboxed HTML rendering escape hatch.
|
|
1472
|
+
*
|
|
1473
|
+
* @param content - Raw HTML markup content
|
|
1474
|
+
* @returns This builder instance for method chaining.
|
|
1475
|
+
*/
|
|
1476
|
+
addHtmlBlock(content) {
|
|
1477
|
+
return this.add(htmlBlock(content));
|
|
1478
|
+
}
|
|
1479
|
+
/**
|
|
1480
|
+
* Appends a `HtmlBlockElement` component to this feature card.
|
|
1481
|
+
*
|
|
1482
|
+
* @remarks
|
|
1483
|
+
* Sandboxed HTML rendering escape hatch.
|
|
1484
|
+
*
|
|
1485
|
+
* @param content - Raw HTML markup content
|
|
1486
|
+
* @returns This builder instance for method chaining.
|
|
1487
|
+
*/
|
|
1488
|
+
addHtml(content) {
|
|
1489
|
+
return this.add(html(content));
|
|
1490
|
+
}
|
|
1491
|
+
/**
|
|
1492
|
+
* Appends a `MultiSlotRowElement` component to this feature card.
|
|
1493
|
+
*
|
|
1494
|
+
* @remarks
|
|
1495
|
+
* Multi-slot horizontal row with declared column width proportions.
|
|
1496
|
+
* Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
|
|
1497
|
+
*
|
|
1498
|
+
* @param slots - List of slots comprising the row
|
|
1499
|
+
* @param options - Optional component settings.
|
|
1500
|
+
* @returns This builder instance for method chaining.
|
|
1501
|
+
*/
|
|
1502
|
+
addMultiSlotRow(slots, options) {
|
|
1503
|
+
return this.add(multiSlotRow(slots, options));
|
|
1504
|
+
}
|
|
1505
|
+
/**
|
|
1506
|
+
* Appends a `MultiSlotRowElement` component to this feature card.
|
|
1507
|
+
*
|
|
1508
|
+
* @remarks
|
|
1509
|
+
* Multi-slot horizontal row with declared column width proportions.
|
|
1510
|
+
* Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
|
|
1511
|
+
*
|
|
1512
|
+
* @param slots - List of slots comprising the row
|
|
1513
|
+
* @param options - Optional component settings.
|
|
1514
|
+
* @returns This builder instance for method chaining.
|
|
1515
|
+
*/
|
|
1516
|
+
addMultiSlot(slots, options) {
|
|
1517
|
+
return this.add(multiSlot(slots, options));
|
|
1518
|
+
}
|
|
1519
|
+
/**
|
|
1520
|
+
* Appends a `LabelValueRowElement` component to this feature card.
|
|
1521
|
+
*
|
|
1522
|
+
* @remarks
|
|
1523
|
+
* Standard label and value row.
|
|
1524
|
+
* Displays a muted label on the left and value representation on the right with a vertical dividing line.
|
|
1525
|
+
*
|
|
1526
|
+
* @param label - Key or descriptive label displayed muted on the left
|
|
1527
|
+
* @param value - Rendered value element on the right
|
|
1528
|
+
* @param options - Optional component settings.
|
|
1529
|
+
* @returns This builder instance for method chaining.
|
|
1530
|
+
*/
|
|
1531
|
+
addLabelValueRow(label, value, options) {
|
|
1532
|
+
return this.add(labelValueRow(label, value, options));
|
|
1533
|
+
}
|
|
1534
|
+
/**
|
|
1535
|
+
* Appends a `LabelValueRowElement` component to this feature card.
|
|
1536
|
+
*
|
|
1537
|
+
* @remarks
|
|
1538
|
+
* Standard label and value row.
|
|
1539
|
+
* Displays a muted label on the left and value representation on the right with a vertical dividing line.
|
|
1540
|
+
*
|
|
1541
|
+
* @param label - Key or descriptive label displayed muted on the left
|
|
1542
|
+
* @param value - Rendered value element on the right
|
|
1543
|
+
* @param options - Optional component settings.
|
|
1544
|
+
* @returns This builder instance for method chaining.
|
|
1545
|
+
*/
|
|
1546
|
+
addLabelValue(label, value, options) {
|
|
1547
|
+
return this.add(labelValue(label, value, options));
|
|
1548
|
+
}
|
|
1549
|
+
/**
|
|
1550
|
+
* Appends a `TableElement` component to this feature card.
|
|
1551
|
+
*
|
|
1552
|
+
* @remarks
|
|
1553
|
+
* Structured tabular data representation.
|
|
1554
|
+
* Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
|
|
1555
|
+
*
|
|
1556
|
+
* @param rows - Tabular data rows
|
|
1557
|
+
* @param options - Optional component settings.
|
|
1558
|
+
* @returns This builder instance for method chaining.
|
|
1559
|
+
*/
|
|
1560
|
+
addTable(rows, options) {
|
|
1561
|
+
return this.add(table(rows, options));
|
|
1562
|
+
}
|
|
1563
|
+
/**
|
|
1564
|
+
* Appends a `RepeatingGroupElement` component to this feature card.
|
|
1565
|
+
*
|
|
1566
|
+
* @remarks
|
|
1567
|
+
* Repeating group container where entries share uniform structure and retain per-entry labels.
|
|
1568
|
+
*
|
|
1569
|
+
* @param entries - List of repeated entry records
|
|
1570
|
+
* @param options - Optional component settings.
|
|
1571
|
+
* @returns This builder instance for method chaining.
|
|
1572
|
+
*/
|
|
1573
|
+
addRepeatingGroup(entries, options) {
|
|
1574
|
+
return this.add(repeatingGroup(entries, options));
|
|
1575
|
+
}
|
|
1576
|
+
/**
|
|
1577
|
+
* Appends a `CollapsibleGroupElement` component to this feature card.
|
|
1578
|
+
*
|
|
1579
|
+
* @remarks
|
|
1580
|
+
* Collapsible disclosure container (accordion) with summary badge.
|
|
1581
|
+
*
|
|
1582
|
+
* @param title - Group title (e.g. "Show specimen details")
|
|
1583
|
+
* @param elements - Nested content elements revealed when expanded
|
|
1584
|
+
* @param options - Optional component settings.
|
|
1585
|
+
* @returns This builder instance for method chaining.
|
|
1586
|
+
*/
|
|
1587
|
+
addCollapsibleGroup(title, elements, options) {
|
|
1588
|
+
return this.add(collapsibleGroup(title, elements, options));
|
|
1589
|
+
}
|
|
1590
|
+
/**
|
|
1591
|
+
* Appends a `DividerElement` component to this feature card.
|
|
1592
|
+
*
|
|
1593
|
+
* @remarks
|
|
1594
|
+
* Visual hairline separator separating sections or element groups.
|
|
1595
|
+
*
|
|
1596
|
+
* @param options - Optional component settings.
|
|
1597
|
+
* @returns This builder instance for method chaining.
|
|
1598
|
+
*/
|
|
1599
|
+
addDivider(options) {
|
|
1600
|
+
return this.add(divider(options));
|
|
1601
|
+
}
|
|
1602
|
+
/**
|
|
1603
|
+
* Finalizes and returns the complete strongly-typed `FeatureBlock` card object.
|
|
1604
|
+
*
|
|
1605
|
+
* @returns The constructed `FeatureBlock` object.
|
|
1606
|
+
*/
|
|
1607
|
+
build() {
|
|
1608
|
+
return {
|
|
1609
|
+
schemaVersion: "1.0",
|
|
1610
|
+
title: this._title,
|
|
1611
|
+
description: this._description,
|
|
1612
|
+
elements: [...this._elements],
|
|
1613
|
+
actions: this._actions.length > 0 ? [...this._actions] : undefined
|
|
1614
|
+
};
|
|
1615
|
+
}
|
|
1616
|
+
}
|
|
1617
|
+
/** Static helper factory object for `FeatureBlock`. */
|
|
1618
|
+
export const FeatureBlock = {
|
|
1619
|
+
/**
|
|
1620
|
+
* Creates a new fluent builder for constructing a `FeatureBlock`.
|
|
1621
|
+
*
|
|
1622
|
+
* @param title - Human-readable feature title displayed in the card header
|
|
1623
|
+
* @returns A new `FeatureBlockBuilder` instance.
|
|
1624
|
+
*/
|
|
1625
|
+
builder(title) {
|
|
1626
|
+
return new FeatureBlockBuilder(title);
|
|
1627
|
+
},
|
|
1628
|
+
/**
|
|
1629
|
+
* Creates a `FeatureBlock` directly from a properties object.
|
|
1630
|
+
*
|
|
1631
|
+
* @param params - Card configuration properties.
|
|
1632
|
+
* @returns A completed `FeatureBlock` object.
|
|
1633
|
+
*/
|
|
1634
|
+
create(params) {
|
|
1635
|
+
return {
|
|
1636
|
+
schemaVersion: "1.0",
|
|
1637
|
+
title: params.title,
|
|
1638
|
+
description: params.description,
|
|
1639
|
+
elements: [...params.elements],
|
|
1640
|
+
actions: params.actions ? [...params.actions] : undefined
|
|
1641
|
+
};
|
|
1642
|
+
}
|
|
1643
|
+
};
|
|
1644
|
+
/**
|
|
1645
|
+
* Functional helper to create a `FeatureBlock` instance directly.
|
|
1646
|
+
*
|
|
1647
|
+
* @remarks
|
|
1648
|
+
* Root Feature Block container model.
|
|
1649
|
+
* Represents a complete feature card rendered inside the 360px panel.
|
|
1650
|
+
*
|
|
1651
|
+
* @param title - Human-readable feature title displayed in the card header
|
|
1652
|
+
* @param options - Optional card configuration (description, attribution, elements, actions).
|
|
1653
|
+
* @returns A strongly-typed `FeatureBlock` card.
|
|
1654
|
+
*/
|
|
1655
|
+
export function createFeatureBlock(title, options) {
|
|
1656
|
+
return {
|
|
1657
|
+
schemaVersion: "1.0",
|
|
1658
|
+
title,
|
|
1659
|
+
description: options?.description,
|
|
1660
|
+
elements: options?.elements ? [...options.elements] : [],
|
|
1661
|
+
actions: options?.actions ? [...options.actions] : undefined
|
|
1662
|
+
};
|
|
1663
|
+
}
|
|
1664
|
+
// --- Functional DSL Factory Helpers ---
|
|
1665
|
+
/**
|
|
1666
|
+
* Creates a `TruncateOptions` component instance.
|
|
1667
|
+
*
|
|
1668
|
+
* @remarks
|
|
1669
|
+
* Truncation configuration for long textual content with optional expand affordance.
|
|
1670
|
+
*
|
|
1671
|
+
* @param characterLimit - Maximum number of characters to display before truncating
|
|
1672
|
+
* @param options - Optional settings (showMore (defaults to `true`)).
|
|
1673
|
+
* @returns A strongly-typed `TruncateOptions` object.
|
|
1674
|
+
*/
|
|
1675
|
+
export function truncateOptions(characterLimit, options) {
|
|
1676
|
+
return {
|
|
1677
|
+
characterLimit,
|
|
1678
|
+
showMore: options?.showMore ?? true
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
/**
|
|
1682
|
+
* Creates a `PrimitiveModifiers` component instance.
|
|
1683
|
+
*
|
|
1684
|
+
* @remarks
|
|
1685
|
+
* Common modifier traits that can be attached to primitive elements.
|
|
1686
|
+
*
|
|
1687
|
+
* @param options - Optional settings (copyable, truncate, emphasis (defaults to `normal`), monospace (defaults to `false`)).
|
|
1688
|
+
* @returns A strongly-typed `PrimitiveModifiers` object.
|
|
1689
|
+
*/
|
|
1690
|
+
export function primitiveModifiers(options) {
|
|
1691
|
+
return {
|
|
1692
|
+
copyable: options?.copyable,
|
|
1693
|
+
truncate: options?.truncate,
|
|
1694
|
+
emphasis: options?.emphasis ?? Emphasis.normal,
|
|
1695
|
+
monospace: options?.monospace ?? false
|
|
1696
|
+
};
|
|
1697
|
+
}
|
|
1698
|
+
/**
|
|
1699
|
+
* Creates a `StringShortElement` component instance.
|
|
1700
|
+
*
|
|
1701
|
+
* @remarks
|
|
1702
|
+
* Short string primitive element.
|
|
1703
|
+
* Supports plain text or compact chip pill presentation.
|
|
1704
|
+
*
|
|
1705
|
+
* @param value - Text value
|
|
1706
|
+
* @param options - Optional settings (representation (defaults to `plain`), modifiers).
|
|
1707
|
+
* @returns A strongly-typed `StringShortElement` object.
|
|
1708
|
+
*/
|
|
1709
|
+
export function stringShort(value, options) {
|
|
1710
|
+
return {
|
|
1711
|
+
type: "string-short",
|
|
1712
|
+
value,
|
|
1713
|
+
representation: options?.representation ?? StringShortRepresentation.plain,
|
|
1714
|
+
modifiers: options?.modifiers
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
/**
|
|
1718
|
+
* Creates a `StringLongElement` component instance.
|
|
1719
|
+
*
|
|
1720
|
+
* @remarks
|
|
1721
|
+
* Multiline text block primitive element for descriptions, comments, or prose.
|
|
1722
|
+
*
|
|
1723
|
+
* @param value - Text value
|
|
1724
|
+
* @param options - Optional settings (modifiers).
|
|
1725
|
+
* @returns A strongly-typed `StringLongElement` object.
|
|
1726
|
+
*/
|
|
1727
|
+
export function stringLong(value, options) {
|
|
1728
|
+
return {
|
|
1729
|
+
type: "string-long",
|
|
1730
|
+
value,
|
|
1731
|
+
modifiers: options?.modifiers
|
|
1732
|
+
};
|
|
1733
|
+
}
|
|
1734
|
+
/**
|
|
1735
|
+
* Creates a `StringCodeElement` component instance.
|
|
1736
|
+
*
|
|
1737
|
+
* @remarks
|
|
1738
|
+
* Monospace code block or formatted code snippet representation.
|
|
1739
|
+
*
|
|
1740
|
+
* @param value - Text value
|
|
1741
|
+
* @param options - Optional settings (language, modifiers).
|
|
1742
|
+
* @returns A strongly-typed `StringCodeElement` object.
|
|
1743
|
+
*/
|
|
1744
|
+
export function stringCode(value, options) {
|
|
1745
|
+
return {
|
|
1746
|
+
type: "string-code",
|
|
1747
|
+
value,
|
|
1748
|
+
language: options?.language,
|
|
1749
|
+
modifiers: options?.modifiers
|
|
1750
|
+
};
|
|
1751
|
+
}
|
|
1752
|
+
/**
|
|
1753
|
+
* Creates a `StringUrlElement` component instance.
|
|
1754
|
+
*
|
|
1755
|
+
* @remarks
|
|
1756
|
+
* Hyperlink representation for external or internal URL navigation.
|
|
1757
|
+
*
|
|
1758
|
+
* @param value - Target URL or navigation destination
|
|
1759
|
+
* @param options - Optional settings (label, modifiers).
|
|
1760
|
+
* @returns A strongly-typed `StringUrlElement` object.
|
|
1761
|
+
*/
|
|
1762
|
+
export function stringUrl(value, options) {
|
|
1763
|
+
return {
|
|
1764
|
+
type: "string-url",
|
|
1765
|
+
value,
|
|
1766
|
+
label: options?.label,
|
|
1767
|
+
modifiers: options?.modifiers
|
|
1768
|
+
};
|
|
1769
|
+
}
|
|
1770
|
+
/**
|
|
1771
|
+
* Creates a `IdentifierElement` component instance.
|
|
1772
|
+
*
|
|
1773
|
+
* @remarks
|
|
1774
|
+
* Monospace semantic identifier representation.
|
|
1775
|
+
*
|
|
1776
|
+
* @param value - Identifier string value
|
|
1777
|
+
* @param options - Optional settings (modifiers).
|
|
1778
|
+
* @returns A strongly-typed `IdentifierElement` object.
|
|
1779
|
+
*/
|
|
1780
|
+
export function identifier(value, options) {
|
|
1781
|
+
return {
|
|
1782
|
+
type: "identifier",
|
|
1783
|
+
value,
|
|
1784
|
+
modifiers: options?.modifiers
|
|
1785
|
+
};
|
|
1786
|
+
}
|
|
1787
|
+
/**
|
|
1788
|
+
* Creates a `RatioElement` component instance.
|
|
1789
|
+
*
|
|
1790
|
+
* @remarks
|
|
1791
|
+
* Aspect ratio representation (e.g. "16:9", "4:3", "1:1").
|
|
1792
|
+
*
|
|
1793
|
+
* @param value - Aspect ratio textual expression
|
|
1794
|
+
* @param options - Optional settings (modifiers).
|
|
1795
|
+
* @returns A strongly-typed `RatioElement` object.
|
|
1796
|
+
*/
|
|
1797
|
+
export function ratio(value, options) {
|
|
1798
|
+
return {
|
|
1799
|
+
type: "ratio",
|
|
1800
|
+
value,
|
|
1801
|
+
modifiers: options?.modifiers
|
|
1802
|
+
};
|
|
1803
|
+
}
|
|
1804
|
+
/**
|
|
1805
|
+
* Creates a `ColourElement` component instance.
|
|
1806
|
+
*
|
|
1807
|
+
* @remarks
|
|
1808
|
+
* Single color swatch representation with hex value and copy affordance.
|
|
1809
|
+
*
|
|
1810
|
+
* @param value - Hexadecimal color code
|
|
1811
|
+
* @param options - Optional settings (modifiers).
|
|
1812
|
+
* @returns A strongly-typed `ColourElement` object.
|
|
1813
|
+
*/
|
|
1814
|
+
export function colour(value, options) {
|
|
1815
|
+
return {
|
|
1816
|
+
type: "color-swatch",
|
|
1817
|
+
value,
|
|
1818
|
+
modifiers: options?.modifiers
|
|
1819
|
+
};
|
|
1820
|
+
}
|
|
1821
|
+
/**
|
|
1822
|
+
* Creates a `ColourElement` component instance.
|
|
1823
|
+
*
|
|
1824
|
+
* @remarks
|
|
1825
|
+
* Single color swatch representation with hex value and copy affordance.
|
|
1826
|
+
*
|
|
1827
|
+
* @param value - Hexadecimal color code
|
|
1828
|
+
* @param options - Optional settings (modifiers).
|
|
1829
|
+
* @returns A strongly-typed `ColourElement` object.
|
|
1830
|
+
*/
|
|
1831
|
+
export function colorSwatch(value, options) {
|
|
1832
|
+
return {
|
|
1833
|
+
type: "color-swatch",
|
|
1834
|
+
value,
|
|
1835
|
+
modifiers: options?.modifiers
|
|
1836
|
+
};
|
|
1837
|
+
}
|
|
1838
|
+
/**
|
|
1839
|
+
* Creates a `NumberUnboundedElement` component instance.
|
|
1840
|
+
*
|
|
1841
|
+
* @remarks
|
|
1842
|
+
* Plain unbounded numeric value primitive element.
|
|
1843
|
+
*
|
|
1844
|
+
* @param value - Numeric value
|
|
1845
|
+
* @param options - Optional settings (unit, modifiers).
|
|
1846
|
+
* @returns A strongly-typed `NumberUnboundedElement` object.
|
|
1847
|
+
*/
|
|
1848
|
+
export function numberUnbounded(value, options) {
|
|
1849
|
+
return {
|
|
1850
|
+
type: "number-unbounded",
|
|
1851
|
+
value,
|
|
1852
|
+
unit: options?.unit,
|
|
1853
|
+
modifiers: options?.modifiers
|
|
1854
|
+
};
|
|
1855
|
+
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Creates a `NumberBoundedStarsElement` component instance.
|
|
1858
|
+
*
|
|
1859
|
+
* @remarks
|
|
1860
|
+
* Bounded numeric rating represented as visual stars.
|
|
1861
|
+
*
|
|
1862
|
+
* @param value - Numeric rating score
|
|
1863
|
+
* @param options - Optional settings (maximum, modifiers).
|
|
1864
|
+
* @returns A strongly-typed `NumberBoundedStarsElement` object.
|
|
1865
|
+
*/
|
|
1866
|
+
export function numberBoundedStars(value, options) {
|
|
1867
|
+
return {
|
|
1868
|
+
type: "number-stars",
|
|
1869
|
+
value,
|
|
1870
|
+
maximum: options?.maximum,
|
|
1871
|
+
modifiers: options?.modifiers
|
|
1872
|
+
};
|
|
1873
|
+
}
|
|
1874
|
+
/**
|
|
1875
|
+
* Creates a `NumberBoundedStarsElement` component instance.
|
|
1876
|
+
*
|
|
1877
|
+
* @remarks
|
|
1878
|
+
* Bounded numeric rating represented as visual stars.
|
|
1879
|
+
*
|
|
1880
|
+
* @param value - Numeric rating score
|
|
1881
|
+
* @param options - Optional settings (maximum, modifiers).
|
|
1882
|
+
* @returns A strongly-typed `NumberBoundedStarsElement` object.
|
|
1883
|
+
*/
|
|
1884
|
+
export function numberStars(value, options) {
|
|
1885
|
+
return {
|
|
1886
|
+
type: "number-stars",
|
|
1887
|
+
value,
|
|
1888
|
+
maximum: options?.maximum,
|
|
1889
|
+
modifiers: options?.modifiers
|
|
1890
|
+
};
|
|
1891
|
+
}
|
|
1892
|
+
/**
|
|
1893
|
+
* Creates a `NumberBoundedMeterElement` component instance.
|
|
1894
|
+
*
|
|
1895
|
+
* @remarks
|
|
1896
|
+
* Bounded numeric meter representation (read-only progress / score bar).
|
|
1897
|
+
*
|
|
1898
|
+
* @param value - Numeric value
|
|
1899
|
+
* @param options - Optional settings (minimum, maximum, label, unit, modifiers).
|
|
1900
|
+
* @returns A strongly-typed `NumberBoundedMeterElement` object.
|
|
1901
|
+
*/
|
|
1902
|
+
export function numberBoundedMeter(value, options) {
|
|
1903
|
+
return {
|
|
1904
|
+
type: "number-meter",
|
|
1905
|
+
value,
|
|
1906
|
+
minimum: options?.minimum,
|
|
1907
|
+
maximum: options?.maximum,
|
|
1908
|
+
label: options?.label,
|
|
1909
|
+
unit: options?.unit,
|
|
1910
|
+
modifiers: options?.modifiers
|
|
1911
|
+
};
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1914
|
+
* Creates a `NumberBoundedMeterElement` component instance.
|
|
1915
|
+
*
|
|
1916
|
+
* @remarks
|
|
1917
|
+
* Bounded numeric meter representation (read-only progress / score bar).
|
|
1918
|
+
*
|
|
1919
|
+
* @param value - Numeric value
|
|
1920
|
+
* @param options - Optional settings (minimum, maximum, label, unit, modifiers).
|
|
1921
|
+
* @returns A strongly-typed `NumberBoundedMeterElement` object.
|
|
1922
|
+
*/
|
|
1923
|
+
export function numberMeter(value, options) {
|
|
1924
|
+
return {
|
|
1925
|
+
type: "number-meter",
|
|
1926
|
+
value,
|
|
1927
|
+
minimum: options?.minimum,
|
|
1928
|
+
maximum: options?.maximum,
|
|
1929
|
+
label: options?.label,
|
|
1930
|
+
unit: options?.unit,
|
|
1931
|
+
modifiers: options?.modifiers
|
|
1932
|
+
};
|
|
1933
|
+
}
|
|
1934
|
+
/**
|
|
1935
|
+
* Creates a `BooleanPlainElement` component instance.
|
|
1936
|
+
*
|
|
1937
|
+
* @remarks
|
|
1938
|
+
* Plain boolean value representation (textual "true" / "false").
|
|
1939
|
+
*
|
|
1940
|
+
* @param value - Boolean state value
|
|
1941
|
+
* @param options - Optional settings (modifiers).
|
|
1942
|
+
* @returns A strongly-typed `BooleanPlainElement` object.
|
|
1943
|
+
*/
|
|
1944
|
+
export function booleanPlain(value, options) {
|
|
1945
|
+
return {
|
|
1946
|
+
type: "boolean-plain",
|
|
1947
|
+
value,
|
|
1948
|
+
modifiers: options?.modifiers
|
|
1949
|
+
};
|
|
1950
|
+
}
|
|
1951
|
+
/**
|
|
1952
|
+
* Creates a `BooleanBadgeElement` component instance.
|
|
1953
|
+
*
|
|
1954
|
+
* @remarks
|
|
1955
|
+
* Visual badge pill representation of a boolean state.
|
|
1956
|
+
*
|
|
1957
|
+
* @param value - Boolean state value
|
|
1958
|
+
* @param options - Optional settings (trueLabel (defaults to `true`), falseLabel (defaults to `false`), variant (defaults to `neutral`), modifiers).
|
|
1959
|
+
* @returns A strongly-typed `BooleanBadgeElement` object.
|
|
1960
|
+
*/
|
|
1961
|
+
export function booleanBadge(value, options) {
|
|
1962
|
+
return {
|
|
1963
|
+
type: "boolean-badge",
|
|
1964
|
+
value,
|
|
1965
|
+
trueLabel: options?.trueLabel ?? "true",
|
|
1966
|
+
falseLabel: options?.falseLabel ?? "false",
|
|
1967
|
+
variant: options?.variant ?? BadgeVariant.neutral,
|
|
1968
|
+
modifiers: options?.modifiers
|
|
1969
|
+
};
|
|
1970
|
+
}
|
|
1971
|
+
/**
|
|
1972
|
+
* Creates a `TimestampElement` component instance.
|
|
1973
|
+
*
|
|
1974
|
+
* @remarks
|
|
1975
|
+
* Formatted date and time representation.
|
|
1976
|
+
*
|
|
1977
|
+
* @param value - ISO 8601 date string or epoch timestamp in milliseconds
|
|
1978
|
+
* @param options - Optional settings (format (defaults to `full`), modifiers).
|
|
1979
|
+
* @returns A strongly-typed `TimestampElement` object.
|
|
1980
|
+
*/
|
|
1981
|
+
export function timestamp(value, options) {
|
|
1982
|
+
return {
|
|
1983
|
+
type: "timestamp",
|
|
1984
|
+
value,
|
|
1985
|
+
format: options?.format ?? TimestampFormat.full,
|
|
1986
|
+
modifiers: options?.modifiers
|
|
1987
|
+
};
|
|
1988
|
+
}
|
|
1989
|
+
/**
|
|
1990
|
+
* Creates a `ImageReferenceElement` component instance.
|
|
1991
|
+
*
|
|
1992
|
+
* @remarks
|
|
1993
|
+
* Thumbnail image reference with placeholder fallback handling.
|
|
1994
|
+
*
|
|
1995
|
+
* @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
|
|
1996
|
+
* @param options - Optional settings (alt, aspectRatio (defaults to `1:1`), placeholder).
|
|
1997
|
+
* @returns A strongly-typed `ImageReferenceElement` object.
|
|
1998
|
+
*/
|
|
1999
|
+
export function imageReference(src, options) {
|
|
2000
|
+
return {
|
|
2001
|
+
type: "image-ref",
|
|
2002
|
+
src,
|
|
2003
|
+
alt: options?.alt,
|
|
2004
|
+
aspectRatio: options?.aspectRatio ?? "1:1",
|
|
2005
|
+
placeholder: options?.placeholder
|
|
2006
|
+
};
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Creates a `ImageReferenceElement` component instance.
|
|
2010
|
+
*
|
|
2011
|
+
* @remarks
|
|
2012
|
+
* Thumbnail image reference with placeholder fallback handling.
|
|
2013
|
+
*
|
|
2014
|
+
* @param src - Image source URI (HTTPS URL, base64 data URI, or asset path)
|
|
2015
|
+
* @param options - Optional settings (alt, aspectRatio (defaults to `1:1`), placeholder).
|
|
2016
|
+
* @returns A strongly-typed `ImageReferenceElement` object.
|
|
2017
|
+
*/
|
|
2018
|
+
export function imageRef(src, options) {
|
|
2019
|
+
return {
|
|
2020
|
+
type: "image-ref",
|
|
2021
|
+
src,
|
|
2022
|
+
alt: options?.alt,
|
|
2023
|
+
aspectRatio: options?.aspectRatio ?? "1:1",
|
|
2024
|
+
placeholder: options?.placeholder
|
|
2025
|
+
};
|
|
2026
|
+
}
|
|
2027
|
+
/**
|
|
2028
|
+
* Creates a `DominantColourSetElement` component instance.
|
|
2029
|
+
*
|
|
2030
|
+
* @remarks
|
|
2031
|
+
* Dominant color set palette rendered in descending dominance order.
|
|
2032
|
+
*
|
|
2033
|
+
* @param colors - List of hexadecimal color strings in descending priority
|
|
2034
|
+
* @returns A strongly-typed `DominantColourSetElement` object.
|
|
2035
|
+
*/
|
|
2036
|
+
export function dominantColourSet(colors) {
|
|
2037
|
+
return {
|
|
2038
|
+
type: "color-set",
|
|
2039
|
+
colors: [...colors]
|
|
2040
|
+
};
|
|
2041
|
+
}
|
|
2042
|
+
/**
|
|
2043
|
+
* Creates a `DominantColourSetElement` component instance.
|
|
2044
|
+
*
|
|
2045
|
+
* @remarks
|
|
2046
|
+
* Dominant color set palette rendered in descending dominance order.
|
|
2047
|
+
*
|
|
2048
|
+
* @param colors - List of hexadecimal color strings in descending priority
|
|
2049
|
+
* @returns A strongly-typed `DominantColourSetElement` object.
|
|
2050
|
+
*/
|
|
2051
|
+
export function dominantColors(colors) {
|
|
2052
|
+
return {
|
|
2053
|
+
type: "color-set",
|
|
2054
|
+
colors: [...colors]
|
|
2055
|
+
};
|
|
2056
|
+
}
|
|
2057
|
+
/**
|
|
2058
|
+
* Creates a `ButtonActionElement` component instance.
|
|
2059
|
+
*
|
|
2060
|
+
* @remarks
|
|
2061
|
+
* Interactive button action triggering an extension command.
|
|
2062
|
+
*
|
|
2063
|
+
* @param commandId - Command identifier to invoke
|
|
2064
|
+
* @param label - Display label for the action
|
|
2065
|
+
* @param options - Optional settings (extensionId, target, parameters, disabled (defaults to `false`), variant (defaults to `secondary`)).
|
|
2066
|
+
* @returns A strongly-typed `ButtonActionElement` object.
|
|
2067
|
+
*/
|
|
2068
|
+
export function buttonAction(commandId, label, options) {
|
|
2069
|
+
return {
|
|
2070
|
+
type: "button",
|
|
2071
|
+
commandId,
|
|
2072
|
+
label,
|
|
2073
|
+
extensionId: options?.extensionId,
|
|
2074
|
+
target: options?.target,
|
|
2075
|
+
parameters: options?.parameters,
|
|
2076
|
+
disabled: options?.disabled ?? false,
|
|
2077
|
+
variant: options?.variant ?? ButtonVariant.secondary
|
|
2078
|
+
};
|
|
2079
|
+
}
|
|
2080
|
+
/**
|
|
2081
|
+
* Creates a `ExternalLinkActionElement` component instance.
|
|
2082
|
+
*
|
|
2083
|
+
* @remarks
|
|
2084
|
+
* External link action distinct from inline URL text values.
|
|
2085
|
+
*
|
|
2086
|
+
* @param url - Target URL destination
|
|
2087
|
+
* @param label - Display label for the action
|
|
2088
|
+
* @returns A strongly-typed `ExternalLinkActionElement` object.
|
|
2089
|
+
*/
|
|
2090
|
+
export function externalLinkAction(url, label) {
|
|
2091
|
+
return {
|
|
2092
|
+
type: "external-link",
|
|
2093
|
+
url,
|
|
2094
|
+
label
|
|
2095
|
+
};
|
|
2096
|
+
}
|
|
2097
|
+
/**
|
|
2098
|
+
* Creates a `MarkdownBlockElement` component instance.
|
|
2099
|
+
*
|
|
2100
|
+
* @remarks
|
|
2101
|
+
* Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
|
|
2102
|
+
*
|
|
2103
|
+
* @param content - Raw Markdown markup content
|
|
2104
|
+
* @returns A strongly-typed `MarkdownBlockElement` object.
|
|
2105
|
+
*/
|
|
2106
|
+
export function markdownBlock(content) {
|
|
2107
|
+
return {
|
|
2108
|
+
type: "markdown",
|
|
2109
|
+
content
|
|
2110
|
+
};
|
|
2111
|
+
}
|
|
2112
|
+
/**
|
|
2113
|
+
* Creates a `MarkdownBlockElement` component instance.
|
|
2114
|
+
*
|
|
2115
|
+
* @remarks
|
|
2116
|
+
* Full Markdown fallback block rendered with core typographic hierarchy, spacing, and styling.
|
|
2117
|
+
*
|
|
2118
|
+
* @param content - Raw Markdown markup content
|
|
2119
|
+
* @returns A strongly-typed `MarkdownBlockElement` object.
|
|
2120
|
+
*/
|
|
2121
|
+
export function markdown(content) {
|
|
2122
|
+
return {
|
|
2123
|
+
type: "markdown",
|
|
2124
|
+
content
|
|
2125
|
+
};
|
|
2126
|
+
}
|
|
2127
|
+
/**
|
|
2128
|
+
* Creates a `HtmlBlockElement` component instance.
|
|
2129
|
+
*
|
|
2130
|
+
* @remarks
|
|
2131
|
+
* Sandboxed HTML rendering escape hatch.
|
|
2132
|
+
*
|
|
2133
|
+
* @param content - Raw HTML markup content
|
|
2134
|
+
* @returns A strongly-typed `HtmlBlockElement` object.
|
|
2135
|
+
*/
|
|
2136
|
+
export function htmlBlock(content) {
|
|
2137
|
+
return {
|
|
2138
|
+
type: "html",
|
|
2139
|
+
content
|
|
2140
|
+
};
|
|
2141
|
+
}
|
|
2142
|
+
/**
|
|
2143
|
+
* Creates a `HtmlBlockElement` component instance.
|
|
2144
|
+
*
|
|
2145
|
+
* @remarks
|
|
2146
|
+
* Sandboxed HTML rendering escape hatch.
|
|
2147
|
+
*
|
|
2148
|
+
* @param content - Raw HTML markup content
|
|
2149
|
+
* @returns A strongly-typed `HtmlBlockElement` object.
|
|
2150
|
+
*/
|
|
2151
|
+
export function html(content) {
|
|
2152
|
+
return {
|
|
2153
|
+
type: "html",
|
|
2154
|
+
content
|
|
2155
|
+
};
|
|
2156
|
+
}
|
|
2157
|
+
/**
|
|
2158
|
+
* Creates a `Slot` component instance.
|
|
2159
|
+
*
|
|
2160
|
+
* @remarks
|
|
2161
|
+
* Single slot within a multi-slot horizontal row layout.
|
|
2162
|
+
*
|
|
2163
|
+
* @param content - Rendered content inside the slot
|
|
2164
|
+
* @param options - Optional settings (label, width).
|
|
2165
|
+
* @returns A strongly-typed `Slot` object.
|
|
2166
|
+
*/
|
|
2167
|
+
export function slot(content, options) {
|
|
2168
|
+
return {
|
|
2169
|
+
content,
|
|
2170
|
+
label: options?.label,
|
|
2171
|
+
width: options?.width
|
|
2172
|
+
};
|
|
2173
|
+
}
|
|
2174
|
+
/**
|
|
2175
|
+
* Creates a `MultiSlotRowElement` component instance.
|
|
2176
|
+
*
|
|
2177
|
+
* @remarks
|
|
2178
|
+
* Multi-slot horizontal row with declared column width proportions.
|
|
2179
|
+
* Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
|
|
2180
|
+
*
|
|
2181
|
+
* @param slots - List of slots comprising the row
|
|
2182
|
+
* @param options - Optional settings (proportions).
|
|
2183
|
+
* @returns A strongly-typed `MultiSlotRowElement` object.
|
|
2184
|
+
*/
|
|
2185
|
+
export function multiSlotRow(slots, options) {
|
|
2186
|
+
return {
|
|
2187
|
+
type: "multi-slot",
|
|
2188
|
+
slots: [...slots],
|
|
2189
|
+
proportions: options?.proportions
|
|
2190
|
+
};
|
|
2191
|
+
}
|
|
2192
|
+
/**
|
|
2193
|
+
* Creates a `MultiSlotRowElement` component instance.
|
|
2194
|
+
*
|
|
2195
|
+
* @remarks
|
|
2196
|
+
* Multi-slot horizontal row with declared column width proportions.
|
|
2197
|
+
* Examples: "1/3 + 2/3", "equal thirds", "1/4 + 3/4".
|
|
2198
|
+
*
|
|
2199
|
+
* @param slots - List of slots comprising the row
|
|
2200
|
+
* @param options - Optional settings (proportions).
|
|
2201
|
+
* @returns A strongly-typed `MultiSlotRowElement` object.
|
|
2202
|
+
*/
|
|
2203
|
+
export function multiSlot(slots, options) {
|
|
2204
|
+
return {
|
|
2205
|
+
type: "multi-slot",
|
|
2206
|
+
slots: [...slots],
|
|
2207
|
+
proportions: options?.proportions
|
|
2208
|
+
};
|
|
2209
|
+
}
|
|
2210
|
+
/**
|
|
2211
|
+
* Creates a `LabelValueRowElement` component instance.
|
|
2212
|
+
*
|
|
2213
|
+
* @remarks
|
|
2214
|
+
* Standard label and value row.
|
|
2215
|
+
* Displays a muted label on the left and value representation on the right with a vertical dividing line.
|
|
2216
|
+
*
|
|
2217
|
+
* @param label - Key or descriptive label displayed muted on the left
|
|
2218
|
+
* @param value - Rendered value element on the right
|
|
2219
|
+
* @param options - Optional settings (withDivider (defaults to `false`)).
|
|
2220
|
+
* @returns A strongly-typed `LabelValueRowElement` object.
|
|
2221
|
+
*/
|
|
2222
|
+
export function labelValueRow(label, value, options) {
|
|
2223
|
+
return {
|
|
2224
|
+
type: "label-value",
|
|
2225
|
+
label,
|
|
2226
|
+
value,
|
|
2227
|
+
withDivider: options?.withDivider ?? false
|
|
2228
|
+
};
|
|
2229
|
+
}
|
|
2230
|
+
/**
|
|
2231
|
+
* Creates a `LabelValueRowElement` component instance.
|
|
2232
|
+
*
|
|
2233
|
+
* @remarks
|
|
2234
|
+
* Standard label and value row.
|
|
2235
|
+
* Displays a muted label on the left and value representation on the right with a vertical dividing line.
|
|
2236
|
+
*
|
|
2237
|
+
* @param label - Key or descriptive label displayed muted on the left
|
|
2238
|
+
* @param value - Rendered value element on the right
|
|
2239
|
+
* @param options - Optional settings (withDivider (defaults to `false`)).
|
|
2240
|
+
* @returns A strongly-typed `LabelValueRowElement` object.
|
|
2241
|
+
*/
|
|
2242
|
+
export function labelValue(label, value, options) {
|
|
2243
|
+
return {
|
|
2244
|
+
type: "label-value",
|
|
2245
|
+
label,
|
|
2246
|
+
value,
|
|
2247
|
+
withDivider: options?.withDivider ?? false
|
|
2248
|
+
};
|
|
2249
|
+
}
|
|
2250
|
+
/**
|
|
2251
|
+
* Creates a `TableColumn` component instance.
|
|
2252
|
+
*
|
|
2253
|
+
* @remarks
|
|
2254
|
+
* Column definition for structured tables.
|
|
2255
|
+
*
|
|
2256
|
+
* @param options - Optional settings (header, align (defaults to `left`), width).
|
|
2257
|
+
* @returns A strongly-typed `TableColumn` object.
|
|
2258
|
+
*/
|
|
2259
|
+
export function tableColumn(options) {
|
|
2260
|
+
return {
|
|
2261
|
+
header: options?.header,
|
|
2262
|
+
align: options?.align ?? TableColumnAlign.left,
|
|
2263
|
+
width: options?.width
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
/**
|
|
2267
|
+
* Creates a `TableRow` component instance.
|
|
2268
|
+
*
|
|
2269
|
+
* @remarks
|
|
2270
|
+
* Single table row containing an array of cell values.
|
|
2271
|
+
*
|
|
2272
|
+
* @param cells - Array of cell values corresponding to table columns
|
|
2273
|
+
* @returns A strongly-typed `TableRow` object.
|
|
2274
|
+
*/
|
|
2275
|
+
export function tableRow(cells) {
|
|
2276
|
+
return {
|
|
2277
|
+
cells: [...cells]
|
|
2278
|
+
};
|
|
2279
|
+
}
|
|
2280
|
+
/**
|
|
2281
|
+
* Creates a `TableElement` component instance.
|
|
2282
|
+
*
|
|
2283
|
+
* @remarks
|
|
2284
|
+
* Structured tabular data representation.
|
|
2285
|
+
* Supports header/borderless modes, 2-column key-value tables, and 3-column data tables.
|
|
2286
|
+
*
|
|
2287
|
+
* @param rows - Tabular data rows
|
|
2288
|
+
* @param options - Optional settings (hasHeader (defaults to `true`), columns, maxColumns).
|
|
2289
|
+
* @returns A strongly-typed `TableElement` object.
|
|
2290
|
+
*/
|
|
2291
|
+
export function table(rows, options) {
|
|
2292
|
+
return {
|
|
2293
|
+
type: "table",
|
|
2294
|
+
rows: [...rows],
|
|
2295
|
+
hasHeader: options?.hasHeader ?? true,
|
|
2296
|
+
columns: options?.columns ? [...options.columns] : undefined,
|
|
2297
|
+
maxColumns: options?.maxColumns
|
|
2298
|
+
};
|
|
2299
|
+
}
|
|
2300
|
+
/**
|
|
2301
|
+
* Creates a `RepeatingGroupEntry` component instance.
|
|
2302
|
+
*
|
|
2303
|
+
* @remarks
|
|
2304
|
+
* Single entry within a repeating group.
|
|
2305
|
+
*
|
|
2306
|
+
* @param label - Entry label
|
|
2307
|
+
* @param options - Optional settings (value, elements).
|
|
2308
|
+
* @returns A strongly-typed `RepeatingGroupEntry` object.
|
|
2309
|
+
*/
|
|
2310
|
+
export function repeatingGroupEntry(label, options) {
|
|
2311
|
+
return {
|
|
2312
|
+
label,
|
|
2313
|
+
value: options?.value,
|
|
2314
|
+
elements: options?.elements ? [...options.elements] : undefined
|
|
2315
|
+
};
|
|
2316
|
+
}
|
|
2317
|
+
/**
|
|
2318
|
+
* Creates a `RepeatingGroupElement` component instance.
|
|
2319
|
+
*
|
|
2320
|
+
* @remarks
|
|
2321
|
+
* Repeating group container where entries share uniform structure and retain per-entry labels.
|
|
2322
|
+
*
|
|
2323
|
+
* @param entries - List of repeated entry records
|
|
2324
|
+
* @param options - Optional settings (title).
|
|
2325
|
+
* @returns A strongly-typed `RepeatingGroupElement` object.
|
|
2326
|
+
*/
|
|
2327
|
+
export function repeatingGroup(entries, options) {
|
|
2328
|
+
return {
|
|
2329
|
+
type: "repeating-group",
|
|
2330
|
+
entries: [...entries],
|
|
2331
|
+
title: options?.title
|
|
2332
|
+
};
|
|
2333
|
+
}
|
|
2334
|
+
/**
|
|
2335
|
+
* Creates a `CollapsibleGroupElement` component instance.
|
|
2336
|
+
*
|
|
2337
|
+
* @remarks
|
|
2338
|
+
* Collapsible disclosure container (accordion) with summary badge.
|
|
2339
|
+
*
|
|
2340
|
+
* @param title - Group title (e.g. "Show specimen details")
|
|
2341
|
+
* @param elements - Nested content elements revealed when expanded
|
|
2342
|
+
* @param options - Optional settings (summary, defaultExpanded (defaults to `false`)).
|
|
2343
|
+
* @returns A strongly-typed `CollapsibleGroupElement` object.
|
|
2344
|
+
*/
|
|
2345
|
+
export function collapsibleGroup(title, elements, options) {
|
|
2346
|
+
return {
|
|
2347
|
+
type: "collapsible-group",
|
|
2348
|
+
title,
|
|
2349
|
+
elements: [...elements],
|
|
2350
|
+
summary: options?.summary,
|
|
2351
|
+
defaultExpanded: options?.defaultExpanded ?? false
|
|
2352
|
+
};
|
|
2353
|
+
}
|
|
2354
|
+
/**
|
|
2355
|
+
* Creates a `DividerElement` component instance.
|
|
2356
|
+
*
|
|
2357
|
+
* @remarks
|
|
2358
|
+
* Visual hairline separator separating sections or element groups.
|
|
2359
|
+
*
|
|
2360
|
+
* @param options - Optional settings (style (defaults to `hairline`)).
|
|
2361
|
+
* @returns A strongly-typed `DividerElement` object.
|
|
2362
|
+
*/
|
|
2363
|
+
export function divider(options) {
|
|
2364
|
+
return {
|
|
2365
|
+
type: "divider",
|
|
2366
|
+
style: options?.style ?? DividerStyle.hairline
|
|
2367
|
+
};
|
|
2368
|
+
}
|
|
2369
|
+
// --- Type Guards ---
|
|
2370
|
+
/**
|
|
2371
|
+
* Type guard predicate verifying whether an unknown value conforms to `UiElement`.
|
|
2372
|
+
*
|
|
2373
|
+
* @param value - The value to inspect.
|
|
2374
|
+
* @returns `true` if the value is a valid `UiElement`, otherwise `false`.
|
|
2375
|
+
*/
|
|
2376
|
+
export function isUiElement(value) {
|
|
2377
|
+
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
2378
|
+
}
|
|
2379
|
+
/**
|
|
2380
|
+
* Type guard predicate narrowing a `UiElement` to `StringShortElement`.
|
|
2381
|
+
*
|
|
2382
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2383
|
+
* @returns `true` if the element is a `StringShortElement` (type = "string-short"), otherwise `false`.
|
|
2384
|
+
*/
|
|
2385
|
+
export function isStringShortElement(element) {
|
|
2386
|
+
return element.type === "string-short";
|
|
2387
|
+
}
|
|
2388
|
+
/**
|
|
2389
|
+
* Type guard predicate narrowing a `UiElement` to `StringLongElement`.
|
|
2390
|
+
*
|
|
2391
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2392
|
+
* @returns `true` if the element is a `StringLongElement` (type = "string-long"), otherwise `false`.
|
|
2393
|
+
*/
|
|
2394
|
+
export function isStringLongElement(element) {
|
|
2395
|
+
return element.type === "string-long";
|
|
2396
|
+
}
|
|
2397
|
+
/**
|
|
2398
|
+
* Type guard predicate narrowing a `UiElement` to `StringCodeElement`.
|
|
2399
|
+
*
|
|
2400
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2401
|
+
* @returns `true` if the element is a `StringCodeElement` (type = "string-code"), otherwise `false`.
|
|
2402
|
+
*/
|
|
2403
|
+
export function isStringCodeElement(element) {
|
|
2404
|
+
return element.type === "string-code";
|
|
2405
|
+
}
|
|
2406
|
+
/**
|
|
2407
|
+
* Type guard predicate narrowing a `UiElement` to `StringUrlElement`.
|
|
2408
|
+
*
|
|
2409
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2410
|
+
* @returns `true` if the element is a `StringUrlElement` (type = "string-url"), otherwise `false`.
|
|
2411
|
+
*/
|
|
2412
|
+
export function isStringUrlElement(element) {
|
|
2413
|
+
return element.type === "string-url";
|
|
2414
|
+
}
|
|
2415
|
+
/**
|
|
2416
|
+
* Type guard predicate narrowing a `UiElement` to `IdentifierElement`.
|
|
2417
|
+
*
|
|
2418
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2419
|
+
* @returns `true` if the element is a `IdentifierElement` (type = "identifier"), otherwise `false`.
|
|
2420
|
+
*/
|
|
2421
|
+
export function isIdentifierElement(element) {
|
|
2422
|
+
return element.type === "identifier";
|
|
2423
|
+
}
|
|
2424
|
+
/**
|
|
2425
|
+
* Type guard predicate narrowing a `UiElement` to `RatioElement`.
|
|
2426
|
+
*
|
|
2427
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2428
|
+
* @returns `true` if the element is a `RatioElement` (type = "ratio"), otherwise `false`.
|
|
2429
|
+
*/
|
|
2430
|
+
export function isRatioElement(element) {
|
|
2431
|
+
return element.type === "ratio";
|
|
2432
|
+
}
|
|
2433
|
+
/**
|
|
2434
|
+
* Type guard predicate narrowing a `UiElement` to `ColourElement`.
|
|
2435
|
+
*
|
|
2436
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2437
|
+
* @returns `true` if the element is a `ColourElement` (type = "color-swatch"), otherwise `false`.
|
|
2438
|
+
*/
|
|
2439
|
+
export function isColourElement(element) {
|
|
2440
|
+
return element.type === "color-swatch";
|
|
2441
|
+
}
|
|
2442
|
+
/**
|
|
2443
|
+
* Type guard predicate narrowing a `UiElement` to `NumberUnboundedElement`.
|
|
2444
|
+
*
|
|
2445
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2446
|
+
* @returns `true` if the element is a `NumberUnboundedElement` (type = "number-unbounded"), otherwise `false`.
|
|
2447
|
+
*/
|
|
2448
|
+
export function isNumberUnboundedElement(element) {
|
|
2449
|
+
return element.type === "number-unbounded";
|
|
2450
|
+
}
|
|
2451
|
+
/**
|
|
2452
|
+
* Type guard predicate narrowing a `UiElement` to `NumberBoundedStarsElement`.
|
|
2453
|
+
*
|
|
2454
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2455
|
+
* @returns `true` if the element is a `NumberBoundedStarsElement` (type = "number-stars"), otherwise `false`.
|
|
2456
|
+
*/
|
|
2457
|
+
export function isNumberBoundedStarsElement(element) {
|
|
2458
|
+
return element.type === "number-stars";
|
|
2459
|
+
}
|
|
2460
|
+
/**
|
|
2461
|
+
* Type guard predicate narrowing a `UiElement` to `NumberBoundedMeterElement`.
|
|
2462
|
+
*
|
|
2463
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2464
|
+
* @returns `true` if the element is a `NumberBoundedMeterElement` (type = "number-meter"), otherwise `false`.
|
|
2465
|
+
*/
|
|
2466
|
+
export function isNumberBoundedMeterElement(element) {
|
|
2467
|
+
return element.type === "number-meter";
|
|
2468
|
+
}
|
|
2469
|
+
/**
|
|
2470
|
+
* Type guard predicate narrowing a `UiElement` to `BooleanPlainElement`.
|
|
2471
|
+
*
|
|
2472
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2473
|
+
* @returns `true` if the element is a `BooleanPlainElement` (type = "boolean-plain"), otherwise `false`.
|
|
2474
|
+
*/
|
|
2475
|
+
export function isBooleanPlainElement(element) {
|
|
2476
|
+
return element.type === "boolean-plain";
|
|
2477
|
+
}
|
|
2478
|
+
/**
|
|
2479
|
+
* Type guard predicate narrowing a `UiElement` to `BooleanBadgeElement`.
|
|
2480
|
+
*
|
|
2481
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2482
|
+
* @returns `true` if the element is a `BooleanBadgeElement` (type = "boolean-badge"), otherwise `false`.
|
|
2483
|
+
*/
|
|
2484
|
+
export function isBooleanBadgeElement(element) {
|
|
2485
|
+
return element.type === "boolean-badge";
|
|
2486
|
+
}
|
|
2487
|
+
/**
|
|
2488
|
+
* Type guard predicate narrowing a `UiElement` to `TimestampElement`.
|
|
2489
|
+
*
|
|
2490
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2491
|
+
* @returns `true` if the element is a `TimestampElement` (type = "timestamp"), otherwise `false`.
|
|
2492
|
+
*/
|
|
2493
|
+
export function isTimestampElement(element) {
|
|
2494
|
+
return element.type === "timestamp";
|
|
2495
|
+
}
|
|
2496
|
+
/**
|
|
2497
|
+
* Type guard predicate narrowing a `UiElement` to `ImageReferenceElement`.
|
|
2498
|
+
*
|
|
2499
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2500
|
+
* @returns `true` if the element is a `ImageReferenceElement` (type = "image-ref"), otherwise `false`.
|
|
2501
|
+
*/
|
|
2502
|
+
export function isImageReferenceElement(element) {
|
|
2503
|
+
return element.type === "image-ref";
|
|
2504
|
+
}
|
|
2505
|
+
/**
|
|
2506
|
+
* Type guard predicate narrowing a `UiElement` to `DominantColourSetElement`.
|
|
2507
|
+
*
|
|
2508
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2509
|
+
* @returns `true` if the element is a `DominantColourSetElement` (type = "color-set"), otherwise `false`.
|
|
2510
|
+
*/
|
|
2511
|
+
export function isDominantColourSetElement(element) {
|
|
2512
|
+
return element.type === "color-set";
|
|
2513
|
+
}
|
|
2514
|
+
/**
|
|
2515
|
+
* Type guard predicate narrowing a `UiElement` to `MarkdownBlockElement`.
|
|
2516
|
+
*
|
|
2517
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2518
|
+
* @returns `true` if the element is a `MarkdownBlockElement` (type = "markdown"), otherwise `false`.
|
|
2519
|
+
*/
|
|
2520
|
+
export function isMarkdownBlockElement(element) {
|
|
2521
|
+
return element.type === "markdown";
|
|
2522
|
+
}
|
|
2523
|
+
/**
|
|
2524
|
+
* Type guard predicate narrowing a `UiElement` to `HtmlBlockElement`.
|
|
2525
|
+
*
|
|
2526
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2527
|
+
* @returns `true` if the element is a `HtmlBlockElement` (type = "html"), otherwise `false`.
|
|
2528
|
+
*/
|
|
2529
|
+
export function isHtmlBlockElement(element) {
|
|
2530
|
+
return element.type === "html";
|
|
2531
|
+
}
|
|
2532
|
+
/**
|
|
2533
|
+
* Type guard predicate narrowing a `UiElement` to `MultiSlotRowElement`.
|
|
2534
|
+
*
|
|
2535
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2536
|
+
* @returns `true` if the element is a `MultiSlotRowElement` (type = "multi-slot"), otherwise `false`.
|
|
2537
|
+
*/
|
|
2538
|
+
export function isMultiSlotRowElement(element) {
|
|
2539
|
+
return element.type === "multi-slot";
|
|
2540
|
+
}
|
|
2541
|
+
/**
|
|
2542
|
+
* Type guard predicate narrowing a `UiElement` to `LabelValueRowElement`.
|
|
2543
|
+
*
|
|
2544
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2545
|
+
* @returns `true` if the element is a `LabelValueRowElement` (type = "label-value"), otherwise `false`.
|
|
2546
|
+
*/
|
|
2547
|
+
export function isLabelValueRowElement(element) {
|
|
2548
|
+
return element.type === "label-value";
|
|
2549
|
+
}
|
|
2550
|
+
/**
|
|
2551
|
+
* Type guard predicate narrowing a `UiElement` to `TableElement`.
|
|
2552
|
+
*
|
|
2553
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2554
|
+
* @returns `true` if the element is a `TableElement` (type = "table"), otherwise `false`.
|
|
2555
|
+
*/
|
|
2556
|
+
export function isTableElement(element) {
|
|
2557
|
+
return element.type === "table";
|
|
2558
|
+
}
|
|
2559
|
+
/**
|
|
2560
|
+
* Type guard predicate narrowing a `UiElement` to `RepeatingGroupElement`.
|
|
2561
|
+
*
|
|
2562
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2563
|
+
* @returns `true` if the element is a `RepeatingGroupElement` (type = "repeating-group"), otherwise `false`.
|
|
2564
|
+
*/
|
|
2565
|
+
export function isRepeatingGroupElement(element) {
|
|
2566
|
+
return element.type === "repeating-group";
|
|
2567
|
+
}
|
|
2568
|
+
/**
|
|
2569
|
+
* Type guard predicate narrowing a `UiElement` to `CollapsibleGroupElement`.
|
|
2570
|
+
*
|
|
2571
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2572
|
+
* @returns `true` if the element is a `CollapsibleGroupElement` (type = "collapsible-group"), otherwise `false`.
|
|
2573
|
+
*/
|
|
2574
|
+
export function isCollapsibleGroupElement(element) {
|
|
2575
|
+
return element.type === "collapsible-group";
|
|
2576
|
+
}
|
|
2577
|
+
/**
|
|
2578
|
+
* Type guard predicate narrowing a `UiElement` to `DividerElement`.
|
|
2579
|
+
*
|
|
2580
|
+
* @param element - The `UiElement` instance to inspect.
|
|
2581
|
+
* @returns `true` if the element is a `DividerElement` (type = "divider"), otherwise `false`.
|
|
2582
|
+
*/
|
|
2583
|
+
export function isDividerElement(element) {
|
|
2584
|
+
return element.type === "divider";
|
|
2585
|
+
}
|
|
2586
|
+
/**
|
|
2587
|
+
* Type guard predicate verifying whether an unknown value conforms to `ActionElement`.
|
|
2588
|
+
*
|
|
2589
|
+
* @param value - The value to inspect.
|
|
2590
|
+
* @returns `true` if the value is a valid `ActionElement`, otherwise `false`.
|
|
2591
|
+
*/
|
|
2592
|
+
export function isActionElement(value) {
|
|
2593
|
+
return typeof value === "object" && value !== null && "type" in value && typeof value.type === "string";
|
|
2594
|
+
}
|
|
2595
|
+
/**
|
|
2596
|
+
* Type guard predicate narrowing a `ActionElement` to `ButtonActionElement`.
|
|
2597
|
+
*
|
|
2598
|
+
* @param element - The `ActionElement` instance to inspect.
|
|
2599
|
+
* @returns `true` if the element is a `ButtonActionElement` (type = "button"), otherwise `false`.
|
|
2600
|
+
*/
|
|
2601
|
+
export function isButtonActionElement(element) {
|
|
2602
|
+
return element.type === "button";
|
|
2603
|
+
}
|
|
2604
|
+
/**
|
|
2605
|
+
* Type guard predicate narrowing a `ActionElement` to `ExternalLinkActionElement`.
|
|
2606
|
+
*
|
|
2607
|
+
* @param element - The `ActionElement` instance to inspect.
|
|
2608
|
+
* @returns `true` if the element is a `ExternalLinkActionElement` (type = "external-link"), otherwise `false`.
|
|
2609
|
+
*/
|
|
2610
|
+
export function isExternalLinkActionElement(element) {
|
|
2611
|
+
return element.type === "external-link";
|
|
2612
|
+
}
|