• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ckeditor / ckeditor5-inspector / 549

pending completion
549

push

travis-ci-com

web-flow
Bump webpack from 5.75.0 to 5.76.0

Bumps [webpack](https://github.com/webpack/webpack) from 5.75.0 to 5.76.0.
- [Release notes](https://github.com/webpack/webpack/releases)
- [Commits](https://github.com/webpack/webpack/compare/v5.75.0...v5.76.0)

---
updated-dependencies:
- dependency-name: webpack
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>

521 of 560 branches covered (93.04%)

Branch coverage included in aggregate %.

1123 of 1165 relevant lines covered (96.39%)

113.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/src/components/tree/treetextnode.js
1
/**
2
 * @license Copyright (c) 2003-2023, CKSource Holding sp. z o.o. All rights reserved.
3
 * For licensing, see LICENSE.md.
4
 */
5

6
import React from 'react';
7
import isEqual from 'lodash.isequal';
8

9
import TreeNode from './treenode';
10
import TreeNodeAttribute from './treenodeattribute';
11
import TreePosition from './treeposition';
12

13
/**
14
 * A class which instances represent text in the tree.
15
 */
16
export default class TreeTextNode extends TreeNode {
17
        render() {
18
                const definition = this.definition;
27✔
19
                const classes = [
27✔
20
                        'ck-inspector-tree-text',
21
                        this.isActive ? 'ck-inspector-tree-node_active' : ''
27✔
22
                ].join( ' ' );
23

24
                let nodeText = this.definition.text;
27✔
25

26
                if ( definition.positions && definition.positions.length ) {
27✔
27
                        nodeText = nodeText.split( '' );
5✔
28

29
                        // Don't alter the props (sort&reverse would do that in place) because next time it will cause unnecessary
30
                        // rendering due to equality check indicating old and new props are different arrays.
31
                        Array.from( definition.positions )
5✔
32
                                .sort( ( posA, posB ) => {
33
                                        if ( posA.offset < posB.offset ) {
4!
34
                                                return -1;
4✔
35
                                        } else if ( posA.offset === posB.offset ) {
×
36
                                                return 0;
×
37
                                        } else {
38
                                                return 1;
×
39
                                        }
40
                                } )
41
                                .reverse()
42
                                .forEach( ( position, index ) => {
43
                                        nodeText.splice(
9✔
44
                                                position.offset - definition.startOffset,
45
                                                0,
46
                                                <TreePosition key={'position' + index} definition={position} />
47
                                        );
48
                                } );
49
                }
50

51
                const children = [ nodeText ];
27✔
52

53
                if ( definition.positionsBefore && definition.positionsBefore.length ) {
27✔
54
                        definition.positionsBefore.forEach( ( position, index ) => {
1✔
55
                                children.unshift( <TreePosition key={'position-before:' + index} definition={position} /> );
1✔
56
                        } );
57
                }
58

59
                if ( definition.positionsAfter && definition.positionsAfter.length ) {
27✔
60
                        definition.positionsAfter.forEach( ( position, index ) => {
1✔
61
                                children.push( <TreePosition key={'position-after:' + index} definition={position} /> );
1✔
62
                        } );
63
                }
64

65
                return <span className={classes} onClick={this.handleClick}>
27✔
66
                        <span className="ck-inspector-tree-node__content">
67
                                {this.globalTreeProps.showCompactText ? '' : this.getAttributes()}
27✔
68
                                {this.globalTreeProps.showCompactText ? '' : '"' }
27✔
69
                                {children}
70
                                {this.globalTreeProps.showCompactText ? '' : '"' }
27✔
71
                        </span>
72
                </span>;
73
        }
74

75
        getAttributes() {
76
                const attributes = [];
21✔
77
                const definition = this.definition;
21✔
78
                const presentation = definition.presentation;
21✔
79
                const dontRenderAttributeValue = presentation && presentation.dontRenderAttributeValue;
21✔
80

81
                for ( const [ key, value ] of definition.attributes ) {
21✔
82
                        attributes.push( <TreeNodeAttribute key={key} name={key} value={value} dontRenderValue={dontRenderAttributeValue} /> );
7✔
83
                }
84

85
                return <span className="ck-inspector-tree-text__attributes">
21✔
86
                        {attributes}
87
                </span>;
88
        }
89

90
        shouldComponentUpdate( nextProps ) {
91
                return !isEqual( this.props, nextProps );
2✔
92
        }
93
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc