@fluidframework/sequence 2.0.0-internal.6.4.0 → 2.0.0-internal.7.1.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.
Files changed (148) hide show
  1. package/CHANGELOG.md +91 -0
  2. package/README.md +130 -0
  3. package/api-extractor.json +16 -1
  4. package/api-report/sequence.api.md +715 -0
  5. package/dist/defaultMap.d.ts +1 -1
  6. package/dist/defaultMap.d.ts.map +1 -1
  7. package/dist/defaultMap.js +6 -6
  8. package/dist/defaultMap.js.map +1 -1
  9. package/dist/defaultMapInterfaces.d.ts +21 -2
  10. package/dist/defaultMapInterfaces.d.ts.map +1 -1
  11. package/dist/defaultMapInterfaces.js.map +1 -1
  12. package/dist/index.d.ts +1 -1
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +2 -1
  15. package/dist/index.js.map +1 -1
  16. package/dist/intervalCollection.d.ts +153 -15
  17. package/dist/intervalCollection.d.ts.map +1 -1
  18. package/dist/intervalCollection.js +146 -42
  19. package/dist/intervalCollection.js.map +1 -1
  20. package/dist/intervalIndex/endpointInRangeIndex.js +1 -1
  21. package/dist/intervalIndex/endpointInRangeIndex.js.map +1 -1
  22. package/dist/intervalIndex/endpointIndex.d.ts.map +1 -1
  23. package/dist/intervalIndex/endpointIndex.js +1 -2
  24. package/dist/intervalIndex/endpointIndex.js.map +1 -1
  25. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts +5 -4
  26. package/dist/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  27. package/dist/intervalIndex/overlappingIntervalsIndex.js +7 -2
  28. package/dist/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  29. package/dist/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
  30. package/dist/intervalIndex/startpointInRangeIndex.js +1 -3
  31. package/dist/intervalIndex/startpointInRangeIndex.js.map +1 -1
  32. package/dist/intervalTree.d.ts +1 -1
  33. package/dist/intervalTree.d.ts.map +1 -1
  34. package/dist/intervals/interval.d.ts +3 -2
  35. package/dist/intervals/interval.d.ts.map +1 -1
  36. package/dist/intervals/interval.js +12 -5
  37. package/dist/intervals/interval.js.map +1 -1
  38. package/dist/intervals/intervalUtils.d.ts +42 -18
  39. package/dist/intervals/intervalUtils.d.ts.map +1 -1
  40. package/dist/intervals/intervalUtils.js +15 -10
  41. package/dist/intervals/intervalUtils.js.map +1 -1
  42. package/dist/intervals/sequenceInterval.d.ts +23 -13
  43. package/dist/intervals/sequenceInterval.d.ts.map +1 -1
  44. package/dist/intervals/sequenceInterval.js +117 -42
  45. package/dist/intervals/sequenceInterval.js.map +1 -1
  46. package/dist/localValues.d.ts.map +1 -1
  47. package/dist/localValues.js.map +1 -1
  48. package/dist/packageVersion.d.ts +1 -1
  49. package/dist/packageVersion.js +1 -1
  50. package/dist/packageVersion.js.map +1 -1
  51. package/dist/revertibles.d.ts +3 -15
  52. package/dist/revertibles.d.ts.map +1 -1
  53. package/dist/revertibles.js +11 -19
  54. package/dist/revertibles.js.map +1 -1
  55. package/dist/sequence-alpha.d.ts +1500 -0
  56. package/dist/sequence-beta.d.ts +1420 -0
  57. package/dist/sequence-public.d.ts +1420 -0
  58. package/dist/sequence-untrimmed.d.ts +1672 -0
  59. package/dist/sequence.d.ts +1 -1
  60. package/dist/sequence.d.ts.map +1 -1
  61. package/dist/sequence.js +44 -43
  62. package/dist/sequence.js.map +1 -1
  63. package/dist/sharedIntervalCollection.js +9 -9
  64. package/dist/sharedIntervalCollection.js.map +1 -1
  65. package/dist/sharedSequence.js +6 -6
  66. package/dist/sharedSequence.js.map +1 -1
  67. package/dist/sharedString.d.ts +1 -1
  68. package/dist/sharedString.d.ts.map +1 -1
  69. package/dist/sharedString.js +5 -5
  70. package/dist/sharedString.js.map +1 -1
  71. package/dist/tsdoc-metadata.json +1 -1
  72. package/lib/defaultMap.d.ts +1 -1
  73. package/lib/defaultMap.d.ts.map +1 -1
  74. package/lib/defaultMap.js +6 -6
  75. package/lib/defaultMap.js.map +1 -1
  76. package/lib/defaultMapInterfaces.d.ts +21 -2
  77. package/lib/defaultMapInterfaces.d.ts.map +1 -1
  78. package/lib/defaultMapInterfaces.js.map +1 -1
  79. package/lib/index.d.ts +1 -1
  80. package/lib/index.d.ts.map +1 -1
  81. package/lib/index.js +1 -1
  82. package/lib/index.js.map +1 -1
  83. package/lib/intervalCollection.d.ts +153 -15
  84. package/lib/intervalCollection.d.ts.map +1 -1
  85. package/lib/intervalCollection.js +143 -42
  86. package/lib/intervalCollection.js.map +1 -1
  87. package/lib/intervalIndex/endpointInRangeIndex.js +1 -1
  88. package/lib/intervalIndex/endpointInRangeIndex.js.map +1 -1
  89. package/lib/intervalIndex/endpointIndex.d.ts.map +1 -1
  90. package/lib/intervalIndex/endpointIndex.js +1 -2
  91. package/lib/intervalIndex/endpointIndex.js.map +1 -1
  92. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts +5 -4
  93. package/lib/intervalIndex/overlappingIntervalsIndex.d.ts.map +1 -1
  94. package/lib/intervalIndex/overlappingIntervalsIndex.js +7 -2
  95. package/lib/intervalIndex/overlappingIntervalsIndex.js.map +1 -1
  96. package/lib/intervalIndex/startpointInRangeIndex.d.ts.map +1 -1
  97. package/lib/intervalIndex/startpointInRangeIndex.js +1 -3
  98. package/lib/intervalIndex/startpointInRangeIndex.js.map +1 -1
  99. package/lib/intervalTree.d.ts +1 -1
  100. package/lib/intervalTree.d.ts.map +1 -1
  101. package/lib/intervals/interval.d.ts +3 -2
  102. package/lib/intervals/interval.d.ts.map +1 -1
  103. package/lib/intervals/interval.js +12 -5
  104. package/lib/intervals/interval.js.map +1 -1
  105. package/lib/intervals/intervalUtils.d.ts +42 -18
  106. package/lib/intervals/intervalUtils.d.ts.map +1 -1
  107. package/lib/intervals/intervalUtils.js +11 -6
  108. package/lib/intervals/intervalUtils.js.map +1 -1
  109. package/lib/intervals/sequenceInterval.d.ts +23 -13
  110. package/lib/intervals/sequenceInterval.d.ts.map +1 -1
  111. package/lib/intervals/sequenceInterval.js +118 -41
  112. package/lib/intervals/sequenceInterval.js.map +1 -1
  113. package/lib/localValues.d.ts.map +1 -1
  114. package/lib/localValues.js.map +1 -1
  115. package/lib/packageVersion.d.ts +1 -1
  116. package/lib/packageVersion.js +1 -1
  117. package/lib/packageVersion.js.map +1 -1
  118. package/lib/revertibles.d.ts +3 -15
  119. package/lib/revertibles.d.ts.map +1 -1
  120. package/lib/revertibles.js +11 -19
  121. package/lib/revertibles.js.map +1 -1
  122. package/lib/sequence.d.ts +1 -1
  123. package/lib/sequence.d.ts.map +1 -1
  124. package/lib/sequence.js +47 -44
  125. package/lib/sequence.js.map +1 -1
  126. package/lib/sharedIntervalCollection.js +9 -9
  127. package/lib/sharedIntervalCollection.js.map +1 -1
  128. package/lib/sharedSequence.js +6 -6
  129. package/lib/sharedSequence.js.map +1 -1
  130. package/lib/sharedString.d.ts +1 -1
  131. package/lib/sharedString.d.ts.map +1 -1
  132. package/lib/sharedString.js +5 -5
  133. package/lib/sharedString.js.map +1 -1
  134. package/package.json +26 -26
  135. package/src/defaultMapInterfaces.ts +21 -2
  136. package/src/index.ts +3 -0
  137. package/src/intervalCollection.ts +378 -67
  138. package/src/intervalIndex/endpointInRangeIndex.ts +1 -1
  139. package/src/intervalIndex/endpointIndex.ts +1 -2
  140. package/src/intervalIndex/overlappingIntervalsIndex.ts +17 -9
  141. package/src/intervalIndex/startpointInRangeIndex.ts +1 -7
  142. package/src/intervals/interval.ts +33 -8
  143. package/src/intervals/intervalUtils.ts +51 -27
  144. package/src/intervals/sequenceInterval.ts +190 -46
  145. package/src/localValues.ts +4 -1
  146. package/src/packageVersion.ts +1 -1
  147. package/src/revertibles.ts +14 -36
  148. package/src/sequence.ts +4 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,96 @@
1
1
  # @fluidframework/sequence
2
2
 
3
+ ## 2.0.0-internal.7.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - sequence: IntervalCollection.add's intervalType is now deprecated ([#17165](https://github.com/microsoft/FluidFramework/issues/17165)) [a8ea26c9d6](https://github.com/microsoft/FluidFramework/commits/a8ea26c9d61e4938f10c87a8757734f8772fbce6)
8
+
9
+ The `intervalType` parameter is being removed from `IntervalCollection.add`. The new usage requires calling add with an object containing each of the desired parameters.
10
+ Example: `add({start: 0, end: 1, props: { a: b }})`
11
+
12
+ The signature of `IntervalCollection.change` is also being updated to an object containing the desired parameters,
13
+ instead of the existing list of parameters. In addition, `changeProperties` will be removed, so in order to change the
14
+ properties of an interval, the `change` method (with the updated signature) will be used. The id of the interval is not
15
+ included in the object passed to `change`, but is instead passed as the first parameter to `change`.
16
+
17
+ Examples:
18
+
19
+ - Change interval endpoints: `change(intervalId, { start: 3, end: 4 })`
20
+ - Change interval properties: `change(intervalId, { props: { a: c } })`
21
+
22
+ - merge-tree: Deprecate IntervalType.Nest, internedSpaces, RangeStackMap, refGetRangeLabels, refHasRangeLabel, and refHasRangeLabels ([#17555](https://github.com/microsoft/FluidFramework/issues/17555)) [e4c11874ef](https://github.com/microsoft/FluidFramework/commits/e4c11874ef7c62b7cde7c282bc7997519d35fbbc)
23
+
24
+ The following classes and functions have been deprecated. The functionality has poor test coverage and is largely
25
+ unused. They will be removed in a future release.
26
+
27
+ - IntervalType.Nest
28
+ - internedSpaces
29
+ - RangeStackMap
30
+ - refGetRangeLabels
31
+ - refHasRangeLabel
32
+ - refHasRangeLabels
33
+
34
+ ## 2.0.0-internal.7.0.0
35
+
36
+ ### Major Changes
37
+
38
+ - sequence: New API for specifying spatial positioning of intervals [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
39
+
40
+ Previously intervals were specified with only an index. Now the model is a bit more nuanced in that you can specify positions that lie before or after a given index. This makes it more clear how interval endpoints should interact with changes to the sequence. See the docs for SequencePlace for additional context.
41
+
42
+ - sequence: IIntervalCollection.change must specify both endpoints [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
43
+
44
+ IIntervalCollection.change no longer allows an endpoint to be undefined. undefined can unintentionally result in end < start. To adapt to this change, simply use the current position of the endpoint that is not intended to change.
45
+
46
+ - Dependencies on @fluidframework/protocol-definitions package updated to 3.0.0 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
47
+
48
+ This included the following changes from the protocol-definitions release:
49
+
50
+ - Updating signal interfaces for some planned improvements. The intention is split the interface between signals
51
+ submitted by clients to the server and the resulting signals sent from the server to clients.
52
+ - A new optional type member is available on the ISignalMessage interface and a new ISentSignalMessage interface has
53
+ been added, which will be the typing for signals sent from the client to the server. Both extend a new
54
+ ISignalMessageBase interface that contains common members.
55
+ - The @fluidframework/common-definitions package dependency has been updated to version 1.0.0.
56
+
57
+ - Server upgrade: dependencies on Fluid server packages updated to 2.0.1 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
58
+
59
+ Dependencies on the following Fluid server package have been updated to version 2.0.1:
60
+
61
+ - @fluidframework/gitresources: 2.0.1
62
+ - @fluidframework/server-kafka-orderer: 2.0.1
63
+ - @fluidframework/server-lambdas: 2.0.1
64
+ - @fluidframework/server-lambdas-driver: 2.0.1
65
+ - @fluidframework/server-local-server: 2.0.1
66
+ - @fluidframework/server-memory-orderer: 2.0.1
67
+ - @fluidframework/protocol-base: 2.0.1
68
+ - @fluidframework/server-routerlicious: 2.0.1
69
+ - @fluidframework/server-routerlicious-base: 2.0.1
70
+ - @fluidframework/server-services: 2.0.1
71
+ - @fluidframework/server-services-client: 2.0.1
72
+ - @fluidframework/server-services-core: 2.0.1
73
+ - @fluidframework/server-services-ordering-kafkanode: 2.0.1
74
+ - @fluidframework/server-services-ordering-rdkafka: 2.0.1
75
+ - @fluidframework/server-services-ordering-zookeeper: 2.0.1
76
+ - @fluidframework/server-services-shared: 2.0.1
77
+ - @fluidframework/server-services-telemetry: 2.0.1
78
+ - @fluidframework/server-services-utils: 2.0.1
79
+ - @fluidframework/server-test-utils: 2.0.1
80
+ - tinylicious: 2.0.1
81
+
82
+ - Minimum TypeScript version now 5.1.6 [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
83
+
84
+ The minimum supported TypeScript version for Fluid 2.0 clients is now 5.1.6.
85
+
86
+ - sequence: Remove `compareStarts` and `compareEnds` from `IIntervalHelpers` [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
87
+
88
+ These methods are redudant with the functions `IInterval.compareStart` and `IInterval.compareEnd` respectively.
89
+
90
+ - sequence: Remove the mergeTreeUseNewLengthCalculations flag [871b3493dd](https://github.com/microsoft/FluidFramework/commits/871b3493dd0d7ea3a89be64998ceb6cb9021a04e)
91
+
92
+ The `mergeTreeUseNewLengthCalculations` flag has been removed, because the feature was enabled by default in 2.0.0-internal.6.0.0.
93
+
3
94
  ## 2.0.0-internal.6.4.0
4
95
 
5
96
  Dependency updates only.
package/README.md CHANGED
@@ -387,6 +387,132 @@ comments.changeProperties(comment.getIntervalId(), { status: "resolved" });
387
387
  comments.removeIntervalById(comment.getIntervalId());
388
388
  ```
389
389
 
390
+ ### Interval stickiness
391
+
392
+ "Stickiness" refers to the behavior of intervals when text is inserted on either
393
+ side of the interval. A "sticky" interval is one which expands to include text
394
+ inserted directly adjacent to it.
395
+
396
+ A "start sticky" interval is one which expands only to include text inserted to
397
+ the start of it. An "end sticky" interval is the same, but with regard to text
398
+ inserted adjacent to the end.
399
+
400
+ For example, let's look at the string "abc". If we have an interval on the
401
+ character "b", what happens when we insert text on either side of it? In the
402
+ below diagrams, we represent an interval by putting a caret directly underneath
403
+ the characters it contains.
404
+
405
+ #### Example
406
+
407
+ ##### Original string
408
+
409
+ ```typescript
410
+ abc
411
+ ^
412
+ ```
413
+
414
+ ##### No stickiness
415
+
416
+ ```typescript
417
+ aXbYc
418
+ ^
419
+ ```
420
+
421
+ The interval does not expand to include the newly inserted characters `X` and `Y`.
422
+
423
+ ##### Start stickiness
424
+
425
+ ```typescript
426
+ aXbYc
427
+ ^^
428
+ ```
429
+
430
+ ##### End stickiness
431
+
432
+ ```typescript
433
+ aXbYc
434
+ ^^
435
+ ```
436
+
437
+ ##### Full stickiness
438
+
439
+ ```typescript
440
+ aXbYc
441
+ ^^^
442
+ ```
443
+
444
+ #### Concrete Implementation
445
+
446
+ The above is a description of the abstract semantics of the concept of stickiness.
447
+ In practice, this is implemented using the concept of "sides."
448
+
449
+ For a given sequence of N characters, there are 2N + 2 positions which can be
450
+ referenced: the position immediately before and after each character, and two
451
+ special endpoint segments denoting the position before and after the start and
452
+ end of the sequence respectively.
453
+
454
+ By placing the endpoints of an interval either before or after a character, it
455
+ is possible to make the endpoints inclusive or exclusive. An exclusive endpoint
456
+ in a given direction implies stickiness in that direction. Whether an endpoint
457
+ is inclusive or exclusive depends on both the Side and if it is the start or the
458
+ end.
459
+
460
+ Given the string "ABCD":
461
+
462
+ ```typescript
463
+ // Refers to "BC". If any content is inserted before B or after C, this
464
+ // interval will include that content
465
+ //
466
+ // Picture:
467
+ // {start} - A[- B - C -]D - {end}
468
+ // {start} - A - B - C - D - {end}
469
+ collection.add(
470
+ { pos: 0, side: Side.After },
471
+ { pos: 3, side: Side.Before },
472
+ IntervalType.SlideOnRemove,
473
+ );
474
+ // Equivalent to specifying the same positions and Side.Before.
475
+ // Refers to "ABC". Content inserted after C will be included in the
476
+ // interval, but content inserted before A will not.
477
+ // {start} -[A - B - C -]D - {end}
478
+ // {start} - A - B - C - D - {end}
479
+ collection.add(0, 3, IntervalType.SlideOnRemove);
480
+ ```
481
+
482
+ In the case of the first interval shown, if text is deleted,
483
+
484
+ ```typescript
485
+ // Delete the character "B"
486
+ string.removeRange(1, 2);
487
+ ```
488
+
489
+ The start point of the interval will slide to the position immediately before
490
+ "C", and the same will be true.
491
+
492
+ ```typescript
493
+ {start} - A[- C -]D - {end}
494
+ ```
495
+
496
+ In this case, text inserted immediately before "C" would be included in the
497
+ interval.
498
+
499
+ ```typescript
500
+ string.insertText(1, "EFG");
501
+ ```
502
+
503
+ With the string now being,
504
+
505
+ ```typescript
506
+ {start} - A[- E - F - G - C -]D - {end}
507
+ ```
508
+
509
+ Note that the endpoint continues to remain with the associated character, except
510
+ when the character is removed. When content containing endpoints is removed,
511
+ `After` endpoints move backward and `Before` endpoints move forward to maintain their
512
+ side value and inclusive/exclusive behavior.
513
+
514
+ <!-- This line ends the content that is copied to the sequences.md README -->
515
+
390
516
  ## SharedString
391
517
 
392
518
  SharedString is a specialized data structure for handling collaborative text. It is based on a more general
@@ -460,6 +586,8 @@ For further reading on attribution, see the [@fluid-experimental/attributor READ
460
586
 
461
587
  There are plans to make attribution policies more flexible, for example tracking attribution of property changes separately from segment insertion.
462
588
 
589
+ <!-- This line begins the content that is copied to the string.md README -->
590
+
463
591
  ### Examples
464
592
 
465
593
  - Rich Text Editor Implementations
@@ -476,5 +604,7 @@ There are plans to make attribution policies more flexible, for example tracking
476
604
  - [collaborativeTextArea](https://github.com/microsoft/FluidFramework/blob/main/experimental/framework/react-inputs/src/CollaborativeTextArea.tsx)
477
605
  - [collaborativeInput](https://github.com/microsoft/FluidFramework/blob/main/experimental/framework/react-inputs/src/CollaborativeInput.tsx)
478
606
 
607
+ <!-- This line ends the content that is copied to the string.md README -->
608
+
479
609
  [sharedmap]: https://fluidframework.com/docs/data-structures/map/
480
610
  [sharedstring]: https://github.com/microsoft/FluidFramework/blob/main/packages/dds/sequence/src/sharedString.ts
@@ -1,4 +1,19 @@
1
1
  {
2
2
  "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
3
- "extends": "@fluidframework/build-common/api-extractor-common-strict.json"
3
+ "extends": "@fluidframework/build-common/api-extractor-base.json",
4
+
5
+ // Configures how the .d.ts rollup file will be generated.
6
+ "dtsRollup": {
7
+ // This package has a root module named "sequence" which conflicts with the default naming here.
8
+ // TODO: remove this override once the base config has been updated to append `-untrimmed` globally.
9
+ "untrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-untrimmed.d.ts"
10
+ },
11
+ "messages": {
12
+ "extractorMessageReporting": {
13
+ "ae-missing-release-tag": {
14
+ // TODO: Fix violations and remove this rule override
15
+ "logLevel": "none"
16
+ }
17
+ }
18
+ }
4
19
  }