v4.0.0
This release introduces a new gn-shortcut-button web component with associated dialogs for adding and removing shortcuts. It also refactors styling for input, label, button and heading components to use shadow DOM and slotted content, and updates API helper functions.
Changes
- New Component: Adds a
gn-shortcut-buttoncomponent with functionality to add/remove shortcuts to the current page. This includes HTML template, associated SCSS styling, and TypeScript logic. - API Helpers: Introduces new API helper functions (
getMinSideShortcutApiUrl,getMinSideShortcutUrl,fetchShortcutItem,postShortcutItem,deleteShortcutItem) to interact with a "minside" (my page) service for shortcut management. - Stylesheet Refactoring: Many components (e.g.,
gn-button,gn-field-container,gn-input,gn-label,heading-text) are refactored to move styles into atemplate.scssfile and apply them to slotted content within the shadow DOM. The original SCSS files are deleted. - Component Logic Updates: Several component TypeScript files are updated (e.g.,
gn-button,gn-input,gn-label,heading-text) to remove theaddGlobalStylesheetcalls and adjust component logic to work with slotted content.heading-textis updated to dynamically apply base heading styles and remove margin for dialog headings.gn-buttonreceives functionality to handle hover state with javascript. - Package.json Update: Adds a
test-releasescript topackage.jsonto run build andcopy-files. Adds a newstar.svgasset for the shortcut button. - guiHelpers.ts update: Adds the
getDocumentHeadinghelper function to find the main document heading (excluding storybook preview headings).
Impact
- Behavioral Changes: Introduces shortcut button functionality. Styling is encapsulated within components shadow DOM and applied to slotted content. The
gn-shortcut-buttoninteracts with a backend API. - Dependencies Affected: The change is dependent on the super-custom-elements library. The component now relies on backend services for persistence.
- Breaking Changes: The changes to styling introduce a breaking change since components no longer use global styles but encapsulated shadow DOM styles and expect content to be passed as slotted children. The deletion of global stylesheets can impact existing components that rely on them.
- Testing Implications: The new
gn-shortcut-buttoncomponent and API helpers will require integration and unit tests. The refactored components should be tested to ensure styles are correctly applied within the shadow DOM.
What's Changed
- Refactors SCSS imports to use
@useby @benjamindehli in #18 - logg ut knapp fikk ikke riktig utseende by @oleriege in #19
- 3.0.2 by @oleriege in #20
- Feature/shortcut button by @benjamindehli in #21
Full Changelog: v3.0.2...v4.0.0