@steedos/webapp 3.0.13-beta.3 → 3.0.13-beta.30

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.
@@ -1,4 +1,4 @@
1
- import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-D1UMGXOo.js";
1
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs } from "./index-Bgqu_5NR.js";
2
2
  function _mergeNamespaces(n, m) {
3
3
  for (var i = 0; i < m.length; i++) {
4
4
  const e = m[i];
@@ -41648,6 +41648,7 @@ const HEADER_USER_AGENT = "User-Agent";
41648
41648
  const HEADER_X_CLUSTER_ID = "X-Cluster-Id";
41649
41649
  const HEADER_X_CSRF_TOKEN = "X-CSRF-Token";
41650
41650
  const HEADER_X_VERSION_ID = "X-Version-Id";
41651
+ window.sha256 = sha256;
41651
41652
  let Client4$1 = class Client42 {
41652
41653
  LOGIN_TOKEN_KEY = "Meteor.loginToken";
41653
41654
  LOGIN_TOKEN_EXPIRES_KEY = "Meteor.loginTokenExpires";
@@ -42153,6 +42154,7 @@ function requireLodash() {
42153
42154
  return lodash$1;
42154
42155
  }
42155
42156
  var lodashExports = requireLodash();
42157
+ const _$1 = /* @__PURE__ */ getDefaultExportFromCjs(lodashExports);
42156
42158
  var Action;
42157
42159
  (function(Action2) {
42158
42160
  Action2["Pop"] = "POP";
@@ -50072,7 +50074,7 @@ const Home = () => {
50072
50074
  goResetPassword(navigate);
50073
50075
  } else {
50074
50076
  let redirect_uri = new URLSearchParams(location ? location.search : "").get("redirect_uri");
50075
- if (redirect_uri) {
50077
+ if (redirect_uri && redirect_uri != "/update-password") {
50076
50078
  window.location.href = redirect_uri;
50077
50079
  } else {
50078
50080
  window.location.href = "/app";
@@ -51571,6 +51573,7 @@ const normalizeLink = (to, location2 = window.location) => {
51571
51573
  };
51572
51574
  const AmisRender = function({ schema = {}, data: data2 = {}, env: env2 = {} }) {
51573
51575
  const navigate = useNavigate();
51576
+ const location2 = useLocation();
51574
51577
  if (!window.goBack) {
51575
51578
  window.goBack = () => {
51576
51579
  navigate(-1);
@@ -51592,10 +51595,70 @@ const AmisRender = function({ schema = {}, data: data2 = {}, env: env2 = {} }) {
51592
51595
  user: Builder$1.settings.context.user,
51593
51596
  now: /* @__PURE__ */ new Date()
51594
51597
  },
51598
+ _pathname: location2.pathname,
51595
51599
  ...data2
51596
51600
  };
51597
51601
  const mergedEnv = {
51598
51602
  ...env2,
51603
+ isCurrentUrl: (to, ctx) => {
51604
+ if (!to) {
51605
+ return false;
51606
+ }
51607
+ const link2 = normalizeLink(to);
51608
+ const pathname = window.location.pathname;
51609
+ const idx = link2.indexOf("?");
51610
+ let linkPathname = link2;
51611
+ let linkSearch = "";
51612
+ if (~idx) {
51613
+ linkPathname = link2.substring(0, idx);
51614
+ linkSearch = link2.substring(idx);
51615
+ }
51616
+ if (linkSearch) {
51617
+ if (linkPathname !== pathname) {
51618
+ return false;
51619
+ }
51620
+ const currentSearch = window.location.search;
51621
+ if (!currentSearch) {
51622
+ return false;
51623
+ }
51624
+ const linkParams = new URLSearchParams(linkSearch);
51625
+ const currentParams = new URLSearchParams(currentSearch);
51626
+ let allMatch = true;
51627
+ linkParams.forEach((value2, key2) => {
51628
+ if (currentParams.get(key2) !== value2) {
51629
+ allMatch = false;
51630
+ }
51631
+ });
51632
+ return allMatch;
51633
+ }
51634
+ const decodedPathname = decodeURI(pathname);
51635
+ const decodedLink = decodeURI(linkPathname);
51636
+ if (decodedPathname === decodedLink) {
51637
+ return true;
51638
+ }
51639
+ const linkSegments = decodedLink.replace(/^\//, "").split("/");
51640
+ if (linkSegments.length <= 3 && decodedPathname.startsWith(decodedLink + "/")) {
51641
+ const navPaths = window._steedosNavPaths;
51642
+ if (navPaths && navPaths.some((p) => {
51643
+ let pp = p;
51644
+ const qi = pp.indexOf("?");
51645
+ if (qi > -1) pp = pp.substring(0, qi);
51646
+ const hi = pp.indexOf("#");
51647
+ if (hi > -1) pp = pp.substring(0, hi);
51648
+ if (decodeURI(pp) === decodedLink) return false;
51649
+ const tmplIdx = pp.indexOf("${");
51650
+ if (tmplIdx > -1) {
51651
+ pp = pp.substring(0, tmplIdx);
51652
+ }
51653
+ const decodedNavPath = decodeURI(pp);
51654
+ return decodedNavPath.startsWith(decodedLink + "/") && decodedPathname.startsWith(decodedNavPath);
51655
+ })) {
51656
+ return false;
51657
+ }
51658
+ return true;
51659
+ }
51660
+ return false;
51661
+ },
51599
51662
  jumpTo: (to, action, ctx) => {
51600
51663
  if (to === "goBack") {
51601
51664
  return window.history.back();
@@ -51672,13 +51735,39 @@ const on_click_script = `
51672
51735
  }
51673
51736
  `;
51674
51737
  const pcInitJumtoFirstAppFirstTabScript = (payload, response, api2, context) => {
51738
+ const resolvePathTemplate = (path2, data2) => {
51739
+ if (!path2 || path2.indexOf("${") < 0) {
51740
+ return path2;
51741
+ }
51742
+ try {
51743
+ var currentAmis = window.amisRequire && window.amisRequire("amis");
51744
+ var createObject = window.BuilderAmisObject && window.BuilderAmisObject.AmisLib && window.BuilderAmisObject.AmisLib.createObject;
51745
+ if (currentAmis && createObject) {
51746
+ const resolved = currentAmis.evaluate(path2, createObject(context, data2 || {}));
51747
+ if (typeof resolved === "string" && resolved) {
51748
+ return resolved;
51749
+ }
51750
+ }
51751
+ } catch (ex) {
51752
+ console.warn("resolvePathTemplate failed:", ex);
51753
+ }
51754
+ return path2;
51755
+ };
51675
51756
  let app_items = payload;
51676
51757
  if (app_items && app_items.length > 0) {
51677
51758
  let firstApp = app_items[0];
51759
+ if (firstApp && firstApp.default_tab) {
51760
+ if (typeof firstApp.default_tab === "object" && firstApp.default_tab.path) {
51761
+ window.location.href = resolvePathTemplate(firstApp.default_tab.path, firstApp.default_tab);
51762
+ } else {
51763
+ window.location.href = `/app/${firstApp.id}/${firstApp.default_tab}`;
51764
+ }
51765
+ return payload;
51766
+ }
51678
51767
  if (firstApp && firstApp.children && firstApp.children.length > 0) {
51679
51768
  let firstTab = firstApp.children[0];
51680
51769
  if (firstTab) {
51681
- window.location.href = firstTab.path;
51770
+ window.location.href = resolvePathTemplate(firstTab.path, firstTab);
51682
51771
  }
51683
51772
  }
51684
51773
  }
@@ -54445,6 +54534,33 @@ const {
54445
54534
  const AppView = () => {
54446
54535
  const { appId } = useParams();
54447
54536
  const navigate = useNavigate();
54537
+ const resolvePathTemplate = (path2, data2) => {
54538
+ if (!path2 || path2.indexOf("${") < 0) {
54539
+ return path2 || "";
54540
+ }
54541
+ try {
54542
+ const currentAmis = window.amisRequire?.("amis");
54543
+ const createObject = window.BuilderAmisObject?.AmisLib?.createObject;
54544
+ if (currentAmis && createObject) {
54545
+ const settings2 = window.Builder?.settings || {};
54546
+ const scope = {
54547
+ context: settings2.context,
54548
+ global: {
54549
+ userId: settings2.context?.userId,
54550
+ spaceId: settings2.context?.tenantId,
54551
+ user: settings2.context?.user
54552
+ }
54553
+ };
54554
+ const resolved = currentAmis.evaluate(path2, createObject(scope, data2 || {}));
54555
+ if (typeof resolved === "string" && resolved) {
54556
+ return resolved;
54557
+ }
54558
+ }
54559
+ } catch (error) {
54560
+ console.warn("resolvePathTemplate failed:", error);
54561
+ }
54562
+ return path2;
54563
+ };
54448
54564
  reactExports.useEffect(() => {
54449
54565
  const fetchData = async () => {
54450
54566
  try {
@@ -54454,9 +54570,19 @@ const AppView = () => {
54454
54570
  // Include credentials if needed
54455
54571
  );
54456
54572
  const data2 = response.data;
54573
+ if (data2?.default_tab) {
54574
+ if (typeof data2.default_tab === "object" && data2.default_tab !== null && data2.default_tab.path) {
54575
+ navigate(resolvePathTemplate(data2.default_tab.path, data2.default_tab));
54576
+ return;
54577
+ }
54578
+ if (typeof data2.default_tab === "string") {
54579
+ navigate(`/app/${appId}/${data2.default_tab}`);
54580
+ return;
54581
+ }
54582
+ }
54457
54583
  if (data2?.children.length > 0 && data2.children[0].path) {
54458
- const children = _.sortBy(data2.children, ["index"]);
54459
- navigate(children[0].path);
54584
+ const children = _$1.sortBy(data2.children, ["index"]);
54585
+ navigate(resolvePathTemplate(children[0].path, children[0]));
54460
54586
  }
54461
54587
  } catch (error) {
54462
54588
  console.error("Error fetching data:", error);
@@ -54715,7 +54841,7 @@ const AppHeader = () => {
54715
54841
  if (searchParams.get("embed") == "1") {
54716
54842
  return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
54717
54843
  }
54718
- let logoSrc = "";
54844
+ let logoSrc = "/images/logo.svg";
54719
54845
  if (Builder$1.settings?.context?.user?.space?.avatar) {
54720
54846
  logoSrc = "/api/v6/files/cfs.avatars.filerecord/" + Builder$1.settings.context.user.space.avatar;
54721
54847
  }
@@ -54876,7 +55002,7 @@ const ObjectListView = () => {
54876
55002
  }
54877
55003
  return /* @__PURE__ */ jsxRuntimeExports.jsx(AmisRender, { schema: {
54878
55004
  type: "page",
54879
- bodyClassName: "p-0",
55005
+ bodyClassName: "p-0 h-full",
54880
55006
  body: {
54881
55007
  "type": "steedos-page-object-control",
54882
55008
  "name": "steedosPageObjectControl",
@@ -81223,7 +81349,7 @@ if (typeof ActiveXObject === "function") {
81223
81349
  if (typeof fetchApi !== "function") fetchApi = void 0;
81224
81350
  if (!fetchApi && !XmlHttpRequestApi && !ActiveXObjectApi) {
81225
81351
  try {
81226
- __vitePreload(() => import("./browser-ponyfill-Qm615jFE.js").then((n) => n.b), true ? [] : void 0).then(function(mod) {
81352
+ __vitePreload(() => import("./browser-ponyfill-9YmtxePq.js").then((n) => n.b), true ? [] : void 0).then(function(mod) {
81227
81353
  fetchApi = mod.default;
81228
81354
  }).catch(function() {
81229
81355
  });
package/dist/index.html CHANGED
@@ -65,7 +65,7 @@
65
65
  <link rel="stylesheet" href="https://unpkg.com/@steedos-widgets/amis@6.3.0-patch.8/lib/themes/antd.css">
66
66
  <link rel="stylesheet" href="https://unpkg.com/@steedos-widgets/amis@6.3.0-patch.8/lib/helper.css">
67
67
  <link rel="stylesheet" href="https://unpkg.com/@steedos-widgets/amis@6.3.0-patch.8/sdk/iconfont.css">
68
- <script type="module" crossorigin src="/assets/index-D1UMGXOo.js"></script>
68
+ <script type="module" crossorigin src="/assets/index-Bgqu_5NR.js"></script>
69
69
  <link rel="stylesheet" crossorigin href="/assets/index-Cd9-p_c2.css">
70
70
  </head>
71
71
  <body class="skin-blue-light fixed steedos sidebar-mini three-columns" >
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/webapp",
3
- "version": "3.0.13-beta.3",
3
+ "version": "3.0.13-beta.30",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -75,7 +75,7 @@
75
75
  "access": "public"
76
76
  },
77
77
  "repository": "https://github.com/steedos/app-builder/tree/master/apps/accounts",
78
- "gitHead": "4d016bc4e89b8bb68765f3b2e13b85a82c28ed03",
78
+ "gitHead": "cb5c5ccf666ad52afbe555df3a3f3b2e6c32f48c",
79
79
  "dependencies": {
80
80
  "@steedos-widgets/amis-object": "^6.10.51",
81
81
  "autoprefixer": "^10.4.23"