@y/y 14.0.0-rc.14 → 14.0.0-rc.16
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.
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const attributionJsonSchema: s.Schema<{
|
|
2
2
|
insert?: string[] | undefined;
|
|
3
|
-
|
|
3
|
+
insertAt?: number | undefined;
|
|
4
4
|
delete?: string[] | undefined;
|
|
5
|
-
|
|
5
|
+
deleteAt?: number | undefined;
|
|
6
6
|
format?: {
|
|
7
7
|
[x: string]: string[];
|
|
8
8
|
} | undefined;
|
package/package.json
CHANGED
|
@@ -4,9 +4,9 @@ import { ObservableV2 } from 'lib0/observable'
|
|
|
4
4
|
|
|
5
5
|
export const attributionJsonSchema = s.$object({
|
|
6
6
|
insert: s.$array(s.$string).optional,
|
|
7
|
-
|
|
7
|
+
insertAt: s.$number.optional,
|
|
8
8
|
delete: s.$array(s.$string).optional,
|
|
9
|
-
|
|
9
|
+
deleteAt: s.$number.optional,
|
|
10
10
|
format: s.$record(s.$string, s.$array(s.$string)).optional,
|
|
11
11
|
formatAt: s.$number.optional
|
|
12
12
|
})
|
package/src/ytype.js
CHANGED
|
@@ -1036,13 +1036,13 @@ export class YType {
|
|
|
1036
1036
|
} else {
|
|
1037
1037
|
const by = changedAttributedAttributes[key] = (changedAttributedAttributes[key]?.slice() ?? [])
|
|
1038
1038
|
by.push(...((c.deleted ? attribution.delete : attribution.insert) ?? []))
|
|
1039
|
-
const attributedAt = (c.deleted ? attribution.
|
|
1039
|
+
const attributedAt = (c.deleted ? attribution.deleteAt : attribution.insertAt)
|
|
1040
1040
|
if (attributedAt) formattingAttribution.formatAt = attributedAt
|
|
1041
1041
|
}
|
|
1042
1042
|
if (object.isEmpty(changedAttributedAttributes)) {
|
|
1043
1043
|
d.useAttribution(null)
|
|
1044
1044
|
} else if (attribution != null) {
|
|
1045
|
-
const attributedAt = (c.deleted ? attribution.
|
|
1045
|
+
const attributedAt = (c.deleted ? attribution.deleteAt : attribution.insertAt)
|
|
1046
1046
|
if (attributedAt != null) formattingAttribution.formatAt = attributedAt
|
|
1047
1047
|
d.useAttribution(formattingAttribution)
|
|
1048
1048
|
}
|
|
@@ -1078,7 +1078,7 @@ export class YType {
|
|
|
1078
1078
|
applyDelta (d, am = noAttributionsManager) {
|
|
1079
1079
|
if (this.doc == null) {
|
|
1080
1080
|
(this._prelim || (this._prelim = /** @type {any} */ (delta.create()))).apply(d)
|
|
1081
|
-
} else {
|
|
1081
|
+
} else if (this._item?.deleted !== true) {
|
|
1082
1082
|
// @todo this was moved here from ytext. Make this more generic
|
|
1083
1083
|
transact(this.doc, transaction => {
|
|
1084
1084
|
const currPos = new ItemTextListPosition(null, this._start, 0, new Map(), am)
|