ode-explorer 2.4.4 → 2.4.5

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/lib/AppAction.js CHANGED
@@ -1,35 +1,39 @@
1
- import { jsxs as b, Fragment as h, jsx as e } from "react/jsx-runtime";
2
- import { Suspense as A, lazy as x } from "react";
3
- import { isActionAvailable as I } from "@edifice.io/client";
4
- import { useToggle as P, useEdificeClient as R, Button as y, BlogPublic as O, LoadingScreen as k } from "@edifice.io/react";
5
- import { u as v, a as F, b as T, c as j, d as B, e as w, S as z, g as E } from "./index2.js";
6
- import { useTranslation as L } from "react-i18next";
7
- const M = /* @__PURE__ */ x(async () => await import("./ResourceModal.js"));
8
- function Q() {
9
- const [c, s] = P(), a = v((o) => o.config), {
1
+ import { jsxs as h, Fragment as A, jsx as e } from "react/jsx-runtime";
2
+ import { Suspense as x, lazy as I } from "react";
3
+ import { isActionAvailable as P } from "@edifice.io/client";
4
+ import { useToggle as R, useEdificeClient as y, Button as O, BlogPublic as k, LoadingScreen as v } from "@edifice.io/react";
5
+ import { u as F, a as T, b as j, c as B, d as w, e as z, S as E, g as L } from "./index2.js";
6
+ import { useTranslation as M } from "react-i18next";
7
+ const N = /* @__PURE__ */ I(async () => await import("./ResourceModal.js"));
8
+ function U({
9
+ onResourceCreated: l
10
+ }) {
11
+ const [c, s] = R(), a = F((o) => o.config), {
10
12
  appCode: t
11
- } = R(), {
12
- t: l
13
- } = L(t), {
14
- clearSelectedItems: i,
15
- clearSelectedIds: u
16
- } = F(), {
13
+ } = y(), {
14
+ t: i
15
+ } = M(t), {
16
+ clearSelectedItems: u,
17
+ clearSelectedIds: d
18
+ } = T(), {
17
19
  data: r
18
- } = T(a == null ? void 0 : a.actions), d = r == null ? void 0 : r.find((o) => o.id === "create"), n = j(), m = B(), p = w();
19
- return d ? /* @__PURE__ */ b(h, { children: [
20
- /* @__PURE__ */ e(y, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(z, {}), className: "ms-auto", onClick: () => {
20
+ } = j(a == null ? void 0 : a.actions), m = r == null ? void 0 : r.find((o) => o.id === "create"), n = B(), p = w({
21
+ onResourceCreated: l
22
+ }), f = z();
23
+ return m ? /* @__PURE__ */ h(A, { children: [
24
+ /* @__PURE__ */ e(O, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(E, {}), className: "ms-auto", onClick: () => {
21
25
  if (t == "scrapbook") {
22
- E({
23
- searchParams: p,
26
+ L({
27
+ searchParams: f,
24
28
  folderId: n.id
25
29
  });
26
30
  return;
27
31
  }
28
- i(), u(), s();
29
- }, children: l("explorer.create.title") }),
30
- /* @__PURE__ */ e(A, { fallback: /* @__PURE__ */ e(k, {}), children: c && /* @__PURE__ */ e(M, { mode: "create", currentFolder: n, createResource: m, isOpen: c, onSuccess: s, onCancel: s, children: (o, f, C, g, S) => t === "blog" && I("createPublic", r) && /* @__PURE__ */ e(O, { appCode: t, isUpdating: f, resource: o, watch: C, setValue: g, register: S }) }) })
32
+ u(), d(), s();
33
+ }, children: i("explorer.create.title") }),
34
+ /* @__PURE__ */ e(x, { fallback: /* @__PURE__ */ e(v, {}), children: c && /* @__PURE__ */ e(N, { mode: "create", currentFolder: n, createResource: p, isOpen: c, onSuccess: s, onCancel: s, children: (o, C, g, S, b) => t === "blog" && P("createPublic", r) && /* @__PURE__ */ e(k, { appCode: t, isUpdating: C, resource: o, watch: g, setValue: S, register: b }) }) })
31
35
  ] }) : null;
32
36
  }
33
37
  export {
34
- Q as default
38
+ U as default
35
39
  };
@@ -1 +1,4 @@
1
- export default function AppAction(): import("react/jsx-runtime").JSX.Element | null;
1
+ import { IResource } from '@edifice.io/client';
2
+ export default function AppAction({ onResourceCreated, }: {
3
+ onResourceCreated?: (resource: IResource) => void;
4
+ }): import("react/jsx-runtime").JSX.Element | null;
@@ -1,4 +1,4 @@
1
- import { ResourceService, App, IAction, IFilter, IOrder, ResourceType } from '@edifice.io/client';
1
+ import { IResource, ResourceService, App, IAction, IFilter, IOrder, ResourceType } from '@edifice.io/client';
2
2
  export interface AppParams {
3
3
  /** Application code */
4
4
  app: App;
@@ -20,5 +20,7 @@ export interface AppParams {
20
20
  libraryAppFilter?: string;
21
21
  /** Enable or disable Explorer Onboarding Modal */
22
22
  enableOnboarding?: boolean;
23
+ /** Callback function triggered when a resource is created */
24
+ onResourceCreated?: (resource: IResource) => void;
23
25
  }
24
26
  export declare function getExplorerConfig(): AppParams;