Bundled output for commit a53a0db2b7a79920039955322614326d9ed9aa66

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

[skip ci]
This commit is contained in:
flarum-bot 2022-12-12 09:48:42 +00:00
parent a53a0db2b7
commit 0eff1f6b2d
28 changed files with 155 additions and 64 deletions

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

View File

@ -1,5 +1,5 @@
import type Tag from '../common/models/Tag'; import type Tag from '../common/models/Tag';
import type TagListState from '../forum/states/TagListState'; import type TagListState from '../common/states/TagListState';
declare module 'flarum/forum/routes' { declare module 'flarum/forum/routes' {
export interface ForumRoutes { export interface ForumRoutes {
@ -7,8 +7,8 @@ declare module 'flarum/forum/routes' {
} }
} }
declare module 'flarum/forum/ForumApplication' { declare module 'flarum/common/Application' {
export default interface ForumApplication { export default interface Application {
tagList: TagListState; tagList: TagListState;
} }
} }

View File

@ -0,0 +1 @@
export default function (): void;

View File

@ -4,6 +4,8 @@ declare const _default: {
'tags/helpers/tagsLabel': typeof import("../common/helpers/tagsLabel").default; 'tags/helpers/tagsLabel': typeof import("../common/helpers/tagsLabel").default;
'tags/helpers/tagIcon': typeof import("../common/helpers/tagIcon").default; 'tags/helpers/tagIcon': typeof import("../common/helpers/tagIcon").default;
'tags/helpers/tagLabel': typeof import("../common/helpers/tagLabel").default; 'tags/helpers/tagLabel': typeof import("../common/helpers/tagLabel").default;
'tags/components/TagSelectionModal': typeof import("../common/components/TagSelectionModal").default;
'tags/states/TagListState': typeof import("../common/states/TagListState").default;
} & { } & {
'tags/addTagsHomePageOption': typeof addTagsHomePageOption; 'tags/addTagsHomePageOption': typeof addTagsHomePageOption;
'tags/addTagChangePermission': typeof addTagChangePermission; 'tags/addTagChangePermission': typeof addTagChangePermission;

View File

@ -0,0 +1,18 @@
/// <reference types="mithril" />
import Component from 'flarum/common/Component';
import type { CommonSettingsItemOptions } from 'flarum/admin/components/AdminPage';
import type Stream from 'flarum/common/utils/Stream';
import type { ITagSelectionModalAttrs } from '../../common/components/TagSelectionModal';
import type Tag from '../../common/models/Tag';
export interface SelectTagsSettingComponentOptions extends CommonSettingsItemOptions {
type: 'flarum-tags.select-tags';
options?: ITagSelectionModalAttrs;
}
export interface SelectTagsSettingComponentAttrs extends SelectTagsSettingComponentOptions {
settingValue: Stream<string>;
}
export default class SelectTagsSettingComponent<CustomAttrs extends SelectTagsSettingComponentAttrs = SelectTagsSettingComponentAttrs> extends Component<CustomAttrs> {
protected tags: Tag[];
protected loaded: boolean;
view(): JSX.Element;
}

View File

@ -4,6 +4,8 @@ declare const _default: {
'tags/helpers/tagsLabel': typeof tagsLabel; 'tags/helpers/tagsLabel': typeof tagsLabel;
'tags/helpers/tagIcon': typeof tagIcon; 'tags/helpers/tagIcon': typeof tagIcon;
'tags/helpers/tagLabel': typeof tagLabel; 'tags/helpers/tagLabel': typeof tagLabel;
'tags/components/TagSelectionModal': typeof TagSelectionModal;
'tags/states/TagListState': typeof TagListState;
}; };
export default _default; export default _default;
import sortTags from "./utils/sortTags"; import sortTags from "./utils/sortTags";
@ -11,3 +13,5 @@ import Tag from "./models/Tag";
import tagsLabel from "./helpers/tagsLabel"; import tagsLabel from "./helpers/tagsLabel";
import tagIcon from "./helpers/tagIcon"; import tagIcon from "./helpers/tagIcon";
import tagLabel from "./helpers/tagLabel"; import tagLabel from "./helpers/tagLabel";
import TagSelectionModal from "./components/TagSelectionModal";
import TagListState from "./states/TagListState";

View File

@ -0,0 +1,99 @@
import Modal from 'flarum/common/components/Modal';
import Stream from 'flarum/common/utils/Stream';
import type Tag from '../models/Tag';
import type { IInternalModalAttrs } from 'flarum/common/components/Modal';
import type Mithril from 'mithril';
export interface ITagSelectionModalLimits {
/** Whether to allow bypassing the limits set here. This will show a toggle button to bypass limits. */
allowBypassing?: boolean;
/** Maximum number of primary/secondary tags allowed. */
max?: {
total?: number;
primary?: number;
secondary?: number;
};
/** Minimum number of primary/secondary tags to be selected. */
min?: {
total?: number;
primary?: number;
secondary?: number;
};
}
export interface ITagSelectionModalAttrs extends IInternalModalAttrs {
/** Custom modal className to use. */
className?: string;
/** Modal title, defaults to 'Choose Tags'. */
title?: string;
/** Initial tag selection value. */
selectedTags?: Tag[];
/** Limits set based on minimum and maximum number of primary/secondary tags that can be selected. */
limits?: ITagSelectionModalLimits;
/** Whether to allow resetting the value. Defaults to true. */
allowResetting?: boolean;
/** Whether to require the parent tag of a selected tag to be selected as well. */
requireParentTag?: boolean;
/** Filter tags that can be selected. */
selectableTags?: (tags: Tag[]) => Tag[];
/** Whether a tag can be selected. */
canSelect: (tag: Tag) => boolean;
/** Callback for when a tag is selected. */
onSelect?: (tag: Tag, selected: Tag[]) => void;
/** Callback for when a tag is deselected. */
onDeselect?: (tag: Tag, selected: Tag[]) => void;
/** Callback for when the selection is submitted. */
onsubmit?: (selected: Tag[]) => void;
}
export type ITagSelectionModalState = undefined;
export default class TagSelectionModal<CustomAttrs extends ITagSelectionModalAttrs = ITagSelectionModalAttrs, CustomState extends ITagSelectionModalState = ITagSelectionModalState> extends Modal<CustomAttrs, CustomState> {
protected loading: boolean;
protected tags: Tag[];
protected selected: Tag[];
protected bypassReqs: boolean;
protected filter: Stream<string>;
protected focused: boolean;
protected navigator: any;
protected indexTag?: Tag;
static initAttrs(attrs: ITagSelectionModalAttrs): void;
oninit(vnode: Mithril.Vnode<CustomAttrs, this>): void;
className(): string;
title(): any;
content(): JSX.Element | JSX.Element[];
/**
* Filters the available tags on every state change.
*/
private getFilteredTags;
/**
* Counts the number of selected primary tags.
*/
protected primaryCount(): number;
/**
* Counts the number of selected secondary tags.
*/
protected secondaryCount(): number;
/**
* Validates the number of selected primary/secondary tags against the set min max limits.
*/
protected meetsRequirements(primaryCount: number, secondaryCount: number): boolean;
/**
* Add the given tag to the list of selected tags.
*/
protected addTag(tag: Tag | undefined): void;
/**
* Remove the given tag from the list of selected tags.
*/
protected removeTag(tag: Tag): void;
protected toggleTag(tag: Tag): void;
/**
* Gives human text instructions based on the current number of selected tags and set limits.
*/
protected getInstruction(primaryCount: number, secondaryCount: number): string;
/**
* Submit tag selection.
*/
onsubmit(e: SubmitEvent): void;
protected select(e: KeyboardEvent): void;
protected selectableItems(): any;
protected getCurrentNumericIndex(): any;
protected getItem(selectedTag: Tag): any;
protected setIndex(index: number, scrollToItem: boolean): void;
}

View File

@ -4,6 +4,8 @@ declare const _default: {
'tags/helpers/tagsLabel': typeof import("../common/helpers/tagsLabel").default; 'tags/helpers/tagsLabel': typeof import("../common/helpers/tagsLabel").default;
'tags/helpers/tagIcon': typeof import("../common/helpers/tagIcon").default; 'tags/helpers/tagIcon': typeof import("../common/helpers/tagIcon").default;
'tags/helpers/tagLabel': typeof import("../common/helpers/tagLabel").default; 'tags/helpers/tagLabel': typeof import("../common/helpers/tagLabel").default;
'tags/components/TagSelectionModal': typeof import("../common/components/TagSelectionModal").default;
'tags/states/TagListState': typeof import("../common/states/TagListState").default;
} & { } & {
'tags/addTagFilter': typeof addTagFilter; 'tags/addTagFilter': typeof addTagFilter;
'tags/addTagControl': typeof addTagControl; 'tags/addTagControl': typeof addTagControl;

View File

@ -1,49 +1,8 @@
/// <reference types="flarum/@types/translator-icu-rich" /> import TagSelectionModal, { ITagSelectionModalAttrs } from '../../common/components/TagSelectionModal';
import type Mithril from 'mithril'; import type Discussion from 'flarum/common/models/Discussion';
import Modal, { IInternalModalAttrs } from 'flarum/common/components/Modal'; export interface TagDiscussionModalAttrs extends ITagSelectionModalAttrs {
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 {
discussion?: Discussion; discussion?: Discussion;
selectedTags?: Tag[];
onsubmit?: (tags: Tag[]) => {};
} }
export default class TagDiscussionModal extends Modal<TagDiscussionModalAttrs> { export default class TagDiscussionModal extends TagSelectionModal<TagDiscussionModalAttrs> {
tagsLoading: boolean; static initAttrs(attrs: TagDiscussionModalAttrs): void;
selected: Tag[];
filter: Stream<string>;
focused: boolean;
minPrimary: number;
maxPrimary: number;
minSecondary: number;
maxSecondary: number;
bypassReqs: boolean;
navigator: KeyboardNavigatable;
tags?: Tag[];
selectedTag?: Tag;
oninit(vnode: Mithril.Vnode<TagDiscussionModalAttrs, this>): void;
primaryCount(): number;
secondaryCount(): number;
/**
* Add the given tag to the list of selected tags.
*/
addTag(tag: Tag): void;
/**
* Remove the given tag from the list of selected tags.
*/
removeTag(tag: Tag): void;
className(): string;
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(): JQuery<HTMLElement>;
getCurrentNumericIndex(): number;
getItem(selectedTag: Tag): JQuery<HTMLElement>;
setIndex(index: number, scrollToItem: boolean): void;
onsubmit(e: SubmitEvent): void;
} }

2
extensions/tags/js/dist/admin.js generated vendored

File diff suppressed because one or more lines are too long

View File

@ -1,3 +1,5 @@
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
/**! /**!
* Sortable 1.15.0 * Sortable 1.15.0
* @author RubaXa <trash@rubaxa.org> * @author RubaXa <trash@rubaxa.org>

File diff suppressed because one or more lines are too long

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

@ -46,6 +46,7 @@ declare const _default: {
one(event: string, handler: Function): void; one(event: string, handler: Function): void;
off(event: string, handler: Function): void; off(event: string, handler: Function): void;
}; };
'utils/KeyboardNavigatable': typeof import("../common/utils/KeyboardNavigatable").default;
'utils/liveHumanTimes': typeof import("../common/utils/liveHumanTimes").default; 'utils/liveHumanTimes': typeof import("../common/utils/liveHumanTimes").default;
'utils/ItemList': typeof import("../common/utils/ItemList").default; 'utils/ItemList': typeof import("../common/utils/ItemList").default;
'utils/mixin': typeof import("../common/utils/mixin").default; 'utils/mixin': typeof import("../common/utils/mixin").default;

View File

@ -1,6 +1,7 @@
import Session from './Session'; import Session from './Session';
import Store from './Store'; import Store from './Store';
import BasicEditorDriver from './utils/BasicEditorDriver'; import BasicEditorDriver from './utils/BasicEditorDriver';
import KeyboardNavigatable from './utils/KeyboardNavigatable';
import liveHumanTimes from './utils/liveHumanTimes'; import liveHumanTimes from './utils/liveHumanTimes';
import ItemList from './utils/ItemList'; import ItemList from './utils/ItemList';
import mixin from './utils/mixin'; import mixin from './utils/mixin';
@ -95,6 +96,7 @@ declare const _default: {
one(event: string, handler: Function): void; one(event: string, handler: Function): void;
off(event: string, handler: Function): void; off(event: string, handler: Function): void;
}; };
'utils/KeyboardNavigatable': typeof KeyboardNavigatable;
'utils/liveHumanTimes': typeof liveHumanTimes; 'utils/liveHumanTimes': typeof liveHumanTimes;
'utils/ItemList': typeof ItemList; 'utils/ItemList': typeof ItemList;
'utils/mixin': typeof mixin; 'utils/mixin': typeof mixin;

View File

@ -22,7 +22,7 @@ export interface IDismissibleOptions {
* The `Modal` component displays a modal dialog, wrapped in a form. Subclasses * The `Modal` component displays a modal dialog, wrapped in a form. Subclasses
* should implement the `className`, `title`, and `content` methods. * should implement the `className`, `title`, and `content` methods.
*/ */
export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IInternalModalAttrs> extends Component<ModalAttrs> { export default abstract class Modal<ModalAttrs extends IInternalModalAttrs = IInternalModalAttrs, CustomState = undefined> extends Component<ModalAttrs, CustomState> {
/** /**
* Determine whether or not the modal should be dismissible via an 'x' button. * Determine whether or not the modal should be dismissible via an 'x' button.
* *

View File

@ -1,5 +1,5 @@
/// <reference types="mithril" /> /// <reference types="mithril" />
import KeyboardNavigatable from './utils/KeyboardNavigatable'; import KeyboardNavigatable from '../common/utils/KeyboardNavigatable';
import slidable from './utils/slidable'; import slidable from './utils/slidable';
import History from './utils/History'; import History from './utils/History';
import alertEmailConfirmation from './utils/alertEmailConfirmation'; import alertEmailConfirmation from './utils/alertEmailConfirmation';
@ -82,6 +82,7 @@ declare const _default: {
one(event: string, handler: Function): void; one(event: string, handler: Function): void;
off(event: string, handler: Function): void; off(event: string, handler: Function): void;
}; };
'utils/KeyboardNavigatable': typeof KeyboardNavigatable;
'utils/liveHumanTimes': typeof import("../common/utils/liveHumanTimes").default; 'utils/liveHumanTimes': typeof import("../common/utils/liveHumanTimes").default;
'utils/ItemList': typeof import("../common/utils/ItemList").default; 'utils/ItemList': typeof import("../common/utils/ItemList").default;
'utils/mixin': typeof import("../common/utils/mixin").default; 'utils/mixin': typeof import("../common/utils/mixin").default;

View File

@ -1,6 +1,6 @@
import Component, { ComponentAttrs } from '../../common/Component'; import Component, { ComponentAttrs } from '../../common/Component';
import ItemList from '../../common/utils/ItemList'; import ItemList from '../../common/utils/ItemList';
import KeyboardNavigatable from '../utils/KeyboardNavigatable'; import KeyboardNavigatable from '../../common/utils/KeyboardNavigatable';
import SearchState from '../states/SearchState'; import SearchState from '../states/SearchState';
import type Mithril from 'mithril'; import type Mithril from 'mithril';
/** /**

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