cradova 3.15.6 → 3.15.8
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/dist/index.js +4 -4
- package/dist/primitives/types.d.ts +2 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -311,7 +311,7 @@ var toCompNoRender = (comp) => {
|
|
|
311
311
|
var compManager = {
|
|
312
312
|
render(component) {
|
|
313
313
|
const html = component(component, ...component._args || []);
|
|
314
|
-
if (html instanceof HTMLElement) {
|
|
314
|
+
if (html instanceof HTMLElement || html instanceof DocumentFragment) {
|
|
315
315
|
component.reference = html;
|
|
316
316
|
component.rendered = true;
|
|
317
317
|
component.published = true;
|
|
@@ -341,7 +341,7 @@ var compManager = {
|
|
|
341
341
|
if (document.body.contains(node)) {
|
|
342
342
|
resetComponent(component);
|
|
343
343
|
const newHtml = component(component, ...component._args || []);
|
|
344
|
-
if (newHtml instanceof HTMLElement) {
|
|
344
|
+
if (newHtml instanceof HTMLElement || newHtml instanceof DocumentFragment) {
|
|
345
345
|
node.insertAdjacentElement("beforebegin", newHtml);
|
|
346
346
|
node.remove();
|
|
347
347
|
component.reference = newHtml;
|
|
@@ -575,7 +575,7 @@ class Signal {
|
|
|
575
575
|
const isComp = !isArrowFunc(listener);
|
|
576
576
|
if (isComp) {
|
|
577
577
|
const el = toComp(listener);
|
|
578
|
-
if (el === undefined || !(el instanceof HTMLElement)) {
|
|
578
|
+
if (el === undefined || !(el instanceof HTMLElement) || !(el instanceof DocumentFragment)) {
|
|
579
579
|
console.error(` ✘ Cradova err: ${String(listener)} is not a valid element or function`);
|
|
580
580
|
return;
|
|
581
581
|
}
|
|
@@ -718,7 +718,7 @@ class List {
|
|
|
718
718
|
const isComp = !isArrowFunc(listener);
|
|
719
719
|
if (isComp) {
|
|
720
720
|
const el = toComp(listener);
|
|
721
|
-
if (el === undefined || !(el instanceof HTMLElement)) {
|
|
721
|
+
if (el === undefined || !(el instanceof HTMLElement) || !(el instanceof DocumentFragment)) {
|
|
722
722
|
console.error(` ✘ Cradova err: ${String(listener)} is not a valid element or function`);
|
|
723
723
|
return;
|
|
724
724
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as CSS from "csstype";
|
|
2
2
|
import { Page, RefInstance, Signal } from "./classes.js";
|
|
3
|
-
interface Attributes<E extends HTMLElement> {
|
|
3
|
+
interface Attributes<E extends HTMLElement | DocumentFragment> {
|
|
4
4
|
ref?: [RefInstance<any>, string];
|
|
5
5
|
style?: Partial<CSS.Properties>;
|
|
6
6
|
[key: `data-${string}`]: string;
|
|
@@ -11,7 +11,7 @@ type StandardEvents = KeyboardEvent | MouseEvent | TouchEvent | WheelEvent | Dra
|
|
|
11
11
|
type OmitFunctions<E> = {
|
|
12
12
|
[K in keyof E as E[K] extends Function ? never : K]: E[K];
|
|
13
13
|
};
|
|
14
|
-
export type VJS_params_TYPE<E extends HTMLElement> = (undefined | undefined[] | string | string[] | HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | (() => HTMLElement) | (() => HTMLElement)[] | ((ctx: Comp) => HTMLElement) | ((ctx: Comp) => HTMLElement)[] | [string, Signal<any>] | Attributes<E> | OmitFunctions<E>)[];
|
|
14
|
+
export type VJS_params_TYPE<E extends HTMLElement | DocumentFragment> = (undefined | undefined[] | string | string[] | HTMLElement | HTMLElement[] | DocumentFragment | DocumentFragment[] | (() => HTMLElement) | (() => HTMLElement)[] | ((ctx: Comp) => HTMLElement) | ((ctx: Comp) => HTMLElement)[] | [string, Signal<any>] | Attributes<E> | OmitFunctions<E>)[];
|
|
15
15
|
export type CradovaPageType = {
|
|
16
16
|
/**
|
|
17
17
|
* Cradova page
|
package/package.json
CHANGED