0.0.3 • Published 1 year ago

be-rewritten v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

be-rewritten

NPM version Playwright Tests How big is this package in your project?

Backdrop

The platform is showing very little interest in my proposal to allow processing of streaming HTML in a service worker (sniff!). Consequently, we have little choice but to do something on the main thread when we stream in HTML, which is what this element decorator does, via mutation observing (sigh).

Mission

be-rewritten extends be-written, by adding the ability to apply be-decorated element behaviors on selected elements as they render onto the screen, including DTR and xslt transforms.

<div be-rewritten='{
    "from": "",
    "make":{
        "cssSelector1": {
            "be": "metamorphic",
            "having": {
                "whenDefined": ["ui5-li", "ui5-list"],
                "xslt": "./ui5-list.xslt"
            }
        }
    }

}'>

User must provide references to be-decorated web components separately.

If web component is not yet registered, simply adds the attribute.

Can also be an array:

<div be-rewritten='{
    "from": "",
    "match":{
        "cssSelector1": [
            {
                "be": "metamorphic",
                "having": {
                    "whenDefined": ["ui5-li", "ui5-list"],
                    "xslt": "./ui5-list.xslt"
                }
            }, {
                "be": "melodramatic",
                "having": {
                    "writer": "Jin-joo"
                }
            }
        ]
    }

}'>

If the css selector requires a single quote, use \' . If double quote, use \" .