vasille-web 5.0.0 → 5.0.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 +43 -19
- package/lib/jsx-runtime.js +1 -0
- package/package.json +1 -1
- package/types/jsx-runtime.d.ts +13 -7
- package/types/spec/html.d.ts +6 -3
package/README.md
CHANGED
|
@@ -2,9 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|

|
|
4
4
|
|
|
5
|
-
`SteelFrameKit` is a front-end development kit, which is developed to provide
|
|
5
|
+
`SteelFrameKit` is a front-end development kit, which is developed to provide fault tolerant web applications.
|
|
6
6
|
|
|
7
|
-
[](https://www.npmjs.com/package/steel-frame)
|
|
8
|
+
[](https://deepwiki.com/vasille-js/steel-frame)
|
|
9
|
+
[](https://coveralls.io/github/vasille-js/steel-frame?branch=v5)
|
|
8
10
|
|
|
9
11
|
## Table of content
|
|
10
12
|
|
|
@@ -19,11 +21,12 @@
|
|
|
19
21
|
- [How POWERFUL is SteelFrameKit](#how-powerful-is-steelframekit)
|
|
20
22
|
- [Road map](#road-map)
|
|
21
23
|
- [Change log](#change-log)
|
|
22
|
-
- [5.
|
|
23
|
-
- [
|
|
24
|
-
- [4.
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
24
|
+
- [5.1](#51)
|
|
25
|
+
- [5.0](#50)
|
|
26
|
+
- [4.0 - 4.3](#40---43)
|
|
27
|
+
- [3.0 - 3.2](#30---32)
|
|
28
|
+
- [2.0 - 2.3](#20---23)
|
|
29
|
+
- [1.0 - 1.2](#10---12)
|
|
27
30
|
- [Questions](#questions)
|
|
28
31
|
|
|
29
32
|
|
|
@@ -92,7 +95,7 @@ All of these are supported:
|
|
|
92
95
|
* Reactive values (observables).
|
|
93
96
|
* Inline computed values.
|
|
94
97
|
* Multiline computed values.
|
|
95
|
-
* HTML
|
|
98
|
+
* HTML tags.
|
|
96
99
|
* Component custom slots.
|
|
97
100
|
* 2-way data binding in components.
|
|
98
101
|
* Logic block (if, else).
|
|
@@ -103,7 +106,6 @@ All of these are supported:
|
|
|
103
106
|
|
|
104
107
|
## Road map
|
|
105
108
|
|
|
106
|
-
* [x] Update the `core` library to version 3.0.
|
|
107
109
|
* [x] `100%` Test Coverage for core Library v3.
|
|
108
110
|
* [x] Develop the `JSX` library.
|
|
109
111
|
* [x] `100%` Test Coverage for the JSX library.
|
|
@@ -117,25 +119,47 @@ All of these are supported:
|
|
|
117
119
|
|
|
118
120
|
## Change log
|
|
119
121
|
|
|
120
|
-
|
|
122
|
+
We respect semantic versioning:
|
|
123
|
+
- A major version is increased when we make incompatible API changes.
|
|
124
|
+
- A minor version is increased when we add functionality.
|
|
125
|
+
- Patch version is increased when we fix bugs.
|
|
121
126
|
|
|
122
|
-
|
|
127
|
+
### 5.1
|
|
123
128
|
|
|
124
|
-
|
|
129
|
+
Add support for web components compile target `web build components`.
|
|
130
|
+
_Web components as custom tags are supported in any version._
|
|
125
131
|
|
|
126
|
-
|
|
132
|
+
### 5.0
|
|
127
133
|
|
|
128
|
-
|
|
134
|
+
- Add support for context and dependencies injection.
|
|
135
|
+
- New developement direction: `fault tolerant`.
|
|
136
|
+
- Renamed to `steel-frame`. **[API change]**
|
|
137
|
+
- Removed `forward` and `backward` functions. **[API change]**
|
|
138
|
+
- Removed `Debug` component. **[API change]**
|
|
129
139
|
|
|
130
|
-
|
|
140
|
+
### 4.0 - 4.3
|
|
131
141
|
|
|
132
|
-
|
|
142
|
+
- Initial version of the framework with file based routing and building scripts (`web dev` and `web build spa`).
|
|
143
|
+
- Reactive values naming switched to `$` prefix. **[API change]**
|
|
144
|
+
- `4.1` Added SSG (static site generation) as build option `web build static`.
|
|
145
|
+
- `4.2` Add support for inlined conditions in JSX, binary `&&` and ternary `?:` operator.
|
|
146
|
+
- `4.3` Add new function `safe` which make functions safe, errors are reported automatically.
|
|
133
147
|
|
|
134
|
-
|
|
148
|
+
### 3.0 - 3.2
|
|
135
149
|
|
|
136
|
-
|
|
150
|
+
- Switch to a babel plugin to compile components code. **[API change]**
|
|
151
|
+
- 100% of the code has been covered with unit tests.
|
|
152
|
+
- New developement direction: `keep it simple`.
|
|
137
153
|
|
|
138
|
-
|
|
154
|
+
### 2.0 - 2.3
|
|
155
|
+
|
|
156
|
+
- Introduces components compilation via a typescript plugin. **[API change]**
|
|
157
|
+
- New developement direction: `write less, do more`.
|
|
158
|
+
|
|
159
|
+
### 1.0 - 1.2
|
|
160
|
+
|
|
161
|
+
- Initial version of a core library.
|
|
162
|
+
- Developemnt direction: `performance-first`.
|
|
139
163
|
|
|
140
164
|
## Questions
|
|
141
165
|
|
package/lib/jsx-runtime.js
CHANGED
package/package.json
CHANGED
package/types/jsx-runtime.d.ts
CHANGED
|
@@ -1,24 +1,31 @@
|
|
|
1
1
|
import type { RawStyleProps } from "./spec/css.ts";
|
|
2
2
|
import type { HtmlTagMap } from "./spec/html.ts";
|
|
3
|
-
type
|
|
3
|
+
export type { TagEvents, TagAttrs, TagProps } from "./spec/html.ts";
|
|
4
|
+
export type prefixedObject<T, P extends string> = {
|
|
4
5
|
[K in keyof T as K extends string ? `${P}${K}` : never]?: T[K];
|
|
5
6
|
};
|
|
6
|
-
type EventHandlers<T> = {
|
|
7
|
+
export type EventHandlers<T> = {
|
|
7
8
|
[K in keyof T]: T[K] | [T[K], boolean | AddEventListenerOptions];
|
|
8
9
|
};
|
|
9
10
|
export type ClassItem = string | Record<string, boolean> | false;
|
|
11
|
+
declare const internal: unique symbol;
|
|
12
|
+
export interface VasilleElement {
|
|
13
|
+
[internal]: typeof internal;
|
|
14
|
+
}
|
|
15
|
+
export type VasilleChild = VasilleElement | string | number | boolean | null | undefined;
|
|
16
|
+
export type VasilleSlot = VasilleChild | VasilleChild[];
|
|
10
17
|
type HtmlInput<K extends keyof HTMLElementTagNameMap & keyof HtmlTagMap> = {
|
|
11
18
|
callback?: (node: HTMLElementTagNameMap[K]) => unknown;
|
|
12
19
|
class?: ClassItem[] | string;
|
|
13
20
|
style?: RawStyleProps | string;
|
|
14
|
-
slot?:
|
|
21
|
+
"vasille:slot"?: VasilleSlot;
|
|
15
22
|
} & Partial<HtmlTagMap[K]["attrs"]> & prefixedObject<EventHandlers<HtmlTagMap[K]["events"]>, "on"> & Partial<prefixedObject<HtmlTagMap[K]["props"], "bind:">>;
|
|
16
23
|
export declare namespace JSX {
|
|
17
24
|
type ElementType = keyof IntrinsicElements | ((props: any) => void);
|
|
18
|
-
type Element =
|
|
19
|
-
type ElementClass =
|
|
25
|
+
type Element = VasilleElement;
|
|
26
|
+
type ElementClass = VasilleElement;
|
|
20
27
|
interface ElementChildrenAttribute {
|
|
21
|
-
slot:
|
|
28
|
+
"vasille:slot": VasilleSlot;
|
|
22
29
|
}
|
|
23
30
|
interface IntrinsicElements {
|
|
24
31
|
a: HtmlInput<"a">;
|
|
@@ -133,4 +140,3 @@ export declare namespace JSX {
|
|
|
133
140
|
wbr: HtmlInput<"wbr">;
|
|
134
141
|
}
|
|
135
142
|
}
|
|
136
|
-
export {};
|
package/types/spec/html.d.ts
CHANGED
|
@@ -4,10 +4,10 @@ export interface Tag<Attrs, Events, Props> {
|
|
|
4
4
|
events: Events;
|
|
5
5
|
props: Props;
|
|
6
6
|
}
|
|
7
|
-
type TagEvents<Target> = {
|
|
7
|
+
export type TagEvents<Target> = {
|
|
8
8
|
[K in keyof HTMLElementEventMap]: EventHandler<HTMLElementEventMap[K], Target> | undefined;
|
|
9
9
|
};
|
|
10
|
-
interface TagAttrs {
|
|
10
|
+
export interface TagAttrs {
|
|
11
11
|
id: string;
|
|
12
12
|
accesskey: string;
|
|
13
13
|
autocapitalize: "off" | "none" | "on" | "sentences" | "words" | "characters";
|
|
@@ -27,6 +27,8 @@ interface TagAttrs {
|
|
|
27
27
|
itemtype: string;
|
|
28
28
|
lang: string;
|
|
29
29
|
nonce: string;
|
|
30
|
+
part: string;
|
|
31
|
+
slot: string;
|
|
30
32
|
spellcheck: "true" | "false" | "" | boolean;
|
|
31
33
|
tabindex: number;
|
|
32
34
|
title: string;
|
|
@@ -97,6 +99,7 @@ interface AAttrs extends TagAttrs {
|
|
|
97
99
|
hreflang: string;
|
|
98
100
|
type: string;
|
|
99
101
|
referrerpolicy: string;
|
|
102
|
+
rel: string;
|
|
100
103
|
}
|
|
101
104
|
interface QAttrs extends TagAttrs {
|
|
102
105
|
cite: string;
|
|
@@ -520,7 +523,7 @@ export interface TagEventsProps<T extends Element> {
|
|
|
520
523
|
onwaiting?: ((this: T, ev: Event) => any) | null;
|
|
521
524
|
onwheel?: ((this: T, ev: WheelEvent) => any) | null;
|
|
522
525
|
}
|
|
523
|
-
interface TagProps<T extends Element> extends TagEventsProps<T> {
|
|
526
|
+
export interface TagProps<T extends Element> extends TagEventsProps<T> {
|
|
524
527
|
autofocus?: boolean;
|
|
525
528
|
className?: string;
|
|
526
529
|
nonce?: string | undefined;
|