Repository navigation
Add colors and radius embed options - #5
Draft
Max Musing (MaxMusing) wants to merge 1 commit into
Draft
Max Musing (MaxMusing) wants to merge 1 commit into
Max Musing (MaxMusing) wants to merge 1 commit into
Conversation
Embeds accept a required background plus optional sidebar background, foreground, accent, and chart colors, and a corner radius. Basedash derives every other shade from them. buildEmbedUrl always emits radius and color_background so a removed option resets instead of lingering in the iframe session. Co-authored-by: Max Musing <MaxMusing@users.noreply.github.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
SDK side of Basedash/charts#5998, which adds custom colors and corner radius to embeds.
API
EmbedColors(backgroundrequired;sidebarBackground,foreground,accent,chartoptional) andEmbedRadius(none/small/default/large). Both are newEmbedOptionsfields.BasedashSharedDashboard(which falls back to an enclosing provider), and both URL builders.colors={null}on a component opts back into Basedash's colors under a provider that sets them. Onlyundefinedfalls back to the provider.#, so the URL needs no encoding. Invalid colors or more than nine chart colors throwTypeError.Contract
buildEmbedUrlalways emitsradiusandcolor_background(defaultwhencolorsis null), like every other session option, so dropping an option resets it instead of keeping the iframe session's value.buildSharedDashboardUrlonly emits appearance params whencolorsorradiusis passed, which keeps plain share links byte-identical.BasedashSharedDashboard, which is always an iframe, always passes resolved values. Its defaultsrctherefore gains?radius=default&color_background=default.CONTRACT.mddocuments all of this.Release
Minor changeset. Self-hosted instances on older Basedash releases ignore the new params.
Testing
pnpm checkpasses (typecheck, 44 tests, build, publint, attw). New tests cover:nulloverride