Releases: danielsaidi/RichTextKit
1.2
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
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.
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.
1.1.2
Thanks to @cp-divyesh-v, and @bryan1anderson for your contributions to this version!
💡 Adjustments
RichKeyboardToolbar.Configurationhas a new format sheet button toggle. (@bryan1anderson)
🐛 Bug Fixes
RichTextCoordinatornow updates the current attributes if needed on macOS. (@cp-divyesh-v)
1.1.1
This release reverts the Swift 6 restriction.
The library is still ready for Swift 6, but will not require it due to compatibility issues.
This version lets you keep using RichTextKit with Xcode 15.
1.1.0
This release makes RichTextKit use Swift 6.
This will involve a few breaking changes, but they are so minor that they (hopefully) didn't warrant a major version bump.
Reach out if you think that this version changes too much for a minor bump, or if you see any Swift 6 changes you don't agree with.
✨ Features
RichTextActionhas a newdeleteSelectedTextaction.RichTextActionhas a newdeleteText(at:)action.RichTextActionhas a newreplaceSelectedText(with:)action.RichTextActionhas a newreplaceText(at:with:)action.RichTextViewhas a newdeleteText(at:)function.RichTextView.Configurationhas a newisScrollBarsVisibleproperty for macOS.
💡 Adjustments
- Many protocols now use
@preconcurrency @MainActor. - All mutable
ImageandColorextensions are now computed. - All standard style and configuration values are now computed.
🐛 Bug Fixes
RichTextViewonly sets image configuration if it's not manually set before.
1.0.0
This release removes all deprecated code and cleans up the library.
✨ Features
- There are new view style and config modifiers for components.
RichTextFormatis a new namespace with format types and views.RichTextContexthas more intuitive ways to paste text content.RichTextContexthas a new observableparagraphStyleproperty.RichTextInsertionhas new static convenience insertion builders.RichTextVieweris a new SwiftUI view that can be used to view rich text.
🐛 Bug Fixes
RichTextViewno longer resets font and styles when setting up the macOS text view.
💥 Breaking Changes
- All previously deprecated code has been deleted.
- Many localization keys have been renamed to be easier to use.
RichTextContextFocusedValueKeyis renamed toRichTextContext.FocusedValueKey.RichTextEditoris now configured and styled with modifiers instead of the init.RichTextFontpickers are now configured with a shared modifier instead of the init.RichTextFontsize picker is now configured with a shared modifier instead of the init.RichTextFormatcomponents are now configured with a shared modifier instead of the init.RichTextFormatSheethas been renamed toRichTextFormat.Sheetto trim SDK surface area.RichTextFormatSidebarhas been renamed toRichTextFormat.Sidebarto trim SDK surface area.RichTextFormatToolbarhas been renamed toRichTextFormat.Toolbarto trim SDK surface area.RichTextLine.SpacingPickeris now configured with a shared view modifier instead of the init.RichTextKeyboardToolbaris now configured and styled with two view modifiers instead of the init.
0.9.9
This release adds a lot of new RichTextAction cases and adjusts the context and coordinator subscription.
This release also deprecates RichTextAttributeReader and RichTextAttributeWriter functionality that are not used by the library, in favor of RichTextViewComponent, to reduce the complexity of the library.
Until now, these functions mostly did the same thing, but sometimes the RichTextViewComponent have to use its text storage or layout manager, or update the typing attributes. This caused the code to diverge and mostly identical copies had co-exist, where the reader and writer versions were not even used by the library.
By deprecating these functions, we can simplify the library in 1.0, and focus more on unifying the different RichTextViewComponent implementations (UITextView in iOS and NSTextView in macOS), rather than providing a low level string handling interface.
✨ Features
FontRepresentablehas new extensions.RichTextActionhas a newlabelproperty.RichTextCommand.ActionButtonGrouphas new inits.RichTextCommand.FormatMenuis a lot more configurable.RichTextFormatSheetis now available on all platforms.RichTextFormatSheethas new configuration and style types.RichTextFormatSidebarhas new configuration and style types.RichTextFormatToolbaris a new rich text formatting toolbar.RichTextKeyboardToolbarhas a new config to always be shown.RichTextLineis a new namespace with support for linespacing.RichTextStyle.Buttonnow supports using custom button styles.RichTextViewhas a new theme that lets you define its style.RichTextViewComponenthas a newhasRichTextStylefunction.RichTextViewComponenthas a newtoggleRichTextStylefunction.RichTextViewComponentnow handles superscript changes properly.
🚨 Important
RichTextFormatToolbaris no longer navigation wrapped by default.RichTextFormatToolbarhas a newasSheet()function that does this.
💡 Adjustments
RichTextColoriconis no longer optional.RichTextColorhas a newtitleKeyproperty.RichTextContextmakes coordinator handle alignment.RichTextCoordinatornow syncs an extra time at ends editing.
🐛 Bug Fixes
- The library once again builds on visionOS.
RichTextAlignmentnow behaves better.RichTextAlignment.Pickernow uses provided values.RichTextCoordinatornow handles indentation changes.
🗑️ Deprecations
RichTextAttributeReaderhas deprecated a lot of functions.RichTextAttributeWriterhas deprecated a lot of functions.RichTextCommand.AlignmentOptionsGrouphas been deprecated.RichTextCommand.FontSizeOptionsGrouphas been deprecated.RichTextCommand.IndentOptionsGrouphas been deprecated.RichTextCommand.StyleOptionsGrouphas been deprecated.RichTextCommand.SuperscriptOptionsGrouphas been deprecated.RichTextContextreplaces individual colors with a singlecolors.RichTextContextreplaces individual styles with a singlestyles.RichTextContextuserActionPublisheris renamed toactionPublisher.RichTextCoordinatorfunctions callinghandle(_:)have been deprecated.RichTextFormatSheethas been renamed toRichTextFormatToolbar.RTKL10n.bundlehas been deprecated since we can use the.modulebundle.
💥 Breaking Changes
RichTextColor.undefinedwas no longer used and has been removed.
0.9.8
This release starts moving types and views that relate to other types into the type namespaces, to make the surface area of the library smaller.
✨ Features
RichTextAlignment.Pickerhas a new style parameter.RichTextCommandis a new namespace for command-related views.RichTextColor.Pickernow shows a quick button to reset the color.RichTextLabelValueis a new protocol to harmonize label-compatible label values.
💡 Adjustments
- Many value types implement
RichTextLabelValueto get alabelproperty. - All types that implement
RichTextLabelValueget alabelthat has improved accessibility. RichTextColor.adjustnow takes an optional color.RichTextColor.allCasesno longer returnsundefined.RichTextFormatSheetno longer hard-codes an accent color.RichTextStyleviews no longer use a style - useforegroundStyle,tintandaccentColorinstead.
🐛 Bug Fixes
Image.symbol(...)removespaletterendering mode to fix incorrect color scheme behavior.RichTextAlignment.Pickernow hides its picker label.RichTextColor.Pickerno longer auto-adjusts black and white to make it possible to actually set those colors.
🗑️ Deprecations
RichTextAction*views have been renamed toRichTextAction.Button*.RichTextAlignment*views have been renamed toRichTextAlignment.*.RichTextArgumentReaderdeprecates the font name and size functions.RichTextArgumentWriterdeprecates the font name and size functions.RichTextColor*views have been renamed toRichTextColor.*.RichTextCommandviews are now nested within the newRichTextCommandtype.RichTextComponentdeprecates the font name and size functions.RichTextDataFormatMenuhas been renamed toRichTextDataFormat.Menu.RichTextFont*views have been renamed toRichTextFont.*.RichTextStyle*views have been renamed toRichTextStyle.*.
0.9.7
Thanks to @ropellanda, RichTextKit now supports Vision OS.
Thanks to @screenworker, RichTextEditor now has a config that can disable scrolling.
✨ Features
Imagehas a new rich text-specific image builders.RichTextEditorhas a newconfigvalue parameter that can disable scrolling.RichTextViewhas a newconfigurationproperty that can disable scrolling.
🗑️ Deprecations
RichTextActionstatic properties have been deprecated in favor of their corresponding functions.RichTextReader.richTextRangehas been renamed to.richTextFullRange.
🐛 Bug Fixes
RichTextActioncorrects some icons and localized strings.RichTextAttributeReadernow userangecorrectly insetRichTextSuperscriptLevel.RichTextCoordinatornow sets correctunderlinecolor instead offoregroundcolor.
💥 Breaking Changes
RichTextAttributeReader/Writerfunctions now require a range.
0.9.6
Thanks to @DominikBucher12, fonts and pasting images behave a lot better than before!
💡 Adjustments
pasteImage(_:at:moveCursorToPastedContent:)now usestrueas default move parameter.