@flamingo-stack/openframe-frontend-core 0.0.739 → 0.0.740
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-WMKNZI4G.cjs → chunk-2Y5Y4FLM.cjs} +22 -22
- package/dist/{chunk-ENCAIAMY.cjs → chunk-3ZIQOYNX.cjs} +3 -3
- package/dist/{chunk-UI3HROSI.cjs → chunk-4RLGLB45.cjs} +33 -33
- package/dist/{chunk-FL6UO7IR.cjs → chunk-5SVOGLNK.cjs} +2 -2
- package/dist/{chunk-DTLHY2ZF.cjs → chunk-7UIQPMBJ.cjs} +11 -11
- package/dist/{chunk-UYP3G6PB.cjs → chunk-BDA5F6RM.cjs} +2 -2
- package/dist/{chunk-S2CA5WE4.cjs → chunk-CWRVTQUO.cjs} +9 -1
- package/dist/{chunk-CUDTMCXK.cjs → chunk-D5KEWWLW.cjs} +13 -13
- package/dist/{chunk-UXFJXIUT.cjs → chunk-EKGL5K5K.cjs} +2 -2
- package/dist/{chunk-V2ZFH42N.cjs → chunk-HYBMADYO.cjs} +3 -3
- package/dist/{chunk-Q7GG3WC5.cjs → chunk-LLAC2UZ3.cjs} +5 -5
- package/dist/{chunk-EGN4I5Q7.cjs → chunk-SWR22DOZ.cjs} +134 -46
- package/dist/{chunk-TF7J6VXG.cjs → chunk-UW3YXDC4.cjs} +9 -9
- package/dist/{chunk-SB4VWA5V.cjs → chunk-VC4IV3AY.cjs} +70 -70
- package/dist/{chunk-RGFT3P3L.cjs → chunk-VU4CKUJW.cjs} +55 -55
- package/dist/{chunk-NX6JQT25.cjs → chunk-ZLTCQKTD.cjs} +4 -4
- package/dist/{cloud-tenants-QSFSO3PA.cjs → cloud-tenants-PVXDI5MU.cjs} +3 -3
- package/dist/components/case-studies/index.cjs +11 -11
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/faq/index.cjs +5 -5
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/help-center-pages/index.cjs +53 -53
- package/dist/components/index.cjs +39 -33
- package/dist/components/meeting-scheduler/index.cjs +17 -17
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.cjs +5 -5
- package/dist/components/product-demo/index.cjs +6 -6
- package/dist/components/shared/legal-document/index.d.ts +2 -1
- package/dist/components/shared/legal-document/index.d.ts.map +1 -1
- package/dist/components/shared/legal-document/index.js +10 -2
- package/dist/components/shared/legal-document/legal-document-page.d.ts +35 -23
- package/dist/components/shared/legal-document/legal-document-page.d.ts.map +1 -1
- package/dist/components/shared/legal-document/legal-document-page.js +27 -10
- package/dist/components/shared/legal-document/use-legal-docs.d.ts +7 -3
- package/dist/components/shared/legal-document/use-legal-docs.d.ts.map +1 -1
- package/dist/components/shared/legal-document/use-legal-docs.js +7 -0
- package/dist/components/shared/legal-document/use-legal-documents.d.ts +31 -0
- package/dist/components/shared/legal-document/use-legal-documents.d.ts.map +1 -0
- package/dist/components/shared/legal-document/use-legal-documents.js +67 -0
- package/dist/components/tickets/index.cjs +8 -8
- package/dist/components/ui/index.cjs +3 -3
- package/dist/{devices-C7XLWJFC.cjs → devices-TWEA7XOR.cjs} +4 -4
- package/dist/index.cjs +11 -7
- package/dist/{knowledge-3QKWTOE7.cjs → knowledge-4GQDBNQB.cjs} +3 -3
- package/dist/{logs-JXD75NR4.cjs → logs-EVU6GJHZ.cjs} +11 -11
- package/dist/{policies-ZPN53PFQ.cjs → policies-OZUEA5YS.cjs} +7 -7
- package/dist/{software-update-CRSIBS3K.cjs → software-update-BLIVYOY2.cjs} +6 -6
- package/dist/utils/index.cjs +8 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -0
- package/dist/utils/legal-documents.d.ts +18 -0
- package/dist/utils/legal-documents.d.ts.map +1 -0
- package/dist/utils/legal-documents.js +8 -0
- package/package.json +1 -1
- package/src/components/shared/legal-document/index.ts +8 -0
- package/src/components/shared/legal-document/legal-document-page.tsx +83 -44
- package/src/components/shared/legal-document/use-legal-docs.ts +18 -3
- package/src/components/shared/legal-document/use-legal-documents.ts +113 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/legal-documents.ts +21 -0
|
@@ -16,7 +16,7 @@ var _chunkWBANGORJcjs = require('../../chunk-WBANGORJ.cjs');
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
19
|
+
var _chunkVC4IV3AYcjs = require('../../chunk-VC4IV3AY.cjs');
|
|
20
20
|
require('../../chunk-O67V3HJR.cjs');
|
|
21
21
|
require('../../chunk-3HPB4H4C.cjs');
|
|
22
22
|
|
|
@@ -46,7 +46,7 @@ var _chunkYUMFVQINcjs = require('../../chunk-YUMFVQIN.cjs');
|
|
|
46
46
|
|
|
47
47
|
|
|
48
48
|
|
|
49
|
-
var
|
|
49
|
+
var _chunkCWRVTQUOcjs = require('../../chunk-CWRVTQUO.cjs');
|
|
50
50
|
|
|
51
51
|
|
|
52
52
|
var _chunkBV5WZVOPcjs = require('../../chunk-BV5WZVOP.cjs');
|
|
@@ -2190,7 +2190,7 @@ function useMeetingBooking(options) {
|
|
|
2190
2190
|
const seededOffset = _optionalChain([initialAvailability, 'optionalAccess', _12 => _12.meetingId]) === meetingId ? initialAvailability.monthOffset : void 0;
|
|
2191
2191
|
const [monthOffset, setMonthOffsetState] = _react.useState.call(void 0, _nullishCoalesce(seededOffset, () => ( 0)));
|
|
2192
2192
|
const setMonthOffset = _react.useCallback.call(void 0, (offset) => {
|
|
2193
|
-
setMonthOffsetState(Math.max(0, Math.min(
|
|
2193
|
+
setMonthOffsetState(Math.max(0, Math.min(_chunkCWRVTQUOcjs.MAX_MONTH_OFFSET, offset)));
|
|
2194
2194
|
}, []);
|
|
2195
2195
|
const prevMeetingIdRef = _react.useRef.call(void 0, meetingId);
|
|
2196
2196
|
_react.useLayoutEffect.call(void 0, () => {
|
|
@@ -2320,7 +2320,7 @@ var FIELD_CONTROLS = {
|
|
|
2320
2320
|
}
|
|
2321
2321
|
),
|
|
2322
2322
|
textarea: ({ field, id, registerName, error, register }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2323
|
-
|
|
2323
|
+
_chunkVC4IV3AYcjs.Textarea,
|
|
2324
2324
|
{
|
|
2325
2325
|
id,
|
|
2326
2326
|
required: field.required,
|
|
@@ -2397,14 +2397,14 @@ var FIELD_CONTROLS = {
|
|
|
2397
2397
|
control,
|
|
2398
2398
|
name: registerName,
|
|
2399
2399
|
render: ({ field: rhf }) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2400
|
-
|
|
2400
|
+
_chunkVC4IV3AYcjs.RadioGroup,
|
|
2401
2401
|
{
|
|
2402
2402
|
value: _nullishCoalesce(rhf.value, () => ( "")),
|
|
2403
2403
|
onValueChange: rhf.onChange,
|
|
2404
2404
|
"aria-required": field.required || void 0,
|
|
2405
2405
|
"aria-invalid": Boolean(error),
|
|
2406
2406
|
children: (_nullishCoalesce(field.options, () => ( []))).map((opt) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-[var(--spacing-system-xs)]", children: [
|
|
2407
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2407
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVC4IV3AYcjs.RadioGroupItem, { id: `${id}-${opt}`, value: opt }),
|
|
2408
2408
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkK6VWTUCHcjs.Label, { htmlFor: `${id}-${opt}`, children: optionLabel(field, opt) })
|
|
2409
2409
|
] }, opt))
|
|
2410
2410
|
}
|
|
@@ -2640,8 +2640,8 @@ function BookingForm({
|
|
|
2640
2640
|
children: _nullishCoalesce(submitLabel, () => ( DEFAULT_SUBMIT_LABEL))
|
|
2641
2641
|
}
|
|
2642
2642
|
);
|
|
2643
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: submit, className: FORM_STACK, noValidate: true, ...
|
|
2644
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2643
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "form", { onSubmit: submit, className: FORM_STACK, noValidate: true, ..._chunkCWRVTQUOcjs.HUBSPOT_DO_NOT_COLLECT_FORM_PROPS, children: [
|
|
2644
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVC4IV3AYcjs.HoneypotField, { ...honeypotInputProps }),
|
|
2645
2645
|
fieldRows ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
2646
2646
|
placedRows.map((row) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: ROW_GRID, children: row.map((slot, slotIndex) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: slotColumnClass(row, slot, slotIndex), children: slotNode(slot.name) }, slot.name)) }, row.map((s) => s.name).join("|"))),
|
|
2647
2647
|
[...unplacedBuiltIns, ...unplacedFields].map((field) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: slotNode(field.name) }, field.name))
|
|
@@ -2654,7 +2654,7 @@ function BookingForm({
|
|
|
2654
2654
|
supportedFields.map((field) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _react.Fragment, { children: renderDeclaredField(field) }, field.name))
|
|
2655
2655
|
] }),
|
|
2656
2656
|
consent && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2657
|
-
|
|
2657
|
+
_chunkVC4IV3AYcjs.CheckboxBlock,
|
|
2658
2658
|
{
|
|
2659
2659
|
id: "ms-host-consent",
|
|
2660
2660
|
checked: consented,
|
|
@@ -2689,7 +2689,7 @@ function BookingForm({
|
|
|
2689
2689
|
// same block the waitlist form uses): box + label in one
|
|
2690
2690
|
// bordered row.
|
|
2691
2691
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2692
|
-
|
|
2692
|
+
_chunkVC4IV3AYcjs.CheckboxBlock,
|
|
2693
2693
|
{
|
|
2694
2694
|
id: `ms-consent-${box.communicationTypeId}`,
|
|
2695
2695
|
checked: _nullishCoalesce(_optionalChain([current, 'optionalAccess', _34 => _34.consented]), () => ( false)),
|
|
@@ -2884,7 +2884,7 @@ function SchedulerContextPanel({
|
|
|
2884
2884
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: _chunk3ATAYP36cjs.cn.call(void 0, STRIP_ASIDE, locked && "content-max-lg:hidden"), children: [
|
|
2885
2885
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: FIELD_LABEL_CLASS, children: "Timezone" }),
|
|
2886
2886
|
timezone ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2887
|
-
|
|
2887
|
+
_chunkVC4IV3AYcjs.TimezoneSelect,
|
|
2888
2888
|
{
|
|
2889
2889
|
value: timezone,
|
|
2890
2890
|
disabled,
|
|
@@ -2967,18 +2967,18 @@ var NOOP = () => void 0;
|
|
|
2967
2967
|
function DayCalendar({ monthOffset, onMonthOffsetChange, selectedDay, onSelectDay, slotsByDay }) {
|
|
2968
2968
|
const now = /* @__PURE__ */ new Date();
|
|
2969
2969
|
const startMonth = new Date(now.getFullYear(), now.getMonth(), 1);
|
|
2970
|
-
const endMonth = new Date(now.getFullYear(), now.getMonth() +
|
|
2970
|
+
const endMonth = new Date(now.getFullYear(), now.getMonth() + _chunkCWRVTQUOcjs.MAX_MONTH_OFFSET + 1, 0);
|
|
2971
2971
|
const visibleMonth = new Date(now.getFullYear(), now.getMonth() + monthOffset, 1);
|
|
2972
2972
|
const dayHasNoSlots = _react.useCallback.call(void 0, (day) => !_optionalChain([slotsByDay, 'optionalAccess', _36 => _36.has, 'call', _37 => _37(calendarDayKey(day))]), [slotsByDay]);
|
|
2973
2973
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex min-h-0 flex-1 flex-col", "aria-busy": slotsByDay === null, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
2974
|
-
|
|
2974
|
+
_chunkVC4IV3AYcjs.DatePickerCalendar,
|
|
2975
2975
|
{
|
|
2976
2976
|
mode: "single",
|
|
2977
2977
|
bare: true,
|
|
2978
2978
|
month: visibleMonth,
|
|
2979
2979
|
onMonthChange: (month) => {
|
|
2980
2980
|
const offset = (month.getFullYear() - now.getFullYear()) * 12 + (month.getMonth() - now.getMonth());
|
|
2981
|
-
onMonthOffsetChange(Math.max(0, Math.min(
|
|
2981
|
+
onMonthOffsetChange(Math.max(0, Math.min(_chunkCWRVTQUOcjs.MAX_MONTH_OFFSET, offset)));
|
|
2982
2982
|
},
|
|
2983
2983
|
fromDate: startMonth,
|
|
2984
2984
|
toDate: endMonth,
|
|
@@ -3094,7 +3094,7 @@ function SlotPicker({
|
|
|
3094
3094
|
monthLabelFor(monthOffset),
|
|
3095
3095
|
"."
|
|
3096
3096
|
] }),
|
|
3097
|
-
monthOffset <
|
|
3097
|
+
monthOffset < _chunkCWRVTQUOcjs.MAX_MONTH_OFFSET && /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
3098
3098
|
_chunk2QMBXGMQcjs.Button,
|
|
3099
3099
|
{
|
|
3100
3100
|
variant: "outline",
|
|
@@ -3580,11 +3580,11 @@ function HubSpotMeetingScheduler({
|
|
|
3580
3580
|
)
|
|
3581
3581
|
] }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col gap-[var(--spacing-system-m)] content-md:min-h-0 content-md:flex-1", children: [
|
|
3582
3582
|
bookingError === "SLOT_TAKEN" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3583
|
-
|
|
3583
|
+
_chunkVC4IV3AYcjs.Alert,
|
|
3584
3584
|
{
|
|
3585
3585
|
variant: "warning",
|
|
3586
3586
|
className: "mx-[var(--spacing-system-l)] mt-[var(--spacing-system-l)] w-auto content-lg:m-0 content-lg:w-full",
|
|
3587
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
3587
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkVC4IV3AYcjs.AlertDescription, { children: "That time was just taken \u2014 pick another slot below. (If you already submitted, check your email for a confirmation before rebooking.)" })
|
|
3588
3588
|
}
|
|
3589
3589
|
),
|
|
3590
3590
|
timezone && durationMs != null ? (
|
|
@@ -24,15 +24,15 @@
|
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
var
|
|
27
|
+
var _chunk2Y5Y4FLMcjs = require('../../chunk-2Y5Y4FLM.cjs');
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
|
|
34
|
-
var
|
|
35
|
-
require('../../chunk-
|
|
34
|
+
var _chunkEKGL5K5Kcjs = require('../../chunk-EKGL5K5K.cjs');
|
|
35
|
+
require('../../chunk-5SVOGLNK.cjs');
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
|
|
@@ -47,7 +47,7 @@ require('../../chunk-FL6UO7IR.cjs');
|
|
|
47
47
|
|
|
48
48
|
|
|
49
49
|
|
|
50
|
-
var
|
|
50
|
+
var _chunkVC4IV3AYcjs = require('../../chunk-VC4IV3AY.cjs');
|
|
51
51
|
require('../../chunk-O67V3HJR.cjs');
|
|
52
52
|
require('../../chunk-3HPB4H4C.cjs');
|
|
53
53
|
require('../../chunk-DSVNFRY5.cjs');
|
|
@@ -63,7 +63,7 @@ require('../../chunk-YUMFVQIN.cjs');
|
|
|
63
63
|
|
|
64
64
|
|
|
65
65
|
|
|
66
|
-
var
|
|
66
|
+
var _chunkCWRVTQUOcjs = require('../../chunk-CWRVTQUO.cjs');
|
|
67
67
|
|
|
68
68
|
|
|
69
69
|
|
|
@@ -1949,4 +1949,4 @@ require('../../chunk-3ATAYP36.cjs');
|
|
|
1949
1949
|
|
|
1950
1950
|
|
|
1951
1951
|
|
|
1952
|
-
exports.ASK_AI_OPEN_EVENT = _chunkBV5WZVOPcjs.ASK_AI_OPEN_EVENT; exports.ASK_AI_OPEN_WITH_REF_EVENT = _chunkBV5WZVOPcjs.ASK_AI_OPEN_WITH_REF_EVENT; exports.AppHeader =
|
|
1952
|
+
exports.ASK_AI_OPEN_EVENT = _chunkBV5WZVOPcjs.ASK_AI_OPEN_EVENT; exports.ASK_AI_OPEN_WITH_REF_EVENT = _chunkBV5WZVOPcjs.ASK_AI_OPEN_WITH_REF_EVENT; exports.AppHeader = _chunk2Y5Y4FLMcjs.AppHeader; exports.AppLayout = _chunk2Y5Y4FLMcjs.AppLayout; exports.AppLayoutDrawer = _chunkVC4IV3AYcjs.AppLayoutDrawerRoot; exports.AppLayoutDrawerBody = _chunkVC4IV3AYcjs.AppLayoutDrawerBody; exports.AppLayoutDrawerClose = _chunkVC4IV3AYcjs.AppLayoutDrawerClose; exports.AppLayoutDrawerContent = _chunkVC4IV3AYcjs.AppLayoutDrawerContent; exports.AppLayoutDrawerDescription = _chunkVC4IV3AYcjs.AppLayoutDrawerDescription; exports.AppLayoutDrawerFooter = _chunkVC4IV3AYcjs.AppLayoutDrawerFooter; exports.AppLayoutDrawerHeader = _chunkVC4IV3AYcjs.AppLayoutDrawerHeader; exports.AppLayoutDrawerTitle = _chunkVC4IV3AYcjs.AppLayoutDrawerTitle; exports.AppLayoutDrawerTrigger = _chunkVC4IV3AYcjs.AppLayoutDrawerTrigger; exports.HeaderButton = _chunkVC4IV3AYcjs.HeaderButton; exports.HeaderGlobalSearch = _chunk2Y5Y4FLMcjs.HeaderGlobalSearch; exports.HeaderMingoButton = _chunk2Y5Y4FLMcjs.HeaderMingoButton; exports.HeaderOrganizationFilter = _chunk2Y5Y4FLMcjs.HeaderOrganizationFilter; exports.MOBILE_NAV_SHEET_ID = _chunk2Y5Y4FLMcjs.MOBILE_NAV_SHEET_ID; exports.MingoAiButton = _chunkCWRVTQUOcjs.MingoAiButton; exports.MobileBurgerMenu = _chunk2Y5Y4FLMcjs.MobileBurgerMenu; exports.MobileNavSheet = _chunk2Y5Y4FLMcjs.MobileNavSheet; exports.MobileNavigationDropdown = _chunkEKGL5K5Kcjs.MobileNavigationDropdown; exports.MultiLevelNavigation = _chunkEKGL5K5Kcjs.MultiLevelNavigation; exports.NAVIGATION_SIDEBAR_WIDTH_VAR = _chunk2Y5Y4FLMcjs.NAVIGATION_SIDEBAR_WIDTH_VAR; exports.NavItemRow = _chunk2Y5Y4FLMcjs.NavItemRow; exports.NavPanel = _chunk2Y5Y4FLMcjs.NavPanel; exports.NavigationItemBadge = _chunk2Y5Y4FLMcjs.NavigationItemBadge; exports.NavigationSidebar = _chunk2Y5Y4FLMcjs.NavigationSidebar; exports.SIDE_PANEL_FRAME_WIDTH = _chunk2Y5Y4FLMcjs.SIDE_PANEL_FRAME_WIDTH; exports.SiteFooter = _chunk2Y5Y4FLMcjs.SiteFooter; exports.SiteHeader = _chunk2Y5Y4FLMcjs.SiteHeader; exports.SlidingSidebar = _chunk2Y5Y4FLMcjs.SlidingSidebar; exports.StickySectionNav = _chunkEKGL5K5Kcjs.StickySectionNav; exports.TicketAlertsButton = _chunk2Y5Y4FLMcjs.TicketAlertsButton; exports.TopNavigation = _chunk2Y5Y4FLMcjs.TopNavigation; exports.UnreadCountBadge = _chunkVC4IV3AYcjs.UnreadCountBadge; exports.UnreadDot = _chunkVC4IV3AYcjs.UnreadDot; exports.defaultRenderSiteNavLink = _chunk2Y5Y4FLMcjs.defaultRenderSiteNavLink; exports.isMegaMenu = _chunk2Y5Y4FLMcjs.isMegaMenu; exports.navLinkLabel = _chunk2Y5Y4FLMcjs.navLinkLabel; exports.openAskAi = _chunkCWRVTQUOcjs.openAskAi; exports.siteNavHasMobileMenus = _chunk2Y5Y4FLMcjs.siteNavHasMobileMenus; exports.useAppLayoutDrawerContainer = _chunkVC4IV3AYcjs.useAppLayoutDrawerContainer; exports.useScrollSpy = _chunkEKGL5K5Kcjs.useScrollSpy; exports.useSectionNavigation = _chunkEKGL5K5Kcjs.useSectionNavigation;
|
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkD5KEWWLWcjs = require('../../chunk-D5KEWWLW.cjs');
|
|
11
11
|
require('../../chunk-B3XBJCOD.cjs');
|
|
12
|
-
require('../../chunk-
|
|
13
|
-
require('../../chunk-
|
|
12
|
+
require('../../chunk-BDA5F6RM.cjs');
|
|
13
|
+
require('../../chunk-VC4IV3AY.cjs');
|
|
14
14
|
require('../../chunk-O67V3HJR.cjs');
|
|
15
15
|
require('../../chunk-3HPB4H4C.cjs');
|
|
16
16
|
require('../../chunk-DSVNFRY5.cjs');
|
|
@@ -23,7 +23,7 @@ require('../../chunk-A6P6DHEZ.cjs');
|
|
|
23
23
|
require('../../chunk-MZ4KBSH7.cjs');
|
|
24
24
|
require('../../chunk-KLI4OSRA.cjs');
|
|
25
25
|
require('../../chunk-YUMFVQIN.cjs');
|
|
26
|
-
require('../../chunk-
|
|
26
|
+
require('../../chunk-CWRVTQUO.cjs');
|
|
27
27
|
require('../../chunk-BV5WZVOP.cjs');
|
|
28
28
|
require('../../chunk-GABDE3FM.cjs');
|
|
29
29
|
require('../../chunk-3RFQPQ7Z.cjs');
|
|
@@ -1868,4 +1868,4 @@ require('../../chunk-3ATAYP36.cjs');
|
|
|
1868
1868
|
|
|
1869
1869
|
|
|
1870
1870
|
|
|
1871
|
-
exports.OnboardingGuideDetailView =
|
|
1871
|
+
exports.OnboardingGuideDetailView = _chunkD5KEWWLWcjs.OnboardingGuideDetailView; exports.OnboardingGuidesCatalogSkeleton = _chunkD5KEWWLWcjs.OnboardingGuidesCatalogSkeleton; exports.OnboardingGuidesCatalogView = _chunkD5KEWWLWcjs.OnboardingGuidesCatalogView; exports.onboardingGuideKeys = _chunkD5KEWWLWcjs.onboardingGuideKeys; exports.useOnboardingGuide = _chunkD5KEWWLWcjs.useOnboardingGuide; exports.useOnboardingGuideSections = _chunkD5KEWWLWcjs.useOnboardingGuideSections; exports.useOnboardingGuides = _chunkD5KEWWLWcjs.useOnboardingGuides;
|
|
@@ -22,13 +22,13 @@ var _react = require('react');
|
|
|
22
22
|
// src/components/product-demo/registry.ts
|
|
23
23
|
var PRODUCT_SCREEN_LOADERS = {
|
|
24
24
|
"remote-session": () => Promise.resolve().then(() => _interopRequireWildcard(require("../../remote-session-DNFZ5OLY.cjs"))),
|
|
25
|
-
"software-update": () => Promise.resolve().then(() => _interopRequireWildcard(require("../../software-update-
|
|
26
|
-
devices: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../devices-
|
|
27
|
-
policies: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../policies-
|
|
28
|
-
"cloud-tenants": () => Promise.resolve().then(() => _interopRequireWildcard(require("../../cloud-tenants-
|
|
25
|
+
"software-update": () => Promise.resolve().then(() => _interopRequireWildcard(require("../../software-update-BLIVYOY2.cjs"))),
|
|
26
|
+
devices: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../devices-TWEA7XOR.cjs"))),
|
|
27
|
+
policies: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../policies-OZUEA5YS.cjs"))),
|
|
28
|
+
"cloud-tenants": () => Promise.resolve().then(() => _interopRequireWildcard(require("../../cloud-tenants-PVXDI5MU.cjs"))),
|
|
29
29
|
"tickets-board": () => Promise.resolve().then(() => _interopRequireWildcard(require("../../tickets-board-CKZRB6YV.cjs"))),
|
|
30
|
-
logs: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../logs-
|
|
31
|
-
knowledge: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../knowledge-
|
|
30
|
+
logs: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../logs-EVU6GJHZ.cjs"))),
|
|
31
|
+
knowledge: () => Promise.resolve().then(() => _interopRequireWildcard(require("../../knowledge-4GQDBNQB.cjs")))
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
// src/components/product-demo/screen-keys.ts
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* formerly-duplicated `PrivacyPolicyPage` + `TermsOfServicePage`
|
|
6
6
|
* (95% identical, differing only in copy strings).
|
|
7
7
|
*/
|
|
8
|
-
export { LegalDocumentPage, type LegalDocumentPageProps, type LegalDocumentMarkdownRendererProps, } from './legal-document-page';
|
|
8
|
+
export { LegalDocumentPage, legalDocumentStampLabel, type LegalDocumentPageProps, type LegalDocumentMarkdownRendererProps, } from './legal-document-page';
|
|
9
9
|
export { useLegalDocs, type LegalDocument, type UseLegalDocsOptions, type UseLegalDocsReturn } from './use-legal-docs';
|
|
10
|
+
export { useLegalDocuments, toLegalDocumentSummaries, type LegalDocumentSummary, type UseLegalDocumentsOptions, type UseLegalDocumentsReturn, } from './use-legal-documents';
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,iBAAiB,EACjB,KAAK,sBAAsB,EAC3B,KAAK,kCAAkC,GACxC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EACL,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,sBAAsB,EAC3B,KAAK,kCAAkC,GACxC,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvH,OAAO,EACL,iBAAiB,EACjB,wBAAwB,EACxB,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,GAC7B,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
|
-
LegalDocumentPage
|
|
2
|
+
LegalDocumentPage,
|
|
3
|
+
legalDocumentStampLabel
|
|
3
4
|
} from "./legal-document-page.js";
|
|
4
5
|
import { useLegalDocs } from "./use-legal-docs.js";
|
|
6
|
+
import {
|
|
7
|
+
useLegalDocuments,
|
|
8
|
+
toLegalDocumentSummaries
|
|
9
|
+
} from "./use-legal-documents.js";
|
|
5
10
|
export {
|
|
6
11
|
LegalDocumentPage,
|
|
7
|
-
|
|
12
|
+
legalDocumentStampLabel,
|
|
13
|
+
toLegalDocumentSummaries,
|
|
14
|
+
useLegalDocs,
|
|
15
|
+
useLegalDocuments
|
|
8
16
|
};
|
|
@@ -28,25 +28,24 @@ export interface LegalDocumentMarkdownRendererProps {
|
|
|
28
28
|
}
|
|
29
29
|
export interface LegalDocumentPageProps {
|
|
30
30
|
/** Document type identifier — drives the default API endpoint
|
|
31
|
-
* `/api/legal/<docType>` AND the error-log prefix.
|
|
32
|
-
*
|
|
31
|
+
* `/api/legal/<docType>` AND the error-log prefix. One of the types the
|
|
32
|
+
* host's list answers (`useLegalDocuments`). */
|
|
33
33
|
docType: string;
|
|
34
|
-
/** Heading text
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
fallbackDescription
|
|
39
|
-
/** Email shown in the error + empty-state copy
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
emptyStateMessage: string;
|
|
34
|
+
/** Heading text. Default: the title the served document carries, so a host
|
|
35
|
+
* that shows whatever the list holds states no per-document copy. */
|
|
36
|
+
title?: string;
|
|
37
|
+
/** Subtitle shown when the document states neither a version nor a date. */
|
|
38
|
+
fallbackDescription?: string;
|
|
39
|
+
/** Email shown in the error + empty-state copy. Absent: no contact line. */
|
|
40
|
+
contactEmail?: string;
|
|
41
|
+
/** Prompt shown above the contact link in the error state.
|
|
42
|
+
* Default "For questions about this document, please contact:". */
|
|
43
|
+
errorContactPrompt?: string;
|
|
44
|
+
/** Title for the error block. Default "Unable to load <title>". */
|
|
45
|
+
errorTitle?: string;
|
|
46
|
+
/** Sentence shown when the API returns no document.
|
|
47
|
+
* Default "<title> is not available at this time.". */
|
|
48
|
+
emptyStateMessage?: string;
|
|
50
49
|
/** SSR-prepared document, if available. */
|
|
51
50
|
initialData?: LegalDocument | null;
|
|
52
51
|
/** SSR-prepared formatted "Last Updated" label. Stable across hydration. */
|
|
@@ -63,15 +62,28 @@ export interface LegalDocumentPageProps {
|
|
|
63
62
|
href?: string;
|
|
64
63
|
} | false;
|
|
65
64
|
/**
|
|
66
|
-
* The
|
|
67
|
-
*
|
|
68
|
-
*
|
|
65
|
+
* The hub's list of legal documents (`GET /api/legal`). Given it, the page
|
|
66
|
+
* takes the document's title and FAQ topic from the list, so a host passes
|
|
67
|
+
* only the type and its endpoints and states nothing per document; the title
|
|
68
|
+
* then names the document even when its text fails to load.
|
|
69
69
|
*/
|
|
70
|
-
|
|
70
|
+
documentsEndpoint?: string;
|
|
71
|
+
/**
|
|
72
|
+
* The page's own FAQ block: the topic the page is about and where the host
|
|
73
|
+
* serves the FAQs. Rendered after the page's content, inside its container.
|
|
74
|
+
* Without a `topic`, the topic is the one the list (`documentsEndpoint`)
|
|
75
|
+
* gives the document. Absent, or no topic known: no FAQ block.
|
|
76
|
+
*/
|
|
77
|
+
faq?: PageFaqSlot | Omit<PageFaqSlot, 'topic'>;
|
|
71
78
|
/** Render the standalone `<PageShell>`. Default true. Pass false when the host
|
|
72
79
|
* layout already provides the page container — only the padding box renders,
|
|
73
80
|
* avoiding a nested `<main>`. */
|
|
74
81
|
shell?: boolean;
|
|
75
82
|
}
|
|
76
|
-
|
|
83
|
+
/**
|
|
84
|
+
* "Version 1.0 · Effective October 14, 2026" for a document that states them;
|
|
85
|
+
* null for one that states neither. One wording for every legal surface.
|
|
86
|
+
*/
|
|
87
|
+
export declare function legalDocumentStampLabel(doc: Pick<LegalDocument, 'version' | 'effectiveDate'> | null | undefined): string | null;
|
|
88
|
+
export declare function LegalDocumentPage({ docType, title: titleProp, fallbackDescription, contactEmail, errorContactPrompt, errorTitle: errorTitleProp, emptyStateMessage: emptyStateMessageProp, initialData, initialLastUpdatedLabel, apiEndpoint, MarkdownRenderer, documentsEndpoint, backButton, faq, shell, }: LegalDocumentPageProps): import("react").JSX.Element;
|
|
77
89
|
//# sourceMappingURL=legal-document-page.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"legal-document-page.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/legal-document-page.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"legal-document-page.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/legal-document-page.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGnF,OAAO,EAAgB,KAAK,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAGpE,MAAM,WAAW,kCAAkC;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjE,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,sBAAsB;IACrC;;qDAEiD;IACjD,OAAO,EAAE,MAAM,CAAC;IAChB;0EACsE;IACtE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,4EAA4E;IAC5E,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,4EAA4E;IAC5E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;wEACoE;IACpE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;4DACwD;IACxD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,2CAA2C;IAC3C,WAAW,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,4EAA4E;IAC5E,uBAAuB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxC;0DACsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,gBAAgB,CAAC,EAAE,aAAa,CAAC,kCAAkC,CAAC,CAAC;IACrE;mEAC+D;IAC/D,UAAU,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAC;IACvD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,GAAG,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IAC/C;;sCAEkC;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,SAAS,GAAG,eAAe,CAAC,GAAG,IAAI,GAAG,SAAS,GACvE,MAAM,GAAG,IAAI,CAMf;AAED,wBAAgB,iBAAiB,CAAC,EAChC,OAAO,EACP,KAAK,EAAE,SAAS,EAChB,mBAAwB,EACxB,YAAY,EACZ,kBAAyE,EACzE,UAAU,EAAE,cAAc,EAC1B,iBAAiB,EAAE,qBAAqB,EACxC,WAAkB,EAClB,uBAA8B,EAC9B,WAAW,EACX,gBAAuC,EACvC,iBAAiB,EACjB,UAAU,EACV,GAAG,EACH,KAAY,GACb,EAAE,sBAAsB,+BAkGxB"}
|
|
@@ -7,18 +7,27 @@ import { FaqSection, pageFaqProps } from "../../faq/faq-section.js";
|
|
|
7
7
|
import { PageShell, PageLayout } from "../../ui/index.js";
|
|
8
8
|
import { RichMarkdownRenderer } from "../../ui/markdown/index.js";
|
|
9
9
|
import { useLegalDocs } from "./use-legal-docs.js";
|
|
10
|
+
import { useLegalDocuments } from "./use-legal-documents.js";
|
|
11
|
+
function legalDocumentStampLabel(doc) {
|
|
12
|
+
const parts = [
|
|
13
|
+
doc?.version ? `Version ${doc.version}` : null,
|
|
14
|
+
doc?.effectiveDate ? `Effective ${doc.effectiveDate}` : null
|
|
15
|
+
].filter((part) => part !== null);
|
|
16
|
+
return parts.length > 0 ? parts.join(" \xB7 ") : null;
|
|
17
|
+
}
|
|
10
18
|
function LegalDocumentPage({
|
|
11
19
|
docType,
|
|
12
|
-
title,
|
|
13
|
-
fallbackDescription,
|
|
20
|
+
title: titleProp,
|
|
21
|
+
fallbackDescription = "",
|
|
14
22
|
contactEmail,
|
|
15
|
-
errorContactPrompt,
|
|
16
|
-
errorTitle,
|
|
17
|
-
emptyStateMessage,
|
|
23
|
+
errorContactPrompt = "For questions about this document, please contact:",
|
|
24
|
+
errorTitle: errorTitleProp,
|
|
25
|
+
emptyStateMessage: emptyStateMessageProp,
|
|
18
26
|
initialData = null,
|
|
19
27
|
initialLastUpdatedLabel = null,
|
|
20
28
|
apiEndpoint,
|
|
21
29
|
MarkdownRenderer = RichMarkdownRenderer,
|
|
30
|
+
documentsEndpoint,
|
|
22
31
|
backButton,
|
|
23
32
|
faq,
|
|
24
33
|
shell = true
|
|
@@ -29,9 +38,16 @@ function LegalDocumentPage({
|
|
|
29
38
|
label: backButton?.label ?? "Back to home",
|
|
30
39
|
onClick: () => router.push(backButton?.href ?? "/")
|
|
31
40
|
};
|
|
41
|
+
const { documents } = useLegalDocuments({ apiEndpoint: documentsEndpoint, enabled: Boolean(documentsEndpoint) });
|
|
42
|
+
const listed = documents.find((doc) => doc.docType === docType);
|
|
43
|
+
const title = titleProp ?? data?.title ?? listed?.title ?? "Legal document";
|
|
44
|
+
const faqTopic = faq && "topic" in faq ? faq.topic : listed?.faqTopic;
|
|
45
|
+
const faqSlot = faq && faqTopic ? { ...faq, topic: faqTopic } : null;
|
|
46
|
+
const errorTitle = errorTitleProp ?? `Unable to load ${title}`;
|
|
47
|
+
const emptyStateMessage = emptyStateMessageProp ?? `${title} is not available at this time.`;
|
|
32
48
|
const fallbackLastUpdatedLabel = data?.lastSynced != null ? formatLegalDate(data.lastSynced) : null;
|
|
33
49
|
const effectiveLastUpdatedLabel = initialLastUpdatedLabel ?? fallbackLastUpdatedLabel;
|
|
34
|
-
const subtitle = effectiveLastUpdatedLabel ? `Last Updated: ${effectiveLastUpdatedLabel}` : fallbackDescription;
|
|
50
|
+
const subtitle = legalDocumentStampLabel(data) ?? (effectiveLastUpdatedLabel ? `Last Updated: ${effectiveLastUpdatedLabel}` : fallbackDescription);
|
|
35
51
|
const inner = /* @__PURE__ */ jsxs(PageLayout, { title, subtitle, backButton: backCfg, titleSize: "h1", titleWrap: true, children: [
|
|
36
52
|
data?.sourceFile && /* @__PURE__ */ jsxs("p", { className: "text-ods-text-secondary opacity-75 text-h6", children: [
|
|
37
53
|
"Source: ",
|
|
@@ -57,13 +73,13 @@ function LegalDocumentPage({
|
|
|
57
73
|
/* @__PURE__ */ jsx("p", { className: "mb-2 text-ods-error", children: errorTitle }),
|
|
58
74
|
/* @__PURE__ */ jsx("p", { className: "text-ods-error text-h6", children: error })
|
|
59
75
|
] }),
|
|
60
|
-
/* @__PURE__ */ jsxs("div", { className: "text-ods-text-secondary", children: [
|
|
76
|
+
contactEmail && /* @__PURE__ */ jsxs("div", { className: "text-ods-text-secondary", children: [
|
|
61
77
|
/* @__PURE__ */ jsx("p", { children: errorContactPrompt }),
|
|
62
78
|
/* @__PURE__ */ jsx(Link, { href: `mailto:${contactEmail}`, className: "text-ods-accent hover:underline", children: contactEmail })
|
|
63
79
|
] })
|
|
64
80
|
] }) : data ? /* @__PURE__ */ jsx(MarkdownRenderer, { content: data.content, sectionIds: data.sections || [], demoteMarkdownH1ToH2: true }) : /* @__PURE__ */ jsxs("div", { className: "py-16 text-center text-ods-text-secondary", children: [
|
|
65
81
|
/* @__PURE__ */ jsx("p", { className: "text-h4", children: emptyStateMessage }),
|
|
66
|
-
/* @__PURE__ */ jsxs("p", { className: "mt-2", children: [
|
|
82
|
+
contactEmail && /* @__PURE__ */ jsxs("p", { className: "mt-2", children: [
|
|
67
83
|
"Please contact",
|
|
68
84
|
" ",
|
|
69
85
|
/* @__PURE__ */ jsx(Link, { href: `mailto:${contactEmail}`, className: "text-ods-accent hover:underline", children: contactEmail }),
|
|
@@ -71,10 +87,11 @@ function LegalDocumentPage({
|
|
|
71
87
|
"for more information."
|
|
72
88
|
] })
|
|
73
89
|
] }) }) }) }) }),
|
|
74
|
-
|
|
90
|
+
faqSlot && /* @__PURE__ */ jsx(FaqSection, { ...pageFaqProps(faqSlot) })
|
|
75
91
|
] });
|
|
76
92
|
return shell ? /* @__PURE__ */ jsx(PageShell, { children: inner }) : /* @__PURE__ */ jsx("div", { className: "page-shell-content", children: inner });
|
|
77
93
|
}
|
|
78
94
|
export {
|
|
79
|
-
LegalDocumentPage
|
|
95
|
+
LegalDocumentPage,
|
|
96
|
+
legalDocumentStampLabel
|
|
80
97
|
};
|
|
@@ -10,6 +10,10 @@ export interface LegalDocument {
|
|
|
10
10
|
level: number;
|
|
11
11
|
}>;
|
|
12
12
|
docType: string;
|
|
13
|
+
/** The version the document states for itself ("1.0"); null when it states none. */
|
|
14
|
+
version: string | null;
|
|
15
|
+
/** The day that version takes effect, as the document words it; null when it states none. */
|
|
16
|
+
effectiveDate: string | null;
|
|
13
17
|
meta: {
|
|
14
18
|
sectionsCount: number;
|
|
15
19
|
contentLength: number;
|
|
@@ -32,9 +36,9 @@ export interface UseLegalDocsOptions {
|
|
|
32
36
|
/**
|
|
33
37
|
* Hook to fetch a legal document.
|
|
34
38
|
* @param docType — short identifier for the document (drives the
|
|
35
|
-
* default endpoint path AND the error-log prefix).
|
|
36
|
-
*
|
|
37
|
-
*
|
|
39
|
+
* default endpoint path AND the error-log prefix). The valid values are
|
|
40
|
+
* the ones the host's list endpoint answers (`useLegalDocuments`); the
|
|
41
|
+
* hook treats it as opaque.
|
|
38
42
|
*/
|
|
39
43
|
export declare function useLegalDocs(docType: string, options?: UseLegalDocsOptions): UseLegalDocsReturn;
|
|
40
44
|
//# sourceMappingURL=use-legal-docs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-legal-docs.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/use-legal-docs.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;mDAC+C;IAC/C,WAAW,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;
|
|
1
|
+
{"version":3,"file":"use-legal-docs.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/use-legal-docs.ts"],"names":[],"mappings":"AAkBA,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,KAAK,CAAC;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC9D,OAAO,EAAE,MAAM,CAAC;IAChB,oFAAoF;IACpF,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,6FAA6F;IAC7F,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,IAAI,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;QACtB,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED,MAAM,WAAW,kBAAkB;IACjC,IAAI,EAAE,aAAa,GAAG,IAAI,CAAC;IAC3B,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,mBAAmB;IAClC;mDAC+C;IAC/C,WAAW,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;IACnC,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AA6ED;;;;;;GAMG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,mBAAwB,GAAG,kBAAkB,CAiHnG"}
|
|
@@ -42,6 +42,8 @@ function toLegalDocument(payload, docType) {
|
|
|
42
42
|
githubSha: typeof githubSha === "string" ? githubSha : null,
|
|
43
43
|
sections,
|
|
44
44
|
docType: readString(payload, "docType") ?? docType,
|
|
45
|
+
version: readString(payload, "version") ?? null,
|
|
46
|
+
effectiveDate: readString(payload, "effectiveDate") ?? null,
|
|
45
47
|
meta: {
|
|
46
48
|
sectionsCount: typeof sectionsCount === "number" ? sectionsCount : sections.length,
|
|
47
49
|
contentLength: typeof contentLength === "number" ? contentLength : content.length,
|
|
@@ -72,6 +74,11 @@ function useLegalDocs(docType, options = {}) {
|
|
|
72
74
|
const fetchDocument = async () => {
|
|
73
75
|
try {
|
|
74
76
|
const response = await contentFetch(effectiveEndpoint);
|
|
77
|
+
if (response.status === 404) {
|
|
78
|
+
if (!isCurrent()) return;
|
|
79
|
+
setData(null);
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
75
82
|
if (!response.ok) {
|
|
76
83
|
throw new Error(`Failed to fetch ${docType} document: ${response.status} ${response.statusText}`);
|
|
77
84
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export interface LegalDocumentSummary {
|
|
2
|
+
/** The identifier `useLegalDocs` and `<LegalDocumentPage>` take. */
|
|
3
|
+
docType: string;
|
|
4
|
+
title: string;
|
|
5
|
+
/** One line saying what the document is, for a card that lists it. */
|
|
6
|
+
summary: string;
|
|
7
|
+
/** The document's page on the hub's own site (a path). */
|
|
8
|
+
route: string;
|
|
9
|
+
sourceFile: string;
|
|
10
|
+
/** The topic the document's FAQs are written for, when the hub has one. */
|
|
11
|
+
faqTopic: string | null;
|
|
12
|
+
version: string | null;
|
|
13
|
+
effectiveDate: string | null;
|
|
14
|
+
/** False while the hub has no content for it yet. */
|
|
15
|
+
published: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface UseLegalDocumentsOptions {
|
|
18
|
+
/** Full GET endpoint URL. Default `/api/legal`. */
|
|
19
|
+
apiEndpoint?: string;
|
|
20
|
+
/** False: read nothing and answer an empty list. Default true. */
|
|
21
|
+
enabled?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface UseLegalDocumentsReturn {
|
|
24
|
+
documents: LegalDocumentSummary[];
|
|
25
|
+
isLoading: boolean;
|
|
26
|
+
error: string | null;
|
|
27
|
+
}
|
|
28
|
+
/** Decode the endpoint's answer; a row without a type and a title is left out. */
|
|
29
|
+
export declare function toLegalDocumentSummaries(payload: unknown): LegalDocumentSummary[];
|
|
30
|
+
export declare function useLegalDocuments(options?: UseLegalDocumentsOptions): UseLegalDocumentsReturn;
|
|
31
|
+
//# sourceMappingURL=use-legal-documents.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-legal-documents.d.ts","sourceRoot":"","sources":["../../../../src/components/shared/legal-document/use-legal-documents.ts"],"names":[],"mappings":"AAiBA,MAAM,WAAW,oBAAoB;IACnC,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,sEAAsE;IACtE,OAAO,EAAE,MAAM,CAAC;IAChB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,qDAAqD;IACrD,SAAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,wBAAwB;IACvC,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,uBAAuB;IACtC,SAAS,EAAE,oBAAoB,EAAE,CAAC;IAClC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAWD,kFAAkF;AAClF,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,oBAAoB,EAAE,CAsBjF;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,uBAAuB,CA+BjG"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { contentFetch } from "../../../utils/embed-content-fetch.js";
|
|
4
|
+
function isRecord(value) {
|
|
5
|
+
return typeof value === "object" && value !== null;
|
|
6
|
+
}
|
|
7
|
+
function text(source, key) {
|
|
8
|
+
const value = source[key];
|
|
9
|
+
return typeof value === "string" && value ? value : null;
|
|
10
|
+
}
|
|
11
|
+
function toLegalDocumentSummaries(payload) {
|
|
12
|
+
const rows = isRecord(payload) ? payload.documents : null;
|
|
13
|
+
if (!Array.isArray(rows)) return [];
|
|
14
|
+
const documents = [];
|
|
15
|
+
for (const row of rows) {
|
|
16
|
+
if (!isRecord(row)) continue;
|
|
17
|
+
const docType = text(row, "docType");
|
|
18
|
+
const title = text(row, "title");
|
|
19
|
+
if (!docType || !title) continue;
|
|
20
|
+
documents.push({
|
|
21
|
+
docType,
|
|
22
|
+
title,
|
|
23
|
+
summary: text(row, "summary") ?? "",
|
|
24
|
+
route: text(row, "route") ?? "",
|
|
25
|
+
sourceFile: text(row, "sourceFile") ?? "",
|
|
26
|
+
faqTopic: text(row, "faqTopic"),
|
|
27
|
+
version: text(row, "version"),
|
|
28
|
+
effectiveDate: text(row, "effectiveDate"),
|
|
29
|
+
published: row.published === true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
return documents;
|
|
33
|
+
}
|
|
34
|
+
function useLegalDocuments(options = {}) {
|
|
35
|
+
const endpoint = options.apiEndpoint ?? "/api/legal";
|
|
36
|
+
const enabled = options.enabled ?? true;
|
|
37
|
+
const [state, setState] = useState({ documents: [], isLoading: enabled, error: null });
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
let current = enabled;
|
|
40
|
+
const load = async () => {
|
|
41
|
+
try {
|
|
42
|
+
const response = await contentFetch(endpoint);
|
|
43
|
+
if (!response.ok) throw new Error(`Failed to fetch legal documents: ${response.status} ${response.statusText}`);
|
|
44
|
+
const payload = await response.json();
|
|
45
|
+
if (current) setState({ documents: toLegalDocumentSummaries(payload), isLoading: false, error: null });
|
|
46
|
+
} catch (err) {
|
|
47
|
+
console.error("Error fetching legal documents:", err);
|
|
48
|
+
if (current) {
|
|
49
|
+
setState({
|
|
50
|
+
documents: [],
|
|
51
|
+
isLoading: false,
|
|
52
|
+
error: err instanceof Error ? err.message : "Unknown error occurred"
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
if (enabled) void load();
|
|
58
|
+
return () => {
|
|
59
|
+
current = false;
|
|
60
|
+
};
|
|
61
|
+
}, [endpoint, enabled]);
|
|
62
|
+
return state;
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
toLegalDocumentSummaries,
|
|
66
|
+
useLegalDocuments
|
|
67
|
+
};
|