@internetarchive/collection-browser 4.1.0 → 4.1.1-alpha-webdev8185.1

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 (30) hide show
  1. package/dist/index.d.ts +1 -1
  2. package/dist/index.js +1 -1
  3. package/dist/index.js.map +1 -1
  4. package/dist/src/collection-browser.d.ts +9 -18
  5. package/dist/src/collection-browser.js +779 -838
  6. package/dist/src/collection-browser.js.map +1 -1
  7. package/dist/src/data-source/collection-browser-data-source.js +2 -3
  8. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  9. package/dist/src/data-source/collection-browser-query-state.d.ts +5 -3
  10. package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
  11. package/dist/src/models.d.ts +27 -2
  12. package/dist/src/models.js +36 -0
  13. package/dist/src/models.js.map +1 -1
  14. package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +2 -2
  15. package/dist/src/sort-filter-bar/sort-filter-bar.js +280 -280
  16. package/dist/src/sort-filter-bar/sort-filter-bar.js.map +1 -1
  17. package/dist/test/collection-browser.test.js +204 -206
  18. package/dist/test/collection-browser.test.js.map +1 -1
  19. package/dist/test/sort-filter-bar/sort-filter-bar.test.js +22 -22
  20. package/dist/test/sort-filter-bar/sort-filter-bar.test.js.map +1 -1
  21. package/index.ts +5 -0
  22. package/package.json +1 -1
  23. package/src/collection-browser.ts +3001 -3070
  24. package/src/data-source/collection-browser-data-source.ts +1443 -1444
  25. package/src/data-source/collection-browser-query-state.ts +69 -60
  26. package/src/models.ts +53 -4
  27. package/src/sort-filter-bar/sort-filter-bar.ts +732 -733
  28. package/test/collection-browser.test.ts +2400 -2402
  29. package/test/sort-filter-bar/sort-filter-bar.test.ts +443 -443
  30. package/.claude/settings.local.json +0 -8
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ export { CollectionBrowserDataSource } from './src/data-source/collection-browse
3
3
  export { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';
4
4
  export { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';
5
5
  export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
6
- export { CollectionDisplayMode, SortField, TileModel, FacetOption, SelectedFacets, getDefaultSelectedFacets, } from './src/models';
6
+ export { CollectionDisplayMode, SortField, ExplicitSortField, TileModel, FacetOption, SelectedFacets, getDefaultSelectedFacets, sortOptionFromAPIString, resolveCollectionDefaultSort, SORT_OPTIONS, defaultProfileElementSorts, } from './src/models';
7
7
  export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
8
8
  export { CollectionTile } from './src/tiles/grid/collection-tile';
9
9
  export { AccountTile } from './src/tiles/grid/account-tile';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CollectionBrowser } from './src/collection-browser';
2
2
  export { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';
3
3
  export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
4
- export { SortField, TileModel, getDefaultSelectedFacets, } from './src/models';
4
+ export { SortField, TileModel, getDefaultSelectedFacets, sortOptionFromAPIString, resolveCollectionDefaultSort, SORT_OPTIONS, defaultProfileElementSorts, } from './src/models';
5
5
  export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
6
6
  export { CollectionTile } from './src/tiles/grid/collection-tile';
7
7
  export { AccountTile } from './src/tiles/grid/account-tile';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAEL,SAAS,EACT,SAAS,EAGT,wBAAwB,GACzB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAO7D,cAAc,uDAAuD,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC","sourcesContent":["export { CollectionBrowser } from './src/collection-browser';\nexport { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';\nexport { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';\nexport { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';\nexport { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';\nexport {\n CollectionDisplayMode,\n SortField,\n TileModel,\n FacetOption,\n SelectedFacets,\n getDefaultSelectedFacets,\n} from './src/models';\nexport { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';\nexport { CollectionTile } from './src/tiles/grid/collection-tile';\nexport { AccountTile } from './src/tiles/grid/account-tile';\nexport { ItemTile } from './src/tiles/grid/item-tile';\nexport { TileList } from './src/tiles/list/tile-list';\nexport { TileListCompact } from './src/tiles/list/tile-list-compact';\nexport { TileDispatcher } from './src/tiles/tile-dispatcher';\nexport { LayoutType } from './src/tiles/models';\nexport {\n SmartQueryHeuristic,\n KeywordFacetMap,\n SmartFacet,\n} from './src/collection-facets/smart-facets/models';\nexport * from './src/collection-facets/smart-facets/heuristics/index';\nexport { SmartQueryHeuristicGroup } from './src/collection-facets/smart-facets/smart-facet-heuristics';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,2BAA2B,EAAE,MAAM,kDAAkD,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,EAEL,SAAS,EAET,SAAS,EAGT,wBAAwB,EACxB,uBAAuB,EACvB,4BAA4B,EAC5B,YAAY,EACZ,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAC;AAC3F,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAO7D,cAAc,uDAAuD,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,6DAA6D,CAAC","sourcesContent":["export { CollectionBrowser } from './src/collection-browser';\nexport { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';\nexport { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';\nexport { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';\nexport { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';\nexport {\n CollectionDisplayMode,\n SortField,\n ExplicitSortField,\n TileModel,\n FacetOption,\n SelectedFacets,\n getDefaultSelectedFacets,\n sortOptionFromAPIString,\n resolveCollectionDefaultSort,\n SORT_OPTIONS,\n defaultProfileElementSorts,\n} from './src/models';\nexport { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';\nexport { CollectionTile } from './src/tiles/grid/collection-tile';\nexport { AccountTile } from './src/tiles/grid/account-tile';\nexport { ItemTile } from './src/tiles/grid/item-tile';\nexport { TileList } from './src/tiles/list/tile-list';\nexport { TileListCompact } from './src/tiles/list/tile-list-compact';\nexport { TileDispatcher } from './src/tiles/tile-dispatcher';\nexport { LayoutType } from './src/tiles/models';\nexport {\n SmartQueryHeuristic,\n KeywordFacetMap,\n SmartFacet,\n} from './src/collection-facets/smart-facets/models';\nexport * from './src/collection-facets/smart-facets/heuristics/index';\nexport { SmartQueryHeuristicGroup } from './src/collection-facets/smart-facets/smart-facet-heuristics';\n"]}
@@ -7,7 +7,7 @@ import '@internetarchive/infinite-scroller';
7
7
  import type { ModalManagerInterface } from '@internetarchive/modal-manager';
8
8
  import type { FeatureFeedbackServiceInterface } from '@internetarchive/feature-feedback';
9
9
  import type { RecaptchaManagerInterface } from '@internetarchive/recaptcha-manager';
10
- import { SelectedFacets, SortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails, FacetLoadStrategy } from './models';
10
+ import { SelectedFacets, SortField, type ExplicitSortField, CollectionBrowserContext, TileModel, CollectionDisplayMode, FacetEventDetails, FacetLoadStrategy } from './models';
11
11
  import { RestorationStateHandlerInterface } from './restoration-state-handler';
12
12
  import type { CollectionBrowserQueryState, CollectionBrowserSearchInterface } from './data-source/collection-browser-query-state';
13
13
  import type { CollectionBrowserDataSourceInterface } from './data-source/collection-browser-data-source-interface';
@@ -61,7 +61,7 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
61
61
  selectedTitleFilter: string | null;
62
62
  selectedCreatorFilter: string | null;
63
63
  sortDirection: SortDirection | null;
64
- defaultSortField: Exclude<SortField, SortField.default>;
64
+ defaultSortField: ExplicitSortField;
65
65
  defaultSortDirection: SortDirection | null;
66
66
  pageSize: number;
67
67
  currentPage?: number;
@@ -587,6 +587,13 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
587
587
  * an error from the backend.
588
588
  */
589
589
  emitSearchError(): void;
590
+ /**
591
+ * Emits a `collectionExtraInfoLoaded` event when the data source has received
592
+ * collection metadata from the backend. This allows parent components to react
593
+ * to the metadata (e.g., to update their default sort based on the collection's
594
+ * `sort-by` metadata field).
595
+ */
596
+ emitCollectionExtraInfoLoaded(collectionExtraInfo?: CollectionExtraInfo): void;
590
597
  /**
591
598
  * Emits a `queryStateChanged` event indicating that one or more of this component's
592
599
  * properties have changed in a way that could affect the set of search results.
@@ -652,22 +659,6 @@ export declare class CollectionBrowser extends LitElement implements InfiniteScr
652
659
  * Sets the total number of tiles displayed in the infinite scroller.
653
660
  */
654
661
  setTileCount(count: number): void;
655
- /**
656
- * Applies the default sort options for the TV search results page
657
- */
658
- applyDefaultTVSearchSort(): void;
659
- /**
660
- * Applies any default sort option for the current collection, by checking
661
- * for one in the collection's metadata. If none is found, defaults to sorting
662
- * descending by:
663
- * - Date Favorited for fav-* collections
664
- * - Weekly views for all other collections
665
- */
666
- applyDefaultCollectionSort(collectionInfo?: CollectionExtraInfo): void;
667
- /**
668
- * Applies the default sort option for the current profile element
669
- */
670
- applyDefaultProfileSort(): void;
671
662
  /**
672
663
  * This is useful for determining whether we need to reload the scroller.
673
664
  *