@arbidocs/blocks 0.5.125 → 0.5.127
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/README.md +19 -0
- package/dist/{ClippingMediaViewer-ZFEX5A3U.cjs → ClippingMediaViewer-47BAXNLO.cjs} +10 -11
- package/dist/ClippingMediaViewer-47BAXNLO.cjs.map +1 -0
- package/dist/{ClippingPdfViewer-3LRTEPHV.cjs → ClippingPdfViewer-D5BYHEAH.cjs} +16 -14
- package/dist/ClippingPdfViewer-D5BYHEAH.cjs.map +1 -0
- package/dist/ConnectedCallDock-XJOYVVAH.cjs +6 -6
- package/dist/ConnectedCallRoom-CUDYAPQK.cjs +6 -6
- package/dist/{ConnectedNativeDocxComparison-7QQ55JIO.cjs → ConnectedNativeDocxComparison-JUF2TI2P.cjs} +12 -12
- package/dist/{ConnectedNativeDocxComparison-7QQ55JIO.cjs.map → ConnectedNativeDocxComparison-JUF2TI2P.cjs.map} +1 -1
- package/dist/{ConnectedPresentation-L32JPRFI.cjs → ConnectedPresentation-SI3L77J4.cjs} +35 -36
- package/dist/ConnectedPresentation-SI3L77J4.cjs.map +1 -0
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs → ConnectedProductionSetDialog-LHB4VQWC.cjs} +3 -3
- package/dist/{ConnectedProductionSetDialog-4EAY6KAZ.cjs.map → ConnectedProductionSetDialog-LHB4VQWC.cjs.map} +1 -1
- package/dist/{ConnectedSlidesTab-P7GGNUTO.cjs → ConnectedSlidesTab-E76OVY34.cjs} +38 -44
- package/dist/ConnectedSlidesTab-E76OVY34.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-7NJ3N52V.cjs → ConnectedStreamedWordArtifact-Q64DRRQD.cjs} +12 -12
- package/dist/{ConnectedStreamedWordArtifact-7NJ3N52V.cjs.map → ConnectedStreamedWordArtifact-Q64DRRQD.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-BFPOFQXI.cjs → DocumentReviewCard-M53XFLI2.cjs} +16 -16
- package/dist/{DocumentReviewCard-BFPOFQXI.cjs.map → DocumentReviewCard-M53XFLI2.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-MHUVEZ7M.cjs → FilesViewerDialog-V6FSRQTP.cjs} +33 -34
- package/dist/FilesViewerDialog-V6FSRQTP.cjs.map +1 -0
- package/dist/{NativeDocxEditor-SIRYPMBN.cjs → NativeDocxEditor-2PTEK6ND.cjs} +6 -6
- package/dist/{NativeDocxEditor-SIRYPMBN.cjs.map → NativeDocxEditor-2PTEK6ND.cjs.map} +1 -1
- package/dist/{SpotlightStrip-ED22UYTM.cjs → SpotlightStrip-QQ2WUI32.cjs} +28 -29
- package/dist/SpotlightStrip-QQ2WUI32.cjs.map +1 -0
- package/dist/{WorkspaceTableView-MIFYXV3G.cjs → WorkspaceTableView-3XYAV4BV.cjs} +8 -8
- package/dist/{WorkspaceTableView-MIFYXV3G.cjs.map → WorkspaceTableView-3XYAV4BV.cjs.map} +1 -1
- package/dist/agents/index.cjs +215 -215
- package/dist/ai-IEIR7SC2.cjs +3 -3
- package/dist/auth/index.cjs +1 -1
- package/dist/calls/index.cjs +2 -2
- package/dist/chat/index.cjs +6 -6
- package/dist/{chunk-GAMRVB3I.cjs → chunk-23I5EUZA.cjs} +65 -10
- package/dist/chunk-23I5EUZA.cjs.map +1 -0
- package/dist/{chunk-ZZZITHGK.cjs → chunk-26SFI2BH.cjs} +16 -3
- package/dist/chunk-26SFI2BH.cjs.map +1 -0
- package/dist/{chunk-OGK377NL.cjs → chunk-2SU37RZA.cjs} +409 -42
- package/dist/chunk-2SU37RZA.cjs.map +1 -0
- package/dist/{chunk-CQ2RJYE2.cjs → chunk-3IH55CDE.cjs} +3 -3
- package/dist/{chunk-CQ2RJYE2.cjs.map → chunk-3IH55CDE.cjs.map} +1 -1
- package/dist/{chunk-AS6QZETU.cjs → chunk-5QERK4PK.cjs} +35 -35
- package/dist/{chunk-AS6QZETU.cjs.map → chunk-5QERK4PK.cjs.map} +1 -1
- package/dist/{chunk-AISYXX4M.cjs → chunk-7NLO7ASW.cjs} +4 -4
- package/dist/{chunk-AISYXX4M.cjs.map → chunk-7NLO7ASW.cjs.map} +1 -1
- package/dist/{chunk-QIK7E6VF.cjs → chunk-7PN3YENO.cjs} +4 -4
- package/dist/{chunk-QIK7E6VF.cjs.map → chunk-7PN3YENO.cjs.map} +1 -1
- package/dist/{chunk-JY7UUZQG.cjs → chunk-7Q46YAX4.cjs} +74 -71
- package/dist/chunk-7Q46YAX4.cjs.map +1 -0
- package/dist/{chunk-J3FFSEKO.cjs → chunk-ADDQKZ5I.cjs} +4 -4
- package/dist/{chunk-J3FFSEKO.cjs.map → chunk-ADDQKZ5I.cjs.map} +1 -1
- package/dist/{chunk-L6HTZIBD.cjs → chunk-ALK3PUUB.cjs} +3 -3
- package/dist/{chunk-L6HTZIBD.cjs.map → chunk-ALK3PUUB.cjs.map} +1 -1
- package/dist/{chunk-3ZZZO4F7.cjs → chunk-BY3QA3S5.cjs} +9 -9
- package/dist/{chunk-3ZZZO4F7.cjs.map → chunk-BY3QA3S5.cjs.map} +1 -1
- package/dist/{chunk-3UP32FM3.cjs → chunk-CQQQIZU4.cjs} +5 -5
- package/dist/{chunk-3UP32FM3.cjs.map → chunk-CQQQIZU4.cjs.map} +1 -1
- package/dist/{chunk-YOEP3I4V.cjs → chunk-E3L5DB5F.cjs} +5 -5
- package/dist/{chunk-YOEP3I4V.cjs.map → chunk-E3L5DB5F.cjs.map} +1 -1
- package/dist/{chunk-UA7HOLAZ.cjs → chunk-ESVRVZ53.cjs} +5 -5
- package/dist/{chunk-UA7HOLAZ.cjs.map → chunk-ESVRVZ53.cjs.map} +1 -1
- package/dist/{chunk-2K6IMIVL.cjs → chunk-GNZAH6UI.cjs} +3 -3
- package/dist/{chunk-2K6IMIVL.cjs.map → chunk-GNZAH6UI.cjs.map} +1 -1
- package/dist/{chunk-KA3F6TIH.cjs → chunk-IWHP7FAB.cjs} +12 -5
- package/dist/chunk-IWHP7FAB.cjs.map +1 -0
- package/dist/{chunk-ORNLCBNE.cjs → chunk-JVEDKKNO.cjs} +43 -4
- package/dist/chunk-JVEDKKNO.cjs.map +1 -0
- package/dist/{chunk-6JMW3IJ2.cjs → chunk-JVLOIIA7.cjs} +103 -100
- package/dist/chunk-JVLOIIA7.cjs.map +1 -0
- package/dist/{chunk-UUENH4BJ.cjs → chunk-KXIRVKCJ.cjs} +3 -3
- package/dist/{chunk-UUENH4BJ.cjs.map → chunk-KXIRVKCJ.cjs.map} +1 -1
- package/dist/{chunk-YVO6Z5BS.cjs → chunk-M6WVIGYP.cjs} +10 -10
- package/dist/{chunk-YVO6Z5BS.cjs.map → chunk-M6WVIGYP.cjs.map} +1 -1
- package/dist/{chunk-PSB64T43.cjs → chunk-MLA2BJ2Y.cjs} +28 -28
- package/dist/{chunk-PSB64T43.cjs.map → chunk-MLA2BJ2Y.cjs.map} +1 -1
- package/dist/{chunk-B3R62764.cjs → chunk-MMSHIIKG.cjs} +6 -6
- package/dist/{chunk-B3R62764.cjs.map → chunk-MMSHIIKG.cjs.map} +1 -1
- package/dist/{chunk-ENOPKX7E.cjs → chunk-MXBXZXXQ.cjs} +3 -3
- package/dist/{chunk-ENOPKX7E.cjs.map → chunk-MXBXZXXQ.cjs.map} +1 -1
- package/dist/chunk-NTDQQLDD.cjs +18 -0
- package/dist/{chunk-IRGRMJPP.cjs.map → chunk-NTDQQLDD.cjs.map} +1 -1
- package/dist/{chunk-PVJ5ODDB.cjs → chunk-Q6IKXWPG.cjs} +4 -4
- package/dist/{chunk-PVJ5ODDB.cjs.map → chunk-Q6IKXWPG.cjs.map} +1 -1
- package/dist/{chunk-4LP5MJGQ.cjs → chunk-QG2U2JGX.cjs} +4 -4
- package/dist/{chunk-4LP5MJGQ.cjs.map → chunk-QG2U2JGX.cjs.map} +1 -1
- package/dist/{chunk-MVXHTAJ4.cjs → chunk-QWVUBTW3.cjs} +9 -9
- package/dist/{chunk-MVXHTAJ4.cjs.map → chunk-QWVUBTW3.cjs.map} +1 -1
- package/dist/{chunk-OHWHYVKG.cjs → chunk-T73BHNQX.cjs} +3 -3
- package/dist/{chunk-OHWHYVKG.cjs.map → chunk-T73BHNQX.cjs.map} +1 -1
- package/dist/{chunk-PWBRE7JA.cjs → chunk-VLQCLQAS.cjs} +23 -10
- package/dist/chunk-VLQCLQAS.cjs.map +1 -0
- package/dist/{chunk-ADPRIBSH.cjs → chunk-X7ALF4MP.cjs} +7 -7
- package/dist/{chunk-ADPRIBSH.cjs.map → chunk-X7ALF4MP.cjs.map} +1 -1
- package/dist/{chunk-7RJZIPLE.cjs → chunk-YP5EBGLU.cjs} +33 -33
- package/dist/{chunk-7RJZIPLE.cjs.map → chunk-YP5EBGLU.cjs.map} +1 -1
- package/dist/{chunk-TSFNLY3K.cjs → chunk-ZCU72Q76.cjs} +192 -166
- package/dist/chunk-ZCU72Q76.cjs.map +1 -0
- package/dist/{chunk-BLIO3B7Z.cjs → chunk-ZYGAXD3N.cjs} +3 -3
- package/dist/{chunk-BLIO3B7Z.cjs.map → chunk-ZYGAXD3N.cjs.map} +1 -1
- package/dist/connect/docx.cjs +16 -16
- package/dist/connect/index.cjs +1095 -1114
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +26 -27
- package/dist/connection/ai.d.ts +1 -0
- package/dist/connection/docx/ConnectedNativeDocxEditor.js +4 -5
- package/dist/connection/docx/ConnectedNativeDocxEditor.js.map +2 -2
- package/dist/connection/docx/save-native-version.d.ts +3 -0
- package/dist/connection/docx/save-native-version.js +19 -0
- package/dist/connection/docx/save-native-version.js.map +7 -0
- package/dist/connection/presentation/ClippingPdfViewer.js +8 -5
- package/dist/connection/presentation/ClippingPdfViewer.js.map +2 -2
- package/dist/connection/presentation/ConnectedSlidesTab.js +8 -13
- package/dist/connection/presentation/ConnectedSlidesTab.js.map +2 -2
- package/dist/connection/presentation/usePresentationController.js +24 -15
- package/dist/connection/presentation/usePresentationController.js.map +2 -2
- package/dist/connection/presentation/usePresentationFiles.d.ts +2 -1
- package/dist/connection/presentation/usePresentationFiles.js +15 -6
- package/dist/connection/presentation/usePresentationFiles.js.map +2 -2
- package/dist/connection/remote-control/ConnectedRemoteControlConsent.js +6 -3
- package/dist/connection/remote-control/ConnectedRemoteControlConsent.js.map +2 -2
- package/dist/connection/remote-control/ConnectedRemoteControlIndicator.js +12 -2
- package/dist/connection/remote-control/ConnectedRemoteControlIndicator.js.map +2 -2
- package/dist/connection/remote-control/ConnectedRemoteControlSwitch.js +1 -1
- package/dist/connection/remote-control/ConnectedRemoteControlSwitch.js.map +1 -1
- package/dist/connection/remote-control/browser-diagnostics.d.ts +7 -0
- package/dist/connection/remote-control/browser-diagnostics.js +109 -0
- package/dist/connection/remote-control/browser-diagnostics.js.map +7 -0
- package/dist/connection/remote-control/remoteControl.d.ts +9 -1
- package/dist/connection/remote-control/remoteControl.js +130 -10
- package/dist/connection/remote-control/remoteControl.js.map +2 -2
- package/dist/connection/remote-control/screen-sharing.d.ts +11 -0
- package/dist/connection/remote-control/screen-sharing.js +78 -0
- package/dist/connection/remote-control/screen-sharing.js.map +7 -0
- package/dist/connection/report-problem/screen-capture.d.ts +1 -0
- package/dist/connection/report-problem/screen-capture.js +2 -1
- package/dist/connection/report-problem/screen-capture.js.map +2 -2
- package/dist/connection/search/ConnectedSearchPage.d.ts +0 -11
- package/dist/connection/search/ConnectedSearchPage.js +3 -0
- package/dist/connection/search/ConnectedSearchPage.js.map +2 -2
- package/dist/connection/search/SearchResultRows.js +75 -43
- package/dist/connection/search/SearchResultRows.js.map +2 -2
- package/dist/connection/viewer/CleanViewControl.d.ts +3 -1
- package/dist/connection/viewer/CleanViewControl.js +5 -1
- package/dist/connection/viewer/CleanViewControl.js.map +2 -2
- package/dist/connection/viewer/ConnectedDocumentViewer.js +1 -1
- package/dist/connection/viewer/ConnectedDocumentViewer.js.map +2 -2
- package/dist/connection/viewer/useCleanView.d.ts +1 -1
- package/dist/connection/viewer/useCleanView.js +2 -2
- package/dist/connection/viewer/useCleanView.js.map +2 -2
- package/dist/connection/viewer/useViewedDocument.d.ts +1 -0
- package/dist/document-tools/index.cjs +20 -20
- package/dist/docx/NativeDocxEditor.d.ts +2 -1
- package/dist/docx/NativeDocxEditor.js +34 -7
- package/dist/docx/NativeDocxEditor.js.map +2 -2
- package/dist/docx/index.cjs +38 -38
- package/dist/docx/useVersionAutosave.d.ts +10 -0
- package/dist/docx/useVersionAutosave.js +36 -0
- package/dist/docx/useVersionAutosave.js.map +7 -0
- package/dist/embed/index.cjs +19 -19
- package/dist/facts/index.cjs +64 -64
- package/dist/files/index.cjs +223 -223
- package/dist/index.cjs +542 -542
- package/dist/presentation/ClipCaptureOverlay.js +14 -1
- package/dist/presentation/ClipCaptureOverlay.js.map +2 -2
- package/dist/presentation/ClipImage.js +7 -4
- package/dist/presentation/ClipImage.js.map +2 -2
- package/dist/presentation/ClipTray.js +11 -7
- package/dist/presentation/ClipTray.js.map +2 -2
- package/dist/presentation/SlidesEditor.js +6 -2
- package/dist/presentation/SlidesEditor.js.map +2 -2
- package/dist/presentation/store.d.ts +2 -0
- package/dist/presentation/store.js +15 -0
- package/dist/presentation/store.js.map +3 -3
- package/dist/settings/index.cjs +146 -146
- package/dist/shell/RemoteControlPill.d.ts +2 -1
- package/dist/shell/RemoteControlPill.js +10 -3
- package/dist/shell/RemoteControlPill.js.map +2 -2
- package/dist/shell/index.cjs +21 -21
- package/dist/site/index.cjs +6 -6
- package/dist/studio/index.cjs +9 -9
- package/dist/workflow-canvas/index.cjs +34 -34
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ClippingMediaViewer-ZFEX5A3U.cjs.map +0 -1
- package/dist/ClippingPdfViewer-3LRTEPHV.cjs.map +0 -1
- package/dist/ConnectedPresentation-L32JPRFI.cjs.map +0 -1
- package/dist/ConnectedSlidesTab-P7GGNUTO.cjs.map +0 -1
- package/dist/FilesViewerDialog-MHUVEZ7M.cjs.map +0 -1
- package/dist/SpotlightStrip-ED22UYTM.cjs.map +0 -1
- package/dist/chunk-6JMW3IJ2.cjs.map +0 -1
- package/dist/chunk-GAMRVB3I.cjs.map +0 -1
- package/dist/chunk-GFUOCGY6.cjs +0 -32
- package/dist/chunk-GFUOCGY6.cjs.map +0 -1
- package/dist/chunk-IRGRMJPP.cjs +0 -18
- package/dist/chunk-JY7UUZQG.cjs.map +0 -1
- package/dist/chunk-KA3F6TIH.cjs.map +0 -1
- package/dist/chunk-OGK377NL.cjs.map +0 -1
- package/dist/chunk-ORNLCBNE.cjs.map +0 -1
- package/dist/chunk-PWBRE7JA.cjs.map +0 -1
- package/dist/chunk-TSFNLY3K.cjs.map +0 -1
- package/dist/chunk-ZZZITHGK.cjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunk7Q46YAX4_cjs = require('./chunk-7Q46YAX4.cjs');
|
|
5
5
|
var chunkWOOOMTTA_cjs = require('./chunk-WOOOMTTA.cjs');
|
|
6
|
-
var chunkWVZLAAIZ_cjs = require('./chunk-WVZLAAIZ.cjs');
|
|
7
|
-
var chunkADPRIBSH_cjs = require('./chunk-ADPRIBSH.cjs');
|
|
8
|
-
var chunkORNLCBNE_cjs = require('./chunk-ORNLCBNE.cjs');
|
|
9
6
|
var chunk2F57IO7S_cjs = require('./chunk-2F57IO7S.cjs');
|
|
10
7
|
var chunkUFT22LAB_cjs = require('./chunk-UFT22LAB.cjs');
|
|
8
|
+
var chunkWVZLAAIZ_cjs = require('./chunk-WVZLAAIZ.cjs');
|
|
9
|
+
var chunkX7ALF4MP_cjs = require('./chunk-X7ALF4MP.cjs');
|
|
10
|
+
var chunkJVEDKKNO_cjs = require('./chunk-JVEDKKNO.cjs');
|
|
11
11
|
var chunk7JLJH5CW_cjs = require('./chunk-7JLJH5CW.cjs');
|
|
12
12
|
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
13
13
|
var chunkTKHCIHE2_cjs = require('./chunk-TKHCIHE2.cjs');
|
|
@@ -30,9 +30,9 @@ function tileSize(aspect, height = TILE_HEIGHT) {
|
|
|
30
30
|
function Fitted({ clip, box: box2 }) {
|
|
31
31
|
const wide = clip.aspect > box2.width / box2.height;
|
|
32
32
|
const size = wide ? { width: box2.width, height: box2.width / clip.aspect } : { width: box2.height * clip.aspect, height: box2.height };
|
|
33
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none", style: size, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
33
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none", style: size, children: /* @__PURE__ */ jsxRuntime.jsx(chunk7Q46YAX4_cjs.ClipImage, { clip }) });
|
|
34
34
|
}
|
|
35
|
-
function Label({ clip }) {
|
|
35
|
+
function Label({ clip, number }) {
|
|
36
36
|
const [editing, setEditing] = react.useState(false);
|
|
37
37
|
if (editing) {
|
|
38
38
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -43,7 +43,7 @@ function Label({ clip }) {
|
|
|
43
43
|
"aria-label": "Clip label",
|
|
44
44
|
className: "w-full rounded border border-input bg-background px-1 text-[11px] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
45
45
|
onBlur: (event) => {
|
|
46
|
-
|
|
46
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().setCaption(clip.id, event.target.value);
|
|
47
47
|
setEditing(false);
|
|
48
48
|
},
|
|
49
49
|
onKeyDown: (event) => {
|
|
@@ -53,20 +53,24 @@ function Label({ clip }) {
|
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}
|
|
56
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
56
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
57
57
|
"button",
|
|
58
58
|
{
|
|
59
59
|
type: "button",
|
|
60
60
|
onDoubleClick: () => setEditing(true),
|
|
61
61
|
title: "Double-click to rename",
|
|
62
62
|
className: "block w-full truncate rounded px-0.5 text-left text-[11px] text-muted-foreground hover:text-foreground",
|
|
63
|
-
children:
|
|
63
|
+
children: [
|
|
64
|
+
number,
|
|
65
|
+
". ",
|
|
66
|
+
clip.caption || "Untitled"
|
|
67
|
+
]
|
|
64
68
|
}
|
|
65
69
|
);
|
|
66
70
|
}
|
|
67
|
-
function TrayTile({ clip, onSlide }) {
|
|
68
|
-
const { place, removeClip } =
|
|
69
|
-
const drag =
|
|
71
|
+
function TrayTile({ clip, onSlide, number }) {
|
|
72
|
+
const { place, removeClip } = chunkJVEDKKNO_cjs.usePresentation.getState();
|
|
73
|
+
const drag = chunk7Q46YAX4_cjs.useClipDrag(clip.id, () => !onSlide && place(clip.id));
|
|
70
74
|
const itemRef = react.useRef(null);
|
|
71
75
|
const size = tileSize(clip.aspect);
|
|
72
76
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -113,7 +117,7 @@ function TrayTile({ clip, onSlide }) {
|
|
|
113
117
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3" })
|
|
114
118
|
}
|
|
115
119
|
),
|
|
116
|
-
/* @__PURE__ */ jsxRuntime.jsx(Label, { clip }),
|
|
120
|
+
/* @__PURE__ */ jsxRuntime.jsx(Label, { clip, number }),
|
|
117
121
|
drag.ghost && reactDom.createPortal(
|
|
118
122
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
119
123
|
"div",
|
|
@@ -132,19 +136,19 @@ function TrayTile({ clip, onSlide }) {
|
|
|
132
136
|
);
|
|
133
137
|
}
|
|
134
138
|
function ClipTray({ start }) {
|
|
135
|
-
const all =
|
|
139
|
+
const all = chunkJVEDKKNO_cjs.usePresentation((s) => s.clips);
|
|
136
140
|
const clips = react.useMemo(() => all.filter((clip) => !clip.plain), [all]);
|
|
137
|
-
const slide =
|
|
141
|
+
const slide = chunkJVEDKKNO_cjs.usePresentation(chunkJVEDKKNO_cjs.currentSlide);
|
|
138
142
|
const onSlide = new Set(slide?.items.map((item) => item.clipId));
|
|
139
143
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "shrink-0 border-t border-border bg-background", "data-testid": "clip-tray-bar", children: clips.length || start ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
140
144
|
"ul",
|
|
141
145
|
{
|
|
142
|
-
className: "flex items-start gap-2 overflow-
|
|
146
|
+
className: "flex max-h-48 flex-wrap items-start gap-2 overflow-y-auto px-3 py-2 [scrollbar-width:none]",
|
|
143
147
|
"aria-label": "Clips",
|
|
144
148
|
"data-testid": "clip-tray",
|
|
145
149
|
children: [
|
|
146
150
|
start && /* @__PURE__ */ jsxRuntime.jsx("li", { className: "shrink-0", children: start }),
|
|
147
|
-
clips.map((clip) => /* @__PURE__ */ jsxRuntime.jsx(TrayTile, { clip, onSlide: onSlide.has(clip.id) }, clip.id))
|
|
151
|
+
clips.map((clip, index) => /* @__PURE__ */ jsxRuntime.jsx(TrayTile, { clip, number: index + 1, onSlide: onSlide.has(clip.id) }, clip.id))
|
|
148
152
|
]
|
|
149
153
|
}
|
|
150
154
|
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -189,7 +193,7 @@ function CustomColor({
|
|
|
189
193
|
"input",
|
|
190
194
|
{
|
|
191
195
|
type: "color",
|
|
192
|
-
value:
|
|
196
|
+
value: chunkJVEDKKNO_cjs.isHexColor(value) ? value : "#1f2937",
|
|
193
197
|
onChange: (event) => onChange(event.target.value),
|
|
194
198
|
"aria-label": label,
|
|
195
199
|
className: "absolute inset-0 cursor-pointer opacity-0"
|
|
@@ -200,10 +204,10 @@ function CustomColor({
|
|
|
200
204
|
);
|
|
201
205
|
}
|
|
202
206
|
function DesignMenu({ onChooseLogo }) {
|
|
203
|
-
const theme =
|
|
204
|
-
const setTheme =
|
|
205
|
-
const customBackground =
|
|
206
|
-
const customAccent = !
|
|
207
|
+
const theme = chunkJVEDKKNO_cjs.usePresentation((s) => s.theme);
|
|
208
|
+
const setTheme = chunkJVEDKKNO_cjs.usePresentation((s) => s.setTheme);
|
|
209
|
+
const customBackground = chunkJVEDKKNO_cjs.isHexColor(theme.background);
|
|
210
|
+
const customAccent = !chunkJVEDKKNO_cjs.ACCENTS.some((accent) => accent.color === theme.accent);
|
|
207
211
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
208
212
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
209
213
|
ui.Button,
|
|
@@ -220,7 +224,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
220
224
|
) }),
|
|
221
225
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.PopoverContent, { align: "end", className: "flex w-[21.5rem] flex-col gap-4 overflow-x-hidden p-4", children: [
|
|
222
226
|
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Background", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-7 gap-2", children: [
|
|
223
|
-
|
|
227
|
+
chunkJVEDKKNO_cjs.BACKGROUNDS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
224
228
|
"button",
|
|
225
229
|
{
|
|
226
230
|
type: "button",
|
|
@@ -232,7 +236,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
232
236
|
"size-8 rounded-md border border-border shadow-sm",
|
|
233
237
|
theme.background === preset.id && "ring-2 ring-primary ring-offset-1 ring-offset-background"
|
|
234
238
|
),
|
|
235
|
-
style: { background:
|
|
239
|
+
style: { background: chunkJVEDKKNO_cjs.backgroundCss(preset.id), containerType: "inline-size" },
|
|
236
240
|
"data-testid": `design-background-${preset.id}`
|
|
237
241
|
},
|
|
238
242
|
preset.id
|
|
@@ -247,7 +251,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
247
251
|
}
|
|
248
252
|
)
|
|
249
253
|
] }) }),
|
|
250
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Typeface", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-2", children: Object.keys(
|
|
254
|
+
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Typeface", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-2", children: Object.keys(chunkJVEDKKNO_cjs.FONTS).map((font) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
251
255
|
"button",
|
|
252
256
|
{
|
|
253
257
|
type: "button",
|
|
@@ -259,14 +263,14 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
259
263
|
),
|
|
260
264
|
"data-testid": `design-font-${font}`,
|
|
261
265
|
children: [
|
|
262
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl leading-tight", style: { fontFamily:
|
|
263
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-muted-foreground", children:
|
|
266
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl leading-tight", style: { fontFamily: chunkJVEDKKNO_cjs.FONTS[font].css }, children: "Aa" }),
|
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-muted-foreground", children: chunkJVEDKKNO_cjs.FONTS[font].label })
|
|
264
268
|
]
|
|
265
269
|
},
|
|
266
270
|
font
|
|
267
271
|
)) }) }),
|
|
268
272
|
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Accent", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
269
|
-
|
|
273
|
+
chunkJVEDKKNO_cjs.ACCENTS.map((accent) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
270
274
|
"button",
|
|
271
275
|
{
|
|
272
276
|
type: "button",
|
|
@@ -278,7 +282,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
278
282
|
"flex size-8 items-center justify-center rounded-full border border-black/10 shadow-sm",
|
|
279
283
|
theme.accent === accent.color && "ring-2 ring-primary ring-offset-1 ring-offset-background"
|
|
280
284
|
),
|
|
281
|
-
style: { background:
|
|
285
|
+
style: { background: chunkJVEDKKNO_cjs.accentColor(accent.color) },
|
|
282
286
|
children: theme.accent === accent.color && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 text-black/70" })
|
|
283
287
|
},
|
|
284
288
|
accent.color
|
|
@@ -286,7 +290,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
286
290
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
287
291
|
CustomColor,
|
|
288
292
|
{
|
|
289
|
-
value:
|
|
293
|
+
value: chunkJVEDKKNO_cjs.accentColor(theme.accent),
|
|
290
294
|
selected: customAccent,
|
|
291
295
|
label: "Your own accent colour",
|
|
292
296
|
round: true,
|
|
@@ -349,13 +353,13 @@ var at = (box2) => ({
|
|
|
349
353
|
height: `${box2.h * 100}%`
|
|
350
354
|
});
|
|
351
355
|
function LayoutThumb({ layout, className }) {
|
|
352
|
-
const geometry =
|
|
356
|
+
const geometry = chunkJVEDKKNO_cjs.slideGeometry({ layout, caption: "Title" }, { labels: false, logo: null });
|
|
353
357
|
const { top, right = 0, bottom = 0, columns } = geometry.reserve;
|
|
354
358
|
const room = {
|
|
355
|
-
x:
|
|
356
|
-
y:
|
|
357
|
-
w: 1 - 2 *
|
|
358
|
-
h: 1 - 2 *
|
|
359
|
+
x: chunkJVEDKKNO_cjs.STAGE_MARGIN,
|
|
360
|
+
y: chunkJVEDKKNO_cjs.STAGE_MARGIN + top,
|
|
361
|
+
w: 1 - 2 * chunkJVEDKKNO_cjs.STAGE_MARGIN - right,
|
|
362
|
+
h: 1 - 2 * chunkJVEDKKNO_cjs.STAGE_MARGIN - top - bottom
|
|
359
363
|
};
|
|
360
364
|
const blocks = layout === "title" || layout === "section" || layout === "free" ? [] : columns === 2 ? [
|
|
361
365
|
{ ...room, w: room.w / 2 - 0.02 },
|
|
@@ -406,10 +410,10 @@ function LayoutMenu({
|
|
|
406
410
|
className,
|
|
407
411
|
compact = false
|
|
408
412
|
}) {
|
|
409
|
-
const layout =
|
|
410
|
-
(s) => (index === void 0 ?
|
|
413
|
+
const layout = chunkJVEDKKNO_cjs.usePresentation(
|
|
414
|
+
(s) => (index === void 0 ? chunkJVEDKKNO_cjs.currentSlide(s) : s.slides[index])?.layout ?? "clips"
|
|
411
415
|
);
|
|
412
|
-
const setSlideLayout =
|
|
416
|
+
const setSlideLayout = chunkJVEDKKNO_cjs.usePresentation((s) => s.setSlideLayout);
|
|
413
417
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
|
|
414
418
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
415
419
|
ui.Button,
|
|
@@ -422,7 +426,7 @@ function LayoutMenu({
|
|
|
422
426
|
className
|
|
423
427
|
),
|
|
424
428
|
title: "Slide layout",
|
|
425
|
-
"aria-label": `Slide layout: ${
|
|
429
|
+
"aria-label": `Slide layout: ${chunkJVEDKKNO_cjs.LAYOUT_INFO[layout].label}`,
|
|
426
430
|
"data-testid": "presentation-layout",
|
|
427
431
|
children: [
|
|
428
432
|
/* @__PURE__ */ jsxRuntime.jsx(LayoutThumb, { layout, className: compact ? "w-6" : "w-7" }),
|
|
@@ -430,7 +434,7 @@ function LayoutMenu({
|
|
|
430
434
|
]
|
|
431
435
|
}
|
|
432
436
|
) }),
|
|
433
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "start", className: "w-56", children:
|
|
437
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "start", className: "w-56", children: chunkJVEDKKNO_cjs.SLIDE_LAYOUTS.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
434
438
|
ui.DropdownMenuItem,
|
|
435
439
|
{
|
|
436
440
|
onSelect: () => setSlideLayout(option, index),
|
|
@@ -438,7 +442,7 @@ function LayoutMenu({
|
|
|
438
442
|
"data-testid": `presentation-layout-${option}`,
|
|
439
443
|
children: [
|
|
440
444
|
/* @__PURE__ */ jsxRuntime.jsx(LayoutThumb, { layout: option, className: "w-12" }),
|
|
441
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
445
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: chunkJVEDKKNO_cjs.LAYOUT_INFO[option].label })
|
|
442
446
|
]
|
|
443
447
|
},
|
|
444
448
|
option
|
|
@@ -446,11 +450,11 @@ function LayoutMenu({
|
|
|
446
450
|
] });
|
|
447
451
|
}
|
|
448
452
|
function Notice() {
|
|
449
|
-
const notice =
|
|
453
|
+
const notice = chunkJVEDKKNO_cjs.usePresentation((s) => s.notice);
|
|
450
454
|
react.useEffect(() => {
|
|
451
455
|
if (!notice) return;
|
|
452
456
|
const timer = setTimeout(
|
|
453
|
-
() =>
|
|
457
|
+
() => chunkJVEDKKNO_cjs.usePresentation.getState().clearNotice(notice.id),
|
|
454
458
|
notice.kind === "error" ? 8e3 : 3e3
|
|
455
459
|
);
|
|
456
460
|
return () => clearTimeout(timer);
|
|
@@ -471,7 +475,7 @@ function Notice() {
|
|
|
471
475
|
type: "button",
|
|
472
476
|
className: "ml-1 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
473
477
|
"aria-label": "Dismiss",
|
|
474
|
-
onClick: () =>
|
|
478
|
+
onClick: () => chunkJVEDKKNO_cjs.usePresentation.getState().clearNotice(notice.id),
|
|
475
479
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5" })
|
|
476
480
|
}
|
|
477
481
|
)
|
|
@@ -488,25 +492,28 @@ var SlideCard = react.memo(function SlideCard2({
|
|
|
488
492
|
onEditImage,
|
|
489
493
|
onCropImage
|
|
490
494
|
}) {
|
|
491
|
-
const empty =
|
|
495
|
+
const empty = chunkJVEDKKNO_cjs.usePresentation((s) => {
|
|
492
496
|
const slide = s.slides[index];
|
|
493
497
|
return !!slide && !slide.items.length && !slide.boxes.length && !slide.points.trim() && slide.layout !== "title" && slide.layout !== "section";
|
|
494
498
|
});
|
|
495
|
-
const notes =
|
|
499
|
+
const notes = chunkJVEDKKNO_cjs.usePresentation((s) => s.slides[index]?.notes ?? "");
|
|
496
500
|
const textEditing = react.useMemo(
|
|
497
501
|
() => ({
|
|
498
|
-
onTitle: (title) =>
|
|
499
|
-
onPoints: (points) =>
|
|
502
|
+
onTitle: (title) => chunkJVEDKKNO_cjs.usePresentation.getState().setSlideCaption(title, index),
|
|
503
|
+
onPoints: (points) => chunkJVEDKKNO_cjs.usePresentation.getState().setSlidePoints(points, index)
|
|
500
504
|
}),
|
|
501
505
|
[index]
|
|
502
506
|
);
|
|
503
507
|
const select = react.useCallback((clipId) => onSelect(index, clipId), [onSelect, index]);
|
|
504
|
-
const actions =
|
|
508
|
+
const actions = chunkJVEDKKNO_cjs.usePresentation.getState();
|
|
505
509
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group relative flex gap-2", "data-testid": `slide-${index}`, children: [
|
|
506
510
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-9 shrink-0 flex-col items-center gap-0.5", children: [
|
|
507
511
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
508
|
-
"
|
|
512
|
+
"button",
|
|
509
513
|
{
|
|
514
|
+
type: "button",
|
|
515
|
+
"aria-label": `Show slide ${index + 1}`,
|
|
516
|
+
onClick: () => chunkJVEDKKNO_cjs.usePresentation.getState().goTo(index),
|
|
510
517
|
className: ui.cn(
|
|
511
518
|
"py-1 text-xs tabular-nums",
|
|
512
519
|
current2 ? "font-semibold text-foreground" : "text-muted-foreground"
|
|
@@ -593,7 +600,7 @@ var SlideCard = react.memo(function SlideCard2({
|
|
|
593
600
|
),
|
|
594
601
|
children: [
|
|
595
602
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
596
|
-
|
|
603
|
+
chunk7Q46YAX4_cjs.PresentationStage,
|
|
597
604
|
{
|
|
598
605
|
editable: true,
|
|
599
606
|
slideIndex: index,
|
|
@@ -611,7 +618,7 @@ var SlideCard = react.memo(function SlideCard2({
|
|
|
611
618
|
value: notes,
|
|
612
619
|
rows: notes.split("\n").length,
|
|
613
620
|
placeholder: "Speaker notes",
|
|
614
|
-
onChange: (event) =>
|
|
621
|
+
onChange: (event) => chunkJVEDKKNO_cjs.usePresentation.getState().setSlideNotes(event.target.value, index),
|
|
615
622
|
className: "mt-2 block w-full resize-none rounded-sm border-0 bg-transparent px-1 py-0.5 text-xs text-muted-foreground placeholder:text-muted-foreground/50 focus:bg-background focus:text-foreground focus:outline-none focus:ring-1 focus:ring-ring",
|
|
616
623
|
"aria-label": `Speaker notes for slide ${index + 1}`,
|
|
617
624
|
"data-testid": `slide-notes-${index}`
|
|
@@ -635,10 +642,10 @@ var INSERTS = [
|
|
|
635
642
|
];
|
|
636
643
|
function InsertMenu({ onInserted }) {
|
|
637
644
|
const insert = (shape) => {
|
|
638
|
-
const state =
|
|
645
|
+
const state = chunkJVEDKKNO_cjs.usePresentation.getState();
|
|
639
646
|
const slide = state.slides[state.current];
|
|
640
|
-
const box2 =
|
|
641
|
-
const dark =
|
|
647
|
+
const box2 = chunkJVEDKKNO_cjs.newBox(shape, chunkJVEDKKNO_cjs.accentColor(state.theme.accent));
|
|
648
|
+
const dark = chunkJVEDKKNO_cjs.isLightBackground(slide?.background);
|
|
642
649
|
const { id, ...rest } = dark ? {
|
|
643
650
|
...box2,
|
|
644
651
|
paragraphs: box2.paragraphs.map((p) => ({
|
|
@@ -681,7 +688,7 @@ function InsertSlide({ after, always }) {
|
|
|
681
688
|
"button",
|
|
682
689
|
{
|
|
683
690
|
type: "button",
|
|
684
|
-
onClick: () =>
|
|
691
|
+
onClick: () => chunkJVEDKKNO_cjs.usePresentation.getState().addSlide(void 0, after),
|
|
685
692
|
className: ui.cn(
|
|
686
693
|
"flex items-center gap-1 rounded-full border border-dashed border-border bg-background px-2.5 py-0.5 text-xs text-muted-foreground transition-opacity hover:border-solid hover:text-foreground focus-visible:opacity-100",
|
|
687
694
|
!always && "opacity-0 group-hover/insert:opacity-100 pointer-coarse:opacity-100"
|
|
@@ -704,11 +711,11 @@ function SlidesEditor({
|
|
|
704
711
|
onEditImage,
|
|
705
712
|
onCropImage
|
|
706
713
|
}) {
|
|
707
|
-
const ids =
|
|
714
|
+
const ids = chunkJVEDKKNO_cjs.usePresentation((s) => s.slides.map((slide) => slide.id).join(" "));
|
|
708
715
|
const slideIds = react.useMemo(() => ids.split(" "), [ids]);
|
|
709
|
-
const current2 =
|
|
710
|
-
const captions =
|
|
711
|
-
const presenting =
|
|
716
|
+
const current2 = chunkJVEDKKNO_cjs.usePresentation((s) => s.current);
|
|
717
|
+
const captions = chunkJVEDKKNO_cjs.usePresentation((s) => s.captions);
|
|
718
|
+
const presenting = chunkJVEDKKNO_cjs.usePresentation((s) => s.presenting);
|
|
712
719
|
const [selection, setSelection] = react.useState(null);
|
|
713
720
|
const [view, setView] = react.useState(null);
|
|
714
721
|
const list = react.useRef(null);
|
|
@@ -716,13 +723,14 @@ function SlidesEditor({
|
|
|
716
723
|
if (node) setView(node.ownerDocument.defaultView);
|
|
717
724
|
}, []);
|
|
718
725
|
const onSelect = react.useCallback((index, clipId) => {
|
|
726
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().goTo(index);
|
|
719
727
|
setSelection(clipId ? { index, clipId } : null);
|
|
720
728
|
}, []);
|
|
721
729
|
const keySelection = react.useMemo(
|
|
722
730
|
() => ({ clipId: selection?.clipId ?? null, clear: () => setSelection(null) }),
|
|
723
731
|
[selection]
|
|
724
732
|
);
|
|
725
|
-
|
|
733
|
+
chunkX7ALF4MP_cjs.usePresenterKeys(view, presenting, keySelection);
|
|
726
734
|
react.useEffect(() => {
|
|
727
735
|
const card = list.current?.querySelector(`[data-testid="slide-${current2}"]`);
|
|
728
736
|
card?.scrollIntoView?.({ block: "nearest", behavior: "smooth" });
|
|
@@ -778,7 +786,7 @@ function SlidesEditor({
|
|
|
778
786
|
ui.DropdownMenuCheckboxItem,
|
|
779
787
|
{
|
|
780
788
|
checked: captions,
|
|
781
|
-
onCheckedChange: (on) =>
|
|
789
|
+
onCheckedChange: (on) => chunkJVEDKKNO_cjs.usePresentation.getState().setCaptions(!!on),
|
|
782
790
|
children: "Show source labels"
|
|
783
791
|
}
|
|
784
792
|
)
|
|
@@ -791,7 +799,7 @@ function SlidesEditor({
|
|
|
791
799
|
size: "sm",
|
|
792
800
|
variant: "destructive",
|
|
793
801
|
className: "ml-0.5 h-8 rounded-full",
|
|
794
|
-
onClick: () =>
|
|
802
|
+
onClick: () => chunkJVEDKKNO_cjs.usePresentation.getState().setPresenting(false),
|
|
795
803
|
title: "Stop presenting (the presentation window closes)",
|
|
796
804
|
"data-testid": "presentation-stop-button",
|
|
797
805
|
children: [
|
|
@@ -830,7 +838,7 @@ function SlidesEditor({
|
|
|
830
838
|
// src/presentation/draw-boxes.ts
|
|
831
839
|
var LINE_HEIGHT = 1.2;
|
|
832
840
|
function fontOf(run, themeFont, width) {
|
|
833
|
-
const size =
|
|
841
|
+
const size = chunkJVEDKKNO_cjs.pointsToStage(run.size ?? chunkJVEDKKNO_cjs.DEFAULT_TEXT_SIZE) * width;
|
|
834
842
|
const family = run.font ? `"${run.font}", ${themeFont}` : themeFont;
|
|
835
843
|
return `${run.italic ? "italic " : ""}${run.bold ? 700 : 400} ${size}px ${family}`;
|
|
836
844
|
}
|
|
@@ -848,9 +856,9 @@ function drawBox(context, box2, width, height, themeFont) {
|
|
|
848
856
|
context.translate(frame.x * width + w / 2, frame.y * height + h / 2);
|
|
849
857
|
if (box2.rotation) context.rotate(box2.rotation * Math.PI / 180);
|
|
850
858
|
context.translate(-w / 2, -h / 2);
|
|
851
|
-
const lineWidth = box2.line ? Math.max(1,
|
|
859
|
+
const lineWidth = box2.line ? Math.max(1, chunkJVEDKKNO_cjs.pointsToStage(box2.line.width) * width) : 0;
|
|
852
860
|
if (box2.shape === "line") {
|
|
853
|
-
context.strokeStyle = box2.line?.color ??
|
|
861
|
+
context.strokeStyle = box2.line?.color ?? chunkJVEDKKNO_cjs.TEXT_COLORS.body;
|
|
854
862
|
context.lineWidth = lineWidth || 1;
|
|
855
863
|
if (box2.line?.dash) context.setLineDash([lineWidth * 3, lineWidth * 2]);
|
|
856
864
|
context.beginPath();
|
|
@@ -875,12 +883,12 @@ function drawBox(context, box2, width, height, themeFont) {
|
|
|
875
883
|
context.stroke();
|
|
876
884
|
context.setLineDash([]);
|
|
877
885
|
}
|
|
878
|
-
const inset =
|
|
886
|
+
const inset = chunkJVEDKKNO_cjs.pointsToStage(box2.inset ?? chunkJVEDKKNO_cjs.DEFAULT_INSET) * width;
|
|
879
887
|
const room = w - 2 * inset;
|
|
880
888
|
context.textBaseline = "alphabetic";
|
|
881
889
|
const lines = [];
|
|
882
890
|
for (const paragraph of box2.paragraphs) {
|
|
883
|
-
const size =
|
|
891
|
+
const size = chunkJVEDKKNO_cjs.pointsToStage(paragraph.runs[0]?.size ?? chunkJVEDKKNO_cjs.DEFAULT_TEXT_SIZE) * width;
|
|
884
892
|
const indent = (paragraph.level ?? 0) * 0.5 * size + (paragraph.bullet ? size * 0.9 : 0);
|
|
885
893
|
const words = [];
|
|
886
894
|
for (const run of paragraph.runs) {
|
|
@@ -926,12 +934,12 @@ function drawBox(context, box2, width, height, themeFont) {
|
|
|
926
934
|
const baseline = y + line.size * (LINE_HEIGHT - 0.2);
|
|
927
935
|
if (line.bullet) {
|
|
928
936
|
context.font = fontOf(line.bullet, themeFont, width);
|
|
929
|
-
context.fillStyle = line.bullet.color ??
|
|
937
|
+
context.fillStyle = line.bullet.color ?? chunkJVEDKKNO_cjs.TEXT_COLORS.body;
|
|
930
938
|
context.fillText("\u2022", inset + line.indent - line.size * 0.9, baseline);
|
|
931
939
|
}
|
|
932
940
|
for (const piece of line.pieces) {
|
|
933
941
|
context.font = fontOf(piece.run, themeFont, width);
|
|
934
|
-
context.fillStyle = piece.run.color ??
|
|
942
|
+
context.fillStyle = piece.run.color ?? chunkJVEDKKNO_cjs.TEXT_COLORS.body;
|
|
935
943
|
context.fillText(piece.text, x, baseline);
|
|
936
944
|
if (piece.run.underline) {
|
|
937
945
|
context.fillRect(x, baseline + line.size * 0.08, piece.width, Math.max(1, line.size * 0.05));
|
|
@@ -948,7 +956,7 @@ var boxWords = (box2) => box2.paragraphs.map(
|
|
|
948
956
|
).filter(Boolean);
|
|
949
957
|
|
|
950
958
|
// src/presentation/render-slides.ts
|
|
951
|
-
var SLIDE_PIXELS = { width: 1920, height: Math.round(1920 /
|
|
959
|
+
var SLIDE_PIXELS = { width: 1920, height: Math.round(1920 / chunkJVEDKKNO_cjs.STAGE_ASPECT) };
|
|
952
960
|
async function videoFrame(source, seconds) {
|
|
953
961
|
const video = document.createElement("video");
|
|
954
962
|
video.muted = true;
|
|
@@ -1060,7 +1068,7 @@ async function drawRoundedClip(context, clip, box2, stageWidth, shadow = true) {
|
|
|
1060
1068
|
outline2();
|
|
1061
1069
|
context.clip();
|
|
1062
1070
|
await drawClip(context, clip, box2);
|
|
1063
|
-
if (clip.kind === "pdf")
|
|
1071
|
+
if (clip.kind === "pdf") chunkJVEDKKNO_cjs.paintClipEdge(context, box2, stageWidth);
|
|
1064
1072
|
context.restore();
|
|
1065
1073
|
context.save();
|
|
1066
1074
|
context.strokeStyle = "rgba(255,255,255,0.15)";
|
|
@@ -1092,7 +1100,7 @@ function wrapLines(context, text, width, max) {
|
|
|
1092
1100
|
function drawText(context, box2, lines, theme, width, height) {
|
|
1093
1101
|
const size = box2.size * width;
|
|
1094
1102
|
const lineHeight = size * box2.leading;
|
|
1095
|
-
context.font = `${box2.weight} ${size}px ${
|
|
1103
|
+
context.font = `${box2.weight} ${size}px ${chunkJVEDKKNO_cjs.FONTS[theme.font].css}`;
|
|
1096
1104
|
context.textBaseline = "top";
|
|
1097
1105
|
const indent = box2.bullets ? size * 1.22 : 0;
|
|
1098
1106
|
const left = box2.x * width;
|
|
@@ -1114,10 +1122,10 @@ function drawText(context, box2, lines, theme, width, height) {
|
|
|
1114
1122
|
for (const wrapped of paragraphs) {
|
|
1115
1123
|
if (box2.bullets) {
|
|
1116
1124
|
const square = size * 0.42;
|
|
1117
|
-
context.fillStyle =
|
|
1125
|
+
context.fillStyle = chunkJVEDKKNO_cjs.accentColor(theme.accent);
|
|
1118
1126
|
context.fillRect(left, y + size * 0.5 - square / 2, square, square);
|
|
1119
1127
|
}
|
|
1120
|
-
context.fillStyle =
|
|
1128
|
+
context.fillStyle = chunkJVEDKKNO_cjs.TEXT_COLORS[box2.tone];
|
|
1121
1129
|
context.textAlign = box2.align === "center" ? "center" : "left";
|
|
1122
1130
|
for (const line of wrapped) {
|
|
1123
1131
|
const x = box2.align === "center" ? left + box2.w * width / 2 : left + indent;
|
|
@@ -1153,11 +1161,11 @@ async function loadImage(file) {
|
|
|
1153
1161
|
}
|
|
1154
1162
|
}
|
|
1155
1163
|
function slideWords(slide) {
|
|
1156
|
-
const own = slide.layout === "free" ? [] : [slide.caption.trim(), ...
|
|
1164
|
+
const own = slide.layout === "free" ? [] : [slide.caption.trim(), ...chunkJVEDKKNO_cjs.textLines(slide.points)];
|
|
1157
1165
|
return [...own, ...slide.boxes.flatMap(boxWords)].filter(Boolean);
|
|
1158
1166
|
}
|
|
1159
1167
|
function drawSlideText(context, slide, look, width, height) {
|
|
1160
|
-
const geometry =
|
|
1168
|
+
const geometry = chunkJVEDKKNO_cjs.slideGeometry(slide, {
|
|
1161
1169
|
labels: look.labels,
|
|
1162
1170
|
logo: look.theme.logo?.corner ?? null
|
|
1163
1171
|
});
|
|
@@ -1165,13 +1173,13 @@ function drawSlideText(context, slide, look, width, height) {
|
|
|
1165
1173
|
if (title && geometry.title) {
|
|
1166
1174
|
drawText(context, geometry.title, [title], look.theme, width, height);
|
|
1167
1175
|
if (geometry.rule) {
|
|
1168
|
-
context.fillStyle =
|
|
1176
|
+
context.fillStyle = chunkJVEDKKNO_cjs.accentColor(look.theme.accent);
|
|
1169
1177
|
const r = geometry.rule;
|
|
1170
1178
|
context.fillRect(r.x * width, r.y * height, r.w * width, r.h * height);
|
|
1171
1179
|
}
|
|
1172
1180
|
}
|
|
1173
1181
|
if (geometry.text) {
|
|
1174
|
-
drawText(context, geometry.text,
|
|
1182
|
+
drawText(context, geometry.text, chunkJVEDKKNO_cjs.textLines(slide.points), look.theme, width, height);
|
|
1175
1183
|
}
|
|
1176
1184
|
return geometry;
|
|
1177
1185
|
}
|
|
@@ -1183,13 +1191,13 @@ async function renderSlide(slide, clips, look) {
|
|
|
1183
1191
|
const context = canvas.getContext("2d");
|
|
1184
1192
|
if (!context) throw new Error("Could not draw the slides");
|
|
1185
1193
|
if (slide.background) {
|
|
1186
|
-
await
|
|
1194
|
+
await chunkJVEDKKNO_cjs.paintSlideBackground(context, width, height, slide.background, look.media);
|
|
1187
1195
|
} else {
|
|
1188
|
-
|
|
1196
|
+
chunkJVEDKKNO_cjs.paintBackground(context, width, height, look.theme.background);
|
|
1189
1197
|
}
|
|
1190
1198
|
const geometry = drawSlideText(context, slide, look, width, height);
|
|
1191
1199
|
const text = slideWords(slide);
|
|
1192
|
-
const font =
|
|
1200
|
+
const font = chunkJVEDKKNO_cjs.FONTS[look.theme.font].css;
|
|
1193
1201
|
const drawBoxes = (front) => {
|
|
1194
1202
|
for (const box2 of slide.boxes) {
|
|
1195
1203
|
if (!!box2.front === front) drawBox(context, box2, width, height, font);
|
|
@@ -1203,16 +1211,16 @@ async function renderSlide(slide, clips, look) {
|
|
|
1203
1211
|
x: item.frame.x * width,
|
|
1204
1212
|
y: item.frame.y * height,
|
|
1205
1213
|
width: item.frame.w * width,
|
|
1206
|
-
height:
|
|
1214
|
+
height: chunkJVEDKKNO_cjs.frameHeight(item.frame, clip.aspect) * height
|
|
1207
1215
|
};
|
|
1208
1216
|
if (clip.plain) {
|
|
1209
1217
|
await drawClip(context, clip, box2);
|
|
1210
1218
|
continue;
|
|
1211
1219
|
}
|
|
1212
1220
|
await drawRoundedClip(context, clip, box2, width);
|
|
1213
|
-
const label =
|
|
1221
|
+
const label = chunkJVEDKKNO_cjs.clipLabel(clip, look.columnValues);
|
|
1214
1222
|
if (look.labels && label) {
|
|
1215
|
-
context.fillStyle =
|
|
1223
|
+
context.fillStyle = chunkJVEDKKNO_cjs.TEXT_COLORS.muted;
|
|
1216
1224
|
context.font = `${Math.round(width * 0.017)}px ${font}`;
|
|
1217
1225
|
context.textAlign = "left";
|
|
1218
1226
|
context.textBaseline = "top";
|
|
@@ -1255,7 +1263,7 @@ function addBox(pptx, page, box2, themeFont) {
|
|
|
1255
1263
|
if (box2.shape === "line") {
|
|
1256
1264
|
page.addShape(pptx.ShapeType.line, {
|
|
1257
1265
|
...place,
|
|
1258
|
-
line: line ?? { color: hex(
|
|
1266
|
+
line: line ?? { color: hex(chunkJVEDKKNO_cjs.TEXT_COLORS.body), width: 1 }
|
|
1259
1267
|
});
|
|
1260
1268
|
return;
|
|
1261
1269
|
}
|
|
@@ -1272,9 +1280,9 @@ function addBox(pptx, page, box2, themeFont) {
|
|
|
1272
1280
|
runs.push({
|
|
1273
1281
|
text: run.text,
|
|
1274
1282
|
options: {
|
|
1275
|
-
fontSize: run.size ??
|
|
1283
|
+
fontSize: run.size ?? chunkJVEDKKNO_cjs.DEFAULT_TEXT_SIZE,
|
|
1276
1284
|
fontFace: run.font ?? themeFont,
|
|
1277
|
-
color: hex(run.color ??
|
|
1285
|
+
color: hex(run.color ?? chunkJVEDKKNO_cjs.TEXT_COLORS.body),
|
|
1278
1286
|
...run.bold ? { bold: true } : {},
|
|
1279
1287
|
...run.italic ? { italic: true } : {},
|
|
1280
1288
|
...run.underline ? { underline: { style: "sng" } } : {},
|
|
@@ -1296,7 +1304,7 @@ function addBox(pptx, page, box2, themeFont) {
|
|
|
1296
1304
|
// Its part in the slide (its title, its body), kept by name: read back when imported.
|
|
1297
1305
|
...box2.role ? { objectName: `ARBI ${box2.role}` } : {},
|
|
1298
1306
|
valign: box2.anchor ?? "top",
|
|
1299
|
-
margin: box2.inset ??
|
|
1307
|
+
margin: box2.inset ?? chunkJVEDKKNO_cjs.DEFAULT_INSET,
|
|
1300
1308
|
lineSpacingMultiple: 1,
|
|
1301
1309
|
fit: "none"
|
|
1302
1310
|
});
|
|
@@ -1326,10 +1334,10 @@ var box = (b) => ({
|
|
|
1326
1334
|
function textOptions(text, look) {
|
|
1327
1335
|
return {
|
|
1328
1336
|
...box(text),
|
|
1329
|
-
fontFace:
|
|
1337
|
+
fontFace: chunkJVEDKKNO_cjs.FONTS[look.theme.font].pptx,
|
|
1330
1338
|
fontSize: toPoints(text.size),
|
|
1331
1339
|
bold: text.weight >= 600,
|
|
1332
|
-
color: hex2(
|
|
1340
|
+
color: hex2(chunkJVEDKKNO_cjs.TEXT_COLORS[text.tone]),
|
|
1333
1341
|
align: text.align,
|
|
1334
1342
|
valign: text.anchor ?? "top",
|
|
1335
1343
|
lineSpacingMultiple: text.leading,
|
|
@@ -1342,18 +1350,18 @@ async function buildPptx(deck, look) {
|
|
|
1342
1350
|
pptx.layout = "LAYOUT_WIDE";
|
|
1343
1351
|
pptx.title = deck.title;
|
|
1344
1352
|
pptx.theme = {
|
|
1345
|
-
headFontFace:
|
|
1346
|
-
bodyFontFace:
|
|
1353
|
+
headFontFace: chunkJVEDKKNO_cjs.FONTS[look.theme.font].pptx,
|
|
1354
|
+
bodyFontFace: chunkJVEDKKNO_cjs.FONTS[look.theme.font].pptx
|
|
1347
1355
|
};
|
|
1348
1356
|
const { width, height } = SLIDE_PIXELS;
|
|
1349
1357
|
const background = await canvasImage(
|
|
1350
1358
|
width,
|
|
1351
1359
|
height,
|
|
1352
|
-
(context) =>
|
|
1360
|
+
(context) => chunkJVEDKKNO_cjs.paintBackground(context, width, height, look.theme.background)
|
|
1353
1361
|
);
|
|
1354
1362
|
const logo = look.logo ? await loadImage(look.logo) : null;
|
|
1355
1363
|
const logoData = logo ? await canvasImage(logo.width, logo.height, (context) => context.drawImage(logo, 0, 0)) : null;
|
|
1356
|
-
const themeFont =
|
|
1364
|
+
const themeFont = chunkJVEDKKNO_cjs.FONTS[look.theme.font].pptx;
|
|
1357
1365
|
for (const slide of deck.slides) {
|
|
1358
1366
|
const page = pptx.addSlide();
|
|
1359
1367
|
if (slide.background?.color && !slide.background.gradient && !slide.background.image) {
|
|
@@ -1364,14 +1372,14 @@ async function buildPptx(deck, look) {
|
|
|
1364
1372
|
data: await canvasImage(
|
|
1365
1373
|
width,
|
|
1366
1374
|
height,
|
|
1367
|
-
(context) =>
|
|
1375
|
+
(context) => chunkJVEDKKNO_cjs.paintSlideBackground(context, width, height, own, look.media)
|
|
1368
1376
|
)
|
|
1369
1377
|
};
|
|
1370
1378
|
} else {
|
|
1371
1379
|
page.background = { data: background };
|
|
1372
1380
|
}
|
|
1373
1381
|
if (slide.notes?.trim()) page.addNotes(slide.notes);
|
|
1374
|
-
const geometry =
|
|
1382
|
+
const geometry = chunkJVEDKKNO_cjs.slideGeometry(slide, {
|
|
1375
1383
|
labels: look.labels,
|
|
1376
1384
|
logo: look.theme.logo?.corner ?? null
|
|
1377
1385
|
});
|
|
@@ -1379,7 +1387,7 @@ async function buildPptx(deck, look) {
|
|
|
1379
1387
|
for (const item of slide.items) {
|
|
1380
1388
|
const clip = deck.clips.find((entry) => entry.id === item.clipId);
|
|
1381
1389
|
if (!clip) continue;
|
|
1382
|
-
const frame = { ...item.frame, h:
|
|
1390
|
+
const frame = { ...item.frame, h: chunkJVEDKKNO_cjs.frameHeight(item.frame, clip.aspect) };
|
|
1383
1391
|
if (clip.plain) {
|
|
1384
1392
|
const source = clip.kind === "image" ? await createImageBitmap(clip.source) : null;
|
|
1385
1393
|
const scale = source ? Math.min(1, 2400 / Math.max(1, clip.rect.w * source.width)) : 1.5;
|
|
@@ -1411,13 +1419,13 @@ async function buildPptx(deck, look) {
|
|
|
1411
1419
|
altText: clip.caption,
|
|
1412
1420
|
shadow: { type: "outer", blur: 10, offset: 3, angle: 90, color: "000000", opacity: 0.45 }
|
|
1413
1421
|
});
|
|
1414
|
-
const label =
|
|
1422
|
+
const label = chunkJVEDKKNO_cjs.clipLabel(clip, look.columnValues);
|
|
1415
1423
|
if (look.labels && label) {
|
|
1416
1424
|
page.addText(label, {
|
|
1417
1425
|
...box({ x: frame.x, y: frame.y + frame.h + 8e-3, w: frame.w, h: 0.045 }),
|
|
1418
|
-
fontFace:
|
|
1426
|
+
fontFace: chunkJVEDKKNO_cjs.FONTS[look.theme.font].pptx,
|
|
1419
1427
|
fontSize: toPoints(0.017),
|
|
1420
|
-
color: hex2(
|
|
1428
|
+
color: hex2(chunkJVEDKKNO_cjs.TEXT_COLORS.muted),
|
|
1421
1429
|
margin: 0,
|
|
1422
1430
|
valign: "top",
|
|
1423
1431
|
fit: "shrink"
|
|
@@ -1430,12 +1438,12 @@ async function buildPptx(deck, look) {
|
|
|
1430
1438
|
if (geometry.rule) {
|
|
1431
1439
|
page.addShape(pptx.ShapeType.rect, {
|
|
1432
1440
|
...box(geometry.rule),
|
|
1433
|
-
fill: { color: hex2(
|
|
1434
|
-
line: { color: hex2(
|
|
1441
|
+
fill: { color: hex2(chunkJVEDKKNO_cjs.accentColor(look.theme.accent)) },
|
|
1442
|
+
line: { color: hex2(chunkJVEDKKNO_cjs.accentColor(look.theme.accent)), width: 0 }
|
|
1435
1443
|
});
|
|
1436
1444
|
}
|
|
1437
1445
|
}
|
|
1438
|
-
const lines =
|
|
1446
|
+
const lines = chunkJVEDKKNO_cjs.textLines(slide.points);
|
|
1439
1447
|
if (geometry.text && lines.length) {
|
|
1440
1448
|
const text = geometry.text;
|
|
1441
1449
|
page.addText(
|
|
@@ -1469,7 +1477,7 @@ async function buildPptx(deck, look) {
|
|
|
1469
1477
|
}
|
|
1470
1478
|
}
|
|
1471
1479
|
const deckFile = await pptx.write({ outputType: "blob" });
|
|
1472
|
-
return accentBullets(deckFile,
|
|
1480
|
+
return accentBullets(deckFile, chunkJVEDKKNO_cjs.accentColor(look.theme.accent));
|
|
1473
1481
|
}
|
|
1474
1482
|
async function accentBullets(deck, accent) {
|
|
1475
1483
|
const { default: JSZip } = await import('jszip');
|
|
@@ -2000,7 +2008,7 @@ function renditionClip(deck, part, area, what) {
|
|
|
2000
2008
|
fileName: fileName ?? "Presentation.pptx",
|
|
2001
2009
|
page: part.page,
|
|
2002
2010
|
rect,
|
|
2003
|
-
aspect: frame.w *
|
|
2011
|
+
aspect: frame.w * chunkJVEDKKNO_cjs.STAGE_ASPECT / Math.max(frame.h, 1e-6),
|
|
2004
2012
|
caption: "",
|
|
2005
2013
|
plain: true
|
|
2006
2014
|
});
|
|
@@ -2139,7 +2147,7 @@ async function readShape(shape, transform, deck, part, inherit, built) {
|
|
|
2139
2147
|
fileName: target?.target.split("/").pop() ?? "Picture",
|
|
2140
2148
|
page: 1,
|
|
2141
2149
|
rect,
|
|
2142
|
-
aspect: frame.w *
|
|
2150
|
+
aspect: frame.w * chunkJVEDKKNO_cjs.STAGE_ASPECT / Math.max(frame.h, 1e-6),
|
|
2143
2151
|
caption: "",
|
|
2144
2152
|
media: key,
|
|
2145
2153
|
plain: true
|
|
@@ -2362,7 +2370,7 @@ async function importPptx(bytes, options = {}) {
|
|
|
2362
2370
|
const cx = numAttr(size, "cx", 12192e3);
|
|
2363
2371
|
const cy = numAttr(size, "cy", 6858e3);
|
|
2364
2372
|
const deckAspect = cx / cy;
|
|
2365
|
-
const place = deckAspect <
|
|
2373
|
+
const place = deckAspect < chunkJVEDKKNO_cjs.STAGE_ASPECT ? { w: deckAspect / chunkJVEDKKNO_cjs.STAGE_ASPECT, h: 1, x: (1 - deckAspect / chunkJVEDKKNO_cjs.STAGE_ASPECT) / 2, y: 0 } : { w: 1, h: chunkJVEDKKNO_cjs.STAGE_ASPECT / deckAspect, x: 0, y: (1 - chunkJVEDKKNO_cjs.STAGE_ASPECT / deckAspect) / 2 };
|
|
2366
2374
|
const slides = await slideParts(pkg);
|
|
2367
2375
|
const firstLayout = slides.length ? await pkg.related(slides[0].part, "/slideLayout") : null;
|
|
2368
2376
|
const firstMaster = firstLayout ? await pkg.related(firstLayout, "/slideMaster") : null;
|
|
@@ -2371,7 +2379,7 @@ async function importPptx(bytes, options = {}) {
|
|
|
2371
2379
|
theme: firstMaster ? await readTheme(pkg, firstMaster) : { scheme: {}, map: {}, majorFont: "Calibri", minorFont: "Calibri", lineWidths: [] },
|
|
2372
2380
|
slideSize: { cx, cy },
|
|
2373
2381
|
place,
|
|
2374
|
-
pointScale:
|
|
2382
|
+
pointScale: chunkJVEDKKNO_cjs.SLIDE_POINTS.h * place.h / (cy / EMU_PER_POINT),
|
|
2375
2383
|
defaultText: kid(pres.documentElement, "defaultTextStyle"),
|
|
2376
2384
|
options,
|
|
2377
2385
|
clips: [],
|
|
@@ -2467,7 +2475,7 @@ async function importPptx(bytes, options = {}) {
|
|
|
2467
2475
|
version: 1,
|
|
2468
2476
|
title: options.title ?? (coreTitle?.trim() || "Presentation"),
|
|
2469
2477
|
captions: false,
|
|
2470
|
-
theme:
|
|
2478
|
+
theme: chunkJVEDKKNO_cjs.DEFAULT_THEME,
|
|
2471
2479
|
clips: deck.clips,
|
|
2472
2480
|
slides: saved,
|
|
2473
2481
|
...Object.keys(deck.media).length ? { media: deck.media } : {}
|
|
@@ -2555,7 +2563,7 @@ async function presentationData(bytes) {
|
|
|
2555
2563
|
if (isZipBytes(bytes)) return readPptxPresentationData(bytes);
|
|
2556
2564
|
const isPdf = bytes[0] === 37 && bytes[1] === 80 && bytes[2] === 68 && bytes[3] === 70;
|
|
2557
2565
|
if (!isPdf) return new TextDecoder().decode(bytes);
|
|
2558
|
-
const data = await documentTools.readPdfAttachment(bytes,
|
|
2566
|
+
const data = await documentTools.readPdfAttachment(bytes, chunkJVEDKKNO_cjs.PRESENTATION_ATTACHMENT);
|
|
2559
2567
|
if (!data) {
|
|
2560
2568
|
throw new Error(
|
|
2561
2569
|
"This PDF has no editable presentation in it (it may have been changed outside ARBI)."
|
|
@@ -2564,7 +2572,7 @@ async function presentationData(bytes) {
|
|
|
2564
2572
|
return new TextDecoder().decode(data);
|
|
2565
2573
|
}
|
|
2566
2574
|
function current(withoutClips) {
|
|
2567
|
-
const state =
|
|
2575
|
+
const state = chunkJVEDKKNO_cjs.usePresentation.getState();
|
|
2568
2576
|
return withoutClips ? {
|
|
2569
2577
|
...state,
|
|
2570
2578
|
clips: [],
|
|
@@ -2586,26 +2594,31 @@ function usePresentationFiles() {
|
|
|
2586
2594
|
const state = current(withoutClips);
|
|
2587
2595
|
const deck = await buildPptx({ title, slides: state.slides, clips: state.clips }, lookOf(state));
|
|
2588
2596
|
const fingerprints = await slideFingerprints(deck);
|
|
2589
|
-
const data =
|
|
2597
|
+
const data = chunkJVEDKKNO_cjs.serializePresentation({ ...state, title, fingerprints });
|
|
2590
2598
|
return writePptxPresentationData(deck, JSON.stringify(data, null, 2));
|
|
2591
2599
|
}, []);
|
|
2592
2600
|
const save = react.useCallback(
|
|
2593
|
-
async (title, {
|
|
2601
|
+
async (title, {
|
|
2602
|
+
asNew = false,
|
|
2603
|
+
template = false,
|
|
2604
|
+
autosave = false
|
|
2605
|
+
} = {}) => {
|
|
2594
2606
|
if (!arbi || !workspaceId) throw new Error("Open a workspace to save the presentation.");
|
|
2595
|
-
const state =
|
|
2607
|
+
const state = chunkJVEDKKNO_cjs.usePresentation.getState();
|
|
2596
2608
|
const versionOf = asNew || template ? null : state.savedId;
|
|
2597
2609
|
const deck = await buildFile(title, template);
|
|
2598
|
-
const file = new File([deck],
|
|
2610
|
+
const file = new File([deck], chunkJVEDKKNO_cjs.presentationFileName(title), { type: PPTX_TYPE });
|
|
2599
2611
|
const result = await arbi.documents.upload([file], {
|
|
2600
|
-
folder: template ?
|
|
2612
|
+
folder: template ? chunkJVEDKKNO_cjs.TEMPLATES_FOLDER : chunkJVEDKKNO_cjs.PRESENTATIONS_FOLDER,
|
|
2601
2613
|
workspaceExtId: workspaceId,
|
|
2602
|
-
...versionOf ? { versionOf } : {}
|
|
2614
|
+
...versionOf ? { versionOf, autosave } : {}
|
|
2603
2615
|
});
|
|
2604
2616
|
const id = versionOf ?? result.doc_ext_ids?.[0];
|
|
2605
2617
|
if (!id) throw new Error("The presentation could not be saved.");
|
|
2606
2618
|
if (!template) {
|
|
2607
2619
|
const [doc] = await arbi.documents.get([id]).catch(() => []);
|
|
2608
|
-
state.setSaved(id, title, doc?.current_version ?? null);
|
|
2620
|
+
state.setSaved(id, title, result.version ?? doc?.current_version ?? null);
|
|
2621
|
+
chunkJVEDKKNO_cjs.usePresentation.setState({ autosave: !!versionOf && autosave });
|
|
2609
2622
|
}
|
|
2610
2623
|
return id;
|
|
2611
2624
|
},
|
|
@@ -2622,8 +2635,8 @@ function usePresentationFiles() {
|
|
|
2622
2635
|
}
|
|
2623
2636
|
const pdf = await documentTools.imagesToPdf(pages, { title });
|
|
2624
2637
|
const result = await arbi.documents.upload(
|
|
2625
|
-
[new File([pdf], `${
|
|
2626
|
-
{ folder:
|
|
2638
|
+
[new File([pdf], `${chunkJVEDKKNO_cjs.safeFileStem(title)}.pdf`, { type: "application/pdf" })],
|
|
2639
|
+
{ folder: chunkJVEDKKNO_cjs.EXPORTS_FOLDER, workspaceExtId: workspaceId }
|
|
2627
2640
|
);
|
|
2628
2641
|
const id = result.doc_ext_ids?.[0];
|
|
2629
2642
|
if (!id) throw new Error("The PDF could not be saved.");
|
|
@@ -2638,10 +2651,10 @@ function usePresentationFiles() {
|
|
|
2638
2651
|
return docs.filter((doc) => {
|
|
2639
2652
|
const folder = doc.folder ?? "";
|
|
2640
2653
|
if (!ui.isPresentationFileName(doc.file_name, folder)) return false;
|
|
2641
|
-
return scope === "templates" ? folder ===
|
|
2654
|
+
return scope === "templates" ? folder === chunkJVEDKKNO_cjs.TEMPLATES_FOLDER : folder.startsWith(chunkJVEDKKNO_cjs.PRESENTATIONS_FOLDER) && folder !== chunkJVEDKKNO_cjs.TEMPLATES_FOLDER && !folder.startsWith(chunkJVEDKKNO_cjs.EXPORTS_FOLDER);
|
|
2642
2655
|
}).map((doc) => ({
|
|
2643
2656
|
id: doc.external_id,
|
|
2644
|
-
title:
|
|
2657
|
+
title: chunkJVEDKKNO_cjs.presentationTitle(doc.file_name ?? ""),
|
|
2645
2658
|
updatedAt: doc.updated_at ?? doc.created_at ?? null
|
|
2646
2659
|
})).sort((a, b) => (a.updatedAt ?? "") < (b.updatedAt ?? "") ? 1 : -1);
|
|
2647
2660
|
},
|
|
@@ -2655,9 +2668,10 @@ function usePresentationFiles() {
|
|
|
2655
2668
|
const text = await presentationData(bytes);
|
|
2656
2669
|
const [doc] = await arbi.documents.get([id]).catch(() => []);
|
|
2657
2670
|
const openedVersion = version ?? doc?.current_version ?? null;
|
|
2671
|
+
const autosave = !!(version ? doc?.versions?.find((entry) => entry.n === version)?.autosave : doc?.autosave);
|
|
2658
2672
|
if (text === null) {
|
|
2659
2673
|
const imported = await importPptx(bytes, {
|
|
2660
|
-
title:
|
|
2674
|
+
title: chunkJVEDKKNO_cjs.presentationTitle(doc?.file_name ?? "Presentation.pptx"),
|
|
2661
2675
|
documentId: id,
|
|
2662
2676
|
version: version ?? doc?.current_version,
|
|
2663
2677
|
fileName: doc?.file_name ?? void 0
|
|
@@ -2666,10 +2680,11 @@ function usePresentationFiles() {
|
|
|
2666
2680
|
saved: imported.saved,
|
|
2667
2681
|
legacy: false,
|
|
2668
2682
|
imported: { notes: imported.notes },
|
|
2669
|
-
openedVersion
|
|
2683
|
+
openedVersion,
|
|
2684
|
+
autosave
|
|
2670
2685
|
};
|
|
2671
2686
|
}
|
|
2672
|
-
let saved =
|
|
2687
|
+
let saved = chunkJVEDKKNO_cjs.parsePresentation(text);
|
|
2673
2688
|
let changedOutside;
|
|
2674
2689
|
if (isZipBytes(bytes) && saved.slides.some((slide) => slide.fingerprint)) {
|
|
2675
2690
|
const now = await slideFingerprints(bytes);
|
|
@@ -2692,7 +2707,8 @@ function usePresentationFiles() {
|
|
|
2692
2707
|
// file, not a version of this one (a document's versions keep one format).
|
|
2693
2708
|
legacy: !isZipBytes(bytes),
|
|
2694
2709
|
changedOutside,
|
|
2695
|
-
openedVersion
|
|
2710
|
+
openedVersion,
|
|
2711
|
+
autosave
|
|
2696
2712
|
};
|
|
2697
2713
|
},
|
|
2698
2714
|
[arbi]
|
|
@@ -2700,7 +2716,7 @@ function usePresentationFiles() {
|
|
|
2700
2716
|
const startFromTemplate = react.useCallback(
|
|
2701
2717
|
async (id) => {
|
|
2702
2718
|
const { saved } = await readSaved(id);
|
|
2703
|
-
|
|
2719
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().load({
|
|
2704
2720
|
title: "Untitled presentation",
|
|
2705
2721
|
savedId: null,
|
|
2706
2722
|
captions: saved.captions,
|
|
@@ -2723,7 +2739,7 @@ function usePresentationFiles() {
|
|
|
2723
2739
|
const open = react.useCallback(
|
|
2724
2740
|
async (id, version) => {
|
|
2725
2741
|
if (!arbi) throw new Error("Sign in to open a presentation.");
|
|
2726
|
-
const { saved, legacy, imported, changedOutside, openedVersion } = await readSaved(
|
|
2742
|
+
const { saved, legacy, imported, changedOutside, openedVersion, autosave } = await readSaved(
|
|
2727
2743
|
id,
|
|
2728
2744
|
version
|
|
2729
2745
|
);
|
|
@@ -2777,10 +2793,11 @@ function usePresentationFiles() {
|
|
|
2777
2793
|
);
|
|
2778
2794
|
const kept = [];
|
|
2779
2795
|
const newIndex = opened.map((clip) => clip ? kept.push(clip) - 1 : -1);
|
|
2780
|
-
|
|
2796
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().load({
|
|
2781
2797
|
title: saved.title,
|
|
2782
2798
|
savedId: legacy ? null : id,
|
|
2783
2799
|
version: legacy ? null : openedVersion,
|
|
2800
|
+
autosave,
|
|
2784
2801
|
boundTo: id,
|
|
2785
2802
|
captions: saved.captions,
|
|
2786
2803
|
labelColumn: saved.labelColumn ?? null,
|
|
@@ -2851,7 +2868,7 @@ function useGenerateImageLaunch() {
|
|
|
2851
2868
|
throw new Error(failure || answer.trim() || "The image could not be generated.");
|
|
2852
2869
|
const source = await (await arbi.documents.download(documentId)).blob();
|
|
2853
2870
|
const fileName = `${prompt.split("\n")[0].slice(0, 60)}.png`;
|
|
2854
|
-
|
|
2871
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().addClip({
|
|
2855
2872
|
kind: "image",
|
|
2856
2873
|
documentId,
|
|
2857
2874
|
fileName,
|
|
@@ -2860,7 +2877,7 @@ function useGenerateImageLaunch() {
|
|
|
2860
2877
|
aspect: await aspectOf(source),
|
|
2861
2878
|
masks: [],
|
|
2862
2879
|
source,
|
|
2863
|
-
caption:
|
|
2880
|
+
caption: chunkJVEDKKNO_cjs.mediaCaption(fileName)
|
|
2864
2881
|
});
|
|
2865
2882
|
},
|
|
2866
2883
|
[arbi, workspaceId]
|
|
@@ -2871,7 +2888,7 @@ function GenerateImageDialog({
|
|
|
2871
2888
|
onOpenChange,
|
|
2872
2889
|
referenceId
|
|
2873
2890
|
}) {
|
|
2874
|
-
const notify =
|
|
2891
|
+
const notify = chunkJVEDKKNO_cjs.usePresentation((s) => s.notify);
|
|
2875
2892
|
const { skills } = chunkUFT22LAB_cjs.useWorkflowDefinitions();
|
|
2876
2893
|
const run = useGenerateImageLaunch();
|
|
2877
2894
|
const workflows = react.useMemo(
|
|
@@ -2931,9 +2948,9 @@ function SavePresentationDialog({
|
|
|
2931
2948
|
onOpenChange,
|
|
2932
2949
|
mode = "save"
|
|
2933
2950
|
}) {
|
|
2934
|
-
const notify =
|
|
2951
|
+
const notify = chunkJVEDKKNO_cjs.usePresentation((s) => s.notify);
|
|
2935
2952
|
const { save, exportPdf } = usePresentationFiles();
|
|
2936
|
-
const current2 =
|
|
2953
|
+
const current2 = chunkJVEDKKNO_cjs.usePresentation((s) => s.title);
|
|
2937
2954
|
const [title, setTitle] = react.useState(current2);
|
|
2938
2955
|
const [busy, setBusy] = react.useState(false);
|
|
2939
2956
|
const text = SAVE_TEXT[mode];
|
|
@@ -3003,7 +3020,7 @@ function OpenPresentationDialog({
|
|
|
3003
3020
|
templates = false
|
|
3004
3021
|
}) {
|
|
3005
3022
|
const { confirm } = chunkTKHCIHE2_cjs.useBlocksEnvironment();
|
|
3006
|
-
const notify =
|
|
3023
|
+
const notify = chunkJVEDKKNO_cjs.usePresentation((s) => s.notify);
|
|
3007
3024
|
const { list, startFromTemplate } = usePresentationFiles();
|
|
3008
3025
|
const [entries, setEntries] = react.useState(null);
|
|
3009
3026
|
const [opening, setOpening] = react.useState(null);
|
|
@@ -3018,7 +3035,7 @@ function OpenPresentationDialog({
|
|
|
3018
3035
|
onOpened(entry.id);
|
|
3019
3036
|
return;
|
|
3020
3037
|
}
|
|
3021
|
-
if (
|
|
3038
|
+
if (chunkJVEDKKNO_cjs.usePresentation.getState().clips.length) {
|
|
3022
3039
|
const ok = await confirm({
|
|
3023
3040
|
title: "New from template",
|
|
3024
3041
|
message: "Replace the presentation that is open? Save it first to keep it.",
|
|
@@ -3069,8 +3086,8 @@ function OpenPresentationDialog({
|
|
|
3069
3086
|
}
|
|
3070
3087
|
var IMAGE_FILE = /\.(png|jpe?g|gif|webp|svg)$/i;
|
|
3071
3088
|
function ChooseLogoDialog({ open, onOpenChange }) {
|
|
3072
|
-
const setTheme =
|
|
3073
|
-
const corner =
|
|
3089
|
+
const setTheme = chunkJVEDKKNO_cjs.usePresentation((s) => s.setTheme);
|
|
3090
|
+
const corner = chunkJVEDKKNO_cjs.usePresentation((s) => s.theme.logo?.corner ?? "br");
|
|
3074
3091
|
const { data: documents } = react$1.useDocuments(void 0, { enabled: open });
|
|
3075
3092
|
const [picked, setPicked] = react.useState("");
|
|
3076
3093
|
const groups = react.useMemo(
|
|
@@ -3157,7 +3174,7 @@ function CropClipDialog({ clip, onOpenChange }) {
|
|
|
3157
3174
|
w: Math.min(1, area.width / natural.width),
|
|
3158
3175
|
h: Math.min(1, area.height / natural.height)
|
|
3159
3176
|
};
|
|
3160
|
-
|
|
3177
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().cropClip(clip.id, rect, area.width / area.height);
|
|
3161
3178
|
onOpenChange(false);
|
|
3162
3179
|
};
|
|
3163
3180
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -3206,8 +3223,8 @@ function CropClipDialog({ clip, onOpenChange }) {
|
|
|
3206
3223
|
var EMPTY = new Blob();
|
|
3207
3224
|
var NONE = "none";
|
|
3208
3225
|
function LabelColumnMenu({ columns }) {
|
|
3209
|
-
const labelColumn =
|
|
3210
|
-
const setLabelColumn =
|
|
3226
|
+
const labelColumn = chunkJVEDKKNO_cjs.usePresentation((s) => s.labelColumn);
|
|
3227
|
+
const setLabelColumn = chunkJVEDKKNO_cjs.usePresentation((s) => s.setLabelColumn);
|
|
3211
3228
|
if (!columns.length) return null;
|
|
3212
3229
|
const chosen = columns.find((column) => column.id === labelColumn);
|
|
3213
3230
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuSub, { children: [
|
|
@@ -3250,8 +3267,8 @@ function useLabelColumns(active) {
|
|
|
3250
3267
|
const workspaceId = react$1.useArbiSessionState((s) => s.workspaceId);
|
|
3251
3268
|
const { data: tags } = react$1.useTags(workspaceId, { enabled: active });
|
|
3252
3269
|
const { data: documents } = react$1.useDocuments(workspaceId, { enabled: active });
|
|
3253
|
-
const labelColumn =
|
|
3254
|
-
const documentIds =
|
|
3270
|
+
const labelColumn = chunkJVEDKKNO_cjs.usePresentation((s) => s.labelColumn);
|
|
3271
|
+
const documentIds = chunkJVEDKKNO_cjs.usePresentation((s) => s.clips.map((clip) => clip.documentId).join(" "));
|
|
3255
3272
|
const columns = react.useMemo(
|
|
3256
3273
|
() => (tags ?? []).filter((tag) => tag.kind !== "search" && VALUE_FORMATS.has(tag.tag_type.type)).map((tag) => ({ id: tag.external_id, name: tag.name })).sort((a, b) => a.name.localeCompare(b.name)),
|
|
3257
3274
|
[tags]
|
|
@@ -3266,23 +3283,25 @@ function useLabelColumns(active) {
|
|
|
3266
3283
|
if (note2) values[doc.external_id] = note2;
|
|
3267
3284
|
}
|
|
3268
3285
|
}
|
|
3269
|
-
|
|
3286
|
+
chunkJVEDKKNO_cjs.usePresentation.getState().setColumnValues(values);
|
|
3270
3287
|
}, [labelColumn, documentIds, documents]);
|
|
3271
3288
|
return columns;
|
|
3272
3289
|
}
|
|
3273
3290
|
function usePresentationController(active) {
|
|
3274
3291
|
const session = react$1.useArbiSessionStore();
|
|
3275
|
-
const
|
|
3292
|
+
const autosave = chunkJVEDKKNO_cjs.usePresentation((s) => s.autosave);
|
|
3293
|
+
const version = chunkJVEDKKNO_cjs.usePresentation((s) => s.version);
|
|
3294
|
+
const notify = chunkJVEDKKNO_cjs.usePresentation((s) => s.notify);
|
|
3276
3295
|
const { save, canSave } = usePresentationFiles();
|
|
3277
3296
|
const labelColumns = useLabelColumns(active);
|
|
3278
3297
|
const [dialog, setDialog] = react.useState(null);
|
|
3279
3298
|
const [reference, setReference] = react.useState(null);
|
|
3280
3299
|
const [cropping, setCropping] = react.useState(null);
|
|
3281
|
-
const cropClip =
|
|
3300
|
+
const cropClip = chunkJVEDKKNO_cjs.usePresentation((s) => s.clips.find((c) => c.id === cropping) ?? null);
|
|
3282
3301
|
const [saving, setSaving] = react.useState(false);
|
|
3283
3302
|
const close = (open) => !open && setDialog(null);
|
|
3284
3303
|
const quickSave = react.useCallback(async () => {
|
|
3285
|
-
const { savedId, title } =
|
|
3304
|
+
const { savedId, title } = chunkJVEDKKNO_cjs.usePresentation.getState();
|
|
3286
3305
|
if (!savedId) return setDialog("save");
|
|
3287
3306
|
setSaving(true);
|
|
3288
3307
|
try {
|
|
@@ -3332,21 +3351,28 @@ function usePresentationController(active) {
|
|
|
3332
3351
|
)
|
|
3333
3352
|
] });
|
|
3334
3353
|
const editor = {
|
|
3335
|
-
actions: canSave && /* @__PURE__ */ jsxRuntime.
|
|
3336
|
-
|
|
3337
|
-
|
|
3338
|
-
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3354
|
+
actions: canSave && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3355
|
+
autosave && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
3356
|
+
"v",
|
|
3357
|
+
version,
|
|
3358
|
+
" \xB7 Autosaved"
|
|
3359
|
+
] }),
|
|
3360
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
3361
|
+
ui.Button,
|
|
3362
|
+
{
|
|
3363
|
+
type: "button",
|
|
3364
|
+
size: "icon",
|
|
3365
|
+
variant: "ghost",
|
|
3366
|
+
className: "size-8 text-muted-foreground hover:text-foreground pointer-coarse:size-11",
|
|
3367
|
+
title: "Save (in Files \u203A Presentations)",
|
|
3368
|
+
"aria-label": "Save",
|
|
3369
|
+
disabled: saving,
|
|
3370
|
+
onClick: () => void quickSave(),
|
|
3371
|
+
"data-testid": "presentation-save",
|
|
3372
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Save, { className: "size-4" })
|
|
3373
|
+
}
|
|
3374
|
+
)
|
|
3375
|
+
] }),
|
|
3350
3376
|
menuItems: canSave && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3351
3377
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuItem, { onSelect: () => setDialog("open"), children: "Open\u2026" }),
|
|
3352
3378
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuItem, { onSelect: () => setDialog("fromTemplate"), children: "New from template\u2026" }),
|
|
@@ -3358,7 +3384,7 @@ function usePresentationController(active) {
|
|
|
3358
3384
|
trayStart: canSave && /* @__PURE__ */ jsxRuntime.jsx(GenerateTile, { onClick: () => generate(null) }),
|
|
3359
3385
|
onChooseLogo: canSave ? () => setDialog("logo") : void 0,
|
|
3360
3386
|
onEditImage: (clipId) => {
|
|
3361
|
-
const clip =
|
|
3387
|
+
const clip = chunkJVEDKKNO_cjs.usePresentation.getState().clips.find((c) => c.id === clipId);
|
|
3362
3388
|
if (clip) generate(clip.documentId);
|
|
3363
3389
|
},
|
|
3364
3390
|
onCropImage: setCropping
|
|
@@ -3369,5 +3395,5 @@ function usePresentationController(active) {
|
|
|
3369
3395
|
exports.SlidesEditor = SlidesEditor;
|
|
3370
3396
|
exports.usePresentationController = usePresentationController;
|
|
3371
3397
|
exports.usePresentationFiles = usePresentationFiles;
|
|
3372
|
-
//# sourceMappingURL=chunk-
|
|
3373
|
-
//# sourceMappingURL=chunk-
|
|
3398
|
+
//# sourceMappingURL=chunk-ZCU72Q76.cjs.map
|
|
3399
|
+
//# sourceMappingURL=chunk-ZCU72Q76.cjs.map
|