@carlonicora/nextjs-jsonapi 1.92.2 → 1.93.0

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.
@@ -47,7 +47,7 @@ import {
47
47
  TabsList,
48
48
  TabsTrigger,
49
49
  useCurrentUserContext
50
- } from "../chunk-TGZDQSDU.mjs";
50
+ } from "../chunk-FELMRARS.mjs";
51
51
  import {
52
52
  getRoleId,
53
53
  getStripePublishableKey
@@ -9214,7 +9214,7 @@ import { useRef as useRef15 } from "react";
9214
9214
  import dynamic from "next/dynamic";
9215
9215
  import React14 from "react";
9216
9216
  import { jsx as jsx73 } from "react/jsx-runtime";
9217
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-C33MRSMX.mjs"), {
9217
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-R2QZFXBW.mjs"), {
9218
9218
  ssr: false
9219
9219
  });
9220
9220
  var BlockNoteEditorContainer = React14.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -9240,7 +9240,8 @@ function FormBlockNote({
9240
9240
  enableMentions,
9241
9241
  mentionSearchFn,
9242
9242
  mentionSearchParams,
9243
- mentionResolveFn
9243
+ mentionResolveFn,
9244
+ suggestionMenuComponent
9244
9245
  }) {
9245
9246
  const initialContentRef = useRef15(null);
9246
9247
  const lastEditorContentRef = useRef15(void 0);
@@ -9285,6 +9286,7 @@ function FormBlockNote({
9285
9286
  mentionSearchFn,
9286
9287
  mentionSearchParams,
9287
9288
  mentionResolveFn,
9289
+ suggestionMenuComponent,
9288
9290
  className: cn(stretch && "min-h-0 flex-1")
9289
9291
  }
9290
9292
  );
@@ -13759,45 +13761,35 @@ var createMentionInlineContentSpec = /* @__PURE__ */ __name((resolveFn, disableM
13759
13761
  // src/components/editors/BlockNoteEditorSuggestionMenuController.tsx
13760
13762
  import { SuggestionMenuController } from "@blocknote/react";
13761
13763
  import { autoUpdate, flip, shift } from "@floating-ui/react";
13762
- import { useCallback as useCallback28, useRef as useRef24 } from "react";
13764
+ import { useCallback as useCallback28 } from "react";
13763
13765
  import { jsx as jsx152 } from "react/jsx-runtime";
13764
- var DEBOUNCE_MS = 300;
13765
13766
  function BlockNoteEditorMentionSuggestionMenu({
13766
13767
  editor,
13767
13768
  mentionSearchFn,
13768
- mentionSearchParams
13769
+ mentionSearchParams,
13770
+ suggestionMenuComponent
13769
13771
  }) {
13770
- const lastQueryRef = useRef24("");
13771
13772
  const getItems = useCallback28(
13772
13773
  async (query) => {
13773
- lastQueryRef.current = query;
13774
- if (query.length > 0) {
13775
- await new Promise((resolve) => setTimeout(resolve, DEBOUNCE_MS));
13776
- if (lastQueryRef.current !== query) return [];
13777
- }
13778
- try {
13779
- const results = await mentionSearchFn(query, mentionSearchParams);
13780
- if (lastQueryRef.current !== query) return [];
13781
- return results.map((item) => ({
13782
- title: item.name,
13783
- subtext: item.entityType,
13784
- onItemClick: /* @__PURE__ */ __name(() => {
13785
- editor.insertInlineContent([
13786
- {
13787
- type: "mention",
13788
- props: {
13789
- alias: item.name,
13790
- id: item.id,
13791
- entityType: item.entityType
13792
- }
13793
- },
13794
- " "
13795
- ]);
13796
- }, "onItemClick")
13797
- }));
13798
- } catch {
13799
- return [];
13800
- }
13774
+ const results = await mentionSearchFn(query, mentionSearchParams);
13775
+ return results.map((item) => ({
13776
+ title: item.name,
13777
+ subtext: item.entityType,
13778
+ icon: item.icon,
13779
+ onItemClick: /* @__PURE__ */ __name(() => {
13780
+ editor.insertInlineContent([
13781
+ {
13782
+ type: "mention",
13783
+ props: {
13784
+ alias: item.name,
13785
+ id: item.id,
13786
+ entityType: item.entityType
13787
+ }
13788
+ },
13789
+ " "
13790
+ ]);
13791
+ }, "onItemClick")
13792
+ }));
13801
13793
  },
13802
13794
  [editor, mentionSearchFn, mentionSearchParams]
13803
13795
  );
@@ -13806,6 +13798,7 @@ function BlockNoteEditorMentionSuggestionMenu({
13806
13798
  {
13807
13799
  triggerCharacter: "@",
13808
13800
  getItems,
13801
+ suggestionMenuComponent,
13809
13802
  floatingUIOptions: {
13810
13803
  useFloatingOptions: {
13811
13804
  strategy: "fixed",
@@ -13820,12 +13813,12 @@ function BlockNoteEditorMentionSuggestionMenu({
13820
13813
  __name(BlockNoteEditorMentionSuggestionMenu, "BlockNoteEditorMentionSuggestionMenu");
13821
13814
 
13822
13815
  // src/components/pages/PageContainerContentDetails.tsx
13823
- import { useEffect as useEffect40, useRef as useRef25, useState as useState48 } from "react";
13816
+ import { useEffect as useEffect40, useRef as useRef24, useState as useState48 } from "react";
13824
13817
  import { jsx as jsx153, jsxs as jsxs91 } from "react/jsx-runtime";
13825
13818
  function PageContainerContentDetails({ items, section, module, id }) {
13826
13819
  const rewriteUrl = useUrlRewriter();
13827
13820
  const [isScrolled, setIsScrolled] = useState48(false);
13828
- const sentinelRef = useRef25(null);
13821
+ const sentinelRef = useRef24(null);
13829
13822
  useEffect40(() => {
13830
13823
  const sentinel = sentinelRef.current;
13831
13824
  if (!sentinel) return;
@@ -14032,13 +14025,13 @@ function JsonApiProvider({ config, children }) {
14032
14025
  __name(JsonApiProvider, "JsonApiProvider");
14033
14026
 
14034
14027
  // src/client/hooks/useJsonApiGet.ts
14035
- import { useState as useState50, useEffect as useEffect43, useCallback as useCallback29, useRef as useRef26 } from "react";
14028
+ import { useState as useState50, useEffect as useEffect43, useCallback as useCallback29, useRef as useRef25 } from "react";
14036
14029
  function useJsonApiGet(params) {
14037
14030
  const [data, setData] = useState50(null);
14038
14031
  const [loading, setLoading] = useState50(false);
14039
14032
  const [error, setError] = useState50(null);
14040
14033
  const [response, setResponse] = useState50(null);
14041
- const isMounted = useRef26(true);
14034
+ const isMounted = useRef25(true);
14042
14035
  const fetchData = useCallback29(async () => {
14043
14036
  if (params.options?.enabled === false) return;
14044
14037
  setLoading(true);
@@ -14840,12 +14833,12 @@ import { memo, useMemo as useMemo25, useState as useState55 } from "react";
14840
14833
  // src/components/tables/ContentTableSearch.tsx
14841
14834
  import { RefreshCw, Search, X as X3 } from "lucide-react";
14842
14835
  import { useTranslations as useTranslations55 } from "next-intl";
14843
- import { useCallback as useCallback34, useEffect as useEffect47, useRef as useRef27, useState as useState54 } from "react";
14836
+ import { useCallback as useCallback34, useEffect as useEffect47, useRef as useRef26, useState as useState54 } from "react";
14844
14837
  import { jsx as jsx164, jsxs as jsxs94 } from "react/jsx-runtime";
14845
14838
  function ContentTableSearch({ data }) {
14846
14839
  const t = useTranslations55();
14847
- const searchTermRef = useRef27("");
14848
- const inputRef = useRef27(null);
14840
+ const searchTermRef = useRef26("");
14841
+ const inputRef = useRef26(null);
14849
14842
  const [searchTerm, setSearchTerm] = useState54("");
14850
14843
  const [isFocused, setIsFocused] = useState54(false);
14851
14844
  const [isSearching, setIsSearching] = useState54(false);
@@ -15045,12 +15038,12 @@ var ContentListTable = memo(/* @__PURE__ */ __name(function ContentListTable2(pr
15045
15038
  }, "ContentListTable"));
15046
15039
 
15047
15040
  // src/components/grids/ContentListGrid.tsx
15048
- import { useEffect as useEffect48, useRef as useRef28 } from "react";
15041
+ import { useEffect as useEffect48, useRef as useRef27 } from "react";
15049
15042
  import { Fragment as Fragment27, jsx as jsx166, jsxs as jsxs96 } from "react/jsx-runtime";
15050
15043
  var DEFAULT_GRID_CLASSES = "grid grid-cols-2 gap-4 p-4 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5";
15051
15044
  function ContentListGrid(props) {
15052
15045
  const { data, ItemComponent, allowSearch, fullWidth, gridClassName } = props;
15053
- const sentinelRef = useRef28(null);
15046
+ const sentinelRef = useRef27(null);
15054
15047
  useEffect48(() => {
15055
15048
  if (!data.next || !sentinelRef.current) return;
15056
15049
  const observer = new IntersectionObserver(
@@ -15145,14 +15138,14 @@ __name(validateItalianTaxCode, "validateItalianTaxCode");
15145
15138
 
15146
15139
  // src/components/fiscal/ItalianFiscalData.tsx
15147
15140
  import { useTranslations as useTranslations56 } from "next-intl";
15148
- import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef29, useState as useState56 } from "react";
15141
+ import { forwardRef as forwardRef8, useCallback as useCallback35, useImperativeHandle as useImperativeHandle2, useRef as useRef28, useState as useState56 } from "react";
15149
15142
  import { z as z4 } from "zod";
15150
15143
  import { jsx as jsx167, jsxs as jsxs97 } from "react/jsx-runtime";
15151
15144
  var ItalianFiscalData = forwardRef8(/* @__PURE__ */ __name(function ItalianFiscalData2({ initialData }, ref) {
15152
15145
  const t = useTranslations56();
15153
- const initialRef = useRef29(initialData);
15146
+ const initialRef = useRef28(initialData);
15154
15147
  const [fiscalData, setFiscalData] = useState56(initialData);
15155
- const fiscalDataRef = useRef29(initialData);
15148
+ const fiscalDataRef = useRef28(initialData);
15156
15149
  const [fiscalErrors, setFiscalErrors] = useState56({});
15157
15150
  const updateFiscalField = useCallback35((key, value) => {
15158
15151
  setFiscalData((prev) => {
@@ -15789,11 +15782,11 @@ import { useTranslations as useTranslations60 } from "next-intl";
15789
15782
  import { useState as useState61 } from "react";
15790
15783
 
15791
15784
  // src/features/auth/components/two-factor/TotpInput.tsx
15792
- import { useEffect as useEffect50, useRef as useRef30, useState as useState60 } from "react";
15785
+ import { useEffect as useEffect50, useRef as useRef29, useState as useState60 } from "react";
15793
15786
  import { jsx as jsx173, jsxs as jsxs101 } from "react/jsx-runtime";
15794
15787
  function TotpInput({ onComplete, disabled = false, autoFocus = true, error }) {
15795
15788
  const [digits, setDigits] = useState60(["", "", "", "", "", ""]);
15796
- const inputRefs = useRef30([]);
15789
+ const inputRefs = useRef29([]);
15797
15790
  useEffect50(() => {
15798
15791
  if (autoFocus && inputRefs.current[0]) {
15799
15792
  inputRefs.current[0].focus();
@@ -17282,7 +17275,7 @@ __name(RelevantContentsList, "RelevantContentsList");
17282
17275
  // src/features/how-to/components/containers/HowToCommand.tsx
17283
17276
  import { ArrowRight, LifeBuoyIcon } from "lucide-react";
17284
17277
  import { useTranslations as useTranslations78 } from "next-intl";
17285
- import { useCallback as useCallback37, useEffect as useEffect59, useMemo as useMemo28, useRef as useRef31, useState as useState75 } from "react";
17278
+ import { useCallback as useCallback37, useEffect as useEffect59, useMemo as useMemo28, useRef as useRef30, useState as useState75 } from "react";
17286
17279
 
17287
17280
  // src/features/how-to/components/containers/HowToCommandViewer.tsx
17288
17281
  import { ArrowLeft, BookOpen, MessageSquare } from "lucide-react";
@@ -17410,7 +17403,7 @@ function HowToCommand({ pathname, extraGroups, onStartChat }) {
17410
17403
  const t = useTranslations78();
17411
17404
  const [dialogOpen, setDialogOpen] = useState75(false);
17412
17405
  const [selectedHowTo, setSelectedHowTo] = useState75(null);
17413
- const searchTermRef = useRef31("");
17406
+ const searchTermRef = useRef30("");
17414
17407
  const [searchTerm, setSearchTerm] = useState75("");
17415
17408
  const data = useDataListRetriever({
17416
17409
  retriever: /* @__PURE__ */ __name((params) => {
@@ -17752,7 +17745,7 @@ __name(HowToMultiSelector, "HowToMultiSelector");
17752
17745
  // src/features/how-to/components/forms/HowToSelector.tsx
17753
17746
  import { CircleX as CircleX2, RefreshCwIcon as RefreshCwIcon3, SearchIcon as SearchIcon6, XIcon as XIcon10 } from "lucide-react";
17754
17747
  import { useTranslations as useTranslations83 } from "next-intl";
17755
- import { useCallback as useCallback38, useEffect as useEffect60, useRef as useRef32, useState as useState76 } from "react";
17748
+ import { useCallback as useCallback38, useEffect as useEffect60, useRef as useRef31, useState as useState76 } from "react";
17756
17749
  import { Fragment as Fragment42, jsx as jsx203, jsxs as jsxs120 } from "react/jsx-runtime";
17757
17750
  function HowToSelector({
17758
17751
  id,
@@ -17764,7 +17757,7 @@ function HowToSelector({
17764
17757
  }) {
17765
17758
  const t = useTranslations83();
17766
17759
  const [open, setOpen] = useState76(false);
17767
- const searchTermRef = useRef32("");
17760
+ const searchTermRef = useRef31("");
17768
17761
  const [searchTerm, setSearchTerm] = useState76("");
17769
17762
  const [isSearching, setIsSearching] = useState76(false);
17770
17763
  const data = useDataListRetriever({
@@ -18058,7 +18051,7 @@ function AssistantThreadHeader({ assistant, onRename, onDelete }) {
18058
18051
  __name(AssistantThreadHeader, "AssistantThreadHeader");
18059
18052
 
18060
18053
  // src/features/assistant/components/parts/AssistantThread.tsx
18061
- import { useEffect as useEffect62, useRef as useRef33 } from "react";
18054
+ import { useEffect as useEffect62, useRef as useRef32 } from "react";
18062
18055
 
18063
18056
  // src/features/assistant-message/components/MessageItem.tsx
18064
18057
  import { useTranslations as useTranslations93 } from "next-intl";
@@ -18612,7 +18605,7 @@ __name(AssistantStatusLine, "AssistantStatusLine");
18612
18605
  // src/features/assistant/components/parts/AssistantThread.tsx
18613
18606
  import { jsx as jsx219, jsxs as jsxs133 } from "react/jsx-runtime";
18614
18607
  function AssistantThread({ messages, sending, status, onSelectFollowUp, failedMessageIds, onRetry }) {
18615
- const endRef = useRef33(null);
18608
+ const endRef = useRef32(null);
18616
18609
  useEffect62(() => {
18617
18610
  endRef.current?.scrollIntoView({ behavior: "smooth" });
18618
18611
  }, [messages.length, sending]);
@@ -18806,10 +18799,10 @@ __name(NotificationsListContainer, "NotificationsListContainer");
18806
18799
  // src/features/notification/components/modals/NotificationModal.tsx
18807
18800
  import { BellIcon } from "lucide-react";
18808
18801
  import { useTranslations as useTranslations97 } from "next-intl";
18809
- import { Fragment as Fragment47, useCallback as useCallback39, useEffect as useEffect63, useMemo as useMemo32, useRef as useRef34, useState as useState83 } from "react";
18802
+ import { Fragment as Fragment47, useCallback as useCallback39, useEffect as useEffect63, useMemo as useMemo32, useRef as useRef33, useState as useState83 } from "react";
18810
18803
  import { jsx as jsx224, jsxs as jsxs138 } from "react/jsx-runtime";
18811
18804
  function NotificationModalContent({ isOpen, setIsOpen }) {
18812
- const _instanceId = useRef34(Math.random().toString(36).substr(2, 9));
18805
+ const _instanceId = useRef33(Math.random().toString(36).substr(2, 9));
18813
18806
  const {
18814
18807
  notifications,
18815
18808
  addNotification,
@@ -18830,8 +18823,8 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18830
18823
  const t = useTranslations97();
18831
18824
  const generateUrl = usePageUrlGenerator();
18832
18825
  const [newNotifications, setNewNotifications] = useState83(false);
18833
- const preventAutoClose = useRef34(false);
18834
- const circuitBreakerRef = useRef34({
18826
+ const preventAutoClose = useRef33(false);
18827
+ const circuitBreakerRef = useRef33({
18835
18828
  count: 0,
18836
18829
  resetTime: 0,
18837
18830
  isOpen: false
@@ -18864,7 +18857,7 @@ function NotificationModalContent({ isOpen, setIsOpen }) {
18864
18857
  useEffect63(() => {
18865
18858
  if (lastLoaded === 0) loadNotifications();
18866
18859
  }, [lastLoaded, loadNotifications]);
18867
- const processSocketNotificationsRef = useRef34(null);
18860
+ const processSocketNotificationsRef = useRef33(null);
18868
18861
  const processSocketNotifications = useCallback39(() => {
18869
18862
  if (socketNotifications.length === 0) {
18870
18863
  return;
@@ -19025,7 +19018,7 @@ __name(ReferralCodeCapture, "ReferralCodeCapture");
19025
19018
 
19026
19019
  // src/features/referral/components/ReferralWidget.tsx
19027
19020
  import { Copy as Copy2, Loader2 as Loader25, Mail, Users } from "lucide-react";
19028
- import { useCallback as useCallback40, useRef as useRef35, useState as useState86 } from "react";
19021
+ import { useCallback as useCallback40, useRef as useRef34, useState as useState86 } from "react";
19029
19022
 
19030
19023
  // src/features/referral/hooks/useReferralInvite.ts
19031
19024
  import { useState as useState84 } from "react";
@@ -19131,7 +19124,7 @@ function ReferralWidget({
19131
19124
  const { sendInvite, sending } = useReferralInvite();
19132
19125
  const [email, setEmail] = useState86("");
19133
19126
  const [copied, setCopied] = useState86(false);
19134
- const linkInputRef = useRef35(null);
19127
+ const linkInputRef = useRef34(null);
19135
19128
  const config = getReferralConfig();
19136
19129
  const baseUrl = config.referralUrlBase || (typeof window !== "undefined" ? window.location.origin : "");
19137
19130
  const referralUrl = stats?.referralCode ? `${baseUrl}${config.referralPath}?${config.urlParamName}=${stats.referralCode}` : "";
@@ -19419,11 +19412,11 @@ __name(RemoveUserFromRole, "RemoveUserFromRole");
19419
19412
  // src/features/role/components/forms/UserRoleAdd.tsx
19420
19413
  import { PlusCircle as PlusCircle2 } from "lucide-react";
19421
19414
  import { useTranslations as useTranslations101 } from "next-intl";
19422
- import { useCallback as useCallback41, useEffect as useEffect67, useRef as useRef36, useState as useState88 } from "react";
19415
+ import { useCallback as useCallback41, useEffect as useEffect67, useRef as useRef35, useState as useState88 } from "react";
19423
19416
  import { Fragment as Fragment51, jsx as jsx232, jsxs as jsxs144 } from "react/jsx-runtime";
19424
19417
  function UserRoleAdd({ user, refresh }) {
19425
19418
  const [open, setOpen] = useState88(false);
19426
- const inputRef = useRef36(null);
19419
+ const inputRef = useRef35(null);
19427
19420
  const [searchTerm, setSearchTerm] = useState88("");
19428
19421
  const [roles, setRoles] = useState88([]);
19429
19422
  const t = useTranslations101();
@@ -20843,7 +20836,7 @@ __name(WaitlistList, "WaitlistList");
20843
20836
  // src/features/rbac/components/RbacContainer.tsx
20844
20837
  import { Loader2Icon as Loader2Icon3 } from "lucide-react";
20845
20838
  import { useTranslations as useTranslations110 } from "next-intl";
20846
- import { memo as memo2, useCallback as useCallback49, useEffect as useEffect71, useMemo as useMemo33, useRef as useRef37, useState as useState96 } from "react";
20839
+ import { memo as memo2, useCallback as useCallback49, useEffect as useEffect71, useMemo as useMemo33, useRef as useRef36, useState as useState96 } from "react";
20847
20840
 
20848
20841
  // src/features/rbac/components/RbacPermissionCell.tsx
20849
20842
  import { CheckIcon as CheckIcon9, MinusIcon as MinusIcon2, XIcon as XIcon11 } from "lucide-react";
@@ -21112,7 +21105,7 @@ var CellButton = memo2(/* @__PURE__ */ __name(function CellButton2({
21112
21105
  isRoleColumn,
21113
21106
  onOpen
21114
21107
  }) {
21115
- const ref = useRef37(null);
21108
+ const ref = useRef36(null);
21116
21109
  const value = cellValue(tokens, action);
21117
21110
  const handleClick = useCallback49(() => {
21118
21111
  if (!ref.current) return;
@@ -21298,7 +21291,7 @@ __name(RbacContainer, "RbacContainer");
21298
21291
  // src/features/rbac/components/RbacByRoleContainer.tsx
21299
21292
  import { Loader2Icon as Loader2Icon4 } from "lucide-react";
21300
21293
  import { useTranslations as useTranslations111 } from "next-intl";
21301
- import { Fragment as Fragment55, memo as memo3, useCallback as useCallback50, useEffect as useEffect72, useMemo as useMemo34, useRef as useRef38, useState as useState97 } from "react";
21294
+ import { Fragment as Fragment55, memo as memo3, useCallback as useCallback50, useEffect as useEffect72, useMemo as useMemo34, useRef as useRef37, useState as useState97 } from "react";
21302
21295
  import { jsx as jsx256, jsxs as jsxs166 } from "react/jsx-runtime";
21303
21296
  function findToken2(tokens, action) {
21304
21297
  if (!tokens) return void 0;
@@ -21319,7 +21312,7 @@ var CellButton3 = memo3(/* @__PURE__ */ __name(function CellButton4({
21319
21312
  isRoleColumn,
21320
21313
  onOpen
21321
21314
  }) {
21322
- const ref = useRef38(null);
21315
+ const ref = useRef37(null);
21323
21316
  const value = cellValue2(tokens, action);
21324
21317
  const handleClick = useCallback50(() => {
21325
21318
  if (!ref.current) return;
@@ -21984,4 +21977,4 @@ export {
21984
21977
  useOAuthClients,
21985
21978
  useOAuthClient
21986
21979
  };
21987
- //# sourceMappingURL=chunk-TGZDQSDU.mjs.map
21980
+ //# sourceMappingURL=chunk-FELMRARS.mjs.map