@carlonicora/nextjs-jsonapi 3.3.4 → 3.3.6

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.
Files changed (29) hide show
  1. package/dist/{BlockNoteEditor-ZNEXXORX.mjs → BlockNoteEditor-BYMRWUVG.mjs} +2 -2
  2. package/dist/{BlockNoteEditor-J4TQJSHZ.js → BlockNoteEditor-USRMFZGP.js} +9 -9
  3. package/dist/{BlockNoteEditor-J4TQJSHZ.js.map → BlockNoteEditor-USRMFZGP.js.map} +1 -1
  4. package/dist/billing/index.js +333 -333
  5. package/dist/billing/index.mjs +1 -1
  6. package/dist/{chunk-KCZ6SPUQ.js → chunk-5WFYQE22.js} +234 -233
  7. package/dist/chunk-5WFYQE22.js.map +1 -0
  8. package/dist/{chunk-GCE4C7FG.mjs → chunk-CFZW6GU4.mjs} +14 -13
  9. package/dist/chunk-CFZW6GU4.mjs.map +1 -0
  10. package/dist/client/index.js +2 -2
  11. package/dist/client/index.mjs +1 -1
  12. package/dist/components/index.d.mts +39 -3
  13. package/dist/components/index.d.ts +39 -3
  14. package/dist/components/index.js +4 -2
  15. package/dist/components/index.js.map +1 -1
  16. package/dist/components/index.mjs +3 -1
  17. package/dist/contexts/index.js +2 -2
  18. package/dist/contexts/index.mjs +1 -1
  19. package/dist/features/help/index.js +31 -31
  20. package/dist/features/help/index.mjs +1 -1
  21. package/dist/features/tokenusage/index.js +75 -75
  22. package/dist/features/tokenusage/index.mjs +1 -1
  23. package/package.json +1 -1
  24. package/src/components/forms/DatePickerPopover.tsx +31 -3
  25. package/src/components/forms/DateRangeSelector.tsx +36 -12
  26. package/src/components/forms/__tests__/DateRangeSelector.spec.ts +74 -0
  27. package/dist/chunk-GCE4C7FG.mjs.map +0 -1
  28. package/dist/chunk-KCZ6SPUQ.js.map +0 -1
  29. /package/dist/{BlockNoteEditor-ZNEXXORX.mjs.map → BlockNoteEditor-BYMRWUVG.mjs.map} +0 -0
@@ -9190,6 +9190,7 @@ import { useMemo as useMemo12, useState as useState20 } from "react";
9190
9190
  import { jsx as jsx83, jsxs as jsxs46 } from "react/jsx-runtime";
9191
9191
  var DatePickerPopover = /* @__PURE__ */ __name(({
9192
9192
  children,
9193
+ nativeButton = true,
9193
9194
  value,
9194
9195
  onSelect,
9195
9196
  minDate,
@@ -9259,7 +9260,7 @@ var DatePickerPopover = /* @__PURE__ */ __name(({
9259
9260
  setInputValue("");
9260
9261
  }, "handleClear");
9261
9262
  return /* @__PURE__ */ jsxs46(Popover, { open: isOpen, onOpenChange: setIsOpen, children: [
9262
- /* @__PURE__ */ jsx83(PopoverTrigger, { children }),
9263
+ /* @__PURE__ */ jsx83(PopoverTrigger, { nativeButton, render: children }),
9263
9264
  /* @__PURE__ */ jsx83(PopoverContent, { className: cn("p-0", className), align, onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs46("div", { className: "p-3", children: [
9264
9265
  /* @__PURE__ */ jsxs46("div", { className: "relative mb-3", children: [
9265
9266
  /* @__PURE__ */ jsx83(
@@ -9350,6 +9351,13 @@ import { CalendarIcon as CalendarIcon2 } from "lucide-react";
9350
9351
  import { useTranslations as useTranslations15 } from "next-intl";
9351
9352
  import { useEffect as useEffect15, useState as useState21 } from "react";
9352
9353
  import { Fragment as Fragment9, jsx as jsx84, jsxs as jsxs47 } from "react/jsx-runtime";
9354
+ function nextDateRange(params) {
9355
+ const { current, computed, triggerDate } = params;
9356
+ if (!computed) return void 0;
9357
+ if (current?.from && current?.to) return { from: triggerDate, to: void 0 };
9358
+ return computed;
9359
+ }
9360
+ __name(nextDateRange, "nextDateRange");
9353
9361
  function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth }) {
9354
9362
  const t = useTranslations15();
9355
9363
  const dateFnsLocale = useI18nDateFnsLocale();
@@ -9372,16 +9380,8 @@ function DateRangeSelector({ onDateChange, avoidSettingDates, showPreviousMonth
9372
9380
  setOpen(false);
9373
9381
  }
9374
9382
  }, [date, prevRange, onDateChange]);
9375
- const handleSelect = /* @__PURE__ */ __name((range) => {
9376
- if (!range) {
9377
- setDate(void 0);
9378
- return;
9379
- }
9380
- if (range.from && (!date?.from || range.from.getTime() !== date.from.getTime())) {
9381
- setDate({ from: range.from, to: void 0 });
9382
- } else {
9383
- setDate(range);
9384
- }
9383
+ const handleSelect = /* @__PURE__ */ __name((range, triggerDate) => {
9384
+ setDate(nextDateRange({ current: date, computed: range, triggerDate }));
9385
9385
  }, "handleSelect");
9386
9386
  if (!mounted) {
9387
9387
  return /* @__PURE__ */ jsx84("div", { className: cn("grid gap-2"), children: /* @__PURE__ */ jsxs47(
@@ -10226,7 +10226,7 @@ import { useRef as useRef17 } from "react";
10226
10226
  import dynamic from "next/dynamic";
10227
10227
  import React17 from "react";
10228
10228
  import { jsx as jsx88 } from "react/jsx-runtime";
10229
- var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-ZNEXXORX.mjs"), {
10229
+ var BlockNoteEditor = dynamic(() => import("./BlockNoteEditor-BYMRWUVG.mjs"), {
10230
10230
  ssr: false
10231
10231
  });
10232
10232
  var BlockNoteEditorContainer = React17.memo(/* @__PURE__ */ __name(function EditorContainer(props) {
@@ -25244,6 +25244,7 @@ export {
25244
25244
  CommonAddTrigger,
25245
25245
  CurrencyInput,
25246
25246
  DatePickerPopover,
25247
+ nextDateRange,
25247
25248
  DateRangeSelector,
25248
25249
  useEditorDialog,
25249
25250
  EditorSheet,
@@ -25441,4 +25442,4 @@ export {
25441
25442
  useOAuthClients,
25442
25443
  useOAuthClient
25443
25444
  };
25444
- //# sourceMappingURL=chunk-GCE4C7FG.mjs.map
25445
+ //# sourceMappingURL=chunk-CFZW6GU4.mjs.map