Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion gatsby-browser.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import '@fontsource/ibm-plex-sans/500.css';
import '@fontsource/ibm-plex-sans/600.css';
import '@fontsource/ibm-plex-sans/700.css';
import '@fontsource/ibm-plex-mono/400.css';
import 'graphiql/graphiql.min.css';
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved this import to global.css, otherwise the styles were not applied in the interactive tours.

import { library } from '@fortawesome/fontawesome-svg-core';
import { fas } from '@fortawesome/free-solid-svg-icons';

Expand Down
51,154 changes: 14,535 additions & 36,619 deletions package-lock.json

Large diffs are not rendered by default.

38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,28 +33,28 @@
"@criipto/signatures": "^1.29.1",
"@fontsource/ibm-plex-mono": "^5.2.7",
"@fontsource/roboto-mono": "^4.5.8",
"@fortawesome/fontawesome-svg-core": "^1.3.0",
"@fortawesome/free-solid-svg-icons": "^6.0.0",
"@fortawesome/react-fontawesome": "^0.1.17",
"@fortawesome/fontawesome-svg-core": "^7.1.0",
"@fortawesome/free-solid-svg-icons": "^7.1.0",
"@fortawesome/react-fontawesome": "^3.2.0",
"@mdx-js/mdx": "^1.6.22",
"@mdx-js/react": "^2.0.0",
"@reduxjs/toolkit": "^2.5.1",
"@sentry/gatsby": "^7.63.0",
"@sentry/gatsby": "^10.38.0",
"algoliasearch": "^4.12.2",
"classnames": "^2.3.1",
"dotenv": "^16.0.0",
"gatsby": "^5.14.1",
"gatsby-plugin-algolia": "^0.16.1",
"gatsby": "^5.16.0",
"gatsby-plugin-algolia": "^1.0.3",
"gatsby-plugin-json-output": "^1.2.0",
"gatsby-plugin-manifest": "^5.14.0",
"gatsby-plugin-mdx": "^5.14.0",
"gatsby-plugin-sitemap": "^6.14.0",
"graphiql": "^3.8.3",
"gatsby-plugin-manifest": "^5.16.0",
"gatsby-plugin-mdx": "^5.16.0",
"gatsby-plugin-sitemap": "^6.16.0",
"graphiql": "^4.1.2",
"graphql-tag": "^2.12.6",
"jose": "^6.1.0",
"lodash": "^4.17.21",
"react": "^18.0.0",
"react-dom": "^18.0.0",
"react": "^19.2.4",
"react-dom": "^19.2.4",
"react-instantsearch": "^7.15.3",
"react-markdown": "^2.5.1",
"react-redux": "^9.2.0",
Expand All @@ -74,13 +74,13 @@
"@types/react-dom": "^19.2.3",
"@types/react-syntax-highlighter": "^15.5.3",
"autoprefixer": "^10.4.0",
"gatsby-adapter-netlify": "^1.2.0",
"gatsby-plugin-image": "^3.14.0",
"gatsby-plugin-postcss": "^6.14.0",
"gatsby-plugin-sharp": "^5.14.0",
"gatsby-remark-images": "^7.14.0",
"gatsby-source-filesystem": "^5.14.0",
"gatsby-transformer-sharp": "^5.14.0",
"gatsby-adapter-netlify": "^1.4.0",
"gatsby-plugin-image": "^3.16.0",
"gatsby-plugin-postcss": "^6.16.0",
"gatsby-plugin-sharp": "^5.16.0",
"gatsby-remark-images": "^7.16.0",
"gatsby-source-filesystem": "^5.16.0",
"gatsby-transformer-sharp": "^5.16.0",
"github-slugger": "^2.0.0",
"husky": "^9.1.7",
"lint-staged": "^16.2.3",
Expand Down
9 changes: 3 additions & 6 deletions src/components/GraphQLExplorer.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import React, { useState, useMemo, useCallback } from 'react';
import cx from 'classnames';
import GraphiQL from 'graphiql';
import { GraphiQL } from 'graphiql';
import { Link } from 'gatsby';
import { Button } from './Button/Button';
import { GraphQLError } from 'graphql';

import {
ApiCredentials,
Expand All @@ -25,12 +26,9 @@ export interface SignatoryCredentials {
token: string;
}

export interface GraphQLError {
message: string;
}
export interface GraphQLResponse<T = any> {
data?: T;
errors?: GraphQLError[];
errors?: readonly GraphQLError[];
}

export function graphQLFetcher<R = any, V = any>(
Expand Down Expand Up @@ -141,7 +139,6 @@ export default function GraphQLExplorer(props: GraphQLExplorerProps) {
variables={typeof variables === 'object' ? JSON.stringify(variables, null, 2) : variables}
defaultEditorToolsVisibility={'variables'}
isHeadersEditorEnabled={false}
disableTabs={true}
className="criipto-graphql-explorer"
forcedTheme="light"
/>
Expand Down
5 changes: 3 additions & 2 deletions src/components/InteractiveTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import * as addSignatoryExample from '../examples/addSignatory.graphql';
import * as closeSignatureOrderExample from '../examples/closeSignatureOrder.graphql';
import { AddSignatoryOutput } from '../../graphql-signatures-types';
import { useAppDispatch, useAppSelector } from '../state/hooks';
import GraphQLExplorer, { GraphQLResponse, GraphQLError, CredentialsForm } from './GraphQLExplorer';
import GraphQLExplorer, { GraphQLResponse, CredentialsForm } from './GraphQLExplorer';
import { GraphQLError } from 'graphql';
import { CodeBlock, H2, Paragraph } from './MdxProvider';
import { DesktopPageNavigation } from './PageNavigation';
import { clearExampleData } from '../state/store';
Expand Down Expand Up @@ -50,7 +51,7 @@ export default function InteractiveTour() {
const [signatories, setSignatories] = useState<AddSignatoryOutput['signatory'][]>([]);
const exampleData = useAppSelector(state => state.exampleData);
const dispatch = useAppDispatch();
const [errors, setErrors] = useState<GraphQLError[]>([]);
const [errors, setErrors] = useState<readonly GraphQLError[]>([]);
const [response, setResponse] = useState<GraphQLResponse | null>(null);

const handleResponse = (step: Step, response: GraphQLResponse) => {
Expand Down
13 changes: 7 additions & 6 deletions src/components/WebhookSignatureValidator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ function bytesToBase64(bytes: Uint8Array) {
}
return window.btoa(binary);
}
function base64ToBytes(base64: string): Uint8Array {
var binaryString = window.atob(base64);
var bytes = new Uint8Array(binaryString.length);
for (var i = 0; i < binaryString.length; i++) {

function base64ToArrayBuffer(base64: string): ArrayBuffer {
const binaryString = window.atob(base64);
const bytes = new Uint8Array(binaryString.length);
for (let i = 0; i < binaryString.length; i++){
bytes[i] = binaryString.charCodeAt(i);
}
return bytes;
return bytes.buffer;
}

export default function WebhookSignatureValidator() {
Expand All @@ -33,7 +34,7 @@ export default function WebhookSignatureValidator() {
const encoder = new TextEncoder();
const key = await window.crypto.subtle.importKey(
'raw',
base64ToBytes(secret),
base64ToArrayBuffer(secret),
{
name: 'hmac',
hash: 'SHA-256',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ import {
import { useAppDispatch, useAppSelector } from '../../state/hooks';
import GraphQLExplorer, {
GraphQLResponse,
GraphQLError,
CredentialsForm,
} from '../../components/GraphQLExplorer';
import { GraphQLError } from 'graphql';
import { H2, Paragraph } from '../../components/MdxProvider';
import { clearExampleData } from '../../state/store';

type Step =
| 'authenticate'
Expand Down Expand Up @@ -76,7 +75,7 @@ export default function InteractiveTour() {
>([]);
const exampleData = useAppSelector(state => state.exampleData);
const dispatch = useAppDispatch();
const [errors, setErrors] = useState<GraphQLError[]>([]);
const [errors, setErrors] = useState<readonly GraphQLError[]>([]);
const [response, setResponse] = useState<GraphQLResponse | null>(null);

const handleResponse = (step: Step, response: GraphQLResponse) => {
Expand Down
4 changes: 2 additions & 2 deletions src/layouts/default.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ export default function DefaultLayout(props: {
location: Location;
pageContext: any;
pageNavigationItems?: PageNavigationItem[];
isIduraBannerVisible: boolean;
onCloseBanner: () => void;
isIduraBannerVisible?: boolean;
onCloseBanner?: () => void;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bit of an unrelated change, I know. But the two required props were causing a TS error in gatsby-browser.tsx which was changed in this PR, so I assumed it's acceptable. I'll move it to a separate commit.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nmoskaleva Of course acceptable, just good to document why, in a separate commit :)

}) {
const { frontmatter } = props.pageContext;
const description = frontmatter?.description || frontmatter?.subtitle;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/signatures/guides/CustomSealsPageTemplateTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { AddSignatoryOutput } from '../../../../graphql-signatures-types';
import { useAppDispatch, useAppSelector } from '../../../state/hooks';
import GraphQLExplorer, {
GraphQLResponse,
GraphQLError,
CredentialsForm,
} from '../../../components/GraphQLExplorer';
import { GraphQLError } from 'graphql';
import { CodeBlock, H3, Paragraph } from '../../../components/MdxProvider';
import { clearExampleData } from '../../../state/store';
import partnershipAgreementImg from './images/partnership-agreement.png';
Expand Down Expand Up @@ -56,7 +56,7 @@ export default function InteractiveTour() {
const [signatories, setSignatories] = useState<AddSignatoryOutput['signatory'][]>([]);
const exampleData = useAppSelector(state => state.exampleData);
const dispatch = useAppDispatch();
const [errors, setErrors] = useState<GraphQLError[]>([]);
const [errors, setErrors] = useState<readonly GraphQLError[]>([]);
const [response, setResponse] = useState<GraphQLResponse | null>(null);

const handleResponse = (step: Step, response: GraphQLResponse) => {
Expand Down
4 changes: 2 additions & 2 deletions src/pages/signatures/guides/PdfFormFillingTour.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { AddSignatoryOutput } from '../../../../graphql-signatures-types';
import { useAppDispatch, useAppSelector } from '../../../state/hooks';
import GraphQLExplorer, {
GraphQLResponse,
GraphQLError,
CredentialsForm,
} from '../../../components/GraphQLExplorer';
import { GraphQLError } from 'graphql';
import { CodeBlock, H3, Paragraph } from '../../../components/MdxProvider';
import { clearExampleData } from '../../../state/store';

Expand Down Expand Up @@ -53,7 +53,7 @@ export default function InteractiveTour() {
const [signatories, setSignatories] = useState<AddSignatoryOutput['signatory'][]>([]);
const exampleData = useAppSelector(state => state.exampleData);
const dispatch = useAppDispatch();
const [errors, setErrors] = useState<GraphQLError[]>([]);
const [errors, setErrors] = useState<readonly GraphQLError[]>([]);
const [response, setResponse] = useState<GraphQLResponse | null>(null);

const handleResponse = (step: Step, response: GraphQLResponse) => {
Expand Down
3 changes: 2 additions & 1 deletion src/styles/global.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@import "graphiql/graphiql.css";

h1,
h2,
Expand Down Expand Up @@ -84,4 +85,4 @@ html {

input[type='search']::-webkit-search-cancel-button {
display: none;
}
}
6 changes: 5 additions & 1 deletion src/utils/algolia-queries.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ const pageQuery = `{
edges {
node {
id
internal {
contentDigest
}
frontmatter {
product
title
Expand All @@ -19,9 +22,10 @@ const pageQuery = `{
}
}
}`;
function pageToAlgoliaRecord({ node: { id, frontmatter, fields, ...rest } }) {
function pageToAlgoliaRecord({ node: { id, internal, frontmatter, fields, ...rest } }) {
return {
objectID: id,
internal,
...frontmatter,
...fields,
...rest,
Expand Down
Loading