Skip to content

Latest commit

 

History

History
674 lines (426 loc) · 26.4 KB

RELEASE_NOTES.md

File metadata and controls

674 lines (426 loc) · 26.4 KB

Release Notes

RichTextKit will use semver after 1.0.

Until then, minor updates may remove deprecated features and introduce breaking changes.

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

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

  • RichTextAction has a new deleteSelectedText action.
  • RichTextAction has a new deleteText(at:) action.
  • RichTextAction has a new replaceSelectedText(with:) action.
  • RichTextAction has a new replaceText(at:with:) action.
  • RichTextView has a new deleteText(at:) function.
  • RichTextView.Configuration has a new isScrollBarsVisible property for macOS.

💡 Adjustments

  • Many protocols now use @preconcurrency @MainActor.
  • All mutable Image and Color extensions are now computed.
  • All standard style and configuration values are now computed.

🐛 Bug Fixes

  • RichTextView only sets image configuration if it's not manually set before.

1.0

This release removes all deprecated code and cleans up the library.

✨ Features

  • There are new view style and config modifiers for components.

  • RichTextFormat is a new namespace with format types and views.

  • RichTextContext has more intuitive ways to paste text content.

  • RichTextContext has a new observable paragraphStyle property.

  • RichTextInsertion has new static convenience insertion builders.

  • RichTextViewer is a new SwiftUI view that can be used to view rich text.

🐛 Bug Fixes

  • RichTextView no 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.

  • RichTextContextFocusedValueKey is renamed to RichTextContext.FocusedValueKey.

  • RichTextEditor is now configured and styled with modifiers instead of the init.

  • RichTextFont pickers are now configured with a shared modifier instead of the init.

  • RichTextFont size picker is now configured with a shared modifier instead of the init.

  • RichTextFormat components are now configured with a shared modifier instead of the init.

  • RichTextFormatSheet has been renamed to RichTextFormat.Sheet to trim SDK surface area.

  • RichTextFormatSidebar has been renamed to RichTextFormat.Sidebar to trim SDK surface area.

  • RichTextFormatToolbar has been renamed to RichTextFormat.Toolbar to trim SDK surface area.

  • RichTextLine.SpacingPicker is now configured with a shared view modifier instead of the init.

  • RichTextKeyboardToolbar is 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

  • FontRepresentable has new extensions.
  • RichTextAction has a new label property.
  • RichTextCommand.ActionButtonGroup has new inits.
  • RichTextCommand.FormatMenu is a lot more configurable.
  • RichTextFormatSheet is now available on all platforms.
  • RichTextFormatSheet has new configuration and style types.
  • RichTextFormatSidebar has new configuration and style types.
  • RichTextFormatToolbar is a new rich text formatting toolbar.
  • RichTextKeyboardToolbar has a new config to always be shown.
  • RichTextLine is a new namespace with support for linespacing.
  • RichTextStyle.Button now supports using custom button styles.
  • RichTextView has a new theme that lets you define its style.
  • RichTextViewComponent has a new hasRichTextStyle function.
  • RichTextViewComponent has a new toggleRichTextStyle function.
  • RichTextViewComponent now handles superscript changes properly.

🚨 Important

  • RichTextFormatToolbar is no longer navigation wrapped by default.
  • RichTextFormatToolbar has a new asSheet() function that does this.

💡 Adjustments

  • RichTextColor icon is no longer optional.
  • RichTextColor has a new titleKey property.
  • RichTextContext makes coordinator handle alignment.
  • RichTextCoordinator now syncs an extra time at ends editing.

🐛 Bug Fixes

  • The library once again builds on visionOS.

  • RichTextAlignment now behaves better.

  • RichTextAlignment.Picker now uses provided values.

  • RichTextCoordinator now handles indentation changes.

🗑️ Deprecations

  • RichTextAttributeReader has deprecated a lot of functions.
  • RichTextAttributeWriter has deprecated a lot of functions.
  • RichTextCommand.AlignmentOptionsGroup has been deprecated.
  • RichTextCommand.FontSizeOptionsGroup has been deprecated.
  • RichTextCommand.IndentOptionsGroup has been deprecated.
  • RichTextCommand.StyleOptionsGroup has been deprecated.
  • RichTextCommand.SuperscriptOptionsGroup has been deprecated.
  • RichTextContext replaces individual colors with a single colors.
  • RichTextContext replaces individual styles with a single styles.
  • RichTextContext userActionPublisher is renamed to actionPublisher.
  • RichTextCoordinator functions calling handle(_:) have been deprecated.
  • RichTextFormatSheet has been renamed to RichTextFormatToolbar.
  • RTKL10n.bundle has been deprecated since we can use the .module bundle.

💥 Breaking Changes

  • RichTextColor.undefined was 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.Picker has a new style parameter.
  • RichTextCommand is a new namespace for command-related views.
  • RichTextColor.Picker now shows a quick button to reset the color.
  • RichTextLabelValue is a new protocol that harmonizes label values.

💡 Adjustments

  • Many value types implement RichTextLabelValue to get a label property.

  • All types that implement RichTextLabelValue get a label that has improved accessibility.

  • RichTextColor .adjust now takes an optional color.

  • RichTextColor .allCases no longer returns undefined.

  • RichTextFormatSheet no longer hard-codes an accent color.

  • RichTextStyle views no longer use a style - use foregroundStyle, tint and accentColor instead.

🐛 Bug Fixes

  • Image.symbol(...) removes palette rendering mode to fix incorrect color scheme behavior.
  • RichTextAlignment.Picker now hides its picker label.
  • RichTextColor.Picker no longer auto-adjusts black and white to make it possible to actually set those colors.

🗑️ Deprecations

  • RichTextAction* views have been renamed to RichTextAction.Button*.
  • RichTextAlignment* views have been renamed to RichTextAlignment.*.
  • RichTextArgumentReader deprecates the font name and size functions.
  • RichTextArgumentWriter deprecates the font name and size functions.
  • RichTextColor* views have been renamed to RichTextColor.*.
  • RichTextCommand views are now nested within the new RichTextCommand type.
  • RichTextComponent deprecates the font name and size functions.
  • RichTextDataFormatMenu has been renamed to RichTextDataFormat.Menu.
  • RichTextFont* views have been renamed to RichTextFont.*.
  • RichTextStyle* views have been renamed to RichTextStyle.*.

0.9.7

Thanks to @ropellanda, RichTextKit now supports Vision OS.

Thanks to @screenworker, RichTextEditor now has a config that can disable scrolling.

✨ Features

  • Image has a new rich text-specific image builders.
  • RichTextEditor has a new config value parameter that can disable scrolling.
  • RichTextView has a new configuration property that can disable scrolling.

🗑️ Deprecations

  • RichTextAction static properties have been deprecated in favor of their corresponding functions.
  • RichTextReader .richTextRange has been renamed to .richTextFullRange.

🐛 Bug Fixes

  • RichTextAction corrects some icons and localized strings.
  • RichTextAttributeReader now use range correctly in setRichTextSuperscriptLevel.
  • RichTextCoordinator now sets correct underline color instead of foreground color.

💥 Breaking Changes

  • RichTextAttributeReader/Writer functions 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 uses true as default move parameter.

0.9.5

Thanks to @DominikBucher12 and @msrutek-paylocity, some bugs have been fixed and some formatting adjusted.

✨ Features

  • RichTextColor has a new attribute property.
  • RichTextColor has a new underline color.
  • RichTextFormatSheet has a new colorPickers init parameter.
  • RichTextFormatSidebar has a new colorPickers init parameter.

💡 Adjustments

  • RichTextAttributeReader now allows providing a nil range.
  • RichTextAttributeWriter now handles setRichTextStyle with a switch.
  • RichTextAttributeWriter and RichTextViewComponent shares more code.
  • RichTextFormatSheet now exposes its init params as mutable properties.
  • RichTextFormatSidebar now handles keyboard focus way better than before.
  • RichTextFormatSidebar now exposes its init params as mutable properties.
  • RichTextViewComponent now handles setCurrentRichTextStyle with a switch.
  • RichTextViewComponent now handles setCurrentRichTextStyle with a switch.
  • RichTextViewComponent uses the new color attribute to optimize some code.
  • SwiftFormat now uses consecutiveSpaces.

🐛 Bug Fixes

  • RichTextAttributeWriter now handles strikethrough with a switch.
  • RichTextView now handles initial drag & drop better on iOS.

🗑️ Deprecations

  • RichTextAttributeReader color functions are replaced with a single richTextColor(_:at:).
  • RichTextAttributeWriter color functions are replaced with a single setRichTextColor(_:to:at:).

0.9.4

Thanks to @Mcrich23, the RichTextColorPicker now adjusts foreground and background color for the current color scheme.

✨ Features

  • RichTextColor has a new .undefined type.
  • RichTextColor has a new color adjust function.
  • RichTextColorPicker now takes an RichTextColor.

💡 Adjustments

  • RichTextColorPicker now uses the color type icon by default.
  • RichTextColorPicker now uses the color type color adjustment.

0.9.3

Thanks to @Mcrich23, RichTextKit now supports Mac Catalyst.

Thanks to @msrutek-paylocity the unit tests are in a much better shape.

0.9.2

This version adjusts some display issues when changing text style.

0.9.1

This version reverts the .presentationBackgroundInteraction addition that caused the format sheet to appear behind the keyboard.

0.9

This version drops support for iOS 14, tvOS 14, macOS 11 and watchOS 7.

This version also consolidates all separate attribute readers and writers into the base attribute reader/writer protocols.

✨ Features

  • RichTextColor is a new enum that defines supported colors that can be set.
  • RichTextColorPicker now works on all platforms.
  • RichTextCommandButton is a new button for commands.
  • RichTextCommandButtonGroup is a new button group for commands.
  • RichTextContext has new enum-based style and color functions.
  • RichTextAttributeReader can handle more colors and superscripting.
  • RichTextAttributeWriter can handle more colors and superscripting.

💡 Adjustments

  • RichTextAttributeReader now has all specific getter functions.
  • RichTextAttributeWriter now has all specific setter functions.
  • RichTextKeyboardToolbar now opens the format sheet in medium size on iPhone.

🗑️ Deprecations

  • All specific attribute reader/writer protocols are deprecated in favor of the base protocols.

  • Many getter/setter functions have been prefixed with richText.

  • RichTextAttributeWriter renames functionality and omits to: param name.

  • RichTextColorPicker initializer has been cleaned up and simplified.

  • RichTextColorPicker.PickerColor has been deprecated.

  • RichTextColorPickerColor has been deprecated.

  • RichTextContext replaces a lot of action-based functions with handle(_:).

  • RichTextIndent has been deprecated.

  • RichTextIndentPicker has been deprecated.

  • RichTextViewComponent and omits to: param name.

💥 Breaking Changes

  • The rich text indent feature has been rewritten to use steps.
  • Some richTextMenu* images are renamed to richTextAction*.
  • RichTextContext replaces a lot of action-based functions with handle(_:).

0.8

This version makes the observable trigger properties internal.

These properties were never made to be used from the outside. Instead, use the functions that trigger them.

IMPORTANT The safeRange adjustment may lead to crashes, although I haven't been able to make it crash. If so, investigate. Perhaps we should use attributedString.string.count instead?

✨ Features

  • RichTextContext has a new attributedString property.
  • RichTextContext's paste functions now use the selected range index as default index.

💡 Adjustments

  • RichTextReader safeRange no longer subtracts 1 from the string length.
  • RichTextReader will now move the cursor after the pasted text, if it's pasted at selected range.
  • RichTextViewComponent image pasting has been rewritten.
  • RichTextViewComponent will now clear the selected range when pasting in images using that range.

🐛 Bug Fixes

  • RichTextReader safe range fix makes pasting text at the end behave better.
  • RichTextViewComponent now properly restores the font size after pasting an image.

🗑️ Deprecations

  • RichTextContext trigger properties have been made internal.

0.7.2

This version makes the keyboard toolbar menu prefer fixed menu order.

0.7.1

This version tweaks the new color picker component a little.

0.7

✨ Features

  • RichTextColorPicker now supports hiding the icon.
  • RichTextColorPicker now supports specifying quick colors.
  • RichTextColorPickerColor is a new enum with curated colors.

💡 Adjustments

  • RichTextFormatSheet adds curated colors to its color pickers.
  • RichTextFormatSidebar adds curated colors to its color pickers.

🗑️ Deprecations

  • RichTextColorPickerStack has been deprecated.

0.6.1

This update reverts a RichTextEditor view update that made the editor less performant.

0.6

✨ Features

  • Thanks to @jamesbradleym, RichTextKit now supports text indentation.

  • Image has new richTextIndentDecrease and richTextIndentIncrease actions.

  • NSTextAttachment has a new attachedImage property.

  • RichTextAction has new increaseIndent and decreaseIndent actions.

  • RichTextActionButtonGroup is a new view that groups multiple action buttons together.

  • RichTextAttributeWriter now supports affecting the entire text by default.

  • RichTextButtonGroup is a new view that groups multiple buttons together.

  • RichTextColorWriter now supports affecting the entire text by default.

  • RichTextContext has new canDecreaseIndent and canIncreaseIndent properties.

  • RichTextContext has new decreaseIndent() and increaseIndent() functions.

  • RichTextContext has new resetAttributedString() and setAttributedString() functions.

  • RichTextFontWriter now supports affecting the entire text by default.

  • RichTextFormatSheet now groups related buttons and also adds indent buttons.

  • RichTextIndent is a new enum for handling text indent changes.

  • RichTextIndentPicker is a new enum for picking a text indent.

  • RichTextIndentReader is a new type for managing text indents.

  • RichTextIndentWriter is a new type for managing text indents.

  • RichTextKeyboardToolbar now supports modifying the format sheet before presenting it.

  • RichTextStyleToggleGroup is a new view that groups multiple toggles together.

  • RichTextStyleWriter now supports affecting the entire text by default.

💡 Adjustments

🐛 Bug Fixes

  • This version fixes a bug where setting up an editor with a text that had image attachments, didn't resize the images until the user typed in the text editor.

💥 Breaking Changes

  • RichTextKeyboardToolbar height and spacing has been moved to RichTextKeyboardToolbarStyle.

0.5.2

🐛 Bug Fixes

  • Initial text color is only applied when setting up rich text with an empty string.

0.5

💥 Breaking Changes

  • All deprecated types have been removed.

0.4

This release addresses some performance changes, by trying to minimize the number of redraws.

As a result, the RichTextContext's selectedRange is no longer observable, since that caused every input or text position change to redraw the entire app. The library and demo app however still updates way to often, and too much. For instance, switching between having a selected range and not should only redraw the copy button, but now updates the entire screen. If you know how to minimize this, please reach out.

Furthermore, this release adds support for focus values and menu commands. You can see them in action in the demo app.

✨ New Features

  • Commands is a new namespace for app commands.
  • Focus is a new namespace for focus values.
  • RichTextDataFormat has a new fileFormatText property.
  • RichTextDataFormat has a new isArchivedDataFormat property.
  • RichTextDataFormat has a new libraryFormats property that returns all formats except the vendorArchivedData format.
  • RichTextDataFormatMenu is a new menu that triggers an action for various formats.
  • RichTextDataReader now has ways to get data for the current rich text.
  • RichTextExportMenu is a new menu for exporting rich text.
  • RichTextContextFocusedValueKey is a new rich text context focus key.
  • RichTextFormatCommandMenu is a new command menu for adding rich text formatting to the system menu.
  • RichTextNSSharingMenu is a new macOS-specific menu for sharing rich text with NSSharingServices.
  • RichTextShareCommandMenu is a new command menu for adding rich text sharing and exporting to the system menu.
  • RichTextShareMenu is a new menu for sharing rich text.
  • ViewDebug is a new demo app class that is used for view debugging capabilities.
  • The library is now localized in Danish, German and Norwegian, although some translations probably need adjusting.

💡 Behavior changes

  • RichTextCoordinator now checks if properties have changed before it syncs.

🐛 Bug Fixes

  • RichTextKeyboardToolbar no longer allocates width for hidden items.
  • RichTextStyleToggle is no longer tinted by default when inactive.

🗑️ Deprecations

  • PdfDataReader has been renamed to RichTextPdfDataReader.
  • RichTextDataWriter is deprecated.
  • RichTextDataWriter functionality has been moved to RichTextDataReader.

💥 Breaking Changes

  • RichTextContext no longer has a font size in the initializer, use StandardFontSizeProvider (CGFloat, TextEditor etc.) instead.
  • RichTextContext selectedRange is no longer published.
  • RichTextDataReader now implements RichTextReader.
  • RichTextDataReader format-specific data functions have been made private.
  • RichTextStyleToggle.Style inactiveColor is now optional.
  • NSMutableString format-specific initializers have been made private.

0.3

This release adds support for strikethrough and cleans up some 0.2 code. It also adds a bunch of new views, such as toolbars, sidebars, sheets etc., as well as support for keyboard shortcuts, localization and accessibility.

✨ New Features

  • Bundle.richTextKit is a new bundle extension that works in external previews.
  • RichTextAction has a new dismissKeyboard action.
  • RichTextAction has new incrementFontSize and decrementFontSize actions.
  • RichTextAction has new undo and redo name aliases.
  • RichTextActionButton has a new fillVertically parameter.
  • RichTextFormatSheet is a new view that collects a bunch of text formatting controls.
  • RichTextFormatSidebar is a new view that collects a bunch of text formatting controls.
  • RichTextKeyboardToolbar is a new toolbar that can be used on iOS.
  • RichTextKeyboardToolbarMenu is a new toolbar menu.
  • RichTextStyle has a new strikethrough style.
  • RichTextStyleToggle has a new fillVertically parameter.
  • RTKL10n is a new enum with localized strings, which is used to localize multiple types.
  • View+KeyboardShortcuts is a new view extension to simplify binding keyboard shortcuts to views.
  • The various stack views now support

💡 Behavior changes

  • RichTextActionButtonStack and RichTextStyleToggleStack now fills vertically.
  • RichTextStyleButton and RichTextStyleToggle now applies keyboard shortcuts.
  • RichTextStyleToggle applies a toggle-like style to fallbacks on older OS versions.
  • Many pickers, buttons and toggles apply a localized accessibility label.
  • More buttons apply a rectangular content shape.

💥 Breaking Changes

  • RichTextActionButtonStack no longer has default actions.
  • RichTextActionButtonStack no longer has a bordered init parameter.
  • RichTextAlignmentPicker no longer has title and segmented parameters.
  • RichTextFontSizePickerStack no longer has a bordered init parameter.
  • RichTextFontSizePickerStack now requires a RichTextContext instead of a binding.

0.2

✨ New Features

  • Image has new rich text-specific images.
  • NSImage cgImage and jpegData are now public.
  • NSAttributedString has a new withBlackText() extension.
  • NSAttributedString has a new init extension file.
  • RichTextAction is a new enum that defines rich text actions.
  • RichTextActionButton is a new view that can trigger a RichTextAction.
  • RichTextActionButtonStack is a new view that can list multiple RichTextActionButton views.
  • RichTextContext has new bindings.
  • RichTextCoordinator now subscribes to highlighting style changes.
  • RichTextCoordinator cancellables are now public.
  • RichTextCoordinator resetHighlightedRangeAppearance() is now public.
  • RichTextCoordinator text is now mutable.
  • RichTextColorPicker is a new color picker.
  • RichTextColorPickerStack is a new view that can list multiple RichTextColorPicker views.
  • RichTextDataFormat has a new vendor-specific data format.
  • RichTextFontSizePickerStack is a new view that can list multiple RichTextFontSizePicker views.
  • RichTextImageAttachment is now open for inheritance.
  • RichTextStyleButton has a new button style.
  • RichTextStyleToggle is a new style toggle button.
  • RichTextStyleToggleStack is a new view that can list multiple RichTextStyleToggle views.
  • RichTextView is now open for inheritance.
  • RichTextView drop interaction functionality is now open.
  • String extensions have been made public.

💡 Behavior changes

  • RichTextAlignmentPicker is now segmented by default.

🗑️ Deprecated

  • Font picker components have been renamed with a RichText prefix.
  • FontSizePicker sizes has been renamed to values.
  • PdfDataWriter has been renamed to PdfDataReader.
  • RichTextAlignmentPicker alignments has been renamed to values.
  • RichTextContext alignment has been renamed to textAlignment.
  • RichTextContext standardHighlightingStyle has been renamed to highlightingStyle.
  • RichTextCoordinator context has been renamed to richTextContext.
  • RichTextDataWriter richTextData(with:) has been renamed to richTextData(for:).
  • RichTextViewRepresentable has been renamed to RichTextViewComponent.

💥 Breaking Changes

  • RichTextView alert function title parameter is no longer implicit.
  • RichTextViewRepresentable decrementFontSize has been renamed to decrementCurrentFontSize and has no range parameter.
  • RichTextViewRepresentable incrementFontSize has been renamed to incrementCurrentFontSize and has no range parameter.

0.1.2

This is a small bugfix release.

🐛 Bugs

  • RichTextCoordinator now subscribes to image pasting.

0.1.1

This is a small bugfix release.

🐛 Bugs

  • RichTextAlignmentWriter now uses safe ranges to avoid occasional crashes.

0.1

This is the first beta release of RichTextKit.

The release includes the following.

✨ Foundational Types

  • RichTextView is a replacement for UITextView and NSTextView.
  • RichTextEditor is a SwiftUI view that embeds a RichTextView.
  • RichTextContext is used to inspect and interact with a RichTextEditor.
  • RichTextCoordinator is used by a RichTextEditor to keep the text view and context in sync.

✨ Feature support

RichTextKit adds extensive support for a bunch of rich text features:

  • Alignment
  • Attributes
  • Colors
  • Data
  • Export
  • Fonts
  • Images
  • Pasteboard extensions
  • Pdf
  • Sharing
  • Styles
  • Views