@textbus/xnote 0.0.1-alpha.2 → 0.0.1-alpha.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.
- package/bundles/editor.d.ts +4 -1
- package/bundles/index.css +24 -0
- package/bundles/index.esm.css +24 -0
- package/bundles/index.esm.js +224 -576
- package/bundles/index.js +222 -574
- package/package.json +5 -5
package/bundles/index.js
CHANGED
|
@@ -11,36 +11,7 @@ var highlightjs = require('highlight.js');
|
|
|
11
11
|
var adapterViewfly = require('@textbus/adapter-viewfly');
|
|
12
12
|
var collaborate = require('@textbus/collaborate');
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
if ( ref === void 0 ) ref = {};
|
|
16
|
-
var insertAt = ref.insertAt;
|
|
17
|
-
|
|
18
|
-
if (!css || typeof document === 'undefined') { return; }
|
|
19
|
-
|
|
20
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
21
|
-
var style = document.createElement('style');
|
|
22
|
-
style.type = 'text/css';
|
|
23
|
-
|
|
24
|
-
if (insertAt === 'top') {
|
|
25
|
-
if (head.firstChild) {
|
|
26
|
-
head.insertBefore(style, head.firstChild);
|
|
27
|
-
} else {
|
|
28
|
-
head.appendChild(style);
|
|
29
|
-
}
|
|
30
|
-
} else {
|
|
31
|
-
head.appendChild(style);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
if (style.styleSheet) {
|
|
35
|
-
style.styleSheet.cssText = css;
|
|
36
|
-
} else {
|
|
37
|
-
style.appendChild(document.createTextNode(css));
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
var css_248z$w = ".btn[vf-69b4db]{align-items:center;background:none;background:#fff;border:none;border-radius:4px;cursor:pointer;display:inline-flex;font-size:inherit;height:28px;outline:none;padding:6px 5px;transition:all .2s}.btn>span[vf-69b4db]{white-space:nowrap}.btn[vf-69b4db]:hover{background:rgba(0,0,0,.1)}.btn-arrow[vf-69b4db]{position:relative;transform:rotate(0);transform-origin:50%;width:1em}.btn.active[vf-69b4db]{background:rgba(0,0,0,.1)}.btn.active .btn-arrow[vf-69b4db]{transform:rotate(180deg)}.btn.highlight[vf-69b4db]{background-color:rgba(41,110,255,.063);color:#296eff}";
|
|
42
|
-
var scopedId$k = "vf-69b4db";
|
|
43
|
-
styleInject(css_248z$w);
|
|
14
|
+
var css$j = undefined;
|
|
44
15
|
|
|
45
16
|
/******************************************************************************
|
|
46
17
|
Copyright (c) Microsoft Corporation.
|
|
@@ -87,18 +58,7 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
87
58
|
|
|
88
59
|
exports.DropdownService = class DropdownService {
|
|
89
60
|
constructor() {
|
|
90
|
-
|
|
91
|
-
enumerable: true,
|
|
92
|
-
configurable: true,
|
|
93
|
-
writable: true,
|
|
94
|
-
value: void 0
|
|
95
|
-
});
|
|
96
|
-
Object.defineProperty(this, "siblingOpenEvent", {
|
|
97
|
-
enumerable: true,
|
|
98
|
-
configurable: true,
|
|
99
|
-
writable: true,
|
|
100
|
-
value: new core$1.Subject()
|
|
101
|
-
});
|
|
61
|
+
this.siblingOpenEvent = new core$1.Subject();
|
|
102
62
|
this.onSiblingOpen = this.siblingOpenEvent.asObservable();
|
|
103
63
|
}
|
|
104
64
|
notify(id) {
|
|
@@ -116,60 +76,14 @@ var DropdownContextService_1;
|
|
|
116
76
|
let i = 0;
|
|
117
77
|
exports.DropdownContextService = DropdownContextService_1 = class DropdownContextService {
|
|
118
78
|
constructor(dropdownService, injector) {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
configurable: true,
|
|
128
|
-
writable: true,
|
|
129
|
-
value: injector
|
|
130
|
-
});
|
|
131
|
-
Object.defineProperty(this, "id", {
|
|
132
|
-
enumerable: true,
|
|
133
|
-
configurable: true,
|
|
134
|
-
writable: true,
|
|
135
|
-
value: i
|
|
136
|
-
});
|
|
137
|
-
Object.defineProperty(this, "isOpen", {
|
|
138
|
-
enumerable: true,
|
|
139
|
-
configurable: true,
|
|
140
|
-
writable: true,
|
|
141
|
-
value: false
|
|
142
|
-
});
|
|
143
|
-
Object.defineProperty(this, "onOpenStateChange", {
|
|
144
|
-
enumerable: true,
|
|
145
|
-
configurable: true,
|
|
146
|
-
writable: true,
|
|
147
|
-
value: void 0
|
|
148
|
-
});
|
|
149
|
-
Object.defineProperty(this, "canHide", {
|
|
150
|
-
enumerable: true,
|
|
151
|
-
configurable: true,
|
|
152
|
-
writable: true,
|
|
153
|
-
value: true
|
|
154
|
-
});
|
|
155
|
-
Object.defineProperty(this, "openStateChangeEvent", {
|
|
156
|
-
enumerable: true,
|
|
157
|
-
configurable: true,
|
|
158
|
-
writable: true,
|
|
159
|
-
value: new core$1.Subject()
|
|
160
|
-
});
|
|
161
|
-
Object.defineProperty(this, "timer", {
|
|
162
|
-
enumerable: true,
|
|
163
|
-
configurable: true,
|
|
164
|
-
writable: true,
|
|
165
|
-
value: null
|
|
166
|
-
});
|
|
167
|
-
Object.defineProperty(this, "parentDropdownContextService", {
|
|
168
|
-
enumerable: true,
|
|
169
|
-
configurable: true,
|
|
170
|
-
writable: true,
|
|
171
|
-
value: this.injector.get(DropdownContextService_1, core.InjectFlags.SkipSelf, null)
|
|
172
|
-
});
|
|
79
|
+
this.dropdownService = dropdownService;
|
|
80
|
+
this.injector = injector;
|
|
81
|
+
this.id = i;
|
|
82
|
+
this.isOpen = false;
|
|
83
|
+
this.canHide = true;
|
|
84
|
+
this.openStateChangeEvent = new core$1.Subject();
|
|
85
|
+
this.timer = null;
|
|
86
|
+
this.parentDropdownContextService = this.injector.get(DropdownContextService_1, core.InjectFlags.SkipSelf, null);
|
|
173
87
|
this.onOpenStateChange = this.openStateChangeEvent.asObservable();
|
|
174
88
|
dropdownService.onSiblingOpen.subscribe(id => {
|
|
175
89
|
if (id === this.id) {
|
|
@@ -228,7 +142,7 @@ function Button(props) {
|
|
|
228
142
|
subscription.unsubscribe();
|
|
229
143
|
});
|
|
230
144
|
}
|
|
231
|
-
return scopedCss.withScopedCSS(
|
|
145
|
+
return scopedCss.withScopedCSS(css$j, () => {
|
|
232
146
|
return (jsxRuntime.jsxs("button", Object.assign({ type: "button" }, props, { class: [
|
|
233
147
|
'btn',
|
|
234
148
|
{
|
|
@@ -240,12 +154,10 @@ function Button(props) {
|
|
|
240
154
|
});
|
|
241
155
|
}
|
|
242
156
|
|
|
243
|
-
var
|
|
244
|
-
var scopedId$j = "vf-ac7e8d";
|
|
245
|
-
styleInject(css_248z$v);
|
|
157
|
+
var css$i = undefined;
|
|
246
158
|
|
|
247
159
|
function ComponentToolbar(props) {
|
|
248
|
-
return scopedCss.withScopedCSS(
|
|
160
|
+
return scopedCss.withScopedCSS(css$i, () => {
|
|
249
161
|
return (jsxRuntime.jsx("div", { class: "component-toolbar", style: props.style, children: jsxRuntime.jsx("div", { class: [
|
|
250
162
|
'toolbar',
|
|
251
163
|
{
|
|
@@ -255,19 +167,15 @@ function ComponentToolbar(props) {
|
|
|
255
167
|
});
|
|
256
168
|
}
|
|
257
169
|
|
|
258
|
-
var
|
|
259
|
-
var scopedId$i = "vf-ede279";
|
|
260
|
-
styleInject(css_248z$u);
|
|
170
|
+
var css$h = undefined;
|
|
261
171
|
|
|
262
172
|
function Divider() {
|
|
263
|
-
return scopedCss.withScopedCSS(
|
|
173
|
+
return scopedCss.withScopedCSS(css$h, () => {
|
|
264
174
|
return jsxRuntime.jsx("div", { class: "divider" });
|
|
265
175
|
});
|
|
266
176
|
}
|
|
267
177
|
|
|
268
|
-
var
|
|
269
|
-
var scopedId$h = "vf-4c1803";
|
|
270
|
-
styleInject(css_248z$t);
|
|
178
|
+
var style = undefined;
|
|
271
179
|
|
|
272
180
|
function DragResize(props) {
|
|
273
181
|
const isShow = core.createSignal(false);
|
|
@@ -375,20 +283,16 @@ function DragResize(props) {
|
|
|
375
283
|
unUp.unsubscribe();
|
|
376
284
|
});
|
|
377
285
|
}
|
|
378
|
-
return scopedCss.withScopedCSS(
|
|
286
|
+
return scopedCss.withScopedCSS(style, () => {
|
|
379
287
|
return (jsxRuntime.jsxs("div", { class: "drag-resize", onClick: selectComponent, children: [jsxRuntime.jsx("div", { class: "container", ref: ref, children: props.children }), jsxRuntime.jsxs("div", { class: ['resize-tool', {
|
|
380
288
|
active: isShow()
|
|
381
289
|
}], children: [jsxRuntime.jsxs("div", { class: "mask", ref: mask, children: [component.state.width, "*", component.state.height] }), jsxRuntime.jsxs("div", { class: "btn-group", ref: btnGroup, onMousedown: drag, children: [jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" }), jsxRuntime.jsx("button", { type: "button" })] })] })] }));
|
|
382
290
|
});
|
|
383
291
|
}
|
|
384
292
|
|
|
385
|
-
var
|
|
386
|
-
var scopedId$g = "vf-a99c5e";
|
|
387
|
-
styleInject(css_248z$s);
|
|
293
|
+
var css$g = undefined;
|
|
388
294
|
|
|
389
|
-
var
|
|
390
|
-
var scopedId$f = "vf-4f8cfb";
|
|
391
|
-
styleInject(css_248z$r);
|
|
295
|
+
var css$f = undefined;
|
|
392
296
|
|
|
393
297
|
const DropdownMenuPortal = core.withAnnotation({
|
|
394
298
|
providers: [
|
|
@@ -471,7 +375,7 @@ const DropdownMenuPortal = core.withAnnotation({
|
|
|
471
375
|
dropdownContextService.canHide = true;
|
|
472
376
|
dropdownContextService.hide();
|
|
473
377
|
}
|
|
474
|
-
return platformBrowser$1.createPortal(scopedCss.withScopedCSS(
|
|
378
|
+
return platformBrowser$1.createPortal(scopedCss.withScopedCSS(css$f, () => {
|
|
475
379
|
return (jsxRuntime.jsx("div", { onMouseenter: onEnter, onMouseleave: onLeave, ref: menuRef, style: {
|
|
476
380
|
width: props.width
|
|
477
381
|
}, class: "dropdown-menu", children: jsxRuntime.jsx("div", { class: "dropdown-menu-content", children: props.children }) }));
|
|
@@ -532,7 +436,7 @@ const Dropdown = core.withAnnotation({
|
|
|
532
436
|
dropdownContextService.open();
|
|
533
437
|
}
|
|
534
438
|
},
|
|
535
|
-
$render: scopedCss.withScopedCSS(
|
|
439
|
+
$render: scopedCss.withScopedCSS(css$g, () => {
|
|
536
440
|
return (jsxRuntime.jsxs("div", { class: ['dropdown', props.class], style: props.style, ref: dropdownRef, children: [jsxRuntime.jsxs("div", { class: "dropdown-btn", ref: triggerRef, children: [jsxRuntime.jsx("div", { class: "dropdown-btn-inner", children: props.children }), jsxRuntime.jsx("div", { class: "dropdown-btn-arrow" })] }), isShow() && jsxRuntime.jsx(DropdownMenuPortal, { width: props.width, abreast: props.abreast, triggerRef: triggerRef, children: Array.isArray(props.menu) ?
|
|
537
441
|
props.menu.map(menu => {
|
|
538
442
|
return (jsxRuntime.jsx("div", { class: "dropdown-menu-item", onClick: () => {
|
|
@@ -548,9 +452,7 @@ const Dropdown = core.withAnnotation({
|
|
|
548
452
|
};
|
|
549
453
|
});
|
|
550
454
|
|
|
551
|
-
var
|
|
552
|
-
var scopedId$e = "vf-64f71d";
|
|
553
|
-
styleInject(css_248z$q);
|
|
455
|
+
var css$e = undefined;
|
|
554
456
|
|
|
555
457
|
function MenuItem(props) {
|
|
556
458
|
const dropdownContextService = core.inject(exports.DropdownContextService, core.InjectFlags.Optional, null);
|
|
@@ -570,7 +472,7 @@ function MenuItem(props) {
|
|
|
570
472
|
}
|
|
571
473
|
(_a = props.onClick) === null || _a === void 0 ? void 0 : _a.call(props, props.value);
|
|
572
474
|
}
|
|
573
|
-
return scopedCss.withScopedCSS(
|
|
475
|
+
return scopedCss.withScopedCSS(css$e, () => {
|
|
574
476
|
return (jsxRuntime.jsxs("div", { class: ['menu-item', { disabled: props.disabled, active: props.arrow && isActive() }], onClick: click, children: [jsxRuntime.jsxs("div", { children: [props.icon && jsxRuntime.jsx("span", { class: "menu-icon", children: props.icon }), props.children] }), props.arrow ?
|
|
575
477
|
jsxRuntime.jsx("div", { class: "arrow", children: jsxRuntime.jsx("span", { class: "xnote-icon-arrow-right" }) }) :
|
|
576
478
|
jsxRuntime.jsx("div", { class: [
|
|
@@ -580,13 +482,11 @@ function MenuItem(props) {
|
|
|
580
482
|
});
|
|
581
483
|
}
|
|
582
484
|
|
|
583
|
-
var
|
|
584
|
-
var scopedId$d = "vf-a23c47";
|
|
585
|
-
styleInject(css_248z$p);
|
|
485
|
+
var css$d = undefined;
|
|
586
486
|
|
|
587
487
|
function Popup(props) {
|
|
588
488
|
const host = core.inject(platformBrowser.VIEW_CONTAINER);
|
|
589
|
-
return platformBrowser$1.createPortal(scopedCss.withScopedCSS(
|
|
489
|
+
return platformBrowser$1.createPortal(scopedCss.withScopedCSS(css$d, () => {
|
|
590
490
|
return (jsxRuntime.jsx("div", { class: "popup", style: {
|
|
591
491
|
left: props.left + 'px',
|
|
592
492
|
top: props.top + 'px'
|
|
@@ -594,28 +494,19 @@ function Popup(props) {
|
|
|
594
494
|
}), host);
|
|
595
495
|
}
|
|
596
496
|
|
|
597
|
-
var
|
|
598
|
-
var scopedId$c = "vf-216815";
|
|
599
|
-
styleInject(css_248z$o);
|
|
497
|
+
var css$c = undefined;
|
|
600
498
|
|
|
601
499
|
function ToolbarItem(props) {
|
|
602
|
-
return scopedCss.withScopedCSS(
|
|
500
|
+
return scopedCss.withScopedCSS(css$c, () => {
|
|
603
501
|
return (jsxRuntime.jsx("div", { class: "toolbar-item", children: props.children }));
|
|
604
502
|
});
|
|
605
503
|
}
|
|
606
504
|
|
|
607
|
-
var
|
|
608
|
-
var scopedId$b = "vf-2a8a65";
|
|
609
|
-
styleInject(css_248z$n);
|
|
505
|
+
var css$b = undefined;
|
|
610
506
|
|
|
611
507
|
exports.RefreshService = class RefreshService {
|
|
612
508
|
constructor() {
|
|
613
|
-
|
|
614
|
-
enumerable: true,
|
|
615
|
-
configurable: true,
|
|
616
|
-
writable: true,
|
|
617
|
-
value: new core$1.Subject()
|
|
618
|
-
});
|
|
509
|
+
this.onRefresh = new core$1.Subject();
|
|
619
510
|
}
|
|
620
511
|
};
|
|
621
512
|
exports.RefreshService = __decorate([
|
|
@@ -658,12 +549,6 @@ function registerTextAlignShortcut(textbus) {
|
|
|
658
549
|
});
|
|
659
550
|
}
|
|
660
551
|
|
|
661
|
-
var css_248z$m = ".xnote-source-code.atom-one-dark pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.atom-one-dark code.hljs{padding:3px 5px}.xnote-source-code.atom-one-dark .hljs{background:#282c34;color:#abb2bf}.xnote-source-code.atom-one-dark .hljs-comment,.xnote-source-code.atom-one-dark .hljs-quote{color:#5c6370;font-style:italic}.xnote-source-code.atom-one-dark .hljs-doctag,.xnote-source-code.atom-one-dark .hljs-formula,.xnote-source-code.atom-one-dark .hljs-keyword{color:#c678dd}.xnote-source-code.atom-one-dark .hljs-deletion,.xnote-source-code.atom-one-dark .hljs-name,.xnote-source-code.atom-one-dark .hljs-section,.xnote-source-code.atom-one-dark .hljs-selector-tag,.xnote-source-code.atom-one-dark .hljs-subst{color:#e06c75}.xnote-source-code.atom-one-dark .hljs-literal{color:#56b6c2}.xnote-source-code.atom-one-dark .hljs-addition,.xnote-source-code.atom-one-dark .hljs-attribute,.xnote-source-code.atom-one-dark .hljs-meta .hljs-string,.xnote-source-code.atom-one-dark .hljs-regexp,.xnote-source-code.atom-one-dark .hljs-string{color:#98c379}.xnote-source-code.atom-one-dark .hljs-attr,.xnote-source-code.atom-one-dark .hljs-number,.xnote-source-code.atom-one-dark .hljs-selector-attr,.xnote-source-code.atom-one-dark .hljs-selector-class,.xnote-source-code.atom-one-dark .hljs-selector-pseudo,.xnote-source-code.atom-one-dark .hljs-template-variable,.xnote-source-code.atom-one-dark .hljs-type,.xnote-source-code.atom-one-dark .hljs-variable{color:#d19a66}.xnote-source-code.atom-one-dark .hljs-bullet,.xnote-source-code.atom-one-dark .hljs-link,.xnote-source-code.atom-one-dark .hljs-meta,.xnote-source-code.atom-one-dark .hljs-selector-id,.xnote-source-code.atom-one-dark .hljs-symbol,.xnote-source-code.atom-one-dark .hljs-title{color:#61aeee}.xnote-source-code.atom-one-dark .hljs-built_in,.xnote-source-code.atom-one-dark .hljs-class .hljs-title,.xnote-source-code.atom-one-dark .hljs-title.class_{color:#e6c07b}.xnote-source-code.atom-one-dark .hljs-emphasis{font-style:italic}.xnote-source-code.atom-one-dark .hljs-strong{font-weight:700}.xnote-source-code.atom-one-dark .hljs-link{text-decoration:underline}.xnote-source-code.foundation pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.foundation code.hljs{padding:3px 5px}.xnote-source-code.foundation .hljs{background:#eee;color:#000}.xnote-source-code.foundation .hljs-addition,.xnote-source-code.foundation .hljs-attribute,.xnote-source-code.foundation .hljs-emphasis,.xnote-source-code.foundation .hljs-link{color:#070}.xnote-source-code.foundation .hljs-emphasis{font-style:italic}.xnote-source-code.foundation .hljs-deletion,.xnote-source-code.foundation .hljs-string,.xnote-source-code.foundation .hljs-strong{color:#d14}.xnote-source-code.foundation .hljs-strong{font-weight:700}.xnote-source-code.foundation .hljs-comment,.xnote-source-code.foundation .hljs-quote{color:#998;font-style:italic}.xnote-source-code.foundation .hljs-section,.xnote-source-code.foundation .hljs-title{color:#900}.xnote-source-code.foundation .hljs-class .hljs-title,.xnote-source-code.foundation .hljs-title.class_,.xnote-source-code.foundation .hljs-type{color:#458}.xnote-source-code.foundation .hljs-template-variable,.xnote-source-code.foundation .hljs-variable{color:#369}.xnote-source-code.foundation .hljs-bullet{color:#970}.xnote-source-code.foundation .hljs-meta{color:#34b}.xnote-source-code.foundation .hljs-code,.xnote-source-code.foundation .hljs-keyword,.xnote-source-code.foundation .hljs-literal,.xnote-source-code.foundation .hljs-number,.xnote-source-code.foundation .hljs-selector-tag{color:#099}.xnote-source-code.foundation .hljs-regexp{background-color:#fff0ff;color:#808}.xnote-source-code.foundation .hljs-symbol{color:#990073}.xnote-source-code.foundation .hljs-name,.xnote-source-code.foundation .hljs-selector-class,.xnote-source-code.foundation .hljs-selector-id,.xnote-source-code.foundation .hljs-tag{color:#070}.xnote-source-code.github{\n /*!\n Theme: GitHub\n Description: Light theme as seen on github.com\n Author: github.com\n Maintainer: @Hirse\n Updated: 2021-05-15\n\n Outdated base version: https://github.com/primer/github-syntax-light\n Current colors taken from GitHub's CSS\n */}.xnote-source-code.github .xnote-source-code-container{border:1px solid #eee}.xnote-source-code.github .xnote-source-code-line-number-bg{background-color:#fafafa}.xnote-source-code.github pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.github code.hljs{padding:3px 5px}.xnote-source-code.github .hljs{background:#fff;color:#24292e}.xnote-source-code.github .hljs-doctag,.xnote-source-code.github .hljs-keyword,.xnote-source-code.github .hljs-meta .hljs-keyword,.xnote-source-code.github .hljs-template-tag,.xnote-source-code.github .hljs-template-variable,.xnote-source-code.github .hljs-type,.xnote-source-code.github .hljs-variable.language_{color:#d73a49}.xnote-source-code.github .hljs-title,.xnote-source-code.github .hljs-title.class_,.xnote-source-code.github .hljs-title.class_.inherited__,.xnote-source-code.github .hljs-title.function_{color:#6f42c1}.xnote-source-code.github .hljs-attr,.xnote-source-code.github .hljs-attribute,.xnote-source-code.github .hljs-literal,.xnote-source-code.github .hljs-meta,.xnote-source-code.github .hljs-number,.xnote-source-code.github .hljs-operator,.xnote-source-code.github .hljs-selector-attr,.xnote-source-code.github .hljs-selector-class,.xnote-source-code.github .hljs-selector-id,.xnote-source-code.github .hljs-variable{color:#005cc5}.xnote-source-code.github .hljs-meta .hljs-string,.xnote-source-code.github .hljs-regexp,.xnote-source-code.github .hljs-string{color:#032f62}.xnote-source-code.github .hljs-built_in,.xnote-source-code.github .hljs-symbol{color:#e36209}.xnote-source-code.github .hljs-code,.xnote-source-code.github .hljs-comment,.xnote-source-code.github .hljs-formula{color:#6a737d}.xnote-source-code.github .hljs-name,.xnote-source-code.github .hljs-quote,.xnote-source-code.github .hljs-selector-pseudo,.xnote-source-code.github .hljs-selector-tag{color:#22863a}.xnote-source-code.github .hljs-subst{color:#24292e}.xnote-source-code.github .hljs-section{color:#005cc5;font-weight:700}.xnote-source-code.github .hljs-bullet{color:#735c0f}.xnote-source-code.github .hljs-emphasis{color:#24292e;font-style:italic}.xnote-source-code.github .hljs-strong{color:#24292e;font-weight:700}.xnote-source-code.github .hljs-addition{background-color:#f0fff4;color:#22863a}.xnote-source-code.github .hljs-deletion{background-color:#ffeef0;color:#b31d28}.xnote-source-code.idea .xnote-source-code-container{border:1px solid #eee}.xnote-source-code.idea .xnote-source-code-line-number-bg{background-color:#fafafa}.xnote-source-code.idea pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.idea code.hljs{padding:3px 5px}.xnote-source-code.idea .hljs{background:#fff;color:#000}.xnote-source-code.idea .hljs-subst,.xnote-source-code.idea .hljs-title{color:#000;font-weight:400}.xnote-source-code.idea .hljs-comment,.xnote-source-code.idea .hljs-quote{color:grey;font-style:italic}.xnote-source-code.idea .hljs-meta{color:olive}.xnote-source-code.idea .hljs-tag{background:#efefef}.xnote-source-code.idea .hljs-keyword,.xnote-source-code.idea .hljs-literal,.xnote-source-code.idea .hljs-name,.xnote-source-code.idea .hljs-section,.xnote-source-code.idea .hljs-selector-class,.xnote-source-code.idea .hljs-selector-id,.xnote-source-code.idea .hljs-selector-tag,.xnote-source-code.idea .hljs-type{color:navy;font-weight:700}.xnote-source-code.idea .hljs-attribute,.xnote-source-code.idea .hljs-link,.xnote-source-code.idea .hljs-number,.xnote-source-code.idea .hljs-regexp{color:#00f;font-weight:700}.xnote-source-code.idea .hljs-link,.xnote-source-code.idea .hljs-number,.xnote-source-code.idea .hljs-regexp{font-weight:400}.xnote-source-code.idea .hljs-string{color:green;font-weight:700}.xnote-source-code.idea .hljs-bullet,.xnote-source-code.idea .hljs-formula,.xnote-source-code.idea .hljs-symbol{background:#d0eded;color:#000;font-style:italic}.xnote-source-code.idea .hljs-doctag{text-decoration:underline}.xnote-source-code.idea .hljs-template-variable,.xnote-source-code.idea .hljs-variable{color:#660e7a}.xnote-source-code.idea .hljs-addition{background:#baeeba}.xnote-source-code.idea .hljs-deletion{background:#ffc8bd}.xnote-source-code.idea .hljs-emphasis{font-style:italic}.xnote-source-code.idea .hljs-strong{font-weight:700}.xnote-source-code.intellij-light .xnote-source-code-container{border:1px solid #eee}.xnote-source-code.intellij-light .xnote-source-code-line-number-bg{background-color:#fafafa}.xnote-source-code.intellij-light pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.intellij-light code.hljs{padding:3px 5px}.xnote-source-code.intellij-light .hljs{background:#fff;color:#000}.xnote-source-code.intellij-light .hljs-subst,.xnote-source-code.intellij-light .hljs-title{color:#000;font-weight:400}.xnote-source-code.intellij-light .hljs-title.function_{color:#7a7a43}.xnote-source-code.intellij-light .hljs-code,.xnote-source-code.intellij-light .hljs-comment,.xnote-source-code.intellij-light .hljs-quote{color:#8c8c8c;font-style:italic}.xnote-source-code.intellij-light .hljs-meta{color:#9e880d}.xnote-source-code.intellij-light .hljs-section{color:#871094}.xnote-source-code.intellij-light .hljs-built_in,.xnote-source-code.intellij-light .hljs-keyword,.xnote-source-code.intellij-light .hljs-literal,.xnote-source-code.intellij-light .hljs-meta .hljs-keyword,.xnote-source-code.intellij-light .hljs-name,.xnote-source-code.intellij-light .hljs-selector-attr,.xnote-source-code.intellij-light .hljs-selector-class,.xnote-source-code.intellij-light .hljs-selector-id,.xnote-source-code.intellij-light .hljs-selector-pseudo,.xnote-source-code.intellij-light .hljs-selector-tag,.xnote-source-code.intellij-light .hljs-symbol,.xnote-source-code.intellij-light .hljs-template-tag,.xnote-source-code.intellij-light .hljs-type,.xnote-source-code.intellij-light .hljs-variable.language_{color:#0033b3}.xnote-source-code.intellij-light .hljs-attr,.xnote-source-code.intellij-light .hljs-property{color:#871094}.xnote-source-code.intellij-light .hljs-attribute{color:#174ad4}.xnote-source-code.intellij-light .hljs-number{color:#1750eb}.xnote-source-code.intellij-light .hljs-regexp{color:#264eff}.xnote-source-code.intellij-light .hljs-link{color:#006dcc;text-decoration:underline}.xnote-source-code.intellij-light .hljs-meta .hljs-string,.xnote-source-code.intellij-light .hljs-string{color:#067d17}.xnote-source-code.intellij-light .hljs-char.escape_{color:#0037a6}.xnote-source-code.intellij-light .hljs-doctag{text-decoration:underline}.xnote-source-code.intellij-light .hljs-template-variable{color:#248f8f}.xnote-source-code.intellij-light .hljs-addition{background:#bee6be}.xnote-source-code.intellij-light .hljs-deletion{background:#d6d6d6}.xnote-source-code.intellij-light .hljs-emphasis{font-style:italic}.xnote-source-code.intellij-light .hljs-strong{font-weight:700}.xnote-source-code.intellij-light .hljs-bullet,.xnote-source-code.intellij-light .hljs-formula,.xnote-source-code.intellij-light .hljs-operator,.xnote-source-code.intellij-light .hljs-params,.xnote-source-code.intellij-light .hljs-punctuation,.xnote-source-code.intellij-light .hljs-tag,.xnote-source-code.intellij-light .hljs-title.class_,.xnote-source-code.intellij-light .hljs-title.class_.inherited__,.xnote-source-code.intellij-light .hljs-variable,.xnote-source-code.stackoverflow-light{\n /*!\n Theme: StackOverflow Light\n Description: Light theme as used on stackoverflow.com\n Author: stackoverflow.com\n Maintainer: @Hirse\n Website: https://github.com/StackExchange/Stacks\n License: MIT\n Updated: 2021-05-15\n\n Updated for @stackoverflow/stacks v0.64.0\n Code Blocks: /blob/v0.64.0/lib/css/components/_stacks-code-blocks.less\n Colors: /blob/v0.64.0/lib/css/exports/_stacks-constants-colors.less\n */}.xnote-source-code.stackoverflow-light pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.stackoverflow-light code.hljs{padding:3px 5px}.xnote-source-code.stackoverflow-light .hljs{background:#f6f6f6;color:#2f3337}.xnote-source-code.stackoverflow-light .hljs-subst{color:#2f3337}.xnote-source-code.stackoverflow-light .hljs-comment{color:#656e77}.xnote-source-code.stackoverflow-light .hljs-attr,.xnote-source-code.stackoverflow-light .hljs-doctag,.xnote-source-code.stackoverflow-light .hljs-keyword,.xnote-source-code.stackoverflow-light .hljs-meta .hljs-keyword,.xnote-source-code.stackoverflow-light .hljs-section,.xnote-source-code.stackoverflow-light .hljs-selector-tag{color:#015692}.xnote-source-code.stackoverflow-light .hljs-attribute{color:#803378}.xnote-source-code.stackoverflow-light .hljs-name,.xnote-source-code.stackoverflow-light .hljs-number,.xnote-source-code.stackoverflow-light .hljs-quote,.xnote-source-code.stackoverflow-light .hljs-selector-id,.xnote-source-code.stackoverflow-light .hljs-template-tag,.xnote-source-code.stackoverflow-light .hljs-type{color:#b75501}.xnote-source-code.stackoverflow-light .hljs-selector-class{color:#015692}.xnote-source-code.stackoverflow-light .hljs-link,.xnote-source-code.stackoverflow-light .hljs-regexp,.xnote-source-code.stackoverflow-light .hljs-selector-attr,.xnote-source-code.stackoverflow-light .hljs-string,.xnote-source-code.stackoverflow-light .hljs-symbol,.xnote-source-code.stackoverflow-light .hljs-template-variable,.xnote-source-code.stackoverflow-light .hljs-variable{color:#54790d}.xnote-source-code.stackoverflow-light .hljs-meta,.xnote-source-code.stackoverflow-light .hljs-selector-pseudo{color:#015692}.xnote-source-code.stackoverflow-light .hljs-built_in,.xnote-source-code.stackoverflow-light .hljs-literal,.xnote-source-code.stackoverflow-light .hljs-title{color:#b75501}.xnote-source-code.stackoverflow-light .hljs-bullet,.xnote-source-code.stackoverflow-light .hljs-code{color:#535a60}.xnote-source-code.stackoverflow-light .hljs-meta .hljs-string{color:#54790d}.xnote-source-code.stackoverflow-light .hljs-deletion{color:#c02d2e}.xnote-source-code.stackoverflow-light .hljs-addition{color:#2f6f44}.xnote-source-code.stackoverflow-light .hljs-emphasis{font-style:italic}.xnote-source-code.stackoverflow-light .hljs-strong{font-weight:700}.xnote-source-code.vs2015 pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.vs2015 code.hljs{padding:3px 5px}.xnote-source-code.vs2015 .hljs{background:#1e1e1e;color:#dcdcdc}.xnote-source-code.vs2015 .hljs-keyword,.xnote-source-code.vs2015 .hljs-literal,.xnote-source-code.vs2015 .hljs-name,.xnote-source-code.vs2015 .hljs-symbol{color:#569cd6}.xnote-source-code.vs2015 .hljs-link{color:#569cd6;text-decoration:underline}.xnote-source-code.vs2015 .hljs-built_in,.xnote-source-code.vs2015 .hljs-type{color:#4ec9b0}.xnote-source-code.vs2015 .hljs-class,.xnote-source-code.vs2015 .hljs-number{color:#b8d7a3}.xnote-source-code.vs2015 .hljs-meta .hljs-string,.xnote-source-code.vs2015 .hljs-string{color:#d69d85}.xnote-source-code.vs2015 .hljs-regexp,.xnote-source-code.vs2015 .hljs-template-tag{color:#9a5334}.xnote-source-code.vs2015 .hljs-formula,.xnote-source-code.vs2015 .hljs-function,.xnote-source-code.vs2015 .hljs-params,.xnote-source-code.vs2015 .hljs-subst,.xnote-source-code.vs2015 .hljs-title{color:#dcdcdc}.xnote-source-code.vs2015 .hljs-comment,.xnote-source-code.vs2015 .hljs-quote{color:#57a64a;font-style:italic}.xnote-source-code.vs2015 .hljs-doctag{color:#608b4e}.xnote-source-code.vs2015 .hljs-meta,.xnote-source-code.vs2015 .hljs-meta .hljs-keyword,.xnote-source-code.vs2015 .hljs-tag{color:#9b9b9b}.xnote-source-code.vs2015 .hljs-template-variable,.xnote-source-code.vs2015 .hljs-variable{color:#bd63c5}.xnote-source-code.vs2015 .hljs-attr,.xnote-source-code.vs2015 .hljs-attribute{color:#9cdcfe}.xnote-source-code.vs2015 .hljs-section{color:gold}.xnote-source-code.vs2015 .hljs-emphasis{font-style:italic}.xnote-source-code.vs2015 .hljs-strong{font-weight:700}.xnote-source-code.vs2015 .hljs-bullet,.xnote-source-code.vs2015 .hljs-selector-attr,.xnote-source-code.vs2015 .hljs-selector-class,.xnote-source-code.vs2015 .hljs-selector-id,.xnote-source-code.vs2015 .hljs-selector-pseudo,.xnote-source-code.vs2015 .hljs-selector-tag{color:#d7ba7d}.xnote-source-code.vs2015 .hljs-addition{background-color:#144212;display:inline-block;width:100%}.xnote-source-code.vs2015 .hljs-deletion{background-color:#600;display:inline-block;width:100%}.xnote-source-code.xcode .xnote-source-code-container{border:1px solid #eee}.xnote-source-code.xcode .xnote-source-code-line-number-bg{background-color:#fafafa}.xnote-source-code.xcode pre code.hljs{display:block;overflow-x:auto;padding:1em}.xnote-source-code.xcode code.hljs{padding:3px 5px}.xnote-source-code.xcode .hljs{background:#fff;color:#000}.xnote-source-code.xcode .xml .hljs-meta{color:silver}.xnote-source-code.xcode .hljs-comment,.xnote-source-code.xcode .hljs-quote{color:#007400}.xnote-source-code.xcode .hljs-attribute,.xnote-source-code.xcode .hljs-keyword,.xnote-source-code.xcode .hljs-literal,.xnote-source-code.xcode .hljs-name,.xnote-source-code.xcode .hljs-selector-tag,.xnote-source-code.xcode .hljs-tag{color:#aa0d91}.xnote-source-code.xcode .hljs-template-variable,.xnote-source-code.xcode .hljs-variable{color:#3f6e74}.xnote-source-code.xcode .hljs-code,.xnote-source-code.xcode .hljs-meta .hljs-string,.xnote-source-code.xcode .hljs-string{color:#c41a16}.xnote-source-code.xcode .hljs-link,.xnote-source-code.xcode .hljs-regexp{color:#0e0eff}.xnote-source-code.xcode .hljs-bullet,.xnote-source-code.xcode .hljs-number,.xnote-source-code.xcode .hljs-symbol,.xnote-source-code.xcode .hljs-title{color:#1c00cf}.xnote-source-code.xcode .hljs-meta,.xnote-source-code.xcode .hljs-section{color:#643820}.xnote-source-code.xcode .hljs-built_in,.xnote-source-code.xcode .hljs-class .hljs-title,.xnote-source-code.xcode .hljs-params,.xnote-source-code.xcode .hljs-title.class_,.xnote-source-code.xcode .hljs-type{color:#5c2699}.xnote-source-code.xcode .hljs-attr{color:#836c28}.xnote-source-code.xcode .hljs-subst{color:#000}.xnote-source-code.xcode .hljs-formula{background-color:#eee;font-style:italic}.xnote-source-code.xcode .hljs-addition{background-color:#baeeba}.xnote-source-code.xcode .hljs-deletion{background-color:#ffc8bd}.xnote-source-code.xcode .hljs-selector-class,.xnote-source-code.xcode .hljs-selector-id{color:#9b703f}.xnote-source-code.xcode .hljs-doctag,.xnote-source-code.xcode .hljs-strong{font-weight:700}.xnote-source-code.xcode .hljs-emphasis{font-style:italic}.xnote-source-code code{background:none;border:none;border-radius:0;padding:0;vertical-align:inherit}.xnote-source-code{position:relative}.xnote-source-code-container{border-radius:5px;display:flex;line-height:1.418em;overflow:hidden;position:relative}.xnote-source-code-container.xnote-source-code-auto-break{word-wrap:break-word;white-space:pre-wrap;word-break:break-all}code,kbd,pre,samp{font-family:Microsoft YaHei Mono,Menlo,Monaco,Consolas,Courier New,monospace}.xnote-source-code-line-number-bg{background-color:inherit;display:none;position:relative;width:3em;z-index:2}.xnote-source-code.xnote-source-code-line-number .xnote-source-code-line-number-bg{display:block}.xnote-source-code.xnote-source-code-line-number .xnote-source-code-line{margin-left:-4em}.xnote-source-code-content{counter-reset:codeNum;flex:1;max-height:450px;overflow:auto;padding:15px 0;position:relative}.xnote-source-code-content-highlight .xnote-source-code-line{opacity:.36}.xnote-source-code-line{display:flex;margin-left:0}.xnote-source-code-line-content{padding:0 20px}.xnote-source-code-line-number .xnote-source-code-line-content{padding:0 20px 0 10px}.xnote-source-code-line-number .xnote-source-code-line:before{box-sizing:border-box;content:counter(codeNum);counter-increment:codeNum;left:0;min-width:4em;opacity:.5;overflow:hidden;padding-right:10px;position:sticky;text-align:right;transform:translateX(-4em);white-space:nowrap;z-index:2}.xnote-source-code-content-highlight .xnote-source-code-line-emphasize{opacity:1}.xnote-source-code-lang{font-size:13px;opacity:.5;padding:4px 10px;pointer-events:none;position:absolute;right:0;top:0}";
|
|
662
|
-
styleInject(css_248z$m);
|
|
663
|
-
|
|
664
|
-
var css_248z$l = ".xnote-paragraph p{margin:8px 0}";
|
|
665
|
-
styleInject(css_248z$l);
|
|
666
|
-
|
|
667
552
|
function useReadonly() {
|
|
668
553
|
const controller = core.inject(core$1.Controller);
|
|
669
554
|
const is = core.createSignal(controller.readonly);
|
|
@@ -703,18 +588,8 @@ class ParagraphComponent extends core$1.Component {
|
|
|
703
588
|
});
|
|
704
589
|
}
|
|
705
590
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
configurable: true,
|
|
709
|
-
writable: true,
|
|
710
|
-
value: 'ParagraphComponent'
|
|
711
|
-
});
|
|
712
|
-
Object.defineProperty(ParagraphComponent, "type", {
|
|
713
|
-
enumerable: true,
|
|
714
|
-
configurable: true,
|
|
715
|
-
writable: true,
|
|
716
|
-
value: core$1.ContentType.BlockComponent
|
|
717
|
-
});
|
|
591
|
+
ParagraphComponent.componentName = 'ParagraphComponent';
|
|
592
|
+
ParagraphComponent.type = core$1.ContentType.BlockComponent;
|
|
718
593
|
function ParagraphView(props) {
|
|
719
594
|
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
720
595
|
const readonly = useReadonly();
|
|
@@ -876,42 +751,27 @@ function createCodeSlot() {
|
|
|
876
751
|
class SourceCodeComponent extends core$1.Component {
|
|
877
752
|
constructor() {
|
|
878
753
|
super(...arguments);
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
writable: true,
|
|
889
|
-
value: () => {
|
|
890
|
-
const selection = this.textbus.get(core$1.Selection);
|
|
891
|
-
const slots = this.state.slots;
|
|
892
|
-
const { startSlot, endSlot } = selection;
|
|
893
|
-
let startIndex = slots.findIndex(i => i.slot === startSlot);
|
|
894
|
-
const endIndex = slots.findIndex(i => i.slot === endSlot) + 1;
|
|
895
|
-
for (; startIndex < endIndex; startIndex++) {
|
|
896
|
-
slots[startIndex].emphasize = false;
|
|
897
|
-
}
|
|
754
|
+
this.focus = new core$1.BehaviorSubject(false);
|
|
755
|
+
this.cancelEmphasize = () => {
|
|
756
|
+
const selection = this.textbus.get(core$1.Selection);
|
|
757
|
+
const slots = this.state.slots;
|
|
758
|
+
const { startSlot, endSlot } = selection;
|
|
759
|
+
let startIndex = slots.findIndex(i => i.slot === startSlot);
|
|
760
|
+
const endIndex = slots.findIndex(i => i.slot === endSlot) + 1;
|
|
761
|
+
for (; startIndex < endIndex; startIndex++) {
|
|
762
|
+
slots[startIndex].emphasize = false;
|
|
898
763
|
}
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
let startIndex = slots.findIndex(i => i.slot === startSlot);
|
|
909
|
-
const endIndex = slots.findIndex(i => i.slot === endSlot) + 1;
|
|
910
|
-
for (; startIndex < endIndex; startIndex++) {
|
|
911
|
-
slots[startIndex].emphasize = true;
|
|
912
|
-
}
|
|
764
|
+
};
|
|
765
|
+
this.emphasize = () => {
|
|
766
|
+
const selection = this.textbus.get(core$1.Selection);
|
|
767
|
+
const slots = this.state.slots;
|
|
768
|
+
const { startSlot, endSlot } = selection;
|
|
769
|
+
let startIndex = slots.findIndex(i => i.slot === startSlot);
|
|
770
|
+
const endIndex = slots.findIndex(i => i.slot === endSlot) + 1;
|
|
771
|
+
for (; startIndex < endIndex; startIndex++) {
|
|
772
|
+
slots[startIndex].emphasize = true;
|
|
913
773
|
}
|
|
914
|
-
}
|
|
774
|
+
};
|
|
915
775
|
}
|
|
916
776
|
static fromJSON(textbus, json) {
|
|
917
777
|
const registry = textbus.get(core$1.Registry);
|
|
@@ -1083,67 +943,52 @@ class SourceCodeComponent extends core$1.Component {
|
|
|
1083
943
|
});
|
|
1084
944
|
}
|
|
1085
945
|
}
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
configurable: true,
|
|
1101
|
-
writable: true,
|
|
1102
|
-
value: {
|
|
1103
|
-
key: 'Enter',
|
|
1104
|
-
match(c) {
|
|
1105
|
-
const matchString = languageList.map(i => i.label || i.value).concat('js', 'ts').join('|').replace(/\+/, '\\+');
|
|
1106
|
-
const reg = new RegExp(`^\`\`\`(${matchString})$`, 'i');
|
|
1107
|
-
return reg.test(c);
|
|
1108
|
-
},
|
|
1109
|
-
createState(content) {
|
|
1110
|
-
const matchString = content.replace(/`/g, '').replace(/\+/, '\\+');
|
|
1111
|
-
for (const item of languageList) {
|
|
1112
|
-
const reg = new RegExp(`^${matchString}$`, 'i');
|
|
1113
|
-
if (reg.test(item.label || item.value)) {
|
|
1114
|
-
return {
|
|
1115
|
-
lang: item.value,
|
|
1116
|
-
theme: '',
|
|
1117
|
-
lineNumber: true,
|
|
1118
|
-
slots: [createCodeSlot()]
|
|
1119
|
-
};
|
|
1120
|
-
}
|
|
1121
|
-
}
|
|
1122
|
-
if (/^js$/i.test(matchString)) {
|
|
1123
|
-
return {
|
|
1124
|
-
lang: 'JavaScript',
|
|
1125
|
-
theme: '',
|
|
1126
|
-
lineNumber: true,
|
|
1127
|
-
slots: [createCodeSlot()]
|
|
1128
|
-
};
|
|
1129
|
-
}
|
|
1130
|
-
if (/^ts$/i.test(matchString)) {
|
|
946
|
+
SourceCodeComponent.type = core$1.ContentType.BlockComponent;
|
|
947
|
+
SourceCodeComponent.componentName = 'SourceCodeComponent';
|
|
948
|
+
SourceCodeComponent.zenCoding = {
|
|
949
|
+
key: 'Enter',
|
|
950
|
+
match(c) {
|
|
951
|
+
const matchString = languageList.map(i => i.label || i.value).concat('js', 'ts').join('|').replace(/\+/, '\\+');
|
|
952
|
+
const reg = new RegExp(`^\`\`\`(${matchString})$`, 'i');
|
|
953
|
+
return reg.test(c);
|
|
954
|
+
},
|
|
955
|
+
createState(content) {
|
|
956
|
+
const matchString = content.replace(/`/g, '').replace(/\+/, '\\+');
|
|
957
|
+
for (const item of languageList) {
|
|
958
|
+
const reg = new RegExp(`^${matchString}$`, 'i');
|
|
959
|
+
if (reg.test(item.label || item.value)) {
|
|
1131
960
|
return {
|
|
1132
|
-
lang:
|
|
961
|
+
lang: item.value,
|
|
1133
962
|
theme: '',
|
|
1134
963
|
lineNumber: true,
|
|
1135
964
|
slots: [createCodeSlot()]
|
|
1136
965
|
};
|
|
1137
966
|
}
|
|
967
|
+
}
|
|
968
|
+
if (/^js$/i.test(matchString)) {
|
|
1138
969
|
return {
|
|
1139
|
-
lang: '',
|
|
970
|
+
lang: 'JavaScript',
|
|
1140
971
|
theme: '',
|
|
1141
972
|
lineNumber: true,
|
|
1142
973
|
slots: [createCodeSlot()]
|
|
1143
974
|
};
|
|
1144
975
|
}
|
|
976
|
+
if (/^ts$/i.test(matchString)) {
|
|
977
|
+
return {
|
|
978
|
+
lang: 'TypeScript',
|
|
979
|
+
theme: '',
|
|
980
|
+
lineNumber: true,
|
|
981
|
+
slots: [createCodeSlot()]
|
|
982
|
+
};
|
|
983
|
+
}
|
|
984
|
+
return {
|
|
985
|
+
lang: '',
|
|
986
|
+
theme: '',
|
|
987
|
+
lineNumber: true,
|
|
988
|
+
slots: [createCodeSlot()]
|
|
989
|
+
};
|
|
1145
990
|
}
|
|
1146
|
-
}
|
|
991
|
+
};
|
|
1147
992
|
function SourceCodeView(props) {
|
|
1148
993
|
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
1149
994
|
const isFocus = core.createSignal(false);
|
|
@@ -1235,7 +1080,7 @@ function SourceCodeView(props) {
|
|
|
1235
1080
|
'xnote-source-code': true,
|
|
1236
1081
|
'xnote-source-code-line-number': state.lineNumber,
|
|
1237
1082
|
[state.theme || 'github']: true
|
|
1238
|
-
}, lang: state.lang, "data-auto-break": state.autoBreak, "data-theme": state.theme || null, "data-line-number": state.lineNumber, children: [!readonly() || !output() && jsxRuntime.jsxs(ComponentToolbar, { visible: isFocus(), children: [jsxRuntime.jsx(ToolbarItem, { children: jsxRuntime.jsx(Dropdown, { onCheck: changeLang, trigger: 'hover', menu: languageList.map(item => {
|
|
1083
|
+
}, lang: state.lang, "data-auto-break": state.autoBreak, "data-theme": state.theme || null, "data-line-number": state.lineNumber, children: [(!readonly() || !output()) && jsxRuntime.jsxs(ComponentToolbar, { visible: isFocus(), children: [jsxRuntime.jsx(ToolbarItem, { children: jsxRuntime.jsx(Dropdown, { onCheck: changeLang, trigger: 'hover', menu: languageList.map(item => {
|
|
1239
1084
|
return {
|
|
1240
1085
|
label: jsxRuntime.jsx(MenuItem, { checked: state.lang === item.value, children: item.label || 'Plain Text' }),
|
|
1241
1086
|
value: item.value
|
|
@@ -1475,7 +1320,7 @@ function AttrTool(props) {
|
|
|
1475
1320
|
break;
|
|
1476
1321
|
}
|
|
1477
1322
|
}
|
|
1478
|
-
return scopedCss.withScopedCSS(
|
|
1323
|
+
return scopedCss.withScopedCSS(css$b, () => {
|
|
1479
1324
|
const states = checkStates();
|
|
1480
1325
|
return (jsxRuntime.jsx(Dropdown, { style: props.style, abreast: props.abreast, onCheck: updateAttr, trigger: 'hover', menu: [
|
|
1481
1326
|
{
|
|
@@ -1614,24 +1459,9 @@ class TableComponent extends core$1.Component {
|
|
|
1614
1459
|
})
|
|
1615
1460
|
}) {
|
|
1616
1461
|
super(textbus, state);
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
writable: true,
|
|
1621
|
-
value: this.textbus.get(core$1.Selection)
|
|
1622
|
-
});
|
|
1623
|
-
Object.defineProperty(this, "focus", {
|
|
1624
|
-
enumerable: true,
|
|
1625
|
-
configurable: true,
|
|
1626
|
-
writable: true,
|
|
1627
|
-
value: new core$1.Subject()
|
|
1628
|
-
});
|
|
1629
|
-
Object.defineProperty(this, "tableSelection", {
|
|
1630
|
-
enumerable: true,
|
|
1631
|
-
configurable: true,
|
|
1632
|
-
writable: true,
|
|
1633
|
-
value: core.createSignal(null)
|
|
1634
|
-
});
|
|
1462
|
+
this.selection = this.textbus.get(core$1.Selection);
|
|
1463
|
+
this.focus = new core$1.Subject();
|
|
1464
|
+
this.tableSelection = core.createSignal(null);
|
|
1635
1465
|
}
|
|
1636
1466
|
setup() {
|
|
1637
1467
|
core$1.onFocusIn(() => {
|
|
@@ -1756,21 +1586,8 @@ class TableComponent extends core$1.Component {
|
|
|
1756
1586
|
});
|
|
1757
1587
|
}
|
|
1758
1588
|
}
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
configurable: true,
|
|
1762
|
-
writable: true,
|
|
1763
|
-
value: 'TableComponent'
|
|
1764
|
-
});
|
|
1765
|
-
Object.defineProperty(TableComponent, "type", {
|
|
1766
|
-
enumerable: true,
|
|
1767
|
-
configurable: true,
|
|
1768
|
-
writable: true,
|
|
1769
|
-
value: core$1.ContentType.BlockComponent
|
|
1770
|
-
});
|
|
1771
|
-
|
|
1772
|
-
var css_248z$k = ".xnote-todolist{align-items:center;display:flex;margin:8px 0}.xnote-todolist-icon{color:#296eff;cursor:pointer;margin-right:6px}.xnote-todolist-content[style*=text-indent]{text-indent:0!important}.xnote-todolist-content[style*=text-align]{text-align:left!important}";
|
|
1773
|
-
styleInject(css_248z$k);
|
|
1589
|
+
TableComponent.componentName = 'TableComponent';
|
|
1590
|
+
TableComponent.type = core$1.ContentType.BlockComponent;
|
|
1774
1591
|
|
|
1775
1592
|
const strikeThroughFormatter = new core$1.Formatter('strike', {
|
|
1776
1593
|
columned: true,
|
|
@@ -1875,37 +1692,22 @@ class TodolistComponent extends core$1.Component {
|
|
|
1875
1692
|
});
|
|
1876
1693
|
}
|
|
1877
1694
|
}
|
|
1878
|
-
|
|
1879
|
-
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
configurable: true,
|
|
1893
|
-
writable: true,
|
|
1894
|
-
value: {
|
|
1895
|
-
match: /^\[(x|\s)?\]$/,
|
|
1896
|
-
key: ' ',
|
|
1897
|
-
createState(content) {
|
|
1898
|
-
const isChecked = content.charAt(1) === 'x';
|
|
1899
|
-
return {
|
|
1900
|
-
checked: isChecked,
|
|
1901
|
-
slot: new core$1.Slot([
|
|
1902
|
-
core$1.ContentType.InlineComponent,
|
|
1903
|
-
core$1.ContentType.Text
|
|
1904
|
-
])
|
|
1905
|
-
};
|
|
1906
|
-
}
|
|
1695
|
+
TodolistComponent.type = core$1.ContentType.BlockComponent;
|
|
1696
|
+
TodolistComponent.componentName = 'TodoListComponent';
|
|
1697
|
+
TodolistComponent.zenCoding = {
|
|
1698
|
+
match: /^\[(x|\s)?\]$/,
|
|
1699
|
+
key: ' ',
|
|
1700
|
+
createState(content) {
|
|
1701
|
+
const isChecked = content.charAt(1) === 'x';
|
|
1702
|
+
return {
|
|
1703
|
+
checked: isChecked,
|
|
1704
|
+
slot: new core$1.Slot([
|
|
1705
|
+
core$1.ContentType.InlineComponent,
|
|
1706
|
+
core$1.ContentType.Text
|
|
1707
|
+
])
|
|
1708
|
+
};
|
|
1907
1709
|
}
|
|
1908
|
-
}
|
|
1710
|
+
};
|
|
1909
1711
|
function TodolistView(props) {
|
|
1910
1712
|
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
1911
1713
|
const component = props.component;
|
|
@@ -1959,9 +1761,6 @@ const todolistComponentLoader = {
|
|
|
1959
1761
|
}
|
|
1960
1762
|
};
|
|
1961
1763
|
|
|
1962
|
-
var css_248z$j = ".xnote-blockquote{border-left:2px solid #296eff;margin:1em 0;padding:0 15px}.xnote-blockquote>:first-child{margin-top:0}.xnote-blockquote>:last-child{margin-bottom:0}";
|
|
1963
|
-
styleInject(css_248z$j);
|
|
1964
|
-
|
|
1965
1764
|
class BlockquoteComponent extends core$1.Component {
|
|
1966
1765
|
static fromJSON(textbus, json) {
|
|
1967
1766
|
const slot = textbus.get(core$1.Registry).createSlot(json.slot);
|
|
@@ -1982,36 +1781,21 @@ class BlockquoteComponent extends core$1.Component {
|
|
|
1982
1781
|
useBlockContent(this.state.slot);
|
|
1983
1782
|
}
|
|
1984
1783
|
}
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
enumerable: true,
|
|
1999
|
-
configurable: true,
|
|
2000
|
-
writable: true,
|
|
2001
|
-
value: {
|
|
2002
|
-
key: ' ',
|
|
2003
|
-
match: /^>$/,
|
|
2004
|
-
createState() {
|
|
2005
|
-
return {
|
|
2006
|
-
slot: new core$1.Slot([
|
|
2007
|
-
core$1.ContentType.Text,
|
|
2008
|
-
core$1.ContentType.InlineComponent,
|
|
2009
|
-
core$1.ContentType.BlockComponent
|
|
2010
|
-
])
|
|
2011
|
-
};
|
|
2012
|
-
}
|
|
1784
|
+
BlockquoteComponent.type = core$1.ContentType.BlockComponent;
|
|
1785
|
+
BlockquoteComponent.componentName = 'BlockquoteComponent';
|
|
1786
|
+
BlockquoteComponent.zenCoding = {
|
|
1787
|
+
key: ' ',
|
|
1788
|
+
match: /^>$/,
|
|
1789
|
+
createState() {
|
|
1790
|
+
return {
|
|
1791
|
+
slot: new core$1.Slot([
|
|
1792
|
+
core$1.ContentType.Text,
|
|
1793
|
+
core$1.ContentType.InlineComponent,
|
|
1794
|
+
core$1.ContentType.BlockComponent
|
|
1795
|
+
])
|
|
1796
|
+
};
|
|
2013
1797
|
}
|
|
2014
|
-
}
|
|
1798
|
+
};
|
|
2015
1799
|
function BlockquoteView(props) {
|
|
2016
1800
|
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
2017
1801
|
const readonly = useReadonly();
|
|
@@ -2046,9 +1830,6 @@ const blockquoteComponentLoader = {
|
|
|
2046
1830
|
},
|
|
2047
1831
|
};
|
|
2048
1832
|
|
|
2049
|
-
var css_248z$i = ".xnote-list{margin:8px 0;padding:0}.xnote-list>li{display:flex}.xnote-list-type{box-sizing:border-box;color:#296eff;text-align:left;text-indent:0;white-space:nowrap;width:24px}.xnote-order-btn{padding-left:5px}.xnote-list-content[style*=text-indent]{text-indent:0!important}.xnote-list-content[style*=text-align]{text-align:left!important}";
|
|
2050
|
-
styleInject(css_248z$i);
|
|
2051
|
-
|
|
2052
1833
|
class ListComponent extends core$1.Component {
|
|
2053
1834
|
static fromJSON(textbus, json) {
|
|
2054
1835
|
return new ListComponent(textbus, {
|
|
@@ -2131,37 +1912,22 @@ class ListComponent extends core$1.Component {
|
|
|
2131
1912
|
});
|
|
2132
1913
|
}
|
|
2133
1914
|
}
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
configurable: true,
|
|
2149
|
-
writable: true,
|
|
2150
|
-
value: {
|
|
2151
|
-
key: ' ',
|
|
2152
|
-
match: /^([1-9]\.|[+*])$/,
|
|
2153
|
-
createState(content) {
|
|
2154
|
-
return {
|
|
2155
|
-
type: /[-+*]/.test(content) ? 'UnorderedList' : 'OrderedList',
|
|
2156
|
-
reorder: true,
|
|
2157
|
-
slot: new core$1.Slot([
|
|
2158
|
-
core$1.ContentType.InlineComponent,
|
|
2159
|
-
core$1.ContentType.Text
|
|
2160
|
-
])
|
|
2161
|
-
};
|
|
2162
|
-
}
|
|
1915
|
+
ListComponent.componentName = 'ListComponent';
|
|
1916
|
+
ListComponent.type = core$1.ContentType.BlockComponent;
|
|
1917
|
+
ListComponent.zenCoding = {
|
|
1918
|
+
key: ' ',
|
|
1919
|
+
match: /^([1-9]\.|[+*])$/,
|
|
1920
|
+
createState(content) {
|
|
1921
|
+
return {
|
|
1922
|
+
type: /[-+*]/.test(content) ? 'UnorderedList' : 'OrderedList',
|
|
1923
|
+
reorder: true,
|
|
1924
|
+
slot: new core$1.Slot([
|
|
1925
|
+
core$1.ContentType.InlineComponent,
|
|
1926
|
+
core$1.ContentType.Text
|
|
1927
|
+
])
|
|
1928
|
+
};
|
|
2163
1929
|
}
|
|
2164
|
-
}
|
|
1930
|
+
};
|
|
2165
1931
|
const step = 26;
|
|
2166
1932
|
const chars = Array.from({ length: step }).map((_, index) => String.fromCharCode(96 + index + 1));
|
|
2167
1933
|
function numberToLetter(num) {
|
|
@@ -2251,7 +2017,7 @@ function ListComponentView(props) {
|
|
|
2251
2017
|
}, children: jsxRuntime.jsxs("li", { style: {
|
|
2252
2018
|
justifyContent: align[component.state.slot.getAttribute(textAlignAttr)],
|
|
2253
2019
|
textAlign: component.state.slot.getAttribute(textAlignAttr) === 'justify' ? 'justify' : void 0
|
|
2254
|
-
}, children: [jsxRuntime.jsx("div", { class: "xnote-list-type", children: component.state.type === 'UnorderedList' || readonly() || output() ?
|
|
2020
|
+
}, children: [jsxRuntime.jsx("div", { class: "xnote-list-type", children: (component.state.type === 'UnorderedList' || readonly() || output()) ?
|
|
2255
2021
|
jsxRuntime.jsx("span", { class: "xnote-order-btn", children: icon })
|
|
2256
2022
|
:
|
|
2257
2023
|
jsxRuntime.jsx(Dropdown, { menu: jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(MenuItem, { onClick: () => reorder(false), children: "\u7EE7\u7EED\u7F16\u53F7" }), jsxRuntime.jsx(MenuItem, { onClick: () => reorder(true), children: "\u91CD\u65B0\u7F16\u53F7" })] }), children: jsxRuntime.jsx(Button, { style: { color: 'inherit' }, children: icon }) }) }), adapter.slotRender(component.state.slot, children => {
|
|
@@ -2353,9 +2119,6 @@ function useActiveBlock() {
|
|
|
2353
2119
|
};
|
|
2354
2120
|
}
|
|
2355
2121
|
|
|
2356
|
-
var css_248z$h = ".xnote-highlight-box{background:#fcf5ce;border:1px solid #f5c774;border-radius:4px;display:flex;margin:16px 0}.xnote-highlight-box-left{padding-top:.65em;text-align:center;width:40px}.xnote-highlight-box-content{flex:1}.xnote-highlight-box-icon button{background:none;border:none;border-radius:4px;cursor:pointer;font-size:1.4em;height:30px;padding:0;width:30px}.xnote-highlight-box-icon button:hover{background:rgba(0,0,0,.1)}.xnote-highlight-box-icons{text-align:left}.xnote-highlight-box-icons button{background:none;border:none;border-radius:4px;cursor:pointer;font-size:24px;height:30px;padding:0;width:30px}.xnote-highlight-box-icons button:hover{background:rgba(0,0,0,.1)}.xnote-highlight-box-content{padding:5px}";
|
|
2357
|
-
styleInject(css_248z$h);
|
|
2358
|
-
|
|
2359
2122
|
class HighlightBoxComponent extends core$1.Component {
|
|
2360
2123
|
static fromJSON(textbus, json) {
|
|
2361
2124
|
return new HighlightBoxComponent(textbus, {
|
|
@@ -2377,24 +2140,9 @@ class HighlightBoxComponent extends core$1.Component {
|
|
|
2377
2140
|
useBlockContent(this.state.slot);
|
|
2378
2141
|
}
|
|
2379
2142
|
}
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
writable: true,
|
|
2384
|
-
value: ['❤️', '💡', '📌', '✅', '❎', '👍', '🎉', '🚫', '❗']
|
|
2385
|
-
});
|
|
2386
|
-
Object.defineProperty(HighlightBoxComponent, "componentName", {
|
|
2387
|
-
enumerable: true,
|
|
2388
|
-
configurable: true,
|
|
2389
|
-
writable: true,
|
|
2390
|
-
value: 'HighlightBoxComponent'
|
|
2391
|
-
});
|
|
2392
|
-
Object.defineProperty(HighlightBoxComponent, "type", {
|
|
2393
|
-
enumerable: true,
|
|
2394
|
-
configurable: true,
|
|
2395
|
-
writable: true,
|
|
2396
|
-
value: core$1.ContentType.BlockComponent
|
|
2397
|
-
});
|
|
2143
|
+
HighlightBoxComponent.defaultTypes = ['❤️', '💡', '📌', '✅', '❎', '👍', '🎉', '🚫', '❗'];
|
|
2144
|
+
HighlightBoxComponent.componentName = 'HighlightBoxComponent';
|
|
2145
|
+
HighlightBoxComponent.type = core$1.ContentType.BlockComponent;
|
|
2398
2146
|
function HighlightBoxView(props) {
|
|
2399
2147
|
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
2400
2148
|
const readonly = useReadonly();
|
|
@@ -2666,7 +2414,7 @@ function useBlockTransform() {
|
|
|
2666
2414
|
function BlockTool() {
|
|
2667
2415
|
const checkStates = useActiveBlock();
|
|
2668
2416
|
const transform = useBlockTransform();
|
|
2669
|
-
return scopedCss.withScopedCSS(
|
|
2417
|
+
return scopedCss.withScopedCSS(css$b, () => {
|
|
2670
2418
|
const states = checkStates();
|
|
2671
2419
|
const types = [
|
|
2672
2420
|
[states.paragraph, 'xnote-icon-pilcrow'],
|
|
@@ -3097,9 +2845,7 @@ function CodeTool() {
|
|
|
3097
2845
|
};
|
|
3098
2846
|
}
|
|
3099
2847
|
|
|
3100
|
-
var
|
|
3101
|
-
var scopedId$a = "vf-1fbbdf";
|
|
3102
|
-
styleInject(css_248z$g);
|
|
2848
|
+
var css$a = undefined;
|
|
3103
2849
|
|
|
3104
2850
|
function ColorTool(props) {
|
|
3105
2851
|
const query = core.inject(core$1.Query);
|
|
@@ -3147,7 +2893,7 @@ function ColorTool(props) {
|
|
|
3147
2893
|
'#90a0e5',
|
|
3148
2894
|
'#c596e0',
|
|
3149
2895
|
];
|
|
3150
|
-
return scopedCss.withScopedCSS(
|
|
2896
|
+
return scopedCss.withScopedCSS(css$a, () => {
|
|
3151
2897
|
const vm = viewModel();
|
|
3152
2898
|
return (jsxRuntime.jsx(Dropdown, { style: props.style, abreast: props.abreast, trigger: 'hover', menu: jsxRuntime.jsxs("div", { children: [jsxRuntime.jsx("div", { class: "color-type", children: "\u6587\u5B57\u989C\u8272" }), jsxRuntime.jsxs("div", { class: "text-colors", children: [jsxRuntime.jsx("div", { class: {
|
|
3153
2899
|
active: textColor() === ''
|
|
@@ -3355,9 +3101,7 @@ function ItalicTool() {
|
|
|
3355
3101
|
};
|
|
3356
3102
|
}
|
|
3357
3103
|
|
|
3358
|
-
var
|
|
3359
|
-
var scopedId$9 = "vf-269a0b";
|
|
3360
|
-
styleInject(css_248z$f);
|
|
3104
|
+
var css$9 = undefined;
|
|
3361
3105
|
|
|
3362
3106
|
function LinkTool(props) {
|
|
3363
3107
|
const selectionBridge = core.inject(platformBrowser.SelectionBridge);
|
|
@@ -3388,7 +3132,7 @@ function LinkTool(props) {
|
|
|
3388
3132
|
core.onUnmounted(() => {
|
|
3389
3133
|
sub.unsubscribe();
|
|
3390
3134
|
});
|
|
3391
|
-
return scopedCss.withScopedCSS(
|
|
3135
|
+
return scopedCss.withScopedCSS(css$9, () => {
|
|
3392
3136
|
const containerRect = container.getBoundingClientRect();
|
|
3393
3137
|
const rect = isShow() ? selectionBridge.getRect({
|
|
3394
3138
|
slot: selection.focusSlot,
|
|
@@ -3457,9 +3201,7 @@ function UnderlineTool() {
|
|
|
3457
3201
|
};
|
|
3458
3202
|
}
|
|
3459
3203
|
|
|
3460
|
-
var
|
|
3461
|
-
var scopedId$8 = "vf-cf8e1c";
|
|
3462
|
-
styleInject(css_248z$e);
|
|
3204
|
+
var css$8 = undefined;
|
|
3463
3205
|
|
|
3464
3206
|
function InsertTool(props) {
|
|
3465
3207
|
const commander = core.inject(core$1.Commander);
|
|
@@ -3563,14 +3305,12 @@ function InsertTool(props) {
|
|
|
3563
3305
|
break;
|
|
3564
3306
|
}
|
|
3565
3307
|
}
|
|
3566
|
-
return scopedCss.withScopedCSS(
|
|
3308
|
+
return scopedCss.withScopedCSS(css$8, () => {
|
|
3567
3309
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { class: "btn-group", children: [jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('paragraph'), children: jsxRuntime.jsx("span", { class: "xnote-icon-pilcrow" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('h1'), children: jsxRuntime.jsx("span", { class: "xnote-icon-heading-h1" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('h2'), children: jsxRuntime.jsx("span", { class: "xnote-icon-heading-h2" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('h3'), children: jsxRuntime.jsx("span", { class: "xnote-icon-heading-h3" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('h4'), children: jsxRuntime.jsx("span", { class: "xnote-icon-heading-h4" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('h5'), children: jsxRuntime.jsx("span", { class: "xnote-icon-heading-h5" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('h6'), children: jsxRuntime.jsx("span", { class: "xnote-icon-heading-h6" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('ol'), children: jsxRuntime.jsx("span", { class: "xnote-icon-list-numbered" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('ul'), children: jsxRuntime.jsx("span", { class: "xnote-icon-list" }) }), jsxRuntime.jsx(Button, { ordinary: true, onClick: () => insert('sourceCode'), children: jsxRuntime.jsx("span", { class: "xnote-icon-source-code" }) })] }), jsxRuntime.jsx(Divider, {}), jsxRuntime.jsx(MenuItem, { onClick: () => insert('table'), icon: jsxRuntime.jsx("span", { class: "xnote-icon-table" }), children: "\u8868\u683C" }), jsxRuntime.jsx(MenuItem, { onClick: () => insert('todolist'), icon: jsxRuntime.jsx("span", { class: "xnote-icon-checkbox-checked" }), children: "\u5F85\u529E\u5217\u8868" }), jsxRuntime.jsx(MenuItem, { onClick: () => insert('image'), icon: jsxRuntime.jsx("span", { class: "xnote-icon-image" }), children: "\u56FE\u7247" }), jsxRuntime.jsx(MenuItem, { onClick: () => insert('video'), icon: jsxRuntime.jsx("span", { class: "xnote-icon-video" }), children: "\u89C6\u9891" }), jsxRuntime.jsx(MenuItem, { onClick: () => insert('highlightBox'), icon: jsxRuntime.jsx("span", { class: "xnote-icon-warning" }), children: "\u9AD8\u4EAE\u5757" })] });
|
|
3568
3310
|
});
|
|
3569
3311
|
}
|
|
3570
3312
|
|
|
3571
|
-
var
|
|
3572
|
-
var scopedId$7 = "vf-b05292";
|
|
3573
|
-
styleInject(css_248z$d);
|
|
3313
|
+
var css$7 = undefined;
|
|
3574
3314
|
|
|
3575
3315
|
const LeftToolbar = core.withAnnotation({
|
|
3576
3316
|
providers: [exports.RefreshService]
|
|
@@ -3729,7 +3469,7 @@ const LeftToolbar = core.withAnnotation({
|
|
|
3729
3469
|
}
|
|
3730
3470
|
}
|
|
3731
3471
|
const isEmptyBlock = core.createSignal(true);
|
|
3732
|
-
return scopedCss.withScopedCSS(
|
|
3472
|
+
return scopedCss.withScopedCSS(css$7, () => {
|
|
3733
3473
|
const position = positionSignal();
|
|
3734
3474
|
const slot = activeSlot();
|
|
3735
3475
|
let activeNode = jsxRuntime.jsx("span", { class: "xnote-icon-pilcrow" });
|
|
@@ -3774,12 +3514,7 @@ const LeftToolbar = core.withAnnotation({
|
|
|
3774
3514
|
|
|
3775
3515
|
class LeftToolbarPlugin {
|
|
3776
3516
|
constructor() {
|
|
3777
|
-
|
|
3778
|
-
enumerable: true,
|
|
3779
|
-
configurable: true,
|
|
3780
|
-
writable: true,
|
|
3781
|
-
value: null
|
|
3782
|
-
});
|
|
3517
|
+
this.app = null;
|
|
3783
3518
|
}
|
|
3784
3519
|
setup(injector) {
|
|
3785
3520
|
const App = function () {
|
|
@@ -3805,18 +3540,11 @@ class LeftToolbarPlugin {
|
|
|
3805
3540
|
}
|
|
3806
3541
|
}
|
|
3807
3542
|
|
|
3808
|
-
var
|
|
3809
|
-
var scopedId$6 = "vf-fee98b";
|
|
3810
|
-
styleInject(css_248z$c);
|
|
3543
|
+
var css$6 = undefined;
|
|
3811
3544
|
|
|
3812
3545
|
exports.EditorService = class EditorService {
|
|
3813
3546
|
constructor() {
|
|
3814
|
-
|
|
3815
|
-
enumerable: true,
|
|
3816
|
-
configurable: true,
|
|
3817
|
-
writable: true,
|
|
3818
|
-
value: false
|
|
3819
|
-
});
|
|
3547
|
+
this.hideInlineToolbar = false;
|
|
3820
3548
|
}
|
|
3821
3549
|
};
|
|
3822
3550
|
exports.EditorService = __decorate([
|
|
@@ -3922,7 +3650,7 @@ const Toolbar = core.withAnnotation({
|
|
|
3922
3650
|
mousedownSubscription.unsubscribe();
|
|
3923
3651
|
mouseupSubscription.unsubscribe();
|
|
3924
3652
|
});
|
|
3925
|
-
return scopedCss.withScopedCSS(
|
|
3653
|
+
return scopedCss.withScopedCSS(css$6, () => {
|
|
3926
3654
|
const p = viewPosition();
|
|
3927
3655
|
return (jsxRuntime.jsxs("div", { class: "toolbar", ref: toolbarRef, style: {
|
|
3928
3656
|
left: p.left + 'px',
|
|
@@ -3937,12 +3665,7 @@ const Toolbar = core.withAnnotation({
|
|
|
3937
3665
|
|
|
3938
3666
|
class ToolbarPlugin {
|
|
3939
3667
|
constructor() {
|
|
3940
|
-
|
|
3941
|
-
enumerable: true,
|
|
3942
|
-
configurable: true,
|
|
3943
|
-
writable: true,
|
|
3944
|
-
value: null
|
|
3945
|
-
});
|
|
3668
|
+
this.app = null;
|
|
3946
3669
|
}
|
|
3947
3670
|
setup(injector) {
|
|
3948
3671
|
const App = function () {
|
|
@@ -3967,30 +3690,10 @@ class ToolbarPlugin {
|
|
|
3967
3690
|
|
|
3968
3691
|
class Matcher {
|
|
3969
3692
|
constructor(target, rule) {
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
value: target
|
|
3975
|
-
});
|
|
3976
|
-
Object.defineProperty(this, "rule", {
|
|
3977
|
-
enumerable: true,
|
|
3978
|
-
configurable: true,
|
|
3979
|
-
writable: true,
|
|
3980
|
-
value: rule
|
|
3981
|
-
});
|
|
3982
|
-
Object.defineProperty(this, "validators", {
|
|
3983
|
-
enumerable: true,
|
|
3984
|
-
configurable: true,
|
|
3985
|
-
writable: true,
|
|
3986
|
-
value: []
|
|
3987
|
-
});
|
|
3988
|
-
Object.defineProperty(this, "excludeValidators", {
|
|
3989
|
-
enumerable: true,
|
|
3990
|
-
configurable: true,
|
|
3991
|
-
writable: true,
|
|
3992
|
-
value: []
|
|
3993
|
-
});
|
|
3693
|
+
this.target = target;
|
|
3694
|
+
this.rule = rule;
|
|
3695
|
+
this.validators = [];
|
|
3696
|
+
this.excludeValidators = [];
|
|
3994
3697
|
if (rule.tags) {
|
|
3995
3698
|
this.validators.push(this.makeTagsMatcher(rule.tags));
|
|
3996
3699
|
}
|
|
@@ -4082,26 +3785,13 @@ class Matcher {
|
|
|
4082
3785
|
}
|
|
4083
3786
|
}
|
|
4084
3787
|
|
|
4085
|
-
var css_248z$b = ".xnote-image{display:inline-block}.xnote-image,.xnote-image img{max-width:100%}";
|
|
4086
|
-
styleInject(css_248z$b);
|
|
4087
|
-
|
|
4088
3788
|
class ImageComponent extends core$1.Component {
|
|
4089
3789
|
static fromJSON(textbus, json) {
|
|
4090
3790
|
return new ImageComponent(textbus, Object.assign({}, json));
|
|
4091
3791
|
}
|
|
4092
3792
|
}
|
|
4093
|
-
|
|
4094
|
-
|
|
4095
|
-
configurable: true,
|
|
4096
|
-
writable: true,
|
|
4097
|
-
value: core$1.ContentType.InlineComponent
|
|
4098
|
-
});
|
|
4099
|
-
Object.defineProperty(ImageComponent, "componentName", {
|
|
4100
|
-
enumerable: true,
|
|
4101
|
-
configurable: true,
|
|
4102
|
-
writable: true,
|
|
4103
|
-
value: 'ImageComponent'
|
|
4104
|
-
});
|
|
3793
|
+
ImageComponent.type = core$1.ContentType.InlineComponent;
|
|
3794
|
+
ImageComponent.componentName = 'ImageComponent';
|
|
4105
3795
|
function ImageView(props) {
|
|
4106
3796
|
const { name, state } = props.component;
|
|
4107
3797
|
const imageRef = core.createRef();
|
|
@@ -4132,18 +3822,10 @@ const imageComponentLoader = {
|
|
|
4132
3822
|
}
|
|
4133
3823
|
};
|
|
4134
3824
|
|
|
4135
|
-
var css_248z$a = ".xnote-root{color:#1f2329}.xnote-root * ::selection{background:rgba(20,99,252,.34)}.xnote-title{font-size:30px;font-weight:600;margin:36px 0 22px}.xnote-title:before{content:attr(data-placeholder);opacity:.5;position:absolute}.xnote-content{font-size:16px;line-height:1.65}.xnote-content:before{content:attr(data-placeholder);opacity:.5;position:absolute}";
|
|
4136
|
-
styleInject(css_248z$a);
|
|
4137
|
-
|
|
4138
3825
|
class RootComponent extends core$1.Component {
|
|
4139
3826
|
constructor() {
|
|
4140
3827
|
super(...arguments);
|
|
4141
|
-
|
|
4142
|
-
enumerable: true,
|
|
4143
|
-
configurable: true,
|
|
4144
|
-
writable: true,
|
|
4145
|
-
value: new core$1.Subject()
|
|
4146
|
-
});
|
|
3828
|
+
this.onCompositionStart = new core$1.Subject();
|
|
4147
3829
|
}
|
|
4148
3830
|
static fromJSON(textbus, json) {
|
|
4149
3831
|
const heading = textbus.get(core$1.Registry).createSlot(json.heading);
|
|
@@ -4186,18 +3868,8 @@ class RootComponent extends core$1.Component {
|
|
|
4186
3868
|
content.insert(new ParagraphComponent(this.textbus));
|
|
4187
3869
|
}
|
|
4188
3870
|
}
|
|
4189
|
-
|
|
4190
|
-
|
|
4191
|
-
configurable: true,
|
|
4192
|
-
writable: true,
|
|
4193
|
-
value: 'RootComponent'
|
|
4194
|
-
});
|
|
4195
|
-
Object.defineProperty(RootComponent, "type", {
|
|
4196
|
-
enumerable: true,
|
|
4197
|
-
configurable: true,
|
|
4198
|
-
writable: true,
|
|
4199
|
-
value: core$1.ContentType.BlockComponent
|
|
4200
|
-
});
|
|
3871
|
+
RootComponent.componentName = 'RootComponent';
|
|
3872
|
+
RootComponent.type = core$1.ContentType.BlockComponent;
|
|
4201
3873
|
function RootView(props) {
|
|
4202
3874
|
const adapter = core.inject(platformBrowser.DomAdapter);
|
|
4203
3875
|
const { heading, content } = props.component.state;
|
|
@@ -4255,45 +3927,15 @@ const rootComponentLoader = {
|
|
|
4255
3927
|
}
|
|
4256
3928
|
};
|
|
4257
3929
|
|
|
4258
|
-
var
|
|
4259
|
-
styleInject(css_248z$9);
|
|
4260
|
-
|
|
4261
|
-
var css_248z$8 = ".drag-line[vf-681de2]{border-color:transparent;border-style:solid;border-width:0 5px;bottom:0;box-sizing:content-box;cursor:col-resize;display:none;margin-left:-5px;position:absolute;top:0;width:2px}.drag-line[vf-681de2]:before{background:#296eff;content:\"\";inset:0;position:absolute}";
|
|
4262
|
-
var scopedId$5 = "vf-681de2";
|
|
4263
|
-
styleInject(css_248z$8);
|
|
3930
|
+
var css$5 = undefined;
|
|
4264
3931
|
|
|
4265
3932
|
let TableService = class TableService {
|
|
4266
3933
|
constructor() {
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
});
|
|
4273
|
-
Object.defineProperty(this, "onInsertColumnBefore", {
|
|
4274
|
-
enumerable: true,
|
|
4275
|
-
configurable: true,
|
|
4276
|
-
writable: true,
|
|
4277
|
-
value: new core$1.Subject()
|
|
4278
|
-
});
|
|
4279
|
-
Object.defineProperty(this, "onSelectColumns", {
|
|
4280
|
-
enumerable: true,
|
|
4281
|
-
configurable: true,
|
|
4282
|
-
writable: true,
|
|
4283
|
-
value: new core$1.Subject()
|
|
4284
|
-
});
|
|
4285
|
-
Object.defineProperty(this, "onSelectRows", {
|
|
4286
|
-
enumerable: true,
|
|
4287
|
-
configurable: true,
|
|
4288
|
-
writable: true,
|
|
4289
|
-
value: new core$1.Subject()
|
|
4290
|
-
});
|
|
4291
|
-
Object.defineProperty(this, "onScroll", {
|
|
4292
|
-
enumerable: true,
|
|
4293
|
-
configurable: true,
|
|
4294
|
-
writable: true,
|
|
4295
|
-
value: new core$1.Subject()
|
|
4296
|
-
});
|
|
3934
|
+
this.onInsertRowBefore = new core$1.Subject();
|
|
3935
|
+
this.onInsertColumnBefore = new core$1.Subject();
|
|
3936
|
+
this.onSelectColumns = new core$1.Subject();
|
|
3937
|
+
this.onSelectRows = new core$1.Subject();
|
|
3938
|
+
this.onScroll = new core$1.Subject();
|
|
4297
3939
|
}
|
|
4298
3940
|
};
|
|
4299
3941
|
TableService = __decorate([
|
|
@@ -4372,14 +4014,12 @@ function ResizeColumn(props) {
|
|
|
4372
4014
|
});
|
|
4373
4015
|
return () => sub.unsubscribe();
|
|
4374
4016
|
});
|
|
4375
|
-
return scopedCss.withScopedCSS(
|
|
4017
|
+
return scopedCss.withScopedCSS(css$5, () => {
|
|
4376
4018
|
return jsxRuntime.jsx("div", { ref: dragLineRef, class: ['drag-line'] });
|
|
4377
4019
|
});
|
|
4378
4020
|
}
|
|
4379
4021
|
|
|
4380
|
-
var
|
|
4381
|
-
var scopedId$4 = "vf-5bce97";
|
|
4382
|
-
styleInject(css_248z$7);
|
|
4022
|
+
var css$4 = undefined;
|
|
4383
4023
|
|
|
4384
4024
|
function TopBar(props) {
|
|
4385
4025
|
const editorService = core.inject(exports.EditorService);
|
|
@@ -4447,7 +4087,7 @@ function TopBar(props) {
|
|
|
4447
4087
|
s.unsubscribe();
|
|
4448
4088
|
});
|
|
4449
4089
|
const deleteIndex = core.createSignal(null);
|
|
4450
|
-
return scopedCss.withScopedCSS(
|
|
4090
|
+
return scopedCss.withScopedCSS(css$4, () => {
|
|
4451
4091
|
const { state, tableSelection } = props.component;
|
|
4452
4092
|
const position = tableSelection();
|
|
4453
4093
|
return (jsxRuntime.jsx("div", { class: ['top-bar', {
|
|
@@ -4500,9 +4140,7 @@ function TopBar(props) {
|
|
|
4500
4140
|
});
|
|
4501
4141
|
}
|
|
4502
4142
|
|
|
4503
|
-
var
|
|
4504
|
-
var scopedId$3 = "vf-b1149b";
|
|
4505
|
-
styleInject(css_248z$6);
|
|
4143
|
+
var css$3 = undefined;
|
|
4506
4144
|
|
|
4507
4145
|
function Scroll(props) {
|
|
4508
4146
|
const scrollRef = core.createRef();
|
|
@@ -4534,7 +4172,7 @@ function Scroll(props) {
|
|
|
4534
4172
|
draft.rightEnd = el.scrollLeft === el.scrollWidth - el.offsetWidth;
|
|
4535
4173
|
});
|
|
4536
4174
|
});
|
|
4537
|
-
return scopedCss.withScopedCSS(
|
|
4175
|
+
return scopedCss.withScopedCSS(css$3, () => {
|
|
4538
4176
|
return jsxRuntime.jsx("div", { ref: [scrollRef, props.scrollRef], class: ['scroll-container', {
|
|
4539
4177
|
'left-end': showShadow().leftEnd,
|
|
4540
4178
|
'right-end': showShadow().rightEnd,
|
|
@@ -4546,9 +4184,7 @@ function Scroll(props) {
|
|
|
4546
4184
|
});
|
|
4547
4185
|
}
|
|
4548
4186
|
|
|
4549
|
-
var
|
|
4550
|
-
var scopedId$2 = "vf-ef93c0";
|
|
4551
|
-
styleInject(css_248z$5);
|
|
4187
|
+
var css$2 = undefined;
|
|
4552
4188
|
|
|
4553
4189
|
function LeftBar(props) {
|
|
4554
4190
|
const editorService = core.inject(exports.EditorService);
|
|
@@ -4622,7 +4258,7 @@ function LeftBar(props) {
|
|
|
4622
4258
|
textbus.focus();
|
|
4623
4259
|
});
|
|
4624
4260
|
}
|
|
4625
|
-
return scopedCss.withScopedCSS(
|
|
4261
|
+
return scopedCss.withScopedCSS(css$2, () => {
|
|
4626
4262
|
const { state, tableSelection } = props.component;
|
|
4627
4263
|
const position = tableSelection();
|
|
4628
4264
|
return (jsxRuntime.jsxs("div", { class: ['left-bar', { active: props.isFocus() }], children: [jsxRuntime.jsx("div", { class: "insert-bar", children: jsxRuntime.jsx("table", { ref: insertBarRef, children: jsxRuntime.jsx("tbody", { children: state.rows.map((_, index) => {
|
|
@@ -4670,9 +4306,7 @@ function LeftBar(props) {
|
|
|
4670
4306
|
});
|
|
4671
4307
|
}
|
|
4672
4308
|
|
|
4673
|
-
var
|
|
4674
|
-
var scopedId$1 = "vf-d4c4a9";
|
|
4675
|
-
styleInject(css_248z$4);
|
|
4309
|
+
var css$1 = undefined;
|
|
4676
4310
|
|
|
4677
4311
|
function sum(numbers) {
|
|
4678
4312
|
return numbers.reduce((a, b) => a + b, 0);
|
|
@@ -4705,7 +4339,7 @@ function ResizeRow(props) {
|
|
|
4705
4339
|
});
|
|
4706
4340
|
return () => sub.unsubscribe();
|
|
4707
4341
|
});
|
|
4708
|
-
return scopedCss.withScopedCSS(
|
|
4342
|
+
return scopedCss.withScopedCSS(css$1, () => {
|
|
4709
4343
|
return jsxRuntime.jsx("div", { ref: dragLineRef, style: {
|
|
4710
4344
|
display: styles().visible ? 'block' : 'none',
|
|
4711
4345
|
top: styles().top + 'px',
|
|
@@ -4714,9 +4348,7 @@ function ResizeRow(props) {
|
|
|
4714
4348
|
});
|
|
4715
4349
|
}
|
|
4716
4350
|
|
|
4717
|
-
var
|
|
4718
|
-
var scopedId = "vf-e16878";
|
|
4719
|
-
styleInject(css_248z$3);
|
|
4351
|
+
var css = undefined;
|
|
4720
4352
|
|
|
4721
4353
|
function SelectionMask(props) {
|
|
4722
4354
|
const [styles, updateStyles] = hooks.useProduce({
|
|
@@ -4769,7 +4401,7 @@ function SelectionMask(props) {
|
|
|
4769
4401
|
core.onUnmounted(() => {
|
|
4770
4402
|
s.unsubscribe();
|
|
4771
4403
|
});
|
|
4772
|
-
return scopedCss.withScopedCSS(
|
|
4404
|
+
return scopedCss.withScopedCSS(css, () => {
|
|
4773
4405
|
const style = styles();
|
|
4774
4406
|
return (jsxRuntime.jsx("div", { class: "mask", style: {
|
|
4775
4407
|
display: style.visible ? 'block' : 'none',
|
|
@@ -5067,9 +4699,6 @@ function autoComplete(table) {
|
|
|
5067
4699
|
});
|
|
5068
4700
|
}
|
|
5069
4701
|
|
|
5070
|
-
var css_248z$2 = ".xnote-video{display:inline-block}.xnote-video,.xnote-video video{max-width:100%}";
|
|
5071
|
-
styleInject(css_248z$2);
|
|
5072
|
-
|
|
5073
4702
|
class VideoComponent extends core$1.Component {
|
|
5074
4703
|
static fromJSON(textbus, json) {
|
|
5075
4704
|
return new VideoComponent(textbus, Object.assign({}, json));
|
|
@@ -5078,18 +4707,8 @@ class VideoComponent extends core$1.Component {
|
|
|
5078
4707
|
//
|
|
5079
4708
|
}
|
|
5080
4709
|
}
|
|
5081
|
-
|
|
5082
|
-
|
|
5083
|
-
configurable: true,
|
|
5084
|
-
writable: true,
|
|
5085
|
-
value: core$1.ContentType.InlineComponent
|
|
5086
|
-
});
|
|
5087
|
-
Object.defineProperty(VideoComponent, "componentName", {
|
|
5088
|
-
enumerable: true,
|
|
5089
|
-
configurable: true,
|
|
5090
|
-
writable: true,
|
|
5091
|
-
value: 'VideoComponent'
|
|
5092
|
-
});
|
|
4710
|
+
VideoComponent.type = core$1.ContentType.InlineComponent;
|
|
4711
|
+
VideoComponent.componentName = 'VideoComponent';
|
|
5093
4712
|
function VideoView(props) {
|
|
5094
4713
|
const { name, state } = props.component;
|
|
5095
4714
|
const videoRef = core.createRef();
|
|
@@ -5120,15 +4739,9 @@ const videoComponentLoader = {
|
|
|
5120
4739
|
}
|
|
5121
4740
|
};
|
|
5122
4741
|
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
var css_248z = ".xnote-h1{font-size:2.2em;font-weight:600}.xnote-h2{font-size:1.8em;font-weight:600}.xnote-h3{font-size:1.4em;font-weight:600}.xnote-h4{font-size:1em;font-weight:600}.xnote-h5{font-size:.9em;font-weight:600}.xnote-h6{font-size:.8em;font-weight:600}.xnote-code{border:1px solid rgba(0,0,0,.2);border-radius:4px;font-family:Microsoft YaHei Mono,Menlo,Monaco,Consolas,Courier New,monospace;margin:0 3px;padding:2px 3px}";
|
|
5127
|
-
styleInject(css_248z);
|
|
5128
|
-
|
|
5129
|
-
function createXNote(host, config = {}) {
|
|
5130
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
5131
|
-
const adapter = new adapterViewfly.Adapter({
|
|
4742
|
+
function createXNote(host_1) {
|
|
4743
|
+
return __awaiter(this, arguments, void 0, function* (host, config = {}) {
|
|
4744
|
+
const adapter = new adapterViewfly.ViewflyAdapter({
|
|
5132
4745
|
[ParagraphComponent.componentName]: ParagraphView,
|
|
5133
4746
|
[RootComponent.componentName]: RootView,
|
|
5134
4747
|
[BlockquoteComponent.componentName]: BlockquoteView,
|
|
@@ -5139,8 +4752,8 @@ function createXNote(host, config = {}) {
|
|
|
5139
4752
|
[ListComponent.componentName]: ListComponentView,
|
|
5140
4753
|
[ImageComponent.componentName]: ImageView,
|
|
5141
4754
|
[VideoComponent.componentName]: VideoView
|
|
5142
|
-
}, (host, root) => {
|
|
5143
|
-
const appInjector = new core.ReflectiveInjector(
|
|
4755
|
+
}, (host, root, injector) => {
|
|
4756
|
+
const appInjector = new core.ReflectiveInjector(injector, [{
|
|
5144
4757
|
provide: OutputInjectionToken,
|
|
5145
4758
|
useValue: false
|
|
5146
4759
|
}]);
|
|
@@ -5151,6 +4764,35 @@ function createXNote(host, config = {}) {
|
|
|
5151
4764
|
app.destroy();
|
|
5152
4765
|
};
|
|
5153
4766
|
});
|
|
4767
|
+
const vDomAdapter = new adapterViewfly.ViewflyVDomAdapter({
|
|
4768
|
+
[ParagraphComponent.componentName]: ParagraphView,
|
|
4769
|
+
[RootComponent.componentName]: RootView,
|
|
4770
|
+
[BlockquoteComponent.componentName]: BlockquoteView,
|
|
4771
|
+
[TodolistComponent.componentName]: TodolistView,
|
|
4772
|
+
[SourceCodeComponent.componentName]: SourceCodeView,
|
|
4773
|
+
[TableComponent.componentName]: TableComponentView,
|
|
4774
|
+
[HighlightBoxComponent.componentName]: HighlightBoxView,
|
|
4775
|
+
[ListComponent.componentName]: ListComponentView,
|
|
4776
|
+
[ImageComponent.componentName]: ImageView,
|
|
4777
|
+
[VideoComponent.componentName]: VideoView
|
|
4778
|
+
}, (host, root, injector) => {
|
|
4779
|
+
const appInjector = new core.ReflectiveInjector(injector, [{
|
|
4780
|
+
provide: OutputInjectionToken,
|
|
4781
|
+
useValue: true
|
|
4782
|
+
}, {
|
|
4783
|
+
provide: platformBrowser.DomAdapter,
|
|
4784
|
+
useFactory() {
|
|
4785
|
+
return vDomAdapter;
|
|
4786
|
+
}
|
|
4787
|
+
}]);
|
|
4788
|
+
const app = platformBrowser$1.createApp(root, {
|
|
4789
|
+
context: appInjector,
|
|
4790
|
+
nativeRenderer: new platformBrowser$1.HTMLRenderer()
|
|
4791
|
+
}).mount(host);
|
|
4792
|
+
return () => {
|
|
4793
|
+
app.destroy();
|
|
4794
|
+
};
|
|
4795
|
+
});
|
|
5154
4796
|
const browserModule = new platformBrowser.BrowserModule({
|
|
5155
4797
|
renderTo() {
|
|
5156
4798
|
return host;
|
|
@@ -5190,6 +4832,7 @@ function createXNote(host, config = {}) {
|
|
|
5190
4832
|
modules.push(new collaborate.CollaborateModule(config.collaborateConfig));
|
|
5191
4833
|
}
|
|
5192
4834
|
const textbus = new core$1.Textbus({
|
|
4835
|
+
additionalAdapters: [vDomAdapter],
|
|
5193
4836
|
zenCoding: true,
|
|
5194
4837
|
readonly: config.readonly,
|
|
5195
4838
|
imports: modules,
|
|
@@ -5254,8 +4897,13 @@ function createXNote(host, config = {}) {
|
|
|
5254
4897
|
});
|
|
5255
4898
|
}
|
|
5256
4899
|
yield textbus.render(rootComp);
|
|
5257
|
-
|
|
5258
|
-
return
|
|
4900
|
+
const translator = new platformBrowser$1.OutputTranslator();
|
|
4901
|
+
return {
|
|
4902
|
+
textbus,
|
|
4903
|
+
getHTML() {
|
|
4904
|
+
return translator.transform(vDomAdapter.host);
|
|
4905
|
+
}
|
|
4906
|
+
};
|
|
5259
4907
|
});
|
|
5260
4908
|
}
|
|
5261
4909
|
|