1.0.1-alfa • Published 5 months ago

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

Weekly downloads
-
License
-
Repository
-
Last release
5 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

9 months ago

0.5.11

9 months ago

1.0.1-alfa

5 months ago

0.7.0-beta

7 months ago

0.7.0-beta-31

5 months ago

0.7.0-beta-30

5 months ago

0.7.0-beta-33

5 months ago

0.7.0-beta-32

5 months ago

0.7.0-beta-35

5 months ago

0.7.0-beta-34

5 months ago

0.7.0-beta-36

5 months ago

0.5.4

11 months ago

0.5.3

11 months ago

0.5.6

10 months ago

0.5.5

11 months ago

0.5.0

11 months ago

0.5.2

11 months ago

0.5.1

11 months ago

1.0.0-alfa

5 months ago

0.5.8

9 months ago

0.5.7

9 months ago

0.5.9

9 months ago

0.7.0-beta-28

5 months ago

0.7.0-beta-27

5 months ago

0.7.0-beta-29

5 months ago

0.7.0-beta-20

6 months ago

0.7.0-beta-22

6 months ago

0.7.0-beta-21

6 months ago

0.7.0-beta-24

6 months ago

0.7.0-beta-23

6 months ago

0.7.0-beta-26

6 months ago

0.7.0-beta-25

6 months ago

0.7.0-beta-17

7 months ago

0.7.0-beta-16

7 months ago

0.7.0-beta-19

6 months ago

0.7.0-beta-18

6 months ago

0.7.0-beta-11

7 months ago

0.7.0-beta-10

7 months ago

0.7.0-beta-2

7 months ago

0.7.0-beta-13

7 months ago

1.0.0-beta

5 months ago

0.7.0-beta-12

7 months ago

0.7.0-beta-15

7 months ago

0.7.0-beta-14

7 months ago

0.7.0-beta-7

7 months ago

0.6.3

8 months ago

0.7.0-beta-8

7 months ago

0.6.2

8 months ago

0.7.0-beta-9

7 months ago

0.6.4

8 months ago

0.7.0-beta-3

7 months ago

0.4.1

11 months ago

0.7.0-beta-4

7 months ago

0.7.0-beta-5

7 months ago

0.6.1

8 months ago

0.7.0-beta-6

7 months ago

0.6.0

9 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

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago