@textbus/xnote 0.0.1-alpha.42 → 0.0.1-alpha.44
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 +14 -2
- package/bundles/index.js +13 -1
- package/package.json +5 -5
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
3
|
import { Injectable, InjectFlags, Injector, inject, createSignal, onUnmounted, createRef, withAnnotation, onUpdated, onMounted, InjectionToken, getCurrentInstance, ReflectiveInjector, createDynamicRef, jsx as jsx$1, viewfly, watch } from '@viewfly/core';
|
|
4
|
-
import { Subject, Selection, fromEvent, Subscription, Attribute, Keyboard, Commander, Controller, useContext, onBreak, onContentInsert, ContentType, createVNode, Slot, Component, Registry, Query, QueryStateType, BehaviorSubject, onPaste, onFocus, onBlur, useDynamicShortcut, VTextNode, onFocusIn, onFocusOut, onDestroy, onGetRanges, Formatter, onParentSlotUpdated, Textbus, RootComponentRef, filter, map, distinctUntilChanged, sampleTime, merge, debounceTime, throttleTime, delay, onContentInserted, onContentDeleted, switchMap, fromPromise, onCompositionStart } from '@textbus/core';
|
|
4
|
+
import { Subject, Selection, fromEvent, Subscription, Attribute, Keyboard, Commander, Controller, useContext, onBreak, onContentInsert, ContentType, createVNode, Slot, Component, Registry, Query, QueryStateType, BehaviorSubject, onSlotApplyFormat, onSlotSetAttribute, onPaste, onFocus, onBlur, useDynamicShortcut, VTextNode, onFocusIn, onFocusOut, onDestroy, onGetRanges, Formatter, onParentSlotUpdated, Textbus, RootComponentRef, filter, map, distinctUntilChanged, sampleTime, merge, debounceTime, throttleTime, delay, onContentInserted, onContentDeleted, switchMap, fromPromise, onCompositionStart } from '@textbus/core';
|
|
5
5
|
import { VIEW_CONTAINER, isMac, DomAdapter, Input, SelectionBridge, BrowserModule, VIEW_DOCUMENT, CollaborateSelectionAwarenessDelegate, isMobileBrowser, Parser } from '@textbus/platform-browser';
|
|
6
6
|
import { createPortal, createApp, DomRenderer, HTMLRenderer, OutputTranslator } from '@viewfly/platform-browser';
|
|
7
7
|
import { useProduce } from '@viewfly/hooks';
|
|
@@ -1226,6 +1226,12 @@ class SourceCodeComponent extends Component {
|
|
|
1226
1226
|
});
|
|
1227
1227
|
ev.preventDefault();
|
|
1228
1228
|
});
|
|
1229
|
+
onSlotApplyFormat(ev => {
|
|
1230
|
+
ev.preventDefault();
|
|
1231
|
+
});
|
|
1232
|
+
onSlotSetAttribute(ev => {
|
|
1233
|
+
ev.preventDefault();
|
|
1234
|
+
});
|
|
1229
1235
|
onPaste(ev => {
|
|
1230
1236
|
const codeList = [];
|
|
1231
1237
|
const sourceCode = ev.data.text;
|
|
@@ -4709,6 +4715,12 @@ class RootComponent extends Component {
|
|
|
4709
4715
|
onCompositionStart(ev => {
|
|
4710
4716
|
this.onCompositionStart.next(ev);
|
|
4711
4717
|
});
|
|
4718
|
+
onSlotSetAttribute(ev => {
|
|
4719
|
+
ev.preventDefault();
|
|
4720
|
+
});
|
|
4721
|
+
onSlotApplyFormat(ev => {
|
|
4722
|
+
ev.preventDefault();
|
|
4723
|
+
});
|
|
4712
4724
|
}
|
|
4713
4725
|
afterCheck() {
|
|
4714
4726
|
const content = this.state.content;
|
|
@@ -4741,7 +4753,7 @@ function RootView(props) {
|
|
|
4741
4753
|
const output = useOutput();
|
|
4742
4754
|
return () => {
|
|
4743
4755
|
const { rootRef } = props;
|
|
4744
|
-
return (jsx("div", { class: "xnote-root", dir:
|
|
4756
|
+
return (jsx("div", { class: "xnote-root", dir: "auto", ref: [rootRef, ref], "data-component": props.component.name, children: jsx(SlotRender, { slot: content, tag: "div", class: "xnote-content", "data-placeholder": content.isEmpty ? '请输入内容' : '', renderEnv: readonly() || output() }) }));
|
|
4745
4757
|
};
|
|
4746
4758
|
}
|
|
4747
4759
|
const rootComponentLoader = {
|
package/bundles/index.js
CHANGED
|
@@ -1228,6 +1228,12 @@ class SourceCodeComponent extends core$1.Component {
|
|
|
1228
1228
|
});
|
|
1229
1229
|
ev.preventDefault();
|
|
1230
1230
|
});
|
|
1231
|
+
core$1.onSlotApplyFormat(ev => {
|
|
1232
|
+
ev.preventDefault();
|
|
1233
|
+
});
|
|
1234
|
+
core$1.onSlotSetAttribute(ev => {
|
|
1235
|
+
ev.preventDefault();
|
|
1236
|
+
});
|
|
1231
1237
|
core$1.onPaste(ev => {
|
|
1232
1238
|
const codeList = [];
|
|
1233
1239
|
const sourceCode = ev.data.text;
|
|
@@ -4711,6 +4717,12 @@ class RootComponent extends core$1.Component {
|
|
|
4711
4717
|
core$1.onCompositionStart(ev => {
|
|
4712
4718
|
this.onCompositionStart.next(ev);
|
|
4713
4719
|
});
|
|
4720
|
+
core$1.onSlotSetAttribute(ev => {
|
|
4721
|
+
ev.preventDefault();
|
|
4722
|
+
});
|
|
4723
|
+
core$1.onSlotApplyFormat(ev => {
|
|
4724
|
+
ev.preventDefault();
|
|
4725
|
+
});
|
|
4714
4726
|
}
|
|
4715
4727
|
afterCheck() {
|
|
4716
4728
|
const content = this.state.content;
|
|
@@ -4743,7 +4755,7 @@ function RootView(props) {
|
|
|
4743
4755
|
const output = useOutput();
|
|
4744
4756
|
return () => {
|
|
4745
4757
|
const { rootRef } = props;
|
|
4746
|
-
return (jsxRuntime.jsx("div", { class: "xnote-root", dir:
|
|
4758
|
+
return (jsxRuntime.jsx("div", { class: "xnote-root", dir: "auto", ref: [rootRef, ref], "data-component": props.component.name, children: jsxRuntime.jsx(SlotRender, { slot: content, tag: "div", class: "xnote-content", "data-placeholder": content.isEmpty ? '请输入内容' : '', renderEnv: readonly() || output() }) }));
|
|
4747
4759
|
};
|
|
4748
4760
|
}
|
|
4749
4761
|
const rootComponentLoader = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@textbus/xnote",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.44",
|
|
4
4
|
"description": "A high-performance rich text editor that supports multiplayer online collaboration.",
|
|
5
5
|
"main": "./bundles/index.js",
|
|
6
6
|
"module": "./bundles/index.esm.js",
|
|
@@ -27,10 +27,10 @@
|
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"@tanbo/color": "^0.1.1",
|
|
30
|
-
"@textbus/adapter-viewfly": "^4.0.0-alpha.
|
|
31
|
-
"@textbus/collaborate": "^4.0.0-alpha.
|
|
32
|
-
"@textbus/core": "^4.0.0-alpha.
|
|
33
|
-
"@textbus/platform-browser": "^4.0.0-alpha.
|
|
30
|
+
"@textbus/adapter-viewfly": "^4.0.0-alpha.69",
|
|
31
|
+
"@textbus/collaborate": "^4.0.0-alpha.69",
|
|
32
|
+
"@textbus/core": "^4.0.0-alpha.69",
|
|
33
|
+
"@textbus/platform-browser": "^4.0.0-alpha.69",
|
|
34
34
|
"@viewfly/core": "^1.0.0-alpha.17",
|
|
35
35
|
"@viewfly/hooks": "^1.0.0-alpha.17",
|
|
36
36
|
"@viewfly/platform-browser": "^1.0.0-alpha.17",
|