@gjermundgaraba-designs/pixel-paper 0.18.0 → 0.19.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/DESIGN.md +25 -4
- package/dist/src/drag/drag.d.ts +3 -0
- package/dist/src/drag/drag.d.ts.map +1 -1
- package/dist/src/drag/drag.js +14 -10
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -0
- package/dist/src/reel/index.d.ts +4 -0
- package/dist/src/reel/index.d.ts.map +1 -0
- package/dist/src/reel/index.js +2 -0
- package/dist/src/reel/layout.d.ts +180 -0
- package/dist/src/reel/layout.d.ts.map +1 -0
- package/dist/src/reel/layout.js +370 -0
- package/dist/src/reel/reel.d.ts +1158 -0
- package/dist/src/reel/reel.d.ts.map +1 -0
- package/dist/src/reel/reel.js +922 -0
- package/dist/src/sortable/sortable.d.ts +30 -30
- package/dist/src/sortable/sortable.d.ts.map +1 -1
- package/dist/src/sortable/sortable.js +2 -10
- package/dist/src/toast/toast.d.ts +12 -12
- package/dist/src/window/window.d.ts +2 -0
- package/dist/src/window/window.d.ts.map +1 -1
- package/dist/src/window/window.js +2 -1
- package/package.json +1 -1
- package/src/drag/drag.ts +19 -4
- package/src/index.ts +1 -0
- package/src/pixel-paper.css +228 -1
- package/src/reel/index.ts +20 -0
- package/src/reel/layout.ts +602 -0
- package/src/reel/reel.ts +1597 -0
- package/src/sortable/sortable.ts +8 -16
- package/src/tokens.css +5 -0
- package/src/window/window.ts +4 -0
package/src/sortable/sortable.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
movedPointer,
|
|
24
24
|
phaseOf,
|
|
25
25
|
pressedDraggable,
|
|
26
|
+
pressingPointer,
|
|
26
27
|
releasedPointer,
|
|
27
28
|
} from "../drag/drag.ts";
|
|
28
29
|
import * as Glyph from "../glyph/glyph.ts";
|
|
@@ -472,23 +473,14 @@ const pointerAt = (hold: PointerHold, event: PointerEvent): PointerAt => ({
|
|
|
472
473
|
});
|
|
473
474
|
|
|
474
475
|
/** The pressing pointer's moves, release and cancel; another pointer's are not the list's. */
|
|
475
|
-
export const pointerMessages = (hold: PointerHold): Stream.Stream<Message> =>
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const streams: ReadonlyArray<Stream.Stream<Message>> = [
|
|
482
|
-
Stream.map(fromPressing("pointermove"), (event) =>
|
|
483
|
-
Message.MovedPointer(pointerAt(hold, event)),
|
|
484
|
-
),
|
|
485
|
-
Stream.map(fromPressing("pointerup"), (event) =>
|
|
486
|
-
Message.ReleasedPointer(pointerAt(hold, event)),
|
|
476
|
+
export const pointerMessages = (hold: PointerHold): Stream.Stream<Message> =>
|
|
477
|
+
Stream.map(pressingPointer(hold.pointerId), (event) =>
|
|
478
|
+
Match.value(event.type).pipe(
|
|
479
|
+
Match.when("pointermove", () => Message.MovedPointer(pointerAt(hold, event))),
|
|
480
|
+
Match.when("pointerup", () => Message.ReleasedPointer(pointerAt(hold, event))),
|
|
481
|
+
Match.orElse(() => Message.CancelledPointer()),
|
|
487
482
|
),
|
|
488
|
-
|
|
489
|
-
];
|
|
490
|
-
return Stream.mergeAll(streams, { concurrency: "unbounded" });
|
|
491
|
-
};
|
|
483
|
+
);
|
|
492
484
|
|
|
493
485
|
const ownSubscriptions = Subscription.make<Model, Message>()((entry) => ({
|
|
494
486
|
pointer: entry(
|
package/src/tokens.css
CHANGED
|
@@ -139,6 +139,11 @@
|
|
|
139
139
|
--shadow-pressed: 1px 1px 0 var(--shadow-color);
|
|
140
140
|
--shadow-danger: 3px 3px 0 var(--shadow-danger-color);
|
|
141
141
|
|
|
142
|
+
/* ---------- the reel: a scrolling row of columns of panes ---------- */
|
|
143
|
+
--reel-gutter: 16px; /* between columns, and between the panes of a column */
|
|
144
|
+
--reel-column-min: 280px; /* the narrowest a column prints, whatever its width */
|
|
145
|
+
--reel-pane-min: 120px; /* the shortest a pane prints */
|
|
146
|
+
|
|
142
147
|
/* ---------- charts ---------- */
|
|
143
148
|
--chart-plot: 160px; /* a line chart's plot, between its top line and its axis */
|
|
144
149
|
|
package/src/window/window.ts
CHANGED
|
@@ -14,6 +14,8 @@ export type ViewConfig<Message> = Readonly<{
|
|
|
14
14
|
id: string;
|
|
15
15
|
/** Pixel caps in the inverted title bar. */
|
|
16
16
|
title: string;
|
|
17
|
+
/** A quiet IconButton before the kind glyph: a Reel's grip. */
|
|
18
|
+
lead?: ReadonlyArray<Html>;
|
|
17
19
|
/** What kind of thing it is: a terminal, a note, a machine. */
|
|
18
20
|
glyph?: GlyphName;
|
|
19
21
|
/** A chip in the title bar: its state. */
|
|
@@ -36,6 +38,7 @@ export const view = <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Messag
|
|
|
36
38
|
const {
|
|
37
39
|
id,
|
|
38
40
|
title,
|
|
41
|
+
lead = [],
|
|
39
42
|
glyph,
|
|
40
43
|
status = [],
|
|
41
44
|
tools = [],
|
|
@@ -55,6 +58,7 @@ export const view = <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Messag
|
|
|
55
58
|
h.header(
|
|
56
59
|
[h.Class("panel-tb")],
|
|
57
60
|
[
|
|
61
|
+
...slotView("span", "panel-lead", lead, h),
|
|
58
62
|
...(glyph === undefined ? [] : [Glyph.view({ name: glyph }, h)]),
|
|
59
63
|
h.h2([h.Id(titleId(id))], [title]),
|
|
60
64
|
...status,
|