@bendyline/squisq-react 2.11.19 → 2.11.20

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.
@@ -5,13 +5,13 @@ import {
5
5
  InlineVideoPlayer,
6
6
  MarkdownRenderer,
7
7
  VideoEmbedFrame
8
- } from "./chunk-YLFAOGJF.js";
8
+ } from "./chunk-T7NVETOH.js";
9
9
  import {
10
10
  BlockRenderer
11
- } from "./chunk-KJZF2U3I.js";
11
+ } from "./chunk-LCBV2SE4.js";
12
12
  import {
13
13
  useMediaUrl
14
- } from "./chunk-63G5OJWY.js";
14
+ } from "./chunk-HCKL2AFN.js";
15
15
 
16
16
  // src/page/PageViewContext.ts
17
17
  import { createContext, useContext } from "react";
@@ -2,7 +2,7 @@ import {
2
2
  renderMermaidSvg,
3
3
  useMediaProvider,
4
4
  useResourcePolicy
5
- } from "./chunk-63G5OJWY.js";
5
+ } from "./chunk-HCKL2AFN.js";
6
6
 
7
7
  // src/hooks/useMediaSchedule.ts
8
8
  import { useMemo } from "react";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  MermaidDiagram
3
- } from "./chunk-QXZXQPL3.js";
3
+ } from "./chunk-Z7OW6RGR.js";
4
4
  import {
5
5
  useMediaUrl,
6
6
  useResourcePolicy
7
- } from "./chunk-63G5OJWY.js";
7
+ } from "./chunk-HCKL2AFN.js";
8
8
 
9
9
  // src/utils/animationUtils.ts
10
10
  import {
@@ -24,29 +24,33 @@ function useMediaUrl(relativePath, basePath) {
24
24
  return isResourceUrlAllowed(candidate, resourcePolicy) ? candidate : "";
25
25
  }, [isAbsolute, safePath, basePath, resourcePolicy]);
26
26
  const needsProvider = !isAbsolute && !!provider;
27
- const [url, setUrl] = useState(fallback);
27
+ const [resolved, setResolved] = useState(null);
28
28
  useEffect(() => {
29
29
  if (!needsProvider) {
30
- setUrl(fallback);
31
30
  return;
32
31
  }
33
32
  let cancelled = false;
34
- setUrl(fallback);
35
33
  provider.resolveUrl(safePath).then(
36
- (resolved) => {
34
+ (resolved2) => {
37
35
  if (!cancelled) {
38
- setUrl(isResourceUrlAllowed(resolved, resourcePolicy) ? resolved : "");
36
+ setResolved({
37
+ path: safePath,
38
+ provider,
39
+ policy: resourcePolicy,
40
+ url: isResourceUrlAllowed(resolved2, resourcePolicy) ? resolved2 : ""
41
+ });
39
42
  }
40
43
  },
41
44
  () => {
42
- if (!cancelled) setUrl(fallback);
45
+ if (!cancelled)
46
+ setResolved({ path: safePath, provider, policy: resourcePolicy, url: fallback });
43
47
  }
44
48
  );
45
49
  return () => {
46
50
  cancelled = true;
47
51
  };
48
52
  }, [needsProvider, provider, safePath, fallback, resourcePolicy]);
49
- return needsProvider ? url : fallback;
53
+ return !needsProvider ? fallback : resolved?.path === safePath && resolved.provider === provider && resolved.policy === resourcePolicy ? resolved.url : "";
50
54
  }
51
55
 
52
56
  // src/mermaid/mermaidRuntime.ts
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  LinearDocView
3
- } from "./chunk-BMQ3EGOP.js";
3
+ } from "./chunk-4HJBKCSY.js";
4
4
 
5
5
  // src/PaginatedDocView.tsx
6
6
  import {
@@ -11,7 +11,7 @@ import {
11
11
  getAnchorOffset,
12
12
  getTransitionClass,
13
13
  resolveValue
14
- } from "./chunk-WG7ALU5G.js";
14
+ } from "./chunk-DI7CKFRY.js";
15
15
 
16
16
  // src/BlockRenderer.tsx
17
17
  import { useId, useLayoutEffect, useRef, useState } from "react";
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  MermaidDiagram
3
- } from "./chunk-QXZXQPL3.js";
3
+ } from "./chunk-Z7OW6RGR.js";
4
4
  import {
5
5
  useMediaProvider,
6
6
  useMediaUrl
7
- } from "./chunk-63G5OJWY.js";
7
+ } from "./chunk-HCKL2AFN.js";
8
8
 
9
9
  // src/hooks/FenceRendererContext.tsx
10
10
  import { createContext, useContext } from "react";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-TT6ENR6T.js";
4
4
  import {
5
5
  MarkdownRenderer
6
- } from "./chunk-YLFAOGJF.js";
6
+ } from "./chunk-T7NVETOH.js";
7
7
 
8
8
  // src/jsonView/useJsonViewTokens.ts
9
9
  import { useMemo } from "react";
@@ -1,30 +1,30 @@
1
1
  import {
2
2
  LinearDocView
3
- } from "./chunk-BMQ3EGOP.js";
3
+ } from "./chunk-4HJBKCSY.js";
4
4
  import {
5
5
  useAudioSync,
6
6
  useDocPlayback,
7
7
  useMediaSchedule,
8
8
  useViewportOrientation
9
- } from "./chunk-SVVPYDV3.js";
9
+ } from "./chunk-7J4YN7EK.js";
10
10
  import {
11
11
  useAutoSurface
12
12
  } from "./chunk-TT6ENR6T.js";
13
13
  import {
14
14
  MarkdownRenderer
15
- } from "./chunk-YLFAOGJF.js";
15
+ } from "./chunk-T7NVETOH.js";
16
16
  import {
17
17
  BlockRenderer
18
- } from "./chunk-KJZF2U3I.js";
18
+ } from "./chunk-LCBV2SE4.js";
19
19
  import {
20
20
  isCaptureDrivenVideo,
21
21
  seekVideoToFrame
22
- } from "./chunk-WG7ALU5G.js";
22
+ } from "./chunk-DI7CKFRY.js";
23
23
  import {
24
24
  useMediaProvider,
25
25
  useMediaUrl,
26
26
  useResourcePolicy
27
- } from "./chunk-63G5OJWY.js";
27
+ } from "./chunk-HCKL2AFN.js";
28
28
 
29
29
  // src/MediaClipLayer.tsx
30
30
  import { useEffect, useRef } from "react";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  mermaidRenderErrorMessage,
3
3
  renderMermaidSvg
4
- } from "./chunk-63G5OJWY.js";
4
+ } from "./chunk-HCKL2AFN.js";
5
5
 
6
6
  // src/mermaid/MermaidDiagram.tsx
7
7
  import { useEffect, useState } from "react";
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  BlockRenderer
3
- } from "../chunk-KJZF2U3I.js";
4
- import "../chunk-WG7ALU5G.js";
5
- import "../chunk-QXZXQPL3.js";
3
+ } from "../chunk-LCBV2SE4.js";
4
+ import "../chunk-DI7CKFRY.js";
5
+ import "../chunk-Z7OW6RGR.js";
6
6
  import {
7
7
  renderMermaidSvgForExport
8
- } from "../chunk-63G5OJWY.js";
8
+ } from "../chunk-HCKL2AFN.js";
9
9
 
10
10
  // src/export/diagramPictures.ts
11
11
  import { createElement } from "react";
@@ -6,7 +6,7 @@ import {
6
6
  useDocPlayback,
7
7
  useMediaSchedule,
8
8
  useViewportOrientation
9
- } from "../chunk-SVVPYDV3.js";
9
+ } from "../chunk-7J4YN7EK.js";
10
10
  import {
11
11
  useAutoSurface
12
12
  } from "../chunk-TT6ENR6T.js";
@@ -16,7 +16,7 @@ import {
16
16
  useMediaProvider,
17
17
  useMediaUrl,
18
18
  useResourcePolicy
19
- } from "../chunk-63G5OJWY.js";
19
+ } from "../chunk-HCKL2AFN.js";
20
20
  export {
21
21
  MediaContext,
22
22
  ResourcePolicyContext,
package/dist/index.js CHANGED
@@ -15,17 +15,17 @@ import {
15
15
  formatTime,
16
16
  resolveDocPlayerAppearance,
17
17
  useMediaClipDurations
18
- } from "./chunk-LXOQCAU6.js";
18
+ } from "./chunk-Y4YCIMES.js";
19
19
  import {
20
20
  PaginatedDocView
21
- } from "./chunk-ZNW3DJAD.js";
21
+ } from "./chunk-JEEBHC5W.js";
22
22
  import {
23
23
  CanvasSection,
24
24
  LinearDocView,
25
25
  PageSectionView,
26
26
  PageViewContext,
27
27
  usePageView
28
- } from "./chunk-BMQ3EGOP.js";
28
+ } from "./chunk-4HJBKCSY.js";
29
29
  import {
30
30
  useModalDialog
31
31
  } from "./chunk-65POMKHR.js";
@@ -34,11 +34,11 @@ import {
34
34
  useDocPlayback,
35
35
  useMediaSchedule,
36
36
  useViewportOrientation
37
- } from "./chunk-SVVPYDV3.js";
37
+ } from "./chunk-7J4YN7EK.js";
38
38
  import {
39
39
  JsonView,
40
40
  createJsonFormFenceRenderer
41
- } from "./chunk-J4BHV6UO.js";
41
+ } from "./chunk-XQSZ55EQ.js";
42
42
  import {
43
43
  useAutoSurface
44
44
  } from "./chunk-TT6ENR6T.js";
@@ -51,10 +51,10 @@ import {
51
51
  VideoEmbedFrame,
52
52
  useAnimatedImage,
53
53
  useFenceRenderers
54
- } from "./chunk-YLFAOGJF.js";
54
+ } from "./chunk-T7NVETOH.js";
55
55
  import {
56
56
  BlockRenderer
57
- } from "./chunk-KJZF2U3I.js";
57
+ } from "./chunk-LCBV2SE4.js";
58
58
  import {
59
59
  ImageLayer,
60
60
  MapLayer,
@@ -67,17 +67,17 @@ import {
67
67
  VideoLayer,
68
68
  getAnimationStyle,
69
69
  getTransitionClass
70
- } from "./chunk-WG7ALU5G.js";
70
+ } from "./chunk-DI7CKFRY.js";
71
71
  import {
72
72
  MermaidDiagram
73
- } from "./chunk-QXZXQPL3.js";
73
+ } from "./chunk-Z7OW6RGR.js";
74
74
  import {
75
75
  MediaContext,
76
76
  ResourcePolicyContext,
77
77
  useMediaProvider,
78
78
  useMediaUrl,
79
79
  useResourcePolicy
80
- } from "./chunk-63G5OJWY.js";
80
+ } from "./chunk-HCKL2AFN.js";
81
81
  export {
82
82
  AnimatedImageControls,
83
83
  BlockRenderer,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  JsonView,
3
3
  createJsonFormFenceRenderer
4
- } from "../chunk-J4BHV6UO.js";
4
+ } from "../chunk-XQSZ55EQ.js";
5
5
  import "../chunk-TT6ENR6T.js";
6
- import "../chunk-YLFAOGJF.js";
7
- import "../chunk-QXZXQPL3.js";
8
- import "../chunk-63G5OJWY.js";
6
+ import "../chunk-T7NVETOH.js";
7
+ import "../chunk-Z7OW6RGR.js";
8
+ import "../chunk-HCKL2AFN.js";
9
9
  export {
10
10
  JsonView,
11
11
  createJsonFormFenceRenderer
@@ -8,9 +8,9 @@ import {
8
8
  TextLayer,
9
9
  TreeLayer,
10
10
  VideoLayer
11
- } from "../chunk-WG7ALU5G.js";
12
- import "../chunk-QXZXQPL3.js";
13
- import "../chunk-63G5OJWY.js";
11
+ } from "../chunk-DI7CKFRY.js";
12
+ import "../chunk-Z7OW6RGR.js";
13
+ import "../chunk-HCKL2AFN.js";
14
14
  export {
15
15
  ImageLayer,
16
16
  MapLayer,
@@ -3,11 +3,11 @@ import {
3
3
  MarkdownRenderer,
4
4
  VideoEmbedFrame,
5
5
  useFenceRenderers
6
- } from "../chunk-YLFAOGJF.js";
6
+ } from "../chunk-T7NVETOH.js";
7
7
  import {
8
8
  MermaidDiagram
9
- } from "../chunk-QXZXQPL3.js";
10
- import "../chunk-63G5OJWY.js";
9
+ } from "../chunk-Z7OW6RGR.js";
10
+ import "../chunk-HCKL2AFN.js";
11
11
  export {
12
12
  FenceRendererContext,
13
13
  MarkdownRenderer,
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  PaginatedDocView
3
- } from "../chunk-ZNW3DJAD.js";
3
+ } from "../chunk-JEEBHC5W.js";
4
4
  import {
5
5
  CanvasSection,
6
6
  LinearDocView,
7
7
  PageSectionView,
8
8
  PageViewContext,
9
9
  usePageView
10
- } from "../chunk-BMQ3EGOP.js";
10
+ } from "../chunk-4HJBKCSY.js";
11
11
  import "../chunk-TT6ENR6T.js";
12
- import "../chunk-YLFAOGJF.js";
13
- import "../chunk-KJZF2U3I.js";
14
- import "../chunk-WG7ALU5G.js";
15
- import "../chunk-QXZXQPL3.js";
16
- import "../chunk-63G5OJWY.js";
12
+ import "../chunk-T7NVETOH.js";
13
+ import "../chunk-LCBV2SE4.js";
14
+ import "../chunk-DI7CKFRY.js";
15
+ import "../chunk-Z7OW6RGR.js";
16
+ import "../chunk-HCKL2AFN.js";
17
17
  export {
18
18
  CanvasSection,
19
19
  LinearDocView,
@@ -12,20 +12,20 @@ import {
12
12
  MediaClipLayer,
13
13
  SocialCaptionOverlay,
14
14
  formatTime
15
- } from "../chunk-LXOQCAU6.js";
16
- import "../chunk-BMQ3EGOP.js";
17
- import "../chunk-SVVPYDV3.js";
15
+ } from "../chunk-Y4YCIMES.js";
16
+ import "../chunk-4HJBKCSY.js";
17
+ import "../chunk-7J4YN7EK.js";
18
18
  import "../chunk-TT6ENR6T.js";
19
19
  import {
20
20
  InlineAudioPlayer,
21
21
  InlineVideoPlayer
22
- } from "../chunk-YLFAOGJF.js";
22
+ } from "../chunk-T7NVETOH.js";
23
23
  import {
24
24
  BlockRenderer
25
- } from "../chunk-KJZF2U3I.js";
26
- import "../chunk-WG7ALU5G.js";
27
- import "../chunk-QXZXQPL3.js";
28
- import "../chunk-63G5OJWY.js";
25
+ } from "../chunk-LCBV2SE4.js";
26
+ import "../chunk-DI7CKFRY.js";
27
+ import "../chunk-Z7OW6RGR.js";
28
+ import "../chunk-HCKL2AFN.js";
29
29
  export {
30
30
  BlockRenderer,
31
31
  CaptionOverlay,