@memberjunction/ng-core-entity-forms 5.11.0 → 5.13.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/lib/custom/AIAgents/FlowAgentType/flow-agent-form-section.component.js +2 -2
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +8 -0
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +199 -139
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js +6 -6
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js +2 -2
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js +6 -6
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +3 -3
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.js +2 -2
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +4 -4
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js +2 -2
- package/dist/lib/custom/Actions/action-execution-log-form.component.js +5 -5
- package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.js +22 -22
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts +11 -0
- package/dist/lib/custom/Entities/entity-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.js +244 -217
- package/dist/lib/custom/Entities/entity-form.component.js.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.js +3 -3
- package/dist/lib/custom/EntityActions/entityaction.form.component.js.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.js +8 -8
- package/dist/lib/custom/Lists/list-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-category-dialog.component.js +3 -3
- package/dist/lib/custom/Queries/query-category-dialog.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.js +2 -2
- package/dist/lib/custom/Queries/query-run-dialog.component.js +3 -3
- package/dist/lib/custom/Queries/query-run-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.js +107 -111
- package/dist/lib/custom/Templates/template-param-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.js +2 -2
- package/dist/lib/custom/Templates/templates-form.component.js +40 -43
- package/dist/lib/custom/Templates/templates-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.js +2 -2
- package/dist/lib/custom/Tests/entity-link-pill.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.js +2 -2
- package/dist/lib/custom/Tests/test-rubric-form.component.js +2 -2
- package/dist/lib/custom/Tests/test-rubric-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.js +2 -2
- package/dist/lib/custom/Tests/test-run-feedback-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.js +2 -2
- package/dist/lib/custom/Tests/test-suite-form.component.js +2 -2
- package/dist/lib/custom/Tests/test-suite-run-form.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js +2 -2
- package/dist/lib/custom/ai-agent-run/ai-agent-run-visualization.component.d.ts +1 -0
- package/dist/lib/custom/ai-agent-run/ai-agent-run-visualization.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-visualization.component.js +28 -18
- package/dist/lib/custom/ai-agent-run/ai-agent-run-visualization.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +2 -2
- package/dist/lib/custom/custom-forms.module.d.ts +2 -1
- package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
- package/dist/lib/custom/custom-forms.module.js +7 -3
- package/dist/lib/custom/custom-forms.module.js.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.js +2 -2
- package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.js +155 -153
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentCategory/mjaiagentcategory.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJAIAgentCategory/mjaiagentcategory.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentCategory/mjaiagentcategory.form.component.js +105 -0
- package/dist/lib/generated/Entities/MJAIAgentCategory/mjaiagentcategory.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentRequest/mjaiagentrequest.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRequest/mjaiagentrequest.form.component.js +31 -7
- package/dist/lib/generated/Entities/MJAIAgentRequest/mjaiagentrequest.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRequestType/mjaiagentrequesttype.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJAIAgentRequestType/mjaiagentrequesttype.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentRequestType/mjaiagentrequesttype.form.component.js +89 -0
- package/dist/lib/generated/Entities/MJAIAgentRequestType/mjaiagentrequesttype.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js +50 -14
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRunStep/mjaiagentrunstep.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRunStep/mjaiagentrunstep.form.component.js +22 -4
- package/dist/lib/generated/Entities/MJAIAgentRunStep/mjaiagentrunstep.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentType/mjaiagenttype.form.component.js +13 -11
- package/dist/lib/generated/Entities/MJAIAgentType/mjaiagenttype.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAction/mjaction.form.component.js +83 -81
- package/dist/lib/generated/Entities/MJAction/mjaction.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJIntegration/mjintegration.form.component.js +35 -33
- package/dist/lib/generated/Entities/MJIntegration/mjintegration.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.js +25 -19
- package/dist/lib/generated/Entities/MJIntegrationObject/mjintegrationobject.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +289 -287
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +102 -96
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/shared/components/template-editor.component.js +85 -89
- package/dist/lib/shared/components/template-editor.component.js.map +1 -1
- package/package.json +31 -31
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"template-editor.component.js","sourceRoot":"","sources":["../../../../src/lib/shared/components/template-editor.component.ts","../../../../src/lib/shared/components/template-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAA+C,SAAS,EAAiB,MAAM,eAAe,CAAC;AAE9I,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAqB,6BAA6B,EAA6B,MAAM,8BAA8B,CAAC;;;;;;;;;;;;ICWpI,wBAAE;IAAA,gCAA8B;IAAA,wBAAQ;IAAA,iBAAO;;;;IAKnD,kCAMsC;IALpC,8PAAS,0CAAwB,wBAAE,wBAAwB,KAAC;IAM5D,wBAAuC;IACzC,iBAAS;;;;IA1Bb,8BAK8F;IAH5F,yOAAS,2CAAyB,KAAK,CAAC,KAAC;IAKvC,AADF,+BAAsB,cAC8C;IAChE,YACF;IAAA,iBAAM;IACN,+BAA+C;IAC7C,YACA;IAAA,iHAAyB;IAI7B,AADE,iBAAM,EACF;IACN,+HAAuD;IAWzD,iBAAM;;;;;IAvBJ,AADA,+HAA6F,+GACF;IAJ3F,oGAAkE;IAO9D,eACF;IADE,mFACF;IAEE,eACA;IADA,sDACA;IAAA,cAEC;IAFD,+CAEC;IAGL,cAUC;IAVD,wFAUC;;;IAIH,8BAC+I;IAC7I,wBAA6C;IAC7C,gCAAmE;IAAA,mBAAG;IACxE,AADwE,iBAAO,EACzE;;;;IAIN,+BAKmC;IAJjC,qNAAS,8BAAuB,KAAC;IAKjC,wBAA2E;IAC3E,gCAAmE;IAAA,mBAAG;IACxE,AADwE,iBAAO,EACzE;;;IAjDV,AADF,8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AC;gBACF,OAAO;YACX,CAAC;QACL,CAAC;QAED,8BAA8B;QAC9B,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IACzC,CAAC;IAED,+BAA+B;QAC3B,yDAAyD;QACzD,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACzE,CAAC;wHA/dQ,uBAAuB;oEAAvB,uBAAuB;;;;;;YCvBpC,yFAAgB;;YAAhB,uCAqVC;;;iFD9TY,uBAAuB;cANnC,SAAS;6BACI,KAAK,YACL,oBAAoB;;kBAK7B,KAAK;;kBACL,KAAK;;kBAML,MAAM;;kBACN,MAAM;;kBAmBN,SAAS;mBAAC,YAAY;;kFA5Bd,uBAAuB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, ViewChild, AfterViewInit } from '@angular/core';\nimport { MJTemplateEntity, MJTemplateContentEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { TemplateEngineBase } from '@memberjunction/templates-base-types';\nimport { LanguageDescription } from '@codemirror/language';\nimport { languages } from '@codemirror/language-data';\nimport { CodeEditorComponent } from '@memberjunction/ng-code-editor';\nimport { Subject } from 'rxjs';\nimport { DEFAULT_SYSTEM_PLACEHOLDERS, SystemPlaceholder, SYSTEM_PLACEHOLDER_CATEGORIES, SystemPlaceholderCategory } from '@memberjunction/ai-core-plus';\n\nexport interface TemplateEditorConfig {\n allowEdit?: boolean;\n showRunButton?: boolean;\n compactMode?: boolean;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-template-editor',\n templateUrl: './template-editor.component.html',\n styleUrls: ['./template-editor.component.css']\n})\nexport class TemplateEditorComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {\n @Input() template: MJTemplateEntity | null = null;\n @Input() config: TemplateEditorConfig = {\n allowEdit: true,\n showRunButton: false,\n compactMode: false\n };\n \n @Output() contentChange = new EventEmitter<MJTemplateContentEntity[]>();\n @Output() runTemplate = new EventEmitter<MJTemplateEntity>();\n \n public templateContents: MJTemplateContentEntity[] = [];\n public selectedContentIndex: number = 0;\n public isAddingNewContent: boolean = false;\n public newTemplateContent: MJTemplateContentEntity | null = null;\n public hasUnsavedChanges: boolean = false;\n public contentTypeOptions: Array<{text: string, value: string}> = [];\n public supportedLanguages: LanguageDescription[] = languages;\n public isRunningTemplate = false;\n public activeHelpTab: 'syntax' | 'placeholders' = 'syntax';\n public activePlaceholderCategory: string = '';\n \n // System placeholders organized by category\n public placeholderCategories: Array<{\n category: SystemPlaceholderCategory;\n placeholders: SystemPlaceholder[];\n }> = [];\n \n @ViewChild('codeEditor') codeEditor: CodeEditorComponent | null = null;\n private isUpdatingEditorValue = false;\n private destroy$ = new Subject<void>();\n private _metadata = new Metadata();\n private activeTimeouts: number[] = [];\n \n constructor(private notificationService: MJNotificationService) {}\n\n async ngOnInit() {\n this.loadContentTypes();\n this.organizePlaceholdersByCategory();\n if (this.template) {\n await this.loadTemplateContents();\n }\n }\n\n async ngOnChanges(changes: SimpleChanges) {\n if (changes['template']) {\n // Template input has changed, reload contents\n if (this.template) {\n await this.loadTemplateContents();\n } else {\n // Template cleared, reset state\n this.templateContents = [];\n this.selectedContentIndex = 0;\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n this.hasUnsavedChanges = false;\n }\n }\n }\n \n private organizePlaceholdersByCategory() {\n // Group placeholders by their category\n this.placeholderCategories = SYSTEM_PLACEHOLDER_CATEGORIES.map(category => {\n const categoryPlaceholders = DEFAULT_SYSTEM_PLACEHOLDERS.filter(\n placeholder => placeholder.category === category.name\n );\n \n return {\n category: category,\n placeholders: categoryPlaceholders\n };\n }).filter(cat => cat.placeholders.length > 0); // Only include categories that have placeholders\n \n // Add any uncategorized placeholders to a misc category if needed\n const categorized = DEFAULT_SYSTEM_PLACEHOLDERS.filter(p => p.category);\n const uncategorized = DEFAULT_SYSTEM_PLACEHOLDERS.filter(p => !p.category);\n \n if (uncategorized.length > 0) {\n this.placeholderCategories.push({\n category: {\n name: 'Other',\n icon: 'fa-ellipsis-h',\n color: '#6c757d'\n },\n placeholders: uncategorized\n });\n }\n \n // Set the first category as active\n if (this.placeholderCategories.length > 0) {\n this.activePlaceholderCategory = this.placeholderCategories[0].category.name;\n }\n }\n \n /**\n * Copies a placeholder to the clipboard\n */\n public async copyPlaceholder(placeholderName: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(`{{ ${placeholderName} }}`);\n this.notificationService.CreateSimpleNotification('Placeholder copied to clipboard!', 'success', 2000);\n } catch (error) {\n console.error('Failed to copy placeholder:', error);\n this.notificationService.CreateSimpleNotification('Failed to copy placeholder', 'error', 3000);\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n \n // Clean up any active timeouts\n this.activeTimeouts.forEach(timeoutId => clearTimeout(timeoutId));\n this.activeTimeouts.length = 0;\n }\n\n ngAfterViewInit() {\n // Initial sync when view is ready\n this.syncEditorValue();\n }\n\n async loadTemplateContents() {\n if (this.template) {\n // Reset state first\n this.templateContents = [];\n this.selectedContentIndex = 0;\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n this.hasUnsavedChanges = false;\n \n if (this.template.IsSaved && this.template.ID) {\n // Load existing template contents for saved templates\n try {\n const rv = new RunView();\n const results = await rv.RunView<MJTemplateContentEntity>({\n EntityName: 'MJ: Template Contents',\n ExtraFilter: `TemplateID='${this.template.ID}'`,\n OrderBy: 'Priority ASC, __mj_CreatedAt ASC',\n ResultType: 'entity_object'\n });\n \n this.templateContents = results.Results;\n } catch (error) {\n console.error('Error loading template contents:', error);\n }\n }\n \n // If we have contents but no selection, select the first one\n if (this.templateContents.length > 0) {\n this.selectedContentIndex = 0;\n }\n \n // If no template contents exist (either new template or saved template with no content), \n // create a default one for single-content optimization\n if (this.templateContents.length === 0) {\n await this.createDefaultTemplateContent();\n }\n\n // Sync editor value after loading content\n this.syncEditorValue();\n this.contentChange.emit(this.templateContents);\n }\n }\n\n /**\n * Public method to refresh the template editor and discard unsaved changes\n * This should be called when canceling edits to restore the original state\n */\n public async refreshAndDiscardChanges() {\n await this.loadTemplateContents();\n }\n\n async createDefaultTemplateContent() {\n const defaultContent = await this._metadata.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n defaultContent.TemplateID = this.template!.ID;\n defaultContent.Priority = 1;\n defaultContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.contentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n defaultContent.TypeID = validContentTypes[0].value;\n }\n \n this.templateContents = [defaultContent];\n this.selectedContentIndex = 0;\n \n // Sync editor value after creating default content\n this.syncEditorValue();\n }\n\n selectTemplateContent(index: number, confirmSwitch: boolean = true) {\n // If we're adding new content and user clicks on existing content, ask for confirmation\n if (this.isAddingNewContent && confirmSwitch) {\n if (!confirm('You have unsaved changes to a new content version. Are you sure you want to switch? Your changes will be lost.')) {\n return;\n }\n }\n \n if (index >= 0 && index < this.templateContents.length) {\n this.selectedContentIndex = index;\n this.isAddingNewContent = false;\n // Don't clear newTemplateContent to preserve the work in progress\n \n // Sync editor value when switching content\n this.syncEditorValue();\n }\n }\n\n loadContentTypes() {\n try {\n // Get content types from TemplateEngine cache\n const contentTypes = TemplateEngineBase.Instance.TemplateContentTypes;\n this.contentTypeOptions = [\n { text: 'Select Type...', value: '' },\n ...contentTypes.map(ct => ({\n text: ct.Name,\n value: ct.ID\n }))\n ];\n } catch (error) {\n console.error('Error loading content types:', error);\n // Fallback to basic types\n this.contentTypeOptions = [\n { text: 'Select Type...', value: '' },\n { text: 'HTML', value: 'HTML' },\n { text: 'Plain Text', value: 'Text' },\n { text: 'Markdown', value: 'Markdown' }\n ];\n }\n }\n\n async addNewTemplateContent() {\n if (!this.config.allowEdit) return;\n \n this.newTemplateContent = await this._metadata.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n this.newTemplateContent.TemplateID = this.template!.ID;\n this.newTemplateContent.Priority = this.templateContents.length + 1;\n this.newTemplateContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.contentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n this.newTemplateContent.TypeID = validContentTypes[0].value;\n }\n this.newTemplateContent.TemplateText = '';\n \n // Add immediately to the array\n this.templateContents.push(this.newTemplateContent);\n this.selectedContentIndex = this.templateContents.length - 1;\n this.isAddingNewContent = true;\n \n // Sync editor value when adding new content\n this.syncEditorValue();\n }\n\n async deleteTemplateContent(index: number) {\n if (!this.config.allowEdit || index < 0 || index >= this.templateContents.length) return;\n \n const contentToDelete = this.templateContents[index];\n \n // Check if the entity is actually saved, not just if it has an ID\n if (contentToDelete.IsSaved) {\n try {\n const result = await contentToDelete.Delete();\n if (result) {\n this.templateContents.splice(index, 1);\n \n // Adjust selected index if necessary\n if (this.selectedContentIndex >= this.templateContents.length) {\n this.selectedContentIndex = Math.max(0, this.templateContents.length - 1);\n }\n \n // If no contents remain, create a default one\n if (this.templateContents.length === 0) {\n await this.createDefaultTemplateContent();\n }\n \n this.contentChange.emit(this.templateContents);\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(`Failed to delete template content. ${contentToDelete.LatestResult?.Message}`, 'error');\n }\n } catch (error) {\n console.error('Error deleting template content:', error);\n MJNotificationService.Instance.CreateSimpleNotification(`Error deleting template content: ${error}`, 'error');\n }\n } else {\n // Not saved yet, just remove from array\n this.templateContents.splice(index, 1);\n if (this.selectedContentIndex >= this.templateContents.length) {\n this.selectedContentIndex = Math.max(0, this.templateContents.length - 1);\n }\n \n // Reset adding new content state if we're deleting the new content\n if (this.isAddingNewContent && index === this.templateContents.length) {\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n }\n \n this.contentChange.emit(this.templateContents);\n }\n }\n\n get currentTemplateContent(): MJTemplateContentEntity | null {\n if (this.isAddingNewContent) {\n return this.newTemplateContent;\n }\n return this.templateContents[this.selectedContentIndex] || null;\n }\n\n get hasMultipleContents(): boolean {\n return this.templateContents.length > 1 || this.isAddingNewContent;\n }\n\n onContentTypeChange() {\n // Content type changes just modify the current content, no new record creation\n this.updateUnsavedChangesFlag();\n }\n\n onContentChange() {\n this.updateUnsavedChangesFlag();\n }\n\n /**\n * Updates the hasUnsavedChanges flag based on entity dirty states\n */\n private updateUnsavedChangesFlag() {\n this.hasUnsavedChanges = this.templateContents.some(content => content.Dirty) || \n this.isAddingNewContent;\n }\n\n onTemplateTextChange(event: any) {\n if (this.isUpdatingEditorValue) {\n // Ignore change events when we're programmatically updating the editor\n return;\n }\n \n if (this.currentTemplateContent) {\n // Extract value from event - might be event.target.value or just event depending on component\n const value = typeof event === 'string' ? event : (event.target?.value || event);\n this.currentTemplateContent.TemplateText = value;\n this.updateUnsavedChangesFlag();\n }\n }\n\n /**\n * Helper method to track setTimeout calls for cleanup\n */\n private setTrackedTimeout(callback: () => void, delay: number): number {\n const timeoutId = setTimeout(() => {\n // Remove from tracking when it executes\n const index = this.activeTimeouts.indexOf(timeoutId);\n if (index > -1) {\n this.activeTimeouts.splice(index, 1);\n }\n callback();\n }, delay) as any as number;\n this.activeTimeouts.push(timeoutId);\n return timeoutId;\n }\n\n /**\n * Manually sync the editor value without triggering change events\n */\n private syncEditorValue() {\n // Use Promise.resolve() to wait for the next microtask after any pending changes\n Promise.resolve().then(() => {\n // Then tracked setTimeout for the next macrotask to ensure DOM is updated\n this.setTrackedTimeout(() => {\n if (!this.codeEditor) {\n return;\n }\n \n this.isUpdatingEditorValue = true;\n const newValue = this.currentTemplateContent?.TemplateText || '';\n \n // Use the setValue method from mj-code-editor component\n this.codeEditor.setValue(newValue); \n this.isUpdatingEditorValue = false;\n }, 0);\n });\n }\n\n async saveTemplateContents(): Promise<boolean> {\n if (!this.config.allowEdit) return false;\n \n try {\n // Save all template contents that have changes\n for (const content of this.templateContents) {\n content.TemplateID = this.template!.ID; // Ensure FK is set\n if (content.Dirty || !content.ID) {\n const contentResult = await content.Save();\n if (!contentResult) {\n console.error('Failed to save template content:', content);\n return false;\n }\n }\n }\n\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n this.updateUnsavedChangesFlag();\n this.contentChange.emit(this.templateContents);\n return true;\n } catch (error) {\n console.error('Error saving template contents:', error);\n return false;\n }\n }\n\n getContentTypeDisplayText(typeId: string): string {\n if (!typeId) return '-';\n const option = this.contentTypeOptions.find(opt => opt.value === typeId);\n return option ? option.text : typeId;\n }\n\n getEditorLanguage(): string {\n if (!this.currentTemplateContent?.TypeID) {\n return 'jinja2'; // default to jinja2 for template syntax (compatible with Nunjucks)\n }\n\n const contentType = this.currentTemplateContent.TypeID.toLowerCase();\n \n // Map content types to CodeMirror language modes\n switch (contentType) {\n case 'html':\n return 'jinja2'; // Use jinja2 for HTML templates to get template syntax highlighting\n case 'markdown':\n case 'md':\n return 'markdown';\n case 'javascript':\n case 'js':\n return 'javascript';\n case 'css':\n return 'css';\n case 'json':\n return 'json';\n case 'xml':\n return 'xml';\n case 'sql':\n return 'sql';\n case 'text':\n case 'plain':\n default:\n return 'jinja2'; // Default to jinja2 since templates often contain template syntax\n }\n }\n\n /**\n * Test run the current template using the parameter dialog\n */\n async onRunTemplate() {\n if (!this.template?.IsSaved || !this.currentTemplateContent) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please save the template before running it.', \n 'warning'\n );\n return;\n }\n\n // Save any unsaved changes first\n if (this.hasUnsavedChanges) {\n const saveResult = await this.saveTemplateContents();\n if (!saveResult) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to save template changes.', \n 'error'\n );\n return;\n }\n }\n\n // Emit the run template event\n this.runTemplate.emit(this.template);\n }\n\n getContentTypeOptionsForContent(): Array<{text: string, value: string}> {\n // Always exclude \"Select Type...\" option for all content\n return this.contentTypeOptions.filter(option => option.value !== '');\n }\n}","@if (template) {\n <div class=\"template-editor\" style=\"height: 100%; display: flex; flex-direction: column;\">\n <!-- Content Versions List/Tabs -->\n @if (templateContents.length > 0) {\n <div class=\"content-versions-tabs\" style=\"margin-bottom: 16px; border-bottom: 2px solid #e0e0e0; padding-bottom: 8px;\">\n <div class=\"content-tabs\" style=\"display: flex; gap: 6px; flex-wrap: wrap;\">\n @for (content of templateContents; track content.ID || $index; let i = $index) {\n <div class=\"content-version-tab\"\n [class.active]=\"selectedContentIndex === i && !isAddingNewContent\"\n (click)=\"selectTemplateContent(i, false)\"\n style=\"padding: 8px 12px; border: 1px solid #ccc; border-radius: 6px; cursor: pointer; background: #fff; display: flex; align-items: center; gap: 6px; transition: all 0.2s; position: relative;\"\n [style.border-color]=\"selectedContentIndex === i && !isAddingNewContent ? '#007bff' : '#ccc'\"\n [style.background]=\"selectedContentIndex === i && !isAddingNewContent ? '#e3f2fd' : '#fff'\">\n <div style=\"flex: 1;\">\n <div style=\"font-weight: 600; font-size: 0.85em; color: #495057;\">\n {{ content.Type || 'Version ' + (i + 1) }}\n </div>\n <div style=\"font-size: 0.7em; color: #6c757d;\">\n P:{{ content.Priority }}\n @if (!content.IsActive) {\n • <span style=\"color: #dc3545;\">Inactive</span>\n }\n </div>\n </div>\n @if (templateContents.length > 1 && config.allowEdit) {\n <button type=\"button\"\n (click)=\"deleteTemplateContent(i); $event.stopPropagation()\"\n class=\"btn-sm delete-btn\"\n style=\"background: none; border: none; color: #dc3545; padding: 4px; border-radius: 3px; transition: all 0.2s; cursor: pointer;\"\n onmouseover=\"this.style.backgroundColor='#dc3545'; this.style.color='white';\"\n onmouseout=\"this.style.backgroundColor='transparent'; this.style.color='#dc3545';\"\n title=\"Delete this content version\">\n <i class=\"fa-solid fa-trash fa-xs\"></i>\n </button>\n }\n </div>\n }\n @if (isAddingNewContent) {\n <div class=\"content-version-tab active\"\n style=\"padding: 8px 12px; border: 1px solid #28a745; border-radius: 6px; background: #d4edda; display: flex; align-items: center; gap: 6px;\">\n <i class=\"fa-solid fa-plus text-success\"></i>\n <span style=\"font-weight: 600; color: #155724; font-size: 0.85em;\">New</span>\n </div>\n }\n <!-- Add New Content (Edit Mode Only) -->\n @if (config.allowEdit && !isAddingNewContent) {\n <div class=\"content-version-tab add-new\"\n (click)=\"addNewTemplateContent()\"\n style=\"padding: 8px 12px; border: 1px dashed #28a745; border-radius: 6px; background: #f8f9fa; display: flex; align-items: center; gap: 6px; cursor: pointer; transition: all 0.2s;\"\n onmouseover=\"this.style.backgroundColor='#e8f5e9'; this.style.borderStyle='solid';\"\n onmouseout=\"this.style.backgroundColor='#f8f9fa'; this.style.borderStyle='dashed';\"\n title=\"Add new template content\">\n <i class=\"fa-solid fa-plus\" style=\"color: #28a745; font-size: 0.75em;\"></i>\n <span style=\"font-weight: 500; color: #28a745; font-size: 0.85em;\">New</span>\n </div>\n }\n </div>\n </div>\n }\n <!-- Content Editor -->\n @if (currentTemplateContent) {\n <div class=\"content-editor-container\" style=\"flex: 1; display: flex; flex-direction: column; background: #fff; border: 1px solid #dee2e6; border-radius: 8px; overflow: hidden;\">\n <!-- Content Metadata Bar -->\n <div class=\"content-metadata-bar\" style=\"background: #f8f9fa; border-bottom: 1px solid #dee2e6; padding: 16px 20px;\">\n <div style=\"display: grid; grid-template-columns: 2fr 1fr 1fr auto; gap: 20px; align-items: end;\">\n <div class=\"form-group\" style=\"margin: 0;\">\n <label for=\"contentType\" class=\"form-label\" style=\"margin-bottom: 4px; font-size: 0.9em; font-weight: 600;\">\n <i class=\"fa-solid fa-tag\"></i> Content Type\n </label>\n @if (config.allowEdit) {\n <kendo-dropdownlist [(ngModel)]=\"currentTemplateContent.TypeID\"\n name=\"contentType\"\n [data]=\"getContentTypeOptionsForContent()\"\n textField=\"text\"\n valueField=\"value\"\n [valuePrimitive]=\"true\"\n (valueChange)=\"onContentTypeChange()\">\n </kendo-dropdownlist>\n } @else {\n <div class=\"form-control-plaintext\" style=\"font-size: 0.9em; padding: 4px 0;\">\n {{ getContentTypeDisplayText(currentTemplateContent.TypeID) }}\n </div>\n }\n </div>\n <div class=\"form-group\" style=\"margin: 0;\">\n <label for=\"priority\" class=\"form-label\" style=\"margin-bottom: 4px; font-size: 0.9em; font-weight: 600;\">\n <i class=\"fa-solid fa-sort-numeric-up\"></i> Priority\n </label>\n @if (config.allowEdit) {\n <kendo-numerictextbox [(ngModel)]=\"currentTemplateContent.Priority\"\n name=\"priority\"\n [min]=\"1\"\n [step]=\"1\"\n [format]=\"'n0'\">\n </kendo-numerictextbox>\n } @else {\n <div class=\"form-control-plaintext\" style=\"font-size: 0.9em; padding: 4px 0;\">\n {{ currentTemplateContent.Priority || '-' }}\n </div>\n }\n </div>\n <div class=\"form-group\" style=\"margin: 0;\">\n <label class=\"form-label\" style=\"margin-bottom: 4px; font-size: 0.9em; font-weight: 600;\">\n <i class=\"fa-solid fa-toggle-on\"></i> Status\n </label>\n @if (config.allowEdit) {\n <div class=\"form-check\" style=\"margin-top: 8px;\">\n <input type=\"checkbox\"\n id=\"isActive\"\n class=\"form-check-input\"\n [(ngModel)]=\"currentTemplateContent.IsActive\"\n name=\"isActive\">\n <label class=\"form-check-label\" for=\"isActive\" style=\"font-size: 0.9em;\">\n Active\n </label>\n </div>\n } @else {\n <div class=\"form-control-plaintext\" style=\"font-size: 0.9em; padding: 4px 0;\">\n @if (currentTemplateContent.IsActive) {\n <span class=\"badge badge-success\" style=\"background: #28a745; color: white; padding: 3px 8px; border-radius: 3px; font-size: 0.75em;\">\n <i class=\"fa-solid fa-check-circle\"></i> Active\n </span>\n } @else {\n <span class=\"badge badge-secondary\" style=\"background: #6c757d; color: white; padding: 3px 8px; border-radius: 3px; font-size: 0.75em;\">\n <i class=\"fa-solid fa-pause-circle\"></i> Inactive\n </span>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <!-- Content Text Editor -->\n <div class=\"content-text-editor\" style=\"flex: 1; padding: 20px; display: flex; flex-direction: column;\">\n <div style=\"display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px;\">\n <label for=\"templateContent\" class=\"form-label\" style=\"margin: 0; font-weight: 600; display: flex; align-items: center; gap: 8px;\">\n <i class=\"fa-solid fa-code\"></i> Template Content\n <span class=\"badge\" style=\"padding: 4px 8px; border-radius: 4px; font-size: 0.75em;\"\n [style.background]=\"!currentTemplateContent.ID ? '#28a745' : '#6c757d'\"\n [style.color]=\"'white'\">\n @if (!currentTemplateContent.ID) {\n New\n } @else {\n {{ getContentTypeDisplayText(currentTemplateContent.TypeID) }}\n }\n </span>\n </label>\n <div style=\"display: flex; align-items: center; gap: 12px;\">\n @if (!isAddingNewContent && hasUnsavedChanges) {\n <span class=\"unsaved-indicator\" style=\"color: #fd7e14; font-size: 0.85em; display: flex; align-items: center; gap: 4px;\">\n <i class=\"fa-solid fa-circle\" style=\"font-size: 0.5em;\"></i>\n Unsaved changes\n </span>\n }\n @if (template.IsSaved && currentTemplateContent && config.showRunButton) {\n <button type=\"button\"\n class=\"btn btn-sm\"\n [disabled]=\"isRunningTemplate\"\n (click)=\"onRunTemplate()\"\n style=\"background: #17a2b8; color: white; border: none; padding: 6px 12px; border-radius: 4px; font-size: 0.85em; display: flex; align-items: center; gap: 6px; transition: all 0.2s;\"\n onmouseover=\"this.style.background='#138496'\"\n onmouseout=\"this.style.background='#17a2b8'\"\n title=\"Test run this template\">\n @if (isRunningTemplate) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n Running...\n } @else {\n <i class=\"fa-solid fa-play\"></i>\n Run\n }\n </button>\n }\n </div>\n </div>\n <mj-code-editor\n #codeEditor\n (change)=\"onTemplateTextChange($event)\"\n [readonly]=\"!config.allowEdit\"\n [language]=\"getEditorLanguage()\"\n [languages]=\"supportedLanguages\"\n style=\"flex: 1; height: 350px; border: 1px solid #ced4da; border-radius: 4px;\">\n </mj-code-editor>\n <!-- Template Help Section with Tabs -->\n @if (!config.compactMode) {\n <div class=\"template-help-section\" style=\"margin-top: 16px;\">\n <!-- Tab Navigation -->\n <div class=\"help-tabs\" style=\"display: flex; border-bottom: 2px solid #dee2e6; margin-bottom: 0;\">\n <button type=\"button\"\n class=\"help-tab\"\n [class.active]=\"activeHelpTab === 'syntax'\"\n (click)=\"activeHelpTab = 'syntax'\"\n style=\"padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 0.9em; font-weight: 600; color: #6c757d; border-bottom: 3px solid transparent; transition: all 0.2s;\"\n [style.color]=\"activeHelpTab === 'syntax' ? '#28a745' : '#6c757d'\"\n [style.border-bottom-color]=\"activeHelpTab === 'syntax' ? '#28a745' : 'transparent'\">\n <i class=\"fa-solid fa-code\"></i> Template Syntax\n </button>\n <button type=\"button\"\n class=\"help-tab\"\n [class.active]=\"activeHelpTab === 'placeholders'\"\n (click)=\"activeHelpTab = 'placeholders'\"\n style=\"padding: 8px 16px; border: none; background: none; cursor: pointer; font-size: 0.9em; font-weight: 600; color: #6c757d; border-bottom: 3px solid transparent; transition: all 0.2s;\"\n [style.color]=\"activeHelpTab === 'placeholders' ? '#28a745' : '#6c757d'\"\n [style.border-bottom-color]=\"activeHelpTab === 'placeholders' ? '#28a745' : 'transparent'\">\n <i class=\"fa-solid fa-at\"></i> System Placeholders\n </button>\n </div>\n <!-- Tab Content -->\n <div class=\"help-content\" style=\"padding: 16px; background: #f8f9fa; border: 1px solid #dee2e6; border-top: none; border-radius: 0 0 4px 4px;\">\n <!-- Template Syntax Tab -->\n @if (activeHelpTab === 'syntax') {\n <div class=\"syntax-help\" style=\"font-size: 0.85em;\">\n <div style=\"font-weight: 600; margin-bottom: 12px; color: #155724;\">\n <i class=\"fa-solid fa-lightbulb\"></i> Template Syntax Quick Reference\n </div>\n <div style=\"display: grid; grid-template-columns: 1fr 1fr; gap: 16px;\">\n <div>\n <div style=\"margin-bottom: 8px;\">\n <strong>Parameters:</strong><br>\n <code style=\"background: #fff; padding: 4px 6px; border-radius: 3px; display: inline-block; margin-top: 4px;\">{{'{{'}} paramName {{'}}'}}</code>\n </div>\n <div>\n <strong>Template Includes:</strong><br>\n <code style=\"background: #fff; padding: 4px 6px; border-radius: 3px; display: inline-block; margin-top: 4px;\">{{'{% template \"TemplateName\" %}'}}</code>\n </div>\n </div>\n <div>\n <div style=\"margin-bottom: 8px;\">\n <strong>Conditionals:</strong><br>\n <code style=\"background: #fff; padding: 4px 6px; border-radius: 3px; display: inline-block; margin-top: 4px;\">{{'{% if condition %}'}} ... {{'{% endif %}'}}</code>\n </div>\n <div>\n <strong>Loops:</strong><br>\n <code style=\"background: #fff; padding: 4px 6px; border-radius: 3px; display: inline-block; margin-top: 4px;\">{{'{% for item in items %}'}} ... {{'{% endfor %}'}}</code>\n </div>\n </div>\n </div>\n </div>\n }\n <!-- System Placeholders Tab -->\n @if (activeHelpTab === 'placeholders') {\n <div class=\"placeholders-help\" style=\"font-size: 0.85em;\">\n <div style=\"font-weight: 600; margin-bottom: 12px; color: #155724;\">\n <i class=\"fa-solid fa-at\"></i> System Placeholders Reference\n </div>\n <p style=\"margin-bottom: 16px; color: #495057; line-height: 1.5;\">\n System placeholders are automatically available in all AI prompt templates. Simply use them in your template text and they will be replaced with their current values at execution time.\n </p>\n <!-- Category Sub-tabs -->\n <div class=\"category-tabs\" style=\"display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap;\">\n @for (categoryGroup of placeholderCategories; track categoryGroup.category.name) {\n <button type=\"button\"\n class=\"category-tab\"\n [class.active]=\"activePlaceholderCategory === categoryGroup.category.name\"\n (click)=\"activePlaceholderCategory = categoryGroup.category.name\"\n style=\"padding: 6px 14px; border: 1px solid #dee2e6; background: white; border-radius: 20px; cursor: pointer; font-size: 0.85em; font-weight: 500; display: flex; align-items: center; gap: 6px; transition: all 0.2s; position: relative;\"\n [style.border-color]=\"activePlaceholderCategory === categoryGroup.category.name ? categoryGroup.category.color : '#dee2e6'\"\n [style.background]=\"activePlaceholderCategory === categoryGroup.category.name ? categoryGroup.category.color + '10' : 'white'\"\n [style.color]=\"activePlaceholderCategory === categoryGroup.category.name ? categoryGroup.category.color : '#6c757d'\">\n <i [class]=\"'fa-solid ' + categoryGroup.category.icon\" style=\"font-size: 0.9em;\"></i>\n {{ categoryGroup.category.name }}\n <span class=\"badge\"\n style=\"background: rgba(0,0,0,0.1); color: inherit; padding: 2px 6px; border-radius: 10px; font-size: 0.75em; margin-left: 4px;\">\n {{ categoryGroup.placeholders.length }}\n </span>\n </button>\n }\n </div>\n <!-- Active Category Content -->\n <div class=\"placeholder-content\" style=\"background: white; border: 1px solid #dee2e6; border-radius: 8px; padding: 16px;\">\n @for (categoryGroup of placeholderCategories; track categoryGroup.category.name) {\n @if (activePlaceholderCategory === categoryGroup.category.name) {\n <div class=\"category-header\" style=\"display: flex; align-items: center; gap: 8px; margin-bottom: 16px;\">\n <i [class]=\"'fa-solid ' + categoryGroup.category.icon\"\n [style.color]=\"categoryGroup.category.color\"\n style=\"font-size: 1.2em;\"></i>\n <h5 style=\"margin: 0; color: #343a40; font-weight: 600;\">{{ categoryGroup.category.name }}</h5>\n </div>\n <div style=\"display: grid; gap: 10px;\">\n @for (placeholder of categoryGroup.placeholders; track placeholder.name) {\n <div class=\"placeholder-item\"\n style=\"padding: 12px 16px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; position: relative; transition: all 0.2s; max-width: 800px;\"\n onmouseover=\"this.style.borderColor='#007bff'; this.style.background='#f0f8ff'; this.querySelector('.copy-btn').style.opacity='1';\"\n onmouseout=\"this.style.borderColor='#e9ecef'; this.style.background='#f8f9fa'; this.querySelector('.copy-btn').style.opacity='0';\">\n <div style=\"display: flex; align-items: flex-start; gap: 8px;\">\n <div>\n <div style=\"display: inline-flex; align-items: center; gap: 8px;\">\n <code style=\"color: #e83e8c; font-weight: 600; font-size: 0.95em;\">{{'{{'}} {{ placeholder.name }} {{'}}'}}</code>\n <button type=\"button\"\n class=\"copy-btn\"\n (click)=\"copyPlaceholder(placeholder.name)\"\n style=\"opacity: 0; transition: opacity 0.2s; background: none; border: none; padding: 4px 8px; cursor: pointer; color: #007bff; border-radius: 4px; display: inline-flex; align-items: center;\"\n onmouseover=\"this.style.background='#e7f3ff';\"\n onmouseout=\"this.style.background='none';\"\n title=\"Copy placeholder to clipboard\">\n <i class=\"fa-solid fa-copy\" style=\"font-size: 0.85em;\"></i>\n </button>\n </div>\n @if (placeholder.description) {\n <div style=\"color: #6c757d; margin-top: 4px; line-height: 1.4;\">{{ placeholder.description }}</div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n </div>\n <!-- Usage Example -->\n <div style=\"margin-top: 20px; padding: 12px; background: #e3f2fd; border-radius: 6px; border: 1px solid #bbdefb;\">\n <div style=\"display: flex; align-items: flex-start; gap: 8px;\">\n <i class=\"fa-solid fa-info-circle\" style=\"color: #1976d2; margin-top: 2px;\"></i>\n <div style=\"flex: 1; font-size: 0.85em; color: #1565c0; line-height: 1.5;\">\n <strong>Usage Example:</strong> To use a system placeholder in your template, simply include it in double curly braces.\n For example: <code style=\"background: white; padding: 2px 4px; border-radius: 3px;\">\"Today is {{'{{'}} _CURRENT_DATE {{'}}'}} and the current user is {{'{{'}} _USER_NAME {{'}}'}}\"</code>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n } @else {\n <!-- No Content State -->\n <div class=\"no-content-state\" style=\"flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #f8f9fa; border: 2px dashed #dee2e6; border-radius: 8px; padding: 40px; text-align: center;\">\n <i class=\"fa-solid fa-file-plus\" style=\"font-size: 48px; margin-bottom: 16px; color: #6c757d; opacity: 0.6;\"></i>\n <h5 style=\"color: #495057; margin-bottom: 8px;\">No Template Content</h5>\n <p style=\"color: #6c757d; margin-bottom: 20px;\">Create your first template content version to get started.</p>\n @if (config.allowEdit) {\n <button type=\"button\"\n (click)=\"addNewTemplateContent()\"\n class=\"btn btn-primary\">\n <i class=\"fa-solid fa-plus\"></i> Create First Content Version\n </button>\n }\n </div>\n }\n </div>\n}"]}
|
|
1
|
+
{"version":3,"file":"template-editor.component.js","sourceRoot":"","sources":["../../../../src/lib/shared/components/template-editor.component.ts","../../../../src/lib/shared/components/template-editor.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAA+C,SAAS,EAAiB,MAAM,eAAe,CAAC;AAE9I,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sCAAsC,CAAC;AAE1E,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAEtD,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAC/B,OAAO,EAAE,2BAA2B,EAAqB,6BAA6B,EAA6B,MAAM,8BAA8B,CAAC;;;;;;;;;;;;ICQpI,wBAAE;IAAA,gCAA6B;IAAA,wBAAQ;IAAA,iBAAO;;;;IAKlD,kCAGsC;IAFpC,8PAAS,0CAAwB,wBAAE,wBAAwB,KAAC;IAG5D,wBAAuC;IACzC,iBAAS;;;;IApBb,8BAE4C;IAA1C,yOAAS,2CAAyB,KAAK,CAAC,KAAC;IAEvC,AADF,+BAAsB,cACG;IACrB,YACF;IAAA,iBAAM;IACN,+BAAsB;IACpB,YACA;IAAA,iHAAyB;IAI7B,AADE,iBAAM,EACF;IACN,+HAAuD;IAQzD,iBAAM;;;;;IArBJ,oGAAkE;IAI9D,eACF;IADE,mFACF;IAEE,eACA;IADA,sDACA;IAAA,cAEC;IAFD,+CAEC;IAGL,cAOC;IAPD,wFAOC;;;IAIH,8BAA4C;IAC1C,wBAA6C;IAC7C,gCAAwB;IAAA,mBAAG;IAC7B,AAD6B,iBAAO,EAC9B;;;;IAIN,+BAEmC;IADjC,qNAAS,8BAAuB,KAAC;IAEjC,wBAAgC;IAChC,4BAAM;IAAA,mBAAG;IACX,AADW,iBAAO,EACZ;;;IAvCV,AADF,8BAAmC,aACP;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3B,yDAAyD;QACzD,OAAO,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,KAAK,KAAK,EAAE,CAAC,CAAC;IACzE,CAAC;wHA/dQ,uBAAuB;oEAAvB,uBAAuB;;;;;;YCvBpC,yFAAgB;;YAAhB,uCAsTC;;;iFD/RY,uBAAuB;cANnC,SAAS;6BACI,KAAK,YACL,oBAAoB;;kBAK7B,KAAK;;kBACL,KAAK;;kBAML,MAAM;;kBACN,MAAM;;kBAmBN,SAAS;mBAAC,YAAY;;kFA5Bd,uBAAuB","sourcesContent":["import { Component, Input, Output, EventEmitter, OnInit, OnDestroy, OnChanges, SimpleChanges, ViewChild, AfterViewInit } from '@angular/core';\nimport { MJTemplateEntity, MJTemplateContentEntity } from '@memberjunction/core-entities';\nimport { Metadata, RunView } from '@memberjunction/core';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { TemplateEngineBase } from '@memberjunction/templates-base-types';\nimport { LanguageDescription } from '@codemirror/language';\nimport { languages } from '@codemirror/language-data';\nimport { CodeEditorComponent } from '@memberjunction/ng-code-editor';\nimport { Subject } from 'rxjs';\nimport { DEFAULT_SYSTEM_PLACEHOLDERS, SystemPlaceholder, SYSTEM_PLACEHOLDER_CATEGORIES, SystemPlaceholderCategory } from '@memberjunction/ai-core-plus';\n\nexport interface TemplateEditorConfig {\n allowEdit?: boolean;\n showRunButton?: boolean;\n compactMode?: boolean;\n}\n\n@Component({\n standalone: false,\n selector: 'mj-template-editor',\n templateUrl: './template-editor.component.html',\n styleUrls: ['./template-editor.component.css']\n})\nexport class TemplateEditorComponent implements OnInit, OnChanges, OnDestroy, AfterViewInit {\n @Input() template: MJTemplateEntity | null = null;\n @Input() config: TemplateEditorConfig = {\n allowEdit: true,\n showRunButton: false,\n compactMode: false\n };\n \n @Output() contentChange = new EventEmitter<MJTemplateContentEntity[]>();\n @Output() runTemplate = new EventEmitter<MJTemplateEntity>();\n \n public templateContents: MJTemplateContentEntity[] = [];\n public selectedContentIndex: number = 0;\n public isAddingNewContent: boolean = false;\n public newTemplateContent: MJTemplateContentEntity | null = null;\n public hasUnsavedChanges: boolean = false;\n public contentTypeOptions: Array<{text: string, value: string}> = [];\n public supportedLanguages: LanguageDescription[] = languages;\n public isRunningTemplate = false;\n public activeHelpTab: 'syntax' | 'placeholders' = 'syntax';\n public activePlaceholderCategory: string = '';\n \n // System placeholders organized by category\n public placeholderCategories: Array<{\n category: SystemPlaceholderCategory;\n placeholders: SystemPlaceholder[];\n }> = [];\n \n @ViewChild('codeEditor') codeEditor: CodeEditorComponent | null = null;\n private isUpdatingEditorValue = false;\n private destroy$ = new Subject<void>();\n private _metadata = new Metadata();\n private activeTimeouts: number[] = [];\n \n constructor(private notificationService: MJNotificationService) {}\n\n async ngOnInit() {\n this.loadContentTypes();\n this.organizePlaceholdersByCategory();\n if (this.template) {\n await this.loadTemplateContents();\n }\n }\n\n async ngOnChanges(changes: SimpleChanges) {\n if (changes['template']) {\n // Template input has changed, reload contents\n if (this.template) {\n await this.loadTemplateContents();\n } else {\n // Template cleared, reset state\n this.templateContents = [];\n this.selectedContentIndex = 0;\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n this.hasUnsavedChanges = false;\n }\n }\n }\n \n private organizePlaceholdersByCategory() {\n // Group placeholders by their category\n this.placeholderCategories = SYSTEM_PLACEHOLDER_CATEGORIES.map(category => {\n const categoryPlaceholders = DEFAULT_SYSTEM_PLACEHOLDERS.filter(\n placeholder => placeholder.category === category.name\n );\n \n return {\n category: category,\n placeholders: categoryPlaceholders\n };\n }).filter(cat => cat.placeholders.length > 0); // Only include categories that have placeholders\n \n // Add any uncategorized placeholders to a misc category if needed\n const categorized = DEFAULT_SYSTEM_PLACEHOLDERS.filter(p => p.category);\n const uncategorized = DEFAULT_SYSTEM_PLACEHOLDERS.filter(p => !p.category);\n \n if (uncategorized.length > 0) {\n this.placeholderCategories.push({\n category: {\n name: 'Other',\n icon: 'fa-ellipsis-h',\n color: 'var(--mj-text-muted)'\n },\n placeholders: uncategorized\n });\n }\n \n // Set the first category as active\n if (this.placeholderCategories.length > 0) {\n this.activePlaceholderCategory = this.placeholderCategories[0].category.name;\n }\n }\n \n /**\n * Copies a placeholder to the clipboard\n */\n public async copyPlaceholder(placeholderName: string): Promise<void> {\n try {\n await navigator.clipboard.writeText(`{{ ${placeholderName} }}`);\n this.notificationService.CreateSimpleNotification('Placeholder copied to clipboard!', 'success', 2000);\n } catch (error) {\n console.error('Failed to copy placeholder:', error);\n this.notificationService.CreateSimpleNotification('Failed to copy placeholder', 'error', 3000);\n }\n }\n\n ngOnDestroy() {\n this.destroy$.next();\n this.destroy$.complete();\n \n // Clean up any active timeouts\n this.activeTimeouts.forEach(timeoutId => clearTimeout(timeoutId));\n this.activeTimeouts.length = 0;\n }\n\n ngAfterViewInit() {\n // Initial sync when view is ready\n this.syncEditorValue();\n }\n\n async loadTemplateContents() {\n if (this.template) {\n // Reset state first\n this.templateContents = [];\n this.selectedContentIndex = 0;\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n this.hasUnsavedChanges = false;\n \n if (this.template.IsSaved && this.template.ID) {\n // Load existing template contents for saved templates\n try {\n const rv = new RunView();\n const results = await rv.RunView<MJTemplateContentEntity>({\n EntityName: 'MJ: Template Contents',\n ExtraFilter: `TemplateID='${this.template.ID}'`,\n OrderBy: 'Priority ASC, __mj_CreatedAt ASC',\n ResultType: 'entity_object'\n });\n \n this.templateContents = results.Results;\n } catch (error) {\n console.error('Error loading template contents:', error);\n }\n }\n \n // If we have contents but no selection, select the first one\n if (this.templateContents.length > 0) {\n this.selectedContentIndex = 0;\n }\n \n // If no template contents exist (either new template or saved template with no content), \n // create a default one for single-content optimization\n if (this.templateContents.length === 0) {\n await this.createDefaultTemplateContent();\n }\n\n // Sync editor value after loading content\n this.syncEditorValue();\n this.contentChange.emit(this.templateContents);\n }\n }\n\n /**\n * Public method to refresh the template editor and discard unsaved changes\n * This should be called when canceling edits to restore the original state\n */\n public async refreshAndDiscardChanges() {\n await this.loadTemplateContents();\n }\n\n async createDefaultTemplateContent() {\n const defaultContent = await this._metadata.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n defaultContent.TemplateID = this.template!.ID;\n defaultContent.Priority = 1;\n defaultContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.contentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n defaultContent.TypeID = validContentTypes[0].value;\n }\n \n this.templateContents = [defaultContent];\n this.selectedContentIndex = 0;\n \n // Sync editor value after creating default content\n this.syncEditorValue();\n }\n\n selectTemplateContent(index: number, confirmSwitch: boolean = true) {\n // If we're adding new content and user clicks on existing content, ask for confirmation\n if (this.isAddingNewContent && confirmSwitch) {\n if (!confirm('You have unsaved changes to a new content version. Are you sure you want to switch? Your changes will be lost.')) {\n return;\n }\n }\n \n if (index >= 0 && index < this.templateContents.length) {\n this.selectedContentIndex = index;\n this.isAddingNewContent = false;\n // Don't clear newTemplateContent to preserve the work in progress\n \n // Sync editor value when switching content\n this.syncEditorValue();\n }\n }\n\n loadContentTypes() {\n try {\n // Get content types from TemplateEngine cache\n const contentTypes = TemplateEngineBase.Instance.TemplateContentTypes;\n this.contentTypeOptions = [\n { text: 'Select Type...', value: '' },\n ...contentTypes.map(ct => ({\n text: ct.Name,\n value: ct.ID\n }))\n ];\n } catch (error) {\n console.error('Error loading content types:', error);\n // Fallback to basic types\n this.contentTypeOptions = [\n { text: 'Select Type...', value: '' },\n { text: 'HTML', value: 'HTML' },\n { text: 'Plain Text', value: 'Text' },\n { text: 'Markdown', value: 'Markdown' }\n ];\n }\n }\n\n async addNewTemplateContent() {\n if (!this.config.allowEdit) return;\n \n this.newTemplateContent = await this._metadata.GetEntityObject<MJTemplateContentEntity>('MJ: Template Contents');\n this.newTemplateContent.TemplateID = this.template!.ID;\n this.newTemplateContent.Priority = this.templateContents.length + 1;\n this.newTemplateContent.IsActive = true;\n \n // Set default to first real content type (skip \"Select Type...\" if it exists)\n const validContentTypes = this.contentTypeOptions.filter(option => option.value !== '');\n if (validContentTypes.length > 0) {\n this.newTemplateContent.TypeID = validContentTypes[0].value;\n }\n this.newTemplateContent.TemplateText = '';\n \n // Add immediately to the array\n this.templateContents.push(this.newTemplateContent);\n this.selectedContentIndex = this.templateContents.length - 1;\n this.isAddingNewContent = true;\n \n // Sync editor value when adding new content\n this.syncEditorValue();\n }\n\n async deleteTemplateContent(index: number) {\n if (!this.config.allowEdit || index < 0 || index >= this.templateContents.length) return;\n \n const contentToDelete = this.templateContents[index];\n \n // Check if the entity is actually saved, not just if it has an ID\n if (contentToDelete.IsSaved) {\n try {\n const result = await contentToDelete.Delete();\n if (result) {\n this.templateContents.splice(index, 1);\n \n // Adjust selected index if necessary\n if (this.selectedContentIndex >= this.templateContents.length) {\n this.selectedContentIndex = Math.max(0, this.templateContents.length - 1);\n }\n \n // If no contents remain, create a default one\n if (this.templateContents.length === 0) {\n await this.createDefaultTemplateContent();\n }\n \n this.contentChange.emit(this.templateContents);\n } else {\n MJNotificationService.Instance.CreateSimpleNotification(`Failed to delete template content. ${contentToDelete.LatestResult?.Message}`, 'error');\n }\n } catch (error) {\n console.error('Error deleting template content:', error);\n MJNotificationService.Instance.CreateSimpleNotification(`Error deleting template content: ${error}`, 'error');\n }\n } else {\n // Not saved yet, just remove from array\n this.templateContents.splice(index, 1);\n if (this.selectedContentIndex >= this.templateContents.length) {\n this.selectedContentIndex = Math.max(0, this.templateContents.length - 1);\n }\n \n // Reset adding new content state if we're deleting the new content\n if (this.isAddingNewContent && index === this.templateContents.length) {\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n }\n \n this.contentChange.emit(this.templateContents);\n }\n }\n\n get currentTemplateContent(): MJTemplateContentEntity | null {\n if (this.isAddingNewContent) {\n return this.newTemplateContent;\n }\n return this.templateContents[this.selectedContentIndex] || null;\n }\n\n get hasMultipleContents(): boolean {\n return this.templateContents.length > 1 || this.isAddingNewContent;\n }\n\n onContentTypeChange() {\n // Content type changes just modify the current content, no new record creation\n this.updateUnsavedChangesFlag();\n }\n\n onContentChange() {\n this.updateUnsavedChangesFlag();\n }\n\n /**\n * Updates the hasUnsavedChanges flag based on entity dirty states\n */\n private updateUnsavedChangesFlag() {\n this.hasUnsavedChanges = this.templateContents.some(content => content.Dirty) || \n this.isAddingNewContent;\n }\n\n onTemplateTextChange(event: any) {\n if (this.isUpdatingEditorValue) {\n // Ignore change events when we're programmatically updating the editor\n return;\n }\n \n if (this.currentTemplateContent) {\n // Extract value from event - might be event.target.value or just event depending on component\n const value = typeof event === 'string' ? event : (event.target?.value || event);\n this.currentTemplateContent.TemplateText = value;\n this.updateUnsavedChangesFlag();\n }\n }\n\n /**\n * Helper method to track setTimeout calls for cleanup\n */\n private setTrackedTimeout(callback: () => void, delay: number): number {\n const timeoutId = setTimeout(() => {\n // Remove from tracking when it executes\n const index = this.activeTimeouts.indexOf(timeoutId);\n if (index > -1) {\n this.activeTimeouts.splice(index, 1);\n }\n callback();\n }, delay) as any as number;\n this.activeTimeouts.push(timeoutId);\n return timeoutId;\n }\n\n /**\n * Manually sync the editor value without triggering change events\n */\n private syncEditorValue() {\n // Use Promise.resolve() to wait for the next microtask after any pending changes\n Promise.resolve().then(() => {\n // Then tracked setTimeout for the next macrotask to ensure DOM is updated\n this.setTrackedTimeout(() => {\n if (!this.codeEditor) {\n return;\n }\n \n this.isUpdatingEditorValue = true;\n const newValue = this.currentTemplateContent?.TemplateText || '';\n \n // Use the setValue method from mj-code-editor component\n this.codeEditor.setValue(newValue); \n this.isUpdatingEditorValue = false;\n }, 0);\n });\n }\n\n async saveTemplateContents(): Promise<boolean> {\n if (!this.config.allowEdit) return false;\n \n try {\n // Save all template contents that have changes\n for (const content of this.templateContents) {\n content.TemplateID = this.template!.ID; // Ensure FK is set\n if (content.Dirty || !content.ID) {\n const contentResult = await content.Save();\n if (!contentResult) {\n console.error('Failed to save template content:', content);\n return false;\n }\n }\n }\n\n this.isAddingNewContent = false;\n this.newTemplateContent = null;\n this.updateUnsavedChangesFlag();\n this.contentChange.emit(this.templateContents);\n return true;\n } catch (error) {\n console.error('Error saving template contents:', error);\n return false;\n }\n }\n\n getContentTypeDisplayText(typeId: string): string {\n if (!typeId) return '-';\n const option = this.contentTypeOptions.find(opt => opt.value === typeId);\n return option ? option.text : typeId;\n }\n\n getEditorLanguage(): string {\n if (!this.currentTemplateContent?.TypeID) {\n return 'jinja2'; // default to jinja2 for template syntax (compatible with Nunjucks)\n }\n\n const contentType = this.currentTemplateContent.TypeID.toLowerCase();\n \n // Map content types to CodeMirror language modes\n switch (contentType) {\n case 'html':\n return 'jinja2'; // Use jinja2 for HTML templates to get template syntax highlighting\n case 'markdown':\n case 'md':\n return 'markdown';\n case 'javascript':\n case 'js':\n return 'javascript';\n case 'css':\n return 'css';\n case 'json':\n return 'json';\n case 'xml':\n return 'xml';\n case 'sql':\n return 'sql';\n case 'text':\n case 'plain':\n default:\n return 'jinja2'; // Default to jinja2 since templates often contain template syntax\n }\n }\n\n /**\n * Test run the current template using the parameter dialog\n */\n async onRunTemplate() {\n if (!this.template?.IsSaved || !this.currentTemplateContent) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Please save the template before running it.', \n 'warning'\n );\n return;\n }\n\n // Save any unsaved changes first\n if (this.hasUnsavedChanges) {\n const saveResult = await this.saveTemplateContents();\n if (!saveResult) {\n MJNotificationService.Instance.CreateSimpleNotification(\n 'Failed to save template changes.', \n 'error'\n );\n return;\n }\n }\n\n // Emit the run template event\n this.runTemplate.emit(this.template);\n }\n\n getContentTypeOptionsForContent(): Array<{text: string, value: string}> {\n // Always exclude \"Select Type...\" option for all content\n return this.contentTypeOptions.filter(option => option.value !== '');\n }\n}","@if (template) {\n <div class=\"template-editor\" style=\"height: 100%; display: flex; flex-direction: column;\">\n <!-- Content Versions List/Tabs -->\n @if (templateContents.length > 0) {\n <div class=\"content-versions-tabs\">\n <div class=\"content-tabs\">\n @for (content of templateContents; track content.ID || $index; let i = $index) {\n <div class=\"content-version-tab\"\n [class.active]=\"selectedContentIndex === i && !isAddingNewContent\"\n (click)=\"selectTemplateContent(i, false)\">\n <div style=\"flex: 1;\">\n <div class=\"tab-label\">\n {{ content.Type || 'Version ' + (i + 1) }}\n </div>\n <div class=\"tab-meta\">\n P:{{ content.Priority }}\n @if (!content.IsActive) {\n • <span class=\"inactive-label\">Inactive</span>\n }\n </div>\n </div>\n @if (templateContents.length > 1 && config.allowEdit) {\n <button type=\"button\"\n (click)=\"deleteTemplateContent(i); $event.stopPropagation()\"\n class=\"delete-btn\"\n title=\"Delete this content version\">\n <i class=\"fa-solid fa-trash fa-xs\"></i>\n </button>\n }\n </div>\n }\n @if (isAddingNewContent) {\n <div class=\"content-version-tab adding-new\">\n <i class=\"fa-solid fa-plus text-success\"></i>\n <span class=\"new-label\">New</span>\n </div>\n }\n <!-- Add New Content (Edit Mode Only) -->\n @if (config.allowEdit && !isAddingNewContent) {\n <div class=\"content-version-tab add-new\"\n (click)=\"addNewTemplateContent()\"\n title=\"Add new template content\">\n <i class=\"fa-solid fa-plus\"></i>\n <span>New</span>\n </div>\n }\n </div>\n </div>\n }\n <!-- Content Editor -->\n @if (currentTemplateContent) {\n <div class=\"content-editor-container\">\n <!-- Content Metadata Bar -->\n <div class=\"content-metadata-bar\">\n <div class=\"metadata-grid\">\n <div class=\"form-group\">\n <label for=\"contentType\" class=\"form-label\">\n <i class=\"fa-solid fa-tag\"></i> Content Type\n </label>\n @if (config.allowEdit) {\n <kendo-dropdownlist [(ngModel)]=\"currentTemplateContent.TypeID\"\n name=\"contentType\"\n [data]=\"getContentTypeOptionsForContent()\"\n textField=\"text\"\n valueField=\"value\"\n [valuePrimitive]=\"true\"\n (valueChange)=\"onContentTypeChange()\">\n </kendo-dropdownlist>\n } @else {\n <div class=\"form-control-plaintext\">\n {{ getContentTypeDisplayText(currentTemplateContent.TypeID) }}\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label for=\"priority\" class=\"form-label\">\n <i class=\"fa-solid fa-sort-numeric-up\"></i> Priority\n </label>\n @if (config.allowEdit) {\n <kendo-numerictextbox [(ngModel)]=\"currentTemplateContent.Priority\"\n name=\"priority\"\n [min]=\"1\"\n [step]=\"1\"\n [format]=\"'n0'\">\n </kendo-numerictextbox>\n } @else {\n <div class=\"form-control-plaintext\">\n {{ currentTemplateContent.Priority || '-' }}\n </div>\n }\n </div>\n <div class=\"form-group\">\n <label class=\"form-label\">\n <i class=\"fa-solid fa-toggle-on\"></i> Status\n </label>\n @if (config.allowEdit) {\n <div class=\"form-check\">\n <input type=\"checkbox\"\n id=\"isActive\"\n class=\"form-check-input\"\n [(ngModel)]=\"currentTemplateContent.IsActive\"\n name=\"isActive\">\n <label class=\"form-check-label\" for=\"isActive\">\n Active\n </label>\n </div>\n } @else {\n <div class=\"form-control-plaintext\">\n @if (currentTemplateContent.IsActive) {\n <span class=\"badge-success\">\n <i class=\"fa-solid fa-check-circle\"></i> Active\n </span>\n } @else {\n <span class=\"badge-secondary\">\n <i class=\"fa-solid fa-pause-circle\"></i> Inactive\n </span>\n }\n </div>\n }\n </div>\n </div>\n </div>\n <!-- Content Text Editor -->\n <div class=\"content-text-editor\">\n <div class=\"editor-header\">\n <label for=\"templateContent\" class=\"editor-label\">\n <i class=\"fa-solid fa-code\"></i> Template Content\n <span class=\"content-type-badge\"\n [class.new]=\"!currentTemplateContent.ID\"\n [class.existing]=\"!!currentTemplateContent.ID\">\n @if (!currentTemplateContent.ID) {\n New\n } @else {\n {{ getContentTypeDisplayText(currentTemplateContent.TypeID) }}\n }\n </span>\n </label>\n <div class=\"editor-actions\">\n @if (!isAddingNewContent && hasUnsavedChanges) {\n <span class=\"unsaved-indicator\">\n <i class=\"fa-solid fa-circle\"></i>\n Unsaved changes\n </span>\n }\n @if (template.IsSaved && currentTemplateContent && config.showRunButton) {\n <button type=\"button\"\n class=\"run-btn\"\n [disabled]=\"isRunningTemplate\"\n (click)=\"onRunTemplate()\"\n title=\"Test run this template\">\n @if (isRunningTemplate) {\n <i class=\"fa-solid fa-spinner fa-spin\"></i>\n Running...\n } @else {\n <i class=\"fa-solid fa-play\"></i>\n Run\n }\n </button>\n }\n </div>\n </div>\n <mj-code-editor\n #codeEditor\n (change)=\"onTemplateTextChange($event)\"\n [readonly]=\"!config.allowEdit\"\n [language]=\"getEditorLanguage()\"\n [languages]=\"supportedLanguages\"\n class=\"code-editor-wrapper\">\n </mj-code-editor>\n <!-- Template Help Section with Tabs -->\n @if (!config.compactMode) {\n <div class=\"template-help-section\">\n <!-- Tab Navigation -->\n <div class=\"help-tabs\">\n <button type=\"button\"\n class=\"help-tab\"\n [class.active]=\"activeHelpTab === 'syntax'\"\n (click)=\"activeHelpTab = 'syntax'\">\n <i class=\"fa-solid fa-code\"></i> Template Syntax\n </button>\n <button type=\"button\"\n class=\"help-tab\"\n [class.active]=\"activeHelpTab === 'placeholders'\"\n (click)=\"activeHelpTab = 'placeholders'\">\n <i class=\"fa-solid fa-at\"></i> System Placeholders\n </button>\n </div>\n <!-- Tab Content -->\n <div class=\"help-content\">\n <!-- Template Syntax Tab -->\n @if (activeHelpTab === 'syntax') {\n <div class=\"syntax-help\">\n <div class=\"section-title\">\n <i class=\"fa-solid fa-lightbulb\"></i> Template Syntax Quick Reference\n </div>\n <div class=\"syntax-grid\">\n <div>\n <div class=\"syntax-item\">\n <strong>Parameters:</strong><br>\n <code>{{'{{'}} paramName {{'}}'}}</code>\n </div>\n <div>\n <strong>Template Includes:</strong><br>\n <code>{{'{% template \"TemplateName\" %}'}}</code>\n </div>\n </div>\n <div>\n <div class=\"syntax-item\">\n <strong>Conditionals:</strong><br>\n <code>{{'{% if condition %}'}} ... {{'{% endif %}'}}</code>\n </div>\n <div>\n <strong>Loops:</strong><br>\n <code>{{'{% for item in items %}'}} ... {{'{% endfor %}'}}</code>\n </div>\n </div>\n </div>\n </div>\n }\n <!-- System Placeholders Tab -->\n @if (activeHelpTab === 'placeholders') {\n <div class=\"placeholders-help\">\n <div class=\"section-title\">\n <i class=\"fa-solid fa-at\"></i> System Placeholders Reference\n </div>\n <p class=\"placeholders-description\">\n System placeholders are automatically available in all AI prompt templates. Simply use them in your template text and they will be replaced with their current values at execution time.\n </p>\n <!-- Category Sub-tabs -->\n <div class=\"category-tabs\">\n @for (categoryGroup of placeholderCategories; track categoryGroup.category.name) {\n <button type=\"button\"\n class=\"category-tab\"\n [class.active]=\"activePlaceholderCategory === categoryGroup.category.name\"\n (click)=\"activePlaceholderCategory = categoryGroup.category.name\">\n <i [class]=\"'fa-solid ' + categoryGroup.category.icon\" style=\"font-size: 0.9em;\"></i>\n {{ categoryGroup.category.name }}\n <span class=\"tab-badge\">\n {{ categoryGroup.placeholders.length }}\n </span>\n </button>\n }\n </div>\n <!-- Active Category Content -->\n <div class=\"placeholder-content\">\n @for (categoryGroup of placeholderCategories; track categoryGroup.category.name) {\n @if (activePlaceholderCategory === categoryGroup.category.name) {\n <div class=\"category-header\">\n <i [class]=\"'fa-solid ' + categoryGroup.category.icon\"\n [style.color]=\"categoryGroup.category.color\"></i>\n <h5>{{ categoryGroup.category.name }}</h5>\n </div>\n <div class=\"placeholder-grid\">\n @for (placeholder of categoryGroup.placeholders; track placeholder.name) {\n <div class=\"placeholder-item\">\n <div class=\"placeholder-item-inner\">\n <div>\n <div class=\"placeholder-name-row\">\n <code class=\"placeholder-code\">{{'{{'}} {{ placeholder.name }} {{'}}'}}</code>\n <button type=\"button\"\n class=\"copy-btn\"\n (click)=\"copyPlaceholder(placeholder.name)\"\n title=\"Copy placeholder to clipboard\">\n <i class=\"fa-solid fa-copy\"></i>\n </button>\n </div>\n @if (placeholder.description) {\n <div class=\"placeholder-description\">{{ placeholder.description }}</div>\n }\n </div>\n </div>\n </div>\n }\n </div>\n }\n }\n </div>\n <!-- Usage Example -->\n <div class=\"usage-example\">\n <div class=\"usage-example-inner\">\n <i class=\"fa-solid fa-info-circle\"></i>\n <div class=\"usage-example-text\">\n <strong>Usage Example:</strong> To use a system placeholder in your template, simply include it in double curly braces.\n For example: <code>\"Today is {{'{{'}} _CURRENT_DATE {{'}}'}} and the current user is {{'{{'}} _USER_NAME {{'}}'}}\"</code>\n </div>\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n }\n </div>\n </div>\n } @else {\n <!-- No Content State -->\n <div class=\"no-content-state\">\n <i class=\"fa-solid fa-file-plus\"></i>\n <h5>No Template Content</h5>\n <p>Create your first template content version to get started.</p>\n @if (config.allowEdit) {\n <button type=\"button\"\n (click)=\"addNewTemplateContent()\"\n class=\"btn btn-primary\">\n <i class=\"fa-solid fa-plus\"></i> Create First Content Version\n </button>\n }\n </div>\n }\n </div>\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-core-entity-forms",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.13.0",
|
|
4
4
|
"description": "MemberJunction Core Entity Angular Forms",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -27,36 +27,36 @@
|
|
|
27
27
|
"@angular/router": "21.1.3",
|
|
28
28
|
"@codemirror/language": "latest",
|
|
29
29
|
"@codemirror/language-data": "^6.5.2",
|
|
30
|
-
"@memberjunction/actions-base": "5.
|
|
31
|
-
"@memberjunction/ai": "5.
|
|
32
|
-
"@memberjunction/ai-core-plus": "5.
|
|
33
|
-
"@memberjunction/ai-engine-base": "5.
|
|
34
|
-
"@memberjunction/core": "5.
|
|
35
|
-
"@memberjunction/core-entities": "5.
|
|
36
|
-
"@memberjunction/global": "5.
|
|
37
|
-
"@memberjunction/graphql-dataprovider": "5.
|
|
38
|
-
"@memberjunction/ng-action-gallery": "5.
|
|
39
|
-
"@memberjunction/ng-actions": "5.
|
|
40
|
-
"@memberjunction/ng-agents": "5.
|
|
41
|
-
"@memberjunction/ng-ai-test-harness": "5.
|
|
42
|
-
"@memberjunction/ng-base-application": "5.
|
|
43
|
-
"@memberjunction/ng-base-forms": "5.
|
|
44
|
-
"@memberjunction/ng-code-editor": "5.
|
|
45
|
-
"@memberjunction/ng-deep-diff": "5.
|
|
46
|
-
"@memberjunction/ng-entity-relationship-diagram": "5.
|
|
47
|
-
"@memberjunction/ng-flow-editor": "5.
|
|
48
|
-
"@memberjunction/ng-entity-viewer": "5.
|
|
49
|
-
"@memberjunction/ng-join-grid": "5.
|
|
50
|
-
"@memberjunction/ng-link-directives": "5.
|
|
51
|
-
"@memberjunction/ng-list-management": "5.
|
|
52
|
-
"@memberjunction/ng-markdown": "5.
|
|
53
|
-
"@memberjunction/ng-notifications": "5.
|
|
54
|
-
"@memberjunction/ng-shared": "5.
|
|
55
|
-
"@memberjunction/ng-shared-generic": "5.
|
|
56
|
-
"@memberjunction/ng-tabstrip": "5.
|
|
57
|
-
"@memberjunction/ng-testing": "5.
|
|
58
|
-
"@memberjunction/ng-timeline": "5.
|
|
59
|
-
"@memberjunction/templates-base-types": "5.
|
|
30
|
+
"@memberjunction/actions-base": "5.13.0",
|
|
31
|
+
"@memberjunction/ai": "5.13.0",
|
|
32
|
+
"@memberjunction/ai-core-plus": "5.13.0",
|
|
33
|
+
"@memberjunction/ai-engine-base": "5.13.0",
|
|
34
|
+
"@memberjunction/core": "5.13.0",
|
|
35
|
+
"@memberjunction/core-entities": "5.13.0",
|
|
36
|
+
"@memberjunction/global": "5.13.0",
|
|
37
|
+
"@memberjunction/graphql-dataprovider": "5.13.0",
|
|
38
|
+
"@memberjunction/ng-action-gallery": "5.13.0",
|
|
39
|
+
"@memberjunction/ng-actions": "5.13.0",
|
|
40
|
+
"@memberjunction/ng-agents": "5.13.0",
|
|
41
|
+
"@memberjunction/ng-ai-test-harness": "5.13.0",
|
|
42
|
+
"@memberjunction/ng-base-application": "5.13.0",
|
|
43
|
+
"@memberjunction/ng-base-forms": "5.13.0",
|
|
44
|
+
"@memberjunction/ng-code-editor": "5.13.0",
|
|
45
|
+
"@memberjunction/ng-deep-diff": "5.13.0",
|
|
46
|
+
"@memberjunction/ng-entity-relationship-diagram": "5.13.0",
|
|
47
|
+
"@memberjunction/ng-flow-editor": "5.13.0",
|
|
48
|
+
"@memberjunction/ng-entity-viewer": "5.13.0",
|
|
49
|
+
"@memberjunction/ng-join-grid": "5.13.0",
|
|
50
|
+
"@memberjunction/ng-link-directives": "5.13.0",
|
|
51
|
+
"@memberjunction/ng-list-management": "5.13.0",
|
|
52
|
+
"@memberjunction/ng-markdown": "5.13.0",
|
|
53
|
+
"@memberjunction/ng-notifications": "5.13.0",
|
|
54
|
+
"@memberjunction/ng-shared": "5.13.0",
|
|
55
|
+
"@memberjunction/ng-shared-generic": "5.13.0",
|
|
56
|
+
"@memberjunction/ng-tabstrip": "5.13.0",
|
|
57
|
+
"@memberjunction/ng-testing": "5.13.0",
|
|
58
|
+
"@memberjunction/ng-timeline": "5.13.0",
|
|
59
|
+
"@memberjunction/templates-base-types": "5.13.0",
|
|
60
60
|
"@progress/kendo-angular-buttons": "22.0.1",
|
|
61
61
|
"@progress/kendo-angular-dateinputs": "22.0.1",
|
|
62
62
|
"@progress/kendo-angular-dialog": "22.0.1",
|