gomtm 0.0.201 → 0.0.203

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.
@@ -9,8 +9,11 @@ export declare const curd3ListParamsAtom: import("jotai").PrimitiveAtom<PlainMes
9
9
  export declare const activateItemValueAtom: import("jotai").PrimitiveAtom<any> & {
10
10
  init: any;
11
11
  };
12
- export declare const activateItemAtom: import("jotai").Atom<any>;
12
+ export declare const activateItemAtom: import("jotai").WritableAtom<any, [value: any], void>;
13
13
  export declare const paramsAtom: import("jotai").Atom<any>;
14
+ export declare const remoteMeghodSigAtom: import("jotai").PrimitiveAtom<any> & {
15
+ init: any;
16
+ };
14
17
  export declare const curdPathAtom: import("jotai").PrimitiveAtom<string> & {
15
18
  init: string;
16
19
  };
@@ -30,12 +30,18 @@ const activateItemValueAtom = atom(void 0);
30
30
  const activateItemAtom = atom((get) => {
31
31
  const v = get(activateItemValueAtom);
32
32
  return v;
33
+ }, (_, set, value) => {
34
+ if (value == null ? void 0 : value.id) {
35
+ set(curdActivateIdAtom, value.id);
36
+ }
37
+ set(activateItemValueAtom, value);
33
38
  });
34
39
  const paramsValueAtom = atom(void 0);
35
40
  const paramsAtom = atom((get) => {
36
41
  const v = get(paramsValueAtom);
37
42
  return v;
38
43
  });
44
+ const remoteMeghodSigAtom = atom(void 0);
39
45
  const curdPathAtom = atom("");
40
46
  const curd3ItemsV2Atom = atom((get) => __async(void 0, null, function* () {
41
47
  const slugPath = get(curdPathAtom);
@@ -65,5 +71,6 @@ export {
65
71
  curdActivateIdAtom,
66
72
  curdPathAtom,
67
73
  paramsAtom,
74
+ remoteMeghodSigAtom,
68
75
  useCurdSlugName
69
76
  };
@@ -4,24 +4,24 @@ import { useAtom } from "jotai";
4
4
  import { MtLink } from "mtxuilib/common/mtlink";
5
5
  import { cn } from "mtxuilib/lib/utils";
6
6
  import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "mtxuilib/ui/card";
7
- import { curdActivateIdAtom } from "../curd.atoms";
8
7
  import { Icons } from "mtxuilib/icons/icons";
9
8
  import { DropdownMenu, DropdownMenuContent, DropdownMenuSeparator, DropdownMenuTrigger } from "mtxuilib/ui/dropdown-menu";
10
9
  import { DropdownMenuItemLink } from "mtxuilib/ui/ui-mt/DropdownMenuItemLink";
11
10
  import { curdSlugPathAtom } from "../CommonListViewV2";
11
+ import { activateItemAtom } from "../curd.atoms";
12
12
  const PostCardListItem = (props) => {
13
13
  const { item } = props;
14
- const [curdActivateId, setcurdActivateId] = useAtom(curdActivateIdAtom);
14
+ const [activateItem, setActivateItem] = useAtom(activateItemAtom);
15
15
  const [curdSlugPath] = useAtom(curdSlugPathAtom);
16
16
  return /* @__PURE__ */ jsxs(
17
17
  Card,
18
18
  {
19
19
  className: cn(
20
20
  "m-2 w-[350px]",
21
- item.id == curdActivateId && " p-2 shadow-md"
21
+ item.id == (activateItem == null ? void 0 : activateItem.id) && " p-2 shadow-md"
22
22
  ),
23
23
  onClick: () => {
24
- setcurdActivateId(item.id);
24
+ setActivateItem(item);
25
25
  },
26
26
  children: [
27
27
  /* @__PURE__ */ jsxs(CardHeader, { children: [
@@ -91,6 +91,7 @@ const gomtmFetcher = (initGlobal) => {
91
91
  }) || {};
92
92
  let headerCookie = "";
93
93
  if (typeof window == "undefined") {
94
+ console.log("mtmFetcher.ts require next/headers");
94
95
  const reqHeaders = require("next/headers").headers();
95
96
  headerCookie = reqHeaders.get("Cookie");
96
97
  }
@@ -1,3 +1,3 @@
1
1
  import { PropsWithChildren } from "react";
2
2
  export declare function GomtmAppSS(props: {} & PropsWithChildren): Promise<import("react").JSX.Element>;
3
- export declare const ssrGetBackendUrl: () => any;
3
+ export declare const ssrGetBackendUrl: () => string;
@@ -19,7 +19,6 @@ var __async = (__this, __arguments, generator) => {
19
19
  });
20
20
  };
21
21
  import { Fragment, jsx } from "react/jsx-runtime";
22
- import { MTM_SERVER_COOKIE_ACTIVATE_URL } from "../consts";
23
22
  import { GomtmProvider } from "./GomtmProvider";
24
23
  function GomtmAppSS(props) {
25
24
  return __async(this, null, function* () {
@@ -32,14 +31,9 @@ function GomtmAppSS(props) {
32
31
  });
33
32
  }
34
33
  const ssrGetBackendUrl = () => {
35
- var _a, _b;
34
+ var _a;
36
35
  if (typeof window == "undefined") {
37
- const _cookies = require("next/headers").cookies();
38
- const value = (_a = _cookies.get(MTM_SERVER_COOKIE_ACTIVATE_URL)) == null ? void 0 : _a.value;
39
- if (value) {
40
- return value;
41
- }
42
- if ((_b = process == null ? void 0 : process.env) == null ? void 0 : _b.MTM_BACKEND) {
36
+ if ((_a = process == null ? void 0 : process.env) == null ? void 0 : _a.MTM_BACKEND) {
43
37
  return process.env.MTM_BACKEND;
44
38
  }
45
39
  if (process.env.VERCEL_URL) {