1
0
mirror of https://github.com/flarum/core.git synced 2025-08-06 08:27:42 +02:00

Bundled output for commit 1ab3029e78

Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
This commit is contained in:
flarum-bot
2024-09-19 16:05:15 +00:00
parent 1ab3029e78
commit f66a1b998f
19 changed files with 139 additions and 47 deletions

2
extensions/likes/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

@@ -1,2 +1,2 @@
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var a in r)e.o(r,a)&&!e.o(t,a)&&Object.defineProperty(t,a,{enumerable:!0,get:r[a]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t);const r=flarum.reg.get("core","admin/app");var a=e.n(r);a().initializers.add("flarum-mentions",(()=>{a().extensionData.for("flarum-mentions").registerSetting({setting:"flarum-mentions.allow_username_format",type:"boolean",label:a().translator.trans("flarum-mentions.admin.settings.allow_username_format_label"),help:a().translator.trans("flarum-mentions.admin.settings.allow_username_format_text")}).registerPermission({permission:"mentionGroups",label:a().translator.trans("flarum-mentions.admin.permissions.mention_groups_label"),icon:"fas fa-at"},"start")}))})(),module.exports=t})();
(()=>{var e={n:t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},d:(t,r)=>{for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};(()=>{"use strict";e.r(t),e.d(t,{extend:()=>u});const r=flarum.reg.get("core","admin/app");var n=e.n(r);const a=flarum.reg.get("core","common/extenders");var o=e.n(a);const s=flarum.reg.get("core","common/query/IGambit"),m=flarum.reg.get("core","common/app");var i=e.n(m);class l extends s.KeyValueGambit{key(){return i().translator.trans("flarum-mentions.lib.gambits.posts.mentioned.key",{},!0)}hint(){return i().translator.trans("flarum-mentions.lib.gambits.posts.mentioned.hint",{},!0)}filterKey(){return"mentioned"}}flarum.reg.add("flarum-mentions","common/query/posts/MentionedGambit",l);const u=[(new(o().Search)).gambit("posts",l)];n().initializers.add("flarum-mentions",(()=>{n().extensionData.for("flarum-mentions").registerSetting({setting:"flarum-mentions.allow_username_format",type:"boolean",label:n().translator.trans("flarum-mentions.admin.settings.allow_username_format_label"),help:n().translator.trans("flarum-mentions.admin.settings.allow_username_format_text")}).registerPermission({permission:"mentionGroups",label:n().translator.trans("flarum-mentions.admin.permissions.mention_groups_label"),icon:"fas fa-at"},"start")}))})(),module.exports=t})();
//# sourceMappingURL=admin.js.map

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -7,5 +7,7 @@ import type Mithril from 'mithril';
* @param phrase The word or words to highlight.
* @param [length] The number of characters to truncate the string to.
* The string will be truncated surrounding the first match.
* @param safe Whether the content is safe to render as HTML or
* should be escaped (HTML entities encoded).
*/
export default function highlight(string: string, phrase?: string | RegExp, length?: number): Mithril.Vnode<any, any> | string;
export default function highlight(string: string, phrase?: string | RegExp, length?: number, safe?: boolean): Mithril.Vnode<any, any> | string;

View File

@@ -0,0 +1,6 @@
import { KeyValueGambit } from '../IGambit';
export default class DiscussionGambit extends KeyValueGambit {
key(): string;
hint(): string;
filterKey(): string;
}

View File

@@ -1,7 +1,9 @@
export default class PageState {
constructor(type: any, data?: {});
type: any;
data: {};
type: Function | null;
data: {
routeName?: string | null;
} & Record<string, any>;
constructor(type: Function | null, data?: any);
/**
* Determine whether the page matches the given class and data.
*
@@ -9,7 +11,7 @@ export default class PageState {
* @param {Record<string, unknown>} data
* @return {boolean}
*/
matches(type: object, data?: Record<string, unknown>): boolean;
get(key: any): any;
set(key: any, value: any): void;
matches(type: Function, data?: any): boolean;
get(key: string): any;
set(key: string, value: any): void;
}

View File

@@ -25,7 +25,7 @@ export default abstract class PaginatedListState<T extends Model, P extends Pagi
*/
static DEFAULT_PAGE_SIZE: number;
protected location: PaginationLocation;
protected pageSize: number | null;
pageSize: number | null;
protected pages: Page<T>[];
protected params: P;
protected initialLoading: boolean;
@@ -88,4 +88,8 @@ export default abstract class PaginatedListState<T extends Model, P extends Pagi
protected getPrevPageNumber(): number;
protected paramsChanged(newParams: P): boolean;
protected getAllItems(): T[];
/**
* In the last request, has the user searched for a model?
*/
isSearchResults(): boolean;
}

View File

@@ -4,9 +4,14 @@ 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 Post from '../../common/models/Post';
import type User from '../../common/models/User';
export interface IDiscussionListItemAttrs extends ComponentAttrs {
discussion: Discussion;
post?: Post;
params: DiscussionListParams;
jumpTo?: number;
author?: User;
}
/**
* The `DiscussionListItem` component shows a single discussion in the

View File

@@ -0,0 +1,9 @@
/// <reference types="mithril" />
import Component, { type ComponentAttrs } from '../../common/Component';
import PostListState from '../states/PostListState';
export interface IPostListAttrs extends ComponentAttrs {
state: PostListState;
}
export default class PostList<CustomAttrs extends IPostListAttrs = IPostListAttrs> extends Component<CustomAttrs> {
view(): JSX.Element;
}

View File

@@ -0,0 +1,11 @@
import Component, { type ComponentAttrs } from '../../common/Component';
import type Post from '../../common/models/Post';
import Mithril from 'mithril';
import { PostListParams } from '../states/PostListState';
export interface IPostListItemAttrs extends ComponentAttrs {
post: Post;
params: PostListParams;
}
export default class PostListItem<CustomAttrs extends IPostListItemAttrs = IPostListItemAttrs> extends Component<CustomAttrs> {
view(): Mithril.Children;
}

View File

@@ -0,0 +1,35 @@
import Page, { IPageAttrs } from '../../common/components/Page';
import ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril';
import PostListState from '../states/PostListState';
export interface IPostsPageAttrs extends IPageAttrs {
}
/**
* The `PostsPage` component displays the index page, including the welcome
* hero, the sidebar, and the discussion list.
*/
export default class PostsPage<CustomAttrs extends IPostsPageAttrs = IPostsPageAttrs, CustomState = {}> extends Page<CustomAttrs, CustomState> {
static providesInitialSearch: boolean;
protected posts: PostListState;
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
view(): JSX.Element;
setTitle(): void;
oncreate(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
onremove(vnode: Mithril.VnodeDOM<CustomAttrs, this>): void;
/**
* Get the component to display as the hero.
*/
hero(): JSX.Element;
sidebar(): JSX.Element;
/**
* Build an item list for the part of the toolbar which is concerned with how
* the results are displayed. By default this is just a select box to change
* the way discussions are sorted.
*/
viewItems(): ItemList<Mithril.Children>;
/**
* Build an item list for the part of the toolbar which is about taking action
* on the results. By default this is just a "mark all as read" button.
*/
actionItems(): ItemList<Mithril.Children>;
}

View File

@@ -0,0 +1,17 @@
import type Mithril from 'mithril';
import type Post from '../../common/models/Post';
import type { SearchSource } from './Search';
/**
* The `PostsSearchSource` finds and displays post search results in
* the search dropdown.
*/
export default class PostsSearchSource implements SearchSource {
protected results: Map<string, Post[]>;
resource: string;
title(): string;
isCached(query: string): boolean;
search(query: string, limit: number): Promise<void>;
view(query: string): Array<Mithril.Vnode>;
fullPage(query: string): Mithril.Vnode;
gotoItem(id: string): string | null;
}

View File

@@ -1,24 +1,16 @@
import UserPage, { IUserPageAttrs } from './UserPage';
import type Post from '../../common/models/Post';
import type Mithril from 'mithril';
import type User from '../../common/models/User';
import PostListState from '../states/PostListState';
/**
* The `PostsUserPage` component shows a user's activity feed inside of their
* profile.
*/
export default class PostsUserPage extends UserPage {
/**
* Whether or not the activity feed is currently loading.
* The state of the Post models in the feed.
*/
loading: boolean;
/**
* Whether or not there are any more activity items that can be loaded.
*/
moreResults: boolean;
/**
* The Post models in the feed.
*/
posts: Post[];
posts: PostListState;
/**
* The number of activity items to load per request.
*/
@@ -30,22 +22,9 @@ export default class PostsUserPage extends UserPage {
* activity feed.
*/
show(user: User): void;
/**
* Clear and reload the user's activity feed.
*/
refresh(): void;
/**
* Load a new page of the user's activity feed.
*
* @protected
*/
loadResults(offset?: number): Promise<import("../../common/Store").ApiResponsePlural<Post>>;
/**
* Load the next page of results.
*/
loadMore(): void;
/**
* Parse results and append them to the activity feed.
*/
parseResults(results: Post[]): Post[];
params(user: User): {
filter: {
author: string;
};
};
}

View File

@@ -84,4 +84,7 @@ export default class SearchModal<CustomAttrs extends ISearchModalAttrs = ISearch
*/
setIndex(index: number, scrollToItem?: boolean): void;
inputElement(): JQuery<HTMLInputElement>;
defaultActiveSource(): string | null;
defaultFilters(): Record<string, Record<string, any>>;
prefill(value: string): string;
}

View File

@@ -18,10 +18,6 @@ export default class DiscussionListState<P extends DiscussionListParams = Discus
* translation) to the API sort value that they represent.
*/
sortMap(): any;
/**
* In the last request, has the user searched for a discussion?
*/
isSearchResults(): boolean;
removeDiscussion(discussion: Discussion): void;
deleteDiscussion(discussion: Discussion): void;
/**

View File

@@ -0,0 +1,23 @@
import PaginatedListState, { Page, PaginatedListParams, PaginatedListRequestParams } from '../../common/states/PaginatedListState';
import Post from '../../common/models/Post';
import { ApiResponsePlural } from '../../common/Store';
import EventEmitter from '../../common/utils/EventEmitter';
export interface PostListParams extends PaginatedListParams {
sort?: string;
}
export default class PostListState<P extends PostListParams = PostListParams> extends PaginatedListState<Post, P> {
protected extraPosts: Post[];
protected eventEmitter: EventEmitter;
constructor(params: P, page?: number, pageSize?: number | null);
get type(): string;
requestParams(): PaginatedListRequestParams;
protected loadPage(page?: number): Promise<ApiResponsePlural<Post>>;
clear(): void;
/**
* Get a map of sort keys (which appear in the URL, and are used for
* translation) to the API sort value that they represent.
*/
sortMap(): any;
protected getAllItems(): Post[];
getPages(): Page<Post>[];
}