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

@jx3box/jx3box-editor

v2.2.16

Published

JX3BOX Article & Editor

Downloads

818

Readme

Article & Editor

手动更新 cdn https://oss.jx3box.com/static/

Dev

$ npm install 
$ npm run serve
$ open http://localhost:8080  //文章渲染
$ open http://localhost:8080/tinymce  //tinymce编辑器
$ open http://localhost:8080/markdown  //markdown编辑器
$ tinymce http://localhost:5000

Step.1 Install

npm install @jx3box/jx3box-editor

Step.2 Import

  • 指定模块
import Article from "@jx3box/jx3box-editor/src/Article.vue";
import Tinymce from "@jx3box/jx3box-editor/src/Tinymce.vue";
//import Markdown from "@jx3box/jx3box-article/src/Markdown.vue"

Step.3 Usage

文章

<article :content="content" directorybox="#directory" />

编辑器

<script src="https://oss.jx3box.com/static/tinymce/tinymce.min.js?v=$version"></script>
<Tinymce
    v-model="content"
    :attachmentEnable="true"
    :resourceEnable="true"
    :height="300"
/>

批量附件上传插入/资源快捷查询插入

<Upload @insert="insertWhere" @update="getList" @htmlUpdate="getHTML" />
<Resource @insert="insertWhere" @update="getHTML" />

页面远程引入文章渲染模块

  1. head标签:头部引入文件 注意应带上查询参数以防本地缓存,版本号请读取https://github.jx3box.com/jx3box-editor/package.json中的version
    app 启动的时候读一次存到本地就可以,之后本地页面可以直接使用对应版本号。
    后续 11 月会新增一个文本物品浮层功能(关联物品百科)。
<script src="https://oss.jx3box.com/static/jx3box-lib/vue.js?v="></script>
<script src="https://oss.jx3box.com/static/jx3box-editor/jx3box_article.umd.min.js?v="></script>
<link rel="stylesheet" href="https://oss.jx3box.com/static/jx3box-editor/jx3box_article.css?v="/>
  1. body标签:需要插入的位置
<div id="app">
    <jx3box_article id="article" content="loading.."></jx3box_article>
</div>
  1. body末尾:初始化脚本
<script>
    
    var username = "$token"; //使用正确的token
    var password = "android"; //安卓端使用
    var headers = new Headers();
    headers.set("Authorization", "Basic " + btoa(username + ":" + password));

    // 1.异步加载设置数据,将420改成正确的文章ID
    fetch("https://cms.jx3box.com/api/cms/post/420", {
        method: "GET",
        headers: headers,
        credentials: "include",
        mode: "cors",
    }).then((res) => {
        res.json().then((data) => {
            let content = data && data.data && data.data.post.post_content;
            document.getElementById("article").setAttribute("content", content);
            // 2.实例化
            new Vue({
                components: {
                    jx3box_article,
                },
            }).$mount("#app");
        });
    });
</script>