@auxee/piece-pdf-converter 0.0.3 → 0.0.5
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/package.json +1 -1
- package/src/lib/actions/markdown-to-pdf.d.ts +1 -0
- package/src/lib/actions/markdown-to-pdf.js +73 -3
- package/src/lib/actions/markdown-to-pdf.js.map +1 -1
- package/src/lib/utils/style-selector.d.ts +18 -0
- package/src/lib/utils/style-selector.js +614 -0
- package/src/lib/utils/style-selector.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const markdownToPdfAction: import("@activepieces/pieces-framework").IAction<import("@activepieces/pieces-framework").PieceAuthProperty, {
|
|
2
2
|
markdown: import("@activepieces/pieces-framework").LongTextProperty<true>;
|
|
3
|
+
meetingType: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
3
4
|
filename: import("@activepieces/pieces-framework").ShortTextProperty<false>;
|
|
4
5
|
}>;
|
|
@@ -6,6 +6,61 @@ const pieces_framework_1 = require("@activepieces/pieces-framework");
|
|
|
6
6
|
const puppeteer = tslib_1.__importStar(require("puppeteer-core"));
|
|
7
7
|
const marked_1 = require("marked");
|
|
8
8
|
const chrome_path_1 = require("../utils/chrome-path");
|
|
9
|
+
const style_selector_1 = require("../utils/style-selector");
|
|
10
|
+
/**
|
|
11
|
+
* Wraps headings (h1, h2, h3) and their following content in section containers.
|
|
12
|
+
* This helps CSS page-break rules keep headings with their content and prevent orphan headings.
|
|
13
|
+
*/
|
|
14
|
+
function wrapHeadingsInSections(html) {
|
|
15
|
+
// Find all heading positions first
|
|
16
|
+
const headingRegex = /<h([1-3])[^>]*>.*?<\/h\1>/gi;
|
|
17
|
+
const headings = [];
|
|
18
|
+
let match;
|
|
19
|
+
// Collect all heading positions
|
|
20
|
+
while ((match = headingRegex.exec(html)) !== null) {
|
|
21
|
+
headings.push({
|
|
22
|
+
index: match.index,
|
|
23
|
+
length: match[0].length,
|
|
24
|
+
level: parseInt(match[1], 10)
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
if (headings.length === 0) {
|
|
28
|
+
return html; // No headings to wrap
|
|
29
|
+
}
|
|
30
|
+
// Build result by processing each heading section
|
|
31
|
+
const parts = [];
|
|
32
|
+
let lastIndex = 0;
|
|
33
|
+
for (let i = 0; i < headings.length; i++) {
|
|
34
|
+
const heading = headings[i];
|
|
35
|
+
const headingStart = heading.index;
|
|
36
|
+
const headingEnd = headingStart + heading.length;
|
|
37
|
+
// Add any content before this heading
|
|
38
|
+
if (headingStart > lastIndex) {
|
|
39
|
+
const beforeContent = html.substring(lastIndex, headingStart).trim();
|
|
40
|
+
if (beforeContent) {
|
|
41
|
+
parts.push(beforeContent);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Find content until next heading (or end)
|
|
45
|
+
const nextHeadingStart = i < headings.length - 1
|
|
46
|
+
? headings[i + 1].index
|
|
47
|
+
: html.length;
|
|
48
|
+
const content = html.substring(headingEnd, nextHeadingStart).trim();
|
|
49
|
+
// Extract the heading HTML
|
|
50
|
+
const headingHtml = html.substring(headingStart, headingEnd);
|
|
51
|
+
// Wrap heading and content in section
|
|
52
|
+
parts.push(`<section class="section">${headingHtml}${content}</section>`);
|
|
53
|
+
lastIndex = nextHeadingStart;
|
|
54
|
+
}
|
|
55
|
+
// Add any remaining content after last heading
|
|
56
|
+
if (lastIndex < html.length) {
|
|
57
|
+
const remaining = html.substring(lastIndex).trim();
|
|
58
|
+
if (remaining) {
|
|
59
|
+
parts.push(remaining);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return parts.join('\n');
|
|
63
|
+
}
|
|
9
64
|
exports.markdownToPdfAction = (0, pieces_framework_1.createAction)({
|
|
10
65
|
name: 'markdown_to_pdf',
|
|
11
66
|
displayName: 'Convert Markdown to PDF',
|
|
@@ -16,6 +71,11 @@ exports.markdownToPdfAction = (0, pieces_framework_1.createAction)({
|
|
|
16
71
|
description: 'The Markdown content to convert',
|
|
17
72
|
required: true,
|
|
18
73
|
}),
|
|
74
|
+
meetingType: pieces_framework_1.Property.ShortText({
|
|
75
|
+
displayName: 'Meeting Type',
|
|
76
|
+
description: 'Meeting type to apply the appropriate visual style. Accepts: "kickoff", "delivery", "client_update", or "sales". Can use dynamic values from previous steps (e.g., {{$json.data.meetingType}}). Leave empty for default style.',
|
|
77
|
+
required: false,
|
|
78
|
+
}),
|
|
19
79
|
filename: pieces_framework_1.Property.ShortText({
|
|
20
80
|
displayName: 'Filename',
|
|
21
81
|
description: 'The name of the output PDF file (e.g., document.pdf)',
|
|
@@ -26,6 +86,7 @@ exports.markdownToPdfAction = (0, pieces_framework_1.createAction)({
|
|
|
26
86
|
run(context) {
|
|
27
87
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
28
88
|
const markdown = context.propsValue.markdown;
|
|
89
|
+
const meetingType = context.propsValue.meetingType;
|
|
29
90
|
let filename = context.propsValue.filename || 'output.pdf';
|
|
30
91
|
if (!markdown) {
|
|
31
92
|
throw new Error("Markdown content is required");
|
|
@@ -33,14 +94,23 @@ exports.markdownToPdfAction = (0, pieces_framework_1.createAction)({
|
|
|
33
94
|
if (!filename.endsWith('.pdf')) {
|
|
34
95
|
filename += '.pdf';
|
|
35
96
|
}
|
|
36
|
-
|
|
37
|
-
|
|
97
|
+
// Convert markdown to HTML
|
|
98
|
+
let htmlContent = yield marked_1.marked.parse(markdown);
|
|
99
|
+
// Wrap headings and their content in section containers for better page-break control
|
|
100
|
+
// This ensures headings stay with their content and prevents orphan headings
|
|
101
|
+
htmlContent = wrapHeadingsInSections(htmlContent);
|
|
102
|
+
// Select CSS style based on meeting type
|
|
103
|
+
// This dynamically applies different visual styles without changing content
|
|
104
|
+
const selectedStyle = (0, style_selector_1.getStyleForMeetingType)(meetingType);
|
|
105
|
+
// Wrap in HTML structure with dynamically selected styles
|
|
106
|
+
// The style is injected at render time based on meetingType
|
|
38
107
|
const fullHtml = `
|
|
39
108
|
<!DOCTYPE html>
|
|
40
109
|
<html>
|
|
41
110
|
<head>
|
|
111
|
+
<meta charset="UTF-8">
|
|
42
112
|
<style>
|
|
43
|
-
|
|
113
|
+
${selectedStyle}
|
|
44
114
|
</style>
|
|
45
115
|
</head>
|
|
46
116
|
<body>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown-to-pdf.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/pdf-converter/src/lib/actions/markdown-to-pdf.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kEAA4C;AAC5C,mCAAgC;AAChC,sDAA+D;
|
|
1
|
+
{"version":3,"file":"markdown-to-pdf.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/pdf-converter/src/lib/actions/markdown-to-pdf.ts"],"names":[],"mappings":";;;;AAAA,qEAAwE;AACxE,kEAA4C;AAC5C,mCAAgC;AAChC,sDAA+D;AAC/D,4DAAiE;AAEjE;;;GAGG;AACH,SAAS,sBAAsB,CAAC,IAAY;IAC1C,mCAAmC;IACnC,MAAM,YAAY,GAAG,6BAA6B,CAAC;IACnD,MAAM,QAAQ,GAA4D,EAAE,CAAC;IAC7E,IAAI,KAAK,CAAC;IAEV,gCAAgC;IAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QAClD,QAAQ,CAAC,IAAI,CAAC;YACZ,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,MAAM,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM;YACvB,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1B,OAAO,IAAI,CAAC,CAAC,sBAAsB;IACrC,CAAC;IAED,kDAAkD;IAClD,MAAM,KAAK,GAA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I,WAAW,GAAG,MAAM,eAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;YAE/C,sFAAsF;YACtF,6EAA6E;YAC7E,WAAW,GAAG,sBAAsB,CAAC,WAAW,CAAC,CAAC;YAElD,yCAAyC;YACzC,4EAA4E;YAC5E,MAAM,aAAa,GAAG,IAAA,uCAAsB,EAAC,WAAW,CAAC,CAAC;YAE1D,0DAA0D;YAC1D,4DAA4D;YAC5D,MAAM,QAAQ,GAAG;;;;;;YAMT,aAAa;;;;UAIf,WAAW;;;KAGhB,CAAC;YAEF,MAAM,OAAO,GAAG,MAAM,SAAS,CAAC,MAAM,CAAC;gBACrC,QAAQ,EAAE,IAAI;gBACd,cAAc,EAAE,IAAA,qCAAuB,GAAE;gBACzC,IAAI,EAAE,CAAC,cAAc,EAAE,0BAA0B,CAAC;aACnD,CAAC,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,OAAO,EAAE,CAAC;YACrC,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,EAAE,SAAS,EAAE,cAAc,EAAE,CAAC,CAAC;YAC/D,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;YAEnD,MAAM,OAAO,CAAC,KAAK,EAAE,CAAC;YAEtB,OAAO;gBACL,QAAQ,EAAE,QAAQ;gBAClB,QAAQ,EAAE,iBAAiB;gBAC3B,IAAI,EAAE,+BAA+B,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;aACjF,CAAC;QACJ,CAAC;KAAA;CACF,CAAC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Style Selector Utility
|
|
3
|
+
*
|
|
4
|
+
* Maps meeting types to their corresponding CSS stylesheets.
|
|
5
|
+
* This allows the PDF converter to apply different visual styles
|
|
6
|
+
* based on the meeting type without changing the content.
|
|
7
|
+
*
|
|
8
|
+
* Styles are inlined here for reliability in bundled environments.
|
|
9
|
+
*/
|
|
10
|
+
export type MeetingType = 'kickoff' | 'delivery' | 'client_update' | 'sales';
|
|
11
|
+
/**
|
|
12
|
+
* Maps meeting type to CSS style name
|
|
13
|
+
* - kickoff → Statement of Work (SOW) style
|
|
14
|
+
* - delivery / client_update → Meeting Minutes style
|
|
15
|
+
* - sales → Sales Proposal style
|
|
16
|
+
* - unknown → Default style
|
|
17
|
+
*/
|
|
18
|
+
export declare function getStyleForMeetingType(meetingType: string | undefined | null): string;
|
|
@@ -0,0 +1,614 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Style Selector Utility
|
|
4
|
+
*
|
|
5
|
+
* Maps meeting types to their corresponding CSS stylesheets.
|
|
6
|
+
* This allows the PDF converter to apply different visual styles
|
|
7
|
+
* based on the meeting type without changing the content.
|
|
8
|
+
*
|
|
9
|
+
* Styles are inlined here for reliability in bundled environments.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getStyleForMeetingType = getStyleForMeetingType;
|
|
13
|
+
/**
|
|
14
|
+
* Maps meeting type to CSS style name
|
|
15
|
+
* - kickoff → Statement of Work (SOW) style
|
|
16
|
+
* - delivery / client_update → Meeting Minutes style
|
|
17
|
+
* - sales → Sales Proposal style
|
|
18
|
+
* - unknown → Default style
|
|
19
|
+
*/
|
|
20
|
+
function getStyleForMeetingType(meetingType) {
|
|
21
|
+
if (!meetingType) {
|
|
22
|
+
return getDefaultStyle();
|
|
23
|
+
}
|
|
24
|
+
const normalizedType = meetingType.toLowerCase().trim();
|
|
25
|
+
switch (normalizedType) {
|
|
26
|
+
case 'kickoff':
|
|
27
|
+
return getSowStyle();
|
|
28
|
+
case 'delivery':
|
|
29
|
+
case 'client_update':
|
|
30
|
+
return getMinutesStyle();
|
|
31
|
+
case 'sales':
|
|
32
|
+
return getProposalStyle();
|
|
33
|
+
default:
|
|
34
|
+
// Fallback to default style for unknown meeting types
|
|
35
|
+
return getDefaultStyle();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Statement of Work (SOW) Style
|
|
40
|
+
* Formal, professional style with blue/brand headers for kickoff meetings
|
|
41
|
+
*/
|
|
42
|
+
function getSowStyle() {
|
|
43
|
+
return `/* Statement of Work (SOW) Style - for kickoff meetings */
|
|
44
|
+
/* Formal, professional style with blue/brand headers */
|
|
45
|
+
|
|
46
|
+
body {
|
|
47
|
+
font-family: 'Georgia', 'Times New Roman', serif;
|
|
48
|
+
padding: 40px 60px;
|
|
49
|
+
line-height: 1.6;
|
|
50
|
+
color: #1a1a1a;
|
|
51
|
+
background: #ffffff;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
h1 {
|
|
55
|
+
color: #1e3a8a;
|
|
56
|
+
font-size: 32px;
|
|
57
|
+
font-weight: 700;
|
|
58
|
+
margin-top: 0;
|
|
59
|
+
margin-bottom: 24px;
|
|
60
|
+
border-bottom: 3px solid #1e3a8a;
|
|
61
|
+
padding-bottom: 12px;
|
|
62
|
+
page-break-after: avoid;
|
|
63
|
+
break-after: avoid;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
h2 {
|
|
67
|
+
color: #1e40af;
|
|
68
|
+
font-size: 24px;
|
|
69
|
+
font-weight: 600;
|
|
70
|
+
margin-top: 32px;
|
|
71
|
+
margin-bottom: 16px;
|
|
72
|
+
border-bottom: 2px solid #3b82f6;
|
|
73
|
+
padding-bottom: 8px;
|
|
74
|
+
page-break-after: avoid;
|
|
75
|
+
break-after: avoid;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
h3 {
|
|
79
|
+
color: #2563eb;
|
|
80
|
+
font-size: 20px;
|
|
81
|
+
font-weight: 600;
|
|
82
|
+
margin-top: 24px;
|
|
83
|
+
margin-bottom: 12px;
|
|
84
|
+
page-break-after: avoid;
|
|
85
|
+
break-after: avoid;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
h4, h5, h6 {
|
|
89
|
+
color: #3b82f6;
|
|
90
|
+
font-weight: 600;
|
|
91
|
+
margin-top: 16px;
|
|
92
|
+
margin-bottom: 8px;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
p {
|
|
96
|
+
margin-bottom: 12px;
|
|
97
|
+
text-align: justify;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
ul, ol {
|
|
101
|
+
margin-bottom: 16px;
|
|
102
|
+
padding-left: 24px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
li {
|
|
106
|
+
margin-bottom: 8px;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
strong {
|
|
110
|
+
color: #1e3a8a;
|
|
111
|
+
font-weight: 700;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
blockquote {
|
|
115
|
+
border-left: 4px solid #1e40af;
|
|
116
|
+
padding-left: 20px;
|
|
117
|
+
margin: 20px 0;
|
|
118
|
+
color: #4b5563;
|
|
119
|
+
font-style: italic;
|
|
120
|
+
background: #f8fafc;
|
|
121
|
+
padding: 16px 20px;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
code {
|
|
125
|
+
background: #f1f5f9;
|
|
126
|
+
padding: 2px 6px;
|
|
127
|
+
border-radius: 3px;
|
|
128
|
+
font-family: 'Courier New', monospace;
|
|
129
|
+
color: #1e3a8a;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
pre {
|
|
133
|
+
background: #1e293b;
|
|
134
|
+
color: #e2e8f0;
|
|
135
|
+
padding: 16px;
|
|
136
|
+
border-radius: 6px;
|
|
137
|
+
overflow-x: auto;
|
|
138
|
+
border-left: 4px solid #3b82f6;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
table {
|
|
142
|
+
border-collapse: collapse;
|
|
143
|
+
width: 100%;
|
|
144
|
+
margin: 20px 0;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
th {
|
|
148
|
+
background: #1e3a8a;
|
|
149
|
+
color: #ffffff;
|
|
150
|
+
padding: 12px;
|
|
151
|
+
text-align: left;
|
|
152
|
+
font-weight: 600;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
td {
|
|
156
|
+
padding: 10px 12px;
|
|
157
|
+
border-bottom: 1px solid #e5e7eb;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
tr:nth-child(even) {
|
|
161
|
+
background: #f8fafc;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
hr {
|
|
165
|
+
border: none;
|
|
166
|
+
border-top: 2px solid #3b82f6;
|
|
167
|
+
margin: 32px 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/* Page break rules to prevent orphan headings */
|
|
171
|
+
h2 + p,
|
|
172
|
+
h2 + ul,
|
|
173
|
+
h2 + ol,
|
|
174
|
+
h3 + p,
|
|
175
|
+
h3 + ul,
|
|
176
|
+
h3 + ol {
|
|
177
|
+
page-break-before: avoid;
|
|
178
|
+
break-before: avoid;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
section, .section {
|
|
182
|
+
break-inside: avoid;
|
|
183
|
+
page-break-inside: avoid;
|
|
184
|
+
}`;
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Meeting Minutes Style
|
|
188
|
+
* Neutral, operational tone with green accents for delivery/client_update meetings
|
|
189
|
+
*/
|
|
190
|
+
function getMinutesStyle() {
|
|
191
|
+
return `/* Meeting Minutes Style - for delivery and client_update meetings */
|
|
192
|
+
/* Neutral, operational tone with green accents */
|
|
193
|
+
|
|
194
|
+
body {
|
|
195
|
+
font-family: 'Arial', 'Helvetica', sans-serif;
|
|
196
|
+
padding: 40px 50px;
|
|
197
|
+
line-height: 1.7;
|
|
198
|
+
color: #2d3748;
|
|
199
|
+
background: #ffffff;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
h1 {
|
|
203
|
+
color: #065f46;
|
|
204
|
+
font-size: 28px;
|
|
205
|
+
font-weight: 600;
|
|
206
|
+
margin-top: 0;
|
|
207
|
+
margin-bottom: 20px;
|
|
208
|
+
border-bottom: 2px solid #10b981;
|
|
209
|
+
padding-bottom: 10px;
|
|
210
|
+
page-break-after: avoid;
|
|
211
|
+
break-after: avoid;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
h2 {
|
|
215
|
+
color: #047857;
|
|
216
|
+
font-size: 22px;
|
|
217
|
+
font-weight: 600;
|
|
218
|
+
margin-top: 28px;
|
|
219
|
+
margin-bottom: 14px;
|
|
220
|
+
border-bottom: 1px solid #34d399;
|
|
221
|
+
padding-bottom: 6px;
|
|
222
|
+
page-break-after: avoid;
|
|
223
|
+
break-after: avoid;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
h3 {
|
|
227
|
+
color: #059669;
|
|
228
|
+
font-size: 18px;
|
|
229
|
+
font-weight: 600;
|
|
230
|
+
margin-top: 20px;
|
|
231
|
+
margin-bottom: 10px;
|
|
232
|
+
page-break-after: avoid;
|
|
233
|
+
break-after: avoid;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
h4, h5, h6 {
|
|
237
|
+
color: #10b981;
|
|
238
|
+
font-weight: 600;
|
|
239
|
+
margin-top: 14px;
|
|
240
|
+
margin-bottom: 6px;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
p {
|
|
244
|
+
margin-bottom: 10px;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
ul, ol {
|
|
248
|
+
margin-bottom: 14px;
|
|
249
|
+
padding-left: 20px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
li {
|
|
253
|
+
margin-bottom: 6px;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
strong {
|
|
257
|
+
color: #047857;
|
|
258
|
+
font-weight: 600;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
blockquote {
|
|
262
|
+
border-left: 4px solid #10b981;
|
|
263
|
+
padding-left: 18px;
|
|
264
|
+
margin: 18px 0;
|
|
265
|
+
color: #4a5568;
|
|
266
|
+
background: #f0fdf4;
|
|
267
|
+
padding: 14px 18px;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
code {
|
|
271
|
+
background: #f0fdf4;
|
|
272
|
+
padding: 2px 5px;
|
|
273
|
+
border-radius: 3px;
|
|
274
|
+
font-family: 'Courier New', monospace;
|
|
275
|
+
color: #047857;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
pre {
|
|
279
|
+
background: #064e3b;
|
|
280
|
+
color: #d1fae5;
|
|
281
|
+
padding: 14px;
|
|
282
|
+
border-radius: 5px;
|
|
283
|
+
overflow-x: auto;
|
|
284
|
+
border-left: 4px solid #10b981;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
table {
|
|
288
|
+
border-collapse: collapse;
|
|
289
|
+
width: 100%;
|
|
290
|
+
margin: 18px 0;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
th {
|
|
294
|
+
background: #047857;
|
|
295
|
+
color: #ffffff;
|
|
296
|
+
padding: 10px;
|
|
297
|
+
text-align: left;
|
|
298
|
+
font-weight: 600;
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
td {
|
|
302
|
+
padding: 8px 10px;
|
|
303
|
+
border-bottom: 1px solid #d1d5db;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
tr:nth-child(even) {
|
|
307
|
+
background: #f0fdf4;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
hr {
|
|
311
|
+
border: none;
|
|
312
|
+
border-top: 2px solid #10b981;
|
|
313
|
+
margin: 28px 0;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
/* Page break rules to prevent orphan headings */
|
|
317
|
+
h2 + p,
|
|
318
|
+
h2 + ul,
|
|
319
|
+
h2 + ol,
|
|
320
|
+
h3 + p,
|
|
321
|
+
h3 + ul,
|
|
322
|
+
h3 + ol {
|
|
323
|
+
page-break-before: avoid;
|
|
324
|
+
break-before: avoid;
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
section, .section {
|
|
328
|
+
break-inside: avoid;
|
|
329
|
+
page-break-inside: avoid;
|
|
330
|
+
}`;
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Sales Proposal Style
|
|
334
|
+
* Highlighted benefits, warmer accent colors for sales meetings
|
|
335
|
+
*/
|
|
336
|
+
function getProposalStyle() {
|
|
337
|
+
return `/* Sales Proposal Style - for sales meetings */
|
|
338
|
+
/* Highlighted benefits, warmer accent colors */
|
|
339
|
+
|
|
340
|
+
body {
|
|
341
|
+
font-family: 'Segoe UI', 'Arial', sans-serif;
|
|
342
|
+
padding: 40px 55px;
|
|
343
|
+
line-height: 1.65;
|
|
344
|
+
color: #1f2937;
|
|
345
|
+
background: #ffffff;
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
h1 {
|
|
349
|
+
color: #b45309;
|
|
350
|
+
font-size: 30px;
|
|
351
|
+
font-weight: 700;
|
|
352
|
+
margin-top: 0;
|
|
353
|
+
margin-bottom: 22px;
|
|
354
|
+
border-bottom: 3px solid #f59e0b;
|
|
355
|
+
padding-bottom: 11px;
|
|
356
|
+
page-break-after: avoid;
|
|
357
|
+
break-after: avoid;
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
h2 {
|
|
361
|
+
color: #c2410c;
|
|
362
|
+
font-size: 23px;
|
|
363
|
+
font-weight: 600;
|
|
364
|
+
margin-top: 30px;
|
|
365
|
+
margin-bottom: 15px;
|
|
366
|
+
border-bottom: 2px solid #fb923c;
|
|
367
|
+
padding-bottom: 7px;
|
|
368
|
+
page-break-after: avoid;
|
|
369
|
+
break-after: avoid;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
h3 {
|
|
373
|
+
color: #d97706;
|
|
374
|
+
font-size: 19px;
|
|
375
|
+
font-weight: 600;
|
|
376
|
+
margin-top: 22px;
|
|
377
|
+
margin-bottom: 11px;
|
|
378
|
+
page-break-after: avoid;
|
|
379
|
+
break-after: avoid;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
h4, h5, h6 {
|
|
383
|
+
color: #f59e0b;
|
|
384
|
+
font-weight: 600;
|
|
385
|
+
margin-top: 15px;
|
|
386
|
+
margin-bottom: 7px;
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
p {
|
|
390
|
+
margin-bottom: 11px;
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
ul, ol {
|
|
394
|
+
margin-bottom: 15px;
|
|
395
|
+
padding-left: 22px;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
li {
|
|
399
|
+
margin-bottom: 7px;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
strong {
|
|
403
|
+
color: #b45309;
|
|
404
|
+
font-weight: 700;
|
|
405
|
+
background: #fef3c7;
|
|
406
|
+
padding: 1px 4px;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
blockquote {
|
|
410
|
+
border-left: 4px solid #f59e0b;
|
|
411
|
+
padding-left: 19px;
|
|
412
|
+
margin: 19px 0;
|
|
413
|
+
color: #4b5563;
|
|
414
|
+
background: #fffbeb;
|
|
415
|
+
padding: 15px 19px;
|
|
416
|
+
border-radius: 4px;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
code {
|
|
420
|
+
background: #fffbeb;
|
|
421
|
+
padding: 2px 6px;
|
|
422
|
+
border-radius: 3px;
|
|
423
|
+
font-family: 'Courier New', monospace;
|
|
424
|
+
color: #b45309;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
pre {
|
|
428
|
+
background: #78350f;
|
|
429
|
+
color: #fde68a;
|
|
430
|
+
padding: 15px;
|
|
431
|
+
border-radius: 5px;
|
|
432
|
+
overflow-x: auto;
|
|
433
|
+
border-left: 4px solid #f59e0b;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
table {
|
|
437
|
+
border-collapse: collapse;
|
|
438
|
+
width: 100%;
|
|
439
|
+
margin: 19px 0;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
th {
|
|
443
|
+
background: #b45309;
|
|
444
|
+
color: #ffffff;
|
|
445
|
+
padding: 11px;
|
|
446
|
+
text-align: left;
|
|
447
|
+
font-weight: 600;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
td {
|
|
451
|
+
padding: 9px 11px;
|
|
452
|
+
border-bottom: 1px solid #e5e7eb;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
tr:nth-child(even) {
|
|
456
|
+
background: #fffbeb;
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
hr {
|
|
460
|
+
border: none;
|
|
461
|
+
border-top: 2px solid #f59e0b;
|
|
462
|
+
margin: 30px 0;
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
/* Page break rules to prevent orphan headings */
|
|
466
|
+
h2 + p,
|
|
467
|
+
h2 + ul,
|
|
468
|
+
h2 + ol,
|
|
469
|
+
h3 + p,
|
|
470
|
+
h3 + ul,
|
|
471
|
+
h3 + ol {
|
|
472
|
+
page-break-before: avoid;
|
|
473
|
+
break-before: avoid;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
section, .section {
|
|
477
|
+
break-inside: avoid;
|
|
478
|
+
page-break-inside: avoid;
|
|
479
|
+
}`;
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* Default Style
|
|
483
|
+
* Clean, neutral styling as fallback
|
|
484
|
+
*/
|
|
485
|
+
function getDefaultStyle() {
|
|
486
|
+
return `/* Default Style - fallback for unknown meeting types */
|
|
487
|
+
/* Clean, neutral styling */
|
|
488
|
+
|
|
489
|
+
body {
|
|
490
|
+
font-family: sans-serif;
|
|
491
|
+
padding: 20px;
|
|
492
|
+
line-height: 1.6;
|
|
493
|
+
color: #333333;
|
|
494
|
+
background: #ffffff;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
h1 {
|
|
498
|
+
font-size: 28px;
|
|
499
|
+
font-weight: 600;
|
|
500
|
+
margin-top: 0;
|
|
501
|
+
margin-bottom: 16px;
|
|
502
|
+
page-break-after: avoid;
|
|
503
|
+
break-after: avoid;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
h2 {
|
|
507
|
+
font-size: 22px;
|
|
508
|
+
font-weight: 600;
|
|
509
|
+
margin-top: 24px;
|
|
510
|
+
margin-bottom: 12px;
|
|
511
|
+
page-break-after: avoid;
|
|
512
|
+
break-after: avoid;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
h3 {
|
|
516
|
+
font-size: 18px;
|
|
517
|
+
font-weight: 600;
|
|
518
|
+
margin-top: 20px;
|
|
519
|
+
margin-bottom: 10px;
|
|
520
|
+
page-break-after: avoid;
|
|
521
|
+
break-after: avoid;
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
h4, h5, h6 {
|
|
525
|
+
font-weight: 600;
|
|
526
|
+
margin-top: 16px;
|
|
527
|
+
margin-bottom: 8px;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
p {
|
|
531
|
+
margin-bottom: 10px;
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
ul, ol {
|
|
535
|
+
margin-bottom: 12px;
|
|
536
|
+
padding-left: 20px;
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
li {
|
|
540
|
+
margin-bottom: 6px;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
strong {
|
|
544
|
+
font-weight: 600;
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
blockquote {
|
|
548
|
+
border-left: 4px solid #cccccc;
|
|
549
|
+
padding-left: 16px;
|
|
550
|
+
margin: 16px 0;
|
|
551
|
+
color: #666666;
|
|
552
|
+
font-style: italic;
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
code {
|
|
556
|
+
background: #f5f5f5;
|
|
557
|
+
padding: 2px 4px;
|
|
558
|
+
border-radius: 3px;
|
|
559
|
+
font-family: monospace;
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
pre {
|
|
563
|
+
background: #f5f5f5;
|
|
564
|
+
padding: 12px;
|
|
565
|
+
border-radius: 4px;
|
|
566
|
+
overflow-x: auto;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
table {
|
|
570
|
+
border-collapse: collapse;
|
|
571
|
+
width: 100%;
|
|
572
|
+
margin: 16px 0;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
th {
|
|
576
|
+
background: #666666;
|
|
577
|
+
color: #ffffff;
|
|
578
|
+
padding: 8px;
|
|
579
|
+
text-align: left;
|
|
580
|
+
font-weight: 600;
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
td {
|
|
584
|
+
padding: 8px;
|
|
585
|
+
border-bottom: 1px solid #e5e7eb;
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
tr:nth-child(even) {
|
|
589
|
+
background: #f9f9f9;
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
hr {
|
|
593
|
+
border: none;
|
|
594
|
+
border-top: 1px solid #cccccc;
|
|
595
|
+
margin: 24px 0;
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/* Page break rules to prevent orphan headings */
|
|
599
|
+
h2 + p,
|
|
600
|
+
h2 + ul,
|
|
601
|
+
h2 + ol,
|
|
602
|
+
h3 + p,
|
|
603
|
+
h3 + ul,
|
|
604
|
+
h3 + ol {
|
|
605
|
+
page-break-before: avoid;
|
|
606
|
+
break-before: avoid;
|
|
607
|
+
}
|
|
608
|
+
|
|
609
|
+
section, .section {
|
|
610
|
+
break-inside: avoid;
|
|
611
|
+
page-break-inside: avoid;
|
|
612
|
+
}`;
|
|
613
|
+
}
|
|
614
|
+
//# sourceMappingURL=style-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"style-selector.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/custom/pdf-converter/src/lib/utils/style-selector.ts"],"names":[],"mappings":";AAAA;;;;;;;;EAQE;;AAWF,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