dragon-editor 3.1.1 → 3.2.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.
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <div class="dragon-editor" :class="{ '--hasMenu': props.useMenuBar === true }" @mousemove="resizeEvent" @touchmove="resizeEvent" @mouseup="resizeEventEnd" @touchend="resizeEventEnd" @mouseleave="resizeEventEnd" ref="$editor">
3
- <div v-if="props.useMenuBar === true" class="de-control-bar">
3
+ <div v-if="props.useMenuBar === true" class="de-menu-bar" :style="{ top: `${menuBarTop}px` }">
4
4
  <button class="de-menu de-menu-add" @click="isActiveAddBlockMenu = !isActiveAddBlockMenu">
5
5
  <svg class="de-icon" viewBox="0 0 64 64">
6
6
  <path class="de-path" d="M32 9C30.3431 9 29 10.3431 29 12V29H12C10.3431 29 9 30.3431 9 32C9 33.6569 10.3431 35 12 35H29V52C29 53.6569 30.3431 55 32 55C33.6569 55 35 53.6569 35 52V35H52C53.6569 35 55 33.6569 55 32C55 30.3431 53.6569 29 52 29H35V12C35 10.3431 33.6569 9 32 9Z"></path>
@@ -78,13 +78,48 @@
78
78
  <button class="de-add-block" @click="addBlock('heading3')">Heading-3</button>
79
79
  <button class="de-add-block" @click="addBlock('ul')">Unodered List</button>
80
80
  <button class="de-add-block" @click="addBlock('ol')">Odered List</button>
81
- <!-- <button class="de-add-block" @click="addBlock('codeblock')">Code Block</button> -->
82
- <!-- <button class="de-add-block" @click="addBlock('video')">Video</button> -->
81
+ <button class="de-add-block" @click="addBlock('code')">Code Block</button>
82
+ <!-- <button class="de-add-block" @click="addBlock('table')">Table Block</button> -->
83
+ <!-- <button class="de-add-block" @click="addBlock('video')">Video</button> youtube | vimeo -->
83
84
  </div>
84
85
  </div>
85
86
  </div>
86
87
 
87
- <div class="de-body" ref="$content" @keydown="contentKeyboardEvent" @mouseup="updateCursorData" @mousedown="resizeEventStart" @touchstart="resizeEventStart">
88
+ <div class="de-control-bar" :class="{ '--active': editorStore.controlBar.active === true }" :style="{ top: `${editorStore.controlBar.y}px`, left: `${editorStore.controlBar.x}px` }" ref="$controlBar">
89
+ <div v-if="['code'].includes(curruntType) === true" class="de-col">
90
+ <p class="de-name">Theme :</p>
91
+ <select class="de-selector" v-model="codeBlockTheme" @change="codeBlockThemeChangeEvent">
92
+ <option v-for="(item, i) in _getCodeBlockTheme()" :value="item.code" :key="`codeBlockTheme-${i}`">{{ item.text }}</option>
93
+ </select>
94
+ </div>
95
+ <!--
96
+ <div v-if="['code'].includes(curruntType) === true" class="de-col">
97
+ <p class="de-name">Language :</p>
98
+ <select class="de-selector" v-model="codeblockLanguage" @change="codeblockLanguageChangeEvent">
99
+ <option v-for="(item, i) in _getCodeBlockLanguage()" :value="item.code" :key="`codeBlockLanuage-${i}`">{{ item.text }}</option>
100
+ </select>
101
+ </div>
102
+ -->
103
+ <div v-if="['list'].includes(curruntType) === true" class="de-col">
104
+ <p class="de-name">List Style :</p>
105
+ <select class="de-selector" v-model="listBlockStyle" @change="listBlockStyleChangeEvent">
106
+ <template v-if="editorStore.$currentBlock.tagName === 'UL'">
107
+ <option value="disc">Disc</option>
108
+ <option value="square">Square</option>
109
+ </template>
110
+
111
+ <template v-else>
112
+ <option value="decimal">Decimal</option>
113
+ <option value="lower-alpha">Lower-Alpha</option>
114
+ <option value="upper-alpha">Upper-Alpha</option>
115
+ <option value="lower-roman">Lower-Roman</option>
116
+ <option value="upper-roman">Upper-Roman</option>
117
+ </template>
118
+ </select>
119
+ </div>
120
+ </div>
121
+
122
+ <div class="de-body" ref="$content" @keydown="contentKeyboardEvent" @mouseup="updateCursorData" @mousedown="resizeEventStart" @touchstart="resizeEventStart" @paste="contentPasteEvent">
88
123
  <p class="de-block de-text-block" contenteditable="true"></p>
89
124
  </div>
90
125
  </div>
@@ -93,9 +128,10 @@
93
128
  <script setup lang="ts">
94
129
  import { ref, onMounted, onUnmounted } from "vue";
95
130
  import { useEditorStore } from "../store";
131
+ import { _getCodeBlockTheme, _getCodeBlockLanguage, _setCodeBlockTheme, _setCodeBlockLanguage, _updateCodeBlockStyle, _setListBlockStyle, _updateListBlockStyle } from "../utils/controlBar";
96
132
  import { _findScrollingElement, _findContentEditableElement } from "../utils/element";
97
- import { _elementKeyEvent, _hotKeyEvent } from "../utils/keyboardEvent";
98
- import { _createTextBlock, _createHeadingBlock, _createListBlock, _createImageBlock, _createCustomBlock } from "../utils/block";
133
+ import { _elementKeyEvent, _hotKeyEvent, _copyEvent, _pasteEvent } from "../utils/keyboardEvent";
134
+ import { _getBlockType, _createTextBlock, _createHeadingBlock, _createListBlock, _createImageBlock, _createCustomBlock, _createCodeBlock } from "../utils/block";
99
135
  import { _setNodeStyle, _setTextAlign } from "../utils/style";
100
136
  import { _setCursorData, _clenupCursor } from "../utils/cursor";
101
137
  import { _getContentData, _setContentData } from "../utils/convertor";
@@ -109,10 +145,20 @@ const props = defineProps({
109
145
  default: () => true,
110
146
  },
111
147
  });
148
+ const emit = defineEmits<{
149
+ (e: "addPasteImage", file: File): DEImage;
150
+ }>();
112
151
  const editorStore = useEditorStore();
113
152
  const isActiveAddBlockMenu = ref<boolean>(false);
153
+ const menuBarTop = ref<number>(0);
154
+ const curruntType = ref<string>("");
155
+ const codeBlockTheme = ref<string>("github");
156
+ const codeblockLanguage = ref<string>("text");
157
+ const listBlockStyle = ref<DEListStyle>("disc");
158
+ const anchorTagValue = ref<string>("");
114
159
  const $editor = ref<HTMLDivElement>();
115
160
  const $content = ref<HTMLDivElement>();
161
+ const $controlBar = ref<HTMLDivElement>();
116
162
  let resizeEventActive: boolean = false;
117
163
  let resizeStartX: number = 0;
118
164
  let resizeType: string = "right";
@@ -138,6 +184,7 @@ function updateCursorData(e: MouseEvent) {
138
184
  editorStore.cursorData = originalCursorData;
139
185
  }
140
186
 
187
+ // 선택 블럭 업데이트
141
188
  if (e.target !== null) {
142
189
  const $block = (e.target as HTMLElement).closest(".de-block");
143
190
 
@@ -145,6 +192,32 @@ function updateCursorData(e: MouseEvent) {
145
192
  editorStore.setCurrentBlock($block as HTMLElement);
146
193
  }
147
194
  }
195
+
196
+ controlBarStatusUpdate();
197
+ }
198
+ // 컨트롤 바 상태 업데이트
199
+ function controlBarStatusUpdate() {
200
+ if (editorStore.$currentBlock !== null) {
201
+ const { type } = _getBlockType(editorStore.$currentBlock);
202
+ const activeList = ["code", "list"];
203
+
204
+ curruntType.value = type;
205
+
206
+ if (activeList.includes(curruntType.value) === true) {
207
+ editorStore.controlBarActive();
208
+
209
+ switch (type) {
210
+ case "code":
211
+ _updateCodeBlockStyle(editorStore, codeBlockTheme, codeblockLanguage);
212
+ break;
213
+ case "list":
214
+ _updateListBlockStyle(editorStore, listBlockStyle);
215
+ break;
216
+ }
217
+ } else {
218
+ editorStore.controlBarDeactive();
219
+ }
220
+ }
148
221
  }
149
222
 
150
223
  // 사이즈 조정 이벤트 시작
@@ -222,7 +295,7 @@ function resizeEventEnd() {
222
295
  // 메뉴 외부 클릭시 닫기
223
296
  function checkOthersideClick(event: MouseEvent) {
224
297
  if (event.target !== null) {
225
- const $controlBar = (event.target as HTMLElement).closest(".de-control-bar");
298
+ const $controlBar = (event.target as HTMLElement).closest(".de-menu-bar");
226
299
 
227
300
  if ($controlBar === null) {
228
301
  isActiveAddBlockMenu.value = false;
@@ -237,10 +310,70 @@ function deleteBlock() {
237
310
  }
238
311
  }
239
312
 
313
+ // 부모 요소 스크롤 이벤트 발생시 컨트롤 바 고정
314
+ function parentWrapScollEvent() {
315
+ editorStore.setParentWrapElement(_findScrollingElement($editor.value as HTMLElement));
316
+
317
+ if (props.useMenuBar === true && editorStore.$parentWrap !== null && editorStore.$editor !== null) {
318
+ // 메뉴바를 사용하는 경우만
319
+
320
+ const editorReac = editorStore.$editor.getBoundingClientRect();
321
+ let scrollY: number = 0;
322
+
323
+ if (editorStore.$parentWrap.constructor.name === "Window") {
324
+ scrollY = (editorStore.$parentWrap as Window).scrollY;
325
+ } else {
326
+ scrollY = (editorStore.$parentWrap as HTMLElement).scrollTop;
327
+ }
328
+
329
+ let realElementY = editorReac.y + scrollY;
330
+
331
+ if (editorStore.$parentWrap.constructor.name !== "Window") {
332
+ const parentRect = (editorStore.$parentWrap as HTMLElement).getBoundingClientRect();
333
+
334
+ realElementY -= parentRect.y;
335
+ }
336
+
337
+ if (scrollY > realElementY) {
338
+ menuBarTop.value = scrollY - realElementY - 1;
339
+ } else {
340
+ menuBarTop.value = 0;
341
+ }
342
+ }
343
+ }
344
+
345
+ // 붙여넣기 이벤트
346
+ function contentPasteEvent(event: ClipboardEvent) {
347
+ _pasteEvent(event, editorStore, emit);
348
+ }
349
+
240
350
  /**
241
351
  * 이벤트 관련 영역 종료
242
352
  */
243
353
 
354
+ /**
355
+ * 컨트롤 바 이벤트 관련 영역 시작
356
+ */
357
+
358
+ // 코드 블럭 테마 적용
359
+ function codeBlockThemeChangeEvent() {
360
+ _setCodeBlockTheme(editorStore, codeBlockTheme.value);
361
+ }
362
+
363
+ // 코드 블럭 언어 적용
364
+ function codeblockLanguageChangeEvent() {
365
+ _setCodeBlockLanguage(editorStore, codeblockLanguage.value);
366
+ }
367
+
368
+ // 리스트 스타일 적용
369
+ function listBlockStyleChangeEvent() {
370
+ _setListBlockStyle(editorStore, listBlockStyle.value);
371
+ }
372
+
373
+ /**
374
+ * 컨트롤 바 이벤트 관련 영역 종료
375
+ */
376
+
244
377
  function addBlock(type: string) {
245
378
  isActiveAddBlockMenu.value = false;
246
379
 
@@ -264,20 +397,11 @@ function addBlock(type: string) {
264
397
  });
265
398
  break;
266
399
  case "ul":
267
- blockStructure = _createListBlock({
268
- type: type,
269
- child: [
270
- {
271
- classList: [],
272
- textContent: "",
273
- },
274
- ],
275
- });
276
- break;
277
400
  case "ol":
278
401
  blockStructure = _createListBlock({
279
- type: type,
280
- pattern: "1",
402
+ type: "list",
403
+ element: type,
404
+ style: type === "ul" ? "disc" : "decimal",
281
405
  child: [
282
406
  {
283
407
  classList: [],
@@ -289,8 +413,14 @@ function addBlock(type: string) {
289
413
  case "table":
290
414
  // TODO : table block
291
415
  break;
292
- case "codeblock":
293
- // TODO : Code Block
416
+ case "code":
417
+ blockStructure = _createCodeBlock({
418
+ type: "code",
419
+ theme: "github",
420
+ filename: "",
421
+ language: "Plain Text",
422
+ textContent: "",
423
+ });
294
424
  break;
295
425
  }
296
426
 
@@ -302,9 +432,15 @@ function addBlock(type: string) {
302
432
  case "ol":
303
433
  (blockStructure.childNodes[0] as HTMLElement).focus();
304
434
  break;
435
+ case "codeblock":
436
+ blockStructure.querySelector("code")?.focus();
437
+ break;
305
438
  default:
306
439
  blockStructure.focus();
307
440
  }
441
+
442
+ editorStore.setCurrentBlock(blockStructure as HTMLElement);
443
+ controlBarStatusUpdate();
308
444
  }
309
445
  }
310
446
 
@@ -360,15 +496,17 @@ onMounted(() => {
360
496
  editorStore.setContentElement($content.value);
361
497
  }
362
498
 
363
- window.addEventListener("click", checkOthersideClick, true);
499
+ if ($controlBar.value !== undefined) {
500
+ editorStore.setContrulBar($controlBar.value);
501
+ }
364
502
 
365
- // TODO : set scroll event
503
+ window.addEventListener("click", checkOthersideClick, true);
504
+ editorStore.$parentWrap?.addEventListener("scroll", parentWrapScollEvent, true);
366
505
  });
367
506
 
368
507
  onUnmounted(() => {
369
508
  window.removeEventListener("click", checkOthersideClick, true);
370
-
371
- // TODO : remove scroll event
509
+ editorStore.$parentWrap?.removeEventListener("scroll", parentWrapScollEvent, true);
372
510
  });
373
511
 
374
512
  defineExpose({
@@ -530,28 +668,30 @@ defineExpose({
530
668
  padding: 20px;
531
669
  line-height: 1.6;
532
670
  }
533
- .dragon-editor .de-control-bar {
671
+ .dragon-editor .de-menu-bar {
534
672
  position: absolute;
535
673
  top: 0;
536
674
  left: 0;
537
675
  right: 0;
538
676
  height: 38px;
677
+ background: #fff;
539
678
  border-bottom: 1px solid #ccc;
679
+ z-index: 10;
540
680
  }
541
- .dragon-editor .de-control-bar .de-menu {
681
+ .dragon-editor .de-menu-bar .de-menu {
542
682
  min-width: 38px;
543
683
  height: 38px;
544
684
  padding: 0 8px;
545
685
  border-right: 1px solid #ccc;
546
686
  box-sizing: border-box;
547
687
  }
548
- .dragon-editor .de-control-bar .de-menu.--lastchild {
688
+ .dragon-editor .de-menu-bar .de-menu.--lastchild {
549
689
  border-right: 0;
550
690
  }
551
- .dragon-editor .de-control-bar .de-menu .de-path.--red {
691
+ .dragon-editor .de-menu-bar .de-menu .de-path.--red {
552
692
  fill: #dd0000;
553
693
  }
554
- .dragon-editor .de-control-bar .de-block-menu-area {
694
+ .dragon-editor .de-menu-bar .de-block-menu-area {
555
695
  display: none;
556
696
  position: absolute;
557
697
  top: 39px;
@@ -561,18 +701,49 @@ defineExpose({
561
701
  box-shadow: 0 2px 2px rgba(0, 0, 0, 0.25);
562
702
  z-index: 1000;
563
703
  }
564
- .dragon-editor .de-control-bar .de-block-menu-area.--active {
704
+ .dragon-editor .de-menu-bar .de-block-menu-area.--active {
565
705
  display: block;
566
706
  }
567
- .dragon-editor .de-control-bar .de-block-menu-area .de-list {
707
+ .dragon-editor .de-menu-bar .de-block-menu-area .de-list {
568
708
  display: flex;
569
709
  flex-direction: column;
570
710
  gap: 5px;
571
711
  padding: 5px;
572
712
  }
573
- .dragon-editor .de-control-bar .de-block-menu-area .de-add-block {
713
+ .dragon-editor .de-menu-bar .de-block-menu-area .de-add-block {
574
714
  line-height: 1.6;
575
715
  }
716
+ .dragon-editor .de-control-bar {
717
+ display: none;
718
+ position: fixed;
719
+ height: 38px;
720
+ background: #fff;
721
+ border: 1px solid #ccc;
722
+ border-width: 1px 0 0 1px;
723
+ transform: translateX(-50%);
724
+ z-index: 20;
725
+ }
726
+ .dragon-editor .de-control-bar.--active {
727
+ display: flex;
728
+ }
729
+ .dragon-editor .de-control-bar:empty {
730
+ display: none;
731
+ }
732
+ .dragon-editor .de-control-bar .de-col {
733
+ display: flex;
734
+ align-items: center;
735
+ column-gap: 6px;
736
+ padding: 0 10px;
737
+ border: 1px solid #ccc;
738
+ border-width: 0 1px 1px 0;
739
+ }
740
+ .dragon-editor .de-control-bar .de-col .de-selector {
741
+ height: 100%;
742
+ border: 0;
743
+ }
744
+ .dragon-editor .de-block {
745
+ width: 100%;
746
+ }
576
747
  .dragon-editor .de-text-block {
577
748
  min-height: 1.6em;
578
749
  outline: 0;
@@ -607,8 +778,28 @@ defineExpose({
607
778
  flex-direction: column;
608
779
  row-gap: 4px;
609
780
  padding-left: 24px;
781
+ }
782
+ .dragon-editor .de-list-block[data-style=disc] {
610
783
  list-style: disc;
611
784
  }
785
+ .dragon-editor .de-list-block[data-style=square] {
786
+ list-style: square;
787
+ }
788
+ .dragon-editor .de-list-block[data-style=decimal] {
789
+ list-style: decimal;
790
+ }
791
+ .dragon-editor .de-list-block[data-style=lower-alpha] {
792
+ list-style: lower-alpha;
793
+ }
794
+ .dragon-editor .de-list-block[data-style=upper-alpha] {
795
+ list-style: upper-alpha;
796
+ }
797
+ .dragon-editor .de-list-block[data-style=lower-roman] {
798
+ list-style: lower-roman;
799
+ }
800
+ .dragon-editor .de-list-block[data-style=upper-roman] {
801
+ list-style: upper-roman;
802
+ }
612
803
  .dragon-editor .de-list-block .de-item {
613
804
  min-height: 1.6em;
614
805
  outline: 0;
@@ -620,9 +811,6 @@ defineExpose({
620
811
  color: #ccc;
621
812
  cursor: text;
622
813
  }
623
- .dragon-editor ol.de-list-block {
624
- list-style: decimal;
625
- }
626
814
  .dragon-editor .de-image-block {
627
815
  display: flex;
628
816
  align-items: center;
@@ -908,6 +1096,262 @@ defineExpose({
908
1096
  color: #ccc;
909
1097
  cursor: text;
910
1098
  }
1099
+ .dragon-editor .de-code-block {
1100
+ display: flex;
1101
+ flex-wrap: wrap;
1102
+ }
1103
+ .dragon-editor .de-code-block .de-filename {
1104
+ flex: 1;
1105
+ padding: 5px 10px;
1106
+ box-sizing: border-box;
1107
+ outline: 0;
1108
+ }
1109
+ .dragon-editor .de-code-block .de-filename:empty:hover::before, .dragon-editor .de-code-block .de-filename:empty:focus::before {
1110
+ display: inline;
1111
+ content: "Type a Filename";
1112
+ cursor: text;
1113
+ }
1114
+ .dragon-editor .de-code-block .de-language {
1115
+ width: 120px;
1116
+ text-align: right;
1117
+ padding: 5px 10px;
1118
+ box-sizing: border-box;
1119
+ }
1120
+ .dragon-editor .de-code-block .de-pre {
1121
+ width: 100%;
1122
+ padding: 10px;
1123
+ box-sizing: border-box;
1124
+ white-space: pre-wrap;
1125
+ }
1126
+ .dragon-editor .de-code-block .de-pre .de-code-content {
1127
+ display: block;
1128
+ min-height: 1.6em;
1129
+ width: 100%;
1130
+ font-family: Inconsolata, monospace, sans-serif;
1131
+ word-break: break-word;
1132
+ outline: 0;
1133
+ }
1134
+ .dragon-editor .de-code-block .de-pre .de-code-content:empty:hover::before, .dragon-editor .de-code-block .de-pre .de-code-content:empty:focus::before {
1135
+ display: inline;
1136
+ content: "Type a Code";
1137
+ cursor: text;
1138
+ }
1139
+ .dragon-editor .de-code-block[data-theme=github] {
1140
+ color: #24292e;
1141
+ background: #f1f1f1;
1142
+ }
1143
+ .dragon-editor .de-code-block[data-theme=github] .de-filename {
1144
+ color: #24292e;
1145
+ background: #ccc;
1146
+ }
1147
+ .dragon-editor .de-code-block[data-theme=github] .de-filename:empty:hover::before, .dragon-editor .de-code-block[data-theme=github] .de-filename:empty:focus::before {
1148
+ color: #8b8d8f;
1149
+ }
1150
+ .dragon-editor .de-code-block[data-theme=github] .de-language {
1151
+ color: #24292e;
1152
+ background: #ccc;
1153
+ }
1154
+ .dragon-editor .de-code-block[data-theme=github] .de-language:empty:hover::before, .dragon-editor .de-code-block[data-theme=github] .de-language:empty:focus::before {
1155
+ color: #8b8d8f;
1156
+ }
1157
+ .dragon-editor .de-code-block[data-theme=github] .de-code-content:empty:hover::before, .dragon-editor .de-code-block[data-theme=github] .de-code-content:empty:focus::before {
1158
+ color: #8b8d8f;
1159
+ }
1160
+ .dragon-editor .de-code-block[data-theme=github] .hljs-doctag,
1161
+ .dragon-editor .de-code-block[data-theme=github] .hljs-keyword,
1162
+ .dragon-editor .de-code-block[data-theme=github] .hljs-meta .hljs-keyword,
1163
+ .dragon-editor .de-code-block[data-theme=github] .hljs-template-tag,
1164
+ .dragon-editor .de-code-block[data-theme=github] .hljs-template-variable,
1165
+ .dragon-editor .de-code-block[data-theme=github] .hljs-type,
1166
+ .dragon-editor .de-code-block[data-theme=github] .hljs-variable.language_ {
1167
+ /* prettylights-syntax-keyword */
1168
+ color: #d73a49;
1169
+ }
1170
+ .dragon-editor .de-code-block[data-theme=github] .hljs-title,
1171
+ .dragon-editor .de-code-block[data-theme=github] .hljs-title.class_,
1172
+ .dragon-editor .de-code-block[data-theme=github] .hljs-title.class_.inherited__,
1173
+ .dragon-editor .de-code-block[data-theme=github] .hljs-title.function_ {
1174
+ /* prettylights-syntax-entity */
1175
+ color: #6f42c1;
1176
+ }
1177
+ .dragon-editor .de-code-block[data-theme=github] .hljs-attr,
1178
+ .dragon-editor .de-code-block[data-theme=github] .hljs-attribute,
1179
+ .dragon-editor .de-code-block[data-theme=github] .hljs-literal,
1180
+ .dragon-editor .de-code-block[data-theme=github] .hljs-meta,
1181
+ .dragon-editor .de-code-block[data-theme=github] .hljs-number,
1182
+ .dragon-editor .de-code-block[data-theme=github] .hljs-operator,
1183
+ .dragon-editor .de-code-block[data-theme=github] .hljs-variable,
1184
+ .dragon-editor .de-code-block[data-theme=github] .hljs-selector-attr,
1185
+ .dragon-editor .de-code-block[data-theme=github] .hljs-selector-class,
1186
+ .dragon-editor .de-code-block[data-theme=github] .hljs-selector-id {
1187
+ /* prettylights-syntax-constant */
1188
+ color: #005cc5;
1189
+ }
1190
+ .dragon-editor .de-code-block[data-theme=github] .hljs-regexp,
1191
+ .dragon-editor .de-code-block[data-theme=github] .hljs-string,
1192
+ .dragon-editor .de-code-block[data-theme=github] .hljs-meta .hljs-string {
1193
+ /* prettylights-syntax-string */
1194
+ color: #032f62;
1195
+ }
1196
+ .dragon-editor .de-code-block[data-theme=github] .hljs-built_in,
1197
+ .dragon-editor .de-code-block[data-theme=github] .hljs-symbol {
1198
+ /* prettylights-syntax-variable */
1199
+ color: #e36209;
1200
+ }
1201
+ .dragon-editor .de-code-block[data-theme=github] .hljs-comment,
1202
+ .dragon-editor .de-code-block[data-theme=github] .hljs-code,
1203
+ .dragon-editor .de-code-block[data-theme=github] .hljs-formula {
1204
+ /* prettylights-syntax-comment */
1205
+ color: #6a737d;
1206
+ }
1207
+ .dragon-editor .de-code-block[data-theme=github] .hljs-name,
1208
+ .dragon-editor .de-code-block[data-theme=github] .hljs-quote,
1209
+ .dragon-editor .de-code-block[data-theme=github] .hljs-selector-tag,
1210
+ .dragon-editor .de-code-block[data-theme=github] .hljs-selector-pseudo {
1211
+ /* prettylights-syntax-entity-tag */
1212
+ color: #22863a;
1213
+ }
1214
+ .dragon-editor .de-code-block[data-theme=github] .hljs-subst {
1215
+ /* prettylights-syntax-storage-modifier-import */
1216
+ color: #24292e;
1217
+ }
1218
+ .dragon-editor .de-code-block[data-theme=github] .hljs-section {
1219
+ /* prettylights-syntax-markup-heading */
1220
+ color: #005cc5;
1221
+ font-weight: bold;
1222
+ }
1223
+ .dragon-editor .de-code-block[data-theme=github] .hljs-bullet {
1224
+ /* prettylights-syntax-markup-list */
1225
+ color: #735c0f;
1226
+ }
1227
+ .dragon-editor .de-code-block[data-theme=github] .hljs-emphasis {
1228
+ /* prettylights-syntax-markup-italic */
1229
+ color: #24292e;
1230
+ font-style: italic;
1231
+ }
1232
+ .dragon-editor .de-code-block[data-theme=github] .hljs-strong {
1233
+ /* prettylights-syntax-markup-bold */
1234
+ color: #24292e;
1235
+ font-weight: bold;
1236
+ }
1237
+ .dragon-editor .de-code-block[data-theme=github] .hljs-addition {
1238
+ /* prettylights-syntax-markup-inserted */
1239
+ color: #22863a;
1240
+ background-color: #f0fff4;
1241
+ }
1242
+ .dragon-editor .de-code-block[data-theme=github] .hljs-deletion {
1243
+ /* prettylights-syntax-markup-deleted */
1244
+ color: #b31d28;
1245
+ background-color: #ffeef0;
1246
+ }
1247
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] {
1248
+ color: #adbac7;
1249
+ background: #22272e;
1250
+ }
1251
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-filename {
1252
+ color: #adbac7;
1253
+ background: #494e54;
1254
+ }
1255
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-filename:empty:hover::before, .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-filename:empty:focus::before {
1256
+ color: #96a0aa;
1257
+ }
1258
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-language {
1259
+ color: #adbac7;
1260
+ background: #494e54;
1261
+ }
1262
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-language:empty:hover::before, .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-language:empty:focus::before {
1263
+ color: #96a0aa;
1264
+ }
1265
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-code-content:empty:hover::before, .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .de-code-content:empty:focus::before {
1266
+ color: #96a0aa;
1267
+ }
1268
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-doctag,
1269
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-keyword,
1270
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-meta .hljs-keyword,
1271
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-template-tag,
1272
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-template-variable,
1273
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-type,
1274
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-variable.language_ {
1275
+ /* prettylights-syntax-keyword */
1276
+ color: #f47067;
1277
+ }
1278
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-title,
1279
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-title.class_,
1280
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-title.class_.inherited__,
1281
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-title.function_ {
1282
+ /* prettylights-syntax-entity */
1283
+ color: #dcbdfb;
1284
+ }
1285
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-attr,
1286
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-attribute,
1287
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-literal,
1288
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-meta,
1289
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-number,
1290
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-operator,
1291
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-variable,
1292
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-selector-attr,
1293
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-selector-class,
1294
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-selector-id {
1295
+ /* prettylights-syntax-constant */
1296
+ color: #6cb6ff;
1297
+ }
1298
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-regexp,
1299
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-string,
1300
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-meta .hljs-string {
1301
+ /* prettylights-syntax-string */
1302
+ color: #96d0ff;
1303
+ }
1304
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-built_in,
1305
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-symbol {
1306
+ /* prettylights-syntax-variable */
1307
+ color: #f69d50;
1308
+ }
1309
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-comment,
1310
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-code,
1311
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-formula {
1312
+ /* prettylights-syntax-comment */
1313
+ color: #768390;
1314
+ }
1315
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-name,
1316
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-quote,
1317
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-selector-tag,
1318
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-selector-pseudo {
1319
+ /* prettylights-syntax-entity-tag */
1320
+ color: #8ddb8c;
1321
+ }
1322
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-subst {
1323
+ /* prettylights-syntax-storage-modifier-import */
1324
+ color: #adbac7;
1325
+ }
1326
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-section {
1327
+ /* prettylights-syntax-markup-heading */
1328
+ color: #316dca;
1329
+ font-weight: bold;
1330
+ }
1331
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-bullet {
1332
+ /* prettylights-syntax-markup-list */
1333
+ color: #eac55f;
1334
+ }
1335
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-emphasis {
1336
+ /* prettylights-syntax-markup-italic */
1337
+ color: #adbac7;
1338
+ font-style: italic;
1339
+ }
1340
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-strong {
1341
+ /* prettylights-syntax-markup-bold */
1342
+ color: #adbac7;
1343
+ font-weight: bold;
1344
+ }
1345
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-addition {
1346
+ /* prettylights-syntax-markup-inserted */
1347
+ color: #b4f1b4;
1348
+ background-color: #1b4721;
1349
+ }
1350
+ .dragon-editor .de-code-block[data-theme=github-dark-dimmed] .hljs-deletion {
1351
+ /* prettylights-syntax-markup-deleted */
1352
+ color: #ffd8d3;
1353
+ background-color: #78191b;
1354
+ }
911
1355
  .dragon-editor .de-bold {
912
1356
  font-weight: 700;
913
1357
  }