CrossClj

thheller/shadow-client shadow.dom 1.3.2

SourceDocs



RECENT
    VARS
    ->Coordinate
    ->NativeColl
    ->Size
    add-class
    add-event-listeners
    ancestor-by-class
    ancestor-by-tag
    append
    attr
    build
    build-url
    by-id
    check
    checked?
    child-nodes
    children
    contains?
    create-dom-node
    create-svg-node
    data
    del-attr
    destructure-node
    dom-listen
    dom-listen-remove
    dom-node
    ev-stop
    eval-scripts
    event-chan
    first-child
    form-elements
    fragment
    get-client-position
    get-height
    get-html
    get-next-sibling
    get-page-offset
    get-parent
    get-position
    get-previous-sibling
    get-size
    get-value
    get-viewport-size
    has-class?
    index-of
    insert-after
    insert-before
    insert-first
    lazy-native-coll-seq
    make-dom-node
    make-svg-node
    matches
    merge-class-string
    native-coll
    node-name
    on
    on-query
    parents
    parse-tag
    pct
    px
    query
    query-one
    redirect
    reload!
    remove
    remove-class
    remove-event-handler
    remove-style
    remove-style*
    remove-styles
    replace-node
    reset
    select-option-values
    set-attr
    set-attr*
    set-attrs
    set-data
    set-html
    set-style
    set-value
    size->clj
    str->fragment
    svg
    svg-node
    tag-name
    text
    toggle-class
    transition-supported?
    xmlns

    \" s)]\n\n (doseq [[script-tag script-body] scripts]\n (js/eval script-body))\n\n (\"ç@areduceç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_reduce\" (fn [s [script-tag script-body]]\n (\"ç@astr/replaceç@/ns/org.clojure/clojure/1.10.0-alpha6/clojure.string.cljs.html#_replace\" s script-tag \"\"))\n s\n scripts)\n ))\n\n\"ç@_str->fragment\"(defn \"ç@dstr->fragmentç@/fun/shadow.dom.cljs/str-%3Efragment.html\" [s]\n (let [el (js/document.createElement \"div\")]\n (set! (.-innerHTML el) s)\n (NativeColl. (dom/childrenToNode_ js/document el))))\n\n\"ç@_node-name\"(defn \"ç@dnode-nameç@/fun/shadow.dom.cljs/node-name.html\" [el]\n (.-nodeName (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)))\n\n\"ç@_ancestor-by-class\"(defn \"ç@dancestor-by-classç@/fun/shadow.dom.cljs/ancestor-by-class.html\" [el cls]\n (dom/getAncestorByClass (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el) cls))\n\n\"ç@_ancestor-by-tag\"(defn \"ç@dancestor-by-tagç@/fun/shadow.dom.cljs/ancestor-by-tag.html\"\n ([el tag] (dom/getAncestorByTagNameAndClass (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el) (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" tag)))\n ([el tag cls] (dom/getAncestorByTagNameAndClass (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el) (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" tag) (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" cls))))\n\n\"ç@_get-value\"(defn \"ç@dget-valueç@/fun/shadow.dom.cljs/get-value.html\" [dom]\n (gf/getValue (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" dom)))\n\n\"ç@_set-value\"(defn \"ç@dset-valueç@/fun/shadow.dom.cljs/set-value.html\" [dom value]\n (gf/setValue (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" dom) value))\n\n\"ç@_px\"(defn \"ç@dpxç@/fun/shadow.dom.cljs/px.html\" [value]\n (str (int value) \"px\"))\n\n\"ç@_pct\"(defn \"ç@dpctç@/fun/shadow.dom.cljs/pct.html\" [value]\n (str value \"%\"))\n\n\"ç@_remove-style*\"(defn \"ç@dremove-style*ç@/fun/shadow.dom.cljs/remove-style*.html\" [el style]\n (.removeProperty (.-style el) (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" style)))\n\n\"ç@_remove-style\"(defn \"ç@dremove-styleç@/fun/shadow.dom.cljs/remove-style.html\" [el style]\n (let [el (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)]\n (\"ç@premove-style*ç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_remove-style*\" el style)))\n\n\"ç@_remove-styles\"(defn \"ç@dremove-stylesç@/fun/shadow.dom.cljs/remove-styles.html\" [el style-keys]\n (let [el (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)]\n (doseq [it style-keys]\n (\"ç@premove-style*ç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_remove-style*\" el it))))\n\n\n\"ç@_->Coordinate\"(defrecord Coordinate [x y])\n\n\"ç@_get-position\"(defn \"ç@dget-positionç@/fun/shadow.dom.cljs/get-position.html\" [el]\n (let [pos (gs/getPosition (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el))]\n (\"ç@p->Coordinateç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_-%3ECoordinate\" (.-x pos) (.-y pos))))\n\n\"ç@_get-client-position\"(defn \"ç@dget-client-positionç@/fun/shadow.dom.cljs/get-client-position.html\" [el]\n (let [pos (gs/getClientPosition (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el))]\n (\"ç@p->Coordinateç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_-%3ECoordinate\" (.-x pos) (.-y pos))))\n\n\"ç@_get-page-offset\"(defn \"ç@dget-page-offsetç@/fun/shadow.dom.cljs/get-page-offset.html\" [el]\n (let [pos (gs/getPageOffset (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el))]\n (\"ç@p->Coordinateç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_-%3ECoordinate\" (.-x pos) (.-y pos))))\n\n\"ç@_->Size\"(defrecord Size [w h])\n\n\"ç@_size->clj\"(defn \"ç@dsize->cljç@/fun/shadow.dom.cljs/size-%3Eclj.html\" [size]\n (Size. (.-width size) (.-height size)))\n\n\"ç@_get-size\"(defn \"ç@dget-sizeç@/fun/shadow.dom.cljs/get-size.html\" [el]\n (\"ç@psize->cljç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_size-%3Eclj\" (gs/getSize (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el))))\n\n\"ç@_get-height\"(defn \"ç@dget-heightç@/fun/shadow.dom.cljs/get-height.html\" [el]\n (-> el \"ç@pget-sizeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_get-size\" :h))\n\n\"ç@_get-viewport-size\"(defn \"ç@dget-viewport-sizeç@/fun/shadow.dom.cljs/get-viewport-size.html\" []\n (\"ç@psize->cljç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_size-%3Eclj\" (dom/getViewportSize)))\n\n\"ç@_first-child\"(defn \"ç@dfirst-childç@/fun/shadow.dom.cljs/first-child.html\" [el]\n (aget (.-children (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)) 0))\n\n\"ç@_select-option-values\"(defn \"ç@dselect-option-valuesç@/fun/shadow.dom.cljs/select-option-values.html\" [el]\n (let [native (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)\n opts (aget native \"options\")]\n (areduce opts i ret []\n (\"ç@aconjç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_conj\" ret (aget opts i \"value\")))\n ))\n\n\"ç@_build-url\"(defn \"ç@dbuild-urlç@/fun/shadow.dom.cljs/build-url.html\" [path query-params]\n (if (\"ç@aempty?ç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_empty%3F\" query-params)\n path\n (str path \"?\" (\"ç@astr/joinç@/ns/org.clojure/clojure/1.10.0-alpha6/clojure.string.cljs.html#_join\" \"&\" (\"ç@amapç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_map\" (fn [[k v]]\n (str (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" k) \"=\" (js/encodeURIComponent (str v))))\n query-params)))\n ))\n\n\"ç@_redirect\"(defn \"ç@dredirectç@/fun/shadow.dom.cljs/redirect.html\"\n ([path]\n (\"ç@predirectç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_redirect\" path {}))\n ([path query-params]\n (aset js/document \"location\" \"href\" (\"ç@pbuild-urlç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_build-url\" path query-params))\n ))\n\n\"ç@_reload!\"(defn \"ç@dreload!ç@/fun/shadow.dom.cljs/reload%21.html\" []\n (set! (.. js/document -location -href)\n (.. js/document -location -href)))\n\n\"ç@_tag-name\"(defn \"ç@dtag-nameç@/fun/shadow.dom.cljs/tag-name.html\" [el]\n (let [dom (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)]\n (.-tagName dom)))\n\n\"ç@_insert-after\"(defn \"ç@dinsert-afterç@/fun/shadow.dom.cljs/insert-after.html\" [ref new]\n (let [new-node (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" new)]\n (dom/insertSiblingAfter new-node (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" ref))\n new-node))\n\n\"ç@_insert-before\"(defn \"ç@dinsert-beforeç@/fun/shadow.dom.cljs/insert-before.html\" [ref new]\n (let [new-node (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" new)]\n (dom/insertSiblingBefore new-node (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" ref))\n new-node))\n\n\"ç@_insert-first\"(defn \"ç@dinsert-firstç@/fun/shadow.dom.cljs/insert-first.html\" [ref new]\n (if-let [child (.-firstChild (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" ref))]\n (\"ç@pinsert-beforeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_insert-before\" child new)\n (\"ç@pappendç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_append\" ref new)))\n\n\"ç@_index-of\"(defn \"ç@dindex-ofç@/fun/shadow.dom.cljs/index-of.html\" [el]\n (loop [el (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)\n i 0]\n (let [ps (.-previousSibling el)]\n (if (nil? ps)\n i\n (recur ps (inc i))\n ))))\n\n\"ç@_get-parent\"(defn \"ç@dget-parentç@/fun/shadow.dom.cljs/get-parent.html\" [el]\n (dom/getParentElement (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)))\n\n\"ç@_parents\"(defn \"ç@dparentsç@/fun/shadow.dom.cljs/parents.html\" [el]\n (let [parent (\"ç@pget-parentç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_get-parent\" el)]\n (when parent\n (\"ç@aconsç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_cons\" parent (lazy-seq (\"ç@aparentsç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_parents\" parent))))))\n\n\"ç@_matches\"(defn \"ç@dmatchesç@/fun/shadow.dom.cljs/matches.html\" [el sel]\n (.matches (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el) sel))\n\n\"ç@_get-next-sibling\"(defn \"ç@dget-next-siblingç@/fun/shadow.dom.cljs/get-next-sibling.html\" [el]\n (dom/getNextElementSibling (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)))\n\n\"ç@_get-previous-sibling\"(defn \"ç@dget-previous-siblingç@/fun/shadow.dom.cljs/get-previous-sibling.html\" [el]\n (dom/getPreviousElementSibling (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el)))\n\n\n\"ç@_xmlns\"(def \"ç@dxmlnsç@/fun/shadow.dom.cljs/xmlns.html\" (\"ç@aatomç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_atom\" {\"svg\" \"http://www.w3.org/2000/svg\"\n \"xlink\" \"http://www.w3.org/1999/xlink\"}))\n\n\"ç@_create-svg-node\"(defn \"ç@dcreate-svg-nodeç@/fun/shadow.dom.cljs/create-svg-node.html\" [tag-def props]\n (let [[tag-name tag-id tag-classes] (\"ç@pparse-tagç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_parse-tag\" tag-def)]\n (let [el (.createElementNS js/document \"http://www.w3.org/2000/svg\" tag-name)]\n (when tag-id\n (.setAttribute el \"id\" tag-id))\n\n (when tag-classes\n (.setAttribute el \"class\" (\"ç@pmerge-class-stringç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_merge-class-string\" (:class props) tag-classes)))\n\n (doseq [[k v] props]\n (.setAttributeNS el\n (when-let [ns (\"ç@anamespaceç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_namespace\" k)]\n (\"ç@agetç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_get\" @\"ç@pxmlnsç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_xmlns\" ns))\n (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" k) v))\n\n el\n )))\n\n\"ç@_svg-node\"(defn \"ç@dsvg-nodeç@/fun/shadow.dom.cljs/svg-node.html\" [el]\n (cond\n (nil? el) nil\n (implements? SVGElement el) (\"ç@p-to-svgç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_-to-svg\" ^not-native el)\n :else el))\n\n\"ç@_make-svg-node\"(defn \"ç@dmake-svg-nodeç@/fun/shadow.dom.cljs/make-svg-node.html\" [structure]\n (let [[node node-children] (\"ç@pdestructure-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_destructure-node\" \"ç@pcreate-svg-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_create-svg-node\" structure)]\n\n (doseq [child-struct node-children\n :when (\"ç@anotç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_not\" (nil? child-struct))]\n (if (string? child-struct)\n (let [text (aget node \"textContent\")]\n (aset node \"textContent\" (str text child-struct)))\n (let [children (\"ç@psvg-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_svg-node\" child-struct)]\n (if (\"ç@aseq?ç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_seq%3F\" children)\n (doseq [child children\n :when child]\n (.appendChild node child))\n (.appendChild node children)))))\n node))\n\n(extend-protocol SVGElement\n string\n (-to-svg [this]\n (if (keyword? this)\n (\"ç@pmake-svg-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_make-svg-node\" [this])\n (throw (\"ç@aex-infoç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_ex-info\" \"strings cannot be in svgs\" {:this this}))))\n\n \"ç@pPersistentVectorç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_PersistentVector\"\n (-to-svg [this]\n (\"ç@pmake-svg-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_make-svg-node\" this))\n\n \"ç@pLazySeqç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_LazySeq\"\n (-to-svg [this]\n (\"ç@amapç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_map\" \"ç@p-to-svgç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_-to-svg\" this))\n\n nil\n (-to-svg [_] nil))\n\n;; FIXME: could autodetect svg elements but that would mean checking\n;; if tag == :svg for every node created in dom-node, that kinda sucks\n\"ç@_svg\"(defn \"ç@dsvgç@/fun/shadow.dom.cljs/svg.html\" [attrs & children]\n (\"ç@p-to-svgç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_-to-svg\" (\"ç@avecç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_vec\" (\"ç@aconcatç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_concat\" [:svg attrs] children))))\n\n\n\n\n;; core.async stuff\n\n\"ç@_event-chan\"(defn \"ç@devent-chanç@/fun/shadow.dom.cljs/event-chan.html\"\n \"returns a channel for events on el\n transform-fn should be a (fn [e el] some-val) where some-val will be put on the chan\n once-or-cleanup handles the removal of the event handler\n - true: remove after one event\n - false: never removed\n - chan: remove on msg/close\"\n ([el event]\n (\"ç@pevent-chanç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_event-chan\" el event nil false))\n ([el event xf]\n (\"ç@pevent-chanç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_event-chan\" el event xf false))\n ([el event xf once-or-cleanup]\n (let [buf (\"ç@aasync/sliding-bufferç@/ns/org.clojure/core.async/0.4.474/cljs.core.async.cljs.html#_sliding-buffer\" 1)\n chan (\"ç@aasync/chanç@/ns/org.clojure/core.async/0.4.474/cljs.core.async.cljs.html#_chan\" buf xf)\n event-fn (fn event-fn [e]\n (\"ç@aasync/put!ç@/ns/org.clojure/core.async/0.4.474/cljs.core.async.cljs.html#_put%21\" chan e)\n (when (true? once-or-cleanup)\n (\"ç@premove-event-handlerç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_remove-event-handler\" el event event-fn)\n (\"ç@aasync/close!ç@/ns/org.clojure/core.async/0.4.474/cljs.core.async.cljs.html#_close%21\" chan)\n ))]\n (\"ç@pdom-listenç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-listen\" (\"ç@pdom-nodeç@/ns/thheller/shadow-client/1.3.2/shadow.dom.cljs.html#_dom-node\" el) (\"ç@anameç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_name\" event) event-fn)\n\n ;; when given a channel fire up a go that removes event handler when closed/msg\n (when (and once-or-cleanup\n (\"ç@anotç@/ns/org.clojure/clojurescript/1.10.339/cljs.core.cljs.html#_not\" (true? once-or-cleanup)))\n (go (