@haklex/rich-kit-shiro 0.0.18 → 0.0.19

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.
@@ -0,0 +1,71 @@
1
+ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
+ import { RichEditor } from "@haklex/rich-editor";
3
+ import { BlockHandlePlugin } from "@haklex/rich-plugin-block-handle";
4
+ import { FloatingToolbarPlugin } from "@haklex/rich-plugin-floating-toolbar";
5
+ import { FloatingLinkEditorPlugin } from "@haklex/rich-plugin-link-edit";
6
+ import { SlashMenuPlugin } from "@haklex/rich-plugin-slash-menu";
7
+ import { TableRowColumnHandlesPlugin, TableCellResizerPlugin } from "@haklex/rich-plugin-table";
8
+ import { TldrawNode, galleryNodes } from "@haklex/rich-renderers";
9
+ import { embedEditNodes, linkCardEditNodes, katexEditNodes, codeSnippetEditNodes, ConvertToLinkCardAction, enhancedEditRendererConfig, TldrawPlugin, EmbedPlugin, PasteLinkCardPlugin } from "@haklex/rich-renderers-edit";
10
+ import { useMemo, useCallback } from "react";
11
+ const defaultExtraNodes = [
12
+ TldrawNode,
13
+ ...embedEditNodes,
14
+ ...linkCardEditNodes,
15
+ ...katexEditNodes,
16
+ ...galleryNodes,
17
+ ...codeSnippetEditNodes
18
+ ];
19
+ function ShiroEditor({
20
+ extraNodes,
21
+ actions,
22
+ children,
23
+ selfHostnames,
24
+ ...props
25
+ }) {
26
+ const mergedNodes = useMemo(
27
+ () => extraNodes ? [...defaultExtraNodes, ...extraNodes] : defaultExtraNodes,
28
+ [extraNodes]
29
+ );
30
+ const renderLinkExtraActions = useCallback(
31
+ ({
32
+ url,
33
+ linkKey,
34
+ actionButtonClassName
35
+ }) => /* @__PURE__ */ jsx(
36
+ ConvertToLinkCardAction,
37
+ {
38
+ url,
39
+ linkKey,
40
+ className: actionButtonClassName
41
+ }
42
+ ),
43
+ []
44
+ );
45
+ return /* @__PURE__ */ jsxs(
46
+ RichEditor,
47
+ {
48
+ ...props,
49
+ extraNodes: mergedNodes,
50
+ rendererConfig: enhancedEditRendererConfig,
51
+ actions: /* @__PURE__ */ jsxs(Fragment, { children: [
52
+ /* @__PURE__ */ jsx(SlashMenuPlugin, {}),
53
+ actions
54
+ ] }),
55
+ children: [
56
+ /* @__PURE__ */ jsx(BlockHandlePlugin, {}),
57
+ /* @__PURE__ */ jsx(FloatingToolbarPlugin, {}),
58
+ /* @__PURE__ */ jsx(FloatingLinkEditorPlugin, { renderExtraActions: renderLinkExtraActions }),
59
+ /* @__PURE__ */ jsx(TldrawPlugin, {}),
60
+ /* @__PURE__ */ jsx(EmbedPlugin, { selfHostnames }),
61
+ /* @__PURE__ */ jsx(PasteLinkCardPlugin, {}),
62
+ /* @__PURE__ */ jsx(TableRowColumnHandlesPlugin, {}),
63
+ /* @__PURE__ */ jsx(TableCellResizerPlugin, {}),
64
+ children
65
+ ]
66
+ }
67
+ );
68
+ }
69
+ export {
70
+ ShiroEditor as S
71
+ };
@@ -0,0 +1,27 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { RichRenderer } from "@haklex/rich-editor";
3
+ import { TldrawNode, embedNodes, galleryNodes, codeSnippetNodes, enhancedRendererConfig } from "@haklex/rich-renderers";
4
+ import { useMemo } from "react";
5
+ const defaultExtraNodes = [
6
+ TldrawNode,
7
+ ...embedNodes,
8
+ ...galleryNodes,
9
+ ...codeSnippetNodes
10
+ ];
11
+ function ShiroRenderer({ extraNodes, ...props }) {
12
+ const mergedNodes = useMemo(
13
+ () => extraNodes ? [...defaultExtraNodes, ...extraNodes] : defaultExtraNodes,
14
+ [extraNodes]
15
+ );
16
+ return /* @__PURE__ */ jsx(
17
+ RichRenderer,
18
+ {
19
+ ...props,
20
+ extraNodes: mergedNodes,
21
+ rendererConfig: enhancedRendererConfig
22
+ }
23
+ );
24
+ }
25
+ export {
26
+ ShiroRenderer as S
27
+ };
@@ -0,0 +1,3 @@
1
+ export type { ShiroEditorProps } from './ShiroEditor';
2
+ export { ShiroEditor, ShiroEditor as default } from './ShiroEditor';
3
+ //# sourceMappingURL=editor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editor.d.ts","sourceRoot":"","sources":["../src/editor.tsx"],"names":[],"mappings":"AAAA,YAAY,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,eAAe,CAAA"}
package/dist/editor.mjs CHANGED
@@ -1,71 +1,5 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { RichEditor } from "@haklex/rich-editor";
3
- import { BlockHandlePlugin } from "@haklex/rich-plugin-block-handle";
4
- import { FloatingToolbarPlugin } from "@haklex/rich-plugin-floating-toolbar";
5
- import { FloatingLinkEditorPlugin } from "@haklex/rich-plugin-link-edit";
6
- import { SlashMenuPlugin } from "@haklex/rich-plugin-slash-menu";
7
- import { TableRowColumnHandlesPlugin, TableCellResizerPlugin } from "@haklex/rich-plugin-table";
8
- import { TldrawNode, galleryNodes } from "@haklex/rich-renderers";
9
- import { embedEditNodes, linkCardEditNodes, katexEditNodes, codeSnippetEditNodes, ConvertToLinkCardAction, enhancedEditRendererConfig, TldrawPlugin, EmbedPlugin, PasteLinkCardPlugin } from "@haklex/rich-renderers-edit";
10
- import { useMemo, useCallback } from "react";
11
- const defaultExtraNodes = [
12
- TldrawNode,
13
- ...embedEditNodes,
14
- ...linkCardEditNodes,
15
- ...katexEditNodes,
16
- ...galleryNodes,
17
- ...codeSnippetEditNodes
18
- ];
19
- function ShiroEditor({
20
- extraNodes,
21
- actions,
22
- children,
23
- selfHostnames,
24
- ...props
25
- }) {
26
- const mergedNodes = useMemo(
27
- () => extraNodes ? [...defaultExtraNodes, ...extraNodes] : defaultExtraNodes,
28
- [extraNodes]
29
- );
30
- const renderLinkExtraActions = useCallback(
31
- ({
32
- url,
33
- linkKey,
34
- actionButtonClassName
35
- }) => /* @__PURE__ */ jsx(
36
- ConvertToLinkCardAction,
37
- {
38
- url,
39
- linkKey,
40
- className: actionButtonClassName
41
- }
42
- ),
43
- []
44
- );
45
- return /* @__PURE__ */ jsxs(
46
- RichEditor,
47
- {
48
- ...props,
49
- extraNodes: mergedNodes,
50
- rendererConfig: enhancedEditRendererConfig,
51
- actions: /* @__PURE__ */ jsxs(Fragment, { children: [
52
- /* @__PURE__ */ jsx(SlashMenuPlugin, {}),
53
- actions
54
- ] }),
55
- children: [
56
- /* @__PURE__ */ jsx(BlockHandlePlugin, {}),
57
- /* @__PURE__ */ jsx(FloatingToolbarPlugin, {}),
58
- /* @__PURE__ */ jsx(FloatingLinkEditorPlugin, { renderExtraActions: renderLinkExtraActions }),
59
- /* @__PURE__ */ jsx(TldrawPlugin, {}),
60
- /* @__PURE__ */ jsx(EmbedPlugin, { selfHostnames }),
61
- /* @__PURE__ */ jsx(PasteLinkCardPlugin, {}),
62
- /* @__PURE__ */ jsx(TableRowColumnHandlesPlugin, {}),
63
- /* @__PURE__ */ jsx(TableCellResizerPlugin, {}),
64
- children
65
- ]
66
- }
67
- );
68
- }
1
+ import { S, S as S2 } from "./ShiroEditor-10Lrfj7a.js";
69
2
  export {
70
- ShiroEditor
3
+ S as ShiroEditor,
4
+ S2 as default
71
5
  };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
- import { ShiroEditor } from "./editor.mjs";
2
- import { ShiroRenderer } from "./renderer.mjs";
1
+ import { S } from "./ShiroEditor-10Lrfj7a.js";
2
+ import { S as S2 } from "./ShiroRenderer-B-khUmQf.js";
3
3
  import { ALL_TRANSFORMERS } from "@haklex/rich-editor";
4
4
  import { ColorSchemeProvider, FootnoteDefinitionsProvider, NESTED_EDITOR_NODES, RichEditor, RichRenderer, allEditNodes, allNodes, builtinNodes, createRendererDecoration, customEditNodes, customNodes, getResolvedEditNodes, getVariantClass, setResolvedEditNodes, useColorScheme, useFootnoteContent, useFootnoteDefinitions, useFootnoteDisplayNumber, useRendererConfig, useRendererMode } from "@haklex/rich-editor";
5
5
  import { TLDRAW_BLOCK_TRANSFORMER } from "@haklex/rich-ext-tldraw";
@@ -76,8 +76,8 @@ export {
76
76
  RichRenderer,
77
77
  SHIRO_EXT_MARKDOWN_TRANSFORMERS,
78
78
  SHIRO_MARKDOWN_TRANSFORMERS,
79
- ShiroEditor,
80
- ShiroRenderer,
79
+ S as ShiroEditor,
80
+ S2 as ShiroRenderer,
81
81
  SlashMenuItem,
82
82
  SlashMenuList,
83
83
  SlashMenuPlugin,
@@ -0,0 +1,3 @@
1
+ export type { ShiroRendererProps } from './ShiroRenderer';
2
+ export { ShiroRenderer, ShiroRenderer as default } from './ShiroRenderer';
3
+ //# sourceMappingURL=renderer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"renderer.d.ts","sourceRoot":"","sources":["../src/renderer.tsx"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AACzD,OAAO,EAAE,aAAa,EAAE,aAAa,IAAI,OAAO,EAAE,MAAM,iBAAiB,CAAA"}
package/dist/renderer.mjs CHANGED
@@ -1,27 +1,5 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { RichRenderer } from "@haklex/rich-editor";
3
- import { TldrawNode, embedNodes, galleryNodes, codeSnippetNodes, enhancedRendererConfig } from "@haklex/rich-renderers";
4
- import { useMemo } from "react";
5
- const defaultExtraNodes = [
6
- TldrawNode,
7
- ...embedNodes,
8
- ...galleryNodes,
9
- ...codeSnippetNodes
10
- ];
11
- function ShiroRenderer({ extraNodes, ...props }) {
12
- const mergedNodes = useMemo(
13
- () => extraNodes ? [...defaultExtraNodes, ...extraNodes] : defaultExtraNodes,
14
- [extraNodes]
15
- );
16
- return /* @__PURE__ */ jsx(
17
- RichRenderer,
18
- {
19
- ...props,
20
- extraNodes: mergedNodes,
21
- rendererConfig: enhancedRendererConfig
22
- }
23
- );
24
- }
1
+ import { S, S as S2 } from "./ShiroRenderer-B-khUmQf.js";
25
2
  export {
26
- ShiroRenderer
3
+ S as ShiroRenderer,
4
+ S2 as default
27
5
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-kit-shiro",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "Production bundle for Shiroi blog",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,17 +25,17 @@
25
25
  "src/style.css"
26
26
  ],
27
27
  "dependencies": {
28
- "@haklex/rich-editor": "0.0.18",
29
- "@haklex/rich-ext-code-snippet": "0.0.18",
30
- "@haklex/rich-plugin-block-handle": "0.0.18",
31
- "@haklex/rich-editor-ui": "0.0.18",
32
- "@haklex/rich-ext-tldraw": "0.0.18",
33
- "@haklex/rich-plugin-floating-toolbar": "0.0.18",
34
- "@haklex/rich-plugin-link-edit": "0.0.18",
35
- "@haklex/rich-plugin-slash-menu": "0.0.18",
36
- "@haklex/rich-plugin-table": "0.0.18",
37
- "@haklex/rich-renderers": "0.0.18",
38
- "@haklex/rich-renderers-edit": "0.0.18"
28
+ "@haklex/rich-editor": "0.0.19",
29
+ "@haklex/rich-editor-ui": "0.0.19",
30
+ "@haklex/rich-ext-tldraw": "0.0.19",
31
+ "@haklex/rich-plugin-block-handle": "0.0.19",
32
+ "@haklex/rich-ext-code-snippet": "0.0.19",
33
+ "@haklex/rich-plugin-table": "0.0.19",
34
+ "@haklex/rich-plugin-link-edit": "0.0.19",
35
+ "@haklex/rich-plugin-slash-menu": "0.0.19",
36
+ "@haklex/rich-renderers": "0.0.19",
37
+ "@haklex/rich-renderers-edit": "0.0.19",
38
+ "@haklex/rich-plugin-floating-toolbar": "0.0.19"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@lexical/react": "^0.40.0",