native-document 1.0.286 → 1.0.287
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-document",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.287",
|
|
4
4
|
"description": "A reactive JavaScript framework that preserves native DOM simplicity without sacrificing modern features",
|
|
5
5
|
"author": "AfroCodeur <https://github.com/afrocodeur>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,7 +8,16 @@ export default function Slot(content) {
|
|
|
8
8
|
}
|
|
9
9
|
this.$anchor = Anchor();
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
if(content) {
|
|
12
|
+
if(content.__$Observable) {
|
|
13
|
+
this.$anchor.set(content.val());
|
|
14
|
+
content.subscribe((value) => {
|
|
15
|
+
this.$anchor.set(value);
|
|
16
|
+
});
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this.$anchor.setContent(content);
|
|
20
|
+
}
|
|
12
21
|
}
|
|
13
22
|
|
|
14
23
|
|
|
@@ -125,7 +125,10 @@ export const setupInteraction = (listItem, el, submenuEl, orientation, interacti
|
|
|
125
125
|
export function applyIsActive(instance, $description, props) {
|
|
126
126
|
const root = instance.getRoot();
|
|
127
127
|
if(root && root.$description.active) {
|
|
128
|
-
|
|
128
|
+
if(!(typeof root.$description.active === 'function')) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const isActive = root.$description.active($description);
|
|
129
132
|
props.class.add({ 'is-active': isActive });
|
|
130
133
|
}
|
|
131
134
|
}
|
package/types/elements.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { NDElement } from './nd-element';
|
|
|
5
5
|
import {AnchorAttributes,
|
|
6
6
|
AudioAttributes, CanvasAttributes, DetailsAttributes, DialogAttributes, GlobalAttributes, OlAttributes,
|
|
7
7
|
SourceAttributes, SvgAttributes, TrackAttributes, VideoAttributes, ThAttributes, ModAttributes, TdAttributes, TimeAttributes } from './globals';
|
|
8
|
+
import {SlotInterface} from "./slot";
|
|
8
9
|
|
|
9
10
|
// - Re-export all attribute types and utilities from globals
|
|
10
11
|
export type {
|
|
@@ -57,6 +58,7 @@ export type ValidChild =
|
|
|
57
58
|
| ObservableItem
|
|
58
59
|
| NDElement
|
|
59
60
|
| BindingHydrator
|
|
61
|
+
| SlotInterface
|
|
60
62
|
| ValidChild[]
|
|
61
63
|
| ((...args: any[]) => ValidChild);
|
|
62
64
|
|