0.8.0 • Published 2 years ago

@puzzlelabs/puzzle-glossary-react v0.8.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Puzzle Glossary

Puzzle Labs is an AI content workflow engine. It lies at the intersection of people, processes, and technology used to improve teams’ content workflows. Teams get a 10x accelerating boost to their content operations processes by using Puzzle.

Recommended Install

npm install @puzzlelabs/puzzle-glossary @puzzlelabs/puzzle-glossary-react

Highlight Widget Example

import {StrictMode} from "react";
import {createRoot} from "react-dom/client";
import {HighlightZone} from "@puzzlelabs/puzzle-glossary-react";
import {highlightWidgetManager} from "@puzzlelabs/puzzle-glossary";
import {defineCustomElements} from '@puzzlelabs/puzzle-glossary/dist/loader';

defineCustomElements();

const App = () => (
  <HighlightZone as='p'>
    Search openai We are on the verge of a creative renaissance.
  </HighlightZone>
);

const root = createRoot(document.getElementById("root"));

root.render(
  <StrictMode>
    <App/>
  </StrictMode>
);

// For react you not needed specify selectors
highlightWidgetManager.config = {
  hasMarkAll: true,
  puzzleBranding: true,
  hasMarkHyperlink: true,
  callToAction: {
    text: 'CTA',
    link: 'https://puzzlelabs.ai',
  },
};

highlightWidgetManager.theme = {
  mode: 'light',
  // fontFamily: 'Inter',
  // marker: {
  //   color: 'black',
  //   type: 'highlight',
  // },
  // resource: {
  //   color: 'black',
  // },
  // callToAction: {
  //     color: 'black',
  //     backgroundColor: 'black',
  // },
  // modal: {
  //     primaryColor: 'black',
  //     secondaryColor: 'black',
  //     backgroundColor: 'black',
  // }
};

highlightWidgetManager.handlers = {
  onCopyClick: console.log,
  onMarkerHover: console.log,
  onMarkerClick: console.log,
  onResourceClick: console.log,
  onCtaClick: console.log,
  onEvent: console.log,
}

// For react you need call only init without mark
highlightWidgetManager.init('6437d691b3c98451b429460f');

Page Widget Example

import './index.css';
import {StrictMode} from "react";
import {createRoot} from "react-dom/client";
import {PageWidget} from "@puzzlelabs/puzzle-glossary-react";
import {defineCustomElements} from '@puzzlelabs/puzzle-glossary/dist/loader';

defineCustomElements();

// For remix use this method of component initialization
// import {defineCustomElementsFromUnPkg} from "@puzzlelabs/puzzle-glossary";
// defineCustomElementsFromUnPkg();

const PageWidgetExample = () => (
  <PageWidget apiKey='6437d691b3c98451b429460f'/>
)

const root = createRoot(document.getElementById("root"));

root.render(
  <StrictMode>
    <PageWidgetExample/>
  </StrictMode>
);
0.7.2

2 years ago

0.7.1

2 years ago

0.7.0

2 years ago

0.6.3-rc.35

2 years ago

0.6.3-rc.36

2 years ago

0.6.3-rc.37

2 years ago

0.8.0

2 years ago

0.6.3-rc.30

2 years ago

0.6.3-rc.31

2 years ago

0.6.3-rc.34

2 years ago

0.6.3-rc.32

2 years ago

0.6.3-rc.33

2 years ago

0.6.3-rc.27

2 years ago

0.6.3-rc.28

2 years ago

0.6.3-rc.26

2 years ago

0.6.3-rc.29

2 years ago

0.6.3-rc.12

2 years ago

0.6.3-rc.13

2 years ago

0.6.3-rc.10

2 years ago

0.6.3-rc.11

2 years ago

0.6.3-rc.7

2 years ago

0.6.3-rc.8

2 years ago

0.6.3-rc.5

2 years ago

0.6.3-rc.6

2 years ago

0.6.3-rc.9

2 years ago

0.6.3-rc.16

2 years ago

0.6.3-rc.17

2 years ago

0.6.3-rc.0

2 years ago

0.6.3-rc.14

2 years ago

0.6.3-rc.15

2 years ago

0.6.3-rc.3

2 years ago

0.6.3-rc.4

2 years ago

0.6.3-rc.18

2 years ago

0.6.3-rc.1

2 years ago

0.6.3-rc.19

2 years ago

0.6.3-rc.2

2 years ago

0.5.8

2 years ago

0.5.7

2 years ago

0.5.9

2 years ago

0.6.3-rc.20

2 years ago

0.6.3-rc.23

2 years ago

0.6.3-rc.24

2 years ago

0.6.3-rc.21

2 years ago

0.6.3-rc.22

2 years ago

0.4.4

2 years ago

0.6.3-rc.25

2 years ago

0.6.4

2 years ago

0.6.1

2 years ago

0.6.0

2 years ago

0.1.10

2 years ago

0.3.0

2 years ago

0.2.0

2 years ago

0.1.9

2 years ago

0.4.1

2 years ago

0.4.3

2 years ago

0.4.2

2 years ago

0.1.2

2 years ago

0.1.8

2 years ago

0.1.7

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.6

2 years ago

0.1.5

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.12

2 years ago

0.0.11

2 years ago

0.0.10

2 years ago

0.0.9

2 years ago

0.0.8

2 years ago

0.0.4

2 years ago