ripple 0.2.65 → 0.2.66
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
|
@@ -486,12 +486,6 @@ const visitors = {
|
|
|
486
486
|
state.analysis.module.filename,
|
|
487
487
|
attribute,
|
|
488
488
|
);
|
|
489
|
-
} else {
|
|
490
|
-
error(
|
|
491
|
-
'Cannot have a `children` prop on a component, did you mean `$children`?',
|
|
492
|
-
state.analysis.module.filename,
|
|
493
|
-
attribute,
|
|
494
|
-
);
|
|
495
489
|
}
|
|
496
490
|
}
|
|
497
491
|
}
|
|
@@ -629,7 +629,7 @@ const visitors = {
|
|
|
629
629
|
} else if (node.metadata.scoped && state.component.css) {
|
|
630
630
|
const value = state.component.css.hash;
|
|
631
631
|
|
|
632
|
-
handle_static_attr('class', value);
|
|
632
|
+
handle_static_attr(is_spreading ? '#class' : 'class', value);
|
|
633
633
|
}
|
|
634
634
|
|
|
635
635
|
state.template.push('>');
|
|
@@ -1473,6 +1473,7 @@ function transform_children(children, context) {
|
|
|
1473
1473
|
node.type === 'FunctionDeclaration' ||
|
|
1474
1474
|
node.type === 'DebuggerStatement' ||
|
|
1475
1475
|
node.type === 'ClassDeclaration' ||
|
|
1476
|
+
node.type === 'TSTypeAliasDeclaration' ||
|
|
1476
1477
|
node.type === 'Component'
|
|
1477
1478
|
) {
|
|
1478
1479
|
const metadata = { await: false };
|
package/src/jsx-runtime.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ export function jsxs(
|
|
|
30
30
|
* JSX Fragment component
|
|
31
31
|
* In Ripple, fragments are imperative and don't return anything
|
|
32
32
|
*/
|
|
33
|
-
export function Fragment(props: {
|
|
33
|
+
export function Fragment(props: { children?: any }): void;
|
|
34
34
|
|
|
35
35
|
// Base HTML attributes
|
|
36
36
|
interface HTMLAttributes {
|
|
@@ -41,7 +41,7 @@ interface HTMLAttributes {
|
|
|
41
41
|
onClick?: (event: MouseEvent) => void;
|
|
42
42
|
onInput?: (event: InputEvent) => void;
|
|
43
43
|
onChange?: (event: Event) => void;
|
|
44
|
-
|
|
44
|
+
children?: any;
|
|
45
45
|
[key: string]: any;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -88,7 +88,7 @@ declare global {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
interface ElementChildrenAttribute {
|
|
91
|
-
|
|
91
|
+
children: {};
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -7,7 +7,11 @@ import {
|
|
|
7
7
|
is_tracked_object,
|
|
8
8
|
} from './utils.js';
|
|
9
9
|
import { delegate, event } from './events.js';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
get_attribute_event_name,
|
|
12
|
+
is_delegated,
|
|
13
|
+
is_event_attribute,
|
|
14
|
+
} from '../../../utils/events.js';
|
|
11
15
|
import { get } from './runtime.js';
|
|
12
16
|
|
|
13
17
|
export function set_text(text, value) {
|
|
@@ -81,6 +85,9 @@ export function set_attributes(element, attributes) {
|
|
|
81
85
|
|
|
82
86
|
if (key === 'class') {
|
|
83
87
|
set_class(element, value);
|
|
88
|
+
} else if (key === '#class') {
|
|
89
|
+
// Special case for static class when spreading props
|
|
90
|
+
element.classList.add(value);
|
|
84
91
|
} else if (is_event_attribute(key)) {
|
|
85
92
|
// Handle event handlers in spread props
|
|
86
93
|
const event_name = get_attribute_event_name(key);
|