Skip to content

Commit

Permalink
Merge branch 'master' into deps/lodash-es
Browse files Browse the repository at this point in the history
  • Loading branch information
tbouffard committed May 22, 2023
2 parents 8d1dab2 + e89f95f commit 70f1ebe
Show file tree
Hide file tree
Showing 6 changed files with 614 additions and 235 deletions.
2 changes: 1 addition & 1 deletion .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ template: |
In this case:
- release the `examples` repository first
- add a link to the RN https://github.com/$OWNER/bpmn-visualization-examples/releases/tag/v0.34.0
Optional: add link to sthe live tatically.io environment including the tag (not the `master` branch)
Optional: add link to the live statically.io environment including the tag (not the `master` branch)
# What's Changed
Expand Down
24 changes: 15 additions & 9 deletions dev/ts/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,21 @@ function configureStyleFromParameters(parameters: URLSearchParams): void {
}

// Collect style properties to update them later with the bpmn-visualization API
// The implementation will be generalized when more properties will be supported (in particular, the query parameter name)
// For example, we could extract all query params starting with style.api, then rebuild the StyleUpdate from the extracted params
style = { stroke: {}, font: {}, fill: {} };

parameters.get('style.api.stroke.color') && (style.stroke.color = parameters.get('style.api.stroke.color'));
parameters.get('style.api.font.color') && (style.font.color = parameters.get('style.api.font.color'));
parameters.get('style.api.font.opacity') && (style.font.opacity = Number(parameters.get('style.api.font.opacity')));
parameters.get('style.api.fill.color') && (style.fill.color = parameters.get('style.api.fill.color'));
parameters.get('style.api.fill.opacity') && (style.fill.opacity = Number(parameters.get('style.api.fill.opacity')));
logStartup(`Configuring the "Update Style" API from query parameters`);
// Only create the StyleUpdate object if some parameters are set
if (Array.from(parameters.keys()).filter(key => key.startsWith('style.api.')).length > 0) {
style = { stroke: {}, font: {}, fill: {} };

parameters.get('style.api.stroke.color') && (style.stroke.color = parameters.get('style.api.stroke.color'));
parameters.get('style.api.font.color') && (style.font.color = parameters.get('style.api.font.color'));
parameters.get('style.api.font.opacity') && (style.font.opacity = Number(parameters.get('style.api.font.opacity')));
parameters.get('style.api.fill.color') && (style.fill.color = parameters.get('style.api.fill.color'));
parameters.get('style.api.fill.opacity') && (style.fill.opacity = Number(parameters.get('style.api.fill.opacity')));

logStartup(`Prepared "Update Style" API object`, style);
} else {
logStartup(`No query parameters, do not set the "Update Style" API object`);
}
}

function configureBpmnElementIdToCollapseFromParameters(parameters: URLSearchParams): void {
Expand Down

0 comments on commit 70f1ebe

Please sign in to comment.