@oliasoft-open-source/react-ui-library 10.5.1 → 10.5.2
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/global.css +44 -29
- package/dist/index.js +75 -225
- package/package.json +1 -2
package/dist/global.css
CHANGED
|
@@ -6355,87 +6355,87 @@ tbody ._staticCell_g4jsi_127 ._staticCellContent_g4jsi_130 {
|
|
|
6355
6355
|
margin-bottom: var(--padding-xs);
|
|
6356
6356
|
align-items: flex-end;
|
|
6357
6357
|
}
|
|
6358
|
-
.
|
|
6358
|
+
._inputInTable_9sh24_1 {
|
|
6359
6359
|
background-color: transparent;
|
|
6360
6360
|
border-radius: inherit !important;
|
|
6361
6361
|
height: var(--size);
|
|
6362
6362
|
min-height: 100%;
|
|
6363
6363
|
}
|
|
6364
|
-
.
|
|
6364
|
+
._inputInTable_9sh24_1:not(:hover):not([data-error]):not([data-warning]) {
|
|
6365
6365
|
border-color: transparent;
|
|
6366
6366
|
}
|
|
6367
|
-
.
|
|
6367
|
+
._inputInTable_9sh24_1:not(:focus) {
|
|
6368
6368
|
box-shadow: none;
|
|
6369
6369
|
}
|
|
6370
|
-
.
|
|
6370
|
+
._inputHover_9sh24_13 {
|
|
6371
6371
|
position: relative;
|
|
6372
6372
|
border-color: var(--color-border-hover);
|
|
6373
6373
|
z-index: 2;
|
|
6374
6374
|
}
|
|
6375
|
-
.
|
|
6375
|
+
._inputFocus_9sh24_18 {
|
|
6376
6376
|
position: relative;
|
|
6377
6377
|
outline: none !important;
|
|
6378
6378
|
border-color: var(--color-border-focus) !important;
|
|
6379
6379
|
box-shadow: var(--shadow-focus);
|
|
6380
6380
|
z-index: 3;
|
|
6381
6381
|
}
|
|
6382
|
-
.
|
|
6382
|
+
._controlFocusVisible_9sh24_25 {
|
|
6383
6383
|
outline: none;
|
|
6384
6384
|
box-shadow: var(--shadow-focus);
|
|
6385
6385
|
}
|
|
6386
|
-
.
|
|
6387
|
-
.
|
|
6386
|
+
._inputError_9sh24_29,
|
|
6387
|
+
._inputWarning_9sh24_30 {
|
|
6388
6388
|
position: relative;
|
|
6389
6389
|
}
|
|
6390
|
-
.
|
|
6390
|
+
._inputError_9sh24_29 {
|
|
6391
6391
|
z-index: 2;
|
|
6392
6392
|
border-color: var(--color-border-error);
|
|
6393
6393
|
color: var(--color-text-error) !important;
|
|
6394
6394
|
background-color: var(--color-background-error-muted);
|
|
6395
6395
|
}
|
|
6396
|
-
.
|
|
6396
|
+
._inputError_9sh24_29:hover {
|
|
6397
6397
|
border-color: var(--color-border-error-hover) !important;
|
|
6398
6398
|
}
|
|
6399
|
-
.
|
|
6399
|
+
._inputError_9sh24_29:focus {
|
|
6400
6400
|
position: relative;
|
|
6401
6401
|
outline: none !important;
|
|
6402
6402
|
border-color: var(--color-border-focus) !important;
|
|
6403
6403
|
box-shadow: var(--shadow-focus);
|
|
6404
6404
|
z-index: 3;
|
|
6405
6405
|
}
|
|
6406
|
-
.
|
|
6406
|
+
._inputWarning_9sh24_30 {
|
|
6407
6407
|
z-index: 1;
|
|
6408
6408
|
border-color: var(--color-border-warning);
|
|
6409
6409
|
color: var(--color-text-warning) !important;
|
|
6410
6410
|
background-color: var(--color-background-warning-muted);
|
|
6411
6411
|
}
|
|
6412
|
-
.
|
|
6412
|
+
._inputWarning_9sh24_30:hover {
|
|
6413
6413
|
border-color: var(--color-border-warning-hover) !important;
|
|
6414
6414
|
}
|
|
6415
|
-
.
|
|
6415
|
+
._inputWarning_9sh24_30:focus {
|
|
6416
6416
|
position: relative;
|
|
6417
6417
|
outline: none !important;
|
|
6418
6418
|
border-color: var(--color-border-focus) !important;
|
|
6419
6419
|
box-shadow: var(--shadow-focus);
|
|
6420
6420
|
z-index: 3;
|
|
6421
6421
|
}
|
|
6422
|
-
.
|
|
6422
|
+
._inputDisabled_9sh24_65 {
|
|
6423
6423
|
pointer-events: none;
|
|
6424
6424
|
background-color: var(--color-background-disabled);
|
|
6425
6425
|
color: var(--color-text-muted);
|
|
6426
6426
|
box-shadow: none;
|
|
6427
6427
|
}
|
|
6428
|
-
.
|
|
6428
|
+
._hideScrollbars_9sh24_71 {
|
|
6429
6429
|
/* Firefox */
|
|
6430
6430
|
scrollbar-width: none;
|
|
6431
6431
|
/* IE 10+ */
|
|
6432
6432
|
-ms-overflow-style: none;
|
|
6433
6433
|
/* Chrome, Safari and Opera */
|
|
6434
6434
|
}
|
|
6435
|
-
.
|
|
6435
|
+
._hideScrollbars_9sh24_71::-webkit-scrollbar {
|
|
6436
6436
|
display: none;
|
|
6437
6437
|
}
|
|
6438
|
-
.
|
|
6438
|
+
._richTextInput_9sh24_81 ._editable_9sh24_81 {
|
|
6439
6439
|
padding: var(--padding-input);
|
|
6440
6440
|
background: var(--color-background-input);
|
|
6441
6441
|
border: 1px solid var(--color-border);
|
|
@@ -6445,25 +6445,25 @@ tbody ._staticCell_g4jsi_127 ._staticCellContent_g4jsi_130 {
|
|
|
6445
6445
|
white-space: pre-wrap;
|
|
6446
6446
|
min-height: var(--size);
|
|
6447
6447
|
}
|
|
6448
|
-
.
|
|
6448
|
+
._richTextInput_9sh24_81 ._editable_9sh24_81:hover {
|
|
6449
6449
|
position: relative;
|
|
6450
6450
|
border-color: var(--color-border-hover);
|
|
6451
6451
|
z-index: 2;
|
|
6452
6452
|
}
|
|
6453
|
-
.
|
|
6453
|
+
._richTextInput_9sh24_81 ._editable_9sh24_81:focus {
|
|
6454
6454
|
position: relative;
|
|
6455
6455
|
outline: none !important;
|
|
6456
6456
|
border-color: var(--color-border-focus) !important;
|
|
6457
6457
|
box-shadow: var(--shadow-focus);
|
|
6458
6458
|
z-index: 3;
|
|
6459
6459
|
}
|
|
6460
|
-
.
|
|
6460
|
+
._richTextInput_9sh24_81 ._editable_9sh24_81[contenteditable='false'] {
|
|
6461
6461
|
pointer-events: none;
|
|
6462
6462
|
background-color: var(--color-background-disabled);
|
|
6463
6463
|
color: var(--color-text-muted);
|
|
6464
6464
|
box-shadow: none;
|
|
6465
6465
|
}
|
|
6466
|
-
.
|
|
6466
|
+
._richTextInput_9sh24_81 p:first-child[data-placeholder]::before {
|
|
6467
6467
|
content: attr(data-placeholder);
|
|
6468
6468
|
color: var(--color-text-faint);
|
|
6469
6469
|
font-style: normal;
|
|
@@ -6471,7 +6471,7 @@ tbody ._staticCell_g4jsi_127 ._staticCellContent_g4jsi_130 {
|
|
|
6471
6471
|
height: 0;
|
|
6472
6472
|
pointer-events: none;
|
|
6473
6473
|
}
|
|
6474
|
-
.
|
|
6474
|
+
._richTextInput_9sh24_81 [data-type='mention'] {
|
|
6475
6475
|
display: inline;
|
|
6476
6476
|
padding: 0 var(--padding-xxs);
|
|
6477
6477
|
border-radius: calc(var(--line-height) / 2);
|
|
@@ -6479,7 +6479,7 @@ tbody ._staticCell_g4jsi_127 ._staticCellContent_g4jsi_130 {
|
|
|
6479
6479
|
color: var(--color-text-primary);
|
|
6480
6480
|
white-space: nowrap;
|
|
6481
6481
|
}
|
|
6482
|
-
.
|
|
6482
|
+
._mention_9sh24_125 {
|
|
6483
6483
|
display: inline;
|
|
6484
6484
|
padding: 0 var(--padding-xxs);
|
|
6485
6485
|
border-radius: calc(var(--line-height) / 2);
|
|
@@ -6487,8 +6487,9 @@ tbody ._staticCell_g4jsi_127 ._staticCellContent_g4jsi_130 {
|
|
|
6487
6487
|
color: var(--color-text-primary);
|
|
6488
6488
|
white-space: nowrap;
|
|
6489
6489
|
}
|
|
6490
|
-
.
|
|
6491
|
-
|
|
6490
|
+
._mentionLayer_9sh24_133 {
|
|
6491
|
+
outline: none;
|
|
6492
|
+
z-index: var(--zindex-dropdown) !important;
|
|
6492
6493
|
min-width: 160px;
|
|
6493
6494
|
max-height: 240px;
|
|
6494
6495
|
overflow-y: auto;
|
|
@@ -6497,14 +6498,28 @@ tbody ._staticCell_g4jsi_127 ._staticCellContent_g4jsi_130 {
|
|
|
6497
6498
|
background: var(--color-background-layer);
|
|
6498
6499
|
box-shadow: var(--shadow-layer);
|
|
6499
6500
|
font-size: var(--font-size);
|
|
6501
|
+
padding: 0;
|
|
6502
|
+
margin: 0;
|
|
6503
|
+
transition: opacity 0.1s, transform 0.1s;
|
|
6500
6504
|
}
|
|
6501
|
-
.
|
|
6502
|
-
|
|
6505
|
+
._mentionLayer_9sh24_133[data-entering],
|
|
6506
|
+
._mentionLayer_9sh24_133[data-exiting] {
|
|
6507
|
+
transform: var(--origin);
|
|
6508
|
+
opacity: 0;
|
|
6509
|
+
}
|
|
6510
|
+
._mentionLayer_9sh24_133[data-placement='top'] {
|
|
6511
|
+
--origin: translateY(4px);
|
|
6512
|
+
}
|
|
6513
|
+
._mentionLayer_9sh24_133[data-placement='bottom'] {
|
|
6514
|
+
--origin: translateY(-4px);
|
|
6515
|
+
}
|
|
6516
|
+
._mentionOption_9sh24_159 {
|
|
6517
|
+
padding: var(--padding-input);
|
|
6503
6518
|
line-height: var(--line-height);
|
|
6504
6519
|
white-space: nowrap;
|
|
6505
6520
|
cursor: pointer;
|
|
6506
6521
|
}
|
|
6507
|
-
.
|
|
6522
|
+
._mentionOption_9sh24_159._focused_9sh24_165 {
|
|
6508
6523
|
background-color: var(--color-background-listitem-hover);
|
|
6509
6524
|
}
|
|
6510
6525
|
._row_n16je_1 {
|
package/dist/index.js
CHANGED
|
@@ -35,7 +35,6 @@ import { EditorContent, useEditor } from "@tiptap/react";
|
|
|
35
35
|
import StarterKit from "@tiptap/starter-kit";
|
|
36
36
|
import Placeholder from "@tiptap/extension-placeholder";
|
|
37
37
|
import { Markdown } from "@tiptap/markdown";
|
|
38
|
-
import { FloatingNode, FloatingPortal, FloatingTree, arrow, autoUpdate, flip, offset, shift, size, useClientPoint, useDismiss, useFloating, useFloatingNodeId, useFloatingParentNodeId, useHover, useInteractions } from "@floating-ui/react";
|
|
39
38
|
import { Mention as Mention$1 } from "@tiptap/extension-mention";
|
|
40
39
|
import ReactLoadingSkeleton from "react-loading-skeleton";
|
|
41
40
|
import "react-loading-skeleton/dist/skeleton.css";
|
|
@@ -8477,165 +8476,6 @@ var RadioButton = ({ name, label, options: rawOptions, value: rawValue, onChange
|
|
|
8477
8476
|
})]
|
|
8478
8477
|
});
|
|
8479
8478
|
};
|
|
8480
|
-
//#endregion
|
|
8481
|
-
//#region src/helpers/floating-layer/components/root.tsx
|
|
8482
|
-
var FloatingLayerRoot = ({ children }) => {
|
|
8483
|
-
if (useFloatingParentNodeId() === null) return /* @__PURE__ */ jsx(FloatingTree, { children });
|
|
8484
|
-
return /* @__PURE__ */ jsx(Fragment$1, { children });
|
|
8485
|
-
};
|
|
8486
|
-
//#endregion
|
|
8487
|
-
//#region src/helpers/floating-layer/hooks/use-floating-layer.tsx
|
|
8488
|
-
var DEFAULT_PLACEMENT = "bottom-start";
|
|
8489
|
-
var updateTriggerBounds = (bounds, setTriggerBounds) => {
|
|
8490
|
-
setTriggerBounds((current) => {
|
|
8491
|
-
if (current && current.width === bounds.width && current.height === bounds.height && current.x === bounds.x && current.y === bounds.y) return current;
|
|
8492
|
-
return bounds;
|
|
8493
|
-
});
|
|
8494
|
-
};
|
|
8495
|
-
var toFloatingPlacement = (placement = DEFAULT_PLACEMENT) => {
|
|
8496
|
-
if (placement === "center") return "bottom";
|
|
8497
|
-
return placement.replace("-center", "");
|
|
8498
|
-
};
|
|
8499
|
-
var getMiddleware = ({ arrowOffset, arrowRef, containerOffset, fallbackPlacements, matchReferenceWidth, triggerOffset }) => [
|
|
8500
|
-
offset(triggerOffset),
|
|
8501
|
-
flip({
|
|
8502
|
-
fallbackPlacements,
|
|
8503
|
-
padding: containerOffset
|
|
8504
|
-
}),
|
|
8505
|
-
shift({ padding: containerOffset }),
|
|
8506
|
-
size({
|
|
8507
|
-
padding: containerOffset,
|
|
8508
|
-
apply({ elements, rects }) {
|
|
8509
|
-
if (!matchReferenceWidth) return;
|
|
8510
|
-
Object.assign(elements.floating.style, { minWidth: `${rects.reference.width}px` });
|
|
8511
|
-
}
|
|
8512
|
-
}),
|
|
8513
|
-
arrow({
|
|
8514
|
-
element: arrowRef,
|
|
8515
|
-
padding: arrowOffset
|
|
8516
|
-
})
|
|
8517
|
-
];
|
|
8518
|
-
var useLayer = ({ isOpen, arrowOffset = 0, clientPoint, containerOffset = 10, hover, matchReferenceWidth = false, placement = DEFAULT_PLACEMENT, possiblePlacements, triggerOffset = 0, updateOnAnimationFrame = false, overflowContainer = true, onOpenChange, onOutsideClick }) => {
|
|
8519
|
-
var _hover$hideOnScroll, _hover$enabled, _hover$delayEnter, _hover$delayLeave, _clientPoint$enabled, _clientPoint$x, _clientPoint$y;
|
|
8520
|
-
const arrowRef = useRef(null);
|
|
8521
|
-
const [triggerBounds, setTriggerBounds] = useState(null);
|
|
8522
|
-
const nodeId = useFloatingNodeId();
|
|
8523
|
-
const floatingPlacement = toFloatingPlacement(placement);
|
|
8524
|
-
const fallbackPlacements = useMemo(() => possiblePlacements === null || possiblePlacements === void 0 ? void 0 : possiblePlacements.map(toFloatingPlacement), [possiblePlacements]);
|
|
8525
|
-
const middleware = useMemo(() => getMiddleware({
|
|
8526
|
-
arrowOffset,
|
|
8527
|
-
arrowRef,
|
|
8528
|
-
containerOffset,
|
|
8529
|
-
fallbackPlacements,
|
|
8530
|
-
matchReferenceWidth,
|
|
8531
|
-
triggerOffset
|
|
8532
|
-
}), [
|
|
8533
|
-
arrowOffset,
|
|
8534
|
-
containerOffset,
|
|
8535
|
-
fallbackPlacements,
|
|
8536
|
-
matchReferenceWidth,
|
|
8537
|
-
triggerOffset
|
|
8538
|
-
]);
|
|
8539
|
-
const whileElementsMounted = useCallback((reference, floating, update) => {
|
|
8540
|
-
updateTriggerBounds(reference.getBoundingClientRect(), setTriggerBounds);
|
|
8541
|
-
return autoUpdate(reference, floating, () => {
|
|
8542
|
-
updateTriggerBounds(reference.getBoundingClientRect(), setTriggerBounds);
|
|
8543
|
-
update();
|
|
8544
|
-
}, { animationFrame: updateOnAnimationFrame });
|
|
8545
|
-
}, [updateOnAnimationFrame]);
|
|
8546
|
-
const { context, refs, floatingStyles, isPositioned, x, y } = useFloating({
|
|
8547
|
-
open: isOpen,
|
|
8548
|
-
onOpenChange: (nextOpen, _event, reason) => {
|
|
8549
|
-
if (!nextOpen && (reason === "outside-press" || reason === "escape-key")) onOutsideClick === null || onOutsideClick === void 0 || onOutsideClick();
|
|
8550
|
-
onOpenChange === null || onOpenChange === void 0 || onOpenChange(nextOpen);
|
|
8551
|
-
},
|
|
8552
|
-
nodeId,
|
|
8553
|
-
placement: floatingPlacement,
|
|
8554
|
-
strategy: overflowContainer ? "fixed" : "absolute",
|
|
8555
|
-
transform: false,
|
|
8556
|
-
whileElementsMounted,
|
|
8557
|
-
middleware
|
|
8558
|
-
});
|
|
8559
|
-
const setReference = useCallback((node) => {
|
|
8560
|
-
refs.setReference(node);
|
|
8561
|
-
if (node) {
|
|
8562
|
-
updateTriggerBounds(node.getBoundingClientRect(), setTriggerBounds);
|
|
8563
|
-
return;
|
|
8564
|
-
}
|
|
8565
|
-
setTriggerBounds(null);
|
|
8566
|
-
}, [refs.setReference]);
|
|
8567
|
-
const hideOnScroll = (_hover$hideOnScroll = hover === null || hover === void 0 ? void 0 : hover.hideOnScroll) !== null && _hover$hideOnScroll !== void 0 ? _hover$hideOnScroll : false;
|
|
8568
|
-
const dismiss = useDismiss(context, {
|
|
8569
|
-
enabled: isOpen && (!!onOutsideClick || hideOnScroll),
|
|
8570
|
-
ancestorScroll: hideOnScroll,
|
|
8571
|
-
escapeKey: !!onOutsideClick,
|
|
8572
|
-
outsidePress: !!onOutsideClick,
|
|
8573
|
-
outsidePressEvent: "mousedown"
|
|
8574
|
-
});
|
|
8575
|
-
const hoverInteraction = useHover(context, {
|
|
8576
|
-
enabled: (_hover$enabled = hover === null || hover === void 0 ? void 0 : hover.enabled) !== null && _hover$enabled !== void 0 ? _hover$enabled : false,
|
|
8577
|
-
delay: {
|
|
8578
|
-
open: (_hover$delayEnter = hover === null || hover === void 0 ? void 0 : hover.delayEnter) !== null && _hover$delayEnter !== void 0 ? _hover$delayEnter : 0,
|
|
8579
|
-
close: (_hover$delayLeave = hover === null || hover === void 0 ? void 0 : hover.delayLeave) !== null && _hover$delayLeave !== void 0 ? _hover$delayLeave : 0
|
|
8580
|
-
},
|
|
8581
|
-
mouseOnly: hover === null || hover === void 0 ? void 0 : hover.mouseOnly,
|
|
8582
|
-
move: false
|
|
8583
|
-
});
|
|
8584
|
-
const clientPointInteraction = useClientPoint(context, {
|
|
8585
|
-
enabled: (_clientPoint$enabled = clientPoint === null || clientPoint === void 0 ? void 0 : clientPoint.enabled) !== null && _clientPoint$enabled !== void 0 ? _clientPoint$enabled : false,
|
|
8586
|
-
axis: clientPoint === null || clientPoint === void 0 ? void 0 : clientPoint.axis,
|
|
8587
|
-
x: (_clientPoint$x = clientPoint === null || clientPoint === void 0 ? void 0 : clientPoint.x) !== null && _clientPoint$x !== void 0 ? _clientPoint$x : null,
|
|
8588
|
-
y: (_clientPoint$y = clientPoint === null || clientPoint === void 0 ? void 0 : clientPoint.y) !== null && _clientPoint$y !== void 0 ? _clientPoint$y : null
|
|
8589
|
-
});
|
|
8590
|
-
const { getReferenceProps, getFloatingProps } = useInteractions([
|
|
8591
|
-
dismiss,
|
|
8592
|
-
hoverInteraction,
|
|
8593
|
-
clientPointInteraction
|
|
8594
|
-
]);
|
|
8595
|
-
const triggerProps = useMemo(() => getReferenceProps({ ref: setReference }), [getReferenceProps, setReference]);
|
|
8596
|
-
const layerProps = useMemo(() => getFloatingProps({
|
|
8597
|
-
ref: refs.setFloating,
|
|
8598
|
-
style: {
|
|
8599
|
-
...floatingStyles,
|
|
8600
|
-
visibility: isOpen && (!isPositioned || x === null || y === null) ? "hidden" : void 0
|
|
8601
|
-
}
|
|
8602
|
-
}), [
|
|
8603
|
-
floatingStyles,
|
|
8604
|
-
getFloatingProps,
|
|
8605
|
-
isOpen,
|
|
8606
|
-
isPositioned,
|
|
8607
|
-
refs.setFloating,
|
|
8608
|
-
x,
|
|
8609
|
-
y
|
|
8610
|
-
]);
|
|
8611
|
-
const arrowProps = useMemo(() => ({
|
|
8612
|
-
context,
|
|
8613
|
-
ref: arrowRef
|
|
8614
|
-
}), [context]);
|
|
8615
|
-
const renderLayer = (layer) => {
|
|
8616
|
-
var _current$contextEleme;
|
|
8617
|
-
if (typeof document === "undefined") return null;
|
|
8618
|
-
const current = refs.reference.current;
|
|
8619
|
-
const portalRoot = getFloatingPortalRoot(current instanceof Element ? current : (_current$contextEleme = current === null || current === void 0 ? void 0 : current.contextElement) !== null && _current$contextEleme !== void 0 ? _current$contextEleme : null);
|
|
8620
|
-
return /* @__PURE__ */ jsx(FloatingNode, {
|
|
8621
|
-
id: nodeId,
|
|
8622
|
-
children: portalRoot ? /* @__PURE__ */ jsx(FloatingPortal, {
|
|
8623
|
-
root: portalRoot,
|
|
8624
|
-
children: layer
|
|
8625
|
-
}, MODAL_LAYERS_ID) : /* @__PURE__ */ jsx(FloatingPortal, {
|
|
8626
|
-
id: PAGE_LAYERS_ID,
|
|
8627
|
-
children: layer
|
|
8628
|
-
}, PAGE_LAYERS_ID)
|
|
8629
|
-
});
|
|
8630
|
-
};
|
|
8631
|
-
return {
|
|
8632
|
-
arrowProps,
|
|
8633
|
-
layerProps,
|
|
8634
|
-
renderLayer,
|
|
8635
|
-
triggerBounds,
|
|
8636
|
-
triggerProps
|
|
8637
|
-
};
|
|
8638
|
-
};
|
|
8639
8479
|
var rich_text_toolbar_module_default = {
|
|
8640
8480
|
richTextToolbar: "_richTextToolbar_1gbkk_1",
|
|
8641
8481
|
richTextToolbarContainer: "_richTextToolbarContainer_1gbkk_5"
|
|
@@ -8799,57 +8639,54 @@ var createMentionExtension = (mentions, render) => Mention$1.extend({
|
|
|
8799
8639
|
render
|
|
8800
8640
|
} });
|
|
8801
8641
|
var rich_text_input_module_default = {
|
|
8802
|
-
inputInTable: "
|
|
8803
|
-
inputHover: "
|
|
8804
|
-
inputFocus: "
|
|
8805
|
-
controlFocusVisible: "
|
|
8806
|
-
inputError: "
|
|
8807
|
-
inputWarning: "
|
|
8808
|
-
inputDisabled: "
|
|
8809
|
-
hideScrollbars: "
|
|
8810
|
-
richTextInput: "
|
|
8811
|
-
editable: "
|
|
8812
|
-
mention: "
|
|
8813
|
-
mentionLayer: "
|
|
8814
|
-
mentionOption: "
|
|
8815
|
-
focused: "
|
|
8642
|
+
inputInTable: "_inputInTable_9sh24_1",
|
|
8643
|
+
inputHover: "_inputHover_9sh24_13",
|
|
8644
|
+
inputFocus: "_inputFocus_9sh24_18",
|
|
8645
|
+
controlFocusVisible: "_controlFocusVisible_9sh24_25",
|
|
8646
|
+
inputError: "_inputError_9sh24_29",
|
|
8647
|
+
inputWarning: "_inputWarning_9sh24_30",
|
|
8648
|
+
inputDisabled: "_inputDisabled_9sh24_65",
|
|
8649
|
+
hideScrollbars: "_hideScrollbars_9sh24_71",
|
|
8650
|
+
richTextInput: "_richTextInput_9sh24_81",
|
|
8651
|
+
editable: "_editable_9sh24_81",
|
|
8652
|
+
mention: "_mention_9sh24_125",
|
|
8653
|
+
mentionLayer: "_mentionLayer_9sh24_133",
|
|
8654
|
+
mentionOption: "_mentionOption_9sh24_159",
|
|
8655
|
+
focused: "_focused_9sh24_165"
|
|
8816
8656
|
};
|
|
8817
8657
|
//#endregion
|
|
8818
8658
|
//#region src/components/rich-text-input/mention/mention-suggestions.tsx
|
|
8659
|
+
var sameRect = (a, b) => {
|
|
8660
|
+
if (a === b) return true;
|
|
8661
|
+
if (!a || !b) return false;
|
|
8662
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
8663
|
+
};
|
|
8664
|
+
var useMentionAnchor = (getRect) => {
|
|
8665
|
+
var _getRect, _ref;
|
|
8666
|
+
const [lastRect, setLastRect] = useState(null);
|
|
8667
|
+
const measured = (_getRect = getRect === null || getRect === void 0 ? void 0 : getRect()) !== null && _getRect !== void 0 ? _getRect : null;
|
|
8668
|
+
if (measured && !sameRect(measured, lastRect)) setLastRect(measured);
|
|
8669
|
+
const anchor = (_ref = measured !== null && measured !== void 0 ? measured : lastRect) !== null && _ref !== void 0 ? _ref : new DOMRect();
|
|
8670
|
+
return {
|
|
8671
|
+
positionKey: `${Math.round(anchor.x)}-${Math.round(anchor.y)}-${Math.round(anchor.width)}`,
|
|
8672
|
+
getTargetRect: () => {
|
|
8673
|
+
var _ref2, _getRect2;
|
|
8674
|
+
return (_ref2 = (_getRect2 = getRect === null || getRect === void 0 ? void 0 : getRect()) !== null && _getRect2 !== void 0 ? _getRect2 : lastRect) !== null && _ref2 !== void 0 ? _ref2 : new DOMRect();
|
|
8675
|
+
}
|
|
8676
|
+
};
|
|
8677
|
+
};
|
|
8819
8678
|
var MentionSuggestions = forwardRef(({ editable, getRect, items, onDismiss, onSelect }, ref) => {
|
|
8820
8679
|
const [activeIndex, setActiveIndex] = useState(0);
|
|
8680
|
+
const [itemsSnapshot, setItemsSnapshot] = useState(items);
|
|
8821
8681
|
const isOpen = items.length > 0;
|
|
8822
8682
|
const listboxId = useId();
|
|
8823
8683
|
const optionId = useCallback((index) => `${listboxId}-option-${index}`, [listboxId]);
|
|
8824
|
-
const {
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
onOutsideClick: onDismiss
|
|
8829
|
-
});
|
|
8830
|
-
useEffect(() => {
|
|
8684
|
+
const triggerRef = useMemo(() => ({ current: editable }), [editable]);
|
|
8685
|
+
const { positionKey, getTargetRect } = useMentionAnchor(getRect);
|
|
8686
|
+
if (items !== itemsSnapshot) {
|
|
8687
|
+
setItemsSnapshot(items);
|
|
8831
8688
|
setActiveIndex(0);
|
|
8832
|
-
}
|
|
8833
|
-
const getRectRef = useRef(getRect);
|
|
8834
|
-
const lastRectRef = useRef(null);
|
|
8835
|
-
useEffect(() => {
|
|
8836
|
-
getRectRef.current = getRect;
|
|
8837
|
-
}, [getRect]);
|
|
8838
|
-
const reference = useMemo(() => ({
|
|
8839
|
-
getBoundingClientRect: () => {
|
|
8840
|
-
var _getRectRef$current, _getRectRef$current2, _lastRectRef$current;
|
|
8841
|
-
lastRectRef.current = (_getRectRef$current = (_getRectRef$current2 = getRectRef.current) === null || _getRectRef$current2 === void 0 ? void 0 : _getRectRef$current2.call(getRectRef)) !== null && _getRectRef$current !== void 0 ? _getRectRef$current : lastRectRef.current;
|
|
8842
|
-
return (_lastRectRef$current = lastRectRef.current) !== null && _lastRectRef$current !== void 0 ? _lastRectRef$current : new DOMRect();
|
|
8843
|
-
},
|
|
8844
|
-
contextElement: editable !== null && editable !== void 0 ? editable : void 0
|
|
8845
|
-
}), [editable]);
|
|
8846
|
-
useEffect(() => {
|
|
8847
|
-
triggerProps.ref(editable ? reference : null);
|
|
8848
|
-
}, [
|
|
8849
|
-
editable,
|
|
8850
|
-
reference,
|
|
8851
|
-
triggerProps.ref
|
|
8852
|
-
]);
|
|
8689
|
+
}
|
|
8853
8690
|
useEffect(() => {
|
|
8854
8691
|
if (!editable) return;
|
|
8855
8692
|
const owned = {
|
|
@@ -8897,25 +8734,38 @@ var MentionSuggestions = forwardRef(({ editable, getRect, items, onDismiss, onSe
|
|
|
8897
8734
|
onDismiss,
|
|
8898
8735
|
onSelect
|
|
8899
8736
|
]);
|
|
8900
|
-
if (!isOpen) return null;
|
|
8901
|
-
return
|
|
8902
|
-
...layerProps,
|
|
8737
|
+
if (!isOpen || !editable) return null;
|
|
8738
|
+
return /* @__PURE__ */ jsx(AriaOverlayPopover, {
|
|
8903
8739
|
className: rich_text_input_module_default.mentionLayer,
|
|
8904
|
-
|
|
8905
|
-
|
|
8906
|
-
|
|
8907
|
-
|
|
8908
|
-
|
|
8909
|
-
|
|
8910
|
-
|
|
8911
|
-
|
|
8912
|
-
|
|
8913
|
-
|
|
8914
|
-
|
|
8915
|
-
|
|
8916
|
-
|
|
8917
|
-
|
|
8918
|
-
|
|
8740
|
+
placement: "bottom-start",
|
|
8741
|
+
triggerRef,
|
|
8742
|
+
portalTriggerRef: triggerRef,
|
|
8743
|
+
offset: 2,
|
|
8744
|
+
isOpen: true,
|
|
8745
|
+
onOpenChange: (open) => {
|
|
8746
|
+
if (!open) onDismiss();
|
|
8747
|
+
},
|
|
8748
|
+
isNonModal: true,
|
|
8749
|
+
disableFocusManagement: true,
|
|
8750
|
+
shouldSkipAnimation: true,
|
|
8751
|
+
getTargetRect,
|
|
8752
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
8753
|
+
id: listboxId,
|
|
8754
|
+
role: "listbox",
|
|
8755
|
+
children: items.map((item, index) => /* @__PURE__ */ jsx("div", {
|
|
8756
|
+
id: optionId(index),
|
|
8757
|
+
role: "option",
|
|
8758
|
+
"aria-selected": index === activeIndex,
|
|
8759
|
+
className: cx(rich_text_input_module_default.mentionOption, { [rich_text_input_module_default.focused]: index === activeIndex }),
|
|
8760
|
+
onMouseEnter: () => setActiveIndex(index),
|
|
8761
|
+
onMouseDown: (evt) => {
|
|
8762
|
+
evt.preventDefault();
|
|
8763
|
+
onSelect(item);
|
|
8764
|
+
},
|
|
8765
|
+
children: item.label
|
|
8766
|
+
}, item.id))
|
|
8767
|
+
})
|
|
8768
|
+
}, positionKey);
|
|
8919
8769
|
});
|
|
8920
8770
|
//#endregion
|
|
8921
8771
|
//#region src/components/rich-text-input/rich-text-input.tsx
|
|
@@ -8992,14 +8842,14 @@ var RichTextInput = memo(forwardRef(({ placeholder, onChange, value, disabled: d
|
|
|
8992
8842
|
editor,
|
|
8993
8843
|
"data-testid": testId && `${testId}-editor`
|
|
8994
8844
|
}),
|
|
8995
|
-
hasMentions && /* @__PURE__ */ jsx(
|
|
8845
|
+
hasMentions && /* @__PURE__ */ jsx(MentionSuggestions, {
|
|
8996
8846
|
ref: suggestionsRef,
|
|
8997
8847
|
editable: (_mentionSuggestion$ed = mentionSuggestion === null || mentionSuggestion === void 0 ? void 0 : mentionSuggestion.editable) !== null && _mentionSuggestion$ed !== void 0 ? _mentionSuggestion$ed : null,
|
|
8998
8848
|
getRect: (_mentionSuggestion$cl = mentionSuggestion === null || mentionSuggestion === void 0 ? void 0 : mentionSuggestion.clientRect) !== null && _mentionSuggestion$cl !== void 0 ? _mentionSuggestion$cl : null,
|
|
8999
8849
|
items: (_mentionSuggestion$it = mentionSuggestion === null || mentionSuggestion === void 0 ? void 0 : mentionSuggestion.items) !== null && _mentionSuggestion$it !== void 0 ? _mentionSuggestion$it : [],
|
|
9000
8850
|
onDismiss: () => setMentionSuggestion(null),
|
|
9001
8851
|
onSelect: (item) => mentionSuggestion === null || mentionSuggestion === void 0 ? void 0 : mentionSuggestion.command(item)
|
|
9002
|
-
})
|
|
8852
|
+
})
|
|
9003
8853
|
]
|
|
9004
8854
|
});
|
|
9005
8855
|
}));
|
|
@@ -10201,7 +10051,7 @@ var Link$1 = ({ label, url, icon, onClick, active, disabled, testId, component:
|
|
|
10201
10051
|
};
|
|
10202
10052
|
//#endregion
|
|
10203
10053
|
//#region src/components/top-bar/element/element.tsx
|
|
10204
|
-
var Element
|
|
10054
|
+
var Element = ({ element }) => {
|
|
10205
10055
|
switch (element.type) {
|
|
10206
10056
|
case ElementType.LINK: return /* @__PURE__ */ jsx("div", {
|
|
10207
10057
|
className: top_bar_module_default.item,
|
|
@@ -10272,14 +10122,14 @@ var TopBar = ({ title, appSwitcher, content = [], contentRight = [], warning = "
|
|
|
10272
10122
|
version: title.version,
|
|
10273
10123
|
onClick: title.onClick
|
|
10274
10124
|
}), content.map((element, i) => {
|
|
10275
|
-
if (element) return /* @__PURE__ */ jsx(Element
|
|
10125
|
+
if (element) return /* @__PURE__ */ jsx(Element, { element }, i);
|
|
10276
10126
|
return null;
|
|
10277
10127
|
})]
|
|
10278
10128
|
}),
|
|
10279
10129
|
/* @__PURE__ */ jsx("div", {
|
|
10280
10130
|
className: top_bar_module_default.right,
|
|
10281
10131
|
children: contentRight.map((element, i) => {
|
|
10282
|
-
if (element) return /* @__PURE__ */ jsx(Element
|
|
10132
|
+
if (element) return /* @__PURE__ */ jsx(Element, { element }, i);
|
|
10283
10133
|
return null;
|
|
10284
10134
|
})
|
|
10285
10135
|
})
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oliasoft-open-source/react-ui-library",
|
|
3
|
-
"version": "10.5.
|
|
3
|
+
"version": "10.5.2",
|
|
4
4
|
"description": "Reusable UI components for React projects",
|
|
5
5
|
"homepage": "https://oliasoft-open-source.gitlab.io/react-ui-library",
|
|
6
6
|
"bugs": {
|
|
@@ -29,7 +29,6 @@
|
|
|
29
29
|
"./dist/global.css": "./dist/global.css"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@floating-ui/react": "^0.27.19",
|
|
33
32
|
"@fontsource/noto-sans": "^5.2.5",
|
|
34
33
|
"@minoru/react-dnd-treeview": "^3.5.4",
|
|
35
34
|
"@radix-ui/react-slider": "^1.4.1",
|