Bundled output for commit 631b4c194c40bc37b7f747031ca0e555a512ff66

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

[skip ci]
This commit is contained in:
flarum-bot 2022-08-08 13:53:39 +00:00
parent 631b4c194c
commit b28606b8ef
32 changed files with 186 additions and 112 deletions

View File

@ -1,5 +1,7 @@
export default class FlagList {
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";

View File

@ -1,12 +1,15 @@
export default class FlagPostModal {
/// <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: any;
reasonDetail: any;
className(): string;
title(): any;
reason: Stream<string> | undefined;
reasonDetail: Stream<string> | undefined;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
content(): JSX.Element;
flagReasons(): any;
flagReasons(): ItemList<any>;
onsubmit(e: any): void;
loading: boolean | undefined;
}
import Modal from "flarum/common/components/Modal";
import Stream from "flarum/common/utils/Stream";
import ItemList from "flarum/common/utils/ItemList";

View File

@ -3,5 +3,5 @@ export default class FlagsDropdown {
getMenu(): JSX.Element;
goToRoute(): void;
getUnreadCount(): any;
getNewCount(): any;
getNewCount(): unknown;
}

View File

@ -1,9 +1,11 @@
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(): any;
reason(): any;
reasonDetail(): any;
createdAt(): any;
post(): any;
user(): any;
type(): string;
reason(): string | null;
reasonDetail(): string | null;
createdAt(): Date | null | undefined;
post(): false | Post;
user(): false | User | null;
}

View File

@ -1 +1 @@
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLRF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3ER,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,+BCLvD,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,gBACC,CACEC,QAAS,8BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAE9B,IAEDC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAE7BK,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,WACA,IAGDF,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,QACA,Q","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/flags/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionData\n .for('flarum-flags')\n .registerSetting(\n {\n setting: 'flarum-flags.guidelines_url',\n type: 'text',\n label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'),\n },\n 15\n )\n .registerSetting({\n setting: 'flarum-flags.can_flag_own',\n type: 'boolean',\n label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags',\n },\n 'moderate',\n 65\n )\n\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts',\n },\n 'reply',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission"],"sourceRoot":""}
{"version":3,"file":"admin.js","mappings":"MACA,IAAIA,EAAsB,CCA1BA,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,CAAM,ECLdF,EAAwB,CAACM,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDR,EAAwB,CAACc,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFf,EAAyBM,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,GAAO,G,+BCL9D,MAAM,EAA+BC,OAAOC,KAAKC,OAAO,a,aCExDC,IAAAA,aAAAA,IAAqB,gBAAgB,WACnCA,IAAAA,cAAAA,IACO,gBACJC,gBACC,CACEC,QAAS,8BACTC,KAAM,OACNC,MAAOJ,IAAAA,WAAAA,MAAqB,qDAE9B,IAEDC,gBAAgB,CACfC,QAAS,4BACTC,KAAM,UACNC,MAAOJ,IAAAA,WAAAA,MAAqB,sDAE7BK,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,WACA,IAGDF,mBACC,CACEC,KAAM,cACNF,MAAOJ,IAAAA,WAAAA,MAAqB,mDAC5BO,WAAY,wBAEd,QACA,GAEL,G","sources":["webpack://@flarum/flags/webpack/bootstrap","webpack://@flarum/flags/webpack/runtime/compat get default export","webpack://@flarum/flags/webpack/runtime/define property getters","webpack://@flarum/flags/webpack/runtime/hasOwnProperty shorthand","webpack://@flarum/flags/webpack/runtime/make namespace object","webpack://@flarum/flags/external root \"flarum.core.compat['admin/app']\"","webpack://@flarum/flags/./src/admin/index.ts"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = flarum.core.compat['admin/app'];","import app from 'flarum/admin/app';\n\napp.initializers.add('flarum-flags', () => {\n app.extensionData\n .for('flarum-flags')\n .registerSetting(\n {\n setting: 'flarum-flags.guidelines_url',\n type: 'text',\n label: app.translator.trans('flarum-flags.admin.settings.guidelines_url_label'),\n },\n 15\n )\n .registerSetting({\n setting: 'flarum-flags.can_flag_own',\n type: 'boolean',\n label: app.translator.trans('flarum-flags.admin.settings.flag_own_posts_label'),\n })\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.view_flags_label'),\n permission: 'discussion.viewFlags',\n },\n 'moderate',\n 65\n )\n\n .registerPermission(\n {\n icon: 'fas fa-flag',\n label: app.translator.trans('flarum-flags.admin.permissions.flag_posts_label'),\n permission: 'discussion.flagPosts',\n },\n 'reply',\n 65\n );\n});\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","flarum","core","compat","app","registerSetting","setting","type","label","registerPermission","icon","permission"],"sourceRoot":""}

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,16 @@
import type Mithril from 'mithril';
import Component from 'flarum/common/Component';
import { TaskOperations } from '../models/Task';
import Component, { ComponentAttrs } from 'flarum/common/Component';
import ItemList from 'flarum/common/utils/ItemList';
import Task, { TaskOperations } from '../models/Task';
interface QueueTableColumn extends ComponentAttrs {
label: string;
content: (task: Task) => Mithril.Children;
}
export default class QueueSection extends Component<{}> {
oninit(vnode: Mithril.Vnode<{}, this>): void;
view(): JSX.Element;
columns(): any;
columns(): ItemList<QueueTableColumn>;
queueTable(): JSX.Element;
operationIcon(operation: TaskOperations): Mithril.Children;
}
export {};

View File

@ -1,4 +1,5 @@
/// <reference types="mithril" />
/// <reference types="flarum/@types/translator-icu-rich" />
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import Task from '../models/Task';
interface TaskOutputModalAttrs extends IInternalModalAttrs {
@ -6,7 +7,7 @@ interface TaskOutputModalAttrs extends IInternalModalAttrs {
}
export default class TaskOutputModal<CustomAttrs extends TaskOutputModalAttrs = TaskOutputModalAttrs> extends Modal<CustomAttrs> {
className(): string;
title(): any;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
content(): JSX.Element;
}
export {};

View File

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

View File

@ -1,13 +1,13 @@
import Model from 'flarum/common/Model';
export declare type TaskOperations = 'extension_install' | 'extension_remove' | 'extension_update' | 'update_global' | 'update_minor' | 'update_major' | 'update_check' | 'why_not';
export default class Task extends Model {
status(): any;
operation(): any;
command(): any;
package(): any;
output(): any;
createdAt(): any;
startedAt(): any;
finishedAt(): any;
status(): "running" | "pending" | "success" | "failure";
operation(): TaskOperations;
command(): string;
package(): string;
output(): string;
createdAt(): Date | null | undefined;
startedAt(): Date;
finishedAt(): Date;
peakMemoryUsed(): string;
}

View File

@ -5,7 +5,7 @@ export default class QueueState {
private limit;
private offset;
private total;
load(params?: ApiQueryParamsPlural): any;
load(params?: ApiQueryParamsPlural): Promise<import("flarum/common/Store").ApiResponsePlural<Task>>;
getItems(): Task[] | null;
getTotalPages(): number;
pageNumber(): number;

View File

@ -1 +1 @@
export default function humanDuration(start: Date, end: Date): any;
export default function humanDuration(start: Date, end: Date): string;

View File

@ -1,4 +1,3 @@
/// <reference types="mithril" />
import ExtensionPage from 'flarum/admin/components/ExtensionPage';
export default class StatisticsPage extends ExtensionPage {
content(): JSX.Element;

View File

@ -1,4 +1,6 @@
/// <reference types="flarum/@types/translator-icu-rich" />
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import ItemList from 'flarum/common/utils/ItemList';
import Stream from 'flarum/common/utils/Stream';
import type Mithril from 'mithril';
import type Tag from '../../common/models/Tag';
@ -21,17 +23,17 @@ export default class EditTagModal extends Modal<EditTagModalAttrs> {
primary: Stream<boolean>;
oninit(vnode: Mithril.Vnode<EditTagModalAttrs, this>): void;
className(): string;
title(): any;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray | Mithril.Vnode<any, any>;
content(): JSX.Element;
fields(): any;
fields(): ItemList<unknown>;
submitData(): {
name: any;
slug: any;
description: any;
color: any;
icon: any;
isHidden: any;
primary: any;
name: string;
slug: string;
description: string;
color: string;
icon: string;
isHidden: boolean;
primary: boolean;
};
onsubmit(e: SubmitEvent): void;
delete(): void;

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 type 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,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,5 +1,8 @@
/// <reference types="flarum/@types/translator-icu-rich" />
import type Mithril from 'mithril';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal';
import KeyboardNavigatable from 'flarum/forum/utils/KeyboardNavigatable';
import Stream from 'flarum/common/utils/Stream';
import Discussion from 'flarum/common/models/Discussion';
import Tag from '../../common/models/Tag';
export interface TagDiscussionModalAttrs extends IInternalModalAttrs {
@ -10,14 +13,14 @@ export interface TagDiscussionModalAttrs extends IInternalModalAttrs {
export default class TagDiscussionModal extends Modal<TagDiscussionModalAttrs> {
tagsLoading: boolean;
selected: Tag[];
filter: any;
filter: Stream<string>;
focused: boolean;
minPrimary: any;
maxPrimary: any;
minSecondary: any;
maxSecondary: any;
minPrimary: number;
maxPrimary: number;
minSecondary: number;
maxSecondary: number;
bypassReqs: boolean;
navigator: any;
navigator: KeyboardNavigatable;
tags?: Tag[];
selectedTag?: Tag;
oninit(vnode: Mithril.Vnode<TagDiscussionModalAttrs, this>): void;
@ -32,15 +35,15 @@ export default class TagDiscussionModal extends Modal<TagDiscussionModalAttrs> {
*/
removeTag(tag: Tag): void;
className(): string;
title(): any;
getInstruction(primaryCount: number, secondaryCount: number): any;
title(): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
getInstruction(primaryCount: number, secondaryCount: number): import("@askvortsov/rich-icu-message-formatter").NestedStringArray;
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;
selectableItems(): JQuery<HTMLElement>;
getCurrentNumericIndex(): number;
getItem(selectedTag: Tag): JQuery<HTMLElement>;
setIndex(index: number, scrollToItem: boolean): void;
onsubmit(e: SubmitEvent): void;
}

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, undefined> {
constructor();
oninit(vnode: any): void;
tags: any[] | undefined;
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

@ -9,6 +9,15 @@ export interface IInternalModalAttrs {
animateShow: ModalManager['animateShow'];
animateHide: ModalManager['animateHide'];
}
export interface IDismissibleOptions {
/**
* @deprecated Check specific individual attributes instead. Will be removed in Flarum 2.0.
*/
isDismissible: boolean;
viaCloseButton: boolean;
viaEscKey: boolean;
viaBackdropClick: boolean;
}
/**
* The `Modal` component displays a modal dialog, wrapped in a form. Subclasses
* should implement the `className`, `title`, and `content` methods.
@ -16,8 +25,25 @@ export interface IInternalModalAttrs {
export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IInternalModalAttrs> extends Component<ModalAttrs> {
/**
* Determine whether or not the modal should be dismissible via an 'x' button.
*
* @deprecated Use the individual `isDismissibleVia...` attributes instead and remove references to this.
*/
static readonly isDismissible: boolean;
/**
* Can the model be dismissed with a close button (X)?
*
* If `false`, no close button is shown.
*/
protected static readonly isDismissibleViaCloseButton: boolean;
/**
* Can the modal be dismissed by pressing the Esc key on a keyboard?
*/
protected static readonly isDismissibleViaEscKey: boolean;
/**
* Can the modal be dismissed via a click on the backdrop.
*/
protected static readonly isDismissibleViaBackdropClick: boolean;
static get dismissibleOptions(): IDismissibleOptions;
protected loading: boolean;
/**
* Attributes for an alert component to show below the header.
@ -65,4 +91,5 @@ export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IIn
* the first relevant field involved in the error.
*/
onerror(error: RequestError): void;
private get dismissibleOptions();
}

View File

@ -6,20 +6,31 @@ interface IModalManagerAttrs {
state: ModalManagerState;
}
/**
* The `ModalManager` component manages a modal dialog. Only one modal dialog
* can be shown at once; loading a new component into the ModalManager will
* overwrite the previous one.
* The `ModalManager` component manages one or more modal dialogs. Stacking modals
* is supported. Multiple dialogs can be shown at once; loading a new component
* into the ModalManager will overwrite the previous one.
*/
export default class ModalManager extends Component<IModalManagerAttrs> {
protected focusTrap: FocusTrap | undefined;
/**
* Whether a modal is currently shown by this modal manager.
*/
protected modalShown: boolean;
protected lastSetFocusTrap: number | undefined;
protected modalClosing: boolean;
protected keyUpListener: null | ((e: KeyboardEvent) => void);
view(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): Mithril.Children;
oncreate(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): void;
onbeforeremove(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): void;
onupdate(vnode: Mithril.VnodeDOM<IModalManagerAttrs, this>): void;
animateShow(readyCallback: () => void): void;
animateHide(): void;
/**
* Get current active dialog
*/
private get activeDialogElement();
/**
* Get current active dialog
*/
private get activeDialogManagerElement();
animateShow(readyCallback?: () => void): void;
animateHide(closedCallback?: () => void): void;
protected handleEscPress(e: KeyboardEvent): void;
protected handlePossibleBackdropClick(e: MouseEvent): void;
protected onBackdropTransitionEnd(e: TransitionEvent): void;
}
export {};

View File

@ -3,7 +3,6 @@ import 'expose-loader?exposes=m!mithril';
import 'expose-loader?exposes=dayjs!dayjs';
import 'bootstrap/js/affix';
import 'bootstrap/js/dropdown';
import 'bootstrap/js/modal';
import 'bootstrap/js/tooltip';
import 'bootstrap/js/transition';
import 'jquery.hotkeys/jquery.hotkeys';

View File

@ -1,5 +1,5 @@
import type Component from '../Component';
import Modal from '../components/Modal';
import Modal, { IDismissibleOptions } from '../components/Modal';
/**
* Ideally, `show` would take a higher-kinded generic, ala:
* `show<Attrs, C>(componentClass: C<Attrs>, attrs: Attrs): void`
@ -8,9 +8,14 @@ import Modal from '../components/Modal';
* Therefore, we have to use this ugly, messy workaround.
*/
declare type UnsafeModalClass = ComponentClass<any, Modal> & {
isDismissible: boolean;
get dismissibleOptions(): IDismissibleOptions;
component: typeof Component.component;
};
declare type ModalItem = {
componentClass: UnsafeModalClass;
attrs?: Record<string, unknown>;
key: number;
};
/**
* Class used to manage modal state.
*
@ -20,21 +25,27 @@ export default class ModalManagerState {
/**
* @internal
*/
modal: null | {
componentClass: UnsafeModalClass;
attrs?: Record<string, unknown>;
key: number;
};
modal: ModalItem | null;
/**
* @internal
*/
modalList: ModalItem[];
/**
* @internal
*/
backdropShown: boolean;
/**
* Used to force re-initialization of modals if a modal
* is replaced by another of the same type.
*/
private key;
private closeTimeout?;
/**
* Shows a modal dialog.
*
* If a modal is already open, the existing one will close and the new modal will replace it.
* If `stackModal` is `true`, the modal will be shown on top of the current modal.
*
* If a value for `stackModal` is not provided, opening a new modal will close
* any others currently being shown for backwards compatibility.
*
* @example <caption>Show a modal</caption>
* app.modal.show(MyCoolModal, { attr: 'value' });
@ -42,10 +53,13 @@ export default class ModalManagerState {
* @example <caption>Show a modal from a lifecycle method (`oncreate`, `view`, etc.)</caption>
* // This "hack" is needed due to quirks with nested redraws in Mithril.
* setTimeout(() => app.modal.show(MyCoolModal, { attr: 'value' }), 0);
*
* @example <caption>Stacking modals</caption>
* app.modal.show(MyCoolStackedModal, { attr: 'value' }, true);
*/
show(componentClass: UnsafeModalClass, attrs?: Record<string, unknown>): void;
show(componentClass: UnsafeModalClass, attrs?: Record<string, unknown>, stackModal?: boolean): void;
/**
* Closes the currently open dialog, if one is open.
* Closes the topmost currently open dialog, if one is open.
*/
close(): void;
/**

2
framework/core/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
framework/core/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

@ -2596,11 +2596,6 @@ prettier@^2.4.1, prettier@^2.5.1:
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.5.1.tgz#fff75fa9d519c54cf0fce328c1017d94546bc56a"
integrity sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==
pretty-bytes@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/pretty-bytes/-/pretty-bytes-6.0.0.tgz#928be2ad1f51a2e336add8ba764739f9776a8140"
integrity sha512-6UqkYefdogmzqAZWzJ7laYeJnaXDy2/J+ZqiiMtS7t7OfpXWTlaeGMwX8U6EFvPV/YWWEKRkS8hKS4k60WHTOg==
prettier@^2.7.1:
version "2.7.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.7.1.tgz#e235806850d057f97bb08368a4f7d899f7760c64"