@activecollab/components 2.0.441 → 2.0.442
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/presentation/shared/UserDetailsDialog.js +125 -0
- package/dist/cjs/presentation/shared/UserDetailsDialog.js.map +1 -0
- package/dist/cjs/presentation/shared/index.js +15 -0
- package/dist/cjs/presentation/shared/index.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/bottomDock.js +10 -3
- package/dist/cjs/presentation/whiteboard/bottomDock.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/canvasElements.js +114 -25
- package/dist/cjs/presentation/whiteboard/canvasElements.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/entityCardActions.js +79 -0
- package/dist/cjs/presentation/whiteboard/entityCardActions.js.map +1 -0
- package/dist/cjs/presentation/whiteboard/inspector.js +20 -5
- package/dist/cjs/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/outline.js +4 -2
- package/dist/cjs/presentation/whiteboard/outline.js.map +1 -1
- package/dist/cjs/presentation/whiteboard/projectElements.js +188 -53
- package/dist/cjs/presentation/whiteboard/projectElements.js.map +1 -1
- package/dist/esm/presentation/shared/UserDetailsDialog.d.ts +45 -0
- package/dist/esm/presentation/shared/UserDetailsDialog.d.ts.map +1 -0
- package/dist/esm/presentation/shared/UserDetailsDialog.js +115 -0
- package/dist/esm/presentation/shared/UserDetailsDialog.js.map +1 -0
- package/dist/esm/presentation/shared/index.d.ts +2 -0
- package/dist/esm/presentation/shared/index.d.ts.map +1 -1
- package/dist/esm/presentation/shared/index.js +1 -0
- package/dist/esm/presentation/shared/index.js.map +1 -1
- package/dist/esm/presentation/whiteboard/bottomDock.d.ts +3 -2
- package/dist/esm/presentation/whiteboard/bottomDock.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/bottomDock.js +9 -4
- package/dist/esm/presentation/whiteboard/bottomDock.js.map +1 -1
- package/dist/esm/presentation/whiteboard/canvasElements.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/canvasElements.js +94 -25
- package/dist/esm/presentation/whiteboard/canvasElements.js.map +1 -1
- package/dist/esm/presentation/whiteboard/entityCardActions.d.ts +37 -0
- package/dist/esm/presentation/whiteboard/entityCardActions.d.ts.map +1 -0
- package/dist/esm/presentation/whiteboard/entityCardActions.js +69 -0
- package/dist/esm/presentation/whiteboard/entityCardActions.js.map +1 -0
- package/dist/esm/presentation/whiteboard/inspector.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/inspector.js +29 -7
- package/dist/esm/presentation/whiteboard/inspector.js.map +1 -1
- package/dist/esm/presentation/whiteboard/outline.d.ts +1 -1
- package/dist/esm/presentation/whiteboard/outline.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/outline.js +5 -3
- package/dist/esm/presentation/whiteboard/outline.js.map +1 -1
- package/dist/esm/presentation/whiteboard/projectElements.d.ts +40 -8
- package/dist/esm/presentation/whiteboard/projectElements.d.ts.map +1 -1
- package/dist/esm/presentation/whiteboard/projectElements.js +181 -55
- package/dist/esm/presentation/whiteboard/projectElements.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,6 +24,7 @@ export { SourceCodeSection, IssueRow, CodeRow, Spine, HistoryDialog, CompletedHe
|
|
|
24
24
|
export { SuggestSubtasksButton } from "./SuggestSubtasksButton";
|
|
25
25
|
export { TaskOptionsMenu, TaskListOptionsMenu } from "./TaskOptionsMenu";
|
|
26
26
|
export { UserMenu } from "./UserMenu";
|
|
27
|
+
export { UserDetailsDialog, USER_DETAILS_AVATAR_SIZE } from "./UserDetailsDialog";
|
|
27
28
|
export { TwoFactorShield } from "./TwoFactorShield";
|
|
28
29
|
export { BackupCodesDialogs, CreateLoginCodeDialogs } from "./TwoFactorDialogs";
|
|
29
30
|
export { SettingsHeader, SettingsContent, StyledSettingRow, RowText, SettingRow } from "./settings";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["MainLogo","RoundAvatar","PresentationShell","StyledPagePaper","PageHeader","ProjectPageHeader","TabHeader","ProjectOptionsMenu","PortfolioOptionsMenu","WidgetGrid","WidgetGroupBy","StatWidget","WidgetRankedList","OverviewWidget","AreaChartWidget","DailyDeltaChartWidget","LeaderboardWidget","StackedBarChartWidget","CHART_SERIES_COLORS","OVERVIEW_SECTION_COLORS","PERIOD_OPTIONS","PeriodPicker","FloatingControls","MessageDialog","DocLinkContext","messageComponents","MessageFeedback","POSITIVE_FEEDBACK_OPTIONS","NEGATIVE_FEEDBACK_OPTIONS","HelpAndSupportMenu","LinkingCommandsButton","LinkBranchOrPullRequestDialog","ConnectRepositoryDialog","RepositorySelect","buildRepoOptions","CONNECTIONS","PROJECT_REPOSITORIES","CONNECTABLE_REPOSITORIES","WebhookLogsDialog","WEBHOOK_CONNECTIONS","WEBHOOK_REPOSITORIES","SourceCodeSection","IssueRow","CodeRow","Spine","HistoryDialog","CompletedHeader","SuggestSubtasksButton","TaskOptionsMenu","TaskListOptionsMenu","UserMenu","TwoFactorShield","BackupCodesDialogs","CreateLoginCodeDialogs","SettingsHeader","SettingsContent","StyledSettingRow","RowText","SettingRow","FeatureAvailability","DEFAULT_FEATURE_AVAILABILITY","PORTFOLIO_TYPES","VISIBILITY_OPTIONS","DEFAULT_PORTFOLIO_FORM_VALUES","LEADERS_LIST","CATEGORIES","CLIENTS","contextFieldLabel","leaderShortName","defaultPortfolioName","isPortfolioDetailsValid","sampleProjectOptionIds","PortfolioDetailsFields","EditPortfolioDialog"],"sources":["../../../../src/presentation/shared/index.ts"],"sourcesContent":["/**\n * Shared building blocks for the Presentation mock-ups (`Presentation/*`\n * stories). The application shell, page headers, tab bar and small widgets are\n * defined once here and reused by the List view, Column view, Task sheet and\n * empty-page stories so the chrome stays identical and in one place.\n */\nexport * from \"./tokens\";\nexport { MainLogo } from \"./MainLogo\";\nexport { RoundAvatar } from \"./RoundAvatar\";\nexport { PresentationShell, StyledPagePaper } from \"./PresentationShell\";\nexport type { PresentationShellProps } from \"./PresentationShell\";\nexport { PageHeader, ProjectPageHeader, TabHeader } from \"./headers\";\nexport type {\n PageHeaderProps,\n ProjectPageHeaderProps,\n TabHeaderProps,\n} from \"./headers\";\nexport { ProjectOptionsMenu } from \"./ProjectOptionsMenu\";\nexport { PortfolioOptionsMenu } from \"./PortfolioOptionsMenu\";\nexport type { PortfolioOptionsMenuProps } from \"./PortfolioOptionsMenu\";\nexport {\n WidgetGrid,\n WidgetGroupBy,\n StatWidget,\n WidgetRankedList,\n OverviewWidget,\n AreaChartWidget,\n DailyDeltaChartWidget,\n LeaderboardWidget,\n StackedBarChartWidget,\n CHART_SERIES_COLORS,\n OVERVIEW_SECTION_COLORS,\n PERIOD_OPTIONS,\n PeriodPicker,\n} from \"./dashboardWidgets\";\nexport type {\n WidgetGroupByProps,\n StatWidgetProps,\n RankedListItem,\n OverviewSectionData,\n OverviewWidgetProps,\n AreaChartWidgetProps,\n DailyDeltaPoint,\n DailyDeltaChartWidgetProps,\n LeaderboardRowData,\n LeaderboardWidgetProps,\n StackedBarColumn,\n StackedBarChartWidgetProps,\n PeriodPickerProps,\n} from \"./dashboardWidgets\";\n\nexport type { ProjectOptionsMenuProps } from \"./ProjectOptionsMenu\";\nexport { FloatingControls } from \"./FloatingControls\";\nexport {\n MessageDialog,\n DocLinkContext,\n messageComponents,\n} from \"./MessageDialog\";\nexport type {\n MessageDialogProps,\n MessageDialogSize,\n OpenArticleHandler,\n} from \"./MessageDialog\";\nexport {\n MessageFeedback,\n POSITIVE_FEEDBACK_OPTIONS,\n NEGATIVE_FEEDBACK_OPTIONS,\n} from \"./MessageFeedback\";\nexport type {\n MessageFeedbackProps,\n MessageFeedbackResult,\n FeedbackOption,\n FeedbackSentiment,\n} from \"./MessageFeedback\";\nexport { HelpAndSupportMenu } from \"./HelpAndSupportMenu\";\nexport type { HelpAndSupportMenuProps } from \"./HelpAndSupportMenu\";\nexport { LinkingCommandsButton } from \"./LinkingCommandsButton\";\nexport { LinkBranchOrPullRequestDialog } from \"./LinkBranchOrPullRequestDialog\";\nexport type { LinkBranchOrPullRequestDialogProps } from \"./LinkBranchOrPullRequestDialog\";\nexport {\n ConnectRepositoryDialog,\n RepositorySelect,\n buildRepoOptions,\n CONNECTIONS,\n PROJECT_REPOSITORIES,\n CONNECTABLE_REPOSITORIES,\n} from \"./ConnectRepositoryDialog\";\nexport type {\n ConnectRepositoryDialogProps,\n RepositorySelectProps,\n Connection,\n ConnectionService,\n Repository,\n} from \"./ConnectRepositoryDialog\";\nexport {\n WebhookLogsDialog,\n WEBHOOK_CONNECTIONS,\n WEBHOOK_REPOSITORIES,\n} from \"./WebhookLogsDialog\";\nexport type {\n WebhookLogsDialogProps,\n WebhookConnection,\n WebhookRepository,\n WebhookLog,\n} from \"./WebhookLogsDialog\";\nexport {\n SourceCodeSection,\n IssueRow,\n CodeRow,\n Spine,\n HistoryDialog,\n CompletedHeader,\n} from \"./SourceCodeSection\";\nexport type {\n IssueEntry,\n CodeEntry,\n Stage,\n HistoryEvent,\n StageState,\n CodeStatus,\n SectionVariant,\n} from \"./SourceCodeSection\";\nexport { SuggestSubtasksButton } from \"./SuggestSubtasksButton\";\nexport { TaskOptionsMenu, TaskListOptionsMenu } from \"./TaskOptionsMenu\";\nexport type {\n TaskOptionsMenuProps,\n TaskListOptionsMenuProps,\n} from \"./TaskOptionsMenu\";\nexport { UserMenu } from \"./UserMenu\";\nexport type { UserMenuProps, UserMenuVariant } from \"./UserMenu\";\nexport { TwoFactorShield } from \"./TwoFactorShield\";\nexport type { TwoFactorShieldProps } from \"./TwoFactorShield\";\nexport { BackupCodesDialogs, CreateLoginCodeDialogs } from \"./TwoFactorDialogs\";\nexport type {\n BackupCodesDialogsProps,\n CreateLoginCodeDialogsProps,\n} from \"./TwoFactorDialogs\";\nexport {\n SettingsHeader,\n SettingsContent,\n StyledSettingRow,\n RowText,\n SettingRow,\n} from \"./settings\";\nexport type { SettingsHeaderProps, SettingRowProps } from \"./settings\";\nexport {\n FeatureAvailability,\n DEFAULT_FEATURE_AVAILABILITY,\n} from \"./FeatureAvailability\";\nexport type {\n FeatureAvailabilityProps,\n AvailabilityRow,\n AvailabilityMark,\n AvailabilityStatus,\n} from \"./FeatureAvailability\";\nexport {\n PORTFOLIO_TYPES,\n VISIBILITY_OPTIONS,\n DEFAULT_PORTFOLIO_FORM_VALUES,\n LEADERS_LIST,\n CATEGORIES,\n CLIENTS,\n contextFieldLabel,\n leaderShortName,\n defaultPortfolioName,\n isPortfolioDetailsValid,\n sampleProjectOptionIds,\n PortfolioDetailsFields,\n EditPortfolioDialog,\n} from \"./portfolioDetails\";\nexport type {\n PortfolioKind,\n PortfolioVisibility,\n GroupBy,\n PortfolioFormValues,\n PickerLeader,\n PortfolioDetailsFieldsProps,\n EditPortfolioDialogProps,\n} from \"./portfolioDetails\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,qBAAqB;AAExE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ,WAAW;AAMpE,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,SACEC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EACdC,eAAe,EACfC,qBAAqB,EACrBC,iBAAiB,EACjBC,qBAAqB,EACrBC,mBAAmB,EACnBC,uBAAuB,EACvBC,cAAc,EACdC,YAAY,QACP,oBAAoB;AAkB3B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,QACZ,iBAAiB;AAMxB,SACEC,eAAe,EACfC,yBAAyB,EACzBC,yBAAyB,QACpB,mBAAmB;AAO1B,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,6BAA6B,QAAQ,iCAAiC;AAE/E,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,2BAA2B;AAQlC,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,qBAAqB;AAO5B,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,eAAe,QACV,qBAAqB;AAU5B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,mBAAmB;AAKxE,SAASC,QAAQ,QAAQ,YAAY;AAErC,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,oBAAoB;AAK/E,SACEC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,OAAO,EACPC,UAAU,QACL,YAAY;AAEnB,SACEC,mBAAmB,EACnBC,4BAA4B,QACvB,uBAAuB;AAO9B,SACEC,eAAe,EACfC,kBAAkB,EAClBC,6BAA6B,EAC7BC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,iBAAiB,EACjBC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,QACd,oBAAoB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["MainLogo","RoundAvatar","PresentationShell","StyledPagePaper","PageHeader","ProjectPageHeader","TabHeader","ProjectOptionsMenu","PortfolioOptionsMenu","WidgetGrid","WidgetGroupBy","StatWidget","WidgetRankedList","OverviewWidget","AreaChartWidget","DailyDeltaChartWidget","LeaderboardWidget","StackedBarChartWidget","CHART_SERIES_COLORS","OVERVIEW_SECTION_COLORS","PERIOD_OPTIONS","PeriodPicker","FloatingControls","MessageDialog","DocLinkContext","messageComponents","MessageFeedback","POSITIVE_FEEDBACK_OPTIONS","NEGATIVE_FEEDBACK_OPTIONS","HelpAndSupportMenu","LinkingCommandsButton","LinkBranchOrPullRequestDialog","ConnectRepositoryDialog","RepositorySelect","buildRepoOptions","CONNECTIONS","PROJECT_REPOSITORIES","CONNECTABLE_REPOSITORIES","WebhookLogsDialog","WEBHOOK_CONNECTIONS","WEBHOOK_REPOSITORIES","SourceCodeSection","IssueRow","CodeRow","Spine","HistoryDialog","CompletedHeader","SuggestSubtasksButton","TaskOptionsMenu","TaskListOptionsMenu","UserMenu","UserDetailsDialog","USER_DETAILS_AVATAR_SIZE","TwoFactorShield","BackupCodesDialogs","CreateLoginCodeDialogs","SettingsHeader","SettingsContent","StyledSettingRow","RowText","SettingRow","FeatureAvailability","DEFAULT_FEATURE_AVAILABILITY","PORTFOLIO_TYPES","VISIBILITY_OPTIONS","DEFAULT_PORTFOLIO_FORM_VALUES","LEADERS_LIST","CATEGORIES","CLIENTS","contextFieldLabel","leaderShortName","defaultPortfolioName","isPortfolioDetailsValid","sampleProjectOptionIds","PortfolioDetailsFields","EditPortfolioDialog"],"sources":["../../../../src/presentation/shared/index.ts"],"sourcesContent":["/**\n * Shared building blocks for the Presentation mock-ups (`Presentation/*`\n * stories). The application shell, page headers, tab bar and small widgets are\n * defined once here and reused by the List view, Column view, Task sheet and\n * empty-page stories so the chrome stays identical and in one place.\n */\nexport * from \"./tokens\";\nexport { MainLogo } from \"./MainLogo\";\nexport { RoundAvatar } from \"./RoundAvatar\";\nexport { PresentationShell, StyledPagePaper } from \"./PresentationShell\";\nexport type { PresentationShellProps } from \"./PresentationShell\";\nexport { PageHeader, ProjectPageHeader, TabHeader } from \"./headers\";\nexport type {\n PageHeaderProps,\n ProjectPageHeaderProps,\n TabHeaderProps,\n} from \"./headers\";\nexport { ProjectOptionsMenu } from \"./ProjectOptionsMenu\";\nexport { PortfolioOptionsMenu } from \"./PortfolioOptionsMenu\";\nexport type { PortfolioOptionsMenuProps } from \"./PortfolioOptionsMenu\";\nexport {\n WidgetGrid,\n WidgetGroupBy,\n StatWidget,\n WidgetRankedList,\n OverviewWidget,\n AreaChartWidget,\n DailyDeltaChartWidget,\n LeaderboardWidget,\n StackedBarChartWidget,\n CHART_SERIES_COLORS,\n OVERVIEW_SECTION_COLORS,\n PERIOD_OPTIONS,\n PeriodPicker,\n} from \"./dashboardWidgets\";\nexport type {\n WidgetGroupByProps,\n StatWidgetProps,\n RankedListItem,\n OverviewSectionData,\n OverviewWidgetProps,\n AreaChartWidgetProps,\n DailyDeltaPoint,\n DailyDeltaChartWidgetProps,\n LeaderboardRowData,\n LeaderboardWidgetProps,\n StackedBarColumn,\n StackedBarChartWidgetProps,\n PeriodPickerProps,\n} from \"./dashboardWidgets\";\n\nexport type { ProjectOptionsMenuProps } from \"./ProjectOptionsMenu\";\nexport { FloatingControls } from \"./FloatingControls\";\nexport {\n MessageDialog,\n DocLinkContext,\n messageComponents,\n} from \"./MessageDialog\";\nexport type {\n MessageDialogProps,\n MessageDialogSize,\n OpenArticleHandler,\n} from \"./MessageDialog\";\nexport {\n MessageFeedback,\n POSITIVE_FEEDBACK_OPTIONS,\n NEGATIVE_FEEDBACK_OPTIONS,\n} from \"./MessageFeedback\";\nexport type {\n MessageFeedbackProps,\n MessageFeedbackResult,\n FeedbackOption,\n FeedbackSentiment,\n} from \"./MessageFeedback\";\nexport { HelpAndSupportMenu } from \"./HelpAndSupportMenu\";\nexport type { HelpAndSupportMenuProps } from \"./HelpAndSupportMenu\";\nexport { LinkingCommandsButton } from \"./LinkingCommandsButton\";\nexport { LinkBranchOrPullRequestDialog } from \"./LinkBranchOrPullRequestDialog\";\nexport type { LinkBranchOrPullRequestDialogProps } from \"./LinkBranchOrPullRequestDialog\";\nexport {\n ConnectRepositoryDialog,\n RepositorySelect,\n buildRepoOptions,\n CONNECTIONS,\n PROJECT_REPOSITORIES,\n CONNECTABLE_REPOSITORIES,\n} from \"./ConnectRepositoryDialog\";\nexport type {\n ConnectRepositoryDialogProps,\n RepositorySelectProps,\n Connection,\n ConnectionService,\n Repository,\n} from \"./ConnectRepositoryDialog\";\nexport {\n WebhookLogsDialog,\n WEBHOOK_CONNECTIONS,\n WEBHOOK_REPOSITORIES,\n} from \"./WebhookLogsDialog\";\nexport type {\n WebhookLogsDialogProps,\n WebhookConnection,\n WebhookRepository,\n WebhookLog,\n} from \"./WebhookLogsDialog\";\nexport {\n SourceCodeSection,\n IssueRow,\n CodeRow,\n Spine,\n HistoryDialog,\n CompletedHeader,\n} from \"./SourceCodeSection\";\nexport type {\n IssueEntry,\n CodeEntry,\n Stage,\n HistoryEvent,\n StageState,\n CodeStatus,\n SectionVariant,\n} from \"./SourceCodeSection\";\nexport { SuggestSubtasksButton } from \"./SuggestSubtasksButton\";\nexport { TaskOptionsMenu, TaskListOptionsMenu } from \"./TaskOptionsMenu\";\nexport type {\n TaskOptionsMenuProps,\n TaskListOptionsMenuProps,\n} from \"./TaskOptionsMenu\";\nexport { UserMenu } from \"./UserMenu\";\nexport type { UserMenuProps, UserMenuVariant } from \"./UserMenu\";\nexport {\n UserDetailsDialog,\n USER_DETAILS_AVATAR_SIZE,\n} from \"./UserDetailsDialog\";\nexport type {\n UserDetailsDialogProps,\n UserDetailsAvatar,\n} from \"./UserDetailsDialog\";\nexport { TwoFactorShield } from \"./TwoFactorShield\";\nexport type { TwoFactorShieldProps } from \"./TwoFactorShield\";\nexport { BackupCodesDialogs, CreateLoginCodeDialogs } from \"./TwoFactorDialogs\";\nexport type {\n BackupCodesDialogsProps,\n CreateLoginCodeDialogsProps,\n} from \"./TwoFactorDialogs\";\nexport {\n SettingsHeader,\n SettingsContent,\n StyledSettingRow,\n RowText,\n SettingRow,\n} from \"./settings\";\nexport type { SettingsHeaderProps, SettingRowProps } from \"./settings\";\nexport {\n FeatureAvailability,\n DEFAULT_FEATURE_AVAILABILITY,\n} from \"./FeatureAvailability\";\nexport type {\n FeatureAvailabilityProps,\n AvailabilityRow,\n AvailabilityMark,\n AvailabilityStatus,\n} from \"./FeatureAvailability\";\nexport {\n PORTFOLIO_TYPES,\n VISIBILITY_OPTIONS,\n DEFAULT_PORTFOLIO_FORM_VALUES,\n LEADERS_LIST,\n CATEGORIES,\n CLIENTS,\n contextFieldLabel,\n leaderShortName,\n defaultPortfolioName,\n isPortfolioDetailsValid,\n sampleProjectOptionIds,\n PortfolioDetailsFields,\n EditPortfolioDialog,\n} from \"./portfolioDetails\";\nexport type {\n PortfolioKind,\n PortfolioVisibility,\n GroupBy,\n PortfolioFormValues,\n PickerLeader,\n PortfolioDetailsFieldsProps,\n EditPortfolioDialogProps,\n} from \"./portfolioDetails\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,UAAU;AACxB,SAASA,QAAQ,QAAQ,YAAY;AACrC,SAASC,WAAW,QAAQ,eAAe;AAC3C,SAASC,iBAAiB,EAAEC,eAAe,QAAQ,qBAAqB;AAExE,SAASC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,QAAQ,WAAW;AAMpE,SAASC,kBAAkB,QAAQ,sBAAsB;AACzD,SAASC,oBAAoB,QAAQ,wBAAwB;AAE7D,SACEC,UAAU,EACVC,aAAa,EACbC,UAAU,EACVC,gBAAgB,EAChBC,cAAc,EACdC,eAAe,EACfC,qBAAqB,EACrBC,iBAAiB,EACjBC,qBAAqB,EACrBC,mBAAmB,EACnBC,uBAAuB,EACvBC,cAAc,EACdC,YAAY,QACP,oBAAoB;AAkB3B,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,QACZ,iBAAiB;AAMxB,SACEC,eAAe,EACfC,yBAAyB,EACzBC,yBAAyB,QACpB,mBAAmB;AAO1B,SAASC,kBAAkB,QAAQ,sBAAsB;AAEzD,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,6BAA6B,QAAQ,iCAAiC;AAE/E,SACEC,uBAAuB,EACvBC,gBAAgB,EAChBC,gBAAgB,EAChBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,2BAA2B;AAQlC,SACEC,iBAAiB,EACjBC,mBAAmB,EACnBC,oBAAoB,QACf,qBAAqB;AAO5B,SACEC,iBAAiB,EACjBC,QAAQ,EACRC,OAAO,EACPC,KAAK,EACLC,aAAa,EACbC,eAAe,QACV,qBAAqB;AAU5B,SAASC,qBAAqB,QAAQ,yBAAyB;AAC/D,SAASC,eAAe,EAAEC,mBAAmB,QAAQ,mBAAmB;AAKxE,SAASC,QAAQ,QAAQ,YAAY;AAErC,SACEC,iBAAiB,EACjBC,wBAAwB,QACnB,qBAAqB;AAK5B,SAASC,eAAe,QAAQ,mBAAmB;AAEnD,SAASC,kBAAkB,EAAEC,sBAAsB,QAAQ,oBAAoB;AAK/E,SACEC,cAAc,EACdC,eAAe,EACfC,gBAAgB,EAChBC,OAAO,EACPC,UAAU,QACL,YAAY;AAEnB,SACEC,mBAAmB,EACnBC,4BAA4B,QACvB,uBAAuB;AAO9B,SACEC,eAAe,EACfC,kBAAkB,EAClBC,6BAA6B,EAC7BC,YAAY,EACZC,UAAU,EACVC,OAAO,EACPC,iBAAiB,EACjBC,eAAe,EACfC,oBAAoB,EACpBC,uBAAuB,EACvBC,sBAAsB,EACtBC,sBAAsB,EACtBC,mBAAmB,QACd,oBAAoB","ignoreList":[]}
|
|
@@ -17,9 +17,10 @@ export declare const TOOL_HINTS: {
|
|
|
17
17
|
readonly roundedRectangle: "Click to drop a default rectangle, or draw one to size. Press R for a rectangle.";
|
|
18
18
|
readonly triangle: "Click to drop a default triangle, or draw one to size. Press Y for a triangle.";
|
|
19
19
|
readonly connector: "Drag from one element to another to connect them. Press C to connect.";
|
|
20
|
-
readonly projectElements: "Put a task or a
|
|
20
|
+
readonly projectElements: "Put a task, a project or a person on the board — pick which above, then draw it.";
|
|
21
21
|
readonly project: "Draw a box to place a project card, then pick the project it shows.";
|
|
22
22
|
readonly task: "Draw a box to place a task card, then pick the task it shows.";
|
|
23
|
+
readonly person: "Draw a circle to place a person, then pick who it shows.";
|
|
23
24
|
readonly link: "Draw a box to place a link, or paste a URL anywhere. Press L for link.";
|
|
24
25
|
readonly file: "Draw a box to place a file, or drop one on the board. Press F for file.";
|
|
25
26
|
readonly sticky: "Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.";
|
|
@@ -35,7 +36,7 @@ export type ShapeTool = "circle" | "roundedRectangle" | "triangle";
|
|
|
35
36
|
* element here" and a drag into "draw one this big"; everything else stays a
|
|
36
37
|
* mock, so the board is otherwise always in select mode.
|
|
37
38
|
*/
|
|
38
|
-
export type BoardTool = "select" | "link" | "file" | "project" | "task" | ShapeTool;
|
|
39
|
+
export type BoardTool = "select" | "link" | "file" | "project" | "task" | "person" | ShapeTool;
|
|
39
40
|
export declare const SHAPE_TOOLS: readonly ShapeTool[];
|
|
40
41
|
export declare const isShapeTool: (tool: BoardTool) => tool is ShapeTool;
|
|
41
42
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomDock.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"bottomDock.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,YAAY,EAAE,SAAS,EAAY,MAAM,OAAO,CAAC;AA6BjE,eAAO,MAAM,WAAW,oEA2BvB,CAAC;AAGF,eAAO,MAAM,eAAe,sJAQ3B,CAAC;AAEF,eAAO,MAAM,gBAAgB,oEAU5B,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,oEAAwB,CAAC;AAIpD,eAAO,MAAM,UAAU,mQAQtB,CAAC;AAGF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;CAuBb,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,OAAO,U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+2,7 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { useState } from "react";
|
|
3
3
|
import styled from "styled-components";
|
|
4
4
|
import { IconButton } from "../../components/IconButton";
|
|
5
|
-
import { AttachmentIcon, CircleIcon, ConnectionIcon, DrawIcon, InsertLinkIcon, ProjectIcon, ProjectStarIcon, RoundedRectangleIcon, ShapesIcon, NoteIcon, TaskIcon, TextIcon, TriangleIcon } from "../../components/Icons";
|
|
5
|
+
import { AttachmentIcon, CircleIcon, ConnectionIcon, DrawIcon, InsertLinkIcon, PersonIcon, ProjectIcon, ProjectStarIcon, RoundedRectangleIcon, ShapesIcon, NoteIcon, TaskIcon, TextIcon, TriangleIcon } from "../../components/Icons";
|
|
6
6
|
import { Tooltip } from "../../components/Tooltip";
|
|
7
7
|
import { Caption1 } from "../../components/Typography";
|
|
8
8
|
|
|
@@ -49,9 +49,10 @@ export const TOOL_HINTS = {
|
|
|
49
49
|
roundedRectangle: "Click to drop a default rectangle, or draw one to size. Press R for a rectangle.",
|
|
50
50
|
triangle: "Click to drop a default triangle, or draw one to size. Press Y for a triangle.",
|
|
51
51
|
connector: "Drag from one element to another to connect them. Press C to connect.",
|
|
52
|
-
projectElements: "Put a task or a
|
|
52
|
+
projectElements: "Put a task, a project or a person on the board — pick which above, then draw it.",
|
|
53
53
|
project: "Draw a box to place a project card, then pick the project it shows.",
|
|
54
54
|
task: "Draw a box to place a task card, then pick the task it shows.",
|
|
55
|
+
person: "Draw a circle to place a person, then pick who it shows.",
|
|
55
56
|
link: "Draw a box to place a link, or paste a URL anywhere. Press L for link.",
|
|
56
57
|
file: "Draw a box to place a file, or drop one on the board. Press F for file.",
|
|
57
58
|
sticky: "Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.",
|
|
@@ -150,7 +151,7 @@ export const BottomDock = _ref2 => {
|
|
|
150
151
|
the pill for free — another dock tool, Esc on the canvas, or the gesture
|
|
151
152
|
finishing and disarming the tool. Two states could disagree; one cannot. */
|
|
152
153
|
const shapesOpen = isShapeTool(activeTool);
|
|
153
|
-
const projectElementsOpen = activeTool === "task" || activeTool === "project";
|
|
154
|
+
const projectElementsOpen = activeTool === "task" || activeTool === "project" || activeTool === "person";
|
|
154
155
|
return /*#__PURE__*/React.createElement(StyledBottomDock, null, shapesOpen ? /*#__PURE__*/React.createElement(StyledToolPill, null, /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
155
156
|
tip: "Circle",
|
|
156
157
|
active: activeTool === "circle",
|
|
@@ -171,7 +172,11 @@ export const BottomDock = _ref2 => {
|
|
|
171
172
|
tip: "Project",
|
|
172
173
|
active: activeTool === "project",
|
|
173
174
|
onClick: () => onToolChange("project")
|
|
174
|
-
}, hoverProps("project")), /*#__PURE__*/React.createElement(ProjectIcon, null))
|
|
175
|
+
}, hoverProps("project")), /*#__PURE__*/React.createElement(ProjectIcon, null)), /*#__PURE__*/React.createElement(ToolButton, _extends({
|
|
176
|
+
tip: "User",
|
|
177
|
+
active: activeTool === "person",
|
|
178
|
+
onClick: () => onToolChange("person")
|
|
179
|
+
}, hoverProps("person")), /*#__PURE__*/React.createElement(PersonIcon, null))) : null, /*#__PURE__*/React.createElement(ToolSurface, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
175
180
|
title: "Sticky Note"
|
|
176
181
|
}, /*#__PURE__*/React.createElement(IconButton, _extends({
|
|
177
182
|
variant: "text gray",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bottomDock.js","names":["React","useState","styled","IconButton","AttachmentIcon","CircleIcon","ConnectionIcon","DrawIcon","InsertLinkIcon","ProjectIcon","ProjectStarIcon","RoundedRectangleIcon","ShapesIcon","NoteIcon","TaskIcon","TextIcon","TriangleIcon","Tooltip","Caption1","ToolSurface","div","withConfig","displayName","componentId","verticalDivider","StyledBottomDock","StyledToolPill","StyledHint","TOOL_HINTS","circle","roundedRectangle","triangle","connector","projectElements","project","task","link","file","sticky","text","draw","shapes","SHAPE_TOOLS","isShapeTool","tool","includes","DEFAULT_SHAPE_TOOL","DEFAULT_PROJECT_ELEMENT_TOOL","SHAPE_DEFAULT_SIZES","width","height","CARD_PREVIEW_HEIGHT","ToolButton","_ref","tip","active","children","onClick","onMouseEnter","onMouseLeave","createElement","title","variant","BottomDock","_ref2","activeTool","onToolChange","_useState","hoverHint","setHoverHint","hoverProps","hint","shapesOpen","projectElementsOpen","_extends","color","className","undefined"],"sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n AttachmentIcon,\n CircleIcon,\n ConnectionIcon,\n DrawIcon,\n InsertLinkIcon,\n ProjectIcon,\n ProjectStarIcon,\n RoundedRectangleIcon,\n ShapesIcon,\n NoteIcon,\n TaskIcon,\n TextIcon,\n TriangleIcon,\n} from \"../../components/Icons\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Caption1 } from \"../../components/Typography\";\n\n/* ------------------------------------------------------------------ */\n/* Floating toolbar surfaces */\n/* ------------------------------------------------------------------ */\n\n/* A floating, rounded toolbar surface (paper + shadow). */\nexport const ToolSurface = styled.div`\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 6px;\n border-radius: 14px;\n background-color: var(--page-paper-main);\n box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);\n border: 1px solid var(--border-primary);\n\n /* A DS button colours its icon by declaring svg { fill: currentColor }, so\n every FILLED glyph follows the button's active and hover states for free.\n Three glyphs here are not filled: RoundedRectangleIcon and TriangleIcon are\n outlines with a stroke of var(--color-theme-600) baked into the path, and\n ProjectIcon draws its ruler as a stroked rect. Nothing about the button\n could ever reach them — an armed rectangle stayed exactly as grey as an\n unarmed one. This extends the same currentColor contract to a declared\n stroke.\n\n Scoped to direct children and to shapes inside a <g>, NOT to every\n descendant: ProjectIcon cuts its ruler with a <mask> whose <line> is\n stroked BLACK on purpose. In a mask only luminance matters, so recolouring\n that line would turn a clean diagonal cut into a half-transparent smear. */\n svg > [stroke],\n svg > g [stroke] {\n stroke: currentColor;\n }\n`;\n\n/* vertical separator used inside the toolbars */\nexport const verticalDivider = `\n .divider {\n width: 1px;\n height: 24px;\n background-color: var(--color-theme-400);\n margin: 0 6px;\n flex-shrink: 0;\n }\n`;\n\nexport const StyledBottomDock = styled.div`\n position: absolute;\n left: 50%;\n bottom: 18px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n max-width: calc(100% - 32px);\n`;\n\n/**\n * The floating second toolbar row — a small pill above the dock that holds the\n * members of one tool family (Circle / Rectangle / Triangle, or Task / Project).\n *\n * It is the same surface as the dock itself, so a family reads as an extension\n * of the button that opened it rather than as a different kind of UI. Only one\n * pill is ever up, because only one tool is ever armed.\n */\nexport const StyledToolPill = styled(ToolSurface)``;\n\n/* Reserve two Caption1 lines (2 × 16px) so showing/hiding the hint never\n shifts the dock; visibility keeps the reserved space when hidden. */\nexport const StyledHint = styled(Caption1)`\n text-align: center;\n padding: 0 16px;\n min-height: 32px;\n\n &.hint-hidden {\n visibility: hidden;\n }\n`;\n\n/* Per-tool hint shown under the dock only while that tool is hovered. */\nexport const TOOL_HINTS = {\n circle:\n \"Click to drop a default circle, or draw one to size. Press O for a circle.\",\n roundedRectangle:\n \"Click to drop a default rectangle, or draw one to size. Press R for a rectangle.\",\n triangle:\n \"Click to drop a default triangle, or draw one to size. Press Y for a triangle.\",\n connector:\n \"Drag from one element to another to connect them. Press C to connect.\",\n projectElements:\n \"Put a task or a project on the board — pick which above, then draw its card.\",\n project:\n \"Draw a box to place a project card, then pick the project it shows.\",\n task: \"Draw a box to place a task card, then pick the task it shows.\",\n link: \"Draw a box to place a link, or paste a URL anywhere. Press L for link.\",\n file: \"Draw a box to place a file, or drop one on the board. Press F for file.\",\n sticky:\n \"Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.\",\n text: \"Click anywhere on the canvas to start typing. Press T for text.\",\n draw: \"Click and drag to draw freehand. Press D for the pen.\",\n shapes:\n \"Pick a shape above, then draw it on the board. Press R for a rectangle.\",\n} as const;\n\nexport type ToolHintKey = keyof typeof TOOL_HINTS;\n\nexport type ShapeTool = \"circle\" | \"roundedRectangle\" | \"triangle\";\n\n/**\n * The armed board tool. Link, File, Project, Task and the three shapes are\n * wired — arming one turns the next canvas click into \"drop the default-size\n * element here\" and a drag into \"draw one this big\"; everything else stays a\n * mock, so the board is otherwise always in select mode.\n */\nexport type BoardTool =\n | \"select\"\n | \"link\"\n | \"file\"\n | \"project\"\n | \"task\"\n | ShapeTool;\n\nexport const SHAPE_TOOLS: readonly ShapeTool[] = [\n \"circle\",\n \"roundedRectangle\",\n \"triangle\",\n];\n\nexport const isShapeTool = (tool: BoardTool): tool is ShapeTool =>\n (SHAPE_TOOLS as readonly string[]).includes(tool);\n\n/**\n * What a dock button arms the instant its pill opens.\n *\n * Opening a family and choosing inside it are two separate decisions, and the\n * second one has a right answer often enough that asking for it every time is\n * just a toll: a shape is usually a rectangle, and the thing people put on a\n * board is usually a task. So the pill opens with that member already armed and\n * the gesture can start immediately — picking another member is a correction,\n * not a required step.\n */\nexport const DEFAULT_SHAPE_TOOL: ShapeTool = \"roundedRectangle\";\nexport const DEFAULT_PROJECT_ELEMENT_TOOL: BoardTool = \"task\";\n\n/* What a plain click drops — mirrors DEFAULT_SHAPE_SIZES in\n new-activecollab-front, and is exactly what the hover preview promises. */\nexport const SHAPE_DEFAULT_SIZES: Record<\n ShapeTool,\n { width: number; height: number }\n> = {\n roundedRectangle: { width: 100, height: 60 },\n circle: { width: 80, height: 80 },\n triangle: { width: 80, height: 80 },\n};\n\n/* Cards are auto-height, so their hover preview uses the app's nominal wire\n height (DEFAULT_LINK_CARD_SIZE / DEFAULT_FILE_CARD_SIZE). */\nexport const CARD_PREVIEW_HEIGHT = 240;\n\n/** The kinds of card the draw gesture can place. */\nexport type DrawableTool = Exclude<BoardTool, \"select\">;\n\nexport interface ToolButtonProps {\n tip: string;\n active?: boolean;\n children: ReactNode;\n onClick?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n}\n\nexport const ToolButton = ({\n tip,\n active,\n children,\n onClick,\n onMouseEnter,\n onMouseLeave,\n}: ToolButtonProps): ReactElement => (\n <Tooltip title={tip}>\n <IconButton\n variant=\"text gray\"\n active={active}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </IconButton>\n </Tooltip>\n);\n\nexport interface BottomDockProps {\n activeTool: BoardTool;\n onToolChange: (tool: BoardTool) => void;\n}\n\n/* Bottom-centre tool dock: the family pill (when one is open), the main\n toolbar, and the shared hint line. The dock is anchored by its BOTTOM edge,\n so a pill appearing or disappearing grows the stack upwards and never moves\n the toolbar itself. */\nexport const BottomDock = ({\n activeTool,\n onToolChange,\n}: BottomDockProps): ReactElement => {\n const [hoverHint, setHoverHint] = useState<string | null>(null);\n\n const hoverProps = (tool: ToolHintKey): Record<string, () => void> => ({\n onMouseEnter: () => setHoverHint(TOOL_HINTS[tool]),\n onMouseLeave: () => setHoverHint(null),\n });\n\n /* An armed tool keeps its hint up after the pointer leaves the dock — the\n gesture happens on the canvas, so that is exactly when the instruction is\n needed. */\n const hint =\n hoverHint ?? (activeTool === \"select\" ? null : TOOL_HINTS[activeTool]);\n\n /* Which pill is up. Both are DERIVED from the armed tool rather than kept as\n their own open/closed state: opening a pill always arms one of its members,\n so \"a member of this family is armed\" and \"this pill is showing\" are the\n same fact. Deriving it is what makes every way of leaving the family close\n the pill for free — another dock tool, Esc on the canvas, or the gesture\n finishing and disarming the tool. Two states could disagree; one cannot. */\n const shapesOpen = isShapeTool(activeTool);\n const projectElementsOpen = activeTool === \"task\" || activeTool === \"project\";\n\n return (\n <StyledBottomDock>\n {/* Shapes pill — hidden until the Shape dock button opens it. Inside a\n pill a click is a plain choice, never a toggle off: the dock button is\n what closes the family, so clicking the armed shape again must not\n make the row that is being used disappear. */}\n {shapesOpen ? (\n <StyledToolPill>\n <ToolButton\n tip=\"Circle\"\n active={activeTool === \"circle\"}\n onClick={() => onToolChange(\"circle\")}\n {...hoverProps(\"circle\")}\n >\n <CircleIcon />\n </ToolButton>\n <ToolButton\n tip=\"Rectangle\"\n active={activeTool === \"roundedRectangle\"}\n onClick={() => onToolChange(\"roundedRectangle\")}\n {...hoverProps(\"roundedRectangle\")}\n >\n <RoundedRectangleIcon />\n </ToolButton>\n <ToolButton\n tip=\"Triangle\"\n active={activeTool === \"triangle\"}\n onClick={() => onToolChange(\"triangle\")}\n {...hoverProps(\"triangle\")}\n >\n <TriangleIcon />\n </ToolButton>\n </StyledToolPill>\n ) : null}\n\n {/* Project Elements pill — the same surface, the same button size and\n spacing, in the same slot above the dock. Task comes first because it\n is what the button arms by default. */}\n {projectElementsOpen ? (\n <StyledToolPill>\n <ToolButton\n tip=\"Task\"\n active={activeTool === \"task\"}\n onClick={() => onToolChange(\"task\")}\n {...hoverProps(\"task\")}\n >\n <TaskIcon />\n </ToolButton>\n <ToolButton\n tip=\"Project\"\n active={activeTool === \"project\"}\n onClick={() => onToolChange(\"project\")}\n {...hoverProps(\"project\")}\n >\n <ProjectIcon />\n </ToolButton>\n </StyledToolPill>\n ) : null}\n\n <ToolSurface>\n {/* The tools that are still mocks arm nothing — but they do DISARM, so\n reaching for one closes whatever pill is up and ends the gesture the\n board was waiting for. A dead button that also leaves the previous\n tool armed would be the confusing half of \"not implemented yet\". */}\n <Tooltip title=\"Sticky Note\">\n <IconButton\n variant=\"text gray\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"sticky\")}\n >\n <NoteIcon />\n </IconButton>\n </Tooltip>\n <ToolButton\n tip=\"Text\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"text\")}\n >\n <TextIcon />\n </ToolButton>\n <ToolButton\n tip=\"Draw\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"draw\")}\n >\n <DrawIcon />\n </ToolButton>\n {/* Opening the family and arming its default member are one click: the\n pill appears with Rectangle already armed, so the next thing the\n pointer does can be the drawing itself. */}\n <ToolButton\n tip=\"Shape\"\n active={shapesOpen}\n onClick={() =>\n onToolChange(shapesOpen ? \"select\" : DEFAULT_SHAPE_TOOL)\n }\n {...hoverProps(\"shapes\")}\n >\n <ShapesIcon />\n </ToolButton>\n <ToolButton\n tip=\"Connect\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"connector\")}\n >\n <ConnectionIcon />\n </ToolButton>\n <ToolButton\n tip=\"Project Elements\"\n active={projectElementsOpen}\n onClick={() =>\n onToolChange(\n projectElementsOpen ? \"select\" : DEFAULT_PROJECT_ELEMENT_TOOL\n )\n }\n {...hoverProps(\"projectElements\")}\n >\n <ProjectStarIcon />\n </ToolButton>\n <ToolButton\n tip=\"Link\"\n active={activeTool === \"link\"}\n onClick={() =>\n onToolChange(activeTool === \"link\" ? \"select\" : \"link\")\n }\n {...hoverProps(\"link\")}\n >\n <InsertLinkIcon />\n </ToolButton>\n <ToolButton\n tip=\"File\"\n active={activeTool === \"file\"}\n onClick={() =>\n onToolChange(activeTool === \"file\" ? \"select\" : \"file\")\n }\n {...hoverProps(\"file\")}\n >\n <AttachmentIcon />\n </ToolButton>\n </ToolSurface>\n\n <StyledHint color=\"tertiary\" className={hint ? undefined : \"hint-hidden\"}>\n {hint ?? \" \"}\n </StyledHint>\n </StyledBottomDock>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAA6BC,QAAQ,QAAQ,OAAO;AAEhE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SACEC,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,QAAQ,EACRC,cAAc,EACdC,WAAW,EACXC,eAAe,EACfC,oBAAoB,EACpBC,UAAU,EACVC,QAAQ,EACRC,QAAQ,EACRC,QAAQ,EACRC,YAAY,QACP,wBAAwB;AAC/B,SAASC,OAAO,QAAQ,0BAA0B;AAClD,SAASC,QAAQ,Q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R,UAAU,EAAAsB,QAAA;IACTpB,GAAG,EAAC,MAAM;IACVC,MAAM,EAAEU,UAAU,KAAK,MAAO;IAC9BR,OAAO,EAAEA,CAAA,KACPS,YAAY,CAACD,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM;EACvD,GACGK,UAAU,CAAC,MAAM,CAAC,gBAEtBtE,KAAA,CAAA4D,aAAA,CAACpD,cAAc,MAAE,CACP,CAAC,eACbR,KAAA,CAAA4D,aAAA,CAACR,UAAU,EAAAsB,QAAA;IACTpB,GAAG,EAAC,MAAM;IACVC,MAAM,EAAEU,UAAU,KAAK,MAAO;IAC9BR,OAAO,EAAEA,CAAA,KACPS,YAAY,CAACD,UAAU,KAAK,MAAM,GAAG,QAAQ,GAAG,MAAM;EACvD,GACGK,UAAU,CAAC,MAAM,CAAC,gBAEtBtE,KAAA,CAAA4D,aAAA,CAACxD,cAAc,MAAE,CACP,CACD,CAAC,eAEdJ,KAAA,CAAA4D,aAAA,CAACjC,UAAU;IAACgD,KAAK,EAAC,UAAU;IAACC,SAAS,EAAEL,IAAI,GAAGM,SAAS,GAAG;EAAc,GACtEN,IAAI,WAAJA,IAAI,GAAI,GACC,CACI,CAAC;AAEvB,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"bottomDock.js","names":["React","useState","styled","IconButton","AttachmentIcon","CircleIcon","ConnectionIcon","DrawIcon","InsertLinkIcon","PersonIcon","ProjectIcon","ProjectStarIcon","RoundedRectangleIcon","ShapesIcon","NoteIcon","TaskIcon","TextIcon","TriangleIcon","Tooltip","Caption1","ToolSurface","div","withConfig","displayName","componentId","verticalDivider","StyledBottomDock","StyledToolPill","StyledHint","TOOL_HINTS","circle","roundedRectangle","triangle","connector","projectElements","project","task","person","link","file","sticky","text","draw","shapes","SHAPE_TOOLS","isShapeTool","tool","includes","DEFAULT_SHAPE_TOOL","DEFAULT_PROJECT_ELEMENT_TOOL","SHAPE_DEFAULT_SIZES","width","height","CARD_PREVIEW_HEIGHT","ToolButton","_ref","tip","active","children","onClick","onMouseEnter","onMouseLeave","createElement","title","variant","BottomDock","_ref2","activeTool","onToolChange","_useState","hoverHint","setHoverHint","hoverProps","hint","shapesOpen","projectElementsOpen","_extends","color","className","undefined"],"sources":["../../../../src/presentation/whiteboard/bottomDock.tsx"],"sourcesContent":["import React, { ReactElement, ReactNode, useState } from \"react\";\n\nimport styled from \"styled-components\";\n\nimport { IconButton } from \"../../components/IconButton\";\nimport {\n AttachmentIcon,\n CircleIcon,\n ConnectionIcon,\n DrawIcon,\n InsertLinkIcon,\n PersonIcon,\n ProjectIcon,\n ProjectStarIcon,\n RoundedRectangleIcon,\n ShapesIcon,\n NoteIcon,\n TaskIcon,\n TextIcon,\n TriangleIcon,\n} from \"../../components/Icons\";\nimport { Tooltip } from \"../../components/Tooltip\";\nimport { Caption1 } from \"../../components/Typography\";\n\n/* ------------------------------------------------------------------ */\n/* Floating toolbar surfaces */\n/* ------------------------------------------------------------------ */\n\n/* A floating, rounded toolbar surface (paper + shadow). */\nexport const ToolSurface = styled.div`\n display: flex;\n align-items: center;\n gap: 2px;\n padding: 6px;\n border-radius: 14px;\n background-color: var(--page-paper-main);\n box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);\n border: 1px solid var(--border-primary);\n\n /* A DS button colours its icon by declaring svg { fill: currentColor }, so\n every FILLED glyph follows the button's active and hover states for free.\n Three glyphs here are not filled: RoundedRectangleIcon and TriangleIcon are\n outlines with a stroke of var(--color-theme-600) baked into the path, and\n ProjectIcon draws its ruler as a stroked rect. Nothing about the button\n could ever reach them — an armed rectangle stayed exactly as grey as an\n unarmed one. This extends the same currentColor contract to a declared\n stroke.\n\n Scoped to direct children and to shapes inside a <g>, NOT to every\n descendant: ProjectIcon cuts its ruler with a <mask> whose <line> is\n stroked BLACK on purpose. In a mask only luminance matters, so recolouring\n that line would turn a clean diagonal cut into a half-transparent smear. */\n svg > [stroke],\n svg > g [stroke] {\n stroke: currentColor;\n }\n`;\n\n/* vertical separator used inside the toolbars */\nexport const verticalDivider = `\n .divider {\n width: 1px;\n height: 24px;\n background-color: var(--color-theme-400);\n margin: 0 6px;\n flex-shrink: 0;\n }\n`;\n\nexport const StyledBottomDock = styled.div`\n position: absolute;\n left: 50%;\n bottom: 18px;\n transform: translateX(-50%);\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: 10px;\n max-width: calc(100% - 32px);\n`;\n\n/**\n * The floating second toolbar row — a small pill above the dock that holds the\n * members of one tool family (Circle / Rectangle / Triangle, or Task / Project).\n *\n * It is the same surface as the dock itself, so a family reads as an extension\n * of the button that opened it rather than as a different kind of UI. Only one\n * pill is ever up, because only one tool is ever armed.\n */\nexport const StyledToolPill = styled(ToolSurface)``;\n\n/* Reserve two Caption1 lines (2 × 16px) so showing/hiding the hint never\n shifts the dock; visibility keeps the reserved space when hidden. */\nexport const StyledHint = styled(Caption1)`\n text-align: center;\n padding: 0 16px;\n min-height: 32px;\n\n &.hint-hidden {\n visibility: hidden;\n }\n`;\n\n/* Per-tool hint shown under the dock only while that tool is hovered. */\nexport const TOOL_HINTS = {\n circle:\n \"Click to drop a default circle, or draw one to size. Press O for a circle.\",\n roundedRectangle:\n \"Click to drop a default rectangle, or draw one to size. Press R for a rectangle.\",\n triangle:\n \"Click to drop a default triangle, or draw one to size. Press Y for a triangle.\",\n connector:\n \"Drag from one element to another to connect them. Press C to connect.\",\n projectElements:\n \"Put a task, a project or a person on the board — pick which above, then draw it.\",\n project:\n \"Draw a box to place a project card, then pick the project it shows.\",\n task: \"Draw a box to place a task card, then pick the task it shows.\",\n person: \"Draw a circle to place a person, then pick who it shows.\",\n link: \"Draw a box to place a link, or paste a URL anywhere. Press L for link.\",\n file: \"Draw a box to place a file, or drop one on the board. Press F for file.\",\n sticky:\n \"Click anywhere on the canvas to drop a sticky note. Press S for a sticky note.\",\n text: \"Click anywhere on the canvas to start typing. Press T for text.\",\n draw: \"Click and drag to draw freehand. Press D for the pen.\",\n shapes:\n \"Pick a shape above, then draw it on the board. Press R for a rectangle.\",\n} as const;\n\nexport type ToolHintKey = keyof typeof TOOL_HINTS;\n\nexport type ShapeTool = \"circle\" | \"roundedRectangle\" | \"triangle\";\n\n/**\n * The armed board tool. Link, File, Project, Task and the three shapes are\n * wired — arming one turns the next canvas click into \"drop the default-size\n * element here\" and a drag into \"draw one this big\"; everything else stays a\n * mock, so the board is otherwise always in select mode.\n */\nexport type BoardTool =\n | \"select\"\n | \"link\"\n | \"file\"\n | \"project\"\n | \"task\"\n | \"person\"\n | ShapeTool;\n\nexport const SHAPE_TOOLS: readonly ShapeTool[] = [\n \"circle\",\n \"roundedRectangle\",\n \"triangle\",\n];\n\nexport const isShapeTool = (tool: BoardTool): tool is ShapeTool =>\n (SHAPE_TOOLS as readonly string[]).includes(tool);\n\n/**\n * What a dock button arms the instant its pill opens.\n *\n * Opening a family and choosing inside it are two separate decisions, and the\n * second one has a right answer often enough that asking for it every time is\n * just a toll: a shape is usually a rectangle, and the thing people put on a\n * board is usually a task. So the pill opens with that member already armed and\n * the gesture can start immediately — picking another member is a correction,\n * not a required step.\n */\nexport const DEFAULT_SHAPE_TOOL: ShapeTool = \"roundedRectangle\";\nexport const DEFAULT_PROJECT_ELEMENT_TOOL: BoardTool = \"task\";\n\n/* What a plain click drops — mirrors DEFAULT_SHAPE_SIZES in\n new-activecollab-front, and is exactly what the hover preview promises. */\nexport const SHAPE_DEFAULT_SIZES: Record<\n ShapeTool,\n { width: number; height: number }\n> = {\n roundedRectangle: { width: 100, height: 60 },\n circle: { width: 80, height: 80 },\n triangle: { width: 80, height: 80 },\n};\n\n/* Cards are auto-height, so their hover preview uses the app's nominal wire\n height (DEFAULT_LINK_CARD_SIZE / DEFAULT_FILE_CARD_SIZE). */\nexport const CARD_PREVIEW_HEIGHT = 240;\n\n/** The kinds of card the draw gesture can place. */\nexport type DrawableTool = Exclude<BoardTool, \"select\">;\n\nexport interface ToolButtonProps {\n tip: string;\n active?: boolean;\n children: ReactNode;\n onClick?: () => void;\n onMouseEnter?: () => void;\n onMouseLeave?: () => void;\n}\n\nexport const ToolButton = ({\n tip,\n active,\n children,\n onClick,\n onMouseEnter,\n onMouseLeave,\n}: ToolButtonProps): ReactElement => (\n <Tooltip title={tip}>\n <IconButton\n variant=\"text gray\"\n active={active}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </IconButton>\n </Tooltip>\n);\n\nexport interface BottomDockProps {\n activeTool: BoardTool;\n onToolChange: (tool: BoardTool) => void;\n}\n\n/* Bottom-centre tool dock: the family pill (when one is open), the main\n toolbar, and the shared hint line. The dock is anchored by its BOTTOM edge,\n so a pill appearing or disappearing grows the stack upwards and never moves\n the toolbar itself. */\nexport const BottomDock = ({\n activeTool,\n onToolChange,\n}: BottomDockProps): ReactElement => {\n const [hoverHint, setHoverHint] = useState<string | null>(null);\n\n const hoverProps = (tool: ToolHintKey): Record<string, () => void> => ({\n onMouseEnter: () => setHoverHint(TOOL_HINTS[tool]),\n onMouseLeave: () => setHoverHint(null),\n });\n\n /* An armed tool keeps its hint up after the pointer leaves the dock — the\n gesture happens on the canvas, so that is exactly when the instruction is\n needed. */\n const hint =\n hoverHint ?? (activeTool === \"select\" ? null : TOOL_HINTS[activeTool]);\n\n /* Which pill is up. Both are DERIVED from the armed tool rather than kept as\n their own open/closed state: opening a pill always arms one of its members,\n so \"a member of this family is armed\" and \"this pill is showing\" are the\n same fact. Deriving it is what makes every way of leaving the family close\n the pill for free — another dock tool, Esc on the canvas, or the gesture\n finishing and disarming the tool. Two states could disagree; one cannot. */\n const shapesOpen = isShapeTool(activeTool);\n const projectElementsOpen =\n activeTool === \"task\" ||\n activeTool === \"project\" ||\n activeTool === \"person\";\n\n return (\n <StyledBottomDock>\n {/* Shapes pill — hidden until the Shape dock button opens it. Inside a\n pill a click is a plain choice, never a toggle off: the dock button is\n what closes the family, so clicking the armed shape again must not\n make the row that is being used disappear. */}\n {shapesOpen ? (\n <StyledToolPill>\n <ToolButton\n tip=\"Circle\"\n active={activeTool === \"circle\"}\n onClick={() => onToolChange(\"circle\")}\n {...hoverProps(\"circle\")}\n >\n <CircleIcon />\n </ToolButton>\n <ToolButton\n tip=\"Rectangle\"\n active={activeTool === \"roundedRectangle\"}\n onClick={() => onToolChange(\"roundedRectangle\")}\n {...hoverProps(\"roundedRectangle\")}\n >\n <RoundedRectangleIcon />\n </ToolButton>\n <ToolButton\n tip=\"Triangle\"\n active={activeTool === \"triangle\"}\n onClick={() => onToolChange(\"triangle\")}\n {...hoverProps(\"triangle\")}\n >\n <TriangleIcon />\n </ToolButton>\n </StyledToolPill>\n ) : null}\n\n {/* Project Elements pill — the same surface, the same button size and\n spacing, in the same slot above the dock. Task comes first because it\n is what the button arms by default; User is third, beside Task and\n Project, and arms the same draw gesture with a person placeholder. */}\n {projectElementsOpen ? (\n <StyledToolPill>\n <ToolButton\n tip=\"Task\"\n active={activeTool === \"task\"}\n onClick={() => onToolChange(\"task\")}\n {...hoverProps(\"task\")}\n >\n <TaskIcon />\n </ToolButton>\n <ToolButton\n tip=\"Project\"\n active={activeTool === \"project\"}\n onClick={() => onToolChange(\"project\")}\n {...hoverProps(\"project\")}\n >\n <ProjectIcon />\n </ToolButton>\n <ToolButton\n tip=\"User\"\n active={activeTool === \"person\"}\n onClick={() => onToolChange(\"person\")}\n {...hoverProps(\"person\")}\n >\n <PersonIcon />\n </ToolButton>\n </StyledToolPill>\n ) : null}\n\n <ToolSurface>\n {/* The tools that are still mocks arm nothing — but they do DISARM, so\n reaching for one closes whatever pill is up and ends the gesture the\n board was waiting for. A dead button that also leaves the previous\n tool armed would be the confusing half of \"not implemented yet\". */}\n <Tooltip title=\"Sticky Note\">\n <IconButton\n variant=\"text gray\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"sticky\")}\n >\n <NoteIcon />\n </IconButton>\n </Tooltip>\n <ToolButton\n tip=\"Text\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"text\")}\n >\n <TextIcon />\n </ToolButton>\n <ToolButton\n tip=\"Draw\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"draw\")}\n >\n <DrawIcon />\n </ToolButton>\n {/* Opening the family and arming its default member are one click: the\n pill appears with Rectangle already armed, so the next thing the\n pointer does can be the drawing itself. */}\n <ToolButton\n tip=\"Shape\"\n active={shapesOpen}\n onClick={() =>\n onToolChange(shapesOpen ? \"select\" : DEFAULT_SHAPE_TOOL)\n }\n {...hoverProps(\"shapes\")}\n >\n <ShapesIcon />\n </ToolButton>\n <ToolButton\n tip=\"Connect\"\n onClick={() => onToolChange(\"select\")}\n {...hoverProps(\"connector\")}\n >\n <ConnectionIcon />\n </ToolButton>\n <ToolButton\n tip=\"Project Elements\"\n active={projectElementsOpen}\n onClick={() =>\n onToolChange(\n projectElementsOpen ? \"select\" : DEFAULT_PROJECT_ELEMENT_TOOL\n )\n }\n {...hoverProps(\"projectElements\")}\n >\n <ProjectStarIcon />\n </ToolButton>\n <ToolButton\n tip=\"Link\"\n active={activeTool === \"link\"}\n onClick={() =>\n onToolChange(activeTool === \"link\" ? \"select\" : \"link\")\n }\n {...hoverProps(\"link\")}\n >\n <InsertLinkIcon />\n </ToolButton>\n <ToolButton\n tip=\"File\"\n active={activeTool === \"file\"}\n onClick={() =>\n onToolChange(activeTool === \"file\" ? \"select\" : \"file\")\n }\n {...hoverProps(\"file\")}\n >\n <AttachmentIcon />\n </ToolButton>\n </ToolSurface>\n\n <StyledHint color=\"tertiary\" className={hint ? undefined : \"hint-hidden\"}>\n {hint ?? \" \"}\n </StyledHint>\n </StyledBottomDock>\n );\n};\n"],"mappings":";AAAA,OAAOA,KAAK,IAA6BC,QAAQ,QAAQ,OAAO;AAEhE,OAAOC,MAAM,MAAM,mBAAmB;AAEtC,SAASC,UAAU,QAAQ,6BAA6B;AACxD,SACEC,cAAc,EACdC,UAAU,EACVC,cAAc,EACdC,QAAQ,EACRC,cAAc,EACdC,UAAU,EACVC,WAAW,EACXC,eAAe,EACfC,oBAAoB,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
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"canvasElements.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/canvasElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,YAAY,EAKb,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,SAAS,EAMV,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,gBAAgB,EAChB,QAAQ,EAGR,iBAAiB,EAEjB,eAAe,EAShB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"canvasElements.d.ts","sourceRoot":"","sources":["../../../../src/presentation/whiteboard/canvasElements.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EACZ,YAAY,EAKb,MAAM,OAAO,CAAC;AAEf,OAAO,EACL,SAAS,EAMV,MAAM,cAAc,CAAC;AACtB,OAAO,EAEL,gBAAgB,EAChB,QAAQ,EAGR,iBAAiB,EAEjB,eAAe,EAShB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAGL,cAAc,EAIf,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,cAAc,EAMf,MAAM,eAAe,CAAC;AAEvB,OAAO,EAIL,iBAAiB,EAWlB,MAAM,mBAAmB,CAAC;AAE3B;;;;;;;;GAQG;AACH,eAAO,MAAM,gBAAgB,+CAA+C,CAAC;AAE7E;;;;;;;;;GASG;AACH,eAAO,MAAM,qBAAqB,wBAAwB,CAAC;AAE3D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,QAAQ,CAAC;IACnB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,SAAS,CAAC;IACtB,UAAU,EAAE,MAAM,IAAI,CAAC;IAKvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,kBAAkB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC,CAAC;IAKxE,SAAS,EAAE,MAAM,CAAC,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M,CAAA;KAAE,CAAC,CAAC;IACzD,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAGlC,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CACzE;AAUD,eAAO,MAAM,cAAc,GAAI,sTAyB5B,mBAAmB,KAAG,YAitCxB,CAAC"}
|
|
@@ -2,9 +2,11 @@ import _extends from "@babel/runtime/helpers/esm/extends";
|
|
|
2
2
|
import React, { useCallback, useEffect, useRef, useState } from "react";
|
|
3
3
|
import { CARD_PREVIEW_HEIGHT, SHAPE_DEFAULT_SIZES, isShapeTool } from "./bottomDock";
|
|
4
4
|
import { CANVAS_ELEMENTS, PostitFormattingToolbar, ResizeHandles, ShapeFormattingToolbar, StyledCanvasElement, StyledCanvasLayer, StyledSticky, defaultShapeState, gridLevel, renderShapeBody, snapValue, stickyGradient } from "./elements";
|
|
5
|
+
import { PersonCardToolbar, personDetailsProps } from "./entityCardActions";
|
|
5
6
|
import { FILE_DEFAULT_WIDTH, FileElement, binaryFrom, describeFile, revokeThumbnail } from "./fileElement";
|
|
6
7
|
import { CARD_DRAW_THRESHOLD, LINK_DEFAULT_WIDTH, LinkElement, StyledLinkDraft, StyledShapePreview, clampCardWidth, isValidLinkUrl, shapePreviewGlyph } from "./linkElement";
|
|
7
|
-
import {
|
|
8
|
+
import { UserDetailsDialog } from "../shared";
|
|
9
|
+
import { PERSON_DEFAULT_SIZE, PLACEHOLDER_MIN_HEIGHT, PLACEHOLDER_MIN_WIDTH, ProjectElementNode, ProjectElementPicker, RESOLVE_MS, StyledPersonDraft, StyledProjectDraft, StyledProjectElementBox, clampPersonSize, isProjectTool, projectCardWidth } from "./projectElements";
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* A card is full of its own controls — the URL field, the display toggle, the
|
|
@@ -37,7 +39,7 @@ export const DRAG_THROUGH_SELECTOR = "[data-drag-through]";
|
|
|
37
39
|
Link elements are created here too — by drawing a box with the Link tool
|
|
38
40
|
armed, or by pasting a URL onto the canvas. */
|
|
39
41
|
export const CanvasElements = _ref => {
|
|
40
|
-
var _projectElements$find;
|
|
42
|
+
var _projectElements$find, _projectElements$find2, _projectElements$find3;
|
|
41
43
|
let gridSize = _ref.gridSize,
|
|
42
44
|
snapToGrid = _ref.snapToGrid,
|
|
43
45
|
activeTool = _ref.activeTool,
|
|
@@ -435,7 +437,8 @@ export const CanvasElements = _ref => {
|
|
|
435
437
|
height: size.height,
|
|
436
438
|
status: "placeholder",
|
|
437
439
|
project: null,
|
|
438
|
-
task: null
|
|
440
|
+
task: null,
|
|
441
|
+
person: null
|
|
439
442
|
}]);
|
|
440
443
|
setSelectedId(id);
|
|
441
444
|
setPickerFor(id);
|
|
@@ -444,21 +447,21 @@ export const CanvasElements = _ref => {
|
|
|
444
447
|
/* The picker answered. The card keeps the placeholder's top-left and flashes
|
|
445
448
|
a skeleton while the "backend" fills the details in — the same two-phase
|
|
446
449
|
honesty the file card's upload / preparing pair has. */
|
|
447
|
-
const resolveProjectElement = useCallback((id,
|
|
450
|
+
const resolveProjectElement = useCallback((id, fill) => {
|
|
448
451
|
setPickerFor(null);
|
|
449
452
|
setProjectElements(current => current.map(entry => entry.id === id ? _extends({}, entry, {
|
|
450
|
-
status: "resolving"
|
|
451
|
-
|
|
452
|
-
task
|
|
453
|
-
}) : entry));
|
|
453
|
+
status: "resolving"
|
|
454
|
+
}, fill) : entry));
|
|
454
455
|
const timer = window.setTimeout(() => {
|
|
455
456
|
setProjectElements(current => current.map(entry => entry.id === id ? _extends({}, entry, {
|
|
456
457
|
status: "resolved",
|
|
457
458
|
/* The card takes its natural width HERE rather than the
|
|
458
459
|
renderer deriving it, so from this moment on there is a
|
|
459
460
|
single stored width for the canvas, the drag and the
|
|
460
|
-
Inspector's Width field to agree on.
|
|
461
|
-
|
|
461
|
+
Inspector's Width field to agree on. A person keeps the
|
|
462
|
+
square that was drawn: the avatar fills whatever circle
|
|
463
|
+
the gesture made. */
|
|
464
|
+
width: entry.kind === "person" ? entry.width : projectCardWidth(entry.kind)
|
|
462
465
|
}) : entry));
|
|
463
466
|
}, RESOLVE_MS);
|
|
464
467
|
resolveTimersRef.current.push(timer);
|
|
@@ -474,6 +477,20 @@ export const CanvasElements = _ref => {
|
|
|
474
477
|
}, [setProjectElements, setSelectedId]);
|
|
475
478
|
const pickerElement = (_projectElements$find = projectElements.find(entry => entry.id === pickerFor)) != null ? _projectElements$find : null;
|
|
476
479
|
|
|
480
|
+
/* A selected element's Delete, the same removal the link and file cards' own
|
|
481
|
+
toolbars do: the board element goes, the entity is never touched. */
|
|
482
|
+
const deleteProjectElement = useCallback(id => {
|
|
483
|
+
setProjectElements(current => current.filter(entry => entry.id !== id));
|
|
484
|
+
setSelectedId(selected => selected === id ? null : selected);
|
|
485
|
+
}, [setProjectElements, setSelectedId]);
|
|
486
|
+
|
|
487
|
+
/* Which person's Details dialog is open — keyed off the element id so the
|
|
488
|
+
element stays the single source of the person it shows. */
|
|
489
|
+
const _useState6 = useState(null),
|
|
490
|
+
detailsId = _useState6[0],
|
|
491
|
+
setDetailsId = _useState6[1];
|
|
492
|
+
const detailsPerson = (_projectElements$find2 = (_projectElements$find3 = projectElements.find(entry => entry.id === detailsId)) == null ? void 0 : _projectElements$find3.person) != null ? _projectElements$find2 : null;
|
|
493
|
+
|
|
477
494
|
/* ---- draw-to-place ------------------------------------------------ */
|
|
478
495
|
|
|
479
496
|
const drawRef = useRef(null);
|
|
@@ -528,6 +545,14 @@ export const CanvasElements = _ref => {
|
|
|
528
545
|
width,
|
|
529
546
|
height
|
|
530
547
|
} : SHAPE_DEFAULT_SIZES[origin.tool]);
|
|
548
|
+
} else if (origin.tool === "person") {
|
|
549
|
+
/* A person is a square: the drawn WIDTH is its side, clamped to the
|
|
550
|
+
person bounds, and a plain click drops the default size. */
|
|
551
|
+
const side = drawn ? clampPersonSize(width) : PERSON_DEFAULT_SIZE;
|
|
552
|
+
addProjectElement(at, {
|
|
553
|
+
width: side,
|
|
554
|
+
height: side
|
|
555
|
+
}, "person");
|
|
531
556
|
} else if (isProjectTool(origin.tool)) {
|
|
532
557
|
/* Both dimensions matter here (a project card is not auto-height the
|
|
533
558
|
way a link is), and a card smaller than the minimum could not hold
|
|
@@ -570,9 +595,9 @@ export const CanvasElements = _ref => {
|
|
|
570
595
|
|
|
571
596
|
/* Where the armed tool's hover preview sits — cleared while a draw gesture
|
|
572
597
|
runs (the rubber band takes over) and whenever the tool disarms. */
|
|
573
|
-
const
|
|
574
|
-
hoverPoint =
|
|
575
|
-
setHoverPoint =
|
|
598
|
+
const _useState7 = useState(null),
|
|
599
|
+
hoverPoint = _useState7[0],
|
|
600
|
+
setHoverPoint = _useState7[1];
|
|
576
601
|
useEffect(() => {
|
|
577
602
|
if (activeTool === "select") {
|
|
578
603
|
setHoverPoint(null);
|
|
@@ -795,23 +820,25 @@ export const CanvasElements = _ref => {
|
|
|
795
820
|
onDelete: () => deleteFile(entry.id)
|
|
796
821
|
}));
|
|
797
822
|
}), projectElements.map(entry => {
|
|
798
|
-
var _positions$entry$id$x2, _positions$entry$id3, _positions$entry$id$y2, _positions$entry$id4;
|
|
823
|
+
var _positions$entry$id$x2, _positions$entry$id3, _positions$entry$id$y2, _positions$entry$id4, _locks$entry$id;
|
|
799
824
|
const selected = entry.id === selectedId;
|
|
800
825
|
return /*#__PURE__*/React.createElement(StyledProjectElementBox, {
|
|
801
826
|
key: entry.id,
|
|
802
|
-
className: [selected ? "selected" : "", entry.limited ? "limited" : "",
|
|
827
|
+
className: [selected ? "selected" : "", entry.limited ? "limited" : "", entry.kind === "person" ? "person" : "",
|
|
803
828
|
/* A resolved card is a StackedCard, and the shell draws its own
|
|
804
829
|
ring — so the box stands down, exactly as it does for the link
|
|
805
|
-
and file cards. The placeholder, the resolving flash
|
|
806
|
-
limited card are not StackedCards and keep
|
|
807
|
-
|
|
830
|
+
and file cards. The placeholder, the resolving flash, the
|
|
831
|
+
limited card and the person chip are not StackedCards and keep
|
|
832
|
+
the box's ring. */
|
|
833
|
+
entry.status === "resolved" && !entry.limited && entry.kind !== "person" ? "is-card" : ""].filter(Boolean).join(" "),
|
|
808
834
|
style: {
|
|
809
835
|
left: (_positions$entry$id$x2 = (_positions$entry$id3 = positions[entry.id]) == null ? void 0 : _positions$entry$id3.x) != null ? _positions$entry$id$x2 : 0,
|
|
810
836
|
top: (_positions$entry$id$y2 = (_positions$entry$id4 = positions[entry.id]) == null ? void 0 : _positions$entry$id4.y) != null ? _positions$entry$id$y2 : 0,
|
|
811
837
|
width: entry.width,
|
|
812
838
|
/* Only the placeholder box is measured in both directions; the
|
|
813
|
-
resolved card is auto-height like every other card here.
|
|
814
|
-
|
|
839
|
+
resolved card is auto-height like every other card here. A
|
|
840
|
+
person is a fixed square in every state. */
|
|
841
|
+
height: entry.status === "resolved" && entry.kind !== "person" ? undefined : entry.height
|
|
815
842
|
},
|
|
816
843
|
onMouseDown: event => entry.limited ? handleLimitedMouseDown(event, entry.id) : handleElementMouseDown(event, entry.id),
|
|
817
844
|
onClickCapture: handleElementClickCapture,
|
|
@@ -819,7 +846,12 @@ export const CanvasElements = _ref => {
|
|
|
819
846
|
}, /*#__PURE__*/React.createElement(ProjectElementNode, {
|
|
820
847
|
element: entry,
|
|
821
848
|
selected: selected
|
|
822
|
-
})
|
|
849
|
+
}), selected && entry.kind === "person" && entry.status === "resolved" && !entry.limited && entry.person ? /*#__PURE__*/React.createElement(PersonCardToolbar, {
|
|
850
|
+
onDetails: () => setDetailsId(entry.id),
|
|
851
|
+
locked: (_locks$entry$id = locks[entry.id]) != null ? _locks$entry$id : false,
|
|
852
|
+
onToggleLock: () => toggleLock(entry.id),
|
|
853
|
+
onDelete: () => deleteProjectElement(entry.id)
|
|
854
|
+
}) : null);
|
|
823
855
|
}), draft && !isShapeTool(draft.tool) && !isProjectTool(draft.tool) ? /*#__PURE__*/React.createElement(StyledLinkDraft, {
|
|
824
856
|
style: {
|
|
825
857
|
left: draft.x,
|
|
@@ -829,7 +861,17 @@ export const CanvasElements = _ref => {
|
|
|
829
861
|
}
|
|
830
862
|
}, /*#__PURE__*/React.createElement("span", {
|
|
831
863
|
className: "draft-width"
|
|
832
|
-
}, "W", " ", draft.width >= CARD_DRAW_THRESHOLD ? clampCardWidth(draft.width) : draft.tool === "file" ? FILE_DEFAULT_WIDTH : LINK_DEFAULT_WIDTH, " ", "\xB7 height follows content")) : null, draft &&
|
|
864
|
+
}, "W", " ", draft.width >= CARD_DRAW_THRESHOLD ? clampCardWidth(draft.width) : draft.tool === "file" ? FILE_DEFAULT_WIDTH : LINK_DEFAULT_WIDTH, " ", "\xB7 height follows content")) : null, draft && draft.tool === "person" ? (() => {
|
|
865
|
+
const side = draft.width >= CARD_DRAW_THRESHOLD ? clampPersonSize(draft.width) : PERSON_DEFAULT_SIZE;
|
|
866
|
+
return /*#__PURE__*/React.createElement(StyledPersonDraft, {
|
|
867
|
+
style: {
|
|
868
|
+
left: draft.x,
|
|
869
|
+
top: draft.y,
|
|
870
|
+
width: side,
|
|
871
|
+
height: side
|
|
872
|
+
}
|
|
873
|
+
});
|
|
874
|
+
})() : null, draft && isProjectTool(draft.tool) && draft.tool !== "person" ? /*#__PURE__*/React.createElement(StyledProjectDraft, {
|
|
833
875
|
style: {
|
|
834
876
|
left: draft.x,
|
|
835
877
|
top: draft.y,
|
|
@@ -858,6 +900,16 @@ export const CanvasElements = _ref => {
|
|
|
858
900
|
}, size)
|
|
859
901
|
}, shapePreviewGlyph(activeTool, size.width, size.height));
|
|
860
902
|
}
|
|
903
|
+
if (activeTool === "person") {
|
|
904
|
+
return /*#__PURE__*/React.createElement(StyledPersonDraft, {
|
|
905
|
+
style: {
|
|
906
|
+
left: at.x,
|
|
907
|
+
top: at.y,
|
|
908
|
+
width: PERSON_DEFAULT_SIZE,
|
|
909
|
+
height: PERSON_DEFAULT_SIZE
|
|
910
|
+
}
|
|
911
|
+
});
|
|
912
|
+
}
|
|
861
913
|
if (isProjectTool(activeTool)) {
|
|
862
914
|
return /*#__PURE__*/React.createElement(StyledProjectDraft, {
|
|
863
915
|
style: {
|
|
@@ -887,10 +939,27 @@ export const CanvasElements = _ref => {
|
|
|
887
939
|
rx: 8,
|
|
888
940
|
ry: 8
|
|
889
941
|
})));
|
|
890
|
-
})() : null,
|
|
942
|
+
})() : null, detailsPerson ? /*#__PURE__*/React.createElement(UserDetailsDialog, _extends({
|
|
943
|
+
open: true
|
|
944
|
+
}, personDetailsProps(detailsPerson), {
|
|
945
|
+
onClose: () => setDetailsId(null)
|
|
946
|
+
})) : null, pickerElement ? /*#__PURE__*/React.createElement(ProjectElementPicker, {
|
|
891
947
|
kind: pickerElement.kind,
|
|
892
|
-
onSelectProject: project => resolveProjectElement(pickerElement.id,
|
|
893
|
-
|
|
948
|
+
onSelectProject: project => resolveProjectElement(pickerElement.id, {
|
|
949
|
+
project,
|
|
950
|
+
task: null,
|
|
951
|
+
person: null
|
|
952
|
+
}),
|
|
953
|
+
onSelectTask: (project, task) => resolveProjectElement(pickerElement.id, {
|
|
954
|
+
project,
|
|
955
|
+
task,
|
|
956
|
+
person: null
|
|
957
|
+
}),
|
|
958
|
+
onSelectPerson: person => resolveProjectElement(pickerElement.id, {
|
|
959
|
+
project: null,
|
|
960
|
+
task: null,
|
|
961
|
+
person
|
|
962
|
+
}),
|
|
894
963
|
onCancel: () => cancelProjectElement(pickerElement.id)
|
|
895
964
|
}) : null);
|
|
896
965
|
};
|