@brillout/docpress 0.7.10-commit-577cdcd → 0.7.10-commit-864983e
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/MenuModal.tsx
CHANGED
|
@@ -29,20 +29,25 @@ function NavigationContent(props) {
|
|
|
29
29
|
else {
|
|
30
30
|
assert(!props.showOnlyRelevant);
|
|
31
31
|
var navItemsColumnLayout = groupByColumns(navItemsWithComputed);
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
columnGap: 20,
|
|
39
|
-
} }, columns.map(function (navItemColumnEntry, k) { return (React.createElement("div", { key: k, className: "column-layout-entry", style: {
|
|
40
|
-
breakInside: 'avoid',
|
|
41
|
-
paddingBottom: !navItemColumnEntry.isFullWidth ? 40 : undefined,
|
|
42
|
-
width: '100%',
|
|
32
|
+
var paddingBottom_1 = 40;
|
|
33
|
+
navContent = (React.createElement(React.Fragment, null, navItemsColumnLayout.map(function (_a, i) {
|
|
34
|
+
var navItemsColumnEntries = _a.navItemsColumnEntries, isFullWidth = _a.isFullWidth;
|
|
35
|
+
return (React.createElement("div", { key: i, style: {
|
|
36
|
+
display: 'flex',
|
|
37
|
+
justifyContent: 'center',
|
|
43
38
|
} },
|
|
44
|
-
React.createElement(
|
|
45
|
-
|
|
39
|
+
React.createElement("div", { className: "column-layout-".concat(i), style: {
|
|
40
|
+
flexGrow: 1,
|
|
41
|
+
columnGap: 20,
|
|
42
|
+
paddingBottom: isFullWidth ? paddingBottom_1 : undefined,
|
|
43
|
+
} }, navItemsColumnEntries.map(function (navItemColumnEntry, k) { return (React.createElement("div", { key: k, className: "column-layout-entry", style: {
|
|
44
|
+
breakInside: 'avoid',
|
|
45
|
+
paddingBottom: !isFullWidth ? paddingBottom_1 : undefined,
|
|
46
|
+
width: '100%',
|
|
47
|
+
} },
|
|
48
|
+
React.createElement(NavItemComponent, { navItem: navItemColumnEntry }),
|
|
49
|
+
navItemColumnEntry.navItemChilds.map(function (navItem, k) { return (React.createElement(NavItemComponent, { navItem: navItem, key: k })); }))); }))));
|
|
50
|
+
})));
|
|
46
51
|
}
|
|
47
52
|
return (React.createElement("div", { className: "navigation-content", style: { marginTop: 10 } }, navContent));
|
|
48
53
|
}
|
|
@@ -84,14 +89,14 @@ function groupByColumns(navItems) {
|
|
|
84
89
|
var isFullWidthPrevious = isFullWidth;
|
|
85
90
|
isFullWidth = !!navItem.menuModalFullWidth;
|
|
86
91
|
if (isFullWidthPrevious !== undefined && isFullWidthPrevious !== isFullWidth) {
|
|
87
|
-
navItemsColumnLayout.push(navItemsColumnEntries);
|
|
92
|
+
navItemsColumnLayout.push({ navItemsColumnEntries: navItemsColumnEntries, isFullWidth: isFullWidth });
|
|
88
93
|
navItemsColumnEntries = [];
|
|
89
94
|
}
|
|
90
95
|
}
|
|
91
96
|
assert(isFullWidth !== undefined);
|
|
92
97
|
if (navItem.columnLayoutEntry) {
|
|
93
98
|
assert(navItem.level === 1 || navItem.level === 4);
|
|
94
|
-
var navItemColumnEntry = __assign(__assign({}, navItem), { navItemChilds: []
|
|
99
|
+
var navItemColumnEntry = __assign(__assign({}, navItem), { navItemChilds: [] });
|
|
95
100
|
navItemsColumnEntries.push(navItemColumnEntry);
|
|
96
101
|
}
|
|
97
102
|
else {
|
|
@@ -99,7 +104,8 @@ function groupByColumns(navItems) {
|
|
|
99
104
|
navItemsColumnEntries[navItemsColumnEntries.length - 1].navItemChilds.push(navItem);
|
|
100
105
|
}
|
|
101
106
|
});
|
|
102
|
-
|
|
107
|
+
assert(isFullWidth !== undefined);
|
|
108
|
+
navItemsColumnLayout.push({ navItemsColumnEntries: navItemsColumnEntries, isFullWidth: isFullWidth });
|
|
103
109
|
return navItemsColumnLayout;
|
|
104
110
|
}
|
|
105
111
|
function getNavItemsWithComputed(navItems, currentUrl) {
|
|
@@ -84,12 +84,10 @@ function getStyleColumnLayout(columnLayouts) {
|
|
|
84
84
|
var _loop_1 = function (numberOfColumns) {
|
|
85
85
|
var styleGivenNumberOfColumns = [];
|
|
86
86
|
styleGivenNumberOfColumns.push(css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n.column-layout-", " {\n column-count: ", ";\n max-width: min(100%, ", "px);\n}\n"], ["\n.column-layout-", " {\n column-count: ", ";\n max-width: min(100%, ", "px);\n}\n"])), i, numberOfColumns, columnWidthMax * numberOfColumns));
|
|
87
|
-
console.log('columnLayouts', columnLayouts);
|
|
88
87
|
var columnsIdMap = determineColumns(columns, numberOfColumns);
|
|
89
|
-
console.log('columnsIdMap', columnsIdMap);
|
|
90
88
|
var columnBreakPoints = determineColumnBreakPoints(columnsIdMap);
|
|
91
89
|
columnBreakPoints.forEach(function (columnBreakPoint, columnUngroupedId) {
|
|
92
|
-
styleGivenNumberOfColumns.push(css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n.column-layout-entry:nth-child(", ") {\n break-before: ", ";\n}\n"], ["\n.column-layout-entry:nth-child(", ") {\n break-before: ", ";\n}\n"])), columnUngroupedId + 1, columnBreakPoint ? 'column' : 'avoid'));
|
|
90
|
+
styleGivenNumberOfColumns.push(css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n.column-layout-", " .column-layout-entry:nth-child(", ") {\n break-before: ", ";\n}\n"], ["\n.column-layout-", " .column-layout-entry:nth-child(", ") {\n break-before: ", ";\n}\n"])), i, columnUngroupedId + 1, columnBreakPoint ? 'column' : 'avoid'));
|
|
93
91
|
});
|
|
94
92
|
var noContainerQuery = numberOfColumns === columns.length;
|
|
95
93
|
if (!noContainerQuery) {
|
|
@@ -37,9 +37,10 @@ function NavigationContent(props: {
|
|
|
37
37
|
} else {
|
|
38
38
|
assert(!props.showOnlyRelevant)
|
|
39
39
|
const navItemsColumnLayout = groupByColumns(navItemsWithComputed)
|
|
40
|
+
const paddingBottom = 40
|
|
40
41
|
navContent = (
|
|
41
42
|
<>
|
|
42
|
-
{navItemsColumnLayout.map((
|
|
43
|
+
{navItemsColumnLayout.map(({ navItemsColumnEntries, isFullWidth }, i) => (
|
|
43
44
|
<div
|
|
44
45
|
key={i}
|
|
45
46
|
style={{
|
|
@@ -52,15 +53,16 @@ function NavigationContent(props: {
|
|
|
52
53
|
style={{
|
|
53
54
|
flexGrow: 1,
|
|
54
55
|
columnGap: 20,
|
|
56
|
+
paddingBottom: isFullWidth ? paddingBottom : undefined,
|
|
55
57
|
}}
|
|
56
58
|
>
|
|
57
|
-
{
|
|
59
|
+
{navItemsColumnEntries.map((navItemColumnEntry, k) => (
|
|
58
60
|
<div
|
|
59
61
|
key={k}
|
|
60
62
|
className="column-layout-entry"
|
|
61
63
|
style={{
|
|
62
64
|
breakInside: 'avoid',
|
|
63
|
-
paddingBottom: !
|
|
65
|
+
paddingBottom: !isFullWidth ? paddingBottom : undefined,
|
|
64
66
|
width: '100%',
|
|
65
67
|
}}
|
|
66
68
|
>
|
|
@@ -126,9 +128,9 @@ function NavItemComponent({
|
|
|
126
128
|
)
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
type NavItemsColumnEntry = NavItemComputed & { navItemChilds: NavItemComputed[]
|
|
131
|
+
type NavItemsColumnEntry = NavItemComputed & { navItemChilds: NavItemComputed[] }
|
|
130
132
|
function groupByColumns(navItems: NavItemComputed[]) {
|
|
131
|
-
const navItemsColumnLayout: NavItemsColumnEntry[][] = []
|
|
133
|
+
const navItemsColumnLayout: { navItemsColumnEntries: NavItemsColumnEntry[]; isFullWidth: boolean }[] = []
|
|
132
134
|
let navItemsColumnEntries: NavItemsColumnEntry[] = []
|
|
133
135
|
let isFullWidth: boolean | undefined
|
|
134
136
|
navItems.forEach((navItem) => {
|
|
@@ -136,21 +138,22 @@ function groupByColumns(navItems: NavItemComputed[]) {
|
|
|
136
138
|
const isFullWidthPrevious = isFullWidth
|
|
137
139
|
isFullWidth = !!navItem.menuModalFullWidth
|
|
138
140
|
if (isFullWidthPrevious !== undefined && isFullWidthPrevious !== isFullWidth) {
|
|
139
|
-
navItemsColumnLayout.push(navItemsColumnEntries)
|
|
141
|
+
navItemsColumnLayout.push({ navItemsColumnEntries, isFullWidth })
|
|
140
142
|
navItemsColumnEntries = []
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
assert(isFullWidth !== undefined)
|
|
144
146
|
if (navItem.columnLayoutEntry) {
|
|
145
147
|
assert(navItem.level === 1 || navItem.level === 4)
|
|
146
|
-
const navItemColumnEntry = { ...navItem, navItemChilds: []
|
|
148
|
+
const navItemColumnEntry = { ...navItem, navItemChilds: [] }
|
|
147
149
|
navItemsColumnEntries.push(navItemColumnEntry)
|
|
148
150
|
} else {
|
|
149
151
|
assert(navItem.level !== 1)
|
|
150
152
|
navItemsColumnEntries[navItemsColumnEntries.length - 1].navItemChilds.push(navItem)
|
|
151
153
|
}
|
|
152
154
|
})
|
|
153
|
-
|
|
155
|
+
assert(isFullWidth !== undefined)
|
|
156
|
+
navItemsColumnLayout.push({ navItemsColumnEntries, isFullWidth })
|
|
154
157
|
return navItemsColumnLayout
|
|
155
158
|
}
|
|
156
159
|
|
package/package.json
CHANGED
|
@@ -87,14 +87,12 @@ function getStyleColumnLayout(columnLayouts: number[][]): string {
|
|
|
87
87
|
}
|
|
88
88
|
`,
|
|
89
89
|
)
|
|
90
|
-
console.log('columnLayouts', columnLayouts);
|
|
91
90
|
const columnsIdMap = determineColumns(columns, numberOfColumns)
|
|
92
|
-
console.log('columnsIdMap', columnsIdMap);
|
|
93
91
|
const columnBreakPoints = determineColumnBreakPoints(columnsIdMap)
|
|
94
92
|
columnBreakPoints.forEach((columnBreakPoint, columnUngroupedId) => {
|
|
95
93
|
styleGivenNumberOfColumns.push(
|
|
96
94
|
css`
|
|
97
|
-
.column-layout-entry:nth-child(${columnUngroupedId + 1}) {
|
|
95
|
+
.column-layout-${i} .column-layout-entry:nth-child(${columnUngroupedId + 1}) {
|
|
98
96
|
break-before: ${columnBreakPoint ? 'column' : 'avoid'};
|
|
99
97
|
}
|
|
100
98
|
`,
|