closes https://github.com/TryGhost/Ghost/issues/16825
- iOS is very restrictive on input focus which doesn't allow without any
user interaction
- The only workaround was creating a temporary input, focus it, and
remove it after moving the focus to the actual searfch input
- It also moves the inputRef to the parent component, so that it can be
used in the click event handler, because the focus event only works when
it's inside a function that's triggered after user interaction
- This includes changes to support PascalCase filenames for interfaces
- Also bumps newer packages to use the latest version to avoid conflicts
with the underlying eslint-plugin-filenames package
As discussed with the product team we want to enforce kebab-case file names for
all files, with the exception of files which export a single class, in which
case they should be PascalCase and reflect the class which they export.
This will help find classes faster, and should push better naming for them too.
Some files and packages have been excluded from this linting, specifically when
a library or framework depends on the naming of a file for the functionality
e.g. Ember, knex-migrator, adapter-manager
refs https://github.com/TryGhost/Team/issues/1719
- the stylesheet link was hardcoded in the app, which made it impossible to configure if config changed in Ghost
- fetches styles url from the data attribute on script instead, which allows app to load styles based on config in Ghost
refs https://github.com/TryGhost/Team/issues/1675
closes https://github.com/TryGhost/Ghost/issues/15020
- the main css file used for search was accidentally imported in the root js script, causing it to be included alongside the final minified bundle and get injected outside the iframe.
- the main css is pushed as a separate file outside of bundle and used directly as link inside the iframe instead
refs https://github.com/TryGhost/Team/issues/1665
- updates highlight logic for excerpts to show the right text
- breaks highlights by individual words instead of search sentence
refs https://github.com/TryGhost/Team/issues/1665
- in case no data-ghost-search attributes on a site, the keyboard shortcut to enable search is disabled
- allows site owners to completely disable search on their site
refs https://github.com/TryGhost/Team/issues/1665
- previously the search was loading site data on load for indexing, which adds unnecessary load if search is not used
- moves data fetch and indexing to when the search popup is opened first time avoiding unnecessary fetch