Conversation
|
@GrahameGW is attempting to deploy a commit to the Hyperlink Team on Vercel. A member of the Team first needs to authorize it. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
This looks awesome! Unsure why it isn't building on vercel, I'll take a look at that, but in the mean time I built it locally and tested. The only logic issue I found so far is that indent should have the same logic as outdent for calculating the new items index. In terms of styling the two issues are:
After that the only remaining piece is adding ordered lists to the block lexicons for when posts are published. This is slightly complicated by the current implementation of unordered list which assumes all children are also an unordered list. I think the most backwards compatible approach here is to add another property, for orderedChildren, or something like that, which just takes from an orderedList lexicon. Let me try and spec something out here, but happy to hear if you have any ideas! |
|
Thanks @GrahameGW this is awesome! Just did some testing too, a few more comments:
|
So originally what I was trying to do was actually flatten the list entirely, and make indent depth a simple property rather than have nested lists in the way unordered list was implemented. The logic for this is that I get really frustrated at most list implementations where they force you to restart the list if you have a break for a picture or some other element that doesn't use list styling. If I understand the lexicons correctly, this would be easy--you just add properties. Of course, with legacy lexicons out there you end up with two implementations. This was one of the reasons I ended up not going that route; I didn't want to handle migration scripts for legacy lists and that was even before considering existing ones. I think you can do it in the same manner as unordered children do it; there's some elegance to that as they will be structurally identical, the ordered lists just have a few extra properties. Provided there's no hard-coupled logic to numbering (e.g., you don't have to go sequentially), then it's fine and solves the problem of the "I want a picture in my list." thing.
I'm not entirely clear what the logical issue is here, but I did find a bug (I think) so I've implemented a fix and hopefully that will resolve it, and maybe that's the issue you're referring to. Basically, when I have a list:
If I indent "blah" I would expect it to be 3., but it is going to 1. So I've fixed that Otherwise, I'm working on the multiselect and copy paste. Might finish up tonight, might be later in the week on that. |
Implements an ordered list block. Includes the ability to edit the list numbers (single click on them), has all the auto-cascade/renumbering logic, and correctly rolls numbers forward or backwards with indents. I also moved a couple of files around because intellisense was complaining about using react hooks in weird places and it seemed straightforward enough to split
getBlocksinto its own file. I added a "list style" type as well that could potentially be merged w/ unordered lists and/or allow for the creation of other numbering types (letters, roman numerals)Typescript is not my strong suit, so I'm sure there's some funky stuff going on here I did wrong. I'd love any feedback you guys might have.