Commit Graph

245 Commits

Author SHA1 Message Date
flarum-bot
1a81c98d43 Bundled output for commit c98e6ba5a7
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-07 15:55:28 +00:00
Ian Morland
c98e6ba5a7
fix: groupmentions have poor contrast on some backgrounds (#3672)
* fix: poor text contrast on some backgrounds
* use hexdec()
* fix render test
* appears to be working now
2022-11-07 16:49:47 +01:00
flarum-bot
32ac0a8d8f Bundled output for commit 827e905f8e
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-11-05 19:34:25 +00:00
Ian Morland
827e905f8e
[mentions] feat: group mentions (#3658)
* wip: group mentions

* Apply fixes from StyleCI

* chore: format

* group mention autocomplete

* chore: format

* remove console.log

* implement notifications

* prevent guest and member groups from being mentioned

* Update extensions/mentions/less/forum.less

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* rename displayname to groupname

* Update extensions/mentions/src/Formatter/FormatGroupMentions.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* remove redundant unparse

* simplify migrations

* add group deleted translation

* Apply fixes from StyleCI

* handle everything falsy

* Include icon in group mention preview

* remove box-shadow from autocomplete group results

* Add color to preview

* chore: format

* Remove box shadow from group autocomplete results

* Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* remove unneeded migration

* prevent former group icon from beingdisplayed

* add group searcher with permissions

* Apply fixes from StyleCI

* Search groups based on canSearchGroups permission

* Don't include virtual groups in results

* Add search groups translation

* Revert "remove unneeded migration"

This reverts commit 9347665baa.

* Revert "Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php"

This reverts commit 8406d51df2.

* add searchGroups permission to tests

* Apply fixes from StyleCI

* Add default searchGroups permission

* Apply fixes from StyleCI

* Update extensions/mentions/js/src/forum/addComposerAutocomplete.js

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update extensions/mentions/migrations/2022_10_21_000000_create_post_mentions_groups_table.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* remove unneeded migration, correct table table

* correct table name in down migration

* Remove group searcher

* Apply fixes from StyleCI

* Remove group searching from composer autocomplete

* Add mentionGroups permission

* Apply fixes from StyleCI

* prevent post preview from rendering a group mention when user does not have permission

* remove test changes

* wip: expose ServerRequestInterface to textformatter parse()

* Apply fixes from StyleCI

* Set post content properly

* php 7.x compatibility

* begin adding groupmention tests

* Apply fixes from StyleCI

* test virtual groups don't mention

* Apply fixes from StyleCI

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update extensions/mentions/extend.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update extensions/mentions/extend.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* requested changes

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/tests/integration/api/groups/ListTest.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/src/Search/SearchServiceProvider.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Update framework/core/src/Extend/Formatter.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* remove default permission migration

* try using datetime column instead of timestamp

* Apply fixes from StyleCI

* chore: remove commented code

* add tests

* Apply fixes from StyleCI

* Pass actor to parser instead of ServerRequest

* Allow for  to be null

* Update framework/core/src/Extend/Formatter.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* pass actor instead of request

* Apply fixes from StyleCI

* actor instead of request

* remove serverrequest

* Apply fixes from StyleCI

* remove dupe actor

* Update extensions/mentions/src/Formatter/CheckPermissions.php

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* fix type in comment

* group does not have the relation, post does

* test: invalid, deleted, fresh data mentions

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

* Apply fixes from StyleCI

* fix: group mentions don't work when editing posts

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>

Signed-off-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: StyleCI Bot <bot@styleci.io>
Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
2022-11-05 19:29:01 +00:00
flarum-bot
082117d8bc Bundled output for commit 11a9b73610
Includes transpiled JS/TS, and Typescript declaration files (typings).

[skip ci]
2022-08-17 13:02:21 +00:00
Hasan Özbey
11a9b73610
fix: use isCollapsed instead of rangeCount (#3581) 2022-08-17 13:56:03 +01:00
flarum-bot
71731819fb Bundled output for commit b01b75e367
Includes transpiled JS/TS.

[skip ci]
2022-08-04 08:11:58 +00:00
flarum-bot
79e0f44324 Bundled output for commit 976a03c9e5
Includes transpiled JS/TS.

[skip ci]
2022-06-19 21:30:47 +00:00
Sami Mazouz
976a03c9e5
fix: post mention notification errors with _no content_ subjects (#3493)
Co-authored-by: David Wheatley <hi@davwheat.dev>
2022-06-19 22:27:39 +01:00
Sami Mazouz
27fb011bf5
chore: with yarn workspaces we only need a single yarn.lock (#3464)
* chore: yarn workspaces means we only need a single `yarn.lock`
* fix: add a `cache_dependency_path` workflow input
* fix: re-introduce `env.cache_dependency_path`
2022-06-19 19:01:21 +01:00
flarum-bot
c944fd0029 Bundled output for commit 98e607a704
Includes transpiled JS/TS.

[skip ci]
2022-04-06 15:56:16 +00:00
Alexander Skvortsov
f2910d8763 chore: add version to core/ext package.json
This is necessary for yarn workspaces to work.
2022-03-11 19:12:11 -05:00
Alexander Skvortsov
5fc0b4963a chore: flarum-cli audit infra --fix 2022-03-11 18:02:51 -05:00
flarum-bot
7dbc5b153f Bundled output for commit e9feb0aa58
Includes transpiled JS/TS.

[skip ci]
2022-01-20 08:46:41 +00:00
Alexander Skvortsov
e9feb0aa58 chore: flarum-cli audit infra --fix 2022-01-20 03:45:09 -05:00
flarum-bot
4c8bba3eb1 Bundled output for commit 0d9c95b096
Includes transpiled JS/TS.

[skip ci]
2022-01-08 21:58:28 +00:00
Ian Morland
0d9c95b096 [chore] Update JS imports (#80) 2022-01-08 16:57:13 -05:00
flarum-bot
4ac4338f9a Bundled output for commit 140d6ea221
Includes transpiled JS/TS.

[skip ci]
2021-11-28 15:57:41 +00:00
David Wheatley
140d6ea221 chore: format javascript 2021-11-28 15:56:30 +00:00
flarum-bot
e8cb1559cf Bundled output for commit f41d6bba7e
Includes transpiled JS/TS.

[skip ci]
2021-11-23 21:39:39 +00:00
David Wheatley
f41d6bba7e fix: errors on texteditor re-use again (#78)
* fix: errors on texteditor re-use again

* fix: use arrow func to not alter `this`

* fix: more replacements
2021-11-23 21:38:28 +00:00
flarum-bot
2721ac8498 Bundled output for commit 302d92aa47
Includes transpiled JS/TS.

[skip ci]
2021-11-23 20:45:52 +00:00
Gianni Guida
302d92aa47 feat: added compat exports and extensibility (#76)
* Added extensibility

* Corrected object export

* Exported the `insertMention` util

* Return a `Promise` in the `reply` util (for extensibility)

* Removed initialization utils

Co-authored-by: Rafael Horvat <rafael.horvat@glowingblue.com>
2021-11-23 20:44:46 +00:00
flarum-bot
94bb882120 Bundled output for commit 69657f63b7
Includes transpiled JS/TS.

[skip ci]
2021-11-13 22:00:12 +00:00
David Wheatley
69657f63b7 fix: autocomplete errors with TextEditor re-use (#77) 2021-11-13 21:58:52 +00:00
flarum-bot
61020eadd6 Bundled output for commit 056c79a908
Includes transpiled JS/TS.

[skip ci]
2021-11-05 19:05:24 +00:00
Sami Mazouz
056c79a908 fix: Cannot reply to posts by deleted authors (#75) 2021-11-05 20:04:20 +01:00
flarum-bot
b245b41b67 Bundled output for commit ffd982df7f
Includes transpiled JS/TS.

[skip ci]
2021-10-18 19:53:25 +00:00
SychO9
ffd982df7f Merge branch 'v1.1.1'
# Conflicts:
#	js/dist/forum.js
#	js/dist/forum.js.map
2021-10-18 20:49:03 +01:00
SychO9
f1f6da10fd chore: Release v1.1.1 2021-10-18 20:27:11 +01:00
Sami Mazouz
3437d7229e fix: Missing # from autocompleted user mention format (#74) 2021-10-18 20:17:22 +01:00
flarum-bot
e63f030094 Bundled output for commit a2832af01f
Includes transpiled JS/TS.

[skip ci]
2021-10-13 18:58:59 +00:00
Alexander Skvortsov
a2832af01f Only search users via rest API if user has permission (#73)
Closes https://github.com/flarum/core/issues/3070

If the user doesn't have permission to search users, there will currently be browser errors, as the current implementation will still attempt to search and autocomplete. In this PR, we check for permission before searching. The dropdown will still support autocomplete of users currently participating in the discussion.
2021-10-13 14:57:45 -04:00
Alexander Skvortsov
c1318d641c Release v1.1.0 2021-10-11 21:12:56 -04:00
flarum-bot
367cca8cc7 Bundled output for commit 2cb00d6773
Includes transpiled JS/TS.

[skip ci]
2021-10-06 20:31:59 +00:00
Alexander Skvortsov
2cb00d6773 Fix missing space after mentions inserted via post reply
Closes https://github.com/flarum/core/issues/3096
2021-10-06 16:30:45 -04:00
flarum-bot
7c954129f0 Bundled output for commit 84dcde4e85
Includes transpiled JS/TS.

[skip ci]
2021-10-06 20:24:50 +00:00
Alexander Skvortsov
84dcde4e85 Fix delayed mention search results
Fixes https://github.com/flarum/core/issues/3095
2021-10-06 16:22:04 -04:00
Alexander Skvortsov
03c6db4c8d Import function correctly
There was a typo in the function's name which broke mentions.
2021-10-06 16:15:01 -04:00
flarum-bot
798fadbddc Bundled output for commit 6173c3d612
Includes transpiled JS/TS.

[skip ci]
2021-09-20 17:43:50 +00:00
David Wheatley
6173c3d612 Minor refactors in frontend JS (#69)
* Add Prettier

* Update dependencies; add typescript setup

* Add tsconfig

* Rewrite some mentions frontend into TS

* Fix use of username instead of display name

* Change back to JS

* Remove commented code

* Update function name to match filename

* Update getMentionText.js

* Simplify condition

* Bump packages to stable versions; use prettier package

* Make functions use camel case

* Update js/package.json

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>

* Don't access data directly

* Update js/src/forum/addComposerAutocomplete.js

Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>

* Update tsconfig.json

Co-authored-by: Sami Mazouz <sychocouldy@gmail.com>
Co-authored-by: Alexander Skvortsov <38059171+askvortsov1@users.noreply.github.com>
2021-09-20 18:42:38 +01:00
Daniel Klabbers
d37a43c795 changes for stable 2021-05-25 16:26:34 +02:00
flarum-bot
37c1933d37 Bundled output for commit 07e93747be
Includes transpiled JS/TS.

[skip ci]
2021-05-25 07:03:39 +00:00
SychO9
cc62044e6f Support smart quotes in mentions format 2021-05-24 21:49:31 +01:00
flarum-bot
b7e9d729c1 Bundled output for commit 8ef8dee532
Includes transpiled JS/TS.

[skip ci]
2021-05-14 22:15:06 +00:00
SychO9
8ef8dee532 Use slug for user mentions page 2021-05-14 23:13:45 +01:00
flarum-bot
4d8f105d07 Bundled output for commit ae69dd25c7
Includes transpiled JS/TS.

[skip ci]
2021-05-13 00:02:51 +00:00
Alexander Skvortsov
ae69dd25c7 Update for ICU MessageFormat 2021-05-12 19:27:13 -04:00
flarum-bot
bc187d9b83 Bundled output for commit 3e596aaadf [skip ci] 2021-05-12 19:43:31 +00:00
Sami Mazouz
3e596aaadf Move replies preview dropdown out of Post-footer (#55) 2021-05-12 20:42:33 +01:00
flarum-bot
e2b309ad95 Bundled output for commit 02d3355989 [skip ci] 2021-05-02 20:38:50 +00:00
SychO9
02d3355989 Add space when inserting a post mention 2021-05-02 21:37:31 +01:00
flarum-bot
83ed624223 Bundled output for commit e407c66784 [skip ci] 2021-04-21 09:59:51 +00:00
Sami Mazouz
e407c66784 New mentions format, decouple usernames from mentions (#65)
* Convert user mentions to new `@"Display Name"#ID` format

* Handle deleted user's mentions

* Convert post mentions to `@"Display Name"#pID` format

* Handle deleted user's post mentions and deleted posts mentions

* Clean display name of `"#{letters}{numbers}` (replace with underscore _)

* Adapt integration tests to new mention formats

* Use a deleted attribute for user mentions

* Introduce cleanDisplayName util

* Detect new format with autocomplete

* Slug needed on rendering only

* Invalidate user mention tag when ID is invalid
This used to be implicitly done, when there was a username attribute configured, formatter would check that all attributes are available and if not invalidate.

since we now only have `displayname` and `id` attributes which are both available from the regex matching, formatter doesn't implicitly invalidate anymore and therefore validates ANY matches. So we explicitly invalidate the tag when the ID does not match a user.

* Allow username mention format with a setting

* Add tests for turning setting on/off

* Move setting check to tag filter
Because the configurator caches, changing the setting only takes effect after the cache is cleared.

* fix: showing autocomplete at the right moment

* Add dockblocks to explain unparsing process
2021-04-21 10:58:54 +01:00
Daniel Klabbers
613664525d Release v0.1.0-beta.16 2021-03-15 12:11:51 +01:00
flarum-bot
37f0a100bd Bundled output for commit 0ad97bb4ed [skip ci] 2021-03-02 04:33:37 +00:00
Alexander Skvortsov
0ad97bb4ed Fix dropdown going off top of screen
The previous solution didn't properly account for document scroll, so when replying to posts, the parent offset would be extremely large, and it'd fall back to the top coordinate, which is out of bounds on small screens.
2021-03-01 23:32:30 -05:00
flarum-bot
8c78af4b1c Bundled output for commit d4db946c31 [skip ci] 2021-02-26 21:20:57 +00:00
Alexander Skvortsov
d4db946c31 Update for Editor Drivers Abstraction (#61) 2021-02-26 16:20:07 -05:00
Daniël Klabbers
80101d52a9 npm audit fix 2020-12-15 09:15:26 +01:00
flarum-bot
4f153a099d Bundled output for commit eea694e021 [skip ci] 2020-12-11 04:50:41 +00:00
Alexander Skvortsov
eea694e021 Fix mention button in composer toolbar
It seems like we missed one `this.props` during the beta 14 rewrite
2020-12-10 23:49:26 -05:00
flarum-bot
6f7b86b0a9 Bundled output for commit 367a1b2329 [skip ci] 2020-10-29 22:34:16 +00:00
Sami Mazouz
367a1b2329 Check if event is cancelable before preventDefault (#54)
This recovers the initial wanted behavior of opening the post mention preview dropdown instead of directly going to the post on touchscreens.
2020-10-29 18:33:26 -04:00
Daniël Klabbers
5cfb1550eb npm audit security vulnerabilities patched 2020-10-14 09:59:01 +02:00
flarum-bot
d94dfa6090 Bundled output for commit 26c84b9e5b [skip ci] 2020-10-03 00:20:06 +00:00
Alexander Skvortsov
26c84b9e5b Use Link component instead of route patch 2020-10-02 20:19:10 -04:00
flarum-bot
51134ff625 Bundled output for commit ea56f39a53 [skip ci] 2020-09-24 02:54:49 +00:00
Alexander Skvortsov
ea56f39a53 Mithril 2 Update (#52)
Update for Mithril 2

- Please note that PostQuoteButton and AutocompleteDropdown are not Fragments, not Components. Accordingly, they have been moved to the components folder.

Co-authored-by: Matthew Kilgore <tankerkiller125@gmail.com>
Co-authored-by: Franz Liedke <franz@develophp.org>
2020-09-23 22:53:46 -04:00
flarum-bot
a48a84fcd0 Bundled output for commit 1674e7a313 [skip ci] 2020-09-04 16:26:07 +00:00
Franz Liedke
1674e7a313 Fix extension to work with Composer state changes
Refs flarum/core#2162.
2020-09-04 18:19:27 +02:00
flarum-bot
8f1ba6e7d2 Bundled output for commit 921db74fe4 [skip ci] 2020-09-04 14:47:16 +00:00
Franz Liedke
921db74fe4 Fix extension to work with Composer state changes
Refs flarum/core#2162.
2020-09-04 16:46:01 +02:00
flarum-bot
1ce62ca3c5 Bundled output for commit ce039d3dd6 [skip ci] 2020-09-04 14:43:38 +00:00
Franz Liedke
ce039d3dd6 Fix extension to work with Composer state changes
Refs flarum/core#2162.
2020-09-04 16:42:07 +02:00
dependabot[bot]
6da004c7ae Bump elliptic from 6.5.2 to 6.5.3 in /js (#51)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.3.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-31 01:09:16 +02:00
dependabot[bot]
c192cbc57b Bump lodash from 4.17.15 to 4.17.19 in /js (#49)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-17 10:48:25 +02:00
flarum-bot
ebc8b763ce Bundled output for commit 68163d462a [skip ci] 2020-07-01 21:10:06 +00:00
Alexander Skvortsov
68163d462a Stop mentions dropdown from jumping around (#48)
Cache the order in which users are returned by the API to stop the mentions list from jumping around
Only ping the api when 2 or more characters are entered
2020-07-01 17:08:31 -04:00
flarum-bot
a905fbd073 Bundled output for commit af979f20ff [skip ci] 2020-06-10 00:14:45 +00:00
Matteo Contrini
af979f20ff Always show replies list on posts (#47)
Previously, if there was a single reply and it was adjacent to the post it wasn't shown.

See discussion on Discuss: https://discuss.flarum.org/d/23666-flarum-010-beta13-released/75
2020-06-09 20:13:24 -04:00
flarum-bot
494ec8b8a6 Bundled output for commit 5855b0367f [skip ci] 2020-05-01 09:59:00 +00:00
Franz Liedke
5855b0367f Update Webpack 2020-05-01 11:56:01 +02:00
Franz Liedke
9587d3b416 npm audit fix 2020-04-24 14:30:29 +02:00
dependabot[bot]
dd89498150 Bump acorn from 6.4.0 to 6.4.1 in /js (#45)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.4.0 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.4.0...6.4.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-17 21:52:38 +01:00
flarum-bot
62ec7dc2fc Bundled output for commit 969638a311 [skip ci] 2020-02-11 20:44:30 +00:00
Franz Liedke
969638a311 Update Webpack 2020-02-11 21:43:28 +01:00
Franz Liedke
d9fb5ab31b Update vulnerable JS dependencies 2019-09-13 15:33:06 +02:00
flarum-bot
ce1f81a460 Bundled output for commit 87ed42157f [skip ci] 2018-12-03 23:43:48 +00:00
Toby Zerner
e2bb04ce34 Truncate notification excerpts 2018-12-03 09:37:01 +10:30
flarum-bot
4f190d6b74 Bundled output for commit 2786476ab1 [skip ci] 2018-11-21 08:23:18 +00:00
Toby Zerner
2786476ab1 Make npm package private, update deps, change watch to dev 2018-11-21 18:45:36 +10:30
flarum-bot
a808ccab69 Bundled output for commit 54660c2cc8 [skip ci] 2018-11-17 08:37:36 +00:00
Toby Zerner
54660c2cc8 Update dependencies 2018-11-17 19:06:29 +10:30
flarum-bot
c8a3c3c22b Bundled output for commit 1f04c732a0 [skip ci] 2018-11-14 03:07:37 +00:00
Toby Zerner
1f04c732a0 Fix cursor not being placed correctly after mention insertion 2018-11-14 13:36:21 +10:30
flarum-bot
7929d2e4bf Bundled output for commit dd500ec54b [skip ci] 2018-11-12 10:35:09 +00:00
Toby Zerner
dd500ec54b Add mention button to text editor toolbar 2018-11-12 17:37:25 +10:30
flarum-bot
d34c7745f8 Bundled output for commit 4bd704c9c5 [skip ci] 2018-11-06 08:42:37 +00:00
Toby Zerner
4bd704c9c5 Trigger mention autocomplete on any kind of input 2018-11-06 19:11:25 +10:30