@dxos/plugin-sheet 0.7.1 → 0.7.2-main.f1adc9f
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/lib/browser/{SheetContainer-YAMIOFC6.mjs → SheetContainer-DBDIZU6U.mjs} +4 -3
- package/dist/lib/browser/{SheetContainer-YAMIOFC6.mjs.map → SheetContainer-DBDIZU6U.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-QHQFM7LV.mjs → chunk-IXA5HC36.mjs} +48 -22
- package/dist/lib/browser/{chunk-QHQFM7LV.mjs.map → chunk-IXA5HC36.mjs.map} +4 -4
- package/dist/lib/browser/index.mjs +8 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/node/{SheetContainer-BSDHHYXE.cjs → SheetContainer-3373SORI.cjs} +16 -15
- package/dist/lib/node/{SheetContainer-BSDHHYXE.cjs.map → SheetContainer-3373SORI.cjs.map} +3 -3
- package/dist/lib/node/{chunk-J5ZFWMOD.cjs → chunk-TS6IBEPZ.cjs} +34 -10
- package/dist/lib/node/{chunk-J5ZFWMOD.cjs.map → chunk-TS6IBEPZ.cjs.map} +4 -4
- package/dist/lib/node/index.cjs +10 -15
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node-esm/{SheetContainer-T47T2NYJ.mjs → SheetContainer-CH2RYBXJ.mjs} +4 -3
- package/dist/lib/node-esm/{SheetContainer-T47T2NYJ.mjs.map → SheetContainer-CH2RYBXJ.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-6GSTEN7N.mjs → chunk-7F3BRKP7.mjs} +48 -22
- package/dist/lib/node-esm/{chunk-6GSTEN7N.mjs.map → chunk-7F3BRKP7.mjs.map} +4 -4
- package/dist/lib/node-esm/index.mjs +8 -13
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/types/src/SheetPlugin.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.d.ts.map +1 -1
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts +1 -0
- package/dist/types/src/components/GridSheet/GridSheet.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts +2 -0
- package/dist/types/src/components/SheetContainer/SheetContainer.stories.d.ts.map +1 -1
- package/dist/types/src/components/SheetObjectSettings.d.ts +7 -0
- package/dist/types/src/components/SheetObjectSettings.d.ts.map +1 -0
- package/dist/types/src/components/Toolbar/Toolbar.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/integrations/thread-ranges.d.ts.map +1 -1
- package/dist/types/src/testing/playwright/playwright.config.d.ts +3 -0
- package/dist/types/src/testing/playwright/playwright.config.d.ts.map +1 -0
- package/dist/types/src/testing/playwright/sheet-manager.d.ts +24 -0
- package/dist/types/src/testing/playwright/sheet-manager.d.ts.map +1 -0
- package/dist/types/src/testing/playwright/sheet.spec.d.ts +2 -0
- package/dist/types/src/testing/playwright/sheet.spec.d.ts.map +1 -0
- package/package.json +39 -37
- package/src/SheetPlugin.tsx +5 -13
- package/src/components/GridSheet/GridSheet.stories.tsx +2 -0
- package/src/components/GridSheet/GridSheet.tsx +12 -3
- package/src/components/GridSheet/SheetCellEditor.stories.tsx +2 -2
- package/src/components/SheetContainer/SheetContainer.stories.tsx +44 -2
- package/src/components/SheetObjectSettings.tsx +38 -0
- package/src/components/Toolbar/Toolbar.tsx +7 -1
- package/src/components/index.ts +1 -0
- package/src/compute-graph/compute-graph.stories.tsx +1 -1
- package/src/compute-graph/compute-graph.test.ts +1 -1
- package/src/integrations/thread-ranges.ts +2 -0
- package/src/sanity.test.ts +1 -1
- package/src/testing/playwright/playwright.config.ts +18 -0
- package/src/testing/playwright/sheet-manager.ts +91 -0
- package/src/testing/playwright/sheet.spec.ts +78 -0
|
@@ -977,9 +977,9 @@ var SheetProvider = ({ children, graph, sheet, readonly, ignoreAttention, onInfo
|
|
|
977
977
|
};
|
|
978
978
|
|
|
979
979
|
// packages/plugins/plugin-sheet/src/components/GridSheet/GridSheet.tsx
|
|
980
|
-
import
|
|
980
|
+
import React5, { useCallback as useCallback4, useMemo as useMemo2, useRef, useState as useState4 } from "react";
|
|
981
981
|
import { useIntentDispatcher as useIntentDispatcher2 } from "@dxos/app-framework";
|
|
982
|
-
import { DropdownMenu, Icon, useTranslation as
|
|
982
|
+
import { DropdownMenu, Icon, useTranslation as useTranslation3 } from "@dxos/react-ui";
|
|
983
983
|
import { useAttention } from "@dxos/react-ui-attention";
|
|
984
984
|
import { closestCell, defaultSizeRow, editorKeys, Grid as Grid2, GridCellEditor } from "@dxos/react-ui-grid";
|
|
985
985
|
|
|
@@ -1038,8 +1038,28 @@ var RangeList = ({ sheet }) => {
|
|
|
1038
1038
|
})))));
|
|
1039
1039
|
};
|
|
1040
1040
|
|
|
1041
|
+
// packages/plugins/plugin-sheet/src/components/SheetObjectSettings.tsx
|
|
1042
|
+
import React4 from "react";
|
|
1043
|
+
import { SPACE_PLUGIN } from "@dxos/plugin-space/meta";
|
|
1044
|
+
import { Input, useTranslation as useTranslation2 } from "@dxos/react-ui";
|
|
1045
|
+
var SheetObjectSettings = ({ sheet }) => {
|
|
1046
|
+
const { t } = useTranslation2(SPACE_PLUGIN);
|
|
1047
|
+
return /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("div", {
|
|
1048
|
+
role: "form",
|
|
1049
|
+
className: "flex flex-col w-full p-2 gap-1"
|
|
1050
|
+
}, /* @__PURE__ */ React4.createElement(Input.Root, null, /* @__PURE__ */ React4.createElement(Input.Label, null, t("name label")), /* @__PURE__ */ React4.createElement(Input.TextInput, {
|
|
1051
|
+
placeholder: t("name placeholder"),
|
|
1052
|
+
value: sheet.name ?? "",
|
|
1053
|
+
onChange: (event) => {
|
|
1054
|
+
sheet.name = event.target.value;
|
|
1055
|
+
}
|
|
1056
|
+
}))), /* @__PURE__ */ React4.createElement(RangeList, {
|
|
1057
|
+
sheet
|
|
1058
|
+
}));
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1041
1061
|
// packages/plugins/plugin-sheet/src/components/index.ts
|
|
1042
|
-
var SheetContainer = lazy(() => import("./SheetContainer-
|
|
1062
|
+
var SheetContainer = lazy(() => import("./SheetContainer-CH2RYBXJ.mjs"));
|
|
1043
1063
|
|
|
1044
1064
|
// packages/plugins/plugin-sheet/src/integrations/thread-ranges.ts
|
|
1045
1065
|
var completeCellRangeToThreadCursor = (range) => {
|
|
@@ -1077,6 +1097,9 @@ var useUpdateFocusedCellOnThreadSelection = (grid) => {
|
|
|
1077
1097
|
...range.to,
|
|
1078
1098
|
plane: "grid"
|
|
1079
1099
|
}, true);
|
|
1100
|
+
return {
|
|
1101
|
+
data: true
|
|
1102
|
+
};
|
|
1080
1103
|
}
|
|
1081
1104
|
}
|
|
1082
1105
|
}, [
|
|
@@ -1348,7 +1371,7 @@ var sheetColDefault = {
|
|
|
1348
1371
|
}
|
|
1349
1372
|
};
|
|
1350
1373
|
var GridSheet = () => {
|
|
1351
|
-
const { t } =
|
|
1374
|
+
const { t } = useTranslation3(SHEET_PLUGIN);
|
|
1352
1375
|
const { id, model, editing, setCursor, setRange, cursor, cursorFallbackRange, activeRefs, ignoreAttention } = useSheetContext();
|
|
1353
1376
|
const [dxGrid, setDxGrid] = useState4(null);
|
|
1354
1377
|
const [extraplanarFocus, setExtraplanarFocus] = useState4(null);
|
|
@@ -1608,14 +1631,14 @@ var GridSheet = () => {
|
|
|
1608
1631
|
]);
|
|
1609
1632
|
useUpdateFocusedCellOnThreadSelection(dxGrid);
|
|
1610
1633
|
useSelectThreadOnCellFocus();
|
|
1611
|
-
return /* @__PURE__ */
|
|
1634
|
+
return /* @__PURE__ */ React5.createElement("div", {
|
|
1612
1635
|
role: "none",
|
|
1613
1636
|
className: "relative min-bs-0"
|
|
1614
|
-
}, /* @__PURE__ */
|
|
1637
|
+
}, /* @__PURE__ */ React5.createElement(GridCellEditor, {
|
|
1615
1638
|
getCellContent,
|
|
1616
1639
|
extension,
|
|
1617
1640
|
onBlur: handleBlur
|
|
1618
|
-
}), /* @__PURE__ */
|
|
1641
|
+
}), /* @__PURE__ */ React5.createElement(Grid2.Content, {
|
|
1619
1642
|
initialCells,
|
|
1620
1643
|
limitColumns: DEFAULT_COLUMNS,
|
|
1621
1644
|
limitRows: DEFAULT_ROWS,
|
|
@@ -1635,32 +1658,35 @@ var GridSheet = () => {
|
|
|
1635
1658
|
className: "[--dx-grid-base:var(--surface-bg)] [&_.dx-grid]:border-bs [&_.dx-grid]:absolute [&_.dx-grid]:inset-0 [&_.dx-grid]:border-separator",
|
|
1636
1659
|
activeRefs,
|
|
1637
1660
|
ref: setDxGrid
|
|
1638
|
-
}), /* @__PURE__ */
|
|
1661
|
+
}), /* @__PURE__ */ React5.createElement(DropdownMenu.Root, {
|
|
1639
1662
|
modal: false,
|
|
1640
1663
|
open: !!contextMenuOpen,
|
|
1641
1664
|
onOpenChange: (nextOpen) => setContextMenuOpen(nextOpen ? inertPosition : null)
|
|
1642
|
-
}, /* @__PURE__ */
|
|
1665
|
+
}, /* @__PURE__ */ React5.createElement(DropdownMenu.VirtualTrigger, {
|
|
1643
1666
|
virtualRef: contextMenuAnchorRef
|
|
1644
|
-
}), /* @__PURE__ */
|
|
1667
|
+
}), /* @__PURE__ */ React5.createElement(DropdownMenu.Content, {
|
|
1645
1668
|
side: contextMenuAxis === "col" ? "bottom" : "right",
|
|
1646
1669
|
sideOffset: 4,
|
|
1647
1670
|
collisionPadding: 8
|
|
1648
|
-
}, /* @__PURE__ */
|
|
1649
|
-
onClick: () => handleAxisMenuAction("insert-before")
|
|
1650
|
-
|
|
1671
|
+
}, /* @__PURE__ */ React5.createElement(DropdownMenu.Viewport, null, /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
1672
|
+
onClick: () => handleAxisMenuAction("insert-before"),
|
|
1673
|
+
"data-testid": `grid.${contextMenuAxis}.insert-before`
|
|
1674
|
+
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
1651
1675
|
size: 5,
|
|
1652
1676
|
icon: contextMenuAxis === "col" ? "ph--columns-plus-left--regular" : "ph--rows-plus-top--regular"
|
|
1653
|
-
}), /* @__PURE__ */
|
|
1654
|
-
onClick: () => handleAxisMenuAction("insert-after")
|
|
1655
|
-
|
|
1677
|
+
}), /* @__PURE__ */ React5.createElement("span", null, t(`add ${contextMenuAxis} before label`))), /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
1678
|
+
onClick: () => handleAxisMenuAction("insert-after"),
|
|
1679
|
+
"data-testid": `grid.${contextMenuAxis}.insert-after`
|
|
1680
|
+
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
1656
1681
|
size: 5,
|
|
1657
1682
|
icon: contextMenuAxis === "col" ? "ph--columns-plus-right--regular" : "ph--rows-plus-bottom--regular"
|
|
1658
|
-
}), /* @__PURE__ */
|
|
1659
|
-
onClick: () => handleAxisMenuAction("drop")
|
|
1660
|
-
|
|
1683
|
+
}), /* @__PURE__ */ React5.createElement("span", null, t(`add ${contextMenuAxis} after label`))), /* @__PURE__ */ React5.createElement(DropdownMenu.Item, {
|
|
1684
|
+
onClick: () => handleAxisMenuAction("drop"),
|
|
1685
|
+
"data-testid": `grid.${contextMenuAxis}.drop`
|
|
1686
|
+
}, /* @__PURE__ */ React5.createElement(Icon, {
|
|
1661
1687
|
size: 5,
|
|
1662
1688
|
icon: "ph--backspace--regular"
|
|
1663
|
-
}), /* @__PURE__ */
|
|
1689
|
+
}), /* @__PURE__ */ React5.createElement("span", null, t(`delete ${contextMenuAxis} label`)))), /* @__PURE__ */ React5.createElement(DropdownMenu.Arrow, null))));
|
|
1664
1690
|
};
|
|
1665
1691
|
|
|
1666
1692
|
export {
|
|
@@ -1671,7 +1697,7 @@ export {
|
|
|
1671
1697
|
useSheetContext,
|
|
1672
1698
|
SheetProvider,
|
|
1673
1699
|
GridSheet,
|
|
1674
|
-
|
|
1700
|
+
SheetObjectSettings,
|
|
1675
1701
|
SheetContainer
|
|
1676
1702
|
};
|
|
1677
|
-
//# sourceMappingURL=chunk-
|
|
1703
|
+
//# sourceMappingURL=chunk-7F3BRKP7.mjs.map
|