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

@symphony-ui/adk-rtb

v1.0.0-beta.24

Published

RichTextBlock ADK project

Downloads

4

Readme

Quick start

Run yarn dev in adk-rtb root directory to launch the examples in a local server, then go on http://localhost:3000/

Run yarn build in adk-rtb to build the project.

Introduction

RichTextBlock enables authors to create rich text block, similar to traditional "What you see is what you get" (wysiwyg) editors. It will be translated into a Symphony specific syntax (PresentationML).

How to use?

{
        kind: "richtextblock",
        content: [{
            kind: "p",
            content: ["Hello John, here are some interesting data"]
        }, {
            kind: "datablock",
            name: "Chart ABC",
            data: {
                // data here
            },
            preview: [{ // optional
                kind: "p",
                content: ["Some preview content can be provided here"]
            }]
        }]
    }

Utility methods

To ease the write of this syntax, we have provided some utility methods.

import { table, tr, td, p, h, em, rtb, span, img, strong, dataBlock, mention, hashtag, dataTag, cashtag, ol, li } from '@symphony-ui/adk-rtb';

 const r = rtb([
            p([
                "Colors: ",
                span("accent 1", { color: "a1" }), ", ",
                span("accent 2", { color: "a2" }), ", ",
                span("primary 1", { color: "p1" }), ", ",
                span("primary 2", { color: "p2" }), ", ",
                span("secondary 1", { color: "s1" }), ", ",
                span("secondary 2", { color: "s2" }), ", ",
                span("sublte 1", { color: "t1" }), ", ",
                span("subtle 2", { color: "t2" })
            ]),
            p([
                "Background colors: ",
                span(" accent 1 ", { bkgColor: "a1" }), ", ",
                span(" accent 2 ", { bkgColor: "a2" }), ", ",
                span(" primary 1 ", { bkgColor: "p1" }), ", ",
                span(" primary 2 ", { bkgColor: "p2" }), ", ",
                span(" secondary 1 ", { bkgColor: "s1" }), ", ",
                span(" secondary 2 ", { bkgColor: "s2" }), ", ",
                span(" subtle 1 ", { bkgColor: "t1" }), ", ",
                span(" subtle 2", { bkgColor: "t2" })
            ]),
            p(" "),
            h(3, "Data block:"),

            dataBlock("EURUSD Chart", {
                type: "fdc3.chart",
                instruments: [
                    {
                        type: "fdc3.instrument",
                        id: {
                            ticker: "EURUSD"
                        }
                    }
                ],
                range: {
                    type: "fdc3.dateRange",
                    starttime: "2020-09-01T08:00:00.000Z",
                    endtime: "2020-10-31T08:00:00.000Z"
                },
                style: "candle"
            }, {
                preview: [
                    img("https://share.chartiq.com/L0V2034HZB.png", "news", { width: 300 })
                ]
            }),

            dataBlock("Symphony New CRO", {
                // any data here
                type: "com.symphony.news",
                articleId: 123456789,
                title: "Symphony names chief revenue officer and announces new commercial structure",
                content: "Symphony has named StreetLinx co-founder and former CEO Gary Godshaw as the company's chief revenue officer (CRO)"
            }, {
                preview: [
                    // preview RTB
                    table([
                        tr([
                            td([
                                img(root + "news_355x255_N.png", "news", { width: 130 })
                            ]),
                            td([
                                h(3, "Symphony names chief revenue officer and announces new commercial structure"),
                                p(span("By: Symphony Communication Services, LLC", { color: "t1" })),
                                p(span("Symphony has named StreetLinx co-founder and former CEO Gary Godshaw as the company's chief revenue officer (CRO)", { color: "t1" })),
                            ], { width: 400 })
                        ]),
                        tr([
                            td([
                                p(span("Symphony - 29 November 2021", { color: "t1" })),
                            ], { colspan: 2 })
                        ])
                    ])
                ]
            }),
            p(" "),
            h(3, "Data tags:"),
            p([
                "mention: ",
                mention(
                    { type: "fdc3.contact", name: "JB", id: { email: "[email protected]" } },
                    { name: "James", title: "James Bond" }
                ),
                " cashtag: ",
                cashtag({ type: "fdc3.instrument", id: { ticker: "MSFT" } }),
                " hashtag: ",
                hashtag("#foo"),
                " any tag: ",
                dataTag("XYZ.ABC DEF-MSFT+", { type: "foo.bar", message: "Hello world!" }, {
                    bkgColor: "s2", preview: [
                        span("XYZ", { bkgColor: "p1" }),
                        ".",
                        span("ABC", { bkgColor: "p2" }),
                        " ",
                        strong("DEF-MSFT+")
                    ]
                })
            ]),
        ]);