@haklex/rich-kit-shiro 0.0.61 → 0.0.63
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/{ShiroEditor--laKGcAX.js → ShiroEditor-B1d8hQ_r.js} +12 -3
- package/dist/ShiroEditor.d.ts +1 -1
- package/dist/ShiroEditor.d.ts.map +1 -1
- package/dist/editor.mjs +2 -2
- package/dist/index.css +1 -1
- package/dist/index.mjs +1 -1
- package/dist/renderer.css +1 -1
- package/dist/renderer.mjs +1 -1
- package/dist/style-N3XWeaLm.js +4 -0
- package/package.json +18 -18
- package/dist/style-D2XDumCx.js +0 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { RichEditor } from "@haklex/rich-editor";
|
|
2
|
+
import { NestedContentRendererProvider, RichEditor } from "@haklex/rich-editor";
|
|
3
3
|
import { BlockHandlePlugin } from "@haklex/rich-plugin-block-handle";
|
|
4
4
|
import { FloatingToolbarPlugin } from "@haklex/rich-plugin-floating-toolbar";
|
|
5
5
|
import { FloatingLinkEditorPlugin } from "@haklex/rich-plugin-link-edit";
|
|
@@ -8,6 +8,7 @@ import { SlashMenuPlugin } from "@haklex/rich-plugin-slash-menu";
|
|
|
8
8
|
import { TableRowColumnHandlesPlugin, TableCellResizerPlugin } from "@haklex/rich-plugin-table";
|
|
9
9
|
import { ExcalidrawEditNode, embedEditNodes, linkCardEditNodes, katexEditNodes, galleryEditNodes, codeSnippetEditNodes, ConvertToLinkCardAction, enhancedEditRendererConfig, ExcalidrawPlugin, EmbedPlugin, PasteLinkCardPlugin } from "@haklex/rich-renderers-edit";
|
|
10
10
|
import { useMemo, useCallback } from "react";
|
|
11
|
+
import { S as ShiroRenderer } from "./ShiroRenderer-D8y1KzIM.js";
|
|
11
12
|
const defaultExtraNodes = [
|
|
12
13
|
ExcalidrawEditNode,
|
|
13
14
|
...embedEditNodes,
|
|
@@ -22,12 +23,18 @@ function ShiroEditor({
|
|
|
22
23
|
children,
|
|
23
24
|
selfHostnames,
|
|
24
25
|
extraMentionPlatforms,
|
|
26
|
+
variant = "article",
|
|
27
|
+
theme = "light",
|
|
25
28
|
...props
|
|
26
29
|
}) {
|
|
27
30
|
const mergedNodes = useMemo(
|
|
28
31
|
() => extraNodes ? [...defaultExtraNodes, ...extraNodes] : defaultExtraNodes,
|
|
29
32
|
[extraNodes]
|
|
30
33
|
);
|
|
34
|
+
const renderNestedContent = useCallback(
|
|
35
|
+
(value) => /* @__PURE__ */ jsx(ShiroRenderer, { value, variant, theme }),
|
|
36
|
+
[theme, variant]
|
|
37
|
+
);
|
|
31
38
|
const renderLinkExtraActions = useCallback(
|
|
32
39
|
({
|
|
33
40
|
url,
|
|
@@ -43,10 +50,12 @@ function ShiroEditor({
|
|
|
43
50
|
),
|
|
44
51
|
[]
|
|
45
52
|
);
|
|
46
|
-
return /* @__PURE__ */ jsxs(
|
|
53
|
+
return /* @__PURE__ */ jsx(NestedContentRendererProvider, { value: renderNestedContent, children: /* @__PURE__ */ jsxs(
|
|
47
54
|
RichEditor,
|
|
48
55
|
{
|
|
49
56
|
...props,
|
|
57
|
+
variant,
|
|
58
|
+
theme,
|
|
50
59
|
extraNodes: mergedNodes,
|
|
51
60
|
rendererConfig: enhancedEditRendererConfig,
|
|
52
61
|
actions: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
@@ -66,7 +75,7 @@ function ShiroEditor({
|
|
|
66
75
|
children
|
|
67
76
|
]
|
|
68
77
|
}
|
|
69
|
-
);
|
|
78
|
+
) });
|
|
70
79
|
}
|
|
71
80
|
export {
|
|
72
81
|
ShiroEditor as S
|
package/dist/ShiroEditor.d.ts
CHANGED
|
@@ -8,5 +8,5 @@ export interface ShiroEditorProps extends Omit<RichEditorProps, 'rendererConfig'
|
|
|
8
8
|
selfHostnames?: string[];
|
|
9
9
|
extraMentionPlatforms?: MentionPlatformDef[];
|
|
10
10
|
}
|
|
11
|
-
export declare function ShiroEditor({ extraNodes, actions, children, selfHostnames, extraMentionPlatforms, ...props }: ShiroEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function ShiroEditor({ extraNodes, actions, children, selfHostnames, extraMentionPlatforms, variant, theme, ...props }: ShiroEditorProps): import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
//# sourceMappingURL=ShiroEditor.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShiroEditor.d.ts","sourceRoot":"","sources":["../src/ShiroEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAK1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAoBrE,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,
|
|
1
|
+
{"version":3,"file":"ShiroEditor.d.ts","sourceRoot":"","sources":["../src/ShiroEditor.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAK1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAoBrE,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAyB,MAAM,SAAS,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AActC,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAC5C,eAAe,EACf,gBAAgB,GAAG,YAAY,GAAG,SAAS,CAC5C;IACC,UAAU,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAA;IACtC,OAAO,CAAC,EAAE,SAAS,CAAA;IACnB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB,qBAAqB,CAAC,EAAE,kBAAkB,EAAE,CAAA;CAC7C;AAED,wBAAgB,WAAW,CAAC,EAC1B,UAAU,EACV,OAAO,EACP,QAAQ,EACR,aAAa,EACb,qBAAqB,EACrB,OAAmB,EACnB,KAAe,EACf,GAAG,KAAK,EACT,EAAE,gBAAgB,2CA6DlB"}
|
package/dist/editor.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import root from "react-shadow";
|
|
3
|
-
import { S as ShiroEditor } from "./ShiroEditor
|
|
4
|
-
import { c as cssText } from "./style-
|
|
3
|
+
import { S as ShiroEditor } from "./ShiroEditor-B1d8hQ_r.js";
|
|
4
|
+
import { c as cssText } from "./style-N3XWeaLm.js";
|
|
5
5
|
const resolvedCss = cssText.replaceAll(":root {", ":root, :host {");
|
|
6
6
|
function IsolateEditor({
|
|
7
7
|
theme = "light",
|