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,596 changes: 191 additions & 1,405 deletions znai-reactjs/package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion znai-reactjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
},
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"build": "vite build",
"test": "vitest --config ./vitest.config.ts",
"test:watch": "vitest --config ./vitest.config.ts --watch",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
Expand Down
6 changes: 3 additions & 3 deletions znai-reactjs/src/components/Tooltip.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
* limitations under the License.
*/

import type { CSSProperties } from "react";
import { CSSProperties } from "react";
import React from "react";

import type { Registry } from "react-component-viewer";
import type { TooltipPlacement} from "./Tooltip";
import { Registry } from "react-component-viewer";
import { TooltipPlacement} from "./Tooltip";
import { Tooltip, TooltipRenderer } from "./Tooltip";

export function tooltipDemo(registry: Registry) {
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/components/Tooltip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { CSSProperties} from "react";
import { CSSProperties} from "react";
import React, { useEffect, useRef, useState } from "react";

import "./Tooltip.css";
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/diff/DiffTracking.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import React from "react";

import type { Registry} from "react-component-viewer";
import { Registry} from "react-component-viewer";
import { simulateState } from "react-component-viewer";
import {
DiffTracking,
Expand Down
4 changes: 2 additions & 2 deletions znai-reactjs/src/diff/DiffTracking.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export class DiffTracking extends React.Component<Props, {}> {
this.scrollNode = node.querySelector("." + mainPanelClassName);
};

getSnapshotBeforeUpdate(prevProps: Props, prevState: {}) {
getSnapshotBeforeUpdate(_prevProps: Props, _prevState: {}) {
if (!enabled) {
return null;
}
Expand All @@ -62,7 +62,7 @@ export class DiffTracking extends React.Component<Props, {}> {
};
}

componentDidUpdate(prevProps: Props, prevState: {}, snapshot: { beforeNode: HTMLElement }) {
componentDidUpdate(_prevProps: Props, _prevState: {}, snapshot: { beforeNode: HTMLElement }) {
if (!snapshot) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/api/ApiLinkedTextBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";

import type { ApiLinkedText } from "./ApiLinkedText";
import { ApiLinkedText } from "./ApiLinkedText";

import { LinkWrapper } from "../default-elements/LinkWrapper";
import { isLocalUrl } from "../../structure/links";
Expand Down
4 changes: 2 additions & 2 deletions znai-reactjs/src/doc-elements/api/ApiParameter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

import React, { useEffect, useRef, useState } from "react";

import type { ApiParameterProps } from "./ApiParameters";
import { ApiParameterProps } from "./ApiParameters";
import ApiParameters from "./ApiParameters";
import { ReferenceLinkWrapper } from "../references/ReferenceLinkWrapper";

import { Icon } from "../icons/Icon";
import { ApiLinkedTextBlock } from "./ApiLinkedTextBlock";

import type { WithElementsLibrary } from "../default-elements/DocElement";
import { WithElementsLibrary } from "../default-elements/DocElement";

import "./ApiParameter.css";

Expand Down
8 changes: 4 additions & 4 deletions znai-reactjs/src/doc-elements/api/ApiParameters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@

import React from "react";

import type { DocElementContent, DocElementProps } from "../default-elements/DocElement";
import type { ApiLinkedText } from "./ApiLinkedText";
import { DocElementContent, DocElementProps } from "../default-elements/DocElement";
import { ApiLinkedText } from "./ApiLinkedText";
import { ApiParameter } from "./ApiParameter";

import { Snippet } from "../code-snippets/Snippet";

import type { ContainerTitleCommonProps} from "../container/ContainerTitle";
import { ContainerTitleCommonProps} from "../container/ContainerTitle";
import { ContainerTitle, useIsUserDrivenCollapsed } from "../container/ContainerTitle";
import type { ContainerCommonProps } from "../container/Container";
import { ContainerCommonProps } from "../container/Container";
import { Container } from "../container/Container";

import "./ApiParameters.css";
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/badge/TextBadge.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";

import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";
import { TextBadge } from "./TextBadge";

export function textBadgeDemo(registry: Registry) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import React from "react";

import { elementsLibrary } from "../DefaultElementsLibrary";
import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";

export function smartBulletListsDemo(registry: Registry) {
registry.add("steps left", () => (
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/card/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";

import type { DocElementContent, WithElementsLibrary } from "../default-elements/DocElement";
import { DocElementContent, WithElementsLibrary } from "../default-elements/DocElement";

import { extractLinkTextAndUrl, isContentElementSelfContainedLink } from "./cardContentAnalyzer";
import { LinkWrapper } from "../default-elements/LinkWrapper";
Expand Down
4 changes: 2 additions & 2 deletions znai-reactjs/src/doc-elements/card/CardsDemo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";

import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";
import { Card } from "./Card";
import {
contentApiParameters,
Expand All @@ -27,7 +27,7 @@ import {
contentTable,
} from "../demo-utils/contentGenerators";
import { elementsLibrary } from "../DefaultElementsLibrary";
import type { DocElementContent } from "../default-elements/DocElement";
import { DocElementContent } from "../default-elements/DocElement";

export function cardsDemo(registry: Registry) {
registry.add("large image", () => (
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/card/cardContentAnalyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { DocElementPayload } from "../default-elements/DocElement";
import { DocElementPayload } from "../default-elements/DocElement";

export function isContentElementSelfContainedLink(element: DocElementPayload) {
return (
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/Echart.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import React from "react";
import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";
import { EchartGeneric } from "./EchartGeneric";

export function echartDemo(registry: Registry) {
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/EchartBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";
import { EchartReactWrapper } from "./EchartReactWrapper";
import type { EchartCommonProps } from "./EchartCommon";
import { EchartCommonProps } from "./EchartCommon";
import { echartCalcBreakpoint, findBreakpointDataIndexForText } from "./echartUtils";

interface Props extends EchartCommonProps {
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/EchartCommon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { GridComponent, TooltipComponent, LegendComponent, TimelineComponent } f
import { BarChart, LineChart, PieChart } from "echarts/charts";
import { LabelLayout } from "echarts/features";
import { SVGRenderer } from "echarts/renderers";
import type { PresentationProps } from "../presentation/PresentationProps";
import { PresentationProps } from "../presentation/PresentationProps";

let configured = false;
export function configuredEcharts() {
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/EchartGeneric.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React from "react";
import { EchartBar } from "./EchartBar";
import { EchartPie } from "./EchartPie";
import { EchartLine } from "./EchartLine";
import type { PresentationProps } from "../presentation/PresentationProps";
import { PresentationProps } from "../presentation/PresentationProps";

interface Props extends PresentationProps {
chartType: string;
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/EchartLine.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";
import { EchartReactWrapper } from "./EchartReactWrapper";
import type { EchartCommonProps } from "./EchartCommon";
import { EchartCommonProps } from "./EchartCommon";
import {
createInvisibleLineSeries,
echartCalcBreakpoint,
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/EchartPie.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";
import { EchartReactWrapper } from "./EchartReactWrapper";
import type { EchartCommonProps } from "./EchartCommon";
import { EchartCommonProps } from "./EchartCommon";
import { echartCalcBreakpoint, findBreakpointDataIndexForText } from "./echartUtils";

export function EchartPie(props: EchartCommonProps) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import { createPresentationDemo } from "../demo-utils/PresentationDemo";
import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";

export function chartsPresentationDemo(registry: Registry) {
registry.add(
Expand Down
4 changes: 2 additions & 2 deletions znai-reactjs/src/doc-elements/charts/EchartReactWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/

import React, {type MutableRefObject, type RefObject, useEffect, useRef } from "react";
import type {EChartsType} from "echarts/types/dist/shared";
import {EChartsType} from "echarts/types/dist/shared";
import { configuredEcharts, type EchartCommonProps } from "./EchartCommon";

import type {PresentationProps} from "../presentation/PresentationProps";
import {PresentationProps} from "../presentation/PresentationProps";

import { echartGridUsingMaxDataAndLegend } from "./echartUtils";

Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/charts/echartUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { EchartCommonProps } from "./EchartCommon";
import { EchartCommonProps } from "./EchartCommon";

export function isNumericChartValue(value: any) {
return typeof value === "number";
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/cli/CliCommand.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import React, { useState, useEffect, useMemo } from "react";

import CliCommandToken from "./CliCommandToken";
import { splitParts } from "../../utils/strings";
import type { DocElementPayload } from "../default-elements/DocElement";
import { DocElementPayload } from "../default-elements/DocElement";
import "./CliCommand.css";

interface Token {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { Snippet } from "./Snippet";
import { TwoSidesLayoutRightPart } from "../page/two-sides/TwoSidesLayout";
import { TooltipRenderer } from "../../components/Tooltip";
import { elementsLibrary } from "../DefaultElementsLibrary";
import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";

export function snippetsWithInlineCommentsDemo(registry: Registry) {
registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ import { isCommentToken, lineWithTokensTrimmedOnRight } from "./codeUtils";

import { mergeWithGlobalDocReferences } from "../references/globalDocReferences";

import type { SnippetDocReferences } from "../references/SnippetDocReferences";
import type { DocElementContent, ElementsLibraryMap } from "../default-elements/DocElement";
import { SnippetDocReferences } from "../references/SnippetDocReferences";
import { DocElementContent, ElementsLibraryMap } from "../default-elements/DocElement";

import "./CodeSnippetWithCallouts.css";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";
import { Snippet } from "./Snippet";
import React from "react";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ import * as React from "react";
import { InlinedCode } from "./InlinedCode";
import Link from "../default-elements/Link";
import { elementsLibrary } from "../DefaultElementsLibrary";
import type { Registry } from "react-component-viewer";
import type { DocElementContent } from "../default-elements/DocElement";
import { Registry } from "react-component-viewer";
import { DocElementContent } from "../default-elements/DocElement";

export function inlinedCodeDemo(registry: Registry) {
registry
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import * as React from "react";

import { mergeWithGlobalDocReferences } from "../references/globalDocReferences";
import { ReferenceLinkWrapper } from "../references/ReferenceLinkWrapper";
import type { SnippetDocReferences } from "../references/SnippetDocReferences";
import { SnippetDocReferences } from "../references/SnippetDocReferences";

import "./InlinedCode.css";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import React from "react";
import type { PresentationProps } from "../presentation/PresentationProps";
import { PresentationProps } from "../presentation/PresentationProps";

import { extractTextFromTokens } from "./codeUtils";
import { repeatChar } from "../../utils/strings";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import React, { useState } from "react";

import { SnippetCircleBadge } from "./SnippetCircleBadge";

import type { DocElementContent, ElementsLibraryMap } from "../../default-elements/DocElement";
import { DocElementContent, ElementsLibraryMap } from "../../default-elements/DocElement";

interface Props {
callouts: Record<number, DocElementContent>;
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/columns/Columns.demo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import React from "react";
import { elementsLibrary } from "../DefaultElementsLibrary";
import { Columns } from "./Columns";
import { ViewPortProvider } from "../../theme/ViewPortContext";
import type { Registry } from "react-component-viewer";
import { Registry } from "react-component-viewer";

export function columnsDemo(registry: Registry) {
registry
Expand Down
4 changes: 2 additions & 2 deletions znai-reactjs/src/doc-elements/columns/Columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ import React, {type CSSProperties } from "react";

import { useIsMobile } from "../../theme/ViewPortContext";

import type {DocElementContent, ElementsLibraryMap} from "../default-elements/DocElement";
import {DocElementContent, ElementsLibraryMap} from "../default-elements/DocElement";
// @ts-ignore
import "./Columns.css";
import type {Property} from "csstype";
import {Property} from "csstype";

interface ColumnConfig {
border?: boolean;
Expand Down
4 changes: 2 additions & 2 deletions znai-reactjs/src/doc-elements/container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
* limitations under the License.
*/

import type { CSSProperties } from "react";
import { CSSProperties } from "react";
import React from "react";

import type { DocElementPayload } from "../default-elements/DocElement";
import { DocElementPayload } from "../default-elements/DocElement";

import "./Container.css";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import React from "react";

import type { Registry} from "react-component-viewer";
import { Registry} from "react-component-viewer";
import { simulateState } from "react-component-viewer";
import { ContainerTitle } from "./ContainerTitle";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

import React from "react";
import type { DocElementContent, ElementsLibraryMap } from "./DocElement";
import { DocElementContent, ElementsLibraryMap } from "./DocElement";

interface Props {
title: string;
Expand Down
2 changes: 1 addition & 1 deletion znai-reactjs/src/doc-elements/default-elements/Link.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import React from "react";
import { isLocalUrl } from "../../structure/links";
import { LinkWrapper } from "./LinkWrapper";
import type { DocElementProps } from "./DocElement";
import { DocElementProps } from "./DocElement";

import "./Link.css";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

import type { DocElementProps } from "./DocElement";
import { DocElementProps } from "./DocElement";
import React from "react";

interface Props extends DocElementProps {
Expand Down
Loading