Commit Graph

90 Commits

Author SHA1 Message Date
Stefan Ceriu a1038f0ffe Remove extra new line before list items and useless paragraph style 2025-09-16 17:54:46 +03:00
Stefan Ceriu f33d29b7e9 Add support for HTML img tags (their alts) on the new AttributedStringBuilder 2025-09-16 17:54:46 +03:00
Stefan Ceriu cf9df8a8e1 Reduce code block font point sizes by 10% on the new attributed string builder. 2025-09-16 17:54:46 +03:00
Stefan Ceriu 350abd0ad7 Fix traling new lines appearing in attributed string when sending text separated by 2 new lines. 2025-09-12 18:09:18 +03:00
Stefan Ceriu 81b4fe2a9f Preserve the formatting of parentless text nodes 2025-09-10 14:52:00 +03:00
Stefan Ceriu 92685fbb50 Automatically add insert a new line after headers 2025-09-10 14:52:00 +03:00
Stefan Ceriu e64fb3dc2a Fix the default point size used when applying symbolic traits. 2025-09-09 17:17:40 +01:00
Stefan Ceriu 5aa894c44a Add proper separated blockquotes fixtures and fix the tests. 2025-09-09 17:17:40 +01:00
Stefan Ceriu cd249040cd Mark code blocks with a special attribute and strip away links from them. 2025-09-09 17:17:40 +01:00
Stefan Ceriu 02462fb1a0 Limit H1, H2 to the H3 point size. 2025-09-09 17:17:40 +01:00
Stefan Ceriu a4ead7210a Invalidate caches on both attributed string builders at the same time 2025-09-09 17:17:40 +01:00
Stefan Ceriu 561c98c966 Adapt old AttributedStringBuilder tests to the new version and update the HTML fixtures 2025-09-09 17:17:40 +01:00
Stefan Ceriu 56175ac933 Correctly identify MSC4286 span values. 2025-09-09 17:17:40 +01:00
Stefan Ceriu 6058130c27 Add link attributes as URL values instead of String ones 2025-09-09 17:17:40 +01:00
Stefan Ceriu a1e64145a8 Remove matrix identifier attributes from code blocks 2025-09-09 17:17:40 +01:00
Stefan Ceriu d16f0ac8d0 Extract HTML fixtures out of the FormattedBoxyText previews. 2025-09-09 17:17:40 +01:00
Stefan Ceriu 3ac201ea2c Use the correct key when caching attributed string builder results. 2025-09-09 17:17:40 +01:00
Stefan Ceriu bc55cf4a10 Add support for ordered and unordered lists. 2025-09-09 17:17:40 +01:00
Stefan Ceriu af7a3a24f6 Add an initial version of the V2 AttributedStringBuilder 2025-09-09 17:17:40 +01:00
Stefan Ceriu 754c2f0fed Add a V2 version of the AttributedStringBuilder as a verbatim copy of the original one (for now) 2025-09-09 17:17:40 +01:00
Stefan Ceriu 5738b08a94 Move the initial attributed string builder to its own file 2025-09-09 17:17:40 +01:00
Stefan Ceriu 549a8de6a9 Rename detectPermalinks to addMatrixEntityPermalinkAttributesTo and move code around 2025-09-09 17:17:40 +01:00
Hugh Nimmo-Smith 0f518d3190 Support for experimental MSC4286 to not render external payment details (#4099)
Ref: https://github.com/matrix-org/matrix-spec-proposals/pull/4286
2025-06-03 12:22:14 +01:00
Stefan Ceriu 5af330cf6e Fix various small errors when running in the Swift 6 language mode (#4109)
* Fix various small errors when running in the Swift 6 language mode

* Make the `TargetConfiguration` run on the main actor.

* Fixed a comment

* Add a comment as to why we can't make the whole NSE a main actor.

* Fix the unit tests

* Fix `blankLinesAtStartOfScope` swiftformat error.
2025-05-13 11:43:47 +03:00
Mauro Romito aa35bfc245 added tests
improvement

improved

improvement

fixed
2025-03-17 16:21:09 +01:00
Mauro Romito 516892ed7b phishing alert implementation
we now check when building the string through the `AttributedStringBuilder` if a URL is actually hiding a different link, if so, we create a custom URL that contains both the external and the internal URL to advise the user through an Alert about the risk
2025-03-17 16:21:09 +01:00
Mauro 5f59e867b5 Room mentioning in the composer (#3868)
* refactored the suggestion item structure

to scale with the room pill

* Implemented a way for the rooms

to appear in the suggestions view for the RTE, however I need to add the pills to the composer and the compatibility with the plain text composer

* small code correction

* fix

* fixed a bug where the suggestion wasn't returning

the right suggestion type and the suggestion text properly

* implementation done!

also updated some tests, but we need more of them

* updated toolbar view model tests

* updated tests

* updated preview tests

* renamed the Avatars case for the suggestions
2025-03-06 11:32:37 +01:00
Mauro a2242c63e2 Render Room and Message Pills (#3809)
* added a way to render the room and the message

pills, but is WIP

* permalinks now get converted into pills!

* fixed an issue where room address mentions

were not adding a URL properly but a string

* updated tests

* c

* Revert "c"

This reverts commit 5c80252fa23dba7e4d44f2a07fbf1e9500e37c82.

* updated tests

* more tests

* created APIs to get a specific RoomSummary

given the id or the alias

* small mention builder improvement

* pr suggestions
2025-02-25 13:46:01 +00:00
manuroe 3950cac085 Dual licensing: AGPL + Element Commercial (#3657)
* New LICENSE-COMMERCIAL file

* Apply dual licenses: AGPL + Element Commercial to file headers

* Update README with dual licensing
2025-01-06 11:27:37 +01:00
Doug c264e9e590 Use the UIColors directly instead of wrapping the SwiftUI Colors. (#3324) 2024-09-24 12:24:03 +01:00
Stefan Ceriu 664e87fe87 Switch license to AGPL (#3237)
* Switch license file to AGPL

* Update file copyright headers

* Update the default project file header
2024-09-06 16:34:30 +03:00
Stefan Ceriu bbf5b91675 Ignore punctuation characters at the end of detected links
- fixes permalink handling when that's the case
- prevents deep linking loops between nightly and the main app
2024-06-19 16:10:31 +03:00
Stefan Ceriu 8bfd802793 Add support for showing the native OS incoming call screen when starting new Element Calls 2024-05-24 15:32:56 +03:00
Doug 6984afd6c0 Support tapping Matrix URIs in messages. (#2828) 2024-05-10 15:22:22 +01:00
Stefan Ceriu 099b69d2f2 Prevent links from showing up in color within code blocks, simplify foreground color stripping 2024-05-10 14:07:43 +03:00
Stefan Ceriu 65310acc64 Reorder AttributedStringBuilder methods based on the order they're called in. 2024-05-09 18:48:51 +03:00
Stefan Ceriu 77f92ad068 Fixes #2807 - Stop inserting string attributes to code blocks. 2024-05-09 18:48:51 +03:00
Stefan Ceriu 38416dbb5c Plain composer suggestions and pills (#2751)
* Move ComposerToolbar files to withing the RoomScreen folder (as it's not a screen on its own)

* Switch the plain composer to NSAttributedStrings

* Enable suggestions on the plain composer

* Introduce a new `MatrixUserDisplayName` attributed string attributed and use it for mention building

* Implement mention pill rendering and sending on the plain message composer

* Fix plain composer snapshot tests

* Fix broken formatting options layout

* Add clarifying comment.
2024-05-03 10:06:16 +01:00
Doug 7c94ed98a5 Permalink Tweaks 2 (#2766)
* Missing changelog.

* Parse bare room aliases as permalinks.

Update the SDK.

* Fix tapping the same permalink twice.

Add a test.

Don't clear the focussed item when reaching the bottom of the timeline.

* Make sure sending a message returns to live.
2024-04-29 17:32:16 +01:00
Stefan Ceriu fcc25dd441 Adop the new SDK permalink detector and user builder 2024-04-12 18:04:41 +03:00
Stefan Ceriu e0c9f43026 Fix localization bundle and attributed string builder crashes on unsynchronised access to their internal caches 2024-02-15 12:20:37 +02:00
Mauro 99d6babc30 Fixed the link color and improved link dection in code blocks (#2466) 2024-02-14 17:45:23 +01:00
Stefan Ceriu 2d66e76b51 Update AttributedStringBuilderComponent identifiers, fix layout issues 2024-01-12 10:49:14 +02:00
Stefan Ceriu 9bb177bff5 Fixes #2286 - Timeline entries flickering when a lot of mention pills present 2024-01-08 12:04:29 +02:00
Mauro d99d26fcdc Removing Dead Code part 1 (#2234) 2023-12-13 09:51:57 +01:00
Mauro a248bdbd95 Fix for line breaks (#2224) 2023-12-11 15:43:31 +00:00
Stefan Ceriu b0567e5004 Fixes #2117 - Disable underlining for links defined in the html body:
- https://github.com/Cocoanetics/DTCoreText/issues/898
2023-11-20 13:46:40 +02:00
Mauro 2eb8945824 Converting detected plain text mentions into permalinks (#1963)
* it works but a test fail because URL(string) fails

* done!

* let
2023-10-27 09:31:01 +02:00
Mauro c04e812a02 Replies now display mentions with @displayname (#1957)
* reply with mentions

* fixed a bug and wrote a test for it

* error message
2023-10-25 18:39:18 +02:00
Mauro c358150449 Render pills in RTE (#1874)
* for now this can only work locally

* works

* added a test

* updated RTE

* revert package

* pr suggestion

* reverting package versions

* better naming
2023-10-11 16:40:52 +02:00