@sheetxl/react 0.8.0-beta.6 → 0.8.0-beta.9

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.
Files changed (58) hide show
  1. package/browser/cjs/index.cjs +18 -17
  2. package/browser/cjs/xuAfpHmA2W4MFa_0.cjs +1 -0
  3. package/browser/esm/Dk6274Lic6AOmEAq.mjs +2624 -0
  4. package/browser/esm/index.mjs +6474 -4211
  5. package/licenses/dependencies.txt +0 -555
  6. package/node/esm/B-5p0wwNM6Y5jlI2.mjs +2624 -0
  7. package/node/esm/index.mjs +8166 -5896
  8. package/package.json +6 -7
  9. package/resources/locales/de/sheet.cmd.json +126 -20
  10. package/resources/locales/de/ui.msg.json +8 -0
  11. package/resources/locales/en/sheet.cmd.json +137 -19
  12. package/resources/locales/en/ui.msg.json +169 -0
  13. package/types/src/cell/CornerTriangle.d.ts +6 -0
  14. package/types/src/cell/OutlineButton.d.ts +123 -0
  15. package/types/src/cell/index.d.ts +1 -0
  16. package/types/src/checklist/ValueChecklist.d.ts +15 -3
  17. package/types/src/comment/CommentCardRequest.d.ts +94 -0
  18. package/types/src/comment/CommentUtils.d.ts +43 -0
  19. package/types/src/comment/index.d.ts +4 -0
  20. package/types/src/comment/useCommentThread.d.ts +37 -0
  21. package/types/src/comment/useSheetComments.d.ts +28 -0
  22. package/types/src/control/FormControlRenderers.d.ts +14 -0
  23. package/types/src/control/index.d.ts +2 -0
  24. package/types/src/frame/CommandContext.d.ts +27 -0
  25. package/types/src/index.d.ts +1 -0
  26. package/types/src/layer/CommentCardLayer.d.ts +45 -0
  27. package/types/src/layer/SheetHeaderCellLayer.d.ts +9 -0
  28. package/types/src/layer/SheetOutlineLayer.d.ts +40 -0
  29. package/types/src/layer/ValidationPromptLayer.d.ts +2 -2
  30. package/types/src/layer/index.d.ts +2 -0
  31. package/types/src/listener/useModelListener.d.ts +4 -4
  32. package/types/src/movable/IMovableArea.d.ts +25 -6
  33. package/types/src/movable/MovableAdornment.d.ts +20 -0
  34. package/types/src/movable/MovableControl.d.ts +32 -0
  35. package/types/src/movable/MovableFrame.d.ts +13 -15
  36. package/types/src/movable/MovableRenderers.d.ts +55 -0
  37. package/types/src/movable/RotateHandle.d.ts +29 -0
  38. package/types/src/movable/framePlacement.d.ts +29 -0
  39. package/types/src/movable/geometry.d.ts +51 -0
  40. package/types/src/movable/index.d.ts +1 -0
  41. package/types/src/shape/ShapeEditor.d.ts +16 -2
  42. package/types/src/shape/ShapeGallery.d.ts +16 -0
  43. package/types/src/shape/ShapeHandles.d.ts +28 -0
  44. package/types/src/shape/ShapeSVG.d.ts +24 -0
  45. package/types/src/shape/ShapeText.d.ts +17 -0
  46. package/types/src/shape/icons/ShapeIcons.d.ts +16 -0
  47. package/types/src/shape/icons/_ShapeIconPack.d.ts +4 -0
  48. package/types/src/shape/index.d.ts +3 -0
  49. package/types/src/shape/shapeFrame.d.ts +6 -0
  50. package/types/src/shape/shapeStyle.d.ts +31 -0
  51. package/types/src/sheet/ISheetElement.d.ts +16 -1
  52. package/types/src/sheet/SheetOutlineElement.d.ts +70 -0
  53. package/types/src/workbook/DefaultMovableRenderers.d.ts +2 -0
  54. package/browser/cjs/Bo9Kx3L_XQkGPBJ5.cjs +0 -1
  55. package/browser/cjs/Pl04-kDEQSO8_qFU.cjs +0 -156
  56. package/browser/esm/CFCvoIa_w1ERjvMW.mjs +0 -6286
  57. package/node/esm/B9g0FgUjU-KLHkGu.mjs +0 -9
  58. package/types/src/movable/MoveableBundle.d.ts +0 -4
@@ -0,0 +1,17 @@
1
+ import { default as React } from 'react';
2
+ import { ITextFrame, IStyleCollection } from '@sheetxl/sdk';
3
+ export interface ShapeTextProps {
4
+ /** The text written on the shape, by paragraph, with how its body sits in the shape. */
5
+ text: ITextFrame.JSON;
6
+ /** Resolves colors through the workbook's theme; `null` reads them without one. */
7
+ styles: IStyleCollection | null;
8
+ /** The color the shape's theme style gives its text, used where a run states none. */
9
+ color?: string | null;
10
+ }
11
+ /**
12
+ * The text written on a shape: its paragraphs laid out as the body says — anchored, inset,
13
+ * aligned, spaced — with what formatting its runs carry. Text layout stays in the DOM; nothing
14
+ * here is measured.
15
+ */
16
+ export declare const ShapeText: React.FC<ShapeTextProps>;
17
+ //# sourceMappingURL=ShapeText.d.ts.map
@@ -0,0 +1,16 @@
1
+ /**
2
+ * The icon pack holding one 24x24 icon per preset shape, keyed by the preset name
3
+ * (`IGeometry.Preset`). Separate from the base pack and loaded only when one of its icons is asked
4
+ * for. The icons are generated from the geometry engine (`pnpm gen:shapes:icons` in the SDK).
5
+ */
6
+ export declare const SHAPE_ICON_PACK = "shape";
7
+ /**
8
+ * The icon key of a preset shape, for `DynamicIcon` or any command or menu that takes an icon key.
9
+ *
10
+ * @example
11
+ * ```tsx
12
+ * <DynamicIcon iconKey={shapeIconKey(IGeometry.Preset.RoundRect)} />
13
+ * ```
14
+ */
15
+ export declare const shapeIconKey: (preset: string) => string;
16
+ //# sourceMappingURL=ShapeIcons.d.ts.map
@@ -0,0 +1,4 @@
1
+ import { IconPackInput } from '@sheetxl/utils-react';
2
+ declare const pack: IconPackInput;
3
+ export default pack;
4
+ //# sourceMappingURL=_ShapeIconPack.d.ts.map
@@ -1,2 +1,5 @@
1
1
  export * from './ShapeEditor';
2
+ export * from './ShapeGallery';
3
+ export * from './ShapeText';
4
+ export * from './icons/ShapeIcons';
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * A stroke width in shape px snapped to whole device pixels, never thinner than one: a 1 pt line
3
+ * is 1 px at 100% and 3 px at 200%, as Excel draws it. Zero stays zero (no line).
4
+ */
5
+ export declare const snapStrokeWidth: (width: number, zoom: number) => number;
6
+ //# sourceMappingURL=shapeFrame.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { IFill, IResource, IShape, IStyleCollection } from '@sheetxl/sdk';
2
+ /**
3
+ * What a shape draws with, resolved to CSS: the colors a `<path>` can take and the line
4
+ * properties SVG strokes natively. Gradients and patterns are reduced to a solid color for now
5
+ * (SHAPES-PLAN phase e draws them properly). Which fill and line apply is the model's call
6
+ * (`ShapeStyleUtils`); this turns its answer into what the renderer sets.
7
+ */
8
+ export interface ResolvedShapeStyle {
9
+ /** CSS color, or `null` for no fill (also when the fill is an image, see `image`). */
10
+ fill: string | null;
11
+ /** An image fill: the resource to draw and how, when the shape holds the image. */
12
+ image?: {
13
+ resource: IResource;
14
+ fill: IFill.ImageJSON;
15
+ };
16
+ /** CSS color, or `null` for no line. */
17
+ stroke: string | null;
18
+ /** In shape-local px (points in the model). */
19
+ strokeWidth: number;
20
+ lineJoin: 'miter' | 'round' | 'bevel';
21
+ lineCap: 'butt' | 'round' | 'square';
22
+ miterLimit: number;
23
+ /** The text color the theme style gives, or `null` when nothing says. */
24
+ textColor: string | null;
25
+ }
26
+ /**
27
+ * Resolves a shape's fill, line and text color to CSS: what it states itself over what its
28
+ * theme style gives, over Excel's defaults for a new shape.
29
+ */
30
+ export declare const resolveShapeStyle: (json: IShape.JSON | null | undefined, styles: IStyleCollection | null, getResource?: (resourceId: number) => IResource | null) => ResolvedShapeStyle;
31
+ //# sourceMappingURL=shapeStyle.d.ts.map
@@ -2,8 +2,9 @@ import { ISheet, ICell, IMovable } from '@sheetxl/sdk';
2
2
  import { CellCoords } from '@sheetxl/utils';
3
3
  import { ViewportMetrics, IShowToolTipProperties, ScrollPaneProps, Viewport, ThemeMode } from '@sheetxl/utils-react';
4
4
  import { GridSurfaceProps, IGridSurface, IEditable, LayerNode } from '@sheetxl/grid-react';
5
- import { SheetCellRendererProps, ColumnButtonConfigProps } from '../cell';
5
+ import { SheetCellRendererProps, ColumnButtonConfigProps, OutlineProps } from '../cell';
6
6
  import { MovableElementProps } from '../movable';
7
+ import { CommentCardRenderProps } from '../comment';
7
8
  import { CommandContext } from '../frame';
8
9
  import { ISheetHeaderElement, SheetHeaderProps } from './ISheetHeaderElement';
9
10
  /**
@@ -161,6 +162,13 @@ export interface SheetElementProps extends React.HTMLAttributes<HTMLDivElement>,
161
162
  * @returns A React Element representing the IMovable.
162
163
  */
163
164
  renderMovable?: (props: MovableElementProps) => React.ReactElement;
165
+ /**
166
+ * Renders the card of a threaded comment beside its cell: on hover, on selection, and as a draft
167
+ * when a command asks for one. Omit to show no card; the indicators are drawn either way.
168
+ *
169
+ * @param props - {@link CommentCardRenderProps}
170
+ */
171
+ renderCommentCard?: (props: CommentCardRenderProps) => React.ReactNode;
164
172
  /**
165
173
  * Render element(s) directly onto the `GridSurface`, bottom → top — the same {@link LayerNode} the
166
174
  * grid takes for its children (a node or an array of them). Each layer reads its pane from context
@@ -189,6 +197,13 @@ export interface SheetElementProps extends React.HTMLAttributes<HTMLDivElement>,
189
197
  * This does not invalidate the rendering
190
198
  */
191
199
  propsCellRender?: Partial<SheetCellRendererProps> & ColumnButtonConfigProps;
200
+ /**
201
+ * Props for the outline: the gutters that show row and column groups, and their level buttons.
202
+ *
203
+ * @remarks
204
+ * Omitted renderers fall back to plain, unstyled buttons.
205
+ */
206
+ propsOutline?: OutlineProps;
192
207
  /**
193
208
  * Ref to the sheet element.
194
209
  */
@@ -0,0 +1,70 @@
1
+ import { default as React } from 'react';
2
+ import { FixedEdge } from '@sheetxl/utils';
3
+ import { IRange, ISheet } from '@sheetxl/sdk';
4
+ import { Viewport, ThemeMode } from '@sheetxl/utils-react';
5
+ import { OutlineButtonProps, OutlineLevelButtonProps } from '../cell/OutlineButton';
6
+ export interface SheetOutlineElementProps extends React.HTMLAttributes<HTMLElement> {
7
+ /** The sheet whose outline is drawn. */
8
+ sheet: ISheet;
9
+ /** Rows (the gutter left of the row headers) or columns (above the column headers). */
10
+ axis: IRange.Axis;
11
+ /** The lanes across the gutter: one per level, plus one. */
12
+ lanes: number;
13
+ /** The gutter's thickness across the axis, in pixels. */
14
+ thickness: number;
15
+ /** The headers frozen at the start of the axis. */
16
+ freezeStart?: number | FixedEdge;
17
+ /** The sheet's main viewport; the gutter follows it along the axis. */
18
+ viewport?: Viewport;
19
+ /** The app color scheme. */
20
+ colorScheme?: ThemeMode;
21
+ /** Renders a group's collapse / expand button. Defaults to `OutlineButton`. */
22
+ renderButton?: (props: OutlineButtonProps) => React.ReactNode;
23
+ /** The space around the buttons, in pixels: between neighbors, before the first and after the last. */
24
+ laneGap?: number;
25
+ /** Space between a bracket's end and its button, in pixels. */
26
+ bracketGap?: number;
27
+ }
28
+ /**
29
+ * The outline gutter for one axis: the brackets and collapse buttons of the row or column groups.
30
+ *
31
+ * @remarks
32
+ * Built like `SheetHeaderElement` — its own `GridSurface` over the header's offsets, following the
33
+ * sheet's viewport along the axis, so it scrolls, zooms, hides and freezes with the headers. The
34
+ * owner decides whether there is one (see `ISheetView.isShowOutlineSymbols` and `getLevelCount`) and sizes
35
+ * it.
36
+ *
37
+ * It is app chrome, not header: it declares the `app` surface and paints no fill, so it shows what
38
+ * the sheet sits on, as the level buttons beside it do.
39
+ */
40
+ export declare const SheetOutlineElement: React.MemoExoticComponent<(props: SheetOutlineElementProps) => React.JSX.Element>;
41
+ export interface SheetOutlineLevelsProps extends React.HTMLAttributes<HTMLElement> {
42
+ /** The sheet whose outline the buttons show levels of. */
43
+ sheet: ISheet;
44
+ /** Rows or columns. */
45
+ axis: IRange.Axis;
46
+ /** The number of buttons: one per level, plus one. */
47
+ lanes: number;
48
+ /** The size of one lane, in pixels. */
49
+ laneSize: number;
50
+ /**
51
+ * The space around the buttons, in pixels: between neighbors, before the first and after the last.
52
+ *
53
+ * @defaultValue 1
54
+ */
55
+ laneGap?: number;
56
+ /** The app color scheme. */
57
+ colorScheme?: ThemeMode;
58
+ /** Renders a level button. Defaults to `OutlineLevelButton`. */
59
+ renderLevelButton?: (props: OutlineLevelButtonProps) => React.ReactNode;
60
+ }
61
+ /**
62
+ * The level buttons `1`..`n` for one axis: button *k* shows the groups above level *k* and collapses
63
+ * the rest (`IOutline.setVisibleLevels`).
64
+ *
65
+ * @remarks
66
+ * Row buttons run across the row gutter (beside the column headers); column buttons run down the
67
+ * column gutter (beside the row headers), one per lane.
68
+ */
69
+ export declare const SheetOutlineLevels: React.MemoExoticComponent<(props: SheetOutlineLevelsProps) => React.JSX.Element>;
70
+ //# sourceMappingURL=SheetOutlineElement.d.ts.map
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=DefaultMovableRenderers.d.ts.map
@@ -1 +0,0 @@
1
- var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,n)=>{let r={};for(var i in e)t(r,i,{get:e[i],enumerable:!0});return n||t(r,Symbol.toStringTag,{value:`Module`}),r},s=(o,s,c)=>(c=o==null?{}:e(i(o)),((e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c,l=r(i),u=0,d=l.length;u<d;u++)c=l[u],a.call(e,c)||c===o||t(e,c,{get:(e=>i[e]).bind(null,c),enumerable:!(s=n(i,c))||s.enumerable});return e})(!s&&o&&o.__esModule?c:t(c,`default`,{value:o,enumerable:!0}),o));Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return o}});