@bendyline/squisq-react 2.11.21 → 2.11.23
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/{chunk-DI7CKFRY.js → chunk-5OA2DYA2.js} +0 -2
- package/dist/{chunk-Y4YCIMES.js → chunk-AAZBM5PV.js} +4 -4
- package/dist/{chunk-4HJBKCSY.js → chunk-E7UE2PCJ.js} +1 -1
- package/dist/{chunk-65POMKHR.js → chunk-JP457U6N.js} +51 -21
- package/dist/{chunk-JEEBHC5W.js → chunk-KORFPHSJ.js} +1 -1
- package/dist/{chunk-LCBV2SE4.js → chunk-TN3NQAFM.js} +1 -1
- package/dist/diagram-pictures/index.js +2 -2
- package/dist/hooks/index.js +1 -1
- package/dist/index.js +6 -6
- package/dist/layers/index.js +1 -1
- package/dist/page/index.js +4 -4
- package/dist/player/index.js +4 -4
- package/dist/squisq-player.full.global.js +5 -5
- package/dist/squisq-player.global.js +5 -5
- package/dist/standalone-player-full.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/package.json +1 -1
|
@@ -445,7 +445,6 @@ function IconTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
|
|
|
445
445
|
{
|
|
446
446
|
"data-squisq-text-content": "true",
|
|
447
447
|
style: { width: "100%", whiteSpace: "pre-wrap", wordBreak: "break-word" },
|
|
448
|
-
"aria-label": plain,
|
|
449
448
|
dangerouslySetInnerHTML: { __html: html }
|
|
450
449
|
}
|
|
451
450
|
)
|
|
@@ -700,7 +699,6 @@ function RichTextLayer({ layer, viewport, blockTime, textScale = 1 }) {
|
|
|
700
699
|
{
|
|
701
700
|
"data-squisq-text-content": "true",
|
|
702
701
|
className: cls,
|
|
703
|
-
"aria-label": content.text,
|
|
704
702
|
style: {
|
|
705
703
|
width: "100%",
|
|
706
704
|
color: style.color,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
LinearDocView
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E7UE2PCJ.js";
|
|
4
4
|
import {
|
|
5
5
|
useAudioSync,
|
|
6
6
|
useDocPlayback,
|
|
@@ -15,11 +15,11 @@ import {
|
|
|
15
15
|
} from "./chunk-T7NVETOH.js";
|
|
16
16
|
import {
|
|
17
17
|
BlockRenderer
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-TN3NQAFM.js";
|
|
19
19
|
import {
|
|
20
20
|
isCaptureDrivenVideo,
|
|
21
21
|
seekVideoToFrame
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-5OA2DYA2.js";
|
|
23
23
|
import {
|
|
24
24
|
useMediaProvider,
|
|
25
25
|
useMediaUrl,
|
|
@@ -3615,7 +3615,7 @@ function DocPlayerContent({
|
|
|
3615
3615
|
isEntering: false,
|
|
3616
3616
|
viewport: activeViewport,
|
|
3617
3617
|
muted: renderMode || muted,
|
|
3618
|
-
animationsEnabled,
|
|
3618
|
+
animationsEnabled: animationsEnabled && !renderMode,
|
|
3619
3619
|
theme: effectiveTheme,
|
|
3620
3620
|
tableContentRenderer,
|
|
3621
3621
|
growTextToFit: isSlideshowMode,
|
|
@@ -6,26 +6,45 @@ var FOCUSABLE_SELECTOR = [
|
|
|
6
6
|
"input:not([disabled])",
|
|
7
7
|
"select:not([disabled])",
|
|
8
8
|
"textarea:not([disabled])",
|
|
9
|
-
'[tabindex]:not([tabindex="-1"])'
|
|
9
|
+
'[tabindex]:not([tabindex="-1"])',
|
|
10
|
+
'[contenteditable="true"]'
|
|
10
11
|
].join(",");
|
|
12
|
+
var modalStack = [];
|
|
13
|
+
var inertOwners = /* @__PURE__ */ new Map();
|
|
11
14
|
function isolateModal(root) {
|
|
12
|
-
const
|
|
15
|
+
const elements = [];
|
|
13
16
|
let branch = root;
|
|
14
17
|
while (branch?.parentElement) {
|
|
15
18
|
for (const sibling of branch.parentElement.children) {
|
|
16
19
|
if (sibling === branch || !(sibling instanceof HTMLElement)) continue;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
const owner = inertOwners.get(sibling);
|
|
21
|
+
if (owner) owner.count++;
|
|
22
|
+
else
|
|
23
|
+
inertOwners.set(sibling, {
|
|
24
|
+
element: sibling,
|
|
25
|
+
inert: sibling.inert === true,
|
|
26
|
+
ariaHidden: sibling.getAttribute("aria-hidden"),
|
|
27
|
+
count: 1
|
|
28
|
+
});
|
|
29
|
+
elements.push(sibling);
|
|
22
30
|
sibling.inert = true;
|
|
23
31
|
sibling.setAttribute("aria-hidden", "true");
|
|
24
32
|
}
|
|
25
33
|
branch = branch.parentElement;
|
|
26
34
|
if (branch === document.body) break;
|
|
27
35
|
}
|
|
28
|
-
return
|
|
36
|
+
return elements;
|
|
37
|
+
}
|
|
38
|
+
function canTabTo(element) {
|
|
39
|
+
if (element.tabIndex < 0 || element.matches(':disabled, input[type="hidden"]')) return false;
|
|
40
|
+
for (let ancestor = element; ancestor; ancestor = ancestor.parentElement) {
|
|
41
|
+
if (ancestor.hidden || ancestor.inert || ancestor.getAttribute("aria-hidden") === "true")
|
|
42
|
+
return false;
|
|
43
|
+
const style = getComputedStyle(ancestor);
|
|
44
|
+
if (style.display === "none" || style.visibility === "hidden" || style.visibility === "collapse")
|
|
45
|
+
return false;
|
|
46
|
+
}
|
|
47
|
+
return true;
|
|
29
48
|
}
|
|
30
49
|
function useModalDialog({
|
|
31
50
|
rootRef,
|
|
@@ -37,28 +56,33 @@ function useModalDialog({
|
|
|
37
56
|
}) {
|
|
38
57
|
const onCloseRef = useRef(onClose);
|
|
39
58
|
onCloseRef.current = onClose;
|
|
59
|
+
const closeOnEscapeRef = useRef(closeOnEscape);
|
|
60
|
+
closeOnEscapeRef.current = closeOnEscape;
|
|
40
61
|
useEffect(() => {
|
|
41
62
|
const root = rootRef.current;
|
|
42
63
|
const dialog = dialogRef.current;
|
|
43
64
|
if (!root || !dialog) return;
|
|
65
|
+
const token = /* @__PURE__ */ Symbol("modal");
|
|
66
|
+
modalStack.push(token);
|
|
44
67
|
const previousFocus = returnFocusRef?.current ?? (document.activeElement instanceof HTMLElement ? document.activeElement : null);
|
|
45
|
-
const inertSnapshots = isolateModal(root);
|
|
46
68
|
const activeWithinDialog = document.activeElement instanceof HTMLElement && dialog.contains(document.activeElement) ? document.activeElement : null;
|
|
47
|
-
const focusTarget = initialFocusRef?.current ?? activeWithinDialog ?? dialog.
|
|
69
|
+
const focusTarget = initialFocusRef?.current ?? activeWithinDialog ?? [...dialog.querySelectorAll(FOCUSABLE_SELECTOR)].find(canTabTo) ?? dialog;
|
|
48
70
|
focusTarget.focus();
|
|
49
71
|
if (focusTarget instanceof HTMLInputElement || focusTarget instanceof HTMLTextAreaElement) {
|
|
50
72
|
focusTarget.select();
|
|
51
73
|
}
|
|
74
|
+
const inertSnapshots = isolateModal(root);
|
|
52
75
|
const handleKeyDown = (event) => {
|
|
76
|
+
if (event.defaultPrevented || modalStack[modalStack.length - 1] !== token) return;
|
|
53
77
|
if (event.key === "Escape") {
|
|
54
78
|
event.preventDefault();
|
|
55
79
|
event.stopPropagation();
|
|
56
|
-
if (
|
|
80
|
+
if (closeOnEscapeRef.current) onCloseRef.current();
|
|
57
81
|
return;
|
|
58
82
|
}
|
|
59
83
|
if (event.key !== "Tab") return;
|
|
60
84
|
const focusable = [...dialog.querySelectorAll(FOCUSABLE_SELECTOR)].filter(
|
|
61
|
-
|
|
85
|
+
canTabTo
|
|
62
86
|
);
|
|
63
87
|
if (focusable.length === 0) {
|
|
64
88
|
event.preventDefault();
|
|
@@ -67,7 +91,7 @@ function useModalDialog({
|
|
|
67
91
|
}
|
|
68
92
|
const first = focusable[0];
|
|
69
93
|
const last = focusable[focusable.length - 1];
|
|
70
|
-
if (event.shiftKey && (document.activeElement === first || !dialog.contains(document.activeElement))) {
|
|
94
|
+
if (event.shiftKey && (document.activeElement === first || document.activeElement === dialog || !dialog.contains(document.activeElement))) {
|
|
71
95
|
event.preventDefault();
|
|
72
96
|
last.focus();
|
|
73
97
|
} else if (!event.shiftKey && (document.activeElement === last || !dialog.contains(document.activeElement))) {
|
|
@@ -75,17 +99,23 @@ function useModalDialog({
|
|
|
75
99
|
first.focus();
|
|
76
100
|
}
|
|
77
101
|
};
|
|
78
|
-
|
|
102
|
+
window.addEventListener("keydown", handleKeyDown);
|
|
79
103
|
return () => {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
104
|
+
window.removeEventListener("keydown", handleKeyDown);
|
|
105
|
+
const wasTopmost = modalStack[modalStack.length - 1] === token;
|
|
106
|
+
modalStack.splice(modalStack.indexOf(token), 1);
|
|
107
|
+
for (const element of inertSnapshots) {
|
|
108
|
+
const snapshot = inertOwners.get(element);
|
|
109
|
+
if (!snapshot || --snapshot.count > 0) continue;
|
|
110
|
+
element.inert = snapshot.inert;
|
|
111
|
+
if (snapshot.ariaHidden === null) element.removeAttribute("aria-hidden");
|
|
112
|
+
else element.setAttribute("aria-hidden", snapshot.ariaHidden);
|
|
113
|
+
inertOwners.delete(element);
|
|
85
114
|
}
|
|
86
|
-
if (previousFocus?.isConnected
|
|
115
|
+
if (wasTopmost && previousFocus?.isConnected && !previousFocus.closest("[inert]"))
|
|
116
|
+
previousFocus.focus();
|
|
87
117
|
};
|
|
88
|
-
}, [
|
|
118
|
+
}, [dialogRef, initialFocusRef, returnFocusRef, rootRef]);
|
|
89
119
|
}
|
|
90
120
|
|
|
91
121
|
export {
|
package/dist/hooks/index.js
CHANGED
package/dist/index.js
CHANGED
|
@@ -15,20 +15,20 @@ import {
|
|
|
15
15
|
formatTime,
|
|
16
16
|
resolveDocPlayerAppearance,
|
|
17
17
|
useMediaClipDurations
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AAZBM5PV.js";
|
|
19
19
|
import {
|
|
20
20
|
PaginatedDocView
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-KORFPHSJ.js";
|
|
22
22
|
import {
|
|
23
23
|
CanvasSection,
|
|
24
24
|
LinearDocView,
|
|
25
25
|
PageSectionView,
|
|
26
26
|
PageViewContext,
|
|
27
27
|
usePageView
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-E7UE2PCJ.js";
|
|
29
29
|
import {
|
|
30
30
|
useModalDialog
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-JP457U6N.js";
|
|
32
32
|
import {
|
|
33
33
|
useAudioSync,
|
|
34
34
|
useDocPlayback,
|
|
@@ -54,7 +54,7 @@ import {
|
|
|
54
54
|
} from "./chunk-T7NVETOH.js";
|
|
55
55
|
import {
|
|
56
56
|
BlockRenderer
|
|
57
|
-
} from "./chunk-
|
|
57
|
+
} from "./chunk-TN3NQAFM.js";
|
|
58
58
|
import {
|
|
59
59
|
ImageLayer,
|
|
60
60
|
MapLayer,
|
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
VideoLayer,
|
|
68
68
|
getAnimationStyle,
|
|
69
69
|
getTransitionClass
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-5OA2DYA2.js";
|
|
71
71
|
import {
|
|
72
72
|
MermaidDiagram
|
|
73
73
|
} from "./chunk-Z7OW6RGR.js";
|
package/dist/layers/index.js
CHANGED
package/dist/page/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PaginatedDocView
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-KORFPHSJ.js";
|
|
4
4
|
import {
|
|
5
5
|
CanvasSection,
|
|
6
6
|
LinearDocView,
|
|
7
7
|
PageSectionView,
|
|
8
8
|
PageViewContext,
|
|
9
9
|
usePageView
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-E7UE2PCJ.js";
|
|
11
11
|
import "../chunk-TT6ENR6T.js";
|
|
12
12
|
import "../chunk-T7NVETOH.js";
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
13
|
+
import "../chunk-TN3NQAFM.js";
|
|
14
|
+
import "../chunk-5OA2DYA2.js";
|
|
15
15
|
import "../chunk-Z7OW6RGR.js";
|
|
16
16
|
import "../chunk-HCKL2AFN.js";
|
|
17
17
|
export {
|
package/dist/player/index.js
CHANGED
|
@@ -12,8 +12,8 @@ import {
|
|
|
12
12
|
MediaClipLayer,
|
|
13
13
|
SocialCaptionOverlay,
|
|
14
14
|
formatTime
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
15
|
+
} from "../chunk-AAZBM5PV.js";
|
|
16
|
+
import "../chunk-E7UE2PCJ.js";
|
|
17
17
|
import "../chunk-7J4YN7EK.js";
|
|
18
18
|
import "../chunk-TT6ENR6T.js";
|
|
19
19
|
import {
|
|
@@ -22,8 +22,8 @@ import {
|
|
|
22
22
|
} from "../chunk-T7NVETOH.js";
|
|
23
23
|
import {
|
|
24
24
|
BlockRenderer
|
|
25
|
-
} from "../chunk-
|
|
26
|
-
import "../chunk-
|
|
25
|
+
} from "../chunk-TN3NQAFM.js";
|
|
26
|
+
import "../chunk-5OA2DYA2.js";
|
|
27
27
|
import "../chunk-Z7OW6RGR.js";
|
|
28
28
|
import "../chunk-HCKL2AFN.js";
|
|
29
29
|
export {
|