ode-explorer 1.5.2 → 1.5.3-develop-rc.202412091521

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.
Files changed (89) hide show
  1. package/dist/EcritureA-Romain-Orne.woff2 +0 -0
  2. package/dist/KGJuneBug.ttf +0 -0
  3. package/dist/OpenDyslexic.woff +0 -0
  4. package/dist/christmas.png +0 -0
  5. package/dist/circus.jpg +0 -0
  6. package/dist/desert.jpg +0 -0
  7. package/dist/hills.svg +360 -0
  8. package/dist/illu-blog.svg +1 -0
  9. package/dist/illu-collaborativewall.svg +1 -0
  10. package/dist/illu-empty-search-blog.svg +25 -0
  11. package/dist/illu-empty-search-blog2.svg +25 -0
  12. package/dist/illu-empty-search-collaborativewall.svg +25 -0
  13. package/dist/illu-empty-search-collaborativewall2.svg +25 -0
  14. package/dist/illu-empty-search-formulaire.svg +27 -0
  15. package/dist/illu-empty-search-formulaire2.svg +27 -0
  16. package/dist/illu-empty-search-forum.svg +25 -0
  17. package/dist/illu-empty-search-forum2.svg +25 -0
  18. package/dist/illu-empty-search-homeworks.svg +25 -0
  19. package/dist/illu-empty-search-homeworks2.svg +25 -0
  20. package/dist/illu-empty-search-wiki.svg +26 -0
  21. package/dist/illu-empty-search-wiki2.svg +26 -0
  22. package/dist/illu-empty-search.svg +62 -0
  23. package/dist/illu-empty-search2.svg +62 -0
  24. package/dist/illu-error.svg +60 -0
  25. package/dist/illu-exercizer.svg +1 -0
  26. package/dist/illu-mindmap.svg +1 -0
  27. package/dist/illu-no-content-in-folder.svg +31 -0
  28. package/dist/illu-pad.svg +1 -0
  29. package/dist/illu-scrapbook.svg +1 -0
  30. package/dist/illu-search.svg +1 -0
  31. package/dist/illu-timeline.svg +1 -0
  32. package/dist/illu-timelinegenerator.svg +1 -0
  33. package/dist/illu-trash.svg +1 -0
  34. package/dist/illu-wiki.svg +15 -0
  35. package/dist/image-library.svg +188 -0
  36. package/dist/image-library2.svg +188 -0
  37. package/dist/image-placeholder.png +0 -0
  38. package/dist/index.html +2 -1
  39. package/dist/index.js +236 -231
  40. package/dist/ocean.jpg +0 -0
  41. package/dist/panda.jpg +0 -0
  42. package/dist/screen-loading.gif +0 -0
  43. package/dist/sparkly.jpg +0 -0
  44. package/dist/style.css +1 -0
  45. package/dist/version.txt +1 -1
  46. package/lib/components/OnboardingModal.d.ts +1 -1
  47. package/lib/config/explorer.d.ts +1 -1
  48. package/lib/features/AccessControl/AccessControl.d.ts +1 -1
  49. package/lib/features/AccessControl/useAccessControl.d.ts +1 -1
  50. package/lib/features/ActionBar/Move/useMoveModal.d.ts +1 -1
  51. package/lib/features/ActionBar/Publish/PublishModal.d.ts +1 -1
  52. package/lib/features/ActionBar/Resource/ResourceModal.d.ts +1 -1
  53. package/lib/features/ActionBar/Share/ShareModal.d.ts +1 -1
  54. package/lib/features/ActionBar/useActionBar.d.ts +2 -2
  55. package/lib/features/List/DraggableCard.d.ts +1 -1
  56. package/lib/features/List/FolderCard.d.ts +2 -2
  57. package/lib/features/List/FoldersList.d.ts +1 -1
  58. package/lib/features/List/ResourceCard.d.ts +2 -2
  59. package/lib/features/List/ResourcesList.d.ts +1 -1
  60. package/lib/index.js +58529 -3
  61. package/lib/services/api/index.d.ts +14 -14
  62. package/lib/services/queries/actions.d.ts +1 -1
  63. package/lib/services/queries/index.d.ts +9 -9
  64. package/lib/services/resource/service.d.ts +1 -1
  65. package/lib/store/index.d.ts +2 -2
  66. package/lib/utils/getChildrenIds.d.ts +1 -1
  67. package/lib/utils/isResourceShared.d.ts +1 -1
  68. package/package.json +4 -5
  69. package/lib/ActionBarContainer.js +0 -312
  70. package/lib/AppAction.js +0 -35
  71. package/lib/DeleteModal.js +0 -46
  72. package/lib/DisableModal.js +0 -20
  73. package/lib/DraggableCard.js +0 -25
  74. package/lib/EmptyScreenApp.js +0 -40
  75. package/lib/EmptyScreenError.js +0 -12
  76. package/lib/EmptyScreenNoContentInFolder.js +0 -18
  77. package/lib/EmptyScreenSearch.js +0 -18
  78. package/lib/EmptyScreenTrash.js +0 -16
  79. package/lib/ExportModal.js +0 -47
  80. package/lib/FolderModal.js +0 -116
  81. package/lib/FoldersList.js +0 -104
  82. package/lib/Library.js +0 -36
  83. package/lib/MoveModal.js +0 -87
  84. package/lib/OnboardingModal.js +0 -5
  85. package/lib/PublishModal.js +0 -5
  86. package/lib/ResourceModal.js +0 -5
  87. package/lib/ResourcesList.js +0 -133
  88. package/lib/TrashModal.js +0 -20
  89. package/lib/index2.js +0 -1531
@@ -1,4 +1,4 @@
1
- import { CreateParameters, GetContextParameters, IActionParameters, ID, IFolder, ISearchParameters, PublishParameters, ShareRight, UpdateParameters } from 'edifice-ts-client';
1
+ import { CreateParameters, GetContextParameters, IActionParameters, ID, IFolder, ISearchParameters, PublishParameters, ShareRight, UpdateParameters } from '@edifice.io/ts-client';
2
2
  /**
3
3
  * searchContext API
4
4
  * @param searchParams
@@ -6,8 +6,8 @@ import { CreateParameters, GetContextParameters, IActionParameters, ID, IFolder,
6
6
  */
7
7
  export declare const searchContext: (searchParams: GetContextParameters) => Promise<{
8
8
  folders: IFolder[];
9
- pagination: import('edifice-ts-client').IPagination;
10
- resources: import('edifice-ts-client').IResource[];
9
+ pagination: import('@edifice.io/ts-client').IPagination;
10
+ resources: import('@edifice.io/ts-client').IResource[];
11
11
  searchConfig?: {
12
12
  minLength: number;
13
13
  };
@@ -21,7 +21,7 @@ export declare const createFolder: ({ searchParams, name, parentId, }: {
21
21
  searchParams: ISearchParameters & IActionParameters;
22
22
  name: string;
23
23
  parentId: ID;
24
- }) => Promise<import('edifice-ts-client').CreateFolderResult>;
24
+ }) => Promise<import('@edifice.io/ts-client').CreateFolderResult>;
25
25
  /**
26
26
  * updateFolder API
27
27
  * @param searchParams, folderId, parentId, name
@@ -32,7 +32,7 @@ export declare const updateFolder: ({ folderId, searchParams, parentId, name, }:
32
32
  searchParams: ISearchParameters & IActionParameters;
33
33
  parentId: ID;
34
34
  name: string;
35
- }) => Promise<import('edifice-ts-client').CreateFolderResult>;
35
+ }) => Promise<import('@edifice.io/ts-client').CreateFolderResult>;
36
36
  /**
37
37
  * trashAll API
38
38
  * @param searchParams, resourceIds, folderIds
@@ -43,7 +43,7 @@ export declare const trashAll: ({ searchParams, resourceIds, useAssetIds, folder
43
43
  resourceIds: ID[];
44
44
  useAssetIds: boolean;
45
45
  folderIds: ID[];
46
- }) => Promise<import('edifice-ts-client').IActionResult>;
46
+ }) => Promise<import('@edifice.io/ts-client').IActionResult>;
47
47
  /**
48
48
  * deleteAll API
49
49
  * @param searchParams, resourceIds, folderIds
@@ -54,7 +54,7 @@ export declare const deleteAll: ({ searchParams, resourceIds, useAssetIds, folde
54
54
  resourceIds: ID[];
55
55
  useAssetIds: boolean;
56
56
  folderIds: ID[];
57
- }) => Promise<import('edifice-ts-client').IActionResult>;
57
+ }) => Promise<import('@edifice.io/ts-client').IActionResult>;
58
58
  /**
59
59
  * restoreAll API
60
60
  * @param searchParams, resourceIds, folderIds
@@ -65,14 +65,14 @@ export declare const restoreAll: ({ searchParams, resourceIds, folderIds, useAss
65
65
  resourceIds: ID[];
66
66
  useAssetIds: boolean;
67
67
  folderIds: ID[];
68
- }) => Promise<import('edifice-ts-client').IActionResult>;
68
+ }) => Promise<import('@edifice.io/ts-client').IActionResult>;
69
69
  /**
70
70
  * copyResource API.
71
71
  * @param searchParams searchParams to retrieve the application name.
72
72
  * @param resourceId the resource id to copy.
73
73
  * @returns copied ressource id and message.
74
74
  */
75
- export declare const copyResource: (searchParams: ISearchParameters & IActionParameters, resourceId: ID) => Promise<import('edifice-ts-client').CopyResult>;
75
+ export declare const copyResource: (searchParams: ISearchParameters & IActionParameters, resourceId: ID) => Promise<import('@edifice.io/ts-client').CopyResult>;
76
76
  /**
77
77
  * moveToFolder API
78
78
  * @param searchParams, resourceIds, folderIds, folderId
@@ -84,7 +84,7 @@ export declare const moveToFolder: ({ searchParams, resourceIds, folderId, folde
84
84
  resourceIds: ID[];
85
85
  useAssetIds: boolean;
86
86
  folderIds: ID[];
87
- }) => Promise<import('edifice-ts-client').IActionResult>;
87
+ }) => Promise<import('@edifice.io/ts-client').IActionResult>;
88
88
  /**
89
89
  * shareResource API
90
90
  * @param searchParams, entId, shares
@@ -94,7 +94,7 @@ export declare const shareResource: ({ application, resourceId, rights, }: {
94
94
  application: string;
95
95
  resourceId: ID;
96
96
  rights: ShareRight[];
97
- }) => Promise<import('edifice-ts-client').PutShareResponse>;
97
+ }) => Promise<import('@edifice.io/ts-client').PutShareResponse>;
98
98
  /**
99
99
  * updateResource API
100
100
  * @param searchParams, params
@@ -103,7 +103,7 @@ export declare const shareResource: ({ application, resourceId, rights, }: {
103
103
  export declare const updateResource: ({ application, params, }: {
104
104
  application: string;
105
105
  params: UpdateParameters;
106
- }) => Promise<import('edifice-ts-client').UpdateResult>;
106
+ }) => Promise<import('@edifice.io/ts-client').UpdateResult>;
107
107
  /**
108
108
  * sessionHasWorkflowRights API
109
109
  * @param actionRights
@@ -117,7 +117,7 @@ export declare const goToResource: ({ searchParams, assetId, }: {
117
117
  export declare const createResource: ({ searchParams, params, }: {
118
118
  searchParams: ISearchParameters & IActionParameters;
119
119
  params: CreateParameters;
120
- }) => Promise<import('edifice-ts-client').CreateResult>;
120
+ }) => Promise<import('@edifice.io/ts-client').CreateResult>;
121
121
  export declare const printResource: ({ searchParams, assetId, }: {
122
122
  searchParams: ISearchParameters & IActionParameters;
123
123
  assetId: ID;
@@ -137,7 +137,7 @@ export declare const goToExport: ({ searchParams, assetId, }: {
137
137
  export declare const publishResource: ({ searchParams, params, }: {
138
138
  searchParams: ISearchParameters & IActionParameters;
139
139
  params: PublishParameters;
140
- }) => Promise<import('edifice-ts-client').PublishResult>;
140
+ }) => Promise<import('@edifice.io/ts-client').PublishResult>;
141
141
  /**
142
142
  * getPreference API
143
143
  * @returns check onboarding trash param
@@ -1,4 +1,4 @@
1
- import { IAction } from 'edifice-ts-client';
1
+ import { IAction } from '@edifice.io/ts-client';
2
2
  import { AppParams } from '../../config';
3
3
  /**
4
4
  * actionsQueryOptions: check action availability depending on workflow right
@@ -1,5 +1,5 @@
1
+ import { CreateParameters, PutShareResponse, UpdateParameters, UpdateResult, IResource, ISearchResults, ShareRight } from '@edifice.io/ts-client';
1
2
  import { UseMutationOptions, UseMutationResult, InfiniteData } from '@tanstack/react-query';
2
- import { CreateParameters, PutShareResponse, UpdateParameters, UpdateResult, IResource, ISearchResults, ShareRight } from 'edifice-ts-client';
3
3
  export * from './actions';
4
4
  /**
5
5
  * useSearchContext query
@@ -11,28 +11,28 @@ export declare const useSearchContext: () => import('@tanstack/react-query').Use
11
11
  * useTrash query
12
12
  * Optimistic UI when resource or folder is trashed
13
13
  */
14
- export declare const useTrash: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, void, unknown>;
14
+ export declare const useTrash: () => UseMutationResult<import('@edifice.io/ts-client').IActionResult, Error, void, unknown>;
15
15
  /**
16
16
  * useRestore query
17
17
  * Optimistic UI when resource is restored
18
18
  */
19
- export declare const useRestore: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, void, unknown>;
19
+ export declare const useRestore: () => UseMutationResult<import('@edifice.io/ts-client').IActionResult, Error, void, unknown>;
20
20
  /**
21
21
  * useDelete query
22
22
  * Optimistic UI when resource is deleted
23
23
  */
24
- export declare const useDelete: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, void, unknown>;
24
+ export declare const useDelete: () => UseMutationResult<import('@edifice.io/ts-client').IActionResult, Error, void, unknown>;
25
25
  /**
26
26
  * useCopyResource query.
27
27
  * Optimistic UI when resource is copied.
28
28
  */
29
- export declare const useCopyResource: () => UseMutationResult<import('edifice-ts-client').CopyResult, Error, IResource, unknown>;
30
- export declare const useMoveItem: () => UseMutationResult<import('edifice-ts-client').IActionResult, Error, string, unknown>;
31
- export declare const useCreateFolder: () => UseMutationResult<import('edifice-ts-client').CreateFolderResult, Error, {
29
+ export declare const useCopyResource: () => UseMutationResult<import('@edifice.io/ts-client').CopyResult, Error, IResource, unknown>;
30
+ export declare const useMoveItem: () => UseMutationResult<import('@edifice.io/ts-client').IActionResult, Error, string, unknown>;
31
+ export declare const useCreateFolder: () => UseMutationResult<import('@edifice.io/ts-client').CreateFolderResult, Error, {
32
32
  name: string;
33
33
  parentId: string;
34
34
  }, unknown>;
35
- export declare const useUpdatefolder: () => UseMutationResult<import('edifice-ts-client').CreateFolderResult, Error, {
35
+ export declare const useUpdatefolder: () => UseMutationResult<import('@edifice.io/ts-client').CreateFolderResult, Error, {
36
36
  folderId: string;
37
37
  name: string;
38
38
  parentId: string;
@@ -43,4 +43,4 @@ export declare const useShareResource: (application: string) => UseMutationResul
43
43
  }>;
44
44
  export declare const useUpdateResource: (application: string) => UseMutationResult<UpdateResult, Error, UpdateParameters>;
45
45
  export declare const useCustomMutation: <TData = unknown, TError = unknown, TVariables = void, TContext = unknown>(options: UseMutationOptions<TData, TError, TVariables, TContext>) => UseMutationResult<TData, TError, TVariables, TContext>;
46
- export declare const useCreateResource: () => UseMutationResult<import('edifice-ts-client').CreateResult, Error, CreateParameters, unknown>;
46
+ export declare const useCreateResource: () => UseMutationResult<import('@edifice.io/ts-client').CreateResult, Error, CreateParameters, unknown>;
@@ -1,4 +1,4 @@
1
- import { BlogUpdate, CreateParameters, CreateResult, ResourceService, ResourceType, UpdateResult } from 'edifice-ts-client';
1
+ import { BlogUpdate, CreateParameters, CreateResult, ResourceService, ResourceType, UpdateResult } from '@edifice.io/ts-client';
2
2
  export declare class BlogResourceService extends ResourceService {
3
3
  getEditUrl(): string;
4
4
  create(parameters: CreateParameters): Promise<CreateResult>;
@@ -1,6 +1,6 @@
1
- import { TreeData } from '@edifice-ui/react';
1
+ import { TreeData } from '@edifice.io/react';
2
+ import { IActionParameters, ID, IFolder, IResource, ISearchParameters } from '@edifice.io/ts-client';
2
3
  import { QueryClient } from '@tanstack/react-query';
3
- import { IActionParameters, ID, IFolder, IResource, ISearchParameters } from 'edifice-ts-client';
4
4
  import { useStore } from 'zustand';
5
5
  import { AppParams } from '../config';
6
6
  export type ExtractState<S> = S extends {
@@ -1,2 +1,2 @@
1
- import { TreeData } from '@edifice-ui/react';
1
+ import { TreeData } from '@edifice.io/react';
2
2
  export declare function getChildrenIds(data: TreeData, folderId: string): string[];
@@ -1,2 +1,2 @@
1
- import { IResource } from 'edifice-ts-client';
1
+ import { IResource } from '@edifice.io/ts-client';
2
2
  export declare function isResourceShared(resource: IResource): boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ode-explorer",
3
- "version": "1.5.2",
3
+ "version": "1.5.3-develop-rc.202412091521",
4
4
  "description": "Edifice Explorer",
5
5
  "homepage": "https://github.com/edificeio/explorer#readme",
6
6
  "bugs": {
@@ -38,8 +38,9 @@
38
38
  "dependencies": {
39
39
  "@dnd-kit/core": "^6.1.0",
40
40
  "@dnd-kit/modifiers": "^7.0.0",
41
- "@edifice-ui/icons": "1.7.0",
42
- "@edifice-ui/react": "1.7.1",
41
+ "@edifice.io/react": "develop-rc",
42
+ "@edifice.io/bootstrap": "develop-rc",
43
+ "@edifice.io/ts-client": "develop-rc",
43
44
  "@react-spring/web": "^9.7.3",
44
45
  "@tanstack/react-query": "^5.59.13",
45
46
  "clsx": "^2.1.1",
@@ -68,8 +69,6 @@
68
69
  "@vitejs/plugin-react": "^4.3.2",
69
70
  "@vitest/coverage-v8": "^2.1.2",
70
71
  "@vitest/ui": "^2.1.2",
71
- "edifice-bootstrap": "1.7.0",
72
- "edifice-ts-client": "1.7.0",
73
72
  "eslint": "^9.11.1",
74
73
  "eslint-plugin-react-hooks": "^5.1.0-rc.0",
75
74
  "eslint-plugin-react-refresh": "^0.4.12",
@@ -1,312 +0,0 @@
1
- import { jsx as a, Fragment as X, jsxs as Q } from "react/jsx-runtime";
2
- import { useState as L, useEffect as Z, Suspense as pe, lazy as b } from "react";
3
- import { useUser as he, Button as W, useOdeClient as fe, ActionBar as Re, LoadingScreen as me, isActionAvailable as Se, BlogPublic as Ee, ShareModal as Oe, ShareBlog as Ce } from "@edifice-ui/react";
4
- import { useTransition as be, animated as ye } from "@react-spring/web";
5
- import { useTranslation as ee } from "react-i18next";
6
- import { odeServices as D, ACTION as c } from "edifice-ts-client";
7
- import { f as J, u as Ie, c as ge, h as ve, i as se, j as Ae, k as Me, l as Pe, m as we, e as Fe, n as xe, o as Te, a as te, b as Be, p as De, q as Le, r as _e } from "./index2.js";
8
- function Ne({
9
- roles: r,
10
- rights: s,
11
- action: t
12
- }) {
13
- const [p, o] = L(!1), {
14
- user: E
15
- } = he(), i = J();
16
- Z(() => {
17
- f();
18
- }, [r, s]);
19
- const m = async function(l) {
20
- const n = l instanceof Array ? l : [l];
21
- if (r instanceof Array) {
22
- const R = await D.rights().sessionHasAtLeastOneResourceRight(r, n);
23
- o(R);
24
- } else {
25
- const R = await D.rights().sessionHasResourceRight(r, n);
26
- o(R);
27
- }
28
- }, h = async function(l) {
29
- if (r instanceof Array) {
30
- const n = await D.rights().sessionHasAtLeastOneResourceRightForEachList(r, l);
31
- o(n);
32
- } else {
33
- const n = await D.rights().sessionHasResourceRightForEachList(r, l);
34
- o(n);
35
- }
36
- }, f = async function() {
37
- var l, n, R;
38
- if (r === void 0) {
39
- o(!0);
40
- return;
41
- }
42
- if (i && ((n = (l = s[0]) == null ? void 0 : l.trashedBy) != null && n.includes(E == null ? void 0 : E.userId)) && t === "restore" && !((R = s[0]) != null && R.trashed)) {
43
- o(!0);
44
- return;
45
- }
46
- if (s instanceof Array)
47
- if (s.length > 0)
48
- if (typeof s[0] == "string")
49
- await m(s);
50
- else {
51
- const y = s.map((I) => I.rights);
52
- await h(y);
53
- }
54
- else
55
- o(!1);
56
- else
57
- typeof s == "string" ? await m(s) : await m(s.rights);
58
- };
59
- return {
60
- visible: p,
61
- refreshState: f
62
- };
63
- }
64
- function oe() {
65
- const [r, s] = L(!1), [t, p] = L("void"), [o, E] = L(), i = Ie((e) => e.config), m = ge(), h = ve(), f = se(), l = Ae(), n = Me(), R = J(), y = Pe(), I = we(), M = Fe(), _ = xe(), N = Te(), {
66
- openResource: P,
67
- printSelectedResource: k,
68
- openFolder: H,
69
- clearSelectedItems: w,
70
- clearSelectedIds: F
71
- } = te(), {
72
- data: U
73
- } = Be(i == null ? void 0 : i.actions);
74
- Z(() => {
75
- if (h.length === 0 && n.length === 0) {
76
- s(!1);
77
- return;
78
- }
79
- if (I) {
80
- s(!1);
81
- return;
82
- }
83
- if (N.isDrag) {
84
- s(!1);
85
- return;
86
- }
87
- s(!0);
88
- }, [h, n]);
89
- async function Y(e) {
90
- var B;
91
- switch ((B = document.getElementById("root")) == null || B.setAttribute("aria-hidden", "true"), E(e), e.id) {
92
- case c.OPEN:
93
- return h.length > 0 ? P(f[0]) : H({
94
- folder: l[0],
95
- folderId: l[0].id
96
- });
97
- case c.COPY:
98
- return le();
99
- case c.MOVE:
100
- return p("move");
101
- case c.PRINT:
102
- return k();
103
- case c.DELETE:
104
- return p("delete");
105
- case c.RESTORE:
106
- return await x();
107
- case c.PUBLISH:
108
- return p("publish");
109
- case c.UPD_PROPS:
110
- case "edit":
111
- return ue();
112
- case c.SHARE:
113
- return p("share");
114
- case c.EXPORT:
115
- return p("export");
116
- default:
117
- throw Error(`Unknown action: ${e.id}`);
118
- }
119
- }
120
- function j(e) {
121
- const B = h.length + n.length, O = h.length === 1 || n.length === 1, K = B === 1, C = n.length === 0;
122
- switch (e.id) {
123
- case c.OPEN:
124
- return K;
125
- case c.MANAGE:
126
- return O;
127
- case c.COPY:
128
- return O && C;
129
- case c.PUBLISH:
130
- return O && C;
131
- case c.UPD_PROPS:
132
- return O && C;
133
- case c.SHARE:
134
- return C && O;
135
- case "export":
136
- return O && C;
137
- case c.PRINT:
138
- return O && C;
139
- case "edit":
140
- return K;
141
- default:
142
- return !0;
143
- }
144
- }
145
- const z = () => !0;
146
- async function x() {
147
- try {
148
- if (R)
149
- await y.mutate();
150
- else
151
- throw new Error("Cannot restore untrashed resources");
152
- g();
153
- } catch (e) {
154
- console.error(e);
155
- }
156
- }
157
- function g() {
158
- var e;
159
- p("void"), o != null && o.id && ((e = document.getElementById(o == null ? void 0 : o.id)) == null || e.focus());
160
- }
161
- const u = (e) => () => {
162
- t === e && (g(), w(), F());
163
- }, S = u("move"), V = u("move"), T = u("delete"), $ = u("delete"), v = u("publish"), A = u("publish"), d = u("edit_folder"), q = u("edit_folder"), G = u("edit_resource"), re = u("edit_resource"), ne = u("share"), ce = u("share"), ae = u("export"), ie = u("export");
164
- async function le() {
165
- if (f && f.length > 0) {
166
- const e = f[0];
167
- await _.mutate(e), w(), F();
168
- }
169
- }
170
- function ue() {
171
- if (h && h.length > 0) {
172
- const e = f[0].assetId;
173
- (i == null ? void 0 : i.app) === "scrapbook" ? De({
174
- searchParams: M,
175
- assetId: e
176
- }) : p("edit_resource");
177
- } else
178
- p("edit_folder");
179
- }
180
- function de(e) {
181
- return e.id === "edit" && n.length > 0 ? "explorer.rename" : `explorer.actions.${e.id}`;
182
- }
183
- return {
184
- onRestore: x,
185
- actions: R ? i == null ? void 0 : i.trashActions : U,
186
- selectedElement: [...f, ...l],
187
- currentFolderId: m == null ? void 0 : m.id,
188
- overrideLabel: de,
189
- handleClick: Y,
190
- isActivable: R ? z : j,
191
- isActionBarOpen: r,
192
- isMoveModalOpen: t === "move",
193
- onMoveCancel: S,
194
- onMoveSuccess: V,
195
- isDeleteModalOpen: t === "delete",
196
- onDeleteCancel: $,
197
- onDeleteSuccess: T,
198
- isPublishModalOpen: t === "publish",
199
- onPublishCancel: A,
200
- onPublishSuccess: v,
201
- isEditFolderOpen: t === "edit_folder",
202
- onEditFolderCancel: q,
203
- onEditFolderSuccess: d,
204
- isEditResourceOpen: t === "edit_resource",
205
- onEditResourceCancel: re,
206
- onEditResourceSuccess: G,
207
- isShareResourceOpen: t === "share",
208
- onShareResourceCancel: ce,
209
- onShareResourceSuccess: ne,
210
- isExportModalOpen: t === "export",
211
- onExportCancel: ae,
212
- onExportSuccess: ie,
213
- onClearActionBar: g
214
- };
215
- }
216
- function ke({
217
- resourceRights: r,
218
- roleExpected: s,
219
- action: t,
220
- children: p,
221
- renderWhenForbidden: o
222
- }) {
223
- const {
224
- t: E
225
- } = ee(), {
226
- overrideLabel: i
227
- } = oe(), {
228
- visible: m
229
- } = Ne({
230
- roles: s,
231
- rights: r,
232
- action: t == null ? void 0 : t.id
233
- }), {
234
- setResourceActionDisable: h
235
- } = te(), f = J();
236
- return m ? /* @__PURE__ */ a(X, { children: p }) : o ? o() : f && !m ? /* @__PURE__ */ a(W, { type: "button", color: "primary", variant: "filled", onClick: () => {
237
- h(!0);
238
- }, children: E(i(t)) }) : /* @__PURE__ */ a(X, {});
239
- }
240
- const He = /* @__PURE__ */ b(async () => await import("./PublishModal.js")), Ue = /* @__PURE__ */ b(async () => await import("./ResourceModal.js")), Ye = /* @__PURE__ */ b(async () => await import("./DeleteModal.js")), je = /* @__PURE__ */ b(async () => await import("./MoveModal.js")), ze = /* @__PURE__ */ b(async () => await import("./FolderModal.js")), Ve = /* @__PURE__ */ b(async () => await import("./ExportModal.js"));
241
- function Ze() {
242
- const {
243
- appCode: r
244
- } = fe(), {
245
- t: s
246
- } = ee(), {
247
- actions: t,
248
- selectedElement: p,
249
- isMoveModalOpen: o,
250
- isDeleteModalOpen: E,
251
- isPublishModalOpen: i,
252
- isActionBarOpen: m,
253
- isEditFolderOpen: h,
254
- overrideLabel: f,
255
- onEditFolderCancel: l,
256
- onEditFolderSuccess: n,
257
- isEditResourceOpen: R,
258
- onEditResourceCancel: y,
259
- onEditResourceSuccess: I,
260
- isShareResourceOpen: M,
261
- onShareResourceCancel: _,
262
- onShareResourceSuccess: N,
263
- isExportModalOpen: P,
264
- onExportCancel: k,
265
- onExportSuccess: H,
266
- onMoveCancel: w,
267
- onMoveSuccess: F,
268
- onDeleteCancel: U,
269
- onDeleteSuccess: Y,
270
- onPublishCancel: j,
271
- onPublishSuccess: z,
272
- isActivable: x,
273
- handleClick: g
274
- } = oe(), S = se()[0], V = Le(r), T = _e(r), $ = be(m, {
275
- from: {
276
- opacity: 0,
277
- transform: "translateY(100%)"
278
- },
279
- enter: {
280
- opacity: 1,
281
- transform: "translateY(0)"
282
- },
283
- leave: {
284
- opacity: 0,
285
- transform: "translateY(100%)"
286
- }
287
- });
288
- return /* @__PURE__ */ Q(X, { children: [
289
- $((v, A) => A && /* @__PURE__ */ a(ye.div, { className: "position-fixed bottom-0 start-0 end-0", style: {
290
- ...v,
291
- zIndex: 4
292
- }, children: /* @__PURE__ */ a(Re, { children: t == null ? void 0 : t.filter((d) => d.available && d.target === "actionbar").map((d) => x(d) && /* @__PURE__ */ a(ke, { resourceRights: p, roleExpected: d.right, action: d, children: /* @__PURE__ */ a(W, { id: d.id, type: "button", color: "primary", variant: "filled", onClick: () => {
293
- g(d);
294
- }, children: s(f(d)) }, d.id) }, d.id)) }) })),
295
- /* @__PURE__ */ Q(pe, { fallback: /* @__PURE__ */ a(me, {}), children: [
296
- o && /* @__PURE__ */ a(je, { isOpen: o, onCancel: w, onSuccess: F }),
297
- E && /* @__PURE__ */ a(Ye, { isOpen: E, onCancel: U, onSuccess: Y }),
298
- i && S && /* @__PURE__ */ a(He, { isOpen: i, resourceId: S.assetId, onCancel: j, onSuccess: z }),
299
- h && /* @__PURE__ */ a(ze, { edit: !0, isOpen: h, onCancel: l, onSuccess: n }),
300
- R && S && /* @__PURE__ */ a(Ue, { mode: "update", isOpen: R, resourceId: S.assetId, updateResource: T, onCancel: y, onSuccess: I, children: (v, A, d, q, G) => r === "blog" && Se("createPublic", t) && /* @__PURE__ */ a(Ee, { appCode: r, isUpdating: A, resource: v, watch: d, setValue: q, register: G }) }),
301
- M && S && /* @__PURE__ */ a(Oe, { isOpen: M, shareResource: V, shareOptions: {
302
- resourceCreatorId: S.creatorId,
303
- resourceId: S.assetId,
304
- resourceRights: S.rights
305
- }, onCancel: _, onSuccess: N, children: r === "blog" ? /* @__PURE__ */ a(Ce, { resourceId: S.assetId, updateResource: T }) : null }),
306
- P && S && /* @__PURE__ */ a(Ve, { isOpen: P, onCancel: k, onSuccess: H })
307
- ] })
308
- ] });
309
- }
310
- export {
311
- Ze as default
312
- };
package/lib/AppAction.js DELETED
@@ -1,35 +0,0 @@
1
- import { jsxs as h, Fragment as S, jsx as e } from "react/jsx-runtime";
2
- import { Suspense as A, lazy as x } from "react";
3
- import { Plus as O } from "@edifice-ui/icons";
4
- import { useToggle as P, useOdeClient as R, Button as y, LoadingScreen as I, isActionAvailable as k, BlogPublic as F } from "@edifice-ui/react";
5
- import { useTranslation as T } from "react-i18next";
6
- import { u as j, a as v, b as B, c as w, d as z, e as L, g as M } from "./index2.js";
7
- const N = /* @__PURE__ */ x(async () => await import("./ResourceModal.js"));
8
- function Q() {
9
- const [c, s] = P(), a = j((t) => t.config), {
10
- appCode: o
11
- } = R(), {
12
- t: l
13
- } = T(o), {
14
- clearSelectedItems: i,
15
- clearSelectedIds: u
16
- } = v(), {
17
- data: r
18
- } = B(a == null ? void 0 : a.actions), d = r == null ? void 0 : r.find((t) => t.id === "create"), n = w(), m = z(), p = L();
19
- return d ? /* @__PURE__ */ h(S, { children: [
20
- /* @__PURE__ */ e(y, { type: "button", color: "primary", variant: "filled", leftIcon: /* @__PURE__ */ e(O, {}), className: "ms-auto", onClick: () => {
21
- if (o == "scrapbook") {
22
- M({
23
- searchParams: p,
24
- folderId: n.id
25
- });
26
- return;
27
- }
28
- i(), u(), s();
29
- }, children: l("explorer.create.title") }),
30
- /* @__PURE__ */ e(A, { fallback: /* @__PURE__ */ e(I, {}), children: c && /* @__PURE__ */ e(N, { mode: "create", currentFolder: n, createResource: m, isOpen: c, onSuccess: s, onCancel: s, children: (t, f, C, g, b) => o === "blog" && k("createPublic", r) && /* @__PURE__ */ e(F, { appCode: o, isUpdating: f, resource: t, watch: C, setValue: g, register: b }) }) })
31
- ] }) : null;
32
- }
33
- export {
34
- Q as default
35
- };
@@ -1,46 +0,0 @@
1
- import { jsxs as s, jsx as l } from "react/jsx-runtime";
2
- import { Modal as a, Button as d } from "@edifice-ui/react";
3
- import { createPortal as c } from "react-dom";
4
- import { useTranslation as h } from "react-i18next";
5
- import { w as m, x as p, f as u } from "./index2.js";
6
- function f({
7
- onSuccess: t
8
- }) {
9
- const i = m(), r = p(), e = u();
10
- async function o() {
11
- try {
12
- e ? await i.mutate() : await r.mutate(), t == null || t();
13
- } catch (n) {
14
- console.error(n);
15
- }
16
- }
17
- return {
18
- isTrashFolder: e,
19
- onDelete: o
20
- };
21
- }
22
- function T({
23
- isOpen: t,
24
- onSuccess: i = () => ({}),
25
- onCancel: r = () => ({})
26
- }) {
27
- const {
28
- t: e
29
- } = h(), {
30
- isTrashFolder: o,
31
- onDelete: n
32
- } = f({
33
- onSuccess: i
34
- });
35
- return /* @__PURE__ */ c(/* @__PURE__ */ s(a, { isOpen: t, onModalClose: r, id: "deleteModal", children: [
36
- /* @__PURE__ */ l(a.Header, { onModalClose: r, children: e(o ? "explorer.delete.title" : "explorer.trash.title") }),
37
- /* @__PURE__ */ l(a.Body, { children: /* @__PURE__ */ l("p", { className: "body", children: e(o ? "explorer.delete.subtitle" : "explorer.trash.subtitle") }) }),
38
- /* @__PURE__ */ s(a.Footer, { children: [
39
- /* @__PURE__ */ l(d, { color: "tertiary", onClick: r, type: "button", variant: "ghost", children: e("explorer.cancel") }),
40
- /* @__PURE__ */ l(d, { color: "danger", onClick: n, type: "button", variant: "filled", children: e(o ? "explorer.delete" : "explorer.trash") })
41
- ] })
42
- ] }), document.getElementById("portal"));
43
- }
44
- export {
45
- T as default
46
- };
@@ -1,20 +0,0 @@
1
- import { jsxs as a, jsx as o } from "react/jsx-runtime";
2
- import { Modal as r, Button as i } from "@edifice-ui/react";
3
- import { createPortal as d } from "react-dom";
4
- import { useTranslation as n } from "react-i18next";
5
- function h({
6
- isOpen: l,
7
- onCancel: t = () => ({})
8
- }) {
9
- const {
10
- t: e
11
- } = n();
12
- return /* @__PURE__ */ d(/* @__PURE__ */ a(r, { isOpen: l, onModalClose: t, id: "trash_action_disable_resource", children: [
13
- /* @__PURE__ */ o(r.Header, { onModalClose: () => t(), children: e("explorer.trash.action.modal.title") }),
14
- /* @__PURE__ */ o(r.Body, { children: /* @__PURE__ */ o("p", { className: "body", children: e("explorer.trash.action.modal.text") }) }),
15
- /* @__PURE__ */ o(r.Footer, { children: /* @__PURE__ */ o(i, { color: "primary", onClick: t, type: "button", variant: "outline", children: e("close") }) })
16
- ] }), document.getElementById("portal"));
17
- }
18
- export {
19
- h as default
20
- };
@@ -1,25 +0,0 @@
1
- import { jsxs as a, jsx as r } from "react/jsx-runtime";
2
- import { Files as s } from "@edifice-ui/icons";
3
- import { AppIcon as l } from "@edifice-ui/react";
4
- function n({
5
- app: e,
6
- type: i
7
- }) {
8
- return i === "folder" ? /* @__PURE__ */ r(s, { width: "24", height: "24", className: `color-app-${e == null ? void 0 : e.displayName}` }) : i === "resource" ? /* @__PURE__ */ r(l, { app: e, iconFit: "ratio", size: "24", variant: "rounded" }) : null;
9
- }
10
- const g = ({
11
- app: e,
12
- type: i,
13
- name: t
14
- }) => /* @__PURE__ */ a("div", { className: "d-inline-flex align-items-center card is-selected gap-8", style: {
15
- flexDirection: "row",
16
- width: "252px",
17
- height: "32px",
18
- boxShadow: "0 0.2rem 0.6em rgba(0, 0, 0, 0.15)"
19
- }, children: [
20
- /* @__PURE__ */ r("div", { className: "ms-8", children: /* @__PURE__ */ r(n, { app: e, type: i }) }),
21
- /* @__PURE__ */ r("div", { className: "text-truncate", children: t })
22
- ] });
23
- export {
24
- g as D
25
- };