 {CompositeDisposable} = require 'event-kit'
-{$} = require './space-pen-extensions'
+{$, callAttachHooks, callRemoveHooks} = require './space-pen-extensions'
 PaneView = require './pane-view'
 
 class PaneElement extends HTMLElement

  activeItemChanged: (item) ->
    return unless item?

    $itemViews = $(@itemViews)
    view = @model.getView(item).__spacePenView
    otherView.hide() for otherView in $itemViews.children().not(view).views()
    $itemViews.append(view) unless view.parent().is($itemViews)
    view.show() if @attached
    view.focus() if @hasFocus()

  itemRemoved: ({item, index, destroyed}) ->
    if item instanceof $

  createdCallback: ->
    @attached = false
    @subscriptions = new CompositeDisposable
    @inlineDisplayStyles = new WeakMap

    @initializeContent()
    @subscribeToDOMEvents()
    @createSpacePenShim()
