@prismora/react 0.1.2 → 0.1.3

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.
@@ -15,8 +15,10 @@ export function createComponent(tag, events, load) {
15
15
  for (const [k, v] of Object.entries(props)) {
16
16
  if (k in events)
17
17
  handlers[events[k]] = v;
18
- else if (v === false)
19
- continue; // omit false booleans so attributes are absent
18
+ // Before the element is defined, false would become the attribute "false" (true), so it is omitted. Once defined,
19
+ // it is passed so the property is set to false (Preact would otherwise set a removed prop to "").
20
+ else if (v === false && (typeof customElements === 'undefined' || !customElements.get(tag)))
21
+ continue;
20
22
  else
21
23
  rest[k] = v;
22
24
  }
package/dist/index.d.ts CHANGED
@@ -111,3 +111,8 @@ declare module 'react' {
111
111
  mobile?: '' | 'false' | (string & {}) | boolean;
112
112
  }
113
113
  }
114
+ declare module 'preact' {
115
+ interface HTMLAttributes<RefType extends EventTarget = EventTarget> {
116
+ mobile?: '' | 'false' | (string & {}) | boolean;
117
+ }
118
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prismora/react",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "React wrappers for Prismora web components (generated).",
5
5
  "keywords": [
6
6
  "prismora",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "sideEffects": false,
35
35
  "dependencies": {
36
- "@prismora/elements": "^0.1.2"
36
+ "@prismora/elements": "^0.1.3"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=19"