Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Converted TextStorage to PRTextStorage in Objc to fix performance iss…
…ues (#66) * Converted TextStorage to PRTextStorage in Objc to fix performance issues * Changed Editor.maxHeight from float to an enum to allow for support for unbounded height * Updated docs Co-authored-by: Rob Chatfield <rchatfield@atlassian.com>
- Loading branch information
Showing
154 changed files
with
1,974 additions
and
865 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
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,28 @@ | ||
// | ||
// DefaultTextFormattingProviding.swift | ||
// Proton | ||
// | ||
// Created by Rajdeep Kwatra on 3/1/20. | ||
// Copyright © 2020 Rajdeep Kwatra. All rights reserved. | ||
// | ||
// 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 | ||
|
||
@objc | ||
protocol DefaultTextFormattingProviding: AnyObject { | ||
var font: UIFont { get } | ||
var paragraphStyle: NSMutableParagraphStyle { get } | ||
var textColor: UIColor { get } | ||
} |
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,45 @@ | ||
// | ||
// EditorContentName.h | ||
// Proton | ||
// | ||
// Created by Rajdeep Kwatra on 13/9/20. | ||
// Copyright © 2020 Rajdeep Kwatra. All rights reserved. | ||
// | ||
// 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. | ||
// | ||
|
||
#ifndef EditorContentName_h | ||
#define EditorContentName_h | ||
|
||
|
||
#endif /* EditorContentName_h */ | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
NS_ASSUME_NONNULL_BEGIN | ||
|
||
@interface EditorContentName : NSObject | ||
|
||
@property (readonly, copy) NSString *rawValue; | ||
|
||
- (instancetype)initWithRawValue:(NSString *)rawValue; | ||
|
||
+ (EditorContentName *)paragraphName; | ||
+ (EditorContentName *)viewOnlyName; | ||
+ (EditorContentName *)newlineName; | ||
+ (EditorContentName *)textName; | ||
+ (EditorContentName *)unknownName; | ||
|
||
@end | ||
|
||
NS_ASSUME_NONNULL_END |
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,53 @@ | ||
// | ||
// EditorContentName.m | ||
// Proton | ||
// | ||
// Created by Rajdeep Kwatra on 13/9/20. | ||
// Copyright © 2020 Rajdeep Kwatra. All rights reserved. | ||
// | ||
// 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 <Foundation/Foundation.h> | ||
#import "EditorContentName.h" | ||
|
||
@implementation EditorContentName | ||
|
||
- (instancetype)initWithRawValue:(NSString *)rawValue { | ||
self = [super init]; | ||
if (self) { | ||
_rawValue = rawValue; | ||
} | ||
return self; | ||
} | ||
|
||
- (BOOL)isEqual:(id)other { | ||
EditorContentName *otherName = (EditorContentName *)other; | ||
return otherName.hash == self.hash; | ||
} | ||
|
||
- (NSUInteger)hash { | ||
return _rawValue.hash; | ||
} | ||
|
||
- (NSString *)description { | ||
return [NSString stringWithFormat:@"EditorContent.Name(rawValue: \"%@\")", [self rawValue]]; | ||
} | ||
|
||
+ (EditorContentName *)paragraphName { return [[EditorContentName alloc] initWithRawValue:@"_paragraph"]; } | ||
+ (EditorContentName *)viewOnlyName { return [[EditorContentName alloc] initWithRawValue:@"_viewOnly"]; } | ||
+ (EditorContentName *)newlineName { return [[EditorContentName alloc] initWithRawValue:@"_newline"]; } | ||
+ (EditorContentName *)textName { return [[EditorContentName alloc] initWithRawValue:@"_text"]; } | ||
+ (EditorContentName *)unknownName { return [[EditorContentName alloc] initWithRawValue:@"_unknown"]; } | ||
|
||
@end |
Oops, something went wrong.