AUTHOR PANE POPUP
=================

SUMMARY
-------
Shows author information in a Tippy.js-powered tooltip when a visitor hovers
over (or clicks) an author link. Content is fetched via AJAX on first hover so
there is no page-load overhead.

REQUIREMENTS
------------
- Drupal 10.x or 11.x
- PHP 8.1+
- Views (Drupal core module)
- Tippy.js v6 + Popper.js v2 (see Installation below)

INSTALLATION
------------
1. Install the module:

     composer require drupal/author_pane_popup
     drush en author_pane_popup -y
     drush updb -y

   If upgrading from a version that used qTip2, `drush updb` automatically
   drops the legacy author_pane_popup_qtip database table.

2. Download Tippy.js v6 and Popper.js v2 into web/libraries/:

   Option A — Composer (recommended):

     composer require oomphinc/composer-installers-extender
     composer require npm-asset/tippy.js:^6.3 npm-asset/popper.js:^2

     Add to the "extra" section of your root composer.json:

       "installer-types": ["npm-asset"],
       "installer-paths": {
           "web/libraries/{$name}": ["type:npm-asset"]
       }

     This installs files at:
       web/libraries/tippy.js/
       web/libraries/popper.js/   ← then copy popper.min.js (see below)

   Option B — Manual download:

     a. Download tippy-bundle.umd.min.js and tippy.css from:
          https://cdn.jsdelivr.net/npm/tippy.js@6.3.7/dist/

     b. Download theme CSS files from:
          https://cdn.jsdelivr.net/npm/tippy.js@6.3.7/dist/themes/

     c. Download animation CSS files from:
          https://cdn.jsdelivr.net/npm/tippy.js@6.3.7/dist/animations/

     d. Download popper.min.js from:
          https://cdn.jsdelivr.net/npm/@popperjs/core@2/dist/umd/

     e. Place all files under web/libraries/tippy.js/ so the structure is:

          web/libraries/tippy.js/
            popper.min.js
            dist/
              tippy-bundle.umd.min.js
              tippy.css
              themes/
                light.css
                light-border.css
                material.css
                translucent.css
              animations/
                shift-away.css
                shift-toward.css
                scale.css
                perspective.css

3. Verify the library is detected:

     drush ev "print_r(drupal_check_module('author_pane_popup'));"

   Or visit Admin > Reports > Status report and look for
   "Author Pane Popup — Tippy.js library".

CONFIGURATION
-------------
Visit Administration > Configuration > User interface > Author Pane Popup
(/admin/config/author_pane_popup/settings) to configure:

  - CSS selectors  — which elements trigger the popup
                     (default: [data-author-popup-uid])
  - Placement      — where the tooltip appears (top, bottom, left, right, auto)
  - Theme          — Default (dark), Light, Light with border, Material,
                     Translucent
  - Animation      — Fade, Shift away, Shift toward, Scale, Perspective
  - Trigger event  — Hover or focus, Hover only, Click, Focus only
  - Interactive    — allow the user to click links inside the tooltip
  - Max width      — maximum tooltip width in pixels
  - Show delay     — milliseconds before the tooltip appears/disappears
  - Loading text   — text shown while author data is being fetched
  - Page visibility — restrict the popup to specific pages or paths

POPUP CONTENT
-------------
The tooltip content is rendered by the "Author Pane Popup" Views display.
To customise the fields shown (avatar, username, join date, last seen, etc.)
go to:

  Structure > Views > Author Pane Popup
  (/admin/structure/views/view/author_pane_popup)

HOW IT WORKS
------------
The module attaches a data-author-popup-uid attribute to author elements on
node pages via hook_preprocess_node(). The JS behaviour (author_pane_popup.js)
initialises Tippy.js on those elements and fetches the rendered View via an
AJAX call to /author_pane_popup/user?uid=N on first hover.

FEATURES
--------
- Hover (or click) any author element to see a user info tooltip
- Content loaded via AJAX on first hover — no page-load overhead
- Fully configurable via the admin UI — no code changes needed
- Nine tooltip placements, five themes, five animations
- Interactive mode allows clicking links inside the tooltip
- Page-level visibility rules (show/hide on specific paths)
- Powered by Tippy.js v6 — actively maintained, no jQuery dependency
- All JavaScript and CSS bundled with the module — no CDN dependency

SUGGESTIONS / ISSUES
--------------------
https://www.drupal.org/project/issues/author_pane_popup
