@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.js
CHANGED
|
@@ -23,7 +23,7 @@ import { toHTML } from "@portabletext/to-html";
|
|
|
23
23
|
import get from "lodash/get.js";
|
|
24
24
|
import isUndefined from "lodash/isUndefined.js";
|
|
25
25
|
import omitBy from "lodash/omitBy.js";
|
|
26
|
-
import { createGuards } from "./_chunks-es/selector.is-
|
|
26
|
+
import { createGuards } from "./_chunks-es/selector.is-active-style.js";
|
|
27
27
|
import { blockOffsetToSpanSelectionPoint } from "./_chunks-es/util.is-empty-text-block.js";
|
|
28
28
|
import { coreBehaviors, isCustomBehaviorEvent, isHotkey } from "./_chunks-es/behavior.core.js";
|
|
29
29
|
import getRandomValues from "get-random-values-esm";
|
|
@@ -3003,123 +3003,54 @@ function createWithEventListeners(editorActor, subscriptions) {
|
|
|
3003
3003
|
subscriptions.push(() => {
|
|
3004
3004
|
const subscription = editorActor.on("*", (event) => {
|
|
3005
3005
|
switch (event.type) {
|
|
3006
|
-
case "
|
|
3007
|
-
editorActor.send({
|
|
3008
|
-
type: "behavior event",
|
|
3009
|
-
behaviorEvent: {
|
|
3010
|
-
type: "annotation.add",
|
|
3011
|
-
annotation: event.annotation
|
|
3012
|
-
},
|
|
3013
|
-
editor
|
|
3014
|
-
});
|
|
3015
|
-
break;
|
|
3016
|
-
}
|
|
3017
|
-
case "annotation.remove": {
|
|
3018
|
-
editorActor.send({
|
|
3019
|
-
type: "behavior event",
|
|
3020
|
-
behaviorEvent: {
|
|
3021
|
-
type: "annotation.remove",
|
|
3022
|
-
annotation: event.annotation
|
|
3023
|
-
},
|
|
3024
|
-
editor
|
|
3025
|
-
});
|
|
3026
|
-
break;
|
|
3027
|
-
}
|
|
3028
|
-
case "blur": {
|
|
3029
|
-
editorActor.send({
|
|
3030
|
-
type: "behavior event",
|
|
3031
|
-
behaviorEvent: {
|
|
3032
|
-
type: "blur"
|
|
3033
|
-
},
|
|
3034
|
-
editor
|
|
3035
|
-
});
|
|
3036
|
-
break;
|
|
3037
|
-
}
|
|
3038
|
-
case "custom.*": {
|
|
3006
|
+
case "custom.*":
|
|
3039
3007
|
editorActor.send({
|
|
3040
3008
|
type: "custom behavior event",
|
|
3041
3009
|
behaviorEvent: event.event,
|
|
3042
3010
|
editor
|
|
3043
3011
|
});
|
|
3044
3012
|
break;
|
|
3045
|
-
|
|
3046
|
-
case "
|
|
3047
|
-
|
|
3048
|
-
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
|
|
3057
|
-
case "
|
|
3058
|
-
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3063
|
-
|
|
3064
|
-
|
|
3065
|
-
|
|
3066
|
-
|
|
3067
|
-
case "
|
|
3068
|
-
|
|
3069
|
-
|
|
3070
|
-
|
|
3071
|
-
|
|
3072
|
-
|
|
3073
|
-
|
|
3074
|
-
|
|
3075
|
-
|
|
3076
|
-
|
|
3077
|
-
|
|
3078
|
-
|
|
3079
|
-
case "
|
|
3080
|
-
editorActor.send({
|
|
3081
|
-
type: "behavior event",
|
|
3082
|
-
behaviorEvent: {
|
|
3083
|
-
type: "insert.inline object",
|
|
3084
|
-
inlineObject: event.inlineObject
|
|
3085
|
-
},
|
|
3086
|
-
editor
|
|
3087
|
-
});
|
|
3088
|
-
break;
|
|
3089
|
-
}
|
|
3090
|
-
case "list item.toggle": {
|
|
3013
|
+
case "annotation.add":
|
|
3014
|
+
case "annotation.remove":
|
|
3015
|
+
case "annotation.toggle":
|
|
3016
|
+
case "blur":
|
|
3017
|
+
case "data transfer.set":
|
|
3018
|
+
case "decorator.add":
|
|
3019
|
+
case "decorator.remove":
|
|
3020
|
+
case "decorator.toggle":
|
|
3021
|
+
case "delete.backward":
|
|
3022
|
+
case "delete.block":
|
|
3023
|
+
case "delete.forward":
|
|
3024
|
+
case "delete.text":
|
|
3025
|
+
case "deserialization.failure":
|
|
3026
|
+
case "deserialization.success":
|
|
3027
|
+
case "focus":
|
|
3028
|
+
case "insert.block object":
|
|
3029
|
+
case "insert.inline object":
|
|
3030
|
+
case "insert.span":
|
|
3031
|
+
case "insert.text block":
|
|
3032
|
+
case "list item.add":
|
|
3033
|
+
case "list item.remove":
|
|
3034
|
+
case "list item.toggle":
|
|
3035
|
+
case "move.block":
|
|
3036
|
+
case "move.block down":
|
|
3037
|
+
case "move.block up":
|
|
3038
|
+
case "select":
|
|
3039
|
+
case "select.next block":
|
|
3040
|
+
case "select.previous block":
|
|
3041
|
+
case "serialization.failure":
|
|
3042
|
+
case "serialization.success":
|
|
3043
|
+
case "style.add":
|
|
3044
|
+
case "style.remove":
|
|
3045
|
+
case "style.toggle":
|
|
3046
|
+
case "text block.set":
|
|
3047
|
+
case "text block.unset":
|
|
3091
3048
|
editorActor.send({
|
|
3092
3049
|
type: "behavior event",
|
|
3093
|
-
behaviorEvent:
|
|
3094
|
-
type: "list item.toggle",
|
|
3095
|
-
listItem: event.listItem
|
|
3096
|
-
},
|
|
3050
|
+
behaviorEvent: event,
|
|
3097
3051
|
editor
|
|
3098
3052
|
});
|
|
3099
3053
|
break;
|
|
3100
|
-
}
|
|
3101
|
-
case "select": {
|
|
3102
|
-
editorActor.send({
|
|
3103
|
-
type: "behavior event",
|
|
3104
|
-
behaviorEvent: {
|
|
3105
|
-
type: "select",
|
|
3106
|
-
selection: event.selection
|
|
3107
|
-
},
|
|
3108
|
-
editor
|
|
3109
|
-
});
|
|
3110
|
-
break;
|
|
3111
|
-
}
|
|
3112
|
-
case "style.toggle": {
|
|
3113
|
-
editorActor.send({
|
|
3114
|
-
type: "behavior event",
|
|
3115
|
-
behaviorEvent: {
|
|
3116
|
-
type: "style.toggle",
|
|
3117
|
-
style: event.style
|
|
3118
|
-
},
|
|
3119
|
-
editor
|
|
3120
|
-
});
|
|
3121
|
-
break;
|
|
3122
|
-
}
|
|
3123
3054
|
}
|
|
3124
3055
|
});
|
|
3125
3056
|
return () => {
|
|
@@ -5661,305 +5592,307 @@ function performAction({
|
|
|
5661
5592
|
action
|
|
5662
5593
|
}) {
|
|
5663
5594
|
switch (action.type) {
|
|
5664
|
-
case "
|
|
5665
|
-
|
|
5595
|
+
case "noop":
|
|
5596
|
+
break;
|
|
5597
|
+
case "effect": {
|
|
5598
|
+
behaviorActionImplementations.effect({
|
|
5666
5599
|
context,
|
|
5667
5600
|
action
|
|
5668
5601
|
});
|
|
5669
5602
|
break;
|
|
5670
5603
|
}
|
|
5671
|
-
case "
|
|
5672
|
-
behaviorActionImplementations
|
|
5604
|
+
case "select": {
|
|
5605
|
+
behaviorActionImplementations.select({
|
|
5673
5606
|
context,
|
|
5674
5607
|
action
|
|
5675
5608
|
});
|
|
5676
5609
|
break;
|
|
5677
5610
|
}
|
|
5678
|
-
|
|
5679
|
-
|
|
5611
|
+
default:
|
|
5612
|
+
performDefaultAction({
|
|
5680
5613
|
context,
|
|
5681
5614
|
action
|
|
5682
5615
|
});
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
|
|
5686
|
-
|
|
5616
|
+
}
|
|
5617
|
+
}
|
|
5618
|
+
function performDefaultAction({
|
|
5619
|
+
context,
|
|
5620
|
+
action
|
|
5621
|
+
}) {
|
|
5622
|
+
switch (action.type) {
|
|
5623
|
+
case "annotation.add": {
|
|
5624
|
+
behaviorActionImplementations["annotation.add"]({
|
|
5687
5625
|
context,
|
|
5688
5626
|
action
|
|
5689
5627
|
});
|
|
5690
5628
|
break;
|
|
5691
5629
|
}
|
|
5692
|
-
case "
|
|
5693
|
-
behaviorActionImplementations["
|
|
5630
|
+
case "annotation.remove": {
|
|
5631
|
+
behaviorActionImplementations["annotation.remove"]({
|
|
5694
5632
|
context,
|
|
5695
5633
|
action
|
|
5696
5634
|
});
|
|
5697
5635
|
break;
|
|
5698
5636
|
}
|
|
5699
|
-
case "
|
|
5700
|
-
behaviorActionImplementations["
|
|
5637
|
+
case "annotation.toggle": {
|
|
5638
|
+
behaviorActionImplementations["annotation.toggle"]({
|
|
5701
5639
|
context,
|
|
5702
5640
|
action
|
|
5703
5641
|
});
|
|
5704
5642
|
break;
|
|
5705
5643
|
}
|
|
5706
|
-
case "
|
|
5707
|
-
behaviorActionImplementations
|
|
5644
|
+
case "blur": {
|
|
5645
|
+
behaviorActionImplementations.blur({
|
|
5708
5646
|
context,
|
|
5709
5647
|
action
|
|
5710
5648
|
});
|
|
5711
5649
|
break;
|
|
5712
5650
|
}
|
|
5713
|
-
case "
|
|
5714
|
-
behaviorActionImplementations["
|
|
5651
|
+
case "data transfer.set": {
|
|
5652
|
+
behaviorActionImplementations["data transfer.set"]({
|
|
5715
5653
|
context,
|
|
5716
5654
|
action
|
|
5717
5655
|
});
|
|
5718
5656
|
break;
|
|
5719
5657
|
}
|
|
5720
|
-
case "
|
|
5721
|
-
behaviorActionImplementations["
|
|
5658
|
+
case "decorator.add": {
|
|
5659
|
+
behaviorActionImplementations["decorator.add"]({
|
|
5722
5660
|
context,
|
|
5723
5661
|
action
|
|
5724
5662
|
});
|
|
5725
5663
|
break;
|
|
5726
5664
|
}
|
|
5727
|
-
case "
|
|
5728
|
-
behaviorActionImplementations["
|
|
5665
|
+
case "decorator.remove": {
|
|
5666
|
+
behaviorActionImplementations["decorator.remove"]({
|
|
5729
5667
|
context,
|
|
5730
5668
|
action
|
|
5731
5669
|
});
|
|
5732
5670
|
break;
|
|
5733
5671
|
}
|
|
5734
|
-
case "
|
|
5735
|
-
behaviorActionImplementations["
|
|
5672
|
+
case "decorator.toggle": {
|
|
5673
|
+
behaviorActionImplementations["decorator.toggle"]({
|
|
5736
5674
|
context,
|
|
5737
5675
|
action
|
|
5738
5676
|
});
|
|
5739
5677
|
break;
|
|
5740
5678
|
}
|
|
5741
|
-
case "
|
|
5742
|
-
behaviorActionImplementations["
|
|
5679
|
+
case "delete.backward": {
|
|
5680
|
+
behaviorActionImplementations["delete.backward"]({
|
|
5743
5681
|
context,
|
|
5744
5682
|
action
|
|
5745
5683
|
});
|
|
5746
5684
|
break;
|
|
5747
5685
|
}
|
|
5748
|
-
case "
|
|
5749
|
-
|
|
5750
|
-
case "effect": {
|
|
5751
|
-
behaviorActionImplementations.effect({
|
|
5686
|
+
case "delete.block": {
|
|
5687
|
+
behaviorActionImplementations["delete.block"]({
|
|
5752
5688
|
context,
|
|
5753
5689
|
action
|
|
5754
5690
|
});
|
|
5755
5691
|
break;
|
|
5756
5692
|
}
|
|
5757
|
-
case "
|
|
5758
|
-
behaviorActionImplementations.
|
|
5693
|
+
case "delete.forward": {
|
|
5694
|
+
behaviorActionImplementations["delete.forward"]({
|
|
5759
5695
|
context,
|
|
5760
5696
|
action
|
|
5761
5697
|
});
|
|
5762
5698
|
break;
|
|
5763
5699
|
}
|
|
5764
|
-
case "
|
|
5765
|
-
behaviorActionImplementations["
|
|
5700
|
+
case "delete.text": {
|
|
5701
|
+
behaviorActionImplementations["delete.text"]({
|
|
5766
5702
|
context,
|
|
5767
5703
|
action
|
|
5768
5704
|
});
|
|
5769
5705
|
break;
|
|
5770
5706
|
}
|
|
5771
|
-
case "
|
|
5772
|
-
behaviorActionImplementations["
|
|
5707
|
+
case "deserialization.failure": {
|
|
5708
|
+
behaviorActionImplementations["deserialization.failure"]({
|
|
5773
5709
|
context,
|
|
5774
5710
|
action
|
|
5775
5711
|
});
|
|
5776
5712
|
break;
|
|
5777
5713
|
}
|
|
5778
|
-
case "
|
|
5779
|
-
behaviorActionImplementations["
|
|
5714
|
+
case "deserialization.success": {
|
|
5715
|
+
behaviorActionImplementations["deserialization.success"]({
|
|
5780
5716
|
context,
|
|
5781
5717
|
action
|
|
5782
5718
|
});
|
|
5783
5719
|
break;
|
|
5784
5720
|
}
|
|
5785
|
-
case "
|
|
5786
|
-
behaviorActionImplementations
|
|
5721
|
+
case "focus": {
|
|
5722
|
+
behaviorActionImplementations.focus({
|
|
5787
5723
|
context,
|
|
5788
5724
|
action
|
|
5789
5725
|
});
|
|
5790
5726
|
break;
|
|
5791
5727
|
}
|
|
5792
|
-
case "
|
|
5793
|
-
behaviorActionImplementations["
|
|
5728
|
+
case "insert.blocks": {
|
|
5729
|
+
behaviorActionImplementations["insert.blocks"]({
|
|
5794
5730
|
context,
|
|
5795
5731
|
action
|
|
5796
5732
|
});
|
|
5797
5733
|
break;
|
|
5798
5734
|
}
|
|
5799
|
-
case "
|
|
5800
|
-
behaviorActionImplementations["
|
|
5735
|
+
case "insert.block object": {
|
|
5736
|
+
behaviorActionImplementations["insert.block object"]({
|
|
5801
5737
|
context,
|
|
5802
5738
|
action
|
|
5803
5739
|
});
|
|
5804
5740
|
break;
|
|
5805
5741
|
}
|
|
5806
|
-
|
|
5807
|
-
|
|
5742
|
+
case "insert.inline object": {
|
|
5743
|
+
behaviorActionImplementations["insert.inline object"]({
|
|
5808
5744
|
context,
|
|
5809
5745
|
action
|
|
5810
5746
|
});
|
|
5811
|
-
|
|
5812
|
-
}
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
action
|
|
5816
|
-
}) {
|
|
5817
|
-
switch (action.type) {
|
|
5818
|
-
case "annotation.add": {
|
|
5819
|
-
behaviorActionImplementations["annotation.add"]({
|
|
5747
|
+
break;
|
|
5748
|
+
}
|
|
5749
|
+
case "insert.break": {
|
|
5750
|
+
behaviorActionImplementations["insert.break"]({
|
|
5820
5751
|
context,
|
|
5821
5752
|
action
|
|
5822
5753
|
});
|
|
5823
5754
|
break;
|
|
5824
5755
|
}
|
|
5825
|
-
case "
|
|
5826
|
-
behaviorActionImplementations["
|
|
5756
|
+
case "insert.soft break": {
|
|
5757
|
+
behaviorActionImplementations["insert.soft break"]({
|
|
5827
5758
|
context,
|
|
5828
5759
|
action
|
|
5829
5760
|
});
|
|
5830
5761
|
break;
|
|
5831
5762
|
}
|
|
5832
|
-
case "
|
|
5833
|
-
behaviorActionImplementations.
|
|
5763
|
+
case "insert.span": {
|
|
5764
|
+
behaviorActionImplementations["insert.span"]({
|
|
5834
5765
|
context,
|
|
5835
5766
|
action
|
|
5836
5767
|
});
|
|
5837
5768
|
break;
|
|
5838
5769
|
}
|
|
5839
|
-
case "
|
|
5840
|
-
behaviorActionImplementations["
|
|
5770
|
+
case "insert.text": {
|
|
5771
|
+
behaviorActionImplementations["insert.text"]({
|
|
5841
5772
|
context,
|
|
5842
5773
|
action
|
|
5843
5774
|
});
|
|
5844
5775
|
break;
|
|
5845
5776
|
}
|
|
5846
|
-
case "
|
|
5847
|
-
behaviorActionImplementations["
|
|
5777
|
+
case "insert.text block": {
|
|
5778
|
+
behaviorActionImplementations["insert.text block"]({
|
|
5848
5779
|
context,
|
|
5849
5780
|
action
|
|
5850
5781
|
});
|
|
5851
5782
|
break;
|
|
5852
5783
|
}
|
|
5853
|
-
case "
|
|
5854
|
-
behaviorActionImplementations["
|
|
5784
|
+
case "list item.add": {
|
|
5785
|
+
behaviorActionImplementations["list item.add"]({
|
|
5855
5786
|
context,
|
|
5856
5787
|
action
|
|
5857
5788
|
});
|
|
5858
5789
|
break;
|
|
5859
5790
|
}
|
|
5860
|
-
case "
|
|
5861
|
-
behaviorActionImplementations["
|
|
5791
|
+
case "list item.remove": {
|
|
5792
|
+
behaviorActionImplementations["list item.remove"]({
|
|
5862
5793
|
context,
|
|
5863
5794
|
action
|
|
5864
5795
|
});
|
|
5865
5796
|
break;
|
|
5866
5797
|
}
|
|
5867
|
-
case "
|
|
5868
|
-
behaviorActionImplementations["
|
|
5798
|
+
case "list item.toggle": {
|
|
5799
|
+
behaviorActionImplementations["list item.toggle"]({
|
|
5869
5800
|
context,
|
|
5870
5801
|
action
|
|
5871
5802
|
});
|
|
5872
5803
|
break;
|
|
5873
5804
|
}
|
|
5874
|
-
case "
|
|
5875
|
-
behaviorActionImplementations["
|
|
5805
|
+
case "move.block": {
|
|
5806
|
+
behaviorActionImplementations["move.block"]({
|
|
5876
5807
|
context,
|
|
5877
5808
|
action
|
|
5878
5809
|
});
|
|
5879
5810
|
break;
|
|
5880
5811
|
}
|
|
5881
|
-
case "
|
|
5882
|
-
behaviorActionImplementations.
|
|
5812
|
+
case "move.block down": {
|
|
5813
|
+
behaviorActionImplementations["move.block down"]({
|
|
5883
5814
|
context,
|
|
5884
5815
|
action
|
|
5885
5816
|
});
|
|
5886
5817
|
break;
|
|
5887
5818
|
}
|
|
5888
|
-
case "
|
|
5889
|
-
behaviorActionImplementations["
|
|
5819
|
+
case "move.block up": {
|
|
5820
|
+
behaviorActionImplementations["move.block up"]({
|
|
5890
5821
|
context,
|
|
5891
5822
|
action
|
|
5892
5823
|
});
|
|
5893
5824
|
break;
|
|
5894
5825
|
}
|
|
5895
|
-
case "
|
|
5896
|
-
behaviorActionImplementations
|
|
5826
|
+
case "select": {
|
|
5827
|
+
behaviorActionImplementations.select({
|
|
5897
5828
|
context,
|
|
5898
5829
|
action
|
|
5899
5830
|
});
|
|
5900
5831
|
break;
|
|
5901
5832
|
}
|
|
5902
|
-
case "
|
|
5903
|
-
behaviorActionImplementations["
|
|
5833
|
+
case "select.previous block": {
|
|
5834
|
+
behaviorActionImplementations["select.previous block"]({
|
|
5904
5835
|
context,
|
|
5905
5836
|
action
|
|
5906
5837
|
});
|
|
5907
5838
|
break;
|
|
5908
5839
|
}
|
|
5909
|
-
case "
|
|
5910
|
-
behaviorActionImplementations["
|
|
5840
|
+
case "select.next block": {
|
|
5841
|
+
behaviorActionImplementations["select.next block"]({
|
|
5911
5842
|
context,
|
|
5912
5843
|
action
|
|
5913
5844
|
});
|
|
5914
5845
|
break;
|
|
5915
5846
|
}
|
|
5916
|
-
case "
|
|
5917
|
-
behaviorActionImplementations["
|
|
5847
|
+
case "serialization.failure": {
|
|
5848
|
+
behaviorActionImplementations["serialization.failure"]({
|
|
5918
5849
|
context,
|
|
5919
5850
|
action
|
|
5920
5851
|
});
|
|
5921
5852
|
break;
|
|
5922
5853
|
}
|
|
5923
|
-
case "
|
|
5924
|
-
behaviorActionImplementations["
|
|
5854
|
+
case "serialization.success": {
|
|
5855
|
+
behaviorActionImplementations["serialization.success"]({
|
|
5925
5856
|
context,
|
|
5926
5857
|
action
|
|
5927
5858
|
});
|
|
5928
5859
|
break;
|
|
5929
5860
|
}
|
|
5930
|
-
case "
|
|
5931
|
-
behaviorActionImplementations["
|
|
5861
|
+
case "style.add": {
|
|
5862
|
+
behaviorActionImplementations["style.add"]({
|
|
5932
5863
|
context,
|
|
5933
5864
|
action
|
|
5934
5865
|
});
|
|
5935
5866
|
break;
|
|
5936
5867
|
}
|
|
5937
|
-
case "
|
|
5938
|
-
behaviorActionImplementations.
|
|
5868
|
+
case "style.remove": {
|
|
5869
|
+
behaviorActionImplementations["style.remove"]({
|
|
5939
5870
|
context,
|
|
5940
5871
|
action
|
|
5941
5872
|
});
|
|
5942
5873
|
break;
|
|
5943
5874
|
}
|
|
5944
|
-
case "
|
|
5945
|
-
behaviorActionImplementations["
|
|
5875
|
+
case "style.toggle": {
|
|
5876
|
+
behaviorActionImplementations["style.toggle"]({
|
|
5946
5877
|
context,
|
|
5947
5878
|
action
|
|
5948
5879
|
});
|
|
5949
5880
|
break;
|
|
5950
5881
|
}
|
|
5951
|
-
case "
|
|
5952
|
-
behaviorActionImplementations["
|
|
5882
|
+
case "text block.set": {
|
|
5883
|
+
behaviorActionImplementations["text block.set"]({
|
|
5953
5884
|
context,
|
|
5954
5885
|
action
|
|
5955
5886
|
});
|
|
5956
5887
|
break;
|
|
5957
5888
|
}
|
|
5958
|
-
|
|
5959
|
-
behaviorActionImplementations["
|
|
5889
|
+
case "text block.unset": {
|
|
5890
|
+
behaviorActionImplementations["text block.unset"]({
|
|
5960
5891
|
context,
|
|
5961
5892
|
action
|
|
5962
5893
|
});
|
|
5894
|
+
break;
|
|
5895
|
+
}
|
|
5963
5896
|
}
|
|
5964
5897
|
}
|
|
5965
5898
|
function getActiveDecorators({
|
|
@@ -6358,6 +6291,11 @@ const editorMachine = setup({
|
|
|
6358
6291
|
event
|
|
6359
6292
|
}) => event)
|
|
6360
6293
|
},
|
|
6294
|
+
"delete.*": {
|
|
6295
|
+
actions: emit(({
|
|
6296
|
+
event
|
|
6297
|
+
}) => event)
|
|
6298
|
+
},
|
|
6361
6299
|
focus: {
|
|
6362
6300
|
actions: emit(({
|
|
6363
6301
|
event
|
|
@@ -6373,15 +6311,30 @@ const editorMachine = setup({
|
|
|
6373
6311
|
event
|
|
6374
6312
|
}) => event)
|
|
6375
6313
|
},
|
|
6314
|
+
"move.*": {
|
|
6315
|
+
actions: emit(({
|
|
6316
|
+
event
|
|
6317
|
+
}) => event)
|
|
6318
|
+
},
|
|
6376
6319
|
select: {
|
|
6377
6320
|
actions: emit(({
|
|
6378
6321
|
event
|
|
6379
6322
|
}) => event)
|
|
6380
6323
|
},
|
|
6324
|
+
"select.*": {
|
|
6325
|
+
actions: emit(({
|
|
6326
|
+
event
|
|
6327
|
+
}) => event)
|
|
6328
|
+
},
|
|
6381
6329
|
"style.*": {
|
|
6382
6330
|
actions: emit(({
|
|
6383
6331
|
event
|
|
6384
6332
|
}) => event)
|
|
6333
|
+
},
|
|
6334
|
+
"text block.*": {
|
|
6335
|
+
actions: emit(({
|
|
6336
|
+
event
|
|
6337
|
+
}) => event)
|
|
6385
6338
|
}
|
|
6386
6339
|
}
|
|
6387
6340
|
}
|
|
@@ -6562,11 +6515,25 @@ function createEditorFromActor(editorActor) {
|
|
|
6562
6515
|
send: (event) => {
|
|
6563
6516
|
editorActor.send(event);
|
|
6564
6517
|
},
|
|
6565
|
-
on: (event, listener) => editorActor.on(
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6518
|
+
on: (event, listener) => editorActor.on(event, (event2) => {
|
|
6519
|
+
switch (event2.type) {
|
|
6520
|
+
case "blurred":
|
|
6521
|
+
case "done loading":
|
|
6522
|
+
case "editable":
|
|
6523
|
+
case "error":
|
|
6524
|
+
case "focused":
|
|
6525
|
+
case "invalid value":
|
|
6526
|
+
case "loading":
|
|
6527
|
+
case "mutation":
|
|
6528
|
+
case "patch":
|
|
6529
|
+
case "read only":
|
|
6530
|
+
case "ready":
|
|
6531
|
+
case "selection":
|
|
6532
|
+
case "value changed":
|
|
6533
|
+
listener(event2);
|
|
6534
|
+
break;
|
|
6535
|
+
}
|
|
6536
|
+
}),
|
|
6570
6537
|
_internal: {
|
|
6571
6538
|
editable,
|
|
6572
6539
|
editorActor,
|