@ones-editor/editor 2.1.1-beta.70 → 2.1.1-beta.71

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/dist/index.js CHANGED
@@ -148,6 +148,7 @@ div.editor-root div.editor-content div[data-type=editor-container] div[data-type
148
148
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.text.link:hover, div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.inputting-insertion.link:hover {
149
149
  cursor: pointer;
150
150
  color: #0053cf;
151
+ text-decoration: underline;
151
152
  }
152
153
  div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.text.link.style-strikethrough:hover, div.editor-root div.editor-content div[data-type=editor-container] div[data-type=editor-block] div[data-type=block-content] > span.inputting-insertion.link.style-strikethrough:hover {
153
154
  text-decoration: underline line-through;
@@ -65023,6 +65024,9 @@ ${codeText}
65023
65024
  if (!enableComments) {
65024
65025
  standardCommands = standardCommands.filter((command) => command.id !== "add-comment");
65025
65026
  }
65027
+ if (this.editor.readonly) {
65028
+ standardCommands = standardCommands.filter((command) => command.id !== "edit");
65029
+ }
65026
65030
  standardCommands.forEach((item) => {
65027
65031
  if (item.id === "add-comment" || item.id === "edit") {
65028
65032
  item.states = this.editor.isBlockWritable(this.block) ? [] : ["disabled"];
@@ -79804,15 +79808,15 @@ ${content}
79804
79808
  const commands = this.getCommands();
79805
79809
  this.toolbar.updateItems(commands);
79806
79810
  const focusBlock = this.editor.selection.focusedBlock;
79807
- const rect = getBlockCaretRect(this.editor, focusBlock, this.editor.selection.range.start);
79808
- const anchor2 = createBlockAnchor(this.editor, focusBlock, "editor-quick-menu", rect);
79811
+ const rect = getBlockCaretRect(this.editor, focusBlock, this.editor.selection.range.focus);
79812
+ const anchor2 = createBlockAnchor(this.editor, focusBlock, "editor-cursor-toolbar", rect);
79809
79813
  this.toolbar.manualShow(anchor2, {
79810
79814
  placement: "top",
79811
79815
  offset: [0, 14]
79812
79816
  });
79813
79817
  });
79814
79818
  __publicField(this, "close", () => {
79815
- this.toolbar.close("clickItem");
79819
+ this.toolbar.close("cancelBar");
79816
79820
  });
79817
79821
  this.editor = editor;
79818
79822
  this.toolbar = new ManualToolbar([], void 0, {
@@ -80123,6 +80127,14 @@ ${content}
80123
80127
  this.mobileToolbar.addListener("subBarShown", this.handleSubBarShow);
80124
80128
  this.mobileToolbar.addListener("click", this.handleClick);
80125
80129
  this.editor.addListener("selectionChanged", this.handleSelectionChange);
80130
+ setTimeout(() => {
80131
+ const container = this.bar.firstChild;
80132
+ if (container.scrollWidth > container.clientWidth) {
80133
+ container.classList.add("overflowing");
80134
+ } else {
80135
+ container.classList.remove("overflowing");
80136
+ }
80137
+ }, 500);
80126
80138
  }
80127
80139
  destroy() {
80128
80140
  this.editor.removeListener("selectionChanged", this.handleSelectionChange);
@@ -80154,9 +80166,8 @@ ${content}
80154
80166
  constructor(editor) {
80155
80167
  __publicField(this, "commandBar");
80156
80168
  __publicField(this, "observer");
80157
- __publicField(this, "showKeyboard", false);
80158
80169
  __publicField(this, "toggleDelay", clientType.isSafari ? 800 : 100);
80159
- __publicField(this, "toggle", debounce__default.default(() => {
80170
+ __publicField(this, "layoutBar", debounce__default.default(() => {
80160
80171
  const offsetHeight = Math.max(this.clientHeight - this.virtualViewportHeight, 0);
80161
80172
  this.commandBar.bar.style.bottom = `${offsetHeight}px`;
80162
80173
  }, this.toggleDelay));
@@ -80170,33 +80181,18 @@ ${content}
80170
80181
  }
80171
80182
  }, 100));
80172
80183
  __publicField(this, "handleFocusIn", () => {
80173
- if (!this.showKeyboard) {
80174
- this.showKeyboard = true;
80175
- }
80176
- this.toggle();
80184
+ this.layoutBar();
80177
80185
  });
80178
80186
  __publicField(this, "handleFocusOut", () => {
80179
- if (this.showKeyboard) {
80180
- this.showKeyboard = false;
80181
- }
80182
- this.toggle();
80187
+ this.layoutBar();
80183
80188
  });
80184
80189
  this.editor = editor;
80185
- createMobileBottomMenu();
80186
80190
  this.commandBar = new MobileToolbarHandler(editor, document.body);
80187
80191
  this.observer = new ActiveElementObserver({
80188
80192
  onFocused: this.handleFocusIn,
80189
80193
  onBlurred: this.handleFocusOut
80190
80194
  });
80191
- this.toggle();
80192
- setTimeout(() => {
80193
- const container = this.commandBar.bar.firstChild;
80194
- if (container.scrollWidth > container.clientWidth) {
80195
- container.classList.add("overflowing");
80196
- } else {
80197
- container.classList.remove("overflowing");
80198
- }
80199
- }, 500);
80195
+ this.layoutBar();
80200
80196
  this.editor.scrollContainer.addEventListener("scroll", this.handScroll);
80201
80197
  }
80202
80198
  get window() {
@@ -80366,6 +80362,7 @@ ${content}
80366
80362
  this.gripper = new SelectionGripper(this.editor);
80367
80363
  this.cursorToolbar = createCursorToolbar(this.editor);
80368
80364
  this.mobileEmbedMask = new MobileEmbedMask(this.editor);
80365
+ createMobileBottomMenu();
80369
80366
  }
80370
80367
  destroy() {
80371
80368
  this.editor.removeListener("selectionChanged", this.handleSelectionChange);
@@ -82228,8 +82225,8 @@ ${content}
82228
82225
  }
82229
82226
  function getBlockProperties$5(editor, block) {
82230
82227
  const properties = getStandardEmbedBlockProperties(editor, block, {
82231
- presetIds: editor.readonly ? [] : ["add-comment"],
82232
- extCommands: [{
82228
+ presetIds: ["add-comment"],
82229
+ extCommands: editor.readonly ? [] : [{
82233
82230
  id: "refresh",
82234
82231
  name: i18n$1.t("webpage.command.refresh"),
82235
82232
  icon: RefreshIcon
@@ -83043,8 +83040,8 @@ ${content}
83043
83040
  states: !drawioImg ? ["disabled"] : []
83044
83041
  }];
83045
83042
  },
83046
- presetIds: editor.readonly ? [] : ["edit"],
83047
- extIds: editor.readonly ? [] : ["separator", "add-comment"]
83043
+ presetIds: ["edit"],
83044
+ extIds: ["separator", "add-comment"]
83048
83045
  });
83049
83046
  return { ...properties, abstract: i18n$1.t("drawio.abstract") };
83050
83047
  }
@@ -83278,19 +83275,14 @@ ${content}
83278
83275
  plantuml: "https://plantuml.com/"
83279
83276
  };
83280
83277
  class GraphBlockCommands {
83281
- constructor(editor, graphType, properties) {
83282
- this.editor = editor;
83278
+ constructor(graphType, properties) {
83279
+ __publicField(this, "presetIds", ["edit"]);
83280
+ __publicField(this, "extIds", ["separator", "add-comment"]);
83283
83281
  this.graphType = graphType;
83284
83282
  this.properties = properties;
83285
83283
  }
83286
- get presetIds() {
83287
- return this.editor.readonly ? [] : ["edit"];
83288
- }
83289
- get extIds() {
83290
- return this.editor.readonly ? [] : ["separator", "add-comment"];
83291
- }
83292
83284
  extCommands(editor, block) {
83293
- const commands = [
83285
+ let commands = [
83294
83286
  {
83295
83287
  id: "help",
83296
83288
  name: i18n$1.t("graph.help"),
@@ -83306,6 +83298,9 @@ ${content}
83306
83298
  icon: DownloadIcon$1,
83307
83299
  states: !graphImgSrc ? ["disabled"] : []
83308
83300
  });
83301
+ if (editor.readonly) {
83302
+ commands = commands.filter((c) => c.id !== "help");
83303
+ }
83309
83304
  return commands;
83310
83305
  }
83311
83306
  handleExecuteCommand(editor, block, item) {
@@ -83328,7 +83323,7 @@ ${content}
83328
83323
  }
83329
83324
  }
83330
83325
  function getGraphEmbedBlockProperties(editor, block, type, properties) {
83331
- const standardProperties = getStandardEmbedBlockProperties(editor, block, new GraphBlockCommands(editor, type, properties));
83326
+ const standardProperties = getStandardEmbedBlockProperties(editor, block, new GraphBlockCommands(type, properties));
83332
83327
  return { ...standardProperties, abstract: lodash.exports.capitalize(type) };
83333
83328
  }
83334
83329
  class GraphBase {
@@ -86801,7 +86796,7 @@ ${data2.flowchartText}
86801
86796
  }
86802
86797
  }
86803
86798
  });
86804
- editor.version = "2.1.1-beta.70";
86799
+ editor.version = "2.1.1-beta.71";
86805
86800
  if (Logger$2.level === LogLevel.DEBUG) {
86806
86801
  window.setReauthFail = (fail) => {
86807
86802
  window.isReauthError = fail;
@@ -86902,7 +86897,7 @@ ${data2.flowchartText}
86902
86897
  });
86903
86898
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
86904
86899
  OnesEditorToolbar.register(editor);
86905
- editor.version = "2.1.1-beta.70";
86900
+ editor.version = "2.1.1-beta.71";
86906
86901
  return editor;
86907
86902
  }
86908
86903
  async function showDocVersions(editor, options, serverUrl) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ones-editor/editor",
3
- "version": "2.1.1-beta.70",
3
+ "version": "2.1.1-beta.71",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",