@johnoscott/isometric-engine 0.12.6 → 0.14.1
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/EDITOR-GUIDE.md +9 -2
- package/README.md +1 -1
- package/assets/app.css +6 -0
- package/assets/marks.css +2 -0
- package/iso-editor.js +188 -187
- package/js/iso-editor/make-way.js +62 -0
- package/js/iso-editor/ui/canvas.js +477 -216
- package/js/iso-editor/ui/palette-look.js +53 -0
- package/js/iso-editor/ui/setup.js +3 -0
- package/package.json +1 -1
- package/src/iso-editor/make-way.ts +89 -0
- package/src/iso-editor/ui/app.css +4 -0
- package/src/iso-editor/ui/canvas.ts +390 -170
- package/src/iso-editor/ui/marks.css +2 -0
- package/src/iso-editor/ui/palette-look.ts +51 -0
- package/src/iso-editor/ui/setup.ts +8 -0
- package/types/iso-editor/make-way.d.ts +40 -0
- package/types/iso-editor/ui/canvas.d.ts +33 -12
- package/types/iso-editor/ui/palette-look.d.ts +5 -0
- package/types/iso-editor/ui/setup.d.ts +5 -0
package/EDITOR-GUIDE.md
CHANGED
|
@@ -213,14 +213,19 @@ Three optional pieces. Give one and the editor offers it; leave it out and nothi
|
|
|
213
213
|
floating over it: a search box at its top filters the entries by label and section (Enter adds the first match, ↓
|
|
214
214
|
goes into the list, Esc clears it), the sections are its collapsible groups, a grip resizes it and a control
|
|
215
215
|
collapses it to a strip (both kept in the host's `storage` as `canvas-palette-dock`). Drag and Enter add as before.
|
|
216
|
-
`'floating'` is the default.
|
|
216
|
+
`'floating'` is the default. **Looks** (0.14.0): `paletteLook: 'object'` shows each entry as the thing it makes, drawn small
|
|
217
|
+
in the drawing's own style (an entry that can't be drawn alone, in a file with only your plain values, keeps its icon).
|
|
217
218
|
- **Connect**, on the adapter: `connect(from, to, data)` returns where a connection goes and what it is, `{ at, value }`
|
|
218
219
|
to add to a list (or with `name`, to a map under a fresh name), or `undefined` when those two don't connect. The
|
|
219
220
|
canvas then shows a handle on the one selected object: drag it to another (Esc cancels), or use **Connect to…** in
|
|
220
221
|
its menu and click the other.
|
|
221
222
|
- **Drop into** (0.10.1), on the adapter: `dropInto(target, value, kind, data)` returns the new thing's value inside
|
|
222
223
|
`target` (and words for it), or `undefined` when `target` doesn't hold it. A palette drop asks what is under it,
|
|
223
|
-
innermost first, and the first that holds it takes it; with none, the drop is pinned where it lands.
|
|
224
|
+
innermost first, and the first that holds it takes it; with none, the drop is pinned where it lands. In 3D the palette
|
|
225
|
+
drags the thing itself (0.14.0), in a trial drawing of the file with it, so the grid, the target and what it lands in are
|
|
226
|
+
seen before the drop; in a container it is pinned where it is dropped, unless that is the layout's own place for it.
|
|
227
|
+
- **Making way** (0.14.0): a drag held still over a taken cell makes what is there step aside (after 700 ms; `dragMotion:
|
|
228
|
+
'respect'` on the view leaves out the jiggle and the glide under Reduce Motion). What moved is pinned, in the same undo step.
|
|
224
229
|
- **Group**, on the adapter: `group(members, data)` returns the new container (`at`, the base of its `name`, its
|
|
225
230
|
`value`) and `members(name)`, what changes in each member once it has a name. **Group** in the menu, or ⌘G, writes
|
|
226
231
|
it all as one step; members' pins are dropped, so the layout places them in their new container.
|
|
@@ -319,6 +324,8 @@ Its `index.html` gives the editor a sized element: `<div id="app" style="height:
|
|
|
319
324
|
| a palette drop that lands inside a container (0.10.1) | `adapter.dropInto` |
|
|
320
325
|
| palette sections under collapsible headers (0.11.0) | `view.palette[].section` |
|
|
321
326
|
| the palette docked at the canvas's left, searchable (0.12.0) | `view.paletteLayout: 'docked'` |
|
|
327
|
+
| the palette's entries as what they make (0.14.0) | `view.paletteLook: 'object'` |
|
|
328
|
+
| a drag's jiggle and glide, under Reduce Motion (0.14.0) | `view.dragMotion: 'respect'` (default: `'always'`) |
|
|
322
329
|
| a double click on an object renames it, in place (0.12.5) | `view.doubleClick: 'rename'` (default: shows it in the text) |
|
|
323
330
|
|
|
324
331
|
## 5. Testing your adapter
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @johnoscott/isometric-engine 0.
|
|
1
|
+
# @johnoscott/isometric-engine 0.14.1
|
|
2
2
|
|
|
3
3
|
A generic isometric diagram engine: `@johnoscott/isometric-engine/render` (L0 core, L1 objects, L2 viewer)
|
|
4
4
|
and `@johnoscott/isometric-engine/editor` (the same, and L3 editor). Each exports one namespace per layer:
|
package/assets/app.css
CHANGED
|
@@ -260,6 +260,10 @@ body.read-only .palette { display: none; }
|
|
|
260
260
|
.pal-grip { flex: none; width: 6px; margin: 0 -3px; cursor: col-resize; z-index: 3; position: relative; }
|
|
261
261
|
.pal-grip:hover, .pal-grip:focus-visible { background: color-mix(in srgb, var(--accent) 30%, transparent); outline: 0; }
|
|
262
262
|
body.read-only .pal-dock, body.read-only .pal-grip { display: none; }
|
|
263
|
+
.palette.looks .pal-item { height: auto; min-height: 40px; }
|
|
264
|
+
.palette.looks .pal-look { display: block; flex: 0 0 44px; width: 44px; height: 36px; margin: 0; padding: 0; background: none; pointer-events: none; overflow: hidden; }
|
|
265
|
+
.palette.looks .pal-scene { display: block; width: 100%; height: 100%; }
|
|
266
|
+
.palette.looks .pal-item > .icon { margin: 0 15px; }
|
|
263
267
|
.pal-ghost { position: absolute; z-index: 5; pointer-events: none; display: flex; align-items: center; gap: var(--sp-1); padding: 2px var(--sp-2); border: var(--bw) solid var(--accent); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); font-size: var(--fs-sm); box-shadow: var(--shadow-2, none); }
|
|
264
268
|
.pal-ghost .icon { width: 14px; height: 14px; }
|
|
265
269
|
.pal-ghost.bad { border-color: var(--bad); color: var(--bad); }
|
|
@@ -274,6 +278,8 @@ body.read-only .pal-dock, body.read-only .pal-grip { display: none; }
|
|
|
274
278
|
@layer views {
|
|
275
279
|
.iso-canvas { --iso-sel: var(--accent); --iso-sel-fill: color-mix(in srgb, var(--iso-sel) 12%, transparent);
|
|
276
280
|
--iso-sel-faint: color-mix(in srgb, var(--iso-sel) 6%, transparent); --iso-bad: var(--bad); --iso-warn: var(--warn); }
|
|
281
|
+
/* a drag moves things, it doesn't select the drawing's words */
|
|
282
|
+
.iso-canvas svg.scene { user-select: none; -webkit-user-select: none; }
|
|
277
283
|
.iso-canvas svg.scene [data-id] { cursor: pointer; }
|
|
278
284
|
.iso-canvas svg.scene.mode-pan { cursor: grab; }
|
|
279
285
|
.iso-canvas svg.scene.mode-select { cursor: crosshair; }
|
package/assets/marks.css
CHANGED
|
@@ -7,6 +7,8 @@
|
|
|
7
7
|
@layer views {
|
|
8
8
|
.iso-canvas { --iso-sel: var(--accent); --iso-sel-fill: color-mix(in srgb, var(--iso-sel) 12%, transparent);
|
|
9
9
|
--iso-sel-faint: color-mix(in srgb, var(--iso-sel) 6%, transparent); --iso-bad: var(--bad); --iso-warn: var(--warn); }
|
|
10
|
+
/* a drag moves things, it doesn't select the drawing's words */
|
|
11
|
+
.iso-canvas svg.scene { user-select: none; -webkit-user-select: none; }
|
|
10
12
|
.iso-canvas svg.scene [data-id] { cursor: pointer; }
|
|
11
13
|
.iso-canvas svg.scene.mode-pan { cursor: grab; }
|
|
12
14
|
.iso-canvas svg.scene.mode-select { cursor: crosshair; }
|