wysiwygido 1.1.0 → 1.2.0
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 +4 -0
- package/README.md +2 -0
- package/dist/adapter.js +1 -1
- package/dist/plugins/collapsible-headings.d.ts +11 -0
- package/dist/plugins/index.d.ts +1 -0
- package/dist/react.js +1 -1
- package/dist/{src-DKhqZoJn.js → src-BNH7F1TH.js} +302 -2
- package/dist/src-BNH7F1TH.js.map +1 -0
- package/dist/style.css +13 -0
- package/dist/vue.js +1 -1
- package/dist/wysiwygido.js +2 -2
- package/package.json +1 -1
- package/dist/src-DKhqZoJn.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project are documented here. The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/) and the project uses [Semantic Versioning](https://semver.org/). Before 1.0.0 minor versions could contain breaking changes. From 1.0.0 on, only a major version may break the public API (see "Stability and versioning" in the README); changes are listed under "Changed" or "Removed".
|
|
4
4
|
|
|
5
|
+
## 1.2.0
|
|
6
|
+
|
|
7
|
+
- Added: **collapsible headings** (`CollapsibleHeadings`, in `defaultPlugins`): an arrow in the margin of every top-level heading hides the text under it up to the next heading of the same or a higher level, like Word. Commands `toggleHeadingFold`, `collapseHeadings`, `expandHeadings`, `showHeadingLevel(n)`; right-click menu, ribbon (View → Headings) and shortcuts included. The document is not changed and the pages are laid out again without the hidden text.
|
|
8
|
+
|
|
5
9
|
## 1.1.0
|
|
6
10
|
|
|
7
11
|
The first release published to npm since 0.4.0: it contains everything in 1.0.0 below plus the following.
|
package/README.md
CHANGED
|
@@ -161,6 +161,8 @@ Markdown), so exports show it. A reference to a deleted caption says "Missing re
|
|
|
161
161
|
|
|
162
162
|
**Columns**: `Columns()` flows blocks into 2–4 newspaper columns (`insertColumns(n)` wraps the selection, `setColumns({ count, rule, gap })`, `removeColumns`). `setDocumentColumns(count)` puts the whole page (below a leading heading) in columns and `insertColumnBreak` starts the next column. Columns collapse to one on narrow screens. Word export writes every top-level columns block as its own continuous **section** with the real column count, gap and rule (text before and after stays single-column; headers and footers stay on the first section); Markdown flows the text in one column. Columns nested inside columns are flattened in Word.
|
|
163
163
|
|
|
164
|
+
**Collapsible headings**: `CollapsibleHeadings` (in `defaultPlugins`) puts a small arrow in the margin left of every top-level heading, as in Word: a click hides everything up to the next heading of the same or a higher level and shows "…" after the title, and a click again opens it. Commands: `toggleHeadingFold` (the heading at the cursor, or the nearest one above it), `collapseHeadings`, `expandHeadings` and `showHeadingLevel(n)` (only the headings down to level `n` stay open); they are also in the right-click menu on a heading and in the ribbon under View → Headings. Shortcuts: Ctrl/Cmd + Alt + Up collapses, Ctrl/Cmd + Alt + Down expands everything. Nothing is removed from the document: the HTML, undo, export and print are unchanged, the pages are laid out again without the hidden text, and a cursor that moves into hidden text (search, undo, the outline) opens that section. Which headings are collapsed is view state: it is not saved with the document.
|
|
165
|
+
|
|
164
166
|
**Charts**: `Charts()` draws bar, line and pie charts as SVG. With the cursor in a table, `insertChart('bar' | 'line' | 'pie')` uses the first row as series and the first column as labels (numbers like `1,200`, `$40` or `12%` are understood); `insertChart(type, { labels, series })` takes data directly and `setChart` changes the selected chart. The chart is saved as validated data (never markup) and redrawn on load; Word export writes it as a picture (needs a browser canvas) and Markdown as a table.
|
|
165
167
|
|
|
166
168
|
**Recording and dictation**: `Recording()` adds `recordAudio`, `recordScreen`, `stopRecording`, `cancelRecording` and `toggleDictation`. The browser asks permission each time, a bar shows the time while recording, Esc cancels and the tracks are always released. A recording becomes a player in the text, embedded as a data URL (capped by `maxBytes`) or stored by your `upload(blob, kind)` function (recommended for anything long); `maxSeconds` stops it automatically. Dictation uses the browser's speech recognition (Chrome, Edge, Safari; not Firefox), types only text at the cursor, and can be set to a language with `dictationLang`. Word and Markdown export keep a link or label, not the media.
|
package/dist/adapter.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createEditor } from "./src-
|
|
1
|
+
import { t as createEditor } from "./src-BNH7F1TH.js";
|
|
2
2
|
//#region src/adapter.ts
|
|
3
3
|
/**
|
|
4
4
|
* Framework-neutral binding for anything that needs a "value in, value out" control: Angular's `ControlValueAccessor`, Svelte, Solid,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { EditorPlugin } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Collapse and expand the text under a heading, like the arrow next to a heading in Word. A small arrow appears left of every
|
|
4
|
+
* top-level heading (on hover, always on touch screens); a click hides everything up to the next heading of the same or a higher level
|
|
5
|
+
* and shows "…" after the title. Nothing is removed: the document, undo, export and print are unchanged, and a cursor that moves into
|
|
6
|
+
* hidden text (search, undo, the outline) opens the section.
|
|
7
|
+
*
|
|
8
|
+
* Commands: `toggleHeadingFold`, `collapseHeadings`, `expandHeadings`, `showHeadingLevel(n)` (only the headings down to level `n`
|
|
9
|
+
* are shown, as "Show Level" in Word: the headings of level `n` and deeper are collapsed), `isHeadingFolded`. Shortcuts: Mod-Alt-ArrowUp collapses, Mod-Alt-ArrowDown expands.
|
|
10
|
+
*/
|
|
11
|
+
export declare const CollapsibleHeadings: EditorPlugin;
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export { TaskList } from './task-list.js';
|
|
|
19
19
|
export { Pages, paginate, PAGE_SIZES } from './pages.js';
|
|
20
20
|
export type { PageOptions, PageSizeName, Margins, BlockMetric, PaginationResult } from './pages.js';
|
|
21
21
|
export { Outline, getOutline } from './outline.js';
|
|
22
|
+
export { CollapsibleHeadings } from './collapsible-headings.js';
|
|
22
23
|
export type { OutlineItem } from './outline.js';
|
|
23
24
|
export { FindReplace, findMatches } from './find-replace.js';
|
|
24
25
|
export type { Match } from './find-replace.js';
|
package/dist/react.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as createEditor } from "./src-
|
|
1
|
+
import { t as createEditor } from "./src-BNH7F1TH.js";
|
|
2
2
|
import { createElement, forwardRef, useEffect, useImperativeHandle, useLayoutEffect, useRef } from "react";
|
|
3
3
|
//#region src/react.ts
|
|
4
4
|
/** React wrapper (needs the optional `react` peer dependency). */
|
|
@@ -7458,6 +7458,7 @@ function Pages(options = {}) {
|
|
|
7458
7458
|
const dom = view.nodeDOM(offset);
|
|
7459
7459
|
if (!(dom instanceof HTMLElement)) return;
|
|
7460
7460
|
const cs = getComputedStyle(dom);
|
|
7461
|
+
if (cs.display === "none") return;
|
|
7461
7462
|
const rect = dom.getBoundingClientRect();
|
|
7462
7463
|
const mb = parseFloat(cs.marginBottom) || 0;
|
|
7463
7464
|
const isTable = node.type.name === "table";
|
|
@@ -7721,6 +7722,304 @@ var Outline = {
|
|
|
7721
7722
|
}
|
|
7722
7723
|
};
|
|
7723
7724
|
//#endregion
|
|
7725
|
+
//#region src/plugins/collapsible-headings.ts
|
|
7726
|
+
/** How far left of a heading the arrow sits, in pixels from its edge (clicks in this strip toggle the section). */
|
|
7727
|
+
var GUTTER = 40;
|
|
7728
|
+
var key$5 = new PluginKey("collapsible-headings");
|
|
7729
|
+
var isHeading = (n) => !!n && n.type.name === "heading";
|
|
7730
|
+
/** The blocks under the heading at `pos`: from just after it to the next heading of the same or a higher level (or the end). */
|
|
7731
|
+
function sectionOf(doc, pos) {
|
|
7732
|
+
const heading = doc.nodeAt(pos);
|
|
7733
|
+
if (!isHeading(heading) || doc.resolve(pos).depth !== 0) return null;
|
|
7734
|
+
const from = pos + heading.nodeSize;
|
|
7735
|
+
let to = from;
|
|
7736
|
+
let at = from;
|
|
7737
|
+
for (let i = doc.resolve(from).index(0); i < doc.childCount; i++) {
|
|
7738
|
+
const child = doc.child(i);
|
|
7739
|
+
if (isHeading(child) && child.attrs.level <= heading.attrs.level) break;
|
|
7740
|
+
at += child.nodeSize;
|
|
7741
|
+
to = at;
|
|
7742
|
+
}
|
|
7743
|
+
return {
|
|
7744
|
+
from,
|
|
7745
|
+
to
|
|
7746
|
+
};
|
|
7747
|
+
}
|
|
7748
|
+
/** Top-level headings with their positions. */
|
|
7749
|
+
function headingsOf(doc) {
|
|
7750
|
+
const out = [];
|
|
7751
|
+
doc.forEach((n, offset) => {
|
|
7752
|
+
if (isHeading(n)) out.push({
|
|
7753
|
+
pos: offset,
|
|
7754
|
+
level: n.attrs.level
|
|
7755
|
+
});
|
|
7756
|
+
});
|
|
7757
|
+
return out;
|
|
7758
|
+
}
|
|
7759
|
+
function build(doc, folded) {
|
|
7760
|
+
if (!folded.length) return DecorationSet.empty;
|
|
7761
|
+
const decos = [];
|
|
7762
|
+
let hiddenUntil = 0;
|
|
7763
|
+
for (const pos of [...folded].sort((a, b) => a - b)) {
|
|
7764
|
+
const heading = doc.nodeAt(pos);
|
|
7765
|
+
if (!isHeading(heading)) continue;
|
|
7766
|
+
if (pos >= hiddenUntil) decos.push(Decoration.node(pos, pos + heading.nodeSize, { class: "wy-heading-folded" }));
|
|
7767
|
+
const s = sectionOf(doc, pos);
|
|
7768
|
+
if (!s) continue;
|
|
7769
|
+
let at = s.from;
|
|
7770
|
+
while (at < s.to) {
|
|
7771
|
+
const n = doc.nodeAt(at);
|
|
7772
|
+
if (at >= hiddenUntil) decos.push(Decoration.node(at, at + n.nodeSize, { class: "wy-heading-hidden" }));
|
|
7773
|
+
at += n.nodeSize;
|
|
7774
|
+
}
|
|
7775
|
+
hiddenUntil = Math.max(hiddenUntil, s.to);
|
|
7776
|
+
}
|
|
7777
|
+
return DecorationSet.create(doc, decos);
|
|
7778
|
+
}
|
|
7779
|
+
/** The folded headings that hide `pos`, if any (a position in a hidden block). */
|
|
7780
|
+
function hidingHeadings(state, pos) {
|
|
7781
|
+
const fs = key$5.getState(state);
|
|
7782
|
+
if (!fs?.folded.length) return [];
|
|
7783
|
+
const out = [];
|
|
7784
|
+
for (const h of fs.folded) {
|
|
7785
|
+
const s = sectionOf(state.doc, h);
|
|
7786
|
+
if (s && pos >= s.from && pos < s.to) out.push(h);
|
|
7787
|
+
}
|
|
7788
|
+
return out;
|
|
7789
|
+
}
|
|
7790
|
+
var foldedPositions = (state) => key$5.getState(state)?.folded ?? [];
|
|
7791
|
+
function setFolded(state, next, tr = state.tr) {
|
|
7792
|
+
return tr.setMeta(key$5, { set: [...new Set(next)] }).setMeta("addToHistory", false);
|
|
7793
|
+
}
|
|
7794
|
+
/** The heading a command acts on: the one the cursor is in, else the nearest one above it. */
|
|
7795
|
+
function headingAt(state) {
|
|
7796
|
+
const { $from } = state.selection;
|
|
7797
|
+
if ($from.depth === 0) return null;
|
|
7798
|
+
const top = $from.before(1);
|
|
7799
|
+
if (isHeading(state.doc.nodeAt(top))) return top;
|
|
7800
|
+
let found = null;
|
|
7801
|
+
state.doc.forEach((n, offset) => {
|
|
7802
|
+
if (offset < top && isHeading(n)) found = offset;
|
|
7803
|
+
});
|
|
7804
|
+
return found;
|
|
7805
|
+
}
|
|
7806
|
+
/** Folds, unfolds or toggles (`fold` undefined) the section of the heading at `pos`. False when there is no such heading. */
|
|
7807
|
+
function toggleAt(state, pos, fold, dispatch) {
|
|
7808
|
+
const heading = state.doc.nodeAt(pos);
|
|
7809
|
+
if (!isHeading(heading) || state.doc.resolve(pos).depth !== 0) return false;
|
|
7810
|
+
const now = foldedPositions(state);
|
|
7811
|
+
const isFolded = now.includes(pos);
|
|
7812
|
+
const want = fold ?? !isFolded;
|
|
7813
|
+
if (want === isFolded) return true;
|
|
7814
|
+
if (dispatch) {
|
|
7815
|
+
let tr = setFolded(state, want ? [...now, pos] : now.filter((p) => p !== pos));
|
|
7816
|
+
if (want) {
|
|
7817
|
+
const s = sectionOf(state.doc, pos);
|
|
7818
|
+
const head = state.selection.head;
|
|
7819
|
+
if (s && head >= s.from && head < s.to) tr = tr.setSelection(TextSelection.near(state.doc.resolve(pos + heading.nodeSize - 1), -1));
|
|
7820
|
+
}
|
|
7821
|
+
dispatch(tr);
|
|
7822
|
+
}
|
|
7823
|
+
return true;
|
|
7824
|
+
}
|
|
7825
|
+
/**
|
|
7826
|
+
* Collapse and expand the text under a heading, like the arrow next to a heading in Word. A small arrow appears left of every
|
|
7827
|
+
* top-level heading (on hover, always on touch screens); a click hides everything up to the next heading of the same or a higher level
|
|
7828
|
+
* and shows "…" after the title. Nothing is removed: the document, undo, export and print are unchanged, and a cursor that moves into
|
|
7829
|
+
* hidden text (search, undo, the outline) opens the section.
|
|
7830
|
+
*
|
|
7831
|
+
* Commands: `toggleHeadingFold`, `collapseHeadings`, `expandHeadings`, `showHeadingLevel(n)` (only the headings down to level `n`
|
|
7832
|
+
* are shown, as "Show Level" in Word: the headings of level `n` and deeper are collapsed), `isHeadingFolded`. Shortcuts: Mod-Alt-ArrowUp collapses, Mod-Alt-ArrowDown expands.
|
|
7833
|
+
*/
|
|
7834
|
+
var CollapsibleHeadings = {
|
|
7835
|
+
name: "collapsibleHeadings",
|
|
7836
|
+
requires: ["heading"],
|
|
7837
|
+
setup(editor) {
|
|
7838
|
+
editor.registerCommand("toggleHeadingFold", (e) => {
|
|
7839
|
+
const pos = headingAt(e.view.state);
|
|
7840
|
+
return pos === null ? false : toggleAt(e.view.state, pos, void 0, (tr) => e.view.dispatch(tr));
|
|
7841
|
+
}, { readOnlySafe: true });
|
|
7842
|
+
editor.registerCommand("collapseHeadings", (e, level) => {
|
|
7843
|
+
const state = e.view.state;
|
|
7844
|
+
const all = headingsOf(state.doc).filter((h) => level === void 0 || h.level >= level);
|
|
7845
|
+
if (!all.length && level === void 0) return false;
|
|
7846
|
+
let tr = setFolded(state, level === void 0 ? all.map((h) => h.pos) : all.map((h) => h.pos));
|
|
7847
|
+
const head = state.selection.head;
|
|
7848
|
+
if (all.some((h) => {
|
|
7849
|
+
const s = sectionOf(state.doc, h.pos);
|
|
7850
|
+
return s && head >= s.from && head < s.to;
|
|
7851
|
+
})) {
|
|
7852
|
+
const before = [...all].reverse().find((h) => h.pos < head) ?? all[0];
|
|
7853
|
+
const node = state.doc.nodeAt(before.pos);
|
|
7854
|
+
tr = tr.setSelection(TextSelection.near(state.doc.resolve(before.pos + node.nodeSize - 1), -1));
|
|
7855
|
+
}
|
|
7856
|
+
e.view.dispatch(tr);
|
|
7857
|
+
return true;
|
|
7858
|
+
}, { readOnlySafe: true });
|
|
7859
|
+
editor.registerCommand("expandHeadings", (e) => {
|
|
7860
|
+
const state = e.view.state;
|
|
7861
|
+
if (!foldedPositions(state).length) return true;
|
|
7862
|
+
e.view.dispatch(setFolded(state, []));
|
|
7863
|
+
return true;
|
|
7864
|
+
}, { readOnlySafe: true });
|
|
7865
|
+
editor.registerCommand("showHeadingLevel", (e, level) => {
|
|
7866
|
+
const n = Math.max(1, Math.min(6, Math.round(Number(level)) || 1));
|
|
7867
|
+
const state = e.view.state;
|
|
7868
|
+
const heads = headingsOf(state.doc);
|
|
7869
|
+
const fold = heads.filter((h) => h.level >= n).map((h) => h.pos);
|
|
7870
|
+
const sel = state.selection.head;
|
|
7871
|
+
let tr = setFolded(state, fold);
|
|
7872
|
+
if (fold.some((p) => {
|
|
7873
|
+
const s = sectionOf(state.doc, p);
|
|
7874
|
+
return s && sel >= s.from && sel < s.to;
|
|
7875
|
+
})) {
|
|
7876
|
+
const before = [...heads].reverse().find((h) => h.pos < sel);
|
|
7877
|
+
if (before) tr = tr.setSelection(TextSelection.near(state.doc.resolve(before.pos + state.doc.nodeAt(before.pos).nodeSize - 1), -1));
|
|
7878
|
+
}
|
|
7879
|
+
e.view.dispatch(tr);
|
|
7880
|
+
return true;
|
|
7881
|
+
}, { readOnlySafe: true });
|
|
7882
|
+
editor.registerCommand("isHeadingFolded", (e) => {
|
|
7883
|
+
const p = headingAt(e.view.state);
|
|
7884
|
+
return p !== null && foldedPositions(e.view.state).includes(p);
|
|
7885
|
+
}, { readOnlySafe: true });
|
|
7886
|
+
return [new Plugin({
|
|
7887
|
+
key: key$5,
|
|
7888
|
+
state: {
|
|
7889
|
+
init: (_c, st) => ({
|
|
7890
|
+
folded: [],
|
|
7891
|
+
decorations: build(st.doc, [])
|
|
7892
|
+
}),
|
|
7893
|
+
apply(tr, value, _old, state) {
|
|
7894
|
+
const meta = tr.getMeta(key$5);
|
|
7895
|
+
let folded = value.folded;
|
|
7896
|
+
if (tr.docChanged && folded.length) folded = folded.map((p) => tr.mapping.map(p, 1)).filter((p, i, all) => isHeading(state.doc.nodeAt(p)) && state.doc.resolve(p).depth === 0 && all.indexOf(p) === i);
|
|
7897
|
+
if (meta?.set) folded = meta.set;
|
|
7898
|
+
if (folded === value.folded && !tr.docChanged) return value;
|
|
7899
|
+
return {
|
|
7900
|
+
folded,
|
|
7901
|
+
decorations: build(state.doc, folded)
|
|
7902
|
+
};
|
|
7903
|
+
}
|
|
7904
|
+
},
|
|
7905
|
+
props: {
|
|
7906
|
+
decorations: (state) => key$5.getState(state)?.decorations,
|
|
7907
|
+
handleDOMEvents: { mousedown(view, event) {
|
|
7908
|
+
const e = event;
|
|
7909
|
+
if (e.button !== 0) return false;
|
|
7910
|
+
const target = e.target;
|
|
7911
|
+
if (!(target instanceof HTMLElement) || target.parentElement !== view.dom || !/^H[1-6]$/.test(target.tagName)) return false;
|
|
7912
|
+
const rect = target.getBoundingClientRect();
|
|
7913
|
+
if (e.clientX >= rect.left || e.clientX < rect.left - GUTTER) return false;
|
|
7914
|
+
const pos = view.posAtDOM(target, 0) - 1;
|
|
7915
|
+
if (!toggleAt(view.state, pos, void 0, (tr) => view.dispatch(tr))) return false;
|
|
7916
|
+
e.preventDefault();
|
|
7917
|
+
return true;
|
|
7918
|
+
} }
|
|
7919
|
+
},
|
|
7920
|
+
view(view) {
|
|
7921
|
+
view.dom.classList.add("wy-collapsible");
|
|
7922
|
+
return { destroy: () => view.dom.classList.remove("wy-collapsible") };
|
|
7923
|
+
},
|
|
7924
|
+
appendTransaction(trs, _old, state) {
|
|
7925
|
+
if (!foldedPositions(state).length) return null;
|
|
7926
|
+
if (!trs.some((t) => t.selectionSet || t.docChanged)) return null;
|
|
7927
|
+
if (trs.some((t) => t.getMeta(key$5)?.set)) return null;
|
|
7928
|
+
const { anchor, head } = state.selection;
|
|
7929
|
+
const open = /* @__PURE__ */ new Set([...hidingHeadings(state, head), ...hidingHeadings(state, anchor)]);
|
|
7930
|
+
if (!open.size) return null;
|
|
7931
|
+
return setFolded(state, foldedPositions(state).filter((p) => !open.has(p)));
|
|
7932
|
+
}
|
|
7933
|
+
})];
|
|
7934
|
+
},
|
|
7935
|
+
keymap: {
|
|
7936
|
+
"Mod-Alt-ArrowUp": "toggleHeadingFold",
|
|
7937
|
+
"Mod-Alt-ArrowDown": "expandHeadings"
|
|
7938
|
+
},
|
|
7939
|
+
contextMenuOrder: 20,
|
|
7940
|
+
contextMenu({ editor, event, state }) {
|
|
7941
|
+
const hit = (event?.target instanceof HTMLElement ? event.target : null)?.closest("h1, h2, h3, h4, h5, h6");
|
|
7942
|
+
const onHeading = !!hit && hit.parentElement === editor.view.dom;
|
|
7943
|
+
const has = headingsOf(state.doc).length > 0;
|
|
7944
|
+
if (!onHeading && !has) return [];
|
|
7945
|
+
const folded = foldedPositions(state);
|
|
7946
|
+
const items = [];
|
|
7947
|
+
if (onHeading) {
|
|
7948
|
+
const pos = editor.view.posAtDOM(hit, 0) - 1;
|
|
7949
|
+
const isFolded = folded.includes(pos);
|
|
7950
|
+
items.push({
|
|
7951
|
+
label: isFolded ? "Expand section" : "Collapse section",
|
|
7952
|
+
readOnly: true,
|
|
7953
|
+
run: () => {
|
|
7954
|
+
toggleAt(editor.view.state, pos, void 0, (tr) => editor.view.dispatch(tr));
|
|
7955
|
+
}
|
|
7956
|
+
});
|
|
7957
|
+
}
|
|
7958
|
+
if (has) {
|
|
7959
|
+
items.push({
|
|
7960
|
+
label: "Collapse all headings",
|
|
7961
|
+
readOnly: true,
|
|
7962
|
+
run: () => {
|
|
7963
|
+
editor.execute("collapseHeadings");
|
|
7964
|
+
}
|
|
7965
|
+
});
|
|
7966
|
+
if (folded.length) items.push({
|
|
7967
|
+
label: "Expand all headings",
|
|
7968
|
+
readOnly: true,
|
|
7969
|
+
run: () => {
|
|
7970
|
+
editor.execute("expandHeadings");
|
|
7971
|
+
}
|
|
7972
|
+
});
|
|
7973
|
+
}
|
|
7974
|
+
return [...items, "-"];
|
|
7975
|
+
},
|
|
7976
|
+
ribbon: [{
|
|
7977
|
+
tab: "view",
|
|
7978
|
+
after: "show",
|
|
7979
|
+
group: {
|
|
7980
|
+
id: "headingFolds",
|
|
7981
|
+
label: "Headings",
|
|
7982
|
+
controls: [{
|
|
7983
|
+
kind: "menu",
|
|
7984
|
+
id: "collapseHeadings",
|
|
7985
|
+
label: "Collapse",
|
|
7986
|
+
icon: "navigation",
|
|
7987
|
+
need: "collapseHeadings",
|
|
7988
|
+
size: "large",
|
|
7989
|
+
entries: () => [
|
|
7990
|
+
{
|
|
7991
|
+
label: "Collapse all headings",
|
|
7992
|
+
command: "collapseHeadings"
|
|
7993
|
+
},
|
|
7994
|
+
{
|
|
7995
|
+
label: "Expand all headings",
|
|
7996
|
+
command: "expandHeadings"
|
|
7997
|
+
},
|
|
7998
|
+
{
|
|
7999
|
+
label: "Show level",
|
|
8000
|
+
heading: true
|
|
8001
|
+
},
|
|
8002
|
+
{
|
|
8003
|
+
label: "Level 1 only",
|
|
8004
|
+
command: "showHeadingLevel",
|
|
8005
|
+
args: [1]
|
|
8006
|
+
},
|
|
8007
|
+
{
|
|
8008
|
+
label: "Levels 1 to 2",
|
|
8009
|
+
command: "showHeadingLevel",
|
|
8010
|
+
args: [2]
|
|
8011
|
+
},
|
|
8012
|
+
{
|
|
8013
|
+
label: "Levels 1 to 3",
|
|
8014
|
+
command: "showHeadingLevel",
|
|
8015
|
+
args: [3]
|
|
8016
|
+
}
|
|
8017
|
+
]
|
|
8018
|
+
}]
|
|
8019
|
+
}
|
|
8020
|
+
}]
|
|
8021
|
+
};
|
|
8022
|
+
//#endregion
|
|
7724
8023
|
//#region src/plugins/find-replace.ts
|
|
7725
8024
|
var MAX_BLOCK = 1e5;
|
|
7726
8025
|
var escapeRe = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -19337,6 +19636,7 @@ var defaultPlugins = [
|
|
|
19337
19636
|
Essentials,
|
|
19338
19637
|
BasicStyles,
|
|
19339
19638
|
Heading,
|
|
19639
|
+
CollapsibleHeadings,
|
|
19340
19640
|
Fonts,
|
|
19341
19641
|
Alignment,
|
|
19342
19642
|
Colors,
|
|
@@ -19375,6 +19675,6 @@ function createEditor(config) {
|
|
|
19375
19675
|
});
|
|
19376
19676
|
}
|
|
19377
19677
|
//#endregion
|
|
19378
|
-
export { TableFormulas as $,
|
|
19678
|
+
export { TableFormulas as $, ICONS as $n, CollapsibleHeadings as $t, MERMAID_TEMPLATES as A, buildPrintHTML as An, ApiError as At, rejectReason as B, uniqueName as Bn, getChanges as Bt, parseOptions as C, Essentials as Cn, DEFAULT_TEMPLATES as Ct, IndexedDBDraftStore as D, isWordHTML as Dn, DEFAULT_AI_ACTIONS as Dt, resolveEmbed as E, isGoogleDocsHTML as En, AIAssistant as Et, DEFAULT_BLOCKED as F, ResilientFileStore as Fn, Mentions as Ft, boxBlur as G, applyContributions as Gn, cleanIssues as Gt, FILTER_PRESETS as H, getStats as Hn, Comments as Ht, addFiles as I, cleanFileName as In, VersionStore as It, foldEnd as J, TextCase as Jn, FormatPainter as Jt, formatBytes as K, RestrictedEditing as Kn, createLanguageToolProvider as Kt, matchesAccept as L, createFileStore as Ln, Versions as Lt, Equations as M, printDocument as Mn, DocumentClient as Mt, MATH_SNIPPETS as N, IndexedDBFileStore as Nn, createEndpointSaver as Nt, MemoryDraftStore as O, markerStyle as On, createFetchProvider as Ot, FileManager as P, MemoryFileStore as Pn, createHttpSaver as Pt, renderDiagram as Q, SpecialCharacters as Qn, isRiskyRegex as Qt, openFileManager as R, fileKind as Rn, localStorageVersions as Rt, listFields as S, BasicStyles as Sn, setBlockAttrs as St, Embeds as T, hasPasteableText as Tn, Direction as Tt, NEUTRAL as U, DEFAULT_RIBBON as Un, TableOfContents as Ut, openImageEditor as V, WordCount as Vn, CommentStore as Vt, applyAdjustments as W, Ribbon as Wn, SpellCheck as Wt, Diagram as X, convertCase as Xn, buildMatcher as Xt, foldEnds as Y, applyCase as Yn, FindReplace as Yt, parseDiagram as Z, SPECIAL_CHARACTERS as Zn, findMatches as Zt, Captions as _, Image$1 as _n, SlashCommands as _t, CodeEditor as a, TaskList as an, translate as ar, CodeEditing as at, FormFields as b, List as bn, ParagraphFormat as bt, toEmailHTML as c, Fonts as cn, DEFAULT_LANGUAGES as ct, DataTable as d, Table as dn, SourceEditing as dt, Outline as en, hasIcon as er, colName as et, PdfEpub as f, Colors as fn, formatHtml as ft, Columns as g, Cover as gn, DEFAULT_SLASH_COMMANDS as gt, Charts as h, tidyEntries as hn, renderMergeFields as ht, splitSlides as i, paginate as in, registerLocale as ir, isErrorValue as it, Mermaid as j, marginContent as jn, ConflictError as jt, Offline as k, Editor as kn, Autosave as kt, toEmailText as l, Alignment as ln, resolveLanguage as lt, isSafeClip as m, buildContextMenu as mn, getMergeFields as mt, defaultPlugins as n, PAGE_SIZES as nn, registerIcon as nr, evaluateGrid as nt, createCodeEditor as o, FONT_FAMILIES as on, findMatchingBracket as ot, Recording as p, ContextMenu as pn, MergeFields as pt, CodeAdvanced as q, CASE_ITEMS as qn, Footnotes as qt, defineEditorElement as r, Pages as rn, isRtlLocale as rr, formatValue as rt, languageForFilename as s, FONT_SIZES as sn, CodeBlocks as st, createEditor as t, getOutline as tn, icon as tr, computeFormulasInHTML as tt, definePlugin as u, Autoformat as un, simpleHighlight as ut, collectCaptions as v, Link as vn, BalloonToolbar as vt, DEFAULT_EMBED_PROVIDERS as w, cleanPastedHTML as wn, Templates as wt, cleanValue as x, Heading as xn, currentBlock as xt, FIELD_META as y, Blocks as yn, Office as yt, readImageSize as z, isRasterImage as zn, TrackChanges as zt };
|
|
19379
19679
|
|
|
19380
|
-
//# sourceMappingURL=src-
|
|
19680
|
+
//# sourceMappingURL=src-BNH7F1TH.js.map
|