GithubHelp home page GithubHelp logo

zesty-io / live-editor Goto Github PK

View Code? Open in Web Editor NEW
2.0 4.0 1.0 20.22 MB

Website/App Overlay Guide for Editing Zesty.io Content

Home Page: https://chrome.google.com/webstore/detail/zestyio-webengine-view-ex/mnkmogppmhhmafgfljgckpkapodofjob

HTML 0.09% TypeScript 99.25% JavaScript 0.40% CSS 0.14% SCSS 0.12%
zesty-io

live-editor's Introduction

zesty logo

Zesty.io Live Editor

Website/App Overlay Guide for Editing Zesty.io Content

npm GitHub package.json version GitHub issues Chrome Web Store GitHub package.json dependency version (prod) TypeScript MUI Webpack NPM

⚡ Installing

Requires node version ^16.x.x

Using NPM

npm install @zesty-io/live-editor

Using Yarn

yarn add  @zesty-io/live-editor

Using jsDelivr CDN

<script
   type="text/javascript"
   src="https://cdn.jsdelivr.net/gh/zesty-io/live-editor@latest/dist/live-editor.production.js"
   defer="defer"
></script>

Note, if your website has a strict content security policy or x-frame-options, you will need to add this url to your white list

https://cdn.jsdelivr.net/gh/zesty-io/live-editor@latest/dist/live-editor.production.js

✨ Quickstart

Using React, place this code in your app.js or app loading file

import { ZestyLiveEditor } from "@zesty-io/live-editor"

React.useEffect(() => {
   ZestyLiveEditor(data)
}, [])

Using Nextjs, place this in ZestyView.js, or for custom builds, _document.js or _app.js

// outside the component near imports
const initLiveEditor = async (data) => {
   const { ZestyLiveEditor } = await import("@zesty-io/live-editor")
   ZestyLiveEditor(data)
}

// inside the component's function just before the return statement
React.useEffect(() => {
   initLiveEditor(props.content)
}, [])

Using Vuejs

<script>

   import { ZestyLiveEditor } from "@zesty-io/live-editor"

    methods:{
        initLiveEditor: function(data) {
            ZestyLiveEditor(data)
        }
    },
    beforeMount(){
       this.initLiveEditor(data)
    },
</script>

💡 Overview

Is that the explorer will be a website overlay tool that will guide the user around the data that loads on the page relative to the zesty content management system. The tool will have tabs for searchable on page data, full site navigation, inline editing, website and page health, metadata explorer, image optimization scanning, broken link scanning.

💡How to Implement

The tool should be built in compiled JavaScript and execute in plain JavaScript so it can run over any installation of zesty, whether it's parsley templating, next js, nuxt, or any custom build.

Distribution

It should be distributed over npm package manager and yarn, it should also be able to be manually installed from a CDN link.

Publishing to NPM

  • Manually: npm run manual-publish
  • Github flow: any merge to main will run a release and publish flow

Zesty Page Composer Application Overview

Zesty is an application that can make any website or text base document on the internet editable. It runs as javascript application and is powered by a Zesty's multi-tenant cloud based API. It would by piping any directing any live domain with a website through WebEngine. Webengine serves the application through and inject content with Parsley, a templating language that connects to the the Zesty API.

##💡 Design

Figma file https://www.figma.com/file/TsOMa4gbWHgMzWyXH8MXpt/Explorer?node-id=0%3A1

How the experience works

A domain is pointed to Zesty Webengine, and the Zesty Overlay Editor is injected into the page when it renders. The overlay tool lets the user select portions of the page they need to edit, and also gives the user the option to add sections into the page. This is made possible by storing a document which HTML markup and Parlsey is written to. When the document is served, WebEngine will render it by processing and compiling Parsley into a final web document, injecting SEO and webpage needed functionality.

💡 Tools in the WebSite Overlay tool

💡 Content

A tablar view of the content editable on the page, when an item is selected, it scrolls you the approate area, highlights it on page, and allows the user to change and save the page. When the content view is selected, a user may select an area on page where they would like to edit contnet, or add a new block to the page (like a image and text block).

How blocks work

Blocks are premade design expeirences. They have premade connections to load content. Blocks will be served from a Parsley HTML repo or served into headless app from a React based npm package managed by Zesty (open-source). A user can preview blocks from a block browser, and select which on they want to inject in page.

Working in headless

Headless applications only need the markup name <Zesty/> to render on their finished page, and have their application hosted somewhere remote with a URL that can be plugged into Zesty WebEngine, there are two envirnoment for this, Production and Stage. Pages or URLs get registered in Zesty, and the URL is how the page is resolved, which injects into the page where the <Zesty/> tag is. <Zesty> can load remotely through a React component, or if the app is loaded through WebEngine only the string <Zesty/> needs to be present.

Working without Headless

The parlsey tag {{current_view}} and <Zesty/> function the same. The difference is when Zesty runs the loader file in zesty runs and controls the page build, which is automated through WebEngine.

loader file explantation

<html> (automated from webengine)
  <head></head> (automated from webengine)
  <body> (loader wraps the body)
  {{current_view}} (injects the view rendered relative to the URL)
  </body>
</html> (automated from webengine)

Writing Changes

Zesty Overlay using the Rest API (instances-api) to write both content and files.

SEO / Meta / Headtags

A view of the pages SEO and meta values which can be edited, this is not limited to SEO meta tags, but open graph tags, scripts, and other head tags. Head tags are injected into the page though WebEngine, prior to Search Engines reading it.

💡 How to run locally

Check here on how to run locally

💡 How to Commit

Check here

💡 Deploying in Production

Automated

  • All successfull merge to main will create a release and publish to npm

Manually

git checkout main && npm run release

Testing Locally in the browser

  • run npm run dev to start the application locally
  • Open /test/index.html in your browser
  • Remove index.html from the browser file path
  • use this override domain https://qzp3zx5t-dev.webEngine.zesty.io/

🖥️ Code Contributors

live-editor's People

Contributors

ardeay avatar darwin808 avatar giseleblair avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

fairhopeweb

live-editor's Issues

Save on edits should post all changes

Much like the Manager, saves should be made after editing all desired fields not just one field at a time to avoid unnecessary versions of content

Editing lock to prevent overwriting

  • are there any sync / user locks to keep 2 people from cutting versions on top of each other?
    • can we use content lock from the manager app

Code Helper TAb

Layout

image

image

Split out content viewer tab into explorer, editor, seo, JSX helper, json

jsx help should include the table of code examples alongside the field names and code to click to copy

Top bar

Link to edit Schema

Name the model and item working in.

Links to zesty docs

Table

The table should include columns for reach

Reference Name: title
Parsley: {{this.title}}
JSX React: {content.title}
VUE: {{content.title}}

Bringing back npm load modules

the ability to install with NPM and run the module from local

  • needs local host in cors

Example implementation

import LiveEditor from '@zesty-io/live-editor'

<LiveEditor content={content} />

If the content object is passed.

If content is passed in and they are not authenticated, only show three tabs: Code, Navigator, JSON

Change Code to ignore fields api call if not authenticated.

Give option to authenticate (this requires cors update from zesty backend)

seo tab improvements

dom report

include - h2 h3 h4 h5 p a chars
make dom report table

groudp page meta and global meta

add create head tag button

navigation

change location to bottom of manager link

resource zuid matches page zuid then this is part of the page

group 2 table

page meta start 7
global meta start 8

dom report > table
dom report > add # of chars

2 ..........1
1= edit persmission

Bad links from no ZUID

When loading via CDNJS we dont have the Instance ZUID
image

If this data is missing ( when not implemted from react loading {content}) it can be accessed off the response object in res.headers.z-zuid
image

Meta TAb: Use top level `.meta` from content object, iterate through each, show in table form

Show Meta Data from Zesty

Access only the top level meta.web object, iterate through each into a table format. The goal is to show the user the tags that are available and editable in zesty. Create link to edit like: https://:INSTANCE_ZUID.manager.zesty.io/content/:MODEL_ZUID/:ITEM_ZUID/meta

"type":"item"
"model_name":"homepage"
"model_alternate_name":"Homepage"
"zuid":"7-31209c-g7qsjg"
"createdAt":"2022-03-24 16:27:42"
"updatedAt":"2022-03-24 16:27:41"
"listed":"1"
"version":"316"
"locale":{6 items
"id":"1"
"name":"English (United States)"
"code":"en-US"
"default":"1"
"active":"1"
"enabled":"1"
}
"model":{5 items
"type":"model"
"zuid":"6-31079c-vdg69q"
"name":"homepage"
"label":"Homepage"
"resourceURI":"https://kfg6bckb-dev.webengine.zesty.io/-/instant/6-31079c-vdg69q.json"
}
"web":{12 items
"url":"https://kfg6bckb-dev.webengine.zesty.io/"
"uri":"/"
"fragment":"zesty_home"
"canonical_tag_mode":"1"
"sitemap_priority":"-1.0"
"sitemap_last_updated":"2022-03-24 16:27:41"
"canonical_query_param_whitelist":NULL
"canonical_tag_custom_value":NULL
"seo_link_text":"Homepage"
"seo_meta_title":"Zesty.io: Simplify digital. Maximize results."
"seo_meta_description":"Zesty is built for teams to manage and distribute content to multiple sites, devices, and anywhere else it needs to go."
"seo_meta_keywords":NULL
}
}

Showing loaded from the HTML document

Look through the dom and output the <meta> tags in a separate table.

image

Not building for npm

Does not run with NPM, @darwin808 please verify this locally and setup a PR.

You can test with nextjs-website and npm update @zesty-io/explorer

Name change to Live Editor

Changes

  • Readme instructions
  • Build files
  • jsdeliver url
  • Chrome extension name and jsdeliver url in chrome extension package
  • npm package name
  • nextjs starter npm include

open schema, manager button naming

Open new Window

Buttons should open new window (target _blank)

Naming

Open Content and Open schema? or Go to Content and Go to Schema? or Edit content/schema
I think we also want to pay close attention to the naming. Both buttons Open Manager and Open Schema  open the Manager they just open different sections/apps in the Manager. I don’t have any suggestions as to what to name them though

SEO Tab

Shows meta as it is, can edit meta, shows dom report (number of H1s, text of page, links)

Local Envirnoment Setup

A clean way with a WATCH to develop locally without publishing or pushing to CDNJS, or using the zesty explorer chrome extension.

Document this is the README

Component Refactor

Split out ZestyExplorer component to multiple components in the top level component directory

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.