@compill/admin 1.0.59 → 1.0.61

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.
package/index.cjs.js CHANGED
@@ -20,6 +20,7 @@ var admin = require('@compill/admin');
20
20
  var reactDom = require('react-dom');
21
21
  var table = require('@compill/table');
22
22
  var hooks = require('@compill/hooks');
23
+ var env = require('@compill/env');
23
24
  var router = require('next/router');
24
25
  var reactQuery = require('@tanstack/react-query');
25
26
 
@@ -1050,9 +1051,7 @@ function PageTopBarToolbar({
1050
1051
  if (!portal || !host) return;
1051
1052
  try {
1052
1053
  if (visible) host.appendChild(portal);else host.removeChild(portal);
1053
- } catch (e) {
1054
- // console.log(e)
1055
- }
1054
+ } catch (e) {}
1056
1055
  return () => {
1057
1056
  try {
1058
1057
  host.removeChild(portal);
@@ -2287,7 +2286,7 @@ function TableViewProvider({
2287
2286
  }
2288
2287
  case "link":
2289
2288
  {
2290
- openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${react.runIfFn(action.path, item)}`);
2289
+ openLink(`${env.Env.websiteUrl()}/${react.runIfFn(action.path, item)}`);
2291
2290
  break;
2292
2291
  }
2293
2292
  case "edit":
@@ -2532,7 +2531,7 @@ function useTableProps(api, table, rowActions) {
2532
2531
  }
2533
2532
  case "link":
2534
2533
  {
2535
- openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${react.runIfFn(config.path, item)}`);
2534
+ openLink(`${env.Env.websiteUrl()}/${react.runIfFn(config.path, item)}`);
2536
2535
  break;
2537
2536
  }
2538
2537
  }
@@ -3411,7 +3410,7 @@ function TableRowViewButton(_a) {
3411
3410
  const openPage = React__default["default"].useCallback(event => {
3412
3411
  event === null || event === void 0 ? void 0 : event.preventDefault();
3413
3412
  event === null || event === void 0 ? void 0 : event.stopPropagation();
3414
- window.open(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${path}`, '_blank');
3413
+ window.open(`${env.Env.websiteUrl()}/${path}`, '_blank');
3415
3414
  }, [path]);
3416
3415
  return jsxRuntime.jsx(TableRowActionButton, Object.assign({
3417
3416
  icon: mdiOpenInNew,
package/index.esm.js CHANGED
@@ -16,6 +16,7 @@ import { PageSectionTitle as PageSectionTitle$1, ButtonBarDialogButton as Button
16
16
  import { createPortal } from 'react-dom';
17
17
  import { TableContextProvider, useTableContext, Table } from '@compill/table';
18
18
  import { useOpenLink, useBoolean } from '@compill/hooks';
19
+ import { Env } from '@compill/env';
19
20
  import { useRouter } from 'next/router';
20
21
  import { useQueryClient } from '@tanstack/react-query';
21
22
 
@@ -1041,9 +1042,7 @@ function PageTopBarToolbar({
1041
1042
  if (!portal || !host) return;
1042
1043
  try {
1043
1044
  if (visible) host.appendChild(portal);else host.removeChild(portal);
1044
- } catch (e) {
1045
- // console.log(e)
1046
- }
1045
+ } catch (e) {}
1047
1046
  return () => {
1048
1047
  try {
1049
1048
  host.removeChild(portal);
@@ -2278,7 +2277,7 @@ function TableViewProvider({
2278
2277
  }
2279
2278
  case "link":
2280
2279
  {
2281
- openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${runIfFn(action.path, item)}`);
2280
+ openLink(`${Env.websiteUrl()}/${runIfFn(action.path, item)}`);
2282
2281
  break;
2283
2282
  }
2284
2283
  case "edit":
@@ -2523,7 +2522,7 @@ function useTableProps(api, table, rowActions) {
2523
2522
  }
2524
2523
  case "link":
2525
2524
  {
2526
- openLink(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${runIfFn(config.path, item)}`);
2525
+ openLink(`${Env.websiteUrl()}/${runIfFn(config.path, item)}`);
2527
2526
  break;
2528
2527
  }
2529
2528
  }
@@ -3402,7 +3401,7 @@ function TableRowViewButton(_a) {
3402
3401
  const openPage = React.useCallback(event => {
3403
3402
  event === null || event === void 0 ? void 0 : event.preventDefault();
3404
3403
  event === null || event === void 0 ? void 0 : event.stopPropagation();
3405
- window.open(`${process.env["NEXT_PUBLIC_WEBSITE_URL"]}/${path}`, '_blank');
3404
+ window.open(`${Env.websiteUrl()}/${path}`, '_blank');
3406
3405
  }, [path]);
3407
3406
  return jsx(TableRowActionButton, Object.assign({
3408
3407
  icon: mdiOpenInNew,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@compill/admin",
3
- "version": "1.0.59",
3
+ "version": "1.0.61",
4
4
  "module": "./index.esm.js",
5
5
  "main": "./index.cjs.js"
6
6
  }