@btst/stack 1.3.0 → 1.4.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 (241) hide show
  1. package/README.md +85 -37
  2. package/dist/node_modules/.pnpm/{@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384 → @radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_4f58c757aa677e233cf96d60fda2f1da}/node_modules/@radix-ui/react-alert-dialog/dist/index.cjs +2 -2
  3. package/dist/node_modules/.pnpm/{@radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.2_@types_react@19.2.2__@types_ec789942cd38340bd7362c09e7d34384 → @radix-ui_react-alert-dialog@1.1.15_@types_react-dom@19.2.3_@types_react@19.2.6__@types_4f58c757aa677e233cf96d60fda2f1da}/node_modules/@radix-ui/react-alert-dialog/dist/index.mjs +2 -2
  4. package/dist/node_modules/.pnpm/{@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@1_9e04309f365863673e44407648bb0cb6 → @radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_35df44f6d87656c1401686c91d770dbb}/node_modules/@radix-ui/react-arrow/dist/index.cjs +1 -1
  5. package/dist/node_modules/.pnpm/{@radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@1_9e04309f365863673e44407648bb0cb6 → @radix-ui_react-arrow@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_35df44f6d87656c1401686c91d770dbb}/node_modules/@radix-ui/react-arrow/dist/index.mjs +1 -1
  6. package/dist/node_modules/.pnpm/{@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_re_6d7c277722b3619c9ee7e64e9a822c45 → @radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5}/node_modules/@radix-ui/react-collection/dist/index.cjs +2 -2
  7. package/dist/node_modules/.pnpm/{@radix-ui_react-collection@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_re_6d7c277722b3619c9ee7e64e9a822c45 → @radix-ui_react-collection@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_re_59aa5e150e70a3e7bfb1567148b021b5}/node_modules/@radix-ui/react-collection/dist/index.mjs +2 -2
  8. package/dist/node_modules/.pnpm/{@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.2_@types_react@19.2.2__@_ca5522e5d45d4722cb9eb5ce53defa61 → @radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad}/node_modules/@radix-ui/react-dismissable-layer/dist/index.cjs +4 -4
  9. package/dist/node_modules/.pnpm/{@radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.2_@types_react@19.2.2__@_ca5522e5d45d4722cb9eb5ce53defa61 → @radix-ui_react-dismissable-layer@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@_9ee1db7daf927866cf505b31d40047ad}/node_modules/@radix-ui/react-dismissable-layer/dist/index.mjs +4 -4
  10. package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@type_a50051c7210b6fbd5be09388bda08578/node_modules/@radix-ui/react-dropdown-menu/dist/index.cjs +282 -0
  11. package/dist/node_modules/.pnpm/@radix-ui_react-dropdown-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@type_a50051c7210b6fbd5be09388bda08578/node_modules/@radix-ui/react-dropdown-menu/dist/index.mjs +247 -0
  12. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_r_93de389b3f622f9f764acc8e59ec80c0 → @radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9}/node_modules/@radix-ui/react-focus-scope/dist/index.cjs +3 -3
  13. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.2_@types_react@19.2.2__@types_r_93de389b3f622f9f764acc8e59ec80c0 → @radix-ui_react-focus-scope@1.1.7_@types_react-dom@19.2.3_@types_react@19.2.6__@types_r_0a31b7f987af9482d13505312e1a1be9}/node_modules/@radix-ui/react-focus-scope/dist/index.mjs +3 -3
  14. package/dist/node_modules/.pnpm/{@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-id/dist/index.cjs +1 -1
  15. package/dist/node_modules/.pnpm/{@radix-ui_react-id@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-id@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-id/dist/index.mjs +1 -1
  16. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_82ed1fcd848b6984d9291a784d477cf4/node_modules/@radix-ui/react-menu/dist/index.cjs +845 -0
  17. package/dist/node_modules/.pnpm/@radix-ui_react-menu@2.1.16_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@1_82ed1fcd848b6984d9291a784d477cf4/node_modules/@radix-ui/react-menu/dist/index.mjs +799 -0
  18. package/dist/node_modules/.pnpm/{@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_d6285b8269ea5d6b59b300f5be279a0c → @radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161}/node_modules/@radix-ui/react-popper/dist/index.cjs +7 -7
  19. package/dist/node_modules/.pnpm/{@radix-ui_react-popper@1.2.8_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_d6285b8269ea5d6b59b300f5be279a0c → @radix-ui_react-popper@1.2.8_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_7ac2caae1e39f9ba93d5015614525161}/node_modules/@radix-ui/react-popper/dist/index.mjs +7 -7
  20. package/dist/node_modules/.pnpm/{@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_478b3d5dd4afab1a3dcce7ed1748cb95 → @radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9}/node_modules/@radix-ui/react-portal/dist/index.cjs +2 -2
  21. package/dist/node_modules/.pnpm/{@radix-ui_react-portal@1.1.9_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_478b3d5dd4afab1a3dcce7ed1748cb95 → @radix-ui_react-portal@1.1.9_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_1bb4e0f97f86496802d28a2e74e2a8b9}/node_modules/@radix-ui/react-portal/dist/index.mjs +2 -2
  22. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.cjs +147 -0
  23. package/dist/node_modules/.pnpm/@radix-ui_react-presence@1.1.5_@types_react-dom@19.2.3_@types_react@19.2.6__@types_reac_90f8e5c12233caef3399d5fd66452a13/node_modules/@radix-ui/react-presence/dist/index.mjs +131 -0
  24. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.cjs +244 -0
  25. package/dist/node_modules/.pnpm/@radix-ui_react-roving-focus@1.1.11_@types_react-dom@19.2.3_@types_react@19.2.6__@types_fe1151d1f393bbc1072b24a86dff3a23/node_modules/@radix-ui/react-roving-focus/dist/index.mjs +224 -0
  26. package/dist/node_modules/.pnpm/@radix-ui_react-scroll-area@1.2.10_@types_react-dom@19.2.3_@types_react@19.2.6__@types__e3f7735e9b444a10b3bbfd9fe97d44d0/node_modules/@radix-ui/react-scroll-area/dist/index.cjs +742 -0
  27. package/dist/node_modules/.pnpm/@radix-ui_react-scroll-area@1.2.10_@types_react-dom@19.2.3_@types_react@19.2.6__@types__e3f7735e9b444a10b3bbfd9fe97d44d0/node_modules/@radix-ui/react-scroll-area/dist/index.mjs +719 -0
  28. package/dist/node_modules/.pnpm/{@radix-ui_react-select@2.2.6_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_802c3d414c85063bee785fcc98a39c07 → @radix-ui_react-select@2.2.6_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_38dc681bb1f2bcfeb5249d8ca2bc01f5}/node_modules/@radix-ui/react-select/dist/index.cjs +17 -17
  29. package/dist/node_modules/.pnpm/{@radix-ui_react-select@2.2.6_@types_react-dom@19.2.2_@types_react@19.2.2__@types_react@_802c3d414c85063bee785fcc98a39c07 → @radix-ui_react-select@2.2.6_@types_react-dom@19.2.3_@types_react@19.2.6__@types_react@_38dc681bb1f2bcfeb5249d8ca2bc01f5}/node_modules/@radix-ui/react-select/dist/index.mjs +17 -17
  30. package/dist/node_modules/.pnpm/{@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-controllable-state/dist/index.cjs +1 -1
  31. package/dist/node_modules/.pnpm/{@radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-controllable-state@1.2.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-controllable-state/dist/index.mjs +1 -1
  32. package/dist/node_modules/.pnpm/{@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-escape-keydown/dist/index.cjs +1 -1
  33. package/dist/node_modules/.pnpm/{@radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-escape-keydown@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-escape-keydown/dist/index.mjs +1 -1
  34. package/dist/node_modules/.pnpm/{@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-size/dist/index.cjs +1 -1
  35. package/dist/node_modules/.pnpm/{@radix-ui_react-use-size@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-size@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-size/dist/index.mjs +1 -1
  36. package/dist/node_modules/.pnpm/{@radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.2_@types_react@19.2.2__@typ_a84e98a44624c31e835a98d4b8b0c30d → @radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_f453379bbd5a4932ec515167f81be42a}/node_modules/@radix-ui/react-visually-hidden/dist/index.cjs +1 -1
  37. package/dist/node_modules/.pnpm/{@radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.2_@types_react@19.2.2__@typ_a84e98a44624c31e835a98d4b8b0c30d → @radix-ui_react-visually-hidden@1.2.3_@types_react-dom@19.2.3_@types_react@19.2.6__@typ_f453379bbd5a4932ec515167f81be42a}/node_modules/@radix-ui/react-visually-hidden/dist/index.mjs +1 -1
  38. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/component.cjs +1 -1
  39. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/component.mjs +1 -1
  40. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/SideEffect.cjs +2 -2
  41. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/SideEffect.mjs +2 -2
  42. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/UI.cjs +2 -2
  43. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/UI.mjs +2 -2
  44. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/medium.cjs +1 -1
  45. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/medium.mjs +1 -1
  46. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +9 -0
  47. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/sidecar.mjs +1 -1
  48. package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.cjs +610 -0
  49. package/dist/packages/better-stack/src/plugins/ai-chat/api/plugin.mjs +608 -0
  50. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.cjs +221 -0
  51. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-input.mjs +219 -0
  52. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.cjs +315 -0
  53. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-interface.mjs +313 -0
  54. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.cjs +122 -0
  55. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-layout.mjs +120 -0
  56. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.cjs +397 -0
  57. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-message.mjs +391 -0
  58. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.cjs +227 -0
  59. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/chat-sidebar.mjs +225 -0
  60. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.cjs +31 -0
  61. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.mjs +29 -0
  62. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.cjs +11 -0
  63. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/loading/index.mjs +8 -0
  64. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.cjs +18 -0
  65. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/404-page.mjs +16 -0
  66. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.cjs +39 -0
  67. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.cjs +22 -0
  68. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.internal.mjs +20 -0
  69. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/pages/chat-page.mjs +37 -0
  70. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.cjs +18 -0
  71. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/default-error.mjs +16 -0
  72. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.cjs +26 -0
  73. package/dist/packages/better-stack/src/plugins/ai-chat/client/components/shared/error-placeholder.mjs +24 -0
  74. package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.cjs +199 -0
  75. package/dist/packages/better-stack/src/plugins/ai-chat/client/hooks/chat-hooks.mjs +191 -0
  76. package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.cjs +63 -0
  77. package/dist/packages/better-stack/src/plugins/ai-chat/client/localization/index.mjs +61 -0
  78. package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.cjs +14 -0
  79. package/dist/packages/better-stack/src/plugins/ai-chat/client/overrides.mjs +11 -0
  80. package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.cjs +241 -0
  81. package/dist/packages/better-stack/src/plugins/ai-chat/client/plugin.mjs +239 -0
  82. package/dist/packages/better-stack/src/plugins/ai-chat/db.cjs +65 -0
  83. package/dist/packages/better-stack/src/plugins/ai-chat/db.mjs +63 -0
  84. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.cjs +42 -0
  85. package/dist/packages/better-stack/src/plugins/ai-chat/schemas.mjs +38 -0
  86. package/dist/packages/better-stack/src/plugins/blog/api/plugin.cjs +8 -2
  87. package/dist/packages/better-stack/src/plugins/blog/api/plugin.mjs +8 -2
  88. package/dist/packages/better-stack/src/plugins/blog/client/components/pages/post-page.internal.cjs +1 -1
  89. package/dist/packages/better-stack/src/plugins/blog/client/components/pages/post-page.internal.mjs +1 -1
  90. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.cjs +12 -309
  91. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/markdown-content.mjs +13 -303
  92. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/on-this-page.cjs +1 -1
  93. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/on-this-page.mjs +1 -1
  94. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.cjs +2 -2
  95. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/page-wrapper.mjs +2 -2
  96. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/recent-posts-carousel.cjs +2 -2
  97. package/dist/packages/better-stack/src/plugins/blog/client/components/shared/recent-posts-carousel.mjs +2 -2
  98. package/dist/packages/ui/src/components/alert-dialog.cjs +1 -1
  99. package/dist/packages/ui/src/components/alert-dialog.mjs +1 -1
  100. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.cjs → ui/src/components/better-stack-attribution.cjs} +3 -3
  101. package/dist/packages/{better-stack/src/plugins/blog/client/components/shared/better-blog-attribution.mjs → ui/src/components/better-stack-attribution.mjs} +3 -3
  102. package/dist/packages/ui/src/components/dialog.cjs +14 -0
  103. package/dist/packages/ui/src/components/dialog.mjs +14 -1
  104. package/dist/packages/ui/src/components/dropdown-menu.cjs +67 -0
  105. package/dist/packages/ui/src/components/dropdown-menu.mjs +62 -0
  106. package/dist/packages/ui/src/components/markdown-content.cjs +306 -0
  107. package/dist/packages/ui/src/components/markdown-content.mjs +297 -0
  108. package/dist/packages/ui/src/components/scroll-area.cjs +63 -0
  109. package/dist/packages/ui/src/components/scroll-area.mjs +60 -0
  110. package/dist/packages/ui/src/components/select.cjs +1 -1
  111. package/dist/packages/ui/src/components/select.mjs +1 -1
  112. package/dist/packages/ui/src/components/sheet.cjs +87 -0
  113. package/dist/packages/ui/src/components/sheet.mjs +69 -0
  114. package/dist/plugins/ai-chat/api/index.cjs +9 -0
  115. package/dist/plugins/ai-chat/api/index.d.cts +9 -0
  116. package/dist/plugins/ai-chat/api/index.d.mts +9 -0
  117. package/dist/plugins/ai-chat/api/index.d.ts +9 -0
  118. package/dist/plugins/ai-chat/api/index.mjs +2 -0
  119. package/dist/plugins/ai-chat/client/components/index.cjs +27 -0
  120. package/dist/plugins/ai-chat/client/components/index.d.cts +30 -0
  121. package/dist/plugins/ai-chat/client/components/index.d.mts +30 -0
  122. package/dist/plugins/ai-chat/client/components/index.d.ts +30 -0
  123. package/dist/plugins/ai-chat/client/components/index.mjs +11 -0
  124. package/dist/plugins/ai-chat/client/hooks/index.cjs +13 -0
  125. package/dist/plugins/ai-chat/client/hooks/index.d.cts +98 -0
  126. package/dist/plugins/ai-chat/client/hooks/index.d.mts +98 -0
  127. package/dist/plugins/ai-chat/client/hooks/index.d.ts +98 -0
  128. package/dist/plugins/ai-chat/client/hooks/index.mjs +1 -0
  129. package/dist/plugins/ai-chat/client/index.cjs +19 -0
  130. package/dist/plugins/ai-chat/client/index.d.cts +327 -0
  131. package/dist/plugins/ai-chat/client/index.d.mts +327 -0
  132. package/dist/plugins/ai-chat/client/index.d.ts +327 -0
  133. package/dist/plugins/ai-chat/client/index.mjs +7 -0
  134. package/dist/plugins/ai-chat/client.css +6 -0
  135. package/dist/plugins/ai-chat/query-keys.cjs +60 -0
  136. package/dist/plugins/ai-chat/query-keys.d.cts +478 -0
  137. package/dist/plugins/ai-chat/query-keys.d.mts +478 -0
  138. package/dist/plugins/ai-chat/query-keys.d.ts +478 -0
  139. package/dist/plugins/ai-chat/query-keys.mjs +58 -0
  140. package/dist/plugins/ai-chat/style.css +19 -0
  141. package/dist/plugins/blog/api/index.d.cts +1 -1
  142. package/dist/plugins/blog/api/index.d.mts +1 -1
  143. package/dist/plugins/blog/api/index.d.ts +1 -1
  144. package/dist/plugins/blog/client/components/shared/markdown-content-styles.css +85 -62
  145. package/dist/plugins/blog/client/hooks/index.d.cts +2 -2
  146. package/dist/plugins/blog/client/hooks/index.d.mts +2 -2
  147. package/dist/plugins/blog/client/hooks/index.d.ts +2 -2
  148. package/dist/plugins/blog/client/index.d.cts +1 -1
  149. package/dist/plugins/blog/client/index.d.mts +1 -1
  150. package/dist/plugins/blog/client/index.d.ts +1 -1
  151. package/dist/plugins/blog/query-keys.d.cts +2 -2
  152. package/dist/plugins/blog/query-keys.d.mts +2 -2
  153. package/dist/plugins/blog/query-keys.d.ts +2 -2
  154. package/dist/shared/stack.Be1QIHEn.d.cts +23 -0
  155. package/dist/shared/stack.Be1QIHEn.d.mts +23 -0
  156. package/dist/shared/stack.Be1QIHEn.d.ts +23 -0
  157. package/dist/shared/stack.DorMi9CZ.d.cts +80 -0
  158. package/dist/shared/stack.DorMi9CZ.d.mts +80 -0
  159. package/dist/shared/stack.DorMi9CZ.d.ts +80 -0
  160. package/package.json +61 -3
  161. package/src/plugins/ai-chat/api/index.ts +2 -0
  162. package/src/plugins/ai-chat/api/plugin.ts +1083 -0
  163. package/src/plugins/ai-chat/client/components/chat-input.tsx +295 -0
  164. package/src/plugins/ai-chat/client/components/chat-interface.tsx +455 -0
  165. package/src/plugins/ai-chat/client/components/chat-layout.tsx +160 -0
  166. package/src/plugins/ai-chat/client/components/chat-message.tsx +505 -0
  167. package/src/plugins/ai-chat/client/components/chat-sidebar.tsx +296 -0
  168. package/src/plugins/ai-chat/client/components/index.ts +16 -0
  169. package/src/plugins/ai-chat/client/components/loading/chat-page-skeleton.tsx +57 -0
  170. package/src/plugins/ai-chat/client/components/loading/index.tsx +11 -0
  171. package/src/plugins/ai-chat/client/components/pages/404-page.tsx +27 -0
  172. package/src/plugins/ai-chat/client/components/pages/chat-page.internal.tsx +31 -0
  173. package/src/plugins/ai-chat/client/components/pages/chat-page.tsx +46 -0
  174. package/src/plugins/ai-chat/client/components/shared/default-error.tsx +28 -0
  175. package/src/plugins/ai-chat/client/components/shared/error-placeholder.tsx +22 -0
  176. package/src/plugins/ai-chat/client/hooks/chat-hooks.tsx +349 -0
  177. package/src/plugins/ai-chat/client/hooks/index.tsx +1 -0
  178. package/src/plugins/ai-chat/client/index.ts +14 -0
  179. package/src/plugins/ai-chat/client/localization/index.ts +156 -0
  180. package/src/plugins/ai-chat/client/overrides.ts +170 -0
  181. package/src/plugins/ai-chat/client/plugin.tsx +449 -0
  182. package/src/plugins/ai-chat/client.css +6 -0
  183. package/src/plugins/ai-chat/db.ts +65 -0
  184. package/src/plugins/ai-chat/query-keys.ts +87 -0
  185. package/src/plugins/ai-chat/schemas.ts +40 -0
  186. package/src/plugins/ai-chat/style.css +19 -0
  187. package/src/plugins/ai-chat/types.ts +29 -0
  188. package/src/plugins/blog/api/plugin.ts +10 -4
  189. package/src/plugins/blog/client/components/pages/post-page.internal.tsx +1 -1
  190. package/src/plugins/blog/client/components/shared/markdown-content-styles.css +85 -62
  191. package/src/plugins/blog/client/components/shared/markdown-content.tsx +19 -427
  192. package/src/plugins/blog/client/components/shared/on-this-page.tsx +1 -1
  193. package/src/plugins/blog/client/components/shared/page-wrapper.tsx +2 -2
  194. package/src/plugins/blog/client/components/shared/recent-posts-carousel.tsx +2 -2
  195. package/dist/node_modules/.pnpm/react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0/node_modules/react-remove-scroll/dist/es2015/sidecar.cjs +0 -9
  196. package/src/plugins/blog/client/components/shared/better-blog-attribution.tsx +0 -19
  197. package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.cjs +0 -0
  198. package/dist/node_modules/.pnpm/{@radix-ui_react-compose-refs@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-compose-refs@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-compose-refs/dist/index.mjs +0 -0
  199. package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.cjs +0 -0
  200. package/dist/node_modules/.pnpm/{@radix-ui_react-context@1.1.2_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-context@1.1.2_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-context/dist/index.mjs +0 -0
  201. package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.cjs +0 -0
  202. package/dist/node_modules/.pnpm/{@radix-ui_react-direction@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-direction@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-direction/dist/index.mjs +0 -0
  203. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.cjs +0 -0
  204. package/dist/node_modules/.pnpm/{@radix-ui_react-focus-guards@1.1.3_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-focus-guards@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-focus-guards/dist/index.mjs +0 -0
  205. package/dist/node_modules/.pnpm/{@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.cjs +0 -0
  206. package/dist/node_modules/.pnpm/{@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.2_@types_react@19.2.2__@types_rea_bdc15f10281778271ffcbe8dd3cd491e → @radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.6__@types_rea_a92a69cb1cb39305138539e4fa72f596}/node_modules/@radix-ui/react-primitive/dist/index.mjs +0 -0
  207. package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.cjs +0 -0
  208. package/dist/node_modules/.pnpm/{@radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-callback-ref@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-callback-ref/dist/index.mjs +0 -0
  209. package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.cjs +0 -0
  210. package/dist/node_modules/.pnpm/{@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-layout-effect/dist/index.mjs +0 -0
  211. package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.cjs +0 -0
  212. package/dist/node_modules/.pnpm/{@radix-ui_react-use-previous@1.1.1_@types_react@19.2.2_react@19.2.0 → @radix-ui_react-use-previous@1.1.1_@types_react@19.2.6_react@19.2.0}/node_modules/@radix-ui/react-use-previous/dist/index.mjs +0 -0
  213. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.cjs +0 -0
  214. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/constants.mjs +0 -0
  215. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.cjs +0 -0
  216. package/dist/node_modules/.pnpm/{react-remove-scroll-bar@2.3.8_@types_react@19.2.2_react@19.2.0 → react-remove-scroll-bar@2.3.8_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll-bar/dist/es2015/utils.mjs +0 -0
  217. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.cjs +0 -0
  218. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/Combination.mjs +0 -0
  219. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.cjs +0 -0
  220. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.mjs +0 -0
  221. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.cjs +0 -0
  222. package/dist/node_modules/.pnpm/{react-remove-scroll@2.7.1_@types_react@19.2.2_react@19.2.0 → react-remove-scroll@2.7.1_@types_react@19.2.6_react@19.2.0}/node_modules/react-remove-scroll/dist/es2015/handleScroll.mjs +0 -0
  223. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.cjs +0 -0
  224. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/component.mjs +0 -0
  225. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.cjs +0 -0
  226. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/hook.mjs +0 -0
  227. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.cjs +0 -0
  228. package/dist/node_modules/.pnpm/{react-style-singleton@2.2.3_@types_react@19.2.2_react@19.2.0 → react-style-singleton@2.2.3_@types_react@19.2.6_react@19.2.0}/node_modules/react-style-singleton/dist/es2015/singleton.mjs +0 -0
  229. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.cjs +0 -0
  230. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/assignRef.mjs +0 -0
  231. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.cjs +0 -0
  232. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useMergeRef.mjs +0 -0
  233. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.cjs +0 -0
  234. package/dist/node_modules/.pnpm/{use-callback-ref@1.3.3_@types_react@19.2.2_react@19.2.0 → use-callback-ref@1.3.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-callback-ref/dist/es2015/useRef.mjs +0 -0
  235. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.cjs +0 -0
  236. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/exports.mjs +0 -0
  237. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.cjs +0 -0
  238. package/dist/node_modules/.pnpm/{use-sidecar@1.1.3_@types_react@19.2.2_react@19.2.0 → use-sidecar@1.1.3_@types_react@19.2.6_react@19.2.0}/node_modules/use-sidecar/dist/es2015/medium.mjs +0 -0
  239. package/dist/shared/{stack.DLhzx1-D.d.ts → stack.CcI4sYJP.d.cts} +1 -1
  240. package/dist/shared/{stack.DLhzx1-D.d.cts → stack.CcI4sYJP.d.mts} +1 -1
  241. package/dist/shared/{stack.DLhzx1-D.d.mts → stack.CcI4sYJP.d.ts} +1 -1
@@ -181,7 +181,10 @@ const blogBackendPlugin = (hooks) => api.defineBackendPlugin({
181
181
  }
182
182
  }
183
183
  let result = posts.map((post) => {
184
- const postTags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
184
+ const postTags = (post.postTag || []).map((pt) => {
185
+ const tag = tagMap.get(pt.tagId);
186
+ return tag ? { ...tag } : void 0;
187
+ }).filter((tag) => tag !== void 0);
185
188
  const { postTag: _, ...postWithoutJoin } = post;
186
189
  return {
187
190
  ...postWithoutJoin,
@@ -505,7 +508,10 @@ const blogBackendPlugin = (hooks) => api.defineBackendPlugin({
505
508
  }
506
509
  }
507
510
  const mapPostWithTags = (post) => {
508
- const tags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
511
+ const tags = (post.postTag || []).map((pt) => {
512
+ const tag = tagMap.get(pt.tagId);
513
+ return tag ? { ...tag } : void 0;
514
+ }).filter((tag) => tag !== void 0);
509
515
  const { postTag: _, ...postWithoutJoin } = post;
510
516
  return {
511
517
  ...postWithoutJoin,
@@ -179,7 +179,10 @@ const blogBackendPlugin = (hooks) => defineBackendPlugin({
179
179
  }
180
180
  }
181
181
  let result = posts.map((post) => {
182
- const postTags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
182
+ const postTags = (post.postTag || []).map((pt) => {
183
+ const tag = tagMap.get(pt.tagId);
184
+ return tag ? { ...tag } : void 0;
185
+ }).filter((tag) => tag !== void 0);
183
186
  const { postTag: _, ...postWithoutJoin } = post;
184
187
  return {
185
188
  ...postWithoutJoin,
@@ -503,7 +506,10 @@ const blogBackendPlugin = (hooks) => defineBackendPlugin({
503
506
  }
504
507
  }
505
508
  const mapPostWithTags = (post) => {
506
- const tags = (post.postTag || []).map((pt) => tagMap.get(pt.tagId)).filter((tag) => tag !== void 0);
509
+ const tags = (post.postTag || []).map((pt) => {
510
+ const tag = tagMap.get(pt.tagId);
511
+ return tag ? { ...tag } : void 0;
512
+ }).filter((tag) => tag !== void 0);
507
513
  const { postTag: _, ...postWithoutJoin } = post;
508
514
  return {
509
515
  ...postWithoutJoin,
@@ -51,7 +51,7 @@ function PostPage({ slug }) {
51
51
  if (!slug || !post) {
52
52
  return /* @__PURE__ */ jsxRuntime.jsx(pageWrapper.PageWrapper, { children: /* @__PURE__ */ jsxRuntime.jsx(emptyList.EmptyList, { message: localization.BLOG_PAGE_NOT_FOUND_DESCRIPTION }) });
53
53
  }
54
- return /* @__PURE__ */ jsxRuntime.jsx(pageWrapper.PageWrapper, { className: "gap-0 px-4 lg:px-4 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start w-full", children: [
54
+ return /* @__PURE__ */ jsxRuntime.jsx(pageWrapper.PageWrapper, { className: "gap-0 px-4 lg:px-2 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start w-full", children: [
55
55
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-44 shrink-0 hidden xl:flex mr-auto" }),
56
56
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-center flex-1 mx-auto w-full max-w-4xl min-w-0", children: [
57
57
  /* @__PURE__ */ jsxRuntime.jsx(onThisPage.OnThisPageSelect, { markdown: post.content }),
@@ -49,7 +49,7 @@ function PostPage({ slug }) {
49
49
  if (!slug || !post) {
50
50
  return /* @__PURE__ */ jsx(PageWrapper, { children: /* @__PURE__ */ jsx(EmptyList, { message: localization.BLOG_PAGE_NOT_FOUND_DESCRIPTION }) });
51
51
  }
52
- return /* @__PURE__ */ jsx(PageWrapper, { className: "gap-0 px-4 lg:px-4 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start w-full", children: [
52
+ return /* @__PURE__ */ jsx(PageWrapper, { className: "gap-0 px-4 lg:px-2 py-0 pb-18", testId: "post-page", children: /* @__PURE__ */ jsxs("div", { className: "flex items-start w-full", children: [
53
53
  /* @__PURE__ */ jsx("div", { className: "w-44 shrink-0 hidden xl:flex mr-auto" }),
54
54
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center flex-1 mx-auto w-full max-w-4xl min-w-0", children: [
55
55
  /* @__PURE__ */ jsx(OnThisPageSelect, { markdown: post.content }),
@@ -2,323 +2,26 @@
2
2
  'use strict';
3
3
 
4
4
  const jsxRuntime = require('react/jsx-runtime');
5
- const utils = require('../../../utils.cjs');
6
- const React = require('react');
7
- const ReactMarkdown = require('react-markdown');
8
- const rehypeHighlight = require('rehype-highlight');
9
- const rehypeRaw = require('rehype-raw');
10
- const remarkGfm = require('remark-gfm');
11
- require('highlight.js/styles/panda-syntax-light.css');
12
- const lucideReact = require('lucide-react');
5
+ const markdownContent = require('../../../../../../../ui/src/components/markdown-content.cjs');
13
6
  const context = require('@btst/stack/context');
14
7
  const defaults = require('./defaults.cjs');
8
+ require('highlight.js/styles/panda-syntax-light.css');
15
9
 
16
- function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e.default : e; }
17
-
18
- const ReactMarkdown__default = /*#__PURE__*/_interopDefaultCompat(ReactMarkdown);
19
- const rehypeHighlight__default = /*#__PURE__*/_interopDefaultCompat(rehypeHighlight);
20
- const rehypeRaw__default = /*#__PURE__*/_interopDefaultCompat(rehypeRaw);
21
- const remarkGfm__default = /*#__PURE__*/_interopDefaultCompat(remarkGfm);
22
-
23
- function containsMath(markdown) {
24
- return /\$\$[\s\S]+?\$\$/.test(markdown) || // Display math
25
- /(?<!\$)\$(?!\$)[^\$\n]+?\$(?!\$)/.test(markdown) || // Inline math (not $$)
26
- /\\begin\{(equation|align|gather|math)\}/.test(markdown);
27
- }
28
- function getNodeText(node) {
29
- if (node == null) return "";
30
- if (typeof node === "string" || typeof node === "number") return String(node);
31
- if (Array.isArray(node)) return node.map(getNodeText).join("");
32
- if (React.isValidElement(node)) {
33
- const props = node.props;
34
- return getNodeText(props.children);
35
- }
36
- return "";
37
- }
38
- function simpleHash(str) {
39
- let hash = 0;
40
- for (let i = 0; i < str.length; i++) {
41
- const char = str.charCodeAt(i);
42
- hash = (hash << 5) - hash + char;
43
- hash = hash & hash;
44
- }
45
- return Math.abs(hash).toString(36).slice(0, 6);
46
- }
47
- function isCheckboxElement(node) {
48
- return React.isValidElement(node) && node.type === "input" && node.props.type === "checkbox";
49
- }
50
- function createTaskListItemRenderer() {
51
- return function LiRenderer(props) {
52
- const { className, children, ...rest } = props;
53
- const isTaskItem = (className ?? "").split(" ").includes("task-list-item");
54
- if (!isTaskItem) {
55
- return /* @__PURE__ */ jsxRuntime.jsx("li", { className, ...rest, children });
56
- }
57
- const childArray = Array.isArray(children) ? children : [children];
58
- const checkboxNode = childArray.find(isCheckboxElement);
59
- const nonCheckboxChildren = childArray.filter((c) => !isCheckboxElement(c));
60
- const labelText = getNodeText(nonCheckboxChildren);
61
- const baseId = utils.slugify(labelText || "task-item");
62
- const hashSuffix = simpleHash(labelText || "task-item");
63
- const uniqueId = `${baseId}-${hashSuffix}`;
64
- return /* @__PURE__ */ jsxRuntime.jsxs("li", { className, ...rest, children: [
65
- checkboxNode ? React.createElement(checkboxNode.type, {
66
- ...checkboxNode.props,
67
- id: uniqueId,
68
- "aria-label": labelText || "Task item"
69
- }) : null,
70
- /* @__PURE__ */ jsxRuntime.jsx("label", { htmlFor: uniqueId, children: nonCheckboxChildren })
71
- ] });
72
- };
73
- }
74
- function createHeadingRenderer(tag) {
75
- return function HeadingRenderer(props) {
76
- const { children, ...rest } = props;
77
- const text = getNodeText(children);
78
- const id = utils.slugify(text);
79
- return React.createElement(
80
- tag,
81
- { id, ...rest },
82
- children,
83
- text ? /* @__PURE__ */ jsxRuntime.jsx(
84
- "a",
85
- {
86
- className: "heading-anchor",
87
- href: `#${id}`,
88
- "aria-label": "Link to heading",
89
- children: "#"
90
- }
91
- ) : null
92
- );
93
- };
94
- }
95
- function AnchorRenderer(props) {
96
- const { Link } = context.usePluginOverrides("blog", {
97
- Link: defaults.DefaultLink
98
- });
99
- const { href = "", children, className: anchorClassName, ...rest } = props;
100
- return /* @__PURE__ */ jsxRuntime.jsx(Link, { href, className: anchorClassName, ...rest, children });
101
- }
102
- function ImgRenderer(props) {
103
- const { Image } = context.usePluginOverrides("blog", {
10
+ function MarkdownContent({ markdown, className }) {
11
+ const { Link, Image } = context.usePluginOverrides("blog", {
12
+ Link: defaults.DefaultLink,
104
13
  Image: defaults.DefaultImage
105
14
  });
106
- const {
107
- src = "",
108
- alt = "",
109
- className: imgClassName,
110
- width,
111
- height,
112
- style,
113
- ...rest
114
- } = props;
115
- const imageProps = {
116
- src,
117
- alt,
118
- className: imgClassName,
119
- style,
120
- ...rest
121
- };
122
- if (width != null && height != null) {
123
- imageProps.width = width;
124
- imageProps.height = height;
125
- } else {
126
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: "markdown-image-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(Image, { ...imageProps }) });
127
- }
128
- return /* @__PURE__ */ jsxRuntime.jsx(Image, { ...imageProps });
129
- }
130
- function CodeRenderer({ inline, className, children, ...rest }) {
131
- const hasLanguage = /language-([a-z0-9-]+)/i.test(className ?? "");
132
- const isInline = inline ?? !hasLanguage;
133
- if (isInline) {
134
- return /* @__PURE__ */ jsxRuntime.jsx("code", { className, ...rest, children });
135
- }
136
- return /* @__PURE__ */ jsxRuntime.jsx("code", { className, ...rest, children });
137
- }
138
- function PreRenderer(props) {
139
- const { children, ...rest } = props;
140
- const child = Array.isArray(children) ? children[0] : children;
141
- let language;
142
- if (React.isValidElement(child)) {
143
- const className = child.props.className;
144
- const match = /language-([a-z0-9-]+)/i.exec(className ?? "");
145
- language = match?.[1];
146
- }
147
- const label = (language ?? "text").toUpperCase();
148
- const preRef = React.useRef(null);
149
- const [copied, setCopied] = React.useState(false);
150
- const resetTimerRef = React.useRef(null);
151
- let codeText = "";
152
- if (React.isValidElement(child)) {
153
- const childProps = child.props;
154
- codeText = getNodeText(childProps.children);
155
- }
156
- const normalized = codeText.endsWith("\n") ? codeText.slice(0, -1) : codeText;
157
- const lineCount = Math.max(1, normalized.split("\n").length);
158
- const digitCount = String(lineCount).length;
159
- const onCopy = async (e) => {
160
- e.preventDefault();
161
- e.stopPropagation();
162
- try {
163
- const text = preRef.current?.textContent ?? "";
164
- if (text && typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
165
- await navigator.clipboard.writeText(text);
166
- setCopied(true);
167
- if (resetTimerRef.current) window.clearTimeout(resetTimerRef.current);
168
- resetTimerRef.current = window.setTimeout(() => {
169
- setCopied(false);
170
- resetTimerRef.current = null;
171
- }, 2e3);
172
- }
173
- } catch {
174
- }
175
- };
176
- return /* @__PURE__ */ jsxRuntime.jsxs(
177
- "div",
15
+ return /* @__PURE__ */ jsxRuntime.jsx(
16
+ markdownContent.MarkdownContent,
178
17
  {
179
- className: "milkdown-code-block",
180
- style: {
181
- ["--code-gutter-width"]: `${digitCount + 1}ch`
182
- },
183
- children: [
184
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "code-toolbar", children: [
185
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "language-label", children: label }),
186
- /* @__PURE__ */ jsxRuntime.jsx(
187
- "button",
188
- {
189
- type: "button",
190
- className: "copy-button",
191
- onClick: onCopy,
192
- "aria-label": copied ? "Copied" : "Copy code",
193
- children: copied ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckIcon, { size: 16 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CopyIcon, { size: 16 })
194
- }
195
- )
196
- ] }),
197
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "code-content", children: [
198
- /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "line-numbers", "aria-hidden": true, children: Array.from({ length: lineCount }).map((_, idx) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: idx + 1 }, idx + 1)) }),
199
- /* @__PURE__ */ jsxRuntime.jsx("pre", { ref: preRef, ...rest, children })
200
- ] })
201
- ]
18
+ markdown,
19
+ className,
20
+ variant: "default",
21
+ LinkComponent: Link,
22
+ ImageComponent: Image
202
23
  }
203
24
  );
204
25
  }
205
- function MarkdownContent({ markdown, className }) {
206
- const [mathPlugins, setMathPlugins] = React.useState(null);
207
- const [isLoadingMath, setIsLoadingMath] = React.useState(false);
208
- const hasMath = React.useMemo(() => containsMath(markdown), [markdown]);
209
- React.useEffect(() => {
210
- if (!hasMath || mathPlugins || isLoadingMath) return;
211
- setIsLoadingMath(true);
212
- const katexCSSId = "katex-css";
213
- if (!document.getElementById(katexCSSId)) {
214
- const link = document.createElement("link");
215
- link.id = katexCSSId;
216
- link.rel = "stylesheet";
217
- link.href = "https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css";
218
- link.integrity = "sha384-nB0miv6/jRmo5UMMR1wu3Gz6NLsoTkbqJghGIsx//Rlm+ZU03BU6SQNC66uf4l5+";
219
- link.crossOrigin = "anonymous";
220
- document.head.appendChild(link);
221
- const fontDisplayStyleId = "katex-font-display-override";
222
- if (!document.getElementById(fontDisplayStyleId)) {
223
- const style = document.createElement("style");
224
- style.id = fontDisplayStyleId;
225
- style.textContent = `
226
- /* Override KaTeX font-face declarations to add font-display: swap */
227
- @font-face {
228
- font-family: 'KaTeX_Main';
229
- font-style: normal;
230
- font-weight: normal;
231
- font-display: swap;
232
- src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Main-Regular.woff2') format('woff2');
233
- }
234
- @font-face {
235
- font-family: 'KaTeX_Math';
236
- font-style: italic;
237
- font-weight: normal;
238
- font-display: swap;
239
- src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Math-Italic.woff2') format('woff2');
240
- }
241
- @font-face {
242
- font-family: 'KaTeX_Size1';
243
- font-style: normal;
244
- font-weight: normal;
245
- font-display: swap;
246
- src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size1-Regular.woff2') format('woff2');
247
- }
248
- @font-face {
249
- font-family: 'KaTeX_Size2';
250
- font-style: normal;
251
- font-weight: normal;
252
- font-display: swap;
253
- src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size2-Regular.woff2') format('woff2');
254
- }
255
- @font-face {
256
- font-family: 'KaTeX_Size3';
257
- font-style: normal;
258
- font-weight: normal;
259
- font-display: swap;
260
- src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size3-Regular.woff2') format('woff2');
261
- }
262
- @font-face {
263
- font-family: 'KaTeX_Size4';
264
- font-style: normal;
265
- font-weight: normal;
266
- font-display: swap;
267
- src: url('https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/fonts/KaTeX_Size4-Regular.woff2') format('woff2');
268
- }
269
- `;
270
- document.head.appendChild(style);
271
- }
272
- }
273
- Promise.all([import('remark-math'), import('rehype-katex')]).then(([remarkMathModule, rehypeKatexModule]) => {
274
- setMathPlugins({
275
- remarkMath: remarkMathModule.default,
276
- rehypeKatex: rehypeKatexModule.default
277
- });
278
- }).catch((error) => {
279
- console.error("Failed to load math plugins:", error);
280
- }).finally(() => {
281
- setIsLoadingMath(false);
282
- });
283
- }, [hasMath, mathPlugins, isLoadingMath]);
284
- const components = React.useMemo(() => {
285
- return {
286
- a: AnchorRenderer,
287
- img: ImgRenderer,
288
- code: CodeRenderer,
289
- pre: PreRenderer,
290
- h1: createHeadingRenderer("h1"),
291
- h2: createHeadingRenderer("h2"),
292
- h3: createHeadingRenderer("h3"),
293
- h4: createHeadingRenderer("h4"),
294
- h5: createHeadingRenderer("h5"),
295
- h6: createHeadingRenderer("h6"),
296
- li: createTaskListItemRenderer()
297
- };
298
- }, []);
299
- const remarkPlugins = React.useMemo(() => {
300
- const plugins = [remarkGfm__default];
301
- if (hasMath && mathPlugins?.remarkMath) {
302
- plugins.push(mathPlugins.remarkMath);
303
- }
304
- return plugins;
305
- }, [hasMath, mathPlugins]);
306
- const rehypePlugins = React.useMemo(() => {
307
- const plugins = [rehypeRaw__default, rehypeHighlight__default];
308
- if (hasMath && mathPlugins?.rehypeKatex) {
309
- plugins.push(mathPlugins.rehypeKatex);
310
- }
311
- return plugins;
312
- }, [hasMath, mathPlugins]);
313
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: utils.cn("milkdown-custom", className), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "milkdown", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "milkdown-content", children: /* @__PURE__ */ jsxRuntime.jsx(
314
- ReactMarkdown__default,
315
- {
316
- remarkPlugins,
317
- rehypePlugins,
318
- components,
319
- children: markdown
320
- }
321
- ) }) }) });
322
- }
323
26
 
324
27
  exports.MarkdownContent = MarkdownContent;