@java-memory-playground/java-memory-playground 0.2.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/LICENSE +21 -0
- package/README.md +345 -0
- package/dist/ArrayCreationDialog.d.ts +8 -0
- package/dist/ClassSource.d.ts +15 -0
- package/dist/ConfigView.d.ts +1 -0
- package/dist/ConfirmDialog.d.ts +16 -0
- package/dist/InlineString.d.ts +14 -0
- package/dist/KeyboardShortcuts.d.ts +7 -0
- package/dist/MemoryPlayground.d.ts +74 -0
- package/dist/MemoryView.d.ts +9 -0
- package/dist/MethodCallNode.d.ts +8 -0
- package/dist/ObjectNode.d.ts +7 -0
- package/dist/ReferenceEdge.d.ts +3 -0
- package/dist/Sidebar.d.ts +11 -0
- package/dist/SimpleInputDialog.d.ts +10 -0
- package/dist/StepBar.d.ts +10 -0
- package/dist/VariableNode.d.ts +5 -0
- package/dist/ariaLabels.d.ts +11 -0
- package/dist/canonical.d.ts +19 -0
- package/dist/exportSteps.d.ts +30 -0
- package/dist/fitPadding.d.ts +13 -0
- package/dist/getEdgesAndNodes.d.ts +10 -0
- package/dist/helper.d.ts +19 -0
- package/dist/index.css +1 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +13208 -0
- package/dist/javaSource.d.ts +17 -0
- package/dist/klassImpact.d.ts +28 -0
- package/dist/memory.d.ts +152 -0
- package/dist/palette.d.ts +29 -0
- package/dist/presets.d.ts +10 -0
- package/dist/serde.d.ts +4 -0
- package/dist/stepDiff.d.ts +18 -0
- package/dist/store.d.ts +230 -0
- package/dist/storeContext.d.ts +24 -0
- package/dist/translations.d.ts +119 -0
- package/dist/types.d.ts +23 -0
- package/dist/useDnD.d.ts +23 -0
- package/dist/useUndoRedo.d.ts +13 -0
- package/dist/utils.d.ts +8 -0
- package/package.json +72 -0
package/dist/useDnD.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { XYPosition } from '@xyflow/react';
|
|
2
|
+
import { Dispatch, SetStateAction } from 'react';
|
|
3
|
+
export type OnDropAction = ({ position }: {
|
|
4
|
+
position: XYPosition;
|
|
5
|
+
}) => void;
|
|
6
|
+
interface DnDContextType {
|
|
7
|
+
isDragging: boolean;
|
|
8
|
+
setIsDragging: Dispatch<SetStateAction<boolean>>;
|
|
9
|
+
dropAction: OnDropAction | null;
|
|
10
|
+
setDropAction: Dispatch<SetStateAction<OnDropAction | null>>;
|
|
11
|
+
}
|
|
12
|
+
declare const DnDContext: import("react").Context<DnDContextType | null>;
|
|
13
|
+
export declare function DnDProvider({ children }: {
|
|
14
|
+
children: React.ReactNode;
|
|
15
|
+
}): import("react").JSX.Element;
|
|
16
|
+
export default DnDContext;
|
|
17
|
+
export declare const useDnD: () => {
|
|
18
|
+
isDragging: boolean;
|
|
19
|
+
onDragStart: (event: React.PointerEvent<HTMLDivElement>, onDrop: OnDropAction) => void;
|
|
20
|
+
};
|
|
21
|
+
export declare const useDnDPosition: () => {
|
|
22
|
+
position: XYPosition | undefined;
|
|
23
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Undo/redo for the surrounding playground, backed by zundo's temporal store.
|
|
3
|
+
*
|
|
4
|
+
* Only the diagram is undoable — opening a dialog or switching to the config
|
|
5
|
+
* view does not consume a step (see the temporal `partialize` in `store.ts`).
|
|
6
|
+
*/
|
|
7
|
+
export declare const useUndoRedo: () => {
|
|
8
|
+
undo: () => void;
|
|
9
|
+
redo: () => void;
|
|
10
|
+
clear: () => void;
|
|
11
|
+
canUndo: boolean;
|
|
12
|
+
canRedo: boolean;
|
|
13
|
+
};
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Node, Edge } from "@xyflow/react";
|
|
2
|
+
export declare const isConnectedToVariable: (nodeId: string, nodes: Node[], edges: Edge[]) => boolean;
|
|
3
|
+
export declare const isConnectedToMethodCall: (nodeId: string, nodes: Node[], edges: Edge[]) => boolean;
|
|
4
|
+
export declare const isConnectedTo: (nodeId: string, conntectedId: string, nodes: Node[], edges: Edge[]) => boolean;
|
|
5
|
+
/**
|
|
6
|
+
* A random hexadecimal address, optionally avoiding ids already in use.
|
|
7
|
+
*/
|
|
8
|
+
export declare const getRanMemoryAdress: (size: number, taken?: Set<string>) => string;
|
package/package.json
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@java-memory-playground/java-memory-playground",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"author": "Mike Barkmin",
|
|
5
|
+
"description": "React components for visualizing the Java stack and heap.",
|
|
6
|
+
"homepage": "https://github.com/openpatch/java-memory-playground#readme",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"type": "module",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "dist/index.js",
|
|
11
|
+
"types": "dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
},
|
|
17
|
+
"./index.css": "./dist/index.css"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"LICENSE"
|
|
22
|
+
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public"
|
|
25
|
+
},
|
|
26
|
+
"repository": {
|
|
27
|
+
"type": "git",
|
|
28
|
+
"url": "git+https://github.com/openpatch/java-memory-playground.git",
|
|
29
|
+
"directory": "packages/java-memory-playground"
|
|
30
|
+
},
|
|
31
|
+
"bugs": {
|
|
32
|
+
"url": "https://github.com/openpatch/java-memory-playground/issues"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"react": "^18.0.0 || ^19.0.0",
|
|
36
|
+
"react-dom": "^18.0.0 || ^19.0.0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@xyflow/react": "^12.11.2",
|
|
40
|
+
"fast-deep-equal": "^3.1.3",
|
|
41
|
+
"html-to-image": "^1.11.13",
|
|
42
|
+
"js-base64": "^3.9.2",
|
|
43
|
+
"pako": "^3.0.1",
|
|
44
|
+
"throttle-debounce": "^5.0.2",
|
|
45
|
+
"zundo": "^2.3.0",
|
|
46
|
+
"zustand": "^5.0.14"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@types/node": "^26.1.2",
|
|
50
|
+
"@types/react": "^19.2.18",
|
|
51
|
+
"@types/react-dom": "^19.2.4",
|
|
52
|
+
"@types/throttle-debounce": "^5.0.2",
|
|
53
|
+
"@vitejs/plugin-react": "^5.2.0",
|
|
54
|
+
"react": "^19.2.8",
|
|
55
|
+
"react-dom": "^19.2.8",
|
|
56
|
+
"rimraf": "^6.1.3",
|
|
57
|
+
"typescript": "^7.0.2",
|
|
58
|
+
"typescript-json-schema": "^0.68.0",
|
|
59
|
+
"vite": "^7.3.6",
|
|
60
|
+
"vitest": "^4.1.10"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"version": "pnpm build",
|
|
64
|
+
"lint": "tsc --noEmit",
|
|
65
|
+
"test": "vitest run",
|
|
66
|
+
"test:watch": "vitest",
|
|
67
|
+
"build": "rimraf dist && vite build && pnpm build:types",
|
|
68
|
+
"build:types": "tsc --project tsconfig.build.json --declaration --emitDeclarationOnly",
|
|
69
|
+
"dev": "vite build --watch",
|
|
70
|
+
"schema": "typescript-json-schema ./src/memory.ts Memory Obj Variable MethodCall Klass DataType --out ./schemas/memory.schema.json --required"
|
|
71
|
+
}
|
|
72
|
+
}
|