mtrl-addons 0.2.2 → 0.2.4

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 (129) hide show
  1. package/{src/components/index.ts → dist/components/index.d.ts} +0 -2
  2. package/dist/components/vlist/config.d.ts +86 -0
  3. package/{src/components/vlist/constants.ts → dist/components/vlist/constants.d.ts} +10 -11
  4. package/dist/components/vlist/features/api.d.ts +7 -0
  5. package/{src/components/vlist/features/index.ts → dist/components/vlist/features/index.d.ts} +0 -2
  6. package/dist/components/vlist/features/selection.d.ts +6 -0
  7. package/dist/components/vlist/features/viewport.d.ts +9 -0
  8. package/dist/components/vlist/features.d.ts +31 -0
  9. package/{src/components/vlist/index.ts → dist/components/vlist/index.d.ts} +1 -10
  10. package/dist/components/vlist/types.d.ts +596 -0
  11. package/dist/components/vlist/vlist.d.ts +29 -0
  12. package/dist/core/compose/features/gestures/index.d.ts +86 -0
  13. package/dist/core/compose/features/gestures/longpress.d.ts +85 -0
  14. package/dist/core/compose/features/gestures/pan.d.ts +108 -0
  15. package/dist/core/compose/features/gestures/pinch.d.ts +111 -0
  16. package/dist/core/compose/features/gestures/rotate.d.ts +111 -0
  17. package/dist/core/compose/features/gestures/swipe.d.ts +149 -0
  18. package/dist/core/compose/features/gestures/tap.d.ts +79 -0
  19. package/{src/core/compose/features/index.ts → dist/core/compose/features/index.d.ts} +1 -2
  20. package/{src/core/compose/index.ts → dist/core/compose/index.d.ts} +2 -11
  21. package/{src/core/gestures/index.ts → dist/core/gestures/index.d.ts} +1 -20
  22. package/dist/core/gestures/longpress.d.ts +23 -0
  23. package/dist/core/gestures/manager.d.ts +14 -0
  24. package/dist/core/gestures/pan.d.ts +12 -0
  25. package/dist/core/gestures/pinch.d.ts +14 -0
  26. package/dist/core/gestures/rotate.d.ts +14 -0
  27. package/dist/core/gestures/swipe.d.ts +20 -0
  28. package/dist/core/gestures/tap.d.ts +12 -0
  29. package/dist/core/gestures/types.d.ts +320 -0
  30. package/dist/core/gestures/utils.d.ts +57 -0
  31. package/dist/core/index.d.ts +13 -0
  32. package/dist/core/layout/config.d.ts +33 -0
  33. package/dist/core/layout/index.d.ts +51 -0
  34. package/dist/core/layout/jsx.d.ts +65 -0
  35. package/dist/core/layout/schema.d.ts +112 -0
  36. package/dist/core/layout/types.d.ts +69 -0
  37. package/dist/core/viewport/constants.d.ts +105 -0
  38. package/dist/core/viewport/features/base.d.ts +14 -0
  39. package/dist/core/viewport/features/collection.d.ts +41 -0
  40. package/dist/core/viewport/features/events.d.ts +13 -0
  41. package/{src/core/viewport/features/index.ts → dist/core/viewport/features/index.d.ts} +0 -7
  42. package/dist/core/viewport/features/item-size.d.ts +30 -0
  43. package/dist/core/viewport/features/loading.d.ts +34 -0
  44. package/dist/core/viewport/features/momentum.d.ts +17 -0
  45. package/dist/core/viewport/features/performance.d.ts +53 -0
  46. package/dist/core/viewport/features/placeholders.d.ts +38 -0
  47. package/dist/core/viewport/features/rendering.d.ts +16 -0
  48. package/dist/core/viewport/features/scrollbar.d.ts +26 -0
  49. package/dist/core/viewport/features/scrolling.d.ts +16 -0
  50. package/dist/core/viewport/features/utils.d.ts +43 -0
  51. package/dist/core/viewport/features/virtual.d.ts +18 -0
  52. package/{src/core/viewport/index.ts → dist/core/viewport/index.d.ts} +1 -17
  53. package/dist/core/viewport/types.d.ts +96 -0
  54. package/dist/core/viewport/utils/speed-tracker.d.ts +22 -0
  55. package/dist/core/viewport/viewport.d.ts +11 -0
  56. package/{src/index.ts → dist/index.d.ts} +0 -4
  57. package/dist/index.js +5143 -0
  58. package/dist/index.mjs +5111 -0
  59. package/dist/styles.css +254 -0
  60. package/dist/styles.css.map +1 -0
  61. package/package.json +16 -2
  62. package/.cursorrules +0 -117
  63. package/AI.md +0 -39
  64. package/CLAUDE.md +0 -882
  65. package/build.js +0 -377
  66. package/index.ts +0 -7
  67. package/scripts/analyze-orphaned-functions.ts +0 -387
  68. package/scripts/debug/vlist-selection.ts +0 -121
  69. package/src/components/vlist/config.ts +0 -323
  70. package/src/components/vlist/features/api.ts +0 -626
  71. package/src/components/vlist/features/selection.ts +0 -436
  72. package/src/components/vlist/features/viewport.ts +0 -59
  73. package/src/components/vlist/features.ts +0 -112
  74. package/src/components/vlist/types.ts +0 -723
  75. package/src/components/vlist/vlist.ts +0 -92
  76. package/src/core/compose/features/gestures/index.ts +0 -227
  77. package/src/core/compose/features/gestures/longpress.ts +0 -383
  78. package/src/core/compose/features/gestures/pan.ts +0 -424
  79. package/src/core/compose/features/gestures/pinch.ts +0 -475
  80. package/src/core/compose/features/gestures/rotate.ts +0 -485
  81. package/src/core/compose/features/gestures/swipe.ts +0 -492
  82. package/src/core/compose/features/gestures/tap.ts +0 -334
  83. package/src/core/gestures/longpress.ts +0 -68
  84. package/src/core/gestures/manager.ts +0 -418
  85. package/src/core/gestures/pan.ts +0 -48
  86. package/src/core/gestures/pinch.ts +0 -58
  87. package/src/core/gestures/rotate.ts +0 -58
  88. package/src/core/gestures/swipe.ts +0 -66
  89. package/src/core/gestures/tap.ts +0 -45
  90. package/src/core/gestures/types.ts +0 -387
  91. package/src/core/gestures/utils.ts +0 -128
  92. package/src/core/index.ts +0 -43
  93. package/src/core/layout/config.ts +0 -102
  94. package/src/core/layout/index.ts +0 -168
  95. package/src/core/layout/jsx.ts +0 -174
  96. package/src/core/layout/schema.ts +0 -1044
  97. package/src/core/layout/types.ts +0 -95
  98. package/src/core/viewport/constants.ts +0 -145
  99. package/src/core/viewport/features/base.ts +0 -73
  100. package/src/core/viewport/features/collection.ts +0 -1182
  101. package/src/core/viewport/features/events.ts +0 -130
  102. package/src/core/viewport/features/item-size.ts +0 -271
  103. package/src/core/viewport/features/loading.ts +0 -263
  104. package/src/core/viewport/features/momentum.ts +0 -269
  105. package/src/core/viewport/features/performance.ts +0 -161
  106. package/src/core/viewport/features/placeholders.ts +0 -335
  107. package/src/core/viewport/features/rendering.ts +0 -962
  108. package/src/core/viewport/features/scrollbar.ts +0 -434
  109. package/src/core/viewport/features/scrolling.ts +0 -634
  110. package/src/core/viewport/features/utils.ts +0 -94
  111. package/src/core/viewport/features/virtual.ts +0 -525
  112. package/src/core/viewport/types.ts +0 -133
  113. package/src/core/viewport/utils/speed-tracker.ts +0 -79
  114. package/src/core/viewport/viewport.ts +0 -265
  115. package/test/benchmarks/layout/advanced.test.ts +0 -656
  116. package/test/benchmarks/layout/comparison.test.ts +0 -519
  117. package/test/benchmarks/layout/performance-comparison.test.ts +0 -274
  118. package/test/benchmarks/layout/real-components.test.ts +0 -733
  119. package/test/benchmarks/layout/simple.test.ts +0 -321
  120. package/test/benchmarks/layout/stress.test.ts +0 -990
  121. package/test/collection/basic.test.ts +0 -304
  122. package/test/components/vlist-selection.test.ts +0 -240
  123. package/test/components/vlist.test.ts +0 -63
  124. package/test/core/collection/adapter.test.ts +0 -161
  125. package/test/core/collection/collection.test.ts +0 -394
  126. package/test/core/layout/layout.test.ts +0 -201
  127. package/test/utils/dom-helpers.ts +0 -275
  128. package/test/utils/performance-helpers.ts +0 -392
  129. package/tsconfig.json +0 -20
@@ -3,7 +3,5 @@
3
3
  *
4
4
  * Central export point for all components
5
5
  */
6
-
7
- // VList component (virtual list with viewport)
8
6
  export { createVList } from "./vlist";
9
7
  export type { VListConfig, VListComponent } from "./vlist/types";
@@ -0,0 +1,86 @@
1
+ /**
2
+ * mtrl-addons List Component Configuration
3
+ *
4
+ * Configuration utilities and defaults for the list component.
5
+ * Follows mtrl patterns for component configuration.
6
+ */
7
+ import type { ListConfig, ListItem } from "./types";
8
+ /**
9
+ * Default configuration for the mtrl-addons List component
10
+ */
11
+ export declare const defaultConfig: Partial<ListConfig>;
12
+ export declare function createBaseConfig<T extends ListItem = ListItem>(config?: ListConfig<T>): Required<ListConfig<T>>;
13
+ /**
14
+ * Creates element configuration for withElement
15
+ * @param {ListConfig} config - List configuration
16
+ * @returns {Object} Element configuration
17
+ */
18
+ export declare function getElementConfig<T extends ListItem = ListItem>(config: ListConfig<T>): any;
19
+ /**
20
+ * Creates API configuration for the List component
21
+ * @param {Object} component - Component with list functionality
22
+ * @returns {Object} API configuration object for withApi
23
+ */
24
+ export declare function getApiConfig<T extends ListItem = ListItem>(component: any): {
25
+ data: {
26
+ add: any;
27
+ update: any;
28
+ remove: any;
29
+ clear: any;
30
+ refresh: any;
31
+ getItems: any;
32
+ getItem: any;
33
+ query: any;
34
+ sort: any;
35
+ getSize: any;
36
+ isEmpty: any;
37
+ isLoading: any;
38
+ getError: any;
39
+ };
40
+ selection: {
41
+ selectItem: any;
42
+ deselectItem: any;
43
+ selectAll: any;
44
+ deselectAll: any;
45
+ getSelectedItems: any;
46
+ getSelectedIds: any;
47
+ } | undefined;
48
+ scrolling: {
49
+ scrollToItem: any;
50
+ scrollToIndex: any;
51
+ scrollToPage: any;
52
+ };
53
+ performance: {
54
+ getMetrics: any;
55
+ resetMetrics: any;
56
+ };
57
+ template: {
58
+ setTemplate: any;
59
+ getTemplate: any;
60
+ };
61
+ events: {
62
+ on: any;
63
+ off: any;
64
+ emit: any;
65
+ subscribe: any;
66
+ };
67
+ lifecycle: {
68
+ destroy: any;
69
+ };
70
+ config: {
71
+ selection: any;
72
+ scroll: any;
73
+ };
74
+ };
75
+ /**
76
+ * Validates list configuration
77
+ */
78
+ export declare const validateConfig: (config: ListConfig) => void;
79
+ /**
80
+ * Creates Collection configuration from List config
81
+ */
82
+ export declare const getCollectionConfig: (config: ListConfig) => {
83
+ adapter: import("./types").ListAdapter<ListItem> | undefined;
84
+ items: ListItem[] | undefined;
85
+ cache: any;
86
+ };
@@ -5,19 +5,18 @@
5
5
  * Note: Base mtrl list functionality is handled by mtrl core.
6
6
  * These constants are for addons-specific features only.
7
7
  */
8
-
9
8
  /**
10
9
  * CSS class names for VList component
11
10
  * Following BEM convention: component__element--modifier
12
11
  * Note: mtrl prefix is added automatically by core DOM classes system
13
12
  */
14
- export const VLIST_CLASSES = {
15
- /** List element */
16
- LIST: "vlist",
17
- /** List item */
18
- ITEM: "viewport-item",
19
- /** Selected list item */
20
- SELECTED: "viewport-item--selected",
21
- /** Empty state */
22
- EMPTY: "vlist--empty",
23
- } as const;
13
+ export declare const VLIST_CLASSES: {
14
+ /** List element */
15
+ readonly LIST: "vlist";
16
+ /** List item */
17
+ readonly ITEM: "viewport-item";
18
+ /** Selected list item */
19
+ readonly SELECTED: "viewport-item--selected";
20
+ /** Empty state */
21
+ readonly EMPTY: "vlist--empty";
22
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * API feature for VList
3
+ * Provides a clean public API for the VList component
4
+ */
5
+ import type { VListConfig, VListItem } from "../types";
6
+ export type { RemoveItemOptions } from "../types";
7
+ export declare const withAPI: <T extends VListItem = VListItem>(config: VListConfig<T>) => (component: any) => any;
@@ -3,8 +3,6 @@
3
3
  *
4
4
  * List-specific features and enhancements.
5
5
  */
6
-
7
- // VList-specific features
8
6
  export { withViewport } from "./viewport";
9
7
  export { withAPI } from "./api";
10
8
  export { withSelection } from "./selection";
@@ -0,0 +1,6 @@
1
+ import type { VListConfig, VListComponent, VListItem } from "../types";
2
+ /**
3
+ * Adds selection management capabilities to VList component
4
+ */
5
+ export declare const withSelection: <T extends VListItem = VListItem>(config: VListConfig<T>) => (component: VListComponent<T>) => VListComponent<T>;
6
+ export default withSelection;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Viewport feature for VList
3
+ * Integrates the core viewport functionality with VList component
4
+ */
5
+ import type { VListConfig, VListItem } from "../types";
6
+ /**
7
+ * Adds viewport functionality to VList
8
+ */
9
+ export declare const withViewport: <T extends VListItem = VListItem>(config: VListConfig<T>) => (component: any) => any;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * List component features
3
+ *
4
+ * Modular features that can be composed with the list component.
5
+ * Following mtrl's functional composition pattern.
6
+ */
7
+ import type { ListComponent, ListItem } from "./types";
8
+ /**
9
+ * Virtual scrolling feature (future implementation)
10
+ * This will provide window-based virtual scrolling for massive datasets
11
+ */
12
+ export declare function withVirtualScroll<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
13
+ /**
14
+ * Enhanced list selection feature (future implementation)
15
+ * This will provide advanced selection patterns
16
+ */
17
+ export declare function withListSelection<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
18
+ /**
19
+ * Advanced list styling feature (future implementation)
20
+ * This will provide theme integration and advanced styling
21
+ */
22
+ export declare function withListStyling<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
23
+ /**
24
+ * Performance optimization feature (future implementation)
25
+ * This will provide advanced performance monitoring and optimization
26
+ */
27
+ export declare function withListPerformance<T extends ListItem = ListItem>(config?: any): (list: ListComponent<T>) => ListComponent<T>;
28
+ /**
29
+ * Re-export the internal composition functions for advanced usage
30
+ * These are the actual working implementations used in createList
31
+ */
@@ -4,14 +4,5 @@
4
4
  * A high-performance virtual list component that uses the viewport
5
5
  * feature directly without the list-manager layer.
6
6
  */
7
-
8
7
  export { createVList } from "./vlist";
9
- export type {
10
- RemoveItemOptions,
11
- VListConfig,
12
- VListComponent,
13
- VListItem,
14
- VListAPI,
15
- VListState,
16
- VListEvents,
17
- } from "./types";
8
+ export type { RemoveItemOptions, VListConfig, VListComponent, VListItem, VListAPI, VListState, VListEvents, } from "./types";