Skip to content

v4.0.0

Choose a tag to compare

@benjamindehli benjamindehli released this 27 May 07:51
· 40 commits to master since this release

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-button component 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 a template.scss file 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 the addGlobalStylesheet calls and adjust component logic to work with slotted content. heading-text is updated to dynamically apply base heading styles and remove margin for dialog headings. gn-button receives functionality to handle hover state with javascript.
  • Package.json Update: Adds a test-release script to package.json to run build and copy-files. Adds a new star.svg asset for the shortcut button.
  • guiHelpers.ts update: Adds the getDocumentHeading helper 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-button interacts 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-button component 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

Full Changelog: v3.0.2...v4.0.0