Bundled output for commit d7f4975330eb5cbd5c09bc812db957689e245ce5

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

[skip ci]
This commit is contained in:
flarum-bot 2023-01-17 18:15:45 +00:00
parent d7f4975330
commit 6adae00f72
35 changed files with 90 additions and 51 deletions

2
extensions/flags/js/dist-typings/forum/extend.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
declare const _default: any[];
export default _default;

View File

@ -1 +1 @@
export {};
export { default as extend } from './extend';

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

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

2
extensions/lock/js/dist/forum.js generated vendored
View File

@ -1,2 +1,2 @@
(()=>{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var c in n)o.o(n,c)&&!o.o(t,c)&&Object.defineProperty(t,c,{enumerable:!0,get:n[c]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t);const n=flarum.core.compat["common/extend"],c=flarum.core.compat["forum/app"];var r=o.n(c);const e=flarum.core.compat["common/Model"];var s=o.n(e);const a=flarum.core.compat["common/models/Discussion"];var i=o.n(a);const u=flarum.core.compat["forum/components/NotificationGrid"];var l=o.n(u);function f(o,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},f(o,t)}function p(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,f(o,t)}const d=flarum.core.compat["forum/components/EventPost"];var k=function(o){function t(){return o.apply(this,arguments)||this}p(t,o);var n=t.prototype;return n.icon=function(){return this.attrs.post.content().locked?"fas fa-lock":"fas fa-unlock"},n.descriptionKey=function(){return this.attrs.post.content().locked?"flarum-lock.forum.post_stream.discussion_locked_text":"flarum-lock.forum.post_stream.discussion_unlocked_text"},t}(o.n(d)());const y=flarum.core.compat["forum/components/Notification"];var b=function(o){function t(){return o.apply(this,arguments)||this}p(t,o);var n=t.prototype;return n.icon=function(){return"fas fa-lock"},n.href=function(){var o=this.attrs.notification;return r().route.discussion(o.subject(),o.content().postNumber)},n.content=function(){return r().translator.trans("flarum-lock.forum.notifications.discussion_locked_text",{user:this.attrs.notification.fromUser()})},t}(o.n(y)());const _=flarum.core.compat["common/components/Badge"];var v=o.n(_);const h=flarum.core.compat["forum/utils/DiscussionControls"];var L=o.n(h);const g=flarum.core.compat["forum/components/DiscussionPage"];var O=o.n(g);const j=flarum.core.compat["common/components/Button"];var x=o.n(j);r().initializers.add("flarum-lock",(function(){r().postComponents.discussionLocked=k,r().notificationComponents.discussionLocked=b,i().prototype.isLocked=s().attribute("isLocked"),i().prototype.canLock=s().attribute("canLock"),(0,n.extend)(i().prototype,"badges",(function(o){this.isLocked()&&o.add("locked",v().component({type:"locked",label:r().translator.trans("flarum-lock.forum.badge.locked_tooltip"),icon:"fas fa-lock"}))})),(0,n.extend)(L(),"moderationControls",(function(o,t){t.canLock()&&o.add("lock",x().component({icon:"fas fa-lock",onclick:this.lockAction.bind(t)},r().translator.trans(t.isLocked()?"flarum-lock.forum.discussion_controls.unlock_button":"flarum-lock.forum.discussion_controls.lock_button")))})),L().lockAction=function(){this.save({isLocked:!this.isLocked()}).then((function(){r().current.matches(O())&&r().current.get("stream").update(),m.redraw()}))},(0,n.extend)(l().prototype,"notificationTypes",(function(o){o.add("discussionLocked",{name:"discussionLocked",icon:"fas fa-lock",label:r().translator.trans("flarum-lock.forum.settings.notify_discussion_locked_label")})}))}))})(),module.exports=t})();
(()=>{var o={n:t=>{var n=t&&t.__esModule?()=>t.default:()=>t;return o.d(n,{a:n}),n},d:(t,n)=>{for(var c in n)o.o(n,c)&&!o.o(t,c)&&Object.defineProperty(t,c,{enumerable:!0,get:n[c]})},o:(o,t)=>Object.prototype.hasOwnProperty.call(o,t),r:o=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(o,"__esModule",{value:!0})}},t={};(()=>{"use strict";o.r(t),o.d(t,{extend:()=>M});const n=flarum.core.compat["common/extend"],c=flarum.core.compat["forum/app"];var e=o.n(c);const r=flarum.core.compat["common/Model"];var s=o.n(r);const a=flarum.core.compat["common/models/Discussion"];var i=o.n(a);const u=flarum.core.compat["forum/components/NotificationGrid"];var l=o.n(u);function f(o,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,t){return o.__proto__=t,o},f(o,t)}function d(o,t){o.prototype=Object.create(t.prototype),o.prototype.constructor=o,f(o,t)}const p=flarum.core.compat["forum/components/Notification"];var k=function(o){function t(){return o.apply(this,arguments)||this}d(t,o);var n=t.prototype;return n.icon=function(){return"fas fa-lock"},n.href=function(){var o=this.attrs.notification;return e().route.discussion(o.subject(),o.content().postNumber)},n.content=function(){return e().translator.trans("flarum-lock.forum.notifications.discussion_locked_text",{user:this.attrs.notification.fromUser()})},t}(o.n(p)());const y=flarum.core.compat["common/components/Badge"];var b=o.n(y);const _=flarum.core.compat["forum/utils/DiscussionControls"];var v=o.n(_);const h=flarum.core.compat["forum/components/DiscussionPage"];var L=o.n(h);const g=flarum.core.compat["common/components/Button"];var x=o.n(g);const O=flarum.core.compat["common/extenders"];var P=o.n(O);const j=flarum.core.compat["forum/components/EventPost"];var S=function(o){function t(){return o.apply(this,arguments)||this}d(t,o);var n=t.prototype;return n.icon=function(){return this.attrs.post.content().locked?"fas fa-lock":"fas fa-unlock"},n.descriptionKey=function(){return this.attrs.post.content().locked?"flarum-lock.forum.post_stream.discussion_locked_text":"flarum-lock.forum.post_stream.discussion_unlocked_text"},t}(o.n(j)());const M=[(new(P().PostTypes)).add("discussionLocked",S)];e().initializers.add("flarum-lock",(function(){e().notificationComponents.discussionLocked=k,i().prototype.isLocked=s().attribute("isLocked"),i().prototype.canLock=s().attribute("canLock"),(0,n.extend)(i().prototype,"badges",(function(o){this.isLocked()&&o.add("locked",b().component({type:"locked",label:e().translator.trans("flarum-lock.forum.badge.locked_tooltip"),icon:"fas fa-lock"}))})),(0,n.extend)(v(),"moderationControls",(function(o,t){t.canLock()&&o.add("lock",x().component({icon:"fas fa-lock",onclick:this.lockAction.bind(t)},e().translator.trans(t.isLocked()?"flarum-lock.forum.discussion_controls.unlock_button":"flarum-lock.forum.discussion_controls.lock_button")))})),v().lockAction=function(){this.save({isLocked:!this.isLocked()}).then((function(){e().current.matches(L())&&e().current.get("stream").update(),m.redraw()}))},(0,n.extend)(l().prototype,"notificationTypes",(function(o){o.add("discussionLocked",{name:"discussionLocked",icon:"fas fa-lock",label:e().translator.trans("flarum-lock.forum.settings.notify_discussion_locked_label")})}))}))})(),module.exports=t})();
//# sourceMappingURL=forum.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

2
extensions/sticky/js/dist/forum.js generated vendored
View File

@ -1,2 +1,2 @@
(()=>{var t={n:o=>{var s=o&&o.__esModule?()=>o.default:()=>o;return t.d(s,{a:s}),s},d:(o,s)=>{for(var n in s)t.o(s,n)&&!t.o(o,n)&&Object.defineProperty(o,n,{enumerable:!0,get:s[n]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o);const s=flarum.core.compat["forum/app"];var n=t.n(s);const c=flarum.core.compat["common/Model"];var r=t.n(c);const e=flarum.core.compat["common/models/Discussion"];var i=t.n(e);function a(t,o){return a=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},a(t,o)}const u=flarum.core.compat["forum/components/EventPost"];var p=function(t){var o,s;function n(){return t.apply(this,arguments)||this}s=t,(o=n).prototype=Object.create(s.prototype),o.prototype.constructor=o,a(o,s);var c=n.prototype;return c.icon=function(){return"fas fa-thumbtack"},c.descriptionKey=function(){return this.attrs.post.content().sticky?"flarum-sticky.forum.post_stream.discussion_stickied_text":"flarum-sticky.forum.post_stream.discussion_unstickied_text"},n}(t.n(u)());const f=flarum.core.compat["common/extend"],l=flarum.core.compat["common/components/Badge"];var d=t.n(l);const y=flarum.core.compat["forum/utils/DiscussionControls"];var k=t.n(y);const v=flarum.core.compat["forum/components/DiscussionPage"];var b=t.n(v);const h=flarum.core.compat["common/components/Button"];var _=t.n(h);const S=flarum.core.compat["forum/states/DiscussionListState"];var P=t.n(S);const g=flarum.core.compat["forum/components/DiscussionListItem"];var x=t.n(g);const O=flarum.core.compat["forum/components/IndexPage"];var j=t.n(O);const D=flarum.core.compat["common/utils/string"],I=flarum.core.compat["common/utils/classList"];var L=t.n(I);n().initializers.add("flarum-sticky",(function(){n().postComponents.discussionStickied=p,i().prototype.isSticky=r().attribute("isSticky"),i().prototype.canSticky=r().attribute("canSticky"),(0,f.extend)(i().prototype,"badges",(function(t){this.isSticky()&&t.add("sticky",d().component({type:"sticky",label:n().translator.trans("flarum-sticky.forum.badge.sticky_tooltip"),icon:"fas fa-thumbtack"}),10)})),(0,f.extend)(k(),"moderationControls",(function(t,o){o.canSticky()&&t.add("sticky",_().component({icon:"fas fa-thumbtack",onclick:this.stickyAction.bind(o)},n().translator.trans(o.isSticky()?"flarum-sticky.forum.discussion_controls.unsticky_button":"flarum-sticky.forum.discussion_controls.sticky_button")))})),k().stickyAction=function(){this.save({isSticky:!this.isSticky()}).then((function(){n().current.matches(b())&&n().current.get("stream").update(),m.redraw()}))},(0,f.extend)(P().prototype,"requestParams",(function(t){(n().current.matches(j())||n().current.matches(b()))&&t.include.push("firstPost")})),(0,f.extend)(x().prototype,"infoItems",(function(t){var o=this.attrs.discussion;if(o.isSticky()&&!this.attrs.params.q&&!o.lastReadPostNumber()){var s=o.firstPost();if(s){var n=(0,D.truncate)(s.contentPlain(),175);t.add("excerpt",m("div",null,n),-100)}}})),(0,f.extend)(x().prototype,"elementAttrs",(function(t){this.attrs.discussion.isSticky()&&(t.className=L()(t.className,"DiscussionListItem--sticky"))}))}))})(),module.exports=o})();
(()=>{var t={n:o=>{var n=o&&o.__esModule?()=>o.default:()=>o;return t.d(n,{a:n}),n},d:(o,n)=>{for(var s in n)t.o(n,s)&&!t.o(o,s)&&Object.defineProperty(o,s,{enumerable:!0,get:n[s]})},o:(t,o)=>Object.prototype.hasOwnProperty.call(t,o),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},o={};(()=>{"use strict";t.r(o),t.d(o,{extend:()=>A});const n=flarum.core.compat["forum/app"];var s=t.n(n);const c=flarum.core.compat["common/Model"];var r=t.n(c);const e=flarum.core.compat["common/models/Discussion"];var i=t.n(e);const a=flarum.core.compat["common/extend"],u=flarum.core.compat["common/components/Badge"];var p=t.n(u);const f=flarum.core.compat["forum/utils/DiscussionControls"];var l=t.n(f);const d=flarum.core.compat["forum/components/DiscussionPage"];var y=t.n(d);const k=flarum.core.compat["common/components/Button"];var v=t.n(k);const b=flarum.core.compat["forum/states/DiscussionListState"];var h=t.n(b);const _=flarum.core.compat["forum/components/DiscussionListItem"];var S=t.n(_);const P=flarum.core.compat["forum/components/IndexPage"];var x=t.n(P);const g=flarum.core.compat["common/utils/string"],O=flarum.core.compat["common/utils/classList"];var j=t.n(O);const D=flarum.core.compat["common/extenders"];var I=t.n(D);function L(t,o){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,o){return t.__proto__=o,t},L(t,o)}const M=flarum.core.compat["forum/components/EventPost"];var w=function(t){var o,n;function s(){return t.apply(this,arguments)||this}n=t,(o=s).prototype=Object.create(n.prototype),o.prototype.constructor=o,L(o,n);var c=s.prototype;return c.icon=function(){return"fas fa-thumbtack"},c.descriptionKey=function(){return this.attrs.post.content().sticky?"flarum-sticky.forum.post_stream.discussion_stickied_text":"flarum-sticky.forum.post_stream.discussion_unstickied_text"},s}(t.n(M)());const A=[(new(I().PostTypes)).add("discussionStickied",w)];s().initializers.add("flarum-sticky",(function(){i().prototype.isSticky=r().attribute("isSticky"),i().prototype.canSticky=r().attribute("canSticky"),(0,a.extend)(i().prototype,"badges",(function(t){this.isSticky()&&t.add("sticky",p().component({type:"sticky",label:s().translator.trans("flarum-sticky.forum.badge.sticky_tooltip"),icon:"fas fa-thumbtack"}),10)})),(0,a.extend)(l(),"moderationControls",(function(t,o){o.canSticky()&&t.add("sticky",v().component({icon:"fas fa-thumbtack",onclick:this.stickyAction.bind(o)},s().translator.trans(o.isSticky()?"flarum-sticky.forum.discussion_controls.unsticky_button":"flarum-sticky.forum.discussion_controls.sticky_button")))})),l().stickyAction=function(){this.save({isSticky:!this.isSticky()}).then((function(){s().current.matches(y())&&s().current.get("stream").update(),m.redraw()}))},(0,a.extend)(h().prototype,"requestParams",(function(t){(s().current.matches(x())||s().current.matches(y()))&&t.include.push("firstPost")})),(0,a.extend)(S().prototype,"infoItems",(function(t){var o=this.attrs.discussion;if(o.isSticky()&&!this.attrs.params.q&&!o.lastReadPostNumber()){var n=o.firstPost();if(n){var s=(0,g.truncate)(n.contentPlain(),175);t.add("excerpt",m("div",null,s),-100)}}})),(0,a.extend)(S().prototype,"elementAttrs",(function(t){this.attrs.discussion.isSticky()&&(t.className=j()(t.className,"DiscussionListItem--sticky"))}))}))})(),module.exports=o})();
//# sourceMappingURL=forum.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

2
extensions/tags/js/dist-typings/forum/extend.d.ts generated vendored Normal file
View File

@ -0,0 +1,2 @@
declare const _default: any[];
export default _default;

View File

@ -1 +1 @@
export {};
export { default as extend } from './extend';

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

@ -34,7 +34,11 @@ import routes from './routes';
import AdminApplication from './AdminApplication';
import generateElementId from './utils/generateElementId';
declare const _default: {
extend: any;
extenders: {
PostTypes: typeof import("../common/extenders/PostTypes").default;
Routes: typeof import("../common/extenders/Routes").default;
};
extend: typeof import("../common/extend");
Session: typeof import("../common/Session").default;
Store: typeof import("../common/Store").default;
'utils/BasicEditorDriver': typeof import("../common/utils/BasicEditorDriver").default;

View File

@ -14,6 +14,7 @@ import type Component from './Component';
import type { ComponentAttrs } from './Component';
import Model, { SavedModelData } from './Model';
import IHistory from './IHistory';
import IExtender from './extenders/IExtender';
export type FlarumScreens = 'phone' | 'tablet' | 'desktop' | 'desktop-hd';
export type FlarumGenericRoute = RouteItem<any, any, any>;
export interface FlarumRequestOptions<ResponseType> extends Omit<Mithril.RequestOptions<ResponseType>, 'extract'> {
@ -196,7 +197,7 @@ export default class Application {
load(payload: Application['data']): void;
boot(): void;
bootExtensions(extensions: Record<string, {
extend?: unknown[];
extend?: IExtender[];
}>): void;
protected mount(basePath?: string): void;
/**

View File

@ -1,3 +1,4 @@
import * as extend from './extend';
import Session from './Session';
import Store from './Store';
import BasicEditorDriver from './utils/BasicEditorDriver';
@ -84,7 +85,11 @@ import AlertManagerState from './states/AlertManagerState';
import ModalManagerState from './states/ModalManagerState';
import PageState from './states/PageState';
declare const _default: {
extend: any;
extenders: {
PostTypes: typeof import("./extenders/PostTypes").default;
Routes: typeof import("./extenders/Routes").default;
};
extend: typeof extend;
Session: typeof Session;
Store: typeof Store;
'utils/BasicEditorDriver': typeof BasicEditorDriver;

View File

@ -1,12 +0,0 @@
export default class Model {
constructor(type: any, model?: null);
type: any;
attributes: any[];
hasOnes: any[];
hasManys: any[];
model: any;
attribute(name: any): Model;
hasOne(type: any): Model;
hasMany(type: any): Model;
extend(app: any, extension: any): void;
}

View File

@ -1,5 +0,0 @@
export default class PostTypes {
postComponents: {};
add(name: any, component: any): PostTypes;
extend(app: any, extension: any): void;
}

View File

@ -1,5 +0,0 @@
export default class Routes {
routes: {};
add(name: any, path: any, component: any): Routes;
extend(app: any, extension: any): void;
}

View File

@ -1,3 +0,0 @@
export { default as Model } from "./Model";
export { default as PostTypes } from "./PostTypes";
export { default as Routes } from "./Routes";

View File

@ -0,0 +1,8 @@
import Application from '../Application';
export interface IExtensionModule {
name: string;
exports: unknown;
}
export default interface IExtender {
extend(app: Application, extension: IExtensionModule): void;
}

View File

@ -0,0 +1,14 @@
import IExtender, { IExtensionModule } from './IExtender';
import Application from '../Application';
export default class PostTypes implements IExtender {
private postComponents;
/**
* Register a new post component type.
* Usually used for event posts.
*
* @param name The name of the post type.
* @param component The component class to render the post.
*/
add(name: string, component: any): PostTypes;
extend(app: Application, extension: IExtensionModule): void;
}

View File

@ -0,0 +1,18 @@
import Application from '../Application';
import IExtender, { IExtensionModule } from './IExtender';
type HelperRoute = (...args: any) => string;
export default class Routes implements IExtender {
private routes;
private helpers;
/**
* Add a mithril route to the application.
*
* @param name The name of the route.
* @param path The path of the route.
* @param component must extend `Page` component.
*/
add(name: string, path: `/${string}`, component: any): Routes;
helper(name: string, callback: HelperRoute): Routes;
extend(app: Application, extension: IExtensionModule): void;
}
export {};

View File

@ -0,0 +1,7 @@
import PostTypes from './PostTypes';
import Routes from './Routes';
declare const _default: {
PostTypes: typeof PostTypes;
Routes: typeof Routes;
};
export default _default;

View File

@ -6,7 +6,6 @@ import 'bootstrap/js/dropdown';
import 'bootstrap/js/tooltip';
import 'bootstrap/js/transition';
import 'jquery.hotkeys/jquery.hotkeys';
import * as Extend from './extend/index';
import app from './app';
export { Extend, app };
export { app };
import './utils/arrayFlatPolyfill';

View File

@ -70,7 +70,11 @@ import routes from './routes';
import ForumApplication from './ForumApplication';
import isSafariMobile from './utils/isSafariMobile';
declare const _default: {
extend: any;
extenders: {
PostTypes: typeof import("../common/extenders/PostTypes").default;
Routes: typeof import("../common/extenders/Routes").default;
};
extend: typeof import("../common/extend");
Session: typeof import("../common/Session").default;
Store: typeof import("../common/Store").default;
'utils/BasicEditorDriver': typeof BasicEditorDriver;

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