@api-client/ui 0.6.7 → 0.6.9

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.
Files changed (25) hide show
  1. package/build/src/modeling/dialogs/CountryTaxonomy.d.ts +24 -0
  2. package/build/src/modeling/dialogs/CountryTaxonomy.d.ts.map +1 -0
  3. package/build/src/modeling/dialogs/CountryTaxonomy.js +174 -0
  4. package/build/src/modeling/dialogs/CountryTaxonomy.js.map +1 -0
  5. package/build/src/modeling/dialogs/PostalCodeTaxonomy.d.ts +24 -0
  6. package/build/src/modeling/dialogs/PostalCodeTaxonomy.d.ts.map +1 -0
  7. package/build/src/modeling/dialogs/PostalCodeTaxonomy.js +167 -0
  8. package/build/src/modeling/dialogs/PostalCodeTaxonomy.js.map +1 -0
  9. package/build/src/modeling/internals/DomainAutoFieldsDialog.d.ts.map +1 -1
  10. package/build/src/modeling/internals/DomainAutoFieldsDialog.js +41 -16
  11. package/build/src/modeling/internals/DomainAutoFieldsDialog.js.map +1 -1
  12. package/build/src/modeling/internals/DomainPropertyEditor.d.ts.map +1 -1
  13. package/build/src/modeling/internals/DomainPropertyEditor.js +8 -0
  14. package/build/src/modeling/internals/DomainPropertyEditor.js.map +1 -1
  15. package/build/src/modeling/internals/DomainTemplateBrowser.d.ts +10 -6
  16. package/build/src/modeling/internals/DomainTemplateBrowser.d.ts.map +1 -1
  17. package/build/src/modeling/internals/DomainTemplateBrowser.js +50 -7
  18. package/build/src/modeling/internals/DomainTemplateBrowser.js.map +1 -1
  19. package/build/tsconfig.tsbuildinfo +1 -1
  20. package/package.json +2 -1
  21. package/src/modeling/dialogs/CountryTaxonomy.ts +176 -0
  22. package/src/modeling/dialogs/PostalCodeTaxonomy.ts +169 -0
  23. package/src/modeling/internals/DomainAutoFieldsDialog.ts +41 -16
  24. package/src/modeling/internals/DomainPropertyEditor.ts +6 -0
  25. package/src/modeling/internals/DomainTemplateBrowser.ts +61 -17
@@ -1,8 +1,39 @@
1
1
  import { __esDecorate, __runInitializers } from "tslib";
2
+ /* eslint-disable max-len */
2
3
  import { html, LitElement } from 'lit';
3
4
  import { state, property } from 'lit/decorators.js';
4
- import { TEMPLATE_METADATA_REGISTRY, TEMPLATE_CATEGORIES, searchTemplates, getTemplatesByCategory, } from '@api-client/core/modeling/templates/meta/index.js';
5
- export const availableCategories = Object.keys(TEMPLATE_CATEGORIES);
5
+ // Template metadata imports
6
+ import ecommercePlatformMetadata from '@api-client/domain-templates/meta/ecommerce-platform.json' with { type: 'json' };
7
+ import blogPublishingPlatformMetadata from '@api-client/domain-templates/meta/blog-publishing-platform.json' with { type: 'json' };
8
+ import healthcareManagementPlatformMetadata from '@api-client/domain-templates/meta/healthcare-management-platform.json' with { type: 'json' };
9
+ import financialServicesPlatformMetadata from '@api-client/domain-templates/meta/financial-services-platform.json' with { type: 'json' };
10
+ import educationManagementPlatformMetadata from '@api-client/domain-templates/meta/education-management-platform.json' with { type: 'json' };
11
+ import realEstateManagementPlatformMetadata from '@api-client/domain-templates/meta/real-estate-management-platform.json' with { type: 'json' };
12
+ import manufacturingPlatformMetadata from '@api-client/domain-templates/meta/manufacturing-platform.json' with { type: 'json' };
13
+ import hospitalityPlatformMetadata from '@api-client/domain-templates/meta/hospitality-platform.json' with { type: 'json' };
14
+ import legalServicesPlatformMetadata from '@api-client/domain-templates/meta/legal-services-platform.json' with { type: 'json' };
15
+ import nonProfitPlatformMetadata from '@api-client/domain-templates/meta/non-profit-platform.json' with { type: 'json' };
16
+ import iotSmartHomePlatformMetadata from '@api-client/domain-templates/meta/iot-smart-home-platform.json' with { type: 'json' };
17
+ import gamingPlatformMetadata from '@api-client/domain-templates/meta/gaming-platform.json' with { type: 'json' };
18
+ import { templatesByVertical } from '@api-client/domain-templates';
19
+ /**
20
+ * Registry of all available template metadata
21
+ */
22
+ export const TEMPLATE_METADATA_REGISTRY = {
23
+ 'ecommerce-platform': ecommercePlatformMetadata,
24
+ 'blog-publishing-platform': blogPublishingPlatformMetadata,
25
+ 'healthcare-management-platform': healthcareManagementPlatformMetadata,
26
+ 'financial-services-platform': financialServicesPlatformMetadata,
27
+ 'education-management-platform': educationManagementPlatformMetadata,
28
+ 'real-estate-management-platform': realEstateManagementPlatformMetadata,
29
+ 'manufacturing-platform': manufacturingPlatformMetadata,
30
+ 'hospitality-platform': hospitalityPlatformMetadata,
31
+ 'legal-services-platform': legalServicesPlatformMetadata,
32
+ 'non-profit-platform': nonProfitPlatformMetadata,
33
+ 'iot-smart-home-platform': iotSmartHomePlatformMetadata,
34
+ 'gaming-platform': gamingPlatformMetadata,
35
+ };
36
+ export const availableCategories = Object.keys(templatesByVertical);
6
37
  /**
7
38
  * Generates an icon name for the DomainProperty that illustrate its primary purpose.
8
39
  */
@@ -28,6 +59,14 @@ export function getPropertyIcon(p) {
28
59
  return 'textFields';
29
60
  }
30
61
  }
62
+ function searchTemplates(query) {
63
+ const searchTerm = query.toLowerCase();
64
+ return Object.values(templatesByVertical)
65
+ .flat()
66
+ .filter((template) => template.name.toLowerCase().includes(searchTerm) ||
67
+ template.description.toLowerCase().includes(searchTerm) ||
68
+ template.tags.some((tag) => tag.toLowerCase().includes(searchTerm)));
69
+ }
31
70
  let DomainTemplateBrowser = (() => {
32
71
  let _classSuper = LitElement;
33
72
  let _query_decorators;
@@ -71,7 +110,7 @@ let DomainTemplateBrowser = (() => {
71
110
  */
72
111
  get category() { return this.#category_accessor_storage; }
73
112
  set category(value) { this.#category_accessor_storage = value; }
74
- #templates_accessor_storage = (__runInitializers(this, _category_extraInitializers), __runInitializers(this, _templates_initializers, [...Object.values(TEMPLATE_METADATA_REGISTRY)]
113
+ #templates_accessor_storage = (__runInitializers(this, _category_extraInitializers), __runInitializers(this, _templates_initializers, [...Object.values(templatesByVertical)].flat()
75
114
  /**
76
115
  * The currently previewed template. When set, the component renders the preview view instead of the list.
77
116
  */
@@ -114,7 +153,7 @@ let DomainTemplateBrowser = (() => {
114
153
  search(value) {
115
154
  this.query = value;
116
155
  if (!value) {
117
- this.templates = [...Object.values(TEMPLATE_METADATA_REGISTRY)];
156
+ this.templates = [...Object.values(templatesByVertical)].flat();
118
157
  }
119
158
  else {
120
159
  this.templates = searchTemplates(value);
@@ -129,11 +168,11 @@ let DomainTemplateBrowser = (() => {
129
168
  }
130
169
  if (value === '') {
131
170
  this.category = undefined;
132
- this.templates = [...Object.values(TEMPLATE_METADATA_REGISTRY)];
171
+ this.templates = [...Object.values(templatesByVertical)].flat();
133
172
  }
134
173
  else {
135
174
  this.category = value;
136
- this.templates = getTemplatesByCategory(this.category);
175
+ this.templates = templatesByVertical[this.category].flat();
137
176
  }
138
177
  }
139
178
  handleTemplateSelect(e) {
@@ -153,7 +192,11 @@ let DomainTemplateBrowser = (() => {
153
192
  if (!templateId) {
154
193
  return;
155
194
  }
156
- this.previewTemplate = this.templates.find((t) => t.id === templateId);
195
+ const value = TEMPLATE_METADATA_REGISTRY[templateId];
196
+ if (!value) {
197
+ return;
198
+ }
199
+ this.previewTemplate = value;
157
200
  }
158
201
  handleClosePreview() {
159
202
  this.previewTemplate = undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"DomainTemplateBrowser.js","sourceRoot":"","sources":["../../../../src/modeling/internals/DomainTemplateBrowser.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAuB,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACnD,OAAO,EACL,0BAA0B,EAC1B,mBAAmB,EACnB,eAAe,EACf,sBAAsB,GACvB,MAAM,mDAAmD,CAAA;AAW1D,MAAM,CAAC,MAAM,mBAAmB,GAAG,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAyC,CAAA;AAY3G;;GAEG;AACH,MAAM,UAAU,eAAe,CAAC,CAAe;IAC7C,IAAI,CAAC,CAAC,OAAO,EAAE,CAAC;QACd,OAAO,KAAK,CAAA;IACd,CAAC;IACD,QAAQ,CAAC,CAAC,IA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orators.js'\nimport {\n TEMPLATE_METADATA_REGISTRY,\n TEMPLATE_CATEGORIES,\n searchTemplates,\n getTemplatesByCategory,\n} from '@api-client/core/modeling/templates/meta/index.js'\nimport type {\n AssociationInfo,\n DomainTemplate,\n EntityInfo,\n ModelInfo,\n NamespaceInfo,\n PropertyInfo,\n} from '@api-client/core/modeling/templates/types.js'\nimport type { IconType } from '../../md/icons/Icons.js'\n\nexport const availableCategories = Object.keys(TEMPLATE_CATEGORIES) as (keyof typeof TEMPLATE_CATEGORIES)[]\n\n/**\n * The selection detail object dispatched by the `selectionchange` event.\n */\nexport interface BrowseTemplatesSelection {\n /**\n * The key of the selected template\n */\n selected: string\n}\n\n/**\n * Generates an icon name for the DomainProperty that illustrate its primary purpose.\n */\nexport function getPropertyIcon(p: PropertyInfo): IconType {\n if (p.primary) {\n return 'key'\n }\n switch (p.type) {\n // case 'integer':\n case 'number':\n return 'number'\n case 'date':\n return 'calendarToday'\n case 'time':\n return 'schedule'\n case 'datetime':\n return 'event'\n case 'boolean':\n return 'checkCircle'\n case 'binary':\n return 'draft'\n default:\n return 'textFields'\n }\n}\n\n/**\n * A browser component for exploring and selecting domain templates.\n * It provides the UI for searching, filtering, previewing, and selecting data domain templates.\n *\n * It manages the filtering state internally but allows property binding for query and category.\n *\n * @fires selectionchange - Dispatched when the user selects a template item. The detail object contains the `selected`\n * status which is the template ID (e.g. `CustomEvent<{ selected: string }>`).\n */\nexport default class DomainTemplateBrowser extends LitElement {\n /**\n * The user entered search query to filter the templates.\n * If not set, all templates are shown (unless filtered by category).\n * @attribute\n */\n @property({ type: String }) accessor query: string | undefined\n\n /**\n * The selected template category to filter the list.\n * If not set, all categories are included.\n * @attribute\n */\n @property({ type: String }) accessor category: keyof typeof TEMPLATE_CATEGORIES | undefined\n\n /**\n * The internal list of filtered templates to render in the UI.\n * This is computed based on `query` and `category`.\n */\n @state() accessor templates: DomainTemplate[] = [...Object.values(TEMPLATE_METADATA_REGISTRY)]\n\n /**\n * The currently previewed template. When set, the component renders the preview view instead of the list.\n */\n @state() accessor previewTemplate: DomainTemplate | undefined\n\n /**\n * Handles keydown events on the search input.\n * Triggers a search on Enter or resets on Escape.\n */\n protected handleSearchKeydown(e: KeyboardEvent): void {\n const input = e.currentTarget as HTMLInputElement\n const value = input.value.trim()\n if (e.key === 'Enter' && value) {\n this.search(value)\n } else if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n input.value = ''\n this.search()\n }\n }\n\n /**\n * Performs an in-memory search for templates matching the provided query.\n * Updates the `templates` state with the search results.\n *\n * @param value The search query. If empty, resets the search.\n */\n search(value?: string): void {\n this.query = value\n if (!value) {\n this.templates = [...Object.values(TEMPLATE_METADATA_REGISTRY)]\n } else {\n this.templates = searchTemplates(value)\n }\n }\n\n protected handleFilterClick(e: Event): void {\n const target = e.target as HTMLElement\n const value = target.dataset.value\n // Toggle category selection\n if (this.category === value) {\n return\n }\n if (value === '') {\n this.category = undefined\n this.templates = [...Object.values(TEMPLATE_METADATA_REGISTRY)]\n } else {\n this.category = value as keyof typeof TEMPLATE_CATEGORIES\n this.templates = getTemplatesByCategory(this.category)\n }\n }\n\n protected handleTemplateSelect(e: Event): void {\n const templateId = (e.currentTarget as HTMLElement).dataset.id\n if (!templateId) {\n return\n }\n // Dispatch selection event\n this.dispatchEvent(\n new CustomEvent<BrowseTemplatesSelection>('selectionchange', {\n detail: { selected: templateId },\n bubbles: false,\n })\n )\n }\n\n protected handleTemplatePreview(e: Event): void {\n e.stopPropagation()\n const templateId = (e.currentTarget as HTMLElement).dataset.id\n if (!templateId) {\n return\n }\n this.previewTemplate = this.templates.find((t) => t.id === templateId)\n }\n\n protected handleClosePreview(): void {\n this.previewTemplate = undefined\n }\n\n protected override render(): TemplateResult {\n if (this.previewTemplate) {\n return this.renderPreviewMode()\n }\n\n return html`\n <div class=\"controls\">${this.renderTopControls()} ${this.renderCategoryFilters()}</div>\n ${this.templates.length > 0 ? this.renderTemplatesGrid() : this.renderEmptyState()}\n `\n }\n\n protected renderTopControls(): TemplateResult {\n return html`\n <div class=\"top-row\">\n <div class=\"search-group\">${this.renderSearchInput()}</div>\n </div>\n `\n }\n\n protected renderSearchInput(): TemplateResult {\n return html`\n <ui-outlined-text-field\n id=\"template-search\"\n label=\"Search templates...\"\n type=\"search\"\n class=\"search\"\n .value=\"${this.query ?? ''}\"\n @keydown=\"${this.handleSearchKeydown}\"\n >\n <ui-icon slot=\"prefix\">search</ui-icon>\n </ui-outlined-text-field>\n `\n }\n\n protected renderCategoryFilters(): TemplateResult {\n return html`\n <div class=\"category-tabs\">\n <ui-button-group type=\"connected\">\n <ui-button\n color=\"tonal\"\n size=\"s\"\n toggle\n data-value=\"\"\n ?selected=\"${!this.category}\"\n @click=\"${this.handleFilterClick}\"\n >\n All\n </ui-button>\n ${availableCategories.map((category) => {\n const isSelected = this.category === category\n return html`<ui-button\n color=\"tonal\"\n size=\"s\"\n toggle\n data-value=\"${category}\"\n ?selected=\"${isSelected}\"\n @click=\"${this.handleFilterClick}\"\n >\n ${category}\n </ui-button>`\n })}\n </ui-button-group>\n </div>\n `\n }\n\n protected renderTemplatesGrid(): TemplateResult {\n return html`\n <div class=\"templates-grid\">${this.templates.map((template) => this.renderTemplateCard(template))}</div>\n `\n }\n\n protected renderTemplateCard(template: DomainTemplate): TemplateResult {\n // Use available properties from DomainTemplate interface\n const templateName = template.name || 'Unnamed Template'\n const templateDescription = template.description || 'No description available'\n\n return html`\n <div class=\"template-card\">\n <h3 class=\"template-title display-small\">${templateName}</h3>\n <p class=\"template-description body-medium\">${templateDescription}</p>\n\n <div class=\"template-actions\">\n <ui-button data-id=\"${template.id}\" color=\"outlined\" size=\"s\" @click=\"${this.handleTemplatePreview}\">\n Details\n </ui-button>\n <ui-button color=\"filled\" size=\"s\" data-id=\"${template.id}\" @click=\"${this.handleTemplateSelect}\">\n Use template\n </ui-button>\n </div>\n </div>\n `\n }\n\n protected renderEmptyState(): TemplateResult {\n const message = this.query\n ? `No templates found for \"${this.query}\"`\n : this.category\n ? `No templates found in \"${this.category}\" category`\n : 'No templates available'\n\n const description =\n this.query || this.category ? 'Try adjusting your search or filters' : 'Templates will appear here when available'\n\n return html`\n <div class=\"empty-state\">\n <ui-icon class=\"empty-icon\">search_off</ui-icon>\n <h3 class=\"empty-title title-large\">${message}</h3>\n <p class=\"empty-description body-large\">${description}</p>\n </div>\n `\n }\n\n renderPreviewMode(): TemplateResult {\n return html`\n <div class=\"preview-header\">\n <ui-button color=\"text\" @click=\"${this.handleClosePreview}\">\n <ui-icon slot=\"icon\">arrow_back</ui-icon>\n Back to Templates\n </ui-button>\n </div>\n <div class=\"preview-main\">${this.renderTemplateDetails(this.previewTemplate as DomainTemplate)}</div>\n `\n }\n\n protected renderTemplateDetails(template: DomainTemplate): TemplateResult {\n return html`\n <div class=\"template-details\">\n <h1 class=\"template-details-title display-small\">${template.name}</h1>\n <div class=\"template-details-header\">\n <div class=\"template-details-info\">\n <p class=\"template-details-description\">${template.description}</p>\n <div class=\"template-metadata\">\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Author:</span>\n <span class=\"metadata-value\">${template.author}</span>\n </div>\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Version:</span>\n <span class=\"metadata-value\">${template.version}</span>\n </div>\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Created:</span>\n <span class=\"metadata-value\">${new Date(template.createdAt).toLocaleDateString()}</span>\n </div>\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Updated:</span>\n <span class=\"metadata-value\">${new Date(template.updatedAt).toLocaleDateString()}</span>\n </div>\n </div>\n <div class=\"template-tags\">\n ${template.tags.map((tag) => html`<span class=\"template-tag\">${tag}</span>`)}\n </div>\n </div>\n <div class=\"template-details-actions\">\n <ui-button color=\"filled\" size=\"s\" data-id=\"${template.id}\" @click=\"${this.handleTemplateSelect}\">\n <ui-icon slot=\"icon\">download</ui-icon>\n Use This Template\n </ui-button>\n </div>\n </div>\n\n <div class=\"template-structure\">\n <h2 class=\"structure-title title-large\">Data Domain Structure</h2>\n ${this.renderDomainStructure(template)}\n </div>\n </div>\n `\n }\n\n protected renderDomainStructure(template: DomainTemplate): TemplateResult {\n const { structure } = template\n const { namespaces } = structure\n\n return html`<div class=\"domain-structure\">${this.renderNamespaces(namespaces)}</div>`\n }\n\n protected renderNamespaces(namespaces: NamespaceInfo[]): TemplateResult {\n return html`\n <div class=\"namespaces-section\">\n <h3 class=\"title-medium\">Namespaces</h3>\n ${namespaces.map(\n (namespace) => html`\n <div class=\"namespace-item\">\n <div class=\"namespace-header\">\n <ui-icon class=\"namespace-icon\" icon=\"schemaNamespace\"></ui-icon>\n <h4 class=\"title-small\">${namespace.displayName || namespace.name}</h4>\n </div>\n ${namespace.description\n ? html`<p class=\"namespace-description body-medium\">${namespace.description}</p>`\n : ''}\n ${this.renderModels(namespace.models)}\n </div>\n `\n )}\n </div>\n `\n }\n\n protected renderModels(models: ModelInfo[]): TemplateResult {\n return html`\n <div class=\"models-section\">\n ${models.map(\n (model) => html`\n <div class=\"domain-model\">\n <div class=\"domain-model-header\">\n <ui-icon class=\"model-icon\" icon=\"schemaModel\"></ui-icon>\n <h5 class=\"title-small\">${model.displayName || model.name}</h5>\n </div>\n ${model.description ? html`<p class=\"model-description body-medium\">${model.description}</p>` : ''}\n <div class=\"model-entities\">${model.entities.map((entity) => this.renderDomainEntity(entity))}</div>\n </div>\n `\n )}\n </div>\n `\n }\n\n protected renderDomainEntity(entity: EntityInfo): TemplateResult {\n return html`\n <div class=\"domain-entity\">\n <div class=\"entity-header\">\n <div class=\"entity-title\">\n <ui-icon class=\"entity-icon\" icon=\"schemaEntity\"></ui-icon>\n <h6 class=\"entity-name label-large\">${entity.displayName || entity.name}</h6>\n ${entity.deprecated ? html`<span class=\"deprecated-badge\">Deprecated</span>` : ''}\n </div>\n ${entity.description ? html`<p class=\"entity-description body-medium\">${entity.description}</p>` : ''}\n </div>\n ${entity.semantics?.length > 0\n ? html`\n <div class=\"entity-semantics\">\n <span class=\"semantics-label\">Semantics:</span>\n ${entity.semantics.map((semantic: string) => html`<span class=\"semantic-tag\">${semantic}</span>`)}\n </div>\n `\n : ''}\n ${entity.properties?.length > 0\n ? html`\n <div class=\"entity-section\">\n <h5 class=\"section-title title-small\">Properties (${entity.propertyCount})</h5>\n <div class=\"properties-list\">${entity.properties.map((prop) => this.renderProperty(prop))}</div>\n </div>\n `\n : ''}\n ${entity.associations?.length > 0\n ? html`\n <div class=\"entity-section\">\n <h5 class=\"section-title title-small\">Associations (${entity.associationCount})</h5>\n <div class=\"associations-list\">\n ${entity.associations.map((assoc) => this.renderAssociation(assoc))}\n </div>\n </div>\n `\n : ''}\n </div>\n `\n }\n\n protected renderProperty(property: PropertyInfo): TemplateResult {\n const badges: string[] = []\n\n if (property.required) badges.push('Required')\n if (property.primary) badges.push('Primary')\n if (property.unique) badges.push('Unique')\n if (property.readOnly) badges.push('Read-only')\n if (property.writeOnly) badges.push('Write-only')\n if (property.multiple) badges.push('Multiple')\n if (property.deprecated) badges.push('Deprecated')\n\n const icon = getPropertyIcon(property)\n return html`\n <div class=\"property-item ${property.deprecated ? 'deprecated' : ''}\">\n <div class=\"property-header\">\n <ui-icon class=\"property-icon\" .icon=${icon}></ui-icon>\n <span class=\"label-large\">${property.displayName || property.name}</span>\n <span class=\"property-type body-small\">${property.type}</span>\n </div>\n ${property.description ? html`<p class=\"property-description body-medium\">${property.description}</p>` : ''}\n ${badges.length > 0\n ? html`<div class=\"property-badges\">\n ${badges.map((badge) => html`<span class=\"property-badge body-small\">${badge}</span>`)}\n </div>`\n : ''}\n ${property.defaultValue\n ? html`<div class=\"property-default\">Default: <code>${property.defaultValue}</code></div>`\n : ''}\n ${property.enumValues && property.enumValues.length > 0\n ? html`<div class=\"property-enum\">\n Values: ${property.enumValues.map((val) => html`<code>${val}</code>`)}\n </div>`\n : ''}\n ${property.semantics?.length > 0\n ? html`\n <div class=\"property-semantics\">\n ${property.semantics.map((semantic) => html`<span class=\"semantic-tag\">${semantic}</span>`)}\n </div>\n `\n : ''}\n </div>\n `\n }\n\n protected renderAssociation(association: AssociationInfo): TemplateResult {\n const badges = []\n\n if (association.required) badges.push('Required')\n if (association.multiple) badges.push('Multiple')\n if (association.readOnly) badges.push('Read-only')\n\n return html`\n <div class=\"association-item\">\n <div class=\"association-header\">\n <ui-icon class=\"association-icon\">link</ui-icon>\n <span class=\"label-large\">${association.displayName || association.name}</span>\n <span class=\"association-targets\">${association.targetEntities.join(', ')}</span>\n </div>\n ${association.description ? html`<p class=\"association-description\">${association.description}</p>` : ''}\n ${badges.length > 0\n ? html`<div class=\"association-badges\">\n ${badges.map((badge: string) => html`<span class=\"association-badge\">${badge}</span>`)}\n </div>`\n : ''}\n ${association.semantics?.length > 0\n ? html`\n <div class=\"association-semantics\">\n ${association.semantics.map((semantic: string) => html`<span class=\"semantic-tag\">${semantic}</span>`)}\n </div>\n `\n : ''}\n </div>\n `\n }\n}\n"]}
1
+ {"version":3,"file":"DomainTemplateBrowser.js","sourceRoot":"","sources":["../../../../src/modeling/internals/DomainTemplateBrowser.ts"],"names":[],"mappings":";AAAA,4BAA4B;AAC5B,OAAO,EAAE,IAAI,EAAuB,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAEnD,4BAA4B;AAC5B,OAAO,yBAAyB,MAAM,2DAA2D,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACvH,OAAO,8BAA8B,MAAM,iEAAiE,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAClI,OAAO,oCAAoC,MAAM,uEAAuE,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC9I,OAAO,iCAAiC,MAAM,oEAAoE,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AACxI,OAAO,mCAAmC,MAAM,sEAAsE,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAA;AAC5I,OAAO,o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AAW,CAAC,WAAW,MAAM,CAAC,CAAC,CAAC,EAAE;UACtG,MAAM,CAAC,MAAM,GAAG,CAAC;gBACjB,CAAC,CAAC,IAAI,CAAA;gBACA,MAAM,CAAC,GAAG,CAAC,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAA,mCAAmC,KAAK,SAAS,CAAC;mBACjF;gBACT,CAAC,CAAC,EAAE;UACJ,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,CAAC;gBACjC,CAAC,CAAC,IAAI,CAAA;;kBAEE,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,QAAgB,EAAE,EAAE,CAAC,IAAI,CAAA,8BAA8B,QAAQ,SAAS,CAAC;;aAEzG;gBACH,CAAC,CAAC,EAAE;;KAET,CAAA;QACH,CAAC;;;;;;;AA9bH;;;;;;;;GAQG;AACH,qCAsbC","sourcesContent":["/* eslint-disable max-len */\nimport { html, type TemplateResult, LitElement } from 'lit'\nimport { state, property } from 'lit/decorators.js'\nimport type { IconType } from '../../md/icons/Icons.js'\n// Template metadata imports\nimport ecommercePlatformMetadata from '@api-client/domain-templates/meta/ecommerce-platform.json' with { type: 'json' }\nimport blogPublishingPlatformMetadata from '@api-client/domain-templates/meta/blog-publishing-platform.json' with { type: 'json' }\nimport healthcareManagementPlatformMetadata from '@api-client/domain-templates/meta/healthcare-management-platform.json' with { type: 'json' }\nimport financialServicesPlatformMetadata from '@api-client/domain-templates/meta/financial-services-platform.json' with { type: 'json' }\nimport educationManagementPlatformMetadata from '@api-client/domain-templates/meta/education-management-platform.json' with { type: 'json' }\nimport realEstateManagementPlatformMetadata from '@api-client/domain-templates/meta/real-estate-management-platform.json' with { type: 'json' }\nimport manufacturingPlatformMetadata from '@api-client/domain-templates/meta/manufacturing-platform.json' with { type: 'json' }\nimport hospitalityPlatformMetadata from '@api-client/domain-templates/meta/hospitality-platform.json' with { type: 'json' }\nimport legalServicesPlatformMetadata from '@api-client/domain-templates/meta/legal-services-platform.json' with { type: 'json' }\nimport nonProfitPlatformMetadata from '@api-client/domain-templates/meta/non-profit-platform.json' with { type: 'json' }\nimport iotSmartHomePlatformMetadata from '@api-client/domain-templates/meta/iot-smart-home-platform.json' with { type: 'json' }\nimport gamingPlatformMetadata from '@api-client/domain-templates/meta/gaming-platform.json' with { type: 'json' }\nimport { templatesByVertical } from '@api-client/domain-templates'\nimport type {\n AssociationInfo,\n DomainTemplate,\n DomainTemplateMetadata,\n EntityInfo,\n ModelInfo,\n NamespaceInfo,\n PropertyInfo,\n} from '@api-client/domain-templates/types.js'\n\n/**\n * Registry of all available template metadata\n */\nexport const TEMPLATE_METADATA_REGISTRY: Record<string, DomainTemplate> = {\n 'ecommerce-platform': ecommercePlatformMetadata as DomainTemplate,\n 'blog-publishing-platform': blogPublishingPlatformMetadata as DomainTemplate,\n 'healthcare-management-platform': healthcareManagementPlatformMetadata as DomainTemplate,\n 'financial-services-platform': financialServicesPlatformMetadata as DomainTemplate,\n 'education-management-platform': educationManagementPlatformMetadata as DomainTemplate,\n 'real-estate-management-platform': realEstateManagementPlatformMetadata as DomainTemplate,\n 'manufacturing-platform': manufacturingPlatformMetadata as DomainTemplate,\n 'hospitality-platform': hospitalityPlatformMetadata as DomainTemplate,\n 'legal-services-platform': legalServicesPlatformMetadata as DomainTemplate,\n 'non-profit-platform': nonProfitPlatformMetadata as DomainTemplate,\n 'iot-smart-home-platform': iotSmartHomePlatformMetadata as DomainTemplate,\n 'gaming-platform': gamingPlatformMetadata as DomainTemplate,\n} as const\n\nexport const availableCategories = Object.keys(templatesByVertical) as (keyof typeof templatesByVertical)[]\n\n/**\n * The selection detail object dispatched by the `selectionchange` event.\n */\nexport interface BrowseTemplatesSelection {\n /**\n * The key of the selected template\n */\n selected: string\n}\n\n/**\n * Generates an icon name for the DomainProperty that illustrate its primary purpose.\n */\nexport function getPropertyIcon(p: PropertyInfo): IconType {\n if (p.primary) {\n return 'key'\n }\n switch (p.type) {\n // case 'integer':\n case 'number':\n return 'number'\n case 'date':\n return 'calendarToday'\n case 'time':\n return 'schedule'\n case 'datetime':\n return 'event'\n case 'boolean':\n return 'checkCircle'\n case 'binary':\n return 'draft'\n default:\n return 'textFields'\n }\n}\n\nfunction searchTemplates(query: string): DomainTemplateMetadata[] {\n const searchTerm = query.toLowerCase()\n return Object.values(templatesByVertical)\n .flat()\n .filter(\n (template) =>\n template.name.toLowerCase().includes(searchTerm) ||\n template.description.toLowerCase().includes(searchTerm) ||\n template.tags.some((tag) => tag.toLowerCase().includes(searchTerm))\n )\n}\n\n/**\n * A browser component for exploring and selecting domain templates.\n * It provides the UI for searching, filtering, previewing, and selecting data domain templates.\n *\n * It manages the filtering state internally but allows property binding for query and category.\n *\n * @fires selectionchange - Dispatched when the user selects a template item. The detail object contains the `selected`\n * status which is the template ID (e.g. `CustomEvent<{ selected: string }>`).\n */\nexport default class DomainTemplateBrowser extends LitElement {\n /**\n * The user entered search query to filter the templates.\n * If not set, all templates are shown (unless filtered by category).\n * @attribute\n */\n @property({ type: String }) accessor query: string | undefined\n\n /**\n * The selected template category to filter the list.\n * If not set, all categories are included.\n * @attribute\n */\n @property({ type: String }) accessor category: keyof typeof templatesByVertical | undefined\n\n /**\n * The internal list of filtered templates to render in the UI.\n * This is computed based on `query` and `category`.\n */\n @state() accessor templates: DomainTemplateMetadata[] = [...Object.values(templatesByVertical)].flat()\n\n /**\n * The currently previewed template. When set, the component renders the preview view instead of the list.\n */\n @state() accessor previewTemplate: DomainTemplate | undefined\n\n /**\n * Handles keydown events on the search input.\n * Triggers a search on Enter or resets on Escape.\n */\n protected handleSearchKeydown(e: KeyboardEvent): void {\n const input = e.currentTarget as HTMLInputElement\n const value = input.value.trim()\n if (e.key === 'Enter' && value) {\n this.search(value)\n } else if (e.key === 'Escape') {\n e.preventDefault()\n e.stopPropagation()\n input.value = ''\n this.search()\n }\n }\n\n /**\n * Performs an in-memory search for templates matching the provided query.\n * Updates the `templates` state with the search results.\n *\n * @param value The search query. If empty, resets the search.\n */\n search(value?: string): void {\n this.query = value\n if (!value) {\n this.templates = [...Object.values(templatesByVertical)].flat()\n } else {\n this.templates = searchTemplates(value)\n }\n }\n\n protected handleFilterClick(e: Event): void {\n const target = e.target as HTMLElement\n const value = target.dataset.value\n // Toggle category selection\n if (this.category === value) {\n return\n }\n if (value === '') {\n this.category = undefined\n this.templates = [...Object.values(templatesByVertical)].flat()\n } else {\n this.category = value as keyof typeof templatesByVertical\n this.templates = templatesByVertical[this.category].flat()\n }\n }\n\n protected handleTemplateSelect(e: Event): void {\n const templateId = (e.currentTarget as HTMLElement).dataset.id\n if (!templateId) {\n return\n }\n // Dispatch selection event\n this.dispatchEvent(\n new CustomEvent<BrowseTemplatesSelection>('selectionchange', {\n detail: { selected: templateId },\n bubbles: false,\n })\n )\n }\n\n protected handleTemplatePreview(e: Event): void {\n e.stopPropagation()\n const templateId = (e.currentTarget as HTMLElement).dataset.id\n if (!templateId) {\n return\n }\n const value = TEMPLATE_METADATA_REGISTRY[templateId]\n if (!value) {\n return\n }\n this.previewTemplate = value\n }\n\n protected handleClosePreview(): void {\n this.previewTemplate = undefined\n }\n\n protected override render(): TemplateResult {\n if (this.previewTemplate) {\n return this.renderPreviewMode()\n }\n\n return html`\n <div class=\"controls\">${this.renderTopControls()} ${this.renderCategoryFilters()}</div>\n ${this.templates.length > 0 ? this.renderTemplatesGrid() : this.renderEmptyState()}\n `\n }\n\n protected renderTopControls(): TemplateResult {\n return html`\n <div class=\"top-row\">\n <div class=\"search-group\">${this.renderSearchInput()}</div>\n </div>\n `\n }\n\n protected renderSearchInput(): TemplateResult {\n return html`\n <ui-outlined-text-field\n id=\"template-search\"\n label=\"Search templates...\"\n type=\"search\"\n class=\"search\"\n .value=\"${this.query ?? ''}\"\n @keydown=\"${this.handleSearchKeydown}\"\n >\n <ui-icon slot=\"prefix\">search</ui-icon>\n </ui-outlined-text-field>\n `\n }\n\n protected renderCategoryFilters(): TemplateResult {\n return html`\n <div class=\"category-tabs\">\n <ui-button-group type=\"connected\">\n <ui-button\n color=\"tonal\"\n size=\"s\"\n toggle\n data-value=\"\"\n ?selected=\"${!this.category}\"\n @click=\"${this.handleFilterClick}\"\n >\n All\n </ui-button>\n ${availableCategories.map((category) => {\n const isSelected = this.category === category\n return html`<ui-button\n color=\"tonal\"\n size=\"s\"\n toggle\n data-value=\"${category}\"\n ?selected=\"${isSelected}\"\n @click=\"${this.handleFilterClick}\"\n >\n ${category}\n </ui-button>`\n })}\n </ui-button-group>\n </div>\n `\n }\n\n protected renderTemplatesGrid(): TemplateResult {\n return html`\n <div class=\"templates-grid\">${this.templates.map((template) => this.renderTemplateCard(template))}</div>\n `\n }\n\n protected renderTemplateCard(template: DomainTemplateMetadata): TemplateResult {\n // Use available properties from DomainTemplate interface\n const templateName = template.name || 'Unnamed Template'\n const templateDescription = template.description || 'No description available'\n\n return html`\n <div class=\"template-card\">\n <h3 class=\"template-title display-small\">${templateName}</h3>\n <p class=\"template-description body-medium\">${templateDescription}</p>\n\n <div class=\"template-actions\">\n <ui-button data-id=\"${template.id}\" color=\"outlined\" size=\"s\" @click=\"${this.handleTemplatePreview}\">\n Details\n </ui-button>\n <ui-button color=\"filled\" size=\"s\" data-id=\"${template.id}\" @click=\"${this.handleTemplateSelect}\">\n Use template\n </ui-button>\n </div>\n </div>\n `\n }\n\n protected renderEmptyState(): TemplateResult {\n const message = this.query\n ? `No templates found for \"${this.query}\"`\n : this.category\n ? `No templates found in \"${this.category}\" category`\n : 'No templates available'\n\n const description =\n this.query || this.category ? 'Try adjusting your search or filters' : 'Templates will appear here when available'\n\n return html`\n <div class=\"empty-state\">\n <ui-icon class=\"empty-icon\">search_off</ui-icon>\n <h3 class=\"empty-title title-large\">${message}</h3>\n <p class=\"empty-description body-large\">${description}</p>\n </div>\n `\n }\n\n renderPreviewMode(): TemplateResult {\n return html`\n <div class=\"preview-header\">\n <ui-button color=\"text\" @click=\"${this.handleClosePreview}\">\n <ui-icon slot=\"icon\">arrow_back</ui-icon>\n Back to Templates\n </ui-button>\n </div>\n <div class=\"preview-main\">${this.renderTemplateDetails(this.previewTemplate as DomainTemplate)}</div>\n `\n }\n\n protected renderTemplateDetails(template: DomainTemplate): TemplateResult {\n return html`\n <div class=\"template-details\">\n <h1 class=\"template-details-title display-small\">${template.name}</h1>\n <div class=\"template-details-header\">\n <div class=\"template-details-info\">\n <p class=\"template-details-description\">${template.description}</p>\n <div class=\"template-metadata\">\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Author:</span>\n <span class=\"metadata-value\">${template.author}</span>\n </div>\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Version:</span>\n <span class=\"metadata-value\">${template.version}</span>\n </div>\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Created:</span>\n <span class=\"metadata-value\">${new Date(template.createdAt).toLocaleDateString()}</span>\n </div>\n <div class=\"metadata-item\">\n <span class=\"metadata-label\">Updated:</span>\n <span class=\"metadata-value\">${new Date(template.updatedAt).toLocaleDateString()}</span>\n </div>\n </div>\n <div class=\"template-tags\">\n ${template.tags.map((tag) => html`<span class=\"template-tag\">${tag}</span>`)}\n </div>\n </div>\n <div class=\"template-details-actions\">\n <ui-button color=\"filled\" size=\"s\" data-id=\"${template.id}\" @click=\"${this.handleTemplateSelect}\">\n <ui-icon slot=\"icon\">download</ui-icon>\n Use This Template\n </ui-button>\n </div>\n </div>\n\n <div class=\"template-structure\">\n <h2 class=\"structure-title title-large\">Data Domain Structure</h2>\n ${this.renderDomainStructure(template)}\n </div>\n </div>\n `\n }\n\n protected renderDomainStructure(template: DomainTemplate): TemplateResult {\n const { structure } = template\n const { namespaces } = structure\n\n return html`<div class=\"domain-structure\">${this.renderNamespaces(namespaces)}</div>`\n }\n\n protected renderNamespaces(namespaces: NamespaceInfo[]): TemplateResult {\n return html`\n <div class=\"namespaces-section\">\n <h3 class=\"title-medium\">Namespaces</h3>\n ${namespaces.map(\n (namespace) => html`\n <div class=\"namespace-item\">\n <div class=\"namespace-header\">\n <ui-icon class=\"namespace-icon\" icon=\"schemaNamespace\"></ui-icon>\n <h4 class=\"title-small\">${namespace.displayName || namespace.name}</h4>\n </div>\n ${namespace.description\n ? html`<p class=\"namespace-description body-medium\">${namespace.description}</p>`\n : ''}\n ${this.renderModels(namespace.models)}\n </div>\n `\n )}\n </div>\n `\n }\n\n protected renderModels(models: ModelInfo[]): TemplateResult {\n return html`\n <div class=\"models-section\">\n ${models.map(\n (model) => html`\n <div class=\"domain-model\">\n <div class=\"domain-model-header\">\n <ui-icon class=\"model-icon\" icon=\"schemaModel\"></ui-icon>\n <h5 class=\"title-small\">${model.displayName || model.name}</h5>\n </div>\n ${model.description ? html`<p class=\"model-description body-medium\">${model.description}</p>` : ''}\n <div class=\"model-entities\">${model.entities.map((entity) => this.renderDomainEntity(entity))}</div>\n </div>\n `\n )}\n </div>\n `\n }\n\n protected renderDomainEntity(entity: EntityInfo): TemplateResult {\n return html`\n <div class=\"domain-entity\">\n <div class=\"entity-header\">\n <div class=\"entity-title\">\n <ui-icon class=\"entity-icon\" icon=\"schemaEntity\"></ui-icon>\n <h6 class=\"entity-name label-large\">${entity.displayName || entity.name}</h6>\n ${entity.deprecated ? html`<span class=\"deprecated-badge\">Deprecated</span>` : ''}\n </div>\n ${entity.description ? html`<p class=\"entity-description body-medium\">${entity.description}</p>` : ''}\n </div>\n ${entity.semantics?.length > 0\n ? html`\n <div class=\"entity-semantics\">\n <span class=\"semantics-label\">Semantics:</span>\n ${entity.semantics.map((semantic: string) => html`<span class=\"semantic-tag\">${semantic}</span>`)}\n </div>\n `\n : ''}\n ${entity.properties?.length > 0\n ? html`\n <div class=\"entity-section\">\n <h5 class=\"section-title title-small\">Properties (${entity.propertyCount})</h5>\n <div class=\"properties-list\">${entity.properties.map((prop) => this.renderProperty(prop))}</div>\n </div>\n `\n : ''}\n ${entity.associations?.length > 0\n ? html`\n <div class=\"entity-section\">\n <h5 class=\"section-title title-small\">Associations (${entity.associationCount})</h5>\n <div class=\"associations-list\">\n ${entity.associations.map((assoc) => this.renderAssociation(assoc))}\n </div>\n </div>\n `\n : ''}\n </div>\n `\n }\n\n protected renderProperty(property: PropertyInfo): TemplateResult {\n const badges: string[] = []\n\n if (property.required) badges.push('Required')\n if (property.primary) badges.push('Primary')\n if (property.unique) badges.push('Unique')\n if (property.readOnly) badges.push('Read-only')\n if (property.writeOnly) badges.push('Write-only')\n if (property.multiple) badges.push('Multiple')\n if (property.deprecated) badges.push('Deprecated')\n\n const icon = getPropertyIcon(property)\n return html`\n <div class=\"property-item ${property.deprecated ? 'deprecated' : ''}\">\n <div class=\"property-header\">\n <ui-icon class=\"property-icon\" .icon=${icon}></ui-icon>\n <span class=\"label-large\">${property.displayName || property.name}</span>\n <span class=\"property-type body-small\">${property.type}</span>\n </div>\n ${property.description ? html`<p class=\"property-description body-medium\">${property.description}</p>` : ''}\n ${badges.length > 0\n ? html`<div class=\"property-badges\">\n ${badges.map((badge) => html`<span class=\"property-badge body-small\">${badge}</span>`)}\n </div>`\n : ''}\n ${property.defaultValue\n ? html`<div class=\"property-default\">Default: <code>${property.defaultValue}</code></div>`\n : ''}\n ${property.enumValues && property.enumValues.length > 0\n ? html`<div class=\"property-enum\">\n Values: ${property.enumValues.map((val) => html`<code>${val}</code>`)}\n </div>`\n : ''}\n ${property.semantics?.length > 0\n ? html`\n <div class=\"property-semantics\">\n ${property.semantics.map((semantic) => html`<span class=\"semantic-tag\">${semantic}</span>`)}\n </div>\n `\n : ''}\n </div>\n `\n }\n\n protected renderAssociation(association: AssociationInfo): TemplateResult {\n const badges = []\n\n if (association.required) badges.push('Required')\n if (association.multiple) badges.push('Multiple')\n if (association.readOnly) badges.push('Read-only')\n\n return html`\n <div class=\"association-item\">\n <div class=\"association-header\">\n <ui-icon class=\"association-icon\">link</ui-icon>\n <span class=\"label-large\">${association.displayName || association.name}</span>\n <span class=\"association-targets\">${association.targetEntities.join(', ')}</span>\n </div>\n ${association.description ? html`<p class=\"association-description\">${association.description}</p>` : ''}\n ${badges.length > 0\n ? html`<div class=\"association-badges\">\n ${badges.map((badge: string) => html`<span class=\"association-badge\">${badge}</span>`)}\n </div>`\n : ''}\n ${association.semantics?.length > 0\n ? html`\n <div class=\"association-semantics\">\n ${association.semantics.map((semantic: string) => html`<span class=\"semantic-tag\">${semantic}</span>`)}\n </div>\n `\n : ''}\n </div>\n `\n }\n}\n"]}