Skip to content

Commit 6eaaa1c

Browse files
committed
mostly trying to get react-draggable to work with react19 -- nope.
1 parent 0c16783 commit 6eaaa1c

File tree

14 files changed

+59
-60
lines changed

14 files changed

+59
-60
lines changed

src/packages/frontend/components/data-grid/headings.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export function ColumnHeading({
8181

8282
function ResizeHandle({ setWidth, width, ignoreClick }) {
8383
const [pos, setPos] = useState<any>(undefined);
84-
const nodeRef = useRef<any>(null);
84+
const nodeRef = useRef<any>({});
8585
return (
8686
<Draggable
8787
nodeRef={nodeRef}

src/packages/frontend/editors/slate/elements/code-block/mermaid.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,14 +61,15 @@ export default function Mermaid({ value, style }: Props) {
6161
);
6262
}
6363

64-
let initialized = false;
65-
async function getMermaid() {
66-
const mermaid = (await import("mermaid")).default;
67-
if (!initialized) {
68-
mermaid.initialize({
69-
startOnLoad: false,
70-
});
71-
initialized = true;
72-
}
73-
return mermaid;
64+
//let initialized = false;
65+
async function getMermaid() : Promise<any> {
66+
throw Error("mermaid js support disabled");
67+
// //const mermaid = (await import("mermaid")).default;
68+
// if (!initialized) {
69+
// mermaid.initialize({
70+
// startOnLoad: false,
71+
// });
72+
// initialized = true;
73+
// }
74+
// return mermaid;
7475
}

src/packages/frontend/frame-editors/crm-editor/fields/tag-by-id.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface Props {
1010
}
1111

1212
export function TagById({ id, onClose, confirm, Draggable }: Props) {
13-
const nodeRef = useRef<any>(null);
13+
const nodeRef = useRef<any>({});
1414
const tags = useTags();
1515
const tag = useMemo(() => {
1616
return tags?.[id];

src/packages/frontend/frame-editors/crm-editor/views/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ export default function Views({ table, style }: Props) {
304304
}
305305

306306
function ResizeBar({ setWidth, width }) {
307-
const nodeRef = useRef<any>(null);
307+
const nodeRef = useRef<any>({});
308308
return (
309309
<Draggable
310310
nodeRef={nodeRef}

src/packages/frontend/frame-editors/frame-tree/frame-tree-drag-bar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ export const FrameTreeDragBar: React.FC<Props> = React.memo((props: Props) => {
114114
}
115115
}
116116

117-
const nodeRef = React.useRef<any>(null);
117+
const nodeRef = React.useRef<any>({});
118118

119119
return (
120120
<Draggable

src/packages/frontend/frame-editors/whiteboard-editor/canvas.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ export default function Canvas({
346346
},
347347
);
348348

349-
const nodeRef = useRef<any>(null);
349+
const nodeRef = useRef<any>({});
350350
const innerCanvasRef = useRef<any>(null);
351351

352352
const transformsRef = useRef<Transforms>(

src/packages/frontend/frame-editors/whiteboard-editor/focused-resize.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export default function DragHandle({
4242
element: Element;
4343
selectedElements: Element[];
4444
}) {
45-
const nodeRef = useRef<any>(null);
45+
const nodeRef = useRef<any>({});
4646
const [position, setPosition] = useState<{ x: number; y: number }>({
4747
x: 0,
4848
y: 0,

src/packages/frontend/frame-editors/whiteboard-editor/focused.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export default function Focused({
8787
dragging || offset.x || offset.y || offset.w || offset.h || rotating;
8888
const locked = isLocked(selectedElements);
8989
const hidden = isHidden(selectedElements);
90-
const nodeRef = useRef<any>(null);
90+
const nodeRef = useRef<any>({});
9191

9292
// Make it so the selected element can handle it's own mouse wheel events.
9393
const divRef = useRef<any>(null);

src/packages/frontend/frame-editors/whiteboard-editor/not-focused.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default function NotFocused({
2727
onDrag,
2828
}: Props) {
2929
const { id } = element;
30-
const nodeRef = useRef<any>(null);
30+
const nodeRef = useRef<any>({});
3131

3232
// Right after dragging, we ignore the onClick so the object doesn't get selected:
3333
const ignoreNextClickRef = useRef<boolean>(false);

src/packages/frontend/frame-editors/whiteboard-editor/tools/navigation.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ export function Overview({
298298
maxScale,
299299
presentation,
300300
}: MapProps) {
301-
const nodeRef = useRef<any>(null);
301+
const nodeRef = useRef<any>({});
302302
const { id, actions } = useFrameContext();
303303
const { xMin, yMin, xMax, yMax } = getPageSpan(elements, 1, presentation);
304304
const xDiff = xMax - xMin + 2 * margin;

src/packages/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@
116116
"markdown-it-front-matter": "^0.2.3",
117117
"md5": "^2",
118118
"memoize-one": "^5.1.1",
119-
"mermaid": "^11.4.1",
119+
"mermaid": "^11.7.0",
120120
"node-forge": "^1.0.0",
121121
"onecolor": "^3.1.0",
122122
"pdfjs-dist": "^4.6.82",

src/packages/frontend/project/page/content.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,7 @@ interface DragBarProps {
327327

328328
const DragBar: React.FC<DragBarProps> = (props: DragBarProps) => {
329329
const { project_id, path, editor_container_ref } = props;
330-
const nodeRef = useRef<any>(null);
330+
const nodeRef = useRef<any>({});
331331
const draggable_ref = useRef<any>(null);
332332

333333
const reset = () => {

src/packages/hub/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@
5656
"preinstall": "npx only-allow pnpm",
5757
"clean": "rm -rf node_modules dist",
5858
"build": "tsc && coffee -m -c -o dist/ .",
59-
"hub-project-dev-nobuild": "unset DATA COCALC_ROOT && export DEBUG=${DEBUG:='cocalc:*,-cocalc:silly:*'} && export PGHOST=${PGHOST:=`realpath $INIT_CWD/../../data/postgres/socket`} && unset TURBOPACK && PGUSER='smc' NODE_ENV=${NODE_ENV:=development} NODE_OPTIONS='--max_old_space_size=8000 --trace-warnings --enable-source-maps --inspect' cocalc-hub-server --mode=single-user --all --hostname=0.0.0.0",
59+
"hub-project-dev-nobuild": "unset DATA COCALC_ROOT && export DEBUG=${DEBUG:='cocalc:*,-cocalc:silly:*'} && export PGHOST=${PGHOST:=`realpath $INIT_CWD/../../data/postgres/socket`} && PGUSER='smc' NODE_ENV=${NODE_ENV:=development} NODE_OPTIONS='--max_old_space_size=8000 --trace-warnings --enable-source-maps --inspect' cocalc-hub-server --mode=single-user --all --hostname=0.0.0.0",
6060
"hub-personal": "unset DATA COCALC_ROOT && export DEBUG=${DEBUG:='cocalc:*,-cocalc:silly:*'} && export PGHOST=${PGHOST:=`realpath $INIT_CWD/../../data/postgres/socket`} && PGUSER='smc' NODE_ENV=${NODE_ENV:=development} NODE_OPTIONS='--max_old_space_size=8000 --trace-warnings --enable-source-maps --inspect' cocalc-hub-server --mode=single-user --all --hostname=0.0.0.0 --personal",
6161
"hub-project-dev": "pnpm build && NODE_OPTIONS='--inspect' pnpm hub-project-dev-nobuild",
6262
"hub-project-prod-nobuild": "unset DATA COCALC_ROOT && export DEBUG=${DEBUG:='cocalc:*,-cocalc:silly:*'} && export PGHOST=${PGHOST:=`realpath $INIT_CWD/../../data/postgres/socket`} && PGUSER='smc' NODE_ENV=production NODE_OPTIONS='--max_old_space_size=8000 --enable-source-maps' cocalc-hub-server --mode=single-user --all --hostname=0.0.0.0",

src/packages/pnpm-lock.yaml

Lines changed: 36 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)