Giter Site home page Giter Site logo

Content Editor? about sonicjs HOT 14 OPEN

chrisspiegl avatar chrisspiegl commented on July 30, 2024
Content Editor?

from sonicjs.

Comments (14)

chrisspiegl avatar chrisspiegl commented on July 30, 2024 1

I just was doing some more research on this topic and found this editor which appears very powerful and "easyish" to implement.

https://tiptap.dev

from sonicjs.

lane711 avatar lane711 commented on July 30, 2024 1

Something like this is definitely in the roadmap. Right now content editing is in place, but pretty basic, ie:
https://demo.sonicjs.com/admin/content/edit/users/488484b6-00df-4d43-b7a2-d554ae654f9a

from sonicjs.

osseonews avatar osseonews commented on July 30, 2024 1

By the way, I'd personally drop the whole admin folder for editing content. It really overly complicates this repo and causes some errors. Admin interfaces are a whole other ballgame. For actually editing the content in the database, I'd just use Retool and set up a resource that connects to the D1 database. It's quite trivial to do. Then this repo should just focus on setting up the backend correctly, i.e. D1 to KV and memory cache, schema set ups. You can even use Retool to upload images to Cloudflare and then that's solved also by jusing saving the SRC url into the D1 database.

from sonicjs.

osseonews avatar osseonews commented on July 30, 2024 1

Yeah, I agree developing a good admin dashboard to edit content is a very difficult thing to do, and not essential to the core functionality of this great little CMS. It would be best to create another repo which would run the admin dashboard that can be used to interact with D1. It is really a separate project.

from sonicjs.

lane711 avatar lane711 commented on July 30, 2024

@osseonews I don't disagree but it's been really helpful for me while building the API as we're "eating our own dogfood" plus the visual representation of data is a benefit. I will look into retool and other alternatives at some point as it would be nice to be able to focus on the API framework more exclusively. Thanks for the idea.

from sonicjs.

osseonews avatar osseonews commented on July 30, 2024

Yeah, totally understand. I used to be the same way until I discovered Retool a few months back. Now, I don't even bother with frontend admin tools any more. Frees up so much energy and time to focus just on the API stuff.

from sonicjs.

lane711 avatar lane711 commented on July 30, 2024

from sonicjs.

osseonews avatar osseonews commented on July 30, 2024

Yes, 100%. You only need paid versions , when you have multiple users that require access rights,

from sonicjs.

osseonews avatar osseonews commented on July 30, 2024

BTW, I was going to try to set up a Retool connection to D1, but busy on some other stuff now. But, I think the way it would work is that you set up REST API resource to the Cloudflare Worker and then since you already have the API routes set up, it should be trivial to do all the CRUD. And you would have an unbelievable amount of components to work with in Retool.

from sonicjs.

cryptoskillz avatar cryptoskillz commented on July 30, 2024

I also like the idea of separating the content editor from the rest of the repo. I coded up a simple Cloudflare pages app using the editor quill.js

You can see the code here

https://github.com/cryptoskillz/sonicjswithquill

and a working demo here

https://sonicjswithquill.pages.dev/b8c26807-6991-4b30-b1ef-a951d6adafc7#

All that would be required from Sonicjs is an edit button next to each row.
Also, if a POST/PUT endpoint was added to the posts API, we could use Sonicjs to fetch and store the data.

from sonicjs.

rhamses avatar rhamses commented on July 30, 2024

While I was looking for alternatives for the content editor I found grapejs which sounds really cool and modern. What do you guys think?

from sonicjs.

lane711 avatar lane711 commented on July 30, 2024

While I was looking for alternatives for the content editor I found grapejs which sounds really cool and modern. What do you guys think?

GrapeJs is just for editing web page HTML content, so not a good fit for an admin tool. I played with it quite a bit a couple of years ago. Its ok, but far from a great page builder compared to the popular Wordpress page builder plugins like Elementor, etc

from sonicjs.

rhamses avatar rhamses commented on July 30, 2024

Yeah, I get from this discussion that GrapeJS and page builder in general would be a separate step on this process. I'm running an experiment with EditorJS somewhat successfully and I'll happy to share the screens after the setup is complete.

from sonicjs.

ninjasitm avatar ninjasitm commented on July 30, 2024

Found a way to hack this quickly for formio (https://help.form.io/userguide/):

As an example in cms/api/forms.ts:

function getField(fieldName): Field {
  const disabled = fieldName == "id";
  const type = getFieldType(fieldName);
  return {
    type,
    key: fieldName,
    label: fieldName,
    disabled,
    autoExpand: type === "textarea",
    wysiwyg: type === "textarea",
    rows: type === "textarea" ? 3 : undefined,
    // placeholder: "Enter your first name.",
    // input: true,
    // tooltip: "Enter your <strong>First Name</strong>",
    // description: "Enter your <strong>First Name</strong>",
  };
}

function getFieldType(fieldName) {
  switch (fieldName) {
    case 'body':
      return 'textarea';
      break;
  }
  return fieldName === "password" ? "password" : "textfield";
}

Not sure if this will be overwritten in the future but for now this allows me to define a wyswyg.

from sonicjs.

Related Issues (20)

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.