playhtml 2.0.0 → 2.0.1

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 CHANGED
@@ -40,11 +40,14 @@ To use this library, you can import the library and the associated styles from a
40
40
  </body>
41
41
  ```
42
42
 
43
- If you have dynamic elements that are hydrated after the initial load, you can call `playhtml.setupElements()` whenever needed to have the library look for elements that haven't been marked.
43
+ If you have dynamic elements that are hydrated after the initial load, you can call `playhtml.setupPlayElement(element)` to imbue the element with playhtml properties.
44
44
 
45
- ```js
45
+ ```html
46
46
  <script type="module">
47
- import {setupElements} from "https://unpkg.com/playhtml"; setupElements();
47
+ import { playhtml } from "https://unpkg.com/playhtml";
48
+ const newPlayElement = document.createElement("div");
49
+ newPlayElement.id = "newPlayElement";
50
+ playhtml.setupPlayElement(newPlayElement);
48
51
  </script>
49
52
  ```
50
53
 
package/dist/main.d.ts CHANGED
@@ -104,20 +104,11 @@ export declare const playhtml: PlayHTMLComponents;
104
104
 
105
105
  declare interface PlayHTMLComponents {
106
106
  init: typeof initPlayHTML;
107
- setupElements: typeof setupElements;
108
107
  setupPlayElement: typeof setupPlayElement;
109
108
  globalData: Y.Map<any> | undefined;
110
109
  elementHandlers: Map<string, Map<string, ElementHandler>> | undefined;
111
110
  }
112
111
 
113
- /**
114
- * Sets up any playhtml elements that are currently on the page.
115
- *
116
- * Should be called only once. If you'd like to set up new elements, use `setupPlayElement`, which is exposed
117
- * on the `playhtml` object on `window`.
118
- */
119
- export declare function setupElements(): void;
120
-
121
112
  export declare function setupPlayElement(element: Element): void;
122
113
 
123
114
  /**