mirror of
https://github.com/flarum/core.git
synced 2025-08-13 11:54:32 +02:00
Compare commits
4 Commits
as/better-
...
as/yarn-wo
Author | SHA1 | Date | |
---|---|---|---|
|
83c1c4a965 | ||
|
f61fa321fa | ||
|
721fd9117d | ||
|
e766b9a565 |
20
.gitattributes
vendored
20
.gitattributes
vendored
@@ -1,20 +0,0 @@
|
||||
**/.gitattributes export-ignore
|
||||
**/.gitignore export-ignore
|
||||
**/.gitmodules export-ignore
|
||||
**/.github export-ignore
|
||||
**/.travis export-ignore
|
||||
**/.travis.yml export-ignore
|
||||
**/.editorconfig export-ignore
|
||||
**/.styleci.yml export-ignore
|
||||
|
||||
**/phpunit.xml export-ignore
|
||||
**/tests export-ignore
|
||||
|
||||
**/js/dist/**/* -diff
|
||||
**/js/dist/**/* linguist-generated
|
||||
**/js/dist-typings/**/* -diff
|
||||
**/js/dist-typings/**/* linguist-generated
|
||||
**/js/yarn.lock -diff
|
||||
**/js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/akismet
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/approval
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-core-frontend.yml
vendored
1
.github/workflows/flarum-core-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./framework/core
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-embed-frontend.yml
vendored
1
.github/workflows/flarum-embed-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/embed
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-emoji-frontend.yml
vendored
1
.github/workflows/flarum-emoji-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/emoji
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
3
.github/workflows/flarum-flags-frontend.yml
vendored
3
.github/workflows/flarum-flags-frontend.yml
vendored
@@ -12,12 +12,11 @@ jobs:
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: true
|
||||
enable_typescript: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/flags/js
|
||||
backend_directory: ./extensions/flags
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-likes-frontend.yml
vendored
1
.github/workflows/flarum-likes-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/likes
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-lock-frontend.yml
vendored
1
.github/workflows/flarum-lock-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/lock
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/markdown
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/mentions
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/nicknames
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/package-manager
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-pusher-frontend.yml
vendored
1
.github/workflows/flarum-pusher-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/pusher
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/statistics
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
1
.github/workflows/flarum-sticky-frontend.yml
vendored
1
.github/workflows/flarum-sticky-frontend.yml
vendored
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/sticky
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/subscriptions
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
@@ -18,6 +18,5 @@ jobs:
|
||||
backend_directory: ./extensions/suspend
|
||||
js_package_manager: yarn
|
||||
main_git_branch: main
|
||||
|
||||
secrets:
|
||||
bundlewatch_github_token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
||||
|
2
.github/workflows/flarum-tags-frontend.yml
vendored
2
.github/workflows/flarum-tags-frontend.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
with:
|
||||
enable_bundlewatch: false
|
||||
enable_prettier: false
|
||||
enable_typescript: true
|
||||
enable_typescript: false
|
||||
|
||||
frontend_directory: ./extensions/tags/js
|
||||
backend_directory: ./extensions/tags
|
||||
|
19
extensions/akismet/.gitattributes
vendored
Normal file
19
extensions/akismet/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -12,7 +12,7 @@
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"build-typings": "yarn run clean-typings && [ -e src/@types ] && cp -r src/@types dist-typings/@types && tsc && yarn run post-build-typings",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
@@ -1,22 +1,18 @@
|
||||
import { extend, override } from 'flarum/common/extend';
|
||||
import app from 'flarum/forum/app';
|
||||
import type Post from 'flarum/common/models/Post';
|
||||
import type ItemList from 'flarum/common/utils/ItemList';
|
||||
|
||||
import PostControls from 'flarum/forum/utils/PostControls';
|
||||
import CommentPost from 'flarum/forum/components/CommentPost';
|
||||
import type Mithril from 'mithril';
|
||||
import ItemList from 'flarum/common/utils/ItemList';
|
||||
import Post from 'flarum/common/models/Post';
|
||||
|
||||
app.initializers.add('flarum-akismet', () => {
|
||||
extend(PostControls, 'destructiveControls', function (items: ItemList<Mithril.Children>, post: Post) {
|
||||
extend(PostControls, 'destructiveControls', function (items: ItemList, post: Post) {
|
||||
if (items.has('approve')) {
|
||||
const flags = post.flags();
|
||||
|
||||
if (flags && flags.some((flag) => flag?.type() === 'akismet')) {
|
||||
const approveItem = items.get('approve');
|
||||
if (approveItem && typeof approveItem === 'object' && 'children' in approveItem) {
|
||||
approveItem.children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');
|
||||
}
|
||||
if (flags && flags.some((flag) => flag.type() === 'akismet')) {
|
||||
items.get('approve').children = app.translator.trans('flarum-akismet.forum.post.not_spam_button');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@@ -4,14 +4,13 @@
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
||||
// and also tells your Typescript server to read core's global typings for
|
||||
// access to `dayjs` and `$` in the global namespace.
|
||||
"include": ["src/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
|
||||
"flarum/flags/*": ["../vendor/flarum/flags/js/dist-typings/*"]
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
extensions/approval/.gitattributes
vendored
Normal file
19
extensions/approval/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/bbcode/.gitattributes
vendored
Normal file
19
extensions/bbcode/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/embed/.gitattributes
vendored
Normal file
19
extensions/embed/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/emoji/.gitattributes
vendored
Normal file
19
extensions/emoji/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/flags/.gitattributes
vendored
Normal file
19
extensions/flags/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -49,7 +49,7 @@
|
||||
"gitConf": true,
|
||||
"githubActions": true,
|
||||
"prettier": true,
|
||||
"typescript": true,
|
||||
"typescript": false,
|
||||
"bundlewatch": false,
|
||||
"backendTesting": true,
|
||||
"editorConfig": true,
|
||||
|
@@ -1,22 +0,0 @@
|
||||
import Flag from '../forum/models/Flag';
|
||||
import FlagListState from '../forum/states/FlagListState';
|
||||
import Mithril from 'mithril';
|
||||
|
||||
declare module 'flarum/common/models/Post' {
|
||||
export default interface Post {
|
||||
flags: () => false | (Flag | undefined)[];
|
||||
canFlag: () => boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/forum/ForumApplication' {
|
||||
export default interface ForumApplication {
|
||||
flags: FlagListState;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/forum/components/Post' {
|
||||
export default interface Post {
|
||||
flagReason: (flag: Flag) => Mithril.Children;
|
||||
}
|
||||
}
|
@@ -1 +0,0 @@
|
||||
export {};
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1,19 +0,0 @@
|
||||
declare var _default: {
|
||||
'flags/addFlagsToPosts': typeof addFlagsToPosts;
|
||||
'flags/addFlagControl': typeof addFlagControl;
|
||||
'flags/addFlagsDropdown': typeof addFlagsDropdown;
|
||||
'flags/models/Flag': typeof Flag;
|
||||
'flags/components/FlagList': typeof FlagList;
|
||||
'flags/components/FlagPostModal': typeof FlagPostModal;
|
||||
'flags/components/FlagsPage': typeof FlagsPage;
|
||||
'flags/components/FlagsDropdown': typeof FlagsDropdown;
|
||||
};
|
||||
export default _default;
|
||||
import addFlagsToPosts from "./addFlagsToPosts";
|
||||
import addFlagControl from "./addFlagControl";
|
||||
import addFlagsDropdown from "./addFlagsDropdown";
|
||||
import Flag from "./models/Flag";
|
||||
import FlagList from "./components/FlagList";
|
||||
import FlagPostModal from "./components/FlagPostModal";
|
||||
import FlagsPage from "./components/FlagsPage";
|
||||
import FlagsDropdown from "./components/FlagsDropdown";
|
@@ -1,7 +0,0 @@
|
||||
export default class FlagList extends Component<import("flarum/common/Component").ComponentAttrs, undefined> {
|
||||
constructor();
|
||||
oninit(vnode: any): void;
|
||||
state: any;
|
||||
view(): JSX.Element;
|
||||
}
|
||||
import Component from "flarum/common/Component";
|
@@ -1,15 +0,0 @@
|
||||
/// <reference types="flarum/@types/translator-icu-rich" />
|
||||
export default class FlagPostModal extends Modal<import("flarum/common/components/Modal").IInternalModalAttrs> {
|
||||
constructor();
|
||||
oninit(vnode: any): void;
|
||||
success: boolean | undefined;
|
||||
reason: Stream<string> | undefined;
|
||||
reasonDetail: Stream<string> | undefined;
|
||||
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
|
||||
content(): JSX.Element;
|
||||
flagReasons(): ItemList<any>;
|
||||
onsubmit(e: any): void;
|
||||
}
|
||||
import Modal from "flarum/common/components/Modal";
|
||||
import Stream from "flarum/common/utils/Stream";
|
||||
import ItemList from "flarum/common/utils/ItemList";
|
@@ -1,7 +0,0 @@
|
||||
export default class FlagsDropdown {
|
||||
static initAttrs(attrs: any): void;
|
||||
getMenu(): JSX.Element;
|
||||
goToRoute(): void;
|
||||
getUnreadCount(): any;
|
||||
getNewCount(): unknown;
|
||||
}
|
@@ -1,9 +0,0 @@
|
||||
/**
|
||||
* The `FlagsPage` component shows the flags list. It is only
|
||||
* used on mobile devices where the flags dropdown is within the drawer.
|
||||
*/
|
||||
export default class FlagsPage {
|
||||
oninit(vnode: any): void;
|
||||
bodyClass: string | undefined;
|
||||
view(): JSX.Element;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
export {};
|
@@ -1,11 +0,0 @@
|
||||
import Model from 'flarum/common/Model';
|
||||
import Post from 'flarum/common/models/Post';
|
||||
import User from 'flarum/common/models/User';
|
||||
export default class Flag extends Model {
|
||||
type(): string;
|
||||
reason(): string | null;
|
||||
reasonDetail(): string | null;
|
||||
createdAt(): Date | null | undefined;
|
||||
post(): false | Post;
|
||||
user(): false | User | null;
|
||||
}
|
@@ -1,16 +0,0 @@
|
||||
export default class FlagListState {
|
||||
constructor(app: any);
|
||||
app: any;
|
||||
/**
|
||||
* Whether or not the flags are loading.
|
||||
*
|
||||
* @type {Boolean}
|
||||
*/
|
||||
loading: boolean;
|
||||
/**
|
||||
* Load flags into the application's cache if they haven't already
|
||||
* been loaded.
|
||||
*/
|
||||
load(): void;
|
||||
cache: any;
|
||||
}
|
@@ -3,8 +3,12 @@
|
||||
"name": "@flarum/flags",
|
||||
"version": "0.0.0",
|
||||
"prettier": "@flarum/prettier-config",
|
||||
"dependencies": {
|
||||
"@flarum/prettier-config": "^1.0.0",
|
||||
"flarum-webpack-config": "^1.0.0",
|
||||
"flarum-tsconfig": "^1.0.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mithril": "^2.0.8",
|
||||
"prettier": "^2.5.1",
|
||||
"flarum-webpack-config": "^2.0.0",
|
||||
"webpack": "^5.65.0",
|
||||
@@ -21,9 +25,8 @@
|
||||
"format-check": "prettier --check src",
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"build-typings": "npm run clean-typings && cp -r src/@types dist-typings/@types && tsc",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
|
||||
"check-typings-coverage": "typescript-coverage-report"
|
||||
}
|
||||
}
|
||||
|
22
extensions/flags/js/src/@types/shims.d.ts
vendored
22
extensions/flags/js/src/@types/shims.d.ts
vendored
@@ -1,22 +0,0 @@
|
||||
import Flag from '../forum/models/Flag';
|
||||
import FlagListState from '../forum/states/FlagListState';
|
||||
import Mithril from 'mithril';
|
||||
|
||||
declare module 'flarum/common/models/Post' {
|
||||
export default interface Post {
|
||||
flags: () => false | (Flag | undefined)[];
|
||||
canFlag: () => boolean;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/forum/ForumApplication' {
|
||||
export default interface ForumApplication {
|
||||
flags: FlagListState;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/forum/components/Post' {
|
||||
export default interface Post {
|
||||
flagReason: (flag: Flag) => Mithril.Children;
|
||||
}
|
||||
}
|
@@ -13,9 +13,6 @@ export default class FlagList extends Component {
|
||||
this.state = this.attrs.state;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import('mithril').Children}
|
||||
*/
|
||||
view() {
|
||||
const flags = this.state.cache || [];
|
||||
|
||||
|
@@ -24,9 +24,6 @@ export default class FlagPostModal extends Modal {
|
||||
return app.translator.trans('flarum-flags.forum.flag_post.title');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import('mithril').Children}
|
||||
*/
|
||||
content() {
|
||||
if (this.success) {
|
||||
return (
|
||||
|
@@ -11,9 +11,6 @@ export default class FlagsDropdown extends NotificationsDropdown {
|
||||
super.initAttrs(attrs);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import('mithril').Children}
|
||||
*/
|
||||
getMenu() {
|
||||
return (
|
||||
<div className={'Dropdown-menu ' + this.attrs.menuClassName} onclick={this.menuClick.bind(this)}>
|
||||
|
@@ -18,9 +18,6 @@ export default class FlagsPage extends Page {
|
||||
this.bodyClass = 'App--flags';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import('mithril').Children}
|
||||
*/
|
||||
view() {
|
||||
return (
|
||||
<div className="FlagsPage">
|
||||
|
@@ -9,8 +9,8 @@ import addFlagsDropdown from './addFlagsDropdown';
|
||||
import addFlagsToPosts from './addFlagsToPosts';
|
||||
|
||||
app.initializers.add('flarum-flags', () => {
|
||||
Post.prototype.flags = Model.hasMany<Flag>('flags');
|
||||
Post.prototype.canFlag = Model.attribute<boolean>('canFlag');
|
||||
app.store.models.posts.prototype.flags = Model.hasMany('flags');
|
||||
app.store.models.posts.prototype.canFlag = Model.attribute('canFlag');
|
||||
|
||||
app.store.models.flags = Flag;
|
||||
|
||||
@@ -26,6 +26,5 @@ app.initializers.add('flarum-flags', () => {
|
||||
// Expose compat API
|
||||
import flagsCompat from './compat';
|
||||
import { compat } from '@flarum/core/forum';
|
||||
import Post from 'flarum/common/models/Post';
|
||||
|
||||
Object.assign(compat, flagsCompat);
|
15
extensions/flags/js/src/forum/models/Flag.js
Normal file
15
extensions/flags/js/src/forum/models/Flag.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import Model from 'flarum/common/Model';
|
||||
|
||||
class Flag extends Model {}
|
||||
|
||||
Object.assign(Flag.prototype, {
|
||||
type: Model.attribute('type'),
|
||||
reason: Model.attribute('reason'),
|
||||
reasonDetail: Model.attribute('reasonDetail'),
|
||||
createdAt: Model.attribute('createdAt', Model.transformDate),
|
||||
|
||||
post: Model.hasOne('post'),
|
||||
user: Model.hasOne('user'),
|
||||
});
|
||||
|
||||
export default Flag;
|
@@ -1,25 +0,0 @@
|
||||
import Model from 'flarum/common/Model';
|
||||
import type Post from 'flarum/common/models/Post';
|
||||
import type User from 'flarum/common/models/User';
|
||||
|
||||
export default class Flag extends Model {
|
||||
type() {
|
||||
return Model.attribute<string>('type').call(this);
|
||||
}
|
||||
reason() {
|
||||
return Model.attribute<string | null>('reason').call(this);
|
||||
}
|
||||
reasonDetail() {
|
||||
return Model.attribute<string | null>('reasonDetail').call(this);
|
||||
}
|
||||
createdAt() {
|
||||
return Model.attribute('createdAt', Model.transformDate).call(this);
|
||||
}
|
||||
|
||||
post() {
|
||||
return Model.hasOne<Post>('post').call(this);
|
||||
}
|
||||
user() {
|
||||
return Model.hasOne<User | null>('user').call(this);
|
||||
}
|
||||
}
|
@@ -1,17 +0,0 @@
|
||||
{
|
||||
// Use Flarum's tsconfig as a starting point
|
||||
"extends": "flarum-tsconfig",
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
||||
// and also tells your Typescript server to read core's global typings for
|
||||
// access to `dayjs` and `$` in the global namespace.
|
||||
"include": ["src/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
|
||||
"@flarum/core/*": ["../vendor/flarum/core/js/dist-typings/*"]
|
||||
}
|
||||
}
|
||||
}
|
19
extensions/lang-english/.gitattributes
vendored
Normal file
19
extensions/lang-english/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/likes/.gitattributes
vendored
Normal file
19
extensions/likes/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
2
extensions/likes/js/dist/forum.js.map
generated
vendored
2
extensions/likes/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
19
extensions/lock/.gitattributes
vendored
Normal file
19
extensions/lock/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/markdown/.gitattributes
vendored
Normal file
19
extensions/markdown/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/mentions/.gitattributes
vendored
Normal file
19
extensions/mentions/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/nicknames/.gitattributes
vendored
Normal file
19
extensions/nicknames/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/package-manager/.gitattributes
vendored
Normal file
19
extensions/package-manager/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -21,7 +21,7 @@
|
||||
"ci": "yarn install --immutable --immutable-cache",
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"build-typings": "yarn run clean-typings && [ -e src/@types ] && cp -r src/@types dist-typings/@types && tsc && yarn run post-build-typings",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
|
||||
|
@@ -46,7 +46,7 @@ export default class Installer<Attrs> extends Component<Attrs> {
|
||||
app.modal.show(LoadingModal);
|
||||
|
||||
app
|
||||
.request<{ id: string }>({
|
||||
.request({
|
||||
method: 'POST',
|
||||
url: `${app.forum.attribute('apiUrl')}/package-manager/extensions`,
|
||||
body: {
|
||||
|
@@ -3,7 +3,6 @@ import app from 'flarum/admin/app';
|
||||
import Component from 'flarum/common/Component';
|
||||
import Button from 'flarum/common/components/Button';
|
||||
import humanTime from 'flarum/common/helpers/humanTime';
|
||||
import extractText from 'flarum/common/utils/extractText';
|
||||
import LoadingModal from 'flarum/admin/components/LoadingModal';
|
||||
import errorHandler from '../utils/errorHandler';
|
||||
import LoadingIndicator from 'flarum/common/components/LoadingIndicator';
|
||||
@@ -64,7 +63,7 @@ export default class Updater<Attrs> extends Component<Attrs> {
|
||||
super.oninit(vnode);
|
||||
}
|
||||
|
||||
view(): Mithril.Children {
|
||||
view() {
|
||||
const extensions = this.getExtensionUpdates();
|
||||
let coreUpdate: UpdatedPackage | undefined = this.getCoreUpdate();
|
||||
let core: any;
|
||||
@@ -189,7 +188,7 @@ export default class Updater<Attrs> extends Component<Attrs> {
|
||||
}
|
||||
|
||||
updateCoreMinor() {
|
||||
if (confirm(extractText(app.translator.trans('flarum-package-manager.admin.minor_update_confirmation.content')))) {
|
||||
if (confirm(app.translator.trans('flarum-package-manager.admin.minor_update_confirmation.content'))) {
|
||||
app.modal.show(LoadingModal);
|
||||
this.isLoading = 'minor-update';
|
||||
|
||||
|
@@ -26,7 +26,7 @@ export default class WhyNotModal<Attrs extends WhyNotModalAttrs = WhyNotModalAtt
|
||||
this.requestWhyNot();
|
||||
}
|
||||
|
||||
content(): Mithril.Children {
|
||||
content() {
|
||||
return <div className="Modal-body">{this.loading ? <LoadingIndicator /> : <pre className="WhyNotModal-contents">{this.whyNot}</pre>}</div>;
|
||||
}
|
||||
|
||||
|
19
extensions/pusher/.gitattributes
vendored
Normal file
19
extensions/pusher/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -22,9 +22,6 @@
|
||||
"flarum/core": "^1.2",
|
||||
"pusher/pusher-php-server": "^2.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"flarum/tags": "^1.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flarum\\Pusher\\": "src/"
|
||||
|
@@ -10,7 +10,7 @@
|
||||
"format": "prettier --write src",
|
||||
"format-check": "prettier --check src",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"build-typings": "yarn run clean-typings && [ -e src/@types ] && cp -r src/@types dist-typings/@types && tsc && yarn run post-build-typings",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"post-build-typings": "find dist-typings -type f -name '*.d.ts' -print0 | xargs -0 sed -i 's,../src/@types,@types,g'"
|
||||
|
@@ -13,9 +13,3 @@ declare module 'flarum/forum/ForumApplication' {
|
||||
pushedUpdates: Array<any>;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/forum/components/DiscussionList' {
|
||||
export default interface DiscussionList {
|
||||
loadingUpdated?: boolean;
|
||||
}
|
||||
}
|
@@ -6,8 +6,7 @@ import DiscussionPage from 'flarum/forum/components/DiscussionPage';
|
||||
import IndexPage from 'flarum/forum/components/IndexPage';
|
||||
import Button from 'flarum/common/components/Button';
|
||||
import ItemList from 'flarum/common/utils/ItemList';
|
||||
import type { Children } from 'mithril';
|
||||
import type Tag from 'flarum/tags/common/models/Tag';
|
||||
import { Children, VnodeDOM } from 'mithril';
|
||||
|
||||
export type PusherBinding = {
|
||||
channels: {
|
||||
@@ -48,15 +47,14 @@ app.initializers.add('flarum-pusher', () => {
|
||||
app.pusher.then((binding: PusherBinding) => {
|
||||
const pusher = binding.pusher;
|
||||
|
||||
pusher.bind('newPost', (data: { tagIds: string[]; discussionId: number }) => {
|
||||
pusher.bind('newPost', (data: { tagIds: number[]; discussionId: number }) => {
|
||||
const params = app.discussions.getParams();
|
||||
|
||||
if (!params.q && !params.sort && !params.filter) {
|
||||
if (params.tags) {
|
||||
const tag = app.store.getBy<Tag>('tags', 'slug', params.tags);
|
||||
const tagId = tag?.id();
|
||||
const tag = app.store.getBy('tags', 'slug', params.tags);
|
||||
|
||||
if (!tagId || !data.tagIds.includes(tagId)) return;
|
||||
if (!data.tagIds.includes(tag.id())) return;
|
||||
}
|
||||
|
||||
const id = String(data.discussionId);
|
||||
@@ -81,11 +79,11 @@ app.initializers.add('flarum-pusher', () => {
|
||||
});
|
||||
});
|
||||
|
||||
extend(DiscussionList.prototype, 'view', function (this: DiscussionList, vdom: Children) {
|
||||
extend(DiscussionList.prototype, 'view', function (this: DiscussionList, vdom: VnodeDOM) {
|
||||
if (app.pushedUpdates) {
|
||||
const count = app.pushedUpdates.length;
|
||||
|
||||
if (count && typeof vdom === 'object' && vdom && 'children' in vdom && vdom.children instanceof Array) {
|
||||
if (count) {
|
||||
vdom.children.unshift(
|
||||
Button.component(
|
||||
{
|
||||
|
@@ -4,14 +4,13 @@
|
||||
// This will match all .ts, .tsx, .d.ts, .js, .jsx files in your `src` folder
|
||||
// and also tells your Typescript server to read core's global typings for
|
||||
// access to `dayjs` and `$` in the global namespace.
|
||||
"include": ["src/**/*", "../vendor/*/*/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"include": ["src/**/*", "../vendor/flarum/core/js/dist-typings/@types/**/*", "@types/**/*"],
|
||||
"compilerOptions": {
|
||||
// This will output typings to `dist-typings`
|
||||
"declarationDir": "./dist-typings",
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"],
|
||||
"flarum/tags/*": ["../vendor/flarum/tags/js/dist-typings/*"]
|
||||
"flarum/*": ["../vendor/flarum/core/js/dist-typings/*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
19
extensions/statistics/.gitattributes
vendored
Normal file
19
extensions/statistics/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -24,7 +24,7 @@
|
||||
"format-check": "prettier --check src",
|
||||
"analyze": "cross-env ANALYZER=true yarn run build",
|
||||
"clean-typings": "npx rimraf dist-typings && mkdir dist-typings",
|
||||
"build-typings": "yarn run clean-typings && ([ -e src/@types ] && cp -r src/@types dist-typings/@types || true) && tsc && yarn run post-build-typings",
|
||||
"build-typings": "yarn run clean-typings && [ -e src/@types ] && cp -r src/@types dist-typings/@types && tsc && yarn run post-build-typings",
|
||||
"check-typings": "tsc --noEmit --emitDeclarationOnly false",
|
||||
"check-typings-coverage": "typescript-coverage-report",
|
||||
"ci": "yarn install --immutable --immutable-cache",
|
||||
|
@@ -46,9 +46,6 @@ export default class StatisticsWidget extends DashboardWidget {
|
||||
return 'StatisticsWidget';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {import('mithril').Children}
|
||||
*/
|
||||
content() {
|
||||
const thisPeriod = this.periods[this.selectedPeriod];
|
||||
|
||||
|
19
extensions/sticky/.gitattributes
vendored
Normal file
19
extensions/sticky/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/subscriptions/.gitattributes
vendored
Normal file
19
extensions/subscriptions/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
2
extensions/subscriptions/js/dist/forum.js.map
generated
vendored
2
extensions/subscriptions/js/dist/forum.js.map
generated
vendored
File diff suppressed because one or more lines are too long
19
extensions/suspend/.gitattributes
vendored
Normal file
19
extensions/suspend/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
19
extensions/tags/.gitattributes
vendored
Normal file
19
extensions/tags/.gitattributes
vendored
Normal file
@@ -0,0 +1,19 @@
|
||||
.gitattributes export-ignore
|
||||
.gitignore export-ignore
|
||||
.gitmodules export-ignore
|
||||
.github export-ignore
|
||||
.travis export-ignore
|
||||
.travis.yml export-ignore
|
||||
.editorconfig export-ignore
|
||||
.styleci.yml export-ignore
|
||||
|
||||
phpunit.xml export-ignore
|
||||
tests export-ignore
|
||||
|
||||
js/dist/* -diff
|
||||
js/dist/* linguist-generated
|
||||
js/dist-typings/* linguist-generated
|
||||
js/yarn.lock -diff
|
||||
js/package-lock.json -diff
|
||||
|
||||
* text=auto eol=lf
|
@@ -54,7 +54,7 @@
|
||||
"gitConf": true,
|
||||
"githubActions": true,
|
||||
"prettier": false,
|
||||
"typescript": true,
|
||||
"typescript": false,
|
||||
"bundlewatch": false,
|
||||
"backendTesting": true,
|
||||
"editorConfig": true,
|
||||
|
@@ -1,21 +0,0 @@
|
||||
import type Tag from "../common/models/Tag";
|
||||
import type TagListState from "../forum/states/TagListState";
|
||||
|
||||
declare module 'flarum/forum/routes' {
|
||||
export interface ForumRoutes {
|
||||
tag: (tag: Tag) => string;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/forum/ForumApplication' {
|
||||
export default interface ForumApplication {
|
||||
tagList: TagListState;
|
||||
}
|
||||
}
|
||||
|
||||
declare module 'flarum/common/models/Discussion' {
|
||||
export default interface Discussion {
|
||||
tags: () => false | (Tag | undefined)[];
|
||||
canTag: () => boolean | undefined;
|
||||
}
|
||||
}
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1,21 +0,0 @@
|
||||
declare var _default: {
|
||||
'tags/utils/sortTags': typeof import("../common/utils/sortTags").default;
|
||||
'tags/models/Tag': typeof import("../common/models/Tag").default;
|
||||
'tags/helpers/tagsLabel': typeof import("../common/helpers/tagsLabel").default;
|
||||
'tags/helpers/tagIcon': typeof import("../common/helpers/tagIcon").default;
|
||||
'tags/helpers/tagLabel': typeof import("../common/helpers/tagLabel").default;
|
||||
} & {
|
||||
'tags/addTagsHomePageOption': typeof addTagsHomePageOption;
|
||||
'tags/addTagChangePermission': typeof addTagChangePermission;
|
||||
'tags/components/TagsPage': typeof TagsPage;
|
||||
'tags/components/EditTagModal': typeof EditTagModal;
|
||||
'tags/addTagPermission': typeof addTagPermission;
|
||||
'tags/addTagsPermissionScope': typeof addTagsPermissionScope;
|
||||
};
|
||||
export default _default;
|
||||
import addTagsHomePageOption from "./addTagsHomePageOption";
|
||||
import addTagChangePermission from "./addTagChangePermission";
|
||||
import TagsPage from "./components/TagsPage";
|
||||
import EditTagModal from "./components/EditTagModal";
|
||||
import addTagPermission from "./addTagPermission";
|
||||
import addTagsPermissionScope from "./addTagsPermissionScope";
|
@@ -1,34 +0,0 @@
|
||||
/// <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<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(): ItemList<any>;
|
||||
submitData(): {
|
||||
name: any;
|
||||
slug: any;
|
||||
description: any;
|
||||
color: any;
|
||||
icon: any;
|
||||
isHidden: any;
|
||||
primary: any;
|
||||
};
|
||||
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";
|
@@ -1,10 +0,0 @@
|
||||
export default class TagsPage extends ExtensionPage<import("flarum/admin/components/ExtensionPage").ExtensionPageAttrs> {
|
||||
constructor();
|
||||
oninit(vnode: any): void;
|
||||
forcedRefreshKey: number | 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";
|
@@ -1 +0,0 @@
|
||||
export {};
|
@@ -1,13 +0,0 @@
|
||||
declare var _default: {
|
||||
'tags/utils/sortTags': typeof sortTags;
|
||||
'tags/models/Tag': typeof Tag;
|
||||
'tags/helpers/tagsLabel': typeof tagsLabel;
|
||||
'tags/helpers/tagIcon': typeof tagIcon;
|
||||
'tags/helpers/tagLabel': typeof tagLabel;
|
||||
};
|
||||
export default _default;
|
||||
import sortTags from "./utils/sortTags";
|
||||
import Tag from "./models/Tag";
|
||||
import tagsLabel from "./helpers/tagsLabel";
|
||||
import tagIcon from "./helpers/tagIcon";
|
||||
import tagLabel from "./helpers/tagLabel";
|
@@ -1 +0,0 @@
|
||||
export default function tagIcon(tag: any, attrs?: {}, settings?: {}): JSX.Element;
|
@@ -1 +0,0 @@
|
||||
export default function tagLabel(tag: any, attrs?: {}): import("mithril").Vnode<any, any>;
|
@@ -1 +0,0 @@
|
||||
export default function tagsLabel(tags: any, attrs?: {}): JSX.Element;
|
@@ -1,24 +0,0 @@
|
||||
import Model from 'flarum/common/Model';
|
||||
import Discussion from 'flarum/common/models/Discussion';
|
||||
export default class Tag extends Model {
|
||||
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;
|
||||
}
|
@@ -1 +0,0 @@
|
||||
export default function sortTags(tags: any): any;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
@@ -1 +0,0 @@
|
||||
export default function _default(): void;
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user