-
Notifications
You must be signed in to change notification settings - Fork 505
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[iOS] Mentions API & enable display in example app (#600)
* [iOS] Mentions API & enable display in example app * Document public API and rename `text` to `name` * Allow creating mentions with no suggestions and expand test suite * Rename `PermalinkDetector` as `PermalinkReplacer` and document it * Only show commands if pattern is at the start of the document * Document and extract function for replacements offset computation * Merge both variants of mention creation API * Replace `self.suggestionPattern` usage * Set `WysiwygPillsFlusher` as an internal non static object and attach it to `WysiwygTextView` * Move filtering non-leading slash pattern to the Rust side * Document `replaceLinks` post-parsing function
1 parent
f958067
commit 55faf8b
Showing
31 changed files
with
1,376 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// | ||
// Copyright 2023 The Matrix.org Foundation C.I.C | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import UIKit | ||
|
||
final class AppDelegate: NSObject, UIApplicationDelegate { | ||
func application(_ application: UIApplication, | ||
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool { | ||
if #available(iOS 15.0, *) { | ||
NSTextAttachment.registerViewProviderClass(WysiwygAttachmentViewProvider.self, | ||
forFileType: WysiwygAttachmentViewProvider.pillUTType) | ||
} else { | ||
// Fallback on earlier versions | ||
} | ||
return true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | ||
<plist version="1.0"> | ||
<dict> | ||
<key>LSSupportsOpeningDocumentsInPlace</key> | ||
<false/> | ||
<key>CFBundleDocumentTypes</key> | ||
<array> | ||
<dict> | ||
<key>CFBundleTypeName</key> | ||
<string>Mention Pills</string> | ||
<key>CFBundleTypeRole</key> | ||
<string>Viewer</string> | ||
<key>LSHandlerRank</key> | ||
<string>Owner</string> | ||
<key>LSItemContentTypes</key> | ||
<array> | ||
<string>org.matrix.rte.pills</string> | ||
</array> | ||
</dict> | ||
</array> | ||
<key>UTExportedTypeDeclarations</key> | ||
<array> | ||
<dict> | ||
<key>UTTypeConformsTo</key> | ||
<array> | ||
<string>public.text</string> | ||
</array> | ||
<key>UTTypeDescription</key> | ||
<string>Mention Pills</string> | ||
<key>UTTypeIdentifier</key> | ||
<string>org.matrix.rte.pills</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</plist> |
Oops, something went wrong.