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

shuyun-ng-editor

v0.0.14

Published

shuyun angularJs editor

Downloads

7

Readme

// npm
npm install shuyun-ng-editor --save

// yarn
yarn add shuyun-ng-editor --save

import angular from 'angular';
import shuyunEditor from 'shuyun-ng-editor';

angular.module('app', [shuyunEditor]);

基础编辑器使用


<!--具体用法: 参见 Demos-->
<shuyun-editor-keyword></shuyun-editor-keyword>

<shuyun-editor-content></shuyun-editor-content>

shuyun-editor-keyword

| 属性 | 说明 | 类型 | 默认值 | | --------------------- | ----------- | -------- | -------- | | keywords | 关键词集合 | array | 见下面对单个keyword的说明 | | width | 宽度 | string | auto | | isShowAll | 是否平铺显示所有关键词 | boolean | false | | onInsertKeywordAction | 点击关键词回调 | function | () => {} |

keyword

| 属性 | 说明 | 类型 | 默认值 | | --------------------- | ----------- | -------- | -------- | | type | 平台类型 | string | | | name | 短生成内容的替换字符 | string | auto | | text | 编辑器插入关键词显示扥文本 | string | string | | isShow | 是否显示 | boolean | true | | defaultValue | 默认显示的预览文本 | string | name |

shuyun-editor-content

| 属性 | 说明 | 类型 | 默认值 | | ---------------------- | -------------- | -------- | ----------------------------------------- | | ref | 获取当前编辑器实例 | object | - | | styles | 编辑器样式设置 | object | width, height, max-height, font-size | | placeholder | 默认值 | string | 请输入内容… | | content | 编辑器内容 | string | | | keywords | 关键词集合 | array | 同shuyun-editor-keyword字段 | | isTrimSpace | 是否删除内容两边空格 | boolean | true | | hasTagInPreview | 预览文本是否包含html标签 | boolean | false | | disabled | 编辑器禁止输入 | boolean | false | | illegalChar | 编辑器禁止输入的非法词 | array | ['œ', 'þ'] | | onFocus | 聚焦显示关键词 | function | - | | onBlur | 失焦隐藏关键词 | function | - | | onContentChangedAction | 编辑器内容发生变化调用此函数 | fucntion | |

onContentChanged 函数

编辑器内容发生变化调用此函数,返回值为:


{
	// 编辑器文本
	editorText: '',

	// 预览内容,按照换行符切割为数组
	previewText: [],

	// 总字数
	totalChars: 20,

	// 换行数
	newLineNumber: 2,

	// 变量数
	variableNumber: 1,

	// 变量预估字数
	variableWordsNumber: 20
}

短信编辑器使用


<!--具体用法: 参见 Demos-->
<shuyun-editor-sms-editor ref="" opts={}></shuyun-editor-sms-editor>

<shuyun-editor-sms-preview opts={}></shuyun-editor-sms-preview>

opts

| 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | content | 短信编辑器内容 | string | | | keywords | 变量集合 | Array | 同shuyun-editor-keyword字段 | | isTrimSpace | 是否删除短信内容两边空格 | boolean | true | | disabled | 短信编辑器禁止编辑 | boolean | false | | customSignature | 自定义短信签名 | string | | | customSignature | 自定义短信签名 | string | | | useUnsubscribe | 是否使用回T退 | boolean | false | | unsubscribeText | 退订的默认文案 | string | 回T退 | | gateway | 短信通道类型 | object | |

gateway

| 属性 | 说明 | 类型 | 默认值 | | --- | --- | --- | --- | | gatewayId | 短信通道id | number | | | wordsLimit | 单条短信字数限制 | number | 70 | | multiLimit | 多条短信字数限制 | number | 67 | | signature | 短信通道内置签名 | string | | | gatewayType | 短信通道类型 | number | |