@haklex/rich-editor 0.0.80 → 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.
Files changed (35) hide show
  1. package/dist/AlertQuoteEditNode-BDoonB4u.js +267 -0
  2. package/dist/KaTeXRenderer-BsyRH5_t.js +214 -0
  3. package/dist/LinkCardRenderer-OEMBDUhD.js +45 -0
  4. package/dist/MermaidPlugin-Df2Cm2yX.js +67 -0
  5. package/dist/PresentDialogContext-DQw6MrNh.js +59 -0
  6. package/dist/RubyRenderer-BpDb_amz.js +14 -0
  7. package/dist/SubmitShortcutPlugin-6IvsbZD-.js +1463 -0
  8. package/dist/commands-entry.mjs +14 -23
  9. package/dist/config-tfg1FWhG.js +1149 -0
  10. package/dist/context/NestedContentRendererContext.d.ts +2 -1
  11. package/dist/context/NestedContentRendererContext.d.ts.map +1 -1
  12. package/dist/favicon-DIWusrrw.js +41 -0
  13. package/dist/index.mjs +259 -284
  14. package/dist/node-registry-CeVi2y9f.js +666 -0
  15. package/dist/nodes-entry.mjs +7 -47
  16. package/dist/plugins-entry.mjs +10 -27
  17. package/dist/renderers-entry.mjs +40 -57
  18. package/dist/rich-editor.css +2 -1
  19. package/dist/shared.css-wgGgtK_e.js +23 -0
  20. package/dist/static-entry.mjs +16 -45
  21. package/dist/styles-entry.mjs +3 -12
  22. package/dist/theme-DHOUKKSr.js +1034 -0
  23. package/package.json +4 -4
  24. package/dist/AlertQuoteEditNode-CHdvQnOr.js +0 -293
  25. package/dist/KaTeXRenderer-C8jv_5xr.js +0 -214
  26. package/dist/LinkCardRenderer-QmkOlyXb.js +0 -36
  27. package/dist/MermaidPlugin-DjLUVZvB.js +0 -97
  28. package/dist/PresentDialogContext-BpSB8tXC.js +0 -52
  29. package/dist/RubyRenderer-DbeobSoH.js +0 -13
  30. package/dist/SubmitShortcutPlugin-BFBAwTb1.js +0 -1627
  31. package/dist/config-DcR_yktp.js +0 -1236
  32. package/dist/favicon-BQgbXF_a.js +0 -43
  33. package/dist/node-registry-B2U2_LrI.js +0 -766
  34. package/dist/shared.css-DNuMYx6Q.js +0 -21
  35. package/dist/theme-CYsyGmCL.js +0 -1040
@@ -1,52 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { Mail, Globe } from "lucide-react";
3
- import { useState, useEffect, createContext, use } from "react";
4
- import { g as getHostname, p as probeFavicon } from "./favicon-BQgbXF_a.js";
5
- function LinkFavicon({
6
- href,
7
- source,
8
- noIcon = false,
9
- className,
10
- platformIconMap,
11
- getPlatformFromUrl
12
- }) {
13
- const [faviconUrl, setFaviconUrl] = useState(null);
14
- useEffect(() => {
15
- if (!href) return;
16
- const hostname = getHostname(href);
17
- if (!hostname) return;
18
- let cancelled = false;
19
- probeFavicon(hostname).then((url) => {
20
- if (!cancelled) setFaviconUrl(url);
21
- });
22
- return () => {
23
- cancelled = true;
24
- };
25
- }, [href]);
26
- if (noIcon || !href && !source) return null;
27
- let platformType = source;
28
- if (!platformType && href && getPlatformFromUrl) {
29
- try {
30
- platformType = getPlatformFromUrl(new URL(href)) ?? void 0;
31
- } catch {
32
- }
33
- }
34
- if (platformType && platformIconMap?.[platformType]) {
35
- return /* @__PURE__ */ jsx("span", { className: `rich-link-favicon ${className ?? ""}`.trim(), children: platformIconMap[platformType] });
36
- }
37
- if (faviconUrl) {
38
- return /* @__PURE__ */ jsx("span", { className: `rich-link-favicon ${className ?? ""}`.trim(), children: /* @__PURE__ */ jsx("img", { alt: "", "aria-hidden": "true", height: 14, src: faviconUrl, width: 14 }) });
39
- }
40
- const isMailto = href?.toLowerCase().startsWith("mailto:");
41
- return /* @__PURE__ */ jsx("span", { className: `rich-link-favicon ${className ?? ""}`.trim(), children: isMailto ? /* @__PURE__ */ jsx(Mail, { "aria-hidden": true, size: 14 }) : /* @__PURE__ */ jsx(Globe, { "aria-hidden": true, size: 14 }) });
42
- }
43
- const PresentDialogContext = createContext(null);
44
- const PresentDialogProvider = PresentDialogContext.Provider;
45
- function usePresentDialog() {
46
- return use(PresentDialogContext);
47
- }
48
- export {
49
- LinkFavicon as L,
50
- PresentDialogProvider as P,
51
- usePresentDialog as u
52
- };
@@ -1,13 +0,0 @@
1
- import { jsx, Fragment, jsxs } from "react/jsx-runtime";
2
- function RubyRenderer({ reading, children }) {
3
- if (!reading) {
4
- return /* @__PURE__ */ jsx(Fragment, { children });
5
- }
6
- return /* @__PURE__ */ jsxs("ruby", { className: "rich-ruby", children: [
7
- children,
8
- /* @__PURE__ */ jsx("rt", { className: "rich-ruby-rt", children: reading })
9
- ] });
10
- }
11
- export {
12
- RubyRenderer as R
13
- };