@edifice.io/react 2.3.0-develop-pedago.20250911173106 → 2.3.0-develop-pedago.20250915144529

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.
@@ -11,6 +11,7 @@ import { useSearch } from "./hooks/useSearch.js";
11
11
  import useShare from "./hooks/useShare.js";
12
12
  import { useShareBookmark } from "./hooks/useShareBookmark.js";
13
13
  import Modal from "../../../components/Modal/Modal.js";
14
+ import Alert from "../../../components/Alert/Alert.js";
14
15
  import Heading from "../../../components/Heading/Heading.js";
15
16
  import LoadingScreen from "../../../components/LoadingScreen/LoadingScreen.js";
16
17
  import VisuallyHidden from "../../../components/VisuallyHidden/VisuallyHidden.js";
@@ -84,6 +85,7 @@ function ShareResourceModal({
84
85
  return /* @__PURE__ */ createPortal(/* @__PURE__ */ jsxs(Modal, { id: "share_modal", size: "lg", isOpen, onModalClose: onCancel, children: [
85
86
  /* @__PURE__ */ jsx(Modal.Header, { onModalClose: onCancel, children: t("share.title") }),
86
87
  /* @__PURE__ */ jsxs(Modal.Body, { children: [
88
+ /* @__PURE__ */ jsx(Alert, { type: "info", className: "mb-16", children: t("explorer.modal.share.alert.community") }),
87
89
  /* @__PURE__ */ jsx(Heading, { headingStyle: "h4", level: "h3", className: "mb-16", children: t("explorer.modal.share.usersWithAccess") }),
88
90
  /* @__PURE__ */ jsx("div", { className: "table-responsive", children: isLoading ? /* @__PURE__ */ jsx(LoadingScreen, {}) : /* @__PURE__ */ jsxs("table", { className: "table border align-middle mb-0", children: [
89
91
  /* @__PURE__ */ jsx("thead", { className: "bg-secondary", children: /* @__PURE__ */ jsxs("tr", { children: [
@@ -32,6 +32,8 @@ export interface InternalLinkerProps {
32
32
  applicationList?: ApplicationOption[];
33
33
  /** Whether to show the application selector */
34
34
  showApplicationSelector?: boolean;
35
+ /** Optional callback to filter resources after loading. Applied in addition to search filters. */
36
+ resourceFilter?: (resource: ILinkedResource) => boolean;
35
37
  }
36
- export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const InternalLinker: ({ appCode, defaultAppCode, defaultResourceId, onChange, onSelect, multiple, resourceList, applicationList, showApplicationSelector, resourceFilter, }: InternalLinkerProps) => import("react/jsx-runtime").JSX.Element;
37
39
  export default InternalLinker;
@@ -21,7 +21,8 @@ const InternalLinker = ({
21
21
  multiple = !0,
22
22
  resourceList,
23
23
  applicationList,
24
- showApplicationSelector = !0
24
+ showApplicationSelector = !0,
25
+ resourceFilter
25
26
  }) => {
26
27
  const {
27
28
  t
@@ -38,8 +39,8 @@ const InternalLinker = ({
38
39
  }, []), sortResources = useCallback((resources2) => resources2.sort((a, b) => a.modifiedAt < b.modifiedAt ? 1 : -1), []), loadAndDisplayResources = useCallback((search) => {
39
40
  async function load() {
40
41
  if (resourceList) {
41
- const filteredResources = resourceList.filter((resource) => filterResources(resource, search));
42
- setResources(sortResources(filteredResources));
42
+ let filteredResources = resourceList.filter((resource) => filterResources(resource, search));
43
+ resourceFilter && (filteredResources = filteredResources.filter(resourceFilter)), setResources(sortResources(filteredResources));
43
44
  return;
44
45
  } else if (selectedApplication)
45
46
  try {
@@ -61,7 +62,7 @@ const InternalLinker = ({
61
62
  setResources([]);
62
63
  }
63
64
  load();
64
- }, [loadResources, selectedApplication, filterResources, sortResources, resourceList]), [selectedDocuments, setSelectedDocuments] = useState([]), handleOptionClick = (option) => {
65
+ }, [loadResources, selectedApplication, filterResources, sortResources, resourceList, resourceFilter]), [selectedDocuments, setSelectedDocuments] = useState([]), handleOptionClick = (option) => {
65
66
  onChange == null || onChange(option), setSelectedApplication(option);
66
67
  }, handleSearchChange = (event) => {
67
68
  const newText = event.target.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/react",
3
- "version": "2.3.0-develop-pedago.20250911173106",
3
+ "version": "2.3.0-develop-pedago.20250915144529",
4
4
  "description": "Edifice React Library",
5
5
  "keywords": [
6
6
  "react",
@@ -130,9 +130,9 @@
130
130
  "react-slugify": "^3.0.3",
131
131
  "swiper": "^10.1.0",
132
132
  "ua-parser-js": "^1.0.36",
133
- "@edifice.io/bootstrap": "2.3.0-develop-pedago.20250911173106",
134
- "@edifice.io/tiptap-extensions": "2.3.0-develop-pedago.20250911173106",
135
- "@edifice.io/utilities": "2.3.0-develop-pedago.20250911173106"
133
+ "@edifice.io/bootstrap": "2.3.0-develop-pedago.20250915144529",
134
+ "@edifice.io/tiptap-extensions": "2.3.0-develop-pedago.20250915144529",
135
+ "@edifice.io/utilities": "2.3.0-develop-pedago.20250915144529"
136
136
  },
137
137
  "devDependencies": {
138
138
  "@babel/plugin-transform-react-pure-annotations": "^7.23.3",
@@ -163,8 +163,8 @@
163
163
  "vite": "^5.4.11",
164
164
  "vite-plugin-dts": "^4.1.0",
165
165
  "vite-tsconfig-paths": "^5.0.1",
166
- "@edifice.io/client": "2.3.0-develop-pedago.20250911173106",
167
- "@edifice.io/config": "2.3.0-develop-pedago.20250911173106"
166
+ "@edifice.io/client": "2.3.0-develop-pedago.20250915144529",
167
+ "@edifice.io/config": "2.3.0-develop-pedago.20250915144529"
168
168
  },
169
169
  "peerDependencies": {
170
170
  "@react-spring/web": "^9.7.5",