@opengeni/react 7.1.0 → 7.1.2-canary.36079201993001
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/artifacts-document.js +2 -2
- package/dist/artifacts-presentation.js +2 -2
- package/dist/artifacts-spreadsheet.js +2 -2
- package/dist/artifacts.js +4 -4
- package/dist/{browser-viewer-MN7MOYQT.js → browser-viewer-K2H3SLIW.js} +2 -2
- package/dist/{chunk-4ACTWOOW.js → chunk-6N3AZUOV.js} +31 -14
- package/dist/chunk-6N3AZUOV.js.map +1 -0
- package/dist/{chunk-KCGXPP5V.js → chunk-6P7T4RPE.js} +7 -3
- package/dist/chunk-6P7T4RPE.js.map +1 -0
- package/dist/{chunk-SHRCATV6.js → chunk-7J4DUR3E.js} +12 -5
- package/dist/chunk-7J4DUR3E.js.map +1 -0
- package/dist/{chunk-ZC2DK5SC.js → chunk-AWIX4UAC.js} +88 -7
- package/dist/chunk-AWIX4UAC.js.map +1 -0
- package/dist/{chunk-UQS7BGNQ.js → chunk-ETA37UZ7.js} +82 -11
- package/dist/chunk-ETA37UZ7.js.map +1 -0
- package/dist/{chunk-VR4Z73EU.js → chunk-G2SCXNXW.js} +9 -2
- package/dist/chunk-G2SCXNXW.js.map +1 -0
- package/dist/{chunk-5UONOQ3Y.js → chunk-K3MQZO7R.js} +150 -67
- package/dist/chunk-K3MQZO7R.js.map +1 -0
- package/dist/{chunk-OWHPKAOV.js → chunk-L6MYP3QU.js} +4 -2
- package/dist/{chunk-OWHPKAOV.js.map → chunk-L6MYP3QU.js.map} +1 -1
- package/dist/{chunk-VI7HELBI.js → chunk-SJ5HE4ZA.js} +21 -2
- package/dist/chunk-SJ5HE4ZA.js.map +1 -0
- package/dist/{chunk-XMXRI5JK.js → chunk-ZZ4744OZ.js} +128 -71
- package/dist/chunk-ZZ4744OZ.js.map +1 -0
- package/dist/components/artifacts/artifact-surface.d.ts +3 -1
- package/dist/components/artifacts/document-editor.d.ts +4 -2
- package/dist/components/artifacts/editable-document.d.ts +1 -1
- package/dist/components/artifacts/editable-presentation.d.ts +1 -1
- package/dist/components/artifacts/editable-spreadsheet.d.ts +2 -1
- package/dist/components/artifacts/presentation-editor.d.ts +4 -2
- package/dist/components/browser-viewer.d.ts +4 -1
- package/dist/components/markdown.d.ts +2 -0
- package/dist/components/session-capability-frame.d.ts +5 -1
- package/dist/composer.js +1 -1
- package/dist/connect.js +2 -2
- package/dist/hooks/use-browser-session.d.ts +3 -0
- package/dist/index.js +7 -6
- package/dist/index.js.map +1 -1
- package/dist/interaction.js +1 -1
- package/dist/session-ui.js +4 -4
- package/dist/session.js +1 -1
- package/dist/timeline/types.d.ts +2 -0
- package/package.json +3 -3
- package/src/components/artifacts/artifact-surface.tsx +39 -19
- package/src/components/artifacts/document-editor.tsx +77 -9
- package/src/components/artifacts/editable-document.tsx +3 -0
- package/src/components/artifacts/editable-presentation.tsx +3 -0
- package/src/components/artifacts/editable-spreadsheet.tsx +3 -0
- package/src/components/artifacts/presentation-editor.tsx +6 -0
- package/src/components/browser-viewer.tsx +11 -5
- package/src/components/composer-transcription-control.tsx +4 -2
- package/src/components/composer.tsx +20 -9
- package/src/components/markdown.tsx +9 -2
- package/src/components/sandbox-workspace.tsx +1 -0
- package/src/components/session-capability-frame.tsx +11 -3
- package/src/components/session-mcp-capability-card.tsx +174 -70
- package/src/hooks/use-browser-frame-stream.ts +3 -1
- package/src/hooks/use-browser-session.ts +107 -3
- package/src/hooks/use-voice-input.ts +12 -1
- package/src/timeline/compaction-copy.ts +2 -0
- package/src/timeline/parsers.ts +2 -2
- package/src/timeline/projection.ts +31 -5
- package/src/timeline/tool-renderers.tsx +105 -16
- package/src/timeline/turn-summary.tsx +10 -2
- package/src/timeline/types.ts +2 -0
- package/styles/compiled.css +6 -0
- package/styles/session-capability.css +2 -0
- package/dist/chunk-4ACTWOOW.js.map +0 -1
- package/dist/chunk-5UONOQ3Y.js.map +0 -1
- package/dist/chunk-KCGXPP5V.js.map +0 -1
- package/dist/chunk-SHRCATV6.js.map +0 -1
- package/dist/chunk-UQS7BGNQ.js.map +0 -1
- package/dist/chunk-VI7HELBI.js.map +0 -1
- package/dist/chunk-VR4Z73EU.js.map +0 -1
- package/dist/chunk-XMXRI5JK.js.map +0 -1
- package/dist/chunk-ZC2DK5SC.js.map +0 -1
- /package/dist/{browser-viewer-MN7MOYQT.js.map → browser-viewer-K2H3SLIW.js.map} +0 -0
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
editableArtifactProjectionKey,
|
|
7
7
|
editableArtifactStatusLabel,
|
|
8
8
|
useEditableArtifactView
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-6P7T4RPE.js";
|
|
10
10
|
import {
|
|
11
11
|
cn
|
|
12
12
|
} from "./chunk-22KP6LR5.js";
|
|
@@ -587,79 +587,100 @@ function DocumentEditorCore({
|
|
|
587
587
|
children: "Start writing"
|
|
588
588
|
}
|
|
589
589
|
) : null
|
|
590
|
-
] }) }) : /* @__PURE__ */ jsx(
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
borderColor: layout === "paginated" ? "#0000001a" : void 0,
|
|
611
|
-
width: layout === "paginated" ? page.page.widthPt * POINT_TO_CSS_PIXEL * page.renderScale : void 0,
|
|
612
|
-
height: page.height
|
|
613
|
-
},
|
|
614
|
-
children: /* @__PURE__ */ jsx(
|
|
615
|
-
MeasuredPageBody,
|
|
590
|
+
] }) }) : /* @__PURE__ */ jsx(
|
|
591
|
+
"div",
|
|
592
|
+
{
|
|
593
|
+
className: "relative min-w-full",
|
|
594
|
+
style: {
|
|
595
|
+
height: axis.total,
|
|
596
|
+
minWidth: layout === "paginated" ? pages.reduce(
|
|
597
|
+
(width, page) => Math.max(
|
|
598
|
+
width,
|
|
599
|
+
page.page.widthPt * POINT_TO_CSS_PIXEL * page.renderScale + 32
|
|
600
|
+
),
|
|
601
|
+
0
|
|
602
|
+
) : void 0
|
|
603
|
+
},
|
|
604
|
+
children: mountedIndexes.map((pageIndex) => {
|
|
605
|
+
const page = pages[pageIndex];
|
|
606
|
+
const top = axis.offsets[pageIndex];
|
|
607
|
+
const pageWidth = page.page.widthPt * POINT_TO_CSS_PIXEL * page.renderScale;
|
|
608
|
+
return /* @__PURE__ */ jsx(
|
|
609
|
+
"article",
|
|
616
610
|
{
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
611
|
+
"aria-label": `${layout === "paginated" ? "Page" : "Section"} ${pageIndex + 1} of ${pages.length}`,
|
|
612
|
+
"aria-posinset": pageIndex + 1,
|
|
613
|
+
"aria-setsize": pages.length,
|
|
614
|
+
"data-og-document-page": pageIndex + 1,
|
|
615
|
+
"data-og-page-width-pt": page.page.widthPt,
|
|
616
|
+
"data-og-page-height-pt": page.page.heightPt,
|
|
620
617
|
className: cn(
|
|
621
|
-
|
|
618
|
+
"absolute overflow-hidden",
|
|
619
|
+
layout === "paginated" ? "border shadow-og-sm" : "left-0 right-0 border-b border-og-border bg-og-surface-1 text-og-fg"
|
|
622
620
|
),
|
|
623
621
|
style: {
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
622
|
+
top,
|
|
623
|
+
// Center against the visible viewport, not the shared width
|
|
624
|
+
// reserved for the widest section in this document.
|
|
625
|
+
left: layout === "paginated" ? Math.max(16, (measuredViewport.width - pageWidth) / 2) : void 0,
|
|
626
|
+
color: layout === "paginated" ? "#171717" : void 0,
|
|
627
|
+
backgroundColor: layout === "paginated" ? "#fff" : void 0,
|
|
628
|
+
borderColor: layout === "paginated" ? "#0000001a" : void 0,
|
|
629
|
+
width: layout === "paginated" ? pageWidth : void 0,
|
|
630
|
+
height: page.height,
|
|
631
|
+
containerType: layout === "continuous" ? "inline-size" : void 0
|
|
632
632
|
},
|
|
633
|
-
children:
|
|
634
|
-
|
|
633
|
+
children: /* @__PURE__ */ jsx(
|
|
634
|
+
MeasuredPageBody,
|
|
635
635
|
{
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
636
|
+
pageKey: page.key,
|
|
637
|
+
measureToken: documentRevision,
|
|
638
|
+
onHeight: recordPageHeight,
|
|
639
|
+
className: cn(
|
|
640
|
+
layout === "paginated" ? "absolute left-0 top-0 overflow-hidden" : "mx-auto"
|
|
641
|
+
),
|
|
642
|
+
style: {
|
|
643
|
+
...pageContentStyle(page.page, layout),
|
|
644
|
+
maxWidth: layout === "continuous" ? "68rem" : void 0,
|
|
645
|
+
...layout === "paginated" ? {
|
|
646
|
+
width: page.page.widthPt * POINT_TO_CSS_PIXEL,
|
|
647
|
+
minHeight: page.naturalHeight,
|
|
648
|
+
transform: `scale(${page.renderScale})`,
|
|
649
|
+
transformOrigin: "top left"
|
|
650
|
+
} : {}
|
|
648
651
|
},
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
652
|
+
children: page.blocks.map(({ block, listOrdinal }) => /* @__PURE__ */ jsx(
|
|
653
|
+
DocumentBlockView,
|
|
654
|
+
{
|
|
655
|
+
block,
|
|
656
|
+
viewBlockId: blockIdForView(block.id),
|
|
657
|
+
comments: annotations.comments.get(block.id) ?? EMPTY_COMMENTS,
|
|
658
|
+
changes: annotations.changes.get(block.id) ?? EMPTY_CHANGES,
|
|
659
|
+
projectionRevision: localRevision,
|
|
660
|
+
listOrdinal,
|
|
661
|
+
readOnly,
|
|
662
|
+
selected: selectedBlockId === block.id,
|
|
663
|
+
openThreadId,
|
|
664
|
+
registerEditor: (node) => {
|
|
665
|
+
if (node) editorNodes.current.set(block.id, node);
|
|
666
|
+
else editorNodes.current.delete(block.id);
|
|
667
|
+
},
|
|
668
|
+
onThreadToggle: (threadId) => setOpenThreadId((current) => current === threadId ? null : threadId),
|
|
669
|
+
onInput: (paragraph, text) => commitText(paragraph, text),
|
|
670
|
+
onBlur: () => setLocalRevision(document2.revision),
|
|
671
|
+
onSelection: (paragraph) => readDomSelection(paragraph.id),
|
|
672
|
+
onKeyDown: handleEditorKeyDown
|
|
673
|
+
},
|
|
674
|
+
block.id
|
|
675
|
+
))
|
|
676
|
+
}
|
|
677
|
+
)
|
|
678
|
+
},
|
|
679
|
+
page.key
|
|
680
|
+
);
|
|
681
|
+
})
|
|
682
|
+
}
|
|
683
|
+
)
|
|
663
684
|
]
|
|
664
685
|
}
|
|
665
686
|
)
|
|
@@ -670,6 +691,7 @@ function DocumentEditorCore({
|
|
|
670
691
|
function DocumentArtifactSurface({
|
|
671
692
|
document: document2,
|
|
672
693
|
title,
|
|
694
|
+
showHeader,
|
|
673
695
|
subtitle,
|
|
674
696
|
busy,
|
|
675
697
|
className,
|
|
@@ -681,6 +703,7 @@ function DocumentArtifactSurface({
|
|
|
681
703
|
{
|
|
682
704
|
modality: "document",
|
|
683
705
|
title,
|
|
706
|
+
showHeader,
|
|
684
707
|
subtitle,
|
|
685
708
|
busy,
|
|
686
709
|
className,
|
|
@@ -699,6 +722,7 @@ function DocumentArtifactSurface({
|
|
|
699
722
|
function DocumentProjectionArtifactSurface({
|
|
700
723
|
projection,
|
|
701
724
|
title,
|
|
725
|
+
showHeader,
|
|
702
726
|
subtitle,
|
|
703
727
|
busy,
|
|
704
728
|
className,
|
|
@@ -710,6 +734,7 @@ function DocumentProjectionArtifactSurface({
|
|
|
710
734
|
{
|
|
711
735
|
modality: "document",
|
|
712
736
|
title,
|
|
737
|
+
showHeader,
|
|
713
738
|
subtitle,
|
|
714
739
|
busy,
|
|
715
740
|
className,
|
|
@@ -974,12 +999,13 @@ function DocumentTableView({
|
|
|
974
999
|
viewBlockId
|
|
975
1000
|
}) {
|
|
976
1001
|
const columnWidths = table.style.columnWidthsPt;
|
|
1002
|
+
const headerColor = tableHeaderTextColor(table.style.headerFill);
|
|
977
1003
|
return /* @__PURE__ */ jsx(
|
|
978
1004
|
"div",
|
|
979
1005
|
{
|
|
980
1006
|
"data-og-document-block": viewBlockId,
|
|
981
1007
|
"data-og-block-kind": "table",
|
|
982
|
-
className: "overflow-x-auto py-2",
|
|
1008
|
+
className: "w-full max-w-full overflow-x-auto py-2",
|
|
983
1009
|
children: /* @__PURE__ */ jsxs(
|
|
984
1010
|
"table",
|
|
985
1011
|
{
|
|
@@ -1008,6 +1034,8 @@ function DocumentTableView({
|
|
|
1008
1034
|
style: {
|
|
1009
1035
|
borderColor: table.style.borderColor ?? "#d1d5db",
|
|
1010
1036
|
background: header ? table.style.headerFill ?? "#f3f4f6" : void 0,
|
|
1037
|
+
// An explicitly colored run still owns its authored text style.
|
|
1038
|
+
color: header ? headerColor : void 0,
|
|
1011
1039
|
padding: `${table.style.cellPaddingPt ?? 6}pt`
|
|
1012
1040
|
},
|
|
1013
1041
|
children: cell.map((run, index) => (
|
|
@@ -1026,6 +1054,32 @@ function DocumentTableView({
|
|
|
1026
1054
|
}
|
|
1027
1055
|
);
|
|
1028
1056
|
}
|
|
1057
|
+
function tableHeaderTextColor(fill) {
|
|
1058
|
+
if (!fill) return "#171717";
|
|
1059
|
+
const hex = /^#([\da-f]{3}|[\da-f]{6}|[\da-f]{8})$/i.exec(fill)?.[1];
|
|
1060
|
+
if (!hex) return void 0;
|
|
1061
|
+
const channels = hex.length === 3 ? [...hex].map((digit) => Number.parseInt(digit + digit, 16)) : [0, 2, 4].map((index) => Number.parseInt(hex.slice(index, index + 2), 16));
|
|
1062
|
+
const alpha = hex.length === 8 ? Number.parseInt(hex.slice(6), 16) / 255 : 1;
|
|
1063
|
+
const luminanceOn = (backdrop) => {
|
|
1064
|
+
const linear = channels.map((channel) => {
|
|
1065
|
+
const normalized = (channel * alpha + backdrop * (1 - alpha)) / 255;
|
|
1066
|
+
return normalized <= 0.04045 ? normalized / 12.92 : ((normalized + 0.055) / 1.055) ** 2.4;
|
|
1067
|
+
});
|
|
1068
|
+
return linear[0] * 0.2126 + linear[1] * 0.7152 + linear[2] * 0.0722;
|
|
1069
|
+
};
|
|
1070
|
+
const backdrops = alpha < 1 ? [luminanceOn(0), luminanceOn(255)] : [luminanceOn(255)];
|
|
1071
|
+
const darkTextLuminance = ((23 / 255 + 0.055) / 1.055) ** 2.4;
|
|
1072
|
+
const whiteContrast = Math.min(...backdrops.map((value) => 1.05 / (value + 0.05)));
|
|
1073
|
+
const darkContrast = Math.min(
|
|
1074
|
+
...backdrops.map(
|
|
1075
|
+
(value) => (Math.max(value, darkTextLuminance) + 0.05) / (Math.min(value, darkTextLuminance) + 0.05)
|
|
1076
|
+
)
|
|
1077
|
+
);
|
|
1078
|
+
if (Math.max(whiteContrast, darkContrast) < 4.5) {
|
|
1079
|
+
return alpha < 1 ? void 0 : "#000";
|
|
1080
|
+
}
|
|
1081
|
+
return whiteContrast > darkContrast ? "#fff" : "#171717";
|
|
1082
|
+
}
|
|
1029
1083
|
function ToolbarButton({
|
|
1030
1084
|
label,
|
|
1031
1085
|
shortcut,
|
|
@@ -1173,12 +1227,12 @@ function visiblePageIndexes(axis, count, scrollTop, viewportHeight, overscan, re
|
|
|
1173
1227
|
function responsiveDocumentPageScale(page, viewportWidth) {
|
|
1174
1228
|
if (viewportWidth <= 0) return 1;
|
|
1175
1229
|
const naturalWidth = page.widthPt * POINT_TO_CSS_PIXEL;
|
|
1176
|
-
return Math.min(1, Math.max(0.
|
|
1230
|
+
return Math.min(1, Math.max(0.75, (viewportWidth - 32) / naturalWidth));
|
|
1177
1231
|
}
|
|
1178
1232
|
function pageContentStyle(page, layout) {
|
|
1179
1233
|
if (layout === "continuous") {
|
|
1180
1234
|
return {
|
|
1181
|
-
padding: "24px clamp(
|
|
1235
|
+
padding: "24px clamp(12px, 4cqw, 72px)"
|
|
1182
1236
|
};
|
|
1183
1237
|
}
|
|
1184
1238
|
return {
|
|
@@ -1713,6 +1767,7 @@ var DOCUMENT_COMPOSITION_ATTEMPTS = 3;
|
|
|
1713
1767
|
function EditableDocumentArtifactSurface({
|
|
1714
1768
|
session,
|
|
1715
1769
|
title,
|
|
1770
|
+
showHeader,
|
|
1716
1771
|
subtitle,
|
|
1717
1772
|
readOnly = false,
|
|
1718
1773
|
onCommit,
|
|
@@ -1880,6 +1935,7 @@ function EditableDocumentArtifactSurface({
|
|
|
1880
1935
|
{
|
|
1881
1936
|
...surfaceProps,
|
|
1882
1937
|
title,
|
|
1938
|
+
showHeader,
|
|
1883
1939
|
subtitle: subtitle ?? `${projection.blocks.length} block${projection.blocks.length === 1 ? "" : "s"}${writable ? "" : " \xB7 Read only"}`,
|
|
1884
1940
|
projection,
|
|
1885
1941
|
commit: writable ? applyCommit : void 0,
|
|
@@ -1892,6 +1948,7 @@ function EditableDocumentArtifactSurface({
|
|
|
1892
1948
|
{
|
|
1893
1949
|
modality: "document",
|
|
1894
1950
|
title,
|
|
1951
|
+
showHeader,
|
|
1895
1952
|
subtitle: subtitle ?? status,
|
|
1896
1953
|
busy: !accessRevoked && !state.error,
|
|
1897
1954
|
className: surfaceProps.className,
|
|
@@ -2192,4 +2249,4 @@ export {
|
|
|
2192
2249
|
DocumentProjectionArtifactSurface,
|
|
2193
2250
|
EditableDocumentArtifactSurface
|
|
2194
2251
|
};
|
|
2195
|
-
//# sourceMappingURL=chunk-
|
|
2252
|
+
//# sourceMappingURL=chunk-ZZ4744OZ.js.map
|