@marimo-team/islands 0.25.3-dev206 → 0.25.3-dev207
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/{ConnectedDataExplorerComponent-DFynurqb.js → ConnectedDataExplorerComponent-ApTYh0V3.js} +4 -4
- package/dist/{ErrorBoundary-DZyGV5dX.js → ErrorBoundary-DV6q3WpD.js} +2 -2
- package/dist/{abnfDiagram-VCTEODGH-DGkUyNdz.js → abnfDiagram-VCTEODGH-uo9xhZY0.js} +2 -2
- package/dist/{architectureDiagram-5GKGNRK7-Bav9J7uF.js → architectureDiagram-5GKGNRK7-Hz6eyeOD.js} +1 -1
- package/dist/assets/__vite-browser-external-CBRgnYY0.js +1 -0
- package/dist/assets/{worker-DodjWT_Z.js → worker-DiPNP__U.js} +2 -2
- package/dist/{chat-ui-Dorq26Pp.js → chat-ui-BTA1I5i1.js} +7 -7
- package/dist/{chunk-IMKFNOWR-1UCTsTqh.js → chunk-IMKFNOWR-DBM2i23k.js} +1 -1
- package/dist/{chunk-SHT3W25Y-Bige_rTb.js → chunk-SHT3W25Y-L8KQLLBy.js} +1 -1
- package/dist/{chunk-SVP7TREG-Cmr0Anfb.js → chunk-SVP7TREG-BOUJKJEP.js} +1 -1
- package/dist/{chunk-TICWLB2K-IWykFldb.js → chunk-TICWLB2K-DY3CzFjX.js} +1 -1
- package/dist/{classDiagram-ZZMXUADV-BH73ECRQ.js → classDiagram-ZZMXUADV-s9iwW-q4.js} +2 -2
- package/dist/{classDiagram-v2-VYDZK3BY-CCuCgq0H.js → classDiagram-v2-VYDZK3BY-2GI5CjGB.js} +2 -2
- package/dist/{code-visibility-CFFYYeyU.js → code-visibility-DLj8SFEM.js} +4 -4
- package/dist/{common-B9xea2wZ.js → common-BEiP9-YB.js} +9 -9
- package/dist/{cynefinDiagram-5FMLGOSQ-CWtL7MIJ.js → cynefinDiagram-5FMLGOSQ-DOxnhBK2.js} +1 -1
- package/dist/{dagre-GXQ25YYZ-DsVO2pVC.js → dagre-GXQ25YYZ-D1AhEfpM.js} +1 -1
- package/dist/{data-grid-overlay-editor-De3J2jxB.js → data-grid-overlay-editor-Bt6VgNDi.js} +1 -1
- package/dist/{diagram-S7CK7UJ4-BuAktgZv.js → diagram-S7CK7UJ4-DV_GebF_.js} +1 -1
- package/dist/{diagram-UQ7AKVKN-DlkAXHu5.js → diagram-UQ7AKVKN-6dNzGFfD.js} +1 -1
- package/dist/{diagram-VX7I27RA-B9U9H0E8.js → diagram-VX7I27RA-DUh9jsfi.js} +1 -1
- package/dist/{diagram-Z3DM3KII-BqmfxzUL.js → diagram-Z3DM3KII-Cug-qcQ8.js} +1 -1
- package/dist/{dropdown-menu-BFQYzWmC.js → dropdown-menu-dlEm41Bt.js} +1 -1
- package/dist/{ebnfDiagram-PWID7BFC-CH5t8ATi.js → ebnfDiagram-PWID7BFC-d5LKx7Vb.js} +2 -2
- package/dist/{erDiagram-RLTQ6QDP-DdIo2BIb.js → erDiagram-RLTQ6QDP-BwvlkcID.js} +1 -1
- package/dist/{error-entries-B0bcEwXm.js → error-entries-CVUHA5r_.js} +3875 -3884
- package/dist/{feedback-button-DXpmx6ff.js → feedback-button-Dd87gzc6.js} +5 -5
- package/dist/{flowDiagram-HODETNUW-BmYk_-Na.js → flowDiagram-HODETNUW-CJcSoFer.js} +2 -2
- package/dist/{formats-DyYnckF5.js → formats-Ry7c-aIV.js} +1 -1
- package/dist/{glide-data-editor-BevQ8Zdz.js → glide-data-editor-CW4LOU-D.js} +5 -5
- package/dist/{globals-Beuc24As.js → globals-D3AhIN1i.js} +2 -2
- package/dist/{html-to-image-BOd7ryZJ.js → html-to-image--E3uFbJ9.js} +5 -5
- package/dist/{infoDiagram-27XIBGKW-DvYh-Sbk.js → infoDiagram-27XIBGKW-Cezgppw3.js} +1 -1
- package/dist/{ishikawaDiagram-5VMMS53U-BdHnYq8s.js → ishikawaDiagram-5VMMS53U-BahZQwJz.js} +1 -1
- package/dist/{kanban-definition-UXKFOSKX-Bf8CT_tU.js → kanban-definition-UXKFOSKX-Cvfn_Obm.js} +1 -1
- package/dist/main.js +22 -22
- package/dist/{mermaid-DBpOnw8c.js → mermaid-BrdwbArF.js} +34 -34
- package/dist/{mindmap-definition-YA3MSWOX-DkYG8ltR.js → mindmap-definition-YA3MSWOX-uB4B2d-J.js} +1 -1
- package/dist/{number-overlay-editor-DX_x9WUo.js → number-overlay-editor-klVnf90Q.js} +1 -1
- package/dist/{pegDiagram-XKGWAZYB-DM7BQ0ip.js → pegDiagram-XKGWAZYB-CYaIwAmH.js} +2 -2
- package/dist/{pieDiagram-E7YTZNPT-CPFGg4YS.js → pieDiagram-E7YTZNPT-BJ1oUxVv.js} +1 -1
- package/dist/{process-output-8BbxxGrz.js → process-output-SjJxB1wh.js} +2 -2
- package/dist/{railroadDiagram-O6MQD6OU-4rUJlIpQ.js → railroadDiagram-O6MQD6OU-BqKSaBux.js} +2 -2
- package/dist/{requirementDiagram-BXWQKSXE-F6ffUUQC.js → requirementDiagram-BXWQKSXE-DwFhgDhH.js} +1 -1
- package/dist/{reveal-component-BMw2TipA.js → reveal-component-CS16WNwA.js} +6 -6
- package/dist/{sequenceDiagram-WJ2MYXX4-tNU95HVS.js → sequenceDiagram-WJ2MYXX4-L7ENjfKF.js} +1 -1
- package/dist/{spec-Alkla7dB.js → spec-BcJ9ncAY.js} +1 -1
- package/dist/{stateDiagram-D77RDMKH-BA8Modqv.js → stateDiagram-D77RDMKH-CVf88u-p.js} +2 -2
- package/dist/{stateDiagram-v2-MP3YSRHH-CFmickht.js → stateDiagram-v2-MP3YSRHH-DvpkQ1V6.js} +2 -2
- package/dist/style.css +1 -1
- package/dist/{swimlanes-42K2YHIH-DBiYZZZc.js → swimlanes-42K2YHIH-DIuFHbVE.js} +1 -1
- package/dist/{swimlanesDiagram-VR7AAH4N-CsgR851k.js → swimlanesDiagram-VR7AAH4N-CAqHAziW.js} +2 -2
- package/dist/{timeline-definition-24CTP7MA-Dfj0CMXY.js → timeline-definition-24CTP7MA-xO4EQqBm.js} +1 -1
- package/dist/{toDate-B0-Y0SEW.js → toDate-BZZ64K_m.js} +1 -5
- package/dist/{useAsyncData-Phxf6GCd.js → useAsyncData-Dqw22wZQ.js} +1 -1
- package/dist/{useDeepCompareMemoize-BXv7DUcU.js → useDeepCompareMemoize-D3gozcjJ.js} +1 -1
- package/dist/{useLifecycle-DDDsO4O2.js → useLifecycle-CaZi4wTw.js} +1 -1
- package/dist/{useTheme-DbBkeP6Z.js → useTheme-TzPgWXwB.js} +1 -4
- package/dist/{vega-component-C_dhEynE.js → vega-component-Blvspl7v.js} +5 -5
- package/dist/{vennDiagram-4TSXK5OY-fJ83Z7FE.js → vennDiagram-4TSXK5OY-DzCi-lRh.js} +1 -1
- package/dist/{wardleyDiagram-VM6X3IG4-DbO9cD15.js → wardleyDiagram-VM6X3IG4-CW48xa0n.js} +1 -1
- package/dist/{xychartDiagram-S5SC5T6Z-DmsdQJG7.js → xychartDiagram-S5SC5T6Z-UPxGGI2B.js} +1 -1
- package/package.json +2 -6
- package/src/components/app-config/user-config-form.tsx +0 -26
- package/src/components/editor/cell/code/cell-editor.tsx +11 -100
- package/src/components/editor/chrome/wrapper/footer.tsx +0 -2
- package/src/core/cells/__tests__/document.test.ts +0 -18
- package/src/core/cells/document.ts +6 -9
- package/src/core/codemirror/cells/__tests__/extensions.test.ts +1 -46
- package/src/core/codemirror/cells/extensions.ts +1 -19
- package/src/core/config/config-schema.ts +0 -1
- package/src/core/config/feature-flag.tsx +0 -2
- package/src/core/runtime/__tests__/runtime.test.ts +0 -16
- package/src/core/runtime/runtime.ts +0 -8
- package/src/css/app/codemirror.css +1 -1
- package/dist/assets/__vite-browser-external-BCJsx8QS.js +0 -1
- package/src/components/editor/cell/code/__tests__/rtc-editor-config.test.ts +0 -50
- package/src/components/editor/chrome/wrapper/footer-items/rtc-status.tsx +0 -65
- package/src/core/codemirror/rtc/extension.ts +0 -464
- package/src/core/codemirror/rtc/loro/__tests__/sync.test.ts +0 -52
- package/src/core/codemirror/rtc/loro/awareness.ts +0 -546
- package/src/core/codemirror/rtc/loro/colors.ts +0 -38
- package/src/core/codemirror/rtc/loro/sync.ts +0 -169
- package/src/core/rtc/state.ts +0 -34
|
@@ -1,169 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
|
|
3
|
-
// Vendored from https://github.com/loro-dev/loro-codemirror/blob/main/src/index.ts
|
|
4
|
-
// and adapted to support:
|
|
5
|
-
// - custom `getTextFromDoc`
|
|
6
|
-
// - filter diffs by path
|
|
7
|
-
|
|
8
|
-
import type { Extension } from "@codemirror/state";
|
|
9
|
-
import { Annotation, type ChangeSpec } from "@codemirror/state";
|
|
10
|
-
import type { EditorView, PluginValue, ViewUpdate } from "@codemirror/view";
|
|
11
|
-
import { ViewPlugin } from "@codemirror/view";
|
|
12
|
-
import type {
|
|
13
|
-
LoroDoc,
|
|
14
|
-
LoroEventBatch,
|
|
15
|
-
LoroText,
|
|
16
|
-
Subscription,
|
|
17
|
-
} from "loro-crdt";
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* It is used to sync the document with the remote users.
|
|
21
|
-
*
|
|
22
|
-
* @param doc - LoroDoc instance
|
|
23
|
-
* @returns Extension
|
|
24
|
-
*/
|
|
25
|
-
export const loroSyncPlugin = (
|
|
26
|
-
doc: LoroDoc,
|
|
27
|
-
docPath: string[],
|
|
28
|
-
getTextFromDoc: (doc: LoroDoc) => LoroText,
|
|
29
|
-
): Extension => {
|
|
30
|
-
return ViewPlugin.define(
|
|
31
|
-
(view) => new LoroSyncPluginValue(view, doc, docPath, getTextFromDoc),
|
|
32
|
-
);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Annotation to identify loro sync changes (syncing from remote to local)
|
|
37
|
-
*/
|
|
38
|
-
export const loroSyncAnnotation = Annotation.define();
|
|
39
|
-
|
|
40
|
-
export class LoroSyncPluginValue implements PluginValue {
|
|
41
|
-
public sub?: Subscription;
|
|
42
|
-
private isInitDispatch = false;
|
|
43
|
-
private view: EditorView;
|
|
44
|
-
private doc: LoroDoc;
|
|
45
|
-
private docPath: string[];
|
|
46
|
-
private getTextFromDoc: (doc: LoroDoc) => LoroText;
|
|
47
|
-
|
|
48
|
-
public constructor(
|
|
49
|
-
view: EditorView,
|
|
50
|
-
doc: LoroDoc,
|
|
51
|
-
docPath: string[],
|
|
52
|
-
getTextFromDoc: (doc: LoroDoc) => LoroText,
|
|
53
|
-
) {
|
|
54
|
-
this.view = view;
|
|
55
|
-
this.doc = doc;
|
|
56
|
-
this.docPath = docPath;
|
|
57
|
-
this.getTextFromDoc = getTextFromDoc;
|
|
58
|
-
this.sub = doc.subscribe(this.onRemoteUpdate);
|
|
59
|
-
Promise.resolve().then(() => {
|
|
60
|
-
this.isInitDispatch = true;
|
|
61
|
-
const currentText = this.view.state.doc.toString();
|
|
62
|
-
const text = this.getTextFromDoc(this.doc);
|
|
63
|
-
|
|
64
|
-
if (currentText === text.toString()) {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
view.dispatch({
|
|
68
|
-
changes: [
|
|
69
|
-
{
|
|
70
|
-
from: 0,
|
|
71
|
-
to: this.view.state.doc.length,
|
|
72
|
-
insert: text.toString(),
|
|
73
|
-
},
|
|
74
|
-
],
|
|
75
|
-
annotations: [loroSyncAnnotation.of(this)],
|
|
76
|
-
});
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
public onRemoteUpdate = (e: LoroEventBatch) => {
|
|
81
|
-
if (e.by === "local") {
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (e.by === "checkout") {
|
|
85
|
-
// TODO: better handle checkout
|
|
86
|
-
this.view.dispatch({
|
|
87
|
-
changes: [
|
|
88
|
-
{
|
|
89
|
-
from: 0,
|
|
90
|
-
to: this.view.state.doc.length,
|
|
91
|
-
insert: this.getTextFromDoc(this.doc).toString(),
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
annotations: [loroSyncAnnotation.of(this)],
|
|
95
|
-
});
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
if (e.by === "import") {
|
|
99
|
-
const changes: ChangeSpec[] = [];
|
|
100
|
-
let pos = 0;
|
|
101
|
-
for (const { diff, path } of e.events) {
|
|
102
|
-
if (path.join("/") !== this.docPath.join("/")) {
|
|
103
|
-
continue;
|
|
104
|
-
}
|
|
105
|
-
if (diff.type !== "text") {
|
|
106
|
-
continue;
|
|
107
|
-
}
|
|
108
|
-
const textDiff = diff.diff;
|
|
109
|
-
for (const delta of textDiff) {
|
|
110
|
-
if (delta.insert) {
|
|
111
|
-
changes.push({
|
|
112
|
-
from: pos,
|
|
113
|
-
to: pos,
|
|
114
|
-
insert: delta.insert,
|
|
115
|
-
});
|
|
116
|
-
} else if (delta.delete) {
|
|
117
|
-
changes.push({
|
|
118
|
-
from: pos,
|
|
119
|
-
to: pos + delta.delete,
|
|
120
|
-
});
|
|
121
|
-
pos += delta.delete;
|
|
122
|
-
} else if (delta.retain != null) {
|
|
123
|
-
pos += delta.retain;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
if (changes.length > 0) {
|
|
127
|
-
this.view.dispatch({
|
|
128
|
-
changes,
|
|
129
|
-
annotations: [loroSyncAnnotation.of(this)],
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
public update(update: ViewUpdate): void {
|
|
137
|
-
if (this.isInitDispatch) {
|
|
138
|
-
this.isInitDispatch = false;
|
|
139
|
-
return;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
if (
|
|
143
|
-
!update.docChanged ||
|
|
144
|
-
(update.transactions.length > 0 &&
|
|
145
|
-
(update.transactions[0].annotation(loroSyncAnnotation) === this ||
|
|
146
|
-
update.transactions[0].annotation(loroSyncAnnotation) === "undo"))
|
|
147
|
-
) {
|
|
148
|
-
return;
|
|
149
|
-
}
|
|
150
|
-
let adj = 0;
|
|
151
|
-
// oxlint-disable-next-line marimo/prefer-object-params -- CodeMirror supplies positional change ranges and inserted text.
|
|
152
|
-
update.changes.iterChanges((fromA, toA, fromB, toB, insert) => {
|
|
153
|
-
const insertText = insert.sliceString(0, insert.length, "\n");
|
|
154
|
-
if (fromA !== toA) {
|
|
155
|
-
this.getTextFromDoc(this.doc).delete(fromA + adj, toA - fromA);
|
|
156
|
-
}
|
|
157
|
-
if (insertText.length > 0) {
|
|
158
|
-
this.getTextFromDoc(this.doc).insert(fromA + adj, insertText);
|
|
159
|
-
}
|
|
160
|
-
adj += insertText.length - (toA - fromA);
|
|
161
|
-
});
|
|
162
|
-
this.doc.commit();
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
public destroy(): void {
|
|
166
|
-
this.sub?.();
|
|
167
|
-
this.sub = undefined;
|
|
168
|
-
}
|
|
169
|
-
}
|
package/src/core/rtc/state.ts
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
/* Copyright 2026 Marimo. All rights reserved. */
|
|
2
|
-
import { atomWithStorage } from "jotai/utils";
|
|
3
|
-
import { SCRATCH_CELL_ID, type CellId } from "@/core/cells/ids";
|
|
4
|
-
import { once } from "@/utils/once";
|
|
5
|
-
import { jotaiJsonStorage } from "@/utils/storage/jotai";
|
|
6
|
-
import { getFeatureFlag } from "../config/feature-flag";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* The username for the current user when using real-time collaboration.
|
|
10
|
-
* This is stored in localStorage.
|
|
11
|
-
*/
|
|
12
|
-
export const usernameAtom = atomWithStorage<string>(
|
|
13
|
-
"marimo:rtc:username",
|
|
14
|
-
"",
|
|
15
|
-
jotaiJsonStorage,
|
|
16
|
-
);
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Whether RTC is enabled.
|
|
20
|
-
*
|
|
21
|
-
* This is cached on page-load because this UI can get into
|
|
22
|
-
* weird states, so we require a page reload to take effect.
|
|
23
|
-
*/
|
|
24
|
-
export const isRtcEnabled = once(() => {
|
|
25
|
-
return getFeatureFlag("rtc_v2");
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Whether this cell type can participate in real-time collaboration.
|
|
30
|
-
* Scratchpad cells are local-only.
|
|
31
|
-
*/
|
|
32
|
-
export function canUseRtc(cellId: CellId): boolean {
|
|
33
|
-
return cellId !== SCRATCH_CELL_ID;
|
|
34
|
-
}
|