home-assistant-query-selector 6.1.0 → 6.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/esm/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -154,6 +154,7 @@ new HAQuerySelector([config])
|
|
|
154
154
|
{
|
|
155
155
|
retries?: number;
|
|
156
156
|
delay?: number;
|
|
157
|
+
shouldReject?: boolean;
|
|
157
158
|
eventThreshold?: number;
|
|
158
159
|
}
|
|
159
160
|
```
|
|
@@ -162,6 +163,7 @@ new HAQuerySelector([config])
|
|
|
162
163
|
| -------------- | ------------- | --------------------------------------------------- |
|
|
163
164
|
| retries | yes | How many retries trying to find an element in the DOM tree before giving up (defaults to 100) |
|
|
164
165
|
| delay | yes | Delay between each retry trying to find an element in the DOM tree (defaults to 50) |
|
|
166
|
+
| shouldReject | yes | Indicates if the class should throw errors if some elements are not found (defaults to `false`, the elements will be `null` if they are not found) |
|
|
165
167
|
| eventThreshold | yes | Timestamp threshold to fire an event. If two consecutive events of the same type have a timestamp difference lower than this value, the second event will be ignored (defaults to 450) |
|
|
166
168
|
|
|
167
169
|
### Public methods
|
package/dist/esm/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{asyncQuerySelector as e,AsyncSelector as t}from"shadow-dom-selector";const _="$",s={retries:100,delay:50,eventThreshold:450};var o,O,n,i,A;!function(e){e.HOME_ASSISTANT="HOME_ASSISTANT",e.HOME_ASSISTANT_MAIN="HOME_ASSISTANT_MAIN",e.HA_DRAWER="HA_DRAWER",e.HA_SIDEBAR="HA_SIDEBAR",e.PARTIAL_PANEL_RESOLVER="PARTIAL_PANEL_RESOLVER"}(o||(o={})),function(e){e.HA_PANEL_LOVELACE="HA_PANEL_LOVELACE",e.HUI_ROOT="HUI_ROOT",e.HEADER="HEADER",e.HUI_VIEW="HUI_VIEW"}(O||(O={})),function(e){e.HA_MORE_INFO_DIALOG="HA_MORE_INFO_DIALOG",e.HA_DIALOG="HA_DIALOG",e.HA_DIALOG_CONTENT="HA_DIALOG_CONTENT",e.HA_MORE_INFO_DIALOG_INFO="HA_MORE_INFO_DIALOG_INFO",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK",e.HA_DIALOG_MORE_INFO_SETTINGS="HA_DIALOG_MORE_INFO_SETTINGS"}(n||(n={})),function(e){e.ON_LISTEN="onListen",e.ON_PANEL_LOAD="onPanelLoad",e.ON_LOVELACE_PANEL_LOAD="onLovelacePanelLoad",e.ON_MORE_INFO_DIALOG_OPEN="onMoreInfoDialogOpen",e.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN="onHistoryAndLogBookDialogOpen",e.ON_SETTINGS_DIALOG_OPEN="onSettingsDialogOpen"}(i||(i={})),function(e){e.HOME_ASSISTANT="home-assistant",e.HOME_ASSISTANT_MAIN="home-assistant-main",e.HA_DRAWER="ha-drawer",e.HA_SIDEBAR="ha-sidebar",e.PARTIAL_PANEL_RESOLVER="partial-panel-resolver",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_ROOT="hui-root",e.HEADER=".header",e.HUI_VIEW="hui-view",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_ADAPTATIVE_DIALOG="ha-adaptive-dialog",e.HA_DIALOG_CONTENT=".content",e.HA_MORE_INFO_DIALOG_INFO="ha-more-info-info",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_MORE_INFO_SETTINGS="ha-more-info-settings"}(A||(A={}));const a={[o.HOME_ASSISTANT]:{selector:A.HOME_ASSISTANT,children:{shadowRoot:{selector:_,children:{[o.HOME_ASSISTANT_MAIN]:{selector:A.HOME_ASSISTANT_MAIN,children:{shadowRoot:{selector:_,children:{[o.HA_DRAWER]:{selector:A.HA_DRAWER,children:{[o.HA_SIDEBAR]:{selector:A.HA_SIDEBAR,children:{shadowRoot:{selector:_}}},[o.PARTIAL_PANEL_RESOLVER]:{selector:A.PARTIAL_PANEL_RESOLVER}}}}}}}}}}}},r={[O.HA_PANEL_LOVELACE]:{selector:A.HA_PANEL_LOVELACE,children:{shadowRoot:{selector:_,children:{[O.HUI_ROOT]:{selector:A.HUI_ROOT,children:{shadowRoot:{selector:_,children:{[O.HEADER]:{selector:A.HEADER},[O.HUI_VIEW]:{selector:A.HUI_VIEW}}}}}}}}}},h={shadowRoot:{selector:_,children:{[n.HA_MORE_INFO_DIALOG]:{selector:A.HA_MORE_INFO_DIALOG,children:{shadowRoot:{selector:_,children:{[n.HA_DIALOG]:{selector:`${A.HA_ADAPTATIVE_DIALOG}, ${A.HA_DIALOG}`,children:{[n.HA_DIALOG_CONTENT]:{selector:A.HA_DIALOG_CONTENT,children:{[n.HA_MORE_INFO_DIALOG_INFO]:{selector:A.HA_MORE_INFO_DIALOG_INFO},[n.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:{selector:A.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK},[n.HA_DIALOG_MORE_INFO_SETTINGS]:{selector:A.HA_DIALOG_MORE_INFO_SETTINGS}}}}}}}}}}}};"function"==typeof SuppressedError&&SuppressedError;const l=(s,o,O,n=!1)=>Object.entries(o||{}).reduce((o,i)=>{const[A,a]=i;if(a.selector===_&&O)return a.children?Object.assign(Object.assign({},o),l(s,a.children,O,!0)):o;const r=O?O.then(t=>{return t?e(t,(_=a.selector,n?"$ "+_:_),s):null;var _}):e(a.selector,s);return o[A]={element:r,children:l(s,a.children,r),selector:new t(r,s)},o},{}),E=(e,t)=>{const _=Object.entries(t);for(const t of _){if(t[0]===e)return t[1];{const _=E(e,t[1].children);if(_)return _}}},c=(e,t)=>Object.keys(e).reduce((e,_)=>{const s=E(_,t);if(s){const{children:t}=s,o=function(e,t){var _={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(_[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(_[s[o]]=e[s[o]])}return _}(s,["children"]);e[_]=Object.assign({},o)}return e},{});class I{constructor(){this.delegate=document.createDocumentFragment()}addEventListener(...e){this.delegate.addEventListener(...e)}dispatchEvent(...e){return this.delegate.dispatchEvent(...e)}removeEventListener(...e){return this.delegate.removeEventListener(...e)}}class d extends I{constructor(e={}){super(),this._config=Object.assign(Object.assign({},s),e),this._timestaps={}}_dispatchEvent(e,t){const _=Date.now();this._timestaps[e]&&_-this._timestaps[e]<this._config.eventThreshold||(this._timestaps[e]=_,this.dispatchEvent(new CustomEvent(e,{detail:t})))}_updateDialogElements(e=n.HA_MORE_INFO_DIALOG_INFO){this._dialogTree=l(this._config,h,this._haRootElements.HOME_ASSISTANT.element);const t=c(n,this._dialogTree);t.HA_DIALOG_CONTENT.element.then(e=>{this._dialogsContentObserver.disconnect(),this._dialogsContentObserver.observe(e,{childList:!0})}),this._haDialogElements=((e,t)=>[n.HA_MORE_INFO_DIALOG,n.HA_DIALOG,n.HA_DIALOG_CONTENT,t].reduce((t,_)=>(t[_]=e[_],t),{}))(t,e);const _={[n.HA_MORE_INFO_DIALOG_INFO]:i.ON_MORE_INFO_DIALOG_OPEN,[n.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:i.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,[n.HA_DIALOG_MORE_INFO_SETTINGS]:i.ON_SETTINGS_DIALOG_OPEN};this._dispatchEvent(_[e],this._haDialogElements)}_updateRootElements(){this._homeAssistantRootTree=l(this._config,a),this._haRootElements=c(o,this._homeAssistantRootTree),this._haRootElements[o.HOME_ASSISTANT].selector.$.element.then(e=>{this._dialogsObserver.disconnect(),this._dialogsObserver.observe(e,{childList:!0})}),this._haRootElements[o.PARTIAL_PANEL_RESOLVER].element.then(e=>{this._panelResolverObserver.disconnect(),e&&this._panelResolverObserver.observe(e,{subtree:!0,childList:!0})}),this._dispatchEvent(i.ON_LISTEN,this._haRootElements),this._dispatchEvent(i.ON_PANEL_LOAD,this._haRootElements)}_updateLovelaceElements(){this._homeAssistantResolverTree=l(this._config,r,this._haRootElements[o.HA_DRAWER].element),this._haResolverElements=c(O,this._homeAssistantResolverTree),this._haResolverElements[O.HA_PANEL_LOVELACE].element.then(e=>{this._lovelaceObserver.disconnect(),e&&(this._lovelaceObserver.observe(e.shadowRoot,{childList:!0}),this._dispatchEvent(i.ON_LOVELACE_PANEL_LOAD,Object.assign(Object.assign({},this._haRootElements),this._haResolverElements)))})}_watchDialogs(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===A.HA_MORE_INFO_DIALOG&&(this._dialogsChildrenObserver.disconnect(),this._dialogsChildrenObserver.observe(e.shadowRoot,{childList:!0}),this._updateDialogElements())})})}_watchDialogsChildren(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t=[`${A.HA_DIALOG}`,`${A.HA_ADAPTATIVE_DIALOG}`];e instanceof Element&&t.includes(e.localName)&&this._updateDialogElements()})})}_watchDialogsContent(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t={[A.HA_MORE_INFO_DIALOG_INFO]:n.HA_MORE_INFO_DIALOG_INFO,[A.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:n.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK,[A.HA_DIALOG_MORE_INFO_SETTINGS]:n.HA_DIALOG_MORE_INFO_SETTINGS};if(e instanceof Element&&e.localName&&e.localName in t){const _=e.localName;this._updateDialogElements(t[_])}})})}_watchDashboards(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{this._dispatchEvent(i.ON_PANEL_LOAD,this._haRootElements),e instanceof Element&&e.localName===A.HA_PANEL_LOVELACE&&this._updateLovelaceElements()})})}_watchLovelace(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===A.HUI_ROOT&&this._updateLovelaceElements()})})}listen(){this._watchDialogsBinded=this._watchDialogs.bind(this),this._watchDialogsChildrenBinded=this._watchDialogsChildren.bind(this),this._watchDialogsContentBinded=this._watchDialogsContent.bind(this),this._watchDashboardsBinded=this._watchDashboards.bind(this),this._watchLovelaceBinded=this._watchLovelace.bind(this),this._dialogsObserver=new MutationObserver(this._watchDialogsBinded),this._dialogsChildrenObserver=new MutationObserver(this._watchDialogsChildrenBinded),this._dialogsContentObserver=new MutationObserver(this._watchDialogsContentBinded),this._panelResolverObserver=new MutationObserver(this._watchDashboardsBinded),this._lovelaceObserver=new MutationObserver(this._watchLovelaceBinded),this._updateRootElements(),this._updateLovelaceElements()}addEventListener(e,t,_){super.addEventListener(e,t,_)}}export{d as HAQuerySelector,i as HAQuerySelectorEvent};
|
|
1
|
+
import{asyncQuerySelector as e,AsyncSelector as t}from"shadow-dom-selector";const _="$",s={retries:100,delay:50,shouldReject:!1,eventThreshold:450};var o,O,n,i,A;!function(e){e.HOME_ASSISTANT="HOME_ASSISTANT",e.HOME_ASSISTANT_MAIN="HOME_ASSISTANT_MAIN",e.HA_DRAWER="HA_DRAWER",e.HA_SIDEBAR="HA_SIDEBAR",e.PARTIAL_PANEL_RESOLVER="PARTIAL_PANEL_RESOLVER"}(o||(o={})),function(e){e.HA_PANEL_LOVELACE="HA_PANEL_LOVELACE",e.HUI_ROOT="HUI_ROOT",e.HEADER="HEADER",e.HUI_VIEW="HUI_VIEW"}(O||(O={})),function(e){e.HA_MORE_INFO_DIALOG="HA_MORE_INFO_DIALOG",e.HA_DIALOG="HA_DIALOG",e.HA_DIALOG_CONTENT="HA_DIALOG_CONTENT",e.HA_MORE_INFO_DIALOG_INFO="HA_MORE_INFO_DIALOG_INFO",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK",e.HA_DIALOG_MORE_INFO_SETTINGS="HA_DIALOG_MORE_INFO_SETTINGS"}(n||(n={})),function(e){e.ON_LISTEN="onListen",e.ON_PANEL_LOAD="onPanelLoad",e.ON_LOVELACE_PANEL_LOAD="onLovelacePanelLoad",e.ON_MORE_INFO_DIALOG_OPEN="onMoreInfoDialogOpen",e.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN="onHistoryAndLogBookDialogOpen",e.ON_SETTINGS_DIALOG_OPEN="onSettingsDialogOpen"}(i||(i={})),function(e){e.HOME_ASSISTANT="home-assistant",e.HOME_ASSISTANT_MAIN="home-assistant-main",e.HA_DRAWER="ha-drawer",e.HA_SIDEBAR="ha-sidebar",e.PARTIAL_PANEL_RESOLVER="partial-panel-resolver",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_ROOT="hui-root",e.HEADER=".header",e.HUI_VIEW="hui-view",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_ADAPTATIVE_DIALOG="ha-adaptive-dialog",e.HA_DIALOG_CONTENT=".content",e.HA_MORE_INFO_DIALOG_INFO="ha-more-info-info",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_MORE_INFO_SETTINGS="ha-more-info-settings"}(A||(A={}));const a={[o.HOME_ASSISTANT]:{selector:A.HOME_ASSISTANT,children:{shadowRoot:{selector:_,children:{[o.HOME_ASSISTANT_MAIN]:{selector:A.HOME_ASSISTANT_MAIN,children:{shadowRoot:{selector:_,children:{[o.HA_DRAWER]:{selector:A.HA_DRAWER,children:{[o.HA_SIDEBAR]:{selector:A.HA_SIDEBAR,children:{shadowRoot:{selector:_}}},[o.PARTIAL_PANEL_RESOLVER]:{selector:A.PARTIAL_PANEL_RESOLVER}}}}}}}}}}}},r={[O.HA_PANEL_LOVELACE]:{selector:A.HA_PANEL_LOVELACE,children:{shadowRoot:{selector:_,children:{[O.HUI_ROOT]:{selector:A.HUI_ROOT,children:{shadowRoot:{selector:_,children:{[O.HEADER]:{selector:A.HEADER},[O.HUI_VIEW]:{selector:A.HUI_VIEW}}}}}}}}}},h={shadowRoot:{selector:_,children:{[n.HA_MORE_INFO_DIALOG]:{selector:A.HA_MORE_INFO_DIALOG,children:{shadowRoot:{selector:_,children:{[n.HA_DIALOG]:{selector:`${A.HA_ADAPTATIVE_DIALOG}, ${A.HA_DIALOG}`,children:{[n.HA_DIALOG_CONTENT]:{selector:A.HA_DIALOG_CONTENT,children:{[n.HA_MORE_INFO_DIALOG_INFO]:{selector:A.HA_MORE_INFO_DIALOG_INFO},[n.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:{selector:A.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK},[n.HA_DIALOG_MORE_INFO_SETTINGS]:{selector:A.HA_DIALOG_MORE_INFO_SETTINGS}}}}}}}}}}}};"function"==typeof SuppressedError&&SuppressedError;const l=(s,o,O,n=!1)=>Object.entries(o||{}).reduce((o,i)=>{const[A,a]=i;if(a.selector===_&&O)return a.children?Object.assign(Object.assign({},o),l(s,a.children,O,!0)):o;const r=O?O.then(t=>{return t?e(t,(_=a.selector,n?"$ "+_:_),s):null;var _}):e(a.selector,s);return o[A]={element:r,children:l(s,a.children,r),selector:new t(r,s)},o},{}),E=(e,t)=>{const _=Object.entries(t);for(const t of _){if(t[0]===e)return t[1];{const _=E(e,t[1].children);if(_)return _}}},c=(e,t)=>Object.keys(e).reduce((e,_)=>{const s=E(_,t);if(s){const{children:t}=s,o=function(e,t){var _={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(_[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(_[s[o]]=e[s[o]])}return _}(s,["children"]);e[_]=Object.assign({},o)}return e},{});class I{constructor(){this.delegate=document.createDocumentFragment()}addEventListener(...e){this.delegate.addEventListener(...e)}dispatchEvent(...e){return this.delegate.dispatchEvent(...e)}removeEventListener(...e){return this.delegate.removeEventListener(...e)}}class d extends I{constructor(e={}){super(),this._config=Object.assign(Object.assign({},s),e),this._timestaps={}}_dispatchEvent(e,t){const _=Date.now();this._timestaps[e]&&_-this._timestaps[e]<this._config.eventThreshold||(this._timestaps[e]=_,this.dispatchEvent(new CustomEvent(e,{detail:t})))}_updateDialogElements(e=n.HA_MORE_INFO_DIALOG_INFO){this._dialogTree=l(this._config,h,this._haRootElements.HOME_ASSISTANT.element);const t=c(n,this._dialogTree);t.HA_DIALOG_CONTENT.element.then(e=>{this._dialogsContentObserver.disconnect(),this._dialogsContentObserver.observe(e,{childList:!0})}),this._haDialogElements=((e,t)=>[n.HA_MORE_INFO_DIALOG,n.HA_DIALOG,n.HA_DIALOG_CONTENT,t].reduce((t,_)=>(t[_]=e[_],t),{}))(t,e);const _={[n.HA_MORE_INFO_DIALOG_INFO]:i.ON_MORE_INFO_DIALOG_OPEN,[n.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:i.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,[n.HA_DIALOG_MORE_INFO_SETTINGS]:i.ON_SETTINGS_DIALOG_OPEN};this._dispatchEvent(_[e],this._haDialogElements)}_updateRootElements(){this._homeAssistantRootTree=l(this._config,a),this._haRootElements=c(o,this._homeAssistantRootTree),this._haRootElements[o.HOME_ASSISTANT].selector.$.element.then(e=>{this._dialogsObserver.disconnect(),this._dialogsObserver.observe(e,{childList:!0})}),this._haRootElements[o.PARTIAL_PANEL_RESOLVER].element.then(e=>{this._panelResolverObserver.disconnect(),e&&this._panelResolverObserver.observe(e,{subtree:!0,childList:!0})}),this._dispatchEvent(i.ON_LISTEN,this._haRootElements),this._dispatchEvent(i.ON_PANEL_LOAD,this._haRootElements)}_updateLovelaceElements(){this._homeAssistantResolverTree=l(this._config,r,this._haRootElements[o.HA_DRAWER].element),this._haResolverElements=c(O,this._homeAssistantResolverTree),this._haResolverElements[O.HA_PANEL_LOVELACE].element.then(e=>{this._lovelaceObserver.disconnect(),e&&(this._lovelaceObserver.observe(e.shadowRoot,{childList:!0}),this._dispatchEvent(i.ON_LOVELACE_PANEL_LOAD,Object.assign(Object.assign({},this._haRootElements),this._haResolverElements)))})}_watchDialogs(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===A.HA_MORE_INFO_DIALOG&&(this._dialogsChildrenObserver.disconnect(),this._dialogsChildrenObserver.observe(e.shadowRoot,{childList:!0}),this._updateDialogElements())})})}_watchDialogsChildren(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t=[`${A.HA_DIALOG}`,`${A.HA_ADAPTATIVE_DIALOG}`];e instanceof Element&&t.includes(e.localName)&&this._updateDialogElements()})})}_watchDialogsContent(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t={[A.HA_MORE_INFO_DIALOG_INFO]:n.HA_MORE_INFO_DIALOG_INFO,[A.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:n.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK,[A.HA_DIALOG_MORE_INFO_SETTINGS]:n.HA_DIALOG_MORE_INFO_SETTINGS};if(e instanceof Element&&e.localName&&e.localName in t){const _=e.localName;this._updateDialogElements(t[_])}})})}_watchDashboards(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{this._dispatchEvent(i.ON_PANEL_LOAD,this._haRootElements),e instanceof Element&&e.localName===A.HA_PANEL_LOVELACE&&this._updateLovelaceElements()})})}_watchLovelace(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===A.HUI_ROOT&&this._updateLovelaceElements()})})}listen(){this._watchDialogsBinded=this._watchDialogs.bind(this),this._watchDialogsChildrenBinded=this._watchDialogsChildren.bind(this),this._watchDialogsContentBinded=this._watchDialogsContent.bind(this),this._watchDashboardsBinded=this._watchDashboards.bind(this),this._watchLovelaceBinded=this._watchLovelace.bind(this),this._dialogsObserver=new MutationObserver(this._watchDialogsBinded),this._dialogsChildrenObserver=new MutationObserver(this._watchDialogsChildrenBinded),this._dialogsContentObserver=new MutationObserver(this._watchDialogsContentBinded),this._panelResolverObserver=new MutationObserver(this._watchDashboardsBinded),this._lovelaceObserver=new MutationObserver(this._watchLovelaceBinded),this._updateRootElements(),this._updateLovelaceElements()}addEventListener(e,t,_){super.addEventListener(e,t,_)}}export{d as HAQuerySelector,i as HAQuerySelectorEvent};
|
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("shadow-dom-selector");const t="$",s={retries:100,delay:50,eventThreshold:450};var _,o,O,n,i;!function(e){e.HOME_ASSISTANT="HOME_ASSISTANT",e.HOME_ASSISTANT_MAIN="HOME_ASSISTANT_MAIN",e.HA_DRAWER="HA_DRAWER",e.HA_SIDEBAR="HA_SIDEBAR",e.PARTIAL_PANEL_RESOLVER="PARTIAL_PANEL_RESOLVER"}(_||(_={})),function(e){e.HA_PANEL_LOVELACE="HA_PANEL_LOVELACE",e.HUI_ROOT="HUI_ROOT",e.HEADER="HEADER",e.HUI_VIEW="HUI_VIEW"}(o||(o={})),function(e){e.HA_MORE_INFO_DIALOG="HA_MORE_INFO_DIALOG",e.HA_DIALOG="HA_DIALOG",e.HA_DIALOG_CONTENT="HA_DIALOG_CONTENT",e.HA_MORE_INFO_DIALOG_INFO="HA_MORE_INFO_DIALOG_INFO",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK",e.HA_DIALOG_MORE_INFO_SETTINGS="HA_DIALOG_MORE_INFO_SETTINGS"}(O||(O={})),exports.HAQuerySelectorEvent=void 0,(n=exports.HAQuerySelectorEvent||(exports.HAQuerySelectorEvent={})).ON_LISTEN="onListen",n.ON_PANEL_LOAD="onPanelLoad",n.ON_LOVELACE_PANEL_LOAD="onLovelacePanelLoad",n.ON_MORE_INFO_DIALOG_OPEN="onMoreInfoDialogOpen",n.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN="onHistoryAndLogBookDialogOpen",n.ON_SETTINGS_DIALOG_OPEN="onSettingsDialogOpen",function(e){e.HOME_ASSISTANT="home-assistant",e.HOME_ASSISTANT_MAIN="home-assistant-main",e.HA_DRAWER="ha-drawer",e.HA_SIDEBAR="ha-sidebar",e.PARTIAL_PANEL_RESOLVER="partial-panel-resolver",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_ROOT="hui-root",e.HEADER=".header",e.HUI_VIEW="hui-view",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_ADAPTATIVE_DIALOG="ha-adaptive-dialog",e.HA_DIALOG_CONTENT=".content",e.HA_MORE_INFO_DIALOG_INFO="ha-more-info-info",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_MORE_INFO_SETTINGS="ha-more-info-settings"}(i||(i={}));const r={[_.HOME_ASSISTANT]:{selector:i.HOME_ASSISTANT,children:{shadowRoot:{selector:t,children:{[_.HOME_ASSISTANT_MAIN]:{selector:i.HOME_ASSISTANT_MAIN,children:{shadowRoot:{selector:t,children:{[_.HA_DRAWER]:{selector:i.HA_DRAWER,children:{[_.HA_SIDEBAR]:{selector:i.HA_SIDEBAR,children:{shadowRoot:{selector:t}}},[_.PARTIAL_PANEL_RESOLVER]:{selector:i.PARTIAL_PANEL_RESOLVER}}}}}}}}}}}},A={[o.HA_PANEL_LOVELACE]:{selector:i.HA_PANEL_LOVELACE,children:{shadowRoot:{selector:t,children:{[o.HUI_ROOT]:{selector:i.HUI_ROOT,children:{shadowRoot:{selector:t,children:{[o.HEADER]:{selector:i.HEADER},[o.HUI_VIEW]:{selector:i.HUI_VIEW}}}}}}}}}},a={shadowRoot:{selector:t,children:{[O.HA_MORE_INFO_DIALOG]:{selector:i.HA_MORE_INFO_DIALOG,children:{shadowRoot:{selector:t,children:{[O.HA_DIALOG]:{selector:`${i.HA_ADAPTATIVE_DIALOG}, ${i.HA_DIALOG}`,children:{[O.HA_DIALOG_CONTENT]:{selector:i.HA_DIALOG_CONTENT,children:{[O.HA_MORE_INFO_DIALOG_INFO]:{selector:i.HA_MORE_INFO_DIALOG_INFO},[O.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:{selector:i.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK},[O.HA_DIALOG_MORE_INFO_SETTINGS]:{selector:i.HA_DIALOG_MORE_INFO_SETTINGS}}}}}}}}}}}};"function"==typeof SuppressedError&&SuppressedError;const l=(s,_,o,O=!1)=>Object.entries(_||{}).reduce((_,n)=>{const[i,r]=n;if(r.selector===t&&o)return r.children?Object.assign(Object.assign({},_),l(s,r.children,o,!0)):_;const A=o?o.then(t=>{return t?e.asyncQuerySelector(t,(_=r.selector,O?"$ "+_:_),s):null;var _}):e.asyncQuerySelector(r.selector,s);return _[i]={element:A,children:l(s,r.children,A),selector:new e.AsyncSelector(A,s)},_},{}),E=(e,t)=>{const s=Object.entries(t);for(const t of s){if(t[0]===e)return t[1];{const s=E(e,t[1].children);if(s)return s}}},h=(e,t)=>Object.keys(e).reduce((e,s)=>{const _=E(s,t);if(_){const{children:t}=_,o=function(e,t){var s={};for(var _ in e)Object.prototype.hasOwnProperty.call(e,_)&&t.indexOf(_)<0&&(s[_]=e[_]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(_=Object.getOwnPropertySymbols(e);o<_.length;o++)t.indexOf(_[o])<0&&Object.prototype.propertyIsEnumerable.call(e,_[o])&&(s[_[o]]=e[_[o]])}return s}(_,["children"]);e[s]=Object.assign({},o)}return e},{});class c{constructor(){this.delegate=document.createDocumentFragment()}addEventListener(...e){this.delegate.addEventListener(...e)}dispatchEvent(...e){return this.delegate.dispatchEvent(...e)}removeEventListener(...e){return this.delegate.removeEventListener(...e)}}exports.HAQuerySelector=class extends c{constructor(e={}){super(),this._config=Object.assign(Object.assign({},s),e),this._timestaps={}}_dispatchEvent(e,t){const s=Date.now();this._timestaps[e]&&s-this._timestaps[e]<this._config.eventThreshold||(this._timestaps[e]=s,this.dispatchEvent(new CustomEvent(e,{detail:t})))}_updateDialogElements(e=O.HA_MORE_INFO_DIALOG_INFO){this._dialogTree=l(this._config,a,this._haRootElements.HOME_ASSISTANT.element);const t=h(O,this._dialogTree);t.HA_DIALOG_CONTENT.element.then(e=>{this._dialogsContentObserver.disconnect(),this._dialogsContentObserver.observe(e,{childList:!0})}),this._haDialogElements=((e,t)=>[O.HA_MORE_INFO_DIALOG,O.HA_DIALOG,O.HA_DIALOG_CONTENT,t].reduce((t,s)=>(t[s]=e[s],t),{}))(t,e);const s={[O.HA_MORE_INFO_DIALOG_INFO]:exports.HAQuerySelectorEvent.ON_MORE_INFO_DIALOG_OPEN,[O.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:exports.HAQuerySelectorEvent.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,[O.HA_DIALOG_MORE_INFO_SETTINGS]:exports.HAQuerySelectorEvent.ON_SETTINGS_DIALOG_OPEN};this._dispatchEvent(s[e],this._haDialogElements)}_updateRootElements(){this._homeAssistantRootTree=l(this._config,r),this._haRootElements=h(_,this._homeAssistantRootTree),this._haRootElements[_.HOME_ASSISTANT].selector.$.element.then(e=>{this._dialogsObserver.disconnect(),this._dialogsObserver.observe(e,{childList:!0})}),this._haRootElements[_.PARTIAL_PANEL_RESOLVER].element.then(e=>{this._panelResolverObserver.disconnect(),e&&this._panelResolverObserver.observe(e,{subtree:!0,childList:!0})}),this._dispatchEvent(exports.HAQuerySelectorEvent.ON_LISTEN,this._haRootElements),this._dispatchEvent(exports.HAQuerySelectorEvent.ON_PANEL_LOAD,this._haRootElements)}_updateLovelaceElements(){this._homeAssistantResolverTree=l(this._config,A,this._haRootElements[_.HA_DRAWER].element),this._haResolverElements=h(o,this._homeAssistantResolverTree),this._haResolverElements[o.HA_PANEL_LOVELACE].element.then(e=>{this._lovelaceObserver.disconnect(),e&&(this._lovelaceObserver.observe(e.shadowRoot,{childList:!0}),this._dispatchEvent(exports.HAQuerySelectorEvent.ON_LOVELACE_PANEL_LOAD,Object.assign(Object.assign({},this._haRootElements),this._haResolverElements)))})}_watchDialogs(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===i.HA_MORE_INFO_DIALOG&&(this._dialogsChildrenObserver.disconnect(),this._dialogsChildrenObserver.observe(e.shadowRoot,{childList:!0}),this._updateDialogElements())})})}_watchDialogsChildren(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t=[`${i.HA_DIALOG}`,`${i.HA_ADAPTATIVE_DIALOG}`];e instanceof Element&&t.includes(e.localName)&&this._updateDialogElements()})})}_watchDialogsContent(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t={[i.HA_MORE_INFO_DIALOG_INFO]:O.HA_MORE_INFO_DIALOG_INFO,[i.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:O.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK,[i.HA_DIALOG_MORE_INFO_SETTINGS]:O.HA_DIALOG_MORE_INFO_SETTINGS};if(e instanceof Element&&e.localName&&e.localName in t){const s=e.localName;this._updateDialogElements(t[s])}})})}_watchDashboards(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{this._dispatchEvent(exports.HAQuerySelectorEvent.ON_PANEL_LOAD,this._haRootElements),e instanceof Element&&e.localName===i.HA_PANEL_LOVELACE&&this._updateLovelaceElements()})})}_watchLovelace(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===i.HUI_ROOT&&this._updateLovelaceElements()})})}listen(){this._watchDialogsBinded=this._watchDialogs.bind(this),this._watchDialogsChildrenBinded=this._watchDialogsChildren.bind(this),this._watchDialogsContentBinded=this._watchDialogsContent.bind(this),this._watchDashboardsBinded=this._watchDashboards.bind(this),this._watchLovelaceBinded=this._watchLovelace.bind(this),this._dialogsObserver=new MutationObserver(this._watchDialogsBinded),this._dialogsChildrenObserver=new MutationObserver(this._watchDialogsChildrenBinded),this._dialogsContentObserver=new MutationObserver(this._watchDialogsContentBinded),this._panelResolverObserver=new MutationObserver(this._watchDashboardsBinded),this._lovelaceObserver=new MutationObserver(this._watchLovelaceBinded),this._updateRootElements(),this._updateLovelaceElements()}addEventListener(e,t,s){super.addEventListener(e,t,s)}};
|
|
1
|
+
"use strict";var e=require("shadow-dom-selector");const t="$",s={retries:100,delay:50,shouldReject:!1,eventThreshold:450};var _,o,O,n,i;!function(e){e.HOME_ASSISTANT="HOME_ASSISTANT",e.HOME_ASSISTANT_MAIN="HOME_ASSISTANT_MAIN",e.HA_DRAWER="HA_DRAWER",e.HA_SIDEBAR="HA_SIDEBAR",e.PARTIAL_PANEL_RESOLVER="PARTIAL_PANEL_RESOLVER"}(_||(_={})),function(e){e.HA_PANEL_LOVELACE="HA_PANEL_LOVELACE",e.HUI_ROOT="HUI_ROOT",e.HEADER="HEADER",e.HUI_VIEW="HUI_VIEW"}(o||(o={})),function(e){e.HA_MORE_INFO_DIALOG="HA_MORE_INFO_DIALOG",e.HA_DIALOG="HA_DIALOG",e.HA_DIALOG_CONTENT="HA_DIALOG_CONTENT",e.HA_MORE_INFO_DIALOG_INFO="HA_MORE_INFO_DIALOG_INFO",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK",e.HA_DIALOG_MORE_INFO_SETTINGS="HA_DIALOG_MORE_INFO_SETTINGS"}(O||(O={})),exports.HAQuerySelectorEvent=void 0,(n=exports.HAQuerySelectorEvent||(exports.HAQuerySelectorEvent={})).ON_LISTEN="onListen",n.ON_PANEL_LOAD="onPanelLoad",n.ON_LOVELACE_PANEL_LOAD="onLovelacePanelLoad",n.ON_MORE_INFO_DIALOG_OPEN="onMoreInfoDialogOpen",n.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN="onHistoryAndLogBookDialogOpen",n.ON_SETTINGS_DIALOG_OPEN="onSettingsDialogOpen",function(e){e.HOME_ASSISTANT="home-assistant",e.HOME_ASSISTANT_MAIN="home-assistant-main",e.HA_DRAWER="ha-drawer",e.HA_SIDEBAR="ha-sidebar",e.PARTIAL_PANEL_RESOLVER="partial-panel-resolver",e.HA_PANEL_LOVELACE="ha-panel-lovelace",e.HUI_ROOT="hui-root",e.HEADER=".header",e.HUI_VIEW="hui-view",e.HA_MORE_INFO_DIALOG="ha-more-info-dialog",e.HA_DIALOG="ha-dialog",e.HA_ADAPTATIVE_DIALOG="ha-adaptive-dialog",e.HA_DIALOG_CONTENT=".content",e.HA_MORE_INFO_DIALOG_INFO="ha-more-info-info",e.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK="ha-more-info-history-and-logbook",e.HA_DIALOG_MORE_INFO_SETTINGS="ha-more-info-settings"}(i||(i={}));const r={[_.HOME_ASSISTANT]:{selector:i.HOME_ASSISTANT,children:{shadowRoot:{selector:t,children:{[_.HOME_ASSISTANT_MAIN]:{selector:i.HOME_ASSISTANT_MAIN,children:{shadowRoot:{selector:t,children:{[_.HA_DRAWER]:{selector:i.HA_DRAWER,children:{[_.HA_SIDEBAR]:{selector:i.HA_SIDEBAR,children:{shadowRoot:{selector:t}}},[_.PARTIAL_PANEL_RESOLVER]:{selector:i.PARTIAL_PANEL_RESOLVER}}}}}}}}}}}},A={[o.HA_PANEL_LOVELACE]:{selector:i.HA_PANEL_LOVELACE,children:{shadowRoot:{selector:t,children:{[o.HUI_ROOT]:{selector:i.HUI_ROOT,children:{shadowRoot:{selector:t,children:{[o.HEADER]:{selector:i.HEADER},[o.HUI_VIEW]:{selector:i.HUI_VIEW}}}}}}}}}},a={shadowRoot:{selector:t,children:{[O.HA_MORE_INFO_DIALOG]:{selector:i.HA_MORE_INFO_DIALOG,children:{shadowRoot:{selector:t,children:{[O.HA_DIALOG]:{selector:`${i.HA_ADAPTATIVE_DIALOG}, ${i.HA_DIALOG}`,children:{[O.HA_DIALOG_CONTENT]:{selector:i.HA_DIALOG_CONTENT,children:{[O.HA_MORE_INFO_DIALOG_INFO]:{selector:i.HA_MORE_INFO_DIALOG_INFO},[O.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:{selector:i.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK},[O.HA_DIALOG_MORE_INFO_SETTINGS]:{selector:i.HA_DIALOG_MORE_INFO_SETTINGS}}}}}}}}}}}};"function"==typeof SuppressedError&&SuppressedError;const l=(s,_,o,O=!1)=>Object.entries(_||{}).reduce((_,n)=>{const[i,r]=n;if(r.selector===t&&o)return r.children?Object.assign(Object.assign({},_),l(s,r.children,o,!0)):_;const A=o?o.then(t=>{return t?e.asyncQuerySelector(t,(_=r.selector,O?"$ "+_:_),s):null;var _}):e.asyncQuerySelector(r.selector,s);return _[i]={element:A,children:l(s,r.children,A),selector:new e.AsyncSelector(A,s)},_},{}),E=(e,t)=>{const s=Object.entries(t);for(const t of s){if(t[0]===e)return t[1];{const s=E(e,t[1].children);if(s)return s}}},h=(e,t)=>Object.keys(e).reduce((e,s)=>{const _=E(s,t);if(_){const{children:t}=_,o=function(e,t){var s={};for(var _ in e)Object.prototype.hasOwnProperty.call(e,_)&&t.indexOf(_)<0&&(s[_]=e[_]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(_=Object.getOwnPropertySymbols(e);o<_.length;o++)t.indexOf(_[o])<0&&Object.prototype.propertyIsEnumerable.call(e,_[o])&&(s[_[o]]=e[_[o]])}return s}(_,["children"]);e[s]=Object.assign({},o)}return e},{});class c{constructor(){this.delegate=document.createDocumentFragment()}addEventListener(...e){this.delegate.addEventListener(...e)}dispatchEvent(...e){return this.delegate.dispatchEvent(...e)}removeEventListener(...e){return this.delegate.removeEventListener(...e)}}exports.HAQuerySelector=class extends c{constructor(e={}){super(),this._config=Object.assign(Object.assign({},s),e),this._timestaps={}}_dispatchEvent(e,t){const s=Date.now();this._timestaps[e]&&s-this._timestaps[e]<this._config.eventThreshold||(this._timestaps[e]=s,this.dispatchEvent(new CustomEvent(e,{detail:t})))}_updateDialogElements(e=O.HA_MORE_INFO_DIALOG_INFO){this._dialogTree=l(this._config,a,this._haRootElements.HOME_ASSISTANT.element);const t=h(O,this._dialogTree);t.HA_DIALOG_CONTENT.element.then(e=>{this._dialogsContentObserver.disconnect(),this._dialogsContentObserver.observe(e,{childList:!0})}),this._haDialogElements=((e,t)=>[O.HA_MORE_INFO_DIALOG,O.HA_DIALOG,O.HA_DIALOG_CONTENT,t].reduce((t,s)=>(t[s]=e[s],t),{}))(t,e);const s={[O.HA_MORE_INFO_DIALOG_INFO]:exports.HAQuerySelectorEvent.ON_MORE_INFO_DIALOG_OPEN,[O.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:exports.HAQuerySelectorEvent.ON_HISTORY_AND_LOGBOOK_DIALOG_OPEN,[O.HA_DIALOG_MORE_INFO_SETTINGS]:exports.HAQuerySelectorEvent.ON_SETTINGS_DIALOG_OPEN};this._dispatchEvent(s[e],this._haDialogElements)}_updateRootElements(){this._homeAssistantRootTree=l(this._config,r),this._haRootElements=h(_,this._homeAssistantRootTree),this._haRootElements[_.HOME_ASSISTANT].selector.$.element.then(e=>{this._dialogsObserver.disconnect(),this._dialogsObserver.observe(e,{childList:!0})}),this._haRootElements[_.PARTIAL_PANEL_RESOLVER].element.then(e=>{this._panelResolverObserver.disconnect(),e&&this._panelResolverObserver.observe(e,{subtree:!0,childList:!0})}),this._dispatchEvent(exports.HAQuerySelectorEvent.ON_LISTEN,this._haRootElements),this._dispatchEvent(exports.HAQuerySelectorEvent.ON_PANEL_LOAD,this._haRootElements)}_updateLovelaceElements(){this._homeAssistantResolverTree=l(this._config,A,this._haRootElements[_.HA_DRAWER].element),this._haResolverElements=h(o,this._homeAssistantResolverTree),this._haResolverElements[o.HA_PANEL_LOVELACE].element.then(e=>{this._lovelaceObserver.disconnect(),e&&(this._lovelaceObserver.observe(e.shadowRoot,{childList:!0}),this._dispatchEvent(exports.HAQuerySelectorEvent.ON_LOVELACE_PANEL_LOAD,Object.assign(Object.assign({},this._haRootElements),this._haResolverElements)))})}_watchDialogs(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===i.HA_MORE_INFO_DIALOG&&(this._dialogsChildrenObserver.disconnect(),this._dialogsChildrenObserver.observe(e.shadowRoot,{childList:!0}),this._updateDialogElements())})})}_watchDialogsChildren(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t=[`${i.HA_DIALOG}`,`${i.HA_ADAPTATIVE_DIALOG}`];e instanceof Element&&t.includes(e.localName)&&this._updateDialogElements()})})}_watchDialogsContent(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{const t={[i.HA_MORE_INFO_DIALOG_INFO]:O.HA_MORE_INFO_DIALOG_INFO,[i.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK]:O.HA_DIALOG_MORE_INFO_HISTORY_AND_LOGBOOK,[i.HA_DIALOG_MORE_INFO_SETTINGS]:O.HA_DIALOG_MORE_INFO_SETTINGS};if(e instanceof Element&&e.localName&&e.localName in t){const s=e.localName;this._updateDialogElements(t[s])}})})}_watchDashboards(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{this._dispatchEvent(exports.HAQuerySelectorEvent.ON_PANEL_LOAD,this._haRootElements),e instanceof Element&&e.localName===i.HA_PANEL_LOVELACE&&this._updateLovelaceElements()})})}_watchLovelace(e){e.forEach(({addedNodes:e})=>{e.forEach(e=>{e instanceof Element&&e.localName===i.HUI_ROOT&&this._updateLovelaceElements()})})}listen(){this._watchDialogsBinded=this._watchDialogs.bind(this),this._watchDialogsChildrenBinded=this._watchDialogsChildren.bind(this),this._watchDialogsContentBinded=this._watchDialogsContent.bind(this),this._watchDashboardsBinded=this._watchDashboards.bind(this),this._watchLovelaceBinded=this._watchLovelace.bind(this),this._dialogsObserver=new MutationObserver(this._watchDialogsBinded),this._dialogsChildrenObserver=new MutationObserver(this._watchDialogsChildrenBinded),this._dialogsContentObserver=new MutationObserver(this._watchDialogsContentBinded),this._panelResolverObserver=new MutationObserver(this._watchDashboardsBinded),this._lovelaceObserver=new MutationObserver(this._watchLovelaceBinded),this._updateRootElements(),this._updateLovelaceElements()}addEventListener(e,t,s){super.addEventListener(e,t,s)}};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "home-assistant-query-selector",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.2.0",
|
|
4
4
|
"description": "Easily query home-assistant DOM elements in an async way",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"query-selector",
|
|
@@ -65,27 +65,27 @@
|
|
|
65
65
|
"@rollup/plugin-terser": "^1.0.0",
|
|
66
66
|
"@rollup/plugin-typescript": "^12.3.0",
|
|
67
67
|
"@types/eslint": "^9.6.1",
|
|
68
|
-
"@types/node": "^25.
|
|
68
|
+
"@types/node": "^25.6.0",
|
|
69
69
|
"@types/sinon": "^21.0.1",
|
|
70
|
-
"eslint": "^10.
|
|
71
|
-
"globals": "^17.
|
|
70
|
+
"eslint": "^10.3.0",
|
|
71
|
+
"globals": "^17.6.0",
|
|
72
72
|
"nyc": "^18.0.0",
|
|
73
73
|
"playwright-test-coverage": "^1.2.12",
|
|
74
|
-
"rollup": "^4.60.
|
|
74
|
+
"rollup": "^4.60.2",
|
|
75
75
|
"rollup-plugin-dts": "^6.4.1",
|
|
76
76
|
"rollup-plugin-istanbul": "^5.0.0",
|
|
77
77
|
"rollup-plugin-serve": "^3.0.0",
|
|
78
78
|
"rollup-plugin-tsconfig-paths": "^1.5.2",
|
|
79
|
-
"sinon": "^21.
|
|
79
|
+
"sinon": "^21.1.2",
|
|
80
80
|
"tslib": "^2.8.1",
|
|
81
|
-
"typescript": "^6.0.
|
|
82
|
-
"typescript-eslint": "^8.
|
|
81
|
+
"typescript": "^6.0.3",
|
|
82
|
+
"typescript-eslint": "^8.59.1"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"shadow-dom-selector": "^6.
|
|
85
|
+
"shadow-dom-selector": "^6.2.2"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
|
-
"shadow-dom-selector": "^6.
|
|
88
|
+
"shadow-dom-selector": "^6.2.2"
|
|
89
89
|
},
|
|
90
90
|
"pnpm": {
|
|
91
91
|
"overrides": {
|