castle-web-cli 0.4.83 → 0.4.85
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/dist/agent-failures.d.ts +17 -0
- package/dist/agent-failures.js +151 -0
- package/dist/agent.d.ts +26 -0
- package/dist/agent.js +317 -74
- package/dist/ide.js +35 -13
- package/dist/native/loop.js +35 -0
- package/dist/native/openrouter.d.ts +7 -0
- package/dist/native/openrouter.js +25 -1
- package/dist/native/types.d.ts +2 -0
- package/dist/native/types.js +0 -38
- package/dist/openrouter-catalog.d.ts +28 -0
- package/dist/openrouter-catalog.js +299 -0
- package/dist/shell/assets/{index-C9Zhmien.js → index-BJLaUTJE.js} +60 -58
- package/dist/shell/assets/{index-BMkQt27u.css → index-DonnH--m.css} +1 -1
- package/dist/shell/index.html +2 -2
- package/kits/physics-2d/.prettierrc +8 -0
- package/kits/physics-2d/CLAUDE.md +329 -0
- package/kits/physics-2d/behaviors/Camera.jsx +43 -0
- package/kits/physics-2d/behaviors/Collider.jsx +199 -0
- package/kits/physics-2d/behaviors/Goal.jsx +29 -0
- package/kits/physics-2d/behaviors/Layout.jsx +53 -0
- package/kits/physics-2d/behaviors/Sprite.jsx +352 -0
- package/kits/physics-2d/behaviors/tint.js +47 -0
- package/kits/physics-2d/blueprints/ball.scene +14 -0
- package/kits/physics-2d/blueprints/block.scene +12 -0
- package/kits/physics-2d/blueprints/cauldron.scene +18 -0
- package/kits/physics-2d/blueprints/crate.scene +14 -0
- package/kits/physics-2d/blueprints/goal.scene +12 -0
- package/kits/physics-2d/castle.json +13 -0
- package/kits/physics-2d/docs/pxart-format.md +377 -0
- package/kits/physics-2d/drawings/block.pxart +25 -0
- package/kits/physics-2d/drawings/cauldron.pxart +113 -0
- package/kits/physics-2d/editors/BlueprintLibrary.jsx +247 -0
- package/kits/physics-2d/editors/ErrorBoundary.jsx +59 -0
- package/kits/physics-2d/editors/PlayOnly.jsx +31 -0
- package/kits/physics-2d/editors/PxArtEditor.jsx +954 -0
- package/kits/physics-2d/editors/SceneEditor.jsx +1681 -0
- package/kits/physics-2d/editors/SelectionOverlay.jsx +909 -0
- package/kits/physics-2d/editors/SingleEditor.jsx +122 -0
- package/kits/physics-2d/editors/behaviorRegistry.js +30 -0
- package/kits/physics-2d/editors/editorHistory.js +157 -0
- package/kits/physics-2d/editors/inspectorSheet.js +13 -0
- package/kits/physics-2d/editors/pixelCanvas.js +11 -0
- package/kits/physics-2d/editors/pixelEditorChrome.jsx +74 -0
- package/kits/physics-2d/editors/pixelGeometry.js +140 -0
- package/kits/physics-2d/editors/pixelInspector.jsx +633 -0
- package/kits/physics-2d/editors/pxArtEditorModel.js +732 -0
- package/kits/physics-2d/editors/pxArtPlayback.js +92 -0
- package/kits/physics-2d/editors/pxArtTimeline.jsx +752 -0
- package/kits/physics-2d/editors/pxArtTimeline.module.css +506 -0
- package/kits/physics-2d/editors/pxArtTools.js +232 -0
- package/kits/physics-2d/editors/useArtboardFit.js +102 -0
- package/kits/physics-2d/engine/ScenePlayer.jsx +196 -0
- package/kits/physics-2d/engine/SceneUI.jsx +59 -0
- package/kits/physics-2d/engine/assets.js +15 -0
- package/kits/physics-2d/engine/autoInspector.jsx +70 -0
- package/kits/physics-2d/engine/blueprint.js +521 -0
- package/kits/physics-2d/engine/collider.js +196 -0
- package/kits/physics-2d/engine/files.js +117 -0
- package/kits/physics-2d/engine/liveReload.js +88 -0
- package/kits/physics-2d/engine/pxart.js +1032 -0
- package/kits/physics-2d/engine/pxartSmooth.js +222 -0
- package/kits/physics-2d/engine/scene.js +686 -0
- package/kits/physics-2d/engine/spriteGeometry.js +32 -0
- package/kits/physics-2d/engine/ui.jsx +688 -0
- package/kits/physics-2d/engine/ui.module.css +2287 -0
- package/kits/physics-2d/eslint.config.js +71 -0
- package/kits/physics-2d/index.html +24 -0
- package/kits/physics-2d/main.jsx +24 -0
- package/kits/physics-2d/package-lock.json +2706 -0
- package/kits/physics-2d/package.json +42 -0
- package/kits/physics-2d/physics/PhysicsSystem.js +290 -0
- package/kits/physics-2d/physics/behaviors/AnalogStick.jsx +101 -0
- package/kits/physics-2d/physics/behaviors/Draggable.jsx +79 -0
- package/kits/physics-2d/physics/behaviors/RigidBody.jsx +55 -0
- package/kits/physics-2d/physics/behaviors/Slingshot.jsx +118 -0
- package/kits/physics-2d/physics/controls.js +79 -0
- package/kits/physics-2d/physics/index.js +26 -0
- package/kits/physics-2d/physics/matterBridge.js +126 -0
- package/kits/physics-2d/pnpm-lock.yaml +1761 -0
- package/kits/physics-2d/scenes/main.scene +12 -0
- package/kits/physics-2d/scenes/sandbox.scene +13 -0
- package/kits/physics-2d/scripts/draw.mjs +121 -0
- package/kits/physics-2d/vite.config.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import reactHooks from 'eslint-plugin-react-hooks';
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
ignores: ['node_modules/**', 'dist/**', '.castle/**', '*.config.js'],
|
|
7
|
+
},
|
|
8
|
+
js.configs.recommended,
|
|
9
|
+
{
|
|
10
|
+
// Node-side kit tooling (e.g. the `npm run draw` art generator). Runs under
|
|
11
|
+
// Node, not the browser, so it gets Node globals.
|
|
12
|
+
files: ['scripts/**/*.{js,mjs}'],
|
|
13
|
+
languageOptions: {
|
|
14
|
+
ecmaVersion: 'latest',
|
|
15
|
+
sourceType: 'module',
|
|
16
|
+
globals: {
|
|
17
|
+
process: 'readonly',
|
|
18
|
+
Buffer: 'readonly',
|
|
19
|
+
console: 'readonly',
|
|
20
|
+
URL: 'readonly',
|
|
21
|
+
setTimeout: 'readonly',
|
|
22
|
+
clearTimeout: 'readonly',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
rules: {
|
|
26
|
+
'no-undef': 'off',
|
|
27
|
+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
files: ['engine/**/*.{js,jsx}', 'editors/**/*.{js,jsx}', 'behaviors/**/*.{js,jsx}', '*.js', '*.jsx'],
|
|
32
|
+
languageOptions: {
|
|
33
|
+
ecmaVersion: 'latest',
|
|
34
|
+
sourceType: 'module',
|
|
35
|
+
parserOptions: {
|
|
36
|
+
ecmaFeatures: { jsx: true },
|
|
37
|
+
},
|
|
38
|
+
globals: {
|
|
39
|
+
window: 'readonly',
|
|
40
|
+
document: 'readonly',
|
|
41
|
+
console: 'readonly',
|
|
42
|
+
performance: 'readonly',
|
|
43
|
+
requestAnimationFrame: 'readonly',
|
|
44
|
+
cancelAnimationFrame: 'readonly',
|
|
45
|
+
setTimeout: 'readonly',
|
|
46
|
+
clearTimeout: 'readonly',
|
|
47
|
+
URL: 'readonly',
|
|
48
|
+
fetch: 'readonly',
|
|
49
|
+
navigator: 'readonly',
|
|
50
|
+
location: 'readonly',
|
|
51
|
+
HTMLCanvasElement: 'readonly',
|
|
52
|
+
Image: 'readonly',
|
|
53
|
+
FileReader: 'readonly',
|
|
54
|
+
KeyboardEvent: 'readonly',
|
|
55
|
+
PointerEvent: 'readonly',
|
|
56
|
+
MouseEvent: 'readonly',
|
|
57
|
+
TouchEvent: 'readonly',
|
|
58
|
+
structuredClone: 'readonly',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
plugins: {
|
|
62
|
+
'react-hooks': reactHooks,
|
|
63
|
+
},
|
|
64
|
+
rules: {
|
|
65
|
+
'no-unused-vars': ['warn', { argsIgnorePattern: '^_', varsIgnorePattern: '^_' }],
|
|
66
|
+
'no-undef': 'off',
|
|
67
|
+
'max-lines-per-function': ['warn', { max: 200, skipBlankLines: true, skipComments: true }],
|
|
68
|
+
complexity: ['warn', 12],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
];
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
|
|
5
|
+
<meta name="color-scheme" content="dark" />
|
|
6
|
+
<title>Castle Basic 2D JS Kit</title>
|
|
7
|
+
<!-- Declare the dark scheme + opaque dark background statically, before the
|
|
8
|
+
JS-imported CSS module loads. Otherwise this frame paints with the
|
|
9
|
+
default (light) scheme first and only switches to dark once the module
|
|
10
|
+
applies -- and Safari fails to repaint a composited iframe on a
|
|
11
|
+
color-scheme change (WebKit bug 309097), leaving static panels like the
|
|
12
|
+
file list blank until a forced repaint (e.g. opening devtools). -->
|
|
13
|
+
<style>
|
|
14
|
+
html {
|
|
15
|
+
color-scheme: dark;
|
|
16
|
+
background: #0a0a0a;
|
|
17
|
+
}
|
|
18
|
+
</style>
|
|
19
|
+
</head>
|
|
20
|
+
<body>
|
|
21
|
+
<div id="root"></div>
|
|
22
|
+
<script type="module" src="/main.jsx"></script>
|
|
23
|
+
</body>
|
|
24
|
+
</html>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { createRoot } from 'react-dom/client';
|
|
3
|
+
import { isEdit, setup } from 'castle-web-sdk';
|
|
4
|
+
import { PlayOnly } from './editors/PlayOnly';
|
|
5
|
+
import { ErrorBoundary } from './editors/ErrorBoundary';
|
|
6
|
+
import { SingleEditor } from './editors/SingleEditor';
|
|
7
|
+
document.body.dataset.castleScreenshotTarget = 'viewport';
|
|
8
|
+
setup();
|
|
9
|
+
const root = document.getElementById('root');
|
|
10
|
+
if (!root) throw new Error('Missing root element');
|
|
11
|
+
// Route on URL params so the shell can mount each piece in its own panel iframe.
|
|
12
|
+
// File browsing and the code/text editor are now builtin shell panels, so the
|
|
13
|
+
// kit only renders the deck (play) and its rich per-file editors (scene/pxart):
|
|
14
|
+
// (no edit / ?edit=0) -> play the deck (playtest panel)
|
|
15
|
+
// ?file=<path>[&editor=<id>] -> a single rich editor for that file
|
|
16
|
+
const params = new URLSearchParams(window.location.search);
|
|
17
|
+
function pick() {
|
|
18
|
+
const initialScene = params.get('scene') ?? undefined;
|
|
19
|
+
if (!isEdit()) return <PlayOnly initialScene={initialScene} />;
|
|
20
|
+
const file = params.get('file');
|
|
21
|
+
if (file) return <SingleEditor path={file} editor={params.get('editor') ?? undefined} />;
|
|
22
|
+
return <PlayOnly initialScene={initialScene} />;
|
|
23
|
+
}
|
|
24
|
+
createRoot(root).render(<ErrorBoundary>{pick()}</ErrorBoundary>);
|