@dxos/react-ui-editor 0.5.9-main.cb71230 → 0.5.9-main.cd3aaf7
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/dist/lib/browser/index.mjs +39 -32
- package/dist/lib/browser/index.mjs.map +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/package.json +25 -25
- package/src/components/TextEditor/TextEditor.stories.tsx +2 -2
- package/src/components/Toolbar/Toolbar.stories.tsx +2 -2
- package/src/extensions/automerge/automerge.stories.tsx +2 -2
|
@@ -477,6 +477,7 @@ import { Annotation as Annotation2, Facet as Facet2, RangeSet } from "@codemirro
|
|
|
477
477
|
import { Decoration as Decoration2, EditorView as EditorView3, ViewPlugin as ViewPlugin2, WidgetType } from "@codemirror/view";
|
|
478
478
|
import { Event } from "@dxos/async";
|
|
479
479
|
import { Context } from "@dxos/context";
|
|
480
|
+
var __dxlog_file2 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/awareness/awareness.ts";
|
|
480
481
|
var dummyProvider = {
|
|
481
482
|
remoteStateChange: new Event(),
|
|
482
483
|
open: () => {
|
|
@@ -503,7 +504,10 @@ var awareness = (provider = dummyProvider) => {
|
|
|
503
504
|
var RemoteSelectionsDecorator = class {
|
|
504
505
|
constructor(view) {
|
|
505
506
|
this.decorations = RangeSet.of([]);
|
|
506
|
-
this._ctx = new Context(
|
|
507
|
+
this._ctx = new Context(void 0, {
|
|
508
|
+
F: __dxlog_file2,
|
|
509
|
+
L: 85
|
|
510
|
+
});
|
|
507
511
|
this._lastAnchor = void 0;
|
|
508
512
|
this._lastHead = void 0;
|
|
509
513
|
this._cursorConverter = view.state.facet(Cursor.converter);
|
|
@@ -712,7 +716,7 @@ import { DeferredTask, Event as Event2, sleep } from "@dxos/async";
|
|
|
712
716
|
import { Context as Context2 } from "@dxos/context";
|
|
713
717
|
import { invariant } from "@dxos/invariant";
|
|
714
718
|
import { log as log2 } from "@dxos/log";
|
|
715
|
-
var
|
|
719
|
+
var __dxlog_file3 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/awareness/awareness-provider.ts";
|
|
716
720
|
var DEBOUNCE_INTERVAL = 100;
|
|
717
721
|
var SpaceAwarenessProvider = class {
|
|
718
722
|
constructor(params) {
|
|
@@ -724,7 +728,10 @@ var SpaceAwarenessProvider = class {
|
|
|
724
728
|
this._info = params.info;
|
|
725
729
|
}
|
|
726
730
|
open() {
|
|
727
|
-
this._ctx = new Context2(
|
|
731
|
+
this._ctx = new Context2(void 0, {
|
|
732
|
+
F: __dxlog_file3,
|
|
733
|
+
L: 57
|
|
734
|
+
});
|
|
728
735
|
this._postTask = new DeferredTask(this._ctx, async () => {
|
|
729
736
|
if (this._localState) {
|
|
730
737
|
await this._space.postMessage(this._channel, {
|
|
@@ -752,7 +759,7 @@ var SpaceAwarenessProvider = class {
|
|
|
752
759
|
log2.debug("failed to query awareness", {
|
|
753
760
|
err
|
|
754
761
|
}, {
|
|
755
|
-
F:
|
|
762
|
+
F: __dxlog_file3,
|
|
756
763
|
L: 89,
|
|
757
764
|
S: this,
|
|
758
765
|
C: (f, a) => f(...a)
|
|
@@ -769,7 +776,7 @@ var SpaceAwarenessProvider = class {
|
|
|
769
776
|
}
|
|
770
777
|
update(position) {
|
|
771
778
|
invariant(this._postTask, void 0, {
|
|
772
|
-
F:
|
|
779
|
+
F: __dxlog_file3,
|
|
773
780
|
L: 104,
|
|
774
781
|
S: this,
|
|
775
782
|
A: [
|
|
@@ -786,7 +793,7 @@ var SpaceAwarenessProvider = class {
|
|
|
786
793
|
}
|
|
787
794
|
_handleQueryMessage() {
|
|
788
795
|
invariant(this._postTask, void 0, {
|
|
789
|
-
F:
|
|
796
|
+
F: __dxlog_file3,
|
|
790
797
|
L: 115,
|
|
791
798
|
S: this,
|
|
792
799
|
A: [
|
|
@@ -798,7 +805,7 @@ var SpaceAwarenessProvider = class {
|
|
|
798
805
|
}
|
|
799
806
|
_handlePostMessage(message) {
|
|
800
807
|
invariant(message.kind === "post", void 0, {
|
|
801
|
-
F:
|
|
808
|
+
F: __dxlog_file3,
|
|
802
809
|
L: 120,
|
|
803
810
|
S: this,
|
|
804
811
|
A: [
|
|
@@ -815,7 +822,7 @@ var SpaceAwarenessProvider = class {
|
|
|
815
822
|
import { EditorView as EditorView4, keymap as keymap2 } from "@codemirror/view";
|
|
816
823
|
import defaultsDeep from "lodash.defaultsdeep";
|
|
817
824
|
import { invariant as invariant2 } from "@dxos/invariant";
|
|
818
|
-
var
|
|
825
|
+
var __dxlog_file4 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/blast.ts";
|
|
819
826
|
var defaultOptions = {
|
|
820
827
|
effect: 2,
|
|
821
828
|
maxParticles: 200,
|
|
@@ -942,7 +949,7 @@ var Blaster = class {
|
|
|
942
949
|
}
|
|
943
950
|
initialize() {
|
|
944
951
|
invariant2(!this._canvas && !this._ctx, void 0, {
|
|
945
|
-
F:
|
|
952
|
+
F: __dxlog_file4,
|
|
946
953
|
L: 141,
|
|
947
954
|
S: this,
|
|
948
955
|
A: [
|
|
@@ -979,7 +986,7 @@ var Blaster = class {
|
|
|
979
986
|
}
|
|
980
987
|
start() {
|
|
981
988
|
invariant2(this._canvas && this._ctx, void 0, {
|
|
982
|
-
F:
|
|
989
|
+
F: __dxlog_file4,
|
|
983
990
|
L: 180,
|
|
984
991
|
S: this,
|
|
985
992
|
A: [
|
|
@@ -1384,13 +1391,13 @@ var editorFillLayoutEditor = "!absolute inset-0";
|
|
|
1384
1391
|
|
|
1385
1392
|
// packages/ui/react-ui-editor/src/util.ts
|
|
1386
1393
|
import { log as log3 } from "@dxos/log";
|
|
1387
|
-
var
|
|
1394
|
+
var __dxlog_file5 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/util.ts";
|
|
1388
1395
|
var callbackWrapper = (fn) => (...args) => {
|
|
1389
1396
|
try {
|
|
1390
1397
|
return fn(...args);
|
|
1391
1398
|
} catch (err) {
|
|
1392
1399
|
log3.catch(err, void 0, {
|
|
1393
|
-
F:
|
|
1400
|
+
F: __dxlog_file5,
|
|
1394
1401
|
L: 18,
|
|
1395
1402
|
S: void 0,
|
|
1396
1403
|
C: (f, a) => f(...a)
|
|
@@ -1416,7 +1423,7 @@ var logChanges = (trs) => {
|
|
|
1416
1423
|
log3.info("changes", {
|
|
1417
1424
|
changes
|
|
1418
1425
|
}, {
|
|
1419
|
-
F:
|
|
1426
|
+
F: __dxlog_file5,
|
|
1420
1427
|
L: 39,
|
|
1421
1428
|
S: void 0,
|
|
1422
1429
|
C: (f, a) => f(...a)
|
|
@@ -1425,7 +1432,7 @@ var logChanges = (trs) => {
|
|
|
1425
1432
|
};
|
|
1426
1433
|
|
|
1427
1434
|
// packages/ui/react-ui-editor/src/extensions/comments.ts
|
|
1428
|
-
var
|
|
1435
|
+
var __dxlog_file6 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/comments.ts";
|
|
1429
1436
|
var documentId = Facet4.define({
|
|
1430
1437
|
combine: (values) => values[0]
|
|
1431
1438
|
});
|
|
@@ -1512,7 +1519,7 @@ var commentsDecorations = EditorView7.decorations.compute([
|
|
|
1512
1519
|
const range = comment.range;
|
|
1513
1520
|
if (!range || range.from === range.to) {
|
|
1514
1521
|
log4.warn("Invalid range:", range, {
|
|
1515
|
-
F:
|
|
1522
|
+
F: __dxlog_file6,
|
|
1516
1523
|
L: 132,
|
|
1517
1524
|
S: void 0,
|
|
1518
1525
|
C: (f, a) => f(...a)
|
|
@@ -1833,11 +1840,11 @@ var useComments = (view, id, comments2) => {
|
|
|
1833
1840
|
// packages/ui/react-ui-editor/src/extensions/doc.ts
|
|
1834
1841
|
import { Facet as Facet5 } from "@codemirror/state";
|
|
1835
1842
|
import { invariant as invariant3 } from "@dxos/invariant";
|
|
1836
|
-
var
|
|
1843
|
+
var __dxlog_file7 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/doc.ts";
|
|
1837
1844
|
var documentId2 = Facet5.define({
|
|
1838
1845
|
combine: (providers) => {
|
|
1839
1846
|
invariant3(providers.length <= 1, void 0, {
|
|
1840
|
-
F:
|
|
1847
|
+
F: __dxlog_file7,
|
|
1841
1848
|
L: 11,
|
|
1842
1849
|
S: void 0,
|
|
1843
1850
|
A: [
|
|
@@ -2142,7 +2149,7 @@ var defaultTheme = {
|
|
|
2142
2149
|
};
|
|
2143
2150
|
|
|
2144
2151
|
// packages/ui/react-ui-editor/src/extensions/factories.ts
|
|
2145
|
-
var
|
|
2152
|
+
var __dxlog_file8 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/factories.ts";
|
|
2146
2153
|
var defaultBasicOptions = {
|
|
2147
2154
|
allowMultipleSelections: true,
|
|
2148
2155
|
bracketMatching: true,
|
|
@@ -2166,7 +2173,7 @@ var createBasicExtensions = (_props) => {
|
|
|
2166
2173
|
// NOTE: Doesn't catch errors in keymap functions.
|
|
2167
2174
|
EditorView9.exceptionSink.of((err) => {
|
|
2168
2175
|
log5.catch(err, void 0, {
|
|
2169
|
-
F:
|
|
2176
|
+
F: __dxlog_file8,
|
|
2170
2177
|
L: 90,
|
|
2171
2178
|
S: void 0,
|
|
2172
2179
|
C: (f, a) => f(...a)
|
|
@@ -4181,7 +4188,7 @@ var TableWidget = class extends WidgetType5 {
|
|
|
4181
4188
|
// packages/ui/react-ui-editor/src/extensions/mention.ts
|
|
4182
4189
|
import { autocompletion as autocompletion2 } from "@codemirror/autocomplete";
|
|
4183
4190
|
import { log as log6 } from "@dxos/log";
|
|
4184
|
-
var
|
|
4191
|
+
var __dxlog_file9 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/mention.ts";
|
|
4185
4192
|
var mention = ({ onSearch }) => {
|
|
4186
4193
|
return autocompletion2({
|
|
4187
4194
|
// TODO(burdon): Not working.
|
|
@@ -4196,7 +4203,7 @@ var mention = ({ onSearch }) => {
|
|
|
4196
4203
|
log6.info("completion context", {
|
|
4197
4204
|
context
|
|
4198
4205
|
}, {
|
|
4199
|
-
F:
|
|
4206
|
+
F: __dxlog_file9,
|
|
4200
4207
|
L: 26,
|
|
4201
4208
|
S: void 0,
|
|
4202
4209
|
C: (f, a) => f(...a)
|
|
@@ -4261,13 +4268,13 @@ import { EditorView as EditorView15, keymap as keymap9 } from "@codemirror/view"
|
|
|
4261
4268
|
import { debounce as debounce2 } from "@dxos/async";
|
|
4262
4269
|
import { invariant as invariant4 } from "@dxos/invariant";
|
|
4263
4270
|
import { isNotFalsy as isNotFalsy3 } from "@dxos/util";
|
|
4264
|
-
var
|
|
4271
|
+
var __dxlog_file10 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/extensions/state.ts";
|
|
4265
4272
|
var scrollAnnotation = "dxos.org/cm/scrolling";
|
|
4266
4273
|
var keyPrefix = "dxos.org/react-ui-editor/state";
|
|
4267
4274
|
var localStorageStateStoreAdapter = {
|
|
4268
4275
|
setState: (id, state2) => {
|
|
4269
4276
|
invariant4(id, void 0, {
|
|
4270
|
-
F:
|
|
4277
|
+
F: __dxlog_file10,
|
|
4271
4278
|
L: 35,
|
|
4272
4279
|
S: void 0,
|
|
4273
4280
|
A: [
|
|
@@ -4279,7 +4286,7 @@ var localStorageStateStoreAdapter = {
|
|
|
4279
4286
|
},
|
|
4280
4287
|
getState: (id) => {
|
|
4281
4288
|
invariant4(id, void 0, {
|
|
4282
|
-
F:
|
|
4289
|
+
F: __dxlog_file10,
|
|
4283
4290
|
L: 39,
|
|
4284
4291
|
S: void 0,
|
|
4285
4292
|
A: [
|
|
@@ -4400,7 +4407,7 @@ var typewriter = ({ delay = 75, items = defaultItems } = {}) => {
|
|
|
4400
4407
|
};
|
|
4401
4408
|
|
|
4402
4409
|
// packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx
|
|
4403
|
-
var
|
|
4410
|
+
var __dxlog_file11 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/components/TextEditor/TextEditor.tsx";
|
|
4404
4411
|
var instanceCount = 0;
|
|
4405
4412
|
var TextEditor = /* @__PURE__ */ forwardRef(({
|
|
4406
4413
|
id,
|
|
@@ -4440,7 +4447,7 @@ var TextEditor = /* @__PURE__ */ forwardRef(({
|
|
|
4440
4447
|
id,
|
|
4441
4448
|
instanceId
|
|
4442
4449
|
}, {
|
|
4443
|
-
F:
|
|
4450
|
+
F: __dxlog_file11,
|
|
4444
4451
|
L: 91,
|
|
4445
4452
|
S: void 0,
|
|
4446
4453
|
C: (f, a) => f(...a)
|
|
@@ -4452,7 +4459,7 @@ var TextEditor = /* @__PURE__ */ forwardRef(({
|
|
|
4452
4459
|
// TODO(burdon): NOTE: Doesn't catch errors in keymap functions.
|
|
4453
4460
|
EditorView16.exceptionSink.of((err) => {
|
|
4454
4461
|
log7.catch(err, void 0, {
|
|
4455
|
-
F:
|
|
4462
|
+
F: __dxlog_file11,
|
|
4456
4463
|
L: 104,
|
|
4457
4464
|
S: void 0,
|
|
4458
4465
|
C: (f, a) => f(...a)
|
|
@@ -4499,7 +4506,7 @@ var TextEditor = /* @__PURE__ */ forwardRef(({
|
|
|
4499
4506
|
id,
|
|
4500
4507
|
instanceId
|
|
4501
4508
|
}, {
|
|
4502
|
-
F:
|
|
4509
|
+
F: __dxlog_file11,
|
|
4503
4510
|
L: 153,
|
|
4504
4511
|
S: void 0,
|
|
4505
4512
|
C: (f, a) => f(...a)
|
|
@@ -4856,7 +4863,7 @@ import { useFocusableGroup as useFocusableGroup2 } from "@fluentui/react-tabster
|
|
|
4856
4863
|
import { useCallback as useCallback2, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
|
|
4857
4864
|
import { log as log8 } from "@dxos/log";
|
|
4858
4865
|
import { isNotFalsy as isNotFalsy5 } from "@dxos/util";
|
|
4859
|
-
var
|
|
4866
|
+
var __dxlog_file12 = "/home/runner/work/dxos/dxos/packages/ui/react-ui-editor/src/hooks/useTextEditor.ts";
|
|
4860
4867
|
var useTextEditor = (cb = () => ({}), deps = []) => {
|
|
4861
4868
|
let { id, doc, selection, extensions, autoFocus, scrollTo, debug } = useMemo2(cb, deps ?? []);
|
|
4862
4869
|
const onUpdate = useRef3();
|
|
@@ -4868,7 +4875,7 @@ var useTextEditor = (cb = () => ({}), deps = []) => {
|
|
|
4868
4875
|
log8("create", {
|
|
4869
4876
|
id
|
|
4870
4877
|
}, {
|
|
4871
|
-
F:
|
|
4878
|
+
F: __dxlog_file12,
|
|
4872
4879
|
L: 50,
|
|
4873
4880
|
S: void 0,
|
|
4874
4881
|
C: (f, a) => f(...a)
|
|
@@ -4880,7 +4887,7 @@ var useTextEditor = (cb = () => ({}), deps = []) => {
|
|
|
4880
4887
|
// TODO(burdon): Doesn't catch errors in keymap functions.
|
|
4881
4888
|
EditorView17.exceptionSink.of((err) => {
|
|
4882
4889
|
log8.catch(err, void 0, {
|
|
4883
|
-
F:
|
|
4890
|
+
F: __dxlog_file12,
|
|
4884
4891
|
L: 60,
|
|
4885
4892
|
S: void 0,
|
|
4886
4893
|
C: (f, a) => f(...a)
|
|
@@ -4911,7 +4918,7 @@ var useTextEditor = (cb = () => ({}), deps = []) => {
|
|
|
4911
4918
|
log8("destroy", {
|
|
4912
4919
|
id
|
|
4913
4920
|
}, {
|
|
4914
|
-
F:
|
|
4921
|
+
F: __dxlog_file12,
|
|
4915
4922
|
L: 88,
|
|
4916
4923
|
S: void 0,
|
|
4917
4924
|
C: (f, a) => f(...a)
|