1
0
mirror of https://github.com/flarum/core.git synced 2025-08-13 03:44:32 +02:00

Compare commits

..

123 Commits

Author SHA1 Message Date
Alexander Skvortsov
99112429f9 Release v1.1.0 2021-10-11 21:19:05 -04:00
Daniël Klabbers
b4772e5399 [huntr] adding cache control headers to the admin area (#3097)
This PR forces the `Cache-Control: no-store, max-age=0` header to the response in the Admin Area. This forces cache to be ignored upon browsing back and forth between pages using the browser controls. Although absolutely no fail safe, it should provide better protection against serving cached pages once an admin has signed out.
2021-10-07 18:34:22 -04:00
flarum-bot
2b47e90827 Bundled output for commit 1c2465b2da
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-10-07 03:33:54 +00:00
Alexander Skvortsov
1c2465b2da Support filter params in discussion list state
https://github.com/flarum/core/pull/3068 accidentially broke the user discussions page, as up until this commit, `DiscussionListState`didn't accept any filter params.
2021-10-06 23:30:32 -04:00
Alexander Skvortsov
a6717ee981 Remove .html on all docs urls
Now that Flarum docs have been moved to docusaurus, URLs no longer end with `.html`.

Closes https://github.com/flarum/core/issues/3092
2021-10-05 10:13:19 -04:00
flarum-bot
450ab61620 Bundled output for commit e2f01c040b
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-09-29 15:32:51 +00:00
Sami Mazouz
e2f01c040b fix: Anchors should not have type="button" (#3086) 2021-09-29 11:30:31 -04:00
Sami Mazouz
1d15cff9ca Filter composer icon array to only valid values (#3080) 2021-09-25 18:35:27 +01:00
David Wheatley
88724bb4cb performance(frontend): Preload FontAwesome, JS and CSS (#3057)
* Add preloads support to Document class

* Add frontend extender for asset preloading

* Provide default preloads for FontAwesome

* Add tests for preload extender and default preloads

* Apply fixes from StyleCI

[ci skip] [skip ci]

* Fix typo

* Fix two more typos 🙃

* Preload core JS and CSS

* Apply fixes from StyleCI

[ci skip] [skip ci]

* Reorder preloads

* Remove singular preloads method

* Use filesystem disk driver for getting FA font paths

* Update test to use full URL

* Apply fixes from StyleCI

[ci skip] [skip ci]

* Address review comment

* Apply fixes from StyleCI

[ci skip] [skip ci]

* Fix typo

* Apply fixes from StyleCI

[ci skip] [skip ci]

* Correct callback wrapping

* Update src/Extend/Frontend.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update src/Extend/Frontend.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update src/Extend/Frontend.php

* Fix preload extender logic

* Convert base FontAwesome preloads into a Singleton

* Apply fixes from StyleCI

[ci skip] [skip ci]

Co-authored-by: luceos <luceos@users.noreply.github.com>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2021-09-20 23:12:09 +01:00
Alexander Skvortsov
1637b90531 Add determinsm to extension order resolution (#3076)
By sorting alphabetically by extension ID before applying topological sort, we ensure that a given set of extensions will always be booted in the same order. This will make it easier to replicate issues caused by complex extension dependencies.
2021-09-20 11:40:00 -04:00
flarum-bot
245d0d2550 Bundled output for commit 5dd48e1b86
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-09-20 15:08:49 +00:00
David Wheatley
5dd48e1b86 [A11Y] Accessibility improvements for the Search component (#3017)
* Remove deprecated code

* Accessibility improvements for Search component
2021-09-20 16:06:15 +01:00
Sami Mazouz
c1a8c6c190 fix: Sanitise integer query parameters (#3064) 2021-09-17 20:50:11 +01:00
David Wheatley
c10a30bae9 [A11Y] Adds missing focus rings back to control elements (#3016)
* Remove the stuff that removes critical accessibility features

* Remove no outline from basic blade layout

* Remove focus outline from FormControls
2021-09-13 23:47:13 +01:00
flarum-bot
b0bc021034 Bundled output for commit 1b193196da
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-09-11 08:26:35 +00:00
Rafael Horvat
1b193196da Use author filter parameter instead of q with gambit to get a user's discussions on the DiscussionsUserPage (#3068) 2021-09-11 09:24:15 +01:00
Sami Mazouz
f56fc11af9 [1.x] Theme Extender to Allow overriding LESS files (#3008)
This PR introduces the ability to just override a LESS file's contents through an extender.
This is mainly useful for theme development, as there are times in extensively customized themes where overriding the actual file makes a huge difference vs overriding CSS styles which can turn into a maintenance hell real fast.

Overriding styles is more tedious than overriding files. When you're designing an element, you would normally rather start from a blank canvas, than a styled element. With an already styled element you have to first override and undo the styles you do not wish to have, only then can you start shaping it, but even then you'd always end up constantly undoing default styles. This mostly applies for more advanced themes. (example: 851c55516d/less/forum/DiscussionList.less)
2021-09-10 13:45:18 -04:00
flarum-bot
ebdc232b11 Bundled output for commit eb0dd1f0d0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-09-06 00:46:37 +00:00
David Sevilla Martín
eb0dd1f0d0 Add extra error handling for avatar file size & large payload (#3042)
* Add extra error handling for avatar file size & large payload

* Change error message to return 'upload failure' on most errors instead of 'no file' message
2021-09-05 20:43:59 -04:00
Sami Mazouz
1aa61f1f01 fix: Unable to use permission grid dropdowns due to z-index mistake (#3065)
The one I had suggested here: https://github.com/flarum/core/pull/2887#pullrequestreview-690047538
2021-09-05 18:29:18 +01:00
Sami Mazouz
e8153ccc79 feat: NoJs Admin View (#3059)
Adds a nojs blade template to be able to enable/disable extensions when one of them misbehaves.
2021-08-31 09:08:27 +01:00
Alexander Skvortsov
55d8af44a2 Move SECURITY.md file to central org repo 2021-08-30 15:43:52 -04:00
Alexander Skvortsov
4de5ad94f0 Use central FUNDING file 2021-08-30 15:42:07 -04:00
Alexander Skvortsov
735583397c Move PR template to central repo 2021-08-30 15:41:18 -04:00
Alexander Skvortsov
da94488f7b Update lastSeenAt when authenticating via API (#3058)
Fixes https://github.com/flarum/core/issues/3025, title says it all.
2021-08-27 14:02:03 -04:00
Ian Morland
581d9517db Pass filter params to getApiDocument (#3037)
* Pass filter params to getApiDocument

* Set filters directly
2021-08-26 10:47:34 +01:00
flarum-bot
3db724e0b3 Bundled output for commit 71073b064a
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-26 09:35:55 +00:00
Rafael Horvat
71073b064a Allow adding page parameters to PaginatedListState, like limit. (#2935) 2021-08-26 10:33:22 +01:00
flarum-bot
d82c093c0f Bundled output for commit c2a0cf8d04
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-25 17:35:41 +00:00
Sami Mazouz
c2a0cf8d04 fix: Extension admin page erroring out (#3054)
Extension admin pages are currently not working because of a JS error.
The settings record is never defined but directly used, it used to be defined as an empty object in oninit.
2021-08-25 13:33:19 -04:00
SychO9
1b77df12b6 Merge remote-tracking branch 'upstream/1.0.5' 2021-08-25 17:00:45 +01:00
Sami Mazouz
d333d0b0e6 perf: Allow eager loading posts relations of GET discussion endpoint (#3048) 2021-08-23 20:33:21 +01:00
flarum-bot
6defca5a6d Bundled output for commit 0a2b28ebe0
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-23 01:02:28 +00:00
David Wheatley
0a2b28ebe0 Rewrite AdminPage abstract component into Typescript (#2996)
* Rewrite AdminPage.js into Typescript

* Export more interfaces and types

* Use Stream type

* Update js/src/admin/components/AdminPage.tsx

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Move `HTMLInputTypes` type to global declarations

* Add missing app import

* Export options interface

* Remove unused method

* Add random element ID generator

* Add attrs for Page component

Full rewrite needed later

* Provide correct attrs

* Add missing a11y attributes for help text and labels

* Update TSDoc comment

* Allow Children to be passed for label/help text

* Extract setting types to arrays

* Make Page class abstract; fix incorrect Component generic call

* Mark AdminPage as abstract

* Mark `content` as abstract

* Revert "Move `HTMLInputTypes` type to global declarations"

This reverts commit c900cb3f6d.

* Restore TSDoc on HTMLInputTypes type

* Fix typo

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2021-08-23 01:59:50 +01:00
flarum-bot
6c64837247 Bundled output for commit 66aaa862fd
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-22 22:48:43 +00:00
David Wheatley
66aaa862fd fix: reference to undefined variable discussion 2021-08-22 23:46:34 +01:00
flarum-bot
1ab35d89ac Bundled output for commit 3cf19dd2ea
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-22 19:40:36 +00:00
David Wheatley
3cf19dd2ea Rewrite Button to Typescript (#2984)
* Rename Button file

* Convert to TS

* Add debug warning helper

Fires `console.warn`, but only when the forum is in debug mode. Can help to inform extension developers of possible issues with their JS code.

* Simplify button content template

* Rewrite Button component

- Prefer `aria-label` over `title`
- Don't duplicate button content to `title` attribute
- Warn in debug mode if button has no accessible content
- Use modern JS/TS syntax (`||=`, spread, etc)

* Update to work with new Button component

* Update warning

Co-authored-by: Matt Kilgore <tankerkiller125@gmail.com>

* Fire warning in `oncreate`

* Format

* Make Button have extensible Attributes type via generics

* Update args type

* Update js/src/common/components/Button.tsx

Co-authored-by: Matt Kilgore <tankerkiller125@gmail.com>
Co-authored-by: David Sevilla Martin <me@datitisev.me>
Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2021-08-22 20:38:01 +01:00
flarum-bot
01082a44ea Bundled output for commit aba6836bdd
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-21 22:36:48 +00:00
Clark Winkelmann
aba6836bdd Replace username with display name in more places (#3040)
* Replace username with display name in more places

* More readable spread operator and translator user magic
2021-08-21 23:34:34 +01:00
Sami Mazouz
af89b23f67 CSS Code Housekeeping (#3026)
* refactor: Avatar classes refactor
* refactor: Badge classes refactor
* chore: Remove commented dead code
* chore: Remove SignUpModal dead CSS code
Flarum seem to have had some kind of user display in the sign up modal 
on successful sign up, which no longer exists.

https://github.com/flarum/core/blob/v0.1.0-beta/js/forum/src/components/SignUpModal.js#L111
* chore: Deprecate unneeded vendor mixins
* chore: Normalize property values format
Co-authored-by: David Wheatley <hi@davwheat.dev>
* chore: Remove @-webkit-keyframes
* chore: Combine animation properties
* chore: Avoid `all` for transition
* chore: translate3d is no longer necessary for hardware acceleration
* fix: Lost cursor pointer to normalize update
* chore: Use CSS variables for more things
* chore: Remove unecessary overspecification
Co-authored-by: David Wheatley <hi@davwheat.dev>
2021-08-21 19:34:07 +01:00
Sami Mazouz
b5620e0549 Throw a validation error on ico favicons. (#2949) 2021-08-21 16:14:33 +01:00
David Sevilla Martín
57eb621885 Move email confirmation to POST request (#3038)
* Add blade view to confirm email flow, move actual confirmation to POST request

* Apply fixes from StyleCI

[ci skip] [skip ci]

Co-authored-by: datitisev <datitisev@users.noreply.github.com>
2021-08-21 16:13:57 +01:00
flarum-bot
c2ec36b2e2 Bundled output for commit 656cc35a0d
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-21 07:56:13 +00:00
David Wheatley
656cc35a0d Use ItemList for DiscussionPage content (#3004)
* Use ItemList for DiscussionPage content

* Don't import Mithril
2021-08-21 09:53:56 +02:00
flarum-bot
b8754c7d7d Bundled output for commit 7f2e6543ed
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-19 09:17:15 +00:00
David Wheatley
7f2e6543ed Add typings for class component state attribute (#2995)
* Add `state` typings to class components
2021-08-19 10:14:50 +01:00
flarum-bot
cc29cf3e10 Bundled output for commit 2831ce226c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-19 09:13:22 +00:00
David Wheatley
2831ce226c Fix global typings for extensions (#2992)
* Fix global typings for extensions

* Deprecate global `app` typings

See https://github.com/flarum/core/issues/2857#issuecomment-889841326

* Add `app` export for common namespace

* Add missing `app` imports within core

* Add missing `app` imports to JS files

* Fix incorrect import

* Fix admin file importing forum `app`

* Add `flarum` global variable

* Format

* Update JSDoc comment

* Update JSDoc comment

Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>

* Fix frontend JS error

* Empty commit

Co-authored-by: Alexander Skvortsov <sasha.skvortsov109@gmail.com>
2021-08-19 10:10:40 +01:00
David Wheatley
8fe2332f98 Remove format hook on commit; update CI to only build with valid formatting (#3032)
* Remove format hook on commit

We all hate it. Let's remove it.
2021-08-19 01:53:39 +01:00
flarum-bot
e05ccf9f62 Bundled output for commit 83529e23de
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-16 09:57:55 +00:00
David Wheatley
83529e23de [A11Y] Make checkboxes focusable (#3014)
* Add extra feature to a11y focusring mixin

* Add visually hidden CSS class and mixin

* Visually hide checkboxes (keep in focus/a11y tree)

* Place checkbox focus ring around display element

* Improve mobile checkbox/switch accessibility
2021-08-16 11:56:10 +02:00
flarum-bot
51ce89b61f Bundled output for commit ef20e29b20
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-16 09:19:44 +00:00
Sami Mazouz
ef20e29b20 [1.x] Custom Colorising with CSS Custom Properties (#3001)
* Start of conversion to CSS variables
* Use variable for Badge colors
* Use variable for avatar bg
* Use variable for user card bg
* Use css variables for hero
* Use css variables for buttons
* Use css variables for sidenav links
* Cleaner style attr

Co-authored-by: David Wheatley <hi@davwheat.dev>
2021-08-16 10:17:48 +01:00
flarum-bot
5798c4b355 Bundled output for commit afc1a1bbbe
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-15 18:56:32 +00:00
David Wheatley
afc1a1bbbe [A11Y] Explicitly state aria-hidden value; hide icons from screenreaders (#3027)
* Set explicit `aria-hidden` value
* Hide icons from screen-readers
2021-08-15 20:54:50 +02:00
Sami Mazouz
cbf4b9c0b4 Fix NotificationGrid Design (#3028)
Updating normalizer messed with it
https://github.com/flarum/core/pull/3015/files
2021-08-15 19:08:05 +01:00
David Wheatley
b88b530c7e Adds missing defaults for display name driver and User slug driver (#2971) 2021-08-15 16:38:43 +01:00
flarum-bot
c8b514106a Bundled output for commit 634dfc69f3
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-14 23:22:33 +00:00
Ornanovitch
634dfc69f3 Permission Grid: stick the headers to handle a lot of tags (#2887)
* sticky thead th & tbody th, adapt PermissionPage and PermissionGrid layout

* adjust height size

* cleanup

* cleanup with some SychO9's recommendation

* remove the `thead th` `first-child` "protection"
2021-08-15 00:21:08 +01:00
flarum-bot
2a83022727 Bundled output for commit b32496d30c
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-13 22:24:28 +00:00
Hasan Özbey
b32496d30c don't show excerpt if there are no plain content (#2964)
for https://github.com/flarum/core/issues/2942
2021-08-13 23:22:56 +01:00
David Wheatley
d8c112088d Update Normalize.css 2021-08-12 17:46:08 +02:00
Pierre Schmitz
f1ba5e7b70 Limit height of code blocks (#3012)
* Limit height of code blocks

Users often post lengthy code or configuration listings which makes following the actual discussion difficult. Therefore we limit a code block by half a screen while still being able to scroll through the code listing itself.

* Define a minimal code block height for small screens

* Add max-height compatibility for browsers that don't support `max()`

See https://caniuse.com/css-math-functions

* Less has a built-in `max` function, so we need to escape this value

Co-authored-by: David Wheatley <hi@davwheat.dev>
2021-08-11 20:28:02 +01:00
flarum-bot
2dd9e17568 Bundled output for commit 13d302b650
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-08-10 13:54:32 +00:00
Ornanovitch
13d302b650 make user.editGroups depending on viewHiddenGroups (#2880)
should resolve #2610
2021-08-10 14:52:34 +01:00
luceos
9490b3dc32 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-07-31 12:34:23 +02:00
Daniel Klabbers
a26f279e0f use construct binding for ioc dependencies 2021-07-31 12:34:23 +02:00
luceos
ef3d4ca018 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-07-31 12:34:23 +02:00
Daniel Klabbers
c449ea211a added mysql version, queue and mail driver 2021-07-31 12:34:23 +02:00
David Wheatley
ce824b0ccf Use organization Prettier config (#2967)
* Use organization Prettier config

* Bump version to 1.0.0

* Update workflow

* Use npm ci and package.json script
2021-07-30 12:18:20 +01:00
flarum-bot
34803f4b43 Bundled output for commit 81e6b17f83
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-07-26 11:04:48 +00:00
SychO9
81e6b17f83 npm run format 2021-07-26 13:03:09 +02:00
David Wheatley
f949b0a28e Remove class from text input 2021-07-26 13:03:09 +02:00
David Wheatley
66064ca9be Remove class from Mail Select setting component 2021-07-26 13:03:09 +02:00
David Wheatley
f9fc78a10d Prevent class attrs overriding default Select classes 2021-07-26 13:03:09 +02:00
David
e195ca27a8 Fix Select-based setting breaking admin pages 2021-07-26 13:03:09 +02:00
Daniël Klabbers
61624d1533 Update composer.json 2021-07-26 13:02:33 +02:00
Sami Mazouz
d31690e7f5 Avoid intervention/image 2.6.0 2021-07-26 13:02:33 +02:00
Sami Mazouz
2bed1d8038 Revert "Avoid using intervention/image 2.6.0"
This reverts commit 8a7fd66919.
2021-07-26 13:02:33 +02:00
Sami Mazouz
0ce6a1ea9a Revert "Use wildcard for constraint instead"
This reverts commit 4bcfc5078c.
2021-07-26 13:02:33 +02:00
Sami Mazouz
4bcfc5078c Use wildcard for constraint instead
Co-authored-by: Daniël Klabbers <luceos@users.noreply.github.com>
2021-07-21 10:41:53 +02:00
SychO9
8a7fd66919 Avoid using intervention/image 2.6.0 2021-07-21 10:41:53 +02:00
flarum-bot
ac0e98e721 Bundled output for commit 5a1948c4fc
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-07-14 14:15:44 +00:00
David Wheatley
5a1948c4fc Add fix for broken type hinting on class components (#2962) 2021-07-14 15:13:57 +01:00
flarum-bot
9ff1a42396 Bundled output for commit 3130e3de5e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-07-13 12:44:21 +00:00
David Wheatley
3130e3de5e Allow extra attrs provided to <Select> to be passed through to the DOM element (#2959)
* Allow extra attrs provided to `<Select>` to be passed through to the DOM element

* Allow direct passing attrs to the Select wrapper

* Format
2021-07-13 13:42:46 +01:00
David Wheatley
da20d75e3c Hide post footer when empty (#2926)
* Add `Post-footer--empty` class if the post footer contains no items

* Hide post footer when it has class `Post-footer--empty`

* Swap to `:empty` pseudoselector

* Prefer ternary operator

* Fix typo
2021-07-13 13:42:19 +01:00
Daniel Klabbers
7a0df21c5a prevent a couple of cycles by not resolving the excluded middleware on each middleware items 2021-07-13 00:44:27 +02:00
Daniel Klabbers
7d4d3d977b fixes internal clients use of session
With remember from cookie, in certain edge cases, the middleware would
try to load a session which hasn't been instantiated as this middleware
is excluded for the client. Excluding the remember from cookie
middleware will resolve this as authentication is done using the
RequestUtil and ActorReference regardlessly.
2021-07-13 00:32:13 +02:00
David Wheatley
408bb38cc0 Update code block styling to match HLJS 11's new styles (#2909) 2021-07-09 10:04:12 +01:00
flarum-bot
b7cb1e8d36 Bundled output for commit 42dabea81f
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-07-05 15:37:15 +00:00
Lucas Henrique
42dabea81f Move Day.js plugin types import to global typings (#2954) 2021-07-05 16:35:37 +01:00
Daniel Klabbers
a077ae9ca3 set version constant for 1.0.5-dev 2021-06-28 12:26:15 +02:00
Daniel Klabbers
17e9bccc15 changelog for v1.0.4 2021-06-28 12:22:48 +02:00
Ian Morland
4a5b84d2e7 Remove LIKE and raw from viewUserList rename 2021-06-28 11:58:23 +02:00
Ian Morland
557fc2cd39 Include updating of scoped tag permissions
Addresses https://github.com/flarum/core/issues/2924

The rename `viewDiscussions` migration introduced for Flarum 1.0 does not take tag scoped permissions into account
e92c267cde/migrations/2021_05_10_000000_rename_permissions.php (L17)

This adds a new migration to additionally rename `tagX.viewDiscussions` to `tagX.viewForum`

Tested locally on an upgrade from core `beta.16` to `1.0.3`
2021-06-28 11:58:23 +02:00
Daniel Klabbers
e92c267cde update version constant for the next release 2021-06-22 23:38:47 +02:00
Daniel Klabbers
f959a69530 changelog entry for laravel filesystem issue 2021-06-22 23:15:25 +02:00
Daniel Klabbers
4e246779f4 changelog so far for 1.0.3 2021-06-22 23:15:25 +02:00
Daniel Klabbers
5b0f5aeaa0 updated foundation version 2021-06-22 23:15:25 +02:00
Daniel Klabbers
6e92af8b00 Fixes issue with Laravel 8.48 filesystem changes
The FilesystemManager has changed to also allow to override
the config while resolving a filesystem.

This PR adds the argument and applies it if provided.
2021-06-22 23:07:41 +02:00
flarum-bot
1cf9491fe6 Bundled output for commit 3fcc7bd3b9
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-06-21 22:16:28 +00:00
ctml91
3fcc7bd3b9 use display name for avatar color gen 2021-06-22 00:14:37 +02:00
Daniel Klabbers
4acff91f80 allows replacing maintenance mode handler using ioc 2021-06-22 00:10:41 +02:00
Daniël Klabbers
a0152ffb18 Dw/huntr fix path traversal (#2931)
* Fix Huntr vuln with possible directory traversal
* Use `active_url` in Laravel validator
2021-06-21 10:14:15 +02:00
David Wheatley
d1e38558c5 Fix image avatar alignment in notifications (#2906) 2021-06-11 12:13:57 +01:00
Daniël Klabbers
0cca808275 minor improvements to the security policy 2021-06-10 21:56:30 +02:00
Daniël Klabbers
5ee5f82e3d huntr.dev as first point for security vuln (#2918)
* huntr.dev as first point for security vuln

* add badge for huntr.dev
2021-06-10 16:26:40 +02:00
Daniël Klabbers
9077fef5b2 clean up of composer.json, added funding and more support links 2021-06-08 01:58:37 +02:00
Daniël Klabbers
93cebec0be remove tidelift, we stopped doing that 2021-06-08 01:54:11 +02:00
Daniël Klabbers
a4a81c0ec2 Remove [forum] prefix in some mails
fixes #2515
2021-06-08 01:28:04 +02:00
David Wheatley
50dcfdb2a6 Mark typings as generated code (#2886) 2021-06-07 13:12:43 +01:00
flarum-bot
8149397850 Bundled output for commit 1ced907e52
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2021-06-06 01:50:56 +00:00
David Wheatley
1ced907e52 npm audit fix 2021-06-06 02:47:58 +01:00
David Wheatley
17c5a40740 Update changelog 2021-06-06 02:44:32 +01:00
David Wheatley
440bed81b8 Fix XSS vulnerability 2021-06-06 02:41:48 +01:00
David Wheatley
eeb8fe1443 Update version constant to 1.0.2 2021-06-06 02:09:03 +01:00
Daniel Klabbers
11b1ab5932 update version constant for 1.0.2-dev 2021-06-02 09:10:01 +02:00
Daniel Klabbers
6f34c43dc1 v1.0.1 changelog and constant 2021-06-02 09:05:36 +02:00
luceos
8ced9eef45 Apply fixes from StyleCI
[ci skip] [skip ci]
2021-05-31 14:08:49 +00:00
Daniel Klabbers
8af52153e4 ref #2890, no longer using process and dump 2021-05-31 16:08:15 +02:00
Daniel Klabbers
2c5e5f13dd Revert "Revert "Squash core migrations (#2842)""
This reverts commit 16f3ae9d1e.
2021-05-31 15:49:20 +02:00
420 changed files with 4560 additions and 3477 deletions

1
.gitattributes vendored
View File

@@ -12,5 +12,6 @@ tests export-ignore
js/dist/* -diff
js/dist/* linguist-generated
js/dist-typings/* linguist-generated
* text=auto eol=lf

3
.github/FUNDING.yml vendored
View File

@@ -1,3 +0,0 @@
github: flarum
open_collective: flarum
tidelift: packagist/flarum/core

View File

@@ -1,24 +0,0 @@
<!--
IMPORTANT: We applaud pull requests, they excite us every single time. As we have an obligation to maintain a healthy code standard and quality, we take sufficient time for reviews. Please do create a separate pull request per change/issue/feature; we will ask you to split bundled pull requests.
-->
**Fixes #0000**
**Changes proposed in this pull request:**
<!-- fill this out, mention the pages and/or components which have been impacted -->
**Reviewers should focus on:**
<!-- fill this out, ask for feedback on specific changes you are unsure about -->
**Screenshot**
<!-- include an image of the most relevant user-facing change, if any -->
**Confirmed**
- [ ] Frontend changes: tested on a local Flarum installation.
- [ ] Backend changes: tests are green (run `composer test`).
**Required changes:**
- [ ] Related documentation PR: (Remove if irrelevant)
- [ ] Related core extension PRs: (Remove if irrelevant)

13
.github/SECURITY.md vendored
View File

@@ -1,13 +0,0 @@
# Security Policy
## Supported Versions
We will only patch security vulnerabilities in the stable 1.x release.
## Reporting a Vulnerability
If you discover a security vulnerability within Flarum, please send an email to security@flarum.org so we can address it promptly.
We will get back to you as time allows.
Discussions may commence internally, so you may not hear back immediately.
When reporting a vulnerability, please provide your GitHub username (if available), so that we can invite you to collaborate on a [security advisory on GitHub](https://help.github.com/en/articles/about-maintainer-security-advisories).

View File

@@ -1,33 +0,0 @@
name: JavaScript
on:
push:
branches:
- master
jobs:
build:
name: JS / Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Restore npm cache
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('js/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
# Our action will install npm, cd into `./js`, run `npm run build` and
# `npm run build-typings`, then commit and upload any changes
- name: Build production JS
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: npm
typings_script: build-typings

91
.github/workflows/js.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
name: JS
on: [workflow_dispatch, push, pull_request]
env:
NODE_VERSION: 16
jobs:
prettier:
name: Prettier
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/package-lock.json
- name: Install JS dependencies
run: npm ci
working-directory: ./js
- name: Check JS formatting
run: npm run format-check
working-directory: ./js
build-prod:
name: Build and commit
runs-on: ubuntu-latest
needs: [prettier]
# Only commit JS on push to master branch
# Remember to change in `build-test` job too
if: github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/package-lock.json
# Our action will install npm, cd into `./js`, run `npm run build` and
# `npm run build-typings`, then commit and upload any changes
- name: Build production JS
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: npm
typings_script: build-typings
build-test:
name: Test build
runs-on: ubuntu-latest
needs: [prettier]
# Inverse check of `build-prod`
# Remember to change in `build-prod` job too
if: github.ref != 'refs/heads/master' || github.event_name != 'push'
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: js/package-lock.json
# Our action will install npm, cd into `./js`, run `npm run build` and
# `npm run build-typings`, then commit and upload any changes
- name: Build production JS
uses: flarum/action-build@2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
build_script: build
package_manager: npm
typings_script: build-typings
do_not_commit: true

View File

@@ -1,28 +0,0 @@
name: Lint
on:
workflow_dispatch:
push:
paths:
- 'js/src/**'
pull_request:
paths:
- 'js/src/**'
jobs:
prettier:
name: JS / Prettier
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Set up Node
uses: actions/setup-node@v2
with:
node-version: "14"
- name: Check JS formatting
run: npx prettier --check src
working-directory: ./js

View File

@@ -1,5 +1,90 @@
# Changelog
## [1.1.0](https://github.com/flarum/core/compare/v1.0.4...v1.1.0)
### Added
- Info command now displays MySQL version, queue driver, mail driver (https://github.com/flarum/core/pull/2991)
- Use organization Prettier config (https://github.com/flarum/core/pull/2967)
- Support for global typings in extensions (https://github.com/flarum/core/pull/2992)
- Typings for class component state attribute (https://github.com/flarum/core/pull/2995)
- Custom colorising with CSS custom properties (https://github.com/flarum/core/pull/3001)
- Theme Extender to allow overriding LESS files (https://github.com/flarum/core/pull/3008)
- Update lastSeenAt when authenticating via API (https://github.com/flarum/core/pull/3058)
- NoJs Admin View (https://github.com/flarum/core/pull/3059)
- Preload FontAwesome, JS and CSS, and add `preload` extender (https://github.com/flarum/core/pull/3057)
### Changed
- Move Day.js plugin types import to global typings (https://github.com/flarum/core/pull/2954)
- Avoid resolving excluded middleware on each middleware items
- Allow extra attrs provided to `<Select>` to be passed through to the DOM element (https://github.com/flarum/core/pull/2959)
- Limit height of code blocks (https://github.com/flarum/core/pull/3012)
- Update normalize.css from v3.0.2 to v8.0.1 (https://github.com/flarum/core/pull/3015)
- Permission Grid: stick the headers to handle a lot of tags (https://github.com/flarum/core/pull/2887)
- Use `ItemList` for `DiscussionPage` content (https://github.com/flarum/core/pull/3004)
- Move email confirmation to POST request (https://github.com/flarum/core/pull/3038)
- Minor CSS code cleanup (https://github.com/flarum/core/pull/3026)
- Replace username with display name in more places (https://github.com/flarum/core/pull/3040)
- Rewrite Button to Typescript (https://github.com/flarum/core/pull/2984)
- Rewrite AdminPage abstract component into Typescript (https://github.com/flarum/core/pull/2996)
- Allow adding page parameters to PaginatedListState (https://github.com/flarum/core/pull/2935)
- Pass filter params to getApiDocument (https://github.com/flarum/core/pull/3037)
- Use author filter instead of gambit to get a user's discussions (https://github.com/flarum/core/pull/3068)
- [A11Y] Accessibility improvements for the Search component (https://github.com/flarum/core/pull/3017)
- Add determinsm to extension order resolution (https://github.com/flarum/core/pull/3076)
- Add cache control headers to the admin area (https://github.com/flarum/core/pull/3097)
### Fixed
- HLJS 11 new styles resulting in double padding (https://github.com/flarum/core/pull/2909)
- Internal API client attempting to load an uninstantiated session
- Empty post footer taking visual space (https://github.com/flarum/core/pull/2926)
- Unrecognized component class custom attribute typings (https://github.com/flarum/core/pull/2962)
- User edit groups permission not visually depending on view hidden groups permission (https://github.com/flarum/core/pull/2880)
- Event post excerpt preview triggers error (https://github.com/flarum/core/pull/2964)
- Missing settings defaults for display name driver and User slug driver (https://github.com/flarum/core/pull/2971)
- [A11Y] Icons not hidden from screenreaders (https://github.com/flarum/core/pull/3027)
- [A11Y] Checkboxes not focusable (https://github.com/flarum/core/pull/3014)
- Uploading ICO favicons resulting in server errors (https://github.com/flarum/core/pull/2949)
- Missing proper validation for large avatar upload payload (https://github.com/flarum/core/pull/3042)
- [A11Y] Missing focus rings in control elements (https://github.com/flarum/core/pull/3016)
- Unsanitised integer query parameters (https://github.com/flarum/core/pull/3064)
###### Code Contributors
@lhsazevedo, @Ornanovitch, @pierres, @the-turk, @iPurpl3x
###### Issue Reporters
@uamv, @dannyuk1982, @BurnNoticeSpy, @haarp, @peopleinside, @matteocontrini
## [1.0.4](https://github.com/flarum/core/compare/v1.0.3...v1.0.4)
### Fixed
- Upgrade to v1.0 resets the "view" permission on all tags (https://github.com/flarum/core/pull/2941)
## [1.0.3](https://github.com/flarum/core/compare/v1.0.2...v1.0.3)
### Changed
- Removed [forum] prefix from Request Password and Email Confirmation emails ([a4a81c0](https://github.com/flarum/core/commit/a4a81c0ec237476cd6e7ca00c1ed9465493af476))
- Adopt huntr.dev for handling our security vulnerability reports (https://github.com/flarum/core/pull/2918)
- Maintenance handler can now be replaced through the service container (ioc) ([4acff91](https://github.com/flarum/core/commit/4acff91f8063fcced9bf8c9a76fbb510d06823c0))
- The colors on the auto generated avatars are now based on the Display Name of the user (https://github.com/flarum/core/pull/2873)
### Fixed
- Avatar in notifications list are incorrectly aligned (https://github.com/flarum/core/pull/2906)
- FilesystemManager is not compatible with upstream Laravel implementation (https://github.com/flarum/core/pull/2936)
## [1.0.2](https://github.com/flarum/core/compare/v1.0.1...v1.0.2)
### Fixed
- Critical XSS vulnerability
## [1.0.1](https://github.com/flarum/core/compare/v1.0.0...v1.0.1)
### Fixed
- Installation fails on environments without proc_* functions enabled or mysql client binary (https://github.com/flarum/core/issues/2890)
## [1.0.0](https://github.com/flarum/core/compare/v0.1.0-beta.16...v1.0.0)
### Added

View File

@@ -5,6 +5,7 @@
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/dt/flarum/core" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/github/v/release/flarum/core?sort=semver" alt="Latest Version"></a>
<a href="https://packagist.org/packages/flarum/core"><img src="https://img.shields.io/packagist/l/flarum/core" alt="License"></a>
<a href="https://huntr.dev/bounties/disclose/?target=https://github.com/flarum/core"><img src="https://cdn.huntr.dev/huntr_security_badge_mono.svg" alt="huntr"></a>
<a href="https://github.styleci.io/repos/28257573"><img src="https://github.styleci.io/repos/28257573/shield?style=flat" alt="StyleCI"></a>
</p>

View File

@@ -14,10 +14,26 @@
"homepage": "https://flarum.org/team"
}
],
"funding": [
{
"type": "opencollective",
"url": "https://opencollective.com/flarum"
},
{
"type": "github",
"url": "https://github.com/sponsors/flarum"
},
{
"type": "other",
"url": "https://flarum.org/donate"
}
],
"support": {
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/core",
"docs": "https://flarum.org/docs/"
"docs": "https://docs.flarum.org",
"forum": "https://discuss.flarum.org",
"chat": "https://flarum.org/chat"
},
"require": {
"php": ">=7.3",
@@ -43,7 +59,7 @@
"illuminate/support": "^8.0",
"illuminate/validation": "^8.0",
"illuminate/view": "^8.0",
"intervention/image": "^2.5.0",
"intervention/image": "2.5.* || ^2.6.1",
"laminas/laminas-diactoros": "^2.4.1",
"laminas/laminas-httphandlerrunner": "^1.2.0",
"laminas/laminas-stratigility": "^3.2.2",

View File

@@ -1,6 +0,0 @@
{
"printWidth": 150,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}

View File

@@ -1,39 +0,0 @@
// Mithril
import Mithril from 'mithril';
// Other third-party libs
import * as _dayjs from 'dayjs';
import * as _$ from 'jquery';
// Globals from flarum/core
import Application from '../../src/common/Application';
import type { TooltipJQueryFunction } from '../tooltips';
/**
* flarum/core exposes several extensions globally:
*
* - jQuery for convenient DOM manipulation
* - Mithril for VDOM and components
* - dayjs for date/time operations
*
* Since these are already part of the global namespace, extensions won't need
* to (and should not) bundle these themselves.
*/
declare global {
// $ is already defined by `@types/jquery`
const m: Mithril.Static;
const dayjs: typeof _dayjs;
// Extend JQuery with our custom functions, defined with $.fn
interface JQuery {
tooltip: TooltipJQueryFunction;
}
}
/**
* All global variables owned by flarum/core.
*/
declare global {
const app: Application;
}

82
js/dist-typings/@types/global.d.ts vendored Normal file
View File

@@ -0,0 +1,82 @@
/**
* @deprecated Please import `app` from a namespace instead of using it as a global variable.
*
* @example App in forum JS
* ```
* import app from 'flarum/forum/app';
* ```
*
* @example App in admin JS
* ```
* import app from 'flarum/admin/app';
* ```
*
* @example App in common JS
* ```
* import app from 'flarum/common/app';
* ```
*/
declare const app: never;
declare const m: import('mithril').Static;
declare const dayjs: typeof import('dayjs');
type ESModule = { __esModule: true; [key: string]: unknown };
/**
* The global `flarum` variable.
*
* Contains the compiled ES Modules for all Flarum extensions and core.
*
* @example <caption>Check if `flarum-tags` is present</captions>
* if ('flarum-tags' in flarum.extensions) {
* // Tags is installed and enabled!
* }
*/
interface FlarumObject {
/**
* Contains the compiled ES Module for Flarum's core.
*
* You shouldn't need to access this directly for any reason.
*/
core: Readonly<ESModule>;
/**
* Contains the compiled ES Modules for all Flarum extensions.
*
* @example <caption>Check if `flarum-tags` is present</captions>
* if ('flarum-tags' in flarum.extensions) {
* // Tags is installed and enabled!
* }
*/
extensions: Readonly<Record<string, ESModule>>;
}
declare const flarum: FlarumObject;
// Extend JQuery with our custom functions, defined with $.fn
interface JQuery {
/**
* Flarum's tooltip JQuery plugin.
*
* Do not use this directly. Instead use the `<Tooltip>` component that
* is exported from `flarum/common/components/Tooltip`.
*
* This will be removed in a future version of Flarum.
*
* @deprecated
*/
tooltip: import('./tooltips/index').TooltipJQueryFunction;
}
/**
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
*
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
* what property on component classes to look at for attribute typings. For our
* Component class, this would be `attrs` (e.g. `this.attrs...`)
*/
interface JSX {
ElementAttributesProperty: {
attrs: Record<string, unknown>;
};
}

View File

@@ -1,39 +0,0 @@
// Mithril
import Mithril from 'mithril';
// Other third-party libs
import * as _dayjs from 'dayjs';
import * as _$ from 'jquery';
// Globals from flarum/core
import Application from '../../src/common/Application';
import type { TooltipJQueryFunction } from '../tooltips';
/**
* flarum/core exposes several extensions globally:
*
* - jQuery for convenient DOM manipulation
* - Mithril for VDOM and components
* - dayjs for date/time operations
*
* Since these are already part of the global namespace, extensions won't need
* to (and should not) bundle these themselves.
*/
declare global {
// $ is already defined by `@types/jquery`
const m: Mithril.Static;
const dayjs: typeof _dayjs;
// Extend JQuery with our custom functions, defined with $.fn
interface JQuery {
tooltip: TooltipJQueryFunction;
}
}
/**
* All global variables owned by flarum/core.
*/
declare global {
const app: Application;
}

View File

@@ -96,6 +96,7 @@ declare var _default: {
'utils/ExtensionData': typeof ExtensionData;
'utils/isExtensionEnabled': typeof isExtensionEnabled;
'utils/getCategorizedExtensions': typeof getCategorizedExtensions;
'utils/generateElementId': typeof generateElementId;
'components/SettingDropdown': typeof SettingDropdown;
'components/EditCustomFooterModal': typeof EditCustomFooterModal;
'components/SessionDropdown': typeof SessionDropdown;
@@ -132,6 +133,7 @@ import saveSettings from "./utils/saveSettings";
import ExtensionData from "./utils/ExtensionData";
import isExtensionEnabled from "./utils/isExtensionEnabled";
import getCategorizedExtensions from "./utils/getCategorizedExtensions";
import generateElementId from "./utils/generateElementId";
import SettingDropdown from "./components/SettingDropdown";
import EditCustomFooterModal from "./components/EditCustomFooterModal";
import SessionDropdown from "./components/SessionDropdown";

View File

@@ -1,4 +1,4 @@
export default class AdminHeader extends Component<import("../../common/Component").ComponentAttrs> {
export default class AdminHeader extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../../common/Component";

View File

@@ -1,4 +1,4 @@
export default class AdminNav extends Component<import("../../common/Component").ComponentAttrs> {
export default class AdminNav extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
query: Stream<string> | undefined;
scrollToActive(): void;

View File

@@ -1,55 +0,0 @@
export default class AdminPage extends Page {
settings: {} | undefined;
loading: boolean | undefined;
content(): string;
submitButton(): JSX.Element;
header(): JSX.Element;
headerInfo(): {
className: string;
icon: string;
title: string;
description: string;
};
/**
* buildSettingComponent takes a settings object and turns it into a component.
* Depending on the type of input, you can set the type to 'bool', 'select', or
* any standard <input> type. Any values inside the 'extra' object will be added
* to the component as an attribute.
*
* Alternatively, you can pass a callback that will be executed in ExtensionPage's
* context to include custom JSX elements.
*
* @example
*
* {
* setting: 'acme.checkbox',
* label: app.translator.trans('acme.admin.setting_label'),
* type: 'bool',
* help: app.translator.trans('acme.admin.setting_help'),
* className: 'Setting-item'
* }
*
* @example
*
* {
* setting: 'acme.select',
* label: app.translator.trans('acme.admin.setting_label'),
* type: 'select',
* options: {
* 'option1': 'Option 1 label',
* 'option2': 'Option 2 label',
* },
* default: 'option1',
* }
*
* @param setting
* @returns {JSX.Element}
*/
buildSettingComponent(entry: any): JSX.Element;
onsaved(): void;
setting(key: any, fallback?: string): any;
dirty(): {};
isChanged(): number;
saveSettings(e: any): Promise<void>;
}
import Page from "../../common/components/Page";

View File

@@ -1,3 +1,4 @@
export default class AppearancePage extends AdminPage {
export default class AppearancePage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
constructor();
}
import AdminPage from "./AdminPage";

View File

@@ -1,4 +1,5 @@
export default class BasicsPage extends AdminPage {
export default class BasicsPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
constructor();
localeOptions: {} | undefined;
displayNameOptions: {} | undefined;
slugDriverOptions: {} | undefined;

View File

@@ -1,4 +1,5 @@
export default class DashboardPage extends AdminPage {
export default class DashboardPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
constructor();
availableWidgets(): ItemList;
}
import AdminPage from "./AdminPage";

View File

@@ -1,4 +1,4 @@
export default class DashboardWidget extends Component<import("../../common/Component").ComponentAttrs> {
export default class DashboardWidget extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Get the class name to apply to the widget.

View File

@@ -1,4 +1,5 @@
export default class ExtensionPage extends AdminPage {
export default class ExtensionPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
constructor();
extension: any;
changingState: boolean | undefined;
infoFields: {

View File

@@ -2,7 +2,7 @@
* The `HeaderPrimary` component displays primary header controls. On the
* default skin, these are shown just to the right of the forum title.
*/
export default class HeaderPrimary extends Component<import("../../common/Component").ComponentAttrs> {
export default class HeaderPrimary extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
config(isInitialized: any, context: any): void;
/**

View File

@@ -1,7 +1,7 @@
/**
* The `HeaderSecondary` component displays secondary header controls.
*/
export default class HeaderSecondary extends Component<import("../../common/Component").ComponentAttrs> {
export default class HeaderSecondary extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Build an item list for the controls.

View File

@@ -1,4 +1,5 @@
export default class MailPage extends AdminPage {
export default class MailPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
constructor();
sendingTest: boolean | undefined;
refresh(): void;
status: {

View File

@@ -1,4 +1,4 @@
export default class PermissionGrid extends Component<import("../../common/Component").ComponentAttrs> {
export default class PermissionGrid extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
permissionItems(): ItemList;
viewItems(): ItemList;

View File

@@ -1,3 +1,4 @@
export default class PermissionsPage extends AdminPage {
export default class PermissionsPage extends AdminPage<import("../../common/components/Page").IPageAttrs> {
constructor();
}
import AdminPage from "./AdminPage";

View File

@@ -1,4 +1,5 @@
export default class UploadImageButton extends Button {
export default class UploadImageButton extends Button<import("../../common/components/Button").IButtonAttrs> {
constructor();
loading: boolean;
/**
* Prompt the user to upload an image.

View File

@@ -0,0 +1 @@
export { nanoid as default } from 'nanoid';

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
export interface ComponentAttrs extends Mithril.Attributes {
}
/**
@@ -28,7 +28,7 @@ export interface ComponentAttrs extends Mithril.Attributes {
*
* @see https://mithril.js.org/components.html
*/
export default abstract class Component<T extends ComponentAttrs = ComponentAttrs> implements Mithril.ClassComponent<T> {
export default abstract class Component<Attrs extends ComponentAttrs = ComponentAttrs, State = undefined> implements Mithril.ClassComponent<Attrs> {
/**
* The root DOM element for the component.
*/
@@ -38,35 +38,47 @@ export default abstract class Component<T extends ComponentAttrs = ComponentAttr
*
* @see https://mithril.js.org/components.html#passing-data-to-components
*/
protected attrs: T;
protected attrs: Attrs;
/**
* Class component state that is persisted between redraws.
*
* Updating this will **not** automatically trigger a redraw, unlike
* other frameworks.
*
* This is different to Vnode state, which is always an instance of your
* class component.
*
* This is `undefined` by default.
*/
protected state: State;
/**
* @inheritdoc
*/
abstract view(vnode: Mithril.Vnode<T, this>): Mithril.Children;
abstract view(vnode: Mithril.Vnode<Attrs, this>): Mithril.Children;
/**
* @inheritdoc
*/
oninit(vnode: Mithril.Vnode<T, this>): void;
oninit(vnode: Mithril.Vnode<Attrs, this>): void;
/**
* @inheritdoc
*/
oncreate(vnode: Mithril.VnodeDOM<T, this>): void;
oncreate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
/**
* @inheritdoc
*/
onbeforeupdate(vnode: Mithril.VnodeDOM<T, this>): void;
onbeforeupdate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
/**
* @inheritdoc
*/
onupdate(vnode: Mithril.VnodeDOM<T, this>): void;
onupdate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
/**
* @inheritdoc
*/
onbeforeremove(vnode: Mithril.VnodeDOM<T, this>): void;
onbeforeremove(vnode: Mithril.VnodeDOM<Attrs, this>): void;
/**
* @inheritdoc
*/
onremove(vnode: Mithril.VnodeDOM<T, this>): void;
onremove(vnode: Mithril.VnodeDOM<Attrs, this>): void;
/**
* Returns a jQuery object for this component's element. If you pass in a
* selector string, this method will return a jQuery object, using the current

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `Fragment` class represents a chunk of DOM that is rendered once with Mithril and then takes
* over control of its own DOM and lifecycle.

6
js/dist-typings/common/app.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
import type Application from './Application';
declare const _default: Application;
/**
* The instance of Application within the common namespace.
*/
export default _default;

View File

@@ -1,5 +1,5 @@
import Component, { ComponentAttrs } from '../Component';
import Mithril from 'mithril';
import type Mithril from 'mithril';
export interface AlertAttrs extends ComponentAttrs {
/** The type of alert this is. Will be used to give the alert a class name of `Alert--{type}`. */
type?: string;

View File

@@ -2,8 +2,7 @@
* The `AlertManager` component provides an area in which `Alert` components can
* be shown and dismissed.
*/
export default class AlertManager extends Component<import("../Component").ComponentAttrs> {
export default class AlertManager extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
state: any;
}
import Component from "../Component";

View File

@@ -11,7 +11,7 @@
*
* All other attrs will be assigned as attributes on the badge element.
*/
export default class Badge extends Component<import("../Component").ComponentAttrs> {
export default class Badge extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../Component";

View File

@@ -1,29 +1,69 @@
import type Mithril from 'mithril';
import Component, { ComponentAttrs } from '../Component';
export interface IButtonAttrs extends ComponentAttrs {
/**
* Class(es) of an optional icon to be rendered within the button.
*
* If provided, the button will gain a `has-icon` class.
*/
icon?: string;
/**
* Disables button from user input.
*
* Default: `false`
*/
disabled?: boolean;
/**
* Show a loading spinner within the button.
*
* If `true`, also disables the button.
*
* Default: `false`
*/
loading?: boolean;
/**
* **DEPRECATED:** Please use the `aria-label` attribute instead. For tooltips, use
* the `<Tooltip>` component.
*
* Accessible text for the button. This should always be present if the button only
* contains an icon.
*
* The textual content of this attribute is passed to the DOM element as `aria-label`.
*
* @deprecated
*/
title?: string | Mithril.ChildArray;
/**
* Accessible text for the button. This should always be present if the button only
* contains an icon.
*
* The textual content of this attribute is passed to the DOM element as `aria-label`.
*/
'aria-label'?: string | Mithril.ChildArray;
/**
* Button type.
*
* Default: `"button"`
*
* @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#attr-type
*/
type?: string;
}
/**
* The `Button` component defines an element which, when clicked, performs an
* action.
*
* ### Attrs
*
* - `icon` The name of the icon class. If specified, the button will be given a
* 'has-icon' class name.
* - `disabled` Whether or not the button is disabled. If truthy, the button
* will be given a 'disabled' class name, and any `onclick` handler will be
* removed.
* - `loading` Whether or not the button should be in a disabled loading state.
*
* All other attrs will be assigned as attributes on the button element.
* Other attrs will be assigned as attributes on the `<button>` element.
*
* Note that a Button has no default class names. This is because a Button can
* be used to represent any generic clickable control, like a menu item.
* be used to represent any generic clickable control, like a menu item. Common
* styles can be applied by providing `className="Button"` to the Button component.
*/
export default class Button extends Component<import("../Component").ComponentAttrs> {
constructor();
export default class Button<CustomAttrs extends IButtonAttrs = IButtonAttrs> extends Component<CustomAttrs> {
view(vnode: Mithril.Vnode<IButtonAttrs, never>): JSX.Element;
oncreate(vnode: Mithril.VnodeDOM<IButtonAttrs, this>): void;
/**
* Get the template for the button's content.
*
* @return {*}
* @protected
*/
protected getButtonContent(children: any): any;
protected getButtonContent(children: Mithril.Children): Mithril.ChildArray;
}
import Component from "../Component";

View File

@@ -10,7 +10,7 @@
* - `onchange` A callback to run when the checkbox is checked/unchecked.
* - `children` A text label to display next to the checkbox.
*/
export default class Checkbox extends Component<import("../Component").ComponentAttrs> {
export default class Checkbox extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
/**
* Get the template for the checkbox's display (tick/cross icon).

View File

@@ -14,7 +14,7 @@
* another component / DOM element.)
*
*/
export default class ConfirmDocumentUnload extends Component<import("../Component").ComponentAttrs> {
export default class ConfirmDocumentUnload extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
handler(): any;
boundHandler: (() => any) | undefined;

View File

@@ -15,7 +15,7 @@
*
* The children will be displayed as a list inside of the dropdown menu.
*/
export default class Dropdown extends Component<import("../Component").ComponentAttrs> {
export default class Dropdown extends Component<import("../Component").ComponentAttrs, undefined> {
static initAttrs(attrs: any): void;
constructor();
showing: boolean | undefined;

View File

@@ -7,7 +7,7 @@
*
* The children should be an array of items to show in the fieldset.
*/
export default class FieldSet extends Component<import("../Component").ComponentAttrs> {
export default class FieldSet extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../Component";

View File

@@ -6,7 +6,7 @@
* Links will default to internal; the 'external' attr must be set to
* `true` for the link to be external.
*/
export default class Link extends Component<import("../Component").ComponentAttrs> {
export default class Link extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../Component";

View File

@@ -11,7 +11,7 @@
* the `active` prop will automatically be set to true.
* - `force` Whether the page should be fully rerendered. Defaults to `true`.
*/
export default class LinkButton extends Button {
export default class LinkButton extends Button<import("./Button").IButtonAttrs> {
static initAttrs(attrs: any): void;
/**
* Determine whether a component with the given attrs is 'active'.
@@ -20,5 +20,6 @@ export default class LinkButton extends Button {
* @return {Boolean}
*/
static isActive(attrs: Object): boolean;
constructor();
}
import Button from "./Button";

View File

@@ -4,7 +4,7 @@
*
* @abstract
*/
export default class Modal extends Component<import("../Component").ComponentAttrs> {
export default class Modal extends Component<import("../Component").ComponentAttrs, undefined> {
/**
* Determine whether or not the modal should be dismissible via an 'x' button.
*/

View File

@@ -3,7 +3,7 @@
* can be shown at once; loading a new component into the ModalManager will
* overwrite the previous one.
*/
export default class ModalManager extends Component<import("../Component").ComponentAttrs> {
export default class ModalManager extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
animateShow(readyCallback: any): void;
animateHide(): void;

View File

@@ -13,7 +13,7 @@
* - `drawer` Whether or not to show a button to toggle the app's drawer if
* there is no more history to pop.
*/
export default class Navigation extends Component<import("../Component").ComponentAttrs> {
export default class Navigation extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
/**
* Get the back button.

View File

@@ -1,27 +1,15 @@
import Component from '../Component';
export interface IPageAttrs {
key?: number;
routeName: string;
}
/**
* The `Page` component
*
* @abstract
*/
export default class Page extends Component<import("../Component").ComponentAttrs> {
constructor();
/**
* A class name to apply to the body while the route is active.
*
* @type {String}
*/
bodyClass: string | undefined;
/**
* Whether we should scroll to the top of the page when its rendered.
*
* @type {Boolean}
*/
scrollTopOnCreate: boolean | undefined;
/**
* Whether the browser should restore scroll state on refreshes.
*
* @type {Boolean}
*/
useBrowserScrollRestoration: boolean | undefined;
export default abstract class Page<CustomAttrs extends IPageAttrs = IPageAttrs> extends Component<CustomAttrs> {
oninit(vnode: any): void;
oncreate(vnode: any): void;
onremove(vnode: any): void;
}
import Component from "../Component";

View File

@@ -6,7 +6,7 @@
*
* - `text`
*/
export default class Placeholder extends Component<import("../Component").ComponentAttrs> {
export default class Placeholder extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../Component";

View File

@@ -6,8 +6,11 @@
* - `onchange` A callback to run when the selected value is changed.
* - `value` The value of the selected option.
* - `disabled` Disabled state for the input.
* - `wrapperAttrs` A map of attrs to be passed to the DOM element wrapping the `<select>`
*
* Other attributes are passed directly to the `<select>` element rendered to the DOM.
*/
export default class Select extends Component<import("../Component").ComponentAttrs> {
export default class Select extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../Component";

View File

@@ -2,7 +2,7 @@ export default Separator;
/**
* The `Separator` component defines a menu separator item.
*/
declare class Separator extends Component<import("../Component").ComponentAttrs> {
declare class Separator extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
}
declare namespace Separator {

View File

@@ -11,7 +11,7 @@
* - `disabled`
* - `preview`
*/
export default class TextEditor extends Component<import("../Component").ComponentAttrs> {
export default class TextEditor extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
/**
* The value of the editor.

View File

@@ -1,8 +1,14 @@
/**
* The `TextEditorButton` component displays a button suitable for the text
* editor toolbar.
*
* Automatically creates tooltips using the Tooltip component and provided text.
*
* ## Attrs
* - `title` - Tooltip for the button
*/
export default class TextEditorButton extends Button {
export default class TextEditorButton extends Button<import("./Button").IButtonAttrs> {
static initAttrs(attrs: any): void;
constructor();
}
import Button from "./Button";

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
import User from '../models/User';
/**
* The `avatar` helper displays a user's avatar.

View File

@@ -0,0 +1,12 @@
/**
* Calls `console.warn` with the provided arguments, but only if the forum is in debug mode.
*
* This function is intended to provide warnings to extension developers about issues with
* their extensions that may not be easily noticed when testing, such as accessibility
* issues.
*
* These warnings should be hidden on production forums to ensure webmasters are not
* inundated with do-gooders telling them they have an issue when it isn't something they
* can fix.
*/
export default function fireDebugWarning(...args: Parameters<typeof console.warn>): void;

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `fullTime` helper displays a formatted time string wrapped in a <time>
* tag.

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `highlight` helper searches for a word phrase in a string, and wraps
* matches with the <mark> tag.

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `humanTime` helper displays a time in a human-friendly time-ago format
* (e.g. '12 days ago'), wrapped in a <time> tag with other information about

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `icon` helper displays an icon.
*

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `listItems` helper wraps a collection of components in <li> tags,
* stripping out any unnecessary `Separator` components.

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
import User from '../models/User';
/**
* The `useronline` helper displays a green circle if the user is online

View File

@@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
import User from '../models/User';
/**
* The `username` helper displays a user's username in a <span class="username">

View File

@@ -1,2 +1,3 @@
export { Extend };
import * as Extend from "./extend/index";
import app from "./app";
export { Extend, app };

View File

@@ -1,4 +1,4 @@
import Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* Generates a route resolver for a given component.
* In addition to regular route resolver functionality:

View File

@@ -1,4 +1,4 @@
import Mithril from 'mithril';
import type Mithril from 'mithril';
import Alert, { AlertAttrs } from '../components/Alert';
/**
* Returned by `AlertManagerState.show`. Used to dismiss alerts.

View File

@@ -1,4 +1,3 @@
import 'dayjs/plugin/relativeTime';
/**
* The `humanTime` utility converts a date to a localized, human-readable time-
* ago string.

View File

@@ -1,4 +1,4 @@
import Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* Mithril 2 does not completely rerender the page if a route change leads to the same route
* (or the same component handling a different route). This util calls m.route.set, forcing a reonit.

View File

@@ -9,7 +9,7 @@
*
* @see https://getbootstrap.com/docs/3.4/javascript/#affix
*/
export default class AffixedSidebar extends Component<import("../../common/Component").ComponentAttrs> {
export default class AffixedSidebar extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
boundOnresize: (() => void) | undefined;
onresize(): void;

View File

@@ -7,7 +7,7 @@
* - `className`
* - `user`
*/
export default class AvatarEditor extends Component<import("../../common/Component").ComponentAttrs> {
export default class AvatarEditor extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Whether or not an avatar upload is in progress.

View File

@@ -24,7 +24,7 @@ export default class CommentPost extends Post {
cardVisible: boolean | undefined;
refreshContent(): void;
contentHtml: any;
isEditing(): any;
isEditing(): boolean;
/**
* Toggle the visibility of a hidden post's content.
*/

View File

@@ -3,14 +3,8 @@
* content component with `load` and then its position/state can be altered with
* `show`, `hide`, `close`, `minimize`, `fullScreen`, and `exitFullScreen`.
*/
export default class Composer extends Component<import("../../common/Component").ComponentAttrs> {
export default class Composer extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* The composer's "state".
*
* @type {ComposerState}
*/
state: ComposerState | undefined;
/**
* Whether or not the composer currently has focus.
*
@@ -108,5 +102,4 @@ export default class Composer extends Component<import("../../common/Component")
changeHeight(height: any): void;
}
import Component from "../../common/Component";
import ComposerState from "../states/ComposerState";
import ItemList from "../../common/utils/ItemList";

View File

@@ -15,7 +15,7 @@
*
* @abstract
*/
export default class ComposerBody extends Component<import("../../common/Component").ComponentAttrs> {
export default class ComposerBody extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
composer: any;
/**

View File

@@ -2,7 +2,8 @@
* The `ComposerButton` component displays a button suitable for the composer
* controls.
*/
export default class ComposerButton extends Button {
export default class ComposerButton extends Button<import("../../common/components/Button").IButtonAttrs> {
static initAttrs(attrs: any): void;
constructor();
}
import Button from "../../common/components/Button";

View File

@@ -10,7 +10,7 @@
* - `className` A CSS class for the element surrounding the preview.
* - `surround` A callback that can execute code before and after re-render, e.g. for scroll anchoring.
*/
export default class ComposerPostPreview extends Component<import("../../common/Component").ComponentAttrs> {
export default class ComposerPostPreview extends Component<import("../../common/Component").ComponentAttrs, undefined> {
static initAttrs(attrs: any): void;
constructor();
updateInterval: number | undefined;

View File

@@ -5,7 +5,7 @@
*
* - `discussion`
*/
export default class DiscussionHero extends Component<import("../../common/Component").ComponentAttrs> {
export default class DiscussionHero extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Build an item list for the contents of the discussion hero.

View File

@@ -5,7 +5,7 @@
*
* - `state` A DiscussionListState object that represents the discussion lists's state.
*/
export default class DiscussionList extends Component<import("../../common/Component").ComponentAttrs> {
export default class DiscussionList extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../../common/Component";

View File

@@ -7,7 +7,7 @@
* - `discussion`
* - `params`
*/
export default class DiscussionListItem extends Component<import("../../common/Component").ComponentAttrs> {
export default class DiscussionListItem extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Set up a subtree retainer so that the discussion will not be redrawn

View File

@@ -7,7 +7,7 @@
*
* - `state` A DiscussionListState object that represents the discussion lists's state.
*/
export default class DiscussionListPane extends Component<import("../../common/Component").ComponentAttrs> {
export default class DiscussionListPane extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Are we on a device that's larger than we consider "mobile"?

View File

@@ -2,7 +2,9 @@
* The `DiscussionPage` component displays a whole discussion page, including
* the discussion list pane, the hero, the posts, and the sidebar.
*/
export default class DiscussionPage extends Page {
export default class DiscussionPage extends Page<import("../../common/components/Page").IPageAttrs> {
constructor();
useBrowserScrollRestoration: boolean | undefined;
/**
* The discussion that is being viewed.
*
@@ -15,6 +17,37 @@ export default class DiscussionPage extends Page {
* @type {number}
*/
near: number | undefined;
bodyClass: string | undefined;
/**
* List of components shown while the discussion is loading.
*
* @returns {ItemList}
*/
loadingItems(): ItemList;
/**
* Function that renders the `sidebarItems` ItemList.
*
* @returns {import('mithril').Children}
*/
sidebar(): import('mithril').Children;
/**
* Renders the discussion's hero.
*
* @returns {import('mithril').Children}
*/
hero(): import('mithril').Children;
/**
* List of items rendered as the main page content.
*
* @returns {ItemList}
*/
pageContent(): ItemList;
/**
* List of items rendered inside the main page content container.
*
* @returns {ItemList}
*/
mainContent(): ItemList;
/**
* Load the discussion from the API or use the preloaded one.
*/
@@ -49,5 +82,5 @@ export default class DiscussionPage extends Page {
positionChanged(startNumber: any, endNumber: any): void;
}
import Page from "../../common/components/Page";
import PostStreamState from "../states/PostStreamState";
import ItemList from "../../common/utils/ItemList";
import PostStreamState from "../states/PostStreamState";

View File

@@ -1,5 +1,5 @@
import { SearchSource } from './Search';
import Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `DiscussionsSearchSource` finds and displays discussion search results in
* the search dropdown.

View File

@@ -3,7 +3,5 @@
* page.
*/
export default class DiscussionsUserPage extends UserPage {
state: DiscussionListState | undefined;
}
import UserPage from "./UserPage";
import DiscussionListState from "../states/DiscussionListState";

View File

@@ -2,7 +2,7 @@
* The `HeaderPrimary` component displays primary header controls. On the
* default skin, these are shown just to the right of the forum title.
*/
export default class HeaderPrimary extends Component<import("../../common/Component").ComponentAttrs> {
export default class HeaderPrimary extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Build an item list for the controls.

View File

@@ -3,7 +3,7 @@
* the search box and the user menu. On the default skin, these are shown on the
* right side of the header.
*/
export default class HeaderSecondary extends Component<import("../../common/Component").ComponentAttrs> {
export default class HeaderSecondary extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Build an item list for the controls.

View File

@@ -2,9 +2,12 @@
* The `IndexPage` component displays the index page, including the welcome
* hero, the sidebar, and the discussion list.
*/
export default class IndexPage extends Page {
export default class IndexPage extends Page<import("../../common/components/Page").IPageAttrs> {
static providesInitialSearch: boolean;
constructor();
lastDiscussion: any;
bodyClass: string | undefined;
scrollTopOnCreate: boolean | undefined;
setTitle(): void;
/**
* Get the component to display as the hero.

View File

@@ -2,7 +2,7 @@
* The `LoadingPost` component shows a placeholder that looks like a post,
* indicating that the post is loading.
*/
export default class LoadingPost extends Component<import("../../common/Component").ComponentAttrs> {
export default class LoadingPost extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../../common/Component";

View File

@@ -6,7 +6,8 @@
*
* - `path`
*/
export default class LogInButton extends Button {
export default class LogInButton extends Button<import("../../common/components/Button").IButtonAttrs> {
static initAttrs(attrs: any): void;
constructor();
}
import Button from "../../common/components/Button";

View File

@@ -1,7 +1,7 @@
/**
* The `LogInButtons` component displays a collection of social login buttons.
*/
export default class LogInButtons extends Component<import("../../common/Component").ComponentAttrs> {
export default class LogInButtons extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Build a list of LogInButton components.

View File

@@ -8,7 +8,7 @@
*
* @abstract
*/
export default class Notification extends Component<import("../../common/Component").ComponentAttrs> {
export default class Notification extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Get the name of the icon that should be displayed in the notification.

View File

@@ -6,7 +6,7 @@
*
* - `user`
*/
export default class NotificationGrid extends Component<import("../../common/Component").ComponentAttrs> {
export default class NotificationGrid extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Information about the available notification methods.

View File

@@ -2,7 +2,7 @@
* The `NotificationList` component displays a list of the logged-in user's
* notifications, grouped by discussion.
*/
export default class NotificationList extends Component<import("../../common/Component").ComponentAttrs> {
export default class NotificationList extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
content(state: any): any;
$notifications: JQuery<HTMLElement> | undefined;

View File

@@ -2,6 +2,8 @@
* The `NotificationsPage` component shows the notifications list. It is only
* used on mobile devices where the notifications dropdown is within the drawer.
*/
export default class NotificationsPage extends Page {
export default class NotificationsPage extends Page<import("../../common/components/Page").IPageAttrs> {
constructor();
bodyClass: string | undefined;
}
import Page from "../../common/components/Page";

View File

@@ -9,7 +9,7 @@
*
* @abstract
*/
export default class Post extends Component<import("../../common/Component").ComponentAttrs> {
export default class Post extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
loading: boolean | undefined;
/**

View File

@@ -6,7 +6,7 @@
*
* - `post`
*/
export default class PostEdited extends Component<import("../../common/Component").ComponentAttrs> {
export default class PostEdited extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../../common/Component";

View File

@@ -7,7 +7,7 @@
*
* - `post`
*/
export default class PostMeta extends Component<import("../../common/Component").ComponentAttrs> {
export default class PostMeta extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Get the permalink for the given post.

View File

@@ -6,7 +6,7 @@
*
* - `post`
*/
export default class PostPreview extends Component<import("../../common/Component").ComponentAttrs> {
export default class PostPreview extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../../common/Component";

View File

@@ -9,7 +9,7 @@
* - `targetPost`
* - `onPositionChange`
*/
export default class PostStream extends Component<import("../../common/Component").ComponentAttrs> {
export default class PostStream extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
discussion: any;
stream: any;

View File

@@ -7,7 +7,7 @@
* - `stream`
* - `className`
*/
export default class PostStreamScrubber extends Component<import("../../common/Component").ComponentAttrs> {
export default class PostStreamScrubber extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
stream: any;
handlers: {} | undefined;

View File

@@ -5,7 +5,7 @@
*
* - `post`
*/
export default class PostUser extends Component<import("../../common/Component").ComponentAttrs> {
export default class PostUser extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
/**
* Show the user card.

View File

@@ -6,7 +6,7 @@
*
* - `discussion`
*/
export default class ReplyPlaceholder extends Component<import("../../common/Component").ComponentAttrs> {
export default class ReplyPlaceholder extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
anchorPreview(preview: any): void;
}

View File

@@ -2,7 +2,7 @@ import Component, { ComponentAttrs } from '../../common/Component';
import ItemList from '../../common/utils/ItemList';
import KeyboardNavigatable from '../utils/KeyboardNavigatable';
import SearchState from '../states/SearchState';
import Mithril from 'mithril';
import type Mithril from 'mithril';
/**
* The `SearchSource` interface defines a section of search results in the
* search dropdown.

View File

@@ -6,7 +6,7 @@
* - `discussion`
* - `lastPost`
*/
export default class TerminalPost extends Component<import("../../common/Component").ComponentAttrs> {
export default class TerminalPost extends Component<import("../../common/Component").ComponentAttrs, undefined> {
constructor();
}
import Component from "../../common/Component";

Some files were not shown because too many files have changed in this diff Show More