@gjermundgaraba-designs/pixel-paper 0.22.2 → 0.23.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 +13 -13
- package/dist/src/adapters/mermaid.d.ts.map +1 -1
- package/dist/src/adapters/mermaid.js +0 -24
- package/dist/src/announcer/announcer.d.ts.map +1 -1
- package/dist/src/announcer/announcer.js +12 -12
- package/dist/src/board/board.d.ts +0 -10
- package/dist/src/board/board.d.ts.map +1 -1
- package/dist/src/board/board.js +36 -64
- package/dist/src/board/index.d.ts +2 -1
- package/dist/src/board/index.d.ts.map +1 -1
- package/dist/src/board/index.js +2 -1
- package/dist/src/button/button.d.ts +1 -1
- package/dist/src/button/button.d.ts.map +1 -1
- package/dist/src/commandPalette/commandPalette.d.ts.map +1 -1
- package/dist/src/commandPalette/commandPalette.js +78 -83
- package/dist/src/commandPalette/keys.d.ts +2 -2
- package/dist/src/commandPalette/keys.d.ts.map +1 -1
- package/dist/src/commandPalette/keys.js +2 -4
- package/dist/src/commandPalette/match.d.ts.map +1 -1
- package/dist/src/commandPalette/match.js +2 -2
- package/dist/src/confirmDialog/confirmDialog.d.ts.map +1 -1
- package/dist/src/confirmDialog/confirmDialog.js +1 -2
- package/dist/src/copyButton/copyButton.d.ts +0 -5
- package/dist/src/copyButton/copyButton.d.ts.map +1 -1
- package/dist/src/copyButton/copyButton.js +2 -2
- package/dist/src/crumbs/crumbs.d.ts +0 -2
- package/dist/src/crumbs/crumbs.d.ts.map +1 -1
- package/dist/src/crumbs/crumbs.js +2 -2
- package/dist/src/dialog/dialog.d.ts +2 -0
- package/dist/src/dialog/dialog.d.ts.map +1 -1
- package/dist/src/dialog/dialog.js +3 -2
- package/dist/src/drag/drag.d.ts +28 -0
- package/dist/src/drag/drag.d.ts.map +1 -1
- package/dist/src/drag/drag.js +39 -17
- package/dist/src/editableTitle/editableTitle.d.ts +4 -4
- package/dist/src/field/field.d.ts +7 -1
- package/dist/src/field/field.d.ts.map +1 -1
- package/dist/src/field/field.js +14 -6
- package/dist/src/fieldset/fieldset.d.ts.map +1 -1
- package/dist/src/fieldset/fieldset.js +2 -4
- package/dist/src/fileTree/fileTree.d.ts.map +1 -1
- package/dist/src/fileTree/fileTree.js +16 -16
- package/dist/src/inlineInput/inlineInput.d.ts +4 -0
- package/dist/src/inlineInput/inlineInput.d.ts.map +1 -1
- package/dist/src/inlineInput/inlineInput.js +9 -6
- package/dist/src/keyHelp/index.d.ts +1 -1
- package/dist/src/keyHelp/index.d.ts.map +1 -1
- package/dist/src/keyHelp/index.js +1 -1
- package/dist/src/keyHelp/keyHelp.d.ts +1 -3
- package/dist/src/keyHelp/keyHelp.d.ts.map +1 -1
- package/dist/src/keyHelp/keyHelp.js +3 -6
- package/dist/src/keyHint/keyLabel.d.ts +2 -0
- package/dist/src/keyHint/keyLabel.d.ts.map +1 -1
- package/dist/src/keyHint/keyLabel.js +3 -2
- package/dist/src/lineDiff/diff.d.ts +6 -3
- package/dist/src/lineDiff/diff.d.ts.map +1 -1
- package/dist/src/lineDiff/diff.js +40 -28
- package/dist/src/lineDiff/patch.d.ts.map +1 -1
- package/dist/src/lineDiff/patch.js +18 -13
- package/dist/src/linkState/linkState.d.ts.map +1 -1
- package/dist/src/linkState/linkState.js +1 -7
- package/dist/src/menu/slip.js +2 -2
- package/dist/src/meter/meter.d.ts.map +1 -1
- package/dist/src/meter/meter.js +22 -17
- package/dist/src/notice/notice.d.ts +2 -0
- package/dist/src/notice/notice.d.ts.map +1 -1
- package/dist/src/notice/notice.js +2 -1
- package/dist/src/passwordField/passwordField.d.ts.map +1 -1
- package/dist/src/passwordField/passwordField.js +3 -7
- package/dist/src/rail/rail.d.ts +17 -3
- package/dist/src/rail/rail.d.ts.map +1 -1
- package/dist/src/rail/rail.js +6 -6
- package/dist/src/reel/layout.d.ts +9 -5
- package/dist/src/reel/layout.d.ts.map +1 -1
- package/dist/src/reel/layout.js +11 -5
- package/dist/src/reel/reel.d.ts.map +1 -1
- package/dist/src/reel/reel.js +122 -68
- package/dist/src/scheme/scheme.d.ts +1 -1
- package/dist/src/scheme/scheme.d.ts.map +1 -1
- package/dist/src/segmented/segmented.d.ts +0 -3
- package/dist/src/segmented/segmented.d.ts.map +1 -1
- package/dist/src/segmented/segmented.js +1 -6
- package/dist/src/selectField/selectField.d.ts.map +1 -1
- package/dist/src/selectField/selectField.js +3 -10
- package/dist/src/sortable/index.d.ts +1 -1
- package/dist/src/sortable/index.d.ts.map +1 -1
- package/dist/src/sortable/index.js +1 -1
- package/dist/src/sortable/sortable.d.ts +39 -40
- package/dist/src/sortable/sortable.d.ts.map +1 -1
- package/dist/src/sortable/sortable.js +14 -31
- package/dist/src/stack/stack.d.ts +1 -1
- package/dist/src/stack/stack.d.ts.map +1 -1
- package/dist/src/stack/stack.js +1 -1
- package/dist/src/tabs/tabs.d.ts +1 -1
- package/dist/src/tabs/tabs.d.ts.map +1 -1
- package/dist/src/tabs/tabs.js +1 -1
- package/dist/src/textareaField/textareaField.d.ts.map +1 -1
- package/dist/src/textareaField/textareaField.js +3 -7
- package/dist/src/time/time.d.ts.map +1 -1
- package/dist/src/time/time.js +4 -2
- package/dist/src/tips/index.d.ts +1 -1
- package/dist/src/tips/index.d.ts.map +1 -1
- package/dist/src/toast/index.d.ts +1 -1
- package/dist/src/toast/index.d.ts.map +1 -1
- package/dist/src/toast/toast.d.ts +5 -5
- package/dist/src/toast/toast.d.ts.map +1 -1
- package/dist/src/toast/toast.js +1 -6
- package/dist/src/toolbar/toolbar.d.ts +0 -3
- package/dist/src/toolbar/toolbar.d.ts.map +1 -1
- package/dist/src/toolbar/toolbar.js +1 -2
- package/package.json +1 -1
- package/src/adapters/mermaid.ts +0 -24
- package/src/announcer/announcer.ts +13 -17
- package/src/board/board.ts +32 -80
- package/src/board/index.ts +1 -1
- package/src/button/button.ts +1 -1
- package/src/commandPalette/commandPalette.ts +21 -38
- package/src/commandPalette/keys.ts +2 -4
- package/src/commandPalette/match.ts +3 -3
- package/src/confirmDialog/confirmDialog.ts +5 -3
- package/src/copyButton/copyButton.ts +2 -5
- package/src/crumbs/crumbs.ts +2 -4
- package/src/dialog/dialog.ts +3 -2
- package/src/drag/drag.ts +54 -5
- package/src/field/field.ts +29 -7
- package/src/fieldset/fieldset.ts +2 -4
- package/src/fileTree/fileTree.ts +10 -12
- package/src/inlineInput/inlineInput.ts +11 -2
- package/src/keyHelp/index.ts +0 -1
- package/src/keyHelp/keyHelp.ts +3 -9
- package/src/keyHint/keyLabel.ts +5 -2
- package/src/lineDiff/diff.ts +70 -54
- package/src/lineDiff/patch.ts +27 -14
- package/src/linkState/linkState.ts +1 -8
- package/src/menu/slip.ts +2 -2
- package/src/meter/meter.ts +25 -15
- package/src/notice/notice.ts +2 -1
- package/src/passwordField/passwordField.ts +3 -7
- package/src/pixel-paper.css +82 -131
- package/src/rail/rail.ts +8 -6
- package/src/reel/layout.ts +14 -7
- package/src/reel/reel.ts +132 -63
- package/src/scheme/scheme.ts +1 -1
- package/src/segmented/segmented.ts +1 -9
- package/src/selectField/selectField.ts +3 -10
- package/src/sortable/index.ts +0 -1
- package/src/sortable/sortable.ts +35 -54
- package/src/stack/stack.ts +1 -1
- package/src/tabs/tabs.ts +1 -1
- package/src/textareaField/textareaField.ts +3 -7
- package/src/time/time.ts +6 -7
- package/src/tips/index.ts +1 -1
- package/src/toast/index.ts +1 -1
- package/src/toast/toast.ts +2 -8
- package/src/tokens.css +6 -0
- package/src/toolbar/toolbar.ts +0 -5
- package/dist/src/inlineInput/inline.d.ts +0 -6
- package/dist/src/inlineInput/inline.d.ts.map +0 -1
- package/dist/src/inlineInput/inline.js +0 -7
- package/src/inlineInput/inline.ts +0 -13
package/src/tabs/tabs.ts
CHANGED
|
@@ -40,7 +40,7 @@ export type OutMessage = typeof OutMessage.Type;
|
|
|
40
40
|
* document; each tab's and panel's id derives from it. */
|
|
41
41
|
export type InitConfig = Readonly<{ id: string }>;
|
|
42
42
|
|
|
43
|
-
/** Creates a tab strip. Arrows select as they move
|
|
43
|
+
/** Creates a tab strip. Arrows select as they move. */
|
|
44
44
|
export const init = (config: InitConfig): Model => ({
|
|
45
45
|
tabs: UiTabs.init({ id: config.id, activationMode: "Automatic" }),
|
|
46
46
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Textarea as UiTextarea } from "@foldkit/ui";
|
|
2
2
|
import type { ChildAttribute, Html, HtmlBuilder, TextareaAttribute } from "foldkit/html";
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { controlAttributes, errorView, helpView } from "../field/field.ts";
|
|
5
5
|
|
|
6
6
|
// VIEW
|
|
7
7
|
|
|
@@ -59,17 +59,13 @@ export const view = <Message>(config: ViewConfig<Message>, h: HtmlBuilder<Messag
|
|
|
59
59
|
[h.Class(`field${isMono ? " mono" : ""}`)],
|
|
60
60
|
[
|
|
61
61
|
h.label(groups.label, [label]),
|
|
62
|
-
// NOTE: @foldkit/ui gap: Textarea has no required option, so the wrapper says it.
|
|
63
62
|
h.textarea([
|
|
64
63
|
...textareaAttributes,
|
|
65
64
|
...groups.textarea,
|
|
66
|
-
...
|
|
67
|
-
...(isRequired ? [h.AriaRequired(true)] : []),
|
|
65
|
+
...controlAttributes(id, error, help, isRequired, h),
|
|
68
66
|
]),
|
|
69
67
|
...errorView(id, error, h),
|
|
70
|
-
...(help
|
|
71
|
-
? []
|
|
72
|
-
: [h.p([...groups.description, h.Class("field-help")], [help])]),
|
|
68
|
+
...helpView(help, groups.description, h),
|
|
73
69
|
],
|
|
74
70
|
),
|
|
75
71
|
},
|
package/src/time/time.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Clock, Duration,
|
|
1
|
+
import { Clock, Duration, Match, Option, Schedule, Schema, Stream } from "effect";
|
|
2
2
|
import type { Html, HtmlBuilder } from "foldkit/html";
|
|
3
3
|
import type { EntryWithoutKeepAlive } from "foldkit/subscription";
|
|
4
4
|
|
|
@@ -127,10 +127,9 @@ export const clockEntry = <Model, Message>(
|
|
|
127
127
|
dependenciesSchema: Schema.Struct({ isActive: Schema.Boolean }),
|
|
128
128
|
modelToDependencies: (model) => ({ isActive: config.isActive(model) }),
|
|
129
129
|
dependenciesToStream: ({ isActive }) =>
|
|
130
|
-
|
|
131
|
-
Stream.fromEffectSchedule(Clock.currentTimeMillis, Schedule.spaced(TICK)).pipe(
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
),
|
|
130
|
+
isActive
|
|
131
|
+
? Stream.fromEffectSchedule(Clock.currentTimeMillis, Schedule.spaced(TICK)).pipe(
|
|
132
|
+
Stream.map(config.toMessage),
|
|
133
|
+
)
|
|
134
|
+
: Stream.empty,
|
|
136
135
|
});
|
package/src/tips/index.ts
CHANGED
package/src/toast/index.ts
CHANGED
|
@@ -13,6 +13,6 @@ export {
|
|
|
13
13
|
update,
|
|
14
14
|
view,
|
|
15
15
|
} from "./toast.ts";
|
|
16
|
-
export type { InitConfig, ShowConfig
|
|
16
|
+
export type { InitConfig, ShowConfig } from "./toast.ts";
|
|
17
17
|
export type { Action, Tone } from "./stack.ts";
|
|
18
18
|
export { Focus } from "../focus/focus.ts";
|
package/src/toast/toast.ts
CHANGED
|
@@ -295,7 +295,7 @@ const oldestCalm = (model: Model): Option.Option<Stack.Entry> => {
|
|
|
295
295
|
|
|
296
296
|
/** What `show` returns: the next Model and Commands, and the new slip's id, to take it back
|
|
297
297
|
* with `dismiss`. */
|
|
298
|
-
|
|
298
|
+
type ShowReturn = Update.Return<Model, Message> & Readonly<{ entryId: string }>;
|
|
299
299
|
|
|
300
300
|
const spoken = (config: ShowConfig): string =>
|
|
301
301
|
config.body === undefined ? `${config.title}.` : `${config.title}. ${config.body}`;
|
|
@@ -350,17 +350,11 @@ export const dismiss = (model: Model, entryId: string): StepReturn =>
|
|
|
350
350
|
|
|
351
351
|
// VIEW
|
|
352
352
|
|
|
353
|
-
const TONE_CLASS: Record<Tone, string> = {
|
|
354
|
-
Ok: "notice toast ok",
|
|
355
|
-
Error: "notice toast error",
|
|
356
|
-
Quiet: "notice toast quiet",
|
|
357
|
-
};
|
|
358
|
-
|
|
359
353
|
const slipView = (entry: Stack.Entry, h: HtmlBuilder<Message>): Html => {
|
|
360
354
|
const { tone, title, maybeBody, maybeAction } = entry.payload;
|
|
361
355
|
|
|
362
356
|
return h.div(
|
|
363
|
-
[h.Class(TONE_CLASS[tone])],
|
|
357
|
+
[h.Class(`notice toast${Notice.TONE_CLASS[tone]}`)],
|
|
364
358
|
[
|
|
365
359
|
Notice.toneGlyphView({ tone }, h),
|
|
366
360
|
h.div([], [h.strong([], [title]), ...Option.toArray(maybeBody)]),
|
package/src/tokens.css
CHANGED
|
@@ -81,6 +81,11 @@
|
|
|
81
81
|
conic-gradient(at 1px 1px, #0000 75%, var(--dither-dot) 0) 0 0 / 4px 4px,
|
|
82
82
|
conic-gradient(at 1px 1px, #0000 75%, var(--dither-dot) 0) 2px 2px / 4px 4px, var(--dither-base);
|
|
83
83
|
|
|
84
|
+
/* ---------- colour: fades ---------- */
|
|
85
|
+
--fade-on-ink: 0.75; /* what prints muted on paper, printed in paper on an inverted fill */
|
|
86
|
+
--fade-held: 0.6; /* a held control on an ink title bar */
|
|
87
|
+
--fade-dragged: 0.4; /* a held item, dimmed in place while its copy follows the pointer */
|
|
88
|
+
|
|
84
89
|
/* ---------- type: three families ---------- */
|
|
85
90
|
--font-px: "Departure Mono", ui-monospace, Menlo, Monaco, monospace;
|
|
86
91
|
--font-body: system-ui, "Helvetica Neue", Helvetica, Arial, sans-serif;
|
|
@@ -147,6 +152,7 @@
|
|
|
147
152
|
|
|
148
153
|
/* ---------- the bench: a page whose work is the window ---------- */
|
|
149
154
|
--bench-work-min: 152px; /* the least of its height the work keeps: a 120px pane, 16px gutters */
|
|
155
|
+
--bench-head-min: 64px; /* the least of its head a short window keeps: its padding and a small button */
|
|
150
156
|
|
|
151
157
|
/* ---------- charts ---------- */
|
|
152
158
|
--chart-plot: 160px; /* a line chart's plot, between its top line and its axis */
|
package/src/toolbar/toolbar.ts
CHANGED
|
@@ -4,7 +4,6 @@ import type { Html, HtmlBuilder } from "foldkit/html";
|
|
|
4
4
|
import { defineMessageUnion } from "foldkit/message";
|
|
5
5
|
import * as Mount from "foldkit/mount";
|
|
6
6
|
|
|
7
|
-
import type { Attributes } from "../attributes/attributes.ts";
|
|
8
7
|
import { isPlain } from "../keys/keys.ts";
|
|
9
8
|
|
|
10
9
|
// MODEL
|
|
@@ -172,8 +171,6 @@ export type ViewConfig<ParentMessage> = Readonly<{
|
|
|
172
171
|
* Scene, resolve the Mount by name with the lifted Message:
|
|
173
172
|
* `Scene.Mount.resolve({ name: Toolbar.BindToolKeys.name }, toParentMessage(Toolbar.Message.MovedToolFocus({ move })))`. */
|
|
174
173
|
toParentMessage: (message: Message) => ParentMessage;
|
|
175
|
-
/** Further attributes for the toolbar, never a class. */
|
|
176
|
-
attributes?: Attributes<ParentMessage>;
|
|
177
174
|
}>;
|
|
178
175
|
|
|
179
176
|
/** A strip of tools that is one stop for Tab (`role="toolbar"`, named by its label, with its
|
|
@@ -189,12 +186,10 @@ export const view = <ParentMessage>(
|
|
|
189
186
|
orientation = "Horizontal",
|
|
190
187
|
isFloating = false,
|
|
191
188
|
toParentMessage,
|
|
192
|
-
attributes = [],
|
|
193
189
|
} = config;
|
|
194
190
|
|
|
195
191
|
return h.div(
|
|
196
192
|
[
|
|
197
|
-
...attributes,
|
|
198
193
|
h.Role("toolbar"),
|
|
199
194
|
h.AriaLabel(label),
|
|
200
195
|
h.AriaOrientation(orientation === "Vertical" ? "vertical" : "horizontal"),
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Option } from "effect";
|
|
2
|
-
/** What Enter or leaving an inline field writes: the draft trimmed, or none (an untouched
|
|
3
|
-
* draft, so an edit made elsewhere to `value` is never overwritten; an empty one; or the
|
|
4
|
-
* text it replaces). */
|
|
5
|
-
export declare const toWrite: (maybeDraft: Option.Option<string>, value: string) => Option.Option<string>;
|
|
6
|
-
//# sourceMappingURL=inline.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"inline.d.ts","sourceRoot":"","sources":["../../../src/inlineInput/inline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,QAAQ,CAAC;AAI9C;;yBAEyB;AACzB,eAAO,MAAM,OAAO,eAAgB,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,SAAS,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,MAAM,CAK5F,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
|
|
2
|
-
import { Option, String, pipe } from "effect";
|
|
3
|
-
// RULES
|
|
4
|
-
/** What Enter or leaving an inline field writes: the draft trimmed, or none (an untouched
|
|
5
|
-
* draft, so an edit made elsewhere to `value` is never overwritten; an empty one; or the
|
|
6
|
-
* text it replaces). */
|
|
7
|
-
export const toWrite = (maybeDraft, value) => __foldkitBrandViewResult((pipe(maybeDraft, Option.map(String.trim), Option.filter((text) => __foldkitBrandViewResult((String.isNonEmpty(text) && text !== value), "@gjermundgaraba-designs/pixel-paper/src/inlineInput/inline.js#anonymous")))), "@gjermundgaraba-designs/pixel-paper/src/inlineInput/inline.js#toWrite");
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Option, String, pipe } from "effect";
|
|
2
|
-
|
|
3
|
-
// RULES
|
|
4
|
-
|
|
5
|
-
/** What Enter or leaving an inline field writes: the draft trimmed, or none (an untouched
|
|
6
|
-
* draft, so an edit made elsewhere to `value` is never overwritten; an empty one; or the
|
|
7
|
-
* text it replaces). */
|
|
8
|
-
export const toWrite = (maybeDraft: Option.Option<string>, value: string): Option.Option<string> =>
|
|
9
|
-
pipe(
|
|
10
|
-
maybeDraft,
|
|
11
|
-
Option.map(String.trim),
|
|
12
|
-
Option.filter((text) => String.isNonEmpty(text) && text !== value),
|
|
13
|
-
);
|