Skip to content

Commit c83d3a2

Browse files
committed
icon strategy.
1 parent 4d952ec commit c83d3a2

File tree

6 files changed

+19
-13
lines changed

6 files changed

+19
-13
lines changed

designer/sass/designer-theme.scss

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,7 @@
362362
$emptyInputFillColor: #fff,
363363
$emptyOutputFillColor: #000,
364364
$emptyOutputStrokeWidth: 0,
365-
$emptyOutputStrokeColor: #000,
366-
$emptyIconFillColor: #b3b3b3
365+
$emptyOutputStrokeColor: #000
367366
) {
368367
.sqd-theme-#{$theme} .sqd-step-launch-pad#{if($stepType != '', '.sqd-type-' + $stepType, '')} {
369368
& > g > {
@@ -378,9 +377,6 @@
378377
$outputStrokeColor: $emptyOutputStrokeColor
379378
);
380379
}
381-
& > g > .sqd-launch-pad-empty-icon {
382-
fill: $emptyIconFillColor;
383-
}
384380
}
385381
}
386382

designer/src/core/icons.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ export class Icons {
3131
public static stop = 'M10.75 37.25V10.7H37.3v26.55Z';
3232
public static folder =
3333
'M7.05 40q-1.2 0-2.1-.925-.9-.925-.9-2.075V11q0-1.15.9-2.075Q5.85 8 7.05 8h14l3 3h17q1.15 0 2.075.925.925.925.925 2.075v23q0 1.15-.925 2.075Q42.2 40 41.05 40Z';
34-
public static trigger = 'm12.93 46.3 8.93-16.75-17.87-2.23 26.8-25.68h4.47l-8.93 16.75 17.87 2.23L17.4 46.3h-4.47z';
3534

3635
public static appendPath(parent: SVGElement, pathClassName: string, d: string, size: number): SVGGElement {
3736
const g = Dom.svg('g');

designer/src/workspace/launch-pad-step/launch-pad-step-component-view-configuration.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@ export interface LaunchPadStepComponentViewConfiguration {
77
emptyInputSize: number;
88
emptyOutputSize: number;
99
emptyIconSize: number;
10-
emptyIconD: string;
1110
}

designer/src/workspace/launch-pad-step/launch-pad-step-component-view.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
import { ComponentDom, InputView, JoinView, OutputView } from '../common-views';
1111
import { LaunchPadStepComponentViewConfiguration } from './launch-pad-step-component-view-configuration';
1212
import { ClickCommand, ClickDetails, Placeholder, StepComponentView } from '../component';
13-
import { Dom, getAbsolutePosition, Icons, Vector } from '../../core';
13+
import { Dom, getAbsolutePosition, Vector } from '../../core';
1414
import { StepComponent } from '../step-component';
1515

1616
const COMPONENT_CLASS_NAME = 'launch-pad';
@@ -118,8 +118,19 @@ function createView(
118118
outputView = OutputView.create(g, width / 2, height, cfg.emptyOutputSize);
119119
}
120120

121-
const icon = Icons.appendPath(g, 'sqd-launch-pad-empty-icon', cfg.emptyIconD, cfg.emptyIconSize);
122-
Dom.translate(icon, (width - cfg.emptyIconSize) / 2, (height - cfg.emptyIconSize) / 2);
121+
if (cfg.emptyIconSize > 0) {
122+
const iconUrl = viewContext.getStepIconUrl();
123+
if (iconUrl) {
124+
const icon = Dom.svg('image', {
125+
href: iconUrl,
126+
x: (width - cfg.emptyIconSize) / 2,
127+
y: (height - cfg.emptyIconSize) / 2,
128+
width: cfg.emptyIconSize,
129+
height: cfg.emptyIconSize
130+
});
131+
g.appendChild(icon);
132+
}
133+
}
123134

124135
joinX = width / 2;
125136
}

designer/src/workspace/launch-pad-step/launch-pad-step-extension.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { StepExtension } from '../../designer-extension';
33
import { LaunchPadStepExtensionConfiguration } from './launch-pad-step-extension-configuration';
44
import { createLaunchPadStepComponentViewFactory } from './launch-pad-step-component-view';
55
import { LaunchPadStepComponentViewConfiguration } from './launch-pad-step-component-view-configuration';
6-
import { Icons } from '../../core';
76

87
const defaultViewConfiguration: LaunchPadStepComponentViewConfiguration = {
98
isRegionEnabled: true,
@@ -13,8 +12,7 @@ const defaultViewConfiguration: LaunchPadStepComponentViewConfiguration = {
1312
emptyPaddingY: 20,
1413
emptyInputSize: 14,
1514
emptyOutputSize: 10,
16-
emptyIconSize: 24,
17-
emptyIconD: Icons.trigger
15+
emptyIconSize: 24
1816
};
1917

2018
export class LaunchPadStepExtension implements StepExtension<SequentialStep> {

examples/assets/triggers.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ const configuration = {
5656

5757
steps: {
5858
iconUrlProvider: (_, type) => {
59+
if (type === 'launchPad') {
60+
return './assets/icon-trigger.svg';
61+
}
5962
return `./assets/icon-${type}.svg`;
6063
},
6164
isDuplicable(step) {

0 commit comments

Comments
 (0)