@json-to-office/jto 0.4.1 → 0.5.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.
Files changed (38) hide show
  1. package/dist/cli.js +30 -35
  2. package/dist/cli.js.map +1 -1
  3. package/dist/client/assets/HomePage-DDMC2eP4.js +99 -0
  4. package/dist/client/assets/HomePage-DDMC2eP4.js.map +1 -0
  5. package/dist/client/assets/{JsonEditorPage-uVaNPE8q.js → JsonEditorPage-Bi3qzsic.js} +3 -3
  6. package/dist/client/assets/{JsonEditorPage-uVaNPE8q.js.map → JsonEditorPage-Bi3qzsic.js.map} +1 -1
  7. package/dist/client/assets/{MonacoPluginProvider-BTaxJhgr.js → MonacoPluginProvider-BuruiMGP.js} +3 -3
  8. package/dist/client/assets/{MonacoPluginProvider-BTaxJhgr.js.map → MonacoPluginProvider-BuruiMGP.js.map} +1 -1
  9. package/dist/client/assets/{button-C9-hWwtZ.js → button-cJfzi3Hb.js} +2 -2
  10. package/dist/client/assets/{button-C9-hWwtZ.js.map → button-cJfzi3Hb.js.map} +1 -1
  11. package/dist/client/assets/{editor-WAlwAQUI.js → editor-BRFvu4pL.js} +2 -2
  12. package/dist/client/assets/{editor-WAlwAQUI.js.map → editor-BRFvu4pL.js.map} +1 -1
  13. package/dist/client/assets/{editor-monaco-json-BLhhoYVD.js → editor-monaco-json-CVcLmruk.js} +2 -2
  14. package/dist/client/assets/{editor-monaco-json-BLhhoYVD.js.map → editor-monaco-json-CVcLmruk.js.map} +1 -1
  15. package/dist/client/assets/index-CcNw6Q2b.css +1 -0
  16. package/dist/client/assets/{index-Bu7pVmbf.js → index-DnOFpa21.js} +3 -3
  17. package/dist/client/assets/{index-Bu7pVmbf.js.map → index-DnOFpa21.js.map} +1 -1
  18. package/dist/client/assets/{preview-Dpw5ePME.js → preview-CCFdky9H.js} +2 -2
  19. package/dist/client/assets/{preview-Dpw5ePME.js.map → preview-CCFdky9H.js.map} +1 -1
  20. package/dist/client/index.html +2 -2
  21. package/dist/client/templates/Lumina Analytics.pptx.json +1913 -0
  22. package/dist/client/templates/themes/lumina.pptx.theme.json +42 -0
  23. package/dist/client/templates/themes/meridian.pptx.theme.json +42 -0
  24. package/dist/index.js +3 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/prompts/instructions-edit-document-pptx-slides.md +23 -2
  27. package/dist/prompts/instructions-edit-document-pptx-templates.md +16 -1
  28. package/dist/prompts/instructions-edit-document-pptx.md +59 -5
  29. package/dist/prompts/instructions-generate-pptx.md +3 -1
  30. package/package.json +4 -4
  31. package/dist/client/assets/HomePage-DoPLARHL.js +0 -99
  32. package/dist/client/assets/HomePage-DoPLARHL.js.map +0 -1
  33. package/dist/client/assets/index-Cph82KFG.css +0 -1
  34. package/dist/client/templates/Charts Demo.pptx.json +0 -174
  35. package/dist/client/templates/Company Branding.pptx.json +0 -143
  36. package/dist/client/templates/Dashboard.pptx.json +0 -91
  37. package/dist/client/templates/Product Launch.pptx.json +0 -87
  38. package/dist/client/templates/Sales Deck.pptx.json +0 -80
package/dist/cli.js CHANGED
@@ -3096,7 +3096,9 @@ function createAPIApp(adapter) {
3096
3096
  const legacyPath = adapter.name === "docx" ? "/api/documents" : "/api/presentations";
3097
3097
  honoApp.route(legacyPath, formatRouter);
3098
3098
  honoApp.route("/api/discovery", discoveryRouter);
3099
- honoApp.route("/api/ai", createAiRouter());
3099
+ if (process.env.AI_ENABLED !== "false") {
3100
+ honoApp.route("/api/ai", createAiRouter());
3101
+ }
3100
3102
  honoApp.get("/", async (c) => {
3101
3103
  const apiInfo = await getApiInfo();
3102
3104
  return c.json(apiInfo);
@@ -3232,13 +3234,17 @@ var init_unified_server = __esm({
3232
3234
  const envClientPath = process.env.JTO_CLIENT_PATH;
3233
3235
  if (existsSync7(envClientPath) && existsSync7(resolve15(envClientPath, "index.html"))) {
3234
3236
  clientPath = envClientPath;
3235
- logger.debug("[Dev Server] Using client from JTO_CLIENT_PATH", { path: clientPath });
3237
+ logger.debug("[Dev Server] Using client from JTO_CLIENT_PATH", {
3238
+ path: clientPath
3239
+ });
3236
3240
  }
3237
3241
  } else if (isBundled) {
3238
3242
  const bundledClientPath = resolve15(__dirname3, "client");
3239
3243
  if (existsSync7(bundledClientPath) && existsSync7(resolve15(bundledClientPath, "index.html"))) {
3240
3244
  clientPath = bundledClientPath;
3241
- logger.debug("[Dev Server] Using bundled client at", { path: clientPath });
3245
+ logger.debug("[Dev Server] Using bundled client at", {
3246
+ path: clientPath
3247
+ });
3242
3248
  }
3243
3249
  } else {
3244
3250
  const possiblePaths = [
@@ -3248,7 +3254,9 @@ var init_unified_server = __esm({
3248
3254
  for (const p of possiblePaths) {
3249
3255
  if (existsSync7(p)) {
3250
3256
  if (p.replace(/\\/g, "/").includes("/src/client")) {
3251
- logger.debug("[Dev Server] Using Vite dev server for", { path: p });
3257
+ logger.debug("[Dev Server] Using Vite dev server for", {
3258
+ path: p
3259
+ });
3252
3260
  try {
3253
3261
  const { createServer: createViteServer } = await import("vite");
3254
3262
  this.viteServer = await createViteServer({
@@ -3265,7 +3273,9 @@ var init_unified_server = __esm({
3265
3273
  break;
3266
3274
  } else if (existsSync7(resolve15(p, "index.html"))) {
3267
3275
  clientPath = p;
3268
- logger.debug("[Dev Server] Using pre-built client at", { path: clientPath });
3276
+ logger.debug("[Dev Server] Using pre-built client at", {
3277
+ path: clientPath
3278
+ });
3269
3279
  break;
3270
3280
  }
3271
3281
  }
@@ -3316,10 +3326,13 @@ var init_unified_server = __esm({
3316
3326
  const { extname: extname2 } = await import("path");
3317
3327
  const mime = await import("mime-types");
3318
3328
  const format = this.adapter.name.replace(/[^a-zA-Z0-9]/g, "");
3319
- this.app.use("/assets/*", serveStatic({
3320
- root: clientPath,
3321
- rewriteRequestPath: (path14) => path14.replace(/^\/assets/, "/assets")
3322
- }));
3329
+ this.app.use(
3330
+ "/assets/*",
3331
+ serveStatic({
3332
+ root: clientPath,
3333
+ rewriteRequestPath: (path14) => path14.replace(/^\/assets/, "/assets")
3334
+ })
3335
+ );
3323
3336
  this.app.use("/*", async (c, next) => {
3324
3337
  const reqPath = c.req.path;
3325
3338
  if (reqPath.startsWith("/api") || reqPath === "/health") return next();
@@ -3337,7 +3350,8 @@ var init_unified_server = __esm({
3337
3350
  });
3338
3351
  this.app.get("*", async (c) => {
3339
3352
  const reqPath = c.req.path;
3340
- if (reqPath.startsWith("/api") || reqPath === "/health") return c.notFound();
3353
+ if (reqPath.startsWith("/api") || reqPath === "/health")
3354
+ return c.notFound();
3341
3355
  const indexPath = resolve15(clientPath, "index.html");
3342
3356
  if (fs11.existsSync(indexPath)) {
3343
3357
  let html = fs11.readFileSync(indexPath, "utf-8");
@@ -3352,30 +3366,8 @@ var init_unified_server = __esm({
3352
3366
  });
3353
3367
  }
3354
3368
  async setupProdClient() {
3355
- const { serveStatic } = await import("@hono/node-server/serve-static");
3356
- const format = this.adapter.name.replace(/[^a-zA-Z0-9]/g, "");
3357
- this.app.use("/*", async (c, next) => {
3358
- const path14 = c.req.path;
3359
- if (path14.startsWith("/api") || path14 === "/health") return next();
3360
- return serveStatic({ root: "./dist/client" })(c, next);
3361
- });
3362
- this.app.get("*", (c) => {
3363
- const path14 = c.req.path;
3364
- if (path14.startsWith("/api") || path14 === "/health") return c.notFound();
3365
- return c.html(`<!DOCTYPE html>
3366
- <html>
3367
- <head>
3368
- <meta charset="UTF-8">
3369
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
3370
- <title>JSON to Office</title>
3371
- <script>window.__JTO_FORMAT__ = '${format}';</script>
3372
- <script>window.location.href = '/';</script>
3373
- </head>
3374
- <body>
3375
- <noscript>You need to enable JavaScript to run this app.</noscript>
3376
- </body>
3377
- </html>`);
3378
- });
3369
+ const clientPath = resolve15(__dirname3, "client");
3370
+ return this.setupBuiltClient(clientPath);
3379
3371
  }
3380
3372
  async start() {
3381
3373
  await this.initialize();
@@ -5748,6 +5740,9 @@ async function loadConfig(configPath) {
5748
5740
  }
5749
5741
  }
5750
5742
  const config2 = deepMerge(defaultConfig, userConfig);
5743
+ if (process.env.NODE_ENV === "production") {
5744
+ config2.mode = "production";
5745
+ }
5751
5746
  if (!Value.Check(ConfigSchema, config2)) {
5752
5747
  const errors = [...Value.Errors(ConfigSchema, config2)];
5753
5748
  console.warn("Warning: Invalid configuration detected:", errors);
@@ -5859,7 +5854,7 @@ ${chalk8.cyan("Health:")} ${url}/health
5859
5854
  }
5860
5855
 
5861
5856
  // src/cli.ts
5862
- var PACKAGE_VERSION = true ? "0.4.1" : "dev-mode";
5857
+ var PACKAGE_VERSION = true ? "0.5.1" : "dev-mode";
5863
5858
  function registerFormatCommands(parent, adapter) {
5864
5859
  parent.addCommand(createGenerateCommand(adapter));
5865
5860
  parent.addCommand(createValidateCommand(adapter));