Skip to content
Compare
Choose a tag to compare
@danielsaidi danielsaidi released this 18 Apr 05:03
· 1 commit to main since this release

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 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

  • NSMutableParagraphStyle has a new defaultMutable builder.
  • NSParagraphStyle has a new defaultPickerValues(for:) function.
  • NSParagraphStyle has a new defaultStepperSteps(for:) function.
  • NSParagraphStyle.KeyPath has a new defaultIcon image property.
  • NSParagraphStyle.KeyPath has a new defaultPickerValues property.
  • NSParagraphStyle.KeyPath has a new defaultStepperInterval property.
  • NSTextAlignment has a new defaultIcon image-building property.
  • RichTextContext has a new paragraphStyleValue(for:) function.
  • RichTextContext has a new paragraphStyleValueBinding(for:) function.
  • RichTextViewComponent has a new, keypath-based richTextParagraphStyleValue(_:).
  • RichTextViewComponent has a new, keypath-based setRichTextParagraphStyleValue(_:_:).
  • RichTextViewComponent has a new, keypath-based stepRichTextParagraphStyleValue(_:_:).

🏞️ Views

  • Picker has new paragraph style value-based initializers.
  • Stepper has new paragraph style value-based initializers.
  • Toggle has new paragraph style value-based initializers.

🗑️ Deprecations

  • RichTextAlignment and all nested types have been deprecated due to the new paragraph-based features.
  • RichTextLine and all nested types have been deprecated due to the new paragraph-based features.