@gjermundgaraba-designs/pixel-paper 0.12.0 → 0.14.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.
Files changed (141) hide show
  1. package/DESIGN.md +32 -25
  2. package/dist/src/announcer/announcer.d.ts +34 -26
  3. package/dist/src/announcer/announcer.d.ts.map +1 -1
  4. package/dist/src/announcer/announcer.js +42 -32
  5. package/dist/src/announcer/index.d.ts +1 -1
  6. package/dist/src/announcer/index.d.ts.map +1 -1
  7. package/dist/src/announcer/index.js +1 -1
  8. package/dist/src/banner/banner.d.ts +1 -1
  9. package/dist/src/banner/banner.js +1 -1
  10. package/dist/src/barChart/barChart.js +1 -1
  11. package/dist/src/board/board.d.ts +1 -4
  12. package/dist/src/board/board.d.ts.map +1 -1
  13. package/dist/src/board/board.js +8 -71
  14. package/dist/src/button/button.d.ts +1 -1
  15. package/dist/src/button/button.js +1 -1
  16. package/dist/src/card/card.d.ts +35 -9
  17. package/dist/src/card/card.d.ts.map +1 -1
  18. package/dist/src/card/card.js +46 -8
  19. package/dist/src/card/index.d.ts +2 -2
  20. package/dist/src/card/index.d.ts.map +1 -1
  21. package/dist/src/card/index.js +1 -1
  22. package/dist/src/commandPalette/commandPalette.d.ts +4 -0
  23. package/dist/src/commandPalette/commandPalette.d.ts.map +1 -1
  24. package/dist/src/confirmDialog/confirmDialog.d.ts +18 -26
  25. package/dist/src/confirmDialog/confirmDialog.d.ts.map +1 -1
  26. package/dist/src/confirmDialog/confirmDialog.js +21 -19
  27. package/dist/src/confirmDialog/index.d.ts +1 -1
  28. package/dist/src/confirmDialog/index.d.ts.map +1 -1
  29. package/dist/src/confirmDialog/index.js +1 -1
  30. package/dist/src/contextMenu/contextMenu.d.ts +6 -6
  31. package/dist/src/dialog/dialog.d.ts +36 -7
  32. package/dist/src/dialog/dialog.d.ts.map +1 -1
  33. package/dist/src/dialog/dialog.js +32 -12
  34. package/dist/src/dialog/index.d.ts +1 -1
  35. package/dist/src/dialog/index.d.ts.map +1 -1
  36. package/dist/src/dialog/index.js +1 -1
  37. package/dist/src/drag/drag.d.ts +40 -0
  38. package/dist/src/drag/drag.d.ts.map +1 -0
  39. package/dist/src/drag/drag.js +134 -0
  40. package/dist/src/emptyState/emptyState.d.ts +6 -4
  41. package/dist/src/emptyState/emptyState.d.ts.map +1 -1
  42. package/dist/src/emptyState/emptyState.js +1 -1
  43. package/dist/src/errorSummary/errorSummary.d.ts +1 -1
  44. package/dist/src/errorSummary/errorSummary.js +1 -1
  45. package/dist/src/index.d.ts +3 -0
  46. package/dist/src/index.d.ts.map +1 -1
  47. package/dist/src/index.js +3 -0
  48. package/dist/src/keyHelp/keyHelp.d.ts +4 -0
  49. package/dist/src/keyHelp/keyHelp.d.ts.map +1 -1
  50. package/dist/src/lineChart/lineChart.js +1 -1
  51. package/dist/src/liveRegion/index.d.ts +3 -0
  52. package/dist/src/liveRegion/index.d.ts.map +1 -0
  53. package/dist/src/liveRegion/index.js +1 -0
  54. package/dist/src/liveRegion/liveRegion.d.ts +42 -0
  55. package/dist/src/liveRegion/liveRegion.d.ts.map +1 -0
  56. package/dist/src/liveRegion/liveRegion.js +35 -0
  57. package/dist/src/loading/loading.d.ts +8 -3
  58. package/dist/src/loading/loading.d.ts.map +1 -1
  59. package/dist/src/loading/loading.js +4 -3
  60. package/dist/src/menu/menu.d.ts +6 -6
  61. package/dist/src/meter/meter.d.ts +3 -0
  62. package/dist/src/meter/meter.d.ts.map +1 -1
  63. package/dist/src/meter/meter.js +6 -3
  64. package/dist/src/places/places.d.ts +15 -5
  65. package/dist/src/places/places.d.ts.map +1 -1
  66. package/dist/src/places/places.js +19 -17
  67. package/dist/src/remote/index.d.ts +3 -0
  68. package/dist/src/remote/index.d.ts.map +1 -0
  69. package/dist/src/remote/index.js +1 -0
  70. package/dist/src/remote/remote.d.ts +29 -0
  71. package/dist/src/remote/remote.d.ts.map +1 -0
  72. package/dist/src/remote/remote.js +41 -0
  73. package/dist/src/rows/index.d.ts +1 -1
  74. package/dist/src/rows/index.d.ts.map +1 -1
  75. package/dist/src/rows/rows.d.ts +24 -3
  76. package/dist/src/rows/rows.d.ts.map +1 -1
  77. package/dist/src/rows/rows.js +44 -15
  78. package/dist/src/skipLink/index.d.ts +1 -1
  79. package/dist/src/skipLink/index.d.ts.map +1 -1
  80. package/dist/src/skipLink/index.js +1 -1
  81. package/dist/src/skipLink/skipLink.d.ts +24 -8
  82. package/dist/src/skipLink/skipLink.d.ts.map +1 -1
  83. package/dist/src/skipLink/skipLink.js +27 -8
  84. package/dist/src/sortable/index.d.ts +3 -0
  85. package/dist/src/sortable/index.d.ts.map +1 -0
  86. package/dist/src/sortable/index.js +1 -0
  87. package/dist/src/sortable/sortable.d.ts +1144 -0
  88. package/dist/src/sortable/sortable.d.ts.map +1 -0
  89. package/dist/src/sortable/sortable.js +504 -0
  90. package/dist/src/toast/index.d.ts +1 -1
  91. package/dist/src/toast/index.d.ts.map +1 -1
  92. package/dist/src/toast/index.js +1 -1
  93. package/dist/src/toast/toast.d.ts +32 -20
  94. package/dist/src/toast/toast.d.ts.map +1 -1
  95. package/dist/src/toast/toast.js +8 -3
  96. package/dist/src/topBar/barHeight.d.ts +6 -0
  97. package/dist/src/topBar/barHeight.d.ts.map +1 -1
  98. package/dist/src/topBar/barHeight.js +4 -0
  99. package/dist/src/topBar/index.d.ts +1 -1
  100. package/dist/src/topBar/index.d.ts.map +1 -1
  101. package/dist/src/topBar/index.js +1 -1
  102. package/dist/src/topBar/topBar.d.ts +1 -2
  103. package/dist/src/topBar/topBar.d.ts.map +1 -1
  104. package/package.json +1 -1
  105. package/src/announcer/announcer.ts +48 -32
  106. package/src/announcer/index.ts +1 -1
  107. package/src/banner/banner.ts +1 -1
  108. package/src/barChart/barChart.ts +1 -1
  109. package/src/board/board.ts +18 -87
  110. package/src/button/button.ts +1 -1
  111. package/src/card/card.ts +120 -21
  112. package/src/card/index.ts +2 -2
  113. package/src/confirmDialog/confirmDialog.ts +25 -32
  114. package/src/confirmDialog/index.ts +2 -0
  115. package/src/dialog/dialog.ts +39 -13
  116. package/src/dialog/index.ts +3 -1
  117. package/src/drag/drag.ts +207 -0
  118. package/src/emptyState/emptyState.ts +7 -5
  119. package/src/errorSummary/errorSummary.ts +1 -1
  120. package/src/index.ts +3 -0
  121. package/src/lineChart/lineChart.ts +1 -1
  122. package/src/liveRegion/index.ts +2 -0
  123. package/src/liveRegion/liveRegion.ts +75 -0
  124. package/src/loading/loading.ts +11 -5
  125. package/src/meter/meter.ts +17 -3
  126. package/src/pixel-paper.css +197 -28
  127. package/src/places/places.ts +43 -30
  128. package/src/remote/index.ts +2 -0
  129. package/src/remote/remote.ts +76 -0
  130. package/src/rows/index.ts +1 -0
  131. package/src/rows/rows.ts +87 -22
  132. package/src/skipLink/index.ts +1 -1
  133. package/src/skipLink/skipLink.ts +38 -9
  134. package/src/sortable/index.ts +14 -0
  135. package/src/sortable/sortable.ts +857 -0
  136. package/src/toast/index.ts +1 -0
  137. package/src/toast/toast.ts +9 -3
  138. package/src/tokens.css +13 -11
  139. package/src/topBar/barHeight.ts +6 -0
  140. package/src/topBar/index.ts +1 -1
  141. package/src/topBar/topBar.ts +1 -2
@@ -7,8 +7,12 @@ export type ViewConfig = Readonly<{
7
7
  rows: ReadonlyArray<Html>;
8
8
  /** An outline: nested rows indent 26px and hang on a 1px rule guide. */
9
9
  isOutline?: boolean;
10
- /** Names the list for screen readers. */
10
+ /** Names the list for screen readers; a treegrid needs it. */
11
11
  label?: string;
12
+ /** A keyboard-driven list, whose cursor the application moves (see Keys in DESIGN.md): a
13
+ * `role="treegrid"`, so a screen reader hands it the arrow and letter keys. Give every row
14
+ * its `treegrid` place. */
15
+ isTreegrid?: boolean;
12
16
  }>;
13
17
  /** A list of 34px rows. */
14
18
  export declare const view: <Message>(config: ViewConfig, h: HtmlBuilder<Message>) => Html;
@@ -26,6 +30,19 @@ export type RowSelect<Message> = Readonly<{
26
30
  * toggles it wherever it is clicked, on the button or the link too. */
27
31
  label?: string;
28
32
  }>;
33
+ /** A row's place in a treegrid (`view`'s `isTreegrid`): its line is a `role="row"` and each
34
+ * of its parts a `role="gridcell"`, while the list items around them step aside
35
+ * (`role="none"`). */
36
+ export type TreegridPlace = Readonly<{
37
+ /** Its depth, from 1 at the list's roots: `aria-level`. */
38
+ level: number;
39
+ /** Its place among its siblings, from 1: `aria-posinset`. */
40
+ position: number;
41
+ /** How many siblings it has, itself included: `aria-setsize`. */
42
+ setSize: number;
43
+ /** Whether the rows under it show, for a row that folds: `aria-expanded`. */
44
+ isExpanded?: boolean;
45
+ }>;
29
46
  /** Configuration for rendering a row with `rowView`. */
30
47
  export type RowConfig<Message> = Readonly<{
31
48
  /** The row's stable id among its siblings. */
@@ -53,14 +70,18 @@ export type RowConfig<Message> = Readonly<{
53
70
  isContext?: boolean;
54
71
  /** Makes the row selectable: a box at its left edge. */
55
72
  select?: RowSelect<Message>;
73
+ /** The row's place in a treegrid; every row of a treegrid has one. */
74
+ treegrid?: TreegridPlace;
56
75
  /** Further attributes for the row's line, the `div.row`, not its `li`: a keyboard list's
57
76
  * cursor (`aria-current="true"`, which the stylesheet outlines, and a roving `tabindex`),
58
- * `role="group"` and a name, data attributes, key and focus handlers. Never a class. */
77
+ * its name (with `role="group"` outside a treegrid, whose row is already a named `row`), data
78
+ * attributes, key and focus handlers. Never a class. */
59
79
  attributes?: Attributes<Message>;
60
80
  }>;
61
81
  /** One 34px row: box, glyph, text, slot, actions, tools, and the rows nested under it. Hover
62
82
  * and focus tint it head. The box of a selectable row is built on `@foldkit/ui`'s Checkbox:
63
- * a `role="checkbox"` button (`aria-checked`) whose whole cell is its target. */
83
+ * a `role="checkbox"` button (`aria-checked`) whose whole cell is its target. In a treegrid
84
+ * the line is the `role="row"` and each part a `role="gridcell"`. */
64
85
  export declare const rowView: <Message>(config: RowConfig<Message>, h: HtmlBuilder<Message>) => Html;
65
86
  /** Configuration for rendering a glyph slot with `glyphView`. */
66
87
  export type GlyphConfig = Readonly<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C,OAAO,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IAStF,CAAC;AAIF,iEAAiE;AACjE,MAAM,MAAM,WAAW,GAAG,QAAQ,CAAC;IACjC,IAAI,EAAE,SAAS,CAAC;CACjB,CAAC,CAAC;AAEH,sCAAsC;AACtC,eAAO,MAAM,SAAS,GAAI,OAAO,UAAU,WAAW,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IACd,CAAC;AAErE,mEAAmE;AACnE,MAAM,MAAM,YAAY,CAAC,OAAO,IAAI,QAAQ,CAAC;IAC3C,UAAU,EAAE,OAAO,CAAC;IACpB;kDAC8C;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC,CAAC;AAEH;oDACoD;AACpD,eAAO,MAAM,UAAU,GAAI,OAAO,UAAU,YAAY,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IAgB1F,CAAC;AAIJ,kEAAkE;AAClE,MAAM,MAAM,WAAW,CAAC,OAAO,IAAI,QAAQ,CAAC;IAC1C,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,OAAO,CAAC;IAChB,mDAAmD;IACnD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB,CAAC,CAAC;AAEH;2BAC2B;AAC3B,eAAO,MAAM,SAAS,GAAI,OAAO,UAAU,WAAW,CAAC,OAAO,CAAC,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IAWxF,CAAC"}
@@ -4,41 +4,70 @@ import * as Glyph from "../glyph/glyph.js";
4
4
  import { slotView } from "../slot/slot.js";
5
5
  /** A list of 34px rows. */
6
6
  export const view = (config, h) => __foldkitBrandViewResult((h.ul([
7
+ ...(config.isTreegrid === true ? [h.Role("treegrid")] : []),
7
8
  ...(config.label === undefined ? [] : [h.AriaLabel(config.label)]),
8
9
  h.Class(config.isOutline === true ? "rows tree" : "rows"),
9
10
  ], config.rows)), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#view");
11
+ const cellRole = (config, h) => (__foldkitBrandViewResult((config.treegrid === undefined ? [] : [h.Role("gridcell")]), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#cellRole"));
12
+ const rowRole = (place, h) => __foldkitBrandViewResult((place === undefined
13
+ ? []
14
+ : [
15
+ h.Role("row"),
16
+ h.AriaLevel(place.level),
17
+ h.AriaPosinset(place.position),
18
+ h.AriaSetsize(place.setSize),
19
+ ...(place.isExpanded === undefined ? [] : [h.AriaExpanded(place.isExpanded)]),
20
+ ]), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#rowRole");
21
+ /** A part the caller gives (a glyph, the actions) in its own cell, in a treegrid. */
22
+ const cellView = (config, className, content, h) => __foldkitBrandViewResult((config.treegrid === undefined
23
+ ? content
24
+ : slotView("span", className, content, h, cellRole(config, h))), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#cellView");
10
25
  /** The row's text, with the words that say a context row is one. */
11
26
  const textOf = (config, h) => __foldkitBrandViewResult((config.isContext === true
12
27
  ? [...config.body, h.span([h.Class("sr-only")], [" (context)"])]
13
28
  : config.body), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#textOf");
14
- const lineView = (config, box, text, h) => __foldkitBrandViewResult((h.div([...(config.attributes ?? []), h.Class(config.isContext === true ? "row context" : "row")], [
29
+ const lineView = (config, box, text, h) => __foldkitBrandViewResult((h.div([
30
+ ...(config.attributes ?? []),
31
+ ...rowRole(config.treegrid, h),
32
+ h.Class(config.isContext === true ? "row context" : "row"),
33
+ ], [
15
34
  ...box,
16
- ...(config.glyph === undefined ? [] : [config.glyph]),
35
+ ...cellView(config, "cell", config.glyph === undefined ? [] : [config.glyph], h),
17
36
  text,
18
- ...slotView("span", "slot", config.slot ?? [], h, config.slotAttributes),
19
- ...(config.actions ?? []),
20
- ...slotView("span", "tools", config.tools ?? [], h),
37
+ ...slotView("span", "slot", config.slot ?? [], h, [
38
+ ...(config.slotAttributes ?? []),
39
+ ...cellRole(config, h),
40
+ ]),
41
+ ...cellView(config, "cell actions", config.actions ?? [], h),
42
+ ...slotView("span", "tools", config.tools ?? [], h, cellRole(config, h)),
21
43
  ])), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#lineView");
22
44
  const selectableLineView = (config, select, h) => __foldkitBrandViewResult((UiCheckbox.view({
23
45
  id: select.id,
24
46
  isChecked: select.isChecked,
25
47
  onToggle: select.onToggle,
26
48
  toView: (groups) => {
27
- const boxView = (name) => __foldkitBrandViewResult((h.span([h.Class("row-check")], [h.button(groups.checkbox), ...name])), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#boxView");
49
+ const boxView = (name) => __foldkitBrandViewResult((h.span([...cellRole(config, h), h.Class("row-check")], [h.button(groups.checkbox), ...name])), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#boxView");
50
+ const label = h.label([...groups.label, h.Class("grow")], textOf(config, h));
28
51
  return __foldkitBrandViewResult((select.label === undefined
29
- ? lineView(config, [boxView([])], h.label([...groups.label, h.Class("grow")], textOf(config, h)), h)
30
- : lineView(config, [boxView([h.span([...groups.label, h.Class("sr-only")], [select.label])])], h.div([h.Class("grow")], textOf(config, h)), h)), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#toView");
52
+ ? lineView(config, [boxView([])], config.treegrid === undefined
53
+ ? label
54
+ : h.span([...cellRole(config, h), h.Class("cell grow-cell")], [label]), h)
55
+ : lineView(config, [boxView([h.span([...groups.label, h.Class("sr-only")], [select.label])])], h.div([...cellRole(config, h), h.Class("grow")], textOf(config, h)), h)), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#toView");
31
56
  },
32
57
  }, h)), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#selectableLineView");
33
58
  /** One 34px row: box, glyph, text, slot, actions, tools, and the rows nested under it. Hover
34
59
  * and focus tint it head. The box of a selectable row is built on `@foldkit/ui`'s Checkbox:
35
- * a `role="checkbox"` button (`aria-checked`) whose whole cell is its target. */
36
- export const rowView = (config, h) => __foldkitBrandViewResult((h.keyed("li")(config.key, [], [
37
- config.select === undefined
38
- ? lineView(config, [], h.div([h.Class("grow")], textOf(config, h)), h)
39
- : selectableLineView(config, config.select, h),
40
- ...slotView("ul", "rows", config.nested ?? [], h),
41
- ])), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#rowView");
60
+ * a `role="checkbox"` button (`aria-checked`) whose whole cell is its target. In a treegrid
61
+ * the line is the `role="row"` and each part a `role="gridcell"`. */
62
+ export const rowView = (config, h) => {
63
+ const listRole = config.treegrid === undefined ? [] : [h.Role("none")];
64
+ return __foldkitBrandViewResult((h.keyed("li")(config.key, listRole, [
65
+ config.select === undefined
66
+ ? lineView(config, [], h.div([...cellRole(config, h), h.Class("grow")], textOf(config, h)), h)
67
+ : selectableLineView(config, config.select, h),
68
+ ...slotView("ul", "rows", config.nested ?? [], h, listRole),
69
+ ])), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#rowView");
70
+ };
42
71
  /** A glyph in the row's 18px slot. */
43
72
  export const glyphView = (config, h) => __foldkitBrandViewResult((h.span([h.Class("glyph")], [Glyph.view({ name: config.name }, h)])), "@gjermundgaraba-designs/pixel-paper/src/rows/rows.js#glyphView");
44
73
  /** The glyph slot as a fold toggle, built on `@foldkit/ui`'s Button: a ring, open or closed,
@@ -1,2 +1,2 @@
1
- export { focusFragment, view } from "./skipLink.ts";
1
+ export { ScrollToFragment, view } from "./skipLink.ts";
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skipLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/skipLink/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- export { focusFragment, view } from "./skipLink.js";
1
+ export { ScrollToFragment, view } from "./skipLink.js";
@@ -1,17 +1,33 @@
1
- import { Effect } from "effect";
1
+ import { Effect, Schema } from "effect";
2
+ import * as Command from "foldkit/command";
2
3
  import type { Html, HtmlBuilder } from "foldkit/html";
4
+ /** What `ScrollToFragment` reports. An application that runs it puts
5
+ * `CompletedScrollToFragment: {}` in its own Message union, which this tag matches. */
6
+ export declare const Message: import("foldkit/message").MessageUnion<{
7
+ readonly CompletedScrollToFragment: {};
8
+ }>;
9
+ export type Message = typeof Message.Type;
3
10
  /**
4
11
  * The first thing in the page: a link to the main landmark (`#main`, as Deck, Stage and Wall render it), hidden until it holds the
5
12
  * keyboard. A Foldkit application routes every link click through its own update, so its
6
- * fragment handler must move focus to the target as the browser would: run `focusFragment`
7
- * from the Command that handles a changed URL's fragment.
13
+ * fragment handler must move focus to the target as the browser would: return
14
+ * `ScrollToFragment` for a changed URL.
8
15
  */
9
16
  export declare const view: <Message>(h: HtmlBuilder<Message>) => Html;
17
+ /** Moves focus to the element a fragment names, making it focusable when it is not;
18
+ * `ScrollToFragment` runs it. */
19
+ export declare const focusFragment: (fragment: string) => Effect.Effect<void>;
10
20
  /**
11
- * Scrolls to the element a fragment names and moves focus to it, making it focusable
12
- * (`tabindex="-1"`) when it is not, so the next Tab continues from there: what a fragment
13
- * link does without an application in the way. Does nothing when no element has that id.
14
- * Run it from the application's own Command, as Foldkit's `Dom` Effects are run.
21
+ * What a followed link does without an application in the way, for the application's URL
22
+ * handler to return when the URL changes: with a fragment, scrolls to the element it names and
23
+ * moves focus to it, making it focusable (`tabindex="-1"`) when it is not, so the next Tab
24
+ * continues from there (nothing when no element has that id); without one, scrolls to the
25
+ * top, since Foldkit reports a link followed and a step through history as the same change, so
26
+ * a new page opens at its top either way. Reports `CompletedScrollToFragment`.
15
27
  */
16
- export declare const focusFragment: (fragment: string) => Effect.Effect<void>;
28
+ export declare const ScrollToFragment: Command.CommandDefinitionWithArgs<"ScrollToFragment", {
29
+ maybeFragment: Schema.Option<Schema.String>;
30
+ }, Effect.Effect<{
31
+ readonly _tag: "CompletedScrollToFragment";
32
+ }, never, never>>;
17
33
  //# sourceMappingURL=skipLink.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"skipLink.d.ts","sourceRoot":"","sources":["../../../src/skipLink/skipLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAItD;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IACM,CAAC;AAI/D;;;;;GAKG;AACH,eAAO,MAAM,aAAa,aAAc,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAGhE,CAAC"}
1
+ {"version":3,"file":"skipLink.d.ts","sourceRoot":"","sources":["../../../src/skipLink/skipLink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,OAAO,MAAM,iBAAiB,CAAC;AAE3C,OAAO,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAKtD;wFACwF;AACxF,eAAO,MAAM,OAAO;;EAAwD,CAAC;AAC7E,MAAM,MAAM,OAAO,GAAG,OAAO,OAAO,CAAC,IAAI,CAAC;AAI1C;;;;;GAKG;AACH,eAAO,MAAM,IAAI,GAAI,OAAO,KAAK,WAAW,CAAC,OAAO,CAAC,KAAG,IACM,CAAC;AAI/D;kCACkC;AAClC,eAAO,MAAM,aAAa,aAAc,MAAM,KAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAGhE,CAAC;AAIJ;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB;;;;iBAY3B,CAAC"}
@@ -1,19 +1,38 @@
1
1
  import { brandViewResult as __foldkitBrandViewResult } from 'foldkit/brand'
2
- import { Effect } from "effect";
2
+ import { Effect, Option, Schema } from "effect";
3
+ import * as Command from "foldkit/command";
3
4
  import * as Dom from "foldkit/dom";
5
+ import { defineMessageUnion } from "foldkit/message";
6
+ // MESSAGE
7
+ /** What `ScrollToFragment` reports. An application that runs it puts
8
+ * `CompletedScrollToFragment: {}` in its own Message union, which this tag matches. */
9
+ export const Message = defineMessageUnion({ CompletedScrollToFragment: {} });
4
10
  // VIEW
5
11
  /**
6
12
  * The first thing in the page: a link to the main landmark (`#main`, as Deck, Stage and Wall render it), hidden until it holds the
7
13
  * keyboard. A Foldkit application routes every link click through its own update, so its
8
- * fragment handler must move focus to the target as the browser would: run `focusFragment`
9
- * from the Command that handles a changed URL's fragment.
14
+ * fragment handler must move focus to the target as the browser would: return
15
+ * `ScrollToFragment` for a changed URL.
10
16
  */
11
17
  export const view = (h) => __foldkitBrandViewResult((h.a([h.Href("#main"), h.Class("skip")], ["Skip to content"])), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#view");
12
18
  // FOCUS
19
+ /** Moves focus to the element a fragment names, making it focusable when it is not;
20
+ * `ScrollToFragment` runs it. */
21
+ export const focusFragment = (fragment) => __foldkitBrandViewResult((Effect.suspend(() => __foldkitBrandViewResult((Dom.focus(`#${CSS.escape(fragment)}`, { makeFocusable: true })), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#anonymous")).pipe(Effect.ignore)), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#focusFragment");
22
+ // COMMAND
13
23
  /**
14
- * Scrolls to the element a fragment names and moves focus to it, making it focusable
15
- * (`tabindex="-1"`) when it is not, so the next Tab continues from there: what a fragment
16
- * link does without an application in the way. Does nothing when no element has that id.
17
- * Run it from the application's own Command, as Foldkit's `Dom` Effects are run.
24
+ * What a followed link does without an application in the way, for the application's URL
25
+ * handler to return when the URL changes: with a fragment, scrolls to the element it names and
26
+ * moves focus to it, making it focusable (`tabindex="-1"`) when it is not, so the next Tab
27
+ * continues from there (nothing when no element has that id); without one, scrolls to the
28
+ * top, since Foldkit reports a link followed and a step through history as the same change, so
29
+ * a new page opens at its top either way. Reports `CompletedScrollToFragment`.
18
30
  */
19
- export const focusFragment = (fragment) => __foldkitBrandViewResult((Effect.suspend(() => __foldkitBrandViewResult((Dom.focus(`#${CSS.escape(fragment)}`, { makeFocusable: true })), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#anonymous")).pipe(Effect.ignore)), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#focusFragment");
31
+ export const ScrollToFragment = Command.define("ScrollToFragment", {
32
+ args: { maybeFragment: Schema.Option(Schema.String) },
33
+ messages: [Message.CompletedScrollToFragment],
34
+ execute: ({ maybeFragment }) => __foldkitBrandViewResult((Option.match(maybeFragment, {
35
+ onNone: () => __foldkitBrandViewResult((Effect.sync(() => __foldkitBrandViewResult((window.scrollTo(0, 0)), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#anonymous~2"))), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#onNone"),
36
+ onSome: (fragment) => __foldkitBrandViewResult((Dom.scrollIntoView(`#${CSS.escape(fragment)}`).pipe(Effect.ignore, Effect.andThen(focusFragment(fragment)))), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#onSome"),
37
+ }).pipe(Effect.as(Message.CompletedScrollToFragment()))), "@gjermundgaraba-designs/pixel-paper/src/skipLink/skipLink.js#execute"),
38
+ });
@@ -0,0 +1,3 @@
1
+ export { AnnounceReorder, Item, Message, Model, OutMessage, SizeLiftedItem, init, setMovable, subscriptions, update, view, } from "./sortable.ts";
2
+ export type { InitConfig, ItemRender, Layout, ViewInputs } from "./sortable.ts";
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/sortable/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,IAAI,EACJ,OAAO,EACP,KAAK,EACL,UAAU,EACV,cAAc,EACd,IAAI,EACJ,UAAU,EACV,aAAa,EACb,MAAM,EACN,IAAI,GACL,MAAM,eAAe,CAAC;AACvB,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC"}
@@ -0,0 +1 @@
1
+ export { AnnounceReorder, Item, Message, Model, OutMessage, SizeLiftedItem, init, setMovable, subscriptions, update, view, } from "./sortable.js";