Skip to content

Commit d674d19

Browse files
committed
2.0.2
1 parent cbed78d commit d674d19

File tree

11 files changed

+1459
-250
lines changed

11 files changed

+1459
-250
lines changed

.DS_Store

2 KB
Binary file not shown.

README.md

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
11
# MultiLineDiff
22

33
[![Swift 6.1](https://img.shields.io/badge/Swift-6.1-orange.svg)](https://swift.org)
4-
[![Website](https://img.shields.io/badge/website-xcf.ai-blue.svg)](https://xcf.ai)
5-
[![Version](https://img.shields.io/badge/version-2.0.1-green.svg)](https://github.com/toddbruss/swift-multi-line-diff)
4+
[![Website](https://img.shields.io/badge/website-d1f.ai-blue.svg)](https://d1f.ai)
5+
[![Live Demo](https://img.shields.io/badge/demo-interactive-green.svg)](https://d1f.ai#demo)
6+
[![Version](https://img.shields.io/badge/version-2.0.1-green.svg)](https://github.com/codefreezeai/swift-multi-line-diff)
67
[![GitHub stars](https://img.shields.io/github/stars/codefreezeai/swift-multi-line-diff.svg?style=social)](https://github.com/codefreezeai/swift-multi-line-diff/stargazers)
78
[![GitHub forks](https://img.shields.io/github/forks/codefreezeai/swift-multi-line-diff.svg?style=social)](https://github.com/codefreezeai/swift-multi-line-diff/network)
89

910
# Swift MultiLineDiff Package Usage Guide
1011

12+
## 🌐 Interactive Demo
13+
14+
**🚀 Try the Live Demo**: [d1f.ai](https://d1f.ai)
15+
16+
Experience the power of MultiLineDiff algorithms in real-time with our interactive JavaScript implementation:
17+
18+
- **⚡ Flash Algorithm**: Lightning-fast prefix/suffix detection (14.5ms)
19+
- **🤖 Optimus Algorithm**: Line-aware CollectionDifference processing (43.7ms)
20+
- **🧠 Megatron Algorithm**: Semantic analysis with balanced performance (47.8ms)
21+
- **🌟 Starscream Algorithm**: Swift-native line processing (45.1ms)
22+
- **🔍 Zoom Algorithm**: Simple character-based diffing (23.9ms)
23+
24+
**Real-time Performance Monitoring**: Watch actual algorithm execution times as you type!
25+
1126
## 📦 Package Information
1227

1328
**Repository**: [CodeFreezeAI/swift-multi-line-diff](https://github.com/CodeFreezeAI/swift-multi-line-diff.git)
29+
**Website**: [d1f.ai](https://d1f.ai) - Interactive Demo & Documentation
1430
**License**: MIT
1531
**Language**: Swift 100%
1632
**Latest Release**: v2.0.1 (May 26, 2025)
@@ -525,12 +541,15 @@ This Swift library enables creating and applying diffs to multi-line text conten
525541

526542
## 🌟 Key Features
527543

544+
- **🌐 Interactive Website Demo**: [d1f.ai](https://d1f.ai) with real JavaScript algorithms
545+
- **⚡ Five Powerful Algorithms**: Flash, Optimus, Megatron, Starscream, Zoom
546+
- **🎯 Real-time Performance**: Live timing display showing actual execution speeds
528547
- Create diffs between two strings
529548
- Apply diffs to transform source text
530549
- Handle multi-line content properly
531550
- Support for Unicode/UTF-8 strings
532-
- Multiple diff formats (JSON, Base64)
533-
- Two superior diff algorithms (Flash and Optimus)
551+
- Multiple diff formats (JSON, Base64, ASCII)
552+
- **🤖 AI-Native ASCII Format**: Perfect for LLM integration
534553
- **Automatic algorithm fallback with verification** 🛡️
535554
- **Auto-detection of truncated vs full source** 🤖
536555
- **Intelligent application without manual parameters** 🧠

website/LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 SuperBox64
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

website/css/components.css

Lines changed: 112 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -599,9 +599,15 @@
599599
display: flex;
600600
justify-content: space-between;
601601
align-items: center;
602-
padding: var(--space-lg);
602+
padding: var(--space-md) var(--space-lg);
603+
background: var(--bg-tertiary);
604+
border-bottom: 1px solid var(--border-primary);
605+
}
606+
607+
.demo-output .panel-header {
603608
background: var(--bg-tertiary);
604609
border-bottom: 1px solid var(--border-primary);
610+
padding: var(--space-md) var(--space-lg);
605611
}
606612

607613
.panel-header h4 {
@@ -613,13 +619,13 @@
613619
.demo-textarea {
614620
flex: 1;
615621
min-height: 300px;
616-
padding: var(--space-lg);
622+
padding: var(--space-md);
617623
background: var(--bg-code);
618624
border: none;
619625
color: var(--text-primary);
620626
font-family: var(--font-mono);
621-
font-size: 0.875rem;
622-
line-height: 1.6;
627+
font-size: 0.7rem;
628+
line-height: 1.4;
623629
resize: none;
624630
outline: none;
625631
}
@@ -634,14 +640,52 @@
634640

635641
.demo-output-content {
636642
flex: 1;
637-
min-height: 300px;
638-
padding: var(--space-lg);
643+
padding: var(--space-md);
644+
margin-top: 0;
639645
background: var(--bg-code);
640646
font-family: var(--font-mono);
641-
font-size: 0.875rem;
642-
line-height: 1.6;
647+
font-size: 0.7rem;
648+
line-height: 1.4;
643649
overflow-x: auto;
644650
white-space: pre-wrap;
651+
word-wrap: break-word;
652+
word-break: break-all;
653+
display: flex;
654+
flex-direction: column;
655+
}
656+
657+
.demo-output-content pre {
658+
background: transparent !important;
659+
padding: 0 !important;
660+
margin: 0 !important;
661+
border-radius: 0 !important;
662+
overflow-x: auto;
663+
flex: 1;
664+
display: flex;
665+
align-items: flex-start;
666+
}
667+
668+
.demo-output-content pre code {
669+
padding: 0 !important;
670+
margin: 0 !important;
671+
background: transparent !important;
672+
}
673+
674+
/* Base64 output specific styling with text wrapping */
675+
.demo-output-content .base64-output {
676+
white-space: pre-wrap !important;
677+
word-wrap: break-word !important;
678+
word-break: break-all !important;
679+
overflow-wrap: break-word !important;
680+
}
681+
682+
.demo-output-content .base64-output code {
683+
white-space: pre-wrap !important;
684+
word-wrap: break-word !important;
685+
word-break: break-all !important;
686+
overflow-wrap: break-word !important;
687+
font-family: var(--font-mono);
688+
line-height: 1.5;
645689
}
646690

647691
.placeholder {
@@ -650,6 +694,7 @@
650694
align-items: center;
651695
justify-content: center;
652696
height: 100%;
697+
min-height: 300px;
653698
color: var(--text-muted);
654699
text-align: center;
655700
}
@@ -661,12 +706,32 @@
661706
}
662707

663708
.output-stats {
664-
display: grid;
665-
grid-template-columns: 1fr 1fr;
666-
gap: var(--space-md);
709+
display: flex;
710+
justify-content: center;
667711
font-size: 0.75rem;
668712
}
669713

714+
.stats-grid {
715+
display: grid;
716+
grid-template-columns: 1fr 1fr 1fr;
717+
grid-template-rows: 1fr 1fr;
718+
gap: var(--space-sm);
719+
align-items: center;
720+
justify-items: center;
721+
width: 360px;
722+
grid-template-areas:
723+
"button algorithm timing"
724+
"accuracy format ops";
725+
}
726+
727+
.diff-button { grid-area: button; }
728+
.algorithm-badge { grid-area: algorithm; }
729+
.timing-badge { grid-area: timing; }
730+
.success-badge { grid-area: accuracy; }
731+
.error-badge { grid-area: accuracy; }
732+
.format-badge { grid-area: format; }
733+
.ops-badge { grid-area: ops; }
734+
670735
.output-stats .stat-badge {
671736
padding: var(--space-sm) var(--space-md);
672737
background: linear-gradient(135deg, var(--bg-tertiary) 0%, var(--bg-card) 100%);
@@ -678,6 +743,16 @@
678743
position: relative;
679744
overflow: hidden;
680745
box-shadow: var(--shadow-sm);
746+
min-width: 110px;
747+
width: 110px;
748+
min-height: 40px;
749+
display: flex;
750+
align-items: center;
751+
justify-content: center;
752+
text-align: center;
753+
white-space: nowrap;
754+
overflow: hidden;
755+
text-overflow: ellipsis;
681756
}
682757

683758
.output-stats .stat-badge::before {
@@ -1174,24 +1249,38 @@
11741249
/* AI Format - Uses Prism.js Swift syntax highlighting */
11751250
/* No additional styling needed - Prism.js handles everything */
11761251

1177-
/* Terminal Colors Format - Pure terminal colors with fade backgrounds */
1178-
.terminal-colors {
1179-
color: var(--text-primary) !important; /* Default white text */
1252+
1253+
1254+
/* Real-time diff output styling */
1255+
.demo-output-content .ascii-diff {
1256+
font-family: var(--font-mono);
1257+
line-height: 1.6;
1258+
white-space: pre-wrap;
1259+
word-wrap: break-word;
11801260
}
11811261

1182-
.terminal-colors .retain {
1183-
color: #60a5fa !important; /* Blue for terminal */
1184-
background: rgba(96, 165, 250, 0.1) !important; /* Subtle blue background */
1262+
.demo-output-content .ascii-diff .retain {
1263+
color: #60a5fa;
1264+
background: rgba(96, 165, 250, 0.1);
1265+
display: block;
1266+
padding: 1px 4px;
1267+
margin: 1px 0;
11851268
}
11861269

1187-
.terminal-colors .delete {
1188-
color: #ef4444 !important; /* Red for terminal */
1189-
background: rgba(239, 68, 68, 0.1) !important; /* Subtle red background */
1270+
.demo-output-content .ascii-diff .delete {
1271+
color: #ef4444;
1272+
background: rgba(239, 68, 68, 0.1);
1273+
display: block;
1274+
padding: 1px 4px;
1275+
margin: 1px 0;
11901276
}
11911277

1192-
.terminal-colors .insert {
1193-
color: #10b981 !important; /* Green for terminal */
1194-
background: rgba(16, 185, 129, 0.1) !important; /* Subtle green background */
1278+
.demo-output-content .ascii-diff .insert {
1279+
color: #10b981;
1280+
background: rgba(16, 185, 129, 0.1);
1281+
display: block;
1282+
padding: 1px 4px;
1283+
margin: 1px 0;
11951284
}
11961285

11971286
/* Loading States */

website/css/styles.css

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,11 @@ a:hover {
194194
}
195195

196196
.btn-small {
197-
padding: var(--space-sm) var(--space-md);
197+
padding: var(--space-sm) var(--space-sm);
198198
font-size: 0.875rem;
199199
border-radius: var(--radius-md);
200+
min-width: auto;
201+
white-space: nowrap;
200202
}
201203

202204
/* Navigation */

0 commit comments

Comments
 (0)