@fibrae/semi-ui-svelte 0.2.0 → 0.3.1

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 (288) hide show
  1. package/LICENSE +0 -62
  2. package/README.md +40 -38
  3. package/README.zh-CN.md +91 -0
  4. package/dist/_base/create-context.js +0 -1
  5. package/dist/_base/css-animation.js +0 -1
  6. package/dist/_base/group-role.d.ts +0 -1
  7. package/dist/_base/group-role.js +0 -1
  8. package/dist/_base/slot-kind.d.ts +0 -1
  9. package/dist/_base/slot-kind.js +0 -1
  10. package/dist/_base/teleport.d.ts +0 -2
  11. package/dist/_base/teleport.js +0 -2
  12. package/dist/_base/use-click-outside.svelte.d.ts +2 -2
  13. package/dist/_base/use-click-outside.svelte.js +2 -2
  14. package/dist/_base/use-foundation.svelte.js +2 -5
  15. package/dist/_base/virtual-list.svelte +2 -3
  16. package/dist/_base/virtual-list.svelte.d.ts +0 -1
  17. package/dist/_sortable/interface.d.ts +0 -1
  18. package/dist/anchor/interface.d.ts +0 -3
  19. package/dist/anchor/link-item.svelte +0 -1
  20. package/dist/anchor/links.d.ts +0 -1
  21. package/dist/anchor/links.js +0 -1
  22. package/dist/audio-player/audio-player.svelte +0 -2
  23. package/dist/audio-player/audio-slider.svelte +0 -3
  24. package/dist/auto-complete/auto-complete.svelte +0 -5
  25. package/dist/auto-complete/interface.d.ts +0 -9
  26. package/dist/avatar/avatar-group-more.svelte +0 -1
  27. package/dist/avatar/avatar.svelte +0 -4
  28. package/dist/avatar/context.d.ts +0 -1
  29. package/dist/avatar/interface.d.ts +0 -4
  30. package/dist/backtop/backtop.svelte +0 -2
  31. package/dist/backtop/interface.d.ts +0 -1
  32. package/dist/badge/interface.d.ts +0 -1
  33. package/dist/banner/banner.svelte +1 -1
  34. package/dist/banner/interface.d.ts +1 -3
  35. package/dist/breadcrumb/breadcrumb-item.svelte +0 -1
  36. package/dist/breadcrumb/breadcrumb.svelte +0 -1
  37. package/dist/breadcrumb/interface.d.ts +0 -7
  38. package/dist/calendar/calendar.svelte +0 -1
  39. package/dist/calendar/day-calendar.svelte +0 -3
  40. package/dist/calendar/interface.d.ts +0 -8
  41. package/dist/calendar/month-calendar.svelte +0 -4
  42. package/dist/calendar/time-grid.svelte +0 -2
  43. package/dist/calendar/time-grid.svelte.d.ts +0 -1
  44. package/dist/calendar/use-today.svelte.d.ts +0 -1
  45. package/dist/calendar/use-today.svelte.js +0 -1
  46. package/dist/card/index.js +0 -1
  47. package/dist/card/interface.d.ts +0 -3
  48. package/dist/carousel/carousel.svelte +0 -4
  49. package/dist/carousel/interface.d.ts +0 -3
  50. package/dist/cascader/cascader.svelte +0 -6
  51. package/dist/cascader/interface.d.ts +0 -19
  52. package/dist/cascader/item.svelte +0 -4
  53. package/dist/cascader/item.svelte.d.ts +0 -4
  54. package/dist/checkbox/checkbox-group.svelte +0 -3
  55. package/dist/checkbox/checkbox.svelte +0 -4
  56. package/dist/checkbox/index.js +0 -1
  57. package/dist/checkbox/interface.d.ts +0 -1
  58. package/dist/code-highlight/interface.d.ts +0 -1
  59. package/dist/collapse/collapse.svelte +0 -2
  60. package/dist/collapse/index.js +0 -1
  61. package/dist/collapse/interface.d.ts +0 -2
  62. package/dist/collapse/panel.svelte +0 -1
  63. package/dist/collapsible/collapsible.svelte +0 -2
  64. package/dist/color-picker/alpha-slider.svelte +0 -1
  65. package/dist/color-picker/color-choose-area.svelte +0 -1
  66. package/dist/color-picker/color-slider.svelte +0 -1
  67. package/dist/color-picker/data-part.svelte +0 -1
  68. package/dist/cropper/cropper.svelte +0 -1
  69. package/dist/cropper/interface.d.ts +0 -6
  70. package/dist/date-picker/date-input.svelte +0 -4
  71. package/dist/date-picker/date-picker.svelte +0 -7
  72. package/dist/date-picker/inset-input.svelte +0 -1
  73. package/dist/date-picker/interface.d.ts +0 -7
  74. package/dist/date-picker/internal.d.ts +0 -7
  75. package/dist/date-picker/month.svelte +0 -1
  76. package/dist/date-picker/months-grid.svelte +0 -6
  77. package/dist/date-picker/navigation.svelte +0 -1
  78. package/dist/descriptions/interface.d.ts +0 -1
  79. package/dist/divider/divider.svelte +0 -1
  80. package/dist/divider/interface.d.ts +0 -4
  81. package/dist/drag-move/drag-move.js +0 -1
  82. package/dist/drag-move/interface.d.ts +0 -3
  83. package/dist/dropdown/context.d.ts +0 -6
  84. package/dist/dropdown/context.js +0 -1
  85. package/dist/dropdown/dropdown-item.svelte +0 -1
  86. package/dist/dropdown/dropdown.svelte +0 -7
  87. package/dist/dropdown/interface.d.ts +0 -4
  88. package/dist/empty/empty.svelte +0 -1
  89. package/dist/empty/interface.d.ts +0 -3
  90. package/dist/feedback/feedback.svelte +0 -1
  91. package/dist/feedback/interface.d.ts +0 -8
  92. package/dist/float-button/float-button-action.svelte +0 -2
  93. package/dist/float-button/interface.d.ts +0 -2
  94. package/dist/form/array-field.svelte +0 -2
  95. package/dist/form/context.d.ts +0 -2
  96. package/dist/form/error-message.svelte +0 -1
  97. package/dist/form/field-grid.svelte +0 -2
  98. package/dist/form/field-grid.svelte.d.ts +0 -2
  99. package/dist/form/field-inner.svelte +0 -2
  100. package/dist/form/field.svelte +0 -1
  101. package/dist/form/form.svelte +0 -1
  102. package/dist/form/hooks.d.ts +1 -2
  103. package/dist/form/hooks.js +1 -2
  104. package/dist/form/interface.d.ts +0 -7
  105. package/dist/form/utils.d.ts +0 -1
  106. package/dist/form/utils.js +0 -2
  107. package/dist/highlight/interface.d.ts +0 -1
  108. package/dist/hot-keys/interface.d.ts +0 -1
  109. package/dist/image/context.d.ts +0 -1
  110. package/dist/image/footer.d.ts +0 -1
  111. package/dist/image/interface.d.ts +0 -8
  112. package/dist/image/preview-image.svelte +0 -3
  113. package/dist/image/preview-image.svelte.d.ts +0 -1
  114. package/dist/image/preview-inner.svelte +0 -3
  115. package/dist/image/preview-inner.svelte.d.ts +0 -1
  116. package/dist/input/context.d.ts +0 -1
  117. package/dist/input/interface.d.ts +0 -3
  118. package/dist/input/textarea.svelte +0 -3
  119. package/dist/input-number/input-number.svelte +0 -2
  120. package/dist/input-number/interface.d.ts +0 -1
  121. package/dist/json-viewer/interface.d.ts +0 -4
  122. package/dist/json-viewer/json-viewer.svelte +0 -3
  123. package/dist/layout/interface.d.ts +0 -2
  124. package/dist/list/interface.d.ts +0 -2
  125. package/dist/lottie/interface.d.ts +1 -1
  126. package/dist/markdown-render/code-text.js +0 -1
  127. package/dist/markdown-render/components/code.svelte +0 -1
  128. package/dist/markdown-render/components/heading.svelte +0 -1
  129. package/dist/markdown-render/components/p.svelte +0 -1
  130. package/dist/markdown-render/components/table.svelte +0 -1
  131. package/dist/markdown-render/components/tree.d.ts +0 -4
  132. package/dist/markdown-render/components/tree.js +0 -2
  133. package/dist/markdown-render/interface.d.ts +0 -1
  134. package/dist/markdown-render/markdown-children.svelte +0 -2
  135. package/dist/markdown-render/markdown-render.svelte +0 -1
  136. package/dist/markdown-render/runtime.js +0 -1
  137. package/dist/modal/confirm-modal.svelte +0 -1
  138. package/dist/modal/confirm.svelte.d.ts +0 -1
  139. package/dist/modal/confirm.svelte.js +0 -1
  140. package/dist/modal/index.js +0 -1
  141. package/dist/modal/interface.d.ts +0 -6
  142. package/dist/modal/modal-content.svelte +0 -4
  143. package/dist/modal/modal.svelte +0 -1
  144. package/dist/modal/use-show-hide.svelte.d.ts +0 -2
  145. package/dist/modal/use-show-hide.svelte.js +0 -4
  146. package/dist/navigation/context.d.ts +0 -2
  147. package/dist/navigation/index.js +0 -1
  148. package/dist/navigation/interface.d.ts +1 -17
  149. package/dist/navigation/item-shell.svelte +0 -4
  150. package/dist/navigation/item-shell.svelte.d.ts +0 -3
  151. package/dist/navigation/nav-footer.svelte +0 -2
  152. package/dist/navigation/nav-items.svelte +0 -1
  153. package/dist/navigation/nav.svelte +0 -1
  154. package/dist/navigation/sub-nav.svelte +0 -5
  155. package/dist/navigation/wrapper-outlet.svelte +0 -1
  156. package/dist/notification/context.d.ts +0 -3
  157. package/dist/notification/interface.d.ts +0 -5
  158. package/dist/notification/notice-list.svelte +0 -2
  159. package/dist/notification/notice-list.svelte.d.ts +0 -1
  160. package/dist/notification/notice.svelte +0 -2
  161. package/dist/notification/notification-list.svelte +0 -1
  162. package/dist/notification/static-api.js +0 -1
  163. package/dist/overflow-list/interface.d.ts +0 -2
  164. package/dist/overflow-list/overflow-list.svelte +0 -2
  165. package/dist/pagination/interface.d.ts +0 -1
  166. package/dist/pagination/pagination.svelte +0 -2
  167. package/dist/pagination/step-button.svelte +0 -3
  168. package/dist/pagination/step-button.svelte.d.ts +0 -1
  169. package/dist/pincode/interface.d.ts +0 -1
  170. package/dist/pincode/pincode.svelte +0 -3
  171. package/dist/popconfirm/interface.d.ts +0 -1
  172. package/dist/popconfirm/popconfirm.svelte +0 -2
  173. package/dist/popover/interface.d.ts +0 -1
  174. package/dist/popover/popover.svelte +0 -1
  175. package/dist/radio/index.js +0 -1
  176. package/dist/radio/radio-group.svelte +0 -1
  177. package/dist/radio/radio.svelte +0 -1
  178. package/dist/rating/interface.d.ts +0 -2
  179. package/dist/rating/item.svelte +0 -1
  180. package/dist/rating/rating.svelte +0 -7
  181. package/dist/resizable/interface.d.ts +0 -2
  182. package/dist/resizable/resizable.svelte +0 -1
  183. package/dist/resizable/resize-group.svelte +0 -1
  184. package/dist/resizable/resize-handler.svelte +0 -1
  185. package/dist/resize-observer/observe-resize.d.ts +1 -5
  186. package/dist/resize-observer/observe-resize.js +1 -5
  187. package/dist/scroll-list/index.js +0 -1
  188. package/dist/scroll-list/interface.d.ts +0 -2
  189. package/dist/scroll-list/scroll-item.svelte +0 -2
  190. package/dist/select/interface.d.ts +0 -14
  191. package/dist/select/option.svelte +0 -5
  192. package/dist/select/option.svelte.d.ts +0 -5
  193. package/dist/select/select.svelte +0 -14
  194. package/dist/side-sheet/interface.d.ts +0 -1
  195. package/dist/side-sheet/side-sheet.svelte +0 -9
  196. package/dist/skeleton/index.js +0 -1
  197. package/dist/skeleton/interface.d.ts +0 -2
  198. package/dist/skeleton/skeleton-item.svelte +0 -1
  199. package/dist/slider/interface.d.ts +0 -5
  200. package/dist/slider/slider.svelte +0 -7
  201. package/dist/space/interface.d.ts +0 -1
  202. package/dist/space/space.svelte +0 -1
  203. package/dist/steps/context.d.ts +0 -1
  204. package/dist/steps/interface.d.ts +0 -2
  205. package/dist/steps/step.svelte +0 -3
  206. package/dist/switch/switch.svelte +0 -2
  207. package/dist/table/body/base-row.svelte +0 -4
  208. package/dist/table/body/base-row.svelte.d.ts +0 -4
  209. package/dist/table/body/body.svelte +0 -7
  210. package/dist/table/body/body.svelte.d.ts +0 -5
  211. package/dist/table/body/expanded-row.svelte +0 -1
  212. package/dist/table/body/expanded-row.svelte.d.ts +0 -1
  213. package/dist/table/body/section-row.svelte +0 -2
  214. package/dist/table/body/section-row.svelte.d.ts +0 -2
  215. package/dist/table/column-filter-menu.svelte +0 -3
  216. package/dist/table/column-filter-menu.svelte.d.ts +0 -3
  217. package/dist/table/column-filter.svelte +0 -2
  218. package/dist/table/column-filter.svelte.d.ts +0 -2
  219. package/dist/table/column-selection.svelte +1 -2
  220. package/dist/table/column-selection.svelte.d.ts +0 -1
  221. package/dist/table/column-sorter.svelte +1 -6
  222. package/dist/table/column-sorter.svelte.d.ts +1 -6
  223. package/dist/table/context.d.ts +0 -10
  224. package/dist/table/context.js +0 -1
  225. package/dist/table/custom-expand-icon.svelte +0 -2
  226. package/dist/table/custom-expand-icon.svelte.d.ts +0 -2
  227. package/dist/table/head-table.svelte +0 -1
  228. package/dist/table/head-table.svelte.d.ts +0 -1
  229. package/dist/table/interface.d.ts +2 -21
  230. package/dist/table/table-cell.svelte +0 -7
  231. package/dist/table/table-cell.svelte.d.ts +0 -7
  232. package/dist/table/table-header-row.svelte +0 -2
  233. package/dist/table/table-header-row.svelte.d.ts +0 -2
  234. package/dist/table/table-pagination.svelte +0 -2
  235. package/dist/table/table-pagination.svelte.d.ts +0 -2
  236. package/dist/table/table.svelte +0 -5
  237. package/dist/table/utils.d.ts +1 -13
  238. package/dist/table/utils.js +1 -11
  239. package/dist/tabs/index.js +0 -1
  240. package/dist/tabs/interface.d.ts +0 -13
  241. package/dist/tabs/tab-bar.svelte +0 -3
  242. package/dist/tabs/tab-bar.svelte.d.ts +0 -1
  243. package/dist/tabs/tab-pane.svelte +0 -2
  244. package/dist/tabs/tabs.svelte +0 -1
  245. package/dist/tag-input/interface.d.ts +0 -5
  246. package/dist/tag-input/tag-input.svelte +0 -3
  247. package/dist/tag-input/tag-item.svelte +0 -1
  248. package/dist/tag-input/tag-item.svelte.d.ts +0 -1
  249. package/dist/time-picker/combobox.svelte +0 -1
  250. package/dist/time-picker/interface.d.ts +0 -9
  251. package/dist/time-picker/time-picker.svelte +0 -2
  252. package/dist/timeline/interface.d.ts +0 -4
  253. package/dist/timeline/timeline.svelte +0 -1
  254. package/dist/toast/context.d.ts +0 -2
  255. package/dist/toast/interface.d.ts +0 -2
  256. package/dist/toast/static-api.js +0 -1
  257. package/dist/toast/toast.svelte +0 -1
  258. package/dist/toast/use-toast.js +0 -1
  259. package/dist/tooltip/context.d.ts +0 -2
  260. package/dist/tooltip/interface.d.ts +0 -2
  261. package/dist/tooltip/tooltip.svelte +0 -5
  262. package/dist/transfer/interface.d.ts +1 -8
  263. package/dist/transfer/transfer-selected-item.svelte +0 -1
  264. package/dist/transfer/transfer-selected-item.svelte.d.ts +0 -1
  265. package/dist/transfer/transfer.svelte +0 -1
  266. package/dist/tree/auto-sizer.svelte +0 -1
  267. package/dist/tree/context.d.ts +0 -1
  268. package/dist/tree/interface.d.ts +0 -9
  269. package/dist/tree/node-collapsible.svelte +0 -1
  270. package/dist/tree/node-list.svelte +0 -4
  271. package/dist/tree/tree-node.svelte +0 -1
  272. package/dist/tree/tree.svelte +0 -3
  273. package/dist/tree/use-tree-keyboard.svelte.d.ts +1 -8
  274. package/dist/tree/use-tree-keyboard.svelte.js +1 -6
  275. package/dist/tree-select/interface.d.ts +0 -11
  276. package/dist/tree-select/tree-select.svelte +0 -2
  277. package/dist/typography/base.svelte +0 -2
  278. package/dist/typography/index.js +0 -1
  279. package/dist/typography/interface.d.ts +0 -1
  280. package/dist/typography/internal.d.ts +0 -2
  281. package/dist/upload/file-card.svelte +0 -1
  282. package/dist/upload/index.js +0 -1
  283. package/dist/upload/interface.d.ts +0 -4
  284. package/dist/upload/upload.svelte +0 -1
  285. package/dist/user-guide/interface.d.ts +0 -1
  286. package/dist/user-guide/user-guide.svelte +0 -1
  287. package/dist/video-player/video-progress.svelte +0 -2
  288. package/package.json +4 -4
@@ -6,7 +6,6 @@
6
6
 
7
7
  const { children, node, class: className, ...rest }: TypographyParagraphProps & MarkdownRenderElementProps = $props();
8
8
 
9
- // a div, since the image component renders one
10
9
  const component = $derived(node && containsImage(node.props.children) ? 'div' : undefined);
11
10
  </script>
12
11
 
@@ -5,7 +5,6 @@
5
5
  import MarkdownChildren from '../markdown-children.svelte';
6
6
  import { parseTable } from './tree.js';
7
7
 
8
- // the cells come from `node`, so the children snippet is dropped
9
8
  const { children: _children, node, ...rest }: TableProps & MarkdownRenderElementProps = $props();
10
9
 
11
10
  const parsed = $derived(parseTable(node?.props.children));
@@ -2,20 +2,16 @@ import type { ColumnProps } from '../../table/index.js';
2
2
  import { type MarkdownChild } from '../runtime.js';
3
3
  /** The Semi img renders a div, which a p cannot hold. Known limit: only the Semi img is detected, not a replacement. */
4
4
  export declare function containsImage(child: MarkdownChild): boolean;
5
- /** A rehype plugin may split code text into elements, which have no source text to highlight */
6
5
  export declare function isPlainText(child: MarkdownChild): boolean;
7
6
  /** CodeHighlight's div and pre may not sit inside a pre, so the wrapper of a block the Semi code highlights goes */
8
7
  export declare function isHighlightedBlock(child: MarkdownChild): boolean;
9
- /** The plain text of a subtree, through components too */
10
8
  export declare function textOf(child: MarkdownChild): string;
11
9
  export interface ParsedTable {
12
10
  columns: ColumnProps[];
13
11
  dataSource: {
14
12
  key: string;
15
13
  }[];
16
- /** Content of each header cell, by column */
17
14
  head: MarkdownChild[];
18
- /** Content of each body cell, by row and column */
19
15
  body: MarkdownChild[][];
20
16
  }
21
17
  export declare function parseTable(content: MarkdownChild): ParsedTable;
@@ -7,7 +7,6 @@ const childNodes = (child) => (Array.isArray(child) ? child : [child]).filter(is
7
7
  export function containsImage(child) {
8
8
  return childNodes(child).some((node) => node.type === Img || containsImage(node.props.children));
9
9
  }
10
- /** A rehype plugin may split code text into elements, which have no source text to highlight */
11
10
  export function isPlainText(child) {
12
11
  return Array.isArray(child) ? child.every(isPlainText) : !isNode(child);
13
12
  }
@@ -19,7 +18,6 @@ export function isHighlightedBlock(child) {
19
18
  const { type, props } = content[0];
20
19
  return type === Code && Boolean(MarkdownRenderFoundation.getCodeLanguage(props.class)) && isPlainText(props.children);
21
20
  }
22
- /** The plain text of a subtree, through components too */
23
21
  export function textOf(child) {
24
22
  if (Array.isArray(child))
25
23
  return child.map(textOf).join('');
@@ -7,7 +7,6 @@ export type MarkdownRenderComponents = Partial<{
7
7
  }> & Record<string, Component<any> | keyof SvelteHTMLElements | undefined>;
8
8
  /** Props a component in `components` receives besides the attributes of its element */
9
9
  export interface MarkdownRenderElementProps {
10
- /** The content, rendered */
11
10
  children?: Snippet;
12
11
  /**
13
12
  * The compiled element. `node.props.children` is the source tree of the content: `codeText(node.props.children)` is
@@ -3,7 +3,6 @@
3
3
  import { omitBy } from 'es-toolkit';
4
4
  import { type MarkdownChild, Fragment, isNode, voidTags } from './runtime.js';
5
5
 
6
- // The compiled tree is data, so the table component can render the cells it picks out of it with this same component.
7
6
  const { content }: { content: MarkdownChild } = $props();
8
7
 
9
8
  // the compiled `children` is a node tree, which would compete with the `children` snippet
@@ -43,7 +42,6 @@
43
42
  {/if}
44
43
  {:else}
45
44
  {@const Element = child.type as Component<any>}
46
- <!-- `node` is the compiled element: a component reads the source of its children there, which a children snippet hides -->
47
45
  {#if child.props.children === undefined}
48
46
  <Element {...child.props} node={child} />
49
47
  {:else}
@@ -52,7 +52,6 @@
52
52
  })
53
53
  );
54
54
 
55
- // An explicit role wins; a named div is a group.
56
55
  const role = $derived(rest.role ?? (rest['aria-label'] || rest['aria-labelledby'] ? 'group' : undefined));
57
56
  const renderContent = $derived(states().renderContent);
58
57
 
@@ -1,5 +1,4 @@
1
1
  export const Fragment = Symbol('MarkdownRender.Fragment');
2
- // Svelte has no JSX runtime, so the compiled source yields a plain node tree that markdown-render.svelte renders.
3
2
  function jsx(type, props) {
4
3
  // MDX hands a `components.wrapper` its content as the element `<_createMdxContent />`, a plain function that is
5
4
  // not a Svelte component; calling it yields the content tree. Known limit: relies on the name @mdx-js/mdx emits.
@@ -7,7 +7,6 @@
7
7
  import type { ConfirmProps, ModalNode } from './interface.js';
8
8
  import Modal from './modal.svelte';
9
9
 
10
- // The options Modal declares itself reach it through `...rest`
11
10
  let { type, title, content, icon, closeIcon, header, footer, direction, visible, onOk, onCancel, class: className, ...rest }: ConfirmProps = $props();
12
11
 
13
12
  const config = getConfigContext();
@@ -17,5 +17,4 @@ export declare function openConfirm({ afterClose, ...others }: ConfirmProps, { c
17
17
  close: () => void;
18
18
  };
19
19
  export default function confirm(props: ConfirmProps): ModalHookRef;
20
- /** The props of `Modal.<type>()`; ConfirmModal adds the type's icon */
21
20
  export declare function withType(type: ConfirmProps['type'], props: ModalConfirmProps): ConfirmProps;
@@ -64,7 +64,6 @@ export default function confirm(props) {
64
64
  destroyFns.push(close);
65
65
  return ref;
66
66
  }
67
- /** The props of `Modal.<type>()`; ConfirmModal adds the type's icon */
68
67
  export function withType(type, props) {
69
68
  return { type, ...resolveConfirmProps(type, props) };
70
69
  }
@@ -2,7 +2,6 @@ import confirm, { destroyAll, withType } from './confirm.svelte.js';
2
2
  import ModalBase from './modal.svelte';
3
3
  import useModal from './use-modal.js';
4
4
  const typed = (type) => (props) => confirm(withType(type, props));
5
- // Svelte components are functions, so the static methods attach to the component itself
6
5
  export const Modal = Object.assign(ModalBase, {
7
6
  useModal,
8
7
  info: typed('info'),
@@ -59,7 +59,6 @@ export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
59
59
  onCancel?: (event: MouseEvent | KeyboardEvent) => unknown;
60
60
  /** A returned Promise keeps the ok button loading until it settles; closing is the caller's job. */
61
61
  onOk?: (event: MouseEvent) => unknown;
62
- /** Plain text or a snippet. */
63
62
  title?: string | Snippet;
64
63
  /** A snippet replaces the default header (title, icon, close button); null renders no header. */
65
64
  header?: Snippet | null;
@@ -73,9 +72,7 @@ export interface ModalProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'
73
72
  }]>;
74
73
  role?: 'dialog' | 'alertdialog';
75
74
  }
76
- /** A text, or a snippet rendered where the option belongs */
77
75
  export type ModalNode = string | Snippet;
78
- /** Options of Modal.confirm/info/success/warning/error and of the useModal methods */
79
76
  export interface ModalConfirmProps extends Omit<ModalProps, 'title' | 'visible' | 'header' | 'footer' | 'icon' | 'closeIcon' | 'children'> {
80
77
  title?: ModalNode;
81
78
  content?: ModalNode;
@@ -92,9 +89,7 @@ export interface ModalConfirmProps extends Omit<ModalProps, 'title' | 'visible'
92
89
  visible?: boolean;
93
90
  }
94
91
  export interface ModalHookRef {
95
- /** Closes the dialog through its leave animation */
96
92
  destroy: () => void;
97
- /** Merges into the dialog's current options */
98
93
  update: (config: ModalConfirmProps) => void;
99
94
  }
100
95
  export interface ModalHookApi {
@@ -104,7 +99,6 @@ export interface ModalHookApi {
104
99
  warning: (config: ModalConfirmProps) => ModalHookRef;
105
100
  confirm: (config: ModalConfirmProps) => ModalHookRef;
106
101
  }
107
- /** A confirm's options with its type, as ConfirmModal receives them */
108
102
  export interface ConfirmProps extends ModalConfirmProps {
109
103
  type: ConfirmType;
110
104
  }
@@ -22,7 +22,6 @@
22
22
  type Foundation = ModalContentFoundation<FoundationProps, MouseEvent>;
23
23
  type Adapter = ModalContentAdapter<FoundationProps, MouseEvent>;
24
24
 
25
- // Internal: Modal passes every prop below; the rest are the caller's attributes
26
25
  interface Props extends Omit<HTMLAttributes<HTMLDivElement>, 'title' | 'children'> {
27
26
  visible: boolean;
28
27
  motion: boolean;
@@ -146,8 +145,6 @@
146
145
  const labelledby = $derived(!attrs.control['aria-label'] && !isCustomHeader && hasTitle ? `${idPrefix}-title` : undefined);
147
146
  const modalDialog = $derived(isModal({ mask, maskFixed, inBody }));
148
147
  const heightSet = $derived(Boolean(height) || /(^|;)\s*height\s*:/.test(userStyle ?? ''));
149
-
150
- // only set keys, so an unset width does not wipe the caller's style
151
148
  const sizeStyle = $derived(isFullScreen ? 'width: 100%; height: 100%; margin: unset' : [width ? `width: ${toCssLength(width)}` : '', height ? `height: ${toCssLength(height)}` : ''].filter(Boolean).join('; '));
152
149
  const boxStyle = $derived([userStyle, sizeStyle].filter(Boolean).join(';') || undefined);
153
150
 
@@ -203,7 +200,6 @@
203
200
  {/snippet}
204
201
 
205
202
  {#snippet dialogPart()}
206
- <!-- tabindex lets the dialog itself take focus -->
207
203
  <div
208
204
  aria-labelledby={labelledby}
209
205
  aria-modal={modalDialog ? 'true' : undefined}
@@ -192,7 +192,6 @@
192
192
  return foundation.afterHide;
193
193
  });
194
194
 
195
- // the unmount of a shown dialog reports its close once
196
195
  onMount(() => () => {
197
196
  if (takePendingClose()) {
198
197
  foundation.afterClose();
@@ -2,10 +2,8 @@ import type { Attachment } from 'svelte/attachments';
2
2
  interface ShowHideOptions {
3
3
  visible: () => boolean;
4
4
  motion: () => boolean;
5
- /** Classes the foundation SCSS animates; the keyframes live only there */
6
5
  showClass: string;
7
6
  hideClass: string;
8
- /** The leave animation has ended, or a hide needed none */
9
7
  onHidden?: () => void;
10
8
  }
11
9
  /**
@@ -8,10 +8,8 @@ export default function useShowHide({ visible, motion, showClass, hideClass, onH
8
8
  let node = $state.raw(null);
9
9
  // true from a show until the leave has ended, so the element is laid out the whole time it can be seen
10
10
  let displayed = $state(untrack(visible));
11
- // true while the show or hide class is applied
12
11
  let animating = $state(false);
13
12
  let first = true;
14
- // identifies the latest animation check, so a check of a replaced run does nothing
15
13
  let runs = 0;
16
14
  const finish = () => {
17
15
  animating = false;
@@ -23,7 +21,6 @@ export default function useShowHide({ visible, motion, showClass, hideClass, onH
23
21
  const attach = (element) => {
24
22
  node = element;
25
23
  const controller = new AbortController();
26
- // animation events bubble; a descendant's animation is not this run
27
24
  element.addEventListener('animationend', (event) => {
28
25
  if (event.target === element && animating) {
29
26
  finish();
@@ -42,7 +39,6 @@ export default function useShowHide({ visible, motion, showClass, hideClass, onH
42
39
  if (isVisible) {
43
40
  displayed = true;
44
41
  }
45
- // a dialog that was never shown has nothing to leave
46
42
  animating = withMotion && !(first && !isVisible);
47
43
  first = false;
48
44
  if (!animating && !isVisible) {
@@ -3,9 +3,7 @@ import type { ItemKey, Mode, NavClickData, NavOpenChangeData, NavProps, OnSelect
3
3
  export interface NavContextValue {
4
4
  readonly isCollapsed: boolean;
5
5
  readonly mode: Mode;
6
- /** True below a Sub: its title and list, inline or in the popup */
7
6
  readonly isInSubNav: boolean;
8
- /** Nesting depth of the items and Subs rendered at this point, 0 at the top */
9
7
  readonly level: number;
10
8
  readonly openKeys: ItemKey[];
11
9
  readonly openKeysIsControlled: boolean;
@@ -3,7 +3,6 @@ import NavHeaderPart from './nav-header.svelte';
3
3
  import NavItemPart from './nav-item.svelte';
4
4
  import NavBase from './nav.svelte';
5
5
  import SubNavPart from './sub-nav.svelte';
6
- // Svelte components are functions, so the parts attach to the component itself
7
6
  export const Nav = Object.assign(NavBase, { Sub: SubNavPart, Item: NavItemPart, Header: NavHeaderPart, Footer: NavFooterPart });
8
7
  export { default as NavFooter } from './nav-footer.svelte';
9
8
  export { default as NavHeader } from './nav-header.svelte';
@@ -11,14 +11,12 @@ type DataAttributes = {
11
11
  type AriaAttributes = {
12
12
  [key: `aria-${string}`]: unknown;
13
13
  };
14
- /** The attributes an `items` entry hands to its li */
15
14
  interface EntryAttributes extends DataAttributes, AriaAttributes {
16
15
  class?: ClassValue;
17
16
  style?: string;
18
17
  onmouseenter?: (event: MouseEvent) => void;
19
18
  onmouseleave?: (event: MouseEvent) => void;
20
19
  }
21
- /** The attributes of the item or header link; Nav spreads them onto the a element */
22
20
  export type NavLinkOptions = HTMLAnchorAttributes;
23
21
  export interface NavItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
24
22
  disabled?: boolean;
@@ -54,7 +52,6 @@ export interface SelectedData {
54
52
  text?: string | number;
55
53
  domEvent?: MouseEvent | KeyboardEvent;
56
54
  }
57
- /** Dropdown props of a popup Sub */
58
55
  export type SubDropdownProps = DropdownProps;
59
56
  export interface SubNavProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
60
57
  disabled?: boolean;
@@ -67,7 +64,6 @@ export interface SubNavProps extends Omit<HTMLAttributes<HTMLLIElement>, 'childr
67
64
  /** Applies when dropdownProps is not given */
68
65
  subDropdownProps?: SubDropdownProps;
69
66
  text?: string | number;
70
- /** The Sub's items: Nav.Item and Nav.Sub, rendered in the inline list or the popup */
71
67
  children?: Snippet;
72
68
  /** Replaces the shown text. Named `label`: `text` is the prop, and a prop and a snippet share one namespace */
73
69
  label?: Snippet;
@@ -98,7 +94,6 @@ export interface NavCollapseButtonProps {
98
94
  }]>;
99
95
  onToggle: () => void;
100
96
  }
101
- /** An entry of `items`: Item or Sub data, the attributes its li takes, and nested entries; Nav's snippets give its content */
102
97
  export interface NavItemConfig extends EntryAttributes {
103
98
  disabled?: boolean;
104
99
  dropdownProps?: SubDropdownProps;
@@ -113,9 +108,7 @@ export interface NavItemConfig extends EntryAttributes {
113
108
  tooltipHideDelay?: number;
114
109
  tooltipShowDelay?: number;
115
110
  }
116
- /** A string entry is both the text and the itemKey of a plain item */
117
111
  export type NavItems = (string | NavItemConfig)[];
118
- /** The `header` prop as data; `logo` is a snippet shown with the header */
119
112
  export interface NavHeaderConfig extends Omit<NavHeaderProps, 'children'> {
120
113
  }
121
114
  export interface NavFooterConfig extends Omit<NavFooterProps, 'children'> {
@@ -146,12 +139,10 @@ export interface NavWrapperArgs {
146
139
  itemElement: Snippet;
147
140
  isSubNav: boolean;
148
141
  isInSubNav: boolean;
149
- /** What the Nav.Item or Nav.Sub was given */
150
142
  props: Partial<NavItemProps> | Partial<SubNavProps>;
151
143
  }
152
144
  export interface NavItemRenderProps {
153
145
  item: NavItemConfig;
154
- /** Nesting depth of the entry, 0 at the top */
155
146
  level: number;
156
147
  }
157
148
  export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'> {
@@ -165,7 +156,6 @@ export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'>
165
156
  openKeys?: ItemKey[] | null;
166
157
  /** Bindable; null is a controlled empty value */
167
158
  selectedKeys?: ItemKey[] | null;
168
- /** Dropdown props of the Subs generated from `items` */
169
159
  subDropdownProps?: SubDropdownProps;
170
160
  subNavCloseDelay?: number;
171
161
  subNavMotion?: boolean;
@@ -173,20 +163,14 @@ export interface NavProps extends Omit<HTMLAttributes<HTMLElement>, 'children'>
173
163
  toggleIconPosition?: 'left' | 'right';
174
164
  tooltipHideDelay?: number;
175
165
  tooltipShowDelay?: number;
176
- /** A config object, or content that holds a `NavHeader`; it shows before the list */
177
166
  header?: NavHeaderConfig | Snippet;
178
- /** A config object, or content that holds a `NavFooter`; it shows after the list */
179
167
  footer?: NavFooterConfig | Snippet;
180
- /** Nav.Item and Nav.Sub, after the ones made from `items` */
181
168
  children?: Snippet;
182
169
  wrapper?: Snippet<[NavWrapperArgs]>;
183
- /** For the entries of `items` */
184
170
  icon?: Snippet<[NavItemRenderProps & NavIconArgs]>;
185
- /** For the entries of `items`; without it the entry's text shows */
171
+ /** Without it the entry's text shows */
186
172
  text?: Snippet<[NavItemRenderProps]>;
187
- /** For the items made from `items` */
188
173
  toggleIcon?: Snippet<[NavItemRenderProps & NavIconArgs]>;
189
- /** For the Subs made from `items` */
190
174
  expandIcon?: Snippet<[NavItemRenderProps & NavExpandIconArgs]>;
191
175
  onClick?: (data: NavClickData) => void;
192
176
  onCollapseChange?: (isCollapsed: boolean) => void;
@@ -12,7 +12,6 @@
12
12
  import { getNavContext } from './context.js';
13
13
  import type { NavIconArgs, NavLinkOptions, OnSelectedData, SelectedData } from './interface.js';
14
14
 
15
- // The li of a Nav.Item or Nav.Sub, or the Dropdown.Item that stands in for it inside a popup
16
15
  interface ItemShellProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'> {
17
16
  isSubNav?: boolean;
18
17
  /** Resolved by the caller: a Sub provides its own context to the subtree, which includes this shell */
@@ -20,7 +19,6 @@
20
19
  level: number;
21
20
  disabled?: boolean;
22
21
  indent?: boolean | number;
23
- /** Or'ed with the collapsed state of the Nav */
24
22
  isCollapsed?: boolean;
25
23
  itemKey?: ItemKey;
26
24
  link?: string;
@@ -28,12 +26,10 @@
28
26
  text?: string | number;
29
27
  tooltipHideDelay?: number;
30
28
  tooltipShowDelay?: number;
31
- /** What the item was given, reported in `selectedItems` */
32
29
  given: Record<string, unknown>;
33
30
  icon?: Snippet<[NavIconArgs]>;
34
31
  toggleIcon?: Snippet<[NavIconArgs]>;
35
32
  label?: Snippet;
36
- /** A Sub's title and list, in place of the control */
37
33
  content?: Snippet;
38
34
  onItemClick?: (data: SelectedData) => void;
39
35
  }
@@ -9,7 +9,6 @@ interface ItemShellProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'>
9
9
  level: number;
10
10
  disabled?: boolean;
11
11
  indent?: boolean | number;
12
- /** Or'ed with the collapsed state of the Nav */
13
12
  isCollapsed?: boolean;
14
13
  itemKey?: ItemKey;
15
14
  link?: string;
@@ -17,12 +16,10 @@ interface ItemShellProps extends Omit<HTMLAttributes<HTMLLIElement>, 'children'>
17
16
  text?: string | number;
18
17
  tooltipHideDelay?: number;
19
18
  tooltipShowDelay?: number;
20
- /** What the item was given, reported in `selectedItems` */
21
19
  given: Record<string, unknown>;
22
20
  icon?: Snippet<[NavIconArgs]>;
23
21
  toggleIcon?: Snippet<[NavIconArgs]>;
24
22
  label?: Snippet;
25
- /** A Sub's title and list, in place of the control */
26
23
  content?: Snippet;
27
24
  onItemClick?: (data: SelectedData) => void;
28
25
  }
@@ -10,8 +10,6 @@
10
10
  const ctx = getNavContext('Nav.Footer');
11
11
 
12
12
  const prefix = cssClasses.PREFIX;
13
-
14
- // the button only takes an empty footer of a vertical nav
15
13
  const showButton = $derived(!children && Boolean(collapseButton) && ctx.mode !== strings.MODE_HORIZONTAL);
16
14
  </script>
17
15
 
@@ -3,7 +3,6 @@
3
3
  import type { NavItemType } from '@fibrae/semi-foundation/navigation/foundation';
4
4
  import type { NavExpandIconArgs, NavIconArgs, NavItemConfig, NavItemRenderProps, SubDropdownProps } from './interface.js';
5
5
  import NavItem from './nav-item.svelte';
6
- // the template recurses through its own file
7
6
  import NavItems from './nav-items.svelte';
8
7
  import SubNav from './sub-nav.svelte';
9
8
 
@@ -57,7 +57,6 @@
57
57
  const NO_TREE: NavItemType[] = [];
58
58
  const prefix = cssClasses.PREFIX;
59
59
 
60
- // null is a controlled empty value, which the foundation's readers handle
61
60
  const foundationProps: NavigationBaseProps = {
62
61
  get children() {
63
62
  return children ? NO_TREE : undefined;
@@ -18,8 +18,6 @@
18
18
 
19
19
  type Foundation = SubNavFoundation<SubNavBaseProps>;
20
20
  type Adapter = SubNavAdapter<SubNavBaseProps>;
21
-
22
- // the title takes the trigger props of a Dropdown, of a Tooltip, or none
23
21
  type TitleTriggerProps = Omit<Partial<DropdownTriggerProps>, 'aria-haspopup' | 'aria-expanded'> & { 'aria-haspopup'?: 'menu' | 'dialog'; 'aria-expanded'?: boolean | 'true' | 'false' };
24
22
 
25
23
  // Left undefined when not passed, so `wrapper` receives only what the Sub was given
@@ -65,8 +63,6 @@
65
63
  const isSelected = $derived(itemKey !== undefined && outer.selectedKeys.includes(itemKey));
66
64
  const horizontal = $derived(outer.mode === strings.MODE_HORIZONTAL);
67
65
  const isPopup = $derived(outer.isCollapsed || horizontal);
68
-
69
- // inside a popup menu the title is the menuitem that opens a submenu
70
66
  const menuTitle = $derived(isPopup && outer.isInSubNav);
71
67
 
72
68
  // A disabled Sub opens no Dropdown; collapsed, it shows its hidden text in a tooltip instead
@@ -119,7 +115,6 @@
119
115
  // the title is a button (or a menuitem div); a disabled one stays focusable so that it can be found
120
116
  const inlineAttrs = $derived(isPopup ? {} : { 'aria-controls': isOpen ? subListId : undefined, 'aria-expanded': isOpen });
121
117
 
122
- // the child context: the Sub's own title and list are below it
123
118
  setNavContext(
124
119
  Object.create(outer, {
125
120
  isInSubNav: { get: () => true },
@@ -3,7 +3,6 @@
3
3
  import { getNavContext } from './context.js';
4
4
  import type { NavWrapperArgs } from './interface.js';
5
5
 
6
- // Hands the item's li to the Nav's `wrapper` snippet when there is one; otherwise the li renders as it is
7
6
  let { itemElement, isSubNav, isInSubNav, itemProps }: { itemElement: Snippet; isSubNav: boolean; isInSubNav: boolean; itemProps: NavWrapperArgs['props'] } = $props();
8
7
 
9
8
  const ctx = getNavContext('Nav.Item');
@@ -1,13 +1,10 @@
1
1
  import type { NoticeInstance } from '@fibrae/semi-foundation/notification/notification-foundation';
2
2
  import type { ConfigProps } from '@fibrae/semi-foundation/notification/notification-list-foundation';
3
- /** A notice as the store holds it: `add` always has an id, and the offsets ride along from the options */
4
3
  export type ListedNotice = NoticeInstance & Required<Pick<NoticeInstance, 'id'>> & Pick<ConfigProps, 'top' | 'bottom' | 'left' | 'right'>;
5
4
  export interface NoticeListContext {
6
5
  /** The pointer or focus is inside the position's list: every notice's countdown waits */
7
6
  readonly paused: boolean;
8
- /** The notices the latest store change updated in place */
9
7
  readonly updatedItems: readonly NoticeInstance[];
10
- /** The notices the store removed that are still leaving */
11
8
  readonly removedItems: readonly NoticeInstance[];
12
9
  /** Queues text for the live region; `read` runs when it is written */
13
10
  announce: (key: string, read: () => string) => void;
@@ -18,22 +18,18 @@ export interface NoticeProps extends Omit<FoundationNoticeProps, 'title' | 'cont
18
18
  left?: ConfigProps['left'];
19
19
  right?: ConfigProps['right'];
20
20
  }
21
- /** Props of the single notice the list renders; list-level options are stripped before they reach it */
22
21
  export interface NoticeItemProps extends Omit<NoticeProps, 'top' | 'bottom' | 'left' | 'right' | 'zIndex' | 'getPopupContainer' | 'stack' | 'position'> {
23
22
  placement: NoticePosition;
24
23
  stack?: boolean;
25
24
  stackExpanded?: boolean;
26
25
  /** Shown notices in front of this one, which sets how far it sinks behind them in a collapsed stack */
27
26
  depth?: number;
28
- /** z-index inside a stack, newest on top */
29
27
  layer?: number;
30
28
  /** The store removed the notice: it plays its leave animation, then calls `onLeaveEnd` */
31
29
  leaving?: boolean;
32
30
  onLeaveEnd?: () => void;
33
- /** Asks the list to remove the notice, with its id */
34
31
  close?: (id: string) => void;
35
32
  }
36
- /** A hook mounts its own wrapper, so the wrapper-level options do not apply */
37
33
  export type NotificationHookOptions = Omit<NoticeProps, 'type' | 'id' | 'zIndex' | 'getPopupContainer'>;
38
34
  export interface NotificationHookApi {
39
35
  success: (config: NotificationHookOptions) => string;
@@ -44,7 +40,6 @@ export interface NotificationHookApi {
44
40
  close: (id: string) => void;
45
41
  }
46
42
  export interface NoticeHandle {
47
- /** Starts the duration over */
48
43
  restartCloseTimer: () => void;
49
44
  pauseCloseTimer: () => void;
50
45
  resumeCloseTimer: () => void;
@@ -12,7 +12,6 @@
12
12
 
13
13
  interface NoticeListProps {
14
14
  placement: NoticePosition;
15
- /** The position's notices, newest first, leaving ones included */
16
15
  items: ListedNotice[];
17
16
  removedItems: readonly NoticeInstance[];
18
17
  updatedItems: readonly NoticeInstance[];
@@ -35,7 +34,6 @@
35
34
  const threshold = $derived(getStackThreshold(items[0].stack ?? defaults('stack')));
36
35
  const expanded = $derived(paused || shownCount <= threshold);
37
36
 
38
- // The newest notice decides the list's offsets
39
37
  const listStyle = $derived.by(() => {
40
38
  const newest = items[0];
41
39
  return {
@@ -3,7 +3,6 @@ import type NotificationListStore from '@fibrae/semi-foundation/notification/not
3
3
  import { type ListedNotice } from './context.js';
4
4
  interface NoticeListProps {
5
5
  placement: NoticePosition;
6
- /** The position's notices, newest first, leaving ones included */
7
6
  items: ListedNotice[];
8
7
  removedItems: readonly NoticeInstance[];
9
8
  updatedItems: readonly NoticeInstance[];
@@ -14,7 +14,6 @@
14
14
  import { getNoticeListContext } from './context.js';
15
15
  import type { NoticeItemProps } from './interface.js';
16
16
 
17
- // The foundation reads only these two
18
17
  type FoundationProps = Pick<NoticeItemProps, 'id' | 'duration'>;
19
18
  type Foundation = NotificationFoundation<FoundationProps>;
20
19
  type Adapter = NoticeAdapter<FoundationProps>;
@@ -102,7 +101,6 @@
102
101
  };
103
102
 
104
103
  const handleAnimationEnd = (event: AnimationEvent) => {
105
- // the content's own animations bubble up to here
106
104
  if (event.target !== event.currentTarget) return;
107
105
  if (!leaving) {
108
106
  entered = true;
@@ -10,7 +10,6 @@
10
10
  import type { NotificationListProps } from './interface.js';
11
11
  import NoticeList from './notice-list.svelte';
12
12
 
13
- // A list renders one store for its whole life
14
13
  let { store }: NotificationListProps = $props();
15
14
  const defaults = useDefaultProps('Notification');
16
15
 
@@ -14,7 +14,6 @@ let wrapper = null;
14
14
  let list = null;
15
15
  function addNotice(notice) {
16
16
  assertClient('Notification', 'Notification.useNotification');
17
- // an explicit undefined must not replace the defaults
18
17
  const merged = { ...store.defaults, ...omitInstanceIds(semiGlobal.config.overrideDefaultProps?.Notification), ...omitBy(notice, (value) => value === undefined) };
19
18
  const id = merged.id ?? createId('notification');
20
19
  if (!wrapper) {
@@ -1,11 +1,9 @@
1
1
  import type { Snippet } from 'svelte';
2
2
  import type { HTMLAttributes } from 'svelte/elements';
3
- /** The default item shape: any record, read by `itemKey` */
4
3
  export type OverflowListItem = Record<string, any>;
5
4
  export type OverflowListKey = string | number;
6
5
  export interface OverflowListItemSnippetProps<T> {
7
6
  item: T;
8
- /** The item's position in `items` */
9
7
  index: number;
10
8
  }
11
9
  export interface OverflowListOverflowSnippetProps<T> {
@@ -56,7 +56,6 @@
56
56
  return rest.style ? { css: rest.style } : undefined;
57
57
  };
58
58
 
59
- // The foundation reads the props through one object
60
59
  const foundationProps: OverflowListBaseProps = {
61
60
  get items() {
62
61
  return readItems();
@@ -172,7 +171,6 @@
172
171
  });
173
172
  };
174
173
 
175
- // Reset the view when items, style, keys or collapseFrom change, before the DOM shows the new props
176
174
  $effect.pre(() => {
177
175
  const next = viewProps();
178
176
  // read keys here so in-place edits of a $state array are tracked
@@ -10,7 +10,6 @@ export interface PaginationProps extends Omit<HTMLAttributes<HTMLUListElement>,
10
10
  size?: 'small' | 'default';
11
11
  /** Bindable; leave it out for an uncontrolled page. `bind:currentPage={get, set}` makes it fully controlled */
12
12
  currentPage?: number;
13
- /** Not rendered when `size` is `small` */
14
13
  showSizeChanger?: boolean;
15
14
  showQuickJumper?: boolean;
16
15
  /** Position of the omitted pages popover and the size changer dropdown; not used by the `small` size */
@@ -17,7 +17,6 @@
17
17
  import RestPages from './rest-pages.svelte';
18
18
  import StepButton from './step-button.svelte';
19
19
 
20
- // The props the foundation reads, plus the ones its initial state reads
21
20
  interface FoundationProps extends PaginationBaseProps {
22
21
  defaultCurrentPage?: number;
23
22
  pageSize?: number;
@@ -59,7 +58,6 @@
59
58
  const globalCurrentPage = defaults('currentPage');
60
59
  const globalPageSize = defaults('pageSize');
61
60
 
62
- // $bindable needs destructuring, so the foundation reads the props through getters
63
61
  const foundationProps: FoundationProps = {
64
62
  get currentPage() {
65
63
  return currentPage ?? globalCurrentPage;