@flamingo-stack/openframe-frontend-core 0.0.736 → 0.0.737
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-T27CVQBO.cjs → chunk-4FJZ7RJD.cjs} +16 -16
- package/dist/{chunk-URX2YTCL.cjs → chunk-4ISP3XP4.cjs} +42 -36
- package/dist/{chunk-BL5GOCHP.cjs → chunk-4RMLAHU2.cjs} +17 -9
- package/dist/{chunk-SZFA2LQR.cjs → chunk-CM35DLKS.cjs} +33 -33
- package/dist/{chunk-7V2KP2TB.cjs → chunk-DA4VS6TS.cjs} +4 -4
- package/dist/{chunk-OJUMVOMP.cjs → chunk-E2JCZU36.cjs} +260 -260
- package/dist/{chunk-UBQSOB3X.cjs → chunk-FA2LATDM.cjs} +4 -4
- package/dist/{chunk-FTGVG6FW.cjs → chunk-KVGBDWYV.cjs} +17 -17
- package/dist/{chunk-JGGSRCRD.cjs → chunk-LW3QSP47.cjs} +11 -11
- package/dist/{chunk-NONQUGRP.cjs → chunk-N6YOOGCD.cjs} +6 -6
- package/dist/chunk-O4MG7FXW.cjs +57 -0
- package/dist/{chunk-P6Z3EBPJ.cjs → chunk-SGVQO5J6.cjs} +9 -9
- package/dist/{chunk-JM54CNZZ.cjs → chunk-TJQYX3QC.cjs} +66 -66
- package/dist/{chunk-ZEX5WU35.cjs → chunk-URIJ6YUG.cjs} +40 -66
- package/dist/{chunk-OV6BGMEL.cjs → chunk-VL4JKXU2.cjs} +125 -113
- package/dist/{chunk-BDF3FNOC.cjs → chunk-VYODTHMR.cjs} +25 -25
- package/dist/{chunk-LIH5OQLY.cjs → chunk-XPP7VCNY.cjs} +3 -3
- package/dist/{cloud-tenants-M55HMW6F.cjs → cloud-tenants-IWQ5FFLY.cjs} +4 -4
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/chat/entity-cards/index.d.ts +1 -0
- package/dist/components/chat/entity-cards/index.d.ts.map +1 -1
- package/dist/components/chat/entity-cards/index.js +2 -0
- package/dist/components/chat/hooks/use-ask-prompts.d.ts +1 -1
- package/dist/components/chat/hooks/use-ask-prompts.js +1 -1
- package/dist/components/chat/index.cjs +5 -3
- package/dist/components/chat/mingo-info-card.d.ts +17 -1
- package/dist/components/chat/mingo-info-card.d.ts.map +1 -1
- package/dist/components/chat/mingo-info-card.js +15 -3
- package/dist/components/contact/index.cjs +5 -5
- package/dist/components/docs/index.cjs +8 -8
- package/dist/components/embeds/index.cjs +5 -5
- package/dist/components/faq/faq-ask-card.d.ts +5 -4
- package/dist/components/faq/faq-ask-card.d.ts.map +1 -1
- package/dist/components/faq/faq-document-page.d.ts +3 -1
- package/dist/components/faq/faq-document-page.d.ts.map +1 -1
- package/dist/components/faq/faq-document-page.js +2 -0
- package/dist/components/faq/faq-section.d.ts +37 -5
- package/dist/components/faq/faq-section.d.ts.map +1 -1
- package/dist/components/faq/faq-section.js +31 -9
- package/dist/components/faq/index.cjs +11 -5
- package/dist/components/faq/index.d.ts +1 -1
- package/dist/components/faq/index.d.ts.map +1 -1
- package/dist/components/faq/index.js +4 -2
- package/dist/components/features/index.cjs +4 -4
- package/dist/components/help-center-pages/delivery-page.d.ts +8 -1
- package/dist/components/help-center-pages/delivery-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/delivery-page.js +16 -4
- package/dist/components/help-center-pages/download-apps-page.d.ts +8 -1
- package/dist/components/help-center-pages/download-apps-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/download-apps-page.js +11 -6
- package/dist/components/help-center-pages/index.cjs +169 -114
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.d.ts +8 -1
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/onboarding-guides-catalog-page.js +26 -14
- package/dist/components/help-center-pages/product-releases-list-page.d.ts +8 -1
- package/dist/components/help-center-pages/product-releases-list-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/product-releases-list-page.js +24 -12
- package/dist/components/help-center-pages/roadmap-page.d.ts +8 -1
- package/dist/components/help-center-pages/roadmap-page.d.ts.map +1 -1
- package/dist/components/help-center-pages/roadmap-page.js +25 -13
- package/dist/components/index.cjs +46 -38
- package/dist/components/meeting-scheduler/index.cjs +20 -20
- package/dist/components/navigation/index.cjs +7 -7
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/product-demo/index.cjs +6 -6
- package/dist/components/shared/dev-section/dev-section-page.d.ts +8 -1
- package/dist/components/shared/dev-section/dev-section-page.d.ts.map +1 -1
- package/dist/components/shared/dev-section/dev-section-page.js +8 -3
- package/dist/components/shared/legal-document/legal-document-page.d.ts +8 -1
- package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
- package/dist/components/shared/legal-document/legal-document-page.js +4 -1
- package/dist/components/tickets/index.cjs +9 -8
- package/dist/components/ui/index.cjs +6 -4
- package/dist/contexts/assistant-runtime-context.d.ts +5 -5
- package/dist/{devices-WWJZFG6E.cjs → devices-OUHGWA6Y.cjs} +5 -5
- package/dist/{embeddable-chat-76IJ6TQZ.cjs → embeddable-chat-U3C4WWB7.cjs} +64 -64
- package/dist/index.cjs +14 -8
- package/dist/{knowledge-F4YFQT3G.cjs → knowledge-3ZASPWMF.cjs} +5 -5
- package/dist/{logs-GAYEGEZM.cjs → logs-E6Y54P6K.cjs} +12 -12
- package/dist/{policies-ZOVJCJWX.cjs → policies-LAV75B5B.cjs} +8 -8
- package/dist/{software-update-H4YE5GMJ.cjs → software-update-2CAL3AMJ.cjs} +7 -7
- package/dist/types/faq.d.ts +17 -0
- package/dist/types/faq.d.ts.map +1 -1
- package/dist/types/faq.js +4 -0
- package/dist/types/index.cjs +4 -0
- package/package.json +1 -1
- package/src/components/chat/entity-cards/index.ts +1 -0
- package/src/components/chat/hooks/use-ask-prompts.ts +2 -2
- package/src/components/chat/mingo-info-card.tsx +39 -4
- package/src/components/faq/faq-ask-card.tsx +5 -4
- package/src/components/faq/faq-document-page.tsx +4 -0
- package/src/components/faq/faq-section.tsx +83 -14
- package/src/components/faq/index.ts +1 -1
- package/src/components/help-center-pages/delivery-page.tsx +16 -1
- package/src/components/help-center-pages/download-apps-page.tsx +9 -0
- package/src/components/help-center-pages/onboarding-guides-catalog-page.tsx +16 -1
- package/src/components/help-center-pages/product-releases-list-page.tsx +16 -1
- package/src/components/help-center-pages/roadmap-page.tsx +16 -1
- package/src/components/shared/dev-section/dev-section-page.tsx +9 -0
- package/src/components/shared/legal-document/legal-document-page.tsx +9 -0
- package/src/contexts/assistant-runtime-context.tsx +5 -5
- package/src/types/faq.ts +18 -0
|
@@ -8,7 +8,7 @@ var _chunkII4QMH26cjs = require('./chunk-II4QMH26.cjs');
|
|
|
8
8
|
var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunkE2JCZU36cjs = require('./chunk-E2JCZU36.cjs');
|
|
12
12
|
require('./chunk-ZJNYWNCB.cjs');
|
|
13
13
|
require('./chunk-3HPB4H4C.cjs');
|
|
14
14
|
require('./chunk-L4ZNR5V7.cjs');
|
|
@@ -21,10 +21,10 @@ require('./chunk-A6P6DHEZ.cjs');
|
|
|
21
21
|
require('./chunk-MZ4KBSH7.cjs');
|
|
22
22
|
require('./chunk-MGW5DO6P.cjs');
|
|
23
23
|
require('./chunk-YUMFVQIN.cjs');
|
|
24
|
-
require('./chunk-
|
|
24
|
+
require('./chunk-4FJZ7RJD.cjs');
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunkVL4JKXU2cjs = require('./chunk-VL4JKXU2.cjs');
|
|
28
28
|
require('./chunk-ZRYKDN2J.cjs');
|
|
29
29
|
require('./chunk-HZJRERJW.cjs');
|
|
30
30
|
require('./chunk-DUXLZPMJ.cjs');
|
|
@@ -1905,10 +1905,10 @@ function KnowledgeScreen(_props) {
|
|
|
1905
1905
|
const cast = _chunkII4QMH26cjs.useProductDemoCast.call(void 0, );
|
|
1906
1906
|
const fixture = _react.useMemo.call(void 0, () => buildKnowledgeFixture(cast), [cast]);
|
|
1907
1907
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1908
|
-
|
|
1908
|
+
_chunkE2JCZU36cjs.KnowledgeBaseArticleView,
|
|
1909
1909
|
{
|
|
1910
1910
|
...fixture.article,
|
|
1911
|
-
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1911
|
+
content: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVL4JKXU2cjs.SimpleMarkdownRenderer, { content: fixture.content, textSize: "compact" })
|
|
1912
1912
|
}
|
|
1913
1913
|
) });
|
|
1914
1914
|
}
|
|
@@ -16,7 +16,7 @@ var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkE2JCZU36cjs = require('./chunk-E2JCZU36.cjs');
|
|
20
20
|
require('./chunk-ZJNYWNCB.cjs');
|
|
21
21
|
require('./chunk-3HPB4H4C.cjs');
|
|
22
22
|
require('./chunk-L4ZNR5V7.cjs');
|
|
@@ -31,8 +31,8 @@ require('./chunk-MGW5DO6P.cjs');
|
|
|
31
31
|
require('./chunk-YUMFVQIN.cjs');
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
require('./chunk-
|
|
34
|
+
var _chunk4FJZ7RJDcjs = require('./chunk-4FJZ7RJD.cjs');
|
|
35
|
+
require('./chunk-VL4JKXU2.cjs');
|
|
36
36
|
require('./chunk-ZRYKDN2J.cjs');
|
|
37
37
|
require('./chunk-HZJRERJW.cjs');
|
|
38
38
|
require('./chunk-DUXLZPMJ.cjs');
|
|
@@ -1886,7 +1886,7 @@ function entry(logId, minutesAgo, severity, toolType, device2, summary) {
|
|
|
1886
1886
|
id: logId,
|
|
1887
1887
|
logId,
|
|
1888
1888
|
timestamp: displayTime(_chunkKHXZFLINcjs.demoMinutesAgo.call(void 0, minutesAgo)),
|
|
1889
|
-
status: { label: severity, variant:
|
|
1889
|
+
status: { label: severity, variant: _chunkE2JCZU36cjs.logSeverityVariant.call(void 0, severity) },
|
|
1890
1890
|
source: { name: toolType, toolType },
|
|
1891
1891
|
device: device2,
|
|
1892
1892
|
description: { title: summary }
|
|
@@ -1958,13 +1958,13 @@ var NO_FILTERS = {};
|
|
|
1958
1958
|
var ACTION_COLUMNS = ["copy", "quickView", "open"];
|
|
1959
1959
|
var BESIDE_DRAWER_HIDDEN = [...ACTION_COLUMNS, "tool", "source"];
|
|
1960
1960
|
var logHref = () => "#";
|
|
1961
|
-
var copyAction = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1961
|
+
var copyAction = () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2JCZU36cjs.LogCopyIconButton, {});
|
|
1962
1962
|
function LogsScreen({ compact = false }) {
|
|
1963
1963
|
const [dock, setDock] = _react.useState.call(void 0, null);
|
|
1964
1964
|
const selected = LOGS_FIXTURE_SELECTED;
|
|
1965
1965
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full bg-ods-bg", children: [
|
|
1966
1966
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "min-w-0 flex-1 overflow-clip", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1967
|
-
|
|
1967
|
+
_chunkE2JCZU36cjs.LogsPageView,
|
|
1968
1968
|
{
|
|
1969
1969
|
showHeader: false,
|
|
1970
1970
|
className: "p-[var(--spacing-system-l)]",
|
|
@@ -1972,7 +1972,7 @@ function LogsScreen({ compact = false }) {
|
|
|
1972
1972
|
onSearchChange: noop,
|
|
1973
1973
|
onOpenFilters: noop,
|
|
1974
1974
|
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1975
|
-
|
|
1975
|
+
_chunkE2JCZU36cjs.LogsTableView,
|
|
1976
1976
|
{
|
|
1977
1977
|
logs: LOGS_FIXTURE_ENTRIES,
|
|
1978
1978
|
facets: LOGS_FIXTURE_FACETS,
|
|
@@ -1986,8 +1986,8 @@ function LogsScreen({ compact = false }) {
|
|
|
1986
1986
|
)
|
|
1987
1987
|
}
|
|
1988
1988
|
) }),
|
|
1989
|
-
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: setDock, className: "relative w-[calc(400px+var(--spacing-system-m))] shrink-0", children: dock && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1990
|
-
|
|
1989
|
+
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref: setDock, className: "relative w-[calc(400px+var(--spacing-system-m))] shrink-0", children: dock && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2JCZU36cjs.AppLayoutDrawerContainerContext.Provider, { value: dock, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1990
|
+
_chunkE2JCZU36cjs.LogDrawer,
|
|
1991
1991
|
{
|
|
1992
1992
|
docked: true,
|
|
1993
1993
|
isOpen: true,
|
|
@@ -1999,12 +1999,12 @@ function LogsScreen({ compact = false }) {
|
|
|
1999
1999
|
{ label: "Log ID", value: selected.logId },
|
|
2000
2000
|
{
|
|
2001
2001
|
label: "Source",
|
|
2002
|
-
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2002
|
+
value: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2JCZU36cjs.ToolBadge, { toolType: _chunk4FJZ7RJDcjs.normalizeToolTypeWithFallback.call(void 0, selected.source.toolType) })
|
|
2003
2003
|
},
|
|
2004
|
-
{ label: "Device", value:
|
|
2004
|
+
{ label: "Device", value: _chunkE2JCZU36cjs.logSourceLabels.call(void 0, selected.device).deviceName }
|
|
2005
2005
|
],
|
|
2006
2006
|
deviceCard: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2007
|
-
|
|
2007
|
+
_chunkE2JCZU36cjs.DeviceCard,
|
|
2008
2008
|
{
|
|
2009
2009
|
...LOGS_FIXTURE_DEVICE,
|
|
2010
2010
|
actions: {
|
|
@@ -10,7 +10,7 @@ var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
var
|
|
13
|
+
var _chunkE2JCZU36cjs = require('./chunk-E2JCZU36.cjs');
|
|
14
14
|
require('./chunk-ZJNYWNCB.cjs');
|
|
15
15
|
require('./chunk-3HPB4H4C.cjs');
|
|
16
16
|
require('./chunk-L4ZNR5V7.cjs');
|
|
@@ -23,8 +23,8 @@ require('./chunk-A6P6DHEZ.cjs');
|
|
|
23
23
|
require('./chunk-MZ4KBSH7.cjs');
|
|
24
24
|
require('./chunk-MGW5DO6P.cjs');
|
|
25
25
|
require('./chunk-YUMFVQIN.cjs');
|
|
26
|
-
require('./chunk-
|
|
27
|
-
require('./chunk-
|
|
26
|
+
require('./chunk-4FJZ7RJD.cjs');
|
|
27
|
+
require('./chunk-VL4JKXU2.cjs');
|
|
28
28
|
require('./chunk-ZRYKDN2J.cjs');
|
|
29
29
|
require('./chunk-HZJRERJW.cjs');
|
|
30
30
|
require('./chunk-DUXLZPMJ.cjs');
|
|
@@ -1891,14 +1891,14 @@ var POLICIES = [
|
|
|
1891
1891
|
policy("policy-local-admins", "No local admins", "No everyday account is a local administrator.", false, 0)
|
|
1892
1892
|
];
|
|
1893
1893
|
var POLICIES_FIXTURE = {
|
|
1894
|
-
summary:
|
|
1894
|
+
summary: _chunkE2JCZU36cjs.computePolicySummary.call(void 0, POLICIES),
|
|
1895
1895
|
rows: POLICIES.map((item) => ({
|
|
1896
1896
|
id: item.id,
|
|
1897
1897
|
name: item.name,
|
|
1898
1898
|
description: item.description,
|
|
1899
1899
|
critical: item.critical,
|
|
1900
1900
|
severityLabel: item.critical ? "Critical" : "Low",
|
|
1901
|
-
status:
|
|
1901
|
+
status: _chunkE2JCZU36cjs.getPolicyTableStatus.call(void 0, item),
|
|
1902
1902
|
actions: [
|
|
1903
1903
|
{ label: "Policy Details", onClick: noop },
|
|
1904
1904
|
{ label: "Delete Policy", onClick: noop }
|
|
@@ -1912,16 +1912,16 @@ var POLICIES_FIXTURE = {
|
|
|
1912
1912
|
var _jsxruntime = require('react/jsx-runtime');
|
|
1913
1913
|
function PoliciesScreen({ compact = false }) {
|
|
1914
1914
|
const table = /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1915
|
-
|
|
1915
|
+
_chunkE2JCZU36cjs.PoliciesTable,
|
|
1916
1916
|
{
|
|
1917
1917
|
rows: POLICIES_FIXTURE.rows,
|
|
1918
1918
|
rowAsLink: true,
|
|
1919
|
-
rightSlot: compact ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1919
|
+
rightSlot: compact ? void 0 : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2JCZU36cjs.DataTable.RowCount, {}),
|
|
1920
1920
|
emptyMessage: "No policies found."
|
|
1921
1921
|
}
|
|
1922
1922
|
);
|
|
1923
1923
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex h-full flex-col gap-[var(--spacing-system-l)] bg-ods-bg p-[var(--spacing-system-l)]", children: [
|
|
1924
|
-
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1924
|
+
!compact && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkE2JCZU36cjs.PolicySummaryCards, { summary: POLICIES_FIXTURE.summary, now: POLICIES_FIXTURE.now }),
|
|
1925
1925
|
table
|
|
1926
1926
|
] });
|
|
1927
1927
|
}
|
|
@@ -15,7 +15,7 @@ var _chunkKHXZFLINcjs = require('./chunk-KHXZFLIN.cjs');
|
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
var
|
|
18
|
+
var _chunkE2JCZU36cjs = require('./chunk-E2JCZU36.cjs');
|
|
19
19
|
require('./chunk-ZJNYWNCB.cjs');
|
|
20
20
|
require('./chunk-3HPB4H4C.cjs');
|
|
21
21
|
|
|
@@ -30,8 +30,8 @@ require('./chunk-A6P6DHEZ.cjs');
|
|
|
30
30
|
require('./chunk-MZ4KBSH7.cjs');
|
|
31
31
|
require('./chunk-MGW5DO6P.cjs');
|
|
32
32
|
require('./chunk-YUMFVQIN.cjs');
|
|
33
|
-
require('./chunk-
|
|
34
|
-
require('./chunk-
|
|
33
|
+
require('./chunk-4FJZ7RJD.cjs');
|
|
34
|
+
require('./chunk-VL4JKXU2.cjs');
|
|
35
35
|
require('./chunk-ZRYKDN2J.cjs');
|
|
36
36
|
require('./chunk-HZJRERJW.cjs');
|
|
37
37
|
require('./chunk-DUXLZPMJ.cjs');
|
|
@@ -1926,12 +1926,12 @@ function StaticPackageField({ value }) {
|
|
|
1926
1926
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1927
1927
|
_chunkL4ZNR5V7cjs.Autocomplete,
|
|
1928
1928
|
{
|
|
1929
|
-
label:
|
|
1929
|
+
label: _chunkE2JCZU36cjs.PACKAGE_SEARCH_LABEL,
|
|
1930
1930
|
labelVariant: "large",
|
|
1931
1931
|
options: value ? [{ value: value.id, label: value.name, description: _nullishCoalesce(value.description, () => ( void 0)) }] : [],
|
|
1932
1932
|
value: _nullishCoalesce(_optionalChain([value, 'optionalAccess', _ => _.id]), () => ( null)),
|
|
1933
1933
|
onChange: noop,
|
|
1934
|
-
placeholder:
|
|
1934
|
+
placeholder: _chunkE2JCZU36cjs.PACKAGE_SEARCH_PLACEHOLDER
|
|
1935
1935
|
}
|
|
1936
1936
|
);
|
|
1937
1937
|
}
|
|
@@ -1945,7 +1945,7 @@ function SoftwareUpdateScreen({ compact = false }) {
|
|
|
1945
1945
|
[fixture.devices, fixture.selectedIds]
|
|
1946
1946
|
);
|
|
1947
1947
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full bg-ods-bg pt-[var(--spacing-system-l)]", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "h-full", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1948
|
-
|
|
1948
|
+
_chunkE2JCZU36cjs.SoftwareActionForm,
|
|
1949
1949
|
{
|
|
1950
1950
|
action: fixture.action,
|
|
1951
1951
|
showHeader: false,
|
|
@@ -1957,7 +1957,7 @@ function SoftwareUpdateScreen({ compact = false }) {
|
|
|
1957
1957
|
initialValues: fixture.initialValues,
|
|
1958
1958
|
renderPackageSearch,
|
|
1959
1959
|
renderDevicePicker: () => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
1960
|
-
|
|
1960
|
+
_chunkE2JCZU36cjs.DeviceSelector,
|
|
1961
1961
|
{
|
|
1962
1962
|
devices: selected,
|
|
1963
1963
|
loading: false,
|
package/dist/types/faq.d.ts
CHANGED
|
@@ -1,8 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The two kinds of FAQ. An `answer` is a question with its written answer (the
|
|
3
|
+
* accordion, FAQPage JSON-LD). An `ask` is a question the assistant answers: it
|
|
4
|
+
* has a `prompt` (what is sent to the chat) and no written answer, and is what
|
|
5
|
+
* every "ask the assistant" surface offers.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FAQ_KINDS: readonly ["answer", "ask"];
|
|
8
|
+
export type FaqKind = (typeof FAQ_KINDS)[number];
|
|
1
9
|
export interface Faq {
|
|
2
10
|
id: number;
|
|
3
11
|
question: string;
|
|
4
12
|
answer: string;
|
|
5
13
|
section?: string | null;
|
|
14
|
+
/** Absent on a host that predates kinds: an `answer`. */
|
|
15
|
+
kind?: FaqKind;
|
|
16
|
+
/** An `ask` FAQ's prompt for the chat; null on an `answer`. */
|
|
17
|
+
prompt?: string | null;
|
|
18
|
+
/**
|
|
19
|
+
* The places the FAQ is written for, shared by both kinds: a page's topic
|
|
20
|
+
* (`pricing`, `careers`, `home`) or a section's. Empty: written for no place.
|
|
21
|
+
*/
|
|
22
|
+
topics?: string[];
|
|
6
23
|
display_order: number;
|
|
7
24
|
is_active: boolean;
|
|
8
25
|
created_at: string;
|
package/dist/types/faq.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"faq.d.ts","sourceRoot":"","sources":["../../src/types/faq.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
1
|
+
{"version":3,"file":"faq.d.ts","sourceRoot":"","sources":["../../src/types/faq.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,SAAS,4BAA6B,CAAC;AACpD,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,WAAW,GAAG;IAClB,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,yDAAyD;IACzD,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,+DAA+D;IAC/D,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,OAAO,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
package/dist/types/faq.js
CHANGED
package/dist/types/index.cjs
CHANGED
|
@@ -59,6 +59,9 @@ var TASK_TYPE_TEXT_COLORS = {
|
|
|
59
59
|
// src/types/video-processing.ts
|
|
60
60
|
var ENTITY_QUOTES_TITLE = "Key Quotes";
|
|
61
61
|
|
|
62
|
+
// src/types/faq.ts
|
|
63
|
+
var FAQ_KINDS = ["answer", "ask"];
|
|
64
|
+
|
|
62
65
|
// src/utils/escape-regexp.ts
|
|
63
66
|
function escapeRegExp(value) {
|
|
64
67
|
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
@@ -608,6 +611,7 @@ exports.DOWNLOADS_TAGLINE = DOWNLOADS_TAGLINE;
|
|
|
608
611
|
exports.DOWNLOADS_TITLE = DOWNLOADS_TITLE;
|
|
609
612
|
exports.DOWNLOAD_ARCHITECTURE_LABELS = DOWNLOAD_ARCHITECTURE_LABELS;
|
|
610
613
|
exports.ENTITY_QUOTES_TITLE = ENTITY_QUOTES_TITLE;
|
|
614
|
+
exports.FAQ_KINDS = FAQ_KINDS;
|
|
611
615
|
exports.OSTypeValues = OSTypeValues;
|
|
612
616
|
exports.OS_TYPES = OS_TYPES;
|
|
613
617
|
exports.SEMVER_REGEX = SEMVER_REGEX;
|
package/package.json
CHANGED
|
@@ -139,3 +139,4 @@ export {
|
|
|
139
139
|
// PACKAGE-EXPORTED chat barrel so the hub can value-import them (deep paths
|
|
140
140
|
// into chat/types/* are not in the package exports map and 404 at runtime).
|
|
141
141
|
export { programItemToStripProfile, type ProgramAuthorRef } from '../types/entities/program-types';
|
|
142
|
+
export { type MingoInfoCardAction, MingoInfoCardActionProvider } from '../mingo-info-card';
|
|
@@ -24,7 +24,7 @@ export function buildAskPromptsUrl(
|
|
|
24
24
|
{ count, topic, exclude = [] }: { count: number; topic?: string; exclude?: readonly string[] },
|
|
25
25
|
): string {
|
|
26
26
|
const params = new URLSearchParams({ count: String(count) });
|
|
27
|
-
if (topic) params.set('
|
|
27
|
+
if (topic) params.set('topic', topic);
|
|
28
28
|
if (exclude.length > 0) params.set('exclude', exclude.join(','));
|
|
29
29
|
return `${base}${base.includes('?') ? '&' : '?'}${params.toString()}`;
|
|
30
30
|
}
|
|
@@ -37,7 +37,7 @@ export function assistantAvailable(assistant: AssistantRuntime | null): assistan
|
|
|
37
37
|
export interface UseAskPromptsOptions {
|
|
38
38
|
/**
|
|
39
39
|
* What the surface is about: ANY string the host's endpoint knows (sent as
|
|
40
|
-
* `
|
|
40
|
+
* `topic`). Questions written for it are picked first. Absent: general ones.
|
|
41
41
|
*/
|
|
42
42
|
topic?: string;
|
|
43
43
|
count?: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import type
|
|
3
|
+
import { createContext, type MouseEvent, type ReactNode, useContext } from 'react';
|
|
4
4
|
import Image from '../../embed-shims/next-image';
|
|
5
5
|
import Link from '../../embed-shims/next-link';
|
|
6
6
|
import { cn } from '../../utils/cn';
|
|
@@ -13,6 +13,35 @@ import { tagVariants, type TagProps } from '../ui/tag';
|
|
|
13
13
|
// Types
|
|
14
14
|
// =============================================================================
|
|
15
15
|
|
|
16
|
+
/**
|
|
17
|
+
* ONE action in place of the "⋯" menu, for a host that shows the card outside a
|
|
18
|
+
* conversation: an editor's list of attached records swaps the menu for
|
|
19
|
+
* "detach". It is a context because the host renders the card through the
|
|
20
|
+
* entity-card dispatch, which decides the menu per record type.
|
|
21
|
+
*/
|
|
22
|
+
export interface MingoInfoCardAction {
|
|
23
|
+
icon: ReactNode;
|
|
24
|
+
/** The button's accessible name, e.g. "Detach". */
|
|
25
|
+
label: string;
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const MingoInfoCardActionContext = createContext<MingoInfoCardAction | null>(null);
|
|
30
|
+
|
|
31
|
+
export function MingoInfoCardActionProvider({
|
|
32
|
+
action,
|
|
33
|
+
children,
|
|
34
|
+
}: {
|
|
35
|
+
action: MingoInfoCardAction;
|
|
36
|
+
children: ReactNode;
|
|
37
|
+
}) {
|
|
38
|
+
return <MingoInfoCardActionContext.Provider value={action}>{children}</MingoInfoCardActionContext.Provider>;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/** The trailing cell's footprint and press feedback, shared by the "⋯" trigger and a host's action. */
|
|
42
|
+
const TRAILING_BUTTON_CLASS =
|
|
43
|
+
'flex w-[56px] shrink-0 items-center justify-center self-stretch text-ods-text-secondary transition-colors hover:bg-ods-bg-hover hover:text-ods-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-accent active:bg-ods-bg-active active:text-ods-text-primary md:w-[68px]';
|
|
44
|
+
|
|
16
45
|
/** A coloured status pill rendered to the right of the title/description. */
|
|
17
46
|
export interface MingoInfoCardStatus {
|
|
18
47
|
/** Pill text — rendered uppercase via the `success`/`warning`/… Tag palette. */
|
|
@@ -157,7 +186,8 @@ export function MingoInfoCard({
|
|
|
157
186
|
className,
|
|
158
187
|
}: MingoInfoCardProps) {
|
|
159
188
|
const hasMedia = !!imageSrc || !!icon;
|
|
160
|
-
const
|
|
189
|
+
const action = useContext(MingoInfoCardActionContext);
|
|
190
|
+
const hasMenu = !action && !!menuGroups && menuGroups.length > 0;
|
|
161
191
|
const isAnchor = !!anchorProps;
|
|
162
192
|
const isInteractive = isAnchor || !!onClick;
|
|
163
193
|
|
|
@@ -182,7 +212,7 @@ export function MingoInfoCard({
|
|
|
182
212
|
|
|
183
213
|
const contentClass = cn(
|
|
184
214
|
'flex min-w-0 flex-1 items-center gap-[var(--spacing-system-s)] overflow-hidden p-[var(--spacing-system-s)] text-left',
|
|
185
|
-
hasMenu && 'border-r border-ods-border',
|
|
215
|
+
(hasMenu || action) && 'border-r border-ods-border',
|
|
186
216
|
isInteractive &&
|
|
187
217
|
'cursor-pointer transition-colors hover:bg-ods-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-ods-accent active:bg-ods-bg-active',
|
|
188
218
|
);
|
|
@@ -206,6 +236,11 @@ export function MingoInfoCard({
|
|
|
206
236
|
<span className={contentClass}>{content}</span>
|
|
207
237
|
)}
|
|
208
238
|
|
|
239
|
+
{action && (
|
|
240
|
+
<button type="button" aria-label={action.label} onClick={action.onClick} className={TRAILING_BUTTON_CLASS}>
|
|
241
|
+
{action.icon}
|
|
242
|
+
</button>
|
|
243
|
+
)}
|
|
209
244
|
{hasMenu && (
|
|
210
245
|
<ActionsMenuDropdown
|
|
211
246
|
groups={menuGroups as ActionsMenuGroup[]}
|
|
@@ -217,7 +252,7 @@ export function MingoInfoCard({
|
|
|
217
252
|
aria-label={menuAriaLabel}
|
|
218
253
|
// Press feedback mirrors `Button` (transparent variant):
|
|
219
254
|
// `hover:bg-ods-bg-hover` → `active:bg-ods-bg-active`.
|
|
220
|
-
className=
|
|
255
|
+
className={TRAILING_BUTTON_CLASS}
|
|
221
256
|
>
|
|
222
257
|
<Ellipsis01Icon size={24} />
|
|
223
258
|
</button>
|
|
@@ -10,10 +10,11 @@ import { assistantAvailable } from '../chat/hooks/use-ask-prompts';
|
|
|
10
10
|
export interface FaqAskOptions {
|
|
11
11
|
/**
|
|
12
12
|
* What this FAQ is about: ANY string the host's questions endpoint knows (it
|
|
13
|
-
* is sent as `
|
|
14
|
-
* for the topic are picked first.
|
|
15
|
-
* the entity the FAQ is attached to (
|
|
16
|
-
*
|
|
13
|
+
* is sent as `topic`, and reported with every click). Questions written
|
|
14
|
+
* for the topic are picked first. Absent: the FAQ's own topic
|
|
15
|
+
* (`FaqSection`'s `topic`), else the entity the FAQ is attached to (its
|
|
16
|
+
* `entityType`). With none, the FAQ has no card: the lib names no topic of
|
|
17
|
+
* its own.
|
|
17
18
|
*/
|
|
18
19
|
topic?: string;
|
|
19
20
|
/**
|
|
@@ -49,6 +49,8 @@ export interface FaqDocumentPageProps {
|
|
|
49
49
|
jsonLd?: FaqSchemaOptions;
|
|
50
50
|
/** Base URL `FaqSection` appends `/api/faqs` to (reverse-proxy embedders). */
|
|
51
51
|
apiBaseUrl?: string;
|
|
52
|
+
/** What the page is about (forwarded to `FaqSection`): its FAQs and its ask card are the ones written for the topic. */
|
|
53
|
+
topic?: string;
|
|
52
54
|
/** Optional entity scoping forwarded to `FaqSection`. */
|
|
53
55
|
entityType?: string;
|
|
54
56
|
entityId?: number | string;
|
|
@@ -70,6 +72,7 @@ export function FaqDocumentPage({
|
|
|
70
72
|
entityType,
|
|
71
73
|
entityId,
|
|
72
74
|
minResults,
|
|
75
|
+
topic,
|
|
73
76
|
ask,
|
|
74
77
|
shell = true,
|
|
75
78
|
}: FaqDocumentPageProps) {
|
|
@@ -97,6 +100,7 @@ export function FaqDocumentPage({
|
|
|
97
100
|
entityType={entityType}
|
|
98
101
|
entityId={entityId}
|
|
99
102
|
minResults={minResults}
|
|
103
|
+
topic={topic}
|
|
100
104
|
ask={ask}
|
|
101
105
|
/>
|
|
102
106
|
</PageLayout>
|
|
@@ -27,6 +27,15 @@ export interface FaqSectionProps {
|
|
|
27
27
|
/** Both required together for entity-attached FAQs; partial → bare /api/faqs. */
|
|
28
28
|
entityType?: string;
|
|
29
29
|
entityId?: number | string;
|
|
30
|
+
/**
|
|
31
|
+
* What the page this FAQ sits on is about: ANY string the host's FAQ
|
|
32
|
+
* endpoint knows. ONE topic for the whole block: the questions are the FAQs
|
|
33
|
+
* written for it (`/api/faqs?topic=`; `initialFaqs` are then the host's read
|
|
34
|
+
* of the same topic) and the "ask the assistant" card offers the questions
|
|
35
|
+
* written for it. Whoever renders the FAQ states it; the lib names none.
|
|
36
|
+
* Ignored for the questions when the FAQ is attached to an entity.
|
|
37
|
+
*/
|
|
38
|
+
topic?: string;
|
|
30
39
|
/**
|
|
31
40
|
* Heading node above the grouped list. `undefined` → default
|
|
32
41
|
* `<h2>`"Frequently Asked Questions". `null` → no heading (the host page
|
|
@@ -43,6 +52,14 @@ export interface FaqSectionProps {
|
|
|
43
52
|
/** Overrides for the JSON-LD's name/description/url. */
|
|
44
53
|
jsonLd?: FaqSchemaOptions;
|
|
45
54
|
className?: string;
|
|
55
|
+
/** The `id` of the rendered section: what an in-page link to the FAQ points at (`PAGE_FAQ_SECTION_ID` for a page's own block). */
|
|
56
|
+
id?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Print the topic's bare name in small muted text under the heading
|
|
59
|
+
* (`pricing`), so whoever edits the FAQs can see which topic a page asks
|
|
60
|
+
* for. Default off. The section always carries it as `data-faq-topic` too.
|
|
61
|
+
*/
|
|
62
|
+
showTopic?: boolean;
|
|
46
63
|
/** Maps to /api/faqs `?count=` (the 5-tier fill target). Absent → param
|
|
47
64
|
* not sent (server default applies). */
|
|
48
65
|
minResults?: number;
|
|
@@ -60,10 +77,10 @@ export interface FaqSectionProps {
|
|
|
60
77
|
* The "ask the assistant" card beside the questions. Shown wherever the
|
|
61
78
|
* host's assistant runtime says a chat is there to open
|
|
62
79
|
* (`AssistantRuntimeContext`: its name, glyph, questions endpoint and
|
|
63
|
-
* opener) AND the FAQ has a topic: `
|
|
64
|
-
*
|
|
65
|
-
* No runtime or no topic: the FAQ is the single column it
|
|
66
|
-
* lib names no topic of its own. `false` switches the card off; the object
|
|
80
|
+
* opener) AND the FAQ has a topic: the block's `topic`, else the
|
|
81
|
+
* `entityType` the FAQ is attached to (`ask.topic` states another one for
|
|
82
|
+
* the card alone). No runtime or no topic: the FAQ is the single column it
|
|
83
|
+
* always was; the lib names no topic of its own. `false` switches the card off; the object
|
|
67
84
|
* also states the questions to leave out, the wording and the chat it opens
|
|
68
85
|
* (`onOpen`). An `aside` takes the card's place.
|
|
69
86
|
*/
|
|
@@ -72,11 +89,47 @@ export interface FaqSectionProps {
|
|
|
72
89
|
|
|
73
90
|
const DEFAULT_HEADING_TEXT = 'Frequently Asked Questions';
|
|
74
91
|
|
|
92
|
+
/** The id of a page's own FAQ block: what a page's "FAQ" link or section nav points at. */
|
|
93
|
+
export const PAGE_FAQ_SECTION_ID = 'faq';
|
|
94
|
+
|
|
95
|
+
/** A page's own FAQ block inside a page that already provides the container: vertical rhythm only. */
|
|
96
|
+
const PAGE_FAQ_IN_PAGE_CLASS = 'space-y-10 pt-12 md:pt-20';
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* What a shared page of the lib takes as its `faq` prop: the topic the page is
|
|
100
|
+
* about (REQUIRED, stated by the host, never read from the page's address) and
|
|
101
|
+
* where the host serves the FAQs. The page renders `FaqSection` with it, inside
|
|
102
|
+
* its own container, after its content (`pageFaqProps`).
|
|
103
|
+
*/
|
|
104
|
+
export type PageFaqSlot = Pick<
|
|
105
|
+
FaqSectionProps,
|
|
106
|
+
'apiBaseUrl' | 'initialFaqs' | 'heading' | 'ask' | 'emitJsonLd' | 'jsonLd' | 'showTopic'
|
|
107
|
+
> & { topic: string };
|
|
108
|
+
|
|
109
|
+
/** The `FaqSection` props of a shared page's own FAQ block: the host's slot, as the page's `#faq` section. */
|
|
110
|
+
export function pageFaqProps(faq: PageFaqSlot): FaqSectionProps {
|
|
111
|
+
return { ...faq, id: PAGE_FAQ_SECTION_ID, className: PAGE_FAQ_IN_PAGE_CLASS };
|
|
112
|
+
}
|
|
113
|
+
|
|
75
114
|
/** URL composition shared with RelatedContentSection (`buildSuggestionUrl`)
|
|
76
115
|
* — byte-identical to the historical `buildFaqsUrl` output when
|
|
77
116
|
* `minResults`/`apiBaseUrl` are absent. */
|
|
78
|
-
function buildFaqsUrl(
|
|
79
|
-
|
|
117
|
+
function buildFaqsUrl(
|
|
118
|
+
entityType?: string,
|
|
119
|
+
entityId?: number | string,
|
|
120
|
+
minResults?: number,
|
|
121
|
+
apiBaseUrl = '',
|
|
122
|
+
topic?: string,
|
|
123
|
+
): string {
|
|
124
|
+
// An entity's FAQs are the entity's: a topic narrows only the platform's own list.
|
|
125
|
+
const entityScoped = !!entityType && entityId !== undefined && entityId !== null && entityId !== '';
|
|
126
|
+
return buildSuggestionUrl('/api/faqs', {
|
|
127
|
+
apiBaseUrl,
|
|
128
|
+
entityType,
|
|
129
|
+
entityId,
|
|
130
|
+
count: minResults,
|
|
131
|
+
extraParams: entityScoped ? undefined : { topic },
|
|
132
|
+
});
|
|
80
133
|
}
|
|
81
134
|
|
|
82
135
|
interface FaqGroup {
|
|
@@ -390,6 +443,8 @@ interface FaqsResponse {
|
|
|
390
443
|
* page owns the <h1>) + `emitJsonLd` with `jsonLd` overrides for SEO.
|
|
391
444
|
* - Per-entity embed: pass `entityType` + `entityId` (no `initialFaqs`); the
|
|
392
445
|
* hook self-fetches `GET /api/faqs`, and `heading` is this block's own <h2>.
|
|
446
|
+
* - A page's own FAQ: pass `topic` (what the page is about); the hook
|
|
447
|
+
* self-fetches `GET /api/faqs?topic=`, and the ask card takes the same topic.
|
|
393
448
|
*
|
|
394
449
|
* CONTRACT: the consuming app MUST implement `GET /api/faqs`. On a fetch error
|
|
395
450
|
* (or zero FAQs) the component renders nothing so the host page isn't
|
|
@@ -400,10 +455,13 @@ export function FaqSection({
|
|
|
400
455
|
initialFaqs,
|
|
401
456
|
entityType,
|
|
402
457
|
entityId,
|
|
458
|
+
topic,
|
|
403
459
|
heading,
|
|
404
460
|
emitJsonLd = false,
|
|
405
461
|
jsonLd,
|
|
406
462
|
className,
|
|
463
|
+
id,
|
|
464
|
+
showTopic = false,
|
|
407
465
|
minResults,
|
|
408
466
|
apiBaseUrl = '',
|
|
409
467
|
aside: asideProp,
|
|
@@ -412,30 +470,41 @@ export function FaqSection({
|
|
|
412
470
|
const assistant = useAssistantRuntime();
|
|
413
471
|
// The host's own block wins; else the card, where a chat is there to open and the FAQ has a topic
|
|
414
472
|
// (an empty topic is no topic, as the questions request reads it).
|
|
415
|
-
const askTopic = ask === false ? undefined : ask?.topic || entityType;
|
|
473
|
+
const askTopic = ask === false ? undefined : ask?.topic || topic || entityType;
|
|
416
474
|
const aside =
|
|
417
475
|
asideProp ??
|
|
418
476
|
(ask !== false && askTopic && faqAskCardShown(assistant) ? <FaqAskCard {...ask} topic={askTopic} /> : undefined);
|
|
419
|
-
const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl);
|
|
477
|
+
const url = buildFaqsUrl(entityType, entityId, minResults, apiBaseUrl, topic);
|
|
420
478
|
// Memoized — useSelfFetch re-syncs on [initialData]; a fresh per-render
|
|
421
479
|
// wrapper object would setState-loop under re-rendering parents.
|
|
422
480
|
const initialData = useMemo<FaqsResponse | undefined>(
|
|
423
481
|
() => (initialFaqs ? { faqs: initialFaqs } : undefined),
|
|
424
482
|
[initialFaqs],
|
|
425
483
|
);
|
|
426
|
-
const { data, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData });
|
|
484
|
+
const { data, dataUrl, isLoading, error } = useSelfFetch<FaqsResponse>(url, { initialData });
|
|
427
485
|
|
|
428
|
-
//
|
|
429
|
-
//
|
|
430
|
-
|
|
486
|
+
// Only the answer for THIS url: while another topic's questions load, the
|
|
487
|
+
// previous topic's are not this page's. Memoised because the `??` fallback
|
|
488
|
+
// minted a NEW array on every render, which made the memo below re-run
|
|
489
|
+
// every time — i.e. do nothing.
|
|
490
|
+
const held = dataUrl === url ? data?.faqs : undefined;
|
|
491
|
+
const faqs = useMemo(() => held ?? [], [held]);
|
|
431
492
|
// Grouped before the early returns so the hook order stays stable.
|
|
432
493
|
const groups = useMemo(() => (faqs.length > 0 ? groupFaqsBySection(faqs) : []), [faqs]);
|
|
433
494
|
|
|
434
495
|
// `undefined` → default <h2> title; `null` → the host page owns the <h1>, so
|
|
435
496
|
// no title renders here. `heading === null` also makes the category headings
|
|
436
497
|
// <h2> (directly under the page <h1>); otherwise they nest as <h3>.
|
|
498
|
+
const titleNode = heading === undefined ? <h2 className={SECTION_HEADING_CLASS}>{DEFAULT_HEADING_TEXT}</h2> : heading;
|
|
437
499
|
const headingNode =
|
|
438
|
-
|
|
500
|
+
showTopic && topic ? (
|
|
501
|
+
<div className="space-y-1">
|
|
502
|
+
{titleNode}
|
|
503
|
+
<p className="text-ods-text-muted text-h6">{topic}</p>
|
|
504
|
+
</div>
|
|
505
|
+
) : (
|
|
506
|
+
titleNode
|
|
507
|
+
);
|
|
439
508
|
|
|
440
509
|
// Degrade silently — never show an error banner or an empty section shell
|
|
441
510
|
// where FAQs would be (host pages and the standalone surface both rely on it).
|
|
@@ -453,7 +522,7 @@ export function FaqSection({
|
|
|
453
522
|
|
|
454
523
|
return (
|
|
455
524
|
<>
|
|
456
|
-
<section className={className ?? 'space-y-10'}>
|
|
525
|
+
<section id={id} data-faq-topic={topic} className={className ?? 'space-y-10'}>
|
|
457
526
|
{!aside && headingNode}
|
|
458
527
|
<GroupedFaqList
|
|
459
528
|
groups={groups}
|
|
@@ -9,6 +9,6 @@
|
|
|
9
9
|
//
|
|
10
10
|
// (Server-safe subpath is wired in tsup.config.ts under the server/universal
|
|
11
11
|
// block and exposed via "./components/faq/json-ld" in package.json#exports.)
|
|
12
|
-
export { FaqSection, type FaqSectionProps } from './faq-section';
|
|
12
|
+
export { FaqSection, PAGE_FAQ_SECTION_ID, pageFaqProps, type FaqSectionProps, type PageFaqSlot } from './faq-section';
|
|
13
13
|
export { FaqDocumentPage, type FaqDocumentPageProps } from './faq-document-page';
|
|
14
14
|
export { FaqAskCard, type FaqAskOptions } from './faq-ask-card';
|