dn-react-router-toolkit 0.7.6 → 0.7.8

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 (95) hide show
  1. package/dist/api/create_api_handler.d.mts +5 -5
  2. package/dist/api/create_api_handler.d.ts +5 -5
  3. package/dist/api/index.d.mts +7 -0
  4. package/dist/api/index.d.ts +7 -0
  5. package/dist/api/index.js +163 -2
  6. package/dist/api/index.mjs +169 -1
  7. package/dist/client/env_loader.d.mts +2 -2
  8. package/dist/client/env_loader.d.ts +2 -2
  9. package/dist/client/env_loader.js +2 -12
  10. package/dist/client/env_loader.mjs +2 -2
  11. package/dist/client/file_input.d.mts +3 -2
  12. package/dist/client/file_input.d.ts +3 -2
  13. package/dist/client/file_input.js +30 -37
  14. package/dist/client/file_input.mjs +33 -28
  15. package/dist/client/index.d.mts +1 -0
  16. package/dist/client/index.d.ts +1 -0
  17. package/dist/client/index.js +38 -44
  18. package/dist/client/index.mjs +39 -33
  19. package/dist/client/store_text_editor.d.mts +2 -2
  20. package/dist/client/store_text_editor.d.ts +2 -2
  21. package/dist/client/store_text_editor.js +3 -12
  22. package/dist/client/store_text_editor.mjs +3 -2
  23. package/dist/crud/crud_form.d.mts +5 -4
  24. package/dist/crud/crud_form.d.ts +5 -4
  25. package/dist/crud/crud_form.js +74 -72
  26. package/dist/crud/crud_form.mjs +79 -62
  27. package/dist/crud/crud_form_provider.d.mts +9 -7
  28. package/dist/crud/crud_form_provider.d.ts +9 -7
  29. package/dist/crud/crud_form_provider.js +2 -12
  30. package/dist/crud/crud_form_provider.mjs +6 -3
  31. package/dist/crud/crud_page.d.mts +10 -6
  32. package/dist/crud/crud_page.d.ts +10 -6
  33. package/dist/crud/crud_page.js +272 -409
  34. package/dist/crud/crud_page.mjs +277 -399
  35. package/dist/crud/generate_pages.d.mts +10 -2
  36. package/dist/crud/generate_pages.d.ts +10 -2
  37. package/dist/crud/generate_pages.js +17 -14
  38. package/dist/crud/generate_pages.mjs +17 -4
  39. package/dist/crud/index.d.mts +2 -1
  40. package/dist/crud/index.d.ts +2 -1
  41. package/dist/crud/index.js +290 -404
  42. package/dist/crud/index.mjs +295 -404
  43. package/dist/form/create_form_component.d.mts +3 -2
  44. package/dist/form/create_form_component.d.ts +3 -2
  45. package/dist/form/create_form_component.js +3 -12
  46. package/dist/form/create_form_component.mjs +3 -2
  47. package/dist/form/form_components.d.mts +5 -4
  48. package/dist/form/form_components.d.ts +5 -4
  49. package/dist/form/form_components.js +3 -12
  50. package/dist/form/form_components.mjs +3 -2
  51. package/dist/form/index.d.mts +1 -0
  52. package/dist/form/index.d.ts +1 -0
  53. package/dist/form/index.js +3 -12
  54. package/dist/form/index.mjs +3 -2
  55. package/dist/post/editor_toolbar.d.mts +4 -3
  56. package/dist/post/editor_toolbar.d.ts +4 -3
  57. package/dist/post/editor_toolbar.js +116 -273
  58. package/dist/post/editor_toolbar.mjs +123 -263
  59. package/dist/post/index.d.mts +1 -0
  60. package/dist/post/index.d.ts +1 -0
  61. package/dist/post/index.js +329 -411
  62. package/dist/post/index.mjs +337 -409
  63. package/dist/post/post_form_page.d.mts +5 -4
  64. package/dist/post/post_form_page.d.ts +5 -4
  65. package/dist/post/post_form_page.js +331 -413
  66. package/dist/post/post_form_page.mjs +337 -409
  67. package/dist/post/thumbnail_picker.d.mts +3 -2
  68. package/dist/post/thumbnail_picker.d.ts +3 -2
  69. package/dist/post/thumbnail_picker.js +14 -23
  70. package/dist/post/thumbnail_picker.mjs +14 -13
  71. package/dist/seo/index.d.mts +1 -1
  72. package/dist/seo/index.d.ts +1 -1
  73. package/dist/seo/index.js +2 -2
  74. package/dist/seo/index.mjs +2 -2
  75. package/dist/seo/seo.d.mts +2 -2
  76. package/dist/seo/seo.d.ts +2 -2
  77. package/dist/seo/seo.js +2 -2
  78. package/dist/seo/seo.mjs +2 -2
  79. package/dist/table/buttons.d.mts +2 -2
  80. package/dist/table/buttons.d.ts +2 -2
  81. package/dist/table/buttons.js +42 -57
  82. package/dist/table/buttons.mjs +42 -47
  83. package/dist/table/index.d.mts +1 -0
  84. package/dist/table/index.d.ts +1 -0
  85. package/dist/table/index.js +185 -338
  86. package/dist/table/index.mjs +185 -328
  87. package/dist/table/page.d.mts +5 -4
  88. package/dist/table/page.d.ts +5 -4
  89. package/dist/table/page.js +185 -338
  90. package/dist/table/page.mjs +185 -328
  91. package/dist/table/table.d.mts +5 -4
  92. package/dist/table/table.d.ts +5 -4
  93. package/dist/table/table.js +77 -237
  94. package/dist/table/table.mjs +77 -227
  95. package/package.json +7 -5
@@ -7591,169 +7591,22 @@ import { useStoreComponent as useStoreComponent2 } from "react-store-input";
7591
7591
 
7592
7592
  // src/post/editor_toolbar.tsx
7593
7593
  import { cn } from "dn-react-toolkit/utils";
7594
-
7595
- // node_modules/react-icons/lib/iconBase.mjs
7596
- import React2 from "react";
7597
-
7598
- // node_modules/react-icons/lib/iconContext.mjs
7599
- import React from "react";
7600
- var DefaultContext = {
7601
- color: void 0,
7602
- size: void 0,
7603
- className: void 0,
7604
- style: void 0,
7605
- attr: void 0
7606
- };
7607
- var IconContext = React.createContext && /* @__PURE__ */ React.createContext(DefaultContext);
7608
-
7609
- // node_modules/react-icons/lib/iconBase.mjs
7610
- var _excluded = ["attr", "size", "title"];
7611
- function _objectWithoutProperties(source, excluded) {
7612
- if (source == null) return {};
7613
- var target = _objectWithoutPropertiesLoose(source, excluded);
7614
- var key, i;
7615
- if (Object.getOwnPropertySymbols) {
7616
- var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
7617
- for (i = 0; i < sourceSymbolKeys.length; i++) {
7618
- key = sourceSymbolKeys[i];
7619
- if (excluded.indexOf(key) >= 0) continue;
7620
- if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
7621
- target[key] = source[key];
7622
- }
7623
- }
7624
- return target;
7625
- }
7626
- function _objectWithoutPropertiesLoose(source, excluded) {
7627
- if (source == null) return {};
7628
- var target = {};
7629
- for (var key in source) {
7630
- if (Object.prototype.hasOwnProperty.call(source, key)) {
7631
- if (excluded.indexOf(key) >= 0) continue;
7632
- target[key] = source[key];
7633
- }
7634
- }
7635
- return target;
7636
- }
7637
- function _extends() {
7638
- _extends = Object.assign ? Object.assign.bind() : function(target) {
7639
- for (var i = 1; i < arguments.length; i++) {
7640
- var source = arguments[i];
7641
- for (var key in source) {
7642
- if (Object.prototype.hasOwnProperty.call(source, key)) {
7643
- target[key] = source[key];
7644
- }
7645
- }
7646
- }
7647
- return target;
7648
- };
7649
- return _extends.apply(this, arguments);
7650
- }
7651
- function ownKeys(e, r) {
7652
- var t = Object.keys(e);
7653
- if (Object.getOwnPropertySymbols) {
7654
- var o = Object.getOwnPropertySymbols(e);
7655
- r && (o = o.filter(function(r2) {
7656
- return Object.getOwnPropertyDescriptor(e, r2).enumerable;
7657
- })), t.push.apply(t, o);
7658
- }
7659
- return t;
7660
- }
7661
- function _objectSpread(e) {
7662
- for (var r = 1; r < arguments.length; r++) {
7663
- var t = null != arguments[r] ? arguments[r] : {};
7664
- r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
7665
- _defineProperty(e, r2, t[r2]);
7666
- }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
7667
- Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
7668
- });
7669
- }
7670
- return e;
7671
- }
7672
- function _defineProperty(obj, key, value) {
7673
- key = _toPropertyKey(key);
7674
- if (key in obj) {
7675
- Object.defineProperty(obj, key, { value, enumerable: true, configurable: true, writable: true });
7676
- } else {
7677
- obj[key] = value;
7678
- }
7679
- return obj;
7680
- }
7681
- function _toPropertyKey(t) {
7682
- var i = _toPrimitive(t, "string");
7683
- return "symbol" == typeof i ? i : i + "";
7684
- }
7685
- function _toPrimitive(t, r) {
7686
- if ("object" != typeof t || !t) return t;
7687
- var e = t[Symbol.toPrimitive];
7688
- if (void 0 !== e) {
7689
- var i = e.call(t, r || "default");
7690
- if ("object" != typeof i) return i;
7691
- throw new TypeError("@@toPrimitive must return a primitive value.");
7692
- }
7693
- return ("string" === r ? String : Number)(t);
7694
- }
7695
- function Tree2Element(tree) {
7696
- return tree && tree.map((node, i) => /* @__PURE__ */ React2.createElement(node.tag, _objectSpread({
7697
- key: i
7698
- }, node.attr), Tree2Element(node.child)));
7699
- }
7700
- function GenIcon(data) {
7701
- return (props) => /* @__PURE__ */ React2.createElement(IconBase, _extends({
7702
- attr: _objectSpread({}, data.attr)
7703
- }, props), Tree2Element(data.child));
7704
- }
7705
- function IconBase(props) {
7706
- var elem = (conf) => {
7707
- var {
7708
- attr,
7709
- size,
7710
- title
7711
- } = props, svgProps = _objectWithoutProperties(props, _excluded);
7712
- var computedSize = size || conf.size || "1em";
7713
- var className;
7714
- if (conf.className) className = conf.className;
7715
- if (props.className) className = (className ? className + " " : "") + props.className;
7716
- return /* @__PURE__ */ React2.createElement("svg", _extends({
7717
- stroke: "currentColor",
7718
- fill: "currentColor",
7719
- strokeWidth: "0"
7720
- }, conf.attr, attr, svgProps, {
7721
- className,
7722
- style: _objectSpread(_objectSpread({
7723
- color: props.color || conf.color
7724
- }, conf.style), props.style),
7725
- height: computedSize,
7726
- width: computedSize,
7727
- xmlns: "http://www.w3.org/2000/svg"
7728
- }), title && /* @__PURE__ */ React2.createElement("title", null, title), props.children);
7729
- };
7730
- return IconContext !== void 0 ? /* @__PURE__ */ React2.createElement(IconContext.Consumer, null, (conf) => elem(conf)) : elem(DefaultContext);
7731
- }
7732
-
7733
- // node_modules/react-icons/go/index.mjs
7734
- function GoFileMedia(props) {
7735
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M21.75 21.5H2.25A1.75 1.75 0 0 1 .5 19.75V4.25c0-.966.784-1.75 1.75-1.75h19.5c.966 0 1.75.784 1.75 1.75v15.5a1.75 1.75 0 0 1-1.75 1.75ZM2.25 4a.25.25 0 0 0-.25.25v15.5c0 .138.112.25.25.25h3.178L14 10.977a1.749 1.749 0 0 1 2.506-.032L22 16.44V4.25a.25.25 0 0 0-.25-.25ZM22 19.75v-1.19l-6.555-6.554a.248.248 0 0 0-.18-.073.247.247 0 0 0-.178.077L7.497 20H21.75a.25.25 0 0 0 .25-.25ZM10.5 9.25a3.25 3.25 0 1 1-6.5 0 3.25 3.25 0 0 1 6.5 0Zm-1.5 0a1.75 1.75 0 1 0-3.501.001A1.75 1.75 0 0 0 9 9.25Z" }, "child": [] }] })(props);
7736
- }
7737
- function GoLink(props) {
7738
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M14.78 3.653a3.936 3.936 0 1 1 5.567 5.567l-3.627 3.627a3.936 3.936 0 0 1-5.88-.353.75.75 0 0 0-1.18.928 5.436 5.436 0 0 0 8.12.486l3.628-3.628a5.436 5.436 0 1 0-7.688-7.688l-3 3a.75.75 0 0 0 1.06 1.061l3-3Z" }, "child": [] }, { "tag": "path", "attr": { "d": "M7.28 11.153a3.936 3.936 0 0 1 5.88.353.75.75 0 0 0 1.18-.928 5.436 5.436 0 0 0-8.12-.486L2.592 13.72a5.436 5.436 0 1 0 7.688 7.688l3-3a.75.75 0 1 0-1.06-1.06l-3 3a3.936 3.936 0 0 1-5.567-5.568l3.627-3.627Z" }, "child": [] }] })(props);
7739
- }
7740
- function GoListOrdered(props) {
7741
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M3.604 3.089A.75.75 0 0 1 4 3.75V8.5h.75a.75.75 0 0 1 0 1.5h-3a.75.75 0 1 1 0-1.5h.75V5.151l-.334.223a.75.75 0 0 1-.832-1.248l1.5-1a.75.75 0 0 1 .77-.037ZM8.75 5.5a.75.75 0 0 0 0 1.5h11.5a.75.75 0 0 0 0-1.5H8.75Zm0 6a.75.75 0 0 0 0 1.5h11.5a.75.75 0 0 0 0-1.5H8.75Zm0 6a.75.75 0 0 0 0 1.5h11.5a.75.75 0 0 0 0-1.5H8.75ZM5.5 15.75c0-.704-.271-1.286-.72-1.686a2.302 2.302 0 0 0-1.53-.564c-.535 0-1.094.178-1.53.565-.449.399-.72.982-.72 1.685a.75.75 0 0 0 1.5 0c0-.296.104-.464.217-.564A.805.805 0 0 1 3.25 15c.215 0 .406.072.533.185.113.101.217.268.217.565 0 .332-.069.48-.21.657-.092.113-.216.24-.403.419l-.147.14c-.152.144-.33.313-.52.504l-1.5 1.5a.75.75 0 0 0-.22.53v.25c0 .414.336.75.75.75H5A.75.75 0 0 0 5 19H3.31l.47-.47c.176-.176.333-.324.48-.465l.165-.156a5.98 5.98 0 0 0 .536-.566c.358-.447.539-.925.539-1.593Z" }, "child": [] }] })(props);
7742
- }
7743
- function GoListUnordered(props) {
7744
- return GenIcon({ "tag": "svg", "attr": { "viewBox": "0 0 24 24" }, "child": [{ "tag": "path", "attr": { "d": "M8.75 5.5h11.5a.75.75 0 0 1 0 1.5H8.75a.75.75 0 0 1 0-1.5Zm0 6h11.5a.75.75 0 0 1 0 1.5H8.75a.75.75 0 0 1 0-1.5Zm0 6h11.5a.75.75 0 0 1 0 1.5H8.75a.75.75 0 0 1 0-1.5ZM5 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM4 7a1 1 0 1 1 0-2 1 1 0 0 1 0 2Zm0 12a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z" }, "child": [] }] })(props);
7745
- }
7746
-
7747
- // src/post/editor_toolbar.tsx
7748
- import React6 from "react";
7594
+ import {
7595
+ GoFileMedia,
7596
+ GoLink,
7597
+ GoListOrdered,
7598
+ GoListUnordered
7599
+ } from "react-icons/go";
7749
7600
 
7750
7601
  // src/client/env_loader.tsx
7751
- import React3 from "react";
7752
7602
  import { useRouteLoaderData } from "react-router";
7603
+ import { jsx } from "react/jsx-runtime";
7753
7604
 
7754
7605
  // src/client/file_input.tsx
7755
- import "react";
7756
- import React4 from "react";
7606
+ import {
7607
+ useRef
7608
+ } from "react";
7609
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
7757
7610
  function FileInput({
7758
7611
  buttonRef,
7759
7612
  className,
@@ -7763,35 +7616,38 @@ function FileInput({
7763
7616
  onChange,
7764
7617
  ...props
7765
7618
  }) {
7766
- const inputRef = React4.useRef(null);
7767
- return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement(
7768
- "button",
7769
- {
7770
- ref: buttonRef,
7771
- className,
7772
- type: "button",
7773
- onClick: () => {
7774
- inputRef.current?.click();
7619
+ const inputRef = useRef(null);
7620
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
7621
+ /* @__PURE__ */ jsx2(
7622
+ "button",
7623
+ {
7624
+ ref: buttonRef,
7625
+ className,
7626
+ type: "button",
7627
+ onClick: () => {
7628
+ inputRef.current?.click();
7629
+ },
7630
+ children
7775
7631
  }
7776
- },
7777
- children
7778
- ), /* @__PURE__ */ React4.createElement(
7779
- "input",
7780
- {
7781
- ...props,
7782
- type: "file",
7783
- ref: inputRef,
7784
- style: {
7785
- display: "none"
7786
- },
7787
- onChange: async (e) => {
7788
- await onChange?.(e);
7789
- if (inputRef.current) {
7790
- inputRef.current.value = "";
7632
+ ),
7633
+ /* @__PURE__ */ jsx2(
7634
+ "input",
7635
+ {
7636
+ ...props,
7637
+ type: "file",
7638
+ ref: inputRef,
7639
+ style: {
7640
+ display: "none"
7641
+ },
7642
+ onChange: async (e) => {
7643
+ await onChange?.(e);
7644
+ if (inputRef.current) {
7645
+ inputRef.current.value = "";
7646
+ }
7791
7647
  }
7792
7648
  }
7793
- }
7794
- ));
7649
+ )
7650
+ ] });
7795
7651
  }
7796
7652
 
7797
7653
  // src/client/use_user_agent.tsx
@@ -7802,7 +7658,8 @@ import {
7802
7658
  TextEditor
7803
7659
  } from "dn-react-text-editor";
7804
7660
  import { useStoreController } from "react-store-input";
7805
- import React5, { useImperativeHandle, useRef } from "react";
7661
+ import { useImperativeHandle, useRef as useRef2 } from "react";
7662
+ import { jsx as jsx3 } from "react/jsx-runtime";
7806
7663
  function StoreTextEditor({
7807
7664
  store,
7808
7665
  name,
@@ -7812,7 +7669,7 @@ function StoreTextEditor({
7812
7669
  ref,
7813
7670
  ...props
7814
7671
  }) {
7815
- const controllerRef = useRef(null);
7672
+ const controllerRef = useRef2(null);
7816
7673
  useImperativeHandle(
7817
7674
  ref,
7818
7675
  () => controllerRef.current,
@@ -7861,7 +7718,7 @@ function StoreTextEditor({
7861
7718
  }
7862
7719
  return void 0;
7863
7720
  };
7864
- return /* @__PURE__ */ React5.createElement(
7721
+ return /* @__PURE__ */ jsx3(
7865
7722
  TextEditor,
7866
7723
  {
7867
7724
  ...props,
@@ -7879,103 +7736,107 @@ function StoreTextEditor({
7879
7736
  import { generateMetadata } from "dn-react-toolkit/file/client";
7880
7737
 
7881
7738
  // src/post/editor_toolbar.tsx
7739
+ import { jsx as jsx4, jsxs as jsxs2 } from "react/jsx-runtime";
7882
7740
  function EditorToolbar({
7883
7741
  textEditorRef,
7884
7742
  className
7885
7743
  }) {
7886
- return /* @__PURE__ */ React6.createElement(
7744
+ return /* @__PURE__ */ jsxs2(
7887
7745
  "div",
7888
7746
  {
7889
- className: cn("w-full h-12 flex items-center gap-0.5 px-1", className)
7890
- },
7891
- /* @__PURE__ */ React6.createElement(
7892
- FileInput,
7893
- {
7894
- className: "button-icon-base text-[18px]",
7895
- onChange: async (e) => {
7896
- const files = e.target.files;
7897
- if (!files || files.length === 0) {
7898
- return;
7747
+ className: cn("w-full h-12 flex items-center gap-0.5 px-1", className),
7748
+ children: [
7749
+ /* @__PURE__ */ jsx4(
7750
+ FileInput,
7751
+ {
7752
+ className: "button-icon-base text-[18px]",
7753
+ onChange: async (e) => {
7754
+ const files = e.target.files;
7755
+ if (!files || files.length === 0) {
7756
+ return;
7757
+ }
7758
+ textEditorRef.current?.commands.attachFile(Array.from(files));
7759
+ },
7760
+ children: /* @__PURE__ */ jsx4(GoFileMedia, {})
7899
7761
  }
7900
- textEditorRef.current?.commands.attachFile(Array.from(files));
7901
- }
7902
- },
7903
- /* @__PURE__ */ React6.createElement(GoFileMedia, null)
7904
- ),
7905
- /* @__PURE__ */ React6.createElement(
7906
- "button",
7907
- {
7908
- type: "button",
7909
- onClick: () => {
7910
- const href = prompt("\uB9C1\uD06C URL\uC744 \uC785\uB825\uD558\uC138\uC694");
7911
- if (!href) {
7912
- return;
7762
+ ),
7763
+ /* @__PURE__ */ jsx4(
7764
+ "button",
7765
+ {
7766
+ type: "button",
7767
+ onClick: () => {
7768
+ const href = prompt("\uB9C1\uD06C URL\uC744 \uC785\uB825\uD558\uC138\uC694");
7769
+ if (!href) {
7770
+ return;
7771
+ }
7772
+ textEditorRef.current?.commands.toggleMark("link", { href });
7773
+ },
7774
+ className: "button-icon-base text-[20px]",
7775
+ children: /* @__PURE__ */ jsx4(GoLink, {})
7913
7776
  }
7914
- textEditorRef.current?.commands.toggleMark("link", { href });
7915
- },
7916
- className: "button-icon-base text-[20px]"
7917
- },
7918
- /* @__PURE__ */ React6.createElement(GoLink, null)
7919
- ),
7920
- /* @__PURE__ */ React6.createElement(
7921
- "button",
7922
- {
7923
- type: "button",
7924
- onClick: () => {
7925
- textEditorRef.current?.commands.toggleBlockType("heading", {
7926
- level: 2
7927
- });
7928
- },
7929
- className: "button-icon-base text-[18px]"
7930
- },
7931
- /* @__PURE__ */ React6.createElement("span", null, "H2")
7932
- ),
7933
- /* @__PURE__ */ React6.createElement(
7934
- "button",
7935
- {
7936
- type: "button",
7937
- onClick: () => {
7938
- textEditorRef.current?.commands.toggleBlockType("heading", {
7939
- level: 3
7940
- });
7941
- },
7942
- className: "button-icon-base text-[18px]"
7943
- },
7944
- /* @__PURE__ */ React6.createElement("span", null, "H3")
7945
- ),
7946
- /* @__PURE__ */ React6.createElement(
7947
- "button",
7948
- {
7949
- type: "button",
7950
- onClick: () => {
7951
- textEditorRef.current?.commands.wrapInList("ordered_list");
7952
- },
7953
- className: "button-icon-base text-[20px]"
7954
- },
7955
- /* @__PURE__ */ React6.createElement(GoListOrdered, null)
7956
- ),
7957
- /* @__PURE__ */ React6.createElement(
7958
- "button",
7959
- {
7960
- type: "button",
7961
- onClick: () => {
7962
- textEditorRef.current?.commands.wrapInList("bullet_list");
7963
- },
7964
- className: "button-icon-base text-[20px]"
7965
- },
7966
- /* @__PURE__ */ React6.createElement(GoListUnordered, null)
7967
- )
7777
+ ),
7778
+ /* @__PURE__ */ jsx4(
7779
+ "button",
7780
+ {
7781
+ type: "button",
7782
+ onClick: () => {
7783
+ textEditorRef.current?.commands.toggleBlockType("heading", {
7784
+ level: 2
7785
+ });
7786
+ },
7787
+ className: "button-icon-base text-[18px]",
7788
+ children: /* @__PURE__ */ jsx4("span", { children: "H2" })
7789
+ }
7790
+ ),
7791
+ /* @__PURE__ */ jsx4(
7792
+ "button",
7793
+ {
7794
+ type: "button",
7795
+ onClick: () => {
7796
+ textEditorRef.current?.commands.toggleBlockType("heading", {
7797
+ level: 3
7798
+ });
7799
+ },
7800
+ className: "button-icon-base text-[18px]",
7801
+ children: /* @__PURE__ */ jsx4("span", { children: "H3" })
7802
+ }
7803
+ ),
7804
+ /* @__PURE__ */ jsx4(
7805
+ "button",
7806
+ {
7807
+ type: "button",
7808
+ onClick: () => {
7809
+ textEditorRef.current?.commands.wrapInList("ordered_list");
7810
+ },
7811
+ className: "button-icon-base text-[20px]",
7812
+ children: /* @__PURE__ */ jsx4(GoListOrdered, {})
7813
+ }
7814
+ ),
7815
+ /* @__PURE__ */ jsx4(
7816
+ "button",
7817
+ {
7818
+ type: "button",
7819
+ onClick: () => {
7820
+ textEditorRef.current?.commands.wrapInList("bullet_list");
7821
+ },
7822
+ className: "button-icon-base text-[20px]",
7823
+ children: /* @__PURE__ */ jsx4(GoListUnordered, {})
7824
+ }
7825
+ )
7826
+ ]
7827
+ }
7968
7828
  );
7969
7829
  }
7970
7830
 
7971
7831
  // src/post/post_form_page.tsx
7972
- import React16, { useRef as useRef2 } from "react";
7832
+ import { useRef as useRef3 } from "react";
7973
7833
  import "dn-react-text-editor";
7974
7834
 
7975
7835
  // src/post/thumbnail_picker.tsx
7976
7836
  import { useSelector } from "react-store-input";
7977
7837
  import { cn as cn2 } from "dn-react-toolkit/utils";
7978
- import React7, { useEffect, useState } from "react";
7838
+ import { useEffect, useState } from "react";
7839
+ import { jsx as jsx5 } from "react/jsx-runtime";
7979
7840
  function PostThumbnailPicker({
7980
7841
  store,
7981
7842
  textEditorRef
@@ -8013,10 +7874,9 @@ function PostThumbnailPicker({
8013
7874
  unsubscribe();
8014
7875
  };
8015
7876
  }, []);
8016
- return /* @__PURE__ */ React7.createElement("div", { className: "grid grid-cols-6 gap-1" }, thumbnails.map((url, index2) => /* @__PURE__ */ React7.createElement(
7877
+ return /* @__PURE__ */ jsx5("div", { className: "grid grid-cols-6 gap-1", children: thumbnails.map((url, index2) => /* @__PURE__ */ jsx5(
8017
7878
  "button",
8018
7879
  {
8019
- key: index2,
8020
7880
  type: "button",
8021
7881
  className: cn2(
8022
7882
  "border border-neutral-200 rounded-lg overflow-hidden aspect-4/3",
@@ -8026,36 +7886,38 @@ function PostThumbnailPicker({
8026
7886
  store.dispatch((state) => {
8027
7887
  state.thumbnail = url;
8028
7888
  });
8029
- }
7889
+ },
7890
+ children: /* @__PURE__ */ jsx5(
7891
+ "img",
7892
+ {
7893
+ src: url,
7894
+ alt: `Thumbnail ${index2 + 1}`,
7895
+ className: "w-full h-full object-cover"
7896
+ }
7897
+ )
8030
7898
  },
8031
- /* @__PURE__ */ React7.createElement(
8032
- "img",
8033
- {
8034
- src: url,
8035
- alt: `Thumbnail ${index2 + 1}`,
8036
- className: "w-full h-full object-cover"
8037
- }
8038
- )
8039
- )));
7899
+ index2
7900
+ )) });
8040
7901
  }
8041
7902
 
8042
7903
  // src/crud/crud_form_provider.tsx
8043
7904
  import { useNavigate } from "react-router";
8044
7905
  import { useStore } from "react-store-input";
8045
- import { createContext, useContext } from "react";
8046
- import React8 from "react";
7906
+ import {
7907
+ createContext,
7908
+ useContext
7909
+ } from "react";
7910
+ import { jsx as jsx6 } from "react/jsx-runtime";
8047
7911
  var FormContext = createContext({});
8048
7912
 
8049
- // src/crud/crud_form.tsx
8050
- import React10 from "react";
8051
-
8052
7913
  // src/form/create_form_component.tsx
8053
7914
  import { cn as cn3 } from "dn-react-toolkit/utils";
8054
- import React9 from "react";
7915
+ import "react";
7916
+ import { jsx as jsx7 } from "react/jsx-runtime";
8055
7917
  function createComponent(tag, options) {
8056
7918
  return function FormComponent({ className, ...props }) {
8057
7919
  const Tag = tag;
8058
- return /* @__PURE__ */ React9.createElement(Tag, { ...props, className: cn3(options.className, className) });
7920
+ return /* @__PURE__ */ jsx7(Tag, { ...props, className: cn3(options.className, className) });
8059
7921
  };
8060
7922
  }
8061
7923
 
@@ -8072,6 +7934,7 @@ var FormLabel = createComponent("label", {
8072
7934
 
8073
7935
  // src/crud/crud_form.tsx
8074
7936
  import { useStoreComponent } from "react-store-input";
7937
+ import { Fragment as Fragment2, jsx as jsx8, jsxs as jsxs3 } from "react/jsx-runtime";
8075
7938
 
8076
7939
  // src/table/loader.tsx
8077
7940
  import {
@@ -8109,31 +7972,34 @@ import {
8109
7972
  useNavigate as useNavigate2,
8110
7973
  useSearchParams as useSearchParams3
8111
7974
  } from "react-router";
7975
+ import { GoSearch } from "react-icons/go";
8112
7976
 
8113
7977
  // src/table/buttons.tsx
8114
7978
  import { cn as cn4 } from "dn-react-toolkit/utils";
8115
7979
  import { Link, useLocation, useSearchParams } from "react-router";
8116
- import React11 from "react";
7980
+ import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs4 } from "react/jsx-runtime";
8117
7981
 
8118
7982
  // src/table/table.tsx
8119
7983
  import { cn as cn5 } from "dn-react-toolkit/utils";
7984
+ import { GoArrowDown, GoArrowUp } from "react-icons/go";
8120
7985
  import { Link as Link2, useSearchParams as useSearchParams2 } from "react-router";
8121
- import React12 from "react";
7986
+ import { Fragment as Fragment4, jsx as jsx10, jsxs as jsxs5 } from "react/jsx-runtime";
8122
7987
 
8123
7988
  // src/table/page.tsx
8124
- import React13 from "react";
7989
+ import { Fragment as Fragment5, jsx as jsx11, jsxs as jsxs6 } from "react/jsx-runtime";
8125
7990
 
8126
7991
  // src/crud/crud_page.tsx
8127
- import React14 from "react";
7992
+ import { jsx as jsx12 } from "react/jsx-runtime";
8128
7993
 
8129
7994
  // src/crud/generate_pages.tsx
8130
7995
  import { useLocation as useLocation4 } from "react-router";
8131
- import React15 from "react";
7996
+ import { jsx as jsx13 } from "react/jsx-runtime";
8132
7997
 
8133
7998
  // src/crud/generate_routes.tsx
8134
7999
  var Routes = __toESM(require_routes());
8135
8000
 
8136
8001
  // src/post/post_form_page.tsx
8002
+ import { Fragment as Fragment6, jsx as jsx14, jsxs as jsxs7 } from "react/jsx-runtime";
8137
8003
  var createPostFormPage = ({
8138
8004
  header: AdminPageHeader,
8139
8005
  textEditorClassName,
@@ -8142,128 +8008,190 @@ var createPostFormPage = ({
8142
8008
  return function PostFormPage({ form }) {
8143
8009
  const { boards } = useLoaderData3();
8144
8010
  const component = useStoreComponent2(form.store);
8145
- const textEditorRef = useRef2(null);
8146
- return /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
8147
- AdminPageHeader,
8148
- {
8149
- title: `${form.name} \uCD94\uAC00`,
8150
- actions: /* @__PURE__ */ React16.createElement(React16.Fragment, null, /* @__PURE__ */ React16.createElement(
8151
- "button",
8152
- {
8153
- type: "button",
8154
- className: "button-outline",
8155
- onClick: () => {
8156
- form.delete();
8011
+ const textEditorRef = useRef3(null);
8012
+ return /* @__PURE__ */ jsxs7(Fragment6, { children: [
8013
+ /* @__PURE__ */ jsx14(
8014
+ AdminPageHeader,
8015
+ {
8016
+ title: `${form.name} \uCD94\uAC00`,
8017
+ actions: /* @__PURE__ */ jsxs7(Fragment6, { children: [
8018
+ /* @__PURE__ */ jsx14(
8019
+ "button",
8020
+ {
8021
+ type: "button",
8022
+ className: "button-outline",
8023
+ onClick: () => {
8024
+ form.delete();
8025
+ },
8026
+ children: "\uC0AD\uC81C\uD558\uAE30"
8027
+ }
8028
+ ),
8029
+ /* @__PURE__ */ jsx14(
8030
+ "button",
8031
+ {
8032
+ type: "button",
8033
+ className: "button-primary",
8034
+ onClick: () => {
8035
+ form.submit();
8036
+ },
8037
+ children: "\uC800\uC7A5\uD558\uAE30"
8038
+ }
8039
+ )
8040
+ ] })
8041
+ }
8042
+ ),
8043
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsxs7("div", { className: "max-w-7xl mx-auto w-full", children: [
8044
+ /* @__PURE__ */ jsxs7(FormRow, { children: [
8045
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8046
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uACF5\uAC1C\uC5EC\uBD80" }),
8047
+ /* @__PURE__ */ jsxs7(
8048
+ component.select,
8049
+ {
8050
+ name: "isPublic",
8051
+ className: "select-form",
8052
+ toInputValue: (value) => value ? "true" : "false",
8053
+ toStateValue: (value) => Boolean(value === "true"),
8054
+ children: [
8055
+ /* @__PURE__ */ jsx14("option", { value: "true", children: "\uACF5\uAC1C" }),
8056
+ /* @__PURE__ */ jsx14("option", { value: "false", children: "\uBE44\uACF5\uAC1C" })
8057
+ ]
8058
+ }
8059
+ )
8060
+ ] }),
8061
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8062
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uC791\uC131\uC77C\uC2DC" }),
8063
+ /* @__PURE__ */ jsx14(
8064
+ component.input,
8065
+ {
8066
+ name: "createdAt",
8067
+ className: "input-form",
8068
+ type: "datetime-local"
8069
+ }
8070
+ )
8071
+ ] })
8072
+ ] }),
8073
+ /* @__PURE__ */ jsxs7(FormRow, { children: [
8074
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8075
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uAC8C\uC2DC\uD310" }),
8076
+ /* @__PURE__ */ jsxs7(component.select, { name: "boardId", className: "select-form", children: [
8077
+ /* @__PURE__ */ jsx14("option", { value: "", children: "\uC120\uD0DD\uD558\uC138\uC694" }),
8078
+ boards.map((board) => /* @__PURE__ */ jsx14("option", { value: board.id, children: board.title }, board.id))
8079
+ ] })
8080
+ ] }),
8081
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8082
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uCE74\uD14C\uACE0\uB9AC" }),
8083
+ /* @__PURE__ */ jsx14(
8084
+ component.input,
8085
+ {
8086
+ name: "category",
8087
+ className: "input-form",
8088
+ placeholder: "\uCE74\uD14C\uACE0\uB9AC"
8089
+ }
8090
+ )
8091
+ ] })
8092
+ ] }),
8093
+ /* @__PURE__ */ jsxs7(FormRow, { children: [
8094
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8095
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uC81C\uBAA9" }),
8096
+ /* @__PURE__ */ jsx14(
8097
+ component.input,
8098
+ {
8099
+ name: "title",
8100
+ className: "input-form",
8101
+ placeholder: "\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",
8102
+ onChange: (e) => {
8103
+ const title = e.target.value;
8104
+ form.store.dispatch((state) => {
8105
+ state.slug = toSlug(title);
8106
+ });
8107
+ }
8108
+ }
8109
+ )
8110
+ ] }),
8111
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8112
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uBD80\uC81C\uBAA9" }),
8113
+ /* @__PURE__ */ jsx14(
8114
+ component.input,
8115
+ {
8116
+ name: "subtitle",
8117
+ className: "input-form",
8118
+ placeholder: "\uBD80\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694"
8119
+ }
8120
+ )
8121
+ ] })
8122
+ ] }),
8123
+ /* @__PURE__ */ jsxs7(FormRow, { children: [
8124
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8125
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uC2AC\uB7EC\uADF8" }),
8126
+ /* @__PURE__ */ jsx14(
8127
+ component.input,
8128
+ {
8129
+ name: "slug",
8130
+ className: "input-form",
8131
+ placeholder: "\uC81C\uBAA9"
8132
+ }
8133
+ )
8134
+ ] }),
8135
+ /* @__PURE__ */ jsxs7(FormEntry, { children: [
8136
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uD0DC\uADF8" }),
8137
+ /* @__PURE__ */ jsx14(
8138
+ component.input,
8139
+ {
8140
+ name: "tags",
8141
+ className: "input-form",
8142
+ placeholder: "\uD0DC\uADF8 1, \uD0DC\uADF8 2, \uD0DC\uADF8 3"
8143
+ }
8144
+ )
8145
+ ] })
8146
+ ] }),
8147
+ /* @__PURE__ */ jsx14(FormRow, { children: /* @__PURE__ */ jsxs7(FormEntry, { children: [
8148
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uC124\uBA85" }),
8149
+ /* @__PURE__ */ jsx14(
8150
+ StoreTextEditor,
8151
+ {
8152
+ store: form.store,
8153
+ mode: "text",
8154
+ name: "description",
8155
+ className: "text-editor min-h-[80px]",
8156
+ placeholder: "\uC124\uBA85"
8157
8157
  }
8158
- },
8159
- "\uC0AD\uC81C\uD558\uAE30"
8160
- ), /* @__PURE__ */ React16.createElement(
8161
- "button",
8162
- {
8163
- type: "button",
8164
- className: "button-primary",
8165
- onClick: () => {
8166
- form.submit();
8158
+ )
8159
+ ] }) }),
8160
+ /* @__PURE__ */ jsx14(FormRow, { children: /* @__PURE__ */ jsxs7(FormEntry, { children: [
8161
+ /* @__PURE__ */ jsx14(FormLabel, { children: "\uC378\uB124\uC77C" }),
8162
+ /* @__PURE__ */ jsx14(
8163
+ PostThumbnailPicker,
8164
+ {
8165
+ store: form.store,
8166
+ textEditorRef
8167
+ }
8168
+ )
8169
+ ] }) })
8170
+ ] }) }),
8171
+ /* @__PURE__ */ jsx14("div", { className: "sticky top-[160px] z-998 bg-white px-4", children: /* @__PURE__ */ jsx14(
8172
+ EditorToolbar,
8173
+ {
8174
+ textEditorRef,
8175
+ className: "max-w-7xl mx-auto"
8176
+ }
8177
+ ) }),
8178
+ /* @__PURE__ */ jsx14("div", { className: "px-4", children: /* @__PURE__ */ jsx14(
8179
+ StoreTextEditor,
8180
+ {
8181
+ ref: textEditorRef,
8182
+ store: form.store,
8183
+ name: "html",
8184
+ placeholder: "\uC5EC\uAE30\uC5D0 \uBCF8\uBB38\uC744 \uC791\uC131\uD558\uC138\uC694...",
8185
+ updateDelay: 500,
8186
+ editor: {
8187
+ attributes: {
8188
+ class: cn6(textEditorClassName, "pb-[50vh]")
8167
8189
  }
8168
8190
  },
8169
- "\uC800\uC7A5\uD558\uAE30"
8170
- ))
8171
- }
8172
- ), /* @__PURE__ */ React16.createElement("div", { className: "px-4" }, /* @__PURE__ */ React16.createElement("div", { className: "max-w-7xl mx-auto w-full" }, /* @__PURE__ */ React16.createElement(FormRow, null, /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uACF5\uAC1C\uC5EC\uBD80"), /* @__PURE__ */ React16.createElement(
8173
- component.select,
8174
- {
8175
- name: "isPublic",
8176
- className: "select-form",
8177
- toInputValue: (value) => value ? "true" : "false",
8178
- toStateValue: (value) => Boolean(value === "true")
8179
- },
8180
- /* @__PURE__ */ React16.createElement("option", { value: "true" }, "\uACF5\uAC1C"),
8181
- /* @__PURE__ */ React16.createElement("option", { value: "false" }, "\uBE44\uACF5\uAC1C")
8182
- )), /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uC791\uC131\uC77C\uC2DC"), /* @__PURE__ */ React16.createElement(
8183
- component.input,
8184
- {
8185
- name: "createdAt",
8186
- className: "input-form",
8187
- type: "datetime-local"
8188
- }
8189
- ))), /* @__PURE__ */ React16.createElement(FormRow, null, /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uAC8C\uC2DC\uD310"), /* @__PURE__ */ React16.createElement(component.select, { name: "boardId", className: "select-form" }, /* @__PURE__ */ React16.createElement("option", { value: "" }, "\uC120\uD0DD\uD558\uC138\uC694"), boards.map((board) => /* @__PURE__ */ React16.createElement("option", { key: board.id, value: board.id }, board.title)))), /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uCE74\uD14C\uACE0\uB9AC"), /* @__PURE__ */ React16.createElement(
8190
- component.input,
8191
- {
8192
- name: "category",
8193
- className: "input-form",
8194
- placeholder: "\uCE74\uD14C\uACE0\uB9AC"
8195
- }
8196
- ))), /* @__PURE__ */ React16.createElement(FormRow, null, /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uC81C\uBAA9"), /* @__PURE__ */ React16.createElement(
8197
- component.input,
8198
- {
8199
- name: "title",
8200
- className: "input-form",
8201
- placeholder: "\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694",
8202
- onChange: (e) => {
8203
- const title = e.target.value;
8204
- form.store.dispatch((state) => {
8205
- state.slug = toSlug(title);
8206
- });
8191
+ attachFile
8207
8192
  }
8208
- }
8209
- )), /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uBD80\uC81C\uBAA9"), /* @__PURE__ */ React16.createElement(
8210
- component.input,
8211
- {
8212
- name: "subtitle",
8213
- className: "input-form",
8214
- placeholder: "\uBD80\uC81C\uBAA9\uC744 \uC785\uB825\uD558\uC138\uC694"
8215
- }
8216
- ))), /* @__PURE__ */ React16.createElement(FormRow, null, /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uC2AC\uB7EC\uADF8"), /* @__PURE__ */ React16.createElement(
8217
- component.input,
8218
- {
8219
- name: "slug",
8220
- className: "input-form",
8221
- placeholder: "\uC81C\uBAA9"
8222
- }
8223
- )), /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uD0DC\uADF8"), /* @__PURE__ */ React16.createElement(
8224
- component.input,
8225
- {
8226
- name: "tags",
8227
- className: "input-form",
8228
- placeholder: "\uD0DC\uADF8 1, \uD0DC\uADF8 2, \uD0DC\uADF8 3"
8229
- }
8230
- ))), /* @__PURE__ */ React16.createElement(FormRow, null, /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uC124\uBA85"), /* @__PURE__ */ React16.createElement(
8231
- StoreTextEditor,
8232
- {
8233
- store: form.store,
8234
- mode: "text",
8235
- name: "description",
8236
- className: "text-editor min-h-[80px]",
8237
- placeholder: "\uC124\uBA85"
8238
- }
8239
- ))), /* @__PURE__ */ React16.createElement(FormRow, null, /* @__PURE__ */ React16.createElement(FormEntry, null, /* @__PURE__ */ React16.createElement(FormLabel, null, "\uC378\uB124\uC77C"), /* @__PURE__ */ React16.createElement(
8240
- PostThumbnailPicker,
8241
- {
8242
- store: form.store,
8243
- textEditorRef
8244
- }
8245
- ))))), /* @__PURE__ */ React16.createElement("div", { className: "sticky top-[160px] z-998 bg-white px-4" }, /* @__PURE__ */ React16.createElement(
8246
- EditorToolbar,
8247
- {
8248
- textEditorRef,
8249
- className: "max-w-7xl mx-auto"
8250
- }
8251
- )), /* @__PURE__ */ React16.createElement("div", { className: "px-4" }, /* @__PURE__ */ React16.createElement(
8252
- StoreTextEditor,
8253
- {
8254
- ref: textEditorRef,
8255
- store: form.store,
8256
- name: "html",
8257
- placeholder: "\uC5EC\uAE30\uC5D0 \uBCF8\uBB38\uC744 \uC791\uC131\uD558\uC138\uC694...",
8258
- updateDelay: 500,
8259
- editor: {
8260
- attributes: {
8261
- class: cn6(textEditorClassName, "pb-[50vh]")
8262
- }
8263
- },
8264
- attachFile
8265
- }
8266
- )));
8193
+ ) })
8194
+ ] });
8267
8195
  };
8268
8196
  };
8269
8197
  export {