Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamically load available familyStyles #51

Merged
merged 34 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
3efef8b
families and styles in dropdown selects
mlwilkerson Oct 6, 2023
38ebb28
capitalize Kit
frrrances May 15, 2024
46d252e
halfway styling for putting family and styles in dropdowns
frrrances May 15, 2024
6b8f52d
WIP: cleanup and generalize familyStyles
mlwilkerson May 21, 2024
c038ac5
update familyStyles on initial kit metadata query
mlwilkerson May 21, 2024
8d02636
handle duotone custom icons
mlwilkerson May 21, 2024
08dfd2f
add fak and fakd to dropdowns when it's a kit
mlwilkerson May 21, 2024
dce286c
remove style filter and wire-up familyStyle dropdowns
mlwilkerson May 21, 2024
df297ca
remove obsolete code pertaining to hardcoded familyStyles and prefixes
mlwilkerson May 21, 2024
93709ee
fix pathData for iconUpload in test
mlwilkerson May 22, 2024
a906535
WIP: compute familyStyle path segments from prefixes without hardcoding
mlwilkerson May 22, 2024
9cafa21
remove obsolete test expectations
mlwilkerson May 22, 2024
ce71e2b
remove obsolete IconPrefix import
mlwilkerson May 22, 2024
3f1921f
don't use watch after al
mlwilkerson May 22, 2024
63a67de
fix onKeyUp to only issue a new query with the query changes
mlwilkerson May 22, 2024
150e007
change the defaultSearchResult to stop hardcoding pro familyStyles
mlwilkerson May 22, 2024
0c25d3e
dynamically build the defaultIcons query result to avoid harcoding pr…
mlwilkerson May 22, 2024
69e4af8
handle duotone legacy form for familyStyle path segments
mlwilkerson May 22, 2024
1c30ebf
remove obsolete slots
mlwilkerson May 22, 2024
e733801
rebuild auto-generated readmes
mlwilkerson May 22, 2024
3b9b2d1
exclude custom icon familyStyles when building default icon search re…
mlwilkerson May 22, 2024
97baf4f
include kit and kit-duotone on family drop down only when present in …
mlwilkerson May 22, 2024
64fc0f7
format labels for drop down options
mlwilkerson May 23, 2024
3488016
update handleQuery to take optional second arg for variables
mlwilkerson May 25, 2024
98a8945
for search input field, respond to onInput instead of onKeyUp
mlwilkerson May 30, 2024
48adf52
add selected attr to style drop down
mlwilkerson Jun 5, 2024
55b4c70
fix test
mlwilkerson Jun 5, 2024
8a6d73e
auto-formatting
mlwilkerson Jun 5, 2024
fb21912
update readmes from rebuild
mlwilkerson Jun 5, 2024
75e17a5
update changelog
mlwilkerson Jun 5, 2024
0edf7a4
Update CHANGELOG to show new QueryHandler type signature
mlwilkerson Jun 5, 2024
b7b4e1b
auto-formatting
mlwilkerson Jun 5, 2024
ff924de
Update CHANGELOG to mention duotone custom icons
mlwilkerson Jun 5, 2024
a7da5f9
update version and deps
mlwilkerson Jun 5, 2024
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
69 changes: 68 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,73 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/) and this project adheres to [Semantic Versioning](http://semver.org/).

---
## [0.7.0](https://github.com/FortAwesome/fa-icon-chooser/releases/tag/0.7.0) - 2024-06-05

### Changed

- Family and style selection are now based on drop down selections, and the available
values are retrieved from the GraphQL API. This removes the hardcoding of familyStyles
and lets the icon chooser work with all available familyStyles for the active version
of Font Awesome.
- Several slots for messages to indicate the unavailability of certain familyStyles
have been removed. They are no longer used, now that the UI only includes in
the drop down selectors available familyStyle combinations for the active version
of Font Awesome.

The following slots have been removed:
- `light-requires-pro`
- `thin-requires-pro`
- `duotone-requires-pro`
- `sharp-solid-requires-pro`
- `sharp-regular-requires-pro`
- `sharp-light-requires-pro`
- `uploaded-requires-pro`
- `sharp-solid-style-filter-sr-message`
- `sharp-regular-style-filter-sr-message`
- `sharp-light-style-filter-sr-message`
- `solid-style-filter-sr-message`
- `regular-style-filter-sr-message`
- `light-style-filter-sr-message`
- `thin-style-filter-sr-message`
- `duotone-style-filter-sr-message`
- `brands-style-filter-sr-message`
- `uploaded-style-filter-sr-message`

- The `QueryHandler` type now takes a second optional argument for variables.
(See also Breaking Changes)o

### Fixed
- Duotone custom icons in kits now work correctly.

### Breaking Changes

- The icon chooser's queries now use variables, instead of interpolating all values
into a single query document string. Thus, any `QueryHandler` callback must be updated
to handle the query variables.

Its type signature is now:

```typescript
export type QueryHandler = (document: string, variables?: object) => Promise<any>;
```

Suggestion:

```javascript
async function handleQuery(query, variables) {
const headers = buildHeaders()
const url = getApiUrl()
const body = JSON.stringify({query, variables})

return fetch(url, {
method: "POST",
headers,
body
})
}
```


## [0.6.0](https://github.com/FortAwesome/fa-icon-chooser/releases/tag/0.6.0) - 2023-07-12

### Changed
Expand Down Expand Up @@ -44,4 +111,4 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### Added

- Initial version
- Initial version
4 changes: 2 additions & 2 deletions packages/fa-icon-chooser-react/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@fortawesome/fa-icon-chooser-react",
"sideEffects": false,
"version": "0.6.0",
"version": "0.7.0",
"license": "MIT",
"private": false,
"description": "React specific wrapper for @fortawesome/fa-icon-chooser",
Expand Down Expand Up @@ -35,7 +35,7 @@
"typescript": "^4.3.2"
},
"dependencies": {
"@fortawesome/fa-icon-chooser": "0.6.0"
"@fortawesome/fa-icon-chooser": "0.7.0"
},
"peerDependencies": {
"react": "^16 || ^17 || ^18",
Expand Down
Loading
Loading