@carlonicora/nextjs-jsonapi 6.32.0 → 6.32.1
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/{BlockNoteEditor-YONN45A3.js → BlockNoteEditor-RD3JNEV5.js} +24 -24
- package/dist/{BlockNoteEditor-YONN45A3.js.map → BlockNoteEditor-RD3JNEV5.js.map} +1 -1
- package/dist/{BlockNoteEditor-HQTBH527.mjs → BlockNoteEditor-XIEMUQCO.mjs} +4 -4
- package/dist/{BlockNoteViewer-BNZEXGVT.mjs → BlockNoteViewer-NVSR67X5.mjs} +2 -2
- package/dist/{BlockNoteViewer-YONLBNXW.js → BlockNoteViewer-RQBYHBQL.js} +3 -3
- package/dist/{BlockNoteViewer-YONLBNXW.js.map → BlockNoteViewer-RQBYHBQL.js.map} +1 -1
- package/dist/billing/index.js +465 -465
- package/dist/billing/index.mjs +3 -3
- package/dist/{chunk-HNK2O6YE.mjs → chunk-4JVLLBRS.mjs} +4 -16
- package/dist/chunk-4JVLLBRS.mjs.map +1 -0
- package/dist/{chunk-NQL2NDKH.js → chunk-5H25LM2Z.js} +10 -10
- package/dist/chunk-5H25LM2Z.js.map +1 -0
- package/dist/{chunk-FDKAVSZ6.mjs → chunk-AEBZ67JJ.mjs} +8 -8
- package/dist/chunk-AEBZ67JJ.mjs.map +1 -0
- package/dist/{chunk-JL6XL5NK.mjs → chunk-AMQFKCAX.mjs} +2 -2
- package/dist/{chunk-6DNGLY5Y.mjs → chunk-F25BVBEH.mjs} +7 -14
- package/dist/chunk-F25BVBEH.mjs.map +1 -0
- package/dist/{chunk-5XP5G45B.js → chunk-NPGX2GJD.js} +4 -16
- package/dist/chunk-NPGX2GJD.js.map +1 -0
- package/dist/{chunk-Q5SMFSE4.js → chunk-PNCO3HMJ.js} +3 -3
- package/dist/{chunk-Q5SMFSE4.js.map → chunk-PNCO3HMJ.js.map} +1 -1
- package/dist/{chunk-J37GJKCB.js → chunk-SQNFYMYE.js} +730 -737
- package/dist/chunk-SQNFYMYE.js.map +1 -0
- package/dist/client/index.js +4 -4
- package/dist/client/index.mjs +3 -3
- package/dist/components/index.js +4 -4
- package/dist/components/index.mjs +3 -3
- package/dist/contexts/index.js +4 -4
- package/dist/contexts/index.mjs +3 -3
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/email-automations/index.js +105 -105
- package/dist/email-automations/index.mjs +3 -3
- package/dist/features/analytics/index.js +114 -114
- package/dist/features/analytics/index.mjs +3 -3
- package/dist/features/analytics/server.js +4 -4
- package/dist/features/analytics/server.mjs +2 -2
- package/dist/features/auth/components/forms/RefreshUser.d.ts.map +1 -1
- package/dist/features/auth/config.d.ts +0 -9
- package/dist/features/auth/config.d.ts.map +1 -1
- package/dist/features/auth/data/auth.service.d.ts.map +1 -1
- package/dist/features/auth/data/two-factor.service.d.ts.map +1 -1
- package/dist/features/auth/utils/AuthCookies.d.ts +0 -9
- package/dist/features/auth/utils/AuthCookies.d.ts.map +1 -1
- package/dist/features/blog/index.js +129 -129
- package/dist/features/blog/index.mjs +3 -3
- package/dist/features/blog/server.js +7 -7
- package/dist/features/blog/server.mjs +1 -1
- package/dist/features/help/index.js +37 -37
- package/dist/features/help/index.mjs +3 -3
- package/dist/features/tokenusage/index.js +114 -114
- package/dist/features/tokenusage/index.mjs +3 -3
- package/dist/features/user/contexts/CurrentUserContext.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +2 -2
- package/dist/server/ServerSession.d.ts.map +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +2 -2
- package/package.json +1 -1
- package/src/features/auth/components/forms/RefreshUser.tsx +0 -3
- package/src/features/auth/config.ts +0 -9
- package/src/features/auth/data/auth.service.ts +0 -8
- package/src/features/auth/data/two-factor.service.ts +0 -4
- package/src/features/auth/utils/AuthCookies.ts +1 -23
- package/src/features/user/contexts/CurrentUserContext.tsx +0 -4
- package/src/features/user/contexts/__tests__/CurrentUserContext.spec.tsx +2 -0
- package/src/server/ServerSession.ts +10 -26
- package/src/server/__tests__/ServerSession.hasPermissionToModule.spec.ts +78 -0
- package/dist/chunk-5XP5G45B.js.map +0 -1
- package/dist/chunk-6DNGLY5Y.mjs.map +0 -1
- package/dist/chunk-FDKAVSZ6.mjs.map +0 -1
- package/dist/chunk-HNK2O6YE.mjs.map +0 -1
- package/dist/chunk-J37GJKCB.js.map +0 -1
- package/dist/chunk-NQL2NDKH.js.map +0 -1
- /package/dist/{BlockNoteEditor-HQTBH527.mjs.map → BlockNoteEditor-XIEMUQCO.mjs.map} +0 -0
- /package/dist/{BlockNoteViewer-BNZEXGVT.mjs.map → BlockNoteViewer-NVSR67X5.mjs.map} +0 -0
- /package/dist/{chunk-JL6XL5NK.mjs.map → chunk-AMQFKCAX.mjs.map} +0 -0
|
@@ -37,12 +37,12 @@ import {
|
|
|
37
37
|
registerTableGenerator,
|
|
38
38
|
useDataListRetriever,
|
|
39
39
|
usePageUrlGenerator
|
|
40
|
-
} from "../../chunk-
|
|
40
|
+
} from "../../chunk-F25BVBEH.mjs";
|
|
41
41
|
import {
|
|
42
42
|
useDateFormatter
|
|
43
43
|
} from "../../chunk-5T2AQMQ2.mjs";
|
|
44
44
|
import "../../chunk-VOXD3ZLY.mjs";
|
|
45
|
-
import "../../chunk-
|
|
45
|
+
import "../../chunk-AMQFKCAX.mjs";
|
|
46
46
|
import "../../chunk-PW42LRSL.mjs";
|
|
47
47
|
import {
|
|
48
48
|
BLOG_ACTION,
|
|
@@ -64,7 +64,7 @@ import {
|
|
|
64
64
|
cn,
|
|
65
65
|
isRemoteImageSrc,
|
|
66
66
|
showToast
|
|
67
|
-
} from "../../chunk-
|
|
67
|
+
} from "../../chunk-4JVLLBRS.mjs";
|
|
68
68
|
import "../../chunk-RW6XZGZG.mjs";
|
|
69
69
|
import "../../chunk-OY65RYD3.mjs";
|
|
70
70
|
import {
|
|
@@ -7,7 +7,7 @@ require('../../chunk-YUO55Q5A.js');
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _chunkNPGX2GJDjs = require('../../chunk-NPGX2GJD.js');
|
|
11
11
|
require('../../chunk-HROKKUBQ.js');
|
|
12
12
|
|
|
13
13
|
|
|
@@ -56,7 +56,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, toPublicBlogCategory, "toPublicBlogCategory
|
|
|
56
56
|
|
|
57
57
|
// src/features/blog/server/fetchers.ts
|
|
58
58
|
var BLOG_PAGE_SIZE = 12;
|
|
59
|
-
var publicPostsEndpoint = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => `${
|
|
59
|
+
var publicPostsEndpoint = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, () => `${_chunkNPGX2GJDjs.BLOG_PUBLIC_PREFIX}/${_chunkZ6T2575Ajs.Modules.BlogPost.name}`, "publicPostsEndpoint");
|
|
60
60
|
var asArray = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (data) => Array.isArray(data) ? data : data ? [data] : [], "asArray");
|
|
61
61
|
async function fetchPublicBlogPosts(params) {
|
|
62
62
|
if (params.all) return { posts: await fetchEveryPublicBlogPost(params), hasMore: false };
|
|
@@ -123,7 +123,7 @@ async function fetchRelatedBlogPosts(params) {
|
|
|
123
123
|
const endpoint = new (0, _chunkZ6T2575Ajs.EndpointCreator)({
|
|
124
124
|
endpoint: publicPostsEndpoint(),
|
|
125
125
|
id: encodeURIComponent(params.slug),
|
|
126
|
-
childEndpoint:
|
|
126
|
+
childEndpoint: _chunkNPGX2GJDjs.BLOG_ACTION.related
|
|
127
127
|
});
|
|
128
128
|
endpoint.addAdditionalParam("language", params.language);
|
|
129
129
|
const res = await _chunkN3NQS7X6js.ServerJsonApiGet.call(void 0, {
|
|
@@ -136,7 +136,7 @@ async function fetchRelatedBlogPosts(params) {
|
|
|
136
136
|
}
|
|
137
137
|
_chunk7QVYU63Ejs.__name.call(void 0, fetchRelatedBlogPosts, "fetchRelatedBlogPosts");
|
|
138
138
|
async function fetchPublicBlogCategories(params) {
|
|
139
|
-
const endpoint = new (0, _chunkZ6T2575Ajs.EndpointCreator)({ endpoint: `${
|
|
139
|
+
const endpoint = new (0, _chunkZ6T2575Ajs.EndpointCreator)({ endpoint: `${_chunkNPGX2GJDjs.BLOG_PUBLIC_PREFIX}/${_chunkZ6T2575Ajs.Modules.BlogCategory.name}` });
|
|
140
140
|
endpoint.addAdditionalParam("language", params.language);
|
|
141
141
|
const res = await _chunkN3NQS7X6js.ServerJsonApiGet.call(void 0, {
|
|
142
142
|
classKey: { ..._chunkZ6T2575Ajs.Modules.BlogCategory, cache: "minutes" },
|
|
@@ -151,12 +151,12 @@ async function fetchBlogSettings() {
|
|
|
151
151
|
const fallback = { listLayout: "featured" };
|
|
152
152
|
const res = await _chunkN3NQS7X6js.ServerJsonApiGet.call(void 0, {
|
|
153
153
|
classKey: { ..._chunkZ6T2575Ajs.Modules.BlogSettings, cache: "minutes" },
|
|
154
|
-
endpoint: new (0, _chunkZ6T2575Ajs.EndpointCreator)({ endpoint: `${
|
|
154
|
+
endpoint: new (0, _chunkZ6T2575Ajs.EndpointCreator)({ endpoint: `${_chunkNPGX2GJDjs.BLOG_PUBLIC_PREFIX}/${_chunkZ6T2575Ajs.Modules.BlogSettings.name}` }).generate(),
|
|
155
155
|
language: "en"
|
|
156
156
|
});
|
|
157
157
|
if (!res.ok) return fallback;
|
|
158
158
|
const settings = asArray(res.data)[0];
|
|
159
|
-
if (!settings || !
|
|
159
|
+
if (!settings || !_chunkNPGX2GJDjs.BLOG_LIST_LAYOUTS.includes(settings.listLayout)) return fallback;
|
|
160
160
|
return { listLayout: settings.listLayout };
|
|
161
161
|
}
|
|
162
162
|
_chunk7QVYU63Ejs.__name.call(void 0, fetchBlogSettings, "fetchBlogSettings");
|
|
@@ -169,5 +169,5 @@ _chunk7QVYU63Ejs.__name.call(void 0, fetchBlogSettings, "fetchBlogSettings");
|
|
|
169
169
|
|
|
170
170
|
|
|
171
171
|
|
|
172
|
-
exports.BLOG_LIST_LAYOUTS =
|
|
172
|
+
exports.BLOG_LIST_LAYOUTS = _chunkNPGX2GJDjs.BLOG_LIST_LAYOUTS; exports.fetchBlogSettings = fetchBlogSettings; exports.fetchPublicBlogCategories = fetchPublicBlogCategories; exports.fetchPublicBlogPost = fetchPublicBlogPost; exports.fetchPublicBlogPosts = fetchPublicBlogPosts; exports.fetchRelatedBlogPosts = fetchRelatedBlogPosts; exports.toPublicBlogCategory = toPublicBlogCategory; exports.toPublicBlogPost = toPublicBlogPost;
|
|
173
173
|
//# sourceMappingURL=server.js.map
|
|
@@ -23,18 +23,18 @@ var _chunkYBZVWLPHjs = require('../../chunk-YBZVWLPH.js');
|
|
|
23
23
|
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
var
|
|
26
|
+
var _chunkSQNFYMYEjs = require('../../chunk-SQNFYMYE.js');
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
var _chunkSYMI4IDWjs = require('../../chunk-SYMI4IDW.js');
|
|
30
30
|
require('../../chunk-3EPNHTMH.js');
|
|
31
31
|
|
|
32
32
|
|
|
33
|
-
var
|
|
33
|
+
var _chunkPNCO3HMJjs = require('../../chunk-PNCO3HMJ.js');
|
|
34
34
|
require('../../chunk-G4JR3SFV.js');
|
|
35
35
|
|
|
36
36
|
|
|
37
|
-
var
|
|
37
|
+
var _chunkNPGX2GJDjs = require('../../chunk-NPGX2GJD.js');
|
|
38
38
|
require('../../chunk-HROKKUBQ.js');
|
|
39
39
|
require('../../chunk-DGN3PR2F.js');
|
|
40
40
|
require('../../chunk-Z6T2575A.js');
|
|
@@ -53,7 +53,7 @@ var _react = require('react');
|
|
|
53
53
|
var _jsxruntime = require('react/jsx-runtime');
|
|
54
54
|
var HelpContext = _react.createContext.call(void 0, null);
|
|
55
55
|
function HelpProvider({ children }) {
|
|
56
|
-
const cfg =
|
|
56
|
+
const cfg = _chunkPNCO3HMJjs._getStaticHelpContent.call(void 0, );
|
|
57
57
|
if (!cfg) {
|
|
58
58
|
throw new Error(
|
|
59
59
|
"Help content not configured \u2014 call configureJsonApi({ helpContent: {...} }) before importing help components."
|
|
@@ -85,29 +85,29 @@ var _lucidereact = require('lucide-react');
|
|
|
85
85
|
|
|
86
86
|
|
|
87
87
|
function HelpAssistantSheet({ open, onOpenChange }) {
|
|
88
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
89
|
-
|
|
88
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.Sheet, { open, onOpenChange, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
89
|
+
_chunkSQNFYMYEjs.SheetContent,
|
|
90
90
|
{
|
|
91
91
|
side: "end",
|
|
92
92
|
className: "flex w-full flex-col data-[side=right]:sm:max-w-2xl data-[side=right]:lg:max-w-3xl data-[side=left]:sm:max-w-2xl data-[side=left]:lg:max-w-3xl",
|
|
93
|
-
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
93
|
+
children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.AssistantProvider, { manageUrl: false, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAssistantSheetBody, {}) })
|
|
94
94
|
}
|
|
95
95
|
) });
|
|
96
96
|
}
|
|
97
97
|
_chunk7QVYU63Ejs.__name.call(void 0, HelpAssistantSheet, "HelpAssistantSheet");
|
|
98
98
|
function HelpAssistantSheetBody() {
|
|
99
99
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
100
|
-
const ctx =
|
|
100
|
+
const ctx = _chunkSQNFYMYEjs.useAssistantContext.call(void 0, );
|
|
101
101
|
const showThread = !!ctx.assistant || ctx.sending || ctx.messages.length > 0;
|
|
102
102
|
const send = /* @__PURE__ */ _chunk7QVYU63Ejs.__name.call(void 0, (content) => ctx.sendMessage(content, { howToMode: true }), "send");
|
|
103
103
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
104
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
105
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
106
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
104
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkSQNFYMYEjs.SheetHeader, { children: [
|
|
105
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.SheetTitle, { children: t("help.askAi.sheet.title") }),
|
|
106
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.SheetDescription, { children: t("help.askAi.sheet.subtitle") })
|
|
107
107
|
] }),
|
|
108
|
-
!showThread ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
108
|
+
!showThread ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.AssistantEmptyState, { onSend: send }) : /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
109
109
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
110
|
-
|
|
110
|
+
_chunkSQNFYMYEjs.AssistantThread,
|
|
111
111
|
{
|
|
112
112
|
messages: ctx.messages,
|
|
113
113
|
sending: ctx.sending,
|
|
@@ -117,7 +117,7 @@ function HelpAssistantSheetBody() {
|
|
|
117
117
|
onRetry: ctx.retrySend
|
|
118
118
|
}
|
|
119
119
|
),
|
|
120
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
120
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.AssistantComposer, { onSend: send, disabled: ctx.sending })
|
|
121
121
|
] })
|
|
122
122
|
] });
|
|
123
123
|
}
|
|
@@ -127,20 +127,20 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpAssistantSheetBody, "HelpAssistantSheet
|
|
|
127
127
|
|
|
128
128
|
function HelpAskAi() {
|
|
129
129
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
130
|
-
const { currentUser } =
|
|
130
|
+
const { currentUser } = _chunkSQNFYMYEjs.useCurrentUserContext.call(void 0, );
|
|
131
131
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
132
132
|
const disabled = !currentUser;
|
|
133
133
|
if (disabled) {
|
|
134
|
-
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
135
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
134
|
+
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkSQNFYMYEjs.Tooltip, { children: [
|
|
135
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkSQNFYMYEjs.TooltipTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.Button, { variant: "outline", size: "sm", disabled: true }), children: [
|
|
136
136
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SparklesIcon, { className: "h-4 w-4" }),
|
|
137
137
|
t("help.askAi.button")
|
|
138
138
|
] }),
|
|
139
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
139
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.TooltipContent, { children: t("help.askAi.loginTooltip") })
|
|
140
140
|
] });
|
|
141
141
|
}
|
|
142
142
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
|
|
143
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
143
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkSQNFYMYEjs.Button, { variant: "outline", size: "sm", onClick: () => setOpen(true), children: [
|
|
144
144
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.SparklesIcon, { className: "h-4 w-4" }),
|
|
145
145
|
t("help.askAi.button")
|
|
146
146
|
] }),
|
|
@@ -153,7 +153,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpAskAi, "HelpAskAi");
|
|
|
153
153
|
|
|
154
154
|
function HelpHeader() {
|
|
155
155
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
156
|
-
const { currentUser } =
|
|
156
|
+
const { currentUser } = _chunkSQNFYMYEjs.useCurrentUserContext.call(void 0, );
|
|
157
157
|
const { brand } = useHelp();
|
|
158
158
|
const logo = _optionalChain([brand, 'optionalAccess', _ => _.logo]);
|
|
159
159
|
const label = _nullishCoalesce(_optionalChain([brand, 'optionalAccess', _2 => _2.label]), () => ( t("help.title")));
|
|
@@ -169,7 +169,7 @@ function HelpHeader() {
|
|
|
169
169
|
] }),
|
|
170
170
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex items-center gap-2 max-md:shrink-0", children: [
|
|
171
171
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, HelpAskAi, {}),
|
|
172
|
-
currentUser ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: appHref, className:
|
|
172
|
+
currentUser ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: appHref, className: _chunkSQNFYMYEjs.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.openApp") }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _link2.default, { href: "/login", className: _chunkSQNFYMYEjs.buttonVariants.call(void 0, { variant: "outline", size: "sm" }), children: t("help.header.login") })
|
|
173
173
|
] })
|
|
174
174
|
] });
|
|
175
175
|
}
|
|
@@ -211,12 +211,12 @@ _chunk7QVYU63Ejs.__name.call(void 0, useHelpFilter, "useHelpFilter");
|
|
|
211
211
|
|
|
212
212
|
function HelpSideNav() {
|
|
213
213
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
214
|
-
const generateUrl =
|
|
214
|
+
const generateUrl = _chunkSQNFYMYEjs.usePageUrlGenerator.call(void 0, );
|
|
215
215
|
const pathname = _navigation.usePathname.call(void 0, );
|
|
216
216
|
const [articles, setArticles] = _react.useState.call(void 0, []);
|
|
217
217
|
_react.useEffect.call(void 0, () => {
|
|
218
218
|
let active = true;
|
|
219
|
-
|
|
219
|
+
_chunkNPGX2GJDjs.HowToService.findPublished().then((list) => active && setArticles(list)).catch(() => active && setArticles([]));
|
|
220
220
|
return () => {
|
|
221
221
|
active = false;
|
|
222
222
|
};
|
|
@@ -292,7 +292,7 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpSideNav, "HelpSideNav");
|
|
|
292
292
|
function HelpArticleBody(props) {
|
|
293
293
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
294
294
|
const dates = _chunkSYMI4IDWjs.useDateFormatter.call(void 0, );
|
|
295
|
-
const generateUrl =
|
|
295
|
+
const generateUrl = _chunkSQNFYMYEjs.usePageUrlGenerator.call(void 0, );
|
|
296
296
|
const { howToType, title, summary, updatedAt, prev, next, children } = props;
|
|
297
297
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "article", { className: "prose dark:prose-invert max-w-none", children: [
|
|
298
298
|
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { className: "text-muted-foreground mb-2 text-xs", children: [
|
|
@@ -349,7 +349,7 @@ function HelpTOC({ headings }) {
|
|
|
349
349
|
}, [headings]);
|
|
350
350
|
if (headings.length === 0) return null;
|
|
351
351
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "nav", { "aria-label": t("help.toc.title"), className: "hidden lg:block", children: [
|
|
352
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
352
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.MicroLabel, { className: "mb-2", children: t("help.toc.title") }),
|
|
353
353
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "ul", { className: "space-y-1 text-sm", children: headings.map((h) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "li", { style: { paddingInlineStart: `${(h.depth - 2) * 0.75}rem` }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
354
354
|
"a",
|
|
355
355
|
{
|
|
@@ -370,13 +370,13 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpTOC, "HelpTOC");
|
|
|
370
370
|
|
|
371
371
|
function HelpHint({ contextKey }) {
|
|
372
372
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
373
|
-
const generateUrl =
|
|
373
|
+
const generateUrl = _chunkSQNFYMYEjs.usePageUrlGenerator.call(void 0, );
|
|
374
374
|
const [open, setOpen] = _react.useState.call(void 0, false);
|
|
375
375
|
const [picked, setPicked] = _react.useState.call(void 0, null);
|
|
376
376
|
const [articles, setArticles] = _react.useState.call(void 0, []);
|
|
377
377
|
_react.useEffect.call(void 0, () => {
|
|
378
378
|
let active2 = true;
|
|
379
|
-
|
|
379
|
+
_chunkNPGX2GJDjs.HowToService.findPublished().then((list) => active2 && setArticles(list)).catch(() => active2 && setArticles([]));
|
|
380
380
|
return () => {
|
|
381
381
|
active2 = false;
|
|
382
382
|
};
|
|
@@ -388,7 +388,7 @@ function HelpHint({ contextKey }) {
|
|
|
388
388
|
if (matches.length === 0) return null;
|
|
389
389
|
const active = _nullishCoalesce(picked, () => ( (matches.length === 1 ? matches[0] : null)));
|
|
390
390
|
return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
391
|
-
|
|
391
|
+
_chunkSQNFYMYEjs.Sheet,
|
|
392
392
|
{
|
|
393
393
|
open,
|
|
394
394
|
onOpenChange: (o) => {
|
|
@@ -396,11 +396,11 @@ function HelpHint({ contextKey }) {
|
|
|
396
396
|
if (!o) setPicked(null);
|
|
397
397
|
},
|
|
398
398
|
children: [
|
|
399
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
400
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
401
|
-
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
402
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
403
|
-
/* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
399
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.SheetTrigger, { render: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.Button, { variant: "ghost", size: "icon-sm", "aria-label": t("help.hint.trigger") }), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.HelpCircleIcon, { className: "h-4 w-4" }) }),
|
|
400
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkSQNFYMYEjs.SheetContent, { side: "end", className: "w-full max-w-md sm:max-w-lg", children: [
|
|
401
|
+
/* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _chunkSQNFYMYEjs.SheetHeader, { children: [
|
|
402
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.SheetTitle, { children: active ? active.name : t("help.hint.pickArticle") }),
|
|
403
|
+
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.SheetDescription, { children: _nullishCoalesce(_optionalChain([active, 'optionalAccess', _4 => _4.summary]), () => ( "")) })
|
|
404
404
|
] }),
|
|
405
405
|
active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "mt-4 space-y-3", children: [
|
|
406
406
|
/* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { className: "text-muted-foreground text-sm", children: active.summary }),
|
|
@@ -432,18 +432,18 @@ _chunk7QVYU63Ejs.__name.call(void 0, HelpHint, "HelpHint");
|
|
|
432
432
|
|
|
433
433
|
function HelpSearchResultRow({ result, onSelect }) {
|
|
434
434
|
const t = _nextintl.useTranslations.call(void 0, );
|
|
435
|
-
const generateUrl =
|
|
435
|
+
const generateUrl = _chunkSQNFYMYEjs.usePageUrlGenerator.call(void 0, );
|
|
436
436
|
const [article, setArticle] = _react.useState.call(void 0, null);
|
|
437
437
|
_react.useEffect.call(void 0, () => {
|
|
438
438
|
let active = true;
|
|
439
|
-
|
|
439
|
+
_chunkNPGX2GJDjs.HowToService.findOne({ id: result.id }).then((a) => active && setArticle(a)).catch(() => active && setArticle(null));
|
|
440
440
|
return () => {
|
|
441
441
|
active = false;
|
|
442
442
|
};
|
|
443
443
|
}, [result.id]);
|
|
444
444
|
if (!article) {
|
|
445
445
|
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
446
|
-
|
|
446
|
+
_chunkSQNFYMYEjs.CommandItem,
|
|
447
447
|
{
|
|
448
448
|
value: result.id,
|
|
449
449
|
disabled: true,
|
|
@@ -452,7 +452,7 @@ function HelpSearchResultRow({ result, onSelect }) {
|
|
|
452
452
|
}
|
|
453
453
|
);
|
|
454
454
|
}
|
|
455
|
-
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
|
|
455
|
+
return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkSQNFYMYEjs.CommandItem, { value: result.id, onSelect, className: "cursor-pointer p-0", children: /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
|
|
456
456
|
_link2.default,
|
|
457
457
|
{
|
|
458
458
|
href: generateUrl({ page: `/help/${article.howToType}/${article.slug}` }),
|
|
@@ -23,18 +23,18 @@ import {
|
|
|
23
23
|
useAssistantContext,
|
|
24
24
|
useCurrentUserContext,
|
|
25
25
|
usePageUrlGenerator
|
|
26
|
-
} from "../../chunk-
|
|
26
|
+
} from "../../chunk-F25BVBEH.mjs";
|
|
27
27
|
import {
|
|
28
28
|
useDateFormatter
|
|
29
29
|
} from "../../chunk-5T2AQMQ2.mjs";
|
|
30
30
|
import "../../chunk-VOXD3ZLY.mjs";
|
|
31
31
|
import {
|
|
32
32
|
_getStaticHelpContent
|
|
33
|
-
} from "../../chunk-
|
|
33
|
+
} from "../../chunk-AMQFKCAX.mjs";
|
|
34
34
|
import "../../chunk-PW42LRSL.mjs";
|
|
35
35
|
import {
|
|
36
36
|
HowToService
|
|
37
|
-
} from "../../chunk-
|
|
37
|
+
} from "../../chunk-4JVLLBRS.mjs";
|
|
38
38
|
import "../../chunk-RW6XZGZG.mjs";
|
|
39
39
|
import "../../chunk-OY65RYD3.mjs";
|
|
40
40
|
import "../../chunk-W7U6O3OE.mjs";
|