declarative-spec 1.5.1 → 1.7.1
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 +105 -85
- package/package.json +1 -1
- package/src/index.js +2 -2
- package/src/v5/index.js +8 -8
- package/src/v5/meta.js +2 -2
- package/src/v5/spec.json +1893 -1893
- package/src/{v3 → v6}/index.js +1 -1
- package/src/{v3 → v6}/meta.js +2 -1
- package/src/{v2 → v6}/register.js +1 -1
- package/src/{v3 → v6}/spec.json +832 -1
- package/src/v7/README.md +13 -0
- package/src/{v2 → v7}/index.js +1 -1
- package/src/{v2 → v7}/meta.js +2 -1
- package/src/{v3 → v7}/register.js +1 -1
- package/src/{v2 → v7}/spec.json +969 -4
- package/src/v1/index.js +0 -4
- package/src/v1/spec.json +0 -1571
package/README.md
CHANGED
|
@@ -1,85 +1,105 @@
|
|
|
1
|
-
# declarative-spec
|
|
2
|
-
|
|
3
|
-
> **Canonical HTML DOM tag specifications, default utility classes, attributes, and interpolation tokens for declarative JSON-to-DOM compilers.**
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
[](https://keshavsoft.github.io/declarative-spec/)
|
|
7
|
-
[](https://www.npmjs.com/package/declarative-spec)
|
|
8
|
-
[](https://github.com/keshavsoft/declarative-spec)
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
Part of the **KeshavSoft Declarative UI Architecture** (Tier 2: DOM Tag Specifications).
|
|
12
|
-
|
|
13
|
-
---
|
|
14
|
-
|
|
15
|
-
## 📖 The Story
|
|
16
|
-
|
|
17
|
-
In modern web development, tag structures are often tightly coupled to JavaScript frameworks (JSX, Vue templates, or string templates).
|
|
18
|
-
|
|
19
|
-
`declarative-spec` decouples raw HTML elements into **pure, serializable JSON blueprints**:
|
|
20
|
-
1. **Zero Runtime Dependency**: Defines HTML primitives (`<table>`, `<th>`, `<td>`, `<select>`, `<button>`) with serializable attributes and utility classes.
|
|
21
|
-
2. **String Interpolation Tokens**: Supports dynamic placeholder tokens (`${columnName}`) that compilers can hydrate without hardcoding DOM manipulation.
|
|
22
|
-
3. **Engine Agnostic**: Can be compiled into native DOM elements, Virtual DOM nodes, or server-side HTML strings.
|
|
23
|
-
|
|
24
|
-
---
|
|
25
|
-
|
|
26
|
-
## 📦 Installation
|
|
27
|
-
|
|
28
|
-
```bash
|
|
29
|
-
npm install declarative-spec
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## 🚀 Usage
|
|
35
|
-
|
|
36
|
-
### 1. Import Spec in ES Modules
|
|
37
|
-
|
|
38
|
-
```javascript
|
|
39
|
-
import spec from "declarative-spec";
|
|
40
|
-
|
|
41
|
-
// Inspect a base tag specification
|
|
42
|
-
console.log(spec.tableSimple);
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### 2. Import Specific Version
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
import spec from "declarative-spec/v1";
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
### 3. Direct JSON Import
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
import spec from "declarative-spec/spec.json" with { type: "json" };
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## 🏛️ Tag Spec Blueprint Example
|
|
60
|
-
|
|
61
|
-
```json
|
|
62
|
-
{
|
|
63
|
-
"tableSimple": {
|
|
64
|
-
"tag": "table",
|
|
65
|
-
"attributes": {
|
|
66
|
-
"class": "table table-bordered table-striped"
|
|
67
|
-
},
|
|
68
|
-
"children": []
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
---
|
|
74
|
-
|
|
75
|
-
## 🌐 Interactive Monaco Studio & Documentation
|
|
76
|
-
|
|
77
|
-
Explore, edit, and inspect all tag blueprints live in Monaco:
|
|
78
|
-
* **Documentation & Story:** [https://keshavsoft.github.io/declarative-spec/](https://keshavsoft.github.io/declarative-spec/)
|
|
79
|
-
* **Monaco Spec Studio:** [https://keshavsoft.github.io/declarative-spec/monaco/v1/](https://keshavsoft.github.io/declarative-spec/monaco/v1/)
|
|
80
|
-
|
|
81
|
-
---
|
|
82
|
-
|
|
83
|
-
## 📄 License
|
|
84
|
-
|
|
85
|
-
MIT © [KeshavSoft](https://github.com/keshavsoft)
|
|
1
|
+
# declarative-spec
|
|
2
|
+
|
|
3
|
+
> **Canonical HTML DOM tag specifications, default utility classes, attributes, and interpolation tokens for declarative JSON-to-DOM compilers.**
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
[](https://keshavsoft.github.io/declarative-spec/)
|
|
7
|
+
[](https://www.npmjs.com/package/declarative-spec)
|
|
8
|
+
[](https://github.com/keshavsoft/declarative-spec)
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
Part of the **KeshavSoft Declarative UI Architecture** (Tier 2: DOM Tag Specifications).
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## 📖 The Story
|
|
16
|
+
|
|
17
|
+
In modern web development, tag structures are often tightly coupled to JavaScript frameworks (JSX, Vue templates, or string templates).
|
|
18
|
+
|
|
19
|
+
`declarative-spec` decouples raw HTML elements into **pure, serializable JSON blueprints**:
|
|
20
|
+
1. **Zero Runtime Dependency**: Defines HTML primitives (`<table>`, `<th>`, `<td>`, `<select>`, `<button>`) with serializable attributes and utility classes.
|
|
21
|
+
2. **String Interpolation Tokens**: Supports dynamic placeholder tokens (`${columnName}`) that compilers can hydrate without hardcoding DOM manipulation.
|
|
22
|
+
3. **Engine Agnostic**: Can be compiled into native DOM elements, Virtual DOM nodes, or server-side HTML strings.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## 📦 Installation
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
npm install declarative-spec
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
---
|
|
33
|
+
|
|
34
|
+
## 🚀 Usage
|
|
35
|
+
|
|
36
|
+
### 1. Import Spec in ES Modules
|
|
37
|
+
|
|
38
|
+
```javascript
|
|
39
|
+
import spec from "declarative-spec";
|
|
40
|
+
|
|
41
|
+
// Inspect a base tag specification
|
|
42
|
+
console.log(spec.tableSimple);
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### 2. Import Specific Version
|
|
46
|
+
|
|
47
|
+
```javascript
|
|
48
|
+
import spec from "declarative-spec/v1";
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
### 3. Direct JSON Import
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
import spec from "declarative-spec/spec.json" with { type: "json" };
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
---
|
|
58
|
+
|
|
59
|
+
## 🏛️ Tag Spec Blueprint Example
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"tableSimple": {
|
|
64
|
+
"tag": "table",
|
|
65
|
+
"attributes": {
|
|
66
|
+
"class": "table table-bordered table-striped"
|
|
67
|
+
},
|
|
68
|
+
"children": []
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🌐 Interactive Monaco Studio & Documentation
|
|
76
|
+
|
|
77
|
+
Explore, edit, and inspect all tag blueprints live in Monaco:
|
|
78
|
+
* **Documentation & Story:** [https://keshavsoft.github.io/declarative-spec/](https://keshavsoft.github.io/declarative-spec/)
|
|
79
|
+
* **Monaco Spec Studio:** [https://keshavsoft.github.io/declarative-spec/monaco/v1/](https://keshavsoft.github.io/declarative-spec/monaco/v1/)
|
|
80
|
+
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
## 📄 License
|
|
84
|
+
|
|
85
|
+
MIT © [KeshavSoft](https://github.com/keshavsoft)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
## V7 — Declarative Spec Sample Lab
|
|
89
|
+
|
|
90
|
+
V7 preserves the V6 catalogue and adds the class-based Bootstrap Header specification. It also introduces a dedicated sample lab: **one isolated folder for every top-level V7 specification entry**.
|
|
91
|
+
|
|
92
|
+
- [V7 documentation](docs/v7/)
|
|
93
|
+
- [V7 sample catalogue](samples/v7/)
|
|
94
|
+
- [Canonical V7 JSON](src/v7/spec.json)
|
|
95
|
+
- [Published V7 JSON](docs/json/v7/spec.json)
|
|
96
|
+
|
|
97
|
+
The lab contains 91 individual sample folders covering all 91 catalogue entries and 30 distinct HTML tag names. Each sample loads its own `example.json` over HTTP and renders the declared DOM structure. These are structural usage tests; application-specific behavior such as sorting, data population, and form submission remains with the consuming renderer/application.
|
|
98
|
+
|
|
99
|
+
Start a local static server from the repository root:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
npx http-server .
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
Then open `http://localhost:8080/samples/v7/`.
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { default } from "./
|
|
1
|
+
export { default } from "./v7/index.js";
|
|
2
2
|
|
|
3
|
-
export * from "./
|
|
3
|
+
export * from "./v7/index.js";
|
package/src/v5/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import spec from "./spec.json" with { type: "json" };
|
|
2
|
-
import meta from "./meta.js";
|
|
3
|
-
import registerGlobal from "./register.js";
|
|
4
|
-
|
|
5
|
-
export { spec, meta };
|
|
6
|
-
export default spec;
|
|
7
|
-
|
|
8
|
-
registerGlobal(spec);
|
|
1
|
+
import spec from "./spec.json" with { type: "json" };
|
|
2
|
+
import meta from "./meta.js";
|
|
3
|
+
import registerGlobal from "./register.js";
|
|
4
|
+
|
|
5
|
+
export { spec, meta };
|
|
6
|
+
export default spec;
|
|
7
|
+
|
|
8
|
+
registerGlobal(spec);
|
package/src/v5/meta.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const meta = { name: "declarative-spec", version: "1.5.0" };
|
|
2
|
-
export default meta;
|
|
1
|
+
export const meta = { name: "declarative-spec", version: "1.5.0" };
|
|
2
|
+
export default meta;
|