@smilodon/core 1.4.11 → 1.4.13

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.
@@ -2,9 +2,11 @@
2
2
  * Enhanced Select Component
3
3
  * Implements all advanced features: infinite scroll, load more, busy state,
4
4
  * server-side selection, and full customization
5
+ *
6
+ * ✨ Redesigned with formal elegance, refined microinteractions, and polished UX
5
7
  */
6
8
  import type { GlobalSelectConfig } from '../config/global-config';
7
- import type { GroupedItem, ClassMap } from '../types';
9
+ import type { GroupedItem, ClassMap, SelectCapabilitiesReport, LimitationState, LimitationPolicyMap, TrackingSnapshot } from '../types';
8
10
  import type { OptionRenderer as OptionRendererFn } from '../renderers/contracts';
9
11
  export declare class EnhancedSelect extends HTMLElement {
10
12
  /** live set of all connected instances; used to auto-close siblings */
@@ -45,6 +47,9 @@ export declare class EnhancedSelect extends HTMLElement {
45
47
  private _mirrorGlobalStylesForCustomOptions;
46
48
  private _globalStylesObserver;
47
49
  private _globalStylesContainer;
50
+ private _tracking;
51
+ private _suppressBlurClose;
52
+ private _renderCycleId;
48
53
  get classMap(): ClassMap | undefined;
49
54
  set classMap(map: ClassMap | undefined);
50
55
  /**
@@ -63,6 +68,7 @@ export declare class EnhancedSelect extends HTMLElement {
63
68
  private _mirrorDocumentStylesIntoShadow;
64
69
  private _createContainer;
65
70
  private _createInputContainer;
71
+ private _syncInputContainerMode;
66
72
  private _createInput;
67
73
  private _createDropdown;
68
74
  private _createOptionsContainer;
@@ -103,6 +109,14 @@ export declare class EnhancedSelect extends HTMLElement {
103
109
  private _setBusy;
104
110
  private _handleError;
105
111
  private _emit;
112
+ private _track;
113
+ private _getKnownLimitationDefinitions;
114
+ private _evaluateLimitationStatus;
115
+ getKnownLimitations(): LimitationState[];
116
+ setLimitationPolicies(policies: LimitationPolicyMap): void;
117
+ getTrackingSnapshot(): TrackingSnapshot;
118
+ clearTracking(source?: 'event' | 'style' | 'limitation' | 'all'): void;
119
+ getCapabilities(): SelectCapabilitiesReport;
106
120
  private _emitChange;
107
121
  get optionRenderer(): OptionRendererFn | undefined;
108
122
  set optionRenderer(renderer: OptionRendererFn | undefined);
@@ -154,6 +168,7 @@ export declare class EnhancedSelect extends HTMLElement {
154
168
  * Update component configuration
155
169
  */
156
170
  updateConfig(config: Partial<GlobalSelectConfig>): void;
171
+ private _mergeConfig;
157
172
  private _handleClearControlClick;
158
173
  private _syncClearControlState;
159
174
  /**
@@ -2,6 +2,7 @@
2
2
  * Global Configuration System for Select Components
3
3
  * Allows users to define default behaviors that can be overridden at component level
4
4
  */
5
+ import type { KnownLimitationId, LimitationPolicy } from '../types';
5
6
  export interface ScrollToSelectedConfig {
6
7
  /** Whether to scroll to selected item when dropdown opens/closes */
7
8
  enabled: boolean;
@@ -69,6 +70,8 @@ export interface SelectionConfig {
69
70
  showRemoveButton?: boolean;
70
71
  /** Close dropdown after selection in single-select */
71
72
  closeOnSelect?: boolean;
73
+ /** Allow repeated trigger clicks to toggle the dropdown open/closed */
74
+ toggleOnTriggerClick?: boolean;
72
75
  }
73
76
  export interface StyleConfig {
74
77
  /** Container styles */
@@ -156,6 +159,26 @@ export interface CallbackConfig {
156
159
  /** Called on error */
157
160
  onError?: (error: Error) => void;
158
161
  }
162
+ export interface TrackingConfig {
163
+ /** Master switch for runtime tracking */
164
+ enabled: boolean;
165
+ /** Track emitted events */
166
+ events: boolean;
167
+ /** Track styling-related changes */
168
+ styling: boolean;
169
+ /** Track limitations and policy changes */
170
+ limitations: boolean;
171
+ /** Emit `diagnostic` events for tracking entries */
172
+ emitDiagnostics: boolean;
173
+ /** Maximum retained entries per tracking channel */
174
+ maxEntries: number;
175
+ }
176
+ export interface LimitationsConfig {
177
+ /** Policy map for known limitations */
178
+ policies: Partial<Record<KnownLimitationId, LimitationPolicy>>;
179
+ /** Auto-reset selection state when mode changes single <-> multi */
180
+ autoMitigateRuntimeModeSwitch: boolean;
181
+ }
159
182
  export interface GlobalSelectConfig {
160
183
  /** Selection behavior */
161
184
  selection: SelectionConfig;
@@ -177,6 +200,10 @@ export interface GlobalSelectConfig {
177
200
  clearControl: ClearControlConfig;
178
201
  /** Callbacks */
179
202
  callbacks: CallbackConfig;
203
+ /** Runtime tracking controls */
204
+ tracking: TrackingConfig;
205
+ /** Known limitations controls */
206
+ limitations: LimitationsConfig;
180
207
  /** Enable/disable entire component */
181
208
  enabled: boolean;
182
209
  /** Enable search/filter */
@@ -64,6 +64,63 @@ export interface ClearEventDetail {
64
64
  clearedSelection: boolean;
65
65
  clearedSearch: boolean;
66
66
  }
67
+ export type KnownLimitationId = 'variableItemHeight' | 'builtInFetchPaginationApi' | 'virtualizationOverheadSmallLists' | 'runtimeModeSwitching' | 'legacyBrowserSupport' | 'webkitArchLinux';
68
+ export type LimitationControlMode = 'default' | 'suppress' | 'strict';
69
+ export interface LimitationPolicy {
70
+ mode: LimitationControlMode;
71
+ note?: string;
72
+ }
73
+ export type LimitationPolicyMap = Partial<Record<KnownLimitationId, LimitationPolicy>>;
74
+ export interface LimitationState {
75
+ id: KnownLimitationId;
76
+ title: string;
77
+ description: string;
78
+ mode: LimitationControlMode;
79
+ status: 'active' | 'mitigated' | 'suppressed';
80
+ workaround?: string;
81
+ }
82
+ export interface TrackingEntry {
83
+ timestamp: number;
84
+ source: 'event' | 'style' | 'limitation';
85
+ name: string;
86
+ detail?: unknown;
87
+ }
88
+ export interface TrackingSnapshot {
89
+ events: TrackingEntry[];
90
+ styles: TrackingEntry[];
91
+ limitations: TrackingEntry[];
92
+ }
93
+ export interface SelectCapabilitiesReport {
94
+ styling: {
95
+ classMap: boolean;
96
+ optionRenderer: boolean;
97
+ groupHeaderRenderer: boolean;
98
+ cssCustomProperties: boolean;
99
+ shadowParts: boolean;
100
+ globalStyleMirroring: boolean;
101
+ };
102
+ events: {
103
+ emitted: SelectEventName[];
104
+ diagnosticEvent: boolean;
105
+ };
106
+ functionality: {
107
+ multiSelect: boolean;
108
+ searchable: boolean;
109
+ infiniteScroll: boolean;
110
+ loadMore: boolean;
111
+ clearControl: boolean;
112
+ groupedItems: boolean;
113
+ serverSideSelection: boolean;
114
+ runtimeModeSwitchMitigation: boolean;
115
+ };
116
+ limitations: LimitationState[];
117
+ }
118
+ export interface DiagnosticEventDetail {
119
+ timestamp: number;
120
+ source: 'event' | 'style' | 'limitation';
121
+ name: string;
122
+ detail?: unknown;
123
+ }
67
124
  export interface SelectEventsDetailMap {
68
125
  select: SelectEventDetail;
69
126
  open: OpenEventDetail;
@@ -75,6 +132,7 @@ export interface SelectEventsDetailMap {
75
132
  loadMore: LoadMoreEventDetail;
76
133
  remove: RemoveEventDetail;
77
134
  clear: ClearEventDetail;
135
+ diagnostic: DiagnosticEventDetail;
78
136
  }
79
137
  export type SelectEventName = keyof SelectEventsDetailMap;
80
138
  export interface RendererHelpers {
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smilodon/core",
3
- "version": "1.4.11",
3
+ "version": "1.4.13",
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",