Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
eriksson-daniel committed Jan 8, 2025
1 parent 3735620 commit 070db97
Show file tree
Hide file tree
Showing 16 changed files with 58 additions and 60 deletions.
Binary file modified frontend/bun.lockb
Binary file not shown.
56 changes: 28 additions & 28 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,60 +13,60 @@
"license": "MIT",
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@happy-dom/global-registrator": "15.11.7",
"@happy-dom/global-registrator": "16.5.2",
"@testing-library/dom": "10.4.0",
"@testing-library/jest-dom": "6.6.3",
"@testing-library/react": "16.1.0",
"@types/bun": "1.1.14",
"@types/react": "19.0.1",
"@types/bun": "1.1.15",
"@types/react": "19.0.3",
"@types/react-dom": "19.0.2",
"@types/react-redux": "7.1.34",
"@vitejs/plugin-react": "4.3.4",
"typescript": "5.7.2",
"vite": "6.0.3",
"vite": "6.0.7",
"vite-tsconfig-paths": "5.1.4"
},
"dependencies": {
"@grafana/faro-react": "1.12.2",
"@grafana/faro-web-sdk": "1.12.2",
"@grafana/faro-web-tracing": "1.12.2",
"@hocuspocus/provider": "2.15.0",
"@navikt/aksel-icons": "7.8.0",
"@navikt/ds-css": "7.8.0",
"@navikt/ds-react": "7.8.0",
"@navikt/aksel-icons": "7.9.1",
"@navikt/ds-css": "7.9.1",
"@navikt/ds-react": "7.9.1",
"@navikt/fnrvalidator": "2.1.5",
"@reduxjs/toolkit": "2.5.0",
"@slate-yjs/core": "1.0.2",
"@slate-yjs/react": "1.1.0",
"@styled-icons/fluentui-system-regular": "10.47.0",
"@types/qs": "6.9.17",
"@udecode/plate": "40.3.4",
"@udecode/plate-alignment": "40.0.0",
"@udecode/plate-autoformat": "40.0.0",
"@udecode/plate-basic-marks": "40.0.0",
"@udecode/plate-break": "40.0.0",
"@udecode/plate-common": "40.3.1",
"@udecode/plate-core": "40.3.1",
"@udecode/plate-cursor": "40.0.0",
"@udecode/plate-docx": "40.2.7",
"@udecode/plate-font": "40.0.0",
"@udecode/plate-heading": "40.2.6",
"@udecode/plate-indent": "40.0.0",
"@udecode/plate-list": "40.0.0",
"@udecode/plate-resizable": "40.0.0",
"@udecode/plate-table": "40.0.0",
"@udecode/plate-yjs": "40.0.0",
"@udecode/slate-react": "40.3.1",
"@udecode/plate": "41.0.14",
"@udecode/plate-alignment": "41.0.0",
"@udecode/plate-autoformat": "41.0.0",
"@udecode/plate-basic-marks": "41.0.0",
"@udecode/plate-break": "41.0.0",
"@udecode/plate-common": "41.0.13",
"@udecode/plate-core": "41.0.13",
"@udecode/plate-cursor": "41.0.0",
"@udecode/plate-docx": "41.0.10",
"@udecode/plate-font": "41.0.12",
"@udecode/plate-heading": "41.0.0",
"@udecode/plate-indent": "41.0.0",
"@udecode/plate-list": "41.0.0",
"@udecode/plate-resizable": "41.0.0",
"@udecode/plate-table": "41.0.9",
"@udecode/plate-yjs": "41.0.0",
"@udecode/slate-react": "41.0.5",
"qs": "6.13.1",
"react": "19.0.0",
"react-dom": "19.0.0",
"react-redux": "9.2.0",
"react-router": "7.0.2",
"react-router-dom": "7.0.2",
"react-router": "7.1.1",
"react-router-dom": "7.1.1",
"slate": "0.112.0",
"slate-history": "0.110.3",
"slate-react": "0.112.0",
"styled-components": "6.1.13",
"yjs": "13.6.20"
"styled-components": "6.1.14",
"yjs": "13.6.21"
}
}
4 changes: 2 additions & 2 deletions frontend/src/plate/components/fullmektig.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { isOfElementType } from '@app/plate/utils/queries';
import { ArrowUndoIcon } from '@navikt/aksel-icons';
import { Button, Loader } from '@navikt/ds-react';
import { findDescendant, replaceNodeChildren, withoutSavingHistory } from '@udecode/plate-common';
import { PlateElement, type PlateElementProps, findNodePath } from '@udecode/plate-common/react';
import { PlateElement, type PlateElementProps, findPath } from '@udecode/plate-common/react';
import { useEffect } from 'react';
import { setNodes, withoutNormalizing } from 'slate';
import { styled } from 'styled-components';
Expand All @@ -17,7 +17,7 @@ export const Fullmektig = (props: PlateElementProps<FullmektigElement>) => {
const { id, show } = element;
const editor = useMyPlateEditorRef();

const at = findNodePath(editor, element);
const at = findPath(editor, element);

const valueEntry = findDescendant<PlaceholderElement>(editor, {
at,
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/components/legacy-redigerbar-maltekst.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { Button, Loader, Tooltip } from '@navikt/ds-react';
import { skipToken } from '@reduxjs/toolkit/query';
import { replaceNodeChildren } from '@udecode/plate-common';
import { PlateElement, type PlateElementProps } from '@udecode/plate-common/react';
import { findNodePath } from '@udecode/slate-react';
import { findPath } from '@udecode/slate-react';
import { useCallback, useContext, useEffect, useRef } from 'react';

const consistsOfOnlyEmptyVoid = (element: RedigerbarMaltekstElement) => {
Expand All @@ -42,7 +42,7 @@ export const LegacyRedigerbarMaltekst = (props: PlateElementProps<RedigerbarMalt

const [getTexts, { isLoading }] = useLazyGetConsumerTextsQuery();

const path = findNodePath(editor, element);
const path = findPath(editor, element);

const isInitialized = useRef(!isNodeEmpty(element));

Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/components/maltekst/legacy-maltekst.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { ArrowCirclepathIcon } from '@navikt/aksel-icons';
import { Button, Loader, Tooltip } from '@navikt/ds-react';
import { isElement, replaceNodeChildren, withoutNormalizing, withoutSavingHistory } from '@udecode/plate-common';
import { PlateElement, type PlateElementProps } from '@udecode/plate-common/react';
import { findNodePath, isEditorReadOnly } from '@udecode/slate-react';
import { findPath, isEditorReadOnly } from '@udecode/slate-react';
import { useContext, useEffect } from 'react';

/**
Expand All @@ -33,7 +33,7 @@ export const LegacyMaltekst = (props: PlateElementProps<MaltekstElement>) => {
return;
}

const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (path === undefined) {
return;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/components/maltekst/maltekst.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { ArrowCirclepathIcon, PadlockUnlockedIcon } from '@navikt/aksel-icons';
import { Button, Tooltip } from '@navikt/ds-react';
import { isElement, replaceNodeChildren, unwrapNodes } from '@udecode/plate-common';
import { PlateElement, type PlateElementProps } from '@udecode/plate-common/react';
import { findNodePath, isEditorReadOnly } from '@udecode/slate-react';
import { findPath, isEditorReadOnly } from '@udecode/slate-react';
import { useContext, useMemo } from 'react';

export const Maltekst = (props: PlateElementProps<MaltekstElement>) => {
Expand All @@ -33,7 +33,7 @@ export const Maltekst = (props: PlateElementProps<MaltekstElement>) => {
return;
}

const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (path === undefined) {
return;
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/components/maltekstseksjon/use-path.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { MaltekstseksjonElement } from '@app/plate/types';
import { type PlateEditor, findNodePath } from '@udecode/plate-common/react';
import { type PlateEditor, findPath } from '@udecode/plate-common/react';
import { useEffect, useRef } from 'react';
import { Path } from 'slate';

export const usePath = (editor: PlateEditor, element: MaltekstseksjonElement) => {
const path = findNodePath(editor, element);
const path = findPath(editor, element);
const previous = useRef<Path | undefined>(path);

useEffect(() => {
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/plate/components/placeholder/placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { getEndPoint, getPreviousPath, setSelection } from '@udecode/plate-commo
import {
PlateElement,
type PlateElementProps,
findNodePath,
findPath,
focusEditor,
isEditorFocused,
useEditorReadOnly,
Expand Down Expand Up @@ -51,7 +51,7 @@ const Placeholder = ({ canManage, ...props }: PlaceholderProps) => {

const onClick = useCallback(
(e: React.MouseEvent) => {
const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (!hasNoVisibleText) {
return;
Expand All @@ -68,11 +68,11 @@ const Placeholder = ({ canManage, ...props }: PlaceholderProps) => {
[containsEmptyChar, editor, element, hasNoVisibleText],
);

const isFocused = getIsFocused(editor, findNodePath(editor, element));
const isFocused = getIsFocused(editor, findPath(editor, element));

// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: ¯\_(ツ)_/¯
useEffect(() => {
const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (isDragging || path === undefined) {
return;
Expand Down Expand Up @@ -115,7 +115,7 @@ const Placeholder = ({ canManage, ...props }: PlaceholderProps) => {

const deletePlaceholder = useCallback(
(event: MouseEvent) => {
const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (path === undefined) {
return;
Expand Down Expand Up @@ -145,7 +145,7 @@ const Placeholder = ({ canManage, ...props }: PlaceholderProps) => {
);

const hideDeleteButton = useMemo(() => {
const path = findNodePath(editor, element);
const path = findPath(editor, element);

return (
!(canManage && hasNoVisibleText) ||
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/components/redigerbar-maltekst.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { ArrowCirclepathIcon } from '@navikt/aksel-icons';
import { Button, Tooltip } from '@navikt/ds-react';
import { replaceNodeChildren } from '@udecode/plate-common';
import { PlateElement, type PlateElementProps } from '@udecode/plate-common/react';
import { findNodePath, isEditorReadOnly } from '@udecode/slate-react';
import { findPath, isEditorReadOnly } from '@udecode/slate-react';
import { useContext } from 'react';

export const RedigerbarMaltekst = (props: PlateElementProps<RedigerbarMaltekstElement>) => {
Expand All @@ -25,7 +25,7 @@ export const RedigerbarMaltekst = (props: PlateElementProps<RedigerbarMaltekstEl
return;
}

const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (path === undefined) {
return;
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/plate/components/regelverk.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { Button, Loader, Tooltip } from '@navikt/ds-react';
import { skipToken } from '@reduxjs/toolkit/query';
import { replaceNodeChildren, setNodes } from '@udecode/plate-common';
import { PlateElement, type PlateElementProps } from '@udecode/plate-common/react';
import { findNodePath } from '@udecode/slate-react';
import { findPath } from '@udecode/slate-react';
import { useCallback, useContext, useEffect, useState } from 'react';
import { styled } from 'styled-components';

Expand Down Expand Up @@ -76,7 +76,7 @@ export const RegelverkContainer = (props: PlateElementProps<RegelverkContainerEl

setLoading(true);

const at = findNodePath(editor, element);
const at = findPath(editor, element);

if (at === undefined) {
return;
Expand Down Expand Up @@ -154,7 +154,7 @@ const DeleteRegelverk = ({ element }: DeleteRegelverkProps) => {
return () => clearTimeout(timeout);
}, [regelverkContainerElement]);

const path = findNodePath(editor, element);
const path = findPath(editor, element);

return (
<DeleteSection
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/plate-editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { ELEMENT_MALTEKST, ELEMENT_PLACEHOLDER } from '@app/plate/plugins/elemen
import type { FormattedText } from '@app/plate/types';
import { getNodeAncestors } from '@udecode/plate-common';
import { PlateContent, type PlateContentProps, type PlateEditor, useEditorRef } from '@udecode/plate-core/react';
import { findNodePath } from '@udecode/slate-react';
import { findPath } from '@udecode/slate-react';

interface Props extends PlateContentProps {
lang: SpellCheckLanguage;
Expand Down Expand Up @@ -32,7 +32,7 @@ const contentEditable = (editor: PlateEditor, isReadOnly: boolean, text: Formatt
return false;
}

const path = findNodePath(editor, text);
const path = findPath(editor, text);

if (path === undefined) {
return false;
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/plate/plugins/plugin-sets/saksbehandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,13 @@ import type { IUserData } from '@app/types/bruker';
import type { ISmartDocument } from '@app/types/documents/documents';
import { slateNodesToInsertDelta } from '@slate-yjs/core';
import { BaseParagraphPlugin } from '@udecode/plate-common';
import type { NodeComponent } from '@udecode/plate-core/react';
import { HEADING_KEYS } from '@udecode/plate-heading';
import { BaseBulletedListPlugin, BaseListItemPlugin, BaseNumberedListPlugin } from '@udecode/plate-list';
import { BaseTableCellPlugin, BaseTablePlugin, BaseTableRowPlugin } from '@udecode/plate-table';
import { YjsPlugin } from '@udecode/plate-yjs/react';
import { XmlText } from 'yjs';

export const components: Record<string, NodeComponent> = {
export const components = {
[BaseParagraphPlugin.key]: Paragraph,

// Headings
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/plate/toolbar/table/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ import type { RichTextEditor, TableCellElement, TableRowElement } from '@app/pla
import { isOfElementType, isOfElementTypeFn } from '@app/plate/utils/queries';
import { type TNode, type TNodeEntry, findNode, getParentNode, someNode } from '@udecode/plate-common';
import { BaseTableCellPlugin, BaseTableRowPlugin } from '@udecode/plate-table';
import { findNodePath } from '@udecode/slate-react';
import { Path } from 'slate';

const findPath = (editor: RichTextEditor, node: TNode | undefined = undefined): Path | undefined =>
node === undefined ? undefined : findNodePath(editor, node);
node === undefined ? undefined : findPath(editor, node);

// Cell helpers
export const getCurrentCell = (editor: RichTextEditor): TNodeEntry<TableCellElement> | undefined =>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/toolbar/table/merge-cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ import {
withoutNormalizing,
} from '@udecode/plate-common';
import { BaseTableCellPlugin, BaseTableRowPlugin } from '@udecode/plate-table';
import { findNodePath } from '@udecode/slate-react';
import { findPath } from '@udecode/slate-react';

export const mergeCells = (
editor: RichTextEditor,
cellNode: TableCellElement,
cellPath = findNodePath(editor, cellNode),
cellPath = findPath(editor, cellNode),
) => {
const rowEntry = getCurrentRow(editor, cellNode, cellPath);

Expand Down
2 changes: 1 addition & 1 deletion frontend/src/plate/toolbar/table/table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import {
insertTableColumn,
insertTableRow,
} from '@udecode/plate-table';
import { deleteColumn, deleteRow } from '@udecode/plate-table/react';
import { deleteColumn, deleteRow } from '@udecode/plate-table';

export const TableButtons = () => {
const editor = useMyPlateEditorRef();
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/plate/utils/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import type { PlateEditor } from '@udecode/plate-core/react';
import { HEADING_KEYS } from '@udecode/plate-heading';
import { BaseBulletedListPlugin, BaseNumberedListPlugin } from '@udecode/plate-list';
import { BaseTablePlugin } from '@udecode/plate-table';
import { findNodePath } from '@udecode/slate-react';
import { findPath } from '@udecode/slate-react';

// Ensures a next-path even though original path is at end
export const nextPath = (path: number[]) => {
Expand Down Expand Up @@ -124,7 +124,7 @@ export const isPlaceholderActive = (editor: PlateEditor) =>
someNode(editor, { match: { type: SaksbehandlerPlaceholderPlugin.key } });

export const getIsInRegelverk = (editor: PlateEditor, element: TNode): boolean => {
const path = findNodePath(editor, element);
const path = findPath(editor, element);

if (path === undefined) {
return false;
Expand Down

0 comments on commit 070db97

Please sign in to comment.