Giter Site home page Giter Site logo

dashibase / lotion Goto Github PK

View Code? Open in Web Editor NEW
2.8K 23.0 131.0 1.67 MB

An open-source Notion UI built with Vue 3

License: GNU General Public License v3.0

HTML 0.49% JavaScript 1.47% Vue 56.14% CSS 1.19% TypeScript 40.72%
editorjs notion markdown vue hacktoberfest

lotion's Introduction

Dashibase

Lightspeed app-builder for Supabase users.
Check it out now โšก

Need to build an app or a dashboard? Dashibase is the fastest app-builder for Supabase users.

Beautiful presets in light and dark modes. CRUD interfaces with cards and table views. Form validation, elegant login and signup pages, and more. All with a simple JSON config file.




This repo contains the open-source code for setting up your own Dashibase dashboard if you are interested in hosting it yourself. Otherwise, we also have a hosted version.

Contributions welcome!

Have suggestions for what to work on next? Support us by joining our beta!


Features

Supported

  • Authentication UIs including sign in and sign up
  • Multiple display modes - single, list, card
  • CRUD functions
  • Simple form validation during item creation by checking that required fields are filled in (required attributes are configured in src/dashibaseConfig.ts)
  • Caching of dashboard data to reduce database queries and improve latency
  • Dashboard is responsive and works on tablet and mobile
  • Pagination support
  • Filter and sort for list and card views

In-progress

  • Better support for table joins
  • Charts display mode
  • Third-party authentication support

Backlog

  • Built-in analytics
  • User impersonation
  • Kanban display mode
  • Regex form validation

Getting Started

1. Clone this repository and go to the Dashibase directory

git clone https://github.com/dashibase/dashibase
cd dashibase

2. Edit src/dashibaseConfig.ts to configure your dashboard.

See here for documentation on the config file.

3. Test it locally

We currently don't have a staging mode yet but you should be able to test it locally with your own account

npm run dev

4. Deploy to your favorite server!

Important! Remember to add your dashboard URL to your list of your sign-up redirect URLs in Supabase. You can find it at https://app.supabase.io/project/YOUR_PROJECT_ID/auth/settings.

Like what you're seeing?

We're hoping to turn this into our full-time job! Support us by joining our beta, visit us in our Discord server and follow us on Twitter for more updates.

lotion's People

Contributors

exposir avatar greentfrapp avatar holazz avatar ivteplo avatar kkkzoz avatar lyqht avatar pjerkovic avatar shashankbhatgs avatar vvidday avatar zhangenming avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lotion's Issues

Can't select text for more than 1 line

few bugs found

  • can't select text for more than 1 line
  • if you delete some word in the middle of a sentence until it deletes the sentence in the line above, when you do a cmd+z (control+z) the undo gets lost

Convert to component library

Hi! I just saw your work and it is very impressive and minimal ๐Ÿ’ฏ

How do you think if we refactor some parts of the core to publish as a component library to npm? It could be a really nice minimal editor component.

Problem with the input history.

ctrl+z and ctrl+y has not a normal or notion-like behavior.

Maybe don't use the browser behavior for ctrl+z and ctrl+y and add a history for the data tree?

Thanks for your awesome job, and please, keep it simple :)

Drag & drop on block line is a problem

When I want to select a text, sometimes I drag & drop it instead (on desktop and everytime on mobile).

Notion does not use drag & drop directly on the lines, the button for that is a good option.

It fixes another problem where clicking has no effect when you click between blocks lines.

CleanShot 2022-07-29 at 14 22 23

Carret is always put at the end of text after transforming block using slash syntax

To reproduce:

  1. Convert block to any other type of content block using slash syntax
  2. Caret will be put at the end of text even if slash was somewhere in the middle

Probably the reason for this:
Lotion.vue::setBlockType() calls moveToEnd() even if transformation was invoked with slash syntax. There is a call before that in Block.vue::clearSearch() to set carret at right position.

Getting error when moving the block in Chrome

I got the following error when I moved the block in Google Chrome.
But I ensured this error didn't occur in FireFox.

error in console

Uncaught (in promise) Error: this.element.parentElement was null
    at i (general.js:205:1412264)
    at L.dao (general.js:2283:41095)
    at L.destruct (general.js:2283:21747)
    at general.js:2283:21664
    at MutationObserver.observe.childList (general.js:205:1406674)

Prop mutation

Currently blocks are mutating props directly, e.g:

@blur="props.block.details.value=content?.innerText"

My understanding is that props are readonly and shouldn't be mutated, instead an event should be emitted back up to the parent, which should then reassign the new value at the top level (which then cascades back down to the component). This is Evan You's advice and it came up on Twitter in response to the announcement.

I'm happy to submit a PR showing this in practice if it's helpful but wanted to first ask in case there was something I'm missing.

(amazing work by the way, I'm really excited about Lotion's potential!)

Add issue & PR templates to GitHub repository

Seeing how Dashibase is getting many issue report & PRs, it will be great to include som templates so there's a standard for new contributors to follow when creating an issue for bugs/ feature requests, and when they create PRs for them.

Examples of GitHub templates can be found here and here

Remove html tag and use a transformers

Having html tags here is not good:

CleanShot 2022-07-29 at 14 38 39@2x

This data should be in a format that can be stored in a database.
And as a developer, I don't want store html tags inside my database, only markdown or cleaned data.

Instead of:

{
    type: "TEXT",
    details: {
      value: '<p>5. <strong>Bold</strong> and <em>italicize</em> using markdown e.g. *italic* or **bold**</p>'
    },
  }

I want provide:

{
    "type": "TEXT",
    "details": {
      "value": "5. **Bold** and *italicize* using markdown e.g. *italic* or **bold**"
    }
}

And transform it if needed for the editor.

Support columns grid

Is your feature request related to a problem? Please describe.
I really love this project and I would like to request column drag-and-drop feature. So that we can leverage grid layout for more flexible editing

Describe the solution you'd like
Drag and drop a component to the side of another components to create columns

Describe alternatives you've considered

Additional context
Add any other context or screenshots about the feature request here.

It rubs the lotion

It clones the lotion on its workspace. It does this whenever it is time to edit.

It forks the lotion on its repo or else it gets no free stuff again.

Now it gives the lotion a star and puts lotion in a basket.

Anyone else have lotion jokes?
Leave it here.

Heading block bugs with browser inconsistencies

Original bug outlined in #30, where converting from a heading block to text block breaks the entire block. This bug only occurs in chromium browsers.

blur

Firefox (correct behaviour):

hb-firefox-blur

Chrome (bug):

hb-chrome-blur

The above was fixed by #31 by changing the state update on heading blocks from a blur event to input. However this introduced a separate bug on firefox & safari where typing within a heading block always inserted characters at the beginning of the line. (rolled back in 3a463c6)

input

Firefox (bug):

hb-firefox-input

Chrome (correct behaviour):

hb-chrome-input

Summary:

Chrome Firefox/Safari
input Correct Buggy (cursor)
blur Buggy (conversion) Correct

Set block's unique id for comment and history

Hi,
Thanks for your great open-source project ๐Ÿ˜.
I have a challenge with this editor, maybe you can help me.

I want to set and save the block's unique id in DB for some features like comments or the block's history. Do you have any idea about that? Notice that text or structure changes shouldn't change id.

Thanks.

Component search improvements

Typing /heading shows two variants: Heading 1 and Heading 2.

However, typing /h1 to quickly access Heading 1 doesn't work. The same is for /h2.

Additionally, if I insert spaces, just like /heading 1, the search ignores the space, tries to look for heading1, and says that nothing was found. And backspacing three times after that leaves /headi in the search box instead of /headin.

gpt-3 addon

Can you implement AI features to this clone?

Nuxt 3 style error

Describe the bug
I try to use Nuxt 3 but it is not totally rendered

To Reproduce
Steps to reproduce the behavior:

  1. Follow
  2. Copy the example
<template>
  <Lotion :page="page" />
</template>
<script setup lang="ts">
import { ref } from 'vue'
import { v4 as uuidv4 } from 'uuid'
import { Lotion, registerBlock } from '@dashibase/lotion'

const page = ref({
  name: '๐Ÿงด Lotion',
  blocks:[{
    id: uuidv4(),
    type: 'TEXT',
    details: {
      value: 'Hello, World!'
    },
  }],
})
</script>
  1. Paste to pages/index.vue
  2. See error

Expected behavior
A beautifully rendered Lotion editor

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Caret moves down when trying to add multiple blocks

Description

In Notion, when you click on the "+" button next to the block, you will see a context menu to choose the custom block that you want to add to your document, so there isn't a behavior of repeatedly clicking on the "+" button.

However, in Lotion, right now, when we click on the "+" button repeatedly, the caret is immediately moved to the new block. This results the user to leave where they are previously. While this logic does seem to follow how Notion implements it, it is not ideal for users that just want to add multiple placeholder blocks.

Screenshots

scroll_position_shifts_down_when_adding_items

Handling / menu suggestion

Stuff looks promising. Nicely thought out UI!

One suggestion though, when you trigger the menu using /, typing hea and selecting heading 2 will put characters /hea into the editor, then you need to delete those after converting to a header. It might make sense to remove the characters automatically if you activated an option in the menu.

Also, it would be cool to have an option to move blocks up/down using (the same?) menu, so you don't need to use the mouse to edit at all.

Ty

Block menu and keyboard shortcuts

Lotion recognizes keyboard shortcuts as if Ctrl or Alt weren't pressed. For instance, if a user presses Ctrl+Z, then a letter z will be added to the search term, while in the editor the shortcut will work as it should (it will undo the last action).

Preventing a letter from being added when a user presses a shortcut is quite simple to do (just extra check for Ctrl and Alt keys). But I currently have no idea how to fix the difference between input and search term that is produced when a user presses Ctrl+Z or Ctrl+Backspace.

Checklist

Impressive Stuff. The most desired and common feature is the checklist. Its is what that is featured on Getting Started page of lotion. what are the plans for the checklist?

Tablet compatibility

Describe the bug
Not menu block when add / in tablet

To Reproduce
Try the demo in tablets

Support for italic bold / nested tags

Currently, working with text that is both bold and italic causes a few functions to break

  • Arrow key navigation doesn't work if italic bold text is at front/back of block
  • Merge doesn't work if italic bold text is at the front of the block that is being merged
  • Split doesn't work if initiated from within the italic bold text
  • Conversion via search doesn't delete search term if initiated from within italic bold text

Issues are mainly due to the tags being nested, since most functions currently only work for one layer of nested tags

Video

italicbold-issue

Fix would require a decent amount of refactoring to support nested tags

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.