1.0.11 • Published 1 month ago

mudom v1.0.11

Weekly downloads
23
License
ISC
Repository
github
Last release
1 month ago

µDOM

Table of Contents generated with DocToc

What it Is

utilities to handle DOM-related tasks

Installation

npm install -g mudom
browserify -r mudom -o app/static/browserified/mudom.js

API

DOM

TEXT

KB

Demo on https://loveencounterflow.github.io/hengist/dev/mudom/static/index.html

How to Use It

To Do

  • absorb µ.keyboard-modifier-emitter.js (svelte app2)
  • absorb src/components/Toolbox/index.svelte#µ_DOM_detect_doublekey_events()
  • documentation
  • offer browserified builds
  • allow lists of elements with event binding
  • include things like computedStyleMap(), attributeStyleMap, computedStyleMap() from CSS Houdini
  • export classes Dom, Text, &c.
  • this should work but doesn't:

    sub_document  = iframe.contentDocument
    first_tracker = µ.DOM.select_first_from sub_document, '.tracker'

    Error message is not a valid delement: HTMLDocument{...; suspicion is that HTMLDocument should be accepted as a (DOM) element

    Note the real problem is not the test x instanceof Element, the problem lies in the realm-crossing nature of the <iframe> element

    • solution might be to just check for presence of relevant API (like element.querySelectorAll?)
  • allow to instantiate with virtual DOM object so µDOM can be used outside the browser

  • integrate XPath &c from playlist µDOM2
  • remove µ.DOM.select_*_from() methods; instead allow µ.DOM.select_first(), µ.DOM.select_all() to take one or two parameters
  • ??? allow to pass in document on creation as it can differ from main document within iframes
  • don't reference µ from with libraries, use private ref to avoid name collisions
  • move loupe.js to deps
  • integrate method to monitor all events in document or on given element as discussed in https://stackoverflow.com/a/72945018:

    for (const key in document) if (key.startsWith('on')) document.addEventListener(key.slice(2), console.log);
    // https://stackoverflow.com/a/72945018/319266
    function monitorEvents(element) {
      for (const key in element) {
        if (key.startsWith('on')) {
          element.addEventListener(key.slice(2), console.log);
        }
      }
    }
1.0.11

1 month ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

0.3.0

10 months ago

1.0.10

9 months ago

0.3.1

10 months ago

0.2.3

3 years ago

0.2.2

3 years ago

0.2.1

3 years ago

0.2.0

3 years ago

0.1.0

3 years ago

0.0.7

3 years ago

0.0.6

3 years ago

0.0.5

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago