@haklex/rich-kit-shiro 0.0.81 → 0.0.82

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.
@@ -1,4 +1,4 @@
1
- import { t as ShiroRenderer } from "./ShiroRenderer-o_UayGl9.js";
1
+ import { t as ShiroRenderer } from "./ShiroRenderer-CPLnT6Jb.js";
2
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";
@@ -20,10 +20,10 @@ var defaultExtraNodes = [
20
20
  ];
21
21
  function ShiroEditor({ extraNodes, actions, children, selfHostnames, extraMentionPlatforms, variant = "article", theme = "light", ...props }) {
22
22
  const mergedNodes = useMemo(() => extraNodes ? [...defaultExtraNodes, ...extraNodes] : defaultExtraNodes, [extraNodes]);
23
- const renderNestedContent = useCallback((value) => /* @__PURE__ */ jsx(ShiroRenderer, {
23
+ const renderNestedContent = useCallback((value, overrideVariant) => /* @__PURE__ */ jsx(ShiroRenderer, {
24
24
  theme,
25
25
  value,
26
- variant
26
+ variant: overrideVariant ?? variant
27
27
  }), [theme, variant]);
28
28
  const renderLinkExtraActions = useCallback(({ url, linkKey, actionButtonClassName }) => /* @__PURE__ */ jsx(ConvertToLinkCardAction, {
29
29
  className: actionButtonClassName,
@@ -1,4 +1,5 @@
1
- import { useMemo } from "react";
1
+ import { NestedContentRendererProvider } from "@haklex/rich-editor";
2
+ import { useCallback, useMemo } from "react";
2
3
  import { nestedDocNodes } from "@haklex/rich-ext-nested-doc/static";
3
4
  import { ExcalidrawNode, codeSnippetNodes, embedNodes, enhancedRendererConfig, galleryNodes } from "@haklex/rich-renderers";
4
5
  import { RichRenderer } from "@haklex/rich-static-renderer";
@@ -17,10 +18,24 @@ function ShiroRenderer({ extraNodes, rendererConfig, ...props }) {
17
18
  ...enhancedRendererConfig,
18
19
  ...rendererConfig
19
20
  } : enhancedRendererConfig, [rendererConfig]);
20
- return /* @__PURE__ */ jsx(RichRenderer, {
21
- ...props,
22
- extraNodes: mergedNodes,
23
- rendererConfig: mergedConfig
21
+ return /* @__PURE__ */ jsx(NestedContentRendererProvider, {
22
+ value: useCallback((value, overrideVariant) => /* @__PURE__ */ jsx(ShiroRenderer, {
23
+ extraNodes,
24
+ rendererConfig,
25
+ theme: props.theme,
26
+ value,
27
+ variant: overrideVariant ?? props.variant
28
+ }), [
29
+ extraNodes,
30
+ props.theme,
31
+ props.variant,
32
+ rendererConfig
33
+ ]),
34
+ children: /* @__PURE__ */ jsx(RichRenderer, {
35
+ ...props,
36
+ extraNodes: mergedNodes,
37
+ rendererConfig: mergedConfig
38
+ })
24
39
  });
25
40
  }
26
41
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"ShiroRenderer.d.ts","sourceRoot":"","sources":["../src/ShiroRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAS1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAWlD,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,iBAAiB,EACjB,gBAAgB,GAAG,YAAY,CAChC;IACC,UAAU,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1C;AAED,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CAazF"}
1
+ {"version":3,"file":"ShiroRenderer.d.ts","sourceRoot":"","sources":["../src/ShiroRenderer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAU7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAyB,MAAM,SAAS,CAAC;AAWzE,MAAM,WAAW,kBAAmB,SAAQ,IAAI,CAC9C,iBAAiB,EACjB,gBAAgB,GAAG,YAAY,CAChC;IACC,UAAU,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC;IACvC,cAAc,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAC;CAC1C;AAED,wBAAgB,aAAa,CAAC,EAAE,UAAU,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,2CA8BzF"}
package/dist/editor.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import "./ShiroRenderer-o_UayGl9.js";
2
- import { t as ShiroEditor } from "./ShiroEditor-DlPjqvEs.js";
1
+ import "./ShiroRenderer-CPLnT6Jb.js";
2
+ import { t as ShiroEditor } from "./ShiroEditor-DTNu7vJV.js";
3
3
  import { t as style_default } from "./style-CxH2CuLb.js";
4
4
  import { jsx, jsxs } from "react/jsx-runtime";
5
5
  import root from "react-shadow";
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { t as ShiroRenderer } from "./ShiroRenderer-o_UayGl9.js";
2
- import { t as ShiroEditor } from "./ShiroEditor-DlPjqvEs.js";
1
+ import { t as ShiroRenderer } from "./ShiroRenderer-CPLnT6Jb.js";
2
+ import { t as ShiroEditor } from "./ShiroEditor-DTNu7vJV.js";
3
3
  import { ColorSchemeProvider, FootnoteDefinitionsProvider, LinkFavicon, PresentDialogProvider, RichEditor, createRendererDecoration, getVariantClass, useColorScheme, useFootnoteContent, useFootnoteDefinitions, useFootnoteDisplayNumber, useRendererConfig, useRendererMode } from "./exports/editor-core.mjs";
4
4
  import { ExcalidrawConfigProvider, ExcalidrawEditRenderer, ExcalidrawPlugin, ExcalidrawRenderer, ExcalidrawStaticRenderer, INSERT_EXCALIDRAW_COMMAND, useExcalidrawConfig } from "./exports/excalidraw.mjs";
5
5
  import { n as SHIRO_MARKDOWN_TRANSFORMERS, r as buildShiroMarkdownTransformers, t as SHIRO_EXT_MARKDOWN_TRANSFORMERS } from "./markdown-BO2eqHxN.js";
package/dist/renderer.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as ShiroRenderer } from "./ShiroRenderer-o_UayGl9.js";
1
+ import { t as ShiroRenderer } from "./ShiroRenderer-CPLnT6Jb.js";
2
2
  import { t as style_default } from "./style-CxH2CuLb.js";
3
3
  import { jsx, jsxs } from "react/jsx-runtime";
4
4
  import root from "react-shadow";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-kit-shiro",
3
- "version": "0.0.81",
3
+ "version": "0.0.82",
4
4
  "description": "Production bundle for Shiroi blog",
5
5
  "repository": {
6
6
  "type": "git",
@@ -65,24 +65,24 @@
65
65
  "dependencies": {
66
66
  "katex": "^0.16.37",
67
67
  "react-shadow": "^20.6.0",
68
- "@haklex/rich-editor": "0.0.81",
69
- "@haklex/rich-editor-ui": "0.0.81",
70
- "@haklex/rich-ext-embed": "0.0.81",
71
- "@haklex/rich-ext-excalidraw": "0.0.81",
72
- "@haklex/rich-ext-code-snippet": "0.0.81",
73
- "@haklex/rich-plugin-block-handle": "0.0.81",
74
- "@haklex/rich-ext-nested-doc": "0.0.81",
75
- "@haklex/rich-plugin-link-edit": "0.0.81",
76
- "@haklex/rich-plugin-table": "0.0.81",
77
- "@haklex/rich-plugin-mention": "0.0.81",
78
- "@haklex/rich-plugin-toolbar": "0.0.81",
79
- "@haklex/rich-plugin-slash-menu": "0.0.81",
80
- "@haklex/rich-renderer-katex": "0.0.81",
81
- "@haklex/rich-renderers": "0.0.81",
82
- "@haklex/rich-static-renderer": "0.0.81",
83
- "@haklex/rich-renderers-edit": "0.0.81",
84
- "@haklex/rich-plugin-floating-toolbar": "0.0.81",
85
- "@haklex/rich-style-token": "0.0.81"
68
+ "@haklex/rich-ext-code-snippet": "0.0.82",
69
+ "@haklex/rich-editor-ui": "0.0.82",
70
+ "@haklex/rich-editor": "0.0.82",
71
+ "@haklex/rich-ext-embed": "0.0.82",
72
+ "@haklex/rich-ext-nested-doc": "0.0.82",
73
+ "@haklex/rich-ext-excalidraw": "0.0.82",
74
+ "@haklex/rich-plugin-block-handle": "0.0.82",
75
+ "@haklex/rich-plugin-link-edit": "0.0.82",
76
+ "@haklex/rich-plugin-floating-toolbar": "0.0.82",
77
+ "@haklex/rich-plugin-slash-menu": "0.0.82",
78
+ "@haklex/rich-plugin-table": "0.0.82",
79
+ "@haklex/rich-plugin-mention": "0.0.82",
80
+ "@haklex/rich-plugin-toolbar": "0.0.82",
81
+ "@haklex/rich-renderer-katex": "0.0.82",
82
+ "@haklex/rich-renderers": "0.0.82",
83
+ "@haklex/rich-renderers-edit": "0.0.82",
84
+ "@haklex/rich-style-token": "0.0.82",
85
+ "@haklex/rich-static-renderer": "0.0.82"
86
86
  },
87
87
  "devDependencies": {
88
88
  "@lexical/react": "^0.41.0",