@patternfly/documentation-framework 6.0.0-alpha.93 → 6.0.0-alpha.95

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/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 6.0.0-alpha.95 (2024-09-17)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **homepage:** remove is full height ([#4211](https://github.com/patternfly/patternfly-org/issues/4211)) ([9875ac8](https://github.com/patternfly/patternfly-org/commit/9875ac827996b874048507df270bf4b07ecb8d64))
12
+
13
+
14
+
15
+
16
+
17
+ # 6.0.0-alpha.94 (2024-09-13)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * packages/documentation-framework/package.json to reduce vulnerabilities ([#4255](https://github.com/patternfly/patternfly-org/issues/4255)) ([79a21e3](https://github.com/patternfly/patternfly-org/commit/79a21e34c3b7464c8e7da9bd0c7c600c44af8f52))
23
+
24
+
25
+
26
+
27
+
6
28
  # 6.0.0-alpha.93 (2024-09-11)
7
29
 
8
30
  **Note:** Version bump only for package @patternfly/documentation-framework
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React from 'react';
2
2
  import { groupedRoutes } from '../../routes';
3
3
 
4
4
  export const SectionGalleryWrapper = ({
@@ -10,9 +10,11 @@ export const SectionGalleryWrapper = ({
10
10
  parseSubsections,
11
11
  initialLayout,
12
12
  isFullWidth,
13
- children
13
+ children,
14
14
  }) => {
15
- let sectionRoutes = subsection ? groupedRoutes[section][subsection] : groupedRoutes[section];
15
+ let sectionRoutes = subsection
16
+ ? groupedRoutes[section][subsection]
17
+ : groupedRoutes[section];
16
18
  if (!includeSubsections || parseSubsections) {
17
19
  const sectionRoutesArr = Object.entries(sectionRoutes);
18
20
  // loop through galleryItems object and build new object to handle subsections
@@ -32,22 +34,21 @@ export const SectionGalleryWrapper = ({
32
34
  if (subitemName !== 'isSubsection') {
33
35
  acc[subitemName] = subitemData;
34
36
  }
35
- })
37
+ });
36
38
  }
37
39
  return acc;
38
- }, {})
40
+ }, {});
39
41
  }
40
42
 
41
43
  const [searchTerm, setSearchTerm] = React.useState('');
42
44
  const [layoutView, setLayoutView] = React.useState(initialLayout);
43
- const filteredItems = Object.entries(sectionRoutes)
44
- .filter(([itemName, { slug }]) => (
45
- // exclude current gallery page from results
45
+ const filteredItems = Object.entries(sectionRoutes).filter(
46
+ ([itemName, { slug }]) =>
47
+ // exclude current gallery page from results - check for trailing /
46
48
  !location.pathname.endsWith(slug) &&
47
- itemName
48
- .toLowerCase()
49
- .includes(searchTerm.toLowerCase())
50
- ));
49
+ !location.pathname.endsWith(`${slug}/`) &&
50
+ itemName.toLowerCase().includes(searchTerm.toLowerCase())
51
+ );
51
52
  const sectionGalleryItems = filteredItems
52
53
  .sort(([itemName1], [itemName2]) => itemName1.localeCompare(itemName2))
53
54
  .map(([itemName, itemData], idx) => {
@@ -56,36 +57,63 @@ export const SectionGalleryWrapper = ({
56
57
  // Convert to lowercase-camelcase ex: File upload - multiple ==> file_upload_multiple
57
58
  const illustrationName = itemName
58
59
  .replace('-', '')
59
- .replace(' ',' ')
60
+ .replace(' ', ' ')
60
61
  .split(' ')
61
62
  .join('_')
62
63
  .toLowerCase();
63
- illustration = illustrations[illustrationName] || illustrations.default_placeholder;
64
+ illustration =
65
+ illustrations[illustrationName] || illustrations.default_placeholder;
64
66
  }
65
67
  const { sources, isSubsection = false } = itemData;
66
68
  // Subsections don't have title or id, default to itemName aka sidenav text
67
69
  const title = itemData.title || itemName;
68
70
  const id = itemData.id || title;
69
71
  // Display beta label if tab other than a '-next' tab is marked Beta
70
- const isDeprecated = !isSubsection && sources && sources.some(source => source.source === "react-deprecated" || source.source === "html-deprecated") && !sources.some(source => source.source === "react" || source.source === "html");
71
- const isBeta = !isSubsection && sources && sources.some(src => src.beta && !src.source.includes('-next'));
72
- const isDemo = !isSubsection && sources && sources.some(source => source.source === "react-demos" || source.source === "html-demos") && !sources.some(source => source.source === "react" || source.source === "html");
72
+ const isDeprecated =
73
+ !isSubsection &&
74
+ sources &&
75
+ sources.some(
76
+ (source) =>
77
+ source.source === 'react-deprecated' ||
78
+ source.source === 'html-deprecated'
79
+ ) &&
80
+ !sources.some(
81
+ (source) => source.source === 'react' || source.source === 'html'
82
+ );
83
+ const isBeta =
84
+ !isSubsection &&
85
+ sources &&
86
+ sources.some((src) => src.beta && !src.source.includes('-next'));
87
+ const isDemo =
88
+ !isSubsection &&
89
+ sources &&
90
+ sources.some(
91
+ (source) =>
92
+ source.source === 'react-demos' || source.source === 'html-demos'
93
+ ) &&
94
+ !sources.some(
95
+ (source) => source.source === 'react' || source.source === 'html'
96
+ );
73
97
 
74
98
  let slug = itemData.slug;
75
99
  if (!slug && isSubsection) {
76
100
  // Update slug to link to first page in subsection
77
- const subsectionItems = Object.entries(itemData).filter(([name, _data]) => name !== 'isSubsection');
78
- const sortedSubsectionItems = subsectionItems.sort((
79
- [name1, {sortValue: sortValue1 = 50}],
80
- [name2, {sortValue: sortValue2 = 50}]
81
- ) => {
82
- if (sortValue1 === sortValue2) {
83
- return name1.localeCompare(name2);
101
+ const subsectionItems = Object.entries(itemData).filter(
102
+ ([name, _data]) => name !== 'isSubsection'
103
+ );
104
+ const sortedSubsectionItems = subsectionItems.sort(
105
+ (
106
+ [name1, { sortValue: sortValue1 = 50 }],
107
+ [name2, { sortValue: sortValue2 = 50 }]
108
+ ) => {
109
+ if (sortValue1 === sortValue2) {
110
+ return name1.localeCompare(name2);
111
+ }
112
+ return sortValue1 > sortValue2 ? 1 : -1;
84
113
  }
85
- return sortValue1 > sortValue2 ? 1 : -1;
86
- });
114
+ );
87
115
  const firstSubsectionItem = sortedSubsectionItems[0];
88
- slug = firstSubsectionItem[1].slug;
116
+ slug = firstSubsectionItem[1].slug;
89
117
  }
90
118
 
91
119
  return {
@@ -98,13 +126,23 @@ export const SectionGalleryWrapper = ({
98
126
  isDemo,
99
127
  title,
100
128
  id,
101
- galleryItemsData
129
+ galleryItemsData,
102
130
  };
103
131
  });
104
132
 
105
133
  return (
106
- <div className={`ws-section-gallery${ isFullWidth ? ' ws-section-gallery-full-width' : '' }`}>
107
- { children(sectionGalleryItems, searchTerm, setSearchTerm, layoutView, setLayoutView) }
134
+ <div
135
+ className={`ws-section-gallery${
136
+ isFullWidth ? ' ws-section-gallery-full-width' : ''
137
+ }`}
138
+ >
139
+ {children(
140
+ sectionGalleryItems,
141
+ searchTerm,
142
+ setSearchTerm,
143
+ layoutView,
144
+ setLayoutView
145
+ )}
108
146
  </div>
109
- )
147
+ );
110
148
  };
@@ -164,7 +164,6 @@ const HeaderTools = ({
164
164
  isOpen={isDropdownOpen}
165
165
  toggle={(toggleRef) => (
166
166
  <MenuToggle
167
- isFullHeight
168
167
  ref={toggleRef}
169
168
  onClick={() => setDropdownOpen(!isDropdownOpen)}
170
169
  isExpanded={isDropdownOpen}
@@ -200,7 +199,7 @@ const HeaderTools = ({
200
199
  key="PatternFly 6"
201
200
  className="ws-patternfly-versions"
202
201
  isExternalLink
203
- to="https://staging-v6.patternfly.org/"
202
+ to="https://staging.patternfly.org/"
204
203
  itemId="patternfly-6"
205
204
  >
206
205
  PatternFly 6
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@patternfly/documentation-framework",
3
3
  "description": "A framework to build documentation for PatternFly.",
4
- "version": "6.0.0-alpha.93",
4
+ "version": "6.0.0-alpha.95",
5
5
  "author": "Red Hat",
6
6
  "license": "MIT",
7
7
  "private": false,
@@ -13,19 +13,19 @@
13
13
  "@babel/preset-env": "^7.24.3",
14
14
  "@babel/preset-react": "^7.24.1",
15
15
  "@mdx-js/util": "1.6.16",
16
- "@patternfly/ast-helpers": "^1.4.0-alpha.82",
16
+ "@patternfly/ast-helpers": "^1.4.0-alpha.84",
17
17
  "@reach/router": "npm:@gatsbyjs/reach-router@1.3.9",
18
18
  "autoprefixer": "9.8.6",
19
19
  "babel-loader": "^9.1.3",
20
20
  "camelcase-css": "2.0.1",
21
- "chokidar": "3.5.3",
21
+ "chokidar": "4.0.0",
22
22
  "clean-webpack-plugin": "4.0.0",
23
23
  "codesandbox": "2.2.0",
24
24
  "commander": "4.1.1",
25
25
  "copy-webpack-plugin": "11.0.0",
26
26
  "css-loader": "6.7.3",
27
27
  "detab": "2.0.3",
28
- "express": "4.18.1",
28
+ "express": "4.20.0",
29
29
  "file-loader": "6.2.0",
30
30
  "file-saver": "1.3.8",
31
31
  "fs-extra": "9.0.1",
@@ -80,5 +80,5 @@
80
80
  "react": "^17.0.0 || ^18.0.0",
81
81
  "react-dom": "^17.0.0 || ^18.0.0"
82
82
  },
83
- "gitHead": "101b72efeca62ffddf07d059322106bcd89b0100"
83
+ "gitHead": "1cfdf2e14b9a12a1ef4af13bb625181299f168ec"
84
84
  }