@keshavsoft/monaco-json-studio 0.0.0-stage → 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.
@@ -0,0 +1,242 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+ import { specToHtml } from '../specToHtml/index.js';
5
+
6
+ const __filename = fileURLToPath(import.meta.url);
7
+ const __dirname = path.dirname(__filename);
8
+ const assetsDir = path.resolve(__dirname, '..', '..', '..', 'assets');
9
+
10
+ function interpolateSpec({ inSpec, inVars }) {
11
+ const localSpec = inSpec;
12
+ const localVars = inVars;
13
+
14
+ if (typeof localSpec === 'string') {
15
+ let result = localSpec;
16
+ for (const [key, val] of Object.entries(localVars)) {
17
+ result = result.replaceAll(`{{${key}}}`, String(val));
18
+ }
19
+ return result;
20
+ }
21
+ if (Array.isArray(localSpec)) {
22
+ return localSpec.map((item) => interpolateSpec({ inSpec: item, inVars: localVars }));
23
+ }
24
+ if (localSpec !== null && typeof localSpec === 'object') {
25
+ const out = {};
26
+ for (const [k, v] of Object.entries(localSpec)) {
27
+ out[k] = interpolateSpec({ inSpec: v, inVars: localVars });
28
+ }
29
+ return out;
30
+ }
31
+ return localSpec;
32
+ }
33
+
34
+ /**
35
+ * Generates a clean, 100% physical Static Monaco Studio project folder.
36
+ *
37
+ * @param {Object} inArgs
38
+ * @param {number} [inArgs.inPanes=2] - Number of panes (1, 2, or 3)
39
+ * @param {string} inArgs.inTargetDir - Absolute or relative path to output directory
40
+ * @param {string} [inArgs.inTitle="Monaco Studio"] - Custom page title
41
+ * @returns {Object} Result summary { success: true, targetDir, panes }
42
+ */
43
+ const generateStudio = ({ inPanes = 2, inTargetDir, inTitle = "Monaco Studio" } = {}) => {
44
+ const localPanes = Math.max(1, Math.min(3, parseInt(inPanes, 10) || 2));
45
+ if (!inTargetDir) {
46
+ throw new Error("Missing required parameter: inTargetDir");
47
+ }
48
+ const localTargetDir = path.resolve(process.cwd(), inTargetDir);
49
+ const localTitle = inTitle;
50
+
51
+ const filesForPanes = ['instructions.json', 'data.json', 'columns.json'];
52
+
53
+ // 1. Prepare Target Directory Structure
54
+ fs.mkdirSync(path.join(localTargetDir, 'css'), { recursive: true });
55
+ fs.mkdirSync(path.join(localTargetDir, 'data'), { recursive: true });
56
+ fs.mkdirSync(path.join(localTargetDir, 'js'), { recursive: true });
57
+
58
+ // 2. Read Source Specs
59
+ const specsDir = path.join(assetsDir, 'specs');
60
+ const paneTemplate = JSON.parse(fs.readFileSync(path.join(specsDir, 'pane.spec.json'), 'utf-8'));
61
+ const footerSpec = JSON.parse(fs.readFileSync(path.join(specsDir, 'footer.spec.json'), 'utf-8'));
62
+
63
+ // 3. Compile Static Panes HTML
64
+ const paneHtmls = [];
65
+ for (let i = 0; i < localPanes; i++) {
66
+ const vars = {
67
+ paneId: `pane${i + 1}`,
68
+ badgeText: `Editor ${i + 1}`,
69
+ fileBtnId: `openFileBtn${i + 1}`,
70
+ fileInputId: `fileInput${i + 1}`,
71
+ fileNameId: `fileName${i + 1}`,
72
+ defaultFileName: filesForPanes[i] || `file${i + 1}.json`,
73
+ editorId: `editor${i + 1}`
74
+ };
75
+ const pSpec = interpolateSpec({ inSpec: paneTemplate, inVars: vars });
76
+ paneHtmls.push(specToHtml({ inSpec: pSpec, inIndent: 12 }));
77
+ }
78
+
79
+ // Static Header HTML
80
+ const headerHtml = ` <!-- Top Bar Header Section -->
81
+ <header class="studio-header">
82
+ <div class="header-left">
83
+ <a href="#" class="brand-link" title="${localTitle}">
84
+ <i class="bi bi-cpu-fill brand-icon"></i>
85
+ <span>${localTitle}</span>
86
+ <span class="version-pill">v1</span>
87
+ </a>
88
+ </div>
89
+ <div class="header-right">
90
+ <span id="statusPill" class="status-pill success hidden">
91
+ <i class="bi bi-check2"></i> <span id="statusText">Loaded ✓</span>
92
+ </span>
93
+ <div class="header-divider"></div>
94
+ <span class="pane-file-pill">
95
+ <i class="bi bi-layout-split"></i>
96
+ <span>${localPanes} Pane${localPanes > 1 ? 's' : ''} Static Layout</span>
97
+ </span>
98
+ </div>
99
+ </header>`;
100
+
101
+ const workspaceHtml = ` <!-- Main Workspace Section: ${localPanes} Static Panes -->
102
+ <main class="studio-workspace" data-panes="${localPanes}">
103
+ ${paneHtmls.join('\n\n')}
104
+ </main>`;
105
+
106
+ // Static Footer HTML
107
+ if (footerSpec.children?.[0]?.children?.[2]) {
108
+ footerSpec.children[0].children[2].textContent = `${localPanes} Pane${localPanes > 1 ? 's' : ''} Active`;
109
+ }
110
+ const footerHtml = specToHtml({ inSpec: footerSpec, inIndent: 8 });
111
+
112
+ // 4. Assemble Full Physical index.html
113
+ const fullHtml = `<!DOCTYPE html>
114
+ <html lang="en">
115
+
116
+ <head>
117
+ <meta charset="utf-8">
118
+ <meta name="viewport" content="width=device-width, initial-scale=1">
119
+ <title>${localTitle} (${localPanes} Pane Static Project) | KeshavSoft</title>
120
+
121
+ <!-- Auto-normalize trailing slash so relative paths ./css and ./js always resolve correctly -->
122
+ <script>
123
+ if (!location.pathname.endsWith('/') && !location.pathname.endsWith('.html')) {
124
+ location.replace(location.pathname + '/' + location.search + location.hash);
125
+ }
126
+ </script>
127
+
128
+ <!-- Bootstrap Icons -->
129
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
130
+
131
+ <!-- Monaco Editor Stylesheet -->
132
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.2/min/vs/editor/editor.main.min.css">
133
+
134
+ <!-- Modular Control-Scoped CSS -->
135
+ <link rel="stylesheet" href="./css/base.css">
136
+ <link rel="stylesheet" href="./css/header.css">
137
+ <link rel="stylesheet" href="./css/workspace.css">
138
+ <link rel="stylesheet" href="./css/footer.css">
139
+ </head>
140
+
141
+ <body>
142
+ <div class="studio-app">
143
+ ${headerHtml}
144
+
145
+ ${workspaceHtml}
146
+
147
+ ${footerHtml}
148
+ </div>
149
+
150
+ <!-- Monaco AMD Loader -->
151
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.2/min/vs/loader.min.js"></script>
152
+
153
+ <!-- Functional Controller -->
154
+ <script type="module" src="./js/index.js"></script>
155
+ </body>
156
+
157
+ </html>
158
+ `;
159
+
160
+ fs.writeFileSync(path.join(localTargetDir, 'index.html'), fullHtml, 'utf-8');
161
+
162
+ // 5. Copy Modular CSS
163
+ const cssSourceDir = path.join(assetsDir, 'css');
164
+ const cssFiles = ['base.css', 'header.css', 'workspace.css', 'footer.css'];
165
+ for (const f of cssFiles) {
166
+ const src = path.join(cssSourceDir, f);
167
+ if (fs.existsSync(src)) {
168
+ fs.copyFileSync(src, path.join(localTargetDir, 'css', f));
169
+ }
170
+ }
171
+
172
+ // 6. Copy Data Files
173
+ const dataSourceDir = path.join(assetsDir, 'data');
174
+ for (let i = 0; i < localPanes; i++) {
175
+ const f = filesForPanes[i];
176
+ const src = path.join(dataSourceDir, f);
177
+ if (fs.existsSync(src)) {
178
+ fs.copyFileSync(src, path.join(localTargetDir, 'data', f));
179
+ }
180
+ }
181
+
182
+ // 7. Generate Static JS Files
183
+ const templatesDir = path.join(assetsDir, 'templates');
184
+ fs.copyFileSync(path.join(templatesDir, 'index.js'), path.join(localTargetDir, 'js', 'index.js'));
185
+
186
+ const stateContent = `export const $ = (id) => document.getElementById(id);
187
+
188
+ export const state = {
189
+ paneCount: ${localPanes},
190
+ editors: [],
191
+ fileNames: ${JSON.stringify(filesForPanes.slice(0, localPanes))},
192
+ contents: []
193
+ };
194
+
195
+ export const pretty = (v) => {
196
+ if (typeof v === 'string') {
197
+ try {
198
+ return JSON.stringify(JSON.parse(v), null, 2);
199
+ } catch {
200
+ return v;
201
+ }
202
+ }
203
+ return JSON.stringify(v, null, 2);
204
+ };
205
+
206
+ export async function loadInitialData(filename) {
207
+ try {
208
+ const res = await fetch(\`./data/\${filename}\`);
209
+ if (!res.ok) throw new Error(\`HTTP \${res.status}\`);
210
+ const data = await res.json();
211
+ return pretty(data);
212
+ } catch (err) {
213
+ console.warn('Fallback loading', filename, err);
214
+ return pretty({ "status": "ready", "file": filename });
215
+ }
216
+ }
217
+
218
+ export function setStatus(text) {
219
+ const pill = $('statusPill');
220
+ const textEl = $('statusText');
221
+ if (!pill || !textEl) return;
222
+
223
+ textEl.textContent = text;
224
+ pill.classList.remove('hidden');
225
+
226
+ clearTimeout(setStatus._timer);
227
+ setStatus._timer = setTimeout(() => {
228
+ pill.classList.add('hidden');
229
+ }, 3000);
230
+ }
231
+ `;
232
+ fs.writeFileSync(path.join(localTargetDir, 'js', 'state.js'), stateContent, 'utf-8');
233
+
234
+ return {
235
+ success: true,
236
+ targetDir: localTargetDir,
237
+ panes: localPanes
238
+ };
239
+ };
240
+
241
+ export { generateStudio };
242
+ export default generateStudio;
@@ -0,0 +1,15 @@
1
+ import { generateStudio } from './generateStudio/index.js';
2
+ import { specToHtml } from './specToHtml/index.js';
3
+ import { assembleSpec } from './assembleSpec/index.js';
4
+
5
+ export {
6
+ generateStudio,
7
+ specToHtml,
8
+ assembleSpec
9
+ };
10
+
11
+ export default {
12
+ generateStudio,
13
+ specToHtml,
14
+ assembleSpec
15
+ };
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Compiles a KeshavSoft JSON specification object into indented, valid static HTML.
3
+ * Strict parameter convention: inArgs object with 'in'-prefix and 'local'-prefixed internal variables.
4
+ *
5
+ * @param {Object} inArgs
6
+ * @param {Object} inArgs.inSpec - The JSON specification node
7
+ * @param {number} [inArgs.inIndent=0] - Leading space indentation
8
+ * @returns {string} Formatted HTML string
9
+ */
10
+ const specToHtml = ({ inSpec, inIndent = 0 } = {}) => {
11
+ const localSpec = inSpec;
12
+ const localIndent = inIndent;
13
+
14
+ if (localSpec === null || localSpec === undefined) return '';
15
+ if (typeof localSpec === 'string' || typeof localSpec === 'number') {
16
+ return ' '.repeat(localIndent) + String(localSpec);
17
+ }
18
+
19
+ const spaces = ' '.repeat(localIndent);
20
+ const tagName = localSpec.tagName || 'div';
21
+
22
+ let attrStr = '';
23
+ if (localSpec.attributes && typeof localSpec.attributes === 'object') {
24
+ for (const [k, v] of Object.entries(localSpec.attributes)) {
25
+ attrStr += ` ${k}="${String(v).replace(/"/g, '&quot;')}"`;
26
+ }
27
+ }
28
+
29
+ const voidElements = new Set(['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr']);
30
+ if (voidElements.has(tagName.toLowerCase())) {
31
+ return `${spaces}<${tagName}${attrStr}>`;
32
+ }
33
+
34
+ if (localSpec.textContent !== undefined && localSpec.textContent !== null && (!localSpec.children || localSpec.children.length === 0)) {
35
+ return `${spaces}<${tagName}${attrStr}>${localSpec.textContent}</${tagName}>`;
36
+ }
37
+
38
+ if (Array.isArray(localSpec.children) && localSpec.children.length > 0) {
39
+ const childHtmls = localSpec.children.map(child => {
40
+ if (typeof child === 'string') {
41
+ return `${spaces} ${child}`;
42
+ }
43
+ return specToHtml({ inSpec: child, inIndent: localIndent + 4 });
44
+ }).join('\n');
45
+ return `${spaces}<${tagName}${attrStr}>\n${childHtmls}\n${spaces}</${tagName}>`;
46
+ }
47
+
48
+ return `${spaces}<${tagName}${attrStr}></${tagName}>`;
49
+ };
50
+
51
+ export { specToHtml };
52
+ export default specToHtml;
@@ -0,0 +1,99 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import { fileURLToPath } from 'url';
4
+
5
+ const __filename = fileURLToPath(import.meta.url);
6
+ const __dirname = path.dirname(__filename);
7
+ const assetsDir = path.resolve(__dirname, '..', '..', '..', 'assets');
8
+
9
+ function interpolateSpec({ inSpec, inVars }) {
10
+ const localSpec = inSpec;
11
+ const localVars = inVars;
12
+
13
+ if (typeof localSpec === 'string') {
14
+ let result = localSpec;
15
+ for (const [key, val] of Object.entries(localVars)) {
16
+ result = result.replaceAll(`{{${key}}}`, String(val));
17
+ }
18
+ return result;
19
+ }
20
+ if (Array.isArray(localSpec)) {
21
+ return localSpec.map((item) => interpolateSpec({ inSpec: item, inVars: localVars }));
22
+ }
23
+ if (localSpec !== null && typeof localSpec === 'object') {
24
+ const out = {};
25
+ for (const [k, v] of Object.entries(localSpec)) {
26
+ out[k] = interpolateSpec({ inSpec: v, inVars: localVars });
27
+ }
28
+ return out;
29
+ }
30
+ return localSpec;
31
+ }
32
+
33
+ /**
34
+ * assembleSpec (v2) - Composes atomic JSON component specs into a complete studio specification tree.
35
+ * Completely self-contained: zero cross-version dependencies.
36
+ *
37
+ * @param {Object} inArgs
38
+ * @param {number} [inArgs.inPanes=2] - Number of panes (1, 2, or 3)
39
+ * @param {Array<string>} [inArgs.inFiles] - Optional custom file names for each pane
40
+ * @param {string} [inArgs.inTitle="Monaco Studio"] - Studio header title
41
+ * @returns {Object} Complete assembled specification tree
42
+ */
43
+ const assembleSpec = ({ inPanes = 2, inFiles, inTitle = "Monaco Studio" } = {}) => {
44
+ const localPanes = Math.max(1, Math.min(3, parseInt(inPanes, 10) || 2));
45
+ const defaultFiles = ['instructions.json', 'data.json', 'columns.json'];
46
+ const localFiles = inFiles || defaultFiles.slice(0, localPanes);
47
+ const localTitle = inTitle;
48
+
49
+ const specsDir = path.join(assetsDir, 'specs');
50
+ const headerSpec = JSON.parse(fs.readFileSync(path.join(specsDir, 'header.spec.json'), 'utf-8'));
51
+ const paneTemplate = JSON.parse(fs.readFileSync(path.join(specsDir, 'pane.spec.json'), 'utf-8'));
52
+ const footerSpec = JSON.parse(fs.readFileSync(path.join(specsDir, 'footer.spec.json'), 'utf-8'));
53
+
54
+ // Inject custom title if header has brand label
55
+ if (headerSpec.children?.[0]?.children?.[0]?.children?.[1]) {
56
+ headerSpec.children[0].children[0].children[1].textContent = localTitle;
57
+ }
58
+
59
+ const assembledPanes = [];
60
+ for (let i = 0; i < localPanes; i++) {
61
+ const vars = {
62
+ paneId: `pane${i + 1}`,
63
+ badgeText: `Editor ${i + 1}`,
64
+ fileBtnId: `openFileBtn${i + 1}`,
65
+ fileInputId: `fileInput${i + 1}`,
66
+ fileNameId: `fileName${i + 1}`,
67
+ defaultFileName: localFiles[i] || `file${i + 1}.json`,
68
+ editorId: `editor${i + 1}`
69
+ };
70
+ assembledPanes.push(interpolateSpec({ inSpec: paneTemplate, inVars: vars }));
71
+ }
72
+
73
+ // Update footer layout label
74
+ if (footerSpec.children?.[0]?.children?.[2]) {
75
+ footerSpec.children[0].children[2].textContent = `${localPanes} Pane${localPanes > 1 ? 's' : ''} Active`;
76
+ }
77
+
78
+ return {
79
+ tagName: 'div',
80
+ attributes: {
81
+ class: 'studio-app'
82
+ },
83
+ children: [
84
+ headerSpec,
85
+ {
86
+ tagName: 'main',
87
+ attributes: {
88
+ class: 'studio-workspace',
89
+ 'data-panes': String(localPanes)
90
+ },
91
+ children: assembledPanes
92
+ },
93
+ footerSpec
94
+ ]
95
+ };
96
+ };
97
+
98
+ export { assembleSpec };
99
+ export default assembleSpec;
@@ -0,0 +1,161 @@
1
+ /**
2
+ * buildHtml (v2) - The Story of Building the Monaco Studio HTML Document.
3
+ *
4
+ * All HTML for the studio is generated from this ONE SINGLE PLACE.
5
+ *
6
+ * Narrative Flow:
7
+ * - Chapter 1: Document Head & Metadata (Icons, Monaco stylesheet, Modular CSS links)
8
+ * - Chapter 2: Studio Topbar Header (Brand, Version badge, Layout pill)
9
+ * - Chapter 3: Studio Workspace & Panes (1, 2, or 3 static editor panes)
10
+ * - Chapter 4: Studio Status Footer (Status brand, Active panes count, Cursor position)
11
+ * - Chapter 5: Script Injections (Monaco AMD loader & ES module controller)
12
+ *
13
+ * @param {Object} inArgs
14
+ * @param {number} [inArgs.inPanes=2] - Number of editor panes (1, 2, or 3)
15
+ * @param {string} [inArgs.inTitle="Monaco Studio"] - Studio branding title
16
+ * @param {Array<string>} [inArgs.inFiles] - Default file names for each pane
17
+ * @returns {string} The complete, self-contained, 100% static HTML document
18
+ */
19
+ const buildHtml = ({ inPanes = 2, inTitle = "Monaco Studio", inFiles } = {}) => {
20
+ const localPanes = Math.max(1, Math.min(3, parseInt(inPanes, 10) || 2));
21
+ const localTitle = inTitle;
22
+ const defaultFiles = ['instructions.json', 'data.json', 'columns.json'];
23
+ const localFiles = inFiles || defaultFiles.slice(0, localPanes);
24
+
25
+ // -------------------------------------------------------------------------
26
+ // Chapter 1: Document Head & Metadata
27
+ // -------------------------------------------------------------------------
28
+ const headSection = ` <meta charset="utf-8">
29
+ <meta name="viewport" content="width=device-width, initial-scale=1">
30
+ <title>${localTitle} (${localPanes} Pane Static Project) | KeshavSoft</title>
31
+
32
+ <!-- Auto-normalize trailing slash so relative paths ./css and ./js always resolve correctly -->
33
+ <script>
34
+ if (!location.pathname.endsWith('/') && !location.pathname.endsWith('.html')) {
35
+ location.replace(location.pathname + '/' + location.search + location.hash);
36
+ }
37
+ </script>
38
+
39
+ <!-- Bootstrap Icons -->
40
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
41
+
42
+ <!-- Monaco Editor Stylesheet -->
43
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.2/min/vs/editor/editor.main.min.css">
44
+
45
+ <!-- Modular Control-Scoped CSS -->
46
+ <link rel="stylesheet" href="./css/base.css">
47
+ <link rel="stylesheet" href="./css/header.css">
48
+ <link rel="stylesheet" href="./css/workspace.css">
49
+ <link rel="stylesheet" href="./css/footer.css">`;
50
+
51
+ // -------------------------------------------------------------------------
52
+ // Chapter 2: Studio Topbar Header
53
+ // -------------------------------------------------------------------------
54
+ const headerSection = ` <!-- Top Bar Header Section -->
55
+ <header class="studio-header">
56
+ <div class="header-left">
57
+ <a href="#" class="brand-link" title="${localTitle}">
58
+ <i class="bi bi-cpu-fill brand-icon"></i>
59
+ <span>${localTitle}</span>
60
+ <span class="version-pill">v2</span>
61
+ </a>
62
+ </div>
63
+ <div class="header-right">
64
+ <span id="statusPill" class="status-pill success hidden">
65
+ <i class="bi bi-check2"></i> <span id="statusText">Loaded ✓</span>
66
+ </span>
67
+ <div class="header-divider"></div>
68
+ <span class="pane-file-pill">
69
+ <i class="bi bi-layout-split"></i>
70
+ <span>${localPanes} Pane${localPanes > 1 ? 's' : ''} Static Layout</span>
71
+ </span>
72
+ </div>
73
+ </header>`;
74
+
75
+ // -------------------------------------------------------------------------
76
+ // Chapter 3: Studio Workspace & Panes
77
+ // -------------------------------------------------------------------------
78
+ const paneElements = [];
79
+ for (let i = 0; i < localPanes; i++) {
80
+ const num = i + 1;
81
+ const fileName = localFiles[i] || `file${num}.json`;
82
+ const paneHtml = ` <!-- Pane ${num}: Editor ${num} (${fileName}) -->
83
+ <section class="studio-pane" id="pane${num}">
84
+ <div class="pane-header">
85
+ <div class="pane-header-left">
86
+ <span class="pane-badge">Editor ${num}</span>
87
+ <button id="openFileBtn${num}" type="button" class="btn-pane-file" title="Open JSON file for Editor ${num}">
88
+ <i class="bi bi-folder2-open"></i>
89
+ <span>Select File</span>
90
+ </button>
91
+ <input type="file" id="fileInput${num}" style="display: none;" accept=".json,.js,.txt,application/json">
92
+ </div>
93
+ <div class="pane-header-right">
94
+ <span class="pane-file-pill">
95
+ <i class="bi bi-filetype-json"></i>
96
+ <span id="fileName${num}" class="pane-file-name">${fileName}</span>
97
+ </span>
98
+ </div>
99
+ </div>
100
+ <div id="editor${num}" class="editor-pane-body"></div>
101
+ </section>`;
102
+ paneElements.push(paneHtml);
103
+ }
104
+
105
+ const workspaceSection = ` <!-- Main Workspace Section: ${localPanes} Static Panes -->
106
+ <main class="studio-workspace" data-panes="${localPanes}">
107
+ ${paneElements.join('\n\n')}
108
+ </main>`;
109
+
110
+ // -------------------------------------------------------------------------
111
+ // Chapter 4: Studio Status Footer
112
+ // -------------------------------------------------------------------------
113
+ const footerSection = ` <!-- Footer Status Section -->
114
+ <footer class="studio-footer">
115
+ <div class="footer-left">
116
+ <span class="footer-brand">
117
+ <i class="bi bi-braces-asterisk"></i>
118
+ <span>JSON-Driven Monaco Studio</span>
119
+ </span>
120
+ <span>|</span>
121
+ <span id="layoutMeta">${localPanes} Pane${localPanes > 1 ? 's' : ''} Active</span>
122
+ </div>
123
+ <div class="footer-right">
124
+ <span id="cursorPos">Ln 1, Col 1</span>
125
+ </div>
126
+ </footer>`;
127
+
128
+ // -------------------------------------------------------------------------
129
+ // Chapter 5: Script Injections & Document Assembly
130
+ // -------------------------------------------------------------------------
131
+ const fullHtml = `<!DOCTYPE html>
132
+ <html lang="en">
133
+
134
+ <head>
135
+ ${headSection}
136
+ </head>
137
+
138
+ <body>
139
+ <div class="studio-app">
140
+ ${headerSection}
141
+
142
+ ${workspaceSection}
143
+
144
+ ${footerSection}
145
+ </div>
146
+
147
+ <!-- Monaco AMD Loader -->
148
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/monaco-editor/0.52.2/min/vs/loader.min.js"></script>
149
+
150
+ <!-- Functional Controller -->
151
+ <script type="module" src="./js/index.js"></script>
152
+ </body>
153
+
154
+ </html>
155
+ `;
156
+
157
+ return fullHtml;
158
+ };
159
+
160
+ export { buildHtml };
161
+ export default buildHtml;