@flamingo-stack/openframe-frontend-core 0.0.744 → 0.0.747
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.
- package/dist/build/export-map.json +1 -1
- package/dist/{chunk-HTQJYN47.cjs → chunk-2CEQGGRN.cjs} +32 -32
- package/dist/{chunk-PYWHDPVC.cjs → chunk-4AWI6CCU.cjs} +38 -38
- package/dist/{chunk-FTYQS6VI.cjs → chunk-4DT5YXTM.cjs} +13 -13
- package/dist/{chunk-YJRMCFX3.cjs → chunk-4MGZYY6U.cjs} +7 -7
- package/dist/{chunk-HMSUYWSB.cjs → chunk-6RTHHU3S.cjs} +4 -4
- package/dist/{chunk-7YDF3QBN.cjs → chunk-7Y5U3Y4S.cjs} +320 -207
- package/dist/{chunk-GAGNKWOC.cjs → chunk-BBM2ICOY.cjs} +2 -2
- package/dist/{chunk-4N7KGOBS.cjs → chunk-BEC43GHL.cjs} +3 -3
- package/dist/{chunk-OC2LBQQJ.cjs → chunk-C7NTL2GV.cjs} +80 -80
- package/dist/{chunk-QZYF2YQ3.cjs → chunk-FCQCEQBY.cjs} +6 -6
- package/dist/{chunk-URVIPSAJ.cjs → chunk-HNLI4OU5.cjs} +14 -14
- package/dist/{chunk-2UBR53AN.cjs → chunk-HTMHDEIV.cjs} +4 -4
- package/dist/{chunk-NURAL5HD.cjs → chunk-IJA3OZWF.cjs} +24 -24
- package/dist/{chunk-ABLUMGCI.cjs → chunk-JHQNUWFM.cjs} +83 -33
- package/dist/{chunk-QSO56JZ2.cjs → chunk-JPSMPXCH.cjs} +90 -90
- package/dist/{chunk-UY6A6TEY.cjs → chunk-L2IQESTQ.cjs} +2 -2
- package/dist/{chunk-AT6ZI4CO.cjs → chunk-LLAKQT3B.cjs} +12 -12
- package/dist/{chunk-HHL23RFC.cjs → chunk-MA7T36JY.cjs} +35 -35
- package/dist/{chunk-H62FNZGG.cjs → chunk-O6QQ44I3.cjs} +18 -18
- package/dist/{chunk-LJ46XYYP.cjs → chunk-P7KTAXXE.cjs} +41 -27
- package/dist/{chunk-2JRCJV3M.cjs → chunk-PIQRV4EQ.cjs} +5 -5
- package/dist/{chunk-OWGLRE74.cjs → chunk-PSIKUDUV.cjs} +8 -8
- package/dist/{chunk-4A6OF4HI.cjs → chunk-PSSGIZXZ.cjs} +44 -44
- package/dist/{chunk-YIOWV7LS.cjs → chunk-QPSQ5WLG.cjs} +2 -2
- package/dist/{chunk-HJ4KGA2M.cjs → chunk-R3FXJXSQ.cjs} +1226 -1012
- package/dist/{chunk-65LJNDR2.cjs → chunk-TYW7NBP7.cjs} +20 -20
- package/dist/{chunk-U2O5YQRP.cjs → chunk-U6XWGK53.cjs} +33 -33
- package/dist/{chunk-35IQLGV3.cjs → chunk-WY4FKKCV.cjs} +74 -74
- package/dist/{chunk-JGZEHBBD.cjs → chunk-YIRX6C7V.cjs} +10 -10
- package/dist/{chunk-5TCIRWHL.cjs → chunk-YRULLK7N.cjs} +5 -5
- package/dist/{cloud-tenants-JPXAXSPE.cjs → cloud-tenants-QJZIF2JS.cjs} +13 -13
- package/dist/components/case-studies/index.cjs +31 -29
- package/dist/components/case-studies/share-experience-section.d.ts.map +1 -1
- package/dist/components/case-studies/share-experience-section.js +6 -5
- package/dist/components/chat/index.cjs +9 -9
- package/dist/components/contact/index.cjs +14 -14
- package/dist/components/docs/index.cjs +17 -17
- package/dist/components/embeds/index.cjs +14 -14
- package/dist/components/embeds/reddit-embed-client.d.ts +3 -1
- package/dist/components/embeds/reddit-embed-client.d.ts.map +1 -1
- package/dist/components/embeds/reddit-embed-client.js +5 -3
- package/dist/components/embeds/twitter-embed-client.d.ts +3 -1
- package/dist/components/embeds/twitter-embed-client.d.ts.map +1 -1
- package/dist/components/embeds/twitter-embed-client.js +5 -3
- package/dist/components/faq/index.cjs +15 -15
- package/dist/components/features/index.cjs +13 -13
- package/dist/components/help-center-pages/index.cjs +116 -116
- package/dist/components/index.cjs +125 -125
- package/dist/components/layout/page-heading.d.ts +16 -0
- package/dist/components/layout/page-heading.d.ts.map +1 -1
- package/dist/components/layout/page-heading.js +16 -2
- package/dist/components/meeting-scheduler/index.cjs +63 -63
- package/dist/components/navigation/index.cjs +16 -16
- package/dist/components/onboarding-guides/index.cjs +16 -16
- package/dist/components/product-demo/index.cjs +9 -9
- package/dist/components/related-content/index.cjs +7 -7
- package/dist/components/tickets/index.cjs +19 -19
- package/dist/components/ui/filter-checkbox-item.d.ts +8 -2
- package/dist/components/ui/filter-checkbox-item.d.ts.map +1 -1
- package/dist/components/ui/filter-checkbox-item.js +14 -4
- package/dist/components/ui/index.cjs +19 -13
- package/dist/components/ui/index.d.ts +1 -0
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +1 -0
- package/dist/components/ui/layout-hold.d.ts +4 -3
- package/dist/components/ui/layout-hold.d.ts.map +1 -1
- package/dist/components/ui/layout-hold.js +29 -9
- package/dist/components/ui/markdown/base-components.d.ts.map +1 -1
- package/dist/components/ui/markdown/base-components.js +3 -2
- package/dist/components/ui/markdown/rich/embed-overrides.d.ts.map +1 -1
- package/dist/components/ui/markdown/rich/embed-overrides.js +11 -8
- package/dist/components/ui/markdown-editor.d.ts.map +1 -1
- package/dist/components/ui/markdown-editor.js +4 -0
- package/dist/components/ui/markdown-link-command.d.ts +37 -0
- package/dist/components/ui/markdown-link-command.d.ts.map +1 -0
- package/dist/components/ui/markdown-link-command.js +180 -0
- package/dist/components/unified-filter-logic.js +1 -1
- package/dist/components/vendor-tag.d.ts +12 -0
- package/dist/components/vendor-tag.d.ts.map +1 -1
- package/dist/components/vendor-tag.js +50 -47
- package/dist/{devices-ONC4JOVH.cjs → devices-V55KQCAL.cjs} +14 -14
- package/dist/{embeddable-chat-7ZEGCDVF.cjs → embeddable-chat-5CDR4I6E.cjs} +80 -80
- package/dist/index.cjs +38 -18
- package/dist/{knowledge-G7XU5YST.cjs → knowledge-S3VGDRKR.cjs} +14 -14
- package/dist/{logs-5B7NY4G6.cjs → logs-K5E2BGZE.cjs} +21 -21
- package/dist/{policies-OYR3SLJN.cjs → policies-BWU4FRFE.cjs} +17 -17
- package/dist/{remote-session-N4PJB5FW.cjs → remote-session-IYT4LWJC.cjs} +7 -7
- package/dist/{scripts-6CWHTY6U.cjs → scripts-25UPGXZU.cjs} +20 -20
- package/dist/{software-update-AJPIY4SQ.cjs → software-update-F6UC7ULZ.cjs} +17 -17
- package/dist/{tickets-board-O753S4ZB.cjs → tickets-board-4MT6ZB4F.cjs} +8 -8
- package/dist/utils/format.d.ts.map +1 -1
- package/dist/utils/format.js +2 -3
- package/dist/utils/index.cjs +193 -28
- package/dist/utils/index.d.ts +2 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +9 -6
- package/dist/utils/markdown-link.d.ts +44 -0
- package/dist/utils/markdown-link.d.ts.map +1 -0
- package/dist/utils/markdown-link.js +83 -0
- package/dist/utils/markdown-to-plain.d.ts +3 -16
- package/dist/utils/markdown-to-plain.d.ts.map +1 -1
- package/dist/utils/markdown-to-plain.js +33 -3
- package/dist/utils/vendor-classification.d.ts +43 -17
- package/dist/utils/vendor-classification.d.ts.map +1 -1
- package/dist/utils/vendor-classification.js +73 -22
- package/package.json +3 -1
- package/src/components/case-studies/share-experience-section.tsx +9 -6
- package/src/components/embeds/reddit-embed-client.tsx +7 -3
- package/src/components/embeds/twitter-embed-client.tsx +7 -3
- package/src/components/layout/page-heading.tsx +52 -11
- package/src/components/ui/filter-checkbox-item.tsx +21 -5
- package/src/components/ui/index.ts +1 -0
- package/src/components/ui/layout-hold.tsx +38 -10
- package/src/components/ui/markdown/base-components.tsx +5 -2
- package/src/components/ui/markdown/rich/embed-overrides.tsx +12 -9
- package/src/components/ui/markdown-editor.tsx +6 -0
- package/src/components/ui/markdown-link-command.tsx +252 -0
- package/src/components/unified-filter-logic.tsx +1 -1
- package/src/components/vendor-tag.tsx +73 -69
- package/src/utils/format.ts +2 -3
- package/src/utils/index.ts +8 -5
- package/src/utils/markdown-link.ts +148 -0
- package/src/utils/markdown-to-plain.ts +64 -22
- package/src/utils/vendor-classification.ts +113 -34
- package/dist/utils/format-text-stub.d.ts +0 -5
- package/dist/utils/format-text-stub.d.ts.map +0 -1
- package/dist/utils/format-text-stub.js +0 -20
- package/src/utils/format-text-stub.ts +0 -17
|
@@ -1,14 +1,44 @@
|
|
|
1
|
+
import { toText } from "hast-util-to-text";
|
|
2
|
+
import rehypeRaw from "rehype-raw";
|
|
3
|
+
import { remark } from "remark";
|
|
4
|
+
import remarkBreaks from "remark-breaks";
|
|
5
|
+
import remarkGfm from "remark-gfm";
|
|
6
|
+
import remarkRehype from "remark-rehype";
|
|
7
|
+
import { SKIP, visit } from "unist-util-visit";
|
|
1
8
|
function stripInlineMarkdown(s) {
|
|
2
9
|
return s.replace(/\[([^\]]+)\]\([^)]+\)/g, "$1").replace(/\*\*([^*]+)\*\*/g, "$1").replace(/\*([^*]+)\*/g, "$1").replace(/`([^`]+)`/g, "$1");
|
|
3
10
|
}
|
|
11
|
+
const toHtmlTree = remark().use(remarkGfm).use(remarkBreaks).use(remarkRehype, { allowDangerousHtml: true }).use(rehypeRaw);
|
|
12
|
+
const NOT_PROSE = /* @__PURE__ */ new Set(["pre", "img"]);
|
|
13
|
+
const TABLE_SECTIONS = /* @__PURE__ */ new Set(["thead", "tbody", "tfoot"]);
|
|
14
|
+
function proseTree(markdown) {
|
|
15
|
+
const tree = toHtmlTree.runSync(toHtmlTree.parse(markdown));
|
|
16
|
+
visit(tree, "element", (node, index, parent) => {
|
|
17
|
+
if (NOT_PROSE.has(node.tagName) && parent && index !== void 0) {
|
|
18
|
+
parent.children.splice(index, 1);
|
|
19
|
+
return [SKIP, index];
|
|
20
|
+
}
|
|
21
|
+
if (TABLE_SECTIONS.has(node.tagName) && parent && index !== void 0) {
|
|
22
|
+
const followedBySection = parent.children.slice(index + 1).some((sibling) => sibling.type === "element" && TABLE_SECTIONS.has(sibling.tagName));
|
|
23
|
+
const rows = node.children.filter(
|
|
24
|
+
(child) => child.type === "element" && child.tagName === "tr"
|
|
25
|
+
);
|
|
26
|
+
const lastRow = rows[rows.length - 1];
|
|
27
|
+
if (followedBySection && lastRow) {
|
|
28
|
+
lastRow.children.push({ type: "element", tagName: "br", properties: {}, children: [] });
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return void 0;
|
|
32
|
+
});
|
|
33
|
+
return tree;
|
|
34
|
+
}
|
|
4
35
|
function markdownToPlainText(markdown, options = {}) {
|
|
5
36
|
const { mode = "article", maxChars } = options;
|
|
6
|
-
let out =
|
|
7
|
-
out = stripInlineMarkdown(out).replace(/^#+\s*/gm, "").replace(/^\s*[-*+]\s+/gm, "");
|
|
37
|
+
let out = toText(proseTree(markdown));
|
|
8
38
|
if (mode === "preview") {
|
|
9
39
|
out = out.replace(/\s+/g, " ").trim();
|
|
10
40
|
} else {
|
|
11
|
-
out = out.replace(/\n{3,}/g, "\n\n").trim();
|
|
41
|
+
out = out.replace(/[^\S\n]*\n[^\S\n]*/g, "\n").replace(/\n{3,}/g, "\n\n").trim();
|
|
12
42
|
}
|
|
13
43
|
if (maxChars != null && out.length > maxChars) {
|
|
14
44
|
out = out.slice(0, maxChars);
|
|
@@ -1,26 +1,52 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Vendor classifications:
|
|
2
|
+
* Vendor classifications: whatever `vendor_classification.classification` holds on the
|
|
3
|
+
* server. The database owns the vocabulary (its CHECK constraint is the list), the catalog
|
|
4
|
+
* builds its filters from the rows that exist, and nothing here limits which values are valid.
|
|
3
5
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
6
|
+
* This module only ENRICHES the values we want to present specially: a curated label, a
|
|
7
|
+
* tooltip description and a group. A value with no entry still works everywhere, labelled
|
|
8
|
+
* by title case. To present a new value better, add an entry here; to make it exist, add it
|
|
9
|
+
* to the database.
|
|
7
10
|
*
|
|
8
|
-
*
|
|
9
|
-
* - `
|
|
10
|
-
* - `
|
|
11
|
+
* Groups:
|
|
12
|
+
* - `license`: how the software is licensed.
|
|
13
|
+
* - `lifecycle`: where the product is in its life (a tag and a filter; a card's one tag stays the license).
|
|
14
|
+
* - `openframe`: drawn with the OpenFrame mark and ONE word (`word`).
|
|
11
15
|
*/
|
|
12
|
-
export
|
|
13
|
-
export type
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
/** The word drawn beside the OpenFrame mark. */
|
|
17
|
-
word: string;
|
|
18
|
-
/** The full name, for plain-text surfaces (a select option, an aria label). */
|
|
16
|
+
export type VendorClassificationValue = string;
|
|
17
|
+
export type VendorClassificationGroup = 'license' | 'lifecycle' | 'openframe';
|
|
18
|
+
export interface VendorClassificationCopy {
|
|
19
|
+
/** The label on a tag, a filter and a plain-text surface. */
|
|
19
20
|
label: string;
|
|
20
21
|
/** What the classification means, for a tooltip. */
|
|
21
22
|
description: string;
|
|
23
|
+
group: VendorClassificationGroup;
|
|
24
|
+
/** OpenFrame group only: the one word drawn beside the OpenFrame mark. */
|
|
25
|
+
word?: string;
|
|
26
|
+
/** The icon drawn beside the label, by name (resolved by the shared icon resolver), and its tone. */
|
|
27
|
+
icon?: VendorClassificationIconConfig;
|
|
22
28
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
29
|
+
/**
|
|
30
|
+
* A classification's icon, as data: `name` is any name the shared resolver knows (an alias such
|
|
31
|
+
* as `openframe-logo`, an icon of the design set by its kebab name, or a lucide name). `tone`:
|
|
32
|
+
* `accent` (the brand colour), `neutral` (secondary text on a tile) or `warning`.
|
|
33
|
+
*/
|
|
34
|
+
export interface VendorClassificationIconConfig {
|
|
35
|
+
name: string;
|
|
36
|
+
tone: 'accent' | 'neutral' | 'warning';
|
|
37
|
+
}
|
|
38
|
+
/** In display order: a filter list shows OpenFrame first, then license, then lifecycle. */
|
|
39
|
+
export declare const VENDOR_CLASSIFICATION_COPY: Readonly<Record<string, VendorClassificationCopy>>;
|
|
40
|
+
/** The enrichment of a classification, or undefined for a value we do not present specially. */
|
|
41
|
+
export declare function vendorClassificationCopy(value: string | null | undefined): VendorClassificationCopy | undefined;
|
|
42
|
+
/** The group of a classification, or undefined for a value with no enrichment. */
|
|
43
|
+
export declare function vendorClassificationGroup(value: string | null | undefined): VendorClassificationGroup | undefined;
|
|
44
|
+
/** A classification drawn with the OpenFrame mark (it has a `word`). */
|
|
45
|
+
export declare function isOpenFrameClassification(value: string | null | undefined): boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Sort order for a list of classifications (a filter list): the enriched values in their
|
|
48
|
+
* display order (OpenFrame Selected, Connect, Shipped, then license, then lifecycle), then
|
|
49
|
+
* every other value the server holds, alphabetically.
|
|
50
|
+
*/
|
|
51
|
+
export declare function compareVendorClassifications(a: string, b: string): number;
|
|
26
52
|
//# sourceMappingURL=vendor-classification.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-classification.d.ts","sourceRoot":"","sources":["../../src/utils/vendor-classification.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"vendor-classification.d.ts","sourceRoot":"","sources":["../../src/utils/vendor-classification.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAE/C,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,WAAW,GAAG,WAAW,CAAC;AAE9E,MAAM,WAAW,wBAAwB;IACvC,6DAA6D;IAC7D,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,yBAAyB,CAAC;IACjC,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qGAAqG;IACrG,IAAI,CAAC,EAAE,8BAA8B,CAAC;CACvC;AAED;;;;GAIG;AACH,MAAM,WAAW,8BAA8B;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;CACxC;AAED,2FAA2F;AAC3F,eAAO,MAAM,0BAA0B,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CA6DzF,CAAC;AAEF,gGAAgG;AAChG,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,wBAAwB,GAAG,SAAS,CAG/G;AAED,kFAAkF;AAClF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,yBAAyB,GAAG,SAAS,CAEjH;AAED,wEAAwE;AACxE,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,OAAO,CAEnF;AAID;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CASzE"}
|
|
@@ -1,36 +1,87 @@
|
|
|
1
|
-
const
|
|
2
|
-
"open_source",
|
|
3
|
-
"commercial",
|
|
4
|
-
"openframe_selected",
|
|
5
|
-
"openframe_shipped",
|
|
6
|
-
"openframe_connect"
|
|
7
|
-
];
|
|
8
|
-
const OPENFRAME_CLASSIFICATIONS = {
|
|
1
|
+
const VENDOR_CLASSIFICATION_COPY = {
|
|
9
2
|
openframe_selected: {
|
|
10
|
-
word: "Selected",
|
|
11
3
|
label: "OpenFrame Selected",
|
|
12
|
-
|
|
4
|
+
word: "Selected",
|
|
5
|
+
description: "OpenFrame is a unified platform that integrates multiple open-source IT and security tools into a single dashboard for MSPs. This filter shows vendors selected by our team for their excellence, community support, and MSP-specific value.",
|
|
6
|
+
group: "openframe",
|
|
7
|
+
icon: { name: "openframe-logo", tone: "accent" }
|
|
8
|
+
},
|
|
9
|
+
openframe_connect: {
|
|
10
|
+
label: "OpenFrame Connect",
|
|
11
|
+
word: "Connect",
|
|
12
|
+
description: "Services OpenFrame connects to and manages for every client, such as Microsoft 365 and Google Workspace, beside devices and tickets.",
|
|
13
|
+
group: "openframe",
|
|
14
|
+
icon: { name: "openframe-logo", tone: "accent" }
|
|
13
15
|
},
|
|
14
16
|
openframe_shipped: {
|
|
15
|
-
word: "Shipped",
|
|
16
17
|
label: "OpenFrame Shipped",
|
|
17
|
-
|
|
18
|
+
word: "Shipped",
|
|
19
|
+
description: "Tools and OpenFrame products that are in the released OpenFrame product today, not on the roadmap.",
|
|
20
|
+
group: "openframe",
|
|
21
|
+
icon: { name: "openframe-logo", tone: "accent" }
|
|
18
22
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
open_source: {
|
|
24
|
+
label: "Open Source",
|
|
25
|
+
description: "Released under an OSI-approved open-source license.",
|
|
26
|
+
group: "license",
|
|
27
|
+
icon: { name: "code", tone: "accent" }
|
|
28
|
+
},
|
|
29
|
+
source_available: {
|
|
30
|
+
label: "Source-available",
|
|
31
|
+
description: "The source code is public, but the license restricts how it may be used (for example SSPL, BSL, the Elastic License, or limits on company size or on offering it as a service).",
|
|
32
|
+
group: "license",
|
|
33
|
+
icon: { name: "file-code", tone: "neutral" }
|
|
34
|
+
},
|
|
35
|
+
commercial: {
|
|
36
|
+
label: "Commercial",
|
|
37
|
+
description: "Proprietary software sold by the vendor.",
|
|
38
|
+
group: "license",
|
|
39
|
+
icon: { name: "dollar", tone: "neutral" }
|
|
40
|
+
},
|
|
41
|
+
end_of_life: {
|
|
42
|
+
label: "End of life",
|
|
43
|
+
description: "The vendor has discontinued or retired the product. No new releases.",
|
|
44
|
+
group: "lifecycle",
|
|
45
|
+
icon: { name: "alert-triangle", tone: "warning" }
|
|
46
|
+
},
|
|
47
|
+
end_of_support: {
|
|
48
|
+
label: "End of support",
|
|
49
|
+
description: "The vendor no longer provides support or security fixes, though the product can still be obtained.",
|
|
50
|
+
group: "lifecycle",
|
|
51
|
+
icon: { name: "clock", tone: "warning" }
|
|
52
|
+
},
|
|
53
|
+
unmaintained: {
|
|
54
|
+
label: "Unmaintained",
|
|
55
|
+
description: "No release for years and no official end-of-life notice.",
|
|
56
|
+
group: "lifecycle",
|
|
57
|
+
icon: { name: "pause-circle", tone: "warning" }
|
|
23
58
|
}
|
|
24
59
|
};
|
|
25
|
-
function
|
|
26
|
-
|
|
60
|
+
function vendorClassificationCopy(value) {
|
|
61
|
+
if (!value || !Object.prototype.hasOwnProperty.call(VENDOR_CLASSIFICATION_COPY, value)) return void 0;
|
|
62
|
+
return VENDOR_CLASSIFICATION_COPY[value];
|
|
63
|
+
}
|
|
64
|
+
function vendorClassificationGroup(value) {
|
|
65
|
+
return vendorClassificationCopy(value)?.group;
|
|
27
66
|
}
|
|
28
67
|
function isOpenFrameClassification(value) {
|
|
29
|
-
return
|
|
68
|
+
return vendorClassificationGroup(value) === "openframe";
|
|
69
|
+
}
|
|
70
|
+
const DISPLAY_ORDER = Object.keys(VENDOR_CLASSIFICATION_COPY);
|
|
71
|
+
function compareVendorClassifications(a, b) {
|
|
72
|
+
const ia = DISPLAY_ORDER.indexOf(a);
|
|
73
|
+
const ib = DISPLAY_ORDER.indexOf(b);
|
|
74
|
+
if (ia !== -1 || ib !== -1) {
|
|
75
|
+
if (ia === -1) return 1;
|
|
76
|
+
if (ib === -1) return -1;
|
|
77
|
+
return ia - ib;
|
|
78
|
+
}
|
|
79
|
+
return a.localeCompare(b);
|
|
30
80
|
}
|
|
31
81
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
82
|
+
VENDOR_CLASSIFICATION_COPY,
|
|
83
|
+
compareVendorClassifications,
|
|
34
84
|
isOpenFrameClassification,
|
|
35
|
-
|
|
85
|
+
vendorClassificationCopy,
|
|
86
|
+
vendorClassificationGroup
|
|
36
87
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flamingo-stack/openframe-frontend-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.747",
|
|
4
4
|
"description": "Shared design system and components for all Flamingo platforms",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -480,6 +480,7 @@
|
|
|
480
480
|
"framer-motion": "^12.23.12",
|
|
481
481
|
"globals": "^16.4.0",
|
|
482
482
|
"graphql": "^16.12.0",
|
|
483
|
+
"hast-util-to-text": "^4.0.2",
|
|
483
484
|
"libphonenumber-js": "^1.12.40",
|
|
484
485
|
"lucide-react": "^0.454.0",
|
|
485
486
|
"mermaid": "^11.14.0",
|
|
@@ -504,6 +505,7 @@
|
|
|
504
505
|
"remark": "^15.0.1",
|
|
505
506
|
"remark-breaks": "^4.0.0",
|
|
506
507
|
"remark-gfm": "^4.0.1",
|
|
508
|
+
"remark-rehype": "^11.1.2",
|
|
507
509
|
"sonner": "^1.2.4",
|
|
508
510
|
"tailwind-merge": "^3.4.0",
|
|
509
511
|
"tailwindcss-animate": "^1.0.7",
|
|
@@ -7,7 +7,7 @@ import { CapterraIcon } from '../icons-v2-generated/brand-logos/capterra-icon';
|
|
|
7
7
|
import { G2Icon } from '../icons-v2-generated/brand-logos/g2-icon';
|
|
8
8
|
import { GetappIcon } from '../icons-v2-generated/brand-logos/getapp-icon';
|
|
9
9
|
import { TrustpilotIcon } from '../icons-v2-generated/brand-logos/trustpilot-icon';
|
|
10
|
-
import { accentSentenceMarks } from '../layout/page-heading';
|
|
10
|
+
import { accentSentenceMarks, HeadingLines } from '../layout/page-heading';
|
|
11
11
|
import { BenefitCard, BenefitCardGrid } from '../ui';
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -56,11 +56,14 @@ export interface ShareExperienceSectionProps {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const DEFAULT_TITLE: React.ReactNode = (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
<HeadingLines>
|
|
60
|
+
{[
|
|
61
|
+
'Share Your Experience',
|
|
62
|
+
<>
|
|
63
|
+
with Fellow MSPs<span className="text-ods-accent">:</span>
|
|
64
|
+
</>,
|
|
65
|
+
]}
|
|
66
|
+
</HeadingLines>
|
|
64
67
|
);
|
|
65
68
|
|
|
66
69
|
const DEFAULT_SUBTITLE: React.ReactNode = (
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useState, useEffect, useRef } from 'react';
|
|
4
4
|
import Link from '../../embed-shims/next-link';
|
|
5
5
|
import { formatLargeNumber } from '../../utils/format';
|
|
6
|
+
import { renderedLinkRel } from '../../utils/markdown-link';
|
|
6
7
|
import type { MediaItem as CarouselMediaItem } from '../../utils/media-carousel-utils-stub';
|
|
7
8
|
import { socialCache } from '../../utils/social-embed-cache';
|
|
8
9
|
import { MediaCarousel } from '../media-carousel';
|
|
@@ -159,10 +160,13 @@ type RedditListingResponse = Array<{ data?: { children?: Array<{ data?: RedditPo
|
|
|
159
160
|
|
|
160
161
|
interface RedditEmbedProps {
|
|
161
162
|
url: string;
|
|
163
|
+
/** The `rel` the author wrote on the post's link (`nofollow` …), kept on the card's links to the post. */
|
|
164
|
+
rel?: string;
|
|
162
165
|
maxWidth?: number;
|
|
163
166
|
}
|
|
164
167
|
|
|
165
|
-
export function RedditEmbedClient({ url, maxWidth = 700 }: RedditEmbedProps) {
|
|
168
|
+
export function RedditEmbedClient({ url, maxWidth = 700, rel }: RedditEmbedProps) {
|
|
169
|
+
const postLinkRel = renderedLinkRel(rel, true);
|
|
166
170
|
const { redditProxyUrl } = useRichMarkdownRuntime();
|
|
167
171
|
const [redditData, setRedditData] = useState<RedditPost | null>(null);
|
|
168
172
|
const [loading, setLoading] = useState(true);
|
|
@@ -261,7 +265,7 @@ export function RedditEmbedClient({ url, maxWidth = 700 }: RedditEmbedProps) {
|
|
|
261
265
|
<Link
|
|
262
266
|
href={url}
|
|
263
267
|
target="_blank"
|
|
264
|
-
rel=
|
|
268
|
+
rel={postLinkRel}
|
|
265
269
|
className="inline-flex items-center space-x-2 rounded-md bg-[#FF4500] px-4 py-2 text-white transition-colors text-h6 hover:bg-[#E03D00]"
|
|
266
270
|
>
|
|
267
271
|
<RedditIcon />
|
|
@@ -562,7 +566,7 @@ export function RedditEmbedClient({ url, maxWidth = 700 }: RedditEmbedProps) {
|
|
|
562
566
|
<Link
|
|
563
567
|
href={url}
|
|
564
568
|
target="_blank"
|
|
565
|
-
rel=
|
|
569
|
+
rel={postLinkRel}
|
|
566
570
|
className="inline-flex items-center space-x-2 text-ods-accent transition-colors text-h6 hover:opacity-80"
|
|
567
571
|
>
|
|
568
572
|
<ExternalLinkIcon />
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
import { useState, useEffect, useRef } from 'react';
|
|
4
4
|
import Image from '../../embed-shims/next-image';
|
|
5
5
|
import Link from '../../embed-shims/next-link';
|
|
6
|
+
import { renderedLinkRel } from '../../utils/markdown-link';
|
|
6
7
|
import { socialCache } from '../../utils/social-embed-cache';
|
|
7
8
|
import { XLogoIcon } from '../icons-v2-generated/brand-logos/x-logo-icon';
|
|
8
9
|
import { TwitterContainer } from './embed-container';
|
|
@@ -71,11 +72,14 @@ interface TwitterOEmbedResponse {
|
|
|
71
72
|
|
|
72
73
|
interface TwitterEmbedProps {
|
|
73
74
|
url: string;
|
|
75
|
+
/** The `rel` the author wrote on the post's link (`nofollow` …), kept on the card's links to the post. */
|
|
76
|
+
rel?: string;
|
|
74
77
|
tweetId?: string;
|
|
75
78
|
maxWidth?: number;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
export function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }: TwitterEmbedProps) {
|
|
81
|
+
export function TwitterEmbedClient({ url, tweetId, maxWidth = 700, rel }: TwitterEmbedProps) {
|
|
82
|
+
const postLinkRel = renderedLinkRel(rel, true);
|
|
79
83
|
const { twitterProxyUrl } = useRichMarkdownRuntime();
|
|
80
84
|
const [tweetData, setTweetData] = useState<TwitterOEmbedResponse | null>(null);
|
|
81
85
|
const [fetchLoading, setLoading] = useState(true);
|
|
@@ -179,7 +183,7 @@ export function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }: TwitterEmbe
|
|
|
179
183
|
<Link
|
|
180
184
|
href={url}
|
|
181
185
|
target="_blank"
|
|
182
|
-
rel=
|
|
186
|
+
rel={postLinkRel}
|
|
183
187
|
className="inline-flex items-center space-x-2 rounded-md bg-ods-bg-surface px-4 py-2 text-ods-text-primary transition-colors text-h6 hover:bg-ods-bg-active"
|
|
184
188
|
>
|
|
185
189
|
<XIcon />
|
|
@@ -318,7 +322,7 @@ export function TwitterEmbedClient({ url, tweetId, maxWidth = 700 }: TwitterEmbe
|
|
|
318
322
|
<Link
|
|
319
323
|
href={url}
|
|
320
324
|
target="_blank"
|
|
321
|
-
rel=
|
|
325
|
+
rel={postLinkRel}
|
|
322
326
|
className="inline-flex items-center space-x-2 text-ods-accent transition-colors text-h6 hover:opacity-80"
|
|
323
327
|
>
|
|
324
328
|
<ExternalLinkIcon />
|
|
@@ -68,6 +68,41 @@ export function PageHeading({
|
|
|
68
68
|
);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
+
/**
|
|
72
|
+
* THE way a heading is drawn on more than one line: each line on its own line,
|
|
73
|
+
* with a space before every break. The space is what keeps the heading's TEXT
|
|
74
|
+
* (what search engines, screen readers and link previews read) in words:
|
|
75
|
+
* "own. Approved", never "own.Approved". It sits at the end of a line, where it
|
|
76
|
+
* draws nothing. An empty line is a blank line.
|
|
77
|
+
*
|
|
78
|
+
* Every multi-line title goes through this; never write a bare `<br />` or one
|
|
79
|
+
* block `<span>` per line in a heading. The lines are its children, so anything
|
|
80
|
+
* that walks a title's children (the accent marks) reaches every line.
|
|
81
|
+
*/
|
|
82
|
+
export interface HeadingLinesProps {
|
|
83
|
+
/** The title's lines, top to bottom: one child per line. */
|
|
84
|
+
children: ReactNode;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function HeadingLines({ children }: HeadingLinesProps) {
|
|
88
|
+
return (
|
|
89
|
+
<>
|
|
90
|
+
{Children.toArray(children).map((line, index) => (
|
|
91
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: a title's lines never reorder
|
|
92
|
+
<Fragment key={index}>
|
|
93
|
+
{index > 0 ? (
|
|
94
|
+
<>
|
|
95
|
+
{' '}
|
|
96
|
+
<br />
|
|
97
|
+
</>
|
|
98
|
+
) : null}
|
|
99
|
+
{line}
|
|
100
|
+
</Fragment>
|
|
101
|
+
))}
|
|
102
|
+
</>
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
|
|
71
106
|
/** A sentence mark inside a title: `.`, `:`, `?` or `!` that ends a sentence (followed by a space or the end). */
|
|
72
107
|
const SENTENCE_MARK = /([.:?!]+)(?=\s|$)/g;
|
|
73
108
|
const ONLY_MARKS = /^\s*[.:?!]+\s*$/;
|
|
@@ -116,17 +151,22 @@ function accentMarks(node: ReactNode, accentClassName: string): ReactNode {
|
|
|
116
151
|
if (ONLY_MARKS.test(node)) return node;
|
|
117
152
|
const parts = node.split(SENTENCE_MARK);
|
|
118
153
|
if (parts.length === 1) return node;
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
154
|
+
// One node for one string, so a list of children keeps its length (each of `HeadingLines`' lines stays one line).
|
|
155
|
+
return (
|
|
156
|
+
<>
|
|
157
|
+
{parts.map((part, index) =>
|
|
158
|
+
// `split` with one capture group alternates text, mark, text, mark...
|
|
159
|
+
index % 2 === 1 ? (
|
|
160
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: the parts of one string never reorder
|
|
161
|
+
<span key={index} className={accentClassName}>
|
|
162
|
+
{part}
|
|
163
|
+
</span>
|
|
164
|
+
) : (
|
|
165
|
+
// biome-ignore lint/suspicious/noArrayIndexKey: the parts of one string never reorder
|
|
166
|
+
<Fragment key={index}>{part}</Fragment>
|
|
167
|
+
),
|
|
168
|
+
)}
|
|
169
|
+
</>
|
|
130
170
|
);
|
|
131
171
|
}
|
|
132
172
|
if (Array.isArray(node)) {
|
|
@@ -225,6 +265,7 @@ export function SectionHeading({
|
|
|
225
265
|
// `contents`: the element names the heading and draws no box, so the stack lays its two children out as before.
|
|
226
266
|
<Tag className="contents">
|
|
227
267
|
{eyebrowNode}
|
|
268
|
+
{/* A space between the eyebrow and the title, so the heading's text reads "Eyebrow Title", not "EyebrowTitle". */}{' '}
|
|
228
269
|
<span className={`block ${layout.heading}`} data-section-heading>
|
|
229
270
|
{headingText}
|
|
230
271
|
</span>
|
|
@@ -1,30 +1,46 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
|
|
4
|
+
import type { ReactNode } from 'react';
|
|
4
5
|
import { cn } from '../../utils/cn';
|
|
5
6
|
import { CheckboxCheckmarkIcon } from '../icons-v2-generated/signs-and-symbols/checkbox-checkmark-icon';
|
|
6
7
|
|
|
7
8
|
export interface FilterCheckboxItemProps {
|
|
8
|
-
label
|
|
9
|
+
/** Text, or a richer label (an icon with a word and a tooltip). */
|
|
10
|
+
label: ReactNode;
|
|
11
|
+
/** The accessible name when `label` is not plain text. */
|
|
12
|
+
ariaLabel?: string;
|
|
9
13
|
checked: boolean;
|
|
10
14
|
onChange: (checked: boolean) => void;
|
|
11
15
|
count?: number;
|
|
16
|
+
/** Ignore clicks (e.g. while a navigation started by this filter is pending). */
|
|
17
|
+
disabled?: boolean;
|
|
12
18
|
className?: string;
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
export function FilterCheckboxItem({
|
|
21
|
+
export function FilterCheckboxItem({
|
|
22
|
+
label,
|
|
23
|
+
ariaLabel,
|
|
24
|
+
checked,
|
|
25
|
+
onChange,
|
|
26
|
+
count,
|
|
27
|
+
disabled,
|
|
28
|
+
className,
|
|
29
|
+
}: FilterCheckboxItemProps) {
|
|
16
30
|
return (
|
|
17
31
|
<div
|
|
18
32
|
className={cn(
|
|
19
33
|
'flex items-center gap-3 border-b border-ods-border bg-ods-card last:border-b-0',
|
|
20
|
-
'cursor-pointer transition-colors hover:bg-ods-bg-hover',
|
|
34
|
+
disabled ? 'cursor-wait opacity-70' : 'cursor-pointer transition-colors hover:bg-ods-bg-hover',
|
|
21
35
|
count !== undefined ? 'px-4 py-3' : 'p-3',
|
|
22
36
|
className,
|
|
23
37
|
)}
|
|
24
|
-
onClick={() => onChange(!checked)}
|
|
38
|
+
onClick={() => !disabled && onChange(!checked)}
|
|
25
39
|
>
|
|
26
40
|
<CheckboxPrimitive.Root
|
|
27
41
|
checked={checked}
|
|
42
|
+
disabled={disabled}
|
|
43
|
+
aria-label={ariaLabel ?? (typeof label === 'string' ? label : undefined)}
|
|
28
44
|
onCheckedChange={c => onChange(c === true)}
|
|
29
45
|
className={cn(
|
|
30
46
|
'h-6 w-6 shrink-0 rounded-[6px] border-2',
|
|
@@ -37,7 +53,7 @@ export function FilterCheckboxItem({ label, checked, onChange, count, className
|
|
|
37
53
|
<CheckboxCheckmarkIcon size={10} />
|
|
38
54
|
</CheckboxPrimitive.Indicator>
|
|
39
55
|
</CheckboxPrimitive.Root>
|
|
40
|
-
<span className="flex-1 text-ods-text-primary text-h4">{label}</span>
|
|
56
|
+
<span className="min-w-0 flex-1 text-ods-text-primary text-h4">{label}</span>
|
|
41
57
|
{count !== undefined && (
|
|
42
58
|
<span className="shrink-0 text-ods-text-secondary text-h5">{count.toLocaleString()}</span>
|
|
43
59
|
)}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { type ReactNode, type RefObject, useLayoutEffect, useRef, useState } from 'react';
|
|
2
4
|
import { cn } from '../../utils/cn';
|
|
5
|
+
import { SkeletonText } from './skeleton';
|
|
3
6
|
|
|
4
7
|
/**
|
|
5
8
|
* Holding a layout while its content is read, the two ways that are right at
|
|
@@ -10,7 +13,8 @@ import { cn } from '../../utils/cn';
|
|
|
10
13
|
*
|
|
11
14
|
* - `TextHold`: an inline stand-in exactly as wide as the words it is given
|
|
12
15
|
* (same font, same letter spacing, because it IS those words, not shown).
|
|
13
|
-
* `bar` draws
|
|
16
|
+
* `bar` draws a `SkeletonText` of as many lines as the words take; `blank`
|
|
17
|
+
* only keeps their space.
|
|
14
18
|
* - `LayoutHold`: a block as tall as the real layout rendered inside it, kept
|
|
15
19
|
* invisible and inert: the layout's own height, at any width.
|
|
16
20
|
*
|
|
@@ -19,27 +23,51 @@ import { cn } from '../../utils/cn';
|
|
|
19
23
|
export interface TextHoldProps {
|
|
20
24
|
/** The words whose width is held (the content's own, or a stand-in of its length). */
|
|
21
25
|
children: ReactNode;
|
|
22
|
-
/** `bar`: a
|
|
26
|
+
/** `bar`: a `SkeletonText` of as many lines as the words take. `blank`: the space only. */
|
|
23
27
|
variant?: 'bar' | 'blank';
|
|
24
28
|
className?: string;
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
export function TextHold({ children, variant = 'bar', className }: TextHoldProps) {
|
|
32
|
+
const hold = useRef<HTMLSpanElement>(null);
|
|
33
|
+
const words = useRef<HTMLSpanElement>(null);
|
|
34
|
+
const lines = useLineCount(hold, words, variant === 'bar');
|
|
28
35
|
return (
|
|
29
36
|
<span
|
|
37
|
+
ref={hold}
|
|
30
38
|
aria-hidden
|
|
31
|
-
className={cn(
|
|
32
|
-
variant === 'bar' ? 'animate-pulse rounded bg-ods-border text-transparent' : 'invisible',
|
|
33
|
-
// A hold is never selectable or clickable, whatever it wraps.
|
|
34
|
-
'pointer-events-none select-none',
|
|
35
|
-
className,
|
|
36
|
-
)}
|
|
39
|
+
className={cn('pointer-events-none select-none', variant === 'bar' && 'relative inline-block', className)}
|
|
37
40
|
>
|
|
38
|
-
{
|
|
41
|
+
<span ref={words} className="invisible">
|
|
42
|
+
{children}
|
|
43
|
+
</span>
|
|
44
|
+
{lines > 0 ? (
|
|
45
|
+
// `justify-around`: each `Skeleton` sits in the middle of the line it stands for.
|
|
46
|
+
<SkeletonText lines={lines} className="absolute inset-0 flex flex-col justify-around space-y-0" />
|
|
47
|
+
) : null}
|
|
39
48
|
</span>
|
|
40
49
|
);
|
|
41
50
|
}
|
|
42
51
|
|
|
52
|
+
/** How many lines the words take (one box per line), kept current as the width changes. */
|
|
53
|
+
function useLineCount(
|
|
54
|
+
hold: RefObject<HTMLSpanElement | null>,
|
|
55
|
+
words: RefObject<HTMLSpanElement | null>,
|
|
56
|
+
enabled: boolean,
|
|
57
|
+
): number {
|
|
58
|
+
const [lines, setLines] = useState(0);
|
|
59
|
+
useLayoutEffect(() => {
|
|
60
|
+
const box = hold.current;
|
|
61
|
+
if (!enabled || !box) return undefined;
|
|
62
|
+
const measure = () => setLines(words.current?.getClientRects().length ?? 0);
|
|
63
|
+
measure();
|
|
64
|
+
const observer = new ResizeObserver(measure);
|
|
65
|
+
observer.observe(box);
|
|
66
|
+
return () => observer.disconnect();
|
|
67
|
+
}, [hold, words, enabled]);
|
|
68
|
+
return lines;
|
|
69
|
+
}
|
|
70
|
+
|
|
43
71
|
export interface LayoutHoldProps {
|
|
44
72
|
/** The real layout, rendered with the data at hand. */
|
|
45
73
|
children: ReactNode;
|
|
@@ -14,6 +14,7 @@ import { useAuthedImageSrc } from '../../../hooks/use-authed-image-src';
|
|
|
14
14
|
import type { ResolveLinkResult } from '../../../types/doc-source';
|
|
15
15
|
import { cn } from '../../../utils/cn';
|
|
16
16
|
import { slugifyHeadingText } from '../../../utils/markdown-heading-id';
|
|
17
|
+
import { renderedLinkRel } from '../../../utils/markdown-link';
|
|
17
18
|
import { getHashTargetElement, navigateSamePageHash, HUB_HEADER_OFFSET_PX } from '../../../utils/same-page-hash-nav';
|
|
18
19
|
import { extractText, resolveFallbackHeadingId, useAssignedHeadingIds, useHeadingId } from './heading-ids';
|
|
19
20
|
import { MermaidDiagram } from './mermaid-diagram';
|
|
@@ -250,7 +251,7 @@ export function buildBaseComponents({
|
|
|
250
251
|
),
|
|
251
252
|
|
|
252
253
|
// --- links ---
|
|
253
|
-
a: ({ href, children, className: linkClassName }: MdRenderProps<'a'>) => {
|
|
254
|
+
a: ({ href, children, className: linkClassName, rel: authoredRel }: MdRenderProps<'a'>) => {
|
|
254
255
|
const isBroken = href !== undefined && brokenLinks.includes(href);
|
|
255
256
|
const isInternalDocLink =
|
|
256
257
|
propCurrentPath !== undefined &&
|
|
@@ -339,7 +340,9 @@ export function buildBaseComponents({
|
|
|
339
340
|
href={href}
|
|
340
341
|
className={`relative text-ods-accent no-underline transition-colors duration-200 after:absolute after:-bottom-0.5 after:left-0 after:h-0.5 after:w-0 after:bg-ods-accent after:transition-all after:duration-300 after:content-[''] hover:after:w-full ${linkClassName || ''}`}
|
|
341
342
|
target={href?.startsWith('http') ? '_blank' : undefined}
|
|
342
|
-
rel=
|
|
343
|
+
// The author's SEO tokens (`<a rel="nofollow">`, the editor's Nofollow choice) are kept;
|
|
344
|
+
// every other authored token is dropped, and a new-tab link always gets noopener noreferrer.
|
|
345
|
+
rel={renderedLinkRel(authoredRel, href?.startsWith('http') ?? false)}
|
|
343
346
|
onClick={inPageAnchorId !== null ? handleAnchorClick : undefined}
|
|
344
347
|
>
|
|
345
348
|
{children}
|