castle-web-cli 0.4.142 → 0.4.145
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-prompts.d.ts +1 -0
- package/dist/agent-prompts.js +7 -2
- package/dist/agent.js +11 -9
- package/dist/imports.js +44 -4
- package/dist/init.d.ts +4 -0
- package/dist/init.js +63 -26
- package/dist/install.js +4 -0
- package/dist/platformDoc.d.ts +12 -0
- package/dist/platformDoc.js +236 -0
- package/dist/serve.d.ts +3 -0
- package/dist/serve.js +157 -13
- package/dist/serveSecurity.d.ts +5 -1
- package/dist/serveSecurity.js +27 -8
- package/dist/shell/assets/index-BaiRLZ8p.css +1 -0
- package/dist/shell/assets/{index-qbygvQIx.js → index-CbRAepsq.js} +68 -68
- package/dist/shell/index.html +2 -2
- package/kits/blank/CLAUDE.md +198 -0
- package/kits/blank/castle.json +8 -0
- package/kits/blank/index.html +42 -0
- package/kits/blank/package-lock.json +10 -0
- package/kits/blank/package.json +9 -0
- package/kits/physics-2d/CLAUDE.md +44 -4
- package/kits/physics-2d/behaviors/Collider.jsx +21 -0
- package/kits/physics-2d/behaviors/Draggable.jsx +9 -0
- package/kits/physics-2d/behaviors/Layout.jsx +7 -0
- package/kits/physics-2d/behaviors/RigidBody.jsx +6 -0
- package/kits/physics-2d/behaviors/Sprite.jsx +9 -4
- package/kits/physics-2d/editors/BlueprintLibrary.jsx +64 -32
- package/kits/physics-2d/editors/NewBlueprintModal.jsx +69 -0
- package/kits/physics-2d/editors/PlayOnly.jsx +1 -1
- package/kits/physics-2d/editors/SceneEditor.jsx +333 -108
- package/kits/physics-2d/editors/SelectionOverlay.jsx +6 -2
- package/kits/physics-2d/editors/behaviorRegistry.js +78 -5
- package/kits/physics-2d/engine/SceneUI.jsx +2 -2
- package/kits/physics-2d/engine/blueprint.js +212 -15
- package/kits/physics-2d/engine/editorFlags.js +50 -0
- package/kits/physics-2d/engine/files.js +9 -0
- package/kits/physics-2d/engine/liveReload.js +16 -4
- package/kits/physics-2d/engine/panelPrefs.js +78 -0
- package/kits/physics-2d/engine/panelSorting.jsx +84 -0
- package/kits/physics-2d/engine/physics/PhysicsSystem.js +5 -2
- package/kits/physics-2d/engine/physics/matterBridge.js +12 -2
- package/kits/physics-2d/engine/scene.js +94 -3
- package/kits/physics-2d/engine/ui.jsx +157 -4
- package/kits/physics-2d/engine/ui.module.css +615 -1
- package/kits/physics-2d/package-lock.json +78 -1
- package/kits/physics-2d/package.json +4 -0
- package/kits/physics-3d/CLAUDE.md +2 -3
- package/package.json +1 -1
- package/dist/commonInstructions.d.ts +0 -1
- package/dist/commonInstructions.js +0 -26
- package/dist/shell/assets/index-CcVJjnL3.css +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { listBuiltinBlueprints } from '../engine/blueprint';
|
|
3
|
+
import { cx, Icon, styles } from '../engine/ui';
|
|
4
|
+
import { BlueprintThumbnail } from './BlueprintLibrary';
|
|
5
|
+
|
|
6
|
+
// The "New blueprint" modal: one decision, made from pictures. It asks only
|
|
7
|
+
// "what is this roughly" -- the name and the sprite are answered afterwards in
|
|
8
|
+
// the blueprint inspector, against an actor you can see.
|
|
9
|
+
//
|
|
10
|
+
// Nothing is written until a tile is picked. Cancel leaves the deck untouched.
|
|
11
|
+
//
|
|
12
|
+
// Off by default; see `newBlueprintModal` in engine/editorFlags.js.
|
|
13
|
+
|
|
14
|
+
// The only choice that isn't a built-in, so it leads.
|
|
15
|
+
const BLANK = { key: '__blank__', label: 'Blank Drawing', hint: 'An empty canvas to draw in' };
|
|
16
|
+
|
|
17
|
+
export function NewBlueprintModal({ files, sprites, onCancel, onCreate }) {
|
|
18
|
+
const builtins = useMemo(() => listBuiltinBlueprints(files), [files]);
|
|
19
|
+
return (
|
|
20
|
+
<div
|
|
21
|
+
className={styles.confirmBackdrop}
|
|
22
|
+
onPointerDown={onCancel}
|
|
23
|
+
onKeyDown={(event) => {
|
|
24
|
+
if (event.key === 'Escape') onCancel();
|
|
25
|
+
}}>
|
|
26
|
+
<div
|
|
27
|
+
className={styles.newBpDialog}
|
|
28
|
+
role="dialog"
|
|
29
|
+
aria-label="New blueprint"
|
|
30
|
+
onPointerDown={(event) => event.stopPropagation()}>
|
|
31
|
+
<div className={styles.confirmTitle}>New blueprint</div>
|
|
32
|
+
<div className={styles.newBpSubtitle}>
|
|
33
|
+
Pick a starting point. You can rename it and edit its art next.
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div className={styles.newBpChoiceGrid}>
|
|
37
|
+
<button
|
|
38
|
+
type="button"
|
|
39
|
+
className={styles.newBpArtTile}
|
|
40
|
+
title={BLANK.hint}
|
|
41
|
+
autoFocus
|
|
42
|
+
onClick={() => onCreate({})}>
|
|
43
|
+
<span className={styles.bpSlotFallback}>
|
|
44
|
+
<Icon name="plus" />
|
|
45
|
+
</span>
|
|
46
|
+
<span className={styles.newBpArtLabel}>{BLANK.label}</span>
|
|
47
|
+
</button>
|
|
48
|
+
{builtins.map((builtin) => (
|
|
49
|
+
<button
|
|
50
|
+
key={builtin.path}
|
|
51
|
+
type="button"
|
|
52
|
+
className={styles.newBpArtTile}
|
|
53
|
+
title={`Start from ${builtin.name}`}
|
|
54
|
+
onClick={() => onCreate({ builtin: builtin.path })}>
|
|
55
|
+
<BlueprintThumbnail blueprint={builtin} sprites={sprites} showName={false} />
|
|
56
|
+
<span className={styles.newBpArtLabel}>{builtin.name}</span>
|
|
57
|
+
</button>
|
|
58
|
+
))}
|
|
59
|
+
</div>
|
|
60
|
+
|
|
61
|
+
<div className={cx(styles.newBpActions, styles.newBpActionsSingle)}>
|
|
62
|
+
<button type="button" className={styles.newBpSecondary} onClick={onCancel}>
|
|
63
|
+
Cancel
|
|
64
|
+
</button>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
}
|
|
@@ -23,7 +23,7 @@ import { behaviorClasses } from './behaviorRegistry';
|
|
|
23
23
|
const DEFAULT_SCENE = 'scenes/main.scene';
|
|
24
24
|
|
|
25
25
|
export function PlayOnly({ initialScene } = {}) {
|
|
26
|
-
const { files } = useLiveDeckFiles({ live: false });
|
|
26
|
+
const { files } = useLiveDeckFiles({ live: false, hydrateDeclared: false });
|
|
27
27
|
const scenePath = initialScene && files[initialScene] !== undefined ? initialScene : DEFAULT_SCENE;
|
|
28
28
|
const { value: sceneData } = parseJsonFile(scenePath, files[scenePath] ?? '');
|
|
29
29
|
if (!sceneData) return null;
|