@flogeez/angular-tiptap-editor 3.1.4 → 3.1.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/CHANGELOG.md +6 -0
- package/esm2022/lib/components/editor/angular-tiptap-editor.component.mjs +4 -3
- package/esm2022/lib/services/ate-editor-commands.service.mjs +34 -1
- package/esm2022/lib/services/ate-export.service.mjs +71 -0
- package/esm2022/lib/services/ate-i18n.service.mjs +28 -1
- package/esm2022/lib/utils/ate-markdown.utils.mjs +179 -0
- package/esm2022/public-api.mjs +2 -1
- package/fesm2022/flogeez-angular-tiptap-editor.mjs +309 -3
- package/fesm2022/flogeez-angular-tiptap-editor.mjs.map +1 -1
- package/lib/services/ate-editor-commands.service.d.ts +14 -0
- package/lib/services/ate-export.service.d.ts +27 -0
- package/lib/services/ate-i18n.service.d.ts +26 -0
- package/lib/utils/ate-markdown.utils.d.ts +4 -0
- package/package.json +1 -1
- package/public-api.d.ts +1 -0
|
@@ -1090,6 +1090,19 @@ const ENGLISH_TRANSLATIONS = {
|
|
|
1090
1090
|
error: "Error",
|
|
1091
1091
|
success: "Success",
|
|
1092
1092
|
},
|
|
1093
|
+
export: {
|
|
1094
|
+
export: "Export",
|
|
1095
|
+
html: "HTML",
|
|
1096
|
+
markdown: "Markdown",
|
|
1097
|
+
text: "Plain Text",
|
|
1098
|
+
copyHtml: "Copy as HTML",
|
|
1099
|
+
copyMarkdown: "Copy as Markdown",
|
|
1100
|
+
copyText: "Copy as plain text",
|
|
1101
|
+
downloadHtml: "Download .html",
|
|
1102
|
+
downloadMarkdown: "Download .md",
|
|
1103
|
+
downloadText: "Download .txt",
|
|
1104
|
+
copiedSuccess: "Copied to clipboard!",
|
|
1105
|
+
},
|
|
1093
1106
|
};
|
|
1094
1107
|
const FRENCH_TRANSLATIONS = {
|
|
1095
1108
|
toolbar: {
|
|
@@ -1263,6 +1276,19 @@ const FRENCH_TRANSLATIONS = {
|
|
|
1263
1276
|
error: "Erreur",
|
|
1264
1277
|
success: "Succès",
|
|
1265
1278
|
},
|
|
1279
|
+
export: {
|
|
1280
|
+
export: "Exporter",
|
|
1281
|
+
html: "HTML",
|
|
1282
|
+
markdown: "Markdown",
|
|
1283
|
+
text: "Texte brut",
|
|
1284
|
+
copyHtml: "Copier en HTML",
|
|
1285
|
+
copyMarkdown: "Copier en Markdown",
|
|
1286
|
+
copyText: "Copier en texte brut",
|
|
1287
|
+
downloadHtml: "Télécharger .html",
|
|
1288
|
+
downloadMarkdown: "Télécharger .md",
|
|
1289
|
+
downloadText: "Télécharger .txt",
|
|
1290
|
+
copiedSuccess: "Copié dans le presse-papiers !",
|
|
1291
|
+
},
|
|
1266
1292
|
};
|
|
1267
1293
|
class AteI18nService {
|
|
1268
1294
|
constructor() {
|
|
@@ -1285,6 +1311,7 @@ class AteI18nService {
|
|
|
1285
1311
|
this.imageUpload = computed(() => this.translations().imageUpload);
|
|
1286
1312
|
this.editor = computed(() => this.translations().editor);
|
|
1287
1313
|
this.common = computed(() => this.translations().common);
|
|
1314
|
+
this.export = computed(() => this.translations().export);
|
|
1288
1315
|
// Automatically detect browser language
|
|
1289
1316
|
this.detectBrowserLanguage();
|
|
1290
1317
|
}
|
|
@@ -2141,11 +2168,259 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
2141
2168
|
type: Injectable
|
|
2142
2169
|
}] });
|
|
2143
2170
|
|
|
2171
|
+
/**
|
|
2172
|
+
* HTML to Markdown converter utility (no external dependencies).
|
|
2173
|
+
*/
|
|
2174
|
+
function htmlToMarkdown(html) {
|
|
2175
|
+
const parser = new DOMParser();
|
|
2176
|
+
const doc = parser.parseFromString(html, "text/html");
|
|
2177
|
+
const result = convertNode(doc.body, { listDepth: 0, listType: null });
|
|
2178
|
+
// Normalize multiple blank lines to max two
|
|
2179
|
+
return result.replace(/\n{3,}/g, "\n\n").trim();
|
|
2180
|
+
}
|
|
2181
|
+
function convertNode(node, ctx) {
|
|
2182
|
+
if (node.nodeType === Node.TEXT_NODE) {
|
|
2183
|
+
return node.textContent || "";
|
|
2184
|
+
}
|
|
2185
|
+
if (node.nodeType !== Node.ELEMENT_NODE) {
|
|
2186
|
+
return "";
|
|
2187
|
+
}
|
|
2188
|
+
const el = node;
|
|
2189
|
+
const tag = el.tagName.toLowerCase();
|
|
2190
|
+
const children = Array.from(el.childNodes);
|
|
2191
|
+
const inner = (overrideCtx) => children.map(c => convertNode(c, { ...ctx, ...overrideCtx })).join("");
|
|
2192
|
+
// ── Block-level elements ──────────────────────────────────
|
|
2193
|
+
if (tag === "br") {
|
|
2194
|
+
return "\n";
|
|
2195
|
+
}
|
|
2196
|
+
if (tag === "hr") {
|
|
2197
|
+
return "\n\n---\n\n";
|
|
2198
|
+
}
|
|
2199
|
+
if (/^h[1-6]$/.test(tag)) {
|
|
2200
|
+
const level = parseInt(tag[1], 10);
|
|
2201
|
+
const prefix = "#".repeat(level);
|
|
2202
|
+
return `\n\n${prefix} ${inner().trim()}\n\n`;
|
|
2203
|
+
}
|
|
2204
|
+
if (tag === "p") {
|
|
2205
|
+
const content = inner().trim();
|
|
2206
|
+
if (!content) {
|
|
2207
|
+
return "";
|
|
2208
|
+
}
|
|
2209
|
+
return `\n\n${content}\n\n`;
|
|
2210
|
+
}
|
|
2211
|
+
if (tag === "blockquote") {
|
|
2212
|
+
const content = inner()
|
|
2213
|
+
.trim()
|
|
2214
|
+
.split("\n")
|
|
2215
|
+
.map(line => `> ${line}`)
|
|
2216
|
+
.join("\n");
|
|
2217
|
+
return `\n\n${content}\n\n`;
|
|
2218
|
+
}
|
|
2219
|
+
if (tag === "pre") {
|
|
2220
|
+
// Extract language from code class e.g. "language-typescript"
|
|
2221
|
+
const codeEl = el.querySelector("code");
|
|
2222
|
+
const lang = codeEl
|
|
2223
|
+
? (codeEl.className.match(/language-(\S+)/) || [])[1] || ""
|
|
2224
|
+
: "";
|
|
2225
|
+
const code = codeEl ? codeEl.textContent || "" : el.textContent || "";
|
|
2226
|
+
return `\n\n\`\`\`${lang}\n${code}\n\`\`\`\n\n`;
|
|
2227
|
+
}
|
|
2228
|
+
if (tag === "ul" || tag === "ol") {
|
|
2229
|
+
const isTaskList = el.getAttribute("data-type") === "taskList";
|
|
2230
|
+
const items = children
|
|
2231
|
+
.filter(c => c.tagName?.toLowerCase() === "li")
|
|
2232
|
+
.map((li, idx) => convertListItem(li, {
|
|
2233
|
+
listDepth: ctx.listDepth + 1,
|
|
2234
|
+
listType: tag === "ul" ? "ul" : "ol",
|
|
2235
|
+
orderedIndex: idx + 1,
|
|
2236
|
+
isTaskList,
|
|
2237
|
+
}))
|
|
2238
|
+
.join("\n");
|
|
2239
|
+
const block = `\n\n${items}\n\n`;
|
|
2240
|
+
// Only add surrounding newlines for root-level lists
|
|
2241
|
+
return ctx.listDepth === 0 ? block : `\n${items}`;
|
|
2242
|
+
}
|
|
2243
|
+
if (tag === "table") {
|
|
2244
|
+
return convertTable(el);
|
|
2245
|
+
}
|
|
2246
|
+
// ── Inline elements ──────────────────────────────────────
|
|
2247
|
+
if (tag === "strong" || tag === "b") {
|
|
2248
|
+
const content = inner();
|
|
2249
|
+
return content ? `**${content}**` : "";
|
|
2250
|
+
}
|
|
2251
|
+
if (tag === "em" || tag === "i") {
|
|
2252
|
+
const content = inner();
|
|
2253
|
+
return content ? `*${content}*` : "";
|
|
2254
|
+
}
|
|
2255
|
+
if (tag === "s" || tag === "del" || tag === "strike") {
|
|
2256
|
+
const content = inner();
|
|
2257
|
+
return content ? `~~${content}~~` : "";
|
|
2258
|
+
}
|
|
2259
|
+
if (tag === "u") {
|
|
2260
|
+
// No standard Markdown for underline — use HTML passthrough
|
|
2261
|
+
const content = inner();
|
|
2262
|
+
return content ? `<u>${content}</u>` : "";
|
|
2263
|
+
}
|
|
2264
|
+
if (tag === "code") {
|
|
2265
|
+
// Inline code (not inside pre)
|
|
2266
|
+
const content = el.textContent || "";
|
|
2267
|
+
return content ? `\`${content}\`` : "";
|
|
2268
|
+
}
|
|
2269
|
+
if (tag === "a") {
|
|
2270
|
+
const href = el.getAttribute("href") || "";
|
|
2271
|
+
const content = inner().trim();
|
|
2272
|
+
if (!content && !href) {
|
|
2273
|
+
return "";
|
|
2274
|
+
}
|
|
2275
|
+
if (!content) {
|
|
2276
|
+
return href;
|
|
2277
|
+
}
|
|
2278
|
+
return `[${content}](${href})`;
|
|
2279
|
+
}
|
|
2280
|
+
if (tag === "img") {
|
|
2281
|
+
const src = el.getAttribute("src") || "";
|
|
2282
|
+
const alt = el.getAttribute("alt") || "";
|
|
2283
|
+
return ``;
|
|
2284
|
+
}
|
|
2285
|
+
// ── Wrapper / Unknown elements → recurse ─────────────────
|
|
2286
|
+
return inner();
|
|
2287
|
+
}
|
|
2288
|
+
function convertListItem(li, ctx) {
|
|
2289
|
+
const indent = " ".repeat(ctx.listDepth - 1);
|
|
2290
|
+
// Task list item
|
|
2291
|
+
if (ctx.isTaskList) {
|
|
2292
|
+
const checked = li.getAttribute("data-checked") === "true";
|
|
2293
|
+
const checkMark = checked ? "[x]" : "[ ]";
|
|
2294
|
+
const content = Array.from(li.childNodes)
|
|
2295
|
+
.map(c => convertNode(c, { listDepth: ctx.listDepth, listType: ctx.listType }))
|
|
2296
|
+
.join("")
|
|
2297
|
+
.trim();
|
|
2298
|
+
return `${indent}- ${checkMark} ${content}`;
|
|
2299
|
+
}
|
|
2300
|
+
// Normal list item
|
|
2301
|
+
const bullet = ctx.listType === "ol" ? `${ctx.orderedIndex}.` : "-";
|
|
2302
|
+
// Check if li contains nested lists
|
|
2303
|
+
const nestedListNodes = Array.from(li.childNodes).filter(c => c.tagName?.toLowerCase() === "ul" ||
|
|
2304
|
+
c.tagName?.toLowerCase() === "ol");
|
|
2305
|
+
const textNodes = Array.from(li.childNodes).filter(c => !["ul", "ol"].includes(c.tagName?.toLowerCase()));
|
|
2306
|
+
const textContent = textNodes
|
|
2307
|
+
.map(c => convertNode(c, { listDepth: ctx.listDepth, listType: ctx.listType }))
|
|
2308
|
+
.join("")
|
|
2309
|
+
.trim();
|
|
2310
|
+
const nestedContent = nestedListNodes
|
|
2311
|
+
.map(c => convertNode(c, { listDepth: ctx.listDepth, listType: ctx.listType }))
|
|
2312
|
+
.join("")
|
|
2313
|
+
.trimEnd();
|
|
2314
|
+
return `${indent}${bullet} ${textContent}${nestedContent}`;
|
|
2315
|
+
}
|
|
2316
|
+
function convertTable(table) {
|
|
2317
|
+
const rows = Array.from(table.querySelectorAll("tr"));
|
|
2318
|
+
if (rows.length === 0) {
|
|
2319
|
+
return "";
|
|
2320
|
+
}
|
|
2321
|
+
const tableData = rows.map(row => Array.from(row.querySelectorAll("th, td")).map(cell => cell.textContent?.replace(/\n/g, " ").trim() || ""));
|
|
2322
|
+
if (tableData.length === 0) {
|
|
2323
|
+
return "";
|
|
2324
|
+
}
|
|
2325
|
+
const colCount = Math.max(...tableData.map(r => r.length));
|
|
2326
|
+
// Pad rows to same width
|
|
2327
|
+
const normalized = tableData.map(row => {
|
|
2328
|
+
while (row.length < colCount) {
|
|
2329
|
+
row.push("");
|
|
2330
|
+
}
|
|
2331
|
+
return row;
|
|
2332
|
+
});
|
|
2333
|
+
// Calculate column widths
|
|
2334
|
+
const colWidths = Array.from({ length: colCount }, (_, i) => Math.max(...normalized.map(r => (r[i] || "").length), 3));
|
|
2335
|
+
const pad = (str, len) => str.padEnd(len, " ");
|
|
2336
|
+
const separator = colWidths.map(w => "-".repeat(w)).join(" | ");
|
|
2337
|
+
// Build rows
|
|
2338
|
+
const lines = [];
|
|
2339
|
+
normalized.forEach((row, rowIdx) => {
|
|
2340
|
+
const line = row.map((cell, i) => pad(cell, colWidths[i])).join(" | ");
|
|
2341
|
+
lines.push(`| ${line} |`);
|
|
2342
|
+
// Add separator after header row (first row)
|
|
2343
|
+
if (rowIdx === 0) {
|
|
2344
|
+
lines.push(`| ${separator} |`);
|
|
2345
|
+
}
|
|
2346
|
+
});
|
|
2347
|
+
return `\n\n${lines.join("\n")}\n\n`;
|
|
2348
|
+
}
|
|
2349
|
+
|
|
2350
|
+
class AteExportService {
|
|
2351
|
+
// ============================================================
|
|
2352
|
+
// Public Content Getters
|
|
2353
|
+
// ============================================================
|
|
2354
|
+
/** Returns the editor content as HTML string. */
|
|
2355
|
+
getHtml(editor) {
|
|
2356
|
+
return editor.getHTML();
|
|
2357
|
+
}
|
|
2358
|
+
/** Returns the editor content as plain text. */
|
|
2359
|
+
getText(editor) {
|
|
2360
|
+
return editor.getText();
|
|
2361
|
+
}
|
|
2362
|
+
/** Returns the editor content converted to Markdown. */
|
|
2363
|
+
getMarkdown(editor) {
|
|
2364
|
+
const html = editor.getHTML();
|
|
2365
|
+
return htmlToMarkdown(html);
|
|
2366
|
+
}
|
|
2367
|
+
/** Returns the editor content in the specified format. */
|
|
2368
|
+
getContent(editor, format) {
|
|
2369
|
+
switch (format) {
|
|
2370
|
+
case "html":
|
|
2371
|
+
return this.getHtml(editor);
|
|
2372
|
+
case "markdown":
|
|
2373
|
+
return this.getMarkdown(editor);
|
|
2374
|
+
case "text":
|
|
2375
|
+
return this.getText(editor);
|
|
2376
|
+
}
|
|
2377
|
+
}
|
|
2378
|
+
// ============================================================
|
|
2379
|
+
// Export Methods
|
|
2380
|
+
// ============================================================
|
|
2381
|
+
/** Copies the editor content to the clipboard. */
|
|
2382
|
+
async exportToClipboard(editor, format) {
|
|
2383
|
+
const content = this.getContent(editor, format);
|
|
2384
|
+
await navigator.clipboard.writeText(content);
|
|
2385
|
+
}
|
|
2386
|
+
/** Downloads the editor content as a file. */
|
|
2387
|
+
exportToFile(editor, format, options) {
|
|
2388
|
+
const content = this.getContent(editor, format);
|
|
2389
|
+
const baseName = options?.filename || "document";
|
|
2390
|
+
const extensions = {
|
|
2391
|
+
html: "html",
|
|
2392
|
+
markdown: "md",
|
|
2393
|
+
text: "txt",
|
|
2394
|
+
};
|
|
2395
|
+
const mimeTypes = {
|
|
2396
|
+
html: "text/html;charset=utf-8",
|
|
2397
|
+
markdown: "text/markdown;charset=utf-8",
|
|
2398
|
+
text: "text/plain;charset=utf-8",
|
|
2399
|
+
};
|
|
2400
|
+
const filename = `${baseName}.${extensions[format]}`;
|
|
2401
|
+
const blob = new Blob([content], { type: mimeTypes[format] });
|
|
2402
|
+
const url = URL.createObjectURL(blob);
|
|
2403
|
+
const link = document.createElement("a");
|
|
2404
|
+
link.href = url;
|
|
2405
|
+
link.download = filename;
|
|
2406
|
+
document.body.appendChild(link);
|
|
2407
|
+
link.click();
|
|
2408
|
+
document.body.removeChild(link);
|
|
2409
|
+
URL.revokeObjectURL(url);
|
|
2410
|
+
}
|
|
2411
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AteExportService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
2412
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AteExportService }); }
|
|
2413
|
+
}
|
|
2414
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AteExportService, decorators: [{
|
|
2415
|
+
type: Injectable
|
|
2416
|
+
}] });
|
|
2417
|
+
|
|
2144
2418
|
class AteEditorCommandsService {
|
|
2145
2419
|
constructor() {
|
|
2146
2420
|
this.imageService = inject(AteImageService);
|
|
2147
2421
|
this.colorPickerSvc = inject(AteColorPickerService);
|
|
2148
2422
|
this.linkSvc = inject(AteLinkService);
|
|
2423
|
+
this.exportSvc = inject(AteExportService);
|
|
2149
2424
|
this._editorState = signal(ATE_INITIAL_EDITOR_STATE, {
|
|
2150
2425
|
equal: (a, b) => {
|
|
2151
2426
|
// 1. Primitive global states
|
|
@@ -2353,6 +2628,9 @@ class AteEditorCommandsService {
|
|
|
2353
2628
|
case "clearContent":
|
|
2354
2629
|
this.clearContent(editor);
|
|
2355
2630
|
break;
|
|
2631
|
+
case "exportAs":
|
|
2632
|
+
void this.exportAs(editor, args[0], args[1], args[2]);
|
|
2633
|
+
break;
|
|
2356
2634
|
}
|
|
2357
2635
|
}
|
|
2358
2636
|
// --- Formatting Commands ---
|
|
@@ -2545,6 +2823,34 @@ class AteEditorCommandsService {
|
|
|
2545
2823
|
}
|
|
2546
2824
|
editor.commands.clearContent(true);
|
|
2547
2825
|
}
|
|
2826
|
+
// --- Export Commands ---
|
|
2827
|
+
/**
|
|
2828
|
+
* Returns the editor content in the given format.
|
|
2829
|
+
* @param format 'html' | 'markdown' | 'text'
|
|
2830
|
+
*/
|
|
2831
|
+
getContent(editor, format) {
|
|
2832
|
+
if (!editor) {
|
|
2833
|
+
return "";
|
|
2834
|
+
}
|
|
2835
|
+
return this.exportSvc.getContent(editor, format);
|
|
2836
|
+
}
|
|
2837
|
+
/**
|
|
2838
|
+
* Exports the editor content.
|
|
2839
|
+
* @param format 'html' | 'markdown' | 'text'
|
|
2840
|
+
* @param method 'clipboard' | 'download'
|
|
2841
|
+
* @param options Optional filename for download
|
|
2842
|
+
*/
|
|
2843
|
+
async exportAs(editor, format, method, options) {
|
|
2844
|
+
if (!editor) {
|
|
2845
|
+
return;
|
|
2846
|
+
}
|
|
2847
|
+
if (method === "clipboard") {
|
|
2848
|
+
await this.exportSvc.exportToClipboard(editor, format);
|
|
2849
|
+
}
|
|
2850
|
+
else {
|
|
2851
|
+
this.exportSvc.exportToFile(editor, format, options);
|
|
2852
|
+
}
|
|
2853
|
+
}
|
|
2548
2854
|
focus(editor) {
|
|
2549
2855
|
if (!editor) {
|
|
2550
2856
|
return;
|
|
@@ -7657,7 +7963,7 @@ class AngularTiptapEditorComponent {
|
|
|
7657
7963
|
}
|
|
7658
7964
|
}
|
|
7659
7965
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: AngularTiptapEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
7660
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AngularTiptapEditorComponent, isStandalone: true, selector: "angular-tiptap-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, fillContainer: { classPropertyName: "fillContainer", publicName: "fillContainer", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, showCharacterCount: { classPropertyName: "showCharacterCount", publicName: "showCharacterCount", isSignal: true, isRequired: false, transformFunction: null }, showWordCount: { classPropertyName: "showWordCount", publicName: "showWordCount", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, enableOfficePaste: { classPropertyName: "enableOfficePaste", publicName: "enableOfficePaste", isSignal: true, isRequired: false, transformFunction: null }, enableSlashCommands: { classPropertyName: "enableSlashCommands", publicName: "enableSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, slashCommands: { classPropertyName: "slashCommands", publicName: "slashCommands", isSignal: true, isRequired: false, transformFunction: null }, customSlashCommands: { classPropertyName: "customSlashCommands", publicName: "customSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, blockControls: { classPropertyName: "blockControls", publicName: "blockControls", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, seamless: { classPropertyName: "seamless", publicName: "seamless", isSignal: true, isRequired: false, transformFunction: null }, floatingToolbar: { classPropertyName: "floatingToolbar", publicName: "floatingToolbar", isSignal: true, isRequired: false, transformFunction: null }, showEditToggle: { classPropertyName: "showEditToggle", publicName: "showEditToggle", isSignal: true, isRequired: false, transformFunction: null }, spellcheck: { classPropertyName: "spellcheck", publicName: "spellcheck", isSignal: true, isRequired: false, transformFunction: null }, tiptapExtensions: { classPropertyName: "tiptapExtensions", publicName: "tiptapExtensions", isSignal: true, isRequired: false, transformFunction: null }, tiptapOptions: { classPropertyName: "tiptapOptions", publicName: "tiptapOptions", isSignal: true, isRequired: false, transformFunction: null }, showBubbleMenu: { classPropertyName: "showBubbleMenu", publicName: "showBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, bubbleMenu: { classPropertyName: "bubbleMenu", publicName: "bubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showImageBubbleMenu: { classPropertyName: "showImageBubbleMenu", publicName: "showImageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, imageBubbleMenu: { classPropertyName: "imageBubbleMenu", publicName: "imageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, showTableBubbleMenu: { classPropertyName: "showTableBubbleMenu", publicName: "showTableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, tableBubbleMenu: { classPropertyName: "tableBubbleMenu", publicName: "tableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showCellBubbleMenu: { classPropertyName: "showCellBubbleMenu", publicName: "showCellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, cellBubbleMenu: { classPropertyName: "cellBubbleMenu", publicName: "cellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, stateCalculators: { classPropertyName: "stateCalculators", publicName: "stateCalculators", isSignal: true, isRequired: false, transformFunction: null }, imageUpload: { classPropertyName: "imageUpload", publicName: "imageUpload", isSignal: true, isRequired: false, transformFunction: null }, imageUploadHandler: { classPropertyName: "imageUploadHandler", publicName: "imageUploadHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange", editorCreated: "editorCreated", editorUpdate: "editorUpdate", editorFocus: "editorFocus", editorBlur: "editorBlur", editableChange: "editableChange" }, host: { properties: { "class.fill-container": "finalFillContainer()", "class.floating-toolbar": "finalFloatingToolbar()", "class.is-readonly": "!finalEditable() && !mergedDisabled()", "class.is-disabled": "mergedDisabled()", "style.--ate-border-width": "finalSeamless() || mergedDisabled() ? '0' : null", "style.--ate-background": "finalSeamless() ? 'transparent' : (mergedDisabled() ? 'var(--ate-surface-tertiary)' : null)", "style.--ate-toolbar-border-color": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-background": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-border-color": "finalSeamless() ? 'transparent' : null", "class.dark": "config().theme === 'dark'", "class.ate-blocks-inside": "finalBlockControls() === 'inside'", "class.ate-blocks-outside": "finalBlockControls() === 'outside'", "attr.data-theme": "config().theme" } }, providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService], viewQueries: [{ propertyName: "editorElement", first: true, predicate: ["editorElement"], descendants: true, isSignal: true }], hostDirectives: [{ directive: AteNoopValueAccessorDirective }], ngImport: i0, template: `
|
|
7966
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: AngularTiptapEditorComponent, isStandalone: true, selector: "angular-tiptap-editor", inputs: { config: { classPropertyName: "config", publicName: "config", isSignal: true, isRequired: false, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, editable: { classPropertyName: "editable", publicName: "editable", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, height: { classPropertyName: "height", publicName: "height", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, fillContainer: { classPropertyName: "fillContainer", publicName: "fillContainer", isSignal: true, isRequired: false, transformFunction: null }, showToolbar: { classPropertyName: "showToolbar", publicName: "showToolbar", isSignal: true, isRequired: false, transformFunction: null }, showFooter: { classPropertyName: "showFooter", publicName: "showFooter", isSignal: true, isRequired: false, transformFunction: null }, showCharacterCount: { classPropertyName: "showCharacterCount", publicName: "showCharacterCount", isSignal: true, isRequired: false, transformFunction: null }, showWordCount: { classPropertyName: "showWordCount", publicName: "showWordCount", isSignal: true, isRequired: false, transformFunction: null }, maxCharacters: { classPropertyName: "maxCharacters", publicName: "maxCharacters", isSignal: true, isRequired: false, transformFunction: null }, enableOfficePaste: { classPropertyName: "enableOfficePaste", publicName: "enableOfficePaste", isSignal: true, isRequired: false, transformFunction: null }, enableSlashCommands: { classPropertyName: "enableSlashCommands", publicName: "enableSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, slashCommands: { classPropertyName: "slashCommands", publicName: "slashCommands", isSignal: true, isRequired: false, transformFunction: null }, customSlashCommands: { classPropertyName: "customSlashCommands", publicName: "customSlashCommands", isSignal: true, isRequired: false, transformFunction: null }, blockControls: { classPropertyName: "blockControls", publicName: "blockControls", isSignal: true, isRequired: false, transformFunction: null }, locale: { classPropertyName: "locale", publicName: "locale", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, seamless: { classPropertyName: "seamless", publicName: "seamless", isSignal: true, isRequired: false, transformFunction: null }, floatingToolbar: { classPropertyName: "floatingToolbar", publicName: "floatingToolbar", isSignal: true, isRequired: false, transformFunction: null }, showEditToggle: { classPropertyName: "showEditToggle", publicName: "showEditToggle", isSignal: true, isRequired: false, transformFunction: null }, spellcheck: { classPropertyName: "spellcheck", publicName: "spellcheck", isSignal: true, isRequired: false, transformFunction: null }, tiptapExtensions: { classPropertyName: "tiptapExtensions", publicName: "tiptapExtensions", isSignal: true, isRequired: false, transformFunction: null }, tiptapOptions: { classPropertyName: "tiptapOptions", publicName: "tiptapOptions", isSignal: true, isRequired: false, transformFunction: null }, showBubbleMenu: { classPropertyName: "showBubbleMenu", publicName: "showBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, bubbleMenu: { classPropertyName: "bubbleMenu", publicName: "bubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showImageBubbleMenu: { classPropertyName: "showImageBubbleMenu", publicName: "showImageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, imageBubbleMenu: { classPropertyName: "imageBubbleMenu", publicName: "imageBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, toolbar: { classPropertyName: "toolbar", publicName: "toolbar", isSignal: true, isRequired: false, transformFunction: null }, showTableBubbleMenu: { classPropertyName: "showTableBubbleMenu", publicName: "showTableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, tableBubbleMenu: { classPropertyName: "tableBubbleMenu", publicName: "tableBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, showCellBubbleMenu: { classPropertyName: "showCellBubbleMenu", publicName: "showCellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, cellBubbleMenu: { classPropertyName: "cellBubbleMenu", publicName: "cellBubbleMenu", isSignal: true, isRequired: false, transformFunction: null }, stateCalculators: { classPropertyName: "stateCalculators", publicName: "stateCalculators", isSignal: true, isRequired: false, transformFunction: null }, imageUpload: { classPropertyName: "imageUpload", publicName: "imageUpload", isSignal: true, isRequired: false, transformFunction: null }, imageUploadHandler: { classPropertyName: "imageUploadHandler", publicName: "imageUploadHandler", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { contentChange: "contentChange", editorCreated: "editorCreated", editorUpdate: "editorUpdate", editorFocus: "editorFocus", editorBlur: "editorBlur", editableChange: "editableChange" }, host: { properties: { "class.fill-container": "finalFillContainer()", "class.floating-toolbar": "finalFloatingToolbar()", "class.is-readonly": "!finalEditable() && !mergedDisabled()", "class.is-disabled": "mergedDisabled()", "style.--ate-border-width": "finalSeamless() || mergedDisabled() ? '0' : null", "style.--ate-background": "finalSeamless() ? 'transparent' : (mergedDisabled() ? 'var(--ate-surface-tertiary)' : null)", "style.--ate-toolbar-border-color": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-background": "finalSeamless() ? 'transparent' : null", "style.--ate-counter-border-color": "finalSeamless() ? 'transparent' : null", "class.dark": "config().theme === 'dark'", "class.ate-blocks-inside": "finalBlockControls() === 'inside'", "class.ate-blocks-outside": "finalBlockControls() === 'outside'", "attr.data-theme": "config().theme" } }, providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService, AteExportService], viewQueries: [{ propertyName: "editorElement", first: true, predicate: ["editorElement"], descendants: true, isSignal: true }], hostDirectives: [{ directive: AteNoopValueAccessorDirective }], ngImport: i0, template: `
|
|
7661
7967
|
<div class="ate-editor">
|
|
7662
7968
|
<!-- Toolbar -->
|
|
7663
7969
|
@if (finalEditable() && !mergedDisabled() && finalShowToolbar() && editor()) {
|
|
@@ -7812,7 +8118,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImpo
|
|
|
7812
8118
|
AteColorBubbleMenuComponent,
|
|
7813
8119
|
AteEditToggleComponent,
|
|
7814
8120
|
AteBlockControlsComponent,
|
|
7815
|
-
], providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService], template: `
|
|
8121
|
+
], providers: [AteEditorCommandsService, AteImageService, AteColorPickerService, AteLinkService, AteExportService], template: `
|
|
7816
8122
|
<div class="ate-editor">
|
|
7817
8123
|
<!-- Toolbar -->
|
|
7818
8124
|
@if (finalEditable() && !mergedDisabled() && finalShowToolbar() && editor()) {
|
|
@@ -8020,5 +8326,5 @@ const ATE_TOOLBAR_KEYS = [
|
|
|
8020
8326
|
* Generated bundle index. Do not edit.
|
|
8021
8327
|
*/
|
|
8022
8328
|
|
|
8023
|
-
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_IMAGE_UPLOAD_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteTooltipDirective, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
8329
|
+
export { ATE_BUBBLE_MENU_KEYS, ATE_CELL_BUBBLE_MENU_KEYS, ATE_DEFAULT_BUBBLE_MENU_CONFIG, ATE_DEFAULT_CELL_MENU_CONFIG, ATE_DEFAULT_CONFIG, ATE_DEFAULT_IMAGE_BUBBLE_MENU_CONFIG, ATE_DEFAULT_IMAGE_UPLOAD_CONFIG, ATE_DEFAULT_SLASH_COMMANDS_CONFIG, ATE_DEFAULT_TABLE_MENU_CONFIG, ATE_DEFAULT_TOOLBAR_CONFIG, ATE_GLOBAL_CONFIG, ATE_IMAGE_BUBBLE_MENU_KEYS, ATE_INITIAL_EDITOR_STATE, ATE_SLASH_COMMAND_KEYS, ATE_TABLE_BUBBLE_MENU_KEYS, ATE_TOOLBAR_KEYS, AngularTiptapEditorComponent, AteAngularNodeView, AteColorPickerService, AteDiscoveryCalculator, AteEditorCommandsService, AteExportService, AteI18nService, AteImageCalculator, AteImageService, AteLinkService, AteMarksCalculator, AteNodeViewRenderer, AteNoopValueAccessorDirective, AteSelectionCalculator, AteStructureCalculator, AteTableCalculator, AteTooltipDirective, createAngularComponentExtension, createDefaultSlashCommands, filterSlashCommands, provideAteEditor, registerAngularComponent };
|
|
8024
8330
|
//# sourceMappingURL=flogeez-angular-tiptap-editor.mjs.map
|