@arbidocs/blocks 0.5.121 → 0.5.122
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/{ClippingMediaViewer-B6WG7Q64.cjs → ClippingMediaViewer-IEIBT74X.cjs} +8 -8
- package/dist/{ClippingMediaViewer-B6WG7Q64.cjs.map → ClippingMediaViewer-IEIBT74X.cjs.map} +1 -1
- package/dist/{ClippingPdfViewer-6GCVTV3V.cjs → ClippingPdfViewer-OGYLMVCE.cjs} +5 -5
- package/dist/{ClippingPdfViewer-6GCVTV3V.cjs.map → ClippingPdfViewer-OGYLMVCE.cjs.map} +1 -1
- package/dist/{ConnectedCallDock-DC5V5OUJ.cjs → ConnectedCallDock-XJOYVVAH.cjs} +21 -21
- package/dist/{ConnectedCallDock-DC5V5OUJ.cjs.map → ConnectedCallDock-XJOYVVAH.cjs.map} +1 -1
- package/dist/{ConnectedCallRoom-FQLXWTFB.cjs → ConnectedCallRoom-CUDYAPQK.cjs} +14 -14
- package/dist/{ConnectedCallRoom-FQLXWTFB.cjs.map → ConnectedCallRoom-CUDYAPQK.cjs.map} +1 -1
- package/dist/{ConnectedNativeDocxComparison-4Q5S7VLD.cjs → ConnectedNativeDocxComparison-QKHCYD6W.cjs} +16 -16
- package/dist/{ConnectedNativeDocxComparison-4Q5S7VLD.cjs.map → ConnectedNativeDocxComparison-QKHCYD6W.cjs.map} +1 -1
- package/dist/ConnectedPresentation-AU25OW25.cjs +321 -0
- package/dist/ConnectedPresentation-AU25OW25.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-7QDE2CZD.cjs → ConnectedSlidesTab-I75LKKN7.cjs} +40 -38
- package/dist/ConnectedSlidesTab-I75LKKN7.cjs.map +1 -0
- package/dist/{ConnectedStreamedWordArtifact-FFOQJBOI.cjs → ConnectedStreamedWordArtifact-AG62232A.cjs} +16 -16
- package/dist/{ConnectedStreamedWordArtifact-FFOQJBOI.cjs.map → ConnectedStreamedWordArtifact-AG62232A.cjs.map} +1 -1
- package/dist/{DocumentReviewCard-SNWVEZ7S.cjs → DocumentReviewCard-M53XFLI2.cjs} +15 -15
- package/dist/{DocumentReviewCard-SNWVEZ7S.cjs.map → DocumentReviewCard-M53XFLI2.cjs.map} +1 -1
- package/dist/{FilesViewerDialog-IZI63FOV.cjs → FilesViewerDialog-4352KIOG.cjs} +50 -49
- package/dist/FilesViewerDialog-4352KIOG.cjs.map +1 -0
- package/dist/{WorkspaceTableView-TEIRB6VJ.cjs → WorkspaceTableView-3XYAV4BV.cjs} +8 -8
- package/dist/{WorkspaceTableView-TEIRB6VJ.cjs.map → WorkspaceTableView-3XYAV4BV.cjs.map} +1 -1
- package/dist/agents/index.cjs +297 -297
- package/dist/{ai-KBYNRNZ6.cjs → ai-IEIR7SC2.cjs} +25 -25
- package/dist/ai-IEIR7SC2.cjs.map +1 -0
- package/dist/calls/index.cjs +121 -121
- package/dist/chat/index.cjs +1 -1
- package/dist/{chunk-NLOETJCB.cjs → chunk-2F57IO7S.cjs} +12 -12
- package/dist/{chunk-NLOETJCB.cjs.map → chunk-2F57IO7S.cjs.map} +1 -1
- package/dist/chunk-2RLA6QO2.cjs +174 -0
- package/dist/chunk-2RLA6QO2.cjs.map +1 -0
- package/dist/{chunk-Q6DQGGP4.cjs → chunk-325GVZE6.cjs} +3 -3
- package/dist/{chunk-Q6DQGGP4.cjs.map → chunk-325GVZE6.cjs.map} +1 -1
- package/dist/{chunk-XTR26TNE.cjs → chunk-4TTX6ZNS.cjs} +20 -4
- package/dist/chunk-4TTX6ZNS.cjs.map +1 -0
- package/dist/{chunk-BVAT4EVC.cjs → chunk-5QERK4PK.cjs} +35 -35
- package/dist/{chunk-BVAT4EVC.cjs.map → chunk-5QERK4PK.cjs.map} +1 -1
- package/dist/{chunk-GX2EBMJW.cjs → chunk-6OK7ESTL.cjs} +7 -6
- package/dist/chunk-6OK7ESTL.cjs.map +1 -0
- package/dist/{chunk-C2OICDMI.cjs → chunk-7557LDAN.cjs} +10 -10
- package/dist/{chunk-C2OICDMI.cjs.map → chunk-7557LDAN.cjs.map} +1 -1
- package/dist/{chunk-474GPLCM.cjs → chunk-7L4X6QN2.cjs} +6 -6
- package/dist/{chunk-474GPLCM.cjs.map → chunk-7L4X6QN2.cjs.map} +1 -1
- package/dist/{chunk-52KGMAO5.cjs → chunk-7NLO7ASW.cjs} +15 -15
- package/dist/{chunk-52KGMAO5.cjs.map → chunk-7NLO7ASW.cjs.map} +1 -1
- package/dist/{chunk-H5OLHP2U.cjs → chunk-7OPOPYV6.cjs} +3 -3
- package/dist/{chunk-H5OLHP2U.cjs.map → chunk-7OPOPYV6.cjs.map} +1 -1
- package/dist/{chunk-W6B3RYTX.cjs → chunk-7PN3YENO.cjs} +4 -4
- package/dist/{chunk-W6B3RYTX.cjs.map → chunk-7PN3YENO.cjs.map} +1 -1
- package/dist/{chunk-734NPQNR.cjs → chunk-ADDQKZ5I.cjs} +4 -4
- package/dist/{chunk-734NPQNR.cjs.map → chunk-ADDQKZ5I.cjs.map} +1 -1
- package/dist/{chunk-JQLWKNJO.cjs → chunk-ALK3PUUB.cjs} +4 -4
- package/dist/{chunk-JQLWKNJO.cjs.map → chunk-ALK3PUUB.cjs.map} +1 -1
- package/dist/{chunk-4VZZWYEC.cjs → chunk-BQ5RIWWT.cjs} +3 -3
- package/dist/{chunk-4VZZWYEC.cjs.map → chunk-BQ5RIWWT.cjs.map} +1 -1
- package/dist/{chunk-ENGL7P3I.cjs → chunk-CQQQIZU4.cjs} +27 -27
- package/dist/{chunk-ENGL7P3I.cjs.map → chunk-CQQQIZU4.cjs.map} +1 -1
- package/dist/{chunk-3SCNXNHI.cjs → chunk-E3L5DB5F.cjs} +5 -5
- package/dist/{chunk-3SCNXNHI.cjs.map → chunk-E3L5DB5F.cjs.map} +1 -1
- package/dist/{chunk-VJ5ZLRBD.cjs → chunk-GFUOCGY6.cjs} +8 -3
- package/dist/chunk-GFUOCGY6.cjs.map +1 -0
- package/dist/{chunk-RYVZDFVO.cjs → chunk-JJZOL5MG.cjs} +3 -3
- package/dist/{chunk-RYVZDFVO.cjs.map → chunk-JJZOL5MG.cjs.map} +1 -1
- package/dist/{chunk-QFXILJMJ.cjs → chunk-K4763GD5.cjs} +17 -174
- package/dist/chunk-K4763GD5.cjs.map +1 -0
- package/dist/{chunk-EHP6OH5D.cjs → chunk-KA3F6TIH.cjs} +11 -11
- package/dist/{chunk-EHP6OH5D.cjs.map → chunk-KA3F6TIH.cjs.map} +1 -1
- 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-4RBQ44RY.cjs → chunk-MLA2BJ2Y.cjs} +28 -28
- package/dist/{chunk-4RBQ44RY.cjs.map → chunk-MLA2BJ2Y.cjs.map} +1 -1
- package/dist/{chunk-DR2AH7JL.cjs → chunk-NG2EE7HR.cjs} +48 -48
- package/dist/{chunk-DR2AH7JL.cjs.map → chunk-NG2EE7HR.cjs.map} +1 -1
- package/dist/{chunk-4NPCDS2X.cjs → chunk-NY3YUCOW.cjs} +3 -3
- package/dist/{chunk-4NPCDS2X.cjs.map → chunk-NY3YUCOW.cjs.map} +1 -1
- package/dist/{chunk-JZEYHDWJ.cjs → chunk-OHHKBURG.cjs} +76 -76
- package/dist/chunk-OHHKBURG.cjs.map +1 -0
- package/dist/{chunk-AY6EZSZB.cjs → chunk-QG2U2JGX.cjs} +4 -4
- package/dist/{chunk-AY6EZSZB.cjs.map → chunk-QG2U2JGX.cjs.map} +1 -1
- package/dist/{chunk-5534FYXP.cjs → chunk-SDRYSLOX.cjs} +4 -4
- package/dist/{chunk-5534FYXP.cjs.map → chunk-SDRYSLOX.cjs.map} +1 -1
- package/dist/{chunk-2W5E62EY.cjs → chunk-SGYSDABK.cjs} +6 -6
- package/dist/{chunk-2W5E62EY.cjs.map → chunk-SGYSDABK.cjs.map} +1 -1
- package/dist/{chunk-EATIFPKP.cjs → chunk-T73BHNQX.cjs} +4 -4
- package/dist/{chunk-EATIFPKP.cjs.map → chunk-T73BHNQX.cjs.map} +1 -1
- package/dist/{chunk-4IOYQLKG.cjs → chunk-TP5PGWIO.cjs} +3 -3
- package/dist/{chunk-4IOYQLKG.cjs.map → chunk-TP5PGWIO.cjs.map} +1 -1
- package/dist/{chunk-GKVE5JGB.cjs → chunk-UFT22LAB.cjs} +3 -3
- package/dist/{chunk-GKVE5JGB.cjs.map → chunk-UFT22LAB.cjs.map} +1 -1
- package/dist/{chunk-Q3XJUXID.cjs → chunk-USNTRL22.cjs} +215 -199
- package/dist/chunk-USNTRL22.cjs.map +1 -0
- package/dist/{chunk-7VUJGHMY.cjs → chunk-UTJ223TI.cjs} +178 -82
- package/dist/chunk-UTJ223TI.cjs.map +1 -0
- package/dist/{chunk-FKFQCK3C.cjs → chunk-V6MW7B4B.cjs} +4 -4
- package/dist/{chunk-FKFQCK3C.cjs.map → chunk-V6MW7B4B.cjs.map} +1 -1
- package/dist/{chunk-2PZT3J34.cjs → chunk-VWBYE3XY.cjs} +6 -6
- package/dist/{chunk-2PZT3J34.cjs.map → chunk-VWBYE3XY.cjs.map} +1 -1
- package/dist/{chunk-GQXPNIRE.cjs → chunk-WAV762GP.cjs} +6 -6
- package/dist/{chunk-GQXPNIRE.cjs.map → chunk-WAV762GP.cjs.map} +1 -1
- package/dist/{chunk-5LTIZ44D.cjs → chunk-WFMWKPGY.cjs} +14 -7
- package/dist/chunk-WFMWKPGY.cjs.map +1 -0
- package/dist/{chunk-KP5AITQ4.cjs → chunk-WRLGLZIA.cjs} +7 -7
- package/dist/{chunk-KP5AITQ4.cjs.map → chunk-WRLGLZIA.cjs.map} +1 -1
- package/dist/{chunk-MZ2KZXNU.cjs → chunk-WXUU3COI.cjs} +3 -3
- package/dist/{chunk-MZ2KZXNU.cjs.map → chunk-WXUU3COI.cjs.map} +1 -1
- package/dist/{chunk-NAJN32MF.cjs → chunk-XF355M7O.cjs} +13 -13
- package/dist/{chunk-NAJN32MF.cjs.map → chunk-XF355M7O.cjs.map} +1 -1
- package/dist/{chunk-GPX5VC57.cjs → chunk-XGM4VVNV.cjs} +50 -50
- package/dist/{chunk-GPX5VC57.cjs.map → chunk-XGM4VVNV.cjs.map} +1 -1
- package/dist/connect/docx.cjs +19 -19
- package/dist/connect/index.cjs +996 -995
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/viewer.cjs +38 -37
- package/dist/connection/conversation/ConnectedMessage.js +1 -1
- package/dist/connection/conversation/ConnectedMessage.js.map +2 -2
- package/dist/connection/presentation/ConnectedSlidesTab.js +5 -3
- package/dist/connection/presentation/ConnectedSlidesTab.js.map +2 -2
- package/dist/connection/presentation/PresentationPill.js +3 -8
- package/dist/connection/presentation/PresentationPill.js.map +2 -2
- package/dist/connection/presentation/requests.d.ts +5 -0
- package/dist/connection/presentation/requests.js +8 -1
- package/dist/connection/presentation/requests.js.map +2 -2
- package/dist/connection/viewer/ViewerPdfPane.js +4 -1
- package/dist/connection/viewer/ViewerPdfPane.js.map +2 -2
- package/dist/connection/viewer/documentPlace.d.ts +5 -4
- package/dist/connection/viewer/documentPlace.js +2 -2
- package/dist/connection/viewer/documentPlace.js.map +2 -2
- package/dist/connection/viewer/pdf/PdfClipOutlines.d.ts +11 -0
- package/dist/connection/viewer/pdf/PdfClipOutlines.js +42 -0
- package/dist/connection/viewer/pdf/PdfClipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/clipOutlines.d.ts +17 -0
- package/dist/connection/viewer/pdf/clipOutlines.js +24 -0
- package/dist/connection/viewer/pdf/clipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/passageHighlights.d.ts +2 -0
- package/dist/connection/viewer/pdf/passageHighlights.js +12 -1
- package/dist/connection/viewer/pdf/passageHighlights.js.map +2 -2
- package/dist/connection/viewer/pdf/usePdfClipOutlines.d.ts +7 -0
- package/dist/connection/viewer/pdf/usePdfClipOutlines.js +36 -0
- package/dist/connection/viewer/pdf/usePdfClipOutlines.js.map +7 -0
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js +11 -2
- package/dist/connection/viewer/pdf/usePdfPassageHighlights.js.map +2 -2
- package/dist/dashboards/index.cjs +1 -1
- package/dist/embed/index.cjs +39 -39
- package/dist/files/index.cjs +224 -224
- package/dist/index.cjs +1597 -1596
- package/dist/index.cjs.map +1 -1
- package/dist/presentation/PresentControls.d.ts +11 -0
- package/dist/presentation/PresentControls.js +117 -0
- package/dist/presentation/PresentControls.js.map +7 -0
- package/dist/presentation/PresenterView.js +36 -5
- package/dist/presentation/PresenterView.js.map +2 -2
- package/dist/presentation/SlidesEditor.js +17 -1
- package/dist/presentation/SlidesEditor.js.map +2 -2
- package/dist/presentation/panel-id.d.ts +12 -2
- package/dist/presentation/panel-id.js +6 -1
- package/dist/presentation/panel-id.js.map +2 -2
- package/dist/presentation/slide-layout.d.ts +5 -1
- package/dist/presentation/slide-layout.js +16 -0
- package/dist/presentation/slide-layout.js.map +2 -2
- package/dist/settings/index.cjs +146 -146
- package/dist/shell/PanelPortal.js +13 -4
- package/dist/shell/PanelPortal.js.map +2 -2
- package/dist/shell/index.cjs +92 -91
- package/dist/shell/panel-windows.js +1 -0
- package/dist/shell/panel-windows.js.map +2 -2
- package/dist/studio/index.cjs +28 -28
- package/dist/styles.css +1 -1
- package/dist/workflow-canvas/index.cjs +53 -53
- package/node_modules/@arbidocs/coedit/package.json +1 -1
- package/package.json +5 -5
- package/dist/ConnectedPresentation-4HLDZDWV.cjs +0 -183
- package/dist/ConnectedPresentation-4HLDZDWV.cjs.map +0 -1
- package/dist/ConnectedSlidesTab-7QDE2CZD.cjs.map +0 -1
- package/dist/FilesViewerDialog-IZI63FOV.cjs.map +0 -1
- package/dist/ai-KBYNRNZ6.cjs.map +0 -1
- package/dist/chunk-5LTIZ44D.cjs.map +0 -1
- package/dist/chunk-7VUJGHMY.cjs.map +0 -1
- package/dist/chunk-GX2EBMJW.cjs.map +0 -1
- package/dist/chunk-JZEYHDWJ.cjs.map +0 -1
- package/dist/chunk-Q3XJUXID.cjs.map +0 -1
- package/dist/chunk-QFXILJMJ.cjs.map +0 -1
- package/dist/chunk-VJ5ZLRBD.cjs.map +0 -1
- package/dist/chunk-XTR26TNE.cjs.map +0 -1
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
|
|
4
4
|
var chunkWOOOMTTA_cjs = require('./chunk-WOOOMTTA.cjs');
|
|
5
5
|
var chunk5GCCUXMT_cjs = require('./chunk-5GCCUXMT.cjs');
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
6
|
+
var chunk2F57IO7S_cjs = require('./chunk-2F57IO7S.cjs');
|
|
7
|
+
var chunkUFT22LAB_cjs = require('./chunk-UFT22LAB.cjs');
|
|
8
|
+
var chunkWFMWKPGY_cjs = require('./chunk-WFMWKPGY.cjs');
|
|
9
|
+
var chunk4TTX6ZNS_cjs = require('./chunk-4TTX6ZNS.cjs');
|
|
10
10
|
var chunk7JLJH5CW_cjs = require('./chunk-7JLJH5CW.cjs');
|
|
11
11
|
var chunkVZOOGA47_cjs = require('./chunk-VZOOGA47.cjs');
|
|
12
12
|
var chunkTKHCIHE2_cjs = require('./chunk-TKHCIHE2.cjs');
|
|
@@ -62,7 +62,7 @@ function MediaClip({
|
|
|
62
62
|
preload: "auto",
|
|
63
63
|
className: "pointer-events-none block select-none",
|
|
64
64
|
style: cropStyle(clip.rect),
|
|
65
|
-
...live ? { [
|
|
65
|
+
...live ? { [chunkWFMWKPGY_cjs.STAGE_VIDEO_ATTRIBUTE]: "" } : {}
|
|
66
66
|
}
|
|
67
67
|
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
68
68
|
"img",
|
|
@@ -191,7 +191,7 @@ var DROP_ATTRIBUTE = "data-presentation-drop";
|
|
|
191
191
|
function dropAt(doc, clipId, x, y) {
|
|
192
192
|
const target = doc.elementFromPoint(x, y)?.closest(`[${DROP_ATTRIBUTE}]`);
|
|
193
193
|
if (!target) return false;
|
|
194
|
-
const state =
|
|
194
|
+
const state = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
195
195
|
if (target.getAttribute(DROP_ATTRIBUTE) === "slide") {
|
|
196
196
|
const index2 = Number(target.getAttribute("data-slide-index"));
|
|
197
197
|
if (!Number.isInteger(index2)) return false;
|
|
@@ -211,7 +211,7 @@ function useClipDrag(clipId, onTap) {
|
|
|
211
211
|
const end = () => {
|
|
212
212
|
press.current = null;
|
|
213
213
|
setGhost(null);
|
|
214
|
-
|
|
214
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().setDragging(null);
|
|
215
215
|
};
|
|
216
216
|
return {
|
|
217
217
|
ghost,
|
|
@@ -227,7 +227,7 @@ function useClipDrag(clipId, onTap) {
|
|
|
227
227
|
if (Math.hypot(event.clientX - p.x, event.clientY - p.y) < DRAG_THRESHOLD) return;
|
|
228
228
|
p.dragging = true;
|
|
229
229
|
event.currentTarget.setPointerCapture(event.pointerId);
|
|
230
|
-
|
|
230
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().setDragging(clipId);
|
|
231
231
|
}
|
|
232
232
|
event.preventDefault();
|
|
233
233
|
setGhost({ x: event.clientX, y: event.clientY });
|
|
@@ -265,7 +265,7 @@ function Label({ clip }) {
|
|
|
265
265
|
"aria-label": "Clip label",
|
|
266
266
|
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",
|
|
267
267
|
onBlur: (event) => {
|
|
268
|
-
|
|
268
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().setCaption(clip.id, event.target.value);
|
|
269
269
|
setEditing(false);
|
|
270
270
|
},
|
|
271
271
|
onKeyDown: (event) => {
|
|
@@ -287,7 +287,7 @@ function Label({ clip }) {
|
|
|
287
287
|
);
|
|
288
288
|
}
|
|
289
289
|
function TrayTile({ clip, onSlide }) {
|
|
290
|
-
const { place, removeClip } =
|
|
290
|
+
const { place, removeClip } = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
291
291
|
const drag = useClipDrag(clip.id, () => !onSlide && place(clip.id));
|
|
292
292
|
const itemRef = react.useRef(null);
|
|
293
293
|
const size = tileSize(clip.aspect);
|
|
@@ -354,9 +354,9 @@ function TrayTile({ clip, onSlide }) {
|
|
|
354
354
|
);
|
|
355
355
|
}
|
|
356
356
|
function ClipTray({ start }) {
|
|
357
|
-
const all =
|
|
357
|
+
const all = chunk4TTX6ZNS_cjs.usePresentation((s) => s.clips);
|
|
358
358
|
const clips = react.useMemo(() => all.filter((clip) => !clip.plain), [all]);
|
|
359
|
-
const slide =
|
|
359
|
+
const slide = chunk4TTX6ZNS_cjs.usePresentation(chunk4TTX6ZNS_cjs.currentSlide);
|
|
360
360
|
const onSlide = new Set(slide?.items.map((item) => item.clipId));
|
|
361
361
|
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(
|
|
362
362
|
"ul",
|
|
@@ -411,7 +411,7 @@ function CustomColor({
|
|
|
411
411
|
"input",
|
|
412
412
|
{
|
|
413
413
|
type: "color",
|
|
414
|
-
value:
|
|
414
|
+
value: chunk4TTX6ZNS_cjs.isHexColor(value) ? value : "#1f2937",
|
|
415
415
|
onChange: (event) => onChange(event.target.value),
|
|
416
416
|
"aria-label": label,
|
|
417
417
|
className: "absolute inset-0 cursor-pointer opacity-0"
|
|
@@ -422,10 +422,10 @@ function CustomColor({
|
|
|
422
422
|
);
|
|
423
423
|
}
|
|
424
424
|
function DesignMenu({ onChooseLogo }) {
|
|
425
|
-
const theme =
|
|
426
|
-
const setTheme =
|
|
427
|
-
const customBackground =
|
|
428
|
-
const customAccent = !
|
|
425
|
+
const theme = chunk4TTX6ZNS_cjs.usePresentation((s) => s.theme);
|
|
426
|
+
const setTheme = chunk4TTX6ZNS_cjs.usePresentation((s) => s.setTheme);
|
|
427
|
+
const customBackground = chunk4TTX6ZNS_cjs.isHexColor(theme.background);
|
|
428
|
+
const customAccent = !chunk4TTX6ZNS_cjs.ACCENTS.some((accent) => accent.color === theme.accent);
|
|
429
429
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { children: [
|
|
430
430
|
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
431
431
|
ui.Button,
|
|
@@ -442,7 +442,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
442
442
|
) }),
|
|
443
443
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.PopoverContent, { align: "end", className: "flex w-[21.5rem] flex-col gap-4 overflow-x-hidden p-4", children: [
|
|
444
444
|
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Background", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "grid grid-cols-7 gap-2", children: [
|
|
445
|
-
|
|
445
|
+
chunk4TTX6ZNS_cjs.BACKGROUNDS.map((preset) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
446
446
|
"button",
|
|
447
447
|
{
|
|
448
448
|
type: "button",
|
|
@@ -454,7 +454,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
454
454
|
"size-8 rounded-md border border-border shadow-sm",
|
|
455
455
|
theme.background === preset.id && "ring-2 ring-primary ring-offset-1 ring-offset-background"
|
|
456
456
|
),
|
|
457
|
-
style: { background:
|
|
457
|
+
style: { background: chunk4TTX6ZNS_cjs.backgroundCss(preset.id), containerType: "inline-size" },
|
|
458
458
|
"data-testid": `design-background-${preset.id}`
|
|
459
459
|
},
|
|
460
460
|
preset.id
|
|
@@ -469,7 +469,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
469
469
|
}
|
|
470
470
|
)
|
|
471
471
|
] }) }),
|
|
472
|
-
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Typeface", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-2", children: Object.keys(
|
|
472
|
+
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Typeface", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-3 gap-2", children: Object.keys(chunk4TTX6ZNS_cjs.FONTS).map((font) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
473
473
|
"button",
|
|
474
474
|
{
|
|
475
475
|
type: "button",
|
|
@@ -481,14 +481,14 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
481
481
|
),
|
|
482
482
|
"data-testid": `design-font-${font}`,
|
|
483
483
|
children: [
|
|
484
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl leading-tight", style: { fontFamily:
|
|
485
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-muted-foreground", children:
|
|
484
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xl leading-tight", style: { fontFamily: chunk4TTX6ZNS_cjs.FONTS[font].css }, children: "Aa" }),
|
|
485
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] text-muted-foreground", children: chunk4TTX6ZNS_cjs.FONTS[font].label })
|
|
486
486
|
]
|
|
487
487
|
},
|
|
488
488
|
font
|
|
489
489
|
)) }) }),
|
|
490
490
|
/* @__PURE__ */ jsxRuntime.jsx(Section, { title: "Accent", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
491
|
-
|
|
491
|
+
chunk4TTX6ZNS_cjs.ACCENTS.map((accent) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
492
492
|
"button",
|
|
493
493
|
{
|
|
494
494
|
type: "button",
|
|
@@ -500,7 +500,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
500
500
|
"flex size-8 items-center justify-center rounded-full border border-black/10 shadow-sm",
|
|
501
501
|
theme.accent === accent.color && "ring-2 ring-primary ring-offset-1 ring-offset-background"
|
|
502
502
|
),
|
|
503
|
-
style: { background:
|
|
503
|
+
style: { background: chunk4TTX6ZNS_cjs.accentColor(accent.color) },
|
|
504
504
|
children: theme.accent === accent.color && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "size-3.5 text-black/70" })
|
|
505
505
|
},
|
|
506
506
|
accent.color
|
|
@@ -508,7 +508,7 @@ function DesignMenu({ onChooseLogo }) {
|
|
|
508
508
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
509
509
|
CustomColor,
|
|
510
510
|
{
|
|
511
|
-
value:
|
|
511
|
+
value: chunk4TTX6ZNS_cjs.accentColor(theme.accent),
|
|
512
512
|
selected: customAccent,
|
|
513
513
|
label: "Your own accent colour",
|
|
514
514
|
round: true,
|
|
@@ -571,13 +571,13 @@ var at = (box2) => ({
|
|
|
571
571
|
height: `${box2.h * 100}%`
|
|
572
572
|
});
|
|
573
573
|
function LayoutThumb({ layout, className }) {
|
|
574
|
-
const geometry =
|
|
574
|
+
const geometry = chunk4TTX6ZNS_cjs.slideGeometry({ layout, caption: "Title" }, { labels: false, logo: null });
|
|
575
575
|
const { top, right = 0, bottom = 0, columns } = geometry.reserve;
|
|
576
576
|
const room = {
|
|
577
|
-
x:
|
|
578
|
-
y:
|
|
579
|
-
w: 1 - 2 *
|
|
580
|
-
h: 1 - 2 *
|
|
577
|
+
x: chunk4TTX6ZNS_cjs.STAGE_MARGIN,
|
|
578
|
+
y: chunk4TTX6ZNS_cjs.STAGE_MARGIN + top,
|
|
579
|
+
w: 1 - 2 * chunk4TTX6ZNS_cjs.STAGE_MARGIN - right,
|
|
580
|
+
h: 1 - 2 * chunk4TTX6ZNS_cjs.STAGE_MARGIN - top - bottom
|
|
581
581
|
};
|
|
582
582
|
const blocks = layout === "title" || layout === "section" || layout === "free" ? [] : columns === 2 ? [
|
|
583
583
|
{ ...room, w: room.w / 2 - 0.02 },
|
|
@@ -628,10 +628,10 @@ function LayoutMenu({
|
|
|
628
628
|
className,
|
|
629
629
|
compact = false
|
|
630
630
|
}) {
|
|
631
|
-
const layout =
|
|
632
|
-
(s) => (index === void 0 ?
|
|
631
|
+
const layout = chunk4TTX6ZNS_cjs.usePresentation(
|
|
632
|
+
(s) => (index === void 0 ? chunk4TTX6ZNS_cjs.currentSlide(s) : s.slides[index])?.layout ?? "clips"
|
|
633
633
|
);
|
|
634
|
-
const setSlideLayout =
|
|
634
|
+
const setSlideLayout = chunk4TTX6ZNS_cjs.usePresentation((s) => s.setSlideLayout);
|
|
635
635
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
|
|
636
636
|
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
637
637
|
ui.Button,
|
|
@@ -644,7 +644,7 @@ function LayoutMenu({
|
|
|
644
644
|
className
|
|
645
645
|
),
|
|
646
646
|
title: "Slide layout",
|
|
647
|
-
"aria-label": `Slide layout: ${
|
|
647
|
+
"aria-label": `Slide layout: ${chunk4TTX6ZNS_cjs.LAYOUT_INFO[layout].label}`,
|
|
648
648
|
"data-testid": "presentation-layout",
|
|
649
649
|
children: [
|
|
650
650
|
/* @__PURE__ */ jsxRuntime.jsx(LayoutThumb, { layout, className: compact ? "w-6" : "w-7" }),
|
|
@@ -652,7 +652,7 @@ function LayoutMenu({
|
|
|
652
652
|
]
|
|
653
653
|
}
|
|
654
654
|
) }),
|
|
655
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "start", className: "w-56", children:
|
|
655
|
+
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "start", className: "w-56", children: chunk4TTX6ZNS_cjs.SLIDE_LAYOUTS.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
656
656
|
ui.DropdownMenuItem,
|
|
657
657
|
{
|
|
658
658
|
onSelect: () => setSlideLayout(option, index),
|
|
@@ -660,7 +660,7 @@ function LayoutMenu({
|
|
|
660
660
|
"data-testid": `presentation-layout-${option}`,
|
|
661
661
|
children: [
|
|
662
662
|
/* @__PURE__ */ jsxRuntime.jsx(LayoutThumb, { layout: option, className: "w-12" }),
|
|
663
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
663
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: chunk4TTX6ZNS_cjs.LAYOUT_INFO[option].label })
|
|
664
664
|
]
|
|
665
665
|
},
|
|
666
666
|
option
|
|
@@ -668,11 +668,11 @@ function LayoutMenu({
|
|
|
668
668
|
] });
|
|
669
669
|
}
|
|
670
670
|
function Notice() {
|
|
671
|
-
const notice =
|
|
671
|
+
const notice = chunk4TTX6ZNS_cjs.usePresentation((s) => s.notice);
|
|
672
672
|
react.useEffect(() => {
|
|
673
673
|
if (!notice) return;
|
|
674
674
|
const timer = setTimeout(
|
|
675
|
-
() =>
|
|
675
|
+
() => chunk4TTX6ZNS_cjs.usePresentation.getState().clearNotice(notice.id),
|
|
676
676
|
notice.kind === "error" ? 8e3 : 3e3
|
|
677
677
|
);
|
|
678
678
|
return () => clearTimeout(timer);
|
|
@@ -693,7 +693,7 @@ function Notice() {
|
|
|
693
693
|
type: "button",
|
|
694
694
|
className: "ml-1 rounded p-0.5 text-muted-foreground hover:text-foreground",
|
|
695
695
|
"aria-label": "Dismiss",
|
|
696
|
-
onClick: () =>
|
|
696
|
+
onClick: () => chunk4TTX6ZNS_cjs.usePresentation.getState().clearNotice(notice.id),
|
|
697
697
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "size-3.5" })
|
|
698
698
|
}
|
|
699
699
|
)
|
|
@@ -729,7 +729,7 @@ function ClipActionBar({
|
|
|
729
729
|
onEditImage,
|
|
730
730
|
onCropImage
|
|
731
731
|
}) {
|
|
732
|
-
const actions =
|
|
732
|
+
const actions = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
733
733
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
734
734
|
"div",
|
|
735
735
|
{
|
|
@@ -808,7 +808,7 @@ function Text({
|
|
|
808
808
|
box2.anchor === "middle" && "justify-center",
|
|
809
809
|
box2.anchor === "bottom" && "justify-end"
|
|
810
810
|
),
|
|
811
|
-
style: textStyle(box2, empty ? PLACEHOLDER_COLOR :
|
|
811
|
+
style: textStyle(box2, empty ? PLACEHOLDER_COLOR : chunk4TTX6ZNS_cjs.TEXT_COLORS[box2.tone]),
|
|
812
812
|
onPointerDown: onEdit ? (event) => event.stopPropagation() : void 0,
|
|
813
813
|
onClick: onEdit,
|
|
814
814
|
"data-testid": testId,
|
|
@@ -857,7 +857,7 @@ function TextField({
|
|
|
857
857
|
box2.align === "center" && "text-center"
|
|
858
858
|
),
|
|
859
859
|
style: {
|
|
860
|
-
...textStyle(box2,
|
|
860
|
+
...textStyle(box2, chunk4TTX6ZNS_cjs.TEXT_COLORS[box2.tone]),
|
|
861
861
|
fontFamily: "inherit",
|
|
862
862
|
// Bulleted lines keep their indent while typed.
|
|
863
863
|
paddingLeft: box2.bullets ? "1.22em" : void 0
|
|
@@ -891,10 +891,10 @@ var SlideDecor = react.memo(function SlideDecor2({
|
|
|
891
891
|
dim
|
|
892
892
|
}) {
|
|
893
893
|
const [typing, setTyping] = react.useState(null);
|
|
894
|
-
const geometry =
|
|
894
|
+
const geometry = chunk4TTX6ZNS_cjs.slideGeometry(slide, { labels, logo: theme.logo?.corner ?? null });
|
|
895
895
|
const title = slide.caption.trim();
|
|
896
896
|
const titled = slide.layout === "title" || slide.layout === "section";
|
|
897
|
-
const info =
|
|
897
|
+
const info = chunk4TTX6ZNS_cjs.LAYOUT_INFO[slide.layout];
|
|
898
898
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("pointer-events-none absolute inset-0", dim && "opacity-30"), children: [
|
|
899
899
|
!geometry.title ? null : editing && typing === "title" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
900
900
|
TextField,
|
|
@@ -912,7 +912,7 @@ var SlideDecor = react.memo(function SlideDecor2({
|
|
|
912
912
|
{
|
|
913
913
|
box: geometry.title,
|
|
914
914
|
lines: title ? [title] : [],
|
|
915
|
-
accent:
|
|
915
|
+
accent: chunk4TTX6ZNS_cjs.accentColor(theme.accent),
|
|
916
916
|
placeholder: editable && (titled || editing) ? "Click to add a title" : void 0,
|
|
917
917
|
onEdit: editing ? () => setTyping("title") : void 0,
|
|
918
918
|
testId: "stage-slide-caption"
|
|
@@ -922,7 +922,7 @@ var SlideDecor = react.memo(function SlideDecor2({
|
|
|
922
922
|
"div",
|
|
923
923
|
{
|
|
924
924
|
className: "absolute",
|
|
925
|
-
style: { ...boxStyle(geometry.rule), background:
|
|
925
|
+
style: { ...boxStyle(geometry.rule), background: chunk4TTX6ZNS_cjs.accentColor(theme.accent) }
|
|
926
926
|
}
|
|
927
927
|
),
|
|
928
928
|
geometry.text && (editing && typing === "text" ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -940,8 +940,8 @@ var SlideDecor = react.memo(function SlideDecor2({
|
|
|
940
940
|
Text,
|
|
941
941
|
{
|
|
942
942
|
box: geometry.text,
|
|
943
|
-
lines:
|
|
944
|
-
accent:
|
|
943
|
+
lines: chunk4TTX6ZNS_cjs.textLines(slide.points),
|
|
944
|
+
accent: chunk4TTX6ZNS_cjs.accentColor(theme.accent),
|
|
945
945
|
placeholder: editable ? info.text : void 0,
|
|
946
946
|
onEdit: editing ? () => setTyping("text") : void 0,
|
|
947
947
|
testId: "stage-slide-points"
|
|
@@ -999,7 +999,7 @@ function HoldButton({
|
|
|
999
999
|
);
|
|
1000
1000
|
}
|
|
1001
1001
|
function ClipViewControls({ clip }) {
|
|
1002
|
-
const { panClip, setClipZoom } =
|
|
1002
|
+
const { panClip, setClipZoom } = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
1003
1003
|
const { rect } = clip;
|
|
1004
1004
|
const zoomBase = clip.zoomBase ?? rect.w;
|
|
1005
1005
|
const minZoom = Math.min(100, Math.floor(zoomBase / Math.min(1, rect.w / rect.h) * 100));
|
|
@@ -1094,7 +1094,7 @@ var CORNERS = [
|
|
|
1094
1094
|
{ corner: "sw", left: "0%", top: "100%", cursor: "nesw-resize" },
|
|
1095
1095
|
{ corner: "se", left: "100%", top: "100%", cursor: "nwse-resize" }
|
|
1096
1096
|
];
|
|
1097
|
-
var EDGE_CSS =
|
|
1097
|
+
var EDGE_CSS = chunk4TTX6ZNS_cjs.clipEdgeCss();
|
|
1098
1098
|
var StageItem = react.memo(function StageItem2({
|
|
1099
1099
|
clip,
|
|
1100
1100
|
frame,
|
|
@@ -1164,14 +1164,14 @@ var StageItem = react.memo(function StageItem2({
|
|
|
1164
1164
|
const dy = (event.clientY - g.pointer.y) / g.stage.height;
|
|
1165
1165
|
const free = event.altKey;
|
|
1166
1166
|
if (isEdge(g.kind)) {
|
|
1167
|
-
const result =
|
|
1167
|
+
const result = chunk4TTX6ZNS_cjs.reshapeFrame(g.frame, g.shape, g.kind, dx, dy, g.others, free);
|
|
1168
1168
|
g.next = {
|
|
1169
1169
|
frame: result.frame,
|
|
1170
1170
|
shape: { rect: result.rect, aspect: result.aspect },
|
|
1171
1171
|
guides: result.guides
|
|
1172
1172
|
};
|
|
1173
1173
|
} else {
|
|
1174
|
-
g.next = g.kind === "move" ?
|
|
1174
|
+
g.next = g.kind === "move" ? chunk4TTX6ZNS_cjs.moveFrame(g.frame, g.shape.aspect, dx, dy, g.others, free) : chunk4TTX6ZNS_cjs.resizeFrame(g.frame, g.shape.aspect, g.kind, dx, dy, g.others, free);
|
|
1175
1175
|
}
|
|
1176
1176
|
g.request ??= view().requestAnimationFrame(apply);
|
|
1177
1177
|
};
|
|
@@ -1208,7 +1208,7 @@ var StageItem = react.memo(function StageItem2({
|
|
|
1208
1208
|
left: `${box2.x * 100}%`,
|
|
1209
1209
|
top: `${box2.y * 100}%`,
|
|
1210
1210
|
width: `${box2.w * 100}%`,
|
|
1211
|
-
height: `${
|
|
1211
|
+
height: `${chunk4TTX6ZNS_cjs.frameHeight(box2, shown.aspect) * 100}%`
|
|
1212
1212
|
},
|
|
1213
1213
|
onPointerDown: (event) => start(event, "move"),
|
|
1214
1214
|
onPointerMove: move,
|
|
@@ -1233,7 +1233,7 @@ var StageItem = react.memo(function StageItem2({
|
|
|
1233
1233
|
"div",
|
|
1234
1234
|
{
|
|
1235
1235
|
className: "pointer-events-none absolute left-0 top-full mt-[0.5cqw] max-w-full truncate text-[1.7cqw] leading-tight",
|
|
1236
|
-
style: { color:
|
|
1236
|
+
style: { color: chunk4TTX6ZNS_cjs.TEXT_COLORS.muted },
|
|
1237
1237
|
children: label
|
|
1238
1238
|
}
|
|
1239
1239
|
),
|
|
@@ -1277,14 +1277,14 @@ var StageItem = react.memo(function StageItem2({
|
|
|
1277
1277
|
});
|
|
1278
1278
|
|
|
1279
1279
|
// src/presentation/box-style.ts
|
|
1280
|
-
var cqw = (points) => `${
|
|
1280
|
+
var cqw = (points) => `${chunk4TTX6ZNS_cjs.pointsToStage(points) * 100}cqw`;
|
|
1281
1281
|
function runStyle(run, font) {
|
|
1282
1282
|
return {
|
|
1283
|
-
fontSize: cqw(run.size ??
|
|
1283
|
+
fontSize: cqw(run.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE),
|
|
1284
1284
|
fontWeight: run.bold ? 700 : 400,
|
|
1285
1285
|
fontStyle: run.italic ? "italic" : void 0,
|
|
1286
1286
|
textDecoration: run.underline ? "underline" : void 0,
|
|
1287
|
-
color: run.color ??
|
|
1287
|
+
color: run.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body,
|
|
1288
1288
|
fontFamily: run.font ? `"${run.font}", ${font}` : font
|
|
1289
1289
|
};
|
|
1290
1290
|
}
|
|
@@ -1306,7 +1306,7 @@ var withAlpha = (hex3, alpha = 1) => {
|
|
|
1306
1306
|
function shapeStyle(box2) {
|
|
1307
1307
|
const { frame } = box2;
|
|
1308
1308
|
const line = box2.line;
|
|
1309
|
-
const shorter = Math.min(frame.w, frame.h * 1 /
|
|
1309
|
+
const shorter = Math.min(frame.w, frame.h * 1 / chunk4TTX6ZNS_cjs.STAGE_ASPECT);
|
|
1310
1310
|
return {
|
|
1311
1311
|
background: box2.fill && box2.shape !== "line" ? withAlpha(box2.fill, box2.fillAlpha) : void 0,
|
|
1312
1312
|
border: line && box2.shape !== "line" ? `${cqw(line.width)} ${line.dash ? "dashed" : "solid"} ${line.color}` : void 0,
|
|
@@ -1319,7 +1319,7 @@ function Paragraphs({
|
|
|
1319
1319
|
}) {
|
|
1320
1320
|
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: paragraphs.map((paragraph, index) => {
|
|
1321
1321
|
const first = paragraph.runs[0];
|
|
1322
|
-
const size = first?.size ??
|
|
1322
|
+
const size = first?.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE;
|
|
1323
1323
|
const indent = (paragraph.level ?? 0) * 0.5 * size;
|
|
1324
1324
|
const empty = !paragraph.runs.some((run) => run.text);
|
|
1325
1325
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -1406,7 +1406,7 @@ var StageBox = react.memo(function StageBox2({
|
|
|
1406
1406
|
const dx = (event.clientX - g.pointer.x) / g.stage.width;
|
|
1407
1407
|
const dy = (event.clientY - g.pointer.y) / g.stage.height;
|
|
1408
1408
|
if (!g.next) setDragging(true);
|
|
1409
|
-
g.next = g.handle === "move" ?
|
|
1409
|
+
g.next = g.handle === "move" ? chunk4TTX6ZNS_cjs.moveBox(g.frame, dx, dy) : chunk4TTX6ZNS_cjs.stretchBox(g.frame, g.handle, dx, dy);
|
|
1410
1410
|
g.request ??= view().requestAnimationFrame(apply);
|
|
1411
1411
|
};
|
|
1412
1412
|
const end = () => {
|
|
@@ -1430,8 +1430,8 @@ var StageBox = react.memo(function StageBox2({
|
|
|
1430
1430
|
host.commit(box2.id, g.next);
|
|
1431
1431
|
};
|
|
1432
1432
|
const hasText = box2.shape !== "line";
|
|
1433
|
-
const inset = cqw(box2.inset ??
|
|
1434
|
-
const run =
|
|
1433
|
+
const inset = cqw(box2.inset ?? chunk4TTX6ZNS_cjs.DEFAULT_INSET);
|
|
1434
|
+
const run = chunk4TTX6ZNS_cjs.firstRun(box2);
|
|
1435
1435
|
const transform = box2.rotation ? `rotate(${box2.rotation}deg)` : void 0;
|
|
1436
1436
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1437
1437
|
"div",
|
|
@@ -1479,7 +1479,7 @@ var StageBox = react.memo(function StageBox2({
|
|
|
1479
1479
|
y1: box2.flipV ? "100%" : "0%",
|
|
1480
1480
|
x2: "100%",
|
|
1481
1481
|
y2: box2.flipV ? "0%" : "100%",
|
|
1482
|
-
stroke: box2.line?.color ??
|
|
1482
|
+
stroke: box2.line?.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body,
|
|
1483
1483
|
style: { strokeWidth: cqw(box2.line?.width ?? 1) },
|
|
1484
1484
|
strokeDasharray: box2.line?.dash ? "6 4" : void 0
|
|
1485
1485
|
}
|
|
@@ -1498,7 +1498,7 @@ var StageBox = react.memo(function StageBox2({
|
|
|
1498
1498
|
"textarea",
|
|
1499
1499
|
{
|
|
1500
1500
|
autoFocus: true,
|
|
1501
|
-
defaultValue:
|
|
1501
|
+
defaultValue: chunk4TTX6ZNS_cjs.boxText(box2),
|
|
1502
1502
|
className: "pointer-events-auto w-full flex-1 resize-none bg-transparent p-0 outline-none",
|
|
1503
1503
|
style: {
|
|
1504
1504
|
...runStyle(run ?? { }, font),
|
|
@@ -1517,11 +1517,11 @@ var StageBox = react.memo(function StageBox2({
|
|
|
1517
1517
|
"aria-label": "Text",
|
|
1518
1518
|
"data-testid": "stage-box-text-input"
|
|
1519
1519
|
}
|
|
1520
|
-
) :
|
|
1520
|
+
) : chunk4TTX6ZNS_cjs.boxText(box2) || !editable ? /* @__PURE__ */ jsxRuntime.jsx(Paragraphs, { paragraphs: box2.paragraphs, font }) : box2.shape === "text" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1521
1521
|
"span",
|
|
1522
1522
|
{
|
|
1523
1523
|
className: "text-white/40",
|
|
1524
|
-
style: { fontSize: cqw(run?.size ??
|
|
1524
|
+
style: { fontSize: cqw(run?.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE) },
|
|
1525
1525
|
children: "Double-click to type"
|
|
1526
1526
|
}
|
|
1527
1527
|
)
|
|
@@ -1587,9 +1587,9 @@ function ColorAction({
|
|
|
1587
1587
|
] });
|
|
1588
1588
|
}
|
|
1589
1589
|
function BoxActionBar({ box: box2, onRemoved }) {
|
|
1590
|
-
const actions =
|
|
1591
|
-
const run =
|
|
1592
|
-
const size = run?.size ??
|
|
1590
|
+
const actions = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
1591
|
+
const run = chunk4TTX6ZNS_cjs.firstRun(box2);
|
|
1592
|
+
const size = run?.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE;
|
|
1593
1593
|
const align = box2.paragraphs[0]?.align ?? "left";
|
|
1594
1594
|
const update = (change) => actions.updateBox(box2.id, change);
|
|
1595
1595
|
const text = box2.shape !== "line";
|
|
@@ -1612,7 +1612,7 @@ function BoxActionBar({ box: box2, onRemoved }) {
|
|
|
1612
1612
|
Action,
|
|
1613
1613
|
{
|
|
1614
1614
|
label: "Smaller",
|
|
1615
|
-
onClick: () => update((b) =>
|
|
1615
|
+
onClick: () => update((b) => chunk4TTX6ZNS_cjs.styleRuns(b, (r) => ({ ...r, size: nextSize(r.size ?? size, false) }))),
|
|
1616
1616
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AArrowDown, { className: "size-4" })
|
|
1617
1617
|
}
|
|
1618
1618
|
),
|
|
@@ -1628,7 +1628,7 @@ function BoxActionBar({ box: box2, onRemoved }) {
|
|
|
1628
1628
|
Action,
|
|
1629
1629
|
{
|
|
1630
1630
|
label: "Larger",
|
|
1631
|
-
onClick: () => update((b) =>
|
|
1631
|
+
onClick: () => update((b) => chunk4TTX6ZNS_cjs.styleRuns(b, (r) => ({ ...r, size: nextSize(r.size ?? size, true) }))),
|
|
1632
1632
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AArrowUp, { className: "size-4" })
|
|
1633
1633
|
}
|
|
1634
1634
|
),
|
|
@@ -1636,7 +1636,7 @@ function BoxActionBar({ box: box2, onRemoved }) {
|
|
|
1636
1636
|
Action,
|
|
1637
1637
|
{
|
|
1638
1638
|
label: "Bold",
|
|
1639
|
-
onClick: () => update((b) =>
|
|
1639
|
+
onClick: () => update((b) => chunk4TTX6ZNS_cjs.styleRuns(b, (r) => ({ ...r, bold: !run?.bold }))),
|
|
1640
1640
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Bold, { className: ui.cn("size-4", run?.bold && "text-primary") })
|
|
1641
1641
|
}
|
|
1642
1642
|
),
|
|
@@ -1644,7 +1644,7 @@ function BoxActionBar({ box: box2, onRemoved }) {
|
|
|
1644
1644
|
Action,
|
|
1645
1645
|
{
|
|
1646
1646
|
label: "Italic",
|
|
1647
|
-
onClick: () => update((b) =>
|
|
1647
|
+
onClick: () => update((b) => chunk4TTX6ZNS_cjs.styleRuns(b, (r) => ({ ...r, italic: !run?.italic }))),
|
|
1648
1648
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Italic, { className: ui.cn("size-4", run?.italic && "text-primary") })
|
|
1649
1649
|
}
|
|
1650
1650
|
),
|
|
@@ -1663,8 +1663,8 @@ function BoxActionBar({ box: box2, onRemoved }) {
|
|
|
1663
1663
|
ColorAction,
|
|
1664
1664
|
{
|
|
1665
1665
|
label: "Text colour",
|
|
1666
|
-
value: run?.color ??
|
|
1667
|
-
onChange: (color) => update((b) =>
|
|
1666
|
+
value: run?.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body,
|
|
1667
|
+
onChange: (color) => update((b) => chunk4TTX6ZNS_cjs.styleRuns(b, (r) => ({ ...r, color }))),
|
|
1668
1668
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Baseline, { className: "size-4" })
|
|
1669
1669
|
}
|
|
1670
1670
|
)
|
|
@@ -1728,18 +1728,18 @@ function PresentationStage({
|
|
|
1728
1728
|
overlay,
|
|
1729
1729
|
className
|
|
1730
1730
|
}) {
|
|
1731
|
-
const index =
|
|
1732
|
-
const slide =
|
|
1733
|
-
const clips =
|
|
1734
|
-
const blank =
|
|
1735
|
-
const captions =
|
|
1736
|
-
const columnValues =
|
|
1737
|
-
const theme =
|
|
1738
|
-
const logoImage =
|
|
1739
|
-
const media =
|
|
1731
|
+
const index = chunk4TTX6ZNS_cjs.usePresentation((s) => slideIndex ?? s.current);
|
|
1732
|
+
const slide = chunk4TTX6ZNS_cjs.usePresentation((s) => s.slides[index]);
|
|
1733
|
+
const clips = chunk4TTX6ZNS_cjs.usePresentation((s) => s.clips);
|
|
1734
|
+
const blank = chunk4TTX6ZNS_cjs.usePresentation((s) => s.blank && !editable);
|
|
1735
|
+
const captions = chunk4TTX6ZNS_cjs.usePresentation((s) => s.captions);
|
|
1736
|
+
const columnValues = chunk4TTX6ZNS_cjs.usePresentation((s) => s.columnValues);
|
|
1737
|
+
const theme = chunk4TTX6ZNS_cjs.usePresentation((s) => s.theme);
|
|
1738
|
+
const logoImage = chunk4TTX6ZNS_cjs.usePresentation((s) => s.logoImage);
|
|
1739
|
+
const media = chunk4TTX6ZNS_cjs.usePresentation((s) => s.media);
|
|
1740
1740
|
const stageRef = react.useRef(null);
|
|
1741
1741
|
const guideLayer = react.useRef(null);
|
|
1742
|
-
const dropping =
|
|
1742
|
+
const dropping = chunk4TTX6ZNS_cjs.usePresentation((s) => editable && s.dragging !== null);
|
|
1743
1743
|
const [dragging, setDragging] = react.useState(false);
|
|
1744
1744
|
const latest = react.useRef({ slide, clips, index, onSelect });
|
|
1745
1745
|
latest.current = { slide, clips, index, onSelect };
|
|
@@ -1754,13 +1754,13 @@ function PresentationStage({
|
|
|
1754
1754
|
}));
|
|
1755
1755
|
},
|
|
1756
1756
|
select: (clipId) => {
|
|
1757
|
-
|
|
1757
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().goTo(latest.current.index);
|
|
1758
1758
|
latest.current.onSelect?.(clipId);
|
|
1759
1759
|
},
|
|
1760
1760
|
guides: (guides) => guideLayer.current?.set(guides),
|
|
1761
1761
|
dragging: setDragging,
|
|
1762
1762
|
commit: (clipId, frame, shape) => {
|
|
1763
|
-
const state =
|
|
1763
|
+
const state = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
1764
1764
|
state.goTo(latest.current.index);
|
|
1765
1765
|
if (shape) state.reshapeClip(clipId, frame, shape.rect, shape.aspect);
|
|
1766
1766
|
else state.setFrame(clipId, frame);
|
|
@@ -1772,15 +1772,15 @@ function PresentationStage({
|
|
|
1772
1772
|
() => ({
|
|
1773
1773
|
stageBox: () => stageRef.current?.getBoundingClientRect() ?? null,
|
|
1774
1774
|
select: (boxId) => {
|
|
1775
|
-
|
|
1775
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().goTo(latest.current.index);
|
|
1776
1776
|
latest.current.onSelect?.(boxId);
|
|
1777
1777
|
},
|
|
1778
|
-
commit: (boxId, frame) =>
|
|
1779
|
-
setText: (boxId, text) =>
|
|
1778
|
+
commit: (boxId, frame) => chunk4TTX6ZNS_cjs.usePresentation.getState().updateBox(boxId, (box2) => ({ ...box2, frame })),
|
|
1779
|
+
setText: (boxId, text) => chunk4TTX6ZNS_cjs.usePresentation.getState().setBoxText(boxId, text)
|
|
1780
1780
|
}),
|
|
1781
1781
|
[]
|
|
1782
1782
|
);
|
|
1783
|
-
const font =
|
|
1783
|
+
const font = chunk4TTX6ZNS_cjs.FONTS[theme.font].css;
|
|
1784
1784
|
const boxes = slide?.boxes ?? [];
|
|
1785
1785
|
const selectedBox = selected ? boxes.find((box2) => box2.id === selected) : void 0;
|
|
1786
1786
|
const renderBoxes = (front) => boxes.filter((box2) => !!box2.front === front).map((box2) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -1806,7 +1806,7 @@ function PresentationStage({
|
|
|
1806
1806
|
const item = event.target?.closest?.(
|
|
1807
1807
|
`[data-testid="stage-item-${selected}"]`
|
|
1808
1808
|
);
|
|
1809
|
-
const clip =
|
|
1809
|
+
const clip = chunk4TTX6ZNS_cjs.usePresentation.getState().clips.find((entry) => entry.id === selected);
|
|
1810
1810
|
if (!item || !clip) return;
|
|
1811
1811
|
event.preventDefault();
|
|
1812
1812
|
const box2 = item.getBoundingClientRect();
|
|
@@ -1819,7 +1819,7 @@ function PresentationStage({
|
|
|
1819
1819
|
};
|
|
1820
1820
|
request ??= view.requestAnimationFrame(() => {
|
|
1821
1821
|
request = null;
|
|
1822
|
-
|
|
1822
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().panClip(selected, sum.x, sum.y);
|
|
1823
1823
|
sum = { x: 0, y: 0 };
|
|
1824
1824
|
});
|
|
1825
1825
|
};
|
|
@@ -1848,12 +1848,12 @@ function PresentationStage({
|
|
|
1848
1848
|
width: "min(100cqw, calc(100cqh * 16 / 9))",
|
|
1849
1849
|
height: "min(100cqh, calc(100cqw * 9 / 16))",
|
|
1850
1850
|
containerType: "inline-size",
|
|
1851
|
-
background: slide?.background ?
|
|
1852
|
-
fontFamily:
|
|
1851
|
+
background: slide?.background ? chunk4TTX6ZNS_cjs.slideBackgroundCss(slide.background, media) : chunk4TTX6ZNS_cjs.backgroundCss(theme.background),
|
|
1852
|
+
fontFamily: chunk4TTX6ZNS_cjs.FONTS[theme.font].css
|
|
1853
1853
|
},
|
|
1854
1854
|
onPointerDown: () => {
|
|
1855
1855
|
if (!editable) return;
|
|
1856
|
-
|
|
1856
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().goTo(index);
|
|
1857
1857
|
onSelect?.(null);
|
|
1858
1858
|
},
|
|
1859
1859
|
...editable ? { [DROP_ATTRIBUTE]: "stage", "data-slide-index": index } : {},
|
|
@@ -1883,7 +1883,7 @@ function PresentationStage({
|
|
|
1883
1883
|
editable,
|
|
1884
1884
|
selected: editable && selected === clip.id,
|
|
1885
1885
|
dim: false,
|
|
1886
|
-
label: captions ?
|
|
1886
|
+
label: captions ? chunk4TTX6ZNS_cjs.clipLabel(clip, columnValues) : "",
|
|
1887
1887
|
host
|
|
1888
1888
|
},
|
|
1889
1889
|
clip.id
|
|
@@ -1939,20 +1939,20 @@ var SlideCard = react.memo(function SlideCard2({
|
|
|
1939
1939
|
onEditImage,
|
|
1940
1940
|
onCropImage
|
|
1941
1941
|
}) {
|
|
1942
|
-
const empty =
|
|
1942
|
+
const empty = chunk4TTX6ZNS_cjs.usePresentation((s) => {
|
|
1943
1943
|
const slide = s.slides[index];
|
|
1944
1944
|
return !!slide && !slide.items.length && !slide.boxes.length && slide.layout !== "title" && slide.layout !== "section";
|
|
1945
1945
|
});
|
|
1946
|
-
const notes =
|
|
1946
|
+
const notes = chunk4TTX6ZNS_cjs.usePresentation((s) => s.slides[index]?.notes ?? "");
|
|
1947
1947
|
const textEditing = react.useMemo(
|
|
1948
1948
|
() => ({
|
|
1949
|
-
onTitle: (title) =>
|
|
1950
|
-
onPoints: (points) =>
|
|
1949
|
+
onTitle: (title) => chunk4TTX6ZNS_cjs.usePresentation.getState().setSlideCaption(title, index),
|
|
1950
|
+
onPoints: (points) => chunk4TTX6ZNS_cjs.usePresentation.getState().setSlidePoints(points, index)
|
|
1951
1951
|
}),
|
|
1952
1952
|
[index]
|
|
1953
1953
|
);
|
|
1954
1954
|
const select = react.useCallback((clipId) => onSelect(index, clipId), [onSelect, index]);
|
|
1955
|
-
const actions =
|
|
1955
|
+
const actions = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
1956
1956
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "group relative flex gap-2", "data-testid": `slide-${index}`, children: [
|
|
1957
1957
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex w-9 shrink-0 flex-col items-center gap-0.5", children: [
|
|
1958
1958
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -2027,7 +2027,7 @@ var SlideCard = react.memo(function SlideCard2({
|
|
|
2027
2027
|
value: notes,
|
|
2028
2028
|
rows: notes.split("\n").length,
|
|
2029
2029
|
placeholder: "Speaker notes",
|
|
2030
|
-
onChange: (event) =>
|
|
2030
|
+
onChange: (event) => chunk4TTX6ZNS_cjs.usePresentation.getState().setSlideNotes(event.target.value, index),
|
|
2031
2031
|
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",
|
|
2032
2032
|
"aria-label": `Speaker notes for slide ${index + 1}`,
|
|
2033
2033
|
"data-testid": `slide-notes-${index}`
|
|
@@ -2051,10 +2051,10 @@ var INSERTS = [
|
|
|
2051
2051
|
];
|
|
2052
2052
|
function InsertMenu({ onInserted }) {
|
|
2053
2053
|
const insert = (shape) => {
|
|
2054
|
-
const state =
|
|
2054
|
+
const state = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
2055
2055
|
const slide = state.slides[state.current];
|
|
2056
|
-
const box2 =
|
|
2057
|
-
const dark =
|
|
2056
|
+
const box2 = chunk4TTX6ZNS_cjs.newBox(shape, chunk4TTX6ZNS_cjs.accentColor(state.theme.accent));
|
|
2057
|
+
const dark = chunk4TTX6ZNS_cjs.isLightBackground(slide?.background);
|
|
2058
2058
|
const { id, ...rest } = dark ? {
|
|
2059
2059
|
...box2,
|
|
2060
2060
|
paragraphs: box2.paragraphs.map((p) => ({
|
|
@@ -2097,7 +2097,7 @@ function InsertSlide({ after, always }) {
|
|
|
2097
2097
|
"button",
|
|
2098
2098
|
{
|
|
2099
2099
|
type: "button",
|
|
2100
|
-
onClick: () =>
|
|
2100
|
+
onClick: () => chunk4TTX6ZNS_cjs.usePresentation.getState().addSlide(void 0, after),
|
|
2101
2101
|
className: ui.cn(
|
|
2102
2102
|
"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",
|
|
2103
2103
|
!always && "opacity-0 group-hover/insert:opacity-100 pointer-coarse:opacity-100"
|
|
@@ -2120,10 +2120,11 @@ function SlidesEditor({
|
|
|
2120
2120
|
onEditImage,
|
|
2121
2121
|
onCropImage
|
|
2122
2122
|
}) {
|
|
2123
|
-
const ids =
|
|
2123
|
+
const ids = chunk4TTX6ZNS_cjs.usePresentation((s) => s.slides.map((slide) => slide.id).join(" "));
|
|
2124
2124
|
const slideIds = react.useMemo(() => ids.split(" "), [ids]);
|
|
2125
|
-
const current2 =
|
|
2126
|
-
const captions =
|
|
2125
|
+
const current2 = chunk4TTX6ZNS_cjs.usePresentation((s) => s.current);
|
|
2126
|
+
const captions = chunk4TTX6ZNS_cjs.usePresentation((s) => s.captions);
|
|
2127
|
+
const presenting = chunk4TTX6ZNS_cjs.usePresentation((s) => s.presenting);
|
|
2127
2128
|
const [selection, setSelection] = react.useState(null);
|
|
2128
2129
|
const [view, setView] = react.useState(null);
|
|
2129
2130
|
const list = react.useRef(null);
|
|
@@ -2137,7 +2138,7 @@ function SlidesEditor({
|
|
|
2137
2138
|
() => ({ clipId: selection?.clipId ?? null, clear: () => setSelection(null) }),
|
|
2138
2139
|
[selection]
|
|
2139
2140
|
);
|
|
2140
|
-
|
|
2141
|
+
chunkWFMWKPGY_cjs.usePresenterKeys(view, false, keySelection);
|
|
2141
2142
|
react.useEffect(() => {
|
|
2142
2143
|
const card = list.current?.querySelector(`[data-testid="slide-${current2}"]`);
|
|
2143
2144
|
card?.scrollIntoView?.({ block: "nearest", behavior: "smooth" });
|
|
@@ -2193,13 +2194,28 @@ function SlidesEditor({
|
|
|
2193
2194
|
ui.DropdownMenuCheckboxItem,
|
|
2194
2195
|
{
|
|
2195
2196
|
checked: captions,
|
|
2196
|
-
onCheckedChange: (on) =>
|
|
2197
|
+
onCheckedChange: (on) => chunk4TTX6ZNS_cjs.usePresentation.getState().setCaptions(!!on),
|
|
2197
2198
|
children: "Show source labels"
|
|
2198
2199
|
}
|
|
2199
2200
|
)
|
|
2200
2201
|
] })
|
|
2201
2202
|
] }),
|
|
2202
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
2203
|
+
presenting ? /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2204
|
+
ui.Button,
|
|
2205
|
+
{
|
|
2206
|
+
type: "button",
|
|
2207
|
+
size: "sm",
|
|
2208
|
+
variant: "destructive",
|
|
2209
|
+
className: "ml-0.5 h-8 rounded-full",
|
|
2210
|
+
onClick: () => chunk4TTX6ZNS_cjs.usePresentation.getState().setPresenting(false),
|
|
2211
|
+
title: "Stop presenting (the presentation window closes)",
|
|
2212
|
+
"data-testid": "presentation-stop-button",
|
|
2213
|
+
children: [
|
|
2214
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "size-3 fill-current" }),
|
|
2215
|
+
"Stop presenting"
|
|
2216
|
+
]
|
|
2217
|
+
}
|
|
2218
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2203
2219
|
ui.Button,
|
|
2204
2220
|
{
|
|
2205
2221
|
type: "button",
|
|
@@ -2230,7 +2246,7 @@ function SlidesEditor({
|
|
|
2230
2246
|
// src/presentation/draw-boxes.ts
|
|
2231
2247
|
var LINE_HEIGHT = 1.2;
|
|
2232
2248
|
function fontOf(run, themeFont, width) {
|
|
2233
|
-
const size =
|
|
2249
|
+
const size = chunk4TTX6ZNS_cjs.pointsToStage(run.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE) * width;
|
|
2234
2250
|
const family = run.font ? `"${run.font}", ${themeFont}` : themeFont;
|
|
2235
2251
|
return `${run.italic ? "italic " : ""}${run.bold ? 700 : 400} ${size}px ${family}`;
|
|
2236
2252
|
}
|
|
@@ -2248,9 +2264,9 @@ function drawBox(context, box2, width, height, themeFont) {
|
|
|
2248
2264
|
context.translate(frame.x * width + w / 2, frame.y * height + h / 2);
|
|
2249
2265
|
if (box2.rotation) context.rotate(box2.rotation * Math.PI / 180);
|
|
2250
2266
|
context.translate(-w / 2, -h / 2);
|
|
2251
|
-
const lineWidth = box2.line ? Math.max(1,
|
|
2267
|
+
const lineWidth = box2.line ? Math.max(1, chunk4TTX6ZNS_cjs.pointsToStage(box2.line.width) * width) : 0;
|
|
2252
2268
|
if (box2.shape === "line") {
|
|
2253
|
-
context.strokeStyle = box2.line?.color ??
|
|
2269
|
+
context.strokeStyle = box2.line?.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body;
|
|
2254
2270
|
context.lineWidth = lineWidth || 1;
|
|
2255
2271
|
if (box2.line?.dash) context.setLineDash([lineWidth * 3, lineWidth * 2]);
|
|
2256
2272
|
context.beginPath();
|
|
@@ -2275,12 +2291,12 @@ function drawBox(context, box2, width, height, themeFont) {
|
|
|
2275
2291
|
context.stroke();
|
|
2276
2292
|
context.setLineDash([]);
|
|
2277
2293
|
}
|
|
2278
|
-
const inset =
|
|
2294
|
+
const inset = chunk4TTX6ZNS_cjs.pointsToStage(box2.inset ?? chunk4TTX6ZNS_cjs.DEFAULT_INSET) * width;
|
|
2279
2295
|
const room = w - 2 * inset;
|
|
2280
2296
|
context.textBaseline = "alphabetic";
|
|
2281
2297
|
const lines = [];
|
|
2282
2298
|
for (const paragraph of box2.paragraphs) {
|
|
2283
|
-
const size =
|
|
2299
|
+
const size = chunk4TTX6ZNS_cjs.pointsToStage(paragraph.runs[0]?.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE) * width;
|
|
2284
2300
|
const indent = (paragraph.level ?? 0) * 0.5 * size + (paragraph.bullet ? size * 0.9 : 0);
|
|
2285
2301
|
const words = [];
|
|
2286
2302
|
for (const run of paragraph.runs) {
|
|
@@ -2326,12 +2342,12 @@ function drawBox(context, box2, width, height, themeFont) {
|
|
|
2326
2342
|
const baseline = y + line.size * (LINE_HEIGHT - 0.2);
|
|
2327
2343
|
if (line.bullet) {
|
|
2328
2344
|
context.font = fontOf(line.bullet, themeFont, width);
|
|
2329
|
-
context.fillStyle = line.bullet.color ??
|
|
2345
|
+
context.fillStyle = line.bullet.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body;
|
|
2330
2346
|
context.fillText("\u2022", inset + line.indent - line.size * 0.9, baseline);
|
|
2331
2347
|
}
|
|
2332
2348
|
for (const piece of line.pieces) {
|
|
2333
2349
|
context.font = fontOf(piece.run, themeFont, width);
|
|
2334
|
-
context.fillStyle = piece.run.color ??
|
|
2350
|
+
context.fillStyle = piece.run.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body;
|
|
2335
2351
|
context.fillText(piece.text, x, baseline);
|
|
2336
2352
|
if (piece.run.underline) {
|
|
2337
2353
|
context.fillRect(x, baseline + line.size * 0.08, piece.width, Math.max(1, line.size * 0.05));
|
|
@@ -2348,7 +2364,7 @@ var boxWords = (box2) => box2.paragraphs.map(
|
|
|
2348
2364
|
).filter(Boolean);
|
|
2349
2365
|
|
|
2350
2366
|
// src/presentation/render-slides.ts
|
|
2351
|
-
var SLIDE_PIXELS = { width: 1920, height: Math.round(1920 /
|
|
2367
|
+
var SLIDE_PIXELS = { width: 1920, height: Math.round(1920 / chunk4TTX6ZNS_cjs.STAGE_ASPECT) };
|
|
2352
2368
|
async function videoFrame(source, seconds) {
|
|
2353
2369
|
const video = document.createElement("video");
|
|
2354
2370
|
video.muted = true;
|
|
@@ -2460,7 +2476,7 @@ async function drawRoundedClip(context, clip, box2, stageWidth, shadow = true) {
|
|
|
2460
2476
|
outline2();
|
|
2461
2477
|
context.clip();
|
|
2462
2478
|
await drawClip(context, clip, box2);
|
|
2463
|
-
if (clip.kind === "pdf")
|
|
2479
|
+
if (clip.kind === "pdf") chunk4TTX6ZNS_cjs.paintClipEdge(context, box2, stageWidth);
|
|
2464
2480
|
context.restore();
|
|
2465
2481
|
context.save();
|
|
2466
2482
|
context.strokeStyle = "rgba(255,255,255,0.15)";
|
|
@@ -2492,7 +2508,7 @@ function wrapLines(context, text, width, max) {
|
|
|
2492
2508
|
function drawText(context, box2, lines, theme, width, height) {
|
|
2493
2509
|
const size = box2.size * width;
|
|
2494
2510
|
const lineHeight = size * box2.leading;
|
|
2495
|
-
context.font = `${box2.weight} ${size}px ${
|
|
2511
|
+
context.font = `${box2.weight} ${size}px ${chunk4TTX6ZNS_cjs.FONTS[theme.font].css}`;
|
|
2496
2512
|
context.textBaseline = "top";
|
|
2497
2513
|
const indent = box2.bullets ? size * 1.22 : 0;
|
|
2498
2514
|
const left = box2.x * width;
|
|
@@ -2514,10 +2530,10 @@ function drawText(context, box2, lines, theme, width, height) {
|
|
|
2514
2530
|
for (const wrapped of paragraphs) {
|
|
2515
2531
|
if (box2.bullets) {
|
|
2516
2532
|
const square = size * 0.42;
|
|
2517
|
-
context.fillStyle =
|
|
2533
|
+
context.fillStyle = chunk4TTX6ZNS_cjs.accentColor(theme.accent);
|
|
2518
2534
|
context.fillRect(left, y + size * 0.5 - square / 2, square, square);
|
|
2519
2535
|
}
|
|
2520
|
-
context.fillStyle =
|
|
2536
|
+
context.fillStyle = chunk4TTX6ZNS_cjs.TEXT_COLORS[box2.tone];
|
|
2521
2537
|
context.textAlign = box2.align === "center" ? "center" : "left";
|
|
2522
2538
|
for (const line of wrapped) {
|
|
2523
2539
|
const x = box2.align === "center" ? left + box2.w * width / 2 : left + indent;
|
|
@@ -2553,11 +2569,11 @@ async function loadImage(file) {
|
|
|
2553
2569
|
}
|
|
2554
2570
|
}
|
|
2555
2571
|
function slideWords(slide) {
|
|
2556
|
-
const own = slide.layout === "free" ? [] : [slide.caption.trim(), ...
|
|
2572
|
+
const own = slide.layout === "free" ? [] : [slide.caption.trim(), ...chunk4TTX6ZNS_cjs.textLines(slide.points)];
|
|
2557
2573
|
return [...own, ...slide.boxes.flatMap(boxWords)].filter(Boolean);
|
|
2558
2574
|
}
|
|
2559
2575
|
function drawSlideText(context, slide, look, width, height) {
|
|
2560
|
-
const geometry =
|
|
2576
|
+
const geometry = chunk4TTX6ZNS_cjs.slideGeometry(slide, {
|
|
2561
2577
|
labels: look.labels,
|
|
2562
2578
|
logo: look.theme.logo?.corner ?? null
|
|
2563
2579
|
});
|
|
@@ -2565,13 +2581,13 @@ function drawSlideText(context, slide, look, width, height) {
|
|
|
2565
2581
|
if (title && geometry.title) {
|
|
2566
2582
|
drawText(context, geometry.title, [title], look.theme, width, height);
|
|
2567
2583
|
if (geometry.rule) {
|
|
2568
|
-
context.fillStyle =
|
|
2584
|
+
context.fillStyle = chunk4TTX6ZNS_cjs.accentColor(look.theme.accent);
|
|
2569
2585
|
const r = geometry.rule;
|
|
2570
2586
|
context.fillRect(r.x * width, r.y * height, r.w * width, r.h * height);
|
|
2571
2587
|
}
|
|
2572
2588
|
}
|
|
2573
2589
|
if (geometry.text) {
|
|
2574
|
-
drawText(context, geometry.text,
|
|
2590
|
+
drawText(context, geometry.text, chunk4TTX6ZNS_cjs.textLines(slide.points), look.theme, width, height);
|
|
2575
2591
|
}
|
|
2576
2592
|
return geometry;
|
|
2577
2593
|
}
|
|
@@ -2583,13 +2599,13 @@ async function renderSlide(slide, clips, look) {
|
|
|
2583
2599
|
const context = canvas.getContext("2d");
|
|
2584
2600
|
if (!context) throw new Error("Could not draw the slides");
|
|
2585
2601
|
if (slide.background) {
|
|
2586
|
-
await
|
|
2602
|
+
await chunk4TTX6ZNS_cjs.paintSlideBackground(context, width, height, slide.background, look.media);
|
|
2587
2603
|
} else {
|
|
2588
|
-
|
|
2604
|
+
chunk4TTX6ZNS_cjs.paintBackground(context, width, height, look.theme.background);
|
|
2589
2605
|
}
|
|
2590
2606
|
const geometry = drawSlideText(context, slide, look, width, height);
|
|
2591
2607
|
const text = slideWords(slide);
|
|
2592
|
-
const font =
|
|
2608
|
+
const font = chunk4TTX6ZNS_cjs.FONTS[look.theme.font].css;
|
|
2593
2609
|
const drawBoxes = (front) => {
|
|
2594
2610
|
for (const box2 of slide.boxes) {
|
|
2595
2611
|
if (!!box2.front === front) drawBox(context, box2, width, height, font);
|
|
@@ -2603,16 +2619,16 @@ async function renderSlide(slide, clips, look) {
|
|
|
2603
2619
|
x: item.frame.x * width,
|
|
2604
2620
|
y: item.frame.y * height,
|
|
2605
2621
|
width: item.frame.w * width,
|
|
2606
|
-
height:
|
|
2622
|
+
height: chunk4TTX6ZNS_cjs.frameHeight(item.frame, clip.aspect) * height
|
|
2607
2623
|
};
|
|
2608
2624
|
if (clip.plain) {
|
|
2609
2625
|
await drawClip(context, clip, box2);
|
|
2610
2626
|
continue;
|
|
2611
2627
|
}
|
|
2612
2628
|
await drawRoundedClip(context, clip, box2, width);
|
|
2613
|
-
const label =
|
|
2629
|
+
const label = chunk4TTX6ZNS_cjs.clipLabel(clip, look.columnValues);
|
|
2614
2630
|
if (look.labels && label) {
|
|
2615
|
-
context.fillStyle =
|
|
2631
|
+
context.fillStyle = chunk4TTX6ZNS_cjs.TEXT_COLORS.muted;
|
|
2616
2632
|
context.font = `${Math.round(width * 0.017)}px ${font}`;
|
|
2617
2633
|
context.textAlign = "left";
|
|
2618
2634
|
context.textBaseline = "top";
|
|
@@ -2655,7 +2671,7 @@ function addBox(pptx, page, box2, themeFont) {
|
|
|
2655
2671
|
if (box2.shape === "line") {
|
|
2656
2672
|
page.addShape(pptx.ShapeType.line, {
|
|
2657
2673
|
...place,
|
|
2658
|
-
line: line ?? { color: hex(
|
|
2674
|
+
line: line ?? { color: hex(chunk4TTX6ZNS_cjs.TEXT_COLORS.body), width: 1 }
|
|
2659
2675
|
});
|
|
2660
2676
|
return;
|
|
2661
2677
|
}
|
|
@@ -2672,9 +2688,9 @@ function addBox(pptx, page, box2, themeFont) {
|
|
|
2672
2688
|
runs.push({
|
|
2673
2689
|
text: run.text,
|
|
2674
2690
|
options: {
|
|
2675
|
-
fontSize: run.size ??
|
|
2691
|
+
fontSize: run.size ?? chunk4TTX6ZNS_cjs.DEFAULT_TEXT_SIZE,
|
|
2676
2692
|
fontFace: run.font ?? themeFont,
|
|
2677
|
-
color: hex(run.color ??
|
|
2693
|
+
color: hex(run.color ?? chunk4TTX6ZNS_cjs.TEXT_COLORS.body),
|
|
2678
2694
|
...run.bold ? { bold: true } : {},
|
|
2679
2695
|
...run.italic ? { italic: true } : {},
|
|
2680
2696
|
...run.underline ? { underline: { style: "sng" } } : {},
|
|
@@ -2696,7 +2712,7 @@ function addBox(pptx, page, box2, themeFont) {
|
|
|
2696
2712
|
// Its part in the slide (its title, its body), kept by name: read back when imported.
|
|
2697
2713
|
...box2.role ? { objectName: `ARBI ${box2.role}` } : {},
|
|
2698
2714
|
valign: box2.anchor ?? "top",
|
|
2699
|
-
margin: box2.inset ??
|
|
2715
|
+
margin: box2.inset ?? chunk4TTX6ZNS_cjs.DEFAULT_INSET,
|
|
2700
2716
|
lineSpacingMultiple: 1,
|
|
2701
2717
|
fit: "none"
|
|
2702
2718
|
});
|
|
@@ -2726,10 +2742,10 @@ var box = (b) => ({
|
|
|
2726
2742
|
function textOptions(text, look) {
|
|
2727
2743
|
return {
|
|
2728
2744
|
...box(text),
|
|
2729
|
-
fontFace:
|
|
2745
|
+
fontFace: chunk4TTX6ZNS_cjs.FONTS[look.theme.font].pptx,
|
|
2730
2746
|
fontSize: toPoints(text.size),
|
|
2731
2747
|
bold: text.weight >= 600,
|
|
2732
|
-
color: hex2(
|
|
2748
|
+
color: hex2(chunk4TTX6ZNS_cjs.TEXT_COLORS[text.tone]),
|
|
2733
2749
|
align: text.align,
|
|
2734
2750
|
valign: text.anchor ?? "top",
|
|
2735
2751
|
lineSpacingMultiple: text.leading,
|
|
@@ -2742,18 +2758,18 @@ async function buildPptx(deck, look) {
|
|
|
2742
2758
|
pptx.layout = "LAYOUT_WIDE";
|
|
2743
2759
|
pptx.title = deck.title;
|
|
2744
2760
|
pptx.theme = {
|
|
2745
|
-
headFontFace:
|
|
2746
|
-
bodyFontFace:
|
|
2761
|
+
headFontFace: chunk4TTX6ZNS_cjs.FONTS[look.theme.font].pptx,
|
|
2762
|
+
bodyFontFace: chunk4TTX6ZNS_cjs.FONTS[look.theme.font].pptx
|
|
2747
2763
|
};
|
|
2748
2764
|
const { width, height } = SLIDE_PIXELS;
|
|
2749
2765
|
const background = await canvasImage(
|
|
2750
2766
|
width,
|
|
2751
2767
|
height,
|
|
2752
|
-
(context) =>
|
|
2768
|
+
(context) => chunk4TTX6ZNS_cjs.paintBackground(context, width, height, look.theme.background)
|
|
2753
2769
|
);
|
|
2754
2770
|
const logo = look.logo ? await loadImage(look.logo) : null;
|
|
2755
2771
|
const logoData = logo ? await canvasImage(logo.width, logo.height, (context) => context.drawImage(logo, 0, 0)) : null;
|
|
2756
|
-
const themeFont =
|
|
2772
|
+
const themeFont = chunk4TTX6ZNS_cjs.FONTS[look.theme.font].pptx;
|
|
2757
2773
|
for (const slide of deck.slides) {
|
|
2758
2774
|
const page = pptx.addSlide();
|
|
2759
2775
|
if (slide.background?.color && !slide.background.gradient && !slide.background.image) {
|
|
@@ -2764,14 +2780,14 @@ async function buildPptx(deck, look) {
|
|
|
2764
2780
|
data: await canvasImage(
|
|
2765
2781
|
width,
|
|
2766
2782
|
height,
|
|
2767
|
-
(context) =>
|
|
2783
|
+
(context) => chunk4TTX6ZNS_cjs.paintSlideBackground(context, width, height, own, look.media)
|
|
2768
2784
|
)
|
|
2769
2785
|
};
|
|
2770
2786
|
} else {
|
|
2771
2787
|
page.background = { data: background };
|
|
2772
2788
|
}
|
|
2773
2789
|
if (slide.notes?.trim()) page.addNotes(slide.notes);
|
|
2774
|
-
const geometry =
|
|
2790
|
+
const geometry = chunk4TTX6ZNS_cjs.slideGeometry(slide, {
|
|
2775
2791
|
labels: look.labels,
|
|
2776
2792
|
logo: look.theme.logo?.corner ?? null
|
|
2777
2793
|
});
|
|
@@ -2779,7 +2795,7 @@ async function buildPptx(deck, look) {
|
|
|
2779
2795
|
for (const item of slide.items) {
|
|
2780
2796
|
const clip = deck.clips.find((entry) => entry.id === item.clipId);
|
|
2781
2797
|
if (!clip) continue;
|
|
2782
|
-
const frame = { ...item.frame, h:
|
|
2798
|
+
const frame = { ...item.frame, h: chunk4TTX6ZNS_cjs.frameHeight(item.frame, clip.aspect) };
|
|
2783
2799
|
if (clip.plain) {
|
|
2784
2800
|
const source = clip.kind === "image" ? await createImageBitmap(clip.source) : null;
|
|
2785
2801
|
const scale = source ? Math.min(1, 2400 / Math.max(1, clip.rect.w * source.width)) : 1.5;
|
|
@@ -2811,13 +2827,13 @@ async function buildPptx(deck, look) {
|
|
|
2811
2827
|
altText: clip.caption,
|
|
2812
2828
|
shadow: { type: "outer", blur: 10, offset: 3, angle: 90, color: "000000", opacity: 0.45 }
|
|
2813
2829
|
});
|
|
2814
|
-
const label =
|
|
2830
|
+
const label = chunk4TTX6ZNS_cjs.clipLabel(clip, look.columnValues);
|
|
2815
2831
|
if (look.labels && label) {
|
|
2816
2832
|
page.addText(label, {
|
|
2817
2833
|
...box({ x: frame.x, y: frame.y + frame.h + 8e-3, w: frame.w, h: 0.045 }),
|
|
2818
|
-
fontFace:
|
|
2834
|
+
fontFace: chunk4TTX6ZNS_cjs.FONTS[look.theme.font].pptx,
|
|
2819
2835
|
fontSize: toPoints(0.017),
|
|
2820
|
-
color: hex2(
|
|
2836
|
+
color: hex2(chunk4TTX6ZNS_cjs.TEXT_COLORS.muted),
|
|
2821
2837
|
margin: 0,
|
|
2822
2838
|
valign: "top",
|
|
2823
2839
|
fit: "shrink"
|
|
@@ -2830,12 +2846,12 @@ async function buildPptx(deck, look) {
|
|
|
2830
2846
|
if (geometry.rule) {
|
|
2831
2847
|
page.addShape(pptx.ShapeType.rect, {
|
|
2832
2848
|
...box(geometry.rule),
|
|
2833
|
-
fill: { color: hex2(
|
|
2834
|
-
line: { color: hex2(
|
|
2849
|
+
fill: { color: hex2(chunk4TTX6ZNS_cjs.accentColor(look.theme.accent)) },
|
|
2850
|
+
line: { color: hex2(chunk4TTX6ZNS_cjs.accentColor(look.theme.accent)), width: 0 }
|
|
2835
2851
|
});
|
|
2836
2852
|
}
|
|
2837
2853
|
}
|
|
2838
|
-
const lines =
|
|
2854
|
+
const lines = chunk4TTX6ZNS_cjs.textLines(slide.points);
|
|
2839
2855
|
if (geometry.text && lines.length) {
|
|
2840
2856
|
const text = geometry.text;
|
|
2841
2857
|
page.addText(
|
|
@@ -2869,7 +2885,7 @@ async function buildPptx(deck, look) {
|
|
|
2869
2885
|
}
|
|
2870
2886
|
}
|
|
2871
2887
|
const deckFile = await pptx.write({ outputType: "blob" });
|
|
2872
|
-
return accentBullets(deckFile,
|
|
2888
|
+
return accentBullets(deckFile, chunk4TTX6ZNS_cjs.accentColor(look.theme.accent));
|
|
2873
2889
|
}
|
|
2874
2890
|
async function accentBullets(deck, accent) {
|
|
2875
2891
|
const { default: JSZip } = await import('jszip');
|
|
@@ -3400,7 +3416,7 @@ function renditionClip(deck, part, area, what) {
|
|
|
3400
3416
|
fileName: fileName ?? "Presentation.pptx",
|
|
3401
3417
|
page: part.page,
|
|
3402
3418
|
rect,
|
|
3403
|
-
aspect: frame.w *
|
|
3419
|
+
aspect: frame.w * chunk4TTX6ZNS_cjs.STAGE_ASPECT / Math.max(frame.h, 1e-6),
|
|
3404
3420
|
caption: "",
|
|
3405
3421
|
plain: true
|
|
3406
3422
|
});
|
|
@@ -3539,7 +3555,7 @@ async function readShape(shape, transform, deck, part, inherit, built) {
|
|
|
3539
3555
|
fileName: target?.target.split("/").pop() ?? "Picture",
|
|
3540
3556
|
page: 1,
|
|
3541
3557
|
rect,
|
|
3542
|
-
aspect: frame.w *
|
|
3558
|
+
aspect: frame.w * chunk4TTX6ZNS_cjs.STAGE_ASPECT / Math.max(frame.h, 1e-6),
|
|
3543
3559
|
caption: "",
|
|
3544
3560
|
media: key,
|
|
3545
3561
|
plain: true
|
|
@@ -3762,7 +3778,7 @@ async function importPptx(bytes, options = {}) {
|
|
|
3762
3778
|
const cx = numAttr(size, "cx", 12192e3);
|
|
3763
3779
|
const cy = numAttr(size, "cy", 6858e3);
|
|
3764
3780
|
const deckAspect = cx / cy;
|
|
3765
|
-
const place = deckAspect <
|
|
3781
|
+
const place = deckAspect < chunk4TTX6ZNS_cjs.STAGE_ASPECT ? { w: deckAspect / chunk4TTX6ZNS_cjs.STAGE_ASPECT, h: 1, x: (1 - deckAspect / chunk4TTX6ZNS_cjs.STAGE_ASPECT) / 2, y: 0 } : { w: 1, h: chunk4TTX6ZNS_cjs.STAGE_ASPECT / deckAspect, x: 0, y: (1 - chunk4TTX6ZNS_cjs.STAGE_ASPECT / deckAspect) / 2 };
|
|
3766
3782
|
const slides = await slideParts(pkg);
|
|
3767
3783
|
const firstLayout = slides.length ? await pkg.related(slides[0].part, "/slideLayout") : null;
|
|
3768
3784
|
const firstMaster = firstLayout ? await pkg.related(firstLayout, "/slideMaster") : null;
|
|
@@ -3771,7 +3787,7 @@ async function importPptx(bytes, options = {}) {
|
|
|
3771
3787
|
theme: firstMaster ? await readTheme(pkg, firstMaster) : { scheme: {}, map: {}, majorFont: "Calibri", minorFont: "Calibri", lineWidths: [] },
|
|
3772
3788
|
slideSize: { cx, cy },
|
|
3773
3789
|
place,
|
|
3774
|
-
pointScale:
|
|
3790
|
+
pointScale: chunk4TTX6ZNS_cjs.SLIDE_POINTS.h * place.h / (cy / EMU_PER_POINT),
|
|
3775
3791
|
defaultText: kid(pres.documentElement, "defaultTextStyle"),
|
|
3776
3792
|
options,
|
|
3777
3793
|
clips: [],
|
|
@@ -3867,7 +3883,7 @@ async function importPptx(bytes, options = {}) {
|
|
|
3867
3883
|
version: 1,
|
|
3868
3884
|
title: options.title ?? (coreTitle?.trim() || "Presentation"),
|
|
3869
3885
|
captions: false,
|
|
3870
|
-
theme:
|
|
3886
|
+
theme: chunk4TTX6ZNS_cjs.DEFAULT_THEME,
|
|
3871
3887
|
clips: deck.clips,
|
|
3872
3888
|
slides: saved,
|
|
3873
3889
|
...Object.keys(deck.media).length ? { media: deck.media } : {}
|
|
@@ -3955,7 +3971,7 @@ async function presentationData(bytes) {
|
|
|
3955
3971
|
if (isZipBytes(bytes)) return readPptxPresentationData(bytes);
|
|
3956
3972
|
const isPdf = bytes[0] === 37 && bytes[1] === 80 && bytes[2] === 68 && bytes[3] === 70;
|
|
3957
3973
|
if (!isPdf) return new TextDecoder().decode(bytes);
|
|
3958
|
-
const data = await documentTools.readPdfAttachment(bytes,
|
|
3974
|
+
const data = await documentTools.readPdfAttachment(bytes, chunk4TTX6ZNS_cjs.PRESENTATION_ATTACHMENT);
|
|
3959
3975
|
if (!data) {
|
|
3960
3976
|
throw new Error(
|
|
3961
3977
|
"This PDF has no editable presentation in it (it may have been changed outside ARBI)."
|
|
@@ -3964,7 +3980,7 @@ async function presentationData(bytes) {
|
|
|
3964
3980
|
return new TextDecoder().decode(data);
|
|
3965
3981
|
}
|
|
3966
3982
|
function current(withoutClips) {
|
|
3967
|
-
const state =
|
|
3983
|
+
const state = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
3968
3984
|
return withoutClips ? {
|
|
3969
3985
|
...state,
|
|
3970
3986
|
clips: [],
|
|
@@ -3986,18 +4002,18 @@ function usePresentationFiles() {
|
|
|
3986
4002
|
const state = current(withoutClips);
|
|
3987
4003
|
const deck = await buildPptx({ title, slides: state.slides, clips: state.clips }, lookOf(state));
|
|
3988
4004
|
const fingerprints = await slideFingerprints(deck);
|
|
3989
|
-
const data =
|
|
4005
|
+
const data = chunk4TTX6ZNS_cjs.serializePresentation({ ...state, title, fingerprints });
|
|
3990
4006
|
return writePptxPresentationData(deck, JSON.stringify(data, null, 2));
|
|
3991
4007
|
}, []);
|
|
3992
4008
|
const save = react.useCallback(
|
|
3993
4009
|
async (title, { asNew = false, template = false } = {}) => {
|
|
3994
4010
|
if (!arbi || !workspaceId) throw new Error("Open a workspace to save the presentation.");
|
|
3995
|
-
const state =
|
|
4011
|
+
const state = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
3996
4012
|
const versionOf = asNew || template ? null : state.savedId;
|
|
3997
4013
|
const deck = await buildFile(title, template);
|
|
3998
|
-
const file = new File([deck],
|
|
4014
|
+
const file = new File([deck], chunk4TTX6ZNS_cjs.presentationFileName(title), { type: PPTX_TYPE });
|
|
3999
4015
|
const result = await arbi.documents.upload([file], {
|
|
4000
|
-
folder: template ?
|
|
4016
|
+
folder: template ? chunk4TTX6ZNS_cjs.TEMPLATES_FOLDER : chunk4TTX6ZNS_cjs.PRESENTATIONS_FOLDER,
|
|
4001
4017
|
workspaceExtId: workspaceId,
|
|
4002
4018
|
...versionOf ? { versionOf } : {}
|
|
4003
4019
|
});
|
|
@@ -4022,8 +4038,8 @@ function usePresentationFiles() {
|
|
|
4022
4038
|
}
|
|
4023
4039
|
const pdf = await documentTools.imagesToPdf(pages, { title });
|
|
4024
4040
|
const result = await arbi.documents.upload(
|
|
4025
|
-
[new File([pdf], `${
|
|
4026
|
-
{ folder:
|
|
4041
|
+
[new File([pdf], `${chunk4TTX6ZNS_cjs.safeFileStem(title)}.pdf`, { type: "application/pdf" })],
|
|
4042
|
+
{ folder: chunk4TTX6ZNS_cjs.EXPORTS_FOLDER, workspaceExtId: workspaceId }
|
|
4027
4043
|
);
|
|
4028
4044
|
const id = result.doc_ext_ids?.[0];
|
|
4029
4045
|
if (!id) throw new Error("The PDF could not be saved.");
|
|
@@ -4038,10 +4054,10 @@ function usePresentationFiles() {
|
|
|
4038
4054
|
return docs.filter((doc) => {
|
|
4039
4055
|
const folder = doc.folder ?? "";
|
|
4040
4056
|
if (!ui.isPresentationFileName(doc.file_name, folder)) return false;
|
|
4041
|
-
return scope === "templates" ? folder ===
|
|
4057
|
+
return scope === "templates" ? folder === chunk4TTX6ZNS_cjs.TEMPLATES_FOLDER : folder.startsWith(chunk4TTX6ZNS_cjs.PRESENTATIONS_FOLDER) && folder !== chunk4TTX6ZNS_cjs.TEMPLATES_FOLDER && !folder.startsWith(chunk4TTX6ZNS_cjs.EXPORTS_FOLDER);
|
|
4042
4058
|
}).map((doc) => ({
|
|
4043
4059
|
id: doc.external_id,
|
|
4044
|
-
title:
|
|
4060
|
+
title: chunk4TTX6ZNS_cjs.presentationTitle(doc.file_name ?? ""),
|
|
4045
4061
|
updatedAt: doc.updated_at ?? doc.created_at ?? null
|
|
4046
4062
|
})).sort((a, b) => (a.updatedAt ?? "") < (b.updatedAt ?? "") ? 1 : -1);
|
|
4047
4063
|
},
|
|
@@ -4057,7 +4073,7 @@ function usePresentationFiles() {
|
|
|
4057
4073
|
const openedVersion = version ?? doc?.current_version ?? null;
|
|
4058
4074
|
if (text === null) {
|
|
4059
4075
|
const imported = await importPptx(bytes, {
|
|
4060
|
-
title:
|
|
4076
|
+
title: chunk4TTX6ZNS_cjs.presentationTitle(doc?.file_name ?? "Presentation.pptx"),
|
|
4061
4077
|
documentId: id,
|
|
4062
4078
|
version: version ?? doc?.current_version,
|
|
4063
4079
|
fileName: doc?.file_name ?? void 0
|
|
@@ -4069,7 +4085,7 @@ function usePresentationFiles() {
|
|
|
4069
4085
|
openedVersion
|
|
4070
4086
|
};
|
|
4071
4087
|
}
|
|
4072
|
-
let saved =
|
|
4088
|
+
let saved = chunk4TTX6ZNS_cjs.parsePresentation(text);
|
|
4073
4089
|
let changedOutside;
|
|
4074
4090
|
if (isZipBytes(bytes) && saved.slides.some((slide) => slide.fingerprint)) {
|
|
4075
4091
|
const now = await slideFingerprints(bytes);
|
|
@@ -4100,7 +4116,7 @@ function usePresentationFiles() {
|
|
|
4100
4116
|
const startFromTemplate = react.useCallback(
|
|
4101
4117
|
async (id) => {
|
|
4102
4118
|
const { saved } = await readSaved(id);
|
|
4103
|
-
|
|
4119
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().load({
|
|
4104
4120
|
title: "Untitled presentation",
|
|
4105
4121
|
savedId: null,
|
|
4106
4122
|
captions: saved.captions,
|
|
@@ -4177,7 +4193,7 @@ function usePresentationFiles() {
|
|
|
4177
4193
|
);
|
|
4178
4194
|
const kept = [];
|
|
4179
4195
|
const newIndex = opened.map((clip) => clip ? kept.push(clip) - 1 : -1);
|
|
4180
|
-
|
|
4196
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().load({
|
|
4181
4197
|
title: saved.title,
|
|
4182
4198
|
savedId: legacy ? null : id,
|
|
4183
4199
|
version: legacy ? null : openedVersion,
|
|
@@ -4226,7 +4242,7 @@ function useGenerateImageLaunch() {
|
|
|
4226
4242
|
if (!arbi || !workspaceId) throw new Error("Open a workspace to generate images.");
|
|
4227
4243
|
const prompt = typeof inputs.prompt === "string" ? inputs.prompt.trim() : "";
|
|
4228
4244
|
if (!prompt) return;
|
|
4229
|
-
const tools =
|
|
4245
|
+
const tools = chunk2F57IO7S_cjs.PROMPT_BINDINGS[chunk7JLJH5CW_cjs.GENERATE_IMAGE_ID].tools?.(inputs);
|
|
4230
4246
|
let image;
|
|
4231
4247
|
let answer = "";
|
|
4232
4248
|
let failure = "";
|
|
@@ -4251,7 +4267,7 @@ function useGenerateImageLaunch() {
|
|
|
4251
4267
|
throw new Error(failure || answer.trim() || "The image could not be generated.");
|
|
4252
4268
|
const source = await (await arbi.documents.download(documentId)).blob();
|
|
4253
4269
|
const fileName = `${prompt.split("\n")[0].slice(0, 60)}.png`;
|
|
4254
|
-
|
|
4270
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().addClip({
|
|
4255
4271
|
kind: "image",
|
|
4256
4272
|
documentId,
|
|
4257
4273
|
fileName,
|
|
@@ -4260,7 +4276,7 @@ function useGenerateImageLaunch() {
|
|
|
4260
4276
|
aspect: await aspectOf(source),
|
|
4261
4277
|
masks: [],
|
|
4262
4278
|
source,
|
|
4263
|
-
caption:
|
|
4279
|
+
caption: chunk4TTX6ZNS_cjs.mediaCaption(fileName)
|
|
4264
4280
|
});
|
|
4265
4281
|
},
|
|
4266
4282
|
[arbi, workspaceId]
|
|
@@ -4271,8 +4287,8 @@ function GenerateImageDialog({
|
|
|
4271
4287
|
onOpenChange,
|
|
4272
4288
|
referenceId
|
|
4273
4289
|
}) {
|
|
4274
|
-
const notify =
|
|
4275
|
-
const { skills } =
|
|
4290
|
+
const notify = chunk4TTX6ZNS_cjs.usePresentation((s) => s.notify);
|
|
4291
|
+
const { skills } = chunkUFT22LAB_cjs.useWorkflowDefinitions();
|
|
4276
4292
|
const run = useGenerateImageLaunch();
|
|
4277
4293
|
const workflows = react.useMemo(
|
|
4278
4294
|
() => skills.filter((w) => w.id === chunk7JLJH5CW_cjs.GENERATE_IMAGE_ID).map((w) => ({ ...w, options: { ...w.options, agent: false } })),
|
|
@@ -4292,7 +4308,7 @@ function GenerateImageDialog({
|
|
|
4292
4308
|
);
|
|
4293
4309
|
if (!open || !workflows.length) return null;
|
|
4294
4310
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4295
|
-
|
|
4311
|
+
chunk2F57IO7S_cjs.ConnectedWorkflowStart,
|
|
4296
4312
|
{
|
|
4297
4313
|
workflows,
|
|
4298
4314
|
showTiles: false,
|
|
@@ -4331,9 +4347,9 @@ function SavePresentationDialog({
|
|
|
4331
4347
|
onOpenChange,
|
|
4332
4348
|
mode = "save"
|
|
4333
4349
|
}) {
|
|
4334
|
-
const notify =
|
|
4350
|
+
const notify = chunk4TTX6ZNS_cjs.usePresentation((s) => s.notify);
|
|
4335
4351
|
const { save, exportPdf } = usePresentationFiles();
|
|
4336
|
-
const current2 =
|
|
4352
|
+
const current2 = chunk4TTX6ZNS_cjs.usePresentation((s) => s.title);
|
|
4337
4353
|
const [title, setTitle] = react.useState(current2);
|
|
4338
4354
|
const [busy, setBusy] = react.useState(false);
|
|
4339
4355
|
const text = SAVE_TEXT[mode];
|
|
@@ -4403,7 +4419,7 @@ function OpenPresentationDialog({
|
|
|
4403
4419
|
templates = false
|
|
4404
4420
|
}) {
|
|
4405
4421
|
const { confirm } = chunkTKHCIHE2_cjs.useBlocksEnvironment();
|
|
4406
|
-
const notify =
|
|
4422
|
+
const notify = chunk4TTX6ZNS_cjs.usePresentation((s) => s.notify);
|
|
4407
4423
|
const { list, startFromTemplate } = usePresentationFiles();
|
|
4408
4424
|
const [entries, setEntries] = react.useState(null);
|
|
4409
4425
|
const [opening, setOpening] = react.useState(null);
|
|
@@ -4418,7 +4434,7 @@ function OpenPresentationDialog({
|
|
|
4418
4434
|
onOpened(entry.id);
|
|
4419
4435
|
return;
|
|
4420
4436
|
}
|
|
4421
|
-
if (
|
|
4437
|
+
if (chunk4TTX6ZNS_cjs.usePresentation.getState().clips.length) {
|
|
4422
4438
|
const ok = await confirm({
|
|
4423
4439
|
title: "New from template",
|
|
4424
4440
|
message: "Replace the presentation that is open? Save it first to keep it.",
|
|
@@ -4469,8 +4485,8 @@ function OpenPresentationDialog({
|
|
|
4469
4485
|
}
|
|
4470
4486
|
var IMAGE_FILE = /\.(png|jpe?g|gif|webp|svg)$/i;
|
|
4471
4487
|
function ChooseLogoDialog({ open, onOpenChange }) {
|
|
4472
|
-
const setTheme =
|
|
4473
|
-
const corner =
|
|
4488
|
+
const setTheme = chunk4TTX6ZNS_cjs.usePresentation((s) => s.setTheme);
|
|
4489
|
+
const corner = chunk4TTX6ZNS_cjs.usePresentation((s) => s.theme.logo?.corner ?? "br");
|
|
4474
4490
|
const { data: documents } = react$1.useDocuments(void 0, { enabled: open });
|
|
4475
4491
|
const [picked, setPicked] = react.useState("");
|
|
4476
4492
|
const groups = react.useMemo(
|
|
@@ -4557,7 +4573,7 @@ function CropClipDialog({ clip, onOpenChange }) {
|
|
|
4557
4573
|
w: Math.min(1, area.width / natural.width),
|
|
4558
4574
|
h: Math.min(1, area.height / natural.height)
|
|
4559
4575
|
};
|
|
4560
|
-
|
|
4576
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().cropClip(clip.id, rect, area.width / area.height);
|
|
4561
4577
|
onOpenChange(false);
|
|
4562
4578
|
};
|
|
4563
4579
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -4606,8 +4622,8 @@ function CropClipDialog({ clip, onOpenChange }) {
|
|
|
4606
4622
|
var EMPTY = new Blob();
|
|
4607
4623
|
var NONE = "none";
|
|
4608
4624
|
function LabelColumnMenu({ columns }) {
|
|
4609
|
-
const labelColumn =
|
|
4610
|
-
const setLabelColumn =
|
|
4625
|
+
const labelColumn = chunk4TTX6ZNS_cjs.usePresentation((s) => s.labelColumn);
|
|
4626
|
+
const setLabelColumn = chunk4TTX6ZNS_cjs.usePresentation((s) => s.setLabelColumn);
|
|
4611
4627
|
if (!columns.length) return null;
|
|
4612
4628
|
const chosen = columns.find((column) => column.id === labelColumn);
|
|
4613
4629
|
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenuSub, { children: [
|
|
@@ -4650,8 +4666,8 @@ function useLabelColumns(active) {
|
|
|
4650
4666
|
const workspaceId = react$1.useArbiSessionState((s) => s.workspaceId);
|
|
4651
4667
|
const { data: tags } = react$1.useTags(workspaceId, { enabled: active });
|
|
4652
4668
|
const { data: documents } = react$1.useDocuments(workspaceId, { enabled: active });
|
|
4653
|
-
const labelColumn =
|
|
4654
|
-
const documentIds =
|
|
4669
|
+
const labelColumn = chunk4TTX6ZNS_cjs.usePresentation((s) => s.labelColumn);
|
|
4670
|
+
const documentIds = chunk4TTX6ZNS_cjs.usePresentation((s) => s.clips.map((clip) => clip.documentId).join(" "));
|
|
4655
4671
|
const columns = react.useMemo(
|
|
4656
4672
|
() => (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)),
|
|
4657
4673
|
[tags]
|
|
@@ -4666,23 +4682,23 @@ function useLabelColumns(active) {
|
|
|
4666
4682
|
if (note2) values[doc.external_id] = note2;
|
|
4667
4683
|
}
|
|
4668
4684
|
}
|
|
4669
|
-
|
|
4685
|
+
chunk4TTX6ZNS_cjs.usePresentation.getState().setColumnValues(values);
|
|
4670
4686
|
}, [labelColumn, documentIds, documents]);
|
|
4671
4687
|
return columns;
|
|
4672
4688
|
}
|
|
4673
4689
|
function usePresentationController(active) {
|
|
4674
4690
|
const session = react$1.useArbiSessionStore();
|
|
4675
|
-
const notify =
|
|
4691
|
+
const notify = chunk4TTX6ZNS_cjs.usePresentation((s) => s.notify);
|
|
4676
4692
|
const { save, canSave } = usePresentationFiles();
|
|
4677
4693
|
const labelColumns = useLabelColumns(active);
|
|
4678
4694
|
const [dialog, setDialog] = react.useState(null);
|
|
4679
4695
|
const [reference, setReference] = react.useState(null);
|
|
4680
4696
|
const [cropping, setCropping] = react.useState(null);
|
|
4681
|
-
const cropClip =
|
|
4697
|
+
const cropClip = chunk4TTX6ZNS_cjs.usePresentation((s) => s.clips.find((c) => c.id === cropping) ?? null);
|
|
4682
4698
|
const [saving, setSaving] = react.useState(false);
|
|
4683
4699
|
const close = (open) => !open && setDialog(null);
|
|
4684
4700
|
const quickSave = react.useCallback(async () => {
|
|
4685
|
-
const { savedId, title } =
|
|
4701
|
+
const { savedId, title } = chunk4TTX6ZNS_cjs.usePresentation.getState();
|
|
4686
4702
|
if (!savedId) return setDialog("save");
|
|
4687
4703
|
setSaving(true);
|
|
4688
4704
|
try {
|
|
@@ -4716,7 +4732,7 @@ function usePresentationController(active) {
|
|
|
4716
4732
|
{
|
|
4717
4733
|
open: dialog === "open" || dialog === "fromTemplate",
|
|
4718
4734
|
templates: dialog === "fromTemplate",
|
|
4719
|
-
onOpened: (id) =>
|
|
4735
|
+
onOpened: (id) => chunkWFMWKPGY_cjs.editPresentation(session, id ? { kind: "open", documentId: id } : { kind: "new" }),
|
|
4720
4736
|
onOpenChange: close
|
|
4721
4737
|
}
|
|
4722
4738
|
),
|
|
@@ -4758,7 +4774,7 @@ function usePresentationController(active) {
|
|
|
4758
4774
|
trayStart: canSave && /* @__PURE__ */ jsxRuntime.jsx(GenerateTile, { onClick: () => generate(null) }),
|
|
4759
4775
|
onChooseLogo: canSave ? () => setDialog("logo") : void 0,
|
|
4760
4776
|
onEditImage: (clipId) => {
|
|
4761
|
-
const clip =
|
|
4777
|
+
const clip = chunk4TTX6ZNS_cjs.usePresentation.getState().clips.find((c) => c.id === clipId);
|
|
4762
4778
|
if (clip) generate(clip.documentId);
|
|
4763
4779
|
},
|
|
4764
4780
|
onCropImage: setCropping
|
|
@@ -4770,5 +4786,5 @@ exports.PresentationStage = PresentationStage;
|
|
|
4770
4786
|
exports.SlidesEditor = SlidesEditor;
|
|
4771
4787
|
exports.usePresentationController = usePresentationController;
|
|
4772
4788
|
exports.usePresentationFiles = usePresentationFiles;
|
|
4773
|
-
//# sourceMappingURL=chunk-
|
|
4774
|
-
//# sourceMappingURL=chunk-
|
|
4789
|
+
//# sourceMappingURL=chunk-USNTRL22.cjs.map
|
|
4790
|
+
//# sourceMappingURL=chunk-USNTRL22.cjs.map
|