diff --git a/Package.swift b/Package.swift index 7f11241..0a0c62a 100644 --- a/Package.swift +++ b/Package.swift @@ -1,11 +1,11 @@ -// swift-tools-version: 5.7 +// swift-tools-version: 5.9 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "Quilt", - platforms: [.iOS(.v14), .macOS(.v12), .watchOS(.v4)], + platforms: [.macOS(.v12)], products: [ // Products define the executables and libraries a package produces, and make them visible to other packages. .library( diff --git a/Sources/Quilt/Array+safeIndex.swift b/Sources/Quilt/Array+safeIndex.swift index 142e727..6fe9c55 100644 --- a/Sources/Quilt/Array+safeIndex.swift +++ b/Sources/Quilt/Array+safeIndex.swift @@ -1,10 +1,3 @@ -// -// Array+safeIndex.swift -// -// -// Created by Theodore Lampert on 08.12.22. -// - public extension Array { subscript(safeIndex index: Int) -> Element? { guard index >= 0, index < endIndex else { diff --git a/Sources/Quilt/MarkType.swift b/Sources/Quilt/MarkType.swift index 24c6929..ec266b2 100644 --- a/Sources/Quilt/MarkType.swift +++ b/Sources/Quilt/MarkType.swift @@ -1,10 +1,3 @@ -// -// MarkType.swift -// -// -// Created by Theodore Lampert on 15.12.22. -// - public enum MarkType: Codable, Equatable { case bold case italic diff --git a/Sources/Quilt/NSAttributedString+Extensions.swift b/Sources/Quilt/NSAttributedString+Extensions.swift index dc109b5..0552bc7 100644 --- a/Sources/Quilt/NSAttributedString+Extensions.swift +++ b/Sources/Quilt/NSAttributedString+Extensions.swift @@ -1,10 +1,3 @@ -// -// NSAttributedString+Extensions.swift -// -// -// Created by Theodore Lampert on 15.05.23. -// - import Foundation public extension NSAttributedString { diff --git a/Sources/Quilt/NSMutableAttributedString+Extensions.swift b/Sources/Quilt/NSMutableAttributedString+Extensions.swift index 7a1db45..a373c9b 100644 --- a/Sources/Quilt/NSMutableAttributedString+Extensions.swift +++ b/Sources/Quilt/NSMutableAttributedString+Extensions.swift @@ -1,10 +1,3 @@ -// -// NSMutableAttributedString+setTextAttribute.swift -// -// -// Created by Theodore Lampert on 15.05.23. -// - import Foundation public extension NSMutableAttributedString { diff --git a/Sources/Quilt/OpID.swift b/Sources/Quilt/OpID.swift index 318f3aa..5663bc9 100644 --- a/Sources/Quilt/OpID.swift +++ b/Sources/Quilt/OpID.swift @@ -1,10 +1,3 @@ -// -// OpID.swift -// -// -// Created by Theodore Lampert on 15.12.22. -// - import Foundation public struct OpID: Comparable, Hashable, Codable, Equatable, CustomStringConvertible { diff --git a/Sources/Quilt/OpType.swift b/Sources/Quilt/OpType.swift index c88f212..9eec9e3 100644 --- a/Sources/Quilt/OpType.swift +++ b/Sources/Quilt/OpType.swift @@ -1,10 +1,3 @@ -// -// OpType.swift -// -// -// Created by Theodore Lampert on 15.12.22. -// - public enum OpType: Codable, Equatable { case insert(String) case remove(OpID) diff --git a/Sources/Quilt/Operation.swift b/Sources/Quilt/Operation.swift index 858b00a..924205b 100644 --- a/Sources/Quilt/Operation.swift +++ b/Sources/Quilt/Operation.swift @@ -1,10 +1,3 @@ -// -// Operation.swift -// -// -// Created by Theodore Lampert on 15.12.22. -// - public struct Operation: Identifiable, Codable, Equatable { public var id: OpID { opId } diff --git a/Sources/Quilt/Quilt.swift b/Sources/Quilt/Quilt.swift index bbcce4b..872da89 100644 --- a/Sources/Quilt/Quilt.swift +++ b/Sources/Quilt/Quilt.swift @@ -1,5 +1,4 @@ import Foundation -import SwiftUI public struct Quilt: Codable { private var counter: Int = 0 @@ -18,6 +17,7 @@ public struct Quilt: Codable { /* Optimisation: Assume that text is inserted and removed sequentially and cache the last known index to avoid scanning the whole document. + This was cribbed from how Y.js does it. */ var lastIdx: (OpID, Int)? diff --git a/Sources/Quilt/QuiltString+Extensions.swift b/Sources/Quilt/QuiltString+Extensions.swift index 01ab48d..9dca96f 100644 --- a/Sources/Quilt/QuiltString+Extensions.swift +++ b/Sources/Quilt/QuiltString+Extensions.swift @@ -1,10 +1,3 @@ -// -// QuiltString.swift -// -// -// Created by Theodore Lampert on 15.05.23. -// - import AppKit import Foundation diff --git a/Sources/Quilt/QuiltString.swift b/Sources/Quilt/QuiltString.swift index 8cb9040..a333e85 100644 --- a/Sources/Quilt/QuiltString.swift +++ b/Sources/Quilt/QuiltString.swift @@ -1,13 +1,4 @@ -// -// File.swift -// -// -// Created by Theodore Lampert on 15.12.22. -// - -import AppKit import Foundation -import SwiftUI public class QuiltString: ObservableObject { public init( diff --git a/Sources/Quilt/SpanMarker.swift b/Sources/Quilt/SpanMarker.swift index e4c87e8..1d8148a 100644 --- a/Sources/Quilt/SpanMarker.swift +++ b/Sources/Quilt/SpanMarker.swift @@ -1,10 +1,3 @@ -// -// SpanMarker.swift -// -// -// Created by Theodore Lampert on 15.12.22. -// - public enum SpanMarker: Codable, Equatable { case before(OpID) case after(OpID)