@ones-editor/editor 3.0.2-beta.3 → 3.0.3-beta.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/@ones-editor/core/src/core/doc/doc.d.ts +1 -2
- package/@ones-editor/sharedb-doc/src/types.d.ts +1 -2
- package/@ones-editor/tsconfig.tsbuildinfo +1 -1
- package/@ones-editor/ui-base/src/icons/index.d.ts +1 -3
- package/@ones-editor/versions/src/locale/en-us.d.ts +0 -1
- package/@ones-editor/versions/src/locale/ja-jp.d.ts +0 -1
- package/@ones-editor/versions/src/locale/zh-cn.d.ts +0 -1
- package/@ones-editor/versions/src/locale/zh-hant-hk.d.ts +0 -1
- package/@ones-editor/versions/src/types.d.ts +0 -1
- package/@ones-editor/versions/src/version-dialog/index.d.ts +0 -1
- package/@ones-editor/versions/src/version-dialog/version-list.d.ts +0 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +106 -94
- package/package.json +1 -1
|
@@ -130,6 +130,4 @@ import TocIcon from './toc.svg?raw';
|
|
|
130
130
|
import AttachmentIcon from './attachment.svg?raw';
|
|
131
131
|
import Mention2Icon from './mention.svg?raw';
|
|
132
132
|
import CircleCloseIcon from './circle-close.svg?raw';
|
|
133
|
-
|
|
134
|
-
import RevertIcon from './revert.svg?raw';
|
|
135
|
-
export { TableEditIcon, TabIcon, ShiftTabIcon, DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, CircleCheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, TextGroupIcon, AdjustWidthIcon, TocIcon, AttachmentIcon, Mention2Icon, CircleCloseIcon, Edit2Icon, RevertIcon, };
|
|
133
|
+
export { TableEditIcon, TabIcon, ShiftTabIcon, DownloadIcon, AddEmojiIcon, BallIcon, CardIcon, FoodIcon, LightIcon, SmileIcon, SymbolIcon, TreeIcon, TimeIcon, ClearIcon, CloseIcon, PrevIcon, NextIcon, MoreIcon, TextColorIcon, AddIcon, ArrowDownIcon, ArrowUpIcon, ArrowLeftIcon, ArrowRightIcon, DeleteRowIcon, DeleteColIcon, MergeCellIcon, SplitCellIcon, DeleteTableIcon, Heading1Icon, Heading2Icon, Heading3Icon, Heading4Icon, Heading5Icon, Heading6Icon, Heading7Icon, Heading8Icon, HeadingNIcon, OrderedListIcon, UnorderedListIcon, CheckListIcon, BlockquoteIcon, AlignCenterIcon, AlignLeftIcon, AlignRightIcon, ImageIcon, ImageMenuIcon, ImageErrorIcon, ImageEmptyIcon, LinkIcon, LinkOffIcon, WarningIcon, PasteSpecialIcon, LaunchIcon, CodeIcon, LayoutIcon, AudioIcon, GraphIcon, VideoIcon, FileIcon, MathIcon, MathMenuIcon, TableIcon, TableMenuIcon, BilibiliIcon, YoukuIcon, ModaoIcon, FigmaIcon, EditIcon, CommentIcon, RefreshIcon, HelpIcon, CheckMarkIcon, CircleCheckMarkIcon, TextIcon, RightArrowIcon, TencentVideoIcon, WebPageIcon, UmlIcon, DividingLineIcon, HeadingH1Icon, HeadingH2Icon, HeadingH3Icon, HeadingH4Icon, HeadingH5Icon, HeadingH6Icon, HeadingH7Icon, HeadingH8Icon, CheckboxIcon, QuoteIcon, LinkHrefIcon, OrderedIcon, UnorderedIcon, CopyIcon, CutIcon, DeleteIcon, LockBlockIcon, UnLockBlockIcon, InsertBeforeIcon, InsertAfterIcon, MentionIcon, CircleAddIcon, LoadingIcon, DragIcon, UmlBrandIcon, OnesLoadingIcon, BoldIcon, ItalicIcon, UnderlineIcon, LineThroughIcon, SubscriptIcon, SuperscriptIcon, InlineCodeIcon, ToMindMapIcon, FitIcon, FullScreenIcon, ExitFullScreenIcon, CaretDownIcon, StatusIcon, AlertEmojiIcon, ForbiddenIcon, WarningFilledIcon, InformationFilledIcon, SearchIcon, CalloutIcon, LoadingCircleIcon, TextGroupIcon, AdjustWidthIcon, TocIcon, AttachmentIcon, Mention2Icon, CircleCloseIcon, };
|
|
@@ -16,7 +16,6 @@ export interface VersionDialogOptions {
|
|
|
16
16
|
onVersionChanged?: (sender: unknown, versionEditor: OnesEditor, version: DocVersion) => void;
|
|
17
17
|
onVersionsLoaded?: (sender: unknown, versions: DocVersion[]) => void;
|
|
18
18
|
decorateItem?: (item: HTMLElement, ver: DocVersion) => void;
|
|
19
|
-
onCopyVersionLink?: (ver: DocVersion) => void;
|
|
20
19
|
}
|
|
21
20
|
export type VersionNum = number | string;
|
|
22
21
|
export interface PlayOptions {
|
|
@@ -14,7 +14,6 @@ export declare class OnesEditorVersionsDialog implements OnesEditorCustom {
|
|
|
14
14
|
get editor(): OnesEditor | null;
|
|
15
15
|
constructor(server: OnesEditorDocServer, provider: OnesEditorVersionsProvider, editorOptions?: unknown);
|
|
16
16
|
private handleRevert;
|
|
17
|
-
private handleCopyLink;
|
|
18
17
|
private handleSelectVersion;
|
|
19
18
|
private handleCompareWithVersion;
|
|
20
19
|
private handleHelp;
|
|
@@ -13,7 +13,6 @@ interface VersionListOptions {
|
|
|
13
13
|
getMarkColor: (user: HistoryUser) => string;
|
|
14
14
|
onSelectVersion: (version: DocVersion) => void;
|
|
15
15
|
onRevert: (version: DocVersion) => void;
|
|
16
|
-
onCopyLink?: (version: DocVersion) => void;
|
|
17
16
|
onMemoChanged?: (version: DocVersion) => void;
|
|
18
17
|
onBeforeEditMemo: () => PromiseLike<boolean>;
|
|
19
18
|
useCreatedBy?: boolean;
|
|
@@ -41,7 +40,6 @@ export declare class VersionList {
|
|
|
41
40
|
private editItemMemo;
|
|
42
41
|
private handleEndEditItemMemo;
|
|
43
42
|
private handleRevert;
|
|
44
|
-
private handleCopyLink;
|
|
45
43
|
private updateHeaderCount;
|
|
46
44
|
private handleFilterClick;
|
|
47
45
|
getVersionItemByVersionNum(version: VersionNum): VersionElement | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -108,3 +108,4 @@ export interface ShowDocVersionsOptions2 {
|
|
|
108
108
|
editorOptions?: CreateOnesEditorOptions;
|
|
109
109
|
}
|
|
110
110
|
export declare function showDocVersions2(parent: HTMLElement, options: ShowDocVersionsOptions2): Promise<OnesEditorVersionsDialog>;
|
|
111
|
+
export declare function createSimpleInput(root: HTMLElement, docData: DocObject | OnesEditorDoc, options: CreateLocalEditorOptions): Promise<OnesEditor>;
|
package/dist/index.js
CHANGED
|
@@ -6771,23 +6771,9 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
|
|
|
6771
6771
|
.version-list-root .version-list-content .version-item .version-item-title .version-actions button.disabled:hover {
|
|
6772
6772
|
color: #c7c7c7;
|
|
6773
6773
|
}
|
|
6774
|
-
.version-list-root .version-list-content .version-item .version-item-title .version-actions .copy-link-button,
|
|
6775
6774
|
.version-list-root .version-list-content .version-item .version-item-title .version-actions .revert-button {
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
.version-list-root .version-list-content .version-item .version-item-info {
|
|
6779
|
-
display: flex;
|
|
6780
|
-
margin-top: 10px;
|
|
6781
|
-
padding-left: 10px;
|
|
6782
|
-
}
|
|
6783
|
-
.version-list-root .version-list-content .version-item .version-item-info .version-item-time {
|
|
6784
|
-
line-height: 22px;
|
|
6785
|
-
display: block;
|
|
6786
|
-
white-space: nowrap;
|
|
6787
|
-
overflow: hidden;
|
|
6788
|
-
text-overflow: ellipsis;
|
|
6789
|
-
font-size: 12px;
|
|
6790
|
-
margin-right: 10px;
|
|
6775
|
+
border-left: 1px solid #e8e8e8;
|
|
6776
|
+
margin-left: 10px;
|
|
6791
6777
|
}
|
|
6792
6778
|
.version-list-root .version-list-content .version-item .version-item-authors {
|
|
6793
6779
|
list-style: none;
|
|
@@ -6797,6 +6783,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div.embed-blo
|
|
|
6797
6783
|
}
|
|
6798
6784
|
.version-list-root .version-list-content .version-item .version-item-author {
|
|
6799
6785
|
display: flex;
|
|
6786
|
+
margin-top: 10px;
|
|
6800
6787
|
color: #606060;
|
|
6801
6788
|
line-height: 22px;
|
|
6802
6789
|
}
|
|
@@ -24758,15 +24745,6 @@ var __publicField = (obj, key, value) => {
|
|
|
24758
24745
|
}
|
|
24759
24746
|
return new EditorSimpleSelectionRange(editor, { anchor: startPos, focus: endPos != null ? endPos : startPos });
|
|
24760
24747
|
}
|
|
24761
|
-
function apiResultToDocVersions(versions) {
|
|
24762
|
-
if (Array.isArray(versions)) {
|
|
24763
|
-
return versions.map((v, index2, arr) => ({
|
|
24764
|
-
...v,
|
|
24765
|
-
versionIndex: arr.length - index2
|
|
24766
|
-
}));
|
|
24767
|
-
}
|
|
24768
|
-
return versions;
|
|
24769
|
-
}
|
|
24770
24748
|
const logger$48 = getLogger("create-text-op");
|
|
24771
24749
|
function createTextOp(text2, attributes) {
|
|
24772
24750
|
assert(logger$48, text2, "text is empty");
|
|
@@ -38842,7 +38820,7 @@ ${codeText}
|
|
|
38842
38820
|
const server = this.apiServer();
|
|
38843
38821
|
const api = `${server}/versions?withExtra=true`;
|
|
38844
38822
|
const ret = await this.request(api);
|
|
38845
|
-
const versions =
|
|
38823
|
+
const versions = ret.data.versions;
|
|
38846
38824
|
versions.forEach((v) => {
|
|
38847
38825
|
if (v.extra) {
|
|
38848
38826
|
v.extra = JSON.parse(v.extra);
|
|
@@ -40717,7 +40695,7 @@ ${codeText}
|
|
|
40717
40695
|
const ret = await this.request(api, {
|
|
40718
40696
|
params
|
|
40719
40697
|
});
|
|
40720
|
-
const versions =
|
|
40698
|
+
const versions = ret.data.versions;
|
|
40721
40699
|
versions.forEach((v) => {
|
|
40722
40700
|
if (v.extra) {
|
|
40723
40701
|
v.extra = JSON.parse(v.extra);
|
|
@@ -41333,8 +41311,6 @@ ${codeText}
|
|
|
41333
41311
|
const AttachmentIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M6.49669 1C4.80282 1 3.0118 2.3515 3.0118 3.76237L3 10.6206M6.49669 1C8.41943 1 10.0154 2.60058 10.0154 4.17342M6.49669 1C7.43289 1 8.28684 1.42118 8.90405 1.96796C9.50746 2.50252 10.0154 3.29036 10.0154 4.17342M10.0154 4.17342L10.0154 9.61446C10.0154 10.4166 9.23033 11.2316 8 11.2316C6.91283 11.2316 6.01026 10.5735 6.01026 9.87981L5.98457 5.04102M3 10.6206C3 13.1126 5.38055 15 8 15M3 10.6206C3 12.9301 5.13252 15 8 15M8 15C10.6194 15 13 13.1988 13 10.7068M8 15C10.8675 15 13 13.0162 13 10.7068M13 10.7068V5.04102" stroke="currentColor" stroke-linecap="square" stroke-linejoin="round"/>\n<path d="M13 4V10C13 12.7614 10.7614 15 8 15C5.23858 15 3 12.7614 3 10V4.5" stroke="currentColor"/>\n<path d="M10 9V4.5C10 2.567 8.433 1 6.5 1C4.567 1 3 2.567 3 4.5" stroke="currentColor"/>\n<path d="M10 9C10 10.1046 9.10457 11 8 11C6.89543 11 6 10.1046 6 9V4" stroke="currentColor"/>\n</svg>\n';
|
|
41334
41312
|
const Mention2Icon = '<svg width="17" height="16" viewBox="0 0 17 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M11.237 13.6469C10.2882 14.1888 9.18962 14.4985 8.01868 14.4985C4.42977 14.4985 1.52039 11.5892 1.52039 8.00024C1.52039 4.41134 4.42977 1.50195 8.01868 1.50195C11.6076 1.50195 14.517 4.41134 14.517 8.00024C14.517 8.70345 14.4221 9.21723 14.2284 9.56578C13.9961 10.0692 13.4926 10.7276 12.66 10.8438C12.3454 10.9008 12.0336 10.7797 11.7805 10.6233C11.3724 10.3711 11.2127 9.88274 11.2127 9.40298V4.48055" stroke="currentColor"/>\n<path d="M7.67957 4.73828C9.37526 4.73835 10.6913 6.20213 10.6913 7.93262C10.6913 9.6631 9.37526 11.1269 7.67957 11.127C5.98381 11.127 4.66785 9.66315 4.66785 7.93262C4.66785 6.20209 5.98381 4.73828 7.67957 4.73828Z" stroke="currentColor"/>\n</svg>\n';
|
|
41335
41313
|
const CircleCloseIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 1C11.8659 1 15 4.13408 15 8C15 11.8659 11.8659 15 8 15C4.13408 15 1 11.8659 1 8C1 4.13408 4.13408 1 8 1ZM8 7.29297L5.52539 4.81836L4.81836 5.52539L7.29297 8L4.81836 10.4746L5.52539 11.1816L8 8.70703L10.4746 11.1816L11.1816 10.4746L8.70703 8L11.1816 5.52539L10.4746 4.81836L8 7.29297Z" fill="currentColor"/>\n</svg>\n';
|
|
41336
|
-
const Edit2Icon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M9 2.5H3C2.72386 2.5 2.5 2.72386 2.5 3V13C2.5 13.2761 2.72386 13.5 3 13.5H13C13.2761 13.5 13.5 13.2761 13.5 13V7H14.5V13C14.5 13.8284 13.8284 14.5 13 14.5H3C2.17157 14.5 1.5 13.8284 1.5 13V3C1.5 2.17157 2.17157 1.5 3 1.5H9V2.5ZM14.2383 2.46875L6.46875 10.2383L5.76172 9.53125L13.5312 1.76172L14.2383 2.46875Z" fill="currentColor"/>\n</svg>\n';
|
|
41337
|
-
const RevertIcon = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">\n<path d="M8 0.5C12.1421 0.5 15.5 3.85786 15.5 8C15.5 12.1421 12.1421 15.5 8 15.5C3.85786 15.5 0.5 12.1421 0.5 8H1.5C1.5 11.5899 4.41015 14.5 8 14.5C11.5899 14.5 14.5 11.5899 14.5 8C14.5 4.41015 11.5899 1.5 8 1.5C5.92002 1.5 4.07025 2.47853 2.87988 4H5V5H1.5C1.22386 5 1 4.77614 1 4.5V1H2V3.50293C3.36756 1.68115 5.545 0.5 8 0.5ZM8.5 7.5H12V8.5H8C7.72386 8.5 7.5 8.27614 7.5 8V4H8.5V7.5Z" fill="currentColor"/>\n</svg>\n';
|
|
41338
41314
|
const index$f = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
41339
41315
|
__proto__: null,
|
|
41340
41316
|
TableEditIcon,
|
|
@@ -41468,9 +41444,7 @@ ${codeText}
|
|
|
41468
41444
|
TocIcon,
|
|
41469
41445
|
AttachmentIcon,
|
|
41470
41446
|
Mention2Icon,
|
|
41471
|
-
CircleCloseIcon
|
|
41472
|
-
Edit2Icon,
|
|
41473
|
-
RevertIcon
|
|
41447
|
+
CircleCloseIcon
|
|
41474
41448
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
41475
41449
|
function createLoading() {
|
|
41476
41450
|
const loading2 = createElement("span", ["editor-loading-icon"], null);
|
|
@@ -81422,7 +81396,6 @@ ${docStr}
|
|
|
81422
81396
|
noFilterVersion: "\u6682\u65E0\u5339\u914D\u7ED3\u679C",
|
|
81423
81397
|
memo: "\u5907\u6CE8",
|
|
81424
81398
|
revert: "\u56DE\u6EDA",
|
|
81425
|
-
copyLink: "\u590D\u5236\u5386\u53F2\u7248\u672C\u94FE\u63A5",
|
|
81426
81399
|
filter: {
|
|
81427
81400
|
all: "\u5168\u90E8",
|
|
81428
81401
|
memoed: "\u5DF2\u5907\u6CE8",
|
|
@@ -81467,7 +81440,6 @@ ${docStr}
|
|
|
81467
81440
|
noFilterVersion: "\u66AB\u7121\u5339\u914D\u7D50\u679C",
|
|
81468
81441
|
memo: "\u5099\u8A3B",
|
|
81469
81442
|
revert: "\u56DE\u6EFE",
|
|
81470
|
-
copyLink: "\u590D\u5236\u6B77\u53F2\u7248\u672C\u94FE\u63A5",
|
|
81471
81443
|
filter: {
|
|
81472
81444
|
all: "\u5168\u90E8",
|
|
81473
81445
|
memoed: "\u5DF2\u5099\u8A3B",
|
|
@@ -81512,7 +81484,6 @@ ${docStr}
|
|
|
81512
81484
|
noFilterVersion: "No result",
|
|
81513
81485
|
memo: "Comment",
|
|
81514
81486
|
revert: "Roll back",
|
|
81515
|
-
copyLink: "Copy historical version link",
|
|
81516
81487
|
filter: {
|
|
81517
81488
|
all: "All",
|
|
81518
81489
|
memoed: "Commented",
|
|
@@ -81557,7 +81528,6 @@ ${docStr}
|
|
|
81557
81528
|
noFilterVersion: "\u4E00\u81F4\u3057\u305F\u7D50\u679C\u306F\u3042\u308A\u307E\u305B\u3093",
|
|
81558
81529
|
memo: "\u5099\u8003",
|
|
81559
81530
|
revert: "\u5FA9\u5143",
|
|
81560
|
-
copyLink: "\u5C65\u6B74\u30D0\u30FC\u30B8\u30E7\u30F3\u306E\u30EA\u30F3\u30AF\u3092\u30B3\u30D4\u30FC",
|
|
81561
81531
|
filter: {
|
|
81562
81532
|
all: "\u3059\u3079\u3066",
|
|
81563
81533
|
memoed: "\u5099\u8003\u3042\u308A",
|
|
@@ -81621,9 +81591,6 @@ ${docStr}
|
|
|
81621
81591
|
var _a;
|
|
81622
81592
|
let name;
|
|
81623
81593
|
if (ver.version !== -1) {
|
|
81624
|
-
if (typeof ver.versionIndex === "number") {
|
|
81625
|
-
return `v${ver.versionIndex}`;
|
|
81626
|
-
}
|
|
81627
81594
|
const date = new Date((_a = ver.created) != null ? _a : ver.version);
|
|
81628
81595
|
name = formatDate(date, "YYYY-MM-DD hh:mm");
|
|
81629
81596
|
} else {
|
|
@@ -81742,10 +81709,6 @@ ${docStr}
|
|
|
81742
81709
|
this.handleRevert(version, versionItem);
|
|
81743
81710
|
return;
|
|
81744
81711
|
}
|
|
81745
|
-
if (target.closest(".copy-link-button") && this.options.enableEdit) {
|
|
81746
|
-
this.handleCopyLink(version, versionItem);
|
|
81747
|
-
return;
|
|
81748
|
-
}
|
|
81749
81712
|
if (active) {
|
|
81750
81713
|
return;
|
|
81751
81714
|
}
|
|
@@ -81784,10 +81747,6 @@ ${docStr}
|
|
|
81784
81747
|
const { onRevert } = this.options;
|
|
81785
81748
|
onRevert(version);
|
|
81786
81749
|
});
|
|
81787
|
-
__publicField(this, "handleCopyLink", (version, versionItem) => {
|
|
81788
|
-
const { onCopyLink } = this.options;
|
|
81789
|
-
onCopyLink == null ? void 0 : onCopyLink(version);
|
|
81790
|
-
});
|
|
81791
81750
|
__publicField(this, "handleFilterClick", (bar2, item) => {
|
|
81792
81751
|
let versions = this.options.versions;
|
|
81793
81752
|
if (item.id === "memoed") {
|
|
@@ -81880,20 +81839,16 @@ ${docStr}
|
|
|
81880
81839
|
}
|
|
81881
81840
|
createElement("div", ["spacer"], title);
|
|
81882
81841
|
const actions2 = createElement("div", ["version-actions"], title);
|
|
81883
|
-
const addMemo =
|
|
81884
|
-
addMemo.
|
|
81842
|
+
const addMemo = createElement("button", ["add-memo-button"], actions2);
|
|
81843
|
+
addMemo.textContent = t$1("version.memo");
|
|
81885
81844
|
if (!this.options.enableEdit) {
|
|
81886
81845
|
addClass(addMemo, "disabled");
|
|
81887
81846
|
const disabledTip = (_d = (_c = (_b = this.options).getDisabledTip) == null ? void 0 : _c.call(_b)) != null ? _d : i18n$1.t("version.tooltip.auth");
|
|
81888
81847
|
addMemo.setAttribute("data-editor-tooltip-common", disabledTip);
|
|
81889
81848
|
}
|
|
81890
|
-
if (this.options.onCopyLink) {
|
|
81891
|
-
const copyLink = createIconButton(LinkIcon, ["copy-link-button"], actions2);
|
|
81892
|
-
copyLink.setAttribute("data-editor-tooltip-common", t$1("version.copyLink"));
|
|
81893
|
-
}
|
|
81894
81849
|
if (!isFirst) {
|
|
81895
|
-
const revert =
|
|
81896
|
-
revert.
|
|
81850
|
+
const revert = createElement("button", ["revert-button"], actions2);
|
|
81851
|
+
revert.textContent = t$1("version.revert");
|
|
81897
81852
|
if (!this.options.enableEdit) {
|
|
81898
81853
|
addClass(revert, "disabled");
|
|
81899
81854
|
const disabledTip = (_g = (_f = (_e = this.options).getDisabledTip) == null ? void 0 : _f.call(_e)) != null ? _g : i18n$1.t("version.tooltip.auth");
|
|
@@ -81909,9 +81864,7 @@ ${docStr}
|
|
|
81909
81864
|
}
|
|
81910
81865
|
createElement("div", ["version-item-restore-from"], item, restoreFrom);
|
|
81911
81866
|
createElement("div", ["version-item-memo"], item, ((_i = ver.extra) == null ? void 0 : _i.memo) || "");
|
|
81912
|
-
const
|
|
81913
|
-
createElement("li", ["version-item-time"], info, formatDate(new Date(ver.version), "YYYY-MM-DD hh:mm"));
|
|
81914
|
-
const authors = createElement("ul", ["version-item-authors"], info);
|
|
81867
|
+
const authors = createElement("ul", ["version-item-authors"], item);
|
|
81915
81868
|
const addUser = (user) => {
|
|
81916
81869
|
const author = createElement("li", ["version-item-author"], authors);
|
|
81917
81870
|
const markAuthor = createElement("span", ["version-item-author-mark"], author);
|
|
@@ -81945,6 +81898,11 @@ ${docStr}
|
|
|
81945
81898
|
};
|
|
81946
81899
|
versions.forEach((ver, index2) => {
|
|
81947
81900
|
addVersion(ver, false, versions, ver.created === this.options.versions[0].created);
|
|
81901
|
+
if (ver.minorVersions && ver.minorVersions.length > 0) {
|
|
81902
|
+
ver.minorVersions.forEach((v) => {
|
|
81903
|
+
addVersion(v, true, versions, false);
|
|
81904
|
+
});
|
|
81905
|
+
}
|
|
81948
81906
|
});
|
|
81949
81907
|
return versionListFragment;
|
|
81950
81908
|
}
|
|
@@ -82006,16 +81964,6 @@ ${docStr}
|
|
|
82006
81964
|
}
|
|
82007
81965
|
}
|
|
82008
81966
|
getVersionItemByVersionNum(version) {
|
|
82009
|
-
if (typeof version === "string" && version.startsWith("v")) {
|
|
82010
|
-
const index2 = Number.parseInt(version.substring(1), 10);
|
|
82011
|
-
const versionItem2 = Array.from(this.versionsList.children).find(
|
|
82012
|
-
(e2) => e2.versionData.versionIndex === index2
|
|
82013
|
-
);
|
|
82014
|
-
if (this.isVersionElement(versionItem2)) {
|
|
82015
|
-
return versionItem2;
|
|
82016
|
-
}
|
|
82017
|
-
return null;
|
|
82018
|
-
}
|
|
82019
81967
|
const versionItem = Array.from(this.versionsList.children).find(
|
|
82020
81968
|
(e2) => e2.versionData.version.toString() === `${version}`
|
|
82021
81969
|
);
|
|
@@ -83311,14 +83259,6 @@ ${docStr}
|
|
|
83311
83259
|
await this.versionHelper.revertVersion(version.version);
|
|
83312
83260
|
(_c = this.dialog) == null ? void 0 : _c.hide();
|
|
83313
83261
|
});
|
|
83314
|
-
__publicField(this, "handleCopyLink", (ver) => {
|
|
83315
|
-
var _a, _b, _c;
|
|
83316
|
-
const version = ver != null ? ver : (_a = this.versionList) == null ? void 0 : _a.activeVersion;
|
|
83317
|
-
if (!version) {
|
|
83318
|
-
return;
|
|
83319
|
-
}
|
|
83320
|
-
(_c = (_b = this.versionOptions) == null ? void 0 : _b.onCopyVersionLink) == null ? void 0 : _c.call(_b, version);
|
|
83321
|
-
});
|
|
83322
83262
|
__publicField(this, "handleSelectVersion", (version) => {
|
|
83323
83263
|
assert(logger$y, version, `The version: ${version} is invalid`);
|
|
83324
83264
|
this.viewVersion(version);
|
|
@@ -83420,24 +83360,20 @@ ${docStr}
|
|
|
83420
83360
|
return this.oldViewer;
|
|
83421
83361
|
}
|
|
83422
83362
|
renderContent(versions) {
|
|
83423
|
-
var _a, _b, _c, _d, _e
|
|
83363
|
+
var _a, _b, _c, _d, _e;
|
|
83424
83364
|
const { listContainer: versionsListContainer } = this.components;
|
|
83425
83365
|
versionsListContainer.innerHTML = "";
|
|
83426
83366
|
const versionList2 = new VersionList({
|
|
83427
83367
|
enableEdit: ((_a = this.versionOptions) == null ? void 0 : _a.enableEdit) || false,
|
|
83428
83368
|
getDisabledTip: (_b = this.versionOptions) == null ? void 0 : _b.getDisabledTip,
|
|
83429
|
-
versions
|
|
83430
|
-
...i,
|
|
83431
|
-
versionIndex: arr.length - index2
|
|
83432
|
-
})),
|
|
83369
|
+
versions,
|
|
83433
83370
|
versionHelper: this.versionHelper,
|
|
83434
83371
|
useCreatedBy: (_c = this.versionOptions) == null ? void 0 : _c.useCreatedBy,
|
|
83435
83372
|
onSelectVersion: this.handleSelectVersion,
|
|
83436
83373
|
onRevert: this.handleRevert,
|
|
83437
|
-
onCopyLink: ((_d = this.versionOptions) == null ? void 0 : _d.onCopyVersionLink) ? this.handleCopyLink : void 0,
|
|
83438
83374
|
onMemoChanged: this.onMemoChanged,
|
|
83439
|
-
decorateItem: (
|
|
83440
|
-
onBeforeEditMemo: ((
|
|
83375
|
+
decorateItem: (_d = this.versionOptions) == null ? void 0 : _d.decorateItem,
|
|
83376
|
+
onBeforeEditMemo: ((_e = this.versionOptions) == null ? void 0 : _e.onBeforeEditMemo) || (async () => true),
|
|
83441
83377
|
getMarkColor: (user) => {
|
|
83442
83378
|
const { flag } = getUserColors(this.server.getRemoteUsers(), user);
|
|
83443
83379
|
return flag;
|
|
@@ -96032,7 +95968,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96032
95968
|
}
|
|
96033
95969
|
}
|
|
96034
95970
|
});
|
|
96035
|
-
editor.version = "3.0.
|
|
95971
|
+
editor.version = "3.0.3-beta.1";
|
|
96036
95972
|
return editor;
|
|
96037
95973
|
}
|
|
96038
95974
|
function isDoc(doc2) {
|
|
@@ -96166,13 +96102,13 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96166
96102
|
OnesEditorDropTarget.register(editor);
|
|
96167
96103
|
OnesEditorTocProvider.register(editor);
|
|
96168
96104
|
OnesEditorExclusiveBlock.register(editor);
|
|
96169
|
-
editor.version = "3.0.
|
|
96105
|
+
editor.version = "3.0.3-beta.1";
|
|
96170
96106
|
return editor;
|
|
96171
96107
|
}
|
|
96172
96108
|
async function showDocVersions(editor, options, serverUrl) {
|
|
96173
96109
|
var _a;
|
|
96174
96110
|
const auth = editor.doc.externalDoc.client.authMessage();
|
|
96175
|
-
const doc2 = await ShareDBServer.load({ auth, serverUrl
|
|
96111
|
+
const doc2 = await ShareDBServer.load({ auth, serverUrl });
|
|
96176
96112
|
const versionHelper = (_a = doc2.getVersionHelper) == null ? void 0 : _a.call(doc2);
|
|
96177
96113
|
if (!versionHelper) {
|
|
96178
96114
|
throw new Error("the editor does not support to show versions");
|
|
@@ -96191,7 +96127,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96191
96127
|
return dialog;
|
|
96192
96128
|
}
|
|
96193
96129
|
async function showDocVersions2(parent, options) {
|
|
96194
|
-
var _a
|
|
96130
|
+
var _a;
|
|
96195
96131
|
const { serverUrl, appId, docId, token, userId, displayName } = options;
|
|
96196
96132
|
const auth = {
|
|
96197
96133
|
appId,
|
|
@@ -96204,10 +96140,9 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96204
96140
|
};
|
|
96205
96141
|
const server = await ShareDBServer.load({
|
|
96206
96142
|
auth,
|
|
96207
|
-
serverUrl: options.serverUrl
|
|
96208
|
-
onCopyVersionLink: (_a = options.options) == null ? void 0 : _a.onCopyVersionLink
|
|
96143
|
+
serverUrl: options.serverUrl
|
|
96209
96144
|
});
|
|
96210
|
-
const versionHelper = (
|
|
96145
|
+
const versionHelper = (_a = server.getVersionHelper) == null ? void 0 : _a.call(server);
|
|
96211
96146
|
if (!versionHelper) {
|
|
96212
96147
|
throw new Error("the editor does not support to show versions");
|
|
96213
96148
|
}
|
|
@@ -96233,6 +96168,85 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
96233
96168
|
dialog.show(dialogOptions);
|
|
96234
96169
|
return dialog;
|
|
96235
96170
|
}
|
|
96171
|
+
async function createSimpleInput(root2, docData, options) {
|
|
96172
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
|
|
96173
|
+
assert(logger, root2, "app does not exists");
|
|
96174
|
+
const doc2 = isDoc(docData) ? docData : new LocalDoc(docData, {
|
|
96175
|
+
serverUrl: options.serverUrl || ""
|
|
96176
|
+
});
|
|
96177
|
+
if (options.lang) {
|
|
96178
|
+
i18n$1.setLang(options.lang);
|
|
96179
|
+
}
|
|
96180
|
+
Logger$2.level = (_a = options.logLevel) != null ? _a : LogLevel.DEBUG;
|
|
96181
|
+
const quickMenu = (_c = (_b = options.componentsOptions) == null ? void 0 : _b.quickMenu) != null ? _c : { id: "quick-menu", trigger: ["/"], commandProviders: [] };
|
|
96182
|
+
const editor = createEditor(root2, doc2, {
|
|
96183
|
+
id: options.id,
|
|
96184
|
+
scrollContainer: options == null ? void 0 : options.scrollContainer,
|
|
96185
|
+
enableResolveComments: false,
|
|
96186
|
+
enableComments: false,
|
|
96187
|
+
dateTimeFormatter: options.dateTimeFormatter,
|
|
96188
|
+
components: {
|
|
96189
|
+
blocks: [ListBlock, ...(_e = (_d = options.components) == null ? void 0 : _d.blocks) != null ? _e : []],
|
|
96190
|
+
commandProviders: [],
|
|
96191
|
+
decorators: [],
|
|
96192
|
+
embeds: [...((_f = options.components) == null ? void 0 : _f.embeds) || []],
|
|
96193
|
+
boxes: [MentionBox, ...((_g = options.components) == null ? void 0 : _g.boxes) || []],
|
|
96194
|
+
insertions: [],
|
|
96195
|
+
blockHooks: [...((_h = options.components) == null ? void 0 : _h.blockHooks) || []],
|
|
96196
|
+
textRenders: [
|
|
96197
|
+
...((_i = options.components) == null ? void 0 : _i.textRenders) || []
|
|
96198
|
+
].filter(Boolean),
|
|
96199
|
+
options: { ...options.componentsOptions, quickMenu }
|
|
96200
|
+
},
|
|
96201
|
+
shortcuts: [TextStyleShortcuts, DefaultShortcuts]
|
|
96202
|
+
});
|
|
96203
|
+
if (options.compact) {
|
|
96204
|
+
addClass(editor.rootElement, "compact");
|
|
96205
|
+
if (options.headingButton === false)
|
|
96206
|
+
addClass(editor.rootElement, "no-heading-collapse");
|
|
96207
|
+
if (options.blockMenuButton === false)
|
|
96208
|
+
addClass(editor.rootElement, "no-block-menu");
|
|
96209
|
+
}
|
|
96210
|
+
editor.input.addHandler(new MarkdownInputHandler());
|
|
96211
|
+
editor.input.addHandler(new ListPasteHandler());
|
|
96212
|
+
editor.doc.registerCallback(new HeadingBlockDocEvents(editor));
|
|
96213
|
+
if (!clientType.isMobile) {
|
|
96214
|
+
editor.addCustom("editor-quick-menu", () => {
|
|
96215
|
+
var _a2;
|
|
96216
|
+
return new OnesEditorQuickMenu(editor, (_a2 = options.componentsOptions) == null ? void 0 : _a2.quickMenu);
|
|
96217
|
+
});
|
|
96218
|
+
editor.editorCommandProviders.registerCommandProvider(
|
|
96219
|
+
new TextCommandProvider(editor, { scriptDropDown: true, isFilter: true })
|
|
96220
|
+
);
|
|
96221
|
+
editor.addCustom("editor-tooltip", () => new OnesEditorTooltip(editor));
|
|
96222
|
+
(_j = editor.findCustom("editor-quick-menu")) == null ? void 0 : _j.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
|
|
96223
|
+
(_k = editor.findCustom("editor-block-menu")) == null ? void 0 : _k.addFilter("layout-quick-menu-filter", LayoutQuickMenuItemFilter.init(editor));
|
|
96224
|
+
}
|
|
96225
|
+
editor.addCustom("create-options", () => new OnesEditorCustomDataWrapper(editor, options));
|
|
96226
|
+
if ((_l = options.componentsOptions) == null ? void 0 : _l.mention) {
|
|
96227
|
+
const mentionOptions = options.componentsOptions.mention;
|
|
96228
|
+
editor.addCustom("mention", () => new OnesEditorMention(editor, mentionOptions));
|
|
96229
|
+
}
|
|
96230
|
+
if (options.autoNewLine) {
|
|
96231
|
+
editor.addCustom("auto-new-line", () => new AutoNewLine(editor));
|
|
96232
|
+
}
|
|
96233
|
+
editor.addListener("clickLink", (editor2, event, link2) => {
|
|
96234
|
+
var _a2;
|
|
96235
|
+
if ((_a2 = options == null ? void 0 : options.events) == null ? void 0 : _a2.onClickLink) {
|
|
96236
|
+
options.events.onClickLink(editor2, event, link2);
|
|
96237
|
+
return;
|
|
96238
|
+
}
|
|
96239
|
+
const href = link2.getAttribute("link") || link2.getAttribute("href");
|
|
96240
|
+
if (href) {
|
|
96241
|
+
if (editor2.readonly || event.ctrlKey || event.metaKey || !getParentBlock(link2)) {
|
|
96242
|
+
window.open(href, "_blank");
|
|
96243
|
+
}
|
|
96244
|
+
}
|
|
96245
|
+
});
|
|
96246
|
+
OnesEditorToolbar.register(editor);
|
|
96247
|
+
editor.version = "3.0.3-beta.1";
|
|
96248
|
+
return editor;
|
|
96249
|
+
}
|
|
96236
96250
|
const emojis$1 = {
|
|
96237
96251
|
smileysAndPeople: [
|
|
96238
96252
|
"\u{1F600}",
|
|
@@ -142027,7 +142041,6 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
142027
142041
|
exports2.DrawioPasteHandler = DrawioPasteHandler;
|
|
142028
142042
|
exports2.Dropdown = Dropdown;
|
|
142029
142043
|
exports2.DropdownFilterableList = DropdownFilterableList;
|
|
142030
|
-
exports2.Edit2Icon = Edit2Icon;
|
|
142031
142044
|
exports2.EditIcon = EditIcon;
|
|
142032
142045
|
exports2.EditorBlocks = EditorBlocks;
|
|
142033
142046
|
exports2.EditorBoxes = EditorBoxes;
|
|
@@ -142184,7 +142197,6 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
142184
142197
|
exports2.RemoteCaretsInsertion = RemoteCaretsInsertion;
|
|
142185
142198
|
exports2.RemoteUsers = RemoteUsers;
|
|
142186
142199
|
exports2.RequestReloadError = RequestReloadError;
|
|
142187
|
-
exports2.RevertIcon = RevertIcon;
|
|
142188
142200
|
exports2.RichText = RichText;
|
|
142189
142201
|
exports2.RightArrowIcon = rightArrow;
|
|
142190
142202
|
exports2.ScriptDropdownProvider = ScriptDropdownProvider;
|
|
@@ -142261,7 +142273,6 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
142261
142273
|
exports2.addMonths = addMonths;
|
|
142262
142274
|
exports2.adjustSelectionPos = adjustSelectionPos$1;
|
|
142263
142275
|
exports2.animateScrollTo = animateScrollTo;
|
|
142264
|
-
exports2.apiResultToDocVersions = apiResultToDocVersions;
|
|
142265
142276
|
exports2.applyPlaceholderToBlock = applyPlaceholderToBlock;
|
|
142266
142277
|
exports2.assert = assert;
|
|
142267
142278
|
exports2.autoShowHideTemplates = autoShowHideTemplates;
|
|
@@ -142351,6 +142362,7 @@ ${JSON.stringify(error2, null, 2)}`);
|
|
|
142351
142362
|
exports2.createSeparator = createSeparator;
|
|
142352
142363
|
exports2.createSimpleBlockPosition = createSimpleBlockPosition;
|
|
142353
142364
|
exports2.createSimpleDocPos = createSimpleDocPos;
|
|
142365
|
+
exports2.createSimpleInput = createSimpleInput;
|
|
142354
142366
|
exports2.createTextBlockData = createTextBlockData;
|
|
142355
142367
|
exports2.createTextButton = createTextButton;
|
|
142356
142368
|
exports2.createTextOp = createTextOp;
|