@haklex/rich-static-renderer 0.0.44 → 0.0.45

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 +1 @@
1
- {"version":3,"file":"renderBuiltinNode.d.ts","sourceRoot":"","sources":["../../src/engine/renderBuiltinNode.tsx"],"names":[],"mappings":"AACA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAmBrD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAC5B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,SAAS,CAkMX"}
1
+ {"version":3,"file":"renderBuiltinNode.d.ts","sourceRoot":"","sources":["../../src/engine/renderBuiltinNode.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAmBrD,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,GAAG,EACT,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,SAAS,EAAE,GAAG,IAAI,EAC5B,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,SAAS,CAmMX"}
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { RendererWrapper, RubyRenderer, getVariantClass, allNodes, ColorSchemeProvider, RendererConfigProvider, FootnoteDefinitionsProvider, NestedContentRendererProvider, editorTheme } from "@haklex/rich-editor/static";
2
+ import { RendererWrapper, RubyRenderer, LinkFavicon, getVariantClass, allNodes, ColorSchemeProvider, RendererConfigProvider, FootnoteDefinitionsProvider, NestedContentRendererProvider, editorTheme } from "@haklex/rich-editor/static";
3
3
  import { PortalThemeProvider } from "@haklex/rich-style-token";
4
4
  import { createHeadlessEditor } from "@lexical/headless";
5
5
  import { $getRoot } from "lexical";
@@ -43,8 +43,7 @@ function renderBuiltinNode(node, key, children, headingSlugs) {
43
43
  "a",
44
44
  {
45
45
  className: "rich-heading-anchor",
46
- "aria-hidden": "true",
47
- tabIndex: -1,
46
+ tabIndex: 0,
48
47
  href: `#${slug}`
49
48
  }
50
49
  ),
@@ -80,26 +79,32 @@ function renderBuiltinNode(node, key, children, headingSlugs) {
80
79
  return /* @__PURE__ */ jsx("li", { className: cls, value: node.value, children }, key);
81
80
  }
82
81
  case "link":
83
- return /* @__PURE__ */ jsx(
82
+ return /* @__PURE__ */ jsxs(
84
83
  "a",
85
84
  {
86
85
  className: "rich-link",
87
86
  href: node.url,
88
- target: node.target,
89
- rel: node.rel,
90
- children
87
+ target: node.target || "_blank",
88
+ rel: node.rel || "noopener",
89
+ children: [
90
+ /* @__PURE__ */ jsx(LinkFavicon, { href: node.url }),
91
+ children
92
+ ]
91
93
  },
92
94
  key
93
95
  );
94
96
  case "autolink":
95
- return /* @__PURE__ */ jsx(
97
+ return /* @__PURE__ */ jsxs(
96
98
  "a",
97
99
  {
98
100
  className: "rich-link",
99
101
  href: node.url,
100
102
  target: "_blank",
101
- rel: "noopener noreferrer",
102
- children
103
+ rel: "noopener",
104
+ children: [
105
+ /* @__PURE__ */ jsx(LinkFavicon, { href: node.url }),
106
+ children
107
+ ]
103
108
  },
104
109
  key
105
110
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haklex/rich-static-renderer",
3
- "version": "0.0.44",
3
+ "version": "0.0.45",
4
4
  "description": "Headless SSR engine for Lexical rich content",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -16,8 +16,8 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@lexical/headless": "^0.41.0",
19
- "@haklex/rich-editor": "0.0.44",
20
- "@haklex/rich-style-token": "0.0.44"
19
+ "@haklex/rich-style-token": "0.0.45",
20
+ "@haklex/rich-editor": "0.0.45"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@lexical/code": "^0.41.0",