@rowsncolumns/ui 16.0.5 → 16.1.0

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 (57) hide show
  1. package/dist/cjs/dialog/index.d.ts +6 -0
  2. package/dist/cjs/dialog/index.d.ts.map +1 -1
  3. package/dist/cjs/dialog/index.js +4 -2
  4. package/dist/cjs/dropdown/index.d.ts +4 -1
  5. package/dist/cjs/dropdown/index.d.ts.map +1 -1
  6. package/dist/cjs/dropdown/index.js +22 -3
  7. package/dist/cjs/editor-pm/prosemirror-editor.d.ts.map +1 -1
  8. package/dist/cjs/editor-pm/prosemirror-editor.js +46 -4
  9. package/dist/cjs/editor-pm/schema.d.ts +1 -1
  10. package/dist/cjs/hooks/use-menu-opening-release-guard.d.ts +28 -0
  11. package/dist/cjs/hooks/use-menu-opening-release-guard.d.ts.map +1 -0
  12. package/dist/cjs/hooks/use-menu-opening-release-guard.js +108 -0
  13. package/dist/cjs/index.d.ts +2 -0
  14. package/dist/cjs/index.d.ts.map +1 -1
  15. package/dist/cjs/index.js +2 -0
  16. package/dist/cjs/popover/index.d.ts +4 -1
  17. package/dist/cjs/popover/index.d.ts.map +1 -1
  18. package/dist/cjs/popover/index.js +7 -1
  19. package/dist/cjs/portal-container/index.d.ts +23 -0
  20. package/dist/cjs/portal-container/index.d.ts.map +1 -0
  21. package/dist/cjs/portal-container/index.js +22 -0
  22. package/dist/cjs/select/index.d.ts +7 -2
  23. package/dist/cjs/select/index.d.ts.map +1 -1
  24. package/dist/cjs/select/index.js +9 -3
  25. package/dist/cjs/tooltip/index.d.ts +5 -1
  26. package/dist/cjs/tooltip/index.d.ts.map +1 -1
  27. package/dist/cjs/tooltip/index.js +9 -2
  28. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  29. package/dist/esm/dialog/index.d.ts +6 -0
  30. package/dist/esm/dialog/index.d.ts.map +1 -1
  31. package/dist/esm/dialog/index.js +6 -2
  32. package/dist/esm/dropdown/index.d.ts +4 -1
  33. package/dist/esm/dropdown/index.d.ts.map +1 -1
  34. package/dist/esm/dropdown/index.js +22 -2
  35. package/dist/esm/editor-pm/prosemirror-editor.d.ts.map +1 -1
  36. package/dist/esm/editor-pm/prosemirror-editor.js +46 -4
  37. package/dist/esm/editor-pm/schema.d.ts +1 -1
  38. package/dist/esm/hooks/use-menu-opening-release-guard.d.ts +28 -0
  39. package/dist/esm/hooks/use-menu-opening-release-guard.d.ts.map +1 -0
  40. package/dist/esm/hooks/use-menu-opening-release-guard.js +102 -0
  41. package/dist/esm/index.d.ts +2 -0
  42. package/dist/esm/index.d.ts.map +1 -1
  43. package/dist/esm/index.js +2 -0
  44. package/dist/esm/popover/index.d.ts +4 -1
  45. package/dist/esm/popover/index.d.ts.map +1 -1
  46. package/dist/esm/popover/index.js +6 -1
  47. package/dist/esm/portal-container/index.d.ts +23 -0
  48. package/dist/esm/portal-container/index.d.ts.map +1 -0
  49. package/dist/esm/portal-container/index.js +17 -0
  50. package/dist/esm/select/index.d.ts +7 -2
  51. package/dist/esm/select/index.d.ts.map +1 -1
  52. package/dist/esm/select/index.js +7 -2
  53. package/dist/esm/tooltip/index.d.ts +5 -1
  54. package/dist/esm/tooltip/index.d.ts.map +1 -1
  55. package/dist/esm/tooltip/index.js +8 -2
  56. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  57. package/package.json +5 -5
@@ -1,5 +1,11 @@
1
1
  import * as DialogPrimitive from "@radix-ui/react-dialog";
2
2
  import React from "react";
3
+ export declare const DialogPortal: {
4
+ ({ children, className, container, ...props }: DialogPrimitive.DialogPortalProps & {
5
+ className?: string;
6
+ }): React.JSX.Element;
7
+ displayName: string | undefined;
8
+ };
3
9
  export declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
4
10
  export declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
5
11
  export declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AA6C1B,eAAO,MAAM,WAAW,oKAYtB,CAAC;AAGH,eAAO,MAAM,iBAAiB,8KAY5B,CAAC;AAkBH,eAAO,MAAM,aAAa;sBAGJ,MAAM;gBACZ,WAAW,GAAG,IAAI;wCA8ChC,CAAC;AAGH,eAAO,MAAM,MAAM,uCAAuB,CAAC;AAC3C,eAAO,MAAM,aAAa,8GAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,4GAAwB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,4KAS5B,CAAC;AAGH,eAAO,MAAM,UAAU,GAAI,0BAGxB;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAEA,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../dialog/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,MAAM,OAAO,CAAC;AA2B1B,eAAO,MAAM,YAAY;mDAKtB,eAAe,CAAC,iBAAiB,GAAG;QAAE,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE;;CAc5D,CAAC;AAGF,eAAO,MAAM,WAAW,oKAYtB,CAAC;AAGH,eAAO,MAAM,iBAAiB,8KAY5B,CAAC;AAkBH,eAAO,MAAM,aAAa;sBAGJ,MAAM;gBACZ,WAAW,GAAG,IAAI;wCA8ChC,CAAC;AAGH,eAAO,MAAM,MAAM,uCAAuB,CAAC;AAC3C,eAAO,MAAM,aAAa,8GAA0B,CAAC;AACrD,eAAO,MAAM,WAAW,4GAAwB,CAAC;AAEjD,eAAO,MAAM,iBAAiB,4KAS5B,CAAC;AAGH,eAAO,MAAM,UAAU,GAAI,0BAGxB;IACD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,sBAEA,CAAC"}
@@ -4,6 +4,7 @@ import { useRef } from "react";
4
4
  import React from "react";
5
5
  import Draggable from "react-draggable";
6
6
  import { IconButton } from "./../icon-button";
7
+ import { usePortalContainer } from "./../portal-container";
7
8
  import { cn } from "./../utils";
8
9
  var FOCUSABLE_SELECTOR = "a[href], button, input, select, textarea, [tabindex], [contenteditable]";
9
10
  var TEXT_ENTRY_SELECTOR = 'input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), textarea, [contenteditable]:not([contenteditable="false"])';
@@ -28,9 +29,10 @@ var firstTabbable = function (container) {
28
29
  }
29
30
  return null;
30
31
  };
31
- var DialogPortal = function (_a) {
32
+ export var DialogPortal = function (_a) {
32
33
  var children = _a.children, className = _a.className, container = _a.container, props = __rest(_a, ["children", "className", "container"]);
33
- return (React.createElement(DialogPrimitive.Portal, __assign({ container: container }, props),
34
+ var portalContainer = usePortalContainer();
35
+ return (React.createElement(DialogPrimitive.Portal, __assign({ container: container !== null && container !== void 0 ? container : portalContainer }, props),
34
36
  React.createElement("div", { className: cn("fixed inset-0 z-50 flex items-start justify-center sm:items-center pointer-events-none", className) }, children)));
35
37
  };
36
38
  DialogPortal.displayName = DialogPrimitive.Portal.displayName;
@@ -4,7 +4,10 @@ export declare const DropdownRightSlot: ({ className, ...props }: React.Componen
4
4
  export declare const DropdownLeftSlot: ({ className, ...props }: React.ComponentPropsWithoutRef<"div">) => React.JSX.Element;
5
5
  export declare const DropdownMenu: React.FC<DropdownMenuPrimitive.DropdownMenuProps>;
6
6
  export declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
7
- export declare const DropdownMenuPortal: React.FC<DropdownMenuPrimitive.DropdownMenuPortalProps>;
7
+ export declare const DropdownMenuPortal: {
8
+ ({ container, ...props }: DropdownMenuPrimitive.DropdownMenuPortalProps): React.JSX.Element;
9
+ displayName: string | undefined;
10
+ };
8
11
  export declare const DropdownMenuRadioGroup: React.ForwardRefExoticComponent<DropdownMenuPrimitive.DropdownMenuRadioGroupProps & React.RefAttributes<HTMLDivElement>>;
9
12
  export declare const DropdownMenuContent: React.ForwardRefExoticComponent<Omit<DropdownMenuPrimitive.DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
10
13
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../dropdown/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,qBAAqB,MAAM,+BAA+B,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,iBAAiB,GAAI,yBAG/B,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,sBAUvC,CAAC;AACF,eAAO,MAAM,gBAAgB,GAAI,yBAG9B,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,sBAOvC,CAAC;AAGF,eAAO,MAAM,YAAY,mDAA6B,CAAC;AACvD,eAAO,MAAM,mBAAmB,0HAAgC,CAAC;AACjE,eAAO,MAAM,kBAAkB,yDAA+B,CAAC;AAE/D,eAAO,MAAM,sBAAsB,0HAAmC,CAAC;AAWvE,eAAO,MAAM,mBAAmB;IAP9B;;;OAGG;iCAC0B,OAAO;wCA6BrC,CAAC;AAGF,eAAO,MAAM,gBAAgB;YAGjB,OAAO;wCAYjB,CAAC;AAGH,eAAO,MAAM,uBAAuB;YAKxB,OAAO;2CAYjB,CAAC;AAIH,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,CAAC;AAGH,eAAO,MAAM,yBAAyB,kLAcpC,CAAC;AAIH,eAAO,MAAM,eAAe,sDAA4B,CAAC;AAEzD,eAAO,MAAM,sBAAsB;YAGvB,OAAO;wCAcjB,CAAC;AAKH,eAAO,MAAM,sBAAsB,6KAYjC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { __assign, __rest } from "tslib";
2
2
  import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
3
3
  import React from "react";
4
+ import { useMenuOpeningReleaseGuard } from "../hooks/use-menu-opening-release-guard";
5
+ import { usePortalContainer } from "../portal-container";
4
6
  import { cn } from "../utils";
5
7
  export var DropdownRightSlot = function (_a) {
6
8
  var className = _a.className, props = __rest(_a, ["className"]);
@@ -13,11 +15,28 @@ export var DropdownLeftSlot = function (_a) {
13
15
  // export const DropdownMenuItemStandalone = StyledStandaloneItem;
14
16
  export var DropdownMenu = DropdownMenuPrimitive.Root;
15
17
  export var DropdownMenuTrigger = DropdownMenuPrimitive.Trigger;
16
- export var DropdownMenuPortal = DropdownMenuPrimitive.Portal;
18
+ export var DropdownMenuPortal = function (_a) {
19
+ var container = _a.container, props = __rest(_a, ["container"]);
20
+ var portalContainer = usePortalContainer();
21
+ return (React.createElement(DropdownMenuPrimitive.Portal, __assign({ container: container !== null && container !== void 0 ? container : portalContainer }, props)));
22
+ };
23
+ DropdownMenuPortal.displayName = DropdownMenuPrimitive.Portal.displayName;
17
24
  export var DropdownMenuRadioGroup = DropdownMenuPrimitive.RadioGroup;
18
25
  export var DropdownMenuContent = React.forwardRef(function (_a, ref) {
19
- var className = _a.className, _b = _a.sideOffset, sideOffset = _b === void 0 ? 4 : _b, _c = _a.constrainToAvailableHeight, constrainToAvailableHeight = _c === void 0 ? true : _c, props = __rest(_a, ["className", "sideOffset", "constrainToAvailableHeight"]);
20
- return (React.createElement(DropdownMenuPrimitive.Content, __assign({ ref: ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border border-solid border-rnc-border bg-rnc-popover p-1 text-rnc-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", constrainToAvailableHeight && "max-h-dropdown", "overflow-auto font-system", "rnc-dropdown", className) }, props)));
26
+ var className = _a.className, _b = _a.sideOffset, sideOffset = _b === void 0 ? 4 : _b, _c = _a.constrainToAvailableHeight, constrainToAvailableHeight = _c === void 0 ? true : _c, onPointerDownCapture = _a.onPointerDownCapture, onPointerMoveCapture = _a.onPointerMoveCapture, onPointerUpCapture = _a.onPointerUpCapture, props = __rest(_a, ["className", "sideOffset", "constrainToAvailableHeight", "onPointerDownCapture", "onPointerMoveCapture", "onPointerUpCapture"]);
27
+ // The content mounts while the press that opened the menu is still down, and it may land under
28
+ // that press; its release must not choose an item (see the hook).
29
+ var openingRelease = useMenuOpeningReleaseGuard(ref);
30
+ return (React.createElement(DropdownMenuPrimitive.Content, __assign({ ref: openingRelease.ref, sideOffset: sideOffset, className: cn("z-50 min-w-[8rem] overflow-hidden rounded-md border border-solid border-rnc-border bg-rnc-popover p-1 text-rnc-popover-foreground shadow-md animate-in data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2", constrainToAvailableHeight && "max-h-dropdown", "overflow-auto font-system", "rnc-dropdown", className), onPointerDownCapture: function (event) {
31
+ onPointerDownCapture === null || onPointerDownCapture === void 0 ? void 0 : onPointerDownCapture(event);
32
+ openingRelease.onPointerDownCapture();
33
+ }, onPointerMoveCapture: function (event) {
34
+ onPointerMoveCapture === null || onPointerMoveCapture === void 0 ? void 0 : onPointerMoveCapture(event);
35
+ openingRelease.onPointerMoveCapture(event);
36
+ }, onPointerUpCapture: function (event) {
37
+ onPointerUpCapture === null || onPointerUpCapture === void 0 ? void 0 : onPointerUpCapture(event);
38
+ openingRelease.onPointerUpCapture(event);
39
+ } }, props)));
21
40
  });
22
41
  DropdownMenuContent.displayName = DropdownMenuPrimitive.Content.displayName;
23
42
  export var DropdownMenuItem = React.forwardRef(function (_a, ref) {
@@ -1 +1 @@
1
- {"version":3,"file":"prosemirror-editor.d.ts","sourceRoot":"","sources":["../../../editor-pm/prosemirror-editor.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAK9E,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,qBAAqB,CAAC;AAY7B,OAAO,KAAK,EAAE,OAAO,EAAC,MAAM,mBAAmB,CAAC;AAIhD,OAAO,KAQN,MAAM,OAAO,CAAC;AAOf,OAAO,KAAK,EACV,wBAAwB,EAAC,MAAM,gCAAgC,CAAC;AASlE,OAAO,EAOL,KAAK,gBAAgB,EAEtB,MAAM,WAAW,CAAC;AACnB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAMnE,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAoBzD,MAAM,MAAM,uBAAuB,GAAG,IAAI,CACxC,KAAK,CAAC,sBAAsB,CAAC,cAAc,CAAC,EAC5C,UAAU,GAAG,UAAU,GAAG,QAAQ,GAAG,SAAS,GAAG,OAAO,CACzD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,SAAS,EAAE,OAYvB,CAAC;AAEF,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAEnE,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,YAAY,GA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24,7 @@ import { SuggestionsDropdown as DefaultSuggestionsDropdown } from "../editor/sug
24
24
  import { useCycleFormulaReference } from "../hooks/use-cycle-reference";
25
25
  import { useDropdown } from "../hooks/use-dropdown";
26
26
  import { useIsomorphicLayoutEffect } from "../hooks/use-isomorphic-layout-effect.ts";
27
+ import { usePortalContainer } from "../portal-container";
27
28
  import { cn } from "../utils";
28
29
  import { createDecorationPlugin } from "./decoration-plugin";
29
30
  import { applyTextFormatRuns, applyTextFormatToSelection, deserializeString, getPropertyStartIndex, getSelectionFontSize, isCellToken, serializeEditorValue, } from "./helpers";
@@ -67,6 +68,9 @@ export var ProseMirrorEditorThatMayError = memo(forwardRef(function (_a, forward
67
68
  var _c = _a.value, value = _c === void 0 ? "" : _c, isNewValue = _a.isNewValue, formulaMode = _a.formulaMode, onChange = _a.onChange, autoFocus = _a.autoFocus, className = _a.className, onKeyDown = _a.onKeyDown, disabled = _a.disabled, _d = _a.showDropdown, showDropdown = _d === void 0 ? true : _d, _e = _a.persistFocus, persistFocus = _e === void 0 ? true : _e, editorZeroOutline = _a.editorZeroOutline, showFormulaHelp = _a.showFormulaHelp, onHideFormulaHelp = _a.onHideFormulaHelp, onShowFormulaHelp = _a.onShowFormulaHelp, tokenizer = _a.tokenizer, onCancel = _a.onCancel, onSubmit = _a.onSubmit, onFormulaStateChange = _a.onFormulaStateChange, dropdownStyles = _a.dropdownStyles, options = _a.options, isOptionSelected = _a.isOptionSelected, functionDescriptions = _a.functionDescriptions, shouldFetchFunctionParametersProp = _a.shouldFetchFunctionParameters, getFunctionParameterSuggestionsProp = _a.getFunctionParameterSuggestions, formulaLocale = _a.formulaLocale, getMentions = _a.getMentions, getNamedRanges = _a.getNamedRanges, getTableNames = _a.getTableNames, getTableColumnNames = _a.getTableColumnNames, getStructuredProperties = _a.getStructuredProperties, onTeardown = _a.onTeardown, _f = _a.SuggestionsDropdown, SuggestionsDropdown = _f === void 0 ? DefaultSuggestionsDropdown : _f, MentionTagComponent = _a.MentionTagComponent, MentionDropdownItemComponent = _a.MentionDropdownItemComponent, isActive = _a.isActive, _g = _a.stickyEditor, stickyEditor = _g === void 0 ? true : _g, onFocus = _a.onFocus, onBlur = _a.onBlur, onCopy = _a.onCopy, onCut = _a.onCut, onPaste = _a.onPaste, placeholder = _a.placeholder, textFormatRuns = _a.textFormatRuns, resolveRunColor = _a.resolveRunColor, navigationMode = _a.navigationMode, enableContinuousSelection = _a.enableContinuousSelection, cellFontFamily = _a.cellFontFamily, props = __rest(_a, ["value", "isNewValue", "formulaMode", "onChange", "autoFocus", "className", "onKeyDown", "disabled", "showDropdown", "persistFocus", "editorZeroOutline", "showFormulaHelp", "onHideFormulaHelp", "onShowFormulaHelp", "tokenizer", "onCancel", "onSubmit", "onFormulaStateChange", "dropdownStyles", "options", "isOptionSelected", "functionDescriptions", "shouldFetchFunctionParameters", "getFunctionParameterSuggestions", "formulaLocale", "getMentions", "getNamedRanges", "getTableNames", "getTableColumnNames", "getStructuredProperties", "onTeardown", "SuggestionsDropdown", "MentionTagComponent", "MentionDropdownItemComponent", "isActive", "stickyEditor", "onFocus", "onBlur", "onCopy", "onCut", "onPaste", "placeholder", "textFormatRuns", "resolveRunColor", "navigationMode", "enableContinuousSelection", "cellFontFamily"]);
68
69
  var editorRef = useRef(null);
69
70
  var viewRef = useRef(null);
71
+ var portalContainer = usePortalContainer();
72
+ /** The `history()` plugin instance the view was created with — see `resetUndoHistory`. */
73
+ var historyPluginRef = useRef(null);
70
74
  var cellFontFamilyRef = useRef(cellFontFamily);
71
75
  // The function token is in the editor's locale (`СУММ(`); hosts are asked about the canonical
72
76
  // name (`SUM(`) so parameter providers keyed on English names work in every locale.
@@ -332,10 +336,12 @@ export var ProseMirrorEditorThatMayError = memo(forwardRef(function (_a, forward
332
336
  if (!editorRef.current)
333
337
  return;
334
338
  try {
339
+ var historyPlugin = history();
340
+ historyPluginRef.current = historyPlugin;
335
341
  var state = EditorState.create({
336
342
  doc: createInitialDocument(),
337
343
  plugins: __spreadArray(__spreadArray([
338
- history(),
344
+ historyPlugin,
339
345
  createUnfocusedSelectionPlugin()
340
346
  ], __read((placeholder ? [createPlaceholderPlugin(placeholder)] : [])), false), [
341
347
  createMentionsPlugin({
@@ -607,6 +613,32 @@ export var ProseMirrorEditorThatMayError = memo(forwardRef(function (_a, forward
607
613
  }
608
614
  }
609
615
  }, [createInitialDocument]); // Re-initialize if document creation logic changes
616
+ /**
617
+ * Drop the undo/redo stacks. The grid keeps ONE editor mounted across every cell it edits
618
+ * (the sticky buffer stays alive while navigating), so without a cut the `history()` plugin
619
+ * accumulates the typing of every previous cell: editing C1 and pressing Mod-z walked back
620
+ * into B1's and then A1's text (rowsncolumns/spreadsheet#1023). Undo is scoped to what the
621
+ * user typed in THIS editor since the host last seeded it. Re-adding the plugin through two
622
+ * `reconfigure`s re-runs only its `init`; every other plugin keeps its state (decorations,
623
+ * mentions, the unfocused-selection paint).
624
+ */
625
+ var resetUndoHistory = useCallback(function () {
626
+ var view = viewRef.current;
627
+ var historyPlugin = historyPluginRef.current;
628
+ if (!view || !historyPlugin)
629
+ return;
630
+ var plugins = view.state.plugins;
631
+ if (!plugins.includes(historyPlugin))
632
+ return;
633
+ try {
634
+ view.updateState(view.state
635
+ .reconfigure({ plugins: plugins.filter(function (p) { return p !== historyPlugin; }) })
636
+ .reconfigure({ plugins: plugins }));
637
+ }
638
+ catch (error) {
639
+ log("Error resetting undo history:", error);
640
+ }
641
+ }, []);
610
642
  // Update editor content when value changes
611
643
  useIsomorphicLayoutEffect(function () {
612
644
  if (viewRef.current) {
@@ -625,13 +657,23 @@ export var ProseMirrorEditorThatMayError = memo(forwardRef(function (_a, forward
625
657
  tr.setSelection(TextSelection.atEnd(tr.doc));
626
658
  }
627
659
  viewRef.current.dispatch(tr);
660
+ // A whole-document seed is host state, not a user edit: nothing before it may be
661
+ // undone into (#1023), and the seed itself is not undoable either.
662
+ resetUndoHistory();
628
663
  }
629
664
  }
630
665
  catch (error) {
631
666
  log("Error updating editor content:", error);
632
667
  }
633
668
  }
634
- }, [value, createInitialDocument]);
669
+ }, [value, createInitialDocument, resetUndoHistory]);
670
+ // An edit session starts and ends with `navigationMode` flipping (the grid's `use-editable`
671
+ // sets it to `!isEditInProgress`). Cut the history on both edges so a cell opened with the
672
+ // same text the buffer already held — no seed dispatched — still starts with an empty
673
+ // undo stack (#1023).
674
+ useIsomorphicLayoutEffect(function () {
675
+ resetUndoHistory();
676
+ }, [navigationMode, resetUndoHistory]);
635
677
  // Update decorations when formula mode, active state or the caret
636
678
  // position changes. A change of mode/active state re-runs the token
637
679
  // analysis (it depends on `isActive`); a caret-only refresh is tagged so
@@ -1247,10 +1289,10 @@ export var ProseMirrorEditorThatMayError = memo(forwardRef(function (_a, forward
1247
1289
  React.createElement("button", { tabIndex: -1, className: cn("absolute left-0 top-0 w-0 h-full overflow-hidden m-0 p-0 border-none bg-transparent shadow-none"), style: {
1248
1290
  left: showMentionDropdownEffective ? mentionPositionLeft : 0,
1249
1291
  } })),
1250
- showDropdownEffective && isDropdownOpen && (React.createElement(ConditionalWrapper, { condition: stickyEditor, wrapper: function (children) { return React.createElement(Portal, { asChild: true }, children); } },
1292
+ showDropdownEffective && isDropdownOpen && (React.createElement(ConditionalWrapper, { condition: stickyEditor, wrapper: function (children) { return (React.createElement(Portal, { asChild: true, container: portalContainer }, children)); } },
1251
1293
  React.createElement(Popper.Content, { side: "bottom", align: "start", className: "z-50", sideOffset: 2 },
1252
1294
  React.createElement(SuggestionsDropdown, { functionDescriptions: functionDescriptions, formulaMode: formulaMode, dropdownStyles: dropdownStyles, functionToken: functionToken, parameterIndex: parameterIndex, items: items, highlightedIndex: highlightedIndex, onSelect: onSelect, onChangeHighlightedIndex: onChangeHighlightedIndex, showFormulaHelp: showFormulaHelp, onHideFormulaHelp: onHideFormulaHelp, formulaLocale: formulaLocale })))),
1253
- showDropdownEffective && showMentionDropdownEffective && (React.createElement(ConditionalWrapper, { condition: stickyEditor, wrapper: function (children) { return React.createElement(Portal, { asChild: true }, children); } },
1295
+ showDropdownEffective && showMentionDropdownEffective && (React.createElement(ConditionalWrapper, { condition: stickyEditor, wrapper: function (children) { return (React.createElement(Portal, { asChild: true, container: portalContainer }, children)); } },
1254
1296
  React.createElement(Popper.Content, { side: "bottom", align: "start", className: "z-50", sideOffset: 2 },
1255
1297
  React.createElement(MentionsDropdown, { mentions: mentions, onSelect: handleInsertMention, highlightedIndex: mentionHighlightedIndex, isFetchingMentions: isFetchingMentions, MentionDropdownItemComponent: MentionDropdownItemComponent }))))));
1256
1298
  }));
@@ -1,3 +1,3 @@
1
1
  import { Schema } from "prosemirror-model";
2
- export declare const schema: Schema<"text" | "line" | "mention" | "doc", "link" | "color" | "bold" | "fontFamily" | "fontSize" | "italic" | "strikethrough" | "underline" | "superscript" | "subscript">;
2
+ export declare const schema: Schema<"text" | "line" | "mention" | "doc", "link" | "color" | "bold" | "fontFamily" | "fontSize" | "superscript" | "subscript" | "italic" | "underline" | "strikethrough">;
3
3
  //# sourceMappingURL=schema.d.ts.map
@@ -0,0 +1,28 @@
1
+ import type { ForwardedRef, PointerEvent as ReactPointerEvent, RefCallback } from "react";
2
+ /** How far the pointer may drift while the opening press is held and still not count as a drag. */
3
+ export declare const MENU_OPENING_RELEASE_SLOP_PX = 4;
4
+ /**
5
+ * Keeps the release of the press that opened a menu from choosing an item.
6
+ *
7
+ * A context menu opens on `contextmenu`, while that press is still down, with the content's corner
8
+ * at the pointer; a trigger's menu opens on its pointerdown. Near the viewport's right or bottom
9
+ * edge the content shifts or flips under the pointer to fit, and it slides in from 8 px off, so the
10
+ * release can land on an item. Radix selects an item on any pointer-up it saw no pointer-down for
11
+ * (to let a person press, drag onto an item and release), so a quick right-click there ran the item
12
+ * under the pointer and closed the menu. The content now swallows that release unless the pointer
13
+ * travelled more than {@link MENU_OPENING_RELEASE_SLOP_PX} from where the menu opened: press, drag
14
+ * and release still chooses the item it ends on, in any number of moves. A press that starts inside
15
+ * the content is a choice of its own, and a new right-click re-arms the guard.
16
+ *
17
+ * The guard arms when the content element mounts, which is when the menu opens. Spread the returned
18
+ * props on the content: `ref` arms it (and forwards the node to `forwardedRef`), and the capture
19
+ * handlers prevent the release's default action, which is what Radix's item reads
20
+ * (`composeEventHandlers` skips a default-prevented pointer-up), so nothing else loses the event.
21
+ */
22
+ export declare function useMenuOpeningReleaseGuard<T extends HTMLElement>(forwardedRef: ForwardedRef<T>): {
23
+ ref: RefCallback<T>;
24
+ onPointerDownCapture: () => void;
25
+ onPointerMoveCapture: (event: ReactPointerEvent<HTMLElement>) => void;
26
+ onPointerUpCapture: (event: ReactPointerEvent) => void;
27
+ };
28
+ //# sourceMappingURL=use-menu-opening-release-guard.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"use-menu-opening-release-guard.d.ts","sourceRoot":"","sources":["../../../hooks/use-menu-opening-release-guard.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,IAAI,iBAAiB,EACjC,WAAW,EACZ,MAAM,OAAO,CAAC;AAGf,mGAAmG;AACnG,eAAO,MAAM,4BAA4B,IAAI,CAAC;AA2B9C;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,0BAA0B,CAAC,CAAC,SAAS,WAAW,EAC9D,YAAY,EAAE,YAAY,CAAC,CAAC,CAAC,GAC5B;IACD,GAAG,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC;IACpB,oBAAoB,EAAE,MAAM,IAAI,CAAC;IACjC,oBAAoB,EAAE,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACtE,kBAAkB,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,IAAI,CAAC;CACxD,CAiEA"}
@@ -0,0 +1,108 @@
1
+ import { useCallback, useRef } from "react";
2
+ /** How far the pointer may drift while the opening press is held and still not count as a drag. */
3
+ export var MENU_OPENING_RELEASE_SLOP_PX = 4;
4
+ var clamp = function (value, min, max) {
5
+ return Math.min(Math.max(value, min), max);
6
+ };
7
+ /**
8
+ * Where the press that opened the menu was, as near as the content can tell: the point of its
9
+ * trigger closest to the pointer. Radix labels the content with its trigger (`aria-labelledby`).
10
+ * A context menu opens around a 0 × 0 trigger placed at the right-click, so that is the press
11
+ * itself; for a button it is the press when the press was on the button. `null` when the content
12
+ * has no trigger to read.
13
+ */
14
+ function readOpeningPoint(content, pointer) {
15
+ var triggerId = content.getAttribute("aria-labelledby");
16
+ var trigger = triggerId
17
+ ? content.ownerDocument.getElementById(triggerId)
18
+ : null;
19
+ if (!trigger)
20
+ return null;
21
+ var rect = trigger.getBoundingClientRect();
22
+ return {
23
+ x: clamp(pointer.x, rect.left, rect.right),
24
+ y: clamp(pointer.y, rect.top, rect.bottom),
25
+ };
26
+ }
27
+ /**
28
+ * Keeps the release of the press that opened a menu from choosing an item.
29
+ *
30
+ * A context menu opens on `contextmenu`, while that press is still down, with the content's corner
31
+ * at the pointer; a trigger's menu opens on its pointerdown. Near the viewport's right or bottom
32
+ * edge the content shifts or flips under the pointer to fit, and it slides in from 8 px off, so the
33
+ * release can land on an item. Radix selects an item on any pointer-up it saw no pointer-down for
34
+ * (to let a person press, drag onto an item and release), so a quick right-click there ran the item
35
+ * under the pointer and closed the menu. The content now swallows that release unless the pointer
36
+ * travelled more than {@link MENU_OPENING_RELEASE_SLOP_PX} from where the menu opened: press, drag
37
+ * and release still chooses the item it ends on, in any number of moves. A press that starts inside
38
+ * the content is a choice of its own, and a new right-click re-arms the guard.
39
+ *
40
+ * The guard arms when the content element mounts, which is when the menu opens. Spread the returned
41
+ * props on the content: `ref` arms it (and forwards the node to `forwardedRef`), and the capture
42
+ * handlers prevent the release's default action, which is what Radix's item reads
43
+ * (`composeEventHandlers` skips a default-prevented pointer-up), so nothing else loses the event.
44
+ */
45
+ export function useMenuOpeningReleaseGuard(forwardedRef) {
46
+ // Whether the press that opened the menu may still be down.
47
+ var armedRef = useRef(false);
48
+ // Where that press was, to measure a drag from; read from the trigger when first needed.
49
+ var originRef = useRef(null);
50
+ // The content element last mounted. A re-attached ref hands back the same element and is not a
51
+ // new open, so it does not re-arm; a menu that opens again mounts a new element.
52
+ var mountedRef = useRef(null);
53
+ var detachRef = useRef(null);
54
+ var ref = useCallback(function (node) {
55
+ var _a;
56
+ if (typeof forwardedRef === "function")
57
+ forwardedRef(node);
58
+ else if (forwardedRef)
59
+ forwardedRef.current = node;
60
+ (_a = detachRef.current) === null || _a === void 0 ? void 0 : _a.call(detachRef);
61
+ detachRef.current = null;
62
+ if (!node)
63
+ return;
64
+ // A right-click while the menu is open opens it again: its release is an opening one too.
65
+ // Heard on the content's document, so a popped-out window's menu counts.
66
+ var doc = node.ownerDocument;
67
+ var onContextMenu = function (event) {
68
+ armedRef.current = true;
69
+ originRef.current = { x: event.clientX, y: event.clientY };
70
+ };
71
+ doc.addEventListener("contextmenu", onContextMenu, true);
72
+ detachRef.current = function () {
73
+ return doc.removeEventListener("contextmenu", onContextMenu, true);
74
+ };
75
+ if (node === mountedRef.current)
76
+ return;
77
+ mountedRef.current = node;
78
+ // The content mounts as the menu opens: the press that opened it is still down.
79
+ armedRef.current = true;
80
+ originRef.current = null;
81
+ }, [forwardedRef]);
82
+ var onPointerMoveCapture = useCallback(function (event) {
83
+ var _a;
84
+ if (!armedRef.current)
85
+ return;
86
+ var pointer = { x: event.clientX, y: event.clientY };
87
+ if (!originRef.current) {
88
+ // Without a trigger to read, the first move stands in for the press.
89
+ originRef.current =
90
+ (_a = readOpeningPoint(event.currentTarget, pointer)) !== null && _a !== void 0 ? _a : pointer;
91
+ }
92
+ var origin = originRef.current;
93
+ var travelled = Math.hypot(pointer.x - origin.x, pointer.y - origin.y);
94
+ if (travelled > MENU_OPENING_RELEASE_SLOP_PX)
95
+ armedRef.current = false;
96
+ }, []);
97
+ // A press that starts inside the menu is a choice of its own.
98
+ var onPointerDownCapture = useCallback(function () {
99
+ armedRef.current = false;
100
+ }, []);
101
+ var onPointerUpCapture = useCallback(function (event) {
102
+ if (!armedRef.current)
103
+ return;
104
+ armedRef.current = false;
105
+ event.preventDefault();
106
+ }, []);
107
+ return { ref: ref, onPointerDownCapture: onPointerDownCapture, onPointerMoveCapture: onPointerMoveCapture, onPointerUpCapture: onPointerUpCapture };
108
+ }
@@ -16,6 +16,7 @@ export * from "./hooks/use-isomorphic-layout-effect.ts";
16
16
  export * from "./hooks/use-dropdown-categories";
17
17
  export * from "./conditional-wrapper";
18
18
  export * from "./hooks/use-dropdown";
19
+ export * from "./hooks/use-menu-opening-release-guard";
19
20
  export * from "./utils";
20
21
  export * from "./hooks/use-modal";
21
22
  export * from "./cell-tooltip";
@@ -31,4 +32,5 @@ export * from "./function-info";
31
32
  export * from "./function-info/helpers";
32
33
  export * from "./hooks/use-visibility";
33
34
  export * from "./arrow";
35
+ export * from "./portal-container";
34
36
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,SAAS,CAAC;AACxB,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,mBAAmB,CAAC;AAClC,cAAc,yCAAyC,CAAC;AACxD,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,sBAAsB,CAAC;AACrC,cAAc,wCAAwC,CAAC;AACvD,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,QAAQ,CAAC;AACvB,cAAc,iBAAiB,CAAC;AAChC,cAAc,yBAAyB,CAAC;AACxC,cAAc,wBAAwB,CAAC;AACvC,cAAc,SAAS,CAAC;AACxB,cAAc,oBAAoB,CAAC"}
package/dist/cjs/index.js CHANGED
@@ -16,6 +16,7 @@ export * from "./hooks/use-isomorphic-layout-effect.ts";
16
16
  export * from "./hooks/use-dropdown-categories";
17
17
  export * from "./conditional-wrapper";
18
18
  export * from "./hooks/use-dropdown";
19
+ export * from "./hooks/use-menu-opening-release-guard";
19
20
  export * from "./utils";
20
21
  export * from "./hooks/use-modal";
21
22
  export * from "./cell-tooltip";
@@ -31,3 +32,4 @@ export * from "./function-info";
31
32
  export * from "./function-info/helpers";
32
33
  export * from "./hooks/use-visibility";
33
34
  export * from "./arrow";
35
+ export * from "./portal-container";
@@ -2,7 +2,10 @@ import * as PopoverPrimitive from "@radix-ui/react-popover";
2
2
  import * as React from "react";
3
3
  declare const Popover: React.FC<PopoverPrimitive.PopoverProps>;
4
4
  declare const PopoverTrigger: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverTriggerProps & React.RefAttributes<HTMLButtonElement>>;
5
- declare const PopoverPortal: React.FC<PopoverPrimitive.PopoverPortalProps>;
5
+ declare const PopoverPortal: {
6
+ ({ container, ...props }: PopoverPrimitive.PopoverPortalProps): React.JSX.Element;
7
+ displayName: string | undefined;
8
+ };
6
9
  declare const PopoverAnchor: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverAnchorProps & React.RefAttributes<HTMLDivElement>>;
7
10
  declare const PopoverContent: React.ForwardRefExoticComponent<Omit<PopoverPrimitive.PopoverContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
8
11
  export declare const PopoverArrow: React.ForwardRefExoticComponent<PopoverPrimitive.PopoverArrowProps & React.RefAttributes<SVGSVGElement>>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,OAAO,yCAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAEhD,QAAA,MAAM,aAAa,+CAA0B,CAAC;AAE9C,QAAA,MAAM,aAAa,4GAA0B,CAAC;AAE9C,QAAA,MAAM,cAAc,gKAelB,CAAC;AAGH,eAAO,MAAM,YAAY,0GAAyB,CAAC;AACnD,eAAO,MAAM,YAAY,8GAAyB,CAAC;AACnD,eAAO,MAAM,eAAe,iKAY1B,CAAC;AAIH,eAAO,MAAM,cAAc,GACzB,OAAO,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,sBAOpE,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../popover/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,gBAAgB,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAM/B,QAAA,MAAM,OAAO,yCAAwB,CAAC;AAEtC,QAAA,MAAM,cAAc,gHAA2B,CAAC;AAEhD,QAAA,MAAM,aAAa;8BAGhB,gBAAgB,CAAC,kBAAkB;;CAQrC,CAAC;AAGF,QAAA,MAAM,aAAa,4GAA0B,CAAC;AAE9C,QAAA,MAAM,cAAc,gKAelB,CAAC;AAGH,eAAO,MAAM,YAAY,0GAAyB,CAAC;AACnD,eAAO,MAAM,YAAY,8GAAyB,CAAC;AACnD,eAAO,MAAM,eAAe,iKAY1B,CAAC;AAIH,eAAO,MAAM,cAAc,GACzB,OAAO,KAAK,CAAC,wBAAwB,CAAC,OAAO,gBAAgB,CAAC,IAAI,CAAC,sBAOpE,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,CAAC"}
@@ -2,10 +2,16 @@ import { __assign, __read, __rest } from "tslib";
2
2
  import * as PopoverPrimitive from "@radix-ui/react-popover";
3
3
  import * as React from "react";
4
4
  import { Button } from "../button";
5
+ import { usePortalContainer } from "../portal-container";
5
6
  import { cn } from "./../utils";
6
7
  var Popover = PopoverPrimitive.Root;
7
8
  var PopoverTrigger = PopoverPrimitive.Trigger;
8
- var PopoverPortal = PopoverPrimitive.Portal;
9
+ var PopoverPortal = function (_a) {
10
+ var container = _a.container, props = __rest(_a, ["container"]);
11
+ var portalContainer = usePortalContainer();
12
+ return (React.createElement(PopoverPrimitive.Portal, __assign({ container: container !== null && container !== void 0 ? container : portalContainer }, props)));
13
+ };
14
+ PopoverPortal.displayName = PopoverPrimitive.Portal.displayName;
9
15
  var PopoverAnchor = PopoverPrimitive.Anchor;
10
16
  var PopoverContent = React.forwardRef(function (_a, ref) {
11
17
  var className = _a.className, _b = _a.align, align = _b === void 0 ? "center" : _b, _c = _a.sideOffset, sideOffset = _c === void 0 ? 4 : _c, props = __rest(_a, ["className", "align", "sideOffset"]);
@@ -0,0 +1,23 @@
1
+ import React from "react";
2
+ export type PortalContainerProviderProps = {
3
+ /**
4
+ * Where the subtree's portals mount. A host that renders the grid in a
5
+ * second window (popout, iframe) passes that window's `document.body` so
6
+ * every dialog, menu, popover, select and tooltip opens next to the grid
7
+ * instead of in the main window.
8
+ */
9
+ container?: HTMLElement | null;
10
+ children?: React.ReactNode;
11
+ };
12
+ export declare const PortalContainerProvider: {
13
+ ({ container, children, }: PortalContainerProviderProps): React.JSX.Element;
14
+ displayName: string;
15
+ };
16
+ /**
17
+ * The portal container set by the nearest {@link PortalContainerProvider},
18
+ * or `null` when none is set. Radix portals treat `undefined` and `null`
19
+ * alike (they fall back to `document.body`), so the value can be passed
20
+ * straight through as a `container` prop.
21
+ */
22
+ export declare const usePortalContainer: () => HTMLElement | null;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../portal-container/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAUzD,MAAM,MAAM,4BAA4B,GAAG;IACzC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,uBAAuB;+BAGjC,4BAA4B;;CAI9B,CAAC;AAGF;;;;;GAKG;AACH,eAAO,MAAM,kBAAkB,QAAO,WAAW,GAAG,IAChB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import React, { createContext, useContext } from "react";
2
+ /**
3
+ * The element every portalled surface (dialogs, menus, popovers, selects,
4
+ * tooltips and the editor's suggestion dropdowns) mounts into when the
5
+ * surface is not given its own `container`. `null` keeps Radix's default,
6
+ * the `document.body` of the window running the JS.
7
+ */
8
+ var PortalContainerContext = createContext(null);
9
+ export var PortalContainerProvider = function (_a) {
10
+ var _b = _a.container, container = _b === void 0 ? null : _b, children = _a.children;
11
+ return (React.createElement(PortalContainerContext.Provider, { value: container }, children));
12
+ };
13
+ PortalContainerProvider.displayName = "PortalContainerProvider";
14
+ /**
15
+ * The portal container set by the nearest {@link PortalContainerProvider},
16
+ * or `null` when none is set. Radix portals treat `undefined` and `null`
17
+ * alike (they fall back to `document.body`), so the value can be passed
18
+ * straight through as a `container` prop.
19
+ */
20
+ export var usePortalContainer = function () {
21
+ return useContext(PortalContainerContext);
22
+ };
@@ -3,12 +3,17 @@ import * as React from "react";
3
3
  declare const Select: React.FC<SelectPrimitive.SelectProps>;
4
4
  declare const SelectGroup: React.ForwardRefExoticComponent<SelectPrimitive.SelectGroupProps & React.RefAttributes<HTMLDivElement>>;
5
5
  declare const SelectValue: React.ForwardRefExoticComponent<SelectPrimitive.SelectValueProps & React.RefAttributes<HTMLSpanElement>>;
6
+ export declare const SelectPortal: {
7
+ ({ container, ...props }: SelectPrimitive.SelectPortalProps): React.JSX.Element;
8
+ displayName: string | undefined;
9
+ };
6
10
  declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectTriggerProps & React.RefAttributes<HTMLButtonElement>, "ref"> & React.RefAttributes<HTMLButtonElement>>;
7
- declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
+ declare const SelectContent: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
12
+ container?: HTMLElement | null;
13
+ } & React.RefAttributes<HTMLDivElement>>;
8
14
  declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
9
15
  declare const SelectItem: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectItemProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
16
  declare const SelectSeparator: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectSeparatorProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
11
- export declare const SelectPortal: React.FC<SelectPrimitive.SelectPortalProps>;
12
17
  export declare const SelectViewPort: React.ForwardRefExoticComponent<SelectPrimitive.SelectViewportProps & React.RefAttributes<HTMLDivElement>>;
13
18
  export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };
14
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,aAAa,8JAqBjB,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAoBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,eAAO,MAAM,YAAY,6CAAyB,CAAC;AACnD,eAAO,MAAM,cAAc,4GAA2B,CAAC;AAEvD,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,GAChB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../select/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAE1C,eAAO,MAAM,YAAY;8BAGtB,eAAe,CAAC,iBAAiB;;CAQnC,CAAC;AAGF,QAAA,MAAM,aAAa,oKAiBjB,CAAC;AAGH,QAAA,MAAM,aAAa;gBAGH,WAAW,GAAG,IAAI;wCAoBhC,CAAC;AAGH,QAAA,MAAM,WAAW,4JASf,CAAC;AAGH,QAAA,MAAM,UAAU,2JAoBd,CAAC;AAGH,QAAA,MAAM,eAAe,gKASnB,CAAC;AAGH,eAAO,MAAM,cAAc,4GAA2B,CAAC;AAEvD,OAAO,EACL,MAAM,EACN,WAAW,EACX,WAAW,EACX,aAAa,EACb,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,GAChB,CAAC"}
@@ -3,10 +3,17 @@ import { __assign, __rest } from "tslib";
3
3
  import * as SelectPrimitive from "@radix-ui/react-select";
4
4
  import { CheckIcon, TriangleDownIcon } from "@rowsncolumns/icons";
5
5
  import * as React from "react";
6
+ import { usePortalContainer } from "./../portal-container";
6
7
  import { cn } from "./../utils";
7
8
  var Select = SelectPrimitive.Root;
8
9
  var SelectGroup = SelectPrimitive.Group;
9
10
  var SelectValue = SelectPrimitive.Value;
11
+ export var SelectPortal = function (_a) {
12
+ var container = _a.container, props = __rest(_a, ["container"]);
13
+ var portalContainer = usePortalContainer();
14
+ return (React.createElement(SelectPrimitive.Portal, __assign({ container: container !== null && container !== void 0 ? container : portalContainer }, props)));
15
+ };
16
+ SelectPortal.displayName = SelectPrimitive.Portal.displayName;
10
17
  var SelectTrigger = React.forwardRef(function (_a, ref) {
11
18
  var className = _a.className, children = _a.children, props = __rest(_a, ["className", "children"]);
12
19
  return (React.createElement(SelectPrimitive.Trigger, __assign({ ref: ref, className: cn("flex w-full items-center text-rnc-foreground justify-between rounded-sm border-solid border border-rnc-input bg-transparent px-1 pl-1.5 py-1 text-xs ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-0 disabled:cursor-not-allowed disabled:opacity-50 font-system", className) }, props),
@@ -16,8 +23,8 @@ var SelectTrigger = React.forwardRef(function (_a, ref) {
16
23
  });
17
24
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
18
25
  var SelectContent = React.forwardRef(function (_a, ref) {
19
- var className = _a.className, children = _a.children, _b = _a.position, position = _b === void 0 ? "popper" : _b, props = __rest(_a, ["className", "children", "position"]);
20
- return (React.createElement(SelectPrimitive.Portal, null,
26
+ var className = _a.className, children = _a.children, _b = _a.position, position = _b === void 0 ? "popper" : _b, container = _a.container, props = __rest(_a, ["className", "children", "position", "container"]);
27
+ return (React.createElement(SelectPortal, { container: container },
21
28
  React.createElement(SelectPrimitive.Content, __assign({ ref: ref, className: cn("relative z-50 min-w-[8rem] overflow-hidden rounded-md border border-rnc-border border-solid bg-rnc-popover text-rnc-popover-foreground shadow-md animate-in fade-in-80", position === "popper" && "translate-y-1", "font-system", className), position: position }, props),
22
29
  React.createElement(SelectPrimitive.Viewport, { className: cn("p-1 max-h-select") }, children))));
23
30
  });
@@ -41,6 +48,5 @@ var SelectSeparator = React.forwardRef(function (_a, ref) {
41
48
  return (React.createElement(SelectPrimitive.Separator, __assign({ ref: ref, className: cn("-mx-1 my-1 h-px bg-rnc-muted", className) }, props)));
42
49
  });
43
50
  SelectSeparator.displayName = SelectPrimitive.Separator.displayName;
44
- export var SelectPortal = SelectPrimitive.Portal;
45
51
  export var SelectViewPort = SelectPrimitive.Viewport;
46
52
  export { Select, SelectGroup, SelectValue, SelectTrigger, SelectContent, SelectLabel, SelectItem, SelectSeparator, };