@masumdev/markforge 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -248,7 +248,7 @@ export default defineConfig({
248
248
  },
249
249
 
250
250
  // Document signatures and approval block
251
- signatureBlock: {
251
+ signatures: {
252
252
  align: SignatureAlign.SPACE_BETWEEN,
253
253
  style: SignatureStyle.BOX,
254
254
  spacingBefore: "2.5cm",
@@ -303,7 +303,7 @@ export default defineConfig({
303
303
  | `numberHeadings` | `boolean \| object` | `false` | Automated hierarchical decimal numbering for headings (`1.`, `1.1.`, etc.) |
304
304
  | `coverPage` | `boolean \| object` | `false` | Isolated front cover page builder with presets and company logo |
305
305
  | `backCover` | `boolean \| object` | `false` | Isolated closing back cover page builder with corporate contact info |
306
- | `signatureBlock` | `object` | `undefined` | Formal multi-signatory approval and signing block |
306
+ | `signatures` | `object` | `undefined` | Formal multi-signatory approval and signing block |
307
307
  | `math` | `boolean` | `false` | KaTeX LaTeX math equation rendering (`$inline$` and `$$block$$`) |
308
308
  | `security` | `object` | `undefined` | ISO 32000-2 AES-256 PDF encryption, user/owner passwords, and permissions |
309
309
  | `watermark` | `string \| object` | `undefined` | 100% unselectable diagonal watermark configuration |
@@ -9,13 +9,13 @@ try {
9
9
  } catch {}
10
10
  import {
11
11
  MARKFORGE_VERSION
12
- } from "./chunk-TNWZ4MFS.mjs";
12
+ } from "./chunk-UNWAEVDU.mjs";
13
13
  import {
14
14
  buildDocxDocument,
15
15
  buildHtmlDocument,
16
16
  buildPdfDocument,
17
17
  parseMarkdownDocument
18
- } from "./chunk-CRV7R2BG.mjs";
18
+ } from "./chunk-R6DT335C.mjs";
19
19
  import {
20
20
  DEFAULT_CONFIG
21
21
  } from "./chunk-BPHDY6VB.mjs";
@@ -40,10 +40,53 @@ function formatDisplayPath(p) {
40
40
  }
41
41
  var Header = ({
42
42
  inputFile,
43
+ configPath,
44
+ config,
43
45
  theme = "corporate",
44
46
  targetFormats = ["docx", "pdf"]
45
47
  }) => {
46
- const themeLabel = typeof theme === "object" ? "Custom (ThemeProps)" : String(theme || "corporate");
48
+ const resolvedTheme = (config == null ? void 0 : config.theme) || theme;
49
+ const themeLabel = typeof resolvedTheme === "object" ? "Custom (ThemeProps)" : String(resolvedTheme || "corporate");
50
+ const activeFeatures = [];
51
+ if (config == null ? void 0 : config.toc) activeFeatures.push("TOC");
52
+ if (config == null ? void 0 : config.numberHeadings) {
53
+ if (typeof config.numberHeadings === "object") {
54
+ const isNumEnabled = config.numberHeadings.enabled ?? true;
55
+ if (isNumEnabled) {
56
+ activeFeatures.push(`Numbering (depth ${config.numberHeadings.depth ?? 3})`);
57
+ }
58
+ } else if (config.numberHeadings === true) {
59
+ activeFeatures.push("Numbering (depth 3)");
60
+ }
61
+ }
62
+ if (config == null ? void 0 : config.coverPage) {
63
+ if (typeof config.coverPage === "object" && config.coverPage.enabled !== false) {
64
+ activeFeatures.push(`Cover (${config.coverPage.preset || "corporate"})`);
65
+ } else if (config.coverPage === true) {
66
+ activeFeatures.push("Cover (corporate)");
67
+ }
68
+ }
69
+ if (config == null ? void 0 : config.backCover) {
70
+ if (typeof config.backCover === "object" && config.backCover.enabled !== false) {
71
+ activeFeatures.push(`BackCover (${config.backCover.preset || "corporate"})`);
72
+ } else if (config.backCover === true) {
73
+ activeFeatures.push("BackCover (corporate)");
74
+ }
75
+ }
76
+ if (config == null ? void 0 : config.watermark) {
77
+ const wmText = typeof config.watermark === "object" ? config.watermark.text : config.watermark;
78
+ if (wmText) {
79
+ activeFeatures.push(`Watermark ("${wmText}")`);
80
+ }
81
+ }
82
+ if ((config == null ? void 0 : config.security) && (config.security.userPassword || config.security.ownerPassword)) {
83
+ activeFeatures.push("AES-256 Security");
84
+ }
85
+ if ((config == null ? void 0 : config.math) !== false) activeFeatures.push("KaTeX Math");
86
+ if (config == null ? void 0 : config.syntaxTheme) activeFeatures.push(`Syntax (${config.syntaxTheme})`);
87
+ const paperLabel = `${(config == null ? void 0 : config.paperSize) || "A4"} (${(config == null ? void 0 : config.orientation) || "portrait"})`;
88
+ const outputLabel = (config == null ? void 0 : config.outputDir) ? formatDisplayPath(config.outputDir) : "./ (default)";
89
+ const configLabel = configPath ? formatDisplayPath(configPath) : "(default auto-discovery)";
47
90
  return /* @__PURE__ */ jsx(Box, { flexDirection: "column", marginY: 1, children: /* @__PURE__ */ jsxs(
48
91
  Box,
49
92
  {
@@ -66,9 +109,15 @@ var Header = ({
66
109
  ] }) })
67
110
  ] }),
68
111
  /* @__PURE__ */ jsxs(Box, { flexDirection: "column", marginTop: 1, children: [
69
- inputFile && /* @__PURE__ */ jsxs(Box, { children: [
70
- /* @__PURE__ */ jsx(Text, { color: "gray", children: "Source: " }),
71
- /* @__PURE__ */ jsx(Text, { color: "white", bold: true, children: formatDisplayPath(inputFile) })
112
+ /* @__PURE__ */ jsxs(Box, { justifyContent: "space-between", children: [
113
+ /* @__PURE__ */ jsxs(Box, { children: [
114
+ /* @__PURE__ */ jsx(Text, { color: "gray", children: "Source: " }),
115
+ /* @__PURE__ */ jsx(Text, { color: "white", bold: true, children: formatDisplayPath(inputFile) })
116
+ ] }),
117
+ /* @__PURE__ */ jsxs(Box, { children: [
118
+ /* @__PURE__ */ jsx(Text, { color: "gray", children: "Config: " }),
119
+ /* @__PURE__ */ jsx(Text, { color: "cyan", children: configLabel })
120
+ ] })
72
121
  ] }),
73
122
  /* @__PURE__ */ jsxs(Box, { justifyContent: "space-between", marginTop: 0, children: [
74
123
  /* @__PURE__ */ jsxs(Box, { children: [
@@ -79,6 +128,20 @@ var Header = ({
79
128
  /* @__PURE__ */ jsx(Text, { color: "gray", children: "Targets: " }),
80
129
  /* @__PURE__ */ jsx(Text, { color: "yellow", bold: true, children: targetFormats.map((f) => f.toUpperCase()).join(", ") })
81
130
  ] })
131
+ ] }),
132
+ /* @__PURE__ */ jsxs(Box, { justifyContent: "space-between", marginTop: 0, children: [
133
+ /* @__PURE__ */ jsxs(Box, { children: [
134
+ /* @__PURE__ */ jsx(Text, { color: "gray", children: "Layout: " }),
135
+ /* @__PURE__ */ jsx(Text, { color: "green", children: paperLabel })
136
+ ] }),
137
+ /* @__PURE__ */ jsxs(Box, { children: [
138
+ /* @__PURE__ */ jsx(Text, { color: "gray", children: "Output: " }),
139
+ /* @__PURE__ */ jsx(Text, { color: "white", children: outputLabel })
140
+ ] })
141
+ ] }),
142
+ activeFeatures.length > 0 && /* @__PURE__ */ jsxs(Box, { marginTop: 0, children: [
143
+ /* @__PURE__ */ jsx(Text, { color: "gray", children: "Modules: " }),
144
+ /* @__PURE__ */ jsx(Text, { color: "blue", children: activeFeatures.join(" | ") })
82
145
  ] })
83
146
  ] }),
84
147
  /* @__PURE__ */ jsxs(Box, { marginTop: 1, justifyContent: "space-between", children: [
@@ -282,7 +345,7 @@ async function compileMarkdown(inputFilePathOrContent, userConfig = {}, onProgre
282
345
 
283
346
  // src/ui/App.tsx
284
347
  import { jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
285
- var App = ({ inputFile, config, onComplete }) => {
348
+ var App = ({ inputFile, config, configPath, onComplete }) => {
286
349
  const [status, setStatus] = useState("Initializing...");
287
350
  const [isCompiling, setIsCompiling] = useState(true);
288
351
  const [result, setResult] = useState(null);
@@ -315,6 +378,8 @@ var App = ({ inputFile, config, onComplete }) => {
315
378
  Header,
316
379
  {
317
380
  inputFile,
381
+ configPath,
382
+ config,
318
383
  theme: config.theme,
319
384
  targetFormats
320
385
  }