snice 7.6.0 → 7.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/adapters/react/SniceProvider.js +1 -1
- package/adapters/react/SniceRouter.js +1 -1
- package/adapters/react/calendar.d.ts +1 -0
- package/adapters/react/calendar.d.ts.map +1 -1
- package/adapters/react/calendar.js +1 -1
- package/adapters/react/calendar.js.map +1 -1
- package/adapters/react/calendar.tsx +2 -1
- package/adapters/react/matchRoute.js +1 -1
- package/adapters/react/useRequestHandler.js +1 -1
- package/bin/analyzer-contracts.js +8 -2
- package/custom-elements.json +15 -1
- package/dist/cdn/accordion/snice-accordion.js +1 -1
- package/dist/cdn/action-bar/snice-action-bar.js +1 -1
- package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
- package/dist/cdn/alert/snice-alert.js +1 -1
- package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
- package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
- package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
- package/dist/cdn/availability/snice-availability.js +1 -1
- package/dist/cdn/avatar/snice-avatar.js +1 -1
- package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
- package/dist/cdn/badge/snice-badge.js +1 -1
- package/dist/cdn/banner/snice-banner.js +1 -1
- package/dist/cdn/binpack/snice-binpack.js +1 -1
- package/dist/cdn/book/snice-book.js +1 -1
- package/dist/cdn/booking/snice-booking.js +1 -1
- package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
- package/dist/cdn/button/snice-button.js +2 -2
- package/dist/cdn/button/snice-button.js.map +1 -1
- package/dist/cdn/button/snice-button.min.js +1 -1
- package/dist/cdn/button/snice-button.min.js.map +1 -1
- package/dist/cdn/calendar/README.md +2 -2
- package/dist/cdn/calendar/snice-calendar.js +26 -2
- package/dist/cdn/calendar/snice-calendar.js.map +1 -1
- package/dist/cdn/calendar/snice-calendar.min.js +2 -2
- package/dist/cdn/calendar/snice-calendar.min.js.map +1 -1
- package/dist/cdn/camera/snice-camera.js +1 -1
- package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
- package/dist/cdn/candlestick/snice-candlestick.js +1 -1
- package/dist/cdn/card/snice-card.js +1 -1
- package/dist/cdn/carousel/snice-carousel.js +1 -1
- package/dist/cdn/cart/snice-cart.js +1 -1
- package/dist/cdn/chart/snice-chart.js +1 -1
- package/dist/cdn/chat/snice-chat.js +1 -1
- package/dist/cdn/checkbox/snice-checkbox.js +1 -1
- package/dist/cdn/chip/snice-chip.js +1 -1
- package/dist/cdn/code-block/snice-code-block.js +1 -1
- package/dist/cdn/color-display/snice-color-display.js +1 -1
- package/dist/cdn/color-picker/snice-color-picker.js +1 -1
- package/dist/cdn/command-palette/snice-command-palette.js +1 -1
- package/dist/cdn/comments/snice-comments.js +1 -1
- package/dist/cdn/countdown/snice-countdown.js +1 -1
- package/dist/cdn/cropper/snice-cropper.js +1 -1
- package/dist/cdn/data-card/snice-data-card.js +1 -1
- package/dist/cdn/date-picker/snice-date-picker.js +1 -1
- package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
- package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
- package/dist/cdn/diff/snice-diff.js +1 -1
- package/dist/cdn/divider/snice-divider.js +1 -1
- package/dist/cdn/doc/snice-doc.js +1 -1
- package/dist/cdn/draw/snice-draw.js +1 -1
- package/dist/cdn/drawer/snice-drawer.js +1 -1
- package/dist/cdn/empty-state/snice-empty-state.js +1 -1
- package/dist/cdn/estimate/snice-estimate.js +1 -1
- package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
- package/dist/cdn/file-upload/snice-file-upload.js +1 -1
- package/dist/cdn/flip-card/snice-flip-card.js +1 -1
- package/dist/cdn/flow/snice-flow.js +1 -1
- package/dist/cdn/form-layout/snice-form-layout.js +1 -1
- package/dist/cdn/funnel/snice-funnel.js +1 -1
- package/dist/cdn/gantt/snice-gantt.js +1 -1
- package/dist/cdn/gauge/snice-gauge.js +1 -1
- package/dist/cdn/grid/snice-grid.js +1 -1
- package/dist/cdn/heatmap/snice-heatmap.js +1 -1
- package/dist/cdn/image/snice-image.js +1 -1
- package/dist/cdn/input/snice-input.js +1 -1
- package/dist/cdn/invoice/snice-invoice.js +1 -1
- package/dist/cdn/kanban/snice-kanban.js +1 -1
- package/dist/cdn/key-value/snice-key-value.js +1 -1
- package/dist/cdn/kpi/snice-kpi.js +1 -1
- package/dist/cdn/layout/snice-layout.js +1 -1
- package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
- package/dist/cdn/link/snice-link.js +1 -1
- package/dist/cdn/link-preview/snice-link-preview.js +1 -1
- package/dist/cdn/list/snice-list.js +1 -1
- package/dist/cdn/location/snice-location.js +1 -1
- package/dist/cdn/login/README.md +1 -1
- package/dist/cdn/login/snice-login.js +2 -2
- package/dist/cdn/login/snice-login.js.map +1 -1
- package/dist/cdn/login/snice-login.min.js +1 -1
- package/dist/cdn/login/snice-login.min.js.map +1 -1
- package/dist/cdn/map/snice-map.js +1 -1
- package/dist/cdn/markdown/snice-markdown.js +1 -1
- package/dist/cdn/masonry/snice-masonry.js +1 -1
- package/dist/cdn/menu/snice-menu.js +1 -1
- package/dist/cdn/message-strip/snice-message-strip.js +1 -1
- package/dist/cdn/modal/snice-modal.js +1 -1
- package/dist/cdn/music-player/snice-music-player.js +1 -1
- package/dist/cdn/nav/snice-nav.js +1 -1
- package/dist/cdn/network-graph/snice-network-graph.js +1 -1
- package/dist/cdn/notification-center/snice-notification-center.js +1 -1
- package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
- package/dist/cdn/org-chart/snice-org-chart.js +1 -1
- package/dist/cdn/pagination/snice-pagination.js +1 -1
- package/dist/cdn/paint/snice-paint.js +1 -1
- package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
- package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
- package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
- package/dist/cdn/popover/snice-popover.js +1 -1
- package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
- package/dist/cdn/product-card/snice-product-card.js +1 -1
- package/dist/cdn/progress/snice-progress.js +1 -1
- package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
- package/dist/cdn/qr-code/snice-qr-code.js +1 -1
- package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
- package/dist/cdn/radio/snice-radio.js +1 -1
- package/dist/cdn/range-slider/snice-range-slider.js +1 -1
- package/dist/cdn/rating/snice-rating.js +1 -1
- package/dist/cdn/receipt/snice-receipt.js +1 -1
- package/dist/cdn/recipe/snice-recipe.js +1 -1
- package/dist/cdn/runtime/README.md +2 -2
- package/dist/cdn/runtime/snice-runtime.esm.js +130 -31
- package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js +1 -1
- package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.js +130 -31
- package/dist/cdn/runtime/snice-runtime.js.map +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js +1 -1
- package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
- package/dist/cdn/sankey/snice-sankey.js +1 -1
- package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
- package/dist/cdn/select/snice-select.js +1 -1
- package/dist/cdn/skeleton/snice-skeleton.js +1 -1
- package/dist/cdn/slider/snice-slider.js +1 -1
- package/dist/cdn/sortable/snice-sortable.js +1 -1
- package/dist/cdn/sparkline/snice-sparkline.js +1 -1
- package/dist/cdn/spinner/snice-spinner.js +1 -1
- package/dist/cdn/split-button/snice-split-button.js +1 -1
- package/dist/cdn/split-pane/snice-split-pane.js +1 -1
- package/dist/cdn/spotlight/snice-spotlight.js +1 -1
- package/dist/cdn/stat-group/snice-stat-group.js +1 -1
- package/dist/cdn/step-input/snice-step-input.js +1 -1
- package/dist/cdn/stepper/snice-stepper.js +1 -1
- package/dist/cdn/switch/snice-switch.js +1 -1
- package/dist/cdn/table/README.md +2 -2
- package/dist/cdn/table/snice-table.esm.js +227 -36
- package/dist/cdn/table/snice-table.esm.js.map +1 -1
- package/dist/cdn/table/snice-table.esm.min.js +69 -48
- package/dist/cdn/table/snice-table.esm.min.js.map +1 -1
- package/dist/cdn/table/snice-table.js +226 -35
- package/dist/cdn/table/snice-table.js.map +1 -1
- package/dist/cdn/table/snice-table.min.js +47 -26
- package/dist/cdn/table/snice-table.min.js.map +1 -1
- package/dist/cdn/tabs/snice-tabs.js +1 -1
- package/dist/cdn/tag/snice-tag.js +1 -1
- package/dist/cdn/tag-input/README.md +2 -2
- package/dist/cdn/tag-input/snice-tag-input.js +10 -16
- package/dist/cdn/tag-input/snice-tag-input.js.map +1 -1
- package/dist/cdn/tag-input/snice-tag-input.min.js +2 -2
- package/dist/cdn/tag-input/snice-tag-input.min.js.map +1 -1
- package/dist/cdn/terminal/snice-terminal.js +1 -1
- package/dist/cdn/testimonial/snice-testimonial.js +1 -1
- package/dist/cdn/textarea/snice-textarea.js +1 -1
- package/dist/cdn/time-picker/snice-time-picker.js +1 -1
- package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
- package/dist/cdn/timeline/snice-timeline.js +1 -1
- package/dist/cdn/timer/snice-timer.js +1 -1
- package/dist/cdn/toast/snice-toast.js +1 -1
- package/dist/cdn/tooltip/snice-tooltip.js +1 -1
- package/dist/cdn/tree/snice-tree.js +1 -1
- package/dist/cdn/treemap/snice-treemap.js +1 -1
- package/dist/cdn/user-card/snice-user-card.js +1 -1
- package/dist/cdn/video-player/snice-video-player.js +1 -1
- package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
- package/dist/cdn/waterfall/snice-waterfall.js +1 -1
- package/dist/cdn/weather/snice-weather.js +1 -1
- package/dist/cdn/work-order/snice-work-order.js +1 -1
- package/dist/components/button/snice-button.js +1 -1
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/calendar/snice-calendar.d.ts +2 -0
- package/dist/components/calendar/snice-calendar.js +25 -1
- package/dist/components/calendar/snice-calendar.js.map +1 -1
- package/dist/components/table/snice-row.d.ts +6 -0
- package/dist/components/table/snice-row.js +11 -3
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.d.ts +40 -3
- package/dist/components/table/snice-table.js +157 -17
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/table/table-cell-presentation.d.ts +11 -0
- package/dist/components/table/table-cell-presentation.js +25 -8
- package/dist/components/table/table-cell-presentation.js.map +1 -1
- package/dist/components/table/table-export.d.ts +6 -0
- package/dist/components/table/table-export.js +11 -2
- package/dist/components/table/table-export.js.map +1 -1
- package/dist/components/table/table-keyboard.js +1 -1
- package/dist/components/table/table-keyboard.js.map +1 -1
- package/dist/components/table/table-master-detail.d.ts +11 -2
- package/dist/components/table/table-master-detail.js +20 -3
- package/dist/components/table/table-master-detail.js.map +1 -1
- package/dist/components/tag-input/snice-tag-input.d.ts +2 -2
- package/dist/components/tag-input/snice-tag-input.js +9 -15
- package/dist/components/tag-input/snice-tag-input.js.map +1 -1
- package/dist/index.cjs +127 -28
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +127 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +127 -28
- package/dist/index.iife.js.map +1 -1
- package/dist/react/SniceProvider.js +1 -1
- package/dist/react/SniceRouter.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/matchRoute.js +1 -1
- package/dist/react/useRequestHandler.js +1 -1
- package/dist/request-response.d.ts +24 -1
- package/dist/symbols.cjs +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/testing-dom.cjs +1 -1
- package/dist/testing-dom.esm.js +1 -1
- package/dist/transitions.cjs +1 -1
- package/dist/transitions.esm.js +1 -1
- package/docs/ai/DEVELOPMENT.md +1 -1
- package/docs/ai/components/calendar.md +8 -0
- package/docs/ai/components/tag-input.md +4 -0
- package/docs/ai/controllers.md +22 -6
- package/docs/components/calendar.md +24 -0
- package/docs/components/tag-input.md +6 -1
- package/docs/controllers.md +57 -6
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
package/dist/react/matchRoute.js
CHANGED
|
@@ -23,5 +23,28 @@ export declare function request<T = any>(requestName: string, options?: RequestO
|
|
|
23
23
|
* @param options Optional configuration
|
|
24
24
|
*/
|
|
25
25
|
export declare function respond(requestName: string, options?: RespondOptions): (target: any, context: ClassMethodDecoratorContext) => void;
|
|
26
|
-
export
|
|
26
|
+
export interface SetupResponseHandlerOptions {
|
|
27
|
+
/**
|
|
28
|
+
* Runs on every incoming request and must settle before the responder method
|
|
29
|
+
* is invoked. Controllers use it to accept requests that arrive while their
|
|
30
|
+
* host is still becoming ready: discovery resolves at once, the answer
|
|
31
|
+
* follows as soon as the controller is attached.
|
|
32
|
+
*/
|
|
33
|
+
claim?: () => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Keep a `@respond({ daemon })` handler unregistered — and silent — when its
|
|
36
|
+
* daemon is not resolvable yet, instead of warning and dropping it. A caller
|
|
37
|
+
* that registers early (before the host is connected or ready) passes this
|
|
38
|
+
* and calls `setupResponseHandlers` again later; the second call registers
|
|
39
|
+
* whatever was deferred and warns then if it is still unresolvable.
|
|
40
|
+
*/
|
|
41
|
+
deferUnresolvableDaemons?: boolean;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Helper to setup response handlers for elements and controllers.
|
|
45
|
+
*
|
|
46
|
+
* Safe to call more than once for the same instance: a handler already
|
|
47
|
+
* registered is skipped rather than double-bound.
|
|
48
|
+
*/
|
|
49
|
+
export declare function setupResponseHandlers(instance: any, element: EventTarget, options?: SetupResponseHandlerOptions): void;
|
|
27
50
|
export declare function cleanupResponseHandlers(instance: any): void;
|
package/dist/symbols.cjs
CHANGED
package/dist/symbols.esm.js
CHANGED
package/dist/testing-dom.cjs
CHANGED
package/dist/testing-dom.esm.js
CHANGED
package/dist/transitions.cjs
CHANGED
package/dist/transitions.esm.js
CHANGED
package/docs/ai/DEVELOPMENT.md
CHANGED
|
@@ -140,7 +140,7 @@ All CDN builds use the shared runtime (external `snice` imports). Load `snice-ru
|
|
|
140
140
|
- IIFE: `.js` + `.min.js`
|
|
141
141
|
- Sourcemaps + README
|
|
142
142
|
|
|
143
|
-
**Size:** Runtime ~34KB gzip, components ~1-
|
|
143
|
+
**Size:** Runtime ~34KB gzip, components ~1-111KB each
|
|
144
144
|
|
|
145
145
|
**Features:**
|
|
146
146
|
- Shared runtime (external snice imports)
|
|
@@ -33,12 +33,15 @@ cellSizing: 'square'|'stretch' = 'square'; // attribute: cell-sizing — square:
|
|
|
33
33
|
|
|
34
34
|
- `calendar-change` -> `{ value: Date, calendar: SniceCalendarElement }`
|
|
35
35
|
- `calendar-event-click` -> `{ event: CalendarEvent, calendar: SniceCalendarElement }`
|
|
36
|
+
- `calendar-more-click` -> `{ date: Date, count: number, calendar: SniceCalendarElement }` — "+N more" chip clicked; does NOT fire `calendar-change`
|
|
36
37
|
|
|
37
38
|
## CSS Parts
|
|
38
39
|
|
|
39
40
|
- `base` - Main calendar container
|
|
40
41
|
- `header` - Header with title and navigation buttons
|
|
41
42
|
- `grid` - Day cells grid
|
|
43
|
+
- `more-chip` - Per-day "+N more" overflow chip
|
|
44
|
+
- `event-bar` / `event-avatar` / `event-tooltip` / `event-popover` - Event bar internals
|
|
42
45
|
|
|
43
46
|
## Basic Usage
|
|
44
47
|
|
|
@@ -57,6 +60,11 @@ calendar.events = [
|
|
|
57
60
|
// at week boundaries (squared corners on the continuing side, title repeats).
|
|
58
61
|
// Concurrent events stack into lanes (start asc, longer first on ties);
|
|
59
62
|
// max 3 lanes, deeper stacks collapse to a per-day "+N more" chip.
|
|
63
|
+
// Chip: part="more-chip", role="button" tabindex=0 (Enter/Space), click ->
|
|
64
|
+
// calendar-more-click { date, count }; the click never falls through to day
|
|
65
|
+
// selection. Use it to open your own day/agenda view:
|
|
66
|
+
// calendar.addEventListener('calendar-more-click',
|
|
67
|
+
// (e) => showDay(e.detail.date, e.detail.count));
|
|
60
68
|
// Bars: part="event-bar", click -> calendar-event-click.
|
|
61
69
|
// Styling: color -> background; avatar?: string | {src?,name?,alt?} ->
|
|
62
70
|
// <snice-avatar> on each bar (part="event-avatar"; name -> initials fallback);
|
|
@@ -51,6 +51,10 @@ readonly labels: NodeList | null;
|
|
|
51
51
|
- `tag-remove` -> `{ tag: string; index: number; value: string[] }`
|
|
52
52
|
- `tag-change` -> `{ value: string[] }`
|
|
53
53
|
|
|
54
|
+
Emitted only by tag edits (`addTag()`, `removeTag()`, and the user actions that
|
|
55
|
+
call them). Assigning `value`, `clear()`, reset, and restoration are silent, so a
|
|
56
|
+
`.value` binding fed from `tag-change` cannot loop.
|
|
57
|
+
|
|
54
58
|
## CSS Parts
|
|
55
59
|
|
|
56
60
|
- `base` - Outer wrapper div
|
package/docs/ai/controllers.md
CHANGED
|
@@ -78,21 +78,37 @@ el.controller = UserController; // snice elements
|
|
|
78
78
|
1. Controller instance created
|
|
79
79
|
2. `element` property set
|
|
80
80
|
3. Router application context passed (if available)
|
|
81
|
-
4.
|
|
82
|
-
5. `
|
|
83
|
-
6.
|
|
84
|
-
7.
|
|
85
|
-
8.
|
|
81
|
+
4. Channel/response handlers (`@respond`) set up
|
|
82
|
+
5. Element's `ready` promise awaited
|
|
83
|
+
6. `attach()` called
|
|
84
|
+
7. `@context` handlers registered and caught up with the current Router context
|
|
85
|
+
8. Observers set up
|
|
86
86
|
9. Event handlers set up
|
|
87
87
|
10. `controller-attached` event dispatched
|
|
88
88
|
|
|
89
|
-
Exception to step
|
|
89
|
+
Exception to step 5: `await attachController(this, ControllerClass)` inside the
|
|
90
90
|
host's own `@ready` handler attaches immediately because initial render is
|
|
91
91
|
already complete. Awaiting that same host's `ready` would self-deadlock. An
|
|
92
92
|
attachment targeting any other element still waits for the target's `ready`.
|
|
93
93
|
This runtime safeguard does not make attaching a controller to a routed page a
|
|
94
94
|
good architecture; pages should orchestrate directly.
|
|
95
95
|
|
|
96
|
+
`@respond` is installed at step 4, before the wait — the same ordering elements
|
|
97
|
+
use (an element installs `@respond` on connection, not at `ready`). A child's
|
|
98
|
+
mount-time `@request` therefore finds the controller even while the host is
|
|
99
|
+
still becoming ready: discovery resolves immediately, the request releases the
|
|
100
|
+
step-5 wait, and the handler runs once `attach()` and the remaining setup are
|
|
101
|
+
done. Without that ordering, a host whose `@ready` awaits a child that requests
|
|
102
|
+
on mount would deadlock — the child waits for a responder that is waiting for
|
|
103
|
+
the host's `ready` — and the attachment would fail. The responder body still
|
|
104
|
+
never runs before `attach()`, so state built there is safe to use.
|
|
105
|
+
|
|
106
|
+
`@respond('name', { daemon })` needs the host's app context to resolve its
|
|
107
|
+
target, and that context is unreachable while the host is still disconnected
|
|
108
|
+
(`attachController(el, C)` before `appendChild`). Resolvable → registered at
|
|
109
|
+
step 4 like the rest; not resolvable → registered after step 6 instead of being
|
|
110
|
+
dropped.
|
|
111
|
+
|
|
96
112
|
**Detachment flow:**
|
|
97
113
|
1. `detach()` called
|
|
98
114
|
2. `element` property set to null
|
|
@@ -75,6 +75,7 @@ interface CalendarEventAvatar {
|
|
|
75
75
|
|-------|--------|-------------|
|
|
76
76
|
| `calendar-change` | `{ value: Date, calendar: SniceCalendarElement }` | Fired when selected date changes |
|
|
77
77
|
| `calendar-event-click` | `{ event: CalendarEvent, calendar: SniceCalendarElement }` | Fired when an event is clicked |
|
|
78
|
+
| `calendar-more-click` | `{ date: Date, count: number, calendar: SniceCalendarElement }` | Fired when a day's `+N more` chip is clicked (or activated with Enter/Space). The day is not selected and `calendar-change` does not fire |
|
|
78
79
|
|
|
79
80
|
## CSS Parts
|
|
80
81
|
|
|
@@ -85,6 +86,11 @@ Style internal elements from outside the shadow DOM using `::part()`.
|
|
|
85
86
|
| `base` | The main calendar container |
|
|
86
87
|
| `header` | The header with month title and navigation buttons |
|
|
87
88
|
| `grid` | The day cells grid |
|
|
89
|
+
| `more-chip` | A day's `+N more` overflow chip |
|
|
90
|
+
| `event-bar` | An event stripe (plus any `className` you set on the event) |
|
|
91
|
+
| `event-avatar` | The `<snice-avatar>` rendered at the start of an event bar |
|
|
92
|
+
| `event-tooltip` | The shared tooltip overlay shown on event hover |
|
|
93
|
+
| `event-popover` | The popover opened by a `popover`-enabled event |
|
|
88
94
|
|
|
89
95
|
```css
|
|
90
96
|
snice-calendar::part(base) {
|
|
@@ -135,6 +141,24 @@ shown; days with deeper stacks get a `+N more` chip. Each bar exposes a
|
|
|
135
141
|
`part="event-bar"` for styling and dispatches `calendar-event-click` when
|
|
136
142
|
clicked.
|
|
137
143
|
|
|
144
|
+
The `+N more` chip is a control of its own: it exposes `part="more-chip"`, is
|
|
145
|
+
keyboard-reachable (`role="button"`, Enter/Space), and dispatches
|
|
146
|
+
`calendar-more-click` with the day it belongs to and how many events are
|
|
147
|
+
hidden there. Its click never falls through to day selection, so opening a
|
|
148
|
+
day view does not change the selected date:
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
calendar.addEventListener('calendar-more-click', (e) => {
|
|
152
|
+
// e.detail.date -> the day whose events overflowed
|
|
153
|
+
// e.detail.count -> how many events are hidden on that day
|
|
154
|
+
showDayAgenda(e.detail.date, calendar.getEventsForDate(e.detail.date));
|
|
155
|
+
});
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
```css
|
|
159
|
+
snice-calendar::part(more-chip) { color: #2563eb; }
|
|
160
|
+
```
|
|
161
|
+
|
|
138
162
|
Bars are styleable per event: `color` sets the background, `avatar` renders a
|
|
139
163
|
small `<snice-avatar>` at the start of each bar (`part="event-avatar"`) — an
|
|
140
164
|
image when `src` is given, initials from `name` otherwise — and `className` is
|
|
@@ -55,7 +55,12 @@ A chip/tag-style input field where users can add tags by typing and pressing Ent
|
|
|
55
55
|
|-------|--------|-------------|
|
|
56
56
|
| `tag-add` | `{ tag: string, value: string[] }` | A new tag was added |
|
|
57
57
|
| `tag-remove` | `{ tag: string, index: number, value: string[] }` | A tag was removed |
|
|
58
|
-
| `tag-change` | `{ value: string[] }` |
|
|
58
|
+
| `tag-change` | `{ value: string[] }` | A tag was added or removed |
|
|
59
|
+
|
|
60
|
+
`tag-add`, `tag-remove`, and `tag-change` describe tag edits: typing, removing a
|
|
61
|
+
tag, selecting a suggestion, `addTag()`, and `removeTag()`. Assigning `value`,
|
|
62
|
+
calling `clear()`, form reset, and form restoration change the tags silently, so
|
|
63
|
+
binding `value` to the `tag-change` payload never re-enters.
|
|
59
64
|
|
|
60
65
|
## CSS Parts
|
|
61
66
|
|
package/docs/controllers.md
CHANGED
|
@@ -128,15 +128,15 @@ through the element's reactive properties or events.
|
|
|
128
128
|
1. Controller instance is created
|
|
129
129
|
2. `element` property is set
|
|
130
130
|
3. Router application context is passed (if available)
|
|
131
|
-
4.
|
|
132
|
-
5. `
|
|
133
|
-
6.
|
|
134
|
-
7.
|
|
135
|
-
8.
|
|
131
|
+
4. Channel/response handlers (`@respond`) are set up
|
|
132
|
+
5. Element's `ready` promise is awaited
|
|
133
|
+
6. `attach()` method is called
|
|
134
|
+
7. `@context` handlers are registered and caught up with the current Router context
|
|
135
|
+
8. Observers are set up
|
|
136
136
|
9. Event handlers are set up
|
|
137
137
|
10. `controller-attached` event is dispatched
|
|
138
138
|
|
|
139
|
-
The step-
|
|
139
|
+
The step-5 wait has one safe exception: when an element calls
|
|
140
140
|
`await attachController(this, ControllerClass)` from its own `@ready` handler,
|
|
141
141
|
Snice attaches immediately. Initial rendering has already completed at that
|
|
142
142
|
point, and waiting for `ready` would otherwise create a self-deadlock because
|
|
@@ -145,6 +145,57 @@ other element still awaits that element's `ready` promise.
|
|
|
145
145
|
This runtime safeguard does not make attaching a controller to a routed page a
|
|
146
146
|
good architecture; pages should orchestrate directly.
|
|
147
147
|
|
|
148
|
+
#### Responders Are Reachable Before the Host Is Ready
|
|
149
|
+
|
|
150
|
+
`@respond` handlers are installed at step 4, *before* the wait — the same
|
|
151
|
+
ordering elements use, where `@respond` is installed on connection rather than
|
|
152
|
+
at `ready`. This matters for the common shape where a host's `@ready` waits on
|
|
153
|
+
a child that makes a request as it mounts:
|
|
154
|
+
|
|
155
|
+
```typescript
|
|
156
|
+
@element('report-host')
|
|
157
|
+
class ReportHost extends HTMLElement {
|
|
158
|
+
@ready()
|
|
159
|
+
async onReady() {
|
|
160
|
+
// The host cannot finish becoming ready until the child does...
|
|
161
|
+
await this.chart.ready;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@render()
|
|
165
|
+
renderContent() { return html`<report-chart></report-chart>`; }
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
@element('report-chart')
|
|
169
|
+
class ReportChart extends HTMLElement {
|
|
170
|
+
@request('report-data')
|
|
171
|
+
async *load(): Response<void> {
|
|
172
|
+
// ...and the child cannot finish until something answers this.
|
|
173
|
+
this.data = await (yield { range: '30d' });
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
@ready()
|
|
177
|
+
async onReady() { await this.load(); }
|
|
178
|
+
}
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
With `<report-host controller="report-controller">` answering `report-data`, the
|
|
182
|
+
child's request reaches the controller while the host's `ready` is still
|
|
183
|
+
pending: discovery resolves immediately, the request releases the step-5 wait,
|
|
184
|
+
and the responder runs once `attach()` and the remaining setup have completed.
|
|
185
|
+
If the responder were only installed after `ready`, the two sides would wait on
|
|
186
|
+
each other until a timeout fired and the attachment would fail outright.
|
|
187
|
+
|
|
188
|
+
The responder *body* still never runs before `attach()`, so anything the
|
|
189
|
+
controller builds in `attach()` is safe to use inside a `@respond` method.
|
|
190
|
+
|
|
191
|
+
`@respond('name', { daemon: 'x' })` has one extra condition. A daemon target is
|
|
192
|
+
resolved through the host's app context, which is unreachable while the host is
|
|
193
|
+
still disconnected — the shape where `attachController(el, Controller)` runs
|
|
194
|
+
before `el` is appended. When the context already resolves, the daemon-scoped
|
|
195
|
+
responder registers at step 4 with every other responder; when it does not, it
|
|
196
|
+
registers after `attach()` instead of being dropped, exactly where it registered
|
|
197
|
+
before.
|
|
198
|
+
|
|
148
199
|
### Detachment Flow
|
|
149
200
|
|
|
150
201
|
1. `detach()` method is called
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snice",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.8.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "A decorator-driven web component library with routing, controllers, daemons, and 130+ UI components. For better coding-agent results, run npx snice init-ai.",
|
|
6
6
|
"main": "dist/index.cjs",
|