ublo-lib 1.42.38 → 1.42.40
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,14 +11,14 @@ export default function useMseMPresets({ defaultOptions }) {
|
|
|
11
11
|
const handleSectionClick = React.useCallback((e) => {
|
|
12
12
|
const target = e.target;
|
|
13
13
|
const section = target.closest(`section[${PRESET_ATTRIBUTE}]`);
|
|
14
|
-
const url = section
|
|
14
|
+
const url = section?.querySelector("a")?.getAttribute("href");
|
|
15
15
|
const preset = section?.getAttribute(PRESET_ATTRIBUTE);
|
|
16
16
|
if (!preset)
|
|
17
17
|
return;
|
|
18
18
|
const { widget, options = {}, presets, groundedTo, } = JSON.parse(preset);
|
|
19
19
|
if (groundedTo)
|
|
20
20
|
return;
|
|
21
|
-
const { prefixes, ...otherDefaultOptions } = defaultOptions;
|
|
21
|
+
const { prefixes = {}, ...otherDefaultOptions } = defaultOptions;
|
|
22
22
|
const prefixUrl = prefixes[widget];
|
|
23
23
|
const allOptions = {
|
|
24
24
|
...options,
|
|
@@ -68,7 +68,7 @@ export default function useMseMPresets({ defaultOptions }) {
|
|
|
68
68
|
const isAlreadyLoaded = placeholder.hasAttribute("id");
|
|
69
69
|
if (isAlreadyLoaded)
|
|
70
70
|
return;
|
|
71
|
-
const { prefixes, ...otherDefaultOptions } = defaultOptions;
|
|
71
|
+
const { prefixes = {}, ...otherDefaultOptions } = defaultOptions;
|
|
72
72
|
const prefixUrl = prefixes[widget];
|
|
73
73
|
const uniqueId = `msem-${Math.random().toString(36).substring(2, 9)}`;
|
|
74
74
|
const allOptions = {
|