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

@mora-light/vue

v0.0.5

Published

Mora Light Vue

Downloads

164

Readme

Mora Light

Vue

Use the Mora Light component according to the following steps.

1. Install the necessary packages

npm i -S @mora-light/core @mora-light/vue

2. Import css

import '@mora-light/vue/index.css';
import '@mora-light/vue/iconfont.css';

3. How to use component

a. Method 1

If you want to use Light which is reviewed by Mora,you will know it's Anchor data. Include:

canister_id: For example: 'nciuh-jiaaa-aaaai-qo75a-cai'

hash: For example: 'AA5O64TBZ2FMJXM'

This way will automatically fetch Light data from the Mora's canister to display and run.

<script lang="ts" setup>
import { ref } from 'vue';
import { HttpAgent } from '@dfinity/agent';
import { WrappedMoraLight as WrappedMoraLightVue } from '@mora-light/vue';
import { ComponentStatus } from '@mora-light/core/types/running';

import '@mora-light/vue/index.css';
import '@mora-light/vue/iconfont.css';

const canister_id = ref('nciuh-jiaaa-aaaai-qo75a-cai')
const hash = ref('AA5O64TBZ2FMJXM')
const prop: string = JSON.stringify({
    canister_id: { // If the operation of the light requires some data
        type: 'principal',
        value: 'ipcaz-wiaaa-aaaai-qoy4q-cai',
    },
});
const status = ref<ComponentStatus>('running'); // Run status
const hostAgent = ref<HttpAgent | undefined>(undefined); // If you have login information, you can provide Light components
</script>

<template>
    <div class="test-light">
        <WrappedMoraLightVue
            :anchor="{ canister_id, hash }"
            :prop="prop"
            :status="status"
            :hostAgent="hostAgent"
        />
    </div>
</template>

<style lang="less"></style>

b. Method 2

If you want to construct Light data yourself.

<script lang="ts" setup>
import { ref } from 'vue';
import { Principal } from '@dfinity/principal';
import { HttpAgent } from '@dfinity/agent';
import { WrappedMoraLight as WrappedMoraLightVue } from '@mora-light/vue';
import { ComponentStatus } from '@mora-light/core/types/running';
import { LightCore } from '@mora-light/core/types';

import '@mora-light/vue/index.css';
import '@mora-light/vue/iconfont.css';

// Construct Light data by yourself
let core: LightCore = {
    version: '0.0.1',
    data: [],
    transmits: [],
};

const info = {
    name: 'Light', // Light Name
    cover: 'QmfVV8acYbEnhjMN4G8Pru2gzLcsam8Y12zZt2TTNvsy9S', // Cover Image
    thumbnail: 'QmPMgAEogb3oaygekaEVZGvTtRcrag9RUYiizt7sPk4oSW', // Thumbnail Image
    categories: ['Tools'], // categories
    runnable_planet: { All: null }, // Runnable Planet
    instruction: "Light Instruction", // Light Instruction
};
const value = {
    hash: 'XXX', // Custom data
    id: 'XXX', // Custom data
    created: BigInt(new Date().getTime() * 1000000),
    creator: Principal.fromText('aaaaa-aa'),
    updated: BigInt(new Date().getTime() * 1000000),
    info_json: JSON.stringify(info),
    core_json: JSON.stringify(core),
    audited: BigInt(new Date().getTime() * 1000000),
    auditor: Principal.fromText('aaaaa-aa'),
};
const data = { value };
const prop: string = JSON.stringify({
    canister_id: { // If the operation of this light requires certain data
        type: 'principal',
        value: 'ipcaz-wiaaa-aaaai-qoy4q-cai',
    },
});
const status = ref<ComponentStatus>('running'); // Run status
const hostAgent = ref<HttpAgent | undefined>(undefined); // If you have login information, you can provide Light components
</script>

<template>
    <div class="test-light">
        <WrappedMoraLightVue
            :data="data"
            :prop="prop"
            :status="status"
            :hostAgent="hostAgent"
        />
    </div>
</template>

<style lang="less"></style>