@astryx-vue/richtext 0.7.29 → 0.9.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/index.js +5 -5
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import { $isCodeNode, CodeNode } from "@lexical/code";
|
|
|
12
12
|
import { $dfs, $getNearestNodeOfType, addClassNamesToElement, mergeRegister as mergeRegister$1, removeClassNamesFromElement } from "@lexical/utils";
|
|
13
13
|
import { parseInlineAst, parseMarkdownAst } from "@astryx-vue/core/Markdown/parser";
|
|
14
14
|
import { $generateHtmlFromNodes, DOMRenderExtension, domOverride } from "@lexical/html";
|
|
15
|
-
import { Button, CheckboxInput, Dialog, DialogHeader, Divider, Field, HIGHLIGHTED_TOKEN_TYPES, HStack, Icon, IconButton, Layout, LayoutContent, LayoutFooter, Selector, TextInput, ToggleButton, Toolbar, VisuallyHidden, tokenize,
|
|
15
|
+
import { Button, CheckboxInput, Dialog, DialogHeader, Divider, Field, HIGHLIGHTED_TOKEN_TYPES, HStack, Icon, IconButton, Layout, LayoutContent, LayoutFooter, Selector, TextInput, ToggleButton, Toolbar, VisuallyHidden, codeBlockMessages, richTextEditorMessages, tableMessages, textAreaMessages, tokenize, useComponentMessages, useCopyToClipboard, useSemanticIcon } from "@astryx-vue/core";
|
|
16
16
|
import { MarkdownPluginNodeRenderer } from "@astryx-vue/core/Markdown/plugin-renderer";
|
|
17
17
|
import "../styles/richtext-document.css";
|
|
18
18
|
import "../styles/richtext-editor.css";
|
|
@@ -645,7 +645,7 @@ const CodeBlockHeader = defineComponent({
|
|
|
645
645
|
} },
|
|
646
646
|
setup(props) {
|
|
647
647
|
const editor = useLexicalEditor();
|
|
648
|
-
const messages =
|
|
648
|
+
const messages = useComponentMessages({ codeBlock: codeBlockMessages });
|
|
649
649
|
const { copy, isCopied } = useCopyToClipboard({ announce: messages.value.codeBlock.copied });
|
|
650
650
|
function copyCode() {
|
|
651
651
|
const code = editor.getEditorState().read(() => $getNodeByKey(props.placement.key)?.getTextContent() ?? "");
|
|
@@ -1288,7 +1288,7 @@ const DecoratorTeleports = defineComponent({
|
|
|
1288
1288
|
* 随 `<InternationalizationProvider>` 的语言切换;包本身不再自带译文。
|
|
1289
1289
|
*/
|
|
1290
1290
|
function useRichTextMessages() {
|
|
1291
|
-
const messages =
|
|
1291
|
+
const messages = useComponentMessages({ richTextEditor: richTextEditorMessages });
|
|
1292
1292
|
const table = computed(() => messages.value.richTextEditor);
|
|
1293
1293
|
return (key) => {
|
|
1294
1294
|
let node = table.value;
|
|
@@ -1355,7 +1355,7 @@ const _sfc_main = /*@__PURE__*/ defineComponent({
|
|
|
1355
1355
|
const emit = __emit;
|
|
1356
1356
|
const attrs = useAttrs();
|
|
1357
1357
|
const t = useRichTextMessages();
|
|
1358
|
-
const coreMessages =
|
|
1358
|
+
const coreMessages = useComponentMessages({ textArea: textAreaMessages });
|
|
1359
1359
|
/** 清空时用的状态:根下面一个空段落。用 `setEditorState` 重置,也会触发 `change`。 */
|
|
1360
1360
|
const EMPTY_EDITOR_STATE = JSON.stringify({ root: {
|
|
1361
1361
|
children: [{
|
|
@@ -2174,7 +2174,7 @@ const _sfc_main$2 = /*@__PURE__*/ defineComponent({
|
|
|
2174
2174
|
const props = __props;
|
|
2175
2175
|
const emit = __emit;
|
|
2176
2176
|
const attrs = useAttrs();
|
|
2177
|
-
const coreMessages =
|
|
2177
|
+
const coreMessages = useComponentMessages({ table: tableMessages });
|
|
2178
2178
|
const surface = shallowRef(null);
|
|
2179
2179
|
const hasError = shallowRef(false);
|
|
2180
2180
|
/** 状态必须是合法的 JSON;坏的 JSON 会在建编辑器时直接抛出,所以先验一遍。 */
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@astryx-vue/richtext",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.9.0",
|
|
5
5
|
"description": "Astryx rich text for Vue — Lexical nodes and lossless Markdown import/export. Not affiliated with Meta.",
|
|
6
6
|
"author": "ShenQingchuan",
|
|
7
7
|
"license": "MIT",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"@lexical/utils": "0.52.0",
|
|
67
67
|
"lexical": "0.52.0",
|
|
68
68
|
"vue": "^3.5.0",
|
|
69
|
-
"@astryx-vue/core": "^0.
|
|
69
|
+
"@astryx-vue/core": "^0.9.0"
|
|
70
70
|
},
|
|
71
71
|
"peerDependenciesMeta": {
|
|
72
72
|
"@lexical/code": {
|
|
@@ -130,7 +130,7 @@
|
|
|
130
130
|
"unplugin-vue": "8.0.0",
|
|
131
131
|
"vue": "3.5.43",
|
|
132
132
|
"vue-tsc": "3.3.12",
|
|
133
|
-
"@astryx-vue/core": "^0.
|
|
133
|
+
"@astryx-vue/core": "^0.9.0"
|
|
134
134
|
},
|
|
135
135
|
"publishConfig": {
|
|
136
136
|
"access": "public"
|