@haklex/rich-editor 0.0.79 → 0.0.81

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,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
- };