@internetarchive/collection-browser 4.1.3-alpha-webdev8257.0 → 4.1.3

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,17 +6,3 @@
6
6
  * - `minimal`: Show neither tile stats nor the text snippets.
7
7
  */
8
8
  export type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';
9
- /**
10
- * Describes an action button to render at the bottom of a tile.
11
- * Styling is controlled via CSS custom properties on the host:
12
- * - `--tileActionColor` (default: #333)
13
- * - `--tileActionBg` (default: #fff)
14
- * - `--tileActionHoverBg` (default: #f0f0f0)
15
- * - `--tileActionSeparatorColor` (default: #ddd)
16
- */
17
- export interface TileAction {
18
- /** Unique identifier for this action */
19
- id: string;
20
- /** Label text displayed on the button */
21
- label: string;
22
- }
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/tiles/models.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * What type of simplified tile layout to use.\n * - `default`: Do not apply any layout simplifications.\n * - `stats-only`: Only show the tile stats row, but not text snippets.\n * - `snippets-only`: Only show the text snippets row (if snippets exist), but not tile stats.\n * - `minimal`: Show neither tile stats nor the text snippets.\n */\nexport type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';\n\n/**\n * Describes an action button to render at the bottom of a tile.\n * Styling is controlled via CSS custom properties on the host:\n * - `--tileActionColor` (default: #333)\n * - `--tileActionBg` (default: #fff)\n * - `--tileActionHoverBg` (default: #f0f0f0)\n * - `--tileActionSeparatorColor` (default: #ddd)\n */\nexport interface TileAction {\n /** Unique identifier for this action */\n id: string;\n\n /** Label text displayed on the button */\n label: string;\n}\n"]}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../src/tiles/models.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * What type of simplified tile layout to use.\n * - `default`: Do not apply any layout simplifications.\n * - `stats-only`: Only show the tile stats row, but not text snippets.\n * - `snippets-only`: Only show the text snippets row (if snippets exist), but not tile stats.\n * - `minimal`: Show neither tile stats nor the text snippets.\n */\nexport type LayoutType = 'default' | 'stats-only' | 'snippets-only' | 'minimal';\n"]}
@@ -12,7 +12,7 @@ import './list/tile-list-compact';
12
12
  import './list/tile-list-compact-header';
13
13
  import type { TileHoverPane } from './hover/tile-hover-pane';
14
14
  import { BaseTileComponent } from './base-tile-component';
15
- import { LayoutType, type TileAction } from './models';
15
+ import { LayoutType } from './models';
16
16
  import { HoverPaneProperties, HoverPaneProviderInterface } from './hover/hover-pane-controller';
17
17
  export declare class TileDispatcher extends BaseTileComponent implements SharedResizeObserverResizeHandlerInterface, HoverPaneProviderInterface {
18
18
  tileDisplayMode?: TileDisplayMode;
@@ -25,8 +25,6 @@ export declare class TileDispatcher extends BaseTileComponent implements SharedR
25
25
  /** Whether this tile should include a hover pane at all (for applicable tile modes) */
26
26
  enableHoverPane: boolean;
27
27
  manageCheckTitle: string;
28
- /** Action buttons to display at the bottom of the tile (grid mode only) */
29
- tileActions: TileAction[];
30
28
  private hoverPaneController?;
31
29
  private container;
32
30
  private hoverPane?;
@@ -74,15 +72,6 @@ export declare class TileDispatcher extends BaseTileComponent implements SharedR
74
72
  */
75
73
  private handleLinkContextMenu;
76
74
  private tileInfoButtonPressed;
77
- /** Whether tile action buttons should be rendered */
78
- private get showTileActions();
79
- private get tileActionsTemplate();
80
- /**
81
- * When the mouse enters the tile actions area, dispatch a synthetic mouseleave
82
- * on the host to cancel the hover pane's show timer and hide any visible pane.
83
- */
84
- private handleTileActionsMouseEnter;
85
- private handleTileActionClick;
86
75
  private get tile();
87
76
  static get styles(): import("lit").CSSResult[];
88
77
  }
@@ -2,7 +2,6 @@ var TileDispatcher_1;
2
2
  import { __decorate } from "tslib";
3
3
  import { css, html, nothing } from 'lit';
4
4
  import { customElement, property, query } from 'lit/decorators.js';
5
- import { classMap } from 'lit/directives/class-map.js';
6
5
  import { ifDefined } from 'lit/directives/if-defined.js';
7
6
  import { msg } from '@lit/localize';
8
7
  import './grid/collection-tile';
@@ -42,15 +41,6 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
42
41
  /** Whether this tile should include a hover pane at all (for applicable tile modes) */
43
42
  this.enableHoverPane = false;
44
43
  this.manageCheckTitle = msg('Remove this item from the list');
45
- /** Action buttons to display at the bottom of the tile (grid mode only) */
46
- this.tileActions = [];
47
- /**
48
- * When the mouse enters the tile actions area, dispatch a synthetic mouseleave
49
- * on the host to cancel the hover pane's show timer and hide any visible pane.
50
- */
51
- this.handleTileActionsMouseEnter = () => {
52
- this.dispatchEvent(new MouseEvent('mouseleave', { bubbles: false }));
53
- };
54
44
  }
55
45
  static { TileDispatcher_1 = this; }
56
46
  acquireFocus() {
@@ -68,19 +58,13 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
68
58
  }; }
69
59
  render() {
70
60
  const isGridMode = this.tileDisplayMode === 'grid';
71
- const hasTileActions = isGridMode && this.showTileActions;
72
61
  const hoverPaneTemplate = this.hoverPaneController?.getTemplate() ?? nothing;
73
- const containerClasses = classMap({
74
- hoverable: isGridMode,
75
- 'has-tile-actions': hasTileActions,
76
- });
77
62
  return html `
78
- <div id="container" class=${containerClasses}>
63
+ <div id="container" class=${isGridMode ? 'hoverable' : ''}>
79
64
  ${this.tileDisplayMode === 'list-header'
80
65
  ? this.headerTemplate
81
66
  : this.tileTemplate}
82
- ${this.tileActionsTemplate} ${this.manageCheckTemplate}
83
- ${hoverPaneTemplate}
67
+ ${this.manageCheckTemplate} ${hoverPaneTemplate}
84
68
  </div>
85
69
  `;
86
70
  }
@@ -242,40 +226,6 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
242
226
  enableTouchBackdrop: true,
243
227
  });
244
228
  }
245
- /** Whether tile action buttons should be rendered */
246
- get showTileActions() {
247
- return (this.tileActions.length > 0 &&
248
- !this.isManageView &&
249
- this.tileDisplayMode === 'grid');
250
- }
251
- get tileActionsTemplate() {
252
- if (!this.showTileActions)
253
- return nothing;
254
- return html `
255
- <div
256
- class="tile-actions"
257
- @mouseenter=${this.handleTileActionsMouseEnter}
258
- @mousemove=${(e) => e.stopPropagation()}
259
- >
260
- ${this.tileActions.map(action => html `
261
- <button
262
- class="tile-action-btn"
263
- @click=${(e) => this.handleTileActionClick(e, action)}
264
- >
265
- ${action.label}
266
- </button>
267
- `)}
268
- </div>
269
- `;
270
- }
271
- handleTileActionClick(e, action) {
272
- e.stopPropagation();
273
- this.dispatchEvent(new CustomEvent('tileActionClicked', {
274
- detail: { actionId: action.id, model: this.model },
275
- bubbles: true,
276
- composed: true,
277
- }));
278
- }
279
229
  get tile() {
280
230
  const { model, collectionPagePath, baseNavigationUrl, currentWidth, currentHeight, sortParam, creatorFilter, mobileBreakpoint, defaultSortParam, } = this;
281
231
  if (!model)
@@ -424,43 +374,8 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
424
374
  border-radius: 4px;
425
375
  }
426
376
 
427
- /*
428
- * When tile actions are present, the container becomes the visual "card"
429
- * so that the tile content and action buttons appear as one unified element.
430
- */
431
- /*
432
- * When tile actions are present, the container takes over the tile's
433
- * border-radius and box-shadow so that the action bar appears as part
434
- * of the same card. The inner tile's own shadow/radius are disabled
435
- * via CSS variable overrides so there is no visual duplication.
436
- */
437
- #container.has-tile-actions {
438
- display: flex;
439
- flex-direction: column;
440
- overflow: hidden;
441
- box-shadow: var(--tileShadow, 1px 1px 2px 0);
442
- --tileBoxShadow: none;
443
- --tileCornerRadius: 0;
444
- }
445
-
446
- #container.has-tile-actions .tile-link {
447
- flex: 1;
448
- min-height: 0;
449
- overflow: hidden;
450
- border-radius: 0;
451
- }
452
-
453
- /* Move hover shadow to container level when tile actions are present */
454
- #container.hoverable:not(.has-tile-actions) a:focus,
455
- #container.hoverable:not(.has-tile-actions) a:hover {
456
- box-shadow: var(
457
- --tileHoverBoxShadow,
458
- 0 0 6px 2px rgba(8, 8, 32, 0.8)
459
- );
460
- transition: box-shadow 0.1s ease;
461
- }
462
-
463
- #container.hoverable.has-tile-actions:hover {
377
+ #container.hoverable a:focus,
378
+ #container.hoverable a:hover {
464
379
  box-shadow: var(
465
380
  --tileHoverBoxShadow,
466
381
  0 0 6px 2px rgba(8, 8, 32, 0.8)
@@ -514,32 +429,6 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
514
429
  left: -9999px;
515
430
  z-index: 2;
516
431
  }
517
-
518
- .tile-actions {
519
- flex-shrink: 0;
520
- display: flex;
521
- border-top: 1px solid var(--tileActionSeparatorColor, #ddd);
522
- }
523
-
524
- .tile-action-btn {
525
- flex: 1;
526
- padding: 8px;
527
- border: none;
528
- border-radius: 0;
529
- font-size: 1.2rem;
530
- cursor: pointer;
531
- color: var(--tileActionColor, #333);
532
- background: var(--tileActionBg, #fff);
533
- transition: background 0.15s;
534
- }
535
-
536
- .tile-action-btn + .tile-action-btn {
537
- border-left: 1px solid var(--tileActionSeparatorColor, #ddd);
538
- }
539
-
540
- .tile-action-btn:hover {
541
- background: var(--tileActionHoverBg, #f0f0f0);
542
- }
543
432
  `,
544
433
  ];
545
434
  }
@@ -568,9 +457,6 @@ __decorate([
568
457
  __decorate([
569
458
  property({ type: String })
570
459
  ], TileDispatcher.prototype, "manageCheckTitle", void 0);
571
- __decorate([
572
- property({ type: Array })
573
- ], TileDispatcher.prototype, "tileActions", void 0);
574
460
  __decorate([
575
461
  query('#container')
576
462
  ], TileDispatcher.prototype, "container", void 0);
@@ -1 +1 @@
1
- {"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/tiles/tile-dispatcher.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAkB,MAAM,KAAK,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACnE,OAAO,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAC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EzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAEzB;AAGyB;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAAgC;AAKlD;IADP,KAAK,CAAC,YAAY,CAAC;iDACe;AAG3B;IADP,KAAK,CAAC,iBAAiB,CAAC;iDACS;AAG1B;IADP,KAAK,CAAC,YAAY,CAAC;uDACwB;AAxDjC,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAymB1B","sourcesContent":["import { css, html, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { msg } from '@lit/localize';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { TileDisplayMode } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './grid/search-tile';\nimport './hover/tile-hover-pane';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\nimport type { TileHoverPane } from './hover/tile-hover-pane';\nimport { BaseTileComponent } from './base-tile-component';\nimport { LayoutType, type TileAction } from './models';\nimport {\n HoverPaneController,\n HoverPaneControllerInterface,\n HoverPaneProperties,\n HoverPaneProviderInterface,\n} from './hover/hover-pane-controller';\nimport { srOnlyStyle } from '../styles/sr-only';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends BaseTileComponent\n implements\n SharedResizeObserverResizeHandlerInterface,\n HoverPaneProviderInterface\n{\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - currentWidth?: number;\n * - currentHeight?: number;\n * - baseNavigationUrl?: string;\n * - baseImageUrl?: string;\n * - collectionPagePath?: string;\n * - sortParam: SortParam | null = null;\n * - defaultSortParam: SortParam | null = null;\n * - creatorFilter?: string;\n * - mobileBreakpoint?: number;\n * - loggedIn = false;\n * - suppressTileBlurring = false;\n * - useLocalTime = false;\n */\n\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @property({ type: Boolean }) showTvClips = false;\n\n /** What type of simplified layout to use in grid mode, if any */\n @property({ type: String }) layoutType: LayoutType = 'default';\n\n /** Whether this tile should include a hover pane at all (for applicable tile modes) */\n @property({ type: Boolean }) enableHoverPane = false;\n\n @property({ type: String }) manageCheckTitle = msg(\n 'Remove this item from the list',\n );\n\n /** Action buttons to display at the bottom of the tile (grid mode only) */\n @property({ type: Array }) tileActions: TileAction[] = [];\n\n private hoverPaneController?: HoverPaneControllerInterface;\n\n @query('#container')\n private container!: HTMLDivElement;\n\n @query('tile-hover-pane')\n private hoverPane?: TileHoverPane;\n\n @query('.tile-link')\n private tileLinkElement?: HTMLAnchorElement;\n\n acquireFocus(): void {\n this.tileLinkElement?.focus();\n }\n\n releaseFocus(): void {\n this.tileLinkElement?.blur();\n }\n\n /** Maps each display mode to whether hover panes should appear in that mode */\n private static readonly HOVER_PANE_DISPLAY_MODES: Record<\n TileDisplayMode,\n boolean\n > = {\n grid: true,\n 'list-compact': true,\n 'list-detail': false,\n 'list-header': false,\n };\n\n render() {\n const isGridMode = this.tileDisplayMode === 'grid';\n const hasTileActions = isGridMode && this.showTileActions;\n const hoverPaneTemplate =\n this.hoverPaneController?.getTemplate() ?? nothing;\n const containerClasses = classMap({\n hoverable: isGridMode,\n 'has-tile-actions': hasTileActions,\n });\n return html`\n <div id=\"container\" class=${containerClasses}>\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n ${this.tileActionsTemplate} ${this.manageCheckTemplate}\n ${hoverPaneTemplate}\n </div>\n `;\n }\n\n protected firstUpdated(): void {\n if (this.shouldPrepareHoverPane) {\n this.hoverPaneController = new HoverPaneController(this, {\n mobileBreakpoint: this.mobileBreakpoint,\n enableLongPress: false,\n });\n }\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } =\n this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam ?? defaultSortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n >\n </tile-list-compact-header>\n `;\n }\n\n private get tileTemplate() {\n return html`\n ${this.tileDisplayMode === 'list-detail'\n ? this.tile\n : this.linkTileTemplate}\n `;\n }\n\n private get linkTileTemplate() {\n return html`\n <a\n href=${this.linkTileHref}\n aria-label=${this.model?.title ?? 'Untitled item'}\n aria-describedby=\"link-aria-description\"\n aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}\n title=${this.shouldPrepareHoverPane\n ? nothing // Don't show title tooltips when we have the tile info popups\n : ifDefined(this.model?.title)}\n @click=${this.handleLinkClicked}\n @contextmenu=${this.handleLinkContextMenu}\n class=\"tile-link\"\n >\n ${this.tile}\n </a>\n <div id=\"link-aria-description\" class=\"sr-only\">\n ${msg('Press Down Arrow to preview item details')}\n </div>\n `;\n }\n\n private get linkTileHref(): string | typeof nothing {\n if (!this.model?.identifier || this.baseNavigationUrl == null)\n return nothing;\n\n // Use the server-specified href if available.\n // Otherwise, construct a details page URL from the item identifier.\n if (this.model.href) {\n return `${this.baseNavigationUrl}${this.model.href}`;\n }\n\n return this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n this.model.mediatype === 'collection',\n );\n }\n\n private get manageCheckTemplate() {\n if (!this.isManageView || this.tileDisplayMode !== 'grid') return nothing;\n\n return html`\n <div class=\"manage-check\">\n <input\n type=\"checkbox\"\n title=${this.manageCheckTitle}\n ?checked=${this.model?.checked}\n @change=${this.handleLinkClicked}\n />\n </div>\n `;\n }\n\n /**\n * Whether hover pane behavior should be prepared for this tile\n * (e.g., whether mouse listeners should be attached, etc.)\n */\n private get shouldPrepareHoverPane(): boolean {\n return (\n this.enableHoverPane &&\n !!this.tileDisplayMode &&\n TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&\n this.model?.mediatype !== 'search' && // don't show hover panes on search tiles\n !this.model?.captureDates // don't show hover panes on web archive tiles\n );\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n /**\n * Whether the info button should be shown on this tile.\n * Only shown on touch/non-hover devices where a hover pane is available,\n * so the button always has something to toggle.\n */\n private get shouldShowInfoButton(): boolean {\n return !this.isHoverEnabled && this.shouldPrepareHoverPane;\n }\n\n /** @inheritdoc */\n getHoverPane(): TileHoverPane | undefined {\n return this.hoverPane;\n }\n\n /** @inheritdoc */\n getHoverPaneProps(): HoverPaneProperties {\n return this;\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n\n disconnectedCallback(): void {\n this.stopResizeObservation(this.resizeObserver);\n }\n\n private stopResizeObservation(observer?: SharedResizeObserverInterface) {\n observer?.removeObserver({\n handler: this,\n target: this.container,\n });\n }\n\n private startResizeObservation() {\n this.stopResizeObservation(this.resizeObserver);\n this.resizeObserver?.addObserver({\n handler: this,\n target: this.container,\n });\n }\n\n updated(props: PropertyValues) {\n if (props.has('resizeObserver')) {\n const previousObserver = props.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.stopResizeObservation(previousObserver);\n this.startResizeObservation();\n }\n }\n\n /**\n * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.\n * In manage view, it also checks/unchecks the tile.\n */\n private handleLinkClicked(e: Event): void {\n if (this.isManageView) {\n e.preventDefault();\n if (this.model) this.model.checked = !this.model.checked;\n }\n\n this.dispatchEvent(\n new CustomEvent('resultSelected', { detail: this.model }),\n );\n }\n\n /**\n * Handler for when the tile link is right-clicked.\n * In manage view, it opens the item in a new tab. Otherwise, does nothing.\n */\n private handleLinkContextMenu(e: Event): void {\n if (this.isManageView && this.linkTileHref !== nothing) {\n e.preventDefault();\n window.open(this.linkTileHref, '_blank');\n }\n }\n\n private tileInfoButtonPressed(\n e: CustomEvent<{ x: number; y: number }>,\n ): void {\n this.hoverPaneController?.toggleHoverPane({\n coords: e.detail,\n enableTouchBackdrop: true,\n });\n }\n\n /** Whether tile action buttons should be rendered */\n private get showTileActions(): boolean {\n return (\n this.tileActions.length > 0 &&\n !this.isManageView &&\n this.tileDisplayMode === 'grid'\n );\n }\n\n private get tileActionsTemplate() {\n if (!this.showTileActions) return nothing;\n\n return html`\n <div\n class=\"tile-actions\"\n @mouseenter=${this.handleTileActionsMouseEnter}\n @mousemove=${(e: Event) => e.stopPropagation()}\n >\n ${this.tileActions.map(\n action => html`\n <button\n class=\"tile-action-btn\"\n @click=${(e: Event) => this.handleTileActionClick(e, action)}\n >\n ${action.label}\n </button>\n `,\n )}\n </div>\n `;\n }\n\n /**\n * When the mouse enters the tile actions area, dispatch a synthetic mouseleave\n * on the host to cancel the hover pane's show timer and hide any visible pane.\n */\n private handleTileActionsMouseEnter = (): void => {\n this.dispatchEvent(new MouseEvent('mouseleave', { bubbles: false }));\n };\n\n private handleTileActionClick(e: Event, action: TileAction): void {\n e.stopPropagation();\n this.dispatchEvent(\n new CustomEvent('tileActionClicked', {\n detail: { actionId: action.id, model: this.model },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private get tile() {\n const {\n model,\n collectionPagePath,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n creatorFilter,\n mobileBreakpoint,\n defaultSortParam,\n } = this;\n\n if (!model) return nothing;\n\n switch (this.tileDisplayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </account-tile>`;\n case 'search':\n return html`<search-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${false}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </search-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .baseImageUrl=${this.baseImageUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showTvClips=${this.showTvClips}\n ?showInfoButton=${this.shouldShowInfoButton}\n ?useLocalTime=${this.useLocalTime}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .collectionTitles=${this.collectionTitles}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list>`;\n default:\n return nothing;\n }\n }\n\n static get styles() {\n return [\n srOnlyStyle,\n css`\n :host {\n display: block;\n height: 100%;\n }\n\n collection-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n }\n\n account-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #fcf5e6;\n }\n\n item-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #f1f1f4;\n }\n\n search-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n --iconFillColor: #2c2c2c;\n }\n\n #container {\n position: relative;\n height: 100%;\n border-radius: 4px;\n }\n\n /*\n * When tile actions are present, the container becomes the visual \"card\"\n * so that the tile content and action buttons appear as one unified element.\n */\n /*\n * When tile actions are present, the container takes over the tile's\n * border-radius and box-shadow so that the action bar appears as part\n * of the same card. The inner tile's own shadow/radius are disabled\n * via CSS variable overrides so there is no visual duplication.\n */\n #container.has-tile-actions {\n display: flex;\n flex-direction: column;\n overflow: hidden;\n box-shadow: var(--tileShadow, 1px 1px 2px 0);\n --tileBoxShadow: none;\n --tileCornerRadius: 0;\n }\n\n #container.has-tile-actions .tile-link {\n flex: 1;\n min-height: 0;\n overflow: hidden;\n border-radius: 0;\n }\n\n /* Move hover shadow to container level when tile actions are present */\n #container.hoverable:not(.has-tile-actions) a:focus,\n #container.hoverable:not(.has-tile-actions) a:hover {\n box-shadow: var(\n --tileHoverBoxShadow,\n 0 0 6px 2px rgba(8, 8, 32, 0.8)\n );\n transition: box-shadow 0.1s ease;\n }\n\n #container.hoverable.has-tile-actions:hover {\n box-shadow: var(\n --tileHoverBoxShadow,\n 0 0 6px 2px rgba(8, 8, 32, 0.8)\n );\n transition: box-shadow 0.1s ease;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n transition: transform 0.05s ease;\n border-radius: 4px;\n outline: none;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n\n .manage-check {\n position: absolute;\n right: 0;\n top: 0;\n border: 5px solid #2c2c2c;\n border-radius: 3px;\n background-color: #2c2c2c;\n z-index: 1;\n }\n\n .manage-check > input[type='checkbox'] {\n display: block;\n margin: 0;\n }\n\n #touch-backdrop {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n z-index: 2;\n background: transparent;\n }\n\n tile-hover-pane {\n position: absolute;\n top: 0;\n left: -9999px;\n z-index: 2;\n }\n\n .tile-actions {\n flex-shrink: 0;\n display: flex;\n border-top: 1px solid var(--tileActionSeparatorColor, #ddd);\n }\n\n .tile-action-btn {\n flex: 1;\n padding: 8px;\n border: none;\n border-radius: 0;\n font-size: 1.2rem;\n cursor: pointer;\n color: var(--tileActionColor, #333);\n background: var(--tileActionBg, #fff);\n transition: background 0.15s;\n }\n\n .tile-action-btn + .tile-action-btn {\n border-left: 1px solid var(--tileActionSeparatorColor, #ddd);\n }\n\n .tile-action-btn:hover {\n background: var(--tileActionHoverBg, #f0f0f0);\n }\n `,\n ];\n }\n}\n"]}
1
+ {"version":3,"file":"tile-dispatcher.js","sourceRoot":"","sources":["../../../src/ti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oC;AAGlC;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;uDAAyB;AAEzB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAEzB;AAKM;IADP,KAAK,CAAC,YAAY,CAAC;iDACe;AAG3B;IADP,KAAK,CAAC,iBAAiB,CAAC;iDACS;AAG1B;IADP,KAAK,CAAC,YAAY,CAAC;uDACwB;AArDjC,cAAc;IAD1B,aAAa,CAAC,iBAAiB,CAAC;GACpB,cAAc,CAgf1B","sourcesContent":["import { css, html, nothing, PropertyValues } from 'lit';\nimport { customElement, property, query } from 'lit/decorators.js';\nimport { ifDefined } from 'lit/directives/if-defined.js';\nimport { msg } from '@lit/localize';\nimport type {\n SharedResizeObserverInterface,\n SharedResizeObserverResizeHandlerInterface,\n} from '@internetarchive/shared-resize-observer';\nimport type { TileDisplayMode } from '../models';\nimport type { CollectionTitles } from '../data-source/models';\nimport './grid/collection-tile';\nimport './grid/item-tile';\nimport './grid/account-tile';\nimport './grid/search-tile';\nimport './hover/tile-hover-pane';\nimport './list/tile-list';\nimport './list/tile-list-compact';\nimport './list/tile-list-compact-header';\nimport type { TileHoverPane } from './hover/tile-hover-pane';\nimport { BaseTileComponent } from './base-tile-component';\nimport { LayoutType } from './models';\nimport {\n HoverPaneController,\n HoverPaneControllerInterface,\n HoverPaneProperties,\n HoverPaneProviderInterface,\n} from './hover/hover-pane-controller';\nimport { srOnlyStyle } from '../styles/sr-only';\n\n@customElement('tile-dispatcher')\nexport class TileDispatcher\n extends BaseTileComponent\n implements\n SharedResizeObserverResizeHandlerInterface,\n HoverPaneProviderInterface\n{\n /*\n * Reactive properties inherited from BaseTileComponent:\n * - model?: TileModel;\n * - currentWidth?: number;\n * - currentHeight?: number;\n * - baseNavigationUrl?: string;\n * - baseImageUrl?: string;\n * - collectionPagePath?: string;\n * - sortParam: SortParam | null = null;\n * - defaultSortParam: SortParam | null = null;\n * - creatorFilter?: string;\n * - mobileBreakpoint?: number;\n * - loggedIn = false;\n * - suppressTileBlurring = false;\n * - useLocalTime = false;\n */\n\n @property({ type: String }) tileDisplayMode?: TileDisplayMode;\n\n @property({ type: Boolean }) isManageView = false;\n\n @property({ type: Object }) resizeObserver?: SharedResizeObserverInterface;\n\n @property({ type: Object })\n collectionTitles?: CollectionTitles;\n\n @property({ type: Boolean }) showTvClips = false;\n\n /** What type of simplified layout to use in grid mode, if any */\n @property({ type: String }) layoutType: LayoutType = 'default';\n\n /** Whether this tile should include a hover pane at all (for applicable tile modes) */\n @property({ type: Boolean }) enableHoverPane = false;\n\n @property({ type: String }) manageCheckTitle = msg(\n 'Remove this item from the list',\n );\n\n private hoverPaneController?: HoverPaneControllerInterface;\n\n @query('#container')\n private container!: HTMLDivElement;\n\n @query('tile-hover-pane')\n private hoverPane?: TileHoverPane;\n\n @query('.tile-link')\n private tileLinkElement?: HTMLAnchorElement;\n\n acquireFocus(): void {\n this.tileLinkElement?.focus();\n }\n\n releaseFocus(): void {\n this.tileLinkElement?.blur();\n }\n\n /** Maps each display mode to whether hover panes should appear in that mode */\n private static readonly HOVER_PANE_DISPLAY_MODES: Record<\n TileDisplayMode,\n boolean\n > = {\n grid: true,\n 'list-compact': true,\n 'list-detail': false,\n 'list-header': false,\n };\n\n render() {\n const isGridMode = this.tileDisplayMode === 'grid';\n const hoverPaneTemplate =\n this.hoverPaneController?.getTemplate() ?? nothing;\n return html`\n <div id=\"container\" class=${isGridMode ? 'hoverable' : ''}>\n ${this.tileDisplayMode === 'list-header'\n ? this.headerTemplate\n : this.tileTemplate}\n ${this.manageCheckTemplate} ${hoverPaneTemplate}\n </div>\n `;\n }\n\n protected firstUpdated(): void {\n if (this.shouldPrepareHoverPane) {\n this.hoverPaneController = new HoverPaneController(this, {\n mobileBreakpoint: this.mobileBreakpoint,\n enableLongPress: false,\n });\n }\n }\n\n private get headerTemplate() {\n const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } =\n this;\n return html`\n <tile-list-compact-header\n class=\"header\"\n .currentWidth=${currentWidth}\n .sortParam=${sortParam ?? defaultSortParam}\n .mobileBreakpoint=${mobileBreakpoint}\n >\n </tile-list-compact-header>\n `;\n }\n\n private get tileTemplate() {\n return html`\n ${this.tileDisplayMode === 'list-detail'\n ? this.tile\n : this.linkTileTemplate}\n `;\n }\n\n private get linkTileTemplate() {\n return html`\n <a\n href=${this.linkTileHref}\n aria-label=${this.model?.title ?? 'Untitled item'}\n aria-describedby=\"link-aria-description\"\n aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}\n title=${this.shouldPrepareHoverPane\n ? nothing // Don't show title tooltips when we have the tile info popups\n : ifDefined(this.model?.title)}\n @click=${this.handleLinkClicked}\n @contextmenu=${this.handleLinkContextMenu}\n class=\"tile-link\"\n >\n ${this.tile}\n </a>\n <div id=\"link-aria-description\" class=\"sr-only\">\n ${msg('Press Down Arrow to preview item details')}\n </div>\n `;\n }\n\n private get linkTileHref(): string | typeof nothing {\n if (!this.model?.identifier || this.baseNavigationUrl == null)\n return nothing;\n\n // Use the server-specified href if available.\n // Otherwise, construct a details page URL from the item identifier.\n if (this.model.href) {\n return `${this.baseNavigationUrl}${this.model.href}`;\n }\n\n return this.displayValueProvider.itemPageUrl(\n this.model.identifier,\n this.model.mediatype === 'collection',\n );\n }\n\n private get manageCheckTemplate() {\n if (!this.isManageView || this.tileDisplayMode !== 'grid') return nothing;\n\n return html`\n <div class=\"manage-check\">\n <input\n type=\"checkbox\"\n title=${this.manageCheckTitle}\n ?checked=${this.model?.checked}\n @change=${this.handleLinkClicked}\n />\n </div>\n `;\n }\n\n /**\n * Whether hover pane behavior should be prepared for this tile\n * (e.g., whether mouse listeners should be attached, etc.)\n */\n private get shouldPrepareHoverPane(): boolean {\n return (\n this.enableHoverPane &&\n !!this.tileDisplayMode &&\n TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&\n this.model?.mediatype !== 'search' && // don't show hover panes on search tiles\n !this.model?.captureDates // don't show hover panes on web archive tiles\n );\n }\n\n private get isHoverEnabled(): boolean {\n return window.matchMedia('(hover: hover)').matches;\n }\n\n /**\n * Whether the info button should be shown on this tile.\n * Only shown on touch/non-hover devices where a hover pane is available,\n * so the button always has something to toggle.\n */\n private get shouldShowInfoButton(): boolean {\n return !this.isHoverEnabled && this.shouldPrepareHoverPane;\n }\n\n /** @inheritdoc */\n getHoverPane(): TileHoverPane | undefined {\n return this.hoverPane;\n }\n\n /** @inheritdoc */\n getHoverPaneProps(): HoverPaneProperties {\n return this;\n }\n\n handleResize(entry: ResizeObserverEntry): void {\n this.currentWidth = entry.contentRect.width;\n this.currentHeight = entry.contentRect.height;\n }\n\n disconnectedCallback(): void {\n this.stopResizeObservation(this.resizeObserver);\n }\n\n private stopResizeObservation(observer?: SharedResizeObserverInterface) {\n observer?.removeObserver({\n handler: this,\n target: this.container,\n });\n }\n\n private startResizeObservation() {\n this.stopResizeObservation(this.resizeObserver);\n this.resizeObserver?.addObserver({\n handler: this,\n target: this.container,\n });\n }\n\n updated(props: PropertyValues) {\n if (props.has('resizeObserver')) {\n const previousObserver = props.get(\n 'resizeObserver',\n ) as SharedResizeObserverInterface;\n this.stopResizeObservation(previousObserver);\n this.startResizeObservation();\n }\n }\n\n /**\n * Handler for when the tile link is left-clicked. Emits the `resultSelected` event.\n * In manage view, it also checks/unchecks the tile.\n */\n private handleLinkClicked(e: Event): void {\n if (this.isManageView) {\n e.preventDefault();\n if (this.model) this.model.checked = !this.model.checked;\n }\n\n this.dispatchEvent(\n new CustomEvent('resultSelected', { detail: this.model }),\n );\n }\n\n /**\n * Handler for when the tile link is right-clicked.\n * In manage view, it opens the item in a new tab. Otherwise, does nothing.\n */\n private handleLinkContextMenu(e: Event): void {\n if (this.isManageView && this.linkTileHref !== nothing) {\n e.preventDefault();\n window.open(this.linkTileHref, '_blank');\n }\n }\n\n private tileInfoButtonPressed(\n e: CustomEvent<{ x: number; y: number }>,\n ): void {\n this.hoverPaneController?.toggleHoverPane({\n coords: e.detail,\n enableTouchBackdrop: true,\n });\n }\n\n private get tile() {\n const {\n model,\n collectionPagePath,\n baseNavigationUrl,\n currentWidth,\n currentHeight,\n sortParam,\n creatorFilter,\n mobileBreakpoint,\n defaultSortParam,\n } = this;\n\n if (!model) return nothing;\n\n switch (this.tileDisplayMode) {\n case 'grid':\n switch (model.mediatype) {\n case 'collection':\n return html`<collection-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </collection-tile>`;\n case 'account':\n return html`<account-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${this.shouldShowInfoButton}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </account-tile>`;\n case 'search':\n return html`<search-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .baseImageUrl=${this.baseImageUrl}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .creatorFilter=${creatorFilter}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n ?showInfoButton=${false}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </search-tile>`;\n default:\n return html`<item-tile\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${this.currentWidth}\n .currentHeight=${this.currentHeight}\n .baseImageUrl=${this.baseImageUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n .isManageView=${this.isManageView}\n .layoutType=${this.layoutType}\n ?showTvClips=${this.showTvClips}\n ?showInfoButton=${this.shouldShowInfoButton}\n ?useLocalTime=${this.useLocalTime}\n @infoButtonPressed=${this.tileInfoButtonPressed}\n >\n </item-tile>`;\n }\n case 'list-compact':\n return html`<tile-list-compact\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list-compact>`;\n case 'list-detail':\n return html`<tile-list\n .model=${model}\n .collectionPagePath=${collectionPagePath}\n .collectionTitles=${this.collectionTitles}\n .currentWidth=${currentWidth}\n .currentHeight=${currentHeight}\n .baseNavigationUrl=${baseNavigationUrl}\n .sortParam=${sortParam}\n .defaultSortParam=${defaultSortParam}\n .creatorFilter=${creatorFilter}\n .mobileBreakpoint=${mobileBreakpoint}\n .baseImageUrl=${this.baseImageUrl}\n .loggedIn=${this.loggedIn}\n .suppressBlurring=${this.suppressBlurring}\n ?useLocalTime=${this.useLocalTime}\n >\n </tile-list>`;\n default:\n return nothing;\n }\n }\n\n static get styles() {\n return [\n srOnlyStyle,\n css`\n :host {\n display: block;\n height: 100%;\n }\n\n collection-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n }\n\n account-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #fcf5e6;\n }\n\n item-tile {\n --tileBorderColor: #dddddd;\n --imageBlockBackgroundColor: #f1f1f4;\n }\n\n search-tile {\n --tileBorderColor: #555555;\n --tileBackgroundColor: #666666;\n --imageBlockBackgroundColor: #666666;\n --iconFillColor: #2c2c2c;\n }\n\n #container {\n position: relative;\n height: 100%;\n border-radius: 4px;\n }\n\n #container.hoverable a:focus,\n #container.hoverable a:hover {\n box-shadow: var(\n --tileHoverBoxShadow,\n 0 0 6px 2px rgba(8, 8, 32, 0.8)\n );\n transition: box-shadow 0.1s ease;\n }\n\n a {\n display: block;\n height: 100%;\n color: unset;\n text-decoration: none;\n transition: transform 0.05s ease;\n border-radius: 4px;\n outline: none;\n }\n\n a :first-child {\n display: block;\n height: 100%;\n }\n\n .manage-check {\n position: absolute;\n right: 0;\n top: 0;\n border: 5px solid #2c2c2c;\n border-radius: 3px;\n background-color: #2c2c2c;\n z-index: 1;\n }\n\n .manage-check > input[type='checkbox'] {\n display: block;\n margin: 0;\n }\n\n #touch-backdrop {\n position: fixed;\n width: 100vw;\n height: 100vh;\n top: 0;\n left: 0;\n z-index: 2;\n background: transparent;\n }\n\n tile-hover-pane {\n position: absolute;\n top: 0;\n left: -9999px;\n z-index: 2;\n }\n `,\n ];\n }\n}\n"]}
package/eslint.config.mjs CHANGED
@@ -1,53 +1,53 @@
1
- import typescriptEslint from '@typescript-eslint/eslint-plugin';
2
- import html from 'eslint-plugin-html';
3
- import tsParser from '@typescript-eslint/parser';
4
- import path from 'node:path';
5
- import { fileURLToPath } from 'node:url';
6
- import js from '@eslint/js';
7
- import { FlatCompat } from '@eslint/eslintrc';
8
-
9
- const __filename = fileURLToPath(import.meta.url);
10
- const __dirname = path.dirname(__filename);
11
- const compat = new FlatCompat({
12
- baseDirectory: __dirname,
13
- recommendedConfig: js.configs.recommended,
14
- allConfig: js.configs.all,
15
- });
16
-
17
- export default [
18
- ...compat.extends('plugin:@typescript-eslint/recommended'),
19
- {
20
- plugins: {
21
- '@typescript-eslint': typescriptEslint,
22
- html,
23
- },
24
-
25
- languageOptions: {
26
- parser: tsParser,
27
- },
28
-
29
- settings: {
30
- 'import/resolver': {
31
- node: {
32
- extensions: ['.ts', '.tsx'],
33
- moduleDirectory: ['node_modules', 'src', 'demo'],
34
- },
35
- },
36
- },
37
-
38
- rules: {
39
- '@typescript-eslint/no-unsafe-function-type': 'warn',
40
- '@typescript-eslint/no-unused-vars': 'warn',
41
- '@typescript-eslint/no-explicit-any': 'warn',
42
- },
43
- },
44
- {
45
- ignores: ['**/*.js', '**/*.mjs', '**/*.d.ts'],
46
- },
47
- {
48
- files: ['**/*.test.ts'],
49
- rules: {
50
- '@typescript-eslint/no-unused-expressions': 'off',
51
- },
52
- },
53
- ];
1
+ import typescriptEslint from '@typescript-eslint/eslint-plugin';
2
+ import html from 'eslint-plugin-html';
3
+ import tsParser from '@typescript-eslint/parser';
4
+ import path from 'node:path';
5
+ import { fileURLToPath } from 'node:url';
6
+ import js from '@eslint/js';
7
+ import { FlatCompat } from '@eslint/eslintrc';
8
+
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = path.dirname(__filename);
11
+ const compat = new FlatCompat({
12
+ baseDirectory: __dirname,
13
+ recommendedConfig: js.configs.recommended,
14
+ allConfig: js.configs.all,
15
+ });
16
+
17
+ export default [
18
+ ...compat.extends('plugin:@typescript-eslint/recommended'),
19
+ {
20
+ plugins: {
21
+ '@typescript-eslint': typescriptEslint,
22
+ html,
23
+ },
24
+
25
+ languageOptions: {
26
+ parser: tsParser,
27
+ },
28
+
29
+ settings: {
30
+ 'import/resolver': {
31
+ node: {
32
+ extensions: ['.ts', '.tsx'],
33
+ moduleDirectory: ['node_modules', 'src', 'demo'],
34
+ },
35
+ },
36
+ },
37
+
38
+ rules: {
39
+ '@typescript-eslint/no-unsafe-function-type': 'warn',
40
+ '@typescript-eslint/no-unused-vars': 'warn',
41
+ '@typescript-eslint/no-explicit-any': 'warn',
42
+ },
43
+ },
44
+ {
45
+ ignores: ['**/*.js', '**/*.mjs', '**/*.d.ts'],
46
+ },
47
+ {
48
+ files: ['**/*.test.ts'],
49
+ rules: {
50
+ '@typescript-eslint/no-unused-expressions': 'off',
51
+ },
52
+ },
53
+ ];
package/index.html CHANGED
@@ -1,24 +1,24 @@
1
- <!doctype html>
2
- <html lang="en-GB">
3
- <head>
4
- <meta charset="utf-8">
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <style>
7
- html {
8
- font-size: 10px; /* This is to match petabox's base font size */
9
- font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
10
- }
11
-
12
- body {
13
- background: #F5F5F7;
14
- color: #2C2C2C;
15
- line-height: 1.42857143; /* Same as production */
16
- }
17
- </style>
18
-
19
- </head>
20
- <body>
21
- <app-root></app-root>
22
- <script type="module" src="./src/app-root"></script>
23
- </body>
24
- </html>
1
+ <!doctype html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ html {
8
+ font-size: 10px; /* This is to match petabox's base font size */
9
+ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
10
+ }
11
+
12
+ body {
13
+ background: #F5F5F7;
14
+ color: #2C2C2C;
15
+ line-height: 1.42857143; /* Same as production */
16
+ }
17
+ </style>
18
+
19
+ </head>
20
+ <body>
21
+ <app-root></app-root>
22
+ <script type="module" src="./src/app-root"></script>
23
+ </body>
24
+ </html>
package/index.ts CHANGED
@@ -19,7 +19,6 @@ export { TileList } from './src/tiles/list/tile-list';
19
19
  export { TileListCompact } from './src/tiles/list/tile-list-compact';
20
20
  export { TileDispatcher } from './src/tiles/tile-dispatcher';
21
21
  export { LayoutType } from './src/tiles/models';
22
- export type { TileAction } from './src/tiles/models';
23
22
  export {
24
23
  SmartQueryHeuristic,
25
24
  KeywordFacetMap,