playhtml 2.1.7 → 2.1.9

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
@@ -44,8 +44,8 @@ To use this library, you can import the library from a CDN (in this case we will
44
44
  <img
45
45
  src="https://media2.giphy.com/media/lL7A3Li0YtFHq/giphy.gif?cid=ecf05e47ah89o71gzz7ke7inrgb1ai1xcbrjnqdf7o890118&ep=v1_stickers_search&rid=giphy.gif"
46
46
  can-move
47
+ id="openSign"
47
48
  />
48
- id="openSign"
49
49
  <!-- INVALID EXAMPLE <img src="https://media2.giphy.com/media/lL7A3Li0YtFHq/giphy.gif?cid=ecf05e47ah89o71gzz7ke7inrgb1ai1xcbrjnqdf7o890118&ep=v1_stickers_search&rid=giphy.gif" can-move /> -->
50
50
  <!-- import the script -->
51
51
 
@@ -175,9 +175,9 @@ https://github.com/spencerc99/playhtml/assets/14796580/fae669b1-b3e2-404e-bd7a-3
175
175
  </script>
176
176
  ```
177
177
 
178
- See all supported properties in the `ElementInitializer` [object in `types.ts`](https://github.com/spencerc99/playhtml/blob/main/src/types.ts#L13).
178
+ See all supported properties in the `ElementInitializer` [object in `common/src/index.ts`](https://github.com/spencerc99/playhtml/blob/main/packages/common/src/index.ts#L7).
179
179
 
180
- The only required properties are `defaultData`, `updateElement` and some kind of setup to trigger those functions (in this case, `onClick`, but you can add custom event listeners and logic using the `onMount` property). See more examples based on the definitions for the included capabilities in [`elements.ts`](https://github.com/spencerc99/playhtml/blob/main/src/elements.ts#L72).
180
+ The only required properties are `defaultData`, `updateElement` and some kind of setup to trigger those functions (in this case, `onClick`, but you can add custom event listeners and logic using the `onMount` property). See more examples based on the definitions for the included capabilities in [`elements.ts`](https://github.com/spencerc99/playhtml/blob/packages/playhtml/src/elements.ts).
181
181
 
182
182
  If you make something fun, please show me! This is designed as an open library for anyone to add on new interactions and capabilities, so we [welcome contributions](https://github.com/spencerc99/playhtml/blob/main/CONTRIBUTING.md) for new built-in capabilities.
183
183
 
@@ -225,7 +225,7 @@ Creates a rotatable element using a `rotate` `transform` on the element. Draggin
225
225
 
226
226
  ## Help & Community
227
227
 
228
- Join our [Discord community](https://discord.gg/h7sABTv8) to get help and show off what you've built!
228
+ Join our [Discord community](https://discord.gg/SKbsSf4ptU) to get help and show off what you've built!
229
229
 
230
230
  ## Data Policy
231
231
 
package/dist/main.d.ts CHANGED
@@ -94,9 +94,13 @@ export declare interface InitOptions<T = any> {
94
94
  */
95
95
  includeSearch?: boolean;
96
96
  };
97
+ /**
98
+ * Runs if playhtml fails to connect. Useful to show error messages and debugging.
99
+ */
100
+ onError?: () => void;
97
101
  }
98
102
 
99
- declare function initPlayHTML({ host, extraCapabilities, events, defaultRoomOptions, room: inputRoom, }?: InitOptions): Promise<YPartyKitProvider | undefined>;
103
+ declare function initPlayHTML({ host, extraCapabilities, events, defaultRoomOptions, room: inputRoom, onError, }?: InitOptions): Promise<YPartyKitProvider | undefined>;
100
104
 
101
105
  export declare const playhtml: PlayHTMLComponents;
102
106