MCPcopy Create free account
hub / github.com/tree-sitter/tree-sitter-javascript / TextEditorComponent

Class TextEditorComponent

examples/text-editor-component.js:30–2986  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28
29module.exports =
30class TextEditorComponent {
31 static setScheduler (scheduler) {
32 etch.setScheduler(scheduler)
33 }
34
35 static getScheduler () {
36 return etch.getScheduler()
37 }
38
39 static didUpdateStyles () {
40 if (this.attachedComponents) {
41 this.attachedComponents.forEach((component) => {
42 component.didUpdateStyles()
43 })
44 }
45 }
46
47 static didUpdateScrollbarStyles () {
48 if (this.attachedComponents) {
49 this.attachedComponents.forEach((component) => {
50 component.didUpdateScrollbarStyles()
51 })
52 }
53 }
54
55 constructor (props) {
56 this.props = props
57
58 if (!props.model) {
59 props.model = new TextEditor({mini: props.mini, readOnly: props.readOnly})
60 }
61 this.props.model.component = this
62
63 if (props.element) {
64 this.element = props.element
65 } else {
66 if (!TextEditorElement) TextEditorElement = require('./text-editor-element')
67 this.element = new TextEditorElement()
68 }
69 this.element.initialize(this)
70 this.virtualNode = $('atom-text-editor')
71 this.virtualNode.domNode = this.element
72 this.refs = {}
73
74 this.updateSync = this.updateSync.bind(this)
75 this.didBlurHiddenInput = this.didBlurHiddenInput.bind(this)
76 this.didFocusHiddenInput = this.didFocusHiddenInput.bind(this)
77 this.didPaste = this.didPaste.bind(this)
78 this.didTextInput = this.didTextInput.bind(this)
79 this.didKeydown = this.didKeydown.bind(this)
80 this.didKeyup = this.didKeyup.bind(this)
81 this.didKeypress = this.didKeypress.bind(this)
82 this.didCompositionStart = this.didCompositionStart.bind(this)
83 this.didCompositionUpdate = this.didCompositionUpdate.bind(this)
84 this.didCompositionEnd = this.didCompositionEnd.bind(this)
85
86 this.updatedSynchronously = this.props.updatedSynchronously
87 this.didScrollDummyScrollbar = this.didScrollDummyScrollbar.bind(this)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…