@carlonicora/nextjs-jsonapi 1.97.0 → 1.97.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-AZLHXACL.mjs → BlockNoteEditor-74GNMOST.mjs} +2 -2
- package/dist/{BlockNoteEditor-MTFUVZ2D.js → BlockNoteEditor-7SXXGSJH.js} +9 -9
- package/dist/{BlockNoteEditor-MTFUVZ2D.js.map → BlockNoteEditor-7SXXGSJH.js.map} +1 -1
- package/dist/billing/index.js +299 -299
- package/dist/billing/index.mjs +1 -1
- package/dist/{chunk-247QIVUN.mjs → chunk-A4EZFGFA.mjs} +84 -58
- package/dist/chunk-A4EZFGFA.mjs.map +1 -0
- package/dist/{chunk-6EJDIVHH.js → chunk-XHCHSTAX.js} +120 -94
- package/dist/chunk-XHCHSTAX.js.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.js +2 -2
- package/dist/components/index.mjs +1 -1
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/package.json +1 -1
- package/src/components/editors/BlockNoteEditorSuggestionMenuController.tsx +39 -3
- package/dist/chunk-247QIVUN.mjs.map +0 -1
- package/dist/chunk-6EJDIVHH.js.map +0 -1
- /package/dist/{BlockNoteEditor-AZLHXACL.mjs.map → BlockNoteEditor-74GNMOST.mjs.map} +0 -0
package/dist/billing/index.mjs
CHANGED
|
@@ -9226,7 +9226,7 @@ import { useRef as useRef15 } from "react";
|
|
|
9226
9226
|
import dynamic from "next/dynamic";
|
|
9227
9227
|
import React14 from "react";
|
|
9228
9228
|
import { jsx as jsx73 } from "react/jsx-runtime";
|
|
9229
|
-
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-
|
|
9229
|
+
var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-74GNMOST.mjs"), {
|
|
9230
9230
|
ssr: false
|
|
9231
9231
|
});
|
|
9232
9232
|
var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
|
|
@@ -13787,10 +13787,11 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
|
|
|
13787
13787
|
// src/components/editors/BlockNoteEditorSuggestionMenuController.tsx
|
|
13788
13788
|
import { SuggestionMenuController } from "@blocknote/react";
|
|
13789
13789
|
import { autoUpdate, flip, shift } from "@floating-ui/react";
|
|
13790
|
-
import React22, { useCallback as useCallback28 } from "react";
|
|
13790
|
+
import React22, { useCallback as useCallback28, useMemo as useMemo19 } from "react";
|
|
13791
13791
|
import { jsx as jsx152 } from "react/jsx-runtime";
|
|
13792
13792
|
var MentionInsertContext = React22.createContext(null);
|
|
13793
13793
|
var useMentionInsert = /* @__PURE__ */ __name(() => React22.useContext(MentionInsertContext), "useMentionInsert");
|
|
13794
|
+
var KEEP_OPEN_SENTINEL_TITLE = "__blocknote_mention_keep_open__";
|
|
13794
13795
|
function BlockNoteEditorMentionSuggestionMenu({
|
|
13795
13796
|
editor,
|
|
13796
13797
|
mentionSearchFn,
|
|
@@ -13812,7 +13813,7 @@ function BlockNoteEditorMentionSuggestionMenu({
|
|
|
13812
13813
|
const getItems = useCallback28(
|
|
13813
13814
|
async (query) => {
|
|
13814
13815
|
const results = await mentionSearchFn(query, mentionSearchParams);
|
|
13815
|
-
|
|
13816
|
+
const items = results.map((item) => ({
|
|
13816
13817
|
title: item.name,
|
|
13817
13818
|
subtext: item.entityType,
|
|
13818
13819
|
icon: item.icon,
|
|
@@ -13830,15 +13831,40 @@ function BlockNoteEditorMentionSuggestionMenu({
|
|
|
13830
13831
|
]);
|
|
13831
13832
|
}, "onItemClick")
|
|
13832
13833
|
}));
|
|
13834
|
+
if (items.length === 0) {
|
|
13835
|
+
items.push({ title: KEEP_OPEN_SENTINEL_TITLE, onItemClick: /* @__PURE__ */ __name(() => {
|
|
13836
|
+
}, "onItemClick") });
|
|
13837
|
+
}
|
|
13838
|
+
return items;
|
|
13833
13839
|
},
|
|
13834
13840
|
[editor, mentionSearchFn, mentionSearchParams]
|
|
13835
13841
|
);
|
|
13842
|
+
const wrappedSuggestionMenuComponent = useMemo19(() => {
|
|
13843
|
+
if (!suggestionMenuComponent) return void 0;
|
|
13844
|
+
const Component2 = suggestionMenuComponent;
|
|
13845
|
+
const Wrapped = /* @__PURE__ */ __name((props) => {
|
|
13846
|
+
const isSentinelOnly = props.items.length === 1 && props.items[0]?.title === KEEP_OPEN_SENTINEL_TITLE;
|
|
13847
|
+
return /* @__PURE__ */ jsx152(
|
|
13848
|
+
Component2,
|
|
13849
|
+
{
|
|
13850
|
+
...props,
|
|
13851
|
+
items: isSentinelOnly ? [] : props.items,
|
|
13852
|
+
selectedIndex: isSentinelOnly ? void 0 : props.selectedIndex,
|
|
13853
|
+
onItemClick: (item) => {
|
|
13854
|
+
if (item.title === KEEP_OPEN_SENTINEL_TITLE) return;
|
|
13855
|
+
props.onItemClick?.(item);
|
|
13856
|
+
}
|
|
13857
|
+
}
|
|
13858
|
+
);
|
|
13859
|
+
}, "Wrapped");
|
|
13860
|
+
return Wrapped;
|
|
13861
|
+
}, [suggestionMenuComponent]);
|
|
13836
13862
|
return /* @__PURE__ */ jsx152(MentionInsertContext.Provider, { value: onMentionInsert, children: /* @__PURE__ */ jsx152("div", { className: "blocknote-suggestion-container", style: { position: "static" }, children: /* @__PURE__ */ jsx152(
|
|
13837
13863
|
SuggestionMenuController,
|
|
13838
13864
|
{
|
|
13839
13865
|
triggerCharacter: "@",
|
|
13840
13866
|
getItems,
|
|
13841
|
-
suggestionMenuComponent,
|
|
13867
|
+
suggestionMenuComponent: wrappedSuggestionMenuComponent,
|
|
13842
13868
|
floatingUIOptions: {
|
|
13843
13869
|
useFloatingOptions: {
|
|
13844
13870
|
strategy: "fixed",
|
|
@@ -14051,7 +14077,7 @@ var cellUrl = /* @__PURE__ */ __name((params) => {
|
|
|
14051
14077
|
}, "cellUrl");
|
|
14052
14078
|
|
|
14053
14079
|
// src/client/context/JsonApiProvider.tsx
|
|
14054
|
-
import { useEffect as useEffect42, useMemo as
|
|
14080
|
+
import { useEffect as useEffect42, useMemo as useMemo20 } from "react";
|
|
14055
14081
|
import { jsx as jsx160 } from "react/jsx-runtime";
|
|
14056
14082
|
function JsonApiProvider({ config, children }) {
|
|
14057
14083
|
useEffect42(() => {
|
|
@@ -14059,7 +14085,7 @@ function JsonApiProvider({ config, children }) {
|
|
|
14059
14085
|
config.bootstrapper();
|
|
14060
14086
|
}
|
|
14061
14087
|
}, [config.bootstrapper]);
|
|
14062
|
-
const memoizedConfig =
|
|
14088
|
+
const memoizedConfig = useMemo20(() => config, [config]);
|
|
14063
14089
|
return /* @__PURE__ */ jsx160(JsonApiContext.Provider, { value: memoizedConfig, children });
|
|
14064
14090
|
}
|
|
14065
14091
|
__name(JsonApiProvider, "JsonApiProvider");
|
|
@@ -14265,16 +14291,16 @@ function useJsonApiMutation(config) {
|
|
|
14265
14291
|
__name(useJsonApiMutation, "useJsonApiMutation");
|
|
14266
14292
|
|
|
14267
14293
|
// src/client/hooks/useRehydration.ts
|
|
14268
|
-
import { useMemo as
|
|
14294
|
+
import { useMemo as useMemo21 } from "react";
|
|
14269
14295
|
function useRehydration(classKey, data) {
|
|
14270
|
-
return
|
|
14296
|
+
return useMemo21(() => {
|
|
14271
14297
|
if (!data) return null;
|
|
14272
14298
|
return RehydrationFactory.rehydrate(classKey, data);
|
|
14273
14299
|
}, [classKey, data]);
|
|
14274
14300
|
}
|
|
14275
14301
|
__name(useRehydration, "useRehydration");
|
|
14276
14302
|
function useRehydrationList(classKey, data) {
|
|
14277
|
-
return
|
|
14303
|
+
return useMemo21(() => {
|
|
14278
14304
|
if (!data || data.length === 0) return [];
|
|
14279
14305
|
return RehydrationFactory.rehydrateList(classKey, data);
|
|
14280
14306
|
}, [classKey, data]);
|
|
@@ -14283,13 +14309,13 @@ __name(useRehydrationList, "useRehydrationList");
|
|
|
14283
14309
|
|
|
14284
14310
|
// src/features/company/hooks/useCompanyTableStructure.tsx
|
|
14285
14311
|
import { useTranslations as useTranslations52 } from "next-intl";
|
|
14286
|
-
import { useMemo as
|
|
14312
|
+
import { useMemo as useMemo22 } from "react";
|
|
14287
14313
|
import { jsx as jsx161 } from "react/jsx-runtime";
|
|
14288
14314
|
var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
|
|
14289
14315
|
const t = useTranslations52();
|
|
14290
14316
|
const generateUrl = usePageUrlGenerator();
|
|
14291
14317
|
const { hasRole } = useCurrentUserContext();
|
|
14292
|
-
const tableData =
|
|
14318
|
+
const tableData = useMemo22(() => {
|
|
14293
14319
|
return params.data.map((company) => {
|
|
14294
14320
|
const entry = {
|
|
14295
14321
|
jsonApiData: company
|
|
@@ -14333,14 +14359,14 @@ var useCompanyTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
14333
14359
|
title: t(`common.date.create`)
|
|
14334
14360
|
})
|
|
14335
14361
|
};
|
|
14336
|
-
const columns =
|
|
14362
|
+
const columns = useMemo22(() => {
|
|
14337
14363
|
return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
|
|
14338
14364
|
}, [params.fields, fieldColumnMap, t, generateUrl, hasRole]);
|
|
14339
|
-
return
|
|
14365
|
+
return useMemo22(() => ({ data: tableData, columns }), [tableData, columns]);
|
|
14340
14366
|
}, "useCompanyTableStructure");
|
|
14341
14367
|
|
|
14342
14368
|
// src/features/company/hooks/useSubscriptionStatus.ts
|
|
14343
|
-
import { useMemo as
|
|
14369
|
+
import { useMemo as useMemo23 } from "react";
|
|
14344
14370
|
var TRIAL_DAYS = 14;
|
|
14345
14371
|
var GRACE_DAYS = 3;
|
|
14346
14372
|
var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
|
|
@@ -14350,7 +14376,7 @@ var isAdministrator = /* @__PURE__ */ __name((currentUser) => {
|
|
|
14350
14376
|
}, "isAdministrator");
|
|
14351
14377
|
function useSubscriptionStatus() {
|
|
14352
14378
|
const { company, currentUser } = useCurrentUserContext();
|
|
14353
|
-
return
|
|
14379
|
+
return useMemo23(() => {
|
|
14354
14380
|
if (currentUser === null) {
|
|
14355
14381
|
return {
|
|
14356
14382
|
status: "loading",
|
|
@@ -14415,12 +14441,12 @@ __name(useSubscriptionStatus, "useSubscriptionStatus");
|
|
|
14415
14441
|
|
|
14416
14442
|
// src/features/role/hooks/useRoleTableStructure.tsx
|
|
14417
14443
|
import { useTranslations as useTranslations53 } from "next-intl";
|
|
14418
|
-
import { useMemo as
|
|
14444
|
+
import { useMemo as useMemo24 } from "react";
|
|
14419
14445
|
import { Fragment as Fragment24, jsx as jsx162 } from "react/jsx-runtime";
|
|
14420
14446
|
var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
|
|
14421
14447
|
const t = useTranslations53();
|
|
14422
14448
|
const generateUrl = usePageUrlGenerator();
|
|
14423
|
-
const tableData =
|
|
14449
|
+
const tableData = useMemo24(() => {
|
|
14424
14450
|
return params.data.map((role) => {
|
|
14425
14451
|
const entry = {
|
|
14426
14452
|
jsonApiData: role
|
|
@@ -14462,20 +14488,20 @@ var useRoleTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
14462
14488
|
title: t(`common.date.create`)
|
|
14463
14489
|
})
|
|
14464
14490
|
};
|
|
14465
|
-
const columns =
|
|
14491
|
+
const columns = useMemo24(() => {
|
|
14466
14492
|
return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
|
|
14467
14493
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
14468
|
-
return
|
|
14494
|
+
return useMemo24(() => ({ data: tableData, columns }), [tableData, columns]);
|
|
14469
14495
|
}, "useRoleTableStructure");
|
|
14470
14496
|
|
|
14471
14497
|
// src/features/content/hooks/useContentTableStructure.tsx
|
|
14472
14498
|
import { useTranslations as useTranslations54 } from "next-intl";
|
|
14473
|
-
import { useMemo as
|
|
14499
|
+
import { useMemo as useMemo25 } from "react";
|
|
14474
14500
|
import { Fragment as Fragment25, jsx as jsx163, jsxs as jsxs93 } from "react/jsx-runtime";
|
|
14475
14501
|
var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
14476
14502
|
const t = useTranslations54();
|
|
14477
14503
|
const generateUrl = usePageUrlGenerator();
|
|
14478
|
-
const tableData =
|
|
14504
|
+
const tableData = useMemo25(() => {
|
|
14479
14505
|
return params.data.map((content) => {
|
|
14480
14506
|
const entry = {
|
|
14481
14507
|
jsonApiData: content
|
|
@@ -14560,7 +14586,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
14560
14586
|
title: t(`common.date.update`)
|
|
14561
14587
|
})
|
|
14562
14588
|
};
|
|
14563
|
-
const columns =
|
|
14589
|
+
const columns = useMemo25(() => {
|
|
14564
14590
|
return params.fields.map((field) => {
|
|
14565
14591
|
const localHandler = fieldColumnMap[field];
|
|
14566
14592
|
if (localHandler) return localHandler();
|
|
@@ -14569,7 +14595,7 @@ var useContentTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
14569
14595
|
return void 0;
|
|
14570
14596
|
}).filter((col) => col !== void 0);
|
|
14571
14597
|
}, [params.fields, fieldColumnMap, t, generateUrl, params.context?.customCells]);
|
|
14572
|
-
return
|
|
14598
|
+
return useMemo25(() => ({ data: tableData, columns }), [tableData, columns]);
|
|
14573
14599
|
}, "useContentTableStructure");
|
|
14574
14600
|
|
|
14575
14601
|
// src/features/oauth/hooks/useOAuthClients.ts
|
|
@@ -14868,7 +14894,7 @@ registerTableGenerator("companies", useCompanyTableStructure);
|
|
|
14868
14894
|
// src/components/tables/ContentListTable.tsx
|
|
14869
14895
|
import { flexRender, getCoreRowModel, getExpandedRowModel, useReactTable } from "@tanstack/react-table";
|
|
14870
14896
|
import { ChevronLeft, ChevronRight } from "lucide-react";
|
|
14871
|
-
import React24, { memo, useMemo as
|
|
14897
|
+
import React24, { memo, useMemo as useMemo26, useState as useState55 } from "react";
|
|
14872
14898
|
|
|
14873
14899
|
// src/components/tables/ContentTableSearch.tsx
|
|
14874
14900
|
import { RefreshCw, Search, X as X3 } from "lucide-react";
|
|
@@ -14987,7 +15013,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
14987
15013
|
dataRetriever: data,
|
|
14988
15014
|
context: props.context
|
|
14989
15015
|
});
|
|
14990
|
-
const columnVisibility =
|
|
15016
|
+
const columnVisibility = useMemo26(
|
|
14991
15017
|
() => fields.reduce(
|
|
14992
15018
|
(acc, columnId) => {
|
|
14993
15019
|
acc[columnId] = true;
|
|
@@ -15012,7 +15038,7 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
|
|
|
15012
15038
|
}
|
|
15013
15039
|
});
|
|
15014
15040
|
const rowModel = tableData ? table.getRowModel() : null;
|
|
15015
|
-
const groupedRows =
|
|
15041
|
+
const groupedRows = useMemo26(() => {
|
|
15016
15042
|
if (!props.groupBy || !rowModel?.rows?.length) return null;
|
|
15017
15043
|
const groupMap = /* @__PURE__ */ new Map();
|
|
15018
15044
|
for (const row of rowModel.rows) {
|
|
@@ -15335,7 +15361,7 @@ var ItalianFiscalData_default = ItalianFiscalData;
|
|
|
15335
15361
|
import Image8 from "next/image";
|
|
15336
15362
|
|
|
15337
15363
|
// src/features/auth/contexts/AuthContext.tsx
|
|
15338
|
-
import { createContext as createContext20, useContext as useContext21, useMemo as
|
|
15364
|
+
import { createContext as createContext20, useContext as useContext21, useMemo as useMemo27, useState as useState58 } from "react";
|
|
15339
15365
|
|
|
15340
15366
|
// src/features/auth/components/forms/Register.tsx
|
|
15341
15367
|
import { zodResolver as zodResolver5 } from "@hookform/resolvers/zod";
|
|
@@ -15694,7 +15720,7 @@ var AuthContextProvider = /* @__PURE__ */ __name(({
|
|
|
15694
15720
|
const [componentType, setComponentType] = useState58(initialComponentType);
|
|
15695
15721
|
const [params, setParams] = useState58(initialParams);
|
|
15696
15722
|
const [pendingTwoFactor, setPendingTwoFactor] = useState58();
|
|
15697
|
-
const activeComponent =
|
|
15723
|
+
const activeComponent = useMemo27(() => {
|
|
15698
15724
|
if (componentType === void 0) return null;
|
|
15699
15725
|
switch (componentType) {
|
|
15700
15726
|
case 0 /* Login */:
|
|
@@ -17359,12 +17385,12 @@ __name(RelevantContentsList, "RelevantContentsList");
|
|
|
17359
17385
|
// src/features/how-to/components/containers/HowToCommand.tsx
|
|
17360
17386
|
import { ArrowRight, LifeBuoyIcon } from "lucide-react";
|
|
17361
17387
|
import { useTranslations as useTranslations78 } from "next-intl";
|
|
17362
|
-
import { useCallback as useCallback37, useEffect as useEffect59, useMemo as
|
|
17388
|
+
import { useCallback as useCallback37, useEffect as useEffect59, useMemo as useMemo29, useRef as useRef30, useState as useState75 } from "react";
|
|
17363
17389
|
|
|
17364
17390
|
// src/features/how-to/components/containers/HowToCommandViewer.tsx
|
|
17365
17391
|
import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
|
|
17366
17392
|
import { useTranslations as useTranslations77 } from "next-intl";
|
|
17367
|
-
import { useMemo as
|
|
17393
|
+
import { useMemo as useMemo28 } from "react";
|
|
17368
17394
|
|
|
17369
17395
|
// src/features/how-to/utils/blocknote.ts
|
|
17370
17396
|
function extractTextFromContent(content) {
|
|
@@ -17436,8 +17462,8 @@ __name(extractHeadings, "extractHeadings");
|
|
|
17436
17462
|
import { jsx as jsx194, jsxs as jsxs117 } from "react/jsx-runtime";
|
|
17437
17463
|
function HowToCommandViewer({ howTo, onBack, onStartChat }) {
|
|
17438
17464
|
const t = useTranslations77();
|
|
17439
|
-
const readingTime =
|
|
17440
|
-
const headings =
|
|
17465
|
+
const readingTime = useMemo28(() => calculateReadingTime(howTo.description), [howTo.description]);
|
|
17466
|
+
const headings = useMemo28(() => extractHeadings(howTo.description), [howTo.description]);
|
|
17441
17467
|
return /* @__PURE__ */ jsxs117("div", { className: "flex h-full flex-col", children: [
|
|
17442
17468
|
/* @__PURE__ */ jsxs117("div", { className: "flex items-center gap-3 border-b px-4 py-3", children: [
|
|
17443
17469
|
/* @__PURE__ */ jsxs117(Button, { variant: "ghost", size: "sm", onClick: onBack, className: "h-8 px-2", children: [
|
|
@@ -17496,7 +17522,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
|
|
|
17496
17522
|
retrieverParams: {},
|
|
17497
17523
|
module: Modules.HowTo
|
|
17498
17524
|
});
|
|
17499
|
-
const { relevantHowTos, otherHowTos } =
|
|
17525
|
+
const { relevantHowTos, otherHowTos } = useMemo29(() => {
|
|
17500
17526
|
if (!data.data) return { relevantHowTos: [], otherHowTos: [] };
|
|
17501
17527
|
const relevant = [];
|
|
17502
17528
|
const other = [];
|
|
@@ -17693,12 +17719,12 @@ import { useTranslations as useTranslations81 } from "next-intl";
|
|
|
17693
17719
|
|
|
17694
17720
|
// src/features/how-to/hooks/useHowToTableStructure.tsx
|
|
17695
17721
|
import { useTranslations as useTranslations80 } from "next-intl";
|
|
17696
|
-
import { useMemo as
|
|
17722
|
+
import { useMemo as useMemo30 } from "react";
|
|
17697
17723
|
import { Fragment as Fragment41, jsx as jsx199 } from "react/jsx-runtime";
|
|
17698
17724
|
var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
17699
17725
|
const t = useTranslations80();
|
|
17700
17726
|
const generateUrl = usePageUrlGenerator();
|
|
17701
|
-
const tableData =
|
|
17727
|
+
const tableData = useMemo30(() => {
|
|
17702
17728
|
return params.data.map((howTo) => {
|
|
17703
17729
|
const entry = {
|
|
17704
17730
|
jsonApiData: howTo
|
|
@@ -17752,10 +17778,10 @@ var useHowToTableStructure = /* @__PURE__ */ __name((params) => {
|
|
|
17752
17778
|
title: t(`common.date.update`)
|
|
17753
17779
|
})
|
|
17754
17780
|
};
|
|
17755
|
-
const columns =
|
|
17781
|
+
const columns = useMemo30(() => {
|
|
17756
17782
|
return params.fields.map((field) => fieldColumnMap[field]?.()).filter((col) => col !== void 0);
|
|
17757
17783
|
}, [params.fields, fieldColumnMap, t, generateUrl]);
|
|
17758
|
-
return
|
|
17784
|
+
return useMemo30(() => ({ data: tableData, columns }), [tableData, columns]);
|
|
17759
17785
|
}, "useHowToTableStructure");
|
|
17760
17786
|
registerTableGenerator("howtos", useHowToTableStructure);
|
|
17761
17787
|
|
|
@@ -18144,10 +18170,10 @@ import ReactMarkdown3 from "react-markdown";
|
|
|
18144
18170
|
import remarkGfm3 from "remark-gfm";
|
|
18145
18171
|
|
|
18146
18172
|
// src/features/assistant-message/components/parts/MessageSourcesContainer.tsx
|
|
18147
|
-
import { useEffect as useEffect61, useMemo as
|
|
18173
|
+
import { useEffect as useEffect61, useMemo as useMemo32, useState as useState82 } from "react";
|
|
18148
18174
|
|
|
18149
18175
|
// src/features/assistant-message/components/parts/MessageSourcesPanel.tsx
|
|
18150
|
-
import { useMemo as
|
|
18176
|
+
import { useMemo as useMemo31, useState as useState81 } from "react";
|
|
18151
18177
|
import { useTranslations as useTranslations92 } from "next-intl";
|
|
18152
18178
|
import { ChevronDown as ChevronDown4, ChevronRight as ChevronRight2 } from "lucide-react";
|
|
18153
18179
|
|
|
@@ -18436,7 +18462,7 @@ __name(SuggestedQuestionsTab, "SuggestedQuestionsTab");
|
|
|
18436
18462
|
import { jsx as jsx214, jsxs as jsxs130 } from "react/jsx-runtime";
|
|
18437
18463
|
function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sources, users }) {
|
|
18438
18464
|
const t = useTranslations92();
|
|
18439
|
-
const visibleReferences =
|
|
18465
|
+
const visibleReferences = useMemo31(
|
|
18440
18466
|
() => message.references.filter((ref) => {
|
|
18441
18467
|
try {
|
|
18442
18468
|
return !!ModuleRegistry.findByName(ref.type).pageUrl;
|
|
@@ -18449,7 +18475,7 @@ function MessageSourcesPanel({ message, isLatestAssistant, onSelectFollowUp, sou
|
|
|
18449
18475
|
const refsCount = visibleReferences.length;
|
|
18450
18476
|
const citationsCount = message.citations.length;
|
|
18451
18477
|
const suggestionsCount = isLatestAssistant ? message.suggestedQuestions.length : 0;
|
|
18452
|
-
const contentsCount =
|
|
18478
|
+
const contentsCount = useMemo31(() => {
|
|
18453
18479
|
if (sources) return sources.size;
|
|
18454
18480
|
const ids = /* @__PURE__ */ new Set();
|
|
18455
18481
|
for (const c of message.citations) {
|
|
@@ -18526,7 +18552,7 @@ var SourcesFetcher = class extends ClientAbstractService {
|
|
|
18526
18552
|
}
|
|
18527
18553
|
};
|
|
18528
18554
|
function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp }) {
|
|
18529
|
-
const groups =
|
|
18555
|
+
const groups = useMemo32(() => {
|
|
18530
18556
|
const map = /* @__PURE__ */ new Map();
|
|
18531
18557
|
for (const chunk of message.citations) {
|
|
18532
18558
|
if (!chunk.nodeType || !chunk.nodeId) continue;
|
|
@@ -18539,7 +18565,7 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
18539
18565
|
}
|
|
18540
18566
|
return map;
|
|
18541
18567
|
}, [message.citations]);
|
|
18542
|
-
const groupsKey =
|
|
18568
|
+
const groupsKey = useMemo32(() => {
|
|
18543
18569
|
const parts = [];
|
|
18544
18570
|
for (const [nodeType, ids] of groups) {
|
|
18545
18571
|
parts.push(`${nodeType}:${Array.from(ids).sort().join(",")}`);
|
|
@@ -18581,12 +18607,12 @@ function MessageSourcesContainer({ message, isLatestAssistant, onSelectFollowUp
|
|
|
18581
18607
|
cancelled = true;
|
|
18582
18608
|
};
|
|
18583
18609
|
}, [groupsKey, groups]);
|
|
18584
|
-
const sources =
|
|
18610
|
+
const sources = useMemo32(() => {
|
|
18585
18611
|
const map = /* @__PURE__ */ new Map();
|
|
18586
18612
|
for (const entity of resolved) map.set(entity.id, entity);
|
|
18587
18613
|
return map;
|
|
18588
18614
|
}, [resolved]);
|
|
18589
|
-
const users =
|
|
18615
|
+
const users = useMemo32(() => {
|
|
18590
18616
|
const userMap = /* @__PURE__ */ new Map();
|
|
18591
18617
|
for (const entity of resolved) {
|
|
18592
18618
|
const author = entity._author ?? (() => {
|
|
@@ -18883,7 +18909,7 @@ __name(NotificationsListContainer, "NotificationsListContainer");
|
|
|
18883
18909
|
// src/features/notification/components/modals/NotificationModal.tsx
|
|
18884
18910
|
import { BellIcon } from "lucide-react";
|
|
18885
18911
|
import { useTranslations as useTranslations97 } from "next-intl";
|
|
18886
|
-
import { Fragment as Fragment47, useCallback as useCallback39, useEffect as useEffect63, useMemo as
|
|
18912
|
+
import { Fragment as Fragment47, useCallback as useCallback39, useEffect as useEffect63, useMemo as useMemo33, useRef as useRef33, useState as useState83 } from "react";
|
|
18887
18913
|
import { jsx as jsx224, jsxs as jsxs138 } from "react/jsx-runtime";
|
|
18888
18914
|
function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
18889
18915
|
const _instanceId = useRef33(Math.random().toString(36).substr(2, 9));
|
|
@@ -18928,7 +18954,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
|
|
|
18928
18954
|
}
|
|
18929
18955
|
return !breaker.isOpen;
|
|
18930
18956
|
}, []);
|
|
18931
|
-
const { unreadCount, unreadIds } =
|
|
18957
|
+
const { unreadCount, unreadIds } = useMemo33(() => {
|
|
18932
18958
|
const unreadNotifications2 = notifications.filter((notif) => !notif.isRead);
|
|
18933
18959
|
return {
|
|
18934
18960
|
unreadCount: unreadNotifications2.length,
|
|
@@ -20920,7 +20946,7 @@ __name(WaitlistList, "WaitlistList");
|
|
|
20920
20946
|
// src/features/rbac/components/RbacContainer.tsx
|
|
20921
20947
|
import { Loader2Icon as Loader2Icon3 } from "lucide-react";
|
|
20922
20948
|
import { useTranslations as useTranslations110 } from "next-intl";
|
|
20923
|
-
import { memo as memo2, useCallback as useCallback49, useEffect as useEffect71, useMemo as
|
|
20949
|
+
import { memo as memo2, useCallback as useCallback49, useEffect as useEffect71, useMemo as useMemo34, useRef as useRef36, useState as useState96 } from "react";
|
|
20924
20950
|
|
|
20925
20951
|
// src/features/rbac/components/RbacPermissionCell.tsx
|
|
20926
20952
|
import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
|
|
@@ -21275,11 +21301,11 @@ function RbacContainer() {
|
|
|
21275
21301
|
setSelectedModuleId(id);
|
|
21276
21302
|
setActivePicker(null);
|
|
21277
21303
|
}, []);
|
|
21278
|
-
const sortedModuleIds =
|
|
21304
|
+
const sortedModuleIds = useMemo34(() => {
|
|
21279
21305
|
if (!matrix) return [];
|
|
21280
21306
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
21281
21307
|
}, [matrix, moduleNames]);
|
|
21282
|
-
const roleIds =
|
|
21308
|
+
const roleIds = useMemo34(() => {
|
|
21283
21309
|
if (roleNames) {
|
|
21284
21310
|
return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
|
|
21285
21311
|
}
|
|
@@ -21297,14 +21323,14 @@ function RbacContainer() {
|
|
|
21297
21323
|
setSelectedModuleId(sortedModuleIds[0]);
|
|
21298
21324
|
}
|
|
21299
21325
|
}, [selectedModuleId, sortedModuleIds]);
|
|
21300
|
-
const activeValue =
|
|
21326
|
+
const activeValue = useMemo34(() => {
|
|
21301
21327
|
if (!activePicker || !matrix) return void 0;
|
|
21302
21328
|
const block = matrix[activePicker.moduleId];
|
|
21303
21329
|
if (!block) return void 0;
|
|
21304
21330
|
const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
|
|
21305
21331
|
return cellValue(tokens, activePicker.action);
|
|
21306
21332
|
}, [activePicker, matrix]);
|
|
21307
|
-
const activeSegments =
|
|
21333
|
+
const activeSegments = useMemo34(() => {
|
|
21308
21334
|
if (!activePicker) return [];
|
|
21309
21335
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
21310
21336
|
}, [activePicker, modulePaths]);
|
|
@@ -21375,7 +21401,7 @@ __name(RbacContainer, "RbacContainer");
|
|
|
21375
21401
|
// src/features/rbac/components/RbacByRoleContainer.tsx
|
|
21376
21402
|
import { Loader2Icon as Loader2Icon4 } from "lucide-react";
|
|
21377
21403
|
import { useTranslations as useTranslations111 } from "next-intl";
|
|
21378
|
-
import { Fragment as Fragment55, memo as memo3, useCallback as useCallback50, useEffect as useEffect72, useMemo as
|
|
21404
|
+
import { Fragment as Fragment55, memo as memo3, useCallback as useCallback50, useEffect as useEffect72, useMemo as useMemo35, useRef as useRef37, useState as useState97 } from "react";
|
|
21379
21405
|
import { jsx as jsx256, jsxs as jsxs166 } from "react/jsx-runtime";
|
|
21380
21406
|
function findToken2(tokens, action) {
|
|
21381
21407
|
if (!tokens) return void 0;
|
|
@@ -21425,11 +21451,11 @@ function RbacByRoleContainer() {
|
|
|
21425
21451
|
setSelectedRoleId(id);
|
|
21426
21452
|
setActivePicker(null);
|
|
21427
21453
|
}, []);
|
|
21428
|
-
const sortedRoleIds =
|
|
21454
|
+
const sortedRoleIds = useMemo35(() => {
|
|
21429
21455
|
if (!roleNames) return [];
|
|
21430
21456
|
return Object.keys(roleNames).sort((a, b) => (roleNames[a] ?? a).localeCompare(roleNames[b] ?? b));
|
|
21431
21457
|
}, [roleNames]);
|
|
21432
|
-
const sortedModuleIds =
|
|
21458
|
+
const sortedModuleIds = useMemo35(() => {
|
|
21433
21459
|
if (!matrix) return [];
|
|
21434
21460
|
return Object.keys(matrix).sort((a, b) => (moduleNames?.[a] ?? a).localeCompare(moduleNames?.[b] ?? b));
|
|
21435
21461
|
}, [matrix, moduleNames]);
|
|
@@ -21438,14 +21464,14 @@ function RbacByRoleContainer() {
|
|
|
21438
21464
|
setSelectedRoleId(sortedRoleIds[0]);
|
|
21439
21465
|
}
|
|
21440
21466
|
}, [selectedRoleId, sortedRoleIds]);
|
|
21441
|
-
const activeValue =
|
|
21467
|
+
const activeValue = useMemo35(() => {
|
|
21442
21468
|
if (!activePicker || !matrix) return void 0;
|
|
21443
21469
|
const block = matrix[activePicker.moduleId];
|
|
21444
21470
|
if (!block) return void 0;
|
|
21445
21471
|
const tokens = activePicker.rowKey === "default" ? block.default : block[activePicker.rowKey];
|
|
21446
21472
|
return cellValue2(tokens, activePicker.action);
|
|
21447
21473
|
}, [activePicker, matrix]);
|
|
21448
|
-
const activeSegments =
|
|
21474
|
+
const activeSegments = useMemo35(() => {
|
|
21449
21475
|
if (!activePicker) return [];
|
|
21450
21476
|
return modulePaths[activePicker.moduleId] ?? [];
|
|
21451
21477
|
}, [activePicker, modulePaths]);
|
|
@@ -22062,4 +22088,4 @@ export {
|
|
|
22062
22088
|
useOAuthClients,
|
|
22063
22089
|
useOAuthClient
|
|
22064
22090
|
};
|
|
22065
|
-
//# sourceMappingURL=chunk-
|
|
22091
|
+
//# sourceMappingURL=chunk-A4EZFGFA.mjs.map
|