Skip to content
Merged
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions packages/html/.storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import {
GlobalConfig,
NoOpLogger,
ObjectCodec,
registerModelCodecs,
resetEdgeHandlerConfig,
resetEntityRelationConnectorConfig,
resetHandleConfig,
Expand Down Expand Up @@ -54,9 +55,13 @@ const resetMaxGraphConfigs = (): void => {
// Reset registries to remove additional elements registered in a story
// The objects storing the registered elements are currently public, but they should not be part of the public API.
// They will be marked as private in the future and clear functions will probably provide instead.

// Codec resets
CodecRegistry.aliases = {};
CodecRegistry.codecs = {};
// This is done automatically by ModelSerializer but only once, even if the codec registry is cleaned. So force reload manually here.
// This is a workaround. If we had a unregisteredCodecs function, we could reset the global codecs loading status and the codecs would be automatically registered again.
registerModelCodecs(true);
ObjectCodec.allowEval = originalAllowEvalConfig.objectCodec;
StylesheetCodec.allowEval = originalAllowEvalConfig.stylesheetCodec;

Expand Down