@ones-editor/editor 3.0.2-beta.3 → 3.0.2-beta.4

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.
@@ -7,6 +7,7 @@ export interface VersionDialogOptions {
7
7
  enableEdit?: boolean;
8
8
  textRenders?: OnesEditorBlockRenderer[];
9
9
  autoCompareWithLastVersion?: boolean;
10
+ compareWith?: VersionNum;
10
11
  getDisabledTip?: () => string | undefined;
11
12
  onMemoChanged?: (version: DocVersion) => void;
12
13
  onBeforeEditMemo?: () => Promise<boolean>;
package/dist/index.js CHANGED
@@ -83447,20 +83447,33 @@ ${docStr}
83447
83447
  this.versionList = versionList2;
83448
83448
  }
83449
83449
  initViewVersion() {
83450
- var _a, _b;
83451
- const autoCompareWithLastVersion = (_a = this.versionOptions) == null ? void 0 : _a.autoCompareWithLastVersion;
83450
+ var _a, _b, _c;
83451
+ let compareWithVersion;
83452
+ if ((_a = this.versionOptions) == null ? void 0 : _a.compareWith) {
83453
+ compareWithVersion = this.versions.find((v) => {
83454
+ var _a2, _b2;
83455
+ if (v.version === ((_a2 = this.versionOptions) == null ? void 0 : _a2.compareWith)) {
83456
+ return true;
83457
+ }
83458
+ if (getVersionName(v) === ((_b2 = this.versionOptions) == null ? void 0 : _b2.compareWith)) {
83459
+ return true;
83460
+ }
83461
+ return false;
83462
+ });
83463
+ }
83464
+ const autoCompareWithLastVersion = (_b = this.versionOptions) == null ? void 0 : _b.autoCompareWithLastVersion;
83452
83465
  assert(logger$y, this.versionList, "no versionList");
83453
- if ((_b = this.versionOptions) == null ? void 0 : _b.initSelectedVersion) {
83466
+ if ((_c = this.versionOptions) == null ? void 0 : _c.initSelectedVersion) {
83454
83467
  const { initSelectedVersion: versionNumber } = this.versionOptions;
83455
83468
  const version2 = this.versionList.selectVersionByVersionNum(versionNumber);
83456
83469
  if (version2) {
83457
- this.viewVersion(version2, void 0, { autoCompareWithLastVersion });
83470
+ this.viewVersion(version2, compareWithVersion, { autoCompareWithLastVersion });
83458
83471
  return;
83459
83472
  }
83460
83473
  }
83461
83474
  const version = this.versionList.activeVersion;
83462
83475
  if (version) {
83463
- this.viewVersion(version, void 0, { autoCompareWithLastVersion });
83476
+ this.viewVersion(version, compareWithVersion, { autoCompareWithLastVersion });
83464
83477
  }
83465
83478
  }
83466
83479
  renderEditorLoading() {
@@ -96032,7 +96045,7 @@ ${JSON.stringify(error2, null, 2)}`);
96032
96045
  }
96033
96046
  }
96034
96047
  });
96035
- editor.version = "3.0.2-beta.3";
96048
+ editor.version = "3.0.2-beta.4";
96036
96049
  return editor;
96037
96050
  }
96038
96051
  function isDoc(doc2) {
@@ -96166,7 +96179,7 @@ ${JSON.stringify(error2, null, 2)}`);
96166
96179
  OnesEditorDropTarget.register(editor);
96167
96180
  OnesEditorTocProvider.register(editor);
96168
96181
  OnesEditorExclusiveBlock.register(editor);
96169
- editor.version = "3.0.2-beta.3";
96182
+ editor.version = "3.0.2-beta.4";
96170
96183
  return editor;
96171
96184
  }
96172
96185
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "3.0.2-beta.3",
3
+ "version": "3.0.2-beta.4",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {