@zohodesk/components 1.4.22 → 1.4.23
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/README.md +5 -0
- package/es/Typography/Typography.js +9 -2
- package/es/Typography/__tests__/Typography.spec.js +427 -0
- package/es/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/es/Typography/props/defaultProps.js +2 -1
- package/es/Typography/props/propTypes.js +24 -5
- package/es/Typography/utils/textHighlighter.js +139 -0
- package/lib/Typography/Typography.js +9 -2
- package/lib/Typography/__tests__/Typography.spec.js +436 -0
- package/lib/Typography/__tests__/__snapshots__/Typography.spec.js.snap +506 -0
- package/lib/Typography/props/defaultProps.js +2 -1
- package/lib/Typography/props/propTypes.js +31 -6
- package/lib/Typography/utils/textHighlighter.js +160 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Dot UI is a customizable React component library built to deliver a clean, accessible, and developer-friendly UI experience. It offers a growing set of reusable components designed to align with modern design systems and streamline application development across projects.
|
|
4
4
|
|
|
5
|
+
# 1.4.23
|
|
6
|
+
|
|
7
|
+
- **Typography**
|
|
8
|
+
- Added support for text highlighting via `$ui_highlightConfig` prop.
|
|
9
|
+
|
|
5
10
|
# 1.4.22
|
|
6
11
|
|
|
7
12
|
- **New Components**
|
|
@@ -3,6 +3,7 @@ import { defaultProps } from "./props/defaultProps";
|
|
|
3
3
|
import { propTypes } from "./props/propTypes";
|
|
4
4
|
import cssJSLogic from "./css/cssJSLogic";
|
|
5
5
|
import { mergeStyle } from '@zohodesk/utils';
|
|
6
|
+
import { highlightText } from "./utils/textHighlighter";
|
|
6
7
|
import defaultStyle from "./css/Typography.module.css";
|
|
7
8
|
|
|
8
9
|
const Typography = props => {
|
|
@@ -14,8 +15,12 @@ const Typography = props => {
|
|
|
14
15
|
customId,
|
|
15
16
|
$tagAttributes_text,
|
|
16
17
|
$a11yAttributes_text,
|
|
17
|
-
customStyle
|
|
18
|
+
customStyle,
|
|
19
|
+
$ui_highlightConfig
|
|
18
20
|
} = props;
|
|
21
|
+
const {
|
|
22
|
+
data: highlightData = []
|
|
23
|
+
} = $ui_highlightConfig;
|
|
19
24
|
const style = mergeStyle(defaultStyle, customStyle);
|
|
20
25
|
const {
|
|
21
26
|
typographyClass
|
|
@@ -30,7 +35,9 @@ const Typography = props => {
|
|
|
30
35
|
'data-test-id': testId,
|
|
31
36
|
...$tagAttributes_text,
|
|
32
37
|
...$a11yAttributes_text
|
|
33
|
-
}, children
|
|
38
|
+
}, highlightData && highlightData.length > 0 && typeof children === 'string' ? highlightText({ ...$ui_highlightConfig,
|
|
39
|
+
text: children
|
|
40
|
+
}) : children);
|
|
34
41
|
};
|
|
35
42
|
|
|
36
43
|
Typography.propTypes = propTypes;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { render } from '@testing-library/react';
|
|
3
3
|
import Typography from "../Typography";
|
|
4
|
+
import Tag from "../../Tag/Tag";
|
|
4
5
|
describe('Typography', () => {
|
|
5
6
|
const ui_size = ['7', '8', '9', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '24', '25', '26', '28', '29', '30', '32', '34', '35', '36', '40', '50', 'inherit'];
|
|
6
7
|
const ui_lineClamp = ['1', '2', '3', '4', '5'];
|
|
@@ -222,4 +223,430 @@ describe('Typography', () => {
|
|
|
222
223
|
}, "Heading"));
|
|
223
224
|
expect(asFragment()).toMatchSnapshot();
|
|
224
225
|
});
|
|
226
|
+
});
|
|
227
|
+
describe('Typography with highlight', () => {
|
|
228
|
+
test('should render highlighted word', () => {
|
|
229
|
+
const {
|
|
230
|
+
asFragment
|
|
231
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
232
|
+
$ui_highlightConfig: {
|
|
233
|
+
data: ['sun'],
|
|
234
|
+
styleConfiguration: {
|
|
235
|
+
$ui_weight: 'bold'
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
}, "The sun was bright, the sun was warm, the sun was high in the sky."));
|
|
239
|
+
expect(asFragment()).toMatchSnapshot();
|
|
240
|
+
});
|
|
241
|
+
test('should render highlight by Index', () => {
|
|
242
|
+
const {
|
|
243
|
+
asFragment
|
|
244
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
245
|
+
$ui_highlightConfig: {
|
|
246
|
+
data: [{
|
|
247
|
+
text: 'sun',
|
|
248
|
+
index: [1, 2]
|
|
249
|
+
}, {
|
|
250
|
+
text: 'under',
|
|
251
|
+
index: 1
|
|
252
|
+
}],
|
|
253
|
+
styleConfiguration: {
|
|
254
|
+
$ui_weight: 'bold',
|
|
255
|
+
$ui_decoration: 'underline'
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}, "The sun was bright, I walked under the sun, I talked under the sun."));
|
|
259
|
+
expect(asFragment()).toMatchSnapshot();
|
|
260
|
+
});
|
|
261
|
+
test('should render separate Styles per Word', () => {
|
|
262
|
+
const {
|
|
263
|
+
asFragment
|
|
264
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
265
|
+
$ui_highlightConfig: {
|
|
266
|
+
data: [{
|
|
267
|
+
text: 'sun',
|
|
268
|
+
styleConfiguration: {
|
|
269
|
+
$ui_weight: 'bold'
|
|
270
|
+
}
|
|
271
|
+
}, {
|
|
272
|
+
text: 'under',
|
|
273
|
+
styleConfiguration: {
|
|
274
|
+
$ui_decoration: 'underline'
|
|
275
|
+
}
|
|
276
|
+
}]
|
|
277
|
+
}
|
|
278
|
+
}, "The sun was bright, I walked under the sun, I talked under the sun."));
|
|
279
|
+
expect(asFragment()).toMatchSnapshot();
|
|
280
|
+
});
|
|
281
|
+
test('should render globally skip highlights at given indexes, with shouldExcludeIndices', () => {
|
|
282
|
+
const {
|
|
283
|
+
asFragment
|
|
284
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
285
|
+
$ui_highlightConfig: {
|
|
286
|
+
data: [{
|
|
287
|
+
text: 'sun',
|
|
288
|
+
index: 1
|
|
289
|
+
}, {
|
|
290
|
+
text: 'moon',
|
|
291
|
+
index: [2, 3]
|
|
292
|
+
}],
|
|
293
|
+
shouldExcludeIndices: true,
|
|
294
|
+
styleConfiguration: {
|
|
295
|
+
$ui_weight: 'bold',
|
|
296
|
+
$ui_decoration: 'underline'
|
|
297
|
+
}
|
|
298
|
+
}
|
|
299
|
+
}, "The sun was bright, the sun was warm, the sun was high in the sky."));
|
|
300
|
+
expect(asFragment()).toMatchSnapshot();
|
|
301
|
+
});
|
|
302
|
+
test('should render with separate excluded index option per word', () => {
|
|
303
|
+
const {
|
|
304
|
+
asFragment
|
|
305
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
306
|
+
$ui_highlightConfig: {
|
|
307
|
+
data: [{
|
|
308
|
+
text: 'sun',
|
|
309
|
+
index: 1,
|
|
310
|
+
shouldExcludeIndices: true
|
|
311
|
+
}, {
|
|
312
|
+
text: 'moon',
|
|
313
|
+
index: [2, 3],
|
|
314
|
+
shouldExcludeIndices: false
|
|
315
|
+
}],
|
|
316
|
+
styleConfiguration: {
|
|
317
|
+
$ui_weight: 'bold',
|
|
318
|
+
$ui_decoration: 'underline'
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
}, "The sun was bright, the moon was bright, the sun and moon again."));
|
|
322
|
+
expect(asFragment()).toMatchSnapshot();
|
|
323
|
+
});
|
|
324
|
+
test('should render with global tagName applied to all highlights', () => {
|
|
325
|
+
const {
|
|
326
|
+
asFragment
|
|
327
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
328
|
+
$ui_highlightConfig: {
|
|
329
|
+
data: [{
|
|
330
|
+
text: 'sun'
|
|
331
|
+
}, {
|
|
332
|
+
text: 'moon'
|
|
333
|
+
}],
|
|
334
|
+
tagName: 'i'
|
|
335
|
+
}
|
|
336
|
+
}, "The sun and moon were bright."));
|
|
337
|
+
expect(asFragment()).toMatchSnapshot();
|
|
338
|
+
});
|
|
339
|
+
test('should render with separate tagName for each highlighted word', () => {
|
|
340
|
+
const {
|
|
341
|
+
asFragment
|
|
342
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
343
|
+
$ui_highlightConfig: {
|
|
344
|
+
data: [{
|
|
345
|
+
text: 'sun',
|
|
346
|
+
tagName: 'i'
|
|
347
|
+
}, {
|
|
348
|
+
text: 'moon',
|
|
349
|
+
tagName: 'u'
|
|
350
|
+
}]
|
|
351
|
+
}
|
|
352
|
+
}, "The sun and moon were bright."));
|
|
353
|
+
expect(asFragment()).toMatchSnapshot();
|
|
354
|
+
});
|
|
355
|
+
test('should render with global case-sensitive option', () => {
|
|
356
|
+
const {
|
|
357
|
+
asFragment
|
|
358
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
359
|
+
$ui_highlightConfig: {
|
|
360
|
+
data: [{
|
|
361
|
+
text: 'Sun'
|
|
362
|
+
}, {
|
|
363
|
+
text: 'moon'
|
|
364
|
+
}],
|
|
365
|
+
styleConfiguration: {
|
|
366
|
+
$ui_weight: 'bold',
|
|
367
|
+
$ui_decoration: 'underline'
|
|
368
|
+
},
|
|
369
|
+
isCaseSensitive: true
|
|
370
|
+
}
|
|
371
|
+
}, "The Sun was bright, the moon was bright, the sun was warm."));
|
|
372
|
+
expect(asFragment()).toMatchSnapshot();
|
|
373
|
+
});
|
|
374
|
+
test('should render with separate case-sensitive option per word', () => {
|
|
375
|
+
const {
|
|
376
|
+
asFragment
|
|
377
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
378
|
+
$ui_highlightConfig: {
|
|
379
|
+
data: [{
|
|
380
|
+
text: 'Sun',
|
|
381
|
+
isCaseSensitive: true
|
|
382
|
+
}, {
|
|
383
|
+
text: 'Moon',
|
|
384
|
+
isCaseSensitive: false
|
|
385
|
+
}],
|
|
386
|
+
styleConfiguration: {
|
|
387
|
+
$ui_weight: 'bold',
|
|
388
|
+
$ui_decoration: 'underline'
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}, "The Sun was bright, the Moon was bright, the sun was warm."));
|
|
392
|
+
expect(asFragment()).toMatchSnapshot();
|
|
393
|
+
});
|
|
394
|
+
test('should render with global whole-word match only', () => {
|
|
395
|
+
const {
|
|
396
|
+
asFragment
|
|
397
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
398
|
+
$ui_highlightConfig: {
|
|
399
|
+
data: [{
|
|
400
|
+
text: 'Sun'
|
|
401
|
+
}, {
|
|
402
|
+
text: 'moon'
|
|
403
|
+
}],
|
|
404
|
+
styleConfiguration: {
|
|
405
|
+
$ui_weight: 'bold',
|
|
406
|
+
$ui_decoration: 'underline'
|
|
407
|
+
},
|
|
408
|
+
isWholeWord: true
|
|
409
|
+
}
|
|
410
|
+
}, "Sunflower is a flower. The Sun was bright, the moonlight was bright."));
|
|
411
|
+
expect(asFragment()).toMatchSnapshot();
|
|
412
|
+
});
|
|
413
|
+
test('should render with separate whole-word option per word', () => {
|
|
414
|
+
const {
|
|
415
|
+
asFragment
|
|
416
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
417
|
+
$ui_highlightConfig: {
|
|
418
|
+
data: [{
|
|
419
|
+
text: 'Sun',
|
|
420
|
+
isWholeWord: true
|
|
421
|
+
}, {
|
|
422
|
+
text: 'moon',
|
|
423
|
+
isWholeWord: false
|
|
424
|
+
}],
|
|
425
|
+
styleConfiguration: {
|
|
426
|
+
$ui_weight: 'bold',
|
|
427
|
+
$ui_decoration: 'underline'
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
}, "Sunflower is a flower. The Sun was bright, the moonlight was bright."));
|
|
431
|
+
expect(asFragment()).toMatchSnapshot();
|
|
432
|
+
});
|
|
433
|
+
test('should render with global custom style for all highlights', () => {
|
|
434
|
+
const {
|
|
435
|
+
asFragment
|
|
436
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
437
|
+
$ui_highlightConfig: {
|
|
438
|
+
data: [{
|
|
439
|
+
text: 'Sun'
|
|
440
|
+
}, {
|
|
441
|
+
text: 'moon'
|
|
442
|
+
}],
|
|
443
|
+
styleConfiguration: {
|
|
444
|
+
customStyle: {
|
|
445
|
+
backgroundColor: 'lightgreen'
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
}, "The sun and moon were bright."));
|
|
450
|
+
expect(asFragment()).toMatchSnapshot();
|
|
451
|
+
});
|
|
452
|
+
test('should render with separate custom style per word', () => {
|
|
453
|
+
const {
|
|
454
|
+
asFragment
|
|
455
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
456
|
+
$ui_highlightConfig: {
|
|
457
|
+
data: [{
|
|
458
|
+
text: 'Sun',
|
|
459
|
+
styleConfiguration: {
|
|
460
|
+
customStyle: {
|
|
461
|
+
backgroundColor: 'lightgreen'
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
}, {
|
|
465
|
+
text: 'moon',
|
|
466
|
+
styleConfiguration: {
|
|
467
|
+
customStyle: {
|
|
468
|
+
backgroundColor: 'orange'
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
}]
|
|
472
|
+
}
|
|
473
|
+
}, "The sun and moon were bright."));
|
|
474
|
+
expect(asFragment()).toMatchSnapshot();
|
|
475
|
+
});
|
|
476
|
+
test('should render with global custom class for all highlights', () => {
|
|
477
|
+
const {
|
|
478
|
+
asFragment
|
|
479
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
480
|
+
$ui_highlightConfig: {
|
|
481
|
+
data: [{
|
|
482
|
+
text: 'Sun'
|
|
483
|
+
}, {
|
|
484
|
+
text: 'moon'
|
|
485
|
+
}],
|
|
486
|
+
styleConfiguration: {
|
|
487
|
+
$ui_className: 'global_custom_class'
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
}, "The sun and moon were bright."));
|
|
491
|
+
expect(asFragment()).toMatchSnapshot();
|
|
492
|
+
});
|
|
493
|
+
test('should render with separate custom class for each highlighted word', () => {
|
|
494
|
+
const {
|
|
495
|
+
asFragment
|
|
496
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
497
|
+
$ui_highlightConfig: {
|
|
498
|
+
data: [{
|
|
499
|
+
text: 'Sun',
|
|
500
|
+
styleConfiguration: {
|
|
501
|
+
$ui_className: 'separate_custom_class_sun'
|
|
502
|
+
}
|
|
503
|
+
}, {
|
|
504
|
+
text: 'moon',
|
|
505
|
+
styleConfiguration: {
|
|
506
|
+
$ui_className: 'separate_custom_class_moon'
|
|
507
|
+
}
|
|
508
|
+
}]
|
|
509
|
+
}
|
|
510
|
+
}, "The sun and moon were bright."));
|
|
511
|
+
expect(asFragment()).toMatchSnapshot();
|
|
512
|
+
});
|
|
513
|
+
test('should render customised render the highlight element for all highlighted words', () => {
|
|
514
|
+
const {
|
|
515
|
+
asFragment
|
|
516
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
517
|
+
$ui_highlightConfig: {
|
|
518
|
+
data: [{
|
|
519
|
+
text: 'sun'
|
|
520
|
+
}],
|
|
521
|
+
renderHighlight: /*#__PURE__*/React.createElement(Tag, {
|
|
522
|
+
text: "Sun"
|
|
523
|
+
})
|
|
524
|
+
}
|
|
525
|
+
}, "The sun was bright."));
|
|
526
|
+
expect(asFragment()).toMatchSnapshot();
|
|
527
|
+
});
|
|
528
|
+
test('should render separate customised render the highlight element for each highlighted word', () => {
|
|
529
|
+
const {
|
|
530
|
+
asFragment
|
|
531
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
532
|
+
$ui_highlightConfig: {
|
|
533
|
+
data: [{
|
|
534
|
+
text: 'Sun',
|
|
535
|
+
renderHighlight: /*#__PURE__*/React.createElement(Tag, {
|
|
536
|
+
text: "Sun"
|
|
537
|
+
})
|
|
538
|
+
}, {
|
|
539
|
+
text: 'moon',
|
|
540
|
+
renderHighlight: /*#__PURE__*/React.createElement(Tag, {
|
|
541
|
+
text: "Moon"
|
|
542
|
+
})
|
|
543
|
+
}]
|
|
544
|
+
}
|
|
545
|
+
}, "The sun and moon were bright."));
|
|
546
|
+
expect(asFragment()).toMatchSnapshot();
|
|
547
|
+
});
|
|
548
|
+
test('should render for RegEx Characters check', () => {
|
|
549
|
+
const {
|
|
550
|
+
asFragment
|
|
551
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
552
|
+
$ui_highlightConfig: {
|
|
553
|
+
data: [{
|
|
554
|
+
text: '$un'
|
|
555
|
+
}, {
|
|
556
|
+
text: 'm**n'
|
|
557
|
+
}],
|
|
558
|
+
styleConfiguration: {
|
|
559
|
+
customStyle: {
|
|
560
|
+
backgroundColor: 'lightgreen'
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
}, "The sun and moon were bright. and the m**n get sunlight from the $un, The Sun provides light to its nearby stars"));
|
|
565
|
+
expect(asFragment()).toMatchSnapshot();
|
|
566
|
+
});
|
|
567
|
+
test('should render for combination of configuration check', () => {
|
|
568
|
+
const {
|
|
569
|
+
asFragment
|
|
570
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
571
|
+
$ui_highlightConfig: {
|
|
572
|
+
data: [{
|
|
573
|
+
text: 'Sun',
|
|
574
|
+
index: 1,
|
|
575
|
+
shouldExcludeIndices: true,
|
|
576
|
+
isWholeWord: true,
|
|
577
|
+
isCaseSensitive: true
|
|
578
|
+
}],
|
|
579
|
+
styleConfiguration: {
|
|
580
|
+
customStyle: {
|
|
581
|
+
backgroundColor: 'lightgreen'
|
|
582
|
+
}
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}, "The sun and moon were bright. and the moon get sunlight from the Sun, The Sun provides light to its nearby stars"));
|
|
586
|
+
expect(asFragment()).toMatchSnapshot();
|
|
587
|
+
});
|
|
588
|
+
test('should render for priority based check - it priorities the global renderHighlight over the style configurations from the global', () => {
|
|
589
|
+
const {
|
|
590
|
+
asFragment
|
|
591
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
592
|
+
$ui_highlightConfig: {
|
|
593
|
+
data: ['sunlight'],
|
|
594
|
+
styleConfiguration: {
|
|
595
|
+
$ui_decoration: 'underline'
|
|
596
|
+
},
|
|
597
|
+
renderHighlight: text => /*#__PURE__*/React.createElement("a", {
|
|
598
|
+
href: "https://www.zoho.com",
|
|
599
|
+
target: "_blank",
|
|
600
|
+
rel: "noopener noreferrer"
|
|
601
|
+
}, " ", text, " ")
|
|
602
|
+
}
|
|
603
|
+
}, "1 Sun Moon 2 sun moon 3 sunmoon 4 SUN MOON 5 sun moon 6 sunlight moonlight"));
|
|
604
|
+
expect(asFragment()).toMatchSnapshot();
|
|
605
|
+
});
|
|
606
|
+
test('should render for priority based check - it priorities the style configurations from the data object over the global renderHighlight', () => {
|
|
607
|
+
const {
|
|
608
|
+
asFragment
|
|
609
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
610
|
+
$ui_highlightConfig: {
|
|
611
|
+
data: [{
|
|
612
|
+
text: 'sunlight',
|
|
613
|
+
styleConfiguration: {
|
|
614
|
+
$ui_decoration: 'underline'
|
|
615
|
+
}
|
|
616
|
+
}],
|
|
617
|
+
renderHighlight: text => /*#__PURE__*/React.createElement("a", {
|
|
618
|
+
href: "https://www.zoho.com",
|
|
619
|
+
target: "_blank",
|
|
620
|
+
rel: "noopener noreferrer"
|
|
621
|
+
}, " ", text, " ")
|
|
622
|
+
}
|
|
623
|
+
}, "1 Sun Moon 2 sun moon 3 sunmoon 4 SUN MOON 5 sun moon 6 sunlight moonlight"));
|
|
624
|
+
expect(asFragment()).toMatchSnapshot();
|
|
625
|
+
});
|
|
626
|
+
test('should render for priority based check - it priorities the renderHighlight from the data object over the global renderHighlight, global style configuration and style configuration from the data object', () => {
|
|
627
|
+
const {
|
|
628
|
+
asFragment
|
|
629
|
+
} = render( /*#__PURE__*/React.createElement(Typography, {
|
|
630
|
+
$ui_highlightConfig: {
|
|
631
|
+
data: [{
|
|
632
|
+
text: 'sunlight',
|
|
633
|
+
styleConfiguration: {
|
|
634
|
+
$ui_decoration: 'underline'
|
|
635
|
+
},
|
|
636
|
+
renderHighlight: text => /*#__PURE__*/React.createElement("b", null, " ", text, " ")
|
|
637
|
+
}],
|
|
638
|
+
styleConfiguration: {
|
|
639
|
+
customStyle: {
|
|
640
|
+
backgroundColor: 'lightgreen'
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
renderHighlight: text => /*#__PURE__*/React.createElement("a", {
|
|
644
|
+
href: "https://www.zoho.com",
|
|
645
|
+
target: "_blank",
|
|
646
|
+
rel: "noopener noreferrer"
|
|
647
|
+
}, " ", text, " ")
|
|
648
|
+
}
|
|
649
|
+
}, "1 Sun Moon 2 sun moon 3 sunmoon 4 SUN MOON 5 sun moon 6 sunlight moonlight"));
|
|
650
|
+
expect(asFragment()).toMatchSnapshot();
|
|
651
|
+
});
|
|
225
652
|
});
|