@bendyline/squisq-react 2.4.5 → 2.4.6

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/NOTICE.md CHANGED
@@ -6,12 +6,13 @@ Third-party components remain under their respective license terms.
6
6
 
7
7
  ## Runtime, peer, and bundled dependencies
8
8
 
9
- | Package | Version | License | Repository |
10
- | ------------------ | -------------------- | ------- | ------------------------------------- |
11
- | mermaid | 11.16.0 | MIT | https://github.com/mermaid-js/mermaid |
12
- | preact _(bundled)_ | 10.29.0 | MIT | https://github.com/preactjs/preact |
13
- | react _(peer)_ | ^18.0.0 \|\| ^19.0.0 | MIT | https://github.com/facebook/react |
14
- | react-dom _(peer)_ | ^18.0.0 \|\| ^19.0.0 | MIT | https://github.com/facebook/react |
9
+ | Package | Version | License | Repository |
10
+ | ----------------------------- | -------------------- | ----------------------------- | ------------------------------------------- |
11
+ | @fortawesome/fontawesome-free | 7.2.0 | CC-BY-4.0 AND OFL-1.1 AND MIT | https://github.com/FortAwesome/Font-Awesome |
12
+ | mermaid | 11.16.0 | MIT | https://github.com/mermaid-js/mermaid |
13
+ | preact _(bundled)_ | 10.29.0 | MIT | https://github.com/preactjs/preact |
14
+ | react _(peer)_ | ^18.0.0 \|\| ^19.0.0 | MIT | https://github.com/facebook/react |
15
+ | react-dom _(peer)_ | ^18.0.0 \|\| ^19.0.0 | MIT | https://github.com/facebook/react |
15
16
 
16
17
  Mermaid is Copyright (c) 2014-2022 Knut Sveidqvist and is distributed under
17
18
  the MIT License. Preact is used by the standalone browser bundles. Exact
package/README.md CHANGED
@@ -91,9 +91,10 @@ useDocPlayback(doc, currentTime, { viewport, theme, onSeek });
91
91
 
92
92
  ## Standalone Player
93
93
 
94
- A self-contained global build is available for non-React environments. It
95
- exposes a `SquisqPlayer` global with `mount`, `getHandle`, `unmount`, and
96
- `version`. `mount` returns an instance handle.
94
+ A global build is available for non-React environments. It exposes a
95
+ `SquisqPlayer` global with `mount`, `getHandle`, `unmount`, and `version`.
96
+ `mount` returns an instance handle. Load the package stylesheet alongside the
97
+ raw global build so authored Font Awesome icons can use the shared webfonts.
97
98
 
98
99
  The default build is the light player and omits Mermaid's multi-megabyte parser
99
100
  and layout engines. Documents that contain Mermaid fences should use the full
@@ -108,6 +109,7 @@ top-level `window.seekTo` / `window.getDuration` properties.
108
109
  Interactive mount:
109
110
 
110
111
  ```html
112
+ <link rel="stylesheet" href="https://unpkg.com/@bendyline/squisq-react/dist/styles/index.css" />
111
113
  <script src="https://unpkg.com/@bendyline/squisq-react/dist/squisq-player.global.js"></script>
112
114
  <div id="player"></div>
113
115
  <script>
@@ -138,12 +140,13 @@ content. Embedded video, timed media, captions, audio, and document timing stay
138
140
  active; this makes the option suitable for compact MP4 and animated-GIF export.
139
141
 
140
142
  For build-time embedding, `@bendyline/squisq-react/standalone-source` exports
141
- the same bundle as a string constant (`PLAYER_BUNDLE`) used by
142
- `@bendyline/squisq-formats` and the CLI to produce single-file HTML exports.
143
+ the player as a self-contained string constant (`PLAYER_BUNDLE`) with the
144
+ shared icon styles composed once. It is used by `@bendyline/squisq-formats`
145
+ and the CLI to produce single-file HTML and rendered video exports.
143
146
 
144
147
  ## Styles
145
148
 
146
- Import the animation CSS for block transitions:
149
+ Import the package CSS for block transitions and Font Awesome inline icons:
147
150
 
148
151
  ```ts
149
152
  import '@bendyline/squisq-react/styles';
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  BlockRenderer,
3
3
  LinearDocView
4
- } from "./chunk-EJMUO6VX.js";
4
+ } from "./chunk-ICM7AWQT.js";
5
5
  import {
6
6
  useAudioSync,
7
7
  useDocPlayback,
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-TT6ENR6T.js";
4
4
  import {
5
5
  MarkdownRenderer
6
- } from "./chunk-D7KN4CRG.js";
6
+ } from "./chunk-VMPQEUJH.js";
7
7
 
8
8
  // src/jsonView/useJsonViewTokens.ts
9
9
  import { useMemo } from "react";
@@ -16,7 +16,7 @@ import {
16
16
  import {
17
17
  InlineVideoPlayer,
18
18
  MarkdownRenderer
19
- } from "./chunk-D7KN4CRG.js";
19
+ } from "./chunk-VMPQEUJH.js";
20
20
  import {
21
21
  useMediaUrl
22
22
  } from "./chunk-LR3AIGDD.js";
@@ -103,6 +103,16 @@ function renderInline(nodes, keyPrefix = "", ctx = DEFAULT_CTX) {
103
103
  return /* @__PURE__ */ jsx3("br", {}, key);
104
104
  case "inlineMath":
105
105
  return /* @__PURE__ */ jsx3("code", { className: "squisq-md-inline-math", children: node.value }, key);
106
+ case "inlineIcon":
107
+ return /* @__PURE__ */ jsx3(
108
+ "i",
109
+ {
110
+ className: `fa-${node.family} fa-${node.name}`,
111
+ "data-icon": node.token,
112
+ "aria-hidden": "true"
113
+ },
114
+ key
115
+ );
106
116
  case "htmlInline":
107
117
  if (ctx.htmlPolicy === "strip") return null;
108
118
  return /* @__PURE__ */ jsx3("span", { className: "squisq-md-html-inline", children: renderHtmlNodes(resolveHtmlNodes(node.htmlChildren, ctx.htmlPolicy), `${key}h`, ctx) }, key);
package/dist/index.d.ts CHANGED
@@ -17,8 +17,9 @@ import '@bendyline/squisq/jsonForm';
17
17
  * Standalone Entry Point — IIFE bundle for self-contained HTML rendering.
18
18
  *
19
19
  * This file is the entry point for the standalone `squisq-player.iife.js` bundle.
20
- * It bundles Preact (via preact/compat), squisq core, and all rendering components
21
- * into a single self-contained script that can be loaded in any HTML page.
20
+ * It bundles Preact (via preact/compat), squisq core, rendering components, and
21
+ * animation CSS. Raw-script consumers load the package stylesheet for shared
22
+ * icon webfonts; standalone-source and the CLI compose those styles once.
22
23
  *
23
24
  * The bundle exposes a global `SquisqPlayer` object with methods to mount
24
25
  * interactive or static document views into any DOM element.
package/dist/index.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  formatTime,
13
13
  resolveDocPlayerAppearance,
14
14
  useMediaClipDurations
15
- } from "./chunk-A4VLH2US.js";
15
+ } from "./chunk-7CDO336T.js";
16
16
  import {
17
17
  BlockRenderer,
18
18
  CanvasSection,
@@ -20,7 +20,7 @@ import {
20
20
  PageSectionView,
21
21
  PageViewContext,
22
22
  usePageView
23
- } from "./chunk-EJMUO6VX.js";
23
+ } from "./chunk-ICM7AWQT.js";
24
24
  import {
25
25
  ImageLayer,
26
26
  MapLayer,
@@ -45,7 +45,7 @@ import {
45
45
  } from "./chunk-BOZJ655L.js";
46
46
  import {
47
47
  JsonView
48
- } from "./chunk-NANF7REM.js";
48
+ } from "./chunk-DJRYQQXB.js";
49
49
  import {
50
50
  useAutoSurface
51
51
  } from "./chunk-TT6ENR6T.js";
@@ -53,7 +53,7 @@ import {
53
53
  InlineAudioPlayer,
54
54
  InlineVideoPlayer,
55
55
  MarkdownRenderer
56
- } from "./chunk-D7KN4CRG.js";
56
+ } from "./chunk-VMPQEUJH.js";
57
57
  import {
58
58
  MermaidDiagram
59
59
  } from "./chunk-WLUZTUNZ.js";
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  JsonView
3
- } from "../chunk-NANF7REM.js";
3
+ } from "../chunk-DJRYQQXB.js";
4
4
  import "../chunk-TT6ENR6T.js";
5
- import "../chunk-D7KN4CRG.js";
5
+ import "../chunk-VMPQEUJH.js";
6
6
  import "../chunk-WLUZTUNZ.js";
7
7
  import "../chunk-LR3AIGDD.js";
8
8
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MarkdownRenderer
3
- } from "../chunk-D7KN4CRG.js";
3
+ } from "../chunk-VMPQEUJH.js";
4
4
  import {
5
5
  MermaidDiagram
6
6
  } from "../chunk-WLUZTUNZ.js";
@@ -4,10 +4,10 @@ import {
4
4
  PageSectionView,
5
5
  PageViewContext,
6
6
  usePageView
7
- } from "../chunk-EJMUO6VX.js";
7
+ } from "../chunk-ICM7AWQT.js";
8
8
  import "../chunk-TI5X7SBC.js";
9
9
  import "../chunk-TT6ENR6T.js";
10
- import "../chunk-D7KN4CRG.js";
10
+ import "../chunk-VMPQEUJH.js";
11
11
  import "../chunk-WLUZTUNZ.js";
12
12
  import "../chunk-LR3AIGDD.js";
13
13
  export {
@@ -10,17 +10,17 @@ import {
10
10
  MediaClipLayer,
11
11
  SocialCaptionOverlay,
12
12
  formatTime
13
- } from "../chunk-A4VLH2US.js";
13
+ } from "../chunk-7CDO336T.js";
14
14
  import {
15
15
  BlockRenderer
16
- } from "../chunk-EJMUO6VX.js";
16
+ } from "../chunk-ICM7AWQT.js";
17
17
  import "../chunk-TI5X7SBC.js";
18
18
  import "../chunk-BOZJ655L.js";
19
19
  import "../chunk-TT6ENR6T.js";
20
20
  import {
21
21
  InlineAudioPlayer,
22
22
  InlineVideoPlayer
23
- } from "../chunk-D7KN4CRG.js";
23
+ } from "../chunk-VMPQEUJH.js";
24
24
  import "../chunk-WLUZTUNZ.js";
25
25
  import "../chunk-LR3AIGDD.js";
26
26
  export {