@portabletext/editor 1.24.0 → 1.25.0
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/lib/_chunks-cjs/behavior.core.cjs +186 -62
- package/lib/_chunks-cjs/behavior.core.cjs.map +1 -1
- package/lib/_chunks-cjs/{selector.is-selection-collapsed.cjs → selector.is-active-style.cjs} +158 -3
- package/lib/_chunks-cjs/selector.is-active-style.cjs.map +1 -0
- package/lib/_chunks-es/behavior.core.js +162 -38
- package/lib/_chunks-es/behavior.core.js.map +1 -1
- package/lib/_chunks-es/{selector.is-selection-collapsed.js → selector.is-active-style.js} +159 -4
- package/lib/_chunks-es/selector.is-active-style.js.map +1 -0
- package/lib/behaviors/index.cjs +27 -27
- package/lib/behaviors/index.cjs.map +1 -1
- package/lib/behaviors/index.d.cts +1718 -94
- package/lib/behaviors/index.d.ts +1718 -94
- package/lib/behaviors/index.js +1 -1
- package/lib/index.cjs +178 -211
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +8792 -245
- package/lib/index.d.ts +8792 -245
- package/lib/index.js +174 -207
- package/lib/index.js.map +1 -1
- package/lib/selectors/index.cjs +24 -171
- package/lib/selectors/index.cjs.map +1 -1
- package/lib/selectors/index.js +3 -151
- package/lib/selectors/index.js.map +1 -1
- package/package.json +6 -6
- package/src/behavior-actions/behavior.actions.ts +99 -98
- package/src/behaviors/behavior.core.annotations.ts +29 -0
- package/src/behaviors/behavior.core.block-objects.ts +13 -13
- package/src/behaviors/behavior.core.decorators.ts +19 -0
- package/src/behaviors/behavior.core.lists.ts +57 -23
- package/src/behaviors/behavior.core.style.ts +19 -0
- package/src/behaviors/behavior.core.ts +12 -0
- package/src/behaviors/behavior.types.ts +87 -87
- package/src/editor/create-editor.ts +46 -6
- package/src/editor/editor-machine.ts +38 -1
- package/src/editor/plugins/create-with-event-listeners.ts +38 -106
- package/lib/_chunks-cjs/selector.is-selection-collapsed.cjs.map +0 -1
- package/lib/_chunks-es/selector.is-selection-collapsed.js.map +0 -1
package/lib/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
3
|
-
var schema = require("@sanity/schema"), types = require("@sanity/types"), startCase = require("lodash.startcase"), jsxRuntime = require("react/jsx-runtime"), react = require("@xstate/react"), isEqual = require("lodash/isEqual.js"), noop = require("lodash/noop.js"), React = require("react"), slate = require("slate"), slateReact = require("slate-react"), debug$j = require("debug"), reactCompilerRuntime = require("react-compiler-runtime"), uniq = require("lodash/uniq.js"), rxjs = require("rxjs"), useEffectEvent = require("use-effect-event"), xstate = require("xstate"), patches = require("@portabletext/patches"), flatten = require("lodash/flatten.js"), isPlainObject = require("lodash/isPlainObject.js"), util_sliceBlocks = require("./_chunks-cjs/util.slice-blocks.cjs"), blockTools = require("@portabletext/block-tools"), toHtml = require("@portabletext/to-html"), get = require("lodash/get.js"), isUndefined = require("lodash/isUndefined.js"), omitBy = require("lodash/omitBy.js"),
|
|
3
|
+
var schema = require("@sanity/schema"), types = require("@sanity/types"), startCase = require("lodash.startcase"), jsxRuntime = require("react/jsx-runtime"), react = require("@xstate/react"), isEqual = require("lodash/isEqual.js"), noop = require("lodash/noop.js"), React = require("react"), slate = require("slate"), slateReact = require("slate-react"), debug$j = require("debug"), reactCompilerRuntime = require("react-compiler-runtime"), uniq = require("lodash/uniq.js"), rxjs = require("rxjs"), useEffectEvent = require("use-effect-event"), xstate = require("xstate"), patches = require("@portabletext/patches"), flatten = require("lodash/flatten.js"), isPlainObject = require("lodash/isPlainObject.js"), util_sliceBlocks = require("./_chunks-cjs/util.slice-blocks.cjs"), blockTools = require("@portabletext/block-tools"), toHtml = require("@portabletext/to-html"), get = require("lodash/get.js"), isUndefined = require("lodash/isUndefined.js"), omitBy = require("lodash/omitBy.js"), selector_isActiveStyle = require("./_chunks-cjs/selector.is-active-style.cjs"), util_isEmptyTextBlock = require("./_chunks-cjs/util.is-empty-text-block.cjs"), behavior_core = require("./_chunks-cjs/behavior.core.cjs"), getRandomValues = require("get-random-values-esm");
|
|
4
4
|
function _interopDefaultCompat(e) {
|
|
5
5
|
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
6
6
|
}
|
|
@@ -2981,123 +2981,54 @@ function createWithEventListeners(editorActor, subscriptions) {
|
|
|
2981
2981
|
subscriptions.push(() => {
|
|
2982
2982
|
const subscription = editorActor.on("*", (event) => {
|
|
2983
2983
|
switch (event.type) {
|
|
2984
|
-
case "
|
|
2985
|
-
editorActor.send({
|
|
2986
|
-
type: "behavior event",
|
|
2987
|
-
behaviorEvent: {
|
|
2988
|
-
type: "annotation.add",
|
|
2989
|
-
annotation: event.annotation
|
|
2990
|
-
},
|
|
2991
|
-
editor
|
|
2992
|
-
});
|
|
2993
|
-
break;
|
|
2994
|
-
}
|
|
2995
|
-
case "annotation.remove": {
|
|
2996
|
-
editorActor.send({
|
|
2997
|
-
type: "behavior event",
|
|
2998
|
-
behaviorEvent: {
|
|
2999
|
-
type: "annotation.remove",
|
|
3000
|
-
annotation: event.annotation
|
|
3001
|
-
},
|
|
3002
|
-
editor
|
|
3003
|
-
});
|
|
3004
|
-
break;
|
|
3005
|
-
}
|
|
3006
|
-
case "blur": {
|
|
3007
|
-
editorActor.send({
|
|
3008
|
-
type: "behavior event",
|
|
3009
|
-
behaviorEvent: {
|
|
3010
|
-
type: "blur"
|
|
3011
|
-
},
|
|
3012
|
-
editor
|
|
3013
|
-
});
|
|
3014
|
-
break;
|
|
3015
|
-
}
|
|
3016
|
-
case "custom.*": {
|
|
2984
|
+
case "custom.*":
|
|
3017
2985
|
editorActor.send({
|
|
3018
2986
|
type: "custom behavior event",
|
|
3019
2987
|
behaviorEvent: event.event,
|
|
3020
2988
|
editor
|
|
3021
2989
|
});
|
|
3022
2990
|
break;
|
|
3023
|
-
|
|
3024
|
-
case "
|
|
3025
|
-
|
|
3026
|
-
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
|
|
3035
|
-
case "
|
|
3036
|
-
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3040
|
-
|
|
3041
|
-
|
|
3042
|
-
|
|
3043
|
-
|
|
3044
|
-
|
|
3045
|
-
case "
|
|
3046
|
-
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
case "
|
|
3058
|
-
editorActor.send({
|
|
3059
|
-
type: "behavior event",
|
|
3060
|
-
behaviorEvent: {
|
|
3061
|
-
type: "insert.inline object",
|
|
3062
|
-
inlineObject: event.inlineObject
|
|
3063
|
-
},
|
|
3064
|
-
editor
|
|
3065
|
-
});
|
|
3066
|
-
break;
|
|
3067
|
-
}
|
|
3068
|
-
case "list item.toggle": {
|
|
2991
|
+
case "annotation.add":
|
|
2992
|
+
case "annotation.remove":
|
|
2993
|
+
case "annotation.toggle":
|
|
2994
|
+
case "blur":
|
|
2995
|
+
case "data transfer.set":
|
|
2996
|
+
case "decorator.add":
|
|
2997
|
+
case "decorator.remove":
|
|
2998
|
+
case "decorator.toggle":
|
|
2999
|
+
case "delete.backward":
|
|
3000
|
+
case "delete.block":
|
|
3001
|
+
case "delete.forward":
|
|
3002
|
+
case "delete.text":
|
|
3003
|
+
case "deserialization.failure":
|
|
3004
|
+
case "deserialization.success":
|
|
3005
|
+
case "focus":
|
|
3006
|
+
case "insert.block object":
|
|
3007
|
+
case "insert.inline object":
|
|
3008
|
+
case "insert.span":
|
|
3009
|
+
case "insert.text block":
|
|
3010
|
+
case "list item.add":
|
|
3011
|
+
case "list item.remove":
|
|
3012
|
+
case "list item.toggle":
|
|
3013
|
+
case "move.block":
|
|
3014
|
+
case "move.block down":
|
|
3015
|
+
case "move.block up":
|
|
3016
|
+
case "select":
|
|
3017
|
+
case "select.next block":
|
|
3018
|
+
case "select.previous block":
|
|
3019
|
+
case "serialization.failure":
|
|
3020
|
+
case "serialization.success":
|
|
3021
|
+
case "style.add":
|
|
3022
|
+
case "style.remove":
|
|
3023
|
+
case "style.toggle":
|
|
3024
|
+
case "text block.set":
|
|
3025
|
+
case "text block.unset":
|
|
3069
3026
|
editorActor.send({
|
|
3070
3027
|
type: "behavior event",
|
|
3071
|
-
behaviorEvent:
|
|
3072
|
-
type: "list item.toggle",
|
|
3073
|
-
listItem: event.listItem
|
|
3074
|
-
},
|
|
3028
|
+
behaviorEvent: event,
|
|
3075
3029
|
editor
|
|
3076
3030
|
});
|
|
3077
3031
|
break;
|
|
3078
|
-
}
|
|
3079
|
-
case "select": {
|
|
3080
|
-
editorActor.send({
|
|
3081
|
-
type: "behavior event",
|
|
3082
|
-
behaviorEvent: {
|
|
3083
|
-
type: "select",
|
|
3084
|
-
selection: event.selection
|
|
3085
|
-
},
|
|
3086
|
-
editor
|
|
3087
|
-
});
|
|
3088
|
-
break;
|
|
3089
|
-
}
|
|
3090
|
-
case "style.toggle": {
|
|
3091
|
-
editorActor.send({
|
|
3092
|
-
type: "behavior event",
|
|
3093
|
-
behaviorEvent: {
|
|
3094
|
-
type: "style.toggle",
|
|
3095
|
-
style: event.style
|
|
3096
|
-
},
|
|
3097
|
-
editor
|
|
3098
|
-
});
|
|
3099
|
-
break;
|
|
3100
|
-
}
|
|
3101
3032
|
}
|
|
3102
3033
|
});
|
|
3103
3034
|
return () => {
|
|
@@ -4500,7 +4431,7 @@ const toggleListItemActionImplementation = ({
|
|
|
4500
4431
|
}) => {
|
|
4501
4432
|
if (!action.editor.selection)
|
|
4502
4433
|
return;
|
|
4503
|
-
const guards =
|
|
4434
|
+
const guards = selector_isActiveStyle.createGuards(context), selectedBlocks = [...slate.Editor.nodes(action.editor, {
|
|
4504
4435
|
at: action.editor.selection,
|
|
4505
4436
|
match: (node) => guards.isListBlock(node)
|
|
4506
4437
|
})];
|
|
@@ -4514,7 +4445,7 @@ const toggleListItemActionImplementation = ({
|
|
|
4514
4445
|
}) => {
|
|
4515
4446
|
if (!action.editor.selection)
|
|
4516
4447
|
return;
|
|
4517
|
-
const guards =
|
|
4448
|
+
const guards = selector_isActiveStyle.createGuards(context), selectedBlocks = [...slate.Editor.nodes(action.editor, {
|
|
4518
4449
|
at: action.editor.selection,
|
|
4519
4450
|
match: (node) => guards.isTextBlock(node)
|
|
4520
4451
|
})];
|
|
@@ -4564,7 +4495,7 @@ const toggleStyleActionImplementation = ({
|
|
|
4564
4495
|
}) => {
|
|
4565
4496
|
if (!action.editor.selection)
|
|
4566
4497
|
return;
|
|
4567
|
-
const defaultStyle = context.schema.styles[0].value, guards =
|
|
4498
|
+
const defaultStyle = context.schema.styles[0].value, guards = selector_isActiveStyle.createGuards(context), selectedBlocks = [...slate.Editor.nodes(action.editor, {
|
|
4568
4499
|
at: action.editor.selection,
|
|
4569
4500
|
match: (node) => guards.isTextBlock(node)
|
|
4570
4501
|
})];
|
|
@@ -4580,7 +4511,7 @@ const toggleStyleActionImplementation = ({
|
|
|
4580
4511
|
}) => {
|
|
4581
4512
|
if (!action.editor.selection)
|
|
4582
4513
|
return;
|
|
4583
|
-
const guards =
|
|
4514
|
+
const guards = selector_isActiveStyle.createGuards(context), selectedBlocks = [...slate.Editor.nodes(action.editor, {
|
|
4584
4515
|
at: action.editor.selection,
|
|
4585
4516
|
match: (node) => guards.isTextBlock(node)
|
|
4586
4517
|
})];
|
|
@@ -5639,305 +5570,307 @@ function performAction({
|
|
|
5639
5570
|
action
|
|
5640
5571
|
}) {
|
|
5641
5572
|
switch (action.type) {
|
|
5642
|
-
case "
|
|
5643
|
-
|
|
5573
|
+
case "noop":
|
|
5574
|
+
break;
|
|
5575
|
+
case "effect": {
|
|
5576
|
+
behaviorActionImplementations.effect({
|
|
5644
5577
|
context,
|
|
5645
5578
|
action
|
|
5646
5579
|
});
|
|
5647
5580
|
break;
|
|
5648
5581
|
}
|
|
5649
|
-
case "
|
|
5650
|
-
behaviorActionImplementations
|
|
5582
|
+
case "select": {
|
|
5583
|
+
behaviorActionImplementations.select({
|
|
5651
5584
|
context,
|
|
5652
5585
|
action
|
|
5653
5586
|
});
|
|
5654
5587
|
break;
|
|
5655
5588
|
}
|
|
5656
|
-
|
|
5657
|
-
|
|
5589
|
+
default:
|
|
5590
|
+
performDefaultAction({
|
|
5658
5591
|
context,
|
|
5659
5592
|
action
|
|
5660
5593
|
});
|
|
5661
|
-
|
|
5662
|
-
|
|
5663
|
-
|
|
5664
|
-
|
|
5594
|
+
}
|
|
5595
|
+
}
|
|
5596
|
+
function performDefaultAction({
|
|
5597
|
+
context,
|
|
5598
|
+
action
|
|
5599
|
+
}) {
|
|
5600
|
+
switch (action.type) {
|
|
5601
|
+
case "annotation.add": {
|
|
5602
|
+
behaviorActionImplementations["annotation.add"]({
|
|
5665
5603
|
context,
|
|
5666
5604
|
action
|
|
5667
5605
|
});
|
|
5668
5606
|
break;
|
|
5669
5607
|
}
|
|
5670
|
-
case "
|
|
5671
|
-
behaviorActionImplementations["
|
|
5608
|
+
case "annotation.remove": {
|
|
5609
|
+
behaviorActionImplementations["annotation.remove"]({
|
|
5672
5610
|
context,
|
|
5673
5611
|
action
|
|
5674
5612
|
});
|
|
5675
5613
|
break;
|
|
5676
5614
|
}
|
|
5677
|
-
case "
|
|
5678
|
-
behaviorActionImplementations["
|
|
5615
|
+
case "annotation.toggle": {
|
|
5616
|
+
behaviorActionImplementations["annotation.toggle"]({
|
|
5679
5617
|
context,
|
|
5680
5618
|
action
|
|
5681
5619
|
});
|
|
5682
5620
|
break;
|
|
5683
5621
|
}
|
|
5684
|
-
case "
|
|
5685
|
-
behaviorActionImplementations
|
|
5622
|
+
case "blur": {
|
|
5623
|
+
behaviorActionImplementations.blur({
|
|
5686
5624
|
context,
|
|
5687
5625
|
action
|
|
5688
5626
|
});
|
|
5689
5627
|
break;
|
|
5690
5628
|
}
|
|
5691
|
-
case "
|
|
5692
|
-
behaviorActionImplementations["
|
|
5629
|
+
case "data transfer.set": {
|
|
5630
|
+
behaviorActionImplementations["data transfer.set"]({
|
|
5693
5631
|
context,
|
|
5694
5632
|
action
|
|
5695
5633
|
});
|
|
5696
5634
|
break;
|
|
5697
5635
|
}
|
|
5698
|
-
case "
|
|
5699
|
-
behaviorActionImplementations["
|
|
5636
|
+
case "decorator.add": {
|
|
5637
|
+
behaviorActionImplementations["decorator.add"]({
|
|
5700
5638
|
context,
|
|
5701
5639
|
action
|
|
5702
5640
|
});
|
|
5703
5641
|
break;
|
|
5704
5642
|
}
|
|
5705
|
-
case "
|
|
5706
|
-
behaviorActionImplementations["
|
|
5643
|
+
case "decorator.remove": {
|
|
5644
|
+
behaviorActionImplementations["decorator.remove"]({
|
|
5707
5645
|
context,
|
|
5708
5646
|
action
|
|
5709
5647
|
});
|
|
5710
5648
|
break;
|
|
5711
5649
|
}
|
|
5712
|
-
case "
|
|
5713
|
-
behaviorActionImplementations["
|
|
5650
|
+
case "decorator.toggle": {
|
|
5651
|
+
behaviorActionImplementations["decorator.toggle"]({
|
|
5714
5652
|
context,
|
|
5715
5653
|
action
|
|
5716
5654
|
});
|
|
5717
5655
|
break;
|
|
5718
5656
|
}
|
|
5719
|
-
case "
|
|
5720
|
-
behaviorActionImplementations["
|
|
5657
|
+
case "delete.backward": {
|
|
5658
|
+
behaviorActionImplementations["delete.backward"]({
|
|
5721
5659
|
context,
|
|
5722
5660
|
action
|
|
5723
5661
|
});
|
|
5724
5662
|
break;
|
|
5725
5663
|
}
|
|
5726
|
-
case "
|
|
5727
|
-
|
|
5728
|
-
case "effect": {
|
|
5729
|
-
behaviorActionImplementations.effect({
|
|
5664
|
+
case "delete.block": {
|
|
5665
|
+
behaviorActionImplementations["delete.block"]({
|
|
5730
5666
|
context,
|
|
5731
5667
|
action
|
|
5732
5668
|
});
|
|
5733
5669
|
break;
|
|
5734
5670
|
}
|
|
5735
|
-
case "
|
|
5736
|
-
behaviorActionImplementations.
|
|
5671
|
+
case "delete.forward": {
|
|
5672
|
+
behaviorActionImplementations["delete.forward"]({
|
|
5737
5673
|
context,
|
|
5738
5674
|
action
|
|
5739
5675
|
});
|
|
5740
5676
|
break;
|
|
5741
5677
|
}
|
|
5742
|
-
case "
|
|
5743
|
-
behaviorActionImplementations["
|
|
5678
|
+
case "delete.text": {
|
|
5679
|
+
behaviorActionImplementations["delete.text"]({
|
|
5744
5680
|
context,
|
|
5745
5681
|
action
|
|
5746
5682
|
});
|
|
5747
5683
|
break;
|
|
5748
5684
|
}
|
|
5749
|
-
case "
|
|
5750
|
-
behaviorActionImplementations["
|
|
5685
|
+
case "deserialization.failure": {
|
|
5686
|
+
behaviorActionImplementations["deserialization.failure"]({
|
|
5751
5687
|
context,
|
|
5752
5688
|
action
|
|
5753
5689
|
});
|
|
5754
5690
|
break;
|
|
5755
5691
|
}
|
|
5756
|
-
case "
|
|
5757
|
-
behaviorActionImplementations["
|
|
5692
|
+
case "deserialization.success": {
|
|
5693
|
+
behaviorActionImplementations["deserialization.success"]({
|
|
5758
5694
|
context,
|
|
5759
5695
|
action
|
|
5760
5696
|
});
|
|
5761
5697
|
break;
|
|
5762
5698
|
}
|
|
5763
|
-
case "
|
|
5764
|
-
behaviorActionImplementations
|
|
5699
|
+
case "focus": {
|
|
5700
|
+
behaviorActionImplementations.focus({
|
|
5765
5701
|
context,
|
|
5766
5702
|
action
|
|
5767
5703
|
});
|
|
5768
5704
|
break;
|
|
5769
5705
|
}
|
|
5770
|
-
case "
|
|
5771
|
-
behaviorActionImplementations["
|
|
5706
|
+
case "insert.blocks": {
|
|
5707
|
+
behaviorActionImplementations["insert.blocks"]({
|
|
5772
5708
|
context,
|
|
5773
5709
|
action
|
|
5774
5710
|
});
|
|
5775
5711
|
break;
|
|
5776
5712
|
}
|
|
5777
|
-
case "
|
|
5778
|
-
behaviorActionImplementations["
|
|
5713
|
+
case "insert.block object": {
|
|
5714
|
+
behaviorActionImplementations["insert.block object"]({
|
|
5779
5715
|
context,
|
|
5780
5716
|
action
|
|
5781
5717
|
});
|
|
5782
5718
|
break;
|
|
5783
5719
|
}
|
|
5784
|
-
|
|
5785
|
-
|
|
5720
|
+
case "insert.inline object": {
|
|
5721
|
+
behaviorActionImplementations["insert.inline object"]({
|
|
5786
5722
|
context,
|
|
5787
5723
|
action
|
|
5788
5724
|
});
|
|
5789
|
-
|
|
5790
|
-
}
|
|
5791
|
-
|
|
5792
|
-
|
|
5793
|
-
action
|
|
5794
|
-
}) {
|
|
5795
|
-
switch (action.type) {
|
|
5796
|
-
case "annotation.add": {
|
|
5797
|
-
behaviorActionImplementations["annotation.add"]({
|
|
5725
|
+
break;
|
|
5726
|
+
}
|
|
5727
|
+
case "insert.break": {
|
|
5728
|
+
behaviorActionImplementations["insert.break"]({
|
|
5798
5729
|
context,
|
|
5799
5730
|
action
|
|
5800
5731
|
});
|
|
5801
5732
|
break;
|
|
5802
5733
|
}
|
|
5803
|
-
case "
|
|
5804
|
-
behaviorActionImplementations["
|
|
5734
|
+
case "insert.soft break": {
|
|
5735
|
+
behaviorActionImplementations["insert.soft break"]({
|
|
5805
5736
|
context,
|
|
5806
5737
|
action
|
|
5807
5738
|
});
|
|
5808
5739
|
break;
|
|
5809
5740
|
}
|
|
5810
|
-
case "
|
|
5811
|
-
behaviorActionImplementations.
|
|
5741
|
+
case "insert.span": {
|
|
5742
|
+
behaviorActionImplementations["insert.span"]({
|
|
5812
5743
|
context,
|
|
5813
5744
|
action
|
|
5814
5745
|
});
|
|
5815
5746
|
break;
|
|
5816
5747
|
}
|
|
5817
|
-
case "
|
|
5818
|
-
behaviorActionImplementations["
|
|
5748
|
+
case "insert.text": {
|
|
5749
|
+
behaviorActionImplementations["insert.text"]({
|
|
5819
5750
|
context,
|
|
5820
5751
|
action
|
|
5821
5752
|
});
|
|
5822
5753
|
break;
|
|
5823
5754
|
}
|
|
5824
|
-
case "
|
|
5825
|
-
behaviorActionImplementations["
|
|
5755
|
+
case "insert.text block": {
|
|
5756
|
+
behaviorActionImplementations["insert.text block"]({
|
|
5826
5757
|
context,
|
|
5827
5758
|
action
|
|
5828
5759
|
});
|
|
5829
5760
|
break;
|
|
5830
5761
|
}
|
|
5831
|
-
case "
|
|
5832
|
-
behaviorActionImplementations["
|
|
5762
|
+
case "list item.add": {
|
|
5763
|
+
behaviorActionImplementations["list item.add"]({
|
|
5833
5764
|
context,
|
|
5834
5765
|
action
|
|
5835
5766
|
});
|
|
5836
5767
|
break;
|
|
5837
5768
|
}
|
|
5838
|
-
case "
|
|
5839
|
-
behaviorActionImplementations["
|
|
5769
|
+
case "list item.remove": {
|
|
5770
|
+
behaviorActionImplementations["list item.remove"]({
|
|
5840
5771
|
context,
|
|
5841
5772
|
action
|
|
5842
5773
|
});
|
|
5843
5774
|
break;
|
|
5844
5775
|
}
|
|
5845
|
-
case "
|
|
5846
|
-
behaviorActionImplementations["
|
|
5776
|
+
case "list item.toggle": {
|
|
5777
|
+
behaviorActionImplementations["list item.toggle"]({
|
|
5847
5778
|
context,
|
|
5848
5779
|
action
|
|
5849
5780
|
});
|
|
5850
5781
|
break;
|
|
5851
5782
|
}
|
|
5852
|
-
case "
|
|
5853
|
-
behaviorActionImplementations["
|
|
5783
|
+
case "move.block": {
|
|
5784
|
+
behaviorActionImplementations["move.block"]({
|
|
5854
5785
|
context,
|
|
5855
5786
|
action
|
|
5856
5787
|
});
|
|
5857
5788
|
break;
|
|
5858
5789
|
}
|
|
5859
|
-
case "
|
|
5860
|
-
behaviorActionImplementations.
|
|
5790
|
+
case "move.block down": {
|
|
5791
|
+
behaviorActionImplementations["move.block down"]({
|
|
5861
5792
|
context,
|
|
5862
5793
|
action
|
|
5863
5794
|
});
|
|
5864
5795
|
break;
|
|
5865
5796
|
}
|
|
5866
|
-
case "
|
|
5867
|
-
behaviorActionImplementations["
|
|
5797
|
+
case "move.block up": {
|
|
5798
|
+
behaviorActionImplementations["move.block up"]({
|
|
5868
5799
|
context,
|
|
5869
5800
|
action
|
|
5870
5801
|
});
|
|
5871
5802
|
break;
|
|
5872
5803
|
}
|
|
5873
|
-
case "
|
|
5874
|
-
behaviorActionImplementations
|
|
5804
|
+
case "select": {
|
|
5805
|
+
behaviorActionImplementations.select({
|
|
5875
5806
|
context,
|
|
5876
5807
|
action
|
|
5877
5808
|
});
|
|
5878
5809
|
break;
|
|
5879
5810
|
}
|
|
5880
|
-
case "
|
|
5881
|
-
behaviorActionImplementations["
|
|
5811
|
+
case "select.previous block": {
|
|
5812
|
+
behaviorActionImplementations["select.previous block"]({
|
|
5882
5813
|
context,
|
|
5883
5814
|
action
|
|
5884
5815
|
});
|
|
5885
5816
|
break;
|
|
5886
5817
|
}
|
|
5887
|
-
case "
|
|
5888
|
-
behaviorActionImplementations["
|
|
5818
|
+
case "select.next block": {
|
|
5819
|
+
behaviorActionImplementations["select.next block"]({
|
|
5889
5820
|
context,
|
|
5890
5821
|
action
|
|
5891
5822
|
});
|
|
5892
5823
|
break;
|
|
5893
5824
|
}
|
|
5894
|
-
case "
|
|
5895
|
-
behaviorActionImplementations["
|
|
5825
|
+
case "serialization.failure": {
|
|
5826
|
+
behaviorActionImplementations["serialization.failure"]({
|
|
5896
5827
|
context,
|
|
5897
5828
|
action
|
|
5898
5829
|
});
|
|
5899
5830
|
break;
|
|
5900
5831
|
}
|
|
5901
|
-
case "
|
|
5902
|
-
behaviorActionImplementations["
|
|
5832
|
+
case "serialization.success": {
|
|
5833
|
+
behaviorActionImplementations["serialization.success"]({
|
|
5903
5834
|
context,
|
|
5904
5835
|
action
|
|
5905
5836
|
});
|
|
5906
5837
|
break;
|
|
5907
5838
|
}
|
|
5908
|
-
case "
|
|
5909
|
-
behaviorActionImplementations["
|
|
5839
|
+
case "style.add": {
|
|
5840
|
+
behaviorActionImplementations["style.add"]({
|
|
5910
5841
|
context,
|
|
5911
5842
|
action
|
|
5912
5843
|
});
|
|
5913
5844
|
break;
|
|
5914
5845
|
}
|
|
5915
|
-
case "
|
|
5916
|
-
behaviorActionImplementations.
|
|
5846
|
+
case "style.remove": {
|
|
5847
|
+
behaviorActionImplementations["style.remove"]({
|
|
5917
5848
|
context,
|
|
5918
5849
|
action
|
|
5919
5850
|
});
|
|
5920
5851
|
break;
|
|
5921
5852
|
}
|
|
5922
|
-
case "
|
|
5923
|
-
behaviorActionImplementations["
|
|
5853
|
+
case "style.toggle": {
|
|
5854
|
+
behaviorActionImplementations["style.toggle"]({
|
|
5924
5855
|
context,
|
|
5925
5856
|
action
|
|
5926
5857
|
});
|
|
5927
5858
|
break;
|
|
5928
5859
|
}
|
|
5929
|
-
case "
|
|
5930
|
-
behaviorActionImplementations["
|
|
5860
|
+
case "text block.set": {
|
|
5861
|
+
behaviorActionImplementations["text block.set"]({
|
|
5931
5862
|
context,
|
|
5932
5863
|
action
|
|
5933
5864
|
});
|
|
5934
5865
|
break;
|
|
5935
5866
|
}
|
|
5936
|
-
|
|
5937
|
-
behaviorActionImplementations["
|
|
5867
|
+
case "text block.unset": {
|
|
5868
|
+
behaviorActionImplementations["text block.unset"]({
|
|
5938
5869
|
context,
|
|
5939
5870
|
action
|
|
5940
5871
|
});
|
|
5872
|
+
break;
|
|
5873
|
+
}
|
|
5941
5874
|
}
|
|
5942
5875
|
}
|
|
5943
5876
|
function getActiveDecorators({
|
|
@@ -6336,6 +6269,11 @@ const editorMachine = xstate.setup({
|
|
|
6336
6269
|
event
|
|
6337
6270
|
}) => event)
|
|
6338
6271
|
},
|
|
6272
|
+
"delete.*": {
|
|
6273
|
+
actions: xstate.emit(({
|
|
6274
|
+
event
|
|
6275
|
+
}) => event)
|
|
6276
|
+
},
|
|
6339
6277
|
focus: {
|
|
6340
6278
|
actions: xstate.emit(({
|
|
6341
6279
|
event
|
|
@@ -6351,15 +6289,30 @@ const editorMachine = xstate.setup({
|
|
|
6351
6289
|
event
|
|
6352
6290
|
}) => event)
|
|
6353
6291
|
},
|
|
6292
|
+
"move.*": {
|
|
6293
|
+
actions: xstate.emit(({
|
|
6294
|
+
event
|
|
6295
|
+
}) => event)
|
|
6296
|
+
},
|
|
6354
6297
|
select: {
|
|
6355
6298
|
actions: xstate.emit(({
|
|
6356
6299
|
event
|
|
6357
6300
|
}) => event)
|
|
6358
6301
|
},
|
|
6302
|
+
"select.*": {
|
|
6303
|
+
actions: xstate.emit(({
|
|
6304
|
+
event
|
|
6305
|
+
}) => event)
|
|
6306
|
+
},
|
|
6359
6307
|
"style.*": {
|
|
6360
6308
|
actions: xstate.emit(({
|
|
6361
6309
|
event
|
|
6362
6310
|
}) => event)
|
|
6311
|
+
},
|
|
6312
|
+
"text block.*": {
|
|
6313
|
+
actions: xstate.emit(({
|
|
6314
|
+
event
|
|
6315
|
+
}) => event)
|
|
6363
6316
|
}
|
|
6364
6317
|
}
|
|
6365
6318
|
}
|
|
@@ -6540,11 +6493,25 @@ function createEditorFromActor(editorActor) {
|
|
|
6540
6493
|
send: (event) => {
|
|
6541
6494
|
editorActor.send(event);
|
|
6542
6495
|
},
|
|
6543
|
-
on: (event, listener) => editorActor.on(
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6496
|
+
on: (event, listener) => editorActor.on(event, (event2) => {
|
|
6497
|
+
switch (event2.type) {
|
|
6498
|
+
case "blurred":
|
|
6499
|
+
case "done loading":
|
|
6500
|
+
case "editable":
|
|
6501
|
+
case "error":
|
|
6502
|
+
case "focused":
|
|
6503
|
+
case "invalid value":
|
|
6504
|
+
case "loading":
|
|
6505
|
+
case "mutation":
|
|
6506
|
+
case "patch":
|
|
6507
|
+
case "read only":
|
|
6508
|
+
case "ready":
|
|
6509
|
+
case "selection":
|
|
6510
|
+
case "value changed":
|
|
6511
|
+
listener(event2);
|
|
6512
|
+
break;
|
|
6513
|
+
}
|
|
6514
|
+
}),
|
|
6548
6515
|
_internal: {
|
|
6549
6516
|
editable,
|
|
6550
6517
|
editorActor,
|