[Update] Plugins: Send all logics to the plugins when it's registered.
This commit is contained in:
@@ -4,13 +4,11 @@ import { SubtitlesController } from "./subtitle_system_container/_controllers/Su
|
||||
|
||||
export const init = (plugin_context) => {
|
||||
initStore(plugin_context.createAtomWithHook);
|
||||
const { logic_configs } = plugin_context;
|
||||
|
||||
loadPluginCSS("./main.css");
|
||||
const { logics } = plugin_context;
|
||||
|
||||
const EntryComponents = () => {
|
||||
return (
|
||||
<StoreContext.Provider value={logic_configs}>
|
||||
<StoreContext.Provider value={logics}>
|
||||
<SubtitlesController />
|
||||
|
||||
<SubtitleSystemContainer />
|
||||
@@ -21,17 +19,4 @@ export const init = (plugin_context) => {
|
||||
plugin_context.registerComponent(EntryComponents);
|
||||
};
|
||||
|
||||
export default init;
|
||||
|
||||
|
||||
// CSS を動的に読み込む関数
|
||||
const loadPluginCSS = (cssUrl) => {
|
||||
if (typeof document === "undefined") return;
|
||||
// すでに読み込まれているかチェック
|
||||
if (document.getElementById("plugin-main-css")) return;
|
||||
const link = document.createElement("link");
|
||||
link.rel = "stylesheet";
|
||||
link.href = cssUrl;
|
||||
link.id = "plugin-main-css";
|
||||
document.head.appendChild(link);
|
||||
};
|
||||
export default init;
|
||||
Reference in New Issue
Block a user