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

@screencloud/screencloud-apps-sdk

v0.1.80

Published

This npm module contain reusable scripts for apps.

Downloads

166

Readme

ScreenCloud apps SDK

This npm module contain reusable scripts for apps.

DEPRECATED

  • dateConvertor ― use instead special npm packages or new Date() constructor
  • dateTimeHelper ― use instead special npm packages or new Date() constructor
  • query.params ― use instead npm package
  • geocodeHelper ― not any relations in current apps, so it deprecated
  • promiseUtil ― not any relations in current apps, so it deprecated
  • QRCode ― not any relations in current apps, so it deprecated.
  • scLog ― it's bad practice and deprecated.
  • localCache ― deprecated after refactoring ThemeManager.

Get started

  1. npm install --save @screencloud/screencloud-apps-sdk
  2. Import modules

triggerEvents

Main module with emitters to sending events to the parent frame from app.

import { triggerEvents } from "@screencloud/screencloud-apps-sdk"

// ... //
  componentDidMount() {
    triggerEvents.on("start", () => triggerEvents.sendAppStatusStarted());
  }

  ...

  onSubmit(login, password) {
    if (login && password) {
      const jwt = encrypt({
        login: login,
        password: password
      })
      triggerEvents.callbackSuccess(jwt);
    } else {
      triggerEvents.callbackError(new Error("Login failed"))
    }
  }
// ... //

List of methods:

  • sendAppStatusPreloaded()
  • sendAppStatusStarted()
  • sendAppStatusFinished()
  • sendAppError(data)
  • callbackSuccess(data) // to send data to ScreenCloud (for example after login)
  • callbackError(data) // to send error to ScreenCloud (for example after login)

logger (beta)

import { logger } from "@screencloud/screencloud-apps-sdk"

if (process.env.NODE_ENV === 'development') {
  logger.init();
}

List of methods:

  • init() // initialize the rendering logs on window

ThemeComponent

import { ThemeComponent } from "@screencloud/screencloud-apps-sdk"
import queryString from 'query-string'

const parsedQuery = queryString.parse(window.location.search)

// ... //
constructor(props) {
    super(props);
    this.state = {
      theme: parsedQuery.theme
    }
}

getThemeData(data) {
  console.log(`Theme object: ${data}`)
}

render() {
  return (
    <ThemeComponent theme={this.state.theme} getThemeDataObject={this.getThemeData}>
      /* your application code */
    </ThemeComponent>
  )
}
// ... //

List of properties:

  • theme // themeID string

List of methods:

  • getThemeDataObject // return {"colorBgPrimary":"#feb62c","colorTextBody":"#1f1f1f","colorTextHeading":"#fb0004","colorTextLink":"#ff3a00","fontBody":"Oswald","fontHeading":"Fjalla One","fontUrlBody":"","fontUrlHeading":"","id":"...","name":"Kodak"} or {}

animationControlHelper (will be DEPRECATED)

On/off animation.css. Will be deprecated because current functuonality affect only to old apps in monorepo.

import { animationControlHelper } from "@screencloud/screencloud-apps-sdk"

// ... //
  componentDidMount() {
      animationControlHelper.enableAnimation();
      // animationControlHelper.disableAnimation();
  }
// ... //

List of methods:

  • enableAnimation() // remove disable-animated class from body element
  • disableAnimation() // add disable-animated class from body element

checkScreenLayout (will be DEPRECATED)

Functionality to get viewport layout type.

import { checkScreenLayout } from "@screencloud/screencloud-apps-sdk"

// ... //
  const layoutClass = checkScreenLayout();
// ... //

List of methods:

  • getLayout(forcedLayoutClass?) // get layout type; set up layout name as class to body element (WILL BE DEPRECATED WITH MONOREPO)

List of properties:

  • LAYOUT_CLASS_PORTRAIT // "portrait"
  • LAYOUT_CLASS_LANDSCAPE // "landscape"
  • LAYOUT_CLASS_TICKERTAPE // "tickertape"
  • LAYOUT_CLASS_SUPERWIDE // "superwide"
  • LAYOUT_CLASS_SQUARE // "square"

deviceDetection (will be DEPRECATED)

Functionality to detect the device type/model. Will be deprecated, please use device-detector npm package instead.

import { deviceDetection } from "@screencloud/screencloud-apps-sdk"

deviceDetection // 'iOS', 'Android', 'Windows Phone', or 'unknown'

colorHelper (will be DEPRECATED)

Module with methods for easy work with colors. (will be deprecated, use third party modules instead)

import { colorHelper } from "@screencloud/screencloud-apps-sdk"

const redHEX = "#ff0000"
const darkRedHEX = colorHelper.colorLuminance(redHEX, -0.2); // #cc0000
const darkOrLight = colorHelper.checkContrast(redHEX); // dark

List of methods:

  • colorLuminance(hex, luminDiff)
  • checkContrast(hex)

urlHelper (will be DEPRECATED)

Module with methods for easy work with colors. (will be deprecated)

import { urlHelper } from "@screencloud/screencloud-apps-sdk"

// ... //
  const url = urlHelper.cleanIframeUrl("<iframe src="https://google.com"></iframe>"); // "https://google.com"
// ... //

List of methods:

  • cleanIframeUrl(iframeHTMLString)

youtubeHelper (will be DEPRECATED)

Module with methods for easy work with colors. (will be deprecated)

import { youtubeHelper } from "@screencloud/screencloud-apps-sdk"

// ... //
  youtubeHelper.extractYoutTubeIds(messageText)
// ... //

List of methods:

  • extractYoutTubeIds(string)
  • isContainYouTubeURL(string) // true|false
  • isValidYouTubeURL(url) // true|false