snice 7.0.2 → 7.0.3

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 (253) hide show
  1. package/adapters/react/SniceProvider.js +1 -1
  2. package/adapters/react/SniceRouter.js +1 -1
  3. package/adapters/react/matchRoute.js +1 -1
  4. package/adapters/react/useRequestHandler.js +1 -1
  5. package/dist/cdn/accordion/snice-accordion.js +1 -1
  6. package/dist/cdn/action-bar/snice-action-bar.js +1 -1
  7. package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
  8. package/dist/cdn/alert/snice-alert.js +1 -1
  9. package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
  10. package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
  11. package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
  12. package/dist/cdn/availability/snice-availability.js +1 -1
  13. package/dist/cdn/avatar/snice-avatar.js +1 -1
  14. package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
  15. package/dist/cdn/badge/snice-badge.js +1 -1
  16. package/dist/cdn/banner/snice-banner.js +1 -1
  17. package/dist/cdn/binpack/snice-binpack.js +1 -1
  18. package/dist/cdn/book/snice-book.js +1 -1
  19. package/dist/cdn/booking/snice-booking.js +1 -1
  20. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
  21. package/dist/cdn/button/snice-button.js +1 -1
  22. package/dist/cdn/calendar/snice-calendar.js +1 -1
  23. package/dist/cdn/camera/snice-camera.js +1 -1
  24. package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
  25. package/dist/cdn/candlestick/snice-candlestick.js +1 -1
  26. package/dist/cdn/card/snice-card.js +1 -1
  27. package/dist/cdn/carousel/snice-carousel.js +1 -1
  28. package/dist/cdn/cart/snice-cart.js +1 -1
  29. package/dist/cdn/chart/snice-chart.js +1 -1
  30. package/dist/cdn/chat/snice-chat.js +1 -1
  31. package/dist/cdn/checkbox/snice-checkbox.js +1 -1
  32. package/dist/cdn/chip/snice-chip.js +1 -1
  33. package/dist/cdn/code-block/snice-code-block.js +1 -1
  34. package/dist/cdn/color-display/snice-color-display.js +1 -1
  35. package/dist/cdn/color-picker/snice-color-picker.js +1 -1
  36. package/dist/cdn/command-palette/snice-command-palette.js +1 -1
  37. package/dist/cdn/comments/snice-comments.js +1 -1
  38. package/dist/cdn/countdown/snice-countdown.js +1 -1
  39. package/dist/cdn/cropper/snice-cropper.js +1 -1
  40. package/dist/cdn/data-card/snice-data-card.js +1 -1
  41. package/dist/cdn/date-picker/snice-date-picker.js +1 -1
  42. package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
  43. package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
  44. package/dist/cdn/diff/snice-diff.js +1 -1
  45. package/dist/cdn/divider/snice-divider.js +1 -1
  46. package/dist/cdn/doc/snice-doc.js +1 -1
  47. package/dist/cdn/draw/snice-draw.js +1 -1
  48. package/dist/cdn/drawer/snice-drawer.js +1 -1
  49. package/dist/cdn/empty-state/snice-empty-state.js +1 -1
  50. package/dist/cdn/estimate/snice-estimate.js +1 -1
  51. package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
  52. package/dist/cdn/file-upload/snice-file-upload.js +1 -1
  53. package/dist/cdn/flip-card/snice-flip-card.js +1 -1
  54. package/dist/cdn/flow/snice-flow.js +1 -1
  55. package/dist/cdn/form-layout/snice-form-layout.js +1 -1
  56. package/dist/cdn/funnel/snice-funnel.js +1 -1
  57. package/dist/cdn/gantt/snice-gantt.js +1 -1
  58. package/dist/cdn/gauge/snice-gauge.js +1 -1
  59. package/dist/cdn/grid/snice-grid.js +1 -1
  60. package/dist/cdn/heatmap/snice-heatmap.js +1 -1
  61. package/dist/cdn/image/snice-image.js +1 -1
  62. package/dist/cdn/input/snice-input.js +1 -1
  63. package/dist/cdn/invoice/snice-invoice.js +1 -1
  64. package/dist/cdn/kanban/snice-kanban.js +1 -1
  65. package/dist/cdn/key-value/snice-key-value.js +1 -1
  66. package/dist/cdn/kpi/snice-kpi.js +1 -1
  67. package/dist/cdn/layout/snice-layout.js +1 -1
  68. package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
  69. package/dist/cdn/link/snice-link.js +1 -1
  70. package/dist/cdn/link-preview/snice-link-preview.js +1 -1
  71. package/dist/cdn/list/snice-list.js +1 -1
  72. package/dist/cdn/location/snice-location.js +1 -1
  73. package/dist/cdn/login/snice-login.js +1 -1
  74. package/dist/cdn/map/snice-map.js +1 -1
  75. package/dist/cdn/markdown/snice-markdown.js +1 -1
  76. package/dist/cdn/masonry/snice-masonry.js +1 -1
  77. package/dist/cdn/menu/snice-menu.js +1 -1
  78. package/dist/cdn/message-strip/snice-message-strip.js +1 -1
  79. package/dist/cdn/modal/snice-modal.js +1 -1
  80. package/dist/cdn/music-player/snice-music-player.js +1 -1
  81. package/dist/cdn/nav/snice-nav.js +1 -1
  82. package/dist/cdn/network-graph/snice-network-graph.js +1 -1
  83. package/dist/cdn/notification-center/snice-notification-center.js +1 -1
  84. package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
  85. package/dist/cdn/org-chart/snice-org-chart.js +1 -1
  86. package/dist/cdn/pagination/snice-pagination.js +1 -1
  87. package/dist/cdn/paint/snice-paint.js +1 -1
  88. package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
  89. package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
  90. package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
  91. package/dist/cdn/popover/snice-popover.js +1 -1
  92. package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
  93. package/dist/cdn/product-card/snice-product-card.js +1 -1
  94. package/dist/cdn/progress/snice-progress.js +1 -1
  95. package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
  96. package/dist/cdn/qr-code/snice-qr-code.js +1 -1
  97. package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
  98. package/dist/cdn/radio/snice-radio.js +1 -1
  99. package/dist/cdn/range-slider/snice-range-slider.js +1 -1
  100. package/dist/cdn/rating/snice-rating.js +1 -1
  101. package/dist/cdn/receipt/snice-receipt.js +1 -1
  102. package/dist/cdn/recipe/snice-recipe.js +2 -2
  103. package/dist/cdn/recipe/snice-recipe.js.map +1 -1
  104. package/dist/cdn/recipe/snice-recipe.min.js +1 -1
  105. package/dist/cdn/recipe/snice-recipe.min.js.map +1 -1
  106. package/dist/cdn/runtime/snice-runtime.esm.js +4 -4
  107. package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
  108. package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
  109. package/dist/cdn/runtime/snice-runtime.js +4 -4
  110. package/dist/cdn/runtime/snice-runtime.js.map +1 -1
  111. package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
  112. package/dist/cdn/sankey/snice-sankey.js +1 -1
  113. package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
  114. package/dist/cdn/select/snice-select.js +1 -1
  115. package/dist/cdn/skeleton/snice-skeleton.js +1 -1
  116. package/dist/cdn/slider/snice-slider.js +1 -1
  117. package/dist/cdn/sortable/snice-sortable.js +1 -1
  118. package/dist/cdn/sparkline/snice-sparkline.js +1 -1
  119. package/dist/cdn/spinner/snice-spinner.js +1 -1
  120. package/dist/cdn/split-button/snice-split-button.js +1 -1
  121. package/dist/cdn/split-pane/snice-split-pane.js +1 -1
  122. package/dist/cdn/spotlight/snice-spotlight.js +1 -1
  123. package/dist/cdn/stat-group/snice-stat-group.js +1 -1
  124. package/dist/cdn/step-input/snice-step-input.js +1 -1
  125. package/dist/cdn/stepper/snice-stepper.js +1 -1
  126. package/dist/cdn/switch/snice-switch.js +1 -1
  127. package/dist/cdn/table/README.md +2 -2
  128. package/dist/cdn/table/snice-table.esm.js +20 -3
  129. package/dist/cdn/table/snice-table.esm.js.map +1 -1
  130. package/dist/cdn/table/snice-table.esm.min.js +35 -35
  131. package/dist/cdn/table/snice-table.esm.min.js.map +1 -1
  132. package/dist/cdn/table/snice-table.js +20 -3
  133. package/dist/cdn/table/snice-table.js.map +1 -1
  134. package/dist/cdn/table/snice-table.min.js +29 -29
  135. package/dist/cdn/table/snice-table.min.js.map +1 -1
  136. package/dist/cdn/tabs/snice-tabs.js +1 -1
  137. package/dist/cdn/tag/snice-tag.js +1 -1
  138. package/dist/cdn/tag-input/snice-tag-input.js +1 -1
  139. package/dist/cdn/terminal/snice-terminal.js +2 -1
  140. package/dist/cdn/terminal/snice-terminal.js.map +1 -1
  141. package/dist/cdn/terminal/snice-terminal.min.js +1 -0
  142. package/dist/cdn/terminal/snice-terminal.min.js.map +1 -1
  143. package/dist/cdn/testimonial/snice-testimonial.js +1 -1
  144. package/dist/cdn/textarea/snice-textarea.js +1 -1
  145. package/dist/cdn/time-picker/snice-time-picker.js +1 -1
  146. package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
  147. package/dist/cdn/timeline/snice-timeline.js +1 -1
  148. package/dist/cdn/timer/snice-timer.js +1 -1
  149. package/dist/cdn/toast/snice-toast.js +1 -1
  150. package/dist/cdn/tooltip/snice-tooltip.js +1 -1
  151. package/dist/cdn/tree/snice-tree.js +1 -1
  152. package/dist/cdn/treemap/snice-treemap.js +1 -1
  153. package/dist/cdn/user-card/snice-user-card.js +1 -1
  154. package/dist/cdn/video-player/README.md +1 -1
  155. package/dist/cdn/video-player/snice-video-player.js +2 -1
  156. package/dist/cdn/video-player/snice-video-player.js.map +1 -1
  157. package/dist/cdn/video-player/snice-video-player.min.js +1 -0
  158. package/dist/cdn/video-player/snice-video-player.min.js.map +1 -1
  159. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
  160. package/dist/cdn/waterfall/snice-waterfall.js +1 -1
  161. package/dist/cdn/weather/snice-weather.js +1 -1
  162. package/dist/cdn/work-order/snice-work-order.js +1 -1
  163. package/dist/components/recipe/snice-recipe.js +1 -1
  164. package/dist/components/recipe/snice-recipe.js.map +1 -1
  165. package/dist/components/table/snice-table.d.ts +1 -0
  166. package/dist/components/table/snice-table.js +18 -2
  167. package/dist/components/table/snice-table.js.map +1 -1
  168. package/dist/components/table/table-tree-data.js +1 -0
  169. package/dist/components/table/table-tree-data.js.map +1 -1
  170. package/dist/components/terminal/snice-terminal.js +1 -0
  171. package/dist/components/terminal/snice-terminal.js.map +1 -1
  172. package/dist/components/video-player/snice-video-player.js +1 -0
  173. package/dist/components/video-player/snice-video-player.js.map +1 -1
  174. package/dist/index.cjs +1 -1
  175. package/dist/index.esm.js +1 -1
  176. package/dist/index.iife.js +1 -1
  177. package/dist/react/SniceProvider.js +1 -1
  178. package/dist/react/SniceRouter.js +1 -1
  179. package/dist/react/index.js +1 -1
  180. package/dist/react/matchRoute.js +1 -1
  181. package/dist/react/useRequestHandler.js +1 -1
  182. package/dist/symbols.cjs +1 -1
  183. package/dist/symbols.esm.js +1 -1
  184. package/dist/transitions.cjs +1 -1
  185. package/dist/transitions.esm.js +1 -1
  186. package/docs/ai/components/avatar.md +8 -8
  187. package/docs/ai/components/breadcrumbs.md +2 -1
  188. package/docs/ai/components/button.md +2 -7
  189. package/docs/ai/components/calendar.md +1 -1
  190. package/docs/ai/components/camera.md +1 -1
  191. package/docs/ai/components/chart.md +3 -1
  192. package/docs/ai/components/code-block.md +2 -2
  193. package/docs/ai/components/date-picker.md +5 -19
  194. package/docs/ai/components/date-range-picker.md +4 -12
  195. package/docs/ai/components/draw.md +5 -5
  196. package/docs/ai/components/drawer.md +4 -4
  197. package/docs/ai/components/form-layout.md +2 -0
  198. package/docs/ai/components/icons.md +7 -16
  199. package/docs/ai/components/key-value.md +3 -22
  200. package/docs/ai/components/layout.md +8 -12
  201. package/docs/ai/components/leaderboard.md +2 -2
  202. package/docs/ai/components/link-preview.md +4 -3
  203. package/docs/ai/components/login.md +11 -0
  204. package/docs/ai/components/markdown.md +7 -0
  205. package/docs/ai/components/masonry.md +6 -0
  206. package/docs/ai/components/menu.md +1 -1
  207. package/docs/ai/components/modal.md +7 -0
  208. package/docs/ai/components/notification-center.md +5 -4
  209. package/docs/ai/components/radio.md +7 -0
  210. package/docs/ai/components/rating.md +3 -3
  211. package/docs/ai/components/select.md +4 -13
  212. package/docs/ai/components/spotlight.md +2 -0
  213. package/docs/ai/components/table.md +1 -4
  214. package/docs/ai/components/tag-input.md +6 -0
  215. package/docs/ai/components/terminal.md +6 -0
  216. package/docs/ai/components/tooltip.md +10 -16
  217. package/docs/ai/components/tree.md +2 -2
  218. package/docs/ai/components/video-player.md +5 -0
  219. package/docs/ai/components/waterfall.md +7 -0
  220. package/docs/ai/events.md +29 -0
  221. package/docs/components/breadcrumbs.md +2 -1
  222. package/docs/components/calendar.md +1 -1
  223. package/docs/components/camera.md +1 -1
  224. package/docs/components/chart.md +1 -1
  225. package/docs/components/code-block.md +13 -4
  226. package/docs/components/color-picker.md +6 -5
  227. package/docs/components/date-time-picker.md +14 -0
  228. package/docs/components/diff.md +2 -1
  229. package/docs/components/draw.md +5 -5
  230. package/docs/components/drawer.md +4 -4
  231. package/docs/components/input.md +1 -0
  232. package/docs/components/layout.md +20 -22
  233. package/docs/components/leaderboard.md +10 -3
  234. package/docs/components/link-preview.md +11 -9
  235. package/docs/components/login.md +4 -0
  236. package/docs/components/menu.md +1 -1
  237. package/docs/components/modal.md +1 -0
  238. package/docs/components/nav.md +1 -0
  239. package/docs/components/network-graph.md +1 -0
  240. package/docs/components/notification-center.md +2 -1
  241. package/docs/components/product-card.md +1 -0
  242. package/docs/components/qr-reader.md +1 -0
  243. package/docs/components/rating.md +4 -4
  244. package/docs/components/select.md +1 -0
  245. package/docs/components/spotlight.md +2 -0
  246. package/docs/components/tabs.md +1 -0
  247. package/docs/components/terminal.md +3 -0
  248. package/docs/components/textarea.md +1 -1
  249. package/docs/components/time-picker.md +14 -0
  250. package/docs/components/tooltip.md +2 -0
  251. package/docs/components/tree.md +2 -2
  252. package/docs/events.md +73 -0
  253. package/package.json +1 -1
@@ -12,6 +12,7 @@ A guided tour and onboarding component that highlights elements on the page with
12
12
  - [CSS Custom Properties](#css-custom-properties)
13
13
  - [Basic Usage](#basic-usage)
14
14
  - [Examples](#examples)
15
+ - [CSS Parts](#css-parts)
15
16
  - [Accessibility](#accessibility)
16
17
 
17
18
  ## Properties
@@ -49,6 +50,7 @@ interface SpotlightStep {
49
50
  | `spotlight-step` | `{ index: number, step: SpotlightStep }` | Navigated to a new step |
50
51
  | `spotlight-end` | `void` | Tour ended (completed or ended programmatically) |
51
52
  | `spotlight-skip` | `{ index: number }` | User skipped the tour at the given step |
53
+ | `spotlight-target-missing` | `{ index: number, step: SpotlightStep }` | A step's target element is no longer in the DOM (e.g. a route change removed it). The popover stops rather than pointing at nothing. |
52
54
 
53
55
  ## CSS Custom Properties
54
56
 
@@ -13,6 +13,7 @@ A tabbed interface for organizing content into separate panels, using `<snice-ta
13
13
  - [Slots](#slots)
14
14
  - [CSS Parts](#css-parts)
15
15
  - [Basic Usage](#basic-usage)
16
+ - [CSS Custom Properties](#css-custom-properties)
16
17
  - [Examples](#examples)
17
18
 
18
19
  ## Components
@@ -37,6 +37,9 @@ A shell terminal emulator with command execution, history navigation, and ANSI c
37
37
  | `focus()` | -- | Focus the input |
38
38
  | `getHistory()` | -- | Get command history, returns `string[]` |
39
39
  | `clearHistory()` | -- | Clear command history |
40
+ | `appendChunk()` | `chunk: string, type?: TerminalLineType` | Feed a raw chunk without splitting on newlines; a trailing partial line stays live and grows as more chunks arrive |
41
+ | `pipeFrom()` | `source: AsyncIterable<string> \| ReadableStream<string \| Uint8Array>, type?: TerminalLineType` | Stream a source to the terminal until it ends. Returns `Promise<void>` |
42
+ | `commitLiveLine()` | -- | Force the current live (un-newlined) buffer to be treated as a finished line |
40
43
 
41
44
  ## Events
42
45
 
@@ -49,7 +49,7 @@ A multi-line text input with validation, character counting, and optional auto-g
49
49
 
50
50
  | Method | Arguments | Description |
51
51
  |--------|-----------|-------------|
52
- | `focus()` | `options?: FocusOptions` | Focus the textarea |
52
+ | `focus()` | -- | Focus the textarea |
53
53
  | `blur()` | -- | Remove focus |
54
54
  | `select()` | -- | Select all text |
55
55
  | `checkValidity()` | -- | Check validation, returns `boolean` |
@@ -4,6 +4,20 @@
4
4
 
5
5
  `<snice-time-picker>` is an editable, form-associated time control with 12-hour and 24-hour displays, dropdown or inline selectors, optional seconds, range and step constraints, native reset and restoration, and constraint validation.
6
6
 
7
+ ## Table of Contents
8
+
9
+ - [Basic usage](#basic-usage)
10
+ - [Time and form-value contract](#time-and-form-value-contract)
11
+ - [Live value and reset default](#live-value-and-reset-default)
12
+ - [Native form lifecycle](#native-form-lifecycle)
13
+ - [External labels and accessible naming](#external-labels-and-accessible-naming)
14
+ - [Validation](#validation)
15
+ - [Display and interaction](#display-and-interaction)
16
+ - [Properties](#properties)
17
+ - [Methods](#methods)
18
+ - [Events](#events)
19
+ - [CSS parts](#css-parts)
20
+
7
21
  ## Basic usage
8
22
 
9
23
  ```ts
@@ -12,6 +12,7 @@ Provides contextual information when users hover, click, or focus an element. Su
12
12
  - [CSS Parts](#css-parts)
13
13
  - [Basic Usage](#basic-usage)
14
14
  - [Examples](#examples)
15
+ - [CSS Custom Properties](#css-custom-properties)
15
16
  - [Attribute-Based Tooltips](#attribute-based-tooltips)
16
17
 
17
18
  ## Properties
@@ -231,6 +232,7 @@ This is the primary use case -- adding tooltips without disrupting component str
231
232
  | `--tooltip-hide-delay` | `0` | Hide delay in milliseconds |
232
233
  | `--tooltip-offset` | `12` | Distance from trigger element in pixels |
233
234
  | `--tooltip-arrow` | *(shown)* | Set to `none` to hide the arrow |
235
+ | `--tooltip-arrow-size` | `6px` | Arrow width and height |
234
236
  | `--tooltip-max-width` | `250` | Maximum tooltip width in pixels |
235
237
  | `--tooltip-z-index` | `10000` | Z-index stacking order |
236
238
  | `--tooltip-strict-positioning` | *(false)* | Set to `true` to disable auto-flip |
@@ -24,8 +24,8 @@ Displays hierarchical data with expandable/collapsible nodes, selection, checkbo
24
24
  | `showIcons` (attr: `show-icons`) | `boolean` | `true` | Display node icons |
25
25
  | `expandOnClick` (attr: `expand-on-click`) | `boolean` | `false` | Expand/collapse on node click |
26
26
  | `nodes` | `TreeNode[]` | `[]` | Array of tree nodes |
27
- | `selectedNodes` (attr: `selected-nodes`) | `string[]` | `[]` | Selected node IDs |
28
- | `checkedNodes` (attr: `checked-nodes`) | `string[]` | `[]` | Checked node IDs |
27
+ | `selectedNodes` | `string[]` | `[]` | Selected node IDs (JS-only; no attribute) |
28
+ | `checkedNodes` | `string[]` | `[]` | Checked node IDs (JS-only; no attribute) |
29
29
 
30
30
  ### TreeNode Interface
31
31
 
package/docs/events.md CHANGED
@@ -7,6 +7,7 @@ Event handling in Snice provides two powerful approaches: **template event synta
7
7
  - [Template Event Syntax (Preferred for Elements)](#template-event-syntax-preferred-for-elements)
8
8
  - [@on Decorator](#on-decorator)
9
9
  - [@dispatch Decorator](#dispatch-decorator)
10
+ - [Event Bus](#event-bus)
10
11
  - [Custom Events](#custom-events)
11
12
  - [Event Delegation](#event-delegation)
12
13
  - [Keyboard Shortcuts](#keyboard-shortcuts)
@@ -715,6 +716,78 @@ class ColorPicker extends HTMLElement {
715
716
  }
716
717
  ```
717
718
 
719
+ ## Event Bus
720
+
721
+ Snice has no bus object and no singleton. A bus is `@dispatch` publishing upward and
722
+ `@on` subscribing at a chosen ancestor -- the scope is a DOM node, so it is created and
723
+ torn down with the DOM.
724
+
725
+ There are two ways to publish, and the choice decides who can hear it.
726
+
727
+ **Bubble up from the host.** `@dispatch` is `bubbles: true, composed: true` by default, so
728
+ the event crosses shadow boundaries and passes every ancestor on its way to `document`.
729
+ Use this when the event is about *this* element and ancestors may care.
730
+
731
+ ```typescript
732
+ @element('product-tile')
733
+ class ProductTile extends HTMLElement {
734
+ @dispatch('bus:cart-added')
735
+ addToCart(sku: string) {
736
+ return { sku, qty: 1 };
737
+ }
738
+ }
739
+ ```
740
+
741
+ **Dispatch directly on a scope.** `@dispatch` takes the same `scope` option as `@on`, which
742
+ fires the event *on* that target instead of bubbling from the host. Use this when the
743
+ subscriber is not an ancestor -- a sibling subtree, or a host that may be detached.
744
+
745
+ ```typescript
746
+ @dispatch('bus:cart-added', { scope: 'global' }) // dispatched on document
747
+ add(id: string) { return { id }; }
748
+ ```
749
+
750
+ Subscribe at the scope you want to share.
751
+
752
+ ```typescript
753
+ // App-wide: listens on document
754
+ @on('bus:cart-added', { scope: 'global' })
755
+ onCartAdded(e: CustomEvent) { /* ... */ }
756
+
757
+ // Feature-scoped: listens on the nearest <cart-shell> ancestor, so a second
758
+ // <cart-shell> elsewhere on the page keeps its own traffic
759
+ @on('bus:cart-added', { scope: 'cart-shell' })
760
+ onCartAdded(e: CustomEvent) { /* ... */ }
761
+ ```
762
+
763
+ Choosing a scope:
764
+
765
+ | Reach | `scope` | Use when |
766
+ |---|---|---|
767
+ | Whole document | `'global'` | Genuinely app-wide: auth expiry, theme change, save shortcut |
768
+ | A feature subtree | selector string | The event belongs to one shell and must not leak to a sibling instance |
769
+ | A specific node | `EventTarget` / resolver | You already hold the node, or the target moves and must re-resolve |
770
+
771
+ Prefer the narrowest scope that works. `'global'` means every instance on the page hears
772
+ every message, which is what makes singleton buses hard to reason about.
773
+
774
+ Match the two halves. A bubbling publish only reaches subscribers that sit on the host's
775
+ ancestor chain; if the subscriber lives in a sibling subtree, scope the dispatch too so
776
+ both meet on the same node. See
777
+ [scope on @dispatch](#scope-controlling-the-dispatch-target).
778
+
779
+ Name events so the routing is visible at the call site -- the `bus:` prefix above is a
780
+ convention, not a framework feature. Any string works.
781
+
782
+ Teardown is automatic: the listener is removed on disconnect from whichever target it
783
+ resolved to, and re-resolved on reconnect, so subscribers follow the host when it moves.
784
+ If a selector scope matches no ancestor the listener is skipped with a `console.warn`
785
+ rather than silently binding to the wrong node. See
786
+ [scope](#scope-controlling-the-listener-target) for the full resolution table.
787
+
788
+ For a request that needs an answer rather than a broadcast, use
789
+ [@request / @respond](./request-response.md) instead.
790
+
718
791
  ## Custom Events
719
792
 
720
793
  ### Dispatching Manually
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snice",
3
- "version": "7.0.2",
3
+ "version": "7.0.3",
4
4
  "type": "module",
5
5
  "description": "A decorator-driven web component library with differential rendering, routing, controllers, and 130+ ready-made UI components. Use as much or as little as you want. Zero dependencies, works anywhere.",
6
6
  "main": "dist/index.cjs",