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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@sedona-cms/core

v1.4.19

Published

![Node.js Package](https://github.com/sedona-cms/core/workflows/Node.js%20Package/badge.svg)

Readme

Node.js Package

Table of Contents

About the Project

Sedona CMS can create a beautiful and fully customizable admin panel on the frontend site.

Built With

Getting Started

Prerequisites

Setup

  1. Add @sedona-cms/core dependency to your project
npm i @sedona-cms/core # or yarn add @sedona-cms/core
  1. Add @sedona-cms/core to the modules section of nuxt.config.js

  2. Create sedona.config.json in project root and create admin folder in src root. Will be fixed

  3. Add plugin in client mode

admin.client.js

export default async function (ctx) {
  // check for user logged in
  await ctx.$adminLoader.load()
}

nuxt.config.js

export default {
  modules: ['@sedona-cms/core'],
  plugins: ['~plugins/admin.client.js'],
}

Usage

Config

sedona.config.json has two main sections.

  1. toolbar – toolbar customization, adding buttons, changing title
  2. items – menu customization, add items, sections and subitems

Config file has json schema. This tool helps validate config when module loading. And edit the file without errors.

Editing the config file may be handier with WebStorm or VS Code.

  1. Webstorm – Languages and Frameworks -> Schemas and DTDs -> JSON Schema Mappings

Toolbar Configuration

toolbar section (object)

type ToolbarConfig = {
  showHome: boolean
  title: string
  buttons: ToolbarButton[]
}

type ToolbarButton = {
  title: string
  icon: string
  component: string
}

Menu Items Configuration

A menu item may be of 3 display variants:

  1. item – a simple menu item
  2. header – a subheader item (not clickable)
  3. section – an item can navigate to another menu list

Examples:

Simple menu item with required fields only

{
  "title": "Post List",
  "type": "item",
  "component": "posts/posts-view"
}

Simple menu item with all available fields

{
  "title": "Post List",
  "type": "item",
  "component": "posts/posts-view",
  "icon": "edit",
  "subTitle": "Managment posts",
  "params": {
    "lang": "ru"
  }
}

Menu item

type MenuItem = SimpleMenuItem | HeaderMenuItem | SectionMenuItem

Simple menu item

type SimpleMenuItem = {
  id?: string
  title?: string
  subTitle?: string
  icon?: string
  type: 'item'
  component?: string | Function
  params?: {
    [key: string]: any
  }
  conditions?: MenuItemCondition[]
}

Header menu item

type HeaderMenuItem = {
  id?: string
  title?: string
  type: 'header'
  conditions?: MenuItemCondition[]
}

Section menu item

type SectionMenuItem = {
  id?: string
  title?: string
  subTitle?: string
  icon?: string
  type: 'section'
  items?: MenuItem[]
  conditions?: MenuItemCondition[]
}

The Visibility of Menu Items

By default, all menu items show on each page on site. This behavior may be changed in the config file.

The visibility depends on a current Vue route. All components have a property $route. Use the $route property in conditions you can change the visibility of menu items on-site pages.

The $route properties that can be used in conditions:

  1. name
  2. path
  3. meta

Type of conditions that can be used.

  1. =
  2. regex

Examples:

The menu item shows only on-page about. The item shows only on pages when the condition returns true $route.name === 'about'

{
  "title": "Test",
  "type": "item",
  "component": "posts/posts-view",
  "conditions": [
    {
      "field": "name",
      "value": "about"
    }
  ]
}

The menu item shows only on page about or index. The item shows only on pages when the condition returns true $route.name === 'about' || $route.name === 'index'

{
  "title": "Test",
  "type": "item",
  "component": "posts/posts-view",
  "conditions": [
    {
      "field": "name",
      "value": "about"
    },
    {
      "field": "name",
      "value": "index"
    }
  ]
}

Save Panel

Each admin view can have a save panel. The Save Panel is a panel in a bottom with a button.

Enable the save panel

Add save attribute to menu item configuration:

{
  "title": "Post Edit",
  "type": "item",
  "icon": "edit",
  "component": "posts/post-edit",
  "save": true
}

You can change the Save Panel options:

{
  "title": "Post Edit",
  "type": "item",
  "icon": "edit",
  "component": "posts/post-edit",
  "save": {
    "label": "Save Post",
    "color": "brown-5",
    "size": "xl"

}

Set disabled state for the Save Panel

In posts/post-edit:

<script>
  import { eventBus } from '@sedona-cms/core/lib/utils/event-bus'

  export default {
    name: 'PostEdit',
    mounted() {
      eventBus.emit('core:save-disable', true)
    },
  }
</script>

Set loading state for the Save Panel

In posts/post-edit:

<script>
  import { eventBus } from '@sedona-cms/core/lib/utils/event-bus'

  export default {
    name: 'PostEdit',
    methods: {
      save() {
        eventBus.emit('core:save-loading', true)
        // A request here
        eventBus.emit('core:save-loading', false)
      },
    },
  }
</script>

Catch click event

<script>
  import { eventBus } from '@sedona-cms/core/lib/utils/event-bus'

  export default {
    name: 'PostEdit',
    mounted() {
      eventBus.on('core:save-click', this.save)
    },
    beforeDestroy() {
      eventBus.off('core:save-click', this.save)
    },
    methods: {
      save() {},
    },
  }
</script>

Lock Navigation

Sometimes we need to lock navigation in Admin Panel. For example when form fill and not saved yet. Navigation API will may to lock navigation in Admin Panel and on the site.

Lock navigation

this.$sedona.navigate.lock()

  • Arguments:
    • globally
  • Example:
export default {
  name: 'PostEdit',
  methods: {
    onChange() {
      this.$sedona.navigate.lock()
    },
  },
}

Unlock navigation

this.$sedona.navigate.unlock()

  • Arguments:
  • Example:
export default {
  name: 'PostEdit',
  methods: {
    onChange() {
      this.$sedona.navigate.lock()
    },
    onSave() {
      this.$sedona.navigate.unlock()
    },
  },
}

Check for is navigation lock

export default {
  name: 'PostEdit',
  computed: {
    buttonDisable() {
      return this.$sedona.navigation.isLock
    },
  },
}

Programmatic Navigation

Examples:

Go to PostView and provide postId prop

export default {
  name: 'Posts',
  methods: {
    goToPost() {
      this.$sedona.navigate('posts/post-view', {
        postId: 12,
      })
    },
  },
}

Go to component by a path with Save Panel

export default {
  name: 'Posts',
  methods: {
    goToPost() {
      this.$sedona.navigate(
        'posts/post-view',
        {
          postId: 12,
        },
        {
          save: true,
        }
      )
    },
  },
}

Events

Sedona CMS uses own global event bus.

Using example:

import { eventBus } from '@sedona-cms/core/lib/utils/event-bus'

eventBus.on('sedona:loaded', () => console.log('Fired after Sedona Core loaded'))

Used Events:

  • sedona:loaded (no args) – Sedona CMS core loaded

  • sedona:panel-loaded (no args) – Sedona CMS panel loaded

  • core:navigate (item: MenuItem) – change an active panel

  • core:lock-navigate (flag: boolean) – if flag is true to lock a navigation

  • core:save-click (no args) – A click on Save button

  • core:save-loading (boolean) – Set a loading state for Save button

  • core:save-disable (boolean) – Set a disabled state for Save button

Development

  1. Install dependencies
npm ci
  1. Link the package in which it is run
npx npm-self-link
  1. Run watch process
npm run watch # typescript watch process
  1. Run nuxt project from dev directory
npm run dev

Tests

Run unit tests for utils

npm run test:utils

Run unit tests for Vue components with vue-test-utils

npm run test:components

Run e2e test (not implemented yet)

npm run test:e2e

Run all test

npm run test