@woosh/meep-engine 2.128.10 → 2.128.11

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/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "description": "Pure JavaScript game engine. Fully featured and production ready.",
6
6
  "type": "module",
7
7
  "author": "Alexander Goldring",
8
- "version": "2.128.10",
8
+ "version": "2.128.11",
9
9
  "main": "build/meep.module.js",
10
10
  "module": "build/meep.module.js",
11
11
  "exports": {
@@ -0,0 +1 @@
1
+ ## Utility Package for working with GraphViz format
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Escapes special characters in a string for use in a GraphViz label.
3
+ *
4
+ * This function handles the most common escaping requirements for standard
5
+ * string labels (i.e., label="..."). It ensures that literal backslashes,
6
+ * double quotes, and newlines in the input string are correctly represented
7
+ * in the final DOT language output.
8
+ *
9
+ * @param {string} input The raw string to be escaped.
10
+ * @returns {string} The escaped string, safe to be used within double quotes in a .dot file.
11
+ * @see https://graphviz.org/docs/attr-types/escString/
12
+ */
13
+ export function graphviz_escape_string(input: string): string;
14
+ //# sourceMappingURL=graphviz_escape_string.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"graphviz_escape_string.d.ts","sourceRoot":"","sources":["../../../../../../src/core/graph/format/graphviz/graphviz_escape_string.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AACH,8CAJW,MAAM,GACJ,MAAM,CAUlB"}
@@ -0,0 +1,22 @@
1
+ import { assert } from "../../../assert.js";
2
+
3
+ /**
4
+ * Escapes special characters in a string for use in a GraphViz label.
5
+ *
6
+ * This function handles the most common escaping requirements for standard
7
+ * string labels (i.e., label="..."). It ensures that literal backslashes,
8
+ * double quotes, and newlines in the input string are correctly represented
9
+ * in the final DOT language output.
10
+ *
11
+ * @param {string} input The raw string to be escaped.
12
+ * @returns {string} The escaped string, safe to be used within double quotes in a .dot file.
13
+ * @see https://graphviz.org/docs/attr-types/escString/
14
+ */
15
+ export function graphviz_escape_string(input) {
16
+ assert.isString(input, 'input');
17
+
18
+ return input
19
+ .replace(/\\/g, '\\\\') // 1. Escape backslashes first
20
+ .replace(/"/g, '\\"') // 2. Escape double quotes
21
+ .replace(/\n/g, '\\n'); // 3. Convert newlines to the \n sequence for centered lines
22
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;IA6BI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IArCD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,oBAEJ,MAAM,CAWlB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,wDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,eALW,MAAM,4BAGJ,iBAAiB,CA2B7B;IAED;;;;;;OAMG;IACH,iEAFa,OAAO,CAQnB;IAED,gBA6FC;IAED;;;OAGG;IACH,uCA2CC;IAED;;;;;;;OAOG;IACH;gBAFqB,EAAE;mBAAa,EAAE;MA2DrC;IAED;;;;;OAKG;IACH,eAFY,MAAM,CAgEjB;IAGL;;;OAGG;IACH,wBAFU,OAAO,CAEkB;CANlC;8BAtjB6B,oBAAoB;6BACrB,mBAAmB;kCAJd,wBAAwB"}
1
+ {"version":3,"file":"RenderGraph.d.ts","sourceRoot":"","sources":["../../../../../../src/engine/graphics/render/frame_graph/RenderGraph.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH;IA6BI;;;OAGG;IACH,mBAFW,MAAM,EAOhB;IArCD;;;;OAIG;IACH,MAFU,MAAM,CAEN;IAEV;;;;OAIG;IACH,qBAAkB;IAElB;;;;OAIG;IACH,yBAAsB;IAEtB;;;;OAIG;IACH,4BAAyB;IAazB;;;;OAIG;IACH,qBAHW,MAAM,sBAahB;IAED;;;;OAIG;IACH,oBAHW,MAAM,qBAmBhB;IAED;;;;OAIG;IACH,qBAHW,MAAM,KAKhB;IAED;;;;;OAKG;IACH,2BAJW,MAAM,oBAEJ,MAAM,CAWlB;IAED;;;;;OAKG;IACH,6BAYC;IAED;;;;;;OAMG;IACH,4BAeC;IAED;;;;OAIG;IACH,wBAHW,MAAM,GACJ,MAAM,CAkBlB;IAED;;;;;;OAMG;IACH,2BALW,MAAM,wDAGJ,MAAM,CAUlB;IAED;;;OAGG;IACH,4BAHa,OAAO,CAQnB;IAED;;;;;;;OAOG;IACH,eALW,MAAM,4BAGJ,iBAAiB,CA2B7B;IAED;;;;;;OAMG;IACH,iEAFa,OAAO,CAQnB;IAED,gBA6FC;IAED;;;OAGG;IACH,uCA2CC;IAED;;;;;;;OAOG;IACH;gBAFqB,EAAE;mBAAa,EAAE;MA2DrC;IAED;;;;;OAKG;IACH,eAFY,MAAM,CAmEjB;IAGL;;;OAGG;IACH,wBAFU,OAAO,CAEkB;CANlC;8BAzjB6B,oBAAoB;6BACrB,mBAAmB;kCAJd,wBAAwB"}
@@ -1,5 +1,6 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
  import LineBuilder from "../../../../core/codegen/LineBuilder.js";
3
+ import { graphviz_escape_string } from "../../../../core/graph/format/graphviz/graphviz_escape_string.js";
3
4
  import { RenderPassBuilder } from "./RenderPassBuilder.js";
4
5
  import { RenderPassNode } from "./RenderPassNode.js";
5
6
  import { RenderPassResources } from "./RenderPassResources.js";
@@ -529,7 +530,10 @@ export class RenderGraph {
529
530
  out.add("# Resource Nodes");
530
531
  for (const node of this.__resource_nodes) {
531
532
  const entry = this.__resource_registry[node.resource_id];
532
- out.add(`R${entry.resource_id}_${node.version} [label=<{ {<B>${node.name}</B>${node.version > 0 ? ` <FONT>v${node.version}</FONT>` : ""}<BR/>${entry.toString()}} | {Index: ${entry.resource_id}<BR/> Refs : ${node.ref_count} } }> style=filled, fillcolor=${entry.isImported() ? "lightsteelblue" : "skyblue"}]`);
533
+
534
+ const content = graphviz_escape_string(entry.toString());
535
+
536
+ out.add(`R${entry.resource_id}_${node.version} [label=<{ {<B>${node.name}</B>${node.version > 0 ? ` <FONT>v${node.version}</FONT>` : ""}<BR/>${content}} | {Index: ${entry.resource_id}<BR/> Refs : ${node.ref_count} } }> style=filled, fillcolor=${entry.isImported() ? "lightsteelblue" : "skyblue"}]`);
533
537
  }
534
538
 
535
539
  // -- Each pass node points to the resource that it writes