[ [ 'key' => 'title_page', 'label' => Plugin::t('component.title_page.label', 'Title Page'), 'desc' => Plugin::t('component.title_page.desc', 'Book title, subtitle, author name.'), 'default_text' => "BOOK TITLE\n\nSubtitle (optional)\n\nAuthor Name", ], [ 'key' => 'copyright', 'label' => Plugin::t('component.copyright.label', 'Copyright Page'), 'desc' => Plugin::t('component.copyright.desc', 'Copyright, ISBN, rights, imprint.'), // Starter structure (placeholders can be edited by the user). 'default_text' => "Copyright © {YEAR} {AUTHOR}\nAll rights reserved.\n\nISBN: {ISBN}\nPublisher / Imprint: {IMPRINT}\n\nNo part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means—electronic, mechanical, photocopying, recording, or otherwise—without prior written permission from the publisher, except for brief quotations in reviews.\n\nCover design: {COVER_DESIGNER}\nInterior layout: {LAYOUT_DESIGNER}\nEditor: {EDITOR}\n\nFirst edition: {YEAR}\nPrinted in {COUNTRY}\n\nFor information: {WEBSITE}", ], [ 'key' => 'dedication', 'label' => Plugin::t('component.dedication.label', 'Dedication'), 'desc' => Plugin::t('component.dedication.desc', 'Short dedication text.'), 'default_text' => "To ________.", ], [ 'key' => 'preface', 'label' => Plugin::t('component.preface.label', 'Preface'), 'desc' => Plugin::t('component.preface.desc', 'Introductory remarks before Chapter 1.'), 'default_text' => "Write a short preface explaining why you wrote this book and what the reader will get from it.", ], [ 'key' => 'foreword', 'label' => Plugin::t('component.foreword.label', 'Foreword'), 'desc' => Plugin::t('component.foreword.desc', 'A guest intro written by someone else.'), 'default_text' => "Foreword text goes here. (Often written by a guest author.)", ], [ 'key' => 'synopsis', 'label' => Plugin::t('component.synopsis.label', 'Synopsis'), 'desc' => Plugin::t('component.synopsis.desc', 'A short summary or back-cover style description.'), 'default_text' => "Synopsis\n\nIn {BOOK_TITLE}, {AUTHOR} explores…\n\nParagraph 1: Hook + core promise.\nParagraph 2: What the reader will learn / experience.\nParagraph 3: Stakes, transformation, or key takeaways.\n\nIf you enjoyed {COMPS}, you’ll love this book.", ], [ 'key' => 'table_of_contents', 'label' => Plugin::t('component.table_of_contents.label', 'Table of Contents'), 'desc' => Plugin::t('component.table_of_contents.desc', 'Auto-generated from your current Organize chapter list. You can edit it here to customize the Table of Contents.'), 'default_text' => "Table of Contents\n\n(You can paste or edit your TOC here.)", ], ], 'back_matter' => [ [ 'key' => 'about_author', 'label' => Plugin::t('component.about_author.label', 'About the Author'), 'desc' => Plugin::t('component.about_author.desc', 'Author bio section.'), 'default_text' => "Write a short author bio (3–8 sentences). Include website or social links if desired.", ], [ 'key' => 'also_by_author', 'label' => Plugin::t('component.also_by_author.label', 'Also By the Author'), 'desc' => Plugin::t('component.also_by_author.desc', 'List other books / series.'), 'default_text' => "Also by {AUTHOR}\n\n{SERIES_OR_CATEGORY_1}\n• Book Title 1\n• Book Title 2\n\n{SERIES_OR_CATEGORY_2}\n• Book Title 3\n• Book Title 4\n\nFor more, visit: {WEBSITE}", ], [ 'key' => 'acknowledgments', 'label' => Plugin::t('component.acknowledgments.label', 'Acknowledgments'), 'desc' => Plugin::t('component.acknowledgments.desc', 'Thank-you section.'), 'default_text' => "Thank the people who helped you create this book.", ], [ 'key' => 'bibliography', 'label' => Plugin::t('component.bibliography.label', 'Bibliography / References'), 'desc' => Plugin::t('component.bibliography.desc', 'Sources and citations.'), 'default_text' => "List references here.", ], [ 'key' => 'endnotes', 'label' => Plugin::t('component.endnotes.label', 'Endnotes'), 'desc' => Plugin::t('component.endnotes.desc', 'Notes that appear at the end of the book.'), 'default_text' => "Endnotes\n\n1. Note text...\n2. Note text...", ], ], 'utility' => [ [ 'key' => 'part_divider', 'label' => Plugin::t('component.part_divider.label', 'Part Divider'), 'desc' => Plugin::t('component.part_divider.desc', 'A separator between major parts.'), 'default_text' => "Part Title", ], [ 'key' => 'scene_break', 'label' => Plugin::t('component.scene_break.label', 'Scene Break / Separator'), 'desc' => Plugin::t('component.scene_break.desc', 'A visual break between scenes.'), 'default_text' => "***", ], ], ]; } public static function flat_map() { $all = self::all(); $flat = []; foreach ($all as $group => $items) { foreach ($items as $it) { $it['group'] = $group; $flat[$it['key']] = $it; } } return $flat; } public static function get($key) { $flat = self::flat_map(); return isset($flat[$key]) ? $flat[$key] : null; } public static function group_label($group) { switch ($group) { case 'front_matter': return Plugin::t('component.group.front_matter','Front Matter'); case 'back_matter': return Plugin::t('component.group.back_matter','Back Matter'); case 'utility': return Plugin::t('component.group.utility','Utility'); default: return ucfirst((string)$group); } } } }