Commit graph

7096 commits

Author SHA1 Message Date
ilja space
868c6e41ac Improve readability for MFM styles code
The code to turn mdm-data-* attributes into a value for the style attribute is complex.
I wrapped it in it's own function now for better code readability.
A comment was already provided with what the code intents to do and why, this information has also been moved
to this function.
2024-12-01 12:24:23 +01:00
ilja space
177d96f977 Improve how scaling is done
During code review a much better way was pointed out to do the emoji scaling, by using `em`.

*key uses 2em for emoji, which is smaller than Akkoma has. I now kept the 38px for Akkoma,
but when "zoom" (ie x2, x3, x4, tada) happens, we set to 2em and zoom from there.
2024-11-01 14:25:22 +01:00
ilja
25681cf5f6 Don't require # in the data-mfm-color attribute
For colour in MFM attributes, we expected a `#`, but that's apparently wrong. The BE
translates the `color` attribute in `$[fg.color=000 text]` into `data-mfm-color=000`.
But for the SCSS to work, we need to put it in the style attribute as `--mfm-color: #000`.

Generally we just add the attribute value as-is in the `style` attribute, but now we
have a special exception for color so we add a `#` before the value.
2024-08-18 15:48:22 +02:00
ilja
6666a273a4 MFM only use sanitised data-* attribute values
We take the value from a data-* attribute and then add this to the style attribute.
This will probably be OK in most cases, but just to be sure, we check for "weird" characters first.
For now we only allow letters, numbers, dot, hash, and plus and minus sign, because those are the ones I currently know of who are used in MFM.
The data-* attribute remains because it was already considered proper HTML as-is.
2024-08-11 18:11:03 +02:00
ilja
3210873d7f MFM make all supported tags suggested
When typing MFM, a sugestor drop-down appears so you can see and/or choose what MFM function to use
The new MFM functions we support have now also been added
2024-08-10 13:55:52 +02:00
ilja
f5f9949253 Fix mfm-position and mfm-scale
The `span`'s needed an inline-block for the transform to wrok
I also added an `overflow: hidden;` because these functions can make the text go beyond the borders of the StatusBody
With `overflow: hidden;`, it won't show outside of the borders
2024-08-10 13:13:47 +02:00
ilja
ba4ae5badb Fix MFM functions x2, x3, and x4
These now work for the new, FEP-c16b compliant, representation
Nesting also works

It already worked for text and "normal" emoji, but now it also works for custom emoji
2024-08-10 12:45:37 +02:00
ilja
56a59e1b55 fill in data-mfm- variables
Things like `speed=0.1s` now work

I also noticed a class was set on StatusBody, but we don't use it, we use StatusContent.
Therefor I removed it now.

We do still pass the setting through StatusBody to RichContent bc it's used there to decide to not show greentext for arrows when MFM was used.
Note that while this setting still works
* You have to refresh the page to see it working (was already like this, so I didn't touch it here)
* It explicitly checks for content type. If womeone provides MFM-like HTML, then it will still show as greentext if that option is enabled
  I think it's a bit inconsistent, but otoh, the inconsistency to me seems more that we ignore the greentext option for one input type specifically

I do still notice generall bugs with MFM.
* Position doesn't seem to work, neither does scale.
* There also seems to be a regression where custom emojis don't become larger any more with e.g. `$[x2 :hehe: ]`

I don't assume the regression is made in this commit, so I add this already. The rest needs to be fixed before merging.
2024-08-05 17:23:15 +02:00
ilja
3065416c93 Make new SCSS work for non-variables
The SCSS that we took from Foundkey in a previous commit, is now working
The settings for disabling MFM or only show animation on hover are working
The previous representation also works and it's clearly marked in the code what is legacy
All the MFM SCSS is now located in one file specifically for MFM, ./src/components/status_content/mfm.scss

This is only SCSS:
* The variables who are provided as data-attributes are not working yet
* `sparkle` also doesn't work
2024-08-04 19:10:25 +02:00
94141dcb3c Message from commiter: Add Foundkey MFM stylesheet
This is part of a bigger work to fix MFM in Akkoma
See <AkkomaGang/akkoma#381>

Here we add the MFM stylesheet as it is used by Foundkey
See <b22e627089>

Foundkey uses MFM and both the Founkey and Akkoma projects and communities, have historically been closely related
As such it makes sense to start with feature-parity with Foundkey

This commit only adds the stylesheet so that correct attribution is given
Properly integrating and making it work will happen in later commits
2024-08-04 17:55:32 +02:00
ilja
92e278d406 Move MFM SCSS to separate SCSS
MFM was defined in three places.
There was ./src/components/status_body/status_body.scss => I moved this to ./src/components/status_content/mfm.scss
There was ./src/components/status_content/status_content.vue => I moved this to ./src/components/status_content/mfm.scss
There's ./static/mfm.css => I kept this as-is

./src/components/status_content/mfm.scss is now being loaded in ./src/components/status_content/status_content.vue

I added a comment in both ./src/components/status_content/mfm.scss and ./static/mfm.css referencing each other

Note that this is just a first step in an overhoal of how MFM is handled. It seemed easier to do this as a first step and then build further on that.
2024-08-04 17:44:21 +02:00
8765491399 Do not try to destructure when we don't need to 2024-06-27 02:58:52 +01:00
4211e05a75 Merge pull request 'status component: Fix repeater name overflowing' (#383) from yukijoou/akkoma-fe:fix-status-usernames into develop
Reviewed-on: AkkomaGang/akkoma-fe#383
2024-06-25 21:34:15 +00:00
a3251a1ba6 Merge remote-tracking branch 'origin/translations' into develop 2024-06-23 03:03:40 +01:00
e5608f4009 remove ora as a dep 2024-06-23 03:03:11 +01:00
1092d43802 remove nonsense dep 2024-06-23 03:02:45 +01:00
Weblate
98a3622172 Merge branch 'origin/develop' into Weblate. 2024-06-17 21:40:59 +00:00
24b9e350e2 Merge pull request 'added minimum space to empty timeline' (#400) from Riedler/akkoma-fe:empty-tl-minspace into develop
Reviewed-on: AkkomaGang/akkoma-fe#400
2024-06-17 21:40:56 +00:00
Weblate
7ab4d22a4c Merge branch 'origin/develop' into Weblate. 2024-06-17 21:40:29 +00:00
8489f6d5ae Merge pull request 'visually fuse CW line and post body textarea' (#401) from Riedler/akkoma-fe:fuse-cw-to-post-body into develop
Reviewed-on: AkkomaGang/akkoma-fe#401
2024-06-17 21:40:26 +00:00
b2cab6d088 only flatten top of post body textarea if subject line is visible 2024-06-16 16:26:44 +02:00
3ebaba6fa7 smushed subject line and post body together, kinda 2024-06-16 16:14:16 +02:00
f1058567b9 also set min height for other lists (e.g. follow requests), not just the timeline 2024-06-16 16:12:15 +02:00
49a850a1e9 added minimum space to empty timeline 2024-06-16 15:49:52 +02:00
Weblate
b2de68239f Merge branch 'origin/develop' into Weblate. 2024-06-15 12:41:26 +00:00
c68595345f Merge pull request 'ANNOYING dependency update' (#397) from dep-update into develop
Reviewed-on: AkkomaGang/akkoma-fe#397
2024-06-15 12:41:23 +00:00
a5d4b0a68c Merge branch 'develop' into dep-update 2024-06-15 13:38:40 +01:00
bd263587b2 Merge branch 'develop' into dep-update 2024-06-15 13:36:24 +01:00
Weblate
c19fb198ca Merge branch 'origin/develop' into Weblate. 2024-06-15 12:33:42 +00:00
97966045cb Merge pull request 'make status form selectors justified properly' (#398) from rat/akkoma-fe:status-form-selector into develop
Reviewed-on: AkkomaGang/akkoma-fe#398
2024-06-15 12:33:38 +00:00
rat
aad023c8a0 make status form selectors justified properly 2024-06-10 17:20:51 -07:00
c952b2335c correct eslint plugin 2024-05-29 04:04:56 +01:00
0baf31f498 correct package.json lint task 2024-05-29 04:01:29 +01:00
8fa24d0c40 migrate to eslint 9 syntax 2024-05-29 03:59:37 +01:00
5848c18ec8 remove unused CI file 2024-05-29 03:43:41 +01:00
Weblate
54dbead22c Merge branch 'origin/develop' into Weblate. 2024-05-28 21:33:19 +00:00
3e86db24d3 Update .woodpecker.yml 2024-05-28 21:33:15 +00:00
Weblate
d8f3f5002f Merge branch 'origin/develop' into Weblate. 2024-05-28 21:31:51 +00:00
7789c5def6 Update .woodpecker.yml 2024-05-28 21:31:46 +00:00
a45f482c79 remove a useless log 2024-05-28 04:18:32 +01:00
Weblate
ed22c480f9 Merge branch 'origin/develop' into Weblate. 2024-05-28 03:17:19 +00:00
f3934afbd8 make sure we normalise interfaceLanguage 2024-05-28 04:17:04 +01:00
Weblate
3797495e53 Merge branch 'origin/develop' into Weblate. 2024-05-28 03:15:47 +00:00
0b437ab6fd remove line left over in conflict 2024-05-28 04:15:35 +01:00
a7dea2f70f ANNOYING dependency update 2024-05-28 04:02:17 +01:00
Weblate
2c9da4a58c Merge branch 'origin/develop' into Weblate. 2024-05-28 02:25:05 +00:00
8964dce609 Merge pull request 'Make animated emojis in reactions pause' (#378) from sarayalth/akkoma-fe:pause-animated-reaction into develop
Reviewed-on: AkkomaGang/akkoma-fe#378
2024-05-28 02:25:02 +00:00
Weblate
156b036caa Merge branch 'origin/develop' into Weblate. 2024-05-28 02:24:09 +00:00
1a49a1b3ac Merge pull request 'Expand Unicode emoji map' (#385) from Oneric/akkoma-fe:emoji_update into develop
Reviewed-on: AkkomaGang/akkoma-fe#385
2024-05-28 02:24:06 +00:00
Weblate
61d82a2a07 Merge branch 'origin/develop' into Weblate. 2024-05-28 02:22:11 +00:00