1.0.1-alfa • Published 6 months ago

@intersect.mbo/pdf-ui v1.0.1-alfa

Weekly downloads
-
License
-
Repository
-
Last release
6 months ago

@intersect.mbo/pdf-ui

The @intersect.mbo/pdf-ui is a React.js package that includes all the necessary logic and UI components required for the operation of a proposal discussion forum.

Table of content:

Installation

To install this pacakge, use npm or yarn:

npm install @intersect.mbo/pdf-ui

or

yarn add @intersect.mbo/pdf-ui

Usage

After installation, you can import the component and use it in your project.

This is an example of implementing a package in a NextJs application

'use client';
import dynamic from 'next/dynamic';
import { useValidateMutation } from "@/hooks/mutations";
import { useCardano, useGovernanceActions } from "@/context";

const ProposalDiscussion = dynamic(() => import('@intersect.mbo/pdf-ui'), {
    ssr: false,
});

export default function Page() {
    const { validateMetadata } = useValidateMutation();
    const { walletApi, ...context } = useCardano();
    const { createGovernanceActionJsonLD, createHash } = useGovernanceActions();

    return (
        <ProposalDiscussion
            pdfApiUrl="https://xxxxx"
            walletAPI={{
              ...context,
              ...walletApi,
              createGovernanceActionJsonLD,
              createHash,
            }}
            pathname={window.location.pathname}
            validateMetadata={
              validateMetadata as ComponentProps<
                typeof ProposalDiscussion
              >["validateMetadata"]
            }
        />
    );
}

Example of Implementing a Package Using CommonJS Modules (CJS):

import React, { ComponentProps } from "react";
import "@intersect.mbo/pdf-ui/style";
import { useCardano, useGovernanceActions } from "@/context";
import { useValidateMutation } from "@/hooks/mutations";

const ProposalDiscussion = React.lazy(
  () => import("@intersect.mbo/pdf-ui/cjs"),
);

export const ProposalDiscussionPillar = () => {
  const { validateMetadata } = useValidateMutation();
  const { walletApi, ...context } = useCardano();
  const { createGovernanceActionJsonLD, createHash } = useGovernanceActions();

  return (
          <ProposalDiscussion
            pdfApiUrl="https://xxxxx"
            walletAPI={{
              ...context,
              ...walletApi,
              createGovernanceActionJsonLD,
              createHash,
            }}
            pathname={window.location.pathname}
            validateMetadata={
              validateMetadata as ComponentProps<
                typeof ProposalDiscussion
              >["validateMetadata"]
            }
          />
  )
};

Project Structure

├── node_modules
├── src
│   ├── assets
│   ├── components
│   ├── context
│   ├── lib
│   ├── pages
│   ├── styles
│   └── App.jsx
│   └── index.js
│   └── index.scss
└── rollup.config.js
  • assets/: The @intersect.mbo/pdf-ui assets.
  • components/: The @intersect.mbo/pdf-ui components.
  • context/: Context for global application state.
  • lib/: Libraries and helper functions.
  • pages/: Application pages.
  • styles/: SCSS files for styling the application.
  • index.js: Main application file.
  • index.scss: Main application styles file.
  • rollup.config.js: Configuration for the Rollup bundler.

Prerequisites

Before starting, please ensure you have the following:

  • Node.js and npm - Latest versions. You can download them from here.

Running locally

To launch the package, it is necessary to have an application (for example, a Next.js app) into which this package is imported. This wrapper application must provide wallet connectivity to supply the wallet API to the package.

0.5.10

11 months ago

0.5.11

11 months ago

1.0.1-alfa

6 months ago

0.7.0-beta

9 months ago

0.7.0-beta-31

7 months ago

0.7.0-beta-30

7 months ago

0.7.0-beta-33

7 months ago

0.7.0-beta-32

7 months ago

0.7.0-beta-35

7 months ago

0.7.0-beta-34

7 months ago

0.7.0-beta-36

7 months ago

0.5.4

1 year ago

0.5.3

1 year ago

0.5.6

11 months ago

0.5.5

1 year ago

0.5.0

1 year ago

0.5.2

1 year ago

0.5.1

1 year ago

1.0.0-alfa

7 months ago

0.5.8

11 months ago

0.5.7

11 months ago

0.5.9

11 months ago

0.7.0-beta-28

7 months ago

0.7.0-beta-27

7 months ago

0.7.0-beta-29

7 months ago

0.7.0-beta-20

8 months ago

0.7.0-beta-22

8 months ago

0.7.0-beta-21

8 months ago

0.7.0-beta-24

8 months ago

0.7.0-beta-23

8 months ago

0.7.0-beta-26

8 months ago

0.7.0-beta-25

8 months ago

0.7.0-beta-17

8 months ago

0.7.0-beta-16

8 months ago

0.7.0-beta-19

8 months ago

0.7.0-beta-18

8 months ago

0.7.0-beta-11

9 months ago

0.7.0-beta-10

9 months ago

0.7.0-beta-2

9 months ago

0.7.0-beta-13

9 months ago

1.0.0-beta

6 months ago

0.7.0-beta-12

9 months ago

0.7.0-beta-15

8 months ago

0.7.0-beta-14

8 months ago

0.7.0-beta-7

9 months ago

0.6.3

10 months ago

0.7.0-beta-8

9 months ago

0.6.2

10 months ago

0.7.0-beta-9

9 months ago

0.6.4

10 months ago

0.7.0-beta-3

9 months ago

0.4.1

1 year ago

0.7.0-beta-4

9 months ago

0.7.0-beta-5

9 months ago

0.6.1

10 months ago

0.7.0-beta-6

9 months ago

0.6.0

10 months ago

0.3.9

1 year ago

0.3.6

1 year ago

0.3.5

1 year ago

0.3.8

1 year ago

0.3.7

1 year ago

0.4.0

1 year ago

0.3.4

1 year ago

0.3.3

1 year ago

0.3.2

1 year ago

0.3.1

1 year ago

0.3.0

1 year ago

0.2.9

1 year ago

0.2.8

1 year ago

0.2.7

1 year ago

0.2.6

1 year ago

0.2.5

1 year ago

0.2.4

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago