@uniformdev/design-system 19.184.3-alpha.32 → 19.186.1
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/esm/index.js +430 -209
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +528 -324
- package/package.json +14 -14
package/dist/esm/index.js
CHANGED
|
@@ -17736,7 +17736,8 @@ var KeyValueInput = ({
|
|
|
17736
17736
|
onChange: (itemValue) => handleUpdateOptionRow(index, itemValue),
|
|
17737
17737
|
onDelete: () => handleDeleteOptionRow(index),
|
|
17738
17738
|
onFocusChange: handleFocusChange,
|
|
17739
|
-
"data-testid": "key-value-input-item"
|
|
17739
|
+
"data-testid": "key-value-input-item",
|
|
17740
|
+
onEnter: handleAddOptionRow
|
|
17740
17741
|
},
|
|
17741
17742
|
isDragging ? id : index
|
|
17742
17743
|
)) })
|
|
@@ -17771,7 +17772,8 @@ var KeyValueInputItem = ({
|
|
|
17771
17772
|
error,
|
|
17772
17773
|
onFocusChange,
|
|
17773
17774
|
disabledDelete = false,
|
|
17774
|
-
disabledDnd = false
|
|
17775
|
+
disabledDnd = false,
|
|
17776
|
+
onEnter
|
|
17775
17777
|
}) => {
|
|
17776
17778
|
const { attributes, listeners, setNodeRef, transform, transition, setActivatorNodeRef, isSorting } = useSortable({
|
|
17777
17779
|
id,
|
|
@@ -17781,6 +17783,11 @@ var KeyValueInputItem = ({
|
|
|
17781
17783
|
transform: CSS.Transform.toString(transform),
|
|
17782
17784
|
transition
|
|
17783
17785
|
};
|
|
17786
|
+
const handleEnter = (e) => {
|
|
17787
|
+
if (e.key === "Enter") {
|
|
17788
|
+
onEnter();
|
|
17789
|
+
}
|
|
17790
|
+
};
|
|
17784
17791
|
return /* @__PURE__ */ jsxs57("div", { css: rowWrapper, ref: setNodeRef, style, children: [
|
|
17785
17792
|
/* @__PURE__ */ jsx92(DragHandle, { disableDnd: disabledDnd, ref: setActivatorNodeRef, ...attributes, ...listeners }),
|
|
17786
17793
|
/* @__PURE__ */ jsxs57("div", { css: SelectKeyValueRowStyles, "data-testid": "key-value-input-item", children: [
|
|
@@ -17800,6 +17807,7 @@ var KeyValueInputItem = ({
|
|
|
17800
17807
|
},
|
|
17801
17808
|
onBlur: () => onFocusChange == null ? void 0 : onFocusChange(false),
|
|
17802
17809
|
onFocus: () => onFocusChange == null ? void 0 : onFocusChange(true),
|
|
17810
|
+
onKeyDown: handleEnter,
|
|
17803
17811
|
value: value.key,
|
|
17804
17812
|
errorMessage: isSorting ? void 0 : error == null ? void 0 : error.key,
|
|
17805
17813
|
"data-testid": "key"
|
|
@@ -17811,12 +17819,15 @@ var KeyValueInputItem = ({
|
|
|
17811
17819
|
label: valueLabel,
|
|
17812
17820
|
showLabel: false,
|
|
17813
17821
|
disabled: disabled2,
|
|
17814
|
-
onChange: (e) =>
|
|
17815
|
-
|
|
17816
|
-
|
|
17817
|
-
|
|
17822
|
+
onChange: (e) => {
|
|
17823
|
+
onChange == null ? void 0 : onChange({
|
|
17824
|
+
key: value.key,
|
|
17825
|
+
value: e.currentTarget.value
|
|
17826
|
+
});
|
|
17827
|
+
},
|
|
17818
17828
|
onBlur: () => onFocusChange == null ? void 0 : onFocusChange(false),
|
|
17819
17829
|
onFocus: () => onFocusChange == null ? void 0 : onFocusChange(true),
|
|
17830
|
+
onKeyDown: handleEnter,
|
|
17820
17831
|
value: value.value,
|
|
17821
17832
|
errorMessage: isSorting ? void 0 : error == null ? void 0 : error.value,
|
|
17822
17833
|
"data-testid": "value"
|
|
@@ -19923,8 +19934,8 @@ import { useState as useState15 } from "react";
|
|
|
19923
19934
|
|
|
19924
19935
|
// src/components/ParameterInputs/ParameterLabel.tsx
|
|
19925
19936
|
import { jsx as jsx121 } from "@emotion/react/jsx-runtime";
|
|
19926
|
-
var ParameterLabel = ({ id, asSpan, children, ...props }) => {
|
|
19927
|
-
return !asSpan ? /* @__PURE__ */ jsx121("label", { ...props, htmlFor: id, css: labelText2, children }) : /* @__PURE__ */ jsx121("span", { "aria-labelledby": id, css: labelText2, children });
|
|
19937
|
+
var ParameterLabel = ({ id, asSpan, children, testId, ...props }) => {
|
|
19938
|
+
return !asSpan ? /* @__PURE__ */ jsx121("label", { ...props, htmlFor: id, css: labelText2, "data-testid": testId, children }) : /* @__PURE__ */ jsx121("span", { "aria-labelledby": id, css: labelText2, children });
|
|
19928
19939
|
};
|
|
19929
19940
|
|
|
19930
19941
|
// src/components/ParameterInputs/ParameterMenuButton.tsx
|
|
@@ -20049,7 +20060,7 @@ var ParameterShell = ({
|
|
|
20049
20060
|
label,
|
|
20050
20061
|
labelTrailingIcon != null ? labelTrailingIcon : null
|
|
20051
20062
|
] }),
|
|
20052
|
-
!title2 ? null : /* @__PURE__ */ jsxs81(ParameterLabel, { id, asSpan: true, children: [
|
|
20063
|
+
!title2 ? null : /* @__PURE__ */ jsxs81(ParameterLabel, { id, asSpan: true, testId: "parameter-label", children: [
|
|
20053
20064
|
labelLeadingIcon != null ? labelLeadingIcon : null,
|
|
20054
20065
|
title2,
|
|
20055
20066
|
labelTrailingIcon != null ? labelTrailingIcon : null
|
|
@@ -20370,7 +20381,7 @@ var ParameterNameAndPublicIdInput = ({
|
|
|
20370
20381
|
|
|
20371
20382
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
20372
20383
|
import { css as css101 } from "@emotion/react";
|
|
20373
|
-
import { ListItemNode, ListNode as
|
|
20384
|
+
import { ListItemNode, ListNode as ListNode3 } from "@lexical/list";
|
|
20374
20385
|
import {
|
|
20375
20386
|
CODE,
|
|
20376
20387
|
HEADING,
|
|
@@ -20381,7 +20392,7 @@ import {
|
|
|
20381
20392
|
UNORDERED_LIST
|
|
20382
20393
|
} from "@lexical/markdown";
|
|
20383
20394
|
import { LexicalComposer } from "@lexical/react/LexicalComposer";
|
|
20384
|
-
import { useLexicalComposerContext as
|
|
20395
|
+
import { useLexicalComposerContext as useLexicalComposerContext8 } from "@lexical/react/LexicalComposerContext";
|
|
20385
20396
|
import { ContentEditable } from "@lexical/react/LexicalContentEditable";
|
|
20386
20397
|
import LexicalErrorBoundary from "@lexical/react/LexicalErrorBoundary";
|
|
20387
20398
|
import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
|
|
@@ -20390,7 +20401,7 @@ import { MarkdownShortcutPlugin } from "@lexical/react/LexicalMarkdownShortcutPl
|
|
|
20390
20401
|
import { RichTextPlugin } from "@lexical/react/LexicalRichTextPlugin";
|
|
20391
20402
|
import { TablePlugin } from "@lexical/react/LexicalTablePlugin";
|
|
20392
20403
|
import { HeadingNode, QuoteNode } from "@lexical/rich-text";
|
|
20393
|
-
import { TableCellNode as
|
|
20404
|
+
import { TableCellNode as TableCellNode3, TableNode, TableRowNode as TableRowNode2 } from "@lexical/table";
|
|
20394
20405
|
|
|
20395
20406
|
// ../richtext/dist/index.mjs
|
|
20396
20407
|
var richTextBuiltInElements = [
|
|
@@ -20489,7 +20500,7 @@ var getLabelForElement = (type) => {
|
|
|
20489
20500
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
20490
20501
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
20491
20502
|
import { ParagraphNode as ParagraphNode2 } from "lexical";
|
|
20492
|
-
import { useEffect as
|
|
20503
|
+
import { useEffect as useEffect24, useState as useState21 } from "react";
|
|
20493
20504
|
|
|
20494
20505
|
// src/components/ParameterInputs/rich-text/CustomCodeNode.ts
|
|
20495
20506
|
import { CodeNode } from "@lexical/code";
|
|
@@ -20726,9 +20737,32 @@ var tableCellElement = css96`
|
|
|
20726
20737
|
min-width: 2rem;
|
|
20727
20738
|
outline: none;
|
|
20728
20739
|
padding: var(--spacing-sm);
|
|
20740
|
+
position: relative;
|
|
20729
20741
|
text-align: start;
|
|
20730
20742
|
vertical-align: top;
|
|
20731
20743
|
width: 7rem;
|
|
20744
|
+
|
|
20745
|
+
/* Used by the table resizer plugin to not change the hovered cell immediately
|
|
20746
|
+
upon going with the mouse over the neighboring cell */
|
|
20747
|
+
&::after {
|
|
20748
|
+
content: '';
|
|
20749
|
+
height: 5px;
|
|
20750
|
+
left: 0;
|
|
20751
|
+
position: absolute;
|
|
20752
|
+
top: 100%;
|
|
20753
|
+
width: 100%;
|
|
20754
|
+
z-index: 1;
|
|
20755
|
+
}
|
|
20756
|
+
|
|
20757
|
+
&::before {
|
|
20758
|
+
content: '';
|
|
20759
|
+
width: 5px;
|
|
20760
|
+
height: 100%;
|
|
20761
|
+
position: absolute;
|
|
20762
|
+
top: 0;
|
|
20763
|
+
left: 100%;
|
|
20764
|
+
z-index: 1;
|
|
20765
|
+
}
|
|
20732
20766
|
`;
|
|
20733
20767
|
var tableHeaderElement = css96`
|
|
20734
20768
|
background-color: var(--gray-100);
|
|
@@ -21088,7 +21122,7 @@ var LINK_POPOVER_OFFSET_X = 0;
|
|
|
21088
21122
|
var LINK_POPOVER_OFFSET_Y = 8;
|
|
21089
21123
|
var linkPopover = css97`
|
|
21090
21124
|
position: absolute;
|
|
21091
|
-
z-index:
|
|
21125
|
+
z-index: 11;
|
|
21092
21126
|
`;
|
|
21093
21127
|
var linkPopoverContainer = css97`
|
|
21094
21128
|
${Popover()};
|
|
@@ -21304,17 +21338,28 @@ function getLinkAncestor(node) {
|
|
|
21304
21338
|
}
|
|
21305
21339
|
|
|
21306
21340
|
// src/components/ParameterInputs/rich-text/ListIndentPlugin.tsx
|
|
21307
|
-
import { $getListDepth, $isListItemNode, $isListNode } from "@lexical/list";
|
|
21341
|
+
import { $getListDepth, $isListItemNode, $isListNode, ListNode } from "@lexical/list";
|
|
21308
21342
|
import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
|
|
21309
|
-
import { TabIndentationPlugin } from "@lexical/react/LexicalTabIndentationPlugin";
|
|
21310
21343
|
import {
|
|
21344
|
+
$filter,
|
|
21345
|
+
$getNearestBlockElementAncestorOrThrow,
|
|
21346
|
+
$getNearestNodeOfType,
|
|
21347
|
+
mergeRegister as mergeRegister3
|
|
21348
|
+
} from "@lexical/utils";
|
|
21349
|
+
import {
|
|
21350
|
+
$createRangeSelection,
|
|
21311
21351
|
$getSelection as $getSelection2,
|
|
21352
|
+
$isBlockElementNode,
|
|
21312
21353
|
$isRangeSelection as $isRangeSelection2,
|
|
21354
|
+
$normalizeSelection__EXPERIMENTAL,
|
|
21313
21355
|
COMMAND_PRIORITY_CRITICAL,
|
|
21314
|
-
|
|
21356
|
+
COMMAND_PRIORITY_NORMAL,
|
|
21357
|
+
INDENT_CONTENT_COMMAND,
|
|
21358
|
+
KEY_TAB_COMMAND,
|
|
21359
|
+
OUTDENT_CONTENT_COMMAND,
|
|
21360
|
+
SELECTION_CHANGE_COMMAND
|
|
21315
21361
|
} from "lexical";
|
|
21316
|
-
import { useEffect as useEffect19 } from "react";
|
|
21317
|
-
import { jsx as jsx130 } from "@emotion/react/jsx-runtime";
|
|
21362
|
+
import { useEffect as useEffect19, useRef as useRef12 } from "react";
|
|
21318
21363
|
function isIndentPermitted(maxDepth) {
|
|
21319
21364
|
const selection = $getSelection2();
|
|
21320
21365
|
if (!$isRangeSelection2(selection)) {
|
|
@@ -21335,16 +21380,84 @@ function isIndentPermitted(maxDepth) {
|
|
|
21335
21380
|
}
|
|
21336
21381
|
return totalDepth <= maxDepth;
|
|
21337
21382
|
}
|
|
21383
|
+
function $isAnyOfSelectedNodesAListItemNode(selection) {
|
|
21384
|
+
const nodes = selection.getNodes();
|
|
21385
|
+
return $filter(nodes, (node) => $isListItemNode(node) ? node : null).length > 0;
|
|
21386
|
+
}
|
|
21387
|
+
function $indentOverTab(selection) {
|
|
21388
|
+
const nodes = selection.getNodes();
|
|
21389
|
+
const canIndentBlockNodes = $filter(nodes, (node) => {
|
|
21390
|
+
if ($isBlockElementNode(node) && node.canIndent()) {
|
|
21391
|
+
return node;
|
|
21392
|
+
}
|
|
21393
|
+
return null;
|
|
21394
|
+
});
|
|
21395
|
+
if (canIndentBlockNodes.length > 0) {
|
|
21396
|
+
return true;
|
|
21397
|
+
}
|
|
21398
|
+
const anchor = selection.anchor;
|
|
21399
|
+
const focus = selection.focus;
|
|
21400
|
+
const first = focus.isBefore(anchor) ? focus : anchor;
|
|
21401
|
+
const firstNode = first.getNode();
|
|
21402
|
+
const firstBlock = $getNearestBlockElementAncestorOrThrow(firstNode);
|
|
21403
|
+
if (firstBlock.canIndent()) {
|
|
21404
|
+
const firstBlockKey = firstBlock.getKey();
|
|
21405
|
+
let selectionAtStart = $createRangeSelection();
|
|
21406
|
+
selectionAtStart.anchor.set(firstBlockKey, 0, "element");
|
|
21407
|
+
selectionAtStart.focus.set(firstBlockKey, 0, "element");
|
|
21408
|
+
selectionAtStart = $normalizeSelection__EXPERIMENTAL(selectionAtStart);
|
|
21409
|
+
if (selectionAtStart.anchor.is(first)) {
|
|
21410
|
+
return true;
|
|
21411
|
+
}
|
|
21412
|
+
}
|
|
21413
|
+
return false;
|
|
21414
|
+
}
|
|
21338
21415
|
function ListIndentPlugin({ maxDepth }) {
|
|
21339
21416
|
const [editor] = useLexicalComposerContext3();
|
|
21417
|
+
const isInListItemNode = useRef12(false);
|
|
21340
21418
|
useEffect19(() => {
|
|
21341
21419
|
return editor.registerCommand(
|
|
21342
|
-
|
|
21343
|
-
() =>
|
|
21344
|
-
|
|
21420
|
+
SELECTION_CHANGE_COMMAND,
|
|
21421
|
+
() => {
|
|
21422
|
+
editor.read(() => {
|
|
21423
|
+
const selection = $getSelection2();
|
|
21424
|
+
if (!$isRangeSelection2(selection) || !selection.isCollapsed()) {
|
|
21425
|
+
isInListItemNode.current = false;
|
|
21426
|
+
return false;
|
|
21427
|
+
}
|
|
21428
|
+
isInListItemNode.current = $getNearestNodeOfType(selection.anchor.getNode(), ListNode) !== null;
|
|
21429
|
+
});
|
|
21430
|
+
return false;
|
|
21431
|
+
},
|
|
21432
|
+
COMMAND_PRIORITY_NORMAL
|
|
21433
|
+
);
|
|
21434
|
+
}, [editor]);
|
|
21435
|
+
useEffect19(() => {
|
|
21436
|
+
return mergeRegister3(
|
|
21437
|
+
editor.registerCommand(
|
|
21438
|
+
INDENT_CONTENT_COMMAND,
|
|
21439
|
+
() => !isIndentPermitted(maxDepth),
|
|
21440
|
+
COMMAND_PRIORITY_CRITICAL
|
|
21441
|
+
),
|
|
21442
|
+
editor.registerCommand(
|
|
21443
|
+
KEY_TAB_COMMAND,
|
|
21444
|
+
(event) => {
|
|
21445
|
+
const selection = $getSelection2();
|
|
21446
|
+
if (!$isRangeSelection2(selection) || !isInListItemNode.current && !$isAnyOfSelectedNodesAListItemNode(selection)) {
|
|
21447
|
+
return false;
|
|
21448
|
+
}
|
|
21449
|
+
event.preventDefault();
|
|
21450
|
+
if ($indentOverTab(selection)) {
|
|
21451
|
+
const command = event.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND;
|
|
21452
|
+
return editor.dispatchCommand(command, void 0);
|
|
21453
|
+
}
|
|
21454
|
+
return false;
|
|
21455
|
+
},
|
|
21456
|
+
COMMAND_PRIORITY_CRITICAL
|
|
21457
|
+
)
|
|
21345
21458
|
);
|
|
21346
21459
|
}, [editor, maxDepth]);
|
|
21347
|
-
return
|
|
21460
|
+
return null;
|
|
21348
21461
|
}
|
|
21349
21462
|
|
|
21350
21463
|
// src/components/ParameterInputs/rich-text/RichTextToolbar.tsx
|
|
@@ -21354,14 +21467,14 @@ import {
|
|
|
21354
21467
|
$isListNode as $isListNode2,
|
|
21355
21468
|
INSERT_ORDERED_LIST_COMMAND,
|
|
21356
21469
|
INSERT_UNORDERED_LIST_COMMAND,
|
|
21357
|
-
ListNode,
|
|
21470
|
+
ListNode as ListNode2,
|
|
21358
21471
|
REMOVE_LIST_COMMAND
|
|
21359
21472
|
} from "@lexical/list";
|
|
21360
21473
|
import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
|
|
21361
21474
|
import { $createHeadingNode, $createQuoteNode, $isHeadingNode } from "@lexical/rich-text";
|
|
21362
21475
|
import { $setBlocksType } from "@lexical/selection";
|
|
21363
21476
|
import { $createTableNodeWithDimensions } from "@lexical/table";
|
|
21364
|
-
import { $findMatchingParent, $getNearestNodeOfType } from "@lexical/utils";
|
|
21477
|
+
import { $findMatchingParent, $getNearestNodeOfType as $getNearestNodeOfType2 } from "@lexical/utils";
|
|
21365
21478
|
import {
|
|
21366
21479
|
$createParagraphNode,
|
|
21367
21480
|
$getSelection as $getSelection3,
|
|
@@ -21370,10 +21483,10 @@ import {
|
|
|
21370
21483
|
$isRootOrShadowRoot,
|
|
21371
21484
|
COMMAND_PRIORITY_CRITICAL as COMMAND_PRIORITY_CRITICAL2,
|
|
21372
21485
|
FORMAT_TEXT_COMMAND,
|
|
21373
|
-
SELECTION_CHANGE_COMMAND
|
|
21486
|
+
SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND2
|
|
21374
21487
|
} from "lexical";
|
|
21375
21488
|
import { useCallback as useCallback11, useEffect as useEffect20, useMemo as useMemo6, useState as useState17 } from "react";
|
|
21376
|
-
import { Fragment as Fragment19, jsx as
|
|
21489
|
+
import { Fragment as Fragment19, jsx as jsx130, jsxs as jsxs86 } from "@emotion/react/jsx-runtime";
|
|
21377
21490
|
var toolbar = css98`
|
|
21378
21491
|
${scrollbarStyles}
|
|
21379
21492
|
background: var(--gray-50);
|
|
@@ -21381,7 +21494,7 @@ var toolbar = css98`
|
|
|
21381
21494
|
display: flex;
|
|
21382
21495
|
/* We add 1px because we use a 1px wide separator */
|
|
21383
21496
|
gap: calc(var(--spacing-sm) + 1px);
|
|
21384
|
-
margin: calc(var(--spacing-sm) + var(--spacing-xs)) 0;
|
|
21497
|
+
margin: 0 0 calc(var(--spacing-sm) + var(--spacing-xs)) 0;
|
|
21385
21498
|
overflow: auto;
|
|
21386
21499
|
padding: var(--spacing-sm);
|
|
21387
21500
|
position: sticky;
|
|
@@ -21433,7 +21546,7 @@ var toolbarChevron = css98`
|
|
|
21433
21546
|
margin-left: var(--spacing-xs);
|
|
21434
21547
|
`;
|
|
21435
21548
|
var RichTextToolbarIcon = ({ icon }) => {
|
|
21436
|
-
return /* @__PURE__ */
|
|
21549
|
+
return /* @__PURE__ */ jsx130(Icon, { icon, css: toolbarIcon, size: "1rem" });
|
|
21437
21550
|
};
|
|
21438
21551
|
var FORMATS_WITH_ICON = /* @__PURE__ */ new Map([
|
|
21439
21552
|
["bold", "format-bold"],
|
|
@@ -21521,7 +21634,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21521
21634
|
const elementDOM = editor.getElementByKey(elementKey);
|
|
21522
21635
|
if (elementDOM !== null) {
|
|
21523
21636
|
if ($isListNode2(element)) {
|
|
21524
|
-
const parentList = $
|
|
21637
|
+
const parentList = $getNearestNodeOfType2(anchorNode, ListNode2);
|
|
21525
21638
|
const type = parentList ? parentList.getListType() : element.getListType();
|
|
21526
21639
|
setActiveElement(type === "bullet" ? "unorderedList" : "orderedList");
|
|
21527
21640
|
} else {
|
|
@@ -21538,7 +21651,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21538
21651
|
}, [editor, setActiveElement, setActiveFormats, setIsLink]);
|
|
21539
21652
|
useEffect20(() => {
|
|
21540
21653
|
return editor.registerCommand(
|
|
21541
|
-
|
|
21654
|
+
SELECTION_CHANGE_COMMAND2,
|
|
21542
21655
|
(_payload) => {
|
|
21543
21656
|
updateToolbar();
|
|
21544
21657
|
return false;
|
|
@@ -21562,7 +21675,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21562
21675
|
menuTrigger: /* @__PURE__ */ jsxs86("button", { css: [richTextToolbarButton, textStyleButton], title: "Text styles", children: [
|
|
21563
21676
|
visibleTextualElements.some((element) => element.type === activeElement) ? getLabelForElement(activeElement) : getLabelForElement("paragraph"),
|
|
21564
21677
|
" ",
|
|
21565
|
-
/* @__PURE__ */
|
|
21678
|
+
/* @__PURE__ */ jsx130(Icon, { icon: "chevron-down", css: [toolbarIcon, toolbarChevron], size: "1rem" })
|
|
21566
21679
|
] }),
|
|
21567
21680
|
placement: "bottom-start",
|
|
21568
21681
|
children: [
|
|
@@ -21572,7 +21685,7 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21572
21685
|
type: "paragraph"
|
|
21573
21686
|
},
|
|
21574
21687
|
...visibleTextualElements
|
|
21575
|
-
].map((element) => /* @__PURE__ */
|
|
21688
|
+
].map((element) => /* @__PURE__ */ jsx130(
|
|
21576
21689
|
MenuItem,
|
|
21577
21690
|
{
|
|
21578
21691
|
onClick: () => {
|
|
@@ -21582,12 +21695,12 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21582
21695
|
},
|
|
21583
21696
|
element.type
|
|
21584
21697
|
)),
|
|
21585
|
-
visibleTextualElements.length === 0 ? /* @__PURE__ */
|
|
21698
|
+
visibleTextualElements.length === 0 ? /* @__PURE__ */ jsx130(MenuItem, { disabled: true, children: "Alternative text styles are not available" }) : null
|
|
21586
21699
|
]
|
|
21587
21700
|
}
|
|
21588
21701
|
),
|
|
21589
21702
|
visibleFormatsWithIcon.length > 0 || visibleFormatsWithoutIcon.length > 0 ? /* @__PURE__ */ jsxs86("div", { css: toolbarGroup, children: [
|
|
21590
|
-
visibleFormatsWithIcon.map((format) => /* @__PURE__ */
|
|
21703
|
+
visibleFormatsWithIcon.map((format) => /* @__PURE__ */ jsx130(Tooltip, { title: format.label, placement: "top", children: /* @__PURE__ */ jsx130(
|
|
21591
21704
|
"button",
|
|
21592
21705
|
{
|
|
21593
21706
|
onClick: () => {
|
|
@@ -21597,16 +21710,16 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21597
21710
|
richTextToolbarButton,
|
|
21598
21711
|
activeFormats.includes(format.type) ? richTextToolbarButtonActive : null
|
|
21599
21712
|
],
|
|
21600
|
-
children: /* @__PURE__ */
|
|
21713
|
+
children: /* @__PURE__ */ jsx130(RichTextToolbarIcon, { icon: FORMATS_WITH_ICON.get(format.type) })
|
|
21601
21714
|
}
|
|
21602
21715
|
) }, format.type)),
|
|
21603
|
-
visibleFormatsWithoutIcon.length > 0 ? /* @__PURE__ */
|
|
21716
|
+
visibleFormatsWithoutIcon.length > 0 ? /* @__PURE__ */ jsx130(
|
|
21604
21717
|
Menu,
|
|
21605
21718
|
{
|
|
21606
21719
|
menuLabel: "Alternative text styles",
|
|
21607
|
-
menuTrigger: /* @__PURE__ */
|
|
21720
|
+
menuTrigger: /* @__PURE__ */ jsx130("button", { css: richTextToolbarButton, title: "Alternative text styles", children: /* @__PURE__ */ jsx130(Icon, { icon: "more-alt", css: toolbarIcon }) }),
|
|
21608
21721
|
placement: "bottom-start",
|
|
21609
|
-
children: visibleFormatsWithoutIcon.map((format) => /* @__PURE__ */
|
|
21722
|
+
children: visibleFormatsWithoutIcon.map((format) => /* @__PURE__ */ jsx130(
|
|
21610
21723
|
MenuItem,
|
|
21611
21724
|
{
|
|
21612
21725
|
onClick: () => {
|
|
@@ -21620,18 +21733,18 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21620
21733
|
) : null
|
|
21621
21734
|
] }) : null,
|
|
21622
21735
|
visibleElementsWithIcons.size > 0 || customControls ? /* @__PURE__ */ jsxs86("div", { css: toolbarGroup, children: [
|
|
21623
|
-
linkElementVisible ? /* @__PURE__ */
|
|
21736
|
+
linkElementVisible ? /* @__PURE__ */ jsx130(Tooltip, { title: "Link", placement: "top", children: /* @__PURE__ */ jsx130(
|
|
21624
21737
|
"button",
|
|
21625
21738
|
{
|
|
21626
21739
|
onClick: () => {
|
|
21627
21740
|
isLink ? editor.dispatchCommand(REMOVE_LINK_NODE_COMMAND, {}) : editor.dispatchCommand(OPEN_LINK_NODE_MODAL_COMMAND, {});
|
|
21628
21741
|
},
|
|
21629
21742
|
css: [richTextToolbarButton, isLink ? richTextToolbarButtonActive : null],
|
|
21630
|
-
children: /* @__PURE__ */
|
|
21743
|
+
children: /* @__PURE__ */ jsx130(RichTextToolbarIcon, { icon: "link" })
|
|
21631
21744
|
}
|
|
21632
21745
|
) }) : null,
|
|
21633
21746
|
visibleLists.size > 0 ? /* @__PURE__ */ jsxs86(Fragment19, { children: [
|
|
21634
|
-
visibleLists.has("unorderedList") ? /* @__PURE__ */
|
|
21747
|
+
visibleLists.has("unorderedList") ? /* @__PURE__ */ jsx130(Tooltip, { title: "Bullet List", placement: "top", children: /* @__PURE__ */ jsx130(
|
|
21635
21748
|
"button",
|
|
21636
21749
|
{
|
|
21637
21750
|
onClick: () => {
|
|
@@ -21641,10 +21754,10 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21641
21754
|
richTextToolbarButton,
|
|
21642
21755
|
activeElement === "unorderedList" ? richTextToolbarButtonActive : null
|
|
21643
21756
|
],
|
|
21644
|
-
children: /* @__PURE__ */
|
|
21757
|
+
children: /* @__PURE__ */ jsx130(RichTextToolbarIcon, { icon: "layout-list" })
|
|
21645
21758
|
}
|
|
21646
21759
|
) }) : null,
|
|
21647
|
-
visibleLists.has("orderedList") ? /* @__PURE__ */
|
|
21760
|
+
visibleLists.has("orderedList") ? /* @__PURE__ */ jsx130(Tooltip, { title: "Ordered List", placement: "top", children: /* @__PURE__ */ jsx130(
|
|
21648
21761
|
"button",
|
|
21649
21762
|
{
|
|
21650
21763
|
onClick: () => {
|
|
@@ -21654,48 +21767,48 @@ var RichTextToolbar = ({ config, customControls, onInsertTable }) => {
|
|
|
21654
21767
|
richTextToolbarButton,
|
|
21655
21768
|
activeElement === "orderedList" ? richTextToolbarButtonActive : null
|
|
21656
21769
|
],
|
|
21657
|
-
children: /* @__PURE__ */
|
|
21770
|
+
children: /* @__PURE__ */ jsx130(RichTextToolbarIcon, { icon: "layout-list-numbered" })
|
|
21658
21771
|
}
|
|
21659
21772
|
) }) : null
|
|
21660
21773
|
] }) : null,
|
|
21661
21774
|
customControls ? customControls : null
|
|
21662
21775
|
] }) : null,
|
|
21663
|
-
visibleInsertElementsWithIcons.size > 0 ? /* @__PURE__ */
|
|
21776
|
+
visibleInsertElementsWithIcons.size > 0 ? /* @__PURE__ */ jsx130("div", { css: toolbarGroup, children: /* @__PURE__ */ jsxs86(
|
|
21664
21777
|
Menu,
|
|
21665
21778
|
{
|
|
21666
21779
|
menuTrigger: /* @__PURE__ */ jsxs86("button", { css: richTextToolbarButton, title: "Insert block element", children: [
|
|
21667
21780
|
"Insert",
|
|
21668
|
-
/* @__PURE__ */
|
|
21781
|
+
/* @__PURE__ */ jsx130(Icon, { icon: "chevron-down", css: [toolbarIcon, toolbarChevron], size: "1rem" })
|
|
21669
21782
|
] }),
|
|
21670
21783
|
placement: "bottom-start",
|
|
21671
21784
|
children: [
|
|
21672
|
-
quoteElementVisible ? /* @__PURE__ */
|
|
21785
|
+
quoteElementVisible ? /* @__PURE__ */ jsx130(
|
|
21673
21786
|
MenuItem,
|
|
21674
21787
|
{
|
|
21675
21788
|
onClick: () => {
|
|
21676
21789
|
onSelectElement("quote");
|
|
21677
21790
|
},
|
|
21678
|
-
icon: /* @__PURE__ */
|
|
21791
|
+
icon: /* @__PURE__ */ jsx130(Icon, { icon: "quote", iconColor: "currentColor" }),
|
|
21679
21792
|
children: "Quote"
|
|
21680
21793
|
}
|
|
21681
21794
|
) : null,
|
|
21682
|
-
codeElementVisible ? /* @__PURE__ */
|
|
21795
|
+
codeElementVisible ? /* @__PURE__ */ jsx130(
|
|
21683
21796
|
MenuItem,
|
|
21684
21797
|
{
|
|
21685
21798
|
onClick: () => {
|
|
21686
21799
|
onSelectElement("code");
|
|
21687
21800
|
},
|
|
21688
|
-
icon: /* @__PURE__ */
|
|
21801
|
+
icon: /* @__PURE__ */ jsx130(Icon, { icon: "code-slash", iconColor: "currentColor" }),
|
|
21689
21802
|
children: "Code"
|
|
21690
21803
|
}
|
|
21691
21804
|
) : null,
|
|
21692
|
-
tableElementVisible && onInsertTable !== void 0 ? /* @__PURE__ */
|
|
21805
|
+
tableElementVisible && onInsertTable !== void 0 ? /* @__PURE__ */ jsx130(
|
|
21693
21806
|
MenuItem,
|
|
21694
21807
|
{
|
|
21695
21808
|
onClick: () => {
|
|
21696
21809
|
onSelectElement("table");
|
|
21697
21810
|
},
|
|
21698
|
-
icon: /* @__PURE__ */
|
|
21811
|
+
icon: /* @__PURE__ */ jsx130(Icon, { icon: "view-grid", iconColor: "currentColor" }),
|
|
21699
21812
|
children: "Table"
|
|
21700
21813
|
}
|
|
21701
21814
|
) : null
|
|
@@ -21848,7 +21961,7 @@ import {
|
|
|
21848
21961
|
} from "@lexical/table";
|
|
21849
21962
|
import { $getRoot, $getSelection as $getSelection4, $isRangeSelection as $isRangeSelection4 } from "lexical";
|
|
21850
21963
|
import { forwardRef as forwardRef22, useCallback as useCallback12, useEffect as useEffect21, useLayoutEffect, useState as useState18 } from "react";
|
|
21851
|
-
import { jsx as
|
|
21964
|
+
import { jsx as jsx131, jsxs as jsxs87 } from "@emotion/react/jsx-runtime";
|
|
21852
21965
|
function computeSelectionCount(selection) {
|
|
21853
21966
|
const selectionShape = selection.getShape();
|
|
21854
21967
|
return {
|
|
@@ -21866,11 +21979,11 @@ var TableActionMenuTrigger = forwardRef22((props, ref) => {
|
|
|
21866
21979
|
useLayoutEffect(() => {
|
|
21867
21980
|
const rect = tableCellEl.getBoundingClientRect();
|
|
21868
21981
|
const parentRect = positioningAnchorEl.getBoundingClientRect();
|
|
21869
|
-
const relativeX = rect.right - parentRect.left;
|
|
21870
|
-
const relativeY = rect.top - parentRect.top;
|
|
21982
|
+
const relativeX = rect.right - parentRect.left + positioningAnchorEl.scrollLeft;
|
|
21983
|
+
const relativeY = rect.top - parentRect.top + positioningAnchorEl.scrollTop;
|
|
21871
21984
|
setCoordinates({ x: relativeX, y: relativeY });
|
|
21872
21985
|
}, [tableCellEl, positioningAnchorEl]);
|
|
21873
|
-
return /* @__PURE__ */
|
|
21986
|
+
return /* @__PURE__ */ jsx131(
|
|
21874
21987
|
IconButton,
|
|
21875
21988
|
{
|
|
21876
21989
|
ref,
|
|
@@ -21884,7 +21997,7 @@ var TableActionMenuTrigger = forwardRef22((props, ref) => {
|
|
|
21884
21997
|
size: "xs",
|
|
21885
21998
|
buttonType: "unimportant",
|
|
21886
21999
|
...rest,
|
|
21887
|
-
children: /* @__PURE__ */
|
|
22000
|
+
children: /* @__PURE__ */ jsx131(Icon, { icon: "chevron-down", size: "1rem", iconColor: "currentColor" })
|
|
21888
22001
|
}
|
|
21889
22002
|
);
|
|
21890
22003
|
});
|
|
@@ -21984,10 +22097,9 @@ function TableActionMenu({
|
|
|
21984
22097
|
const deleteTableColumnAtSelection = useCallback12(() => {
|
|
21985
22098
|
editor.update(() => {
|
|
21986
22099
|
$deleteTableColumn__EXPERIMENTAL();
|
|
21987
|
-
clearTableSelection();
|
|
21988
22100
|
});
|
|
21989
22101
|
incrementMenuTriggerKey();
|
|
21990
|
-
}, [editor
|
|
22102
|
+
}, [editor]);
|
|
21991
22103
|
const toggleTableRowIsHeader = useCallback12(() => {
|
|
21992
22104
|
editor.update(() => {
|
|
21993
22105
|
const tableNode = $getTableNodeFromLexicalNodeOrThrow(tableCellNode);
|
|
@@ -22042,7 +22154,7 @@ function TableActionMenu({
|
|
|
22042
22154
|
return /* @__PURE__ */ jsxs87(
|
|
22043
22155
|
Menu,
|
|
22044
22156
|
{
|
|
22045
|
-
menuTrigger: /* @__PURE__ */
|
|
22157
|
+
menuTrigger: /* @__PURE__ */ jsx131(
|
|
22046
22158
|
TableActionMenuTrigger,
|
|
22047
22159
|
{
|
|
22048
22160
|
tableCellEl,
|
|
@@ -22072,7 +22184,7 @@ function TableActionMenu({
|
|
|
22072
22184
|
selectionCounts.rows === 1 ? "row" : `${selectionCounts.rows} rows`,
|
|
22073
22185
|
" below"
|
|
22074
22186
|
] }),
|
|
22075
|
-
/* @__PURE__ */
|
|
22187
|
+
/* @__PURE__ */ jsx131(MenuItemSeparator, {}),
|
|
22076
22188
|
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => insertTableColumnAtSelection(false), css: menuItemCss, children: [
|
|
22077
22189
|
"Insert ",
|
|
22078
22190
|
selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`,
|
|
@@ -22083,11 +22195,11 @@ function TableActionMenu({
|
|
|
22083
22195
|
selectionCounts.columns === 1 ? "column" : `${selectionCounts.columns} columns`,
|
|
22084
22196
|
" right"
|
|
22085
22197
|
] }),
|
|
22086
|
-
/* @__PURE__ */
|
|
22087
|
-
/* @__PURE__ */
|
|
22088
|
-
/* @__PURE__ */
|
|
22089
|
-
/* @__PURE__ */
|
|
22090
|
-
/* @__PURE__ */
|
|
22198
|
+
/* @__PURE__ */ jsx131(MenuItemSeparator, {}),
|
|
22199
|
+
/* @__PURE__ */ jsx131(MenuItem, { onClick: () => deleteTableColumnAtSelection(), css: menuItemCss, children: "Delete column" }),
|
|
22200
|
+
/* @__PURE__ */ jsx131(MenuItem, { onClick: () => deleteTableRowAtSelection(), css: menuItemCss, children: "Delete row" }),
|
|
22201
|
+
/* @__PURE__ */ jsx131(MenuItem, { onClick: () => deleteTableAtSelection(), css: menuItemCss, children: "Delete table" }),
|
|
22202
|
+
/* @__PURE__ */ jsx131(MenuItemSeparator, {}),
|
|
22091
22203
|
/* @__PURE__ */ jsxs87(MenuItem, { onClick: () => toggleTableRowIsHeader(), css: menuItemCss, children: [
|
|
22092
22204
|
(tableCellNode.__headerState & TableCellHeaderStates.ROW) === TableCellHeaderStates.ROW ? "Remove" : "Add",
|
|
22093
22205
|
" ",
|
|
@@ -22161,7 +22273,7 @@ function TableCellActionMenuContainer({
|
|
|
22161
22273
|
});
|
|
22162
22274
|
});
|
|
22163
22275
|
});
|
|
22164
|
-
return tableCellNode != null && tableCellNodeEl != null && tableCellMenuPortalEl != null && /* @__PURE__ */
|
|
22276
|
+
return tableCellNode != null && tableCellNodeEl != null && tableCellMenuPortalEl != null && /* @__PURE__ */ jsx131(
|
|
22165
22277
|
TableActionMenu,
|
|
22166
22278
|
{
|
|
22167
22279
|
tableCellNode,
|
|
@@ -22172,15 +22284,12 @@ function TableCellActionMenuContainer({
|
|
|
22172
22284
|
tableCellNode.getKey()
|
|
22173
22285
|
);
|
|
22174
22286
|
}
|
|
22175
|
-
function TableActionMenuPlugin({
|
|
22287
|
+
function TableActionMenuPlugin({
|
|
22288
|
+
positioningAnchorEl,
|
|
22289
|
+
menuPortalEl
|
|
22290
|
+
}) {
|
|
22176
22291
|
const isEditable = useLexicalEditable();
|
|
22177
|
-
return isEditable ? /* @__PURE__ */
|
|
22178
|
-
TableCellActionMenuContainer,
|
|
22179
|
-
{
|
|
22180
|
-
menuPortalEl: positioningAnchorEl,
|
|
22181
|
-
positioningAnchorEl
|
|
22182
|
-
}
|
|
22183
|
-
) : null;
|
|
22292
|
+
return isEditable ? /* @__PURE__ */ jsx131(TableCellActionMenuContainer, { menuPortalEl, positioningAnchorEl }) : null;
|
|
22184
22293
|
}
|
|
22185
22294
|
|
|
22186
22295
|
// src/components/ParameterInputs/rich-text/TableCellResizerPlugin.tsx
|
|
@@ -22196,9 +22305,9 @@ import {
|
|
|
22196
22305
|
} from "@lexical/table";
|
|
22197
22306
|
import { calculateZoomLevel } from "@lexical/utils";
|
|
22198
22307
|
import { $getNearestNodeFromDOMNode } from "lexical";
|
|
22199
|
-
import { useCallback as useCallback13, useEffect as useEffect22, useMemo as useMemo7, useRef as
|
|
22308
|
+
import { useCallback as useCallback13, useEffect as useEffect22, useMemo as useMemo7, useRef as useRef13, useState as useState19 } from "react";
|
|
22200
22309
|
import { createPortal as createPortal3 } from "react-dom";
|
|
22201
|
-
import { Fragment as Fragment20, jsx as
|
|
22310
|
+
import { Fragment as Fragment20, jsx as jsx132, jsxs as jsxs88 } from "@emotion/react/jsx-runtime";
|
|
22202
22311
|
var MIN_ROW_HEIGHT = 33;
|
|
22203
22312
|
var MIN_COLUMN_WIDTH = 50;
|
|
22204
22313
|
var tableResizer = css100`
|
|
@@ -22223,10 +22332,10 @@ var fixedGetDOMCellFromTarget = (node) => {
|
|
|
22223
22332
|
return null;
|
|
22224
22333
|
};
|
|
22225
22334
|
function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
22226
|
-
const targetRef =
|
|
22227
|
-
const resizerRef =
|
|
22228
|
-
const tableRectRef =
|
|
22229
|
-
const mouseStartPosRef =
|
|
22335
|
+
const targetRef = useRef13(null);
|
|
22336
|
+
const resizerRef = useRef13(null);
|
|
22337
|
+
const tableRectRef = useRef13(null);
|
|
22338
|
+
const mouseStartPosRef = useRef13(null);
|
|
22230
22339
|
const [mouseCurrentPos, updateMouseCurrentPos] = useState19(null);
|
|
22231
22340
|
const [activeCell, updateActiveCell] = useState19(null);
|
|
22232
22341
|
const [isMouseDown, updateIsMouseDown] = useState19(false);
|
|
@@ -22462,7 +22571,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
22462
22571
|
cursor: "row-resize",
|
|
22463
22572
|
height: `${zoneWidth}px`,
|
|
22464
22573
|
left: `${left - parentRect.left}px`,
|
|
22465
|
-
top: `${top - parentRect.top + height - zoneWidth / 2}px`,
|
|
22574
|
+
top: `${top - parentRect.top + positioningAnchorEl.scrollTop + height - zoneWidth / 2}px`,
|
|
22466
22575
|
width: `${width}px`
|
|
22467
22576
|
},
|
|
22468
22577
|
right: {
|
|
@@ -22470,7 +22579,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
22470
22579
|
cursor: "col-resize",
|
|
22471
22580
|
height: `${height}px`,
|
|
22472
22581
|
left: `${left - parentRect.left + width - zoneWidth / 2}px`,
|
|
22473
|
-
top: `${top - parentRect.top}px`,
|
|
22582
|
+
top: `${top - parentRect.top + positioningAnchorEl.scrollTop}px`,
|
|
22474
22583
|
width: `${zoneWidth}px`
|
|
22475
22584
|
}
|
|
22476
22585
|
};
|
|
@@ -22478,11 +22587,11 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
22478
22587
|
if (draggingDirection && mouseCurrentPos && tableRect) {
|
|
22479
22588
|
if (isHeightChanging(draggingDirection)) {
|
|
22480
22589
|
styles[draggingDirection].left = `${tableRect.left - parentRect.left}px`;
|
|
22481
|
-
styles[draggingDirection].top = `${(mouseCurrentPos.y - parentRect.top) / zoom}px`;
|
|
22590
|
+
styles[draggingDirection].top = `${(mouseCurrentPos.y - parentRect.top + positioningAnchorEl.scrollTop) / zoom}px`;
|
|
22482
22591
|
styles[draggingDirection].height = "3px";
|
|
22483
22592
|
styles[draggingDirection].width = `${tableRect.width}px`;
|
|
22484
22593
|
} else {
|
|
22485
|
-
styles[draggingDirection].top = `${tableRect.top - parentRect.top}px`;
|
|
22594
|
+
styles[draggingDirection].top = `${tableRect.top - parentRect.top + positioningAnchorEl.scrollTop}px`;
|
|
22486
22595
|
styles[draggingDirection].left = `${(mouseCurrentPos.x - parentRect.left) / zoom}px`;
|
|
22487
22596
|
styles[draggingDirection].width = "3px";
|
|
22488
22597
|
styles[draggingDirection].height = `${tableRect.height}px`;
|
|
@@ -22499,8 +22608,8 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
22499
22608
|
};
|
|
22500
22609
|
}, [activeCell, draggingDirection, mouseCurrentPos, positioningAnchorEl]);
|
|
22501
22610
|
const resizerStyles = getResizers();
|
|
22502
|
-
return /* @__PURE__ */
|
|
22503
|
-
/* @__PURE__ */
|
|
22611
|
+
return /* @__PURE__ */ jsx132("div", { ref: resizerRef, children: activeCell != null && !isMouseDown && /* @__PURE__ */ jsxs88(Fragment20, { children: [
|
|
22612
|
+
/* @__PURE__ */ jsx132(
|
|
22504
22613
|
"div",
|
|
22505
22614
|
{
|
|
22506
22615
|
css: tableResizer,
|
|
@@ -22508,7 +22617,7 @@ function TableCellResizer({ editor, positioningAnchorEl }) {
|
|
|
22508
22617
|
onMouseDown: toggleResize("right")
|
|
22509
22618
|
}
|
|
22510
22619
|
),
|
|
22511
|
-
/* @__PURE__ */
|
|
22620
|
+
/* @__PURE__ */ jsx132(
|
|
22512
22621
|
"div",
|
|
22513
22622
|
{
|
|
22514
22623
|
css: tableResizer,
|
|
@@ -22523,15 +22632,73 @@ function TableCellResizerPlugin({ positioningAnchorEl }) {
|
|
|
22523
22632
|
const isEditable = useLexicalEditable2();
|
|
22524
22633
|
return useMemo7(
|
|
22525
22634
|
() => isEditable ? createPortal3(
|
|
22526
|
-
/* @__PURE__ */
|
|
22635
|
+
/* @__PURE__ */ jsx132(TableCellResizer, { editor, positioningAnchorEl }),
|
|
22527
22636
|
positioningAnchorEl
|
|
22528
22637
|
) : null,
|
|
22529
22638
|
[editor, isEditable, positioningAnchorEl]
|
|
22530
22639
|
);
|
|
22531
22640
|
}
|
|
22532
22641
|
|
|
22642
|
+
// src/components/ParameterInputs/rich-text/TableSelectionPlugin.tsx
|
|
22643
|
+
import { useLexicalComposerContext as useLexicalComposerContext7 } from "@lexical/react/LexicalComposerContext";
|
|
22644
|
+
import { $findCellNode } from "@lexical/table";
|
|
22645
|
+
import {
|
|
22646
|
+
$getSelection as $getSelection5,
|
|
22647
|
+
$isRangeSelection as $isRangeSelection5,
|
|
22648
|
+
$setSelection,
|
|
22649
|
+
COMMAND_PRIORITY_NORMAL as COMMAND_PRIORITY_NORMAL2,
|
|
22650
|
+
SELECTION_CHANGE_COMMAND as SELECTION_CHANGE_COMMAND3
|
|
22651
|
+
} from "lexical";
|
|
22652
|
+
import { useEffect as useEffect23, useState as useState20 } from "react";
|
|
22653
|
+
var TableSelectionPlugin = () => {
|
|
22654
|
+
const [editor] = useLexicalComposerContext7();
|
|
22655
|
+
const [closestTableCellNode, setClosestTableCellNode] = useState20(null);
|
|
22656
|
+
useEffect23(() => {
|
|
22657
|
+
return editor.registerCommand(
|
|
22658
|
+
SELECTION_CHANGE_COMMAND3,
|
|
22659
|
+
() => {
|
|
22660
|
+
editor.read(() => {
|
|
22661
|
+
const selection = $getSelection5();
|
|
22662
|
+
if (!$isRangeSelection5(selection) || !selection.isCollapsed()) {
|
|
22663
|
+
setClosestTableCellNode(null);
|
|
22664
|
+
return false;
|
|
22665
|
+
}
|
|
22666
|
+
const tableCellNode = $findCellNode(selection.anchor.getNode());
|
|
22667
|
+
if (tableCellNode === null) {
|
|
22668
|
+
setClosestTableCellNode(null);
|
|
22669
|
+
return false;
|
|
22670
|
+
}
|
|
22671
|
+
setClosestTableCellNode(tableCellNode);
|
|
22672
|
+
});
|
|
22673
|
+
return false;
|
|
22674
|
+
},
|
|
22675
|
+
COMMAND_PRIORITY_NORMAL2
|
|
22676
|
+
);
|
|
22677
|
+
}, [editor]);
|
|
22678
|
+
useEffect23(() => {
|
|
22679
|
+
const onControlA = (event) => {
|
|
22680
|
+
if (event.key === "a" && (event.ctrlKey || event.metaKey)) {
|
|
22681
|
+
if (!closestTableCellNode) {
|
|
22682
|
+
return;
|
|
22683
|
+
}
|
|
22684
|
+
event.preventDefault();
|
|
22685
|
+
editor.update(() => {
|
|
22686
|
+
const selection = closestTableCellNode.select(0, closestTableCellNode.getChildrenSize());
|
|
22687
|
+
$setSelection(selection);
|
|
22688
|
+
});
|
|
22689
|
+
}
|
|
22690
|
+
};
|
|
22691
|
+
return editor.registerRootListener((rootElement, prevRootElement) => {
|
|
22692
|
+
rootElement == null ? void 0 : rootElement.addEventListener("keydown", onControlA);
|
|
22693
|
+
prevRootElement == null ? void 0 : prevRootElement.removeEventListener("keydown", onControlA);
|
|
22694
|
+
});
|
|
22695
|
+
}, [editor, closestTableCellNode]);
|
|
22696
|
+
return null;
|
|
22697
|
+
};
|
|
22698
|
+
var TableSelectionPlugin_default = TableSelectionPlugin;
|
|
22699
|
+
|
|
22533
22700
|
// src/components/ParameterInputs/ParameterRichText.tsx
|
|
22534
|
-
import { Fragment as Fragment21, jsx as
|
|
22701
|
+
import { Fragment as Fragment21, jsx as jsx133, jsxs as jsxs89 } from "@emotion/react/jsx-runtime";
|
|
22535
22702
|
var ParameterRichText = ({
|
|
22536
22703
|
label,
|
|
22537
22704
|
labelLeadingIcon,
|
|
@@ -22573,7 +22740,7 @@ var ParameterRichText = ({
|
|
|
22573
22740
|
captionTestId,
|
|
22574
22741
|
menuItems,
|
|
22575
22742
|
children: [
|
|
22576
|
-
/* @__PURE__ */
|
|
22743
|
+
/* @__PURE__ */ jsx133(
|
|
22577
22744
|
ParameterRichTextInner,
|
|
22578
22745
|
{
|
|
22579
22746
|
value,
|
|
@@ -22594,21 +22761,71 @@ var ParameterRichText = ({
|
|
|
22594
22761
|
children
|
|
22595
22762
|
}
|
|
22596
22763
|
),
|
|
22597
|
-
menuItems ? /* @__PURE__ */
|
|
22764
|
+
menuItems ? /* @__PURE__ */ jsx133(ParameterMenuButton, { label: `${label} menu`, children: /* @__PURE__ */ jsx133(Fragment21, { children: menuItems }) }) : null
|
|
22598
22765
|
]
|
|
22599
22766
|
}
|
|
22600
22767
|
);
|
|
22601
22768
|
};
|
|
22769
|
+
var editorContainerWrapper = css101`
|
|
22770
|
+
position: relative;
|
|
22771
|
+
|
|
22772
|
+
&::before {
|
|
22773
|
+
background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #ffffff 96.12%);
|
|
22774
|
+
bottom: 1px;
|
|
22775
|
+
content: '';
|
|
22776
|
+
display: block;
|
|
22777
|
+
height: 30px;
|
|
22778
|
+
left: var(--spacing-sm);
|
|
22779
|
+
pointer-events: none;
|
|
22780
|
+
position: absolute;
|
|
22781
|
+
right: var(--spacing-sm);
|
|
22782
|
+
z-index: 2;
|
|
22783
|
+
}
|
|
22784
|
+
`;
|
|
22602
22785
|
var editorWrapper = css101`
|
|
22603
22786
|
display: flex;
|
|
22604
22787
|
flex-flow: column;
|
|
22605
22788
|
flex-grow: 1;
|
|
22606
22789
|
`;
|
|
22607
22790
|
var editorContainer = css101`
|
|
22791
|
+
${scrollbarStyles}
|
|
22792
|
+
background: var(--white);
|
|
22793
|
+
border-radius: var(--rounded-sm);
|
|
22794
|
+
border: 1px solid var(--gray-200);
|
|
22795
|
+
color: var(--gray-900);
|
|
22608
22796
|
display: flex;
|
|
22609
22797
|
flex-flow: column;
|
|
22610
22798
|
flex-grow: 1;
|
|
22799
|
+
font-size: var(--fs-base);
|
|
22800
|
+
height: max-content;
|
|
22801
|
+
line-height: 1.2;
|
|
22802
|
+
max-height: 300px;
|
|
22803
|
+
min-height: 50px;
|
|
22804
|
+
overflow-y: auto;
|
|
22805
|
+
padding: var(--spacing-sm);
|
|
22611
22806
|
position: relative;
|
|
22807
|
+
resize: vertical;
|
|
22808
|
+
|
|
22809
|
+
&:focus,
|
|
22810
|
+
&:focus-within {
|
|
22811
|
+
border-radius: var(--rounded-sm);
|
|
22812
|
+
box-shadow: var(--elevation-100);
|
|
22813
|
+
border: 1px solid var(--accent-dark-hover);
|
|
22814
|
+
outline: none;
|
|
22815
|
+
}
|
|
22816
|
+
|
|
22817
|
+
&[style*='height:'] {
|
|
22818
|
+
min-height: 50px;
|
|
22819
|
+
max-height: unset;
|
|
22820
|
+
}
|
|
22821
|
+
`;
|
|
22822
|
+
var editorContainerOverflowWrapper = css101`
|
|
22823
|
+
overflow: hidden;
|
|
22824
|
+
pointer-events: none;
|
|
22825
|
+
|
|
22826
|
+
& > * {
|
|
22827
|
+
pointer-events: auto;
|
|
22828
|
+
}
|
|
22612
22829
|
`;
|
|
22613
22830
|
var editorPlaceholder = css101`
|
|
22614
22831
|
color: var(--gray-500);
|
|
@@ -22622,21 +22839,10 @@ var editorPlaceholder = css101`
|
|
|
22622
22839
|
user-select: none;
|
|
22623
22840
|
`;
|
|
22624
22841
|
var editorInput = css101`
|
|
22625
|
-
|
|
22626
|
-
border: 1px solid var(--gray-200);
|
|
22627
|
-
border-radius: var(--rounded-sm);
|
|
22628
|
-
color: var(--gray-900);
|
|
22629
|
-
flex-grow: 1;
|
|
22630
|
-
font-size: var(--fs-base);
|
|
22631
|
-
line-height: 1.2;
|
|
22632
|
-
min-height: 2rem;
|
|
22633
|
-
padding: var(--spacing-sm);
|
|
22842
|
+
min-height: 100%;
|
|
22634
22843
|
|
|
22635
22844
|
&:focus,
|
|
22636
22845
|
&:focus-within {
|
|
22637
|
-
border-radius: var(--rounded-sm);
|
|
22638
|
-
box-shadow: var(--elevation-100);
|
|
22639
|
-
border: 1px solid var(--accent-dark-hover);
|
|
22640
22846
|
outline: none;
|
|
22641
22847
|
}
|
|
22642
22848
|
`;
|
|
@@ -22665,7 +22871,7 @@ var ParameterRichTextInner = ({
|
|
|
22665
22871
|
},
|
|
22666
22872
|
editorState: value ? JSON.stringify(value) : void 0,
|
|
22667
22873
|
nodes: [
|
|
22668
|
-
|
|
22874
|
+
ListNode3,
|
|
22669
22875
|
ListItemNode,
|
|
22670
22876
|
LinkNode,
|
|
22671
22877
|
HeadingNode,
|
|
@@ -22673,7 +22879,7 @@ var ParameterRichTextInner = ({
|
|
|
22673
22879
|
ParagraphNode2,
|
|
22674
22880
|
CustomCodeNode,
|
|
22675
22881
|
TableNode,
|
|
22676
|
-
|
|
22882
|
+
TableCellNode3,
|
|
22677
22883
|
TableRowNode2,
|
|
22678
22884
|
...customNodes != null ? customNodes : []
|
|
22679
22885
|
],
|
|
@@ -22715,7 +22921,7 @@ var ParameterRichTextInner = ({
|
|
|
22715
22921
|
editable: !readOnly
|
|
22716
22922
|
};
|
|
22717
22923
|
return /* @__PURE__ */ jsxs89(Fragment21, { children: [
|
|
22718
|
-
/* @__PURE__ */
|
|
22924
|
+
/* @__PURE__ */ jsx133("div", { css: [editorWrapper], className: editorWrapperClassName, children: /* @__PURE__ */ jsx133(LexicalComposer, { initialConfig: lexicalConfig, children: /* @__PURE__ */ jsx133(
|
|
22719
22925
|
RichText,
|
|
22720
22926
|
{
|
|
22721
22927
|
onChange,
|
|
@@ -22758,13 +22964,13 @@ var RichText = ({
|
|
|
22758
22964
|
onInsertTable,
|
|
22759
22965
|
minimalInteractivity
|
|
22760
22966
|
}) => {
|
|
22761
|
-
const [editor] =
|
|
22762
|
-
|
|
22967
|
+
const [editor] = useLexicalComposerContext8();
|
|
22968
|
+
useEffect24(() => {
|
|
22763
22969
|
if (onRichTextInit) {
|
|
22764
22970
|
onRichTextInit(editor);
|
|
22765
22971
|
}
|
|
22766
22972
|
}, [editor, onRichTextInit]);
|
|
22767
|
-
|
|
22973
|
+
useEffect24(() => {
|
|
22768
22974
|
const removeUpdateListener = editor.registerUpdateListener(({ editorState, prevEditorState, tags }) => {
|
|
22769
22975
|
requestAnimationFrame(() => {
|
|
22770
22976
|
if (!deepEqual2(editorState.toJSON(), prevEditorState.toJSON())) {
|
|
@@ -22776,66 +22982,81 @@ var RichText = ({
|
|
|
22776
22982
|
removeUpdateListener();
|
|
22777
22983
|
};
|
|
22778
22984
|
}, [editor, onChange]);
|
|
22779
|
-
|
|
22985
|
+
useEffect24(() => {
|
|
22780
22986
|
editor.setEditable(!readOnly);
|
|
22781
22987
|
}, [editor, readOnly]);
|
|
22782
|
-
const [editorContainerRef, setEditorContainerRef] =
|
|
22783
|
-
const
|
|
22988
|
+
const [editorContainerRef, setEditorContainerRef] = useState21(null);
|
|
22989
|
+
const onEditorContainerRef = (_editorContainerRef) => {
|
|
22784
22990
|
if (_editorContainerRef !== null) {
|
|
22785
22991
|
setEditorContainerRef(_editorContainerRef);
|
|
22786
22992
|
}
|
|
22787
22993
|
};
|
|
22994
|
+
const [portalContainerRef, setPortalContainerRef] = useState21(null);
|
|
22995
|
+
const onPortalContainerRef = (_portalContainerRef) => {
|
|
22996
|
+
if (_portalContainerRef !== null) {
|
|
22997
|
+
setPortalContainerRef(_portalContainerRef);
|
|
22998
|
+
}
|
|
22999
|
+
};
|
|
22788
23000
|
return /* @__PURE__ */ jsxs89(Fragment21, { children: [
|
|
22789
|
-
readOnly || minimalInteractivity ? null : /* @__PURE__ */
|
|
22790
|
-
/* @__PURE__ */ jsxs89(
|
|
22791
|
-
|
|
22792
|
-
|
|
22793
|
-
|
|
22794
|
-
|
|
22795
|
-
|
|
22796
|
-
|
|
22797
|
-
|
|
22798
|
-
|
|
22799
|
-
|
|
22800
|
-
|
|
22801
|
-
|
|
22802
|
-
|
|
22803
|
-
|
|
22804
|
-
|
|
22805
|
-
|
|
22806
|
-
|
|
22807
|
-
|
|
22808
|
-
|
|
22809
|
-
|
|
22810
|
-
|
|
22811
|
-
|
|
22812
|
-
|
|
22813
|
-
|
|
22814
|
-
|
|
22815
|
-
|
|
22816
|
-
|
|
22817
|
-
|
|
22818
|
-
|
|
22819
|
-
|
|
22820
|
-
}
|
|
22821
|
-
|
|
22822
|
-
|
|
22823
|
-
|
|
22824
|
-
|
|
22825
|
-
|
|
22826
|
-
|
|
22827
|
-
|
|
22828
|
-
|
|
23001
|
+
readOnly || minimalInteractivity ? null : /* @__PURE__ */ jsx133(RichTextToolbar_default, { config, customControls, onInsertTable }),
|
|
23002
|
+
/* @__PURE__ */ jsxs89("div", { css: editorContainerWrapper, ref: onPortalContainerRef, children: [
|
|
23003
|
+
/* @__PURE__ */ jsxs89(
|
|
23004
|
+
"div",
|
|
23005
|
+
{
|
|
23006
|
+
css: editorContainer,
|
|
23007
|
+
className: editorInputWrapperClassName,
|
|
23008
|
+
ref: onEditorContainerRef,
|
|
23009
|
+
"data-testid": "value-container",
|
|
23010
|
+
children: [
|
|
23011
|
+
/* @__PURE__ */ jsx133(
|
|
23012
|
+
RichTextPlugin,
|
|
23013
|
+
{
|
|
23014
|
+
contentEditable: /* @__PURE__ */ jsx133(ContentEditable, { css: editorInput, className: editorInputClassName }),
|
|
23015
|
+
placeholder: /* @__PURE__ */ jsx133("div", { css: editorPlaceholder, children: readOnly ? "empty" : "start editing..." }),
|
|
23016
|
+
ErrorBoundary: LexicalErrorBoundary
|
|
23017
|
+
}
|
|
23018
|
+
),
|
|
23019
|
+
/* @__PURE__ */ jsx133(ListPlugin, {}),
|
|
23020
|
+
/* @__PURE__ */ jsx133(ListIndentPlugin, { maxDepth: 4 }),
|
|
23021
|
+
/* @__PURE__ */ jsx133(TablePlugin, { hasCellMerge: false, hasCellBackgroundColor: false }),
|
|
23022
|
+
/* @__PURE__ */ jsx133("div", { css: editorContainerOverflowWrapper, children: editorContainerRef && portalContainerRef && !minimalInteractivity ? /* @__PURE__ */ jsx133(
|
|
23023
|
+
TableActionMenuPlugin,
|
|
23024
|
+
{
|
|
23025
|
+
positioningAnchorEl: editorContainerRef,
|
|
23026
|
+
menuPortalEl: portalContainerRef
|
|
23027
|
+
}
|
|
23028
|
+
) : null }),
|
|
23029
|
+
editorContainerRef && !minimalInteractivity ? /* @__PURE__ */ jsx133(TableCellResizerPlugin, { positioningAnchorEl: editorContainerRef }) : null,
|
|
23030
|
+
readOnly ? null : /* @__PURE__ */ jsx133(HistoryPlugin, {}),
|
|
23031
|
+
/* @__PURE__ */ jsx133(DisableStylesPlugin, {}),
|
|
23032
|
+
/* @__PURE__ */ jsx133(MarkdownShortcutPlugin, { transformers: MARKDOWN_TRANSFORMERS })
|
|
23033
|
+
]
|
|
23034
|
+
}
|
|
23035
|
+
),
|
|
23036
|
+
/* @__PURE__ */ jsx133(Fragment21, { children }),
|
|
23037
|
+
editorContainerRef ? /* @__PURE__ */ jsx133(
|
|
23038
|
+
LinkNodePlugin,
|
|
23039
|
+
{
|
|
23040
|
+
onConnectLink: onConnectLink ? onConnectLink : () => Promise.resolve(),
|
|
23041
|
+
getBoundPath: (variables == null ? void 0 : variables.bindVariables) ? (path) => {
|
|
23042
|
+
var _a, _b;
|
|
23043
|
+
return (_b = (_a = variables.bindVariables) == null ? void 0 : _a.call(variables, path)) != null ? _b : path;
|
|
23044
|
+
} : void 0,
|
|
23045
|
+
positioningAnchorEl: editorContainerRef
|
|
23046
|
+
}
|
|
23047
|
+
) : null,
|
|
23048
|
+
/* @__PURE__ */ jsx133(TableSelectionPlugin_default, {})
|
|
23049
|
+
] })
|
|
22829
23050
|
] });
|
|
22830
23051
|
};
|
|
22831
23052
|
|
|
22832
23053
|
// src/components/ParameterInputs/ParameterSelect.tsx
|
|
22833
23054
|
import { forwardRef as forwardRef23 } from "react";
|
|
22834
|
-
import { jsx as
|
|
23055
|
+
import { jsx as jsx134, jsxs as jsxs90 } from "@emotion/react/jsx-runtime";
|
|
22835
23056
|
var ParameterSelect = forwardRef23(
|
|
22836
23057
|
({ defaultOption, options, ...props }, ref) => {
|
|
22837
23058
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
22838
|
-
return /* @__PURE__ */
|
|
23059
|
+
return /* @__PURE__ */ jsx134(ParameterShell, { ...shellProps, children: /* @__PURE__ */ jsx134(ParameterSelectInner, { options, defaultOption, ...innerProps, ref }) });
|
|
22839
23060
|
}
|
|
22840
23061
|
);
|
|
22841
23062
|
var ParameterSelectInner = forwardRef23(
|
|
@@ -22850,10 +23071,10 @@ var ParameterSelectInner = forwardRef23(
|
|
|
22850
23071
|
ref,
|
|
22851
23072
|
...props,
|
|
22852
23073
|
children: [
|
|
22853
|
-
defaultOption ? /* @__PURE__ */
|
|
23074
|
+
defaultOption ? /* @__PURE__ */ jsx134("option", { value: "", children: defaultOption }) : null,
|
|
22854
23075
|
options.map((option) => {
|
|
22855
23076
|
var _a;
|
|
22856
|
-
return /* @__PURE__ */
|
|
23077
|
+
return /* @__PURE__ */ jsx134("option", { value: (_a = option.value) != null ? _a : option.label, children: option.label }, option.label);
|
|
22857
23078
|
})
|
|
22858
23079
|
]
|
|
22859
23080
|
}
|
|
@@ -22863,14 +23084,14 @@ var ParameterSelectInner = forwardRef23(
|
|
|
22863
23084
|
|
|
22864
23085
|
// src/components/ParameterInputs/ParameterTextarea.tsx
|
|
22865
23086
|
import { forwardRef as forwardRef24 } from "react";
|
|
22866
|
-
import { jsx as
|
|
23087
|
+
import { jsx as jsx135 } from "@emotion/react/jsx-runtime";
|
|
22867
23088
|
var ParameterTextarea = forwardRef24((props, ref) => {
|
|
22868
23089
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
22869
|
-
return /* @__PURE__ */
|
|
23090
|
+
return /* @__PURE__ */ jsx135(ParameterShell, { "data-testid": "parameter-textarea", ...shellProps, children: /* @__PURE__ */ jsx135(ParameterTextareaInner, { ref, ...innerProps }) });
|
|
22870
23091
|
});
|
|
22871
23092
|
var ParameterTextareaInner = forwardRef24(({ ...props }, ref) => {
|
|
22872
23093
|
const { id, label, hiddenLabel } = useParameterShell();
|
|
22873
|
-
return /* @__PURE__ */
|
|
23094
|
+
return /* @__PURE__ */ jsx135(
|
|
22874
23095
|
"textarea",
|
|
22875
23096
|
{
|
|
22876
23097
|
css: [input3, textarea2],
|
|
@@ -22884,17 +23105,17 @@ var ParameterTextareaInner = forwardRef24(({ ...props }, ref) => {
|
|
|
22884
23105
|
|
|
22885
23106
|
// src/components/ParameterInputs/ParameterToggle.tsx
|
|
22886
23107
|
import { forwardRef as forwardRef25 } from "react";
|
|
22887
|
-
import { jsx as
|
|
23108
|
+
import { jsx as jsx136, jsxs as jsxs91 } from "@emotion/react/jsx-runtime";
|
|
22888
23109
|
var ParameterToggle = forwardRef25((props, ref) => {
|
|
22889
23110
|
const { shellProps, innerProps } = extractParameterProps(props);
|
|
22890
|
-
return /* @__PURE__ */
|
|
23111
|
+
return /* @__PURE__ */ jsx136(ParameterShell, { ...shellProps, children: /* @__PURE__ */ jsx136(ParameterToggleInner, { ref, ...innerProps }) });
|
|
22891
23112
|
});
|
|
22892
23113
|
var ParameterToggleInner = forwardRef25(
|
|
22893
23114
|
({ children, ...props }, ref) => {
|
|
22894
23115
|
const { id, label } = useParameterShell();
|
|
22895
23116
|
return /* @__PURE__ */ jsxs91("label", { css: inputToggleLabel2, children: [
|
|
22896
|
-
/* @__PURE__ */
|
|
22897
|
-
/* @__PURE__ */
|
|
23117
|
+
/* @__PURE__ */ jsx136("input", { css: toggleInput2, type: props.type, id, ref, ...props }),
|
|
23118
|
+
/* @__PURE__ */ jsx136("span", { css: inlineLabel2, children: label }),
|
|
22898
23119
|
children
|
|
22899
23120
|
] });
|
|
22900
23121
|
}
|
|
@@ -22955,7 +23176,7 @@ var bar = css102`
|
|
|
22955
23176
|
`;
|
|
22956
23177
|
|
|
22957
23178
|
// src/components/ProgressBar/ProgressBar.tsx
|
|
22958
|
-
import { jsx as
|
|
23179
|
+
import { jsx as jsx137 } from "@emotion/react/jsx-runtime";
|
|
22959
23180
|
function ProgressBar({
|
|
22960
23181
|
current,
|
|
22961
23182
|
max,
|
|
@@ -22965,7 +23186,7 @@ function ProgressBar({
|
|
|
22965
23186
|
}) {
|
|
22966
23187
|
const valueNow = Math.min(current, max);
|
|
22967
23188
|
const valuePercentage = max > 0 ? Math.ceil(100 / max * valueNow) : 0;
|
|
22968
|
-
return /* @__PURE__ */
|
|
23189
|
+
return /* @__PURE__ */ jsx137(
|
|
22969
23190
|
"div",
|
|
22970
23191
|
{
|
|
22971
23192
|
css: container3,
|
|
@@ -22976,7 +23197,7 @@ function ProgressBar({
|
|
|
22976
23197
|
"aria-valuemax": max,
|
|
22977
23198
|
"aria-valuenow": valueNow,
|
|
22978
23199
|
...props,
|
|
22979
|
-
children: /* @__PURE__ */
|
|
23200
|
+
children: /* @__PURE__ */ jsx137(
|
|
22980
23201
|
"div",
|
|
22981
23202
|
{
|
|
22982
23203
|
css: [
|
|
@@ -23016,7 +23237,7 @@ var progressListItemStyles = css103`
|
|
|
23016
23237
|
`;
|
|
23017
23238
|
|
|
23018
23239
|
// src/components/ProgressList/ProgressList.tsx
|
|
23019
|
-
import { jsx as
|
|
23240
|
+
import { jsx as jsx138, jsxs as jsxs92 } from "@emotion/react/jsx-runtime";
|
|
23020
23241
|
var ProgressList = ({ inProgressId, items, autoEllipsis, ...htmlProps }) => {
|
|
23021
23242
|
const itemsWithStatus = useMemo8(() => {
|
|
23022
23243
|
const indexOfInProgressItem = items.findIndex(({ id }) => id === inProgressId);
|
|
@@ -23030,8 +23251,8 @@ var ProgressList = ({ inProgressId, items, autoEllipsis, ...htmlProps }) => {
|
|
|
23030
23251
|
return { ...item, status };
|
|
23031
23252
|
});
|
|
23032
23253
|
}, [items, inProgressId]);
|
|
23033
|
-
return /* @__PURE__ */
|
|
23034
|
-
return /* @__PURE__ */
|
|
23254
|
+
return /* @__PURE__ */ jsx138("ol", { css: progressListStyles, ...htmlProps, children: itemsWithStatus.map(({ id, label, status, error, errorLevel }) => {
|
|
23255
|
+
return /* @__PURE__ */ jsx138(
|
|
23035
23256
|
ProgressListItem,
|
|
23036
23257
|
{
|
|
23037
23258
|
status,
|
|
@@ -23090,10 +23311,10 @@ var ProgressListItem = ({
|
|
|
23090
23311
|
return colorPerStatus[status];
|
|
23091
23312
|
}, [status, error, errorLevel]);
|
|
23092
23313
|
return /* @__PURE__ */ jsxs92("li", { css: [progressListItemStyles, statusStyles], children: [
|
|
23093
|
-
/* @__PURE__ */
|
|
23314
|
+
/* @__PURE__ */ jsx138(Tooltip, { title: error != null ? error : "", children: /* @__PURE__ */ jsx138("div", { children: /* @__PURE__ */ jsx138(Icon, { icon, size: 20, iconColor: "currentColor" }) }) }),
|
|
23094
23315
|
/* @__PURE__ */ jsxs92("div", { children: [
|
|
23095
23316
|
children,
|
|
23096
|
-
/* @__PURE__ */
|
|
23317
|
+
/* @__PURE__ */ jsx138("span", { css: { visibility: autoEllipsis && status === "inProgress" && !error ? "visible" : "hidden" }, children: "..." })
|
|
23097
23318
|
] })
|
|
23098
23319
|
] });
|
|
23099
23320
|
};
|
|
@@ -23101,7 +23322,7 @@ var ProgressListItem = ({
|
|
|
23101
23322
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
23102
23323
|
import { css as css106 } from "@emotion/react";
|
|
23103
23324
|
import { CgCheck as CgCheck5 } from "@react-icons/all-files/cg/CgCheck";
|
|
23104
|
-
import { useCallback as useCallback14, useEffect as
|
|
23325
|
+
import { useCallback as useCallback14, useEffect as useEffect25, useMemo as useMemo9, useRef as useRef14, useState as useState22 } from "react";
|
|
23105
23326
|
|
|
23106
23327
|
// src/components/SegmentedControl/SegmentedControl.styles.ts
|
|
23107
23328
|
import { css as css105 } from "@emotion/react";
|
|
@@ -23277,7 +23498,7 @@ var segmentedControlLabelTextStyles = css105`
|
|
|
23277
23498
|
`;
|
|
23278
23499
|
|
|
23279
23500
|
// src/components/SegmentedControl/SegmentedControl.tsx
|
|
23280
|
-
import { jsx as
|
|
23501
|
+
import { jsx as jsx139, jsxs as jsxs93 } from "@emotion/react/jsx-runtime";
|
|
23281
23502
|
var SegmentedControl = ({
|
|
23282
23503
|
name,
|
|
23283
23504
|
options,
|
|
@@ -23292,9 +23513,9 @@ var SegmentedControl = ({
|
|
|
23292
23513
|
currentBackgroundColor = "white",
|
|
23293
23514
|
...props
|
|
23294
23515
|
}) => {
|
|
23295
|
-
const wrapperRef =
|
|
23296
|
-
const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] =
|
|
23297
|
-
const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] =
|
|
23516
|
+
const wrapperRef = useRef14(null);
|
|
23517
|
+
const [isOverflowStartShadowVisible, setIsOverflowStartShadowVisible] = useState22(false);
|
|
23518
|
+
const [isOverflowEndShadowVisible, setIsOverflowEndShadowVisible] = useState22(false);
|
|
23298
23519
|
const onOptionChange = useCallback14(
|
|
23299
23520
|
(event) => {
|
|
23300
23521
|
if (event.target.checked) {
|
|
@@ -23315,7 +23536,7 @@ var SegmentedControl = ({
|
|
|
23315
23536
|
const isIconOnly = useMemo9(() => {
|
|
23316
23537
|
return options.every((option) => option && option.icon && !option.label);
|
|
23317
23538
|
}, [options]);
|
|
23318
|
-
|
|
23539
|
+
useEffect25(() => {
|
|
23319
23540
|
const wrapperElement = wrapperRef.current;
|
|
23320
23541
|
const onScroll = () => {
|
|
23321
23542
|
if (!wrapperElement) {
|
|
@@ -23337,7 +23558,7 @@ var SegmentedControl = ({
|
|
|
23337
23558
|
};
|
|
23338
23559
|
}, []);
|
|
23339
23560
|
return /* @__PURE__ */ jsxs93("div", { css: [segmentedControlRootStyles, { "--background-color": currentBackgroundColor }], children: [
|
|
23340
|
-
/* @__PURE__ */
|
|
23561
|
+
/* @__PURE__ */ jsx139("div", { ref: wrapperRef, css: segmentedControlWrapperStyles, children: /* @__PURE__ */ jsx139(
|
|
23341
23562
|
"div",
|
|
23342
23563
|
{
|
|
23343
23564
|
css: [
|
|
@@ -23353,7 +23574,7 @@ var SegmentedControl = ({
|
|
|
23353
23574
|
}
|
|
23354
23575
|
const text = option.label ? option.label : option.icon ? null : String(option.value);
|
|
23355
23576
|
const isDisabled = disabled2 || option.disabled;
|
|
23356
|
-
return /* @__PURE__ */
|
|
23577
|
+
return /* @__PURE__ */ jsx139(Tooltip, { title: (_a = option.tooltip) != null ? _a : "", children: /* @__PURE__ */ jsx139(
|
|
23357
23578
|
"div",
|
|
23358
23579
|
{
|
|
23359
23580
|
css: segmentedControlItemStyles,
|
|
@@ -23367,7 +23588,7 @@ var SegmentedControl = ({
|
|
|
23367
23588
|
isIconOnly ? segmentedControlLabelIconOnlyStyles : void 0
|
|
23368
23589
|
],
|
|
23369
23590
|
children: [
|
|
23370
|
-
/* @__PURE__ */
|
|
23591
|
+
/* @__PURE__ */ jsx139(
|
|
23371
23592
|
"input",
|
|
23372
23593
|
{
|
|
23373
23594
|
css: segmentedControlInputStyles,
|
|
@@ -23379,10 +23600,10 @@ var SegmentedControl = ({
|
|
|
23379
23600
|
disabled: isDisabled
|
|
23380
23601
|
}
|
|
23381
23602
|
),
|
|
23382
|
-
option.value !== value || noCheckmark ? null : /* @__PURE__ */
|
|
23603
|
+
option.value !== value || noCheckmark ? null : /* @__PURE__ */ jsx139(CgCheck5, { css: segmentedControlLabelCheckStyles, "aria-label": "Selected", size: "1.5em" }),
|
|
23383
23604
|
/* @__PURE__ */ jsxs93("span", { css: segmentedControlLabelContentStyles, children: [
|
|
23384
|
-
!option.icon ? null : /* @__PURE__ */
|
|
23385
|
-
!text || hideOptionText ? null : /* @__PURE__ */
|
|
23605
|
+
!option.icon ? null : /* @__PURE__ */ jsx139(Icon, { icon: option.icon, size: iconSize, iconColor: "currentColor" }),
|
|
23606
|
+
!text || hideOptionText ? null : /* @__PURE__ */ jsx139("span", { css: segmentedControlLabelTextStyles, children: text })
|
|
23386
23607
|
] })
|
|
23387
23608
|
]
|
|
23388
23609
|
}
|
|
@@ -23392,7 +23613,7 @@ var SegmentedControl = ({
|
|
|
23392
23613
|
})
|
|
23393
23614
|
}
|
|
23394
23615
|
) }),
|
|
23395
|
-
/* @__PURE__ */
|
|
23616
|
+
/* @__PURE__ */ jsx139(
|
|
23396
23617
|
"div",
|
|
23397
23618
|
{
|
|
23398
23619
|
css: [
|
|
@@ -23417,7 +23638,7 @@ var skeletonStyles = css107`
|
|
|
23417
23638
|
`;
|
|
23418
23639
|
|
|
23419
23640
|
// src/components/Skeleton/Skeleton.tsx
|
|
23420
|
-
import { jsx as
|
|
23641
|
+
import { jsx as jsx140 } from "@emotion/react/jsx-runtime";
|
|
23421
23642
|
var Skeleton = ({
|
|
23422
23643
|
width = "100%",
|
|
23423
23644
|
height = "1.25rem",
|
|
@@ -23425,7 +23646,7 @@ var Skeleton = ({
|
|
|
23425
23646
|
circle = false,
|
|
23426
23647
|
children,
|
|
23427
23648
|
...otherProps
|
|
23428
|
-
}) => /* @__PURE__ */
|
|
23649
|
+
}) => /* @__PURE__ */ jsx140(
|
|
23429
23650
|
"div",
|
|
23430
23651
|
{
|
|
23431
23652
|
css: [
|
|
@@ -23535,7 +23756,7 @@ var SwitchText = (size) => css108`
|
|
|
23535
23756
|
`;
|
|
23536
23757
|
|
|
23537
23758
|
// src/components/Switch/Switch.tsx
|
|
23538
|
-
import { Fragment as Fragment22, jsx as
|
|
23759
|
+
import { Fragment as Fragment22, jsx as jsx141, jsxs as jsxs94 } from "@emotion/react/jsx-runtime";
|
|
23539
23760
|
var Switch = forwardRef26(
|
|
23540
23761
|
({ label, infoText, toggleText, children, switchSize = "base", ...inputProps }, ref) => {
|
|
23541
23762
|
let additionalText = infoText;
|
|
@@ -23548,12 +23769,12 @@ var Switch = forwardRef26(
|
|
|
23548
23769
|
{
|
|
23549
23770
|
css: [SwitchInputContainer, inputProps.disabled ? SwitchInputDisabled : void 0],
|
|
23550
23771
|
children: [
|
|
23551
|
-
/* @__PURE__ */
|
|
23552
|
-
/* @__PURE__ */
|
|
23772
|
+
/* @__PURE__ */ jsx141("input", { type: "checkbox", css: SwitchInput(switchSize), ...inputProps, ref }),
|
|
23773
|
+
/* @__PURE__ */ jsx141("span", { css: SwitchInputLabel(switchSize), children: label })
|
|
23553
23774
|
]
|
|
23554
23775
|
}
|
|
23555
23776
|
),
|
|
23556
|
-
additionalText ? /* @__PURE__ */
|
|
23777
|
+
additionalText ? /* @__PURE__ */ jsx141("p", { css: SwitchText(switchSize), children: additionalText }) : null,
|
|
23557
23778
|
children
|
|
23558
23779
|
] });
|
|
23559
23780
|
}
|
|
@@ -23598,40 +23819,40 @@ var tableCellHead = css109`
|
|
|
23598
23819
|
`;
|
|
23599
23820
|
|
|
23600
23821
|
// src/components/Table/Table.tsx
|
|
23601
|
-
import { jsx as
|
|
23822
|
+
import { jsx as jsx142 } from "@emotion/react/jsx-runtime";
|
|
23602
23823
|
var Table = React24.forwardRef(
|
|
23603
23824
|
({ children, cellPadding, ...otherProps }, ref) => {
|
|
23604
|
-
return /* @__PURE__ */
|
|
23825
|
+
return /* @__PURE__ */ jsx142("table", { ref, css: table({ cellPadding }), ...otherProps, children });
|
|
23605
23826
|
}
|
|
23606
23827
|
);
|
|
23607
23828
|
var TableHead = React24.forwardRef(
|
|
23608
23829
|
({ children, ...otherProps }, ref) => {
|
|
23609
|
-
return /* @__PURE__ */
|
|
23830
|
+
return /* @__PURE__ */ jsx142("thead", { ref, css: tableHead, ...otherProps, children });
|
|
23610
23831
|
}
|
|
23611
23832
|
);
|
|
23612
23833
|
var TableBody = React24.forwardRef(
|
|
23613
23834
|
({ children, ...otherProps }, ref) => {
|
|
23614
|
-
return /* @__PURE__ */
|
|
23835
|
+
return /* @__PURE__ */ jsx142("tbody", { ref, ...otherProps, children });
|
|
23615
23836
|
}
|
|
23616
23837
|
);
|
|
23617
23838
|
var TableFoot = React24.forwardRef(
|
|
23618
23839
|
({ children, ...otherProps }, ref) => {
|
|
23619
|
-
return /* @__PURE__ */
|
|
23840
|
+
return /* @__PURE__ */ jsx142("tfoot", { ref, ...otherProps, children });
|
|
23620
23841
|
}
|
|
23621
23842
|
);
|
|
23622
23843
|
var TableRow = React24.forwardRef(
|
|
23623
23844
|
({ children, ...otherProps }, ref) => {
|
|
23624
|
-
return /* @__PURE__ */
|
|
23845
|
+
return /* @__PURE__ */ jsx142("tr", { ref, css: tableRow, ...otherProps, children });
|
|
23625
23846
|
}
|
|
23626
23847
|
);
|
|
23627
23848
|
var TableCellHead = React24.forwardRef(
|
|
23628
23849
|
({ children, ...otherProps }, ref) => {
|
|
23629
|
-
return /* @__PURE__ */
|
|
23850
|
+
return /* @__PURE__ */ jsx142("th", { ref, css: tableCellHead, ...otherProps, children });
|
|
23630
23851
|
}
|
|
23631
23852
|
);
|
|
23632
23853
|
var TableCellData = React24.forwardRef(
|
|
23633
23854
|
({ children, ...otherProps }, ref) => {
|
|
23634
|
-
return /* @__PURE__ */
|
|
23855
|
+
return /* @__PURE__ */ jsx142("td", { ref, ...otherProps, children });
|
|
23635
23856
|
}
|
|
23636
23857
|
);
|
|
23637
23858
|
|
|
@@ -23643,7 +23864,7 @@ import {
|
|
|
23643
23864
|
TabProvider as AriakitTabProvider,
|
|
23644
23865
|
useTabStore as useAriakitTabStore
|
|
23645
23866
|
} from "@ariakit/react";
|
|
23646
|
-
import { useCallback as useCallback15, useEffect as
|
|
23867
|
+
import { useCallback as useCallback15, useEffect as useEffect26, useMemo as useMemo10 } from "react";
|
|
23647
23868
|
|
|
23648
23869
|
// src/components/Tabs/Tabs.styles.ts
|
|
23649
23870
|
import { css as css110 } from "@emotion/react";
|
|
@@ -23671,7 +23892,7 @@ var tabButtonGroupStyles = css110`
|
|
|
23671
23892
|
`;
|
|
23672
23893
|
|
|
23673
23894
|
// src/components/Tabs/Tabs.tsx
|
|
23674
|
-
import { jsx as
|
|
23895
|
+
import { jsx as jsx143 } from "@emotion/react/jsx-runtime";
|
|
23675
23896
|
var useCurrentTab = () => {
|
|
23676
23897
|
const context = useAriakitTabStore();
|
|
23677
23898
|
if (!context) {
|
|
@@ -23703,28 +23924,28 @@ var Tabs = ({
|
|
|
23703
23924
|
},
|
|
23704
23925
|
[onSelectedIdChange, useHashForState]
|
|
23705
23926
|
);
|
|
23706
|
-
|
|
23927
|
+
useEffect26(() => {
|
|
23707
23928
|
if (selected && selected !== tab.getState().activeId) {
|
|
23708
23929
|
tab.setSelectedId(selected);
|
|
23709
23930
|
}
|
|
23710
23931
|
}, [selected, tab]);
|
|
23711
|
-
return /* @__PURE__ */
|
|
23932
|
+
return /* @__PURE__ */ jsx143(AriakitTabProvider, { store: tab, setSelectedId: onTabSelect, children });
|
|
23712
23933
|
};
|
|
23713
23934
|
var TabButtonGroup = ({ children, ...props }) => {
|
|
23714
|
-
return /* @__PURE__ */
|
|
23935
|
+
return /* @__PURE__ */ jsx143(AriakitTabList, { ...props, css: tabButtonGroupStyles, children });
|
|
23715
23936
|
};
|
|
23716
23937
|
var TabButton = ({
|
|
23717
23938
|
children,
|
|
23718
23939
|
id,
|
|
23719
23940
|
...props
|
|
23720
23941
|
}) => {
|
|
23721
|
-
return /* @__PURE__ */
|
|
23942
|
+
return /* @__PURE__ */ jsx143(AriakitTab, { type: "button", id, ...props, css: tabButtonStyles, children });
|
|
23722
23943
|
};
|
|
23723
23944
|
var TabContent = ({
|
|
23724
23945
|
children,
|
|
23725
23946
|
...props
|
|
23726
23947
|
}) => {
|
|
23727
|
-
return /* @__PURE__ */
|
|
23948
|
+
return /* @__PURE__ */ jsx143(AriakitTabPanel, { ...props, children });
|
|
23728
23949
|
};
|
|
23729
23950
|
|
|
23730
23951
|
// src/components/Validation/StatusBullet.styles.ts
|
|
@@ -23807,7 +24028,7 @@ var StatusDeleted = css111`
|
|
|
23807
24028
|
`;
|
|
23808
24029
|
|
|
23809
24030
|
// src/components/Validation/StatusBullet.tsx
|
|
23810
|
-
import { jsx as
|
|
24031
|
+
import { jsx as jsx144 } from "@emotion/react/jsx-runtime";
|
|
23811
24032
|
var StatusBullet = ({
|
|
23812
24033
|
status,
|
|
23813
24034
|
hideText = false,
|
|
@@ -23827,7 +24048,7 @@ var StatusBullet = ({
|
|
|
23827
24048
|
Deleted: StatusDeleted
|
|
23828
24049
|
};
|
|
23829
24050
|
const statusSize = size === "base" ? StatusBulletBase : StatusBulletSmall;
|
|
23830
|
-
return /* @__PURE__ */
|
|
24051
|
+
return /* @__PURE__ */ jsx144(
|
|
23831
24052
|
"span",
|
|
23832
24053
|
{
|
|
23833
24054
|
role: "status",
|