Skip to content

Commit 456a7ec

Browse files
committed
Fix build issues due to server-side rendering, fix broken links
1 parent ab92213 commit 456a7ec

7 files changed

Lines changed: 60 additions & 41 deletions

File tree

docs/concepts/data-provider.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebar_position: 2
44

55
# Data Provider
66

7-
Reactodia defines a contract ([`DataProvider`](/docs/api/workspace/interfaces/DataProvider) interface) to query a subset of data from external source ([data graph](./graph-model.md#data-graph)) to provide means for incremental data loading when exploring the graph.
7+
Reactodia defines a contract ([`DataProvider`](/docs/api/workspace/interfaces/DataProvider) interface) to query a subset of data from external source ([data graph](/docs/concepts/graph-model#data-graph)) to provide means for incremental data loading when exploring the graph.
88

99
## IRI and RDF
1010

@@ -17,7 +17,7 @@ Reactodia uses RDF ([Resource Description Framework](https://en.wikipedia.org/wi
1717

1818
For interoperability with other RDF-based libraries for JavaScript, the property values for entities and relations are stored as either **named node** or **literal** values using commonly used [RDF/JS](https://rdf.js.org/) representation.
1919

20-
To provide improved type-safety with TypeScript when dealing with various kinds of IRIs from the [data graph](./graph-model.md#data-graph), the library uses the following [branded string types](https://www.learningtypescript.com/articles/branded-types):
20+
To provide improved type-safety with TypeScript when dealing with various kinds of IRIs from the [data graph](/docs/concepts/graph-model#data-graph), the library uses the following [branded string types](https://www.learningtypescript.com/articles/branded-types):
2121

2222
| Type | Description |
2323
|-----------------|-------------|

docs/concepts/design-system.mdx

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ sidebar_position: 10
33
title: Design System
44
---
55

6+
import BrowserOnly from '@docusaurus/BrowserOnly';
67
import * as React from 'react';
7-
import * as Reactodia from '@reactodia/workspace';
88
import { ButtonToggle } from '@site/src/components/ButtonToggle';
99
import { ColorBoxes } from '@site/src/components/ColorBoxes';
10+
import { WithReactodiaStyles } from '@site/src/components/WithReactodiaStyles';
1011

1112
# Basic Design System
1213

@@ -26,14 +27,14 @@ Toggle active color scheme at the top to see how the default colors are defined
2627

2728
### Grays {#color-grays}
2829

29-
<Reactodia.WorkspaceRoot>
30+
<WithReactodiaStyles>
3031
<ColorBoxes
3132
colors={Array.from(
3233
{length: 11},
3334
(_, i) => `var(--reactodia-color-gray-${i * 100})`)
3435
}
3536
/>
36-
</Reactodia.WorkspaceRoot>
37+
</WithReactodiaStyles>
3738

3839
Color-scheme independent gray colors gradient from 0 (white) to 1000 (black) in increments of 100:
3940
```css
@@ -42,14 +43,14 @@ Color-scheme independent gray colors gradient from 0 (white) to 1000 (black) in
4243

4344
### Emphasis {#color-emphasis}
4445

45-
<Reactodia.WorkspaceRoot>
46+
<WithReactodiaStyles>
4647
<ColorBoxes
4748
colors={Array.from(
4849
{length: 11},
4950
(_, i) => `var(--reactodia-color-emphasis-${i * 100})`)
5051
}
5152
/>
52-
</Reactodia.WorkspaceRoot>
53+
</WithReactodiaStyles>
5354

5455
Color-scheme specific gray colors gradient from 0 (same as schema color) to 1000 (opposite to schema color) in increments of 100:
5556
```css
@@ -58,15 +59,15 @@ Color-scheme specific gray colors gradient from 0 (same as schema color) to 1000
5859

5960
### Content and Background
6061

61-
<Reactodia.WorkspaceRoot>
62+
<WithReactodiaStyles>
6263
<ColorBoxes
6364
colors={[
6465
'var(--reactodia-color-content)',
6566
'var(--reactodia-color-content-inverse)',
6667
'var(--reactodia-color-content-contrast)',
6768
]}
6869
/>
69-
</Reactodia.WorkspaceRoot>
70+
</WithReactodiaStyles>
7071

7172
Color-scheme specific color for a text-like content, pure inverse for the background, and a contrast (which is suitable for content on top of a background of the named color):
7273
```css
@@ -75,14 +76,14 @@ Color-scheme specific color for a text-like content, pure inverse for the backgr
7576
--reactodia-color-content-contrast
7677
```
7778

78-
<Reactodia.WorkspaceRoot>
79+
<WithReactodiaStyles>
7980
<ColorBoxes
8081
colors={[
8182
'var(--reactodia-background-color)',
8283
'var(--reactodia-background-color-surface)',
8384
]}
8485
/>
85-
</Reactodia.WorkspaceRoot>
86+
</WithReactodiaStyles>
8687

8788
Color-scheme specific color for a background-like layers, and a surface one which can be used for layers placed on top of the main background:
8889
```css
@@ -133,39 +134,39 @@ Additionally, each color has a contrast foreground (to put on the named color) a
133134

134135
#### `primary` color
135136

136-
<Reactodia.WorkspaceRoot>
137+
<WithReactodiaStyles>
137138
<NamedColorBoxes color='primary' />
138-
</Reactodia.WorkspaceRoot>
139+
</WithReactodiaStyles>
139140

140141
#### `secondary` color
141142

142-
<Reactodia.WorkspaceRoot>
143+
<WithReactodiaStyles>
143144
<NamedColorBoxes color='secondary' />
144-
</Reactodia.WorkspaceRoot>
145+
</WithReactodiaStyles>
145146

146147
#### `success` color
147148

148-
<Reactodia.WorkspaceRoot>
149+
<WithReactodiaStyles>
149150
<NamedColorBoxes color='success' />
150-
</Reactodia.WorkspaceRoot>
151+
</WithReactodiaStyles>
151152

152153
#### `info` color
153154

154-
<Reactodia.WorkspaceRoot>
155+
<WithReactodiaStyles>
155156
<NamedColorBoxes color='info' />
156-
</Reactodia.WorkspaceRoot>
157+
</WithReactodiaStyles>
157158

158159
#### `warning` color
159160

160-
<Reactodia.WorkspaceRoot>
161+
<WithReactodiaStyles>
161162
<NamedColorBoxes color='warning' />
162-
</Reactodia.WorkspaceRoot>
163+
</WithReactodiaStyles>
163164

164165
#### `danger` color
165166

166-
<Reactodia.WorkspaceRoot>
167+
<WithReactodiaStyles>
167168
<NamedColorBoxes color='danger' />
168-
</Reactodia.WorkspaceRoot>
169+
</WithReactodiaStyles>
169170

170171
## Text
171172

@@ -316,9 +317,9 @@ export const Buttons = () => {
316317
);
317318
};
318319

319-
<Reactodia.WorkspaceRoot style={{marginBottom: 10}}>
320+
<WithReactodiaStyles>
320321
<Buttons />
321-
</Reactodia.WorkspaceRoot>
322+
</WithReactodiaStyles>
322323

323324
There are specific CSS properties to define the style of various buttons:
324325
```tsx live
@@ -378,9 +379,9 @@ export const Inputs = () => {
378379
);
379380
};
380381

381-
<Reactodia.WorkspaceRoot style={{marginBottom: 10}}>
382+
<WithReactodiaStyles>
382383
<Inputs />
383-
</Reactodia.WorkspaceRoot>
384+
</WithReactodiaStyles>
384385

385386
There are specific CSS properties to define the style of various inputs, including `<input type="text">` and `<select>`:
386387

docs/concepts/graph-model.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ The central part of the Reactodia state is the diagram content which is a mutabl
1010

1111
The diagram is composed of *abstract* [elements](/docs/api/workspace/classes/Element.md) and [links](/docs/api/workspace/classes/Link.md) and can be though of as collection of graph nodes and edges drawn on the canvas surface.
1212

13-
Each **element** is identified by a [generated ID](/docs/api/workspace/classes/Element.md#generateid), stores a [position](/docs/api/workspace/classes/Element.md#position) (in [paper coordinates](./canvas-coordinates.md)) and an arbitrary persisted [element state](/docs/api/workspace/classes/Element.md#elementstate).
13+
Each **element** is identified by a [generated ID](/docs/api/workspace/classes/Element.md#generateid), stores a [position](/docs/api/workspace/classes/Element.md#position) (in [paper coordinates](/docs/concepts/canvas-coordinates)) and an arbitrary persisted [element state](/docs/api/workspace/classes/Element.md#elementstate).
1414

15-
Each **link** is identified by a [generated ID](/docs/api/workspace/classes/Link.md#generateid), has source and target element IDs, and a [link type IRI](/docs/api/workspace/type-aliases/LinkTypeIri.md). In its state it stores path geometry as a [collection of points](/docs/api/workspace/classes/Link.md#vertices) (in [paper coordinates](./canvas-coordinates.md)) and an arbitrary persisted [link state](/docs/api/workspace/classes/Link.md#linkstate).
15+
Each **link** is identified by a [generated ID](/docs/api/workspace/classes/Link.md#generateid), has source and target element IDs, and a [link type IRI](/docs/api/workspace/type-aliases/LinkTypeIri.md). In its state it stores path geometry as a [collection of points](/docs/api/workspace/classes/Link.md#vertices) (in [paper coordinates](/docs/concepts/canvas-coordinates)) and an arbitrary persisted [link state](/docs/api/workspace/classes/Link.md#linkstate).
1616

1717
:::note
1818
Currently there is only one concrete element type besides the data graph ones: [`VoidElement`](/docs/api/workspace/classes/VoidElement.md) which is displayed as nothing (empty point) but can be connected to with the links.
1919
:::
2020

2121
## Data graph
2222

23-
While elements and links are considered to be diagram graph nodes and edges, some of them can represent entities and relations from (external) data graph defined by the [`DataProvider`](./data-provider.md):
23+
While elements and links are considered to be diagram graph nodes and edges, some of them can represent entities and relations from (external) data graph defined by the [`DataProvider`](/docs/concepts/data-provider):
2424

2525
| Cell type | Description |
2626
|-----------|-------------|
@@ -32,16 +32,16 @@ While elements and links are considered to be diagram graph nodes and edges, som
3232
:::note
3333
An IRI is [Internationalized Resource Identifier](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier) which is basically a URI but may additionally contain most unicode characters.
3434

35-
See how the library uses [IRIs and RDF](./data-provider.md#iri-and-rdf) for more details.
35+
See how the library uses [IRIs and RDF](/docs/concepts/data-provider#iri-and-rdf) for more details.
3636
:::
3737

3838
Basically, a sub-graph of a full external data graph composed of entities and relations forms a diagram on the canvas. By exploring that graph, other entities and relation are added to the diagram content, expanding the view of the data graph and presenting more interconnections throughout the data.
3939

40-
Using the [graph authoring](./graph-authoring.md) feature it is possible to work on the changes to the data graph and apply it once ready.
40+
Using the [graph authoring](/docs/concepts/graph-authoring) feature it is possible to work on the changes to the data graph and apply it once ready.
4141

4242
## Manipulating the diagram
4343

44-
To access and manipulate the diagram one can use [diagram model](/docs/api/workspace/classes/DataDiagramModel.md) from [`WorkspaceContext`](./workspace-context.md):
44+
To access and manipulate the diagram one can use [diagram model](/docs/api/workspace/classes/DataDiagramModel.md) from [`WorkspaceContext`](/docs/concepts/workspace-context):
4545
```ts
4646
function WorkingWithDiagramModel() {
4747
const {model} = Reactodia.useWorkspace();
@@ -92,7 +92,7 @@ function WorkingWithDiagramModel() {
9292

9393
## Link visibility
9494

95-
Some links can be hidden from the canvas by setting its link type visibility with [`setLinkVisibility()`](/docs/api/workspace/classes/DataDiagramModel.md#setlinkvisibility) to `hidden`. The hidden links are invisible and would not affect the [graph layout](./layout-workers.md).
95+
Some links can be hidden from the canvas by setting its link type visibility with [`setLinkVisibility()`](/docs/api/workspace/classes/DataDiagramModel.md#setlinkvisibility) to `hidden`. The hidden links are invisible and would not affect the [graph layout](/docs/concepts/layout-workers).
9696

9797
Alternatively, a link type visibility can be set to `withoutLabel` to display it as path (line) only without any additional labels.
9898

docs/concepts/i18n.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_position: 9
66

77
Reactodia has a built-in support for UI text strings localization.
88
Each UI component in the library that displays text labels or descriptions resolves
9-
them from [translation bundles](#translation-bundle) via [Translation interface](#translation-interface-and-hooks).
9+
them from [translation bundles](#translation-bundle) via [Translation interface](#custom-translation).
1010

1111
## Translation bundle
1212

@@ -71,7 +71,7 @@ function MultipleTranslations() {
7171
}
7272
```
7373

74-
## Using translation in the custom components
74+
## Using translation in the custom components {#custom-translation}
7575

7676
The localization mechanism can be used for a custom component nested inside the [`Workspace`](/docs/components/workspace.md) by getting a [`Translation`](/docs/api/workspace/interfaces/Translation.md) instance which can be used to format localizable strings.
7777

docs/concepts/workspace-context.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ sidebar_position: 5
44

55
# Workspace Context
66

7-
Reactodia uses a common context to connect its components with the [graph model](./graph-model.md) and other services such as [graph layout](./layout-workers.md), [i18n](./i18n.md) and [visual graph authoring](./graph-authoring.md).
7+
Reactodia uses a common context to connect its components with the [graph model](/docs/concepts/graph-model) and other services such as [graph layout](/docs/concepts/layout-workers), [i18n](/docs/concepts/i18n) and [visual graph authoring](/docs/concepts/graph-authoring).
88

99
## Services and stores in the context
1010

1111
The [`WorkspaceContext`](/docs/api/workspace/interfaces/WorkspaceContext) contains references to different services and state stores, here is the important ones:
1212

1313
| Property name | Type | Description |
1414
|---------------|------------------|-------------|
15-
| `model` | [`DataDiagramModel`](/docs/api/workspace/classes/DataDiagramModel.md) | Stores the diagram content and asynchronously fetches from a data provider.<br/>See [graph model](./graph-model.md). |
15+
| `model` | [`DataDiagramModel`](/docs/api/workspace/classes/DataDiagramModel.md) | Stores the diagram content and asynchronously fetches from a data provider.<br/>See [graph model](/docs/concepts/graph-model). |
1616
| `view` | [`SharedCanvasState`](/docs/api/workspace/classes/SharedCanvasState.md) | Stores common state and settings for all [canvases](/docs/components/canvas.md) in the workspace. |
17-
| `editor` | [`EditorController`](/docs/api/workspace/classes/EditorController.md) | Stores, modifies and validates changes from the visual graph authoring.<br/>See [graph authoring](./graph-authoring.md). |
17+
| `editor` | [`EditorController`](/docs/api/workspace/classes/EditorController.md) | Stores, modifies and validates changes from the visual graph authoring.<br/>See [graph authoring](/docs/concepts/graph-authoring). |
1818
| `overlay` | [`OverlayController`](/docs/api/workspace/classes/OverlayController.md) | Controls UI overlays for the canvases, including dialogs and tasks. |
19-
| `translation` | [`Translation`](/docs/api/workspace/interfaces/Translation.md) | Provides a translation for UI text strings.<br/>See [i18n](./i18n.md). |
19+
| `translation` | [`Translation`](/docs/api/workspace/interfaces/Translation.md) | Provides a translation for UI text strings.<br/>See [i18n](/docs/concepts/i18n). |
2020

2121
## Getting the workspace context
2222

@@ -70,5 +70,5 @@ function Example() {
7070
```
7171

7272
:::note
73-
The library also uses separate context for [i18n](./i18n.md) (which is accessible by [`useTranslation()`](/docs/api/workspace/functions/useTranslation.md) hook and `translation` property of the workspace context) and a nested context for the [`Canvas`](/docs/components/canvas.md).
73+
The library also uses separate context for [i18n](/docs/concepts/i18n) (which is accessible by [`useTranslation()`](/docs/api/workspace/functions/useTranslation.md) hook and `translation` property of the workspace context) and a nested context for the [`Canvas`](/docs/components/canvas.md).
7474
:::
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import BrowserOnly from '@docusaurus/BrowserOnly';
2+
import type * as Reactodia from '@reactodia/workspace';
3+
4+
export function WithReactodiaStyles(props: Reactodia.WorkspaceRootProps) {
5+
return (
6+
<BrowserOnly>
7+
{() => {
8+
const {ReactodiaStyleRoot} = require('./style-root') as typeof import('./style-root');
9+
return <ReactodiaStyleRoot {...props} />;
10+
}}
11+
</BrowserOnly>
12+
);
13+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Reactodia from '@reactodia/workspace';
2+
3+
export function ReactodiaStyleRoot(props: Reactodia.WorkspaceRootProps) {
4+
return <Reactodia.WorkspaceRoot {...props} />;
5+
}

0 commit comments

Comments
 (0)