@startupjs/docs 0.55.0-alpha.9 → 0.55.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/client/app/Layout/Sidebar/Content/Docs/index.js +1 -1
- package/client/app/Layout/Sidebar/Content/Options/index.js +1 -15
- package/client/app/Layout/Sidebar/Content/index.js +2 -2
- package/client/app/Layout/index.js +2 -12
- package/client/components/Props/Constructor/Tr/index.styl +1 -1
- package/client/components/Props/Constructor/index.styl +1 -1
- package/client/components/Props/Renderer/GridVisualizer/index.js +8 -8
- package/client/components/Props/Renderer/index.js +4 -3
- package/client/components/Props/index.js +3 -3
- package/client/components/Props/index.styl +2 -2
- package/package.json +5 -5
- package/startupjs.config.cjs +1 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { pug, observer, useValue, $ } from 'startupjs'
|
|
3
|
-
import { Br, Input, Button, Modal
|
|
3
|
+
import { Br, Input, Button, Modal } from '@startupjs/ui'
|
|
4
4
|
import { faSlidersH } from '@fortawesome/free-solid-svg-icons'
|
|
5
5
|
import {
|
|
6
6
|
useShowGrid,
|
|
@@ -9,18 +9,6 @@ import {
|
|
|
9
9
|
} from '../../../../../clientHelpers'
|
|
10
10
|
import './index.styl'
|
|
11
11
|
|
|
12
|
-
const palette = new Palette()
|
|
13
|
-
const { Color, generateColors } = palette
|
|
14
|
-
|
|
15
|
-
const THEMES = {
|
|
16
|
-
dark: generateColors({
|
|
17
|
-
[Colors.bg]: Color('coolGray', 0),
|
|
18
|
-
[Colors.text]: Color('coolGray', 9),
|
|
19
|
-
[Colors.border]: Color('coolGray', 2),
|
|
20
|
-
[Colors.secondary]: Color('coolGray', 9)
|
|
21
|
-
})
|
|
22
|
-
}
|
|
23
|
-
|
|
24
12
|
export default observer(function Options ({
|
|
25
13
|
style
|
|
26
14
|
}) {
|
|
@@ -42,8 +30,6 @@ export default observer(function Options ({
|
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
return pug`
|
|
45
|
-
if theme !== 'light'
|
|
46
|
-
CssVariables(meta=THEMES[theme])
|
|
47
33
|
Button(
|
|
48
34
|
style=style
|
|
49
35
|
icon=faSlidersH
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { ScrollView, Image } from 'react-native'
|
|
3
3
|
import { pug, observer } from 'startupjs'
|
|
4
|
-
import { Div,
|
|
4
|
+
import { Div, Select } from '@startupjs/ui'
|
|
5
5
|
import { BASE_URL } from '@env'
|
|
6
6
|
import { useLang } from '../../../../clientHelpers'
|
|
7
7
|
import Options from './Options'
|
|
@@ -25,7 +25,7 @@ export default observer(function Content ({
|
|
|
25
25
|
ScrollView
|
|
26
26
|
Image.logo(testID='logo' source={ uri: baseUrl + '/img/docs.png' })
|
|
27
27
|
Docs
|
|
28
|
-
|
|
28
|
+
Div.footer(row)
|
|
29
29
|
Select.lang(
|
|
30
30
|
testID='languagesSelect'
|
|
31
31
|
options=LANGUAGES
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import React, { useState } from 'react'
|
|
2
2
|
import { pug, emit, observer, useModel, $ } from 'startupjs'
|
|
3
3
|
import { pathFor, useLocation } from 'startupjs/app'
|
|
4
|
-
import { AutoSuggest, Button, Div, Layout, Menu,
|
|
4
|
+
import { AutoSuggest, Button, Div, Layout, Menu, Span } from '@startupjs/ui'
|
|
5
5
|
import { MDXProvider } from '@startupjs/mdx'
|
|
6
6
|
import { ScrollableProvider } from '@startupjs/scrollable-anchors'
|
|
7
7
|
import { faBars, faSearch } from '@fortawesome/free-solid-svg-icons'
|
|
8
|
-
import { APP_ENV } from '@env'
|
|
9
8
|
import Sidebar, { SIDEBAR_PATH } from './Sidebar'
|
|
10
9
|
import { useDocsContext } from '../../../docsContext'
|
|
11
10
|
import { useLang, getTitle } from '../../clientHelpers'
|
|
@@ -57,14 +56,6 @@ const Search = observer(function Search () {
|
|
|
57
56
|
emit('url', value.value)
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
function onChangeText (value) {
|
|
61
|
-
const testComponentUrlRegExp = /^\/test\//
|
|
62
|
-
|
|
63
|
-
if (testComponentUrlRegExp.test(value)) {
|
|
64
|
-
return emit('url', value)
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
|
|
68
59
|
return pug`
|
|
69
60
|
AutoSuggest.search(
|
|
70
61
|
testID='searchInput'
|
|
@@ -74,7 +65,6 @@ const Search = observer(function Search () {
|
|
|
74
65
|
inputIcon=faSearch
|
|
75
66
|
renderItem=item => renderItem(item, pathname)
|
|
76
67
|
onChange=onChange
|
|
77
|
-
onChangeText=APP_ENV === 'detox' ? onChangeText : undefined
|
|
78
68
|
)
|
|
79
69
|
`
|
|
80
70
|
})
|
|
@@ -87,7 +77,7 @@ const Topbar = observer(function Topbar () {
|
|
|
87
77
|
}
|
|
88
78
|
|
|
89
79
|
return pug`
|
|
90
|
-
|
|
80
|
+
Div.topbar(row)
|
|
91
81
|
Button(testID='button' variant='text' icon=faBars onPress=toggleSidebar color='text-description')
|
|
92
82
|
Div.searchWrapper
|
|
93
83
|
Search
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
$input = var(--color-border)
|
|
2
2
|
$header = var(--color-text-description)
|
|
3
|
-
$darkHeader = var(--color-text-
|
|
3
|
+
$darkHeader = var(--color-text-on-contrast)
|
|
4
4
|
$value = var(--color-text-success)
|
|
5
5
|
$type = var(--color-text-info)
|
|
6
6
|
$valueDark = var(--color-text-success-strong)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { pug, observer, useModel, useLocal } from 'startupjs'
|
|
3
|
-
import { themed, Div, Span
|
|
3
|
+
import { themed, Div, Span } from '@startupjs/ui'
|
|
4
4
|
import './index.styl'
|
|
5
5
|
|
|
6
6
|
const GRID_SIZE = 8
|
|
@@ -17,16 +17,16 @@ export default observer(function GridVisualizer ({
|
|
|
17
17
|
style,
|
|
18
18
|
children
|
|
19
19
|
}) {
|
|
20
|
-
|
|
20
|
+
const $componentSize = useModel('_session.Renderer.componentSize')
|
|
21
21
|
|
|
22
22
|
function onLayout (e) {
|
|
23
|
-
|
|
23
|
+
const { width, height } = e.nativeEvent.layout
|
|
24
24
|
$componentSize.setDiffDeep({ width, height })
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
// TODO: Bring back width check as an option. For now it's commented out.
|
|
28
28
|
return pug`
|
|
29
|
-
|
|
29
|
+
Div.vertical(row)
|
|
30
30
|
LeftBar(
|
|
31
31
|
allowHalfUnit=allowHalfUnit
|
|
32
32
|
validate=validateHeight
|
|
@@ -45,13 +45,13 @@ export default observer(function GridVisualizer ({
|
|
|
45
45
|
})
|
|
46
46
|
|
|
47
47
|
const LeftBar = observer(themed(({ allowHalfUnit, validate, theme }) => {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
const [height = 0] = useLocal('_session.Renderer.componentSize.height')
|
|
49
|
+
const units = toUnits(height)
|
|
50
|
+
const valid = validate ? validateGrid(height, allowHalfUnit) : true
|
|
51
51
|
|
|
52
52
|
return pug`
|
|
53
53
|
Div.leftBar
|
|
54
|
-
|
|
54
|
+
Div.leftBarWrapper(style={ width: height } row)
|
|
55
55
|
Div.leftBarLine(styleName=[theme, { valid }])
|
|
56
56
|
Span.leftBarText(styleName=[theme, { valid }])= units
|
|
57
57
|
Div.leftBarLine(styleName=[theme, { valid }])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react'
|
|
2
2
|
import { pug, observer } from 'startupjs'
|
|
3
|
-
import { themed,
|
|
3
|
+
import { themed, Div } from '@startupjs/ui'
|
|
4
4
|
import GridVisualizer from './GridVisualizer'
|
|
5
5
|
|
|
6
6
|
export default observer(themed(function Renderer ({
|
|
@@ -19,12 +19,13 @@ export default observer(themed(function Renderer ({
|
|
|
19
19
|
style
|
|
20
20
|
}) {
|
|
21
21
|
let Wrapper
|
|
22
|
-
|
|
22
|
+
const extraProps = {}
|
|
23
23
|
if (showSizes) {
|
|
24
24
|
Wrapper = GridVisualizer
|
|
25
25
|
extraProps.block = block
|
|
26
26
|
} else {
|
|
27
|
-
Wrapper =
|
|
27
|
+
Wrapper = Div
|
|
28
|
+
extraProps.row = !block
|
|
28
29
|
}
|
|
29
30
|
|
|
30
31
|
return pug`
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react'
|
|
2
2
|
import { pug, observer, $root, useComponentId } from 'startupjs'
|
|
3
|
-
import { themed, Button,
|
|
3
|
+
import { themed, Button, Div, ScrollView } from '@startupjs/ui'
|
|
4
4
|
import parsePropTypesModule from 'parse-prop-types'
|
|
5
5
|
import Constructor from './Constructor'
|
|
6
6
|
import Renderer from './Renderer'
|
|
@@ -41,7 +41,7 @@ function useEntries ({ Component, props, extraParams }) {
|
|
|
41
41
|
|
|
42
42
|
function parseEntries (entries) {
|
|
43
43
|
return entries.map(entry => {
|
|
44
|
-
|
|
44
|
+
const meta = entry[1]
|
|
45
45
|
return {
|
|
46
46
|
name: entry[0],
|
|
47
47
|
type: meta.type.name,
|
|
@@ -133,7 +133,7 @@ export default observer(themed(function PComponent ({
|
|
|
133
133
|
showSizes=showSizes
|
|
134
134
|
block=block
|
|
135
135
|
)
|
|
136
|
-
|
|
136
|
+
Div.display(align='right' row)
|
|
137
137
|
Button(
|
|
138
138
|
size='s'
|
|
139
139
|
variant='text'
|
package/package.json
CHANGED
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
6
|
"description": "MDX documentation generator",
|
|
7
|
-
"version": "0.55.
|
|
7
|
+
"version": "0.55.1",
|
|
8
8
|
"type": "module",
|
|
9
9
|
"main": "index.js",
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@fortawesome/free-solid-svg-icons": "^5.12.0",
|
|
12
|
-
"@startupjs/mdx": "^0.55.
|
|
13
|
-
"@startupjs/scrollable-anchors": "^0.55.
|
|
14
|
-
"@startupjs/ui": "^0.55.
|
|
12
|
+
"@startupjs/mdx": "^0.55.1",
|
|
13
|
+
"@startupjs/scrollable-anchors": "^0.55.1",
|
|
14
|
+
"@startupjs/ui": "^0.55.1",
|
|
15
15
|
"parse-prop-types": "^0.3.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
@@ -19,5 +19,5 @@
|
|
|
19
19
|
"react-native": "*",
|
|
20
20
|
"startupjs": "*"
|
|
21
21
|
},
|
|
22
|
-
"gitHead": "
|
|
22
|
+
"gitHead": "88d13d7c882487c160d0d416b1b04bba28e6298d"
|
|
23
23
|
}
|