@memberjunction/ng-core-entity-forms 6.2.0-edge.0 → 6.2.0-edge.2
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/AIAgentCategories/ai-agent-category-overview.panel.d.ts +1 -1
- package/dist/lib/custom/AIAgentCategories/ai-agent-category-overview.panel.js +2 -2
- package/dist/lib/custom/AIAgentCategories/ai-agent-category-overview.panel.js.map +1 -1
- package/dist/lib/custom/AIAgentSessions/ai-agent-session-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts +90 -16
- package/dist/lib/custom/AIAgents/add-action-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js +218 -70
- package/dist/lib/custom/AIAgents/add-action-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-form-tabs.d.ts +1 -0
- package/dist/lib/custom/AIAgents/agent-form-tabs.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/agent-form-tabs.js +2 -0
- package/dist/lib/custom/AIAgents/agent-form-tabs.js.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts +80 -16
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js +146 -46
- package/dist/lib/custom/AIAgents/agent-prompt-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts +329 -27
- package/dist/lib/custom/AIAgents/ai-agent-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js +1322 -783
- package/dist/lib/custom/AIAgents/ai-agent-form.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-management.service.d.ts +76 -0
- package/dist/lib/custom/AIAgents/ai-agent-management.service.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/ai-agent-management.service.js +77 -33
- package/dist/lib/custom/AIAgents/ai-agent-management.service.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts +69 -15
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js +182 -74
- package/dist/lib/custom/AIAgents/create-prompt-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts +105 -25
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js +272 -112
- package/dist/lib/custom/AIAgents/create-sub-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts +32 -6
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js +71 -19
- package/dist/lib/custom/AIAgents/new-agent-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.d.ts +10 -0
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.js +27 -7
- package/dist/lib/custom/AIAgents/new-agent-dialog.service.js.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts +65 -15
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js +152 -52
- package/dist/lib/custom/AIAgents/prompt-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts +81 -15
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js +145 -45
- package/dist/lib/custom/AIAgents/sub-agent-advanced-settings-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts +71 -17
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js +175 -67
- package/dist/lib/custom/AIAgents/sub-agent-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts +173 -27
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js +385 -93
- package/dist/lib/custom/AIPromptRuns/ai-prompt-run-form.component.js.map +1 -1
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.d.ts +64 -4
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.js +129 -29
- package/dist/lib/custom/AIPromptRuns/chat-message-viewer.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts +260 -27
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js +694 -252
- package/dist/lib/custom/AIPrompts/ai-prompt-form.component.js.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.d.ts +10 -0
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.js +17 -9
- package/dist/lib/custom/AIPrompts/ai-prompt-management.service.js.map +1 -1
- package/dist/lib/custom/AIPrompts/pending-records.d.ts +11 -0
- package/dist/lib/custom/AIPrompts/pending-records.d.ts.map +1 -0
- package/dist/lib/custom/AIPrompts/pending-records.js +21 -0
- package/dist/lib/custom/AIPrompts/pending-records.js.map +1 -0
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts +74 -16
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js +174 -58
- package/dist/lib/custom/AIPrompts/template-selector-dialog.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts +108 -14
- package/dist/lib/custom/Actions/action-execution-log-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Actions/action-execution-log-form.component.js +258 -70
- package/dist/lib/custom/Actions/action-execution-log-form.component.js.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.d.ts +198 -14
- package/dist/lib/custom/Actions/action-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Actions/action-form.component.js +387 -107
- package/dist/lib/custom/Actions/action-form.component.js.map +1 -1
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.d.ts +12 -6
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.d.ts.map +1 -1
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.js +41 -29
- package/dist/lib/custom/BridgeProviders/bridge-provider-features.js.map +1 -1
- package/dist/lib/custom/BridgeProviders/bridge-provider-form.component.js +14 -14
- package/dist/lib/custom/BridgeProviders/bridge-provider-form.component.js.map +1 -1
- package/dist/lib/custom/Companies/company-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Companies/company-overview.panel.js +2 -2
- package/dist/lib/custom/Companies/company-overview.panel.js.map +1 -1
- package/dist/lib/custom/Conversations/conversation-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Conversations/conversation-overview.panel.js +2 -2
- package/dist/lib/custom/Conversations/conversation-overview.panel.js.map +1 -1
- package/dist/lib/custom/Employees/employee-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Employees/employee-overview.panel.js +2 -2
- package/dist/lib/custom/Employees/employee-overview.panel.js.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.d.ts +217 -29
- package/dist/lib/custom/Entities/entity-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Entities/entity-form.component.js +734 -285
- package/dist/lib/custom/Entities/entity-form.component.js.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.d.ts +5 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.d.ts.map +1 -1
- package/dist/lib/custom/EntityActions/entityaction.form.component.js +10 -2
- package/dist/lib/custom/EntityActions/entityaction.form.component.js.map +1 -1
- package/dist/lib/custom/Files/file-form.component.d.ts +1 -1
- package/dist/lib/custom/Files/file-form.component.js +2 -2
- package/dist/lib/custom/Files/file-form.component.js.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.d.ts +300 -36
- package/dist/lib/custom/Lists/list-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Lists/list-form.component.js +664 -208
- package/dist/lib/custom/Lists/list-form.component.js.map +1 -1
- package/dist/lib/custom/MLModels/ml-model-view-models.d.ts +31 -0
- package/dist/lib/custom/MLModels/ml-model-view-models.d.ts.map +1 -1
- package/dist/lib/custom/MLModels/ml-model-view-models.js +52 -16
- package/dist/lib/custom/MLModels/ml-model-view-models.js.map +1 -1
- package/dist/lib/custom/MLModels/ps-model-detail.component.d.ts +107 -10
- package/dist/lib/custom/MLModels/ps-model-detail.component.d.ts.map +1 -1
- package/dist/lib/custom/MLModels/ps-model-detail.component.js +291 -101
- package/dist/lib/custom/MLModels/ps-model-detail.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.d.ts +201 -26
- package/dist/lib/custom/Queries/query-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-form.component.js +429 -109
- package/dist/lib/custom/Queries/query-form.component.js.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts +107 -14
- package/dist/lib/custom/Queries/query-run-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Queries/query-run-dialog.component.js +249 -79
- package/dist/lib/custom/Queries/query-run-dialog.component.js.map +1 -1
- package/dist/lib/custom/RecordProcesses/record-process-form.component.d.ts +129 -4
- package/dist/lib/custom/RecordProcesses/record-process-form.component.d.ts.map +1 -1
- package/dist/lib/custom/RecordProcesses/record-process-form.component.js +904 -90
- package/dist/lib/custom/RecordProcesses/record-process-form.component.js.map +1 -1
- package/dist/lib/custom/Rubrics/evaluation-form.component.d.ts +37 -0
- package/dist/lib/custom/Rubrics/evaluation-form.component.d.ts.map +1 -0
- package/dist/lib/custom/Rubrics/evaluation-form.component.js +399 -0
- package/dist/lib/custom/Rubrics/evaluation-form.component.js.map +1 -0
- package/dist/lib/custom/Rubrics/record-forms.component.d.ts +69 -0
- package/dist/lib/custom/Rubrics/record-forms.component.d.ts.map +1 -0
- package/dist/lib/custom/Rubrics/record-forms.component.js +587 -0
- package/dist/lib/custom/Rubrics/record-forms.component.js.map +1 -0
- package/dist/lib/custom/Rubrics/rubric-form.component.d.ts +67 -0
- package/dist/lib/custom/Rubrics/rubric-form.component.d.ts.map +1 -0
- package/dist/lib/custom/Rubrics/rubric-form.component.js +534 -0
- package/dist/lib/custom/Rubrics/rubric-form.component.js.map +1 -0
- package/dist/lib/custom/Rubrics/rubric-form.panels.d.ts +25 -0
- package/dist/lib/custom/Rubrics/rubric-form.panels.d.ts.map +1 -0
- package/dist/lib/custom/Rubrics/rubric-form.panels.js +299 -0
- package/dist/lib/custom/Rubrics/rubric-form.panels.js.map +1 -0
- package/dist/lib/custom/Rubrics/scale-form.component.d.ts +31 -0
- package/dist/lib/custom/Rubrics/scale-form.component.d.ts.map +1 -0
- package/dist/lib/custom/Rubrics/scale-form.component.js +395 -0
- package/dist/lib/custom/Rubrics/scale-form.component.js.map +1 -0
- package/dist/lib/custom/SearchScopes/searchscope-form.component.d.ts +1 -1
- package/dist/lib/custom/SearchScopes/searchscope-form.component.js +4 -4
- package/dist/lib/custom/SearchScopes/searchscope-form.component.js.map +1 -1
- package/dist/lib/custom/SessionBridges/session-bridge-form.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts +77 -13
- package/dist/lib/custom/Templates/template-param-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-param-dialog.component.js +196 -78
- package/dist/lib/custom/Templates/template-param-dialog.component.js.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts +49 -7
- package/dist/lib/custom/Templates/template-params-grid.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/template-params-grid.component.js +132 -44
- package/dist/lib/custom/Templates/template-params-grid.component.js.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.d.ts +153 -19
- package/dist/lib/custom/Templates/templates-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Templates/templates-form.component.js +434 -217
- package/dist/lib/custom/Templates/templates-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts +24 -4
- package/dist/lib/custom/Tests/entity-link-pill.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/entity-link-pill.component.js +64 -20
- package/dist/lib/custom/Tests/entity-link-pill.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.d.ts +223 -27
- package/dist/lib/custom/Tests/test-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-form.component.js +951 -530
- package/dist/lib/custom/Tests/test-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-checks.d.ts +2 -0
- package/dist/lib/custom/Tests/test-run-checks.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-run-checks.js +5 -1
- package/dist/lib/custom/Tests/test-run-checks.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.d.ts +2 -0
- package/dist/lib/custom/Tests/test-run-feedback-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.js +5 -1
- package/dist/lib/custom/Tests/test-run-feedback-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.d.ts +146 -18
- package/dist/lib/custom/Tests/test-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-run-form.component.js +362 -106
- package/dist/lib/custom/Tests/test-run-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts +395 -47
- package/dist/lib/custom/Tests/test-suite-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-form.component.js +1719 -1007
- package/dist/lib/custom/Tests/test-suite-form.component.js.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts +214 -26
- package/dist/lib/custom/Tests/test-suite-run-form.component.d.ts.map +1 -1
- package/dist/lib/custom/Tests/test-suite-run-form.component.js +535 -159
- package/dist/lib/custom/Tests/test-suite-run-form.component.js.map +1 -1
- package/dist/lib/custom/Users/user-overview.panel.d.ts +1 -1
- package/dist/lib/custom/Users/user-overview.panel.js +3 -3
- package/dist/lib/custom/Users/user-overview.panel.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts +208 -29
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js +446 -138
- package/dist/lib/custom/ai-agent-run/ai-agent-run-analytics.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.d.ts +6 -0
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.js +16 -4
- package/dist/lib/custom/ai-agent-run/ai-agent-run-cost.service.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts +50 -6
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js +84 -12
- package/dist/lib/custom/ai-agent-run/ai-agent-run-data.service.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.d.ts +89 -5
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js +216 -70
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-detail.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.d.ts +62 -3
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js +140 -42
- package/dist/lib/custom/ai-agent-run/ai-agent-run-step-node.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts +81 -10
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js +165 -37
- package/dist/lib/custom/ai-agent-run/ai-agent-run-timeline.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts +140 -15
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js +326 -100
- package/dist/lib/custom/ai-agent-run/ai-agent-run.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.d.ts +101 -15
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.js +281 -97
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.d.ts +43 -25
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.js +100 -64
- package/dist/lib/custom/ai-agent-run/flow/agent-run-flow.model.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.d.ts +14 -2
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.js +71 -53
- package/dist/lib/custom/ai-agent-run/flow/constellation.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.d.ts +14 -2
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.js +70 -52
- package/dist/lib/custom/ai-agent-run/flow/flame-cascade.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.d.ts +8 -0
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.js +22 -6
- package/dist/lib/custom/ai-agent-run/flow/flow-svg.util.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.d.ts +24 -2
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.js +91 -59
- package/dist/lib/custom/ai-agent-run/flow/flowchart.component.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.d.ts +10 -2
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.js +33 -17
- package/dist/lib/custom/ai-agent-run/flow/pan-zoom.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.d.ts +2 -0
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.js +34 -30
- package/dist/lib/custom/ai-agent-run/flow/run-tree-flow-projection.js.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.d.ts +14 -2
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.d.ts.map +1 -1
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.js +69 -51
- package/dist/lib/custom/ai-agent-run/flow/subway-lines.component.js.map +1 -1
- package/dist/lib/custom/custom-forms.module.d.ts +56 -48
- package/dist/lib/custom/custom-forms.module.d.ts.map +1 -1
- package/dist/lib/custom/custom-forms.module.js +60 -0
- package/dist/lib/custom/custom-forms.module.js.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts +38 -12
- package/dist/lib/custom/shared/entity-selector-dialog.component.d.ts.map +1 -1
- package/dist/lib/custom/shared/entity-selector-dialog.component.js +103 -51
- package/dist/lib/custom/shared/entity-selector-dialog.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.js +61 -43
- package/dist/lib/generated/Entities/MJAIAgent/mjaiagent.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIAgentRubric/mjaiagentrubric.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJAIAgentRubric/mjaiagentrubric.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJAIAgentRubric/mjaiagentrubric.form.component.js +74 -0
- package/dist/lib/generated/Entities/MJAIAgentRubric/mjaiagentrubric.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 +37 -19
- package/dist/lib/generated/Entities/MJAIAgentRun/mjaiagentrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.js +78 -52
- package/dist/lib/generated/Entities/MJAIPromptRun/mjaipromptrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.js +76 -74
- package/dist/lib/generated/Entities/MJAIVendor/mjaivendor.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js +156 -84
- package/dist/lib/generated/Entities/MJEntity/mjentity.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJFeaturePipelineType/mjfeaturepipelinetype.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJFeaturePipelineType/mjfeaturepipelinetype.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJFeaturePipelineType/mjfeaturepipelinetype.form.component.js +62 -0
- package/dist/lib/generated/Entities/MJFeaturePipelineType/mjfeaturepipelinetype.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJProcessRun/mjprocessrun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJProcessRun/mjprocessrun.form.component.js +24 -6
- package/dist/lib/generated/Entities/MJProcessRun/mjprocessrun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJProject/mjproject.form.component.js +27 -25
- package/dist/lib/generated/Entities/MJProject/mjproject.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJRecordChange/mjrecordchange.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJRecordChange/mjrecordchange.form.component.js +24 -16
- package/dist/lib/generated/Entities/MJRecordChange/mjrecordchange.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJRecordCloneLog/mjrecordclonelog.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRecordCloneLog/mjrecordclonelog.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRecordCloneLog/mjrecordclonelog.form.component.js +107 -0
- package/dist/lib/generated/Entities/MJRecordCloneLog/mjrecordclonelog.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRecordCloneLogItem/mjrecordclonelogitem.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRecordCloneLogItem/mjrecordclonelogitem.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRecordCloneLogItem/mjrecordclonelogitem.form.component.js +74 -0
- package/dist/lib/generated/Entities/MJRecordCloneLogItem/mjrecordclonelogitem.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubric/mjrubric.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubric/mjrubric.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubric/mjrubric.form.component.js +135 -0
- package/dist/lib/generated/Entities/MJRubric/mjrubric.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricBand/mjrubricband.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricBand/mjrubricband.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricBand/mjrubricband.form.component.js +87 -0
- package/dist/lib/generated/Entities/MJRubricBand/mjrubricband.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricCategory/mjrubriccategory.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricCategory/mjrubriccategory.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricCategory/mjrubriccategory.form.component.js +107 -0
- package/dist/lib/generated/Entities/MJRubricCategory/mjrubriccategory.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricCriterion/mjrubriccriterion.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricCriterion/mjrubriccriterion.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricCriterion/mjrubriccriterion.form.component.js +155 -0
- package/dist/lib/generated/Entities/MJRubricCriterion/mjrubriccriterion.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricCriterionLevel/mjrubriccriterionlevel.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricCriterionLevel/mjrubriccriterionlevel.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricCriterionLevel/mjrubriccriterionlevel.form.component.js +62 -0
- package/dist/lib/generated/Entities/MJRubricCriterionLevel/mjrubriccriterionlevel.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricEvaluation/mjrubricevaluation.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricEvaluation/mjrubricevaluation.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricEvaluation/mjrubricevaluation.form.component.js +183 -0
- package/dist/lib/generated/Entities/MJRubricEvaluation/mjrubricevaluation.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricEvaluationScore/mjrubricevaluationscore.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricEvaluationScore/mjrubricevaluationscore.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricEvaluationScore/mjrubricevaluationscore.form.component.js +120 -0
- package/dist/lib/generated/Entities/MJRubricEvaluationScore/mjrubricevaluationscore.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricScale/mjrubricscale.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricScale/mjrubricscale.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricScale/mjrubricscale.form.component.js +107 -0
- package/dist/lib/generated/Entities/MJRubricScale/mjrubricscale.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricScaleLevel/mjrubricscalelevel.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricScaleLevel/mjrubricscalelevel.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricScaleLevel/mjrubricscalelevel.form.component.js +103 -0
- package/dist/lib/generated/Entities/MJRubricScaleLevel/mjrubricscalelevel.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJRubricVersion/mjrubricversion.form.component.d.ts +10 -0
- package/dist/lib/generated/Entities/MJRubricVersion/mjrubricversion.form.component.d.ts.map +1 -0
- package/dist/lib/generated/Entities/MJRubricVersion/mjrubricversion.form.component.js +171 -0
- package/dist/lib/generated/Entities/MJRubricVersion/mjrubricversion.form.component.js.map +1 -0
- package/dist/lib/generated/Entities/MJTest/mjtest.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJTest/mjtest.form.component.js +24 -16
- package/dist/lib/generated/Entities/MJTest/mjtest.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTestSuite/mjtestsuite.form.component.js +27 -25
- package/dist/lib/generated/Entities/MJTestSuite/mjtestsuite.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJTestSuiteRun/mjtestsuiterun.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJTestSuiteRun/mjtestsuiterun.form.component.js +19 -11
- package/dist/lib/generated/Entities/MJTestSuiteRun/mjtestsuiterun.form.component.js.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.d.ts.map +1 -1
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js +209 -119
- package/dist/lib/generated/Entities/MJUser/mjuser.form.component.js.map +1 -1
- package/dist/lib/generated/generated-forms.module.d.ts +436 -422
- package/dist/lib/generated/generated-forms.module.d.ts.map +1 -1
- package/dist/lib/generated/generated-forms.module.js +44 -2
- package/dist/lib/generated/generated-forms.module.js.map +1 -1
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.d.ts +5 -1
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.d.ts.map +1 -1
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.js +11 -3
- package/dist/lib/panels/ai-skill-sharing/ai-skill-sharing-panel.component.js.map +1 -1
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.d.ts +2 -0
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.d.ts.map +1 -1
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.js +16 -12
- package/dist/lib/panels/content-sources/tag-pipeline-configuration.panel.js.map +1 -1
- package/dist/lib/panels/content-sources/website-crawler-settings.panel.d.ts +1 -1
- package/dist/lib/panels/content-sources/website-crawler-settings.panel.js +2 -2
- package/dist/lib/panels/content-sources/website-crawler-settings.panel.js.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.d.ts +45 -19
- package/dist/lib/panels/model-predictions/model-prediction.logic.d.ts.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.logic.js +95 -43
- package/dist/lib/panels/model-predictions/model-prediction.logic.js.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.panel.d.ts +20 -16
- package/dist/lib/panels/model-predictions/model-prediction.panel.d.ts.map +1 -1
- package/dist/lib/panels/model-predictions/model-prediction.panel.js +73 -65
- package/dist/lib/panels/model-predictions/model-prediction.panel.js.map +1 -1
- package/dist/lib/panels/record-clone/entity-clone-config-editor.component.d.ts +116 -0
- package/dist/lib/panels/record-clone/entity-clone-config-editor.component.d.ts.map +1 -0
- package/dist/lib/panels/record-clone/entity-clone-config-editor.component.js +820 -0
- package/dist/lib/panels/record-clone/entity-clone-config-editor.component.js.map +1 -0
- package/dist/lib/shared/components/template-editor.component.d.ts +158 -15
- package/dist/lib/shared/components/template-editor.component.d.ts.map +1 -1
- package/dist/lib/shared/components/template-editor.component.js +389 -127
- package/dist/lib/shared/components/template-editor.component.js.map +1 -1
- package/dist/public-api.d.ts +5 -0
- package/dist/public-api.d.ts.map +1 -1
- package/dist/public-api.js +5 -0
- package/dist/public-api.js.map +1 -1
- package/package.json +47 -42
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { Component, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
|
1
|
+
import { Component, Input, Output, EventEmitter, ViewChild, ElementRef, inject } from '@angular/core';
|
|
2
2
|
import { RunView } from '@memberjunction/core';
|
|
3
|
+
import { MJEventType, MJGlobal } from '@memberjunction/global';
|
|
3
4
|
import { MJNotificationService } from '@memberjunction/ng-notifications';
|
|
5
|
+
import { IsDescendantElement } from '@memberjunction/ng-shared-generic';
|
|
4
6
|
import { TemplateEngineBase } from '@memberjunction/templates-base-types';
|
|
5
7
|
import { languages } from '@codemirror/language-data';
|
|
6
8
|
import { Subject } from 'rxjs';
|
|
9
|
+
import { takeUntil } from 'rxjs/operators';
|
|
7
10
|
import { DEFAULT_SYSTEM_PLACEHOLDERS, SYSTEM_PLACEHOLDER_CATEGORIES } from '@memberjunction/ai-core-plus';
|
|
8
|
-
import { BaseAngularComponent } from '@memberjunction/ng-base-types';
|
|
11
|
+
import { BaseAngularComponent, BaseFormComponentEventCodes, PendingRecordItem } from '@memberjunction/ng-base-types';
|
|
9
12
|
import * as i0 from "@angular/core";
|
|
10
13
|
import * as i1 from "@memberjunction/ng-notifications";
|
|
11
14
|
import * as i2 from "@memberjunction/ng-ui-components";
|
|
@@ -462,62 +465,206 @@ function TemplateEditorComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
|
462
465
|
i0.ɵɵconditional(ctx_r2.currentTemplateContent ? 2 : 3);
|
|
463
466
|
} }
|
|
464
467
|
export class TemplateEditorComponent extends BaseAngularComponent {
|
|
468
|
+
/** @deprecated Use {@link Template}. */
|
|
469
|
+
set template(value) {
|
|
470
|
+
this.Template = value;
|
|
471
|
+
}
|
|
472
|
+
/** @deprecated Use {@link Template}. */
|
|
473
|
+
get template() {
|
|
474
|
+
return this.Template;
|
|
475
|
+
}
|
|
476
|
+
/** @deprecated Use {@link TemplateContents}. */
|
|
477
|
+
get templateContents() {
|
|
478
|
+
return this.TemplateContents;
|
|
479
|
+
}
|
|
480
|
+
/** @deprecated Use {@link TemplateContents}. */
|
|
481
|
+
set templateContents(value) {
|
|
482
|
+
this.TemplateContents = value;
|
|
483
|
+
}
|
|
484
|
+
/** @deprecated Use {@link SelectedContentIndex}. */
|
|
485
|
+
get selectedContentIndex() {
|
|
486
|
+
return this.SelectedContentIndex;
|
|
487
|
+
}
|
|
488
|
+
/** @deprecated Use {@link SelectedContentIndex}. */
|
|
489
|
+
set selectedContentIndex(value) {
|
|
490
|
+
this.SelectedContentIndex = value;
|
|
491
|
+
}
|
|
492
|
+
/** @deprecated Use {@link IsAddingNewContent}. */
|
|
493
|
+
get isAddingNewContent() {
|
|
494
|
+
return this.IsAddingNewContent;
|
|
495
|
+
}
|
|
496
|
+
/** @deprecated Use {@link IsAddingNewContent}. */
|
|
497
|
+
set isAddingNewContent(value) {
|
|
498
|
+
this.IsAddingNewContent = value;
|
|
499
|
+
}
|
|
500
|
+
/** @deprecated Use {@link NewTemplateContent}. */
|
|
501
|
+
get newTemplateContent() {
|
|
502
|
+
return this.NewTemplateContent;
|
|
503
|
+
}
|
|
504
|
+
/** @deprecated Use {@link NewTemplateContent}. */
|
|
505
|
+
set newTemplateContent(value) {
|
|
506
|
+
this.NewTemplateContent = value;
|
|
507
|
+
}
|
|
508
|
+
/** @deprecated Use {@link HasUnsavedChanges}. */
|
|
509
|
+
get hasUnsavedChanges() {
|
|
510
|
+
return this.HasUnsavedChanges;
|
|
511
|
+
}
|
|
512
|
+
/** @deprecated Use {@link HasUnsavedChanges}. */
|
|
513
|
+
set hasUnsavedChanges(value) {
|
|
514
|
+
this.HasUnsavedChanges = value;
|
|
515
|
+
}
|
|
516
|
+
/** @deprecated Use {@link ContentTypeOptions}. */
|
|
517
|
+
get contentTypeOptions() {
|
|
518
|
+
return this.ContentTypeOptions;
|
|
519
|
+
}
|
|
520
|
+
/** @deprecated Use {@link ContentTypeOptions}. */
|
|
521
|
+
set contentTypeOptions(value) {
|
|
522
|
+
this.ContentTypeOptions = value;
|
|
523
|
+
}
|
|
524
|
+
/** @deprecated Use {@link SupportedLanguages}. */
|
|
525
|
+
get supportedLanguages() {
|
|
526
|
+
return this.SupportedLanguages;
|
|
527
|
+
}
|
|
528
|
+
/** @deprecated Use {@link SupportedLanguages}. */
|
|
529
|
+
set supportedLanguages(value) {
|
|
530
|
+
this.SupportedLanguages = value;
|
|
531
|
+
}
|
|
532
|
+
/** @deprecated Use {@link IsRunningTemplate}. */
|
|
533
|
+
get isRunningTemplate() {
|
|
534
|
+
return this.IsRunningTemplate;
|
|
535
|
+
}
|
|
536
|
+
/** @deprecated Use {@link IsRunningTemplate}. */
|
|
537
|
+
set isRunningTemplate(value) {
|
|
538
|
+
this.IsRunningTemplate = value;
|
|
539
|
+
}
|
|
540
|
+
/** @deprecated Use {@link ActiveHelpTab}. */
|
|
541
|
+
get activeHelpTab() {
|
|
542
|
+
return this.ActiveHelpTab;
|
|
543
|
+
}
|
|
544
|
+
/** @deprecated Use {@link ActiveHelpTab}. */
|
|
545
|
+
set activeHelpTab(value) {
|
|
546
|
+
this.ActiveHelpTab = value;
|
|
547
|
+
}
|
|
548
|
+
/** @deprecated Use {@link ActivePlaceholderCategory}. */
|
|
549
|
+
get activePlaceholderCategory() {
|
|
550
|
+
return this.ActivePlaceholderCategory;
|
|
551
|
+
}
|
|
552
|
+
/** @deprecated Use {@link ActivePlaceholderCategory}. */
|
|
553
|
+
set activePlaceholderCategory(value) {
|
|
554
|
+
this.ActivePlaceholderCategory = value;
|
|
555
|
+
}
|
|
556
|
+
/** @deprecated Use {@link PlaceholderCategories}. */
|
|
557
|
+
get placeholderCategories() {
|
|
558
|
+
return this.PlaceholderCategories;
|
|
559
|
+
}
|
|
560
|
+
/** @deprecated Use {@link PlaceholderCategories}. */
|
|
561
|
+
set placeholderCategories(value) {
|
|
562
|
+
this.PlaceholderCategories = value;
|
|
563
|
+
}
|
|
564
|
+
/** @deprecated Use {@link CodeEditor}. */
|
|
565
|
+
get codeEditor() {
|
|
566
|
+
return this.CodeEditor;
|
|
567
|
+
}
|
|
568
|
+
/** @deprecated Use {@link CodeEditor}. */
|
|
569
|
+
set codeEditor(value) {
|
|
570
|
+
this.CodeEditor = value;
|
|
571
|
+
}
|
|
465
572
|
get _metadata() { return this.ProviderToUse; }
|
|
466
573
|
constructor(notificationService, confirmService) {
|
|
467
574
|
super();
|
|
468
575
|
this.notificationService = notificationService;
|
|
469
576
|
this.confirmService = confirmService;
|
|
470
|
-
this.
|
|
577
|
+
this.Template = null;
|
|
471
578
|
this.config = {
|
|
472
579
|
allowEdit: true,
|
|
473
580
|
showRunButton: false,
|
|
474
581
|
compactMode: false
|
|
475
582
|
};
|
|
476
|
-
this.
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
this.
|
|
485
|
-
this.
|
|
486
|
-
|
|
487
|
-
|
|
583
|
+
this.ContentChange = new EventEmitter();
|
|
584
|
+
/**
|
|
585
|
+
* @deprecated Use {@link ContentChange}.
|
|
586
|
+
*
|
|
587
|
+
* The same emitter under the old binding name, so a template still binding
|
|
588
|
+
* (contentChange) keeps working. Must stay AFTER ContentChange: class fields
|
|
589
|
+
* initialise in order, and the other way round this captures undefined.
|
|
590
|
+
*/
|
|
591
|
+
this.contentChange = this.ContentChange;
|
|
592
|
+
this.RunTemplate = new EventEmitter();
|
|
593
|
+
/**
|
|
594
|
+
* @deprecated Use {@link RunTemplate}.
|
|
595
|
+
*
|
|
596
|
+
* The same emitter under the old binding name, so a template still binding
|
|
597
|
+
* (runTemplate) keeps working. Must stay AFTER RunTemplate: class fields
|
|
598
|
+
* initialise in order, and the other way round this captures undefined.
|
|
599
|
+
*/
|
|
600
|
+
this.runTemplate = this.RunTemplate;
|
|
601
|
+
this.TemplateContents = [];
|
|
602
|
+
this.SelectedContentIndex = 0;
|
|
603
|
+
this.IsAddingNewContent = false;
|
|
604
|
+
this.NewTemplateContent = null;
|
|
605
|
+
this.HasUnsavedChanges = false;
|
|
606
|
+
this.ContentTypeOptions = [];
|
|
607
|
+
this.SupportedLanguages = languages;
|
|
608
|
+
this.IsRunningTemplate = false;
|
|
609
|
+
this.ActiveHelpTab = 'syntax';
|
|
610
|
+
this.ActivePlaceholderCategory = '';
|
|
488
611
|
// System placeholders organized by category
|
|
489
|
-
this.
|
|
490
|
-
this.
|
|
612
|
+
this.PlaceholderCategories = [];
|
|
613
|
+
this.CodeEditor = null;
|
|
491
614
|
this.isUpdatingEditorValue = false;
|
|
492
615
|
this.destroy$ = new Subject();
|
|
493
616
|
this.activeTimeouts = [];
|
|
617
|
+
this.elementRef = inject(ElementRef);
|
|
494
618
|
}
|
|
495
619
|
async ngOnInit() {
|
|
496
|
-
this.
|
|
620
|
+
this.LoadContentTypes();
|
|
497
621
|
this.organizePlaceholdersByCategory();
|
|
498
|
-
|
|
499
|
-
|
|
622
|
+
this.listenForHostFormEvents();
|
|
623
|
+
if (this.Template) {
|
|
624
|
+
await this.LoadTemplateContents();
|
|
500
625
|
}
|
|
501
626
|
}
|
|
627
|
+
/**
|
|
628
|
+
* A host form that folds this editor's contents into its pending records (see GetPendingChanges)
|
|
629
|
+
* also reverts them when the user discards the edit: `BaseFormComponent.CancelEdit()` calls
|
|
630
|
+
* `Revert()` on every pending record and broadcasts REVERT_PENDING_CHANGES. The entities roll back
|
|
631
|
+
* on their own, but this editor's rows, CodeMirror's text and the dirty flag would not know, so
|
|
632
|
+
* the screen would keep showing discarded text and the next save would fail on it. Reload from
|
|
633
|
+
* the saved state when the event comes from a form this editor sits inside.
|
|
634
|
+
*/
|
|
635
|
+
listenForHostFormEvents() {
|
|
636
|
+
MJGlobal.Instance.GetEventListener(false).pipe(takeUntil(this.destroy$)).subscribe((e) => {
|
|
637
|
+
if (e.event !== MJEventType.ComponentEvent || e.eventCode !== BaseFormComponentEventCodes.BASE_CODE) {
|
|
638
|
+
return;
|
|
639
|
+
}
|
|
640
|
+
const formEvent = e.args;
|
|
641
|
+
if (formEvent.subEventCode !== BaseFormComponentEventCodes.REVERT_PENDING_CHANGES) {
|
|
642
|
+
return;
|
|
643
|
+
}
|
|
644
|
+
if (IsDescendantElement(formEvent.elementRef, this.elementRef)) {
|
|
645
|
+
void this.RefreshAndDiscardChanges();
|
|
646
|
+
}
|
|
647
|
+
});
|
|
648
|
+
}
|
|
502
649
|
async ngOnChanges(changes) {
|
|
503
650
|
if (changes['template']) {
|
|
504
651
|
// Template input has changed, reload contents
|
|
505
|
-
if (this.
|
|
506
|
-
await this.
|
|
652
|
+
if (this.Template) {
|
|
653
|
+
await this.LoadTemplateContents();
|
|
507
654
|
}
|
|
508
655
|
else {
|
|
509
656
|
// Template cleared, reset state
|
|
510
|
-
this.
|
|
511
|
-
this.
|
|
512
|
-
this.
|
|
513
|
-
this.
|
|
514
|
-
this.
|
|
657
|
+
this.TemplateContents = [];
|
|
658
|
+
this.SelectedContentIndex = 0;
|
|
659
|
+
this.IsAddingNewContent = false;
|
|
660
|
+
this.NewTemplateContent = null;
|
|
661
|
+
this.HasUnsavedChanges = false;
|
|
515
662
|
}
|
|
516
663
|
}
|
|
517
664
|
}
|
|
518
665
|
organizePlaceholdersByCategory() {
|
|
519
666
|
// Group placeholders by their category
|
|
520
|
-
this.
|
|
667
|
+
this.PlaceholderCategories = SYSTEM_PLACEHOLDER_CATEGORIES.map(category => {
|
|
521
668
|
const categoryPlaceholders = DEFAULT_SYSTEM_PLACEHOLDERS.filter(placeholder => placeholder.category === category.name);
|
|
522
669
|
return {
|
|
523
670
|
category: category,
|
|
@@ -528,7 +675,7 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
528
675
|
const categorized = DEFAULT_SYSTEM_PLACEHOLDERS.filter(p => p.category);
|
|
529
676
|
const uncategorized = DEFAULT_SYSTEM_PLACEHOLDERS.filter(p => !p.category);
|
|
530
677
|
if (uncategorized.length > 0) {
|
|
531
|
-
this.
|
|
678
|
+
this.PlaceholderCategories.push({
|
|
532
679
|
category: {
|
|
533
680
|
name: 'Other',
|
|
534
681
|
icon: 'fa-ellipsis-h',
|
|
@@ -538,14 +685,14 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
538
685
|
});
|
|
539
686
|
}
|
|
540
687
|
// Set the first category as active
|
|
541
|
-
if (this.
|
|
542
|
-
this.
|
|
688
|
+
if (this.PlaceholderCategories.length > 0) {
|
|
689
|
+
this.ActivePlaceholderCategory = this.PlaceholderCategories[0].category.name;
|
|
543
690
|
}
|
|
544
691
|
}
|
|
545
692
|
/**
|
|
546
693
|
* Copies a placeholder to the clipboard
|
|
547
694
|
*/
|
|
548
|
-
async
|
|
695
|
+
async CopyPlaceholder(placeholderName) {
|
|
549
696
|
try {
|
|
550
697
|
await navigator.clipboard.writeText(`{{ ${placeholderName} }}`);
|
|
551
698
|
this.notificationService.CreateSimpleNotification('Placeholder copied to clipboard!', 'success', 2000);
|
|
@@ -555,6 +702,10 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
555
702
|
this.notificationService.CreateSimpleNotification('Failed to copy placeholder', 'error', 3000);
|
|
556
703
|
}
|
|
557
704
|
}
|
|
705
|
+
/** @deprecated Use {@link CopyPlaceholder}. */
|
|
706
|
+
async copyPlaceholder(placeholderName) {
|
|
707
|
+
return this.CopyPlaceholder(placeholderName);
|
|
708
|
+
}
|
|
558
709
|
ngOnDestroy() {
|
|
559
710
|
this.destroy$.next();
|
|
560
711
|
this.destroy$.complete();
|
|
@@ -566,86 +717,102 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
566
717
|
// Initial sync when view is ready
|
|
567
718
|
this.syncEditorValue();
|
|
568
719
|
}
|
|
569
|
-
async
|
|
570
|
-
if (this.
|
|
720
|
+
async LoadTemplateContents() {
|
|
721
|
+
if (this.Template) {
|
|
571
722
|
// Reset state first
|
|
572
|
-
this.
|
|
573
|
-
this.
|
|
574
|
-
this.
|
|
575
|
-
this.
|
|
576
|
-
this.
|
|
577
|
-
if (this.
|
|
723
|
+
this.TemplateContents = [];
|
|
724
|
+
this.SelectedContentIndex = 0;
|
|
725
|
+
this.IsAddingNewContent = false;
|
|
726
|
+
this.NewTemplateContent = null;
|
|
727
|
+
this.HasUnsavedChanges = false;
|
|
728
|
+
if (this.Template.IsSaved && this.Template.ID) {
|
|
578
729
|
// Load existing template contents for saved templates
|
|
579
730
|
try {
|
|
580
731
|
const rv = RunView.FromMetadataProvider(this.ProviderToUse);
|
|
581
732
|
const results = await rv.RunView({
|
|
582
733
|
EntityName: 'MJ: Template Contents',
|
|
583
|
-
ExtraFilter: `TemplateID='${this.
|
|
734
|
+
ExtraFilter: `TemplateID='${this.Template.ID}'`,
|
|
584
735
|
OrderBy: 'Priority ASC, __mj_CreatedAt ASC',
|
|
585
736
|
ResultType: 'entity_object'
|
|
586
737
|
});
|
|
587
|
-
this.
|
|
738
|
+
this.TemplateContents = results.Results;
|
|
588
739
|
}
|
|
589
740
|
catch (error) {
|
|
590
741
|
console.error('Error loading template contents:', error);
|
|
591
742
|
}
|
|
592
743
|
}
|
|
593
744
|
// If we have contents but no selection, select the first one
|
|
594
|
-
if (this.
|
|
595
|
-
this.
|
|
745
|
+
if (this.TemplateContents.length > 0) {
|
|
746
|
+
this.SelectedContentIndex = 0;
|
|
596
747
|
}
|
|
597
748
|
// If no template contents exist (either new template or saved template with no content),
|
|
598
749
|
// create a default one for single-content optimization
|
|
599
|
-
if (this.
|
|
600
|
-
await this.
|
|
750
|
+
if (this.TemplateContents.length === 0) {
|
|
751
|
+
await this.CreateDefaultTemplateContent();
|
|
601
752
|
}
|
|
602
753
|
// Sync editor value after loading content
|
|
603
754
|
this.syncEditorValue();
|
|
604
|
-
this.
|
|
755
|
+
this.ContentChange.emit(this.TemplateContents);
|
|
605
756
|
}
|
|
606
757
|
}
|
|
758
|
+
/** @deprecated Use {@link LoadTemplateContents}. */
|
|
759
|
+
async loadTemplateContents() {
|
|
760
|
+
return this.LoadTemplateContents();
|
|
761
|
+
}
|
|
607
762
|
/**
|
|
608
763
|
* Public method to refresh the template editor and discard unsaved changes
|
|
609
764
|
* This should be called when canceling edits to restore the original state
|
|
610
765
|
*/
|
|
766
|
+
async RefreshAndDiscardChanges() {
|
|
767
|
+
await this.LoadTemplateContents();
|
|
768
|
+
}
|
|
769
|
+
/** @deprecated Use {@link RefreshAndDiscardChanges}. */
|
|
611
770
|
async refreshAndDiscardChanges() {
|
|
612
|
-
|
|
771
|
+
return this.RefreshAndDiscardChanges();
|
|
613
772
|
}
|
|
614
|
-
async
|
|
773
|
+
async CreateDefaultTemplateContent() {
|
|
615
774
|
const defaultContent = await this._metadata.GetEntityObject('MJ: Template Contents');
|
|
616
|
-
defaultContent.TemplateID = this.
|
|
775
|
+
defaultContent.TemplateID = this.Template.ID;
|
|
617
776
|
defaultContent.Priority = 1;
|
|
618
777
|
defaultContent.IsActive = true;
|
|
619
778
|
// Set default to first real content type (skip "Select Type..." if it exists)
|
|
620
|
-
const validContentTypes = this.
|
|
779
|
+
const validContentTypes = this.ContentTypeOptions.filter(option => option.value !== '');
|
|
621
780
|
if (validContentTypes.length > 0) {
|
|
622
781
|
defaultContent.TypeID = validContentTypes[0].value;
|
|
623
782
|
}
|
|
624
|
-
this.
|
|
625
|
-
this.
|
|
783
|
+
this.TemplateContents = [defaultContent];
|
|
784
|
+
this.SelectedContentIndex = 0;
|
|
626
785
|
// Sync editor value after creating default content
|
|
627
786
|
this.syncEditorValue();
|
|
628
787
|
}
|
|
629
|
-
|
|
788
|
+
/** @deprecated Use {@link CreateDefaultTemplateContent}. */
|
|
789
|
+
async createDefaultTemplateContent() {
|
|
790
|
+
return this.CreateDefaultTemplateContent();
|
|
791
|
+
}
|
|
792
|
+
async SelectTemplateContent(index, confirmSwitch = true) {
|
|
630
793
|
// If we're adding new content and user clicks on existing content, ask for confirmation
|
|
631
|
-
if (this.
|
|
794
|
+
if (this.IsAddingNewContent && confirmSwitch) {
|
|
632
795
|
if (!(await this.confirmService.Confirm({ title: 'Discard changes?', message: 'Switch content version and lose your unsaved changes?', detail: 'Your changes to the new content version will be lost.' }))) {
|
|
633
796
|
return;
|
|
634
797
|
}
|
|
635
798
|
}
|
|
636
|
-
if (index >= 0 && index < this.
|
|
637
|
-
this.
|
|
638
|
-
this.
|
|
799
|
+
if (index >= 0 && index < this.TemplateContents.length) {
|
|
800
|
+
this.SelectedContentIndex = index;
|
|
801
|
+
this.IsAddingNewContent = false;
|
|
639
802
|
// Don't clear newTemplateContent to preserve the work in progress
|
|
640
803
|
// Sync editor value when switching content
|
|
641
804
|
this.syncEditorValue();
|
|
642
805
|
}
|
|
643
806
|
}
|
|
644
|
-
|
|
807
|
+
/** @deprecated Use {@link SelectTemplateContent}. */
|
|
808
|
+
async selectTemplateContent(index, confirmSwitch = true) {
|
|
809
|
+
return this.SelectTemplateContent(index, confirmSwitch);
|
|
810
|
+
}
|
|
811
|
+
LoadContentTypes() {
|
|
645
812
|
try {
|
|
646
813
|
// Get content types from TemplateEngine cache
|
|
647
814
|
const contentTypes = TemplateEngineBase.Instance.TemplateContentTypes;
|
|
648
|
-
this.
|
|
815
|
+
this.ContentTypeOptions = [
|
|
649
816
|
{ text: 'Select Type...', value: '' },
|
|
650
817
|
...contentTypes.map(ct => ({
|
|
651
818
|
text: ct.Name,
|
|
@@ -656,7 +823,7 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
656
823
|
catch (error) {
|
|
657
824
|
console.error('Error loading content types:', error);
|
|
658
825
|
// Fallback to basic types
|
|
659
|
-
this.
|
|
826
|
+
this.ContentTypeOptions = [
|
|
660
827
|
{ text: 'Select Type...', value: '' },
|
|
661
828
|
{ text: 'HTML', value: 'HTML' },
|
|
662
829
|
{ text: 'Plain Text', value: 'Text' },
|
|
@@ -664,45 +831,53 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
664
831
|
];
|
|
665
832
|
}
|
|
666
833
|
}
|
|
667
|
-
|
|
834
|
+
/** @deprecated Use {@link LoadContentTypes}. */
|
|
835
|
+
loadContentTypes() {
|
|
836
|
+
return this.LoadContentTypes();
|
|
837
|
+
}
|
|
838
|
+
async AddNewTemplateContent() {
|
|
668
839
|
if (!this.config.allowEdit)
|
|
669
840
|
return;
|
|
670
|
-
this.
|
|
671
|
-
this.
|
|
672
|
-
this.
|
|
673
|
-
this.
|
|
841
|
+
this.NewTemplateContent = await this._metadata.GetEntityObject('MJ: Template Contents');
|
|
842
|
+
this.NewTemplateContent.TemplateID = this.Template.ID;
|
|
843
|
+
this.NewTemplateContent.Priority = this.TemplateContents.length + 1;
|
|
844
|
+
this.NewTemplateContent.IsActive = true;
|
|
674
845
|
// Set default to first real content type (skip "Select Type..." if it exists)
|
|
675
|
-
const validContentTypes = this.
|
|
846
|
+
const validContentTypes = this.ContentTypeOptions.filter(option => option.value !== '');
|
|
676
847
|
if (validContentTypes.length > 0) {
|
|
677
|
-
this.
|
|
848
|
+
this.NewTemplateContent.TypeID = validContentTypes[0].value;
|
|
678
849
|
}
|
|
679
|
-
this.
|
|
850
|
+
this.NewTemplateContent.TemplateText = '';
|
|
680
851
|
// Add immediately to the array
|
|
681
|
-
this.
|
|
682
|
-
this.
|
|
683
|
-
this.
|
|
852
|
+
this.TemplateContents.push(this.NewTemplateContent);
|
|
853
|
+
this.SelectedContentIndex = this.TemplateContents.length - 1;
|
|
854
|
+
this.IsAddingNewContent = true;
|
|
684
855
|
// Sync editor value when adding new content
|
|
685
856
|
this.syncEditorValue();
|
|
686
857
|
}
|
|
687
|
-
|
|
688
|
-
|
|
858
|
+
/** @deprecated Use {@link AddNewTemplateContent}. */
|
|
859
|
+
async addNewTemplateContent() {
|
|
860
|
+
return this.AddNewTemplateContent();
|
|
861
|
+
}
|
|
862
|
+
async DeleteTemplateContent(index) {
|
|
863
|
+
if (!this.config.allowEdit || index < 0 || index >= this.TemplateContents.length)
|
|
689
864
|
return;
|
|
690
|
-
const contentToDelete = this.
|
|
865
|
+
const contentToDelete = this.TemplateContents[index];
|
|
691
866
|
// Check if the entity is actually saved, not just if it has an ID
|
|
692
867
|
if (contentToDelete.IsSaved) {
|
|
693
868
|
try {
|
|
694
869
|
const result = await contentToDelete.Delete();
|
|
695
870
|
if (result) {
|
|
696
|
-
this.
|
|
871
|
+
this.TemplateContents.splice(index, 1);
|
|
697
872
|
// Adjust selected index if necessary
|
|
698
|
-
if (this.
|
|
699
|
-
this.
|
|
873
|
+
if (this.SelectedContentIndex >= this.TemplateContents.length) {
|
|
874
|
+
this.SelectedContentIndex = Math.max(0, this.TemplateContents.length - 1);
|
|
700
875
|
}
|
|
701
876
|
// If no contents remain, create a default one
|
|
702
|
-
if (this.
|
|
703
|
-
await this.
|
|
877
|
+
if (this.TemplateContents.length === 0) {
|
|
878
|
+
await this.CreateDefaultTemplateContent();
|
|
704
879
|
}
|
|
705
|
-
this.
|
|
880
|
+
this.ContentChange.emit(this.TemplateContents);
|
|
706
881
|
}
|
|
707
882
|
else {
|
|
708
883
|
MJNotificationService.Instance.CreateSimpleNotification(`Failed to delete template content. ${contentToDelete.LatestResult?.Message}`, 'error');
|
|
@@ -715,53 +890,77 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
715
890
|
}
|
|
716
891
|
else {
|
|
717
892
|
// Not saved yet, just remove from array
|
|
718
|
-
this.
|
|
719
|
-
if (this.
|
|
720
|
-
this.
|
|
893
|
+
this.TemplateContents.splice(index, 1);
|
|
894
|
+
if (this.SelectedContentIndex >= this.TemplateContents.length) {
|
|
895
|
+
this.SelectedContentIndex = Math.max(0, this.TemplateContents.length - 1);
|
|
721
896
|
}
|
|
722
897
|
// Reset adding new content state if we're deleting the new content
|
|
723
|
-
if (this.
|
|
724
|
-
this.
|
|
725
|
-
this.
|
|
898
|
+
if (this.IsAddingNewContent && index === this.TemplateContents.length) {
|
|
899
|
+
this.IsAddingNewContent = false;
|
|
900
|
+
this.NewTemplateContent = null;
|
|
726
901
|
}
|
|
727
|
-
this.
|
|
902
|
+
this.ContentChange.emit(this.TemplateContents);
|
|
728
903
|
}
|
|
729
904
|
}
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
905
|
+
/** @deprecated Use {@link DeleteTemplateContent}. */
|
|
906
|
+
async deleteTemplateContent(index) {
|
|
907
|
+
return this.DeleteTemplateContent(index);
|
|
908
|
+
}
|
|
909
|
+
get CurrentTemplateContent() {
|
|
910
|
+
if (this.IsAddingNewContent) {
|
|
911
|
+
return this.NewTemplateContent;
|
|
733
912
|
}
|
|
734
|
-
return this.
|
|
913
|
+
return this.TemplateContents[this.SelectedContentIndex] || null;
|
|
914
|
+
}
|
|
915
|
+
/** @deprecated Use {@link CurrentTemplateContent}. */
|
|
916
|
+
get currentTemplateContent() {
|
|
917
|
+
return this.CurrentTemplateContent;
|
|
918
|
+
}
|
|
919
|
+
get HasMultipleContents() {
|
|
920
|
+
return this.TemplateContents.length > 1 || this.IsAddingNewContent;
|
|
735
921
|
}
|
|
922
|
+
/** @deprecated Use {@link HasMultipleContents}. */
|
|
736
923
|
get hasMultipleContents() {
|
|
737
|
-
return this.
|
|
924
|
+
return this.HasMultipleContents;
|
|
738
925
|
}
|
|
739
|
-
|
|
926
|
+
OnContentTypeChange() {
|
|
740
927
|
// Content type changes just modify the current content, no new record creation
|
|
741
928
|
this.updateUnsavedChangesFlag();
|
|
742
929
|
}
|
|
743
|
-
|
|
930
|
+
/** @deprecated Use {@link OnContentTypeChange}. */
|
|
931
|
+
onContentTypeChange() {
|
|
932
|
+
return this.OnContentTypeChange();
|
|
933
|
+
}
|
|
934
|
+
OnContentChange() {
|
|
744
935
|
this.updateUnsavedChangesFlag();
|
|
745
936
|
}
|
|
937
|
+
/** @deprecated Use {@link OnContentChange}. */
|
|
938
|
+
onContentChange() {
|
|
939
|
+
return this.OnContentChange();
|
|
940
|
+
}
|
|
746
941
|
/**
|
|
747
942
|
* Updates the hasUnsavedChanges flag based on entity dirty states
|
|
748
943
|
*/
|
|
749
944
|
updateUnsavedChangesFlag() {
|
|
750
|
-
this.
|
|
751
|
-
this.
|
|
945
|
+
this.HasUnsavedChanges = this.TemplateContents.some(content => content.Dirty) ||
|
|
946
|
+
this.IsAddingNewContent;
|
|
752
947
|
}
|
|
753
|
-
|
|
948
|
+
OnTemplateTextChange(event) {
|
|
754
949
|
if (this.isUpdatingEditorValue) {
|
|
755
950
|
// Ignore change events when we're programmatically updating the editor
|
|
756
951
|
return;
|
|
757
952
|
}
|
|
758
|
-
if (this.
|
|
953
|
+
if (this.CurrentTemplateContent) {
|
|
759
954
|
// Extract value from event - might be event.target.value or just event depending on component
|
|
760
955
|
const value = typeof event === 'string' ? event : (event.target?.value || event);
|
|
761
|
-
this.
|
|
956
|
+
this.CurrentTemplateContent.TemplateText = value;
|
|
762
957
|
this.updateUnsavedChangesFlag();
|
|
763
958
|
}
|
|
764
959
|
}
|
|
960
|
+
/** @deprecated Use {@link OnTemplateTextChange}. */
|
|
961
|
+
onTemplateTextChange(event) {
|
|
962
|
+
return this.OnTemplateTextChange(event);
|
|
963
|
+
}
|
|
765
964
|
/**
|
|
766
965
|
* Helper method to track setTimeout calls for cleanup
|
|
767
966
|
*/
|
|
@@ -785,26 +984,26 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
785
984
|
Promise.resolve().then(() => {
|
|
786
985
|
// Then tracked setTimeout for the next macrotask to ensure DOM is updated
|
|
787
986
|
this.setTrackedTimeout(() => {
|
|
788
|
-
if (!this.
|
|
987
|
+
if (!this.CodeEditor) {
|
|
789
988
|
return;
|
|
790
989
|
}
|
|
791
990
|
this.isUpdatingEditorValue = true;
|
|
792
|
-
const newValue = this.
|
|
991
|
+
const newValue = this.CurrentTemplateContent?.TemplateText || '';
|
|
793
992
|
// Use the setValue method from mj-code-editor component
|
|
794
|
-
this.
|
|
993
|
+
this.CodeEditor.setValue(newValue);
|
|
795
994
|
this.isUpdatingEditorValue = false;
|
|
796
995
|
}, 0);
|
|
797
996
|
});
|
|
798
997
|
}
|
|
799
|
-
async
|
|
998
|
+
async SaveTemplateContents() {
|
|
800
999
|
if (!this.config.allowEdit)
|
|
801
1000
|
return false;
|
|
802
1001
|
try {
|
|
803
1002
|
// Ensure FK is set on all contents, then persist the dirty/new ones atomically
|
|
804
|
-
for (const content of this.
|
|
805
|
-
content.TemplateID = this.
|
|
1003
|
+
for (const content of this.TemplateContents) {
|
|
1004
|
+
content.TemplateID = this.Template.ID;
|
|
806
1005
|
}
|
|
807
|
-
const toSave = this.
|
|
1006
|
+
const toSave = this.TemplateContents.filter(c => c.Dirty || !c.ID);
|
|
808
1007
|
if (toSave.length > 0) {
|
|
809
1008
|
const tg = await this._metadata.CreateTransactionGroup();
|
|
810
1009
|
for (const content of toSave) {
|
|
@@ -817,10 +1016,10 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
817
1016
|
return false;
|
|
818
1017
|
}
|
|
819
1018
|
}
|
|
820
|
-
this.
|
|
821
|
-
this.
|
|
1019
|
+
this.IsAddingNewContent = false;
|
|
1020
|
+
this.NewTemplateContent = null;
|
|
822
1021
|
this.updateUnsavedChangesFlag();
|
|
823
|
-
this.
|
|
1022
|
+
this.ContentChange.emit(this.TemplateContents);
|
|
824
1023
|
return true;
|
|
825
1024
|
}
|
|
826
1025
|
catch (error) {
|
|
@@ -828,17 +1027,62 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
828
1027
|
return false;
|
|
829
1028
|
}
|
|
830
1029
|
}
|
|
831
|
-
|
|
1030
|
+
/**
|
|
1031
|
+
* The content rows a HOST FORM should persist inside its own save: every content that is new or
|
|
1032
|
+
* dirty, each stamped with the template's ID. Forms that embed this editor (Templates, AI Prompts)
|
|
1033
|
+
* call this from their `PopulatePendingRecords()` override, so the template and its contents
|
|
1034
|
+
* commit in one transaction and a content that fails validation blocks the save visibly instead
|
|
1035
|
+
* of being dropped on the floor. A brand-new content nobody typed into is not a change and is
|
|
1036
|
+
* skipped; a read-only editor contributes nothing.
|
|
1037
|
+
*/
|
|
1038
|
+
GetPendingChanges() {
|
|
1039
|
+
if (!this.config.allowEdit || !this.Template) {
|
|
1040
|
+
return [];
|
|
1041
|
+
}
|
|
1042
|
+
const pending = [];
|
|
1043
|
+
for (const content of this.TemplateContents) {
|
|
1044
|
+
// An unsaved entity always reports Dirty; the empty-text guard keeps a default row nobody used out.
|
|
1045
|
+
const untouchedNew = !content.IsSaved && !(content.TemplateText ?? '').trim();
|
|
1046
|
+
if (untouchedNew || !content.Dirty) {
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
1049
|
+
content.TemplateID = this.Template.ID;
|
|
1050
|
+
const item = new PendingRecordItem();
|
|
1051
|
+
item.entityObject = content;
|
|
1052
|
+
item.action = 'save';
|
|
1053
|
+
pending.push(item);
|
|
1054
|
+
}
|
|
1055
|
+
return pending;
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* The host form has persisted the rows from {@link GetPendingChanges}: clear the local dirty state
|
|
1059
|
+
* and publish the saved set to listeners.
|
|
1060
|
+
*/
|
|
1061
|
+
MarkContentsSaved() {
|
|
1062
|
+
this.IsAddingNewContent = false;
|
|
1063
|
+
this.NewTemplateContent = null;
|
|
1064
|
+
this.updateUnsavedChangesFlag();
|
|
1065
|
+
this.ContentChange.emit(this.TemplateContents);
|
|
1066
|
+
}
|
|
1067
|
+
/** @deprecated Use {@link SaveTemplateContents}. */
|
|
1068
|
+
async saveTemplateContents() {
|
|
1069
|
+
return this.SaveTemplateContents();
|
|
1070
|
+
}
|
|
1071
|
+
GetContentTypeDisplayText(typeId) {
|
|
832
1072
|
if (!typeId)
|
|
833
1073
|
return '-';
|
|
834
|
-
const option = this.
|
|
1074
|
+
const option = this.ContentTypeOptions.find(opt => opt.value === typeId);
|
|
835
1075
|
return option ? option.text : typeId;
|
|
836
1076
|
}
|
|
837
|
-
|
|
838
|
-
|
|
1077
|
+
/** @deprecated Use {@link GetContentTypeDisplayText}. */
|
|
1078
|
+
getContentTypeDisplayText(typeId) {
|
|
1079
|
+
return this.GetContentTypeDisplayText(typeId);
|
|
1080
|
+
}
|
|
1081
|
+
GetEditorLanguage() {
|
|
1082
|
+
if (!this.CurrentTemplateContent?.TypeID) {
|
|
839
1083
|
return 'jinja2'; // default to jinja2 for template syntax (compatible with Nunjucks)
|
|
840
1084
|
}
|
|
841
|
-
const contentType = this.
|
|
1085
|
+
const contentType = this.CurrentTemplateContent.TypeID.toLowerCase();
|
|
842
1086
|
// Map content types to CodeMirror language modes
|
|
843
1087
|
switch (contentType) {
|
|
844
1088
|
case 'html':
|
|
@@ -863,36 +1107,48 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
863
1107
|
return 'jinja2'; // Default to jinja2 since templates often contain template syntax
|
|
864
1108
|
}
|
|
865
1109
|
}
|
|
1110
|
+
/** @deprecated Use {@link GetEditorLanguage}. */
|
|
1111
|
+
getEditorLanguage() {
|
|
1112
|
+
return this.GetEditorLanguage();
|
|
1113
|
+
}
|
|
866
1114
|
/**
|
|
867
1115
|
* Test run the current template using the parameter dialog
|
|
868
1116
|
*/
|
|
869
|
-
async
|
|
870
|
-
if (!this.
|
|
1117
|
+
async OnRunTemplate() {
|
|
1118
|
+
if (!this.Template?.IsSaved || !this.CurrentTemplateContent) {
|
|
871
1119
|
MJNotificationService.Instance.CreateSimpleNotification('Please save the template before running it.', 'warning');
|
|
872
1120
|
return;
|
|
873
1121
|
}
|
|
874
1122
|
// Save any unsaved changes first
|
|
875
|
-
if (this.
|
|
876
|
-
const saveResult = await this.
|
|
1123
|
+
if (this.HasUnsavedChanges) {
|
|
1124
|
+
const saveResult = await this.SaveTemplateContents();
|
|
877
1125
|
if (!saveResult) {
|
|
878
1126
|
MJNotificationService.Instance.CreateSimpleNotification('Failed to save template changes.', 'error');
|
|
879
1127
|
return;
|
|
880
1128
|
}
|
|
881
1129
|
}
|
|
882
1130
|
// Emit the run template event
|
|
883
|
-
this.
|
|
1131
|
+
this.RunTemplate.emit(this.Template);
|
|
884
1132
|
}
|
|
885
|
-
|
|
1133
|
+
/** @deprecated Use {@link OnRunTemplate}. */
|
|
1134
|
+
async onRunTemplate() {
|
|
1135
|
+
return this.OnRunTemplate();
|
|
1136
|
+
}
|
|
1137
|
+
GetContentTypeOptionsForContent() {
|
|
886
1138
|
// Always exclude "Select Type..." option for all content
|
|
887
|
-
return this.
|
|
1139
|
+
return this.ContentTypeOptions.filter(option => option.value !== '');
|
|
1140
|
+
}
|
|
1141
|
+
/** @deprecated Use {@link GetContentTypeOptionsForContent}. */
|
|
1142
|
+
getContentTypeOptionsForContent() {
|
|
1143
|
+
return this.GetContentTypeOptionsForContent();
|
|
888
1144
|
}
|
|
889
1145
|
static { this.ɵfac = function TemplateEditorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TemplateEditorComponent)(i0.ɵɵdirectiveInject(i1.MJNotificationService), i0.ɵɵdirectiveInject(i2.MJConfirmService)); }; }
|
|
890
1146
|
static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TemplateEditorComponent, selectors: [["mj-template-editor"]], viewQuery: function TemplateEditorComponent_Query(rf, ctx) { if (rf & 1) {
|
|
891
1147
|
i0.ɵɵviewQuery(_c0, 5);
|
|
892
1148
|
} if (rf & 2) {
|
|
893
1149
|
let _t;
|
|
894
|
-
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.
|
|
895
|
-
} }, inputs: { template: "template", config: "config" }, outputs: { contentChange: "contentChange", runTemplate: "runTemplate" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["codeEditor", ""], [1, "template-editor", 2, "height", "100%", "display", "flex", "flex-direction", "column"], [1, "content-versions-tabs"], [1, "content-editor-container"], [1, "no-content-state"], [1, "content-tabs"], [1, "content-version-tab", 3, "active"], [1, "content-version-tab", "adding-new"], ["title", "Add new template content", 1, "content-version-tab", "add-new"], [1, "content-version-tab", 3, "click"], [2, "flex", "1"], [1, "tab-label"], [1, "tab-meta"], ["type", "button", "title", "Delete this content version", 1, "delete-btn"], [1, "inactive-label"], ["type", "button", "title", "Delete this content version", 1, "delete-btn", 3, "click"], [1, "fa-solid", "fa-trash", "fa-xs"], [1, "fa-solid", "fa-plus", "text-success"], [1, "new-label"], ["title", "Add new template content", 1, "content-version-tab", "add-new", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "content-metadata-bar"], [1, "metadata-grid"], [1, "form-group"], ["for", "contentType", 1, "form-label"], [1, "fa-solid", "fa-tag"], ["name", "contentType", "TextField", "text", "ValueField", "value", 3, "ngModel", "Data", "ValuePrimitive"], [1, "form-control-plaintext"], ["for", "priority", 1, "form-label"], [1, "fa-solid", "fa-sort-numeric-up"], ["name", "priority", 3, "ngModel", "Min", "Step", "Format"], [1, "form-label"], [1, "fa-solid", "fa-toggle-on"], [1, "form-check"], [1, "content-text-editor"], [1, "editor-header"], ["for", "templateContent", 1, "editor-label"], [1, "fa-solid", "fa-code"], [1, "content-type-badge"], [1, "editor-actions"], [1, "unsaved-indicator"], ["type", "button", "title", "Test run this template", 1, "run-btn", 3, "disabled"], [1, "code-editor-wrapper", 3, "change", "readonly", "language", "languages"], [1, "template-help-section"], ["name", "contentType", "TextField", "text", "ValueField", "value", 3, "ngModelChange", "ValueChange", "ngModel", "Data", "ValuePrimitive"], ["name", "priority", 3, "ngModelChange", "ngModel", "Min", "Step", "Format"], ["type", "checkbox", "id", "isActive", "name", "isActive", 1, "form-check-input", 3, "ngModelChange", "ngModel"], ["for", "isActive", 1, "form-check-label"], [1, "badge-success"], [1, "badge-secondary"], [1, "fa-solid", "fa-check-circle"], [1, "fa-solid", "fa-pause-circle"], [1, "fa-solid", "fa-circle"], ["type", "button", "title", "Test run this template", 1, "run-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-play"], [1, "help-tabs"], ["type", "button", 1, "help-tab", 3, "click"], [1, "fa-solid", "fa-at"], [1, "help-content"], [1, "syntax-help"], [1, "placeholders-help"], [1, "section-title"], [1, "fa-solid", "fa-lightbulb"], [1, "syntax-grid"], [1, "syntax-item"], [1, "placeholders-description"], [1, "category-tabs"], ["type", "button", 1, "category-tab", 3, "active"], [1, "placeholder-content"], [1, "usage-example"], [1, "usage-example-inner"], [1, "fa-solid", "fa-info-circle"], [1, "usage-example-text"], ["type", "button", 1, "category-tab", 3, "click"], [2, "font-size", "0.9em"], [1, "tab-badge"], [1, "category-header"], [1, "placeholder-grid"], [1, "placeholder-item"], [1, "placeholder-item-inner"], [1, "placeholder-name-row"], [1, "placeholder-code"], ["type", "button", "title", "Copy placeholder to clipboard", 1, "copy-btn", 3, "click"], [1, "fa-solid", "fa-copy"], [1, "placeholder-description"], [1, "fa-solid", "fa-file-plus"], ["type", "button", 1, "btn", "btn-primary"], ["type", "button", 1, "btn", "btn-primary", 3, "click"]], template: function TemplateEditorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
1150
|
+
i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.CodeEditor = _t.first);
|
|
1151
|
+
} }, inputs: { Template: "Template", template: "template", config: "config" }, outputs: { ContentChange: "ContentChange", contentChange: "contentChange", RunTemplate: "RunTemplate", runTemplate: "runTemplate" }, standalone: false, features: [i0.ɵɵInheritDefinitionFeature, i0.ɵɵNgOnChangesFeature], decls: 1, vars: 1, consts: [["codeEditor", ""], [1, "template-editor", 2, "height", "100%", "display", "flex", "flex-direction", "column"], [1, "content-versions-tabs"], [1, "content-editor-container"], [1, "no-content-state"], [1, "content-tabs"], [1, "content-version-tab", 3, "active"], [1, "content-version-tab", "adding-new"], ["title", "Add new template content", 1, "content-version-tab", "add-new"], [1, "content-version-tab", 3, "click"], [2, "flex", "1"], [1, "tab-label"], [1, "tab-meta"], ["type", "button", "title", "Delete this content version", 1, "delete-btn"], [1, "inactive-label"], ["type", "button", "title", "Delete this content version", 1, "delete-btn", 3, "click"], [1, "fa-solid", "fa-trash", "fa-xs"], [1, "fa-solid", "fa-plus", "text-success"], [1, "new-label"], ["title", "Add new template content", 1, "content-version-tab", "add-new", 3, "click"], [1, "fa-solid", "fa-plus"], [1, "content-metadata-bar"], [1, "metadata-grid"], [1, "form-group"], ["for", "contentType", 1, "form-label"], [1, "fa-solid", "fa-tag"], ["name", "contentType", "TextField", "text", "ValueField", "value", 3, "ngModel", "Data", "ValuePrimitive"], [1, "form-control-plaintext"], ["for", "priority", 1, "form-label"], [1, "fa-solid", "fa-sort-numeric-up"], ["name", "priority", 3, "ngModel", "Min", "Step", "Format"], [1, "form-label"], [1, "fa-solid", "fa-toggle-on"], [1, "form-check"], [1, "content-text-editor"], [1, "editor-header"], ["for", "templateContent", 1, "editor-label"], [1, "fa-solid", "fa-code"], [1, "content-type-badge"], [1, "editor-actions"], [1, "unsaved-indicator"], ["type", "button", "title", "Test run this template", 1, "run-btn", 3, "disabled"], [1, "code-editor-wrapper", 3, "change", "readonly", "language", "languages"], [1, "template-help-section"], ["name", "contentType", "TextField", "text", "ValueField", "value", 3, "ngModelChange", "ValueChange", "ngModel", "Data", "ValuePrimitive"], ["name", "priority", 3, "ngModelChange", "ngModel", "Min", "Step", "Format"], ["type", "checkbox", "id", "isActive", "name", "isActive", 1, "form-check-input", 3, "ngModelChange", "ngModel"], ["for", "isActive", 1, "form-check-label"], [1, "badge-success"], [1, "badge-secondary"], [1, "fa-solid", "fa-check-circle"], [1, "fa-solid", "fa-pause-circle"], [1, "fa-solid", "fa-circle"], ["type", "button", "title", "Test run this template", 1, "run-btn", 3, "click", "disabled"], [1, "fa-solid", "fa-spinner", "fa-spin"], [1, "fa-solid", "fa-play"], [1, "help-tabs"], ["type", "button", 1, "help-tab", 3, "click"], [1, "fa-solid", "fa-at"], [1, "help-content"], [1, "syntax-help"], [1, "placeholders-help"], [1, "section-title"], [1, "fa-solid", "fa-lightbulb"], [1, "syntax-grid"], [1, "syntax-item"], [1, "placeholders-description"], [1, "category-tabs"], ["type", "button", 1, "category-tab", 3, "active"], [1, "placeholder-content"], [1, "usage-example"], [1, "usage-example-inner"], [1, "fa-solid", "fa-info-circle"], [1, "usage-example-text"], ["type", "button", 1, "category-tab", 3, "click"], [2, "font-size", "0.9em"], [1, "tab-badge"], [1, "category-header"], [1, "placeholder-grid"], [1, "placeholder-item"], [1, "placeholder-item-inner"], [1, "placeholder-name-row"], [1, "placeholder-code"], ["type", "button", "title", "Copy placeholder to clipboard", 1, "copy-btn", 3, "click"], [1, "fa-solid", "fa-copy"], [1, "placeholder-description"], [1, "fa-solid", "fa-file-plus"], ["type", "button", 1, "btn", "btn-primary"], ["type", "button", 1, "btn", "btn-primary", 3, "click"]], template: function TemplateEditorComponent_Template(rf, ctx) { if (rf & 1) {
|
|
896
1152
|
i0.ɵɵconditionalCreate(0, TemplateEditorComponent_Conditional_0_Template, 4, 2, "div", 1);
|
|
897
1153
|
} if (rf & 2) {
|
|
898
1154
|
i0.ɵɵconditional(ctx.template ? 0 : -1);
|
|
@@ -901,17 +1157,23 @@ export class TemplateEditorComponent extends BaseAngularComponent {
|
|
|
901
1157
|
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TemplateEditorComponent, [{
|
|
902
1158
|
type: Component,
|
|
903
1159
|
args: [{ standalone: false, selector: 'mj-template-editor', template: "@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 \u2022 <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 <mj-dropdown [(ngModel)]=\"currentTemplateContent.TypeID\"\n name=\"contentType\"\n [Data]=\"getContentTypeOptionsForContent()\"\n TextField=\"text\"\n ValueField=\"value\"\n [ValuePrimitive]=\"true\"\n (ValueChange)=\"onContentTypeChange()\">\n </mj-dropdown>\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 <mj-numeric-input [(ngModel)]=\"currentTemplateContent.Priority\"\n name=\"priority\"\n [Min]=\"1\"\n [Step]=\"1\"\n [Format]=\"'n0'\">\n </mj-numeric-input>\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", styles: [".template-editor {\n font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;\n}\n\n.section-header h6 {\n font-size: 0.9em;\n}\n\n.param-row:hover {\n background-color: var(--mj-bg-surface-card) !important;\n}\n\n.content-item {\n transition: box-shadow 0.2s ease;\n}\n\n.content-item:hover {\n box-shadow: 0 2px 4px var(--mj-shadow-sm);\n}\n\n.loading-state {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 8px;\n}\n\n.empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 8px;\n}\n\n.badge {\n display: inline-block;\n font-size: 0.7em;\n line-height: 1;\n}\n\n/* Form control sizing */\n.template-editor .mj-input,\n.template-editor .mj-textarea,\n.template-editor mj-dropdown {\n width: 100%;\n}\n\n.template-editor [mjButton] {\n min-width: auto;\n}\n\n/* Content version tabs */\n.content-versions-tabs {\n margin-bottom: 16px;\n border-bottom: 2px solid var(--mj-border-default);\n padding-bottom: 8px;\n}\n\n.content-tabs {\n display: flex;\n gap: 6px;\n flex-wrap: wrap;\n}\n\n.content-version-tab {\n padding: 8px 12px;\n border: 1px solid var(--mj-border-strong);\n border-radius: 6px;\n cursor: pointer;\n background: var(--mj-bg-surface);\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n position: relative;\n}\n\n.content-version-tab.active {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n\n.content-version-tab .tab-label {\n font-weight: 600;\n font-size: 0.85em;\n color: var(--mj-text-secondary);\n}\n\n.content-version-tab .tab-meta {\n font-size: 0.7em;\n color: var(--mj-text-muted);\n}\n\n.content-version-tab .tab-meta .inactive-label {\n color: var(--mj-status-error);\n}\n\n.content-version-tab .delete-btn {\n background: none;\n border: none;\n color: var(--mj-status-error);\n padding: 4px;\n border-radius: 3px;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.content-version-tab .delete-btn:hover {\n background-color: var(--mj-status-error);\n color: var(--mj-text-inverse);\n}\n\n/* New content tab (adding state) */\n.content-version-tab.adding-new {\n border-color: var(--mj-status-success);\n background: color-mix(in srgb, var(--mj-status-success) 10%, var(--mj-bg-surface));\n}\n\n.content-version-tab.adding-new .new-label {\n font-weight: 600;\n color: var(--mj-status-success);\n font-size: 0.85em;\n}\n\n/* Add new content button */\n.content-version-tab.add-new {\n border: 1px dashed var(--mj-status-success);\n background: var(--mj-bg-surface-card);\n}\n\n.content-version-tab.add-new:hover {\n background: color-mix(in srgb, var(--mj-status-success) 8%, var(--mj-bg-surface));\n border-style: solid;\n}\n\n.content-version-tab.add-new i {\n color: var(--mj-status-success);\n font-size: 0.75em;\n}\n\n.content-version-tab.add-new span {\n font-weight: 500;\n color: var(--mj-status-success);\n font-size: 0.85em;\n}\n\n/* Content editor container */\n.content-editor-container {\n flex: 1;\n display: flex;\n flex-direction: column;\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n overflow: hidden;\n}\n\n/* Content metadata bar */\n.content-metadata-bar {\n background: var(--mj-bg-surface-card);\n border-bottom: 1px solid var(--mj-border-default);\n padding: 16px 20px;\n}\n\n.metadata-grid {\n display: grid;\n grid-template-columns: 2fr 1fr 1fr auto;\n gap: 20px;\n align-items: end;\n}\n\n.form-group {\n margin: 0;\n}\n\n.form-label {\n margin-bottom: 4px;\n font-size: 0.9em;\n font-weight: 600;\n color: var(--mj-text-primary);\n}\n\n.form-control-plaintext {\n font-size: 0.9em;\n padding: 4px 0;\n}\n\n.form-check {\n margin-top: 8px;\n}\n\n.form-check-label {\n font-size: 0.9em;\n}\n\n.badge-success {\n background: color-mix(in srgb, var(--mj-status-success) 15%, var(--mj-bg-surface));\n color: var(--mj-status-success);\n border: 1px solid color-mix(in srgb, var(--mj-status-success) 30%, transparent);\n padding: 3px 8px;\n border-radius: 10px;\n font-size: 0.75em;\n font-weight: 600;\n}\n\n.badge-secondary {\n background: color-mix(in srgb, var(--mj-text-muted) 15%, var(--mj-bg-surface));\n color: var(--mj-text-muted);\n border: 1px solid color-mix(in srgb, var(--mj-text-muted) 30%, transparent);\n padding: 3px 8px;\n border-radius: 10px;\n font-size: 0.75em;\n font-weight: 600;\n}\n\n/* Content text editor area */\n.content-text-editor {\n flex: 1;\n padding: 20px;\n display: flex;\n flex-direction: column;\n}\n\n.editor-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 12px;\n}\n\n.editor-label {\n margin: 0;\n font-weight: 600;\n display: flex;\n align-items: center;\n gap: 8px;\n}\n\n.content-type-badge {\n padding: 4px 8px;\n border-radius: 4px;\n font-size: 0.75em;\n color: var(--mj-text-inverse);\n}\n\n.content-type-badge.new {\n background: var(--mj-status-success);\n}\n\n.content-type-badge.existing {\n background: var(--mj-text-muted);\n}\n\n.editor-actions {\n display: flex;\n align-items: center;\n gap: 12px;\n}\n\n.unsaved-indicator {\n color: var(--mj-status-warning);\n font-size: 0.85em;\n display: flex;\n align-items: center;\n gap: 4px;\n}\n\n.unsaved-indicator i {\n font-size: 0.5em;\n}\n\n.run-btn {\n background: var(--mj-brand-primary);\n color: var(--mj-text-inverse);\n border: none;\n padding: 6px 12px;\n border-radius: 4px;\n font-size: 0.85em;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n cursor: pointer;\n}\n\n.run-btn:hover {\n background: var(--mj-brand-primary-hover);\n}\n\n/* Code editor border */\n.code-editor-wrapper {\n flex: 1;\n height: 350px;\n border: 1px solid var(--mj-border-strong);\n border-radius: 4px;\n}\n\n/* Help section tabs */\n.template-help-section {\n margin-top: 16px;\n}\n\n.help-tabs {\n display: flex;\n border-bottom: 2px solid var(--mj-border-default);\n margin-bottom: 0;\n}\n\n.help-tab {\n padding: 8px 16px;\n border: none;\n background: none;\n cursor: pointer;\n font-size: 0.9em;\n font-weight: 600;\n color: var(--mj-text-muted);\n border-bottom: 3px solid transparent;\n transition: all 0.2s;\n}\n\n.help-tab.active {\n color: var(--mj-status-success);\n border-bottom-color: var(--mj-status-success);\n}\n\n/* Help content area */\n.help-content {\n padding: 16px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-top: none;\n border-radius: 0 0 4px 4px;\n}\n\n/* Syntax help */\n.syntax-help {\n font-size: 0.85em;\n}\n\n.syntax-help .section-title {\n font-weight: 600;\n margin-bottom: 12px;\n color: var(--mj-status-success);\n}\n\n.syntax-grid {\n display: grid;\n grid-template-columns: 1fr 1fr;\n gap: 16px;\n}\n\n.syntax-item {\n margin-bottom: 8px;\n}\n\n.syntax-help code {\n background: var(--mj-bg-surface);\n padding: 4px 6px;\n border-radius: 3px;\n display: inline-block;\n margin-top: 4px;\n color: var(--mj-text-primary);\n}\n\n/* Placeholders help */\n.placeholders-help {\n font-size: 0.85em;\n}\n\n.placeholders-help .section-title {\n font-weight: 600;\n margin-bottom: 12px;\n color: var(--mj-status-success);\n}\n\n.placeholders-description {\n margin-bottom: 16px;\n color: var(--mj-text-secondary);\n line-height: 1.5;\n}\n\n/* Category tabs */\n.category-tabs {\n display: flex;\n gap: 8px;\n margin-bottom: 16px;\n flex-wrap: wrap;\n}\n\n.category-tab {\n padding: 6px 14px;\n border: 1px solid var(--mj-border-default);\n background: var(--mj-bg-surface);\n border-radius: 20px;\n cursor: pointer;\n font-size: 0.85em;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 6px;\n transition: all 0.2s;\n color: var(--mj-text-muted);\n}\n\n.category-tab.active {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n color: var(--mj-brand-primary);\n}\n\n.category-tab .tab-badge {\n background: color-mix(in srgb, var(--mj-text-primary) 10%, transparent);\n color: inherit;\n padding: 2px 6px;\n border-radius: 10px;\n font-size: 0.75em;\n margin-left: 4px;\n}\n\n/* Placeholder content area */\n.placeholder-content {\n background: var(--mj-bg-surface);\n border: 1px solid var(--mj-border-default);\n border-radius: 8px;\n padding: 16px;\n}\n\n.category-header {\n display: flex;\n align-items: center;\n gap: 8px;\n margin-bottom: 16px;\n}\n\n.category-header i {\n font-size: 1.2em;\n}\n\n.category-header h5 {\n margin: 0;\n color: var(--mj-text-primary);\n font-weight: 600;\n}\n\n.placeholder-grid {\n display: grid;\n gap: 10px;\n}\n\n/* Placeholder item */\n.placeholder-item {\n padding: 12px 16px;\n background: var(--mj-bg-surface-card);\n border: 1px solid var(--mj-border-default);\n border-radius: 6px;\n position: relative;\n transition: all 0.2s;\n max-width: 800px;\n}\n\n.placeholder-item:hover {\n border-color: var(--mj-brand-primary);\n background: color-mix(in srgb, var(--mj-brand-primary) 5%, var(--mj-bg-surface));\n}\n\n.placeholder-item:hover .copy-btn {\n opacity: 1 !important;\n}\n\n.placeholder-item-inner {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n}\n\n.placeholder-name-row {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n}\n\n.placeholder-code {\n color: var(--mj-status-error);\n font-weight: 600;\n font-size: 0.95em;\n}\n\n.copy-btn {\n opacity: 0;\n transition: opacity 0.2s;\n background: none;\n border: none;\n padding: 4px 8px;\n cursor: pointer;\n color: var(--mj-brand-primary);\n border-radius: 4px;\n display: inline-flex;\n align-items: center;\n}\n\n.copy-btn:hover {\n background: color-mix(in srgb, var(--mj-brand-primary) 10%, var(--mj-bg-surface));\n}\n\n.copy-btn i {\n font-size: 0.85em;\n}\n\n.placeholder-description {\n color: var(--mj-text-muted);\n margin-top: 4px;\n line-height: 1.4;\n}\n\n/* Usage example box */\n.usage-example {\n margin-top: 20px;\n padding: 12px;\n background: color-mix(in srgb, var(--mj-brand-primary) 8%, var(--mj-bg-surface));\n border-radius: 6px;\n border: 1px solid color-mix(in srgb, var(--mj-brand-primary) 20%, var(--mj-bg-surface));\n}\n\n.usage-example-inner {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n}\n\n.usage-example i {\n color: var(--mj-brand-primary);\n margin-top: 2px;\n}\n\n.usage-example-text {\n flex: 1;\n font-size: 0.85em;\n color: var(--mj-brand-primary);\n line-height: 1.5;\n}\n\n.usage-example code {\n background: var(--mj-bg-surface);\n padding: 2px 4px;\n border-radius: 3px;\n}\n\n/* No content state */\n.no-content-state {\n flex: 1;\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n background: var(--mj-bg-surface-card);\n border: 2px dashed var(--mj-border-default);\n border-radius: 8px;\n padding: 40px;\n text-align: center;\n}\n\n.no-content-state i {\n font-size: 48px;\n margin-bottom: 16px;\n color: var(--mj-text-muted);\n opacity: 0.6;\n}\n\n.no-content-state h5 {\n color: var(--mj-text-secondary);\n margin-bottom: 8px;\n}\n\n.no-content-state p {\n color: var(--mj-text-muted);\n margin-bottom: 20px;\n}\n"] }]
|
|
904
|
-
}], () => [{ type: i1.MJNotificationService }, { type: i2.MJConfirmService }], {
|
|
1160
|
+
}], () => [{ type: i1.MJNotificationService }, { type: i2.MJConfirmService }], { Template: [{
|
|
1161
|
+
type: Input
|
|
1162
|
+
}], template: [{
|
|
905
1163
|
type: Input
|
|
906
1164
|
}], config: [{
|
|
907
1165
|
type: Input
|
|
1166
|
+
}], ContentChange: [{
|
|
1167
|
+
type: Output
|
|
908
1168
|
}], contentChange: [{
|
|
909
1169
|
type: Output
|
|
1170
|
+
}], RunTemplate: [{
|
|
1171
|
+
type: Output
|
|
910
1172
|
}], runTemplate: [{
|
|
911
1173
|
type: Output
|
|
912
|
-
}],
|
|
1174
|
+
}], CodeEditor: [{
|
|
913
1175
|
type: ViewChild,
|
|
914
1176
|
args: ['codeEditor']
|
|
915
1177
|
}] }); })();
|
|
916
|
-
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TemplateEditorComponent, { className: "TemplateEditorComponent", filePath: "src/lib/shared/components/template-editor.component.ts", lineNumber:
|
|
1178
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TemplateEditorComponent, { className: "TemplateEditorComponent", filePath: "src/lib/shared/components/template-editor.component.ts", lineNumber: 29 }); })();
|
|
917
1179
|
//# sourceMappingURL=template-editor.component.js.map
|