@btst/stack 1.4.1 → 1.5.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.
Files changed (432) hide show
  1. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/date/index.cjs +85 -0
  2. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/date/index.mjs +83 -0
  3. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/date/mini.cjs +237 -0
  4. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/date/mini.mjs +235 -0
  5. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/tzName/index.cjs +41 -0
  6. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/tzName/index.mjs +39 -0
  7. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/tzOffset/index.cjs +46 -0
  8. package/dist/node_modules/.pnpm/@date-fns_tz@1.4.1/node_modules/@date-fns/tz/tzOffset/index.mjs +44 -0
  9. package/dist/node_modules/.pnpm/@radix-ui_react-checkbox@1.3.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_c1e3fbdebd5ee34a254141dc5a2dcd28/node_modules/@radix-ui/react-checkbox/dist/index.cjs +296 -0
  10. package/dist/node_modules/.pnpm/@radix-ui_react-checkbox@1.3.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_c1e3fbdebd5ee34a254141dc5a2dcd28/node_modules/@radix-ui/react-checkbox/dist/index.mjs +271 -0
  11. package/dist/node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.cjs +325 -0
  12. package/dist/node_modules/.pnpm/@radix-ui_react-popover@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_5c5a3ca63b34dfe7d9d23f1e8cee675c/node_modules/@radix-ui/react-popover/dist/index.mjs +299 -0
  13. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.4_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_43b950ce9f6b8d55739cce33fe173a1c/node_modules/@radix-ui/react-primitive/dist/index.cjs +56 -0
  14. package/dist/node_modules/.pnpm/@radix-ui_react-primitive@2.1.4_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_43b950ce9f6b8d55739cce33fe173a1c/node_modules/@radix-ui/react-primitive/dist/index.mjs +40 -0
  15. package/dist/node_modules/.pnpm/@radix-ui_react-radio-group@1.3.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_e0d4db654009398ea41c8e459eeae4ee/node_modules/@radix-ui/react-radio-group/dist/index.cjs +304 -0
  16. package/dist/node_modules/.pnpm/@radix-ui_react-radio-group@1.3.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_e0d4db654009398ea41c8e459eeae4ee/node_modules/@radix-ui/react-radio-group/dist/index.mjs +283 -0
  17. package/dist/node_modules/.pnpm/@radix-ui_react-separator@1.1.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_8aae318b88145540882c32de0262377a/node_modules/@radix-ui/react-separator/dist/index.cjs +47 -0
  18. package/dist/node_modules/.pnpm/@radix-ui_react-separator@1.1.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_8aae318b88145540882c32de0262377a/node_modules/@radix-ui/react-separator/dist/index.mjs +30 -0
  19. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/DayPicker.cjs +326 -0
  20. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/DayPicker.mjs +320 -0
  21. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/UI.cjs +122 -0
  22. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/UI.mjs +122 -0
  23. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/CalendarDay.cjs +35 -0
  24. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/CalendarDay.mjs +33 -0
  25. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.cjs +16 -0
  26. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/CalendarMonth.mjs +14 -0
  27. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.cjs +15 -0
  28. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/CalendarWeek.mjs +13 -0
  29. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/DateLib.cjs +577 -0
  30. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/classes/DateLib.mjs +573 -0
  31. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Button.cjs +19 -0
  32. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Button.mjs +13 -0
  33. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/CaptionLabel.cjs +19 -0
  34. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/CaptionLabel.mjs +13 -0
  35. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Chevron.cjs +26 -0
  36. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Chevron.mjs +20 -0
  37. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Day.cjs +24 -0
  38. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Day.mjs +18 -0
  39. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/DayButton.cjs +25 -0
  40. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/DayButton.mjs +19 -0
  41. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Dropdown.cjs +27 -0
  42. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Dropdown.mjs +21 -0
  43. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/DropdownNav.cjs +19 -0
  44. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/DropdownNav.mjs +13 -0
  45. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Footer.cjs +19 -0
  46. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Footer.mjs +13 -0
  47. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Month.cjs +21 -0
  48. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Month.mjs +15 -0
  49. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/MonthCaption.cjs +20 -0
  50. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/MonthCaption.mjs +14 -0
  51. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/MonthGrid.cjs +19 -0
  52. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/MonthGrid.mjs +13 -0
  53. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Months.cjs +19 -0
  54. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Months.mjs +13 -0
  55. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.cjs +21 -0
  56. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/MonthsDropdown.mjs +15 -0
  57. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Nav.cjs +37 -0
  58. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Nav.mjs +31 -0
  59. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/NextMonthButton.cjs +21 -0
  60. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/NextMonthButton.mjs +15 -0
  61. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Option.cjs +19 -0
  62. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Option.mjs +13 -0
  63. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.cjs +21 -0
  64. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/PreviousMonthButton.mjs +15 -0
  65. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Root.cjs +20 -0
  66. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Root.mjs +14 -0
  67. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Select.cjs +19 -0
  68. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Select.mjs +13 -0
  69. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Week.cjs +20 -0
  70. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Week.mjs +14 -0
  71. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/WeekNumber.cjs +20 -0
  72. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/WeekNumber.mjs +14 -0
  73. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.cjs +19 -0
  74. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/WeekNumberHeader.mjs +13 -0
  75. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Weekday.cjs +19 -0
  76. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Weekday.mjs +13 -0
  77. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Weekdays.cjs +20 -0
  78. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Weekdays.mjs +14 -0
  79. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Weeks.cjs +19 -0
  80. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/Weeks.mjs +13 -0
  81. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/YearsDropdown.cjs +21 -0
  82. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/YearsDropdown.mjs +15 -0
  83. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/custom-components.cjs +57 -0
  84. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/components/custom-components.mjs +26 -0
  85. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatCaption.cjs +29 -0
  86. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatCaption.mjs +26 -0
  87. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatDay.cjs +21 -0
  88. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatDay.mjs +19 -0
  89. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.cjs +20 -0
  90. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatMonthDropdown.mjs +18 -0
  91. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.cjs +23 -0
  92. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumber.mjs +21 -0
  93. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.cjs +15 -0
  94. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekNumberHeader.mjs +13 -0
  95. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.cjs +21 -0
  96. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatWeekdayName.mjs +19 -0
  97. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.cjs +26 -0
  98. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/formatYearDropdown.mjs +23 -0
  99. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/index.cjs +21 -0
  100. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/formatters/index.mjs +7 -0
  101. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.cjs +75 -0
  102. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/calculateFocusTarget.mjs +73 -0
  103. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.cjs +97 -0
  104. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/createGetModifiers.mjs +95 -0
  105. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.cjs +24 -0
  106. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/endOfBroadcastWeek.mjs +22 -0
  107. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.cjs +30 -0
  108. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getBroadcastWeeksInMonth.mjs +28 -0
  109. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.cjs +35 -0
  110. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getClassNamesForModifiers.mjs +33 -0
  111. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getComponents.cjs +22 -0
  112. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getComponents.mjs +20 -0
  113. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.cjs +29 -0
  114. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDataAttributes.mjs +27 -0
  115. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDates.cjs +61 -0
  116. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDates.mjs +59 -0
  117. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDays.cjs +21 -0
  118. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDays.mjs +19 -0
  119. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.cjs +35 -0
  120. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDefaultClassNames.mjs +33 -0
  121. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.cjs +26 -0
  122. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getDisplayMonths.mjs +24 -0
  123. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.cjs +48 -0
  124. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getFocusableDate.mjs +46 -0
  125. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getFormatters.cjs +26 -0
  126. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getFormatters.mjs +24 -0
  127. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.cjs +29 -0
  128. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getInitialMonth.mjs +27 -0
  129. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getLabels.cjs +55 -0
  130. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getLabels.mjs +53 -0
  131. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.cjs +35 -0
  132. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getMonthOptions.mjs +33 -0
  133. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getMonths.cjs +71 -0
  134. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getMonths.mjs +69 -0
  135. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.cjs +53 -0
  136. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getNavMonth.mjs +51 -0
  137. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.cjs +42 -0
  138. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getNextFocus.mjs +40 -0
  139. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.cjs +38 -0
  140. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getNextMonth.mjs +36 -0
  141. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.cjs +39 -0
  142. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getPreviousMonth.mjs +37 -0
  143. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.cjs +29 -0
  144. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getStyleForModifiers.mjs +27 -0
  145. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.cjs +28 -0
  146. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getWeekdays.mjs +26 -0
  147. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getWeeks.cjs +16 -0
  148. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getWeeks.mjs +14 -0
  149. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.cjs +38 -0
  150. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/getYearOptions.mjs +36 -0
  151. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.cjs +29 -0
  152. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/startOfBroadcastWeek.mjs +27 -0
  153. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.cjs +33 -0
  154. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/helpers/useControlledValue.mjs +31 -0
  155. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/index.cjs +29 -0
  156. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/index.mjs +11 -0
  157. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelDayButton.cjs +35 -0
  158. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelDayButton.mjs +32 -0
  159. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelGrid.cjs +28 -0
  160. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelGrid.mjs +25 -0
  161. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelGridcell.cjs +24 -0
  162. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelGridcell.mjs +22 -0
  163. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.cjs +16 -0
  164. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelMonthDropdown.mjs +14 -0
  165. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelNav.cjs +15 -0
  166. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelNav.mjs +13 -0
  167. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelNext.cjs +18 -0
  168. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelNext.mjs +16 -0
  169. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelPrevious.cjs +17 -0
  170. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelPrevious.mjs +15 -0
  171. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.cjs +17 -0
  172. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumber.mjs +15 -0
  173. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.cjs +16 -0
  174. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelWeekNumberHeader.mjs +14 -0
  175. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelWeekday.cjs +20 -0
  176. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelWeekday.mjs +18 -0
  177. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.cjs +16 -0
  178. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/labels/labelYearDropdown.mjs +14 -0
  179. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/locale/en-US.cjs +69 -0
  180. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/locale/en-US.mjs +67 -0
  181. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/selection/useMulti.cjs +59 -0
  182. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/selection/useMulti.mjs +57 -0
  183. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/selection/useRange.cjs +47 -0
  184. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/selection/useRange.mjs +45 -0
  185. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/selection/useSingle.cjs +46 -0
  186. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/selection/useSingle.mjs +44 -0
  187. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useAnimation.cjs +176 -0
  188. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useAnimation.mjs +174 -0
  189. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useCalendar.cjs +115 -0
  190. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useCalendar.mjs +113 -0
  191. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useDayPicker.cjs +28 -0
  192. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useDayPicker.mjs +25 -0
  193. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useFocus.cjs +58 -0
  194. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useFocus.mjs +56 -0
  195. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useSelection.cjs +33 -0
  196. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/useSelection.mjs +31 -0
  197. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/addToRange.cjs +97 -0
  198. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/addToRange.mjs +95 -0
  199. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.cjs +59 -0
  200. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/convertMatchersToTimeZone.mjs +57 -0
  201. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.cjs +64 -0
  202. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/dateMatchModifiers.mjs +62 -0
  203. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.cjs +32 -0
  204. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsDayOfWeek.mjs +30 -0
  205. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.cjs +76 -0
  206. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeContainsModifiers.mjs +74 -0
  207. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.cjs +37 -0
  208. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeIncludesDate.mjs +35 -0
  209. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.cjs +23 -0
  210. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/rangeOverlaps.mjs +21 -0
  211. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/toTimeZone.cjs +18 -0
  212. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/toTimeZone.mjs +16 -0
  213. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/typeguards.cjs +73 -0
  214. package/dist/node_modules/.pnpm/react-day-picker@9.12.0_react@19.2.0/node_modules/react-day-picker/dist/esm/utils/typeguards.mjs +66 -0
  215. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.cjs +7 -0
  216. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.mjs +7 -0
  217. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +131 -124
  218. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +131 -124
  219. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.cjs +23 -23
  220. package/dist/packages/better-stack/src/plugins/blog/api/plugin.cjs +28 -12
  221. package/dist/packages/better-stack/src/plugins/blog/api/plugin.mjs +18 -2
  222. package/dist/packages/better-stack/src/plugins/blog/client/components/loading/form-page-skeleton.cjs +1 -1
  223. package/dist/packages/better-stack/src/plugins/blog/client/components/loading/form-page-skeleton.mjs +1 -1
  224. package/dist/packages/better-stack/src/plugins/blog/client/components/loading/list-page-skeleton.cjs +1 -1
  225. package/dist/packages/better-stack/src/plugins/blog/client/components/loading/list-page-skeleton.mjs +1 -1
  226. package/dist/packages/better-stack/src/plugins/blog/client/components/loading/post-page-skeleton.cjs +1 -1
  227. package/dist/packages/better-stack/src/plugins/blog/client/components/loading/post-page-skeleton.mjs +1 -1
  228. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +10 -6
  229. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +11 -7
  230. package/dist/packages/better-stack/src/plugins/blog/schemas.cjs +17 -17
  231. package/dist/packages/better-stack/src/plugins/cms/api/plugin.cjs +457 -0
  232. package/dist/packages/better-stack/src/plugins/cms/api/plugin.mjs +455 -0
  233. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.cjs +299 -0
  234. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/content-form.mjs +297 -0
  235. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/file-upload.cjs +118 -0
  236. package/dist/packages/better-stack/src/plugins/cms/client/components/forms/file-upload.mjs +116 -0
  237. package/dist/packages/better-stack/src/plugins/cms/client/components/loading/dashboard-skeleton.cjs +18 -0
  238. package/dist/packages/better-stack/src/plugins/cms/client/components/loading/dashboard-skeleton.mjs +16 -0
  239. package/dist/packages/better-stack/src/plugins/cms/client/components/loading/editor-skeleton.cjs +32 -0
  240. package/dist/packages/better-stack/src/plugins/cms/client/components/loading/editor-skeleton.mjs +30 -0
  241. package/dist/packages/better-stack/src/plugins/cms/client/components/loading/list-skeleton.cjs +32 -0
  242. package/dist/packages/better-stack/src/plugins/cms/client/components/loading/list-skeleton.mjs +30 -0
  243. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/404-page.cjs +20 -0
  244. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/404-page.mjs +18 -0
  245. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-editor-page.cjs +46 -0
  246. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-editor-page.internal.cjs +83 -0
  247. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-editor-page.internal.mjs +81 -0
  248. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-editor-page.mjs +44 -0
  249. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-list-page.cjs +43 -0
  250. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-list-page.internal.cjs +152 -0
  251. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-list-page.internal.mjs +150 -0
  252. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/content-list-page.mjs +41 -0
  253. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/dashboard-page.cjs +39 -0
  254. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/dashboard-page.internal.cjs +68 -0
  255. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/dashboard-page.internal.mjs +66 -0
  256. package/dist/packages/better-stack/src/plugins/cms/client/components/pages/dashboard-page.mjs +37 -0
  257. package/dist/packages/better-stack/src/plugins/cms/client/components/shared/default-error.cjs +17 -0
  258. package/dist/packages/better-stack/src/plugins/cms/client/components/shared/default-error.mjs +15 -0
  259. package/dist/packages/better-stack/src/plugins/cms/client/components/shared/empty-state.cjs +16 -0
  260. package/dist/packages/better-stack/src/plugins/cms/client/components/shared/empty-state.mjs +14 -0
  261. package/dist/packages/better-stack/src/plugins/cms/client/components/shared/page-wrapper.cjs +27 -0
  262. package/dist/packages/better-stack/src/plugins/cms/client/components/shared/page-wrapper.mjs +25 -0
  263. package/dist/packages/better-stack/src/plugins/cms/client/hooks/cms-hooks.cjs +402 -0
  264. package/dist/packages/better-stack/src/plugins/cms/client/hooks/cms-hooks.mjs +390 -0
  265. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-common.cjs +29 -0
  266. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-common.mjs +27 -0
  267. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-dashboard.cjs +13 -0
  268. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-dashboard.mjs +11 -0
  269. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-editor.cjs +12 -0
  270. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-editor.mjs +10 -0
  271. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-list.cjs +18 -0
  272. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-list.mjs +16 -0
  273. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-toasts.cjs +12 -0
  274. package/dist/packages/better-stack/src/plugins/cms/client/localization/cms-toasts.mjs +10 -0
  275. package/dist/packages/better-stack/src/plugins/cms/client/localization/index.cjs +17 -0
  276. package/dist/packages/better-stack/src/plugins/cms/client/localization/index.mjs +15 -0
  277. package/dist/packages/better-stack/src/plugins/cms/client/plugin.cjs +185 -0
  278. package/dist/packages/better-stack/src/plugins/cms/client/plugin.mjs +183 -0
  279. package/dist/packages/better-stack/src/plugins/cms/db.cjs +76 -0
  280. package/dist/packages/better-stack/src/plugins/cms/db.mjs +74 -0
  281. package/dist/packages/better-stack/src/plugins/cms/schemas.cjs +54 -0
  282. package/dist/packages/better-stack/src/plugins/cms/schemas.mjs +49 -0
  283. package/dist/packages/better-stack/src/plugins/cms/utils.cjs +15 -0
  284. package/dist/packages/better-stack/src/plugins/cms/utils.mjs +9 -0
  285. package/dist/packages/ui/src/components/calendar.cjs +205 -0
  286. package/dist/packages/ui/src/components/calendar.mjs +188 -0
  287. package/dist/packages/ui/src/components/checkbox.cjs +34 -0
  288. package/dist/packages/ui/src/components/checkbox.mjs +32 -0
  289. package/dist/packages/ui/src/components/date-picker.cjs +41 -0
  290. package/dist/packages/ui/src/components/date-picker.mjs +39 -0
  291. package/dist/packages/ui/src/components/form.mjs +1 -1
  292. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared → ui/src/components}/page-layout.cjs +2 -1
  293. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared → ui/src/components}/page-layout.mjs +2 -1
  294. package/dist/packages/ui/src/components/page-wrapper.cjs +20 -0
  295. package/dist/packages/ui/src/components/page-wrapper.mjs +18 -0
  296. package/dist/packages/ui/src/components/popover.cjs +41 -0
  297. package/dist/packages/ui/src/components/popover.mjs +37 -0
  298. package/dist/packages/ui/src/components/radio-group.cjs +48 -0
  299. package/dist/packages/ui/src/components/radio-group.mjs +45 -0
  300. package/dist/packages/ui/src/components/separator.cjs +29 -0
  301. package/dist/packages/ui/src/components/separator.mjs +27 -0
  302. package/dist/packages/ui/src/components/table.cjs +89 -0
  303. package/dist/packages/ui/src/components/table.mjs +82 -0
  304. package/dist/packages/ui/src/components/ui/auto-form/common/label.cjs +18 -0
  305. package/dist/packages/ui/src/components/ui/auto-form/common/label.mjs +16 -0
  306. package/dist/packages/ui/src/components/ui/auto-form/common/tooltip.cjs +9 -0
  307. package/dist/packages/ui/src/components/ui/auto-form/common/tooltip.mjs +7 -0
  308. package/dist/packages/ui/src/components/ui/auto-form/config.cjs +42 -0
  309. package/dist/packages/ui/src/components/ui/auto-form/config.mjs +39 -0
  310. package/dist/packages/ui/src/components/ui/auto-form/dependencies.cjs +48 -0
  311. package/dist/packages/ui/src/components/ui/auto-form/dependencies.mjs +46 -0
  312. package/dist/packages/ui/src/components/ui/auto-form/fields/array.cjs +103 -0
  313. package/dist/packages/ui/src/components/ui/auto-form/fields/array.mjs +87 -0
  314. package/dist/packages/ui/src/components/ui/auto-form/fields/checkbox.cjs +38 -0
  315. package/dist/packages/ui/src/components/ui/auto-form/fields/checkbox.mjs +36 -0
  316. package/dist/packages/ui/src/components/ui/auto-form/fields/date.cjs +37 -0
  317. package/dist/packages/ui/src/components/ui/auto-form/fields/date.mjs +35 -0
  318. package/dist/packages/ui/src/components/ui/auto-form/fields/enum.cjs +73 -0
  319. package/dist/packages/ui/src/components/ui/auto-form/fields/enum.mjs +71 -0
  320. package/dist/packages/ui/src/components/ui/auto-form/fields/file.cjs +63 -0
  321. package/dist/packages/ui/src/components/ui/auto-form/fields/file.mjs +61 -0
  322. package/dist/packages/ui/src/components/ui/auto-form/fields/input.cjs +32 -0
  323. package/dist/packages/ui/src/components/ui/auto-form/fields/input.mjs +30 -0
  324. package/dist/packages/ui/src/components/ui/auto-form/fields/number.cjs +31 -0
  325. package/dist/packages/ui/src/components/ui/auto-form/fields/number.mjs +29 -0
  326. package/dist/packages/ui/src/components/ui/auto-form/fields/object.cjs +149 -0
  327. package/dist/packages/ui/src/components/ui/auto-form/fields/object.mjs +133 -0
  328. package/dist/packages/ui/src/components/ui/auto-form/fields/radio-group.cjs +67 -0
  329. package/dist/packages/ui/src/components/ui/auto-form/fields/radio-group.mjs +65 -0
  330. package/dist/packages/ui/src/components/ui/auto-form/fields/switch.cjs +38 -0
  331. package/dist/packages/ui/src/components/ui/auto-form/fields/switch.mjs +36 -0
  332. package/dist/packages/ui/src/components/ui/auto-form/fields/textarea.cjs +31 -0
  333. package/dist/packages/ui/src/components/ui/auto-form/fields/textarea.mjs +29 -0
  334. package/dist/packages/ui/src/components/ui/auto-form/index.cjs +87 -0
  335. package/dist/packages/ui/src/components/ui/auto-form/index.mjs +78 -0
  336. package/dist/packages/ui/src/components/ui/auto-form/types.cjs +11 -0
  337. package/dist/packages/ui/src/components/ui/auto-form/types.mjs +9 -0
  338. package/dist/packages/ui/src/components/ui/auto-form/utils.cjs +179 -0
  339. package/dist/packages/ui/src/components/ui/auto-form/utils.mjs +169 -0
  340. package/dist/plugins/ai-chat/api/index.d.cts +1 -1
  341. package/dist/plugins/ai-chat/api/index.d.mts +1 -1
  342. package/dist/plugins/ai-chat/api/index.d.ts +1 -1
  343. package/dist/plugins/ai-chat/client/hooks/index.d.cts +1 -1
  344. package/dist/plugins/ai-chat/client/hooks/index.d.mts +1 -1
  345. package/dist/plugins/ai-chat/client/hooks/index.d.ts +1 -1
  346. package/dist/plugins/ai-chat/query-keys.d.cts +56 -250
  347. package/dist/plugins/ai-chat/query-keys.d.mts +56 -250
  348. package/dist/plugins/ai-chat/query-keys.d.ts +56 -250
  349. package/dist/plugins/blog/query-keys.d.cts +102 -362
  350. package/dist/plugins/blog/query-keys.d.mts +102 -362
  351. package/dist/plugins/blog/query-keys.d.ts +102 -362
  352. package/dist/plugins/cms/api/index.cjs +7 -0
  353. package/dist/plugins/cms/api/index.d.cts +101 -0
  354. package/dist/plugins/cms/api/index.d.mts +101 -0
  355. package/dist/plugins/cms/api/index.d.ts +101 -0
  356. package/dist/plugins/cms/api/index.mjs +1 -0
  357. package/dist/plugins/cms/client/components/index.cjs +14 -0
  358. package/dist/plugins/cms/client/components/index.d.cts +20 -0
  359. package/dist/plugins/cms/client/components/index.d.mts +20 -0
  360. package/dist/plugins/cms/client/components/index.d.ts +20 -0
  361. package/dist/plugins/cms/client/components/index.mjs +10 -0
  362. package/dist/plugins/cms/client/hooks/index.cjs +17 -0
  363. package/dist/plugins/cms/client/hooks/index.d.cts +203 -0
  364. package/dist/plugins/cms/client/hooks/index.d.mts +203 -0
  365. package/dist/plugins/cms/client/hooks/index.d.ts +203 -0
  366. package/dist/plugins/cms/client/hooks/index.mjs +1 -0
  367. package/dist/plugins/cms/client/index.cjs +9 -0
  368. package/dist/plugins/cms/client/index.d.cts +344 -0
  369. package/dist/plugins/cms/client/index.d.mts +344 -0
  370. package/dist/plugins/cms/client/index.d.ts +344 -0
  371. package/dist/plugins/cms/client/index.mjs +2 -0
  372. package/dist/plugins/cms/client.css +2 -0
  373. package/dist/plugins/cms/query-keys.cjs +137 -0
  374. package/dist/plugins/cms/query-keys.d.cts +79 -0
  375. package/dist/plugins/cms/query-keys.d.mts +79 -0
  376. package/dist/plugins/cms/query-keys.d.ts +79 -0
  377. package/dist/plugins/cms/query-keys.mjs +135 -0
  378. package/dist/plugins/cms/style.css +19 -0
  379. package/dist/shared/stack.BwkyFwF8.d.cts +135 -0
  380. package/dist/shared/stack.DBqxCs0V.d.mts +135 -0
  381. package/dist/shared/stack.DwnJA87a.d.ts +135 -0
  382. package/dist/shared/stack.NZJogTUn.d.cts +66 -0
  383. package/dist/shared/stack.NZJogTUn.d.mts +66 -0
  384. package/dist/shared/stack.NZJogTUn.d.ts +66 -0
  385. package/package.json +58 -5
  386. package/src/plugins/ai-chat/client/components/chat-interface.tsx +15 -0
  387. package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +4 -1
  388. package/src/plugins/blog/api/plugin.ts +29 -2
  389. package/src/plugins/blog/client/components/loading/form-page-skeleton.tsx +1 -1
  390. package/src/plugins/blog/client/components/loading/list-page-skeleton.tsx +1 -1
  391. package/src/plugins/blog/client/components/loading/post-page-skeleton.tsx +1 -1
  392. package/src/plugins/blog/client/components/shared/page-wrapper.tsx +9 -9
  393. package/src/plugins/cms/__tests__/schema-roundtrip.test.ts +611 -0
  394. package/src/plugins/cms/api/index.ts +1 -0
  395. package/src/plugins/cms/api/plugin.ts +611 -0
  396. package/src/plugins/cms/client/components/forms/content-form.tsx +477 -0
  397. package/src/plugins/cms/client/components/forms/file-upload.tsx +164 -0
  398. package/src/plugins/cms/client/components/index.tsx +10 -0
  399. package/src/plugins/cms/client/components/loading/dashboard-skeleton.tsx +22 -0
  400. package/src/plugins/cms/client/components/loading/editor-skeleton.tsx +35 -0
  401. package/src/plugins/cms/client/components/loading/index.tsx +3 -0
  402. package/src/plugins/cms/client/components/loading/list-skeleton.tsx +38 -0
  403. package/src/plugins/cms/client/components/pages/404-page.tsx +27 -0
  404. package/src/plugins/cms/client/components/pages/content-editor-page.internal.tsx +121 -0
  405. package/src/plugins/cms/client/components/pages/content-editor-page.tsx +50 -0
  406. package/src/plugins/cms/client/components/pages/content-list-page.internal.tsx +198 -0
  407. package/src/plugins/cms/client/components/pages/content-list-page.tsx +45 -0
  408. package/src/plugins/cms/client/components/pages/dashboard-page.internal.tsx +94 -0
  409. package/src/plugins/cms/client/components/pages/dashboard-page.tsx +37 -0
  410. package/src/plugins/cms/client/components/shared/default-error.tsx +30 -0
  411. package/src/plugins/cms/client/components/shared/empty-state.tsx +26 -0
  412. package/src/plugins/cms/client/components/shared/page-wrapper.tsx +32 -0
  413. package/src/plugins/cms/client/components/shared/pagination.tsx +72 -0
  414. package/src/plugins/cms/client/hooks/cms-hooks.tsx +724 -0
  415. package/src/plugins/cms/client/hooks/index.tsx +1 -0
  416. package/src/plugins/cms/client/index.ts +13 -0
  417. package/src/plugins/cms/client/localization/cms-common.ts +29 -0
  418. package/src/plugins/cms/client/localization/cms-dashboard.ts +10 -0
  419. package/src/plugins/cms/client/localization/cms-editor.ts +8 -0
  420. package/src/plugins/cms/client/localization/cms-list.ts +14 -0
  421. package/src/plugins/cms/client/localization/cms-toasts.ts +8 -0
  422. package/src/plugins/cms/client/localization/index.ts +15 -0
  423. package/src/plugins/cms/client/overrides.ts +166 -0
  424. package/src/plugins/cms/client/plugin.tsx +283 -0
  425. package/src/plugins/cms/client.css +2 -0
  426. package/src/plugins/cms/db.ts +76 -0
  427. package/src/plugins/cms/query-keys.ts +186 -0
  428. package/src/plugins/cms/schemas.ts +81 -0
  429. package/src/plugins/cms/style.css +19 -0
  430. package/src/plugins/cms/types.ts +220 -0
  431. package/src/plugins/cms/utils.ts +11 -0
  432. package/src/plugins/blog/client/components/shared/page-layout.tsx +0 -23
@@ -0,0 +1,724 @@
1
+ "use client";
2
+
3
+ import {
4
+ useQuery,
5
+ useMutation,
6
+ useQueryClient,
7
+ useSuspenseQuery,
8
+ useInfiniteQuery,
9
+ useSuspenseInfiniteQuery,
10
+ type InfiniteData,
11
+ } from "@tanstack/react-query";
12
+ import { createApiClient } from "@btst/stack/plugins/client";
13
+ import { usePluginOverrides } from "@btst/stack/context";
14
+ import type { CMSApiRouter } from "../../api";
15
+ import type {
16
+ SerializedContentType,
17
+ SerializedContentItemWithType,
18
+ PaginatedContentItems,
19
+ } from "../../types";
20
+ import type { CMSPluginOverrides } from "../overrides";
21
+ import { createCMSQueryKeys } from "../../query-keys";
22
+
23
+ // Type guard for better-call error responses
24
+ function isErrorResponse(
25
+ response: unknown,
26
+ ): response is { error: unknown; data?: never } {
27
+ if (typeof response !== "object" || response === null) {
28
+ return false;
29
+ }
30
+ const obj = response as Record<string, unknown>;
31
+ return "error" in obj && obj.error !== null && obj.error !== undefined;
32
+ }
33
+
34
+ // Helper to convert error to a proper Error object with meaningful message
35
+ function toError(error: unknown): Error {
36
+ if (error instanceof Error) {
37
+ return error;
38
+ }
39
+
40
+ if (typeof error === "object" && error !== null) {
41
+ const errorObj = error as Record<string, unknown>;
42
+ const message =
43
+ (typeof errorObj.message === "string" ? errorObj.message : null) ||
44
+ (typeof errorObj.error === "string" ? errorObj.error : null) ||
45
+ JSON.stringify(error);
46
+
47
+ const err = new Error(message);
48
+ Object.assign(err, error);
49
+ return err;
50
+ }
51
+
52
+ return new Error(String(error));
53
+ }
54
+
55
+ /**
56
+ * Shared React Query configuration for all CMS queries
57
+ * Prevents automatic refetching to avoid hydration mismatches in SSR
58
+ */
59
+ const SHARED_QUERY_CONFIG = {
60
+ retry: false,
61
+ refetchOnWindowFocus: false,
62
+ refetchOnMount: false,
63
+ refetchOnReconnect: false,
64
+ staleTime: 1000 * 60 * 5, // 5 minutes
65
+ gcTime: 1000 * 60 * 10, // 10 minutes
66
+ } as const;
67
+
68
+ // ========== Content Types Hooks ==========
69
+
70
+ export interface UseContentTypesResult {
71
+ contentTypes: (SerializedContentType & { itemCount: number })[];
72
+ isLoading: boolean;
73
+ error: Error | null;
74
+ refetch: () => void;
75
+ }
76
+
77
+ /**
78
+ * Hook for fetching all content types
79
+ */
80
+ export function useContentTypes(): UseContentTypesResult {
81
+ const { apiBaseURL, apiBasePath, headers } =
82
+ usePluginOverrides<CMSPluginOverrides>("cms");
83
+ const client = createApiClient<CMSApiRouter>({
84
+ baseURL: apiBaseURL,
85
+ basePath: apiBasePath,
86
+ });
87
+ const queries = createCMSQueryKeys(client, headers);
88
+ const baseQuery = queries.cmsTypes.list();
89
+
90
+ const { data, isLoading, error, refetch } = useQuery({
91
+ ...baseQuery,
92
+ ...SHARED_QUERY_CONFIG,
93
+ });
94
+
95
+ return {
96
+ contentTypes: data ?? [],
97
+ isLoading,
98
+ error,
99
+ refetch,
100
+ };
101
+ }
102
+
103
+ /**
104
+ * Suspense variant of useContentTypes
105
+ */
106
+ export function useSuspenseContentTypes(): {
107
+ contentTypes: (SerializedContentType & { itemCount: number })[];
108
+ refetch: () => Promise<unknown>;
109
+ } {
110
+ const { apiBaseURL, apiBasePath, headers } =
111
+ usePluginOverrides<CMSPluginOverrides>("cms");
112
+ const client = createApiClient<CMSApiRouter>({
113
+ baseURL: apiBaseURL,
114
+ basePath: apiBasePath,
115
+ });
116
+ const queries = createCMSQueryKeys(client, headers);
117
+ const baseQuery = queries.cmsTypes.list();
118
+
119
+ const { data, refetch, error, isFetching } = useSuspenseQuery({
120
+ ...baseQuery,
121
+ ...SHARED_QUERY_CONFIG,
122
+ });
123
+
124
+ if (error && !isFetching) {
125
+ throw error;
126
+ }
127
+
128
+ return {
129
+ contentTypes: data ?? [],
130
+ refetch,
131
+ };
132
+ }
133
+
134
+ /**
135
+ * Hook for fetching a single content type by slug
136
+ */
137
+ export function useContentType(slug: string): {
138
+ contentType: SerializedContentType | null;
139
+ isLoading: boolean;
140
+ error: Error | null;
141
+ refetch: () => void;
142
+ } {
143
+ const { apiBaseURL, apiBasePath, headers } =
144
+ usePluginOverrides<CMSPluginOverrides>("cms");
145
+ const client = createApiClient<CMSApiRouter>({
146
+ baseURL: apiBaseURL,
147
+ basePath: apiBasePath,
148
+ });
149
+ const queries = createCMSQueryKeys(client, headers);
150
+ const baseQuery = queries.cmsTypes.detail(slug);
151
+
152
+ const { data, isLoading, error, refetch } = useQuery({
153
+ ...baseQuery,
154
+ ...SHARED_QUERY_CONFIG,
155
+ enabled: !!slug,
156
+ });
157
+
158
+ return {
159
+ contentType: data ?? null,
160
+ isLoading,
161
+ error,
162
+ refetch,
163
+ };
164
+ }
165
+
166
+ // ========== Content Items Hooks ==========
167
+
168
+ export interface UseContentOptions {
169
+ /** Number of items per page (default: 10) */
170
+ limit?: number;
171
+ /** Whether to enable the query (default: true) */
172
+ enabled?: boolean;
173
+ }
174
+
175
+ /**
176
+ * Result type for useContent hook with load more functionality
177
+ * @template TData - The type of parsedData (defaults to Record<string, unknown>)
178
+ */
179
+ export interface UseContentResult<TData = Record<string, unknown>> {
180
+ /** Array of all loaded content items */
181
+ items: SerializedContentItemWithType<TData>[];
182
+ /** Total number of items available */
183
+ total: number;
184
+ /** Whether the initial load is in progress */
185
+ isLoading: boolean;
186
+ /** Error if the query failed */
187
+ error: Error | null;
188
+ /** Function to load the next page of items */
189
+ loadMore: () => void;
190
+ /** Whether there are more items to load */
191
+ hasMore: boolean;
192
+ /** Whether the next page is being loaded */
193
+ isLoadingMore: boolean;
194
+ /** Function to refetch all items */
195
+ refetch: () => void;
196
+ }
197
+
198
+ /**
199
+ * Hook for fetching paginated content items with load more functionality.
200
+ * Uses React Query's infinite query for efficient pagination.
201
+ *
202
+ * @template TMap - A type map of content type slugs to their data types
203
+ * @template TSlug - The content type slug (inferred from typeSlug parameter)
204
+ *
205
+ * @example
206
+ * ```typescript
207
+ * // Without type safety (backward compatible)
208
+ * const { items, loadMore, hasMore, isLoadingMore } = useContent("product")
209
+ *
210
+ * // With type safety using a type map
211
+ * type MyCMSTypes = {
212
+ * product: { name: string; price: number }
213
+ * testimonial: { author: string; quote: string }
214
+ * }
215
+ * const { items, loadMore, hasMore } = useContent<MyCMSTypes, "product">("product")
216
+ * // items[0].parsedData.name is string
217
+ * // items[0].parsedData.price is number
218
+ * ```
219
+ */
220
+ export function useContent<
221
+ TMap extends Record<string, Record<string, unknown>> = Record<
222
+ string,
223
+ Record<string, unknown>
224
+ >,
225
+ TSlug extends keyof TMap = keyof TMap,
226
+ >(
227
+ typeSlug: TSlug & string,
228
+ options: UseContentOptions = {},
229
+ ): UseContentResult<TMap[TSlug]> {
230
+ const { apiBaseURL, apiBasePath, headers } =
231
+ usePluginOverrides<CMSPluginOverrides>("cms");
232
+ const client = createApiClient<CMSApiRouter>({
233
+ baseURL: apiBaseURL,
234
+ basePath: apiBasePath,
235
+ });
236
+ const queries = createCMSQueryKeys(client, headers);
237
+ const { limit = 10, enabled = true } = options;
238
+
239
+ const baseQuery = queries.cmsContent.list({ typeSlug, limit, offset: 0 });
240
+
241
+ const {
242
+ data,
243
+ isLoading,
244
+ error,
245
+ fetchNextPage,
246
+ hasNextPage,
247
+ isFetchingNextPage,
248
+ refetch,
249
+ } = useInfiniteQuery({
250
+ queryKey: baseQuery.queryKey,
251
+ queryFn: async ({ pageParam = 0 }) => {
252
+ const response: unknown = await client("/content/:typeSlug", {
253
+ method: "GET",
254
+ params: { typeSlug },
255
+ query: { limit, offset: pageParam },
256
+ headers,
257
+ });
258
+ if (isErrorResponse(response)) {
259
+ throw toError(response.error);
260
+ }
261
+ return (response as { data?: unknown }).data as PaginatedContentItems<
262
+ TMap[TSlug]
263
+ >;
264
+ },
265
+ ...SHARED_QUERY_CONFIG,
266
+ initialPageParam: 0,
267
+ getNextPageParam: (lastPage, allPages) => {
268
+ // Defensive check: ensure lastPage exists and has expected structure
269
+ if (!lastPage || typeof lastPage !== "object") return undefined;
270
+ const items = (lastPage as PaginatedContentItems)?.items;
271
+ // If no items or fewer items than limit, we've reached the end
272
+ if (!Array.isArray(items) || items.length < limit) return undefined;
273
+ // Calculate total items loaded so far
274
+ const loadedCount = (allPages || []).reduce(
275
+ (sum, page) =>
276
+ sum +
277
+ (Array.isArray((page as PaginatedContentItems)?.items)
278
+ ? (page as PaginatedContentItems).items.length
279
+ : 0),
280
+ 0,
281
+ );
282
+ const total = (lastPage as PaginatedContentItems)?.total ?? 0;
283
+ // Check if we've loaded all items
284
+ if (loadedCount >= total) return undefined;
285
+ return loadedCount;
286
+ },
287
+ enabled: enabled && !!typeSlug,
288
+ });
289
+
290
+ const pages = (
291
+ data as InfiniteData<PaginatedContentItems<TMap[TSlug]>, number> | undefined
292
+ )?.pages;
293
+ const items = (pages?.flatMap((page) =>
294
+ Array.isArray(page?.items) ? page.items : [],
295
+ ) ?? []) as SerializedContentItemWithType<TMap[TSlug]>[];
296
+ const total = pages?.[0]?.total ?? 0;
297
+
298
+ return {
299
+ items,
300
+ total,
301
+ isLoading,
302
+ error,
303
+ loadMore: fetchNextPage,
304
+ hasMore: !!hasNextPage,
305
+ isLoadingMore: isFetchingNextPage,
306
+ refetch,
307
+ };
308
+ }
309
+
310
+ /**
311
+ * Suspense variant of useContent with load more functionality.
312
+ *
313
+ * @template TMap - A type map of content type slugs to their data types
314
+ * @template TSlug - The content type slug (inferred from typeSlug parameter)
315
+ */
316
+ export function useSuspenseContent<
317
+ TMap extends Record<string, Record<string, unknown>> = Record<
318
+ string,
319
+ Record<string, unknown>
320
+ >,
321
+ TSlug extends keyof TMap = keyof TMap,
322
+ >(
323
+ typeSlug: TSlug & string,
324
+ options: UseContentOptions = {},
325
+ ): {
326
+ items: SerializedContentItemWithType<TMap[TSlug]>[];
327
+ total: number;
328
+ loadMore: () => Promise<unknown>;
329
+ hasMore: boolean;
330
+ isLoadingMore: boolean;
331
+ refetch: () => Promise<unknown>;
332
+ } {
333
+ const { apiBaseURL, apiBasePath, headers } =
334
+ usePluginOverrides<CMSPluginOverrides>("cms");
335
+ const client = createApiClient<CMSApiRouter>({
336
+ baseURL: apiBaseURL,
337
+ basePath: apiBasePath,
338
+ });
339
+ const queries = createCMSQueryKeys(client, headers);
340
+ const { limit = 10 } = options;
341
+
342
+ const baseQuery = queries.cmsContent.list({ typeSlug, limit, offset: 0 });
343
+
344
+ const {
345
+ data,
346
+ fetchNextPage,
347
+ hasNextPage,
348
+ isFetchingNextPage,
349
+ refetch,
350
+ error,
351
+ isFetching,
352
+ } = useSuspenseInfiniteQuery({
353
+ queryKey: baseQuery.queryKey,
354
+ queryFn: async ({ pageParam = 0 }) => {
355
+ const response: unknown = await client("/content/:typeSlug", {
356
+ method: "GET",
357
+ params: { typeSlug },
358
+ query: { limit, offset: pageParam },
359
+ headers,
360
+ });
361
+ if (isErrorResponse(response)) {
362
+ throw toError(response.error);
363
+ }
364
+ return (response as { data?: unknown }).data as PaginatedContentItems<
365
+ TMap[TSlug]
366
+ >;
367
+ },
368
+ ...SHARED_QUERY_CONFIG,
369
+ initialPageParam: 0,
370
+ getNextPageParam: (lastPage, allPages) => {
371
+ // Defensive check: ensure lastPage exists and has expected structure
372
+ if (!lastPage || typeof lastPage !== "object") return undefined;
373
+ const items = (lastPage as PaginatedContentItems)?.items;
374
+ // If no items or fewer items than limit, we've reached the end
375
+ if (!Array.isArray(items) || items.length < limit) return undefined;
376
+ // Calculate total items loaded so far
377
+ const loadedCount = (allPages || []).reduce(
378
+ (sum, page) =>
379
+ sum +
380
+ (Array.isArray((page as PaginatedContentItems)?.items)
381
+ ? (page as PaginatedContentItems).items.length
382
+ : 0),
383
+ 0,
384
+ );
385
+ const total = (lastPage as PaginatedContentItems)?.total ?? 0;
386
+ // Check if we've loaded all items
387
+ if (loadedCount >= total) return undefined;
388
+ return loadedCount;
389
+ },
390
+ });
391
+
392
+ // Manually throw errors for Error Boundaries (per React Query Suspense docs)
393
+ if (error && !isFetching) {
394
+ throw error;
395
+ }
396
+
397
+ const pages = data.pages as PaginatedContentItems<TMap[TSlug]>[];
398
+ const items = (pages?.flatMap((page) =>
399
+ Array.isArray(page?.items) ? page.items : [],
400
+ ) ?? []) as SerializedContentItemWithType<TMap[TSlug]>[];
401
+ const total = pages?.[0]?.total ?? 0;
402
+
403
+ return {
404
+ items,
405
+ total,
406
+ loadMore: fetchNextPage,
407
+ hasMore: !!hasNextPage,
408
+ isLoadingMore: isFetchingNextPage,
409
+ refetch,
410
+ };
411
+ }
412
+
413
+ /**
414
+ * Hook for fetching a single content item by ID with optional type safety.
415
+ *
416
+ * @template TMap - A type map of content type slugs to their data types
417
+ * @template TSlug - The content type slug (inferred from typeSlug parameter)
418
+ *
419
+ * @example
420
+ * ```typescript
421
+ * type MyCMSTypes = { product: { name: string; price: number } }
422
+ * const { item } = useContentItem<MyCMSTypes, "product">("product", "some-id")
423
+ * // item?.parsedData.name is string
424
+ * ```
425
+ */
426
+ export function useContentItem<
427
+ TMap extends Record<string, Record<string, unknown>> = Record<
428
+ string,
429
+ Record<string, unknown>
430
+ >,
431
+ TSlug extends keyof TMap = keyof TMap,
432
+ >(
433
+ typeSlug: TSlug & string,
434
+ id: string,
435
+ ): {
436
+ item: SerializedContentItemWithType<TMap[TSlug]> | null;
437
+ isLoading: boolean;
438
+ error: Error | null;
439
+ refetch: () => void;
440
+ } {
441
+ const { apiBaseURL, apiBasePath, headers } =
442
+ usePluginOverrides<CMSPluginOverrides>("cms");
443
+ const client = createApiClient<CMSApiRouter>({
444
+ baseURL: apiBaseURL,
445
+ basePath: apiBasePath,
446
+ });
447
+ const queries = createCMSQueryKeys(client, headers);
448
+ const baseQuery = queries.cmsContent.detail(typeSlug, id);
449
+
450
+ const { data, isLoading, error, refetch } = useQuery({
451
+ ...baseQuery,
452
+ ...SHARED_QUERY_CONFIG,
453
+ enabled: !!typeSlug && !!id,
454
+ });
455
+
456
+ return {
457
+ item: (data as SerializedContentItemWithType<TMap[TSlug]>) ?? null,
458
+ isLoading,
459
+ error,
460
+ refetch,
461
+ };
462
+ }
463
+
464
+ /**
465
+ * Suspense variant of useContentItem with optional type safety.
466
+ *
467
+ * @template TMap - A type map of content type slugs to their data types
468
+ * @template TSlug - The content type slug (inferred from typeSlug parameter)
469
+ */
470
+ export function useSuspenseContentItem<
471
+ TMap extends Record<string, Record<string, unknown>> = Record<
472
+ string,
473
+ Record<string, unknown>
474
+ >,
475
+ TSlug extends keyof TMap = keyof TMap,
476
+ >(
477
+ typeSlug: TSlug & string,
478
+ id: string,
479
+ ): {
480
+ item: SerializedContentItemWithType<TMap[TSlug]> | null;
481
+ refetch: () => Promise<unknown>;
482
+ } {
483
+ const { apiBaseURL, apiBasePath, headers } =
484
+ usePluginOverrides<CMSPluginOverrides>("cms");
485
+ const client = createApiClient<CMSApiRouter>({
486
+ baseURL: apiBaseURL,
487
+ basePath: apiBasePath,
488
+ });
489
+ const queries = createCMSQueryKeys(client, headers);
490
+ const baseQuery = queries.cmsContent.detail(typeSlug, id);
491
+
492
+ const { data, refetch, error, isFetching } = useSuspenseQuery({
493
+ ...baseQuery,
494
+ ...SHARED_QUERY_CONFIG,
495
+ });
496
+
497
+ if (error && !isFetching) {
498
+ throw error;
499
+ }
500
+
501
+ return {
502
+ item: (data as SerializedContentItemWithType<TMap[TSlug]>) ?? null,
503
+ refetch,
504
+ };
505
+ }
506
+
507
+ /**
508
+ * Hook for fetching a content item by slug with optional type safety.
509
+ *
510
+ * @template TMap - A type map of content type slugs to their data types
511
+ * @template TSlug - The content type slug (inferred from typeSlug parameter)
512
+ *
513
+ * @example
514
+ * ```typescript
515
+ * type MyCMSTypes = { product: { name: string; price: number } }
516
+ * const { item } = useContentItemBySlug<MyCMSTypes, "product">("product", "my-product")
517
+ * // item?.parsedData.price is number
518
+ * ```
519
+ */
520
+ export function useContentItemBySlug<
521
+ TMap extends Record<string, Record<string, unknown>> = Record<
522
+ string,
523
+ Record<string, unknown>
524
+ >,
525
+ TSlug extends keyof TMap = keyof TMap,
526
+ >(
527
+ typeSlug: TSlug & string,
528
+ slug: string,
529
+ ): {
530
+ item: SerializedContentItemWithType<TMap[TSlug]> | null;
531
+ isLoading: boolean;
532
+ error: Error | null;
533
+ refetch: () => void;
534
+ } {
535
+ const { apiBaseURL, apiBasePath, headers } =
536
+ usePluginOverrides<CMSPluginOverrides>("cms");
537
+ const client = createApiClient<CMSApiRouter>({
538
+ baseURL: apiBaseURL,
539
+ basePath: apiBasePath,
540
+ });
541
+ const queries = createCMSQueryKeys(client, headers);
542
+ const baseQuery = queries.cmsContent.bySlug(typeSlug, slug);
543
+
544
+ const { data, isLoading, error, refetch } = useQuery({
545
+ ...baseQuery,
546
+ ...SHARED_QUERY_CONFIG,
547
+ enabled: !!typeSlug && !!slug,
548
+ });
549
+
550
+ return {
551
+ item: (data as SerializedContentItemWithType<TMap[TSlug]>) ?? null,
552
+ isLoading,
553
+ error,
554
+ refetch,
555
+ };
556
+ }
557
+
558
+ // ========== Mutation Hooks ==========
559
+
560
+ /**
561
+ * Hook for creating a content item with optional type safety.
562
+ *
563
+ * @template TData - The type of the content data (defaults to Record<string, unknown>)
564
+ *
565
+ * @example
566
+ * ```typescript
567
+ * type ProductData = { name: string; price: number }
568
+ * const createProduct = useCreateContent<ProductData>("product")
569
+ *
570
+ * // TypeScript will enforce the correct shape
571
+ * createProduct.mutate({
572
+ * slug: "my-product",
573
+ * data: { name: "Widget", price: 29.99 }
574
+ * })
575
+ * ```
576
+ */
577
+ export function useCreateContent<TData = Record<string, unknown>>(
578
+ typeSlug: string,
579
+ ) {
580
+ const { refresh, apiBaseURL, apiBasePath, headers } =
581
+ usePluginOverrides<CMSPluginOverrides>("cms");
582
+ const client = createApiClient<CMSApiRouter>({
583
+ baseURL: apiBaseURL,
584
+ basePath: apiBasePath,
585
+ });
586
+ const queryClient = useQueryClient();
587
+ const queries = createCMSQueryKeys(client, headers);
588
+
589
+ return useMutation<
590
+ SerializedContentItemWithType<TData>,
591
+ Error,
592
+ { slug: string; data: TData }
593
+ >({
594
+ mutationKey: [...queries.cmsContent._def, typeSlug, "create"],
595
+ mutationFn: async (data) => {
596
+ const response: unknown = await client("@post/content/:typeSlug", {
597
+ method: "POST",
598
+ params: { typeSlug },
599
+ body: data as { slug: string; data: Record<string, unknown> },
600
+ headers,
601
+ });
602
+ if (isErrorResponse(response)) {
603
+ throw toError(response.error);
604
+ }
605
+ return (response as { data?: unknown })
606
+ .data as SerializedContentItemWithType<TData>;
607
+ },
608
+ onSuccess: async () => {
609
+ await queryClient.invalidateQueries({
610
+ queryKey: queries.cmsContent.list._def,
611
+ });
612
+ await queryClient.invalidateQueries({
613
+ queryKey: queries.cmsTypes.list._def,
614
+ });
615
+ if (refresh) {
616
+ await refresh();
617
+ }
618
+ },
619
+ });
620
+ }
621
+
622
+ /**
623
+ * Hook for updating a content item with optional type safety.
624
+ *
625
+ * @template TData - The type of the content data (defaults to Record<string, unknown>)
626
+ *
627
+ * @example
628
+ * ```typescript
629
+ * type ProductData = { name: string; price: number }
630
+ * const updateProduct = useUpdateContent<ProductData>("product")
631
+ *
632
+ * updateProduct.mutate({
633
+ * id: "item-id",
634
+ * data: { data: { name: "Updated Widget", price: 39.99 } }
635
+ * })
636
+ * ```
637
+ */
638
+ export function useUpdateContent<TData = Record<string, unknown>>(
639
+ typeSlug: string,
640
+ ) {
641
+ const { refresh, apiBaseURL, apiBasePath, headers } =
642
+ usePluginOverrides<CMSPluginOverrides>("cms");
643
+ const client = createApiClient<CMSApiRouter>({
644
+ baseURL: apiBaseURL,
645
+ basePath: apiBasePath,
646
+ });
647
+ const queryClient = useQueryClient();
648
+ const queries = createCMSQueryKeys(client, headers);
649
+
650
+ return useMutation<
651
+ SerializedContentItemWithType<TData>,
652
+ Error,
653
+ { id: string; data: { slug?: string; data?: TData } }
654
+ >({
655
+ mutationKey: [...queries.cmsContent._def, typeSlug, "update"],
656
+ mutationFn: async ({ id, data }) => {
657
+ const response: unknown = await client("@put/content/:typeSlug/:id", {
658
+ method: "PUT",
659
+ params: { typeSlug, id },
660
+ body: data as { slug?: string; data?: Record<string, unknown> },
661
+ headers,
662
+ });
663
+ if (isErrorResponse(response)) {
664
+ throw toError(response.error);
665
+ }
666
+ return (response as { data?: unknown })
667
+ .data as SerializedContentItemWithType<TData>;
668
+ },
669
+ onSuccess: async (updated) => {
670
+ if (updated) {
671
+ queryClient.setQueryData(
672
+ queries.cmsContent.detail(typeSlug, updated.id).queryKey,
673
+ updated,
674
+ );
675
+ }
676
+ await queryClient.invalidateQueries({
677
+ queryKey: queries.cmsContent.list._def,
678
+ });
679
+ if (refresh) {
680
+ await refresh();
681
+ }
682
+ },
683
+ });
684
+ }
685
+
686
+ /**
687
+ * Hook for deleting a content item
688
+ */
689
+ export function useDeleteContent(typeSlug: string) {
690
+ const { refresh, apiBaseURL, apiBasePath, headers } =
691
+ usePluginOverrides<CMSPluginOverrides>("cms");
692
+ const client = createApiClient<CMSApiRouter>({
693
+ baseURL: apiBaseURL,
694
+ basePath: apiBasePath,
695
+ });
696
+ const queryClient = useQueryClient();
697
+ const queries = createCMSQueryKeys(client, headers);
698
+
699
+ return useMutation<{ success: boolean }, Error, string>({
700
+ mutationKey: [...queries.cmsContent._def, typeSlug, "delete"],
701
+ mutationFn: async (id) => {
702
+ const response: unknown = await client("@delete/content/:typeSlug/:id", {
703
+ method: "DELETE",
704
+ params: { typeSlug, id },
705
+ headers,
706
+ });
707
+ if (isErrorResponse(response)) {
708
+ throw toError(response.error);
709
+ }
710
+ return (response as { data?: unknown }).data as { success: boolean };
711
+ },
712
+ onSuccess: async () => {
713
+ await queryClient.invalidateQueries({
714
+ queryKey: queries.cmsContent._def,
715
+ });
716
+ await queryClient.invalidateQueries({
717
+ queryKey: queries.cmsTypes.list._def,
718
+ });
719
+ if (refresh) {
720
+ await refresh();
721
+ }
722
+ },
723
+ });
724
+ }
@@ -0,0 +1 @@
1
+ export * from "./cms-hooks";