declarative-spec 1.0.0 → 1.2.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 +85 -79
- package/package.json +35 -38
- package/src/index.js +2 -2
- package/src/v1/index.js +4 -4
- package/src/v1/spec.json +1570 -1570
- package/src/v2/index.js +8 -0
- package/src/v2/meta.js +6 -0
- package/src/v2/register.js +11 -0
- package/src/v2/spec.json +1571 -0
package/README.md
CHANGED
|
@@ -1,79 +1,85 @@
|
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
###
|
|
46
|
-
|
|
47
|
-
```javascript
|
|
48
|
-
import spec from "declarative-spec/
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
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)
|
package/package.json
CHANGED
|
@@ -1,38 +1,35 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "declarative-spec",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "
|
|
5
|
-
"type": "module",
|
|
6
|
-
"main": "./src/index.js",
|
|
7
|
-
"module": "./src/index.js",
|
|
8
|
-
"exports": {
|
|
9
|
-
".": {
|
|
10
|
-
"import": "./src/index.js",
|
|
11
|
-
"default": "./src/index.js"
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"
|
|
29
|
-
"dom-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"license": "MIT",
|
|
37
|
-
"homepage": "https://keshavsoft.github.io/declarative-spec/"
|
|
38
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "declarative-spec",
|
|
3
|
+
"version": "1.2.1",
|
|
4
|
+
"description": "High-level declarative UI component blueprints, option configurations, and assembly contracts for JSON-to-DOM compilers.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./src/index.js",
|
|
7
|
+
"module": "./src/index.js",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./src/index.js",
|
|
11
|
+
"default": "./src/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"src",
|
|
16
|
+
"README.md"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/keshavsoft/declarative-spec.git"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "npx @keshavsoft/build-cli"
|
|
24
|
+
},
|
|
25
|
+
"keywords": [
|
|
26
|
+
"declarative-ui",
|
|
27
|
+
"component-blueprints",
|
|
28
|
+
"ui-contracts",
|
|
29
|
+
"dom-compiler",
|
|
30
|
+
"zero-dependency"
|
|
31
|
+
],
|
|
32
|
+
"author": "KeshavSoft",
|
|
33
|
+
"license": "MIT",
|
|
34
|
+
"homepage": "https://keshavsoft.github.io/declarative-spec/"
|
|
35
|
+
}
|
package/src/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { default } from "./v1/index.js";
|
|
2
|
-
export * from "./v1/index.js";
|
|
1
|
+
export { default } from "./v1/index.js";
|
|
2
|
+
export * from "./v1/index.js";
|
package/src/v1/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import spec from "./spec.json" with { type: "json" };
|
|
2
|
-
|
|
3
|
-
export { spec };
|
|
4
|
-
export default spec;
|
|
1
|
+
import spec from "./spec.json" with { type: "json" };
|
|
2
|
+
|
|
3
|
+
export { spec };
|
|
4
|
+
export default spec;
|