@newtone-dev/ui-react-web 0.43.0 → 0.44.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 (229) hide show
  1. package/dist/app-frame/app-frame.css +16 -67
  2. package/dist/app-frame/control/control.d.ts +1 -0
  3. package/dist/app-frame/control/control.d.ts.map +1 -1
  4. package/dist/app-frame/control/control.js +3 -2
  5. package/dist/app-frame/control/control.js.map +1 -1
  6. package/dist/app-frame/launcher/launcher.d.ts +6 -2
  7. package/dist/app-frame/launcher/launcher.d.ts.map +1 -1
  8. package/dist/app-frame/launcher/launcher.js +12 -11
  9. package/dist/app-frame/launcher/launcher.js.map +1 -1
  10. package/dist/app-frame/main-menu/main-menu.js +2 -2
  11. package/dist/app-frame/main-menu/main-menu.js.map +1 -1
  12. package/dist/app-frame/menu/menu.d.ts +1 -0
  13. package/dist/app-frame/menu/menu.d.ts.map +1 -1
  14. package/dist/app-frame/menu/menu.js +3 -1
  15. package/dist/app-frame/menu/menu.js.map +1 -1
  16. package/dist/app-frame/parts.d.ts +3 -1
  17. package/dist/app-frame/parts.d.ts.map +1 -1
  18. package/dist/app-frame/parts.js +12 -4
  19. package/dist/app-frame/parts.js.map +1 -1
  20. package/dist/ask-button/ask-button.css +37 -0
  21. package/dist/ask-button/ask-button.d.ts +24 -0
  22. package/dist/ask-button/ask-button.d.ts.map +1 -0
  23. package/dist/ask-button/ask-button.js +19 -0
  24. package/dist/ask-button/ask-button.js.map +1 -0
  25. package/dist/ask-button/index.d.ts +3 -0
  26. package/dist/ask-button/index.d.ts.map +1 -0
  27. package/dist/ask-button/index.js +2 -0
  28. package/dist/ask-button/index.js.map +1 -0
  29. package/dist/badge/badge.css +44 -0
  30. package/dist/badge/badge.d.ts +16 -0
  31. package/dist/badge/badge.d.ts.map +1 -0
  32. package/dist/badge/badge.js +15 -0
  33. package/dist/badge/badge.js.map +1 -0
  34. package/dist/badge/index.d.ts +3 -0
  35. package/dist/badge/index.d.ts.map +1 -0
  36. package/dist/badge/index.js +2 -0
  37. package/dist/badge/index.js.map +1 -0
  38. package/dist/below/below.css +8 -10
  39. package/dist/below/below.d.ts +3 -4
  40. package/dist/below/below.d.ts.map +1 -1
  41. package/dist/below/below.js +10 -52
  42. package/dist/below/below.js.map +1 -1
  43. package/dist/below/grip.d.ts +20 -0
  44. package/dist/below/grip.d.ts.map +1 -0
  45. package/dist/below/grip.js +78 -0
  46. package/dist/below/grip.js.map +1 -0
  47. package/dist/canvas/box/box.d.ts +9 -2
  48. package/dist/canvas/box/box.d.ts.map +1 -1
  49. package/dist/canvas/box/box.js +2 -2
  50. package/dist/canvas/box/box.js.map +1 -1
  51. package/dist/canvas/canvas.css +105 -34
  52. package/dist/canvas/canvas.d.ts +9 -2
  53. package/dist/canvas/canvas.d.ts.map +1 -1
  54. package/dist/canvas/canvas.js +19 -6
  55. package/dist/canvas/canvas.js.map +1 -1
  56. package/dist/canvas/cells/cells.d.ts +3 -3
  57. package/dist/canvas/cells/cells.js +10 -9
  58. package/dist/canvas/cells/cells.js.map +1 -1
  59. package/dist/canvas/cells/grid.d.ts +32 -0
  60. package/dist/canvas/cells/grid.d.ts.map +1 -1
  61. package/dist/canvas/cells/grid.js +93 -1
  62. package/dist/canvas/cells/grid.js.map +1 -1
  63. package/dist/canvas/dock/dock.d.ts +6 -1
  64. package/dist/canvas/dock/dock.d.ts.map +1 -1
  65. package/dist/canvas/dock/dock.js +19 -3
  66. package/dist/canvas/dock/dock.js.map +1 -1
  67. package/dist/canvas/frame/frame.d.ts.map +1 -1
  68. package/dist/canvas/frame/frame.js +1 -7
  69. package/dist/canvas/frame/frame.js.map +1 -1
  70. package/dist/canvas/index.d.ts +2 -1
  71. package/dist/canvas/index.d.ts.map +1 -1
  72. package/dist/canvas/index.js.map +1 -1
  73. package/dist/canvas/insert/insert.d.ts +18 -0
  74. package/dist/canvas/insert/insert.d.ts.map +1 -0
  75. package/dist/canvas/insert/insert.js +40 -0
  76. package/dist/canvas/insert/insert.js.map +1 -0
  77. package/dist/canvas/pin/pin.d.ts.map +1 -1
  78. package/dist/canvas/pin/pin.js +2 -1
  79. package/dist/canvas/pin/pin.js.map +1 -1
  80. package/dist/chat/chat.css +2 -7
  81. package/dist/chat/chat.d.ts +5 -3
  82. package/dist/chat/chat.d.ts.map +1 -1
  83. package/dist/chat/chat.js +17 -24
  84. package/dist/chat/chat.js.map +1 -1
  85. package/dist/data-grid/data-grid.css +128 -0
  86. package/dist/data-grid/data-grid.d.ts +45 -0
  87. package/dist/data-grid/data-grid.d.ts.map +1 -0
  88. package/dist/data-grid/data-grid.js +50 -0
  89. package/dist/data-grid/data-grid.js.map +1 -0
  90. package/dist/data-grid/index.d.ts +3 -0
  91. package/dist/data-grid/index.d.ts.map +1 -0
  92. package/dist/data-grid/index.js +2 -0
  93. package/dist/data-grid/index.js.map +1 -0
  94. package/dist/discover/discover.css +60 -0
  95. package/dist/discover/discover.d.ts +33 -0
  96. package/dist/discover/discover.d.ts.map +1 -0
  97. package/dist/discover/discover.js +13 -0
  98. package/dist/discover/discover.js.map +1 -0
  99. package/dist/discover/index.d.ts +4 -0
  100. package/dist/discover/index.d.ts.map +1 -0
  101. package/dist/discover/index.js +3 -0
  102. package/dist/discover/index.js.map +1 -0
  103. package/dist/file-grid/file-grid.css +5 -0
  104. package/dist/file-grid/file-grid.d.ts +9 -2
  105. package/dist/file-grid/file-grid.d.ts.map +1 -1
  106. package/dist/file-grid/file-grid.js +5 -4
  107. package/dist/file-grid/file-grid.js.map +1 -1
  108. package/dist/floating-bar/floating-bar.css +20 -1
  109. package/dist/floating-bar/floating-bar.d.ts +16 -1
  110. package/dist/floating-bar/floating-bar.d.ts.map +1 -1
  111. package/dist/floating-bar/floating-bar.js +51 -46
  112. package/dist/floating-bar/floating-bar.js.map +1 -1
  113. package/dist/floating-bar/menu.d.ts +1 -0
  114. package/dist/floating-bar/menu.d.ts.map +1 -1
  115. package/dist/floating-bar/menu.js +12 -1
  116. package/dist/floating-bar/menu.js.map +1 -1
  117. package/dist/font-picker/font-picker.css +39 -0
  118. package/dist/font-picker/font-picker.d.ts +29 -0
  119. package/dist/font-picker/font-picker.d.ts.map +1 -0
  120. package/dist/font-picker/font-picker.js +119 -0
  121. package/dist/font-picker/font-picker.js.map +1 -0
  122. package/dist/font-picker/index.d.ts +3 -0
  123. package/dist/font-picker/index.d.ts.map +1 -0
  124. package/dist/font-picker/index.js +2 -0
  125. package/dist/font-picker/index.js.map +1 -0
  126. package/dist/hint/hint.css +55 -0
  127. package/dist/hint/hint.d.ts +33 -0
  128. package/dist/hint/hint.d.ts.map +1 -0
  129. package/dist/hint/hint.js +80 -0
  130. package/dist/hint/hint.js.map +1 -0
  131. package/dist/hint/index.d.ts +4 -0
  132. package/dist/hint/index.d.ts.map +1 -0
  133. package/dist/hint/index.js +3 -0
  134. package/dist/hint/index.js.map +1 -0
  135. package/dist/index.d.ts +27 -3
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +12 -0
  138. package/dist/index.js.map +1 -1
  139. package/dist/inspector/inspector.css +27 -0
  140. package/dist/inspector/inspector.d.ts +12 -1
  141. package/dist/inspector/inspector.d.ts.map +1 -1
  142. package/dist/inspector/inspector.js +6 -3
  143. package/dist/inspector/inspector.js.map +1 -1
  144. package/dist/look-picker/index.d.ts +3 -0
  145. package/dist/look-picker/index.d.ts.map +1 -0
  146. package/dist/look-picker/index.js +2 -0
  147. package/dist/look-picker/index.js.map +1 -0
  148. package/dist/look-picker/look-picker.css +90 -0
  149. package/dist/look-picker/look-picker.d.ts +40 -0
  150. package/dist/look-picker/look-picker.d.ts.map +1 -0
  151. package/dist/look-picker/look-picker.js +82 -0
  152. package/dist/look-picker/look-picker.js.map +1 -0
  153. package/dist/look-thumb/index.d.ts +3 -0
  154. package/dist/look-thumb/index.d.ts.map +1 -0
  155. package/dist/look-thumb/index.js +2 -0
  156. package/dist/look-thumb/index.js.map +1 -0
  157. package/dist/look-thumb/look-thumb.css +7 -0
  158. package/dist/look-thumb/look-thumb.d.ts +27 -0
  159. package/dist/look-thumb/look-thumb.d.ts.map +1 -0
  160. package/dist/look-thumb/look-thumb.js +15 -0
  161. package/dist/look-thumb/look-thumb.js.map +1 -0
  162. package/dist/material/index.d.ts +3 -0
  163. package/dist/material/index.d.ts.map +1 -0
  164. package/dist/material/index.js +2 -0
  165. package/dist/material/index.js.map +1 -0
  166. package/dist/material/material.css +306 -0
  167. package/dist/material/material.d.ts +43 -0
  168. package/dist/material/material.d.ts.map +1 -0
  169. package/dist/material/material.js +27 -0
  170. package/dist/material/material.js.map +1 -0
  171. package/dist/on-media/on-media.css +6 -6
  172. package/dist/prompt-field/index.d.ts +3 -0
  173. package/dist/prompt-field/index.d.ts.map +1 -0
  174. package/dist/prompt-field/index.js +2 -0
  175. package/dist/prompt-field/index.js.map +1 -0
  176. package/dist/prompt-field/prompt-field.css +203 -0
  177. package/dist/prompt-field/prompt-field.d.ts +72 -0
  178. package/dist/prompt-field/prompt-field.d.ts.map +1 -0
  179. package/dist/prompt-field/prompt-field.js +91 -0
  180. package/dist/prompt-field/prompt-field.js.map +1 -0
  181. package/dist/quick-action/index.d.ts +1 -1
  182. package/dist/quick-action/index.d.ts.map +1 -1
  183. package/dist/quick-action/quick-action.css +60 -17
  184. package/dist/quick-action/quick-action.d.ts +34 -28
  185. package/dist/quick-action/quick-action.d.ts.map +1 -1
  186. package/dist/quick-action/quick-action.js +25 -21
  187. package/dist/quick-action/quick-action.js.map +1 -1
  188. package/dist/row-list/row-list.css +3 -0
  189. package/dist/seed-color-field/index.d.ts +3 -0
  190. package/dist/seed-color-field/index.d.ts.map +1 -0
  191. package/dist/seed-color-field/index.js +2 -0
  192. package/dist/seed-color-field/index.js.map +1 -0
  193. package/dist/seed-color-field/seed-color-field.css +105 -0
  194. package/dist/seed-color-field/seed-color-field.d.ts +36 -0
  195. package/dist/seed-color-field/seed-color-field.d.ts.map +1 -0
  196. package/dist/seed-color-field/seed-color-field.js +103 -0
  197. package/dist/seed-color-field/seed-color-field.js.map +1 -0
  198. package/dist/skeleton/index.d.ts +3 -0
  199. package/dist/skeleton/index.d.ts.map +1 -0
  200. package/dist/skeleton/index.js +2 -0
  201. package/dist/skeleton/index.js.map +1 -0
  202. package/dist/skeleton/skeleton.css +84 -0
  203. package/dist/skeleton/skeleton.d.ts +50 -0
  204. package/dist/skeleton/skeleton.d.ts.map +1 -0
  205. package/dist/skeleton/skeleton.js +25 -0
  206. package/dist/skeleton/skeleton.js.map +1 -0
  207. package/dist/slide-list/index.d.ts +1 -1
  208. package/dist/slide-list/index.d.ts.map +1 -1
  209. package/dist/slide-list/slide-list.css +259 -22
  210. package/dist/slide-list/slide-list.d.ts +78 -1
  211. package/dist/slide-list/slide-list.d.ts.map +1 -1
  212. package/dist/slide-list/slide-list.js +264 -18
  213. package/dist/slide-list/slide-list.js.map +1 -1
  214. package/dist/split/split.css +8 -10
  215. package/dist/thread/thread.css +7 -39
  216. package/dist/thread/thread.d.ts.map +1 -1
  217. package/dist/thread/thread.js +44 -45
  218. package/dist/thread/thread.js.map +1 -1
  219. package/dist/tile-picker/tile-picker.css +18 -0
  220. package/dist/tile-picker/tile-picker.d.ts +12 -2
  221. package/dist/tile-picker/tile-picker.d.ts.map +1 -1
  222. package/dist/tile-picker/tile-picker.js +19 -4
  223. package/dist/tile-picker/tile-picker.js.map +1 -1
  224. package/dist/workbench/workbench.css +55 -16
  225. package/dist/workbench/workbench.d.ts +7 -2
  226. package/dist/workbench/workbench.d.ts.map +1 -1
  227. package/dist/workbench/workbench.js +8 -2
  228. package/dist/workbench/workbench.js.map +1 -1
  229. package/package.json +61 -1
@@ -19,18 +19,28 @@ export interface SlideListSection {
19
19
  slides: SlideListSlide[];
20
20
  folded?: boolean;
21
21
  hidden?: boolean;
22
+ /**
23
+ * Slides at the first level after the sections before it (2026-11-11, Slides: a section made of some slides leaves
24
+ * the ones after it where they were): no header, never folded, renamed or moved as one; `name` is not shown.
25
+ */
26
+ bare?: boolean;
22
27
  }
23
28
  /** What the deck holds, top to bottom: slides before the first section, then the sections. */
24
29
  export type SlideListItem = SlideListSlide | SlideListSection;
25
30
  /**
26
31
  * A move. Slides (`ids`, top to bottom) go into `section` (null: the top, before the first section), at `index` among
27
32
  * the slides that stay there once they are taken out. A section goes to `index` among the other sections.
33
+ * With `copy` (Option held as they are let go, 2026-11-09), copies of the slides go there and the slides stay: `index`
34
+ * is then among every slide there. With `after` (2026-11-11), `section` is null and the slides go to the first level
35
+ * right after that section, in a run of their own (no first-level slides stood there yet).
28
36
  */
29
37
  export type SlideListMove = {
30
38
  kind: 'slides';
31
39
  ids: string[];
32
40
  section: string | null;
33
41
  index: number;
42
+ copy?: boolean;
43
+ after?: string;
34
44
  } | {
35
45
  kind: 'section';
36
46
  id: string;
@@ -47,6 +57,9 @@ export interface SlideListLabels {
47
57
  unfold: string;
48
58
  addSlide: string;
49
59
  addSection: string;
60
+ /** In a slide's menu: "New slide", "New section". Without, `addSlide` and `addSection`. */
61
+ newSlide?: string;
62
+ newSection?: string;
50
63
  /** A slide's number, as a screen reader hears it before its name: "Slide 3". */
51
64
  slide: (number: number) => string;
52
65
  /** A slide's `count`, as a screen reader hears it after its name: "2 comments". */
@@ -69,16 +82,80 @@ export interface SlideListProps extends Omit<HTMLAttributes<HTMLDivElement>, 'ch
69
82
  onFold?: (id: string, folded: boolean) => void;
70
83
  /** A slide or a section renamed. */
71
84
  onRename?: (id: string, name: string) => void;
85
+ /**
86
+ * A slide or a section whose name is typed into as soon as it is in the list (2026-11-11: a section just dropped).
87
+ * Enter or leaving keeps the name typed, Escape the one it has. Each new value starts it once.
88
+ */
89
+ naming?: string | null;
72
90
  onAdd?: (what: 'slide' | 'section') => void;
73
91
  /** Which adders it shows under the list; both unless said (a list of templates has no sections); none, no row for them. */
74
92
  adds?: readonly ('slide' | 'section')[];
93
+ /** What a slide's menu adds, at the top of it (2026-11-09); both unless said. */
94
+ menuAdds?: readonly ('slide' | 'section')[];
95
+ /**
96
+ * What labels each slide (2026-11-11): its `number` beside the picture (the default), or its `name` under it, no
97
+ * number (a list of templates, whose order says nothing). Narrow, `name` is the name alone.
98
+ */
99
+ caption?: 'number' | 'name';
100
+ /**
101
+ * Something added in the gap under a slide (2026-11-09): pointed at, the gap shows an accent line; held there a
102
+ * moment, a + whose menu adds a slide or a section there. `after` the slide over the gap, `before` the one under it
103
+ * in the same section (null: none). Without it, the gaps are plain.
104
+ */
105
+ onInsert?: (at: {
106
+ after: string;
107
+ before: string | null;
108
+ }, what: 'slide' | 'section') => void;
75
109
  /** What is chosen, removed (Delete): slides, or the section whose menu it was. */
76
110
  onRemove?: (ids: string[]) => void;
111
+ /**
112
+ * Something new being placed (2026-11-10, Slides' foot bar): a blank slide or a section follows the pointer and the
113
+ * landing line shows where it would go between the slides; a press there drops it (`onPlace`). Escape, or a press
114
+ * anywhere else that is not a control, gives it up (`onPlaceCancel`); a press on a control is left to that control.
115
+ */
116
+ placing?: 'slide' | 'section' | null;
117
+ /**
118
+ * Where it was dropped: in `section` (null: the top, before the first section), at `index` among its slides,
119
+ * before the slide `before` (null: at that container's end). A section dropped there starts at `before`.
120
+ */
121
+ onPlace?: (at: SlideListPlace) => void;
122
+ onPlaceCancel?: () => void;
123
+ /**
124
+ * Another place it may be dropped, outside the list (2026-11-11, Slides' main area): whether a point's element is
125
+ * in it. Over it the ghost shows it would land; a press there (not on a control in it) drops it (`onPlaceOutside`),
126
+ * and the consumer decides where in the deck it goes.
127
+ */
128
+ placeOutside?: (el: Element) => boolean;
129
+ onPlaceOutside?: (what: 'slide' | 'section') => void;
130
+ }
131
+ /** Where something placed was dropped (`onPlace`). */
132
+ export interface SlideListPlace {
133
+ what: 'slide' | 'section';
134
+ section: string | null;
135
+ index: number;
136
+ before: string | null;
137
+ /** At the first level right after this section (2026-11-11), where no first-level slides stood yet. */
138
+ after?: string;
77
139
  }
78
140
  /**
79
141
  * A deck's slides in sections, top to bottom, each seen as a picture of itself: chosen, dragged to another place
80
142
  * (slides between sections, sections with their slides), folded, hidden, renamed, added and removed. The consumer
81
143
  * keeps the deck and is told each change. Blueprint components/slide-list.md.
82
144
  */
83
- export declare function SlideList({ label, labels, items, chosen, onChoose, onMove, onToggle, onFold, onRename, onAdd, adds, onRemove, className, ...rest }: SlideListProps): import("react").JSX.Element;
145
+ export declare function SlideList({ label, labels, items, chosen, onChoose, onMove, onToggle, onFold, onRename, naming, onAdd, menuAdds, caption, onInsert, adds, onRemove, placing, onPlace, onPlaceCancel, placeOutside, onPlaceOutside, className, ...rest }: SlideListProps): import("react").JSX.Element;
146
+ export declare namespace SlideList {
147
+ export { SlideListLoading as Loading };
148
+ }
149
+ export interface SlideListLoadingProps {
150
+ /** What is arriving, said once: "Loading slides". */
151
+ label: string;
152
+ /** How many slides to draw: the deck's count when known, else a few. */
153
+ count?: number;
154
+ }
155
+ /**
156
+ * The list while its deck arrives (components/skeleton.md): numbered rows whose thumbnails are skeletons, where the
157
+ * slides will be, so nothing moves when they come.
158
+ */
159
+ declare function SlideListLoading({ label, count }: SlideListLoadingProps): import("react").JSX.Element;
160
+ export {};
84
161
  //# sourceMappingURL=slide-list.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"slide-list.d.ts","sourceRoot":"","sources":["../../src/slide-list/slide-list.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAS,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,EAMH,KAAK,cAAc,EAInB,KAAK,SAAS,EACjB,MAAM,OAAO,CAAA;AAKd,8EAA8E;AAC9E,MAAM,WAAW,cAAc;IAC3B,EAAE,EAAE,MAAM,CAAA;IACV,4FAA4F;IAC5F,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,6GAA6G;IAC7G,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,qHAAqH;IACrH,MAAM,CAAC,EAAE,WAAW,EAAE,CAAA;CACzB;AAED,mDAAmD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AI,CAAA;IACtB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,uGAAuG;IACvG,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAwBD;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,EACtB,KAAK,EACL,MAAM,EACN,KAAK,EACL,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,MAAa,EACb,KAAK,EACL,QAA+B,EAC/B,OAAkB,EAClB,QAAQ,EACR,IAA2B,EAC3B,QAAQ,EACR,OAAc,EACd,OAAO,EACP,aAAa,EACb,YAAY,EACZ,cAAc,EACd,SAAS,EACT,GAAG,IAAI,EACV,EAAE,cAAc,+BA0tBhB;yBAlvBe,SAAS;aAkzBL,gBAAgB;;AAhCpC,MAAM,WAAW,qBAAqB;IAClC,qDAAqD;IACrD,KAAK,EAAE,MAAM,CAAA;IACb,wEAAwE;IACxE,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED;;;GAGG;AACH,iBAAS,gBAAgB,CAAC,EAAE,KAAK,EAAE,KAAS,EAAE,EAAE,qBAAqB,+BAmBpE"}
@@ -1,10 +1,17 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Faces } from '../faces/faces.js';
4
4
  import { useEffect, useLayoutEffect, useMemo, useRef, useState, } from 'react';
5
5
  import { Icon } from '../icon/icon.js';
6
+ import { Badge } from '../badge/badge.js';
6
7
  import { Text } from '../text/text.js';
7
8
  import { PopMenuRows, usePopMenu } from '../floating-bar/menu.js';
9
+ import { Skeleton } from '../skeleton/skeleton.js';
10
+ // Over a named section's last row (its last slide, or its header when folded), below this share of its height, or past
11
+ // the list's end, what is dragged lands at the first level after the section, not in it (2026-11-11).
12
+ const OUT = 0.7;
13
+ // How far from a slide's edge, in px, the dot in the gap there starts to grow toward the line.
14
+ const NEAR = 48;
8
15
  const isSection = (i) => 'slides' in i;
9
16
  // How far a mouse moves before a press becomes a drag, in CSS pixels; how long a finger holds still first, in ms;
10
17
  // how near an edge a drag scrolls the list, in CSS pixels. The same numbers as LayerList's, so the two feel alike.
@@ -18,20 +25,22 @@ const NARROW = 160;
18
25
  * (slides between sections, sections with their slides), folded, hidden, renamed, added and removed. The consumer
19
26
  * keeps the deck and is told each change. Blueprint components/slide-list.md.
20
27
  */
21
- export function SlideList({ label, labels, items, chosen, onChoose, onMove, onToggle, onFold, onRename, onAdd, adds = ['slide', 'section'], onRemove, className, ...rest }) {
28
+ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onToggle, onFold, onRename, naming = null, onAdd, menuAdds = ['slide', 'section'], caption = 'number', onInsert, adds = ['slide', 'section'], onRemove, placing = null, onPlace, onPlaceCancel, placeOutside, onPlaceOutside, className, ...rest }) {
22
29
  const loose = useMemo(() => items.filter((i) => !isSection(i)), [items]);
23
30
  const sections = useMemo(() => items.filter(isSection), [items]);
24
31
  const rows = useMemo(() => {
25
32
  const out = [];
26
33
  let number = 0;
27
34
  for (const s of loose)
28
- out.push({ type: 'slide', slide: s, section: null, hidden: !!s.hidden, number: ++number });
35
+ out.push({ type: 'slide', slide: s, section: null, top: true, hidden: !!s.hidden, number: ++number });
29
36
  sections.forEach((section, order) => {
30
- out.push({ type: 'section', section, order });
37
+ // A bare run has no header: its slides stand at the first level.
38
+ if (!section.bare)
39
+ out.push({ type: 'section', section, order });
31
40
  for (const s of section.slides) {
32
41
  number++;
33
- if (!section.folded)
34
- out.push({ type: 'slide', slide: s, section: section.id, hidden: !!s.hidden || !!section.hidden, number });
42
+ if (section.bare || !section.folded)
43
+ out.push({ type: 'slide', slide: s, section: section.id, top: !!section.bare, hidden: !!s.hidden || !!section.hidden, number });
35
44
  }
36
45
  });
37
46
  return out;
@@ -43,9 +52,21 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
43
52
  const rowEls = useRef([]);
44
53
  const [focus, setFocus] = useState(0);
45
54
  const [renaming, setRenaming] = useState(null);
55
+ // `naming` starts a rename once, when the row it names is there.
56
+ const named = useRef(null);
57
+ useEffect(() => {
58
+ if (!naming || named.current === naming || !onRename)
59
+ return;
60
+ if (!rows.some((r) => (r.type === 'slide' ? r.slide.id : r.section.id) === naming))
61
+ return;
62
+ named.current = naming;
63
+ setRenaming(naming);
64
+ }, [naming, rows, onRename]);
46
65
  const [dragging, setDragging] = useState(null);
47
66
  const [landing, setLandingState] = useState(null);
48
67
  const dragRef = useRef(null);
68
+ // Option held while slides are dragged: they will be copied, not moved (2026-11-09).
69
+ const [copying, setCopying] = useState(false);
49
70
  const landingRef = useRef(null);
50
71
  const startDrag = (d) => {
51
72
  dragRef.current = d;
@@ -89,14 +110,18 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
89
110
  }
90
111
  return null;
91
112
  };
92
- // While dragging near the top or bottom edge, the list scrolls by itself.
113
+ // While dragging near the top or bottom edge, the list scrolls by itself. Something being placed comes from outside
114
+ // the list (its foot bar stands over the list's foot): it scrolls only once the pointer has been over the list away
115
+ // from both edges, and while it is over the list.
116
+ const armed = useRef(false);
117
+ const overList = useRef(false);
93
118
  useEffect(() => {
94
119
  if (!dragging)
95
120
  return;
96
121
  let frame = 0;
97
122
  const step = () => {
98
123
  const box = scroller();
99
- if (box) {
124
+ if (box && (!placing || (armed.current && overList.current))) {
100
125
  const r = box.getBoundingClientRect();
101
126
  const y = pointerY.current;
102
127
  if (y < r.top + EDGE)
@@ -110,6 +135,99 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
110
135
  return () => cancelAnimationFrame(frame);
111
136
  // eslint-disable-next-line react-hooks/exhaustive-deps
112
137
  }, [dragging]);
138
+ // Placing (2026-11-10): a drag of nothing, so the landings are the gaps between slides; the ghost follows the pointer.
139
+ const [ghost, setGhost] = useState(null);
140
+ const placeRef = useRef(null);
141
+ // Over the other place it may be dropped (placeOutside): the ghost says it would land there.
142
+ const [outside, setOutside] = useState(false);
143
+ useEffect(() => {
144
+ if (!placing)
145
+ return;
146
+ armed.current = false;
147
+ overList.current = false;
148
+ startDrag({ kind: 'slides', ids: [] });
149
+ // Over the list itself (not its foot bar, not past its scroller's edges).
150
+ const inList = (x, y) => {
151
+ const el = document.elementFromPoint(x, y);
152
+ return !!el && !!list.current?.contains(el);
153
+ };
154
+ const CONTROL = 'button, [role="button"], a, input, textarea, select, [role="menuitem"]';
155
+ const inOutside = (el) => !!el && !list.current?.contains(el) && !el.closest(CONTROL) && !!placeRef.current.placeOutside?.(el);
156
+ // The press that dropped it outside: its release and click go nowhere else either.
157
+ let droppedOutside = false;
158
+ const moved = (e) => {
159
+ pointerY.current = e.clientY;
160
+ setGhost({ x: e.clientX, y: e.clientY });
161
+ const over = inList(e.clientX, e.clientY);
162
+ overList.current = over;
163
+ setOutside(!over && inOutside(document.elementFromPoint(e.clientX, e.clientY)));
164
+ const box = scroller() ?? list.current;
165
+ if (over && box) {
166
+ const r = box.getBoundingClientRect();
167
+ if (e.clientY > r.top + EDGE && e.clientY < r.bottom - EDGE)
168
+ armed.current = true;
169
+ }
170
+ const l = over ? placeRef.current.landingAt(e.clientY) : null;
171
+ // A section starts between slides: never inside a section's header.
172
+ setLanding(l && placeRef.current.placing === 'section' && l.kind === 'slides' && l.how === 'inside' ? null : l);
173
+ };
174
+ const pressed = (e) => {
175
+ const t = e.target;
176
+ if (t && list.current?.contains(t)) {
177
+ e.preventDefault();
178
+ e.stopPropagation();
179
+ const l = landingRef.current;
180
+ const m = l ? placeRef.current.moveOf(l) : null;
181
+ if (l && l.kind === 'slides' && m && m.kind === 'slides')
182
+ placeRef.current.onPlace?.({ what: placeRef.current.placing ?? 'slide', section: l.section, index: m.index, before: l.before, ...(m.after ? { after: m.after } : {}) });
183
+ return;
184
+ }
185
+ if (t?.closest(CONTROL))
186
+ return;
187
+ if (inOutside(t)) {
188
+ e.preventDefault();
189
+ e.stopPropagation();
190
+ droppedOutside = true;
191
+ placeRef.current.onPlaceOutside?.(placeRef.current.placing ?? 'slide');
192
+ return;
193
+ }
194
+ placeRef.current.onPlaceCancel?.();
195
+ };
196
+ // The release of the press that dropped it chooses nothing.
197
+ const swallow = (e) => {
198
+ const t = e.target;
199
+ if ((t && list.current?.contains(t)) || droppedOutside) {
200
+ e.preventDefault();
201
+ e.stopPropagation();
202
+ if (e.type === 'click')
203
+ droppedOutside = false;
204
+ }
205
+ };
206
+ const key = (e) => {
207
+ if (e.key === 'Escape') {
208
+ e.preventDefault();
209
+ placeRef.current.onPlaceCancel?.();
210
+ }
211
+ };
212
+ addEventListener('pointermove', moved, true);
213
+ addEventListener('pointerdown', pressed, true);
214
+ addEventListener('pointerup', swallow, true);
215
+ addEventListener('click', swallow, true);
216
+ addEventListener('keydown', key, true);
217
+ return () => {
218
+ removeEventListener('pointermove', moved, true);
219
+ removeEventListener('pointerdown', pressed, true);
220
+ removeEventListener('pointerup', swallow, true);
221
+ removeEventListener('click', swallow, true);
222
+ removeEventListener('keydown', key, true);
223
+ startDrag(null);
224
+ setLanding(null);
225
+ setGhost(null);
226
+ setOutside(false);
227
+ };
228
+ // Started and ended by `placing` alone; what it calls is read through placeRef.
229
+ // eslint-disable-next-line react-hooks/exhaustive-deps
230
+ }, [placing]);
113
231
  // The slides a drag of `id` carries: everything chosen when it is chosen, else itself; top to bottom.
114
232
  const carried = (id) => (chosen.includes(id) ? order.filter((s) => chosen.includes(s.id)).map((s) => s.id) : [id]);
115
233
  // The slide after `id` in its container that is not moving, or null at the end.
@@ -118,6 +236,23 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
118
236
  const i = list_.findIndex((s) => s.id === id);
119
237
  return list_.slice(i + 1).find((s) => !moving.includes(s.id))?.id ?? null;
120
238
  };
239
+ // The named section whose last row is row `i`: its last slide, or its header when folded.
240
+ const endOf = (i) => {
241
+ const row = rows[i];
242
+ if (row.type === 'section')
243
+ return row.section.folded && !row.section.bare ? row.section.id : null;
244
+ if (row.top || row.section === null)
245
+ return null;
246
+ const next = rows[i + 1];
247
+ return next?.type === 'slide' && next.section === row.section ? null : row.section;
248
+ };
249
+ // At the first level right after section `id`: the start of the bare run there, or a run of its own.
250
+ const outOf = (id, row, moving) => {
251
+ const next = sections[sections.findIndex((x) => x.id === id) + 1];
252
+ if (next?.bare)
253
+ return { kind: 'slides', section: next.id, before: next.slides.find((s) => !moving.includes(s.id))?.id ?? null, row, how: 'after' };
254
+ return { kind: 'slides', section: null, before: null, row, how: 'after', after: id };
255
+ };
121
256
  // The landing under a point.
122
257
  const landingAt = (y) => {
123
258
  const dragging = dragRef.current;
@@ -133,7 +268,13 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
133
268
  continue;
134
269
  const row = rows[i];
135
270
  const lower = (y - r.top) / r.height >= 0.5;
271
+ // A section being placed over a slide (2026-11-11): anywhere on it, the section starts at that slide.
272
+ if (dragging.kind === 'slides' && placeRef.current?.placing === 'section' && row.type === 'slide' && y >= r.top && y <= r.bottom)
273
+ return { kind: 'slides', section: row.section, before: row.slide.id, row: i, how: 'before' };
136
274
  if (dragging.kind === 'slides') {
275
+ const out = endOf(i);
276
+ if (out && (y - r.top) / r.height >= OUT)
277
+ return outOf(out, i, dragging.ids);
137
278
  if (row.type === 'section')
138
279
  return { kind: 'slides', section: row.section.id, before: row.section.slides.find((s) => !dragging.ids.includes(s.id))?.id ?? null, row: i, how: 'inside' };
139
280
  if (!lower)
@@ -153,13 +294,14 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
153
294
  return { kind: 'section', index: k, row: i, how: 'before' };
154
295
  // After the section: the line under its last row drawn.
155
296
  let end = i;
156
- while (end + 1 < rows.length && rows[end + 1].type === 'slide')
297
+ // Its own rows only: a bare run after it is not part of it.
298
+ for (let nx = rows[end + 1]; nx?.type === 'slide' && nx.section === owner; nx = rows[end + 1])
157
299
  end++;
158
300
  return { kind: 'section', index: k + 1, row: end, how: 'after' };
159
301
  }
160
302
  return null;
161
303
  };
162
- const moveOf = (l) => {
304
+ const moveOf = (l, copy = false) => {
163
305
  const dragging = dragRef.current;
164
306
  if (!dragging)
165
307
  return null;
@@ -167,12 +309,20 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
167
309
  return { kind: 'section', id: dragging.id, index: l.index };
168
310
  if (dragging.kind !== 'slides' || l.kind !== 'slides')
169
311
  return null;
312
+ if (l.after)
313
+ return { kind: 'slides', ids: dragging.ids, section: null, index: 0, after: l.after, ...(copy ? { copy: true } : {}) };
314
+ if (copy) {
315
+ const all = slidesOf(l.section);
316
+ const at = l.before === null ? all.length : all.findIndex((s) => s.id === l.before);
317
+ return { kind: 'slides', ids: dragging.ids, section: l.section, index: Math.max(0, at), copy: true };
318
+ }
170
319
  const staying = slidesOf(l.section).filter((s) => !dragging.ids.includes(s.id));
171
320
  const index = l.before === null ? staying.length : staying.findIndex((s) => s.id === l.before);
172
321
  return { kind: 'slides', ids: dragging.ids, section: l.section, index: Math.max(0, index) };
173
322
  };
323
+ placeRef.current = { placing, onPlace, onPlaceCancel, placeOutside, onPlaceOutside, moveOf, landingAt };
174
324
  const down = (id, section) => (e) => {
175
- if (e.button !== 0 || renaming)
325
+ if (e.button !== 0 || renaming || placing)
176
326
  return;
177
327
  const touch = e.pointerType === 'touch';
178
328
  press.current = { id, section, x: e.clientX, y: e.clientY, pointer: e.pointerId, touch };
@@ -205,6 +355,7 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
205
355
  startDrag(p.section ? { kind: 'section', id: p.id } : { kind: 'slides', ids: carried(p.id) });
206
356
  }
207
357
  setLanding(landingAt(e.clientY));
358
+ setCopying(e.altKey && dragRef.current?.kind === 'slides');
208
359
  };
209
360
  const up = (e) => {
210
361
  const p = press.current;
@@ -214,11 +365,12 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
214
365
  press.current = null;
215
366
  if (dragRef.current) {
216
367
  const l = landingRef.current;
217
- const m = l && e.type === 'pointerup' ? moveOf(l) : null;
368
+ const m = l && e.type === 'pointerup' ? moveOf(l, e.altKey) : null;
218
369
  if (m)
219
370
  onMove?.(m);
220
371
  startDrag(null);
221
372
  setLanding(null);
373
+ setCopying(false);
222
374
  return;
223
375
  }
224
376
  if (e.type === 'pointerup' && !p.section)
@@ -319,8 +471,13 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
319
471
  const [menuFor, setMenuFor] = useState(null);
320
472
  const itemsOf = (row) => {
321
473
  const hidden = row.type === 'slide' ? !!row.slide.hidden : !!row.section.hidden;
474
+ // On a slide (Joshua 2026-11-09): add a slide or a section there first, as the adders under the list would.
475
+ const adding = row.type === 'slide' && onAdd
476
+ ? menuAdds.map((what) => ({ id: `add-${what}`, label: what === 'slide' ? (labels.newSlide ?? labels.addSlide) : (labels.newSection ?? labels.addSection), icon: what === 'slide' ? 'add_box' : 'segment' }))
477
+ : [];
322
478
  return [
323
- { id: 'rename', label: labels.rename, icon: 'edit' },
479
+ ...adding,
480
+ { id: 'rename', label: labels.rename, icon: 'edit', divided: adding.length > 0 },
324
481
  ...(onToggle ? [{ id: 'hide', label: hidden ? labels.show : labels.hide, icon: hidden ? 'visibility' : 'visibility_off' }] : []),
325
482
  { id: 'remove', label: labels.remove, icon: 'delete' },
326
483
  ];
@@ -345,6 +502,65 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
345
502
  else
346
503
  openMenu(i, x, y);
347
504
  };
505
+ // The gap's + (2026-11-09): its own menu, by the + pressed.
506
+ const insertAt = useRef(null);
507
+ const insertMenu = usePopMenu('below', 'menu', insertAt);
508
+ const [insertFor, setInsertFor] = useState(null);
509
+ // A press anywhere in the gap opens it, the + grown or not (Joshua 2026-11-09: a press often comes before the +),
510
+ // primary or secondary; the menu stands under where the + is.
511
+ const openInsert = (after, before) => (e) => {
512
+ e.preventDefault();
513
+ e.stopPropagation();
514
+ const r = e.currentTarget.getBoundingClientRect();
515
+ const show = () => {
516
+ // Open, the gap is 40px (60px with its 10px reach either side) with the 28px + on its middle: the menu under
517
+ // the +, wherever the gap stood when pressed.
518
+ setInsertFor({ after, before, x: r.left + r.width / 2 - 14, y: r.top + 30 + 14 });
519
+ insertMenu.show();
520
+ };
521
+ // Where the secondary press opens a menu on the press (macOS), the release would put it away again: it opens
522
+ // once the button is let go, as a row's menu does.
523
+ if (e.type === 'contextmenu' && e.buttons)
524
+ addEventListener('pointerup', () => setTimeout(show), { once: true, capture: true });
525
+ else
526
+ show();
527
+ };
528
+ // How near the pointer is to each gap (Joshua 2026-11-09): over a slide, the gap by the edge it is near grows its dot
529
+ // toward the line, 0 at NEAR px from the edge and more, 1 at the edge; in a gap, 1. Set on the gaps' style, so no
530
+ // render follows the pointer.
531
+ const nearBy = (e) => {
532
+ if (!onInsert)
533
+ return;
534
+ const near = new Map();
535
+ const t = e.target;
536
+ const inGap = t.closest('.newtone-slide-list-gap');
537
+ if (inGap)
538
+ near.set(inGap, 1);
539
+ else {
540
+ const row = t.closest('.newtone-slide-list-slide');
541
+ const pic = row?.querySelector('.newtone-slide-list-picture');
542
+ if (row && pic) {
543
+ const r = pic.getBoundingClientRect();
544
+ const under = pic.querySelector('.newtone-slide-list-gap');
545
+ const before = row.previousElementSibling?.matches('.newtone-slide-list-slide') ? row.previousElementSibling.querySelector('.newtone-slide-list-gap') : null;
546
+ if (under)
547
+ near.set(under, Math.max(0, Math.min(1, 1 - (r.bottom - e.clientY) / NEAR)));
548
+ if (before)
549
+ near.set(before, Math.max(0, Math.min(1, 1 - (e.clientY - r.top) / NEAR)));
550
+ }
551
+ }
552
+ e.currentTarget.querySelectorAll('.newtone-slide-list-gap').forEach((g) => g.style.setProperty('--_near', String(near.get(g) ?? 0)));
553
+ };
554
+ const nearNone = (e) => {
555
+ e.currentTarget.querySelectorAll('.newtone-slide-list-gap').forEach((g) => g.style.setProperty('--_near', '0'));
556
+ };
557
+ const inserted = (id) => {
558
+ const f = insertFor;
559
+ insertMenu.done(() => {
560
+ if (f)
561
+ onInsert?.({ after: f.after, before: f.before }, id === 'section' ? 'section' : 'slide');
562
+ });
563
+ };
348
564
  const picked = (id) => {
349
565
  const f = menuFor;
350
566
  if (!f)
@@ -355,7 +571,11 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
355
571
  if (!row)
356
572
  return;
357
573
  const rowId = row.type === 'slide' ? row.slide.id : row.section.id;
358
- if (id === 'rename')
574
+ if (id === 'add-slide')
575
+ onAdd?.('slide');
576
+ else if (id === 'add-section')
577
+ onAdd?.('section');
578
+ else if (id === 'rename')
359
579
  setRenaming(rowId);
360
580
  else if (id === 'hide')
361
581
  onToggle?.(rowId, 'hidden');
@@ -370,21 +590,39 @@ export function SlideList({ label, labels, items, chosen, onChoose, onMove, onTo
370
590
  rowEls.current[i]?.focus();
371
591
  };
372
592
  const lineOf = (i) => (landing && landing.row === i && landing.how !== 'inside' ? landing.how : undefined);
593
+ // The named section landed in, if any: tinted whole, its header to its last slide; the line inset as its slides.
594
+ const landIn = landing?.kind === 'slides' && !landing.after && landing.section !== null && !sections.find((x) => x.id === landing.section)?.bare ? landing.section : null;
595
+ const rowOwner = (r) => (r.type === 'section' ? r.section.id : r.section);
596
+ const inOf = (i) => {
597
+ if (!landIn || rowOwner(rows[i]) !== landIn)
598
+ return undefined;
599
+ const first = i === 0 || rowOwner(rows[i - 1]) !== landIn;
600
+ const last = i === rows.length - 1 || rowOwner(rows[i + 1]) !== landIn;
601
+ return first && last ? 'only' : first ? 'first' : last ? 'last' : 'middle';
602
+ };
603
+ const levelOf = (i) => (lineOf(i) ? (landIn ? 'section' : 'top') : undefined);
373
604
  const movingIds = dragging ? (dragging.kind === 'slides' ? dragging.ids : [dragging.id]) : [];
374
- return (_jsxs("div", { ref: list, className: ['newtone-slide-list', className].filter(Boolean).join(' '), "data-narrow": narrow ? '' : undefined, "data-dragging": dragging ? '' : undefined, ...rest, children: [_jsx("div", { role: "tree", "aria-label": label, "aria-multiselectable": "true", className: "newtone-slide-list-rows", onKeyDown: keys, children: rows.map((row, i) => {
605
+ return (_jsxs("div", { ref: list, className: ['newtone-slide-list', className].filter(Boolean).join(' '), "data-narrow": narrow ? '' : undefined, "data-dragging": dragging ? '' : undefined, "data-copying": copying ? '' : undefined, "data-placing": placing ?? undefined, ...rest, children: [placing && ghost ? (_jsx("span", { className: "newtone-slide-list-ghost", "data-what": placing, "data-landing": landing || outside ? '' : undefined, style: { left: ghost.x, top: ghost.y }, "aria-hidden": "true", children: placing === 'section' ? (_jsxs(_Fragment, { children: [_jsx(Icon, { name: "segment", size: "sm" }), _jsx(Text, { as: "span", scale: "body-sm", children: labels.newSection ?? labels.addSection })] })) : null })) : null, _jsx("div", { role: "tree", "aria-label": label, "aria-multiselectable": "true", className: "newtone-slide-list-rows", onKeyDown: keys, onPointerMove: nearBy, onPointerLeave: nearNone, children: rows.map((row, i) => {
375
606
  if (row.type === 'section') {
376
607
  const s = row.section;
377
608
  return (_jsxs("div", { ref: (el) => {
378
609
  rowEls.current[i] = el;
379
- }, className: "newtone-slide-list-section", role: "treeitem", "aria-level": 1, "aria-expanded": !s.folded, "aria-selected": false, tabIndex: i === at ? 0 : -1, "data-hidden": s.hidden ? '' : undefined, "data-moving": movingIds.includes(s.id) ? '' : undefined, "data-landing": landing?.row === i && landing.how === 'inside' ? '' : undefined, "data-line": lineOf(i), onFocus: () => setFocus(i), onPointerDown: down(s.id, true), onPointerMove: move, onPointerUp: up, onPointerCancel: up, onDoubleClick: () => setRenaming(s.id), onContextMenu: menuOn(i), children: [_jsx("button", { type: "button", className: "newtone-slide-list-button newtone-slide-list-fold", "aria-label": s.folded ? labels.unfold : labels.fold, title: s.folded ? labels.unfold : labels.fold, tabIndex: -1, "data-folded": s.folded ? '' : undefined, onPointerDown: (e) => e.stopPropagation(), onClick: () => onFold?.(s.id, !s.folded), children: _jsx(Icon, { name: "expand_more", size: "sm" }) }), renaming === s.id ? (_jsx(Rename, { name: s.name, label: labels.rename, onDone: renamed(s.id, s.name, i) })) : (_jsx(Text, { as: "span", scale: "body-sm", weight: "medium", className: "newtone-slide-list-name", children: s.name })), _jsx(Text, { as: "span", scale: "body-sm", tone: "secondary", figures: "tabular", children: s.slides.length })] }, s.id));
610
+ }, className: "newtone-slide-list-section", role: "treeitem", "aria-level": 1, "aria-expanded": !s.folded, "aria-selected": false, tabIndex: i === at ? 0 : -1, "data-hidden": s.hidden ? '' : undefined, "data-moving": movingIds.includes(s.id) ? '' : undefined, "data-landing": landing?.row === i && landing.how === 'inside' ? '' : undefined, "data-line": lineOf(i), "data-line-level": levelOf(i), "data-landing-in": inOf(i), onFocus: () => setFocus(i), onPointerDown: down(s.id, true), onPointerMove: move, onPointerUp: up, onPointerCancel: up, onDoubleClick: () => setRenaming(s.id), onContextMenu: menuOn(i), children: [_jsx("button", { type: "button", className: "newtone-slide-list-button newtone-slide-list-fold", "aria-label": s.folded ? labels.unfold : labels.fold, title: s.folded ? labels.unfold : labels.fold, tabIndex: -1, "data-folded": s.folded ? '' : undefined, onPointerDown: (e) => e.stopPropagation(), onClick: () => onFold?.(s.id, !s.folded), children: _jsx(Icon, { name: "expand_more", size: "sm" }) }), renaming === s.id ? (_jsx(Rename, { name: s.name, label: labels.rename, onDone: renamed(s.id, s.name, i) })) : (_jsx(Text, { as: "span", scale: "body-sm", weight: "medium", className: "newtone-slide-list-name", children: s.name })), _jsx(Text, { as: "span", scale: "body-sm", tone: "secondary", figures: "tabular", children: s.slides.length })] }, s.id));
380
611
  }
381
612
  const s = row.slide;
382
613
  const isChosen = chosen.includes(s.id);
383
614
  const name = s.name || labels.slide(row.number);
384
615
  return (_jsxs("div", { ref: (el) => {
385
616
  rowEls.current[i] = el;
386
- }, className: "newtone-slide-list-slide", role: "treeitem", "aria-level": row.section ? 2 : 1, "aria-selected": isChosen, "aria-label": [labels.slide(row.number), s.name, s.count && labels.count ? labels.count(s.count) : null, s.people?.length && labels.people ? labels.people(s.people.map((p) => p.name)) : null].filter(Boolean).join(', '), tabIndex: i === at ? 0 : -1, "data-chosen": isChosen ? '' : undefined, "data-hidden": row.hidden ? '' : undefined, "data-moving": movingIds.includes(s.id) ? '' : undefined, "data-line": lineOf(i), "data-in-section": row.section ? '' : undefined, onFocus: () => setFocus(i), onPointerDown: down(s.id, false), onPointerMove: move, onPointerUp: up, onPointerCancel: up, onContextMenu: menuOn(i), children: [_jsx(Text, { as: "span", scale: "body-sm", tone: "secondary", figures: "tabular", className: "newtone-slide-list-number", "aria-hidden": "true", children: row.number }), narrow ? (renaming === s.id ? (_jsx(Rename, { name: s.name ?? '', label: labels.rename, onDone: renamed(s.id, s.name ?? '', i) })) : (_jsx(Text, { as: "span", scale: "body-sm", className: "newtone-slide-list-name", "aria-hidden": "true", children: name }))) : (_jsxs("span", { className: "newtone-slide-list-picture", children: [_jsx("span", { className: "newtone-slide-list-thumb", "aria-hidden": "true", children: s.thumb }), row.hidden ? _jsx(Icon, { name: "visibility_off", size: "sm", tone: "secondary", className: "newtone-slide-list-hidden" }) : null, s.count ? _jsx("span", { className: "newtone-slide-list-count", "aria-hidden": "true", children: s.count > 99 ? '99+' : s.count }) : null, s.people?.length ? _jsx(Faces, { className: "newtone-slide-list-people", people: s.people, label: "", max: 3, size: "1.25rem", "aria-hidden": "true" }) : null, renaming === s.id ? (_jsx("span", { className: "newtone-slide-list-renaming", children: _jsx(Rename, { name: s.name ?? '', label: labels.rename, onDone: renamed(s.id, s.name ?? '', i) }) })) : null] }))] }, s.id));
387
- }) }), _jsx("span", { ref: menuAt, className: "newtone-slide-list-menu-at", style: menuFor ? { left: menuFor.x, top: menuFor.y } : undefined, "aria-hidden": "true" }), _jsx("div", { ...menu.menu, "aria-label": labels.more, children: menuFor && rows[menuFor.row] ? _jsx(PopMenuRows, { items: itemsOf(rows[menuFor.row]), onPick: picked }) : null }), adds.length ? _jsxs("div", { className: "newtone-slide-list-add", children: [adds.includes('slide') ? (_jsxs("button", { type: "button", className: "newtone-slide-list-adder", onClick: () => onAdd?.('slide'), children: [_jsx(Icon, { name: "add", size: "sm" }), _jsx(Text, { as: "span", scale: "body-sm", children: labels.addSlide })] })) : null, adds.includes('section') ? (_jsxs("button", { type: "button", className: "newtone-slide-list-adder", onClick: () => onAdd?.('section'), children: [_jsx(Icon, { name: "add", size: "sm" }), _jsx(Text, { as: "span", scale: "body-sm", children: labels.addSection })] })) : null] }) : null] }));
617
+ }, className: "newtone-slide-list-slide", role: "treeitem", "aria-level": row.top ? 1 : 2, "aria-selected": isChosen, "aria-label": [labels.slide(row.number), s.name, s.count && labels.count ? labels.count(s.count) : null, s.people?.length && labels.people ? labels.people(s.people.map((p) => p.name)) : null].filter(Boolean).join(', '), tabIndex: i === at ? 0 : -1, "data-chosen": isChosen ? '' : undefined, "data-hidden": row.hidden ? '' : undefined, "data-moving": movingIds.includes(s.id) ? '' : undefined, "data-line": lineOf(i), "data-line-level": levelOf(i), "data-landing-in": inOf(i), "data-in-section": row.top ? undefined : '', "data-caption": caption, onFocus: () => setFocus(i), onPointerDown: down(s.id, false), onPointerMove: move, onPointerUp: up, onPointerCancel: up, onContextMenu: menuOn(i), children: [caption === 'number' ? (_jsx(Text, { as: "span", scale: "body-sm", tone: "secondary", figures: "tabular", className: "newtone-slide-list-number", "aria-hidden": "true", children: row.number })) : null, narrow ? (renaming === s.id ? (_jsx(Rename, { name: s.name ?? '', label: labels.rename, onDone: renamed(s.id, s.name ?? '', i) })) : (_jsx(Text, { as: "span", scale: "body-sm", className: "newtone-slide-list-name", "aria-hidden": "true", children: name }))) : (_jsxs("span", { className: "newtone-slide-list-picture", children: [_jsx("span", { className: "newtone-slide-list-thumb", "aria-hidden": "true", children: s.thumb }), row.hidden ? _jsx(Icon, { name: "visibility_off", size: "sm", tone: "secondary", className: "newtone-slide-list-hidden" }) : null, s.count ? _jsx(Badge, { count: s.count }) : null, s.people?.length ? _jsx(Faces, { className: "newtone-slide-list-people", people: s.people, label: "", max: 3, size: "1.25rem", "aria-hidden": "true" }) : null, onInsert && !dragging ? (() => {
618
+ const next = rows[i + 1];
619
+ const before = next && next.type === 'slide' && next.section === row.section ? next.slide.id : null;
620
+ return (_jsx("span", { className: "newtone-slide-list-gap", "data-open": insertFor?.after === s.id && insertMenu.open ? '' : undefined, onPointerDown: (e) => e.stopPropagation(), onClick: openInsert(s.id, before), onContextMenu: openInsert(s.id, before), children: _jsx("button", { type: "button", className: "newtone-slide-list-gap-add", "aria-label": `${labels.newSlide ?? labels.addSlide} · ${labels.newSection ?? labels.addSection}`, title: labels.newSlide ?? labels.addSlide, tabIndex: -1, children: _jsx(Icon, { name: "add", size: "sm" }) }) }));
621
+ })() : null, renaming === s.id && caption === 'number' ? (_jsx("span", { className: "newtone-slide-list-renaming", children: _jsx(Rename, { name: s.name ?? '', label: labels.rename, onDone: renamed(s.id, s.name ?? '', i) }) })) : null, caption === 'name' ? (renaming === s.id ? (_jsx("span", { className: "newtone-slide-list-caption", "data-renaming": "", children: _jsx(Rename, { name: s.name ?? '', label: labels.rename, onDone: renamed(s.id, s.name ?? '', i) }) })) : (_jsx(Text, { as: "span", scale: "body-sm", className: "newtone-slide-list-name newtone-slide-list-caption", "aria-hidden": "true", children: name }))) : null] }))] }, s.id));
622
+ }) }), _jsx("span", { ref: insertAt, className: "newtone-slide-list-menu-at", style: insertFor ? { left: insertFor.x, top: insertFor.y } : undefined, "aria-hidden": "true" }), _jsx("div", { ...insertMenu.menu, "aria-label": labels.newSlide ?? labels.addSlide, children: insertFor ? (_jsx(PopMenuRows, { items: [
623
+ { id: 'slide', label: labels.newSlide ?? labels.addSlide, icon: 'add_box' },
624
+ { id: 'section', label: labels.newSection ?? labels.addSection, icon: 'segment' },
625
+ ], onPick: inserted })) : null }), _jsx("span", { ref: menuAt, className: "newtone-slide-list-menu-at", style: menuFor ? { left: menuFor.x, top: menuFor.y } : undefined, "aria-hidden": "true" }), _jsx("div", { ...menu.menu, "aria-label": labels.more, children: menuFor && rows[menuFor.row] ? _jsx(PopMenuRows, { items: itemsOf(rows[menuFor.row]), onPick: picked }) : null }), adds.length ? _jsxs("div", { className: "newtone-slide-list-add", children: [adds.includes('slide') ? (_jsxs("button", { type: "button", className: "newtone-slide-list-adder", onClick: () => onAdd?.('slide'), children: [_jsx(Icon, { name: "add", size: "sm" }), _jsx(Text, { as: "span", scale: "body-sm", children: labels.addSlide })] })) : null, adds.includes('section') ? (_jsxs("button", { type: "button", className: "newtone-slide-list-adder", onClick: () => onAdd?.('section'), children: [_jsx(Icon, { name: "add", size: "sm" }), _jsx(Text, { as: "span", scale: "body-sm", children: labels.addSection })] })) : null] }) : null] }));
388
626
  }
389
627
  // A name being changed in place: Enter or leaving keeps it, Escape drops it (null).
390
628
  function Rename({ name, label, onDone }) {
@@ -408,4 +646,12 @@ function Rename({ name, label, onDone }) {
408
646
  finish(null);
409
647
  }, onBlur: (e) => finish(e.currentTarget.value) }));
410
648
  }
649
+ /**
650
+ * The list while its deck arrives (components/skeleton.md): numbered rows whose thumbnails are skeletons, where the
651
+ * slides will be, so nothing moves when they come.
652
+ */
653
+ function SlideListLoading({ label, count = 4 }) {
654
+ return (_jsx("div", { className: "newtone-slide-list", role: "status", "aria-busy": "true", "aria-label": label, children: _jsx("div", { className: "newtone-slide-list-rows", "aria-hidden": "true", children: Array.from({ length: count }, (_, i) => (_jsxs("div", { className: "newtone-slide-list-slide", "data-loading": "", children: [_jsx(Text, { as: "span", scale: "body-sm", tone: "secondary", figures: "tabular", className: "newtone-slide-list-number", children: i + 1 }), _jsx("span", { className: "newtone-slide-list-picture", children: _jsx("span", { className: "newtone-slide-list-thumb", children: _jsx(Skeleton.Block, { radius: "none" }) }) })] }, i))) }) }));
655
+ }
656
+ SlideList.Loading = SlideListLoading;
411
657
  //# sourceMappingURL=slide-list.js.map