use IIFE for entry points.

This commit is contained in:
2025-07-03 18:24:31 +09:00
parent 5926c08da5
commit 83f29b8e63
12 changed files with 64 additions and 51 deletions

View File

@@ -9,7 +9,8 @@ import { saveAs } from 'file-saver';
import moize from 'moize';
import PizZip from 'pizzip';
import invariant from 'tiny-invariant';
import { DOCX_CONTENT_TYPE, LANGUAGE, PLUGIN_ID } from '../common/global';
import { DOCX_CONTENT_TYPE } from '../common/constants';
import { LANGUAGE } from '../common/kintoneUtils';
import { KintoneFormFieldProperties } from '../common/types';
import KintonePluginAlert from '../common/ui/KintonePluginAlert';
import KintonePluginButton from '../common/ui/KintonePluginButton';
@@ -19,6 +20,7 @@ interface TemplateData {
}
interface MenuPanelProps {
pluginId: string;
event: kintone.events.AppRecordDetailShowEvent | kintone.events.MobileAppRecordDetailShowEvent;
}
@@ -181,10 +183,10 @@ const record2data = (properties: KintoneFormFieldProperties, record: Partial<Kin
};
const MenuPanel: React.FC<MenuPanelProps> = (props) => {
const { event } = props;
const { pluginId, event } = props;
const appId = event.appId;
const properties = React.use(cachedFormFieldsProperties(appId));
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
const config = kintone.plugin.app.getConfig(pluginId);
const template: string = config.template ?? '';
if (template === '') {
return (
@@ -218,6 +220,7 @@ const MenuPanel: React.FC<MenuPanelProps> = (props) => {
</KintonePluginAlert>
);
}
const handleOnClickOutputButton = (e: React.MouseEvent<HTMLButtonElement>) => {
e.preventDefault();
const client = new KintoneRestAPIClient();