1.2-b.1
This version makes a first step towards removing library-specific types in favor of native types, to avoid having to add custom types and logic to the library, where native alternatives exist.
This version starts with NSParagraphStyle and its nested types, and makes it possible to get, set, pick, step and toggle the following values with a single set of functions, pickers, steppers and toggles:
alignment, allowsDefaultTighteningForTruncation, baseWritingDirection, defaultTabInterval, firstLineHeadIndent, headIndent, hyphenationFactor, lineBreakMode, lineBreakStrategy, lineHeightMultiple, lineSpacing, maximumLineHeight, minimumLineHeight, paragraphSpacing, paragraphSpacingBefore, tabStops, tailIndent, usesDefaultHyphenation.
As a result, this version deprecates the RichTextAlignment and RichTextLine type. This makes the library tighter, and a lot more capable with less code that does more.
✨ Features
NSMutableParagraphStylehas a newdefaultMutablebuilder.NSParagraphStylehas a newdefaultPickerValues(for:)function.NSParagraphStylehas a newdefaultStepperSteps(for:)function.NSParagraphStyle.KeyPathhas a newdefaultIconimage property.NSParagraphStyle.KeyPathhas a newdefaultPickerValuesproperty.NSParagraphStyle.KeyPathhas a newdefaultStepperIntervalproperty.NSTextAlignmenthas a newdefaultIconimage-building property.RichTextContexthas a newparagraphStyleValue(for:)function.RichTextContexthas a newparagraphStyleValueBinding(for:)function.RichTextViewComponenthas a new, keypath-basedrichTextParagraphStyleValue(_:).RichTextViewComponenthas a new, keypath-basedsetRichTextParagraphStyleValue(_:_:).RichTextViewComponenthas a new, keypath-basedstepRichTextParagraphStyleValue(_:_:).
🏞️ Views
Pickerhas new paragraph style value-based initializers.Stepperhas new paragraph style value-based initializers.Togglehas new paragraph style value-based initializers.
🗑️ Deprecations
RichTextAlignmentand all nested types have been deprecated due to the new paragraph-based features.RichTextLineand all nested types have been deprecated due to the new paragraph-based features.