All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
- Adds the setting to hide a design function from the mechanic UI app. This allows to iterate multiple functions and simply hide earlier versions, instead of moving everything to other locations. If a user sets
hideFunction
in their functions settings to true, they won't appear but will still be tracked for updates in HMR mode. It defaults to false.
- Fixes bug that crushed mechanic on PC, because of a module string that wasn't appropriately made cross-os compatible.
- Adds public
memo
function to mechanic core to provide an opt-in performance optimization.memo
can be imported directly from mechanic-core into a design function where it can be used to cache the results of slow computations (like loading static assets). - Adds public
preload
andpreloadFont
functions to mechanic core, that extendmemo
to fetch external resources like images and fonts.
- Adds the setting to debounce re-rendering after changing the input values. By default inputs are debounced by 100ms. If a user sets
debounceInputs
in their functions settings to false they can opt-out of the debouncing. The period can be passed in the settings asdebounceDelay
and defaults to 100ms.
- Hash the localStorage key storing a function's params based on the input's config of the function. This makes sure a fresh localStorage key is used if a function's input configuration changes to prevent bugs like #139 from happening.
- Serve command now prioritizes argument option for port to use instead of config file. Similar as how dev command works.
- Static folder gets uploaded again
- Corrects wrong name for "slider" property of number input in their definition
- Adds missing "multiple" property of image input in their definition
- Design function iframe also takes basename to load resources
- Build command had a import missing
- Removed unused log left in development
- Adds cli and config file options to define static folder (
staticPath
) and custom app components (appCompsPath
)
- App breaking when no custom app components are defined
- Error log when no static folder is included in project
- Support to import custom
SideBar
component inapp/
folder that replaces sidebar in Mechanic UI. - New design function export
ExtraUi
, expected to be a React component that's added to the bottom section of sidebar, on top of default toggles and buttons. - Support for SVG and PNG exports for SVG based engines like
engine-react
andengine-svg
. - New
hideFeedback
design function setting. When true, Mechanic's feedback button is hidden. Defaults to false. - New
hideNavigation
design function setting. When true, the navigation input that lets users select a design function is hidden. Defaults to false. - New
hidePresets
design function setting. When true, preset selection input is hidden. Defaults to false. - New
hideScaleToFit
design function setting. When true, Scale to Fit toggle is hidden. Defaults to false. - New
initialScaleToFit
design function setting. When false, Scale to Fit will be off initially. Defaults to true. - New
hideAutoRefresh
design function setting. When true, Auto Refresh toggle is hidden. Defaults to false. - New
initialAutoRefresh
design function setting. When false, Auto Refresh will be off initially. Defaults to true. - New
hideGenerate
design function setting. When true, Generate button is hidden. Defaults to false. - New
showMultipleExports
design function setting. When false, single export button is shown. When true, two separate export buttons are shown: one for PNG export and another for SVG export. Defaults to false. - New
ignoreStyles
design function setting. When true, CSS in iframe is injected into design function's SVG output. Defaults to false. - Support to serve
static/
folder for all design functions. _isPreview
value is passed to design function handler ininputs
argument.
- Changed filename from
[name][timestamp].[ext]
to[filename]-[timestamp].[ext]
for better readability
- Adds
immer
as dependency.
- Preview / Randomize button was renamed to Generate and styled as a single button with undo / redo
- Error capturing during df render
- Typos in input validation
- Captured instance when animation only calls done and never frame.
- Custom inputs as components can be defined and imported into a mechanic project
- Custom inputs as interaction observers can be defined and imported into a mechanic project
- Title in app shows open design function's name
- Not found page renders link to home
- Random seed history, with undo and redo options
- Random seed history local storage persistency
- State can be set in mechanic instances and passed to the next instance
- Not found page is centered
- Loading and running errors are now shown in app as a modal instead of as an alert
- Uses
immer
to manage input values in app - Generated script from function loader is now written in ESM
- Updated PostCSS dependencies:
postcss-loader
andpostcss-preset-env
- Generalized and streamlined input validation, and added basic inputs definitions and behaviors
- Renamed original width and height values passed from
_widthOriginal
and_heightOriginal
to just_width
and_height
.
- Feedback tag gets lifted
- Added array case to local storage input values serialization
- Allows nested URLs in app that redirect to first level of URL (to main design functions)
- Added styles (& fonts) to SVG frames for animated exports, so they export correctly.
- Added support to export images and video from HTML elements from React engine (credits to @caroillemann)
- Added favicon to mechanic app and loading page.
- Extra input values are passed to design function handler (
_widthOriginal
,_heightOriginal
and_ratio
) (credits to @caroillemann)
- Changed
usesRandom
setting name topersistRandomOnExport
at it's default value totrue
.
- Fixed anchor into App that link to feedback form.
- Default preset is named "Custom" now and behaves more nicely
- Changed colors in ui-components to be consistent with colors in docs
- Replaced nullish coalescing operator used in node scripts to support 12.20 onwards
- Fixed bug involving importing scripts in Windows without using POSIX.
dev
andserve
commands look for available port to use instead of crushing.
- Renamed design function's
params
export toinputs
. This is not backwards compatible and is an API change.
- HMR is now correctly enabled while running
npm run dev
on Mechanic project.
- App can be injected a different public path to be serve from a subfolder
- Renamed packages and scope to
@mechanic-design/core
.
- Added ability to import fonts in functions, and embed them on SVG export
- Added ability to import css files in functions. They are now properly handled when exporting svg.
- Added SVG optimization via SVGO. This also removes unused css in the exported file. There is a new
optimize
setting key that defaults to true and accepts a boolean or a SVGO config object. - Updated app to use new visual styles.
- Changed how design functions are bundled, instead of a single functions bundle that mixes definitions, one per design function bundle is generated through temporal scripts. This lets CSS stylings to not get mixed in the loaded iframe of the app.
- Improved language and logs in main Mechanic commands (
dev
,build
,serve
) - Updated app loading page to use rotating mini Mechanic logo.
- Fixed bug in mechanic value validation through validation field.
- Fixed bug in preset value sets.
- App adds new edge cases to support new image param.
- Core function validation adds support for image param validation.
- Internal app constructions now uses named exports for CSS Modules.
- Added extra information log for "options" field in param validation.
- Added validation of new
"editable"
param property. - Adds "Auto-refresh" toggle to app that enables automatic function call when inputs are changed. It also preserves random seeds when run is automatic.
- Added title to HTML of main app, title to iframe, and a label to design function select for navigation.
- Updated prop pass for
ParamInput
components. - Adapted
mechanic
partially as an ES module package
- Improved path normalization and logs
- Fixed Windows bug when requiring modules without POSIX format.
First logged release