// The Outline stage: the shape of the message as a real outline — main points (I.), sub-points (A.), // and deeper (1., a.). There is one outline for the whole study and one for each chunk (pick which at // the top). A point can be an illustration, application, quote…, carry minutes, a longer note, a verse's // words, and cross-references or word studies from its chunk. Print it, share it, or take it as a file. import { useEffect, useLayoutEffect, useRef, useState } from 'react'; import { useApp } from '../context/AppContext.js'; import { useToast } from '../components/Toasts.jsx'; import StudioShell from '../components/study/StudioShell.jsx'; import { formatChunkReference } from '../utils/bibleUtils.jsx'; import { buildChapterSummary } from '../utils/projectStorage.js'; import { compactPassages } from '../utils/passageSummary.js'; import { attachableFromChunk, fetchPassageText } from '../utils/passageText.js'; import ShareOutlineSheet from '../components/ShareOutlineSheet.jsx'; import { downloadOutlineDocx, downloadOutlineMarkdown, printOutline } from '../utils/outlineExport.js'; import { KINDS, STUDY, addAfter, addChild, addRoot, chunkOf, countNodes, flatten, getNode, indent, insertAt, kindLabel, locate, moveNode, newNode, outdent, outlineFor, outlineToText, removeNode, seedFromChunks, seedFromVerses, timeSummary, updateNode, withOutline, } from '../utils/outline.js'; const iconBtn = 'flex h-7 w-7 items-center justify-center rounded-md text-sm text-[var(--r-sub)] hover:bg-black/5 hover:text-[var(--r-text)] disabled:opacity-30 disabled:hover:bg-transparent'; const btn = 'rounded-xl border border-[var(--r-line)] px-3.5 py-2 text-sm hover:bg-black/5 disabled:opacity-50'; const field = 'mt-0.5 block w-full rounded-lg border border-[var(--r-line)] bg-[var(--r-bg)] px-2 py-1.5 text-sm text-[var(--r-text)]'; const chip = 'rounded-full border border-[var(--r-line)] px-2 py-0.5 text-[11px] text-[var(--r-sub)]'; // A text box that grows with what is typed, so a long point never hides behind a scroll bar. function AutoText({ value, onChange, className, ...rest }) { const ref = useRef(null); useLayoutEffect(() => { const el = ref.current; if (!el) return; el.style.height = 'auto'; el.style.height = `${el.scrollHeight}px`; }, [value]); return