apex-toolbar
v0.0.0
Published
## Overview
Readme
Apex Toolbar
Overview
This monorepo implements a web component version of the Apex toolbar via StencilJS, provides the wrappers needed to natively integrate with React, Angular, vanilla JS, and Vue, and includes example apps that consume each of the wrappers for demo purposes.
pnpm is used to manage this monorepo workspace. To install all dependencies for all sub-projects at once, see the scripts section below.
Requirements
- Nodejs
^22.0.0 - pnpm
9.15.0
Install
The first time that you start up the project, you'll need to ensure the apps are pnpm install'd after the packages have run pnpm install and pnpm build. Here's the order of operations to run from apex-toolbar:
pnpm install:core
pnpm build:core
pnpm install:frameworks
pnpm build:frameworks
pnpm install:apps
pnpm build:appsStructure
This project has two main areas: packages/ and apps/.
packages/
Framework wrappers that bundle the core Stencil web component into each supported framework.
packages/core: Stencil project that contains the raw Stencil web components. Not published.packages/react-toolbar: Stencil wrapper for React based projects, e.g. Next.js or React. Published as@apex/react-toolbarpackages/angular-workspace/projects/angular: Stencil wrapper for Angular components. Published as@apex/angular-toolbarpackages/js-toolbar: Stencil wrapper for vanilla JS component. Published as@apex/js-toolbarpackages/vue-toolbar: Stencil wrapper for Vue based projects. Published as@apex/vue-toolbar
apps/
Demo apps
apps/react: basic React + Vite applicationapps/angular: Angular applicationapps/js: Vanilla JS implementationapps/vue: basic Vue + Vite application
Scripts
The following scripts are configured for you to operate this codebase:
Build all packages
pnpm run buildRun demo app
This project contains example apps to test the integration of the Apex toolbar web component. Run these commands to view the toolbar in different UI flavors:
pnpm start:react
pnpm start:angular
pnpm start:js
pnpm start:vueLocal development
Develop using the Stencil dev server
Has hot module reloading.
pnpm devDevelop using a demo app
You can choose to start up the dev server for a demo app if you want to see your changes in the context of a consuming application. You'll need to manually run pnpm build after each change to a Stencil package. For example:
In one terminal:
pnpm start:reactMake some changes to the toolbar and save.
In another terminal:
pnpm buildPublishing
TODO: Set up .gitlab-ci.yml
Nuances/Gotchas/Intrinsic Knowledge
Monolithic Component
The toolbar file is large. We had initially broken this out into multiple components to make it easier to read and maintain. However, this introduced a number of problems from styling issues all the way to packaging issues, so we decided to leave it as one component.
For ease of navigation within the large component template, we left comments above what each section is:
- NAVIGATION MENU - if provided with a navigation callback, this will display the cog icon. clients are responsible for bringing their own navigation UI
- APPLICATION AREA - this is the area where the app icon and name are placed
- WIDGET AREA - this is where developers can place widgets
- SETTINGS MENU - if provided with a settings callback, this will display the cog icon. clients are responsible for bringing their own settings UI
- APPLICATION MENU - the user's application list flyout
- PROFILE MENU - the user's profile/logout flyout
- MOBILE TOOLBAR - this is the mobile layout
If you attempt to break it out into multiple, easier to work with components, you need to:
- create a css file for every component and import it -- styles will not work without this
- each component needs shadow set to true to reset the css styles, otherwise you will run into some funky edge cases
- drill props like theme all the way down since css resets
- this means that you will also need to add the class
darkat the root of each broken-out component based on a theme prop - find a way to not include the broken out components into the build, thus exposing them to clients
