* Centralize pagination/canonical meta URL generation in Document
* Apply fixes from StyleCI
[ci skip] [skip ci]
* Use translations for title template
* Apply fixes from StyleCI
[ci skip] [skip ci]
* Dont add translator to title driver interface
It's an implementation detail, and can be made available on specific implementations as needed.
Co-authored-by: Alexander Skvortsov <askvortsov1@users.noreply.github.com>
Fixes https://github.com/flarum/core/issues/3055
- On the frontend, accept only image types as a hint to the OS file picker.
- On the backend, add more robust validation to ensure only valid images make it through. This isn't necessary for security, but results in less confusing error mesages.
* Remove color validation in basics admin page & add color indicator
* Create ColorInput common component
* Revert 'formGroupAttrs' addition
* Rename component CSS classes
* Fix input type in ColorInput from AdminPage#buildSettingComponent
* Rename component to ColorPreviewInput, remove aliases in admin & export in compat
* Remove leftovers from rebase on master
* feat: add global type definition for a vnode element tag
* fix(a11y): add aria roles to color input
* chore: use new type
* chore: format
Co-authored-by: David Wheatley <hi@davwheat.dev>
* Add focus trap util
* Add focus trap to Modals
Fixes#2663
* Split tab press into `onTab` handler
* Remove deprecated code
* Use requestAnimationFrame instead of setTimeout
* Reduce code duplication
* Implement focus trap in nav drawer
Fixes#2665
* Hide drawer when window is resized to be bigger
Fixes issue where focus trap would remain on the drawer when it is
just the app header, if the drawer was opened then the window was
made larger.
* Simplify conditional function calls
* Fix modal focus trap
* Remove debug code
* Simplify resize handler conditional statements
* Add info about reasoning of resize handler
* Prefer native JS methods over jQuery
* Update conditional function call to handle `undefined`
* Expose screen sizes as CSS custom properties
* Use `window.matchMedia` rather than resize handler
* Fix spelling error
Co-authored-by: David Sevilla Martin <me@datitisev.me>
* Remove breaking change
Co-authored-by: David Sevilla Martin <me@datitisev.me>
By injecting the cache store into the queue, we allow queues to be
restarted using php flarum queue:restart and similar events dispatched
from within Laravelish classes.
* Enforce 65k limit when attempting to store setting values.
* Add space for style.
* Move setting validation into Saving event listener.
* Use consistent var names
* remove extra space
* Move settings validation into separate class.
* Remove unused class.
* Remove extra line.
* Move ValidateCustomLess to SettingsServiceProvider. Use existing convention for validator.
* Update src/Settings/SettingsValidator.php
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
* Revert moving of ValidateCustomLess logic. Allow for attribute specific setting validation rules.
* Style fixes.
* Style fixes.
* Style fixes.
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
* Improve typings for ItemList
* Add new `.replace()` syntax
* Update JSDoc
* Add missing `T` type
* Fix typo
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
* Allow choice to not set `itemName` property when calling `toArray`
* Make `ItemList.items` read-only
* Modify `.replace()`; add `.changePriority()`
* Complete rename
* Update JSDoc
* Add `.toObject()` method; deprecate `.items`
* Rewrite `.toArray()` to use Proxy instead of modifying the item content
- Fixes#3030
- Fixes issue where setting `itemName` property could result in errors depending on the object type (e.g. proxies)
- Fixes unneeded duplication of item list
- Add option to disable setting `itemName` property on primitives
* Simplify condition
* Remove debug code
* Make proxying function protected instead of private
* Update a usage of ItemList as an example
* Make `itemName` property read-only
* Use correct capitalisation of `object`
* Invert `toArray` parameter function
* Simplify isEmpty check
* Update ItemList.ts
* Fix `merge()`
* Remove extra JSDoc comment
* Use `._items` directly for merging
* Rename methods: `replace` -> `set`; `changePriority` -> `setPriority`
This more closely matches our existing method names (`get()`)
* Change `items` getter
* Simplify proxying
* Update URL to source function
* Update compat
* Various changes to toObject
* Remove `Item.key`
* Make item content proxy method private
* Enforce merge typings
* Update TSDoc comments to use `{@link}` for references to methods
* Correct references to deprecated `.replace` method
* Throw error when setting content/priority of non-existent items
* Remove intermediary variable
* Update TSDoc block
* Update js/src/@types/global.d.ts
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
* chore: migrate to Yarn package manager
* chore: bump deps, move `expose-loader` to correct deps section
* fix: remove package from old typescript shim
* feat: use Yarn Plug'n'Play
* chore: keep `node_modules` ignored for people who choose to use npm anyway
* Revert "feat: use Yarn Plug'n'Play"
This reverts commit 9781c8c8d5.