@smilodon/core 1.13.0 → 1.17.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.
@@ -6,7 +6,7 @@
6
6
  * Redesigned with formal elegance, refined microinteractions, and polished UX
7
7
  */
8
8
  import type { DataLoadingStateSnapshot, DataRequestCompletion, DataRequestCompletionResult, EnhancedSelectAcknowledgedSurface, SelectInstanceConfig } from '../data-loading/public-types.js';
9
- import type { GroupedItem, ClassMap, SelectCapabilitiesReport, LimitationState, LimitationPolicyMap, TrackingSnapshot } from '../types.js';
9
+ import type { GroupedItem, ClassMap, SelectCapabilitiesReport, LimitationState, LimitationPolicyMap, TrackingSnapshot, EmptyStateContext } from '../types.js';
10
10
  import type { OptionRenderer as OptionRendererFn } from '../renderers/contracts.js';
11
11
  export declare class EnhancedSelect extends HTMLElement implements EnhancedSelectAcknowledgedSurface {
12
12
  static get observedAttributes(): string[];
@@ -43,6 +43,7 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
43
43
  private _engine;
44
44
  private _virtualizationScope;
45
45
  private _renderPlan;
46
+ private _emptyStateContext;
46
47
  private _guardedVirtualWindow;
47
48
  private _guardedVirtualizer;
48
49
  private _guardedVirtualizationRequested;
@@ -102,6 +103,10 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
102
103
  private _pendingFirstRenderMark;
103
104
  private _pendingSearchRenderMark;
104
105
  private _rangeAnchorIndex;
106
+ /** Chip identity is tracked independently of dropdown option positions. */
107
+ private _lastRenderedChipKeys;
108
+ private _latestChipScrollGeneration;
109
+ private _latestChipScrollFrame;
105
110
  private _optionRenderer?;
106
111
  private _groupHeaderRenderer?;
107
112
  private _classMap?;
@@ -269,6 +274,8 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
269
274
  private _handleSearch;
270
275
  private _handleKeydown;
271
276
  private _moveActive;
277
+ /** Return true only when boundary navigation is held for an in-flight/new page. */
278
+ private _requestKeyboardLoadMore;
272
279
  private _setActive;
273
280
  private _getOptionElementByIndex;
274
281
  private _getSelectableOptions;
@@ -283,6 +290,8 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
283
290
  private _selectOption;
284
291
  private _handleOptionRemove;
285
292
  private _updateInputDisplay;
293
+ private _cancelLatestChipScroll;
294
+ private _scheduleLatestChipScroll;
286
295
  private _isActivelyEditingSearchInput;
287
296
  private _renderOptionsWithAnimation;
288
297
  private _scrollToSelected;
@@ -298,6 +307,10 @@ export declare class EnhancedSelect extends HTMLElement implements EnhancedSelec
298
307
  getTrackingSnapshot(): TrackingSnapshot;
299
308
  clearTracking(source?: 'event' | 'style' | 'limitation' | 'all'): void;
300
309
  getCapabilities(): SelectCapabilitiesReport;
310
+ /** Return a detached immutable snapshot of the currently rendered empty state. */
311
+ getEmptyStateContext(): EmptyStateContext | null;
312
+ private _syncEmptyStateContext;
313
+ private _appendEmptyState;
301
314
  private _emitChange;
302
315
  get optionRenderer(): OptionRendererFn | undefined;
303
316
  set optionRenderer(renderer: OptionRendererFn | undefined);
@@ -109,6 +109,10 @@ export interface MultiSelectDisplayConfig {
109
109
  overflowY?: 'auto' | 'scroll' | 'hidden';
110
110
  /** Enable drag-to-scroll interactions in horizontal mode */
111
111
  dragScroll?: boolean;
112
+ /** Scroll the chip viewport to newly added selections, without moving it on removal. */
113
+ scrollToLatestChip?: boolean;
114
+ /** Scrolling behavior for a newly selected chip; reduced-motion users get instant movement. */
115
+ scrollToLatestChipBehavior?: 'auto' | 'smooth';
112
116
  }
113
117
  /**
114
118
  * Plain CSS style object for component part configuration.
@@ -1,5 +1,5 @@
1
1
  export * from './types.js';
2
- export type { SelectEventDetail, OpenEventDetail, CloseEventDetail, SearchEventDetail, ChangeEventDetail, LoadMoreEventDetail, RemoveEventDetail, ClearEventDetail, ErrorEventDetail, PageLoadedEventDetail, GroupedItem, RemoteConfig, Placement, Strategy, NativeSelectOptions, RendererHelpers, SelectEventsDetailMap, SelectEventName } from './types.js';
2
+ export type { SelectEventDetail, OpenEventDetail, CloseEventDetail, SearchEventDetail, ChangeEventDetail, LoadMoreEventDetail, RemoveEventDetail, ClearEventDetail, EmptyStateReason, EmptyStateContext, EmptyStateChangeDetail, ErrorEventDetail, PageLoadedEventDetail, GroupedItem, RemoteConfig, Placement, Strategy, NativeSelectOptions, RendererHelpers, SelectEventsDetailMap, SelectEventName } from './types.js';
3
3
  export type { CustomOptionContract, CustomOptionContext, CustomOptionFactory, ExtendedSelectItem, OptionRendererMode, CustomOptionConfig, CustomOptionEvents } from './types/custom-option.js';
4
4
  export * from './renderers/contracts.js';
5
5
  export * from './engine/index.js';
@@ -66,6 +66,14 @@ export interface ClearEventDetail {
66
66
  clearedSelection: boolean;
67
67
  clearedSearch: boolean;
68
68
  }
69
+ export type EmptyStateReason = 'no-options' | 'no-results';
70
+ export interface EmptyStateContext {
71
+ readonly query: string;
72
+ readonly reason: EmptyStateReason;
73
+ }
74
+ export interface EmptyStateChangeDetail {
75
+ readonly context: EmptyStateContext | null;
76
+ }
69
77
  export type LimitationPolicyMap = Partial<Record<KnownLimitationId, LimitationPolicy>>;
70
78
  export interface LimitationState {
71
79
  id: KnownLimitationId;
@@ -91,6 +99,7 @@ export interface SelectCapabilitiesReport {
91
99
  classMap: boolean;
92
100
  optionRenderer: boolean;
93
101
  groupHeaderRenderer: boolean;
102
+ emptyStateSlot: boolean;
94
103
  cssCustomProperties: boolean;
95
104
  shadowParts: boolean;
96
105
  globalStyleMirroring: boolean;
@@ -128,6 +137,7 @@ export interface SelectEventsDetailMap {
128
137
  loadMore: LoadMoreEventDetail;
129
138
  remove: RemoveEventDetail;
130
139
  clear: ClearEventDetail;
140
+ emptyStateChange: EmptyStateChangeDetail;
131
141
  diagnostic: DiagnosticEventDetail;
132
142
  }
133
143
  export type SelectEventName = keyof SelectEventsDetailMap;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smilodon/core",
3
- "version": "1.13.0",
3
+ "version": "1.17.0",
4
4
  "description": "High-performance native select component with extreme-scale virtualization - React, Vue, Svelte, Vanilla JS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",