lilact 0.24.0 → 0.24.2
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 +3 -1
- package/dist/lilact.development.js +10 -1
- package/dist/lilact.development.js.map +2 -2
- package/dist/lilact.development.min.js +19 -19
- package/dist/lilact.development.min.js.map +3 -3
- package/dist/lilact.production.min.js +21 -21
- package/docs/classes/accessories.ErrorBoundary.html +8 -8
- package/docs/classes/accessories.Suspense.html +7 -7
- package/docs/classes/components.Component.html +11 -11
- package/docs/classes/components.HTMLComponent.html +11 -11
- package/docs/classes/components.RootComponent.html +11 -11
- package/docs/functions/components.cloneComponent.html +1 -1
- package/docs/functions/components.createComponent.html +1 -1
- package/docs/functions/components.createPortal.html +1 -1
- package/docs/functions/components.createRoot.html +1 -1
- package/docs/functions/components.memo.html +1 -1
- package/docs/functions/components.render.html +1 -1
- package/docs/index.html +2 -1
- package/docs/static/demos/cloneelement.jsx +1 -1
- package/docs/static/index.html +1 -1
- package/docs/static/lilact.development.js +10 -1
- package/docs/static/lilact.development.js.map +2 -2
- package/docs/static/lilact.development.min.js +19 -19
- package/docs/static/lilact.development.min.js.map +3 -3
- package/docs/static/lilact.production.min.js +21 -21
- package/docs/variables/components.cloneElement.html +1 -1
- package/examples/demos/cloneelement.jsx +1 -1
- package/examples/index.html +1 -1
- package/examples/lilact.development.js +10 -1
- package/examples/lilact.development.js.map +2 -2
- package/examples/lilact.development.min.js +19 -19
- package/examples/lilact.development.min.js.map +3 -3
- package/examples/lilact.production.min.js +21 -21
- package/package.json +1 -1
- package/src/components.jsx +13 -1
- package/impexptest.js +0 -51
package/README.md
CHANGED
|
@@ -212,7 +212,7 @@ render(<App/>, document.body);
|
|
|
212
212
|
|
|
213
213
|
## Learn More / Examples / Beta Status
|
|
214
214
|
|
|
215
|
-
`Lilact` tries to mimic `React` API as close as possible. So the [Official React API Reference](https://react.dev/reference/react) can be used as a perfect resource. Most of its examples would work in `Lilact` with just substituting import source "react" with "lilact"!
|
|
215
|
+
`Lilact` tries to mimic `React` API as close as possible. So the [Official React API Reference](https://react.dev/reference/react) can be used as a perfect resource. Most of its examples would work in `Lilact` with just substituting import source "react" with "lilact"! You can even do:
|
|
216
216
|
|
|
217
217
|
```jsx
|
|
218
218
|
import React from "lilact"
|
|
@@ -226,6 +226,8 @@ import redux from "redux";
|
|
|
226
226
|
import emotion from "@emotion/css";
|
|
227
227
|
```
|
|
228
228
|
|
|
229
|
+
Some functions are not implemented in `Lilact`, mostly because `Lilact` is only client side and doesn't need server side API. Besides that, a few missing hooks and components like `Profiler` or `StrictMode` exist, which will be implemented in the future. There are also a few differences that are mentioned in the `Lilact` documentation.
|
|
230
|
+
|
|
229
231
|
To know more about using `Lilact`, see the included examples:
|
|
230
232
|
[Lilact Examples](https://arashkazemi.github.io/lilact/static)
|
|
231
233
|
|
|
@@ -2332,6 +2332,7 @@ __export(components_exports, {
|
|
|
2332
2332
|
update_set: () => update_set,
|
|
2333
2333
|
update_timeout: () => update_timeout
|
|
2334
2334
|
});
|
|
2335
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
2335
2336
|
var ComponentCache = class {
|
|
2336
2337
|
constructor(owner) {
|
|
2337
2338
|
__publicField(this, "owner");
|
|
@@ -2445,7 +2446,12 @@ var ComponentCore = class {
|
|
|
2445
2446
|
if (this.component.shouldComponentUpdate && !this.component.shouldComponentUpdate(next_state, next_props, this.context)) return;
|
|
2446
2447
|
if (typeof this.entity === "string") {
|
|
2447
2448
|
if (!(this.element instanceof Element)) {
|
|
2448
|
-
this.
|
|
2449
|
+
if (this.is_svg || this.container.is_svg) {
|
|
2450
|
+
this.is_svg = true;
|
|
2451
|
+
this.element = document.createElementNS(SVG_NS, this.entity);
|
|
2452
|
+
} else {
|
|
2453
|
+
this.element = document.createElement(this.entity);
|
|
2454
|
+
}
|
|
2449
2455
|
if (next_props == null ? void 0 : next_props.defaultValue) this.element.value = String(next_props.defaultValue).slice(0, next_props == null ? void 0 : next_props.maxLength);
|
|
2450
2456
|
if (next_props == null ? void 0 : next_props.defaultChecked) this.element.checked = next_props.defaultChecked;
|
|
2451
2457
|
}
|
|
@@ -3023,6 +3029,9 @@ var HTMLComponent = class extends Component {
|
|
|
3023
3029
|
constructor(entity, props) {
|
|
3024
3030
|
super(props);
|
|
3025
3031
|
this[CORE].entity = entity;
|
|
3032
|
+
if (entity === "svg") {
|
|
3033
|
+
this[CORE].is_svg = true;
|
|
3034
|
+
}
|
|
3026
3035
|
}
|
|
3027
3036
|
render() {
|
|
3028
3037
|
return this[CORE].props.children;
|