From 3787cc413ef7bff6b4966c3d1cb036190fe163eb Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 7 May 2015 22:26:02 +0930 Subject: [PATCH 001/183] Initial commit --- extensions/sticky/.gitignore | 4 ++ extensions/sticky/LICENSE.txt | 21 ++++++ extensions/sticky/bootstrap.php | 9 +++ extensions/sticky/composer.json | 19 ++++++ extensions/sticky/extension.json | 15 +++++ extensions/sticky/js/.gitignore | 4 ++ extensions/sticky/js/Gulpfile.js | 45 +++++++++++++ extensions/sticky/js/bootstrap.js | 60 +++++++++++++++++ extensions/sticky/js/package.json | 18 +++++ .../notification-discussion-stickied.js | 21 ++++++ .../components/post-discussion-stickied.js | 9 +++ extensions/sticky/less/sticky.less | 8 +++ ...02_24_000000_add_sticky_to_discussions.php | 31 +++++++++ .../src/DiscussionStickiedNotification.php | 39 +++++++++++ .../sticky/src/DiscussionStickiedPost.php | 66 ++++++++++++++++++ .../src/Events/DiscussionWasStickied.php | 27 ++++++++ .../src/Events/DiscussionWasUnstickied.php | 27 ++++++++ .../Handlers/DiscussionStickiedNotifier.php | 67 +++++++++++++++++++ .../sticky/src/Handlers/StickySaver.php | 34 ++++++++++ .../src/Handlers/StickySearchModifier.php | 37 ++++++++++ extensions/sticky/src/StickyGambit.php | 29 ++++++++ .../sticky/src/StickyServiceProvider.php | 34 ++++++++++ 22 files changed, 624 insertions(+) create mode 100644 extensions/sticky/.gitignore create mode 100644 extensions/sticky/LICENSE.txt create mode 100644 extensions/sticky/bootstrap.php create mode 100644 extensions/sticky/composer.json create mode 100644 extensions/sticky/extension.json create mode 100644 extensions/sticky/js/.gitignore create mode 100644 extensions/sticky/js/Gulpfile.js create mode 100644 extensions/sticky/js/bootstrap.js create mode 100644 extensions/sticky/js/package.json create mode 100644 extensions/sticky/js/src/components/notification-discussion-stickied.js create mode 100644 extensions/sticky/js/src/components/post-discussion-stickied.js create mode 100644 extensions/sticky/less/sticky.less create mode 100644 extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php create mode 100644 extensions/sticky/src/DiscussionStickiedNotification.php create mode 100755 extensions/sticky/src/DiscussionStickiedPost.php create mode 100644 extensions/sticky/src/Events/DiscussionWasStickied.php create mode 100644 extensions/sticky/src/Events/DiscussionWasUnstickied.php create mode 100755 extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php create mode 100755 extensions/sticky/src/Handlers/StickySaver.php create mode 100755 extensions/sticky/src/Handlers/StickySearchModifier.php create mode 100644 extensions/sticky/src/StickyGambit.php create mode 100644 extensions/sticky/src/StickyServiceProvider.php diff --git a/extensions/sticky/.gitignore b/extensions/sticky/.gitignore new file mode 100644 index 000000000..a4f3b125e --- /dev/null +++ b/extensions/sticky/.gitignore @@ -0,0 +1,4 @@ +/vendor +composer.phar +.DS_Store +Thumbs.db diff --git a/extensions/sticky/LICENSE.txt b/extensions/sticky/LICENSE.txt new file mode 100644 index 000000000..aa1e5fb86 --- /dev/null +++ b/extensions/sticky/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014-2015 Toby Zerner + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php new file mode 100644 index 000000000..aaee6ed2c --- /dev/null +++ b/extensions/sticky/bootstrap.php @@ -0,0 +1,9 @@ +register('Flarum\Sticky\StickyServiceProvider'); diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json new file mode 100644 index 000000000..278b2c61c --- /dev/null +++ b/extensions/sticky/composer.json @@ -0,0 +1,19 @@ +{ + "name": "flarum/sticky", + "description": "", + "authors": [ + { + "name": "Toby Zerner", + "email": "toby@flarum.org" + } + ], + "require": { + "php": ">=5.4.0" + }, + "autoload": { + "psr-4": { + "Flarum\\Sticky\\": "src/" + } + }, + "minimum-stability": "dev" +} diff --git a/extensions/sticky/extension.json b/extensions/sticky/extension.json new file mode 100644 index 000000000..2b9535fbc --- /dev/null +++ b/extensions/sticky/extension.json @@ -0,0 +1,15 @@ +{ + "name": "sticky", + "description": "Pin discussions to the top of the list.", + "version": "0.1.0", + "author": { + "name": "Toby Zerner", + "email": "toby@flarum.org", + "website": "http://tobyzerner.com" + }, + "license": "MIT", + "require": { + "php": ">=5.4.0", + "flarum": ">1.0.0" + } +} diff --git a/extensions/sticky/js/.gitignore b/extensions/sticky/js/.gitignore new file mode 100644 index 000000000..bae304483 --- /dev/null +++ b/extensions/sticky/js/.gitignore @@ -0,0 +1,4 @@ +bower_components +node_modules +mithril.js +dist diff --git a/extensions/sticky/js/Gulpfile.js b/extensions/sticky/js/Gulpfile.js new file mode 100644 index 000000000..09b1432e0 --- /dev/null +++ b/extensions/sticky/js/Gulpfile.js @@ -0,0 +1,45 @@ +var gulp = require('gulp'); +var livereload = require('gulp-livereload'); +var concat = require('gulp-concat'); +var argv = require('yargs').argv; +var uglify = require('gulp-uglify'); +var gulpif = require('gulp-if'); +var babel = require('gulp-babel'); +var cached = require('gulp-cached'); +var remember = require('gulp-remember'); +var merge = require('merge-stream'); +var streamqueue = require('streamqueue'); + +var staticFiles = [ + 'bootstrap.js' +]; +var moduleFiles = [ + 'src/**/*.js' +]; +var modulePrefix = 'sticky'; + +gulp.task('default', function() { + return streamqueue({objectMode: true}, + gulp.src(moduleFiles) + .pipe(cached('scripts')) + .pipe(babel({ modules: 'amd', moduleIds: true, moduleRoot: modulePrefix })) + .pipe(remember('scripts')), + gulp.src(staticFiles) + .pipe(babel()) + ) + .pipe(concat('extension.js')) + .pipe(gulpif(argv.production, uglify())) + .pipe(gulp.dest('dist')) + .pipe(livereload()); +}); + +gulp.task('watch', ['default'], function () { + livereload.listen(); + var watcher = gulp.watch(moduleFiles.concat(staticFiles), ['default']); + watcher.on('change', function (event) { + if (event.type === 'deleted') { + delete cached.caches.scripts[event.path]; + remember.forget('scripts', event.path); + } + }); +}); diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js new file mode 100644 index 000000000..0eac2c264 --- /dev/null +++ b/extensions/sticky/js/bootstrap.js @@ -0,0 +1,60 @@ +import { extend } from 'flarum/extension-utils'; +import Model from 'flarum/model'; +import Discussion from 'flarum/models/discussion'; +import DiscussionPage from 'flarum/components/discussion-page'; +import Badge from 'flarum/components/badge'; +import ActionButton from 'flarum/components/action-button'; +import SettingsPage from 'flarum/components/settings-page'; +import icon from 'flarum/helpers/icon'; +import app from 'flarum/app'; + +import PostDiscussionStickied from 'sticky/components/post-discussion-stickied'; +import NotificationDiscussionStickied from 'sticky/components/notification-discussion-stickied'; + +app.initializers.add('sticky', function() { + + // Register components. + app.postComponentRegistry['discussionStickied'] = PostDiscussionStickied; + app.notificationComponentRegistry['discussionStickied'] = NotificationDiscussionStickied; + + Discussion.prototype.isSticky = Model.prop('isSticky'); + + // Add a sticky badge to discussions. + extend(Discussion.prototype, 'badges', function(badges) { + if (this.isSticky()) { + badges.add('sticky', Badge.component({ + label: 'Sticky', + icon: 'thumb-tack', + className: 'badge-sticky', + })); + } + }); + + function toggleSticky() { + this.save({isSticky: !this.isSticky()}).then(discussion => { + if (app.current instanceof DiscussionPage) { + app.current.stream().sync(); + } + m.redraw(); + }); + } + + // Add a sticky control to discussions. + extend(Discussion.prototype, 'controls', function(items) { + if (this.canEdit()) { + items.add('sticky', ActionButton.component({ + label: this.isSticky() ? 'Unsticky' : 'Sticky', + icon: 'thumb-tack', + onclick: toggleSticky.bind(this) + }), {after: 'rename'}); + } + }); + + // Add a notification preference. + extend(SettingsPage.prototype, 'notificationTypes', function(items) { + items.add('discussionStickied', { + name: 'discussionStickied', + label: [icon('thumb-tack'), ' Someone stickies a discussion I started'] + }); + }); +}); diff --git a/extensions/sticky/js/package.json b/extensions/sticky/js/package.json new file mode 100644 index 000000000..b83b01cc5 --- /dev/null +++ b/extensions/sticky/js/package.json @@ -0,0 +1,18 @@ +{ + "name": "flarum-sticky", + "devDependencies": { + "gulp": "^3.8.11", + "gulp-babel": "^5.1.0", + "gulp-cached": "^1.0.4", + "gulp-concat": "^2.5.2", + "gulp-if": "^1.2.5", + "gulp-livereload": "^3.8.0", + "gulp-remember": "^0.3.0", + "gulp-uglify": "^1.2.0", + "merge-stream": "^0.1.7", + "yargs": "^3.7.2" + }, + "dependencies": { + "streamqueue": "^0.1.3" + } +} diff --git a/extensions/sticky/js/src/components/notification-discussion-stickied.js b/extensions/sticky/js/src/components/notification-discussion-stickied.js new file mode 100644 index 000000000..89bc169b8 --- /dev/null +++ b/extensions/sticky/js/src/components/notification-discussion-stickied.js @@ -0,0 +1,21 @@ +import Notification from 'flarum/components/notification'; +import username from 'flarum/helpers/username'; + +export default class NotificationDiscussionStickied extends Notification { + view() { + var notification = this.props.notification; + var discussion = notification.subject(); + + return super.view({ + href: app.route('discussion.near', { + id: discussion.id(), + slug: discussion.slug(), + near: notification.content().postNumber + }), + config: m.route, + title: discussion.title(), + icon: 'thumb-tack', + content: ['Stickied by ', username(notification.sender())] + }); + } +} diff --git a/extensions/sticky/js/src/components/post-discussion-stickied.js b/extensions/sticky/js/src/components/post-discussion-stickied.js new file mode 100644 index 000000000..beb75e70f --- /dev/null +++ b/extensions/sticky/js/src/components/post-discussion-stickied.js @@ -0,0 +1,9 @@ +import PostActivity from 'flarum/components/post-activity'; + +export default class PostDiscussionStickied extends PostActivity { + view() { + var post = this.props.post; + + return super.view('thumb-tack', [post.content().sticky ? 'stickied' : 'unstickied', ' the discussion.']); + } +} diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less new file mode 100644 index 000000000..d8e24bf9c --- /dev/null +++ b/extensions/sticky/less/sticky.less @@ -0,0 +1,8 @@ +.badge-sticky { + background: #d13e32; +} +.post-discussion-stickied { + & .post-icon, & .post-activity-info, & .post-activity-info a { + color: #d13e32; + } +} diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php new file mode 100644 index 000000000..1a0884c53 --- /dev/null +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -0,0 +1,31 @@ +boolean('is_sticky')->default(0); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('discussions', function (Blueprint $table) { + $table->dropColumn('is_sticky'); + }); + } +} diff --git a/extensions/sticky/src/DiscussionStickiedNotification.php b/extensions/sticky/src/DiscussionStickiedNotification.php new file mode 100644 index 000000000..40e407a50 --- /dev/null +++ b/extensions/sticky/src/DiscussionStickiedNotification.php @@ -0,0 +1,39 @@ +post = $post; + + parent::__construct($recipient, $sender); + } + + public function getSubject() + { + return $this->post->discussion; + } + + public function getAlertData() + { + return [ + 'postNumber' => $this->post->number + ]; + } + + public static function getType() + { + return 'discussionStickied'; + } + + public static function getSubjectModel() + { + return 'Flarum\Core\Models\Discussion'; + } +} diff --git a/extensions/sticky/src/DiscussionStickiedPost.php b/extensions/sticky/src/DiscussionStickiedPost.php new file mode 100755 index 000000000..08d80b33a --- /dev/null +++ b/extensions/sticky/src/DiscussionStickiedPost.php @@ -0,0 +1,66 @@ +user_id === $previous->user_id) { + if ($previous->content['sticky'] != $this->content['sticky']) { + return; + } + + $previous->content = $this->content; + return $previous; + } + + return $this; + } + + /** + * Create a new instance in reply to a discussion. + * + * @param integer $discussionId + * @param integer $userId + * @param boolean $isSticky + * @return static + */ + public static function reply($discussionId, $userId, $isSticky) + { + $post = new static; + + $post->content = static::buildContent($isSticky); + $post->time = time(); + $post->discussion_id = $discussionId; + $post->user_id = $userId; + + return $post; + } + + /** + * Build the content attribute. + * + * @param boolean $isSticky Whether or not the discussion is stickied. + * @return array + */ + public static function buildContent($isSticky) + { + return ['sticky' => (bool) $isSticky]; + } +} diff --git a/extensions/sticky/src/Events/DiscussionWasStickied.php b/extensions/sticky/src/Events/DiscussionWasStickied.php new file mode 100644 index 000000000..31432f4aa --- /dev/null +++ b/extensions/sticky/src/Events/DiscussionWasStickied.php @@ -0,0 +1,27 @@ +discussion = $discussion; + $this->user = $user; + } +} diff --git a/extensions/sticky/src/Events/DiscussionWasUnstickied.php b/extensions/sticky/src/Events/DiscussionWasUnstickied.php new file mode 100644 index 000000000..24e3fc2fd --- /dev/null +++ b/extensions/sticky/src/Events/DiscussionWasUnstickied.php @@ -0,0 +1,27 @@ +discussion = $discussion; + $this->user = $user; + } +} diff --git a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php new file mode 100755 index 000000000..fdfa28aa1 --- /dev/null +++ b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php @@ -0,0 +1,67 @@ +notifier = $notifier; + } + + /** + * Register the listeners for the subscriber. + * + * @param \Illuminate\Contracts\Events\Dispatcher $events + */ + public function subscribe(Dispatcher $events) + { + $events->listen('Flarum\Sticky\Events\DiscussionWasStickied', __CLASS__.'@whenDiscussionWasStickied'); + $events->listen('Flarum\Sticky\Events\DiscussionWasUnstickied', __CLASS__.'@whenDiscussionWasUnstickied'); + } + + public function whenDiscussionWasStickied(DiscussionWasStickied $event) + { + $post = $this->createPost($event->discussion->id, $event->user->id, true); + + $post = $event->discussion->addPost($post); + + if ($event->discussion->start_user_id !== $event->user->id) { + $this->sendNotification($post); + } + } + + public function whenDiscussionWasUnstickied(DiscussionWasUnstickied $event) + { + $post = $this->createPost($event->discussion->id, $event->user->id, false); + + $event->discussion->addPost($post); + } + + protected function createPost($discussionId, $userId, $isSticky) + { + return DiscussionStickiedPost::reply( + $discussionId, + $userId, + $isSticky + ); + } + + protected function sendNotification(DiscussionStickiedPost $post) + { + $notification = new DiscussionStickiedNotification( + $post->discussion->startUser, + $post->user, + $post + ); + + $this->notifier->send($notification); + } +} diff --git a/extensions/sticky/src/Handlers/StickySaver.php b/extensions/sticky/src/Handlers/StickySaver.php new file mode 100755 index 000000000..cffbb6208 --- /dev/null +++ b/extensions/sticky/src/Handlers/StickySaver.php @@ -0,0 +1,34 @@ +listen('Flarum\Core\Events\DiscussionWillBeSaved', __CLASS__.'@whenDiscussionWillBeSaved'); + } + + public function whenDiscussionWillBeSaved(DiscussionWillBeSaved $event) + { + if (isset($event->command->data['isSticky'])) { + $isSticky = (bool) $event->command->data['isSticky']; + $discussion = $event->discussion; + $user = $event->command->user; + + if ((bool) $discussion->is_sticky === $isSticky) { + return; + } + + $discussion->is_sticky = $isSticky; + + $discussion->raise( + $discussion->is_sticky + ? new DiscussionWasStickied($discussion, $user) + : new DiscussionWasUnstickied($discussion, $user) + ); + } + } +} diff --git a/extensions/sticky/src/Handlers/StickySearchModifier.php b/extensions/sticky/src/Handlers/StickySearchModifier.php new file mode 100755 index 000000000..05592c5d8 --- /dev/null +++ b/extensions/sticky/src/Handlers/StickySearchModifier.php @@ -0,0 +1,37 @@ +listen('Flarum\Core\Events\DiscussionSearchWillBePerformed', __CLASS__.'@reorderSearch'); + } + + public function reorderSearch(DiscussionSearchWillBePerformed $event) + { + if ($event->criteria->sort === null) { + $query = $event->searcher->query(); + + foreach ($event->searcher->getActiveGambits() as $gambit) { + if ($gambit instanceof CategoryGambit) { + array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); + return; + } + } + + $query->leftJoin('users_discussions', function ($join) use ($event) { + $join->on('users_discussions.discussion_id', '=', 'discussions.id') + ->where('discussions.is_sticky', '=', true) + ->where('users_discussions.user_id', '=', $event->criteria->user->id); + }); + // might be quicker to do a subquery in the order clause than a join? + array_unshift( + $query->orders, + ['type' => 'raw', 'sql' => '(is_sticky AND (users_discussions.read_number IS NULL OR discussions.last_post_number > users_discussions.read_number)) desc'] + ); + } + } +} diff --git a/extensions/sticky/src/StickyGambit.php b/extensions/sticky/src/StickyGambit.php new file mode 100644 index 000000000..84c3c2f7d --- /dev/null +++ b/extensions/sticky/src/StickyGambit.php @@ -0,0 +1,29 @@ +query()->where('is_sticky', $sticky); + } +} diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php new file mode 100644 index 000000000..2dd79f6e7 --- /dev/null +++ b/extensions/sticky/src/StickyServiceProvider.php @@ -0,0 +1,34 @@ +subscribe('Flarum\Sticky\Handlers\StickySaver'); + $events->subscribe('Flarum\Sticky\Handlers\StickySearchModifier'); + $events->subscribe('Flarum\Sticky\Handlers\DiscussionStickiedNotifier'); + + $this->forumAssets([ + __DIR__.'/../js/dist/extension.js', + __DIR__.'/../less/sticky.less' + ]); + + $this->postType('Flarum\Sticky\DiscussionStickiedPost'); + + $this->serializeAttributes('Flarum\Api\Serializers\DiscussionSerializer', function (&$attributes, $model) { + $attributes['isSticky'] = (bool) $model->is_sticky; + }); + + $this->discussionGambit('Flarum\Sticky\StickyGambit'); + + $this->notificationType('Flarum\Sticky\DiscussionStickiedNotification', ['alert' => true]); + } +} From 55a4d4663a555b23aae13c5b12a6fbbecd649bc3 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 11 May 2015 10:42:30 +0930 Subject: [PATCH 002/183] Assume a Flarum\Support\ServiceProvider context in bootstrap.php --- extensions/sticky/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index aaee6ed2c..f09cac86c 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -6,4 +6,4 @@ require __DIR__.'/vendor/autoload.php'; // Register our service provider with the Flarum application. In here we can // register bindings and execute code when the application boots. -return $app->register('Flarum\Sticky\StickyServiceProvider'); +return $this->app->register('Flarum\Sticky\StickyServiceProvider'); From 798bdd3e68998bb5f32d5ffe92ee7e56f4106a7b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 14 May 2015 22:42:52 +0930 Subject: [PATCH 003/183] Update notification architecture --- .../notification-discussion-stickied.js | 11 ++------- .../src/DiscussionStickiedNotification.php | 24 ++++++++++++------- .../Handlers/DiscussionStickiedNotifier.php | 16 ++++++------- 3 files changed, 25 insertions(+), 26 deletions(-) diff --git a/extensions/sticky/js/src/components/notification-discussion-stickied.js b/extensions/sticky/js/src/components/notification-discussion-stickied.js index 89bc169b8..08e04fc89 100644 --- a/extensions/sticky/js/src/components/notification-discussion-stickied.js +++ b/extensions/sticky/js/src/components/notification-discussion-stickied.js @@ -4,18 +4,11 @@ import username from 'flarum/helpers/username'; export default class NotificationDiscussionStickied extends Notification { view() { var notification = this.props.notification; - var discussion = notification.subject(); return super.view({ - href: app.route('discussion.near', { - id: discussion.id(), - slug: discussion.slug(), - near: notification.content().postNumber - }), - config: m.route, - title: discussion.title(), + href: app.route.discussion(notification.subject(), notification.content().postNumber), icon: 'thumb-tack', - content: ['Stickied by ', username(notification.sender())] + content: [username(notification.sender()), ' stickied'] }); } } diff --git a/extensions/sticky/src/DiscussionStickiedNotification.php b/extensions/sticky/src/DiscussionStickiedNotification.php index 40e407a50..97047f426 100644 --- a/extensions/sticky/src/DiscussionStickiedNotification.php +++ b/extensions/sticky/src/DiscussionStickiedNotification.php @@ -1,30 +1,38 @@ discussion = $discussion; + $this->sender = $sender; $this->post = $post; - - parent::__construct($recipient, $sender); } public function getSubject() { - return $this->post->discussion; + return $this->discussion; + } + + public function getSender() + { + return $this->sender; } public function getAlertData() { - return [ - 'postNumber' => $this->post->number - ]; + return ['postNumber' => $this->post->number]; } public static function getType() diff --git a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php index fdfa28aa1..39ccb29e7 100755 --- a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php +++ b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php @@ -34,7 +34,9 @@ class DiscussionStickiedNotifier $post = $event->discussion->addPost($post); if ($event->discussion->start_user_id !== $event->user->id) { - $this->sendNotification($post); + $notification = $this->createNotification($event->discussion, $post->user, $post); + + $this->notifier->send($notification, [$post->discussion->startUser]); } } @@ -43,6 +45,8 @@ class DiscussionStickiedNotifier $post = $this->createPost($event->discussion->id, $event->user->id, false); $event->discussion->addPost($post); + + $this->notifier->retract($this->createNotification($event->discussion, $event->user)); } protected function createPost($discussionId, $userId, $isSticky) @@ -54,14 +58,8 @@ class DiscussionStickiedNotifier ); } - protected function sendNotification(DiscussionStickiedPost $post) + protected function createNotification($discussion, $user, $post = null) { - $notification = new DiscussionStickiedNotification( - $post->discussion->startUser, - $post->user, - $post - ); - - $this->notifier->send($notification); + return new DiscussionStickiedNotification($discussion, $user, $post); } } From 5b13acd5e3448c7e77433eb85ffc9fcae6b2c70d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 14 May 2015 23:10:50 +0930 Subject: [PATCH 004/183] Add excerpt to sticky discussions --- extensions/sticky/js/bootstrap.js | 16 ++++++++++++++++ extensions/sticky/less/sticky.less | 8 ++++++++ 2 files changed, 24 insertions(+) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index 0eac2c264..d7ba8d882 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -2,6 +2,7 @@ import { extend } from 'flarum/extension-utils'; import Model from 'flarum/model'; import Discussion from 'flarum/models/discussion'; import DiscussionPage from 'flarum/components/discussion-page'; +import DiscussionList from 'flarum/components/discussion-list'; import Badge from 'flarum/components/badge'; import ActionButton from 'flarum/components/action-button'; import SettingsPage from 'flarum/components/settings-page'; @@ -57,4 +58,19 @@ app.initializers.add('sticky', function() { label: [icon('thumb-tack'), ' Someone stickies a discussion I started'] }); }); + + extend(DiscussionList.prototype, 'params', function(params) { + params.include.push('startPost'); + }); + + extend(DiscussionList.prototype, 'infoItems', function(items, discussion) { + if (discussion.isSticky()) { + var startPost = discussion.startPost(); + if (startPost) { + var excerpt = m('span', startPost.excerpt()); + excerpt.wrapperClass = 'discussion-excerpt'; + var item = items.add('excerpt', excerpt, {first: true}); + } + } + }); }); diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index d8e24bf9c..c4d74154f 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -6,3 +6,11 @@ color: #d13e32; } } +.discussion-excerpt { + display: block !important; + margin-bottom: 10px; + white-space: normal; + font-size: 12px; + line-height: 1.5em; + color: #aaa; +} From 5872e041df49c26d5df939dea531d81fc1d51194 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 14 May 2015 23:14:31 +0930 Subject: [PATCH 005/183] Hide excerpt in discussion list pane + on mobile --- extensions/sticky/less/sticky.less | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index c4d74154f..542c451fc 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -7,10 +7,20 @@ } } .discussion-excerpt { - display: block !important; margin-bottom: 10px; white-space: normal; font-size: 12px; line-height: 1.5em; - color: #aaa; + color: @fl-body-muted-more-color; + + .discussion-summary .info > li& { + display: block; + + .paned & { + display: none; + } + @media @phone { + display: none; + } + } } From 30d546383edc40170becc6c297480701cef11d52 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 15 May 2015 17:06:50 +0930 Subject: [PATCH 006/183] Add sticky permission --- extensions/sticky/js/bootstrap.js | 3 ++- extensions/sticky/src/Handlers/StickySaver.php | 2 ++ extensions/sticky/src/StickyServiceProvider.php | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index d7ba8d882..c176c9436 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -19,6 +19,7 @@ app.initializers.add('sticky', function() { app.notificationComponentRegistry['discussionStickied'] = NotificationDiscussionStickied; Discussion.prototype.isSticky = Model.prop('isSticky'); + Discussion.prototype.canSticky = Model.prop('canSticky'); // Add a sticky badge to discussions. extend(Discussion.prototype, 'badges', function(badges) { @@ -42,7 +43,7 @@ app.initializers.add('sticky', function() { // Add a sticky control to discussions. extend(Discussion.prototype, 'controls', function(items) { - if (this.canEdit()) { + if (this.canSticky()) { items.add('sticky', ActionButton.component({ label: this.isSticky() ? 'Unsticky' : 'Sticky', icon: 'thumb-tack', diff --git a/extensions/sticky/src/Handlers/StickySaver.php b/extensions/sticky/src/Handlers/StickySaver.php index cffbb6208..d01da961c 100755 --- a/extensions/sticky/src/Handlers/StickySaver.php +++ b/extensions/sticky/src/Handlers/StickySaver.php @@ -18,6 +18,8 @@ class StickySaver $discussion = $event->discussion; $user = $event->command->user; + $discussion->assertCan($user, 'sticky'); + if ((bool) $discussion->is_sticky === $isSticky) { return; } diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php index 2dd79f6e7..f5c1496a7 100644 --- a/extensions/sticky/src/StickyServiceProvider.php +++ b/extensions/sticky/src/StickyServiceProvider.php @@ -23,12 +23,15 @@ class StickyServiceProvider extends ServiceProvider $this->postType('Flarum\Sticky\DiscussionStickiedPost'); - $this->serializeAttributes('Flarum\Api\Serializers\DiscussionSerializer', function (&$attributes, $model) { + $this->serializeAttributes('Flarum\Api\Serializers\DiscussionSerializer', function (&$attributes, $model, $serializer) { $attributes['isSticky'] = (bool) $model->is_sticky; + $attributes['canSticky'] = (bool) $model->can($serializer->actor->getUser(), 'sticky'); }); $this->discussionGambit('Flarum\Sticky\StickyGambit'); $this->notificationType('Flarum\Sticky\DiscussionStickiedNotification', ['alert' => true]); + + $this->permission('discussion.sticky'); } } From bd1d165355339822f0377c438d4cbd15d0733cf8 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 17 May 2015 10:20:26 +0930 Subject: [PATCH 007/183] Update for new extension API --- .../sticky/src/StickyServiceProvider.php | 49 ++++++++++--------- 1 file changed, 27 insertions(+), 22 deletions(-) diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php index f5c1496a7..fdd80db8f 100644 --- a/extensions/sticky/src/StickyServiceProvider.php +++ b/extensions/sticky/src/StickyServiceProvider.php @@ -1,37 +1,42 @@ subscribe('Flarum\Sticky\Handlers\StickySaver'); - $events->subscribe('Flarum\Sticky\Handlers\StickySearchModifier'); - $events->subscribe('Flarum\Sticky\Handlers\DiscussionStickiedNotifier'); + $this->extend( + new EventSubscribers([ + 'Flarum\Sticky\Handlers\StickySaver', + 'Flarum\Sticky\Handlers\StickySearchModifier', + 'Flarum\Sticky\Handlers\DiscussionStickiedNotifier' + ]), - $this->forumAssets([ - __DIR__.'/../js/dist/extension.js', - __DIR__.'/../less/sticky.less' - ]); + new ForumAssets([ + __DIR__.'/../js/dist/extension.js', + __DIR__.'/../less/sticky.less' + ]), - $this->postType('Flarum\Sticky\DiscussionStickiedPost'); + new PostType('Flarum\Sticky\DiscussionStickiedPost'), - $this->serializeAttributes('Flarum\Api\Serializers\DiscussionSerializer', function (&$attributes, $model, $serializer) { - $attributes['isSticky'] = (bool) $model->is_sticky; - $attributes['canSticky'] = (bool) $model->can($serializer->actor->getUser(), 'sticky'); - }); + new SerializeAttributes('Flarum\Api\Serializers\DiscussionSerializer', function (&$attributes, $model, $serializer) { + $attributes['isSticky'] = (bool) $model->is_sticky; + $attributes['canSticky'] = (bool) $model->can($serializer->actor->getUser(), 'sticky'); + }), - $this->discussionGambit('Flarum\Sticky\StickyGambit'); + new DiscussionGambit('Flarum\Sticky\StickyGambit'), - $this->notificationType('Flarum\Sticky\DiscussionStickiedNotification', ['alert' => true]); + (new NotificationType('Flarum\Sticky\DiscussionStickiedNotification'))->enableByDefault('alert'), - $this->permission('discussion.sticky'); + new Permission('discussion.sticky') + ); } } From 0797a58eb77c936a1d136d0640913947e841821b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 18 May 2015 13:52:25 +0930 Subject: [PATCH 008/183] Move sticky excerpts to below the category/last post info --- extensions/sticky/js/bootstrap.js | 2 +- extensions/sticky/less/sticky.less | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index c176c9436..62ea0b89e 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -70,7 +70,7 @@ app.initializers.add('sticky', function() { if (startPost) { var excerpt = m('span', startPost.excerpt()); excerpt.wrapperClass = 'discussion-excerpt'; - var item = items.add('excerpt', excerpt, {first: true}); + var item = items.add('excerpt', excerpt, {last: true}); } } }); diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index 542c451fc..5e619d5a7 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -7,7 +7,8 @@ } } .discussion-excerpt { - margin-bottom: 10px; + margin-top: 8px; + margin-right: 20px; white-space: normal; font-size: 12px; line-height: 1.5em; From d16a6a0a5d6343b631638c8d72ca9dbdc4a9e255 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 18 May 2015 18:11:51 +0930 Subject: [PATCH 009/183] More defined style for sticky excerpts --- extensions/sticky/less/sticky.less | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index 5e619d5a7..a293b5f26 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -12,7 +12,10 @@ white-space: normal; font-size: 12px; line-height: 1.5em; - color: @fl-body-muted-more-color; + color: @fl-body-muted-color; + background: @fl-body-secondary-color; + border-radius: @border-radius-base; + padding: 10px 15px; .discussion-summary .info > li& { display: block; From d4b8c9c8d7cbd3e10f9e431361a49463e8d11557 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 18 May 2015 18:14:52 +0930 Subject: [PATCH 010/183] Make excerpts look a little cooler --- extensions/sticky/less/sticky.less | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index a293b5f26..5cebfbfb4 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -16,6 +16,7 @@ background: @fl-body-secondary-color; border-radius: @border-radius-base; padding: 10px 15px; + border-bottom: 2px dotted @fl-body-bg; .discussion-summary .info > li& { display: block; From 2be7c4affca9826a3ab26226c0e6c9aaca01d7d0 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 18 May 2015 18:47:55 +0930 Subject: [PATCH 011/183] Rename ActivityPost to EventPost --- extensions/sticky/src/DiscussionStickiedPost.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/src/DiscussionStickiedPost.php b/extensions/sticky/src/DiscussionStickiedPost.php index 08d80b33a..5d94bd947 100755 --- a/extensions/sticky/src/DiscussionStickiedPost.php +++ b/extensions/sticky/src/DiscussionStickiedPost.php @@ -1,9 +1,9 @@ Date: Mon, 18 May 2015 18:50:58 +0930 Subject: [PATCH 012/183] Rename JS sub-components so that descriptors are before the noun, not after --- extensions/sticky/js/bootstrap.js | 8 ++++---- ...on-stickied.js => discussion-stickied-notification.js} | 2 +- ...discussion-stickied.js => discussion-stickied-post.js} | 4 ++-- extensions/sticky/less/sticky.less | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) rename extensions/sticky/js/src/components/{notification-discussion-stickied.js => discussion-stickied-notification.js} (86%) rename extensions/sticky/js/src/components/{post-discussion-stickied.js => discussion-stickied-post.js} (55%) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index 62ea0b89e..c95d9cc4f 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -9,14 +9,14 @@ import SettingsPage from 'flarum/components/settings-page'; import icon from 'flarum/helpers/icon'; import app from 'flarum/app'; -import PostDiscussionStickied from 'sticky/components/post-discussion-stickied'; -import NotificationDiscussionStickied from 'sticky/components/notification-discussion-stickied'; +import DiscussionStickiedPost from 'sticky/components/discussion-stickied-post'; +import DiscussionStickiedNotification from 'sticky/components/discussion-stickied-notification'; app.initializers.add('sticky', function() { // Register components. - app.postComponentRegistry['discussionStickied'] = PostDiscussionStickied; - app.notificationComponentRegistry['discussionStickied'] = NotificationDiscussionStickied; + app.postComponentRegistry['discussionStickied'] = DiscussionStickiedPost; + app.notificationComponentRegistry['discussionStickied'] = DiscussionStickiedNotification; Discussion.prototype.isSticky = Model.prop('isSticky'); Discussion.prototype.canSticky = Model.prop('canSticky'); diff --git a/extensions/sticky/js/src/components/notification-discussion-stickied.js b/extensions/sticky/js/src/components/discussion-stickied-notification.js similarity index 86% rename from extensions/sticky/js/src/components/notification-discussion-stickied.js rename to extensions/sticky/js/src/components/discussion-stickied-notification.js index 08e04fc89..81f636e19 100644 --- a/extensions/sticky/js/src/components/notification-discussion-stickied.js +++ b/extensions/sticky/js/src/components/discussion-stickied-notification.js @@ -1,7 +1,7 @@ import Notification from 'flarum/components/notification'; import username from 'flarum/helpers/username'; -export default class NotificationDiscussionStickied extends Notification { +export default class DiscussionStickiedNotification extends Notification { view() { var notification = this.props.notification; diff --git a/extensions/sticky/js/src/components/post-discussion-stickied.js b/extensions/sticky/js/src/components/discussion-stickied-post.js similarity index 55% rename from extensions/sticky/js/src/components/post-discussion-stickied.js rename to extensions/sticky/js/src/components/discussion-stickied-post.js index beb75e70f..3d8e786a4 100644 --- a/extensions/sticky/js/src/components/post-discussion-stickied.js +++ b/extensions/sticky/js/src/components/discussion-stickied-post.js @@ -1,6 +1,6 @@ -import PostActivity from 'flarum/components/post-activity'; +import EventPost from 'flarum/components/event-post'; -export default class PostDiscussionStickied extends PostActivity { +export default class DiscussionStickiedPost extends EventPost { view() { var post = this.props.post; diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index 5cebfbfb4..c3b5edb29 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -1,7 +1,7 @@ .badge-sticky { background: #d13e32; } -.post-discussion-stickied { +.discussion-stickied-post { & .post-icon, & .post-activity-info, & .post-activity-info a { color: #d13e32; } From ba31890aa4e613c3f271b013d2a60019f803a8e4 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 20 May 2015 12:32:17 +0930 Subject: [PATCH 013/183] Update for new notifications API --- .../src/DiscussionStickiedNotification.php | 23 +++------- .../Handlers/DiscussionStickiedNotifier.php | 45 ++++++++----------- .../sticky/src/StickyServiceProvider.php | 2 +- 3 files changed, 27 insertions(+), 43 deletions(-) diff --git a/extensions/sticky/src/DiscussionStickiedNotification.php b/extensions/sticky/src/DiscussionStickiedNotification.php index 97047f426..b9ff17b0b 100644 --- a/extensions/sticky/src/DiscussionStickiedNotification.php +++ b/extensions/sticky/src/DiscussionStickiedNotification.php @@ -1,38 +1,29 @@ discussion = $discussion; - $this->sender = $sender; $this->post = $post; } public function getSubject() { - return $this->discussion; + return $this->post->discussion; } public function getSender() { - return $this->sender; + return $this->post->user; } - public function getAlertData() + public function getData() { - return ['postNumber' => $this->post->number]; + return ['postNumber' => (int) $this->post->number]; } public static function getType() diff --git a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php index 39ccb29e7..c36c5a97a 100755 --- a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php +++ b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php @@ -4,16 +4,18 @@ use Flarum\Sticky\DiscussionStickiedPost; use Flarum\Sticky\DiscussionStickiedNotification; use Flarum\Sticky\Events\DiscussionWasStickied; use Flarum\Sticky\Events\DiscussionWasUnstickied; -use Flarum\Core\Notifications\Notifier; +use Flarum\Core\Notifications\NotificationSyncer; +use Flarum\Core\Models\Discussion; +use Flarum\Core\Models\User; use Illuminate\Contracts\Events\Dispatcher; class DiscussionStickiedNotifier { - protected $notifier; + protected $notifications; - public function __construct(Notifier $notifier) + public function __construct(NotificationSyncer $notifications) { - $this->notifier = $notifier; + $this->notifications = $notifications; } /** @@ -29,37 +31,28 @@ class DiscussionStickiedNotifier public function whenDiscussionWasStickied(DiscussionWasStickied $event) { - $post = $this->createPost($event->discussion->id, $event->user->id, true); - - $post = $event->discussion->addPost($post); - - if ($event->discussion->start_user_id !== $event->user->id) { - $notification = $this->createNotification($event->discussion, $post->user, $post); - - $this->notifier->send($notification, [$post->discussion->startUser]); - } + $this->stickyChanged($event->discussion, $event->user, true); } public function whenDiscussionWasUnstickied(DiscussionWasUnstickied $event) { - $post = $this->createPost($event->discussion->id, $event->user->id, false); - - $event->discussion->addPost($post); - - $this->notifier->retract($this->createNotification($event->discussion, $event->user)); + $this->stickyChanged($event->discussion, $event->user, false); } - protected function createPost($discussionId, $userId, $isSticky) + protected function stickyChanged(Discussion $discussion, User $user, $isSticky) { - return DiscussionStickiedPost::reply( - $discussionId, - $userId, + $post = DiscussionStickiedPost::reply( + $discussion->id, + $user->id, $isSticky ); - } - protected function createNotification($discussion, $user, $post = null) - { - return new DiscussionStickiedNotification($discussion, $user, $post); + $post = $discussion->addPost($post); + + if ($discussion->start_user_id !== $user->id) { + $notification = new DiscussionStickiedNotification($post); + + $this->notifications->sync($notification, $post->exists ? [$discussion->startUser] : []); + } } } diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php index fdd80db8f..8ac048ade 100644 --- a/extensions/sticky/src/StickyServiceProvider.php +++ b/extensions/sticky/src/StickyServiceProvider.php @@ -34,7 +34,7 @@ class StickyServiceProvider extends ServiceProvider new DiscussionGambit('Flarum\Sticky\StickyGambit'), - (new NotificationType('Flarum\Sticky\DiscussionStickiedNotification'))->enableByDefault('alert'), + (new NotificationType('Flarum\Sticky\DiscussionStickiedNotification', 'Flarum\Api\Serializers\DiscussionBasicSerializer'))->enableByDefault('alert'), new Permission('discussion.sticky') ); From cb1dfe1726fce276d48dce2134130012d493955f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 21 May 2015 13:07:46 +0930 Subject: [PATCH 014/183] Remove box from excerpts again --- extensions/sticky/less/sticky.less | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index c3b5edb29..8a6056990 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -12,11 +12,7 @@ white-space: normal; font-size: 12px; line-height: 1.5em; - color: @fl-body-muted-color; - background: @fl-body-secondary-color; - border-radius: @border-radius-base; - padding: 10px 15px; - border-bottom: 2px dotted @fl-body-bg; + color: @fl-body-muted-more-color; .discussion-summary .info > li& { display: block; From 5b323d7c083ede2abce9b3bfebf4e1b6c695a002 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 29 May 2015 18:23:01 +0930 Subject: [PATCH 015/183] Update for new post stream --- extensions/sticky/js/bootstrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index c95d9cc4f..d9edc8956 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -35,7 +35,7 @@ app.initializers.add('sticky', function() { function toggleSticky() { this.save({isSticky: !this.isSticky()}).then(discussion => { if (app.current instanceof DiscussionPage) { - app.current.stream().sync(); + app.current.stream.sync(); } m.redraw(); }); From d5e9ad84b841c7b634162b10e5e16ef3a35ba438 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 29 May 2015 18:56:49 +0930 Subject: [PATCH 016/183] Fix class names --- extensions/sticky/less/sticky.less | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less index 8a6056990..cc7456d96 100644 --- a/extensions/sticky/less/sticky.less +++ b/extensions/sticky/less/sticky.less @@ -2,7 +2,7 @@ background: #d13e32; } .discussion-stickied-post { - & .post-icon, & .post-activity-info, & .post-activity-info a { + & .post-icon, & .event-post-info, & .event-post-info a { color: #d13e32; } } From 194de6be3770615e5612da78037eaf363b4ebe36 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 3 Jun 2015 18:05:23 +0930 Subject: [PATCH 017/183] Fix error when there are no orders on the query --- extensions/sticky/src/Handlers/StickySearchModifier.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/extensions/sticky/src/Handlers/StickySearchModifier.php b/extensions/sticky/src/Handlers/StickySearchModifier.php index 05592c5d8..b173e1c44 100755 --- a/extensions/sticky/src/Handlers/StickySearchModifier.php +++ b/extensions/sticky/src/Handlers/StickySearchModifier.php @@ -15,6 +15,10 @@ class StickySearchModifier if ($event->criteria->sort === null) { $query = $event->searcher->query(); + if (!is_array($query->orders)) { + $query->orders = []; + } + foreach ($event->searcher->getActiveGambits() as $gambit) { if ($gambit instanceof CategoryGambit) { array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); From 8c8f2bb8022090d1fe5fb609282b1b73497b67ae Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 8 Jun 2015 15:04:42 +0930 Subject: [PATCH 018/183] Use new flarum-gulp package. --- extensions/sticky/js/Gulpfile.js | 46 ++----------------------------- extensions/sticky/js/bootstrap.js | 4 +-- extensions/sticky/js/package.json | 15 ++-------- 3 files changed, 7 insertions(+), 58 deletions(-) diff --git a/extensions/sticky/js/Gulpfile.js b/extensions/sticky/js/Gulpfile.js index 09b1432e0..fae866679 100644 --- a/extensions/sticky/js/Gulpfile.js +++ b/extensions/sticky/js/Gulpfile.js @@ -1,45 +1,5 @@ -var gulp = require('gulp'); -var livereload = require('gulp-livereload'); -var concat = require('gulp-concat'); -var argv = require('yargs').argv; -var uglify = require('gulp-uglify'); -var gulpif = require('gulp-if'); -var babel = require('gulp-babel'); -var cached = require('gulp-cached'); -var remember = require('gulp-remember'); -var merge = require('merge-stream'); -var streamqueue = require('streamqueue'); +var gulp = require('flarum-gulp'); -var staticFiles = [ - 'bootstrap.js' -]; -var moduleFiles = [ - 'src/**/*.js' -]; -var modulePrefix = 'sticky'; - -gulp.task('default', function() { - return streamqueue({objectMode: true}, - gulp.src(moduleFiles) - .pipe(cached('scripts')) - .pipe(babel({ modules: 'amd', moduleIds: true, moduleRoot: modulePrefix })) - .pipe(remember('scripts')), - gulp.src(staticFiles) - .pipe(babel()) - ) - .pipe(concat('extension.js')) - .pipe(gulpif(argv.production, uglify())) - .pipe(gulp.dest('dist')) - .pipe(livereload()); -}); - -gulp.task('watch', ['default'], function () { - livereload.listen(); - var watcher = gulp.watch(moduleFiles.concat(staticFiles), ['default']); - watcher.on('change', function (event) { - if (event.type === 'deleted') { - delete cached.caches.scripts[event.path]; - remember.forget('scripts', event.path); - } - }); +gulp({ + modulePrefix: 'flarum-sticky' }); diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index d9edc8956..a394c22de 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -9,8 +9,8 @@ import SettingsPage from 'flarum/components/settings-page'; import icon from 'flarum/helpers/icon'; import app from 'flarum/app'; -import DiscussionStickiedPost from 'sticky/components/discussion-stickied-post'; -import DiscussionStickiedNotification from 'sticky/components/discussion-stickied-notification'; +import DiscussionStickiedPost from 'flarum-sticky/components/discussion-stickied-post'; +import DiscussionStickiedNotification from 'flarum-sticky/components/discussion-stickied-notification'; app.initializers.add('sticky', function() { diff --git a/extensions/sticky/js/package.json b/extensions/sticky/js/package.json index b83b01cc5..3e0ef919d 100644 --- a/extensions/sticky/js/package.json +++ b/extensions/sticky/js/package.json @@ -1,18 +1,7 @@ { - "name": "flarum-sticky", + "private": true, "devDependencies": { "gulp": "^3.8.11", - "gulp-babel": "^5.1.0", - "gulp-cached": "^1.0.4", - "gulp-concat": "^2.5.2", - "gulp-if": "^1.2.5", - "gulp-livereload": "^3.8.0", - "gulp-remember": "^0.3.0", - "gulp-uglify": "^1.2.0", - "merge-stream": "^0.1.7", - "yargs": "^3.7.2" - }, - "dependencies": { - "streamqueue": "^0.1.3" + "flarum-gulp": "git+https://github.com/flarum/gulp.git" } } From 35ca32a7332ae7e9d27d55e11989e056906e4b87 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 8 Jun 2015 15:04:51 +0930 Subject: [PATCH 019/183] Update manifest. --- extensions/sticky/composer.json | 14 +------------- extensions/sticky/extension.json | 15 --------------- extensions/sticky/flarum.json | 23 +++++++++++++++++++++++ 3 files changed, 24 insertions(+), 28 deletions(-) delete mode 100644 extensions/sticky/extension.json create mode 100644 extensions/sticky/flarum.json diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 278b2c61c..75a7bc603 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -1,19 +1,7 @@ { - "name": "flarum/sticky", - "description": "", - "authors": [ - { - "name": "Toby Zerner", - "email": "toby@flarum.org" - } - ], - "require": { - "php": ">=5.4.0" - }, "autoload": { "psr-4": { "Flarum\\Sticky\\": "src/" } - }, - "minimum-stability": "dev" + } } diff --git a/extensions/sticky/extension.json b/extensions/sticky/extension.json deleted file mode 100644 index 2b9535fbc..000000000 --- a/extensions/sticky/extension.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "sticky", - "description": "Pin discussions to the top of the list.", - "version": "0.1.0", - "author": { - "name": "Toby Zerner", - "email": "toby@flarum.org", - "website": "http://tobyzerner.com" - }, - "license": "MIT", - "require": { - "php": ">=5.4.0", - "flarum": ">1.0.0" - } -} diff --git a/extensions/sticky/flarum.json b/extensions/sticky/flarum.json new file mode 100644 index 000000000..db93e353e --- /dev/null +++ b/extensions/sticky/flarum.json @@ -0,0 +1,23 @@ +{ + "name": "flarum-sticky", + "title": "Sticky", + "description": "Pin discussions to the top of the list.", + "tags": [ + "discussions" + ], + "version": "0.1.0", + "author": { + "name": "Toby Zerner", + "email": "toby@flarum.org", + "homepage": "http://tobyzerner.com" + }, + "license": "MIT", + "require": { + "php": ">=5.4.0", + "flarum": ">0.1.0" + }, + "links": { + "github": "https://github.com/flarum/sticky", + "issues": "https://github.com/flarum/sticky/issues" + } +} From 0892a979be576b34351d1c46b1fdebb0b52b9db9 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 18 Jun 2015 12:45:44 +0930 Subject: [PATCH 020/183] Update APIs --- .../sticky/src/StickyServiceProvider.php | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php index 8ac048ade..c1f03c659 100644 --- a/extensions/sticky/src/StickyServiceProvider.php +++ b/extensions/sticky/src/StickyServiceProvider.php @@ -1,42 +1,37 @@ extend( - new EventSubscribers([ + new Extend\EventSubscriber([ 'Flarum\Sticky\Handlers\StickySaver', 'Flarum\Sticky\Handlers\StickySearchModifier', 'Flarum\Sticky\Handlers\DiscussionStickiedNotifier' ]), - new ForumAssets([ - __DIR__.'/../js/dist/extension.js', - __DIR__.'/../less/sticky.less' - ]), + (new Extend\ForumClient()) + ->assets([ + __DIR__.'/../js/dist/extension.js', + __DIR__.'/../less/sticky.less' + ]), - new PostType('Flarum\Sticky\DiscussionStickiedPost'), + new Extend\PostType('Flarum\Sticky\DiscussionStickiedPost'), - new SerializeAttributes('Flarum\Api\Serializers\DiscussionSerializer', function (&$attributes, $model, $serializer) { - $attributes['isSticky'] = (bool) $model->is_sticky; - $attributes['canSticky'] = (bool) $model->can($serializer->actor->getUser(), 'sticky'); - }), + (new Extend\ApiSerializer('Flarum\Api\Serializers\DiscussionSerializer')) + ->attributes(function (&$attributes, $model, $user) { + $attributes['isSticky'] = (bool) $model->is_sticky; + $attributes['canSticky'] = (bool) $model->can($user, 'sticky'); + }), - new DiscussionGambit('Flarum\Sticky\StickyGambit'), + new Extend\DiscussionGambit('Flarum\Sticky\StickyGambit'), - (new NotificationType('Flarum\Sticky\DiscussionStickiedNotification', 'Flarum\Api\Serializers\DiscussionBasicSerializer'))->enableByDefault('alert'), - - new Permission('discussion.sticky') + (new Extend\NotificationType('Flarum\Sticky\DiscussionStickiedNotification', 'Flarum\Api\Serializers\DiscussionBasicSerializer')) + ->enableByDefault('alert') ); } } From 835c3eef713270d6f035657d00f55009d292457b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Jun 2015 09:58:11 +0930 Subject: [PATCH 021/183] Fix compatibility with tags extension --- extensions/sticky/src/Handlers/StickySearchModifier.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/src/Handlers/StickySearchModifier.php b/extensions/sticky/src/Handlers/StickySearchModifier.php index b173e1c44..fec49b9e7 100755 --- a/extensions/sticky/src/Handlers/StickySearchModifier.php +++ b/extensions/sticky/src/Handlers/StickySearchModifier.php @@ -1,7 +1,7 @@ searcher->getActiveGambits() as $gambit) { - if ($gambit instanceof CategoryGambit) { + if ($gambit instanceof TagGambit) { array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); return; } From 039606e325491562a49a2c05ec860ef618bba1a4 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Jun 2015 09:58:35 +0930 Subject: [PATCH 022/183] Bring back sticky discussion excerpts --- extensions/sticky/js/bootstrap.js | 13 +++++++++---- extensions/sticky/src/StickyServiceProvider.php | 4 ++++ 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index a394c22de..135fca513 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -3,10 +3,12 @@ import Model from 'flarum/model'; import Discussion from 'flarum/models/discussion'; import DiscussionPage from 'flarum/components/discussion-page'; import DiscussionList from 'flarum/components/discussion-list'; +import DiscussionListItem from 'flarum/components/discussion-list-item'; import Badge from 'flarum/components/badge'; import ActionButton from 'flarum/components/action-button'; import SettingsPage from 'flarum/components/settings-page'; import icon from 'flarum/helpers/icon'; +import truncate from 'flarum/utils/truncate'; import app from 'flarum/app'; import DiscussionStickiedPost from 'flarum-sticky/components/discussion-stickied-post'; @@ -57,20 +59,23 @@ app.initializers.add('sticky', function() { items.add('discussionStickied', { name: 'discussionStickied', label: [icon('thumb-tack'), ' Someone stickies a discussion I started'] - }); + }, {after: 'discussionRenamed'}); }); extend(DiscussionList.prototype, 'params', function(params) { params.include.push('startPost'); }); - extend(DiscussionList.prototype, 'infoItems', function(items, discussion) { + extend(DiscussionListItem.prototype, 'infoItems', function(items) { + var discussion = this.props.discussion; + if (discussion.isSticky()) { + console.log(discussion.startPost()) var startPost = discussion.startPost(); if (startPost) { - var excerpt = m('span', startPost.excerpt()); + var excerpt = m('span', truncate(startPost.contentPlain(), 200)); excerpt.wrapperClass = 'discussion-excerpt'; - var item = items.add('excerpt', excerpt, {last: true}); + items.add('excerpt', excerpt, {last: true}); } } }); diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php index c1f03c659..ca2fa685e 100644 --- a/extensions/sticky/src/StickyServiceProvider.php +++ b/extensions/sticky/src/StickyServiceProvider.php @@ -28,6 +28,10 @@ class StickyServiceProvider extends ServiceProvider $attributes['canSticky'] = (bool) $model->can($user, 'sticky'); }), + // include discussion start posts by default + (new Extend\ApiAction('Flarum\Api\Actions\Discussions\IndexAction')) + ->addInclude('startPost'), + new Extend\DiscussionGambit('Flarum\Sticky\StickyGambit'), (new Extend\NotificationType('Flarum\Sticky\DiscussionStickiedNotification', 'Flarum\Api\Serializers\DiscussionBasicSerializer')) From d44b2e840b87e39f2b18e649cc2e3616e3bd0c45 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Jun 2015 10:45:42 +0930 Subject: [PATCH 023/183] Get rid of console.log --- extensions/sticky/js/bootstrap.js | 1 - 1 file changed, 1 deletion(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index 135fca513..5954084dc 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -70,7 +70,6 @@ app.initializers.add('sticky', function() { var discussion = this.props.discussion; if (discussion.isSticky()) { - console.log(discussion.startPost()) var startPost = discussion.startPost(); if (startPost) { var excerpt = m('span', truncate(startPost.contentPlain(), 200)); From b65c1f8624fbc663fd40ec49412da679d9615ae9 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Jun 2015 15:39:53 +0930 Subject: [PATCH 024/183] Update for discussion controls API --- extensions/sticky/js/bootstrap.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index 5954084dc..e56838ba4 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -44,13 +44,13 @@ app.initializers.add('sticky', function() { } // Add a sticky control to discussions. - extend(Discussion.prototype, 'controls', function(items) { + extend(Discussion.prototype, 'moderationControls', function(items) { if (this.canSticky()) { items.add('sticky', ActionButton.component({ label: this.isSticky() ? 'Unsticky' : 'Sticky', icon: 'thumb-tack', onclick: toggleSticky.bind(this) - }), {after: 'rename'}); + })); } }); From 76d58ababa410fbe6bc3dff89c7a170b5cb9345b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Jun 2015 15:40:02 +0930 Subject: [PATCH 025/183] Give the sticky badge precedence --- extensions/sticky/js/bootstrap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js index e56838ba4..f5baf754d 100644 --- a/extensions/sticky/js/bootstrap.js +++ b/extensions/sticky/js/bootstrap.js @@ -30,7 +30,7 @@ app.initializers.add('sticky', function() { label: 'Sticky', icon: 'thumb-tack', className: 'badge-sticky', - })); + }), {last: true}); } }); From 27ed9ab636062d5b10d75a0cb736e4c6af88fa07 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 26 Jun 2015 12:21:47 +0930 Subject: [PATCH 026/183] Update gambit for search API --- extensions/sticky/src/Handlers/StickySearchModifier.php | 2 +- extensions/sticky/src/StickyGambit.php | 8 +++----- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/extensions/sticky/src/Handlers/StickySearchModifier.php b/extensions/sticky/src/Handlers/StickySearchModifier.php index fec49b9e7..021a17cc2 100755 --- a/extensions/sticky/src/Handlers/StickySearchModifier.php +++ b/extensions/sticky/src/Handlers/StickySearchModifier.php @@ -13,7 +13,7 @@ class StickySearchModifier public function reorderSearch(DiscussionSearchWillBePerformed $event) { if ($event->criteria->sort === null) { - $query = $event->searcher->query(); + $query = $event->searcher->getQuery(); if (!is_array($query->orders)) { $query->orders = []; diff --git a/extensions/sticky/src/StickyGambit.php b/extensions/sticky/src/StickyGambit.php index 84c3c2f7d..7dd2262d5 100644 --- a/extensions/sticky/src/StickyGambit.php +++ b/extensions/sticky/src/StickyGambit.php @@ -10,7 +10,7 @@ class StickyGambit extends GambitAbstract * * @var string */ - protected $pattern = 'sticky:(true|false)'; + protected $pattern = 'is:sticky'; /** * Apply conditions to the searcher, given matches from the gambit's @@ -20,10 +20,8 @@ class StickyGambit extends GambitAbstract * @param \Flarum\Core\Search\SearcherInterface $searcher * @return void */ - public function conditions($matches, SearcherInterface $searcher) + protected function conditions(SearcherInterface $searcher, array $matches, $negate) { - $sticky = $matches[1] === 'true'; - - $searcher->query()->where('is_sticky', $sticky); + $searcher->getQuery()->where('is_sticky', ! $negate); } } From 1ad057d4d7cdbe77db8229d94a804813b47fb81f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 20 Jul 2015 18:14:42 +0930 Subject: [PATCH 027/183] Update for evented API --- extensions/sticky/bootstrap.php | 6 +- extensions/sticky/js/Gulpfile.js | 2 +- extensions/sticky/js/bootstrap.js | 81 ------------------- extensions/sticky/js/src/addStickyBadge.js | 15 ++++ extensions/sticky/js/src/addStickyControl.js | 26 ++++++ extensions/sticky/js/src/addStickyExcerpt.js | 24 ++++++ .../DiscussionStickiedNotification.js | 15 ++++ .../src/components/DiscussionStickiedPost.js | 13 +++ .../discussion-stickied-notification.js | 14 ---- .../components/discussion-stickied-post.js | 9 --- extensions/sticky/js/src/main.js | 29 +++++++ extensions/sticky/less/extension.less | 26 ++++++ extensions/sticky/less/sticky.less | 27 ------- extensions/sticky/locale/en.yml | 8 ++ .../src/Events/DiscussionWasStickied.php | 12 +-- .../src/Events/DiscussionWasUnstickied.php | 12 +-- extensions/sticky/src/Extension.php | 16 ++++ .../sticky/src/{ => Gambits}/StickyGambit.php | 12 +-- .../Handlers/DiscussionStickiedNotifier.php | 58 ------------- .../sticky/src/Listeners/AddApiAttributes.php | 30 +++++++ .../sticky/src/Listeners/AddClientAssets.php | 39 +++++++++ .../Listeners/NotifyDiscussionStickied.php | 71 ++++++++++++++++ .../PersistData.php} | 20 ++--- .../PinStickiedDiscussionsToTop.php} | 28 ++++--- .../DiscussionStickiedBlueprint.php} | 18 ++--- .../{ => Posts}/DiscussionStickiedPost.php | 38 +++++---- .../sticky/src/StickyServiceProvider.php | 41 ---------- 27 files changed, 387 insertions(+), 303 deletions(-) delete mode 100644 extensions/sticky/js/bootstrap.js create mode 100644 extensions/sticky/js/src/addStickyBadge.js create mode 100644 extensions/sticky/js/src/addStickyControl.js create mode 100644 extensions/sticky/js/src/addStickyExcerpt.js create mode 100644 extensions/sticky/js/src/components/DiscussionStickiedNotification.js create mode 100644 extensions/sticky/js/src/components/DiscussionStickiedPost.js delete mode 100644 extensions/sticky/js/src/components/discussion-stickied-notification.js delete mode 100644 extensions/sticky/js/src/components/discussion-stickied-post.js create mode 100644 extensions/sticky/js/src/main.js create mode 100644 extensions/sticky/less/extension.less delete mode 100644 extensions/sticky/less/sticky.less create mode 100644 extensions/sticky/locale/en.yml create mode 100644 extensions/sticky/src/Extension.php rename extensions/sticky/src/{ => Gambits}/StickyGambit.php (56%) delete mode 100755 extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php create mode 100755 extensions/sticky/src/Listeners/AddApiAttributes.php create mode 100755 extensions/sticky/src/Listeners/AddClientAssets.php create mode 100755 extensions/sticky/src/Listeners/NotifyDiscussionStickied.php rename extensions/sticky/src/{Handlers/StickySaver.php => Listeners/PersistData.php} (54%) rename extensions/sticky/src/{Handlers/StickySearchModifier.php => Listeners/PinStickiedDiscussionsToTop.php} (55%) rename extensions/sticky/src/{DiscussionStickiedNotification.php => Notifications/DiscussionStickiedBlueprint.php} (73%) rename extensions/sticky/src/{ => Posts}/DiscussionStickiedPost.php (56%) delete mode 100644 extensions/sticky/src/StickyServiceProvider.php diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index f09cac86c..0afa317f8 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -1,9 +1,5 @@ app->register('Flarum\Sticky\StickyServiceProvider'); +return 'Flarum\Sticky\Extension'; diff --git a/extensions/sticky/js/Gulpfile.js b/extensions/sticky/js/Gulpfile.js index fae866679..f015c1647 100644 --- a/extensions/sticky/js/Gulpfile.js +++ b/extensions/sticky/js/Gulpfile.js @@ -1,5 +1,5 @@ var gulp = require('flarum-gulp'); gulp({ - modulePrefix: 'flarum-sticky' + modulePrefix: 'sticky' }); diff --git a/extensions/sticky/js/bootstrap.js b/extensions/sticky/js/bootstrap.js deleted file mode 100644 index f5baf754d..000000000 --- a/extensions/sticky/js/bootstrap.js +++ /dev/null @@ -1,81 +0,0 @@ -import { extend } from 'flarum/extension-utils'; -import Model from 'flarum/model'; -import Discussion from 'flarum/models/discussion'; -import DiscussionPage from 'flarum/components/discussion-page'; -import DiscussionList from 'flarum/components/discussion-list'; -import DiscussionListItem from 'flarum/components/discussion-list-item'; -import Badge from 'flarum/components/badge'; -import ActionButton from 'flarum/components/action-button'; -import SettingsPage from 'flarum/components/settings-page'; -import icon from 'flarum/helpers/icon'; -import truncate from 'flarum/utils/truncate'; -import app from 'flarum/app'; - -import DiscussionStickiedPost from 'flarum-sticky/components/discussion-stickied-post'; -import DiscussionStickiedNotification from 'flarum-sticky/components/discussion-stickied-notification'; - -app.initializers.add('sticky', function() { - - // Register components. - app.postComponentRegistry['discussionStickied'] = DiscussionStickiedPost; - app.notificationComponentRegistry['discussionStickied'] = DiscussionStickiedNotification; - - Discussion.prototype.isSticky = Model.prop('isSticky'); - Discussion.prototype.canSticky = Model.prop('canSticky'); - - // Add a sticky badge to discussions. - extend(Discussion.prototype, 'badges', function(badges) { - if (this.isSticky()) { - badges.add('sticky', Badge.component({ - label: 'Sticky', - icon: 'thumb-tack', - className: 'badge-sticky', - }), {last: true}); - } - }); - - function toggleSticky() { - this.save({isSticky: !this.isSticky()}).then(discussion => { - if (app.current instanceof DiscussionPage) { - app.current.stream.sync(); - } - m.redraw(); - }); - } - - // Add a sticky control to discussions. - extend(Discussion.prototype, 'moderationControls', function(items) { - if (this.canSticky()) { - items.add('sticky', ActionButton.component({ - label: this.isSticky() ? 'Unsticky' : 'Sticky', - icon: 'thumb-tack', - onclick: toggleSticky.bind(this) - })); - } - }); - - // Add a notification preference. - extend(SettingsPage.prototype, 'notificationTypes', function(items) { - items.add('discussionStickied', { - name: 'discussionStickied', - label: [icon('thumb-tack'), ' Someone stickies a discussion I started'] - }, {after: 'discussionRenamed'}); - }); - - extend(DiscussionList.prototype, 'params', function(params) { - params.include.push('startPost'); - }); - - extend(DiscussionListItem.prototype, 'infoItems', function(items) { - var discussion = this.props.discussion; - - if (discussion.isSticky()) { - var startPost = discussion.startPost(); - if (startPost) { - var excerpt = m('span', truncate(startPost.contentPlain(), 200)); - excerpt.wrapperClass = 'discussion-excerpt'; - items.add('excerpt', excerpt, {last: true}); - } - } - }); -}); diff --git a/extensions/sticky/js/src/addStickyBadge.js b/extensions/sticky/js/src/addStickyBadge.js new file mode 100644 index 000000000..1566c3434 --- /dev/null +++ b/extensions/sticky/js/src/addStickyBadge.js @@ -0,0 +1,15 @@ +import { extend } from 'flarum/extend'; +import Discussion from 'flarum/models/Discussion'; +import Badge from 'flarum/components/Badge'; + +export default function addStickyBadge() { + extend(Discussion.prototype, 'badges', function(badges) { + if (this.isSticky()) { + badges.add('sticky', Badge.component({ + type: 'sticky', + label: app.trans('sticky.stickied'), + icon: 'thumb-tack' + }), 10); + } + }); +} diff --git a/extensions/sticky/js/src/addStickyControl.js b/extensions/sticky/js/src/addStickyControl.js new file mode 100644 index 000000000..e7651fd23 --- /dev/null +++ b/extensions/sticky/js/src/addStickyControl.js @@ -0,0 +1,26 @@ +import { extend } from 'flarum/extend'; +import DiscussionControls from 'flarum/utils/DiscussionControls'; +import DiscussionPage from 'flarum/components/DiscussionPage'; +import Button from 'flarum/components/Button'; + +export default function addStickyControl() { + extend(DiscussionControls, 'moderationControls', function(items, discussion) { + if (discussion.canSticky()) { + items.add('sticky', Button.component({ + children: app.trans(discussion.isSticky() ? 'sticky.unsticky' : 'sticky.sticky'), + icon: 'thumb-tack', + onclick: this.stickyAction.bind(discussion) + })); + } + }); + + DiscussionControls.stickyAction = function() { + this.save({isSticky: !this.isSticky()}).then(() => { + if (app.current instanceof DiscussionPage) { + app.current.stream.update(); + } + + m.redraw(); + }); + }; +} diff --git a/extensions/sticky/js/src/addStickyExcerpt.js b/extensions/sticky/js/src/addStickyExcerpt.js new file mode 100644 index 000000000..932f748d5 --- /dev/null +++ b/extensions/sticky/js/src/addStickyExcerpt.js @@ -0,0 +1,24 @@ +import { extend } from 'flarum/extend'; +import DiscussionList from 'flarum/components/DiscussionList'; +import DiscussionListItem from 'flarum/components/DiscussionListItem'; +import { truncate } from 'flarum/utils/string'; + +export default function addStickyControl() { + extend(DiscussionList.prototype, 'requestParams', function(params) { + params.include.push('startPost'); + }); + + extend(DiscussionListItem.prototype, 'infoItems', function(items) { + const discussion = this.props.discussion; + + if (discussion.isSticky()) { + const startPost = discussion.startPost(); + + if (startPost) { + const excerpt = {truncate(startPost.contentPlain(), 200)}; + + items.add('excerpt', excerpt, 100); + } + } + }); +} diff --git a/extensions/sticky/js/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/src/components/DiscussionStickiedNotification.js new file mode 100644 index 000000000..b1dc64217 --- /dev/null +++ b/extensions/sticky/js/src/components/DiscussionStickiedNotification.js @@ -0,0 +1,15 @@ +import Notification from 'flarum/components/Notification'; + +export default class DiscussionStickiedNotification extends Notification { + icon() { + return 'thumb-tack'; + } + + href() { + return app.route.discussion(notification.subject(), notification.content().postNumber); + } + + content() { + return app.trans('sticky.discussion_stickied_notification', {user: this.props.notification.sender()}); + } +} diff --git a/extensions/sticky/js/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/src/components/DiscussionStickiedPost.js new file mode 100644 index 000000000..5b3408e69 --- /dev/null +++ b/extensions/sticky/js/src/components/DiscussionStickiedPost.js @@ -0,0 +1,13 @@ +import EventPost from 'flarum/components/EventPost'; + +export default class DiscussionStickiedPost extends EventPost { + icon() { + return 'thumb-tack'; + } + + descriptionKey() { + return this.props.post.content().sticky + ? 'sticky.discussion_stickied_post' + : 'sticky.discussion_unstickied_post'; + } +} diff --git a/extensions/sticky/js/src/components/discussion-stickied-notification.js b/extensions/sticky/js/src/components/discussion-stickied-notification.js deleted file mode 100644 index 81f636e19..000000000 --- a/extensions/sticky/js/src/components/discussion-stickied-notification.js +++ /dev/null @@ -1,14 +0,0 @@ -import Notification from 'flarum/components/notification'; -import username from 'flarum/helpers/username'; - -export default class DiscussionStickiedNotification extends Notification { - view() { - var notification = this.props.notification; - - return super.view({ - href: app.route.discussion(notification.subject(), notification.content().postNumber), - icon: 'thumb-tack', - content: [username(notification.sender()), ' stickied'] - }); - } -} diff --git a/extensions/sticky/js/src/components/discussion-stickied-post.js b/extensions/sticky/js/src/components/discussion-stickied-post.js deleted file mode 100644 index 3d8e786a4..000000000 --- a/extensions/sticky/js/src/components/discussion-stickied-post.js +++ /dev/null @@ -1,9 +0,0 @@ -import EventPost from 'flarum/components/event-post'; - -export default class DiscussionStickiedPost extends EventPost { - view() { - var post = this.props.post; - - return super.view('thumb-tack', [post.content().sticky ? 'stickied' : 'unstickied', ' the discussion.']); - } -} diff --git a/extensions/sticky/js/src/main.js b/extensions/sticky/js/src/main.js new file mode 100644 index 000000000..655a9b09d --- /dev/null +++ b/extensions/sticky/js/src/main.js @@ -0,0 +1,29 @@ +import { extend, notificationType } from 'flarum/extend'; +import app from 'flarum/app'; +import Model from 'flarum/Model'; +import Discussion from 'flarum/models/Discussion'; +import NotificationGrid from 'flarum/components/NotificationGrid'; + +import DiscussionStickiedPost from 'sticky/components/DiscussionStickiedPost'; +import DiscussionStickiedNotification from 'sticky/components/DiscussionStickiedNotification'; +import addStickyBadge from 'sticky/addStickyBadge'; +import addStickyControl from 'sticky/addStickyControl'; +import addStickyExcerpt from 'sticky/addStickyExcerpt'; + +app.postComponents.discussionStickied = DiscussionStickiedPost; +app.notificationComponents.discussionStickied = DiscussionStickiedNotification; + +Discussion.prototype.isSticky = Model.attribute('isSticky'); +Discussion.prototype.canSticky = Model.attribute('canSticky'); + +addStickyBadge(); +addStickyControl(); +addStickyExcerpt(); + +extend(NotificationGrid.prototype, 'notificationTypes', function(items) { + items.add('discussionStickied', { + name: 'discussionStickied', + icon: 'thumb-tack', + label: app.trans('sticky.notify_discussion_stickied') + }); +}); diff --git a/extensions/sticky/less/extension.less b/extensions/sticky/less/extension.less new file mode 100644 index 000000000..046da8ed5 --- /dev/null +++ b/extensions/sticky/less/extension.less @@ -0,0 +1,26 @@ +.Badge--sticky { + background: #d13e32; +} +.DiscussionStickiedPost { + & .EventPost-icon, + & .EventPost-info, + & .EventPost-info a { + color: #d13e32; + } +} +.DiscussionListItem-info .item-excerpt { + margin-top: 8px; + margin-right: 20px; + white-space: normal; + font-size: 12px; + line-height: 1.5em; + color: @muted-more-color; + display: block; + + .DiscussionPage-list & { + display: none; + } + @media @phone { + display: none; + } +} diff --git a/extensions/sticky/less/sticky.less b/extensions/sticky/less/sticky.less deleted file mode 100644 index cc7456d96..000000000 --- a/extensions/sticky/less/sticky.less +++ /dev/null @@ -1,27 +0,0 @@ -.badge-sticky { - background: #d13e32; -} -.discussion-stickied-post { - & .post-icon, & .event-post-info, & .event-post-info a { - color: #d13e32; - } -} -.discussion-excerpt { - margin-top: 8px; - margin-right: 20px; - white-space: normal; - font-size: 12px; - line-height: 1.5em; - color: @fl-body-muted-more-color; - - .discussion-summary .info > li& { - display: block; - - .paned & { - display: none; - } - @media @phone { - display: none; - } - } -} diff --git a/extensions/sticky/locale/en.yml b/extensions/sticky/locale/en.yml new file mode 100644 index 000000000..b871de0d5 --- /dev/null +++ b/extensions/sticky/locale/en.yml @@ -0,0 +1,8 @@ +sticky: + discussion_stickied_notification: "{username} stickied" + discussion_stickied_post: "{username} stickied the discussion." + discussion_unstickied_post: "{username} unstickied the discussion." + notify_discussion_stickied: Someone stickies a discussion I started + stickied: Sticky + sticky: Sticky + unsticky: Unsticky diff --git a/extensions/sticky/src/Events/DiscussionWasStickied.php b/extensions/sticky/src/Events/DiscussionWasStickied.php index 31432f4aa..f1747a406 100644 --- a/extensions/sticky/src/Events/DiscussionWasStickied.php +++ b/extensions/sticky/src/Events/DiscussionWasStickied.php @@ -1,23 +1,23 @@ subscribe('Flarum\Sticky\Listeners\AddClientAssets'); + $events->subscribe('Flarum\Sticky\Listeners\AddApiAttributes'); + $events->subscribe('Flarum\Sticky\Listeners\PersistData'); + $events->subscribe('Flarum\Sticky\Listeners\PinStickiedDiscussionsToTop'); + $events->subscribe('Flarum\Sticky\Listeners\NotifyDiscussionStickied'); + } +} diff --git a/extensions/sticky/src/StickyGambit.php b/extensions/sticky/src/Gambits/StickyGambit.php similarity index 56% rename from extensions/sticky/src/StickyGambit.php rename to extensions/sticky/src/Gambits/StickyGambit.php index 7dd2262d5..2915ad1b9 100644 --- a/extensions/sticky/src/StickyGambit.php +++ b/extensions/sticky/src/Gambits/StickyGambit.php @@ -1,9 +1,9 @@ -getQuery()->where('is_sticky', ! $negate); + $search->getQuery()->where('is_sticky', ! $negate); } } diff --git a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php b/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php deleted file mode 100755 index c36c5a97a..000000000 --- a/extensions/sticky/src/Handlers/DiscussionStickiedNotifier.php +++ /dev/null @@ -1,58 +0,0 @@ -notifications = $notifications; - } - - /** - * Register the listeners for the subscriber. - * - * @param \Illuminate\Contracts\Events\Dispatcher $events - */ - public function subscribe(Dispatcher $events) - { - $events->listen('Flarum\Sticky\Events\DiscussionWasStickied', __CLASS__.'@whenDiscussionWasStickied'); - $events->listen('Flarum\Sticky\Events\DiscussionWasUnstickied', __CLASS__.'@whenDiscussionWasUnstickied'); - } - - public function whenDiscussionWasStickied(DiscussionWasStickied $event) - { - $this->stickyChanged($event->discussion, $event->user, true); - } - - public function whenDiscussionWasUnstickied(DiscussionWasUnstickied $event) - { - $this->stickyChanged($event->discussion, $event->user, false); - } - - protected function stickyChanged(Discussion $discussion, User $user, $isSticky) - { - $post = DiscussionStickiedPost::reply( - $discussion->id, - $user->id, - $isSticky - ); - - $post = $discussion->addPost($post); - - if ($discussion->start_user_id !== $user->id) { - $notification = new DiscussionStickiedNotification($post); - - $this->notifications->sync($notification, $post->exists ? [$discussion->startUser] : []); - } - } -} diff --git a/extensions/sticky/src/Listeners/AddApiAttributes.php b/extensions/sticky/src/Listeners/AddApiAttributes.php new file mode 100755 index 000000000..c3597275c --- /dev/null +++ b/extensions/sticky/src/Listeners/AddApiAttributes.php @@ -0,0 +1,30 @@ +listen(ApiAttributes::class, __CLASS__.'@addAttributes'); + $events->listen(BuildApiAction::class, __CLASS__.'@includeStartPost'); + } + + public function addAttributes(ApiAttributes $event) + { + if ($event->serializer instanceof DiscussionSerializer) { + $event->attributes['isSticky'] = (bool) $event->model->is_sticky; + $event->attributes['canSticky'] = (bool) $event->model->can($event->actor, 'sticky'); + } + } + public function includeStartPost(BuildApiAction $event) + { + if ($event->action instanceof DiscussionsIndexAction) { + $event->addInclude('startPost'); + } + } +} diff --git a/extensions/sticky/src/Listeners/AddClientAssets.php b/extensions/sticky/src/Listeners/AddClientAssets.php new file mode 100755 index 000000000..0d5d8d3bb --- /dev/null +++ b/extensions/sticky/src/Listeners/AddClientAssets.php @@ -0,0 +1,39 @@ +listen(RegisterLocales::class, __CLASS__.'@addLocale'); + $events->listen(BuildClientView::class, __CLASS__.'@addAssets'); + } + + public function addLocale(RegisterLocales $event) + { + $event->addTranslations('en', __DIR__.'/../../locale/en.yml'); + } + + public function addAssets(BuildClientView $event) + { + $event->forumAssets([ + __DIR__.'/../../js/dist/extension.js', + __DIR__.'/../../less/extension.less' + ]); + + $event->forumBootstrapper('sticky/main'); + + $event->forumTranslations([ + 'sticky.discussion_stickied_notification', + 'sticky.discussion_stickied_post', + 'sticky.discussion_unstickied_post', + 'sticky.notify_discussion_stickied', + 'sticky.stickied', + 'sticky.sticky', + 'sticky.unsticky' + ]); + } +} diff --git a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php new file mode 100755 index 000000000..15eb094ab --- /dev/null +++ b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php @@ -0,0 +1,71 @@ +notifications = $notifications; + } + + public function subscribe(Dispatcher $events) + { + $events->listen(RegisterPostTypes::class, __CLASS__.'@registerPostType'); + $events->listen(RegisterNotificationTypes::class, __CLASS__.'@registerNotificationType'); + $events->listen(DiscussionWasStickied::class, __CLASS__.'@whenDiscussionWasStickied'); + $events->listen(DiscussionWasUnstickied::class, __CLASS__.'@whenDiscussionWasUnstickied'); + } + + public function registerPostType(RegisterPostTypes $event) + { + $event->register('Flarum\Sticky\Posts\DiscussionStickiedPost'); + } + + public function registerNotificationType(RegisterNotificationTypes $event) + { + $event->register( + 'Flarum\Sticky\Notifications\DiscussionStickiedBlueprint', + 'Flarum\Api\Serializers\DiscussionBasicSerializer', + ['alert'] + ); + } + + public function whenDiscussionWasStickied(DiscussionWasStickied $event) + { + $this->stickyChanged($event->discussion, $event->user, true); + } + + public function whenDiscussionWasUnstickied(DiscussionWasUnstickied $event) + { + $this->stickyChanged($event->discussion, $event->user, false); + } + + protected function stickyChanged(Discussion $discussion, User $user, $isSticky) + { + $post = DiscussionStickiedPost::reply( + $discussion->id, + $user->id, + $isSticky + ); + + $post = $discussion->mergePost($post); + + if ($discussion->start_user_id !== $user->id) { + $notification = new DiscussionStickiedBlueprint($post); + + $this->notifications->sync($notification, $post->exists ? [$discussion->startUser] : []); + } + } +} diff --git a/extensions/sticky/src/Handlers/StickySaver.php b/extensions/sticky/src/Listeners/PersistData.php similarity index 54% rename from extensions/sticky/src/Handlers/StickySaver.php rename to extensions/sticky/src/Listeners/PersistData.php index d01da961c..c434bd6b6 100755 --- a/extensions/sticky/src/Handlers/StickySaver.php +++ b/extensions/sticky/src/Listeners/PersistData.php @@ -1,24 +1,24 @@ -listen('Flarum\Core\Events\DiscussionWillBeSaved', __CLASS__.'@whenDiscussionWillBeSaved'); + $events->listen(DiscussionWillBeSaved::class, __CLASS__.'@whenDiscussionWillBeSaved'); } public function whenDiscussionWillBeSaved(DiscussionWillBeSaved $event) { - if (isset($event->command->data['isSticky'])) { - $isSticky = (bool) $event->command->data['isSticky']; + if (isset($event->data['attributes']['isSticky'])) { + $isSticky = (bool) $event->data['attributes']['isSticky']; $discussion = $event->discussion; - $user = $event->command->user; + $actor = $event->actor; - $discussion->assertCan($user, 'sticky'); + $discussion->assertCan($actor, 'sticky'); if ((bool) $discussion->is_sticky === $isSticky) { return; @@ -28,8 +28,8 @@ class StickySaver $discussion->raise( $discussion->is_sticky - ? new DiscussionWasStickied($discussion, $user) - : new DiscussionWasUnstickied($discussion, $user) + ? new DiscussionWasStickied($discussion, $actor) + : new DiscussionWasUnstickied($discussion, $actor) ); } } diff --git a/extensions/sticky/src/Handlers/StickySearchModifier.php b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php similarity index 55% rename from extensions/sticky/src/Handlers/StickySearchModifier.php rename to extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php index 021a17cc2..ce3e236a6 100755 --- a/extensions/sticky/src/Handlers/StickySearchModifier.php +++ b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php @@ -1,25 +1,33 @@ -listen('Flarum\Core\Events\DiscussionSearchWillBePerformed', __CLASS__.'@reorderSearch'); + $events->listen(RegisterDiscussionGambits::class, __CLASS__.'@registerStickyGambit'); + $events->listen(DiscussionSearchWillBePerformed::class, __CLASS__.'@reorderSearch'); + } + + public function registerStickyGambit(RegisterDiscussionGambits $event) + { + $event->gambits->add('Flarum\Sticky\Gambits\StickyGambit'); } public function reorderSearch(DiscussionSearchWillBePerformed $event) { if ($event->criteria->sort === null) { - $query = $event->searcher->getQuery(); + $query = $event->search->getQuery(); - if (!is_array($query->orders)) { + if (! is_array($query->orders)) { $query->orders = []; } - foreach ($event->searcher->getActiveGambits() as $gambit) { + foreach ($event->search->getActiveGambits() as $gambit) { if ($gambit instanceof TagGambit) { array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); return; @@ -29,7 +37,7 @@ class StickySearchModifier $query->leftJoin('users_discussions', function ($join) use ($event) { $join->on('users_discussions.discussion_id', '=', 'discussions.id') ->where('discussions.is_sticky', '=', true) - ->where('users_discussions.user_id', '=', $event->criteria->user->id); + ->where('users_discussions.user_id', '=', $event->search->getActor()->id); }); // might be quicker to do a subquery in the order clause than a join? array_unshift( diff --git a/extensions/sticky/src/DiscussionStickiedNotification.php b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php similarity index 73% rename from extensions/sticky/src/DiscussionStickiedNotification.php rename to extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php index b9ff17b0b..3fa44c4c5 100644 --- a/extensions/sticky/src/DiscussionStickiedNotification.php +++ b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php @@ -1,8 +1,8 @@ -post = $post; } - public function getSubject() - { - return $this->post->discussion; - } - public function getSender() { return $this->post->user; } + public function getSubject() + { + return $this->post->discussion; + } + public function getData() { return ['postNumber' => (int) $this->post->number]; @@ -33,6 +33,6 @@ class DiscussionStickiedNotification extends NotificationAbstract public static function getSubjectModel() { - return 'Flarum\Core\Models\Discussion'; + return 'Flarum\Core\Discussions\Discussion'; } } diff --git a/extensions/sticky/src/DiscussionStickiedPost.php b/extensions/sticky/src/Posts/DiscussionStickiedPost.php similarity index 56% rename from extensions/sticky/src/DiscussionStickiedPost.php rename to extensions/sticky/src/Posts/DiscussionStickiedPost.php index 5d94bd947..9af84f4c2 100755 --- a/extensions/sticky/src/DiscussionStickiedPost.php +++ b/extensions/sticky/src/Posts/DiscussionStickiedPost.php @@ -1,35 +1,33 @@ -user_id === $previous->user_id) { + // If the previous post is another 'discussion stickied' post, and it's + // by the same user, then we can merge this post into it. If we find + // that we've in fact reverted the sticky status, delete it. Otherwise, + // update its content. + if ($previous instanceof static && $this->user_id === $previous->user_id) { if ($previous->content['sticky'] != $this->content['sticky']) { - return; + $previous->delete(); + } else { + $previous->content = $this->content; + + $previous->save(); } - $previous->content = $this->content; return $previous; } + $this->save(); + return $this; } diff --git a/extensions/sticky/src/StickyServiceProvider.php b/extensions/sticky/src/StickyServiceProvider.php deleted file mode 100644 index ca2fa685e..000000000 --- a/extensions/sticky/src/StickyServiceProvider.php +++ /dev/null @@ -1,41 +0,0 @@ -extend( - new Extend\EventSubscriber([ - 'Flarum\Sticky\Handlers\StickySaver', - 'Flarum\Sticky\Handlers\StickySearchModifier', - 'Flarum\Sticky\Handlers\DiscussionStickiedNotifier' - ]), - - (new Extend\ForumClient()) - ->assets([ - __DIR__.'/../js/dist/extension.js', - __DIR__.'/../less/sticky.less' - ]), - - new Extend\PostType('Flarum\Sticky\DiscussionStickiedPost'), - - (new Extend\ApiSerializer('Flarum\Api\Serializers\DiscussionSerializer')) - ->attributes(function (&$attributes, $model, $user) { - $attributes['isSticky'] = (bool) $model->is_sticky; - $attributes['canSticky'] = (bool) $model->can($user, 'sticky'); - }), - - // include discussion start posts by default - (new Extend\ApiAction('Flarum\Api\Actions\Discussions\IndexAction')) - ->addInclude('startPost'), - - new Extend\DiscussionGambit('Flarum\Sticky\StickyGambit'), - - (new Extend\NotificationType('Flarum\Sticky\DiscussionStickiedNotification', 'Flarum\Api\Serializers\DiscussionBasicSerializer')) - ->enableByDefault('alert') - ); - } -} From 4f4bc435757e8dc7ef30f029a2353068a05de71d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 20 Jul 2015 18:14:52 +0930 Subject: [PATCH 028/183] Update meta --- extensions/sticky/.editorconfig | 32 ++++++ extensions/sticky/.eslintignore | 5 + extensions/sticky/.eslintrc | 171 ++++++++++++++++++++++++++++++++ extensions/sticky/flarum.json | 10 +- 4 files changed, 212 insertions(+), 6 deletions(-) create mode 100644 extensions/sticky/.editorconfig create mode 100644 extensions/sticky/.eslintignore create mode 100644 extensions/sticky/.eslintrc diff --git a/extensions/sticky/.editorconfig b/extensions/sticky/.editorconfig new file mode 100644 index 000000000..5612a5e74 --- /dev/null +++ b/extensions/sticky/.editorconfig @@ -0,0 +1,32 @@ +# EditorConfig helps developers define and maintain consistent +# coding styles between different editors and IDEs +# editorconfig.org + +root = true + +[*] +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_style = space +indent_size = 2 + +[*.js] +indent_style = space +indent_size = 2 + +[*.{css,less}] +indent_style = space +indent_size = 2 + +[*.html] +indent_style = space +indent_size = 2 + +[*.{diff,md}] +trim_trailing_whitespace = false + +[*.php] +indent_style = space +indent_size = 4 diff --git a/extensions/sticky/.eslintignore b/extensions/sticky/.eslintignore new file mode 100644 index 000000000..86b7c8854 --- /dev/null +++ b/extensions/sticky/.eslintignore @@ -0,0 +1,5 @@ +**/bower_components/**/* +**/node_modules/**/* +vendor/**/* +**/Gulpfile.js +**/dist/**/* diff --git a/extensions/sticky/.eslintrc b/extensions/sticky/.eslintrc new file mode 100644 index 000000000..9cebc759d --- /dev/null +++ b/extensions/sticky/.eslintrc @@ -0,0 +1,171 @@ +{ + "parser": "babel-eslint", // https://github.com/babel/babel-eslint + "env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments + "browser": true // browser global variables + }, + "ecmaFeatures": { + "arrowFunctions": true, + "blockBindings": true, + "classes": true, + "defaultParams": true, + "destructuring": true, + "forOf": true, + "generators": false, + "modules": true, + "objectLiteralComputedProperties": true, + "objectLiteralDuplicateProperties": false, + "objectLiteralShorthandMethods": true, + "objectLiteralShorthandProperties": true, + "spread": true, + "superInFunctions": true, + "templateStrings": true, + "jsx": true + }, + "globals": { + "m": true, + "app": true, + "$": true, + "moment": true + }, + "rules": { +/** + * Strict mode + */ + // babel inserts "use strict"; for us + "strict": [2, "never"], // http://eslint.org/docs/rules/strict + +/** + * ES6 + */ + "no-var": 2, // http://eslint.org/docs/rules/no-var + "prefer-const": 2, // http://eslint.org/docs/rules/prefer-const + +/** + * Variables + */ + "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow + "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names + "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars + "vars": "local", + "args": "after-used" + }], + "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define + +/** + * Possible errors + */ + "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle + "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign + "no-console": 1, // http://eslint.org/docs/rules/no-console + "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger + "no-alert": 1, // http://eslint.org/docs/rules/no-alert + "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition + "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys + "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case + "no-empty": 2, // http://eslint.org/docs/rules/no-empty + "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign + "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast + "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi + "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign + "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations + "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp + "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace + "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls + "no-reserved-keys": 2, // http://eslint.org/docs/rules/no-reserved-keys + "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays + "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable + "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan + "block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var + +/** + * Best practices + */ + "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return + "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly + "default-case": 2, // http://eslint.org/docs/rules/default-case + "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation + "allowKeywords": true + }], + "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq + "no-caller": 2, // http://eslint.org/docs/rules/no-caller + "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return + "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null + "no-eval": 2, // http://eslint.org/docs/rules/no-eval + "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native + "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind + "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough + "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal + "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval + "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks + "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func + "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str + "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign + "no-new": 2, // http://eslint.org/docs/rules/no-new + "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func + "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers + "no-octal": 2, // http://eslint.org/docs/rules/no-octal + "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape + "no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign + "no-proto": 2, // http://eslint.org/docs/rules/no-proto + "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare + "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign + "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare + "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences + "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal + "no-with": 2, // http://eslint.org/docs/rules/no-with + "radix": 2, // http://eslint.org/docs/rules/radix + "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top + "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife + "yoda": 2, // http://eslint.org/docs/rules/yoda + +/** + * Style + */ + "indent": [2, 2], // http://eslint.org/docs/rules/indent + "brace-style": [2, // http://eslint.org/docs/rules/brace-style + "1tbs", { + "allowSingleLine": true + }], + "quotes": [ + 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes + ], + "camelcase": [2, { // http://eslint.org/docs/rules/camelcase + "properties": "never" + }], + "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing + "before": false, + "after": true + }], + "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style + "eol-last": 2, // http://eslint.org/docs/rules/eol-last + "func-names": 1, // http://eslint.org/docs/rules/func-names + "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing + "beforeColon": false, + "afterColon": true + }], + "new-cap": [2, { // http://eslint.org/docs/rules/new-cap + "newIsCap": true + }], + "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines + "max": 2 + }], + "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object + "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func + "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces + "no-wrap-func": 2, // http://eslint.org/docs/rules/no-wrap-func + "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle + "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var + "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks + "semi": [2, "always"], // http://eslint.org/docs/rules/semi + "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing + "before": false, + "after": true + }], + "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords + "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks + "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren + "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops + "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case + "spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment + } +} diff --git a/extensions/sticky/flarum.json b/extensions/sticky/flarum.json index db93e353e..78880df55 100644 --- a/extensions/sticky/flarum.json +++ b/extensions/sticky/flarum.json @@ -1,10 +1,8 @@ { - "name": "flarum-sticky", + "name": "sticky", "title": "Sticky", "description": "Pin discussions to the top of the list.", - "tags": [ - "discussions" - ], + "keywords": ["discussions"], "version": "0.1.0", "author": { "name": "Toby Zerner", @@ -16,8 +14,8 @@ "php": ">=5.4.0", "flarum": ">0.1.0" }, - "links": { - "github": "https://github.com/flarum/sticky", + "support": { + "source": "https://github.com/flarum/sticky", "issues": "https://github.com/flarum/sticky/issues" } } From 115551c9ceda241b49e183fc6a69639127c06b99 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 22 Jul 2015 10:14:20 +0930 Subject: [PATCH 029/183] Group assets by client --- extensions/sticky/js/{ => forum}/Gulpfile.js | 0 extensions/sticky/js/{ => forum}/package.json | 0 extensions/sticky/js/{ => forum}/src/addStickyBadge.js | 0 extensions/sticky/js/{ => forum}/src/addStickyControl.js | 0 extensions/sticky/js/{ => forum}/src/addStickyExcerpt.js | 2 +- .../src/components/DiscussionStickiedNotification.js | 0 .../js/{ => forum}/src/components/DiscussionStickiedPost.js | 0 extensions/sticky/js/{ => forum}/src/main.js | 0 extensions/sticky/less/{ => forum}/extension.less | 0 extensions/sticky/src/Listeners/AddClientAssets.php | 4 ++-- 10 files changed, 3 insertions(+), 3 deletions(-) rename extensions/sticky/js/{ => forum}/Gulpfile.js (100%) rename extensions/sticky/js/{ => forum}/package.json (100%) rename extensions/sticky/js/{ => forum}/src/addStickyBadge.js (100%) rename extensions/sticky/js/{ => forum}/src/addStickyControl.js (100%) rename extensions/sticky/js/{ => forum}/src/addStickyExcerpt.js (94%) rename extensions/sticky/js/{ => forum}/src/components/DiscussionStickiedNotification.js (100%) rename extensions/sticky/js/{ => forum}/src/components/DiscussionStickiedPost.js (100%) rename extensions/sticky/js/{ => forum}/src/main.js (100%) rename extensions/sticky/less/{ => forum}/extension.less (100%) diff --git a/extensions/sticky/js/Gulpfile.js b/extensions/sticky/js/forum/Gulpfile.js similarity index 100% rename from extensions/sticky/js/Gulpfile.js rename to extensions/sticky/js/forum/Gulpfile.js diff --git a/extensions/sticky/js/package.json b/extensions/sticky/js/forum/package.json similarity index 100% rename from extensions/sticky/js/package.json rename to extensions/sticky/js/forum/package.json diff --git a/extensions/sticky/js/src/addStickyBadge.js b/extensions/sticky/js/forum/src/addStickyBadge.js similarity index 100% rename from extensions/sticky/js/src/addStickyBadge.js rename to extensions/sticky/js/forum/src/addStickyBadge.js diff --git a/extensions/sticky/js/src/addStickyControl.js b/extensions/sticky/js/forum/src/addStickyControl.js similarity index 100% rename from extensions/sticky/js/src/addStickyControl.js rename to extensions/sticky/js/forum/src/addStickyControl.js diff --git a/extensions/sticky/js/src/addStickyExcerpt.js b/extensions/sticky/js/forum/src/addStickyExcerpt.js similarity index 94% rename from extensions/sticky/js/src/addStickyExcerpt.js rename to extensions/sticky/js/forum/src/addStickyExcerpt.js index 932f748d5..a08591f25 100644 --- a/extensions/sticky/js/src/addStickyExcerpt.js +++ b/extensions/sticky/js/forum/src/addStickyExcerpt.js @@ -17,7 +17,7 @@ export default function addStickyControl() { if (startPost) { const excerpt = {truncate(startPost.contentPlain(), 200)}; - items.add('excerpt', excerpt, 100); + items.add('excerpt', excerpt, -100); } } }); diff --git a/extensions/sticky/js/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js similarity index 100% rename from extensions/sticky/js/src/components/DiscussionStickiedNotification.js rename to extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js diff --git a/extensions/sticky/js/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js similarity index 100% rename from extensions/sticky/js/src/components/DiscussionStickiedPost.js rename to extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js diff --git a/extensions/sticky/js/src/main.js b/extensions/sticky/js/forum/src/main.js similarity index 100% rename from extensions/sticky/js/src/main.js rename to extensions/sticky/js/forum/src/main.js diff --git a/extensions/sticky/less/extension.less b/extensions/sticky/less/forum/extension.less similarity index 100% rename from extensions/sticky/less/extension.less rename to extensions/sticky/less/forum/extension.less diff --git a/extensions/sticky/src/Listeners/AddClientAssets.php b/extensions/sticky/src/Listeners/AddClientAssets.php index 0d5d8d3bb..63ccb33f5 100755 --- a/extensions/sticky/src/Listeners/AddClientAssets.php +++ b/extensions/sticky/src/Listeners/AddClientAssets.php @@ -20,8 +20,8 @@ class AddClientAssets public function addAssets(BuildClientView $event) { $event->forumAssets([ - __DIR__.'/../../js/dist/extension.js', - __DIR__.'/../../less/extension.less' + __DIR__.'/../../js/forum/dist/extension.js', + __DIR__.'/../../less/forum/extension.less' ]); $event->forumBootstrapper('sticky/main'); From 97ef05de203a1a967058f44f30b193b1eda854f4 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 23 Jul 2015 16:40:41 +0930 Subject: [PATCH 030/183] Fix notification error --- extensions/sticky/src/Listeners/AddApiAttributes.php | 1 + .../sticky/src/Notifications/DiscussionStickiedBlueprint.php | 1 + 2 files changed, 2 insertions(+) diff --git a/extensions/sticky/src/Listeners/AddApiAttributes.php b/extensions/sticky/src/Listeners/AddApiAttributes.php index c3597275c..1c0266ed8 100755 --- a/extensions/sticky/src/Listeners/AddApiAttributes.php +++ b/extensions/sticky/src/Listeners/AddApiAttributes.php @@ -21,6 +21,7 @@ class AddApiAttributes $event->attributes['canSticky'] = (bool) $event->model->can($event->actor, 'sticky'); } } + public function includeStartPost(BuildApiAction $event) { if ($event->action instanceof DiscussionsIndexAction) { diff --git a/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php index 3fa44c4c5..badad33d2 100644 --- a/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php +++ b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php @@ -1,5 +1,6 @@ Date: Mon, 27 Jul 2015 11:54:35 +0930 Subject: [PATCH 031/183] PERF: avoid reinstantiation of event subscribers --- extensions/sticky/src/Listeners/AddApiAttributes.php | 4 ++-- extensions/sticky/src/Listeners/AddClientAssets.php | 4 ++-- .../sticky/src/Listeners/NotifyDiscussionStickied.php | 8 ++++---- extensions/sticky/src/Listeners/PersistData.php | 2 +- .../sticky/src/Listeners/PinStickiedDiscussionsToTop.php | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/extensions/sticky/src/Listeners/AddApiAttributes.php b/extensions/sticky/src/Listeners/AddApiAttributes.php index 1c0266ed8..90904fce7 100755 --- a/extensions/sticky/src/Listeners/AddApiAttributes.php +++ b/extensions/sticky/src/Listeners/AddApiAttributes.php @@ -10,8 +10,8 @@ class AddApiAttributes { public function subscribe(Dispatcher $events) { - $events->listen(ApiAttributes::class, __CLASS__.'@addAttributes'); - $events->listen(BuildApiAction::class, __CLASS__.'@includeStartPost'); + $events->listen(ApiAttributes::class, [$this, 'addAttributes']); + $events->listen(BuildApiAction::class, [$this, 'includeStartPost']); } public function addAttributes(ApiAttributes $event) diff --git a/extensions/sticky/src/Listeners/AddClientAssets.php b/extensions/sticky/src/Listeners/AddClientAssets.php index 63ccb33f5..c7bf5e6bc 100755 --- a/extensions/sticky/src/Listeners/AddClientAssets.php +++ b/extensions/sticky/src/Listeners/AddClientAssets.php @@ -8,8 +8,8 @@ class AddClientAssets { public function subscribe(Dispatcher $events) { - $events->listen(RegisterLocales::class, __CLASS__.'@addLocale'); - $events->listen(BuildClientView::class, __CLASS__.'@addAssets'); + $events->listen(RegisterLocales::class, [$this, 'addLocale']); + $events->listen(BuildClientView::class, [$this, 'addAssets']); } public function addLocale(RegisterLocales $event) diff --git a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php index 15eb094ab..1244cb934 100755 --- a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php +++ b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php @@ -22,10 +22,10 @@ class NotifyDiscussionStickied public function subscribe(Dispatcher $events) { - $events->listen(RegisterPostTypes::class, __CLASS__.'@registerPostType'); - $events->listen(RegisterNotificationTypes::class, __CLASS__.'@registerNotificationType'); - $events->listen(DiscussionWasStickied::class, __CLASS__.'@whenDiscussionWasStickied'); - $events->listen(DiscussionWasUnstickied::class, __CLASS__.'@whenDiscussionWasUnstickied'); + $events->listen(RegisterPostTypes::class, [$this, 'registerPostType']); + $events->listen(RegisterNotificationTypes::class, [$this, 'registerNotificationType']); + $events->listen(DiscussionWasStickied::class, [$this, 'whenDiscussionWasStickied']); + $events->listen(DiscussionWasUnstickied::class, [$this, 'whenDiscussionWasUnstickied']); } public function registerPostType(RegisterPostTypes $event) diff --git a/extensions/sticky/src/Listeners/PersistData.php b/extensions/sticky/src/Listeners/PersistData.php index c434bd6b6..6a70088ef 100755 --- a/extensions/sticky/src/Listeners/PersistData.php +++ b/extensions/sticky/src/Listeners/PersistData.php @@ -8,7 +8,7 @@ class PersistData { public function subscribe($events) { - $events->listen(DiscussionWillBeSaved::class, __CLASS__.'@whenDiscussionWillBeSaved'); + $events->listen(DiscussionWillBeSaved::class, [$this, 'whenDiscussionWillBeSaved']); } public function whenDiscussionWillBeSaved(DiscussionWillBeSaved $event) diff --git a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php index ce3e236a6..5e88cf5bb 100755 --- a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php @@ -9,8 +9,8 @@ class PinStickiedDiscussionsToTop { public function subscribe(Dispatcher $events) { - $events->listen(RegisterDiscussionGambits::class, __CLASS__.'@registerStickyGambit'); - $events->listen(DiscussionSearchWillBePerformed::class, __CLASS__.'@reorderSearch'); + $events->listen(RegisterDiscussionGambits::class, [$this, 'registerStickyGambit']); + $events->listen(DiscussionSearchWillBePerformed::class, [$this, 'reorderSearch']); } public function registerStickyGambit(RegisterDiscussionGambits $event) From e450a90464fb773a6993aae6d797192f463cb896 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 27 Jul 2015 14:19:43 +0930 Subject: [PATCH 032/183] Update gulp module configuration --- extensions/sticky/js/forum/Gulpfile.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/js/forum/Gulpfile.js b/extensions/sticky/js/forum/Gulpfile.js index f015c1647..2cf16b3ea 100644 --- a/extensions/sticky/js/forum/Gulpfile.js +++ b/extensions/sticky/js/forum/Gulpfile.js @@ -1,5 +1,7 @@ var gulp = require('flarum-gulp'); gulp({ - modulePrefix: 'sticky' + modules: { + 'sticky': 'src/**/*.js' + } }); From 145f783006f5518de7d554e1833339501b8582b1 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 28 Jul 2015 15:35:28 +0930 Subject: [PATCH 033/183] Fix notification error --- .../js/forum/src/components/DiscussionStickiedNotification.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js index b1dc64217..cc99d9a35 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js @@ -6,6 +6,8 @@ export default class DiscussionStickiedNotification extends Notification { } href() { + const notification = this.props.notification; + return app.route.discussion(notification.subject(), notification.content().postNumber); } From 84abfd1a58bb972cdbaf8a3a758c64aaff0a3677 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 13 Aug 2015 12:50:52 +0930 Subject: [PATCH 034/183] Add icon --- extensions/sticky/flarum.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/flarum.json b/extensions/sticky/flarum.json index 78880df55..dee1616fc 100644 --- a/extensions/sticky/flarum.json +++ b/extensions/sticky/flarum.json @@ -2,7 +2,7 @@ "name": "sticky", "title": "Sticky", "description": "Pin discussions to the top of the list.", - "keywords": ["discussions"], + "keywords": ["moderation"], "version": "0.1.0", "author": { "name": "Toby Zerner", @@ -17,5 +17,10 @@ "support": { "source": "https://github.com/flarum/sticky", "issues": "https://github.com/flarum/sticky/issues" + }, + "icon": { + "name": "thumb-tack", + "backgroundColor": "#D13E32", + "color": "#fff" } } From 8531580f06438007d02cbd0b0f192fdf010f1ff2 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 13 Aug 2015 12:50:59 +0930 Subject: [PATCH 035/183] Use new listen API --- extensions/sticky/src/Extension.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/src/Extension.php b/extensions/sticky/src/Extension.php index 232f27c15..e8ef27b9f 100644 --- a/extensions/sticky/src/Extension.php +++ b/extensions/sticky/src/Extension.php @@ -1,11 +1,11 @@ subscribe('Flarum\Sticky\Listeners\AddClientAssets'); $events->subscribe('Flarum\Sticky\Listeners\AddApiAttributes'); From 05c74383965a7575bfefe8c317854af456ea135b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 14 Aug 2015 12:55:33 +0930 Subject: [PATCH 036/183] Update migrations --- .../2015_02_24_000000_add_sticky_to_discussions.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index 1a0884c53..0afb5472a 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -1,7 +1,7 @@ schema->table('discussions', function (Blueprint $table) { $table->boolean('is_sticky')->default(0); }); } @@ -24,7 +24,7 @@ class AddStickyToDiscussions extends Migration */ public function down() { - Schema::table('discussions', function (Blueprint $table) { + $this->schema->table('discussions', function (Blueprint $table) { $table->dropColumn('is_sticky'); }); } From a90dfd686ad1de3966ffbfc1a9daa6f6e2e14ce3 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sat, 29 Aug 2015 23:02:00 +0200 Subject: [PATCH 037/183] Make sure query filter works with database prefix, too Related to flarum/core#269. --- .../sticky/src/Listeners/PinStickiedDiscussionsToTop.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php index 5e88cf5bb..cde0d2526 100755 --- a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php @@ -39,10 +39,15 @@ class PinStickiedDiscussionsToTop ->where('discussions.is_sticky', '=', true) ->where('users_discussions.user_id', '=', $event->search->getActor()->id); }); + // might be quicker to do a subquery in the order clause than a join? + $prefix = app('Illuminate\Database\ConnectionInterface')->getTablePrefix(); array_unshift( $query->orders, - ['type' => 'raw', 'sql' => '(is_sticky AND (users_discussions.read_number IS NULL OR discussions.last_post_number > users_discussions.read_number)) desc'] + [ + 'type' => 'raw', + 'sql' => "(is_sticky AND ({$prefix}users_discussions.read_number IS NULL OR {$prefix}discussions.last_post_number > {$prefix}users_discussions.read_number)) desc" + ] ); } } From 76a6673088ea37d55fe63b11211fe00cf13fef18 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 11:36:07 +0930 Subject: [PATCH 038/183] Add phpcs, Travis, clean up editorconfig and eslint --- extensions/sticky/.editorconfig | 13 ------------- extensions/sticky/.eslintrc | 5 +++++ extensions/sticky/.php_cs | 27 +++++++++++++++++++++++++++ extensions/sticky/.travis.yml | 23 +++++++++++++++++++++++ extensions/sticky/composer.json | 3 +++ 5 files changed, 58 insertions(+), 13 deletions(-) create mode 100755 extensions/sticky/.php_cs create mode 100644 extensions/sticky/.travis.yml diff --git a/extensions/sticky/.editorconfig b/extensions/sticky/.editorconfig index 5612a5e74..87694ddab 100644 --- a/extensions/sticky/.editorconfig +++ b/extensions/sticky/.editorconfig @@ -12,21 +12,8 @@ insert_final_newline = true indent_style = space indent_size = 2 -[*.js] -indent_style = space -indent_size = 2 - -[*.{css,less}] -indent_style = space -indent_size = 2 - -[*.html] -indent_style = space -indent_size = 2 - [*.{diff,md}] trim_trailing_whitespace = false [*.php] -indent_style = space indent_size = 4 diff --git a/extensions/sticky/.eslintrc b/extensions/sticky/.eslintrc index 9cebc759d..534b50e27 100644 --- a/extensions/sticky/.eslintrc +++ b/extensions/sticky/.eslintrc @@ -27,7 +27,12 @@ "$": true, "moment": true }, + "plugins": [ + "react" + ], "rules": { + "react/jsx-uses-vars": 1, + /** * Strict mode */ diff --git a/extensions/sticky/.php_cs b/extensions/sticky/.php_cs new file mode 100755 index 000000000..c55085293 --- /dev/null +++ b/extensions/sticky/.php_cs @@ -0,0 +1,27 @@ + + +For the full copyright and license information, please view the LICENSE +file that was distributed with this source code. +EOF; + +Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); + +$finder = Symfony\CS\Finder\DefaultFinder::create() + ->exclude('js') + ->exclude('less') + ->in(__DIR__); + +return Symfony\CS\Config\Config::create() + ->setUsingCache(true) + ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) + ->fixers([ + 'short_array_syntax', + 'header_comment', + '-psr0' + ]) + ->finder($finder); diff --git a/extensions/sticky/.travis.yml b/extensions/sticky/.travis.yml new file mode 100644 index 000000000..692e09f86 --- /dev/null +++ b/extensions/sticky/.travis.yml @@ -0,0 +1,23 @@ +language: php + +php: + - 5.5 + - 5.6 + +matrix: + allow_failures: + - php: hhvm + fast_finish: true + +before_script: + - curl -s http://getcomposer.org/installer | php + - php composer.phar install + +script: + - php composer.phar style + +notifications: + email: + on_failure: change + +sudo: false diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 75a7bc603..71d98ca20 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -3,5 +3,8 @@ "psr-4": { "Flarum\\Sticky\\": "src/" } + }, + "scripts": { + "style": "phpcs --standard=PSR2 -np src" } } From fd5a6e6a5d0825fce1d33a33e229cedde66f8ee8 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 11:47:53 +0930 Subject: [PATCH 039/183] Update flarum.json --- extensions/sticky/flarum.json | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/extensions/sticky/flarum.json b/extensions/sticky/flarum.json index dee1616fc..a63475675 100644 --- a/extensions/sticky/flarum.json +++ b/extensions/sticky/flarum.json @@ -3,7 +3,7 @@ "title": "Sticky", "description": "Pin discussions to the top of the list.", "keywords": ["moderation"], - "version": "0.1.0", + "version": "0.1.0-beta.2", "author": { "name": "Toby Zerner", "email": "toby@flarum.org", @@ -11,16 +11,15 @@ }, "license": "MIT", "require": { - "php": ">=5.4.0", - "flarum": ">0.1.0" + "flarum": ">=0.1.0-beta.2" }, "support": { "source": "https://github.com/flarum/sticky", - "issues": "https://github.com/flarum/sticky/issues" + "issues": "https://github.com/flarum/core/issues" }, "icon": { - "name": "thumb-tack", - "backgroundColor": "#D13E32", - "color": "#fff" + "name": "thumb-tack", + "backgroundColor": "#D13E32", + "color": "#fff" } } From 33c86f38f1fe7d77c36fc836c98c007ba0c370f3 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 12:07:19 +0930 Subject: [PATCH 040/183] Update npm dependency --- extensions/sticky/js/forum/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/js/forum/package.json b/extensions/sticky/js/forum/package.json index 3e0ef919d..62ea6c691 100644 --- a/extensions/sticky/js/forum/package.json +++ b/extensions/sticky/js/forum/package.json @@ -2,6 +2,6 @@ "private": true, "devDependencies": { "gulp": "^3.8.11", - "flarum-gulp": "git+https://github.com/flarum/gulp.git" + "flarum-gulp": "^0.1.0" } } From 3ab62fb0ca07ed8634ca178bcfc05a72c48fa7b6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 4 Sep 2015 12:30:25 +0930 Subject: [PATCH 041/183] Add LICENSE information --- extensions/sticky/.php_cs | 1 - extensions/sticky/{LICENSE.txt => LICENSE} | 0 extensions/sticky/bootstrap.php | 9 +++++++++ .../2015_02_24_000000_add_sticky_to_discussions.php | 9 +++++++++ .../sticky/src/Events/DiscussionWasStickied.php | 12 +++++++++++- .../sticky/src/Events/DiscussionWasUnstickied.php | 12 +++++++++++- extensions/sticky/src/Extension.php | 12 +++++++++++- extensions/sticky/src/Gambits/StickyGambit.php | 12 +++++++++++- extensions/sticky/src/Listeners/AddApiAttributes.php | 12 +++++++++++- extensions/sticky/src/Listeners/AddClientAssets.php | 12 +++++++++++- .../src/Listeners/NotifyDiscussionStickied.php | 12 +++++++++++- extensions/sticky/src/Listeners/PersistData.php | 12 +++++++++++- .../src/Listeners/PinStickiedDiscussionsToTop.php | 12 +++++++++++- .../Notifications/DiscussionStickiedBlueprint.php | 12 +++++++++++- .../sticky/src/Posts/DiscussionStickiedPost.php | 12 +++++++++++- 15 files changed, 139 insertions(+), 12 deletions(-) rename extensions/sticky/{LICENSE.txt => LICENSE} (100%) diff --git a/extensions/sticky/.php_cs b/extensions/sticky/.php_cs index c55085293..20d29c766 100755 --- a/extensions/sticky/.php_cs +++ b/extensions/sticky/.php_cs @@ -17,7 +17,6 @@ $finder = Symfony\CS\Finder\DefaultFinder::create() ->in(__DIR__); return Symfony\CS\Config\Config::create() - ->setUsingCache(true) ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) ->fixers([ 'short_array_syntax', diff --git a/extensions/sticky/LICENSE.txt b/extensions/sticky/LICENSE similarity index 100% rename from extensions/sticky/LICENSE.txt rename to extensions/sticky/LICENSE diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index 0afa317f8..bc8469b1e 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + require __DIR__.'/vendor/autoload.php'; return 'Flarum\Sticky\Extension'; diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index 0afb5472a..6cd1b1984 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -1,5 +1,14 @@ + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + use Illuminate\Database\Schema\Blueprint; use Flarum\Migrations\Migration; diff --git a/extensions/sticky/src/Events/DiscussionWasStickied.php b/extensions/sticky/src/Events/DiscussionWasStickied.php index f1747a406..da2ed195d 100644 --- a/extensions/sticky/src/Events/DiscussionWasStickied.php +++ b/extensions/sticky/src/Events/DiscussionWasStickied.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Events; use Flarum\Core\Discussions\Discussion; use Flarum\Core\Users\User; diff --git a/extensions/sticky/src/Events/DiscussionWasUnstickied.php b/extensions/sticky/src/Events/DiscussionWasUnstickied.php index f416d9adc..06b07799d 100644 --- a/extensions/sticky/src/Events/DiscussionWasUnstickied.php +++ b/extensions/sticky/src/Events/DiscussionWasUnstickied.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Events; use Flarum\Core\Discussions\Discussion; use Flarum\Core\Users\User; diff --git a/extensions/sticky/src/Extension.php b/extensions/sticky/src/Extension.php index e8ef27b9f..96373f954 100644 --- a/extensions/sticky/src/Extension.php +++ b/extensions/sticky/src/Extension.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky; use Flarum\Support\Extension as BaseExtension; use Illuminate\Events\Dispatcher; diff --git a/extensions/sticky/src/Gambits/StickyGambit.php b/extensions/sticky/src/Gambits/StickyGambit.php index 2915ad1b9..a8639b72b 100644 --- a/extensions/sticky/src/Gambits/StickyGambit.php +++ b/extensions/sticky/src/Gambits/StickyGambit.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Gambits; use Flarum\Core\Search\Search; use Flarum\Core\Search\RegexGambit; diff --git a/extensions/sticky/src/Listeners/AddApiAttributes.php b/extensions/sticky/src/Listeners/AddApiAttributes.php index 90904fce7..d230e623a 100755 --- a/extensions/sticky/src/Listeners/AddApiAttributes.php +++ b/extensions/sticky/src/Listeners/AddApiAttributes.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listeners; use Flarum\Events\ApiAttributes; use Flarum\Events\BuildApiAction; diff --git a/extensions/sticky/src/Listeners/AddClientAssets.php b/extensions/sticky/src/Listeners/AddClientAssets.php index c7bf5e6bc..5ef5b64ce 100755 --- a/extensions/sticky/src/Listeners/AddClientAssets.php +++ b/extensions/sticky/src/Listeners/AddClientAssets.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listeners; use Flarum\Events\RegisterLocales; use Flarum\Events\BuildClientView; diff --git a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php index 1244cb934..0bcccfc44 100755 --- a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php +++ b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listeners; use Flarum\Events\RegisterPostTypes; use Flarum\Events\RegisterNotificationTypes; diff --git a/extensions/sticky/src/Listeners/PersistData.php b/extensions/sticky/src/Listeners/PersistData.php index 6a70088ef..13b9a3879 100755 --- a/extensions/sticky/src/Listeners/PersistData.php +++ b/extensions/sticky/src/Listeners/PersistData.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listeners; use Flarum\Sticky\Events\DiscussionWasStickied; use Flarum\Sticky\Events\DiscussionWasUnstickied; diff --git a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php index cde0d2526..8fd1dd913 100755 --- a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listeners; use Flarum\Events\RegisterDiscussionGambits; use Flarum\Events\DiscussionSearchWillBePerformed; diff --git a/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php index badad33d2..c12299d66 100644 --- a/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php +++ b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Notifications; use Flarum\Sticky\Posts\DiscussionStickiedPost; use Flarum\Core\Notifications\Blueprint; diff --git a/extensions/sticky/src/Posts/DiscussionStickiedPost.php b/extensions/sticky/src/Posts/DiscussionStickiedPost.php index 9af84f4c2..df05739a1 100755 --- a/extensions/sticky/src/Posts/DiscussionStickiedPost.php +++ b/extensions/sticky/src/Posts/DiscussionStickiedPost.php @@ -1,4 +1,14 @@ - + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Posts; use Flarum\Core\Posts\Post; use Flarum\Core\Posts\EventPost; From 04f33261ee1f47a429cd1f7bb9c91c32f116dfd7 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 17 Sep 2015 09:09:11 +0930 Subject: [PATCH 042/183] Namespace migrations --- .../migrations/2015_02_24_000000_add_sticky_to_discussions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index 6cd1b1984..a603891cc 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -1,5 +1,4 @@ Date: Thu, 17 Sep 2015 09:09:16 +0930 Subject: [PATCH 043/183] Add gitattributes --- extensions/sticky/.gitattributes | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 extensions/sticky/.gitattributes diff --git a/extensions/sticky/.gitattributes b/extensions/sticky/.gitattributes new file mode 100644 index 000000000..4afe79241 --- /dev/null +++ b/extensions/sticky/.gitattributes @@ -0,0 +1,3 @@ +.gitattributes export-ignore +.gitignore export-ignore +.travis.yml export-ignore From 0d7a7682be45d6475aaf107307ca4f183a422f8f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 22 Sep 2015 18:05:40 +0930 Subject: [PATCH 044/183] Add sticky permission to grid --- extensions/sticky/js/admin/Gulpfile.js | 7 +++++++ extensions/sticky/js/admin/package.json | 7 +++++++ extensions/sticky/js/admin/src/main.js | 13 +++++++++++++ extensions/sticky/src/Listeners/AddClientAssets.php | 8 +++++++- 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 extensions/sticky/js/admin/Gulpfile.js create mode 100644 extensions/sticky/js/admin/package.json create mode 100644 extensions/sticky/js/admin/src/main.js diff --git a/extensions/sticky/js/admin/Gulpfile.js b/extensions/sticky/js/admin/Gulpfile.js new file mode 100644 index 000000000..2cf16b3ea --- /dev/null +++ b/extensions/sticky/js/admin/Gulpfile.js @@ -0,0 +1,7 @@ +var gulp = require('flarum-gulp'); + +gulp({ + modules: { + 'sticky': 'src/**/*.js' + } +}); diff --git a/extensions/sticky/js/admin/package.json b/extensions/sticky/js/admin/package.json new file mode 100644 index 000000000..62ea6c691 --- /dev/null +++ b/extensions/sticky/js/admin/package.json @@ -0,0 +1,7 @@ +{ + "private": true, + "devDependencies": { + "gulp": "^3.8.11", + "flarum-gulp": "^0.1.0" + } +} diff --git a/extensions/sticky/js/admin/src/main.js b/extensions/sticky/js/admin/src/main.js new file mode 100644 index 000000000..717b57f85 --- /dev/null +++ b/extensions/sticky/js/admin/src/main.js @@ -0,0 +1,13 @@ +import { extend } from 'flarum/extend'; +import app from 'flarum/app'; +import PermissionGrid from 'flarum/components/PermissionGrid'; + +app.initializers.add('sticky', () => { + extend(PermissionGrid.prototype, 'moderateItems', items => { + items.add('sticky', { + icon: 'thumb-tack', + label: 'Sticky discussions', + permission: 'discussion.sticky' + }, 95); + }); +}); diff --git a/extensions/sticky/src/Listeners/AddClientAssets.php b/extensions/sticky/src/Listeners/AddClientAssets.php index 5ef5b64ce..a92fa6366 100755 --- a/extensions/sticky/src/Listeners/AddClientAssets.php +++ b/extensions/sticky/src/Listeners/AddClientAssets.php @@ -1,4 +1,4 @@ -adminAssets([ + __DIR__.'/../../js/admin/dist/extension.js' + ]); + + $event->adminBootstrapper('sticky/main'); } } From 37d7874705a0d0cc55518705d8410dd97bf3f36b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Oct 2015 11:43:13 +1030 Subject: [PATCH 045/183] Update for composer branch Also remove sticky notification --- extensions/sticky/.gitignore | 2 + extensions/sticky/bootstrap.php | 11 +- extensions/sticky/composer.json | 28 ++- extensions/sticky/flarum.json | 25 -- extensions/sticky/js/.gitignore | 4 - extensions/sticky/js/admin/Gulpfile.js | 2 +- extensions/sticky/js/admin/dist/extension.js | 26 ++ extensions/sticky/js/forum/Gulpfile.js | 2 +- extensions/sticky/js/forum/dist/extension.js | 224 ++++++++++++++++++ .../sticky/js/forum/src/addStickyBadge.js | 2 +- .../sticky/js/forum/src/addStickyControl.js | 2 +- .../DiscussionStickiedNotification.js | 2 +- .../src/components/DiscussionStickiedPost.js | 4 +- extensions/sticky/js/forum/src/main.js | 21 +- extensions/sticky/locale/en.yml | 8 - ...02_24_000000_add_sticky_to_discussions.php | 16 +- extensions/sticky/scripts/compile.sh | 27 +++ .../DiscussionWasStickied.php | 6 +- .../DiscussionWasUnstickied.php | 6 +- extensions/sticky/src/Extension.php | 26 -- extensions/sticky/src/Gambit/StickyGambit.php | 30 +++ .../sticky/src/Gambits/StickyGambit.php | 37 --- .../sticky/src/Listener/AddApiAttributes.php | 50 ++++ .../sticky/src/Listener/AddClientAssets.php | 47 ++++ .../CreatePostWhenDiscussionIsStickied.php | 72 ++++++ .../Listener/PinStickiedDiscussionsToTop.php | 75 ++++++ .../SaveStickyToDatabase.php} | 24 +- .../sticky/src/Listeners/AddApiAttributes.php | 41 ---- .../sticky/src/Listeners/AddClientAssets.php | 55 ----- .../Listeners/NotifyDiscussionStickied.php | 81 ------- .../Listeners/PinStickiedDiscussionsToTop.php | 64 ----- .../DiscussionStickiedBlueprint.php | 49 ---- .../DiscussionStickiedPost.php | 16 +- 33 files changed, 637 insertions(+), 448 deletions(-) delete mode 100644 extensions/sticky/flarum.json delete mode 100644 extensions/sticky/js/.gitignore create mode 100644 extensions/sticky/js/admin/dist/extension.js create mode 100644 extensions/sticky/js/forum/dist/extension.js delete mode 100644 extensions/sticky/locale/en.yml create mode 100755 extensions/sticky/scripts/compile.sh rename extensions/sticky/src/{Events => Event}/DiscussionWasStickied.php (85%) rename extensions/sticky/src/{Events => Event}/DiscussionWasUnstickied.php (85%) delete mode 100644 extensions/sticky/src/Extension.php create mode 100644 extensions/sticky/src/Gambit/StickyGambit.php delete mode 100644 extensions/sticky/src/Gambits/StickyGambit.php create mode 100755 extensions/sticky/src/Listener/AddApiAttributes.php create mode 100755 extensions/sticky/src/Listener/AddClientAssets.php create mode 100755 extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php create mode 100755 extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php rename extensions/sticky/src/{Listeners/PersistData.php => Listener/SaveStickyToDatabase.php} (65%) delete mode 100755 extensions/sticky/src/Listeners/AddApiAttributes.php delete mode 100755 extensions/sticky/src/Listeners/AddClientAssets.php delete mode 100755 extensions/sticky/src/Listeners/NotifyDiscussionStickied.php delete mode 100755 extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php delete mode 100644 extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php rename extensions/sticky/src/{Posts => Post}/DiscussionStickiedPost.php (86%) diff --git a/extensions/sticky/.gitignore b/extensions/sticky/.gitignore index a4f3b125e..4181b9dca 100644 --- a/extensions/sticky/.gitignore +++ b/extensions/sticky/.gitignore @@ -2,3 +2,5 @@ composer.phar .DS_Store Thumbs.db +node_modules +bower_components \ No newline at end of file diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index bc8469b1e..19076c02e 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -9,6 +9,13 @@ * file that was distributed with this source code. */ -require __DIR__.'/vendor/autoload.php'; +use Flarum\Sticky\Listener; +use Illuminate\Contracts\Events\Dispatcher; -return 'Flarum\Sticky\Extension'; +return function (Dispatcher $events) { + $events->subscribe(Listener\AddApiAttributes::class); + $events->subscribe(Listener\AddClientAssets::class); + $events->subscribe(Listener\CreatePostWhenDiscussionIsStickied::class); + $events->subscribe(Listener\PinStickiedDiscussionsToTop::class); + $events->subscribe(Listener\SaveStickyToDatabase::class); +}; diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 71d98ca20..866ef4545 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -1,10 +1,34 @@ { + "name": "flarum/sticky", + "description": "Pin discussions to the top of the list.", + "type": "flarum-extension", + "license": "MIT", + "authors": [ + { + "name": "Toby Zerner", + "email": "toby.zerner@gmail.com" + } + ], + "support": { + "issues": "https://github.com/flarum/core/issues", + "source": "https://github.com/flarum/sticky" + }, + "require": { + "flarum/core": "^0.1.0-beta.3" + }, "autoload": { "psr-4": { "Flarum\\Sticky\\": "src/" } }, - "scripts": { - "style": "phpcs --standard=PSR2 -np src" + "extra": { + "flarum-extension": { + "title": "Sticky", + "icon": { + "name": "thumb-tack", + "backgroundColor": "#D13E32", + "color": "#fff" + } + } } } diff --git a/extensions/sticky/flarum.json b/extensions/sticky/flarum.json deleted file mode 100644 index a63475675..000000000 --- a/extensions/sticky/flarum.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "sticky", - "title": "Sticky", - "description": "Pin discussions to the top of the list.", - "keywords": ["moderation"], - "version": "0.1.0-beta.2", - "author": { - "name": "Toby Zerner", - "email": "toby@flarum.org", - "homepage": "http://tobyzerner.com" - }, - "license": "MIT", - "require": { - "flarum": ">=0.1.0-beta.2" - }, - "support": { - "source": "https://github.com/flarum/sticky", - "issues": "https://github.com/flarum/core/issues" - }, - "icon": { - "name": "thumb-tack", - "backgroundColor": "#D13E32", - "color": "#fff" - } -} diff --git a/extensions/sticky/js/.gitignore b/extensions/sticky/js/.gitignore deleted file mode 100644 index bae304483..000000000 --- a/extensions/sticky/js/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -bower_components -node_modules -mithril.js -dist diff --git a/extensions/sticky/js/admin/Gulpfile.js b/extensions/sticky/js/admin/Gulpfile.js index 2cf16b3ea..c2cebeaf6 100644 --- a/extensions/sticky/js/admin/Gulpfile.js +++ b/extensions/sticky/js/admin/Gulpfile.js @@ -2,6 +2,6 @@ var gulp = require('flarum-gulp'); gulp({ modules: { - 'sticky': 'src/**/*.js' + 'flarum/sticky': 'src/**/*.js' } }); diff --git a/extensions/sticky/js/admin/dist/extension.js b/extensions/sticky/js/admin/dist/extension.js new file mode 100644 index 000000000..ec8f3ac3b --- /dev/null +++ b/extensions/sticky/js/admin/dist/extension.js @@ -0,0 +1,26 @@ +System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/components/PermissionGrid'], function (_export) { + 'use strict'; + + var extend, app, PermissionGrid; + return { + setters: [function (_flarumExtend) { + extend = _flarumExtend.extend; + }, function (_flarumApp) { + app = _flarumApp['default']; + }, function (_flarumComponentsPermissionGrid) { + PermissionGrid = _flarumComponentsPermissionGrid['default']; + }], + execute: function () { + + app.initializers.add('sticky', function () { + extend(PermissionGrid.prototype, 'moderateItems', function (items) { + items.add('sticky', { + icon: 'thumb-tack', + label: 'Sticky discussions', + permission: 'discussion.sticky' + }, 95); + }); + }); + } + }; +}); \ No newline at end of file diff --git a/extensions/sticky/js/forum/Gulpfile.js b/extensions/sticky/js/forum/Gulpfile.js index 2cf16b3ea..c2cebeaf6 100644 --- a/extensions/sticky/js/forum/Gulpfile.js +++ b/extensions/sticky/js/forum/Gulpfile.js @@ -2,6 +2,6 @@ var gulp = require('flarum-gulp'); gulp({ modules: { - 'sticky': 'src/**/*.js' + 'flarum/sticky': 'src/**/*.js' } }); diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js new file mode 100644 index 000000000..33fd2484a --- /dev/null +++ b/extensions/sticky/js/forum/dist/extension.js @@ -0,0 +1,224 @@ +System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models/Discussion', 'flarum/components/Badge'], function (_export) { + 'use strict'; + + var extend, Discussion, Badge; + + _export('default', addStickyBadge); + + function addStickyBadge() { + extend(Discussion.prototype, 'badges', function (badges) { + if (this.isSticky()) { + badges.add('sticky', Badge.component({ + type: 'sticky', + label: app.trans('flarum-sticky.forum.stickied'), + icon: 'thumb-tack' + }), 10); + } + }); + } + + return { + setters: [function (_flarumExtend) { + extend = _flarumExtend.extend; + }, function (_flarumModelsDiscussion) { + Discussion = _flarumModelsDiscussion['default']; + }, function (_flarumComponentsBadge) { + Badge = _flarumComponentsBadge['default']; + }], + execute: function () {} + }; +});;System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export) { + 'use strict'; + + var extend, DiscussionControls, DiscussionPage, Button; + + _export('default', addStickyControl); + + function addStickyControl() { + extend(DiscussionControls, 'moderationControls', function (items, discussion) { + if (discussion.canSticky()) { + items.add('sticky', Button.component({ + children: app.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'), + icon: 'thumb-tack', + onclick: this.stickyAction.bind(discussion) + })); + } + }); + + DiscussionControls.stickyAction = function () { + this.save({ isSticky: !this.isSticky() }).then(function () { + if (app.current instanceof DiscussionPage) { + app.current.stream.update(); + } + + m.redraw(); + }); + }; + } + + return { + setters: [function (_flarumExtend) { + extend = _flarumExtend.extend; + }, function (_flarumUtilsDiscussionControls) { + DiscussionControls = _flarumUtilsDiscussionControls['default']; + }, function (_flarumComponentsDiscussionPage) { + DiscussionPage = _flarumComponentsDiscussionPage['default']; + }, function (_flarumComponentsButton) { + Button = _flarumComponentsButton['default']; + }], + execute: function () {} + }; +});;System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export) { + 'use strict'; + + var extend, DiscussionList, DiscussionListItem, truncate; + + _export('default', addStickyControl); + + function addStickyControl() { + extend(DiscussionList.prototype, 'requestParams', function (params) { + params.include.push('startPost'); + }); + + extend(DiscussionListItem.prototype, 'infoItems', function (items) { + var discussion = this.props.discussion; + + if (discussion.isSticky()) { + var startPost = discussion.startPost(); + + if (startPost) { + var excerpt = m( + 'span', + null, + truncate(startPost.contentPlain(), 200) + ); + + items.add('excerpt', excerpt, -100); + } + } + }); + } + + return { + setters: [function (_flarumExtend) { + extend = _flarumExtend.extend; + }, function (_flarumComponentsDiscussionList) { + DiscussionList = _flarumComponentsDiscussionList['default']; + }, function (_flarumComponentsDiscussionListItem) { + DiscussionListItem = _flarumComponentsDiscussionListItem['default']; + }, function (_flarumUtilsString) { + truncate = _flarumUtilsString.truncate; + }], + execute: function () {} + }; +});;System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export) { + 'use strict'; + + var extend, notificationType, app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; + return { + setters: [function (_flarumExtend) { + extend = _flarumExtend.extend; + notificationType = _flarumExtend.notificationType; + }, function (_flarumApp) { + app = _flarumApp['default']; + }, function (_flarumModel) { + Model = _flarumModel['default']; + }, function (_flarumModelsDiscussion) { + Discussion = _flarumModelsDiscussion['default']; + }, function (_flarumStickyComponentsDiscussionStickiedPost) { + DiscussionStickiedPost = _flarumStickyComponentsDiscussionStickiedPost['default']; + }, function (_flarumStickyAddStickyBadge) { + addStickyBadge = _flarumStickyAddStickyBadge['default']; + }, function (_flarumStickyAddStickyControl) { + addStickyControl = _flarumStickyAddStickyControl['default']; + }, function (_flarumStickyAddStickyExcerpt) { + addStickyExcerpt = _flarumStickyAddStickyExcerpt['default']; + }], + execute: function () { + + app.postComponents.discussionStickied = DiscussionStickiedPost; + + Discussion.prototype.isSticky = Model.attribute('isSticky'); + Discussion.prototype.canSticky = Model.attribute('canSticky'); + + addStickyBadge(); + addStickyControl(); + addStickyExcerpt(); + } + }; +});;System.register('flarum/sticky/components/DiscussionStickiedNotification', ['flarum/components/Notification'], function (_export) { + 'use strict'; + + var Notification, DiscussionStickiedNotification; + return { + setters: [function (_flarumComponentsNotification) { + Notification = _flarumComponentsNotification['default']; + }], + execute: function () { + DiscussionStickiedNotification = (function (_Notification) { + babelHelpers.inherits(DiscussionStickiedNotification, _Notification); + + function DiscussionStickiedNotification() { + babelHelpers.classCallCheck(this, DiscussionStickiedNotification); + babelHelpers.get(Object.getPrototypeOf(DiscussionStickiedNotification.prototype), 'constructor', this).apply(this, arguments); + } + + babelHelpers.createClass(DiscussionStickiedNotification, [{ + key: 'icon', + value: function icon() { + return 'thumb-tack'; + } + }, { + key: 'href', + value: function href() { + var notification = this.props.notification; + + return app.route.discussion(notification.subject(), notification.content().postNumber); + } + }, { + key: 'content', + value: function content() { + return app.trans('flarum-sticky.forum.discussion_stickied_notification', { user: this.props.notification.sender() }); + } + }]); + return DiscussionStickiedNotification; + })(Notification); + + _export('default', DiscussionStickiedNotification); + } + }; +});;System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export) { + 'use strict'; + + var EventPost, DiscussionStickiedPost; + return { + setters: [function (_flarumComponentsEventPost) { + EventPost = _flarumComponentsEventPost['default']; + }], + execute: function () { + DiscussionStickiedPost = (function (_EventPost) { + babelHelpers.inherits(DiscussionStickiedPost, _EventPost); + + function DiscussionStickiedPost() { + babelHelpers.classCallCheck(this, DiscussionStickiedPost); + babelHelpers.get(Object.getPrototypeOf(DiscussionStickiedPost.prototype), 'constructor', this).apply(this, arguments); + } + + babelHelpers.createClass(DiscussionStickiedPost, [{ + key: 'icon', + value: function icon() { + return 'thumb-tack'; + } + }, { + key: 'descriptionKey', + value: function descriptionKey() { + return this.props.post.content().sticky ? 'flarum-sticky.forum.discussion_stickied_post' : 'flarum-sticky.forum.discussion_unstickied_post'; + } + }]); + return DiscussionStickiedPost; + })(EventPost); + + _export('default', DiscussionStickiedPost); + } + }; +}); \ No newline at end of file diff --git a/extensions/sticky/js/forum/src/addStickyBadge.js b/extensions/sticky/js/forum/src/addStickyBadge.js index 1566c3434..4c1bbd5bb 100644 --- a/extensions/sticky/js/forum/src/addStickyBadge.js +++ b/extensions/sticky/js/forum/src/addStickyBadge.js @@ -7,7 +7,7 @@ export default function addStickyBadge() { if (this.isSticky()) { badges.add('sticky', Badge.component({ type: 'sticky', - label: app.trans('sticky.stickied'), + label: app.trans('flarum-sticky.forum.stickied'), icon: 'thumb-tack' }), 10); } diff --git a/extensions/sticky/js/forum/src/addStickyControl.js b/extensions/sticky/js/forum/src/addStickyControl.js index e7651fd23..25f55921c 100644 --- a/extensions/sticky/js/forum/src/addStickyControl.js +++ b/extensions/sticky/js/forum/src/addStickyControl.js @@ -7,7 +7,7 @@ export default function addStickyControl() { extend(DiscussionControls, 'moderationControls', function(items, discussion) { if (discussion.canSticky()) { items.add('sticky', Button.component({ - children: app.trans(discussion.isSticky() ? 'sticky.unsticky' : 'sticky.sticky'), + children: app.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'), icon: 'thumb-tack', onclick: this.stickyAction.bind(discussion) })); diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js index cc99d9a35..b69eef231 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js @@ -12,6 +12,6 @@ export default class DiscussionStickiedNotification extends Notification { } content() { - return app.trans('sticky.discussion_stickied_notification', {user: this.props.notification.sender()}); + return app.trans('flarum-sticky.forum.discussion_stickied_notification', {user: this.props.notification.sender()}); } } diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js index 5b3408e69..613c46683 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js @@ -7,7 +7,7 @@ export default class DiscussionStickiedPost extends EventPost { descriptionKey() { return this.props.post.content().sticky - ? 'sticky.discussion_stickied_post' - : 'sticky.discussion_unstickied_post'; + ? 'flarum-sticky.forum.discussion_stickied_post' + : 'flarum-sticky.forum.discussion_unstickied_post'; } } diff --git a/extensions/sticky/js/forum/src/main.js b/extensions/sticky/js/forum/src/main.js index 655a9b09d..3b3a1b493 100644 --- a/extensions/sticky/js/forum/src/main.js +++ b/extensions/sticky/js/forum/src/main.js @@ -2,28 +2,17 @@ import { extend, notificationType } from 'flarum/extend'; import app from 'flarum/app'; import Model from 'flarum/Model'; import Discussion from 'flarum/models/Discussion'; -import NotificationGrid from 'flarum/components/NotificationGrid'; -import DiscussionStickiedPost from 'sticky/components/DiscussionStickiedPost'; -import DiscussionStickiedNotification from 'sticky/components/DiscussionStickiedNotification'; -import addStickyBadge from 'sticky/addStickyBadge'; -import addStickyControl from 'sticky/addStickyControl'; -import addStickyExcerpt from 'sticky/addStickyExcerpt'; +import DiscussionStickiedPost from 'flarum/sticky/components/DiscussionStickiedPost'; +import addStickyBadge from 'flarum/sticky/addStickyBadge'; +import addStickyControl from 'flarum/sticky/addStickyControl'; +import addStickyExcerpt from 'flarum/sticky/addStickyExcerpt'; app.postComponents.discussionStickied = DiscussionStickiedPost; -app.notificationComponents.discussionStickied = DiscussionStickiedNotification; Discussion.prototype.isSticky = Model.attribute('isSticky'); Discussion.prototype.canSticky = Model.attribute('canSticky'); addStickyBadge(); addStickyControl(); -addStickyExcerpt(); - -extend(NotificationGrid.prototype, 'notificationTypes', function(items) { - items.add('discussionStickied', { - name: 'discussionStickied', - icon: 'thumb-tack', - label: app.trans('sticky.notify_discussion_stickied') - }); -}); +addStickyExcerpt(); \ No newline at end of file diff --git a/extensions/sticky/locale/en.yml b/extensions/sticky/locale/en.yml deleted file mode 100644 index b871de0d5..000000000 --- a/extensions/sticky/locale/en.yml +++ /dev/null @@ -1,8 +0,0 @@ -sticky: - discussion_stickied_notification: "{username} stickied" - discussion_stickied_post: "{username} stickied the discussion." - discussion_unstickied_post: "{username} unstickied the discussion." - notify_discussion_stickied: Someone stickies a discussion I started - stickied: Sticky - sticky: Sticky - unsticky: Unsticky diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index a603891cc..aded7e5c9 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -8,18 +8,13 @@ * file that was distributed with this source code. */ -namespace Flarum\Migrations\Sticky; +namespace Flarum\Sticky\Migration; +use Flarum\Database\AbstractMigration; use Illuminate\Database\Schema\Blueprint; -use Flarum\Migrations\Migration; -class AddStickyToDiscussions extends Migration +class AddStickyToDiscussions extends AbstractMigration { - /** - * Run the migrations. - * - * @return void - */ public function up() { $this->schema->table('discussions', function (Blueprint $table) { @@ -27,11 +22,6 @@ class AddStickyToDiscussions extends Migration }); } - /** - * Reverse the migrations. - * - * @return void - */ public function down() { $this->schema->table('discussions', function (Blueprint $table) { diff --git a/extensions/sticky/scripts/compile.sh b/extensions/sticky/scripts/compile.sh new file mode 100755 index 000000000..b0d8e8bd3 --- /dev/null +++ b/extensions/sticky/scripts/compile.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# This script compiles the extension so that it can be used in a Flarum +# installation. It should be run from the root directory of the extension. + +base=$PWD + +cd "${base}/js" + +if [ -f bower.json ]; then + bower install +fi + +for app in forum admin; do + cd "${base}/js" + + if [ -d $app ]; then + cd $app + + if [ -f bower.json ]; then + bower install + fi + + npm install + gulp --production + fi +done diff --git a/extensions/sticky/src/Events/DiscussionWasStickied.php b/extensions/sticky/src/Event/DiscussionWasStickied.php similarity index 85% rename from extensions/sticky/src/Events/DiscussionWasStickied.php rename to extensions/sticky/src/Event/DiscussionWasStickied.php index da2ed195d..cef0dc958 100644 --- a/extensions/sticky/src/Events/DiscussionWasStickied.php +++ b/extensions/sticky/src/Event/DiscussionWasStickied.php @@ -8,10 +8,10 @@ * file that was distributed with this source code. */ -namespace Flarum\Sticky\Events; +namespace Flarum\Sticky\Event; -use Flarum\Core\Discussions\Discussion; -use Flarum\Core\Users\User; +use Flarum\Core\Discussion; +use Flarum\Core\User; class DiscussionWasStickied { diff --git a/extensions/sticky/src/Events/DiscussionWasUnstickied.php b/extensions/sticky/src/Event/DiscussionWasUnstickied.php similarity index 85% rename from extensions/sticky/src/Events/DiscussionWasUnstickied.php rename to extensions/sticky/src/Event/DiscussionWasUnstickied.php index 06b07799d..5a39c71f6 100644 --- a/extensions/sticky/src/Events/DiscussionWasUnstickied.php +++ b/extensions/sticky/src/Event/DiscussionWasUnstickied.php @@ -8,10 +8,10 @@ * file that was distributed with this source code. */ -namespace Flarum\Sticky\Events; +namespace Flarum\Sticky\Event; -use Flarum\Core\Discussions\Discussion; -use Flarum\Core\Users\User; +use Flarum\Core\Discussion; +use Flarum\Core\User; class DiscussionWasUnstickied { diff --git a/extensions/sticky/src/Extension.php b/extensions/sticky/src/Extension.php deleted file mode 100644 index 96373f954..000000000 --- a/extensions/sticky/src/Extension.php +++ /dev/null @@ -1,26 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky; - -use Flarum\Support\Extension as BaseExtension; -use Illuminate\Events\Dispatcher; - -class Extension extends BaseExtension -{ - public function listen(Dispatcher $events) - { - $events->subscribe('Flarum\Sticky\Listeners\AddClientAssets'); - $events->subscribe('Flarum\Sticky\Listeners\AddApiAttributes'); - $events->subscribe('Flarum\Sticky\Listeners\PersistData'); - $events->subscribe('Flarum\Sticky\Listeners\PinStickiedDiscussionsToTop'); - $events->subscribe('Flarum\Sticky\Listeners\NotifyDiscussionStickied'); - } -} diff --git a/extensions/sticky/src/Gambit/StickyGambit.php b/extensions/sticky/src/Gambit/StickyGambit.php new file mode 100644 index 000000000..d21021a4e --- /dev/null +++ b/extensions/sticky/src/Gambit/StickyGambit.php @@ -0,0 +1,30 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Gambit; + +use Flarum\Core\Search\AbstractSearch; +use Flarum\Core\Search\AbstractRegexGambit; + +class StickyGambit extends AbstractRegexGambit +{ + /** + * {@inheritdoc} + */ + protected $pattern = 'is:sticky'; + + /** + * {@inheritdoc} + */ + protected function conditions(AbstractSearch $search, array $matches, $negate) + { + $search->getQuery()->where('is_sticky', ! $negate); + } +} diff --git a/extensions/sticky/src/Gambits/StickyGambit.php b/extensions/sticky/src/Gambits/StickyGambit.php deleted file mode 100644 index a8639b72b..000000000 --- a/extensions/sticky/src/Gambits/StickyGambit.php +++ /dev/null @@ -1,37 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Gambits; - -use Flarum\Core\Search\Search; -use Flarum\Core\Search\RegexGambit; - -class StickyGambit extends RegexGambit -{ - /** - * The gambit's regex pattern. - * - * @var string - */ - protected $pattern = 'is:sticky'; - - /** - * Apply conditions to the searcher, given matches from the gambit's - * regex. - * - * @param array $matches The matches from the gambit's regex. - * @param \Flarum\Core\Search\SearcherInterface $searcher - * @return void - */ - protected function conditions(Search $search, array $matches, $negate) - { - $search->getQuery()->where('is_sticky', ! $negate); - } -} diff --git a/extensions/sticky/src/Listener/AddApiAttributes.php b/extensions/sticky/src/Listener/AddApiAttributes.php new file mode 100755 index 000000000..d82c98f3e --- /dev/null +++ b/extensions/sticky/src/Listener/AddApiAttributes.php @@ -0,0 +1,50 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listener; + +use Flarum\Api\Controller\ListDiscussionsController; +use Flarum\Api\Serializer\DiscussionSerializer; +use Flarum\Event\ConfigureApiController; +use Flarum\Event\PrepareApiAttributes; +use Illuminate\Contracts\Events\Dispatcher; + +class AddApiAttributes +{ + /** + * @param Dispatcher $events + */ + public function subscribe(Dispatcher $events) + { + $events->listen(PrepareApiAttributes::class, [$this, 'prepareApiAttributes']); + $events->listen(ConfigureApiController::class, [$this, 'includeStartPost']); + } + + /** + * @param PrepareApiAttributes $event + */ + public function prepareApiAttributes(PrepareApiAttributes $event) + { + if ($event->isSerializer(DiscussionSerializer::class)) { + $event->attributes['isSticky'] = (bool) $event->model->is_sticky; + $event->attributes['canSticky'] = (bool) $event->actor->can('sticky', $event->model); + } + } + + /** + * @param ConfigureApiController $event + */ + public function includeStartPost(ConfigureApiController $event) + { + if ($event->isController(ListDiscussionsController::class)) { + $event->addInclude('startPost'); + } + } +} diff --git a/extensions/sticky/src/Listener/AddClientAssets.php b/extensions/sticky/src/Listener/AddClientAssets.php new file mode 100755 index 000000000..26fb77f1d --- /dev/null +++ b/extensions/sticky/src/Listener/AddClientAssets.php @@ -0,0 +1,47 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listener; + +use Flarum\Event\ConfigureClientView; +use Illuminate\Contracts\Events\Dispatcher; + +class AddClientAssets +{ + /** + * @param Dispatcher $events + */ + public function subscribe(Dispatcher $events) + { + $events->listen(ConfigureClientView::class, [$this, 'addAssets']); + } + + /** + * @param ConfigureClientView $event + */ + public function addAssets(ConfigureClientView $event) + { + if ($event->isForum()) { + $event->addAssets([ + __DIR__.'/../../js/forum/dist/extension.js', + __DIR__.'/../../less/forum/extension.less' + ]); + $event->addBootstrapper('flarum/sticky/main'); + $event->addTranslations('flarum-sticky.forum'); + } + + if ($event->isAdmin()) { + $event->addAssets([ + __DIR__.'/../../js/admin/dist/extension.js' + ]); + $event->addBootstrapper('flarum/sticky/main'); + } + } +} diff --git a/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php b/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php new file mode 100755 index 000000000..242411eaf --- /dev/null +++ b/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php @@ -0,0 +1,72 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listener; + +use Flarum\Core\Discussion; +use Flarum\Core\User; +use Flarum\Event\ConfigurePostTypes; +use Flarum\Sticky\Event\DiscussionWasStickied; +use Flarum\Sticky\Event\DiscussionWasUnstickied; +use Flarum\Sticky\Post\DiscussionStickiedPost; +use Illuminate\Contracts\Events\Dispatcher; + +class CreatePostWhenDiscussionIsStickied +{ + /** + * @param Dispatcher $events + */ + public function subscribe(Dispatcher $events) + { + $events->listen(ConfigurePostTypes::class, [$this, 'configurePostTypes']); + $events->listen(DiscussionWasStickied::class, [$this, 'whenDiscussionWasStickied']); + $events->listen(DiscussionWasUnstickied::class, [$this, 'whenDiscussionWasUnstickied']); + } + + /** + * @param ConfigurePostTypes $event + */ + public function configurePostTypes(ConfigurePostTypes $event) + { + $event->add(DiscussionStickiedPost::class); + } + + /** + * @param DiscussionWasStickied $event + */ + public function whenDiscussionWasStickied(DiscussionWasStickied $event) + { + $this->stickyChanged($event->discussion, $event->user, true); + } + + /** + * @param DiscussionWasUnstickied $event + */ + public function whenDiscussionWasUnstickied(DiscussionWasUnstickied $event) + { + $this->stickyChanged($event->discussion, $event->user, false); + } + + /** + * @param Discussion $discussion + * @param User $user + * @param bool $isSticky + */ + protected function stickyChanged(Discussion $discussion, User $user, $isSticky) + { + $post = DiscussionStickiedPost::reply( + $discussion->id, + $user->id, + $isSticky + ); + + $discussion->mergePost($post); + } +} diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php new file mode 100755 index 000000000..960ebf27d --- /dev/null +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -0,0 +1,75 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Flarum\Sticky\Listener; + +use Flarum\Event\ConfigureDiscussionGambits; +use Flarum\Event\DiscussionSearchWillBePerformed; +use Flarum\Sticky\Gambit\StickyGambit; +use Flarum\Tags\Gambit\TagGambit; +use Illuminate\Contracts\Events\Dispatcher; + +class PinStickiedDiscussionsToTop +{ + /** + * @param Dispatcher $events + */ + public function subscribe(Dispatcher $events) + { + $events->listen(ConfigureDiscussionGambits::class, [$this, 'addStickyGambit']); + $events->listen(DiscussionSearchWillBePerformed::class, [$this, 'reorderSearch']); + } + + /** + * @param ConfigureDiscussionGambits $event + */ + public function addStickyGambit(ConfigureDiscussionGambits $event) + { + $event->gambits->add(StickyGambit::class); + } + + /** + * @param DiscussionSearchWillBePerformed $event + */ + public function reorderSearch(DiscussionSearchWillBePerformed $event) + { + if ($event->criteria->sort === null) { + $search = $event->search; + $query = $search->getQuery(); + + if (! is_array($query->orders)) { + $query->orders = []; + } + + foreach ($search->getActiveGambits() as $gambit) { + if ($gambit instanceof TagGambit) { + array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); + return; + } + } + + $query->leftJoin('users_discussions', function ($join) use ($search) { + $join->on('users_discussions.discussion_id', '=', 'discussions.id') + ->where('discussions.is_sticky', '=', true) + ->where('users_discussions.user_id', '=', $search->getActor()->id); + }); + + // TODO: Might be quicker to do a subquery in the order clause than a join? + $grammar = $query->getGrammar(); + $readNumber = $grammar->wrap('users_discussions.read_number'); + $lastPostNumber = $grammar->wrap('discussions.last_post_number'); + + array_unshift($query->orders, [ + 'type' => 'raw', + 'sql' => "(is_sticky AND ($readNumber IS NULL OR $lastPostNumber > $readNumber)) desc" + ]); + } + } +} diff --git a/extensions/sticky/src/Listeners/PersistData.php b/extensions/sticky/src/Listener/SaveStickyToDatabase.php similarity index 65% rename from extensions/sticky/src/Listeners/PersistData.php rename to extensions/sticky/src/Listener/SaveStickyToDatabase.php index 13b9a3879..3209a39db 100755 --- a/extensions/sticky/src/Listeners/PersistData.php +++ b/extensions/sticky/src/Listener/SaveStickyToDatabase.php @@ -8,19 +8,29 @@ * file that was distributed with this source code. */ -namespace Flarum\Sticky\Listeners; +namespace Flarum\Sticky\Listener; -use Flarum\Sticky\Events\DiscussionWasStickied; -use Flarum\Sticky\Events\DiscussionWasUnstickied; -use Flarum\Events\DiscussionWillBeSaved; +use Flarum\Core\Access\AssertPermissionTrait; +use Flarum\Sticky\Event\DiscussionWasStickied; +use Flarum\Sticky\Event\DiscussionWasUnstickied; +use Flarum\Event\DiscussionWillBeSaved; +use Illuminate\Contracts\Events\Dispatcher; -class PersistData +class SaveStickyToDatabase { - public function subscribe($events) + use AssertPermissionTrait; + + /** + * @param Dispatcher $events + */ + public function subscribe(Dispatcher $events) { $events->listen(DiscussionWillBeSaved::class, [$this, 'whenDiscussionWillBeSaved']); } + /** + * @param DiscussionWillBeSaved $event + */ public function whenDiscussionWillBeSaved(DiscussionWillBeSaved $event) { if (isset($event->data['attributes']['isSticky'])) { @@ -28,7 +38,7 @@ class PersistData $discussion = $event->discussion; $actor = $event->actor; - $discussion->assertCan($actor, 'sticky'); + $this->assertCan($actor, 'sticky', $discussion); if ((bool) $discussion->is_sticky === $isSticky) { return; diff --git a/extensions/sticky/src/Listeners/AddApiAttributes.php b/extensions/sticky/src/Listeners/AddApiAttributes.php deleted file mode 100755 index d230e623a..000000000 --- a/extensions/sticky/src/Listeners/AddApiAttributes.php +++ /dev/null @@ -1,41 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Listeners; - -use Flarum\Events\ApiAttributes; -use Flarum\Events\BuildApiAction; -use Illuminate\Contracts\Events\Dispatcher; -use Flarum\Api\Serializers\DiscussionSerializer; -use Flarum\Api\Actions\Discussions\IndexAction as DiscussionsIndexAction; - -class AddApiAttributes -{ - public function subscribe(Dispatcher $events) - { - $events->listen(ApiAttributes::class, [$this, 'addAttributes']); - $events->listen(BuildApiAction::class, [$this, 'includeStartPost']); - } - - public function addAttributes(ApiAttributes $event) - { - if ($event->serializer instanceof DiscussionSerializer) { - $event->attributes['isSticky'] = (bool) $event->model->is_sticky; - $event->attributes['canSticky'] = (bool) $event->model->can($event->actor, 'sticky'); - } - } - - public function includeStartPost(BuildApiAction $event) - { - if ($event->action instanceof DiscussionsIndexAction) { - $event->addInclude('startPost'); - } - } -} diff --git a/extensions/sticky/src/Listeners/AddClientAssets.php b/extensions/sticky/src/Listeners/AddClientAssets.php deleted file mode 100755 index a92fa6366..000000000 --- a/extensions/sticky/src/Listeners/AddClientAssets.php +++ /dev/null @@ -1,55 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Listeners; - -use Flarum\Events\RegisterLocales; -use Flarum\Events\BuildClientView; -use Illuminate\Contracts\Events\Dispatcher; - -class AddClientAssets -{ - public function subscribe(Dispatcher $events) - { - $events->listen(RegisterLocales::class, [$this, 'addLocale']); - $events->listen(BuildClientView::class, [$this, 'addAssets']); - } - - public function addLocale(RegisterLocales $event) - { - $event->addTranslations('en', __DIR__.'/../../locale/en.yml'); - } - - public function addAssets(BuildClientView $event) - { - $event->forumAssets([ - __DIR__.'/../../js/forum/dist/extension.js', - __DIR__.'/../../less/forum/extension.less' - ]); - - $event->forumBootstrapper('sticky/main'); - - $event->forumTranslations([ - 'sticky.discussion_stickied_notification', - 'sticky.discussion_stickied_post', - 'sticky.discussion_unstickied_post', - 'sticky.notify_discussion_stickied', - 'sticky.stickied', - 'sticky.sticky', - 'sticky.unsticky' - ]); - - $event->adminAssets([ - __DIR__.'/../../js/admin/dist/extension.js' - ]); - - $event->adminBootstrapper('sticky/main'); - } -} diff --git a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php b/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php deleted file mode 100755 index 0bcccfc44..000000000 --- a/extensions/sticky/src/Listeners/NotifyDiscussionStickied.php +++ /dev/null @@ -1,81 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Listeners; - -use Flarum\Events\RegisterPostTypes; -use Flarum\Events\RegisterNotificationTypes; -use Flarum\Sticky\Posts\DiscussionStickiedPost; -use Flarum\Sticky\Notifications\DiscussionStickiedBlueprint; -use Flarum\Sticky\Events\DiscussionWasStickied; -use Flarum\Sticky\Events\DiscussionWasUnstickied; -use Flarum\Core\Notifications\NotificationSyncer; -use Flarum\Core\Discussions\Discussion; -use Flarum\Core\Users\User; -use Illuminate\Contracts\Events\Dispatcher; - -class NotifyDiscussionStickied -{ - protected $notifications; - - public function __construct(NotificationSyncer $notifications) - { - $this->notifications = $notifications; - } - - public function subscribe(Dispatcher $events) - { - $events->listen(RegisterPostTypes::class, [$this, 'registerPostType']); - $events->listen(RegisterNotificationTypes::class, [$this, 'registerNotificationType']); - $events->listen(DiscussionWasStickied::class, [$this, 'whenDiscussionWasStickied']); - $events->listen(DiscussionWasUnstickied::class, [$this, 'whenDiscussionWasUnstickied']); - } - - public function registerPostType(RegisterPostTypes $event) - { - $event->register('Flarum\Sticky\Posts\DiscussionStickiedPost'); - } - - public function registerNotificationType(RegisterNotificationTypes $event) - { - $event->register( - 'Flarum\Sticky\Notifications\DiscussionStickiedBlueprint', - 'Flarum\Api\Serializers\DiscussionBasicSerializer', - ['alert'] - ); - } - - public function whenDiscussionWasStickied(DiscussionWasStickied $event) - { - $this->stickyChanged($event->discussion, $event->user, true); - } - - public function whenDiscussionWasUnstickied(DiscussionWasUnstickied $event) - { - $this->stickyChanged($event->discussion, $event->user, false); - } - - protected function stickyChanged(Discussion $discussion, User $user, $isSticky) - { - $post = DiscussionStickiedPost::reply( - $discussion->id, - $user->id, - $isSticky - ); - - $post = $discussion->mergePost($post); - - if ($discussion->start_user_id !== $user->id) { - $notification = new DiscussionStickiedBlueprint($post); - - $this->notifications->sync($notification, $post->exists ? [$discussion->startUser] : []); - } - } -} diff --git a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php deleted file mode 100755 index 8fd1dd913..000000000 --- a/extensions/sticky/src/Listeners/PinStickiedDiscussionsToTop.php +++ /dev/null @@ -1,64 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Listeners; - -use Flarum\Events\RegisterDiscussionGambits; -use Flarum\Events\DiscussionSearchWillBePerformed; -use Flarum\Tags\Gambits\TagGambit; -use Illuminate\Contracts\Events\Dispatcher; - -class PinStickiedDiscussionsToTop -{ - public function subscribe(Dispatcher $events) - { - $events->listen(RegisterDiscussionGambits::class, [$this, 'registerStickyGambit']); - $events->listen(DiscussionSearchWillBePerformed::class, [$this, 'reorderSearch']); - } - - public function registerStickyGambit(RegisterDiscussionGambits $event) - { - $event->gambits->add('Flarum\Sticky\Gambits\StickyGambit'); - } - - public function reorderSearch(DiscussionSearchWillBePerformed $event) - { - if ($event->criteria->sort === null) { - $query = $event->search->getQuery(); - - if (! is_array($query->orders)) { - $query->orders = []; - } - - foreach ($event->search->getActiveGambits() as $gambit) { - if ($gambit instanceof TagGambit) { - array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); - return; - } - } - - $query->leftJoin('users_discussions', function ($join) use ($event) { - $join->on('users_discussions.discussion_id', '=', 'discussions.id') - ->where('discussions.is_sticky', '=', true) - ->where('users_discussions.user_id', '=', $event->search->getActor()->id); - }); - - // might be quicker to do a subquery in the order clause than a join? - $prefix = app('Illuminate\Database\ConnectionInterface')->getTablePrefix(); - array_unshift( - $query->orders, - [ - 'type' => 'raw', - 'sql' => "(is_sticky AND ({$prefix}users_discussions.read_number IS NULL OR {$prefix}discussions.last_post_number > {$prefix}users_discussions.read_number)) desc" - ] - ); - } - } -} diff --git a/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php b/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php deleted file mode 100644 index c12299d66..000000000 --- a/extensions/sticky/src/Notifications/DiscussionStickiedBlueprint.php +++ /dev/null @@ -1,49 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Notifications; - -use Flarum\Sticky\Posts\DiscussionStickiedPost; -use Flarum\Core\Notifications\Blueprint; - -class DiscussionStickiedBlueprint implements Blueprint -{ - protected $post; - - public function __construct(DiscussionStickiedPost $post) - { - $this->post = $post; - } - - public function getSender() - { - return $this->post->user; - } - - public function getSubject() - { - return $this->post->discussion; - } - - public function getData() - { - return ['postNumber' => (int) $this->post->number]; - } - - public static function getType() - { - return 'discussionStickied'; - } - - public static function getSubjectModel() - { - return 'Flarum\Core\Discussions\Discussion'; - } -} diff --git a/extensions/sticky/src/Posts/DiscussionStickiedPost.php b/extensions/sticky/src/Post/DiscussionStickiedPost.php similarity index 86% rename from extensions/sticky/src/Posts/DiscussionStickiedPost.php rename to extensions/sticky/src/Post/DiscussionStickiedPost.php index df05739a1..2c9ff3c55 100755 --- a/extensions/sticky/src/Posts/DiscussionStickiedPost.php +++ b/extensions/sticky/src/Post/DiscussionStickiedPost.php @@ -8,16 +8,22 @@ * file that was distributed with this source code. */ -namespace Flarum\Sticky\Posts; +namespace Flarum\Sticky\Post; -use Flarum\Core\Posts\Post; -use Flarum\Core\Posts\EventPost; -use Flarum\Core\Posts\MergeablePost; +use Flarum\Core\Post; +use Flarum\Core\Post\AbstractEventPost; +use Flarum\Core\Post\MergeableInterface; -class DiscussionStickiedPost extends EventPost implements MergeablePost +class DiscussionStickiedPost extends AbstractEventPost implements MergeableInterface { + /** + * {@inheritdoc} + */ public static $type = 'discussionStickied'; + /** + * {@inheritdoc} + */ public function saveAfter(Post $previous) { // If the previous post is another 'discussion stickied' post, and it's From 0ddd1dcd59765357392946e724e1d0365bffd90b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Oct 2015 13:01:53 +1030 Subject: [PATCH 046/183] Rename initializer --- extensions/sticky/js/admin/src/main.js | 2 +- extensions/sticky/js/forum/src/main.js | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/extensions/sticky/js/admin/src/main.js b/extensions/sticky/js/admin/src/main.js index 717b57f85..eaad2fedf 100644 --- a/extensions/sticky/js/admin/src/main.js +++ b/extensions/sticky/js/admin/src/main.js @@ -2,7 +2,7 @@ import { extend } from 'flarum/extend'; import app from 'flarum/app'; import PermissionGrid from 'flarum/components/PermissionGrid'; -app.initializers.add('sticky', () => { +app.initializers.add('flarum-sticky', () => { extend(PermissionGrid.prototype, 'moderateItems', items => { items.add('sticky', { icon: 'thumb-tack', diff --git a/extensions/sticky/js/forum/src/main.js b/extensions/sticky/js/forum/src/main.js index 3b3a1b493..1cfe374e2 100644 --- a/extensions/sticky/js/forum/src/main.js +++ b/extensions/sticky/js/forum/src/main.js @@ -8,11 +8,13 @@ import addStickyBadge from 'flarum/sticky/addStickyBadge'; import addStickyControl from 'flarum/sticky/addStickyControl'; import addStickyExcerpt from 'flarum/sticky/addStickyExcerpt'; -app.postComponents.discussionStickied = DiscussionStickiedPost; +app.initializers.add('flarum-sticky', () => { + app.postComponents.discussionStickied = DiscussionStickiedPost; -Discussion.prototype.isSticky = Model.attribute('isSticky'); -Discussion.prototype.canSticky = Model.attribute('canSticky'); + Discussion.prototype.isSticky = Model.attribute('isSticky'); + Discussion.prototype.canSticky = Model.attribute('canSticky'); -addStickyBadge(); -addStickyControl(); -addStickyExcerpt(); \ No newline at end of file + addStickyBadge(); + addStickyControl(); + addStickyExcerpt(); +}); \ No newline at end of file From 030e0c99388c078628e84cf85cd4ef561dcc380d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 11 Oct 2015 22:24:12 +1030 Subject: [PATCH 047/183] Update API, add default translations --- extensions/sticky/src/Listener/AddClientAssets.php | 1 + .../sticky/src/Listener/PinStickiedDiscussionsToTop.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/sticky/src/Listener/AddClientAssets.php b/extensions/sticky/src/Listener/AddClientAssets.php index 26fb77f1d..35c1ff1c5 100755 --- a/extensions/sticky/src/Listener/AddClientAssets.php +++ b/extensions/sticky/src/Listener/AddClientAssets.php @@ -42,6 +42,7 @@ class AddClientAssets __DIR__.'/../../js/admin/dist/extension.js' ]); $event->addBootstrapper('flarum/sticky/main'); + $event->addTranslations('flarum-sticky.admin'); } } } diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 960ebf27d..46a09692e 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -11,7 +11,7 @@ namespace Flarum\Sticky\Listener; use Flarum\Event\ConfigureDiscussionGambits; -use Flarum\Event\DiscussionSearchWillBePerformed; +use Flarum\Event\ConfigureDiscussionSearch; use Flarum\Sticky\Gambit\StickyGambit; use Flarum\Tags\Gambit\TagGambit; use Illuminate\Contracts\Events\Dispatcher; @@ -24,7 +24,7 @@ class PinStickiedDiscussionsToTop public function subscribe(Dispatcher $events) { $events->listen(ConfigureDiscussionGambits::class, [$this, 'addStickyGambit']); - $events->listen(DiscussionSearchWillBePerformed::class, [$this, 'reorderSearch']); + $events->listen(ConfigureDiscussionSearch::class, [$this, 'reorderSearch']); } /** @@ -36,9 +36,9 @@ class PinStickiedDiscussionsToTop } /** - * @param DiscussionSearchWillBePerformed $event + * @param ConfigureDiscussionSearch $event */ - public function reorderSearch(DiscussionSearchWillBePerformed $event) + public function reorderSearch(ConfigureDiscussionSearch $event) { if ($event->criteria->sort === null) { $search = $event->search; From d11d9d144a004fc71d0de92d4bb99dacf84bcad1 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 12 Oct 2015 15:01:20 +1030 Subject: [PATCH 048/183] Update metadata --- extensions/sticky/composer.json | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 866ef4545..2be371636 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -2,6 +2,7 @@ "name": "flarum/sticky", "description": "Pin discussions to the top of the list.", "type": "flarum-extension", + "keywords": ["discussion"], "license": "MIT", "authors": [ { From 45e3e0fbffc121bfe36eb89fc2bf7cac74127a1f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 21 Oct 2015 10:29:31 +1030 Subject: [PATCH 049/183] Change `app.trans` calls to `app.translator.trans` calls --- extensions/sticky/js/forum/src/addStickyBadge.js | 2 +- extensions/sticky/js/forum/src/addStickyControl.js | 2 +- .../js/forum/src/components/DiscussionStickiedNotification.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/sticky/js/forum/src/addStickyBadge.js b/extensions/sticky/js/forum/src/addStickyBadge.js index 4c1bbd5bb..b6e05bda5 100644 --- a/extensions/sticky/js/forum/src/addStickyBadge.js +++ b/extensions/sticky/js/forum/src/addStickyBadge.js @@ -7,7 +7,7 @@ export default function addStickyBadge() { if (this.isSticky()) { badges.add('sticky', Badge.component({ type: 'sticky', - label: app.trans('flarum-sticky.forum.stickied'), + label: app.translator.trans('flarum-sticky.forum.stickied'), icon: 'thumb-tack' }), 10); } diff --git a/extensions/sticky/js/forum/src/addStickyControl.js b/extensions/sticky/js/forum/src/addStickyControl.js index 25f55921c..e14179bff 100644 --- a/extensions/sticky/js/forum/src/addStickyControl.js +++ b/extensions/sticky/js/forum/src/addStickyControl.js @@ -7,7 +7,7 @@ export default function addStickyControl() { extend(DiscussionControls, 'moderationControls', function(items, discussion) { if (discussion.canSticky()) { items.add('sticky', Button.component({ - children: app.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'), + children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'), icon: 'thumb-tack', onclick: this.stickyAction.bind(discussion) })); diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js index b69eef231..1101591d5 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js @@ -12,6 +12,6 @@ export default class DiscussionStickiedNotification extends Notification { } content() { - return app.trans('flarum-sticky.forum.discussion_stickied_notification', {user: this.props.notification.sender()}); + return app.translator.trans('flarum-sticky.forum.discussion_stickied_notification', {user: this.props.notification.sender()}); } } From 160f09281057d95c9f301efb0ea193f3fa6c9154 Mon Sep 17 00:00:00 2001 From: dcsjapan Date: Thu, 22 Oct 2015 09:21:00 +0900 Subject: [PATCH 050/183] Reorganize key names See [flarum/core #265](https://github.com/flarum/core/issues/265). - Adjusts key names to three-tier namespacing. - Extracts previously unextracted strings. --- extensions/sticky/js/admin/src/main.js | 2 +- extensions/sticky/js/forum/src/addStickyBadge.js | 2 +- extensions/sticky/js/forum/src/addStickyControl.js | 2 +- .../js/forum/src/components/DiscussionStickiedNotification.js | 2 +- .../sticky/js/forum/src/components/DiscussionStickiedPost.js | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/extensions/sticky/js/admin/src/main.js b/extensions/sticky/js/admin/src/main.js index eaad2fedf..08879f01f 100644 --- a/extensions/sticky/js/admin/src/main.js +++ b/extensions/sticky/js/admin/src/main.js @@ -6,7 +6,7 @@ app.initializers.add('flarum-sticky', () => { extend(PermissionGrid.prototype, 'moderateItems', items => { items.add('sticky', { icon: 'thumb-tack', - label: 'Sticky discussions', + label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'), permission: 'discussion.sticky' }, 95); }); diff --git a/extensions/sticky/js/forum/src/addStickyBadge.js b/extensions/sticky/js/forum/src/addStickyBadge.js index b6e05bda5..8d0d7ca2d 100644 --- a/extensions/sticky/js/forum/src/addStickyBadge.js +++ b/extensions/sticky/js/forum/src/addStickyBadge.js @@ -7,7 +7,7 @@ export default function addStickyBadge() { if (this.isSticky()) { badges.add('sticky', Badge.component({ type: 'sticky', - label: app.translator.trans('flarum-sticky.forum.stickied'), + label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'), icon: 'thumb-tack' }), 10); } diff --git a/extensions/sticky/js/forum/src/addStickyControl.js b/extensions/sticky/js/forum/src/addStickyControl.js index e14179bff..c08aff5e9 100644 --- a/extensions/sticky/js/forum/src/addStickyControl.js +++ b/extensions/sticky/js/forum/src/addStickyControl.js @@ -7,7 +7,7 @@ export default function addStickyControl() { extend(DiscussionControls, 'moderationControls', function(items, discussion) { if (discussion.canSticky()) { items.add('sticky', Button.component({ - children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'), + children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'), icon: 'thumb-tack', onclick: this.stickyAction.bind(discussion) })); diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js index 1101591d5..593431262 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js @@ -12,6 +12,6 @@ export default class DiscussionStickiedNotification extends Notification { } content() { - return app.translator.trans('flarum-sticky.forum.discussion_stickied_notification', {user: this.props.notification.sender()}); + return '{username} stickied'; } } diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js index 613c46683..bd207c035 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js @@ -7,7 +7,7 @@ export default class DiscussionStickiedPost extends EventPost { descriptionKey() { return this.props.post.content().sticky - ? 'flarum-sticky.forum.discussion_stickied_post' - : 'flarum-sticky.forum.discussion_unstickied_post'; + ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' + : 'flarum-sticky.forum.post_stream.discussion_unstickied_text'; } } From 50e838e990e5b1ec05ba20d1472ec2936233ccef Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 22 Oct 2015 11:14:11 +1030 Subject: [PATCH 051/183] Remove unused notification component --- .../DiscussionStickiedNotification.js | 17 ----------------- 1 file changed, 17 deletions(-) delete mode 100644 extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js deleted file mode 100644 index 593431262..000000000 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedNotification.js +++ /dev/null @@ -1,17 +0,0 @@ -import Notification from 'flarum/components/Notification'; - -export default class DiscussionStickiedNotification extends Notification { - icon() { - return 'thumb-tack'; - } - - href() { - const notification = this.props.notification; - - return app.route.discussion(notification.subject(), notification.content().postNumber); - } - - content() { - return '{username} stickied'; - } -} From f7e815f6e6001e1905554123e206c927d6434647 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 27 Oct 2015 12:17:08 +1030 Subject: [PATCH 052/183] Recompile JS --- extensions/sticky/js/forum/dist/extension.js | 61 ++++---------------- 1 file changed, 11 insertions(+), 50 deletions(-) diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index 33fd2484a..58e120a2b 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -10,7 +10,7 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models if (this.isSticky()) { badges.add('sticky', Badge.component({ type: 'sticky', - label: app.trans('flarum-sticky.forum.stickied'), + label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'), icon: 'thumb-tack' }), 10); } @@ -38,7 +38,7 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models extend(DiscussionControls, 'moderationControls', function (items, discussion) { if (discussion.canSticky()) { items.add('sticky', Button.component({ - children: app.trans(discussion.isSticky() ? 'flarum-sticky.forum.unsticky' : 'flarum-sticky.forum.sticky'), + children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'), icon: 'thumb-tack', onclick: this.stickyAction.bind(discussion) })); @@ -136,55 +136,16 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }], execute: function () { - app.postComponents.discussionStickied = DiscussionStickiedPost; + app.initializers.add('flarum-sticky', function () { + app.postComponents.discussionStickied = DiscussionStickiedPost; - Discussion.prototype.isSticky = Model.attribute('isSticky'); - Discussion.prototype.canSticky = Model.attribute('canSticky'); + Discussion.prototype.isSticky = Model.attribute('isSticky'); + Discussion.prototype.canSticky = Model.attribute('canSticky'); - addStickyBadge(); - addStickyControl(); - addStickyExcerpt(); - } - }; -});;System.register('flarum/sticky/components/DiscussionStickiedNotification', ['flarum/components/Notification'], function (_export) { - 'use strict'; - - var Notification, DiscussionStickiedNotification; - return { - setters: [function (_flarumComponentsNotification) { - Notification = _flarumComponentsNotification['default']; - }], - execute: function () { - DiscussionStickiedNotification = (function (_Notification) { - babelHelpers.inherits(DiscussionStickiedNotification, _Notification); - - function DiscussionStickiedNotification() { - babelHelpers.classCallCheck(this, DiscussionStickiedNotification); - babelHelpers.get(Object.getPrototypeOf(DiscussionStickiedNotification.prototype), 'constructor', this).apply(this, arguments); - } - - babelHelpers.createClass(DiscussionStickiedNotification, [{ - key: 'icon', - value: function icon() { - return 'thumb-tack'; - } - }, { - key: 'href', - value: function href() { - var notification = this.props.notification; - - return app.route.discussion(notification.subject(), notification.content().postNumber); - } - }, { - key: 'content', - value: function content() { - return app.trans('flarum-sticky.forum.discussion_stickied_notification', { user: this.props.notification.sender() }); - } - }]); - return DiscussionStickiedNotification; - })(Notification); - - _export('default', DiscussionStickiedNotification); + addStickyBadge(); + addStickyControl(); + addStickyExcerpt(); + }); } }; });;System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export) { @@ -212,7 +173,7 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }, { key: 'descriptionKey', value: function descriptionKey() { - return this.props.post.content().sticky ? 'flarum-sticky.forum.discussion_stickied_post' : 'flarum-sticky.forum.discussion_unstickied_post'; + return this.props.post.content().sticky ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' : 'flarum-sticky.forum.post_stream.discussion_unstickied_text'; } }]); return DiscussionStickiedPost; From 36b81b55bb69416181e03ff47908b3e572005b83 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 27 Oct 2015 12:40:16 +1030 Subject: [PATCH 053/183] Recompile JS --- extensions/sticky/js/admin/dist/extension.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/js/admin/dist/extension.js b/extensions/sticky/js/admin/dist/extension.js index ec8f3ac3b..a7a53b1d6 100644 --- a/extensions/sticky/js/admin/dist/extension.js +++ b/extensions/sticky/js/admin/dist/extension.js @@ -12,11 +12,11 @@ System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/co }], execute: function () { - app.initializers.add('sticky', function () { + app.initializers.add('flarum-sticky', function () { extend(PermissionGrid.prototype, 'moderateItems', function (items) { items.add('sticky', { icon: 'thumb-tack', - label: 'Sticky discussions', + label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'), permission: 'discussion.sticky' }, 95); }); From 395b45156b38536a9937ade944a72df85eebdad4 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 2 Nov 2015 18:52:52 +1030 Subject: [PATCH 054/183] Translations are now automatically included --- extensions/sticky/src/Listener/AddClientAssets.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/extensions/sticky/src/Listener/AddClientAssets.php b/extensions/sticky/src/Listener/AddClientAssets.php index 35c1ff1c5..b10399a9a 100755 --- a/extensions/sticky/src/Listener/AddClientAssets.php +++ b/extensions/sticky/src/Listener/AddClientAssets.php @@ -34,7 +34,6 @@ class AddClientAssets __DIR__.'/../../less/forum/extension.less' ]); $event->addBootstrapper('flarum/sticky/main'); - $event->addTranslations('flarum-sticky.forum'); } if ($event->isAdmin()) { @@ -42,7 +41,6 @@ class AddClientAssets __DIR__.'/../../js/admin/dist/extension.js' ]); $event->addBootstrapper('flarum/sticky/main'); - $event->addTranslations('flarum-sticky.admin'); } } } From a6a9e87873ba80c0f6dc9e274bb0c32cb1a47179 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 3 Nov 2015 10:03:45 +1030 Subject: [PATCH 055/183] Release 0.1.0-beta.3 --- extensions/sticky/js/forum/dist/extension.js | 78 ++++++++++---------- 1 file changed, 41 insertions(+), 37 deletions(-) diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index 58e120a2b..381a1b494 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -27,7 +27,8 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }], execute: function () {} }; -});;System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export) { +});; +System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export) { 'use strict'; var extend, DiscussionControls, DiscussionPage, Button; @@ -68,7 +69,8 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }], execute: function () {} }; -});;System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export) { +});; +System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export) { 'use strict'; var extend, DiscussionList, DiscussionListItem, truncate; @@ -111,7 +113,43 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }], execute: function () {} }; -});;System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export) { +});; +System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export) { + 'use strict'; + + var EventPost, DiscussionStickiedPost; + return { + setters: [function (_flarumComponentsEventPost) { + EventPost = _flarumComponentsEventPost['default']; + }], + execute: function () { + DiscussionStickiedPost = (function (_EventPost) { + babelHelpers.inherits(DiscussionStickiedPost, _EventPost); + + function DiscussionStickiedPost() { + babelHelpers.classCallCheck(this, DiscussionStickiedPost); + babelHelpers.get(Object.getPrototypeOf(DiscussionStickiedPost.prototype), 'constructor', this).apply(this, arguments); + } + + babelHelpers.createClass(DiscussionStickiedPost, [{ + key: 'icon', + value: function icon() { + return 'thumb-tack'; + } + }, { + key: 'descriptionKey', + value: function descriptionKey() { + return this.props.post.content().sticky ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' : 'flarum-sticky.forum.post_stream.discussion_unstickied_text'; + } + }]); + return DiscussionStickiedPost; + })(EventPost); + + _export('default', DiscussionStickiedPost); + } + }; +});; +System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export) { 'use strict'; var extend, notificationType, app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; @@ -148,38 +186,4 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }); } }; -});;System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export) { - 'use strict'; - - var EventPost, DiscussionStickiedPost; - return { - setters: [function (_flarumComponentsEventPost) { - EventPost = _flarumComponentsEventPost['default']; - }], - execute: function () { - DiscussionStickiedPost = (function (_EventPost) { - babelHelpers.inherits(DiscussionStickiedPost, _EventPost); - - function DiscussionStickiedPost() { - babelHelpers.classCallCheck(this, DiscussionStickiedPost); - babelHelpers.get(Object.getPrototypeOf(DiscussionStickiedPost.prototype), 'constructor', this).apply(this, arguments); - } - - babelHelpers.createClass(DiscussionStickiedPost, [{ - key: 'icon', - value: function icon() { - return 'thumb-tack'; - } - }, { - key: 'descriptionKey', - value: function descriptionKey() { - return this.props.post.content().sticky ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' : 'flarum-sticky.forum.post_stream.discussion_unstickied_text'; - } - }]); - return DiscussionStickiedPost; - })(EventPost); - - _export('default', DiscussionStickiedPost); - } - }; }); \ No newline at end of file From 85c71af3a53c275fa20b955b425a145e2f140e4d Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 29 Dec 2015 12:55:46 +1030 Subject: [PATCH 056/183] Rename package --- extensions/sticky/composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 2be371636..93c13dcd6 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -1,5 +1,5 @@ { - "name": "flarum/sticky", + "name": "flarum/flarum-ext-sticky", "description": "Pin discussions to the top of the list.", "type": "flarum-extension", "keywords": ["discussion"], @@ -12,7 +12,7 @@ ], "support": { "issues": "https://github.com/flarum/core/issues", - "source": "https://github.com/flarum/sticky" + "source": "https://github.com/flarum/flarum-ext-sticky" }, "require": { "flarum/core": "^0.1.0-beta.3" From 1fdcf580143807e19a0b8a3356f653408da0d494 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 19 Jan 2016 17:18:10 +1030 Subject: [PATCH 057/183] Add Composer branch-alias This allows installations to require version 0.1.0 with minimum-stability=dev, and they will get the latest from master. See flarum/core#727 --- extensions/sticky/composer.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 93c13dcd6..ab96235a5 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -23,6 +23,9 @@ } }, "extra": { + "branch-alias": { + "dev-master": "0.1.x-dev" + }, "flarum-extension": { "title": "Sticky", "icon": { From a82d256366858361c963e82e6cef78851a7a17e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ma=C3=ABl=20Soucaze?= Date: Mon, 25 Jan 2016 16:54:00 +0100 Subject: [PATCH 058/183] Update license year range to 2016 --- extensions/sticky/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/LICENSE b/extensions/sticky/LICENSE index aa1e5fb86..a502a8545 100644 --- a/extensions/sticky/LICENSE +++ b/extensions/sticky/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2015 Toby Zerner +Copyright (c) 2014-2016 Toby Zerner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From ead84c29c5f7c49dd38c3e0c75939f2583e82b3e Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Wed, 24 Feb 2016 23:13:39 +0900 Subject: [PATCH 059/183] Use new migration format --- ...02_24_000000_add_sticky_to_discussions.php | 21 +++++++------------ 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index aded7e5c9..9e378f5a6 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -8,24 +8,19 @@ * file that was distributed with this source code. */ -namespace Flarum\Sticky\Migration; - -use Flarum\Database\AbstractMigration; use Illuminate\Database\Schema\Blueprint; +use Illuminate\Database\Schema\Builder; -class AddStickyToDiscussions extends AbstractMigration -{ - public function up() - { - $this->schema->table('discussions', function (Blueprint $table) { +return [ + 'up' => function (Builder $schema) { + $schema->table('discussions', function (Blueprint $table) { $table->boolean('is_sticky')->default(0); }); - } + }, - public function down() - { - $this->schema->table('discussions', function (Blueprint $table) { + 'down' => function (Builder $schema) { + $schema->table('discussions', function (Blueprint $table) { $table->dropColumn('is_sticky'); }); } -} +]; From 648cad1a385facc22245f0788540be9f1eaddb48 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 26 Feb 2016 14:02:50 +1030 Subject: [PATCH 060/183] Add StyleCI config --- extensions/sticky/.styleci.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 extensions/sticky/.styleci.yml diff --git a/extensions/sticky/.styleci.yml b/extensions/sticky/.styleci.yml new file mode 100644 index 000000000..00617d9b0 --- /dev/null +++ b/extensions/sticky/.styleci.yml @@ -0,0 +1,13 @@ +preset: recommended + +enabled: + - logical_not_operators_with_successor_space + +disabled: + - align_double_arrow + - multiline_array_trailing_comma + - new_with_braces + - phpdoc_align + - phpdoc_order + - phpdoc_separation + - phpdoc_types From b59268b856c7ace26ae5299fa47f3ee4ba0eb57a Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 25 Feb 2016 22:56:55 -0500 Subject: [PATCH 061/183] Applied fixes from StyleCI --- .../sticky/src/Event/DiscussionWasStickied.php | 3 ++- .../src/Event/DiscussionWasUnstickied.php | 3 ++- extensions/sticky/src/Gambit/StickyGambit.php | 5 +++-- .../sticky/src/Listener/AddApiAttributes.php | 3 ++- .../CreatePostWhenDiscussionIsStickied.php | 3 ++- .../Listener/PinStickiedDiscussionsToTop.php | 4 +++- .../src/Listener/SaveStickyToDatabase.php | 5 +++-- .../sticky/src/Post/DiscussionStickiedPost.php | 17 +++++++++-------- 8 files changed, 26 insertions(+), 17 deletions(-) diff --git a/extensions/sticky/src/Event/DiscussionWasStickied.php b/extensions/sticky/src/Event/DiscussionWasStickied.php index cef0dc958..0eeb7cca2 100644 --- a/extensions/sticky/src/Event/DiscussionWasStickied.php +++ b/extensions/sticky/src/Event/DiscussionWasStickied.php @@ -1,4 +1,5 @@ -getActiveGambits() as $gambit) { if ($gambit instanceof TagGambit) { array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); + return; } } diff --git a/extensions/sticky/src/Listener/SaveStickyToDatabase.php b/extensions/sticky/src/Listener/SaveStickyToDatabase.php index 3209a39db..836a00a0c 100755 --- a/extensions/sticky/src/Listener/SaveStickyToDatabase.php +++ b/extensions/sticky/src/Listener/SaveStickyToDatabase.php @@ -1,4 +1,5 @@ -content = static::buildContent($isSticky); - $post->time = time(); + $post->content = static::buildContent($isSticky); + $post->time = time(); $post->discussion_id = $discussionId; - $post->user_id = $userId; + $post->user_id = $userId; return $post; } @@ -70,7 +71,7 @@ class DiscussionStickiedPost extends AbstractEventPost implements MergeableInter /** * Build the content attribute. * - * @param boolean $isSticky Whether or not the discussion is stickied. + * @param bool $isSticky Whether or not the discussion is stickied. * @return array */ public static function buildContent($isSticky) From 3b6fc53f91559f1452c569069bcddd0ce56de10f Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 29 Feb 2016 18:53:04 +1030 Subject: [PATCH 062/183] Update MergeableInterface method arguments --- extensions/sticky/src/Post/DiscussionStickiedPost.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/src/Post/DiscussionStickiedPost.php b/extensions/sticky/src/Post/DiscussionStickiedPost.php index 26d9abcb1..0ad5cabb5 100755 --- a/extensions/sticky/src/Post/DiscussionStickiedPost.php +++ b/extensions/sticky/src/Post/DiscussionStickiedPost.php @@ -25,7 +25,7 @@ class DiscussionStickiedPost extends AbstractEventPost implements MergeableInter /** * {@inheritdoc} */ - public function saveAfter(Post $previous) + public function saveAfter(Post $previous = null) { // If the previous post is another 'discussion stickied' post, and it's // by the same user, then we can merge this post into it. If we find From da664d1624ad4f60c4c1f02cd27d0e0b64b3610c Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Fri, 4 Mar 2016 01:12:30 +0900 Subject: [PATCH 063/183] Use new shortcuts for migrations --- ...02_24_000000_add_sticky_to_discussions.php | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index 9e378f5a6..655a01c98 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -8,19 +8,8 @@ * file that was distributed with this source code. */ -use Illuminate\Database\Schema\Blueprint; -use Illuminate\Database\Schema\Builder; +use Flarum\Database\Migration; -return [ - 'up' => function (Builder $schema) { - $schema->table('discussions', function (Blueprint $table) { - $table->boolean('is_sticky')->default(0); - }); - }, - - 'down' => function (Builder $schema) { - $schema->table('discussions', function (Blueprint $table) { - $table->dropColumn('is_sticky'); - }); - } -]; +return Migration::addColumns('discussions', [ + 'is_sticky' => ['boolean', 'default' => 0] +]); From ad80f1bc1e20f4e8ea52e36b8de76f7e892b2f02 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 10 Mar 2016 17:22:05 +1030 Subject: [PATCH 064/183] Clean up linting stuff --- extensions/sticky/.eslintignore | 5 - extensions/sticky/.eslintrc | 176 -------------------------------- extensions/sticky/.php_cs | 26 ----- extensions/sticky/.travis.yml | 23 ----- 4 files changed, 230 deletions(-) delete mode 100644 extensions/sticky/.eslintignore delete mode 100644 extensions/sticky/.eslintrc delete mode 100755 extensions/sticky/.php_cs delete mode 100644 extensions/sticky/.travis.yml diff --git a/extensions/sticky/.eslintignore b/extensions/sticky/.eslintignore deleted file mode 100644 index 86b7c8854..000000000 --- a/extensions/sticky/.eslintignore +++ /dev/null @@ -1,5 +0,0 @@ -**/bower_components/**/* -**/node_modules/**/* -vendor/**/* -**/Gulpfile.js -**/dist/**/* diff --git a/extensions/sticky/.eslintrc b/extensions/sticky/.eslintrc deleted file mode 100644 index 534b50e27..000000000 --- a/extensions/sticky/.eslintrc +++ /dev/null @@ -1,176 +0,0 @@ -{ - "parser": "babel-eslint", // https://github.com/babel/babel-eslint - "env": { // http://eslint.org/docs/user-guide/configuring.html#specifying-environments - "browser": true // browser global variables - }, - "ecmaFeatures": { - "arrowFunctions": true, - "blockBindings": true, - "classes": true, - "defaultParams": true, - "destructuring": true, - "forOf": true, - "generators": false, - "modules": true, - "objectLiteralComputedProperties": true, - "objectLiteralDuplicateProperties": false, - "objectLiteralShorthandMethods": true, - "objectLiteralShorthandProperties": true, - "spread": true, - "superInFunctions": true, - "templateStrings": true, - "jsx": true - }, - "globals": { - "m": true, - "app": true, - "$": true, - "moment": true - }, - "plugins": [ - "react" - ], - "rules": { - "react/jsx-uses-vars": 1, - -/** - * Strict mode - */ - // babel inserts "use strict"; for us - "strict": [2, "never"], // http://eslint.org/docs/rules/strict - -/** - * ES6 - */ - "no-var": 2, // http://eslint.org/docs/rules/no-var - "prefer-const": 2, // http://eslint.org/docs/rules/prefer-const - -/** - * Variables - */ - "no-shadow": 2, // http://eslint.org/docs/rules/no-shadow - "no-shadow-restricted-names": 2, // http://eslint.org/docs/rules/no-shadow-restricted-names - "no-unused-vars": [2, { // http://eslint.org/docs/rules/no-unused-vars - "vars": "local", - "args": "after-used" - }], - "no-use-before-define": 2, // http://eslint.org/docs/rules/no-use-before-define - -/** - * Possible errors - */ - "comma-dangle": [2, "never"], // http://eslint.org/docs/rules/comma-dangle - "no-cond-assign": [2, "always"], // http://eslint.org/docs/rules/no-cond-assign - "no-console": 1, // http://eslint.org/docs/rules/no-console - "no-debugger": 1, // http://eslint.org/docs/rules/no-debugger - "no-alert": 1, // http://eslint.org/docs/rules/no-alert - "no-constant-condition": 1, // http://eslint.org/docs/rules/no-constant-condition - "no-dupe-keys": 2, // http://eslint.org/docs/rules/no-dupe-keys - "no-duplicate-case": 2, // http://eslint.org/docs/rules/no-duplicate-case - "no-empty": 2, // http://eslint.org/docs/rules/no-empty - "no-ex-assign": 2, // http://eslint.org/docs/rules/no-ex-assign - "no-extra-boolean-cast": 0, // http://eslint.org/docs/rules/no-extra-boolean-cast - "no-extra-semi": 2, // http://eslint.org/docs/rules/no-extra-semi - "no-func-assign": 2, // http://eslint.org/docs/rules/no-func-assign - "no-inner-declarations": 2, // http://eslint.org/docs/rules/no-inner-declarations - "no-invalid-regexp": 2, // http://eslint.org/docs/rules/no-invalid-regexp - "no-irregular-whitespace": 2, // http://eslint.org/docs/rules/no-irregular-whitespace - "no-obj-calls": 2, // http://eslint.org/docs/rules/no-obj-calls - "no-reserved-keys": 2, // http://eslint.org/docs/rules/no-reserved-keys - "no-sparse-arrays": 2, // http://eslint.org/docs/rules/no-sparse-arrays - "no-unreachable": 2, // http://eslint.org/docs/rules/no-unreachable - "use-isnan": 2, // http://eslint.org/docs/rules/use-isnan - "block-scoped-var": 2, // http://eslint.org/docs/rules/block-scoped-var - -/** - * Best practices - */ - "consistent-return": 2, // http://eslint.org/docs/rules/consistent-return - "curly": [2, "multi-line"], // http://eslint.org/docs/rules/curly - "default-case": 2, // http://eslint.org/docs/rules/default-case - "dot-notation": [2, { // http://eslint.org/docs/rules/dot-notation - "allowKeywords": true - }], - "eqeqeq": 2, // http://eslint.org/docs/rules/eqeqeq - "no-caller": 2, // http://eslint.org/docs/rules/no-caller - "no-else-return": 2, // http://eslint.org/docs/rules/no-else-return - "no-eq-null": 2, // http://eslint.org/docs/rules/no-eq-null - "no-eval": 2, // http://eslint.org/docs/rules/no-eval - "no-extend-native": 2, // http://eslint.org/docs/rules/no-extend-native - "no-extra-bind": 2, // http://eslint.org/docs/rules/no-extra-bind - "no-fallthrough": 2, // http://eslint.org/docs/rules/no-fallthrough - "no-floating-decimal": 2, // http://eslint.org/docs/rules/no-floating-decimal - "no-implied-eval": 2, // http://eslint.org/docs/rules/no-implied-eval - "no-lone-blocks": 2, // http://eslint.org/docs/rules/no-lone-blocks - "no-loop-func": 2, // http://eslint.org/docs/rules/no-loop-func - "no-multi-str": 2, // http://eslint.org/docs/rules/no-multi-str - "no-native-reassign": 2, // http://eslint.org/docs/rules/no-native-reassign - "no-new": 2, // http://eslint.org/docs/rules/no-new - "no-new-func": 2, // http://eslint.org/docs/rules/no-new-func - "no-new-wrappers": 2, // http://eslint.org/docs/rules/no-new-wrappers - "no-octal": 2, // http://eslint.org/docs/rules/no-octal - "no-octal-escape": 2, // http://eslint.org/docs/rules/no-octal-escape - "no-param-reassign": 2, // http://eslint.org/docs/rules/no-param-reassign - "no-proto": 2, // http://eslint.org/docs/rules/no-proto - "no-redeclare": 2, // http://eslint.org/docs/rules/no-redeclare - "no-return-assign": 2, // http://eslint.org/docs/rules/no-return-assign - "no-self-compare": 2, // http://eslint.org/docs/rules/no-self-compare - "no-sequences": 2, // http://eslint.org/docs/rules/no-sequences - "no-throw-literal": 2, // http://eslint.org/docs/rules/no-throw-literal - "no-with": 2, // http://eslint.org/docs/rules/no-with - "radix": 2, // http://eslint.org/docs/rules/radix - "vars-on-top": 2, // http://eslint.org/docs/rules/vars-on-top - "wrap-iife": [2, "any"], // http://eslint.org/docs/rules/wrap-iife - "yoda": 2, // http://eslint.org/docs/rules/yoda - -/** - * Style - */ - "indent": [2, 2], // http://eslint.org/docs/rules/indent - "brace-style": [2, // http://eslint.org/docs/rules/brace-style - "1tbs", { - "allowSingleLine": true - }], - "quotes": [ - 2, "single", "avoid-escape" // http://eslint.org/docs/rules/quotes - ], - "camelcase": [2, { // http://eslint.org/docs/rules/camelcase - "properties": "never" - }], - "comma-spacing": [2, { // http://eslint.org/docs/rules/comma-spacing - "before": false, - "after": true - }], - "comma-style": [2, "last"], // http://eslint.org/docs/rules/comma-style - "eol-last": 2, // http://eslint.org/docs/rules/eol-last - "func-names": 1, // http://eslint.org/docs/rules/func-names - "key-spacing": [2, { // http://eslint.org/docs/rules/key-spacing - "beforeColon": false, - "afterColon": true - }], - "new-cap": [2, { // http://eslint.org/docs/rules/new-cap - "newIsCap": true - }], - "no-multiple-empty-lines": [2, { // http://eslint.org/docs/rules/no-multiple-empty-lines - "max": 2 - }], - "no-new-object": 2, // http://eslint.org/docs/rules/no-new-object - "no-spaced-func": 2, // http://eslint.org/docs/rules/no-spaced-func - "no-trailing-spaces": 2, // http://eslint.org/docs/rules/no-trailing-spaces - "no-wrap-func": 2, // http://eslint.org/docs/rules/no-wrap-func - "no-underscore-dangle": 0, // http://eslint.org/docs/rules/no-underscore-dangle - "one-var": [2, "never"], // http://eslint.org/docs/rules/one-var - "padded-blocks": [2, "never"], // http://eslint.org/docs/rules/padded-blocks - "semi": [2, "always"], // http://eslint.org/docs/rules/semi - "semi-spacing": [2, { // http://eslint.org/docs/rules/semi-spacing - "before": false, - "after": true - }], - "space-after-keywords": 2, // http://eslint.org/docs/rules/space-after-keywords - "space-before-blocks": 2, // http://eslint.org/docs/rules/space-before-blocks - "space-before-function-paren": [2, "never"], // http://eslint.org/docs/rules/space-before-function-paren - "space-infix-ops": 2, // http://eslint.org/docs/rules/space-infix-ops - "space-return-throw-case": 2, // http://eslint.org/docs/rules/space-return-throw-case - "spaced-line-comment": 2, // http://eslint.org/docs/rules/spaced-line-comment - } -} diff --git a/extensions/sticky/.php_cs b/extensions/sticky/.php_cs deleted file mode 100755 index 20d29c766..000000000 --- a/extensions/sticky/.php_cs +++ /dev/null @@ -1,26 +0,0 @@ - - -For the full copyright and license information, please view the LICENSE -file that was distributed with this source code. -EOF; - -Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header); - -$finder = Symfony\CS\Finder\DefaultFinder::create() - ->exclude('js') - ->exclude('less') - ->in(__DIR__); - -return Symfony\CS\Config\Config::create() - ->level(Symfony\CS\FixerInterface::PSR2_LEVEL) - ->fixers([ - 'short_array_syntax', - 'header_comment', - '-psr0' - ]) - ->finder($finder); diff --git a/extensions/sticky/.travis.yml b/extensions/sticky/.travis.yml deleted file mode 100644 index 692e09f86..000000000 --- a/extensions/sticky/.travis.yml +++ /dev/null @@ -1,23 +0,0 @@ -language: php - -php: - - 5.5 - - 5.6 - -matrix: - allow_failures: - - php: hhvm - fast_finish: true - -before_script: - - curl -s http://getcomposer.org/installer | php - - php composer.phar install - -script: - - php composer.phar style - -notifications: - email: - on_failure: change - -sudo: false From fe90e5d6a5599d7b990b3acd42a6dd12cf73c4c6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 18 Mar 2016 09:33:31 +1030 Subject: [PATCH 065/183] Upgrade to flarum-gulp 0.2.0 / Babel 6 --- extensions/sticky/js/admin/dist/extension.js | 8 +-- extensions/sticky/js/admin/package.json | 4 +- extensions/sticky/js/forum/dist/extension.js | 71 ++++++++++---------- extensions/sticky/js/forum/package.json | 4 +- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/extensions/sticky/js/admin/dist/extension.js b/extensions/sticky/js/admin/dist/extension.js index a7a53b1d6..4bbf679ec 100644 --- a/extensions/sticky/js/admin/dist/extension.js +++ b/extensions/sticky/js/admin/dist/extension.js @@ -1,14 +1,14 @@ -System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/components/PermissionGrid'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/components/PermissionGrid'], function (_export, _context) { var extend, app, PermissionGrid; return { setters: [function (_flarumExtend) { extend = _flarumExtend.extend; }, function (_flarumApp) { - app = _flarumApp['default']; + app = _flarumApp.default; }, function (_flarumComponentsPermissionGrid) { - PermissionGrid = _flarumComponentsPermissionGrid['default']; + PermissionGrid = _flarumComponentsPermissionGrid.default; }], execute: function () { diff --git a/extensions/sticky/js/admin/package.json b/extensions/sticky/js/admin/package.json index 62ea6c691..19a7865d9 100644 --- a/extensions/sticky/js/admin/package.json +++ b/extensions/sticky/js/admin/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "gulp": "^3.8.11", - "flarum-gulp": "^0.1.0" + "gulp": "^3.9.1", + "flarum-gulp": "^0.2.0" } } diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index 381a1b494..008cf8253 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -1,10 +1,7 @@ -System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models/Discussion', 'flarum/components/Badge'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models/Discussion', 'flarum/components/Badge'], function (_export, _context) { var extend, Discussion, Badge; - - _export('default', addStickyBadge); - function addStickyBadge() { extend(Discussion.prototype, 'badges', function (badges) { if (this.isSticky()) { @@ -17,24 +14,23 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models }); } + _export('default', addStickyBadge); + return { setters: [function (_flarumExtend) { extend = _flarumExtend.extend; }, function (_flarumModelsDiscussion) { - Discussion = _flarumModelsDiscussion['default']; + Discussion = _flarumModelsDiscussion.default; }, function (_flarumComponentsBadge) { - Badge = _flarumComponentsBadge['default']; + Badge = _flarumComponentsBadge.default; }], execute: function () {} }; });; -System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export, _context) { var extend, DiscussionControls, DiscussionPage, Button; - - _export('default', addStickyControl); - function addStickyControl() { extend(DiscussionControls, 'moderationControls', function (items, discussion) { if (discussion.canSticky()) { @@ -57,26 +53,25 @@ System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/util }; } + _export('default', addStickyControl); + return { setters: [function (_flarumExtend) { extend = _flarumExtend.extend; }, function (_flarumUtilsDiscussionControls) { - DiscussionControls = _flarumUtilsDiscussionControls['default']; + DiscussionControls = _flarumUtilsDiscussionControls.default; }, function (_flarumComponentsDiscussionPage) { - DiscussionPage = _flarumComponentsDiscussionPage['default']; + DiscussionPage = _flarumComponentsDiscussionPage.default; }, function (_flarumComponentsButton) { - Button = _flarumComponentsButton['default']; + Button = _flarumComponentsButton.default; }], execute: function () {} }; });; -System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export, _context) { var extend, DiscussionList, DiscussionListItem, truncate; - - _export('default', addStickyControl); - function addStickyControl() { extend(DiscussionList.prototype, 'requestParams', function (params) { params.include.push('startPost'); @@ -101,34 +96,36 @@ System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/comp }); } + _export('default', addStickyControl); + return { setters: [function (_flarumExtend) { extend = _flarumExtend.extend; }, function (_flarumComponentsDiscussionList) { - DiscussionList = _flarumComponentsDiscussionList['default']; + DiscussionList = _flarumComponentsDiscussionList.default; }, function (_flarumComponentsDiscussionListItem) { - DiscussionListItem = _flarumComponentsDiscussionListItem['default']; + DiscussionListItem = _flarumComponentsDiscussionListItem.default; }, function (_flarumUtilsString) { truncate = _flarumUtilsString.truncate; }], execute: function () {} }; });; -System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export, _context) { var EventPost, DiscussionStickiedPost; return { setters: [function (_flarumComponentsEventPost) { - EventPost = _flarumComponentsEventPost['default']; + EventPost = _flarumComponentsEventPost.default; }], execute: function () { - DiscussionStickiedPost = (function (_EventPost) { + DiscussionStickiedPost = function (_EventPost) { babelHelpers.inherits(DiscussionStickiedPost, _EventPost); function DiscussionStickiedPost() { babelHelpers.classCallCheck(this, DiscussionStickiedPost); - babelHelpers.get(Object.getPrototypeOf(DiscussionStickiedPost.prototype), 'constructor', this).apply(this, arguments); + return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(DiscussionStickiedPost).apply(this, arguments)); } babelHelpers.createClass(DiscussionStickiedPost, [{ @@ -143,34 +140,34 @@ System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/comp } }]); return DiscussionStickiedPost; - })(EventPost); + }(EventPost); _export('default', DiscussionStickiedPost); } }; });; -System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export) { - 'use strict'; +'use strict'; +System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export, _context) { var extend, notificationType, app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; return { setters: [function (_flarumExtend) { extend = _flarumExtend.extend; notificationType = _flarumExtend.notificationType; }, function (_flarumApp) { - app = _flarumApp['default']; + app = _flarumApp.default; }, function (_flarumModel) { - Model = _flarumModel['default']; + Model = _flarumModel.default; }, function (_flarumModelsDiscussion) { - Discussion = _flarumModelsDiscussion['default']; + Discussion = _flarumModelsDiscussion.default; }, function (_flarumStickyComponentsDiscussionStickiedPost) { - DiscussionStickiedPost = _flarumStickyComponentsDiscussionStickiedPost['default']; + DiscussionStickiedPost = _flarumStickyComponentsDiscussionStickiedPost.default; }, function (_flarumStickyAddStickyBadge) { - addStickyBadge = _flarumStickyAddStickyBadge['default']; + addStickyBadge = _flarumStickyAddStickyBadge.default; }, function (_flarumStickyAddStickyControl) { - addStickyControl = _flarumStickyAddStickyControl['default']; + addStickyControl = _flarumStickyAddStickyControl.default; }, function (_flarumStickyAddStickyExcerpt) { - addStickyExcerpt = _flarumStickyAddStickyExcerpt['default']; + addStickyExcerpt = _flarumStickyAddStickyExcerpt.default; }], execute: function () { diff --git a/extensions/sticky/js/forum/package.json b/extensions/sticky/js/forum/package.json index 62ea6c691..19a7865d9 100644 --- a/extensions/sticky/js/forum/package.json +++ b/extensions/sticky/js/forum/package.json @@ -1,7 +1,7 @@ { "private": true, "devDependencies": { - "gulp": "^3.8.11", - "flarum-gulp": "^0.1.0" + "gulp": "^3.9.1", + "flarum-gulp": "^0.2.0" } } From 71db5f23e9bcde752922bf344ac2ddd6b6d081cb Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 29 Mar 2016 18:48:57 +1030 Subject: [PATCH 066/183] Require core v0.1.0-beta.5 --- extensions/sticky/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index ab96235a5..18897e4ef 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -15,7 +15,7 @@ "source": "https://github.com/flarum/flarum-ext-sticky" }, "require": { - "flarum/core": "^0.1.0-beta.3" + "flarum/core": "^0.1.0-beta.5" }, "autoload": { "psr-4": { From 5c6089b4df08726f1d1b3ba4f59bbe3ae2e73ded Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 3 Jun 2016 11:02:28 +0930 Subject: [PATCH 067/183] Recompile dist JS using latest version of babel --- extensions/sticky/js/admin/dist/extension.js | 2 ++ extensions/sticky/js/forum/dist/extension.js | 10 ++++++++++ 2 files changed, 12 insertions(+) diff --git a/extensions/sticky/js/admin/dist/extension.js b/extensions/sticky/js/admin/dist/extension.js index 4bbf679ec..b3bc4bc02 100644 --- a/extensions/sticky/js/admin/dist/extension.js +++ b/extensions/sticky/js/admin/dist/extension.js @@ -1,6 +1,8 @@ 'use strict'; System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/components/PermissionGrid'], function (_export, _context) { + "use strict"; + var extend, app, PermissionGrid; return { setters: [function (_flarumExtend) { diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index 008cf8253..971b22472 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -1,6 +1,8 @@ 'use strict'; System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models/Discussion', 'flarum/components/Badge'], function (_export, _context) { + "use strict"; + var extend, Discussion, Badge; function addStickyBadge() { extend(Discussion.prototype, 'badges', function (badges) { @@ -30,6 +32,8 @@ System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models 'use strict'; System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export, _context) { + "use strict"; + var extend, DiscussionControls, DiscussionPage, Button; function addStickyControl() { extend(DiscussionControls, 'moderationControls', function (items, discussion) { @@ -71,6 +75,8 @@ System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/util 'use strict'; System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export, _context) { + "use strict"; + var extend, DiscussionList, DiscussionListItem, truncate; function addStickyControl() { extend(DiscussionList.prototype, 'requestParams', function (params) { @@ -114,6 +120,8 @@ System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/comp 'use strict'; System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export, _context) { + "use strict"; + var EventPost, DiscussionStickiedPost; return { setters: [function (_flarumComponentsEventPost) { @@ -149,6 +157,8 @@ System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/comp 'use strict'; System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export, _context) { + "use strict"; + var extend, notificationType, app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; return { setters: [function (_flarumExtend) { From dce149b53673121b23982f85f3f8b8f483d40337 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 3 Jun 2016 11:02:34 +0930 Subject: [PATCH 068/183] Use new event name --- extensions/sticky/src/Listener/AddClientAssets.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/sticky/src/Listener/AddClientAssets.php b/extensions/sticky/src/Listener/AddClientAssets.php index b10399a9a..7548215e5 100755 --- a/extensions/sticky/src/Listener/AddClientAssets.php +++ b/extensions/sticky/src/Listener/AddClientAssets.php @@ -10,7 +10,7 @@ namespace Flarum\Sticky\Listener; -use Flarum\Event\ConfigureClientView; +use Flarum\Event\ConfigureWebApp; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets @@ -20,13 +20,13 @@ class AddClientAssets */ public function subscribe(Dispatcher $events) { - $events->listen(ConfigureClientView::class, [$this, 'addAssets']); + $events->listen(ConfigureWebApp::class, [$this, 'addAssets']); } /** * @param ConfigureClientView $event */ - public function addAssets(ConfigureClientView $event) + public function addAssets(ConfigureWebApp $event) { if ($event->isForum()) { $event->addAssets([ From 6cb446837de1de5174e95f3672a407cc9e7ae770 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 19 Oct 2016 21:13:40 +1030 Subject: [PATCH 069/183] v0.1.0-beta.6 --- extensions/sticky/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 18897e4ef..56ec2ca53 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -15,7 +15,7 @@ "source": "https://github.com/flarum/flarum-ext-sticky" }, "require": { - "flarum/core": "^0.1.0-beta.5" + "flarum/core": "^0.1.0-beta.6" }, "autoload": { "psr-4": { From 0802a9f139d7b5d19dbff450cbdeabf846fd961b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 16 Nov 2016 15:46:23 +1030 Subject: [PATCH 070/183] Update StyleCI rules --- extensions/sticky/.styleci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/extensions/sticky/.styleci.yml b/extensions/sticky/.styleci.yml index 00617d9b0..8806a5402 100644 --- a/extensions/sticky/.styleci.yml +++ b/extensions/sticky/.styleci.yml @@ -5,6 +5,7 @@ enabled: disabled: - align_double_arrow + - blank_line_after_opening_tag - multiline_array_trailing_comma - new_with_braces - phpdoc_align From 0653d74f0d5811d2f56af0c9c683936039efa7e6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 19 Nov 2016 22:09:38 +1030 Subject: [PATCH 071/183] Recompile JS --- extensions/sticky/js/forum/dist/extension.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index 971b22472..d68918337 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -133,7 +133,7 @@ System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/comp function DiscussionStickiedPost() { babelHelpers.classCallCheck(this, DiscussionStickiedPost); - return babelHelpers.possibleConstructorReturn(this, Object.getPrototypeOf(DiscussionStickiedPost).apply(this, arguments)); + return babelHelpers.possibleConstructorReturn(this, (DiscussionStickiedPost.__proto__ || Object.getPrototypeOf(DiscussionStickiedPost)).apply(this, arguments)); } babelHelpers.createClass(DiscussionStickiedPost, [{ From 7564533d1d813073c81057cd35df039b3e23bfc8 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Tue, 29 Nov 2016 05:29:44 +0000 Subject: [PATCH 072/183] Apply fixes from StyleCI [ci skip] [skip ci] --- .../migrations/2015_02_24_000000_add_sticky_to_discussions.php | 1 + extensions/sticky/src/Listener/AddClientAssets.php | 1 + 2 files changed, 2 insertions(+) diff --git a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php index 655a01c98..b728d540c 100644 --- a/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php +++ b/extensions/sticky/migrations/2015_02_24_000000_add_sticky_to_discussions.php @@ -1,4 +1,5 @@ Date: Sun, 1 Jan 2017 22:46:59 +0100 Subject: [PATCH 073/183] Update year --- extensions/sticky/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/LICENSE b/extensions/sticky/LICENSE index a502a8545..1e346ea06 100644 --- a/extensions/sticky/LICENSE +++ b/extensions/sticky/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2016 Toby Zerner +Copyright (c) 2014-2017 Toby Zerner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From b7f2469523eca4b26bc0511b06ca38781b0ee3ec Mon Sep 17 00:00:00 2001 From: VSN Reddy Janga Date: Mon, 20 Feb 2017 19:28:13 +0530 Subject: [PATCH 074/183] Hide diff for compiled diff files --- extensions/sticky/.gitattributes | 2 ++ 1 file changed, 2 insertions(+) diff --git a/extensions/sticky/.gitattributes b/extensions/sticky/.gitattributes index 4afe79241..053481a3e 100644 --- a/extensions/sticky/.gitattributes +++ b/extensions/sticky/.gitattributes @@ -1,3 +1,5 @@ .gitattributes export-ignore .gitignore export-ignore .travis.yml export-ignore + +js/*/dist/*.js -diff From 9fb03d3549e50bf47a5773df689fa1d8efb649aa Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 22 Jul 2017 12:09:36 +0930 Subject: [PATCH 075/183] Add default permissions --- ...017_07_22_000000_add_default_permissions.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php diff --git a/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php b/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php new file mode 100644 index 000000000..870b06da5 --- /dev/null +++ b/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php @@ -0,0 +1,17 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +use Flarum\Core\Group; +use Flarum\Database\Migration; + +return Migration::addPermissions([ + 'discussion.sticky' => Group::MODERATOR_ID +]); From 5a9711fac9e40e1d35bb2e5a297dd241398dcb5c Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 22 Jul 2017 12:17:30 +0930 Subject: [PATCH 076/183] Require b7 for new migration helper --- extensions/sticky/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 56ec2ca53..5498909cb 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -15,7 +15,7 @@ "source": "https://github.com/flarum/flarum-ext-sticky" }, "require": { - "flarum/core": "^0.1.0-beta.6" + "flarum/core": "^0.1.0-beta.7" }, "autoload": { "psr-4": { From 86cc5fe9c873a1578f95ed427130312a35b241fc Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Fri, 29 Sep 2017 12:35:59 +0930 Subject: [PATCH 077/183] Remove unused imports --- extensions/sticky/js/forum/dist/extension.js | 9 +++------ extensions/sticky/js/forum/src/main.js | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index d68918337..0c6695427 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -156,15 +156,12 @@ System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/comp });; 'use strict'; -System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export, _context) { +System.register('flarum/sticky/main', ['flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export, _context) { "use strict"; - var extend, notificationType, app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; + var app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; return { - setters: [function (_flarumExtend) { - extend = _flarumExtend.extend; - notificationType = _flarumExtend.notificationType; - }, function (_flarumApp) { + setters: [function (_flarumApp) { app = _flarumApp.default; }, function (_flarumModel) { Model = _flarumModel.default; diff --git a/extensions/sticky/js/forum/src/main.js b/extensions/sticky/js/forum/src/main.js index 1cfe374e2..838e705f3 100644 --- a/extensions/sticky/js/forum/src/main.js +++ b/extensions/sticky/js/forum/src/main.js @@ -1,4 +1,3 @@ -import { extend, notificationType } from 'flarum/extend'; import app from 'flarum/app'; import Model from 'flarum/Model'; import Discussion from 'flarum/models/Discussion'; @@ -17,4 +16,4 @@ app.initializers.add('flarum-sticky', () => { addStickyBadge(); addStickyControl(); addStickyExcerpt(); -}); \ No newline at end of file +}); From a8c43097d7fb7a46b33db751011221d420dcb523 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sun, 1 Oct 2017 19:55:07 +0200 Subject: [PATCH 078/183] Update namespaces for beta 8 Refs flarum/core#1235. --- ...2017_07_22_000000_add_default_permissions.php | 2 +- .../sticky/src/Event/DiscussionWasStickied.php | 4 ++-- .../sticky/src/Event/DiscussionWasUnstickied.php | 4 ++-- .../sticky/src/Listener/AddApiAttributes.php | 16 ++++++++-------- .../sticky/src/Listener/AddClientAssets.php | 8 ++++---- .../CreatePostWhenDiscussionIsStickied.php | 4 ++-- .../src/Listener/PinStickiedDiscussionsToTop.php | 8 ++++---- .../sticky/src/Listener/SaveStickyToDatabase.php | 10 +++++----- .../sticky/src/Post/DiscussionStickiedPost.php | 6 +++--- 9 files changed, 31 insertions(+), 31 deletions(-) diff --git a/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php b/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php index 870b06da5..98ffb1ecd 100644 --- a/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php +++ b/extensions/sticky/migrations/2017_07_22_000000_add_default_permissions.php @@ -9,8 +9,8 @@ * file that was distributed with this source code. */ -use Flarum\Core\Group; use Flarum\Database\Migration; +use Flarum\Group\Group; return Migration::addPermissions([ 'discussion.sticky' => Group::MODERATOR_ID diff --git a/extensions/sticky/src/Event/DiscussionWasStickied.php b/extensions/sticky/src/Event/DiscussionWasStickied.php index 0eeb7cca2..e7b178685 100644 --- a/extensions/sticky/src/Event/DiscussionWasStickied.php +++ b/extensions/sticky/src/Event/DiscussionWasStickied.php @@ -11,8 +11,8 @@ namespace Flarum\Sticky\Event; -use Flarum\Core\Discussion; -use Flarum\Core\User; +use Flarum\Discussion\Discussion; +use Flarum\User\User; class DiscussionWasStickied { diff --git a/extensions/sticky/src/Event/DiscussionWasUnstickied.php b/extensions/sticky/src/Event/DiscussionWasUnstickied.php index eab4d2fcd..80be3b324 100644 --- a/extensions/sticky/src/Event/DiscussionWasUnstickied.php +++ b/extensions/sticky/src/Event/DiscussionWasUnstickied.php @@ -11,8 +11,8 @@ namespace Flarum\Sticky\Event; -use Flarum\Core\Discussion; -use Flarum\Core\User; +use Flarum\Discussion\Discussion; +use Flarum\User\User; class DiscussionWasUnstickied { diff --git a/extensions/sticky/src/Listener/AddApiAttributes.php b/extensions/sticky/src/Listener/AddApiAttributes.php index ba559f655..76c1b26b0 100755 --- a/extensions/sticky/src/Listener/AddApiAttributes.php +++ b/extensions/sticky/src/Listener/AddApiAttributes.php @@ -12,9 +12,9 @@ namespace Flarum\Sticky\Listener; use Flarum\Api\Controller\ListDiscussionsController; +use Flarum\Api\Event\Serializing; +use Flarum\Api\Event\WillGetData; use Flarum\Api\Serializer\DiscussionSerializer; -use Flarum\Event\ConfigureApiController; -use Flarum\Event\PrepareApiAttributes; use Illuminate\Contracts\Events\Dispatcher; class AddApiAttributes @@ -24,14 +24,14 @@ class AddApiAttributes */ public function subscribe(Dispatcher $events) { - $events->listen(PrepareApiAttributes::class, [$this, 'prepareApiAttributes']); - $events->listen(ConfigureApiController::class, [$this, 'includeStartPost']); + $events->listen(Serializing::class, [$this, 'prepareApiAttributes']); + $events->listen(WillGetData::class, [$this, 'includeStartPost']); } /** - * @param PrepareApiAttributes $event + * @param Serializing $event */ - public function prepareApiAttributes(PrepareApiAttributes $event) + public function prepareApiAttributes(Serializing $event) { if ($event->isSerializer(DiscussionSerializer::class)) { $event->attributes['isSticky'] = (bool) $event->model->is_sticky; @@ -40,9 +40,9 @@ class AddApiAttributes } /** - * @param ConfigureApiController $event + * @param WillGetData $event */ - public function includeStartPost(ConfigureApiController $event) + public function includeStartPost(WillGetData $event) { if ($event->isController(ListDiscussionsController::class)) { $event->addInclude('startPost'); diff --git a/extensions/sticky/src/Listener/AddClientAssets.php b/extensions/sticky/src/Listener/AddClientAssets.php index 40a3d0812..2fd1f3981 100755 --- a/extensions/sticky/src/Listener/AddClientAssets.php +++ b/extensions/sticky/src/Listener/AddClientAssets.php @@ -11,7 +11,7 @@ namespace Flarum\Sticky\Listener; -use Flarum\Event\ConfigureWebApp; +use Flarum\Frontend\Event\Rendering; use Illuminate\Contracts\Events\Dispatcher; class AddClientAssets @@ -21,13 +21,13 @@ class AddClientAssets */ public function subscribe(Dispatcher $events) { - $events->listen(ConfigureWebApp::class, [$this, 'addAssets']); + $events->listen(Rendering::class, [$this, 'addAssets']); } /** - * @param ConfigureClientView $event + * @param Rendering $event */ - public function addAssets(ConfigureWebApp $event) + public function addAssets(Rendering $event) { if ($event->isForum()) { $event->addAssets([ diff --git a/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php b/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php index 91485d45c..ae2c06548 100755 --- a/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php +++ b/extensions/sticky/src/Listener/CreatePostWhenDiscussionIsStickied.php @@ -11,12 +11,12 @@ namespace Flarum\Sticky\Listener; -use Flarum\Core\Discussion; -use Flarum\Core\User; +use Flarum\Discussion\Discussion; use Flarum\Event\ConfigurePostTypes; use Flarum\Sticky\Event\DiscussionWasStickied; use Flarum\Sticky\Event\DiscussionWasUnstickied; use Flarum\Sticky\Post\DiscussionStickiedPost; +use Flarum\User\User; use Illuminate\Contracts\Events\Dispatcher; class CreatePostWhenDiscussionIsStickied diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 74352c79e..e7b4da985 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -11,8 +11,8 @@ namespace Flarum\Sticky\Listener; +use Flarum\Discussion\Event\Searching; use Flarum\Event\ConfigureDiscussionGambits; -use Flarum\Event\ConfigureDiscussionSearch; use Flarum\Sticky\Gambit\StickyGambit; use Flarum\Tags\Gambit\TagGambit; use Illuminate\Contracts\Events\Dispatcher; @@ -25,7 +25,7 @@ class PinStickiedDiscussionsToTop public function subscribe(Dispatcher $events) { $events->listen(ConfigureDiscussionGambits::class, [$this, 'addStickyGambit']); - $events->listen(ConfigureDiscussionSearch::class, [$this, 'reorderSearch']); + $events->listen(Searching::class, [$this, 'reorderSearch']); } /** @@ -37,9 +37,9 @@ class PinStickiedDiscussionsToTop } /** - * @param ConfigureDiscussionSearch $event + * @param Searching $event */ - public function reorderSearch(ConfigureDiscussionSearch $event) + public function reorderSearch(Searching $event) { if ($event->criteria->sort === null) { $search = $event->search; diff --git a/extensions/sticky/src/Listener/SaveStickyToDatabase.php b/extensions/sticky/src/Listener/SaveStickyToDatabase.php index 836a00a0c..19b37673c 100755 --- a/extensions/sticky/src/Listener/SaveStickyToDatabase.php +++ b/extensions/sticky/src/Listener/SaveStickyToDatabase.php @@ -11,10 +11,10 @@ namespace Flarum\Sticky\Listener; -use Flarum\Core\Access\AssertPermissionTrait; -use Flarum\Event\DiscussionWillBeSaved; +use Flarum\Discussion\Event\Saving; use Flarum\Sticky\Event\DiscussionWasStickied; use Flarum\Sticky\Event\DiscussionWasUnstickied; +use Flarum\User\AssertPermissionTrait; use Illuminate\Contracts\Events\Dispatcher; class SaveStickyToDatabase @@ -26,13 +26,13 @@ class SaveStickyToDatabase */ public function subscribe(Dispatcher $events) { - $events->listen(DiscussionWillBeSaved::class, [$this, 'whenDiscussionWillBeSaved']); + $events->listen(Saving::class, [$this, 'whenSaving']); } /** - * @param DiscussionWillBeSaved $event + * @param Saving $event */ - public function whenDiscussionWillBeSaved(DiscussionWillBeSaved $event) + public function whenSaving(Saving $event) { if (isset($event->data['attributes']['isSticky'])) { $isSticky = (bool) $event->data['attributes']['isSticky']; diff --git a/extensions/sticky/src/Post/DiscussionStickiedPost.php b/extensions/sticky/src/Post/DiscussionStickiedPost.php index 0ad5cabb5..22be30851 100755 --- a/extensions/sticky/src/Post/DiscussionStickiedPost.php +++ b/extensions/sticky/src/Post/DiscussionStickiedPost.php @@ -11,9 +11,9 @@ namespace Flarum\Sticky\Post; -use Flarum\Core\Post; -use Flarum\Core\Post\AbstractEventPost; -use Flarum\Core\Post\MergeableInterface; +use Flarum\Post\Post; +use Flarum\Post\Post\AbstractEventPost; +use Flarum\Post\Post\MergeableInterface; class DiscussionStickiedPost extends AbstractEventPost implements MergeableInterface { From b28f116b064eefaa638f9ec69b0ebdee778262b0 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 3 Oct 2017 19:45:54 +0200 Subject: [PATCH 079/183] Fix class names --- extensions/sticky/src/Gambit/StickyGambit.php | 4 ++-- extensions/sticky/src/Post/DiscussionStickiedPost.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/sticky/src/Gambit/StickyGambit.php b/extensions/sticky/src/Gambit/StickyGambit.php index dde1417b4..fd81c687f 100644 --- a/extensions/sticky/src/Gambit/StickyGambit.php +++ b/extensions/sticky/src/Gambit/StickyGambit.php @@ -11,8 +11,8 @@ namespace Flarum\Sticky\Gambit; -use Flarum\Core\Search\AbstractRegexGambit; -use Flarum\Core\Search\AbstractSearch; +use Flarum\Search\AbstractRegexGambit; +use Flarum\Search\AbstractSearch; class StickyGambit extends AbstractRegexGambit { diff --git a/extensions/sticky/src/Post/DiscussionStickiedPost.php b/extensions/sticky/src/Post/DiscussionStickiedPost.php index 22be30851..db937fd89 100755 --- a/extensions/sticky/src/Post/DiscussionStickiedPost.php +++ b/extensions/sticky/src/Post/DiscussionStickiedPost.php @@ -11,9 +11,9 @@ namespace Flarum\Sticky\Post; +use Flarum\Post\AbstractEventPost; +use Flarum\Post\MergeableInterface; use Flarum\Post\Post; -use Flarum\Post\Post\AbstractEventPost; -use Flarum\Post\Post\MergeableInterface; class DiscussionStickiedPost extends AbstractEventPost implements MergeableInterface { From 7ff57e1ba448636dc08b5dcd18ce39c68f941f48 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 8 Nov 2017 11:34:37 +1030 Subject: [PATCH 080/183] Refactor sticky order clause into a subquery Based on some limited testing, using a subquery seems to outperform a join in this case (the join was invoking a temporary table, which is always a bad sign). This also adds logic to fix a bug where sticky discussions would remain at the top even when marked as read using the "mark all as read" button. I thought we had an open issue for this somewhere, but I can't seem to find one. ref #988 #1003 --- .../Listener/PinStickiedDiscussionsToTop.php | 36 +++++++++++++------ 1 file changed, 25 insertions(+), 11 deletions(-) diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 74352c79e..4c284c36b 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -45,10 +45,17 @@ class PinStickiedDiscussionsToTop $search = $event->search; $query = $search->getQuery(); + // TODO: ideally we might like to consider an event in core that is + // fired before the sort criteria is applied to the query (ie. + // immediately after gambits are applied) so that we can add the + // following order logic to the start without using array_unshift. + if (! is_array($query->orders)) { $query->orders = []; } + // If we are viewing a specific tag, then pin all stickied + // discussions to the top no matter what. foreach ($search->getActiveGambits() as $gambit) { if ($gambit instanceof TagGambit) { array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); @@ -57,21 +64,28 @@ class PinStickiedDiscussionsToTop } } - $query->leftJoin('users_discussions', function ($join) use ($search) { - $join->on('users_discussions.discussion_id', '=', 'discussions.id') - ->where('discussions.is_sticky', '=', true) - ->where('users_discussions.user_id', '=', $search->getActor()->id); - }); - - // TODO: Might be quicker to do a subquery in the order clause than a join? - $grammar = $query->getGrammar(); - $readNumber = $grammar->wrap('users_discussions.read_number'); - $lastPostNumber = $grammar->wrap('discussions.last_post_number'); + // Otherwise, if we are viewing "all discussions" or similar, only + // pin stickied discussions to the top if they are unread. To do + // this we construct an order clause containing a subquery which + // determines whether or not the discussion is unread. + $subquery = $query->newQuery() + ->selectRaw(1) + ->from('users_discussions as sticky') + ->whereRaw('sticky.discussion_id = discussions.id') + ->where('sticky.user_id', '=', $search->getActor()->id) + ->where(function ($query) { + $query->whereNull('sticky.read_number') + ->orWhereRaw('discussions.last_post_number > sticky.read_number'); + }) + ->where('discussions.last_time', '>', $search->getActor()->read_time ?: 0); array_unshift($query->orders, [ 'type' => 'raw', - 'sql' => "(is_sticky AND ($readNumber IS NULL OR $lastPostNumber > $readNumber)) desc" + 'sql' => "(is_sticky and exists ({$subquery->toSql()})) desc" ]); + + $orderBindings = $query->getRawBindings()['order']; + $query->setBindings(array_merge($subquery->getBindings(), $orderBindings), 'order'); } } } From 0ce00c6d169159c5ba65f1fec8b4ebb6217b2bba Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 12 Nov 2017 21:28:17 +1030 Subject: [PATCH 081/183] Performance: Refactor SQL that pins unread sticky posts to the top Ordering by `is_sticky and (unread subquery) desc` removes MySQL's ability to use an index for ordering by `last_time`, which triggers a filesort across the whole discussions table which is BAD. This commit uses a union to add all stickied discussions to the query. The results of the unioned queries are then ordered by the `is_sticky and (unread subquery)` criteria, so the filesort only takes place on a maximum of limit * 2 rows. Big performance win when you get up to thousands of discussions! --- .../Listener/PinStickiedDiscussionsToTop.php | 58 ++++++++++--------- 1 file changed, 31 insertions(+), 27 deletions(-) diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 4c284c36b..1f0f54e8d 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -25,7 +25,7 @@ class PinStickiedDiscussionsToTop public function subscribe(Dispatcher $events) { $events->listen(ConfigureDiscussionGambits::class, [$this, 'addStickyGambit']); - $events->listen(ConfigureDiscussionSearch::class, [$this, 'reorderSearch']); + $events->listen(ConfigureDiscussionSearch::class, [$this, 'reorderSearch'], -100); } /** @@ -45,18 +45,15 @@ class PinStickiedDiscussionsToTop $search = $event->search; $query = $search->getQuery(); - // TODO: ideally we might like to consider an event in core that is - // fired before the sort criteria is applied to the query (ie. - // immediately after gambits are applied) so that we can add the - // following order logic to the start without using array_unshift. - if (! is_array($query->orders)) { $query->orders = []; } // If we are viewing a specific tag, then pin all stickied // discussions to the top no matter what. - foreach ($search->getActiveGambits() as $gambit) { + $gambits = $search->getActiveGambits(); + + foreach ($gambits as $gambit) { if ($gambit instanceof TagGambit) { array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); @@ -64,28 +61,35 @@ class PinStickiedDiscussionsToTop } } - // Otherwise, if we are viewing "all discussions" or similar, only - // pin stickied discussions to the top if they are unread. To do - // this we construct an order clause containing a subquery which - // determines whether or not the discussion is unread. - $subquery = $query->newQuery() - ->selectRaw(1) - ->from('users_discussions as sticky') - ->whereRaw('sticky.discussion_id = discussions.id') - ->where('sticky.user_id', '=', $search->getActor()->id) - ->where(function ($query) { - $query->whereNull('sticky.read_number') - ->orWhereRaw('discussions.last_post_number > sticky.read_number'); - }) - ->where('discussions.last_time', '>', $search->getActor()->read_time ?: 0); + // Otherwise, if we are viewing "all discussions", only pin stickied + // discussions to the top if they are unread. To do this in a + // performant way we create another query which will select all + // stickied discussions, marry them into the main query, and then + // reorder the unread ones up to the top. + if (empty($gambits)) { + $sticky = clone $query; + $sticky->where('is_sticky', true); + $sticky->limit = $sticky->offset = $sticky->orders = null; - array_unshift($query->orders, [ - 'type' => 'raw', - 'sql' => "(is_sticky and exists ({$subquery->toSql()})) desc" - ]); + $query->union($sticky); - $orderBindings = $query->getRawBindings()['order']; - $query->setBindings(array_merge($subquery->getBindings(), $orderBindings), 'order'); + $read = $query->newQuery() + ->selectRaw(1) + ->from('users_discussions as sticky') + ->whereRaw('sticky.discussion_id = id') + ->where('sticky.user_id', '=', $search->getActor()->id) + ->whereRaw('sticky.read_number >= last_post_number'); + + // Add the bindings manually (rather than as the second + // argument in orderByRaw) for now due to a bug in Laravel which + // would add the bindings in the wrong order. + $query->orderByRaw('is_sticky and not exists ('.$read->toSql().') and last_time > ? desc') + ->addBinding(array_merge($read->getBindings(), [$search->getActor()->read_time ?: 0]), 'union'); + + $query->unionOrders = array_merge($query->unionOrders, $query->orders); + $query->unionLimit = $query->limit; + $query->unionOffset = $query->offset; + } } } } From c7d7b2d36003b3c694806af67f9a8bf84e6b2ced Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 13 Nov 2017 09:17:55 +1030 Subject: [PATCH 082/183] Fix subsequent pages of results not working properly --- .../sticky/src/Listener/PinStickiedDiscussionsToTop.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 1f0f54e8d..78fc69610 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -69,7 +69,7 @@ class PinStickiedDiscussionsToTop if (empty($gambits)) { $sticky = clone $query; $sticky->where('is_sticky', true); - $sticky->limit = $sticky->offset = $sticky->orders = null; + $sticky->orders = null; $query->union($sticky); @@ -89,6 +89,9 @@ class PinStickiedDiscussionsToTop $query->unionOrders = array_merge($query->unionOrders, $query->orders); $query->unionLimit = $query->limit; $query->unionOffset = $query->offset; + + $query->limit = $sticky->limit = $query->offset + $query->limit; + $query->offset = $sticky->offset = null; } } } From 20f6a256d5ad8c434bb1bbd17c5fa19f072d5708 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Mon, 13 Nov 2017 13:18:36 +1030 Subject: [PATCH 083/183] Only touch orders property if we're going to add to it --- .../sticky/src/Listener/PinStickiedDiscussionsToTop.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 78fc69610..af454efdf 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -45,16 +45,16 @@ class PinStickiedDiscussionsToTop $search = $event->search; $query = $search->getQuery(); - if (! is_array($query->orders)) { - $query->orders = []; - } - // If we are viewing a specific tag, then pin all stickied // discussions to the top no matter what. $gambits = $search->getActiveGambits(); foreach ($gambits as $gambit) { if ($gambit instanceof TagGambit) { + if (! is_array($query->orders)) { + $query->orders = []; + } + array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); return; From b58f97fd5e573ce7ed09b944ac5bfb0a5ae6d671 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 11 Jan 2018 12:26:49 +1030 Subject: [PATCH 084/183] Require beta 8 --- extensions/sticky/composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 5498909cb..0bdb3b166 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -15,7 +15,7 @@ "source": "https://github.com/flarum/flarum-ext-sticky" }, "require": { - "flarum/core": "^0.1.0-beta.7" + "flarum/core": "^0.1.0-beta.8" }, "autoload": { "psr-4": { From 8bfaff339e25ce26895b77105e1f4dee88e652df Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 11 Jan 2018 12:28:35 +1030 Subject: [PATCH 085/183] Only pin to top if viewing a tag with no other filters --- .../Listener/PinStickiedDiscussionsToTop.php | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 79c50d2b8..898cbdc84 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -49,16 +49,16 @@ class PinStickiedDiscussionsToTop // discussions to the top no matter what. $gambits = $search->getActiveGambits(); - foreach ($gambits as $gambit) { - if ($gambit instanceof TagGambit) { + if ($count = count($gambits)) { + if ($count === 1 && $gambits[0] instanceof TagGambit) { if (! is_array($query->orders)) { $query->orders = []; } array_unshift($query->orders, ['column' => 'is_sticky', 'direction' => 'desc']); - - return; } + + return; } // Otherwise, if we are viewing "all discussions", only pin stickied @@ -66,33 +66,31 @@ class PinStickiedDiscussionsToTop // performant way we create another query which will select all // stickied discussions, marry them into the main query, and then // reorder the unread ones up to the top. - if (empty($gambits)) { - $sticky = clone $query; - $sticky->where('is_sticky', true); - $sticky->orders = null; + $sticky = clone $query; + $sticky->where('is_sticky', true); + $sticky->orders = null; - $query->union($sticky); + $query->union($sticky); - $read = $query->newQuery() - ->selectRaw(1) - ->from('users_discussions as sticky') - ->whereRaw('sticky.discussion_id = id') - ->where('sticky.user_id', '=', $search->getActor()->id) - ->whereRaw('sticky.read_number >= last_post_number'); + $read = $query->newQuery() + ->selectRaw(1) + ->from('users_discussions as sticky') + ->whereRaw('sticky.discussion_id = id') + ->where('sticky.user_id', '=', $search->getActor()->id) + ->whereRaw('sticky.read_number >= last_post_number'); - // Add the bindings manually (rather than as the second - // argument in orderByRaw) for now due to a bug in Laravel which - // would add the bindings in the wrong order. - $query->orderByRaw('is_sticky and not exists ('.$read->toSql().') and last_time > ? desc') - ->addBinding(array_merge($read->getBindings(), [$search->getActor()->read_time ?: 0]), 'union'); + // Add the bindings manually (rather than as the second + // argument in orderByRaw) for now due to a bug in Laravel which + // would add the bindings in the wrong order. + $query->orderByRaw('is_sticky and not exists ('.$read->toSql().') and last_time > ? desc') + ->addBinding(array_merge($read->getBindings(), [$search->getActor()->read_time ?: 0]), 'union'); - $query->unionOrders = array_merge($query->unionOrders, $query->orders); - $query->unionLimit = $query->limit; - $query->unionOffset = $query->offset; + $query->unionOrders = array_merge($query->unionOrders, $query->orders); + $query->unionLimit = $query->limit; + $query->unionOffset = $query->offset; - $query->limit = $sticky->limit = $query->offset + $query->limit; - $query->offset = $sticky->offset = null; - } + $query->limit = $sticky->limit = $query->offset + $query->limit; + $query->offset = $sticky->offset = null; } } } From cf0ae806913c4010deca500cdef33ebf505abc5b Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Thu, 11 Jan 2018 14:22:43 +1030 Subject: [PATCH 086/183] Remove use of event priorities Event priorities are no longer in Laravel - see https://github.com/laravel/framework/commit/dbbfc62beff1625b0d45bbf39650d047555cf4fa --- extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php index 898cbdc84..62b00cbfd 100755 --- a/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php +++ b/extensions/sticky/src/Listener/PinStickiedDiscussionsToTop.php @@ -25,7 +25,7 @@ class PinStickiedDiscussionsToTop public function subscribe(Dispatcher $events) { $events->listen(ConfigureDiscussionGambits::class, [$this, 'addStickyGambit']); - $events->listen(Searching::class, [$this, 'reorderSearch'], -100); + $events->listen(Searching::class, [$this, 'reorderSearch']); } /** From b5460b6b597eec0707cb216a2f0757805ebf0b25 Mon Sep 17 00:00:00 2001 From: Miles Cellar Date: Mon, 15 Jan 2018 19:38:45 +0100 Subject: [PATCH 087/183] Update license year range to 2018 --- extensions/sticky/LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/LICENSE b/extensions/sticky/LICENSE index 1e346ea06..e6288c67a 100644 --- a/extensions/sticky/LICENSE +++ b/extensions/sticky/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2014-2017 Toby Zerner +Copyright (c) 2014-2018 Toby Zerner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From a4c42dcfff6fc8b083003950fa9ad73b61a0a414 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Tue, 16 Jan 2018 23:19:29 +0100 Subject: [PATCH 088/183] Adapt new bootstrap format, use Asset extender --- extensions/sticky/bootstrap.php | 22 ++++++--- .../sticky/src/Listener/AddClientAssets.php | 47 ------------------- 2 files changed, 15 insertions(+), 54 deletions(-) delete mode 100755 extensions/sticky/src/Listener/AddClientAssets.php diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index 19076c02e..e800e6908 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -9,13 +9,21 @@ * file that was distributed with this source code. */ +use Flarum\Extend; use Flarum\Sticky\Listener; use Illuminate\Contracts\Events\Dispatcher; -return function (Dispatcher $events) { - $events->subscribe(Listener\AddApiAttributes::class); - $events->subscribe(Listener\AddClientAssets::class); - $events->subscribe(Listener\CreatePostWhenDiscussionIsStickied::class); - $events->subscribe(Listener\PinStickiedDiscussionsToTop::class); - $events->subscribe(Listener\SaveStickyToDatabase::class); -}; +return [ + (new Extend\Assets('forum')) + ->defaultAssets(__DIR__) + ->bootstrapper('flarum/sticky/main'), + (new Extend\Assets('admin')) + ->asset(__DIR__.'/js/admin/dist/extension.js') + ->bootstrapper('flarum/sticky/main'), + function (Dispatcher $events) { + $events->subscribe(Listener\AddApiAttributes::class); + $events->subscribe(Listener\CreatePostWhenDiscussionIsStickied::class); + $events->subscribe(Listener\PinStickiedDiscussionsToTop::class); + $events->subscribe(Listener\SaveStickyToDatabase::class); + }, +]; diff --git a/extensions/sticky/src/Listener/AddClientAssets.php b/extensions/sticky/src/Listener/AddClientAssets.php deleted file mode 100755 index 2fd1f3981..000000000 --- a/extensions/sticky/src/Listener/AddClientAssets.php +++ /dev/null @@ -1,47 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Flarum\Sticky\Listener; - -use Flarum\Frontend\Event\Rendering; -use Illuminate\Contracts\Events\Dispatcher; - -class AddClientAssets -{ - /** - * @param Dispatcher $events - */ - public function subscribe(Dispatcher $events) - { - $events->listen(Rendering::class, [$this, 'addAssets']); - } - - /** - * @param Rendering $event - */ - public function addAssets(Rendering $event) - { - if ($event->isForum()) { - $event->addAssets([ - __DIR__.'/../../js/forum/dist/extension.js', - __DIR__.'/../../less/forum/extension.less' - ]); - $event->addBootstrapper('flarum/sticky/main'); - } - - if ($event->isAdmin()) { - $event->addAssets([ - __DIR__.'/../../js/admin/dist/extension.js' - ]); - $event->addBootstrapper('flarum/sticky/main'); - } - } -} From 4c8bea217bd23d160fbd263b8eaffc7bf6a1fdf9 Mon Sep 17 00:00:00 2001 From: Franz Liedke Date: Sun, 21 Jan 2018 21:10:26 +0100 Subject: [PATCH 089/183] Extender: List all assets explicitly --- extensions/sticky/bootstrap.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index e800e6908..4ee76c8e7 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -15,7 +15,8 @@ use Illuminate\Contracts\Events\Dispatcher; return [ (new Extend\Assets('forum')) - ->defaultAssets(__DIR__) + ->asset(__DIR__.'/js/forum/dist/extension.js') + ->asset(__DIR__.'/less/forum/extension.less') ->bootstrapper('flarum/sticky/main'), (new Extend\Assets('admin')) ->asset(__DIR__.'/js/admin/dist/extension.js') From 61387947126833afa646afb045dcd2c683cd8d29 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 4 Feb 2018 12:53:52 +1030 Subject: [PATCH 090/183] Excerpt added to core --- .../sticky/js/forum/src/addStickyExcerpt.js | 4 ++-- extensions/sticky/less/forum/extension.less | 16 ---------------- 2 files changed, 2 insertions(+), 18 deletions(-) diff --git a/extensions/sticky/js/forum/src/addStickyExcerpt.js b/extensions/sticky/js/forum/src/addStickyExcerpt.js index a08591f25..a830914fb 100644 --- a/extensions/sticky/js/forum/src/addStickyExcerpt.js +++ b/extensions/sticky/js/forum/src/addStickyExcerpt.js @@ -11,11 +11,11 @@ export default function addStickyControl() { extend(DiscussionListItem.prototype, 'infoItems', function(items) { const discussion = this.props.discussion; - if (discussion.isSticky()) { + if (discussion.isSticky() && !this.props.params.q) { const startPost = discussion.startPost(); if (startPost) { - const excerpt = {truncate(startPost.contentPlain(), 200)}; + const excerpt = truncate(startPost.contentPlain(), 175); items.add('excerpt', excerpt, -100); } diff --git a/extensions/sticky/less/forum/extension.less b/extensions/sticky/less/forum/extension.less index 046da8ed5..a3651f953 100644 --- a/extensions/sticky/less/forum/extension.less +++ b/extensions/sticky/less/forum/extension.less @@ -8,19 +8,3 @@ color: #d13e32; } } -.DiscussionListItem-info .item-excerpt { - margin-top: 8px; - margin-right: 20px; - white-space: normal; - font-size: 12px; - line-height: 1.5em; - color: @muted-more-color; - display: block; - - .DiscussionPage-list & { - display: none; - } - @media @phone { - display: none; - } -} From 8b5f1839b6aa3e82dfcc105d728e8d77d12cc5eb Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sun, 4 Feb 2018 12:54:41 +1030 Subject: [PATCH 091/183] Recompile JS --- extensions/sticky/js/forum/dist/extension.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js index 0c6695427..1fa115e62 100644 --- a/extensions/sticky/js/forum/dist/extension.js +++ b/extensions/sticky/js/forum/dist/extension.js @@ -86,15 +86,11 @@ System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/comp extend(DiscussionListItem.prototype, 'infoItems', function (items) { var discussion = this.props.discussion; - if (discussion.isSticky()) { + if (discussion.isSticky() && !this.props.params.q) { var startPost = discussion.startPost(); if (startPost) { - var excerpt = m( - 'span', - null, - truncate(startPost.contentPlain(), 200) - ); + var excerpt = truncate(startPost.contentPlain(), 175); items.add('excerpt', excerpt, -100); } From d3baf624d110b86e07da538ca0f78948d978f5d5 Mon Sep 17 00:00:00 2001 From: AFR Date: Sat, 24 Feb 2018 05:47:51 +0700 Subject: [PATCH 092/183] Adapt to FontAwesome v5.0.6 icon name changes (#8) --- extensions/sticky/composer.json | 2 +- extensions/sticky/js/admin/src/main.js | 2 +- extensions/sticky/js/forum/src/addStickyBadge.js | 2 +- extensions/sticky/js/forum/src/addStickyControl.js | 2 +- .../sticky/js/forum/src/components/DiscussionStickiedPost.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 0bdb3b166..474e6140f 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -29,7 +29,7 @@ "flarum-extension": { "title": "Sticky", "icon": { - "name": "thumb-tack", + "name": "fa fa-thumbtack", "backgroundColor": "#D13E32", "color": "#fff" } diff --git a/extensions/sticky/js/admin/src/main.js b/extensions/sticky/js/admin/src/main.js index 08879f01f..ab0447aa1 100644 --- a/extensions/sticky/js/admin/src/main.js +++ b/extensions/sticky/js/admin/src/main.js @@ -5,7 +5,7 @@ import PermissionGrid from 'flarum/components/PermissionGrid'; app.initializers.add('flarum-sticky', () => { extend(PermissionGrid.prototype, 'moderateItems', items => { items.add('sticky', { - icon: 'thumb-tack', + icon: 'fa fa-thumbtack', label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'), permission: 'discussion.sticky' }, 95); diff --git a/extensions/sticky/js/forum/src/addStickyBadge.js b/extensions/sticky/js/forum/src/addStickyBadge.js index 8d0d7ca2d..950d578fc 100644 --- a/extensions/sticky/js/forum/src/addStickyBadge.js +++ b/extensions/sticky/js/forum/src/addStickyBadge.js @@ -8,7 +8,7 @@ export default function addStickyBadge() { badges.add('sticky', Badge.component({ type: 'sticky', label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'), - icon: 'thumb-tack' + icon: 'fa fa-thumbtack' }), 10); } }); diff --git a/extensions/sticky/js/forum/src/addStickyControl.js b/extensions/sticky/js/forum/src/addStickyControl.js index c08aff5e9..94624e99d 100644 --- a/extensions/sticky/js/forum/src/addStickyControl.js +++ b/extensions/sticky/js/forum/src/addStickyControl.js @@ -8,7 +8,7 @@ export default function addStickyControl() { if (discussion.canSticky()) { items.add('sticky', Button.component({ children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'), - icon: 'thumb-tack', + icon: 'fa fa-thumbtack', onclick: this.stickyAction.bind(discussion) })); } diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js index bd207c035..353b78280 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js @@ -2,7 +2,7 @@ import EventPost from 'flarum/components/EventPost'; export default class DiscussionStickiedPost extends EventPost { icon() { - return 'thumb-tack'; + return 'fa fa-thumbtack'; } descriptionKey() { From a3755e06f0bfa1e86ab319ae3c602165fb5557f6 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Sat, 24 Feb 2018 16:00:45 +1030 Subject: [PATCH 093/183] Only show sticky excerpt on unread discussions --- extensions/sticky/js/forum/src/addStickyExcerpt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/js/forum/src/addStickyExcerpt.js b/extensions/sticky/js/forum/src/addStickyExcerpt.js index a830914fb..1302a0618 100644 --- a/extensions/sticky/js/forum/src/addStickyExcerpt.js +++ b/extensions/sticky/js/forum/src/addStickyExcerpt.js @@ -11,7 +11,7 @@ export default function addStickyControl() { extend(DiscussionListItem.prototype, 'infoItems', function(items) { const discussion = this.props.discussion; - if (discussion.isSticky() && !this.props.params.q) { + if (discussion.isSticky() && !this.props.params.q && !discussion.readNumber()) { const startPost = discussion.startPost(); if (startPost) { From 28e4bfa4092fe59cdb1481d69ba941f47a04c525 Mon Sep 17 00:00:00 2001 From: Ammar Fadhlur Rahman Date: Thu, 10 May 2018 15:03:19 +0700 Subject: [PATCH 094/183] Change fa icon prefix to fas --- extensions/sticky/composer.json | 2 +- extensions/sticky/js/admin/src/main.js | 2 +- extensions/sticky/js/forum/src/addStickyBadge.js | 2 +- extensions/sticky/js/forum/src/addStickyControl.js | 2 +- .../sticky/js/forum/src/components/DiscussionStickiedPost.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/sticky/composer.json b/extensions/sticky/composer.json index 474e6140f..5f0e5b5cd 100644 --- a/extensions/sticky/composer.json +++ b/extensions/sticky/composer.json @@ -29,7 +29,7 @@ "flarum-extension": { "title": "Sticky", "icon": { - "name": "fa fa-thumbtack", + "name": "fas fa-thumbtack", "backgroundColor": "#D13E32", "color": "#fff" } diff --git a/extensions/sticky/js/admin/src/main.js b/extensions/sticky/js/admin/src/main.js index ab0447aa1..b7856cf83 100644 --- a/extensions/sticky/js/admin/src/main.js +++ b/extensions/sticky/js/admin/src/main.js @@ -5,7 +5,7 @@ import PermissionGrid from 'flarum/components/PermissionGrid'; app.initializers.add('flarum-sticky', () => { extend(PermissionGrid.prototype, 'moderateItems', items => { items.add('sticky', { - icon: 'fa fa-thumbtack', + icon: 'fas fa-thumbtack', label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'), permission: 'discussion.sticky' }, 95); diff --git a/extensions/sticky/js/forum/src/addStickyBadge.js b/extensions/sticky/js/forum/src/addStickyBadge.js index 950d578fc..723961585 100644 --- a/extensions/sticky/js/forum/src/addStickyBadge.js +++ b/extensions/sticky/js/forum/src/addStickyBadge.js @@ -8,7 +8,7 @@ export default function addStickyBadge() { badges.add('sticky', Badge.component({ type: 'sticky', label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'), - icon: 'fa fa-thumbtack' + icon: 'fas fa-thumbtack' }), 10); } }); diff --git a/extensions/sticky/js/forum/src/addStickyControl.js b/extensions/sticky/js/forum/src/addStickyControl.js index 94624e99d..6b8aa7d66 100644 --- a/extensions/sticky/js/forum/src/addStickyControl.js +++ b/extensions/sticky/js/forum/src/addStickyControl.js @@ -8,7 +8,7 @@ export default function addStickyControl() { if (discussion.canSticky()) { items.add('sticky', Button.component({ children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'), - icon: 'fa fa-thumbtack', + icon: 'fas fa-thumbtack', onclick: this.stickyAction.bind(discussion) })); } diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js index 353b78280..f3e3736fd 100644 --- a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js +++ b/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js @@ -2,7 +2,7 @@ import EventPost from 'flarum/components/EventPost'; export default class DiscussionStickiedPost extends EventPost { icon() { - return 'fa fa-thumbtack'; + return 'fas fa-thumbtack'; } descriptionKey() { From 70f2b63bf5a8d3191406558a77ebab9371e56fb3 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 20 Jun 2018 13:36:00 +0930 Subject: [PATCH 095/183] Webpack (#10) See https://github.com/flarum/core/pull/1367 * Replace gulp with webpack and npm scripts for JS compilation * Set up Travis CI to commit compiled JS * Restructure `js` directory; only one instance of npm, forum/admin are "submodules" * Restructure `less` directory --- extensions/sticky/.deploy.enc | Bin 0 -> 3248 bytes extensions/sticky/.gitattributes | 2 +- extensions/sticky/.gitignore | 2 +- extensions/sticky/.travis.yml | 15 + extensions/sticky/bootstrap.php | 10 +- extensions/sticky/js/admin.js | 10 + extensions/sticky/js/admin/Gulpfile.js | 7 - extensions/sticky/js/admin/dist/extension.js | 28 - extensions/sticky/js/admin/package.json | 7 - extensions/sticky/js/forum.js | 10 + extensions/sticky/js/forum/Gulpfile.js | 7 - extensions/sticky/js/forum/dist/extension.js | 189 - extensions/sticky/js/forum/package.json | 7 - extensions/sticky/js/package-lock.json | 4695 +++++++++++++++++ extensions/sticky/js/package.json | 13 + .../{admin/src/main.js => src/admin/index.js} | 0 .../src => src/forum}/addStickyBadge.js | 0 .../src => src/forum}/addStickyControl.js | 0 .../src => src/forum}/addStickyExcerpt.js | 0 .../components/DiscussionStickiedPost.js | 0 .../{forum/src/main.js => src/forum/index.js} | 9 +- extensions/sticky/js/webpack.config.js | 3 + .../less/{forum/extension.less => forum.less} | 0 extensions/sticky/scripts/compile.sh | 27 - 24 files changed, 4758 insertions(+), 283 deletions(-) create mode 100644 extensions/sticky/.deploy.enc create mode 100644 extensions/sticky/.travis.yml create mode 100644 extensions/sticky/js/admin.js delete mode 100644 extensions/sticky/js/admin/Gulpfile.js delete mode 100644 extensions/sticky/js/admin/dist/extension.js delete mode 100644 extensions/sticky/js/admin/package.json create mode 100644 extensions/sticky/js/forum.js delete mode 100644 extensions/sticky/js/forum/Gulpfile.js delete mode 100644 extensions/sticky/js/forum/dist/extension.js delete mode 100644 extensions/sticky/js/forum/package.json create mode 100644 extensions/sticky/js/package-lock.json create mode 100644 extensions/sticky/js/package.json rename extensions/sticky/js/{admin/src/main.js => src/admin/index.js} (100%) rename extensions/sticky/js/{forum/src => src/forum}/addStickyBadge.js (100%) rename extensions/sticky/js/{forum/src => src/forum}/addStickyControl.js (100%) rename extensions/sticky/js/{forum/src => src/forum}/addStickyExcerpt.js (100%) rename extensions/sticky/js/{forum/src => src/forum}/components/DiscussionStickiedPost.js (100%) rename extensions/sticky/js/{forum/src/main.js => src/forum/index.js} (61%) create mode 100644 extensions/sticky/js/webpack.config.js rename extensions/sticky/less/{forum/extension.less => forum.less} (100%) delete mode 100755 extensions/sticky/scripts/compile.sh diff --git a/extensions/sticky/.deploy.enc b/extensions/sticky/.deploy.enc new file mode 100644 index 0000000000000000000000000000000000000000..cd42dd36baafb633d582f0289c0bf6a444b5911c GIT binary patch literal 3248 zcmV;h3{UfpOUL+!1W*$c*EPeqjIpk2xBx$j1e=vRK$A}w$KcUDZkP_<%wQL0m&&y#v(s+v?Iwzd&~NQtE3Aj;B%($}q8*5eqKYpdg3zD6D<(3$^L#A7 z`t0wY1du4J1>i_V7vAG$@f2GP&#I$S^H#5{L#h(>uyy%d)>Xt$ag}9auk7T>{5puV zb7gblG^Dx%D@^Nal@TqG4tQgTnil;;HAca$Yng zrICf3hKx|#&*!KG9=oh^CMj6UiIjZi6)0ybmWM-MbW}^?7zbhcvSr3$A%$mrL~G9l zs)TTZ9qX>^B~I`=+c`@&d*WFX#Y$zjInVoszCm2yHnmxv!V6uuYH!GY2~{)~%9ioJ1#x4;Ca zfBXeB?+T?da=PeDZt)jplKo8i5FDQL*c9_KJR!AvU`Eoe9W7kt1T&A$L`3#Pf)QWK z;G_{z!Yc(-kL9IFTEf>=_`4bF$cF$$ypRa`03r2bO+1u10xg+iL&lZ()k-mY5--Yh z>UN)nvzU-!hKnAI)+FgjYP;x|&maqSB5#Niyu9(CTf+`{yqm;nrC5RsfvVi5g8~U0 zkwr`@W-oLnEu-5vUz&B4?>=bP{&*&-_Bc|M_FZv+-)K@b$AWK@o#rtHe29Fp#;jGto-EFNtIJATJBTnK7-&U&j%r~ka{F6Td!)jE! z?y23lwd~%|c@M(=?T?TE9*M8FWv}D1E^Zav;HzhfctOm+Q05~D({)vn4mC0T>aB7u z%0DeitYeu!gXR3+%mFSoM^moleqW^Ckzq!F1=gkwQ(DIPXWxqk7woFn07i~AtSTl2 z;}s5cV+u}((CBX_s82?`8qllh^8w9>5Q_&B#T%vO)u6y0Yq4TcfhPpLVzO_;JtaF@ zU**&dmj?LnN|n)Hb>6r!x09Y_G?dJ}0M76eSWMfO{m8tcf)69qbZe-KbC);y_15r% zx0>X-1W5}R?8=x%A8F;Sejv{Ny!%7aZoLtAX`=P(HRur(Qq%ah@3yk+44F1ZEofyg zR`h}7r!f{D0)wEs9K7~zgeX~WTyKc>{ei8$>n3*c^~QBvd!*?5?=cU zkmRK>t0nxmY5JryldpC`%_lE=`jRt#8l@z;6mGt!+rTf{=HYB(dv^2;x)X6nDdC|* zbR6u>9}ywfDY4J2F}~*XEiA%M;saNw0^tZeK=Z3-1^8Y-9|AA`KA+z_5;5dFSR9?a81o z#Z{ZxhxN$xG(*f^m!xJRZ_r)eY?%@zw8rzHd2jMdAk4 zUZL+<616}iZDKk2lh1m%?OajckPIpfpxc9xK>^eO2!DSOOjD{&Hc6uU^!<7o$hUlXW73)eSNk-y=6x2;e zj$(V9FTI*;UHi6?6JGy>K@B404Ks}NI#U8k)8&EOS6DOm_UyAxyt>UY#Gq11y<;qb zpohg0^5Q3*kCTt4y{wVf8dcJIUbU`Kghzhg_{?ie(Z#(<>el3%==+>f7S z&EabN0GMCeDqYc)a@&FuL)h^75o?Mz+fm%08b+b13LzEPZ;Tenx1|;joFis6xH~rP zyqY}rr@S_IAiyqV5c?sxKz^IcgaOAjg+z$gWB{}P4O5yZ&m5dT>M_k&DdAI6QpZ}6 zNydL(*>UEqwsqUn& z5Ferh2{AKSP{4*Y$6zfHiU%y2KTEr0!&a|o5r5V&%R&C!fbWap6h#Gv%md0ep(=K| z@QgjE8da@@GQFR`B7)=fEZ+h{P!q^QNQ&3MeLAZ1p$w~0FK@1okt((U#GN<5tHxNZqo-#--{n70f7 zl}=G?&?=qXQ)2I{o4ySCGBdb%sNfusc8R`7b30Iu{D&{y| zauLg0;ONISA1`PZE(5B`2o8>!yu8M4B?GvJaiA@u?ilW-XKH_6HM$U4a z1|LTh(1OASJDoJq0iY5VDE;?>ir)WSxIVtV7fHk}sa>JjQm*$A$>nC%ToEk2KdwQh zGvot&>TpBmhGpy4R&dsSQAZ>BP zxqcbVgQ|@_#hK07lpF=2M^rNtr+Sb@8^z{zsorh>r1fFW)*(BgClVAl3clhZCFiDI zdi#lpw-!j}^B1uzjZyOI=}g1c3(3eoapl+e^a9wB6|80Yz7x$HRT%3M<|QmBKN6%k z?_v!Ngo-}X0V;6!+LAciffuWLn=zxlt%qA|K0a^=$QQrueBB17okw}pW=7JY-Trge zYi|i}Jj|o)3rV@K`R^FejUTPz2eSaXOA| z7jn%{L)m3qNhpk68(#88VKa`+HdgJ=ovT?8HHM>bbjdD$Z)sxl3q*DMAdaci9!=@o z;2E^?koj9n=}`HnlbIs}vI1URHM-FsXo&}E7j;g;hlC~vV;_+E18AYQo!@P{F%@0It9f9`TpaMxNq;L&p9;mxCy7%L7(fE%h4%!i`-l z#})Z|UcQ&uw6iN4!of!edtP&?hoLOAc302`lPLHv{BVpZkHP+Jf6*J3!WT*P-VZ^U(C^!@f16F?qL?0dS06?{!dNtyJ2OO9UfnP zD_s|l?-ZlJlrj98C>c7-*6C>H;8vr?|G0}7MgrgMxPl>s23#w+2&|@VTZ3eQV?G|x z`ME*~Wu*w6QG*Qf^9vus`9m!xJp0EkG`2A56>XI=h-}!=*+pF7TJ% zTAbGO_h@fIu^wuY^*rk#n@UG02gL*E_s;d^syAn+1+h27-`H+0PJfrx6%T(mr=v$| z{V!V?<1(h|8A(fMFN*bO8zS~1Hh>ts<>!)%kT1FmK{rl>?~o*qqK$GSt4>Q?eCGqv z2yBEdLaBlax_3TW$?JQ~9*US_5~s&2c8a?9pNS);(S5Br7hLhehWjVGrMP%2t*SaK ij^y7@)zL4?XcUk$yafAA|EcA+OGMGk=hp20g-o}HCR+;t literal 0 HcmV?d00001 diff --git a/extensions/sticky/.gitattributes b/extensions/sticky/.gitattributes index 053481a3e..16ac2892f 100644 --- a/extensions/sticky/.gitattributes +++ b/extensions/sticky/.gitattributes @@ -2,4 +2,4 @@ .gitignore export-ignore .travis.yml export-ignore -js/*/dist/*.js -diff +js/dist/* -diff diff --git a/extensions/sticky/.gitignore b/extensions/sticky/.gitignore index 4181b9dca..7f43257e7 100644 --- a/extensions/sticky/.gitignore +++ b/extensions/sticky/.gitignore @@ -3,4 +3,4 @@ composer.phar .DS_Store Thumbs.db node_modules -bower_components \ No newline at end of file +js/dist/* diff --git a/extensions/sticky/.travis.yml b/extensions/sticky/.travis.yml new file mode 100644 index 000000000..96b33cb58 --- /dev/null +++ b/extensions/sticky/.travis.yml @@ -0,0 +1,15 @@ +language: minimal + +sudo: false + +cache: + directories: + - $HOME/.npm + +jobs: + include: + - stage: build + if: branch = master AND type = push + script: curl -s https://raw.githubusercontent.com/flarum/core/master/.travis/build.sh | bash -s - + -k $encrypted_1695d3919056_key + -i $encrypted_1695d3919056_iv diff --git a/extensions/sticky/bootstrap.php b/extensions/sticky/bootstrap.php index 4ee76c8e7..59ebad473 100644 --- a/extensions/sticky/bootstrap.php +++ b/extensions/sticky/bootstrap.php @@ -15,12 +15,12 @@ use Illuminate\Contracts\Events\Dispatcher; return [ (new Extend\Assets('forum')) - ->asset(__DIR__.'/js/forum/dist/extension.js') - ->asset(__DIR__.'/less/forum/extension.less') - ->bootstrapper('flarum/sticky/main'), + ->js(__DIR__.'/js/dist/forum.js') + ->asset(__DIR__.'/less/forum.less'), + (new Extend\Assets('admin')) - ->asset(__DIR__.'/js/admin/dist/extension.js') - ->bootstrapper('flarum/sticky/main'), + ->js(__DIR__.'/js/dist/admin.js'), + function (Dispatcher $events) { $events->subscribe(Listener\AddApiAttributes::class); $events->subscribe(Listener\CreatePostWhenDiscussionIsStickied::class); diff --git a/extensions/sticky/js/admin.js b/extensions/sticky/js/admin.js new file mode 100644 index 000000000..3eb559ff9 --- /dev/null +++ b/extensions/sticky/js/admin.js @@ -0,0 +1,10 @@ +/* + * This file is part of Flarum. + * + * (c) Toby Zerner + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +export * from './src/admin'; diff --git a/extensions/sticky/js/admin/Gulpfile.js b/extensions/sticky/js/admin/Gulpfile.js deleted file mode 100644 index c2cebeaf6..000000000 --- a/extensions/sticky/js/admin/Gulpfile.js +++ /dev/null @@ -1,7 +0,0 @@ -var gulp = require('flarum-gulp'); - -gulp({ - modules: { - 'flarum/sticky': 'src/**/*.js' - } -}); diff --git a/extensions/sticky/js/admin/dist/extension.js b/extensions/sticky/js/admin/dist/extension.js deleted file mode 100644 index b3bc4bc02..000000000 --- a/extensions/sticky/js/admin/dist/extension.js +++ /dev/null @@ -1,28 +0,0 @@ -'use strict'; - -System.register('flarum/sticky/main', ['flarum/extend', 'flarum/app', 'flarum/components/PermissionGrid'], function (_export, _context) { - "use strict"; - - var extend, app, PermissionGrid; - return { - setters: [function (_flarumExtend) { - extend = _flarumExtend.extend; - }, function (_flarumApp) { - app = _flarumApp.default; - }, function (_flarumComponentsPermissionGrid) { - PermissionGrid = _flarumComponentsPermissionGrid.default; - }], - execute: function () { - - app.initializers.add('flarum-sticky', function () { - extend(PermissionGrid.prototype, 'moderateItems', function (items) { - items.add('sticky', { - icon: 'thumb-tack', - label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'), - permission: 'discussion.sticky' - }, 95); - }); - }); - } - }; -}); \ No newline at end of file diff --git a/extensions/sticky/js/admin/package.json b/extensions/sticky/js/admin/package.json deleted file mode 100644 index 19a7865d9..000000000 --- a/extensions/sticky/js/admin/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "devDependencies": { - "gulp": "^3.9.1", - "flarum-gulp": "^0.2.0" - } -} diff --git a/extensions/sticky/js/forum.js b/extensions/sticky/js/forum.js new file mode 100644 index 000000000..cc78f6edc --- /dev/null +++ b/extensions/sticky/js/forum.js @@ -0,0 +1,10 @@ +/* + * This file is part of Flarum. + * + * (c) Toby Zerner + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +export * from './src/forum'; diff --git a/extensions/sticky/js/forum/Gulpfile.js b/extensions/sticky/js/forum/Gulpfile.js deleted file mode 100644 index c2cebeaf6..000000000 --- a/extensions/sticky/js/forum/Gulpfile.js +++ /dev/null @@ -1,7 +0,0 @@ -var gulp = require('flarum-gulp'); - -gulp({ - modules: { - 'flarum/sticky': 'src/**/*.js' - } -}); diff --git a/extensions/sticky/js/forum/dist/extension.js b/extensions/sticky/js/forum/dist/extension.js deleted file mode 100644 index 1fa115e62..000000000 --- a/extensions/sticky/js/forum/dist/extension.js +++ /dev/null @@ -1,189 +0,0 @@ -'use strict'; - -System.register('flarum/sticky/addStickyBadge', ['flarum/extend', 'flarum/models/Discussion', 'flarum/components/Badge'], function (_export, _context) { - "use strict"; - - var extend, Discussion, Badge; - function addStickyBadge() { - extend(Discussion.prototype, 'badges', function (badges) { - if (this.isSticky()) { - badges.add('sticky', Badge.component({ - type: 'sticky', - label: app.translator.trans('flarum-sticky.forum.badge.sticky_tooltip'), - icon: 'thumb-tack' - }), 10); - } - }); - } - - _export('default', addStickyBadge); - - return { - setters: [function (_flarumExtend) { - extend = _flarumExtend.extend; - }, function (_flarumModelsDiscussion) { - Discussion = _flarumModelsDiscussion.default; - }, function (_flarumComponentsBadge) { - Badge = _flarumComponentsBadge.default; - }], - execute: function () {} - }; -});; -'use strict'; - -System.register('flarum/sticky/addStickyControl', ['flarum/extend', 'flarum/utils/DiscussionControls', 'flarum/components/DiscussionPage', 'flarum/components/Button'], function (_export, _context) { - "use strict"; - - var extend, DiscussionControls, DiscussionPage, Button; - function addStickyControl() { - extend(DiscussionControls, 'moderationControls', function (items, discussion) { - if (discussion.canSticky()) { - items.add('sticky', Button.component({ - children: app.translator.trans(discussion.isSticky() ? 'flarum-sticky.forum.discussion_controls.unsticky_button' : 'flarum-sticky.forum.discussion_controls.sticky_button'), - icon: 'thumb-tack', - onclick: this.stickyAction.bind(discussion) - })); - } - }); - - DiscussionControls.stickyAction = function () { - this.save({ isSticky: !this.isSticky() }).then(function () { - if (app.current instanceof DiscussionPage) { - app.current.stream.update(); - } - - m.redraw(); - }); - }; - } - - _export('default', addStickyControl); - - return { - setters: [function (_flarumExtend) { - extend = _flarumExtend.extend; - }, function (_flarumUtilsDiscussionControls) { - DiscussionControls = _flarumUtilsDiscussionControls.default; - }, function (_flarumComponentsDiscussionPage) { - DiscussionPage = _flarumComponentsDiscussionPage.default; - }, function (_flarumComponentsButton) { - Button = _flarumComponentsButton.default; - }], - execute: function () {} - }; -});; -'use strict'; - -System.register('flarum/sticky/addStickyExcerpt', ['flarum/extend', 'flarum/components/DiscussionList', 'flarum/components/DiscussionListItem', 'flarum/utils/string'], function (_export, _context) { - "use strict"; - - var extend, DiscussionList, DiscussionListItem, truncate; - function addStickyControl() { - extend(DiscussionList.prototype, 'requestParams', function (params) { - params.include.push('startPost'); - }); - - extend(DiscussionListItem.prototype, 'infoItems', function (items) { - var discussion = this.props.discussion; - - if (discussion.isSticky() && !this.props.params.q) { - var startPost = discussion.startPost(); - - if (startPost) { - var excerpt = truncate(startPost.contentPlain(), 175); - - items.add('excerpt', excerpt, -100); - } - } - }); - } - - _export('default', addStickyControl); - - return { - setters: [function (_flarumExtend) { - extend = _flarumExtend.extend; - }, function (_flarumComponentsDiscussionList) { - DiscussionList = _flarumComponentsDiscussionList.default; - }, function (_flarumComponentsDiscussionListItem) { - DiscussionListItem = _flarumComponentsDiscussionListItem.default; - }, function (_flarumUtilsString) { - truncate = _flarumUtilsString.truncate; - }], - execute: function () {} - }; -});; -'use strict'; - -System.register('flarum/sticky/components/DiscussionStickiedPost', ['flarum/components/EventPost'], function (_export, _context) { - "use strict"; - - var EventPost, DiscussionStickiedPost; - return { - setters: [function (_flarumComponentsEventPost) { - EventPost = _flarumComponentsEventPost.default; - }], - execute: function () { - DiscussionStickiedPost = function (_EventPost) { - babelHelpers.inherits(DiscussionStickiedPost, _EventPost); - - function DiscussionStickiedPost() { - babelHelpers.classCallCheck(this, DiscussionStickiedPost); - return babelHelpers.possibleConstructorReturn(this, (DiscussionStickiedPost.__proto__ || Object.getPrototypeOf(DiscussionStickiedPost)).apply(this, arguments)); - } - - babelHelpers.createClass(DiscussionStickiedPost, [{ - key: 'icon', - value: function icon() { - return 'thumb-tack'; - } - }, { - key: 'descriptionKey', - value: function descriptionKey() { - return this.props.post.content().sticky ? 'flarum-sticky.forum.post_stream.discussion_stickied_text' : 'flarum-sticky.forum.post_stream.discussion_unstickied_text'; - } - }]); - return DiscussionStickiedPost; - }(EventPost); - - _export('default', DiscussionStickiedPost); - } - }; -});; -'use strict'; - -System.register('flarum/sticky/main', ['flarum/app', 'flarum/Model', 'flarum/models/Discussion', 'flarum/sticky/components/DiscussionStickiedPost', 'flarum/sticky/addStickyBadge', 'flarum/sticky/addStickyControl', 'flarum/sticky/addStickyExcerpt'], function (_export, _context) { - "use strict"; - - var app, Model, Discussion, DiscussionStickiedPost, addStickyBadge, addStickyControl, addStickyExcerpt; - return { - setters: [function (_flarumApp) { - app = _flarumApp.default; - }, function (_flarumModel) { - Model = _flarumModel.default; - }, function (_flarumModelsDiscussion) { - Discussion = _flarumModelsDiscussion.default; - }, function (_flarumStickyComponentsDiscussionStickiedPost) { - DiscussionStickiedPost = _flarumStickyComponentsDiscussionStickiedPost.default; - }, function (_flarumStickyAddStickyBadge) { - addStickyBadge = _flarumStickyAddStickyBadge.default; - }, function (_flarumStickyAddStickyControl) { - addStickyControl = _flarumStickyAddStickyControl.default; - }, function (_flarumStickyAddStickyExcerpt) { - addStickyExcerpt = _flarumStickyAddStickyExcerpt.default; - }], - execute: function () { - - app.initializers.add('flarum-sticky', function () { - app.postComponents.discussionStickied = DiscussionStickiedPost; - - Discussion.prototype.isSticky = Model.attribute('isSticky'); - Discussion.prototype.canSticky = Model.attribute('canSticky'); - - addStickyBadge(); - addStickyControl(); - addStickyExcerpt(); - }); - } - }; -}); \ No newline at end of file diff --git a/extensions/sticky/js/forum/package.json b/extensions/sticky/js/forum/package.json deleted file mode 100644 index 19a7865d9..000000000 --- a/extensions/sticky/js/forum/package.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "private": true, - "devDependencies": { - "gulp": "^3.9.1", - "flarum-gulp": "^0.2.0" - } -} diff --git a/extensions/sticky/js/package-lock.json b/extensions/sticky/js/package-lock.json new file mode 100644 index 000000000..5df91e669 --- /dev/null +++ b/extensions/sticky/js/package-lock.json @@ -0,0 +1,4695 @@ +{ + "name": "@flarum/flarum-ext-sticky", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.51.tgz", + "integrity": "sha1-vXHZsZKvl435FYKdOdQJRFZDmgw=", + "requires": { + "@babel/highlight": "7.0.0-beta.51" + } + }, + "@babel/core": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.0.0-beta.51.tgz", + "integrity": "sha1-DlS9a2OHNrKuWTwxpH8JaeKyuW0=", + "requires": { + "@babel/code-frame": "7.0.0-beta.51", + "@babel/generator": "7.0.0-beta.51", + "@babel/helpers": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "convert-source-map": "^1.1.0", + "debug": "^3.1.0", + "json5": "^0.5.0", + "lodash": "^4.17.5", + "micromatch": "^3.1.10", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.51.tgz", + "integrity": "sha1-bHV1/952HQdIXgS67cA5LG2eMPY=", + "requires": { + "@babel/types": "7.0.0-beta.51", + "jsesc": "^2.5.1", + "lodash": "^4.17.5", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0-beta.51.tgz", + "integrity": "sha1-OM95IL9fM4oif3VOKGtvut7gS1g=", + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-builder-binary-assignment-operator-visitor": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.0.0-beta.51.tgz", + "integrity": "sha1-ITP//j4vcVkeQhR7lHKRyirTkjc=", + "requires": { + "@babel/helper-explode-assignable-expression": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-builder-react-jsx": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-react-jsx/-/helper-builder-react-jsx-7.0.0-beta.51.tgz", + "integrity": "sha1-hsctZoO9JZfJOKEhU6bkgL8UASg=", + "requires": { + "@babel/types": "7.0.0-beta.51", + "esutils": "^2.0.0" + } + }, + "@babel/helper-call-delegate": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-call-delegate/-/helper-call-delegate-7.0.0-beta.51.tgz", + "integrity": "sha1-BO1yfJfPBbyy/WRINzMasV1jyBk=", + "requires": { + "@babel/helper-hoist-variables": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-define-map": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.0.0-beta.51.tgz", + "integrity": "sha1-2Ixkc36UjHE/nxFTM46EFf7kCxE=", + "requires": { + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/helper-explode-assignable-expression": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.0.0-beta.51.tgz", + "integrity": "sha1-mHUzKti11cmC+kgcuCtzFwPyzS0=", + "requires": { + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.51.tgz", + "integrity": "sha1-IbSHSiJ8+Z7K/MMKkDAtpaJkBWE=", + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.51.tgz", + "integrity": "sha1-MoGy0EWvlcFyzpGyCCXYXqRnZBE=", + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-hoist-variables": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.0.0-beta.51.tgz", + "integrity": "sha1-XX68hZZWe2RPyYmRLDo++YvgWPw=", + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-member-expression-to-functions": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.0.0-beta.51.tgz", + "integrity": "sha1-KkJTZXQXZYiAbmAusXpS0yP4KHA=", + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-module-imports": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0-beta.51.tgz", + "integrity": "sha1-zgBCgEX7t9XrwOp7+DV4nxU2arI=", + "requires": { + "@babel/types": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/helper-module-transforms": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.0.0-beta.51.tgz", + "integrity": "sha1-E68MjuQfJ3dDyPxD1EQxXbIyb3M=", + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.51", + "@babel/helper-simple-access": "7.0.0-beta.51", + "@babel/helper-split-export-declaration": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/helper-optimise-call-expression": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.0.0-beta.51.tgz", + "integrity": "sha1-IfIVjvCDoSPOHgRmW1u4TzcAgNc=", + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0-beta.51.tgz", + "integrity": "sha1-D2pfK20cZERBP4+rYJQNebY8IDE=" + }, + "@babel/helper-regex": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.0.0-beta.51.tgz", + "integrity": "sha1-mXIqPAxwRZavsSMoSwqIihoAPYI=", + "requires": { + "lodash": "^4.17.5" + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.0.0-beta.51.tgz", + "integrity": "sha1-DtxX4F3LXd4qC27m+NAmGYLe8l8=", + "requires": { + "@babel/helper-annotate-as-pure": "7.0.0-beta.51", + "@babel/helper-wrap-function": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-replace-supers": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.0.0-beta.51.tgz", + "integrity": "sha1-J5phr7hJR2xsxw1VGfg99KdP+m8=", + "requires": { + "@babel/helper-member-expression-to-functions": "7.0.0-beta.51", + "@babel/helper-optimise-call-expression": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-simple-access": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.0.0-beta.51.tgz", + "integrity": "sha1-ydf+zYShgdUKOvzEIvyUqWi+MFA=", + "requires": { + "@babel/template": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.51.tgz", + "integrity": "sha1-imw/ZsTSZTUvwHdIT59ugKUauXg=", + "requires": { + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helper-wrap-function": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.0.0-beta.51.tgz", + "integrity": "sha1-bFFvsEQQmWTuAxwiUAqDAxOGL7E=", + "requires": { + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/template": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/helpers": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.0.0-beta.51.tgz", + "integrity": "sha1-lScr4qtGNNaCBCX4klAxqSiRg5c=", + "requires": { + "@babel/template": "7.0.0-beta.51", + "@babel/traverse": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.51.tgz", + "integrity": "sha1-6IRK4loVlcz9QriWI7Q3bKBtIl0=", + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" + } + }, + "@babel/parser": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.0.0-beta.51.tgz", + "integrity": "sha1-J87C30Cd9gr1gnDtj2qlVAnqhvY=" + }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.0.0-beta.51.tgz", + "integrity": "sha1-99aS+Uakp/ynjkM2QHoAvq+KTeo=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-remap-async-to-generator": "7.0.0-beta.51", + "@babel/plugin-syntax-async-generators": "7.0.0-beta.51" + } + }, + "@babel/plugin-proposal-class-properties": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.0.0-beta.51.tgz", + "integrity": "sha1-tcZi+GKjCs6U/EhHeDex0lX6ON8=", + "requires": { + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/helper-member-expression-to-functions": "7.0.0-beta.51", + "@babel/helper-optimise-call-expression": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-replace-supers": "7.0.0-beta.51", + "@babel/plugin-syntax-class-properties": "7.0.0-beta.51" + } + }, + "@babel/plugin-proposal-object-rest-spread": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.0.0-beta.51.tgz", + "integrity": "sha1-W8Rp5ebRuEpdYEa1npDKAWwghtY=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.51" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.0.0-beta.51.tgz", + "integrity": "sha1-PsxtKRnVLJTL+uhiXaM1ghAvs9Y=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.51" + } + }, + "@babel/plugin-proposal-unicode-property-regex": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.0.0-beta.51.tgz", + "integrity": "sha1-0pbD6nTKN/1/pVu/jAzYWqfZn3s=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-regex": "7.0.0-beta.51", + "regexpu-core": "^4.2.0" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.0.0-beta.51.tgz", + "integrity": "sha1-aSGvHcPaD87d4KYQc+7Hl7jKpwc=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-syntax-class-properties": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.0.0-beta.51.tgz", + "integrity": "sha1-8Mv28iqHnFk6B+jhQckI4IdwHpE=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-syntax-jsx": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.0.0-beta.51.tgz", + "integrity": "sha1-9nKjNxxro/5Tv/0uirXcQElTgs8=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-syntax-object-rest-spread": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.0.0-beta.51.tgz", + "integrity": "sha1-bVehGcHwZMRY5FutRb7wqD7RDAA=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.0.0-beta.51.tgz", + "integrity": "sha1-ziZ1cgy0EkjCZDNRXJDJS50Bpv0=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-arrow-functions": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.0.0-beta.51.tgz", + "integrity": "sha1-KbnbbjhoigbsXCVjmZbYml6/2+M=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-async-to-generator": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.0.0-beta.51.tgz", + "integrity": "sha1-lFOFBVoubTVmv1WvEnyNclzToXM=", + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-remap-async-to-generator": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-block-scoped-functions": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.0.0-beta.51.tgz", + "integrity": "sha1-IxKbr4FEcfOeqU7shKsf/nbJ/pY=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-block-scoping": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.0.0-beta.51.tgz", + "integrity": "sha1-vlVcefDaTrFop/4W14eppxc3AeA=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/plugin-transform-classes": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.0.0-beta.51.tgz", + "integrity": "sha1-BD8x+2MnZkoy2Lpl3hV5nv3GXaA=", + "requires": { + "@babel/helper-annotate-as-pure": "7.0.0-beta.51", + "@babel/helper-define-map": "7.0.0-beta.51", + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/helper-optimise-call-expression": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-replace-supers": "7.0.0-beta.51", + "@babel/helper-split-export-declaration": "7.0.0-beta.51", + "globals": "^11.1.0" + } + }, + "@babel/plugin-transform-computed-properties": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.0.0-beta.51.tgz", + "integrity": "sha1-jHKhqz4HZwNP+eZzLSWBwjwDLv4=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-destructuring": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.0.0-beta.51.tgz", + "integrity": "sha1-1dRU5XTH7zPuSekYsEivspvpNfY=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.0.0-beta.51.tgz", + "integrity": "sha1-mAVYoeX34ohQ9f/eIEBCkeKqM/s=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-regex": "7.0.0-beta.51", + "regexpu-core": "^4.1.3" + } + }, + "@babel/plugin-transform-duplicate-keys": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.0.0-beta.51.tgz", + "integrity": "sha1-VB6vipfRSpgJs1nY9UgAHwhbm38=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-exponentiation-operator": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.0.0-beta.51.tgz", + "integrity": "sha1-BLTj5As3AREt1u2jliUTJ1eIH9Q=", + "requires": { + "@babel/helper-builder-binary-assignment-operator-visitor": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-for-of": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.0.0-beta.51.tgz", + "integrity": "sha1-RPR2sGxANVF6hAOiYk+xZMQ3FFU=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-function-name": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.0.0-beta.51.tgz", + "integrity": "sha1-cGU8NgtTJUJG9GWexFCwwKVthqo=", + "requires": { + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-literals": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.0.0-beta.51.tgz", + "integrity": "sha1-RbB6lCI8+iJnAaeUYLQrMt8d7AU=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-modules-amd": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.0.0-beta.51.tgz", + "integrity": "sha1-9oqL5/ZRd9JGUGo5FNrk1m5nWh8=", + "requires": { + "@babel/helper-module-transforms": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.0.0-beta.51.tgz", + "integrity": "sha1-QDj54VJE4QkAy4n1t5bQUPHrGVs=", + "requires": { + "@babel/helper-module-transforms": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-simple-access": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-modules-systemjs": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.0.0-beta.51.tgz", + "integrity": "sha1-bn/ErZQhtyXN3zfMkk6vd38ijCc=", + "requires": { + "@babel/helper-hoist-variables": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-modules-umd": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.0.0-beta.51.tgz", + "integrity": "sha1-7i71dVedluQGE/ym5sjttcrbbG8=", + "requires": { + "@babel/helper-module-transforms": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-new-target": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.0.0-beta.51.tgz", + "integrity": "sha1-cHWhBllcv91CXta4MLefinr/UoM=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-object-super": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.0.0-beta.51.tgz", + "integrity": "sha1-rBjoi8HXm3GL2vSKdWgzzfW9zr8=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-replace-supers": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-parameters": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.0.0-beta.51.tgz", + "integrity": "sha1-mQGVsd/bG8yUkG8wNJUQie0e3U4=", + "requires": { + "@babel/helper-call-delegate": "7.0.0-beta.51", + "@babel/helper-get-function-arity": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-react-display-name": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-display-name/-/plugin-transform-react-display-name-7.0.0-beta.51.tgz", + "integrity": "sha1-G0i9NN+pCHJSyHB9Kb0d8uiCHL4=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-react-jsx": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.0.0-beta.51.tgz", + "integrity": "sha1-evhJhRi4OQZAVDg3AZiAjKbmOxA=", + "requires": { + "@babel/helper-builder-react-jsx": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-syntax-jsx": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-react-jsx-self": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-self/-/plugin-transform-react-jsx-self-7.0.0-beta.51.tgz", + "integrity": "sha1-pPCYWX/nCYVUQ2b4k6xHOJhk2JQ=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-syntax-jsx": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-react-jsx-source": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx-source/-/plugin-transform-react-jsx-source-7.0.0-beta.51.tgz", + "integrity": "sha1-aZncSRyLRgLvtNC9G6/JNq1pbs8=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-syntax-jsx": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-regenerator": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.0.0-beta.51.tgz", + "integrity": "sha1-U28NWZ0nU9ygor6KZeLCRKe1YSs=", + "requires": { + "regenerator-transform": "^0.12.4" + } + }, + "@babel/plugin-transform-runtime": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.0.0-beta.51.tgz", + "integrity": "sha1-DJyrF09OPhMWWf1lxc6OPXM3aCA=", + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-shorthand-properties": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.0.0-beta.51.tgz", + "integrity": "sha1-3bwLGuHds7z+aWnyyWgQPxHjK9k=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-spread": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.0.0-beta.51.tgz", + "integrity": "sha1-EAEpvI19z0vHmtzWEppCFCWdilA=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-sticky-regex": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.0.0-beta.51.tgz", + "integrity": "sha1-SMvqzTG9Be6AC1+svLCcV4G9lhk=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-regex": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-template-literals": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.0.0-beta.51.tgz", + "integrity": "sha1-LQWV9WRh1DRbo1w41zAz+H7Lu8g=", + "requires": { + "@babel/helper-annotate-as-pure": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-typeof-symbol": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.0.0-beta.51.tgz", + "integrity": "sha1-SVDAyOPJ4eFB5Fzrq15hSCYyBMM=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51" + } + }, + "@babel/plugin-transform-unicode-regex": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.0.0-beta.51.tgz", + "integrity": "sha1-kBn5FQj0C1CmRDUEMijEFCws2GQ=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/helper-regex": "7.0.0-beta.51", + "regexpu-core": "^4.1.3" + } + }, + "@babel/preset-env": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.0.0-beta.51.tgz", + "integrity": "sha1-W1gObp6DBBZsExcBfoY8Btz8BKI=", + "requires": { + "@babel/helper-module-imports": "7.0.0-beta.51", + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-proposal-async-generator-functions": "7.0.0-beta.51", + "@babel/plugin-proposal-object-rest-spread": "7.0.0-beta.51", + "@babel/plugin-proposal-optional-catch-binding": "7.0.0-beta.51", + "@babel/plugin-proposal-unicode-property-regex": "7.0.0-beta.51", + "@babel/plugin-syntax-async-generators": "7.0.0-beta.51", + "@babel/plugin-syntax-object-rest-spread": "7.0.0-beta.51", + "@babel/plugin-syntax-optional-catch-binding": "7.0.0-beta.51", + "@babel/plugin-transform-arrow-functions": "7.0.0-beta.51", + "@babel/plugin-transform-async-to-generator": "7.0.0-beta.51", + "@babel/plugin-transform-block-scoped-functions": "7.0.0-beta.51", + "@babel/plugin-transform-block-scoping": "7.0.0-beta.51", + "@babel/plugin-transform-classes": "7.0.0-beta.51", + "@babel/plugin-transform-computed-properties": "7.0.0-beta.51", + "@babel/plugin-transform-destructuring": "7.0.0-beta.51", + "@babel/plugin-transform-dotall-regex": "7.0.0-beta.51", + "@babel/plugin-transform-duplicate-keys": "7.0.0-beta.51", + "@babel/plugin-transform-exponentiation-operator": "7.0.0-beta.51", + "@babel/plugin-transform-for-of": "7.0.0-beta.51", + "@babel/plugin-transform-function-name": "7.0.0-beta.51", + "@babel/plugin-transform-literals": "7.0.0-beta.51", + "@babel/plugin-transform-modules-amd": "7.0.0-beta.51", + "@babel/plugin-transform-modules-commonjs": "7.0.0-beta.51", + "@babel/plugin-transform-modules-systemjs": "7.0.0-beta.51", + "@babel/plugin-transform-modules-umd": "7.0.0-beta.51", + "@babel/plugin-transform-new-target": "7.0.0-beta.51", + "@babel/plugin-transform-object-super": "7.0.0-beta.51", + "@babel/plugin-transform-parameters": "7.0.0-beta.51", + "@babel/plugin-transform-regenerator": "7.0.0-beta.51", + "@babel/plugin-transform-shorthand-properties": "7.0.0-beta.51", + "@babel/plugin-transform-spread": "7.0.0-beta.51", + "@babel/plugin-transform-sticky-regex": "7.0.0-beta.51", + "@babel/plugin-transform-template-literals": "7.0.0-beta.51", + "@babel/plugin-transform-typeof-symbol": "7.0.0-beta.51", + "@babel/plugin-transform-unicode-regex": "7.0.0-beta.51", + "browserslist": "^3.0.0", + "invariant": "^2.2.2", + "js-levenshtein": "^1.1.3", + "semver": "^5.3.0" + } + }, + "@babel/preset-react": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/preset-react/-/preset-react-7.0.0-beta.51.tgz", + "integrity": "sha1-lX2BKobZbIkhSSi3mAB0j1GTXkk=", + "requires": { + "@babel/helper-plugin-utils": "7.0.0-beta.51", + "@babel/plugin-transform-react-display-name": "7.0.0-beta.51", + "@babel/plugin-transform-react-jsx": "7.0.0-beta.51", + "@babel/plugin-transform-react-jsx-self": "7.0.0-beta.51", + "@babel/plugin-transform-react-jsx-source": "7.0.0-beta.51" + } + }, + "@babel/runtime": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.0.0-beta.51.tgz", + "integrity": "sha1-SLjtGDBwNMZiD2Q1FGUMoszAFlo=", + "requires": { + "core-js": "^2.5.7", + "regenerator-runtime": "^0.11.1" + } + }, + "@babel/template": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.51.tgz", + "integrity": "sha1-lgKkCuvPNXrpZ34lMu9fyBD1+/8=", + "requires": { + "@babel/code-frame": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "lodash": "^4.17.5" + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.51.tgz", + "integrity": "sha1-mB2vLOw0emIx06odnhgDsDqqpKg=", + "requires": { + "@babel/code-frame": "7.0.0-beta.51", + "@babel/generator": "7.0.0-beta.51", + "@babel/helper-function-name": "7.0.0-beta.51", + "@babel/helper-split-export-declaration": "7.0.0-beta.51", + "@babel/parser": "7.0.0-beta.51", + "@babel/types": "7.0.0-beta.51", + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.17.5" + } + }, + "@babel/types": { + "version": "7.0.0-beta.51", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.51.tgz", + "integrity": "sha1-2AK3tUO1g2x3iqaReXq/APPZfqk=", + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.5", + "to-fast-properties": "^2.0.0" + } + }, + "@webassemblyjs/ast": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.5.12.tgz", + "integrity": "sha512-bmTBEKuuhSU6dC95QIW250xO769cdYGx9rWn3uBLTw2pUpud0Z5kVuMw9m9fqbNzGeuOU2HpyuZa+yUt2CTEDA==", + "requires": { + "@webassemblyjs/helper-module-context": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/wast-parser": "1.5.12", + "debug": "^3.1.0", + "mamacro": "^0.0.3" + } + }, + "@webassemblyjs/floating-point-hex-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/floating-point-hex-parser/-/floating-point-hex-parser-1.5.12.tgz", + "integrity": "sha512-epTvkdwOIPpTE9edHS+V+shetYzpTbd91XOzUli1zAS0+NSgSe6ZsNggIqUNzhma1s4bN2f/m8c6B1NMdCERAg==" + }, + "@webassemblyjs/helper-api-error": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-api-error/-/helper-api-error-1.5.12.tgz", + "integrity": "sha512-Goxag86JvLq8ucHLXFNSLYzf9wrR+CJr37DsESTAzSnGoqDTgw5eqiXSQVd/D9Biih7+DIn8UIQCxMs8emRRwg==" + }, + "@webassemblyjs/helper-buffer": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-buffer/-/helper-buffer-1.5.12.tgz", + "integrity": "sha512-tJNUjttL5CxiiS/KLxT4/Zk0Nbl/poFhztFxktb46zoQEUWaGHR9ZJ0SnvE7DbFX5PY5JNJDMZ0Li4lm246fWw==", + "requires": { + "debug": "^3.1.0" + } + }, + "@webassemblyjs/helper-code-frame": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-code-frame/-/helper-code-frame-1.5.12.tgz", + "integrity": "sha512-0FrJgiST+MQDMvPigzs+UIk1vslLIqGadkEWdn53Lr0NsUC2JbheG9QaO3Zf6ycK2JwsHiUpGaMFcHYXStTPMA==", + "requires": { + "@webassemblyjs/wast-printer": "1.5.12" + } + }, + "@webassemblyjs/helper-fsm": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-fsm/-/helper-fsm-1.5.12.tgz", + "integrity": "sha512-QBHZ45VPUJ7UyYKvUFoaxrSS9H5hbkC9U7tdWgFHmnTMutkXSEgDg2gZg3I/QTsiKOCIwx4qJUJwPd7J4D5CNQ==" + }, + "@webassemblyjs/helper-module-context": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-module-context/-/helper-module-context-1.5.12.tgz", + "integrity": "sha512-SCXR8hPI4JOG3cdy9HAO8W5/VQ68YXG/Hfs7qDf1cd64zWuMNshyEour5NYnLMVkrrtc0XzfVS/MdeV94woFHA==", + "requires": { + "debug": "^3.1.0", + "mamacro": "^0.0.3" + } + }, + "@webassemblyjs/helper-wasm-bytecode": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-bytecode/-/helper-wasm-bytecode-1.5.12.tgz", + "integrity": "sha512-0Gz5lQcyvElNVbOTKwjEmIxGwdWf+zpAW/WGzGo95B7IgMEzyyfZU+PrGHDwiSH9c0knol9G7smQnY0ljrSA6g==" + }, + "@webassemblyjs/helper-wasm-section": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/helper-wasm-section/-/helper-wasm-section-1.5.12.tgz", + "integrity": "sha512-ge/CKVKBGpiJhFN9PIOQ7sPtGYJhxm/mW1Y3SpG1L6XBunfRz0YnLjW3TmhcOEFozIVyODPS1HZ9f7VR3GBGow==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "debug": "^3.1.0" + } + }, + "@webassemblyjs/ieee754": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/ieee754/-/ieee754-1.5.12.tgz", + "integrity": "sha512-F+PEv9QBzPi1ThLBouUJbuxhEr+Sy/oua1ftXFKHiaYYS5Z9tKPvK/hgCxlSdq+RY4MSG15jU2JYb/K5pkoybg==", + "requires": { + "ieee754": "^1.1.11" + } + }, + "@webassemblyjs/leb128": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/leb128/-/leb128-1.5.12.tgz", + "integrity": "sha512-cCOx/LVGiWyCwVrVlvGmTdnwHzIP4+zflLjGkZxWpYCpdNax9krVIJh1Pm7O86Ox/c5PrJpbvZU1cZLxndlPEw==", + "requires": { + "leb": "^0.3.0" + } + }, + "@webassemblyjs/utf8": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/utf8/-/utf8-1.5.12.tgz", + "integrity": "sha512-FX8NYQMiTRU0TfK/tJVntsi9IEKsedSsna8qtsndWVE0x3zLndugiApxdNMIOoElBV9o4j0BUqR+iwU58QfPxQ==" + }, + "@webassemblyjs/wasm-edit": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-edit/-/wasm-edit-1.5.12.tgz", + "integrity": "sha512-r/oZAyC4EZl0ToOYJgvj+b0X6gVEKQMLT34pNNbtvWBehQOnaSXvVUA5FIYlH8ubWjFNAFqYaVGgQTjR1yuJdQ==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/helper-wasm-section": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "@webassemblyjs/wasm-opt": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "@webassemblyjs/wast-printer": "1.5.12", + "debug": "^3.1.0" + } + }, + "@webassemblyjs/wasm-gen": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-gen/-/wasm-gen-1.5.12.tgz", + "integrity": "sha512-LTu+cr1YRxGGiVIXWhei/35lXXEwTnQU18x4V/gE+qCSJN21QcVTMjJuasTUh8WtmBZtOlqJbOQIeN7fGnHWhg==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/ieee754": "1.5.12", + "@webassemblyjs/leb128": "1.5.12", + "@webassemblyjs/utf8": "1.5.12" + } + }, + "@webassemblyjs/wasm-opt": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-opt/-/wasm-opt-1.5.12.tgz", + "integrity": "sha512-LBwG5KPA9u/uigZVyTsDpS3CVxx3AePCnTItVL+OPkRCp5LqmLsOp4a3/c5CQE0Lecm0Ss9hjUTDcbYFZkXlfQ==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-buffer": "1.5.12", + "@webassemblyjs/wasm-gen": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "debug": "^3.1.0" + } + }, + "@webassemblyjs/wasm-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wasm-parser/-/wasm-parser-1.5.12.tgz", + "integrity": "sha512-xset3+1AtoFYEfMg30nzCGBnhKmTBzbIKvMyLhqJT06TvYV+kA884AOUpUvhSmP6XPF3G+HVZPm/PbCGxH4/VQ==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-api-error": "1.5.12", + "@webassemblyjs/helper-wasm-bytecode": "1.5.12", + "@webassemblyjs/ieee754": "1.5.12", + "@webassemblyjs/leb128": "1.5.12", + "@webassemblyjs/utf8": "1.5.12" + } + }, + "@webassemblyjs/wast-parser": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-parser/-/wast-parser-1.5.12.tgz", + "integrity": "sha512-QWUtzhvfY7Ue9GlJ3HeOB6w5g9vNYUUnG+Y96TWPkFHJTxZlcvGfNrUoACCw6eDb9gKaHrjt77aPq41a7y8svg==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/floating-point-hex-parser": "1.5.12", + "@webassemblyjs/helper-api-error": "1.5.12", + "@webassemblyjs/helper-code-frame": "1.5.12", + "@webassemblyjs/helper-fsm": "1.5.12", + "long": "^3.2.0", + "mamacro": "^0.0.3" + } + }, + "@webassemblyjs/wast-printer": { + "version": "1.5.12", + "resolved": "https://registry.npmjs.org/@webassemblyjs/wast-printer/-/wast-printer-1.5.12.tgz", + "integrity": "sha512-XF9RTeckFgDyl196uRKZWHFFfbkzsMK96QTXp+TC0R9gsV9DMiDGMSIllgy/WdrZ3y3dsQp4fTA5r4GoaOBchA==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/wast-parser": "1.5.12", + "long": "^3.2.0" + } + }, + "acorn": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==" + }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "requires": { + "acorn": "^5.0.0" + } + }, + "ajv": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.1.tgz", + "integrity": "sha512-pgZos1vgOHDiC7gKNbZW8eKvCnNXARv2oqrGQT7Hzbq5Azp7aZG6DJzADnkuSq7RH6qkXp4J/m68yPX/2uBHyQ==", + "requires": { + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.1" + } + }, + "ajv-keywords": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz", + "integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=" + }, + "ansi-escapes": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.1.0.tgz", + "integrity": "sha512-UgAb8H9D41AQnu/PbWlCofQVcnV4Gs2bBJi9eZPxfU/hgglFh3SMDMENRIqdr7H6XFnXdoknctFByVsCOotTVw==" + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + } + }, + "aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" + }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "asn1.js": { + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/asn1.js/-/asn1.js-4.10.1.tgz", + "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", + "requires": { + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "assert": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/assert/-/assert-1.4.1.tgz", + "integrity": "sha1-mZEtWRg2tab1s0XA8H7vwI/GXZE=", + "requires": { + "util": "0.10.3" + }, + "dependencies": { + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" + }, + "util": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.3.tgz", + "integrity": "sha1-evsa/lCAUkZInj23/g7TeTNqwPk=", + "requires": { + "inherits": "2.0.1" + } + } + } + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "async-each": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" + }, + "atob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.1.tgz", + "integrity": "sha1-ri1acpR38onWDdf5amMUoi3Wwio=" + }, + "babel-loader": { + "version": "8.0.0-beta.3", + "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.0-beta.3.tgz", + "integrity": "sha512-yvaAx7cBEjh+R2oGL2vIPmveO6daS5TYP2FSPq4b6CUYjU/ilD4HHyfLIa9KUj6OKBcR9fQcl1NvUOTWNaJ6mw==", + "requires": { + "find-cache-dir": "^1.0.0", + "loader-utils": "^1.0.2", + "mkdirp": "^0.5.1", + "util.promisify": "^1.0.0" + } + }, + "balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "base64-js": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.0.tgz", + "integrity": "sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw==" + }, + "big.js": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/big.js/-/big.js-3.2.0.tgz", + "integrity": "sha512-+hN/Zh2D08Mx65pZ/4g5bsmNiZUuChDiQfTUQ7qJr4/kuopCr88xZsAXv6mBoZEsUI4OuGHlX59qE94K2mMW8Q==" + }, + "binary-extensions": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.11.0.tgz", + "integrity": "sha1-RqoXUftqL5PuXmibsQh9SxTGwgU=" + }, + "bluebird": { + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", + "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==" + }, + "bn.js": { + "version": "4.11.8", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + }, + "browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "requires": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "browserify-cipher": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", + "requires": { + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" + } + }, + "browserify-des": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.1.tgz", + "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", + "requires": { + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "browserify-rsa": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/browserify-rsa/-/browserify-rsa-4.0.1.tgz", + "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", + "requires": { + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" + } + }, + "browserify-sign": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/browserify-sign/-/browserify-sign-4.0.4.tgz", + "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", + "requires": { + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" + } + }, + "browserify-zlib": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/browserify-zlib/-/browserify-zlib-0.2.0.tgz", + "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", + "requires": { + "pako": "~1.0.5" + } + }, + "browserslist": { + "version": "3.2.8", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-3.2.8.tgz", + "integrity": "sha512-WHVocJYavUwVgVViC0ORikPHQquXwVh939TaelZ4WDqpWgTX/FsGhl/+P4qBUAGcRvtOgDgC+xftNWWp2RUTAQ==", + "requires": { + "caniuse-lite": "^1.0.30000844", + "electron-to-chromium": "^1.3.47" + } + }, + "buffer": { + "version": "4.9.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.1.tgz", + "integrity": "sha1-bRu2AbB6TvztlwlBMgkwJ8lbwpg=", + "requires": { + "base64-js": "^1.0.2", + "ieee754": "^1.1.4", + "isarray": "^1.0.0" + } + }, + "buffer-from": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.0.tgz", + "integrity": "sha512-c5mRlguI/Pe2dSZmpER62rSCu0ryKmWddzRYsuXc50U2/g8jMOulc31VZMa4mYx31U5xsmSOpDCgH88Vl9cDGQ==" + }, + "buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + }, + "builtin-status-codes": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz", + "integrity": "sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=" + }, + "cacache": { + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-10.0.4.tgz", + "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", + "requires": { + "bluebird": "^3.5.1", + "chownr": "^1.0.1", + "glob": "^7.1.2", + "graceful-fs": "^4.1.11", + "lru-cache": "^4.1.1", + "mississippi": "^2.0.0", + "mkdirp": "^0.5.1", + "move-concurrently": "^1.0.1", + "promise-inflight": "^1.0.1", + "rimraf": "^2.6.2", + "ssri": "^5.2.4", + "unique-filename": "^1.1.0", + "y18n": "^4.0.0" + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=" + }, + "caniuse-lite": { + "version": "1.0.30000856", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000856.tgz", + "integrity": "sha512-x3mYcApHMQemyaHuH/RyqtKCGIYTgEA63fdi+VBvDz8xUSmRiVWTLeyKcoGQCGG6UPR9/+4qG4OKrTa6aSQRKg==" + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "chardet": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.5.0.tgz", + "integrity": "sha512-9ZTaoBaePSCFvNlNGrsyI8ZVACP2svUtq0DkM7t4K2ClAa96sqOIRjAzDTc8zXzFt1cZR46rRzLTiHFSJ+Qw0g==" + }, + "chokidar": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.0.3.tgz", + "integrity": "sha512-zW8iXYZtXMx4kux/nuZVXjkLP+CyIK5Al5FHnj1OgTKGZfp4Oy6/ymtMSKFv3GD8DviEmUPmJg9eFdJ/JzudMg==", + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.0", + "braces": "^2.3.0", + "fsevents": "^1.1.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.1", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^2.1.1", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.0.0", + "upath": "^1.0.0" + } + }, + "chownr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.0.1.tgz", + "integrity": "sha1-4qdQQqlVGQi+vSW4Uj1fl2nXkYE=" + }, + "chrome-trace-event": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chrome-trace-event/-/chrome-trace-event-1.0.0.tgz", + "integrity": "sha512-xDbVgyfDTT2piup/h8dK/y4QZfJRSa73bw1WZ8b4XM1o7fsFubUVGYcE+1ANtOzJJELGpYoG2961z0Z6OAld9A==", + "requires": { + "tslib": "^1.9.0" + } + }, + "cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "requires": { + "restore-cursor": "^2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" + }, + "cliui": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", + "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "requires": { + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, + "color-convert": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", + "requires": { + "color-name": "1.1.1" + } + }, + "color-name": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=" + }, + "commander": { + "version": "2.13.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", + "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==" + }, + "commondir": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + }, + "concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "requires": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "console-browserify": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-browserify/-/console-browserify-1.1.0.tgz", + "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", + "requires": { + "date-now": "^0.1.4" + } + }, + "constants-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/constants-browserify/-/constants-browserify-1.0.0.tgz", + "integrity": "sha1-wguW2MYXdIqvHBYCF2DNJ/y4y3U=" + }, + "convert-source-map": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.5.1.tgz", + "integrity": "sha1-uCeAl7m8IpNl3lxiz1/K7YtVmeU=" + }, + "copy-concurrently": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/copy-concurrently/-/copy-concurrently-1.0.5.tgz", + "integrity": "sha512-f2domd9fsVDFtaFcbaRZuYXwtdmnzqbADSwhSWYxYB/Q8zsdUUFMXVRwXGDMWmbEzAn1kdRrtI1T/KTFOL4X2A==", + "requires": { + "aproba": "^1.1.1", + "fs-write-stream-atomic": "^1.0.8", + "iferr": "^0.1.5", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.0" + } + }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-js": { + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.5.7.tgz", + "integrity": "sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw==" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "create-ecdh": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.3.tgz", + "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", + "requires": { + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" + } + }, + "create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "requires": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "requires": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "requires": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-browserify": { + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/crypto-browserify/-/crypto-browserify-3.12.0.tgz", + "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", + "requires": { + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" + } + }, + "cyclist": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/cyclist/-/cyclist-0.2.2.tgz", + "integrity": "sha1-GzN5LhHpFKL9bW7WRHRkRE5fpkA=" + }, + "date-now": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz", + "integrity": "sha1-6vQ5/U1ISK105cx9vvIAZyueNFs=" + }, + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "define-properties": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.2.tgz", + "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", + "requires": { + "foreach": "^2.0.5", + "object-keys": "^1.0.8" + } + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "des.js": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/des.js/-/des.js-1.0.0.tgz", + "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", + "requires": { + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" + } + }, + "diffie-hellman": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/diffie-hellman/-/diffie-hellman-5.0.3.tgz", + "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", + "requires": { + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" + } + }, + "domain-browser": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/domain-browser/-/domain-browser-1.2.0.tgz", + "integrity": "sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==" + }, + "duplexify": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz", + "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", + "requires": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "electron-to-chromium": { + "version": "1.3.48", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.48.tgz", + "integrity": "sha1-07DYWTgUBE4JLs4hCPw6ya6kuQA=" + }, + "elliptic": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.0.tgz", + "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" + } + }, + "emojis-list": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", + "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=" + }, + "end-of-stream": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "requires": { + "once": "^1.4.0" + } + }, + "enhanced-resolve": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-4.0.0.tgz", + "integrity": "sha512-jox/62b2GofV1qTUQTMPEJSDIGycS43evqYzD/KVtEb9OCoki9cnacUPxCrZa7JfPzZSYOCZhu9O9luaMxAX8g==", + "requires": { + "graceful-fs": "^4.1.2", + "memory-fs": "^0.4.0", + "tapable": "^1.0.0" + } + }, + "errno": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", + "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", + "requires": { + "prr": "~1.0.1" + } + }, + "es-abstract": { + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", + "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.1.1.tgz", + "integrity": "sha1-RTVSSKiJeQNLZ5Lhm7gfK3l13Q0=", + "requires": { + "is-callable": "^1.1.1", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.1" + } + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "requires": { + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "requires": { + "estraverse": "^4.1.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=" + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=" + }, + "events": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz", + "integrity": "sha1-nr23Y1rQmccNzEwqH1AEKI6L2SQ=" + }, + "evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "requires": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + } + } + }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "external-editor": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.0.tgz", + "integrity": "sha512-mpkfj0FEdxrIhOC04zk85X7StNtr0yXnG7zCb+8ikO8OJi2jsHh5YGoknNTyXgsbHOf1WOOcVU3kPFWT2WgCkQ==", + "requires": { + "chardet": "^0.5.0", + "iconv-lite": "^0.4.22", + "tmp": "^0.0.33" + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "find-cache-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", + "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", + "requires": { + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^2.0.0" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "requires": { + "locate-path": "^2.0.0" + } + }, + "flarum-webpack-config": { + "version": "0.1.0-beta.8", + "resolved": "https://registry.npmjs.org/flarum-webpack-config/-/flarum-webpack-config-0.1.0-beta.8.tgz", + "integrity": "sha512-KRYrD2UIgv7HAETv3H6EPnj9rafQ5N1AYmHlKTH/cibjYBK65QItr49v5zADT3xjGwZBLGlTsV/bnLqrCrD+NA==", + "requires": { + "@babel/core": "^7.0.0-beta.39", + "@babel/plugin-proposal-class-properties": "^7.0.0-beta.39", + "@babel/plugin-transform-react-jsx": "^7.0.0-beta.39", + "@babel/plugin-transform-runtime": "^7.0.0-beta.39", + "@babel/preset-env": "^7.0.0-beta.39", + "@babel/preset-react": "^7.0.0-beta.39", + "@babel/runtime": "^7.0.0-beta.39", + "babel-loader": "^8.0.0-beta.0" + } + }, + "flush-write-stream": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/flush-write-stream/-/flush-write-stream-1.0.3.tgz", + "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "foreach": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/foreach/-/foreach-2.0.5.tgz", + "integrity": "sha1-C+4AUBiusmDQo6865ljdATbsG5k=" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" + } + }, + "from2": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/from2/-/from2-2.3.0.tgz", + "integrity": "sha1-i/tVAr3kpNNs/e6gB/zKIdfjgq8=", + "requires": { + "inherits": "^2.0.1", + "readable-stream": "^2.0.0" + } + }, + "fs-write-stream-atomic": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", + "requires": { + "graceful-fs": "^4.1.2", + "iferr": "^0.1.5", + "imurmurhash": "^0.1.4", + "readable-stream": "1 || 2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + }, + "fsevents": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.4.tgz", + "integrity": "sha512-z8H8/diyk76B7q5wg+Ud0+CqzcAF3mBBI/bA5ne5zrRUUIvNkJY//D3BqyH571KuAC4Nr7Rw7CjWX4r0y9DvNg==", + "optional": true, + "requires": { + "nan": "^2.9.2", + "node-pre-gyp": "^0.10.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.4", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "2.6.9", + "bundled": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "deep-extend": { + "version": "0.5.1", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.2", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.21", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": "^2.1.0" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true + }, + "minipass": { + "version": "2.2.4", + "bundled": true, + "requires": { + "safe-buffer": "^5.1.1", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.1.0", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.2.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^2.1.2", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.10.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.1.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.1.10", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.7", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.5.1", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.2", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.0.5" + } + }, + "safe-buffer": { + "version": "5.1.1", + "bundled": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.5.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.1", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.0.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.2.4", + "minizlib": "^1.1.0", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.1", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.2", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true + }, + "yallist": { + "version": "3.0.2", + "bundled": true + } + } + }, + "function-bind": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==" + }, + "get-caller-file": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", + "integrity": "sha1-9wLmMSfn4jHBYKgMFVSstw1QR+U=" + }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=" + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + }, + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "global-modules-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/global-modules-path/-/global-modules-path-2.1.0.tgz", + "integrity": "sha512-3DrmGj2TP+96cABk9TfMp6f3knH/Y46dqvWznTU3Tf6/bDGLDAn15tFluQ7BcloykOcdY16U0WGq0BQblYOxJQ==" + }, + "globals": { + "version": "11.5.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", + "integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==" + }, + "graceful-fs": { + "version": "4.1.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", + "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "requires": { + "function-bind": "^1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "hash-base": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "hash.js": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.4.tgz", + "integrity": "sha512-A6RlQvvZEtFS5fLU43IDu0QUmBy+fDO9VMdTXvufKwIkt/rFfvICAViCax5fbDO4zdNzaC3/27ZhKUok5bAJyw==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "requires": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "https-browserify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/https-browserify/-/https-browserify-1.0.0.tgz", + "integrity": "sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM=" + }, + "iconv-lite": { + "version": "0.4.23", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz", + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==", + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ieee754": { + "version": "1.1.12", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.12.tgz", + "integrity": "sha512-GguP+DRY+pJ3soyIiGPTvdiVXjZ+DbXOxGpXn3eMvNW4x4irjqXm4wHKscC+TfxSJ0yw/S1F24tqdMNsMZTiLA==" + }, + "iferr": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz", + "integrity": "sha1-xg7taebY/bazEEofy8ocGS3FtQE=" + }, + "import-local": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-1.0.0.tgz", + "integrity": "sha512-vAaZHieK9qjGo58agRBg+bhHX3hoTZU/Oa3GESWLz7t1U62fk63aHuDJJEteXoDeTCcPmUT+z38gkHPZkkmpmQ==", + "requires": { + "pkg-dir": "^2.0.0", + "resolve-cwd": "^2.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "indexof": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + }, + "inquirer": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.0.0.tgz", + "integrity": "sha512-tISQWRwtcAgrz+SHPhTH7d3e73k31gsOy6i1csonLc0u1dVK/wYvuOnFeiWqC5OXFIYbmrIFInef31wbT8MEJg==", + "requires": { + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.0", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.0", + "figures": "^2.0.0", + "lodash": "^4.3.0", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.1.0", + "string-width": "^2.1.0", + "strip-ansi": "^4.0.0", + "through": "^2.3.6" + } + }, + "interpret": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.1.0.tgz", + "integrity": "sha1-ftGxQQxqDg94z5XTuEQMY/eLhhQ=" + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "requires": { + "loose-envify": "^1.0.0" + } + }, + "invert-kv": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", + "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" + }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-callable": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.3.tgz", + "integrity": "sha1-hut1OSgF3cM69xySoO7fdO52BLI=" + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } + } + }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=" + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + }, + "is-glob": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.0.tgz", + "integrity": "sha1-lSHHaEXMJhCoUgPd8ICpWML/q8A=", + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-odd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-odd/-/is-odd-2.0.0.tgz", + "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", + "requires": { + "is-number": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-4.0.0.tgz", + "integrity": "sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==" + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "requires": { + "has": "^1.0.1" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-symbol": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.1.tgz", + "integrity": "sha1-PMWfAAJRlLarLjjbrmaJJWtmBXI=" + }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, + "js-levenshtein": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/js-levenshtein/-/js-levenshtein-1.1.3.tgz", + "integrity": "sha512-/812MXr9RBtMObviZ8gQBhHO8MOrGj8HlEE+4ccMTElNA/6I3u39u+bhny55Lk921yn44nSZFy9naNLElL5wgQ==" + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" + }, + "jsesc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.1.tgz", + "integrity": "sha1-5CGiqOINawgZ3yiQj3glJrlt0f4=" + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==" + }, + "json5": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", + "integrity": "sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=" + }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, + "lcid": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", + "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", + "requires": { + "invert-kv": "^1.0.0" + } + }, + "leb": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/leb/-/leb-0.3.0.tgz", + "integrity": "sha1-Mr7p+tFoMo1q6oUi2DP0GA7tHaM=" + }, + "loader-runner": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/loader-runner/-/loader-runner-2.3.0.tgz", + "integrity": "sha1-9IKuqC1UPgeSFwDVpG7yb9rGuKI=" + }, + "loader-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.1.0.tgz", + "integrity": "sha1-yYrvSIvM7aL/teLeZG1qdUQp9c0=", + "requires": { + "big.js": "^3.1.3", + "emojis-list": "^2.0.0", + "json5": "^0.5.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "requires": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "long": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/long/-/long-3.2.0.tgz", + "integrity": "sha1-2CG3E4yhy1gcFymQ7xTbIAtcR0s=" + }, + "loose-envify": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.3.1.tgz", + "integrity": "sha1-0aitM/qc4OcT1l/dCsi3SNR4yEg=", + "requires": { + "js-tokens": "^3.0.0" + } + }, + "lru-cache": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.3.tgz", + "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "requires": { + "pify": "^3.0.0" + } + }, + "mamacro": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/mamacro/-/mamacro-0.0.3.tgz", + "integrity": "sha512-qMEwh+UujcQ+kbz3T6V+wAmO2U8veoq2w+3wY8MquqwVA3jChfwY+Tk52GZKDfACEPjuZ7r2oJLejwpt8jtwTA==" + }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, + "md5.js": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.4.tgz", + "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "mem": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-1.1.0.tgz", + "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "memory-fs": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/memory-fs/-/memory-fs-0.4.1.tgz", + "integrity": "sha1-OpoguEYlI+RHz7x+i7gO1me/xVI=", + "requires": { + "errno": "^0.1.3", + "readable-stream": "^2.0.1" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "miller-rabin": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", + "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", + "requires": { + "bn.js": "^4.0.0", + "brorand": "^1.0.1" + } + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + }, + "minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + }, + "minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + }, + "mississippi": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mississippi/-/mississippi-2.0.0.tgz", + "integrity": "sha512-zHo8v+otD1J10j/tC+VNoGK9keCuByhKovAvdn74dmxJl9+mWHnx6EMsDN4lgRoMI/eYo2nchAxniIbUPb5onw==", + "requires": { + "concat-stream": "^1.5.0", + "duplexify": "^3.4.2", + "end-of-stream": "^1.1.0", + "flush-write-stream": "^1.0.0", + "from2": "^2.1.0", + "parallel-transform": "^1.1.0", + "pump": "^2.0.1", + "pumpify": "^1.3.3", + "stream-each": "^1.1.0", + "through2": "^2.0.0" + } + }, + "mixin-deep": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.1.tgz", + "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "requires": { + "minimist": "0.0.8" + } + }, + "move-concurrently": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", + "requires": { + "aproba": "^1.1.1", + "copy-concurrently": "^1.0.0", + "fs-write-stream-atomic": "^1.0.8", + "mkdirp": "^0.5.1", + "rimraf": "^2.5.4", + "run-queue": "^1.0.3" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=" + }, + "nan": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.10.0.tgz", + "integrity": "sha512-bAdJv7fBLhWC+/Bls0Oza+mvTaNQtP+1RyhhhvD95pgUJz6XM5IzgmxOkItJ9tkoCiplvAnXI1tNmmUD/eScyA==", + "optional": true + }, + "nanomatch": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.9.tgz", + "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, + "neo-async": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.5.1.tgz", + "integrity": "sha512-3KL3fvuRkZ7s4IFOMfztb7zJp3QaVWnBeGoJlgB38XnCRPj/0tLzzLG5IB8NYOHbJ8g8UGrgZv44GLDk6CxTxA==" + }, + "nice-try": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.4.tgz", + "integrity": "sha512-2NpiFHqC87y/zFke0fC0spBXL3bBsoh/p5H1EFhshxjCR5+0g2d6BiXbUFz9v1sAcxsk2htp2eQnNIci2dIYcA==" + }, + "node-libs-browser": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/node-libs-browser/-/node-libs-browser-2.1.0.tgz", + "integrity": "sha512-5AzFzdoIMb89hBGMZglEegffzgRg+ZFoUmisQ8HI4j1KDdpx13J0taNp2y9xPbur6W61gepGDDotGBVQ7mfUCg==", + "requires": { + "assert": "^1.1.1", + "browserify-zlib": "^0.2.0", + "buffer": "^4.3.0", + "console-browserify": "^1.1.0", + "constants-browserify": "^1.0.0", + "crypto-browserify": "^3.11.0", + "domain-browser": "^1.1.1", + "events": "^1.0.0", + "https-browserify": "^1.0.0", + "os-browserify": "^0.3.0", + "path-browserify": "0.0.0", + "process": "^0.11.10", + "punycode": "^1.2.4", + "querystring-es3": "^0.2.0", + "readable-stream": "^2.3.3", + "stream-browserify": "^2.0.1", + "stream-http": "^2.7.2", + "string_decoder": "^1.0.0", + "timers-browserify": "^2.0.4", + "tty-browserify": "0.0.0", + "url": "^0.11.0", + "util": "^0.10.3", + "vm-browserify": "0.0.4" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + } + } + }, + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "requires": { + "path-key": "^2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-keys": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.11.tgz", + "integrity": "sha1-xUYBd4rVYPEULODgG8yotW0TQm0=" + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + } + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz", + "integrity": "sha1-h1jIRvW0B62rDyNuCYbxSwUcqhY=", + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "requires": { + "wrappy": "1" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "requires": { + "mimic-fn": "^1.0.0" + } + }, + "os-browserify": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/os-browserify/-/os-browserify-0.3.0.tgz", + "integrity": "sha1-hUNzx/XCMVkU/Jv8a9gjj92h7Cc=" + }, + "os-locale": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-2.1.0.tgz", + "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", + "requires": { + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "requires": { + "p-try": "^1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "requires": { + "p-limit": "^1.1.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=" + }, + "pako": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.6.tgz", + "integrity": "sha512-lQe48YPsMJAig+yngZ87Lus+NF+3mtu7DVOBu6b/gHO1YpKwIj5AWjZ/TOS7i46HD/UixzWb1zeWDZfGZ3iYcg==" + }, + "parallel-transform": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/parallel-transform/-/parallel-transform-1.1.0.tgz", + "integrity": "sha1-1BDwZbBdojCB/NEPKIVMKb2jOwY=", + "requires": { + "cyclist": "~0.2.2", + "inherits": "^2.0.3", + "readable-stream": "^2.1.5" + } + }, + "parse-asn1": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/parse-asn1/-/parse-asn1-5.1.1.tgz", + "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", + "requires": { + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" + } + }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", + "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + }, + "path-parse": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.5.tgz", + "integrity": "sha1-PBrfhx6pzWyUMbbqK9dKD/BVxME=" + }, + "pbkdf2": { + "version": "3.0.16", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.0.16.tgz", + "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", + "requires": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "requires": { + "find-up": "^2.1.0" + } + }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "private": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/private/-/private-0.1.8.tgz", + "integrity": "sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg==" + }, + "process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha1-czIwDoQBYb2j5podHZGn1LwW8YI=" + }, + "process-nextick-args": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", + "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" + }, + "promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" + }, + "prr": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + }, + "public-encrypt": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/public-encrypt/-/public-encrypt-4.0.2.tgz", + "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", + "requires": { + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" + } + }, + "pump": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pump/-/pump-2.0.1.tgz", + "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "pumpify": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/pumpify/-/pumpify-1.5.1.tgz", + "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", + "requires": { + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" + } + }, + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==" + }, + "querystring": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz", + "integrity": "sha1-sgmEkgO7Jd+CDadW50cAWHhSFiA=" + }, + "querystring-es3": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/querystring-es3/-/querystring-es3-0.2.1.tgz", + "integrity": "sha1-nsYfeQSYdXB9aUFFlv2Qek1xHnM=" + }, + "randombytes": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.0.6.tgz", + "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", + "requires": { + "safe-buffer": "^5.1.0" + } + }, + "randomfill": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/randomfill/-/randomfill-1.0.4.tgz", + "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", + "requires": { + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" + } + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.1.0.tgz", + "integrity": "sha1-TtCtBg3zBzMAxIRANz9y0cxkLXg=", + "requires": { + "graceful-fs": "^4.1.2", + "minimatch": "^3.0.2", + "readable-stream": "^2.0.2", + "set-immediate-shim": "^1.0.1" + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==" + }, + "regenerate-unicode-properties": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-7.0.0.tgz", + "integrity": "sha512-s5NGghCE4itSlUS+0WUj88G6cfMVMmH8boTPNvABf8od+2dhT9WDlWu8n01raQAJZMOK8Ch6jSexaRO7swd6aw==", + "requires": { + "regenerate": "^1.4.0" + } + }, + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==" + }, + "regenerator-transform": { + "version": "0.12.4", + "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.12.4.tgz", + "integrity": "sha512-p2I0fY+TbSLD2/VFTFb/ypEHxs3e3AjU0DzttdPqk2bSmDhfSh5E54b86Yc6XhUa5KykK1tgbvZ4Nr82oCJWkQ==", + "requires": { + "private": "^0.1.6" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, + "regexpu-core": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.2.0.tgz", + "integrity": "sha512-Z835VSnJJ46CNBttalHD/dB+Sj2ezmY6Xp38npwU87peK6mqOzOpV8eYktdkLTEkzzD+JsTcxd84ozd8I14+rw==", + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^7.0.0", + "regjsgen": "^0.4.0", + "regjsparser": "^0.3.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.0.2" + } + }, + "regjsgen": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.4.0.tgz", + "integrity": "sha512-X51Lte1gCYUdlwhF28+2YMO0U6WeN0GLpgpA7LK7mbdDnkQYiwvEpmpe0F/cv5L14EbxgrdayAG3JETBv0dbXA==" + }, + "regjsparser": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.3.0.tgz", + "integrity": "sha512-zza72oZBBHzt64G7DxdqrOo/30bhHkwMUoT0WqfGu98XLd7N+1tsy5MJ96Bk4MD0y74n629RhmrGW6XlnLLwCA==", + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=" + } + } + }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.2.tgz", + "integrity": "sha1-7wiaF40Ug7quTZPrmLT55OEdmQo=" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + }, + "resolve": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.0.tgz", + "integrity": "sha512-MNcwJ8/K9iJqFDBDyhcxZuDWvf/ai0GcAJWetx2Cvvcz4HLfA8j0KasWR5Z6ChcbjYZ+FaczcXjN2jrCXCjQ4w==", + "requires": { + "path-parse": "^1.0.5" + } + }, + "resolve-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-2.0.0.tgz", + "integrity": "sha1-AKn3OHVW4nA46uIyyqNypqWbZlo=", + "requires": { + "resolve-from": "^3.0.0" + } + }, + "resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha1-six699nWiBvItuZTM17rywoYh0g=" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", + "requires": { + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" + } + }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, + "rimraf": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.2.tgz", + "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", + "requires": { + "glob": "^7.0.5" + } + }, + "ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "requires": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "requires": { + "is-promise": "^2.1.0" + } + }, + "run-queue": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/run-queue/-/run-queue-1.0.3.tgz", + "integrity": "sha1-6Eg5bwV9Ij8kOGkkYY4laUFh7Ec=", + "requires": { + "aproba": "^1.1.1" + } + }, + "rxjs": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.2.1.tgz", + "integrity": "sha512-OwMxHxmnmHTUpgO+V7dZChf3Tixf4ih95cmXjzzadULziVl/FKhHScGLj4goEw9weePVOH2Q0+GcCBUhKCZc/g==", + "requires": { + "tslib": "^1.9.0" + } + }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + }, + "schema-utils": { + "version": "0.4.5", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.5.tgz", + "integrity": "sha512-yYrjb9TX2k/J1Y5UNy3KYdZq10xhYcF8nMpAW6o3hy6Q8WSIEf9lJHG/ePnOBfziPM3fvQwfOwa13U/Fh8qTfA==", + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + }, + "semver": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.5.0.tgz", + "integrity": "sha512-4SJ3dm0WAwWy/NVeioZh5AntkdJoWKxHxcmyP622fOkgHa4z3R0TdBJICINyaSDE6uNwVc8gZr+ZinwZAH4xIA==" + }, + "serialize-javascript": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.5.0.tgz", + "integrity": "sha512-Ga8c8NjAAp46Br4+0oZ2WxJCwIzwP60Gq1YPgU+39PiTVxyed/iKE/zyZI6+UlVYH5Q4PaQdHhcegIFPZTUfoQ==" + }, + "set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + }, + "set-immediate-shim": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", + "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=" + }, + "set-value": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.0.tgz", + "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" + }, + "sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "requires": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "requires": { + "shebang-regex": "^1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-list-map": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/source-list-map/-/source-list-map-2.0.0.tgz", + "integrity": "sha512-I2UmuJSRr/T8jisiROLU3A3ltr+swpniSmNPI4Ml3ZCX6tVnDsuZzK7F2hl5jTqbZBWCEKlj5HRQiPExXLgE8A==" + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "ssri": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-5.3.0.tgz", + "integrity": "sha512-XRSIPqLij52MtgoQavH/x/dU1qVKtWUAAZeOHsR9c2Ddi4XerFy3mc1alf+dLJKl9EUIm/Ht+EowFkTUOA6GAQ==", + "requires": { + "safe-buffer": "^5.1.1" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, + "stream-browserify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.1.tgz", + "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", + "requires": { + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" + } + }, + "stream-each": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/stream-each/-/stream-each-1.2.2.tgz", + "integrity": "sha512-mc1dbFhGBxvTM3bIWmAAINbqiuAk9TATcfIQC8P+/+HJefgaiTlMn2dHvkX8qlI12KeYKSQ1Ua9RrIqrn1VPoA==", + "requires": { + "end-of-stream": "^1.1.0", + "stream-shift": "^1.0.0" + } + }, + "stream-http": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/stream-http/-/stream-http-2.8.3.tgz", + "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", + "requires": { + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" + } + }, + "stream-shift": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.0.tgz", + "integrity": "sha1-1cdSgl5TZ+eG944Y5EXqIjoVWVI=" + }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "requires": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "requires": { + "ansi-regex": "^3.0.0" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + }, + "supports-color": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "tapable": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.0.0.tgz", + "integrity": "sha512-dQRhbNQkRnaqauC7WqSJ21EEksgT0fYZX2lqXzGkpo8JNig9zGZTYoMGvyI2nWmXlE2VSVXVDu7wLVGu/mQEsg==" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "through2": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.3.tgz", + "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", + "requires": { + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" + } + }, + "timers-browserify": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/timers-browserify/-/timers-browserify-2.0.10.tgz", + "integrity": "sha512-YvC1SV1XdOUaL6gx5CoGroT3Gu49pK9+TZ38ErPldOWW4j49GI1HKs9DV+KGq/w6y+LZ72W1c8cKz2vzY+qpzg==", + "requires": { + "setimmediate": "^1.0.4" + } + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, + "to-arraybuffer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=" + }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" + }, + "tslib": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz", + "integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==" + }, + "tty-browserify": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/tty-browserify/-/tty-browserify-0.0.0.tgz", + "integrity": "sha1-oVe6QC2iTpv5V/mqadUk7tQpAaY=" + }, + "typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + }, + "uglify-es": { + "version": "3.3.9", + "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", + "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", + "requires": { + "commander": "~2.13.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "uglifyjs-webpack-plugin": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/uglifyjs-webpack-plugin/-/uglifyjs-webpack-plugin-1.2.5.tgz", + "integrity": "sha512-hIQJ1yxAPhEA2yW/i7Fr+SXZVMp+VEI3d42RTHBgQd2yhp/1UdBcR3QEWPV5ahBxlqQDMEMTuTEvDHSFINfwSw==", + "requires": { + "cacache": "^10.0.4", + "find-cache-dir": "^1.0.0", + "schema-utils": "^0.4.5", + "serialize-javascript": "^1.4.0", + "source-map": "^0.6.1", + "uglify-es": "^3.3.4", + "webpack-sources": "^1.1.0", + "worker-farm": "^1.5.2" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.0.2.tgz", + "integrity": "sha512-Rx7yODZC1L/T8XKo/2kNzVAQaRE88AaMvI1EF/Xnj3GW2wzN6fop9DDWuFAKUVFH7vozkz26DzP0qyWLKLIVPQ==" + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.4.tgz", + "integrity": "sha512-2WSLa6OdYd2ng8oqiGIWnJqyFArvhn+5vgx5GTxMbUYjCYKUcuKS62YLFF0R/BDGlB1yzXjQOLtPAfHsgirEpg==" + }, + "union-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", + "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "set-value": { + "version": "0.4.3", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-0.4.3.tgz", + "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" + } + } + } + }, + "unique-filename": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.0.tgz", + "integrity": "sha1-0F8v5AMlYIcfMOk8vnNe6iAVFPM=", + "requires": { + "unique-slug": "^2.0.0" + } + }, + "unique-slug": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz", + "integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=", + "requires": { + "imurmurhash": "^0.1.4" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "upath": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.1.0.tgz", + "integrity": "sha512-bzpH/oBhoS/QI/YtbkqCg6VEiPYjSZtrHQM6/QnJS6OL9pKUFLqb3aFh4Scvwm45+7iAgiMkLhSbaZxUqmrprw==" + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "requires": { + "punycode": "^2.1.0" + } + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "url": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/url/-/url-0.11.0.tgz", + "integrity": "sha1-ODjpfPxgUh63PFJajlW/3Z4uKPE=", + "requires": { + "punycode": "1.3.2", + "querystring": "0.2.0" + }, + "dependencies": { + "punycode": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz", + "integrity": "sha1-llOgNvt8HuQjQvIyXM7v6jkmxI0=" + } + } + }, + "use": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.0.tgz", + "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", + "requires": { + "kind-of": "^6.0.2" + } + }, + "util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/util/-/util-0.10.4.tgz", + "integrity": "sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A==", + "requires": { + "inherits": "2.0.3" + } + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, + "util.promisify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/util.promisify/-/util.promisify-1.0.0.tgz", + "integrity": "sha512-i+6qA2MPhvoKLuxnJNpXAGhg7HphQOSUq2LKMZD0m15EiskXUkMvKdF4Uui0WYeCUGea+o2cw/ZuwehtfsrNkA==", + "requires": { + "define-properties": "^1.1.2", + "object.getownpropertydescriptors": "^2.0.3" + } + }, + "v8-compile-cache": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.0.0.tgz", + "integrity": "sha512-qNdTUMaCjPs4eEnM3W9H94R3sU70YCuT+/ST7nUf+id1bVOrdjrpUaeZLqPBPRph3hsgn4a4BvwpxhHZx+oSDg==" + }, + "vm-browserify": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-0.0.4.tgz", + "integrity": "sha1-XX6kW7755Kb/ZflUOOCofDV9WnM=", + "requires": { + "indexof": "0.0.1" + } + }, + "watchpack": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-1.6.0.tgz", + "integrity": "sha512-i6dHe3EyLjMmDlU1/bGQpEw25XSjkJULPuAVKCbNRefQVq48yXKUpwg538F7AZTf9kyr57zj++pQFltUa5H7yA==", + "requires": { + "chokidar": "^2.0.2", + "graceful-fs": "^4.1.2", + "neo-async": "^2.5.0" + } + }, + "webpack": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.12.0.tgz", + "integrity": "sha512-EJj2FfhgtjrTbJbJaNulcVpDxi9vsQVvTahHN7xJvIv6W+k4r/E6Hxy4eyOrj+IAFWqYgaUtnpxmSGYP8MSZJw==", + "requires": { + "@webassemblyjs/ast": "1.5.12", + "@webassemblyjs/helper-module-context": "1.5.12", + "@webassemblyjs/wasm-edit": "1.5.12", + "@webassemblyjs/wasm-opt": "1.5.12", + "@webassemblyjs/wasm-parser": "1.5.12", + "acorn": "^5.6.2", + "acorn-dynamic-import": "^3.0.0", + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0", + "chrome-trace-event": "^1.0.0", + "enhanced-resolve": "^4.0.0", + "eslint-scope": "^3.7.1", + "json-parse-better-errors": "^1.0.2", + "loader-runner": "^2.3.0", + "loader-utils": "^1.1.0", + "memory-fs": "~0.4.1", + "micromatch": "^3.1.8", + "mkdirp": "~0.5.0", + "neo-async": "^2.5.0", + "node-libs-browser": "^2.0.0", + "schema-utils": "^0.4.4", + "tapable": "^1.0.0", + "uglifyjs-webpack-plugin": "^1.2.4", + "watchpack": "^1.5.0", + "webpack-sources": "^1.0.1" + } + }, + "webpack-cli": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.0.8.tgz", + "integrity": "sha512-KnRLJ0BUaYRqrhAMb9dv3gzdmhmgIMKo0FmdsnmfqbPGtLnnZ6tORZAvmmKfr+A0VgiVpqC60Gv7Ofg0R2CHtQ==", + "requires": { + "chalk": "^2.4.1", + "cross-spawn": "^6.0.5", + "enhanced-resolve": "^4.0.0", + "global-modules-path": "^2.1.0", + "import-local": "^1.0.0", + "inquirer": "^6.0.0", + "interpret": "^1.1.0", + "loader-utils": "^1.1.0", + "supports-color": "^5.4.0", + "v8-compile-cache": "^2.0.0", + "yargs": "^11.1.0" + } + }, + "webpack-sources": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/webpack-sources/-/webpack-sources-1.1.0.tgz", + "integrity": "sha512-aqYp18kPphgoO5c/+NaUvEeACtZjMESmDChuD3NBciVpah3XpMEU9VAAtIaB1BsfJWWTSdv8Vv1m3T0aRk2dUw==", + "requires": { + "source-list-map": "^2.0.0", + "source-map": "~0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + } + } + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "requires": { + "isexe": "^2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + }, + "worker-farm": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/worker-farm/-/worker-farm-1.6.0.tgz", + "integrity": "sha512-6w+3tHbM87WnSWnENBUvA2pxJPLhQUg5LKwUQHq3r+XPhIM+Gh2R5ycbwPCyuGbNg+lPgdcnQUhuC02kJCvffQ==", + "requires": { + "errno": "~0.1.7" + } + }, + "wrap-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", + "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "requires": { + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "requires": { + "ansi-regex": "^2.0.0" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + }, + "xtend": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz", + "integrity": "sha1-pcbVMr5lbiPbgg77lDofBJmNY68=" + }, + "y18n": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + }, + "yargs": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-11.1.0.tgz", + "integrity": "sha512-NwW69J42EsCSanF8kyn5upxvjp5ds+t3+udGBeTbFnERA+lF541DDpMawzo4z6W/QrzNM18D+BPMiOBibnFV5A==", + "requires": { + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" + }, + "dependencies": { + "y18n": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.1.tgz", + "integrity": "sha1-bRX7qITAhnnA136I53WegR4H+kE=" + } + } + }, + "yargs-parser": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-9.0.2.tgz", + "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", + "requires": { + "camelcase": "^4.1.0" + } + } + } +} diff --git a/extensions/sticky/js/package.json b/extensions/sticky/js/package.json new file mode 100644 index 000000000..c7d1af876 --- /dev/null +++ b/extensions/sticky/js/package.json @@ -0,0 +1,13 @@ +{ + "name": "@flarum/flarum-ext-sticky", + "version": "0.0.0", + "dependencies": { + "flarum-webpack-config": "^0.1.0-beta.8", + "webpack": "^4.0.0", + "webpack-cli": "^3.0.7" + }, + "scripts": { + "build": "webpack --mode production --progress", + "watch": "webpack --mode development --watch" + } +} diff --git a/extensions/sticky/js/admin/src/main.js b/extensions/sticky/js/src/admin/index.js similarity index 100% rename from extensions/sticky/js/admin/src/main.js rename to extensions/sticky/js/src/admin/index.js diff --git a/extensions/sticky/js/forum/src/addStickyBadge.js b/extensions/sticky/js/src/forum/addStickyBadge.js similarity index 100% rename from extensions/sticky/js/forum/src/addStickyBadge.js rename to extensions/sticky/js/src/forum/addStickyBadge.js diff --git a/extensions/sticky/js/forum/src/addStickyControl.js b/extensions/sticky/js/src/forum/addStickyControl.js similarity index 100% rename from extensions/sticky/js/forum/src/addStickyControl.js rename to extensions/sticky/js/src/forum/addStickyControl.js diff --git a/extensions/sticky/js/forum/src/addStickyExcerpt.js b/extensions/sticky/js/src/forum/addStickyExcerpt.js similarity index 100% rename from extensions/sticky/js/forum/src/addStickyExcerpt.js rename to extensions/sticky/js/src/forum/addStickyExcerpt.js diff --git a/extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js b/extensions/sticky/js/src/forum/components/DiscussionStickiedPost.js similarity index 100% rename from extensions/sticky/js/forum/src/components/DiscussionStickiedPost.js rename to extensions/sticky/js/src/forum/components/DiscussionStickiedPost.js diff --git a/extensions/sticky/js/forum/src/main.js b/extensions/sticky/js/src/forum/index.js similarity index 61% rename from extensions/sticky/js/forum/src/main.js rename to extensions/sticky/js/src/forum/index.js index 838e705f3..6981d26b4 100644 --- a/extensions/sticky/js/forum/src/main.js +++ b/extensions/sticky/js/src/forum/index.js @@ -2,10 +2,10 @@ import app from 'flarum/app'; import Model from 'flarum/Model'; import Discussion from 'flarum/models/Discussion'; -import DiscussionStickiedPost from 'flarum/sticky/components/DiscussionStickiedPost'; -import addStickyBadge from 'flarum/sticky/addStickyBadge'; -import addStickyControl from 'flarum/sticky/addStickyControl'; -import addStickyExcerpt from 'flarum/sticky/addStickyExcerpt'; +import DiscussionStickiedPost from './components/DiscussionStickiedPost'; +import addStickyBadge from './addStickyBadge'; +import addStickyControl from './addStickyControl'; +import addStickyExcerpt from './addStickyExcerpt'; app.initializers.add('flarum-sticky', () => { app.postComponents.discussionStickied = DiscussionStickiedPost; @@ -17,3 +17,4 @@ app.initializers.add('flarum-sticky', () => { addStickyControl(); addStickyExcerpt(); }); + diff --git a/extensions/sticky/js/webpack.config.js b/extensions/sticky/js/webpack.config.js new file mode 100644 index 000000000..fcfa77c92 --- /dev/null +++ b/extensions/sticky/js/webpack.config.js @@ -0,0 +1,3 @@ +const config = require('flarum-webpack-config'); + +module.exports = config(); diff --git a/extensions/sticky/less/forum/extension.less b/extensions/sticky/less/forum.less similarity index 100% rename from extensions/sticky/less/forum/extension.less rename to extensions/sticky/less/forum.less diff --git a/extensions/sticky/scripts/compile.sh b/extensions/sticky/scripts/compile.sh deleted file mode 100755 index b0d8e8bd3..000000000 --- a/extensions/sticky/scripts/compile.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/usr/bin/env bash - -# This script compiles the extension so that it can be used in a Flarum -# installation. It should be run from the root directory of the extension. - -base=$PWD - -cd "${base}/js" - -if [ -f bower.json ]; then - bower install -fi - -for app in forum admin; do - cd "${base}/js" - - if [ -d $app ]; then - cd $app - - if [ -f bower.json ]; then - bower install - fi - - npm install - gulp --production - fi -done From d7b0d5c42c1b49cba13c42ada047a8bed62b2a31 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 20 Jun 2018 13:54:01 +0930 Subject: [PATCH 096/183] Remove progress flag --- extensions/sticky/js/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/sticky/js/package.json b/extensions/sticky/js/package.json index c7d1af876..55749f1dd 100644 --- a/extensions/sticky/js/package.json +++ b/extensions/sticky/js/package.json @@ -7,7 +7,7 @@ "webpack-cli": "^3.0.7" }, "scripts": { - "build": "webpack --mode production --progress", + "build": "webpack --mode production", "watch": "webpack --mode development --watch" } } From c89b4f79f7971a5ae356a71cf7aa62cfb991e953 Mon Sep 17 00:00:00 2001 From: Toby Zerner Date: Wed, 20 Jun 2018 14:27:18 +0930 Subject: [PATCH 097/183] Fix Travis' deploy key --- extensions/sticky/.deploy.enc | Bin 3248 -> 3248 bytes 1 file changed, 0 insertions(+), 0 deletions(-) diff --git a/extensions/sticky/.deploy.enc b/extensions/sticky/.deploy.enc index cd42dd36baafb633d582f0289c0bf6a444b5911c..e28c8940cc84462963e5f2d2a7a6d37b5cfa405a 100644 GIT binary patch literal 3248 zcmV;h3{UeSYv4Iud9me{!PcrjJ7jZ?q-^wn`_D6mq%@Wm+%*yYSV9F8QOH)cLUg%7 z!ERct98Mk0-gY;k)_liD)ZE@8{z98eR9|`pn4`l4rgUpNhhN9tpXN||pG2F_ zsy1K_zGJL1^;WS*neiwPARt7C{}1 zMDf`_*0>z%${8w;;~Wfeq(%c$gpFQnWGau$++<{}{?9yE=2Hv_9H@d3zfGC_uwo+i z{7l>Iee1YwMo7zf+n~pFa~Lsb5i#Dk?fi_m=WCH8m0TIE*^4sFm~W=YIk~;V)qcJj zRuO(Hr;}@ee}8IUaT5VgW{Kv%Q;|uaFLzfO#J*V|!DTByes9M6nhVrInYi2(b-&(j z;wUW3?vYVCc2Rf~kR10k*ME%i53I#9lyF3YO|}V=Vv*1=s+jZn#`0lA{;b5Qq1N(4 zK9h(P{Av_RbN*=6 zS~SQD+YI$*Ulc*7RejBHG|HJ+f3r3VOJtWc#-%loM5XEb6 zT2?LP1-g8wU`LYRNTHRD<*KMZO^hsgb*s1rsv21ah_$o*0^Gx8X>j|B4vQ59ev~?%HXqf<7KBSwruUv zf&e+3tT1caR6~{{4E|g=%CN~DyPzE z?8vzd7OUu|Vj&Q9G6i+)BR^|oyv$^XkPK$2N_H7*qSBjfi$l*aFTI@_R>4^hE^2{lYLCPcsr8X(s0|qXE zu68yM##SJP=!1n!tPuviy-RMe!^yVU0WB~6lBK_~NfVJD?YSeMP>tae(nW1`zo0N_ zW)i$>j^7xxy@IZpd7~^8r`J$j-E#no;x9Ldjn^Pc90v0t28P+*(iEfoR)hXOK9p4y zxZOZSKX{oG38PSQs^a}m z4&Zo^)NV1&m(MgEj$N1{M$Wr8o?Q{3H8<{-DcH$O-4o31oUJxWJ~)i^U>-DHmlFrg}&C&P1IOC{E! zokeJRJKA_DNI8Nd48fix#hko~^!&i!KN3_pOEyWbfAd?6^V7D2rO~Eg5@Xj@F@<{b z@RA)gGUj{asHZq)WtU#pN_lR812jiHmhI}W0B9uGq~82E83xS7~5)2NI)UqA!n zCf{rbLuP|zCLnGSzlA+^-k)3hU}^t^B8p-zg(Ej(vZd&2f+V@r5KxwY(8?rCBvXV2b=g9xp#ryI+*vCI;V;pap)nR7TaMx-B+=b3%lZu#g<*?!)VsdCxSCxfwOLT@-oK|hfb#GS^f;&^E*_RPeNgKQo@kL^ zgFW(XOR?)MSUy`$X~blp`N0`#ydCl`$#`w~_nQ*-aeV?!v zDBS_qPNQ=?pW^O5rl&s;oj;9R;lL;yl57Yw#$eSAs^QEp`u7Q`X4 z*Gk{?#1qvWee`_+?j3zS^M+38(RQvC0J)jr2$X@xNOkSZ10Tl_V2fa?*n+Zp41iV+ zt<~FRE1LA)Nvn3WxKU;SwMeho*HaU@{U2Gu7P;2e#@8@xeSe z?3|oF7myNnZWia5XAQflG9~9vI1%8*37$u`Yw@sucaG7W%A<)A4luMYWS%lzou!Bbta!g(}o4 zk1`%?82mzQrtf*atY)=WUk*B-UMGk@03di;X)eWh*>5gzBdGz+98pqJj2S^$oc3k7 zEsPvR#}#s}zTLv-UihSaEhWU1YxcyU!c>6HI#~qy#qxtcr%L|B!3fIo8qk5G|Hx_6W?kYLr~@Pk3mkfU56cFw`K$Hv9gBG zWO1!XU%8q_3g;K^)zo0WC!^|)>Gi;aVCoi7_@IIrJtpj(i6$c_F5z;d~vP*a+8^HH6A z8Vy`#dv^5X?$N4pQ3Z$dT@!w}WqK(${mh!LYd%%HK%zti;69)x1zJ`C|&>UvvKw7O*4Hi@v|tDvV{|VoOI`!b%1ddkp(z$i@21~ z`Vb#S4f7cwcn#Wd4HI#Xx_{&10PRD(6j)c`8edJ85>_VG-L@KqUUJ%M%Ps*7zSV$X z8TYeRz7+sUO<<;z_w=K3e_v+(ZP9mz^e^nT<&-dGP7Lnlqr zyJ1xe-iP(CEf0mKyFPa#$x~rphfHQ?H5R=F_sj*hd?-s&yT^rZEPF$O{i>ltzaNRw z)tnpMtEs4y+1PH<-2){YjiIAD*xwBTJi6iL)N z_6ibTGTsJee@C%bUx+`tMCtVD`F%YGdO4_JvEdhXx%e%RpID~onBEZsHLCwm_!8-W z@lv1x>}=ok_+(?gdXokl;f#(c#UL+%AI-6I7D?DExw1{lIKI`rR`|859fEbbC~=)Y zw^L;u`k)yyI?DMkuxACi!ztN9=Q%9Zsdaim*paRNvot6uN;oCLR*%^1+ueW;dr+&J z4tkAb*R)w*H3J^${e9*PE$EiJa7&y6g5d#3By(;Lx+p%kjOZYHcj8xZ&eoYGHT-I4 z&Qd6Wu7@-xS40r3if=?vNN)eMjdBciMR@S)4Sl!yAG2W_?_Z7;UR@DU+3rkt!oS%w zr#BKJAnnqh?uF$37{4`PKV&%UfE)!f;z{Q~ECh4EHrB}O`g(%rj)CDBA!Wmq($VEC i2oWWMAU3L2tIzHX+u4NcU({fsJZH;zun2 literal 3248 zcmV;h3{UfpOUL+!1W*$c*EPeqjIpk2xBx$j1e=vRK$A}w$KcUDZkP_<%wQL0m&&y#v(s+v?Iwzd&~NQtE3Aj;B%($}q8*5eqKYpdg3zD6D<(3$^L#A7 z`t0wY1du4J1>i_V7vAG$@f2GP&#I$S^H#5{L#h(>uyy%d)>Xt$ag}9auk7T>{5puV zb7gblG^Dx%D@^Nal@TqG4tQgTnil;;HAca$Yng zrICf3hKx|#&*!KG9=oh^CMj6UiIjZi6)0ybmWM-MbW}^?7zbhcvSr3$A%$mrL~G9l zs)TTZ9qX>^B~I`=+c`@&d*WFX#Y$zjInVoszCm2yHnmxv!V6uuYH!GY2~{)~%9ioJ1#x4;Ca zfBXeB?+T?da=PeDZt)jplKo8i5FDQL*c9_KJR!AvU`Eoe9W7kt1T&A$L`3#Pf)QWK z;G_{z!Yc(-kL9IFTEf>=_`4bF$cF$$ypRa`03r2bO+1u10xg+iL&lZ()k-mY5--Yh z>UN)nvzU-!hKnAI)+FgjYP;x|&maqSB5#Niyu9(CTf+`{yqm;nrC5RsfvVi5g8~U0 zkwr`@W-oLnEu-5vUz&B4?>=bP{&*&-_Bc|M_FZv+-)K@b$AWK@o#rtHe29Fp#;jGto-EFNtIJATJBTnK7-&U&j%r~ka{F6Td!)jE! z?y23lwd~%|c@M(=?T?TE9*M8FWv}D1E^Zav;HzhfctOm+Q05~D({)vn4mC0T>aB7u z%0DeitYeu!gXR3+%mFSoM^moleqW^Ckzq!F1=gkwQ(DIPXWxqk7woFn07i~AtSTl2 z;}s5cV+u}((CBX_s82?`8qllh^8w9>5Q_&B#T%vO)u6y0Yq4TcfhPpLVzO_;JtaF@ zU**&dmj?LnN|n)Hb>6r!x09Y_G?dJ}0M76eSWMfO{m8tcf)69qbZe-KbC);y_15r% zx0>X-1W5}R?8=x%A8F;Sejv{Ny!%7aZoLtAX`=P(HRur(Qq%ah@3yk+44F1ZEofyg zR`h}7r!f{D0)wEs9K7~zgeX~WTyKc>{ei8$>n3*c^~QBvd!*?5?=cU zkmRK>t0nxmY5JryldpC`%_lE=`jRt#8l@z;6mGt!+rTf{=HYB(dv^2;x)X6nDdC|* zbR6u>9}ywfDY4J2F}~*XEiA%M;saNw0^tZeK=Z3-1^8Y-9|AA`KA+z_5;5dFSR9?a81o z#Z{ZxhxN$xG(*f^m!xJRZ_r)eY?%@zw8rzHd2jMdAk4 zUZL+<616}iZDKk2lh1m%?OajckPIpfpxc9xK>^eO2!DSOOjD{&Hc6uU^!<7o$hUlXW73)eSNk-y=6x2;e zj$(V9FTI*;UHi6?6JGy>K@B404Ks}NI#U8k)8&EOS6DOm_UyAxyt>UY#Gq11y<;qb zpohg0^5Q3*kCTt4y{wVf8dcJIUbU`Kghzhg_{?ie(Z#(<>el3%==+>f7S z&EabN0GMCeDqYc)a@&FuL)h^75o?Mz+fm%08b+b13LzEPZ;Tenx1|;joFis6xH~rP zyqY}rr@S_IAiyqV5c?sxKz^IcgaOAjg+z$gWB{}P4O5yZ&m5dT>M_k&DdAI6QpZ}6 zNydL(*>UEqwsqUn& z5Ferh2{AKSP{4*Y$6zfHiU%y2KTEr0!&a|o5r5V&%R&C!fbWap6h#Gv%md0ep(=K| z@QgjE8da@@GQFR`B7)=fEZ+h{P!q^QNQ&3MeLAZ1p$w~0FK@1okt((U#GN<5tHxNZqo-#--{n70f7 zl}=G?&?=qXQ)2I{o4ySCGBdb%sNfusc8R`7b30Iu{D&{y| zauLg0;ONISA1`PZE(5B`2o8>!yu8M4B?GvJaiA@u?ilW-XKH_6HM$U4a z1|LTh(1OASJDoJq0iY5VDE;?>ir)WSxIVtV7fHk}sa>JjQm*$A$>nC%ToEk2KdwQh zGvot&>TpBmhGpy4R&dsSQAZ>BP zxqcbVgQ|@_#hK07lpF=2M^rNtr+Sb@8^z{zsorh>r1fFW)*(BgClVAl3clhZCFiDI zdi#lpw-!j}^B1uzjZyOI=}g1c3(3eoapl+e^a9wB6|80Yz7x$HRT%3M<|QmBKN6%k z?_v!Ngo-}X0V;6!+LAciffuWLn=zxlt%qA|K0a^=$QQrueBB17okw}pW=7JY-Trge zYi|i}Jj|o)3rV@K`R^FejUTPz2eSaXOA| z7jn%{L)m3qNhpk68(#88VKa`+HdgJ=ovT?8HHM>bbjdD$Z)sxl3q*DMAdaci9!=@o z;2E^?koj9n=}`HnlbIs}vI1URHM-FsXo&}E7j;g;hlC~vV;_+E18AYQo!@P{F%@0It9f9`TpaMxNq;L&p9;mxCy7%L7(fE%h4%!i`-l z#})Z|UcQ&uw6iN4!of!edtP&?hoLOAc302`lPLHv{BVpZkHP+Jf6*J3!WT*P-VZ^U(C^!@f16F?qL?0dS06?{!dNtyJ2OO9UfnP zD_s|l?-ZlJlrj98C>c7-*6C>H;8vr?|G0}7MgrgMxPl>s23#w+2&|@VTZ3eQV?G|x z`ME*~Wu*w6QG*Qf^9vus`9m!xJp0EkG`2A56>XI=h-}!=*+pF7TJ% zTAbGO_h@fIu^wuY^*rk#n@UG02gL*E_s;d^syAn+1+h27-`H+0PJfrx6%T(mr=v$| z{V!V?<1(h|8A(fMFN*bO8zS~1Hh>ts<>!)%kT1FmK{rl>?~o*qqK$GSt4>Q?eCGqv z2yBEdLaBlax_3TW$?JQ~9*US_5~s&2c8a?9pNS);(S5Br7hLhehWjVGrMP%2t*SaK ij^y7@)zL4?XcUk$yafAA|EcA+OGMGk=hp20g-o}HCR+;t From 067df578c93a16946a7e23ed3f6a43e1d4fceb2e Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Wed, 20 Jun 2018 05:23:22 +0000 Subject: [PATCH 098/183] Bundled output for commit c89b4f79f7971a5ae356a71cf7aa62cfb991e953 [skip ci] --- extensions/sticky/js/dist/admin.js | 2 ++ extensions/sticky/js/dist/admin.js.map | 1 + extensions/sticky/js/dist/forum.js | 2 ++ extensions/sticky/js/dist/forum.js.map | 1 + 4 files changed, 6 insertions(+) create mode 100644 extensions/sticky/js/dist/admin.js create mode 100644 extensions/sticky/js/dist/admin.js.map create mode 100644 extensions/sticky/js/dist/forum.js create mode 100644 extensions/sticky/js/dist/forum.js.map diff --git a/extensions/sticky/js/dist/admin.js b/extensions/sticky/js/dist/admin.js new file mode 100644 index 000000000..80400a5c9 --- /dev/null +++ b/extensions/sticky/js/dist/admin.js @@ -0,0 +1,2 @@ +module.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=27)}({0:function(e,t){e.exports=flarum.core.compat.extend},1:function(e,t){e.exports=flarum.core.compat.app},18:function(e,t){e.exports=flarum.core.compat["components/PermissionGrid"]},27:function(e,t,r){"use strict";r.r(t);var n=r(0),o=r(1),i=r.n(o),u=r(18),a=r.n(u);i.a.initializers.add("flarum-sticky",function(){Object(n.extend)(a.a.prototype,"moderateItems",function(e){e.add("sticky",{icon:"fas fa-thumbtack",label:i.a.translator.trans("flarum-sticky.admin.permissions.sticky_discussions_label"),permission:"discussion.sticky"},95)})})}}); +//# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/extensions/sticky/js/dist/admin.js.map b/extensions/sticky/js/dist/admin.js.map new file mode 100644 index 000000000..7dd61fc96 --- /dev/null +++ b/extensions/sticky/js/dist/admin.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack://module.exports/webpack/bootstrap","webpack://module.exports/external \"flarum.core.compat['extend']\"","webpack://module.exports/external \"flarum.core.compat['app']\"","webpack://module.exports/external \"flarum.core.compat['components/PermissionGrid']\"","webpack://module.exports/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","external_flarum_core_compat_app_default","a","initializers","add","external_flarum_core_compat_extend_","PermissionGrid_default","items","icon","label","translator","trans","permission"],"mappings":"2BACA,IAAAA,KAGA,SAAAC,EAAAC,GAGA,GAAAF,EAAAE,GACA,OAAAF,EAAAE,GAAAC,QAGA,IAAAC,EAAAJ,EAAAE,IACAG,EAAAH,EACAI,GAAA,EACAH,YAUA,OANAI,EAAAL,GAAAM,KAAAJ,EAAAD,QAAAC,IAAAD,QAAAF,GAGAG,EAAAE,GAAA,EAGAF,EAAAD,QA0DA,OArDAF,EAAAQ,EAAAF,EAGAN,EAAAS,EAAAV,EAGAC,EAAAU,EAAA,SAAAR,EAAAS,EAAAC,GACAZ,EAAAa,EAAAX,EAAAS,IACAG,OAAAC,eAAAb,EAAAS,GAA0CK,YAAA,EAAAC,IAAAL,KAK1CZ,EAAAkB,EAAA,SAAAhB,GACA,oBAAAiB,eAAAC,aACAN,OAAAC,eAAAb,EAAAiB,OAAAC,aAAwDC,MAAA,WAExDP,OAAAC,eAAAb,EAAA,cAAiDmB,OAAA,KAQjDrB,EAAAsB,EAAA,SAAAD,EAAAE,GAEA,GADA,EAAAA,IAAAF,EAAArB,EAAAqB,IACA,EAAAE,EAAA,OAAAF,EACA,KAAAE,GAAA,iBAAAF,QAAAG,WAAA,OAAAH,EACA,IAAAI,EAAAX,OAAAY,OAAA,MAGA,GAFA1B,EAAAkB,EAAAO,GACAX,OAAAC,eAAAU,EAAA,WAAyCT,YAAA,EAAAK,UACzC,EAAAE,GAAA,iBAAAF,EAAA,QAAAM,KAAAN,EAAArB,EAAAU,EAAAe,EAAAE,EAAA,SAAAA,GAAgH,OAAAN,EAAAM,IAAqBC,KAAA,KAAAD,IACrI,OAAAF,GAIAzB,EAAA6B,EAAA,SAAA1B,GACA,IAAAS,EAAAT,KAAAqB,WACA,WAA2B,OAAArB,EAAA,SAC3B,WAAiC,OAAAA,GAEjC,OADAH,EAAAU,EAAAE,EAAA,IAAAA,GACAA,GAIAZ,EAAAa,EAAA,SAAAiB,EAAAC,GAAsD,OAAAjB,OAAAkB,UAAAC,eAAA1B,KAAAuB,EAAAC,IAGtD/B,EAAAkC,EAAA,GAIAlC,IAAAmC,EAAA,sBClFAhC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,wBCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,sBCAAnC,EAAAD,QAAAkC,OAAAC,KAAAC,OAAA,iHCIAC,EAAAC,EAAIC,aAAaC,IAAI,gBAAiB,WACpC5B,OAAA6B,EAAA,OAAA7B,CAAO8B,EAAAJ,EAAeR,UAAW,gBAAiB,SAAAa,GAChDA,EAAMH,IAAI,UACRI,KAAM,mBACNC,MAAOR,EAAAC,EAAIQ,WAAWC,MAAM,4DAC5BC,WAAY,qBACX","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 27);\n","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['app'];","module.exports = flarum.core.compat['components/PermissionGrid'];","import { extend } from 'flarum/extend';\nimport app from 'flarum/app';\nimport PermissionGrid from 'flarum/components/PermissionGrid';\n\napp.initializers.add('flarum-sticky', () => {\n extend(PermissionGrid.prototype, 'moderateItems', items => {\n items.add('sticky', {\n icon: 'fas fa-thumbtack',\n label: app.translator.trans('flarum-sticky.admin.permissions.sticky_discussions_label'),\n permission: 'discussion.sticky'\n }, 95);\n });\n});\n"],"sourceRoot":""} \ No newline at end of file diff --git a/extensions/sticky/js/dist/forum.js b/extensions/sticky/js/dist/forum.js new file mode 100644 index 000000000..160861297 --- /dev/null +++ b/extensions/sticky/js/dist/forum.js @@ -0,0 +1,2 @@ +module.exports=function(t){var n={};function r(o){if(n[o])return n[o].exports;var e=n[o]={i:o,l:!1,exports:{}};return t[o].call(e.exports,e,e.exports,r),e.l=!0,e.exports}return r.m=t,r.c=n,r.d=function(t,n,o){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:o})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var o=Object.create(null);if(r.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var e in t)r.d(o,e,function(n){return t[n]}.bind(null,e));return o},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=28)}([function(t,n){t.exports=flarum.core.compat.extend},function(t,n){t.exports=flarum.core.compat.app},function(t,n){t.exports=flarum.core.compat["models/Discussion"]},function(t,n,r){t.exports=!r(16)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,n){var r=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var o=r(5);t.exports=function(t){if(!o(t))throw TypeError(t+" is not an object!");return t}},function(t,n){var r=t.exports={version:"2.5.7"};"number"==typeof __e&&(__e=r)},function(t,n){t.exports=flarum.core.compat["utils/DiscussionControls"]},function(t,n){t.exports=flarum.core.compat.Model},function(t,n){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,n,r){var o=r(32)("keys"),e=r(30);t.exports=function(t){return o[t]||(o[t]=e(t))}},function(t,n){var r=Math.ceil,o=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?o:r)(t)}},function(t,n,r){var o=r(38),e=r(36);t.exports=function(t){return o(e(t))}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n,r){var o=r(5),e=r(4).document,i=o(e)&&o(e.createElement);t.exports=function(t){return i?e.createElement(t):{}}},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n,r){var o=r(6),e=r(45),i=r(44),c=Object.defineProperty;n.f=r(3)?Object.defineProperty:function(t,n,r){if(o(t),n=i(n,!0),o(r),e)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported!");return"value"in r&&(t[n]=r.value),t}},,function(t,n){t.exports=flarum.core.compat["utils/string"]},function(t,n){t.exports=flarum.core.compat["components/DiscussionListItem"]},function(t,n){t.exports=flarum.core.compat["components/DiscussionList"]},function(t,n){t.exports=flarum.core.compat["components/Button"]},function(t,n){t.exports=flarum.core.compat["components/DiscussionPage"]},function(t,n){t.exports=flarum.core.compat["components/Badge"]},function(t,n){t.exports=flarum.core.compat["components/EventPost"]},function(t,n,r){t.exports=r(51)},,function(t,n,r){"use strict";r.r(n);var o=r(1),e=r.n(o),i=r(9),c=r.n(i),u=r(2),a=r.n(u),s=r(26),f=r.n(s);var p=r(25),l=function(t){var n,r;function o(){return t.apply(this,arguments)||this}r=t,(n=o).prototype=f()(r.prototype),n.prototype.constructor=n,n.__proto__=r;var e=o.prototype;return e.icon=function(){return"fas fa-thumbtack"},e.descriptionKey=function(){return this.props.post.content().sticky?"flarum-sticky.forum.post_stream.discussion_stickied_text":"flarum-sticky.forum.post_stream.discussion_unstickied_text"},o}(r.n(p).a),y=r(0),d=r(24),v=r.n(d);var x=r(8),b=r.n(x),h=r(23),_=r.n(h),k=r(22),O=r.n(k);var g=r(21),j=r.n(g),S=r(20),w=r.n(S),P=r(19);e.a.initializers.add("flarum-sticky",function(){e.a.postComponents.discussionStickied=l,a.a.prototype.isSticky=c.a.attribute("isSticky"),a.a.prototype.canSticky=c.a.attribute("canSticky"),Object(y.extend)(a.a.prototype,"badges",function(t){this.isSticky()&&t.add("sticky",v.a.component({type:"sticky",label:app.translator.trans("flarum-sticky.forum.badge.sticky_tooltip"),icon:"fas fa-thumbtack"}),10)}),Object(y.extend)(b.a,"moderationControls",function(t,n){n.canSticky()&&t.add("sticky",O.a.component({children:app.translator.trans(n.isSticky()?"flarum-sticky.forum.discussion_controls.unsticky_button":"flarum-sticky.forum.discussion_controls.sticky_button"),icon:"fas fa-thumbtack",onclick:this.stickyAction.bind(n)}))}),b.a.stickyAction=function(){this.save({isSticky:!this.isSticky()}).then(function(){app.current instanceof _.a&&app.current.stream.update(),m.redraw()})},Object(y.extend)(j.a.prototype,"requestParams",function(t){t.include.push("startPost")}),Object(y.extend)(w.a.prototype,"infoItems",function(t){var n=this.props.discussion;if(n.isSticky()&&!this.props.params.q&&!n.readNumber()){var r=n.startPost();if(r){var o=Object(P.truncate)(r.contentPlain(),175);t.add("excerpt",o,-100)}}})})},function(t,n,r){var o=r(4).document;t.exports=o&&o.documentElement},function(t,n){var r=0,o=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++r+o).toString(36))}},function(t,n){t.exports=!0},function(t,n,r){var o=r(7),e=r(4),i=e["__core-js_shared__"]||(e["__core-js_shared__"]={});(t.exports=function(t,n){return i[t]||(i[t]=void 0!==n?n:{})})("versions",[]).push({version:o.version,mode:r(31)?"pure":"global",copyright:"© 2018 Denis Pushkarev (zloirock.ru)"})},function(t,n,r){var o=r(12),e=Math.max,i=Math.min;t.exports=function(t,n){return(t=o(t))<0?e(t+n,0):i(t,n)}},function(t,n,r){var o=r(12),e=Math.min;t.exports=function(t){return t>0?e(o(t),9007199254740991):0}},function(t,n,r){var o=r(13),e=r(34),i=r(33);t.exports=function(t){return function(n,r,c){var u,a=o(n),s=e(a.length),f=i(c,s);if(t&&r!=r){for(;s>f;)if((u=a[f++])!=u)return!0}else for(;s>f;f++)if((t||f in a)&&a[f]===r)return t||f||0;return!t&&-1}}},function(t,n){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var o=r(37);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==o(t)?t.split(""):Object(t)}},function(t,n,r){var o=r(14),e=r(13),i=r(35)(!1),c=r(11)("IE_PROTO");t.exports=function(t,n){var r,u=e(t),a=0,s=[];for(r in u)r!=c&&o(u,r)&&s.push(r);for(;n.length>a;)o(u,r=n[a++])&&(~i(s,r)||s.push(r));return s}},function(t,n,r){var o=r(39),e=r(10);t.exports=Object.keys||function(t){return o(t,e)}},function(t,n,r){var o=r(17),e=r(6),i=r(40);t.exports=r(3)?Object.defineProperties:function(t,n){e(t);for(var r,c=i(n),u=c.length,a=0;u>a;)o.f(t,r=c[a++],n[r]);return t}},function(t,n,r){var o=r(6),e=r(41),i=r(10),c=r(11)("IE_PROTO"),u=function(){},a=function(){var t,n=r(15)("iframe"),o=i.length;for(n.style.display="none",r(29).appendChild(n),n.src="javascript:",(t=n.contentWindow.document).open(),t.write("