mtxuilib 0.0.312 → 0.0.313

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 (265) hide show
  1. package/dist/esm/common/tailwind-indicator.js +1 -1
  2. package/dist/esm/components/common/NotFoundGoBack.d.ts +2 -0
  3. package/dist/esm/components/common/NotFoundGoBack.js +23 -0
  4. package/dist/esm/components/common/react-markdown/Code.d.ts +7 -0
  5. package/dist/esm/components/common/react-markdown/Code.js +40 -0
  6. package/dist/esm/components/common/react-markdown/MarkdownToolbar.d.ts +5 -0
  7. package/dist/esm/components/common/react-markdown/MarkdownToolbar.js +23 -0
  8. package/dist/esm/components/common/react-markdown/ReactMarkdownExample.d.ts +2 -0
  9. package/dist/esm/components/common/react-markdown/ReactMarkdownExample.js +31 -0
  10. package/dist/esm/components/common/theme/mode-toggle.d.ts +2 -0
  11. package/dist/esm/components/common/theme/mode-toggle.js +24 -0
  12. package/dist/esm/components/common/theme/theme-toggle.d.ts +2 -0
  13. package/dist/esm/components/common/theme/theme-toggle.js +24 -0
  14. package/dist/esm/components/common/tiptap/MenuBar.d.ts +2 -0
  15. package/dist/esm/components/common/tiptap/MenuBar.js +165 -0
  16. package/dist/esm/components/common/tiptap/TiptapEditor.d.ts +6 -0
  17. package/dist/esm/components/common/tiptap/TiptapEditor.js +65 -0
  18. package/dist/esm/components/common/tiptap/examples/Demo-Default.d.ts +2 -0
  19. package/dist/esm/components/common/tiptap/examples/Demo-Default.js +219 -0
  20. package/dist/esm/components/common/tiptap/examples/Demo-Tiptap.d.ts +2 -0
  21. package/dist/esm/components/common/tiptap/examples/Demo-Tiptap.js +16 -0
  22. package/dist/esm/index.d.ts +1 -2
  23. package/dist/esm/index.js +0 -2
  24. package/dist/esm/tailwind.d.cts +2 -91
  25. package/dist/tailwind.cjs +6 -7
  26. package/dist/tsconfig.type.tsbuildinfo +1 -1
  27. package/package.json +5 -3
  28. package/dist/App.cjs +0 -47
  29. package/dist/MtmButton.cjs +0 -31
  30. package/dist/NovelEditor.cjs +0 -29
  31. package/dist/NovelEditorLoader.cjs +0 -40
  32. package/dist/browser/index.min.js +0 -8
  33. package/dist/common/FullCenter.cjs +0 -33
  34. package/dist/common/MtImage.cjs +0 -86
  35. package/dist/common/OnlyDebug.cjs +0 -33
  36. package/dist/common/mtlink.cjs +0 -86
  37. package/dist/common/table/cells/ExpenderCell.cjs +0 -60
  38. package/dist/common/table/cells/SelectCell.cjs +0 -61
  39. package/dist/common/table/cells/Text.cjs +0 -50
  40. package/dist/common/table/cells/ViewLink.cjs +0 -61
  41. package/dist/common/table/cells/container/cellWrapper.cjs +0 -32
  42. package/dist/common/table/cells/number.cjs +0 -47
  43. package/dist/common/table/cells/string.cjs +0 -52
  44. package/dist/common/table/data-table-pagination.cjs +0 -124
  45. package/dist/common/table/data-table-view-options.cjs +0 -68
  46. package/dist/common/table/datatable-view-options.cjs +0 -17
  47. package/dist/common/tailwind-indicator.cjs +0 -41
  48. package/dist/consts.cjs +0 -109
  49. package/dist/entry-client.cjs +0 -32
  50. package/dist/entry-server.cjs +0 -48
  51. package/dist/esm/ui/alert copy.d.ts +0 -9
  52. package/dist/esm/ui/alert copy.js +0 -85
  53. package/dist/esm/ui/form copy.d.ts +0 -24
  54. package/dist/esm/ui/form copy.js +0 -144
  55. package/dist/icons/icons.cjs +0 -296
  56. package/dist/index.cjs +0 -31
  57. package/dist/lib/clientlib/clientlib.cjs +0 -72
  58. package/dist/lib/clientlib/domutils.cjs +0 -39
  59. package/dist/lib/clientlib/selectPath.cjs +0 -69
  60. package/dist/lib/connectquery/call-unary-method.cjs +0 -71
  61. package/dist/lib/connectquery/connect-query-key.cjs +0 -40
  62. package/dist/lib/connectquery/create-use-infinite-query-options.cjs +0 -112
  63. package/dist/lib/connectquery/create-use-query-options.cjs +0 -96
  64. package/dist/lib/connectquery/default-options.cjs +0 -43
  65. package/dist/lib/connectquery/index.cjs +0 -65
  66. package/dist/lib/connectquery/method-unary-descriptor.cjs +0 -16
  67. package/dist/lib/connectquery/use-infinite-query.cjs +0 -107
  68. package/dist/lib/connectquery/use-mutation.cjs +0 -101
  69. package/dist/lib/connectquery/use-query.cjs +0 -95
  70. package/dist/lib/connectquery/use-transport.cjs +0 -49
  71. package/dist/lib/connectquery/utils.cjs +0 -51
  72. package/dist/lib/errors.cjs +0 -37
  73. package/dist/lib/http/cors.cjs +0 -151
  74. package/dist/lib/http/fetchMiddleWithCache.cjs +0 -111
  75. package/dist/lib/http/fetchMiddleWithUrlProxy.cjs +0 -53
  76. package/dist/lib/http/mthttp.cjs +0 -88
  77. package/dist/lib/http/response-cache.test.cjs +0 -73
  78. package/dist/lib/jotai-helper.cjs +0 -122
  79. package/dist/lib/mt-logger.cjs +0 -125
  80. package/dist/lib/mtmFetcher.cjs +0 -134
  81. package/dist/lib/mtmclient/descriptions/mtm/conf/conf.cjs +0 -1
  82. package/dist/lib/mtmclient/descriptions/mtm/mtbot/mtbotpb/bot.cjs +0 -1
  83. package/dist/lib/mtmclient/descriptions/mtm/mtps/mtpspb/mtps.cjs +0 -1
  84. package/dist/lib/mtmclient/descriptions/mtm/sp/sppb/sp.cjs +0 -1
  85. package/dist/lib/mtmclient/descriptions/mtm/sppb/ai.cjs +0 -1
  86. package/dist/lib/mtmclient/descriptions/mtm/sppb/av.cjs +0 -1
  87. package/dist/lib/mtmclient/descriptions/mtm/sppb/cx.cjs +0 -1
  88. package/dist/lib/mtmclient/descriptions/mtm/sppb/events.cjs +0 -1
  89. package/dist/lib/mtmclient/descriptions/mtm/sppb/job.cjs +0 -1
  90. package/dist/lib/mtmclient/descriptions/mtm/sppb/mtm.cjs +0 -1
  91. package/dist/lib/mtmclient/mtm/conf/conf-ConfService_connectquery.cjs +0 -88
  92. package/dist/lib/mtmclient/mtm/conf/conf_connect.cjs +0 -80
  93. package/dist/lib/mtmclient/mtm/conf/conf_pb.cjs +0 -2416
  94. package/dist/lib/mtmclient/mtm/mtbot/mtbotpb/bot-BotService_connectquery.cjs +0 -64
  95. package/dist/lib/mtmclient/mtm/mtbot/mtbotpb/bot_connect.cjs +0 -66
  96. package/dist/lib/mtmclient/mtm/mtbot/mtbotpb/bot_pb.cjs +0 -968
  97. package/dist/lib/mtmclient/mtm/mtps/mtpspb/mtps-PsService_connectquery.cjs +0 -87
  98. package/dist/lib/mtmclient/mtm/mtps/mtpspb/mtps_connect.cjs +0 -79
  99. package/dist/lib/mtmclient/mtm/mtps/mtpspb/mtps_pb.cjs +0 -565
  100. package/dist/lib/mtmclient/mtm/sp/sppb/sp-SpService_connectquery.cjs +0 -280
  101. package/dist/lib/mtmclient/mtm/sp/sppb/sp_connect.cjs +0 -232
  102. package/dist/lib/mtmclient/mtm/sp/sppb/sp_pb.cjs +0 -2979
  103. package/dist/lib/mtmclient/mtm/sppb/ai-AiService_connectquery.cjs +0 -51
  104. package/dist/lib/mtmclient/mtm/sppb/ai_connect.cjs +0 -56
  105. package/dist/lib/mtmclient/mtm/sppb/ai_pb.cjs +0 -175
  106. package/dist/lib/mtmclient/mtm/sppb/av-AvService_connectquery.cjs +0 -88
  107. package/dist/lib/mtmclient/mtm/sppb/av_connect.cjs +0 -80
  108. package/dist/lib/mtmclient/mtm/sppb/av_pb.cjs +0 -318
  109. package/dist/lib/mtmclient/mtm/sppb/cx-CxService_connectquery.cjs +0 -184
  110. package/dist/lib/mtmclient/mtm/sppb/cx_connect.cjs +0 -165
  111. package/dist/lib/mtmclient/mtm/sppb/cx_pb.cjs +0 -1772
  112. package/dist/lib/mtmclient/mtm/sppb/events_pb.cjs +0 -915
  113. package/dist/lib/mtmclient/mtm/sppb/job-JobService_connectquery.cjs +0 -64
  114. package/dist/lib/mtmclient/mtm/sppb/job_connect.cjs +0 -64
  115. package/dist/lib/mtmclient/mtm/sppb/job_pb.cjs +0 -474
  116. package/dist/lib/mtmclient/mtm/sppb/mtm-MtmService_connectquery.cjs +0 -639
  117. package/dist/lib/mtmclient/mtm/sppb/mtm_connect.cjs +0 -527
  118. package/dist/lib/mtmclient/mtm/sppb/mtm_pb.cjs +0 -7822
  119. package/dist/lib/mtmservices.cjs +0 -47
  120. package/dist/lib/queue copy.cjs +0 -70
  121. package/dist/lib/queue.cjs +0 -70
  122. package/dist/lib/render copy.cjs +0 -59
  123. package/dist/lib/render.cjs +0 -59
  124. package/dist/lib/service-worker.cjs +0 -49
  125. package/dist/lib/sscore.cjs +0 -58
  126. package/dist/lib/sslib/github-file.cjs +0 -63
  127. package/dist/lib/sslib/mtmcore.cjs +0 -46
  128. package/dist/lib/url.cjs +0 -94
  129. package/dist/lib/useScript.cjs +0 -101
  130. package/dist/lib/utils.cjs +0 -348
  131. package/dist/store/MtConnectProvider.cjs +0 -42
  132. package/dist/store/ReactQueryProvider.cjs +0 -130
  133. package/dist/store/StorybookDecorator.cjs +0 -44
  134. package/dist/store/appContext.cjs +0 -195
  135. package/dist/store/hydrateCore.cjs +0 -69
  136. package/dist/store/logger.context.cjs +0 -66
  137. package/dist/store/pageMeta.cjs +0 -43
  138. package/dist/ui/accordion.cjs +0 -125
  139. package/dist/ui/alert copy.cjs +0 -119
  140. package/dist/ui/alert-dialog.cjs +0 -209
  141. package/dist/ui/alert.cjs +0 -119
  142. package/dist/ui/aspect-ratio.cjs +0 -40
  143. package/dist/ui/avatar.cjs +0 -111
  144. package/dist/ui/badge.cjs +0 -78
  145. package/dist/ui/button.cjs +0 -109
  146. package/dist/ui/calendar.cjs +0 -121
  147. package/dist/ui/card.cjs +0 -139
  148. package/dist/ui/checkbox.cjs +0 -94
  149. package/dist/ui/collapsible.cjs +0 -46
  150. package/dist/ui/command.cjs +0 -199
  151. package/dist/ui/context-menu.cjs +0 -251
  152. package/dist/ui/dialog.cjs +0 -192
  153. package/dist/ui/drawer.cjs +0 -192
  154. package/dist/ui/dropdown-menu.cjs +0 -250
  155. package/dist/ui/form copy.cjs +0 -179
  156. package/dist/ui/form.cjs +0 -179
  157. package/dist/ui/hover-card.cjs +0 -90
  158. package/dist/ui/input.cjs +0 -83
  159. package/dist/ui/label.cjs +0 -83
  160. package/dist/ui/menubar.cjs +0 -285
  161. package/dist/ui/navigation-menu.cjs +0 -194
  162. package/dist/ui/novel/content.cjs +0 -258
  163. package/dist/ui/novel/novel/src/components/editor-bubble-item.cjs +0 -71
  164. package/dist/ui/novel/novel/src/components/editor-bubble.cjs +0 -101
  165. package/dist/ui/novel/novel/src/components/editor-command-item.cjs +0 -84
  166. package/dist/ui/novel/novel/src/components/editor-command.cjs +0 -136
  167. package/dist/ui/novel/novel/src/components/editor.cjs +0 -98
  168. package/dist/ui/novel/novel/src/components/index.cjs +0 -49
  169. package/dist/ui/novel/novel/src/extensions/ai-highlight.cjs +0 -123
  170. package/dist/ui/novel/novel/src/extensions/custom-keymap.cjs +0 -60
  171. package/dist/ui/novel/novel/src/extensions/drag-and-drop.cjs +0 -205
  172. package/dist/ui/novel/novel/src/extensions/image-resizer.cjs +0 -98
  173. package/dist/ui/novel/novel/src/extensions/index.cjs +0 -124
  174. package/dist/ui/novel/novel/src/extensions/slash-command.cjs +0 -140
  175. package/dist/ui/novel/novel/src/extensions/updated-image.cjs +0 -66
  176. package/dist/ui/novel/novel/src/plugins/index.cjs +0 -34
  177. package/dist/ui/novel/novel/src/plugins/upload-images.cjs +0 -139
  178. package/dist/ui/novel/novel/src/utils/atoms.cjs +0 -32
  179. package/dist/ui/novel/novel/src/utils/store.cjs +0 -29
  180. package/dist/ui/novel/novel/src/utils/utils.cjs +0 -56
  181. package/dist/ui/novel/tailwind/advanced-editor.cjs +0 -161
  182. package/dist/ui/novel/tailwind/extensions.cjs +0 -126
  183. package/dist/ui/novel/tailwind/generative/ai-completion-command.cjs +0 -82
  184. package/dist/ui/novel/tailwind/generative/ai-selector-commands.cjs +0 -93
  185. package/dist/ui/novel/tailwind/generative/ai-selector.cjs +0 -130
  186. package/dist/ui/novel/tailwind/generative/generative-menu-switch.cjs +0 -87
  187. package/dist/ui/novel/tailwind/image-upload.cjs +0 -98
  188. package/dist/ui/novel/tailwind/selectors/color-selector.cjs +0 -198
  189. package/dist/ui/novel/tailwind/selectors/link-selector.cjs +0 -128
  190. package/dist/ui/novel/tailwind/selectors/node-selector.cjs +0 -130
  191. package/dist/ui/novel/tailwind/selectors/text-buttons.cjs +0 -88
  192. package/dist/ui/novel/tailwind/slash-command.cjs +0 -168
  193. package/dist/ui/novel/tailwind/ui/button.cjs +0 -109
  194. package/dist/ui/novel/tailwind/ui/command.cjs +0 -200
  195. package/dist/ui/novel/tailwind/ui/dialog.cjs +0 -192
  196. package/dist/ui/novel/tailwind/ui/icons/crazy-spinner.cjs +0 -32
  197. package/dist/ui/novel/tailwind/ui/icons/font-default.cjs +0 -52
  198. package/dist/ui/novel/tailwind/ui/icons/font-mono.cjs +0 -53
  199. package/dist/ui/novel/tailwind/ui/icons/font-serif.cjs +0 -53
  200. package/dist/ui/novel/tailwind/ui/icons/github.cjs +0 -38
  201. package/dist/ui/novel/tailwind/ui/icons/index.cjs +0 -47
  202. package/dist/ui/novel/tailwind/ui/icons/loading-circle.cjs +0 -52
  203. package/dist/ui/novel/tailwind/ui/icons/magic.cjs +0 -65
  204. package/dist/ui/novel/tailwind/ui/menu.cjs +0 -70
  205. package/dist/ui/novel/tailwind/ui/popover.cjs +0 -90
  206. package/dist/ui/novel/tailwind/ui/scroll-area.cjs +0 -109
  207. package/dist/ui/novel/tailwind/ui/separator.cjs +0 -87
  208. package/dist/ui/pagination.cjs +0 -198
  209. package/dist/ui/popover.cjs +0 -90
  210. package/dist/ui/progress.cjs +0 -93
  211. package/dist/ui/radio-group.cjs +0 -102
  212. package/dist/ui/resizable.cjs +0 -112
  213. package/dist/ui/scroll-area.cjs +0 -117
  214. package/dist/ui/select.cjs +0 -176
  215. package/dist/ui/separator.cjs +0 -87
  216. package/dist/ui/sheet.cjs +0 -204
  217. package/dist/ui/skeleton.cjs +0 -68
  218. package/dist/ui/slider.cjs +0 -90
  219. package/dist/ui/sonner.cjs +0 -76
  220. package/dist/ui/switch.cjs +0 -94
  221. package/dist/ui/table.cjs +0 -171
  222. package/dist/ui/tabs.cjs +0 -117
  223. package/dist/ui/textarea.cjs +0 -82
  224. package/dist/ui/toast.cjs +0 -177
  225. package/dist/ui/toaster.cjs +0 -77
  226. package/dist/ui/toggle.cjs +0 -102
  227. package/dist/ui/tooltip.cjs +0 -92
  228. package/dist/ui/ui-mt/Button.cjs +0 -29
  229. package/dist/ui/ui-mt/MtForm.cjs +0 -30
  230. package/dist/ui/ui-mt/NavTag.cjs +0 -59
  231. package/dist/ui/ui-mt/Separator.cjs +0 -30
  232. package/dist/ui/ui-mt/SimpleModel.cjs +0 -71
  233. package/dist/ui/ui-mt/inputField/InputField.cjs +0 -120
  234. package/dist/ui/ui-mt/inputField/SingleUploadForm.cjs +0 -186
  235. package/dist/ui/ui-mt/inputField/TextArea.cjs +0 -95
  236. package/dist/ui/ui-mt/inputField/TextFileInput.cjs +0 -126
  237. package/dist/ui/ui-mt/inputField/select/InputSelect.cjs +0 -105
  238. package/dist/ui/ui-mt/inputField/types.cjs +0 -16
  239. package/dist/ui/ui-mt/inputs/SearchInput.cjs +0 -84
  240. package/dist/ui/ui-mt/inputs/searchBar.cjs +0 -45
  241. package/dist/ui/ui-mt/skeleton/skeleton-card.cjs +0 -52
  242. package/dist/ui/ui-mt/skeleton/skeleton2.cjs +0 -34
  243. package/dist/ui/ui-mt/skeleton/skeletons.cjs +0 -40
  244. package/dist/ui/ui-vamp/alert.cjs +0 -161
  245. package/dist/ui/ui-vamp/avatar.cjs +0 -128
  246. package/dist/ui/ui-vamp/button.cjs +0 -112
  247. package/dist/ui/ui-vamp/card.cjs +0 -115
  248. package/dist/ui/ui-vamp/checkbox.cjs +0 -104
  249. package/dist/ui/ui-vamp/chip.cjs +0 -91
  250. package/dist/ui/ui-vamp/dropdown.cjs +0 -128
  251. package/dist/ui/ui-vamp/external-link.cjs +0 -74
  252. package/dist/ui/ui-vamp/headline.cjs +0 -34
  253. package/dist/ui/ui-vamp/input.cjs +0 -103
  254. package/dist/ui/ui-vamp/keyvalue.cjs +0 -49
  255. package/dist/ui/ui-vamp/label.cjs +0 -74
  256. package/dist/ui/ui-vamp/mobile-nav-button.cjs +0 -55
  257. package/dist/ui/ui-vamp/modal.cjs +0 -113
  258. package/dist/ui/ui-vamp/pagination.cjs +0 -114
  259. package/dist/ui/ui-vamp/scroll-area.cjs +0 -112
  260. package/dist/ui/ui-vamp/skeleton.cjs +0 -67
  261. package/dist/ui/ui-vamp/stripe-not-connected-modal.cjs +0 -76
  262. package/dist/ui/ui-vamp/textarea.cjs +0 -99
  263. package/dist/ui/ui-vamp/toggle-group.cjs +0 -90
  264. package/dist/ui/use-toast.cjs +0 -187
  265. package/dist/vite-env.d.cjs +0 -1
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  const TailwindIndicator = () => {
4
- if (true)
4
+ if (process.env.NODE_ENV === "production")
5
5
  return null;
6
6
  return /* @__PURE__ */ jsxs("div", { className: "fixed bottom-1 left-1 z-50 flex h-6 w-6 items-center justify-center rounded-full bg-gray-800 p-3 font-mono text-xs text-white", children: [
7
7
  /* @__PURE__ */ jsx("div", { className: "block sm:hidden", children: "xs" }),
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const NotFoundGoBack: () => import("react").JSX.Element;
@@ -0,0 +1,23 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useRouter } from "next/navigation";
4
+ import { Button } from "../../ui/button";
5
+ const NotFoundGoBack = () => {
6
+ const router = useRouter();
7
+ return /* @__PURE__ */ jsxs("div", { className: "container flex flex-col", children: [
8
+ /* @__PURE__ */ jsx("div", { className: "mx-auto p-8", children: "not found" }),
9
+ /* @__PURE__ */ jsx(
10
+ Button,
11
+ {
12
+ className: "mx-auto p-8",
13
+ onClick: () => {
14
+ router.back();
15
+ },
16
+ children: "Go back"
17
+ }
18
+ )
19
+ ] });
20
+ };
21
+ export {
22
+ NotFoundGoBack
23
+ };
@@ -0,0 +1,7 @@
1
+ /// <reference types="react" />
2
+ export declare const CodeBlock: ({ ...props }: {
3
+ [x: string]: any;
4
+ }) => import("react").JSX.Element;
5
+ export declare const Pre: ({ ...props }: {
6
+ [x: string]: any;
7
+ }) => import("react").JSX.Element;
@@ -0,0 +1,40 @@
1
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
2
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
3
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
4
+ var __objRest = (source, exclude) => {
5
+ var target = {};
6
+ for (var prop in source)
7
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
8
+ target[prop] = source[prop];
9
+ if (source != null && __getOwnPropSymbols)
10
+ for (var prop of __getOwnPropSymbols(source)) {
11
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
12
+ target[prop] = source[prop];
13
+ }
14
+ return target;
15
+ };
16
+ import { jsx } from "react/jsx-runtime";
17
+ import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
18
+ import { materialOceanic } from "react-syntax-highlighter/dist/cjs/styles/prism";
19
+ const CodeBlock = (_a) => {
20
+ var props = __objRest(_a, []);
21
+ var _a2;
22
+ return /* @__PURE__ */ jsx(
23
+ SyntaxHighlighter,
24
+ {
25
+ language: (_a2 = props.className) == null ? void 0 : _a2.replace(/(?:lang(?:uage)?-)/, ""),
26
+ style: materialOceanic,
27
+ wrapLines: true,
28
+ className: "not-prose rounded-md",
29
+ children: props.children
30
+ }
31
+ );
32
+ };
33
+ const Pre = (_b) => {
34
+ var props = __objRest(_b, []);
35
+ return /* @__PURE__ */ jsx("div", { className: "not-prose", children: props.children });
36
+ };
37
+ export {
38
+ CodeBlock,
39
+ Pre
40
+ };
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const MarkdownToolbar: ({ feedElement }: {
3
+ feedElement: (syntax: string) => void;
4
+ }) => import("react").JSX.Element;
5
+ export default MarkdownToolbar;
@@ -0,0 +1,23 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Button } from "../../../ui/button";
3
+ const MarkdownToolbar = ({ feedElement }) => {
4
+ const btns = [
5
+ { name: "B", syntax: "**Bold**" },
6
+ { name: "I", syntax: "*Italic*" },
7
+ { name: "S", syntax: "~Strikethrough~" },
8
+ { name: "H1", syntax: "# " }
9
+ ];
10
+ return /* @__PURE__ */ jsx("header", { className: " flex gap-1 bg-[#253237]", children: btns.map((btn) => /* @__PURE__ */ jsx(
11
+ Button,
12
+ {
13
+ className: "flex rounded-md",
14
+ onClick: () => feedElement(btn.syntax),
15
+ children: btn.name
16
+ },
17
+ btn.syntax
18
+ )) });
19
+ };
20
+ var MarkdownToolbar_default = MarkdownToolbar;
21
+ export {
22
+ MarkdownToolbar_default as default
23
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ReactMarkdownExample: () => import("react").JSX.Element;
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import Markdown from "react-markdown";
4
+ import rehypeExternalLinks from "rehype-external-links";
5
+ import rehypeSanitize from "rehype-sanitize";
6
+ import remarkGfm from "remark-gfm";
7
+ import { CodeBlock, Pre } from "./Code";
8
+ const ReactMarkdownExample = () => {
9
+ const options = {
10
+ code: CodeBlock,
11
+ pre: Pre
12
+ };
13
+ return /* @__PURE__ */ jsx("div", { className: "bg-slate-500", children: /* @__PURE__ */ jsx("div", { className: "flex h-screen justify-between", children: /* @__PURE__ */ jsx("article", { className: "w-full pl-6 pt-5", children: /* @__PURE__ */ jsx(
14
+ Markdown,
15
+ {
16
+ className: "prose prose-invert min-w-full",
17
+ remarkPlugins: [remarkGfm],
18
+ rehypePlugins: [
19
+ rehypeSanitize,
20
+ [
21
+ rehypeExternalLinks,
22
+ { content: { type: "text", value: "\u{1F517}" } }
23
+ ]
24
+ ],
25
+ components: options
26
+ }
27
+ ) }) }) });
28
+ };
29
+ export {
30
+ ReactMarkdownExample
31
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function ModeToggle(): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { MoonIcon, SunIcon } from "@radix-ui/react-icons";
4
+ import { useTheme } from "next-themes";
5
+ import { Button } from "../../../ui/button";
6
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../../ui/dropdown-menu";
7
+ function ModeToggle() {
8
+ const { setTheme } = useTheme();
9
+ return /* @__PURE__ */ jsxs(DropdownMenu, { children: [
10
+ /* @__PURE__ */ jsx(DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", className: "w-9 px-0", children: [
11
+ /* @__PURE__ */ jsx(SunIcon, { className: "h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" }),
12
+ /* @__PURE__ */ jsx(MoonIcon, { className: "absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" }),
13
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
14
+ ] }) }),
15
+ /* @__PURE__ */ jsxs(DropdownMenuContent, { align: "end", children: [
16
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => setTheme("light"), children: "Light" }),
17
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => setTheme("dark"), children: "Dark" }),
18
+ /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => setTheme("system"), children: "System" })
19
+ ] })
20
+ ] });
21
+ }
22
+ export {
23
+ ModeToggle
24
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare function ThemeToggle(): import("react").JSX.Element;
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { Moon, Sun } from "lucide-react";
4
+ import { useTheme } from "next-themes";
5
+ import { Button } from "../../../ui/button";
6
+ function ThemeToggle() {
7
+ const { setTheme, theme } = useTheme();
8
+ return /* @__PURE__ */ jsxs(
9
+ Button,
10
+ {
11
+ variant: "ghost",
12
+ size: "icon",
13
+ onClick: () => setTheme(theme === "light" ? "dark" : "light"),
14
+ children: [
15
+ /* @__PURE__ */ jsx(Sun, { className: "h-6 w-[1.3rem] dark:hidden" }),
16
+ /* @__PURE__ */ jsx(Moon, { className: "hidden h-5 w-5 dark:block" }),
17
+ /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Toggle theme" })
18
+ ]
19
+ }
20
+ );
21
+ }
22
+ export {
23
+ ThemeToggle
24
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const MenuBar: () => import("react").JSX.Element | null;
@@ -0,0 +1,165 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useCurrentEditor } from "@tiptap/react";
4
+ const MenuBar = () => {
5
+ const { editor } = useCurrentEditor();
6
+ if (!editor) {
7
+ return null;
8
+ }
9
+ return /* @__PURE__ */ jsxs("div", { className: "bg-slate-100 p-1", children: [
10
+ /* @__PURE__ */ jsx(
11
+ "button",
12
+ {
13
+ onClick: () => editor.chain().focus().toggleBold().run(),
14
+ disabled: !editor.can().chain().focus().toggleBold().run(),
15
+ className: editor.isActive("bold") ? "is-active" : "",
16
+ children: "bold"
17
+ }
18
+ ),
19
+ /* @__PURE__ */ jsx(
20
+ "button",
21
+ {
22
+ onClick: () => editor.chain().focus().toggleItalic().run(),
23
+ disabled: !editor.can().chain().focus().toggleItalic().run(),
24
+ className: editor.isActive("italic") ? "is-active" : "",
25
+ children: "italic"
26
+ }
27
+ ),
28
+ /* @__PURE__ */ jsx(
29
+ "button",
30
+ {
31
+ onClick: () => editor.chain().focus().toggleStrike().run(),
32
+ disabled: !editor.can().chain().focus().toggleStrike().run(),
33
+ className: editor.isActive("strike") ? "is-active" : "",
34
+ children: "strike"
35
+ }
36
+ ),
37
+ /* @__PURE__ */ jsx(
38
+ "button",
39
+ {
40
+ onClick: () => editor.chain().focus().toggleCode().run(),
41
+ disabled: !editor.can().chain().focus().toggleCode().run(),
42
+ className: editor.isActive("code") ? "is-active" : "",
43
+ children: "code"
44
+ }
45
+ ),
46
+ /* @__PURE__ */ jsx("button", { onClick: () => editor.chain().focus().unsetAllMarks().run(), children: "clear marks" }),
47
+ /* @__PURE__ */ jsx("button", { onClick: () => editor.chain().focus().clearNodes().run(), children: "clear nodes" }),
48
+ /* @__PURE__ */ jsx(
49
+ "button",
50
+ {
51
+ onClick: () => editor.chain().focus().setParagraph().run(),
52
+ className: editor.isActive("paragraph") ? "is-active" : "",
53
+ children: "paragraph"
54
+ }
55
+ ),
56
+ /* @__PURE__ */ jsx(
57
+ "button",
58
+ {
59
+ onClick: () => editor.chain().focus().toggleHeading({ level: 1 }).run(),
60
+ className: editor.isActive("heading", { level: 1 }) ? "is-active" : "",
61
+ children: "h1"
62
+ }
63
+ ),
64
+ /* @__PURE__ */ jsx(
65
+ "button",
66
+ {
67
+ onClick: () => editor.chain().focus().toggleHeading({ level: 2 }).run(),
68
+ className: editor.isActive("heading", { level: 2 }) ? "is-active" : "",
69
+ children: "h2"
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(
73
+ "button",
74
+ {
75
+ onClick: () => editor.chain().focus().toggleHeading({ level: 3 }).run(),
76
+ className: editor.isActive("heading", { level: 3 }) ? "is-active" : "",
77
+ children: "h3"
78
+ }
79
+ ),
80
+ /* @__PURE__ */ jsx(
81
+ "button",
82
+ {
83
+ onClick: () => editor.chain().focus().toggleHeading({ level: 4 }).run(),
84
+ className: editor.isActive("heading", { level: 4 }) ? "is-active" : "",
85
+ children: "h4"
86
+ }
87
+ ),
88
+ /* @__PURE__ */ jsx(
89
+ "button",
90
+ {
91
+ onClick: () => editor.chain().focus().toggleHeading({ level: 5 }).run(),
92
+ className: editor.isActive("heading", { level: 5 }) ? "is-active" : "",
93
+ children: "h5"
94
+ }
95
+ ),
96
+ /* @__PURE__ */ jsx(
97
+ "button",
98
+ {
99
+ onClick: () => editor.chain().focus().toggleHeading({ level: 6 }).run(),
100
+ className: editor.isActive("heading", { level: 6 }) ? "is-active" : "",
101
+ children: "h6"
102
+ }
103
+ ),
104
+ /* @__PURE__ */ jsx(
105
+ "button",
106
+ {
107
+ onClick: () => editor.chain().focus().toggleBulletList().run(),
108
+ className: editor.isActive("bulletList") ? "is-active" : "",
109
+ children: "bullet list"
110
+ }
111
+ ),
112
+ /* @__PURE__ */ jsx(
113
+ "button",
114
+ {
115
+ onClick: () => editor.chain().focus().toggleOrderedList().run(),
116
+ className: editor.isActive("orderedList") ? "is-active" : "",
117
+ children: "ordered list"
118
+ }
119
+ ),
120
+ /* @__PURE__ */ jsx(
121
+ "button",
122
+ {
123
+ onClick: () => editor.chain().focus().toggleCodeBlock().run(),
124
+ className: editor.isActive("codeBlock") ? "is-active" : "",
125
+ children: "code block"
126
+ }
127
+ ),
128
+ /* @__PURE__ */ jsx(
129
+ "button",
130
+ {
131
+ onClick: () => editor.chain().focus().toggleBlockquote().run(),
132
+ className: editor.isActive("blockquote") ? "is-active" : "",
133
+ children: "blockquote"
134
+ }
135
+ ),
136
+ /* @__PURE__ */ jsx("button", { onClick: () => editor.chain().focus().setHorizontalRule().run(), children: "horizontal rule" }),
137
+ /* @__PURE__ */ jsx("button", { onClick: () => editor.chain().focus().setHardBreak().run(), children: "hard break" }),
138
+ /* @__PURE__ */ jsx(
139
+ "button",
140
+ {
141
+ onClick: () => editor.chain().focus().undo().run(),
142
+ disabled: !editor.can().chain().focus().undo().run(),
143
+ children: "undo"
144
+ }
145
+ ),
146
+ /* @__PURE__ */ jsx(
147
+ "button",
148
+ {
149
+ onClick: () => editor.chain().focus().redo().run(),
150
+ disabled: !editor.can().chain().focus().redo().run(),
151
+ children: "redo"
152
+ }
153
+ ),
154
+ /* @__PURE__ */ jsx(
155
+ "button",
156
+ {
157
+ className: editor.isActive("textStyle", { color: "#958DF1" }) ? "is-active" : "",
158
+ children: "purple"
159
+ }
160
+ )
161
+ ] });
162
+ };
163
+ export {
164
+ MenuBar
165
+ };
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ import { EditorEvents } from '@tiptap/react';
3
+ export declare const TiptapEditorV1: (props: {
4
+ value?: string | undefined;
5
+ onUpdate?: ((props: EditorEvents['update']) => void) | undefined;
6
+ }) => import("react").JSX.Element;
@@ -0,0 +1,65 @@
1
+ "use client";
2
+ import { Fragment, jsx } from "react/jsx-runtime";
3
+ import { Color } from "@tiptap/extension-color";
4
+ import ListItem from "@tiptap/extension-list-item";
5
+ import TextStyle from "@tiptap/extension-text-style";
6
+ import { EditorProvider, useCurrentEditor } from "@tiptap/react";
7
+ import StarterKit from "@tiptap/starter-kit";
8
+ import { MenuBar } from "./MenuBar";
9
+ import { cn } from "../../../lib/utils";
10
+ import { MtButton } from "../../../ui/ui-mt/Button";
11
+ const SaveButton = (props) => {
12
+ const { onSave } = props;
13
+ const { editor } = useCurrentEditor();
14
+ if (!editor) {
15
+ return null;
16
+ }
17
+ const handleSave = () => {
18
+ const html = editor == null ? void 0 : editor.getHTML();
19
+ console.log("html", html);
20
+ if (html) {
21
+ onSave && onSave(html);
22
+ }
23
+ };
24
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(MtButton, { onClick: handleSave, children: "Save" }) }) });
25
+ };
26
+ const extensions = [
27
+ Color.configure({ types: [TextStyle.name, ListItem.name] }),
28
+ // TextStyle.configure({ types: [ListItem.name] }),
29
+ StarterKit.configure({
30
+ bulletList: {
31
+ keepMarks: true,
32
+ keepAttributes: false
33
+ // TODO : Making this as `false` becase marks are not preserved when I try to preserve attrs, awaiting a bit of help
34
+ },
35
+ orderedList: {
36
+ keepMarks: true,
37
+ keepAttributes: false
38
+ // TODO : Making this as `false` becase marks are not preserved when I try to preserve attrs, awaiting a bit of help
39
+ }
40
+ })
41
+ ];
42
+ const TiptapEditorV1 = (props) => {
43
+ const { value, onUpdate } = props;
44
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
45
+ EditorProvider,
46
+ {
47
+ slotBefore: /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(MenuBar, {}) }),
48
+ extensions,
49
+ content: value,
50
+ onUpdate,
51
+ editorProps: {
52
+ attributes: {
53
+ class: cn(
54
+ "prose dark:prose-invert prose-sm sm:prose-base lg:prose-lg xl:prose-2xl focus:outline-none",
55
+ "mr-0 h-[700px] overflow-auto pr-0"
56
+ )
57
+ }
58
+ },
59
+ children: /* @__PURE__ */ jsx(Fragment, {})
60
+ }
61
+ ) });
62
+ };
63
+ export {
64
+ TiptapEditorV1
65
+ };
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export default function TiptapDemo1(): import("react").JSX.Element;