diff --git a/Mermaid_Selector.html b/Mermaid_Selector.html index 28a67c6..30040a2 100644 --- a/Mermaid_Selector.html +++ b/Mermaid_Selector.html @@ -355,9 +355,9 @@ graph TD - - - + + + @@ -638,18 +638,119 @@ graph TD clonedSvg.setAttribute('xmlns', 'http://www.w3.org/2000/svg'); clonedSvg.setAttribute('xmlns:xlink', 'http://www.w3.org/1999/xlink'); - // Add embedded style for standard fonts - const styleElement = document.createElementNS('http://www.w3.org/2000/svg', 'style'); - styleElement.textContent = ` - text { - font-family: Arial, Helvetica, Verdana, sans-serif !important; - font-size: 14px !important; + // Convert foreignObject elements to native SVG text (Word doesn't support foreignObject) + const foreignObjects = clonedSvg.querySelectorAll('foreignObject'); + foreignObjects.forEach(fo => { + const foText = fo.textContent || ''; + if (foText.trim()) { + const textElement = document.createElementNS('http://www.w3.org/2000/svg', 'text'); + + // Handle multi-line text by splitting into tspan elements + const lines = foText.trim().split('\n').filter(line => line.trim()); + + // Copy position attributes + const x = fo.getAttribute('x') || '0'; + const y = fo.getAttribute('y') || '0'; + const width = fo.getAttribute('width') || '100'; + const height = fo.getAttribute('height') || '20'; + + const centerX = parseFloat(x) + parseFloat(width)/2; + const centerY = parseFloat(y) + parseFloat(height)/2; + + textElement.setAttribute('x', centerX); + textElement.setAttribute('y', centerY); + textElement.setAttribute('text-anchor', 'middle'); + textElement.setAttribute('dominant-baseline', 'middle'); + textElement.setAttribute('font-family', 'Arial, Helvetica, sans-serif'); + textElement.setAttribute('font-size', '14px'); + textElement.setAttribute('fill', 'black'); + textElement.setAttribute('stroke', 'none'); + + if (lines.length === 1) { + textElement.textContent = lines[0]; + } else { + // Multi-line text + lines.forEach((line, index) => { + const tspan = document.createElementNS('http://www.w3.org/2000/svg', 'tspan'); + tspan.textContent = line; + tspan.setAttribute('x', centerX); + tspan.setAttribute('dy', index === 0 ? '0' : '1.2em'); + textElement.appendChild(tspan); + }); + } + + // Replace foreignObject with text + fo.parentNode.replaceChild(textElement, fo); + } else { + fo.remove(); } - .nodeLabel, .edgeLabel { - font-family: Arial, Helvetica, Verdana, sans-serif !important; + }); + + // ONLY process text elements - leave shapes and paths untouched + const allTextElements = clonedSvg.querySelectorAll('text'); + allTextElements.forEach((textElement, index) => { + // Remove contentEditable + textElement.removeAttribute('contentEditable'); + + // Only add missing font attributes, don't modify existing ones + if (!textElement.hasAttribute('font-family')) { + textElement.setAttribute('font-family', 'Arial, Helvetica, sans-serif'); } - `; - clonedSvg.insertBefore(styleElement, clonedSvg.firstChild); + if (!textElement.hasAttribute('font-size')) { + textElement.setAttribute('font-size', '14px'); + } + if (!textElement.hasAttribute('fill')) { + textElement.setAttribute('fill', 'black'); + } + + // Only clean up pointer-events and user-select from style, keep everything else + const styleAttr = textElement.getAttribute('style'); + if (styleAttr) { + const cleanedStyles = styleAttr.split(';') + .filter(s => { + const trimmed = s.trim(); + return trimmed && + !trimmed.startsWith('pointer-events') && + !trimmed.startsWith('user-select') && + !trimmed.startsWith('-webkit-user-select') && + !trimmed.startsWith('-moz-user-select'); + }) + .join('; '); + + if (cleanedStyles) { + textElement.setAttribute('style', cleanedStyles); + } else { + textElement.removeAttribute('style'); + } + } + }); + + // Process tspan elements - minimal changes + const allTspanElements = clonedSvg.querySelectorAll('tspan'); + allTspanElements.forEach(tspan => { + tspan.removeAttribute('contentEditable'); + + // Only clean up pointer-events and user-select + const styleAttr = tspan.getAttribute('style'); + if (styleAttr) { + const cleanedStyles = styleAttr.split(';') + .filter(s => { + const trimmed = s.trim(); + return trimmed && + !trimmed.startsWith('pointer-events') && + !trimmed.startsWith('user-select') && + !trimmed.startsWith('-webkit-user-select') && + !trimmed.startsWith('-moz-user-select'); + }) + .join('; '); + + if (cleanedStyles) { + tspan.setAttribute('style', cleanedStyles); + } else { + tspan.removeAttribute('style'); + } + } + }); // Get SVG dimensions const bbox = svg.getBBox(); @@ -684,7 +785,7 @@ graph TD // Cleanup URL.revokeObjectURL(url); - showMessage('✅ Diagram exported as SVG', 'success'); + showMessage('✅ SVG exported - Optimized for Word/PDF with full text compatibility', 'success'); } catch (error) { showMessage('❌ Error: ' + error.message, 'error'); console.error('SVG export error:', error); diff --git a/Royal Enfield Documentation.docx b/Royal Enfield Documentation.docx index f85504a..059cbe2 100644 Binary files a/Royal Enfield Documentation.docx and b/Royal Enfield Documentation.docx differ diff --git a/Royal Enfield Documentation_11.pdf b/Royal Enfield Documentation_11.pdf new file mode 100644 index 0000000..06673ed Binary files /dev/null and b/Royal Enfield Documentation_11.pdf differ diff --git a/approval_hierarchy.mermaid b/approval_hierarchy.mermaid index 1e16da5..07cff39 100644 --- a/approval_hierarchy.mermaid +++ b/approval_hierarchy.mermaid @@ -1,9 +1,9 @@ graph TD -DDT[DD Team
First point of contact,
Initial processing] --> ZM[ZM
Evaluates and Approves/Rejects] -ZM --> RBM[RBM
Reviews ZM-approved applications,
Makes final decisions] -RBM --> DDL[DDL
Evaluates RBM-approved applications
and Forwards to Finance] -DDL --> FDD[FDD Team
Financial Due Diligence
and Document Submission] -FDD --> NBH[NBH
Final Review and Approval] -NBH --> Legal[Legal
Handles Legal Documentation
and Compliance] -Legal --> SuperAdmin[Super Admin
Full Oversight and Management] +DDT[DD Team - First point of contact, Initial processing] --> ZM[ZM - Evaluates and Approves/Rejects] +ZM --> RBM[RBM - Reviews ZM-approved applications, Makes final decisions] +RBM --> DDL[DDL - Evaluates RBM-approved applications and Forwards to Finance] +DDL --> FDD[FDD Team - Financial Due Diligence and Document Submission] +FDD --> NBH[NBH - Final Review and Approval] +NBH --> Legal[Legal - Handles Legal Documentation and Compliance] +Legal --> SuperAdmin[Super Admin - Full Oversight and Management] diff --git a/settlment_diagram.mermaid b/settlment_diagram.mermaid index e14105c..12c92eb 100644 --- a/settlment_diagram.mermaid +++ b/settlment_diagram.mermaid @@ -1,13 +1,13 @@ graph TD %% ===== Start ===== - Start([🟢 Start: Dealer Claim Process]) --> RI[1️⃣ Request Initiation
Requestor
Submits activity request
with dealer info, type, date, location, and details] + Start([🟢 Start: Dealer Claim Process]) --> RI[1️⃣ Request Initiation - Requestor - Submits activity request with dealer info, type, date, location, and details] %% ===== Proposal Submission ===== - RI --> PS[2️⃣ Proposal Submission
Dealer
Submits proposal with
cost breakup, timeline,
and supporting documents] + RI --> PS[2️⃣ Proposal Submission - Dealer - Submits proposal with cost breakup, timeline, and supporting documents] %% ===== Request Evaluation ===== - PS --> RE[3️⃣ Request Evaluation
Requestor
Reviews dealer proposal
and adds comments] + PS --> RE[3️⃣ Request Evaluation - Requestor - Reviews dealer proposal and adds comments] RE --> RE_Decision{Proposal Satisfactory?} RE_Decision -->|❌ Needs Clarification| RE_Clarify[Requestor Requests Clarification] @@ -15,22 +15,22 @@ graph TD RE_Decision -->|✅ Confirmed to Proceed| DLA %% ===== Department Lead Approval ===== - DLA[4️⃣ Department Lead Approval
Dept. Lead
Reviews and Approves Request] --> DLA_Decision{Lead Decision} + DLA[4️⃣ Department Lead Approval - Dept. Lead - Reviews and Approves Request] --> DLA_Decision{Lead Decision} DLA_Decision -->|❌ Needs Clarification| DLA_Clarify[Lead Requests Clarification] DLA_Clarify --> RE DLA_Decision -->|✅ Approved| BUD %% ===== Budgeting ===== - BUD[5️⃣ Budgeting
Finance or System
Blocks budget under IO Internal Order] --> AC + BUD[5️⃣ Budgeting - Finance or System - Blocks budget under IO Internal Order] --> AC %% ===== Activity Creation ===== - AC[6️⃣ Activity Creation
System
Creates Activity and Sends Notifications
to Requestor, Dealer and Lead] --> AE + AC[6️⃣ Activity Creation - System - Creates Activity and Sends Notifications to Requestor, Dealer and Lead] --> AE %% ===== Activity Execution ===== - AE[7️⃣ Activity Execution
Dealer
Executes Activity
and Uploads Proof Documents] --> CA + AE[7️⃣ Activity Execution - Dealer - Executes Activity and Uploads Proof Documents] --> CA %% ===== Claim Approval ===== - CA[8️⃣ Claim Approval
Requestor
Reviews submitted documents] --> CA_Decision{Documents OK?} + CA[8️⃣ Claim Approval - Requestor - Reviews submitted documents] --> CA_Decision{Documents OK?} CA_Decision -->|❌ Needs More Info| CA_Clarify[Requestor Requests Additional Information] CA_Clarify --> AE CA_Decision -->|✅ Approved| CA_Type{Approval Type} @@ -38,7 +38,7 @@ graph TD CA_Type -->|Partial Approval| EI %% ===== E-Invoicing ===== - EI[9️⃣ E-Invoicing
Finance or System
Generates E-Invoice
and Issues Credit Note] --> End([✅ Claim Settled
Process Completed]) + EI[9️⃣ E-Invoicing - Finance or System - Generates E-Invoice and Issues Credit Note] --> End([✅ Claim Settled - Process Completed]) %% ===== Styles ===== style RI fill:#e3f2fd,stroke:#2196f3,stroke-width:2px,color:#000 diff --git a/~$yal Enfield Documentation.docx b/~$yal Enfield Documentation.docx index 7b7556b..55a8afe 100644 Binary files a/~$yal Enfield Documentation.docx and b/~$yal Enfield Documentation.docx differ diff --git a/~WRL1115.tmp b/~WRL1115.tmp deleted file mode 100644 index 237be1a..0000000 Binary files a/~WRL1115.tmp and /dev/null differ