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

@hsdata/warrenq-ck-note

v0.0.9

Published

* 支持功能

Downloads

6

Readme

使用 @hsdata/warrenq-ck-note

  • 支持功能

    1. 拖拽添加文本,图片
    2. 粘贴word,excel,图片
    3. 手动添加文本,标记,图片,html
    4. 文本自动保存
  • 引入组件


import {
  setRules,   //function(ruleName) 配置图表功能
  setConfig,  //function(config) 组件配置函数
  setViewOrigin,  //funtion(fn) 配置查看原文方法
  appendElementToNote,   //function(params) 添加图片,文本,html,到笔记
  multiTab,  //vue组件 ,笔记完整功能
  bus  //通信组件
  } from '@hsdata/warrenq-ck-note'
  • 完整功能
<template>
  <div style="height: 100vh; width: 100vw">
    <multi-tab  @close='close' @hide='hide' @fullarea='fullarea' ref='mode'/>
  </div>
</template>
<script>
import { multiTab, bus } from '@hsdata/warrenq-ck-note'
export default {
  components: {multiTab},
  create(){
    //沉浸模式
    bus.$on('module-fullscreen-change', this.fullscreen)
  }
  beforeDestroy(){
    bus.$off('module-fullscreen-change', this.fullscreen)
  },
  methods:{
    close(){
      //关闭笔记
    },
    hide(){
      //最小化笔记
    },
    fullarea(v){
      //全屏,取消全屏
    },
    //主动改变全屏图标样式
    initFullarea(){
      this.$refs.mode.changeFullArea(Boolean)
    },
    fullscreen(v,key){
      if(key == 'note'){
        console.log(v)
      }
    }
  }
}
</script>
  • 事件 | 事件名称 | 返回值 | 功能 | | --- | --- | --- | | close | null | 点击关闭 | | hide | null | 点击最小化| | fullarea | boolean | 点击全屏/取消全屏 |

  • 组件配置

  //配置单
const PROJECT_CONFIG = {
  showAddIndexText: false, //显示添加指标,待集成
  showAddChart: false, //显示添加图表,待集成
  showShare: false, //显示分享, 未集成
  showFullscreen: false, //显示全屏, 待集成
  showMenu: true, //显示菜单列表
  showAddNewNote: true, //新建笔记
  showDownloadWord: true, //显示导出word
  saveAs: {
    //另存为模块
    show: false,
    component: 'div'
  }
};

//更改配置
 import {
  setConfig,
} from "@hsdata/warrenq-ck-note";
//禁用菜单和下载excel
setConfig({
  showMenu: false,
  showDownloadWord: false
})

查看原文功能

  • 插入查看原文文本
  import {
  appendElementToNote,   //function(params) 添加图片,文本,html,到笔记
  } from '@hsdata/warrenq-ck-note'

  //新增一个查看原文标记
  appendElementToNote({
    key: 'appendNote',
    content: {
      color: 'red'  //左侧颜色色条,必传
      colorLetter: 'a'  //a,b,c,d  标记,必传
      content: '原文文本……' //需要插入的文本,必传
      ...params   //自定义参数,后续查看原文时使用
    }
  })
  • 配置查看原文方法,该方法为全局方法,多次配置会覆盖
  import {
  setViewOrigin,  //funtion(fn) 配置查看原文方法
  } from '@hsdata/warrenq-ck-note'
/*** 这块可以配置打开阅读器方法 ***/
  setViewOrigin((params)=>{
    //当点击查看原文时,会调用该函数,传入参数为添加标记时的自定义参数
    //示例

    window.open(params.pdfPath)

  })

在当前页签下插入图片、文本、html

import {
  appendElementToNote,   //function(params) 添加图片,文本,html,到笔记
  } from '@hsdata/warrenq-ck-note'

  //在焦点处添加文本
  appendElementToNote({
    key: 'copyNote',
    content: '123123'
  })

  //在焦点处添加html
  appendElementToNote({
    key: 'addInnerHtml',
    content: '123123'
  })

  //在文本结尾添加html
  appendElementToNote({
    key: 'appendInnerHtml',
    content: '123123'
  })

   //添加图片
  appendElementToNote({
    key: 'addImage',
    content: 'src……'  //图片地址
  })