Commit Graph

13 Commits

Author SHA1 Message Date
diamondburned 8827df937d Added MentionerAvatar and MentionedImage; clarified new behavior for Mentioner
This commit adds the MentionerAvatar and MentionedImage interfaces. This
interface gives the mentioned object an avatar or image. An example of
this would be showing a user's avatar. This allows the frontend to do
simple layouting.

The new behavior for Mentioner states that the frontends should be able
to use the highlighted segment as the mentioned object's display name.
For example, if the mentioned segment highlights "@username", then the
frontend should display "@username" as the large text.
2020-07-19 00:55:57 -07:00
diamondburned ecbd4515a2 Added Mentioner and clarifications
This commit adds the Mentioner interface. The objective is to have a
clickable mention string similar to that in Discord, that when pressed
will popup a small box containing the given user info.

In the future, Mentioner may be expanded to add Avatar capabilities, but
for now, it can be added using text segments.

This commit also clarified that segments can implement multiple
interfaces. This is done to allow segments such as Mentioner to also be
colored using Colorer.

Frontend implementations should, instead of a type switch, use multiple
if statements separately. This may introduce a lot more boilerplate code.
2020-07-07 13:26:39 -07:00
diamondburned (Forefront) 0abbf861bc Added Avatarer into package text
This commit adds Avatarer into the list of supported text segments. This
should work very similarly to Imager, except that avatars should be
rounded by the frontend.

This commit should make the text image APIs consistent with the main
cchat package.
2020-07-04 01:15:50 -07:00
diamondburned (Forefront) dfb60ac0eb text.Rich to implement Stringer; extra docs 2020-06-20 00:10:23 -07:00
diamondburned (Forefront) e953dbbcb1 Added extra methods onto Imager.
This is done instead of text substitution, as images might have contexts
and other important attributes. One such example is an emoji, which may
have worked with text substitution, but would also work with a simple
string append.
2020-06-17 20:45:30 -07:00
diamondburned (Forefront) 05b7a6a10c Specified that Images cannot do text substitution
This commit specifies that images cannot substitute a piece of text with
itself. This means that end bounds of those segments are ignored, and
images will be inserted where the start bounds point them to.

Frontends that can't actually display images should represent this
information in another way by itself. One way is to treat this as a
hyperlink that says "Image."
2020-06-17 17:34:38 -07:00
diamondburned (Forefront) ba88528a7a Removed text substitution from hyperlinks
This was done because handling text substitution would make rich text
renderers much more complex. Instead of lazily preprocessing all
segments into a list of attributes and lazily inserting them into a
new text, they would now have to account for text substitutions,
which would be overkill for a single link.

As a tradeoff, frontends that don't render rich texts and only use the
Content string will not see any URLs. Instead, it will only see the
underlying text of the URL, except without the actual hyperlink.
2020-06-17 17:02:56 -07:00
diamondburned (Forefront) d4917d2e6d Added Has to text.Attribute 2020-06-17 16:10:53 -07:00
diamondburned (Forefront) 8fdf82883a Moved package split to utils 2020-06-10 12:19:13 -07:00
diamondburned (Forefront) 66dd2b1b11 Added split package to help with completions 2020-06-10 01:12:41 -07:00
diamondburned (Forefront) 2e7c6b0098 Added blocks into richtext and AttrDim into inline attributes 2020-06-09 20:51:54 -07:00
diamondburned (Forefront) fa7f2fdca4 Fixed color hexadecimal invalid size 2020-06-03 21:15:52 -07:00
diamondburned (Forefront) 3e8f0a0921 Initial API draft 2020-05-18 23:07:22 -07:00