Bundled output for commit 5097620b6e

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

[skip ci]
This commit is contained in:
flarum-bot 2021-08-19 09:13:22 +00:00
parent 5097620b6e
commit 1b2a6c7e99
26 changed files with 117 additions and 81 deletions

View File

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

View File

@ -1,53 +0,0 @@
// Mithril
import Mithril from 'mithril';
// Other third-party libs
import * as _dayjs from 'dayjs';
import 'dayjs/plugin/relativeTime';
import * as _$ from 'jquery';
// Globals from flarum/core
import Application from '../../src/common/Application';
import type { TooltipJQueryFunction } from '../tooltips';
/**
* flarum/core exposes several extensions globally:
*
* - jQuery for convenient DOM manipulation
* - Mithril for VDOM and components
* - dayjs for date/time operations
*
* Since these are already part of the global namespace, extensions won't need
* to (and should not) bundle these themselves.
*/
declare global {
// $ is already defined by `@types/jquery`
const m: Mithril.Static;
const dayjs: typeof _dayjs;
// Extend JQuery with our custom functions, defined with $.fn
interface JQuery {
tooltip: TooltipJQueryFunction;
}
/**
* For more info, see: https://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
*
* In a nutshell, we need to add `ElementAttributesProperty` to tell Typescript
* what property on component classes to look at for attribute typings. For our
* Component class, this would be `attrs` (e.g. `this.attrs...`)
*/
namespace JSX {
interface ElementAttributesProperty {
attrs: Record<string, unknown>;
}
}
}
/**
* All global variables owned by flarum/core.
*/
declare global {
const app: Application;
}

View File

@ -1,4 +1,4 @@
import * as Mithril from 'mithril';
import type Mithril from 'mithril';
export interface ComponentAttrs extends Mithril.Attributes {
}
/**

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

6
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

8
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