Bundled output for commit b91caec30b

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

[skip ci]
This commit is contained in:
flarum-bot 2024-06-22 07:08:06 +00:00
parent b91caec30b
commit d52068cf5b
13 changed files with 66 additions and 6 deletions

View File

@ -27,10 +27,16 @@ export declare type Extension = {
extra: { extra: {
'flarum-extension': { 'flarum-extension': {
title: string; title: string;
'database-support': undefined | string[];
}; };
}; };
require?: Record<string, string>; require?: Record<string, string>;
}; };
export declare enum DatabaseDriver {
MySQL = "MySQL",
PostgreSQL = "PostgreSQL",
SQLite = "SQLite"
}
export interface AdminApplicationData extends ApplicationData { export interface AdminApplicationData extends ApplicationData {
extensions: Record<string, Extension>; extensions: Record<string, Extension>;
settings: Record<string, string>; settings: Record<string, string>;
@ -44,6 +50,13 @@ export interface AdminApplicationData extends ApplicationData {
maintenanceByConfig: boolean; maintenanceByConfig: boolean;
safeModeExtensions?: string[] | null; safeModeExtensions?: string[] | null;
safeModeExtensionsConfig?: string[] | null; safeModeExtensionsConfig?: string[] | null;
dbDriver: DatabaseDriver;
dbVersion: string;
dbOptions: Record<string, string>;
phpVersion: string;
queueDriver: string;
schedulerStatus: string;
sessionDriver: string;
} }
export default class AdminApplication extends Application { export default class AdminApplication extends Application {
extensionData: ExtensionData; extensionData: ExtensionData;

View File

@ -18,4 +18,5 @@ export default class AdvancedPage<CustomAttrs extends IPageAttrs = IPageAttrs> e
sectionItems(): ItemList<Mithril.Children>; sectionItems(): ItemList<Mithril.Children>;
searchDrivers(): JSX.Element; searchDrivers(): JSX.Element;
maintenance(): JSX.Element; maintenance(): JSX.Element;
pgsqlSettings(): JSX.Element;
} }

View File

@ -16,6 +16,7 @@ import Model, { SavedModelData } from './Model';
import IHistory from './IHistory'; import IHistory from './IHistory';
import IExtender from './extenders/IExtender'; import IExtender from './extenders/IExtender';
import SearchManager from './SearchManager'; import SearchManager from './SearchManager';
import { ColorScheme } from './components/ThemeMode';
export declare type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd'; export declare type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd';
export declare type FlarumGenericRoute = RouteItem<any, any, any>; export declare type FlarumGenericRoute = RouteItem<any, any, any>;
export interface FlarumRequestOptions<ResponseType> extends Omit<Mithril.RequestOptions<ResponseType>, 'extract'> { export interface FlarumRequestOptions<ResponseType> extends Omit<Mithril.RequestOptions<ResponseType>, 'extract'> {
@ -190,6 +191,7 @@ export default class Application {
history: IHistory | null; history: IHistory | null;
pane: any; pane: any;
data: ApplicationData; data: ApplicationData;
allowUserColorScheme: boolean;
private _title; private _title;
private _titleCount; private _titleCount;
private set title(value); private set title(value);
@ -208,6 +210,11 @@ export default class Application {
extend?: IExtender[]; extend?: IExtender[];
}>): void; }>): void;
protected mount(basePath?: string): void; protected mount(basePath?: string): void;
private initColorScheme;
getSystemColorSchemePreference(): ColorScheme | string;
watchSystemColorSchemePreference(callback: () => void): void;
setColorScheme(scheme: ColorScheme | string): void;
setColoredHeader(value: boolean): void;
/** /**
* Get the API response document that has been preloaded into the application. * Get the API response document that has been preloaded into the application.
*/ */

View File

@ -0,0 +1,23 @@
import Component, { type ComponentAttrs } from '../../common/Component';
import type Mithril from 'mithril';
export interface IThemeModeAttrs extends ComponentAttrs {
label: string;
mode: string;
selected?: boolean;
alternate?: boolean;
}
export declare enum ColorScheme {
Auto = "auto",
Light = "light",
Dark = "dark",
LightHighContrast = "light-hc",
DarkHighContrast = "dark-hc"
}
export declare type ColorSchemeData = {
id: ColorScheme | string;
label?: string | null;
};
export default class ThemeMode<CustomAttrs extends IThemeModeAttrs = IThemeModeAttrs> extends Component<CustomAttrs> {
static colorSchemes: ColorSchemeData[];
view(vnode: Mithril.Vnode<CustomAttrs, this>): Mithril.Children;
}

View File

@ -0,0 +1,7 @@
import Application from '../Application';
import IExtender, { IExtensionModule } from './IExtender';
export default class ThemeMode implements IExtender {
private readonly colorSchemes;
add(mode: string, label: string): this;
extend(app: Application, extension: IExtensionModule): void;
}

View File

@ -4,6 +4,7 @@ import Routes from './Routes';
import Store from './Store'; import Store from './Store';
import Search from './Search'; import Search from './Search';
import Notification from './Notification'; import Notification from './Notification';
import ThemeMode from './ThemeMode';
declare const extenders: { declare const extenders: {
Model: typeof Model; Model: typeof Model;
PostTypes: typeof PostTypes; PostTypes: typeof PostTypes;
@ -11,5 +12,6 @@ declare const extenders: {
Store: typeof Store; Store: typeof Store;
Search: typeof Search; Search: typeof Search;
Notification: typeof Notification; Notification: typeof Notification;
ThemeMode: typeof ThemeMode;
}; };
export default extenders; export default extenders;

View File

@ -1,14 +1,17 @@
import UserPage, { IUserPageAttrs } from './UserPage'; import UserPage, { IUserPageAttrs } from './UserPage';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import type Mithril from 'mithril'; import type Mithril from 'mithril';
import { ComponentAttrs } from '../../common/Component';
/** /**
* The `SettingsPage` component displays the user's settings control panel, in * The `SettingsPage` component displays the user's settings control panel, in
* the context of their user profile. * the context of their user profile.
*/ */
export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPageAttrs> extends UserPage<CustomAttrs> { export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPageAttrs> extends UserPage<CustomAttrs> {
discloseOnlineLoading?: boolean; discloseOnlineLoading?: boolean;
colorSchemeLoading?: boolean;
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void; oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
content(): JSX.Element; content(): JSX.Element;
sectionProps(): Record<string, ComponentAttrs>;
/** /**
* Build an item list for the user's settings controls. * Build an item list for the user's settings controls.
*/ */
@ -25,4 +28,8 @@ export default class SettingsPage<CustomAttrs extends IUserPageAttrs = IUserPage
* Build an item list for the user's privacy settings. * Build an item list for the user's privacy settings.
*/ */
privacyItems(): ItemList<Mithril.Children>; privacyItems(): ItemList<Mithril.Children>;
/**
* Color schemes.
*/
colorSchemeItems(): ItemList<Mithril.Children>;
} }

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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long