feat: Initial clean release of CHM
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
一些检查失败了
automerge / automerge (push) Has been cancelled
react-native-android-build-apk / AssembleRelease (push) Has been cancelled
Build macOS M1 / Main (push) Has been cancelled
Joplin Continuous Integration / Main (macos-15-intel) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / Main (ubuntu-22.04-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-11-vs2026-arm) (push) Has been cancelled
Joplin Continuous Integration / Main (windows-2025) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04) (push) Has been cancelled
Joplin Continuous Integration / ServerDockerImage (ubuntu-22.04-arm) (push) Has been cancelled
Joplin UI tests / Main (ubuntu-22.04) (push) Has been cancelled
Joplin UI tests / Main (windows-2025) (push) Has been cancelled
Joplin UI tests / Mobile (push) Has been cancelled
Close stale issues / ProcessStaleIssues (push) Has been cancelled
这个提交包含在:
@@ -0,0 +1,66 @@
|
||||
import * as React from 'react';
|
||||
import { ReactElement } from 'react';
|
||||
import { PluginHtmlContents, PluginStates, ViewInfo } from '@joplin/lib/services/plugins/reducer';
|
||||
import PluginDialogWebView from './PluginDialogWebView';
|
||||
import { Modal, Portal } from 'react-native-paper';
|
||||
import PluginService from '@joplin/lib/services/plugins/PluginService';
|
||||
import WebviewController, { ContainerType } from '@joplin/lib/services/plugins/WebviewController';
|
||||
import useViewInfos from './hooks/useViewInfos';
|
||||
import PluginPanelViewer from './PluginPanelViewer';
|
||||
import FocusControl from '../../accessibility/FocusControl/FocusControl';
|
||||
import { ModalState } from '../../accessibility/FocusControl/types';
|
||||
|
||||
interface Props {
|
||||
themeId: number;
|
||||
|
||||
pluginHtmlContents: PluginHtmlContents;
|
||||
pluginStates: PluginStates;
|
||||
}
|
||||
|
||||
const dismissDialog = (viewInfo: ViewInfo) => {
|
||||
if (!viewInfo.view.opened) return;
|
||||
|
||||
const plugin = PluginService.instance().pluginById(viewInfo.plugin.id);
|
||||
const viewController = plugin.viewController(viewInfo.view.id) as WebviewController;
|
||||
viewController.closeWithResponse(null);
|
||||
};
|
||||
|
||||
const PluginDialogManager: React.FC<Props> = props => {
|
||||
const viewInfos = useViewInfos(props.pluginStates);
|
||||
|
||||
const dialogs: ReactElement[] = [];
|
||||
for (const viewInfo of viewInfos) {
|
||||
if (viewInfo.view.containerType !== ContainerType.Dialog || !viewInfo.view.opened) {
|
||||
continue;
|
||||
}
|
||||
|
||||
dialogs.push(
|
||||
<Portal
|
||||
key={`${viewInfo.plugin.id}-${viewInfo.view.id}`}
|
||||
>
|
||||
<Modal
|
||||
visible={true}
|
||||
onDismiss={() => dismissDialog(viewInfo)}
|
||||
>
|
||||
<FocusControl.ModalWrapper state={ModalState.Open}>
|
||||
<PluginDialogWebView
|
||||
viewInfo={viewInfo}
|
||||
themeId={props.themeId}
|
||||
pluginStates={props.pluginStates}
|
||||
pluginHtmlContents={props.pluginHtmlContents}
|
||||
/>
|
||||
</FocusControl.ModalWrapper>
|
||||
</Modal>
|
||||
</Portal>,
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<PluginPanelViewer inert={dialogs.length > 0}/>
|
||||
{dialogs}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default PluginDialogManager;
|
||||
在新工单中引用
屏蔽一个用户