@textbus/xnote 0.1.1 → 0.1.2
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
CHANGED
|
@@ -731,8 +731,11 @@ const DropdownMenuPortal = withAnnotation({
|
|
|
731
731
|
dropdownContextService.canHide = true;
|
|
732
732
|
dropdownContextService.hide();
|
|
733
733
|
}
|
|
734
|
+
function stopPropagation(ev) {
|
|
735
|
+
ev.stopPropagation();
|
|
736
|
+
}
|
|
734
737
|
return createPortal(withScopedCSS(scopedId$i, () => {
|
|
735
|
-
return (jsx("div", { onMouseenter: onEnter, onMouseleave: onLeave, ref: menuRef, style: {
|
|
738
|
+
return (jsx("div", { onMouseenter: onEnter, onMousedown: stopPropagation, onMouseleave: onLeave, ref: menuRef, style: {
|
|
736
739
|
width: props.width
|
|
737
740
|
}, class: "dropdown-menu", children: jsx("div", { class: "dropdown-menu-content", style: {
|
|
738
741
|
padding: props.padding
|
|
@@ -1399,6 +1402,14 @@ class TimelineComponent extends Component {
|
|
|
1399
1402
|
getSlots() {
|
|
1400
1403
|
return this.state.items.map(i => i.slot);
|
|
1401
1404
|
}
|
|
1405
|
+
removeSlot(slot) {
|
|
1406
|
+
const index = this.state.items.findIndex(i => i.slot === slot);
|
|
1407
|
+
if (index >= 0) {
|
|
1408
|
+
this.state.items.splice(index, 1);
|
|
1409
|
+
return true;
|
|
1410
|
+
}
|
|
1411
|
+
return false;
|
|
1412
|
+
}
|
|
1402
1413
|
}
|
|
1403
1414
|
TimelineComponent.componentName = 'TimelineComponent';
|
|
1404
1415
|
TimelineComponent.type = ContentType.BlockComponent;
|
|
@@ -1433,6 +1444,17 @@ class StepComponent extends Component {
|
|
|
1433
1444
|
getSlots() {
|
|
1434
1445
|
return this.state.items.map(i => i.slot);
|
|
1435
1446
|
}
|
|
1447
|
+
removeSlot(slot) {
|
|
1448
|
+
const index = this.state.items.findIndex(i => i.slot === slot);
|
|
1449
|
+
if (index >= 0) {
|
|
1450
|
+
if (index === this.state.step) {
|
|
1451
|
+
this.state.step--;
|
|
1452
|
+
}
|
|
1453
|
+
this.state.items.splice(index, 1);
|
|
1454
|
+
return true;
|
|
1455
|
+
}
|
|
1456
|
+
return false;
|
|
1457
|
+
}
|
|
1436
1458
|
}
|
|
1437
1459
|
StepComponent.componentName = 'StepComponent';
|
|
1438
1460
|
StepComponent.type = ContentType.BlockComponent;
|
package/bundles/index.js
CHANGED
|
@@ -733,8 +733,11 @@ const DropdownMenuPortal = core.withAnnotation({
|
|
|
733
733
|
dropdownContextService.canHide = true;
|
|
734
734
|
dropdownContextService.hide();
|
|
735
735
|
}
|
|
736
|
+
function stopPropagation(ev) {
|
|
737
|
+
ev.stopPropagation();
|
|
738
|
+
}
|
|
736
739
|
return platformBrowser$1.createPortal(scopedCss.withScopedCSS(scopedId$i, () => {
|
|
737
|
-
return (jsxRuntime.jsx("div", { onMouseenter: onEnter, onMouseleave: onLeave, ref: menuRef, style: {
|
|
740
|
+
return (jsxRuntime.jsx("div", { onMouseenter: onEnter, onMousedown: stopPropagation, onMouseleave: onLeave, ref: menuRef, style: {
|
|
738
741
|
width: props.width
|
|
739
742
|
}, class: "dropdown-menu", children: jsxRuntime.jsx("div", { class: "dropdown-menu-content", style: {
|
|
740
743
|
padding: props.padding
|
|
@@ -1401,6 +1404,14 @@ class TimelineComponent extends core$1.Component {
|
|
|
1401
1404
|
getSlots() {
|
|
1402
1405
|
return this.state.items.map(i => i.slot);
|
|
1403
1406
|
}
|
|
1407
|
+
removeSlot(slot) {
|
|
1408
|
+
const index = this.state.items.findIndex(i => i.slot === slot);
|
|
1409
|
+
if (index >= 0) {
|
|
1410
|
+
this.state.items.splice(index, 1);
|
|
1411
|
+
return true;
|
|
1412
|
+
}
|
|
1413
|
+
return false;
|
|
1414
|
+
}
|
|
1404
1415
|
}
|
|
1405
1416
|
TimelineComponent.componentName = 'TimelineComponent';
|
|
1406
1417
|
TimelineComponent.type = core$1.ContentType.BlockComponent;
|
|
@@ -1435,6 +1446,17 @@ class StepComponent extends core$1.Component {
|
|
|
1435
1446
|
getSlots() {
|
|
1436
1447
|
return this.state.items.map(i => i.slot);
|
|
1437
1448
|
}
|
|
1449
|
+
removeSlot(slot) {
|
|
1450
|
+
const index = this.state.items.findIndex(i => i.slot === slot);
|
|
1451
|
+
if (index >= 0) {
|
|
1452
|
+
if (index === this.state.step) {
|
|
1453
|
+
this.state.step--;
|
|
1454
|
+
}
|
|
1455
|
+
this.state.items.splice(index, 1);
|
|
1456
|
+
return true;
|
|
1457
|
+
}
|
|
1458
|
+
return false;
|
|
1459
|
+
}
|
|
1438
1460
|
}
|
|
1439
1461
|
StepComponent.componentName = 'StepComponent';
|
|
1440
1462
|
StepComponent.type = core$1.ContentType.BlockComponent;
|
|
@@ -12,4 +12,5 @@ export declare class StepComponent extends Component<StepComponentState> {
|
|
|
12
12
|
static type: ContentType;
|
|
13
13
|
static fromJSON(textbus: Textbus, json: ComponentStateLiteral<StepComponentState>): StepComponent;
|
|
14
14
|
getSlots(): Slot[];
|
|
15
|
+
removeSlot(slot: Slot): boolean;
|
|
15
16
|
}
|
|
@@ -12,4 +12,5 @@ export declare class TimelineComponent extends Component<TimelineComponentState>
|
|
|
12
12
|
static type: ContentType;
|
|
13
13
|
static fromJSON(textbus: Textbus, json: ComponentStateLiteral<TimelineComponentState>): TimelineComponent;
|
|
14
14
|
getSlots(): Slot[];
|
|
15
|
+
removeSlot(slot: Slot): boolean;
|
|
15
16
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@textbus/xnote",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
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.2.
|
|
31
|
-
"@textbus/collaborate": "^4.2.
|
|
32
|
-
"@textbus/core": "^4.2.
|
|
33
|
-
"@textbus/platform-browser": "^4.2.
|
|
30
|
+
"@textbus/adapter-viewfly": "^4.2.2",
|
|
31
|
+
"@textbus/collaborate": "^4.2.1",
|
|
32
|
+
"@textbus/core": "^4.2.1",
|
|
33
|
+
"@textbus/platform-browser": "^4.2.2",
|
|
34
34
|
"@viewfly/core": "^1.0.5",
|
|
35
35
|
"@viewfly/hooks": "^1.0.5",
|
|
36
36
|
"@viewfly/platform-browser": "^1.0.6",
|