@json-to-office/jto 0.3.6 → 0.5.0
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 +39 -13
- package/dist/cli.js +80 -52
- package/dist/cli.js.map +1 -1
- package/dist/client/assets/{HomePage-DoPLARHL.js → HomePage-DfwGX3I1.js} +47 -47
- package/dist/client/assets/HomePage-DfwGX3I1.js.map +1 -0
- package/dist/client/assets/{JsonEditorPage-uVaNPE8q.js → JsonEditorPage-Ba40pGIp.js} +3 -3
- package/dist/client/assets/{JsonEditorPage-uVaNPE8q.js.map → JsonEditorPage-Ba40pGIp.js.map} +1 -1
- package/dist/client/assets/{MonacoPluginProvider-BTaxJhgr.js → MonacoPluginProvider-y0S1WRcO.js} +3 -3
- package/dist/client/assets/{MonacoPluginProvider-BTaxJhgr.js.map → MonacoPluginProvider-y0S1WRcO.js.map} +1 -1
- package/dist/client/assets/{button-C9-hWwtZ.js → button-Cxhj_Vqc.js} +2 -2
- package/dist/client/assets/{button-C9-hWwtZ.js.map → button-Cxhj_Vqc.js.map} +1 -1
- package/dist/client/assets/{editor-WAlwAQUI.js → editor-C5jlPSdE.js} +2 -2
- package/dist/client/assets/{editor-WAlwAQUI.js.map → editor-C5jlPSdE.js.map} +1 -1
- package/dist/client/assets/{editor-monaco-json-BLhhoYVD.js → editor-monaco-json-DyDeK1fB.js} +2 -2
- package/dist/client/assets/{editor-monaco-json-BLhhoYVD.js.map → editor-monaco-json-DyDeK1fB.js.map} +1 -1
- package/dist/client/assets/{index-Bu7pVmbf.js → index-B2Ju-X_M.js} +3 -3
- package/dist/client/assets/{index-Bu7pVmbf.js.map → index-B2Ju-X_M.js.map} +1 -1
- package/dist/client/assets/{preview-Dpw5ePME.js → preview-sfoszPPX.js} +2 -2
- package/dist/client/assets/{preview-Dpw5ePME.js.map → preview-sfoszPPX.js.map} +1 -1
- package/dist/client/index.html +1 -1
- package/dist/client/templates/Lumina Analytics.pptx.json +1913 -0
- package/dist/client/templates/themes/lumina.pptx.theme.json +42 -0
- package/dist/client/templates/themes/meridian.pptx.theme.json +42 -0
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/prompts/instructions-edit-document-pptx-slides.md +23 -2
- package/dist/prompts/instructions-edit-document-pptx-templates.md +16 -1
- package/dist/prompts/instructions-edit-document-pptx.md +59 -5
- package/dist/prompts/instructions-generate-pptx.md +3 -1
- package/package.json +3 -3
- package/dist/client/assets/HomePage-DoPLARHL.js.map +0 -1
- package/dist/client/templates/Charts Demo.pptx.json +0 -174
- package/dist/client/templates/Company Branding.pptx.json +0 -143
- package/dist/client/templates/Dashboard.pptx.json +0 -91
- package/dist/client/templates/Product Launch.pptx.json +0 -87
- package/dist/client/templates/Sales Deck.pptx.json +0 -80
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
## Presentation: {{documentName}}
|
|
2
2
|
|
|
3
3
|
### Available Templates (reference only — do not output these)
|
|
4
|
+
|
|
4
5
|
{{templatesSummary}}
|
|
5
6
|
|
|
6
7
|
### Current Slides
|
|
8
|
+
|
|
7
9
|
```json
|
|
8
10
|
{{slidesText}}
|
|
9
11
|
```
|
|
10
12
|
|
|
11
13
|
You are EDITING the slides of this presentation. Return ONLY the modified slides array:
|
|
14
|
+
|
|
12
15
|
```json
|
|
13
16
|
{
|
|
14
17
|
"children": [ ...all slides including unmodified ones... ]
|
|
@@ -24,17 +27,35 @@ You are EDITING the slides of this presentation. Return ONLY the modified slides
|
|
|
24
27
|
- Preserve unmodified slides exactly as they appear above.
|
|
25
28
|
- When editing a slide, keep its `template` reference and only change `placeholders` content.
|
|
26
29
|
- If the presentation uses templates, new slides should also use templates for consistency.
|
|
30
|
+
- **Component format:** every component MUST be `{ "name": "<type>", "props": { ... } }`. Never use `{ "type": "...", ... }` with flat props.
|
|
27
31
|
|
|
28
32
|
### Example
|
|
29
33
|
|
|
30
34
|
**User request:** "Add a slide about pricing"
|
|
31
35
|
|
|
32
36
|
**Correct output (complete children array with new slide appended):**
|
|
37
|
+
|
|
33
38
|
```json
|
|
34
39
|
{
|
|
35
40
|
"children": [
|
|
36
|
-
{
|
|
37
|
-
|
|
41
|
+
{
|
|
42
|
+
"name": "slide",
|
|
43
|
+
"props": {
|
|
44
|
+
"template": "CONTENT_TEMPLATE",
|
|
45
|
+
"placeholders": {
|
|
46
|
+
"heading": { "name": "text", "props": { "text": "Overview" } }
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"name": "slide",
|
|
52
|
+
"props": {
|
|
53
|
+
"template": "CONTENT_TEMPLATE",
|
|
54
|
+
"placeholders": {
|
|
55
|
+
"heading": { "name": "text", "props": { "text": "Pricing" } }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
38
59
|
]
|
|
39
60
|
}
|
|
40
61
|
```
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
## Presentation: {{documentName}}
|
|
2
2
|
|
|
3
3
|
### Current Templates
|
|
4
|
+
|
|
4
5
|
```json
|
|
5
6
|
{{templatesText}}
|
|
6
7
|
```
|
|
7
8
|
|
|
8
9
|
### Slides Using These Templates (reference only — do not output these)
|
|
10
|
+
|
|
9
11
|
{{slidesSummary}}
|
|
10
12
|
|
|
11
13
|
You are EDITING the template slides of this presentation. Output **only new or modified** templates:
|
|
14
|
+
|
|
12
15
|
```json
|
|
13
16
|
{
|
|
14
17
|
"templates": [ ...only new/changed templates... ]
|
|
@@ -27,12 +30,14 @@ Unchanged templates are automatically preserved — do NOT echo them back.
|
|
|
27
30
|
- When adding a new template, use SCREAMING_SNAKE_CASE naming (e.g. `FULLSCREEN_IMAGE_TEMPLATE`).
|
|
28
31
|
- Each template needs: `name`, `placeholders[]`, and optionally `background`, `objects[]`, `grid`.
|
|
29
32
|
- For page numbers, add a text component with `"text": "{PAGE_NUMBER}"` inside `objects[]` — do NOT use a `slideNumber` key.
|
|
33
|
+
- **Object format:** every item in `objects[]` MUST be `{ "name": "<type>", "props": { ... } }`. Never use `{ "type": "...", ... }` with flat props. Wrong: `{ "type": "image", "src": "logo.svg" }`. Correct: `{ "name": "image", "props": { "src": "logo.svg" } }`. Same applies to `placeholders[].defaults`.
|
|
30
34
|
|
|
31
35
|
### Example
|
|
32
36
|
|
|
33
37
|
**User request:** "Add a divider bar to CONTENT_TEMPLATE"
|
|
34
38
|
|
|
35
39
|
**Correct output (only the modified template):**
|
|
40
|
+
|
|
36
41
|
```json
|
|
37
42
|
{
|
|
38
43
|
"templates": [
|
|
@@ -40,7 +45,17 @@ Unchanged templates are automatically preserved — do NOT echo them back.
|
|
|
40
45
|
"name": "CONTENT_TEMPLATE",
|
|
41
46
|
"placeholders": [{ "name": "heading" }, { "name": "body" }],
|
|
42
47
|
"objects": [
|
|
43
|
-
{
|
|
48
|
+
{
|
|
49
|
+
"name": "shape",
|
|
50
|
+
"props": {
|
|
51
|
+
"type": "line",
|
|
52
|
+
"x": "5%",
|
|
53
|
+
"y": "20%",
|
|
54
|
+
"w": "90%",
|
|
55
|
+
"h": "0%",
|
|
56
|
+
"line": { "color": "accent", "width": 1 }
|
|
57
|
+
}
|
|
58
|
+
}
|
|
44
59
|
]
|
|
45
60
|
}
|
|
46
61
|
]
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
## Current {{contentLabel}} ({{documentName}})
|
|
2
|
+
|
|
2
3
|
The user already has this {{contentLabelLower}} open in the editor:
|
|
4
|
+
|
|
3
5
|
```json
|
|
4
6
|
{{documentText}}
|
|
5
7
|
```
|
|
@@ -12,20 +14,37 @@ IMPORTANT: This {{contentLabelLower}} already exists. You are EDITING it, not ge
|
|
|
12
14
|
- When adding new slides, **reference existing template names** — do not invent new templates unless the user asks for a new layout.
|
|
13
15
|
- When editing a slide, keep its `template` reference and only change the `placeholders` content.
|
|
14
16
|
- If the presentation uses templates, new slides should also use templates for consistency.
|
|
17
|
+
- **Component format:** every component MUST be `{ "name": "<type>", "props": { ... } }`. Never use `{ "type": "...", ... }` with flat props.
|
|
15
18
|
|
|
16
19
|
### Example
|
|
17
20
|
|
|
18
21
|
**Current presentation (abbreviated):**
|
|
22
|
+
|
|
19
23
|
```json
|
|
20
24
|
{
|
|
21
25
|
"name": "pptx",
|
|
22
26
|
"props": {
|
|
23
27
|
"templates": [
|
|
24
|
-
{
|
|
28
|
+
{
|
|
29
|
+
"name": "CONTENT_TEMPLATE",
|
|
30
|
+
"placeholders": [
|
|
31
|
+
{ "name": "heading", "type": "title" },
|
|
32
|
+
{ "name": "body", "type": "body" }
|
|
33
|
+
]
|
|
34
|
+
}
|
|
25
35
|
]
|
|
26
36
|
},
|
|
27
37
|
"children": [
|
|
28
|
-
{
|
|
38
|
+
{
|
|
39
|
+
"name": "slide",
|
|
40
|
+
"props": {
|
|
41
|
+
"template": "CONTENT_TEMPLATE",
|
|
42
|
+
"placeholders": {
|
|
43
|
+
"heading": { "name": "text", "props": { "text": "Overview" } },
|
|
44
|
+
"body": { "name": "text", "props": { "text": "Content here." } }
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
}
|
|
29
48
|
]
|
|
30
49
|
}
|
|
31
50
|
```
|
|
@@ -33,17 +52,52 @@ IMPORTANT: This {{contentLabelLower}} already exists. You are EDITING it, not ge
|
|
|
33
52
|
**User request:** "Add a slide about pricing"
|
|
34
53
|
|
|
35
54
|
**Correct output (full document with new slide appended, using existing template):**
|
|
55
|
+
|
|
36
56
|
```json
|
|
37
57
|
{
|
|
38
58
|
"name": "pptx",
|
|
39
59
|
"props": {
|
|
40
60
|
"templates": [
|
|
41
|
-
{
|
|
61
|
+
{
|
|
62
|
+
"name": "CONTENT_TEMPLATE",
|
|
63
|
+
"placeholders": [
|
|
64
|
+
{ "name": "heading", "type": "title" },
|
|
65
|
+
{ "name": "body", "type": "body" }
|
|
66
|
+
]
|
|
67
|
+
}
|
|
42
68
|
]
|
|
43
69
|
},
|
|
44
70
|
"children": [
|
|
45
|
-
{
|
|
46
|
-
|
|
71
|
+
{
|
|
72
|
+
"name": "slide",
|
|
73
|
+
"props": {
|
|
74
|
+
"template": "CONTENT_TEMPLATE",
|
|
75
|
+
"placeholders": {
|
|
76
|
+
"heading": { "name": "text", "props": { "text": "Overview" } },
|
|
77
|
+
"body": { "name": "text", "props": { "text": "Content here." } }
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
"name": "slide",
|
|
83
|
+
"props": {
|
|
84
|
+
"template": "CONTENT_TEMPLATE",
|
|
85
|
+
"placeholders": {
|
|
86
|
+
"heading": { "name": "text", "props": { "text": "Pricing" } },
|
|
87
|
+
"body": {
|
|
88
|
+
"name": "table",
|
|
89
|
+
"props": {
|
|
90
|
+
"rows": [
|
|
91
|
+
["Plan", "Price"],
|
|
92
|
+
["Starter", "$9/mo"],
|
|
93
|
+
["Pro", "$29/mo"]
|
|
94
|
+
],
|
|
95
|
+
"grid": { "column": 0, "row": 2, "columnSpan": 12, "rowSpan": 3 }
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
47
101
|
]
|
|
48
102
|
}
|
|
49
103
|
```
|
|
@@ -3,7 +3,8 @@ The user wants you to generate a complete presentation JSON from scratch.
|
|
|
3
3
|
Produce a full PPTX JSON wrapped in a ```json code block:
|
|
4
4
|
|
|
5
5
|
- Define 2–3 template slides (TITLE_TEMPLATE, CONTENT_TEMPLATE, and optionally TWO_COLUMN_TEMPLATE)
|
|
6
|
-
- Templates should include header bars, footer bars, and branding text as `objects`
|
|
6
|
+
- Templates should include header bars, footer bars, and branding text as `objects`
|
|
7
|
+
- **Every component** (in `objects[]`, `placeholders`, `children[]`) MUST use `{ "name": "<type>", "props": { ... } }`. Never `{ "type": "...", ... }` with flat props
|
|
7
8
|
- The presentation MUST include a `"grid"` prop on `pptx.props` (e.g. `"grid": { "columns": 12, "rows": 6, "margin": 0.5, "gutter": 0.2 }`)
|
|
8
9
|
- Templates with header/footer bars MUST set `"grid": { "margin": { "top": <header-height + 0.2> } }` so row 0 starts below the header
|
|
9
10
|
- Generate 5–8 slides that reference these templates and fill their placeholders
|
|
@@ -13,6 +14,7 @@ Produce a full PPTX JSON wrapped in a ```json code block:
|
|
|
13
14
|
- For refined/elegant designs, use light font variants (e.g. `"Inter Light"`) via `fontFace` instead of relying on bold alone
|
|
14
15
|
|
|
15
16
|
Before finalizing, verify:
|
|
17
|
+
|
|
16
18
|
- [ ] No two text/shape components share the same position
|
|
17
19
|
- [ ] Headings fit their container (short text or reduced fontSize)
|
|
18
20
|
- [ ] `slideNumber` is in the bottom-right, not overlapping content
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@json-to-office/jto",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "JSON to Office CLI - Unified document and presentation generation",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -86,10 +86,10 @@
|
|
|
86
86
|
"vite": "6.0.5",
|
|
87
87
|
"zod": "^4.0.0",
|
|
88
88
|
"zustand": "5.0.2",
|
|
89
|
-
"@json-to-office/core-docx": "^0.
|
|
89
|
+
"@json-to-office/core-docx": "^0.5.0",
|
|
90
90
|
"@json-to-office/core-pptx": "^0.3.0",
|
|
91
|
-
"@json-to-office/shared-docx": "^0.3.0",
|
|
92
91
|
"@json-to-office/shared": "^0.2.0",
|
|
92
|
+
"@json-to-office/shared-docx": "^0.3.0",
|
|
93
93
|
"@json-to-office/shared-pptx": "^0.3.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": {
|