@byline/richtext-lexical 1.1.0 → 1.2.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.
- package/dist/field/editor-component.js +1 -1
- package/dist/field/editor-field.js +1 -1
- package/dist/field/plugins/admonition-plugin/admonition-modal.js +1 -1
- package/dist/field/plugins/admonition-plugin/fields.d.ts +1 -1
- package/dist/field/plugins/auto-embed-plugin/auto-embed-modal.js +1 -1
- package/dist/field/plugins/inline-image-plugin/fields.d.ts +1 -1
- package/dist/field/plugins/inline-image-plugin/inline-image-modal.js +1 -2
- package/dist/field/plugins/layout-plugin/insert-layout-modal.js +1 -1
- package/dist/field/plugins/link-plugin/link/link-modal.js +1 -2
- package/dist/field/plugins/table-plugin/table-modal.js +1 -1
- package/dist/richtext-field.js +1 -2
- package/package.json +4 -4
- package/src/field/editor-component.test.tsx +1 -1
- package/src/field/editor-component.tsx +1 -1
- package/src/field/editor-field.tsx +1 -1
- package/src/field/plugins/admonition-plugin/admonition-modal.tsx +1 -1
- package/src/field/plugins/admonition-plugin/fields.ts +1 -1
- package/src/field/plugins/auto-embed-plugin/auto-embed-modal.tsx +1 -1
- package/src/field/plugins/inline-image-plugin/fields.ts +1 -1
- package/src/field/plugins/inline-image-plugin/inline-image-modal.tsx +1 -1
- package/src/field/plugins/layout-plugin/insert-layout-modal.tsx +1 -1
- package/src/field/plugins/link-plugin/link/link-modal.tsx +1 -1
- package/src/field/plugins/table-plugin/table-modal.tsx +1 -1
- package/src/richtext-field.tsx +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { memo, useCallback, useMemo, useRef } from "react";
|
|
4
|
-
import { HelpText, Label } from "@byline/ui";
|
|
4
|
+
import { HelpText, Label } from "@byline/ui/react";
|
|
5
5
|
import { ErrorBoundary } from "react-error-boundary";
|
|
6
6
|
import { richTextValidate } from "../validate/validate.js";
|
|
7
7
|
import { ApplyValuePlugin } from "./apply-value-plugin.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { Suspense, lazy } from "react";
|
|
4
|
-
import { Shimmer } from "@byline/ui";
|
|
4
|
+
import { Shimmer } from "@byline/ui/react";
|
|
5
5
|
const EditorComponent = /*#__PURE__*/ lazy(()=>import("./editor-component.js").then((module)=>({
|
|
6
6
|
default: module.EditorComponent
|
|
7
7
|
})));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { Button, CloseIcon, IconButton, Input, Modal, RadioGroup, RadioGroupItem } from "@byline/ui";
|
|
4
|
+
import { Button, CloseIcon, IconButton, Input, Modal, RadioGroup, RadioGroupItem } from "@byline/ui/react";
|
|
5
5
|
import { admonitionTypeOptions, getInitialState, validateFields } from "./fields.js";
|
|
6
6
|
import "./admonition-modal.css";
|
|
7
7
|
function intent(type) {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
|
-
import type { RadioGroupValue } from '@byline/ui';
|
|
8
|
+
import type { RadioGroupValue } from '@byline/ui/react';
|
|
9
9
|
import type { AdmonitionType } from '../../nodes/admonition-node';
|
|
10
10
|
import type { AdmonitionFormState } from './types';
|
|
11
11
|
export declare const admonitionTypeOptions: RadioGroupValue[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo, useState } from "react";
|
|
3
|
-
import { Button, CloseIcon, IconButton, Input, Modal } from "@byline/ui";
|
|
3
|
+
import { Button, CloseIcon, IconButton, Input, Modal } from "@byline/ui/react";
|
|
4
4
|
import { URL_MATCHER } from "@lexical/react/LexicalAutoEmbedPlugin";
|
|
5
5
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
6
|
import "./auto-embed-modal.css";
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
|
-
import type { SelectValue } from '@byline/ui';
|
|
8
|
+
import type { SelectValue } from '@byline/ui/react';
|
|
9
9
|
export declare const positionOptions: SelectValue[];
|
|
10
10
|
/** Alt text is required for accessibility — non-empty after trimming. */
|
|
11
11
|
export declare function isAltTextValid(value: string | undefined | null): boolean;
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useState } from "react";
|
|
4
4
|
import { getCollectionDefinition } from "@byline/core";
|
|
5
|
-
import { Button, Checkbox, CloseIcon, ErrorText, IconButton, Input, Label, Modal, RadioGroup, RadioGroupItem } from "@byline/ui";
|
|
6
|
-
import { RelationPicker } from "@byline/ui/react";
|
|
5
|
+
import { Button, Checkbox, CloseIcon, ErrorText, IconButton, Input, Label, Modal, RadioGroup, RadioGroupItem, RelationPicker } from "@byline/ui/react";
|
|
7
6
|
import { useEditorConfig } from "../../config/editor-config-context.js";
|
|
8
7
|
import { useModalFormState } from "../../shared/useModalFormState.js";
|
|
9
8
|
import { isAltTextValid, positionOptions } from "./fields.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
import { Button, CloseIcon, IconButton, Modal, Select } from "@byline/ui";
|
|
4
|
+
import { Button, CloseIcon, IconButton, Modal, Select } from "@byline/ui/react";
|
|
5
5
|
import "./insert-layout-modal.css";
|
|
6
6
|
const layouts = [
|
|
7
7
|
{
|
|
@@ -2,8 +2,7 @@
|
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo, useState } from "react";
|
|
4
4
|
import { getClientConfig, getCollectionDefinition } from "@byline/core";
|
|
5
|
-
import { Button, Checkbox, CloseIcon, IconButton, Input, Label, Modal, RadioGroup, RadioGroupItem, Select } from "@byline/ui";
|
|
6
|
-
import { RelationPicker } from "@byline/ui/react";
|
|
5
|
+
import { Button, Checkbox, CloseIcon, IconButton, Input, Label, Modal, RadioGroup, RadioGroupItem, RelationPicker, Select } from "@byline/ui/react";
|
|
7
6
|
import { useEditorConfig } from "../../../config/editor-config-context.js";
|
|
8
7
|
import { useModalFormState } from "../../../shared/useModalFormState.js";
|
|
9
8
|
import { validateUrl } from "../../../utils/url.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
|
-
import { Button, CloseIcon, IconButton, Input, Modal } from "@byline/ui";
|
|
4
|
+
import { Button, CloseIcon, IconButton, Input, Modal } from "@byline/ui/react";
|
|
5
5
|
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
|
|
6
6
|
import { INSERT_TABLE_COMMAND } from "@lexical/table";
|
|
7
7
|
import "./table-modal.css";
|
package/dist/richtext-field.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ErrorText, Label } from "@byline/ui";
|
|
3
|
-
import { LocaleBadge, useFieldError, useFieldValue } from "@byline/ui/react";
|
|
2
|
+
import { ErrorText, Label, LocaleBadge, useFieldError, useFieldValue } from "@byline/ui/react";
|
|
4
3
|
import classnames from "classnames";
|
|
5
4
|
import { defaultEditorConfig } from "./field/config/default.js";
|
|
6
5
|
import { EditorField } from "./field/editor-field.js";
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
|
-
"version": "1.
|
|
6
|
+
"version": "1.2.0",
|
|
7
7
|
"engines": {
|
|
8
8
|
"node": ">=20.9.0"
|
|
9
9
|
},
|
|
@@ -71,9 +71,9 @@
|
|
|
71
71
|
"npm-run-all": "^4.1.5",
|
|
72
72
|
"prism-react-renderer": "^2.4.1",
|
|
73
73
|
"react-error-boundary": "^6.1.1",
|
|
74
|
-
"@byline/
|
|
75
|
-
"@byline/
|
|
76
|
-
"@byline/core": "1.
|
|
74
|
+
"@byline/client": "1.2.0",
|
|
75
|
+
"@byline/ui": "1.2.0",
|
|
76
|
+
"@byline/core": "1.2.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"react": "^19.0.0",
|
|
@@ -11,7 +11,7 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
|
|
|
11
11
|
|
|
12
12
|
vi.mock('./editor-component.css', () => ({}))
|
|
13
13
|
vi.mock('./themes/lexical-editor-theme.css', () => ({}))
|
|
14
|
-
vi.mock('@byline/ui', () => ({
|
|
14
|
+
vi.mock('@byline/ui/react', () => ({
|
|
15
15
|
HelpText: () => null,
|
|
16
16
|
Label: () => null,
|
|
17
17
|
}))
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type React from 'react'
|
|
12
12
|
import { memo, useCallback, useMemo, useRef } from 'react'
|
|
13
13
|
|
|
14
|
-
import { HelpText, Label } from '@byline/ui'
|
|
14
|
+
import { HelpText, Label } from '@byline/ui/react'
|
|
15
15
|
import type { EditorState, SerializedEditorState } from 'lexical'
|
|
16
16
|
import { ErrorBoundary } from 'react-error-boundary'
|
|
17
17
|
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
import type React from 'react'
|
|
12
12
|
import { useEffect, useState } from 'react'
|
|
13
13
|
|
|
14
|
-
import { Button, CloseIcon, IconButton, Input, Modal, RadioGroup, RadioGroupItem } from '@byline/ui'
|
|
14
|
+
import { Button, CloseIcon, IconButton, Input, Modal, RadioGroup, RadioGroupItem } from '@byline/ui/react'
|
|
15
15
|
|
|
16
16
|
import { admonitionTypeOptions, getInitialState, validateFields } from './fields'
|
|
17
17
|
import type { AdmonitionType } from '../../nodes/admonition-node/types'
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Copyright (c) Infonomic Company Limited
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import type { RadioGroupValue } from '@byline/ui'
|
|
9
|
+
import type { RadioGroupValue } from '@byline/ui/react'
|
|
10
10
|
|
|
11
11
|
import type { AdmonitionType } from '../../nodes/admonition-node'
|
|
12
12
|
import type { AdmonitionFormState } from './types'
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo, useState } from 'react'
|
|
2
2
|
|
|
3
|
-
import { Button, CloseIcon, IconButton, Input, Modal } from '@byline/ui'
|
|
3
|
+
import { Button, CloseIcon, IconButton, Input, Modal } from '@byline/ui/react'
|
|
4
4
|
import { type EmbedMatchResult, URL_MATCHER } from '@lexical/react/LexicalAutoEmbedPlugin'
|
|
5
5
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
|
6
6
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import type * as React from 'react'
|
|
20
20
|
import { useState } from 'react'
|
|
21
21
|
|
|
22
|
-
import { Button, CloseIcon, IconButton, Modal, Select, type SelectValue } from '@byline/ui'
|
|
22
|
+
import { Button, CloseIcon, IconButton, Modal, Select, type SelectValue } from '@byline/ui/react'
|
|
23
23
|
|
|
24
24
|
const layouts: SelectValue[] = [
|
|
25
25
|
{ label: '2 columns (equal width)', value: '1fr 1fr' },
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import type * as React from 'react'
|
|
20
20
|
import { useEffect, useState } from 'react'
|
|
21
21
|
|
|
22
|
-
import { Button, CloseIcon, IconButton, Input, Modal } from '@byline/ui'
|
|
22
|
+
import { Button, CloseIcon, IconButton, Input, Modal } from '@byline/ui/react'
|
|
23
23
|
import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'
|
|
24
24
|
import { INSERT_TABLE_COMMAND } from '@lexical/table'
|
|
25
25
|
|
package/src/richtext-field.tsx
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
import type React from 'react'
|
|
10
10
|
|
|
11
11
|
import type { RichTextField as FieldType } from '@byline/core'
|
|
12
|
-
import { ErrorText, Label } from '@byline/ui'
|
|
12
|
+
import { ErrorText, Label } from '@byline/ui/react'
|
|
13
13
|
import { LocaleBadge, useFieldError, useFieldValue } from '@byline/ui/react'
|
|
14
14
|
import cx from 'classnames'
|
|
15
15
|
|