Skip to content

Commit

Permalink
Update react-asciidoc
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminleonard committed Nov 12, 2024
1 parent b1255e3 commit caf2a44
Show file tree
Hide file tree
Showing 10 changed files with 2,511 additions and 53,856 deletions.
12 changes: 3 additions & 9 deletions components/dist/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
import * as react_jsx_runtime from 'react/jsx-runtime';
import * as _asciidoctor_core_types from '@asciidoctor/core/types';
import * as _oxide_react_asciidoc from '@oxide/react-asciidoc';
import * as react from 'react';
import { ReactNode } from 'react';
import { TabsProps, TabsTriggerProps, TabsListProps, TabsContentProps } from '@radix-ui/react-tabs';
import { SetRequired } from 'type-fest';

declare const AsciiDocBlocks: {
Admonition: ({ node }: {
node: _asciidoctor_core_types.Block;
}) => react_jsx_runtime.JSX.Element;
Listing: ({ node }: {
node: _asciidoctor_core_types.Block;
node: _oxide_react_asciidoc.AdmonitionBlock;
}) => react_jsx_runtime.JSX.Element;
Table: ({ node }: {
node: _asciidoctor_core_types.Table;
}) => react_jsx_runtime.JSX.Element;
Section: ({ node }: {
node: _asciidoctor_core_types.Section;
node: _oxide_react_asciidoc.TableBlock;
}) => react_jsx_runtime.JSX.Element;
};

Expand Down
54,362 changes: 2,127 additions & 52,235 deletions components/dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion components/dist/index.js.map

Large diffs are not rendered by default.

15 changes: 7 additions & 8 deletions components/src/AsciiDoc/Admonition.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,13 @@
*
* Copyright Oxide Computer Company
*/
import { type AdocTypes, Title, getContent } from '@oxide/react-asciidoc'
import { AdmonitionBlock, Title } from '@oxide/react-asciidoc'
import parse from 'html-react-parser'

import { titleCase } from '../utils'

const Admonition = ({ node }: { node: AdocTypes.Block }) => {
const attrs = node.getAttributes()
const content = getContent(node)
const Admonition = ({ node }: { node: AdmonitionBlock }) => {
const attrs = node.attributes

let icon
if (attrs.name === 'caution') {
Expand All @@ -27,11 +26,11 @@ const Admonition = ({ node }: { node: AdocTypes.Block }) => {
<div className={`admonitionblock ${attrs.name}`}>
<div className="admonition-icon">{icon}</div>
<div className="admonition-content content">
<Title node={node} />
<div>{titleCase(attrs.name)}</div>
<Title text={node.title} />
<div>{titleCase(attrs.name.toString())}</div>
<div>
<Title node={node} />
{parse(content)}
<Title text={node.title} />
{node.content && parse(node.content)}
</div>
</div>
</div>
Expand Down
84 changes: 0 additions & 84 deletions components/src/AsciiDoc/Listing.tsx

This file was deleted.

4 changes: 2 additions & 2 deletions components/src/AsciiDoc/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*
* Copyright Oxide Computer Company
*/
import { type AdocTypes, Table as InnerTable } from '@oxide/react-asciidoc'
import { Table as InnerTable, TableBlock } from '@oxide/react-asciidoc'

const Table = ({ node }: { node: AdocTypes.Table }) => (
const Table = ({ node }: { node: TableBlock }) => (
<div className="table-wrapper">
<InnerTable node={node} />
</div>
Expand Down
4 changes: 0 additions & 4 deletions components/src/AsciiDoc/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,9 @@
* Copyright Oxide Computer Company
*/
import Admonition from './Admonition'
import Listing from './Listing'
import Section from './Section'
import Table from './Table'

export const AsciiDocBlocks = {
Admonition,
Listing,
Table,
Section,
}
84 changes: 0 additions & 84 deletions components/src/asciidoc/Section.tsx

This file was deleted.

Loading

0 comments on commit caf2a44

Please sign in to comment.