ode-explorer 1.4.2-develop-pedago.202404301615 → 1.4.2-develop-integration.202405161426

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.js CHANGED
@@ -4100,12 +4100,6 @@ const usePrevious = (value, ignore) => {
4100
4100
  }, [value, ignore]);
4101
4101
  return ref2.current;
4102
4102
  };
4103
- function alwaysNewT(i18n, language, namespace, keyPrefix) {
4104
- return i18n.getFixedT(language, namespace, keyPrefix);
4105
- }
4106
- function useMemoizedT(i18n, language, namespace, keyPrefix) {
4107
- return reactExports.useCallback(alwaysNewT(i18n, language, namespace, keyPrefix), [i18n, language, namespace, keyPrefix]);
4108
- }
4109
4103
  function useTranslation(ns) {
4110
4104
  let props = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4111
4105
  const {
@@ -4149,9 +4143,9 @@ function useTranslation(ns) {
4149
4143
  if (i18n.reportNamespaces.addUsedNamespaces)
4150
4144
  i18n.reportNamespaces.addUsedNamespaces(namespaces);
4151
4145
  const ready = (i18n.isInitialized || i18n.initializedStoreOnce) && namespaces.every((n2) => hasLoadedNamespace(n2, i18n, i18nOptions));
4152
- const memoGetT = useMemoizedT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
4153
- const getT = () => memoGetT;
4154
- const getNewT = () => alwaysNewT(i18n, props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
4146
+ function getT() {
4147
+ return i18n.getFixedT(props.lng || null, i18nOptions.nsMode === "fallback" ? namespaces : namespaces[0], keyPrefix);
4148
+ }
4155
4149
  const [t2, setT] = reactExports.useState(getT);
4156
4150
  let joinedNS = namespaces.join();
4157
4151
  if (props.lng)
@@ -4168,21 +4162,21 @@ function useTranslation(ns) {
4168
4162
  if (props.lng) {
4169
4163
  loadLanguages(i18n, props.lng, namespaces, () => {
4170
4164
  if (isMounted.current)
4171
- setT(getNewT);
4165
+ setT(getT);
4172
4166
  });
4173
4167
  } else {
4174
4168
  loadNamespaces(i18n, namespaces, () => {
4175
4169
  if (isMounted.current)
4176
- setT(getNewT);
4170
+ setT(getT);
4177
4171
  });
4178
4172
  }
4179
4173
  }
4180
4174
  if (ready && previousJoinedNS && previousJoinedNS !== joinedNS && isMounted.current) {
4181
- setT(getNewT);
4175
+ setT(getT);
4182
4176
  }
4183
4177
  function boundReset() {
4184
4178
  if (isMounted.current)
4185
- setT(getNewT);
4179
+ setT(getT);
4186
4180
  }
4187
4181
  if (bindI18n && i18n)
4188
4182
  i18n.on(bindI18n, boundReset);
@@ -4196,11 +4190,13 @@ function useTranslation(ns) {
4196
4190
  bindI18nStore.split(" ").forEach((e2) => i18n.store.off(e2, boundReset));
4197
4191
  };
4198
4192
  }, [i18n, joinedNS]);
4193
+ const isInitial = reactExports.useRef(true);
4199
4194
  reactExports.useEffect(() => {
4200
- if (isMounted.current && ready) {
4195
+ if (isMounted.current && !isInitial.current) {
4201
4196
  setT(getT);
4202
4197
  }
4203
- }, [i18n, keyPrefix, ready]);
4198
+ isInitial.current = false;
4199
+ }, [i18n, keyPrefix]);
4204
4200
  const ret = [t2, i18n, ready];
4205
4201
  ret.t = t2;
4206
4202
  ret.i18n = i18n;
@@ -4239,10 +4235,7 @@ instance.use(Backend).use(initReactI18next).init({
4239
4235
  prefix: "[[",
4240
4236
  suffix: "]]"
4241
4237
  },
4242
- debug: false,
4243
- react: {
4244
- useSuspense: false
4245
- }
4238
+ debug: false
4246
4239
  });
4247
4240
  var Subscribable = class {
4248
4241
  constructor() {
@@ -18918,16 +18911,16 @@ const size$1 = function(options) {
18918
18911
  widthSide = side;
18919
18912
  heightSide = alignment === "end" ? "top" : "bottom";
18920
18913
  }
18921
- const overflowAvailableHeight = height - overflow[heightSide];
18922
- const overflowAvailableWidth = width - overflow[widthSide];
18914
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
18915
+ const maximumClippingWidth = width - overflow.left - overflow.right;
18916
+ const overflowAvailableHeight = min$1(height - overflow[heightSide], maximumClippingHeight);
18917
+ const overflowAvailableWidth = min$1(width - overflow[widthSide], maximumClippingWidth);
18923
18918
  const noShift = !state.middlewareData.shift;
18924
18919
  let availableHeight = overflowAvailableHeight;
18925
18920
  let availableWidth = overflowAvailableWidth;
18926
18921
  if (isYAxis) {
18927
- const maximumClippingWidth = width - overflow.left - overflow.right;
18928
18922
  availableWidth = alignment || noShift ? min$1(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
18929
18923
  } else {
18930
- const maximumClippingHeight = height - overflow.top - overflow.bottom;
18931
18924
  availableHeight = alignment || noShift ? min$1(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
18932
18925
  }
18933
18926
  if (noShift && !alignment) {
@@ -19194,10 +19187,10 @@ function getBoundingClientRect$1(element, includeScale, isFixedStrategy, offsetP
19194
19187
  });
19195
19188
  }
19196
19189
  const topLayerSelectors = [":popover-open", ":modal"];
19197
- function isTopLayer(floating) {
19190
+ function isTopLayer(element) {
19198
19191
  return topLayerSelectors.some((selector) => {
19199
19192
  try {
19200
- return floating.matches(selector);
19193
+ return element.matches(selector);
19201
19194
  } catch (e2) {
19202
19195
  return false;
19203
19196
  }
@@ -19363,7 +19356,7 @@ function getClippingRect$1(_ref) {
19363
19356
  rootBoundary,
19364
19357
  strategy
19365
19358
  } = _ref;
19366
- const elementClippingAncestors = boundary === "clippingAncestors" ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
19359
+ const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);
19367
19360
  const clippingAncestors = [...elementClippingAncestors, rootBoundary];
19368
19361
  const firstClippingAncestor = clippingAncestors[0];
19369
19362
  const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
@@ -19422,6 +19415,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
19422
19415
  height: rect.height
19423
19416
  };
19424
19417
  }
19418
+ function isStaticPositioned(element) {
19419
+ return getComputedStyle$3(element).position === "static";
19420
+ }
19425
19421
  function getTrueOffsetParent$1(element, polyfill2) {
19426
19422
  if (!isHTMLElement$1(element) || getComputedStyle$3(element).position === "fixed") {
19427
19423
  return null;
@@ -19432,18 +19428,28 @@ function getTrueOffsetParent$1(element, polyfill2) {
19432
19428
  return element.offsetParent;
19433
19429
  }
19434
19430
  function getOffsetParent$1(element, polyfill2) {
19435
- const window2 = getWindow$2(element);
19436
- if (!isHTMLElement$1(element) || isTopLayer(element)) {
19437
- return window2;
19431
+ const win = getWindow$2(element);
19432
+ if (isTopLayer(element)) {
19433
+ return win;
19434
+ }
19435
+ if (!isHTMLElement$1(element)) {
19436
+ let svgOffsetParent = getParentNode$1(element);
19437
+ while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {
19438
+ if (isElement$2(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {
19439
+ return svgOffsetParent;
19440
+ }
19441
+ svgOffsetParent = getParentNode$1(svgOffsetParent);
19442
+ }
19443
+ return win;
19438
19444
  }
19439
19445
  let offsetParent = getTrueOffsetParent$1(element, polyfill2);
19440
- while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle$3(offsetParent).position === "static") {
19446
+ while (offsetParent && isTableElement$1(offsetParent) && isStaticPositioned(offsetParent)) {
19441
19447
  offsetParent = getTrueOffsetParent$1(offsetParent, polyfill2);
19442
19448
  }
19443
- if (offsetParent && (getNodeName$1(offsetParent) === "html" || getNodeName$1(offsetParent) === "body" && getComputedStyle$3(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
19444
- return window2;
19449
+ if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {
19450
+ return win;
19445
19451
  }
19446
- return offsetParent || getContainingBlock$1(element) || window2;
19452
+ return offsetParent || getContainingBlock$1(element) || win;
19447
19453
  }
19448
19454
  const getElementRects = async function(data) {
19449
19455
  const getOffsetParentFn = this.getOffsetParent || getOffsetParent$1;
@@ -62597,42 +62603,6 @@ const useConversation = () => {
62597
62603
  }, useConversation$1 = useConversation;
62598
62604
  dayjs.extend(relativeTime);
62599
62605
  dayjs.extend(customParseFormat);
62600
- function useDate() {
62601
- const [lang, setLang] = reactExports.useState("fr"), sessionQuery = useSession();
62602
- function parseDate(date, lang2) {
62603
- if (date.length < 11)
62604
- return dayjs(date, ["YYYY-MM-DD"], lang2);
62605
- if (date.split("").findIndex((char) => "0" > char || char > "9") < 0)
62606
- return dayjs(Number.parseInt(date));
62607
- {
62608
- let day = dayjs(date);
62609
- return day.isValid() || (day = dayjs(date, ["YYYY-MM-DD HH:mm:ss.SSS"])), day;
62610
- }
62611
- }
62612
- const fromNow = reactExports.useCallback((date) => {
62613
- let computedDate = dayjs();
62614
- try {
62615
- return typeof date > "u" ? "" : (typeof date == "string" ? computedDate = parseDate(date, lang) : typeof date.$date == "number" ? computedDate = dayjs(new Date(date.$date)) : typeof date.$date == "string" && (computedDate = parseDate(date.$date, lang)), computedDate.isValid() ? computedDate.fromNow() : "");
62616
- } catch {
62617
- return "";
62618
- }
62619
- }, [lang]), formatDate = reactExports.useCallback((date, format) => {
62620
- let computedDate = dayjs();
62621
- try {
62622
- return typeof date > "u" ? "" : (typeof date == "string" ? computedDate = parseDate(date, lang) : typeof date.$date == "number" ? computedDate = dayjs(new Date(date.$date)) : typeof date.$date == "string" && (computedDate = parseDate(date.$date, lang)), computedDate.isValid() ? computedDate.locale(lang).format(format || "D MMMM YYYY HH:mm:ss") : "");
62623
- } catch {
62624
- return "";
62625
- }
62626
- }, [lang]);
62627
- return reactExports.useEffect(() => {
62628
- var _a2;
62629
- const lang2 = ((_a2 = sessionQuery == null ? void 0 : sessionQuery.data) == null ? void 0 : _a2.currentLanguage) || "fr";
62630
- setLang(lang2), dayjs.locale(lang2);
62631
- }, [sessionQuery == null ? void 0 : sessionQuery.data, setLang]), {
62632
- fromNow,
62633
- formatDate
62634
- };
62635
- }
62636
62606
  const DEFAULT_EVENTS = ["mousedown", "touchstart"];
62637
62607
  function useClickOutside(handler, events2, nodes) {
62638
62608
  const ref2 = reactExports.useRef();
@@ -63135,6 +63105,98 @@ function useXitiTrackPageLoad() {
63135
63105
  xitiStatus
63136
63106
  };
63137
63107
  }
63108
+ function useZendeskGuide() {
63109
+ const sessionQuery = useSession(), {
63110
+ isAdml
63111
+ } = useIsAdml(), {
63112
+ theme
63113
+ } = useOdeTheme(), hasSupportWorkflow = useHasWorkflow("net.atos.entng.support.controllers.DisplayController|view"), [locationPathname, setLocationPathname] = reactExports.useState(""), [dataModule, setDataModule] = reactExports.useState(void 0), setZendeskGuideLabels = () => {
63114
+ var _a2;
63115
+ const modulePathnameSplit = locationPathname.split("/");
63116
+ let moduleLabel = "", labels = "";
63117
+ if (dataModule != null && dataModule.labels && Object.keys(dataModule == null ? void 0 : dataModule.labels).length > 0 && modulePathnameSplit.length > 1) {
63118
+ for (let i2 = 1; i2 < modulePathnameSplit.length; i2++)
63119
+ modulePathnameSplit[i2].length > 0 && modulePathnameSplit[i2].match(/\d/) == null && (moduleLabel.length === 0 ? moduleLabel = modulePathnameSplit[i2] : moduleLabel = moduleLabel + "/" + modulePathnameSplit[i2]);
63120
+ dataModule != null && dataModule.labels && Object.prototype.hasOwnProperty.call(dataModule == null ? void 0 : dataModule.labels, moduleLabel) ? labels = dataModule == null ? void 0 : dataModule.labels[moduleLabel] : dataModule != null && dataModule.default && String(dataModule.default).length > 0 && (labels = dataModule == null ? void 0 : dataModule.default);
63121
+ } else
63122
+ dataModule != null && dataModule.default && String(dataModule == null ? void 0 : dataModule.default).length > 0 && (labels = dataModule == null ? void 0 : dataModule.default);
63123
+ if (labels.includes("${adml}") && (isAdml ? labels = labels.replace("${adml}", "adml") : labels = labels.replace("/${adml}", "")), labels.includes("${profile}")) {
63124
+ const userProfile = ((_a2 = sessionQuery == null ? void 0 : sessionQuery.data) == null ? void 0 : _a2.userProfile[0]) || "";
63125
+ labels = labels.replace("${profile}", userProfile.toLowerCase());
63126
+ }
63127
+ labels.includes("${theme") && (theme != null && theme.is1d ? labels = labels.replace("${theme}", "1D") : labels = labels.replace("${theme}", "2D")), window.zE("webWidget", "helpCenter:setSuggestions", {
63128
+ labels: [labels]
63129
+ });
63130
+ };
63131
+ return reactExports.useEffect(() => {
63132
+ window.location.pathname !== locationPathname && setLocationPathname(window.location.pathname), !(dataModule === void 0 || Object.keys(dataModule).length === 0) && setZendeskGuideLabels();
63133
+ }, [window.location.pathname, dataModule]), reactExports.useEffect(() => {
63134
+ document.getElementById("ze-snippet") || hasSupportWorkflow === void 0 || (async () => {
63135
+ var _a2;
63136
+ const zendeskGuideConfig = await odeServices.http().get("/zendeskGuide/config");
63137
+ if (zendeskGuideConfig && zendeskGuideConfig.key && zendeskGuideConfig.key !== "") {
63138
+ const scriptZendesk = document.createElement("script");
63139
+ scriptZendesk.id = "ze-snippet", scriptZendesk.src = `https://static.zdassets.com/ekr/snippet.js?key=${zendeskGuideConfig.key}`;
63140
+ const currentLanguage = ((_a2 = sessionQuery == null ? void 0 : sessionQuery.data) == null ? void 0 : _a2.currentLanguage) || "fr";
63141
+ document.body.appendChild(scriptZendesk).onload = () => {
63142
+ currentLanguage === "es" ? window.zE(function() {
63143
+ window.zE.setLocale("es-419");
63144
+ }) : window.zE(function() {
63145
+ window.zE.setLocale("fr");
63146
+ }), Object.keys(zendeskGuideConfig.module).length > 0 && setDataModule(zendeskGuideConfig.module), window.zE("webWidget", "updateSettings", {
63147
+ webWidget: {
63148
+ color: {
63149
+ theme: zendeskGuideConfig.color || "#ffc400"
63150
+ },
63151
+ zIndex: 2,
63152
+ launcher: {
63153
+ mobile: {
63154
+ labelVisible: true
63155
+ }
63156
+ },
63157
+ contactForm: {
63158
+ suppress: !hasSupportWorkflow
63159
+ },
63160
+ helpCenter: {
63161
+ messageButton: {
63162
+ "*": "Assistance ENT",
63163
+ "es-419": "Asistencia ENT"
63164
+ }
63165
+ }
63166
+ }
63167
+ }), window.addEventListener("scroll", () => {
63168
+ window.zE("webWidget", "updateSettings", {
63169
+ webWidget: {
63170
+ launcher: {
63171
+ mobile: {
63172
+ labelVisible: window.scrollY <= 5
63173
+ }
63174
+ }
63175
+ }
63176
+ });
63177
+ }), window.zE("webWidget:on", "open", function() {
63178
+ hasSupportWorkflow && window.zE("webWidget", "updateSettings", {
63179
+ webWidget: {
63180
+ contactForm: {
63181
+ suppress: false
63182
+ }
63183
+ }
63184
+ });
63185
+ }), window.zE("webWidget:on", "userEvent", function(ref2) {
63186
+ const category = ref2.category, action = ref2.action, properties2 = ref2.properties;
63187
+ action === "Contact Form Shown" && category === "Zendesk Web Widget" && properties2 && properties2.name === "contact-form" && hasSupportWorkflow && (window.zE("webWidget", "updateSettings", {
63188
+ webWidget: {
63189
+ contactForm: {
63190
+ suppress: true
63191
+ }
63192
+ }
63193
+ }), window.zE("webWidget", "close"), window.open("/support", "_blank"));
63194
+ });
63195
+ };
63196
+ }
63197
+ })();
63198
+ }, [hasSupportWorkflow]), null;
63199
+ }
63138
63200
  const Image$1 = /* @__PURE__ */ reactExports.forwardRef(({
63139
63201
  src,
63140
63202
  alt,
@@ -66323,7 +66385,9 @@ const SearchEngine = () => {
66323
66385
  showCookiesConsent,
66324
66386
  handleConsultCookies,
66325
66387
  handleCloseCookiesConsent
66326
- } = useCookiesConsent(), classes2 = clsx("d-flex flex-column bg-white", {
66388
+ } = useCookiesConsent();
66389
+ useZendeskGuide();
66390
+ const classes2 = clsx("d-flex flex-column bg-white", {
66327
66391
  "container-fluid": !headless,
66328
66392
  "rounded-4 border": (theme == null ? void 0 : theme.is1d) && !headless,
66329
66393
  "mt-24": (theme == null ? void 0 : theme.is1d) && !headless
@@ -67157,7 +67221,7 @@ const useSearchForm = () => {
67157
67221
  function ExplorerBreadcrumb() {
67158
67222
  const { appCode } = useOdeClient();
67159
67223
  const { gotoPreviousFolder } = useStoreActions();
67160
- const { t: t2 } = useTranslation(["common", appCode]);
67224
+ const { t: t2 } = useTranslation();
67161
67225
  const { inputSearch } = useSearchForm();
67162
67226
  const selectedNodesIds = useSelectedNodesIds();
67163
67227
  const isTrashFolder = useIsTrash();
@@ -67613,7 +67677,7 @@ const useCopyResource = () => {
67613
67677
  }
67614
67678
  );
67615
67679
  }
67616
- if (currentFolder.id && currentFolder.id !== FOLDER.DEFAULT) {
67680
+ if (currentFolder.id && currentFolder.id !== "default") {
67617
67681
  moveToFolder({
67618
67682
  searchParams,
67619
67683
  resourceIds: [data.duplicateId],
@@ -67995,9 +68059,10 @@ const useCreateResource = () => {
67995
68059
  var _a2, _b2, _c2;
67996
68060
  await queryClient2.cancelQueries({ queryKey });
67997
68061
  const previousData = queryClient2.getQueryData(queryKey);
68062
+ const { thumbnail } = variables;
67998
68063
  const newResource = {
67999
68064
  ...variables,
68000
- thumbnail: data.thumbnail || "",
68065
+ thumbnail: thumbnail ? URL.createObjectURL(thumbnail) : "",
68001
68066
  application,
68002
68067
  assetId: data._id || data.entId || "",
68003
68068
  id: data._id || data.entId || "",
@@ -68061,7 +68126,7 @@ const List = () => {
68061
68126
  const treeData = useTreeData();
68062
68127
  const toast = useToast();
68063
68128
  const { appCode } = useOdeClient();
68064
- const { t: t2 } = useTranslation([appCode]);
68129
+ const { t: t2 } = useTranslation();
68065
68130
  const { setSearchParams, setSearchConfig, setTreeData } = useStoreActions();
68066
68131
  const { data, isError: isError2, error, isLoading, isFetching, fetchNextPage } = useSearchContext();
68067
68132
  const hasNoFolders = (data == null ? void 0 : data.pages[0].folders.length) === 0;
@@ -68304,10 +68369,7 @@ const TreeViewContainer = () => {
68304
68369
  /* @__PURE__ */ jsxRuntimeExports.jsx(
68305
68370
  TreeView$1,
68306
68371
  {
68307
- data: {
68308
- ...treeData,
68309
- name: t2("explorer.filters.mine", { ns: appCode })
68310
- },
68372
+ data: treeData,
68311
68373
  selectedNodesIds,
68312
68374
  onTreeItemSelect: selectTreeItem,
68313
68375
  onTreeItemFold: foldTreeItem,
@@ -68725,7 +68787,7 @@ const ResourceCard = ({
68725
68787
  Image$2,
68726
68788
  {
68727
68789
  alt: "",
68728
- src: `${resource == null ? void 0 : resource.thumbnail}?thumbnail=80x80`,
68790
+ src: resource == null ? void 0 : resource.thumbnail,
68729
68791
  objectFit: "cover",
68730
68792
  className: "h-full w-100"
68731
68793
  }
@@ -68782,13 +68844,13 @@ const ResourceCard = ({
68782
68844
  );
68783
68845
  };
68784
68846
  ResourceCard.displayName = "ResourceCard";
68847
+ dayjs.extend(relativeTime);
68785
68848
  const ResourcesList = ({
68786
68849
  data,
68787
68850
  fetchNextPage
68788
68851
  }) => {
68789
- const { currentApp } = useOdeClient();
68852
+ const { currentApp, currentLanguage } = useOdeClient();
68790
68853
  const { t: t2 } = useTranslation();
68791
- const { fromNow } = useDate();
68792
68854
  const searchParams = useSearchParams();
68793
68855
  const resourceIds = useResourceIds();
68794
68856
  const selectedResources = useSelectedResources();
@@ -68840,7 +68902,7 @@ const ResourcesList = ({
68840
68902
  // eslint-disable-next-line react/no-array-index-key
68841
68903
  /* @__PURE__ */ jsxRuntimeExports.jsx(React$2.Fragment, { children: page.resources.map((resource) => {
68842
68904
  const { id: id2, updatedAt } = resource;
68843
- const time = fromNow(updatedAt);
68905
+ const time = dayjs(updatedAt).locale(currentLanguage).fromNow();
68844
68906
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
68845
68907
  animated.li,
68846
68908
  {
@@ -69253,10 +69315,14 @@ function useActionBar() {
69253
69315
  case ACTION.UPD_PROPS:
69254
69316
  case "edit":
69255
69317
  return onEdit();
69318
+ case "export":
69319
+ if (resourceIds.length > 0) {
69320
+ return onExport();
69321
+ } else {
69322
+ return null;
69323
+ }
69256
69324
  case ACTION.SHARE:
69257
69325
  return setOpenedModalName("share");
69258
- case ACTION.EXPORT:
69259
- return setOpenedModalName("export");
69260
69326
  default:
69261
69327
  throw Error(`Unknown action: ${action.id}`);
69262
69328
  }
@@ -69328,8 +69394,6 @@ function useActionBar() {
69328
69394
  const onEditResourceCancel = onFinish("edit_resource");
69329
69395
  const onShareResourceSuccess = onFinish("share");
69330
69396
  const onShareResourceCancel = onFinish("share");
69331
- const onExportCancel = onFinish("export");
69332
- const onExportSuccess = onFinish("export");
69333
69397
  async function onCopy() {
69334
69398
  if (selectedResources && selectedResources.length > 0) {
69335
69399
  const selectedResource = selectedResources[0];
@@ -69346,6 +69410,12 @@ function useActionBar() {
69346
69410
  setOpenedModalName("edit_folder");
69347
69411
  }
69348
69412
  }
69413
+ function onExport() {
69414
+ if (resourceIds && resourceIds.length > 0) {
69415
+ const selectedResource = selectedResources[0].assetId;
69416
+ goToExport({ searchParams, assetId: selectedResource });
69417
+ }
69418
+ }
69349
69419
  function overrideLabel(action) {
69350
69420
  if (action.id === "edit" && folderIds.length > 0) {
69351
69421
  return "explorer.rename";
@@ -69379,9 +69449,6 @@ function useActionBar() {
69379
69449
  isShareResourceOpen: openedModalName === "share",
69380
69450
  onShareResourceCancel,
69381
69451
  onShareResourceSuccess,
69382
- isExportModalOpen: openedModalName === "export",
69383
- onExportCancel,
69384
- onExportSuccess,
69385
69452
  onClearActionBar
69386
69453
  };
69387
69454
  }
@@ -69431,7 +69498,6 @@ const UpdateModal = reactExports.lazy(
69431
69498
  const DeleteModal$2 = reactExports.lazy(async () => await __vitePreload(() => Promise.resolve().then(() => DeleteModal$1), true ? void 0 : void 0));
69432
69499
  const MoveModal$2 = reactExports.lazy(async () => await __vitePreload(() => Promise.resolve().then(() => MoveModal$1), true ? void 0 : void 0));
69433
69500
  const FolderModal = reactExports.lazy(async () => await __vitePreload(() => Promise.resolve().then(() => FolderModal$2), true ? void 0 : void 0));
69434
- const ExportModal$2 = reactExports.lazy(async () => await __vitePreload(() => Promise.resolve().then(() => ExportModal$1), true ? void 0 : void 0));
69435
69501
  function ActionBarContainer() {
69436
69502
  const { appCode } = useOdeClient();
69437
69503
  const { t: t2 } = useTranslation();
@@ -69452,9 +69518,6 @@ function ActionBarContainer() {
69452
69518
  isShareResourceOpen,
69453
69519
  onShareResourceCancel,
69454
69520
  onShareResourceSuccess,
69455
- isExportModalOpen,
69456
- onExportCancel,
69457
- onExportSuccess,
69458
69521
  onMoveCancel,
69459
69522
  onMoveSuccess,
69460
69523
  onDeleteCancel,
@@ -69583,14 +69646,6 @@ function ActionBarContainer() {
69583
69646
  }
69584
69647
  ) : null
69585
69648
  }
69586
- ),
69587
- isExportModalOpen && selectedResource && /* @__PURE__ */ jsxRuntimeExports.jsx(
69588
- ExportModal$2,
69589
- {
69590
- isOpen: isExportModalOpen,
69591
- onCancel: onExportCancel,
69592
- onSuccess: onExportSuccess
69593
- }
69594
69649
  )
69595
69650
  ] })
69596
69651
  ] });
@@ -69844,69 +69899,6 @@ const MoveModal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
69844
69899
  __proto__: null,
69845
69900
  default: MoveModal
69846
69901
  }, Symbol.toStringTag, { value: "Module" }));
69847
- const useExportModal = (onSuccess) => {
69848
- const selectedResources = useSelectedResources();
69849
- const searchParams = useSearchParams();
69850
- const toast = useToast();
69851
- const { t: t2 } = useTranslation();
69852
- const handleExportClick = () => {
69853
- if (selectedResources.length) {
69854
- goToExport({ searchParams, assetId: selectedResources[0].assetId });
69855
- onSuccess();
69856
- } else {
69857
- toast.error(t2("explorer.error.noResourceSelected"));
69858
- }
69859
- };
69860
- return { handleExportClick };
69861
- };
69862
- function ExportModal({
69863
- isOpen,
69864
- onSuccess,
69865
- onCancel
69866
- }) {
69867
- const { handleExportClick } = useExportModal(onSuccess);
69868
- const { t: t2 } = useTranslation();
69869
- return reactDomExports.createPortal(
69870
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal$1, { isOpen, onModalClose: onCancel, id: "exportModal", children: [
69871
- /* @__PURE__ */ jsxRuntimeExports.jsx(Modal$1.Header, { onModalClose: onCancel, children: t2("explorer.export.title") }),
69872
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal$1.Body, { children: [
69873
- /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { children: [
69874
- /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: t2("explorer.export.body.info.1") }),
69875
- /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: t2("explorer.export.body.info.2") }),
69876
- /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: t2("explorer.export.body.info.3") })
69877
- ] }),
69878
- /* @__PURE__ */ jsxRuntimeExports.jsx(Alert$1, { type: "warning", children: t2("explorer.export.body.warning") })
69879
- ] }),
69880
- /* @__PURE__ */ jsxRuntimeExports.jsxs(Modal$1.Footer, { children: [
69881
- /* @__PURE__ */ jsxRuntimeExports.jsx(
69882
- Button$1,
69883
- {
69884
- color: "tertiary",
69885
- onClick: onCancel,
69886
- type: "button",
69887
- variant: "ghost",
69888
- children: t2("explorer.cancel")
69889
- }
69890
- ),
69891
- /* @__PURE__ */ jsxRuntimeExports.jsx(
69892
- Button$1,
69893
- {
69894
- color: "primary",
69895
- onClick: handleExportClick,
69896
- type: "button",
69897
- variant: "filled",
69898
- children: t2("explorer.actions.export")
69899
- }
69900
- )
69901
- ] })
69902
- ] }),
69903
- document.getElementById("portal")
69904
- );
69905
- }
69906
- const ExportModal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
69907
- __proto__: null,
69908
- default: ExportModal
69909
- }, Symbol.toStringTag, { value: "Module" }));
69910
69902
  function __vite__mapDeps(indexes) {
69911
69903
  if (!__vite__mapDeps.viteFileDeps) {
69912
69904
  __vite__mapDeps.viteFileDeps = []
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-explorer=1.0-b2school-SNAPSHOT 30/04/2024 16:15:49
1
+ ode-explorer=1.0-b2school-SNAPSHOT 16/05/2024 14:26:40