@ones-editor/editor 2.2.14-beta.13 → 2.2.14-beta.15

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
@@ -3952,6 +3952,9 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] div[
3952
3952
  .editor-root .editor-content div[data-type=editor-block].comment.active::after {
3953
3953
  display: none;
3954
3954
  }
3955
+ .editor-root .editor-content div[data-type=editor-block].comment.active > div[data-type=block-content] {
3956
+ outline: none;
3957
+ }
3955
3958
  .editor-root .editor-content div[data-type=editor-block] div[data-type=block-tools] .block-comment-button {
3956
3959
  all: unset;
3957
3960
  position: absolute;
@@ -7119,7 +7122,7 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] .emb
7119
7122
  flex-shrink: 0;
7120
7123
  height: 40px;
7121
7124
  padding: 10px 20px;
7122
- gap: 20px;
7125
+ gap: 6px;
7123
7126
  background: var(--Background-Default-o-color-bg-weak, #f7f8fa);
7124
7127
  border-bottom: 1px solid var(--border-color);
7125
7128
  }
@@ -7183,6 +7186,61 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] .emb
7183
7186
  margin-left: -5px;
7184
7187
  cursor: col-resize;
7185
7188
  }
7189
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea,
7190
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar,
7191
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea,
7192
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar,
7193
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea {
7194
+ overflow: auto;
7195
+ scrollbar-color: transparent transparent;
7196
+ scrollbar-width: thin;
7197
+ /* Handle */
7198
+ /* Handle on hover */
7199
+ }
7200
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar:hover, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea:hover,
7201
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar:hover,
7202
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea:hover,
7203
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar:hover,
7204
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea:hover {
7205
+ scrollbar-color: var(--other-o-color-scrollbar, #bebfc2) transparent;
7206
+ overflow-y: scroll !important;
7207
+ }
7208
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar:focus, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea:focus,
7209
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar:focus,
7210
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea:focus,
7211
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar:focus,
7212
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea:focus {
7213
+ scrollbar-color: var(--other-o-color-scrollbar, #bebfc2) transparent;
7214
+ }
7215
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-track, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-track,
7216
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-track,
7217
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-track,
7218
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-track,
7219
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-track {
7220
+ background: transparent;
7221
+ }
7222
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-thumb, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-thumb,
7223
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-thumb,
7224
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-thumb,
7225
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-thumb,
7226
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-thumb {
7227
+ border-radius: 4px;
7228
+ background: transparent;
7229
+ }
7230
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-thumb:hover, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-thumb:hover,
7231
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-thumb:hover,
7232
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-thumb:hover,
7233
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar::-webkit-scrollbar-thumb:hover,
7234
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea::-webkit-scrollbar-thumb:hover {
7235
+ background: var(--other-o-color-scrollbar, #bebfc2);
7236
+ }
7237
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .custom-scrollbar:hover::-webkit-scrollbar-thumb, .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container textarea:hover::-webkit-scrollbar-thumb,
7238
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .custom-scrollbar:hover::-webkit-scrollbar-thumb,
7239
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container textarea:hover::-webkit-scrollbar-thumb,
7240
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .custom-scrollbar:hover::-webkit-scrollbar-thumb,
7241
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container textarea:hover::-webkit-scrollbar-thumb {
7242
+ background: var(--other-o-color-scrollbar, #bebfc2);
7243
+ }
7186
7244
  .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-code-editor-container,
7187
7245
  .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-code-editor-container,
7188
7246
  .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-code-editor-container {
@@ -7237,11 +7295,14 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] .emb
7237
7295
  max-width: 100%;
7238
7296
  max-height: 100%;
7239
7297
  }
7240
- div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=mermaid]:not(.highlighted).selected > div[data-type=block-content]::before,
7241
- div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=flowchart]:not(.highlighted).selected > div[data-type=block-content]::before,
7242
- div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=plantuml]:not(.highlighted).selected > div[data-type=block-content]::before {
7298
+ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=mermaid].no-highlighted.selected > div[data-type=block-content]::before,
7299
+ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=flowchart].no-highlighted.selected > div[data-type=block-content]::before,
7300
+ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container] .embed-block[data-embed-type=plantuml].no-highlighted.selected > div[data-type=block-content]::before {
7243
7301
  background-color: transparent;
7244
7302
  }
7303
+ div[data-type=editor-block].layout-block .layout-column-container > .container-blocks > .embed-block[data-embed-type=mermaid] div[data-type=block-content], div[data-type=editor-block].layout-block .layout-column-container > .container-blocks > .embed-block[data-embed-type=flowchart] div[data-type=block-content], div[data-type=editor-block].layout-block .layout-column-container > .container-blocks > .embed-block[data-embed-type=plantuml] div[data-type=block-content] {
7304
+ min-width: 290px;
7305
+ }
7245
7306
  div.comment-editor-root [data-type=editor-container].root .embed-block[data-embed-type=mermaid],
7246
7307
  div.comment-editor-root [data-type=editor-container].root .embed-block[data-embed-type=flowchart],
7247
7308
  div.comment-editor-root [data-type=editor-container].root .embed-block[data-embed-type=plantuml] {
@@ -28538,7 +28599,10 @@ ${codeText}
28538
28599
  }
28539
28600
  function editorHandleCopyMarkdown(editor) {
28540
28601
  if (editor.selection.range.isCollapsed()) {
28541
- return false;
28602
+ const block = editor.selection.focusedBlock;
28603
+ if (!isEmbedBlock(block)) {
28604
+ return false;
28605
+ }
28542
28606
  }
28543
28607
  const doc2 = selectionToDoc$2(editor);
28544
28608
  addMetaToDoc(editor, doc2);
@@ -81668,6 +81732,24 @@ ${content}
81668
81732
  }
81669
81733
  }
81670
81734
  });
81735
+ __publicField(this, "handleClick", (e2) => {
81736
+ const target = e2.target;
81737
+ if (target instanceof HTMLElement) {
81738
+ const blockElement = getParentBlock(target);
81739
+ assert(logger$k, blockElement, "blockElement does not exist");
81740
+ if (!hasClass(target, "embed-graph-header")) {
81741
+ addClass(blockElement, "no-highlighted");
81742
+ } else {
81743
+ removeClass(blockElement, "no-highlighted");
81744
+ }
81745
+ }
81746
+ });
81747
+ __publicField(this, "handleSelectionChanged", (editor) => {
81748
+ const block = editor.selection.focusedBlock;
81749
+ if (block !== this.block) {
81750
+ removeClass(this.block, "no-highlighted");
81751
+ }
81752
+ });
81671
81753
  __publicField(this, "handleInputFocusChange", (focused, id) => {
81672
81754
  const block = this.editor.getBlockById(id);
81673
81755
  if (focused) {
@@ -81737,6 +81819,7 @@ ${content}
81737
81819
  }));
81738
81820
  this.editor = editor;
81739
81821
  this.editor.addListener("readonlyChanged", this.handleReadonlyChanged);
81822
+ this.editor.addListener("selectionChanged", this.handleSelectionChanged);
81740
81823
  GraphExclusiveHandler.get(editor).addListener("onExclusiveBlock", this.handleExclusiveBlock);
81741
81824
  }
81742
81825
  get block() {
@@ -81748,6 +81831,7 @@ ${content}
81748
81831
  destroy() {
81749
81832
  var _a, _b, _c;
81750
81833
  this.editor.removeListener("readonlyChanged", this.handleReadonlyChanged);
81834
+ this.editor.removeListener("selectionChanged", this.handleSelectionChanged);
81751
81835
  (_a = this.layout) == null ? void 0 : _a.destroy();
81752
81836
  (_b = this.viewSelect) == null ? void 0 : _b.destroy();
81753
81837
  (_c = this.drawHandler) == null ? void 0 : _c.destroy();
@@ -81761,7 +81845,6 @@ ${content}
81761
81845
  createEmbedContent(content, blockData) {
81762
81846
  const { code, src, height, flex = DEFAULT_FLEX, view } = this.getGraphData(blockData);
81763
81847
  const header = createElement("div", ["embed-graph-header"], content, i18n$1.t(`graph.${this.graphType}`));
81764
- bindPreventSelect(header, this.handleBlockFocus);
81765
81848
  this.viewSelect = new ViewSelect(header);
81766
81849
  this.viewSelect.addListener("viewChange", this.updateLayoutData);
81767
81850
  const left = createElement("div", ["embed-graph-left"], null);
@@ -81782,6 +81865,7 @@ ${content}
81782
81865
  return;
81783
81866
  }
81784
81867
  const blockElement = this.editor.getBlockById(blockData.id);
81868
+ blockElement.addEventListener("mousedown", this.handleClick, { capture: true });
81785
81869
  EmbedBlockResizer.register(this.editor, blockElement, { maxHeight: GRAPH_MAX_HEIGHT, minHeight: GRAPH_MIN_HEIGHT });
81786
81870
  });
81787
81871
  }
@@ -82016,13 +82100,13 @@ ${content}
82016
82100
  return "<p>[mermaid]</p>";
82017
82101
  }
82018
82102
  if (type === "markdown") {
82019
- if (data2.src) {
82020
- return `![mermaid](${editor.doc.buildResourceUrl(data2.src, { withToken: true })})`;
82021
- }
82022
82103
  if (data2.mermaidText) {
82023
- return `\`\`\`mermaid\`\`\`
82104
+ return `\`\`\`mermaid
82024
82105
  ${data2.mermaidText}
82025
- \`\`\`\`\`\``;
82106
+ \`\`\``;
82107
+ }
82108
+ if (data2.src) {
82109
+ return `![mermaid](${editor.doc.buildResourceUrl(data2.src, { withToken: true })})`;
82026
82110
  }
82027
82111
  }
82028
82112
  return "";
@@ -82113,7 +82197,8 @@ ${data2.mermaidText}
82113
82197
  code: embedData.flowchartText,
82114
82198
  src: embedData.src,
82115
82199
  flex: embedData.flex,
82116
- height: embedData.height
82200
+ height: embedData.height,
82201
+ view: embedData.view
82117
82202
  };
82118
82203
  });
82119
82204
  }
@@ -82182,13 +82267,13 @@ ${data2.mermaidText}
82182
82267
  return "<p>[flowchart]</p>";
82183
82268
  }
82184
82269
  if (type === "markdown") {
82185
- if (data2.src) {
82186
- return `![flowchart](${editor.doc.buildResourceUrl(data2.src, { withToken: true })})`;
82187
- }
82188
82270
  if (data2.flowchartText) {
82189
- return `\`\`\`flowchart\`\`\`
82271
+ return `\`\`\`flowchart
82190
82272
  ${data2.flowchartText}
82191
- \`\`\`\`\`\``;
82273
+ \`\`\``;
82274
+ }
82275
+ if (data2.src) {
82276
+ return `![flowchart](${editor.doc.buildResourceUrl(data2.src, { withToken: true })})`;
82192
82277
  }
82193
82278
  }
82194
82279
  return "";
@@ -83092,7 +83177,8 @@ ${data2.flowchartText}
83092
83177
  code: embedData.plantumlText,
83093
83178
  src: embedData.src,
83094
83179
  flex: embedData.flex,
83095
- height: embedData.height
83180
+ height: embedData.height,
83181
+ view: embedData.view
83096
83182
  };
83097
83183
  });
83098
83184
  }
@@ -83162,13 +83248,13 @@ ${data2.flowchartText}
83162
83248
  return "<p>[plantuml]</p>";
83163
83249
  }
83164
83250
  if (type === "markdown") {
83165
- if (data2.src) {
83166
- return `![plantuml](${editor.doc.buildResourceUrl(data2.src, { withToken: true })})`;
83167
- }
83168
83251
  if (data2.plantumlText) {
83169
- return `\`\`\`plantuml\`\`\`
83252
+ return `\`\`\`plantuml
83170
83253
  ${data2.plantumlText}
83171
- \`\`\`\`\`\``;
83254
+ \`\`\``;
83255
+ }
83256
+ if (data2.src) {
83257
+ return `![plantuml](${editor.doc.buildResourceUrl(data2.src, { withToken: true })})`;
83172
83258
  }
83173
83259
  }
83174
83260
  return "";
@@ -88971,7 +89057,7 @@ ${data2.plantumlText}
88971
89057
  }
88972
89058
  }
88973
89059
  });
88974
- editor.version = "2.2.14-beta.13";
89060
+ editor.version = "2.2.14-beta.15";
88975
89061
  return editor;
88976
89062
  }
88977
89063
  function isDoc(doc2) {
@@ -89072,7 +89158,7 @@ ${data2.plantumlText}
89072
89158
  });
89073
89159
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
89074
89160
  OnesEditorToolbar.register(editor);
89075
- editor.version = "2.2.14-beta.13";
89161
+ editor.version = "2.2.14-beta.15";
89076
89162
  return editor;
89077
89163
  }
89078
89164
  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.2.14-beta.13",
3
+ "version": "2.2.14-beta.15",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {