NEARBuilders / near-bos-webcomponent

Embed NEAR BOS content as a web component
The Unlicense
13 stars 6 forks source link

Introduce VM feature "enableComponentSrcDataKey" as a config option #37

Closed elliotBraem closed 4 months ago

elliotBraem commented 4 months ago

Following the introduction of the "config" attribute in #26, let's add a "vm" config option for "enableComponentSrcDataKey".

This is a feature that is helpful for local development and while inspecting elements. It helps devs figure out which widget is rendering. Notice data-component attribute in example below on nearbuilders.org:

Screenshot 2024-07-09 at 6 05 48 PM

Currently, this is hardcoded to "true" in the web component -- let's have this default to false and come from config instead.

Acceptance Criteria

{
  "vm": {
      // Configuration options for the VM
       "features": {
           "enableComponentSrcDataKey": boolean, // adds the "data-component" attribute specifying the rendered component's "src"
       }
   }
}