All files / collaborative-slate/src/sync/__tests__/fixtures/traces 80-various.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87    1x                                                                                                                                                                        
import type {SlateTrace} from '../../tools/traces';
 
export const slateVariousEditingTrace: SlateTrace = {
  start: [{type: 'paragraph', children: [{text: ''}]}],
  operations: [
    {
      type: 'set_selection',
      properties: null,
      newProperties: {anchor: {path: [0, 0], offset: 0}, focus: {path: [0, 0], offset: 0}},
    },
    {type: 'insert_text', path: [0, 0], offset: 0, text: 'Hello, world!'},
    {
      type: 'set_selection',
      properties: {anchor: {path: [0, 0], offset: 13}, focus: {path: [0, 0], offset: 13}},
      newProperties: {anchor: {path: [0, 0], offset: 1}, focus: {path: [0, 0], offset: 1}},
    },
    {type: 'insert_text', path: [0, 0], offset: 1, text: 'a'},
    {type: 'remove_text', path: [0, 0], offset: 2, text: 'e'},
    {
      type: 'set_selection',
      properties: {anchor: {path: [0, 0], offset: 2}, focus: {path: [0, 0], offset: 2}},
      newProperties: {anchor: {path: [0, 0], offset: 6}, focus: {path: [0, 0], offset: 6}},
    },
    {type: 'split_node', path: [0, 0], position: 6, properties: {}},
    {type: 'split_node', path: [0], position: 1, properties: {type: 'paragraph'}},
    {
      type: 'set_selection',
      properties: {anchor: {path: [1, 0], offset: 0}, focus: {path: [1, 0], offset: 0}},
      newProperties: {anchor: {path: [0, 0], offset: 0}, focus: {path: [0, 0], offset: 6}},
    },
    {type: 'set_node', path: [0], properties: {}, newProperties: {indent: 2}},
    {
      type: 'set_selection',
      properties: {anchor: {path: [0, 0], offset: 0}, focus: {path: [0, 0], offset: 6}},
      newProperties: {anchor: {path: [1, 0], offset: 1}, focus: {path: [1, 0], offset: 6}},
    },
    {type: 'split_node', path: [1, 0], position: 6, properties: {}},
    {type: 'split_node', path: [1, 0], position: 1, properties: {}},
    {
      type: 'set_selection',
      properties: {focus: {path: [1, 2], offset: 0}},
      newProperties: {focus: {path: [1, 1], offset: 5}},
    },
    {type: 'set_node', path: [1, 1], properties: {}, newProperties: {bold: true}},
    {type: 'set_node', path: [1, 1], properties: {bold: true}, newProperties: {}},
    {type: 'merge_node', path: [1, 1], position: 1, properties: {}},
    {type: 'merge_node', path: [1, 1], position: 6, properties: {}},
    {type: 'split_node', path: [1, 0], position: 6, properties: {}},
    {type: 'split_node', path: [1, 0], position: 1, properties: {}},
    {
      type: 'set_selection',
      properties: {focus: {path: [1, 2], offset: 0}},
      newProperties: {focus: {path: [1, 1], offset: 5}},
    },
    {type: 'set_node', path: [1, 1], properties: {}, newProperties: {bold: true}},
    {
      type: 'set_selection',
      properties: {anchor: {path: [1, 1], offset: 0}, focus: {path: [1, 1], offset: 5}},
      newProperties: {anchor: {path: [1, 2], offset: 0}, focus: {path: [1, 2], offset: 1}},
    },
    {type: 'set_node', path: [1, 2], properties: {}, newProperties: {highlighted: true}},
    {type: 'remove_text', path: [1, 2], offset: 0, text: '!'},
    {type: 'remove_node', path: [1, 2], node: {text: '', highlighted: true}},
    {
      type: 'set_selection',
      properties: {anchor: {path: [1, 1], offset: 5}, focus: {path: [1, 1], offset: 5}},
      newProperties: {anchor: {path: [1, 0], offset: 0}, focus: {path: [1, 0], offset: 1}},
    },
    {type: 'remove_text', path: [1, 0], offset: 0, text: ' '},
    {type: 'remove_node', path: [1, 0], node: {text: ''}},
    {
      type: 'set_selection',
      properties: {anchor: {path: [1, 0], offset: 0}, focus: {path: [1, 0], offset: 0}},
      newProperties: {anchor: {path: [0, 0], offset: 1}, focus: {path: [0, 0], offset: 2}},
    },
    {type: 'split_node', path: [0, 0], position: 2, properties: {}},
    {type: 'split_node', path: [0, 0], position: 1, properties: {}},
    {
      type: 'set_selection',
      properties: {focus: {path: [0, 2], offset: 0}},
      newProperties: {focus: {path: [0, 1], offset: 1}},
    },
    {type: 'set_node', path: [0, 1], properties: {}, newProperties: {highlighted: true}},
  ],
  checkpoints: [2, 4, 5, 8, 10, 15, 18, 22, 24, 26, 29, 34],
};