react-native-enriched-markdown 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownManagerDelegate.java +1 -0
- package/android/generated/java/com/facebook/react/viewmanagers/EnrichedMarkdownTextManagerDelegate.java +1 -0
- package/android/generated/jni/react/renderer/components/EnrichedMarkdownTextSpec/Props.h +55 -0
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdown.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownManager.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/EnrichedMarkdownTextManager.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/MeasurementStore.kt +3 -3
- package/android/src/main/java/com/swmansion/enriched/markdown/parser/Parser.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/renderer/NodeRenderer.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/common/FeatureFlags.kt +1 -1
- package/android/src/main/java/com/swmansion/enriched/markdown/utils/text/extensions/SpannableExtensions.kt +1 -1
- package/app.plugin.js +1 -0
- package/cpp/parser/MD4CParser.cpp +34 -7
- package/ios/EnrichedMarkdown.mm +85 -19
- package/ios/EnrichedMarkdownText.mm +74 -15
- package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/Props.h +55 -0
- package/ios/internals/EnrichedMarkdownShadowNode.mm +16 -2
- package/ios/internals/EnrichedMarkdownTextShadowNode.mm +16 -2
- package/ios/utils/StylePropsUtils.h +6 -3
- package/lib/module/plugin/withAndroidMath.js +23 -0
- package/lib/module/plugin/withAndroidMath.js.map +1 -0
- package/lib/module/plugin/withIosMath.js +26 -0
- package/lib/module/plugin/withIosMath.js.map +1 -0
- package/lib/module/plugin/withReactNativeEnrichedMarkdown.js +16 -0
- package/lib/module/plugin/withReactNativeEnrichedMarkdown.js.map +1 -0
- package/lib/typescript/src/plugin/withAndroidMath.d.ts +5 -0
- package/lib/typescript/src/plugin/withAndroidMath.d.ts.map +1 -0
- package/lib/typescript/src/plugin/withIosMath.d.ts +5 -0
- package/lib/typescript/src/plugin/withIosMath.d.ts.map +1 -0
- package/lib/typescript/src/plugin/withReactNativeEnrichedMarkdown.d.ts +6 -0
- package/lib/typescript/src/plugin/withReactNativeEnrichedMarkdown.d.ts.map +1 -0
- package/package.json +28 -13
- package/src/plugin/withAndroidMath.ts +26 -0
- package/src/plugin/withIosMath.ts +37 -0
- package/src/plugin/withReactNativeEnrichedMarkdown.ts +17 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/ComponentDescriptors.cpp +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/ComponentDescriptors.h +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/EventEmitters.cpp +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/EventEmitters.h +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/Props.cpp +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/RCTComponentViewHelpers.h +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/ShadowNodes.cpp +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/ShadowNodes.h +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/States.cpp +0 -0
- /package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/States.h +0 -0
package/ios/EnrichedMarkdown.mm
CHANGED
|
@@ -356,22 +356,15 @@ using namespace facebook::react;
|
|
|
356
356
|
});
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
- (
|
|
359
|
+
- (NSArray *)parseAndRenderSegments:(NSString *)markdownString
|
|
360
360
|
{
|
|
361
|
-
if (!markdownString || markdownString.length == 0) {
|
|
362
|
-
return;
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
_blockAsyncRender = YES;
|
|
366
|
-
_cachedMarkdown = [markdownString copy];
|
|
367
|
-
_renderedMarkdown = [markdownString copy];
|
|
368
|
-
|
|
369
361
|
MarkdownASTNode *ast = [_parser parseMarkdown:markdownString flags:_md4cFlags];
|
|
370
362
|
if (!ast) {
|
|
371
|
-
return;
|
|
363
|
+
return nil;
|
|
372
364
|
}
|
|
373
365
|
|
|
374
366
|
NSArray *segments = [self splitASTIntoSegments:ast];
|
|
367
|
+
NSMutableArray *renderedSegments = [NSMutableArray array];
|
|
375
368
|
|
|
376
369
|
for (id segment in segments) {
|
|
377
370
|
if ([segment isKindOfClass:[EMTextSegment class]]) {
|
|
@@ -380,19 +373,54 @@ using namespace facebook::react;
|
|
|
380
373
|
allowTrailingMargin:_allowTrailingMargin
|
|
381
374
|
allowFontScaling:_fontScaleObserver.allowFontScaling
|
|
382
375
|
maxFontSizeMultiplier:_maxFontSizeMultiplier];
|
|
383
|
-
|
|
376
|
+
[renderedSegments addObject:rendered];
|
|
377
|
+
} else if ([segment isKindOfClass:[EMTableSegment class]]) {
|
|
378
|
+
[renderedSegments addObject:segment];
|
|
379
|
+
}
|
|
380
|
+
#if ENRICHED_MARKDOWN_MATH
|
|
381
|
+
else if ([segment isKindOfClass:[EMMathSegment class]]) {
|
|
382
|
+
[renderedSegments addObject:segment];
|
|
383
|
+
}
|
|
384
|
+
#endif
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
return renderedSegments;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/// Synchronous rendering for mock view measurement (no UI updates needed).
|
|
391
|
+
- (void)renderMarkdownSynchronously:(NSString *)markdownString
|
|
392
|
+
{
|
|
393
|
+
if (!markdownString || markdownString.length == 0) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
for (UIView *view in _segmentViews) {
|
|
398
|
+
[view removeFromSuperview];
|
|
399
|
+
}
|
|
400
|
+
[_segmentViews removeAllObjects];
|
|
401
|
+
|
|
402
|
+
_blockAsyncRender = YES;
|
|
403
|
+
_cachedMarkdown = [markdownString copy];
|
|
404
|
+
_renderedMarkdown = [markdownString copy];
|
|
405
|
+
|
|
406
|
+
NSArray *renderedSegments = [self parseAndRenderSegments:markdownString];
|
|
407
|
+
if (!renderedSegments) {
|
|
408
|
+
return;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
for (id segment in renderedSegments) {
|
|
412
|
+
if ([segment isKindOfClass:[EMRenderedTextSegment class]]) {
|
|
413
|
+
EnrichedMarkdownInternalText *view = [self createTextViewForRenderedSegment:(EMRenderedTextSegment *)segment];
|
|
384
414
|
[_segmentViews addObject:view];
|
|
385
415
|
[self addSubview:view];
|
|
386
416
|
} else if ([segment isKindOfClass:[EMTableSegment class]]) {
|
|
387
|
-
|
|
388
|
-
TableContainerView *tableView = [self createTableViewForSegment:tableSegment];
|
|
417
|
+
TableContainerView *tableView = [self createTableViewForSegment:(EMTableSegment *)segment];
|
|
389
418
|
[_segmentViews addObject:tableView];
|
|
390
419
|
[self addSubview:tableView];
|
|
391
420
|
}
|
|
392
421
|
#if ENRICHED_MARKDOWN_MATH
|
|
393
422
|
else if ([segment isKindOfClass:[EMMathSegment class]]) {
|
|
394
|
-
|
|
395
|
-
ENRMMathContainerView *mathView = [self createMathViewForSegment:mathSegment];
|
|
423
|
+
ENRMMathContainerView *mathView = [self createMathViewForSegment:(EMMathSegment *)segment];
|
|
396
424
|
[_segmentViews addObject:mathView];
|
|
397
425
|
[self addSubview:mathView];
|
|
398
426
|
}
|
|
@@ -430,11 +458,17 @@ using namespace facebook::react;
|
|
|
430
458
|
#endif
|
|
431
459
|
}
|
|
432
460
|
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
461
|
+
// When bounds width is zero (recycled view not yet laid out), skip
|
|
462
|
+
// measurement — didMoveToWindow will handle it once the view has real
|
|
463
|
+
// bounds. Measuring with width=0 produces a bogus single-line measurement
|
|
464
|
+
// that corrupts the height sent to Yoga.
|
|
465
|
+
if (self.bounds.size.width > 0) {
|
|
466
|
+
[self setNeedsLayout];
|
|
436
467
|
|
|
437
|
-
|
|
468
|
+
if (needsHeightUpdate([self measureSize:self.bounds.size.width], self.bounds)) {
|
|
469
|
+
[self requestHeightUpdate];
|
|
470
|
+
}
|
|
471
|
+
}
|
|
438
472
|
}
|
|
439
473
|
|
|
440
474
|
- (EMRenderedTextSegment *)renderTextSegment:(EMTextSegment *)textSegment
|
|
@@ -605,6 +639,38 @@ using namespace facebook::react;
|
|
|
605
639
|
[super updateProps:props oldProps:oldProps];
|
|
606
640
|
}
|
|
607
641
|
|
|
642
|
+
- (void)didMoveToWindow
|
|
643
|
+
{
|
|
644
|
+
[super didMoveToWindow];
|
|
645
|
+
|
|
646
|
+
if (self.window && _renderedMarkdown != nil) {
|
|
647
|
+
for (UIView *segment in _segmentViews) {
|
|
648
|
+
if ([segment isKindOfClass:[EnrichedMarkdownInternalText class]]) {
|
|
649
|
+
EnrichedMarkdownInternalText *textSegment = (EnrichedMarkdownInternalText *)segment;
|
|
650
|
+
UITextView *textView = textSegment.textView;
|
|
651
|
+
textView.contentOffset = CGPointZero;
|
|
652
|
+
|
|
653
|
+
textView.frame = textSegment.bounds;
|
|
654
|
+
textView.textContainer.size = CGSizeMake(textView.bounds.size.width, CGFLOAT_MAX);
|
|
655
|
+
|
|
656
|
+
if (textView.attributedText.length > 0) {
|
|
657
|
+
[textView.layoutManager invalidateLayoutForCharacterRange:NSMakeRange(0, textView.attributedText.length)
|
|
658
|
+
actualCharacterRange:NULL];
|
|
659
|
+
[textView.layoutManager ensureLayoutForTextContainer:textView.textContainer];
|
|
660
|
+
}
|
|
661
|
+
|
|
662
|
+
[textView layoutIfNeeded];
|
|
663
|
+
[textView setNeedsDisplay];
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
|
|
667
|
+
CGSize measured = [self measureSize:self.bounds.size.width];
|
|
668
|
+
if (needsHeightUpdate(measured, self.bounds)) {
|
|
669
|
+
[self requestHeightUpdate];
|
|
670
|
+
}
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
|
|
608
674
|
Class<RCTComponentViewProtocol> EnrichedMarkdownCls(void)
|
|
609
675
|
{
|
|
610
676
|
return EnrichedMarkdown.class;
|
|
@@ -302,19 +302,11 @@ using namespace facebook::react;
|
|
|
302
302
|
});
|
|
303
303
|
}
|
|
304
304
|
|
|
305
|
-
|
|
306
|
-
- (void)renderMarkdownSynchronously:(NSString *)markdownString
|
|
305
|
+
- (NSMutableAttributedString *)parseAndRenderMarkdown:(NSString *)markdownString
|
|
307
306
|
{
|
|
308
|
-
if (!markdownString || markdownString.length == 0) {
|
|
309
|
-
return;
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
_blockAsyncRender = YES;
|
|
313
|
-
_cachedMarkdown = [markdownString copy];
|
|
314
|
-
|
|
315
307
|
MarkdownASTNode *ast = [_parser parseMarkdown:markdownString flags:_md4cFlags];
|
|
316
308
|
if (!ast) {
|
|
317
|
-
return;
|
|
309
|
+
return nil;
|
|
318
310
|
}
|
|
319
311
|
|
|
320
312
|
AttributedRenderer *renderer = [[AttributedRenderer alloc] initWithConfig:_config];
|
|
@@ -331,6 +323,24 @@ using namespace facebook::react;
|
|
|
331
323
|
|
|
332
324
|
_accessibilityInfo = [AccessibilityInfo infoFromContext:context];
|
|
333
325
|
|
|
326
|
+
return attributedText;
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
/// Synchronous rendering for mock view measurement (no UI updates needed).
|
|
330
|
+
- (void)renderMarkdownSynchronously:(NSString *)markdownString
|
|
331
|
+
{
|
|
332
|
+
if (!markdownString || markdownString.length == 0) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
_blockAsyncRender = YES;
|
|
337
|
+
_cachedMarkdown = [markdownString copy];
|
|
338
|
+
|
|
339
|
+
NSMutableAttributedString *attributedText = [self parseAndRenderMarkdown:markdownString];
|
|
340
|
+
if (!attributedText) {
|
|
341
|
+
return;
|
|
342
|
+
}
|
|
343
|
+
|
|
334
344
|
_textView.attributedText = attributedText;
|
|
335
345
|
_renderedMarkdown = [_cachedMarkdown copy];
|
|
336
346
|
}
|
|
@@ -346,18 +356,38 @@ using namespace facebook::react;
|
|
|
346
356
|
|
|
347
357
|
objc_setAssociatedObject(_textView.textContainer, kTextViewKey, _textView, OBJC_ASSOCIATION_ASSIGN);
|
|
348
358
|
|
|
359
|
+
// Ensure the text container has unlimited height before setting content.
|
|
360
|
+
// updateLayoutMetrics may have shrunk the frame (and thus the text container)
|
|
361
|
+
// from a previous layout pass, which would clip the new attributed text.
|
|
362
|
+
CGFloat containerWidth = _textView.textContainer.size.width;
|
|
363
|
+
if (containerWidth <= 0) {
|
|
364
|
+
containerWidth = self.bounds.size.width;
|
|
365
|
+
}
|
|
366
|
+
_textView.textContainer.size = CGSizeMake(containerWidth, CGFLOAT_MAX);
|
|
367
|
+
|
|
349
368
|
_textView.attributedText = attributedText;
|
|
350
369
|
_renderedMarkdown = [_cachedMarkdown copy];
|
|
351
370
|
|
|
352
371
|
[_textView.layoutManager invalidateLayoutForCharacterRange:NSMakeRange(0, attributedText.length)
|
|
353
372
|
actualCharacterRange:NULL];
|
|
354
373
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
374
|
+
// When bounds width is zero (recycled view not yet laid out), skip layout
|
|
375
|
+
// and measurement — didMoveToWindow will handle it once the view has real
|
|
376
|
+
// bounds. Measuring with width=0 produces a bogus single-line measurement
|
|
377
|
+
// that corrupts the height sent to Yoga.
|
|
378
|
+
if (self.bounds.size.width > 0) {
|
|
379
|
+
[_textView.layoutManager ensureLayoutForTextContainer:_textView.textContainer];
|
|
380
|
+
[_textView layoutIfNeeded];
|
|
358
381
|
|
|
359
|
-
|
|
360
|
-
[self
|
|
382
|
+
[_textView setNeedsDisplay];
|
|
383
|
+
[self setNeedsLayout];
|
|
384
|
+
|
|
385
|
+
CGSize measured = [self measureSize:self.bounds.size.width];
|
|
386
|
+
BOOL needsUpdate = needsHeightUpdate(measured, self.bounds);
|
|
387
|
+
|
|
388
|
+
if (needsUpdate) {
|
|
389
|
+
[self requestHeightUpdate];
|
|
390
|
+
}
|
|
361
391
|
}
|
|
362
392
|
|
|
363
393
|
_accessibilityNeedsRebuild = YES;
|
|
@@ -463,6 +493,35 @@ using namespace facebook::react;
|
|
|
463
493
|
[super updateProps:props oldProps:oldProps];
|
|
464
494
|
}
|
|
465
495
|
|
|
496
|
+
- (void)didMoveToWindow
|
|
497
|
+
{
|
|
498
|
+
[super didMoveToWindow];
|
|
499
|
+
|
|
500
|
+
if (self.window && _renderedMarkdown != nil) {
|
|
501
|
+
_textView.hidden = NO;
|
|
502
|
+
_textView.contentOffset = CGPointZero;
|
|
503
|
+
|
|
504
|
+
_textView.frame = self.bounds;
|
|
505
|
+
_textView.textContainer.size = CGSizeMake(self.bounds.size.width, CGFLOAT_MAX);
|
|
506
|
+
|
|
507
|
+
NSAttributedString *text = _textView.attributedText;
|
|
508
|
+
if (text.length > 0) {
|
|
509
|
+
[_textView.layoutManager invalidateLayoutForCharacterRange:NSMakeRange(0, text.length) actualCharacterRange:NULL];
|
|
510
|
+
[_textView.layoutManager ensureLayoutForTextContainer:_textView.textContainer];
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
[_textView layoutIfNeeded];
|
|
514
|
+
[_textView setNeedsDisplay];
|
|
515
|
+
|
|
516
|
+
CGSize measured = [self measureSize:self.bounds.size.width];
|
|
517
|
+
BOOL needsUpdate = needsHeightUpdate(measured, self.bounds);
|
|
518
|
+
|
|
519
|
+
if (needsUpdate) {
|
|
520
|
+
[self requestHeightUpdate];
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
|
|
466
525
|
Class<RCTComponentViewProtocol> EnrichedMarkdownTextCls(void)
|
|
467
526
|
{
|
|
468
527
|
return EnrichedMarkdownText.class;
|
package/ios/generated/{EnrichedMarkdownTextSpec → ReactCodegen/EnrichedMarkdownTextSpec}/Props.h
RENAMED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
#include <react/renderer/components/view/ViewProps.h>
|
|
13
13
|
#include <react/renderer/core/PropsParserContext.h>
|
|
14
14
|
#include <react/renderer/core/propsConversions.h>
|
|
15
|
+
#include <react/renderer/debug/DebugStringConvertible.h>
|
|
15
16
|
#include <react/renderer/graphics/Color.h>
|
|
16
17
|
|
|
17
18
|
namespace facebook::react {
|
|
@@ -26,6 +27,7 @@ struct EnrichedMarkdownMarkdownStyleParagraphStruct {
|
|
|
26
27
|
Float lineHeight{0.0};
|
|
27
28
|
std::string textAlign{};
|
|
28
29
|
|
|
30
|
+
|
|
29
31
|
#ifdef RN_SERIALIZABLE_STATE
|
|
30
32
|
bool operator==(const EnrichedMarkdownMarkdownStyleParagraphStruct&) const = default;
|
|
31
33
|
|
|
@@ -101,6 +103,7 @@ struct EnrichedMarkdownMarkdownStyleH1Struct {
|
|
|
101
103
|
Float lineHeight{0.0};
|
|
102
104
|
std::string textAlign{};
|
|
103
105
|
|
|
106
|
+
|
|
104
107
|
#ifdef RN_SERIALIZABLE_STATE
|
|
105
108
|
bool operator==(const EnrichedMarkdownMarkdownStyleH1Struct&) const = default;
|
|
106
109
|
|
|
@@ -176,6 +179,7 @@ struct EnrichedMarkdownMarkdownStyleH2Struct {
|
|
|
176
179
|
Float lineHeight{0.0};
|
|
177
180
|
std::string textAlign{};
|
|
178
181
|
|
|
182
|
+
|
|
179
183
|
#ifdef RN_SERIALIZABLE_STATE
|
|
180
184
|
bool operator==(const EnrichedMarkdownMarkdownStyleH2Struct&) const = default;
|
|
181
185
|
|
|
@@ -251,6 +255,7 @@ struct EnrichedMarkdownMarkdownStyleH3Struct {
|
|
|
251
255
|
Float lineHeight{0.0};
|
|
252
256
|
std::string textAlign{};
|
|
253
257
|
|
|
258
|
+
|
|
254
259
|
#ifdef RN_SERIALIZABLE_STATE
|
|
255
260
|
bool operator==(const EnrichedMarkdownMarkdownStyleH3Struct&) const = default;
|
|
256
261
|
|
|
@@ -326,6 +331,7 @@ struct EnrichedMarkdownMarkdownStyleH4Struct {
|
|
|
326
331
|
Float lineHeight{0.0};
|
|
327
332
|
std::string textAlign{};
|
|
328
333
|
|
|
334
|
+
|
|
329
335
|
#ifdef RN_SERIALIZABLE_STATE
|
|
330
336
|
bool operator==(const EnrichedMarkdownMarkdownStyleH4Struct&) const = default;
|
|
331
337
|
|
|
@@ -401,6 +407,7 @@ struct EnrichedMarkdownMarkdownStyleH5Struct {
|
|
|
401
407
|
Float lineHeight{0.0};
|
|
402
408
|
std::string textAlign{};
|
|
403
409
|
|
|
410
|
+
|
|
404
411
|
#ifdef RN_SERIALIZABLE_STATE
|
|
405
412
|
bool operator==(const EnrichedMarkdownMarkdownStyleH5Struct&) const = default;
|
|
406
413
|
|
|
@@ -476,6 +483,7 @@ struct EnrichedMarkdownMarkdownStyleH6Struct {
|
|
|
476
483
|
Float lineHeight{0.0};
|
|
477
484
|
std::string textAlign{};
|
|
478
485
|
|
|
486
|
+
|
|
479
487
|
#ifdef RN_SERIALIZABLE_STATE
|
|
480
488
|
bool operator==(const EnrichedMarkdownMarkdownStyleH6Struct&) const = default;
|
|
481
489
|
|
|
@@ -554,6 +562,7 @@ struct EnrichedMarkdownMarkdownStyleBlockquoteStruct {
|
|
|
554
562
|
Float gapWidth{0.0};
|
|
555
563
|
SharedColor backgroundColor{};
|
|
556
564
|
|
|
565
|
+
|
|
557
566
|
#ifdef RN_SERIALIZABLE_STATE
|
|
558
567
|
bool operator==(const EnrichedMarkdownMarkdownStyleBlockquoteStruct&) const = default;
|
|
559
568
|
|
|
@@ -649,6 +658,7 @@ struct EnrichedMarkdownMarkdownStyleListStruct {
|
|
|
649
658
|
Float gapWidth{0.0};
|
|
650
659
|
Float marginLeft{0.0};
|
|
651
660
|
|
|
661
|
+
|
|
652
662
|
#ifdef RN_SERIALIZABLE_STATE
|
|
653
663
|
bool operator==(const EnrichedMarkdownMarkdownStyleListStruct&) const = default;
|
|
654
664
|
|
|
@@ -753,6 +763,7 @@ struct EnrichedMarkdownMarkdownStyleCodeBlockStruct {
|
|
|
753
763
|
Float borderWidth{0.0};
|
|
754
764
|
Float padding{0.0};
|
|
755
765
|
|
|
766
|
+
|
|
756
767
|
#ifdef RN_SERIALIZABLE_STATE
|
|
757
768
|
bool operator==(const EnrichedMarkdownMarkdownStyleCodeBlockStruct&) const = default;
|
|
758
769
|
|
|
@@ -843,6 +854,7 @@ struct EnrichedMarkdownMarkdownStyleLinkStruct {
|
|
|
843
854
|
SharedColor color{};
|
|
844
855
|
bool underline{false};
|
|
845
856
|
|
|
857
|
+
|
|
846
858
|
#ifdef RN_SERIALIZABLE_STATE
|
|
847
859
|
bool operator==(const EnrichedMarkdownMarkdownStyleLinkStruct&) const = default;
|
|
848
860
|
|
|
@@ -888,6 +900,7 @@ struct EnrichedMarkdownMarkdownStyleStrongStruct {
|
|
|
888
900
|
std::string fontWeight{};
|
|
889
901
|
SharedColor color{};
|
|
890
902
|
|
|
903
|
+
|
|
891
904
|
#ifdef RN_SERIALIZABLE_STATE
|
|
892
905
|
bool operator==(const EnrichedMarkdownMarkdownStyleStrongStruct&) const = default;
|
|
893
906
|
|
|
@@ -933,6 +946,7 @@ struct EnrichedMarkdownMarkdownStyleEmStruct {
|
|
|
933
946
|
std::string fontStyle{};
|
|
934
947
|
SharedColor color{};
|
|
935
948
|
|
|
949
|
+
|
|
936
950
|
#ifdef RN_SERIALIZABLE_STATE
|
|
937
951
|
bool operator==(const EnrichedMarkdownMarkdownStyleEmStruct&) const = default;
|
|
938
952
|
|
|
@@ -976,6 +990,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownMarkdownStyleEmStru
|
|
|
976
990
|
struct EnrichedMarkdownMarkdownStyleStrikethroughStruct {
|
|
977
991
|
SharedColor color{};
|
|
978
992
|
|
|
993
|
+
|
|
979
994
|
#ifdef RN_SERIALIZABLE_STATE
|
|
980
995
|
bool operator==(const EnrichedMarkdownMarkdownStyleStrikethroughStruct&) const = default;
|
|
981
996
|
|
|
@@ -1009,6 +1024,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownMarkdownStyleStrike
|
|
|
1009
1024
|
struct EnrichedMarkdownMarkdownStyleUnderlineStruct {
|
|
1010
1025
|
SharedColor color{};
|
|
1011
1026
|
|
|
1027
|
+
|
|
1012
1028
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1013
1029
|
bool operator==(const EnrichedMarkdownMarkdownStyleUnderlineStruct&) const = default;
|
|
1014
1030
|
|
|
@@ -1046,6 +1062,7 @@ struct EnrichedMarkdownMarkdownStyleCodeStruct {
|
|
|
1046
1062
|
SharedColor backgroundColor{};
|
|
1047
1063
|
SharedColor borderColor{};
|
|
1048
1064
|
|
|
1065
|
+
|
|
1049
1066
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1050
1067
|
bool operator==(const EnrichedMarkdownMarkdownStyleCodeStruct&) const = default;
|
|
1051
1068
|
|
|
@@ -1102,6 +1119,7 @@ struct EnrichedMarkdownMarkdownStyleImageStruct {
|
|
|
1102
1119
|
Float marginTop{0.0};
|
|
1103
1120
|
Float marginBottom{0.0};
|
|
1104
1121
|
|
|
1122
|
+
|
|
1105
1123
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1106
1124
|
bool operator==(const EnrichedMarkdownMarkdownStyleImageStruct&) const = default;
|
|
1107
1125
|
|
|
@@ -1150,6 +1168,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownMarkdownStyleImageS
|
|
|
1150
1168
|
struct EnrichedMarkdownMarkdownStyleInlineImageStruct {
|
|
1151
1169
|
Float size{0.0};
|
|
1152
1170
|
|
|
1171
|
+
|
|
1153
1172
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1154
1173
|
bool operator==(const EnrichedMarkdownMarkdownStyleInlineImageStruct&) const = default;
|
|
1155
1174
|
|
|
@@ -1186,6 +1205,7 @@ struct EnrichedMarkdownMarkdownStyleThematicBreakStruct {
|
|
|
1186
1205
|
Float marginTop{0.0};
|
|
1187
1206
|
Float marginBottom{0.0};
|
|
1188
1207
|
|
|
1208
|
+
|
|
1189
1209
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1190
1210
|
bool operator==(const EnrichedMarkdownMarkdownStyleThematicBreakStruct&) const = default;
|
|
1191
1211
|
|
|
@@ -1250,6 +1270,7 @@ struct EnrichedMarkdownMarkdownStyleTableStruct {
|
|
|
1250
1270
|
Float cellPaddingHorizontal{0.0};
|
|
1251
1271
|
Float cellPaddingVertical{0.0};
|
|
1252
1272
|
|
|
1273
|
+
|
|
1253
1274
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1254
1275
|
bool operator==(const EnrichedMarkdownMarkdownStyleTableStruct&) const = default;
|
|
1255
1276
|
|
|
@@ -1369,6 +1390,7 @@ struct EnrichedMarkdownMarkdownStyleTaskListStruct {
|
|
|
1369
1390
|
SharedColor checkedTextColor{};
|
|
1370
1391
|
bool checkedStrikethrough{false};
|
|
1371
1392
|
|
|
1393
|
+
|
|
1372
1394
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1373
1395
|
bool operator==(const EnrichedMarkdownMarkdownStyleTaskListStruct&) const = default;
|
|
1374
1396
|
|
|
@@ -1438,6 +1460,7 @@ struct EnrichedMarkdownMarkdownStyleMathStruct {
|
|
|
1438
1460
|
Float marginBottom{0.0};
|
|
1439
1461
|
std::string textAlign{};
|
|
1440
1462
|
|
|
1463
|
+
|
|
1441
1464
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1442
1465
|
bool operator==(const EnrichedMarkdownMarkdownStyleMathStruct&) const = default;
|
|
1443
1466
|
|
|
@@ -1501,6 +1524,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownMarkdownStyleMathSt
|
|
|
1501
1524
|
struct EnrichedMarkdownMarkdownStyleInlineMathStruct {
|
|
1502
1525
|
SharedColor color{};
|
|
1503
1526
|
|
|
1527
|
+
|
|
1504
1528
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1505
1529
|
bool operator==(const EnrichedMarkdownMarkdownStyleInlineMathStruct&) const = default;
|
|
1506
1530
|
|
|
@@ -1556,6 +1580,7 @@ struct EnrichedMarkdownMarkdownStyleStruct {
|
|
|
1556
1580
|
EnrichedMarkdownMarkdownStyleMathStruct math{};
|
|
1557
1581
|
EnrichedMarkdownMarkdownStyleInlineMathStruct inlineMath{};
|
|
1558
1582
|
|
|
1583
|
+
|
|
1559
1584
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1560
1585
|
bool operator==(const EnrichedMarkdownMarkdownStyleStruct&) const = default;
|
|
1561
1586
|
|
|
@@ -1700,6 +1725,7 @@ struct EnrichedMarkdownMd4cFlagsStruct {
|
|
|
1700
1725
|
bool underline{false};
|
|
1701
1726
|
bool latexMath{false};
|
|
1702
1727
|
|
|
1728
|
+
|
|
1703
1729
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1704
1730
|
bool operator==(const EnrichedMarkdownMd4cFlagsStruct&) const = default;
|
|
1705
1731
|
|
|
@@ -1756,6 +1782,8 @@ class EnrichedMarkdownProps final : public ViewProps {
|
|
|
1756
1782
|
|
|
1757
1783
|
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
|
1758
1784
|
#endif
|
|
1785
|
+
|
|
1786
|
+
|
|
1759
1787
|
};
|
|
1760
1788
|
|
|
1761
1789
|
struct EnrichedMarkdownTextMarkdownStyleParagraphStruct {
|
|
@@ -1768,6 +1796,7 @@ struct EnrichedMarkdownTextMarkdownStyleParagraphStruct {
|
|
|
1768
1796
|
Float lineHeight{0.0};
|
|
1769
1797
|
std::string textAlign{};
|
|
1770
1798
|
|
|
1799
|
+
|
|
1771
1800
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1772
1801
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleParagraphStruct&) const = default;
|
|
1773
1802
|
|
|
@@ -1843,6 +1872,7 @@ struct EnrichedMarkdownTextMarkdownStyleH1Struct {
|
|
|
1843
1872
|
Float lineHeight{0.0};
|
|
1844
1873
|
std::string textAlign{};
|
|
1845
1874
|
|
|
1875
|
+
|
|
1846
1876
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1847
1877
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleH1Struct&) const = default;
|
|
1848
1878
|
|
|
@@ -1918,6 +1948,7 @@ struct EnrichedMarkdownTextMarkdownStyleH2Struct {
|
|
|
1918
1948
|
Float lineHeight{0.0};
|
|
1919
1949
|
std::string textAlign{};
|
|
1920
1950
|
|
|
1951
|
+
|
|
1921
1952
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1922
1953
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleH2Struct&) const = default;
|
|
1923
1954
|
|
|
@@ -1993,6 +2024,7 @@ struct EnrichedMarkdownTextMarkdownStyleH3Struct {
|
|
|
1993
2024
|
Float lineHeight{0.0};
|
|
1994
2025
|
std::string textAlign{};
|
|
1995
2026
|
|
|
2027
|
+
|
|
1996
2028
|
#ifdef RN_SERIALIZABLE_STATE
|
|
1997
2029
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleH3Struct&) const = default;
|
|
1998
2030
|
|
|
@@ -2068,6 +2100,7 @@ struct EnrichedMarkdownTextMarkdownStyleH4Struct {
|
|
|
2068
2100
|
Float lineHeight{0.0};
|
|
2069
2101
|
std::string textAlign{};
|
|
2070
2102
|
|
|
2103
|
+
|
|
2071
2104
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2072
2105
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleH4Struct&) const = default;
|
|
2073
2106
|
|
|
@@ -2143,6 +2176,7 @@ struct EnrichedMarkdownTextMarkdownStyleH5Struct {
|
|
|
2143
2176
|
Float lineHeight{0.0};
|
|
2144
2177
|
std::string textAlign{};
|
|
2145
2178
|
|
|
2179
|
+
|
|
2146
2180
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2147
2181
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleH5Struct&) const = default;
|
|
2148
2182
|
|
|
@@ -2218,6 +2252,7 @@ struct EnrichedMarkdownTextMarkdownStyleH6Struct {
|
|
|
2218
2252
|
Float lineHeight{0.0};
|
|
2219
2253
|
std::string textAlign{};
|
|
2220
2254
|
|
|
2255
|
+
|
|
2221
2256
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2222
2257
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleH6Struct&) const = default;
|
|
2223
2258
|
|
|
@@ -2296,6 +2331,7 @@ struct EnrichedMarkdownTextMarkdownStyleBlockquoteStruct {
|
|
|
2296
2331
|
Float gapWidth{0.0};
|
|
2297
2332
|
SharedColor backgroundColor{};
|
|
2298
2333
|
|
|
2334
|
+
|
|
2299
2335
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2300
2336
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleBlockquoteStruct&) const = default;
|
|
2301
2337
|
|
|
@@ -2391,6 +2427,7 @@ struct EnrichedMarkdownTextMarkdownStyleListStruct {
|
|
|
2391
2427
|
Float gapWidth{0.0};
|
|
2392
2428
|
Float marginLeft{0.0};
|
|
2393
2429
|
|
|
2430
|
+
|
|
2394
2431
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2395
2432
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleListStruct&) const = default;
|
|
2396
2433
|
|
|
@@ -2495,6 +2532,7 @@ struct EnrichedMarkdownTextMarkdownStyleCodeBlockStruct {
|
|
|
2495
2532
|
Float borderWidth{0.0};
|
|
2496
2533
|
Float padding{0.0};
|
|
2497
2534
|
|
|
2535
|
+
|
|
2498
2536
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2499
2537
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleCodeBlockStruct&) const = default;
|
|
2500
2538
|
|
|
@@ -2585,6 +2623,7 @@ struct EnrichedMarkdownTextMarkdownStyleLinkStruct {
|
|
|
2585
2623
|
SharedColor color{};
|
|
2586
2624
|
bool underline{false};
|
|
2587
2625
|
|
|
2626
|
+
|
|
2588
2627
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2589
2628
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleLinkStruct&) const = default;
|
|
2590
2629
|
|
|
@@ -2630,6 +2669,7 @@ struct EnrichedMarkdownTextMarkdownStyleStrongStruct {
|
|
|
2630
2669
|
std::string fontWeight{};
|
|
2631
2670
|
SharedColor color{};
|
|
2632
2671
|
|
|
2672
|
+
|
|
2633
2673
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2634
2674
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleStrongStruct&) const = default;
|
|
2635
2675
|
|
|
@@ -2675,6 +2715,7 @@ struct EnrichedMarkdownTextMarkdownStyleEmStruct {
|
|
|
2675
2715
|
std::string fontStyle{};
|
|
2676
2716
|
SharedColor color{};
|
|
2677
2717
|
|
|
2718
|
+
|
|
2678
2719
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2679
2720
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleEmStruct&) const = default;
|
|
2680
2721
|
|
|
@@ -2718,6 +2759,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownTextMarkdownStyleEm
|
|
|
2718
2759
|
struct EnrichedMarkdownTextMarkdownStyleStrikethroughStruct {
|
|
2719
2760
|
SharedColor color{};
|
|
2720
2761
|
|
|
2762
|
+
|
|
2721
2763
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2722
2764
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleStrikethroughStruct&) const = default;
|
|
2723
2765
|
|
|
@@ -2751,6 +2793,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownTextMarkdownStyleSt
|
|
|
2751
2793
|
struct EnrichedMarkdownTextMarkdownStyleUnderlineStruct {
|
|
2752
2794
|
SharedColor color{};
|
|
2753
2795
|
|
|
2796
|
+
|
|
2754
2797
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2755
2798
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleUnderlineStruct&) const = default;
|
|
2756
2799
|
|
|
@@ -2788,6 +2831,7 @@ struct EnrichedMarkdownTextMarkdownStyleCodeStruct {
|
|
|
2788
2831
|
SharedColor backgroundColor{};
|
|
2789
2832
|
SharedColor borderColor{};
|
|
2790
2833
|
|
|
2834
|
+
|
|
2791
2835
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2792
2836
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleCodeStruct&) const = default;
|
|
2793
2837
|
|
|
@@ -2844,6 +2888,7 @@ struct EnrichedMarkdownTextMarkdownStyleImageStruct {
|
|
|
2844
2888
|
Float marginTop{0.0};
|
|
2845
2889
|
Float marginBottom{0.0};
|
|
2846
2890
|
|
|
2891
|
+
|
|
2847
2892
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2848
2893
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleImageStruct&) const = default;
|
|
2849
2894
|
|
|
@@ -2892,6 +2937,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownTextMarkdownStyleIm
|
|
|
2892
2937
|
struct EnrichedMarkdownTextMarkdownStyleInlineImageStruct {
|
|
2893
2938
|
Float size{0.0};
|
|
2894
2939
|
|
|
2940
|
+
|
|
2895
2941
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2896
2942
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleInlineImageStruct&) const = default;
|
|
2897
2943
|
|
|
@@ -2928,6 +2974,7 @@ struct EnrichedMarkdownTextMarkdownStyleThematicBreakStruct {
|
|
|
2928
2974
|
Float marginTop{0.0};
|
|
2929
2975
|
Float marginBottom{0.0};
|
|
2930
2976
|
|
|
2977
|
+
|
|
2931
2978
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2932
2979
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleThematicBreakStruct&) const = default;
|
|
2933
2980
|
|
|
@@ -2992,6 +3039,7 @@ struct EnrichedMarkdownTextMarkdownStyleTableStruct {
|
|
|
2992
3039
|
Float cellPaddingHorizontal{0.0};
|
|
2993
3040
|
Float cellPaddingVertical{0.0};
|
|
2994
3041
|
|
|
3042
|
+
|
|
2995
3043
|
#ifdef RN_SERIALIZABLE_STATE
|
|
2996
3044
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleTableStruct&) const = default;
|
|
2997
3045
|
|
|
@@ -3111,6 +3159,7 @@ struct EnrichedMarkdownTextMarkdownStyleTaskListStruct {
|
|
|
3111
3159
|
SharedColor checkedTextColor{};
|
|
3112
3160
|
bool checkedStrikethrough{false};
|
|
3113
3161
|
|
|
3162
|
+
|
|
3114
3163
|
#ifdef RN_SERIALIZABLE_STATE
|
|
3115
3164
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleTaskListStruct&) const = default;
|
|
3116
3165
|
|
|
@@ -3180,6 +3229,7 @@ struct EnrichedMarkdownTextMarkdownStyleMathStruct {
|
|
|
3180
3229
|
Float marginBottom{0.0};
|
|
3181
3230
|
std::string textAlign{};
|
|
3182
3231
|
|
|
3232
|
+
|
|
3183
3233
|
#ifdef RN_SERIALIZABLE_STATE
|
|
3184
3234
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleMathStruct&) const = default;
|
|
3185
3235
|
|
|
@@ -3243,6 +3293,7 @@ static inline folly::dynamic toDynamic(const EnrichedMarkdownTextMarkdownStyleMa
|
|
|
3243
3293
|
struct EnrichedMarkdownTextMarkdownStyleInlineMathStruct {
|
|
3244
3294
|
SharedColor color{};
|
|
3245
3295
|
|
|
3296
|
+
|
|
3246
3297
|
#ifdef RN_SERIALIZABLE_STATE
|
|
3247
3298
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleInlineMathStruct&) const = default;
|
|
3248
3299
|
|
|
@@ -3298,6 +3349,7 @@ struct EnrichedMarkdownTextMarkdownStyleStruct {
|
|
|
3298
3349
|
EnrichedMarkdownTextMarkdownStyleMathStruct math{};
|
|
3299
3350
|
EnrichedMarkdownTextMarkdownStyleInlineMathStruct inlineMath{};
|
|
3300
3351
|
|
|
3352
|
+
|
|
3301
3353
|
#ifdef RN_SERIALIZABLE_STATE
|
|
3302
3354
|
bool operator==(const EnrichedMarkdownTextMarkdownStyleStruct&) const = default;
|
|
3303
3355
|
|
|
@@ -3442,6 +3494,7 @@ struct EnrichedMarkdownTextMd4cFlagsStruct {
|
|
|
3442
3494
|
bool underline{false};
|
|
3443
3495
|
bool latexMath{false};
|
|
3444
3496
|
|
|
3497
|
+
|
|
3445
3498
|
#ifdef RN_SERIALIZABLE_STATE
|
|
3446
3499
|
bool operator==(const EnrichedMarkdownTextMd4cFlagsStruct&) const = default;
|
|
3447
3500
|
|
|
@@ -3498,6 +3551,8 @@ class EnrichedMarkdownTextProps final : public ViewProps {
|
|
|
3498
3551
|
|
|
3499
3552
|
folly::dynamic getDiffProps(const Props* prevProps) const override;
|
|
3500
3553
|
#endif
|
|
3554
|
+
|
|
3555
|
+
|
|
3501
3556
|
};
|
|
3502
3557
|
|
|
3503
3558
|
} // namespace facebook::react
|