npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@springtree/makeup-react-renderer

v1.0.23

Published

Make up renderer, for react

Downloads

12

Readme

Make up react renderer

This project will render make up blocks and also have a preview component to develop them in combination with the make up editor. This project will contain the necessary components to both render and preview blocks.

Consumption

Rendering

Lets say you have a make up page with id foo and you want to render it somewhere on the website. You would need to import the Renderer component and pass it a page fetched by that id (use eva-sdk-js)

You will also need to pass the Renderer component an endPointUrl so it can fetch stylesheets associated with it.

Example:

<Renderer page={page} components={/** Component object here */} endPointUrl="http://example.com" />

The Renderer component requires you to pass it all the components you would like make up to render as a prop named components of type object.

The structure looks something like this. The key of the object will represent the ID of the block make up knows about, and the value will represent the actual react component.

{
    counter: Counter,
    header: Header
}

To tell make up about the existance of a react component in that list, you would have to add it in the blocks manager under blocks/manage in the make up editor. It will ask you for the ID you are using up here and a name to easily find the component later on. It will also ask you for the inputs of this component, which are basically the react props this component needs to be rendered (Incase it has any) Try to make these as descriptive as possible.

Editing content

This is something that is setup once, but its important the component list that is provided to the preview stays up to date.

But basically you will need to have two routes that the editor will point to when editing blocks and pages.

Preview end point

/preview Which should render the Preview Component in this library

This component also needs a prop named components which should be provided with the exact same list you provide the Renderer component with.

Block end point

/makeup-block-preview Which should render the BlockPreview component exposed by this library.

This component will be responsible for communication with the editor for previewing HTML blocks.

Development

I use storybook for development, so here is how you would develop on the preview or block preview component

  1. Ensure whatever component you want to work on is the first story under stories/index.js
  2. npm run storybook
  3. Take the the url where the server is running and put it in the environment file of make up (Under websiteUrls) and make sure it ends with iframe.html
  4. Ensure make up editor looks at the correct path, by default it adds /makeup-preview and /makeup-block-preview we don't want that in this case so comment that piece of code in editor-page.component.ts and block-preview.component.ts In the future you will be able to modify the URL immediately in the view.

Example

{
    "companyName": "",
    "siteGroup": [
        {
        "defaultToken": "",
        "applicationId": 1,
        "endPointUrl": "",
        "displayName": "",
        "id": "",
        "websiteUrls": [{
            "url": "http://localhost:6006/iframe.html", // this is the important part
            "culture": "nl-NL"
        }]
        }
    ]
}

The development workflow of this project can be dramatically improved, but due to time constraints I will keep it as it is.

Building

Builds a consumable version of the project, after running a build you can publish the package to npm or install it locally.

Publishing

Just run npm publish there is a prepublish hook which will build the project for you once you do that.