Skip to content
Merged
Show file tree
Hide file tree
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 .changeset/duplicate-to-drafts-conditional.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@workflowbuilder/sdk': patch
---

The app bar's "Duplicate to Drafts" menu item now renders only when an `onDuplicateClick` handler is provided, removing the default no-op button.
5 changes: 5 additions & 0 deletions .changeset/template-selector-title.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@workflowbuilder/sdk': patch
---

The template selector modal title now uses the SDK's own `templateSelector.title` string instead of an unrelated plugin translation key.
2 changes: 1 addition & 1 deletion apps/demo/src/app/plugins/help/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Help

Removal of this plugin will result in an application without the "_Unlock Full Product Access_" popup and watermark in the corner.
Removal of this plugin will result in an application without the watermark in the corner.

## Plugins in Workflow Builder

Expand Down
Binary file not shown.
31 changes: 3 additions & 28 deletions apps/demo/src/app/plugins/help/assets/watermark.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

32 changes: 0 additions & 32 deletions apps/demo/src/app/plugins/help/functions/add-items-to-dots.tsx

This file was deleted.

13 changes: 0 additions & 13 deletions apps/demo/src/app/plugins/help/functions/open-help-modal.tsx

This file was deleted.

This file was deleted.

14 changes: 0 additions & 14 deletions apps/demo/src/app/plugins/help/locales/en/translation.json

This file was deleted.

14 changes: 0 additions & 14 deletions apps/demo/src/app/plugins/help/locales/pl/translation.json

This file was deleted.

This file was deleted.

15 changes: 0 additions & 15 deletions apps/demo/src/app/plugins/help/modals/no-access/no-access.tsx

This file was deleted.

This file was deleted.

This file was deleted.

80 changes: 2 additions & 78 deletions apps/demo/src/app/plugins/help/plugin-exports.ts
Original file line number Diff line number Diff line change
@@ -1,86 +1,10 @@
import {
hasRegisteredComponentDecorator,
registerComponentDecorator,
registerFunctionDecorator,
registerPluginTranslation,
} from '@workflowbuilder/sdk';
import type { DiagramContainerProps, ProjectSelectionProps, PropertiesBarProps } from '@workflowbuilder/sdk';
import { registerComponentDecorator } from '@workflowbuilder/sdk';
import type { DiagramContainerProps } from '@workflowbuilder/sdk';

import { getAppBarButton } from './components/app-bar/get-app-bar-button';
import { FooterSupportButton } from './components/footer-support-button';
import { Watermark } from './components/watermark/watermark';
import { addItemsToDots } from './functions/add-items-to-dots';
import { openNoAccessModal } from './functions/open-no-access-modal';
import * as translationEN from './locales/en/translation.json';
import * as translationPL from './locales/pl/translation.json';

export function plugin(): void {
registerComponentDecorator('OptionalFooterContent', {
content: FooterSupportButton,
place: 'after',
});

registerComponentDecorator<DiagramContainerProps>('DiagramContainer', {
content: Watermark,
});

registerFunctionDecorator('getControlsDotsItems', {
callback: addItemsToDots,
place: 'after',
priority: 10,
});

registerComponentDecorator<ProjectSelectionProps>('ProjectSelection', {
modifyProps: (props) => ({
...props,
onDuplicateClick: openNoAccessModal,
}),
});

registerComponentDecorator<PropertiesBarProps>('PropertiesBar', {
modifyProps: (props) => ({
...props,
onMenuHeaderClick: openNoAccessModal,
}),
});

registerComponentDecorator('OptionalAppBarTools', {
content: getAppBarButton('FolderOpen', 'plugins.help.tooltipOpen'),
place: 'after',
priority: 10,
});

/*
This plugin checks whether those buttons are already registered
to avoid rendering hints about features that have been added to the project.
*/
if (hasRegisteredComponentDecorator('OptionalAppBarTools', 'UndoRedo') === false) {
registerComponentDecorator('OptionalAppBarTools', {
content: getAppBarButton('ArrowUUpLeft', 'plugins.help.tooltipUndo'),
place: 'after',
name: 'OptionalAppBarToolsArrowUUpLeft',
});

registerComponentDecorator('OptionalAppBarTools', {
content: getAppBarButton('ArrowUUpRight', 'plugins.help.tooltipRedo'),
place: 'after',
name: 'OptionalAppBarToolsArrowUUpRight',
});
}

if (hasRegisteredComponentDecorator('OptionalAppBarControls', 'ElkLayout') === false) {
registerComponentDecorator('OptionalAppBarControls', {
content: getAppBarButton('TreeStructureDown', 'plugins.help.tooltipElk'),
place: 'before',
});
}

registerPluginTranslation({
en: {
translation: translationEN,
},
pl: {
translation: translationPL,
},
});
}
3 changes: 1 addition & 2 deletions packages/sdk/src/features/app-bar/app-bar-container.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import styles from './app-bar.module.css';
import './variables.css';

import { noop } from '../../utils/noop';
import { Controls } from './components/controls/controls';
import { ProjectSelection } from './components/project-selection/project-selection';
import { Toolbar } from './components/toolbar/toolbar';
Expand All @@ -17,7 +16,7 @@ export function AppBarContainer() {
return (
<div className={styles['container']}>
<Toolbar />
<ProjectSelection onDuplicateClick={noop} />
<ProjectSelection />
<Controls />
</div>
);
Expand Down
Loading
Loading