@raylang/react 0.11.0 → 0.12.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.
@@ -6,5 +6,5 @@ import { createComponent } from "../create.js";
6
6
  export const RayInput = /*#__PURE__*/ createComponent("ray-input", {
7
7
  displayName: "RayInput",
8
8
  properties: ["value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
- events: { onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
9
+ events: { onRayComplete: "ray-complete", onRayHighlightHover: "ray-highlight-hover", onInput: "input", onChange: "change" },
10
10
  });
@@ -5,7 +5,7 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayMenu = /*#__PURE__*/ createComponent("ray-menu", {
7
7
  displayName: "RayMenu",
8
- properties: ["open", "placement", "context", "keepOpen", "native", "offset"],
8
+ properties: ["open", "placement", "context", "keepOpen", "native", "anchor", "offset"],
9
9
  events: { onRaySelect: "ray-select", onRayRequestOpen: "ray-request-open", onRayOpen: "ray-open", onRayClose: "ray-close" },
10
10
  });
11
11
  export const RayMenuItem = /*#__PURE__*/ createComponent("ray-menu-item", {
@@ -6,5 +6,5 @@ import { createComponent } from "../create.js";
6
6
  export const RayModeInput = /*#__PURE__*/ createComponent("ray-mode-input", {
7
7
  displayName: "RayModeInput",
8
8
  properties: ["mode", "options", "display", "position", "menuLabel", "nativeMenu", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
- events: { onRayModeChange: "ray-mode-change", onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
9
+ events: { onRayModeChange: "ray-mode-change", onRayComplete: "ray-complete", onRayHighlightHover: "ray-highlight-hover", onInput: "input", onChange: "change" },
10
10
  });
@@ -6,5 +6,5 @@ import { createComponent } from "../create.js";
6
6
  export const RayPasswordInput = /*#__PURE__*/ createComponent("ray-password-input", {
7
7
  displayName: "RayPasswordInput",
8
8
  properties: ["visible", "showLabel", "hideLabel", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
- events: { onRayVisibilityChange: "ray-visibility-change", onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
9
+ events: { onRayVisibilityChange: "ray-visibility-change", onRayComplete: "ray-complete", onRayHighlightHover: "ray-highlight-hover", onInput: "input", onChange: "change" },
10
10
  });
@@ -6,5 +6,5 @@ import { createComponent } from "../create.js";
6
6
  export const RayPathInput = /*#__PURE__*/ createComponent("ray-path-input", {
7
7
  displayName: "RayPathInput",
8
8
  properties: ["mode", "accept", "browseLabel", "dialogTitle", "value", "type", "name", "label", "description", "descriptionPosition", "error", "placeholder", "required", "disabled", "readonly", "size", "radius", "variant", "highlight", "complete", "suggestionsLabel"],
9
- events: { onChange: "change", onRayError: "ray-error", onRayComplete: "ray-complete", onInput: "input" },
9
+ events: { onChange: "change", onRayError: "ray-error", onRayComplete: "ray-complete", onRayHighlightHover: "ray-highlight-hover", onInput: "input" },
10
10
  });
@@ -5,6 +5,6 @@ import { createComponent } from "../create.js";
5
5
 
6
6
  export const RayPopover = /*#__PURE__*/ createComponent("ray-popover", {
7
7
  displayName: "RayPopover",
8
- properties: ["open", "placement", "offset", "width", "matchWidth", "padding", "trapFocus"],
8
+ properties: ["open", "placement", "offset", "anchor", "width", "matchWidth", "padding", "trapFocus"],
9
9
  events: { onRayOpen: "ray-open", onRayClose: "ray-close" },
10
10
  });
@@ -6,5 +6,5 @@ import { createComponent } from "../create.js";
6
6
  export const RayTextarea = /*#__PURE__*/ createComponent("ray-textarea", {
7
7
  displayName: "RayTextarea",
8
8
  properties: ["value", "rows", "autosize", "maxRows", "name", "label", "description", "descriptionPosition", "error", "required", "disabled", "readonly", "size", "variant", "highlight", "complete", "suggestionsLabel", "radius"],
9
- events: { onRayComplete: "ray-complete", onInput: "input", onChange: "change" },
9
+ events: { onRayComplete: "ray-complete", onRayHighlightHover: "ray-highlight-hover", onInput: "input", onChange: "change" },
10
10
  });
package/index.d.ts CHANGED
@@ -550,6 +550,8 @@ export interface RayInputOwnProps {
550
550
  list?: string;
551
551
  /** A suggestion was accepted (the text already has it). */
552
552
  onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
553
+ /** The highlight range under the pointer changed: the range and the box of the line of it the pointer is on, or null on leaving a range. Anchor a ray-popover to rect (its anchor property) to show more than the title. */
554
+ onRayHighlightHover?: (event: CustomEvent<{ range: Ray.HighlightRange | null; rect: DOMRect | null }>) => void;
553
555
  /** On every edit (value already updated). */
554
556
  onInput?: (event: Event) => void;
555
557
  /** When an edit is committed (blur, Enter). */
@@ -632,6 +634,8 @@ export interface RayModeInputOwnProps {
632
634
  onRayModeChange?: (event: CustomEvent<{ mode: string; previous: string | null; option: Ray.ModeOption }>) => void;
633
635
  /** A suggestion was accepted (the text already has it). */
634
636
  onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
637
+ /** The highlight range under the pointer changed: the range and the box of the line of it the pointer is on, or null on leaving a range. Anchor a ray-popover to rect (its anchor property) to show more than the title. */
638
+ onRayHighlightHover?: (event: CustomEvent<{ range: Ray.HighlightRange | null; rect: DOMRect | null }>) => void;
635
639
  /** On every edit (value already updated). */
636
640
  onInput?: (event: Event) => void;
637
641
  /** When an edit is committed (blur, Enter). */
@@ -766,6 +770,8 @@ export interface RayPasswordInputOwnProps {
766
770
  onRayVisibilityChange?: (event: CustomEvent<{ visible: boolean }>) => void;
767
771
  /** A suggestion was accepted (the text already has it). */
768
772
  onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
773
+ /** The highlight range under the pointer changed: the range and the box of the line of it the pointer is on, or null on leaving a range. Anchor a ray-popover to rect (its anchor property) to show more than the title. */
774
+ onRayHighlightHover?: (event: CustomEvent<{ range: Ray.HighlightRange | null; rect: DOMRect | null }>) => void;
769
775
  /** On every edit (value already updated). */
770
776
  onInput?: (event: Event) => void;
771
777
  /** When an edit is committed (blur, Enter). */
@@ -846,6 +852,8 @@ export interface RayPathInputOwnProps {
846
852
  onRayError?: (event: CustomEvent<{ error: Error }>) => void;
847
853
  /** A suggestion was accepted (the text already has it). */
848
854
  onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
855
+ /** The highlight range under the pointer changed: the range and the box of the line of it the pointer is on, or null on leaving a range. Anchor a ray-popover to rect (its anchor property) to show more than the title. */
856
+ onRayHighlightHover?: (event: CustomEvent<{ range: Ray.HighlightRange | null; rect: DOMRect | null }>) => void;
849
857
  /** On every edit (value already updated). */
850
858
  onInput?: (event: Event) => void;
851
859
  }
@@ -1174,6 +1182,8 @@ export interface RayTextareaOwnProps {
1174
1182
  wrap?: string;
1175
1183
  /** A suggestion was accepted (the text already has it). */
1176
1184
  onRayComplete?: (event: CustomEvent<{ item: Ray.CompletionItem; from: number; to: number }>) => void;
1185
+ /** The highlight range under the pointer changed: the range and the box of the line of it the pointer is on, or null on leaving a range. Anchor a ray-popover to rect (its anchor property) to show more than the title. */
1186
+ onRayHighlightHover?: (event: CustomEvent<{ range: Ray.HighlightRange | null; rect: DOMRect | null }>) => void;
1177
1187
  /** On every edit. */
1178
1188
  onInput?: (event: Event) => void;
1179
1189
  /** When an edit is committed. */
@@ -1598,6 +1608,8 @@ export interface RayMenuOwnProps {
1598
1608
  keepOpen?: boolean;
1599
1609
  /** With a native host (ray-elements/core/raylang.js in a std/ui window), opens as the system's context menu at the pointer: items and dividers, same ray-select. */
1600
1610
  native?: boolean;
1611
+ /** What the panel is placed against instead of the trigger: an element, a DOMRect or a function returning one (a text range, the pointer; read again on every reposition). The trigger still opens it. */
1612
+ anchor?: Element | DOMRect | (() => DOMRect) | null;
1601
1613
  /** Gap to the anchor in px. */
1602
1614
  offset?: number;
1603
1615
  /** An item was chosen; detail: { value, item }. */
@@ -1650,6 +1662,8 @@ export interface RayPopoverOwnProps {
1650
1662
  placement?: "bottom" | "bottom-start" | "bottom-end" | "top" | "top-start" | "top-end" | "left" | "left-start" | "left-end" | "right" | "right-start" | "right-end";
1651
1663
  /** Gap to the trigger in px. */
1652
1664
  offset?: number;
1665
+ /** What the panel is placed against instead of the trigger: an element, a DOMRect or a function returning one (a text range, the pointer; read again on every reposition). The trigger still opens it. */
1666
+ anchor?: Element | DOMRect | (() => DOMRect) | null;
1653
1667
  /** Panel width (px number or CSS length). Default: its content. */
1654
1668
  width?: string;
1655
1669
  /** At least as wide as the trigger. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@raylang/react",
3
- "version": "0.11.0",
3
+ "version": "0.12.0",
4
4
  "description": "React wrappers of the ray-elements web components",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": ["web-components", "design-system", "ui", "raylang", "react"],
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "sideEffects": false,
30
30
  "peerDependencies": {
31
- "@raylang/elements": "^0.11.0",
31
+ "@raylang/elements": "^0.12.0",
32
32
  "react": ">=18"
33
33
  }
34
34
  }