@diagrammo/dgmo 0.8.12 → 0.8.13

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 (45) hide show
  1. package/dist/cli.cjs +115 -719
  2. package/dist/index.cjs +11 -5
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.js +9 -6
  5. package/dist/index.js.map +1 -1
  6. package/docs/guide/chart-arc.md +71 -0
  7. package/docs/guide/chart-area.md +73 -0
  8. package/docs/guide/chart-bar-stacked.md +61 -0
  9. package/docs/guide/chart-bar.md +62 -0
  10. package/docs/guide/chart-boxes-and-lines.md +243 -0
  11. package/docs/guide/chart-c4.md +300 -0
  12. package/docs/guide/chart-chord.md +43 -0
  13. package/docs/guide/chart-class.md +204 -0
  14. package/docs/guide/chart-doughnut.md +38 -0
  15. package/docs/guide/chart-er.md +218 -0
  16. package/docs/guide/chart-flowchart.md +102 -0
  17. package/docs/guide/chart-function.md +56 -0
  18. package/docs/guide/chart-funnel.md +38 -0
  19. package/docs/guide/chart-gantt.md +368 -0
  20. package/docs/guide/chart-heatmap.md +41 -0
  21. package/docs/guide/chart-infra.md +694 -0
  22. package/docs/guide/chart-kanban.md +156 -0
  23. package/docs/guide/chart-line.md +79 -0
  24. package/docs/guide/chart-multi-line.md +84 -0
  25. package/docs/guide/chart-org.md +209 -0
  26. package/docs/guide/chart-pie.md +39 -0
  27. package/docs/guide/chart-polar-area.md +38 -0
  28. package/docs/guide/chart-quadrant.md +69 -0
  29. package/docs/guide/chart-radar.md +38 -0
  30. package/docs/guide/chart-sankey.md +103 -0
  31. package/docs/guide/chart-scatter.md +94 -0
  32. package/docs/guide/chart-sequence.md +332 -0
  33. package/docs/guide/chart-sitemap.md +248 -0
  34. package/docs/guide/chart-slope.md +56 -0
  35. package/docs/guide/chart-state.md +171 -0
  36. package/docs/guide/chart-timeline.md +229 -0
  37. package/docs/guide/chart-venn.md +81 -0
  38. package/docs/guide/chart-wordcloud.md +66 -0
  39. package/docs/guide/colors.md +283 -0
  40. package/docs/guide/index.md +55 -0
  41. package/docs/guide/keyboard-shortcuts.md +49 -0
  42. package/docs/guide/registry.json +51 -0
  43. package/gallery/fixtures/boxes-and-lines.dgmo +4 -6
  44. package/package.json +1 -1
  45. package/src/sharing.ts +3 -4
package/dist/index.cjs CHANGED
@@ -31429,15 +31429,20 @@ init_colors();
31429
31429
  init_palettes();
31430
31430
 
31431
31431
  // src/sharing.ts
31432
- var import_lz_string = require("lz-string");
31432
+ var import_lz_string = __toESM(require("lz-string"), 1);
31433
+ var { compressToEncodedURIComponent, decompressFromEncodedURIComponent } = import_lz_string.default;
31433
31434
  var DEFAULT_BASE_URL = "https://online.diagrammo.app";
31434
31435
  var COMPRESSED_SIZE_LIMIT = 8192;
31435
31436
  function encodeDiagramUrl(dsl, options) {
31436
31437
  const baseUrl = options?.baseUrl ?? DEFAULT_BASE_URL;
31437
- const compressed = (0, import_lz_string.compressToEncodedURIComponent)(dsl);
31438
+ const compressed = compressToEncodedURIComponent(dsl);
31438
31439
  const byteSize = new TextEncoder().encode(compressed).byteLength;
31439
31440
  if (byteSize > COMPRESSED_SIZE_LIMIT) {
31440
- return { error: "too-large", compressedSize: byteSize, limit: COMPRESSED_SIZE_LIMIT };
31441
+ return {
31442
+ error: "too-large",
31443
+ compressedSize: byteSize,
31444
+ limit: COMPRESSED_SIZE_LIMIT
31445
+ };
31441
31446
  }
31442
31447
  let hash = `dgmo=${compressed}`;
31443
31448
  if (options?.viewState?.activeTagGroup) {
@@ -31488,14 +31493,15 @@ function decodeDiagramUrl(hash) {
31488
31493
  viewState.collapsedLanes = val.split(",").filter(Boolean);
31489
31494
  }
31490
31495
  if (key === "pal" && val) viewState.palette = val;
31491
- if (key === "th" && (val === "light" || val === "dark")) viewState.theme = val;
31496
+ if (key === "th" && (val === "light" || val === "dark"))
31497
+ viewState.theme = val;
31492
31498
  }
31493
31499
  if (payload.startsWith("dgmo=")) {
31494
31500
  payload = payload.slice(5);
31495
31501
  }
31496
31502
  if (!payload) return { dsl: "", viewState };
31497
31503
  try {
31498
- const result = (0, import_lz_string.decompressFromEncodedURIComponent)(payload);
31504
+ const result = decompressFromEncodedURIComponent(payload);
31499
31505
  return { dsl: result ?? "", viewState };
31500
31506
  } catch {
31501
31507
  return { dsl: "", viewState };