@akanjs/ui 0.9.48 → 0.9.50

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 (107) hide show
  1. package/Data/CardList.d.ts +1 -1
  2. package/Data/ListContainer.d.ts +4 -5
  3. package/Data/QueryMaker.d.ts +1 -1
  4. package/Data/TableList.d.ts +1 -1
  5. package/Data/index.d.ts +0 -1
  6. package/Field.d.ts +1 -1
  7. package/Layout/Navbar.d.ts +1 -1
  8. package/Model/AdminPanel.d.ts +2 -3
  9. package/System/CSR.d.ts +2 -2
  10. package/System/Client.d.ts +4 -2
  11. package/System/Common.d.ts +10 -9
  12. package/System/SSR.d.ts +2 -2
  13. package/cjs/Button.js +3 -4
  14. package/cjs/Data/Dashboard.js +1 -2
  15. package/cjs/Data/Insight.js +1 -2
  16. package/cjs/Data/Item.js +3 -4
  17. package/cjs/Data/ListContainer.js +5 -19
  18. package/cjs/Data/QueryMaker.js +1 -292
  19. package/cjs/Data/TableList.js +3 -3
  20. package/cjs/Data/index.js +2 -2
  21. package/cjs/DatePicker.js +4 -5
  22. package/cjs/Dialog/Modal.js +2 -3
  23. package/cjs/Empty.js +2 -3
  24. package/cjs/Field.js +42 -46
  25. package/cjs/Input.js +11 -12
  26. package/cjs/Layout/BottomTab.js +1 -2
  27. package/cjs/Link/CsrLink.js +1 -2
  28. package/cjs/Link/NextLink.js +1 -2
  29. package/cjs/Load/Page.js +1 -2
  30. package/cjs/Load/Units.js +4 -3
  31. package/cjs/Load/View.js +3 -2
  32. package/cjs/Model/Edit.js +2 -3
  33. package/cjs/Model/EditModal.js +5 -4
  34. package/cjs/Model/New.js +2 -3
  35. package/cjs/Model/NewWrapper_Client.js +3 -2
  36. package/cjs/Model/Remove.js +6 -8
  37. package/cjs/Model/RemoveWrapper.js +3 -4
  38. package/cjs/Model/SureToRemove.js +8 -10
  39. package/cjs/Model/ViewEditModal.js +4 -4
  40. package/cjs/Popconfirm.js +3 -4
  41. package/cjs/RecentTime.js +1 -2
  42. package/cjs/Select.js +2 -2
  43. package/cjs/Signal/Arg.js +2 -2
  44. package/cjs/Signal/Doc.js +2 -2
  45. package/cjs/Signal/GraphQL.js +4 -4
  46. package/cjs/Signal/Message.js +2 -4
  47. package/cjs/Signal/Object.js +12 -17
  48. package/cjs/Signal/PubSub.js +2 -4
  49. package/cjs/Signal/RestApi.js +2 -2
  50. package/cjs/System/CSR.js +3 -6
  51. package/cjs/System/Client.js +18 -7
  52. package/cjs/System/Common.js +2 -2
  53. package/cjs/System/Messages.js +2 -4
  54. package/cjs/System/Reconnect.js +16 -21
  55. package/cjs/System/Root.js +0 -4
  56. package/cjs/System/SSR.js +30 -24
  57. package/cjs/System/SelectLanguage.js +1 -2
  58. package/cjs/ToggleSelect.js +4 -5
  59. package/cjs/Unauthorized.js +2 -3
  60. package/esm/Button.js +3 -4
  61. package/esm/Data/Dashboard.js +1 -2
  62. package/esm/Data/Insight.js +1 -2
  63. package/esm/Data/Item.js +2 -3
  64. package/esm/Data/ListContainer.js +6 -20
  65. package/esm/Data/QueryMaker.js +1 -299
  66. package/esm/Data/TableList.js +2 -2
  67. package/esm/Data/index.js +3 -3
  68. package/esm/DatePicker.js +5 -6
  69. package/esm/Dialog/Modal.js +2 -3
  70. package/esm/Empty.js +2 -3
  71. package/esm/Field.js +30 -34
  72. package/esm/Input.js +7 -8
  73. package/esm/Layout/BottomTab.js +1 -2
  74. package/esm/Link/CsrLink.js +1 -2
  75. package/esm/Link/NextLink.js +1 -2
  76. package/esm/Load/Page.js +1 -2
  77. package/esm/Load/Units.js +4 -3
  78. package/esm/Load/View.js +3 -2
  79. package/esm/Model/Edit.js +2 -3
  80. package/esm/Model/EditModal.js +8 -7
  81. package/esm/Model/New.js +2 -3
  82. package/esm/Model/NewWrapper_Client.js +3 -2
  83. package/esm/Model/Remove.js +6 -8
  84. package/esm/Model/RemoveWrapper.js +3 -4
  85. package/esm/Model/SureToRemove.js +8 -10
  86. package/esm/Model/ViewEditModal.js +3 -3
  87. package/esm/Popconfirm.js +3 -4
  88. package/esm/RecentTime.js +1 -2
  89. package/esm/Select.js +3 -3
  90. package/esm/Signal/Arg.js +1 -1
  91. package/esm/Signal/Doc.js +1 -1
  92. package/esm/Signal/GraphQL.js +4 -4
  93. package/esm/Signal/Message.js +1 -3
  94. package/esm/Signal/Object.js +13 -18
  95. package/esm/Signal/PubSub.js +1 -3
  96. package/esm/Signal/RestApi.js +1 -1
  97. package/esm/System/CSR.js +3 -6
  98. package/esm/System/Client.js +22 -12
  99. package/esm/System/Common.js +2 -2
  100. package/esm/System/Messages.js +1 -3
  101. package/esm/System/Reconnect.js +15 -10
  102. package/esm/System/Root.js +0 -4
  103. package/esm/System/SSR.js +30 -24
  104. package/esm/System/SelectLanguage.js +1 -2
  105. package/esm/ToggleSelect.js +3 -4
  106. package/esm/Unauthorized.js +2 -3
  107. package/package.json +1 -1
package/esm/Input.js CHANGED
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { clsx } from "@akanjs/client";
3
+ import { clsx, usePage } from "@akanjs/client";
4
4
  import { isEmail } from "@akanjs/common";
5
- import { usePage } from "@akanjs/next";
6
5
  import {
7
6
  useEffect,
8
7
  useRef,
@@ -30,7 +29,7 @@ const Input = ({
30
29
  const [firstFocus, setFirstFocus] = useState(true);
31
30
  const validateResult = validate ? validate(value) : void 0;
32
31
  const status = !nullable && !value ? null : !value.length ? "warning" : validateResult === true ? "success" : "error";
33
- const invalidMessage = value && !value.length || validateResult === true || firstFocus ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
32
+ const invalidMessage = value && !value.length || validateResult === true || firstFocus ? null : validateResult === false ? l("base.invalidValueError") : validateResult;
34
33
  const statusClass = inputStyleType === "bordered" ? status === "error" ? "input-error" : !firstFocus && status === "warning" ? "input-warning" : status === "success" ? "input-success" : "" : "";
35
34
  const inputType = inputStyleType === "bordered" ? "input" : inputStyleType === "borderless" ? "input-ghost" : "border-0 border-b rounded-none";
36
35
  const handleKeyDown = (e) => {
@@ -101,7 +100,7 @@ const TextArea = ({
101
100
  const validateResult = validate(value);
102
101
  const [firstFocus, setFirstFocus] = useState(true);
103
102
  const status = !nullable && !value.length ? "warning" : validateResult === true ? "success" : "error";
104
- const invalidMessage = !value.length || validateResult === true || firstFocus ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
103
+ const invalidMessage = !value.length || validateResult === true || firstFocus ? null : validateResult === false ? l("base.invalidValueError") : validateResult;
105
104
  const statusClass = status === "error" ? "textarea-error" : !firstFocus && status === "warning" ? "textarea-warning" : status === "success" ? "textarea-success" : "";
106
105
  const handleKeyDown = (e) => {
107
106
  if (onPressEnter && e.key === "Enter")
@@ -165,7 +164,7 @@ const Password = ({
165
164
  const [firstFocus, setFirstFocus] = useState(true);
166
165
  const [showPassword, setShowPassword] = useState(false);
167
166
  const status = !nullable && !value.length ? "warning" : validateResult === true ? "success" : "error";
168
- const invalidMessage = !value.length || validateResult === true || firstFocus ? "" : validateResult === false ? l("util.invalidValueError") : validateResult;
167
+ const invalidMessage = !value.length || validateResult === true || firstFocus ? "" : validateResult === false ? l("base.invalidValueError") : validateResult;
169
168
  const statusClass = status === "error" ? "input-error" : !firstFocus && status === "warning" ? "input-warning" : status === "success" ? "input-success" : "";
170
169
  const handleKeyDown = (e) => {
171
170
  if (onPressEnter && e.key === "Enter")
@@ -250,9 +249,9 @@ const Email = ({
250
249
  const inputRef = useRef(null);
251
250
  const isValidEmail = isEmail(value);
252
251
  const [firstFocus, setFirstFocus] = useState(true);
253
- const validateResult = !isValidEmail ? l("util.emailInvalidError") : validate(value);
252
+ const validateResult = !isValidEmail ? l("base.emailInvalidError") : validate(value);
254
253
  const status = !nullable && !value.length ? "warning" : !isValidEmail ? "error" : validateResult === true ? "success" : "error";
255
- const invalidMessage = !value.length || validateResult === true || firstFocus ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
254
+ const invalidMessage = !value.length || validateResult === true || firstFocus ? null : validateResult === false ? l("base.invalidValueError") : validateResult;
256
255
  const statusClass = status === "error" ? "input-error" : !firstFocus && status === "warning" ? "input-warning" : status === "success" ? "input-success" : "";
257
256
  const inputType = inputStyleType === "bordered" ? "input-bordered" : inputStyleType === "borderless" ? "input" : "input-bordered rounded-none";
258
257
  const handleKeyDown = (e) => {
@@ -332,7 +331,7 @@ const Number = ({
332
331
  const [firstFocus, setFirstFocus] = useState(true);
333
332
  const [formatValue, setFormatValue] = useState(generateFormat());
334
333
  const status = validate !== void 0 ? validateResult === true ? "success" : "error" : !nullable && value === null ? "warning" : "";
335
- const invalidMessage = value === null || validateResult === true ? null : validateResult === false ? l("util.invalidValueError") : validateResult;
334
+ const invalidMessage = value === null || validateResult === true ? null : validateResult === false ? l("base.invalidValueError") : validateResult;
336
335
  const statusClass = validate !== void 0 ? status === "error" ? "input-error" : !firstFocus && status === "warning" ? "input-warning" : status === "success" ? "input-success" : "input" : "input";
337
336
  const handleKeyDown = (e) => {
338
337
  const numberValue = parseFloat(e.currentTarget.value.replace(/[^\d-]/g, ""));
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { clsx } from "@akanjs/client";
4
- import { usePage } from "@akanjs/next";
3
+ import { clsx, usePage } from "@akanjs/client";
5
4
  import { useEffect, useState } from "react";
6
5
  import { Link } from "../Link";
7
6
  import { BottomInset } from "./BottomInset";
@@ -1,7 +1,6 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { clsx, getPathInfo, router } from "@akanjs/client";
4
- import { usePage } from "@akanjs/next";
3
+ import { clsx, getPathInfo, router, usePage } from "@akanjs/client";
5
4
  import { st } from "@akanjs/store";
6
5
  import { Browser } from "@capacitor/browser";
7
6
  function CsrLink({
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { clsx, getPathInfo } from "@akanjs/client";
3
+ import { clsx, getPathInfo, usePage } from "@akanjs/client";
4
4
  import { Logger } from "@akanjs/common";
5
- import { usePage } from "@akanjs/next";
6
5
  import { st } from "@akanjs/store";
7
6
  import NextjsLink from "next/link";
8
7
  function NextLink({
package/esm/Load/Page.js CHANGED
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { baseClientEnv } from "@akanjs/base";
3
3
  import { PageCSR } from "./PageCSR";
4
4
  const Page = baseClientEnv.renderMode === "csr" ? PageCSR : ({ loader, render }) => {
5
- const promise = new Promise((resolve, reject) => {
5
+ return new Promise((resolve, reject) => {
6
6
  loader().then((data) => {
7
7
  resolve(render(data));
8
8
  }).catch((error) => {
@@ -13,7 +13,6 @@ const Page = baseClientEnv.renderMode === "csr" ? PageCSR : ({ loader, render })
13
13
  resolve(/* @__PURE__ */ jsx("div", { className: "text-red-500", children: message }));
14
14
  });
15
15
  });
16
- return promise;
17
16
  };
18
17
  var Page_default = Page;
19
18
  export {
package/esm/Load/Units.js CHANGED
@@ -3,8 +3,8 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { DataList } from "@akanjs/base";
4
4
  import { clsx } from "@akanjs/client";
5
5
  import { capitalize, isQueryEqual, lowerlize } from "@akanjs/common";
6
+ import { constantInfo } from "@akanjs/constant";
6
7
  import { useFetch } from "@akanjs/next";
7
- import { fetch } from "@akanjs/signal";
8
8
  import { st } from "@akanjs/store";
9
9
  import { useEffect, useMemo, useRef } from "react";
10
10
  import { Empty } from "../Empty";
@@ -33,6 +33,7 @@ function Render({
33
33
  const storeGet = st.get;
34
34
  const { refName, sliceName } = init;
35
35
  const [modelName, ModelName] = [lowerlize(refName), capitalize(refName)];
36
+ const cnst = constantInfo.getDatabase(refName);
36
37
  const names = {
37
38
  model: modelName,
38
39
  modelList: `${modelName}List`,
@@ -80,14 +81,14 @@ function Render({
80
81
  if (loaded.current)
81
82
  return modelList;
82
83
  const initModelObjList = init[names.modelObjList];
83
- const lightCrystalizeModel = fetch[names.lightCrystalizeModel];
84
+ const lightCrystalizeModel = cnst.lightCrystalize;
84
85
  return new DataList(initModelObjList.map((model) => lightCrystalizeModel(model)));
85
86
  }, []);
86
87
  useEffect(() => {
87
88
  if (loaded.current)
88
89
  return;
89
90
  const modelObjInsight = init[names.modelObjInsight];
90
- const crystalizeModelInsight = fetch[names.crystalizeModelInsight];
91
+ const crystalizeModelInsight = cnst.crystalizeInsight;
91
92
  const insight2 = crystalizeModelInsight(modelObjInsight);
92
93
  const initPageOfModel2 = init[names.pageOfModel];
93
94
  const initLastPageOfModel = init[names.lastPageOfModel];
package/esm/Load/View.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
- import { capitalize } from "@akanjs/common";
4
+ import { constantInfo } from "@akanjs/constant";
5
5
  import { useFetch } from "@akanjs/next";
6
6
  import { st } from "@akanjs/store";
7
7
  import { useEffect, useMemo, useRef } from "react";
@@ -20,6 +20,7 @@ function Render({
20
20
  const storeGet = st.get;
21
21
  const { refName } = view;
22
22
  const model = storeUse[refName]();
23
+ const cnst = constantInfo.getDatabase(refName);
23
24
  const modelLoading = storeUse[`${refName}Loading`]();
24
25
  const modelObj = view[`${refName}Obj`];
25
26
  const modelViewAt = view[`${refName}ViewAt`];
@@ -29,7 +30,7 @@ function Render({
29
30
  if (loaded.current)
30
31
  return model;
31
32
  const modelObj2 = view[`${refName}Obj`];
32
- const crystalizeModel = fetch[`crystalize${capitalize(refName)}`];
33
+ const crystalizeModel = cnst.crystalize;
33
34
  const crystal = crystalizeModel(modelObj2);
34
35
  return crystal;
35
36
  }, []);
package/esm/Model/Edit.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { clsx } from "@akanjs/client";
3
- import { usePage } from "@akanjs/next";
2
+ import { clsx, usePage } from "@akanjs/client";
4
3
  import { AiOutlineEdit } from "react-icons/ai";
5
4
  import EditModal from "./EditModal";
6
5
  import EditWrapper from "./EditWrapper";
@@ -26,7 +25,7 @@ function Edit({
26
25
  children: [
27
26
  /* @__PURE__ */ jsx(AiOutlineEdit, {}),
28
27
  " ",
29
- type === "button" ? l("shared.edit") : null
28
+ type === "button" ? l("base.edit") : null
30
29
  ]
31
30
  }
32
31
  ),
@@ -1,10 +1,10 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { clsx, router } from "@akanjs/client";
3
+ import { clsx, router, usePage } from "@akanjs/client";
4
4
  import { capitalize, deepObjectify, lowerlize } from "@akanjs/common";
5
- import { getFullModelRef } from "@akanjs/constant";
6
- import { useDebounce, usePage } from "@akanjs/next";
7
- import { fetch, immerify } from "@akanjs/signal";
5
+ import { constantInfo } from "@akanjs/constant";
6
+ import { useDebounce } from "@akanjs/next";
7
+ import { immerify } from "@akanjs/signal";
8
8
  import { st } from "@akanjs/store";
9
9
  import { use, useCallback, useEffect, useMemo } from "react";
10
10
  import { AiOutlinePlus, AiOutlineSave } from "react-icons/ai";
@@ -109,8 +109,9 @@ function EditModal({
109
109
  return;
110
110
  const refName2 = modelEdit.refName;
111
111
  const editType = refName2 && modelEdit[names.modelObj] ? "edit" : "new";
112
- const crystalizeModel = fetch[names.crystalizeModel];
113
- const modelRef = getFullModelRef(modelName);
112
+ const cnst = constantInfo.getDatabase(modelName);
113
+ const crystalizeModel = cnst.crystalize;
114
+ const modelRef = cnst.full;
114
115
  if (editType === "edit") {
115
116
  const crystal = crystalizeModel(modelEdit[names.modelObj]);
116
117
  st.set({
@@ -175,7 +176,7 @@ function EditModal({
175
176
  },
176
177
  children: [
177
178
  modelFormId ? /* @__PURE__ */ jsx(AiOutlineSave, {}) : /* @__PURE__ */ jsx(AiOutlinePlus, {}),
178
- l(modelFormId ? "shared.updateModel" : "shared.createModel", {
179
+ l(modelFormId ? "base.updateModel" : "base.createModel", {
179
180
  model: l.field(names.model, "modelName")
180
181
  })
181
182
  ]
package/esm/Model/New.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { jsx, jsxs } from "react/jsx-runtime";
2
- import { clsx } from "@akanjs/client";
3
- import { usePage } from "@akanjs/next";
2
+ import { clsx, usePage } from "@akanjs/client";
4
3
  import { AiOutlinePlus } from "react-icons/ai";
5
4
  import EditModal from "./EditModal";
6
5
  import NewWrapper from "./NewWrapper";
@@ -26,7 +25,7 @@ function New({
26
25
  children: [
27
26
  /* @__PURE__ */ jsx(AiOutlinePlus, {}),
28
27
  " ",
29
- type === "button" ? l("shared.new") : null
28
+ type === "button" ? l("base.new") : null
30
29
  ]
31
30
  }
32
31
  ),
@@ -2,7 +2,7 @@
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { clsx } from "@akanjs/client";
4
4
  import { capitalize } from "@akanjs/common";
5
- import { fetch } from "@akanjs/signal";
5
+ import { constantInfo } from "@akanjs/constant";
6
6
  import { st } from "@akanjs/store";
7
7
  const NewWrapper_Client = ({
8
8
  children,
@@ -22,7 +22,8 @@ const NewWrapper_Client = ({
22
22
  };
23
23
  const storeDo = st.do;
24
24
  const storeUse = st.use;
25
- const crystalizeModel = fetch[names.crystalizeModel];
25
+ const cnst = constantInfo.getDatabase(modelName);
26
+ const crystalizeModel = cnst.crystalize;
26
27
  const modelModal = storeUse[names.modelModal]();
27
28
  const disabled = modelModal === "edit";
28
29
  return /* @__PURE__ */ jsx(
@@ -1,9 +1,7 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
- import { clsx, router } from "@akanjs/client";
3
+ import { clsx, msg, router, usePage } from "@akanjs/client";
4
4
  import { capitalize } from "@akanjs/common";
5
- import { msg } from "@akanjs/dictionary";
6
- import { usePage } from "@akanjs/next";
7
5
  import { st } from "@akanjs/store";
8
6
  import { useMemo, useState } from "react";
9
7
  import { AiOutlineDelete } from "react-icons/ai";
@@ -33,7 +31,7 @@ function Remove({ className, name, modelId, sliceName, modal, redirect }) {
33
31
  children: [
34
32
  /* @__PURE__ */ jsx(AiOutlineDelete, {}),
35
33
  " ",
36
- l("shared.remove")
34
+ l("base.remove")
37
35
  ]
38
36
  }
39
37
  ),
@@ -44,14 +42,14 @@ function Remove({ className, name, modelId, sliceName, modal, redirect }) {
44
42
  onCancel: () => {
45
43
  setModalOpen(false);
46
44
  },
47
- title: /* @__PURE__ */ jsx("div", { className: "text-error text-lg font-bold", children: l("shared.removeModel", { model: l(`${modelName}.modelName`) }) }),
45
+ title: /* @__PURE__ */ jsx("div", { className: "text-error text-lg font-bold", children: l("base.removeModel", { model: l(`${modelName}.modelName`) }) }),
48
46
  action: /* @__PURE__ */ jsx(
49
47
  Button,
50
48
  {
51
49
  className: "btn btn-warning w-full",
52
50
  onClick: async (e, { onError }) => {
53
51
  await storeDo[names.removeModel](modelId, { onError, modal });
54
- msg.success("shared.removeSuccess", { data: { model: l(`${modelName}.modelName`) } });
52
+ msg.success("base.removeSuccess", { data: { model: l(`${modelName}.modelName`) } });
55
53
  setModalOpen(false);
56
54
  if (!redirect)
57
55
  return;
@@ -60,10 +58,10 @@ function Remove({ className, name, modelId, sliceName, modal, redirect }) {
60
58
  else
61
59
  router.push(redirect);
62
60
  },
63
- children: l("shared.yesRemove", { model: l(`${modelName}.modelName`) })
61
+ children: l("base.yesRemove", { model: l(`${modelName}.modelName`) })
64
62
  }
65
63
  ),
66
- children: /* @__PURE__ */ jsx("div", { className: "flex w-full items-center justify-center", children: l("shared.sureToRemove", { model: l(`${modelName}.modelName`), name: name ?? "" }) })
64
+ children: /* @__PURE__ */ jsx("div", { className: "flex w-full items-center justify-center", children: l("base.sureToRemove", { model: l(`${modelName}.modelName`), name: name ?? "" }) })
67
65
  }
68
66
  )
69
67
  ] });
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { jsx } from "react/jsx-runtime";
3
- import { clsx } from "@akanjs/client";
3
+ import { clsx, usePage } from "@akanjs/client";
4
4
  import { capitalize } from "@akanjs/common";
5
- import { usePage } from "@akanjs/next";
6
5
  import { st } from "@akanjs/store";
7
6
  import { Popconfirm } from "../Popconfirm";
8
7
  function RemoveWrapper({ children, sliceName, name, modelId, className, modal }) {
@@ -16,8 +15,8 @@ function RemoveWrapper({ children, sliceName, name, modelId, className, modal })
16
15
  return /* @__PURE__ */ jsx(
17
16
  Popconfirm,
18
17
  {
19
- title: l("shared.removeModel", { model: l(`${modelName}.modelName`) }),
20
- description: /* @__PURE__ */ jsx("div", { children: l("shared.sureToRemove", { model: l(`${modelName}.modelName`), name }) }),
18
+ title: l("base.removeModel", { model: l(`${modelName}.modelName`) }),
19
+ description: /* @__PURE__ */ jsx("div", { children: l("base.sureToRemove", { model: l(`${modelName}.modelName`), name }) }),
21
20
  onConfirm: () => {
22
21
  void storeDo[names.removeModel](modelId, { modal });
23
22
  },
@@ -1,9 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
- import { clsx, router } from "@akanjs/client";
3
+ import { clsx, msg, router, usePage } from "@akanjs/client";
4
4
  import { capitalize } from "@akanjs/common";
5
- import { msg } from "@akanjs/dictionary";
6
- import { usePage } from "@akanjs/next";
7
5
  import { st } from "@akanjs/store";
8
6
  import { useMemo, useState } from "react";
9
7
  import { AiOutlineDelete } from "react-icons/ai";
@@ -47,7 +45,7 @@ function SureToRemove({
47
45
  children: [
48
46
  /* @__PURE__ */ jsx(AiOutlineDelete, {}),
49
47
  " ",
50
- l("shared.remove")
48
+ l("base.remove")
51
49
  ]
52
50
  }
53
51
  ),
@@ -58,7 +56,7 @@ function SureToRemove({
58
56
  onCancel: () => {
59
57
  setModalOpen(false);
60
58
  },
61
- title: /* @__PURE__ */ jsx("div", { className: "text-error text-lg font-bold", children: l("shared.removeModel", { model: l(`${modelName}.modelName`) }) }),
59
+ title: /* @__PURE__ */ jsx("div", { className: "text-error text-lg font-bold", children: l("base.removeModel", { model: l(`${modelName}.modelName`) }) }),
62
60
  bodyClassName: "border-error",
63
61
  action: /* @__PURE__ */ jsx(
64
62
  "button",
@@ -67,7 +65,7 @@ function SureToRemove({
67
65
  disabled: typeNameToRemove && repeatName !== name,
68
66
  onClick: async () => {
69
67
  await storeDo[names.removeModel](modelId);
70
- msg.success("shared.removeSuccess", { data: { model: l(`${modelName}.modelName`) } });
68
+ msg.success("base.removeSuccess", { data: { model: l(`${modelName}.modelName`) } });
71
69
  setModalOpen(false);
72
70
  if (!redirect)
73
71
  return;
@@ -76,17 +74,17 @@ function SureToRemove({
76
74
  else
77
75
  router.push(redirect);
78
76
  },
79
- children: l("shared.removeModel", { model: l(`${modelName}.modelName`) })
77
+ children: l("base.removeModel", { model: l(`${modelName}.modelName`) })
80
78
  }
81
79
  ),
82
80
  children: [
83
81
  /* @__PURE__ */ jsxs("div", { className: "py-4", children: [
84
- l("shared.sureToRemove", { model: l(`${modelName}.modelName`), name }),
82
+ l("base.sureToRemove", { model: l(`${modelName}.modelName`), name }),
85
83
  /* @__PURE__ */ jsx("br", {}),
86
- l("shared.irreversibleOps"),
84
+ l("base.irreversibleOps"),
87
85
  typeNameToRemove ? /* @__PURE__ */ jsxs(Fragment, { children: [
88
86
  /* @__PURE__ */ jsx("br", {}),
89
- l("shared.typeNameToRemove", { model: l(`${modelName}.modelName`), name })
87
+ l("base.typeNameToRemove", { model: l(`${modelName}.modelName`), name })
90
88
  ] }) : null
91
89
  ] }),
92
90
  typeNameToRemove ? /* @__PURE__ */ jsx(
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { usePage } from "@akanjs/client";
3
4
  import { capitalize } from "@akanjs/common";
4
- import { usePage } from "@akanjs/next";
5
5
  import { st } from "@akanjs/store";
6
6
  import { AiOutlineEdit, AiOutlineSave } from "react-icons/ai";
7
7
  import { BiDotsVertical } from "react-icons/bi";
@@ -76,7 +76,7 @@ function ViewEditModal({
76
76
  children: [
77
77
  /* @__PURE__ */ jsx(AiOutlineEdit, {}),
78
78
  " ",
79
- l("shared.edit")
79
+ l("base.edit")
80
80
  ]
81
81
  }
82
82
  ) : /* @__PURE__ */ jsxs(
@@ -89,7 +89,7 @@ function ViewEditModal({
89
89
  children: [
90
90
  /* @__PURE__ */ jsx(AiOutlineSave, {}),
91
91
  " ",
92
- l("shared.save")
92
+ l("base.save")
93
93
  ]
94
94
  }
95
95
  ),
package/esm/Popconfirm.js CHANGED
@@ -1,8 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  //! 디자인 수정, 테마 적용 안됨
4
- import { clsx } from "@akanjs/client";
5
- import { usePage } from "@akanjs/next";
4
+ import { clsx, usePage } from "@akanjs/client";
6
5
  import { useSpring } from "@react-spring/web";
7
6
  import { useEffect, useState } from "react";
8
7
  import { BiMessageRoundedError } from "react-icons/bi";
@@ -83,8 +82,8 @@ const Popconfirm = ({
83
82
  ] })
84
83
  ] }),
85
84
  /* @__PURE__ */ jsxs("div", { className: "flex justify-end gap-2", children: [
86
- /* @__PURE__ */ jsx("button", { className: "btn btn-xs btn-outline", onClick: handleCancel, ...cancelButtonProps, children: cancelText ?? l("util.cancel") }),
87
- /* @__PURE__ */ jsx("button", { className: "btn btn-xs", onClick: handleConfirm, ...okButtonProps, children: okText ?? l("util.ok") })
85
+ /* @__PURE__ */ jsx("button", { className: "btn btn-xs btn-outline", onClick: handleCancel, ...cancelButtonProps, children: cancelText ?? l("base.cancel") }),
86
+ /* @__PURE__ */ jsx("button", { className: "btn btn-xs", onClick: handleConfirm, ...okButtonProps, children: okText ?? l("base.ok") })
88
87
  ] })
89
88
  ]
90
89
  }
package/esm/RecentTime.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { dayjs } from "@akanjs/base";
3
- import { clsx } from "@akanjs/client";
4
- import { usePage } from "@akanjs/next";
3
+ import { clsx, usePage } from "@akanjs/client";
5
4
  import relativeTime from "dayjs/plugin/relativeTime";
6
5
  dayjs.extend(relativeTime);
7
6
  const RecentTime = ({
package/esm/Select.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { Enum } from "@akanjs/base";
4
- import { clsx } from "@akanjs/client";
5
- import { useDebounce, usePage } from "@akanjs/next";
4
+ import { clsx, usePage } from "@akanjs/client";
5
+ import { useDebounce } from "@akanjs/next";
6
6
  import { useEffect, useMemo, useRef, useState } from "react";
7
7
  import { BiCheck, BiChevronDown, BiX } from "react-icons/bi";
8
8
  import { BsQuestionCircleFill } from "react-icons/bs";
@@ -257,7 +257,7 @@ const Select = ({
257
257
  ] }, index);
258
258
  }) }) : /* @__PURE__ */ jsxs("div", { className: "text-base-content/50 flex size-full flex-col items-center justify-center gap-2 p-2 text-center text-5xl", children: [
259
259
  /* @__PURE__ */ jsx(BsQuestionCircleFill, {}),
260
- /* @__PURE__ */ jsx("div", { className: "text-sm", children: l("shared.noOptions") })
260
+ /* @__PURE__ */ jsx("div", { className: "text-sm", children: l("base.noOptions") })
261
261
  ] })
262
262
  ]
263
263
  }
package/esm/Signal/Arg.js CHANGED
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { getNonArrayModel, isGqlScalar } from "@akanjs/base";
4
+ import { usePage } from "@akanjs/client";
4
5
  import { getGqlTypeStr, getScalarExample } from "@akanjs/constant";
5
- import { usePage } from "@akanjs/next";
6
6
  import { st } from "@akanjs/store";
7
7
  import { AiOutlineDelete } from "react-icons/ai";
8
8
  import { DatePicker } from "../DatePicker";
package/esm/Signal/Doc.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
+ import { usePage } from "@akanjs/client";
3
4
  import { lowerlize } from "@akanjs/common";
4
- import { usePage } from "@akanjs/next";
5
5
  import { client, defaultAccount, getAllSignalRefs, getSigMeta, roleTypes } from "@akanjs/signal";
6
6
  import { st } from "@akanjs/store";
7
7
  import decode from "jsonwebtoken/decode";
@@ -1,8 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { getNonArrayModel, isGqlScalar } from "@akanjs/base";
4
- import { getLightModelRef } from "@akanjs/constant";
5
- import { usePage } from "@akanjs/next";
4
+ import { usePage } from "@akanjs/client";
5
+ import { constantInfo } from "@akanjs/constant";
6
6
  import {
7
7
  fetch,
8
8
  getArgMetas,
@@ -159,11 +159,11 @@ const GraphQLTry = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
159
159
  const tryJwt = st.use.tryJwt();
160
160
  const [modelRef, arrDepth] = getNonArrayModel(gqlMeta.returns());
161
161
  const isScalar = isGqlScalar(modelRef);
162
- const returnRef = isScalar || !arrDepth ? modelRef : getLightModelRef(modelRef);
162
+ const returnRef = isScalar || arrDepth === 0 ? modelRef : constantInfo.isFull(modelRef) ? constantInfo.getDatabase(constantInfo.getRefName(modelRef)).light : modelRef;
163
163
  const gqlStr = useMemo(
164
164
  () => getGqlStr(
165
165
  modelRef,
166
- gqlMeta,
166
+ gqlMeta.key,
167
167
  [...gqlArgMetas, ...uploadArgMetas].sort((a, b) => a.idx - b.idx),
168
168
  returnRef
169
169
  ),
@@ -1,9 +1,8 @@
1
1
  "use client";
2
2
  import { jsx, jsxs } from "react/jsx-runtime";
3
3
  import { getNonArrayModel, isGqlScalar } from "@akanjs/base";
4
+ import { usePage } from "@akanjs/client";
4
5
  import { capitalize } from "@akanjs/common";
5
- import { getLightModelRef } from "@akanjs/constant";
6
- import { usePage } from "@akanjs/next";
7
6
  import { fetch, getArgMetas, getSigMeta, makeRequestExample } from "@akanjs/signal";
8
7
  import { st } from "@akanjs/store";
9
8
  import { useEffect, useMemo, useState } from "react";
@@ -130,7 +129,6 @@ const MessageTry = ({ sigRef, gqlMeta, gqlArgMetas, uploadArgMetas }) => {
130
129
  const tryJwt = st.use.tryJwt();
131
130
  const [modelRef, arrDepth] = getNonArrayModel(gqlMeta.returns());
132
131
  const isScalar = isGqlScalar(modelRef);
133
- const returnRef = isScalar || !arrDepth ? modelRef : getLightModelRef(modelRef);
134
132
  const requestExample = useMemo(() => JSON.stringify(makeRequestExample(sigRef, gqlMeta.key), null, 2), []);
135
133
  const [gqlRequest, setGqlRequest] = useState(requestExample);
136
134
  const [uploadRequest, setUploadRequest] = useState({});
@@ -1,17 +1,17 @@
1
1
  "use client";
2
2
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
3
3
  import { getNonArrayModel, isGqlClass, isGqlScalar, scalarNameMap } from "@akanjs/base";
4
- import { lowerlize } from "@akanjs/common";
5
- import { getClassMeta, getFieldMetas, getGqlTypeStr } from "@akanjs/constant";
6
- import { usePage } from "@akanjs/next";
7
- import { useMemo, useState } from "react";
4
+ import { usePage } from "@akanjs/client";
5
+ import { capitalize } from "@akanjs/common";
6
+ import { constantInfo, getFieldMetas, getGqlTypeStr } from "@akanjs/constant";
7
+ import { useState } from "react";
8
8
  import { Modal } from "../Modal";
9
9
  function Object() {
10
10
  return /* @__PURE__ */ jsx("div", {});
11
11
  }
12
12
  const ObjectType = ({ objRef, arrDepth, nullable }) => {
13
13
  const isModelType = !isGqlScalar(objRef);
14
- const refName = getGqlTypeStr(objRef);
14
+ const gqlName = getGqlTypeStr(objRef);
15
15
  const [openDetail, setOpenDetail] = useState(false);
16
16
  return /* @__PURE__ */ jsxs(Fragment, { children: [
17
17
  /* @__PURE__ */ jsxs(
@@ -24,7 +24,7 @@ const ObjectType = ({ objRef, arrDepth, nullable }) => {
24
24
  },
25
25
  children: [
26
26
  "[".repeat(arrDepth),
27
- refName,
27
+ gqlName,
28
28
  "]".repeat(arrDepth),
29
29
  nullable ? "" : "!"
30
30
  ]
@@ -33,7 +33,7 @@ const ObjectType = ({ objRef, arrDepth, nullable }) => {
33
33
  isModelType ? /* @__PURE__ */ jsx(
34
34
  Modal,
35
35
  {
36
- title: `Model Type - ${refName}`,
36
+ title: `Model Type - ${gqlName}`,
37
37
  open: openDetail,
38
38
  onCancel: () => {
39
39
  setOpenDetail(false);
@@ -45,12 +45,7 @@ const ObjectType = ({ objRef, arrDepth, nullable }) => {
45
45
  };
46
46
  Object.Type = ObjectType;
47
47
  const ObjectDetail = ({ objRef }) => {
48
- const classMeta = getClassMeta(objRef);
49
- const refName = lowerlize(getGqlTypeStr(objRef));
50
- const modelRefName = useMemo(
51
- () => classMeta.type === "light" ? lowerlize(refName.replace("light", "")) : refName.startsWith("summary") ? refName : refName.replace("Summary", "").replace("Insight", "").replace("Input", ""),
52
- []
53
- );
48
+ const modelRefName = constantInfo.getRefName(objRef);
54
49
  const fieldMetas = getFieldMetas(objRef);
55
50
  const { l } = usePage();
56
51
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsxs("table", { className: "table", children: [
@@ -61,10 +56,10 @@ const ObjectDetail = ({ objRef }) => {
61
56
  /* @__PURE__ */ jsx("th", { className: "text-center text-base", children: "Description" }),
62
57
  /* @__PURE__ */ jsx("th", { className: "text-center text-base", children: "Enum" })
63
58
  ] }) }),
64
- fieldMetas.map(({ key, arrDepth, name, nullable, modelRef, isClass, enum: enumOpt, isMap, of }, idx) => /* @__PURE__ */ jsx("tbody", { className: "font-normal", children: /* @__PURE__ */ jsxs("tr", { children: [
59
+ fieldMetas.map(({ key, arrDepth, nullable, modelRef, isClass, enum: enumOpt, isMap, of }, idx) => /* @__PURE__ */ jsx("tbody", { className: "font-normal", children: /* @__PURE__ */ jsxs("tr", { children: [
65
60
  /* @__PURE__ */ jsx("td", { className: "", children: key }),
66
61
  /* @__PURE__ */ jsxs("td", { className: "text-center", children: [
67
- isClass ? /* @__PURE__ */ jsx(ObjectType, { objRef: modelRef, arrDepth }) : `${"[".repeat(arrDepth)}${name}${"]".repeat(arrDepth)}${nullable ? "" : "!"}`,
62
+ isClass ? /* @__PURE__ */ jsx(ObjectType, { objRef: modelRef, arrDepth }) : `${"[".repeat(arrDepth)}${getGqlTypeStr(modelRef)}${"]".repeat(arrDepth)}${nullable ? "" : "!"}`,
68
63
  isMap ? /* @__PURE__ */ jsxs(Fragment, { children: [
69
64
  " => ",
70
65
  (() => {
@@ -93,11 +88,11 @@ const ObjectDetail = ({ objRef }) => {
93
88
  Object.Detail = ObjectDetail;
94
89
  const ObjectSchema = ({ objRef }) => {
95
90
  const { l } = usePage();
96
- const classMeta = getClassMeta(objRef);
97
- const refName = lowerlize(classMeta.refName);
91
+ const refName = capitalize(constantInfo.getRefName(objRef));
92
+ const gqlName = `${constantInfo.isLight(objRef) ? "Light" : ""}${refName}${constantInfo.isInsight(objRef) ? "Insight" : ""}`;
98
93
  return /* @__PURE__ */ jsxs("div", { className: "flex break-after-page flex-col gap-4", children: [
99
94
  /* @__PURE__ */ jsx("div", { className: "mt-24" }),
100
- /* @__PURE__ */ jsx("div", { className: "text-3xl font-bold", children: refName }),
95
+ /* @__PURE__ */ jsx("div", { className: "text-3xl font-bold", children: gqlName }),
101
96
  /* @__PURE__ */ jsxs("div", { className: "mb-5", children: [
102
97
  " - ",
103
98
  l.field(refName, "modelDesc")