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

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
@@ -7109,14 +7109,19 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] .emb
7109
7109
  .embed-block[data-embed-type=flowchart] div[data-type=block-content],
7110
7110
  .embed-block[data-embed-type=plantuml] div[data-type=block-content] {
7111
7111
  --border-color: #e5e5e5;
7112
- display: flex;
7113
- flex-direction: column;
7114
7112
  outline: 1px solid var(--border-color);
7115
7113
  border-radius: 3px;
7116
7114
  }
7117
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-header,
7118
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-header,
7119
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-header {
7115
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper,
7116
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper,
7117
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper {
7118
+ display: flex;
7119
+ flex-direction: column;
7120
+ flex: 1;
7121
+ }
7122
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header,
7123
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header,
7124
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header {
7120
7125
  display: flex;
7121
7126
  align-items: center;
7122
7127
  flex-shrink: 0;
@@ -7126,58 +7131,58 @@ div.editor-root.readonly div.editor-content div[data-type=editor-container] .emb
7126
7131
  background: var(--Background-Default-o-color-bg-weak, #f7f8fa);
7127
7132
  border-bottom: 1px solid var(--border-color);
7128
7133
  }
7129
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-header .editor-command-bar-root,
7130
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-header .editor-command-bar,
7131
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-header .editor-command-bar-root,
7132
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-header .editor-command-bar,
7133
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-header .editor-command-bar-root,
7134
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-header .editor-command-bar {
7134
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header .editor-command-bar-root,
7135
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header .editor-command-bar,
7136
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header .editor-command-bar-root,
7137
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header .editor-command-bar,
7138
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header .editor-command-bar-root,
7139
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-header .editor-command-bar {
7135
7140
  background-color: transparent;
7136
7141
  }
7137
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content,
7138
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content,
7139
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content {
7142
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content,
7143
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content,
7144
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content {
7140
7145
  position: relative;
7141
7146
  display: flex;
7142
7147
  flex-direction: column;
7143
7148
  height: calc(100% - 40px);
7144
7149
  flex: 1;
7145
7150
  }
7146
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .graph-content,
7147
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .graph-content,
7148
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .graph-content {
7151
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content,
7152
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content,
7153
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content {
7149
7154
  flex: 1;
7150
7155
  display: flex;
7151
7156
  height: 100%;
7152
7157
  }
7153
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left,
7154
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left,
7155
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left {
7158
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left,
7159
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left,
7160
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left {
7156
7161
  border-right: 1px solid var(--border-color);
7157
7162
  }
7158
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left,
7159
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-right,
7160
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left,
7161
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-right,
7162
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left,
7163
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-right {
7163
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left,
7164
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-right,
7165
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left,
7166
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-right,
7167
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left,
7168
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-right {
7164
7169
  display: flex;
7165
7170
  align-items: center;
7166
7171
  justify-content: center;
7167
7172
  overflow: hidden;
7168
7173
  padding: 10px;
7169
7174
  }
7170
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left > div,
7171
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-right > div,
7172
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left > div,
7173
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-right > div,
7174
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-left > div,
7175
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .graph-content .embed-graph-right > div {
7175
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left > div,
7176
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-right > div,
7177
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left > div,
7178
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-right > div,
7179
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-left > div,
7180
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .graph-content .embed-graph-right > div {
7176
7181
  flex: 1;
7177
7182
  }
7178
- .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-content .resize-gripper,
7179
- .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-content .resize-gripper,
7180
- .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-content .resize-gripper {
7183
+ .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .resize-gripper,
7184
+ .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .resize-gripper,
7185
+ .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper .embed-graph-content .resize-gripper {
7181
7186
  position: absolute;
7182
7187
  top: 0;
7183
7188
  width: 10px;
@@ -7301,6 +7306,9 @@ div.editor-root:not(.readonly) div.editor-content div[data-type=editor-container
7301
7306
  background-color: transparent;
7302
7307
  }
7303
7308
  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] {
7309
+ overflow-x: auto;
7310
+ }
7311
+ div[data-type=editor-block].layout-block .layout-column-container > .container-blocks > .embed-block[data-embed-type=mermaid] div[data-type=block-content] .embed-graph-wrapper, div[data-type=editor-block].layout-block .layout-column-container > .container-blocks > .embed-block[data-embed-type=flowchart] div[data-type=block-content] .embed-graph-wrapper, div[data-type=editor-block].layout-block .layout-column-container > .container-blocks > .embed-block[data-embed-type=plantuml] div[data-type=block-content] .embed-graph-wrapper {
7304
7312
  min-width: 290px;
7305
7313
  }
7306
7314
  div.comment-editor-root [data-type=editor-container].root .embed-block[data-embed-type=mermaid],
@@ -81842,8 +81850,9 @@ ${content}
81842
81850
  const oldCode = this.getGraphData(data2).code;
81843
81851
  return oldCode !== code;
81844
81852
  }
81845
- createEmbedContent(content, blockData) {
81853
+ createEmbedContent(blockContent, blockData) {
81846
81854
  const { code, src, height, flex = DEFAULT_FLEX, view } = this.getGraphData(blockData);
81855
+ const content = createElement("div", ["embed-graph-wrapper"], blockContent);
81847
81856
  const header = createElement("div", ["embed-graph-header"], content, i18n$1.t(`graph.${this.graphType}`));
81848
81857
  this.viewSelect = new ViewSelect(header);
81849
81858
  this.viewSelect.addListener("viewChange", this.updateLayoutData);
@@ -81858,13 +81867,16 @@ ${content}
81858
81867
  const realView = this.getRealView(view);
81859
81868
  this.viewSelect.setSelectedView(realView);
81860
81869
  this.updateLayout(realView, flex);
81861
- this.updateHeight(content, height);
81870
+ this.updateHeight(blockContent, height);
81862
81871
  this.updateDraw(src, code);
81863
81872
  setTimeout(() => {
81864
81873
  if (clientType.isMobile) {
81865
81874
  return;
81866
81875
  }
81867
81876
  const blockElement = this.editor.getBlockById(blockData.id);
81877
+ if (!this.editor.readonly) {
81878
+ addClass(blockElement, "no-highlighted");
81879
+ }
81868
81880
  blockElement.addEventListener("mousedown", this.handleClick, { capture: true });
81869
81881
  EmbedBlockResizer.register(this.editor, blockElement, { maxHeight: GRAPH_MAX_HEIGHT, minHeight: GRAPH_MIN_HEIGHT });
81870
81882
  });
@@ -81987,6 +81999,9 @@ ${content}
81987
81999
  static get(editor, id) {
81988
82000
  return editor.addCustom(`${MERMAID_TYPE}_${id}`, () => new _MermaidInstance(editor));
81989
82001
  }
82002
+ static destroyCustom(editor, id) {
82003
+ editor.destroyCustom(`${MERMAID_TYPE}_${id}`);
82004
+ }
81990
82005
  code2ObjectUrl(code) {
81991
82006
  return mermaidCodeToObjectUrl(this.editor, code);
81992
82007
  }
@@ -82113,8 +82128,7 @@ ${data2.mermaidText}
82113
82128
  }
82114
82129
  function handleDeleteBlock$2(editor, block) {
82115
82130
  const blockId = getBlockId(block);
82116
- const mermaid = MermaidInstance.get(editor, blockId);
82117
- mermaid.destroy();
82131
+ MermaidInstance.destroyCustom(editor, blockId);
82118
82132
  }
82119
82133
  const MermaidEmbed = {
82120
82134
  embedType: MERMAID_TYPE,
@@ -89057,7 +89071,7 @@ ${data2.plantumlText}
89057
89071
  }
89058
89072
  }
89059
89073
  });
89060
- editor.version = "2.2.14-beta.15";
89074
+ editor.version = "2.2.14-beta.16";
89061
89075
  return editor;
89062
89076
  }
89063
89077
  function isDoc(doc2) {
@@ -89158,7 +89172,7 @@ ${data2.plantumlText}
89158
89172
  });
89159
89173
  editor.addCustom(DOC_RE_AUTH_KEYS, (editor2) => new DocReAuthCallbacks(editor2));
89160
89174
  OnesEditorToolbar.register(editor);
89161
- editor.version = "2.2.14-beta.15";
89175
+ editor.version = "2.2.14-beta.16";
89162
89176
  return editor;
89163
89177
  }
89164
89178
  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.15",
3
+ "version": "2.2.14-beta.16",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "dependencies": {