@dashfoo/core 0.5.1 → 1.0.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/README.md +20 -20
- package/dist/index.d.ts +250 -159
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +283 -160
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -198,7 +198,7 @@ or a float) a node lives in.
|
|
|
198
198
|
## Floating panels
|
|
199
199
|
|
|
200
200
|
A panel can float out into a movable, resizable overlay (the React layer renders
|
|
201
|
-
it in-app
|
|
201
|
+
it in-app; see `@dashfoo/react`). Floats are first-class model nodes
|
|
202
202
|
(`Dashfoo.floats`), each owning a full `RowNode` layout, so they serialize and
|
|
203
203
|
self-heal like the main tree:
|
|
204
204
|
|
|
@@ -241,7 +241,7 @@ region the dock indicator highlights for a `DockLocation`: the whole tabset for
|
|
|
241
241
|
`resolveDockTarget` as five polygons (`{ location, points }`): the inner center
|
|
242
242
|
rect and four edge trapezoids whose seams run from each rect corner to the
|
|
243
243
|
matching inner corner. The two functions share the band default, so a map
|
|
244
|
-
painted from the polygons always agrees with the live hit-test
|
|
244
|
+
painted from the polygons always agrees with the live hit-test; use it to
|
|
245
245
|
visualize drop zones or to build custom drop indicators.
|
|
246
246
|
|
|
247
247
|
## Snapping
|
|
@@ -258,7 +258,7 @@ snapEnabled(config: SnapConfig | null): boolean;
|
|
|
258
258
|
|
|
259
259
|
`resolveSnapTargets` builds the grid for a row from its config and panel count: the
|
|
260
260
|
union of the `step` grid (multiples of a fixed percent) and the `divisions` grid
|
|
261
|
-
(even splits
|
|
261
|
+
(even splits: multiples of `100/d`, where `d` is the number or, for `"panels"`,
|
|
262
262
|
the panel count). `snapSizes` snaps the boundary between panel `boundaryIndex` and
|
|
263
263
|
the next onto the nearest target within `threshold` (default `4`), moving only that
|
|
264
264
|
pair so siblings keep their size. It is a no-op when the grid is empty, the index
|
|
@@ -314,8 +314,8 @@ the document is data, so it has a single `ready` state and handles four events:
|
|
|
314
314
|
| Event | Payload | Effect |
|
|
315
315
|
| ----------- | ------------ | ------------------------------ |
|
|
316
316
|
| `DISPATCH` | `{ action }` | run the reducer via `dispatch` |
|
|
317
|
-
| `UNDO` |
|
|
318
|
-
| `REDO` |
|
|
317
|
+
| `UNDO` | (none) | step back |
|
|
318
|
+
| `REDO` | (none) | step forward |
|
|
319
319
|
| `SET_MODEL` | `{ model }` | replace with a fresh history |
|
|
320
320
|
|
|
321
321
|
```ts
|
|
@@ -334,7 +334,7 @@ abstract events the dnd-kit adapter maps from pointer and keyboard input. It own
|
|
|
334
334
|
transient drag state only and never touches the document. On a valid `DROP` it
|
|
335
335
|
**emits** a `COMMIT` carrying a `moveNode` action (the drag subject is a tab), a
|
|
336
336
|
`moveTabset` action (the subject is a whole tabset, dragged by its grip), or an
|
|
337
|
-
`addNode` action (an `external` subject
|
|
337
|
+
`addNode` action (an `external` subject: content dragged in from outside the
|
|
338
338
|
layout, carrying the `TabNode` to insert), which the React layer forwards to
|
|
339
339
|
`dashfooMachine`.
|
|
340
340
|
|
|
@@ -342,48 +342,48 @@ layout, carrying the `TabNode` to insert), which the React layer forwards to
|
|
|
342
342
|
| -------- | -------------------- |
|
|
343
343
|
| `START` | `{ subject }` |
|
|
344
344
|
| `OVER` | `{ intent \| null }` |
|
|
345
|
-
| `DROP` |
|
|
346
|
-
| `CANCEL` |
|
|
345
|
+
| `DROP` | (none) |
|
|
346
|
+
| `CANCEL` | (none) |
|
|
347
347
|
|
|
348
348
|
## Public exports
|
|
349
349
|
|
|
350
|
-
`schema
|
|
350
|
+
`schema`: `dashfooSchema`, `rowNodeSchema`, `tabsetNodeSchema`, `tabNodeSchema`,
|
|
351
351
|
`floatNodeSchema`, `geometrySchema`, `dimensionSchema`, `snapSchema`, `edgeSchema`,
|
|
352
352
|
`unitSchema`, `orientationSchema`, `globalAttributesSchema`,
|
|
353
353
|
`jsonValueSchema`; types `Dashfoo`, `RowNode`, `TabsetNode`, `TabNode`,
|
|
354
354
|
`FloatNode`, `Geometry`, `Dimension`, `SnapConfig`, `Edge`, `Unit`, `Orientation`,
|
|
355
355
|
`GlobalAttributes`, `Node`, `Json`.
|
|
356
356
|
|
|
357
|
-
`builders
|
|
357
|
+
`builders`: `model`, `row`, `tabset`, `tab`, `floatNode`; option types
|
|
358
358
|
`ModelOptions`, `RowOptions`, `TabsetOptions`, `TabOptions`, `FloatOptions`.
|
|
359
359
|
|
|
360
|
-
`ids
|
|
360
|
+
`ids`: `createNodeId`, `createTabId`.
|
|
361
361
|
|
|
362
|
-
`actions
|
|
362
|
+
`actions`: `actionSchema`, `dockLocationSchema`, `mutableNodeAttrsSchema`; types
|
|
363
363
|
`Action`, `DockLocation`, `DropIntent`, `MutableNodeAttrs`.
|
|
364
364
|
|
|
365
|
-
`reducer
|
|
365
|
+
`reducer`: `reducer`. `invariants`: `normalize`.
|
|
366
366
|
|
|
367
|
-
`tree
|
|
367
|
+
`tree`: `collectRoots`, `collectTabsets`, `collectTabsetsInRow`, `getFirstTabset`,
|
|
368
368
|
`findTabset`, `findTab`, `findFloat`, `findRow`, `findRootContaining`, `findAttributedNode`,
|
|
369
369
|
`findTabsetParent`, `findDuplicateIds`;
|
|
370
370
|
types `AttributedNode`, `TabContainer`, `TabLocation`.
|
|
371
371
|
|
|
372
|
-
`geometry
|
|
372
|
+
`geometry`: `resolveDockTarget`, `dockZonePolygons`, `zoneRect`; types
|
|
373
373
|
`DockTarget`, `DockZone`, `BandOptions`, `Point`, `Rect`.
|
|
374
374
|
|
|
375
|
-
`snap
|
|
375
|
+
`snap`: `resolveSnapTargets`, `snapSizes`, `snapEnabled`, `DEFAULT_SNAP_THRESHOLD`;
|
|
376
376
|
type `SnapResult`.
|
|
377
377
|
|
|
378
|
-
`history
|
|
378
|
+
`history`: `createHistory`, `dispatch`, `undo`, `redo`, `canUndo`, `canRedo`;
|
|
379
379
|
type `History`.
|
|
380
380
|
|
|
381
|
-
`serialize
|
|
381
|
+
`serialize`: `toJSON`, `fromJSON`, `parseModel`.
|
|
382
382
|
|
|
383
|
-
`stack
|
|
383
|
+
`stack`: `stackModel` (flatten any layout into one row or column of all its
|
|
384
384
|
tabsets, the building block for a narrow-screen breakpoint).
|
|
385
385
|
|
|
386
|
-
`machines
|
|
386
|
+
`machines`: `dashfooMachine`, `dragDockMachine`; types `DashfooContext`,
|
|
387
387
|
`DashfooEvent`, `DashfooInput`, `DragContext`, `DragEvent`, `DragSubject`,
|
|
388
388
|
`DragEmitted`.
|
|
389
389
|
|