@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
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ICommand } from '@uiw/react-md-editor';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
import { type MarkdownLinkFields } from '../../utils/markdown-link';
|
|
4
|
+
export interface MarkdownLinkDialogProps {
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
/** The link being edited, or the selection a new link starts from. */
|
|
7
|
+
initial: MarkdownLinkFields;
|
|
8
|
+
/** True when `initial` is a link already in the text: the dialog then offers to remove it. */
|
|
9
|
+
editing: boolean;
|
|
10
|
+
onSubmit: (link: MarkdownLinkFields) => void;
|
|
11
|
+
/** Replaces the link with its text. */
|
|
12
|
+
onRemove: () => void;
|
|
13
|
+
onClose: () => void;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* The link dialog of the markdown editors: the link's text, its address, and what it tells search
|
|
17
|
+
* engines: Follow (the default), Nofollow, Sponsored or UGC. Any choice but Follow writes the link
|
|
18
|
+
* as `<a rel="…">`. A link that carries several values (`rel="ugc nofollow"`) keeps them all until
|
|
19
|
+
* the choice is changed.
|
|
20
|
+
*/
|
|
21
|
+
export declare function MarkdownLinkDialog({ isOpen, initial, editing, onSubmit, onRemove, onClose }: MarkdownLinkDialogProps): import("react").JSX.Element;
|
|
22
|
+
export interface MarkdownLinkCommand {
|
|
23
|
+
/**
|
|
24
|
+
* The editor's toolbar: the vendor's commands with its `link` command replaced by this dialog.
|
|
25
|
+
* `undefined` until the vendor's commands have loaded (the editor then shows its own defaults).
|
|
26
|
+
*/
|
|
27
|
+
commands: ICommand[] | undefined;
|
|
28
|
+
/** The dialog. Render it beside the editor. */
|
|
29
|
+
linkDialog: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The link command every markdown editor uses: the toolbar's link button and Ctrl/Cmd+L open
|
|
33
|
+
* {@link MarkdownLinkDialog} on the link under the caret (markdown or HTML), or on the selection
|
|
34
|
+
* for a new link, and write the result back as one undoable edit.
|
|
35
|
+
*/
|
|
36
|
+
export declare function useMarkdownLinkCommand(): MarkdownLinkCommand;
|
|
37
|
+
//# sourceMappingURL=markdown-link-command.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-link-command.d.ts","sourceRoot":"","sources":["../../../src/components/ui/markdown-link-command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,QAAQ,EAA8B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,KAAK,SAAS,EAAuC,MAAM,OAAO,CAAC;AAC5E,OAAO,EAIL,KAAK,kBAAkB,EACxB,MAAM,2BAA2B,CAAC;AAkCnC,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,OAAO,CAAC;IAChB,sEAAsE;IACtE,OAAO,EAAE,kBAAkB,CAAC;IAC5B,8FAA8F;IAC9F,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,CAAC;IAC7C,uCAAuC;IACvC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,uBAAuB,+BAiFpH;AAkBD,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,QAAQ,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IACjC,+CAA+C;IAC/C,UAAU,EAAE,SAAS,CAAC;CACvB;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,IAAI,mBAAmB,CA4E5D"}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect, useId, useMemo, useState } from "react";
|
|
4
|
+
import {
|
|
5
|
+
findMarkdownLinkAt,
|
|
6
|
+
formatMarkdownLink
|
|
7
|
+
} from "../../utils/markdown-link.js";
|
|
8
|
+
import { Button } from "./button/index.js";
|
|
9
|
+
import { Input } from "./input.js";
|
|
10
|
+
import { ModalV2, ModalV2Footer, ModalV2Header, ModalV2Title } from "./modal-v2.js";
|
|
11
|
+
import { TabSelector } from "./tab-selector.js";
|
|
12
|
+
const LINK_REL_CHOICES = [
|
|
13
|
+
{ id: "follow", label: "Follow", hint: "Search engines follow this link. This is the default." },
|
|
14
|
+
{
|
|
15
|
+
id: "nofollow",
|
|
16
|
+
label: "Nofollow",
|
|
17
|
+
hint: 'Search engines are asked not to follow this link (rel="nofollow").'
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
id: "sponsored",
|
|
21
|
+
label: "Sponsored",
|
|
22
|
+
hint: 'For ads, paid placements and sponsorships (rel="sponsored").'
|
|
23
|
+
},
|
|
24
|
+
{ id: "ugc", label: "UGC", hint: 'For links in content written by users, such as comments (rel="ugc").' }
|
|
25
|
+
];
|
|
26
|
+
const LINK_REL_ITEMS = LINK_REL_CHOICES.map(({ id, label }) => ({ id, label }));
|
|
27
|
+
function choiceOf(rel) {
|
|
28
|
+
if (rel.includes("sponsored")) return "sponsored";
|
|
29
|
+
if (rel.includes("ugc")) return "ugc";
|
|
30
|
+
if (rel.includes("nofollow")) return "nofollow";
|
|
31
|
+
return "follow";
|
|
32
|
+
}
|
|
33
|
+
function MarkdownLinkDialog({ isOpen, initial, editing, onSubmit, onRemove, onClose }) {
|
|
34
|
+
const formId = useId();
|
|
35
|
+
const [text, setText] = useState(initial.text);
|
|
36
|
+
const [url, setUrl] = useState(initial.url);
|
|
37
|
+
const [rel, setRel] = useState(initial.rel);
|
|
38
|
+
const [seededWith, setSeededWith] = useState({ isOpen, initial });
|
|
39
|
+
if (seededWith.isOpen !== isOpen || seededWith.initial !== initial) {
|
|
40
|
+
setSeededWith({ isOpen, initial });
|
|
41
|
+
if (isOpen) {
|
|
42
|
+
setText(initial.text);
|
|
43
|
+
setUrl(initial.url);
|
|
44
|
+
setRel(initial.rel);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const choice = choiceOf(rel);
|
|
48
|
+
const trimmedUrl = url.trim();
|
|
49
|
+
const submit = () => {
|
|
50
|
+
if (!trimmedUrl) return;
|
|
51
|
+
onSubmit({ text: text.trim(), url: trimmedUrl, rel });
|
|
52
|
+
};
|
|
53
|
+
return /* @__PURE__ */ jsxs(ModalV2, { isOpen, onClose, className: "text-left md:max-w-[560px]", children: [
|
|
54
|
+
/* @__PURE__ */ jsx(ModalV2Header, { children: /* @__PURE__ */ jsx(ModalV2Title, { children: editing ? "Edit link" : "Add link" }) }),
|
|
55
|
+
/* @__PURE__ */ jsxs(
|
|
56
|
+
"form",
|
|
57
|
+
{
|
|
58
|
+
id: formId,
|
|
59
|
+
className: "flex w-full flex-col gap-[var(--spacing-system-l)]",
|
|
60
|
+
onSubmit: (event) => {
|
|
61
|
+
event.preventDefault();
|
|
62
|
+
submit();
|
|
63
|
+
},
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ jsx(Input, { label: "Text", value: text, onChange: (event) => setText(event.target.value), placeholder: "Link text" }),
|
|
66
|
+
/* @__PURE__ */ jsx(
|
|
67
|
+
Input,
|
|
68
|
+
{
|
|
69
|
+
label: "URL",
|
|
70
|
+
value: url,
|
|
71
|
+
onChange: (event) => setUrl(event.target.value),
|
|
72
|
+
placeholder: "https://",
|
|
73
|
+
autoFocus: true,
|
|
74
|
+
inputMode: "url"
|
|
75
|
+
}
|
|
76
|
+
),
|
|
77
|
+
/* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-[var(--spacing-system-xsf)]", children: [
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
TabSelector,
|
|
80
|
+
{
|
|
81
|
+
label: "Search engines",
|
|
82
|
+
value: choice,
|
|
83
|
+
onValueChange: (value) => {
|
|
84
|
+
const next = LINK_REL_CHOICES.find((option) => option.id === value)?.id ?? "follow";
|
|
85
|
+
setRel(next === "follow" ? [] : [next]);
|
|
86
|
+
},
|
|
87
|
+
items: LINK_REL_ITEMS,
|
|
88
|
+
variant: "secondary"
|
|
89
|
+
}
|
|
90
|
+
),
|
|
91
|
+
/* @__PURE__ */ jsx("p", { className: "text-ods-text-secondary text-h6", children: LINK_REL_CHOICES.find((option) => option.id === choice)?.hint })
|
|
92
|
+
] })
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsxs(ModalV2Footer, { children: [
|
|
97
|
+
editing ? /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onRemove, className: "flex-1", children: "Remove link" }) : /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", onClick: onClose, className: "flex-1", children: "Cancel" }),
|
|
98
|
+
/* @__PURE__ */ jsx(Button, { type: "submit", form: formId, variant: "accent", disabled: !trimmedUrl, className: "flex-1", children: editing ? "Save" : "Add link" })
|
|
99
|
+
] })
|
|
100
|
+
] });
|
|
101
|
+
}
|
|
102
|
+
const EMPTY_LINK = { text: "", url: "", rel: [] };
|
|
103
|
+
const LOOKS_LIKE_URL = /^(?:https?:\/\/|www\.|mailto:|\/|#)\S*$/i;
|
|
104
|
+
function initialFieldsFromSelection(selectedText) {
|
|
105
|
+
const selected = selectedText.trim();
|
|
106
|
+
return LOOKS_LIKE_URL.test(selected) ? { text: "", url: selected, rel: [] } : { text: selected, url: "", rel: [] };
|
|
107
|
+
}
|
|
108
|
+
function useMarkdownLinkCommand() {
|
|
109
|
+
const [vendorCommands, setVendorCommands] = useState(void 0);
|
|
110
|
+
const [pending, setPending] = useState(null);
|
|
111
|
+
useEffect(() => {
|
|
112
|
+
let cancelled = false;
|
|
113
|
+
void (async () => {
|
|
114
|
+
try {
|
|
115
|
+
const mod = await import("@uiw/react-md-editor");
|
|
116
|
+
if (!cancelled && mod.commands?.getCommands) setVendorCommands(mod.commands.getCommands());
|
|
117
|
+
} catch (error) {
|
|
118
|
+
console.error("Failed to load markdown editor toolbar commands:", error);
|
|
119
|
+
}
|
|
120
|
+
})();
|
|
121
|
+
return () => {
|
|
122
|
+
cancelled = true;
|
|
123
|
+
};
|
|
124
|
+
}, []);
|
|
125
|
+
const commands = useMemo(() => {
|
|
126
|
+
if (!vendorCommands) return void 0;
|
|
127
|
+
return vendorCommands.map((command) => {
|
|
128
|
+
if (command.name !== "link") return command;
|
|
129
|
+
const linkCommand = {
|
|
130
|
+
name: "link",
|
|
131
|
+
keyCommand: "link",
|
|
132
|
+
shortcuts: "ctrlcmd+l",
|
|
133
|
+
buttonProps: { "aria-label": "Add or edit a link (ctrl + l)", title: "Add or edit a link (ctrl + l)" },
|
|
134
|
+
icon: command.icon,
|
|
135
|
+
execute: (state, api) => {
|
|
136
|
+
const existing = findMarkdownLinkAt(state.text, state.selection.start, state.selection.end);
|
|
137
|
+
setPending(
|
|
138
|
+
existing ? {
|
|
139
|
+
api,
|
|
140
|
+
range: { start: existing.start, end: existing.end },
|
|
141
|
+
initial: { text: existing.text, url: existing.url, rel: existing.rel },
|
|
142
|
+
editing: true
|
|
143
|
+
} : {
|
|
144
|
+
api,
|
|
145
|
+
range: state.selection,
|
|
146
|
+
initial: initialFieldsFromSelection(state.selectedText),
|
|
147
|
+
editing: false
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
return linkCommand;
|
|
153
|
+
});
|
|
154
|
+
}, [vendorCommands]);
|
|
155
|
+
const write = (current, text) => {
|
|
156
|
+
setPending(null);
|
|
157
|
+
current.api.setSelectionRange(current.range);
|
|
158
|
+
current.api.replaceSelection(text);
|
|
159
|
+
};
|
|
160
|
+
const linkDialog = /* @__PURE__ */ jsx(
|
|
161
|
+
MarkdownLinkDialog,
|
|
162
|
+
{
|
|
163
|
+
isOpen: pending !== null,
|
|
164
|
+
initial: pending?.initial ?? EMPTY_LINK,
|
|
165
|
+
editing: pending?.editing ?? false,
|
|
166
|
+
onSubmit: (link) => {
|
|
167
|
+
if (pending) write(pending, formatMarkdownLink(link));
|
|
168
|
+
},
|
|
169
|
+
onRemove: () => {
|
|
170
|
+
if (pending) write(pending, pending.initial.text);
|
|
171
|
+
},
|
|
172
|
+
onClose: () => setPending(null)
|
|
173
|
+
}
|
|
174
|
+
);
|
|
175
|
+
return { commands, linkDialog };
|
|
176
|
+
}
|
|
177
|
+
export {
|
|
178
|
+
MarkdownLinkDialog,
|
|
179
|
+
useMarkdownLinkCommand
|
|
180
|
+
};
|
|
@@ -264,7 +264,7 @@ function useUnifiedFiltering(config) {
|
|
|
264
264
|
isPending
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
-
import { formatClassification, formatPricingModel } from "../utils/format
|
|
267
|
+
import { formatClassification, formatPricingModel } from "../utils/format.js";
|
|
268
268
|
function getFilterLabel(filterKey) {
|
|
269
269
|
const customLabels = {
|
|
270
270
|
recommended: "Recommended",
|
|
@@ -6,5 +6,17 @@ export interface VendorTagProps {
|
|
|
6
6
|
hidden?: boolean;
|
|
7
7
|
accentColor?: string;
|
|
8
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* A classification's icon, from its config (`VENDOR_CLASSIFICATION_COPY[value].icon`): the
|
|
11
|
+
* icon is resolved by NAME through the shared resolver, never imported here. A license icon
|
|
12
|
+
* sits on a small tile (the accent tile for an `accent` tone); an OpenFrame mark and a
|
|
13
|
+
* lifecycle icon are drawn bare in their tone. A value with no icon draws nothing.
|
|
14
|
+
*/
|
|
15
|
+
export declare function VendorClassificationIcon({ classification, accentColor, className, }: {
|
|
16
|
+
classification: string;
|
|
17
|
+
/** The accent tile's colour, for a host that tints its hover accent (a vendor card). */
|
|
18
|
+
accentColor?: string;
|
|
19
|
+
className?: string;
|
|
20
|
+
}): import("react").JSX.Element | null;
|
|
9
21
|
export declare function VendorTag({ type, text, className, hidden, size, accentColor }: VendorTagProps): import("react").JSX.Element;
|
|
10
22
|
//# sourceMappingURL=vendor-tag.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vendor-tag.d.ts","sourceRoot":"","sources":["../../src/components/vendor-tag.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vendor-tag.d.ts","sourceRoot":"","sources":["../../src/components/vendor-tag.tsx"],"names":[],"mappings":"AASA,MAAM,WAAW,cAAc;IAC7B,IAAI,EACA,aAAa,GACb,YAAY,GACZ,MAAM,GACN,UAAU,GACV,MAAM,GACN,YAAY,GACZ,aAAa,GACb,gBAAgB,GAChB,IAAI,GACJ,QAAQ,GACR,oBAAoB,GACpB,mBAAmB,GACnB,mBAAmB,GACnB,aAAa,GACb,KAAK,GACL,MAAM,GACN,KAAK,GACL,SAAS,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAQD;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,EACvC,cAAc,EACd,WAAW,EACX,SAAS,GACV,EAAE;IACD,cAAc,EAAE,MAAM,CAAC;IACvB,wFAAwF;IACxF,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sCAyBA;AAoBD,wBAAgB,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,SAAc,EAAE,MAAc,EAAE,IAAW,EAAE,WAAW,EAAE,EAAE,cAAc,+BAsJjH"}
|
|
@@ -1,17 +1,51 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Boxes,
|
|
3
|
+
import { Boxes, Database, DollarSign, Hand, Plug, ShieldCheck, Sparkles } from "lucide-react";
|
|
4
|
+
import { createElement } from "react";
|
|
4
5
|
import { cn } from "../utils/cn.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
import { formatClassification } from "../utils/format.js";
|
|
7
|
+
import { vendorClassificationCopy } from "../utils/vendor-classification.js";
|
|
8
|
+
import { resolveIcon } from "./chat/utils/icon-library.js";
|
|
9
|
+
const TONE_CLASS = {
|
|
10
|
+
accent: "text-ods-text-on-accent",
|
|
11
|
+
neutral: "text-ods-text-secondary",
|
|
12
|
+
warning: "text-ods-warning"
|
|
13
|
+
};
|
|
14
|
+
function VendorClassificationIcon({
|
|
15
|
+
classification,
|
|
16
|
+
accentColor,
|
|
17
|
+
className
|
|
18
|
+
}) {
|
|
19
|
+
const copy = vendorClassificationCopy(classification);
|
|
20
|
+
if (!copy?.icon) return null;
|
|
21
|
+
const icon = resolveIcon(copy.icon.name);
|
|
22
|
+
if (copy.group !== "license") {
|
|
23
|
+
const bareClass = copy.icon.tone === "accent" ? "text-ods-accent" : TONE_CLASS[copy.icon.tone];
|
|
24
|
+
return createElement(icon, {
|
|
25
|
+
size: copy.group === "openframe" ? 16 : 12,
|
|
26
|
+
className: cn("shrink-0", bareClass, className)
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
const accent = copy.icon.tone === "accent";
|
|
30
|
+
return /* @__PURE__ */ jsx(
|
|
31
|
+
"div",
|
|
32
|
+
{
|
|
33
|
+
className: cn(
|
|
34
|
+
"flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm",
|
|
35
|
+
accent ? "bg-ods-accent" : "bg-ods-border",
|
|
36
|
+
className
|
|
37
|
+
),
|
|
38
|
+
style: accent && accentColor ? { backgroundColor: accentColor } : void 0,
|
|
39
|
+
children: createElement(icon, { size: 10, className: TONE_CLASS[copy.icon.tone] })
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
function classificationTag(value, text, accentColor) {
|
|
44
|
+
const copy = vendorClassificationCopy(value);
|
|
11
45
|
return {
|
|
12
|
-
text: text ||
|
|
13
|
-
textColor: void 0,
|
|
14
|
-
icon: /* @__PURE__ */ jsx(
|
|
46
|
+
text: text || (copy?.group === "openframe" ? copy.word : void 0) || copy?.label || formatClassification(value),
|
|
47
|
+
textColor: copy?.group === "lifecycle" ? "text-ods-warning" : void 0,
|
|
48
|
+
icon: /* @__PURE__ */ jsx(VendorClassificationIcon, { classification: value, accentColor })
|
|
15
49
|
};
|
|
16
50
|
}
|
|
17
51
|
function VendorTag({ type, text, className = "", hidden = false, size = "md", accentColor }) {
|
|
@@ -40,22 +74,9 @@ function VendorTag({ type, text, className = "", hidden = false, size = "md", ac
|
|
|
40
74
|
icon: /* @__PURE__ */ jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm", children: /* @__PURE__ */ jsx(Hand, { width: 10, height: 10, className: "text-ods-text-secondary" }) })
|
|
41
75
|
};
|
|
42
76
|
case "open-source":
|
|
43
|
-
return
|
|
44
|
-
text: text || "Open Source",
|
|
45
|
-
icon: /* @__PURE__ */ jsx(
|
|
46
|
-
"div",
|
|
47
|
-
{
|
|
48
|
-
className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm bg-ods-accent",
|
|
49
|
-
style: accentColor ? { backgroundColor: accentColor } : void 0,
|
|
50
|
-
children: /* @__PURE__ */ jsx(Code, { width: 10, height: 10, className: "text-ods-text-on-accent" })
|
|
51
|
-
}
|
|
52
|
-
)
|
|
53
|
-
};
|
|
77
|
+
return classificationTag("open_source", text, accentColor);
|
|
54
78
|
case "commercial":
|
|
55
|
-
return
|
|
56
|
-
text: text || "Commercial Vendor",
|
|
57
|
-
icon: /* @__PURE__ */ jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm bg-ods-border", children: /* @__PURE__ */ jsx(DollarSign, { width: 10, height: 10, className: "text-ods-text-secondary" }) })
|
|
58
|
-
};
|
|
79
|
+
return classificationTag("commercial", text);
|
|
59
80
|
// platform-capability tags — same neutral icon-box chrome as 'commercial'
|
|
60
81
|
case "api":
|
|
61
82
|
return {
|
|
@@ -102,31 +123,12 @@ function VendorTag({ type, text, className = "", hidden = false, size = "md", ac
|
|
|
102
123
|
text: text || "Recommended",
|
|
103
124
|
icon: /* @__PURE__ */ jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm bg-ods-accent", children: /* @__PURE__ */ jsx("span", { className: "text-[8px] font-bold text-ods-text-on-accent", children: "\u2605" }) })
|
|
104
125
|
};
|
|
105
|
-
case "classification":
|
|
106
|
-
|
|
107
|
-
if (classificationType === "open_source") {
|
|
108
|
-
return {
|
|
109
|
-
text: "Open Source",
|
|
110
|
-
icon: /* @__PURE__ */ jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm bg-ods-accent", children: /* @__PURE__ */ jsx(Code, { width: 10, height: 10, className: "text-ods-text-on-accent" }) })
|
|
111
|
-
};
|
|
112
|
-
} else if (classificationType === "commercial") {
|
|
113
|
-
return {
|
|
114
|
-
text: "Commercial Vendor",
|
|
115
|
-
icon: /* @__PURE__ */ jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm bg-ods-border", children: /* @__PURE__ */ jsx(DollarSign, { width: 10, height: 10, className: "text-ods-text-secondary" }) })
|
|
116
|
-
};
|
|
117
|
-
} else if (isOpenFrameClassification(classificationType)) {
|
|
118
|
-
return openFrameTag(classificationType);
|
|
119
|
-
} else {
|
|
120
|
-
return {
|
|
121
|
-
text: text || "Classification",
|
|
122
|
-
icon: /* @__PURE__ */ jsx("div", { className: "flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-sm bg-ods-accent", children: /* @__PURE__ */ jsx("span", { className: "text-[8px] font-bold text-ods-text-on-accent", children: "C" }) })
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
+
case "classification":
|
|
127
|
+
return classificationTag((text ?? "").toLowerCase(), void 0, accentColor);
|
|
126
128
|
case "openframe_selected":
|
|
127
129
|
case "openframe_connect":
|
|
128
130
|
case "openframe_shipped":
|
|
129
|
-
return
|
|
131
|
+
return classificationTag(type, text);
|
|
130
132
|
default:
|
|
131
133
|
return {
|
|
132
134
|
text: text || type,
|
|
@@ -141,5 +143,6 @@ function VendorTag({ type, text, className = "", hidden = false, size = "md", ac
|
|
|
141
143
|
] });
|
|
142
144
|
}
|
|
143
145
|
export {
|
|
146
|
+
VendorClassificationIcon,
|
|
144
147
|
VendorTag
|
|
145
148
|
};
|
|
@@ -11,10 +11,10 @@ require('./chunk-DKOLQPE7.cjs');
|
|
|
11
11
|
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
var
|
|
15
|
-
require('./chunk-
|
|
14
|
+
var _chunkR3FXJXSQcjs = require('./chunk-R3FXJXSQ.cjs');
|
|
15
|
+
require('./chunk-HNLI4OU5.cjs');
|
|
16
16
|
require('./chunk-NTGIQP7O.cjs');
|
|
17
|
-
require('./chunk-
|
|
17
|
+
require('./chunk-U6XWGK53.cjs');
|
|
18
18
|
require('./chunk-HQQE74RO.cjs');
|
|
19
19
|
require('./chunk-DEY6XXGO.cjs');
|
|
20
20
|
require('./chunk-4FWURR3W.cjs');
|
|
@@ -22,13 +22,13 @@ require('./chunk-LU7TD6QS.cjs');
|
|
|
22
22
|
require('./chunk-24I6RFVU.cjs');
|
|
23
23
|
require('./chunk-A6P6DHEZ.cjs');
|
|
24
24
|
require('./chunk-MZ4KBSH7.cjs');
|
|
25
|
-
require('./chunk-
|
|
25
|
+
require('./chunk-BBM2ICOY.cjs');
|
|
26
26
|
require('./chunk-YUMFVQIN.cjs');
|
|
27
|
-
require('./chunk-
|
|
28
|
-
require('./chunk-
|
|
29
|
-
require('./chunk-
|
|
27
|
+
require('./chunk-C7NTL2GV.cjs');
|
|
28
|
+
require('./chunk-7Y5U3Y4S.cjs');
|
|
29
|
+
require('./chunk-PSIKUDUV.cjs');
|
|
30
30
|
require('./chunk-3RFQPQ7Z.cjs');
|
|
31
|
-
require('./chunk-
|
|
31
|
+
require('./chunk-YRULLK7N.cjs');
|
|
32
32
|
require('./chunk-B27QEHYR.cjs');
|
|
33
33
|
require('./chunk-ZOZR3QI2.cjs');
|
|
34
34
|
require('./chunk-OMV5S5PI.cjs');
|
|
@@ -1826,12 +1826,12 @@ require('./chunk-7DNL734S.cjs');
|
|
|
1826
1826
|
require('./chunk-WWUSFOJ7.cjs');
|
|
1827
1827
|
require('./chunk-SKI6NKOE.cjs');
|
|
1828
1828
|
require('./chunk-EWPR7662.cjs');
|
|
1829
|
-
require('./chunk-
|
|
1830
|
-
require('./chunk-
|
|
1829
|
+
require('./chunk-YIRX6C7V.cjs');
|
|
1830
|
+
require('./chunk-P7KTAXXE.cjs');
|
|
1831
1831
|
require('./chunk-QYLIHZKZ.cjs');
|
|
1832
1832
|
require('./chunk-63N4FN5V.cjs');
|
|
1833
|
-
require('./chunk-
|
|
1834
|
-
require('./chunk-
|
|
1833
|
+
require('./chunk-L2IQESTQ.cjs');
|
|
1834
|
+
require('./chunk-JHQNUWFM.cjs');
|
|
1835
1835
|
require('./chunk-S5C3OZCO.cjs');
|
|
1836
1836
|
require('./chunk-32ASZMTV.cjs');
|
|
1837
1837
|
require('./chunk-OOYBIS7D.cjs');
|
|
@@ -1865,14 +1865,14 @@ require('./chunk-3ATAYP36.cjs');
|
|
|
1865
1865
|
// src/components/product-demo/screens/devices.tsx
|
|
1866
1866
|
var _react = require('react');
|
|
1867
1867
|
var _jsxruntime = require('react/jsx-runtime');
|
|
1868
|
-
var TOOLBAR = { ...
|
|
1868
|
+
var TOOLBAR = { ..._chunkR3FXJXSQcjs.IDLE_DEVICES_TOOLBAR, searchValue: _chunk7AM3AFM4cjs.DEVICES_SEARCH_QUERY };
|
|
1869
1869
|
var NO_HEADER = /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _jsxruntime.Fragment, {});
|
|
1870
1870
|
var HIDDEN_WHEN_COMPACT = ["organization"];
|
|
1871
1871
|
function DevicesScreen({ compact = false }) {
|
|
1872
1872
|
const cast = _chunkSTEJZPIOcjs.useProductDemoCast.call(void 0, );
|
|
1873
1873
|
const fixture = _react.useMemo.call(void 0, () => _chunk7AM3AFM4cjs.buildWindowsDevicesFixture.call(void 0, cast), [cast]);
|
|
1874
1874
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1875
|
-
|
|
1875
|
+
_chunkR3FXJXSQcjs.DevicesPanelView,
|
|
1876
1876
|
{
|
|
1877
1877
|
className: "p-[var(--spacing-system-l)]",
|
|
1878
1878
|
headerSlot: NO_HEADER,
|