diff --git a/app/web/src/nova/ed/panel/main/main.tsx b/app/web/src/nova/ed/panel/main/main.tsx index 72a1c249..84ec2555 100644 --- a/app/web/src/nova/ed/panel/main/main.tsx +++ b/app/web/src/nova/ed/panel/main/main.tsx @@ -64,6 +64,12 @@ export const EdMain = () => { p.render(); p.page.render(); }, + text(item, className) { + return
+ } }} /> )} diff --git a/app/web/src/nova/view/logic/global.ts b/app/web/src/nova/view/logic/global.ts index 02c54847..63a3785a 100644 --- a/app/web/src/nova/view/logic/global.ts +++ b/app/web/src/nova/view/logic/global.ts @@ -1,7 +1,7 @@ -import { ReactElement } from "react"; +import { ReactElement, ReactNode } from "react"; import { IContent } from "../../../utils/types/general"; -import { EdMeta, PG } from "../../ed/logic/ed-global"; -import { IRoot } from "../../../utils/types/root"; +import { IText } from "../../../utils/types/text"; +import { EdMeta } from "../../ed/logic/ed-global"; export const ViewGlobal = { mode: "" as "desktop" | "mobile", @@ -12,7 +12,7 @@ export const ViewGlobal = { entry: [] as string[], body_cache: null as null | ReactElement, component: { - load: async (id_comp: string) => {}, + load: async (id_comp: string) => { }, }, script: { api_url: "", @@ -23,7 +23,11 @@ export const ViewGlobal = { hidden: undefined as undefined | ((item: IContent) => boolean), active: undefined as | undefined - | { get: (item: IContent) => boolean; set: (id: string) => void }, + | { + get: (item: IContent) => boolean; + set: (id: string) => void; + text?: (item: IText, className: string) => ReactNode + }, hover: undefined as | undefined | { get: (item: IContent) => boolean; set: (id: string) => void }, diff --git a/app/web/src/nova/view/render/meta/children.tsx b/app/web/src/nova/view/render/meta/children.tsx index c2cadf61..894cd4d2 100644 --- a/app/web/src/nova/view/render/meta/children.tsx +++ b/app/web/src/nova/view/render/meta/children.tsx @@ -1,4 +1,4 @@ -import { FC, ReactNode } from "react"; +import { FC, Fragment, ReactNode } from "react"; import { useGlobal } from "web-utils"; import { IItem } from "../../../../utils/types/item"; import { ISection } from "../../../../utils/types/section"; @@ -20,9 +20,18 @@ export const ViewMetaChildren: FC<{ item: IItem | IText | ISection }> = ({ } } else { if (item.id) { - children[item.id] = ; + + if (v.view.active?.text && v.view.active?.get(item)) { + children[item.id] =