@textbus/xnote 0.3.1 → 0.3.3
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/index.esm.js +788 -222
- package/bundles/index.js +786 -220
- package/bundles/plugins/tools/font-family.tool.d.ts +1 -1
- package/bundles/textbus/components/SlotRender.d.ts +2 -3
- package/package.json +10 -10
package/bundles/index.esm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from '@viewfly/core/jsx-runtime';
|
|
2
2
|
import { withScopedCSS } from '@viewfly/scoped-css';
|
|
3
|
-
import { Injectable, InjectFlags, Injector, inject, createSignal, onUnmounted, getCurrentInstance, createRef, InjectionToken, withAnnotation, onUpdated, onMounted, ReflectiveInjector, createDynamicRef, jsx as jsx$1, viewfly, Fragment as Fragment$1, Context, watch } from '@viewfly/core';
|
|
4
|
-
import { Subject, fromEvent, Selection, Subscription, Attribute, Keyboard, Commander, Controller, useContext, onBreak, onContentInsert, ContentType,
|
|
3
|
+
import { Injectable, InjectFlags, Injector, inject, createSignal, onUnmounted, getCurrentInstance, createRef, InjectionToken, withAnnotation, onUpdated, onMounted, onPropsChanged, ReflectiveInjector, createDynamicRef, jsx as jsx$1, viewfly, Fragment as Fragment$1, Context, watch } from '@viewfly/core';
|
|
4
|
+
import { Subject, fromEvent, Selection, Subscription, Attribute, Keyboard, Commander, Controller, useContext, onBreak, onContentInsert, ContentType, createVNode, merge, Slot, Component, Registry, Query, QueryStateType, Formatter, BehaviorSubject, onSlotApplyFormat, onSlotSetAttribute, onPaste, onFocus, onBlur, useDynamicShortcut, VTextNode, onFocusIn, onFocusOut, onDestroy, onGetRanges, onParentSlotUpdated, Textbus, History, RootComponentRef, filter, map, distinctUntilChanged, sampleTime, debounceTime, delay, tap, onContentInserted, onContentDeleted, switchMap, fromPromise, onCompositionStart } from '@textbus/core';
|
|
5
5
|
import { normalizeHex, hex2Hsl, hex2Rgb, hex2Hsv, hsl2Hex, hsl2Hsv, hsl2Rgb, rgb2Hsl, rgb2Hex, rgb2Hsv, hsv2Hex, hsv2Hsl, hsv2Rgb, any2Hsl, parseCss } from '@tanbo/color';
|
|
6
6
|
import { VIEW_CONTAINER, isMac, DomAdapter, Input, BrowserModule, SelectionBridge, VIEW_DOCUMENT, CollaborateSelectionAwarenessDelegate, isMobileBrowser, CollaborateCursor, Parser } from '@textbus/platform-browser';
|
|
7
7
|
import { createPortal, createApp, DomRenderer, HTMLRenderer, OutputTranslator } from '@viewfly/platform-browser';
|
|
@@ -61,7 +61,18 @@ typeof SuppressedError === "function" ? SuppressedError : function (error, suppr
|
|
|
61
61
|
|
|
62
62
|
let DropdownService = class DropdownService {
|
|
63
63
|
constructor() {
|
|
64
|
-
this
|
|
64
|
+
Object.defineProperty(this, "onSiblingOpen", {
|
|
65
|
+
enumerable: true,
|
|
66
|
+
configurable: true,
|
|
67
|
+
writable: true,
|
|
68
|
+
value: void 0
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(this, "siblingOpenEvent", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
configurable: true,
|
|
73
|
+
writable: true,
|
|
74
|
+
value: new Subject()
|
|
75
|
+
});
|
|
65
76
|
this.onSiblingOpen = this.siblingOpenEvent.asObservable();
|
|
66
77
|
}
|
|
67
78
|
notify(id) {
|
|
@@ -79,14 +90,60 @@ var DropdownContextService_1;
|
|
|
79
90
|
let i = 0;
|
|
80
91
|
let DropdownContextService = DropdownContextService_1 = class DropdownContextService {
|
|
81
92
|
constructor(dropdownService, injector) {
|
|
82
|
-
this
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
this
|
|
89
|
-
|
|
93
|
+
Object.defineProperty(this, "dropdownService", {
|
|
94
|
+
enumerable: true,
|
|
95
|
+
configurable: true,
|
|
96
|
+
writable: true,
|
|
97
|
+
value: dropdownService
|
|
98
|
+
});
|
|
99
|
+
Object.defineProperty(this, "injector", {
|
|
100
|
+
enumerable: true,
|
|
101
|
+
configurable: true,
|
|
102
|
+
writable: true,
|
|
103
|
+
value: injector
|
|
104
|
+
});
|
|
105
|
+
Object.defineProperty(this, "id", {
|
|
106
|
+
enumerable: true,
|
|
107
|
+
configurable: true,
|
|
108
|
+
writable: true,
|
|
109
|
+
value: i
|
|
110
|
+
});
|
|
111
|
+
Object.defineProperty(this, "isOpen", {
|
|
112
|
+
enumerable: true,
|
|
113
|
+
configurable: true,
|
|
114
|
+
writable: true,
|
|
115
|
+
value: false
|
|
116
|
+
});
|
|
117
|
+
Object.defineProperty(this, "onOpenStateChange", {
|
|
118
|
+
enumerable: true,
|
|
119
|
+
configurable: true,
|
|
120
|
+
writable: true,
|
|
121
|
+
value: void 0
|
|
122
|
+
});
|
|
123
|
+
Object.defineProperty(this, "canHide", {
|
|
124
|
+
enumerable: true,
|
|
125
|
+
configurable: true,
|
|
126
|
+
writable: true,
|
|
127
|
+
value: true
|
|
128
|
+
});
|
|
129
|
+
Object.defineProperty(this, "openStateChangeEvent", {
|
|
130
|
+
enumerable: true,
|
|
131
|
+
configurable: true,
|
|
132
|
+
writable: true,
|
|
133
|
+
value: new Subject()
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(this, "timer", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
configurable: true,
|
|
138
|
+
writable: true,
|
|
139
|
+
value: null
|
|
140
|
+
});
|
|
141
|
+
Object.defineProperty(this, "parentDropdownContextService", {
|
|
142
|
+
enumerable: true,
|
|
143
|
+
configurable: true,
|
|
144
|
+
writable: true,
|
|
145
|
+
value: this.injector.get(DropdownContextService_1, null, InjectFlags.SkipSelf)
|
|
146
|
+
});
|
|
90
147
|
this.onOpenStateChange = this.openStateChangeEvent.asObservable();
|
|
91
148
|
dropdownService.onSiblingOpen.subscribe(id => {
|
|
92
149
|
if (id === this.id) {
|
|
@@ -258,14 +315,54 @@ class Picker {
|
|
|
258
315
|
return this.empty ? null : this._hsv;
|
|
259
316
|
}
|
|
260
317
|
constructor(onChange, value) {
|
|
261
|
-
this
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
this
|
|
268
|
-
|
|
318
|
+
Object.defineProperty(this, "onChange", {
|
|
319
|
+
enumerable: true,
|
|
320
|
+
configurable: true,
|
|
321
|
+
writable: true,
|
|
322
|
+
value: onChange
|
|
323
|
+
});
|
|
324
|
+
Object.defineProperty(this, "_hex", {
|
|
325
|
+
enumerable: true,
|
|
326
|
+
configurable: true,
|
|
327
|
+
writable: true,
|
|
328
|
+
value: ''
|
|
329
|
+
});
|
|
330
|
+
Object.defineProperty(this, "_hsl", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
configurable: true,
|
|
333
|
+
writable: true,
|
|
334
|
+
value: null
|
|
335
|
+
});
|
|
336
|
+
Object.defineProperty(this, "_rgb", {
|
|
337
|
+
enumerable: true,
|
|
338
|
+
configurable: true,
|
|
339
|
+
writable: true,
|
|
340
|
+
value: null
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(this, "_hsv", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
configurable: true,
|
|
345
|
+
writable: true,
|
|
346
|
+
value: null
|
|
347
|
+
});
|
|
348
|
+
Object.defineProperty(this, "_rgba", {
|
|
349
|
+
enumerable: true,
|
|
350
|
+
configurable: true,
|
|
351
|
+
writable: true,
|
|
352
|
+
value: null
|
|
353
|
+
});
|
|
354
|
+
Object.defineProperty(this, "empty", {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
configurable: true,
|
|
357
|
+
writable: true,
|
|
358
|
+
value: false
|
|
359
|
+
});
|
|
360
|
+
Object.defineProperty(this, "resetAlpha", {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
configurable: true,
|
|
363
|
+
writable: true,
|
|
364
|
+
value: true
|
|
365
|
+
});
|
|
269
366
|
this.hex = value || '#f00';
|
|
270
367
|
}
|
|
271
368
|
}
|
|
@@ -940,7 +1037,12 @@ var scopedId$e = "vf-2a8a65";
|
|
|
940
1037
|
|
|
941
1038
|
let RefreshService = class RefreshService {
|
|
942
1039
|
constructor() {
|
|
943
|
-
this
|
|
1040
|
+
Object.defineProperty(this, "onRefresh", {
|
|
1041
|
+
enumerable: true,
|
|
1042
|
+
configurable: true,
|
|
1043
|
+
writable: true,
|
|
1044
|
+
value: new Subject()
|
|
1045
|
+
});
|
|
944
1046
|
}
|
|
945
1047
|
};
|
|
946
1048
|
RefreshService = __decorate([
|
|
@@ -1085,9 +1187,18 @@ function SlotRender(props) {
|
|
|
1085
1187
|
const adapter = inject(DomAdapter);
|
|
1086
1188
|
const instance = getCurrentInstance();
|
|
1087
1189
|
const slot = props.slot;
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1190
|
+
function listen(slot) {
|
|
1191
|
+
return merge(slot.__changeMarker__.onChange, slot.__changeMarker__.onForceChange).subscribe(() => {
|
|
1192
|
+
if (props.slot.__changeMarker__.dirty) {
|
|
1193
|
+
instance.markAsDirtied();
|
|
1194
|
+
}
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
let sub = listen(slot);
|
|
1198
|
+
onPropsChanged((currentProps, oldProps) => {
|
|
1199
|
+
if (oldProps.slot !== currentProps.slot) {
|
|
1200
|
+
sub.unsubscribe();
|
|
1201
|
+
sub = listen(currentProps.slot);
|
|
1091
1202
|
}
|
|
1092
1203
|
});
|
|
1093
1204
|
onUnmounted(() => {
|
|
@@ -1122,31 +1233,46 @@ class BlockquoteComponent extends Component {
|
|
|
1122
1233
|
useBlockContent(this.state.slot);
|
|
1123
1234
|
}
|
|
1124
1235
|
}
|
|
1125
|
-
BlockquoteComponent
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1236
|
+
Object.defineProperty(BlockquoteComponent, "type", {
|
|
1237
|
+
enumerable: true,
|
|
1238
|
+
configurable: true,
|
|
1239
|
+
writable: true,
|
|
1240
|
+
value: ContentType.BlockComponent
|
|
1241
|
+
});
|
|
1242
|
+
Object.defineProperty(BlockquoteComponent, "componentName", {
|
|
1243
|
+
enumerable: true,
|
|
1244
|
+
configurable: true,
|
|
1245
|
+
writable: true,
|
|
1246
|
+
value: 'BlockquoteComponent'
|
|
1247
|
+
});
|
|
1248
|
+
Object.defineProperty(BlockquoteComponent, "zenCoding", {
|
|
1249
|
+
enumerable: true,
|
|
1250
|
+
configurable: true,
|
|
1251
|
+
writable: true,
|
|
1252
|
+
value: {
|
|
1253
|
+
key: ' ',
|
|
1254
|
+
match(content, textbus) {
|
|
1255
|
+
const selection = textbus.get(Selection);
|
|
1256
|
+
if (selection.commonAncestorComponent instanceof ParagraphComponent) {
|
|
1257
|
+
return /^>$/.test(content);
|
|
1258
|
+
}
|
|
1259
|
+
return false;
|
|
1260
|
+
},
|
|
1261
|
+
createState(_, textbus) {
|
|
1262
|
+
const selection = textbus.get(Selection);
|
|
1263
|
+
const commonAncestorSlot = selection.commonAncestorSlot;
|
|
1264
|
+
const slot = new Slot([
|
|
1265
|
+
ContentType.BlockComponent
|
|
1266
|
+
]);
|
|
1267
|
+
if (commonAncestorSlot === null || commonAncestorSlot === void 0 ? void 0 : commonAncestorSlot.hasAttribute(textIndentAttr)) {
|
|
1268
|
+
slot.setAttribute(textIndentAttr, commonAncestorSlot.getAttribute(textIndentAttr));
|
|
1269
|
+
}
|
|
1270
|
+
return {
|
|
1271
|
+
slot
|
|
1272
|
+
};
|
|
1144
1273
|
}
|
|
1145
|
-
return {
|
|
1146
|
-
slot
|
|
1147
|
-
};
|
|
1148
1274
|
}
|
|
1149
|
-
};
|
|
1275
|
+
});
|
|
1150
1276
|
function toBlockquote(textbus) {
|
|
1151
1277
|
const query = textbus.get(Query);
|
|
1152
1278
|
const commander = textbus.get(Commander);
|
|
@@ -1248,9 +1374,24 @@ class HighlightBoxComponent extends Component {
|
|
|
1248
1374
|
useBlockContent(this.state.slot);
|
|
1249
1375
|
}
|
|
1250
1376
|
}
|
|
1251
|
-
HighlightBoxComponent
|
|
1252
|
-
|
|
1253
|
-
|
|
1377
|
+
Object.defineProperty(HighlightBoxComponent, "defaultTypes", {
|
|
1378
|
+
enumerable: true,
|
|
1379
|
+
configurable: true,
|
|
1380
|
+
writable: true,
|
|
1381
|
+
value: ['❤️', '💡', '📌', '✅', '❎', '👍', '🎉', '🚫', '❗']
|
|
1382
|
+
});
|
|
1383
|
+
Object.defineProperty(HighlightBoxComponent, "componentName", {
|
|
1384
|
+
enumerable: true,
|
|
1385
|
+
configurable: true,
|
|
1386
|
+
writable: true,
|
|
1387
|
+
value: 'HighlightBoxComponent'
|
|
1388
|
+
});
|
|
1389
|
+
Object.defineProperty(HighlightBoxComponent, "type", {
|
|
1390
|
+
enumerable: true,
|
|
1391
|
+
configurable: true,
|
|
1392
|
+
writable: true,
|
|
1393
|
+
value: ContentType.BlockComponent
|
|
1394
|
+
});
|
|
1254
1395
|
function HighlightBoxView(props) {
|
|
1255
1396
|
const readonly = useReadonly();
|
|
1256
1397
|
const output = useOutput();
|
|
@@ -1431,8 +1572,18 @@ class TimelineComponent extends Component {
|
|
|
1431
1572
|
return false;
|
|
1432
1573
|
}
|
|
1433
1574
|
}
|
|
1434
|
-
TimelineComponent
|
|
1435
|
-
|
|
1575
|
+
Object.defineProperty(TimelineComponent, "componentName", {
|
|
1576
|
+
enumerable: true,
|
|
1577
|
+
configurable: true,
|
|
1578
|
+
writable: true,
|
|
1579
|
+
value: 'TimelineComponent'
|
|
1580
|
+
});
|
|
1581
|
+
Object.defineProperty(TimelineComponent, "type", {
|
|
1582
|
+
enumerable: true,
|
|
1583
|
+
configurable: true,
|
|
1584
|
+
writable: true,
|
|
1585
|
+
value: ContentType.BlockComponent
|
|
1586
|
+
});
|
|
1436
1587
|
|
|
1437
1588
|
function createStepItem(textbus) {
|
|
1438
1589
|
const slot = new Slot([
|
|
@@ -1476,8 +1627,18 @@ class StepComponent extends Component {
|
|
|
1476
1627
|
return false;
|
|
1477
1628
|
}
|
|
1478
1629
|
}
|
|
1479
|
-
StepComponent
|
|
1480
|
-
|
|
1630
|
+
Object.defineProperty(StepComponent, "componentName", {
|
|
1631
|
+
enumerable: true,
|
|
1632
|
+
configurable: true,
|
|
1633
|
+
writable: true,
|
|
1634
|
+
value: 'StepComponent'
|
|
1635
|
+
});
|
|
1636
|
+
Object.defineProperty(StepComponent, "type", {
|
|
1637
|
+
enumerable: true,
|
|
1638
|
+
configurable: true,
|
|
1639
|
+
writable: true,
|
|
1640
|
+
value: ContentType.BlockComponent
|
|
1641
|
+
});
|
|
1481
1642
|
|
|
1482
1643
|
class ParagraphComponent extends Component {
|
|
1483
1644
|
static fromJSON(textbus, json) {
|
|
@@ -1523,8 +1684,18 @@ class ParagraphComponent extends Component {
|
|
|
1523
1684
|
});
|
|
1524
1685
|
}
|
|
1525
1686
|
}
|
|
1526
|
-
ParagraphComponent
|
|
1527
|
-
|
|
1687
|
+
Object.defineProperty(ParagraphComponent, "componentName", {
|
|
1688
|
+
enumerable: true,
|
|
1689
|
+
configurable: true,
|
|
1690
|
+
writable: true,
|
|
1691
|
+
value: 'ParagraphComponent'
|
|
1692
|
+
});
|
|
1693
|
+
Object.defineProperty(ParagraphComponent, "type", {
|
|
1694
|
+
enumerable: true,
|
|
1695
|
+
configurable: true,
|
|
1696
|
+
writable: true,
|
|
1697
|
+
value: ContentType.BlockComponent
|
|
1698
|
+
});
|
|
1528
1699
|
function ParagraphView(props) {
|
|
1529
1700
|
const readonly = useReadonly();
|
|
1530
1701
|
const output = useOutput();
|
|
@@ -1708,27 +1879,42 @@ function createCodeSlot() {
|
|
|
1708
1879
|
class SourceCodeComponent extends Component {
|
|
1709
1880
|
constructor() {
|
|
1710
1881
|
super(...arguments);
|
|
1711
|
-
this
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1882
|
+
Object.defineProperty(this, "focus", {
|
|
1883
|
+
enumerable: true,
|
|
1884
|
+
configurable: true,
|
|
1885
|
+
writable: true,
|
|
1886
|
+
value: new BehaviorSubject(false)
|
|
1887
|
+
});
|
|
1888
|
+
Object.defineProperty(this, "cancelEmphasize", {
|
|
1889
|
+
enumerable: true,
|
|
1890
|
+
configurable: true,
|
|
1891
|
+
writable: true,
|
|
1892
|
+
value: () => {
|
|
1893
|
+
const selection = this.textbus.get(Selection);
|
|
1894
|
+
const slots = this.state.slots;
|
|
1895
|
+
const { startSlot, endSlot } = selection;
|
|
1896
|
+
let startIndex = slots.findIndex(i => i.slot === startSlot);
|
|
1897
|
+
const endIndex = slots.findIndex(i => i.slot === endSlot) + 1;
|
|
1898
|
+
for (; startIndex < endIndex; startIndex++) {
|
|
1899
|
+
slots[startIndex].emphasize = false;
|
|
1900
|
+
}
|
|
1720
1901
|
}
|
|
1721
|
-
};
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1902
|
+
});
|
|
1903
|
+
Object.defineProperty(this, "emphasize", {
|
|
1904
|
+
enumerable: true,
|
|
1905
|
+
configurable: true,
|
|
1906
|
+
writable: true,
|
|
1907
|
+
value: () => {
|
|
1908
|
+
const selection = this.textbus.get(Selection);
|
|
1909
|
+
const slots = this.state.slots;
|
|
1910
|
+
const { startSlot, endSlot } = selection;
|
|
1911
|
+
let startIndex = slots.findIndex(i => i.slot === startSlot);
|
|
1912
|
+
const endIndex = slots.findIndex(i => i.slot === endSlot) + 1;
|
|
1913
|
+
for (; startIndex < endIndex; startIndex++) {
|
|
1914
|
+
slots[startIndex].emphasize = true;
|
|
1915
|
+
}
|
|
1730
1916
|
}
|
|
1731
|
-
};
|
|
1917
|
+
});
|
|
1732
1918
|
}
|
|
1733
1919
|
static fromJSON(textbus, json) {
|
|
1734
1920
|
const registry = textbus.get(Registry);
|
|
@@ -1918,56 +2104,71 @@ class SourceCodeComponent extends Component {
|
|
|
1918
2104
|
return false;
|
|
1919
2105
|
}
|
|
1920
2106
|
}
|
|
1921
|
-
SourceCodeComponent
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1934
|
-
|
|
1935
|
-
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
2107
|
+
Object.defineProperty(SourceCodeComponent, "type", {
|
|
2108
|
+
enumerable: true,
|
|
2109
|
+
configurable: true,
|
|
2110
|
+
writable: true,
|
|
2111
|
+
value: ContentType.BlockComponent
|
|
2112
|
+
});
|
|
2113
|
+
Object.defineProperty(SourceCodeComponent, "componentName", {
|
|
2114
|
+
enumerable: true,
|
|
2115
|
+
configurable: true,
|
|
2116
|
+
writable: true,
|
|
2117
|
+
value: 'SourceCodeComponent'
|
|
2118
|
+
});
|
|
2119
|
+
Object.defineProperty(SourceCodeComponent, "zenCoding", {
|
|
2120
|
+
enumerable: true,
|
|
2121
|
+
configurable: true,
|
|
2122
|
+
writable: true,
|
|
2123
|
+
value: {
|
|
2124
|
+
key: ['Enter', ' '],
|
|
2125
|
+
match(c, textbus) {
|
|
2126
|
+
const selection = textbus.get(Selection);
|
|
2127
|
+
if (selection.commonAncestorComponent instanceof ParagraphComponent) {
|
|
2128
|
+
const matchString = languageList.map(i => i.label || i.value).concat('js', 'ts').join('|').replace(/\+/, '\\+');
|
|
2129
|
+
const reg = new RegExp(`^\`\`\`(${matchString})$`, 'i');
|
|
2130
|
+
return reg.test(c);
|
|
2131
|
+
}
|
|
2132
|
+
return false;
|
|
2133
|
+
},
|
|
2134
|
+
createState(content) {
|
|
2135
|
+
const matchString = content.replace(/`/g, '').replace(/\+/, '\\+');
|
|
2136
|
+
for (const item of languageList) {
|
|
2137
|
+
const reg = new RegExp(`^${matchString}$`, 'i');
|
|
2138
|
+
if (reg.test(item.label || item.value)) {
|
|
2139
|
+
return {
|
|
2140
|
+
lang: item.value,
|
|
2141
|
+
theme: '',
|
|
2142
|
+
lineNumber: true,
|
|
2143
|
+
slots: [createCodeSlot()]
|
|
2144
|
+
};
|
|
2145
|
+
}
|
|
2146
|
+
}
|
|
2147
|
+
if (/^js$/i.test(matchString)) {
|
|
1939
2148
|
return {
|
|
1940
|
-
lang:
|
|
2149
|
+
lang: 'JavaScript',
|
|
2150
|
+
theme: '',
|
|
2151
|
+
lineNumber: true,
|
|
2152
|
+
slots: [createCodeSlot()]
|
|
2153
|
+
};
|
|
2154
|
+
}
|
|
2155
|
+
if (/^ts$/i.test(matchString)) {
|
|
2156
|
+
return {
|
|
2157
|
+
lang: 'TypeScript',
|
|
1941
2158
|
theme: '',
|
|
1942
2159
|
lineNumber: true,
|
|
1943
2160
|
slots: [createCodeSlot()]
|
|
1944
2161
|
};
|
|
1945
2162
|
}
|
|
1946
|
-
}
|
|
1947
|
-
if (/^js$/i.test(matchString)) {
|
|
1948
|
-
return {
|
|
1949
|
-
lang: 'JavaScript',
|
|
1950
|
-
theme: '',
|
|
1951
|
-
lineNumber: true,
|
|
1952
|
-
slots: [createCodeSlot()]
|
|
1953
|
-
};
|
|
1954
|
-
}
|
|
1955
|
-
if (/^ts$/i.test(matchString)) {
|
|
1956
2163
|
return {
|
|
1957
|
-
lang: '
|
|
2164
|
+
lang: '',
|
|
1958
2165
|
theme: '',
|
|
1959
2166
|
lineNumber: true,
|
|
1960
2167
|
slots: [createCodeSlot()]
|
|
1961
2168
|
};
|
|
1962
2169
|
}
|
|
1963
|
-
return {
|
|
1964
|
-
lang: '',
|
|
1965
|
-
theme: '',
|
|
1966
|
-
lineNumber: true,
|
|
1967
|
-
slots: [createCodeSlot()]
|
|
1968
|
-
};
|
|
1969
2170
|
}
|
|
1970
|
-
};
|
|
2171
|
+
});
|
|
1971
2172
|
function SourceCodeView(props) {
|
|
1972
2173
|
const adapter = inject(DomAdapter);
|
|
1973
2174
|
const isFocus = createSignal(false);
|
|
@@ -2245,8 +2446,18 @@ class ImageComponent extends Component {
|
|
|
2245
2446
|
return [];
|
|
2246
2447
|
}
|
|
2247
2448
|
}
|
|
2248
|
-
ImageComponent
|
|
2249
|
-
|
|
2449
|
+
Object.defineProperty(ImageComponent, "type", {
|
|
2450
|
+
enumerable: true,
|
|
2451
|
+
configurable: true,
|
|
2452
|
+
writable: true,
|
|
2453
|
+
value: ContentType.InlineComponent
|
|
2454
|
+
});
|
|
2455
|
+
Object.defineProperty(ImageComponent, "componentName", {
|
|
2456
|
+
enumerable: true,
|
|
2457
|
+
configurable: true,
|
|
2458
|
+
writable: true,
|
|
2459
|
+
value: 'ImageComponent'
|
|
2460
|
+
});
|
|
2250
2461
|
function ImageView(props) {
|
|
2251
2462
|
const { name, state } = props.component;
|
|
2252
2463
|
const imageRef = createRef();
|
|
@@ -2287,8 +2498,18 @@ class VideoComponent extends Component {
|
|
|
2287
2498
|
return [];
|
|
2288
2499
|
}
|
|
2289
2500
|
}
|
|
2290
|
-
VideoComponent
|
|
2291
|
-
|
|
2501
|
+
Object.defineProperty(VideoComponent, "type", {
|
|
2502
|
+
enumerable: true,
|
|
2503
|
+
configurable: true,
|
|
2504
|
+
writable: true,
|
|
2505
|
+
value: ContentType.InlineComponent
|
|
2506
|
+
});
|
|
2507
|
+
Object.defineProperty(VideoComponent, "componentName", {
|
|
2508
|
+
enumerable: true,
|
|
2509
|
+
configurable: true,
|
|
2510
|
+
writable: true,
|
|
2511
|
+
value: 'VideoComponent'
|
|
2512
|
+
});
|
|
2292
2513
|
function VideoView(props) {
|
|
2293
2514
|
const { name, state } = props.component;
|
|
2294
2515
|
const videoRef = createRef();
|
|
@@ -2323,8 +2544,30 @@ const videoComponentLoader = {
|
|
|
2323
2544
|
|
|
2324
2545
|
let ToolService = class ToolService {
|
|
2325
2546
|
constructor(selection, controller) {
|
|
2326
|
-
this
|
|
2327
|
-
|
|
2547
|
+
Object.defineProperty(this, "selection", {
|
|
2548
|
+
enumerable: true,
|
|
2549
|
+
configurable: true,
|
|
2550
|
+
writable: true,
|
|
2551
|
+
value: selection
|
|
2552
|
+
});
|
|
2553
|
+
Object.defineProperty(this, "controller", {
|
|
2554
|
+
enumerable: true,
|
|
2555
|
+
configurable: true,
|
|
2556
|
+
writable: true,
|
|
2557
|
+
value: controller
|
|
2558
|
+
});
|
|
2559
|
+
Object.defineProperty(this, "state", {
|
|
2560
|
+
enumerable: true,
|
|
2561
|
+
configurable: true,
|
|
2562
|
+
writable: true,
|
|
2563
|
+
value: void 0
|
|
2564
|
+
});
|
|
2565
|
+
Object.defineProperty(this, "sub", {
|
|
2566
|
+
enumerable: true,
|
|
2567
|
+
configurable: true,
|
|
2568
|
+
writable: true,
|
|
2569
|
+
value: void 0
|
|
2570
|
+
});
|
|
2328
2571
|
const [state, updateState] = useProduce({
|
|
2329
2572
|
inSourceCode: false,
|
|
2330
2573
|
readonly: controller.readonly,
|
|
@@ -2471,10 +2714,30 @@ function AttrTool(props) {
|
|
|
2471
2714
|
|
|
2472
2715
|
class Rectangle {
|
|
2473
2716
|
constructor(x1, y1, x2, y2) {
|
|
2474
|
-
this
|
|
2475
|
-
|
|
2476
|
-
|
|
2477
|
-
|
|
2717
|
+
Object.defineProperty(this, "x1", {
|
|
2718
|
+
enumerable: true,
|
|
2719
|
+
configurable: true,
|
|
2720
|
+
writable: true,
|
|
2721
|
+
value: x1
|
|
2722
|
+
});
|
|
2723
|
+
Object.defineProperty(this, "y1", {
|
|
2724
|
+
enumerable: true,
|
|
2725
|
+
configurable: true,
|
|
2726
|
+
writable: true,
|
|
2727
|
+
value: y1
|
|
2728
|
+
});
|
|
2729
|
+
Object.defineProperty(this, "x2", {
|
|
2730
|
+
enumerable: true,
|
|
2731
|
+
configurable: true,
|
|
2732
|
+
writable: true,
|
|
2733
|
+
value: x2
|
|
2734
|
+
});
|
|
2735
|
+
Object.defineProperty(this, "y2", {
|
|
2736
|
+
enumerable: true,
|
|
2737
|
+
configurable: true,
|
|
2738
|
+
writable: true,
|
|
2739
|
+
value: y2
|
|
2740
|
+
});
|
|
2478
2741
|
}
|
|
2479
2742
|
intersects(other) {
|
|
2480
2743
|
return this.x1 < other.x2 && this.x2 > other.x1 && this.y1 < other.y2 && this.y2 > other.y1;
|
|
@@ -2595,12 +2858,42 @@ class TableComponent extends Component {
|
|
|
2595
2858
|
})
|
|
2596
2859
|
}) {
|
|
2597
2860
|
super(textbus, state);
|
|
2598
|
-
this
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2861
|
+
Object.defineProperty(this, "selection", {
|
|
2862
|
+
enumerable: true,
|
|
2863
|
+
configurable: true,
|
|
2864
|
+
writable: true,
|
|
2865
|
+
value: this.textbus.get(Selection)
|
|
2866
|
+
});
|
|
2867
|
+
Object.defineProperty(this, "commander", {
|
|
2868
|
+
enumerable: true,
|
|
2869
|
+
configurable: true,
|
|
2870
|
+
writable: true,
|
|
2871
|
+
value: this.textbus.get(Commander)
|
|
2872
|
+
});
|
|
2873
|
+
Object.defineProperty(this, "focus", {
|
|
2874
|
+
enumerable: true,
|
|
2875
|
+
configurable: true,
|
|
2876
|
+
writable: true,
|
|
2877
|
+
value: new Subject()
|
|
2878
|
+
});
|
|
2879
|
+
Object.defineProperty(this, "tableSelection", {
|
|
2880
|
+
enumerable: true,
|
|
2881
|
+
configurable: true,
|
|
2882
|
+
writable: true,
|
|
2883
|
+
value: createSignal(null)
|
|
2884
|
+
});
|
|
2885
|
+
Object.defineProperty(this, "ignoreSelectionChanges", {
|
|
2886
|
+
enumerable: true,
|
|
2887
|
+
configurable: true,
|
|
2888
|
+
writable: true,
|
|
2889
|
+
value: false
|
|
2890
|
+
});
|
|
2891
|
+
Object.defineProperty(this, "normalizedData", {
|
|
2892
|
+
enumerable: true,
|
|
2893
|
+
configurable: true,
|
|
2894
|
+
writable: true,
|
|
2895
|
+
value: []
|
|
2896
|
+
});
|
|
2604
2897
|
}
|
|
2605
2898
|
getSlots() {
|
|
2606
2899
|
return this.normalizedData.map(item => {
|
|
@@ -3012,8 +3305,18 @@ class TableComponent extends Component {
|
|
|
3012
3305
|
});
|
|
3013
3306
|
}
|
|
3014
3307
|
}
|
|
3015
|
-
TableComponent
|
|
3016
|
-
|
|
3308
|
+
Object.defineProperty(TableComponent, "componentName", {
|
|
3309
|
+
enumerable: true,
|
|
3310
|
+
configurable: true,
|
|
3311
|
+
writable: true,
|
|
3312
|
+
value: 'TableComponent'
|
|
3313
|
+
});
|
|
3314
|
+
Object.defineProperty(TableComponent, "type", {
|
|
3315
|
+
enumerable: true,
|
|
3316
|
+
configurable: true,
|
|
3317
|
+
writable: true,
|
|
3318
|
+
value: ContentType.BlockComponent
|
|
3319
|
+
});
|
|
3017
3320
|
|
|
3018
3321
|
const strikeThroughFormatter = new Formatter('strike', {
|
|
3019
3322
|
columned: true,
|
|
@@ -3122,34 +3425,49 @@ class TodolistComponent extends Component {
|
|
|
3122
3425
|
});
|
|
3123
3426
|
}
|
|
3124
3427
|
}
|
|
3125
|
-
TodolistComponent
|
|
3126
|
-
|
|
3127
|
-
|
|
3128
|
-
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3139
|
-
|
|
3140
|
-
|
|
3141
|
-
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3428
|
+
Object.defineProperty(TodolistComponent, "type", {
|
|
3429
|
+
enumerable: true,
|
|
3430
|
+
configurable: true,
|
|
3431
|
+
writable: true,
|
|
3432
|
+
value: ContentType.BlockComponent
|
|
3433
|
+
});
|
|
3434
|
+
Object.defineProperty(TodolistComponent, "componentName", {
|
|
3435
|
+
enumerable: true,
|
|
3436
|
+
configurable: true,
|
|
3437
|
+
writable: true,
|
|
3438
|
+
value: 'TodoListComponent'
|
|
3439
|
+
});
|
|
3440
|
+
Object.defineProperty(TodolistComponent, "zenCoding", {
|
|
3441
|
+
enumerable: true,
|
|
3442
|
+
configurable: true,
|
|
3443
|
+
writable: true,
|
|
3444
|
+
value: {
|
|
3445
|
+
match(content, textbus) {
|
|
3446
|
+
const selection = textbus.get(Selection);
|
|
3447
|
+
if (selection.commonAncestorComponent instanceof ParagraphComponent) {
|
|
3448
|
+
return /^\[(x|\s)?\]$/.test(content);
|
|
3449
|
+
}
|
|
3450
|
+
return false;
|
|
3451
|
+
},
|
|
3452
|
+
key: ' ',
|
|
3453
|
+
createState(content, textbus) {
|
|
3454
|
+
const selection = textbus.get(Selection);
|
|
3455
|
+
const commonAncestorSlot = selection.commonAncestorSlot;
|
|
3456
|
+
const slot = new Slot([
|
|
3457
|
+
ContentType.InlineComponent,
|
|
3458
|
+
ContentType.Text
|
|
3459
|
+
]);
|
|
3460
|
+
if (commonAncestorSlot === null || commonAncestorSlot === void 0 ? void 0 : commonAncestorSlot.hasAttribute(textIndentAttr)) {
|
|
3461
|
+
slot.setAttribute(textIndentAttr, commonAncestorSlot.getAttribute(textIndentAttr));
|
|
3462
|
+
}
|
|
3463
|
+
const isChecked = content.charAt(1) === 'x';
|
|
3464
|
+
return {
|
|
3465
|
+
checked: isChecked,
|
|
3466
|
+
slot
|
|
3467
|
+
};
|
|
3145
3468
|
}
|
|
3146
|
-
const isChecked = content.charAt(1) === 'x';
|
|
3147
|
-
return {
|
|
3148
|
-
checked: isChecked,
|
|
3149
|
-
slot
|
|
3150
|
-
};
|
|
3151
3469
|
}
|
|
3152
|
-
};
|
|
3470
|
+
});
|
|
3153
3471
|
function TodolistView(props) {
|
|
3154
3472
|
const component = props.component;
|
|
3155
3473
|
const state = component.state;
|
|
@@ -3336,34 +3654,49 @@ class ListComponent extends Component {
|
|
|
3336
3654
|
});
|
|
3337
3655
|
}
|
|
3338
3656
|
}
|
|
3339
|
-
ListComponent
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3657
|
+
Object.defineProperty(ListComponent, "componentName", {
|
|
3658
|
+
enumerable: true,
|
|
3659
|
+
configurable: true,
|
|
3660
|
+
writable: true,
|
|
3661
|
+
value: 'ListComponent'
|
|
3662
|
+
});
|
|
3663
|
+
Object.defineProperty(ListComponent, "type", {
|
|
3664
|
+
enumerable: true,
|
|
3665
|
+
configurable: true,
|
|
3666
|
+
writable: true,
|
|
3667
|
+
value: ContentType.BlockComponent
|
|
3668
|
+
});
|
|
3669
|
+
Object.defineProperty(ListComponent, "zenCoding", {
|
|
3670
|
+
enumerable: true,
|
|
3671
|
+
configurable: true,
|
|
3672
|
+
writable: true,
|
|
3673
|
+
value: {
|
|
3674
|
+
key: ' ',
|
|
3675
|
+
match(content, textbus) {
|
|
3676
|
+
const selection = textbus.get(Selection);
|
|
3677
|
+
if (selection.commonAncestorComponent instanceof ParagraphComponent) {
|
|
3678
|
+
return /^([1-9]\.|[+*-])$/.test(content);
|
|
3679
|
+
}
|
|
3680
|
+
return false;
|
|
3681
|
+
},
|
|
3682
|
+
createState(content, textbus) {
|
|
3683
|
+
const selection = textbus.get(Selection);
|
|
3684
|
+
const commonAncestorSlot = selection.commonAncestorSlot;
|
|
3685
|
+
const slot = new Slot([
|
|
3686
|
+
ContentType.InlineComponent,
|
|
3687
|
+
ContentType.Text
|
|
3688
|
+
]);
|
|
3689
|
+
if (commonAncestorSlot === null || commonAncestorSlot === void 0 ? void 0 : commonAncestorSlot.hasAttribute(textIndentAttr)) {
|
|
3690
|
+
slot.setAttribute(textIndentAttr, commonAncestorSlot.getAttribute(textIndentAttr));
|
|
3691
|
+
}
|
|
3692
|
+
return {
|
|
3693
|
+
type: /[-+*]/.test(content) ? 'UnorderedList' : 'OrderedList',
|
|
3694
|
+
reorder: true,
|
|
3695
|
+
slot
|
|
3696
|
+
};
|
|
3359
3697
|
}
|
|
3360
|
-
return {
|
|
3361
|
-
type: /[-+*]/.test(content) ? 'UnorderedList' : 'OrderedList',
|
|
3362
|
-
reorder: true,
|
|
3363
|
-
slot
|
|
3364
|
-
};
|
|
3365
3698
|
}
|
|
3366
|
-
};
|
|
3699
|
+
});
|
|
3367
3700
|
const step = 26;
|
|
3368
3701
|
const chars = Array.from({ length: step }).map((_, index) => String.fromCharCode(96 + index + 1));
|
|
3369
3702
|
function numberToLetter(num) {
|
|
@@ -4162,11 +4495,17 @@ const isSupportFont = (function () {
|
|
|
4162
4495
|
const data = context.getImageData(0, 0, width, height).data;
|
|
4163
4496
|
return Array.from(data).filter(n => n !== 0);
|
|
4164
4497
|
}
|
|
4498
|
+
const cache = new Map();
|
|
4165
4499
|
return function (fontName) {
|
|
4166
4500
|
if (fontName.toLowerCase() === fullbackFontName.toLowerCase()) {
|
|
4167
4501
|
return true;
|
|
4168
4502
|
}
|
|
4169
|
-
|
|
4503
|
+
if (cache.has(fontName)) {
|
|
4504
|
+
return cache.get(fontName);
|
|
4505
|
+
}
|
|
4506
|
+
const b = checker(fullbackFontName).join('') !== checker(fontName).join('');
|
|
4507
|
+
cache.set(fontName, b);
|
|
4508
|
+
return b;
|
|
4170
4509
|
};
|
|
4171
4510
|
})();
|
|
4172
4511
|
function FontFamilyTool() {
|
|
@@ -4336,7 +4675,18 @@ class KatexEditor extends Textbus {
|
|
|
4336
4675
|
],
|
|
4337
4676
|
imports: [browserModule]
|
|
4338
4677
|
});
|
|
4339
|
-
this
|
|
4678
|
+
Object.defineProperty(this, "host", {
|
|
4679
|
+
enumerable: true,
|
|
4680
|
+
configurable: true,
|
|
4681
|
+
writable: true,
|
|
4682
|
+
value: void 0
|
|
4683
|
+
});
|
|
4684
|
+
Object.defineProperty(this, "onValueChange", {
|
|
4685
|
+
enumerable: true,
|
|
4686
|
+
configurable: true,
|
|
4687
|
+
writable: true,
|
|
4688
|
+
value: new Subject()
|
|
4689
|
+
});
|
|
4340
4690
|
}
|
|
4341
4691
|
mount(host, code) {
|
|
4342
4692
|
this.host = host;
|
|
@@ -4383,8 +4733,18 @@ class KatexComponent extends Component {
|
|
|
4383
4733
|
return [];
|
|
4384
4734
|
}
|
|
4385
4735
|
}
|
|
4386
|
-
KatexComponent
|
|
4387
|
-
|
|
4736
|
+
Object.defineProperty(KatexComponent, "componentName", {
|
|
4737
|
+
enumerable: true,
|
|
4738
|
+
configurable: true,
|
|
4739
|
+
writable: true,
|
|
4740
|
+
value: 'KatexComponent'
|
|
4741
|
+
});
|
|
4742
|
+
Object.defineProperty(KatexComponent, "type", {
|
|
4743
|
+
enumerable: true,
|
|
4744
|
+
configurable: true,
|
|
4745
|
+
writable: true,
|
|
4746
|
+
value: ContentType.InlineComponent
|
|
4747
|
+
});
|
|
4388
4748
|
function domToVDom(el) {
|
|
4389
4749
|
const attrs = {};
|
|
4390
4750
|
el.getAttributeNames().forEach(key => {
|
|
@@ -4673,9 +5033,24 @@ var scopedId$c = "vf-e74208";
|
|
|
4673
5033
|
|
|
4674
5034
|
let EditorService = class EditorService {
|
|
4675
5035
|
constructor() {
|
|
4676
|
-
this
|
|
4677
|
-
|
|
4678
|
-
|
|
5036
|
+
Object.defineProperty(this, "hideInlineToolbar", {
|
|
5037
|
+
enumerable: true,
|
|
5038
|
+
configurable: true,
|
|
5039
|
+
writable: true,
|
|
5040
|
+
value: false
|
|
5041
|
+
});
|
|
5042
|
+
Object.defineProperty(this, "canShowLeftToolbar", {
|
|
5043
|
+
enumerable: true,
|
|
5044
|
+
configurable: true,
|
|
5045
|
+
writable: true,
|
|
5046
|
+
value: true
|
|
5047
|
+
});
|
|
5048
|
+
Object.defineProperty(this, "onLeftToolbarCanVisibleChange", {
|
|
5049
|
+
enumerable: true,
|
|
5050
|
+
configurable: true,
|
|
5051
|
+
writable: true,
|
|
5052
|
+
value: new Subject()
|
|
5053
|
+
});
|
|
4679
5054
|
}
|
|
4680
5055
|
changeLeftToolbarVisible(b) {
|
|
4681
5056
|
this.canShowLeftToolbar = b;
|
|
@@ -5550,7 +5925,12 @@ const LeftToolbar = withAnnotation({
|
|
|
5550
5925
|
|
|
5551
5926
|
class LeftToolbarPlugin {
|
|
5552
5927
|
constructor() {
|
|
5553
|
-
this
|
|
5928
|
+
Object.defineProperty(this, "app", {
|
|
5929
|
+
enumerable: true,
|
|
5930
|
+
configurable: true,
|
|
5931
|
+
writable: true,
|
|
5932
|
+
value: null
|
|
5933
|
+
});
|
|
5554
5934
|
}
|
|
5555
5935
|
setup(injector) {
|
|
5556
5936
|
const App = function () {
|
|
@@ -5826,8 +6206,18 @@ const InlineToolbar = withAnnotation({
|
|
|
5826
6206
|
|
|
5827
6207
|
class InlineToolbarPlugin {
|
|
5828
6208
|
constructor(config = {}) {
|
|
5829
|
-
this
|
|
5830
|
-
|
|
6209
|
+
Object.defineProperty(this, "config", {
|
|
6210
|
+
enumerable: true,
|
|
6211
|
+
configurable: true,
|
|
6212
|
+
writable: true,
|
|
6213
|
+
value: config
|
|
6214
|
+
});
|
|
6215
|
+
Object.defineProperty(this, "app", {
|
|
6216
|
+
enumerable: true,
|
|
6217
|
+
configurable: true,
|
|
6218
|
+
writable: true,
|
|
6219
|
+
value: null
|
|
6220
|
+
});
|
|
5831
6221
|
}
|
|
5832
6222
|
setup(injector) {
|
|
5833
6223
|
const App = () => {
|
|
@@ -5874,9 +6264,24 @@ const StaticToolbar = withAnnotation({
|
|
|
5874
6264
|
|
|
5875
6265
|
class StaticToolbarPlugin {
|
|
5876
6266
|
constructor(options) {
|
|
5877
|
-
this
|
|
5878
|
-
|
|
5879
|
-
|
|
6267
|
+
Object.defineProperty(this, "options", {
|
|
6268
|
+
enumerable: true,
|
|
6269
|
+
configurable: true,
|
|
6270
|
+
writable: true,
|
|
6271
|
+
value: options
|
|
6272
|
+
});
|
|
6273
|
+
Object.defineProperty(this, "app", {
|
|
6274
|
+
enumerable: true,
|
|
6275
|
+
configurable: true,
|
|
6276
|
+
writable: true,
|
|
6277
|
+
value: null
|
|
6278
|
+
});
|
|
6279
|
+
Object.defineProperty(this, "container", {
|
|
6280
|
+
enumerable: true,
|
|
6281
|
+
configurable: true,
|
|
6282
|
+
writable: true,
|
|
6283
|
+
value: null
|
|
6284
|
+
});
|
|
5880
6285
|
}
|
|
5881
6286
|
setup(injector) {
|
|
5882
6287
|
const container = document.createElement('div');
|
|
@@ -5956,9 +6361,24 @@ const SuspensionToolbar = withAnnotation({
|
|
|
5956
6361
|
|
|
5957
6362
|
class SuspensionToolbarPlugin {
|
|
5958
6363
|
constructor(options = {}) {
|
|
5959
|
-
this
|
|
5960
|
-
|
|
5961
|
-
|
|
6364
|
+
Object.defineProperty(this, "options", {
|
|
6365
|
+
enumerable: true,
|
|
6366
|
+
configurable: true,
|
|
6367
|
+
writable: true,
|
|
6368
|
+
value: options
|
|
6369
|
+
});
|
|
6370
|
+
Object.defineProperty(this, "app", {
|
|
6371
|
+
enumerable: true,
|
|
6372
|
+
configurable: true,
|
|
6373
|
+
writable: true,
|
|
6374
|
+
value: null
|
|
6375
|
+
});
|
|
6376
|
+
Object.defineProperty(this, "container", {
|
|
6377
|
+
enumerable: true,
|
|
6378
|
+
configurable: true,
|
|
6379
|
+
writable: true,
|
|
6380
|
+
value: null
|
|
6381
|
+
});
|
|
5962
6382
|
}
|
|
5963
6383
|
setup(injector) {
|
|
5964
6384
|
const host = injector.get(VIEW_CONTAINER);
|
|
@@ -5979,10 +6399,30 @@ class SuspensionToolbarPlugin {
|
|
|
5979
6399
|
|
|
5980
6400
|
class Matcher {
|
|
5981
6401
|
constructor(target, rule) {
|
|
5982
|
-
this
|
|
5983
|
-
|
|
5984
|
-
|
|
5985
|
-
|
|
6402
|
+
Object.defineProperty(this, "target", {
|
|
6403
|
+
enumerable: true,
|
|
6404
|
+
configurable: true,
|
|
6405
|
+
writable: true,
|
|
6406
|
+
value: target
|
|
6407
|
+
});
|
|
6408
|
+
Object.defineProperty(this, "rule", {
|
|
6409
|
+
enumerable: true,
|
|
6410
|
+
configurable: true,
|
|
6411
|
+
writable: true,
|
|
6412
|
+
value: rule
|
|
6413
|
+
});
|
|
6414
|
+
Object.defineProperty(this, "validators", {
|
|
6415
|
+
enumerable: true,
|
|
6416
|
+
configurable: true,
|
|
6417
|
+
writable: true,
|
|
6418
|
+
value: []
|
|
6419
|
+
});
|
|
6420
|
+
Object.defineProperty(this, "excludeValidators", {
|
|
6421
|
+
enumerable: true,
|
|
6422
|
+
configurable: true,
|
|
6423
|
+
writable: true,
|
|
6424
|
+
value: []
|
|
6425
|
+
});
|
|
5986
6426
|
if (rule.tags) {
|
|
5987
6427
|
this.validators.push(this.makeTagsMatcher(rule.tags));
|
|
5988
6428
|
}
|
|
@@ -6123,11 +6563,36 @@ class AtComponent extends Component {
|
|
|
6123
6563
|
state.slot = new Slot([ContentType.Text]);
|
|
6124
6564
|
}
|
|
6125
6565
|
super(textbus, state);
|
|
6126
|
-
this
|
|
6127
|
-
|
|
6128
|
-
|
|
6129
|
-
|
|
6130
|
-
|
|
6566
|
+
Object.defineProperty(this, "focus", {
|
|
6567
|
+
enumerable: true,
|
|
6568
|
+
configurable: true,
|
|
6569
|
+
writable: true,
|
|
6570
|
+
value: new Subject()
|
|
6571
|
+
});
|
|
6572
|
+
Object.defineProperty(this, "members", {
|
|
6573
|
+
enumerable: true,
|
|
6574
|
+
configurable: true,
|
|
6575
|
+
writable: true,
|
|
6576
|
+
value: createSignal([])
|
|
6577
|
+
});
|
|
6578
|
+
Object.defineProperty(this, "selectedIndex", {
|
|
6579
|
+
enumerable: true,
|
|
6580
|
+
configurable: true,
|
|
6581
|
+
writable: true,
|
|
6582
|
+
value: createSignal(0)
|
|
6583
|
+
});
|
|
6584
|
+
Object.defineProperty(this, "selection", {
|
|
6585
|
+
enumerable: true,
|
|
6586
|
+
configurable: true,
|
|
6587
|
+
writable: true,
|
|
6588
|
+
value: this.textbus.get(Selection)
|
|
6589
|
+
});
|
|
6590
|
+
Object.defineProperty(this, "organization", {
|
|
6591
|
+
enumerable: true,
|
|
6592
|
+
configurable: true,
|
|
6593
|
+
writable: true,
|
|
6594
|
+
value: this.textbus.get(Organization)
|
|
6595
|
+
});
|
|
6131
6596
|
}
|
|
6132
6597
|
getSlots() {
|
|
6133
6598
|
if (this.state.userInfo) {
|
|
@@ -6225,8 +6690,18 @@ class AtComponent extends Component {
|
|
|
6225
6690
|
this.selection.selectComponentEnd(this);
|
|
6226
6691
|
}
|
|
6227
6692
|
}
|
|
6228
|
-
AtComponent
|
|
6229
|
-
|
|
6693
|
+
Object.defineProperty(AtComponent, "componentName", {
|
|
6694
|
+
enumerable: true,
|
|
6695
|
+
configurable: true,
|
|
6696
|
+
writable: true,
|
|
6697
|
+
value: 'AtComponent'
|
|
6698
|
+
});
|
|
6699
|
+
Object.defineProperty(AtComponent, "type", {
|
|
6700
|
+
enumerable: true,
|
|
6701
|
+
configurable: true,
|
|
6702
|
+
writable: true,
|
|
6703
|
+
value: ContentType.InlineComponent
|
|
6704
|
+
});
|
|
6230
6705
|
|
|
6231
6706
|
function AtComponentView(props) {
|
|
6232
6707
|
const dropdownRef = createRef();
|
|
@@ -6307,7 +6782,12 @@ const atComponentLoader = {
|
|
|
6307
6782
|
class RootComponent extends Component {
|
|
6308
6783
|
constructor() {
|
|
6309
6784
|
super(...arguments);
|
|
6310
|
-
this
|
|
6785
|
+
Object.defineProperty(this, "onCompositionStart", {
|
|
6786
|
+
enumerable: true,
|
|
6787
|
+
configurable: true,
|
|
6788
|
+
writable: true,
|
|
6789
|
+
value: new Subject()
|
|
6790
|
+
});
|
|
6311
6791
|
}
|
|
6312
6792
|
static fromJSON(textbus, json) {
|
|
6313
6793
|
const content = textbus.get(Registry).createSlot(json.content);
|
|
@@ -6345,8 +6825,18 @@ class RootComponent extends Component {
|
|
|
6345
6825
|
selection.setPosition(newParagraph.state.slot, 0);
|
|
6346
6826
|
}
|
|
6347
6827
|
}
|
|
6348
|
-
RootComponent
|
|
6349
|
-
|
|
6828
|
+
Object.defineProperty(RootComponent, "componentName", {
|
|
6829
|
+
enumerable: true,
|
|
6830
|
+
configurable: true,
|
|
6831
|
+
writable: true,
|
|
6832
|
+
value: 'RootComponent'
|
|
6833
|
+
});
|
|
6834
|
+
Object.defineProperty(RootComponent, "type", {
|
|
6835
|
+
enumerable: true,
|
|
6836
|
+
configurable: true,
|
|
6837
|
+
writable: true,
|
|
6838
|
+
value: ContentType.BlockComponent
|
|
6839
|
+
});
|
|
6350
6840
|
function RootView(props) {
|
|
6351
6841
|
const ref = createDynamicRef(node => {
|
|
6352
6842
|
const sub = props.component.onCompositionStart.subscribe(() => {
|
|
@@ -6399,11 +6889,26 @@ var scopedId$5 = "vf-681de2";
|
|
|
6399
6889
|
|
|
6400
6890
|
let TableService = class TableService {
|
|
6401
6891
|
constructor() {
|
|
6402
|
-
this
|
|
6403
|
-
|
|
6892
|
+
Object.defineProperty(this, "onInsertRowBefore", {
|
|
6893
|
+
enumerable: true,
|
|
6894
|
+
configurable: true,
|
|
6895
|
+
writable: true,
|
|
6896
|
+
value: new Subject()
|
|
6897
|
+
});
|
|
6898
|
+
Object.defineProperty(this, "onInsertColumnBefore", {
|
|
6899
|
+
enumerable: true,
|
|
6900
|
+
configurable: true,
|
|
6901
|
+
writable: true,
|
|
6902
|
+
value: new Subject()
|
|
6903
|
+
});
|
|
6404
6904
|
// onSelectColumns = new Subject<{ start: number, end: number } | null>()
|
|
6405
6905
|
// onSelectRows = new Subject<{ start: number, end: number } | null>()
|
|
6406
|
-
this
|
|
6906
|
+
Object.defineProperty(this, "onScroll", {
|
|
6907
|
+
enumerable: true,
|
|
6908
|
+
configurable: true,
|
|
6909
|
+
writable: true,
|
|
6910
|
+
value: new Subject()
|
|
6911
|
+
});
|
|
6407
6912
|
}
|
|
6408
6913
|
};
|
|
6409
6914
|
TableService = __decorate([
|
|
@@ -7076,6 +7581,9 @@ const tableComponentLoader = {
|
|
|
7076
7581
|
let content = element;
|
|
7077
7582
|
if (element.tagName === 'DIV') {
|
|
7078
7583
|
content = element.querySelector('.xnote-table-content');
|
|
7584
|
+
if (!content) {
|
|
7585
|
+
return;
|
|
7586
|
+
}
|
|
7079
7587
|
}
|
|
7080
7588
|
const { tHead, tBodies, tFoot } = content;
|
|
7081
7589
|
const headers = [];
|
|
@@ -7183,8 +7691,18 @@ function findFocusCell(table, slot) {
|
|
|
7183
7691
|
let TableSelectionAwarenessDelegate = class TableSelectionAwarenessDelegate extends CollaborateSelectionAwarenessDelegate {
|
|
7184
7692
|
constructor(domAdapter, selection) {
|
|
7185
7693
|
super();
|
|
7186
|
-
this
|
|
7187
|
-
|
|
7694
|
+
Object.defineProperty(this, "domAdapter", {
|
|
7695
|
+
enumerable: true,
|
|
7696
|
+
configurable: true,
|
|
7697
|
+
writable: true,
|
|
7698
|
+
value: domAdapter
|
|
7699
|
+
});
|
|
7700
|
+
Object.defineProperty(this, "selection", {
|
|
7701
|
+
enumerable: true,
|
|
7702
|
+
configurable: true,
|
|
7703
|
+
writable: true,
|
|
7704
|
+
value: selection
|
|
7705
|
+
});
|
|
7188
7706
|
}
|
|
7189
7707
|
getRects(abstractSelection, _, data) {
|
|
7190
7708
|
const { focusSlot, anchorSlot } = abstractSelection;
|
|
@@ -7343,10 +7861,36 @@ const stepComponentLoader = {
|
|
|
7343
7861
|
class XNoteMessageBus extends MessageBus {
|
|
7344
7862
|
constructor(selection, collaborateCursor, userinfo) {
|
|
7345
7863
|
super();
|
|
7346
|
-
this
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7864
|
+
Object.defineProperty(this, "selection", {
|
|
7865
|
+
enumerable: true,
|
|
7866
|
+
configurable: true,
|
|
7867
|
+
writable: true,
|
|
7868
|
+
value: selection
|
|
7869
|
+
});
|
|
7870
|
+
Object.defineProperty(this, "collaborateCursor", {
|
|
7871
|
+
enumerable: true,
|
|
7872
|
+
configurable: true,
|
|
7873
|
+
writable: true,
|
|
7874
|
+
value: collaborateCursor
|
|
7875
|
+
});
|
|
7876
|
+
Object.defineProperty(this, "userinfo", {
|
|
7877
|
+
enumerable: true,
|
|
7878
|
+
configurable: true,
|
|
7879
|
+
writable: true,
|
|
7880
|
+
value: userinfo
|
|
7881
|
+
});
|
|
7882
|
+
Object.defineProperty(this, "onMessageChange", {
|
|
7883
|
+
enumerable: true,
|
|
7884
|
+
configurable: true,
|
|
7885
|
+
writable: true,
|
|
7886
|
+
value: void 0
|
|
7887
|
+
});
|
|
7888
|
+
Object.defineProperty(this, "messageChangeEvent", {
|
|
7889
|
+
enumerable: true,
|
|
7890
|
+
configurable: true,
|
|
7891
|
+
writable: true,
|
|
7892
|
+
value: new Subject()
|
|
7893
|
+
});
|
|
7350
7894
|
this.onMessageChange = this.messageChangeEvent.asObservable();
|
|
7351
7895
|
}
|
|
7352
7896
|
get() {
|
|
@@ -7547,8 +8091,30 @@ class Editor extends Textbus {
|
|
|
7547
8091
|
registerListShortcut(textbus);
|
|
7548
8092
|
registerBlockquoteShortcut(textbus);
|
|
7549
8093
|
} }, editorConfig));
|
|
7550
|
-
this
|
|
7551
|
-
|
|
8094
|
+
Object.defineProperty(this, "editorConfig", {
|
|
8095
|
+
enumerable: true,
|
|
8096
|
+
configurable: true,
|
|
8097
|
+
writable: true,
|
|
8098
|
+
value: editorConfig
|
|
8099
|
+
});
|
|
8100
|
+
Object.defineProperty(this, "translator", {
|
|
8101
|
+
enumerable: true,
|
|
8102
|
+
configurable: true,
|
|
8103
|
+
writable: true,
|
|
8104
|
+
value: new OutputTranslator()
|
|
8105
|
+
});
|
|
8106
|
+
Object.defineProperty(this, "host", {
|
|
8107
|
+
enumerable: true,
|
|
8108
|
+
configurable: true,
|
|
8109
|
+
writable: true,
|
|
8110
|
+
value: void 0
|
|
8111
|
+
});
|
|
8112
|
+
Object.defineProperty(this, "vDomAdapter", {
|
|
8113
|
+
enumerable: true,
|
|
8114
|
+
configurable: true,
|
|
8115
|
+
writable: true,
|
|
8116
|
+
value: void 0
|
|
8117
|
+
});
|
|
7552
8118
|
this.vDomAdapter = vDomAdapter;
|
|
7553
8119
|
}
|
|
7554
8120
|
mount(host) {
|