1
0
mirror of https://github.com/flarum/core.git synced 2025-08-13 20:04:24 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
Alexander Skvortsov
e9d8c0726d feat: update tsconfig docs 2022-04-07 16:30:36 -04:00
Alexander Skvortsov
246bf54155 chore: update flarum/core references to flarum/monorepo 2022-04-07 16:30:31 -04:00
132 changed files with 1615 additions and 934 deletions

View File

@@ -1,7 +1,26 @@
---
name: "🚀 Feature Request"
about: "If you have a suggestion please head over to our forum!"
about: "I have a suggestion (and may want to implement it!)"
---
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future. For feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/proposals. Feature requests are added to GitHub only when they have been accepted by the development team and implementation details have been laid out.
<!--
IMPORTANT: Feature requests on this GitHub issue tracker are only accepted in case they have been approved by a core developer or contain extensive argumentation and directions for implementation. For all other feature requests, ideas and feedback please post in the Flarum Community: https://discuss.flarum.org/t/feedback.
-->
## Feature Request
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. eg. I have an issue when [...]
**Describe the solution you'd like**
A detailed description of your proposed solution. Include:
- How the feature would work/behave
- Any potential drawbacks
- Maybe a screenshot, design, or example code
**Justify why this feature belongs in Flarum's core, rather than in a third-party extension**
Consider who this change will be useful to  most Flarum forums, or just a few?
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

View File

@@ -4,7 +4,7 @@ about: "If you have a question, please check out our forum or Discord!"
---
We primarily use GitHub as a bug tracker and issue tracker for items we are sure to tackle in the near future; for usage and support questions, please check out these resources below. Thanks!
We primarily use GitHub as an issue tracker; for usage and support questions, please check out these resources below. Thanks!
* Flarum Community: https://discuss.flarum.org/
* Discord Chat: https://flarum.org/discord/

View File

@@ -1,15 +0,0 @@
name: Package Manager PHP
on: [workflow_dispatch, push, pull_request]
# The reusable workflow definitions will be moved to the `flarum/framework` repo soon.
# This will break your current script.
# When this happens, run `flarum-cli audit infra --fix` to update your infrastructure.
jobs:
run:
uses: flarum/.github/.github/workflows/REUSABLE_backend.yml@main
with:
enable_backend_testing: true
backend_directory: ./extensions/package-manager

4
.gitignore vendored
View File

@@ -1,3 +1 @@
node_modules
vendor
composer.lock
node_modules

View File

@@ -1,11 +1,11 @@
<p align="center"><img src="https://flarum.org/assets/img/logo.png"></p>
<p align="center">
<a href="https://github.com/flarum/core/actions?query=workflow%3ATests"><img src="https://github.com/flarum/core/workflows/Tests/badge.svg" alt="PHP Tests"></a>
<a href="https://github.com/flarum/framework/actions?query=workflow%3ATests"><img src="https://github.com/flarum/framework/workflows/Tests/badge.svg" alt="PHP Tests"></a>
<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/github/v/release/flarum/framework?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://huntr.dev/bounties/disclose/?target=https://github.com/flarum/framework"><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>
@@ -31,7 +31,7 @@ Thank you for considering contributing to Flarum! Please read the **[Contributin
## Security Vulnerabilities
If you discover a security vulnerability within Flarum, please send an e-mail to [security@flarum.org](mailto:security@flarum.org). All security vulnerabilities will be promptly addressed. More details can be found in our [security policy](https://github.com/flarum/core/security/policy).
If you discover a security vulnerability within Flarum, please send an e-mail to [security@flarum.org](mailto:security@flarum.org). All security vulnerabilities will be promptly addressed. More details can be found in our [security policy](https://github.com/flarum/framework/security/policy).
## License

View File

@@ -1,182 +0,0 @@
{
"name": "flarum/framework",
"description": "Delightfully simple forum software.",
"keywords": [
"forum",
"discussion"
],
"homepage": "https://flarum.org/",
"license": "MIT",
"authors": [
{
"name": "Flarum",
"email": "info@flarum.org",
"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://docs.flarum.org",
"forum": "https://discuss.flarum.org",
"chat": "https://flarum.org/chat"
},
"autoload": {
"psr-4": {
"Flarum\\": "framework/core/src",
"Flarum\\Akismet\\": "extensions/akismet/src",
"Flarum\\Approval\\": "extensions/approval/src",
"Flarum\\Flags\\": "extensions/flags/src",
"Flarum\\Likes\\": "extensions/likes/src",
"Flarum\\Lock\\": "extensions/lock/src",
"Flarum\\Mentions\\": "extensions/mentions/src",
"Flarum\\Nicknames\\": "extensions/nicknames/src",
"Flarum\\PackageManager\\": "extensions/package-manager/src",
"Flarum\\Pusher\\": "extensions/pusher/src",
"Flarum\\Statistics\\": "extensions/statistics/src",
"Flarum\\Sticky\\": "extensions/sticky/src",
"Flarum\\Subscriptions\\": "extensions/subscriptions/src",
"Flarum\\Suspend\\": "extensions/suspend/src",
"Flarum\\Tags\\": "extensions/tags/src",
"Flarum\\PHPStan\\": "php-packages/phpstan/src",
"Flarum\\Testing\\": "php-packages/testing/src"
},
"files": [
"framework/core/src/helpers.php"
]
},
"replace": {
"flarum/core": "self.version",
"flarum/akismet": "self.version",
"flarum/approval": "self.version",
"flarum/bbcode": "self.version",
"flarum/embed": "self.version",
"flarum/emoji": "self.version",
"flarum/flags": "self.version",
"flarum/lang-english": "self.version",
"flarum/likes": "self.version",
"flarum/lock": "self.version",
"flarum/markdown": "self.version",
"flarum/mentions": "self.version",
"flarum/nicknames": "self.version",
"flarum/package-manager": "self.version",
"flarum/pusher": "self.version",
"flarum/statistics": "self.version",
"flarum/sticky": "self.version",
"flarum/subscriptions": "self.version",
"flarum/suspend": "self.version",
"flarum/tags": "self.version",
"flarum/phpstan": "self.version",
"flarum/testing": "self.version"
},
"require": {
"ext-json": "*",
"php": ">=7.3",
"axy/sourcemap": "^0.1.4",
"components/font-awesome": "^5.14.0",
"composer/composer": "^2.0",
"dflydev/fig-cookies": "^3.0.0",
"doctrine/dbal": "^2.7",
"dragonmantank/cron-expression": "^3.1.0",
"franzl/whoops-middleware": "^2.0.0",
"guzzlehttp/guzzle": "^7.4",
"illuminate/bus": "^8.0",
"illuminate/cache": "^8.0",
"illuminate/config": "^8.0",
"illuminate/console": "^8.0",
"illuminate/container": "^8.0",
"illuminate/contracts": "^8.0",
"illuminate/database": "^8.0",
"illuminate/events": "^8.0",
"illuminate/filesystem": "^8.0",
"illuminate/hashing": "^8.0",
"illuminate/mail": "^8.0",
"illuminate/queue": "^8.0",
"illuminate/session": "^8.0",
"illuminate/support": "^8.0",
"illuminate/validation": "^8.0",
"illuminate/view": "^8.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",
"league/flysystem": "^1.0.11",
"matthiasmullie/minify": "^1.3",
"middlewares/base-path": "^2.0.1",
"middlewares/base-path-router": "^2.0.1",
"middlewares/request-handler": "^2.0.1",
"monolog/monolog": "^1.16.0",
"nesbot/carbon": "^2.0",
"nikic/fast-route": "^0.6",
"psr/http-message": "^1.0",
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"pusher/pusher-php-server": "^2.2",
"s9e/text-formatter": "^2.3.6",
"symfony/config": "^5.2.2",
"symfony/console": "^5.2.2",
"symfony/event-dispatcher": "^5.2.2",
"symfony/mime": "^5.2.0",
"symfony/polyfill-intl-messageformatter": "^1.22.0",
"symfony/translation": "^5.1.5",
"symfony/yaml": "^5.2.2",
"tobscure/json-api": "^0.3.0",
"wikimedia/less.php": "^3.0"
},
"require-dev": {
"mockery/mockery": "^1.4",
"phpunit/phpunit": "^9.0",
"phpstan/phpstan-php-parser": "^1.0",
"phpstan/phpstan": "^1.2"
},
"config": {
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true,
"extra": {
"flarum-subextensions": [
"extensions/akismet",
"extensions/approval",
"extensions/bbcode",
"extensions/embed",
"extensions/emoji",
"extensions/flags",
"extensions/lang-english",
"extensions/likes",
"extensions/lock",
"extensions/markdown",
"extensions/mentions",
"extensions/nicknames",
"extensions/package-manager",
"extensions/pusher",
"extensions/statistics",
"extensions/sticky",
"extensions/subscriptions",
"extensions/suspend",
"extensions/tags"
],
"branch-alias": {
"dev-main": "1.x-dev"
},
"phpstan": {
"includes": [
"extension.neon"
]
}
}
}

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/akismet",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3",
"flarum/core": "^1.2",
"flarum/approval": "^1.2",
"guzzlehttp/guzzle": "^7.4"
},

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/approval",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3",
"flarum/core": "^1.2",
"flarum/flags": "^1.2"
},
"autoload": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/bbcode",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"extra": {
"branch-alias": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/embed",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/emoji",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"extra": {
"branch-alias": {

2
extensions/emoji/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -4,18 +4,18 @@
"version": "0.0.0",
"prettier": "@flarum/prettier-config",
"dependencies": {
"simple-emoji-map": "^0.5.1",
"twemoji": "^14.0.2"
"simple-emoji-map": "^0.4.1",
"twemoji": "^13.1.0"
},
"devDependencies": {
"prettier": "^2.5.1",
"flarum-webpack-config": "^2.0.0",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1",
"@flarum/prettier-config": "^1.0.0",
"flarum-tsconfig": "^1.0.2",
"flarum-webpack-config": "^2.0.0",
"prettier": "^2.5.1",
"typescript": "^4.5.4",
"typescript-coverage-report": "^0.6.1",
"webpack": "^5.65.0",
"webpack-cli": "^4.9.1"
"typescript-coverage-report": "^0.6.1"
},
"scripts": {
"dev": "webpack --mode development --watch",

View File

@@ -39,7 +39,7 @@ export default function renderEmoji() {
// wrap it in a node. In our `parseHTML` implementation, we wrap it in a `<body>`
// element. This gets stripped below.
//
// See https://github.com/flarum/core/issues/2958
// See https://github.com/flarum/framework/issues/2958
const emojifiedDom = twemoji.parse(parseHTML(contentHtml), options);
// Steal the HTML string inside the emojified DOM `<body>` tag.

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/flags",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -66,8 +66,8 @@ No changes.
## [0.1.0-beta.13](https://github.com/flarum/lang-english/compare/v0.1.0-beta.12...v0.1.0-beta.13)
### Added
- Keys for hidden permission groups (#153, flarum/core#2129, flarum/core#845)
- Keys for post deletion confirmation (#162, flarum/core#2135)
- Keys for hidden permission groups (#153, flarum/framework#2129, flarum/framework#845)
- Keys for post deletion confirmation (#162, flarum/framework#2135)
- Keys for HTML meta data (#154, flarum/tags#72)
### Changed

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"extra": {
"branch-alias": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/likes",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/lock",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/markdown",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"extra": {
"branch-alias": {

View File

@@ -33,8 +33,8 @@ No changes.
### Fixed
- Unrecognised user/post mentions (https://github.com/flarum/mentions/pulls/71)
- Reduced bugginess in mentions username search (https://github.com/flarum/core/issues/3095)
- Fixed missing space after mentions inserted via post reply (https://github.com/flarum/core/issues/3096)
- Reduced bugginess in mentions username search (https://github.com/flarum/framework/issues/3095)
- Fixed missing space after mentions inserted via post reply (https://github.com/flarum/framework/issues/3096)
## [1.0.0](https://github.com/flarum/mentions/compare/v0.1.0-beta.16...v1.0.0)

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/mentions",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -125,13 +125,10 @@ class ConfigureMentions
{
$post = CommentPost::find($tag->getAttribute('id'));
if ($post) {
if ($post && $post->user) {
$tag->setAttribute('discussionid', (int) $post->discussion_id);
$tag->setAttribute('number', (int) $post->number);
if ($post->user) {
$tag->setAttribute('displayname', $post->user->display_name);
}
$tag->setAttribute('displayname', $post->user->display_name);
return true;
}

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/nicknames",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

File diff suppressed because one or more lines are too long

View File

@@ -40,7 +40,7 @@ class AddNicknameValidation
function ($attribute, $value, $fail) {
$regex = $this->settings->get('flarum-nicknames.regex');
if ($regex && ! preg_match_all("/$regex/", $value)) {
$fail($this->translator->trans('flarum-nicknames.api.invalid_nickname_message'));
$this->translator->trans('flarum-nicknames.api.invalid_nickname_message');
}
},
'min:'.$this->settings->get('flarum-nicknames.min'),

View File

@@ -74,48 +74,4 @@ class RegisterTest extends TestCase
$this->assertEquals(403, $response->getStatusCode());
}
/**
* @test
*/
public function cant_register_with_nickname_if_invalid_regex()
{
$this->setting('flarum-nicknames.set_on_registration', true);
$this->setting('flarum-nicknames.regex', '^[A-z]+$');
$response = $this->send(
$this->request('POST', '/register', [
'json' => [
'nickname' => '007',
'username' => 'test',
'password' => 'too-obscure',
'email' => 'test@machine.local',
]
])
);
$this->assertEquals(422, $response->getStatusCode());
}
/**
* @test
*/
public function can_register_with_nickname_if_valid_regex()
{
$this->setting('flarum-nicknames.set_on_registration', true);
$this->setting('flarum-nicknames.regex', '^[A-z]+$');
$response = $this->send(
$this->request('POST', '/register', [
'json' => [
'nickname' => 'Acme',
'username' => 'test',
'password' => 'too-obscure',
'email' => 'test@machine.local',
]
])
);
$this->assertEquals(201, $response->getStatusCode());
}
}

View File

@@ -23,7 +23,7 @@
},
"require": {
"flarum/core": "^1.0.0",
"composer/composer": "^2.3"
"composer/composer": "^2.0"
},
"require-dev": {
"flarum/testing": "^1.0.0",
@@ -86,7 +86,7 @@
"test:integration": "phpunit -c tests/phpunit.integration.xml",
"test:setup": [
"@php tests/integration/setup.php",
"cd ${FLARUM_TEST_TMP_DIR_LOCAL:-${FLARUM_TEST_TMP_DIR:-./tests/integration/tmp}} && composer install"
"cd $FLARUM_TEST_TMP_DIR_LOCAL && composer install"
]
},
"scripts-descriptions": {

View File

@@ -1,3 +1,4 @@
/// <reference path="../../../vendor/flarum/core/js/src/common/translator-icu-rich.d.ts" />
import Mithril from 'mithril';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
export interface WhyNotModalAttrs extends IInternalModalAttrs {
@@ -7,7 +8,7 @@ export default class WhyNotModal<Attrs extends WhyNotModalAttrs = WhyNotModalAtt
loading: boolean;
whyNot: string | null;
className(): string;
title(): any;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
oncreate(vnode: Mithril.VnodeDOM<Attrs, this>): void;
content(): JSX.Element;
requestWhyNot(): void;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -58,7 +58,7 @@ class CheckForUpdatesHandler
$actor->assertAdmin();
$firstOutput = $this->runComposerCommand(false);
$firstOutput = json_decode($this->cleanJson($firstOutput), true);
$firstOutput = json_decode($firstOutput, true);
$majorUpdates = false;
@@ -71,7 +71,7 @@ class CheckForUpdatesHandler
if ($majorUpdates) {
$secondOutput = $this->runComposerCommand(true);
$secondOutput = json_decode($this->cleanJson($secondOutput), true);
$secondOutput = json_decode($secondOutput, true);
}
if (! isset($secondOutput)) {
@@ -101,15 +101,6 @@ class CheckForUpdatesHandler
->save();
}
/**
* Composer can sometimes return text above the JSON.
* This method tries to remove such occurences.
*/
protected function cleanJson(string $composerOutput): string
{
return preg_replace('/^[^{]+\n({.*)/ms', '$1', $composerOutput);
}
/**
* @throws ComposerCommandFailedException
*/

View File

@@ -15,11 +15,27 @@ class SetupComposer
{
use UsesTmpDir;
private $config;
private $config = [
'require' => [
'flarum/core' => '1.0.0',
'flarum/tags' => '1.0.3',
'flarum/lang-english' => '*',
],
'config' => [
'preferred-install' => 'dist',
'sort-packages' => true,
],
'repositories' => [
[
'type' => 'path',
'url' => __DIR__.'/tmp/packages/*',
]
]
];
public function __construct(array $config = null)
{
$this->config = $config;
$this->config = array_merge($this->config, $config ?? []);
}
public function run()
@@ -28,7 +44,7 @@ class SetupComposer
$composerLock = $this->tmpDir().'/composer.lock';
$packages = $this->tmpDir().'/packages';
file_put_contents($composerJson, json_encode($this->getConfig(), JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
file_put_contents($composerJson, json_encode($this->config, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT));
if (! file_exists($packages)) {
mkdir($packages);
@@ -37,28 +53,5 @@ class SetupComposer
if (file_exists($composerLock)) {
unlink($composerLock);
}
echo 'composer.json created with testing packages directory.';
}
private function getConfig(): array
{
return array_merge([
'require' => [
'flarum/core' => '1.0.0',
'flarum/tags' => '1.0.3',
'flarum/lang-english' => '*',
],
'config' => [
'preferred-install' => 'dist',
'sort-packages' => true,
],
'repositories' => [
[
'type' => 'path',
'url' => realpath($this->tmpDir()).'/packages/*',
]
]
], $this->config ?? []);
}
}

View File

@@ -19,7 +19,10 @@
<testsuites>
<testsuite name="Flarum Integration Tests">
<directory suffix="Test.php">./integration</directory>
<exclude>./integration/tmp</exclude>
<exclude>./integration/tmp</exclude>
</testsuite>
</testsuites>
<php>
<env name="FLARUM_TEST_TMP_DIR_LOCAL" value="tests/integration/tmp" force="true" />
</php>
</phpunit>

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/pusher",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3",
"flarum/core": "^1.2",
"pusher/pusher-php-server": "^2.2"
},
"require-dev": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/statistics",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/sticky",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/subscriptions",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/suspend",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -49,7 +49,6 @@ flarum-suspend:
# Translations in this namespace are used by suspension email notifications
email:
no_reason_given: No reason was given for this suspension.
suspended:
subject: Your account has been suspended
body: |

View File

@@ -1,4 +1,4 @@
{!! $translator->trans('flarum-suspend.email.suspended.body', [
'{recipient_display_name}' => $user->display_name,
'{suspension_message}' => $blueprint->user->suspend_message ?? $translator->trans('flarum-suspend.email.no_reason_given'),
'{suspension_message}' => $blueprint->user->suspend_message,
]) !!}

View File

@@ -30,7 +30,7 @@
- Broken side nav tag listing (https://github.com/flarum/tags/pulls/137)
- Discussions hidden from all users including admins (https://github.com/flarum/tags/pulls/140)
- Unauthorized view of restricted tags (https://github.com/flarum/tags/pulls/145)
- Make clicking edit tag button easier on mobile (https://github.com/flarum/core/issues/3098)
- Make clicking edit tag button easier on mobile (https://github.com/flarum/framework/issues/3098)
## [1.0.3](https://github.com/flarum/tags/compare/v1.0.2...v1.0.3)

View File

@@ -7,7 +7,7 @@
],
"license": "MIT",
"support": {
"issues": "https://github.com/flarum/core/issues",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/tags",
"forum": "https://discuss.flarum.org"
},
@@ -19,7 +19,7 @@
}
],
"require": {
"flarum/core": "^1.3"
"flarum/core": "^1.2"
},
"autoload": {
"psr-4": {

View File

@@ -19,20 +19,3 @@ declare module 'flarum/common/models/Discussion' {
canTag: () => boolean | undefined;
}
}
declare module 'flarum/forum/components/IndexPage' {
export default interface IndexPage {
currentActiveTag?: Tag;
currentTagLoading?: boolean;
currentTag: () => Tag | undefined;
}
}
declare module 'flarum/admin/components/PermissionGrid' {
export interface PermissionConfig {
tagScoped?: boolean;
}
export default interface PermissionGrid {
loading?: boolean;
}
}

View File

@@ -1 +1 @@
export default function (): void;
export default function _default(): void;

View File

@@ -1,29 +1,22 @@
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import Stream from 'flarum/common/utils/Stream';
import type Mithril from 'mithril';
import type Tag from '../../common/models/Tag';
export interface EditTagModalAttrs extends IInternalModalAttrs {
primary?: boolean;
model?: Tag;
}
/// <reference types="flarum/@types/translator-icu-rich" />
/**
* The `EditTagModal` component shows a modal dialog which allows the user
* to create or edit a tag.
*/
export default class EditTagModal extends Modal<EditTagModalAttrs> {
tag: Tag;
name: Stream<string>;
slug: Stream<string>;
description: Stream<string>;
color: Stream<string>;
icon: Stream<string>;
isHidden: Stream<boolean>;
primary: Stream<boolean>;
oninit(vnode: Mithril.Vnode<EditTagModalAttrs, this>): void;
className(): string;
title(): any;
export default class EditTagModal extends Modal<import("flarum/common/components/Modal").IInternalModalAttrs> {
constructor();
oninit(vnode: any): void;
tag: any;
name: Stream<any> | undefined;
slug: Stream<any> | undefined;
description: Stream<any> | undefined;
color: Stream<any> | undefined;
icon: Stream<any> | undefined;
isHidden: Stream<any> | undefined;
primary: Stream<any> | undefined;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray | import("mithril").Vnode<any, any>;
content(): JSX.Element;
fields(): any;
fields(): ItemList<any>;
submitData(): {
name: any;
slug: any;
@@ -33,6 +26,9 @@ export default class EditTagModal extends Modal<EditTagModalAttrs> {
isHidden: any;
primary: any;
};
onsubmit(e: SubmitEvent): void;
onsubmit(e: any): void;
delete(): void;
}
import Modal from "flarum/common/components/Modal";
import Stream from "flarum/common/utils/Stream";
import ItemList from "flarum/common/utils/ItemList";

View File

@@ -1,9 +1,10 @@
export default class TagsPage {
export default class TagsPage extends ExtensionPage<import("flarum/admin/components/ExtensionPage").ExtensionPageAttrs> {
constructor();
oninit(vnode: any): void;
forcedRefreshKey: number | undefined;
loading: boolean | undefined;
content(): JSX.Element;
onListOnCreate(vnode: any): void;
setMinTags(minTags: any, maxTags: any, value: any): void;
onSortUpdate(e: any): void;
}
import ExtensionPage from "flarum/admin/components/ExtensionPage";

View File

@@ -1 +1 @@
export default function tagLabel(tag: any, attrs?: {}): any;
export default function tagLabel(tag: any, attrs?: {}): import("mithril").Vnode<any, any>;

View File

@@ -1,23 +1,24 @@
import Model from 'flarum/common/Model';
import Discussion from 'flarum/common/models/Discussion';
export default class Tag extends Model {
name(): any;
slug(): any;
description(): any;
color(): any;
backgroundUrl(): any;
backgroundMode(): any;
icon(): any;
position(): any;
parent(): any;
children(): any;
defaultSort(): any;
isChild(): any;
isHidden(): any;
discussionCount(): any;
lastPostedAt(): any;
lastPostedDiscussion(): any;
isRestricted(): any;
canStartDiscussion(): any;
canAddToDiscussion(): any;
isPrimary(): any;
name(): string;
slug(): string;
description(): string | null;
color(): string | null;
backgroundUrl(): string | null;
backgroundMode(): string | null;
icon(): string | null;
position(): number | null;
parent(): false | Tag | null;
children(): false | (Tag | undefined)[];
defaultSort(): string | null;
isChild(): boolean;
isHidden(): boolean;
discussionCount(): number;
lastPostedAt(): Date | null | undefined;
lastPostedDiscussion(): false | Discussion | null;
isRestricted(): boolean;
canStartDiscussion(): boolean;
canAddToDiscussion(): boolean;
isPrimary(): boolean;
}

View File

@@ -1,2 +1 @@
import Tag from "../models/Tag";
export default function sortTags(tags: Tag[]): Tag[];
export default function sortTags(tags: any): any;

View File

@@ -1 +1 @@
export default function (): void;
export default function _default(): void;

View File

@@ -1,9 +1,9 @@
export default class DiscussionTaggedPost {
export default class DiscussionTaggedPost extends EventPost {
static initAttrs(attrs: any): void;
icon(): string;
descriptionKey(): "flarum-tags.forum.post_stream.added_and_removed_tags_text" | "flarum-tags.forum.post_stream.added_tags_text" | "flarum-tags.forum.post_stream.removed_tags_text";
descriptionData(): {
tagsAdded: any;
tagsRemoved: any;
};
}
import EventPost from "flarum/forum/components/EventPost";

View File

@@ -1,46 +1,44 @@
import type Mithril from 'mithril';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import Discussion from 'flarum/common/models/Discussion';
import Tag from '../../common/models/Tag';
export interface TagDiscussionModalAttrs extends IInternalModalAttrs {
discussion?: Discussion;
selectedTags?: Tag[];
onsubmit?: (tags: Tag[]) => {};
}
export default class TagDiscussionModal extends Modal<TagDiscussionModalAttrs> {
tagsLoading: boolean;
selected: Tag[];
filter: any;
focused: boolean;
export default class TagDiscussionModal extends Modal<import("flarum/common/components/Modal").IInternalModalAttrs> {
constructor();
oninit(vnode: any): void;
tagsLoading: boolean | undefined;
selected: any[] | undefined;
filter: Stream<string> | undefined;
focused: boolean | undefined;
minPrimary: any;
maxPrimary: any;
minSecondary: any;
maxSecondary: any;
bypassReqs: boolean;
navigator: any;
tags?: Tag[];
selectedTag?: Tag;
oninit(vnode: Mithril.Vnode<TagDiscussionModalAttrs, this>): void;
bypassReqs: any;
navigator: KeyboardNavigatable | undefined;
tags: any;
index: any;
primaryCount(): number;
secondaryCount(): number;
/**
* Add the given tag to the list of selected tags.
*
* @param {Tag} tag
*/
addTag(tag: Tag): void;
/**
* Remove the given tag from the list of selected tags.
*
* @param {Tag} tag
*/
removeTag(tag: Tag): void;
className(): string;
title(): any;
getInstruction(primaryCount: number, secondaryCount: number): any;
getInstruction(primaryCount: any, secondaryCount: any): any;
content(): JSX.Element | JSX.Element[];
meetsRequirements(primaryCount: number, secondaryCount: number): boolean;
toggleTag(tag: Tag): void;
select(e: KeyboardEvent): void;
selectableItems(): any;
getCurrentNumericIndex(): any;
getItem(selectedTag: Tag): any;
setIndex(index: number, scrollToItem: boolean): void;
onsubmit(e: SubmitEvent): void;
meetsRequirements(primaryCount: any, secondaryCount: any): boolean;
toggleTag(tag: any): void;
select(e: any): void;
selectableItems(): JQuery<HTMLElement>;
getCurrentNumericIndex(): number;
getItem(index: any): JQuery<HTMLElement>;
setIndex(index: any, scrollToItem: any): void;
onsubmit(e: any): void;
}
import Modal from "flarum/common/components/Modal";
import Stream from "flarum/common/utils/Stream";
import KeyboardNavigatable from "flarum/forum/utils/KeyboardNavigatable";

View File

@@ -1,3 +1,5 @@
export default class TagHero {
export default class TagHero extends Component<import("flarum/common/Component").ComponentAttrs, undefined> {
constructor();
view(): JSX.Element;
}
import Component from "flarum/common/Component";

View File

@@ -1,4 +1,5 @@
export default class TagLinkButton {
export default class TagLinkButton extends LinkButton {
static initAttrs(attrs: any): void;
view(vnode: any): JSX.Element;
}
import LinkButton from "flarum/common/components/LinkButton";

View File

@@ -1,7 +1,9 @@
export default class TagsPage {
export default class TagsPage extends Page<import("flarum/common/components/Page").IPageAttrs> {
constructor();
oninit(vnode: any): void;
tags: any[] | undefined;
tags: any;
loading: boolean | undefined;
view(): JSX.Element;
oncreate(vnode: any): void;
}
import Page from "flarum/common/components/Page";

View File

@@ -1,6 +1,8 @@
/**
* @TODO move to core
*/
export default class ToggleButton {
export default class ToggleButton extends Component<import("flarum/common/Component").ComponentAttrs, undefined> {
constructor();
view(vnode: any): JSX.Element;
}
import Component from "flarum/common/Component";

View File

@@ -1,5 +1,5 @@
import type Tag from "../../common/models/Tag";
import Tag from "../../common/models/Tag";
export default class TagListState {
loadedIncludes: Set<unknown>;
load(includes?: string[]): Promise<Tag[]>;
load(includes?: never[]): Promise<Tag[]>;
}

2
extensions/tags/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

2
extensions/tags/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -322,7 +322,7 @@ export default class TagDiscussionModal extends Modal<TagDiscussionModalAttrs> {
m.redraw();
if (scrollToItem && this.selectedTag) {
if (scrollToItem) {
const dropdownScroll = $dropdown.scrollTop()!;
const dropdownTop = $dropdown.offset()!.top;
const dropdownBottom = dropdownTop + $dropdown.outerHeight()!;

View File

@@ -44,7 +44,6 @@
}
}
.TagsInput {
.add-keyboard-focus-ring(":focus-within");
padding-top: 0;
padding-bottom: 0;
overflow: hidden;
@@ -58,7 +57,6 @@
border: 0 !important;
padding: 0;
max-width: 100%;
min-width: 1ch;
margin-right: -100%;
background: transparent !important;
}
@@ -68,7 +66,6 @@
}
.TagsInput-selected {
.TagsInput-tag {
display: inline-flex;
margin-right: 5px;
&:last-child {

View File

@@ -4,132 +4,132 @@
{
"name": "akismet",
"gitRemote": "git@github.com:flarum/akismet.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "approval",
"gitRemote": "git@github.com:flarum/approval.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "bbcode",
"gitRemote": "git@github.com:flarum/bbcode.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "embed",
"gitRemote": "git@github.com:flarum/embed.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "emoji",
"gitRemote": "git@github.com:flarum/emoji.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "flags",
"gitRemote": "git@github.com:flarum/flags.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "lang-english",
"gitRemote": "git@github.com:flarum/lang-english.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "likes",
"gitRemote": "git@github.com:flarum/likes.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "lock",
"gitRemote": "git@github.com:flarum/lock.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "markdown",
"gitRemote": "git@github.com:flarum/markdown.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "mentions",
"gitRemote": "git@github.com:flarum/mentions.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "nicknames",
"gitRemote": "git@github.com:flarum/nicknames.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "package-manager",
"gitRemote": "git@github.com:flarum/package-manager.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "pusher",
"gitRemote": "git@github.com:flarum/pusher.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "statistics",
"gitRemote": "git@github.com:flarum/statistics.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "sticky",
"gitRemote": "git@github.com:flarum/sticky.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "subscriptions",
"gitRemote": "git@github.com:flarum/subscriptions.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "suspend",
"gitRemote": "git@github.com:flarum/suspend.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "tags",
"gitRemote": "git@github.com:flarum/tags.git",
"mainBranch": "main"
"mainBranch": "master"
}
],
"composer": [
{
"name": "testing",
"gitRemote": "git@github.com:flarum/testing.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "phpstan",
"gitRemote": "git@github.com:flarum/phpstan.git",
"mainBranch": "main"
"mainBranch": "master"
}
],
"npm": [
{
"name": "prettier-config",
"gitRemote": "git@github.com:flarum/prettier-config.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "webpack-config",
"gitRemote": "git@github.com:flarum/flarum-webpack-config.git",
"mainBranch": "main"
"mainBranch": "master"
},
{
"name": "tsconfig",
"gitRemote": "git@github.com:flarum/flarum-tsconfig.git",
"mainBranch": "main"
"mainBranch": "master"
}
],
"core": {
"name": "core",
"gitRemote": "git@github.com:flarum/flarum-core.git",
"mainBranch": "main"
"mainBranch": "master"
}
}
}

View File

@@ -1,43 +1,6 @@
# Changelog
<!-- One-time commit-based diff due to monorepo rework. Diffing against the 1.2.1 tag doesn't work due to unrelated histories. -->
## [1.3.0](https://github.com/flarum/framework/compare/33d939cb012716ed6309ea02236737ad4f25a75b...v1.3.0)
From v1.2.1 on all bundled Flarum extensions and `flarum/core` are merged into one monorepo. As a result of this, the full code diff linked above
looks rather complex and messy compared to the full list of changes made for this release.
### Added
- [A11Y] Added role feed to DiscussionList (https://github.com/flarum/framework/pull/3359)
- Support multiple confirmation dialogs when closing a tab/window (https://github.com/flarum/framework/pull/3372)
- Markdown: markdown toolbar support for admin frontend (https://github.com/flarum/framework/commit/16d5cc11e3aee5c94aeed877987cdb199a2a0d2c)
### Changed
- Post number calculation is now executed inside the database layer, preventing integrity constraints (https://github.com/flarum/framework/pull/3358)
- Errors from within extensions no longer make Flarum crash but trigger a visible warning (https://github.com/flarum/framework/pull/3349)
- Sorting options for discussion index is now extensible (https://github.com/flarum/framework/pull/3377)
- Event listeners from the framework now are added before those of extensions (https://github.com/flarum/framework/pull/3373)
### Fixed
- Typings and missing typescript components (https://github.com/flarum/framework/pull/3348)
- `Post--by-start-user` CSS class is not added to post html (https://github.com/flarum/framework/pull/3356)
- Timestamps for notifications are incorrect on servers that have a timezone different than UTC (https://github.com/flarum/framework/pull/3379)
- Extensions with dependencies that are enabled do not cause dependencies to be enforced (https://github.com/flarum/framework/pull/3352)
- Search using non-words doesn't work (https://github.com/flarum/framework/pull/3385)
- Slugs are not working for other languages than English (https://github.com/flarum/framework/pull/3387)
- Deprecations are triggered on PHP 8.1 (https://github.com/flarum/framework/pull/3384)
- Post permalink for subdirectory installs have duplicate paths segments (https://github.com/flarum/framework/pull/3354)
- Composer discussion title is not always clearly visible (https://github.com/flarum/framework/pull/3413)
- Mentions: extensions re-using mentions can cause errors due to missing context (https://github.com/flarum/framework/pull/3382)
- Tags: tag selection modal errors on new discussions when pressing down (https://github.com/flarum/framework/issues/3403)
- [A11Y] Tags: focus to input and layout of tag selection modal are off (https://github.com/flarum/framework/pull/3412)
- Subscriptions: searching inside the following page will search in all discussions (https://github.com/flarum/framework/pull/3376)
## [1.2.1](https://github.com/flarum/framework/compare/v1.2.0...v1.2.1)
### Fixed
- Don't escape single quotes in discussion title meta tags (60600f4d2b8f0c5dac94c329041427a0a08fad42)
## [1.2.0](https://github.com/flarum/framework/compare/v1.1.1...v1.2.0)
## [1.2.0](https://github.com/flarum/flarum-core/compare/v1.1.1...v1.2.0)
### Added
- View `README` documentation in extension pages (https://github.com/flarum/framework/pull/3094).
@@ -143,12 +106,12 @@ looks rather complex and messy compared to the full list of changes made for thi
### Deprecated
- Unused `evented` utility (https://github.com/flarum/framework/pull/3125).
## [1.1.1](https://github.com/flarum/framework/compare/v1.1.0...v1.1.1)
## [1.1.1](https://github.com/flarum/flarum-core/compare/v1.1.0...v1.1.1)
### Fixed
- Performance issue with very large communities.
## [1.1.0](https://github.com/flarum/framework/compare/v1.0.4...v1.1.0)
## [1.1.0](https://github.com/flarum/flarum-core/compare/v1.0.4...v1.1.0)
### Added
- Info command now displays MySQL version, queue driver, mail driver (https://github.com/flarum/framework/pull/2991)
@@ -202,13 +165,13 @@ looks rather complex and messy compared to the full list of changes made for thi
###### Issue Reporters
@uamv, @dannyuk1982, @BurnNoticeSpy, @haarp, @peopleinside, @matteocontrini
## [1.0.4](https://github.com/flarum/framework/compare/v1.0.3...v1.0.4)
## [1.0.4](https://github.com/flarum/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/framework/pull/2941)
## [1.0.3](https://github.com/flarum/framework/compare/v1.0.2...v1.0.3)
## [1.0.3](https://github.com/flarum/flarum-core/compare/v1.0.2...v1.0.3)
### Changed
@@ -222,17 +185,17 @@ looks rather complex and messy compared to the full list of changes made for thi
- Avatar in notifications list are incorrectly aligned (https://github.com/flarum/framework/pull/2906)
- FilesystemManager is not compatible with upstream Laravel implementation (https://github.com/flarum/framework/pull/2936)
## [1.0.2](https://github.com/flarum/framework/compare/v1.0.1...v1.0.2)
## [1.0.2](https://github.com/flarum/flarum-core/compare/v1.0.1...v1.0.2)
### Fixed
- Critical XSS vulnerability
## [1.0.1](https://github.com/flarum/framework/compare/v1.0.0...v1.0.1)
## [1.0.1](https://github.com/flarum/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/framework/issues/2890)
## [1.0.0](https://github.com/flarum/framework/compare/v0.1.0-beta.16...v1.0.0)
## [1.0.0](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.16...v1.0.0)
### Added
- Task scheduling
@@ -298,7 +261,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- The session is no longer available from the User class (https://github.com/flarum/framework/pull/2790)
- The `mail` key is removed from the laravel related config (https://github.com/flarum/framework/pull/2796)
## [0.1.0-beta.16](https://github.com/flarum/framework/compare/v0.1.0-beta.15...v0.1.0-beta.16)
## [0.1.0-beta.16](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.15...v0.1.0-beta.16)
### Added
- Allow event subscribers (https://github.com/flarum/framework/pull/2535)
@@ -389,7 +352,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- `UserFilter` ([91e8b56](https://github.com/flarum/framework/commit/91e8b569618957c86757ef89bac666e9102db5ae))
## [0.1.0-beta.15](https://github.com/flarum/framework/compare/v0.1.0-beta.14.1...v0.1.0-beta.15)
## [0.1.0-beta.15](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.14.1...v0.1.0-beta.15)
### Added
@@ -447,7 +410,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- `CheckingForFlooding` (https://github.com/flarum/framework/commit/8e25bcb68f86cc992c46dfa70368419fe9f936ac).
## [0.1.0-beta.14.1](https://github.com/flarum/framework/compare/v0.1.0-beta.14...v0.1.0-beta.14.1)
## [0.1.0-beta.14.1](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.14...v0.1.0-beta.14.1)
### Fixed
@@ -457,7 +420,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- Sub path installations have no page title.
- Losing focus of Composer area when coming from fullscreen.
## [0.1.0-beta.14](https://github.com/flarum/framework/compare/v0.1.0-beta.13...v0.1.0-beta.14)
## [0.1.0-beta.14](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.13...v0.1.0-beta.14)
### Added
@@ -554,7 +517,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- Global path helpers, `Flarum\Foundation\Application` path methods (https://github.com/flarum/framework/pull/2155)
- `Flarum\User\AssertPermissionTrait` (https://github.com/flarum/framework/pull/2044)
## [0.1.0-beta.13](https://github.com/flarum/framework/compare/v0.1.0-beta.12...v0.1.0-beta.13)
## [0.1.0-beta.13](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.12...v0.1.0-beta.13)
### Added
- Console extender (#2057)
@@ -607,7 +570,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- `Flarum\Event\ConfigureForumRoutes` event class
- `Flarum\Event\ConfigureLocales` event class
## [0.1.0-beta.12](https://github.com/flarum/framework/compare/v0.1.0-beta.11.1...v0.1.0-beta.12)
## [0.1.0-beta.12](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.11.1...v0.1.0-beta.12)
### Added
- Full support for PHP 7.4 (#1980)
@@ -632,12 +595,12 @@ looks rather complex and messy compared to the full list of changes made for thi
- Translation fallback was ignored for client-rendered pages (#1774, #1961)
- The success alert when posting replies was invisible (#1976)
## [0.1.0-beta.11.1](https://github.com/flarum/framework/compare/v0.1.0-beta.11...v0.1.0-beta.11.1)
## [0.1.0-beta.11.1](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.11...v0.1.0-beta.11.1)
### Fixed
- Saving custom css in admin failed (#1946)
## [0.1.0-beta.11](https://github.com/flarum/framework/compare/v0.1.0-beta.10...v0.1.0-beta.11)
## [0.1.0-beta.11](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.10...v0.1.0-beta.11)
### Added
- Comments have an additional class `Post--by-actor` when posted by the user (#1927)
@@ -664,7 +627,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- Debug button no longer visible (#1687)
- Modals on smaller screens use the whole width of the page
## [0.1.0-beta.10](https://github.com/flarum/framework/compare/v0.1.0-beta.9...v0.1.0-beta.10)
## [0.1.0-beta.10](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.9...v0.1.0-beta.10)
### Added
- Initial queue support: Infrastructure for offloading long-running tasks (e.g. email sending) to background workers (#1773)
@@ -690,7 +653,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- API requests authenticated using access tokens needed to provide a CSRF token (#1828)
- Accessibility: Screenreaders did not read the "Back to discussion list" link (#1835)
## [0.1.0-beta.9](https://github.com/flarum/framework/compare/v0.1.0-beta.8.2...v0.1.0-beta.9)
## [0.1.0-beta.9](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.8.2...v0.1.0-beta.9)
### Added
- New `hasPermission()` helper method for `Group` objects ([9684fbc](https://github.com/flarum/framework/commit/9684fbc4da07d32aa322d9228302a23418412cb9))
@@ -737,7 +700,7 @@ looks rather complex and messy compared to the full list of changes made for thi
- `php flarum install --defaults` - this was meant to be used in our old development VM ([44c9109](https://github.com/flarum/framework/commit/44c91099cd77138bb5fc29f14fb1e81a9781272d))
- Obsolete `id` attributes in JSON-API responses ([ecc3b5e](https://github.com/flarum/framework/commit/ecc3b5e2271f8d9b38d52cd54476d86995dbe32e) and [7a44086](https://github.com/flarum/framework/commit/7a44086bf3a0e3ba907dceb13d07ac695eca05ea))
## [0.1.0-beta.8.1](https://github.com/flarum/framework/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)
## [0.1.0-beta.8.1](https://github.com/flarum/flarum-core/compare/v0.1.0-beta.8...v0.1.0-beta.8.1)
### Fixed
- Fix live output in `migrate:reset` command ([f591585](https://github.com/flarum/framework/commit/f591585d02f8c4ff0211c5bf4413dd6baa724c05))

View File

@@ -29,14 +29,15 @@
}
],
"support": {
"issues": "https://github.com/flarum/core/issues",
"source": "https://github.com/flarum/core",
"issues": "https://github.com/flarum/framework/issues",
"source": "https://github.com/flarum/framework",
"docs": "https://docs.flarum.org",
"forum": "https://discuss.flarum.org",
"chat": "https://flarum.org/chat"
},
"require": {
"php": ">=7.3",
"axy/sourcemap": "^0.1.4",
"components/font-awesome": "^5.14.0",
"dflydev/fig-cookies": "^3.0.0",
"doctrine/dbal": "^2.7",
@@ -74,8 +75,6 @@
"psr/http-server-handler": "^1.0",
"psr/http-server-middleware": "^1.0",
"s9e/text-formatter": "^2.3.6",
"sycho/json-api": "^0.5.0",
"sycho/sourcemap": "^2.0.0",
"symfony/config": "^5.2.2",
"symfony/console": "^5.2.2",
"symfony/event-dispatcher": "^5.2.2",
@@ -83,6 +82,7 @@
"symfony/polyfill-intl-messageformatter": "^1.22.0",
"symfony/translation": "^5.1.5",
"symfony/yaml": "^5.2.2",
"tobscure/json-api": "^0.3.0",
"wikimedia/less.php": "^3.0"
},
"require-dev": {

View File

@@ -40,7 +40,7 @@ export interface HTMLInputSettingsComponentOptions extends CommonSettingsItemOpt
declare const BooleanSettingTypes: readonly ["bool", "checkbox", "switch", "boolean"];
declare const SelectSettingTypes: readonly ["select", "dropdown", "selectdropdown"];
declare const TextareaSettingTypes: readonly ["textarea"];
declare const ColorPreviewSettingType: "color-preview";
declare const ColorPreviewSettingType = "color-preview";
/**
* Valid options for the setting component builder to generate a Switch.
*/

View File

@@ -1,7 +1,7 @@
/// <reference path="../../@types/translator-icu-rich.d.ts" />
import ItemList from '../../common/utils/ItemList';
import AdminPage from './AdminPage';
import type { Children } from 'mithril';
import { Children } from 'mithril';
export default class DashboardPage extends AdminPage {
headerInfo(): {
className: string;

View File

@@ -1,4 +1,4 @@
import type { Children, Vnode } from 'mithril';
import { Children, Vnode } from 'mithril';
import Component, { ComponentAttrs } from '../../common/Component';
export interface IDashboardWidgetAttrs extends ComponentAttrs {
}

View File

@@ -25,7 +25,7 @@ export interface SavedModelData {
}
export declare type ModelData = UnsavedModelData | SavedModelData;
export interface SaveRelationships {
[relationship: string]: null | Model | Model[];
[relationship: string]: Model | Model[];
}
export interface SaveAttributes {
[key: string]: unknown;

View File

@@ -92,8 +92,8 @@ export default class Store {
/**
* Make a request to the API to find record(s) of a specific type.
*/
find<M extends Model>(type: string, params?: ApiQueryParamsSingle): Promise<ApiResponseSingle<M>>;
find<Ms extends Model[]>(type: string, params?: ApiQueryParamsPlural): Promise<ApiResponsePlural<Ms[number]>>;
find<M extends Model>(type: string, params: ApiQueryParamsSingle): Promise<ApiResponseSingle<M>>;
find<Ms extends Model[]>(type: string, params: ApiQueryParamsPlural): Promise<ApiResponsePlural<Ms[number]>>;
find<M extends Model>(type: string, id: string, params?: ApiQueryParamsSingle, options?: ApiQueryRequestOptions<ApiPayloadSingle>): Promise<ApiResponseSingle<M>>;
find<Ms extends Model[]>(type: string, ids: string[], params?: ApiQueryParamsPlural, options?: ApiQueryRequestOptions<ApiPayloadPlural>): Promise<ApiResponsePlural<Ms[number]>>;
/**

View File

@@ -7,6 +7,12 @@
*
* - `when` - a callback returning true when the browser should prompt for
* confirmation before closing the window/tab
*
* ### Children
*
* NOTE: Only the first child will be rendered. (Use this component to wrap
* another component / DOM element.)
*
*/
export default class ConfirmDocumentUnload extends Component<import("../Component").ComponentAttrs, undefined> {
constructor();
@@ -14,6 +20,6 @@ export default class ConfirmDocumentUnload extends Component<import("../Componen
oncreate(vnode: any): void;
boundHandler: (() => any) | undefined;
onremove(vnode: any): void;
view(vnode: any): JSX.Element;
view(vnode: any): any;
}
import Component from "../Component";

View File

@@ -9,9 +9,9 @@ export interface TooltipAttrs extends Mithril.CommonAttributes<TooltipAttrs, Too
*/
text: string | string[];
/**
* Use to manually show or hide the tooltip. `undefined` will show based on cursor events.
* Manually show tooltip. `false` will show based on cursor events.
*
* Default: `undefined`.
* Default: `false`.
*/
tooltipVisible?: boolean;
/**

View File

@@ -1,8 +0,0 @@
/**
* Fire a Flarum error which is shown in the JS console for everyone and in an alert for the admin.
*
* @param userTitle: a user friendly title of the error, should be localized.
* @param consoleTitle: an error title that goes in the console, doesn't have to be localized.
* @param error: the error.
*/
export default function fireApplicationError(userTitle: string, consoleTitle: string, error: any): void;

View File

@@ -13,7 +13,6 @@ export default class User extends Model {
avatarUrl(): string | null;
preferences(): Record<string, any> | null | undefined;
groups(): false | (Group | undefined)[];
isAdmin(): boolean | undefined;
joinTime(): Date | null | undefined;
lastSeenAt(): Date | null | undefined;
markedAllAsReadAt(): Date | null | undefined;

View File

@@ -78,7 +78,7 @@ export default class ItemList<T> {
/**
* Replaces an item's content, if the provided item key exists.
*
* If the provided `key` is not present, an error will be thrown.
* If the provided `key` is not present, nothing will happen.
*
* @param key The key of the item in the list
* @param content The item's new content
@@ -97,7 +97,7 @@ export default class ItemList<T> {
/**
* Replaces an item's priority, if the provided item key exists.
*
* If the provided `key` is not present, an error will be thrown.
* If the provided `key` is not present, nothing will happen.
*
* @param key The key of the item in the list
* @param priority The item's new priority
@@ -115,8 +115,6 @@ export default class ItemList<T> {
setPriority(key: string, priority: number): this;
/**
* Remove an item from the list.
*
* If the provided `key` is not present, nothing will happen.
*/
remove(key: string): this;
/**

View File

@@ -127,7 +127,6 @@ declare var _default: {
};
'utils/Pane': typeof Pane;
'utils/BasicEditorDriver': typeof BasicEditorDriver;
'utils/isSafariMobile': typeof isSafariMobile;
'states/ComposerState': typeof ComposerState;
'states/DiscussionListState': typeof DiscussionListState;
'states/GlobalSearchState': typeof GlobalSearchState;
@@ -199,7 +198,6 @@ import slidable from "./utils/slidable";
import History from "./utils/History";
import alertEmailConfirmation from "./utils/alertEmailConfirmation";
import Pane from "./utils/Pane";
import isSafariMobile from "./utils/isSafariMobile";
import ComposerState from "./states/ComposerState";
import DiscussionListState from "./states/DiscussionListState";
import GlobalSearchState from "./states/GlobalSearchState";

View File

@@ -1,9 +1,9 @@
import Component, { ComponentAttrs } from '../../common/Component';
import ItemList from '../../common/utils/ItemList';
import SubtreeRetainer from '../../common/utils/SubtreeRetainer';
import type Discussion from '../../common/models/Discussion';
import type Mithril from 'mithril';
import type { DiscussionListParams } from '../states/DiscussionListState';
import Discussion from '../../common/models/Discussion';
import Mithril from 'mithril';
import { DiscussionListParams } from '../states/DiscussionListState';
export interface IDiscussionListItemAttrs extends ComponentAttrs {
discussion: Discussion;
params: DiscussionListParams;

View File

@@ -8,5 +8,5 @@ export default class DiscussionRenamedNotification extends Notification {
icon(): string;
href(): string;
content(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
excerpt(): null;
excerpt(): string;
}

View File

@@ -1,6 +1,6 @@
import type NotificationModel from '../../common/models/Notification';
import NotificationModel from '../../common/models/Notification';
import Component, { ComponentAttrs } from '../../common/Component';
import type Mithril from 'mithril';
import Mithril from 'mithril';
export interface INotificationAttrs extends ComponentAttrs {
notification: NotificationModel;
}

View File

@@ -1,8 +1,8 @@
import Component, { ComponentAttrs } from '../../common/Component';
import SubtreeRetainer from '../../common/utils/SubtreeRetainer';
import ItemList from '../../common/utils/ItemList';
import type PostModel from '../../common/models/Post';
import type Mithril from 'mithril';
import PostModel from '../../common/models/Post';
import Mithril from 'mithril';
export interface IPostAttrs extends ComponentAttrs {
post: PostModel;
}

View File

@@ -1,7 +1,7 @@
import ForumApplication from './ForumApplication';
import Discussion from '../common/models/Discussion';
import type Post from '../common/models/Post';
import type User from '../common/models/User';
import Post from '../common/models/Post';
import User from '../common/models/User';
/**
* Helper functions to generate URLs to form pages.
*/

View File

@@ -1,7 +1,11 @@
/// <reference types="node" />
import type Discussion from '../../common/models/Discussion';
import type Post from '../../common/models/Post';
import Discussion from '../../common/models/Discussion';
import Post from '../../common/models/Post';
export default class PostStreamState {
/**
* @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146
*/
['constructor']: typeof PostStreamState;
/**
* The number of posts to load per page.
*/

2
framework/core/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -48,7 +48,7 @@
*/
/*!
* focus-trap 6.7.3
* focus-trap 6.7.2
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/

File diff suppressed because one or more lines are too long

2
framework/core/js/dist/forum.js generated vendored

File diff suppressed because one or more lines are too long

View File

@@ -48,7 +48,7 @@
*/
/*!
* focus-trap 6.7.3
* focus-trap 6.7.2
* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE
*/

File diff suppressed because one or more lines are too long

View File

@@ -31,7 +31,7 @@ export interface AdminHeaderOptions {
*
* Note: this will be exported from a different location in the future.
*
* @see https://github.com/flarum/core/issues/3039
* @see https://github.com/flarum/framework/issues/3039
*/
export type HTMLInputTypes =
| 'button'
@@ -77,7 +77,7 @@ export interface HTMLInputSettingsComponentOptions extends CommonSettingsItemOpt
const BooleanSettingTypes = ['bool', 'checkbox', 'switch', 'boolean'] as const;
const SelectSettingTypes = ['select', 'dropdown', 'selectdropdown'] as const;
const TextareaSettingTypes = ['textarea'] as const;
const ColorPreviewSettingType = 'color-preview' as const;
const ColorPreviewSettingType = 'color-preview';
/**
* Valid options for the setting component builder to generate a Switch.

View File

@@ -14,7 +14,7 @@ export default class EditCustomCssModal extends SettingsModal {
return [
<p>
{app.translator.trans('core.admin.edit_css.customize_text', {
a: <a href="https://github.com/flarum/core/tree/master/less" target="_blank" />,
a: <a href="https://github.com/flarum/framework/tree/main/framework/core/less" target="_blank" />,
})}
</p>,
<div className="Form-group">

View File

@@ -78,7 +78,7 @@ export default class EditGroupModal extends Modal {
<div className="Form-group">
<label>{app.translator.trans('core.admin.edit_group.icon_label')}</label>
<div className="helpText">
{app.translator.trans('core.admin.edit_group.icon_text', { a: <a href="https://fontawesome.com/v5/search?m=free" tabindex="-1" /> })}
{app.translator.trans('core.admin.edit_group.icon_text', { a: <a href="https://fontawesome.com/icons?m=free" tabindex="-1" /> })}
</div>
<input className="FormControl" placeholder="fas fa-bolt" bidi={this.icon} />
</div>,

View File

@@ -12,9 +12,9 @@ export interface TooltipAttrs extends Mithril.CommonAttributes<TooltipAttrs, Too
*/
text: string | string[];
/**
* Use to manually show or hide the tooltip. `undefined` will show based on cursor events.
* Manually show tooltip. `false` will show based on cursor events.
*
* Default: `undefined`.
* Default: `false`.
*/
tooltipVisible?: boolean;
/**

View File

@@ -36,7 +36,7 @@ $.fn.tooltip = function (options, caller) {
// This functionality is deprecated and should not be used.
if (!['DANGEROUS_tooltip_jquery_fn_deprecation_exempt'].includes(caller)) {
console.warn(
"Calling `$.tooltip` is now deprecated. Please use the `<Tooltip>` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"
"Calling `$.tooltip` is now deprecated. Please use the `<Tooltip>` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/framework/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"
);
}

View File

@@ -79,7 +79,7 @@ export default class Drawer {
* correctly animates out, while ensuring it is not part of the navigation
* tree while off-screen.
*
* More info: https://github.com/flarum/core/pull/2666#discussion_r595381014
* More info: https://github.com/flarum/framework/pull/2666#discussion_r595381014
*/
this.focusTrap.deactivate();

View File

@@ -127,7 +127,7 @@ export default class ItemList<T> {
/**
* Replaces an item's content, if the provided item key exists.
*
* If the provided `key` is not present, an error will be thrown.
* If the provided `key` is not present, nothing will happen.
*
* @param key The key of the item in the list
* @param content The item's new content
@@ -154,7 +154,7 @@ export default class ItemList<T> {
/**
* Replaces an item's priority, if the provided item key exists.
*
* If the provided `key` is not present, an error will be thrown.
* If the provided `key` is not present, nothing will happen.
*
* @param key The key of the item in the list
* @param priority The item's new priority
@@ -181,8 +181,6 @@ export default class ItemList<T> {
/**
* Remove an item from the list.
*
* If the provided `key` is not present, nothing will happen.
*/
remove(key: string): this {
delete this._items[key];
@@ -224,7 +222,7 @@ export default class ItemList<T> {
* @param keepPrimitives Converts item content to objects and sets the
* `itemName` property on them.
*
* @see https://github.com/flarum/core/issues/3030
* @see https://github.com/flarum/framework/issues/3030
*/
toArray(keepPrimitives?: false): (T & { itemName: string })[];
/**

View File

@@ -72,7 +72,6 @@ import DiscussionPageResolver from './resolvers/DiscussionPageResolver';
import BasicEditorDriver from '../common/utils/BasicEditorDriver';
import routes from './routes';
import ForumApplication from './ForumApplication';
import isSafariMobile from './utils/isSafariMobile';
export default Object.assign(compat, {
'utils/PostControls': PostControls,
@@ -84,7 +83,6 @@ export default Object.assign(compat, {
'utils/UserControls': UserControls,
'utils/Pane': Pane,
'utils/BasicEditorDriver': BasicEditorDriver,
'utils/isSafariMobile': isSafariMobile,
'states/ComposerState': ComposerState,
'states/DiscussionListState': DiscussionListState,
'states/GlobalSearchState': GlobalSearchState,

View File

@@ -272,12 +272,12 @@ export default class Composer extends Component {
if (app.screen() === 'phone') {
// On safari fixed position doesn't properly work on mobile,
// So we use absolute and set the top value.
// https://github.com/flarum/core/issues/2652
// https://github.com/flarum/framework/issues/2652
// Due to another safari bug, `scrollTop` is unreliable when
// at the very bottom of the page AND opening the composer.
// So we fallback to a calculated version of scrollTop.
// https://github.com/flarum/core/issues/2683
// https://github.com/flarum/framework/issues/2683
const scrollElement = document.documentElement;
const topOfViewport = Math.min(scrollElement.scrollTop, scrollElement.scrollHeight - scrollElement.clientHeight);
this.$().css('top', $('.App').is('.mobile-safari') ? topOfViewport : 0);

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