ode-explorer 1.4.1 → 1.4.2-develop-b2school.202403201820

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/dist/index.html CHANGED
@@ -111,6 +111,7 @@
111
111
  right: "manager",
112
112
  },
113
113
  ],
114
+ enableOnboarding: true,
114
115
  };
115
116
  ////
116
117
  var rootElement = document.querySelector("[data-explorer-config]");
package/dist/index.js CHANGED
@@ -35,7 +35,7 @@ var __privateMethod = (obj, member, method) => {
35
35
  return method;
36
36
  };
37
37
  var _focused, _cleanup, _setup, _a, _online, _cleanup2, _setup2, _b, _gcTimeout, _c, _initialState, _revertState, _cache, _promise, _retryer, _observers, _defaultOptions, _abortSignalConsumed, _setOptions, setOptions_fn, _dispatch, dispatch_fn, _d, _queries, _e, _observers2, _defaultOptions2, _mutationCache, _retryer2, _dispatch2, dispatch_fn2, _f, _mutations, _mutationId, _resuming, _g, _queryCache, _mutationCache2, _defaultOptions3, _queryDefaults, _mutationDefaults, _mountCount, _unsubscribeFocus, _unsubscribeOnline, _h, _client, _currentQuery, _currentQueryInitialState, _currentResult, _currentResultState, _currentResultOptions, _selectError, _selectFn, _selectResult, _lastQueryWithDefinedData, _staleTimeoutId, _refetchIntervalId, _currentRefetchInterval, _trackedProps, _executeFetch, executeFetch_fn, _updateStaleTimeout, updateStaleTimeout_fn, _computeRefetchInterval, computeRefetchInterval_fn, _updateRefetchInterval, updateRefetchInterval_fn, _updateTimers, updateTimers_fn, _clearStaleTimeout, clearStaleTimeout_fn, _clearRefetchInterval, clearRefetchInterval_fn, _updateQuery, updateQuery_fn, _notify, notify_fn, _i, _client2, _currentResult2, _currentMutation, _mutateOptions, _updateResult, updateResult_fn, _notify2, notify_fn2, _j;
38
- import { odeServices, FOLDER, ACTION } from "/assets/js/edifice-ts-client/index.js";
38
+ import { odeServices, FOLDER, SORT_ORDER, ACTION } from "/assets/js/edifice-ts-client/index.js";
39
39
  function _mergeNamespaces(n2, m2) {
40
40
  for (var i2 = 0; i2 < m2.length; i2++) {
41
41
  const e2 = m2[i2];
@@ -57163,6 +57163,22 @@ class ResizePlugin {
57163
57163
  }
57164
57164
  ResizePlugin.extension = ExtensionType.Application;
57165
57165
  extensions$1.add(ResizePlugin);
57166
+ DisplayObject.prototype.name = null;
57167
+ Container.prototype.getChildByName = function(name, deep) {
57168
+ for (let i2 = 0, j2 = this.children.length; i2 < j2; i2++)
57169
+ if (this.children[i2].name === name)
57170
+ return this.children[i2];
57171
+ if (deep)
57172
+ for (let i2 = 0, j2 = this.children.length; i2 < j2; i2++) {
57173
+ const child = this.children[i2];
57174
+ if (!child.getChildByName)
57175
+ continue;
57176
+ const target = child.getChildByName(name, true);
57177
+ if (target)
57178
+ return target;
57179
+ }
57180
+ return null;
57181
+ };
57166
57182
  const _tempMatrix = new Matrix();
57167
57183
  DisplayObject.prototype._cacheAsBitmap = false;
57168
57184
  DisplayObject.prototype._cacheData = null;
@@ -57293,22 +57309,6 @@ DisplayObject.prototype._destroyCachedDisplayObject = function() {
57293
57309
  DisplayObject.prototype._cacheAsBitmapDestroy = function(options) {
57294
57310
  this.cacheAsBitmap = false, this.destroy(options);
57295
57311
  };
57296
- DisplayObject.prototype.name = null;
57297
- Container.prototype.getChildByName = function(name, deep) {
57298
- for (let i2 = 0, j2 = this.children.length; i2 < j2; i2++)
57299
- if (this.children[i2].name === name)
57300
- return this.children[i2];
57301
- if (deep)
57302
- for (let i2 = 0, j2 = this.children.length; i2 < j2; i2++) {
57303
- const child = this.children[i2];
57304
- if (!child.getChildByName)
57305
- continue;
57306
- const target = child.getChildByName(name, true);
57307
- if (target)
57308
- return target;
57309
- }
57310
- return null;
57311
- };
57312
57312
  DisplayObject.prototype.getGlobalPosition = function(point = new Point(), skipUpdate = false) {
57313
57313
  return this.parent ? this.parent.toGlobal(this.position, point, skipUpdate) : (point.x = this.position.x, point.y = this.position.y), point;
57314
57314
  };
@@ -62184,7 +62184,7 @@ const ActionBar$1 = /* @__PURE__ */ reactExports.forwardRef(({
62184
62184
  } = props, getLoadingIcon = () => {
62185
62185
  let icon;
62186
62186
  return loadingIcon ? icon = loadingIcon : icon = /* @__PURE__ */ jsxRuntimeExports.jsx(SvgLoader$1, { ...restProps, "aria-label": "Loading" }), icon;
62187
- }, classes2 = clsx("loading", {
62187
+ }, classes2 = clsx("loading d-flex align-items-center gap-8", {
62188
62188
  "is-loading": isLoading
62189
62189
  }, className);
62190
62190
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: classes2, role: "status", ref: ref2, children: [
@@ -63085,7 +63085,8 @@ const Image$1 = /* @__PURE__ */ reactExports.forwardRef(({
63085
63085
  app,
63086
63086
  size: size2 = "24",
63087
63087
  iconFit = "contain",
63088
- variant = "square"
63088
+ variant = "square",
63089
+ className = ""
63089
63090
  }, ref2) => {
63090
63091
  const {
63091
63092
  isIconUrl,
@@ -63103,14 +63104,19 @@ const Image$1 = /* @__PURE__ */ reactExports.forwardRef(({
63103
63104
  }, iconFits = {
63104
63105
  "icon-contain": isContain,
63105
63106
  "icon-ratio": isRatio
63106
- }, icon = typeof app == "string" ? app : (app == null ? void 0 : app.icon) !== void 0 ? app.icon : "placeholder", displayName = typeof app != "string" && (app == null ? void 0 : app.displayName) !== void 0 ? app.displayName : "", code = app ? getIconCode(app) : "", isIconURL = isIconUrl(icon), appCode = code || "placeholder", classes2 = clsx("app-icon", {
63107
+ }, icon = typeof app == "string" ? app : (app == null ? void 0 : app.icon) !== void 0 ? app.icon : "placeholder", displayName = typeof app != "string" && (app == null ? void 0 : app.displayName) !== void 0 ? app.displayName : "", code = app ? getIconCode(app) : "", isIconURL = isIconUrl(icon), appCode = code || "placeholder";
63108
+ if (isIconURL) {
63109
+ const classes22 = clsx("h-full", className);
63110
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Image$2, { src: icon, alt: displayName, objectFit: "contain", width: size2, height: size2, className: classes22 });
63111
+ }
63112
+ const classes2 = clsx("app-icon", {
63107
63113
  ...iconSizes,
63108
63114
  ...iconVariant,
63109
63115
  ...iconFits,
63110
63116
  [`bg-light-${appCode}`]: appCode && !isContain,
63111
63117
  [`color-app-${appCode}`]: appCode
63112
- });
63113
- return isIconURL ? /* @__PURE__ */ jsxRuntimeExports.jsx(Image$2, { src: icon, alt: displayName, objectFit: "contain", width: size2, height: size2, className: "h-full" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes2, style: {
63118
+ }, className);
63119
+ return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: classes2, style: {
63114
63120
  width: size2 + "px",
63115
63121
  height: size2 + "px"
63116
63122
  }, children: /* @__PURE__ */ jsxRuntimeExports.jsx("svg", { ref: ref2, width: size2, height: size2, role: "img", fill: "currentColor", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntimeExports.jsx("use", { xlinkHref: `${iconPath}/apps.svg#${appCode}` }) }) });
@@ -65457,7 +65463,7 @@ const defaultActions = [{
65457
65463
  }
65458
65464
  }
65459
65465
  };
65460
- }, initialState = {
65466
+ }, initialState$2 = {
65461
65467
  isSharing: false,
65462
65468
  shareRights: {
65463
65469
  rights: [],
@@ -65510,7 +65516,7 @@ function useShare({
65510
65516
  avatar
65511
65517
  } = useUser(), toast2 = useToast(), {
65512
65518
  t: t2
65513
- } = useTranslation(), [state, dispatch] = reactExports.useReducer(reducer, initialState);
65519
+ } = useTranslation(), [state, dispatch] = reactExports.useReducer(reducer, initialState$2);
65514
65520
  return reactExports.useEffect(() => {
65515
65521
  resource && (async () => {
65516
65522
  const shareRightActions = await odeServices.share().getActionsForApp(appCode), shareRights = await odeServices.share().getRightsForResource(appCode, resource == null ? void 0 : resource.assetId);
@@ -65814,7 +65820,7 @@ function ShareResourceModal({
65814
65820
  /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip$1, { message: "Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.", placement: "top", children: /* @__PURE__ */ jsxRuntimeExports.jsx(SvgInfoCircle$1, { className: "c-pointer", height: "18" }) })
65815
65821
  ] }),
65816
65822
  /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "row", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-10", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Combobox$1, { value: searchInputValue, placeholder: searchPlaceholder, isLoading: showSearchLoading(), noResult: showSearchNoResults(), options: searchResults, searchMinLength: getSearchMinLength(), onSearchInputChange: handleSearchInputChange, onSearchResultsChange: handleSearchResultsChange }) }) }),
65817
- children
65823
+ typeof children == "function" ? children(resource) : children
65818
65824
  ] }),
65819
65825
  /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal$1.Footer, { children: [
65820
65826
  /* @__PURE__ */ jsxRuntimeExports.jsx(Button$1, { type: "button", color: "tertiary", variant: "ghost", onClick: onCancel, children: t2("explorer.cancel") }),
@@ -66273,7 +66279,10 @@ function getExplorerConfig() {
66273
66279
  const { explorerConfig } = rootElement.dataset;
66274
66280
  try {
66275
66281
  const parsedConfig = JSON.parse(explorerConfig);
66276
- config = Object.assign({}, parsedConfig);
66282
+ config = {
66283
+ ...parsedConfig,
66284
+ enableOnboarding: parsedConfig.enableOnboarding !== void 0 ? parsedConfig.enableOnboarding : true
66285
+ };
66277
66286
  } catch (e2) {
66278
66287
  console.error(
66279
66288
  "[Explorer Config] could not parse app params from root data attributes:",
@@ -66686,17 +66695,17 @@ const wrapTreeNode = (treeNode, folders, parentId) => {
66686
66695
  return node2;
66687
66696
  });
66688
66697
  };
66689
- const useStoreContext = create()((set2, get2) => ({
66698
+ const initialState = {
66690
66699
  config: null,
66691
66700
  searchConfig: { minLength: 1 },
66692
66701
  searchParams: {
66693
66702
  filters: {
66694
- folder: "default",
66703
+ folder: FOLDER.DEFAULT,
66695
66704
  owner: void 0,
66696
66705
  shared: void 0,
66697
66706
  public: void 0
66698
66707
  },
66699
- orders: { updatedAt: "desc" },
66708
+ orders: { updatedAt: SORT_ORDER.DESC },
66700
66709
  application: "",
66701
66710
  types: [],
66702
66711
  pagination: {
@@ -66722,7 +66731,10 @@ const useStoreContext = create()((set2, get2) => ({
66722
66731
  resourceIds: [],
66723
66732
  resourceIsTrash: false,
66724
66733
  resourceActionDisable: false,
66725
- status: void 0,
66734
+ status: void 0
66735
+ };
66736
+ const useStoreContext = create()((set2, get2) => ({
66737
+ ...initialState,
66726
66738
  updaters: {
66727
66739
  setConfig: (config2) => set2({ config: config2 }),
66728
66740
  setSearchConfig: (searchConfig) => set2((state) => ({
@@ -68274,7 +68286,7 @@ const Explorer = ({ config: config2 }) => {
68274
68286
  ] }),
68275
68287
  /* @__PURE__ */ jsxRuntimeExports.jsxs(reactExports.Suspense, { fallback: /* @__PURE__ */ jsxRuntimeExports.jsx(LoadingScreen$1, {}), children: [
68276
68288
  /* @__PURE__ */ jsxRuntimeExports.jsx(ActionBar, {}),
68277
- /* @__PURE__ */ jsxRuntimeExports.jsx(
68289
+ config2.enableOnboarding && /* @__PURE__ */ jsxRuntimeExports.jsx(
68278
68290
  OnboardingModal$1,
68279
68291
  {
68280
68292
  id: "showOnboardingTrash",
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 12/03/2024 11:16:00
1
+ ode-explorer=1.0-b2school-SNAPSHOT 20/03/2024 18:20:55
@@ -1,4 +1,4 @@
1
- import { AppParams } from "../utils/getAppParams";
1
+ import { AppParams } from '../config/getExplorerConfig';
2
2
  declare const Explorer: ({ config }: {
3
3
  config: AppParams;
4
4
  }) => import("react/jsx-runtime").JSX.Element;
@@ -1,11 +1,20 @@
1
1
  import { type App, type ResourceType, type IAction, type IFilter, type IOrder } from "edifice-ts-client";
2
2
  export interface AppParams {
3
+ /** Application code */
3
4
  app: App;
5
+ /** Array of ResourceType */
4
6
  types: ResourceType[];
7
+ /** Array of IFilter */
5
8
  filters: IFilter[];
9
+ /** Array of IOrder */
6
10
  orders: IOrder[];
11
+ /** Array of IAction */
7
12
  actions: IAction[];
13
+ /** Array of trashable IAction */
8
14
  trashActions: IAction[];
15
+ /** BPR application code */
9
16
  libraryAppFilter?: string;
17
+ /** Enable or disable Explorer Onboarding Modal */
18
+ enableOnboarding?: boolean;
10
19
  }
11
20
  export declare function getExplorerConfig(): AppParams;
package/lib/index.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export { default as Explorer } from "./components/Explorer";
2
+ export * from "./config/getExplorerConfig";
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { E as l } from "./index2.js";
1
+ import { E as g, z as l } from "./index2.js";
2
2
  import "react/jsx-runtime";
3
3
  import "react";
4
4
  import "@edifice-ui/react";
@@ -9,5 +9,6 @@ import "i18next";
9
9
  import "zustand";
10
10
  import "@tanstack/react-query";
11
11
  export {
12
- l as Explorer
12
+ g as Explorer,
13
+ l as getExplorerConfig
13
14
  };